// JavaScript Document//<!--function calcAge(birthDate, birthMonth, birthYear){		theDate = parseInt(birthDate,10);	theMonth = parseInt(birthMonth,10);	theYear = parseInt(birthYear,10);	if (isNaN(theDate) || !(theDate >= 1 && theDate <= 31)) return 'badDate';	if (theYear.toString().length != 4 || (birthYear.length!=4))  return 'badYear';	if (isNaN(theMonth)) return 'badMonth';	//if (isNaN(theYear) || (birthYear.length!=4))  return 'badYear';	curDate = new Date();	yearsOld = curDate.getFullYear() - theYear;	monthsOld = (curDate.getMonth() + 1) - theMonth;	daysOld = curDate.getDate() - theDate;	if ((monthsOld < 0) || (monthsOld == 0 && daysOld < 0)) yearsOld --;	if (yearsOld < 0) yearsOld = 'badYear';	return yearsOld;}function validateAge(){	ageForm = document.forms.theForm;	birthMonth = ageForm.monthField.options[ageForm.monthField.selectedIndex].value;	birthDate = ageForm.dateField.value;	birthYear = ageForm.yearField.value;	myAge = calcAge(birthDate, birthMonth, birthYear);	if (myAge >=19){		document.location.href="pages/main_index.htm"		}else{			if (myAge < 19 && myAge > 0){			alert("Sorry, you must be legal drinking age to enter.");			return;			}			if (myAge == 'badDate'){			ageForm.dateField.focus();			alert("Please enter a valid date");			ageForm.dateField.value=''			}			if (myAge == 'badYear'){			ageForm.yearField.focus();			alert("Please enter a valid year");			ageForm.yearField.value=''			}			if (myAge == 'badMonth'){			ageForm.monthField.focus();			alert("Please enter a valid month");			ageForm.monthField.value=''			}		}		}//-->