ErrorLogger=function(){};ErrorLogger.url="/log-js-errors";ErrorLogger.prototype={errorsLimit:3,log:function(c){var d=this._getXHR();var b=[];for(var a in c){if(!c.hasOwnProperty(a)){continue}b.push(a+"="+encodeURIComponent(c[a]))}d.open("POST",ErrorLogger.url,true);d.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8");d.send(b.join("&"))},register:function(){var a=this;window.onerror=function(){a._handleError.apply(a,arguments)}},_handleError:function(c,b,a){if(!this.errorsLimit){return}this.errorsLimit--;var d={message:c,url:b,line:a,userAgent:navigator.userAgent,location:document.location.href,cmd:""};this.log(d)},_getXHR:function(){var c=[function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];for(var b=0,a=c.length;b<a;b++){try{return c[b]()}catch(d){}}}};new ErrorLogger().register();