
(function() {
    $.fn.infiniteCarousel = function(d, e, b, c, a) {
        return this.each(function() {
            var t = $("> div", this).css("overflow", "hidden"), m = t.find("> ul").width(9999),
            g = m.find("> li"), p = g.filter(":first"), f, n = p.outerWidth(true),
q = Math.floor(t.innerWidth() / n), r = q + Math.ceil(q / 2),
i = g.length, o = null, h = null, l = (e > 0) ? true : false; e = (e < q) ? e : q; if (c == null && a == null)
            { c = 3000; a = 1 } if (i <= q) { return } g.removeAttr("style"); g.filter(":first").before(g.slice(-r).clone(true).addClass("cloned"));
            g.filter(":last").after(g.slice(0, r).clone(true).addClass("cloned"));
            g = m.find("> li"); f = m.find(".cloned"); cloneAmount = f.length / 2; t.scrollLeft(n * cloneAmount);
            function j(w, v) {
                var u = n * w; var x = (t.scrollLeft() % n); if (v && t.filter(":animated").length > 0)
                { return } if (w > 0) { u -= x } else { u += (x > 0) ? n - x : 0 } t.filter(":animated").stop(true); t.animate({ scrollLeft: "+=" + u },
{ queue: false, duration: d, easing: b }, k())
            } function k() {
                var u = t.scrollLeft() / n;
                if (u <= q) { t.scrollLeft(n * (u + i)) }
                else { if (u >= i + cloneAmount - Math.ceil(q / 2) - 1) { t.scrollLeft(n * (u - i)) } }
            }
            function s() {
                if (c > 0 && a != 0) {
                    h = setInterval(function() { j(a, true) },
(d + c))
                } 
            } 
            t.after('<a href="#" class="arrow back">&lt;</a><a href="#" class="arrow forward">&gt;</a>'); 
            $("a.back", this).click(function() { j(-q, false); return false }); 
            $("a.forward", this).click(function() { j(+q, false); return false }); s(); if (l) 
            { $("a.forward", this).hover(function() 
            { clearInterval(h); 
            j(e, true); o = setInterval(function() { j(e, true) }, 
            (d * 2)) }, function() { clearInterval(o); s() }); $("a.back", this).hover(function() 
            { clearInterval(h); j(-e, true); o = setInterval(function() { j(-e, true) }, (d * 2)) }, 
            function() { clearInterval(o); s() }) } 
        })
    }
})(jQuery); $(document).ready(function() {
    $(".wrapper a.packshot img").mouseover(function() 
{ $(this).fadeTo(250, 0.75); $(this).fadeTo(500, 1) }) });