var xhrObj=false;function showWait(){if(divid){getEl(divid).innerHTML="<img src='images/status.gif'>"}}var iRemoteProcedure=0;var tRemoteProcedures={};function RemoteProcedure(B,A,C){this.req=null;this.fnOnLoad=null;this.id=++iRemoteProcedure;tRemoteProcedures[this.id]=this;this.timer=null;this.call(B,A,C)}RemoteProcedure.prototype.call=function(B,A,C){if(xhrObj&&xhrObj.readyState!=0){xhrObj.abort()}this.fnOnLoad=A;this.fnOnPatience=C;this.timer=window.setTimeout("tRemoteProcedures["+this.id+"].showPatience()",500);var D=(B.indexOf("?")==-1?"?":"&")+"Rand="+Math.random();if(window.XMLHttpRequest){this.req=new XMLHttpRequest();this.req.onreadystatechange=new Function("tRemoteProcedures["+this.id+"].processReqChange()");this.req.open("GET",B+D,true);this.req.send(null)}else{if(window.ActiveXObject){this.req=new ActiveXObject("Microsoft.XMLHTTP");if(this.req){this.req.onreadystatechange=new Function("tRemoteProcedures["+this.id+"].processReqChange()");this.req.open("GET",B+D,true);this.req.send()}}}};RemoteProcedure.prototype.showPatience=function(){this.clearTimeout();if(this.fnOnPatience){this.fnOnPatience()}};RemoteProcedure.prototype.clearTimeout=function(){if(this.timer!=null){window.clearTimeout(this.timer);this.timer=null}};RemoteProcedure.prototype.processReqChange=function(){if(this.req.readyState==4){this.clearTimeout();if(this.req.status==200||this.req.status==0){if(this.fnOnLoad){this.fnOnLoad(this.req)}}else{alert("Error "+this.req.status+"\n"+this.req.statusText+"\n\n"+this.req.responseText.replace(/\r\n/g,""))}}};function getEl(A){return document.getElementById(A)};