function Form_Validator(theForm)
{
  contact_type_selection = theForm.contact_type.options[theForm.contact_type.selectedIndex].value;
  vds_packages_selection = theForm.vds_packages.options[theForm.vds_packages.selectedIndex].value;
  refferal_sel_selection = theForm.referral_sel.options[theForm.referral_sel.selectedIndex].value;

  /*
  ** Validate T&Cs selected
  */
  if ( theForm.terms_conditions.checked == false )
  {
    alert("You must accept the terms and conditions!");
    theForm.terms_conditions.focus();
    return (false);
  }

  /*
  ** Validate Mailing List selected
  **
  ** ... no validation required
  */

  /*
  ** Validate Company/Registrant Name
  */
  if ( ( theForm.company_name.value == "-- please specify --" )
    || ( theForm.company_name.value == "" ) )
  {
    alert("Please specify the registrant's name!");
    theForm.company_name.focus();
    return (false);
  }

  /*
  ** Validate Registrant Type
  */
  if ( contact_type_selection == "NONE" )
  {
    alert("Please specify the registrant type!");
    theForm.contact_type.focus();
    return (false);
  }

  /*
  ** Validate Trading Name
  */
  if ( ( theForm.trading_name.value == "-- please specify --" )
    || ( theForm.trading_name.value == "" ) )
  {
    alert("Please specify the registrant's trading name");
    theForm.trading_name.focus();
    return (false);
  }

  /*
  ** Validate Registration Number
  */
  if ( ( theForm.company_regn.value == "-- please specify --" )
    || ( theForm.company_regn.value == "" ) )
  {
    alert("Please specify the registration number");
    theForm.company_regn.focus();
    return (false);
  }

  /*
  ** Validate Contact Name
  */
  if ( ( theForm.contact_name.value == "-- please specify --" )
    || ( theForm.contact_name.value == "" ) )
  {
    alert("Please specify a contact name");
    theForm.contact_name.focus();
    return (false);
  }

  /*
  ** Validate Contact Email address
  */
  if ( ( theForm.contact_email.value == "-- please specify --" )
    || ( theForm.contact_email.value == "" ) )
  {
    alert("Please specify a contact email address");
    theForm.contact_emaile.focus();
    return (false);
  }

  /*
  ** Validate Address (all fields)
  */
  if ( ( theForm.contact_address1.value == "-- please specify --" )
    || ( theForm.contact_address1.value == "" ) )
  {
    alert("Please specify your address");
    theForm.contact_address1.focus();
    return (false);
  }
  if ( ( theForm.contact_city.value == "-- please specify --" )
    || ( theForm.contact_city.value == "" ) )
  {
    alert("Please specify your town/city");
    theForm.contact_city.focus();
    return (false);
  }
  if ( ( theForm.contact_county.value == "-- please specify --" )
    || ( theForm.contact_county.value == "" ) )
  {
    alert("Please specify your county");
    theForm.contact_county.focus();
    return (false);
  }
  if ( ( theForm.contact_postcode.value == "-- please specify --" )
    || ( theForm.contact_postcode.value == "" ) )
  {
    alert("Please specify your postcode");
    theForm.contact_postcode.focus();
    return (false);
  }
  if ( ( theForm.contact_country.value == "-- please specify --" )
    || ( theForm.contact_country.value == "" ) )
  {
    alert("Please specify your country");
    theForm.contact_country.focus();
    return (false);
  }
  if ( ( theForm.contact_tel.value == "-- please specify --" )
    || ( theForm.contact_tel.value == "" ) )
  {
    alert("Please specify a contact telephone number");
    theForm.contact_tel.focus();
    return (false);
  }

  /*
  ** Validate VDS hosting package
  */
  if ( ( vds_packages_selection == "None" )
    || ( vds_packages_selection == ""     ) )
  {
    alert("Please specify the required hosting package");
    theForm.vds_packages.focus();
    return (false);
  }
  if ( ( vds_packages_selection == "Forward"      )
    || ( vds_packages_selection == "Forward/NoAd" ) )
  {
    if ( ( theForm.vds_notes.value == "-- please specify --" )
      || ( theForm.vds_notes.value == "" ) )
    {
      alert("Please specify email address and web URL for forwarding");
      theForm.vds_notes.focus();
      return (false);
    }
  }

  /*
  ** Validate Referral
  */
  if ( ( referral_sel_selection == "None" )
    || ( referral_sel_selection == ""     ) )
  {
    alert("Please advise how you found out about Internet Intuitive");
    theForm.referral_sel.focus();
    return (false);
  }
  if ( ( theForm.referral_detail.value == "-- please specify --" )
    || ( theForm.referral_detail.value == ""                     ) )
  {
    if ( ( referral_sel_selection == "Search Engine" )
      || ( referral_sel_selection == "Website Link"  ) )
    {
      alert("Please specify the website");
      theForm.referral_detail.focus();
      return (false);
    }
    if ( referral_sel_selection == "Advert" )
    {
      alert("Please specify the publication");
      theForm.referral_detail.focus();
      return (false);
    }
    if ( ( referral_sel_selection == "Other"          )
      || ( referral_sel_selection == "Recommendation" ) )
    {
      alert("Please give details...");
      theForm.referral_detail.focus();
      return (false);
    }
  }


  /*
  ** Got here... must be OK
  */
  return (true);
}

