//Andrews Insurance Javascript

// ** BEGIN GLOBAL ADJUSTMENTS ** //
var isEnterKey = false;

 function checkForEnter(evt) {
	  	evt = (evt) ? evt : event;
		var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);
		if (charCode == 13) {
		 	isEnterKey = true;
		}
	
	  }
	  
function allowSend(form) {
		var firstField = eval("form.First_Name.value");
		var lastField = eval("form.Last_Name.value");
		var phoneField = eval("form.Phone.value");
		var emptyFields = false;
		
		// Cancel submit triggered by use of Enter key
		if (isEnterKey == true){
			isEnterKey = false;  //reset flag
			alert("Please use the Tab key or the mouse cursor to select a new entry field.  When finished, click the Send button at the bottom of the form.");
			return false;
		}
		
		/*alert("Firstfield is " + firstField);
		alert("Lastfield is " + lastField);
		alert("Phonefield is " + phoneField);
		alert("Leaving");
		*/
		if (firstField == "") {emptyFields = true};
		if (lastField == "") {emptyFields = true};
		if (phoneField == "") {emptyFields = true};
		if (emptyFields == true) {
			alert("Please enter your first and last name in the " + '"About You"' + " section and your phone number in the " + '"Contact Information"' + " section.");
			return false
		}
}
