﻿//document.write('This script is external ')

/////////////////////////////////////////////////
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header

var good;
function checkEmailAddress(field) {

// Note: The next expression must be all on one line...
//       allow no spaces, linefeeds, or carriage returns!

var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);

if (goodEmail){
   good = true
} else {
   alert('Please enter a valid e-mail address.')
   field.focus()
   field.select()
   good = false
   }
}

function sendOff(){

//   nmcheck = document.getElementById('aspnetForm')['frmName'].value
   nmcheck = document.getElementById('aspnetForm')['frmName']
   if (nmcheck.value.length <2) {
      alert('Please enter your name.')
      nmcheck.focus()
      nmcheck.select()
      return
   }         

   good = false

   //select box value checker
 // test to see if Select box exists before testing value
  SelectExists = document.getElementById('aspnetForm').frmPriceCombo
  if (SelectExists){
   SelectCheck = document.getElementById('aspnetForm').frmPriceCombo.options[document.getElementById('aspnetForm').frmPriceCombo.selectedIndex].value
   if (SelectCheck=='') {
      alert('Please select your purchaser type.');
      good = false;
      return;
   } 
  }


   checkEmailAddress(document.getElementById('aspnetForm').frmEmail)

   if (good){

      // This is where you put your action
      // if name and email addresses are good.
      // We show an alert box, here; but you can
      // use a window.location= 'http://address'
      // to call a subsequent html page, 
      // or a Perl script, etc.
      //alert("Name and email address fields verified good.")
      // post form

      document.getElementById('aspnetForm').submit()
      
   }     
}


