﻿

showError = function ( msg )
{
    $(window).ready ( function () {
    
        if ( $ ( '#errorDisplay' ).length != 0 )
        {
            $ ( '#errorDisplay' ).html ( msg );
                  
        } else {
            $ ( '<div id="errorDisplay"/>' ).html ( msg ).insertBefore ( $ ( 'div.form' ) );
        }
        
        $ ( '#errorDisplay' ).customFadeIn ("slow");  
    

    });
}


/* Show a success message */
showSuccess = function ( msg )
{
    $(window).ready ( function () {
    
        if ( $ ( '#successDisplay' ).length != 0 )
        {
            $ ( '#successDisplay' ).html ( msg );
                  
        } else {
            $ ( '<div id="successDisplay"/>' ).html ( msg ).insertBefore ( $ ( 'div.form' ) );
        }
        
        $ ( '#successDisplay' ).customFadeIn ("slow");  
    

    });
}

showMessage = function ( msg )
{
    $ (window).ready ( function () {
        if ( $ ('#messageDisplay').length != 0 )
        {
            $ ( '#messageDisplay').html ( msg );
        } else {
             $ ( '<div id="messageDisplay"/>' ).html ( msg ).insertBefore ( $ ( '#mainTable' ) );
        
        }
        
        $ ( '#messageDisplay' ).customFadeIn ("slow");  
    
    });
}
