/* start menu functions */
// id, dir, left, top, width, height
var top = (is_opera) ? 168 : 152;
var iMenu1 = new ypSlideOutMenu("about", "down", -1000, top, 140, 139)
var iMenu2 = new ypSlideOutMenu("investor", "down", -1000, top, 140, 159)
var iMenu3 = new ypSlideOutMenu("operations", "down", -1000, top, 140, 128)

iMenu1.onactivate = function() { i_repositionMenu(iMenu1, -83); }
iMenu2.onactivate = function() { i_repositionMenu(iMenu2, 26); }
iMenu3.onactivate = function() { i_repositionMenu(iMenu3, 143); }

// 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 < 770 ) ? 770 : width;
}
