/*
** (C)Copyright Internet Intuitive - a division of ADB Internet Services Limited
**
** All code (including but not limited to HTML, JavaScript and PHP) and images
** (C)Copyright 2001-2003 ADB Internet Services Limited - all rights reserved.
**
** Filename: mod_contactus.js
** Version:  V1.00.b
** Date:     03-May-2004
*/


/*
**
** Validate Feedback Form
**
*/
function Form_FB_Validator(theForm)
{
  /*
  ** Validate feedback_name
  */
  if ( ( theForm.feedback_name.value == "--- please specify ---" )
    || ( theForm.feedback_name.value == "" ) )
  {
    alert("Please enter a value for the \"Your Name\" field.");
    theForm.feedback_name.focus();
    return (false);
  }

  /*
  ** Validate feedback_company
  **
  ** ... no validation required
  */

  /*
  ** Validate feedback_name
  */
  if ( ( theForm.feedback_email.value == "--- please specify ---")
    || ( theForm.feedback_email.value == "" ) )
  {
    alert("Please enter a value for the \"Email Address\" field.");
    theForm.feedback_email.focus();
    return (false);
  }

  /*
  ** Validate feedback_notes
  */
  if (theForm.feedback_notes.value == "")
  {
    alert("Please enter a value for the \"Feedback\" field.");
    theForm.feedback_notes.focus();
    return (false);
  }

  if (theForm.feedback_notes.value.length >= 1024 )
  {
    alert("Please limit \"Feedback\" to at most 1024 characters.");
    theForm.feedback_notes.focus();
    return (false);
  }

  return (true);
}

/*
**
** Validate MailingList subscription form
**
*/
function Form_ML_Validator(theForm)
{
  /*
  ** Validate Name
  */
  if ( ( theForm.maillist_name.value == "--- please specify ---" )
    || ( theForm.maillist_name.value == "" ) )
  {
    alert("Please complete the \"Your Name\" field.");
    theForm.maillist_name.focus();
    return (false);
  }

  /*
  ** Validate CompName
  **
  ** ... no validation needed
  */

  /*
  ** Validate Email 
  */
  if ( ( theForm.maillist_mail.value == "--- please specify ---" )
    || ( theForm.maillist_mail.value == "" ) )
  {
    alert("Please complete the \"Your E-mail\" field.");
    theForm.maillist_mail.focus();
    return (false);
  }

  return (true);
}