
// the number you pass to initLeft doesn't matter since it will get
		// changed onactivate
		
		var myMenu1 = new ypSlideOutMenu("menu1", "down", -1000, 73, 184, 175)
		var myMenu2 = new ypSlideOutMenu("menu2", "down", -1000, 73, 184, 125) 
//		var myMenu3 = new ypSlideOutMenu("menu3", "down", -1000, 110, 129, 90)
     
    // for each menu, we set up hte onactivate event to call repositionMenu with the amount offset from center, in pixels
	if (navigator.userAgent.indexOf('Win')!=-1){
		myMenu1.onactivate = function() { repositionMenu(myMenu1, 20); }
		myMenu2.onactivate = function() { repositionMenu(myMenu2, 1); }
//		myMenu3.onactivate = function() { repositionMenu(myMenu3, -206); }

	} else {
		myMenu1.onactivate = function() { repositionMenu(myMenu1, 81); }
		myMenu2.onactivate = function() { repositionMenu(myMenu2, 5); }
//		myMenu3.onactivate = function() { repositionMenu(myMenu3, -196); }
	}

    // this function repositions a menu to the speicified offset from center
		function repositionMenu(menu, offset)
		{
			
				  // the new left position should be the center of the window + the offset
						//var newLeft = getWindowWidth() / 2 + offset;
						
					//var width = window.document.body.clientHeight;
					//alert(width);
					/*var x_pos = document.getElementById("menu_main").x;
					var y_pos = document.getElementById("menu_main").y;
					alert("x="+x_pos);
					alert("y="+y_pos);*/
					
					var e = document.getElementById("menu_main_item");
 					e.style.position = "relative";  // only needs to be done once
 					var newLeft = e.offsetLeft;

					/*if (screen.width==800||screen.height==600){
						var newLeft = 102;			
					}else if (screen.width==1024||screen.height==768){
						var newLeft = 164;
					}else if (screen.width==1152||screen.height==864){
						var newLeft = 230;
					}else if (screen.width==1280||screen.height==960){
						var newLeft = 294;							
					}else if (screen.width==1280||screen.height==1024){
						var newLeft = 294;
					}else if (screen.width==1440||screen.height==900){
						var newLeft = 376;						
					}else{
						var newLeft = 164;
					}*/
			//			if (menu==myMenu2) {
			//				newLeft = 304;  // for menu2
			//			}	
						//alert(myMenu2);
						var minWindowWidth = 984;
						if (getWindowWidth() <= minWindowWidth){
							if (navigator.userAgent.indexOf('Win')!=-1){
								var pcOffset = 10;
							} else {
								var pcOffset = 0;
							}
							//newLeft = minWindowWidth / 2 + offset + pcOffset;
							//newleft = 193;
											
						}
				  // setting the left position in netscape is a little different than IE
						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 getWindowWidth()
		{
			return window.innerWidth ? window.innerWidth : document.body.offsetWidth;
		}	


    ypSlideOutMenu.writeCSS();

