Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/themes/garland/
Upload File :
Current File : /var/www/cesa.co.za/themes/garland/inc_scroller.htm

<html>
<body>
<script>
var pic = new Array();
function banner(name, width){
	this.name = name;
	this.width = width;
	this.link = name;
}

pic[0] = new banner('/images/scroller/pics.jpg',154);
pic[1] = new banner('/images/scroller/pics1.jpg',93);
pic[2] = new banner('/images/scroller/pics2.jpg',90);
pic[3] = new banner('/images/scroller/pics3.jpg',90);
pic[4] = new banner('/images/scroller/pics4.jpg',180);
pic[5] = new banner('/images/scroller/pics5.jpg',180);
pic[6] = new banner('/images/scroller/pics6.jpg',180);
pic[7] = new banner('/images/scroller/pics7.jpg',160);
pic[8] = new banner('/images/scroller/pics8.jpg',160);
pic[9] = new banner('/images/scroller/pics9.jpg',160);
pic[10] = new banner('/images/scroller/pics10.jpg',160);
pic[11] = new banner('/images/scroller/pics11.jpg',160);
pic[12] = new banner('/images/scroller/pics12.jpg',160);
pic[13] = new banner('/images/scroller/pics13.jpg',167);

var speed = 50;

var kk = pic.length;
var ii;
var hhh;
var nnn;
var myInterval;
var myPause;
var mode = 0;

var imgArray = new Array(kk);
var myLeft = new Array(kk);

for (ii=0;ii<kk;ii++){
	imgArray[ii] = new Image();
	imgArray[ii].src = pic[ii].name;
	imgArray[ii].width = pic[ii].width;

	hhh=0 ;
	for (nnn=0;nnn<ii;nnn++){
		hhh=hhh+pic[nnn].width;
	}
	myLeft[ii] = hhh;
}

function ready(){
	for (ii=0;ii<kk;ii++){ 
		if (document.images[ii].complete == false) {
			return false;	
			break;
		}
	}
return true;
}


function startScrolling() {
	if (ready() == true){		
		window.clearInterval(myPause);
		myInterval = setInterval("autoScroll()",speed);
	}
}	
	

function autoScroll(){
	for (ii=0;ii<kk;ii++){
		myLeft[ii] = myLeft[ii] - 1;
		
	if (myLeft[ii] == -(pic[ii].width)){
		hhh = 0;
		for (nnn=0;nnn<kk;nnn++){
			if (nnn!=ii){
				hhh = hhh + pic[nnn].width;
			}			
		}
		myLeft[ii] =  hhh;
	}
		
				
		document.images[ii].style.left = myLeft[ii];
	}
	mode = 1;
}

function stop(){
	if (mode == 1){
		window.clearInterval(myInterval);
	}
	if (mode == 0){
		window.clearInterval(myPause);
	}	
}

function go(){
	if (mode == 1){
		myInterval = setInterval("autoScroll()",speed);
	}
	if (mode == 0){
		myPause = setInterval("startScrolling()",3000);
	}	
}




// create scroller
	for (ii=0;ii<kk;ii++){
		document.write('<a href = ' + pic[ii].link + ' target="_blank" ><img space=0 hspace=0 vspace=0 border=0 height=120 style=position:absolute;top:0;left:' + myLeft[ii]  + '; src=' + pic[ii].name + ' onMouseOver=stop() onMouseOut=go()></a>');
	}
	myPause = setInterval("startScrolling()",3000);
</script>
</body>
</html>