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