function Valid(thisForm)
{

  if (thisForm.FIRST_NAME.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    thisForm.FIRST_NAME.focus();
    return (false);
  }


  if (thisForm.LAST_NAME.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    thisForm.LAST_NAME.focus();
    return (false);
  }

  if (thisForm.COMPANY.value == "")
  {
    alert("Please enter a value for the \"Company\" field.");
    thisForm.COMPANY.focus();
    return (false);
  }

  if (thisForm.TITLE.value == "")
  {
    alert("Please enter a value for the \"Title\" field.");
    thisForm.TITLE.focus();
    return (false);
  }

  if (thisForm.ADD1.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    thisForm.ADD1.focus();
    return (false);
  }

  if (thisForm.CITY.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    thisForm.CITY.focus();
    return (false);
  }

  if (thisForm.CITY.value.length < 1)
  {
    alert("Please enter a value for the \"City\" field.");
    thisForm.CITY.focus();
    return (false);
  }

  CountryChoice = thisForm.COUNTRY.selectedIndex
  if (thisForm.COUNTRY.options[CountryChoice].value == "")
  {
     alert("You must pick a Country")
    return false
   } 

  if ((thisForm.COUNTRY.options[CountryChoice].value == "Canada") || (thisForm.COUNTRY.options[CountryChoice].value == "Australia") || (thisForm.COUNTRY.options[CountryChoice].value == "United States of America"))
  {
	  STChoice = thisForm.ST.selectedIndex
	  if (thisForm.ST.options[STChoice].value == "")
	  {
	     alert("You must pick a State/Province")
	    return false
	   } 

  }

  if (thisForm.ZIP.value == "")
  {
    alert("Please enter a value for the \"ZIP Code\" field.");
    thisForm.ZIP.focus();
    return (false);
  }



  if (thisForm.PHONE.value == "")
  {
    alert("Please enter a value for the \"Phone\" field.");
    thisForm.PHONE.focus();
    return (false);
  }

  var checkNUM = "0123456789()-x+. ";
  var checkStr = thisForm.PHONE.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkNUM.length;  j++)
    {
      if (ch == checkNUM.charAt(j))
        break;
    }
    if (j == checkNUM.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only valid characters in the \"Phone\" field. Example: (800)555-1212 X44");
    thisForm.PHONE.focus();
    return (false);
  } 


  return (true);  
}

function Validname(thisForm)
{

  if (thisForm.FIRST_NAME.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    thisForm.FIRST_NAME.focus();
    return (false);
  }


  if (thisForm.LAST_NAME.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    thisForm.LAST_NAME.focus();
    return (false);
  }
  return (true);  
}

function Validixc(thisForm)
{

  if (thisForm.FIRST_NAME.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    thisForm.FIRST_NAME.focus();
    return (false);
  }


  if (thisForm.LAST_NAME.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    thisForm.LAST_NAME.focus();
    return (false);
  }

  if (thisForm.COMPANY.value == "")
  {
    alert("Please enter a value for the \"Company\" field.");
    thisForm.COMPANY.focus();
    return (false);
  }

  if (thisForm.CITY.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    thisForm.CITY.focus();
    return (false);
  }

  if (thisForm.CITY.value.length < 1)
  {
    alert("Please enter a value for the \"City\" field.");
    thisForm.CITY.focus();
    return (false);
  }

  CountryChoice = thisForm.COUNTRY.selectedIndex
  if (thisForm.COUNTRY.options[CountryChoice].value == "")
  {
     alert("You must pick a Country")
    return false
   } 

  if ((thisForm.COUNTRY.options[CountryChoice].value == "Canada") || (thisForm.COUNTRY.options[CountryChoice].value == "Australia") || (thisForm.COUNTRY.options[CountryChoice].value == "United States of America"))
  {
	  STChoice = thisForm.ST.selectedIndex
	  if (thisForm.ST.options[STChoice].value == "")
	  {
	     alert("You must pick a State/Province")
	    return false
	   } 

  }

  if (thisForm.PHONE.value == "")
  {
    alert("Please enter a value for the \"Phone\" field.");
    thisForm.PHONE.focus();
    return (false);
  }

  var checkNUM = "0123456789()- x";
  var checkStr = thisForm.PHONE.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkNUM.length;  j++)
    {
      if (ch == checkNUM.charAt(j))
        break;
    }
    if (j == checkNUM.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only valid characters in the \"Phone\" field. Example: (800)555-1212 X44");
    thisForm.PHONE.focus();
    return (false);
  } 

  if (thisForm.PHONE.value == "")
  {
    alert("Please enter a value for the \"Phone\" field.");
    thisForm.PHONE.focus();
    return (false);
  }

  return (true);  
}





function Valide(thisForm)
{
  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
  }

  // check to see if the email's valid
  if (!validEmail(thisForm.EMAIL.value)) {
    alert("Invalid email address")
    thisForm.EMAIL.focus()
    thisForm.EMAIL.select()
    return false
  }

  return (true);  
}














