$.fn.delay = function(time, callback){
    // Empty function:
    jQuery.fx.step.delay = function(){};
    // Return meaningless animation, (will be added to queue)
    return this.animate({delay:1}, time, callback);
}

$(document).ready(function(){

    function move_left (button)
    {
        $(button.currentTarget).unbind("click");

        $("#rotator_items").stop().animate({marginLeft: '-=255px'}, 500, function()
        {
            $("#rotator_items").css("margin-left", "-255px");
            $("#rotator_items .rotator_item:first").appendTo("#rotator_items");

            $(button.currentTarget).bind("click", move_left);
        }
        );
    }

    function move_right (button)
    {
        $(button.currentTarget).unbind("click");

        $("#rotator_items").stop().animate({marginLeft: '+=255px'}, 500, function()
        {
            $("#rotator_items").css("margin-left", "-255px");
            $("#rotator_items .rotator_item:last").prependTo("#rotator_items");

            $(button.currentTarget).bind("click", move_right);
        }
        );
    }

    $(".vino_left").bind("click", move_right);
    $(".vino_right").bind("click", move_left);

    $('#img_slider').innerfade({ animationtype: 'fade', speed: 2000, timeout: 7000, type: 'random', containerheight: '189px' });

    $('.fancybox').fancybox({"titlePosition": "inside"});
});