var _menu_js = true;

/* Constant Definition */
var MenuOrientation = new Object();
MenuOrientation.Horizontal = 0;
MenuOrientation.Vertical = 1;
/* End of Constant Definition */

function Menu(id, MenuWidth)
{
	var obj = new Object();
	obj.MenuItems = new Array();
	obj.MenuItems.Add = function (menuitem)
	{
		this.push(menuitem);
		menuitem.Parent = this;
	}

	// Unique ID, must provided
	obj.ID = id;

	// The parent menu of this menu item
	obj.Parent = null;

	// Main menu initialized function
	obj.Init = Menu_MainInit;

	// Submenu initialized function
	obj.SubInit = Menu_SubInit;

	obj.AttachEvent = Menu_AttachEvent;

	obj.Depth = 0;
	obj.Object = null;
	obj.IsActive = false;

	// The following are the menu properties which can be adjust

	// Z-index of the menu
	obj.zIndex = 2;

	// Left position of the menu, not applied if the position is set to relative
	obj.Left = 0;

	// Top position of the menu, not applied if the position is set to relative
	obj.Top = 0;

	// Rendering method, can be {relative, absolute}
	obj.Position = "relative";

	obj.SelectedColor = "inherited";
	obj.SelectedTextColor = "inherited";
	obj.HorizontalSeparatorSrc = null;
	obj.VerticalSeparatorSrc = null;
	obj.SeparatorColor = "white";
	obj.IsClickHideMenu = true;
	obj.Width = MenuWidth;
	obj.CssClass = null;
	obj.Orientation = MenuOrientation.Horizontal;
	obj.HeaderPicSrc = null;
	obj.FooterPicSrc = null;
	obj.OffsetX = 0;
	obj.OffsetY = 0;
	obj.ArrowSrc = null;
	return obj;
} // End Menu

function Menu_GetX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;
		} // End while
	}
	else if (obj.x)
	{
		curleft += obj.x;
	}
	return curleft;
} // End MenuButton_GetX

function Menu_GetY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while(obj.offsetParent)
		{
			curtop += obj.offsetTop;
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
	{
		curtop += obj.y;
	}
	return curtop;
} // End MenuButton_GetY


