$(document).ready(function(){
	if ($('#Expected_Arrival')) {
		$('#Expected_Arrival').datepicker();
	}
});

function setFormFocus(e) {
	var val = e.value;
	if (
		val == "Broker Name"
		|| val == "Broker Firm"
		|| val == "Broker Cell Number"
		|| val == "Broker Email"
		|| val == "Prospect Name"
		|| val == "Expected Arrival"
		|| val == "Type Your Question"
		|| val == "Email Address"
		|| val == "My Name"
		|| val == "My Agent's Name (if applicable)"
		|| val == "Contact Number"
		|| val == "Email"
		|| val == "Street Address"
		|| val == "City"
		|| val == "State"
		|| val == "Zip"
		|| val == "My Agents Name"
	) {
		e.value = '';
	}
}

function setFormBlur(e) {
	if (e.value != "")
		return;
	
	e.value = e.id.replace(/_/g, ' ');
}

function checkBrokerForm() {
	// Make sure our values are all in place and not default
	if ($('#Broker_Name').attr('value') == 'Broker Name') {
		alert("Please enter your name.");
		return false;
	}
	
	if ($('#Broker_Firm').attr('value') == 'Broker Firm') {
		alert("Please enter your firm.");
		return false;
	}
	
	if ($('#Broker_Cell_Number').attr('value') == 'Broker Cell Number') {
		alert("Please enter your cell number.");
		return false;
	}
	
	if ($('#Broker_Email').attr('value') == 'Broker Email') {
		alert("Please enter your email address.");
		return false;
	}
	
	if ($('#Prospect_Name').attr('value') == 'Prospect Name') {
		alert("Please enter your prospect's name.");
		return false;
	}
	
	if ($('#Expected_Arrival').attr('value') == 'Expected Arrival') {
		alert("Please select the expected arrival date.");
		return false;
	}
	
	return true;
}

function checkInfoForm() {
	// Make sure our values are all in place and not default
	if ($('#My_Name').attr('value') == 'My Name') {
		alert("Please enter your name.");
		return false;
	}
	
	if ($('#Contact_Number').attr('value') == 'Contact Number') {
		alert("Please enter your contact number.");
		return false;
	}
	
	if ($('#Email_Address').attr('value') == 'Email Address') {
		alert("Please enter your email address.");
		return false;
	}
	
	if ($('#Street_Address').attr('value') == 'Street Address') {
		alert("Please enter your street address.");
		return false;
	}
	
	if ($('#Prospect_Name').attr('value') == 'Prospect Name') {
		alert("Please enter your prospect's name.");
		return false;
	}
	
	if ($('#Expected_Arrival').attr('value') == 'Expected Arrival') {
		alert("Please select the expected arrival date.");
		return false;
	}
	
	return true;
}

