function _gel(a) {
	return document.getElementById?document.getElementById(a):null
}

function isShow(sDivId, sDisplay){
	_gel(sDivId).style.display = sDisplay;
}
function showIframe(sDivId) {
	var DivRef = _gel(sDivId);
    var IfrRef = _gel('DivShim');
	var arrayPageSize = getPageSize();
	IfrRef.style.width = arrayPageSize[0];
	IfrRef.style.height = arrayPageSize[1];
	IfrRef.style.top = DivRef.style.top;
	IfrRef.style.left = DivRef.style.left;
	IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	IfrRef.style.display = "block";
}

function enterforbid()
{
  if(event.keyCode==13)
     event.keyCode=9;	
  if(event.ctrlKey)
     event.returnValue=false;
}
function entertj(id)
{
  if(event.keyCode==13)
     document.getElementById(id).click();	
  if(event.ctrlKey)
     event.returnValue=false;
}

function getPageSize(){
	
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ 
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { 
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) {	
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { 
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) {
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	

	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

function msgs(sContent){        //只有确定按钮
	overlay(2);
	var arrayPageSize = getPageSize();
	var B = _gel("msgs");
	if(B!=null){
			
			D="<DIV style=\"width:550px;\">";
			D+="<table width='100%' border='0' cellspacing='5' cellpadding='0''>";
			D+="<tr><td height=\"413\" valign=\"top\" style=\"line-height:25px; color:#000;\"><img src='upload/"+sContent+"'></td></tr>";
			D+="<tr><td align=\"center\"><input type=\"button\" name=\"button2\" class=\"button\" value=\"关闭\"  onClick=\"javascript:AllCloseDiv();\" /></td></tr>";
			D+="</table>";
			D+="</DIV>";
			B.innerHTML = D;
			
			B.style.left = (arrayPageSize[0]/2-230)+"px";
			B.style.top = document.documentElement.scrollTop+(arrayPageSize[3]/2-130)+"px";
			isShow('msgs', 'block');
		}
		
}


function overlay(i){
	if(i == 1) { i = "none" }
	if(i == 2) { i = "block" }
	var B = _gel("overlay");
	isShow('overlay', i);
	//showIframe('overlay');
	var arrayPageSize = getPageSize();
	B.style.height = arrayPageSize[1]+"px";

}

function overlayt(i){
	if(i == 1) { i = "none" }
	if(i == 2) { i = "block" }
	var B = _gel("overlay");
	isShow('overlay', i);
	//showIframe('overlay');
	var arrayPageSize = getPageSize();
	B.style.height = arrayPageSize[1]+85+"px";

}

function AllCloseDiv()
{
	isShow('msgs', 'none');
	isShow('overlay','none');
	//isShow('DivShim','none');
}



function IsReturnFalse() {
	AllCloseDiv();
}

function AllCloseDiv()
{
	isShow('msgs', 'none');
	isShow('overlay','none');
}

function _esc(a) {
	return window.encodeURIComponent?encodeURIComponent(a):escape(a)
}

function _dlsetp(a,b){
	
	if(!b){
		b=_esc(document.location)
	}
	
	document.location = a;	
}

