function sendForm()
{
	if(validate())
	{
		formatMessage();
		document.mailForm.submit();
		window.setTimeout('window.location="Appointment_Confirm.htm"', 100);
	}
}

function validate()
{
	if(document.info.name.value == '')
		return error('Name');
	if(document.info.phone.value == '')
		return error('Phone');
	if(document.info.email.value == '')
		return error('E-mail');	
	 if(document.info.firstDate.value == '')
		return error('First Choice of Date');
        	if(document.info.firstTime.value == '')
		return error('First Choice of Time');
	
        
	return true;
}

function formatMessage()
{
	
	var source = document.info;
	var target = document.mailForm;
	var bodyValue = '';
	
	bodyValue += 'Information from Senders: ' + '\r\n';
	bodyValue += '____________________________________________________ ' + '\r\n';
	bodyValue += ' ' + '\r\n';
	bodyValue += 'Name----------------: ' + source.name.value + '\r\n';
	bodyValue += 'Street--------------: ' + source.street.value + '\r\n';
	bodyValue += 'City----------------: ' + source.city.value + '\r\n';
	bodyValue += 'State---------------: ' + source.state.value + '\r\n';
	bodyValue += 'Phone---------------: ' + source.phone.value + '\r\n';
	bodyValue += 'Email Address-------: ' + source.email.value + '\r\n';
	bodyValue += 'Service(s) Request--: ' + source.serviceRequest.value + '\r\n';
	bodyValue += '--------------------------------------------------- ' + '\r\n';
        bodyValue += 'First Choice Date---: ' + source.firstDate.value + '\r\n';
	bodyValue += 'First Choice Time---: ' + source.firstTime.value + '\r\n';
	bodyValue += '--------------------------------------------------- ' + '\r\n';
        bodyValue += 'Second Choice Date--: ' + source.secondDate.value + '\r\n';
	bodyValue += 'Second Choice Time--: ' + source.secondTime.value + '\r\n';
        bodyValue += '--------------------------------------------------- ' + '\r\n';
        
 	
        bodyValue += 'Hear About----------: ' + source.hearAbout.options[source.hearAbout.selectedIndex].value + '\r\n';
	target.body.value = bodyValue;
}

function error(field)
{
	alert(field + ' cannot be empty!');
	return false;
}
