jade.Ajax=function(G,F,E,H){this.url=G;this.method=F?F:"POST";this.user=E;this.password=H
};jade.Ajax.prototype.url=null;jade.Ajax.prototype.method=null;jade.Ajax.prototype.user=null;
jade.Ajax.prototype.password=null;jade.Ajax.resetSessionTimeout=null;jade.Ajax.getRequestor=function(){if(window.XMLHttpRequest){return new XMLHttpRequest()
}if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}throw new Error("Unable to initialize Ajax requestor")
};jade.Ajax.getResponse=function(C){var D;D=C.getResponseHeader("Content-Type");if(D&&D.toLowerCase().indexOf("xml")!=-1){return C.responseXML
}else{return C.responseText}};jade.Ajax.prototype.send=function(G,F,E){var H;H=jade.Ajax.getRequestor();
H.open(this.method,this.url,true,this.user,this.password);if(F){new jade.AjaxResponse(H,F,E)
}if(!G||!G.getElementById){H.setRequestHeader("Content-type","text/plain")}H.send(G);
if(jade.sessionTimeout){jade.sessionTimeout.reset()}if(jade.Ajax.resetSessionTimeout){jade.Ajax.resetSessionTimeout()
}};jade.Ajax.send=function(J,H,G,F){var I;I=new jade.Ajax(J,H?"POST":"GET");I.send(H,G,F)
};jade.Ajax.prototype.request=function(D){var C;C=jade.Ajax.getRequestor();C.open(this.method,this.url,false,this.user,this.password);
if(!D||!D.getElementById){C.setRequestHeader("Content-type","text/plain")}C.send(D);
if(C.status!=200){throw new Error("HTTP request failed: "+C.status+" "+C.statusText)
}if(jade.sessionTimeout){jade.sessionTimeout.reset()}if(jade.Ajax.resetSessionTimeout){jade.Ajax.resetSessionTimeout()
}return jade.Ajax.getResponse(C)};jade.Ajax.request=function(D,E){var F;F=new jade.Ajax(D,E?"POST":"GET");
return F.request(E)};jade.AjaxResponse=function(H,F,E){var G;this.requestor=H;this.onResponse=F;
if(E){this.onResponseScope=E}G=jade.AjaxResponse.nextInstance++;jade.AjaxResponse.instances[G]=this;
H.onreadystatechange=function(){jade.AjaxResponse.handleReadyStateChange(G)}};jade.AjaxResponse.prototype.requestor=null;
jade.AjaxResponse.prototype.onResponse=null;jade.AjaxResponse.prototype.onResponseScope=window;
jade.AjaxResponse.nextInstance=1;jade.AjaxResponse.instances=[];jade.AjaxResponse.prototype.handleReadyStateChange=function(B){if(this.requestor.readyState==4){this.onResponse.call(this.onResponseScope,jade.Ajax.getResponse(this.requestor),this.requestor);
jade.AjaxResponse.instances[B]=null}};jade.AjaxResponse.handleReadyStateChange=function(B){jade.AjaxResponse.instances[B].handleReadyStateChange(B)
};