<!-- 
//
// Written for: My Devine Things Pty Ltd.
// Copyright: A Better Deal for ALL (C) 2008 all rights reserved.
// Designed & Developed by: A Better Deal for All ABN: 64 648 123 459
// URL: http://www.ABetterDealForAll.net.au/
// Author: Graham Hagney.
// Program Name: BB001.js
// Date Created: February 2009
// Description: 
//    Validation form.....

  function validEmailAddress(EmailAddress) {
//----------------------------
     invalidChars = " /:,;"
     if (EmailAddress == "") {                                                // cannot be empty
         return false
     }
     for (i=0; i<invalidChars.length; i++) {        // does it contain any invalid characters?
         badChar = invalidChars.charAt(i)
         if (EmailAddress.indexOf(badChar,0) > -1) {
             return false
             }
     }
     atPos = EmailAddress.indexOf("@",1)                        // there must be one "@" symbol
     if (atPos == -1) {
        return false
     }
     if (EmailAddress.indexOf("@",atPos+1) != -1) {        // and only one "@" symbol
        return false
     }
     periodPos = EmailAddress.indexOf(".",atPos)
     if (periodPos == -1) {                                        // and at least one "." after the "@"
         return false
     }
     if (periodPos+3 > EmailAddress.length)        {                // must be at least 2 characters after the "."
         return false
     }
     return true
}

  function submitIt(Enquiry) {
//-------------------------
// Check thatfield has been entered
  if (Enquiry.WhatCentre.value == "") {
      alert("Please enter the Centre you attend.")
      Enquiry.WhatCentre.focus()
      Enquiry.WhatCentre.select()
      return false
  }
 
  if (Enquiry.TeacherFeedback.value == "" && Enquiry.ChildEducation.value == "" && Enquiry.BestThing.value == "" && Enquiry.ImproveExperience.value == "") {
      alert("Please enter your feedback in at least one of the topics listed here.")
      Enquiry.TeacherFeedback.focus()
      Enquiry.TeacherFeedback.select()
      return false
  }
  
// If we made it to here, everything's valid, so return true
  return true
}

// -->

