/* start menu functions */
// id, dir, left, top, width, height
var top = (is_opera) ? 152 : 190;
var iMenu1 = new ypSlideOutMenu("services", "down", -1000, top, 141, 104)
//var iMenu2 = new ypSlideOutMenu("products", "down", -1000, top, 141, 58)
var iMenu3 = new ypSlideOutMenu("inspiration", "down", -1000, top, 141, 58)
var iMenu4 = new ypSlideOutMenu("team", "down", -1000, top, 141, 128)
var iMenu5 = new ypSlideOutMenu("resources", "down", -1000, top, 141, 58)

iMenu1.onactivate = function() { i_repositionMenu(iMenu1, -208); }
//iMenu2.onactivate = function() { i_repositionMenu(iMenu2, -153); }
iMenu3.onactivate = function() { i_repositionMenu(iMenu3, -112); }
iMenu4.onactivate = function() { i_repositionMenu(iMenu4, 2); }
iMenu5.onactivate = function() { i_repositionMenu(iMenu5, 115); }

//alert(navigator.userAgent.toLowerCase());

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

