/* ***********************************************************
config_menubar_map.js
Javascript that creates the horizontal menu bar for the viewer.asp
page in Map Viewer 3rd Edition. This menu bar includes map tools.
--------------------------------------------------------------
Browser compatibility - Supports W3C DOM compatible browsers such
as IE 5, 5.5, and 6; Netscape 7 and Mozilla FireFox 1. Does not 
support IE 4 and Netscape Navigator 4.
--------------------------------------------------------------
Dependencies - jsdomenu.js, jsdomenubar.js  
--------------------------------------------------------------
Acknowledgements - jsDOMenuBar Version 1.1.1, Copyright (C) 2004
- 2005 Toh Zhiqiang Released on 12 February 2005. jsDOMenuBar is
distributed under the terms of the GNU GPL license. This program 
is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or 
(at your option) any later version. Download jsDOMenuBar at 
http://www.tohzhiqiang.per.sg/projects/jsdomenubar/ and refer to
license.txt and readme.txt included in the download for more 
information.
--------------------------------------------------------------
History
May 2005, Initial code for Map Viewer 3rd Edition
Jul 2005, Revised for Map Viewer 3rd Edition update 
************************************************************ */

function createjsDOMenu() {
	mainMenu1 = new jsDOMenu(110);
	with (mainMenu1) {
		addMenuItem(new menuItem("Full View", "fv", "Javascript:setMapAction('fullview')"));
		addMenuItem(new menuItem("Zoom In", "zi", "Javascript:setMapAction('centerzoomin')"));
		addMenuItem(new menuItem("Zoom Out", "zo", "Javascript:setMapAction('centerzoomout')"));
		if (objMapForm.enablesearch) {
			if (objMapForm.enablesearch.value == "true") {
				addMenuItem(new menuItem("Find", "fi", "Javascript:loadPage('find.asp')"));
			}
		}
	}
	
  	mainMenu2 = new jsDOMenu(150);
	
  	with (mainMenu2) {
  		if (objMapForm.enablelayers) {
			if (objMapForm.enablelayers.value == "true") {
    			addMenuItem(new menuItem("Layers", "la", "Javascript:setMapOptionLevel2('layers')"));
			}
		}
		if (objMapForm.enablelegend) {
			if (objMapForm.enablelegend.value == "true") {
				addMenuItem(new menuItem("Legend", "le", "Javascript:setMapOptionLevel2('legend')"));
			}
		}
		if (objMapForm.enableaddnewmap) {
			if (objMapForm.enableaddnewmap.value == "true") {	
				addMenuItem(new menuItem("Add New Map", "ad", "Javascript:setMapOptionLevel2('addnewmap')"));
  			}
		}
	}
  
  	mainMenu3 = new jsDOMenu(150);
	with (mainMenu3) {
		if (objMapForm.enableprint) {
			if (objMapForm.enableprint.value == "true") {	
    			addMenuItem(new menuItem("Print Map", "pr", "Javascript:loadPage('print.asp')"));
			}
		}
		if (objMapForm.enableproperties) {
			if (objMapForm.enableproperties.value == "true") {	
    			addMenuItem(new menuItem("Map Properties", "ps", "Javascript:loadPage('properties.asp')"));
			}
		}
    	addMenuItem(new menuItem("Refresh Map", "", "Javascript:setMapAction('refreshmap')"));
  	}
  
	mainMenu4 = new jsDOMenu(170);
	with (mainMenu4) {
    	addMenuItem(new menuItem("Map Tools Help", "hp", "help.htm"));
		if (objMapForm.enableabout) {
			if (objMapForm.enableabout.value == "true") {	
    			addMenuItem(new menuItem("About Map Viewer", "", "about.htm"));
			}
		}	
  	}
  
	menuBar = new jsDOMenuBar("static", "staticMenuBar", "", "", ""); //CREATE MAIN MENU ITEMS
  	with (menuBar) {
    	addMenuBarItem(new menuBarItem("Home", "", "","","index.asp","jsdomenubaroneitem","jsdomenubaroneitemover","jsdomenubaroneitem")); 
    	addMenuBarItem(new menuBarItem("View", mainMenu1, ""));
		addMenuBarItem(new menuBarItem("Data", mainMenu2, ""));
		addMenuBarItem(new menuBarItem("Options", mainMenu3, ""));
		addMenuBarItem(new menuBarItem("Help", mainMenu4, ""));
	}
  
	mainMenu1.items.fv.showIcon("fullviewicon", "fullviewicon", "fullviewicon");
	mainMenu1.items.zi.showIcon("zoominicon", "zoominicon", "zoominicon");
	mainMenu1.items.zo.showIcon("zoomouticon", "zoomouticon", "zoomouticon");
	if (objMapForm.enablesearch) {
		if (objMapForm.enablesearch.value == "true") {
       	mainMenu1.items.fi.showIcon("findicon", "findicon", "findicon");
	  	}
  	}
	if (objMapForm.enablelayers) {
		if (objMapForm.enablelayers.value == "true") {
  			mainMenu2.items.la.showIcon("layersicon", "layersicon", "layersicon");
		}
  	}
	if (objMapForm.enablelegend) {
		if (objMapForm.enablelegend.value == "true") {
			mainMenu2.items.le.showIcon("legendicon", "legendicon", "legendicon");
		}
	}
	if (objMapForm.enableaddnewmap) {
		if (objMapForm.enableaddnewmap.value == "true") {	
			mainMenu2.items.ad.showIcon("adddataicon", "adddataicon", "adddataicon");
		}
	}
	if (objMapForm.enableproperties) {
		if (objMapForm.enableproperties.value == "true") {	
			mainMenu3.items.ps.showIcon("propertiesicon", "propertiesicon", "propertiesicon");
		}
	}
	if (objMapForm.enableprint) {
		if (objMapForm.enableprint.value == "true") {	
			mainMenu3.items.pr.showIcon("printicon", "printicon", "printicon");
		}
	}
 	mainMenu4.items.hp.showIcon("helpicon", "helpicon", "helpicon");
}