function MenuItem_OnMouseOver(Sender, BaseMenuID, MenuID, SubMenuID, MenuItemIndex)
{
	// Highlight Effect
	eval("var MainMenuObj = " + BaseMenuID + "_Object." + BaseMenuID + ";");
	eval("var MenuObj = " + BaseMenuID + "_Object." + MenuID + ";");

	if (MenuObj.SelectedColor != "none")
	{
		Sender.style.backgroundColor = MenuObj.SelectedColor;
	} // End if

	if (Sender.tagName != "TD" && MenuObj.SelectedTextColor != "none")
	{
		// Search for the link and make the highlight
		for (var i = 0; i < Sender.cells.length; i++)
		{
			var td = Sender.cells[i];
			for (var j = 0; j < td.childNodes.length; j++)
			{
				var cn = td.childNodes[j];

				if (cn.tagName == "A")
				{
					cn.style.color = MenuObj.SelectedTextColor;
				} // End if
			} // End for

		} // End for
	} // End if

	// Clear Schedule for hiding
	Menu_ClearHideMenuSchedule(BaseMenuID);

	// Hide all adjact menu
	Menu_HideAdjacentMenu(BaseMenuID, MenuID, MenuItemIndex);

	// Show Sub Menu
	if (SubMenuID != null)
	{
		var objSubMenu = document.getElementById(SubMenuID);

		if (objSubMenu != null)
		{
			eval("var SubMenuObj = " + BaseMenuID + "_Object." + SubMenuID + ";");
			SubMenuObj.IsActive = true;

			var style = objSubMenu.style;

			var x = Menu_GetX(Sender);
			var y = Menu_GetY(Sender);

			if (MenuObj.Orientation == MenuOrientation.Horizontal)
			{
    			if (MenuObj.Depth > 0)
    			{
    			    var ShowLeft = false;

    			    var ViewableRight;

    			    if (typeof(document.body.scrollLeft) != "undefined")
    			    {
    			        ViewableRight = document.body.scrollLeft + document.body.clientWidth;
    			    }
    			    else
    			    {
    			        ViewableRight = window.pageXOffset + document.body.clientWidth;
    			    }

    			    // determine it shows to right or left
    			    if (x + Sender.offsetWidth + objSubMenu.offsetWidth >= ViewableRight)
    			    {
    		            ShowLeft = true;
    			    } // End if

    			    style.left = (! ShowLeft)? x + Sender.offsetWidth : x - objSubMenu.offsetWidth ;
    				style.top = y + SubMenuObj.OffsetY;
    			}
    			else
    			{
    				style.left = x + SubMenuObj.OffsetX;
    				style.top = y + Sender.offsetHeight;
    			} // End if
    		}
    		else if (MenuObj.Orientation == MenuOrientation.Vertical)
    		{
    		    style.left = x + Sender.offsetWidth;

    		    // Detect Up or down
    		    var ViewableBottom;

    		    if (typeof(document.body.scrollTop) != "undefined")
			    {
			        ViewableBottom = document.body.scrollTop + document.body.clientHeight;
			    }
			    else
			    {
			        ViewableBottom = window.pageYOffset + document.body.clientHeight;
			    } // End if

    		    if (y + objSubMenu.offsetHeight > ViewableBottom)
    		    {
    		        style.top = y + Sender.offsetHeight - objSubMenu.offsetHeight;
    		    }
    		    else
    		    {
    		        style.top = y;
    		    } // End if
    		} // End if

			style.visibility = "visible";

			// For IE Only
            if (MainMenuObj.Browser.Name == "Internet Explorer")
            {
    			var iFrame = document.getElementById("Hide" + SubMenuID);
    			if (!iFrame)
    			{
    				iFrame = Menu_CreateIFrame("Hide" + SubMenuID);
    			}

    			iFrame.style.width = objSubMenu.offsetWidth - 2;
    			iFrame.style.height = objSubMenu.offsetHeight - 2;
    			iFrame.style.left = objSubMenu.style.left;
    			iFrame.style.top = objSubMenu.style.top;
    			iFrame.style.visibility = "visible";

    	    } // End if

		} // End if
	} // End if
	//
	if(x!=null&&y!=null){
		//alert("x="+x+",y="+y);
		try{
		doOut2(x,y);
	}catch(e){}
	}
}

function Menu_CreateIFrame(ID)
{
	document.body.insertAdjacentHTML("afterBegin", "<iframe src='javascript:false' class='BoomMenu_SubMenu' id='" + ID + "' scrolling='no' frameborder='0' style='position:absolute; visibility:hidden; z-Index: 2;'></iframe>");
	return document.getElementById(ID);
}


function Menu_OnMouseOver(BaseMenuID, MenuID)
{
	eval("var MenuObj = " + BaseMenuID + "_Object." + MenuID + ";");
	Menu_ClearHideMenuSchedule(BaseMenuID);
	MenuObj.IsActive = true;

	// Traverse all parents and set them to isActive
	var parent = MenuObj.Parent;
	while (parent != null)
	{
		parent.IsActive = true;
		parent = parent.Parent;
	}
}

function Menu_OnMouseOut(BaseMenuID, MenuID)
{
	eval("var MenuObj = " + BaseMenuID + "_Object." + MenuID + ";");
	MenuObj.IsActive = false;

	for (var i=0; i < MenuObj.MenuItems.length; i++)
	{
		var SubMenuObj = MenuObj.MenuItems[i].SubMenu;
		if (SubMenuObj != null)
		{
			SubMenuObj.IsActive = false;
		}
	} // End for

	// Traverse all the way to the root and tell its not active
	var parent = MenuObj.Parent;
	while (parent != null)
	{
		parent.IsActive = false;
		parent = parent.Parent;
	}

	Menu_ScheduleHideMenu(BaseMenuID, MenuID);
} // End Menu_OnMouseOut

