if(!LBS)var LBS={};
LBS.HTTP=new (function(){this.sendRequest=function(a){var c=LBS.HTTP.Request.METHOD,b=g();b.onreadystatechange=new h(a,b);var d=a.getUrl(),j=a.getMethod(),f="";a=a.getParams();if(a.length>0){if(j===c.GET)f="?";for(var i in a){var e=a[i],k=e.name;e=e.value;if(e instanceof window.Array)for(var l in e){f+=encodeURIComponent(k)+"[]=";f+=encodeURIComponent(e[l])+"&"}else{f+=encodeURIComponent(k)+"=";f+=encodeURIComponent(e)+"&"}}f=f.substring(0,f.length-1)}if(j===c.GET){b.open("GET",d+f,true);b.send(null)}else if(j===
c.POST){b.open("POST",d,true);b.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");b.send(f)}};var h=function(a,c){var b=LBS.HTTP,d=b.Response.STATUS,j=null,f=false;j=setTimeout(function(){f=true;c.abort();a.getCBF()(new b.Response(d.TIMEOUT))},a.getTimeout());return function(){if(c.readyState==4)if(f==false){clearTimeout(j);var i=new b.Response(d.ERROR);i.setHttpStatusCode(c.status);if(c.status==200){i.setStatus(d.OK);i.setResponseText(c.responseText);i.setResponseXml(c.responseXML)}a.getCBF()(i)}}},
g=function(){g=window.XMLHttpRequest?function(){return new XMLHttpRequest}:function(){var a=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];for(var c in a)try{return new ActiveXObject(a[c])}catch(b){}return null};return g()}});
LBS.HTTP.Request=function(h,g,a,c){this.setUrl=function(e){b=e};this.getUrl=function(){return b};this.setMethod=function(e){d=e};this.getMethod=function(){return d};this.setCBF=function(e){j=e};this.getCBF=function(){return j};this.addParam=function(e,k){f.push({name:e,value:k})};this.getParams=function(){return f};this.setTimeout=function(e){i=e};this.getTimeout=function(){return i};var b=h,d=g,j=a,f=[],i=c};LBS.HTTP.Request.METHOD={GET:1,POST:2};
LBS.HTTP.Response=function(h){this.setStatus=function(d){g=d};this.getStatus=function(){return g};this.setHttpStatusCode=function(d){a=d};this.getHttpStatusCode=function(){return a};this.setResponseText=function(d){c=d};this.getResponseText=function(){return c};this.setResponseXml=function(d){b=d};this.getResponseXml=function(){return b};var g=h,a,c,b};LBS.HTTP.Response.STATUS={OK:1,ERROR:2,TIMEOUT:3};
LBS.HTTP.JSON=new (function(){this.parse=function(g){return h(g)};var h=function(g){try{var a=JSON.parse(g);h=function(b){return JSON.parse(b)};return a}catch(c){h=function(b){return eval("("+b+")")};return h(g)}}});

