function countryChange(theForm) {
// Reset values when country changes: (Note only MS IE recognizes the disabled property.
// Netscape will ignore this and allow users input.  Therefore, this function is called
// from edit() below to reset errorneous input from Netscape.
// If USA:
	if (theForm.countryType[0].checked) {
		theForm.state.disabled = false;
		theForm.province.selectedIndex = 0;
		theForm.province.disabled = true;
		theForm.otherState.value = "";
		theForm.otherState.disabled = true;
		theForm.country.selectedIndex = 0;
		theForm.country.disabled = true;
	}
// If Canada:
	if (theForm.countryType[1].checked) {
		theForm.province.disabled = false;
		theForm.state.selectedIndex = 0;
		theForm.state.disabled = true;
		theForm.otherState.value = "";
		theForm.otherState.disabled = true;
		theForm.country.selectedIndex = 0;
		theForm.country.disabled = true;
	}

// If Other:
	if (theForm.countryType[2].checked) {
		theForm.otherState.disabled = false;
		theForm.country.disabled = false;
		theForm.state.selectedIndex = 0;
		theForm.state.disabled = true;
		theForm.province.selectedIndex = 0;
		theForm.province.disabled = true;
	}

}

function edit(theForm) {

// Reset erroneous input if Netscape: 
if (navigator.appName == 'Netscape') { countryChange(theForm);}

var errorFound = false;
var infoRequested = false;

// First and Last Name are required:
	if (theForm.firstName.value == "" ||
	    theForm.lastName.value == "") {
		if (confirm ("Please provide both your first and last name."))
			{ errorFound = true; }
		else	{ return; }
	}

// Company is required:
//	if (theForm.company.value == "") {
//		if (confirm ("Please provide your company name."))
//			{ errorFound = true; }
//		else 	{ return; }
//	}

// Phone or e-mail is required:
	if (theForm.phone.value == "" && theForm.email.value == "") {
		if (confirm ("Please provide your phone number and/or email address."))
			{ errorFound = true; }
		else 	{ return; }
	}

// If information requested, mailing address is required:
	if (theForm.cbPlan.checked ||
	    theForm.cbEval.checked ||
	    theForm.cbImp.checked ||
	    theForm.cbDW.checked ||
	    theForm.cbInet.checked ||
	    theForm.cbEzx.checked ||
	    theForm.cbTRGeac.checked ||
	    theForm.cbTRSQL.checked ||
	    theForm.cbTRCognos.checked) { 

	// Set variable for "thank you" message below:
		infoRequested = true;
		
	// Edit Address:
//		if (theForm.addr1.value == "" &&
//		    theForm.addr2.value == "") {
//			if (confirm ("Please enter your street address."))
//				{ errorFound = true; }
//			else 	{ return; }
//		}

	// Edit City:
//		if (theForm.city.value == "") {
//			if (confirm ("Please enter your city.")) 
//				{ errorFound = true; }
//			else 	{ return; }
//		}

	// Edit State / Country:
		// USA:
//		if (theForm.countryType[0].checked &&
//		    theForm.state.selectedIndex == 0) {
//		 	if (confirm ("Please select a valid US state."))
//		 		{ errorFound = true; }
//		 	else	{ return; }
//		}
		
		// Canada:
//		if (theForm.countryType[1].checked &&
//		    theForm.province.selectedIndex == 0) {
//			if (confirm ("Please select a valid Canadian province"))
//				{ errorFound = true; }
//			else 	{ return; }
//		} 
		
		// Other:
//		if (theForm.countryType[2].checked &&
//		    theForm.country.selectedIndex == 0) {
//		 	if (confirm ("Please select your country."))
//		 		{ errorFound = true; }
//		 	else	{ return; }
//		}

	// Zip Code is required for USA:
//		if (theForm.countryType[0].checked && 
//		    theForm.zip.value == "") {
//			if (confirm ("Please enter your zip code."))
//				{ errorFound = true; }
//			else	{ return; }
//		}

	// Postal Code is required for Canada:
//		if (theForm.countryType[1].checked && 
//		    theForm.zip.value == "") {
//			if (confirm ("Please enter your postal code."))
//				{ errorFound = true; }
//			else	{ return; }
//		}
	}
	
// Check for Errors:
	if (errorFound) { return; }

// Thank you:
	if (infoRequested)
		{ alert ("Thank you for contacting Applied Business Systems.  The information you requested will be sent right away."); }
	else 	{ alert ("Thank you for visiting our web site!"); }

	document.contactForm.submit();

}