var Box=function(sId){this._id=sId;this.parent=Box;}
if(typeof Box.isGecko=="undefined"){var Puser=navigator.userAgent.toLowerCase();Box.isGecko=(Puser.indexOf("gecko")>-1);
Box.isOpera=(typeof window.opera!="undefined");Box.isIe=(Puser.indexOf("msie")>-1&&!Box.isOpera);}
Box.getSize=function(){var Doc=document.body;var W,H;if(Box.isGecko){W=Doc.scrollWidth;H=window.innerHeight+window.scrollMaxY;}else{W=(Doc.scrollWidth>Doc.offsetWidth)?Doc.scrollWidth:Doc.offsetWidth;H=(Doc.scrollHeight>Doc.offsetHeight)?Doc.scrollHeight:Doc.offsetHeight;}if(!Box.isIe){this.Wi=window.innerWidth;this.Hi=window.innerHeight;}else{var oDocObj=(document.documentElement&&document.documentElement.clientHeight)?document.documentElement:Doc;this.Wi=oDocObj.clientWidth;this.Hi=oDocObj.clientHeight;}this.pHeight=(H<this.Hi)?this.Hi:H;this.pWidth=(W<this.Wi)?this.Wi:W;}
Box.getTop=function(){return(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0)}
Box.getHeight=function(){if(document.body.scrollHeight>=this.pHeight){return document.body.scrollHeight;}else{return this.pHeight;}}
Box.prototype.show=function(){if(typeof this.element!="undefined"){return;}this.element=document.createElement("div");this.element.id=this._id;this.style=this.element.style;this.init();document.body.appendChild(this.element);}
Box.prototype.hide=function(){document.body.removeChild(this.element);delete this.element;delete this.style;}
Box.prototype.setData=function(str){this.element.innerHTML=str;}
Box.Message=new Box('m_box');
Box.cl=new Array();
Box.closeForm = function(){Box.hideOthers();for(var i=0;i<Box.cl.length;i++){var func=Box.cl[i];func.call();}}
Box.hideOthers = function (obj){Box.Message.style.display='none';if(obj){var topLeave=(obj.parent.getTop()+(obj.parent.Hi-300)/2);if(topLeave<=0){obj.style.top=100;}else{obj.style.top=topLeave+'px';}obj.style.left=((obj.parent.pWidth-208)/2)+'px';obj.style.display='';}}
Box.Message.init=function(){this.style.display='none';this.style.position="absolute";this.style.zIndex=1000;this.style.left=((this.parent.pWidth-208)/2)+'px';}
Box.Message.shows=function(msg){Box.hideOthers(this);this.setData('<div style="padding:10px 30px 10px 30px;background:#f4ffe2;border:#b5e48f 1px solid;color:#1b9200;"><img src="/images/Searching.gif" />'+msg+'</div>');}
Box.getSize();
Box.Message.show();