var C4=C4||{};
C4.Controller=(function clipLandingControllerInit(F){function C(J,G){var I="",H=0;
while(H<J.length){I+="<span>"+J.substr(H,G)+"</span>";
H+=G
}return I
}var B={ClipsList:{showClipInfo:function(G){function H(I){return(I.innerHeight)?I.innerHeight:I.clientHeight
}F("#clipsList .clipInfo:visible").hide();
G.find(".clipInfo").show().find(".guidance:not(.fixed)").each(function(){F(this).parent().find(".synopsis").css({height:(G.height()-H(this)-H(G.find(".playClip")[0]))+"px",top:H(this)+"px"})
}).addClass("fixed").end().end().find(".synopsis:not(.flowfitted)").flowfit().addClass("flowfitted").end()
},hideClipInfo:function(){F(this).hide()
}}};
var E={enhanceClipsList:function D(){F("#clipsList").removeClass("graceIe6");
var G=F.browser;
if(G.msie&&G.version==8||G.version==6){var H=F("#clipsList li").find(".clipsInfo");
F("#clipsList li").hover(function(){F(this).find(".clipsInfo").css("visibility","visible")
},function(){F(this).find(".clipsInfo").css("visibility","hidden")
})
}F("#clipsList li").each(function(){F(this).find("h3").breakTitle(21);
var K=F(this).find(".guidanceGrid").text();
if(K.length>=127){F(this).find(".guidanceGrid").truncate("127").end().find(".synopsis").text("").end().find(".clipsInfo").css("background","#333333 ")
}var L=F(this).find(".guidanceGrid").height();
var I=F(this).find(".synopsis");
if(L>20){I.truncate("80")
}var J=F(F(this).find("a").get(0)).attr("href");
F(this).click(function(){location.href=J
})
})
}};
return{init:function A(){C4.OO.insistRequired({object:F,names:["flowfit","history","poshTabsLite","outerHtml"]},{object:C4.Brand.Views,names:["buildPocketsAndTabs","enhanceQuickLinks"]});
E.enhanceClipsList();
C4.Brand.Views.enhanceDropDownNavigation();
C4.Brand.Views.enhanceQuickLinks();
C4.Brand.Views.buildPocketsAndTabs();
C4.Brand.Views.enhanceSponsorship();
C4.Brand.Views.enhanceBrandPageAds()
},_set$:function(G){F=G
},_setViews:function(G){E=G
},_getViews:function(){return E
},_setEvents:function(G){B=G
},_getEvents:function(){return B
},_reset:(function(){var G=F,H=E,I=B;
return function(){F=G;
E=H;
B=I
}
})()}
})(jQuery);