var ie = false;
var ns6 = false;
var ns = false;
var opera = false;
if (eval(document.layers)) { ns=true; }
else {
	if (eval(document.all)) { ie=true; if (navigator.userAgent.indexOf('Opera')!=-1) opera=true;}
		else {
			if (eval(document.getElementById)) { ns6=true;}
			}
	}
// Hide and Show menu

//finds and return <DIV> object by given name
function Layer(layerName) {
return (ns6)?(document.getElementById(layerName)):(document.all(layerName));
}

//flips the state from Off to On and vice versa
function flipState(state) {
return (state=='On')?('Off'):('On');
}

//event routing and handling for NS6
function stopNSbubble (e){
if (e) e.stopPropagation();
}
//flips menu On/Off and make appropriate changes in onClick function
function flip(layer,state,e){
layer.innerHTML=Layer(layer.id+state).innerHTML;
layer.onclick=new Function("flip(this,'"+flipState(state)+"');return false;");
}

//render initial Layer with appropriate data
function CreateLayer(layer){
document.write('<div id="'+layer.id+'"></div>');
Layer(layer.id).onclick=new Function("flip(this,'"+flipState(layer.state)+"');return false;");
Layer(layer.id).innerHTML=Layer(layer.id+layer.state).innerHTML;
}

//creates Menu
function Menu(menuName) {
this.id=menuName;
this.state;
this.create=new Function("CreateLayer(this)");
}