﻿//************************************************************************************* 
// File     :   login_forgotbox.js
// Version  :   1.1
// Requires :   mf_domLibrary_0.1.js, prototype.js
// Author   :   Kyle Weems (ksw)
// Origin   :   mindfly.com
// Created  :   October 5, 2007
// Modified :   December 13, 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. 
// Version 1.1   (12/13/2007) - Change script to hide/show boxes by changing class names (rather than directly manipulating the display style). For this to work, the theme needs styles for displayNone and displayBlock.


//=============================================================================================
// 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 the div 'forgotBoxLink' is invisible...
        if($('forgotBoxLink').hasClassName('displayNone'))
        {
            // ... then make it visible.
            $('forgotBoxLink').removeClassName('displayNone');
            $('forgotBoxLink').addClassName('displayBlock');
            // Make the div 'forgotBox' invisible.
            $('forgotBox').removeClassName('displayBlock');
            $('forgotBox').addClassName('displayNone');
        }
        // Else...
        else
        {
            // ... make 'forgotBoxLink' invisible.
            $('forgotBoxLink').removeClassName('displayBlock');
            $('forgotBoxLink').addClassName('displayNone');
            // Make the div 'forgotBox' visible.
            $('forgotBox').removeClassName('displayNone');
            $('forgotBox').addClassName('displayBlock');
        }
    } // end if

} // end of toggleForgotBoxVisibility()

