
var LandingPageHandler={init:function(){function convertAndHide(c){var d=$(c);return d;}
this.tabArray=$A(this.tabArray).map(convertAndHide);this.panelArray=$A(this.panelArray).map(convertAndHide);this.createPE();for(var i=0;i<this.tabArray.length;i++){this.tabArray[i]=Object.extend(this.tabArray[i],this.tabExtensions);Event.observe(this.tabArray[i],"mouseover",this.onTabGenerator(i).bindAsEventListener(this));Event.observe(this.tabArray[i],"mouseout",this.offTab.bindAsEventListener(this));}
Event.observe(window,"mousemove",this.resetTimer.bind(this));Event.observe("box","mousemove",(function(){this.pe.stop();}).bind(this));this.updateIndex();},resetTimer:function(){if(this.mmpe){this.mmpe.stop();}
var _4=this;this.mmpe=new PeriodicalExecuter(function(){_4.mmpe.stop();_4.createPE();},this.restartDelay);},createPE:function(){if(this.isFreeToCycle()){if(this.pe){this.pe.stop();}
this.pe=new PeriodicalExecuter(this.updateIndex.bind(this),this.cycleDelay);}},onTabGenerator:function(_5){return function(_6){this.tabIndex=_5;this.onTab();};},onTab:function(_7){this.overTab=true;this.pe.stop();this.showIndex();},offTab:function(_8){this.overTab=false;},showIndex:function(){this.tabArray.invoke("visHide");this.panelArray.invoke("hide");this.tabArray[this.tabIndex].visShow();this.panelArray[this.tabIndex].show();},isFreeToCycle:function(){return!this.overTab;},updateIndex:function(){this.tabIndex++;if(this.tabIndex>=this.tabArray.length){this.tabIndex=0;}
this.showIndex();},tabExtensions:{setOpacity:function(_9){this.style.filter="alpha(opacity="+(_9*100)+")";this.style["-moz-opacity"]=_9;this.style["-khtml-opacity"]=_9;this.style.opacity=_9;},visHide:function(){this.setOpacity(0);},visShow:function(){this.setOpacity(1);}},tabArray:["tab1","tab2","tab3","tab4"],panelArray:["welcomePanel","athPanel","scoutPanel","hsPanel"],tabIndex:-1,overTab:false,cycleDelay:4,restartDelay:2};Event.observe(window,"load",function(){LandingPageHandler.init();});
