	function getObj(name) {
		if (document.getElementById) {
			if(document.getElementById(name)) {
				this.obj = document.getElementById(name);
				this.style = document.getElementById(name).style;
			}
		}
		else if (document.all) {
			if(document.all[name]) {
				this.obj = document.all[name];
				this.style = document.all[name].style;
			}
		}
		else if (document.layers) {
			if (document.layers[name]) {
				this.obj = document.layers[name];
				this.style = document.layers[name];
			}
		}
	}
	
	function findPosX(obj) {
		var curleft = 0;
		if (obj.offsetParent) {
			while (obj.offsetParent) {
				curleft += obj.offsetLeft
				obj = obj.offsetParent;
			}
		}
		else if (obj.x)
			curleft += obj.x;

		return curleft;
	}
	
	function loadMenu() {
		menuContainer = (new getObj('menu1Container')).obj
		contentContainer = (new getObj('content')).obj;
		menuContainer.style.display = 'none';
	
		objX = findPosX(contentContainer);
		x = contentContainer.offsetWidth + objX;
	
		menuContainer.style.display = 'block';
	
		var menus = [
						new ypSlideOutMenu("menu1", "right", x, 99, 96, 154),
					]
	
		menus[0].onactivate = function() { repositionMenu(menus[0], 300); }
	
		function repositionMenu(menu, offset) {
			var newLeft = getWindowWidth() / 2 + offset;
			menu.container.style ? menu.container.style.left = newLeft + "px" : menu.container.left = newLeft;
		}
	
		function getWindowWidth() {
			return window.innerWidth ? window.innerWidth : document.body.offsetWidth;
		}
	}
	loadMenu();

