function inch2cm(p) {
  p = parseInt(eval(p.value * 2.54 + 0.5));
  return p; 
}

function cm2inch(p) {
  p = parseInt(eval(p.value / 2.54 + 0.5));
  return p; 
}


function height2cm() {
   with (document.RegisterForm) {
     Heightcm.value=parseInt(eval(HeightFeet.value * 30.48 + HeightInches.value * 2.54 + 0.5));
  }
}

function cm2height() {
   with (document.RegisterForm) {
     HeightFeet.value=parseInt(eval(Heightcm.value / 30.48));
     HeightInches.value=parseInt(eval((Heightcm.value - HeightFeet.value * 30.48 ) / 2.54 +0.5));
  }
}

function lbs2kg() {
   with (document.RegisterForm) {
     WeightKg.value=parseInt(eval(WeightLbs.value / 2.2048 + 0.5));
  }
}

function kg2lbs() {
   with (document.RegisterForm) {
     WeightLbs.value=parseInt(eval(WeightKg.value * 2.2048 + 0.5));
  }
}


function GetAge(bday) {

  var n = new Date();  
  yy = n.getFullYear();
  mm = n.getMonth()+1;
  dd = n.getDate();

  y = bday.substring(0,4);
  m = bday.substring(5,7);
  d = bday.substring(8,10);

  t = yy - y -1;

  if (( mm > m ) || ((mm == m) && (dd >= d))) {t = t +1;}



  return t;


}
