// the number you pass to initLeft doesn't matter since it will get
// changed onactivate

var bMacIE = (navigator.userAgent.toLowerCase().indexOf("mac")!=-1);
iRowHeight = (bMacIE ? 25 : 23);

function getMenuHeight(iItemCount) {
	return iRowHeight*iItemCount + iItemCount + 1;
}

function getSubmenuBump(iItem) {
	return iRowHeight*(iItem-1) + iItem - 1;
}

// id, direction, left, top, width, height
// for height, use items * 28
var menu_AboutUs = new ypSlideOutMenu("menu_AboutUs", "down", -1000, iTop, 160, getMenuHeight(2), "")
	//var menu_AboutUs_Bios = new ypSlideOutMenu("menu_AboutUs_Bios", "right", -1000, iTop+getSubmenuBump(2), 120, getMenuHeight(3), "menu_AboutUs")

var menu_Services = new ypSlideOutMenu("menu_Services", "down", -1000, iTop, 160, getMenuHeight(5), "")

var menu_Resources = new ypSlideOutMenu("menu_Resources", "down", -1000, iTop, 160, getMenuHeight(7), "")
	// The height of this needs to be populated
	var menu_Resources_Articles = new ypSlideOutMenu("menu_Resources_Articles", "right", -1000, iTop+getSubmenuBump(2), 180, getMenuHeight(iArticleCount), "menu_Resources")

// The height of this needs to be populated
var menu_News = new ypSlideOutMenu("menu_News", "down", -1000, iTop, 260, getMenuHeight(iNewsCount), "")


// this function repositions a menu to the speicified offset from center
function repositionMenu(menu, offset)
{
	// the new left position should be the center of the window + the offset
	var newLeft = getWindowWidth() / 2 + offset;

	// Account for everpresent right scrollbar in IE
	if (document.all) {
		newLeft -= 10;
	}

	// setting the left position in netscape is a little different than IE
	menu.container.style ? menu.container.style.left = newLeft + "px" : menu.container.left = newLeft;
}

// this function calculates the window's width - different for IE and netscape
function getWindowWidth()
{
	return window.innerWidth ? window.innerWidth : document.body.offsetWidth;
}
