


//////////////////////////////////// function to open MLS window
function openMLS() {
var MLSwindow;
MLSwindow = window.open( "http://letsbepartners.utahrealestate.com", "MLS", "height=550,width=700,top=50,left=50,scrollbars=1,resizable=0,toolbar=1,menubar=0");
  if (MLSwindow.open) {
    MLSwindow.close;
  }
  MLSwindow.focus();
}

// this funtion is called when the user clicks the submit button on module EF-01 with special MLS
function submitFormEF() {
		
		// make a variable to hold all the errors
		var error_string="";
		
		// making a variable to hold document.contactForm, to make less code to write
		var formValidate = document.contactForm;
		
		// make sure user enters first name
		if (formValidate.Full_Name.value == "") {
			error_string += "You must enter your full name!\n";
		}

		// check to see if the email address is entered and or valid
		if (formValidate.Email_Address.value == "") {
		      error_string += "You must enter your e-mail address!\n";
		} else if (formValidate.Email_Address.value.indexOf("@")==-1 || 
			 	formValidate.Email_Address.value.indexOf(".")==-1 || 
			 	formValidate.Email_Address.value.indexOf(" ")!=-1 || 
			 	formValidate.Email_Address.value.length<6) 
				{
					error_string += "You entered an invalid e-mail address!\n";
		}
	   
	
	// if variable is empty, process the form else pop up an alert returning the errors	
	if (error_string == "") {
		alert("Your information has been submitted.  Thank You!");
		return openMLS();
		return true;
	} else {
		error_string = "We found the following omissions in your form: \n" + error_string;
		alert(error_string);
			return false;
	}
}

