You are on page 1of 5

(function(){var g=true,l=null,n=false,o=this,p=function(a,b,c){a=a.split(".

");c=c||
o;!(a[0]in c)&&c.execScript&&c.execScript("var "+a[0]);for(var
d;a.length&&(d=a.shift());)if(!a.length&&b!==undefined)c[d]=b;else c=c[d]?
c[d]:c[d]={}},aa=function(a){var b=typeof a;if(b=="object")if(a){if(a instanceof
Array||!(a instanceof Object)&&Object.prototype.toString.call(a)=="[object
Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof
a.propertyIsEnumerable!="undefined"&&!
a.propertyIsEnumerable("splice"))return"array";
if(!(a instanceof Object)&&(Object.prototype.toString.call(a)=="[object
Function]"||typeof a.call!="undefined"&&typeof a.propertyIsEnumerable!
="undefined"&&!a.propertyIsEnumerable("call")))return"function"}else
return"null";else if(b=="function"&&typeof
a.call=="undefined")return"object";return b},r=function(a){return typeof
a=="string"};Math.floor(Math.random()*2147483648).toString(36);
var s=function(a,b){var c=b||o;if(arguments.length>2){var
d=Array.prototype.slice.call(arguments,2);return function(){var
e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return
a.apply(c,e)}}else return function(){return a.apply(c,arguments)}},ba=function(a)
{var b=Array.prototype.slice.call(arguments,1);return function(){var
c=Array.prototype.slice.call(arguments);c.unshift.apply(c,b);return
a.apply(this,c)}},ca=Date.now||function(){return+new Date},da=function(a,b)
{function c(){}
c.prototype=b.prototype;a.P=b.prototype;a.prototype=new c};var t=function(a)
{this.stack=Error().stack||"";if(a)this.message=String(a)};da(t,Error);var
ea=function(a){for(var b=1;b<arguments.length;b++){var
c=String(arguments[b]).replace(/\$/g,"$$$$");a=a.replace(/\%s/,c)}return
a},fa=/^[a-zA-Z0-9\-_.!~*'()]*$/,ga=function(a){a=String(a);if(!fa.test(a))return
encodeURIComponent(a);return a},u=function(a,b){if(a<b)return-1;else if(a>b)return
1;return 0};var ha=function(a,b)
{b.unshift(a);t.call(this,ea.apply(l,b));b.shift();this.O=a};da(ha,t);var
v=function(a,b){if(!a){var c=Array.prototype.slice.call(arguments,2),d="Assertion
failed";if(b){d+=": "+b;var e=c}throw new ha(""+d,e||[]);}return a};var
w=Array.prototype,x=w.indexOf?function(a,b,c){v(a.length!=l);return
w.indexOf.call(a,b,c)}:function(a,b,c){c=c==l?0:c<0?
Math.max(0,a.length+c):c;if(r(a)){if(!r(b)||b.length!=1)return-1;return
a.indexOf(b,c)}for(c=c;c<a.length;c++)if(c in a&&a[c]===b)return c;return-
1},y=w.forEach?function(a,b,c){v(a.length!
=l);w.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=r(a)?
a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},ia=function(a,b,c){for(var
d=r(a)?a.split(""):a,e=a.length-1;e>=0;--e)e in
d&&b.call(c,d[e],e,a)},ja=function(a){v(a.length!=l);return
w.splice.apply(a,z(arguments,1))},z=function(a,b,c){v(a.length!=l);return
arguments.length<=2?w.slice.call(a,b):w.slice.call(a,b,c)};var ka=function(a,b)
{this.x=a!==undefined?a:0;this.y=b!==undefined?
b:0};ka.prototype.toString=function(){return"("+this.x+", "+this.y+")"};var
B=function(a,b){this.width=a;this.height=b};B.prototype.toString=function()
{return"("+this.width+" x "+this.height+")"};B.prototype.isEmpty=function(){return!
(this.width*this.height)};B.prototype.floor=function()
{this.width=Math.floor(this.width);this.height=Math.floor(this.height);return
this};B.prototype.round=function()
{this.width=Math.round(this.width);this.height=Math.round(this.height);return
this};var C,D,F,G,H,la=function(){return o.navigator?
o.navigator.userAgent:l};H=G=F=D=C=n;var I;if(I=la()){var
ma=o.navigator;C=I.indexOf("Opera")==0;D=!C&&I.indexOf("MSIE")!=-1;G=(F=!
C&&I.indexOf("WebKit")!=-1)&&I.indexOf("Mobile")!=-1;H=!C&&!
F&&ma.product=="Gecko"}var J=C,K=D,na=H,L=F,oa=G,M;
a:{var N="",O;if(J&&o.opera){var P=o.opera.version;N=typeof P=="function"?
P():P}else{if(na)O=/rv\:([^\);]+)(\)|;)/;else if(K)O=/MSIE\s+([^\);]+)(\)|;)/;else
if(L)O=/WebKit\/(\S+)/;if(O){var pa=O.exec(la());N=pa?pa[1]:""}}if(K){var
Q,qa=o.document;Q=qa?qa.documentMode:undefined;if(Q>parseFloat(N))
{M=String(Q);break a}}M=N}
var ra=M,sa={},R=function(a){var b;if(!(b=sa[a])){b=0;for(var
c=String(ra).replace(/^[\s\xa0]+|[\s\xa0]+
$/g,"").split("."),d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+
$/g,"").split("."),e=Math.max(c.length,d.length),f=0;b==0&&f<e;f++){var
h=c[f]||"",i=d[f]||"",j=RegExp("(\\d*)(\\D*)","g"),m=RegExp("(\\d*)
(\\D*)","g");do{var k=j.exec(h)||["","",""],q=m.exec(i)||
["","",""];if(k[0].length==0&&q[0].length==0)break;b=u(k[1].length==0?
0:parseInt(k[1],10),q[1].length==0?0:parseInt(q[1],10))||u(k[2].length==
0,q[2].length==0)||u(k[2],q[2])}while(b==0)}b=sa[a]=b>=0}return b};!K||
R("9");K&&R("9");var S=function(a){return(a=a.className)&&typeof
a.split=="function"?a.split(/\s+/):[]},ta=function(a){var
b=S(a),c;c=z(arguments,1);for(var d=0,e=0;e<c.length;e++)if(!(x(b,c[e])>=0))
{b.push(c[e]);d++}c=d==c.length;a.className=b.join(" ");return c},ua=function(a)
{var b=S(a),c;c=z(arguments,1);for(var d=0,e=0;e<b.length;e++)if(x(c,b[e])>=0)
{ja(b,e--,1);d++}c=d==c.length;a.className=b.join(" ");return c};var T=function(a)
{return r(a)?document.getElementById(a):a},va=function(a,b,c,d){a=d||a;b=b&&b!="*"?
b.toUpperCase():"";if(a.querySelectorAll&&a.querySelector&&(!L||
document.compatMode=="CSS1Compat"||R("528"))&&(b||c))return a.querySelectorAll(b+
(c?"."+c:""));if(c&&a.getElementsByClassName){a=a.getElementsByClassName(c);if(b)
{d={};for(var e=0,f=0,h;h=a[f];f++)if(b==h.nodeName)d[e++]=h;d.length=e;return
d}else return a}a=a.getElementsByTagName(b||"*");if(c){d={};for(f=e=0;h=a[f];f++)
{b=h.className;
if(typeof b.split=="function"&&x(b.split(/\s+/),c)>=0)d[e++]=h}d.length=e;return
d}else return a},xa=function(a){var b=a.document;if(L&&!R("500")&&!oa){if(typeof
a.innerHeight=="undefined")a=window;b=a.innerHeight;var
c=a.document.documentElement.scrollHeight;if(a==a.top)if(c<b)b-=15;return new
B(a.innerWidth,b)}a=b.compatMode=="CSS1Compat";if(J&&!R("9.50"))a=n;a=a?
b.documentElement:b.body;return new B(a.clientWidth,a.clientHeight)},ya=function(a)
{a=!L&&a.compatMode=="CSS1Compat"?a.documentElement:
a.body;return new ka(a.scrollLeft,a.scrollTop)},za=function(a,b,c,d){if(!
c)a=a.parentNode;c=d==l;for(var e=0;a&&(c||e<=d);){if(b(a))return
a;a=a.parentNode;e++}return l};var U=function()
{this.o=[]};U.prototype.e=0;U.prototype.k=0;var Aa=function(a){if(a.e!=a.k){var
b=a.o[a.e];delete a.o[a.e];a.e++;return b}};U.prototype.isEmpty=function(){return
this.k-this.e==0};var Ca=function(a,b,c){if(r(b))Ba(a,c,b);else{a=ba(Ba,a);for(var
d in b)a.call(void 0,b[d],d,b)}},Ba=function(a,b,c)
{a.style[Da(c)]=b},Ea={},Da=function(a){return Ea[a]||(Ea[a]=String(a).replace(/\-
([a-z])/g,function(b,c){return c.toUpperCase()}))};var Fa=function(a){a=a||
window.event;var b=a.relatedTarget;if(!
b)if(a.type=="mouseover")b=a.fromElement;else
if(a.type=="mouseout")b=a.toElement;return b};var Ga=function(){return
V&&V()},V=l;if(typeof XMLHttpRequest!="undefined")V=function(){return new
XMLHttpRequest};else if(typeof ActiveXObject!="undefined")V=function(){return new
ActiveXObject("Microsoft.XMLHTTP")};var Ha=function(a,b,c,d,e){var f=new
Ga;if("open"in f){f.onreadystatechange=function(){(f&&"readyState"in f?
f.readyState:0)==4&&b&&b(f)};c=c||"GET";d=d||"";f.open(c,a,g);c=="POST"&&f.setReque
stHeader("Content-Type","application/x-www-form-urlencoded");if(e)for(var h in
e)f.setRequestHeader(h,e[h]);f.send(d)}},Ia=function(a)
{window.console&&window.console.warn&&window.console.warn(a)},Ka=function(a,b){var
c=b.onComplete||l,d=b.onException||l,e=b.onError||l,f=b.update||l,h=b.json||
n;Ha(a,function(i){var j;
a:switch(i&&"status"in i?i.status:-1){case 0:case 200:case 204:case 304:j=g;break
a;default:j=n}if(j){var m=i.responseXML;j=m?Ja(m):l;m=!!(m&&j);var k,q;if(m)
{k=W(j,"return_code");q=W(j,"html_content");if(k==0){if(f&&q)T(f).innerHTML=q;var
A=W(j,"css_content"),wa=W(j,"js_content");if(A){var
E=document.createElement("style");E.setAttribute("type","text/css");if(E.styleSheet
)E.styleSheet.cssText=A;else
E.appendChild(document.createTextNode(A));document.getElementsByTagName("head")
[0].appendChild(E)}if(wa){A=
document.createElement("script");A.text=wa;document.getElementsByTagName("head")
[0].appendChild(A)}}}if(c)if(m)
{m=W(j,"redirect_on_success");if(k&&m)window.location=m;else{(j=W(j,k==0?"success_m
essage":"error_message"))&&alert(j);i=h?eval("("+q+")"):i;if(k==0)c(i);else
if(d)d(i);else j||Ia("Non-zero ("+k+") return code from AJAX request: "+a)}}else
i.responseText?c(i):Ia("No xmlResponse or xhr.responseText from AJAX request:
"+a)}else e&&e(i)},b.method||"POST",b.postBody||l,b.headers||l)},Ja=function(a)
{if(!a)return l;
return(a=("responseXML"in a?
a.responseXML:a).getElementsByTagName("root"))&&a.length>0?a[0]:l},W=function(a,b)
{if(!a)return l;var c=a.getElementsByTagName(b);return
c&&c.length>0&&c[0].firstChild?
c[0].firstChild.nodeValue:l};p("yt.net.ajax.setToken",function(){},void 0);var
La=function(a,b){if((a=T(a))&&a.style){a.style.display=b?"":"none";var c=a;!b?
ta(c,"hid"):ua(c,"hid")}},Ma=function(){y(arguments,function(a)
{La(a,g)})},Na=function(){y(arguments,function(a){La(a,n)})};RegExp("^(?:([^:/?#.]
+):)?(?://(?:([^/?#]*)@)?([\\w\\d\\-\\u0100-\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?
(?:\\?([^#]*))?(?:#(.*))?$");
var Oa=function(a){if(a[1]){var b=a[0],c=b.indexOf("#");if(c>=0)
{a.push(b.substr(c));a[0]=b=b.substr(0,c)}c=b.indexOf("?");if(c<0)a[1]="?";else
if(c==b.length-1)a[1]=undefined}return a.join("")},Pa=function(a,b){for(var c in b)
{var d=c,e=b[c],f=a;if(aa(e)=="array")for(var h=0;h<e.length;h++)
{f.push("&",d);e[h]!==""&&f.push("=",ga(e[h]))}else if(e!=l){f.push("&",d);e!
==""&&f.push("=",ga(e))}}return a};p("yt.config_",window.yt&&window.yt.config_||
{},void 0);p("yt.globals_",window.yt&&window.yt.globals_||{},void 0);var
Qa=window.yt&&window.yt.msgs_||{};p("yt.msgs_",Qa,void 0);var
Ra=window.yt&&window.yt.timeouts_||[];p("yt.timeouts_",Ra,void 0);var
Sa=window.yt&&window.yt.intervals_||[];p("yt.intervals_",Sa,void 0);var
X=function(a,b){var c=window.setTimeout(a,b);Ra.push(c);return
c},Ta=function(a,b,c){b=b||{};if(a=a in Qa?Qa[a]:c)for(var d in
b)a=a.replace(RegExp("\\$"+d,"gi"),b[d]);return a};eval("/*@cc_on!@*/false");/*
Portions of this code are from the MooTools project, received by
YouTube under the MIT License. All other code is Copyright 2009 YouTube LLC.
All Rights Reserved.

Prototype JavaScript framework, version 1.4


(c) 2005 Sam Stephenson <sam@conio.net>
Prototype is freely distributable under the terms of an MIT-style license.
For details, see the Prototype web site: http://prototype.conio.net/

(c) 2006 Valerio Proietti (http://mad4milk.net). MIT-style license.

Author: Robert Penner, <http://www.robertpenner.com/easing/>, modified to be used


with mootools.
License: Easing Equations v1.5, (c) 2003 Robert Penner, all rights reserved. Open
Source BSD License.

*/
var Ua=function(){return function(){this.z.apply(this,arguments)}},Va=function(a,b)
{for(var c in b)a[c]=b[c];return a},Wa=function(a,b){return function(){return
a.apply(b,arguments)}},Xa=function(){};
Xa.prototype={setOptions:function(a){this.options=Va({onStart:function()
{},onComplete:function(){},transition:function(b,c,d,e){return
d*(b/=e)*b+c},transitionOut:function(b,c,d,e){return-d*(b/=e)*(b-
2)+c},duration:333,unit:"px",wait:g,dontUseVisibility:n,fps:50},a||
{})},N:function(){var a=(new Date).getTime();if(a<this.t+this.options.duration)
{this.v=a-
this.t;this.M()}else{X(Wa(this.options.onComplete,this,this.element),10);this.m();t
his.now=this.C}this.q()},M:function(){this.now=this.F(this.I,this.C)},
F:function(a,b){var c=b-a;return c<0?
this.options.transition(this.v,a,c,this.options.duration):this.options.transitionOu
t(this.v,a,c,this.options.duration)},m:function()
{window.clearInterval(this.u);this.u=l;return this},D:function(a,b)
{this.options.wait||this.m();if(!this.u)
{X(Wa(this.options.onStart,this,this.element),10);this.I=a;this.C=b;this.t=(new
Date).getTime();var
c=window.setInterval(Wa(this.N,this),Math.round(1E3/this.options.fps));Sa.push(c);t
his.u=c;return this}},i:function(a,b){return this.D(a,
b)},set:function(a){this.now=a;this.q();return this},show:function(){return
this.set(1)},K:function(){return this.set(0)},B:function(a,b,c){if(b=="opacity")
{if(!this.options.dontUseVisibility)if(c==0)a.style.visibility="hidden";else
if(a.style.visibility!
="visible")a.style.visibility="visible";if(window.ActiveXObject)a.style.filter="alp
ha(opacity="+c*100+")";a.style.opacity=c}else a.style[b]=c+this.options.unit}};var
Ya=Ua();
Ya.prototype=Va(new Xa,{z:function(a,b,c)
{this.element=T(a);this.setOptions(c);this.G=b},q:function()
{this.B(this.element,this.G,this.now)}});Ua().prototype=Va(new Xa,{z:function(a,b)
{this.element=T(a);this.setOptions(b);this.now=1},Q:function(){return this.now>0?
this.i(1,0):this.i(0,1)},K:function(){return this.set(0)},q:function()
{this.B(this.element,"opacity",this.now)}});var Y=function(a,b,c,d,e,f,h,i)
{this.H=a;this.r=b;this.g=this.w=c;this.c=d;this.f=T(e);this.p=T(f);this.n=T(h);thi
s.L=T(i);this.b=new
U;this.s=this.A=0;this.d=n;this.j=va(document,"li","comment",this.f);this.c&&Ma(thi
s.n)},Za=function(a,b){var c=b.responseXML,d=c?Ja(c):l;if(!(c&&d))return
n;c=W(d,"latest_time");var
e=W(d,"comments");d=W(d,"poll_delay");a.g=parseInt(d,10);if(!
a.c&&a.g<a.w)a.g=a.w;if(c==undefined||e==undefined)return
n;d=document.createElement("div");d.innerHTML=e;e=va(document,"li",
"comment",d);a.A=e.length;ia(e,function(f){if(!(x(S(f),"author-viewing")>=0)){var
h=this.b;f=f.cloneNode(g);h.o[h.k++]=f}},a);a.r=Math.max(a.r,c);if(!
a.b.isEmpty()&&!a.c){a.L.innerHTML=Ta("LC_COUNT_NEW_COMMENTS",{count:a.b.k-
a.b.e});Ma(a.p)}return g};Y.prototype.start=function(){Z(this);this.h()};var
Z=function(a){a.g>0&&a.s<200&&X(s(a.J,a),a.g)};
Y.prototype.J=function(){var a=ya(document);xa(window);var b=T("movie_player");a=a?
a.y:"";var c=b?b.getPlayerState():"",d=b?b.getDuration():"";b=b?
b.getCurrentTime():"";b=Oa(Pa(["/live_comments"],
{action_get_comments:1,video_id:this.H,lt:this.r,format:"html",nnc:this.A,pd:this.g
,rc:this.s,dst:a,lch:this.f.offsetHeight,ps:c,pvd:d,pct:b,scr:this.c}));Ka(b,
{method:"GET",json:n,onComplete:s(function(e){if((e=Za(this,e))||!
this.d)Z(this);this.d=!e},this),onException:s(function(){this.d||Z(this);this.d=
g},this),onError:s(function(){this.d||Z(this);this.d=g},this)});++this.s};
Y.prototype.h=function(){if(this.c)if(this.b.isEmpty())
{this.a=l;X(s(this.h,this),5E3)}else{var a=[],b=0;for($a(this);!this.b.isEmpty();)
{var c=Aa(this.b);a.push(c);this.j.push(c)}c=3E3*a.length;this.l=a[a.length-
1];Ca(this.l,"marginTop",-1E4);y(a,function(d)
{d.style.display="none";this.f.insertBefore(d,this.f.firstChild);var e=J&&!
R("10"),f;b:{f=d.nodeType==9?d:d.ownerDocument||
d.document;if(f.defaultView&&f.defaultView.getComputedStyle)if(f=f.defaultView.getC
omputedStyle(d,"")){f=f.display;break b}f=
l}if((f||(d.currentStyle?d.currentStyle.display:l)||d.style.display)!="none")d=e?
new B(d.offsetWidth||d.clientWidth,d.offsetHeight||d.clientHeight):new
B(d.offsetWidth,d.offsetHeight);else{f=d.style;var
h=f.display,i=f.visibility,j=f.position;f.visibility="hidden";f.position="absolute"
;f.display="inline";if(e){e=d.offsetWidth||d.clientWidth;d=d.offsetHeight||
d.clientHeight}else{e=d.offsetWidth;d=d.offsetHeight}f.display=h;f.position=j;f.vis
ibility=i;d=new B(e,d)}b-=d.height},this);Ca(this.l,"marginTop",
b);this.a=new Ya(this.l,"marginTop",{duration:c,onStart:function(){y(a,function(d)
{d.style.display=""},this)},onComplete:s(function()
{this.h()},this),transitionOut:function(d,e,f,h){return f*(d/h)
+e}});this.a.i(b,0)}};
var bb=function(a,b,c){if(a.c){var d=T("comments-actions"),e=(c||
window.event).type;c=za(Fa(c),function(f){return f===b||f===d},g,6);if(!(!b||
c))if(e=="mouseover")ab(a);else
e=="mouseout"&&a.a&&a.a.i(a.a.now,0)}},ab=function(a){if(a.a){a.a.options.duration-
=ca()-a.a.t;a.a.m()}},$a=function(a){y(a.j,function(b){ta(b,"comment-hide-
timestamp")},a);a.j=[]};var
$=l;p("yt.www.watch.livecomments.init",function(a,b,c,d,e,f,h,i){if(T(e)){a=new
Y(a,b,c,d,e,f,h,i);a.start();$=a}},void
0);p("yt.www.watch.livecomments.handleCommentMouseEvent",function(a,b)
{$&&bb($,a,b)},void 0);p("yt.www.watch.livecomments.setScroll",function(a){if($)
{var b=$;if(a){b.c=g;Na(b.p);Ma(b.n);b.h()}else{b.c=n;Na(b.n);if(b.a)
{b.a.show();b.a=l}}}},void 0);
p("yt.www.watch.livecomments.showNewComments",function(){if($){var a=$;for($a(a);!
a.b.isEmpty();){var
b=Aa(a.b);a.f.insertBefore(b,a.f.firstChild);a.j.push(b)}Na(a.p)}},void 0);})();

You might also like