function validate(){
	if (!document.forms[0]['EmployingBroker'].value.length>0){
		alert('Please enter the employing broker.');
		document.forms[0]['EmployingBroker'].focus();
		return false;
	}
	if (!document.forms[0]['BrokerSalesAssociate'].value.length>0){
		alert('Please enter the broker sales associate.');
		document.forms[0]['BrokerSalesAssociate'].focus();
		return false;
	}
	if (!document.forms[0]['BrokerAddress'].value.length>0){
		alert('Please enter the broker address.');
		document.forms[0]['BrokerAddress'].focus();
		return false;
	}
	if (!document.forms[0]['BrokerPhone'].value.length>0){
		alert('Please enter the broker office phone/fax.');
		document.forms[0]['BrokerPhone'].focus();
		return false;
	}
	emailPattern = /^[\w\d]+(\.[\w\d]+)*@[\w\d]+(\.[\w\d]+)+$/
	if (!emailPattern.test(document.forms[0]['BrokerEmail'].value)){
		alert('Please enter a valid broker email address.');
		document.forms[0]['BrokerEmail'].focus();
		document.forms[0]['BrokerEmail'].select();
		return false;
	}
	if (!communitiesOK){
		alert('Please select the Moceri Companies community and today\'s date.');
		return false;
	}
	if (!document.forms[0]['MoceriSalesAssociate'].value.length>0){
		alert('Please enter the Moceri Sales Associate.');
		document.forms[0]['MoceriSalesAssociate'].focus();
		return false;
	}
	if (!document.forms[0]['Client'].value.length>0){
		alert('Please enter the client\'s full name.');
		document.forms[0]['Client'].focus();
		return false;
	}
	if (!document.forms[0]['Client'].value.length>0){
		alert('Please enter the client\'s full name.');
		document.forms[0]['Client'].focus();
		return false;
	}
	if (!document.forms[0]['Client'].value.length>0){
		alert('Please enter the client\'s full name.');
		document.forms[0]['Client'].focus();
		return false;
	}
	if (!document.forms[0]['ClientPhone'].value.length>0){
		alert('Please enter the client\'s home and work phone numbers.');
		document.forms[0]['ClientPhone'].focus();
		return false;
	}
	if (!document.forms[0]['ClientAddress'].value.length>0){
		alert('Please enter the client\'s full address.');
		document.forms[0]['ClientAddress'].focus();
		return false;
	}
	if (!emailPattern.test(document.forms[0]['ClientEmail'].value)){
		alert('Please enter a valid client email address.');
		document.forms[0]['ClientEmail'].focus();
		document.forms[0]['ClientEmail'].select();
		return false;
	}
	return true;
}
function testCommunities(c){
	communitiesOK = (c.length>0) ? true:false;
	document.forms[0]['MoceriCommunity'].value = c.replace('\'','');
}
function getObj(obj) {
	if (document.getElementById){
		return document.getElementById(obj);
	} else {
		return document[obj];
	}
}
function insertCommunities(){
	communitiesOK = false;
	theDate = new Date();
	theDateString = (theDate.getMonth() + 1) + '/' + theDate.getDate() + '/' + theDate.getFullYear() + ' - ';
	theCommunities = '<select name="MoceriCommunityDate" onchange="testCommunities(this.value);" multiple>';
	theCommunities += '<option value="">PLEASE SELECT</option>';
	theCommunities += '<option value="' + theDateString + 'Aberdeen At Hartford">' + theDateString + 'Aberdeen At Hartford</option>';
	theCommunities += '<option value="' + theDateString + 'Addison At Hartford">' + theDateString + 'Addison At Hartford</option>';
	theCommunities += '<option value="' + theDateString + 'Camelot Villa">' + theDateString + 'Camelot Villa</option>';
	theCommunities += '<option value="' + theDateString + 'Carrollton Hills">' + theDateString + 'Carrollton Hills</option>';
	theCommunities += '<option value="' + theDateString + 'Claremont">' + theDateString + 'Claremont</option>';
	theCommunities += '<option value="' + theDateString + 'Cloisters">' + theDateString + 'Cloisters</option>';
	theCommunities += '<option value="' + theDateString + 'Cottages At Mill River">' + theDateString + 'Cottages At Mill River</option>';
	theCommunities += '<option value="' + theDateString + 'Kingsridge">' + theDateString + 'Kingsridge</option>';
	theCommunities += '<option value="' + theDateString + 'Kirklands">' + theDateString + 'Kirklands</option>';
	theCommunities += '<option value="' + theDateString + 'LeBear Residential Club & Spa">' + theDateString + 'LeBear Residential Club &amp; Spa</option>';
	theCommunities += '<option value="' + theDateString + 'Manors At Knollwood">' + theDateString + 'Manors At Knollwood</option>';
	theCommunities += '<option value="' + theDateString + 'Oakmonte At Mill River">' + theDateString + 'Oakmonte At Mill River</option>';
	theCommunities += '<option value="' + theDateString + 'Reflections At Mill River">' + theDateString + 'Reflections At Mill River</option>';
	theCommunities += '<option value="' + theDateString + 'Rivers Edge At Cherry Hill Village">' + theDateString + 'Rivers Edge At Cherry Hill Village</option>';
	theCommunities += '<option value="' + theDateString + 'Shelby Forest">' + theDateString + 'Shelby Forest</option>';
	theCommunities += '<option value="' + theDateString + 'Shelby Woods">' + theDateString + 'Shelby Woods</option>';
	theCommunities += '<option value="' + theDateString + 'Trailside At Mill River">' + theDateString + 'Trailside At Mill River</option>';
	theCommunities += '</select>';
	theTD = getObj('MoceriCommunityDateTD');
	theTD.innerHTML = theCommunities;
}
