/* start menu functions */
// id, dir, left, top, width, height
var top = 120;
var iMenu1 = new ypSlideOutMenu("about", "down", -1000, top, 178, 139)
var iMenu2 = new ypSlideOutMenu("technology", "down", -1000, top, 178, 170)
var iMenu3 = new ypSlideOutMenu("services", "down", -1000, top, 178, 170)

iMenu1.onactivate = function() { i_repositionMenu(iMenu1, -373); }
iMenu2.onactivate = function() { i_repositionMenu(iMenu2, -271); }
iMenu3.onactivate = function() { i_repositionMenu(iMenu3, -151); }

// 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 < 780 ) ? 780 : width;
}

