function getAge(birth)
{

var now = new Date();

aSecond = 1000;
aMinute = aSecond * 60;
aHour = aMinute * 60;
aDay = aHour * 24;
aWeek = aDay * 7;
aMonth = aDay * 30;

var age = now.getTime() - birth.getTime();

if (age < 0) {
return "ERROR"
}

years = (new Date(now.getTime() - aMonth* (birth.getMonth()) )).getFullYear() 
- (new Date(birth.getTime() - aMonth* (birth.getMonth()) )).getFullYear();

offsetNow = (new Date(now.getTime() - aDay* (birth.getDate() -1) ));
offsetBirth = (new Date(birth.getTime() - aDay* (birth.getDate() -1) ));
if(years > 1){
months = years*12 + ( offsetNow.getMonth() - offsetBirth.getMonth()) ;
}else{
months = (now.getFullYear() - birth.getFullYear())*12 + ( offsetNow.getMonth() - offsetBirth.getMonth()) ;
}

agestr="";

if (months < 24){
weeks = Math.floor(age / aWeek);
age -= weeks * aWeek;
days = Math.floor(age / aDay); 

if(weeks > 0){
if(weeks == 1){
agestr = agestr + weeks + " Week ";
}else if(weeks < 9){
agestr = agestr + weeks + " Weeks ";
}else{
agestr = agestr + months ;
getFullYear
if(now.getDate() - birth.getDate() > 10){
agestr = agestr + " ½ ";
}
agestr = agestr + " Months ";

}
}

if(days > 0){

if(weeks < 9){
if(weeks > 0){
agestr = agestr + " and ";
}
if(days == 1){
agestr = agestr + days + " Day ";
}else{
agestr = agestr + days + " Days ";
}
}
}
}else{
agestr = agestr + years;
if (months%12 > 5 && years<14){
agestr = agestr + " ½ ";
}
agestr = agestr + "";
}

return agestr;
}
