	//Display email message
	function getEmailMessage() {
		var emailSent = getUrlParameter("email");
		
		if (emailSent != "") {
			if (emailSent == "true") {
				changeEmailResult("#00CC00", "Information successfully submitted.");
			} else if (emailSent == "false") {
				changeEmailResult("#CC0000", "Information submission failed, please try again.");
			}
		}
	}
	
	//Check fields and send email
	function sendEmail(form) {
		//Check fields
		if (checkFields(form)) {
			//Set result
			changeEmailResult("#00CC00", "Submitting information...")
			
			//Remove parameters
			var url = location.href;
			url = url.substring(0, url.indexOf("?"));
			
			//Variables
			var name = form.txtName.value;
			var add1 = form.txtAddress1.value;
			var add2 = form.txtAddress2.value;
			var city = form.txtCityTown.value;
			var phone = form.txtPhone.value;
			var email = form.txtEmail.value;
			var stories = form.txtStories.value;
			var chimneys = form.txtChimneys.value;
			var how = form.txtHowHear.value;			
			var remarks = form.txtRemarks.value;
			
			//Redirect
			window.location = "../email/hireUs.aspx?name=" + name + "&add1=" + add1 + "&add2=" + add2 + "&city=" + city + "&phone=" + phone + "&email=" + email + "&stories=" + stories + "&chimneys=" + chimneys + "&how=" + how + "&remarks=" + remarks;
		}
	}
	function checkFields(form) {
		//Check name
		if (form.txtName.value == "") {
			//Set result
			changeEmailResult("#CC0000", "Name cannot be blank.");
			return false;
		}
		//Check city/town
		if (form.txtCityTown.value == "") {
			//Set result
			changeEmailResult("#CC0000", "City/town cannot be blank.");
			return false;
		}
		//Check phone
		if (form.txtPhone.value == "") {
			//Set result
			changeEmailResult("#CC0000", "Phone cannot be blank.");
			return false;
		}
		//Check remarks
		if (form.txtRemarks.value == "") {
			//Set result
			changeEmailResult("#CC0000", "Remarks cannot be blank.");
			return false;
		}
		
		return true;
	}
	
	function changeEmailResult(colorString, myString) {
		$("#pEmailResult").slideUp("normal", function(){
															document.getElementById("pEmailResult").innerHTML = "<span style='color:" + colorString + "; font-size:16px; font-weight:bold'>" + myString + "</span>";
													  });
		$("#pEmailResult").slideDown();
	}