function LocationSearch() {
	var zip = $('#zip').val();
	
	if (zip.length == 0) {
		alert("You forgot to enter a zip code");
	} else {
		document.getElementById('map_canvas').style.display = "block";
		initialize(); // init the google maps api
		$('#location_results').html("<img src='_images/loading.gif' border='0'/>");
		// send the form via ajax
		$.post('modules/locationsAJAX.aspx', { zip:zip }, function(sData) { 
			$('#location_results').html(sData);
		});
	}
	return false;	
}
function DoctorSearch(val) {
	$('#doctor_results').html("<img src='_images/loading.gif' border='0'/>");
	// send the form via ajax
	$.post('modules/doctorsAJAX.aspx', { val:val }, function(sData) { 
		$('#doctor_results').html(sData);
	});
	return true;
}
function LinkToggle(id) {
	var obj = document.getElementById("link_container"+ id);
	if (obj.style.display == "none" || obj.style.display == "") {
		$('#link_container'+ id).show("fast");
	} else {
		$('#link_container'+ id).hide("fast");
	}
}
function setLocationTab(iVal,iLid) { 
	if (iVal == 0) {
		document.getElementById("generalInfoTab").className = "locationDetailActive";
		document.getElementById("doctorInfoTab").className = "locationDetail";
		$('#location_information_container').html("<img src='_images/loading.gif' border='0'/>");
		$.post('modules/officeInformation.aspx', {lid:iLid}, function(sData) {
			$('#location_information_container').html(sData);
		});
	} else {
		document.getElementById("generalInfoTab").className = "locationDetail";
		document.getElementById("doctorInfoTab").className = "locationDetailActive";
		$('#location_information_container').html("<img src='_images/loading.gif' border='0'/>");
		$.post('modules/doctorInformation.aspx', {lid:iLid}, function(sData) {
			$('#location_information_container').html(sData);
		});
	}
}
function SwapImage(sImageName) {
	$('#docImage').fadeOut("fast", function () {
		$('#docImage').attr("src", "upload/doctors/" + sImageName); 
		$('#docImage').fadeIn("fast");
	});
}
function SwapDocImage(id,iState) {
	if (iState == 0) {
		$('#docImage' + id).fadeOut("fast");
	} else {
		$('#docImage' + id).fadeIn("fast");
	}
}
