function AjaxRequest(){var A=new Object();A.timeout=null;A.generateUniqueUrl=true;A.url=window.location.href;A.method="GET";A.async=true;A.username=null;A.password=null;A.parameters=new Object();A.requestIndex=AjaxRequest.numAjaxRequests++;A.responseReceived=false;A.groupName=null;A.queryString="";A.responseText=null;A.responseXML=null;A.status=null;A.statusText=null;A.aborted=false;A.xmlHttpRequest=null;A.onTimeout=null;A.onLoading=null;A.onLoaded=null;A.onInteractive=null;A.onComplete=null;A.onSuccess=null;A.onError=null;A.onGroupBegin=null;A.onGroupEnd=null;A.xmlHttpRequest=AjaxRequest.getXmlHttpRequest();if(A.xmlHttpRequest==null){return null}A.xmlHttpRequest.onreadystatechange=function(){if(A==null||A.xmlHttpRequest==null){return }if(A.xmlHttpRequest.readyState==1){A.onLoadingInternal(A)}if(A.xmlHttpRequest.readyState==2){A.onLoadedInternal(A)}if(A.xmlHttpRequest.readyState==3){A.onInteractiveInternal(A)}if(A.xmlHttpRequest.readyState==4){A.onCompleteInternal(A)}};A.onLoadingInternalHandled=false;A.onLoadedInternalHandled=false;A.onInteractiveInternalHandled=false;A.onCompleteInternalHandled=false;A.onLoadingInternal=function(){if(A.onLoadingInternalHandled){return }AjaxRequest.numActiveAjaxRequests++;if(AjaxRequest.numActiveAjaxRequests==1&&typeof (window.AjaxRequestBegin)=="function"){AjaxRequestBegin()}if(A.groupName!=null){if(typeof (AjaxRequest.numActiveAjaxGroupRequests[A.groupName])=="undefined"){AjaxRequest.numActiveAjaxGroupRequests[A.groupName]=0}AjaxRequest.numActiveAjaxGroupRequests[A.groupName]++;if(AjaxRequest.numActiveAjaxGroupRequests[A.groupName]==1&&typeof (A.onGroupBegin)=="function"){A.onGroupBegin(A.groupName)}}if(typeof (A.onLoading)=="function"){A.onLoading(A)}A.onLoadingInternalHandled=true};A.onLoadedInternal=function(){if(A.onLoadedInternalHandled){return }if(typeof (A.onLoaded)=="function"){A.onLoaded(A)}A.onLoadedInternalHandled=true};A.onInteractiveInternal=function(){if(A.onInteractiveInternalHandled){return }if(typeof (A.onInteractive)=="function"){A.onInteractive(A)}A.onInteractiveInternalHandled=true};A.onCompleteInternal=function(){if(A.onCompleteInternalHandled||A.aborted){return }A.onCompleteInternalHandled=true;AjaxRequest.numActiveAjaxRequests--;if(AjaxRequest.numActiveAjaxRequests==0&&typeof (window.AjaxRequestEnd)=="function"){AjaxRequestEnd(A.groupName)}if(A.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[A.groupName]--;if(AjaxRequest.numActiveAjaxGroupRequests[A.groupName]==0&&typeof (A.onGroupEnd)=="function"){A.onGroupEnd(A.groupName)}}A.responseReceived=true;try{A.status=A.xmlHttpRequest.status;A.statusText=A.xmlHttpRequest.statusText;A.responseText=A.xmlHttpRequest.responseText;A.responseXML=A.xmlHttpRequest.responseXML;if(typeof (A.onComplete)=="function"){A.onComplete(A)}if(A.xmlHttpRequest.status==200&&typeof (A.onSuccess)=="function"){A.onSuccess(A)}else{if(typeof (A.onError)=="function"){A.onError(A)}}}catch(B){if(typeof (A.onComplete)=="function"){A.onComplete(A)}else{if(typeof (A.onError)=="function"){A.onError(A)}}}delete A.xmlHttpRequest.onreadystatechange;A.xmlHttpRequest=null};A.onTimeoutInternal=function(){if(A!=null&&A.xmlHttpRequest!=null&&!A.onCompleteInternalHandled){A.aborted=true;A.xmlHttpRequest.abort();AjaxRequest.numActiveAjaxRequests--;if(AjaxRequest.numActiveAjaxRequests==0&&typeof (window.AjaxRequestEnd)=="function"){AjaxRequestEnd(A.groupName)}if(A.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[A.groupName]--;if(AjaxRequest.numActiveAjaxGroupRequests[A.groupName]==0&&typeof (A.onGroupEnd)=="function"){A.onGroupEnd(A.groupName)}}if(typeof (A.onTimeout)=="function"){A.onTimeout(A)}delete A.xmlHttpRequest.onreadystatechange;A.xmlHttpRequest=null}};A.process=function(){var C="";if(A.xmlHttpRequest!=null){if(A.generateUniqueUrl&&A.method=="GET"){A.parameters.AjaxRequestUniqueId=new Date().getTime()+""+A.requestIndex}for(var B in A.parameters){if(A.queryString.length>0){A.queryString+="&"}A.queryString+=encodeURIComponent(B)+"="+encodeURIComponent(A.parameters[B])}if(A.method=="GET"){if(A.queryString.length>0){A.url+=((A.url.indexOf("?")>-1)?"&":"?")+A.queryString}}A.xmlHttpRequest.open(A.method,A.url,A.async,A.username,A.password);if(A.method=="POST"){if(typeof (A.xmlHttpRequest.setRequestHeader)!="undefined"){A.xmlHttpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded")}C=A.queryString}if(A.timeout>0){setTimeout(A.onTimeoutInternal,A.timeout)}A.xmlHttpRequest.send(C)}};A.handleArguments=function(B){for(var C in B){if(typeof (A[C])=="undefined"){A.parameters[C]=B[C]}else{A[C]=B[C]}}};A.getAllResponseHeaders=function(){if(A.xmlHttpRequest!=null){if(A.responseReceived){return A.xmlHttpRequest.getAllResponseHeaders()}alert("Cannot getAllResponseHeaders because a response has not yet been received")}};A.getResponseHeader=function(B){if(A.xmlHttpRequest!=null){if(A.responseReceived){return A.xmlHttpRequest.getResponseHeader(B)}alert("Cannot getResponseHeader because a response has not yet been received")}};return A}AjaxRequest.getXmlHttpRequest=function(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(B){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(A){return null}}}else{return null}}};AjaxRequest.isActive=function(){return(AjaxRequest.numActiveAjaxRequests>0)};AjaxRequest.get=function(A){AjaxRequest.doRequest("GET",A)};AjaxRequest.post=function(A){AjaxRequest.doRequest("POST",A)};AjaxRequest.doRequest=function(C,A){if(typeof (A)!="undefined"&&A!=null){var B=new AjaxRequest();B.method=C;B.handleArguments(A);B.process()}};AjaxRequest.submit=function(A,B){var D=new AjaxRequest();if(D==null){return false}var C=AjaxRequest.serializeForm(A);D.method=A.method.toUpperCase();D.url=A.action;D.handleArguments(B);D.queryString=C;D.process();return true};AjaxRequest.serializeForm=function(B){var E=B.elements;var A=E.length;var G="";this.addField=function(H,I){if(G.length>0){G+="&"}G+=encodeURIComponent(H)+"="+encodeURIComponent(I)};for(var D=0;D<A;D++){var F=E[D];if(!F.disabled){switch(F.type){case"text":case"password":case"hidden":case"textarea":this.addField(F.name,F.value);break;case"select-one":if(F.selectedIndex>=0){this.addField(F.name,F.options[F.selectedIndex].value)}break;case"select-multiple":for(var C=0;C<F.options.length;C++){if(F.options[C].selected){this.addField(F.name,F.options[C].value)}}break;case"checkbox":case"radio":if(F.checked){this.addField(F.name,F.value)}break}}}return G};AjaxRequest.numActiveAjaxRequests=0;AjaxRequest.numActiveAjaxGroupRequests=new Object();AjaxRequest.numAjaxRequests=0;
