var C4=C4||{};
C4.Controller=(function hubControllerInit(D){var C={setPromoTitleHeights:function B(){D("#promo-three ul:not(.related-links)").each(function(){var G=0;
var F=0;
D(this).find("li:not(no-image) span").each(function(){if(D(this).height()>=G){G=D(this).height();
F=parseInt(D(this).css("margin-bottom"))
}}).each(function(){if(D(this).height()<G){var H=G-D(this).height()+F;
if(D.browser="mozilla"){H+=1
}D(this).css("margin-bottom",H)
}})
});
D("#promo-two ul.info-teaser").each(function(){var F=0;
D(this).find("h3").each(function(){if(D(this).height()>=F){F=D(this).height()
}}).each(function(){if(D(this).height()<F){D(this).css("margin-bottom",F-D(this).height())
}})
})
},addThirdPartyShareButtons:function E(){var I=D("meta[name=brandTitle]").attr("content");
var H,F={},G={facebook:{url:window.location.protocol+"//"+window.location.hostname+window.location.pathname+"?cntsrc=sn_bips-share_facebook",width:"450",height:"40"},twitter:{dataUrl:window.location.protocol+"//"+window.location.hostname+window.location.pathname+"?cntsrc=sn_bips-share_twitter",dataCount:"none",dataText:I+" from Channel4.com"}};
F.html=C4.Brand.Views.createShareButtons(G);
H='<p class="facebook-twitter-share"><a class="secondary-chevron"><span>Share this</span></a></p>';
D("#brandInfoBox").append(H);
D(".facebook-twitter-share").c4tooltip(F)
}};
return{init:function A(){C4.OO.insistRequired({object:D,names:[]},{object:C4.Brand.Views,names:["enhanceQuickLinks","enhanceSponsorship","enhanceJumpPointLinks","enhanceComments","enhanceCommentsIE","enhanceBrandPageAds","bindTooltipsIE"]});
C4.Brand.Views.createIntCmpLinks("#moreShowInfo a",null,C4.Brand.Views.getIntCmpQueryStr);
C.setPromoTitleHeights();
C.addThirdPartyShareButtons();
C4.Brand.Views.enhanceQuickLinks();
C4.Brand.Views.enhanceSponsorship();
C4.Brand.Views.enhanceJumpPointLinks();
C4.Brand.Views.enhanceComments();
C4.Brand.Views.enhanceCommentsIE();
C4.Brand.Views.enhanceBrandPageAds();
C4.Brand.Views.bindTooltipsIE()
},_set$:function(F){D=F
},_setViews:function(F){C=F
},_getViews:function(){return C
},_reset:(function(){var F=D,G=C;
return function(){D=F;
C=G
}
})()}
})(jQuery);
