
function $(id){return document.getElementById(id);}
function $$(name,formName){formName=formName||"form1";return document.forms[formName].elements[name];}
function addEvent(el,evname,func){if(typeof func=="string"){func=new Function('eval("'+func+'");');}
if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}}
function exec(a,o){for(var i=0;i<a.length;i++){switch(typeof a[i]){case"string":eval(a[i]);break;default:if(o)a[i].call(o);else a[i].call();}}}
function realOffset(element){var valueT=0,valueL=0;do{valueT+=element.scrollTop||0;valueL+=element.scrollLeft||0;element=element.parentNode;}while(element);return[valueL,valueT];}
function cumulativeOffset(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;}while(element);return[valueL,valueT];}
function innerSize(){var myWidth=0,myHeight=0;if(typeof(window.innerWidth)=='number'){myWidth=window.innerWidth;myHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth||0;myHeight=document.body.clientHeight||0;}
return[myWidth,myHeight];}
function popup(name,zindex){var _i=this;this._name=name;this._zindex=zindex||100;this._containerId=name+"_container";this._bgId=name+"_bg";this._bgHTML='<div ID="'+this._bgId+'" STYLE=" top:0px; left:0px;background-color:#000;POSITION: absolute; Z-INDEX:'+this._zindex+';" class="overlay"></div>';this._boxId=name+"_box";this._boxHTML='<div id="'+this._boxId+'" style="display:none; Z-INDEX:'+this._zindex+'; POSITION:absolute;"><div style="width:300px; display:;"><div class="win_wait">正在处理中，请稍等...</div></div></div>';this._offsetTop=100;this._offsetTop_temp=this._offsetTop;this._onBO=[];this._open=[];this._onAO=[];this._onBC=[];this._close=[];this._onAC=[];this._intPos=[];this._intId=null;this.openDiv=function(){exec(this._onBO,this);exec(this._open,this);exec(this._onAO,this);};this.closeDiv=function(){exec(this._onBC,this);exec(this._close,this);exec(this._onAC,this);};this._open=[function(){if($(this._boxId))this.closeDiv();},function(){if(!$(this._containerId)){var c=document.createElement("div");c.setAttribute("id",this._containerId);c.style.left="0";c.style.width="0px";c.style.float="left";document.body.appendChild(c);}
var _opcaity=0.35;$(this._containerId).innerHTML+=this._bgHTML;var _bgElement=$(this._bgId);_bgElement.style.opacity=_opcaity;if(/MSIE/.test(navigator.userAgent)){_bgElement.style.filter=_bgElement.style.filter.replace(/alpha\([^\)]*\)/gi,'')+'alpha(opacity='+_opcaity*100+')';};$(this._containerId).innerHTML+=this._boxHTML;this._intId=window.setInterval(function(){exec(_i._intPos,_i);},100);}];this._close=[function(){$(this._containerId).innerHTML="";$(this._containerId).parentNode.removeChild($(this._containerId));try{window.clearInterval(this._intId);}catch(e){}}];this._onAC=[function(){this._onAO=[];this._onBC=[];this._intId=null;this._intPos=[this._intPos[0]];this._offsetTop=70;}];this._intPos=[function(){if($(this._bgId)==null)return false;var bg=$(this._bgId);bg.style.left=0;bg.style.top=0;bg.style.width=(document.body.offsetLeft+document.body.scrollWidth)+"px";bg.style.height=getPageSize()[1]+"px";if($(this._boxId)==null)return false;var p=realOffset(document.body);var box=$(this._boxId);box.style.width=(box.firstChild.style?box.firstChild.style.width.replace("px",""):"0")+"px";var w=parseInt(box.style.width.replace("px","")||"0");var _pageH=parseInt(getPageSize()[1]);var _winH=parseInt(getPageSize()[3]);var _boxH=parseInt(box.style.height);var _boxT=parseInt(box.style.top)||0;box.style.left=(p[0]+(innerSize()[0]-w)*0.5)+"px";if(_boxH>=_winH&&box.style.display!="none")return;if(_boxH+_boxT>=_winH){this._offsetTop_temp=this._offsetTop_temp-parseInt(_boxH+_boxT-_winH);}else{this._offsetTop_temp=this._offsetTop;}
if(this._offsetTop_temp>this._offsetTop)this._offsetTop_temp=this._offsetTop;if(this._offsetTop_temp<0)this._offsetTop_temp=0;box.style.top=(p[1]+this._offsetTop_temp)+"px";box.style.display="inline";box.style.visibility="visible";}];}
var ajax_popup=new popup("ajax_popup",150);function show_ajax_popup(url,postArg,fixTop){if($(ajax_popup._boxId)){ajax_popup.closeDiv();}
if($(common_popup._boxId)){common_popup.closeDiv();}
ajax_popup._intPos.push(function(){if(url){ajaxPostDateToPage(url,postArg||"",ajax_popup._boxId);}
if($(ajax_popup._boxId+"_closeCross")){addEvent($(ajax_popup._boxId+"_closeCross"),"click","ajax_popup.closeDiv()");}
ajax_popup._intPos=[ajax_popup._intPos[0]];});ajax_popup.openDiv();}
var common_popup=new popup("common_popup",9999);function show_common_popup(url,width,height,fixTop){if($(ajax_popup._boxId)){ajax_popup.closeDiv();}
if($(common_popup._boxId)){common_popup.closeDiv();}
if(fixTop)common_popup._offsetTop=fixTop;common_popup._boxHTML='<div id="'+common_popup._boxId+'" style="Z-INDEX:'+common_popup._zindex+'; POSITION:absolute; background-color:#fff; border:0;width:'+(width||600)+'px;height:'+(height||400)+'px; display:none;"><div  style="width:'+(width||600)+'px;height:'+(height||400)+'px;"><iframe id="'+common_popup._boxId+'_iframe" frameborder="0" width="'+(width||600)+'" height="'+(height||400)+'"></iframe></div></div>';common_popup._intPos.push(function(){$(common_popup._boxId+'_iframe').src=url;common_popup._intPos=[common_popup._intPos[0]];});common_popup.openDiv();$(common_popup._bgId).title="双击关闭";$(common_popup._bgId).ondblclick=function(){common_popup.closeDiv()};}
function getPageSize(win){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSize;}