function DyLayer() {
function el(id) { return document.getElementById(id); };
//加載狀態
this.LoadStatus = "";
//css名
this.CssName = "layermask";
//創建遮蓋層
this.render = function(dw, dh) {
try {
var objDiv = el("sysdiv_wait");
if (objDiv == null) {
objDiv = document.createElement("DIV");
objDiv.id = "sysdiv_wait";
objDiv.className = this.CssName;
document.body.appendChild(objDiv);
var w = 0;
var h = 0;
var size = qp_shared.getPageSize();
if (dw != null)
w = dw;
else
w = size.width;
if (dh != null)
h = dh;
else
h = size.height;
objDiv.style.width = w + "px";
objDiv.style.height = h + "px";
var objImg = document.createElement("IMG");
objImg.id = "sysimg_wait";
objImg.src = qp_shared.getURL("images/wait/reloading.gif");
objImg.style.zIndex = 999999;
objImg.style.position = "absolute";
objImg.style.left = parseInt((w-24)/2) + "px";
objImg.style.top = parseInt((h-24)/2) + "px";
document.body.appendChild(objImg);
}
}catch(e){}
};
//展現遮蓋層
this.dw_render = function(w, h, resizeToMax, cssName) {
this.LoadStatus = "Loading";
//如果需要最大化窗口時
if (resizeToMax) {
window.moveTo(0, 0);
window.resizeTo(window.screen.availWidth, window.screen.availHeight);
};
//如果有自定css
if (cssName != null) {
this.CssName = cssName;
};
this.render(w, h);
};
//展現遮蓋層
this.show = function(w, h, resizeToMax, cssName) {
this.dw_render(w, h, resizeToMax, cssName);
};
this.show2 = function(h, cssName) {
this.dw_render(null, h, null, cssName);
};
this.show3 = function(cssName) {
this.dw_render(null, null, null, cssName);
};
//刪除遮蓋層
this.dw_remove = function() {
try{
this.LoadStatus = "";
var objDiv = el("sysdiv_wait");
if (objDiv != null)
document.body.removeChild(objDiv);
var objImg = el("sysimg_wait");
if (objImg != null)
document.body.removeChild(objImg);
}catch(e){}
};
//刪除遮蓋層
this.remove = function() {
this.dw_remove();
}
};
var oLayer = new DyLayer();
//鎖定界面
function lockingLayer() {
oLayer.dw_render();
};