function Menu_ScheduleHideMenu(BaseMenuID, MenuID)
{
	var TimerID = window.setTimeout("Menu_HideAllMenu('" + BaseMenuID + "')", 1000);
	eval(BaseMenuID + "_Object.TimerID = " + TimerID + ";");
}

function Menu_ClearHideMenuSchedule(BaseMenuID)
{
	eval("var TimerID = " + BaseMenuID + "_Object.TimerID;");
	if (TimerID != null)
	{
		window.clearTimeout(TimerID);
		eval(BaseMenuID + "_Object.TimerID = null");
	}
}

function Menu_MainInit()
{
	this.Browser = new Menu_CheckBrowser();
	var TableStyle = "";
	var Depth = this.Depth;
	var tdMainMenuWidth = (this.Width != null && typeof(this.Width) != 'undefined') ?
		" width='" + this.Width + "' " : "";

	var DivOnMouseOut = "onmouseout=\"Menu_OnMouseOut('" + this.ID + "', '" + this.ID + "')\" ";
	var DivOnMouseOver = "onmouseover=\"Menu_OnMouseOver('" + this.ID + "', '" + this.ID + "')\" ";

	if (this.Position == "absolute")
	{
		TableStyle += "position: absolute; left: " + this.Left + "px; top: " + this.Top +"; ";
	}

	if (this.zIndex < 2) { this.zIndex = 2; }

	if (this.SelectedColor == "inherited") { this.SelectedColor = "white"; } // Endif
	if (this.SelectedTextColor == "inherited") { this.SelectedColor = "white"; } // End if

	TableStyle += "z-Index: " + this.zIndex;

	eval(this.ID + "_Object=this;");
	eval(this.ID + "_Object." + this.ID + "=this;");
	eval(this.ID + "_Object.TimerID = null;");

	var str = "<div id='" + this.ID + "' " + DivOnMouseOut + DivOnMouseOver + ">\n" +
	"\t<table cellpadding='0' cellspacing='0' " + tdMainMenuWidth + " style='" + TableStyle + "'>\n\t\t";

    if (this.Orientation == MenuOrientation.Horizontal)
	{
	    str += "<tr>";
	} // End if

	if (this.HeaderPicSrc != null)
	{
	    if (this.Orientation == MenuOrientation.Horizontal)
	    {
	        str += "<td><img src='" + this.HeaderPicSrc + "'/></td>";
	    }
	    else if (this.Orientation == MenuOrientation.Vertical)
	    {
	        str += "<tr><td><img src='" + this.HeaderPicSrc + "'/></td></tr>";
	    } // End if
	} // End if

	if (this.Orientation == MenuOrientation.Vertical)
	{
	    str += "<tr><td><table cellpadding='0' cellspacing='0' " + tdMainMenuWidth + " class='" + this.CssClass + "_MainMenu'>\n";
	}
	else if (this.Orientation == MenuOrientation.Horizontal)
	{
	    str += "<td><table cellpadding='0' cellspacing='0' " + tdMainMenuWidth + " class='" + this.CssClass + "_MainMenu'><tr>\n";
    } // End if


	for (var i = 0; i < this.MenuItems.length; i++)
	{
		var mi = this.MenuItems[i];

		var RightCell, LeftCell;
		var sepstyle = (this.SeparatorColor != null && i != this.MenuItems.length - 1 && this.Orientation != MenuOrientation.Horizontal && this.SeparatorColor != "none")?
			 " style='border-bottom: 1px solid " + this.SeparatorColor + "' " : "";

		// Prepare onmouseover event
        var CurrentCellOnMouseOver = "";
        var CurrentCellOnMouseOut;

        if (this.Orientation == MenuOrientation.Horizontal)
        {
            CurrentCellOnMouseOut = "MenuItem_OnMouseOutTD(this, '" + this.ID + "')";
        }
        else if (this.Orientation == MenuOrientation.Vertical)
        {
            CurrentCellOnMouseOut = "MenuItem_OnMouseOutTR(this, '" + this.ID + "')";
        } // End if

		var tdWidth = (mi.Width != null)? " width='" + mi.Width + "' " : "";

		if (mi.SubMenu != null)
		{
			mi.SubMenu.ID = this.ID + "_" + i;
			mi.SubMenu.Depth = this.Depth + 1;
			mi.SubMenu.Parent = this;
			mi.SubMenu.zIndex = this.zIndex + 1;
			mi.SubMenu.ArrowSrc = this.ArrowSrc;
			mi.SubMenu.CssClass = this.CssClass;
			mi.SubMenu.VerticalSeparatorSrc = this.VerticalSeparatorSrc;
			mi.SubMenu.OffsetX = this.OffsetX;
			mi.SubMenu.OffsetY = this.OffsetY;

			if (mi.SubMenu.SelectedColor == "inherited")
			{
				mi.SubMenu.SelectedColor = this.SelectedColor;
			} // End if

			if (mi.SubMenu.SelectedTextColor == "inherited")
			{
				mi.SubMenu.SelectedTextColor = this.SelectedTextColor;
			} // End if

			if (mi.SubMenu.SeparatorColor == "inherited")
			{
			    mi.SubMenu.SeparatorColor = this.SeparatorColor;
			} // End if

            CurrentCellOnMouseOver += "MenuItem_OnMouseOver(this, '" + this.ID + "', '" + this.ID + "', '" + mi.SubMenu.ID + "', " + i + ")";
			mi.SubMenu.SubInit(this.ID);

			var objSubMenu = document.getElementById(mi.SubMenu.ID);
		}
		else
		{
		    CurrentCellOnMouseOver += "MenuItem_OnMouseOver(this, '" +  this.ID + "', '" + this.ID + "', null, " + i + ");";
		} // End if

		var anchor = (mi.href != "#")?
		   "<a href='" + mi.href + "' title='" + mi.tooltip + "'>" + mi.text + "</a>" :
		   "<a href='#' onclick='return false;' title='" + mi.tooltip + "'>" + mi.text + "</a>";

		// Left Cell
		LeftCell = (mi.ImageSrc != null)?
		    "<td " + sepstyle + "class='Icon'><img src='" + mi.ImageSrc + "'/></td>" :
		    "<td " + sepstyle + ">&nbsp;</td>";


		// Right Cell
		if (this.Orientation == MenuOrientation.Vertical)
		{
		    if (mi.SubMenu != null && this.ArrowSrc != null)
		    {
			    RightCell = "<td " + sepstyle + "class='Arrow'><img src='" + this.ArrowSrc + "'/></td>";
		    }
		    else
		    {
		        RightCell = "<td " + sepstyle + ">&nbsp;</td>";
		    } // End if
		} // End if

        var Event1 = "onmouseover=\"" + CurrentCellOnMouseOver + "\"";
        var Event2 = "onmouseout=\"" + CurrentCellOnMouseOut + "\"";

	    if (this.Orientation == MenuOrientation.Vertical)
	    {
	        var MidCell = "\t\t\t<td " + sepstyle + "class='MenuItem' " + tdWidth + ">" + anchor + "</td>\n";
	        str += "<tr " + Event1 + " " + Event2 + ">" + LeftCell + MidCell + RightCell + "</tr>";
	    }
	    else
	    {
	        var MidCell = "\t\t\t<td " + sepstyle + "class='MenuItem' nowrap " + Event1 + " " + Event2 + tdWidth + ">" + anchor + "</td>\n";
	        str += MidCell;
	    } // End if

		if (i != this.MenuItems.length - 1)
		{
		    if (this.Orientation == MenuOrientation.Horizontal && this.HorizontalSeparatorSrc != null)
		    {
		        str += "<td class='HorizontalSeparator'><img src='" + this.HorizontalSeparatorSrc + "'/></td>";
		    }
		    else if (this.Orientation == MenuOrientation.Vertical && this.VerticalSeparatorSrc != null)
		    {
		        str += "<tr><td class='HorizontalSeparator' colspan='3'><img src='" + this.VerticalSeparatorSrc +"'/></td></tr>";
		    } // End if
		} // End if
	} // End for

    if (this.Orientation == MenuOrientation.Vertical)
	{
	    str += "</table></td></tr>";
	}
	else if (this.Orientation == MenuOrientation.Horizontal)
	{
	    str += "</tr></table></td>";
	}// End if

	if (this.FooterPicSrc != null)
	{
	    if (this.Orientation == MenuOrientation.Horizontal)
	    {
	        str += "<td><img src='" + this.FooterPicSrc + "'/></td>";
	    }
	    else if (this.Orientation == MenuOrientation.Vertical)
	    {
	        str += "<tr><td><img src='" + this.FooterPicSrc + "'/></td></tr>";
	    } // End if

	} // End if

	if (this.Orientation == MenuOrientation.Horizontal)
	{
	    str += "</tr>";
	} // End if

	str += "\n\t</table>\n";
	str += "</div>\n";
	document.write(str);
	this.Object = document.getElementById(this.ID);
	this.OriginalColor = this.Object.style.backgroundColor;
	this.OriginalTextColor = this.Object.style.color;

	if (this.IsClickHideMenu)
	{
	    var func = new Function("Menu_HideAllMenu('" + this.ID + "')");
	    this.AttachEvent(document, "click", func, true);
	} // End if


	return str;
}

