function ChangeRequiredTextColor(color, obj)
{
    if(obj.checked==true)
    {
        document.getElementById('fname2').innerHTML = "<font color='#" + color + "'>Applicant Full Name:</font>";
        document.getElementById('ddate2').innerHTML = "<font color='#" + color + "'>DOB (MM/DD/YYYY):</font>";
        document.getElementById('addr2').innerHTML = "<font color='#" + color + "'>Address:</font>";
        document.getElementById('cit2').innerHTML = "<font color='#" + color + "'>City:</font>";
        document.getElementById('st2').innerHTML = "<font color='#" + color + "'>State:</font>";
        document.getElementById('z2').innerHTML = "<font color='#" + color + "'>Postal Code:</font>";
        document.getElementById('ph2').innerHTML = "<font color='#" + color + "'>Home Phone:</font>";
        document.getElementById('pay2').innerHTML = "<font color='#" + color + "'>Payment Type:</font>";
        document.getElementById('comp2').innerHTML = "<font color='#" + color + "'>Company Name:</font>";
    }
    else
    {
        document.getElementById('fname2').innerHTML = "<font color='#000000'>Applicant Full Name:</font>";
        document.getElementById('ddate2').innerHTML = "<font color='#000000'>DOB (MM/DD/YYYY):</font>";
        document.getElementById('addr2').innerHTML = "<font color='#000000'>Address:</font>";
        document.getElementById('cit2').innerHTML = "<font color='#000000'>City:</font>";
        document.getElementById('st2').innerHTML = "<font color='#000000'>State:</font>";
        document.getElementById('z2').innerHTML = "<font color='#000000'>Postal Code:</font>";
        document.getElementById('ph2').innerHTML = "<font color='#000000'>Home Phone:</font>";
        document.getElementById('pay2').innerHTML = "<font color='#000000'>Payment Type:</font>";
        document.getElementById('comp2').innerHTML = "<font color='#000000'>Company Name:</font>";
    }  
}

function ValidateDate(fld) 
{
    var RegExPattern = /^(?=\d)(?:(?:(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})|(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))|(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2}))($|\ (?=\d)))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$/;
    //var errorMessage = 'Please enter valid date as month, day, and four digit year.\nYou may use a slash, hyphen or period to separate the values.\nThe date must be a real date. 2-30-2000 would not be accepted.\nFormay mm/dd/yyyy.';
    if ((fld.value.match(RegExPattern)) && (fld.value!='')) 
    {
        //alert('Date is OK'); 
        return true;
    } 
    else 
    {
        //alert(errorMessage);
        //fld.focus();
        return false;
    } 
}

function displaytimer(obj, yyyy, mm, dd, txtBefore, txtAfter) {
    //change the text below to reflect your own,
    var before = txtBefore;
    var current = txtAfter;
    var montharray = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
    var target = obj;
    
    //enter the count down date using the format year/month/day
    countdown(target, yyyy, mm, dd, before, after)
}

function countdown(obj, yr, m, d) {
    theyear = yr; themonth = m; theday = d
    var today = new Date()
    var todayy = today.getYear()
    if (todayy < 1000)
        todayy += 1900
    var todaym = today.getMonth()
    var todayd = today.getDate()
    var todayh = today.getHours()
    var todaymin = today.getMinutes()
    var todaysec = today.getSeconds()
    var todaystring = montharray[todaym] + " " + todayd + ", " + todayy + " " + todayh + ":" + todaymin + ":" + todaysec
    futurestring = montharray[m - 1] + " " + d + ", " + yr
    dd = Date.parse(futurestring) - Date.parse(todaystring)
    dday = Math.floor(dd / (60 * 60 * 1000 * 24) * 1)
    dhour = Math.floor((dd % (60 * 60 * 1000 * 24)) / (60 * 60 * 1000) * 1)
    dmin = Math.floor(((dd % (60 * 60 * 1000 * 24)) % (60 * 60 * 1000)) / (60 * 1000) * 1)
    dsec = Math.floor((((dd % (60 * 60 * 1000 * 24)) % (60 * 60 * 1000)) % (60 * 1000)) / 1000 * 1)
    if (dday == 0 && dhour == 0 && dmin == 0 && dsec == 1) {
        document.forms.count.count2.value = current
        return
    }
    else
        document.getElementById(obj).value = "Only " + dday + " days, " + dhour + " hours, " + dmin + " minutes, and " + dsec + " seconds until " + before
    setTimeout("countdown(theyear,themonth,theday)", 1000)
}
