

function show(object) {

    if (document.getElementById && document.getElementById(object) != null)

         node = document.getElementById(object).style.display='block';

    else if (document.layers && document.layers[object] != null)

        document.layers[object].display = 'block';

    else if (document.all)

        document.all[object].style.display = 'block';    

}



function hide(object) {

    if (document.getElementById && document.getElementById(object) != null)

         node = document.getElementById(object).style.display='none';

    else if (document.layers && document.layers[object] != null)

        document.layers[object].display = 'none';

    else if (document.all)

         document.all[object].style.display = 'none';

}



function swapImg(imgIndex) {



  var imgSrc = thumbs[imgIndex];

  imgSrc = '/' + tourDir + '/thumbs/' + imgSrc + '.jpg';	



  // only set the image src if we're not already displaying the specified image.

  if (document.vtpic.src.indexOf(imgSrc) == -1) {

    shownImg = imgSrc;    

    document.vtpic.src=imgSrc;

    slideshow_index = imgIndex;

  }

  hide('panCell');

  show('imgCell');  

}



// called when you click on a thumbnail. stops the slideshow and swaps out the image 

function swapThumb(img) {

  slideshow_stop();

  swapImg(thumbToIndex[img]);

}







// some slideshow functions and variables

var slideshow_on = false;

var slideshow_index = 0;

var slideshow_speed = 5000;



function slideshow_start() { 

  slideshow_on = true;

  //setTimeout('slideshow_go()',slideshow_speed);  

  slideshow_go();

}



function slideshow_go() {

  //alert('slideshow next');

  if (slideshow_on) {

    // get next image

    slideshow_index = slideshow_index + 1;

    if (slideshow_index == thumbs.length) {

      slideshow_index = 0;

    }    

    // change out the image

    swapImg(slideshow_index);

    setTimeout('slideshow_go()',slideshow_speed);

  }

  

}



function slideshow_stop() {

  slideshow_on = false;

}



// stops the slideshow and loads the next image

function slideshow_next() {

  slideshow_stop();

  slideshow_index = slideshow_index + 1;

  if (slideshow_index == thumbs.length) {

    slideshow_index = 0;

  }    

  // change out the image

  swapImg(slideshow_index);  

}



// stops the slideshow and loads the previous image

function slideshow_previous() {

  slideshow_stop();

  slideshow_index = slideshow_index - 1;

  if (slideshow_index == -1) {

    slideshow_index = thumbs.length -1;

  }    

  // change out the image

  swapImg(slideshow_index);  

}


