/*
* url : 链接url
* func : 回调方法
* width : 面版宽
* height: 面版高
* id	 : 面版id
* left  : 调整面版位置 default : -225px;
* top : 调整面版位置 default : -150
*/ 
var box = {
	func : function(){},
	load : function(obj){
		var BgPanel = document.createElement("DIV");
		try{
		  document.body.removeChild(document.getElementById(obj.id));
		  document.body.removeChild(document.getElementById(obj.alertid ? obj.alertid : 'alertpanel'));
		  document.body.onselectstart = function(){return true;}
		  document.body.oncontextmenu = function(){return true;}
		}catch(e){}
		BgPanel.id = obj.id;
		BgPanel.style.position = "absolute";
		BgPanel.style.left = "0px";
		BgPanel.style.top = "0px";
		BgPanel.style.width = "100%";
		BgPanel.style.height = ((document.documentElement.clientHeight>document.documentElement.scrollHeight)?document.documentElement.clientHeight:document.documentElement.scrollHeight)+"px";
		BgPanel.style.background = "#000";
		BgPanel.style.textAlign = "center";
		BgPanel.style.zIndex = "1000";
		BgPanel.style.filter = "alpha(opacity=20)";
		BgPanel.style.opacity = 0.1;
	
		
		var alertFram = document.createElement("DIV");
		alertFram.id = obj.alertid ? obj.alertid : 'alertpanel';
		alertFram.style.position = "absolute";
		alertFram.style.left = "0%";
		alertFram.style.top = obj.top ? obj.top : '22%';
		alertFram.style.marginLeft =  obj.left ? obj.left : "-225px";
		alertFram.style.width = obj.width ? obj.width + 'px' : "350px";
		alertFram.style.height = obj.height? obj.height + 'px' :"80px";
		alertFram.style.textAlign = "center";
		alertFram.style.lineHeight = "80px";
		alertFram.style.zIndex = "10001";

		strHtml  = '';
		
		if(obj.iframe == true)
		{
			strHtml  += '<iframe frameborder="0" name="load_box" id="load_box" width="' + (obj.width ? obj.width : 350) + '" height="' + (obj.height? obj.height : 200) + '" src="' + obj.url + '"></iframe>';
		}else{
			strHtml  +='';
		}

		alertFram.innerHTML = strHtml;
		
		document.body.appendChild(BgPanel);
		document.body.appendChild(alertFram);

		document.body.onselectstart = function(){return false;}
		document.body.oncontextmenu = function(){return false;}

	},
	
	unload : function(id,alertpanel){
		try{
		  var panelid = alertpanel ? alertpanel : 'alertpanel';
		  document.body.removeChild(document.getElementById(panelid));
		  document.body.removeChild(document.getElementById(id));
		  document.body.onselectstart = function(){return true;}
		  document.body.oncontextmenu = function(){return true;}
		}catch(e){}
	}
}
