function isEmpty(inputStr) {
   if (inputStr == null || inputStr == "") {
      return true
   }
   return false
}
// Function to validate form data input:
function checkForm(form1) {
	  if (isEmpty(form1.firstName.value)) {
		  alert ("Please fill in the First Name field.");
		  form1.firstName.focus();
		  return false;
      }
	  if (isEmpty(form1.lastName.value)) {
		  alert ("Please fill in the Last Name field.");
		  form1.lastName.focus();
		  return false;
      }
	   if (isEmpty(form1.company.value)) {
		  alert ("Please fill in the Company field.");
		  form1.company.focus();
		  return false;
      }
	  if (document.form1.market[document.form1.market.selectedIndex].text=="--Please select--")
	   {
		 alert("Please select a market");
		 form1.market.focus();
		 return false;  
	   }

	  if (document.form1.StateCountry[document.form1.StateCountry.selectedIndex].text=="--Please select--")
	   {
	     alert("Please select a country");
		 form1.StateCountry.focus();
		 return false;
	   }

      if (isEmpty(form1.Email.value)) {
      alert ("Please fill in the Email field.");
      form1.Email.focus();
      return false;
      }

  var tempMsg;
  tempMsg  = "First Name: " + document.form1.firstName.value + "\n";
  tempMsg += "Last Name: " + document.form1.lastName.value + "\n";
  tempMsg += "Company: " + document.form1.company.value + "\n";
  tempMsg += "Job Title: " + document.form1.job.value + "\n";
  tempMsg += "Market: " + document.form1.market[document.form1.market.selectedIndex].text + "\n";
  tempMsg += "Country: " + document.form1.StateCountry[document.form1.StateCountry.selectedIndex].text + "\n";
  tempMsg += "Phone: " + document.form1.Phone.value + "\n";
  tempMsg += "Email: " + document.form1.Email.value + "\n";
  tempMsg += "How can we help you? " + "\n" + " " + document.form1.Inquiry.value + "\n";
  
  document.form1.xx_message.value = tempMsg; 
}

