(function(){var e={},c=new Date().getTime(),d,i,f=function(){if(window.addEventListener){return function(m,j,k,l){m.addEventListener(j,k,(!!l))}}else{if(window.attachEvent){return function(j,k,l){j.attachEvent("on"+k,l)}}else{return function(){}}}}(),h=function(){if(window.removeEventListener){return function(m,j,k,l){m.removeEventListener(j,k,!!l)}}else{if(window.detachEvent){return function(j,k,l){j.detachEvent("on"+k,l)}}else{return function(){}}}}(),a=function(){YUI.Env.windowLoaded=true;YUI.Env.DOMReady=true;h(window,"load",a)},b={"io.xdrReady":1,"io.xdrResponse":1},g=Array.prototype.slice;if(typeof YUI==="undefined"||!YUI){YUI=function(m,n,o,p,r){var q=this,j=arguments,k,l=j.length;if(!(q instanceof YUI)){return new YUI(m,n,o,p,r)}else{q._init();for(k=0;k<l;k++){q._config(j[k])}q._setup();return q}}}YUI.prototype={_config:function(n){n=n||{};var m=this.config,j,k,l,o;o=m.modules;for(j in n){if(o&&j=="modules"){l=n[j];for(k in l){if(l.hasOwnProperty(k)){o[k]=l[k]}}}else{if(j=="win"){m[j]=n[j].contentWindow||n[j];m.doc=m[j].document}else{m[j]=n[j]}}}},_init:function(){var k="3.0.0",j=this;if(k.indexOf("@")>-1){k="test"}j.version=k;j.Env={mods:{},cdn:"http://yui.yahooapis.com/"+k+"/build/",bootstrapped:false,_idx:0,_used:{},_attached:{},_yidx:0,_uidx:0,_loaded:{}};j.Env._loaded[k]={};if(YUI.Env){j.Env._yidx=(++YUI.Env._yidx);j.Env._guidp=("yui_"+k+"-"+j.Env._yidx+"-"+c).replace(/\./g,"_");j.id=j.stamp(j);e[j.id]=j}j.constructor=YUI;j.config={win:window||{},doc:document,debug:true,useBrowserConsole:true,throwFail:true,bootstrap:true,fetchCSS:true,base:function(){var l,o,m,n;o=document.getElementsByTagName("script");for(m=0;m<o.length;m=m+1){n=o[m].src.match(/^(.*)yui\/yui[\.\-].*js(\?.*)?$/);l=n&&n[1];if(l){break}}return l||j.Env.cdn}(),loaderPath:"loader/loader-min.js"}},_setup:function(j){this.use("yui-base")},applyTo:function(m,n,j){if(!(n in b)){this.log(n+": applyTo not allowed","warn","yui");return null}var k=e[m],o,l,p;if(k){o=n.split(".");l=k;for(p=0;p<o.length;p=p+1){l=l[o[p]];if(!l){this.log("applyTo not found: "+n,"warn","yui")}}return l.apply(k,j)}return null},add:function(k,m,l,j){YUI.Env.mods[k]={name:k,fn:m,version:l,details:j||{}};return this},_attach:function(s,o){var j=YUI.Env.mods,r=this.Env._attached,m,n=s.length,q,p,l,k,t;for(m=0;m<n;m=m+1){q=s[m];p=j[q];if(!r[q]&&p){r[q]=true;l=p.details;k=l.requires;t=l.use;if(k){this._attach(this.Array(k))}if(p.fn){p.fn(this)}if(t){this._attach(this.Array(t))}}}},use:function(){if(this._loading){this._useQueue=this._useQueue||new this.Queue();this._useQueue.add(g.call(arguments,0));return this}var x=this,n=g.call(arguments,0),j=YUI.Env.mods,y=x.Env._used,m,t=n[0],v=false,k=n[n.length-1],l=x.config.bootstrap,s,q,u,r=[],z=[],p=x.config.fetchCSS,o=function(D){if(y[D]){return}var C=j[D],E,B,A;if(C){y[D]=true;B=C.details.requires;A=C.details.use}else{if(!YUI.Env._loaded[x.version][D]){r.push(D)}else{y[D]=true}}if(B){if(x.Lang.isString(B)){o(B)}else{for(E=0;E<B.length;E=E+1){o(B[E])}}}z.push(D)},w;if(typeof k==="function"){n.pop()}else{k=null}w=function(A){A=A||{success:true,msg:"not dynamic"};if(k){k(x,A)}if(x.fire){x.fire("yui:load",x,A)}x._loading=false;if(x._useQueue&&x._useQueue.size()&&!x._loading){x.use.apply(x,x._useQueue.next())}};if(t==="*"){n=[];for(s in j){if(j.hasOwnProperty(s)){n.push(s)}}if(k){n.push(k)}return x.use.apply(x,n)}if(x.Loader){v=true;m=new x.Loader(x.config);m.require(n);m.ignoreRegistered=true;m.allowRollup=false;m.calculate(null,(p)?null:"js");n=m.sorted}u=n.length;for(q=0;q<u;q=q+1){o(n[q])}u=r.length;if(u){r=x.Object.keys(x.Array.hash(r))}if(l&&u&&x.Loader){x._loading=true;m=new x.Loader(x.config);m.onSuccess=w;m.onFailure=w;m.onTimeout=w;m.context=x;m.attaching=n;m.require((p)?r:n);m.insert(null,(p)?null:"js")}else{if(l&&u&&x.Get&&!x.Env.bootstrapped){x._loading=true;n=x.Array(arguments,0,true);x.Get.script(x.config.base+x.config.loaderPath,{onEnd:function(){x._loading=false;x.Env.bootstrapped=true;x._attach(["loader"]);x.use.apply(x,n)}});return x}else{if(u){}x._attach(z);w()}}return x},namespace:function(){var l=arguments,m=null,j,k,n;for(j=0;j<l.length;j=j+1){n=(""+l[j]).split(".");m=this;for(k=(n[0]=="YAHOO")?1:0;k<n.length;k=k+1){m[n[k]]=m[n[k]]||{};m=m[n[k]]}}return m},log:function(){},error:function(j,k){if(this.config.throwFail){throw (k||new Error(j))}else{this.message(j,"error")}return this},guid:function(k){var j=this.Env._guidp+(++this.Env._uidx);return(k)?(k+j):j},stamp:function(j,m){if(!j){return j}var l=(typeof j==="string")?j:j._yuid;if(!l){l=this.guid();if(!m){try{j._yuid=l}catch(k){l=null}}}return l}};d=YUI.prototype;for(i in d){YUI[i]=d[i]}YUI._init();f(window,"load",a);YUI.Env.add=f;YUI.Env.remove=h})();YUI.add("yui-base",function(b){function a(){this._init();this.add.apply(this,arguments)}a.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},add:function(){b.Array.each(b.Array(arguments,0,true),function(c){this._q.push(c)},this);return this},size:function(){return this._q.length}};b.Queue=a;(function(){b.Lang=b.Lang||{};var f=b.Lang,p="array",n="boolean",c="date",k="error",e="function",o="number",l="null",q="object",i="regexp",j="string",d=Object.prototype.toString,h="undefined",r={"undefined":h,number:o,"boolean":n,string:j,"[object Function]":e,"[object RegExp]":i,"[object Array]":p,"[object Date]":c,"[object Error]":k},m=/^\s+|\s+$/g,g="";f.isArray=function(s){return f.type(s)===p};f.isBoolean=function(s){return typeof s===n};f.isFunction=function(s){return f.type(s)===e};f.isDate=function(s){return f.type(s)===c};f.isNull=function(s){return s===null};f.isNumber=function(s){return typeof s===o&&isFinite(s)};f.isObject=function(t,s){return(t&&(typeof t===q||(!s&&f.isFunction(t))))||false};f.isString=function(s){return typeof s===j};f.isUndefined=function(s){return typeof s===h};f.trim=function(s){try{return s.replace(m,g)}catch(t){return s}};f.isValue=function(t){var s=f.type(t);switch(s){case o:return isFinite(t);case l:case h:return false;default:return !!(s)}};f.type=function(s){return r[typeof s]||r[d.call(s)]||(s?q:l)}})();(function(){var e=b.Lang,d=Array.prototype,c=function(m,h,f){var i=(f)?2:b.Array.test(m),j,k,l;if(i){try{return d.slice.call(m,h||0)}catch(g){l=[];for(j=0,k=m.length;j<k;j=j+1){l.push(m[j])}return l}}else{return[m]}};b.Array=c;c.test=function(f){var h=0;if(e.isObject(f)){if(e.isArray(f)){h=1}else{try{if("length" in f&&!("tagName" in f)&&!("alert" in f)&&(!b.Lang.isFunction(f.size)||f.size()>1)){h=2}}catch(g){}}}return h};c.each=(d.forEach)?function(h,g,f){d.forEach.call(h||[],g,f||b);return b}:function(i,g,f){var j=(i&&i.length)||0,h;for(h=0;h<j;h=h+1){g.call(f||b,i[h],h,i)}return b};c.hash=function(i,j){var f={},k=i.length,g=j&&j.length,h;for(h=0;h<k;h=h+1){f[i[h]]=(g&&g>h)?j[h]:true}return f};c.indexOf=(d.indexOf)?function(g,f){return d.indexOf.call(g,f)}:function(h,f){for(var g=0;g<h.length;g=g+1){if(h[g]===f){return g}}return -1};c.numericSort=function(f,g){return(f-g)};c.some=(d.some)?function(h,g,f){return d.some.call(h,g,f)}:function(i,g,f){var j=i.length,h;for(h=0;h<j;h=h+1){if(g.call(f,i[h],h,i)){return true}}return false}})();(function(){var d=b.Lang,e="__",c=function(f,g){var h=g.toString;if(d.isFunction(h)&&h!=Object.prototype.toString){f.toString=h}};b.merge=function(){var h=arguments,f={},g,i=h.length;for(g=0;g<i;g=g+1){b.mix(f,h[g],true)}return f};b.mix=function(o,f,m,g,i,h){if(!f||!o){return o||b}if(i){switch(i){case 1:return b.mix(o.prototype,f.prototype,m,g,0,h);case 2:b.mix(o.prototype,f.prototype,m,g,0,h);break;case 3:return b.mix(o,f.prototype,m,g,0,h);case 4:return b.mix(o.prototype,f,m,g,0,h);default:}}var j=h&&d.isArray(o),k,l,n;if(g&&g.length){for(k=0,l=g.length;k<l;++k){n=g[k];if(n in f){if(h&&d.isObject(o[n],true)){b.mix(o[n],f[n])}else{if(!j&&(m||!(n in o))){o[n]=f[n]}else{if(j){o.push(f[n])}}}}}}else{for(k in f){if(h&&d.isObject(o[k],true)){b.mix(o[k],f[k])}else{if(!j&&(m||!(k in o))){o[k]=f[k]}else{if(j){o.push(f[k])}}}}if(b.UA.ie){c(o,f)}}return o};b.cached=function(f,h,g){h=h||{};return function(i,j){var k=(j)?Array.prototype.join.call(arguments,e):i,l=h[k];if(!(k in h)||(g&&h[k]==g)){h[k]=f.apply(f,arguments)}return h[k]}}})();(function(){b.Object=function(f){var g=function(){};g.prototype=f;return new g()};var c=b.Object,d=undefined,e=function(f,g){var h=(g===2),j=(h)?0:[],i;for(i in f){if(h){j++}else{if(f.hasOwnProperty(i)){j.push((g)?f[i]:i)}}}return j};c.keys=function(f){return e(f)};c.values=function(f){return e(f,1)};c.size=function(f){return e(f,2)};c.hasKey=function(f,g){return(g in f)};c.hasValue=function(f,g){return(b.Array.indexOf(c.values(f),g)>-1)};c.owns=function(f,g){return(f.hasOwnProperty(g))};c.each=function(g,h,f,i){var j=f||b,k;for(k in g){if(i||g.hasOwnProperty(k)){h.call(j,g[k],k,g)}}return b};c.getValue=function(f,g){var h=b.Array(g),j=h.length,i;for(i=0;f!==d&&i<j;i=i+1){f=f[h[i]]}return f};c.setValue=function(f,h,g){var i=b.Array(h),j=i.length-1,l,k=f;if(j>=0){for(l=0;k!==d&&l<j;l=l+1){k=k[i[l]]}if(k!==d){k[i[l]]=g}else{return d}}return f}})();b.UA=function(){var f=function(k){var j=0;return parseFloat(k.replace(/\./g,function(){return(j++==1)?"":"."}))},c=navigator,d={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:c.cajaVersion,secure:false,os:null},g=c&&c.userAgent,e=b.config.win.location,h=e&&e.href,i;d.secure=h&&(h.toLowerCase().indexOf("https")===0);if(g){if((/windows|win32/i).test(g)){d.os="windows"}else{if((/macintosh/i).test(g)){d.os="macintosh"}}if((/KHTML/).test(g)){d.webkit=1}i=g.match(/AppleWebKit\/([^\s]*)/);if(i&&i[1]){d.webkit=f(i[1]);if(/ Mobile\//.test(g)){d.mobile="Apple"}else{i=g.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);if(i){d.mobile=i[0]}}i=g.match(/AdobeAIR\/([^\s]*)/);if(i){d.air=i[0]}}if(!d.webkit){i=g.match(/Opera[\s\/]([^\s]*)/);if(i&&i[1]){d.opera=f(i[1]);i=g.match(/Opera Mini[^;]*/);if(i){d.mobile=i[0]}}else{i=g.match(/MSIE\s([^;]*)/);if(i&&i[1]){d.ie=f(i[1])}else{i=g.match(/Gecko\/([^\s]*)/);if(i){d.gecko=1;i=g.match(/rv:([^\s\)]*)/);if(i&&i[1]){d.gecko=f(i[1])}}}}}}return d}();(function(){var f=["yui-base"],h,c=b.config,d=YUI.Env.mods,e,g;b.use.apply(b,f);if(c.core){h=c.core}else{h=[];e=["get","loader","yui-log","yui-later"];for(g=0;g<e.length;g++){if(d[e[g]]){h.push(e[g])}}}b.use.apply(b,h)})()},"3.0.0");YUI.add("get",function(a){(function(){var e=a.UA,f=a.Lang,c="text/javascript",b="text/css",d="stylesheet";a.Get=function(){var q={},s=0,i=false,g=function(y,D,x){var B=x||a.config.win,C=B.document,A=C.createElement(y),z;for(z in D){if(D[z]&&D.hasOwnProperty(z)){A.setAttribute(z,D[z])}}return A},j=function(z,y,A){var x={id:a.guid(),type:b,rel:d,href:z};if(A){a.mix(x,A)}return g("link",x,y)},k=function(z,y,A){var x={id:a.guid(),type:c,src:z};if(A){a.mix(x,A)}return g("script",x,y)},p=function(E){var z=q[E],y,G,B,D,A,F,x,C;if(z){y=z.nodes;G=y.length;B=z.win.document;D=B.getElementsByTagName("head")[0];if(z.insertBefore){A=r(z.insertBefore,E);if(A){D=A.parentNode}}for(F=0;F<G;F=F+1){x=y[F];if(x.clearAttributes){x.clearAttributes()}else{for(C in x){delete x[C]}}D.removeChild(x)}}z.nodes=[]},n=function(y,x,z){return{tId:y.tId,win:y.win,data:y.data,nodes:y.nodes,msg:x,statusText:z,purge:function(){p(this.tId)}}},o=function(x,y,B){var A=q[x],z;if(A&&A.onEnd){z=A.context||A;A.onEnd.call(z,n(A,y,B))}},h=function(x,y){var A=q[x],z;if(A.timer){clearTimeout(A.timer)}if(A.onFailure){z=A.context||A;A.onFailure.call(z,n(A,y))}o(x,y,"failure")},r=function(A,x){var z=q[x],y=(f.isString(A))?z.win.document.getElementById(A):A;if(!y){h(x,"target node not found: "+A)}return y},u=function(x){var A=q[x],y,z;if(A.timer){clearTimeout(A.timer)}A.finished=true;if(A.aborted){y="transaction "+x+" was aborted";h(x,y);return}if(A.onSuccess){z=A.context||A;A.onSuccess.call(z,n(A))}o(x,y,"OK")},m=function(x){var z=q[x],y;if(z.onTimeout){y=z.context||z;z.onTimeout.call(y,n(z))}o(x,"timeout","timeout")},v=function(x,E){var y=q[x],F,B,C,D,G,z,A;if(y.timer){clearTimeout(y.timer)}if(y.aborted){F="transaction "+x+" was aborted";h(x,F);return}if(E){y.url.shift();if(y.varName){y.varName.shift()}}else{y.url=(f.isString(y.url))?[y.url]:y.url;if(y.varName){y.varName=(f.isString(y.varName))?[y.varName]:y.varName}}B=y.win;C=B.document;D=C.getElementsByTagName("head")[0];if(y.url.length===0){u(x);return}z=y.url[0];if(!z){y.url.shift();return v(x)}if(y.timeout){y.timer=setTimeout(function(){m(x)},y.timeout)}if(y.type==="script"){G=k(z,B,y.attributes)}else{G=j(z,B,y.attributes)}t(y.type,G,x,z,B,y.url.length);y.nodes.push(G);if(y.insertBefore){A=r(y.insertBefore,x);if(A){A.parentNode.insertBefore(G,A)}}else{D.appendChild(G)}if((e.webkit||e.gecko)&&y.type==="css"){v(x,z)}},w=function(){if(i){return}i=true;var y,x;for(y in q){if(q.hasOwnProperty(y)){x=q[y];if(x.autopurge&&x.finished){p(x.tId);delete q[y]}}}i=false},l=function(A,C,z){z=z||{};var B="q"+(s++),y,x=z.purgethreshold||a.Get.PURGE_THRESH;if(s%x===0){w()}q[B]=a.merge(z,{tId:B,type:A,url:C,finished:false,nodes:[]});y=q[B];y.win=y.win||a.config.win;y.context=y.context||y;y.autopurge=("autopurge" in y)?y.autopurge:(A==="script")?true:false;if(z.charset){y.attributes=y.attributes||{};y.attributes.charset=z.charset}setTimeout(function(){v(B)},0);return{tId:B}},t=function(A,z,C,B,E,x,D){var y=D||v;if(e.ie){z.onreadystatechange=function(){var F=this.readyState;if("loaded"===F||"complete"===F){z.onreadystatechange=null;y(C,B)}}}else{if(e.webkit){if(A==="script"){z.addEventListener("load",function(){y(C,B)})}}else{z.onload=function(){y(C,B)};z.onerror=function(F){h(C,F+": "+B)}}}};return{PURGE_THRESH:20,_finalize:function(x){setTimeout(function(){u(x)},0)},abort:function(y){var x=(f.isString(y))?y:y.tId,z=q[x];if(z){z.aborted=true}},script:function(y,x){return l("script",y,x)},css:function(y,x){return l("css",y,x)}}}()})()},"3.0.0");YUI.add("yui-log",function(a){(function(){var d=a,b="yui:log",f="undefined",e={debug:1,info:1,warn:1,error:1},c;d.log=function(o,g,q,i){var p=d,h=p.config,m=false,j,l,n,k;if(h.debug){if(q){j=h.logExclude;l=h.logInclude;if(l&&!(q in l)){m=1}else{if(j&&(q in j)){m=1}}}if(!m){if(h.useBrowserConsole){n=(q)?q+": "+o:o;if(typeof console!=f&&console.log){k=(g&&console[g]&&(g in e))?g:"log";console[k](n)}else{if(typeof opera!=f){opera.postError(n)}}}if(p.fire&&!i){if(!c){p.publish(b,{broadcast:2,emitFacade:1});c=1}p.fire(b,{msg:o,cat:g,src:q})}}}return p};d.message=function(){return d.log.apply(d,arguments)}})()},"3.0.0",{requires:["yui-base"]});YUI.add("yui-later",function(a){(function(){var c=a.Lang,b=function(f,l,e,j,i){f=f||0;l=l||{};var k=e,g=a.Array(j),h,d;if(c.isString(e)){k=l[e]}if(!k){}h=function(){k.apply(l,g)};d=(i)?setInterval(h,f):setTimeout(h,f);return{id:d,interval:i,cancel:function(){if(this.interval){clearInterval(d)}else{clearTimeout(d)}}}};a.later=b;c.later=b})()},"3.0.0",{requires:["yui-base"]});YUI.add("yui",function(a){},"3.0.0",{use:["yui-base","get","yui-log","yui-later"]});var TUBEFOOT=TUBEFOOT||{};TUBEFOOT.base=function(){YUI().use("node",function(c){var b=c.one("#query");b.focus();var a=c.one("#category");c.one("#search").on("submit",function(f){f.preventDefault();if(c.Lang.trim(b.get("value"))==""){alert("You'll want to type something in the search box.");b.focus()}else{var d=a.get("value");var g=b.get("value");window.location.href=g_sBasePath+"videos,"+d+","+encodeURIComponent(g)}});c.on("available",function(d){if(a){a.set("value",c.one("#selected").get("value"))}},"#selected")})}();var TUBEFOOT=TUBEFOOT||{};TUBEFOOT.search=function(){YUI().use("node",function(b){var f=300,k=500,h="playing",l=55;var a,c,q,i,e,d,m,o,g,p;var j=function(){a=b.one("#header");c=b.one("#video_desc_read_less");q=b.one("#video_desc_read_more");p=(a)?a.getAttribute("videoID"):null;g='<object width="'+k+'" height="'+f+'"><param name="movie" value="http://www.youtube.com/v/@ID&hl=en&fs=1&rel=0" wmode="transparent"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="transparent" /><embed src="http://www.youtube.com/v/@ID&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'+k+'" height="'+f+'" wmode="transparent"></embed></object>';try{b.one("#video_embed_input").set("value",g.replace(/@ID/g,p));b.one("#video_link_input").set("value",location.href);m='<span class="embed_code">embed code: <input class="input_embed" type="text" value=""><br />direct link: <input class="input_link" type="text" value="" /></span>';o='<span class="embed_links"><a href="javascript:;" class="tagfoot_link">add to my tagfoot</a></span>'}catch(r){}}();var n=function(r){switch(r.target){case c:r.preventDefault();b.one("#video_desc_less").setStyle("display","block");b.one("#video_desc_more").setStyle("display","none");break;case q:r.preventDefault();b.one("#video_desc_less").setStyle("display","none");b.one("#video_desc_more").setStyle("display","block");break;default:break}};b.on("available",function(r){YUI().use(("io"),function(u){var v=u.one("#popular_videos");function s(y,x){try{v.removeClass("popular_loading");v.set("innerHTML",x.responseText)}catch(w){t()}}function t(x,w){}u.io("../_getPopular",{method:"GET",on:{success:s,failure:t}})})},"#popular_container");b.on("available",function(r){YUI().use(("io"),function(u){var v=u.one("#related_container");function s(y,x){try{v.replaceClass("related_loading","related_loaded");v.set("innerHTML",x.responseText)}catch(w){t()}}function t(x,w){}u.io("../_getRelated?v="+p,{method:"GET",on:{success:s,failure:t}})})},"#related_container");b.on("click",function(r){try{r.target.select()}catch(r){}},"#video_playing_embed");b.on("click",n,"#video_desc_read_less");b.on("click",n,"#video_desc_read_more")})}();
