var SV=SV||{};(function(A){SV.slideshow=function(){var I=A(this),F=null,B=[],E=null,J=null,H=0,M={showControls:false,speed:2500};function K(){if(A.browser.msie&&A.browser.version<7){try{document.execCommand("BackgroundImageCache",false,true)}catch(P){}}A("img",I).each(function(){B.push({src:A(this).attr("src"),href:A(this).parent().attr("href")})});if(B.length>1){A("#slideshow-slides").remove()}else{return false}E=A("<div />").appendTo(I).addClass("slideshow-buffer").css({width:"100%",height:"100%"}).fadeTo(0,0);if(M.showControls){A("<ul />").appendTo(I).attr("id","slideshow-toc");for(var O=0;O<B.length;O++){var N=A("<li />").appendTo("#slideshow-toc").data("slideIndex",O).text(O+1).click(function(){H=A(this).data("slideIndex");D(H);G();return false})}F=A("<li />").appendTo("#slideshow-toc").attr("id","#slideshow-pause").text("Pause").click(function(){if(J){A(this).text("Play");G()}else{A(this).text("Pause");C()}return false})}A("#slideshow").css("background","url("+B[0].src+")");L(0);A("#slideshow-toc li").eq(0).addClass("selected");C()}function D(O){var N="url("+B[O].src+")";A(E).stop().css("background",N).fadeTo(M.speed,1,function(){I.css("backgroundImage",N);A("#slideshow-toc li").eq(O).addClass("selected").siblings().removeClass("selected");L(O);A(this).fadeTo(0,0)})}function C(N){N=A.extend({speed:5000},N);A(F).addClass("pause").removeClass("play");J=setInterval(function(){if(H<B.length-1){++H}else{H=0}D(H)},N.speed)}function G(){A(F).addClass("play").removeClass("pause");clearInterval(J);J=null}function L(N){if(B[N].href){if(A("a",E).length==0){A("<a />").appendTo(E).css({display:"block",width:"100%",height:"100%"})}A("a",E).attr("href",B[N].href)}else{A("a",E).remove()}}K();return this}})(jQuery);jQuery.fn.extend({slideshow:SV.slideshow});