function ValidTE(thisForm)
{


function getSelectedCheckbox(buttonGroup) {
   // Go through all the check boxes. return an array of all the ones
   // that are selected (their position numbers). if no boxes were checked,
   // returned array will be empty (length will be zero)
   var retArr = new Array();
   var lastElement = 0;
   if (buttonGroup[0]) { // if the button group is an array (one check box is not an array)
      for (var i=0; i<buttonGroup.length; i++) {
         if (buttonGroup[i].checked) {
            retArr.length = lastElement;
            retArr[lastElement] = i;
            lastElement++;
         }
      }
   } else { // There is only one check box (it's not an array)
      if (buttonGroup.checked) { // if the one check box is checked
         retArr.length = lastElement;
         retArr[lastElement] = 0; // return zero as the only array value
      }
   }
   return retArr;
} // Ends the "getSelectedCheckbox" function

var checkBoxArr = getSelectedCheckbox(document.forms[0].Classes);
	if (checkBoxArr.length == 0) { 
	alert("You must select a class!"); 
	return false
}


  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
  }

  // check to see if the email's valid
  if (!validEmail(thisForm.EMAIL.value)) {
    alert("Please put in a valid email address")
    thisForm.EMAIL.focus()
    thisForm.EMAIL.select()
    return false
  }



  return (true);  
}














function ValidTR(thisForm)
{

  if (thisForm.FIRST_NAME.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    thisForm.FIRST_NAME.focus();
    return (false);
  }


  if (thisForm.LAST_NAME.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    thisForm.LAST_NAME.focus();
    return (false);
  }

  if (thisForm.COMPANY.value == "")
  {
    alert("Please enter a value for the \"Company\" field.");
    thisForm.COMPANY.focus();
    return (false);
  }


  CountryChoice = thisForm.COUNTRY.selectedIndex
  if (thisForm.COUNTRY.options[CountryChoice].value == "")
  {
     alert("You must pick a Country")
    return false
   } 

  if ((thisForm.COUNTRY.options[CountryChoice].value == "Canada") || (thisForm.COUNTRY.options[CountryChoice].value == "Australia") || (thisForm.COUNTRY.options[CountryChoice].value == "United States of America"))
  {
	  STChoice = thisForm.ST.selectedIndex
	  if (thisForm.ST.options[STChoice].value == "")
	  {
	     alert("You must pick a State/Province")
	    return false
	   } 

  }

  if (thisForm.PHONE.value == "")
  {
    alert("Please enter a value for the \"Phone\" field.");
    thisForm.PHONE.focus();
    return (false);
  }

  var checkNUM = "0123456789()- x+";
  var checkStr = thisForm.PHONE.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkNUM.length;  j++)
    {
      if (ch == checkNUM.charAt(j))
        break;
    }
    if (j == checkNUM.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only valid characters in the \"Phone\" field. Example: (800)555-1212 X44");
    thisForm.PHONE.focus();
    return (false);
  } 


  return (true);  
}



function ValidSales(thisForm)
{

  if (thisForm.FIRST_NAME.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    thisForm.FIRST_NAME.focus();
    return (false);
  }


  if (thisForm.LAST_NAME.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    thisForm.LAST_NAME.focus();
    return (false);
  }

  if (thisForm.COMPANY.value == "")
  {
    alert("Please enter a value for the \"Company\" field.");
    thisForm.COMPANY.focus();
    return (false);
  }

  if (thisForm.TITLE.value == "")
  {
    alert("Please enter a value for the \"Title\" field.");
    thisForm.TITLE.focus();
    return (false);
  }

  if (thisForm.ADD1.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    thisForm.ADD1.focus();
    return (false);
  }

  if (thisForm.CITY.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    thisForm.CITY.focus();
    return (false);
  }

  if (thisForm.CITY.value.length < 1)
  {
    alert("Please enter a value for the \"City\" field.");
    thisForm.CITY.focus();
    return (false);
  }

  CountryChoice = thisForm.COUNTRY.selectedIndex
  if (thisForm.COUNTRY.options[CountryChoice].value == "")
  {
     alert("You must pick a Country")
    return false
   } 

  if ((thisForm.COUNTRY.options[CountryChoice].value == "Canada") || (thisForm.COUNTRY.options[CountryChoice].value == "Australia") || (thisForm.COUNTRY.options[CountryChoice].value == "United States of America"))
  {
	  STChoice = thisForm.ST.selectedIndex
	  if (thisForm.ST.options[STChoice].value == "")
	  {
	     alert("You must pick a State/Province")
	    return false
	   } 

  }

  if (thisForm.PHONE.value == "")
  {
    alert("Please enter a value for the \"Phone\" field.");
    thisForm.PHONE.focus();
    return (false);
  }

  var checkNUM = "0123456789()-x+ ";
  var checkStr = thisForm.PHONE.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkNUM.length;  j++)
    {
      if (ch == checkNUM.charAt(j))
        break;
    }
    if (j == checkNUM.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only valid characters in the \"Phone\" field. Example: (800)555-1212 X44");
    thisForm.PHONE.focus();
    return (false);
  } 

  Q4Choice = thisForm.Q4.selectedIndex
  if (thisForm.Q4.options[Q4Choice].value == "")
  {
     alert("What is your Shirt Size selection?")
    return false
   } 

  Q1Choice = thisForm.Q1.selectedIndex
  if (thisForm.Q1.options[Q1Choice].value == "")
  {
     alert("What is your Bed Size selection?")
    return false
   } 

  Q3Choice = thisForm.Q3.selectedIndex
  if (thisForm.Q3.options[Q3Choice].value == "")
  {
     alert("What is your Hotel Check-In Date?")
    return false
   } 

  Q70Choice = thisForm.Q70.selectedIndex
  if (thisForm.Q70.options[Q70Choice].value == "")
  {
     alert("What is your Hotel Check-out Date?")
    return false
   } 



  return (true);  
}

