<!--
function validate_form() {

  if (!isProper(document.form.realname.value))
  	{ alert('Name entered is not valid or empty!'); form.realname.focus(); return false; }
      if (!isEmail(document.form.email.value))
  	{ alert('Email address is invalid or empty!'); form.email.focus(); return false; }
  if (document.form.email.value != document.form.EMAIL2.value)
        { alert('The two email addresses do not match or one is empty!'); form.EMAIL2.focus(); return false; }
  if (!check_textbody(document.form.MESSAGE.value))
  	{ alert('Mail body is empty!'); form.MESSAGE.focus(); return false; }
  if (!check_textbody(document.form.vercode.value))
  	{ alert('Please enter the verification code displayed on the left!'); form.vercode.focus(); return false; }
  return true;
}

function check_textbody(text) {
  return (text.length > 0); // returns false if empty
}

function isProper(string) {

   if (!string) return false;
   var iChars = "*|,\":<>[]{}`\';()@&$#%";

   for (var i = 0; i < string.length; i++) {
      if (iChars.indexOf(string.charAt(i)) != -1)
         return false;
   }
   return true;
}                      

function isEmail(str) {
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);        
}
// -->
