﻿/// <reference name="MicrosoftAjax.js"/>


// This script file controls the client-side behavior for the main navigation
// control.

var controls_PageFooter_loginButtonID;

// Toggles the visibility of the login dialog.
function controls_PageFooter_toggleLogin( loginFormID, emailAddressID, loginButtonID )
{
    var form = $get( loginFormID );
    controls_PageFooter_loginButtonID = loginButtonID;
    
    if( form.style.display == "none" )
    {
        form.style.display = "";
        $get( emailAddressID ).focus();
    }
    else    
        form.style.display = "none";
}

// Selects all the text in the provided text box.
function controls_PageFooter_selectAllText( textBox )
{
    textBox.select();
}

// Has the effect of clicking the login button, when the key pressed is
// the enter key.
function controls_PageFooter_clickLogin()
{
    if( window.event && window.event.keyCode == 13 )
    {
        $get( controls_PageFooter_loginButtonID ).click();
        return false;
    }
    else
        return true;
}