function Menu_SubInit(MainMenuID)
{
	var style = "";
	var Depth = this.Depth;

	style = "position: absolute; visibility: hidden; z-Index: " + this.zIndex;

	eval(MainMenuID + "_Object." + this.ID + "=this;");

	var DivOnMouseOut = "onmouseout=\"Menu_OnMouseOut('" + MainMenuID + "', '" + this.ID + "')\" ";
	var DivOnMouseOver = "onmouseover=\"Menu_OnMouseOver('" + MainMenuID + "', '" + this.ID + "')\" ";

	var tableWidth = (this.Width != null)? " width='" + this.Width + "' ": "";

	var str = "<div id='" + this.ID + "' style='" + style + "' " + DivOnMouseOut + DivOnMouseOver + ">\n" +
		"\t<table cellpadding='0' cellspacing='0' class='" + this.CssClass + "_SubMenu'" + tableWidth + ">\n";

	for (var i = 0; i < this.MenuItems.length; i++)
	{
		var mi = this.MenuItems[i];

		// Prepare onmouseover event
		var CurrentCellOnMouseOver;
		var RightCell;
		var ColumnSpan = 1;

		var style = (i != this.MenuItems.length - 1 && this.SeparatorColor != "none")?
		    "style='border-bottom: 1px solid " + this.SeparatorColor + ";'" : "";

		var LeftCell = (mi.ImageSrc != null)?
			"<td " + style + " class='Icon'><img src='" + mi.ImageSrc + "'/></td>" :
			"<td " + style + "/>";


		if (mi.SubMenu != null)
		{
			mi.SubMenu.ID = this.ID + "_" + i;
			mi.SubMenu.Depth = this.Depth + 1;
			mi.SubMenu.Parent = this;
			mi.SubMenu.zIndex = this.zIndex + 1;
			mi.SubMenu.CssClass = this.CssClass;
			mi.SubMenu.VerticalSeparatorSrc = this.VerticalSeparatorSrc;
			mi.SubMenu.OffsetX = this.OffsetX;
			mi.SubMenu.OffsetY = this.OffsetY;

			if (mi.SubMenu.SelectedColor == "inherited")
			{
				mi.SubMenu.SelectedColor = this.SelectedColor;
			} // End if

			if (mi.SubMenu.SelectedTextColor == "inherited")
			{
				mi.SubMenu.SelectedTextColor = this.SelectedTextColor;
			} // End if

			if (mi.SubMenu.SeparatorColor == "inherited")
			{
			    mi.SubMenu.SeparatorColor = this.SeparatorColor;
			} // End if

			CurrentCellOnMouseOver = "MenuItem_OnMouseOver(this, '" +  MainMenuID + "', '" + this.ID + "', '" + mi.SubMenu.ID + "', " + i + ");";
			mi.SubMenu.SubInit(MainMenuID);
			RightCell = "<td " + style + " class='Arrow'>" +
				(this.ArrowSrc != null ? "<img src='" + this.ArrowSrc + "'/> " : "") +
				"</td>";
		}
		else
		{
			CurrentCellOnMouseOver = "MenuItem_OnMouseOver(this, '" +  MainMenuID + "', '" + this.ID + "', null, " + i + ");";
			RightCell = "<td " + style + ">&nbsp;</td>";
		} // End if

		var target = (mi.target != null)? "target='" + mi.target + "' " : "";

		var anchor = (mi.href != "#")?
		   "<a href='" + mi.href + "' title='" + mi.tooltip + "'>" + mi.text + "</a>" :
		   "<a href='#' onclick='return false;' title='" + mi.tooltip + "'>" + mi.text + "</a>";

		var MidCell = "<td " + style + " colspan='" + ColumnSpan + "' class='MenuItem'>" + anchor + "</td>";

		var Event1 = "onmouseover=\"" + CurrentCellOnMouseOver + "\"";
		var Event2 = "onmouseout=\"MenuItem_OnMouseOutTR(this, '" + MainMenuID + "')\"";

		var tdMenuItemID = "id='" + this.ID + "_MenuItem' ";

		str += "\t\t<tr " + tdMenuItemID + Event1 + " " + Event2 + ">" + LeftCell + MidCell + RightCell + "</tr>\n";
	} // End for

	str += "\t</table>\n";
	str += "</div>\n";

	document.write(str);
	this.Object = document.getElementById(this.ID);
	return str;
}

