function mask(config){
if(typeof config == 'object'){
this.win = config.win || window;
this.tip = config.tip || '请等待...';
this.id = config.id || 'mask';
this.tipColor = config.fontColor || '#ff0000';
}else{
this.win = window;
this.tip = '请等待...';
this.id = 'mask';
this.tipColor = '#ff0000';
}
this.doc = this.win.document;
this.show = function(){
var maskElement = this.doc.getElementById(this.id);
if (maskElement) this.doc.body.removeChild(maskElement);
//mask遮罩层
var newMask = this.doc.createElement("div");
newMask.id = this.id;
newMask.style.position = "absolute";
newMask.style.zIndex = "1";
var _scrollWidth = Math.max(this.doc.body.scrollWidth,this.doc.documentElement.scrollWidth);
var _scrollHeight = Math.max(this.doc.body.scrollHeight,this.doc.documentElement.scrollHeight);
newMask.style.width = (_scrollWidth-25) + "px";
newMask.style.height = (_scrollHeight-25) + "px";
newMask.style.top = "0px";
newMask.style.left = "0px";
newMask.style.background = "#E1E1E1";
newMask.style.filter = "alpha(opacity=40)";
newMask.style.opacity = "0.40";
newMask.innerHTML ='<div align="center" style="margin-top:' + _scrollHeight /2 + 'px;"><font color="' + this.tipColor + '"><b>' + this.tip + '</b></font><div>';
this.doc.body.appendChild(newMask);
};
this.remove = function(){
this.doc.body.removeChild(this.doc.getElementById(this.id));
};
}