var xeAjax=new XeAjaxItems();function XeAjaxItems(){this.ajaxItemArray=new Array();}XeAjaxItems.prototype.register=function(b,a){if((b==null||typeof(b)!="string"||b.length<1)||(a==null||typeof(a)!="string"||a.length<1)){throw ("Invalid XeAjaxItems object: requires handle and URL");}this.ajaxItemArray[b]=new XeAjaxItem(this,b,a);return this.ajaxItemArray[b];};XeAjaxItems.prototype.get=function(a){return this.ajaxItemArray[a];};function XeAjaxItem(b,c,a){this.objectData=new Array();this.setData("request",createXMLHttpRequest());this.setData("parent",b);this.setData("handle",c);this.setData("url",a);this.setData("refreshState",0);}XeAjaxItem.prototype.call=function(){var c=this.getData("handle");var b=this.getData("requestHandler");XeAjaxItem.call(c,b);var a=this.getData("refreshInterval");if(a==null){return;}if(typeof(a)!="number"){a=parseInt(a);}if(!isNaN(a)&&this.getData("refreshState")!=1){this.setData("refreshState",1);this.startRefresh(a);}};XeAjaxItem.call=function(d,a){var c=xeAjax.get(d);if(c==null){return;
}try{var b=c.getData("request");b.onreadystatechange=function(){};b.abort();b.open("GET",c.getData("url"),true);b.onreadystatechange=function(){if(b.readyState==4){if(b.status==200){XeAjaxItem.proxyCallbackFunction(a,d);}}};b.send(null);}catch(f){c.handleFailedRequest(f,d);return;}};XeAjaxItem.proxyCallbackFunction=function(a,c){var b=xeAjax.get(c);if(b!=null){var d=b.checkIfCached(c);if(d!=null){b.setData("request",d);}a(c,b.getData("request"));}};XeAjaxItem.prototype.checkIfCached=function(f){var d=this;var c=null;try{if(d==null){d=xeAjax.get(f);}c=d.getData("request");if(c==null){return;}if(!c.getResponseHeader("Date")){var a=c;c=createXMLHttpRequest();var b=a.getResponseHeader("Last-Modified");b=(b)?b:new Date(0);c.open("GET",d.getData("url"),false);c.setRequestHeader("If-Modified-Since",b);c.send(null);if(c.status==304){return a;}return c;}}catch(g){return c;}};XeAjaxItem.prototype.handleFailedRequest=function(b){var a=this.getData("failedRequestHandler");if(a!=null&&typeof(a)=="function"){a(b,this.getData("handle"));
}};XeAjaxItem.prototype.startRefresh=function(b){var c=this.getData("handle");var d=this.getData("requestHandler");var a=setInterval("XeAjaxItem.call('"+c+"',"+d+")",b);xeAjax.get(c).setData("timerId",a);};XeAjaxItem.prototype.stopRefresh=function(a){clearInterval(xeAjax.get(a).getData("timerId"));};XeAjaxItem.prototype.setData=function(a,b){this.objectData[a]=b;return this.objectData[a];};XeAjaxItem.prototype.getData=function(a){return this.objectData[a];};function createXMLHttpRequest(){if(window.XMLHttpRequest){return new XMLHttpRequest();}else{if(typeof XMLHttpRequest=="undefined"){XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0");}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0");}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(a){}try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(a){}throw new Error("This browser does not support XMLHttpRequest.");};}}}