<!-- 
//
// 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: js001.js
// Date Created: February 2008
// Description: 
//    Validation form.....

  function validemail(email) {
//----------------------------
     invalidChars = " /:,;"
     if (email == "") {                                                // cannot be empty
         return false
     }
     for (i=0; i<invalidChars.length; i++) {        // does it contain any invalid characters?
         badChar = invalidChars.charAt(i)
         if (email.indexOf(badChar,0) > -1) {
             return false
             }
     }
     atPos = email.indexOf("@",1)                        // there must be one "@" symbol
     if (atPos == -1) {
        return false
     }
     if (email.indexOf("@",atPos+1) != -1) {        // and only one "@" symbol
        return false
     }
     periodPos = email.indexOf(".",atPos)
     if (periodPos == -1) {                                        // and at least one "." after the "@"
         return false
     }
     if (periodPos+3 > email.length)        {                // must be at least 2 characters after the "."
         return false
     }
     return true
}

  function submitIt(Enquiry) {
//-------------------------
// Check that First Name field has been entered
  if (Enquiry.Country.value == "") {
      alert("Please enter your Country of registration.")
      Enquiry.Country.focus()
      Enquiry.Country.select()
      return false
  }
  if (Enquiry.Capital.value == "") {
      alert("Please enter Investment Capital required:")
      Enquiry.Capital.focus()
      Enquiry.Capital.select()
      return false
  }
  if (Enquiry.describes.value == "Please select.............") {
      alert("Please What best describes your business:")
      Enquiry.Capital.focus()
      Enquiry.Capital.select()
      return false
  }
  if (Enquiry.Revenue.value == "") {
      alert("Please enter your Current yearly revenue.")
      Enquiry.Revenue.focus()
      Enquiry.Revenue.select()
      return false
  }
  if (Enquiry.Name.value == "") {
      alert("Please enter your Name.")
      Enquiry.Name.focus()
      Enquiry.Name.select()
      return false
  }
// Check that company field has been entered
  if (Enquiry.Company.value == "") {
      alert("Please enter your Company name.")
      Enquiry.Company.focus()
      Enquiry.Company.select()
      return false
  }
// Check that telephone field has been entered
  if (Enquiry.Phone.value == "") {
      alert("Please enter your telephone.")
      Enquiry.Phone.focus()
      Enquiry.Phone.select()
      return false
  }
// check to see if the Email Address's valid
  if (Enquiry.EmailAddress.value == "") {
      alert("Email Address is not a valid Email address!\nPlease re-enter.")
      Enquiry.EmailAddress.focus()
      Enquiry.EmailAddress.select()
      return false
  }
  if (!validemail(Enquiry.EmailAddress.value)) {
      alert("Email Address is not a valid Email address!\nPlease re-enter.")
      Enquiry.EmailAddress.focus()
      Enquiry.EmailAddress.select()
      return false
  }


  if (Enquiry.budget.value == "Please Select ---------------------") {
      alert("Please select how you heard about us.")
      Enquiry.budget.focus()
      Enquiry.budget.select()
      return false
  }
 
  
// If we made it to here, everything's valid, so return true
  return true
}

// -->
<script src="js/js001.js" type="text/javascript" ></script>

