// This has been autogenerated by \lib\JSMin\jsmin.exe, do not modify manually

$(window).load(function(){hero.init();});var hero={$images:$('#hero-box div.heros-slides img'),$anchors:$('#hero-box div.titles h2 a'),autoCyclePeriodInSeconds:5,autoCycleTimerName:'HeroBoxAutoCycleTimer',init:function(){$('#hero-box div.titles h2 a').mouseover(function(e){$(document).stopTime(hero.autoCycleTimerName);hero.selectItem($(e.target));});$('#hero-box').mouseout(function(e){hero.startNextCycle();});hero.startNextCycle();},selectItem:function($item){var linkOver=$item.parent('h2').attr('class').split('-')[1]-1;hero.switchImage($item,linkOver);},switchImage:function($t,index){hero.$images.hide();$('#hero-box div.titles h2 a').removeClass('selected');$t.addClass('selected');hero.$images.eq(index).show();},startNextCycle:function(){$(document).stopTime(hero.autoCycleTimerName);$(document).oneTime(hero.autoCyclePeriodInSeconds*1000,hero.autoCycleTimerName,function(){hero.onCycleComplete();});},onCycleComplete:function(){hero.autoCycleToNextItem();hero.startNextCycle();},autoCycleToNextItem:function(){var maxIndex=hero.$anchors.size()-1;var currentItemIndex=hero.getCurrentItemIndex();var nextItemIndex=hero.circularIncrement(currentItemIndex,maxIndex,0);$nextItem=hero.$anchors.eq(nextItemIndex);hero.switchImage($nextItem,nextItemIndex);},getCurrentItemIndex:function(){return hero.$anchors.index(hero.$anchors.filter('.selected').eq(0));},circularIncrement:function(i,max,min){var x=i+1;return(x>max)?min:x;}};

