var sstrStay = '';
var sstrOn = '';
var sintTimer = 0;
var sarrItems = new Array('services', 'contactus');

function MenuOn(strID, blnRight) {
	sstrStay = strID;
	if (strID != sstrOn) {
		sstrOn = strID;
		var objN = document.getElementById('nav_' + strID);
		var objM = document.getElementById('menu_' + strID)
		if (objN.offsetLeft) {
			if (blnRight) {
				objM.style.left = (objN.offsetLeft - (objM.offsetWidth - objN.offsetWidth)) + 'px';
			}
			else {
				objM.style.left = (objN.offsetLeft - 2) + 'px';
			}
			objM.style.top = (objN.offsetTop + 39) + 'px';
			objM.style.visibility = 'visible';
		}
		MenuAllHide(strID);
	}
}

function MenuStay(strID) {
	sstrStay = strID;
}

function MenuOff(strID) {
	sstrStay = '';
	clearTimeout(sintTimer);
	sintTimer = setTimeout('MenuHide(\'' + strID + '\')', 500);
}

function MenuAllOff() {
	sstrStay = '';
	sstrOn = '';
	clearTimeout(sintTimer);
	MenuAllHide();
}

function MenuHide(strID) {
	if (strID != sstrStay) {
		if (strID == sstrOn) sstrOn = '';
		var objM = document.getElementById('menu_' + strID);
		objM.style.visibility = 'hidden';
	}
}

function MenuAllHide(strID) {
	var intCount, strItem;
	for (intCount = 0; intCount < sarrItems.length; intCount++) {
		strItem = sarrItems[intCount];
		if (strID != strItem) MenuHide(strItem);
	}
}
