var HomeFeature,HomeFeatureItem,homePageFeature;$(function(){"use strict";$('.home-features-unready').removeClass('home-features-unready');homePageFeature=new HomeFeature({startAt:0,autocycle:true,period:5000,idletime:10000,tabHoverDelay:50,tabSlideDuration:200});});HomeFeature=function(options){"use strict";var self=this,construct,setUpAutocycle,registerFeature,goTo,next,prev,play,pause,container,items,position,interval,startAt=options.startAt||0,autocycle=options.autocycle||0,period=options.period||0,idletime=options.idletime||0,tabHoverDelay=options.tabHoverDelay||0,tabSlideDuration=options.tabSlideDuration||0;construct=function(){interval=0;position=startAt;items=[];container=$('.home-features');$('.home-features-item').each(function(index){items.push(new HomeFeatureItem({pane:$(this),feature:self,index:index,delay:tabHoverDelay,duration:tabSlideDuration}));});setTimeout(function(){goTo(startAt);},0);if(autocycle){setUpAutocycle();}};setUpAutocycle=function(){container.mouseover(function(){pause();}).mouseout(function(){play(true);});play();};this.play=play=function(afterIdle){if(!interval){if(afterIdle){interval=setInterval(function(){clearInterval(interval);interval=setInterval(next,period);next();},idletime);}else{interval=setInterval(next,period);}}};this.pause=pause=function(){if(interval){clearInterval(interval);interval=0;}};this.registerFeature=registerFeature=function(options){var i;for(i=0;i<items.length;i+=1){items[i].registerFeature(options);}};this.goTo=goTo=function(index){var i;for(i=0;i<items.length;i+=1){if(i===index){items[i].select();}else{items[i].deselect();}}
position=index;};this.next=next=function(){goTo((position+1)%items.length);};this.prev=prev=function(){goTo((position-1+items.length)%items.length);};construct();};HomeFeatureItem=function(options){"use strict";var self=this,construct,select,deselect,registerFeature,tab,background,content,show,hide,nothing,selected,delay=options.delay,duration=options.duration,pane=options.pane,feature=options.feature,index=options.index;construct=function(){content=$('.home-features-content',pane);tab=$('.home-features-tab',pane).remove().appendTo('.home-features-tabs-transplant').hoverDelay(function(){feature.goTo(index);},delay);tab.css({'top':index*tab.height()});background=$('a',tab);if(!$('body').hasClass('version-msie-6')){background.append('<span class="home-features-tab-effect"></span>');}
selected=false;pane.css({'display':'none'});};nothing=show=hide=function(){};this.select=select=function(){if(!selected){selected=true;tab.addClass('home-features-tab-selected').css({'left':10}).animate({'left':0},duration,'easeOutBack');pane.css({'display':'block'});content.each(show);}};this.deselect=deselect=function(){if(selected){selected=false;tab.removeClass('home-features-tab-selected').css({'left':0});pane.css({'display':'none'});content.each(hide);}};this.registerFeature=registerFeature=function(options){if(content.is(options.selector)){show=options.show||nothing;hide=options.hide||nothing;}};construct();};
var registerHomeImageSlider=function(selector){"use strict";$(selector).css({left:-10,top:-10});homePageFeature.registerFeature({selector:selector,show:function(){$(this).css({'left':-20}).animate({'left':-10},200,'easeOutBack');},hide:function(){}});};
$(function(){"use strict";registerHomeImageSlider('.home-features-content-fof');});
$(function(){"use strict";registerHomeImageSlider('.home-features-content-recipe');});
$(function(){"use strict";registerHomeImageSlider('.home-features-content-game-day-buffalo');});
$(function(){"use strict";registerHomeImageSlider('.home-features-content-tabasco-nation');});
$(function(){$('.home-locator-zip input').labeledInput({emptyClass:'home-locator-zip-empty'});});
$(function(){$('.home-facebook-iframe').each(function(){$(this).replaceWith('<iframe style="border: none;" allowTransparency="true" scrolling="no" src="'+
$(this).attr('href')+'" width="678" height="160"></iframe>');});});
