/**
 * This jQuery plugin creates an animated slider with the child elements as frames.
 *
 * @author Justin Jones (justin(at)jstnjns(dot)com)
 * @version 1.2
 */
(function(a){a.fn.simpleslider=function(b){var c={auto:false,interval:2000,speed:500,easing:"swing",direction:"horizontal",continuous:"false",buttons:true,autobuttonsize:false,previoustext:"Previous",nexttext:"Next"};b=a.extend({},c,b);a(this).each(function(){var f,e,t,q,m,i,d,k,r,j,u;f=a(this);e=f.children().addClass("frame");t=f.wrap('<div id="'+f.attr("id")+'-wrapper" />').parent("#"+f.attr("id")+"-wrapper");j=e.size();q=0;i=0;e.each(function(){if(a(this).height()>i){i=a(this).height()}if(a(this).outerHeight(true)>q){q=a(this).outerHeight(true)}});d=f.width();r=e.width();u=1;t.css({width:d,height:q,overflow:"hidden"});if(b.direction=="horizontal"){k=d*j;m=q}else{if(b.direction=="vertical"){k=d;m=q*j}}f.css({width:k,height:m});e.css({display:"block","float":"left",height:i,width:r});if(b.buttons){t.before('<input type="button" id="'+f.attr("id")+'-previous_button" class="button" value="'+b.previoustext+'" />').after('<input type="button" id="'+f.attr("id")+'-next_button" class="button" value="'+b.nexttext+'" />')}if(b.autobuttonsize&&b.direction=="horizontal"){t.parent().find(".button").css("height",m)}else{if(b.autobuttonsize&&(b.direction=="vertical")){t.parent().find(".button").css("width",k)}}a("#"+f.attr("id")+"-previous_button").click(function(v){v.preventDefault();n();l()});a("#"+f.attr("id")+"-next_button").click(function(v){v.preventDefault();o();l()});s();if(b.auto==true){h(b.interval);g()}function p(v){if(v!==undefined){if(b.direction=="horizontal"){f.animate({marginLeft:(-1)*(v-1)*d+"px"},b.speed,b.easing)}else{if(b.direction=="vertical"){f.animate({marginTop:(-1)*(v-1)*q+"px"},b.speed,b.easing)}}}else{if(b.direction=="horizontal"){f.animate({marginLeft:(-1)*(u-1)*d+"px"},b.speed,b.easing)}else{if(b.direction=="vertical"){f.animate({marginTop:(-1)*(u-1)*q+"px"},b.speed,b.easing)}}}}function n(){u--;if(u>0){p()}else{p(j);u=j}s()}function o(){u++;if(u<=j){p()}else{p(1);u=1}s()}function s(){if(u==1){a("#"+f.attr("id")+"-previous_button").attr("disabled","disabled").addClass("disabled")}else{a("#"+f.attr("id")+"-previous_button").removeAttr("disabled").removeClass("disabled")}if(u==j){a("#"+f.attr("id")+"-next_button").attr("disabled","disabled").addClass("disabled")}else{a("#"+f.attr("id")+"-next_button").removeAttr("disabled").removeClass("disabled")}}function h(v){auto=setInterval(o,v)}function l(){if(b.auto!==false){clearInterval(auto)}}function g(){t.hover(function(){l()},function(){h(b.interval)})}})}})(jQuery);
