function show_hide_bday(bdaydiv)
{
  var bday_value=document.private.birthday.options[document.private.birthday.selectedIndex].value;

  if (bday_value == "yes")
   {
     var x = document.getElementById(bdaydiv);
     x.style.display = 'inline';
   } else {
     var x = document.getElementById(bdaydiv);
     x.style.display = 'none';     
   }
}

function show_hide_snackbar(snackdiv)
{
  var snack_value=document.private.snack.options[document.private.snack.selectedIndex].value;

  if (snack_value == "special")
   {
     var x = document.getElementById(snackdiv);
     x.style.display = 'inline';
   } else {
     var x = document.getElementById(snackdiv);
     x.style.display = 'none';     
   }
}

function change_phone(homeph,cellph)
{
  var phone_value=document.private.phonetype.options[document.private.phonetype.selectedIndex].value;

  if (phone_value == "home")
   {
     var x = document.getElementById(homeph);
     x.style.display = 'inline';
     var x = document.getElementById(cellph);
     x.style.display = 'none';
   } else if (phone_value == "cell"){
     var x = document.getElementById(homeph);
     x.style.display = 'none';
     var x = document.getElementById(cellph);
     x.style.display = 'inline';
   } else { //both
     var x = document.getElementById(homeph);
     x.style.display = 'inline';
     var x = document.getElementById(cellph);
     x.style.display = 'inline';
   }
}

function fillFromDate(fillobj)
{
  var birth_value=document.private.birthdate.value;
  var temp = birth_value.indexOf(",");
  var temp2 = birth_value.substring(temp+1,birth_value.length);
  var temp = temp2.indexOf(",");
  var byear = temp2.substring(temp+2,temp2.length);
  var currentTime = new Date()
  var year = currentTime.getFullYear()
  var outyear = year-byear;
  var ageout=fillobj.form.elements;
  ageout['age'].value=outyear;
}
