function clsAjax(){var url = '';var panelresult = null;var pictureLocation = null;var innerhtml = 'LOADING';var qstr = '';var self = null;var functionName = '';var isImportant = 0;var SecureCode = 'AjaxanFin';var temppictureLocation = new Array;var temppanelresult = new Array;var ErrMessage = '';var IsPicANDtext = 0;var isCached = 0;var arr_cached = new Array;this.init = function(URL, presult, plocation, inner){url = URL;panelresult = presult;pictureLocation = plocation;innerhtml = inner;IsPicANDtext = presult==plocation;};this.important = function(state){isImportant = state;if(!state)SecureCode = '';};this.cached = function(state){isCached = state;};this.setSecureCode = function(str){SecureCode = str;};this.setErr = function(str){ErrMessage = str;};this.setQuery = function(str){qstr = str;	};this.returnQuery = function(){return qstr;};function ord(c){return c.charCodeAt(0);};function chr(n){return String.fromCharCode(n);};function updatepage(str){if(typeof panelresult!='object')   panelresult = document.getElementById(panelresult);if(typeof panelresult=='object'){try{panelresult.className = '';}catch(e){};try{pictureLocation.className = '';}catch(e){};}if(!isCached || !arr_cached[cachenumber]){if (isImportant){var bb = true;if(str.indexOf(SecureCode)>-1){var temp = str.substr(str.indexOf(SecureCode), SecureCode.length);if (temp == SecureCode){str = str.substr(0,str.length-SecureCode.length);}else{bb=false;}}else{bb=false;}}else{str = str.substr(0,str.length-SecureCode.length);bb=true;}if(!bb){if (ErrMessage!='')alert(ErrMessage);str = temppanelresult['innerHTML'];if(panelresult)panelresult.className = temppanelresult['className'];if(!IsPicANDtext){try{pictureLocation.innerHTML=temppictureLocation['innerHTML'];}catch(e){}try{pictureLocation.className=temppictureLocation['className'];}catch(e){}}}}try{if(isCached)if(!arr_cached[cachenumber])arr_cached[cachenumber] = str;panelresult.innerHTML = '';var temp = document.createElement('div');temp.innerHTML = str;var arr = new Array;for(var i=0; i<temp.childNodes.length;i++){arr[i] = temp.childNodes[i];}for(i=0;i<arr.length;i++)panelresult.appendChild(arr[i]);}catch(e){}if(bb)if(!IsPicANDtext)try{pictureLocation.style.display = "none";}catch(e){};if(functionName!='' && functionName)setTimeout(functionName, 1);};this.send = function(option, FN) {if (url==''){alert("Error! url is null");return false;}if(isCached)if(arr_cached[cachenumber]){updatepage(arr_cached[cachenumber]);return;}functionName = FN;var xmlHttpReq = false; self = this;if (window.XMLHttpRequest) { self.xmlHttpReq = new XMLHttpRequest(); }else if (window.ActiveXObject) { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); }self.xmlHttpReq.open('POST', url, true); self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8'); self.xmlHttpReq.onreadystatechange = dataRecived;while(qstr.indexOf("+",0)>-1)qstr = qstr.replace("+","%2B");while(qstr.indexOf(" ",0)>-1)qstr=qstr.replace(" ","+");var x = this.optimize(this.getquerystring(option));self.xmlHttpReq.send(x);};function dataRecived(){if (self.xmlHttpReq.readyState == 4){updatepage(self.xmlHttpReq.responseText);}};this.clear = function (){qstr="";};this.optimize = function (str){if(qstr=='') return;try{var arrQuery = str.split("&");}catch(e){return;}var arrResult = new Array;var result;var state=true,t1,t2;try{for(var i=0, j=0, t; i<arrQuery.length;i++)if(arrQuery[i].indexOf('=')>-1)if(arrQuery[i].substr(arrQuery[i].indexOf('=')).length>1){t1 = arrQuery[i].substr(0,arrQuery[i].indexOf('='));for(t=0,state=true;t<arrResult.length-1;t++)if(t1.toLowerCase()==arrResult[t].substr(0,arrResult[t].indexOf('=')).toLowerCase()){state=false;t=arrResult.length+1;}if(state){arrResult[j] = arrQuery[i];j++;}}	for(i=0;i<arrResult.length;i++)result+=arrResult[i]+'&';result = result.replace('undefinednull=null&null=null&','');result = result.replace('undefinednull=null&','');result = result.replace('undefined','');}catch(e){result=qstr;}return result;};this.getquerystring = function (option) {if (typeof panelresult !='object') panelresult = document.getElementById(panelresult);try{temppanelresult['innerHTML'] = panelresult.innerHTML;temppanelresult['className'] = panelresult.className;panelresult.className = "Ajax_Panel_Refresh";}catch(e){temppanelresult['innerHTML'] = '';temppanelresult['className'] = '';}try{if (typeof pictureLocation !='object') pictureLocation = document.getElementById(pictureLocation);}catch(e){}try{temppictureLocation['innerHTML'] = pictureLocation.innerHTML;temppictureLocation['className'] = pictureLocation.className;pictureLocation.className = "Ajax_Panel_Refresh";pictureLocation.innerHTML = innerhtml;}catch(e){}if(option)this.addKey("option",option);var i;while (qstr.indexOf("&null=null&&null=null&")>-1)qstr = qstr.replace("&null=null&&null=null&", "&null=null&");return qstr;};this.addKey = function (name,value){if (name=="") return 0;this.delKey(name);qstr = qstr + name.toLowerCase() + '=' + enCode(value) + '&null=null&';};this.setCachednumber = function(number){cachenumber = number;};this.delKey = function (name){if(qstr=='')return;if(name=='')return;name=name.toLowerCase();if(name=='null')return;while(qstr.indexOf(name+'=')>-1){qstr = qstr.replace(name+'=','null=');}};this.returnKey = function (name){qstr = this.optimize(qstr);var temp = qstr.split("&");var Params = new Object ();var key;for(var i=0;i<temp.length;i++){key = temp[i].split("=");if(key[0].toLowerCase()==name.toLowerCase())return key[1];}return '';};function enCode(str){return encodeURIComponent(str.toString());};};