(function(){try{var c=document.styleSheets[0].href.match(/http:\/\/[^\/]+/);if(c&&c[0]!="http://css.tudouui.com"){document.write("<script type='text/javascript' src='"+c+"/autodomain.js?r="+Math.random()+"'><\/script>")}}catch(i){}var g=navigator.userAgent.toLowerCase();var f=document.compatMode=="CSS1Compat";var h=f?document.documentElement:document.body;var d={};var b=Array.prototype;if(!b.filter){b.filter=function(m){var n=[];for(var j=0,e=this.length;j<e;j++){if(m(this[j],j,this)){n.push(this[j])}}return n}}if(!b.forEach){b.forEach=function(m){for(var j=0,e=this.length;j<e;j++){m(this[j],j,this)}}}if(!b.map){b.map=function(m){var n=[];for(var j=0,e=this.length;j<e;j++){n.push(m(this[j],j,this))}return n}}if(!window.TUI){window.TUI={}}var a=window.TUI=$.extend({Browser:{MobileSafari:!!g.match(/apple.*mobile.*safari/),ie:/msie/.test(g)&&!/opera/.test(g)},elm:function(e){return document.getElementById(e)},unique:function(q){var j=[],e={},o,m;var n={number:function(r){return"_TUI_num"+r},string:function(r){return r},"boolean":function(r){return"_TUI_boolean"+r},object:function(r){return r===null?"TUI_null":$.data(r)},"undefined":function(r){return"_TUI_undefined"}};for(var l=0,p=q.length;l<p;l++){o=m=q[l];m=n[typeof o](o);if(!e[m]){j.push(o);e[m]=true}}return j},substr:function(r,m,e){if(!r||typeof r!=="string"){return""}var q=[],p=r.split("");for(var o=0,s=0,j=p.length;o<j;o++){if(s>m){return e?e.call(q.join("")):(q.join("")+"...")}q.push(p[o]);s=s+(/[^\x00-\x80]/.test(p[o])?2:1)}return q.join("")},getFlashMC:function(e){return this.Browser.ie?window[e]:document[e]},domain:{join:function(e){for(var j in e){window[j+"_domain"]=window[j+"_domain"]||("http://"+e[j])}}},module:{join:function(j){var l=j.match(/\/js(\/.*?)([^\/]+?)_?(\d*)\.js/);if(!l){return false}var m=l[1]+l[2];var e=d[m];if(!e){e=d[m]={}}e.path=l[1];e.version=l[3]||0;e.callback=[];e.url=[js_domain,"/js",e.path,l[2],(l[3]?("_"+l[3]):""),".js"].join("");return e},use:function(l,e){var j=d[l];if(!j||!j.url){return false}if($.isFunction(e)){j.callback.push(e)}else{e=function(){}}if(!j.loaded){a.getCacheJS(j.url,false,function(){j.loaded=true;j.callback.forEach(function(m){m(j)})},"script")}else{e(j)}return true}},getCacheJS:function(e,l,m,j){if(jQuery.isFunction(l)){m=l;l=null}jQuery.ajax({type:"GET",url:e,data:l||"",success:m||function(){},cache:true,dataType:j||"jsonp"})},ajaxCache:{},getCache:function(j,n,o){var e=a.ajaxCache,l=encodeURI(j);if(e[l]){n(e[l])}else{var m={};if(o){if(typeof o=="string"){m.type=o}else{$.extend(m,o)}}$.ajax({url:j,type:"GET",dataType:m.type,cache:m.cache,success:function(p){e[l]=p;n(p)}})}},cookie:function(q,l,r,p){if(typeof q=="string"){p=r;r=l;l=q;q=window}if(r!==undefined){p=p||{};var m,j="";if(p.expires){if(p.expires.constructor==Date){m=p.expires}else{m=new Date();m.setTime(m.getTime()+(p.expires*24*60*60*1000))}j="; expires="+m.toGMTString()}var s=p.path?"; path="+p.path:"";var o=p.domain?"; domain="+p.domain:"";var e=p.secure?"; secure":"";q.document.cookie=[l,"=",encodeURIComponent(r),j,s,o,e].join("")}else{r=q.document.cookie.match(new RegExp("(?:\\s|^)"+l+"\\=([^;]*)"));return r?decodeURIComponent(r[1]):null}},clone:function(e,j){var n=$.isFunction(e);var m=n?e.prototype:e;var l=function(){if(n){this.superClass=e}if(j){j.apply(this,arguments)}};l.prototype=m;return n?l:(new l())},eventProxy:function(l,j,m,e){m=$.extend({hasClass:{},hasId:{},hasTag:{},hasAttr:{}},m);$(l).bind(j,function(q){var o=q.target;var p=m.hasId[o.id]||m.hasClass[o.className]||m.hasTag[o.nodeName.toLowerCase()]||null;var n="nomatch";if(p){n=p.call(o,q)}else{$.each(m.hasAttr,function(r){if($(o).attr(r)){n=m.hasAttr[r].call(o,q);return false}})}if(n!=="nomatch"){return n||e===0&&n||false}});return m},uEvent:function(j){j=$.event.fix(j||window.event);j.charCode=j.charCode||j.which;j.time=(new Date()).getTime();return j},pos:{scrollTop:function(){return window.pageYOffset||h.scrollTop},scrollLeft:function(){return window.pageXOffset||h.scrollLeft},windowHeight:function(){return window.innerHeight||h.clientHeight},windowWidth:function(){return window.innerWidth||h.clientWidth},elementLeft:function(e){return $(e).offset().left},elementTop:function(e){return $(e).offset().top}},parseUrlHash:function(n){if(typeof n!="string"){n=$(n).attr("href")}if(!/#\w/.test(n)){return[]}n=n.replace(/^\S*#/,"");var j=n.replace(/[\/\?]*([^\?\/]+\=[^\?\/]+)*$/,"").split("/");var o=n.match(/[\/\?]*([^\?\/]+\=[^\?\/]+)$/);if(o==null){return j}o=o[1].split("&");for(var m=0,q={},e=o.length;m<e;m++){k=o[m].match(/(&|\?|)([^=]+)(=)?([^=]*)/);q[k[2]]=k[4]||null}j.push(q);return j[0]?j:[q]},renderTpl:function(e,j){return e.replace(/<%\=(\w+)%>/g,function(m,l){return j[l]||""})},rand:function(e){return Math.floor(Math.random()*e)},isNoCloseTag:function(e){return/^(area|base|basefont|col|frame|hr|img|br|input|isindex|link|meta|param)$/.test(e.toLowerCase())},addElm:function(l,j,e){var m=document.createElement("div");if(/</.test(l)){m.innerHTML=l;e=j}else{var n=[""],o="<"+l;j=j||{};$.each(j,function(p){if(p=="innerHTML"){return true}n.push((p=="className"&&'class="'||(p+'="'))+this+'"')});m.innerHTML=["<",l,n.join(" "),(a.isNoCloseTag(l)?" />":[">",j.innerHTML||"","</",l,">"].join(""))].join("")}var o=m.firstChild;if(e){e.call(o)}delete m;return o},getRequest:function(e,j){$(function(){(new Image()).src=!j?e:[e,e.match(/\?/)?"&":"?",typeof j=="string"?j:$.param(j)].join("")})},copyToClip:function(j,e){e=e||function(){};if(window.clipboardData){window.clipboardData.setData("text",j);e(true,"已经复制到你的剪贴板")}else{e(false,"抱歉，在你使用的浏览器里不能自动复制到剪贴板～")}},debug:function(e){if(window.console&&window.console.error){console.error(e)}}},window.TUI);a.api={subscribe:function(m,p,j,n){if(m.constructor==Object){var e=m;n=arguments[2];j=arguments[1];m=e.type;p=e.id;var o=$.param(e)}else{var o="type="+m+"&id="+p}if(typeof n!="boolean"){n=true}var l=n?"/my/sub/subscribe.php":"/my/sub/unsubscribe.php";$.getJSON(l,o,function(q){if(j){j(q);return false}if(q.status==0){location="http://www.tudou.com/my/sub/"}else{a.panel(q.message)}})},uploadImg:function(e){document.domain="tudou.com";a.panel('<!--noicon--><iframe id="tudou_uploadImg" src="'+main_domain+'/my/picture/picShow.srv?rows=6" frameborder="no" style="width:100%;height:460px;overflow:hidden;" ></iframe>',"插入图片",{value:"插入图片",handler:function(){var j=document.getElementById("#tudou_uploadImg")[0].contentWindow.document.body;$(j).find("input[name=chosenImg]").each(function(){if($(this).attr("checked")){e(this.value)}})}},{value:"取消"})}};a.animate=function(B,t,r,C){var z=r.duration||r;var D=z/30;var v={},w={},u=[],q,j;for(var A in t){if(!B.style[A]){B.style[A]=(parseInt($.curCSS(B,A))||0)+"px"}w[A]=t[A]-parseFloat(B.style[A]);v[A]=w[A]/D;u.push(A)}var y=u.length;var x=u[0];if(r.buffer){q=Math.abs(w[x]/3)}var e=setInterval(function(){var n=parseFloat(B.style[x]);var p=t[x]-n;if(p<0){p=-p}if(v[x]>0&&p<v[x]||v[x]<0&&p<-v[x]){clearInterval(e);for(var l=0;l<y;l++){B.style[u[l]]=t[u[l]]+"px"}if(C){C.call(B)}e=null;return false}var o=0;for(var m=0;m<y;m++){x=u[m];n=parseFloat(B.style[x]);if(r.buffer){if(p<=q){v[x]=v[x]*r.buffer}}B.style[x]=n+v[x]+"px"}},30);return e};a.stick=function(y,q,m){var s=(y.constructor==Array)?{left:y[0],top:y[1]}:$(y).offset();var w=(q.constructor==Array)?{w:q[0],h:q[1]}:{w:q.offsetWidth,h:q.offsetHeight};var e=a.pos;var x={l:e.scrollLeft(),t:e.scrollTop(),w:e.windowWidth(),h:e.windowHeight()};var u,l;if(m!==undefined){var r=parseInt(++m/3),j=m%3;var n=function(p,v,t,o){if(p==0){return v}else{if(p==1){return v-(o-t)/2}else{if(p==2){return v-(o-t)}}}};if(r==0||r==4){u=s.top-w.h;l=n(j,s.left,y.offsetWidth,w.w)}else{if(r==1){u=n(j,s.top,y.offsetHeight,w.h);l=s.left+(y.offsetWidth||0)}else{if(r==2){u=s.top+(y.offsetHeight||0);l=n([2,1,0][j],s.left,y.offsetWidth,w.w)}else{if(r==3){u=n([2,1,0][j],s.top,y.offsetHeight,w.h);l=s.left-w.w}}}}}else{u=s.top+(y.offsetHeight||0);l=s.left;if(u+w.h>x.t+x.h){u-=(y.offsetHeight||0)+w.h}if(l+w.w>x.l+x.w){l-=w.w}}if(q.constructor!=Array){q.style.left=l+"px";q.style.top=u+"px"}return{t:u,l:l}};a.fixPosition=function(p,o){var m,l;var n=g.match(/msie\D*(\d+)/);var j=(n&&parseInt(n[1])<7);var e=function(){var q,r=function(){return(m.bottom>-1000)?(a.pos.windowHeight()-m.height-m.bottom+a.pos.scrollTop()):((m.top||0)+a.pos.scrollTop())};if(j){p.style.position="absolute";q=o?(function(){var s=r(),u=m.elm;if(o.top>-1000&&s<o.top){s=o.top}else{if(o.bottom>-1000&&s>h.offsetHeight-o.bottom){s=h.offsetHeight-o.bottom}}u.style.top=s+"px"}):(function(){m.elm.style.top=r()+"px"})}else{if(o){q=function(){var s=r(),u=m.elm;if(o.top>-1000&&s<o.top){u.style.position="absolute";u.style.top=o.top+"px"}else{if(o.bottom>-1000&&s>h.offsetHeight-o.bottom){u.style.position="absolute";u.style.top=h.offsetHeight-o.bottom+"px"}else{if(parseInt(u.style.top)>-1000){u.style.position="fixed";u.style.top=""}}}}}}return q};if(j||o){m={elm:p,top:parseInt($(p).css("top")),bottom:parseInt($(p).css("bottom")),limit:o};if(m.bottom>-1000){m.height=p.offsetHeight}l=e();l(m);$(window).bind("scroll",function(){l(m)});return m}return false};a.dropbox=function(p){var l=p.target,m=p.drop||$(l).find("ul")[0],j;$(l).bind("mouseover",e).mouseout(function(){o("out",p.hide||p.action||(function(){$(this).hide()}))});function e(q){o("over",p.show||p.action||(function(){$(this).show()}))}function n(){if(j){clearTimeout(j)}}function o(q,r){if(j){clearTimeout(j)}q=(q=="over");j=setTimeout(function(){r.call(m,l);$(l).unbind("mouseover",q?e:n).bind("mouseover",q?n:e)},q?0:500)}};a.tipbox=function(o,e,j,p){var n=true,m=a.elm("TUI_tipbox"),p=p||{};if(!o&&m){m.style.display="none";return false}j="box "+(j?j:"");if(o.constructor==Array||o.innerHTML==""){n=false}var l=n?o:document.body;if(!m){m=a.addElm('<div id="TUI_tipbox" class="'+j+'" style="display:none;"></div>');if(n&&o&&$(o).css("position")!="absolute"){o.style.position="relative"}}else{m.style.display="none"}l.appendChild(m);if(e){e.call(m)}m.className=j;if(p.fade===false){m.style.display="block"}else{$(m).fadeIn(p.fade||400)}if(!n){a.stick(o,m)}return m};a.prompt=function(v,s,l,p){var l=(l||0)+1,q=parseInt(l/3),e=l%3,t,m,r=[6,5,10,9,8,1,0,11,4,3,2,7];if(q==0||q==4){t="padding:20px 0 0 0;background-position:"+["left","center","right"][e]+" top;";m="border-width:0 1px 1px 0;"}else{if(q==1){t="padding:0 20px 0 0;background-position:right "+["top","center","bottom"][e];m="border-width:0 0 1px 1px;"}else{if(q==2){t="padding:0 0 20px 0;background-position:"+["right","center","left"][e]+" bottom;";m="border-width:1px 0 0 1px;"}else{if(q==3){t="padding:0 0 0 20px;background-position:left "+["bottom","center","top"][e];m="border-width:0 1px 1px 0;"}}}}var n=a.addElm('<div class="t_prompt"><div class="myarrow" style="'+t+'"><div style="'+m+'">'+v+"</div></div></div>");document.body.appendChild(n);a.stick(s,n,r[l-1]);var u=p?document:n;var j=function(){$(u).unbind("mousedown",j);document.body.removeChild(n)};$(u).bind("mousedown",j);return n};a.panel=function(t,x,r,w){var o=[],s=false,q,y,v=arguments.length,u=$("#tudou_panel")[0];if(v<=4&&typeof arguments[2]!="object"){if(!x||typeof x=="function"){q={value:"确定",handler:x||function(){}};x="土豆提示"}else{q={value:typeof r=="string"?r:"确定",handler:(r&&typeof r=="function")&&r||(w&&typeof r=="string")&&w||function(){}}}o.push(q)}if(u){m()}var z={},e=t.match(/^<\!--([^-]+)/);if(e){e=e[1].split(",");$.each(e,function(){z[$.trim(this)]=true})}u=a.addElm(['<div id="tudou_panel"><div class="caption"><h3>',x,'</h3><a href="#" id="dlg_close">关闭</a></div><div class="container">',z.noicon?"":('<p id="dlg_msg" class="r'+(a.rand(3)+1)+'">'),t,z.noicon?"":"</p>",'</div><div class="footbtns" id="dlg_btn"></div>',"</div>"].join(""));document.body.appendChild(u);if(a.maskAllPage()){s=true}else{a.maskAllPage(0.6)}if(!z.nocenter){u.style.top=(a.pos.windowHeight()-u.offsetHeight)/2+a.pos.scrollTop()+"px"}for(var p=2;p<v;p++){if(typeof arguments[p]=="object"){o.push(arguments[p])}}if(!z.nobutton){y=$("#dlg_btn")[0];for(var p=0,n=o.length;p<n;p++){y.appendChild(j(o[p].value,o[p].handler,(p==0)?"on":""))}u.className=n==1&&"alert"||n==2&&"confirm"||n==3&&"custom";$("#dlg_btn")[0].lastChild.focus()}$("#dlg_close").click(function(){if(n>1){var l=o[n-1].handler;if(l){l.apply(this,arguments)}}m();return false});function j(A,l,C){l=l||function(){};var B=a.addElm('<a href="#" class="'+(C||"")+'">'+A+"</a>");$(B).click(function(){var D=l.apply(this,arguments);if(D!==false){m()}return false});return B}function m(){if(!s){a.maskAllPage(-1)}document.body.removeChild(u);u=null}};a.confirm=function(j,e){a.panel(j,"土豆提示",{value:"确认",handler:e},{value:"取消",handler:function(){}})};a.noAboveFloater=function(j,l,e){l=l||document.body,status=j?"hidden":"";$(l).find("select").each(m);if(!e){$(l).find("object").each(m)}function m(){this.style.visibility=status}};a.maskAllPage=function(n,l,j){if(arguments.length==0){return document.getElementById("tudou_masklayer")}if(n<0){document.body.removeChild(document.getElementById("tudou_masklayer"));a.noAboveFloater(false,false,j);return false}if(!document.getElementById("tudou_masklayer")){var e=document.createElement("DIV");e.id="tudou_masklayer";e.style.width=document.body.offsetWidth+"px";e.style.height=document.body.offsetHeight+"px";e.style.position="absolute";e.style.top="0";e.style.left="0";e.style.zIndex="10000";document.body.appendChild(e)}else{var e=document.getElementById("tudou_masklayer")}a.noAboveFloater(true,false,j);e.style.opacity=n;e.style.filter="alpha(opacity="+n*100+")";e.style.background=l||"#000000";return e};a.switchTabNoAjax=function(o){var j=o.tab,r=o.list,n=o.noDefaultTag,e=o.noIgnoreRepeat,l=o.fade,m=o.action,p=null,s=0;if(!j[0]){return false}$.each(j,function(){if(this.className.indexOf("current")!=-1){p=this}});if(!p){p=j[0];if(!n){$(p).addClass("current")}}if(!n){s=a.parseUrlHash(p.nodeName=="A"?p:p.getElementsByTagName("A")[0])[0];var q=r?r[s-1]:a.elm(s);if(m){m(q,q,true)}else{$(q).show()}}return{go:function(v,u){var y=a.parseUrlHash(v)[0];var x=r?r[y-1]:a.elm(y);var w=s?(r?r[s-1]:a.elm(s)):null;if(!x){return false}if(s==y){if(e){this.back(x)}return false}if(u){u.call(v,p,w,x)}s=y;if(/current/.test(p.className)){$(p).removeClass("current")}if(p.nodeName!="A"){v=v.parentNode}p=v;$(v).addClass("current");if(m){m(x,w)}else{if(w){$(w).hide()}if(l){$(x).fadeIn(l)}else{$(x).show()}}return false},back:function(v,u){if(!v){var w=a.parseUrlHash(p.nodeName=="A"?p:p.getElementsByTagName("A")[0])[0];v=r?r[w-1]:a.elm(w)}if(/current/.test(p.className)){$(p).removeClass("current")}s=0;if(u){u.call(v,p)}if(m){m(v,v,true)}else{$(v).hide()}return false}}};a.searchHint=(function(){var j={_control:function(q){var p,s,m,r=this.op,o=this;if(this.loaded&&(q.keyCode==38||q.keyCode==40)){if(!this.tipbox){return true}p=$(this.tipbox).find("li");m=p.length;if(this.lastn!==null){s=(q.keyCode==38)?((this.lastn-1<0)?m-1:this.lastn-1):((this.lastn+1<m)?this.lastn+1:this.lastn-m+1);p[this.lastn].className=""}else{s=0}p[s].className="chosen";this.lastn=s;r.input.value=$(p[s]).attr("keyv");r.input.select()}else{if(this.timer){clearTimeout(this.timer)}this.loaded=false;this.lastn=null;this.timer=setTimeout(function(){o.getData()},100)}},_toggleList:function(){var l=this,m=$(this.tipbox).find("li");$(m).mouseover(function(o){var n=this;if(l.lastn!==null){m[l.lastn].className=""}n.className="chosen";l.lastn=parseInt($(n).attr("ord"))}).click(function(o){var n=this;l.op.input.value=$(n).attr("keyv");clearTimeout(l.timer);l.op.input.select();l.hide()});this.loaded=true}};var e={show:function(m){var n,p,l=[],o=this.op;if(o.type=="programs"){n="个视频"}else{if(o.type=="playlist"){n="个豆单"}}$.each(m,function(q){p=this.split(/#(?=\d+$)/);l.push(a.renderTpl('<li ord="<%=order%>" keyv="<%=key%>"><span><%=key%></span><em><%=count%></em></li>',{order:q||"0",key:p[0],count:p[1]+n}))});this.tipbox=a.tipbox(o.input.parentNode.parentNode,function(){this.innerHTML="<ul>"+l.join("")+"</ul>"},"gst",{fade:false});j._toggleList.call(this)},getData:function(){var m=this.op,l=this;if(!m.type||!/\S+/.test(m.input.value)){return this.hide()}a.getCacheJS(m.url+"?jsoncallback=?",{q:m.input.value,type:m.type},function(n){if(!n||n.length==0){return l.hide()}l.show(n)})},hide:function(){if(this.tipbox){this.tipbox.innerHTML="";this.tipbox.style.display="none"}this.loaded=false;this.lastn=null;clearTimeout(this.timer);return false}};return function(m){var l=a.clone(e,function(){this.lastn=null;this.op=m});$(m.input).keyup(function(n){j._control.call(l,n)});$(m.input).blur(function(){m.timer=setTimeout(function(){l.hide()},200)});return l}})();$.cookie=a.cookie;$.fn.eventProxy=function(j,l,e){return this.each(function(){a.eventProxy(this,j,l,e)})};jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(j,l,e,n,m){return jQuery.easing[jQuery.easing.def](j,l,e,n,m)},easeInQuad:function(j,l,e,n,m){return n*(l/=m)*l+e},easeOutQuad:function(j,l,e,n,m){return -n*(l/=m)*(l-2)+e},easeInOutQuad:function(j,l,e,n,m){if((l/=m/2)<1){return n/2*l*l+e}return -n/2*((--l)*(l-2)-1)+e},easeInBack:function(j,l,e,o,n,m){if(m==undefined){m=1.70158}return o*(l/=n)*l*((m+1)*l-m)+e},easeOutBack:function(j,l,e,o,n,m){if(m==undefined){m=1.70158}return o*((l=l/n-1)*l*((m+1)*l+m)+1)+e},easeOutBounce:function(j,l,e,n,m){if((l/=m)<(1/2.75)){return n*(7.5625*l*l)+e}else{if(l<(2/2.75)){return n*(7.5625*(l-=(1.5/2.75))*l+0.75)+e}else{if(l<(2.5/2.75)){return n*(7.5625*(l-=(2.25/2.75))*l+0.9375)+e}else{return n*(7.5625*(l-=(2.625/2.75))*l+0.984375)+e}}}}});$.fn.loadImgSrc=function(e){var e=e||"alt";this.each(function(){var j=$(this).attr(e);if(j){$(this).attr("src",j).removeAttr("alt")}});return this};$.fn.diyselect=function(e){this.each(function(r){var p=$(this),q=p.find(".diyselect_current")[0],m=p.find("input"),l=p.find("ul")[0];m[0].onclick=null;$(m[0]).click(function(){if(l.style.display!="block"){$(l).fadeIn(200);$(document.body).bind("click",j)}else{n()}});function j(u){var t=u.target,o=t.parentNode;if(!o.parentNode.parentNode){n();return false}if(o.parentNode.parentNode==p[0]){m[0].value=t.innerHTML;if(m[1]){try{m[1].value=a.parseUrlHash(t)[0]}catch(s){}}n();q.className="";o.className="diyselect_current";q=o;if(typeof e=="function"){return e.call(p[0],t)||false}}else{if(o.className!="diyselect"){n()}}return false}function n(){l.style.display="none";$(document.body).unbind("click",j)}});return this}})();if(!window.juidStr){globalVarConfig()}TUI.domain.join({main:"www.tudou.com",css:"css.tudouui.com",js:"js.tudouui.com",login:"login.tudou.com",dig:"dig.tudou.com",message:"message.tudou.com",hint:"hint.tudou.com/hint",hd:"hd.tudou.com",search:"so.tudou.com"});$(function(){initLogined();tudouPvStat();tudouClickStat.clear();initQuick();TUI.getCacheJS("http://www.tudou.com/util/tools/total_programs.txt",false,false,"script");if(uid){$.getJSON(message_domain+"/messages/util/uusmc.php?user_id="+uid+"&jsoncallback=?",function(b){if(typeof b.n=="number"){$("#msg_num").html(b.n+"条新短信")}})}$(".gs .diyselect").diyselect(function(c){var f=$(this.parentNode),e=f.find(".gs_text"),b=$(f).find("input[type=hidden]");var d=function(){b.each(function(){this.disabled=this.disabled?false:true})};if(/baidu\.com/.test(c.href)){if(f.attr("searchtype")!="web"){e.attr("name","word").addClass("webse_bg");d()}f.attr("searchtype","web")}else{if(f.attr("searchtype")=="web"){e.attr("name","kw").removeClass("webse_bg");d()}f.attr("searchtype","")}f.attr("action",c.href)});try{$(".tui_searchint").each(function(){var b={input:this,url:hint_domain,type:"programs"};$(this).click(function(){var c=$(this.parentNode).attr("action").match(/\w(?=search\.do$)/g)||[0];b.type=((c[0]=="i")&&"programs")||((c[0]=="p")&&"playlist")||null});TUI.searchHint(b)})}catch(a){TUI.debug("searchHint: "+a)}$(".g_drop_box").each(function(){var b=$(this).find(".gd_i")[0];var c=b.offsetHeight;TUI.dropbox({target:this,drop:$(this).find(".gd")[0],show:function(d){b.style.height=0;this.style.visibility="visible";$(b).animate({height:c},500,"easeOutBounce");$(d).addClass("hover")},hide:function(d){$(this).fadeOut(200,function(){this.style.visibility="hidden";this.style.display="block"});$(d).removeClass("hover")}})})});function juid(){return((new Date().getTime()*10000+Math.random(1)*10000).toString(32)+(new Date().getTime()*10000+Math.random(1)*10000).toString(32)).substr(0,11)}function isLogined(){if($.cookie("u_user")&&$.cookie("u_id")){if($.cookie("u_login")){return true}else{if($.cookie("u_passport_info")){$(function(){TUI.addElm('<iframe id="autoLoginReq" src="'+login_domain+'/login.do?act=ajaxAutoLogin" style="visibility:hidden;" width="0" height="0" frameborder="0"></iframe>',function(){document.body.appendChild(this)})});return true}}}return false}function initLogined(){if(uid&&!document.getElementById("msg_num")){showLoginStatus()}}function globalVarConfig(){try{window.juidStr=juid();if(!$.cookie("juid")){$.cookie("juid",window.juidStr,{expires:365*100,domain:"tudou.com",path:"/"})}else{window.juidStr=$.cookie("juid")}window.uid=isLogined()?($.cookie("u_id")||0):0;window._usr=$.cookie("u_user");window._nic=$.cookie("u_nick")||window._usr;window.isGuest=!!uid;if(!window.initTimestamp){window.initTimestamp=(new Date()).getTime()}}catch(a){TUI.debug("globalVarConfig: "+a)}}function showLoginStatus(){try{var a=TUI.renderTpl(['<strong>你好，<a href="<%=main_domain%>/home/<%=usr%>" target="_blank"><%=nic%></a></strong>','<span><a href="<%=login_domain%>/loginOut.do?r=<%=random%>">退出</a></span>','<span class="msg_num"><a href="<%=message_domain%>/messages/list.php" target="_blank" id="msg_num">短信箱</a></span>'].join(""),{main_domain:main_domain,usr:_usr,nic:_nic,login_domain:login_domain,random:Math.random(),message_domain:message_domain});$("#uInfo").html(a)}catch(b){TUI.debug("showLoginStatus: "+b)}}function needLogin(a){TUI.confirm("只有注册用户才能使用这个小功能喔，你想要现在就去注册或者登录么？",function(){if(a){setTimeout(function(){location=login_domain+"/login.do?service="+encodeURIComponent(a)},100)}else{setTimeout(function(){location=login_domain+"/login.do"},100)}});return false}function tudouPvStat(){try{TUI.getCacheJS("http://iwstat.tudou.com/dma.js?491e5fd092db6",false,false,"script");if(!window.rsCi){TUI.getRequest("//secure-cn.imrworldwide.com/cgi-bin/m",{rnd:(new Date()).getTime(),ci:"cn-video2009tudou",cg:"site",cc:1,si:escape(location),rp:escape(document.referrer)})}if(!juidStr){return false}var c=$.cookie("pageStep");var b=c?Math.max(1,c):1;var d=(new Date()).getTime();var a=[1,juidStr,encodeURIComponent(location.href),encodeURIComponent(document.referrer),b,d,(uid||0),(initTimestamp?(d-initTimestamp):0)];window.pageUUID="";$.cookie("pageStep",(b+1).toString(),{path:"/",domain:"tudou.com"});$.getScript("http://stat.tudou.com/newstat/pv?s="+a.join("~_~"),function(){$.cookie("pageUUID",window.pageUUID+"~_~"+((new Date()).getTime()-d),{path:"/",domain:"tudou.com"});window.pageUUID=""});var g=$.cookie("pageUUID");if(g){$.getScript("http://stat.tudou.com/newstat/pv?s=2~_~"+g);$.cookie("pageUUID","",{expires:-1,path:"/",domain:"tudou.com"})}}catch(f){TUI.debug("tudouPvStat: "+f)}}var tudouClickStat={pvid:juid(),special:"",getCode:function(e){var f=e.split("-"),c=[];for(var d=0,b=f.length;d<b;d++){c.push(String.fromCharCode(parseInt(f[d])+64))}return c.join("")},record:function(a){$.cookie("clickstat",this.pvid+(a?("|"+a+this.special):""),{expires:365,path:"/",domain:"tudou.com"})},clear:function(){if($.cookie("clickstat")){$.cookie("clickstat","",{expires:-1,path:"/",domain:"tudou.com"})}},bind:function(a){var c=this,b={};if(a){this.special="|"+a}c.record();b.a=b.img=b.input=true;$(document.body).bind("click",function(g){var d,f=g.target.nodeName.toLowerCase();if(b[f]){d=$(g.target).attr("coords")||"0";c.record(d)}})}};function showSCount(b){try{$(".gs_text").each(function(){var c=b+"个视频";var d=this;$(this.parentNode).submit(function(){if(d.value==c){return false}return keySearch(this)});$(this).blur(function(){if($(this).val().match(/\S/)==null){$(this).val(c);$(this).addClass("gs_c")}});$(this).focus(function(){if($(this).val()==c){$(this).val("")}$(this).removeClass("gs_c")});$(function(){if(!d._gs_focus&&(!d.value||d.value==c)){$(d).val(c);$(d).addClass("gs_c")}})})}catch(a){TUI.debug("showSCount: "+a)}}function keySearch(d,h){try{if($(d).attr("searchtype")=="web"){return true}var c="",i=[],a=$(d).find("input");a.each(function(j){var f=$(this).attr("disabled");if(f||f=="disabled"){return true}var e=$(this).attr("name");if(e=="kw"){c=encodeURIComponent(this.value.replace(/[\/\\#%]/g," "))}else{if(e){i.push(e);i.push(this.value)}}});var b=$(d).attr("action").replace(/(\/\wsearch).*$/,"$1/"+(c?(c+"/"):"")+i.join("_"));if($(d).attr("target")){open(b)}else{location=b}return false}catch(g){TUI.debug("keySearch: "+g)}}function toggleQuick(c,e){if(!/^[\w-]{11}$/.test(c)){return false}var d=$.cookie("quickListClips");var a=$("#quickNum");var g=a.html()|0;if(d==null){$.cookie("quickListClips",c+",",{domain:"tudou.com",path:"/"});a.html(g+1)}else{var b=d.indexOf(c);if(b>=0){if(e!=null){$.cookie("quickListClips",d.replace(c+",",""),{domain:"tudou.com",path:"/"});a.html(g-1);if($(".saveListAs").attr("rel")==1){e.parent().parent().parent().remove()}}else{setTimeout(f,100);return false}}else{if(g>=40){TUI.panel("你只能在便利豆单中暂存40个节目，你可以删除一些，然后再继续添加。\n想去便利豆单删除一些节目吗？","土豆提示",{value:"确认",handler:function(){setTimeout(function(){location.href=main_domain+"/playlist/played/history.do?method=getqui"},100)}},{value:"取消",handler:function(){}});return false}else{$.cookie("quickListClips",d+c+",",{domain:"tudou.com",path:"/"});a.html(g+1)}}}return true;function f(){location=main_domain+"/playlist/quick.do?code="+c}}function initQuick(c){try{var d=c?$(c).find(".pack_clipImg"):$(".pack_clipImg");var b=$.cookie("quickListClips")||"";var f=b?(b.split(",").length-1):0;$("#quickNum").html(f.toString());d.each(function(){var h=this.parentNode.parentNode,e=$(h).find("a"),j=TUI.addElm('<div class="quick"><a href="#" title="添加到便利豆单"></a></div>'),g=$(e).attr("href").match(/\/view\/([\w-]{11})/i);if(!g){return false}if(e.length>1){return true}g=g[1];h.insertBefore(j,e[0]);var i=$(j).find("a");$(h).hover(function(){$(this).addClass("quickAhover")},function(){$(this).removeClass("quickAhover")});if(b.indexOf(g)>=0){i.attr("title","播放便利豆单").parent().toggleClass("quickAdded")}i.click(function(){if(toggleQuick(g,null)){$(this).attr("title","播放便利豆单").parent().toggleClass("quickAdded")}return false})})}catch(a){TUI.debug("initQuick: "+a)}}function redirectSignIn(){return needLogin()};

