function AjaxClient(aa,ba){this.requestQueue=new Array();this.requestActive=false;this.xmlHttp=this.getXmlHttp();this.onreceiveresponse=aa;this.onprogress=ba;}
AjaxClient.prototype.getXmlHttp=function(){try{this.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(ex){try{this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(ex){this.xmlHttp=null;}}
if(!this.xmlHttp&&typeof XMLHttpRequest!="undefined"){this.xmlHttp=new XMLHttpRequest();}
return this.xmlHttp;}
AjaxClient.prototype.addRequest=function(ca,da){this.requestQueue.unshift([ca,da]);this.sendNextRequest();}
AjaxClient.prototype.sendNextRequest=function(){if(this.requestActive){return;}
var ea=this.requestQueue;if(!ea||ea.length==0){return;}
var fa=ea.pop();if(fa){var ga=AjaxClient.prototype.getXmlHttp();if(ga){try{var ha=fa[1]?"POST":"GET";ga.open(ha,fa[0],true);if(ha=="POST"){ga.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");ga.setRequestHeader("Content-Length",fa[1].length);}
var ia=this;ga.onreadystatechange=function(){if(ia.onprogress){ia.onprogress(ga.readyState);}
if(ga.readyState==4){ia.requestActive=false;if(ia.onreceiveresponse){try{ia.onreceiveresponse(ga);}
catch(ex){if(ga.responseText.indexOf('Login')>=0){window.location="login.aspx";}
else{alert(ex.description);}}}
else{var ja=ga.responseText;try{alert(ja);}
catch(ex){if(ga.status!=200){alert("Could not process your search request due to a communication error. Errors of this type can be caused by an incorrectly configured control or by network connection issues. Contact the site owner if this problem persists.");}}}
ia.sendNextRequest();}}
this.requestActive=true;var ka=(fa.length==2)?fa[1]:"";ga.send(ka);}
catch(ex){alert(ex.message);throw ex;}}}
else{alert("invalid API call");}}
AjaxClient.prototype.getTimeStamp=function(){var d=new Date();var la=d.getUTCHours()+'.'+d.getUTCMinutes()+'.'+d.getUTCSeconds()+'.'+d.getUTCMilliseconds();return la;}
function getXmlDoc(ma){var na;if(window.DOMParser){var oa=new DOMParser();na=oa.parseFromString(ma,"text/xml");}
else{na=new ActiveXObject("Microsoft.XMLDOM");na.async="false";na.loadXML(ma);}
return na;}