(function(a){a.fn.easySlider=function(b){var c={prevId:"prevBtn",prevText:"&lsaquo;",nextId:"nextBtn",nextText:"&rsaquo;",orientation:"",speed:500,interval:8};var b=a.extend(c,b);return this.each(function(){obj=a(this);var q=a("li",obj).length;var n=obj.width();var l=obj.height();var m=q-1;var o=0;var j=(b.orientation=="vertical");var g="";var i=0;a("ul",obj).css("width",q*n);if(!j){a("li",obj).css("float","left")}g+='<span class="prvnxt">';g+='<a href="javascript:void(0);" id="'+b.prevId+'">'+b.prevText+'</a><a href="javascript:void(0);" id="'+b.nextId+'">'+b.nextText+"</a>";g+="</span>";a(obj).after(g);a("#"+b.nextId).click(function(){e("next");k()});a("#"+b.prevId).click(function(){e("prev");k()});function e(h){i=0;if(h=="next"){o=(o>=m)?m:o+1}else{o=(o<=0)?0:o-1}if(!j){p=(o*n*-1);a("ul",obj).animate({marginLeft:p},b.speed)}else{p=(o*l*-1);a("ul",obj).animate({marginTop:p},b.speed)}}function d(h){i=0;o=parseInt(h);p=(o*n*-1);a("ul",obj).animate({marginLeft:p},b.speed)}function k(){if(o<=0){a("#"+b.prevId).addClass("inactive");a("#"+b.nextId).removeClass("inactive")}else{if(o>=m){a("#"+b.nextId).addClass("inactive");a("#"+b.prevId).removeClass("inactive")}else{a("#"+b.prevId).removeClass("inactive");a("#"+b.nextId).removeClass("inactive")}}}function f(){myInt=setInterval(function(){i++;if(b.interval==i){if(o>=m){d(0);k()}else{e("next");k()}}},1000);if(q>1){a("#"+b.prevId).addClass("inactive");a("#"+b.prevId).show();a("#"+b.nextId).show()}else{a("#"+b.prevId).hide();a("#"+b.nextId).hide()}}f()})}})(jQuery);