﻿
//PAGE SPECIFIC for ~/my/fp.aspx

$(document).ready(function()
    {
        $("div.UserNameSection input.Button").click(btnContinue_OnClick);
        $("div.QuestionSection input.Button").click(btnContinue2_OnClick);
        $(txtUserName).keypress(function(e){return txtUserName_OnKeyPress(e);});
        $(txtAnswer).keypress(function(e){return txtAnswer_OnKeyPress(e);});

        if (!txtUserName.disabled)
        {
            txtUserName.focus();
        }
        else
        {
            if (!txtAnswer.disabled)
            {
                txtAnswer.focus();
            }
        }
    }
);

function txtUserName_OnKeyPress(e)
{
    if (e.which == 13)
    {
        btnContinue_OnClick();
        return false;
    }
    else
    {
        return true;
    }
}
function txtAnswer_OnKeyPress(e)
{
    if (e.which == 13)
    {
        btnContinue2_OnClick();
        return false;
    }
    else
    {
        return true;
    }
}
function btnContinue_OnClick()
{
    $("div.UserNameSection input.Button").attr("disabled", "disabled");
    $("div.UserNameSection input.Button").val("Please wait...");

    lnkContinue_OnClick();
}
function btnContinue2_OnClick()
{
    $("div.QuestionSection input.Button").attr("disabled", "disabled");
    $("div.QuestionSection input.Button").val("Please wait...");

    lnkContinue2_OnClick();
}
