var slides=0;var slideshow_speed=5000;var slideshow_width=1000;var animation_speed=700;startSlideshow=function(){play=setInterval(function(){var b=$(".active_slide").attr("id").split("slide_").join("");if((Number(b)+1)>slides){var a=1}else{var a=(Number(b)+1)}$("#slide_"+b).removeClass("active_slide");$("#slide_"+a).addClass("active_slide");if((Number(b)+1)>slides){clearInterval(play);$(".slide").each(function(){var c=Number($(this).attr("id").split("slide_").join(""));$(this).stop(true,false).animate({left:(slideshow_width*Number($(this).attr("id").split("slide_").join(""))-1000)+"px"},animation_speed)});startSlideshow()}else{clearInterval(play);$(".slide").each(function(){$(this).stop(true,false).animate({left:($(this).position().left-slideshow_width)+"px"},animation_speed)});startSlideshow()}},slideshow_speed)};$(document).ready(function(){if($(".slideshow").length>0){$(".slideshow").css({left:(($(window).width()/2)-($(".slideshow").width()/2))+"px"});$(".slideshow").after('<div class="slideshow_bttn_left"></div><div class="slideshow_bttn_right"></div>');$(".slideshow_bttn_left").css({left:(($(window).width()/2)-($(".slideshow").width()/2))+"px"});$(".slideshow_bttn_right").css({left:((($(window).width()/2)-($(".slideshow").width()/2)))+"px"});$(".slideshow").after('<img src="images/slideshow/pause.png" width="20" height="21" alt="||" class="slideshow_pause" />');$(".slideshow_pause").css({left:(((($(window).width()/2)-($(".slideshow").width()/2)))+$(".slideshow").width()-20)+"px",top:(($(".slideshow").position().top+$(".slideshow").height())-21)+"px"});$(".slide").each(function(){$(this).css("position","absolute");if(slides>0){$(this).css({left:(slideshow_width*slides)+"px"})}slides++;$(this).attr("id","slide_"+slides)});$("#slide_1").addClass("active_slide");$(".slideshow").show();startSlideshow()}else{if($(".slideshow_static").length>0){var a=Math.floor(slideHTML.length*Math.random());$(".slideshow_static").html(slideHTML[a])}}});$(function(){$(".slideshow").hover(function(){clearInterval(play);$(".slideshow_pause").fadeIn("fast")},function(){startSlideshow();$(".slideshow_pause").fadeOut("fast")});$(".slideshow_bttn_left, .slideshow_bttn_right").hover(function(){$(this).stop(true,false).animate({marginTop:"325px"},200)},function(){$(this).animate({marginTop:"330px"},200)});$(".slideshow_bttn_left").click(function(){clearInterval(play);var a=$(".active_slide").attr("id").split("slide_").join("");if(!((Number(a)-1)<1)){$("#slide_"+a).removeClass("active_slide");$("#slide_"+(Number(a)-1)).addClass("active_slide");$(".slide").each(function(){$(this).stop(false,true).animate({left:($(this).position().left+slideshow_width)+"px"},animation_speed)})}startSlideshow()});$(".slideshow_bttn_right").click(function(){clearInterval(play);var a=$(".active_slide").attr("id").split("slide_").join("");if(!((Number(a)+1)>slides)){$("#slide_"+a).removeClass("active_slide");$("#slide_"+(Number(a)+1)).addClass("active_slide");$(".slide").each(function(){$(this).stop(false,true).animate({left:($(this).position().left-slideshow_width)+"px"},animation_speed)})}startSlideshow()})});
