/*
addLoadListener(init);

function init()
{
  var submit = document.getElementById("submit");
  submit.onclick = validate;

  return true;
}
*/

function validate(frm)
{
  //var textField = document.getElementById("email");
  
  //Check name field
  if (frm.name.value == "" || /^\s+$/.test(frm.name.value))
  {
    alert("Please enter your full name.");
    frm.name.focus();
    return false;
  }
  
  //Check email address field
  if (!/^[\w\.\-]+@([\w\-]+\.)+[a-zA-Z]+$/.test(frm.email.value))
  {
    alert("Invalid email address supplied. Please provide a valid email address.");
    frm.email.focus();
    return false;
  }
  
  //Check code field
  if (frm.vcode.value == "" || /^\s+$/.test(frm.vcode.value))
  {
    alert("Please enter verification code exactly as it appears in the image.");
    frm.vcode.focus();
    return false;
  }
	  
  //All ok, return true.  
  return true;
 
}


/*
function addLoadListener(fn)
{
  if (typeof window.addEventListener != 'undefined')
  {
    window.addEventListener('load', fn, false);
  }
  else if (typeof document.addEventListener != 'undefined')
  {
    document.addEventListener('load', fn, false);
  }
  else if (typeof window.attachEvent != 'undefined')
  {
    window.attachEvent('onload', fn);
  }
  else
  {
    var oldfn = window.onload;
    if (typeof window.onload != 'function')
    {
      window.onload = fn;
    }
    else
    {
      window.onload = function()
      {
        oldfn();
        fn();
      };
    }
  }
}
*/