var NycHero={obj:null,timerHandle:null,bPaused:false,currentIndex:0,contentLength:0,sNavButtons:null,sNavButton:null,imgPath:null,init:function(imgPath,sNavButtons,sNavButton){this.bPaused=false;this.contentLength=$(".grid_hero").size();this.sNavButtons=sNavButtons;this.sNavButton=sNavButton;this.imgPath=imgPath;if($(".grid_hero").size()>1){$(this.sNavButtons+" "+this.sNavButton+" img").click(function(){clearInterval(NycHero.timerHandle);NycHero.timerHandle=0;var index=$(this).parent().parent().children().index($(this).parent());if(index!==NycHero.currentIndex){$(NycHero.sNavButton).eq(NycHero.currentIndex).children().eq(0).attr("src",NycHero.imgPath+eval(NycHero.currentIndex+1)+"_off.gif");$(this).src=NycHero.imgPath+eval(index+1)+"_on.gif"}NycHero.loadSlide(index)});$(this.sNavButtons+" "+this.sNavButton+" img").hover(function(){var index=$(this).parent().parent().children().index($(this).parent());this.src=NycHero.imgPath+eval(index+1)+"_on.gif"},function(){var index=$(this).parent().parent().children().index($(this).parent());if(index===NycHero.currentIndex){this.src=NycHero.imgPath+eval(index+1)+"_on.gif"}else{this.src=NycHero.imgPath+eval(index+1)+"_off.gif"}});this.timerHandle=setTimeout(function(){NycHero.onInitTimer(1)},10000)}},loadSlide:function(index){$("div.grid_hero").eq(NycHero.currentIndex).fadeOut("fast",function(){$("div.grid_hero").eq(index).fadeIn("fast")});if(index===NycHero.currentIndex){$(this.sNavButton).children().eq(index).src=this.imgPath+eval(index+1)+"_on.gif"}else{$(this.sNavButton).children().eq(index).src=this.imgPath+eval(index+1)+"_off.gif"}NycHero.currentIndex=index},toggle:function(a){this.bPaused=!a;if(a===true){this.timerHandle=setInterval(function(){this.onTimer(1)},6000)}else{clearInterval(this.timerHandle);this.timerHandle=null}},onTimer:function(a){NycHero.setSlide(a)},onInitTimer:function(a){NycHero.setSlide(a);clearTimeout(NycHero.timerHandle);this.timerHandle=setInterval(function(){NycHero.onTimer(1)},6000)},setSlide:function(direction){$(this.sNavButton).eq(this.currentIndex).children().eq(0).attr("src",this.imgPath+eval(this.currentIndex+1)+"_off.gif");var nSlide=this.getNextSlide(direction);this.loadSlide(nSlide);$(this.sNavButton).eq(this.currentIndex).children().eq(0).attr("src",this.imgPath+eval(this.currentIndex+1)+"_on.gif")},getNextSlide:function(b){var a=0;if(b===1){a=(NycHero.currentIndex===this.contentLength-1)?0:NycHero.currentIndex+1}else{a=(NycHero.currentIndex===0)?NycHero.contentLength:NycHero.currentIndex-1}return a}};