// Checks for numbers greater than 0
function checkNumbers(e) {
ok = "1234567890";
for(i=0; i < e.length ;i++){
 if(ok.indexOf(e.charAt(i))<0){ 
  return (false); }} 
 if (document.images) {
  re = /^[1-9]+([0-9]+)?$/;
  if (e.match(re)) {
   return (-1); }
   }}

// Checks for valid US zip codes (zip or zip+4)
function checkZip(e) {
ok = "1234567890-";
for(i=0; i < e.length ;i++){
 if(ok.indexOf(e.charAt(i))<0){ 
  return (false); }} 
 if (document.images) {
  re = (/^\d{5}([\-]\d{4})?$/);
  if (e.match(re)) {
   return (-1); }
   }}

// Checks for valid us phone numbers
function checkPhone(e) {
ok = "1234567890-";
for(i=0; i < e.length ;i++){
 if(ok.indexOf(e.charAt(i))<0){ 
  return (false); }} 
 if (document.images) {
  re = (/^\d{3}\-\d{3}\-\d{4}$/);
  if (e.match(re)) {
   return (-1); }
   }}

// Checks for valid email accounts, structurally
function checkEmail(e) {
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
 for(i=0; i < e.length ;i++){
  if(ok.indexOf(e.charAt(i))<0){ 
   return (false); }} 
  if (document.images) {
   re = (/(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/);
   re_two = (/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/);
   if (!e.match(re) && e.match(re_two)) {
    return (-1); }
	}}


function checkData () {
with (window.document.golf) {

	if (name.value == "") {
	  alert ("Please provide your name.");
	  name.focus ();
	  return false; }

	if (address.value == "") {
	  alert ("Please provide your address.");
	  address.focus ();
	  return false; }

	if (city.value == "") {
	  alert ("Please provide your city.");
	  city.focus ();
	  return false; }

	if (state.value == "") {
	  alert ("Please provide your state.");
	  state.focus ();
	  return false; }

	if (!checkZip (zip.value)) {
	  alert ("Please provide your valid US zip code.");
	  zip.focus ();
	  return false;}
	  
	if (phone.value != "")
	if (!checkPhone (phone.value)) {
	   alert ("Please provide your valid phone number.");
	   phone.focus ();
	   return false;}
	   
	if (!checkEmail (email.value)) {
	  alert ("Please provide your valid e-mail address.");
	  email.focus ();
	  return false; }

	if (participation.value == "choose") {
	  alert ("Please provide your participation level.");
	  participation.focus ();
	  return false; }

}}
