function SlideShow(images,settings){this.image_list=images;this.target=settings.target;this.target_img=settings.target.find("img.target");this.link_next=settings.link_next;this.link_prev=settings.link_prev;this.link_startstop=settings.link_startstop;this.link_back=settings.link_back;this.currpage=settings.currpage;this.title=settings.title;this.desc=settings.desc;this.text_start=settings.text_start||"Slideshow starten";this.text_stop=settings.text_stop||"Slideshow anhalten";this.fade_delay=settings.fade_delay||500;this.next_delay=settings.next_delay||5000;this.current_image=0;this.timer=null;this.running=true;};SlideShow.prototype.showCurrent=function(){var img=this.image_list[this.current_image];this.link_back.attr({href:img.back_link});this.target.fadeOut(this.fade_delay,function(){this.target_img.attr({src:img.src});}.bind(this));};SlideShow.prototype.ELoad=function(){var img=this.image_list[this.current_image];this.target.fadeIn("slow");this.currpage.html((this.current_image+1).toString()+"/"
+(this.image_list.length).toString());this.setTimer();this.title.html(img.title);this.desc.html(img.desc);};SlideShow.prototype.ENext=function(){this.current_image++;if(this.current_image==this.image_list.length){this.current_image=0;}
this.showCurrent();return false;};SlideShow.prototype.EPrev=function(){this.current_image--;if(this.current_image<=0){this.current_image=this.image_list.length-1;}
this.showCurrent();return false;};SlideShow.prototype.EStartLink=function(){this.running=true;clearTimeout(this.timer);this.link_startstop.unbind('click');this.link_startstop.html(this.text_stop);this.link_startstop.click(this.EStopLink.bind(this));this.setTimer();return false;};SlideShow.prototype.EStopLink=function(){this.running=false;this.link_startstop.unbind('click');this.link_startstop.html(this.text_start);this.link_startstop.click(this.EStartLink.bind(this));return false;};SlideShow.prototype.ETick=function(){if(this.running){this.ENext();}};SlideShow.prototype.EKey=function(ev){if(ev.keyCode==37){this.EPrev();}
if(ev.keyCode==39){this.ENext();}
return false;};SlideShow.prototype.setTimer=function(){clearTimeout(this.timer);this.timer=window.setTimeout(this.ETick.bind(this),this.next_delay);};SlideShow.prototype.start=function(){this.link_next.click(this.ENext.bind(this));this.link_prev.click(this.EPrev.bind(this));this.target_img.load(this.ELoad.bind(this));$(document).keyup(this.EKey.bind(this));this.EStartLink();this.showCurrent();};