var _isShowLoading=false;var _isShowLoadingBox=false;var _isShowCustomMsg=false;var _boxOffsetLeft=0;var _boxOffsetTop=0;var _oBodys=document.getElementsByTagName('BODY');var _oBody=null;var DRMsgID=null;var DRMsg=null;var _ActiveXMLObj=null;var _LoadingDIV=null;var _ifm=null;var _isIE=navigator.appName.indexOf("Microsoft")!=-1;function _getProgressDIV(){_LoadingDIV=getObjByID('loading');if(!_LoadingDIV){_LoadingDIV=document.createElement('DIV');_LoadingDIV.id='loading';_oBody=document.getElementsByTagName('BODY')[0];if(_isIE){_oBody.insertAdjacentElement('afterBegin',_LoadingDIV);}else{_oBody.appendChild(_LoadingDIV);};var oTABLE=document.createElement("TABLE");var oTBODY=document.createElement("TBODY");var oTR=document.createElement("TR");var oTD=document.createElement("TD");oTD.align='center';oTD.width='100%';oTD.style.background='#656565';oTD.style.fontSize='12px';oTD.style.fontFamily='Verdana, Helvetica';oTD.innerHTML='<font color=white>Loading...</font>';oTR.appendChild(oTD);oTBODY.appendChild(oTR);oTABLE.appendChild(oTBODY);oTABLE.width='100%';oTABLE.cellspacing=0;oTABLE.cellpadding=0;_LoadingDIV.appendChild(oTABLE);_LoadingDIV.style.position='absolute';_LoadingDIV.style.zIndex=100;_LoadingDIV.style.height='17px';_LoadingDIV.style.width='70px';_LoadingDIV.style.background='#656565';var offLeft=document.body.clientWidth-70;var offTop=1;offLeft=parseInt(offLeft);offTop=parseInt(offTop);var mx=parseInt(document.body.scrollLeft+offLeft);var my=parseInt(document.body.scrollTop+offTop);_LoadingDIV.style.left=mx;_LoadingDIV.style.top=my;_LoadingDIV.style.left=document.body.clientWidth-70;};_oBody.onscroll=function(){_LoadingDIV.style.top=parseInt(document.body.scrollTop+1);};_oBody.onresize=function(){_LoadingDIV.style.top=parseInt(document.body.scrollTop+1);_LoadingDIV.style.left=document.body.clientWidth-70;}};function _getProgressDIVBox(){_LoadingDIV=getObjByID('loading');_oBody=document.getElementsByTagName('BODY')[0];if(!_LoadingDIV){_ifm=null;_LoadingDIV=document.createElement('DIV');_LoadingDIV.id='loading';if(_isIE){_oBody.insertAdjacentElement('afterBegin',_LoadingDIV);}else{_oBody.appendChild(_LoadingDIV);};var str="";str+="<table width='200' border='0' cellspacing='2' cellpadding='2' id='msgTable'>";str+="  <tr> ";str+="    <td align='center' bgcolor='#3068D8'>";str+="	    <table width='200' border='0' cellspacing='0' cellpadding='0' bgcolor='#EBF2FF'>";str+="        <tr> ";str+="          <td align='center' style='color: #222222; font-weight: bold; font-size:12px; font-family:Verdana,Helvetica'><BR>"+DRMsg+"<BR><BR></td>";str+="        </tr>";str+="      </table></td>";str+="  </tr>";str+="</table>";_LoadingDIV.innerHTML=str;_LoadingDIV.style.position='absolute';_LoadingDIV.style.height='200px';_LoadingDIV.style.width='300px';_LoadingDIV.style.zIndex=3;_LoadingDIV.style.left=document.body.clientWidth/2-100+_boxOffsetLeft;_LoadingDIV.style.top=document.body.scrollTop+250+_boxOffsetTop;if(_isIE){_LoadingDIV.style.filter="progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=135,Strength=5)";}};if(!_ifm){_ifm=document.createElement('IFRAME');_ifm.src="javascript:false";_ifm.style.position='absolute';_ifm.style.visibility='inherit';_ifm.style.top=0;_ifm.style.left=0;_ifm.style.width=0;_ifm.style.height=0;_ifm.style.zIndex=2;_ifm.frameBorder=0;_ifm.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';_ifm.id='ifm';if(_isIE){_oBody.insertAdjacentElement('afterBegin',_ifm);}else{_oBody.appendChild(_ifm);}};_setMsgBoxPos();_ifm.style.width=getObjByID('msgTable').offsetWidth-5;_ifm.style.height=getObjByID('msgTable').offsetHeight-5;_oBody.onscroll=function(){_setMsgBoxPos();};_oBody.onresize=function(){_setMsgBoxPos();}};function _getProgressCustomDIV(msgID,msg){_LoadingDIV=getObjByID(msgID);if(!_LoadingDIV){alert("Error! Msg ID can't be found!");};_LoadingDIV.innerHTML=msg;};function _getLoadingDIV(){if(_isShowLoading)_getProgressDIV();if(_isShowLoadingBox)_getProgressDIVBox();if(_isShowCustomMsg)_getProgressCustomDIV();};function _setMsgBoxPos(){var ifmOffset=2;_LoadingDIV.style.top=document.body.scrollTop+250+_boxOffsetTop;_LoadingDIV.style.left=document.body.clientWidth/2-100+_boxOffsetLeft;_ifm.style.top=document.body.scrollTop+250+_boxOffsetTop+ifmOffset;_ifm.style.left=document.body.clientWidth/2-100+_boxOffsetLeft+ifmOffset;};function _showProgress(){_getLoadingDIV();if(_LoadingDIV){_LoadingDIV.style.visibility='visible';};if(_ifm){_ifm.style.visibility='visible';}};function _hideProgress(){_getLoadingDIV();if(_LoadingDIV){_LoadingDIV.style.visibility='hidden';};if(_ifm){_ifm.style.visibility='hidden';};_oBody=document.getElementsByTagName('BODY')[0];_oBody.onscroll=function(){;};_oBody.onresize=function(){;}};function setMsgShowType(sType,Msg,MsgID){if(sType==null){sType="0";};_isShowLoading=false;_isShowLoadingBox=false;_isShowCustomMsg=false;if(sType=="1"){_isShowLoading=true;}else if(sType=="2"){_isShowLoadingBox=true;if(Msg==null){alert("Error! Please give me some message.")};DRMsg=Msg;DRMsgID=null;}else if(sType=="3"){_isShowCustomMsg=true;DRMsg=Msg;DRMsgID=MsgID;}else{_isShowLoading=false;_isShowLoadingBox=false;_isShowCustomMsg=false;_LoadingDIV=null;_ifm=null;_oBody=document.getElementsByTagName('BODY');_oBody.onscroll=function(){;};_oBody.onresize=function(){;};_boxOffsetLeft=0;_boxOffsetTop=0;}};function setMsgBoxOffset(boxOffsetTop,boxOffsetLeft){if(_isShowLoadingBox){if(boxOffsetTop==null){boxOffsetTop=0;};if(boxOffsetLeft==null){boxOffsetLeft=0;};_boxOffsetLeft=boxOffsetLeft;_boxOffsetTop=boxOffsetTop;}else{alert("Please exec setMsgShowType(2,Msg) first.");}};function getObjByID(id){var obj=document.getElementById(id);if(obj)return obj;else return false;};function display(id,result){if(getObjByID(id)){try{getObjByID(id).innerHTML=result;}catch(ex){alert(ex);}}};function getActiveXMLObj(){try{_ActiveXMLObj=new XMLHttpRequest();}catch(e){try{_ActiveXMLObj=new ActiveXObject("Msxml2.XMLHTTP.4.0");}catch(e){try{_ActiveXMLObj=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{_ActiveXMLObj=new ActiveXObject("microsoft.XMLHTTP");}catch(e){alert(e);throw new Error("Unable to get an HTTP request object.");}}}};return _ActiveXMLObj;};function getContent(sURL,SpanID,SendMethod){_showProgress();var xmlhttp=getActiveXMLObj();var pgm=sURL;var parm=null;var is_async=true;var method=SendMethod;var response="";var id=SpanID;if(method==null){method='POST';};if(id==null){is_async=false;};if(method=='POST'){if(sURL.indexOf("?")>0){pgm=sURL.substring(0,sURL.indexOf("?"));parm=sURL.substring(sURL.indexOf("?")+1);}else{pgm=sURL;parm=null;}};xmlhttp.open(method,pgm,is_async);xmlhttp.onreadystatechange=function(){switch(xmlhttp.readyState){case 4:try{switch(xmlhttp.status){case 200:response=xmlhttp.responseText;if(id!=null){try{if(getObjByID(id)){display(id,response);}}catch(ex){alert(ex.message);};_hideProgress();};break;default:}}catch(e){;};break;}};xmlhttp.setRequestHeader("X-Requested-With","XMLHttpRequest");if(method=='POST'){xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlhttp.setRequestHeader("Connection","Keep-Alive");};xmlhttp.send(parm);if(!is_async){_hideProgress();};return response;};function postFormData(fID,SpanID){var inputs;var target;var str="";try{target=getObjByID(fID).action;inputs=getObjByID(fID).getElementsByTagName("input");}catch(exception){alert(exception);};for(i=0;i<inputs.length;i++){if(inputs[i].type!="button"&&inputs[i].type!="submit"&&inputs[i].type!="reset"){if(inputs[i].type=="radio"||inputs[i].type=="checkbox"){if(inputs[i].checked){str=str+inputs[i].name+"="+inputs[i].value+"&";}}else{str=str+inputs[i].name+"="+inputs[i].value+"&";}}};var uniq=null;inputs=getObjByID(fID).getElementsByTagName("select");for(i=0;i<inputs.length;i++){uniq=inputs[i].name;str=str+inputs[i].name+"="+inputs[i].value+"&";};str=str.substr(0,str.length-1);var sUrl;if(target.indexOf("?")>0){if(target.substr(str.length-1,str.length)=='&'){sUrl=target+str;}else{sUrl=target+'&'+str;}}else{sUrl=target+'?'+str;};return getContent(sUrl,SpanID,'POST');}

