// JavaScript Document
function hideFieldHint(id)
{
  hints = getFieldHints();
  
  defaultValue = (id == 'name') ? hints[0] : hints[1];
  
  if ($(id).value == defaultValue)
  {
    $(id).value = '';
  }
  
  $(id).removeClassName('empty');
}

function showFieldHint(id)
{
  hints = getFieldHints();
  
  defaultValue = (id == 'name') ? hints[0] : hints[1];
  
  if ($(id).value == '' || $(id).value == defaultValue)
  {
    $(id).value = defaultValue;
    $(id).addClassName('empty');
  }
  else
  {
    $(id).removeClassName('empty');
  }
}

function getFieldHints()
{
  return ['Your name', 'Your email address'];
}