function FormValidator(theForm)
{
	GetElementByID('fnameError').style.visibility = 'hidden';
	GetElementByID('lnameError').style.visibility = 'hidden';
	GetElementByID('emailError').style.visibility = 'hidden';
	isValid = true;
	
	if (theForm.fname.value == ""){
		//alert("Please enter a value for the \"First Name\" field.");
		theForm.fname.focus();
	  GetElementByID('fnameError').style.visibility = 'visible';
	  isValid = false;
	}

	if (theForm.lname.value == ""){
		//alert("Please enter a value for the \"Last Name\" field.");
		theForm.lname.focus();
	  GetElementByID('lnameError').style.visibility = 'visible';
	  isValid = false;
	}

	if (theForm.email.value == ""){
		//alert("Please enter a value for the \"Last Name\" field.");
		theForm.email.focus();
	  GetElementByID('emailError').style.visibility = 'visible';
	  isValid = false;
	}

  if(!isValid)
	  return (false);
	else
	  return (true);
}

function GetElementByID(divID)
{
    var div;
    
    if( document.getElementById )
        div = document.getElementById(divID);
    else if( document.all )
        div = document.all[divID];
    else if( document.layers )
        div = document.layers[divID];    

    return div;
}