/*******************************************************************************************/

function Form_Change_RegType(theSelection)
{
  /*
  ** Get current Contact_Type selection
  */
  contact_type_selection = theSelection.options[theSelection.selectedIndex].value;

  if ( contact_type_selection == "" )
  {
      theSelection.form.contact_type.value = "NONE";
  }

  if ( ( contact_type_selection == "LTD"   )
    || ( contact_type_selection == "PLC"   )
    || ( contact_type_selection == "LLP"   )
    || ( contact_type_selection == "RCHAR" )
    || ( contact_type_selection == "FCORP" )
    || ( contact_type_selection == "OTHER" ) )
  {
    theSelection.form.company_regn.disabled = false;
    theSelection.form.trading_name.disabled = false;

    theSelection.form.company_regn.value    = "-- please specify --";
    theSelection.form.trading_name.value    = "-- please specify --";
  }

  if ( contact_type_selection == "IND" )
  {
    theSelection.form.company_regn.disabled = true;
    theSelection.form.trading_name.disabled = true;

    theSelection.form.company_regn.value    = "-- n/a --";
    theSelection.form.trading_name.value    = "-- n/a --";
  }

  if ( ( contact_type_selection == "STRA" )
    || ( contact_type_selection == "PTNR" ) )
  {
    theSelection.form.company_regn.disabled = true;
    theSelection.form.trading_name.disabled = false;

    theSelection.form.company_regn.value    = "-- n/a --";
    theSelection.form.trading_name.value    = "-- please specify --";
  }
}


/*******************************************************************************************/

function Form_Change_Referral(theSelection)
{
  /*
  ** Get current VDS package selection
  */
  ref_selection = theSelection.options[theSelection.selectedIndex].value;

  if ( ref_selection == "" )
  {
    theSelection.form.referral_sel.value       = "None";

    theSelection.form.referral_detail.disabled = true;
    theSelection.form.referral_detail.value    = "-- n/a --";
  }

  if ( ( ref_selection == "Existing Customer" )
    || ( ref_selection == "PCG"               ) )
  {
    theSelection.form.referral_detail.disabled = true;
    theSelection.form.referral_detail.value    = "-- n/a --";
  }

  if ( ( ref_selection == "Search Engine"  )
    || ( ref_selection == "Website Link"   )
    || ( ref_selection == "Recommendation" )
    || ( ref_selection == "Other"          ) )
  {
    theSelection.form.referral_detail.disabled = false;
    theSelection.form.referral_detail.value    = "-- please specify --";
  }
}


/*******************************************************************************************/

function Form_Change_VDS(theSelection)
{
  /*
  ** Get current VDS package selection
  */
  vds_selection = theSelection.options[theSelection.selectedIndex].value;

  if ( vds_selection == "" )
  {
    theSelection.form.vds_packages.value = "None";

    theSelection.form.vds_extra_web.disabled = true;
    theSelection.form.vds_extra_bw.disabled  = true;
    theSelection.form.vds_notes.disabled     = true;

    theSelection.form.vds_extra_web.value    = "0";
    theSelection.form.vds_extra_bw.value     = "0";
    theSelection.form.vds_notes.value        = "-- n/a --";
  }

  if ( ( vds_selection == "Holding"     )
    || ( vds_selection == "VDS Mailbox" ) )
  {
    theSelection.form.vds_extra_web.disabled = true;
    theSelection.form.vds_extra_bw.disabled  = true;
    theSelection.form.vds_notes.disabled     = true;

    theSelection.form.vds_extra_web.value    = "0";
    theSelection.form.vds_extra_bw.value     = "0";
    theSelection.form.vds_notes.value        = "-- n/a --";
  }

  if ( ( vds_selection == "Forward"      )
    || ( vds_selection == "Forward/NoAd" ) )
  {
    theSelection.form.vds_extra_web.disabled = true;
    theSelection.form.vds_extra_bw.disabled  = true;
    theSelection.form.vds_notes.disabled     = false;

    theSelection.form.vds_extra_web.value    = "0";
    theSelection.form.vds_extra_bw.value     = "0";
    theSelection.form.vds_notes.value        = "-- please specify --";
    alert("Please specify email address and web URL for forwarding in 'Other Comments' box");
  }

  if ( ( vds_selection == "VDS StartUp"   )
    || ( vds_selection == "VDS Bronze"    )
    || ( vds_selection == "VDS Silver"    )
    || ( vds_selection == "VDS Gold"      )
    || ( vds_selection == "VDS Platinium" ) )
  {
    theSelection.form.vds_extra_web.disabled = false;
    theSelection.form.vds_extra_bw.disabled  = false;
    theSelection.form.vds_notes.disabled     = false;

    theSelection.form.vds_extra_web.value    = "0";
    theSelection.form.vds_extra_bw.value     = "0";
    theSelection.form.vds_notes.value        = "";
  }

  if ( vds_selection == "Other" )
  {
    theSelection.form.vds_extra_web.disabled = true;
    theSelection.form.vds_extra_bw.disabled  = true;
    theSelection.form.vds_notes.disabled     = false;

    theSelection.form.vds_extra_web.value    = "0";
    theSelection.form.vds_extra_bw.value     = "0";
    theSelection.form.vds_notes.value        = "-- please specify --";
    alert("Please specify all necessary details in the 'Other Comments' box");
  }
}
