function DeriveAge ( BirthYear, BirthMonth, BirthDay, CurYear, CurMonth, CurDay ){
//derive the applicant's birth year from the Birthday fields
//and server date then return age
//REMEMBER:  Do not pass the values as "strings".
//Also, when sending from dropdowns, you want to send the .value


//as a first approximation, set the age to the difference between the 
//current year and the birth year
age = CurYear - BirthYear;

//if the applicant's has not yet had a birthday in the current year, 
//reduce the age by 1
if (CurMonth < BirthMonth){
	age = age - 1;
}else{
	if (CurMonth == BirthMonth){ //If birthday is this month
	    if (CurDay < BirthDay){  //If today before birthday then subtract a year
	    	age = age - 1;
	    }
	}
}

// return age to the calling method
//alert (age);
return age;
}