﻿//************************************************************************************* 
// File     :   aram_login_forgotbox.js
// Version  :   1.0
// Requires :   mf_domLibrary_0.1.js, prototype.js
// Author   :   Kyle Weems (ksw)
// Origin   :   mindfly.com
// Created  :   October 5, 2007
// Modified :   October 5, 2007 (ksw)
// Purpose  :   Hides or displays the forgot password box on the login page.      
//*************************************************************************************

// Version History (only for changes of at least 0.0.1 in version number)
// ===============
// Version 1.0   (08/15/2007) - Basic functionality. 


//=============================================================================================
// toggleForgotBoxVisibility()
//=============================================================================================
// Makes the forgot password box either visible or invisible depending on it's current visibility.
function toggleForgotBoxVisibility()
{
    // Only run the function if the user is on the login page.
    if($('forgotBoxLink'))
    {
        // Get the visibility status of the forgot box link.
        var visibility = $('forgotBoxLink').style.display;
        
        // If it's invisible, make it visible and the box invisible.
        if($('forgotBoxLink').style.display == 'none')
        {
            $('forgotBoxLink').style.display    = 'block';
            $('forgotBox').style.display        = 'none';
        }
        // If it's visible, make it invisible and the box visible.
        else
        {
            $('forgotBoxLink').style.display    = 'none';
            $('forgotBox').style.display        = 'block';
        
        }
    } // end if($('forgotBoxLink'))

} // end of toggleForgotBoxVisibility()


//=============================================================================================
// checkIfForgotBoxHasMessage()
//=============================================================================================
//  Called on page load, and checks if a forgot password box message exists. If so, it makes the box visible. 
function checkIfForgotBoxHasMessage()
{
    if($('forgotPasswordMessage'))
    {
        $('forgotBoxLink').style.display    = 'none';
        $('forgotBox').style.display        = 'block';
    }
} // end of checkIfForgotBoxHasMessage()


addLoadEvent(checkIfForgotBoxHasMessage);