var arrPendingHttpRequests=[];OboutGridAjax=function(){this.responseText=null;this.defaultDisplayText=null;this.onDone=null;this.url="";this.variables=null;this.getXML=false;this.method="POST";this.grid=null;this.recreateGrid=false;this.requests=[]};OboutGridAjax.prototype.initialize=function(){var a;try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){a=null}}if(!a&&typeof XMLHttpRequest!="undefined")a=new XMLHttpRequest;this.requests.push({xhr:a,busy:true})};OboutGridAjax.prototype.getRequestObject=function(){for(var a=0;a<this.requests.length;a++)if(this.requests[a].busy==false){this.requests[a].busy=true;return this.requests[a]}this.initialize();return this.requests[this.requests.length-1]};OboutGridAjax.prototype.sendData=function(){var e=this.url,c=this.getRequestObject();if(c!=null){var a=c.xhr;if(a!=null){oCHttp=this;if(this.method=="GET"){a.open(this.method,e+"?"+this.variables,true);a.send(null)}else if(this.method=="POST"){a.open(this.method,e,true);a.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");a.onreadystatechange=function(){oCHttp.process()};a.send(this.variables)}for(var d=false,b=0;b<arrPendingHttpRequests.length;b++)if(arrPendingHttpRequests[b]==this){d=true;break}!d&&arrPendingHttpRequests.push(this)}}};OboutGridAjax.prototype.process=function(){if(arrPendingHttpRequests.length==0)return;for(var f=0;f<arrPendingHttpRequests.length;f++)for(var a=arrPendingHttpRequests[f],d=0;d<a.requests.length;d++){if(a.requests[d].busy==false)continue;var b=a.requests[d].xhr;if(b.readyState==4){if(b.status==200){if(a.recreateGrid){iStartPos=b.responseText.indexOf("<!-- Grid with id "+a.grid.ID+" -->");iLength=b.responseText.lastIndexOf("<!-- Grid with id "+a.grid.ID+" -->")+("<!-- Grid with id "+a.grid.ID+" -->").length-iStartPos;sResponseText=b.responseText.substr(iStartPos,iLength);sResponseText=sResponseText.replace("<!-- Grid with id "+a.grid.ID+" -->","");sResponseText=sResponseText.replace("<!-- Grid with id "+a.grid.ID+" -->","")}else sResponseText=b.responseText;if(typeof a.onDone=="function")if(a.getXML){var c;if(window.ActiveXObject){c=new ActiveXObject("Microsoft.XMLDOM");c.loadXML(sResponseText)}else c=(new DOMParser).parseFromString(sResponseText,"text/xml");if(a.grid)a.onDone(a.grid,c);else a.onDone(c)}else if(a.grid)a.onDone(a.grid,sResponseText);else a.onDone(sResponseText);else eval(b.responseText);a.grid.BackupError=null}else{a.grid.BackupError=b.responseText;if(a.grid.OnClientCallbackError==null){if(confirm("There has been an error. Press the OK button to view the error.")==true){var e=window.open();if(e!=null){e.document.write(a.grid.BackupError.replace(/\r\n/g,""));e.document.close()}else alert("The window with the error cannot be opened. Make sure you have the Pop-Up Blocker turned off.")}}else a.grid.OnClientCallbackError(a.grid.BackupError);a.grid.restoreGrid();arrPendingHttpRequests=[]}a.requests[d].busy=false}}};OboutGridAjax.prototype.xmlCdataEncode=function(a){a=a.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;")};try{if(Sys)Sys.Application&&Sys.Application.notifyScriptLoaded()}catch(ex){};