var code="code";var url="url";var sub="sub";

var CM_STYLE = {
	"border":1,
	"shadow":2,
	"color":{"border":"black", "shadow":"gray", "bgON":"silver","bgOVER":"navy"},
	"css":{"ON":"clsCMOn", "OVER":"clsCMOver"}
};

var CM_STYLE_CAL = {
	"border":1,
	"shadow":2,
	"color":{"border":"black", "shadow":"gray", "bgON":"Khaki", "bgOVER":"Chocolate"},
	"css":{"ON":"clsCMOn", "OVER":"clsCMOver"}
};

var CM_STYLE_SUB = {
	"border":1,
	"shadow":2,
	"color":{"border":"black", "shadow":"gray", "bgON":"LightSteelBlue","bgOVER":"LightSkyBlue"},
	"css":{"ON":"clsCMOn", "OVER":"clsCMOver"}
};

var CM_STYLE_SUB_1 = {
	"border":1,
	"shadow":2,
	"color":{"border":"black", "shadow":"gray", "bgON":"Silver","bgOVER":"Gainsboro"},
	"css":{"ON":"clsCMOn", "OVER":"clsCMOverBlk"}
};

var CM_STYLE_SUB_2 = {
	"border":1,
	"shadow":2,
	"color":{"border":"black", "shadow":"gray", "bgON":"DarkSeaGreen","bgOVER":"Chocolate"},
	"css":{"ON":"clsCMOn", "OVER":"clsCMOver"}
};