function MenuItem(text, href, target, width, imgsrc, tooltip, SubMenu)
{
	var obj = new Object();
	obj.text = text;
	obj.href = (href == null || href == "")? "#" : href;
	obj.target = ( (typeof(target) == "undefined") || (target == "") )? null : target;
	obj.Width = (typeof(width) != "undefined")? width: null;
	obj.ImageSrc = (typeof(imgsrc) != "undefined")? imgsrc : null;
	obj.tooltip = ((typeof(tooltip) == "undefined") || (tooltip == null))? "" : tooltip;
	obj.SubMenu = (typeof(SubMenu) != "undefined")? SubMenu : null;

	return obj;
} // End Constructor


function Menu_Hide(MenuObj)
{
	for (var i = 0; i < MenuObj.MenuItems.length; i++)
	{
		var MenuItem = MenuObj.MenuItem[i];
		if (MenuItem.SubMenu != null)
		{
			Menu_Hide(MenuItem.SubMenu);
		}
	}
	if (MenuObj.Depth > 0)
	{
		MenuObj.Object.style.visibility = "hidden";
	}
}


// Only hide adjacent menu (at the same level) (When td.onmouseover)
function Menu_HideAdjacentMenu(BaseMenuID, CurrentMenuID, MenuItemIndex)
{
	eval("var MenuObj = " + BaseMenuID + "_Object." + CurrentMenuID + ";");

	for (var i = 0; i < MenuObj.MenuItems.length; i++)
	{
		var tmp = MenuObj.MenuItems[i].SubMenu;

		if (tmp != null && MenuItemIndex != i && tmp.IsActive == false)
		{
			tmp.Object.style.visibility = "hidden";
			var iFrame = document.getElementById("Hide" + tmp.Object.id);

			if (iFrame != null) { iFrame.style.visibility = "hidden"; }
			Menu_HideAdjacentMenu(BaseMenuID, MenuObj.MenuItems[i].SubMenu.ID, -1);
		} // End if
	} // End for
} // End Menu_HideAdjacentMenu

