///////////////////////////////// write styles for ns /////////////////////

style = "<STYLE>\n";
style += "DIV {\n";
style += "	font-family : "+font_family+";\n";
style += "}\n\n";
style += ".normal {\n";
style += "	color: "+font_color+";\n";
style += "	font-size : "+font_size+";\n";
style += "	text-decoration : "+font_decor+";\n";
style += "	font-weight : "+font_style+";\n";
style += "	padding: "+menu_padding+";\n";
style += "}\n\n";
style += ".highlight {\n";
style += "	color: "+font_hl_color+";\n";
style += "	font-size : "+font_size+";\n";
style += "	text-decoration : "+font_decor+";\n";
style += "	font-weight : "+font_style+";\n";
style += "	padding: "+menu_padding+";\n";
style += "}\n";
style += "<\/STYLE>";

document.write(style);

//////////////////////////////////////////////////////////////////////////

_d = document; s = "";

var ns4 = (navigator.appName.indexOf("Netscape")>=0 && parseInt(navigator.appVersion) < 4.99)? true : false;
//var ie4 = (_d.all && !_d.getElementById)? true : false;
//var ie5 = (_d.all && document.getElementById)? true : false;
var ns6 = (_d.getElementById && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var mac= (navigator.appVersion.indexOf("Mac")!=-1)?true:false

BLANK_GIF = "b.gif";

if (ns4) {
	i = 0;
	for (var j=0; j < menu_items.length; j++){
		text = menu_items[j];
		link = menu_items[++j];
		_btop = menu_y + i * (menu_height - 1);
		_top = _btop + 1;
		s += "<layer id='menu_"+i+"_b' z-index='2' left="+menu_x+" top='"+_btop+"' width='"+menu_width+"' height='"+menu_height+"' bgcolor='"+border_color+"' visibility='show'></layer>\n";
		s += "<layer id='menu_"+i+"_n' z-index='3' left="+(menu_x+1)+" top='"+_top+"' width='"+(menu_width-2)+"' height='"+(menu_height-2)+"' bgcolor='"+bg_color+"' visibility='show'><DIV class=\"normal\">"+text+"</DIV></layer>\n";
		s += "<layer id='menu_"+i+"_h' z-index='4' left="+(menu_x+1)+" top='"+_top+"' width='"+(menu_width-2)+"' height='"+(menu_height-2)+"' bgcolor='"+bg_hl_color+"' visibility='hidden'><DIV class=\"highlight\">"+text+"</DIV></layer>\n";
		s += "<layer id='menu_"+i+"_l' z-index='5' left="+(menu_x+1)+" top='"+_top+"' width='"+(menu_width-2)+"' height='"+(menu_height-2)+"' visibility='show'><A href='"+link+"' onMouseOver=\"pop('menu_"+i+"_h','menu_"+i+"_n');return setStatus('"+text+"');\" onMouseOut=\"pop('menu_"+i+"_n','menu_"+i+"_h');return setStatus('');\"><IMG src='"+BLANK_GIF+"' width='"+menu_width+"' height='"+menu_height+"' border='0'></A></layer>\n";
		s += "\n\n";
		i++;
	}
	
}
else {
	i = 0;
	for (var j=0; j < menu_items.length; j++){
		text = menu_items[j];
		link = menu_items[++j];
		_top = menu_y + i * (menu_height - 1);
		s += "\n\n";
		s+="<DIV z-index=2 id='menu_"+i+"' onmouseover=\"style.background='"+bg_hl_color+"';style.color='"+font_hl_color+"';setStatus('"+text+"');\"";
		s+=" onmouseout=\"style.background='"+bg_color+"';style.color='"+font_color+"';setStatus('');\" onClick=\"goTo('"+link+"');\"";
		s+=" style=\"position:absolute;border:"+border_color+" "+border_size+"px solid;left:"+menu_x+"px;top:"+_top+"px;color:"+font_color+";background:"+bg_color+";";
		s+=" padding:"+menu_padding+";text-decoration:"+font_decor+";font-size:"+font_size+";font-weight:"+font_style+";font-family:"+font_family+";";
		s+=" width:"+menu_width+"px;height:"+menu_height+"px;visibility:'visible';cursor:hand;z-index=2;\">";
		s+=" "+text+"<\/div>\n";
		i++;
	}
}

_d.write(s);

////////////////////////////////////////// FUNCTIONS ////////////////////////////////////////

function getObject(mtxt){
	if(_d.getElementById){
		m=_d.getElementById(mtxt)
	}
	else if(_d.all){
		m=_d.all[mtxt]
	}
	else if(_d.layers){
		m=_d[mtxt]
	}
	return m;
}

function pop(lay1,lay2){

	x = getObject(lay1);
	y = getObject(lay2);

	x.visibility = "show";
	y.visibility = "hide";
}

function setStatus(mtxt){
	window.status=mtxt;
	return true;
}

function goTo(l){
	location.href=l;
}
