//var nowDate = new Date();
//var nowYear = nowDate.getYear();
//var inclick = false;
//var currentAddress = document.location + "";
//function stopError() {  return true;               }
//var copydate = new Date();
//var copyyear = copydate.getYear();
//var RowColor = "";
//var noth = "";
//var movmou;
//var updstr = "";

var menuett = false;
//var cp = "Home1";
var cp = "_self";
var char34 = String.fromCharCode(34);
var menuheadcolor  = "white";
var menuheadover = "white";
var menuheadoverbg = "#f57a00";
var menubackground = "black";
var menubodyborder = "white";
var menubodylink = "white";
var menuhighlight = "white";
var menubodylinkbg = menuheadoverbg;
var topnavover = "white";
var topnavoverbg = menuheadoverbg;

var brow = navigator.userAgent.toLowerCase() + "";
var is_ie = false;
var is_ie5 = false;
var is_ie6 = false;

if (brow.indexOf("msie ") != -1) 
{
    is_ie = true; 
    if (brow.indexOf("msie 5") != -1) is_ie5 = true;
    if (brow.indexOf("msie 6") != -1) is_ie6 = true;
    if (brow.indexOf("opera ") != -1) {is_ie = false; is_ie5 = false; is_ie6 = false;};
}

w("<style>");
w(".navlink {font-family: tahoma; font-size: 8pt; font-weight: bold; padding-left: 8px; padding-right: 8px; vertical-align: middle}");
w("td.navlink a {text-decoration: none; font-weight: bold}");
w("td.navlink a:hover {text-decoration: underline}");
w(".menuhead {color: " + menuheadcolor + "; cursor: default; padding-left: 8px; padding-right: 8px; font-family: tahoma; font-size: 8pt; font-weight: bold}");
w(".topmenucsik {height: 1px; background-color: " + menubodyborder + "; border-left: 3px solid " + menubackground + "; border-right: 3px solid " + menubackground + "; border-top: 2px solid " + menubackground + "; border-bottom: 2px solid " + menubackground + "}");
w(".menubody {background-color: " + menubackground + "}");
w(".menubody {padding-top: 2px; padding-bottom: 2px; font-size: 85%; white-space: nowrap; border: 1px solid " + menubodyborder + "}");
w(".menubodyb {}")
w(".menubodyb a{color: " + menubodylink + "; text-decoration: none}")
w(".menubodyb a:link{color: " + menubodylink + "; text-decoration: none}")
w(".menubodyb a:visited{color: " + menubodylink + "; text-decoration: none}")
w(".menubodylink {display: block; text-align: left; padding-left: 12px; padding-right: 12px; padding-top: 2px; padding-bottom: 3px; border-left: 1px solid " + menubackground + "; border-right: 1px solid " + menubackground + "}");

if (is_ie) { }
w(".NN {z-index: 9; visibility: hidden; position: absolute; left: 0px; top: 0px; border: none}");
w(".siderow {padding-top: 2px; padding-bottom: 2px; vertical-align: top; width: 99%} .bullet1 {font-size: 8px; padding-top: 4px; width: 1%; vertical-align: top}");
w(".leftnavlink {font-size: 8pt; padding-top: 3px; padding-bottom: 3px; padding-left: 8px; padding-right: 8px; text-align: right}");
w(".leftnavhighed {background-color: " + menubodylinkbg + "; color: " + menuhighlight + "}");
w(".leftnavdivider {font-size: 1px; border-top: 4px solid white; border-bottom: 1px solid white; padding: 0px; padding-left: 10px; padding-right: 10px; text-align: right; background-color: #C9C9C9}");
w("</style>");

function Nothing()   {return}

function w(text)      {
var textout = text.toString();
document.write(textout);
}

var normalColor, normalBgColor;
function mov(oobj)
{
	normalColor = oobj.style.color;  
	normalBgColor = oobj.style.backgroundColor;  
	oobj.style.color = topnavover;
 	oobj.style.backgroundColor = topnavoverbg;
}
function mou(oobj)
{
	oobj.style.color = normalColor;
	oobj.style.backgroundColor = normalBgColor;
}

function showmenu(mhead, mbody, trig)   {
	if (mbody)
	{
		if (trig)
			{
//			if (inclick) 
//			{
				mbody.style.left = mhead.offsetLeft + "px";
				HideAllMenu();
				mbody.style.display = "";
				if (document.getElementById("Hfrm"))
				{
				document.getElementById("Hfrm").style.top = document.getElementById(mhead.id + "menu").offsetTop + "px"; 
				document.getElementById("Hfrm").style.left = mhead.offsetLeft + "px";
				document.getElementById("Hfrm").style.width = document.getElementById(mhead.id + "menuin").offsetWidth + "px"; 
				document.getElementById("Hfrm").style.height = document.getElementById(mhead.id + "menuin").offsetHeight + "px";
				document.getElementById("Hfrm").style.visibility = "visible";
				}
//			}
			mhead.style.backgroundColor = menuheadoverbg;
			mhead.style.color = menuheadover;
			menuett = true;
			}
		else 	{
			menuett = false;
			if (document.getElementById("Hfrm")) {document.getElementById("Hfrm").style.visibility = "hidden"};
			mbody.style.display = "none";
			mhead.style.backgroundColor = "";
			mhead.style.color = menuheadcolor;
			}
	}
}

