function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}
/*function isEmail (s)
{   if (isEmpty(s)) 
if (isEmail.arguments.length == 1) {
return false;
}
else return (isEmail.arguments[1] == true);
// there must be >= 1 character before @, so we
// start looking at character position 1 
// (i.e. second character)
var i = 1;
var sLength = s.length;
// look for @
while ((i < sLength) && (s.charAt(i) != "@"))
{ i++;
}
if ((i >= sLength) || (s.charAt(i) != "@")) return false;
else i += 2;
// look for .
while ((i < sLength) && (s.charAt(i) != "."))
{ i++;
}
// there must be at least one character after the .
if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
else return true;
}
*/
function validateForm(form)
{   
if(isEmpty(form.firstname.value))
{
alert("Plese Enter Your First Name.");
form.firstname.focus();
return;
} 
if(isEmpty(form.lastname.value)){
alert("Plese Enter Your Last Name.");
form.lastname.focus();
return;
} 
if(isEmpty(form.address.value))
{
alert("Plese Enter Your Address.");
form.address.focus();
return;
}
if(isEmpty(form.city.value))
{
alert("Plese Enter Your City Name.");
form.city.focus();
return;
}
if(isEmpty(form.state.value))
{
alert("Plese Enter Your State.");
form.state.focus();
return;
}
if(isEmpty(form.zipcode.value))
{
alert("Plese Enter Your Zip Code.");
form.zipcode.focus();
return;
}
if(isEmpty(form.phone.value))
{
alert("Plese Enter Your Phone.");
form.phone.focus();
return;
}
/*if(!isEmail(form.email.value))
{
alert("Plese Enter Your Email.");
form.email.focus();
return;
}
*/
if(isEmpty(form.dateofbirth.value))
{
alert("Plese enter the Date Of Your Birth.");
form.dateofbirth.focus();
return;
}
/*if(isEmpty(form.dateofdiagnosis.value))
{
alert("Please Enter the Date Of Diagnosis.");
form.dateofdiagnosis.focus();
return;
}
*/
if(form.diagnosed.options[form.diagnosed.options.selectedIndex].value=="Select One")
{
alert("Please Select If You Have Been Diagnosed With Manganese.");
form.diagnosed.focus();
return;
}
if(form.relativediagnosed.options[form.relativediagnosed.options.selectedIndex].value=="Select One")
{
alert("Please Select If You Have a Relative Diagnosed with Manganese.");
form.relativediagnosed.focus();
return;
}
if(form.pathologyreport.options[form.pathologyreport.options.selectedIndex].value=="Select One")
{
alert("Please Select If You Have a Patology Report.");
form.pathologyreport.focus();
return;
}
if(form.married.options[form.married.options.selectedIndex].value=="Select One")
{
alert("Please Select If You Are Married.");
form.married.focus();
return;
}
if(isEmpty(form.children.value))
{
alert("Please Enter How many Children You Have");
form.children.focus();
return;
}
if(form.WorkingWithAttorney.options[form.WorkingWithAttorney.options.selectedIndex].value=="Select One")
{
alert("Please Select If You Are Working With An Attorney.");
form.WorkingWithAttorney.focus();
return;
}
if(form.diagnosed.options[form.diagnosed.options.selectedIndex].value=="Yes" && isEmpty(form.ExposedState.value))
{
alert("Please Enter State Where Were You Exposed.");
form.ExposedState.focus();
return;
} 
if(isEmpty(form.casedescription.value))
{
alert("Please Enter Your Case Description.");
form.casedescription.focus();
return;
} 
form.action="sendeaile.php";
form.submit();
}
