(function(c,f){function w(e,A){for(var B,z=0,y=e.length;z<y;z++){B=A(e[z],z,e);if(B!==f){return B}}}function m(e){return e.replace(/(^\s*)|(\s*$)/g,"")}function o(e){return Object.prototype.toString.apply(e)==="[object Array]"}function h(e){this.$name=e;var y=document.cookie.match("(?:^|;)\\s*"+e+"=([^;]*)");if(!y){return}this.value=unescape(y[1])}var x="ku6.com",d="http://analytics.ku6.com/",a=+new Date,s=escape(a*1000+(Math.random()*1000|0)),b=36500,v="",t=0,k=[["images.google","q"],["google.cn","q"],["google.com.tw","q"],["google.com.hk","q"],["google.com.sg","q"],["google.sg","q"],["cn.yahoo.com","p"],["yahoo.cn","p"],["image.baidu.com","word"],["zhidao.baidu.com","wd"],["video.baidu.com","word"],["sogou","query"],["zhongsou","word"],["soso","q"],["114","kw"],["yodao","q"],["google.com","q"],["yahoo.com","p"],["msn","q"],["live","q"],["baidu.com","wd"]];if(/juchang\.com/.test(document.domain)){x="juchang.com"}try{if(top!==c){t=1}}catch(u){t=1}h.prototype={store:function(e,D,B,C){var A=escape(this.value||""),z=this.$name+"="+A,y=new Date();y.setTime(y.getTime()+e*24*60*60*1000);if(e||e==0){z+="; expires="+y.toGMTString()}if(D){z+="; path="+D}if(B){z+="; domain="+B}if(C){z+="; secure"}document.cookie=z},remove:function(z,e,y){delete this.value;this.store(0,z,e,y)},enabled:function(){return !!navigator.cookieEnabled}};var i=new h("KUT"),l=new h("KUP"),p=new h("KUID"),g=new h("systemPPCLoginUser"),r=new h("loginUser"),q=0;function n(){if(x=="ku6.com"&&g.value&&g.value.split("_--_").length>=5){q=1}if(x=="juchang.com"&&r.value&&r.value.split("|").length>=4){q=1}if(!p.enabled()){return}if(!p.value){p.value=s;p.store(b,"/",x)}i.value=a/1000|0;i.store(b,"/",x);l.value="0";l.store(b,"/",x)}function j(){var A=document.referrer;if(!A||A.indexOf("://")<0){return""}var e=A.split("/"),y=e[2]?e[2].toLowerCase():"",z=e[e.length-1];z=z&&z.split("?")[1];if(!y||!z){return""}return w(k,function(B){if(y.indexOf(B[0].toLowerCase())<0){return}v=B[0];return w(z.split("&"),function(F,D,C){var E=F.split("=");if(E[0]==B[1]){return E[1].replace(/%20/gi,"+")}})})}this._st=function(){};this.ku_track=function(){n();if(typeof _ximg!=f&&o(_ximg)){var e=j()||"";w(_ximg,function(A,C,y){var B=[d,A,"?t?=",s,"?r?=",escape(document.referrer),"?p?=",escape(location.href),"?s?=",v,"?k?=",e,"?u?=",q,"?if?=",t,"?v?="];if(typeof c.ku6pv_options=="object"){var D=c.ku6pv_options;B.push(escape(D.id)+"|"+escape(D.name))}else{B.push("|")}B.push("?d?=");try{B.push(screen.width+":"+screen.height)}catch(E){B.push("0:0")}var z=new Image(1,1);z.src=B.join("")})}};c.PV={v:1,key:"u_info",rate:c.SURVEY_RATE||500,closeSurvey:function(){if(!this.frame){return}this.frame.style.display="none";delete this.frame},init:function(){var e=this,A=e.key,z=new h(A),C=z.value,B=Math.random()*e.rate|0,y=+new Date;if(/juchang\.com/.test(document.domain)){return}if(c.opera){c.addEventListener("message",function(D){if(D.data=="closeSurvey"){e.closeSurvey()}})}if(C){C=C.split("|");if(C[1]||y-parseInt(C[1],36)<=30*24*60*60*1000){return}}if(0==B){this.show()}},show:function(){var e=this,y=!!c.ActiveXObject;setTimeout(function(){var A=e.frame=document.createElement("div"),z=A.style;A.innerHTML='<iframe src="http://www.ku6.com/c2011/dcifrm/?r='+encodeURIComponent(location.href)+'" width="'+(y?250:255)+'" height="'+(y?210:215)+'" frameborder="0" scrolling="no"></iframe>';z.position="absolute";z.right=0;z.top=0;z.zIndex=2000;document.body.appendChild(A)},100)}};c.PV.init()})(window);