var MENU_ITEMS = [
	{"pos":"relative", "size":[25,145], "itemoff":[0,144], "leveloff":[24,0], "delay":800, "style":CM_STYLE},
	{code:"Data",
	sub:[
		{"itemoff":[24,0],"leveloff":[0,0],"style":CM_STYLE_SUB},
		{code:"Land Surface",
		 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
			{code:"Elevation", url:"javascript:select_data('elevation')"},
			{code:"Bathymetry", url:"javascript:select_data('bathymetry')"},
			{code:"BlueMarble",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"Clouds", url:"javascript:select_data('blue_marble_loic')"},
				{code:"World", url:"javascript:select_data('blue_marble')"},
				{code:"Topo/Bathymetry", url:"javascript:select_data('blue_marble_tb')"}
			     ]
			},
			{code:"PopulationDensity",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"PopDensity-1990", url:"javascript:select_data('PopulationDensity1990')"},
				{code:"PopDensity-1995", url:"javascript:select_data('PopulationDensity1995')"},
				{code:"PopDensity-2000", url:"javascript:select_data('PopulationDensity2000')"},
				{code:"PopDensity-2015", url:"javascript:select_data('PopulationDensity2015')"}
			     ]
			},
			{code:"Land Cover",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"LandCover 1km", url:"javascript:select_data('landcover')"},
				{code:"LandCoverPercent",
				 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
					{code:"Water", url:"javascript:select_data('lc0')"},
					{code:"Evergrn Ndleleaf Frst", url:"javascript:select_data('lc1')"},
					{code:"Evergrn Brdleaf Frst", url:"javascript:select_data('lc2')"},
					{code:"Decid. Ndleleaf Frst", url:"javascript:select_data('lc3')"},
					{code:"Decid. Brdleaf Frst", url:"javascript:select_data('lc4')"},
					{code:"Mixed Forest", url:"javascript:select_data('lc5')"},
					{code:"Woodland", url:"javascript:select_data('lc6')"},
					{code:"Wooded Grassland", url:"javascript:select_data('lc7')"},
					{code:"Closed Shrubland", url:"javascript:select_data('lc8')"},
					{code:"Open Shrubland", url:"javascript:select_data('lc9')"},
					{code:"Grassland", url:"javascript:select_data('lc10')"},
					{code:"Cropland", url:"javascript:select_data('lc11')"},
					{code:"Bare Ground", url:"javascript:select_data('lc12')"},
					{code:"Urban and Built-up", url:"javascript:select_data('lc13')"},
					{code:"PopDensity-2015", url:"javascript:select_data('lc13')"}
				     ]
				}
			     ]
			},
			{code:"Cropland Area", url:"javascript:select_data('croplandarea')"},
			{code:"Major Crops",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"Barley", url:"javascript:select_data('crps_barley')"},
				{code:"Cassava", url:"javascript:select_data('crps_cassava')"},
				{code:"Cotton", url:"javascript:select_data('crps_cotton')"},
				{code:"Groundnuts/Peanuts", url:"javascript:select_data('crps_grnuts')"},
				{code:"Maize", url:"javascript:select_data('crps_maize')"},
				{code:"Millet", url:"javascript:select_data('crps_millet')"},
				{code:"Oil Palm", url:"javascript:select_data('crps_oilpalm')"},
				{code:"Potato", url:"javascript:select_data('crps_potato')"},
				{code:"Pulses", url:"javascript:select_data('crps_pulses')"},
				{code:"Rapeseed/Canola", url:"javascript:select_data('crps_rape')"},
				{code:"Rice", url:"javascript:select_data('crps_rice')", "format":{"itemoff":[-9*24,144]}},
				{code:"Rye", url:"javascript:select_data('crps_rye')"},
				{code:"Sorghum", url:"javascript:select_data('crps_sorghum')"},
				{code:"Soy", url:"javascript:select_data('crps_soy')"},
				{code:"Sugarbeet", url:"javascript:select_data('crps_sugarbeet')"},
				{code:"Sugarcane", url:"javascript:select_data('crps_sugarcane')"},
				{code:"Sunflower", url:"javascript:select_data('crps_sunflower')"},
				{code:"Wheat", url:"javascript:select_data('crps_wheat')"},
				{code:"Other Crops", url:"javascript:select_data('crps_othercrops')"}
			     ]
			},
			{code:"Vegetation",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"NPP", url:"javascript:select_data('npp60m')"},
				{code:"FASIR NDVI", url:"javascript:select_data('ndvi')"}
			     ]
			},
			{code:"LSWI", url:"javascript:select_data('lswi')"},
			{code:"Deforestation", "format":{"style":CM_STYLE_SUB_1}},
			{code:"Fires", "format":{"style":CM_STYLE_SUB_1}},
			{code:"Dust",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"Annual", url:"javascript:select_data('dust')"},
				{code:"Monthly Avg", url:"javascript:select_data('dust_mc')"}
			     ]
			},
			{code:"Soil pH", url:"javascript:select_data('SoilpH')"},
			{code:"Nitrogen Loads", url:"javascript:select_data('nitrogen')"},
		     ]
		},
		{code:"Atmosphere",
		 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
			{code:"Composition",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"Green House Gases",
				 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
					{code:"Carbon Dioxide", "format":{"style":CM_STYLE_SUB_1}},
					{code:"Methane", "format":{"style":CM_STYLE_SUB_1}},
					{code:"Ozone", "format":{"style":CM_STYLE_SUB_1}}
				     ]
				}
			     ]
			},
			{code:"Pressure", "format":{"style":CM_STYLE_SUB_1}},
			{code:"Temperature",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"NCEP Temp", url:"javascript:select_data('ncep_air.2m_yc')"},
				{code:"NCEP Temp-Max", url:"javascript:select_data('ncep_tmax.2m_yc')"},
				{code:"NCEP Temp-Min", url:"javascript:select_data('ncep_tmin.2m_yc')"}
			     ]
			},
			{code:"Humidity", "format":{"style":CM_STYLE_SUB_1}},
			{code:"Winds", "format":{"style":CM_STYLE_SUB_1}},
			{code:"Vortocity", "format":{"style":CM_STYLE_SUB_1}},
			{code:"Clouds", "format":{"style":CM_STYLE_SUB_1}},
			{code:"Lightning", "format":{"style":CM_STYLE_SUB_1}},
			{code:"Aerosols", "format":{"style":CM_STYLE_SUB_1}}
		     ]
		},
		{code:"Oceans",
		 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
			{code:"SST", url:"javascript:select_data('sst')"},
			{code:"Sea Ice", url:"javascript:select_data('sea_ice_f')"},
			{code:"Currents",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"Gulf Stream", "format":{"style":CM_STYLE_SUB_1}},
				{code:"NA Deepwater Circ.", "format":{"style":CM_STYLE_SUB_1}},
				{code:"El Nino / La Nino", "format":{"style":CM_STYLE_SUB_1}}
			     ]
			},
			{code:"Human Impact", url:"javascript:select_data('impact_ocean')"},
			{code:"Marine Animals", "format":{"style":CM_STYLE_SUB_1}}
		     ]
		},
		{code:"Climate",
		 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
			{code:"Precipitation",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"AnnualPrecip-6''", url:"javascript:select_data('AnnualPrecip')"},
				{code:"Precip. NCEP", url:"javascript:select_data('precip_ncep')"}
			     ]
			},
			{code:"Evapotranspiration",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"ET WTMrun", url:"javascript:select_data('Global_WBM-WTMrun_Evapotranspiration_aTS1901-2002_30min')"},
				{code:"ET NCEP", url:"javascript:select_data('ncep_pevpr_yc')"}
			     ]
			},
			{code:"Paleoclimate",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"Ice Cores", "format":{"style":CM_STYLE_SUB_1}},
				{code:"Sedimentary Cores", "format":{"style":CM_STYLE_SUB_1}}
			     ]
			},
			{code:"Climate Change",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"Recent CO<sub>2</sub>", "format":{"style":CM_STYLE_SUB_1}},
				{code:"CH<sub>4</sub>", "format":{"style":CM_STYLE_SUB_1}},
				{code:"Pollution", "format":{"style":CM_STYLE_SUB_1}}
			     ]
			},
			{code:"GFDL Climate Models",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"A1F1",
				 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
					{code:"Snowmelt", url:"javascript:select_data('SNM_GFDL_CM21_A1F1')"},
					{code:"Snow amount", url:"javascript:select_data('SNW_GFDL_CM21_A1F1')"},
					{code:"Runoff", url:"javascript:select_data('MRRO_GFDL_CM21_A1F1')"},
					{code:"Serface Temperature", url:"javascript:select_data('TS_GFDL_CM21_A1F1')"}
				     ]
				},
				{code:"B1",
				 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
					{code:"Snowmelt", url:"javascript:select_data('SNM_GFDL_CM21_B1')"},
					{code:"Snow amount", url:"javascript:select_data('SNW_GFDL_CM21_B1')"},
					{code:"Runoff", url:"javascript:select_data('MRRO_GFDL_CM21_B1')"},
					{code:"Serface Temperature", url:"javascript:select_data('TS_GFDL_CM21_B1')"}
				     ]
				},
				{code:"H2 - All Forcings",
				 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
					{code:"Snowmelt", url:"javascript:select_data('SNM_GFDL_CM21_H2')"},
					{code:"Snow amount", url:"javascript:select_data('SNW_GFDL_CM21_H2')"},
					{code:"Runoff", url:"javascript:select_data('MRRO_GFDL_CM21_H2')"},
					{code:"Surface Temperature", url:"javascript:select_data('TS_GFDL_CM21_H2')"}
				     ]
				}
			     ]
			}
		     ]
		},
		{code:"Hydrology",
		 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
			{code:"Runoff", url:"javascript:select_data('runoff')"},
			{code:"Runoff, N.Amer.",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"Modeled", url:"javascript:select_data('runoff_modeled_yc')"}
			     ]
			},
			{code:"Discharge, N.Amer.",
			 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
				{code:"Comp monthly clim", url:"javascript:select_data('discharge_composite_mc')"},
				{code:"Comp yearly clim", url:"javascript:select_data('discharge_composite_yc')"},
				{code:"Comp yearly", url:"javascript:select_data('discharge_composite_y')"},
				{code:"Comp monthly", url:"javascript:select_data('discharge_composite_m')"},
				{code:"Calc mthly clim", url:"javascript:select_data('discharge_calculated_mc')"},
				{code:"Calc yearly clim", url:"javascript:select_data('discharge_calculated_yc')"},
				{code:"Calc yearly", url:"javascript:select_data('discharge_calculated_y')"},
				{code:"Calc monthly", url:"javascript:select_data('discharge_calculated_m')"}
			     ]
			},
			{code:"Distance to Ocean", url:"javascript:select_data('stn06_distance')"}
		     ]
		},
		{code:"Base Data",
		 sub:[  {"itemoff":[24,0],"leveloff":[0,144],"style":CM_STYLE_SUB_2},
			{code:"US States", url:"javascript:select_data('statemask')"},
			{code:"Country", url:"javascript:select_data('countrymask')"},
			{code:"Continent", url:"javascript:select_data('continentmask')"},
			{code:"River Basin", url:"javascript:select_data('riverbasinmask')"},
			{code:"Cell Area", url:"javascript:select_data('cellarea')"},
			{code:"Longitude", url:"javascript:select_data('lon')"},
			{code:"Latitude", url:"javascript:select_data('lat')"}
		     ]
		}
	   ]
	},
	{code:"Navigation",
	sub:[
		{"itemoff":[24,0],"leveloff":[0,0],"style":CM_STYLE_SUB},
		{code:"World", url:"javascript:navigate(-180,-135,180,135)", "format":{"style":CM_STYLE_SUB_2}},
		{code:"Africa", url:"javascript:navigate(-29.42668313698858,-36.39700402282068,70.38878140509414,38.46459438374144)", "format":{"style":CM_STYLE_SUB_2}},
		{code:"North America", url:"javascript:navigate(-141.81179422872165,3.588281807918115,-51.612470364848065,71.23777470582334)", "format":{"style":CM_STYLE_SUB_2}},
		{code:"South America", url:"javascript:navigate(-109.5390296723003,-56.44804110860745,-14.895090707599138,14.534913114918417)", "format":{"style":CM_STYLE_SUB_2}},
		{code:"New England", url:"javascript:navigate(-74.6333333333333,40.95,-65.9666666666667,47.45)"},
		{code:"Europe", url:"javascript:navigate(-11.710639423394824,34.67126348907642,50.261441562520665,81.15013672851453)", "format":{"style":CM_STYLE_SUB_2, "itemoff":[-4*24,144]}},
		{code:"West Asia", url:"javascript:navigate(27,0,135,81)", "format":{"style":CM_STYLE_SUB_2}},
		{code:"East Asia", url:"javascript:navigate(67.69325766708815,-0.0982605550010831,172.16089858566855,78.25247013393422)", "format":{"style":CM_STYLE_SUB_2}},
		{code:"Australia", url:"javascript:navigate(103.94366197183099,-45.85742009468082,163.09859154929578,-1.491222911582227)", "format":{"style":CM_STYLE_SUB_2}},
		{code:"New place", url:"javascript:navigate(0,0,0,0)"}
		]
	},
	{code:"Data Manipulation", url:"javascript:calculator_expand(true)", "format":{"size":[25,210], "style":CM_STYLE_CAL}
	}
];
