dojo.declare("mySlideshow",null,{imageid:1,slideHeight:350,imageCount:0,animationType:"fade",constructor:function(animtype,height){animationType=animtype||this.animationType;this.slideHeight=height||this.slideHeight;startTimer=this.startTimer;fadetoSlide=this.fadetoSlide;showImage=this.showImage;_this=this;},_doFade:function(newTop){var doFadeOut=dojo.fadeOut({node:"travelslider",duration:350});var doFadeIn=dojo.fadeIn({node:"travelslider",duration:350});var doSlide=dojo.animateProperty({node:"travelslider",duration:1,properties:{top:{end:newTop,unit:"px"}}});dojo.fx.chain([doFadeOut,doSlide,doFadeIn]).play();},_doSlide:function(newTop){var doSlide=dojo.fx.slideTo({node:"travelslider",top:newTop}).play();},showImage:function(newTop,callback){switch(animationType){case"fade":_this._doFade(newTop);break;case"slide":_this._doSlide(newTop);break;}},startTimer:function(){setTimeout(function(){_this.nextImage(true);},5000);},clickEffect:function(evt){var theslide2=evt.target.id.split("_");var slidenumber=theslide2[1];newTop=-(_this.slideHeight*(slidenumber-1));_this.showImage(newTop);_this.updateNav(evt.target.id);},updateNav:function(slide){dojo.query("#carouselnav div.slides").forEach('item.style.backgroundPosition = "0 -25px"');dojo.attr(dojo.byId(slide),"style",{backgroundPosition:"0 0"});},nextImage:function(_showImage){if(!_showImage){_showImage=true;}
if(_showImage){var coords=dojo.coords(dojo.byId('travelslider'));newTop=coords.t-_this.slideHeight;if(Math.abs(newTop)>=Math.abs(_this.slideHeight*_this.imageCount))newTop=0;_this.showImage(newTop,startTimer());slide=(Math.abs(newTop)/_this.slideHeight)+1;_this.updateNav('slide_'+slide);}},setImageCount:function(counter){this.imageCount=counter;},getImageCount:function(){return this.imageCount;}});var mySlider=new mySlideshow("fade",490);dojo.addOnLoad(function(){mySlider.setImageCount(dojo.query("#travelslider div.travel").length);mySlider.updateNav('slide_1');for(var i=1;i<=mySlider.getImageCount();i++){dojo.connect(dojo.byId('slide_'+i),"onclick",null,mySlider.clickEffect);}
setTimeout(function(){mySlider.nextImage(true);},10000);});