function sack(d){this.xmlhttp=null;this.resetData=function(){this.method="POST";this.queryStringSeparator="?";this.argumentSeparator="&";this.URLString="";this.encodeURIString=!0;this.execute=!1;this.elementObj=this.element=null;this.requestFile=d;this.vars={};this.responseStatus=Array(2)};this.resetFunctions=function(){this.onLoading=function(){};this.onLoaded=function(){};this.onInteractive=function(){};this.onCompletion=function(){};this.onError=function(){};this.onFail=function(){}};this.reset=
function(){this.resetFunctions();this.resetData()};this.createAJAX=function(){try{this.xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){this.xmlhttp=null}}if(!this.xmlhttp)typeof XMLHttpRequest!="undefined"?this.xmlhttp=new XMLHttpRequest:this.failed=!0};this.setVar=function(b,a){this.vars[b]=[a,!1]};this.encVar=function(b,a,c){if(!0==c)return[encodeURIComponent(b),encodeURIComponent(a)];else this.vars[encodeURIComponent(b)]=[encodeURIComponent(a),
!0]};this.processURLString=function(b,a){encoded=encodeURIComponent(this.argumentSeparator);regexp=RegExp(this.argumentSeparator+"|"+encoded);varArray=b.split(regexp);for(i=0;i<varArray.length;i++)urlVars=varArray[i].split("="),!0==a?this.encVar(urlVars[0],urlVars[1]):this.setVar(urlVars[0],urlVars[1])};this.createURLString=function(b){this.encodeURIString&&this.URLString.length&&this.processURLString(this.URLString,!0);if(b)this.URLString.length?this.URLString+=this.argumentSeparator+b:this.URLString=
b;this.setVar("rndval",(new Date).getTime());urlstringtemp=[];for(key in this.vars)!1==this.vars[key][1]&&!0==this.encodeURIString&&(encoded=this.encVar(key,this.vars[key][0],!0),delete this.vars[key],this.vars[encoded[0]]=[encoded[1],!0],key=encoded[0]),urlstringtemp[urlstringtemp.length]=key+"="+this.vars[key][0];this.URLString+=b?this.argumentSeparator+urlstringtemp.join(this.argumentSeparator):urlstringtemp.join(this.argumentSeparator)};this.runResponse=function(){eval(this.response)};this.runAJAX=
function(b){if(this.failed)this.onFail();else{this.createURLString(b);if(this.element)this.elementObj=document.getElementById(this.element);if(this.xmlhttp){var a=this;if(this.method=="GET")totalurlstring=this.requestFile+this.queryStringSeparator+this.URLString,this.xmlhttp.open(this.method,totalurlstring,!0);else{this.xmlhttp.open(this.method,this.requestFile,!0);try{this.xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(c){}}this.xmlhttp.onreadystatechange=function(){switch(a.xmlhttp.readyState){case 1:a.onLoading();
break;case 2:a.onLoaded();break;case 3:a.onInteractive();break;case 4:a.response=a.xmlhttp.responseText;a.responseXML=a.xmlhttp.responseXML;a.responseStatus[0]=a.xmlhttp.status;a.responseStatus[1]=a.xmlhttp.statusText;a.execute&&a.runResponse();if(a.elementObj)elemNodeName=a.elementObj.nodeName,elemNodeName.toLowerCase(),elemNodeName=="input"||elemNodeName=="select"||elemNodeName=="option"||elemNodeName=="textarea"?a.elementObj.value=a.response:a.elementObj.innerHTML=a.response;if(a.responseStatus[0]==
"200")a.onCompletion();else a.onError();a.URLString=""}};this.xmlhttp.send(this.URLString)}}};this.reset();this.createAJAX()};