//function doClearM(obj)
//{
//	obj.style.backgroundColor = "";
//	obj.style.color = menuheadcolor;
//}

function HideAllMenu()
{
	for (i = 1; i < suboptions.length; i++)
	{
		showmenu(document.getElementById("topm" + i), document.getElementById("topm" + i + "menu"), false);
	}
}

function foo(evt) 
{
	var e = (window.event) ? window.event : evt;
	e.cancelBubble = true;
	if (e.stopPropagation) {e.stopPropagation()};
}

function topMenu1() {
    if (is_ie5)
    { w("<span class=NN id=Hfrm src='javascript: false;' frameborder=0></span>") }
    else {
        if (is_ie) { w("<iframe class=NN id=Hfrm src='javascript: false;' frameborder=0></iframe>") }
    };

    w("<table cellpadding=0 cellspacing=0 height=25 onmouseover='foo(event)'><tr>");
    for (i = 1; i < suboptions.length; i++) {
        if (suboptions[i].length > 0) {
            var st = suboptions[i][0].substring(0, suboptions[i][0].indexOf("|"));
            var lnkst = suboptions[i][0].substring(suboptions[i][0].indexOf("|") + 1, suboptions[i][0].length);
            w("<td style='cursor: default' nowrap onmouseover='foo(event); showmenu(document.getElementById(\"" + "topm" + i + "\"), document.getElementById(\"" + "topm" + i + "menu\"), true)' class=menuhead id='" + "topm" + i + "'><a href=" + char34 + lnkst + char34 + " target=" + cp + " style='color: white; text-decoration: none'>" + st + "</a></td>");
        }
    }
    w("</tr>");
    w("</table>");
}

function topMenu2() {

    var ua = navigator.userAgent.toLowerCase();
    var browserName = navigator.appName;
    var Browser = {};

    Browser.ns_sf_gc_fx = navigator.appName == 'Netscape';
    Browser.ie = navigator.appName == 'Microsoft Internet Explorer';
    Browser.opera = ua.indexOf('opera') > -1;


    for (i = 1; i < suboptions.length; i++) {
        if (suboptions[i].length > 0) {


            if (Browser.ie) {
                w("<table id='" + "topm" + i + "menu' cellspacing=0 cellpadding=0 border=0 style='position: absolute; top: 25px; left: 10px; display: none; z-index: 10'><tr><td nowrap>");
            }
            else if (Browser.ns_sf_gc_fx) {
                w("<table id='" + "topm" + i + "menu' cellspacing=0 cellpadding=0 border=0 style='position: absolute; top: 95px; left: 10px; padding-left: 302px; display: none; z-index: 10'><tr><td nowrap>");
            }
            else if (Browser.opera) {
                w("<table id='" + "topm" + i + "menu' cellspacing=0 cellpadding=0 border=0 style='position: absolute; top: 25px; left: 10px; padding-left: 0px; display: none; z-index: 10'><tr><td nowrap>");
            }

            w("<table cellpadding=0 cellspacing=0 id='" + "topm" + i + "menuin' onmouseover='foo(event)'><tr><td nowrap class=menubody>");
            w("<table cellspacing=0 cellpadding=0 class='menubodyb'>");
            for (j = 1; j < suboptions[i].length; j++) {
                if (suboptions[i][j] != "-") {
                    var lnkstr = suboptions[i][j].substring(suboptions[i][j].indexOf("|") + 1, suboptions[i][j].length);
                    var lnktxt = suboptions[i][j].substring(0, suboptions[i][j].indexOf("|"));
                    spacecnt = 0;
                    while (lnktxt.indexOf(" ") > -1) { spacecnt += 1; if (spacecnt / 4 != parseInt(spacecnt / 4)) { lnktxt = lnktxt.replace(" ", "&nbsp;") } else { lnktxt = lnktxt.replace(" ", "<br />") }; }
                    w("<tr><td nowrap><a href=" + char34 + lnkstr + char34 + " target=" + cp + " onmouseover='mov(this)' onmouseout='mou(this)' class='menubodylink'>" + lnktxt + "</a></td></tr>");
                }
                else
                { w("<tr><td class=topmenucsik><img src='/images/blank.gif' border=0 height=1></td></tr>"); }
            }
            w("</table>");
            w("</td></tr></table>");
            w("</td></tr></table>");
        }
    }
    delete ua;
}
