/**
 * @author zerostyle
 * @QQ:83226227
 */
var RBClick="";

Namespace.register("ZeroStyle.Web.RightBtClick");

ZeroStyle.Web.RightBtClick=
{
	txtArray:"",
	funArray:"",
	ph:18,//每条选项的高度c
	mwidth:100,//菜单的总宽度c
	bgcolor:"#eee",//菜单没有选中的背景色c
	txcolor:"black",//菜单没有选中的文字色c
	sbgcolor:"#ccc",//菜单选中的选项背景色c
	stxcolor:"black",//菜单选中的选项文字c
	rightMenu:null,
	m_over:"",
	m_out:"",
	InitRightMenu:function()
	{
		
		with(this)
		{	
			m_over="this.style.background='"+sbgcolor+"';this.style.color='"+stxcolor+"';";
			m_out="this.style.background='"+bgcolor+"';this.style.color='"+txcolor+"';";
			rightMenu=document.createElement("div");//属性c
			rightMenu.setAttribute("id", "RigthBtDiv");//设置ID
		}
	},
	ShowRightMenu:function()
	{
		with(this)
		{
			rightMenu.style.background=bgcolor;
		 	rightMenu.style.color=txcolor;
		 	rightMenu.style.width=mwidth;
		 	rightMenu.style.height=txtArray.length*ph;
		 	var h="<table class='RightMenuTable' height=\""+txtArray.length*ph+"px\">";
		 	var i=0;
		 	for(i=0;i<txtArray.length;i++)
		 	{
				if(txtArray[i]=="-")
				{
					h+="<tr class=\"split\"><td>"+
					"<hr/></td></tr>";
				}
				else{
					//alert(this.DoSomeThing[i])
		 	 		h+="<tr class=\"menuline\" height=\""+ph+"px\" onclick="+funArray[i]+" onMouseover=\""+m_over+"\" onMouseout=\""+m_out+"\">"+
					"<td>"+txtArray[i]+"</td></tr>";
			 	}
		 	}
		 	h+="</table>";
		 	rightMenu.innerHTML=h;
			document.getElementsByTagName("body")[0].appendChild(rightMenu);
			rightMenu.style.display="";
			rightMenu.style.zIndex = "100";
			rightMenu.style.cursor="default"
			rightMenu.style.position = "absolute";//c设置DIV为相对位置c
		 	rightMenu.style.top=event.clientY;
		 	rightMenu.style.left=event.clientX;
		}
	},
	HiddenRightMenu:function()
	{
		with(this)
		{
			if(rightMenu!=null)
			{
				document.getElementsByTagName("body")[0].removeChild(rightMenu)
			}
			rightMenu=null;
		}
	}
	
}


document.onclick=function()
{
	ZeroStyle.Web.RightBtClick.HiddenRightMenu();
}
document.oncontextmenu=function()
{
	/*if(ZeroStyle.Web.RightBtClick.rightMenu==null)
	{
		var menu=ZeroStyle.Web.RightBtClick;
		menu.txtArray=new Array(JoveTech.VVSWeb.Language.Text.Document_rightMenu1);
		menu.funArray=new Array("alert(JoveTech.VVSWeb.Language.Text.Sys_Description)");
		menu.InitRightMenu();
		menu.ShowRightMenu();
	}*/
	return false;
}