 //declaring necessary local variables
 var img = new Array(16); //array to hold the images
 var start = null; //start pointer
 var counter = 3; //counts the image sequences
 var delayTime = null; //user defined
 var sponsors = 7;


 if(document.images) //pre-load all the images

 {
   /* change the looping condition if you want
      to add or remove images. Do not load too
      many images, it will slow down the program's
      loading time [e.g. 30 or above images] */
   for(i = 1; i <= sponsors; i++)
   {
     img[i] = new Image();
     img[i].src = "/images/sponsors/sponsor" + i + ".gif";
   }
 }

 //function for getting the user defined delay time
 function getDelayTime(dlTime)
 {
   var temp = parseInt(dlTime);
   if(temp != NaN)
    delayTime = temp * 1000;
   else
    delayTime = 4000;
 }

 //function for changing the images
 function anim()
 {
   counter++;
   document.sponsorimage.src = img[counter].src;

   if(counter == sponsors)
    counter = 0; //sets the counter value to 0
 }

 //function for starting the slide show
 function slide()
 {
   getDelayTime(document.form1.delay.value);
   with(document.form1)
   {
     start = setInterval("anim()", delayTime);
   }
 }

