theimage = new Array();

// The dimensions of ALL the images should be the same or some of them may look stretched or reduced in Netscape 4.
// Format: theimage[...]=[image URL, link URL, name/description]
theimage[0]=["http://www.vectron.com.au/images/testimonial/GV-hotel.gif", "", "GV hotel"];
theimage[1]=["http://www.vectron.com.au/images/testimonial/hoppers.gif", "", "Hoppers Club"];
theimage[2]=["http://www.vectron.com.au/images/testimonial/naked-for-satan.gif", "", "Naked for Satan Bar and Restaurant"];
theimage[3]=["http://www.vectron.com.au/images/testimonial/giorgios.gif", "", "Giorgios"];
theimage[4]=["http://www.vectron.com.au/images/testimonial/melbourne-pub-group.gif", "", "Melbourne Pub Group"];
theimage[5]=["http://www.vectron.com.au/images/testimonial/great-eastern-hotel.gif", "", "Great Eastern Hotel"];
theimage[6]=["http://www.vectron.com.au/images/testimonial/boheme.gif", "", "Boheme"];
theimage[7]=["http://www.vectron.com.au/images/testimonial/foodworks.gif", "", "Foodworks"];
theimage[8]=["http://www.vectron.com.au/images/testimonial/royal-saxon.gif", "", "Royan Saxon"];
theimage[9]=["http://www.vectron.com.au/images/testimonial/cookie.gif", "", "Cookie"];
theimage[10]=["http://www.vectron.com.au/images/testimonial/sanchurro.gif", "", "San Churro"];

///// Plugin variables
 
playspeed=5000;// The playspeed determines the delay for the "Play" button in ms
dotrans=1; // if value = 1 then there are transitions played in IE
transtype='blendTrans';// 'blendTrans' or 'revealtrans'
transattributes='23';// duration=seconds,transition=#<24
//#####
//key that holds where in the array currently are
i=0;


//###########################################
window.onload=function(){

	//preload images into browser
	preloadSlide();

	//set transitions
	GetTrans();

	//set the first slide
	SetSlide(0);

	//autoplay
	PlaySlide();
}

//###########################################
function SetSlide(num) {
	//too big
	i=num%theimage.length;
	//too small
	if(i<0) i=theimage.length-1;

	//switch the image
	if(document.all&&!window.opera&&dotrans==1)eval('document.images.imgslide.filters.'+transtype+'.Apply()')
	document.images.imgslide.src=theimage[i][0];
	if(document.all&&!window.opera&&dotrans==1)eval('document.images.imgslide.filters.'+transtype+'.Play()')

}


//###########################################
function PlaySlide() {
	if (!window.playing) {
		PlayingSlide(i);
		if(document.slideshow.play){
			document.slideshow.play.value="   Stop   ";
		}
	}
	else {
		playing=clearTimeout(playing);
		if(document.slideshow.play){
			document.slideshow.play.value="   Play   ";
			
		}
	}
	// if you have to change the image for the "playing" slide
	if(document.images.imgPlay){
		setTimeout('document.images.imgPlay.src="'+imgStop+'"',1);
		imgStop=document.images.imgPlay.src
	}
}


//###########################################
function PlayingSlide(num) {

	playing=setTimeout('PlayingSlide(i+1);SetSlide(i+1);', playspeed);
	
	if(num == 4 ) num = 0;
	
	for	(block = 0; block < 4; block++) {
		nav_blocks = document.getElementById("nav" + block);
		//alert("num:" + num + "block:" + block);
		
		if(num == block) {
			nav_blocks.style.backgroundColor = "#FFFFFF";
		} else {	//alert(i);
			nav_blocks.style.backgroundColor = "#FFFFFF";
		}
	}

	
}


//###########################################
//desc: picks the transition to apply to the images
function GetTrans() {
	//si=document.slideshow.trans.selectedIndex;

		if((document.slideshow.trans && document.slideshow.trans.selectedIndex == 0) || (!document.slideshow.trans && dotrans==0)){
		dotrans=0;
	}
	else if ((document.slideshow.trans && document.slideshow.trans.selectedIndex == 1) || (!document.slideshow.trans && transtype == 'blendTrans')){
		dotrans=1;
		transtype='blendTrans';
		document.imgslide.style.filter = "blendTrans(duration=1,transition=1)";
	}else{
		dotrans=1;
		transtype='revealtrans';
		if(document.slideshow.trans) transattributes=document.slideshow.trans[document.slideshow.trans.selectedIndex].value;
		document.imgslide.style.filter = "revealTrans(duration=1,transition=" +transattributes+ ")";
	}

}
//###########################################
function preloadSlide() {
	for(k=0;k<theimage.length;k++) {
		theimage[k][0]=new Image().src=theimage[k][0];
	}
}

