// CivXplorer Code to support user help
// Suzanne Fliege, Allied Information Solutions, Inc.

// 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";
	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-Annotation':
	    titleString = "Map Annotation";
	    bodyString = "Add graphics or text to the map.";
		break
	case 'cxSidebar-AnnotationContents':
	    titleString = "Map Annotation";
	    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 '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_Search':
	    titleString = "Search";
	    bodyString = "Pre-configured searches for various map layers.";
		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_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_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, at the same scale.';
		bodyString += '<hr>Dragging a box on the reference map redraws the main map to those extents.';
		break
	case 'menuItem_Legend':
	    titleString = "Scalebar Legend";
		bodyString += 'Show or hide the legend on the map.  The legend appears in the upper left-hand corner of the map with the current map layer key.';
		break
	case 'menuItem_Scalebar':
	    titleString = "Scalebar Display";
		bodyString += 'Show or hide the scalebar on the map.  The scalebar appears in the upper right-hand corner of the map with the current map scale in map coordinate units.';
		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
// 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-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, use "Clear Shape" button below the map to reset 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
// footer tools
	case 'cxFooter-MapScaleZoom':
		titleString = 'Zoom To Scale';
		bodyString = 'Specifies the current scale the map is viewed at.';
		bodyString += '<br>You may edit the scale and click "Zoom" to change the scale.';
		break
	case 'cxFooter-IDLayer':
		titleString = 'Identify Layers';
		bodyString = 'The layers you may perform an Identify on.';
		bodyString += '<br>Pick a layer from the list and hover over a feature on the map to see information about that feature.';
		bodyString += '<br>You may only do Identify on one layer at a time!';
		break
	case 'cxFooter-SelectLayer':
		titleString = 'Select Layers';
		bodyString = 'The layers you may perform a Selection on.';
		bodyString += '<br>Pick a layer from the list and select features on the map.';
		break
	case 'cxFooter-SelectType':
		titleString = 'Selection Type';
		bodyString = 'You may do a new selection, add to a current selection or remove features from a current selection.';
		break
	case 'cxFooter-SelectShape':
		titleString = 'Selection Shape';
		bodyString = 'The shape you draw on the map to select features.';
		bodyString += '<br>Lines and Polygons require that you finalize the shape by clicking "Do Selection" below the map.';
		break
	case 'cxFooter-Measure':
		titleString = 'Measure Results';
		bodyString = 'The current measurement results.<br>Check the "Area" box for area measurement, uncheck it for linear measurements.';
		break
	case 'cxFooter-DoSelectButton':
		titleString = 'Do Selection';
		bodyString = 'Completes the selection shape on the map and executes a selection.';
		break
	case 'cxFooter-ClearShapeButton':
		titleString = 'Clear Shape';
		bodyString = 'Clears the shape graphic so you can redraw it, without executing a selection (or clearing the current selection).';
		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, at the same scale.';
		bodyString += '<hr>Dragging a box on the reference map redraws the main map to those extents.';
		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
	default:
	    titleString = theTool;
	    bodyString = "Help coming soon!";
	}
// show it
	updateContent("cxHelpTitle",titleString);
	updateContent("cxHelpBody",bodyString);
	document.getElementById('cxHelp').style.visibility = "visible";
	return false;
}
