(function(n){n.fn.jshowoff=function(t){var i={animatePause:!0,autoPlay:!0,changeSpeed:600,controls:!0,controlText:{play:"Play",pause:"Pause",next:"Next",previous:"Previous"},effect:"fade",hoverPause:!0,links:!0,speed:3e3};return(t&&n.extend(!0,i,t),i.speed<i.changeSpeed+20)?(alert("jShowOff: Make speed at least 20ms longer than changeSpeed; the fades aren't always right on time."),this):(this.each(function(){function v(f,e){var c=r,l,a,o,s;if(r>=f.length||e>=f.length?(r=0,l=!0):r<0||e<0?(r=f.length-1,a=!0):r=e,i.effect=="slideLeft"){function h(n){o=n=="right"?"left":"right";s=n=="left"?"left":"right"}r>=c?h("left"):h("right");n(f[r]).clone().appendTo(u).slideIt({direction:o,changeSpeed:i.changeSpeed});u.children().length>1&&u.children().eq(0).css("position","absolute").slideIt({direction:s,showHide:"hide",changeSpeed:i.changeSpeed},function(){n(this).remove()})}else i.effect=="fade"?(n(f[r]).clone().appendTo(u).hide().fadeIn(i.changeSpeed,function(){n.browser.msie&&this.style.removeAttribute("filter")}),u.children().length>1&&u.children().eq(0).css("position","absolute").fadeOut(i.changeSpeed,function(){n(this).remove()})):i.effect=="none"&&(n(f[r]).clone().appendTo(u),u.children().length>1&&u.children().eq(0).css("position","absolute").remove());i.links&&(n("."+t+"-active").removeClass(t+"-active jshowoff-active"),n("."+t+"-slidelinks a").eq(r).addClass(t+"-active jshowoff-active"))}function o(){return n("."+t+"-play").hasClass("jshowoff-paused")?!1:!0}function s(u){l()||(r++,v(f,r),u!="hover"&&o()||(h=setInterval(function(){s()},i.speed)),o()||n("."+t+"-play").text(i.controlText.pause).removeClass("jshowoff-paused "+t+"-paused"))}function c(r){clearInterval(h);r&&r!="playBtn"||n("."+t+"-play").text(i.controlText.play).addClass("jshowoff-paused "+t+"-paused");i.animatePause&&r=="playBtn"&&n('<p class="'+t+'-pausetext jshowoff-pausetext">'+i.controlText.pause+"<\/p>").css({fontSize:"62%",textAlign:"center",position:"absolute",top:"40%",lineHeight:"100%",width:"100%"}).appendTo(e).addClass(t+"pauseText").animate({fontSize:"600%",top:"30%",opacity:0},{duration:500,complete:function(){n(this).remove()}})}function b(){a(r+1)}function k(){a(r-1)}function l(){return u.children().length>1?!0:!1}function a(n){u.children().stop(!0,!0);(r!=n||r==n&&l())&&(l()&&u.children().eq(0).remove(),v(f,n),c())}function d(){n(f).each(function(){n(this).find("img").each(function(t){y[t]=n("<img>").attr("src",n(this).attr("src"))})})}function g(){e.append('<p class="jshowoff-controls '+t+'-controls"><a class="jshowoff-play '+t+'-play" href="#null">'+i.controlText.pause+'<\/a> <a class="jshowoff-prev '+t+'-prev" href="#null">'+i.controlText.previous+'<\/a> <a class="jshowoff-next '+t+'-next" href="#null">'+i.controlText.next+"<\/a><\/p>");n("."+t+"-controls a").each(function(){n(this).hasClass("jshowoff-play")&&n(this).click(function(){return o()?c("playBtn"):s(),!1});n(this).hasClass("jshowoff-prev")&&n(this).click(function(){return k(),!1});n(this).hasClass("jshowoff-next")&&n(this).click(function(){return b(),!1})})}function nt(){e.append('<p class="jshowoff-slidelinks '+t+'-slidelinks"><\/p>');n.each(f,function(i){var r=n(this).prop("title")!=""?n(this).prop("title"):i+1;n('<a class="jshowoff-slidelink-'+i+" "+t+"-slidelink-"+i+'" href="#null">'+r+"<\/a>").bind("click",{index:i},function(n){return a(n.data.index),!1}).appendTo("."+t+"-slidelinks")})}var u=n(this),f=n(this).children().remove(),h="",r=0,y=[],p=n(".jshowoff").length+1,t="jshowoff-"+p,w=i.cssClass!=undefined?i.cssClass:"",e;u.css("position","relative").wrap('<div class="jshowoff '+t+'" />');e=n("."+t);e.css("position","relative").addClass(w);n(f[0]).clone().appendTo(u);d();i.controls&&(g(),i.autoPlay==!1&&n("."+t+"-play").addClass(t+"-paused jshowoff-paused").text(i.controlText.play));i.links&&(nt(),n("."+t+"-slidelinks a").eq(0).addClass(t+"-active jshowoff-active"));i.hoverPause&&u.hover(function(){o()&&c("hover")},function(){o()&&s("hover")});i.autoPlay&&f.length>1&&(h=setInterval(function(){s()},i.speed));f.length<1&&n("."+t).append("<p>For jShowOff to work, the container element must have child elements.<\/p>")}),this)}})(jQuery),function(n){n.fn.slideIt=function(t,i){var r={direction:"left",showHide:"show",changeSpeed:600};return t&&n.extend(r,t),this.each(function(){var u,t,f;n(this).css({left:"auto",right:"auto",top:"auto",bottom:"auto"});u=r.direction=="left"||r.direction=="right"?n(this).outerWidth():n(this).outerHeight();t={};t.position=n(this).css("position")=="static"?"relative":n(this).css("position");t[r.direction]=r.showHide=="show"?"-"+u+"px":0;f={};f[r.direction]=r.showHide=="show"?0:"-"+u+"px";n(this).css(t).animate(f,r.changeSpeed,i)}),this}}(jQuery)