/*v3.2*/;(function(){function a(e,t,n,r){if(n){var i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3);var s="; expires="+i.toGMTString()}else var s="";document.cookie=e+"="+t+s+"; path=/"+(r?"; domain="+r:"")}function l(e,t,n,r){var i={};i["mi_u_t"]=e;i["mi_u_v"]=t;i["mi_u_r"]=n;i["mi_u_d"]=r;var s=f.enf(JSON.stringify(i));if(o&&window.console&&console.log){console.log("((("+JSON.stringify(i)+")))");console.log("(((("+f.def(s)+"))))")}a("muctm",s,1,"mi.com");return true}var e={};var t=/^https?\:\/\/(\w+\.)+(mi|xiaomi|mifile|duokan|youku|miliao|miui|google\-analytics|qq|baidu)\.(com|cn)(\/|\.|\w|\=|\&|\?)*/;var n=null;var r=Math.floor(Math.random()*1e4)+1e3;var i=0;var s=1;var o=false;var u=function(e){var t=e+"=";var n=document.cookie.split(";");for(var r=0;r<n.length;r++){var i=n[r];while(i.charAt(0)==" ")i=i.substring(1,i.length);if(i.indexOf(t)==0)return i.substring(t.length,i.length)}return null};var f={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var l=0;e=f._utf8_encode(e);while(l<e.length){n=e.charCodeAt(l++);r=e.charCodeAt(l++);i=e.charCodeAt(l++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var l=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(l<e.length){s=this._keyStr.indexOf(e.charAt(l++));o=this._keyStr.indexOf(e.charAt(l++));u=this._keyStr.indexOf(e.charAt(l++));a=this._keyStr.indexOf(e.charAt(l++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=f._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r)}else if(r>127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n<e.length){r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r);n++}else if(r>191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t},enf:function(e){var t=f.encode(e);return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"*")},def:function(e){return f.decode(e.replace(/\*/g,"=").replace(/-/g,"+").replace(/_/g,"/"))}};var c=u("mutid");if(!o&&c==null)return;var h=function(e,n){if(e==null||typeof e=="undefined"||e==""||e.toUpperCase().indexOf("HTTP")!=0)return;var r=t.test(e);if(!r){if(o&&window.console&&console.log){console.log("err:"+e)}var i=window.location.href;if(!o){var s=new Image;s.src="http://a.union.mi.com/cheat?mi_u_t=5&mi_u_v="+encodeURIComponent(i)+"&mi_u_d="+encodeURIComponent(e)+"&mi_tid="+c+"&mi_u_td="+n}}};var p=function(){var e=document.referrer;if(e==null||e==undefined||e.toLowerCase().indexOf("http://a.union.mi.com/mua")!=0)return;var t=document.documentElement.clientHeight;if(t<100){if(o&&window.console&&console.log){console.log("window too small:"+t)}var n=window.location.href;if(!o){var r=new Image;r.src="http://a.union.mi.com/cheat?mi_u_t=6&mi_u_v="+encodeURIComponent(n)+"&mi_u_d="+t+"&mi_tid="+c}}};var d=function(){if(window.parent!=window.top)return;var e=u("mudjc");if(e==c)return;a("mudjc",c,.007,"mi.com");var t=document.getElementById("unjcIfrm");if(t!=null)return;t=document.createElement("IFRAME");t.setAttribute("id","unjcIfrm");t.setAttribute("src","http://mi.com");t.style.width="0px";t.style.height="0px";t.onload=function(){var e=u("mutid");if(e!=null&&e!=c){if(o&&window.console&&console.log){console.log("jc:"+c+":::"+e)}a("mudjc",e,.007,"mi.com");var t=window.location.href;l("9",t,document.referrer,c);if(!o){var n=new Image;n.src="http://a.union.mi.com/cheat?mi_u_t=9&mi_u_v="+encodeURIComponent(t)+"&mi_u_d="+c+"&mi_tid="+e}}};document.body.appendChild(t)};setTimeout(function(){var t=document.getElementsByTagName("a");for(var n=0;n<t.length;n++){var r=t[n].getAttribute("href");e[t[n]]=r}var i=document.getElementsByTagName("iframe");for(var s=0;s<i.length;s++){var r=i[s].getAttribute("src");e[i[s]]=r}p()},5);clearTimeout(n);n=setTimeout(function(){if(i>=s){clearTimeout(n);return false}var t=document.getElementsByTagName("a");for(var o=0;o<t.length;o++){var u=t[o].getAttribute("href");if(e[t[o]]!=u){h(u,"aHref");e[t[o]]=u}}var a=document.getElementsByTagName("iframe");for(var f=0;f<a.length;f++){var u=a[f].getAttribute("src");if(e[a[f]]!=u){h(u,"iframeSrc");e[a[f]]=u}}d();r=r*2;i++;n=setTimeout(arguments.callee,r)},r)})();