// Hide all menus (When div.onmouseout)
function Menu_HideAllMenu(BaseMenuID)
{
	eval("var MenuObj = " + BaseMenuID + "_Object." + BaseMenuID + ";");
	Menu_HideMenuRecursive(MenuObj);

}


function Menu_HideMenuRecursive(MenuObj)
{
	for (var i = 0; i < MenuObj.MenuItems.length; i++)
	{
		var tmp = MenuObj.MenuItems[i].SubMenu;

		if (tmp != null && tmp.IsActive == false)
		{
			Menu_HideMenuRecursive(tmp);
			var iFrame = document.getElementById("Hide" + tmp.Object.id);
			if (iFrame != null)
			{
				iFrame.style.visibility = "hidden";
			}
			tmp.Object.style.visibility = "hidden";
		} // End if
	} // End for
} // End Menu_HideMenuRecursive


function MenuItem_OnMouseOutTR(Sender, BaseMenuID)
{
	eval("var MenuObj = " + BaseMenuID + "_Object." + BaseMenuID + ";");
	Sender.style.backgroundColor = MenuObj.OriginalColor;

	for (var i = 0; i < Sender.cells.length; i++)
    {
        var td = Sender.cells[i];
        for (var j = 0; j < td.childNodes.length; j++)
        {
            var cn = td.childNodes[j];
            if (cn.tagName == "A")
            {
                cn.style.color = MenuObj.OriginalTextColor;
            } // End if
        } // End for
    } // End for
} // End MenuItem_OnMouseOverTR

