	// function showHideTable(JQuery table, JQuery totalCell)
	// tests to see if totalCell is zero or empty, hides the table if so. Shows it otherwise.
	function showHideTable(table, totalCell) {
		if (totalCell.html() == "0" || totalCell.html() == "") {
			table.css("display", "none");
			$("#no-summary").css("display", "block");
		} else {
			table.css("display", "block");
			$("#no-summary").css("display", "none");
		}
	}
	
	// updateTotalDisplay()
	// used for between refresh updates to the overall emissions total figure shown on the page.
	function updateTotalDisplay() {
		updateURL = "includes/get-emission-total.php?session_id=" + $("#hidden-session-id").val();
		var totalEmissions = $.get(updateURL, function(data) {
			$("#overallEmissions").html(data);
		});	
	}
	
	// turns visibility of HTML elements on or off.
	function switchLayer( whichLayer, action ) {

		whichLayer = "#" + whichLayer;
		
		if (action == 'on') {
			if ( $(whichLayer).is("span") ) {
				$(whichLayer).css("display", "inline");
			} else {
				$(whichLayer).css("display", "block");
			}
		} else {
			$(whichLayer).css("display", "none");
		}
		return;
	}
	
	MILES2KMMULTIPLIER = 1.609344;