/* start menu functions */
// id, dir, left, top, width, height
var top = 211;
var iMenu1 = new ypSlideOutMenu("menu1", "down", -1000, top, 148, 93)
var iMenu2 = new ypSlideOutMenu("menu2", "down", -1000, top, 148, 139)
var iMenu3 = new ypSlideOutMenu("menu3", "down", -1000, top, 150, 200)
// change these numbers for Y position of drop-downs
iMenu1.onactivate = function() { i_repositionMenu(iMenu1, -227); }
iMenu2.onactivate = function() { i_repositionMenu(iMenu2, -73); }
iMenu3.onactivate = function() { i_repositionMenu(iMenu3, 101); }

// 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;
}
