$.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");
        
        $("#footer_slider_container").stop().animate({marginLeft: '-=281px'}, 500, function()
        {
            $("#footer_slider_container").css("margin-left", "-281px");
            $("#footer_slider_container .footer_slide:first").appendTo("#footer_slider_container");
            
            $(button.currentTarget).bind("click", move_left);
        }
        );
        
        return false;
    }

    function move_right (button)
    {
        $(button.currentTarget).unbind("click");
        
        $("#footer_slider_container").stop().animate({marginLeft: '+=281px'}, 500, function()
        {
            $("#footer_slider_container").css("margin-left", "-281px");
            $("#footer_slider_container .footer_slide:last").prependTo("#footer_slider_container");
            
            $(button.currentTarget).bind("click", move_right);
        }
        );
    }

    $(".footer_slider_button_left").bind("click", move_right);
    $(".footer_slider_button_right").bind("click", move_left);
        
});
