function addSelectionControls(a){jQuery.each($(a+" > .layer"),function(){$(this).css("opacity",(($(this).prevAll().length+1)>1?"0":"1"));$(".controlList").append('<li class="item'+($(this).hasClass("selected")?" selected":"")+'">&nbsp;</li>')});jQuery.each($(".controlList > .item"),function(){$(this).click(function(){var b=".layer:eq("+$(this).prevAll().length.toString()+")";switchOffer(b);pausePromotionsSlide()})})}function switchOffer(b){$(".layer.selected").fadeTo("slow",0).removeClass("selected");$(b).addClass("selected").fadeTo("slow",1);$(".controlList > .item.selected").removeClass("selected");var a=".controlList > .item:eq("+$(b).prevAll().length.toString()+")";$(a).addClass("selected")}function nextPromotion(){var c=$(".layer.selected").prevAll().length;var a=(c<($(".layers").children(".layer").length-1)?c+1:0);var b=".layer:eq("+a.toString()+")";switchOffer(b);promotionSlider=setTimeout(nextPromotion,5000)}function pausePromotionsSlide(){clearTimeout(promotionSlider)}function superHeroSetup(b){var a=$("#hero-gallery-"+b[0].galleryid);jQuery.each(b,function(c,e){if(c>0){var d='<li class="layer"><a href="'+e.ngg_custom_fields.URL+'"><img height="400" width="1280" src="'+e.imageURL+'" alt="'+e.alttext+'" /></a></li>';a.append(d)}});addSelectionControls("#hero-gallery-"+b[0].galleryid);promotionSlider=setTimeout(nextPromotion,5000)};
