$(document).ready(function(){var A=[];$.getJSON(playlist,function(C){var D='<ul style="height:'+C.height+'px;">',E=0;$.each(C.modules,function(){D+='<li style="height:'+C.height+'px;" class="';if(this.type=="flash"){A.push(this);D+='flash flash-loading" id="carousel-flash-'+E+'"><div id="hero-flash-player-'+E+'" class="flash-player">Please download the <a href="http://get.adobe.com/flashplayer/">free Adobe Flash Player</a>.</div>';E++}else{if(this.type=="image"){D+='image"><img src="'+this.content+'" alt="'+this.alt_text+'" width="'+this.width+'" height="'+this.height+'" />'}else{D+='html not-loaded">'+this.content}}D+="</li>"});D+='</ul><ol id="hero-carousel-controls">';E=1;$.each(C.modules,function(){D+='<li><a class="IR toggle-'+E+'" href="#" onclick="omni_track('+E+');">'+E+"</a></li>";E++});D+="</ol>";$("#hero-carousel").html(D);$("#hero-carousel-controls li:first-child").addClass("active");$("#hero-carousel").parents("div.grid-j").find("div.hero-ad").height(C.height+"px");if($.browser.msie&&$.browser.version<7){var B=$("#hero-carousel ol li").outerHeight();$("#hero-carousel ol").css({bottom:"auto",top:(C.height-B)+"px"})}$("#hero-carousel > ul").jcarousel({scroll:1,auto:C.autoInterval,wrap:C.wrapOnEnd==true?"last":null,initCallback:function(F){F.clip.hover(function(){F.stopAuto()},function(){F.startAuto()});$("#hero-carousel-controls a").bind("click",function(){C.autoInterval=0;F.startAuto(C.autoInterval);F.scroll($.jcarousel.intval($(this).text()));return false});$("#hero-carousel li.html.not-loaded").each(function(){var G=$(this);$.get(G.text(),function(H){G.removeClass("not-loaded").html(H);$(".tooltip-box").hover(function(){$(this).children().show()},function(){$(this).children().hide()})})})},itemVisibleInCallback:function(G,I,K,H){var F=$(I),L,J;if(F.hasClass("flash")){G.startAuto(0);J=parseInt(F.attr("id").replace("carousel-flash-",""),10);L=A[J];F.html('<div id="hero-flash-player-'+J+'" class="flash-player">Please download the <a href="http://get.adobe.com/flashplayer/">free Adobe Flash Player</a>.</div>');swfobject.embedSWF(L.content,"hero-flash-player-"+J,L.width,(L.height>C.height?C.height:L.height),L.version,L.express,L.flashvars,L.params,L.attributes,function(M){if(M.success){$("#carousel-flash-"+J).removeClass("flash-loading");G.startAuto(C.autoInterval)}})}else{G.startAuto(C.autoInterval);$("div#hero-carousel").next("div#breakout").attr("class","breakout-"+K).fadeIn(1000);$("div#hero-carousel").find("#hero-carousel-controls a").parent("li").attr("class","active-"+K)}},itemVisibleOutCallback:{onBeforeAnimation:function(G,I,K,H){var F=$(I),J;if(F.hasClass("flash")){J=parseInt(F.attr("id").replace("carousel-flash-",""),10);swfobject.removeSWF("hero-flash-player-"+J);F.addClass("flash-loading")}else{$("div#hero-carousel").next("div#breakout").attr("class","breakout-"+K).fadeOut()}}},buttonNextHTML:null,buttonPrevHTML:null})})});
