var SlideShowSpeed = 10000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this


Picture[1]  = SITE_URL+'images/pre-primary.jpg';
Picture[2]  = SITE_URL+'images/primary.jpg';
Picture[3]  = SITE_URL+'images/highschool.jpg';
//Picture[4]  = SITE_URL+'images/banner.jpg';


var tss;
var iss;
var kss;
var pause=0;
var jss = 0;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];
}

function runSlideShow(){
	if(!pause){
		
		if (jss<pss){
			jss=jss+1;
		}	else {
			jss=1
		}
		
		if (document.all){
			document.images.PictureBox.style.filter="blendTrans(duration=2)";
			document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
			document.images.PictureBox.filters.blendTrans.Apply();
		}

		if(jss!=1){
			jss1 = jss-1;
			//document.getElementById("img"+jss1).src="images/"+jss1+".jpg";
			$('#num' + +jss1).removeClass("numbersselect");
		}else{
			//document.getElementById("img"+pss).src="images/"+pss+".jpg";
			$('#num' + +pss).removeClass("numbersselect");
		}
		//document.getElementById("img"+jss).src="images/"+jss+"_up.jpg";
		$('#num' + +jss).addClass("numbersselect");
		document.images.PictureBox.src = preLoad[jss].src;
		if (document.all) document.images.PictureBox.filters.blendTrans.Play();
		tss = setTimeout('runSlideShow()', SlideShowSpeed);
	}
}

//Click on button
function btnClick(btnord){
	
	for (kss = 1; kss < 4; kss++){
		//document.getElementById("img"+kss).src="images/"+kss+".jpg";
		$('#num' + kss).removeClass("numbersselect");
	}
	//document.getElementById("img"+btnord).src="images/"+btnord+"_up.jpg";
	$('#num' + btnord).addClass("numbersselect");
	document.images.PictureBox.src = preLoad[btnord].src;
	jss = btnord;
}

 $(document).ready(function(){
 	runSlideShow();
 });
