/* ajax tiny framework by Fabio Tezedor */
if(typeof(Ajax)!="object")Ajax={Xml:{XmlHttp:{create:function(){try{if(window.XMLHttpRequest){var f=new XMLHttpRequest();if(f.readyState==null){f.readyState=1;f.addEventListener("load",function(){f.readyState=4;if(typeof f.onreadystatechange=="function")f.onreadystatechange();},false);}return f;}if(window.ActiveXObject){var e=["MSXML2","Microsoft","MSXML","MSXML3","MSXML4"],o;for(var i=0;i<e.length;i++){try{return new ActiveXObject(e[i]+".XmlHttp");}catch(ex){}}}}catch(ex){}throw new Error("Your browser does not support XmlHttp objects");}},XmlDocument:{create:function(){try{if(document.implementation&&document.implementation.createDocument){var g=document.implementation.createDocument("","",null);if(g.readyState==null){g.readyState=1;g.addEventListener("load",function(){g.readyState=4;if(typeof g.onreadystatechange=="function")g.onreadystatechange();},false);}return g;}if(window.ActiveXObject){var e=["MSXML2","Microsoft","MSXML","MSXML3","MSXML4"];for(var i=0;i<e.length;i++){try{return new ActiveXObject(e[i]+".DomDocument");}catch(ex){}}}}catch(ex){}throw new Error("Your browser does not support XmlDocument objects");}}},Http:{request:function(u,p,m,c){var async=false;if(u.indexOf("http://")>=0){throw new Error("Endereço inválido \""+u+"\"\n\nO domínio não deve ser especificado!");}u="http://"+window.location.host+(u.substr(0,1)!="/"?"/":"")+u;if(typeof(m)!="string")m="GET";else m=m.toUpperCase();if(m!="POST"&&m!="GET")m="GET";if(typeof(c)!="undefined"&&typeof(c)!="function"){throw new Error("The callback is not a function");}else{if(typeof(c)=="function")async=true;}try{var d=Ajax.Xml.XmlHttp.create();if(m=="GET"){u+=(p!=null?"?"+p:"");d.open(m,u,async);d.setRequestHeader("Content-Type","text/html; charset=\"ISO-8859-1\"");p=null;}else{d.open(m,u,async);d.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=\"ISO-8859-1\"");}d.setRequestHeader("Accept-Language","pt-BR");d.setRequestHeader("Content-Length",(p==null?0:p.length));d.setRequestHeader("Cache-Control","no-cache");d.setRequestHeader("User-Agent",window.navigator.userAgent);if(async){d.onreadystatechange=c;}d.send(p);return d;}catch(ex){throw new Error("A conexão com o servidor falhou devido ao seguinte erro:\n\n"+ex.message);}return null;}}};