function MenuItem_OnMouseOutTD(Sender, BaseMenuID)
{
   	eval("var MenuObj = " + BaseMenuID + "_Object." + BaseMenuID + ";");
	Sender.style.backgroundColor = MenuObj.OriginalColor;

	for (var j = 0; j < Sender.childNodes.length; j++)
	{
        var cn = Sender.childNodes[j];
        if (cn.tagName == "A")
        {
            cn.style.color = MenuObj.OriginalTextColor;
        } // End if
	} // End for
} // End MenuItem_OnMouseOutTD

function MenuItem_OnClick(url, href)
{
	window.open(url, href);
} // End MenuItem_OnClick


function Menu_AttachEvent(obj, evType, fn, useCapture)
{
    if (obj.attachEvent)
    {
        return obj.attachEvent("on" + evType, fn);
    }
    else if (obj.addEventListener)
    {
        obj.addEventListener(evType, fn, useCapture);
        return true;
    }
} // End Menu_AttachEvent

function Menu_AttachEvent(obj, evType, fn, useCapture)
{
    if (obj.attachEvent)
    {
        return obj.attachEvent("on" + evType, fn);
    }
    else if (obj.addEventListener)
    {
        obj.addEventListener(evType, fn, useCapture);
        return true;
    }
}

function Menu_CheckBrowser()
{
	function checkIt(string)
	{
		place = detect.indexOf(string) + 1;
		thestring = string;
		return place;
	}

	var obj = new Object();
	var detect = navigator.userAgent.toLowerCase();

	if (checkIt('konqueror'))
	{
		obj.Name = "Konqueror";
	}
	else if (checkIt('safari'))
	{
		obj.Name = "Safari";
	}
	else if (checkIt('omniweb'))
	{
		obj.Name = "OmniWeb";
	}
	else if (checkIt('opera'))
	{
	 	obj.Name = "Opera";
	}
	else if (checkIt('webtv'))
	{
		obj.Name = "WebTV";
	}
	else if (checkIt('icab'))
	{
		obj.Name = "iCab";
	}
	else if (checkIt('msie'))
	{
		obj.Name = "Internet Explorer";
	}
	else if (!checkIt('compatible'))
	{
		obj.Name = "Netscape Navigator";
		obj.Version = detect.charAt(8);
	}
	else
	{
	 	obj.Name = null;
	}

	if (!obj.Version)
	{
		obj.Version = detect.charAt(place + thestring.length);
	}

	return obj;
} // End Menu_CheckBrowser