  if(document.layers && document.forms[0] && document.forms[0].SubmitCount && (document.forms[0].SubmitCount.value > 0))
  document.captureEvents(Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP);
  document.onclick = checkSubmit;
  
  function checkSubmit(e)
  {
    if(document.forms[0] && document.forms[0].SubmitCount && (document.forms[0].SubmitCount.value > 0))
      return false;
  } 

  function submitForm()
  {
    if(document.forms[0].SubmitCount.value > 0)
      return false;
    if(!checkEmail())
      return false;
    document.forms[0].email.value = trimLeftRight(document.forms[0].email.value);
    document.forms[0].SubmitCount.value = 1;
    return true;
  }
  
  
  //new
  function sendRequest()
  {
    if(document.forms[0].SubmitCount.value > 0)
      return false;
    if(!checkEmail())
      return;
    document.forms[0].SubmitCount.value = 1;
    document.forms[0].action = "http://www.123signup.com/servlet/RequestPassword";
    document.forms[0].submit();
  }
  
  function checkEmail()
  {
    if(document.forms[0].email.value == null || trimLeftRight(document.forms[0].email.value).length == 0)
    {
      alert("Please enter your email address");
      document.forms[0].email.focus();
      return false
    }
    return true;
  }
  
  // Trim left white spaces
  function trimLeft(str)
  {
    return str.replace(/^[\t\n\r ]*/, "");
  }
  
  // trim right white spaces
  function trimRight(str)
  {
    return str.replace(/[\t\n\r ]* $/, "");
  }
  
  // trim both left and right spaces.
  function trimLeftRight(str)
  {
    return trimLeft(trimRight(str));
  }
