Okay, I'm less than fluent with JavaScript (I can do an alert and a pop-up window!). But I've managed to debug my problem. I didn't write this, I'm just trying to fix it. In the code below, the if statement checks to see if the browser is Netscape 4 and if so, subtract one from the users age becase the math is always one too high. Here is what I've determined.

IE6 Gets detected as Netscape 4 and does the subtraction making it 1 too low.

IE5x gets detected correctly and the script returns the correct age.

Netscape 4X Returns a Year too high

Netscape 6x Returns the correct age.

Below is the entire function. I've commented the lines that are causing the problem. It's just below this:
ERROR : The Below IF logic is where the ERROR is


function finalizeDOB(form)
{
var oError = new Error(); // Error object for date validation
var dtToday = new Date(); // Todays date
var nThisYear = dtToday.getFullYear(); // The current year

// Make sure the user only entered digits
if ( ! isNumeric(form.Year.value) )
{
alert("Invalid character in the Year.");
form.Year.focus();
return (false);
}

// If year is two digits prepend "19" on front
if ( form.Year.value.length == 2 )
{
form.Year.value = "19" + form.Year.value;
}

// At this point insure that we have a four digit year.
if ( form.Year.value.length != 4 )
{
alert("Please check the year value, it must be either 2 or 4 digits.");
form.Year.focus();
return (false);
}

// Insure that the year is within 1890 and now
if ( form.Year.value >= 1890 && form.Year.value <= nThisYear )
{
// Set the hidden DOB field value

form.txtDOB.value = form.Month.selectedIndex + "/" +
form.Day.selectedIndex + "/" + form.Year.value;

// Make sure the date is valid
if ( isDate(form.txtDOB, oError ) )
{
var dtDOB = new Date(form.Year.value, form.Month.value, form.Day.value);
var dtDiff = dtToday.getTime() - dtDOB.getTime();
form.txtAge.value = Math.floor(dtDiff /(1000 * 60 * 60 * 24 * 365.25));

//Netscape 4.x is always 1 to high
// ERROR : The Below IF logic is where the ERROR is
if ( String(form.txtBrowser.value).match("Netscape") &&
String(form.txtBrowserVersion.value).charAt(0) == "4" )
{
form.txtAge.value = form.txtAge.value - 1;
}

return (true); // We have a valid date
}
else
{
// Show date error and set focus to the appropriate control
alert(oError.Description);
if ( oError.Number == 1 )
{
form.Month.focus();
}
else
{
form.Day.focus();
}

form.txtDOB.value = "";
return (false);
}
}
else
{
alert("Please check the year value, it must be between 1890 and " + nThisYear);
form.Year.focus();
return (false);
}

}

Any help would be much appreciated.