function ajax_connect(C,A){var D,B=false;var F=false;try{D=new ActiveXObject("Msxml2.XMLHTTP")}catch(E){try{D=new ActiveXObject("Microsoft.XMLHTTP")}catch(E){try{D=new XMLHttpRequest()}catch(E){D=false}}}if(!D){return null}this.addDefault=function(G){if(isArray(G)){for(x in G){this.addDefault(G[x])}}else{if(G.indexOf(",")!=-1){G=G.split(",");for(x in G){this.addDefault(G[x])}}else{this.defaults[G]="undefined"}}};this.updateDefaults=function(){for(x in this.defaults){this.defaults[x]=document.getElementById(x).innerHTML}};this.setToDefault=function(G){if(G==null){for(x in this.defaults){this.setToDefault(x)}}else{document.getElementById(G).innerHTML=this.defaults[G]}};this.tail=null;this.setTail=function(G){this.tail=G};this.clearTail=function(){this.tail=null};this.defaults=new Array();this.autoClear=false;this.url=C;this.method=A.toUpperCase();this.vars=Array();this.onComplete=function(G){F=G};this.clearVars=function(){this.vars=Array()};this.setVars=function(K,G){if(this.autoClear){this.clearVars()}if((!isArray(K))&&(G==null)){if(K.lastIndexOf("=")==-1){this.setVars(K.split(","))}else{K=K.split("=");this.setVars(K[0],K[1])}}else{if((isArray(K))&&(G==null)){for(x in K){if(this.tail!=null){tag_id=String(K[x])+String(this.tail)}else{tag_id=K[x]}var J=document.getElementById(tag_id);try{if(((J.nodeName.toUpperCase()=="INPUT")&&(J.attributes.getNamedItem("type").value.toUpperCase()=="TEXT"))||((J.nodeName.toUpperCase()=="INPUT")&&(J.attributes.getNamedItem("type").value.toUpperCase()=="HIDDEN"))||((J.nodeName.toUpperCase()=="INPUT")&&(J.attributes.getNamedItem("type").value.toUpperCase()=="PASSWORD"))||((J.nodeName.toUpperCase()=="INPUT")&&(J.attributes.getNamedItem("type").value.toUpperCase()=="RADIO"))||((J.nodeName.toUpperCase()=="SELECT")&&(J.multiple==false))||(J.nodeName.toUpperCase()=="TEXTAREA")){this.setVars(K[x],J.value)}if((J.nodeName.toUpperCase()=="INPUT")&&(J.attributes.getNamedItem("type").value.toUpperCase()=="CHECKBOX")){String(J.checked)=="false"?value="0":value="1";this.setVars(K[x],value)}else{if((J.nodeName.toUpperCase()=="DIV")||(J.nodeName.toUpperCase()=="SPAN")){this.setVars(K[x],J.innerHTML.replace(/&amp;/gi,"&"))}else{if((J.nodeName.toUpperCase()=="SELECT")&&(J.multiple==true)){for(i=0;i<J.options.length;i++){if(J.options[i].selected==true){this.setVars(K[x]+"[]",J.options[i].value)}}}}}}catch(I){}}}else{if((isArray(K))&&(isArray(G))){alert("I am Broken! PLEASE FIX ME!")}else{if((K!=null)&&(G!=null)){var H=this.vars.length;this.vars[H]=Array(K,G)}}}}};this.getVar=function(G,H){G=String(G);if(H==null){H=false}for(x in this.vars){if((this.vars[x][1]=="undefined")||(this.vars[x][0]=="undefined")||(this.vars[x][1]==null)||(this.vars[x][0]==null)){}else{if(String(this.vars[x][0])==G){if(H){return this.decodeVar(this.vars[x][1])}else{return this.vars[x][1]}}}}return false};this.encodeVar=function(G){G=encodeURIComponent(String(G));return G};this.decodeVar=function(G){G=decodeURIComponent(String(G));return G};this.getVarString=function(H){if(H==null){H=true}var G="";for(x in this.vars){if((this.vars[x][1]=="undefined")||(this.vars[x][0]=="undefined")||(this.vars[x][1]==null)||(this.vars[x][0]==null)){}else{if(H){this.vars[x][1]=this.encodeVar(this.vars[x][1])}G+=this.vars[x][0]+"="+this.vars[x][1]+"&"}}if(H){G+="encode=true&"}return G.substring(0,G.lastIndexOf("&"))};this.sendData=function(I,H){varStr=this.getVarString();if((!D)||(varStr=="")){return false}B=false;if(H!=null){this.method=H.toUpperCase()}if(I!=null){this.url=I}try{var G="";if(this.method=="GET"){D.open(this.method,this.url+"?"+varStr,true)}else{G=varStr;D.open(this.method,this.url,true);D.setRequestHeader("Method","POST "+this.url+" HTTP/1.1");D.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}D.onreadystatechange=function(){if(D.readyState==4&&!B){B=true;if(F!=false){var L=D.responseXML;var K=new Array();if(L){K.type="xml";K.data=L}else{K.type="text";K.data=D.responseText}if(navigator.appName=="Microsoft Internet Explorer"){K.text=D.responseXML.xml}else{K.text=D.responseText}F(K)}}};D.send(G)}catch(J){return false}return true};return this}function isArray(B){try{if(B.constructor==Array){return true}else{return false}}catch(A){return false}}function stripAmperstand(A){return A.substring(0,A.lastIndexOf("&"))};