﻿hdnImageText1  = document.getElementById(hiddenImageText1);
hdnLinkURL1  = document.getElementById(hiddenLinkURL1);
hdnSlideSpeed1 = document.getElementById(SlideSpeed1);
hdnSlideEffect1 = document.getElementById(SlideEffect1);


var s1 = hdnImageText1.value.split(",");
var l1 = hdnLinkURL1.value.split(",");



// The list of images to display in the slideshow
//creating a array of the image object
var image1=new Array(s1)
                
//variable that will increment through the images
var num1=0

// set the delay between images
var timeDelay1
 
//preload the images in the cache so that the images load faster
//create new instance of images in memory 

var imagePreload1=new Array()
var link1=new Array()
for (i=0;i<s1.length;i++)
{
   imagePreload1[i]=new Image()
// set the src attribute
imagePreload1[i].src=s1[i]
}


function image_effects1()
{
//     var selobj = document.getElementById('slidehow_transition');
//     var selIndex = selobj.selectedIndex;
     //set the transition to the number selected in the list
      if(navigator.appName == "Microsoft Internet Explorer")
    {
     document.getElementById('slideShow1').filters.revealTrans.Transition=hdnSlideEffect1.value
     document.getElementById('slideShow1').filters.revealTrans.apply()
     document.getElementById('slideShow1').filters.revealTrans.play()
    }
  
}





//for automatic Slideshow of the Images
function slideshow_automatic1()
{ 
    if (num1<s1.length)
     {
     
       num1++
       //if last image is reached,display the first image
       if (num1==s1.length) 
       num1=0
       image_effects1()
       //sets the timer value to 4 seconds,we can create a timing loop by using the setTimeout method
       timeDelay=setTimeout("slideshow_automatic1()",hdnSlideSpeed1.value) 
       //document.images.slideShow.src=s[num]   
       document.getElementById('slideShow1').src=s1[num1]
       //window.open(l1[num1])
      
       document.getElementById('SlideLink1').href = l1[num1]    
       
       
     }
 
}
