/* start menu functions */
// id, dir, left, top, width, height
var top = (is_opera) ? 55 : 40;
var iMenu1 = new ypSlideOutMenu("about", "down", -1000, top, 155, 70)
var iMenu2 = new ypSlideOutMenu("investor", "down", -1000, top, 133, 92)
var iMenu3 = new ypSlideOutMenu("operations", "down", -1000, top, 133, 92)

iMenu1.onactivate = function() { i_repositionMenu(iMenu1, -54); }
iMenu2.onactivate = function() { i_repositionMenu(iMenu2, 140); }
iMenu3.onactivate = function() { i_repositionMenu(iMenu3, 24); }

// this function repositions a menu to the speicified offset from center
function i_repositionMenu(menu, offset) {
	// the new left position should be the center of the window + the offset
	var newLeft = i_getWindowWidth() / 2 + offset;
	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 i_getWindowWidth() {
	var width = document.body.clientWidth != null ? document.body.clientWidth : window.innerWidth;
	return (width < 790 ) ? 790 : width;
}
