
var slideshow={displayTime:4000,playbackMode:1,currentSlide:0,init:function(){this.clearTimeOut();this.playbackMode=1;this.togglePlayback();this.first();if($('#slideshowCarousel li img').length<=1){this.stop();}},specific:function(slide,stop){if(stop){this.stop();}
$('.slideshow-content .image-container img').fadeOut('fast',function(){$('.slideshow-content .image-container img').attr('src',slide.attr('slide'));$('.slideshow-content .image-container img').fadeIn('fast');});$('#slideshowCarousel li img').removeClass('active');slide.addClass('active');for(i=0;i<$('#slideshowCarousel li img').length;i++){if(slide.attr('slide')==$('#slideshowCarousel li img:eq('+i+')').attr('slide')){this.currentSlide=i;break;}}},go:function(stop){if(stop){this.stop();}
if(this.currentSlide<0||this.currentSlide>=$('#slideshowCarousel li img').length){slideshow.first();}else{var slide=$('#slideshowCarousel li img:eq('+this.currentSlide+')');$('#slideshowCarousel li img').removeClass('active');slide.addClass('active');$('.slideshow-content .image-container img').fadeOut('fast',function(){$('.slideshow-content .image-container img').attr('src',slide.attr('slide'));$('.slideshow-content .image-container img').fadeIn('fast');});}},first:function(stop){this.currentSlide=0;this.go(stop);},previous:function(stop){this.currentSlide--;this.go(stop);},next:function(stop){this.currentSlide++;this.go(stop);},last:function(stop){this.currentSlide=$('#slideshowCarousel li img').length-1;this.go(stop);},play:function(){this.playbackTimeout=setTimeout('slideshow.next()',this.displayTime);this.playbackTrigger=setTimeout('slideshow.play()',this.displayTime);},stop:function(){$('.slideshow-content .controls-container .controls .playback').removeClass('stop');this.clearTimeOut();this.playbackMode=1;},clearTimeOut:function(){if(this.playbackTimeout)clearInterval(this.playbackTimeout);if(this.playbackTrigger)clearInterval(this.playbackTrigger);},togglePlayback:function(){if(this.playbackMode==1){this.play();this.playbackMode=0;$('.slideshow-content .controls-container .controls .playback').addClass('stop');}else{this.stop();}}}