function ygConnect(){}ygConnect.prototype={_msxml_progid:["MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],_async_response:{},_http_header:[],_isFormPost:false,_sFormData:null,getConnObject:function(_1,_2){var _3,http;try{http=new XMLHttpRequest();_3={conn:http,oId:_1,tId:_2};}catch(e){for(var i=0;i<this._msxml_progid.length;++i){try{http=new ActiveXObject(this._msxml_progid[i]);_3={conn:http,oId:_1,tId:_2};}catch(e){}}}finally{if(http!=undefined||_3!=undefined){var _5=arguments.length>0?_3:http;return _5;}else{return null;}}},setProgId:function(id){this.msxml_progid.unshift(id);},syncRequest:function(o,_8,_9,_10,_11){if(!o){return null;}o.conn.open(_8,_9,false);if(this._http_header.length>0){this.setHeader(o.conn);}if(this._isFormPost){_11=this._sFormData;this._isFormPost=false;}_11?o.conn.send(_11):o.conn.send(null);try{if(o.conn.status==200){response=(_10?o.conn.responseXML:o.conn.responseText);}else{response=this.connException(o);}}catch(e){response=this.connException(e,o.tId);}finally{ygConnect.superclass.releaseObject(o);return response;}},asyncRequest:function(o,_12,_13,_14,_15,_16,_17){if(!o){return null;}var _18=this;o.conn.open(_12,_13,true);if(_15){o.conn.onreadystatechange=function(){if(o.conn.readyState==4){try{if(o.conn.status==200){_15(o.conn,o.tId,_16);}else{errObj=_18.connException(o);_15(errObj);}}catch(e){errObj=_18.connException(e,o.tId);_15(errObj);}finally{ygConnect.superclass.releaseObject(o);}}};}else{o.conn.onreadystatechange=function(){_18.stateChange(o,_14);};}if(this._http_header.length>0){this.setHeader(o);}if(this._isFormPost){_17=this._sFormData;this._isFormPost=false;}_17?o.conn.send(_17):o.conn.send(null);},stateChange:function(o,_19){var _20;switch(o.conn.readyState){case 4:try{if(o.conn.status==200){_20={tId:o.tId,status:o.conn.status,message:(_19?o.conn.responseXML:o.conn.responseText)};}else{_20=this.connException(o);}}catch(e){_20=this.connException(e,o.tId);}finally{this.setResponse(_20);ygConnect.superclass.releaseObject(o);}break;}},setResponse:function(o){this._async_response[o.tId]=o;},getResponse:function(tId){var _22=this._async_response[tId];if(_22){delete this._async_response[tId];return _22;}},initHeader:function(_23,_24){var _25=[_23,_24];this._http_header.push(_25);},setHeader:function(o){var _26=this._http_header;for(var i=0;i<_26.length;i++){o.conn.setRequestHeader(_26[i][0],_26[i][1]);}_26.splice(0,_26.length);},getHeader:function(o,_27){return o.conn.getResponseHeader(_27);},getAllHeaders:function(o){return o.conn.getAllResponseHeaders();},setForm:function(_28){this._sFormData="";var _29;var _30=document.forms[_28];for(var i=0;i<_30.elements.length;i++){oElement=_30.elements[i];elName=_30.elements[i].name;elValue=_30.elements[i].value;switch(oElement.type){case"select-multiple":for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){this._sFormData+=elName+"="+encodeURIComponent(oElement.options[j].value)+"&";}}break;case"radio":if(oElement.checked){this._sFormData+=elName+"="+encodeURIComponent(elValue)+"&";}break;case"checkbox":if(oElement.checked){if(elName==_29){if(this._sFormData.lastIndexOf("&")==sFormData.length-1){this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);}this._sFormData+=","+encodeURIComponent(elValue);}else{this._sFormData+=elName+"="+encodeURIComponent(elValue)+"&";}_29=elName;}break;case"file":break;default:this._sFormData+=elName+"="+encodeURIComponent(elValue)+"&";break;}}this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);this._isFormPost=true;this.initHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");},abort:function(o){if(this.isCallInProgress(o)){o.conn.abort();ygConnect.superclass.releaseObject(o);}},isCallInProgress:function(o){if(o){return o.conn.readyState!=4&&o.conn.readyState!=0;}},connException:function(o,_32){if(o.conn){return{tId:o.tId,status:o.conn.status,message:o.conn.statusText};}else{return{tId:_32,status:o.name,message:o.message};}}};var ygConnManager=function(){};ygConnManager.prototype={_object_count:0,_available_pool:[],_enable_pool:true,_max_pool_size:2,_transaction_id:0,http:new ygConnect()};ygConn=ygConnManager.prototype;ygConnect.superclass=ygConnManager.prototype;ygConnManager.prototype.setPoolSize=function(i){this._max_pool_size=i;};ygConnManager.prototype.disablePooling=function(){this._enable_pool=false;};ygConnManager.prototype.enablePooling=function(){this._enable_pool=true;};ygConnManager.prototype.getTransactionId=function(){return this._transaction_id;};ygConnManager.prototype.incrObjCount=function(){this._object_count++;};ygConnManager.prototype.incrTransactionId=function(){this._transaction_id++;};ygConnManager.prototype.getObject=function(){if(this._enable_pool){var o,oId,tId=this.getTransactionId();if(this._object_count<this._max_pool_size&&this._available_pool.length==0){oId=this._object_count;o=this.http.getConnObject(oId,tId);if(o){this.incrObjCount();this.incrTransactionId();}return o;}else{if(this._available_pool.length>0){o=this.getAvailableObject();if(o){o.tId=tId;this.incrTransactionId();}return o;}else{return null;}}}else{var o=this.http.getConnObject();if(o){return o;}else{return null;}}};ygConnManager.prototype.getAvailableObject=function(){return this._available_pool.shift();};ygConnManager.prototype.releaseObject=function(o){this._available_pool.push(o);};