(function($){$.fn.extend({fashionCarousel:function(options){var defaults={links:".links",rightArrow:"",leftArrow:"",selectedClass:"",parent:$(this).parent(),autoScroll:true,scrollSpeed:4};if(options){var o=$.extend(defaults,options);}return this.each(function(){o.scrollSpeed=o.scrollSpeed*1000;var c=$(this);var s=0;var h=$(this).children().not(o.leftArrow).not(o.rightArrow);$(o.rightArrow).css({"z-index":"6"});$(o.leftArrow).css({"z-index":"6"});var t=$(h).size();var nL="";var j=1;while(j<=t){nL+='<a href="?t='+j+'">'+j+"</a>";j++;}$(o.links).prepend(nL);$(h).css("display","none");$(h).eq(s).each(function(){$(this).fadeIn();$(o.links).children().eq(s).addClass(o.selectedClass);});function sI(){$(h).each(function(i){if($(this).is(":visible")){s=$(h).index(this);}});}function cN(){sI();return s==(t-1)?0:s+1;}function cP(){sI();return s==0?(t-1):s-1;}function sc(){r(cN());}function r(x){sI();$(h).eq(s).fadeOut("slow",function(){$(h).eq(x).fadeIn("slow",function(){s=x;$(o.links).children().removeClass(o.selectedClass);$(o.links).children().eq(s).addClass(o.selectedClass);});});}$(o.links).children().click(function(e){var d=$(o.links).children().index(this);r(d);window.clearInterval(iV);return false;});$(c).hover(function(e){$(o.rightArrow+","+o.leftArrow).fadeIn();},function(e){$(o.rightArrow+","+o.leftArrow).fadeOut();});$(o.rightArrow).click(function(){var n=cN();r(n);window.clearInterval(iV);});$(o.leftArrow).click(function(){var n=cP();r(n);window.clearInterval(iV);});if(o.autoScroll==true){var iV=window.setInterval(sc,o.scrollSpeed);}});}});})(jQuery);
