function updateWhereHeard() {
	var f = document.edit_form;
	var sectionId = f.whereHeardSectionId.options[f.whereHeardSectionId.selectedIndex].value;
	if(sectionId == 'other') {
		document.getElementById('whereHeardDiv').style.display = 'none';
		displayOther(true);
	}
	else {
		displayOther(false);
		var oXmlHttp = zXmlHttp.createRequest();
		var url = "index.php?p=FindContractor&e=getWhereHeard&sectionId=" + sectionId;
		document.getElementById('whereHeardLoadingDiv').style.display = 'block';
		document.getElementById('whereHeardDiv').style.display = 'none';
		oXmlHttp.open("get", url, true);
		oXmlHttp.onreadystatechange = function() {
			if(oXmlHttp.readyState == 4) {
				if(oXmlHttp.status == 200) {
					displayWhereHeard(oXmlHttp.responseText);
				}
				else {
					alert('Unable to load whereHeard option list');
				}
			}
		};
		oXmlHttp.send(null);
	}
}

function displayWhereHeard(sText) {
	document.getElementById('whereHeardDiv').style.display = 'block';
	document.getElementById('whereHeardLoadingDiv').style.display = 'none';
	document.getElementById('whereHeardDiv').innerHTML = sText;
}

function displayOther(visible) {
	if(visible) {
		document.getElementById('whereHeardOtherDiv').style.display = 'block';
	}
	else {
		document.getElementById('whereHeardOtherDiv').style.display = 'none';
	}	
}


