$(function()
{


    /**
     * Display an error message on the splash page.
     *
     * @param[in]   errorText       Text of error to display.
     */

    function displaySplashError(text)
    {
        var message = $('#message');

        (message
            .hide()
            .text(text)
            .fadeIn(2000, function()
            {
                setTimeout(function() { message.fadeOut(2000); }, 5000);
            }));
    }

    var errors = {
        noAccount: 'You attempted an action that requires an account. Please sign in',
        loggedOut: 'Signed out! Please come again',
        emailConfirmed: 'Your e-mail address has been confirmed',
        blockAdded: 'Your e-mail address is now permanently blocked'
    }

    var error = window.location.hash.substring(1);
    if(error)
    {
        var text = errors[error];
        if(! text)
            return;

        displaySplashError(text);
    }
});
