(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=fun
ction(a){var b=typeof a;if(b=="object")if(a){if(a instanceof Array||!(a instance
of Object)&&Object.prototype.toString.call(a)=="[object Array]"||typeof a.length
=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefi
ned"&&!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.p
ropertyIsEnumerable("call")))return"function"}else return"null";else if(b=="func
tion"&&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.slic
e.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(a
rguments,1);return function(){var c=Array.prototype.slice.call(arguments);c.unsh
ift.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){thi
s.stack=Error().stack||"";if(a)this.message=String(a)};da(t,Error);var ea=functi
on(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=funct
ion(a){a=String(a);if(!fa.test(a))return encodeURIComponent(a);return a},u=funct
ion(a,b){if(a<b)return-1;else if(a>b)return 1;return 0};var ha=function(a,b){b.u
nshift(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.prototyp
e,x=w.indexOf?function(a,b,c){v(a.length!=l);return w.indexOf.call(a,b,c)}:funct
ion(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)}:f
unction(a,b,c){for(var d=a.length,e=r(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.cal
l(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(a
rguments,1))},z=function(a,b,c){v(a.length!=l);return arguments.length<=2?w.slic
e.call(a,b):w.slice.call(a,b,c)};var ka=function(a,b){this.x=a!==undefined?a:0;t
his.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=func
tion(){return!(this.width*this.height)};B.prototype.floor=function(){this.width=
Math.floor(this.width);this.height=Math.floor(this.height);return this};B.protot
ype.round=function(){this.width=Math.round(this.width);this.height=Math.round(th
is.height);return this};var C,D,F,G,H,la=function(){return o.navigator?o.navigat
or.userAgent:l};H=G=F=D=C=n;var I;if(I=la()){var ma=o.navigator;C=I.indexOf("Ope
ra")==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.do
cument;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).repla
ce(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=String(a).replace(/^[\s\xa0]+|[\s\x
a0]+$/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{v
ar k=j.exec(h)||["","",""],q=m.exec(i)||["","",""];if(k[0].length==0&&q[0].lengt
h==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.sp
lit(/\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=func
tion(a,b,c,d){a=d||a;b=b&&b!="*"?b.toUpperCase():"";if(a.querySelectorAll&&a.que
rySelector&&(!L||document.compatMode=="CSS1Compat"||R("528"))&&(b||c))return a.q
uerySelectorAll(b+(c?"."+c:""));if(c&&a.getElementsByClassName){a=a.getElementsB
yClassName(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={};fo
r(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(typeo
f a.innerHeight=="undefined")a=window;b=a.innerHeight;var c=a.document.documentE
lement.scrollHeight;if(a==a.top)if(c<b)b-=15;return new B(a.innerWidth,b)}a=b.co
mpatMode=="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=="CSS1Com
pat"?a.documentElement:
a.body;return new ka(a.scrollLeft,a.scrollTop)},za=function(a,b,c,d){if(!c)a=a.p
arentNode;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=fun
ction(a){if(a.e!=a.k){var b=a.o[a.e];delete a.o[a.e];a.e++;return b}};U.prototyp
e.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||w
indow.event;var b=a.relatedTarget;if(!b)if(a.type=="mouseover")b=a.fromElement;e
lse 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 XMLHttpRequ
est};else if(typeof ActiveXObject!="undefined")V=function(){return new ActiveXOb
ject("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.setRequestHeader("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.con
sole.warn(a)},Ka=function(a,b){var c=b.onComplete||l,d=b.onException||l,e=b.onEr
ror||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;brea
k 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("st
yle");E.setAttribute("type","text/css");if(E.styleSheet)E.styleSheet.cssText=A;e
lse E.appendChild(document.createTextNode(A));document.getElementsByTagName("hea
d")[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.loca
tion=m;else{(j=W(j,k==0?"success_message":"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.res
ponseText 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.le
ngth>0?a[0]:l},W=function(a,b){if(!a)return l;var c=a.getElementsByTagName(b);re
turn 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.styl
e.display=b?"":"none";var c=a;!b?ta(c,"hid"):ua(c,"hid")}},Ma=function(){y(argum
ents,function(a){La(a,g)})},Na=function(){y(arguments,function(a){La(a,n)})};Reg
Exp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\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_",wind
ow.yt&&window.yt.globals_||{},void 0);var Qa=window.yt&&window.yt.msgs_||{};p("y
t.msgs_",Qa,void 0);var Ra=window.yt&&window.yt.timeouts_||[];p("yt.timeouts_",R
a,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=funct
ion(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 us
ed with mootools.
License: Easing Equations v1.5, (c) 2003 Robert Penner, all rights reserved. Op
en 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(){},onCom
plete:function(){},transition:function(b,c,d,e){return d*(b/=e)*b+c},transitionO
ut:function(b,c,d,e){return-d*(b/=e)*(b-2)+c},duration:333,unit:"px",wait:g,dont
UseVisibility:n,fps:50},a||{})},N:function(){var a=(new Date).getTime();if(a<thi
s.t+this.options.duration){this.v=a-this.t;this.M()}else{X(Wa(this.options.onCom
plete,this,this.element),10);this.m();this.now=this.C}this.q()},M:function(){thi
s.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.opt
ions.duration):this.options.transitionOut(this.v,a,c,this.options.duration)},m:f
unction(){window.clearInterval(this.u);this.u=l;return this},D:function(a,b){thi
s.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);this.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.st
yle.visibility!="visible")a.style.visibility="visible";if(window.ActiveXObject)a
.style.filter="alpha(opacity="+c*100+")";a.style.opacity=c}else a.style[b]=c+thi
s.options.unit}};var Ya=Ua();
Ya.prototype=Va(new Xa,{z:function(a,b,c){this.element=T(a);this.setOptions(c);t
his.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:funct
ion(){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);thi
s.n=T(h);this.L=T(i);this.b=new U;this.s=this.A=0;this.d=n;this.j=va(document,"l

i","comment",this.f);this.c&&Ma(this.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==und
efined)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)){va
r h=this.b;f=f.cloneNode(g);h.o[h.k++]=f}},a);a.r=Math.max(a.r,c);if(!a.b.isEmpt
y()&&!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.getCurrentT
ime():"";b=Oa(Pa(["/live_comments"],{action_get_comments:1,video_id:this.H,lt:th
is.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(){t
his.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.pus
h(c);this.j.push(c)}c=3E3*a.length;this.l=a[a.length-1];Ca(this.l,"marginTop",-1
E4);y(a,function(d){d.style.display="none";this.f.insertBefore(d,this.f.firstChi
ld);var e=J&&!R("10"),f;b:{f=d.nodeType==9?d:d.ownerDocument||d.document;if(f.de
faultView&&f.defaultView.getComputedStyle)if(f=f.defaultView.getComputedStyle(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.offs
etWidth,d.offsetHeight);else{f=d.style;var h=f.display,i=f.visibility,j=f.positi
on;f.visibility="hidden";f.position="absolute";f.display="inline";if(e){e=d.offs
etWidth||d.clientWidth;d=d.offsetHeight||d.clientHeight}else{e=d.offsetWidth;d=d
.offsetHeight}f.display=h;f.position=j;f.visibility=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),transition
Out: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).t
ype;c=za(Fa(c),function(f){return f===b||f===d},g,6);if(!(!b||c))if(e=="mouseove
r")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,"co
mment-hide-timestamp")},a);a.j=[]};var $=l;p("yt.www.watch.livecomments.init",fu
nction(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)}N
a(a.p)}},void 0);})();

Sign up to vote on this title
UsefulNot useful