window.$n=function(n){return top.document.getElementsByTagName?top.document.getElementsByTagName(n):new Array()}
window.$c=function(n){return this.document.getElementsByTagName?this.document.getElementsByTagName(n):new Array()}

function lockFaceAdpter(){

	var titlecolor,msgw,msgh,bordercolor;
	msgw=300;//提示窗口的宽度
	msgh=80;//提示窗口的高度
	titleheight=25 //提示窗口标题高度
	bordercolor ="#999999"; //提示窗口的边框颜色
	titlecolor="#0966B1"; //提示窗口的标题颜色
			
	var sWidth,sHeight;
	sWidth=document.body.scrollWidth;
	sHeight=document.body.scrollHeight;
	
	var msgObj=document.createElement("div")
	msgObj.setAttribute("id","msgDiv");
	msgObj.setAttribute("align","center");
	msgObj.style.background="#FFFFFF";
	msgObj.style.border="2px solid " + bordercolor;
	msgObj.style.position = "absolute";
	msgObj.style.left = sWidth - msgw-15;
	msgObj.style.top = 0;
	msgObj.style.width = msgw + "px";
	msgObj.style.height = msgh + "px";
	msgObj.style.textAlign = "center";
	msgObj.style.zIndex = "10001";
	msgObj.style.padding = "0 0 0 0";

	var alertInfo=document.all['alertInfo'];
	//alert(alertInfo);
	msgObj.innerHTML = alertInfo.innerHTML;

	document.body.appendChild(msgObj);
}

function showSuccessInfo(top, left) {
	var titlecolor,msgw,msgh,bordercolor;
	msgw=350;//提示窗口的宽度
	msgh=25;//提示窗口的高度
	titleheight=25 //提示窗口标题高度
	bordercolor="#999";//提示窗口的边框颜色
	titlecolor="#445588";//提示窗口的标题颜色
		
	var sWidth,sHeight;
	sWidth=document.body.scrollWidth;
	sHeight=document.body.scrollHeight;
	
	var msgObj=document.createElement("div")
	msgObj.setAttribute("id","successInfoMsgDiv");
	msgObj.setAttribute("align","right");
	msgObj.setAttribute("vertical-align","top");
	msgObj.style.background="#FFFFFF";
	//msgObj.style.border="1px solid " + bordercolor;
	msgObj.style.position = "absolute";
	msgObj.style.left = (sWidth - msgw) / 2 + left;
	msgObj.style.top = top;
	msgObj.style.width = msgw + "px";
	msgObj.style.height = msgh + "px";
	msgObj.style.textAlign = "right";
	msgObj.style.zIndex = "10001";
	msgObj.style.padding = "0 0 0 0";

	var alertInfo=document.all['successInfo'];
	//alert(alertInfo);
	msgObj.innerHTML = alertInfo.innerHTML;

	document.body.appendChild(msgObj);
}

function closeDiv(){
	var bgObj = document.getElementById("bgDiv");
	var msgObj = document.getElementById("msgDiv");
	document.body.removeChild(msgObj);

}

function ShowWin(strValue,dialogWidth,dialogHeight)
{
	window.open(strValue,"","height=" + dialogHeight + ",width=" + dialogWidth + ",top=100, left=200,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}


function genString(s, n)
{
	var a = new Array();
	for (var i=0;i<n;i++)
		a[a.length] = s;
	return a.join("");
}

function isEmail(S) {
	var pass=0;
	if (window.RegExp) {
		var tempS="a";
		var tempReg=new RegExp(tempS);
		if (tempReg.test(tempS)) pass=1;
	}
	if (!pass) 
		return (S.indexOf(".") > 2) && (S.indexOf("@") > 0);
	var r1=new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	var r2=new RegExp("^[a-zA-Z0-9\\.\\!\\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\}\\~]*[a-zA-Z0-9\\!\\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\}\\~]\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
	return (!r1.test(S) && r2.test(S));
}

function showHideDiv(divId, isShow){
	
 var arr = document.getElementById(divId);
 if (arr != undefined) { 
   arr.style.display =  isShow ? "" : "none"; 
  }
}

function ShowWin2(strValue,dialogWidth,dialogHeight)
{
	var strUrl=strValue;
	var t = (screen.height - dialogHeight) / 2; 
	var l = (screen.width - dialogWidth) / 2;
	window.open(strUrl,"","height="+dialogHeight+"px, width="+dialogWidth+"px, top="+t+", left="+l+", toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no");
}

function openMainUrl(url){
	document.all.MAIN.src = url;
	closeLeft();
}
/*
function openMenuPage(menuGroupId, menuId) {
    var vmenuGroupId=menuGroupId;
    if(vmenuGroupId!=null)
       vmenuGroupId='menu'+vmenuGroupId;
	top.menu.clickMenuButton(vmenuGroupId,'menu'+menuId);
}
*/

//操作成功提示信息
function showSuccessInfo4Admin() {
    var titlecolor, msgw, msgh, bordercolor;
    msgw = 350; //提示窗口的宽度
    msgh = 25; //提示窗口的高度
    titleheight = 25 //提示窗口标题高度
    bordercolor = "#999"; //提示窗口的边框颜色
    titlecolor = "#445588"; //提示窗口的标题颜色

    var sWidth, sHeight;
    sWidth = document.body.scrollWidth;
    sHeight = document.body.scrollHeight;

    var msgObj = document.createElement("div")
    msgObj.setAttribute("id", "successInfoMsgDiv");
    msgObj.setAttribute("align", "right");
    msgObj.setAttribute("vertical-align", "top");
    msgObj.style.background = "#FFFFFF";
    //msgObj.style.border="1px solid " + bordercolor;
    msgObj.style.position = "absolute";
    msgObj.style.left = (sWidth - msgw) / 2 - 50;
    msgObj.style.top = 0;
    msgObj.style.width = msgw + "px";
    msgObj.style.height = msgh + "px";
    msgObj.style.textAlign = "right";
    msgObj.style.zIndex = "10001";
    msgObj.style.padding = "0 0 0 0";

    var alertInfo = document.all['successInfo'];
    //alert(alertInfo);
    msgObj.innerHTML = alertInfo.innerHTML;

    document.body.appendChild(msgObj);
}
