function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}


function validate() {
 
if (document.form1.c_name.value == "")
{
	alert("Please enter your First Name.")
	document.form1.c_name.focus();
	return false;
}

var checkOK = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
  var checkStr = document.form1.c_name.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only alphabets in the First Name field.");
    document.form1.c_name.focus();
    return (false);
  }

if (document.form1.c_surname.value == "")
{
	alert("Please enter your Last Name.")
	document.form1.c_surname.focus();
	return false;
}

var checkOK = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
  var checkStr = document.form1.c_surname.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only alphabets in the Last Name field.");
    document.form1.c_surname.focus();
    return (false);
  }
  
  if (document.form1.email.value == "")
    {
      alert("Please enter your Email address.");
      document.form1.email.focus();
      return (false);
    }
  
    if (!isEmailAddr(document.form1.email.value))
    {
      alert("Please enter a valid Email address.");
      document.form1.email.focus();
      return (false);
  }
  
 a = document.form1.accept.checked;

	if (a==false)
	{
		alert("Please accept the Terms of Use checkbox.");
		document.form1.accept.focus() ;
		return false;
	}
}