var heroCarousel={content:[],isLoaded:false,currentIndex:0,domNode:"#heroCarousel",contentContainer:null,titleContainer:null,init:function(){$(".heroCarouselNavs .carourselLeft").click(function(){heroCarousel.go(-1)});$(".heroCarouselNavs .carourselRight").click(function(){heroCarousel.go(1)});this.contentContainer=$(".heroWrapper",this.domNode);this.titleContainer=$(".heroHead h1 .slideTitle",this.domNode);this.isLoaded=true},go:function(a){if(a===1){heroCarousel.currentIndex=(heroCarousel.currentIndex===heroCarousel.content.length-1)?0:heroCarousel.currentIndex+1}else{heroCarousel.currentIndex=(heroCarousel.currentIndex===0)?heroCarousel.content.length-1:heroCarousel.currentIndex-1}this.loadSlide()},loadSlide:function(){var a=this;heroCarousel.contentContainer.children("div").fadeOut("fast",function(){$.get(a.content[a.currentIndex].src,{},heroCarousel.postLoad)})},postLoad:function(a){heroCarousel.contentContainer.html(a).fadeIn("fast");heroCarousel.titleContainer.html(heroCarousel.content[heroCarousel.currentIndex].title)},loadHalfSlide:function(){var a=this;heroCarousel.contentContainer.find("div.heroMain").fadeOut("fast",function(){$.get(a.content[a.currentIndex].src,{},function(c){var b=heroCarousel.contentContainer.find("div.heroMain");var d=$(c).find("div.heroMain").html();$(b).children().remove();heroCarousel.titleContainer.html(heroCarousel.content[heroCarousel.currentIndex].title);$(b).append(d).fadeIn("fast")})})},setNextPrevSlide:function(a){if(a===1){heroCarousel.currentIndex=(heroCarousel.currentIndex===heroCarousel.content.length-1)?0:heroCarousel.currentIndex+1}else{heroCarousel.currentIndex=(heroCarousel.currentIndex===0)?heroCarousel.content.length-1:heroCarousel.currentIndex-1}}};$(document).ready(function(){heroCarousel.init()});