		var submittedFlag = false;
		
		function validForm(fm) {
			if (submittedFlag) { return false; }
			else {
				var eMsg = '';
				
				var regExp_Email = /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;	// http://regxlib.com/REDetails.aspx?regexp_id=26
				if (!regExp_Email.test(fm.email.value)) { eMsg += '\n\t- invalid email address'; }
				
				if (fm.formType.value == 'New Sales Information' || fm.formType.value == 'Service Request') {
					if (fm.name.value.length == 0) { eMsg += '\n\t- name is a required field'; }
					if (fm.company.value.length == 0) { eMsg += '\n\t- you must enter a company'; }
					if (fm.phone.value.length == 0) { eMsg += '\n\t- missing phone number'; }
				}
				
				if (fm.formType.value == 'New Sales Information') {
					if (isNaN(fm.phoneQty.value)) { eMsg += '\n\t- invalid number of phones'; }
					if (isNaN(fm.phoneLines.value)) { eMsg += '\n\t- invalid number of phone lines'; }
				}
				
				if (fm.formType.value == 'Service Request') {
					if (fm.address1.value.length == 0) { eMsg += '\n\t- missing address'; }
					if (fm.city.value.length == 0) { eMsg += '\n\t- missing city'; }
					if (fm.state.value == '') { eMsg += '\n\t- invalid state'; }
					if (fm.zip.value.length == 0) { eMsg += '\n\t- missing zipcode'; }
					if (fm.work.value.length == 0) { eMsg += '\n\t- you must enter a message'; }
				}
				
				if (fm.formType.value == 'New Sales Information' || fm.formType.value == 'General Information') {
					if (fm.comments.value.length == 0) { eMsg += '\n\t- you must enter a message'; }
				}
				
				if (eMsg == '') {
					submittedFlag = true;
					return true;
				} else {
					alert('The following errors were encountered:' + eMsg);
					return false;
				}
			}
		}
		
		function changeContactForm(fmType) {
			if (document.getElementById) {
				if (document.getElementById('name_company_phone')) { hideBlock(document.getElementById('name_company_phone')); }
				if (document.getElementById('phones_voice')) { hideBlock(document.getElementById('phones_voice')); }
				if (document.getElementById('trouble_work')) { hideBlock(document.getElementById('trouble_work')); }
				if (document.getElementById('comments_other')) { hideBlock(document.getElementById('comments_other')); }

				if (fmType.value == 'New Sales Information') {
					if (document.getElementById('name_company_phone')) { showBlock(document.getElementById('name_company_phone')); }
					if (document.getElementById('phones_voice')) { showBlock(document.getElementById('phones_voice')); }
					if (document.getElementById('comments_other')) { showBlock(document.getElementById('comments_other')); }
				} else if (fmType.value == 'Service Request') {
					if (document.getElementById('name_company_phone')) { showBlock(document.getElementById('name_company_phone')); }
					if (document.getElementById('trouble_work')) { showBlock(document.getElementById('trouble_work')); }
				} else {
					if (document.getElementById('comments_other')) { showBlock(document.getElementById('comments_other')); }
				}
			}
		}
		
		function showBlock(thisBlock) {
			thisBlock.style.display = 'block';
			thisBlock.style.visibility = 'visible';
		}
		
		function hideBlock(thisBlock) {
			thisBlock.style.display = 'none';
			thisBlock.style.visibility = 'hidden';
		}
