function go_right() {
    $('.error_required').animate({
        marginRight: "-240px"
    }, 500) 
};

function go_left() {
    $('.error_required').animate({
        marginRight: "-235px"
    }, 500, go_right())
}

$(document).ready(
    function() {
        $('.associate_container').hide();
        
        $('#associate_openid_link').click(
            function(event) {
                event.preventDefault();
                $('#change_openid_container').show();
                $(this).hide();
            }
        );
        
        $('#add_another_email_link').click(
            function(event) {
                event.preventDefault();
                $('#add_email_container').show();
                $(this).hide();
            }
        );
        
        $('#cancel_add_email').click(
            function(event) {
                event.preventDefault();
                $('#add_email_container').hide();
                $('#add_another_email_link').show();
            }
        );
        
        $('#cancel_associate_openid').click(
            function(event) {
                event.preventDefault();
                $('#change_openid_container').hide();
                $('#associate_openid_link').show();
            }
        );
        
        $('.error_required').ready(
            function() {
                for (var i=0;i<11;i++) {
                    go_left();
                }
            }
        );
        
        $('.message_fadeaway').fadeOut(2250);
    }
)