$(document).ready(function()
{$.get("pop-vids"+window.location.search,function(data)
{var popVidsContainer=$("#pop-vids");popVidsContainer.html(data);$(".tn-title",popVidsContainer).each(trimThumbTitle);$(".scroller",popVidsContainer).each(makeListScroller);});var shows=new Array(),episodes=new Array(),featured=$("#featured");$("a",featured).each(wrangleFeaturedLink);$("img",featured).each(function()
{_this=$(this);_this.attr("title",_this.attr("title"));shows.push(_this.attr("title"));episodes.push(_this.attr("alt"));});featured.nivoSlider({directionNav:false,controlNavThumbs:true,captionOpacity:1,effect:"fade",slices:15,animSpeed:500,pauseTime:7000,beforeChange:function()
{$("#featured .border").removeAttr("href");$("#featured .play-btn").fadeOut();},afterChange:function()
{var link=$(".nivo-imageLink:visible");$("#featured .border").attr("href",link.attr("href"));$("#featured .border").attr("title",link.attr("title"));$("#featured .play-btn").fadeIn();}});$("a.nivo-control",featured).prepend('<span class="featured-arrow"></span>').each(function(i){$(this).append('<div><h3>'+episodes[i]+'</h3><p>'+shows[i]+'</p></div>');});featured.append('<a class="border"><div class="play-btn"/></a>');var link=$(".nivo-imageLink");$(".border",featured).attr("href",link.attr("href"));$(".border",featured).attr("title",link.attr("title"));featured.show();insertAds();});function wrangleFeaturedLink(){var _this=$(this),href=_this.attr("href");if(href.indexOf("?cts=1")>-1)
href=href.replace("?cts=1","").replace("/","/?cts=1#ap=");else
href=href.replace("/","/#ap=");_this.attr("href",href);}
