var type = "IE";	//Variable used to hold the browser name

BrowserSniffer();

function BrowserSniffer() {
	if (navigator.userAgent.indexOf("Opera")!=-1 && document.getElementById) type="OP";		//Opera
	else if (document.all) type="IE";														//Internet Explorer e.g. IE4 upwards
	else if (document.layers) type="NN";													//Netscape Communicator 4
	else if (!document.all && document.getElementById) type="MO";							//Mozila e.g. Netscape 6 upwards
	else type = "IE";		//I assume it will not get here
		
}

function ChangeContent(id, str) {
	if (type=="IE") {
		document.all[id].innerHTML = str;
	}
	if (type=="NN") { 
		document.layers[id].document.open();
		document.layers[id].document.write(str);
		document.layers[id].document.close();
	}
	if (type=="MO" || type=="OP") {
		document.getElementById(id).innerHTML = str;
	}
}

function ChangeLayerBgColor(id, color){
	if (type=="IE") document.all[id].style.backgroundColor=color;
	if (type=="NN") document.layer['id'].bgColor=color;
	if (type=="MO" || type=="OP") document.getElementById(id).style.backgroundColor=color;
}

function ShowHideLayer(id){
	if (type=="IE") {
		if (eval("document.all." + id + ".style").display == 'block')
				action = 'none'; 
		else
			action = 'block'; 
		
		eval("document.all." + id + ".style.display='" + action + "'");
	}
	
	if (type=="NN") {
		if (eval("document.").visibility == 'block')
				action = 'none'; 
		else
			action = 'block'; 
		
		eval("document." + id + ".visibility='" + action + "'");
	
	}
	if (type=="MO" || type=="OP") {
		if (eval("document.getElementById('" + id + "').style").display == 'block')
				action = 'none'; 
		else
			action = 'block'; 
	
		eval("document.getElementById('" + id + "').style.display='" + action + "'");
	}
}



