function HideLayers(totalrecords) {
	var i,v,obj;
	
	for (i=1; i<(totalrecords + 1); i++) {
		obj = document.getElementById("this" + i);
		if (obj.style) { 
			obj=obj.style; 
			v=(v=='hide')?'none':(v='hide')?'none':v; 
		}
    obj.display=v; 		
		}
	
}

function ShowLayer(toshow) {
	var v,obj;	
	obj = document.getElementById(toshow);
		if (obj.style) { 
			obj=obj.style; 
			v=(v=='show')?'block':(v='show')?'block':v; 
		}
    obj.display=v; 
}

var thisnumber,totalrecords,timeout,toshow,nexttime;
	thisnumber = 1;
	
	
	function addnumber(totalrecords,timeout) {
		thisnumber = thisnumber + 1;
		if (thisnumber == (totalrecords + 1) ) {
			thisnumber = 1;
		}
		HideLayers(totalrecords);
		toshow = "this" + thisnumber;
		ShowLayer(toshow);
		nexttime = "addnumber(" + totalrecords + ", " + timeout + ")";
		setTimeout(nexttime, timeout);
		}
