// JavaScript Document
 var bSaving = false;
	function validate(register) {

        if (bSaving) {
		    myLearned = -1;
			myPrice = -1;
			myBedroom = -1;
			myResidence = -1;
			myReason = -1;
			myInterest = -1;
			myRes = -1;
            bSaving = false; // reset
			goemail = true;
            var msg = '';
			
			
			if (document.contact.First_Name.value == '') {
                msg += 'First Name is missing.\n';
            }
			
			if (document.contact.Last_Name.value == '') {
                msg += 'Last Name is missing.\n';
            }
			
			if (document.contact.Address.value == '') {
                msg += 'Address is missing.\n';
            }
			
			if (document.contact.City.value == '') {
                msg += 'City is missing.\n';
            }
			
			if (document.contact.State.value == 'State') {
                msg += 'State is missing.\n';
            }
			
			if (document.contact.Zip.value == '') {
                msg += 'Zip is missing.\n';
            }
		
			if(document.contact.email.value==''){
			msg += 'Email is missing.\n';
			goemail = false
            }			
		   /*if (document.contact.Day_Phone.value == '') {
                msg += 'Daytime Phone is missing.\n';
            }*/

			
			  str = document.contact.email.value
			  checkdot = str.indexOf(".")
			  checkarb = str.indexOf("@")
			  if(goemail){
              if((checkdot<=-1) || (checkarb<=-1)){
			  msg += 'Please use a valid Email Address.\n';
			  }
			  }

            if (msg != '') {
                msg = 'The following errors were found:\n\n' + msg;
                alert(msg);
                return false;
            } else {
                return true;
            }
        } else {
            return true;
        }
		}