﻿ // set image list     
 images = new Array();  
	 
function init(){
//nothing right now
}


function show(img) {
if(images[img]) document.logo.src=images[img];
}

//preloader
function preloader() 
{
     // counter     
	 var i = 0;
     // create object     
	 imageObj = new Image();
   
	 images[0]="images/logo/logo.gif";
	 images[1]="images/logo/logo_2.gif";
	 images[2]="images/logo/logo_1.gif";
	 images[3]="images/logo/logo_lrw2005.gif";
	 images[4]="images/logo/logo_su.gif";
	 images[5]="images/logo/logo_cd.gif";
	 images[6]="images/logo/logo_wc.gif";
	 images[7]="images/logo/logo_cac.gif";
     // start preloading     
	 for(i=0; i<=7; i++)      {          
	 imageObj.src=images[i];
	      }

} 

// * Dependencies * 
// this function requires the following snippets:
// JavaScript/images/switchImage
//
// BODY Example:
// <body onLoad="mySlideShow1.play(); mySlideShow2.play();">
// <img src="originalImage1.gif" name="slide1">
// <img src="originalImage2.gif" name="slide2">
//
// SCRIPT Example:
// var mySlideList2 = ['image4.gif', 'image5.gif', 'image6.gif'];
// var mySlideShow2 = new SlideShow(mySlideList2, 'slide2', 1000, "mySlideShow2");
function SlideShow(slideList, image, speed, name)          
{
  this.slideList = slideList;
  this.image = image;
  this.speed = speed;
  this.name = name;
  this.current = -1;
  this.timer = 0;
}
SlideShow.prototype.play = SlideShow_play;  
function SlideShow_play()       
{
  with(this)
  {
    if(current++ == slideList.length-1) current = 0;
    switchImage(image, slideList[current]);
    clearTimeout(timer);
    timer = setTimeout(name+'.play()', speed);
  }
}
function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}



