// JavaScript Document
var arMenuHover = new Array();


$(document).ready(function () {
	$('div.menu_head').mouseover(function () {
		var intCurHover = GetMenuID($(this));
		arMenuHover[intCurHover] = true;
		//SlideUpOthers(intCurHover);
		$("#menu_body"+intCurHover).slideDown('medium');
    });
	$('ul.menu_body').mouseover(function () {
		var intCurHover = GetMenuID($(this));
		arMenuHover[intCurHover] = true;
    });
	$('div.menu_head').mouseout(function () {
		var intCurHover = GetMenuID($(this));
		arMenuHover[intCurHover] = false;
		setTimeout('CheckMenuHover('+intCurHover+')',400);
    });
	$('ul.menu_body').mouseout(function () {
		var intCurHover = GetMenuID($(this));
		arMenuHover[intCurHover] = false;
		setTimeout('CheckMenuHover('+intCurHover+')',400);
    });
});

function GetMenuID(objMenuItem) {
	var strCurHover = objMenuItem[0].id;
	return strCurHover.substring(9);
}

function CheckMenuHover(intMenuItem) {
	//if menu hover status for the given menu item number is false, then slide up. This allows the timer to work as well as multiple mouse over/out areas.
	if(arMenuHover[intMenuItem]==false) {
		$("#menu_body"+intMenuItem).slideUp('fast');
	}
}
