(function(A){A.fn.jshowoff=function(C){var B={animatePause:true,autoPlay:true,changeSpeed:600,controls:true,controlText:{play:"Play",pause:"Pause",next:"Next",previous:"Previous"},effect:"fade",hoverPause:true,links:true,speed:3000};if(C){A.extend(true,B,C)}if(B.speed<(B.changeSpeed+20)){alert("jShowOff: Make speed at least 20ms longer than changeSpeed; the fades aren't always right on time.");return this}this.each(function(S){var K=A(this);var D=A(this).children().remove();var O="";var N=0;var R=[];var I=A(".jshowoff").length+1;var L="jshowoff-"+I;var M=B.cssClass!=undefined?B.cssClass:"";K.css("position","relative").wrap('<div class="jshowoff '+L+'" />');var P=A("."+L);P.css("position","relative").addClass(M);A(D[0]).clone().appendTo(K);J();if(B.controls){U();if(B.autoPlay==false){A("."+L+"-play").addClass(L+"-paused jshowoff-paused").text(B.controlText.play)}}if(B.links){T();A("."+L+"-slidelinks a").eq(0).addClass(L+"-active jshowoff-active")}if(B.hoverPause){K.hover(function(){if(G()){H("hover")}},function(){if(G()){W("hover")}})}if(B.autoPlay&&D.length>1){O=setInterval(function(){W()},B.speed)}if(D.length<1){A("."+L).append("<p>For jShowOff to work, the container element must have child elements.</p>")}function E(Z,b){var Y=N;if((N>=Z.length)||(b>=Z.length)){N=0;var d=true}else{if((N<0)||(b<0)){N=Z.length-1;var a=true}else{N=b}}if(B.effect=="slideLeft"){var e,f;function c(g){e=g=="right"?"left":"right";f=g=="left"?"left":"right"}N>=Y?c("left"):c("right");A(Z[N]).clone().appendTo(K).slideIt({direction:e,changeSpeed:B.changeSpeed});if(K.children().length>1){K.children().eq(0).css("position","absolute").slideIt({direction:f,showHide:"hide",changeSpeed:B.changeSpeed},function(){A(this).remove()})}}else{if(B.effect=="fade"){A(Z[N]).clone().appendTo(K).hide().fadeIn(B.changeSpeed,function(){if(A.browser.msie){this.style.removeAttribute("filter")}});if(K.children().length>1){K.children().eq(0).css("position","absolute").fadeOut(B.changeSpeed,function(){A(this).remove()})}}else{if(B.effect=="none"){A(Z[N]).clone().appendTo(K);if(K.children().length>1){K.children().eq(0).css("position","absolute").remove()}}}}if(B.links){A("."+L+"-active").removeClass(L+"-active jshowoff-active");A("."+L+"-slidelinks a").eq(N).addClass(L+"-active jshowoff-active")}}function G(){return A("."+L+"-play").hasClass("jshowoff-paused")?false:true}function W(Y){if(!X()){N++;E(D,N);if(Y=="hover"||!G()){O=setInterval(function(){W()},B.speed)}if(!G()){A("."+L+"-play").text(B.controlText.pause).removeClass("jshowoff-paused "+L+"-paused")}}}function H(Y){clearInterval(O);if(!Y||Y=="playBtn"){A("."+L+"-play").text(B.controlText.play).addClass("jshowoff-paused "+L+"-paused")}if(B.animatePause&&Y=="playBtn"){A('<p class="'+L+'-pausetext jshowoff-pausetext">'+B.controlText.pause+"</p>").css({fontSize:"62%",textAlign:"center",position:"absolute",top:"40%",lineHeight:"100%",width:"100%"}).appendTo(P).addClass(L+"pauseText").animate({fontSize:"600%",top:"30%",opacity:0},{duration:500,complete:function(){A(this).remove()}})}}function Q(){V(N+1)}function F(){V(N-1)}function X(){return K.children().length>1?true:false}function V(Y){K.children().stop(true,true);if((N!=Y)||((N==Y)&&X())){if(X()){K.children().eq(0).remove()}E(D,Y);H()}}function J(){A(D).each(function(Y){A(this).find("img").each(function(Z){R[Z]=A("<img>").attr("src",A(this).attr("src"))})})}function U(){P.append('<p class="jshowoff-controls '+L+'-controls"><a class="jshowoff-play '+L+'-play" href="#null">'+B.controlText.pause+'</a> <a class="jshowoff-prev '+L+'-prev" href="#null">'+B.controlText.previous+'</a> <a class="jshowoff-next '+L+'-next" href="#null">'+B.controlText.next+"</a></p>");A("."+L+"-controls a").each(function(){if(A(this).hasClass("jshowoff-play")){A(this).click(function(){G()?H("playBtn"):W();return false})}if(A(this).hasClass("jshowoff-prev")){A(this).click(function(){F();return false})}if(A(this).hasClass("jshowoff-next")){A(this).click(function(){Q();return false})}})}function T(){P.append('<p class="jshowoff-slidelinks '+L+'-slidelinks"></p>');A.each(D,function(Y,a){var Z=A(this).attr("title")!=""?A(this).attr("title"):Y+1;A('<a class="jshowoff-slidelink-'+Y+" "+L+"-slidelink-"+Y+'" href="#null">'+Z+"</a>").bind("click",{index:Y},function(b){V(b.data.index);return false}).appendTo("."+L+"-slidelinks")})}});return this}})(jQuery);(function(A){A.fn.slideIt=function(C,D){var B={direction:"left",showHide:"show",changeSpeed:600};if(C){A.extend(B,C)}this.each(function(F){A(this).css({left:"auto",right:"auto",top:"auto",bottom:"auto"});var G=(B.direction=="left")||(B.direction=="right")?A(this).outerWidth():A(this).outerHeight();var E={};E.position=A(this).css("position")=="static"?"relative":A(this).css("position");E[B.direction]=(B.showHide=="show")?"-"+G+"px":0;var H={};H[B.direction]=B.showHide=="show"?0:"-"+G+"px";A(this).css(E).animate(H,B.changeSpeed,D)});return this}})(jQuery);
