function hasUserGroup(user_group){try{switch(user_group){case"lfctv_member":var demog=$.cookie("LFC_demog");demog=eval("("+demog+")");return demog.status==21;case"registered_user":return $.cookie("LFC_cookie")!=undefined}}catch(e){}return false}function navLoggedInMenu(){var a=$("li#nav_log_button").get(0);var b=$("li#nav_account_or_register_button").get(0);var c=$.cookie("LFC_U_NME");var d=$.cookie("LFC_U_EML");if(typeof a!="undefined"){if(c!=null&&c!="deleted"){a.innerHTML='<a href="/cgi-bin/logout">Logout</a>';b.innerHTML='<a href="/cgi-bin/traffic_control?service=eup">My Account</a>'}else{a.innerHTML='<a class="show-login" href="/login.php">Login</a>';b.innerHTML='<a href="/regview/?ptype=1">Sign Up</a>'}$(".show-login").colorbox()}}function ticker_tick(){var a=false;if(!a){document.getElementById("ticker").scrollLeft+=2}if(document.getElementById("ticker").scrollLeft>=document.getElementById("ticker").scrollWidth-document.getElementById("ticker").offsetWidth){document.getElementById("ticker").scrollLeft=0}window.setTimeout("ticker_tick()",60)}function ticker_news_start(a){var b=false;var c="";if(navigator.userAgent.indexOf("Firefox")!=-1||navigator.userAgent.indexOf("Safari")!=-1){document.getElementById("ticker").innerHTML="<table cellspacing='0' cellpadding='0' width='100%'><tr><td nowrap='nowrap'>"+c+"<span id='ticker_body' width='100%'> </span>"+c+"</td></tr></table>";b=true}if(navigator.userAgent.indexOf("MSIE")!=-1||navigator.userAgent.indexOf("Opera")!=-1){document.getElementById("ticker").innerHTML="<table cellspacing='0' cellpadding='0' width='100%'><tr><td nowrap='nowrap'>"+c+"<span id='ticker_body' width='100%'> </span>"+c+"</td></tr></table>";b=true}if(!b){document.getElementById("ticker").outerHTML=""}else{document.getElementById("ticker").scrollLeft=0;document.getElementById("ticker_body").innerHTML=a;document.getElementById("ticker").style.display="block";ticker_tick()}}function ticker_start(a){var b=false;var c="<img src=http://assets.liverpoolfc.tv/images/spacer.gif width=634px height=0>";if(navigator.userAgent.indexOf("Firefox")!=-1||navigator.userAgent.indexOf("Safari")!=-1){document.getElementById("ticker").innerHTML="<table cellspacing='0' cellpadding='0' width='100%'><tr><td nowrap='nowrap'>"+c+"<span id='ticker_body' width='100%'> </span>"+c+"</td></tr></table>";b=true}if(navigator.userAgent.indexOf("MSIE")!=-1||navigator.userAgent.indexOf("Opera")!=-1){document.getElementById("ticker").innerHTML="<div nowrap='nowrap' style='width:100%;'>"+c+"<span id='ticker_body' width='100%'></span>"+c+"</div>";b=true}if(!b){document.getElementById("ticker").outerHTML=""}else{document.getElementById("ticker").scrollLeft=0;document.getElementById("ticker_body").innerHTML=a;document.getElementById("ticker").style.display="block";ticker_tick()}}function buildVideoPlaylistHomepage(a,b){var c=a.getElementsByTagName("clip");var d;var e=[];var f=[];var g;var h;var i;var j=0;var k=[];var l=[];for(var m=0;m<c.length;m++){for(var n=0;n<c.item(m).childNodes.length;n++){d=c.item(m).childNodes.item(n);try{f[d.nodeName]=d.childNodes.item(0).nodeValue}catch(o){}}j=f["rank"]>j?f["rank"]:j;e[f["rank"]]=document.createElement("div");$(e[f["rank"]]).addClass("entry");g=document.createElement("a");$(g).attr("href",f["page_url"]);k[f["rank"]]=f["clip_path"];$(g).addClass("vid_title");g.innerHTML=f["title"];$(e[f["rank"]]).append(g);if(m==1){$(e[f["rank"]]).append(g);g=document.createElement("div");g.style.display="block";i=document.createElement("a");$(i).attr("href",f["page_url"]);$(e[f["rank"]]).addClass("topentry");h=document.createElement("img");$(h).attr("src",f["thumb_url"]);$(i).append(h);$(g).append(i);h=document.createElement("p");$(h).addClass("vid_desc");h.innerHTML=f["description"];$(g).append(h);h=document.createElement("div");$(h).addClass("pl_content");$(h).append(g);$(e[f["rank"]]).append(h);i=document.createElement("div");$(i).addClass("clear");$(e[f["rank"]]).append(i)}}var p=document.getElementById("pl_pane");for(m=1;m<=j;m++){try{$(p).append(e[m])}catch(o){}}}function playThis(a){window.location=a+"?ncid=est_weblinks_rightnav"}function buildVideoPlaylist(a,b){function p(){$(".entry .pl_content").hide();$(".entry .pl_content:first").show();$(".entry .openclose:first").hide();$(".entry .openclose").click(function(){var a=$(this).next();$("#pl_pane .openclose").fadeIn("fast");$(this).fadeOut("slow");if(a.is(".pl_content")&&!a.is(":visible")){$(".entry .pl_content:visible").slideUp("normal");a.slideDown("normal");return false}})}var c=a.getElementsByTagName("clip");var d;var e=[];var f=[];var g;var h;var i=0;var j=[];var k=[];for(var l=0;l<c.length;l++){for(var m=0;m<c.item(l).childNodes.length;m++){d=c.item(l).childNodes.item(m);try{f[d.nodeName]=d.childNodes.item(0).nodeValue}catch(n){}}i=f["rank"]>i?f["rank"]:i;e[f["rank"]]=document.createElement("div");$(e[f["rank"]]).addClass("entry");g=document.createElement("a");$(g).attr("id","pl_play_lnk_a_"+f["rank"]);j[f["rank"]]=f["clip_path"];k[f["rank"]]=f["page_url"];$(g).addClass("vid_title");g.innerHTML=f["title"];$(e[f["rank"]]).append(g);g=document.createElement("div");$(g).attr("id","pl_"+f["rank"]);$(g).addClass("openclose");$(e[f["rank"]]).append(g);g=document.createElement("div");g.style.display="block";h=document.createElement("img");h.style.width="80px";h.style.height="53px";$(h).attr("src","http://assets.lfcimages.com/images/spacer.gif");$(h).attr("data-original",f["thumb_url"]);$(h).addClass("lazy");$(g).append(h);h=document.createElement("p");$(h).addClass("vid_desc");h.innerHTML=f["description"];$(g).append(h);h=document.createElement("div");$(h).attr("id","pl_desc_"+f["rank"]);$(h).addClass("pl_content");$(h).append(g);$(e[f["rank"]]).append(h)}var o=document.getElementById("pl_pane");for(l=1;l<=i;l++){try{$(o).append(e[l]);$("#pl_desc_"+l).attr("clip_path",k[l]);$("#pl_play_lnk_a_"+l).click(function(){var a=$(this).next().next();if(a.is(":visible")){playThis(a.attr("clip_path"))}else{$("#pl_pane .openclose").fadeIn("fast");$(this).next().fadeOut("slow");$(".entry .pl_content:visible").slideUp("normal");a.slideDown("normal");$("#"+a.attr("id")+" img").each(function(){$(this).trigger("appear")})}});$("#pl_desc_"+l).click(function(){playThis($(this).attr("clip_path"))})}catch(n){}$("#pl_pane img.lazy").show().lazyload({threshold:150})}$(document).ready(function(){p()})}function testAds(){LFCAds145x145.display("news")}function HideMatchCentre(){showHideMatchCentre()}function showHideMatchCentre(){if($.flash.available&&matchCentreOpened==0){$("#match_center").text("")}if($("#MatchCenterContainer").hasClass("hidden")){$("#MatchCenterContainer").css("background","url(../images/template/MatchCenterBg.jpg) 0 0 no-repeat");$("#MatchCenterContainer").show();$("#MatchCenterContainer").slideDown().toggleClass("hidden");$("#NavDD iframe").hide();captureOnClick("10");if(matchCentreOpened==0){$("#match_center").flash({swf:swfUrl,width:996,height:299,flashvars:{xmlStatic:flashvars["xmlStatic"],xmlLive:flashvars["xmlLive"],xmlLocation:flashvars["xmlLocation"]},params:{wmode:"transparent",allowScriptAccess:"always"}});matchCentreOpened=1}}else{captureOnClick("11");var a=$("#MatchCenterContainer").height();$("#MatchCenterContainer").fadeOut("fast",function(){$("#MatchCenterContainer").height(a);$("#MatchCenterContainer").slideUp().toggleClass("hidden")})}}function captureOnClickWithCF(a,b,c){var d=YWA.getTracker("1000120889805");d.setAction(a);d.setCF(b,c);d.submit_action()}function captureOnClick(a){var b=YWA.getTracker("1000120889805");b.setAction(a);b.submit_action()}$(document).ready(function(){navLoggedInMenu();$(".show-login").colorbox();$(".show-comments-login").colorbox();$(".report_abuse").colorbox();$(".report_abuse_close").click(function(){reportAbuse.close();return false});$.cookie("LFC_c_on","1",{expires:7,path:"/",domain:".liverpoolfc.tv",secure:false});$("ul.TabsRounded").each(function(){var a=$(".TabsRounded");$(".TabsRounded a").css("padding","0px");var b=a.width();var c=0;jQuery.each($(this).children(),function(a,b){c=c+$(this).width()});var d=b/c;jQuery.each($(this).children(),function(a,c){var e=Math.ceil($(this).width()*d);if(b>=e){$(this).children().css("width",e).css("padding","0px")}else{$(this).children().css("width",b).css("padding","0px")}b=b-e})});var a=$(".TabsSquare");$(".TabsSquare a").css("padding","0px");var b=a.width();var c=0;jQuery.each(a.children(),function(a,b){c=c+$(this).width()});var d=b/c;jQuery.each(a.children(),function(a,c){var e=Math.ceil($(this).width()*d);if(b>=e){if($(this).children().hasClass("end")){$(this).children().css("width",e).css("padding","0px")}else{$(this).children().css("width",e-2).css("padding","0px")}}else{if($(this).children().hasClass("end")){$(this).children().css("width",b).css("padding","0px")}else{$(this).children().css("width",b-2).css("padding","0px")}}b=b-e});$(".fix-z-index").bgiframe()});$(document).ajaxComplete(function(a,b,c){if(b&&b.responseText=="tnc"){$("#ArticleCommentsMainLeft").html("Please agree to our Terms and Conditions before posting. You will be redirected shortly…");top.location.href="/fans/terms-and-conditions/"+Base64.encode(top.location.href)}});var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){var b="";var c,d,e,f,g,h,i;var j=0;a=Base64._utf8_encode(a);while(j<a.length){c=a.charCodeAt(j++);d=a.charCodeAt(j++);e=a.charCodeAt(j++);f=c>>2;g=(c&3)<<4|d>>4;h=(d&15)<<2|e>>6;i=e&63;if(isNaN(d)){h=i=64}else if(isNaN(e)){i=64}b=b+this._keyStr.charAt(f)+this._keyStr.charAt(g)+this._keyStr.charAt(h)+this._keyStr.charAt(i)}return b},decode:function(a){var b="";var c,d,e;var f,g,h,i;var j=0;a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(j<a.length){f=this._keyStr.indexOf(a.charAt(j++));g=this._keyStr.indexOf(a.charAt(j++));h=this._keyStr.indexOf(a.charAt(j++));i=this._keyStr.indexOf(a.charAt(j++));c=f<<2|g>>4;d=(g&15)<<4|h>>2;e=(h&3)<<6|i;b=b+String.fromCharCode(c);if(h!=64){b=b+String.fromCharCode(d)}if(i!=64){b=b+String.fromCharCode(e)}}b=Base64._utf8_decode(b);return b},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");var b="";for(var c=0;c<a.length;c++){var d=a.charCodeAt(c);if(d<128){b+=String.fromCharCode(d)}else if(d>127&&d<2048){b+=String.fromCharCode(d>>6|192);b+=String.fromCharCode(d&63|128)}else{b+=String.fromCharCode(d>>12|224);b+=String.fromCharCode(d>>6&63|128);b+=String.fromCharCode(d&63|128)}}return b},_utf8_decode:function(a){var b="";var c=0;var d=c1=c2=0;while(c<a.length){d=a.charCodeAt(c);if(d<128){b+=String.fromCharCode(d);c++}else if(d>191&&d<224){c2=a.charCodeAt(c+1);b+=String.fromCharCode((d&31)<<6|c2&63);c+=2}else{c2=a.charCodeAt(c+1);c3=a.charCodeAt(c+2);b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63);c+=3}}return b}};var changeSearchForms={init:function(a,b){if($(a).length<=0)return;if(!b)b=$(a)[0].action;if(b.match(/[^\/]$/g))b=b+"/";$(a).submit(function(){var c=buildSearchFormToSubmit.init(a,b);window.location.href=c;return false});this.updateSorting()},updateSorting:function(){var a=$("#search_sorting a");var b=window.location.href.replace(/sort\/\w+\//g,"");var c=a.length;if(b.match(/(.*)([^\/])$/))b+="/";for(var d=0;d<c;d++)a[d].href=a[d].href.replace(/^(.*)\&sort\=(\w+)(.*)$/,b+"sort/$2/")},initMainSearchStore:function(){if($(".main_nav_search").length>0){$("#main_search").submit(function(){var a=$(".main_nav_search").get(0).value;a=a.replace(/\"|\<|\>\'/gi,"");$.cookie("main_search_data",a)})}}};var buildSearchFormToSubmit={init:function(a,b){var c=this.getAllFormElements(a);var d=this.buildUri(c,b);if(typeof searchFormUriOverride=="function")d=searchFormUriOverride(d);return d},getAllFormElements:function(a){var b=$(a+" input[type=text]");var c=$(a+" input[type=checkbox]");var d=$(a+" select");var e=$(a+" input[type=hidden]");return this.mergeObjects(b,c,d,e)},mergeObjects:function(){var a=new Array;for(var b=0;b<arguments.length;b++)for(var c=0;c<arguments[b].length;c++)a.push(arguments[b][c]);return a},buildUri:function(a,b){var c=b;var d=a.length;for(var e=0;e<d;e++){if(!a[e].name||!a[e].value||a[e].type!="hidden"&&a[e].type!="text"&&a[e].checked!==undefined&&!a[e].checked)continue;c+=a[e].name+"/"+a[e].value.replace(/(\s|\*|\/|\\|\?)+/g,"+")+"/"}return c.slice(0,-1)}};$(document).ready(function(){changeSearchForms.initMainSearchStore();changeSearchForms.init("#page_archive");changeSearchForms.init("#news_search","/news/archive/");changeSearchForms.init("#faqs_search","/faqs/search/");changeSearchForms.init("#academy_search","/stadium/academy/news/archive/");changeSearchForms.init("#main_search");changeSearchForms.init("#tickets_form","/tickets/latest-ticket-news/search/");changeSearchForms.init("#fixture_season_select");changeSearchForms.init("#fixture_season_select2");changeSearchForms.init("#history_past_players_filter");changeSearchForms.init("#first_team_stats_season_select");changeSearchForms.init(".kop_search_blogs");changeSearchForms.init(".kop_search_fans");changeSearchForms.init(".kop_search_videos");changeSearchForms.init(".kop_search_photos");changeSearchForms.init("#downloads_wallpaper_search","/fans/downloads/search/wallpapers/");changeSearchForms.init("#downloads_screensaver_search","/fans/downloads/search/screensavers/");changeSearchForms.init("#search_box")});eval(function(a,b,c,d,e,f){e=function(a){return(a<62?"":e(parseInt(a/62)))+((a=a%62)>35?String.fromCharCode(a+29):a.toString(36))};if("0".replace(0,e)==0){while(c--)f[e(c)]=d[c];d=[function(a){return f[a]||a}];e=function(){return"([237-9n-zA-Z]|1\\w)"};c=1}while(c--)if(d[c])a=a.replace(new RegExp("\\b"+e(c)+"\\b","g"),d[c]);return a}("(s(m){3.fn.pngFix=s(c){c=3.extend({P:'blank.gif'},c);8 e=(o.Q==\"t R S\"&&T(o.u)==4&&o.u.A(\"U 5.5\")!=-1);8 f=(o.Q==\"t R S\"&&T(o.u)==4&&o.u.A(\"U 6.0\")!=-1);p(3.browser.msie&&(e||f)){3(2).B(\"img[n$=.C]\").D(s(){3(2).7('q',3(2).q());3(2).7('r',3(2).r());8 a='';8 b='';8 g=(3(2).7('E'))?'E=\"'+3(2).7('E')+'\" ':'';8 h=(3(2).7('F'))?'F=\"'+3(2).7('F')+'\" ':'';8 i=(3(2).7('G'))?'G=\"'+3(2).7('G')+'\" ':'';8 j=(3(2).7('H'))?'H=\"'+3(2).7('H')+'\" ':'';8 k=(3(2).7('V'))?'float:'+3(2).7('V')+';':'';8 d=(3(2).parent().7('href'))?'cursor:hand;':'';p(2.9.v){a+='v:'+2.9.v+';';2.9.v=''}p(2.9.w){a+='w:'+2.9.w+';';2.9.w=''}p(2.9.x){a+='x:'+2.9.x+';';2.9.x=''}8 l=(2.9.cssText);b+='<y '+g+h+i+j;b+='9=\"W:X;white-space:pre-line;Y:Z-10;I:transparent;'+k+d;b+='q:'+3(2).q()+'z;r:'+3(2).r()+'z;';b+='J:K:L.t.M(n=\\''+3(2).7('n')+'\\', N=\\'O\\');';b+=l+'\"></y>';p(a!=''){b='<y 9=\"W:X;Y:Z-10;'+a+d+'q:'+3(2).q()+'z;r:'+3(2).r()+'z;\">'+b+'</y>'}3(2).hide();3(2).after(b)});3(2).B(\"*\").D(s(){8 a=3(2).11('I-12');p(a.A(\".C\")!=-1){8 b=a.13('url(\"')[1].13('\")')[0];3(2).11('I-12','none');3(2).14(0).15.J=\"K:L.t.M(n='\"+b+\"',N='O')\"}});3(2).B(\"input[n$=.C]\").D(s(){8 a=3(2).7('n');3(2).14(0).15.J='K:L.t.M(n=\\''+a+'\\', N=\\'O\\');';3(2).7('n',c.P)})}return 3}})(3);",[],68,"||this|jQuery||||attr|var|style||||||||||||||src|navigator|if|width|height|function|Microsoft|appVersion|border|padding|margin|span|px|indexOf|find|png|each|id|class|title|alt|background|filter|progid|DXImageTransform|AlphaImageLoader|sizingMethod|scale|blankgif|appName|Internet|Explorer|parseInt|MSIE|align|position|none|display|inline|block|css|image|split|get|runtimeStyle".split("|"),0,{}));(function(a){function b(a){return a&&a.constructor===Number?a+"px":a}a.fn.bgiframe=a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(c){c=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},c);var d='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+c.src+'"style="display:block;position:absolute;z-index:-1;'+(c.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(c.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(c.top))+";left:"+(c.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(c.left))+";width:"+(c.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(c.width))+";height:"+(c.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(c.height))+';"/>';return this.each(function(){if(a(this).children("iframe.bgiframe").length===0){this.insertBefore(document.createElement(d),this.firstChild)}})}:function(){return this};a.fn.bgIframe=a.fn.bgiframe})(jQuery);(function(a,b,c){function ba(b){if(!T){O=b;Z(a.extend(J,a.data(O,e)));x=a(O);P=0;if(J.rel!=="nofollow"){x=a("."+V).filter(function(){var b=a.data(this,e).rel||this.rel;return b===J.rel});P=x.index(O);if(P===-1){x=x.add(O);P=x.length-1}}if(!R){R=S=true;q.show();if(J.returnFocus){try{O.blur();a(O).one(k,function(){try{this.focus()}catch(a){}})}catch(c){}}p.css({opacity:+J.opacity,cursor:J.overlayClose?"pointer":"auto"}).show();J.w=X(J.initialWidth,"x");J.h=X(J.initialHeight,"y");U.position(0);if(n){y.bind("resize."+o+" scroll."+o,function(){p.css({width:y.width(),height:y.height(),top:y.scrollTop(),left:y.scrollLeft()})}).trigger("resize."+o)}$(g,J.onOpen);I.add(C).hide();try{H.html(J.close).show()}catch(c){}}U.load(true)}}function _(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;if(J.slideshow&&x[1]){d=function(){E.text(J.slideshowStop).unbind(c).bind(i,function(){if(P<x.length-1||J.loop){a=setTimeout(U.next,J.slideshowSpeed)}}).bind(h,function(){clearTimeout(a)}).one(c+" "+j,e);q.removeClass(b+"off").addClass(b+"on");a=setTimeout(U.next,J.slideshowSpeed)};e=function(){clearTimeout(a);E.text(J.slideshowStart).unbind([i,h,j,c].join(" ")).one(c,d);q.removeClass(b+"on").addClass(b+"off")};if(J.slideshowAuto){d()}else{e()}}}function $(b,c){if(c){c.call(O)}a.event.trigger(b)}function Z(b){for(var c in b){if(a.isFunction(b[c])&&c.substring(0,2)!=="on"){b[c]=b[c].call(O)}}b.rel=b.rel||O.rel||"nofollow";b.href=a.trim(b.href||a(O).attr("href"));b.title=b.title||O.title}function Y(a){return J.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(a)}function X(a,b){b=b==="x"?y.width():y.height();return typeof a==="string"?Math.round(/%/.test(a)?b/100*parseInt(a,10):parseInt(a,10)):a}function W(c,d){var e=b.createElement("div");e.id=c?f+c:false;e.style.cssText=d||false;return a(e)}var d={transition:"elastic",speed:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight:false,maxHeight:false,scalePhotos:true,scrolling:true,inline:false,html:false,iframe:false,fastIframe:true,photo:false,href:false,title:false,rel:false,opacity:.9,preloading:true,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,returnFocus:true,loop:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,overlayClose:true,escKey:true,arrowKey:true},e="colorbox",f="cbox",g=f+"_open",h=f+"_load",i=f+"_complete",j=f+"_cleanup",k=f+"_closed",l=f+"_purge",m=a.browser.msie&&!a.support.opacity,n=m&&a.browser.version<7,o=f+"_IE6",p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J={},K,L,M,N,O,P,Q,R,S,T=false,U,V=f+"Element";U=a.fn[e]=a[e]=function(b,c){var f=this,g;if(!f[0]&&f.selector){return f}b=b||{};if(c){b.onComplete=c}if(!f[0]||f.selector===undefined){f=a("<a/>");b.open=true}f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b));a(this).addClass(V)});g=b.open;if(a.isFunction(g)){g=g.call(f)}if(g){ba(f[0])}return f};U.init=function(){y=a(c);q=W().attr({id:e,"class":m?f+(n?"IE6":"IE"):""});p=W("Overlay",n?"position:absolute":"").hide();r=W("Wrapper");s=W("Content").append(z=W("LoadedContent","width:0; height:0; overflow:hidden"),B=W("LoadingOverlay").add(W("LoadingGraphic")),C=W("Title"),D=W("Current"),F=W("Next"),G=W("Previous"),E=W("Slideshow").bind(g,_),H=W("Close"));r.append(W().append(W("TopLeft"),t=W("TopCenter"),W("TopRight")),W(false,"clear:left").append(u=W("MiddleLeft"),s,v=W("MiddleRight")),W(false,"clear:left").append(W("BottomLeft"),w=W("BottomCenter"),W("BottomRight"))).children().children().css({"float":"left"});A=W(false,"position:absolute; width:9999px; visibility:hidden; display:none");a("body").prepend(p,q.append(r,A));s.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover");K=t.height()+w.height()+s.outerHeight(true)-s.height();L=u.width()+v.width()+s.outerWidth(true)-s.width();M=z.outerHeight(true);N=z.outerWidth(true);q.css({"padding-bottom":K,"padding-right":L}).hide();F.click(function(){U.next()});G.click(function(){U.prev()});H.click(function(){U.close()});I=F.add(G).add(D).add(E);s.children().removeClass("hover");a("."+V).live("click",function(a){if(!(a.button!==0&&typeof a.button!=="undefined"||a.ctrlKey||a.shiftKey||a.altKey)){a.preventDefault();ba(this)}});p.click(function(){if(J.overlayClose){U.close()}});a(b).bind("keydown",function(a){if(R&&J.escKey&&a.keyCode===27){a.preventDefault();U.close()}if(R&&J.arrowKey&&!S&&x[1]){if(a.keyCode===37&&(P||J.loop)){a.preventDefault();G.click()}else if(a.keyCode===39&&(P<x.length-1||J.loop)){a.preventDefault();F.click()}}})};U.remove=function(){q.add(p).remove();a("."+V).die("click").removeData(e).removeClass(V)};U.position=function(a,c){function g(a){t[0].style.width=w[0].style.width=s[0].style.width=a.style.width;B[0].style.height=B[1].style.height=s[0].style.height=u[0].style.height=v[0].style.height=a.style.height}var d,e=Math.max(b.documentElement.clientHeight-J.h-M-K,0)/2+y.scrollTop(),f=Math.max(y.width()-J.w-N-L,0)/2+y.scrollLeft();d=q.width()===J.w+N&&q.height()===J.h+M?0:a;r[0].style.width=r[0].style.height="9999px";q.dequeue().animate({width:J.w+N,height:J.h+M,top:e,left:f},{duration:d,complete:function(){g(this);S=false;r[0].style.width=J.w+N+L+"px";r[0].style.height=J.h+M+K+"px";if(c){c()}},step:function(){g(this)}})};U.resize=function(a){if(R){a=a||{};if(a.width){J.w=X(a.width,"x")-N-L}if(a.innerWidth){J.w=X(a.innerWidth,"x")}z.css({width:J.w});if(a.height){J.h=X(a.height,"y")-M-K}if(a.innerHeight){J.h=X(a.innerHeight,"y")}if(!a.innerHeight&&!a.height){var b=z.wrapInner("<div style='overflow:auto'></div>").children();J.h=b.height();b.replaceWith(b.children())}z.css({height:J.h});U.position(J.transition==="none"?0:J.speed)}};U.prep=function(b){function h(b){U.position(b,function(){var b,d,g,h,j=x.length,k,n;if(!R){return}n=function(){B.hide();$(i,J.onComplete)};if(m){if(Q){z.fadeIn(100)}}C.html(J.title).add(z).show();if(j>1){if(typeof J.current==="string"){D.html(J.current.replace(/\{current\}/,P+1).replace(/\{total\}/,j)).show()}F[J.loop||P<j-1?"show":"hide"]().html(J.next);G[J.loop||P?"show":"hide"]().html(J.previous);b=P?x[P-1]:x[j-1];g=P<j-1?x[P+1]:x[0];if(J.slideshow){E.show()}if(J.preloading){h=a.data(g,e).href||g.href;d=a.data(b,e).href||b.href;h=a.isFunction(h)?h.call(g):h;d=a.isFunction(d)?d.call(b):d;if(Y(h)){a("<img/>")[0].src=h}if(Y(d)){a("<img/>")[0].src=d}}}else{I.hide()}if(J.iframe){k=a("<iframe frameborder=0/>").addClass(f+"Iframe")[0];if(J.fastIframe){n()}else{a(k).load(n)}k.name=f+ +(new Date);k.src=J.href;if(!J.scrolling){k.scrolling="no"}if(m){k.allowTransparency="true"}a(k).appendTo(z).one(l,function(){k.src="//about:blank"})}else{n()}if(J.transition==="fade"){q.fadeTo(c,1,function(){q[0].style.filter=""})}else{q[0].style.filter=""}y.bind("resize."+f,function(){U.position(0)})})}function g(){J.h=J.h||z.height();J.h=J.mh&&J.mh<J.h?J.mh:J.h;return J.h}function d(){J.w=J.w||z.width();J.w=J.mw&&J.mw<J.w?J.mw:J.w;return J.w}if(!R){return}var c=J.transition==="none"?0:J.speed;y.unbind("resize."+f);z.remove();z=W("LoadedContent").html(b);z.hide().appendTo(A.show()).css({width:d(),overflow:J.scrolling?"auto":"hidden"}).css({height:g()}).prependTo(s);A.hide();a(Q).css({"float":"none"});if(n){a("select").not(q.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(j,function(){this.style.visibility="inherit"})}if(J.transition==="fade"){q.fadeTo(c,0,function(){h(0)})}else{h(c)}};U.load=function(b){var c,d,g=U.prep;S=true;Q=false;O=x[P];if(!b){Z(a.extend(J,a.data(O,e)))}$(l);$(h,J.onLoad);J.h=J.height?X(J.height,"y")-M-K:J.innerHeight&&X(J.innerHeight,"y");J.w=J.width?X(J.width,"x")-N-L:J.innerWidth&&X(J.innerWidth,"x");J.mw=J.w;J.mh=J.h;if(J.maxWidth){J.mw=X(J.maxWidth,"x")-N-L;J.mw=J.w&&J.w<J.mw?J.w:J.mw}if(J.maxHeight){J.mh=X(J.maxHeight,"y")-M-K;J.mh=J.h&&J.h<J.mh?J.h:J.mh}c=J.href;B.show();if(J.inline){W().hide().insertBefore(a(c)[0]).one(l,function(){a(this).replaceWith(z.children())});g(a(c))}else if(J.iframe){g(" ")}else if(J.html){g(J.html)}else if(Y(c)){a(Q=new Image).addClass(f+"Photo").error(function(){J.title=false;g(W("Error").text("This image could not be loaded"))}).load(function(){var a;Q.onload=null;if(J.scalePhotos){d=function(){Q.height-=Q.height*a;Q.width-=Q.width*a};if(J.mw&&Q.width>J.mw){a=(Q.width-J.mw)/Q.width;d()}if(J.mh&&Q.height>J.mh){a=(Q.height-J.mh)/Q.height;d()}}if(J.h){Q.style.marginTop=Math.max(J.h-Q.height,0)/2+"px"}if(x[1]&&(P<x.length-1||J.loop)){Q.style.cursor="pointer";Q.onclick=function(){U.next()}}if(m){Q.style.msInterpolationMode="bicubic"}setTimeout(function(){g(Q)},1)});setTimeout(function(){Q.src=c},1)}else if(c){A.load(c,function(b,c,d){g(c==="error"?W("Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})}};U.next=function(){if(!S){P=P<x.length-1?P+1:0;U.load()}};U.prev=function(){if(!S){P=P?P-1:x.length-1;U.load()}};U.close=function(){if(R&&!T){T=true;R=false;$(j,J.onCleanup);y.unbind("."+f+" ."+o);p.fadeTo(200,0);q.stop().fadeTo(300,0,function(){q.add(p).css({opacity:1,cursor:"auto"}).hide();$(l);z.remove();setTimeout(function(){T=false;$(k,J.onClosed)},1)})}};U.element=function(){return a(O)};U.settings=d;a(U.init)})(jQuery,document,this);jQuery.cookie=function(a,b,c){if(typeof b!="undefined"){c=c||{};if(b===null){b="";c.expires=-1}var d="";if(c.expires&&(typeof c.expires=="number"||c.expires.toUTCString)){var e;if(typeof c.expires=="number"){e=new Date;e.setTime(e.getTime()+c.expires*24*60*60*1e3)}else{e=c.expires}d="; expires="+e.toUTCString()}var f=c.path?"; path="+c.path:"";var g=c.domain?"; domain="+c.domain:"";var h=c.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(b),d,f,g,h].join("")}else{var i=null;if(document.cookie&&document.cookie!=""){var j=document.cookie.split(";");for(var k=0;k<j.length;k++){var l=jQuery.trim(j[k]);if(l.substring(0,a.length+1)==a+"="){i=decodeURIComponent(l.substring(a.length+1));break}}}return i}};(function(a,b){var c=function(a){var b,c=[];for(b in a){if(/string|number/.test(typeof a[b])&&a[b]!==""){c.push(b+'="'+a[b]+'"')}}return c[f]("")},d=function(a){var b,c,d=[],e;if(typeof a=="object"){for(b in a){if(typeof a[b]=="object"){e=[];for(c in a[b]){e.push([c,"=",encodeURIComponent(a[b][c])][f](""))}a[b]=e[f]("&")}if(a[b]){d.push(['<param name="',b,'" value="',a[b],'" />'][f](""))}}a=d[f]("")}return a},e=false,f="join";a[b]=function(){try{var g="0,0,0",h=navigator.plugins["Shockwave Flash"]||ActiveXObject;g=h.description||function(){try{return(new h("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}catch(a){}}()}catch(i){}g=g.match(/^[A-Za-z\s]*?(\d+)[\.|,](\d+)(?:\s+[d|r]|,)(\d+)/);return{available:g[1]>0,activeX:h&&!h.name,version:{major:g[1]*1,minor:g[2]*1,release:g[3]*1},hasVersion:function(a){var b=this.version,c="major",d="minor",e="release";a=/string|number/.test(typeof a)?a.toString().split("."):a||[0,0,0];a=[a[c]||a[0]||b[c],a[d]||a[1]||b[d],a[e]||a[2]||b[e]];return a[0]<b[c]||a[0]==b[c]&&a[1]<b[d]||a[0]==b[c]&&a[1]==b[d]&&a[2]<=b[e]},expressInstall:"expressInstall.swf",create:function(g){if(!a[b].available||e||!typeof g=="object"||!g.swf){return false}if(g.hasVersion&&!a[b].hasVersion(g.hasVersion)){g={swf:g.expressInstall||a[b].expressInstall,attrs:{id:g.id||"SWFObjectExprInst",name:g.name,height:Math.max(g.height||137),width:Math.max(g.width||214)},params:{flashvars:{MMredirectURL:location.href,MMplayerType:a[b].activeX?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}};e=true}else{g=a.extend(true,{attrs:{id:g.id,name:g.name,height:g.height||180,width:g.width||320},params:{wmode:g.wmode||"opaque",flashvars:g.flashvars}},g)}if(a[b].activeX){g.attrs.classid=g.attrs.classid||"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";g.params.movie=g.params.movie||g.swf}else{g.attrs.type=g.attrs.classid||"application/x-shockwave-flash";g.attrs.data=g.attrs.data||g.swf}return["<object ",c(g.attrs),">",d(g.params),"</object>"][f]("")}}}();a.fn[b]=function(c){if(typeof c=="object"){this.each(function(){var d=document.createElement(b);var e=a[b].create(c);if(e){d.innerHTML=e;if(d.childNodes[0]){this.appendChild(d.childNodes[0])}}})}else{if(typeof c=="function"){this.find("object").andSelf().filter("object").each(function(){var d=this,e="jsInteractionTimeoutMs";d[e]=d[e]||0;if(d[e]<660){if(d.clientWidth||d.clientHeight){c.call(this)}else{setTimeout(function(){a(d)[b](c)},d[e]+66)}}})}}return this}})(jQuery,"flash");var pollCheck={init:function(a){var b=$("#"+a);var c=b.get(0).innerHTML;var d=new RegExp("^(Sorry, you need to be)","gi");if(c=="fail_login"){b.hide();$("#"+a+"_fail").show();$("#"+a+"_fail a").colorbox({width:"415px"})}else if(c=="not_allowed"){b.hide();$("#"+a+"_allowed").show()}else if(d.test(c)&&$("#"+a+"_fail .KidsVideoContent").length){b.hide();$("#"+a+"_fail .KidsVideoContent").html("<p>"+c+"</p>");$("#"+a+"_fail").show()}else{b.show()}},hideButton:function(){$("#poll_send_button").hide();$("#side_poll_loading").show()}};$(document).ready(function(){$("#retweet_general_bar").attr("href","http://twitter.com/home?status="+encodeURIComponent(document.title+" "+$("#retweet_general_bar").attr("href")))});(function(a){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var c=function(a){a=a.replace(/\x0d\x0a/g,"\n");var b="";for(var c=0;c<a.length;c++){var d=a.charCodeAt(c);if(d<128){b+=String.fromCharCode(d)}else if(d>127&&d<2048){b+=String.fromCharCode(d>>6|192);b+=String.fromCharCode(d&63|128)}else{b+=String.fromCharCode(d>>12|224);b+=String.fromCharCode(d>>6&63|128);b+=String.fromCharCode(d&63|128)}}return b};var d=function(a){var b="";var c=0;var d=c1=c2=0;while(c<a.length){d=a.charCodeAt(c);if(d<128){b+=String.fromCharCode(d);c++}else if(d>191&&d<224){c2=a.charCodeAt(c+1);b+=String.fromCharCode((d&31)<<6|c2&63);c+=2}else{c2=a.charCodeAt(c+1);c3=a.charCodeAt(c+2);b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63);c+=3}}return b};a.extend({base64Encode:function(a){var d="";var e,f,g,h,i,j,k;var l=0;a=c(a);while(l<a.length){e=a.charCodeAt(l++);f=a.charCodeAt(l++);g=a.charCodeAt(l++);h=e>>2;i=(e&3)<<4|f>>4;j=(f&15)<<2|g>>6;k=g&63;if(isNaN(f)){j=k=64}else if(isNaN(g)){k=64}d=d+b.charAt(h)+b.charAt(i)+b.charAt(j)+b.charAt(k)}return d},base64Decode:function(a){var c="";var e,f,g;var h,i,j,k;var l=0;a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(l<a.length){h=b.indexOf(a.charAt(l++));i=b.indexOf(a.charAt(l++));j=b.indexOf(a.charAt(l++));k=b.indexOf(a.charAt(l++));e=h<<2|i>>4;f=(i&15)<<4|j>>2;g=(j&3)<<6|k;c=c+String.fromCharCode(e);if(j!=64){c=c+String.fromCharCode(f)}if(k!=64){c=c+String.fromCharCode(g)}}c=d(c);return c}})})(jQuery)
