var totalImages = 0;
var imageShowing = 1;
var layerRef=""; var styleSwitch="";

//Default browsercheck, added to all scripts!
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()


function showNextLayer(layer)
{
	totalImages = layer;
	
	var showThisImage = imageShowing + 1;
	if (showThisImage > totalImages){
		showThisImage = 1;
	}

hideLayer(eval('"content' + imageShowing + '"'));
showLayer(eval('"content' + showThisImage + '"'));
imageShowing = showThisImage;
}

function showPrevLayer(layer)
{
	totalImages = layer;
	
	var showThisImage = imageShowing - 1;
	if (showThisImage == 0){
		showThisImage = 1;
	}

hideLayer(eval('"content' + imageShowing + '"'));
showLayer(eval('"content' + showThisImage + '"'));
imageShowing = showThisImage;
}


//Shows the div
function showLayer(div){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?document[div]:0;
	obj.visibility='visible'

}

//Hides the div
function hideLayer(div){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?document[div]:0;
	obj.visibility='hidden'

}

function showNext(layer,total)
{
var NewImage = layer;
var totalImages = total;
	if (NewImage > totalImages){
		NewImage = 1;
	}

hideLayer(eval('"content' + imageShowing + '"'));
showLayer(eval('"content' + NewImage + '"'));
imageShowing = NewImage;
}

