﻿var baseId = "ctl00_MB_";
var ERROR_2_50CHARS = "The above field must be between 2 and 50 characters in length."
var ERROR_CAPTCHA = "Characters did not match those displayed in the graphic."
var ERROR_EMAIL = "Please enter a valid email address.";
var ERROR_EMAILCONFIRM = "Email address fields must match.";
var ERROR_FORMNOTVALID = "Please correct the following errors before submitting this form:";
var ERROR_MANDATORYFIELD = "The above field is mandatory."
var ERROR_PASSWORD = "Password must be a strong password between 8 and 20 characters.";
var ERROR_PASSWORDCONFIRM = "Password fields must match.";
var ERROR_USERNAME = "Username must be at least 5 characters."
var INPUTCLASS = "FitText"
var INPUTCLASS_ERROR = "FitText_Error"
var INPUTCLASS_FOCUS = "FitText_Focus"

function SessionExpireTime()
{
    var date = new Date();
    var amPm, hour, min;		
    
    date.setTime(date.getTime() + 600000);
    if (date.getHours() < 12)
    {
        if (date.getHours() == 0)
        {
            hour = "12";
        }
        else
        {
            hour = date.getHours().toString();
        }
        amPm = "AM";
    }
    else 
    {
        if (date.getHours() == 12)
        {
            hour = "12";
        }
        else
        {
            hour = (date.getHours() - 12).toString();
        }                
        amPm = "PM";
    }
    min = date.getMinutes().toString();
    if (min.length == 1)
    {
        min = "0" + min;
    }
    
    return hour + ":" + min + " " + amPm;
}

function SyncLocked1LegalCheckboxes(srcId)
{
    //@TC - 2009-11-06: added to ensure locked 1 and legal name locked checkboxes stay in sync when necessary
    if (srcId.indexOf(baseId) > -1)
    {
        var locked1 = document.getElementById(baseId + "Locked_Section1");
        var legalName = document.getElementById(baseId + "Locked_LegalName");
    }
    else
    {
        var locked1 = document.getElementById("Locked_Section1");
        var legalName = document.getElementById("Locked_LegalName");
    }

    if (srcId == locked1.id)
    {
        //Locked_Section1 checkbox clicked
        if (locked1.checked)
        {
            //Section 1 is locked so make sure legal name is locked as well
            legalName.checked = true;
        }
    }
    else
    {
        //Legal name checkbox clicked
        if (legalName.checked == false)
        {
            //Legal name unlocked so make sure section 1 lock is also unlocked
            locked1.checked = false;
        }
    }    
}
