function getAge(birthdate)
{

var now = new Date();
var birth = new Date(birthdate);

aSecond = 1000;
aMinute = aSecond * 60;
aHour = aMinute * 60;
aDay = aHour * 24;
aWeek = aDay * 7;
aMonth = aDay * 30;

years = (new Date(now.getTime() - aMonth* (birth.getMonth()) )).getFullYear() 
- (new Date(birth.getTime() - aMonth* (birth.getMonth()) )).getFullYear();

if (years<0) {
years = 0;
} 

return years;
}
