function Ajax(url,data){var xmlHttp=null;var onSuccessCbF='';var onSuccessMth='';var onFailureCbF='';var onLoadingCbF='';var onLoadedCbF='';var onSuccessArg='';var onFailureArg='';var onLoadingArg='';var onLoadedArg='';var notrun=true;var rawdata=false;function init(){if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest();}else if(window.ActiveXObject){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}} this.doRequest=function(options){init();var encoded=null;if(typeof(data)!="undefined"){if(data!==null){method="POST";encoded=JSON.stringify(data);}else{method="GET";}}else{method="GET";} xmlHttp.onreadystatechange=getResponse;xmlHttp.open(method,url,true);if(document.xmlVersion){xmlHttp.setRequestHeader('Accept','text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8');}else{xmlHttp.setRequestHeader('Accept','text/html,*/*;q=0.8');} if(typeof(options)=="undefined"){options={};} if(typeof(options["elements"])=="object"&&typeof(options["elements"].join)!="undefined"){xmlHttp.setRequestHeader("HTML-Nodes",options["elements"].join(";"));}else if(typeof(options["raw"])=="undefined"||!options["raw"]){xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");}else if(typeof(options["raw"])!="undefined"&&options["raw"]){rawdata=true;} if(typeof(options["headers"])!="undefined"){for(var k in options["headers"]){xmlHttp.setRequestHeader(k,options["headers"][k]);}} if(method!="GET"){xmlHttp.send(encoded);}else{xmlHttp.send(null);}};function getResponse(){switch(xmlHttp.readyState){case 1:_onLoading();break;case 2:_onLoaded();break;case 4:if(xmlHttp.status==200){_onSuccess();}else{_onFailure();} break;default:break;}} function getXmlResponse(){return xmlHttp.responseXML;} function getTextResponse(){return xmlHttp.responseText;} function _onSuccess(){if(onSuccessCbF==''){delete xmlHttp;return false;} var output='';switch(onSuccessMth){default:case"text":output=getTextResponse();break;case"xml":output=getXmlResponse();break;} if(!rawdata){try{output=JSON.parse(output);}catch(e){alert(e+"\n"+output);}} var ref=null;if(typeof(onSuccessCbF)=="string"){if(onSuccessCbF.indexOf(".")>=0){var objs=onSuccessCbF.split(".");objs.pop();ref=objs.join(".");ref=eval(ref);} eval(onSuccessCbF).call(ref,output,onSuccessArg);}else if(typeof(onSuccessCbF)=="function"){onSuccessCbF(output,onSuccessArg);}else if(typeof(onSuccessCbF)=="object"){onSuccessCbF[1].call(onSuccessCbF[0],output,onSuccessArg);} delete xmlHttp;return true;} function _onFailure(){var output=getTextResponse();if(onFailureCbF==''){alert(output);}else{var ref=null;if(typeof(onFailureCbF)=="string"){if(onFailureCbF.indexOf(".")>=0){var objs=onFailureCbF.split(".");objs.pop();ref=objs.join(".");ref=eval(ref);} eval(onFailureCbF).call(ref,output,onFailureArg);}else if(typeof(onFailureCbF)=="function"){onFailureCbF(output,onFailureArg);}else if(typeof(onFailureCbF)=="object"){onFailureCbF[1].call(onFailureCbF[0],output,onFailureArg);}}delete xmlHttp;return true;} function _onLoading(){if(notrun){notrun=false;if(onLoadingCbF==''){delete xmlHttp;return false;} var ref=null;if(typeof(onLoadingCbF)=="string"){if(onLoadingCbF.indexOf(".")>=0){var objs=onLoadingCbF.split(".");objs.pop();ref=objs.join(".");ref=eval(ref);} eval(onLoadingCbF).call(ref,onLoadingArg);}else if(typeof(onLoadingCbF)=="object"){if(typeof(onLoadingCbF.length)!="undefined"){onLoadingCbF[1].call(onLoadingCbF[0],onLoadingArg);}else{onLoadingCbF(onLoadingArg);}} delete xmlHttp;return true;}} function _onLoaded(){if(onLoadedCbF==''){delete xmlHttp;return false;} var ref=null;if(typeof(onLoadedCbF)=="string"){if(onLoadedCbF.indexOf(".")>=0){var objs=onLoadedCbF.split(".");objs.pop();ref=objs.join(".");ref=eval(ref);} eval(onLoadedCbF).call(ref,onLoadedArg);}else if(typeof(onLoadedCbF)=="object"){if(typeof(onLoadedCbF.length)!="undefined"){onLoadedCbF[1].call(onLoadedCbF[0],onLoadedArg);}else{onLoadedCbF(onLoadedArg);}} delete xmlHttp;return true;};this.onSuccess=function(callback_fce,arg){onSuccessCbF=callback_fce;onSuccessMth="text";onSuccessArg=arg;};this.onFailure=function(callback_fce,arg){onFailureCbF=callback_fce;onFailureArg=arg;};this.onLoading=function(callback_fce,arg){onLoadingCbF=callback_fce;onLoadingArg=arg;};this.onLoaded=function(callback_fce,arg){onLoadedCbF=callback_fce;onLoadedArg=arg;}} if(!this.JSON){this.JSON={};} (function(){function f(n){return n<10?'0'+n:n;} if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+ f(this.getUTCMonth()+1)+'-'+ f(this.getUTCDate())+'T'+ f(this.getUTCHours())+':'+ f(this.getUTCMinutes())+':'+ f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};} var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);} if(typeof rep==='function'){value=rep.call(holder,key,value);} switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';} gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i