/*
 * Compressed by JSA(www.xidea.org)
 */
function MeizuLogger(){}MeizuLogger.prototype={getType:function(){var B=location.href,A="https:"==document.location.protocol?"https://":"http://",$="tongji.meizu.com",_=[{type:1,url:A+$+"/flow/mc?"},{type:2,url:A+$+"/flow/je?"},{type:3,url:A+$+"/flow/st?"}];return _},request:function(A,D){var $=this.getType(),_=this.getQueryJson(A,D),C=$.length;for(var G=0;G<C;G++)if($[G].type===D)var E=$[G].url;var B=new Image(),F=this.makeUrl(E,_);B.src=F;B.onload=function($){}},makeUrl:function(_,$){if(_.indexOf("?")==-1)_+="?";if(!/\?$/.test(_))_+="&";if(typeof $=="string")_+=$;else _+=this.urlEncodeObj($);return _},urlEncodeObj:function($){var _=[];for(var A in $)if($.hasOwnProperty(A))_.push(A+"="+encodeURIComponent($[A]));return _.join("&")},getQueryObj:function(A){var $={},C=A.split("&");for(var E=0;E<C.length;E++){var _=C[E].split("="),D=_[0],B=_[1];$[D]=B}return $},getTextOverFlow:function($,_){if($.length<=_)return $;else return $.substring(0,_)},jsError:function(){var $=this;window.onerror=function(H,B,D){if(typeof H!="string")return;var F=[],_=arguments.callee.caller,G=/function (\w*\([^(]*\))/;while(_){var C=_.toString(),E=C.match(G);F.push((E&&E[1])||C);_=_.caller}var A={mg:H,fi:B,li:D,stk:$.getTextOverFlow(F.join(""),50)};$.request(A,2)}},render:function(){var $=this;this.topGlobalClick();this.jsError();this.getStayTime();this.request(null,1)},topGlobalClick:function(){var $=this;document.body.onclick=function(B){var C;B=B?B:window.event;var _=B.target||B.srcElement;while(_){try{if(_.getAttribute)C=_.getAttribute("data-bh")}catch(A){if(_.attributes)C=_.attributes["data-bh"]}if(C)break;else _=_.parentNode}if(C)$.request(C,1)}},getQueryJson:function(B,D){var A={};if(B)if(B.constructor===String){if(B.indexOf("=")!=-1)A=this.getQueryObj(B);else A.action=B}else if(B.constructor===Object)A=B;var $=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{type:"unknown"},E=window.screen.width+"x"+window.screen.height,C=$.type,_={ver:"1.0",re:document.referrer,rnd:parseInt(Math.random()*10000000),rc:this.queryString("refcode"),ru:location.href,dp:E,nt:C};for(var F in A)_[F]=A[F];if(D==2){_=B;_.ru=location.href}return _},queryString:function(B,A){A=A||location.search;A=A.split(/&|\?/);var $="";B=String(B).toLowerCase();for(var D=0;D<A.length;D++){var C=A[D],_=C.split("=");if(_[0].toLowerCase()==B){$=_[1];break}}return $},getStayTime:function(){var C=this,$=+new Date(),B=this.getType(),E=false;function _(){E=false;window.onbeforeunload=D}function A(){E=true;var A=+new Date(),_=A-$;C.request({st:_/1000},3);window.onbeforeunload=null}function D(){if(!E)A()}_()}};var meizuLogger=new MeizuLogger();meizuLogger.render();window.MeizuBH=function($){return meizuLogger.request($,1)}