/* Copyright 2011 Yusuf Najmuddin. Project URL: https://code.google.com/p/jquery-hslide/ . Dual licensed - GNU GPL and MIT. */
(function(b){function i(a){b(g).animate({left:-1*a*d},h.animation)}function j(a){b(c).find("a").removeClass("active");b(c).find("a:nth-child("+(a+1)+")").addClass("active")}function k(a){a*=1;clearInterval(l);j(a);i(a);l=setInterval(function(){a++;a==e&&(a=0);j(a);i(a)},h.interval)}var e,d,l,f,g,c,h={interval:5E3,animation:800};b.fn.hslide=function(a){b.extend(h,a);f=this;b(f).css({position:"relative",overflow:"hidden"});d=b(this).width();height=b(this).height();e=b(this).children("div").length;b(f).children("div").wrapAll("<div></div>");
g=b(this).children("div").first().css({position:"absolute",width:d*e});b(g).children("div").css({width:d,height:height,overflow:"hidden","float":"left",padding:0,margin:0});c=b('<span class="clicker"></span>').prependTo(f).css({position:"absolute",right:"10px",bottom:"10px","z-index":1E3});for(a=0;a<e;a++)b('<a rel="'+a+'"></a>').click(function(){k(b(this).attr("rel"))}).appendTo(c);b(c).find("a").css({cursor:"pointer","float":"left"});k(0)}})(jQuery);
