// KEEP THIS FILE IDENTICAL FOR ALL BROKERAGES

function changeFrameSize(idx) {
	if (idx == 0) {
		parent.document.getElementById('mapframe').height = 450;
		parent.document.getElementById('mapframe').width = 700;
	} else if (idx == 1) {
		parent.document.getElementById('mapframe').height = 597;
		parent.document.getElementById('mapframe').width = 700;
	} else if (idx == 2) {
		parent.document.getElementById('mapframe').height = 867;
		parent.document.getElementById('mapframe').width = 920;
	}
}

function setSaleStatusChk() {
	if (document.compsSearchForm.salesStatus[0].checked) {
		document.compsSearchForm.forSale.checked = true;
		document.compsSearchForm.ona.checked = true;
		document.compsSearchForm.inContract.checked = true;
		document.compsSearchForm.forSale.disabled = false;
		document.compsSearchForm.ona.disabled = false;
		document.compsSearchForm.inContract.disabled = false;
	} else {
		document.compsSearchForm.forSale.checked = false;
		document.compsSearchForm.ona.checked = false;
		document.compsSearchForm.inContract.checked = false;
		document.compsSearchForm.forSale.disabled = true;
		document.compsSearchForm.ona.disabled = true;
		document.compsSearchForm.inContract.disabled = true;
	}
}

function validateCompsForm() {
	if (document.compsSearchForm.taxMap1) {
		// validate phantom listing fields
		//if (document.compsSearchForm.taxMap1.value == '' && document.compsSearchForm.taxMap2.value == '' && document.compsSearchForm.taxMap3.value == '00' && document.compsSearchForm.taxMap4.value == '' && document.compsSearchForm.taxMap5.value == '' && document.compsSearchForm.taxMap6.value == '' && document.compsSearchForm.phantom_street.value == '' && document.compsSearchForm.phantom_town[0].selected) {
		//	document.compsSearchForm.taxMap1.focus();
		//	alert("You must enter either the full tax map number or a full street address.");
		//	return false;
		//}

		if (document.compsSearchForm.phantom_street.value == '') {
			document.compsSearchForm.phantom_street.focus();
			alert("Please enter the street address.");
			return false;
		}
		if (document.compsSearchForm.phantom_town[0].selected) {
			document.compsSearchForm.phantom_town.focus();
			alert("Please select a town.");
			return false;
		}
		if (document.compsSearchForm.phantom_price.value == '') {
			document.compsSearchForm.phantom_price.focus();
			alert("Please enter a price for the phatom listing.");
			return false;
		}

		if (!(document.compsSearchForm.taxMap1.value == '' && document.compsSearchForm.taxMap2.value == '' && document.compsSearchForm.taxMap4.value == '' && document.compsSearchForm.taxMap5.value == '' && document.compsSearchForm.taxMap6.value == '')) {
			if (document.compsSearchForm.taxMap1.value == '') {
				document.compsSearchForm.taxMap1.focus();
				alert("Please enter a full tax map number.");
				return false;
			}
			if (document.compsSearchForm.taxMap2.value == '') {
				document.compsSearchForm.taxMap2.focus();
				alert("Please enter a full tax map number.");
				return false;
			}
			if (document.compsSearchForm.taxMap3.value == '') {
				document.compsSearchForm.taxMap3.focus();
				alert("Please enter a full tax map number.");
				return false;
			}
			if (document.compsSearchForm.taxMap4.value == '') {
				document.compsSearchForm.taxMap4.focus();
				alert("Please enter a full tax map number.");
				return false;
			}
			if (document.compsSearchForm.taxMap5.value == '') {
				document.compsSearchForm.taxMap5.focus();
				alert("Please enter a full tax map number.");
				return false;
			}
			if (document.compsSearchForm.taxMap6.value == '') {
				document.compsSearchForm.taxMap6.focus();
				alert("Please enter a full tax map number.");
				return false;
			}
		}
	}
}

