function submitIt()
{
	// Check for Complete Edits
	if ( checkEdits() == true ) {
		document.frmRequest.submit();
		return true;

	}
}
function checkEdits()
{

	// Check Country
	if (window.document.frmRequest.cboCountry.value=='Select One') {
		alert('Please enter the country where your company is located.');
		window.document.frmRequest.cboCountry.focus();
		return false;
	}
	// Check Company Name
	if (window.document.frmRequest.txtCompany.value=='') {
		alert('Please enter the name of your company.');
		window.document.frmRequest.txtCompany.focus();
		return false;
	}
	// Check Contact Name
	if (window.document.frmRequest.txtContact.value=='') {
		alert('Please enter the contact name at your company.');
		window.document.frmRequest.txtContact.focus();
		return false;
	}
	// Check Address
	if (window.document.frmRequest.txtAddress1.value=='') {
		alert('Please enter the address of your company.');
		window.document.frmRequest.txtAddress1.focus();
		return false;
	}
	// Check City
	if (window.document.frmRequest.txtCity.value=='') {
		alert('Please enter the city where your company is located.');
		window.document.frmRequest.txtCity.focus();
		return false;
	}
	// Check US State
	if ((window.document.frmRequest.cboCountry.value=='United States') && (window.document.frmRequest.cboState.value=='Select One')) {
		alert('Please enter the state where your company is located.');
		window.document.frmRequest.cboState.focus();
		return false;
	}
	// Check Canadian Province
	if ((window.document.frmRequest.cboCountry.value=='Canada') && (window.document.frmRequest.cboProvince.value=='Select One')) {
		alert('Please enter the province where your company is located.');
		window.document.frmRequest.cboProvince.focus();
		return false;
	}
	// Check Australian State
	if ((window.document.frmRequest.cboCountry.value=='Australia') && (window.document.frmRequest.cboAustralianState.value=='Select One')) {
		alert('Please enter the state or territory where your company is located.');
		window.document.frmRequest.cboAustralianState.focus();
		return false;
	}
	// Check South African Province/State
	if ((window.document.frmRequest.cboCountry.value=='South Africa') && (window.document.frmRequest.txtState.value=='')) {
		alert('Please enter the province or state where your company is located.');
		window.document.frmRequest.txtState.focus();
		return false;
	}
	// Check United Kingdom Province/State
	if ((window.document.frmRequest.cboCountry.value=='United Kingdom') && (window.document.frmRequest.txtState.value=='')) {
		alert('Please enter the province or state where your company is located.');
		window.document.frmRequest.txtState.focus();
		return false;
	}
	// Check South Other Province/State
	if ((window.document.frmRequest.cboCountry.value=='Other') && (window.document.frmRequest.txtState.value=='')) {
		alert('Please enter the province or state where your company is located.');
		window.document.frmRequest.txtState.focus();
		return false;
	}
	// Check Zip
	if (window.document.frmRequest.txtZip.value=='') {
		alert('Please enter the zip or postal code where your company is located.');
		window.document.frmRequest.txtZip.focus();
		return false;
	}
	// Check Zip
	if (window.document.frmRequest.txtZip.value=='') {
		alert('Please enter the zip or postal code where your company is located.');
		window.document.frmRequest.txtZip.focus();
		return false;
	}
	// Check Phone
	if (window.document.frmRequest.txtPhone.value=='') {
		alert('Please enter the phone number for your company.');
		window.document.frmRequest.txtPhone.focus();
		return false;
	}
	// Check Phone
	if (formatPhone(window.document.frmRequest.txtPhone.value).length < 10){
		alert('Invalid phone number entered for your company.');
		window.document.frmRequest.txtPhone.focus();
		return false;
	}
	// Check Fax
	if ((formatPhone(window.document.frmRequest.txtFax.value).length < 10) && (formatPhone(window.document.frmRequest.txtFax.value).length > 0)){
		alert('Invalid fax number entered for your company.');
		window.document.frmRequest.txtFax.focus();
		return false;
	}
	// Check E-Mail
	if (window.document.frmRequest.txtEMail.value=='') {
		alert('Please enter your e-mail address.');
		window.document.frmRequest.txtEMail.focus();
		return false;
	}
	// Check E-Mail
	if (validEmail(window.document.frmRequest.txtEMail.value)==false) {
		alert('You must enter a valid e-mail address.');
		window.document.frmRequest.txtEMail.focus();
		return false;
	}
	// Check Truck Quantity
	if (window.document.frmRequest.cboTrucks.value=='Select One') {
		alert('Please select the number of trucks at your company.');
		window.document.frmRequest.cboTrucks.focus();
		return false;
	}
	// Check Driver Quantity
	if (window.document.frmRequest.cboDrivers.value=='Select One') {
		alert('Please select the number of drivers at your company.');
		window.document.frmRequest.cboDrivers.focus();
		return false;
	}
	// Check Driver Payment
	if (window.document.frmRequest.cboPayDrivers.value=='Select One') {
		alert('Please select how you pay your drivers.');
		window.document.frmRequest.cboPayDrivers.focus();
		return false;
	}
	// Check Calls Per Day
	if (window.document.frmRequest.cboCallsPerDay.value=='Select One') {
		alert('Please select how many calls per day your company performs.');
		window.document.frmRequest.cboCallsPerDay.focus();
		return false;
	}
	// Check Customers Quantity
	if (window.document.frmRequest.cboCustomers.value=='Select One') {
		alert('Please select the customers your company deals with.');
		window.document.frmRequest.cboCustomers.focus();
		return false;
	}
	// Check Autoleague Affiliated
	if (window.document.frmRequest.cboAutoLeague.value=='Select One') {
		alert('Please select whether your company is an auto league affiliate.');
		window.document.frmRequest.cboAutoLeague.focus();
		return false;
	}
	// Check Impound Yard
	if (window.document.frmRequest.cboImpoundYard.value=='Select One') {
		alert('Please select whether your company has an impound yard.');
		window.document.frmRequest.cboImpoundYard.focus();
		return false;
	}
	// Check Impound Vehicles
	if (window.document.frmRequest.cboImpoundVehicles.value=='Select One') {
		alert('Please select the number of vehicles usually in your impound yard.');
		window.document.frmRequest.cboImpoundVehicles.focus();
		return false;
	}
	// Check Full-Time Dispatcher
	if (window.document.frmRequest.cboDispatcher.value=='Select One') {
		alert('Please select whether your company has a full time dispatcher.');
		window.document.frmRequest.cboDispatcher.focus();
		return false;
	}
	// Check Computer Quantity
	if (window.document.frmRequest.cboComputers.value=='Select One') {
		alert('Please select the number of computers at your company.');
		window.document.frmRequest.cboComputers.focus();
		return false;
	}
	// Check Existing Software
	if (window.document.frmRequest.cboExistingSoftware.value=='Select One') {
		alert('Please select the towing software you are currently using.');
		window.document.frmRequest.cboExistingSoftware.focus();
		return false;
	}
	// Check Lead Source
	if (window.document.frmRequest.cboHearAboutUs.value=='Select One') {
		alert('Please select how you heard about OnScene Solutions.');
		window.document.frmRequest.cboHearAboutUs.focus();
		return false;
	}
	
	return true;
}

function formatPhone(phone) {
	var stripped = phone.replace(/[\(\)\.\-\ ]/g, '');
	
	return stripped;
}

function validEmail(email) {
	invalidChars = " /:,;";
	
	if (email == "") {
		return false;
	}
	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i);
		if (email.indexOf(badChar,0) > -1) {
			return false;
		}
	}
	atPos = email.indexOf("@",1)
	if (atPos == -1) {
		return false;
	}
	if (email.indexOf("@",atPos+1) > -1) {
		return false;
	}
	periodPos = email.indexOf(".",atPos)
	if (periodPos == -1) {
		return false;
	}
	if (periodPos+3 > email.length)	{
		return false;
	}
	return true;
}

