function Form1_Validator(theForm)
{
if (theForm.firstname.value == "")
  {
    alert("Please, enter your first name.");
    theForm.firstname.focus();
    return (false);
  }
if (theForm.lastname.value == "")
  {
    alert("Please, write in your last name in this field.");
    theForm.lastname.focus();
    return (false);
  }
if (theForm.city.value == "")
  {
    alert("Please, indicate your city.");
    theForm.city.focus();
    return (false);
  }
if (theForm.country.value == "")
  {
    alert("Please, indicate your country.");
    theForm.country.focus();
    return (false);
  }
if (theForm.email.value == "")
  {
    alert("Please write in your valid e-mail address in this field.");
    theForm.email.focus();
    return (false);
  }
if (theForm.email.value.indexOf('@',0)==-1 ||
        theForm.email.value.indexOf('.',0)==-1)
        {
            alert("Please write in your valid e-mail address in this field.")
            theForm.email.select()
            theForm.email.focus()
            return (false);
        }
if (theForm.email2.value == "")
    {
    alert("Please confirm your e-mail.");
    theForm.email2.focus();
    return (false);
  }
if(theForm.email.value!=theForm.email2.value)
  {
  alert('E-mail address should be the same in boxes \"Email\" and \"Confirm Email\".');
  theForm.email.focus();
  return false;
  }
if (theForm.age.value == "")
  {
    alert("Please, indicate your age.");
    theForm.age.focus();
    return (false);
  }
if (theForm.gender.value == "")
  {
    alert("Please indicate your gender.");
    theForm.sex[0].focus();
    return (false);
  }
if (theForm.durationofdisease.value == "")
  {
    alert("Please, indicate total duration of your disease.");
   theForm.duration[0].focus();
    return (false);
  }
if (theForm.captcha_code.value == "")
  {
    alert("Type in digital code of the color picture.");
    theForm.captcha_code.focus();
    return (false);
  } 
   return (true);
}
