﻿/* --------------------------------------------------------------------------------
 Filename: BottomMessage.js                                                   

 Description:

 Manipulates a message box on the page.
 
 History:                                                                        
   Ver         Inits   Date        Comments                                        
   1.00.00     jwl     03/31/2010    Created

-------------------------------------------------------------------------------- */


// writeMessageToPage:
//
// Writes an error message into the span at the top of the page.
//
function writeMessageToPage(szMessage)
{                
    var pMessageSpan = showMessage();
    if(pMessageSpan) 
        pMessageSpan.innerHTML = szMessage;
                                         
} // writeMessageToPage


// showMessage:
//
// Shows the message box we've defined.
//
function showMessage()
{                
    var pMessageSpan = g_utility.GetElementUsingId("BottomMessage");
    if(pMessageSpan) 
        pMessageSpan.className = "bottomMessageDisplay";

    return pMessageSpan;
                                             
} // showMessage


// hideEmptyMessageBox:
//
// If the message box is emtpy, we will hide. it.
//
function hideEmptyMessageBox()
{     
    var pMessageSpan = g_utility.GetElementUsingId("BottomMessage");     

    if(!pMessageSpan)   // We need this.
        return;

    if(pMessageSpan.innerHTML.length < 1)
        pMessageSpan.className = "bottomMessageHidden";        
                                 
} // hideEmptyMessageBox  


// clearErrorMessageOnPage:
//
// Empties the error message text in the span at the top of the page.
//
function clearErrorMessageOnPage()
{        
    var pMessageSpan = g_utility.GetElementUsingId("BottomMessage"); 
    if(pMessageSpan) 
    {
        pMessageSpan.className = "bottomMessageHidden";    
        pMessageSpan.innerHTML = "";
    }        
                                     
} // clearErrorMessageOnPage  

                   

