

// The list of images to display in the slideshow
//creating a array of the image object
var image=new Array("http://www.yigotours.com/slide/1.jpg",
                                           "http://www.yigotours.com/slide/11.jpg",
"http://www.yigotours.com/slide/21.jpg",
"http://www.yigotours.com/slide/31.jpg",
"http://www.yigotours.com/slide/41.jpg",
"http://www.yigotours.com/slide/2.jpg",
"http://www.yigotours.com/slide/22.jpg",
"http://www.yigotours.com/slide/12.jpg",
"http://www.yigotours.com/slide/32.jpg",
"http://www.yigotours.com/slide/42.jpg",

"http://www.yigotours.com/slide/3.jpg",
"http://www.yigotours.com/slide/13.jpg",
"http://www.yigotours.com/slide/23.jpg",
"http://www.yigotours.com/slide/33.jpg",
"http://www.yigotours.com/slide/43.jpg",

"http://www.yigotours.com/slide/4.jpg",
"http://www.yigotours.com/slide/14.jpg",
"http://www.yigotours.com/slide/24.jpg",
"http://www.yigotours.com/slide/34.jpg",
"http://www.yigotours.com/slide/44.jpg",

"http://www.yigotours.com/slide/5.jpg",
"http://www.yigotours.com/slide/15.jpg",
"http://www.yigotours.com/slide/25.jpg",
"http://www.yigotours.com/slide/35.jpg",
"http://www.yigotours.com/slide/45.jpg",

"http://www.yigotours.com/slide/6.jpg",
"http://www.yigotours.com/slide/16.jpg",
"http://www.yigotours.com/slide/26.jpg",
"http://www.yigotours.com/slide/36.jpg",
"http://www.yigotours.com/slide/46.jpg",

"http://www.yigotours.com/slide/7.jpg",
"http://www.yigotours.com/slide/17.jpg",
"http://www.yigotours.com/slide/27.jpg",
"http://www.yigotours.com/slide/37.jpg",
"http://www.yigotours.com/slide/47.jpg",

"http://www.yigotours.com/slide/8.jpg",
"http://www.yigotours.com/slide/18.jpg",
"http://www.yigotours.com/slide/28.jpg",
"http://www.yigotours.com/slide/38.jpg",
"http://www.yigotours.com/slide/48.jpg",

"http://www.yigotours.com/slide/9.jpg",
"http://www.yigotours.com/slide/19.jpg",
"http://www.yigotours.com/slide/29.jpg",
"http://www.yigotours.com/slide/39.jpg",
"http://www.yigotours.com/slide/49.jpg",

"http://www.yigotours.com/slide/10.jpg",
"http://www.yigotours.com/slide/20.jpg",
          "http://www.yigotours.com/slide/30.jpg",
"http://www.yigotours.com/slide/40.jpg"
 
                    )
                
//variable that will increment through the images
var num=0

// set the delay between images
var timeDelay
 
//preload the images in the cache so that the images load faster
//create new instance of images in memory 

var imagePreload=new Array()
for (i=0;i<image.length;i++)
{
   imagePreload[i]=new Image()
// set the src attribute
imagePreload[i].src=image[i]
}


function image_effects()
{

     var selobj = document.getElementById('slidehow_transition');
     var selIndex = 3;
     //set the transition to the number selected in the list
     slideShow.filters.revealTrans.Transition=selIndex
     slideShow.filters.revealTrans.apply()
     slideShow.filters.revealTrans.play()
  
}

//function to get the previous image in the array
function previous_image()
{  
  //code to execute only when the automatic slideshow is disabled 
   if (slideshow.checked==false)
   {
    if (num>0)
    {
       num--
       image_effects()
       //set the SRC attribute to let the browser load the preloaded images 
       document.images.slideShow.src=image[num] 
     }
    if (num==0)
    {  //if first image is displayed
       num=image.length
       num--
       image_effects()
       document.images.slideShow.src=image[num] 
    } 
  }  
}

//function to get the next image in the array
function next_image()
{ 
  //code to execute only when the automatic slideshow is disabled 
  if (slideshow.checked==false)
  {
    if (num<image.length)
    {
       num++
       //if last image is reached,display the first image
       if (num==image.length) 
       num=0
       image_effects()
        //set the SRC attribute to let the browser load the preloaded images 
       document.images.slideShow.src=image[num]   
    }
  } 
}

//for automatic Slideshow of the Images
function slideshow_automatic()
{ 

    if (num<image.length)
     {
       num++
       //if last image is reached,display the first image
       if (num==image.length) 
       num=0
       image_effects()
       //sets the timer value to 10 seconds,we can create a timing loop by using the setTimeout method
       timeDelay=setTimeout("slideshow_automatic()",10000) 
       document.images.slideShow.src=image[num]   
     }
    
   
}



