// JavaScript Document

function change_vis( obj )
{
  if( navigator.userAgent.indexOf( "MSIE" ) == -1 )
  {
    var o = document.getElementById( obj );
    if( o.style.display == "none" )
    {
      if( o.tagName == "TR" )
        o.style.display = "table-row";
      else
        o.style.display = "block";
    }
    else
      o.style.display = "none";
  }
  else
  {
    if( document.all[obj].style.display == "none" )
      document.all[obj].style.display = "block";
    else
      document.all[obj].style.display = "none";
  }
}

function dob_focus(item){
	if (item.value == "MM/DD/YYYY")
		item.value='';
}

function dob_blur(item){
	if (!item.value.length)
		item.value="MM/DD/YYYY";
}

function validate_form(theForm)
{
  
  if (theForm.Name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }
  
  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }
  
  if (theForm.applicant_dob.value == "" || theForm.applicant_dob.value == "MM/DD/YYYY")
  {
    alert("Please enter a value for the \"Applicant Date of Birth\" field in the format MM/DD/YYYY.");
    theForm.applicant_dob.focus();
    return (false);
  }
  
  if (theForm.Applicant_Sex.value == "Select")
  {
    alert("Please make a selection for the \"Applicant Gender\".");
    theForm.Applicant_Sex.focus();
    return (false);
  }
  
  var str=theForm.applicant_dob.value;
  l = str.length;
  if (l != 10)
  {
    alert("Please enter a two digit month, two digit day and 4 digit year for the \"Applicant Date of Birth\" field.");
    theForm.applicant_dob.focus();
    return (false);
  }

  return (true);
}

