function AJAXRequest(o){var s=[],q=this,c=AJAXRequest.__pool__||(AJAXRequest.__pool__=[]);(function(w){var v=function(){};w=w?w:{};var x=["url","content","method","async","encode","timeout","ontimeout","onrequeststart","onrequestend","oncomplete","onexception","charset"];var t=["","","GET",true,l("UTF-8"),3600000,v,v,v,v,v,"UTF-8"];var u=x.length;while(u--){q[x[u]]=h(w[x[u]],t[u])}q.encode=l(q[x[x.length-1]]);if(!m()){return false}})(o);function h(t,u){return t!=undefined?t:u}function m(){var w,t=[window.XMLHttpRequest,"MSXML2.XMLHTTP","Microsoft.XMLHTTP"];var u;for(u=0;u<c.length;u+=1){if(c[u].readyState===0||c[u].readyState===4){return c[u]}}for(u=0;u<t.length;u+=1){try{w=(t[u]&&typeof(t[u])=="function"?new t[u]:new ActiveXObject(t[u]));break}catch(v){w=false;continue}}if(!w){throw"Cannot init XMLHttpRequest object!"}else{c[c.length]=w;return w}}function d(t){return document.getElementById(t)}function n(t){var u=t*1;return(isNaN(u)?0:u)}function b(t){return(typeof(t)=="string"?(t=d(t))?t:false:t)}function p(){return((new Date)*1)}function e(u,t){s[u+""]=t}function k(t){return(s[t+""])}function f(v,t,w){return(function u(y){y=v(y);for(var x=0,z=t.length;x<z;x+=1){y=y.replace(t[x],w[x])}return(y)})}function i(w){var x="";for(var v=0;v<w.length;v++){var u=w.charCodeAt(v);if(u>=19968||u==12298||u==12299){try{execScript('ascCode=hex(asc("'+w.charAt(v)+'"))',"vbscript");x+=ascCode.replace(/(.{2})/g,"%$1")}catch(y){}}else{x+=escape(w.charAt(v))}}return x}function l(t){if(t.toUpperCase()=="UTF-8"){return(encodeURIComponent)}else{return(f(i,[/\+/g],["%2B"]))}}function a(v,t){if(!v.nodeName){return}var w="|"+v.nodeName.toUpperCase()+"|";if("|INPUT|TEXTAREA|OPTION|".indexOf(w)>-1){v.value=t}else{try{v.innerHTML=t}catch(u){}}}function r(t){if(typeof(t)=="function"){return t}else{t=b(t);if(t){return(function(u){a(t,u.responseText)})}else{return q.oncomplete}}}function j(t,y,w){var u=0,x=[];while(u<t.length){x[u]=t[u]?(w[u]?w[u](t[u]):t[u]):y[u];u+=1}while(u<y.length){x[u]=y[u];u+=1}return x}function g(){var B,E=false,G=m();var w=j(arguments,[q.url,q.content,q.oncomplete,q.method,q.async,q.charset,null],[null,null,r,null,null,null,null]);var v=w[0],C=w[1],F=w[2],u=w[3],z=w[4],y=w[5],x=w[6];var A=u.toUpperCase()=="POST"?true:false;if(!v){throw"url is null"}var D={url:encodeURI(v),content:C,method:u,charset:y,params:x};if(!A){v+=(v.indexOf("?")>-1?"&":"?")+"timestamp="+p()}G.open(u,v,z);q.onrequeststart(D);if(A){G.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}G.setRequestHeader("X-Request-With","XMLHttpRequest");B=setTimeout(function(){E=true;G.abort()},q.timeout);var t=function(){if(E){q.ontimeout(D);q.onrequestend(D)}else{if(G.readyState==4){clearTimeout(B);D.status=G.status;try{if(G.status==200){setTimeout(function(){F(G,x)},0)}else{q.onexception(D)}}catch(H){q.onexception(D)}q.onrequestend(D)}}};G.onreadystatechange=t;if(A){G.send(C)}else{G.send("")}if(z===false){t()}return true}this.setcharset=function(t){q.encode=l(t)};this.get=function(u,v,t){return g(u,"",v,"GET",q.async,t)};this.update=function(A,x,v,z,t){v=n(v);z=n(z);if(v<1){z=1}else{if(z<1){z=Number.POSITIVE_INFINITY}}var u=function(){g(x,"",A,"GET",q.async,t)};var w=p();var y=function(B){u();B--;if(B>0){e(w,setTimeout(function(){y(B)},v))}};y(z);return w};this.stopupdate=function(t){clearTimeout(k(t))};this.post=function(u,v,w,t){return g(u,v,w,"POST",q.async,t)};this.postf=function(A,F,x){var w=[],z,D,E,C,y,G=arguments.length,v=arguments;A=A?b(A):false;if(!A||A.nodeName!="FORM"){return false}validfoo=A.getAttribute("onvalidate");validfoo=validfoo?(typeof(validfoo)=="string"?new Function(validfoo):validfoo):null;if(validfoo&&!validfoo()){return false}var u=A.getAttribute("action"),t=A.getAttribute("method");var B=q.formToStr(A);if(B.length===0){return false}if(t.toUpperCase()=="POST"){return g(u,B,F,"POST",true,x)}else{u+=(u.indexOf("?")>-1?"&":"?")+B;return g(u,"",F,"GET",true,x)}};this.formToStr=function(A){var v="",z="",u=A.elements,w,B;for(var y=0;y<u.length;++y){w=u[y];if(w.name!==""){B=undefined;switch(w.type){case"select-one":if(w.selectedIndex>-1){B=w.options[w.selectedIndex].value}else{B=""}break;case"select-multiple":var t=w.options;for(var x=0;x<t.length;++x){if(t[x].selected){v+=z+w.name+"="+q.encode(t[x].value);z="&"}}break;case"checkbox":case"radio":if(w.checked){B=w.value}break;default:B=w.value;break}if(B!=undefined){B=q.encode(B);v+=z+w.name+"="+B;z="&"}}}return v}};

