
function CallerContext(callerName,content)
{this.callerName=callerName;this.content=content;}
function Invoke_caller()
{if(this.callerName instanceof Function)
this.callerName(this.content);}
CallerContext.prototype.execute=Invoke_caller;READY_STATE_UNINITIALIZED=0;READY_STATE_LOADING=1;READY_STATE_LOADED=2;READY_STATE_INTERACTIVE=3;READY_STATE_COMPLETE=4;function FactoryXMLHttpRequest()
{if(window.XMLHttpRequest)
{return new XMLHttpRequest();}
else if(window.ActiveXObject)
{var msxmls=new Array('Msxml2.XMLHTTP.5.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP','Microsoft.XMLHTTP');for(var i=0;i<msxmls.length;i++)
{try
{return new ActiveXObject(msxmls[i]);}
catch(e){}}}
throw new Error("Could not instantiate factory");}
function Ajax()
{this._xmlhttp=new FactoryXMLHttpRequest();this.username=null;this.password=null;}
function Ajax_call(action,url,data,args)
{var instance=this;this._xmlhttp.open(action,url,true,this.username,this.password);this.openCallback(this._xmlhttp);this._xmlhttp.onreadystatechange=function()
{switch(instance._xmlhttp.readyState)
{case READY_STATE_LOADING:instance.loading();break;case READY_STATE_LOADED:instance.loaded();break;case READY_STATE_INTERACTIVE:instance.interactive();break;case READY_STATE_COMPLETE:instance.complete(instance._xmlhttp.status,instance._xmlhttp.statusText,instance._xmlhttp.responseText,instance._xmlhttp.responseXML,args);break;}}
this._xmlhttp.send(data);}
function Ajax_get(url,args)
{this.call("GET",url,null,args);}
function Ajax_put(url,mimetype,datalength,data,args)
{this.openCallback=function(xmlhttp)
{xmlhttp.setRequestHeader("Content-type",mimetype);xmlhttp.setRequestHeader("Content-Length",datalength);}
this.call("PUT",url,data,args);}
function Ajax_delete(url,args)
{this.call("DELETE",url,null,args);}
function Ajax_post(url,mimetype,datalength,data,args)
{var thisReference=this;this.userOpenCallback=this.openCallback;this.openCallback=function(xmlhttp)
{xmlhttp.setRequestHeader("Content-type",mimetype);xmlhttp.setRequestHeader("Content-Length",datalength);thisReference.userOpenCallback(xmlhttp);thisReference.openCallback=thisReference.userOpenCallback;}
this.call("POST",url,data,args);}
function Ajax_openCallback(obj){}
function Ajax_loading(){}
function Ajax_loaded(){}
function Ajax_interactive(){}
function Ajax_complete(status,statusText,responseText,responseHTML,args){}
Ajax.prototype.openCallback=Ajax_openCallback;Ajax.prototype.loading=Ajax_loading;Ajax.prototype.loaded=Ajax_loaded;Ajax.prototype.interactive=Ajax_interactive;Ajax.prototype.complete=Ajax_complete;Ajax.prototype.get=Ajax_get;Ajax.prototype.put=Ajax_put;Ajax.prototype.del=Ajax_delete;Ajax.prototype.post=Ajax_post;Ajax.prototype.call=Ajax_call;