(function($) {
$.fn.jKwick = function(o) {
    o = $.extend({
        min: 0,             // Minimum size of each element. All other elements other than the currently hovered element get this size
        max: 0,             // Maximum size of the element. The element that is currently hovered gets this size
        mid: 0,             // Middle size of each element. All the elements get this size when no element is hovered upon
        speed: 150,         // Speed with which the animation should be applied while moving the focus for the element
        easing: "bounceinout"    // The easing effect to be applied to the animation that moves the element's focus  
    }, o || {});

    var $ul = $("ul", this), $li = $("li", $ul), liLength = $li.length, 
        $old = null, $new = null, first = true, running = false, noop = function() {};

    $li.hover(function() {                      
        if(!running) {
            running = true; $new = $(this);
            if(first) {
                $new.animate({width: o.max}, o.speed);
                $li.not(this).animate({width: o.min}, o.speed, function() {
                    $old = $new;
                    first = running = false;
                });
            } else {
                var newWidth = $new.width(), oldWidth = $old.width();
                $new.animate( { width: o.max }, { duration: o.speed, easing: o.easing,
                    step: function(n) {
                        $old.width(Math.ceil( oldWidth - (n-newWidth)));
                    },
                    complete: function() {
                        $old = $new; running = false;
                    }
                });
            }
        }
    }, noop);

    $ul.hover(noop, function() {
        $li.animate({width: o.mid}, o.speed); first = true;
    });

};
})(jQuery);
