function age(DoB) { 
	// Convert the submitted string to a date 
	var birthDate = new Date(DoB.substring(6,10),DoB.substring(3,5)-1,DoB.substring(0,2)); 
	var birthYear = birthDate.getFullYear(); 
	var birthMonth = birthDate.getMonth(); 
	var birthDay = birthDate.getDate(); 
	// Get the components of the current date 
	var now = new Date(); 
	var thisYear = now.getFullYear(); 
	var thisMonth = now.getMonth(); 
	var thisDay = now.getDate(); 
	// How much years since the birthday? 
	years = thisYear-birthYear; 
	// Already birthday this year? 
	if ( (thisMonth < birthMonth) || ( (thisMonth == birthMonth) && (birthDay > thisDay) ) ) { 
		years--; 
	} 
	document.write(years); 
}

