﻿var docEle = function() {
return document.getElementById(arguments[0]) || false;
}
function removieAll() {
document.body.removeChild(docEle(_id));
document.body.removeChild(docEle(m));
return false;
}

function openNewDiv(_id,casurl) {
var m = "mask";
if (docEle(_id)) document.removeChild(docEle(_id));
if (docEle(m)) document.removeChild(docEle(m));
// 新激活图层
var newDiv = document.createElement("div");
newDiv.id = _id;
newDiv.style.position = "absolute";
newDiv.style.zIndex = "9999";
newDiv.align="center";
newDiv.style.cursor="pointer";
//newDiv.style.width = parseInt(document.documentElement.clientWidth);
//newDiv.style.height ="100%";
newDiv.style.height = parseInt(document.documentElement.clientHeight)+"px";
newDiv.style.width =parseInt(document.documentElement.clientWidth)+"px";
//newDiv.style.background = "#ffcc33";
//newDiv.style.border = "1px solid #860001";
newDiv.style.padding = "0px";
newDiv.style.margin = "0px";
newDiv.style.overflow="hidden";
//正文内
//newDiv.style.top = parseInt(document.documentElement.scrollTop)+"px"
newDiv.style.left = "0px"; // 屏幕居中容
newDiv.innerHTML = "<table id=closepic height=100% style=border-collapse:collapse; border-spacing:0px;><tr><td align=center><div style=cursor:pointer;background-image:url(images/daohang_bg.png);background-repeat:repeat-x;><span style=line-height:37px;margin-right:2px;padding-right:2px;color:#FFFFFF;text-decoration:none;text-transform:none;font-weight:bold>CLOSE</span><br><img id=iso src=images/"+casurl+"></div></td></tr></table>";
function noscroll(){
pxii =parseInt(document.documentElement.scrollTop)+"px";
newDiv.style.top=newMasktext.style.top=pxii;
};
function initialize()
{
timer=setInterval(noscroll,1);
};
function sc(){
clearInterval(timer);
};
initialize();

newDiv.onclick=function(){
document.body.removeChild(docEle(_id));
document.body.removeChild(docEle(m));
sc();
return false;
	}
document.body.appendChild(newDiv);


var newMask = document.createElement("div");
newMask.id = m;
newMask.style.position = "absolute";
newMask.style.zIndex = "9998";
newMask.style.width = parseInt(document.documentElement.clientWidth) + "px";
newMask.style.height = parseInt(document.documentElement.scrollHeight) +"px";
newMask.style.top ="0px";
newMask.style.cursor="pointer";
newMask.style.left = "0px";
newMask.style.background = "#273861";
newMask.style.filter = "alpha(opacity=95)";
newMask.style.opacity = "0.95";
newMask.style.overflow="hidden";
var newMasktext = document.createElement("div");
newMasktext.style.position="absolute";
newMasktext.style.width ="100%";
newMasktext.innerHTML="<font color=#ffffff>there is loading,Please wait for a moment...</font>"
newMasktext.style.lineHeight=parseInt(document.documentElement.clientHeight) + "px";
newMasktext.style.textAlign="center";
newMasktext.style.overflow="hidden";
newMask.onclick=function () {
document.body.removeChild(docEle(_id));
document.body.removeChild(docEle(m));
sc();
return false;
};
newMask.appendChild(newMasktext);
document.body.appendChild(newMask);
}

