// Suzanne Fliege
// Red Horse Geographics, LLC

// CivXplorer Code to support user help

// hide help
function hideHelp() {
	document.getElementById('cxHelp').style.visibility = "hidden";
	return false;
}

// show help
function showHelp(theTool) {
    var titleString = '';
    var bodyString = '';
	// truncate for search
	if (theTool.indexOf("menuItem_Search") != -1) theTool = "menuItem_Search";
	// truncate for selectByArea
	if (theTool.indexOf("menuItem_SelectByArea") != -1) theTool = "menuItem_SelectByArea";
	if (theTool.indexOf("menuItem_Zoom2Area") != -1) theTool = "menuItem_Zoom2Area";
	switch(theTool) {
// sidebar items
	case 'cxSidebar-WelcomeHeader':
	    titleString = "Welcome";
	    bodyString = "General information about this application is provided here.";
		break
	case 'cxSidebar-WelcomeContents':
	    titleString = "Welcome";
	    bodyString = "General information about this application is provided here.";
		break
	case 'cxSidebar-MapLayers':
	    titleString = "Map Layers";
	    bodyString = "View the list of map layers and the legend.  Control what layers are visible on the map.";
		break
	case 'cxSidebar-MapLayersContents':
	    titleString = "Map Layers";
	    bodyString = "View the list of map layers and the legend.  Control what layers are visible on the map.";
		break
	case 'cxSidebar-Selection':
	    titleString = "Current Selection";
	    bodyString = "A display of the currently selected features for the active map layer.  Reports available for a map layer are also accessible here.";
		break
	case 'cxSidebar-SelectionContents':
	    titleString = "Current Selection";
	    bodyString = "A display of the currently selected features for the active map layer.";
		break
	case 'cxSidebar-PrintMap':
	    titleString = "Printable Map";
	    bodyString = "Create two types of printable map formats.";
		break
	case 'cxSidebar-PrintMapContents':
	    titleString = "Printable Map";
	    bodyString = "Create two types of printable map formats.";
		bodyString += "<br>PDF Document can be saved to your computer and has several formatting options.";
		bodyString += "<br>JPG Image creates an image you can copy and paste into other applications.";
		bodyString += "<br>Both map formats use the current main map view extents to define what is shown in the resulting map.";
		break
	case 'cxSidebar-Information':
	    titleString = "About This Website";
	    bodyString = "General information about the data shown in this website and disclaimer notices.";
		break
	case 'cxSidebar-InformationContents':
	    titleString = "About This Website";
	    bodyString = "General information about the data shown in this website and disclaimer notices.";
		break
// search menu
	case 'menutabFind':
	    titleString = "Find";
	    bodyString = "Locate Map Features with pre-configured searches.";
		break
	case 'menuItem_FindInParcels':
	    titleString = "Search Parcels";
	    bodyString = "Pre-configured searches for parcel/property layers.";
		break
	case 'menuItem_FindByIntersection':
	    titleString = "Find By Intersection";
	    bodyString = "Find a location by Street Intersection";
		bodyString += "<hr>Zooms the map to the street intersection specified.<br>Enter street names, seperated by \"&\"<br>(ex. \"MAIN & STATE\").<br>For best results use only street name, not directional or type<br>(ex. \"MAIN & STATE\", not \"MAIN ST W & STATE ST N\").";
		break
	case 'menuItem_Zoom2Area':
	    titleString = "Find By Area/Landmark";
	    bodyString = "Find a location by its Name";
		bodyString += "<hr>Zooms the map to a specified location.<br>Specify an area/landmark name, then click \"Find It\" to zoom the map to it.";
		break
	case 'menuItem_LatLongPtZoom':
		titleString = 'Put a Point on Map by Lat/Long';
		bodyString = 'Enter a point by Latitude and Longitude coordinates (decimal degrees)<br>and it will zoom to and display it on the map.';
		bodyString += '<hr>The lat/long point symbol type and color can be specified.<br>If a label is specified, it will be placed on the map alongside the point.';
		break
	case 'menuItem_LatLongPtClear':
		titleString = 'Clear Lat/Long Point';
		bodyString = 'Clears the Lat/Long point from the map.';
		break
	case 'menuItem_LatLongPtCoord':
		titleString = 'Click on Map for Lat/Long Coords';
		bodyString = 'This tool will return latitude and longitude coordinates for the point clicked.';
		bodyString += '<hr>Coordinates of the current mouse position on the map, in the map data units, are always displayed in the status bar at the lower left of your browser window.';
		break
// select menu
	case 'menutabSelect':
	    titleString = "Feature Selection Tools";
	    bodyString = "Tools to select features on the map.";
		break
	case 'menuItem_Identify':// if edited, also change for the tool!
	    titleString = "Identify";
		bodyString = 'View details about features in a map layer by hovering over them with the mouse cursor.';
		bodyString += '<hr>Specify a layer below the map, then hover over a feature to see information about it.';
		bodyString += '<br><b>Using Identify will NOT change your selection!</b>';
		break
	case 'menuItem_SelectOnMap':// if edited, also change for the tool!
	    titleString = "Select On Map";
		bodyString = 'Select features on the map by defining a shape.';
		bodyString += '<hr>Once the tool is active, specify a layer, selection type and selection shape below the map, then draw the shape on the map to select features.<br>Attributes for selected features will be displayed, along with available reports.';
		bodyString += '<hr>You can maintain selections in multiple layers, but only view the selection in one layer at a time!';
		break
	case 'menuItem_SelectByLocation':
	    titleString = "Select By Location (Buffering)";
		bodyString = 'Select map features based on their proximity to other features.';
		bodyString += '<hr>You may select features within a specified distance, or just those that overlap the currently selected features in a map layer.';
		bodyString += '<hr>Specify the layer to select from, the distance to search, and the layer to search around.';
		break
	case 'menuItem_SelectByAttribute':
	    titleString = "Select By Attribute (Query)";
		bodyString = 'Search for a map feature by querying the database.';
		bodyString += '<hr>You can build your own custom queries, on one or more attributes.<br>Queries will last during your current mapping session.';
		bodyString += '<hr>You can combine queries for more specialized searches. Check the queries you want to use, then specify the type of selection ("and" or "or").';
		bodyString += '<hr>You can add to your current selection or do a subset selection. In the dropdown specify "New Selection", "Add to Selection" or "Select from Current Selection".';
		break
	case 'menuItem_ClearSelections':
	    titleString = "Clear All Selections";
	    bodyString = "Clears current selections in ALL map layers.";
		break
// advanced menu
	case 'menutabAdvanced':
	    titleString = "Advanced Tools";
	    bodyString = "Additional Tools that give you<br>added functionality.<br>Availability will vary!";
		break
	case 'menuItem_VEBirdsEye':
	    titleString = "Virtual Earth Bird's Eye Map";
		bodyString += 'This opens Virtual Earth\'s "Bird\'s Eye" Map, focused on the current map\'s center.<br>You must be zoomed in to a certain scale before Bird\'s Eye will be accessible.';
		bodyString += '<hr>This is a link to an independent website: functionality and availability is not guaranteed.';
		break
	case 'menuItem_MapGraphicDraw':
	    titleString = "Map Annotation/Graphics";
	    bodyString = "Add graphics or text to the map. Annotation lasts until you clear it or your map session ends.";
		bodyString += "<br>Be sure to specify colors or other properties for your annotation before saving it to the map!";
		break
	case 'menuItem_MapGraphicClear':
	    titleString = "Clear All Annotation from the Map";
	    bodyString = "Clears all graphics and annotation from the map.";
		break
	case 'menuItem_NoAdvanced':
	    titleString = "Advanced Tools";
		bodyString += 'No Additional Tools are Available!';
		break
// settings menu
	case 'menutabSettings':
	    titleString = "Settings";
	    bodyString = "Miscellaneous Tools that allow you to<br>configure the interface.";
		break
	case 'menuItem_OverviewMap':
	    titleString = "Reference Map Display";
		bodyString += 'Open or close the Reference Map.  The Reference Map displays the full map extents, and a box bounding the current main map extents';
		bodyString += '<hr>Clicking on the reference map centers the main map on your click.';
		break
	case 'menuItem_Help':
	    titleString = "Help Notes Display";
	    bodyString = "Turn these help notes on or off.  When turned on, Help Notes pop up to give information on the tools available in this application.";
		break
	case 'menuItem_ChangeUnits':
	    titleString = "Change Scale Bar Units";
	    bodyString = "Change the measurement units displayed on the map's scalebar.";
		break
	case 'menuItem_Metadata':
	    titleString = "Metadata";
	    bodyString = "Metadata is information about the data shown in the map and available in reports.  It usually describes where the data came from, when it was created, and who created it.";
		break
	case 'menuItem_FAQ':
	    titleString = "FAQ (Frequently Asked Questions)";
	    bodyString = "<b>Frequently Asked Questions</b> about this application are shown, with answers.";
		break
	case 'menuItem_Reset':
	    titleString = "Reset Map and Selections";
		bodyString += 'This will reset the map back to starting conditions, including map view, layer visibility, clearing selections and reports.';
		break
// map toolbar
	case 'cxOnMap-ZoomIn':
		titleString = 'Zoom In';
		bodyString = 'Click and drag a box on the map to define the area to zoom in to, or a single click will zoom in one step.';
		break
	case 'cxOnMap-ZoomOut':
		titleString = 'Zoom Out';
		bodyString = 'Click and drag a box on the map to define the scale to zoom out (small box means a larger zoom out), or a single click will zoom out one step.';
		break
	case 'cxOnMap-Recenter':
		titleString = 'Pan';
		bodyString = 'A single click will center map on the spot clicked. Click and drag the map to pan to new area to view.';
		break
	case 'cxOnMap-ZoomAll':
		titleString = 'Zoom To Full Extent';
		bodyString = 'Returns the map to the full data extent.';
		bodyString += '<br>This does NOT affect current feature selections, annotation or map layer visibility status.';
		break
	case 'cxOnMap-ZoomPrevious':
		titleString = 'Zoom To Previous Extent';
		bodyString = 'Returns the map to the last data extent. Only the single last extent is stored!';
		bodyString += '<br>This does NOT affect current feature selections, annotation or map layer visibility status.';
		break
	case 'cxOnMap-Identify':// if edited, also change for the menu!
	    titleString = "Identify";
		bodyString = 'View details about features in a map layer by hovering over them with the mouse cursor.';
		bodyString += '<hr>Specify a layer below the map, then hover over a feature to see information about it.';
		bodyString += '<br><b>Using Identify will NOT change your selection!</b>';
		break
	case 'cxOnMap-Select':// if edited, also change for the menu!
	    titleString = "Select On Map";
		bodyString = 'Select features on the map by defining a shape.';
		bodyString += '<hr>Once the tool is active, specify a layer, selection type and selection shape below the map, then draw the shape on the map to select features.<br>Attributes for selected features will be displayed, along with available reports.';
		//bodyString += '<hr>You can maintain selections in multiple layers.';
		break
	case 'cxOnMap-Measure':
		titleString += 'Measure Distances/Area on Map';
		bodyString = 'Click points to measure distances on the map, double-click to end and start again.';
		bodyString += '<hr>Distances will be displayed on the map until a new measurement is started or another tool is selected.';
		bodyString += '<br>Checking "area" will show the area of a polygon, once 3 or more points have been clicked.';
		bodyString += '<hr>Changing the units of measure will allow for measurements in feet, meters, miles and kilometers.';
		break
	case 'cxOnMap-PanCompass':
		titleString = 'Panning Compass';
		bodyString = 'Pan the map a half-frame in the direction the arrow points, at the same scale.';
		bodyString += '<br>You may pan the map north, south, east, west, northwest, southwest, northeast or southeast.';
		break
// overview map
	case 'cxOverviewMap':
	    titleString = "Reference Map";
		bodyString += 'The Reference Map displays the full map extents, and a box bounding the current main map extents';
		bodyString += '<hr>Clicking on the reference map centers the main map on your click.';
		break
	case 'cxOverviewMapArrow':
	    titleString = "Open/Close Reference Map";
		bodyString += 'Open or close the Reference Map.  The Reference Map displays the full map extents, and a box bounding the current main map extents';
		break
//***************************** custom Beltrami help!!
// E911 search
	case 'menuItem_E911search':
		titleString = 'E911 Address Search';
		bodyString = 'Search E911 Address data by House Number, Street, Owner or Parcel Tax ID';
		break
// RVI webpage
	case 'menuItem_RVI':
		titleString = 'Land Records Survey Website';
		bodyString = 'Search Land Records Survey documents';
		break
// RVI webpage
	case 'menuItem_RVIinstructions':
		titleString = 'Land Records Survey Instructions';
		bodyString = 'Information on how to search Land Records Survey documents';
		break
	default:
	    titleString = theTool;
	    bodyString = "Help coming soon!";
	}
// show it
	updateContent("cxHelpTitle",titleString);
	updateContent("cxHelpBody",bodyString);
	document.getElementById('cxHelp').style.visibility = "visible";
	return false;
}
