Ajax=function(){this.url=null;this.timeout=10000;this.method='GET'};Ajax.prototype.request=function(url,functionExecName,argumentos,timeout,method){var requestHttp=false;this.url=url;if(timeout!=null){this.timeout=timeout}if(method!=null){this.method=method}if(window.XMLHttpRequest){requestHttp=new XMLHttpRequest();if(requestHttp.overrideMimeType){requestHttp.overrideMimeType('text/javascript')}}else if(window.ActiveXObject){try{requestHttp=new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{requestHttp=new ActiveXObject('Microsoft.XMLHTTP')}catch(e){return}}}var args_post='argumentos='+__encodeUrl(argumentos.replace(/\+/gi,'$MAIS$').replace(/&/gi,'$ECOM$').replace(/\?/gi,'$INTER$'));var errorReturn=null;try{if(functionExecName!=null){requestHttp.onreadystatechange=function(){if(requestHttp.readyState==4){if(requestHttp.status==200){try{if(requestHttp.responseText.indexOf('[VoxelAjaxError]')>-1){eval(requestHttp.responseText.replace('[VoxelAjaxError]',''));response=null}else{eval('response = '+requestHttp.responseText)}}catch(e){errorReturn={Message:e.description,StackTrace:null,Type:e.name};response=null}var resp={value:(typeof response=='function'?response():response),text:requestHttp.responseText,error:errorReturn};functionExecName(resp);requestHttp.abort()}else{var resp={value:null,text:null,error:{Message:requestHttp.statusText,StackTrace:null,Type:'Connection failure.'}};functionExecName(resp);requestHttp.abort()}}};requestHttp.open(this.method,this.url,true)}else{requestHttp.open(this.method,this.url,false)}}catch(e){var resp={value:null,text:null,error:{Message:'The resource cannot be found',StackTrace:null,Type:'Connection failure.'}};return resp}requestHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');if(method=='POST')requestHttp.send(args_post);else requestHttp.send(null);if(functionExecName==null){try{if(requestHttp.responseText.indexOf('[VoxelAjaxError]')>-1){response=null;eval(requestHttp.responseText.replace('[VoxelAjaxError]',''))}else{eval('response = '+requestHttp.responseText)}}catch(e){response=null;errorReturn={Message:e.description,StackTrace:null,Type:e.name}}var resp={value:(typeof response=='function'?response():response),text:requestHttp.responseText,error:errorReturn};requestHttp.abort();return resp}return null};function __encodeUrl(vl){var SAFECHARS="0123456789"+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"abcdefghijklmnopqrstuvwxyz"+"-_.!~*'()";var HEX='0123456789ABCDEF';var plaintext=vl;var encoded='';for(var i=0;i<plaintext.length;i++){var ch=plaintext.charAt(i);if(ch==' '){encoded+='+'}else if(SAFECHARS.indexOf(ch)!=-1){encoded+=ch}else{var charCode=ch.charCodeAt(0);if(charCode>255){encoded+='+'}else{encoded+='%';encoded+=HEX.charAt((charCode>>4)&0xF);encoded+=HEX.charAt(charCode&0xF)}}}return encoded};