function showForgotForm(pStrPopUpTitle)
{
    var strUrl = "./jsp/showForgotForm.jsp";
    var strUrlParams = "lang=" + strLang;

    // Create a new XML HTTP object for AJAX operation.
    var oTempXmlHttp = getNewXmlHTTPObject();

    // Process the AJAX request.
    if (!isXmlHTTPNull(oTempXmlHttp))
        doXMLRequest(oTempXmlHttp, strUrl, strUrlParams, "post", false, "application/x-www-form-urlencoded");

    // Show the popup div.
    var objDivForgotPopUp = createDivPopUp(pStrPopUpTitle, oTempXmlHttp.responseText, "divForgotPopUp", "popUpDefaultModal popUpLogin", true, true);

    oTempXmlHttp = null;

    // Position the div.
    centerObjectWithin(objDivForgotPopUp, (document.body || window));

    if (document.getElementById("txtEmail"))
        document.getElementById("txtEmail").focus();

    if(document.getElementById("divLoginPopUp") != null){
        document.getElementById("divLoginPopUp").style.display = "none";
    }
}

function doForgot(pStrEmail, pStrErrorNoEmail, pObjErrorMsg)
{
    // Validate the email before processing to ensure that the appropriate field is entered.
    if (pStrEmail.trim().length == 0)
    {
        pObjErrorMsg.innerHTML = pStrErrorNoEmail;
        pObjErrorMsg.style.display = "";
    }
    else
        pObjErrorMsg.style.display = "none";

    // If no error message visible, process account request.
    if (pObjErrorMsg.style.display.toUpperCase() == "NONE")
    {
        var strUrl = "./jsp/processEmail.jsp";
        var strUrlParams = "email=" + pStrEmail.trim() + "&lang=" + strLang;

        // Create a new XML HTTP object for AJAX operation.
        var oTempXmlHttp = getNewXmlHTTPObject();

        // Process the AJAX request.
        if (!isXmlHTTPNull(oTempXmlHttp))
        {
            logMsg("Processing password retrieval. url: " + encodeURIComponent(strUrl + "?" + strUrlParams), "info", "forgot.js (doForgot)");
            doXMLRequest(oTempXmlHttp, strUrl, strUrlParams, "post", false, "application/x-www-form-urlencoded");
            logMsg("*** result: " + encodeURI(oTempXmlHttp.responseText), "info", "forgot.js (doForgot)");
        }

        // Get the response from the request.
        var strResult = oTempXmlHttp.responseText;

        oTempXmlHttp = null;

        // Check to see if the registration was successful.
        if (strResult == 1)
        {
            closeForgotPopUp();

            // Show the popup message div.
            createDivPopUpFade(strEmailNotify, "divForgotMsgPopUp", "popUpForgotMsg", 3500, true);

            // Verify if the login window exists on the page.
            if ((document.getElementById("divLoginPopUp") == null) || (document.getElementById("divLoginPopUp") == undefined))
            {
                // Remove the modal div (if exists).
                if (document.getElementById("divModal"))
                    removeElement("divModal");
            }
        }
        else
        {
            pObjErrorMsg.innerHTML = strResult;
            pObjErrorMsg.style.display = "";
        }
    }
}

function closeForgotPopUp()
{
    // Remove the div.
    removeElement("divForgotPopUp");

    if (document.getElementById("divLoginPopUp") != null)
        document.getElementById("divLoginPopUp").style.display = "";
    else
    {
        // Remove the modal div (if exists).
        if (document.getElementById("divModal"))
            removeElement("divModal");
    }
}
