
var layer = new String();
var style = new String();
var type = new String();
var pages = 5;//number of pages in loop
var num = 1;
var div;
var divSpeed = 700;

function checkBrowser(){
	if (navigator.userAgent.indexOf("Opera")!=-1
    && document.getElementById) type="OP"; 
	
	if (document.all) type="IE"; 

	if (document.layers) type="NN"; 
	
	if (!document.all && document.getElementById) type="MO";
}

function changeDiv(layerRef, state, action){
	checkBrowser();
	for(i=1; i<pages+1; i++)
	{
		div = "div"+i;		
		if (type=="IE") eval("document.all." + div + ".style.visibility='hidden'");		
		if (type=="NN") eval("document." + div + ".visibility='hidden'");
  		if (type=="MO" || type=="OP") 
    		eval("document.getElementById('" + div + "').style.visibility='hidden'");
	}	
	
	if (type=="IE") eval("document.all." + layerRef + ".style.visibility='" + state + "'");
  	if (type=="NN") eval("document." + layerRef + ".visibility='" + state + "'");
  	if (type=="MO" || type=="OP") 
   		eval("document.getElementById('" + layerRef + "').style.visibility='" + state + "'");
		
	if(action == 'Stop'){
		running = false;
	}
}



var countDownInterval=5;
var running = true;

var countDownTime=countDownInterval+1;
function countDown(){
	if(running){
		countDownTime--;
		if (countDownTime <=0){
			countDownTime=countDownInterval;
			clearTimeout(counter);
			if(num<=pages){
				changeDiv("div"+num, "visible");
				num++;
			} else {
				changeDiv('div1', "visible");
				num = 2;
			}
		}
		counter=setTimeout("countDown()",divSpeed);
	}
}

if (document.all || document.getElementById){
	countDown();
}
else{	
	window.onload=countDown();
}


function mouseover(id){
	if (id ='1') {
		running = false;
	}

}

function mouseout(){
	running = true;
	counter=setTimeout("countDown()",divSpeed);
}








