function G(id) {
return document.getElementById(id);
}
function GC(t){
return document.createElement(t);
}
String.prototype.trim = function(){
return this.replace(/(^\s*)|(\s*$)/g, '');
}
function isIE(){
return (document.all && window.ActiveXObject && !window.opera)?true:false;
}
function popCoverDiv(){
if (G("cover_div")) {
G("cover_div").style.display = '';
}
else {
var coverDiv = GC('div');
document.body.appendChild(coverDiv);
coverDiv.id = 'cover_div';
with(coverDiv.style) {
position = 'absolute';
background = '#CCCCCC';
left = '0px';
top = '0px';
var bodySize = getBodySize();
width = bodySize[0] + 'px'
height = bodySize[1] + 'px';
zIndex = 98;
if (isIE()) {
filter = "Alpha(Opacity=60)";
}
else {
opacity = 0.6;
}
}
}
}
function getBodySize(){
var bodySize = [];
with(document.documentElement) {
bodySize[0] = (scrollWidth>clientWidth)?scrollWidth:clientWidth;
bodySize[1] = (scrollHeight>clientHeight)?scrollHeight:clientHeight;
}
return bodySize;
}
function DialogShow(showdata,ow,oh,w,h) {
var DivWidth=300; //显示区域的宽度
popCoverDiv();
if (G("sign_div")) {
G("sign_div").style.display = '';
}
else {
var signDiv = GC('div');
document.body.appendChild(signDiv);
signDiv.id = 'sign_div';
signDiv.align = "center";
with (signDiv.style) {
position = 'absolute';
left = (document.documentElement.clientWidth - DivWidth)/2 +'px';
top = (document.documentElement.clientHeight - 300)/2 + 'px';
width = DivWidth + 'px';
zIndex = 99;
background = '#FFFFFF';
border = '#66CCFF solid 1px';
}
}
G("sign_div").innerHTML=showdata;
}
function DialogHide() {
G("sign_div").style.display = 'none';
G("cover_div").style.display = 'none';
document.body.style.overflow = '';
}
|