var onlayer="none";
var activelayer="none";
var lastlayer="none";
var d = "document.images";
var ie = 0;
var op = 0;
var ns6 = 0;
var samecolor = 0;
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf('gecko')!=-1){ns6=1;}
if (document.all) {
if (agt.indexOf('opera')==-1){ie=1;}
else {op=1;}
}

function fadein(what) {
	if(document.getElementById(what).filters.blendTrans){
    	if (document.getElementById(what).filters.blendTrans.status==0) {
        	document.getElementById(what).filters.blendTrans.Apply();
        	document.getElementById(what).style.visibility = "visible";
        	document.getElementById(what).filters.blendTrans.Play();
    	}
	} else {
	document.getElementById(what).style.visibility = "visible";}
}

function show(what,link){
if (!document.getElementById('ref').offsetLeft){
	if ((document.body.offsetWidth / 2) - (375 - MenuLeft) > MenuLeft)
	document.getElementById(what).style.left = (document.body.offsetWidth / 2) - (375 - MenuLeft);
	else
	document.getElementById(what).style.left = MenuLeft;
}
else {document.getElementById(what).style.left = document.getElementById('ref').offsetLeft + MenuLeft;}

if(lastlayer != "none"){
eval(d + "." +lastlayer+ "Img.src='images/mnu-" + lastlayer + ".gif'")
document.getElementById(lastlayer).style.visibility="hidden";}
if(ie){fadein(what);}
else{document.getElementById(what).style.visibility="visible";}
eval(d + "." +what+ "Img.src='images/mnu-" + what + "-over.gif'");
activelayer=what;
}

function hide(what){
lastlayer=activelayer;
activelayer="none";
window.setTimeout("hidenow('" +what+ "')", 500);
}

function on(what){
onlayer = what;
}

function off(what){
onlayer="none";
window.setTimeout("hidenow('" +what+ "')", 250);
}

function hidenow(what){
if(onlayer != what && activelayer != what){
eval(d + "." +what+ "Img.src='images/mnu-" + what + ".gif'")
document.getElementById(what).style.visibility="hidden";
}
}

function BuildLinks(what) {
var temp = what + "Content";
var theov = "";
var theout = "";

if (MenuOvColor != ""){
theov = theov + "this.style.backgroundColor=aaa" + MenuOvColor + "aaa;"
theout = theout + "this.style.backgroundColor=aaa" + MenuColor + "aaa;"
}

if (op==1){
document.write("<div id='tester' class='ovmenutext' visibility='hidden' height='0' width='0'></div>");
document.write("<div id='tester2' class='menutext' visibility='hidden' height='0' width='0'></div>");
if (tester.style.color == tester2.style.color){
samecolor = 1;
}else{
theov = theov + "this.style.color=tester.style.color;"
theout = theout + "this.style.color=tester2.style.color;"}
}else{
theov = theov + "this.className=aaaovmenutextaaa;"
theout = theout + "this.className=aaamenutextaaa;"}

if (ns6==1)
theov = theov + "this.style.cursor=aaapointeraaa;"
else
theov = theov + "this.style.cursor=aaahandaaa;"

eval("var " + temp + "= '<table width=150 cellspacing=4 cellpadding=0 border=0 Link=#333366>'");

for(var y = 0; y < eval(what + "arr.length"); y++){

eval(temp + "=" + temp + "+ '<tr><td height='+ MenuHeight +' bgcolor=' + MenuColor + ' valign=center width=100%'")

if (theov != ""){
eval(temp + "=" + temp + "+ ' onmouseover=bbb' + theov + 'bbb'")
eval(temp + "=" + temp + "+ ' onmouseout=bbb' + theout + 'bbb'")
}

tempcode = eval(what + "Linksarr[y].toLowerCase()");
if (tempcode.indexOf("javascript:")!=-1){
tempcode = tempcode.replace("javascript:","");
eval(temp + "=" + temp + "+ ' onclick=bbb'+ tempcode +';bbb'")
} else {
eval(temp + "=" + temp + "+ ' onclick=bbbdocument.location=aaa' + " + what + "Linksarr[y] + 'aaa;bbb'")
}

if (MenuOvColor=="" && samecolor==1){
var tdcontent = "<a class=aaamenutextaaa href=aaa" + eval(what + "Linksarr[y]") + "aaa>" + eval(what + "arr[y]") + "</a>";}
else{
var tdcontent = eval(what + "arr[y]");}

eval(temp + "=" + temp + "+ 'class=menutext><img src=images/spacer.gif width=4 height=1>' + tdcontent  + '</td></tr>'")
}
eval(temp + "=" + temp + "+ '</table>'")
atemp = eval(temp)

atemp = atemp.replace(/aaa/g, "'")
atemp = atemp.replace(/bbb/g, '"')
return atemp;
}

function BuildLayers(){
for(var x = 0; x < menuarr.length; x++){
document.write('<div id="' + menuarr[x] + '"');
document.write(' style="width:150px;filter:Shadow(color=#A4A47E, Direction=135, Strength=5)blendTrans(duration=.25);visibility:hidden;position:absolute;left:0;top:'+ Top +';"');
Top = Top + 28;
document.write(" onMouseOver=on('" + menuarr[x] + "'); onMouseOut=off('" + menuarr[x] + "');>");
document.write(eval("BuildLinks('" + menuarr[x] + "')"));
document.write('</div>');
}}


