/* Validates the quick contact form */

    function validate_form ( )
    {
/* checks the first name box is filled in */
    	valid = true;

      if ( document.contact_form.firstname.value == "" )
        {
          alert ( "Please fill in the first name box." );
          valid = false;
        }

/* if the phone box is selected */
      if (( document.contact_form.contact[0].checked == true ) &&  ( document.contact_form.telephone.value == "" ))
        {
          alert ( "Please fill in the telephone box." );
          valid = false;
        }
      if (( document.contact_form.contact[0].checked == true ) &&  ( document.contact_form.time.value == 0 ))
        {
          alert ( "Please fill in the time box." );
          valid = false;
        }
      if (( document.contact_form.contact[0].checked == true ) &&  ( document.contact_form.postcode.value == "" ))
        {
          alert ( "Please fill in the postcode box." );
          valid = false;
        }

/* if the email box is selected */
      if (( document.contact_form.contact[1].checked == true ) &&  ( document.contact_form.email.value == "" ))
        {
          alert ( "Please fill in the email box." );
          valid = false;
        }
      if (( document.contact_form.contact[1].checked == true ) &&  ( document.contact_form.telephone.value == "" ))
        {
          alert ( "Please fill in the telephone box." );
          valid = false;
        }
      if (( document.contact_form.contact[1].checked == true ) &&  ( document.contact_form.postcode.value == "" ))
        {
          alert ( "Please fill in the postcode box." );
          valid = false;
        }

/* if the don't mind box is selected */        
      if (( document.contact_form.contact[2].checked == true ) &&  ( document.contact_form.email.value == "" ))
        {
          alert ( "Please fill in the email box." );
          valid = false;
        }
      if (( document.contact_form.contact[2].checked == true ) &&  ( document.contact_form.telephone.value == "" ))
        {
          alert ( "Please fill in the telephone box." );
          valid = false;
        }
      if (( document.contact_form.contact[2].checked == true ) &&  ( document.contact_form.time.value == 0 ))
        {
          alert ( "Please fill in the time box." );
          valid = false;
        }
      if (( document.contact_form.contact[2].checked == true ) &&  ( document.contact_form.postcode.value == "" ))
        {
          alert ( "Please fill in the postcode box." );
          valid = false;
        }

      return valid;
    }
