{
CM();
ShowLoading('<div class="pack_loading_box"><p>正在进行中,请稍等...</p></div>', IsEmpty(bgId) ? null : bgId,disableBackground);
}
============================================================================
CM():
function CM() {
if (o('alert_div') != null) document.body.removeChild(o("alert_div"));
if (o('alert_div_MSGBOX') != null) document.body.removeChild(o("alert_div_MSGBOX"));
if ($.browser.msie && $.browser.version == '6.0')
ShowSelect(true);
var bgObj = document.getElementById("bgDiv");
if (bgObj != null) {
document.body.removeChild(bgObj);
}
if (bgObj != null) {
bgObj = null;
}
}
function o(obj) {
return document.getElementById(obj);
}
//from jquery-ext.js
function ShowSelect(xShow, objId) {
$('select', objId == null ? null : ('#' + objId)).each(function () {
if (xShow && this.attributes["hidden"] == null)
$(this).show();
else
$(this).hide();
});
}
===========================================================
ShowLoading:
function ShowLoading(l, sId, disableLockBackground)//ShowLoading
{
ShowDiv(l, null, null, "#7ec2e9", "LOADING", 0, 0, sId);
if (!disableLockBackground)
ShowBackgroup(sId);
try {
if (o('_sldtext') != null) {
o('_sldtext').focus();
}
} catch (e) {
}
}
//from jquery-ext.js
function ShowDiv(content, width, height, bordercolor, borderstyle) {
ShowDiv(content, width, height, bordercolor, "", 0, 0);
}
function ShowBackgroup(divId) {
if (o("bgDiv") != null) return;
function height() {
var scrollHeight,
offsetHeight;
// handle IE 6
if ($.browser.msie && $.browser.version < 7) {
scrollHeight = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
);
offsetHeight = Math.max(
document.documentElement.offsetHeight,
document.body.offsetHeight
);
if (scrollHeight < offsetHeight) {
return $(window).height() + 'px';
} else {
return scrollHeight + 'px';
}
// handle "good" browsers
} else {
return $(document).height() + 'px';
}
}
function width() {
var scrollWidth,
offsetWidth;
// handle IE
if ($.browser.msie) {
scrollWidth = Math.max(
document.documentElement.scrollWidth,
document.body.scrollWidth
);
offsetWidth = Math.max(
document.documentElement.offsetWidth,
document.body.offsetWidth
);
if (scrollWidth < offsetWidth) {
return $(window).width() + 'px';
} else {
return scrollWidth + 'px';
}
// handle "good" browsers
} else {
return $(document).width() + 'px';
}
}
var postion = { "left": "0px", "top": "0px", "width": 0, "height": 0 };
//var opacity = 0.8;
function getPix(pixel) {
pixel = pixel.indexOf('px') > -1 ? pixel.replace('px', '') : pixel;
var num = parseFloat(pixel, 10);
return isNaN(num) ? 0 : num;
}
if (divId != null && o(divId) != null) {
var objPositoion = $(o(divId)).offset();
//var marginTop = getPix($(o(divId)).css('margin-top')) + getPix($(o(divId)).css('padding-top'));
//var marginLeft = getPix($(o(divId)).css('margin-left')) + getPix($(o(divId)).css('padding-left'));
//postion.top = (objPositoion.top + marginTop) + 'px';
//postion.left = (objPositoion.left + marginLeft) + 'px';
//postion.height = ($(o(divId)).innerHeight() - ($(o(divId)).innerHeight() - $(o(divId)).height()) / 2 - marginTop) + 'px';
//postion.width = $(o(divId)).width() + 'px';
postion.top = objPositoion.top;
postion.left = objPositoion.left;
postion.height = $(o(divId)).outerHeight();
postion.width = $(o(divId)).outerWidth();
opacity = 0.25;
} else {
postion.height = height();
postion.width = width();
}
var bgObj = document.createElement("div");
bgObj.id = 'bgDiv';
$(bgObj).css({ "left": postion.left, "top": postion.top, "width": postion.width, "height": postion.height });
bgObj.className = "modalBackground";
//bgObj.style.zIndex = "100";
//bgObj.style.opacity = opacity;
//if (!($.browser.msie && parseInt($.browser.version, 10) > 8))
// bgObj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=15)";
if ($.browser.msie && $.browser.version < 7) {
$(bgObj).prepend($('<iframe src="javascript:false;document.write(\'\');"></iframe>').css({ opacity: 0 }).css({ width: postion.width, height: postion.height }));
ShowSelect(false);
}
document.body.appendChild(bgObj);
}