<!--
var menutimeout_value = 500;  // milli-seconds
var menu_timeout_value = 0;
var curZIndex = 100000;

var mouseovertimeout;
var currentmenu = 0;
var oldmenuclassname = "";

// prototype $() function to replace document.getElementById()
function $() {
	var elements = new Array();

	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
		element = document.getElementById(element);

		if (arguments.length == 1)
		return element;

		elements.push(element);
	}

	return elements;
}
	
function mout(id) {
	if ($("submenu").style.visibility == "hidden") mout2(id);
	else mouseovertimeout = setTimeout("mout2(" + id + ")", menu_timeout_value);
}

function mout2(id) {
	$("navl" + id).className = oldmenuclassname;
	nosubmenus();
}

function mover(id, menu, obj) {
	if (mouseovertimeout) {
		clearTimeout(mouseovertimeout);
		if (currentmenu != "id") mout2(currentmenu);
	}

	oldmenuclassname = $("navl" + id).className;
	$("navl" + id).className = "topnavlink_selected";

	submenus(id, menu, obj);

	currentmenu = id;
}

function submenus(id, n, obj) {
	isSafari = navigator.appVersion.indexOf("Safari") != -1;
	isIE = navigator.appVersion.indexOf("MSIE") != -1;

	nosubmenus();
	blur_dropdowns();
	curZIndex++;
	$("submenuIframe").style.zIndex = curZIndex;
	curZIndex++;
	$("submenu").style.zIndex = curZIndex;

	p = getpos(obj.id)
	$("submenuIframe").style.left = p[0] - (isSafari ? 13 : 15);
	$("submenuIframe").style.top = p[1] + (submenu[n].length == 0 ? -1 : 0) + (isSafari ? 5 : 0) + obj.offsetHeight + (isIE ? 3 : (window.opera ? 5 : 4)) + 4;
	$("submenu").style.left = p[0] - (isSafari ? 13 : 15);
	$("submenu").style.top = p[1] + (submenu[n].length == 0 ? -1 : 0) + (isSafari ? 5 : 0) + obj.offsetHeight + (isIE ? 3 : (window.opera ? 5 : 4)) + 4;

	submenu_width = 0;
	links = "";

	for (i = 0; i < submenu[n].length; i++) {
		links += "<div class=\"menuitems_off\" onClick=\"document.location.href='" + submenu[n][i][0] + "'\" onMouseover=\"this.className='menuitems_on'\" onMouseout=\"this.className='menuitems_off'\" id=\"menu_item_" + i + "\" style=\"text-align:center;\"><nobr>" + submenu[n][i][1].toUpperCase() + "</nobr></div>";
		links += "<div style=\"background-color:#ffffff;\" id=\"menu_sep_" + i + "\"><img src=\"/library/187/images/dummy.gif\" width=\"1\" height=\"1\" border=\"0\"></div>";
	}

	if (links != "") {
		$("submenu").innerHTML = links;

		submenu_width = Math.max(141, $("submenu").offsetWidth);

		for (i = 0; i < submenu[n].length; i++) {
			$("menu_item_" + i).style.width = submenu_width + (isIE ? -1 : -24);
			$("menu_sep_" + i).style.width = submenu_width;		
		}

		html = "<table cellpadding=0 cellspacing=0 border=0>";
		html += "<tr>";
		html += '<td background="/library/187/images/menuleft.gif"><img src="/library/187/images/dummy.gif" width="8" height="1" border="0"></td>';
		html += "<td width=" + submenu_width + " bgcolor=#dcdcdc>";
		html += $("submenu").innerHTML;
		html += "</td>";
		html += '<td background="/library/187/images/menuright.gif"><img src="/library/187/images/dummy.gif" width="8" height="1" border="0"></td>';
		html += "</tr>";
		html += '<tr>';
		html += '<td background="/library/187/images/menuleft.gif"><img src="/library/187/images/dummy.gif" width="8" height="1" border="0"></td>';
		html += '<td bgcolor=#dcdcdc><img src="/library/187/images/dummy.gif" width="1" height="5" border="0"></td>';
		html += '<td background="/library/187/images/menuright.gif"><img src="/library/187/images/dummy.gif" width="8" height="1" border="0"></td>';
		html += "</tr>";
		html += "<tr>";
		html += '<td><img src="/library/187/images/menuleftbottom.gif" width="8" height="8" border="0"></td>';
		html += '<td background="/library/187/images/menubottom.gif"><img src="/library/187/images/dummy.gif" width="' + submenu_width + '" height="8" border="0"></td>';
		html += '<td><img src="/library/187/images/menurightbottom.gif" width="8" height="8" border="0"></td>';
		html += "</tr>"; 
		html += "</table>";
		
		menu_timeout_value = menutimeout_value;
	} else {
		html = "<div style=\"background-color:transparent\"><img src=\"/library/187/images/dummy.gif\" width=\"71\" height=\"1\"></div>";
		
		menu_timeout_value = 0;
	}

	$("submenu").innerHTML = html;
	
	p = getpos("navtable");
	if ($("submenu").offsetLeft + $("submenu").offsetWidth > p[0] + $("navtable").offsetWidth) {
		menu_left = p[0] + $("navtable").offsetWidth - $("submenu").offsetWidth - 2;
		$("submenu").style.left = menu_left;
		$("submenuIframe").style.left = menu_left;
	}
	else if ($("submenu").offsetLeft < p[0]) {
		menu_left = p[0] + 2;
		$("submenu").style.left = menu_left;
		$("submenuIframe").style.left = menu_left;
	}
	
	submenu_height = $("submenu").offsetHeight;
	submenu_width = $("submenu").offsetWidth;
	$("submenuIframe").style.width = submenu_width + "px";
	$("submenuIframe").style.height = submenu_height + "px";
	
	$("submenuIframe").style.visibility = "visible";
	$("submenu").style.visibility = "visible";
}

function nosubmenus() {
	if ($("submenu") && $("submenu").style.visibility == "visible") {
		$("submenuIframe").style.visibility = "hidden";
		$("submenu").style.visibility = "hidden";
		$("submenuIframe").style.left = -1000;
		$("submenu").style.left = -1000;
	}
}

function blur_dropdowns() {
	els = document.getElementsByTagName("select");
	for (i = 0; i < els.length; i++) {
		els[i].blur();
	}
}

function trim(str) {
	return str.replace(/^\s+|\s+$/g, "");
}
 
Array.prototype.inArray = function(value) {
	for (i = 0; i < this.length; i++) {
			if (this[i] == value) return true;
	}
	return false;
};

function getRealLeft(el){
	xPos = $(el).offsetLeft;
	tempEl = $(el).offsetParent;
	while (tempEl != null) {
		xPos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
	}
	return xPos;
}

function getRealTop(el){
	yPos = $(el).offsetTop;
	tempEl = $(el).offsetParent;
	while (tempEl != null) {
		yPos += tempEl.offsetTop;
		tempEl = tempEl.offsetParent;
	}
	return yPos;
}

function getpos(isID){
	trueX = getRealLeft(isID);
	trueY = getRealTop(isID);
	return Array(trueX, trueY);
}

-->