/*
 * InfiniteCarousel v1.1.0
 * Based off code from http://jqueryfordesigners.com/jquery-infinite-carousel/
 *
 * Author: Stephen Jones (Steve Jones)
 * Date: 2009-09-03 16:37
 * 
 * 1.1.0 - Added in Auto-Scroll to carousel, fixed timing issue with autoscroll.
 * 1.0.3 - Updated the class hover effect and removes any pre-set styles from the items.
 * 1.0.2 - Disables the carousel if not enough items are displayed (degrades nicely).
*/
(function(){$.fn.infiniteCarousel=function(a,c,e,b,d){return this.each(function(){var g=$("> div",this).css("overflow","hidden"),s=g.find("> ul").width(9999),q=s.find("> li"),p=q.filter(":first"),r,o=p.outerWidth(true),h=Math.floor(g.innerWidth()/o),l=h+Math.ceil(h/2),m=q.length,k=null,i=null,j=(c>0)?true:false;c=(c<h)?c:h;if(b==null&&d==null){b=3000;d=1}if(m<=h){return}q.removeAttr("style");q.filter(":first").before(q.slice(-l).clone(true).addClass("cloned"));q.filter(":last").after(q.slice(0,l).clone(true).addClass("cloned"));q=s.find("> li");r=s.find(".cloned");cloneAmount=r.length/2;g.scrollLeft(o*cloneAmount);function n(v,x){var w=o*v;var u=(g.scrollLeft()%o);if(x&&g.filter(":animated").length>0){return}if(v>0){w-=u}else{w+=(u>0)?o-u:0}g.filter(":animated").stop(true);g.animate({scrollLeft:"+="+w},{queue:false,duration:a},t())}function t(){var u=g.scrollLeft()/o;if(u<=h){g.scrollLeft(o*(u+m))}else{if(u>=m+cloneAmount-Math.ceil(h/2)-1){g.scrollLeft(o*(u-m))}}}function f(){if(b>0&&d!=0){i=setInterval(function(){n(d,true)},(a+b))}}g.after('<a href="#" class="arrow back">&lt;</a><a href="#" class="arrow forward">&gt;</a>');$("a.back",this).click(function(){n(-h,false);return false});$("a.forward",this).click(function(){n(+h,false);return false});f();if(j){$("a.forward",this).hover(function(){clearInterval(i);n(c,true);k=setInterval(function(){n(c,true)},(a*2))},function(){clearInterval(k);f()});$("a.back",this).hover(function(){clearInterval(i);n(-c,true);k=setInterval(function(){n(-c,true)},(a*2))},function(){clearInterval(k);f()})}})}})(jQuery);$(document).ready(function(){$(".wrapper a.packshot img").mouseover(function(){$(this).fadeTo(250,0.75);$(this).fadeTo(500,1)})});
