//<![CDATA[
var mapArrowControl = new GSmallMapControl();
var mapButtonControl = new GMapTypeControl();
var mm;
var lm;
var label;
var satview = 0;
var gmarkersGlobal = [];
var gmarkersINT = [];
var gmarkersAMF= [];
var gmarkersNSA= [];
var gmarkersSGP = [];
var gmarkersSGPfac = [];
var gmarkersSGPinst = [];
var bldgsCF= [];
var labelsCF= [];

// A TextualZoomControl is a GControl that displays textual "Zoom In"
// and "Zoom Out" buttons (as opposed to the iconic buttons used in
// Google Maps).

function TextualZoomControl() {}
TextualZoomControl.prototype = new GControl();

// Creates a one DIV for each of the buttons and places them in a container
// DIV which is returned as our control element. We add the control to
// to the map container and return the element for the map class to
// position properly.
TextualZoomControl.prototype.initialize = function(map) 
{
	var container = document.createElement("div");

	var zoomInDiv = document.createElement("div");
	this.setButtonStyle_(zoomInDiv);
	container.appendChild(zoomInDiv);
	zoomInDiv.appendChild(document.createTextNode("+"));
	GEvent.addDomListener(zoomInDiv, "click", function() 
	{
		map.zoomIn();
	});

	var zoomOutDiv = document.createElement("div");
	this.setButtonStyle_(zoomOutDiv);
	container.appendChild(zoomOutDiv);
	zoomOutDiv.appendChild(document.createTextNode("-"));
	GEvent.addDomListener(zoomOutDiv, "click", function() 
	{
	map.zoomOut();
	});

	map.getContainer().appendChild(container);
	return container;
 }

// By default, the control will appear in the top left corner of the
// map with 7 pixels of padding.
TextualZoomControl.prototype.getDefaultPosition = function() 
{
	return new GControlPosition(3, new GSize(7, 17));
}

// Sets the proper CSS for the given button element.
TextualZoomControl.prototype.setButtonStyle_ = function(button) 
{
	button.style.textDecoration = "none";
	button.style.color = "#000";
	button.style.backgroundColor = "white";
	button.style.font = "12px Arial";
	button.style.border = "1px solid black";
	button.style.padding = "2px 3px";
	button.style.marginBottom = "3px";
	button.style.textAlign = "center";
	button.style.width = "12px";
	button.style.cursor = "pointer";
	//button.style.float = "left";
 }

function load() 
{
	if (GBrowserIsCompatible()) 
	{

		// ==================================================
		// Create the marker and corresponding information window
		function createInfoMarker(point, address, icon, title) 
		{
			if (icon) 
			{
				var marker = new GMarker(point, {icon:icon, title:title});
			} else 
			{
				var marker = new GMarker(point);
			}
			GEvent.addListener(marker, "click",function() { marker.openInfoWindowHtml(address); });
			return marker;
		}

		// ==================================================
		// This function is based on code provided by the
		// Blackpool Community Church Javascript Team
		// http://www.commchurch.freeserve.co.uk/   
		// http://www.econym.demon.co.uk/googlemaps/

		//  Did not in the end use custom tiles because no way to position properly AND
		//  wanted the capability to see the image at different zoom levels
		//  HOWEVER, setting up a custom map is one way to zoom beyond G_NORMAL_MAP zoom

		function plotcustommap(map, custommap) 
		{
			CustomGetTileUrl=function(a,b){ return G_NORMAL_MAP.getTileLayers()[0].getTileUrl(a,b); }

			//  Fix copyrightlabel and latlng bounds issue for CF cusmot map
			var copyrightlabel="AerialOklahoma- 2006"; 
			var copyright = new GCopyright(1,
			// copyright area for custom map
			new GLatLngBounds(new GLatLng(35.598237,-97.490187),new GLatLng(36.6092728,-97.4799728) ), 15, copyrightlabel);

			var copyrightCollection = new GCopyrightCollection('Map Data:');
			copyrightCollection.addCopyright(copyright);

			var tilelayers = [new GTileLayer(copyrightCollection,1,21)];
			tilelayers[0].getTileUrl = CustomGetTileUrl;

			// ============================================================
			// === If we know the copyright, return it, otherwise look for the G_NORMAL_MAP copyright =====
			tilelayers[0].getCopyright = function(a,b) 
			{
				var c= copyrightCollection.getCopyrightNotice(a,b);
				if (!c) 
				{
					c = G_NORMAL_MAP.getTileLayers()[0].getCopyright(a,b);
				}
				return c;
			}

			custommap = new GMapType(tilelayers, G_SATELLITE_MAP.getProjection(), "Custom",{errorMessage:"No custom map available"});

			map.addMapType(custommap);

		} //end plotcustommap


		// ==================================================

		// Create our "ARM" marker icon
		var armicon = new GIcon();
		armicon.image = "http://www.arm.gov/images/imported/marker.png";
		armicon.shadow = "http://www.google.com/mapfiles/shadow50.png";
		armicon.iconSize = new GSize(17, 29);
		armicon.shadowSize = new GSize(37, 25);
		armicon.iconAnchor = new GPoint(9, 25);
		armicon.infoWindowAnchor = new GPoint(9, 2);
		armicon.infoShadowAnchor = new GPoint(20, 30);

		// Create our "INST" marker icon
		var insticon = new GIcon();
		insticon.image = "http://labs.google.com/ridefinder/images/mm_20_blue.png";
		insticon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
		insticon.iconSize = new GSize(12, 20);
		insticon.shadowSize = new GSize(25, 20);
		insticon.iconAnchor = new GPoint(6, 15);
		insticon.infoWindowAnchor = new GPoint(6, 1);
		armicon.infoShadowAnchor = new GPoint(13, 21);

		// Create our "BLDG" marker icon
		var bldgicon = new GIcon();
		bldgicon.image = "http://labs.google.com/ridefinder/images/mm_20_yellow.png";
		bldgicon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
		bldgicon.iconSize = new GSize(12, 20);
		bldgicon.shadowSize = new GSize(25, 20);
		bldgicon.iconAnchor = new GPoint(6, 15);
		bldgicon.infoWindowAnchor = new GPoint(6, 1);
		bldgicon.infoShadowAnchor = new GPoint(13, 21);

		// Create our "AMF" marker icon
		var amficon = new GIcon();
		amficon.image = "http://www.arm.gov/images/imported/amficon.png";
		amficon.shadow = "http://www.google.com/mapfiles/shadow50.png";
		amficon.iconSize = new GSize(17, 29);
		amficon.shadowSize = new GSize(37, 25);
		amficon.iconAnchor = new GPoint(9, 25);
		amficon.infoWindowAnchor = new GPoint(9, 2);
		amficon.infoShadowAnchor = new GPoint(20, 30);

		// Create our "AMF SUPP" marker icon
		var amfsuppicon = new GIcon();
		amfsuppicon.image = "http://www.arm.gov/images/imported/amficon.png";
		amfsuppicon.shadow = "http://www.google.com/mapfiles/shadow50.png";
		amfsuppicon.iconSize = new GSize(17, 29);
		amfsuppicon.shadowSize = new GSize(37, 25);
		amfsuppicon.iconAnchor = new GPoint(9, 25);
		amfsuppicon.infoWindowAnchor = new GPoint(9, 2);
		amfsuppicon.infoShadowAnchor = new GPoint(20, 30);

		// Create our "AVP" marker icon
		var avpicon = new GIcon();
		avpicon.image = "http://labs.google.com/ridefinder/images/mm_20_green.png";
		avpicon.shadow = "http://www.google.com/mapfiles/shadow50.png";
		avpicon.iconSize = new GSize(17, 29);
		avpicon.shadowSize = new GSize(37, 25);
		avpicon.iconAnchor = new GPoint(9, 25);
		avpicon.infoWindowAnchor = new GPoint(9, 2);
		avpicon.infoShadowAnchor = new GPoint(20, 30);

		// Create our "Special Dataset" marker icon
		var specialicon = new GIcon();
		specialicon.image = "http://www.arm.gov/images/imported/specialdataicon.png";
		specialicon.shadow = "http://www.google.com/mapfiles/shadow50.png";
		specialicon.iconSize = new GSize(17, 29);
		specialicon.shadowSize = new GSize(37, 25);
		specialicon.iconAnchor = new GPoint(9, 25);
		specialicon.infoWindowAnchor = new GPoint(9, 2);
		specialicon.infoShadowAnchor = new GPoint(20, 30);



		// TWP Site /////////////////////////////////////
		// Darwin, AUS- General
		var point = new GPoint(130.891596078, -12.4246009);
		address = "<a href=\"/sites/twp/\" target=\"info\">TWP</a> - <a href=\"/sites/twp/C3\" target=\"info\">Darwin, AUS</a><br />12&deg; 25' 28.56\" S, 130&deg; 53' 29.75\" E<br />Altitude: 29.9 meters <br /><a href=\"/sites/twp/C3/darwin_layout_rev_feb06.pdf\" target=\"info\">Site Layout</a>";
		title = "TWP - Darwin, Aus";
		var marker = createInfoMarker(point, address, armicon, title);
		var geoXml;
		gmarkersINT.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng(-12.4246009, 130.891596078), 10);
			map.setMapType(G_NORMAL_MAP);
		});
		var point = new GPoint(130.891596078, -12.4246009);
		address = "<a href=\"/sites/twp/\" target=\"info\">TWP</a> - <a href=\"/sites/twp/C3\" target=\"info\">Darwin, AUS</a><br />12&deg; 25' 28.56\" S, 130&deg; 53' 29.75\" E<br />Altitude: 29.9 meters <br /><a href=\"/sites/twp/C3/darwin_layout_rev_feb06.pdf\" target=\"info\">Site Layout</a>";
		title = "TWP - Darwin, Aus";
		var marker = createInfoMarker(point, address, armicon, title);
		var geoXml;
		gmarkersAMF.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setMapType(G_SATELLITE_MAP);
			map.setCenter (new GLatLng(-12.4246009, 130.891596078), 18);
			var DAR_overview_insert = new EInsert(new GLatLng(-12.4240009, 130.891596078), "/sites/twp/C3/darwin_layout_rev_feb06.jpg", new GSize(2063,1930), 20, 1);
			map.addOverlay(DAR_overview_insert);
			DAR_overview_insert.hide(); //do not want to see it until zoom level 19
			//geoXml = new GGeoXml("http://www.arm.gov/images/Darwin_inst.kml");
			//map.addOverlay(geoXml);
			GEvent.addListener(map, "zoomend", function(oldzoom,zoom)
			{
				if (zoom < 17) 
				{
					DAR_overview_insert.hide();
				}
				else if (zoom >= 19) 
				{
					map.setMapType(map.getMapTypes()[3]); DAR_overview_insert.show(); 
				}
				else 
				{
					DAR_overview_insert.hide(); map.setMapType(G_SATELLITE_MAP); 
				}
				//if (zoom < 17) {map.removeOverlay(geoXml); DAR_overview_insert.hide();}
				//else if (zoom >= 19) {map.setMapType(map.getMapTypes()[3]); DAR_overview_insert.show(); map.removeOverlay(geoXml);}
				//else {DAR_overview_insert.hide(); map.setMapType(G_SATELLITE_MAP); map.addOverlay(geoXml);}
			});
		});

		//Manus Island -General
		var point = new GPoint(147.42539763, -2.06101004);
		address = "<a href=\"/sites/twp/\" target=\"info\">TWP</a> - <a href=\"/sites/twp/C1\" target=\"info\">Manus Island, PNG</a><br />2&deg; 3' 39.64\" S, 147&deg; 25' 31.43\" E<br />Altitude: 4 meters <br /><a href=\"/sites/twp/C1/manus_layout_1.pdf\" target=\"info\">Site Layout</a>";

		title = "TWP - Manus Island, PNG";
		var marker = createInfoMarker(point, address, armicon, title);
		gmarkersINT.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng(-2.1007741, 147.225376), 9);
			map.setMapType(G_SATELLITE_MAP);
		});
		//Manus Island -2.06, 147.425
		//var point = new GPoint(147.425376, -2.0607741);
		var point = new GPoint(147.42539763, -2.06101004);
		address = "<a href=\"/sites/twp/\" target=\"info\">TWP</a> - <a href=\"/sites/twp/C1\" target=\"info\">Manus Island, PNG</a><br />2&deg; 3' 39.64\" S, 147&deg; 25' 31.43\" E<br />Altitude: 4 meters <br /><a href=\"/sites/twp/C1/manus_layout_1.pdf\" target=\"info\">Site Layout</a>";
		title = "TWP - Manus Island, PNG";
		var marker = createInfoMarker(point, address, armicon, title);
		gmarkersAMF.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng(-2.0607741, 147.425376), 18);
			map.setMapType(G_SATELLITE_MAP);
			var MAN_overview_insert = new EInsert(new GLatLng(-2.0607741, 147.425376), "/sites/twp/C1/manus_layout_1_mod.jpg", new GSize(3000,2947), 21);
			map.addOverlay(MAN_overview_insert);
			MAN_overview_insert.hide();  // do not show at this initial zoom
			GEvent.addListener(map, "zoomend", function(oldzoom,zoom)
			{
				if (zoom < 19) {MAN_overview_insert.hide(); map.setMapType(G_SATELLITE_MAP);}
				else {map.setMapType(map.getMapTypes()[3]); MAN_overview_insert.show();}
			});
		});

		// Nauru Island- General 
		var point = new GPoint(166.916, -0.521);
		address = "<a href=\"/sites/twp/\" target=\"info\">TWP</a> - <a href=\"/sites/twp/C2\" target=\"info\">Nauru Island</a><br />0&deg; 31' 15.6\" S, 166&deg; 54' 57.60\" E<br />Altitude: 7.1 meters <br /><a href=\"/sites/twp/C2/nauru_layout_1.pdf\" target=\"info\">Site Layout</a>";
		title = "TWP - Nauru Island";
		var marker = createInfoMarker(point, address, armicon, title);
		gmarkersINT.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng(-0.521, 166.916), 13);
			map.setMapType(G_SATELLITE_MAP);
		});
		var point = new GPoint(166.916, -0.521);
		address = "<a href=\"/sites/twp/\" target=\"info\">TWP</a> - <a href=\"/sites/twp/C2\" target=\"info\">Nauru Island</a><br />0&deg; 31' 15.6\" S, 166&deg; 54' 57.60\" E<br />Altitude: 7.1 meters <br /><a href=\"/sites/twp/C2/nauru_layout_1.pdf\" target=\"info\">Site Layout</a>";
		title = "TWP - Nauru Island";
		var marker = createInfoMarker(point, address, armicon, title);
		gmarkersAMF.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng(-0.521, 166.916), 18);
			map.setMapType(G_SATELLITE_MAP);
			var NAU_overview_insert = new EInsert(new GLatLng(-0.521, 166.916), "/sites/twp/C2/nauru_layout_1_mod.jpg", new GSize(4000,3085), 21);
			map.addOverlay(NAU_overview_insert);
			NAU_overview_insert.hide();  // do not show at this initial zoom
			GEvent.addListener(map, "zoomend", function(oldzoom,zoom)
			{
				if (zoom < 19) {NAU_overview_insert.hide(); map.setMapType(G_SATELLITE_MAP);}
				else {map.setMapType(map.getMapTypes()[3]); NAU_overview_insert.show();}
			});
		});

		// SGP Site 36.605,-97.485 ///////////////////////////////////////
		// read SGP facility markers
		GDownloadUrl("/sites/include/sgp_site_locations.xml", function(doc) 
		{
			//var gmarkersSGPfac = [];
			var xml = GXml.parse(doc);
			var fmarkers = xml.documentElement.getElementsByTagName("marker");
			for (var i = 0; i < fmarkers.length; i++) 
			{
				var point = new GLatLng(parseFloat(fmarkers[i].getAttribute("lat")), parseFloat(fmarkers[i].getAttribute("lon")));
				site = "<a href=\"/sites/sgp/\" target=\"info\">SGP</a>";
				facility = fmarkers[i].getAttribute("facility");
				fac_href="<a href=\"/sites/sgp/maps/"+facility+".htm\" target=\"info\">Site Layout</a>";
				type = fmarkers[i].getAttribute("type");
				type_href="<a href=\"/sites/sgp/"+type+".stm\" target=\"info\">";
				//address =site + (" - ")+fac_href+facility+"</a>"+(" ")+(fmarkers[i].getAttribute("location"))+("<br/>Lat = ")+(fmarkers[i].getAttribute("lat"))+(" Lon = ")+(fmarkers[i].getAttribute("lon"))+("<br/>Altitude (m) = ")+(fmarkers[i].getAttribute("alt"));
				address =site + (" - ")+type_href+facility+"</a>"+(" ")+(fmarkers[i].getAttribute("location"))+("<br/>Lat = ")+(fmarkers[i].getAttribute("lat"))+(" Lon = ")+(fmarkers[i].getAttribute("lon"))+("<br/>Altitude (m) = ")+(fmarkers[i].getAttribute("alt"))+"<br/>"+fac_href;
				title = fmarkers[i].getAttribute("facility")+"- "+fmarkers[i].getAttribute("location");
				var marker = createInfoMarker(point, address, armicon, title);
				gmarkersSGPfac.push(marker);
				if (facility == "E13") 
				{
					GEvent.addListener(marker, "click", function () 
					{
						map.setCenter (new GLatLng(36.602161327, -97.483577728), 15);
						map.setMapType(map.getMapTypes()[3]);
						//var CF_overview_insert = new EInsert(new GLatLng(36.6036772,-97.48499393), "/sites/sgp/maps/CF30x40_qtr.png", new GSize(1917,2557), 18, -1);
						var CF_overview_insert = new EInsert(new GLatLng(36.6036772,-97.48499393), "/sites/sgp/maps/CF30x40_cjb.jpg", new GSize(1917,2557), 18, -1);
						map.addOverlay(CF_overview_insert);
						map.setMapType(map.getMapTypes()[3]);
						// GEvent.addListener(CF_overview_insert, "dragend", function (pt) {
						// GLog.write("new position of image = "+ pt.lat() + ","+pt.lng());
						//});
						GEvent.addListener(map, "zoomend", function(oldzoom,zoom)
						{
							if (zoom < 15) {CF_overview_insert.hide(); }
							//if (zoom < 15) {CF_overview_insert.hide(); map.setMapType(map.getMapTypes()[3]);}
							else if (zoom > 18) { CF_overview_insert.show(); }
							else { CF_overview_insert.show(); }
						});  //end GEvent
					}); //end GEvent
				} // end if
			}  // end for
			//mm.addMarkers(gmarkersSGPfac, 6, 14);
			//mm.refresh();
		});  //end gdownload

		// read CF instrument markers for einsert image 
		GDownloadUrl("/sites/include/CF_inst.xml", function(data, responseCode) 
		{
			//var gmarkersSGPinst = [];
			var xml = GXml.parse(data);
			var markers = xml.documentElement.getElementsByTagName("marker");
			for (var i = 0; i < markers.length; i++) 
			{
				var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lon")));
				site_href = "<a href=\"/sites/sgp/\" target=\"info\">SGP</a>";
				facility = markers[i].getAttribute("facility");
				fac_href="<a href=\"/sites/sgp/maps/"+facility+".htm\" target=\"info\">";
				instrument = markers[i].getAttribute("instrument");
				abbr = markers[i].getAttribute("abbr");
				inst_href ="<a href=\"/instruments/instrument.php?id="+ abbr.toLowerCase() +"\" target=\"info\">";
				lat = markers[i].getAttribute("lat");
				lon = markers[i].getAttribute("lon");
				address = "<b>"+"ACRF Site = "+ site_href + "<br>"+ ("Facility =  ")+fac_href+facility+"</a><br>"+ "Instrument = "+inst_href+instrument+"</a></b>";
				title = abbr;
				var marker = createInfoMarker(point, address, insticon, title);
				gmarkersSGPinst.push(marker);
			}
			//mm.addMarkers(gmarkersSGPinst, 15, 20);
			//mm.refresh();
		});

		// read CF structures 
		GDownloadUrl("/sites/include/CF_bldg.xml", function(doc) 
		{
			//var bldgsCF= [];
			var xml = GXml.parse(doc);
			var markers = xml.documentElement.getElementsByTagName("marker");
			for (var i = 0; i < markers.length; i++) 
			{
				var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lon")));
				var labelbldg = markers[i].getAttribute("b_label");
				var labelstyle = markers[i].getAttribute("style");
				var labelopacity = markers[i].getAttribute("opacity");
				var labelplace = markers[i].getAttribute("smartover");
				//var label = new ELabel(point, labelbldg, labelstyle, new GSize(0,0), labelopacity, labelplace);
				var marker = new GMarker(point, {icon:bldgicon, title:labelbldg});
				bldgsCF.push(marker);
			}
			//mm.addMarkers(bldgsCF, 18, 21);
			//mm.refresh();
		});
		// identify the Central and Optical Clusters with labels rather than balloon markers
		label = new ELabel(new GLatLng(36.60422843,-97.485356032), "Central Cluster", "style1", new GSize(-30,20), 60, true );
		labelsCF.push(label);
		label = new ELabel(new GLatLng(36.604960519,-97.485551834), "Optical Cluster", "style1", new GSize(0,20), 60, true );
		labelsCF.push(label);
		label = new ELabel(new GLatLng(36.6081686994,-97.4871772527), "Visitor Parking Lot", "style1", new GSize(0,0), 60, true );
		labelsCF.push(label);

		var point = new GLatLng(36.605, -97.485);
		address = "<a href=\"/sites/sgp/\"target=\"info\">SGP</a> - <a href=\"/sites/sgp/C/\" target=\"info\">Central Facility</a><br />36&deg; 36' 18.00\" N, 97&deg; 29' W<br />Altitude: 318 meters<br /><a href=\"/sites/sgp/maps.stm\"target=\"info\">Overview Map</a>";
		title = "SGP - Central Facility";
		var marker = createInfoMarker(point, address, armicon, title);
		gmarkersSGP.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng(36.605,-97.485), 6);
			map.setMapType(map.getMapTypes()[3]);
		});

		// NSA Site ///////////////////////////////////////////
		// General
		var point = new GPoint(-157.4080538, 70.471975);
		address = "<a href=\"/sites/nsa/\"target=\"info\">NSA</a> - <a href=\"/sites/nsa/C2/\" target=\"info\">Atqasuk, Alaska</a><br />70&deg; 28' 19.11\" N, 157&deg; 24' 28.99\" W <br />Altitude: 20 meters";
		title = "NSA Sites, Alaska";
		var marker = createInfoMarker(point, address, armicon, title);
		gmarkersINT.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng(67.471975,-157.4080538), 4);
			map.setMapType(G_SATELLITE_3D_MAP);
			//map.setMapType(G_NORMAL_MAP);
		});
		// NSA Site ///////////////////////////////////////////
		// Atqasuk 70.4718,-157.407
		var point = new GPoint(-157.4080538, 70.471975);
		address = "<a href=\"/sites/nsa/\"target=\"info\">NSA</a> - <a href=\"/sites/nsa/C2/\" target=\"info\">Atqasuk, Alaska</a><br />70&deg; 28' 19.11\" N, 157&deg; 24' 28.99\" W <br />Altitude: 20 meters <br /><a href=\"/sites/nsa/C2/Atqasuk_site_overview.pdf\"targer=\"info\">Site Layout and Photos</a>";
		title = "NSA - Atqasuk, Alaska";
		var marker = createInfoMarker(point, address, armicon, title);
		gmarkersNSA.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng(70.471975,-157.4080538), 16);
			map.setMapType(G_SATELLITE_MAP);
		});

		// Barrow 71.323,-156.609
		var point = new GPoint(-156.61575, 71.32298);
		address = "<a href=\"/sites/nsa/\" target=\"info\">NSA</a> - <a href=\"/sites/nsa/C1/\" target=\"info\">Barrow, Alaska</a><br />71&deg; 19' 22.73\" N, 156&deg; 36' 56.70\" W<br />Altitude: 8 meters <br /><a href=\"/sites/nsa/C1/barrow_layout.pdf\" target=\"info\">Site Layout</a><br /><a href=\"/sites/nsa/C1/barrow_vieweast.pdf\" target=\"info\">View to East (photo)</a><br /><a href=\"/sites/nsa/C1/barrow_viewsouth.pdf\" target=\"info\">View to South (photo)</a>";
		title = "NSA - Barrow, Alaska";
		var marker = createInfoMarker(point, address, armicon, title);
		gmarkersNSA.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng(71.32298,-156.61575), 16);
			map.setMapType(G_SATELLITE_MAP);
		});
		// NSA- AVP 71.286754 ,-156.770782
		//var point = new GPoint(-156.770782, 71.286754);
		//address = "<a href=\"/sites/avp.stm\" target=\"info\">NSA</a> - <a href=\"/sites/nsa/avp.stm\" target=\"info\">Barrow, Alaska</a><br />71&deg; N 19.38' 156&deg; W 36.54'<br />Altitude: 8 meters";
		//title = "NSA - AVP";
		//var marker = createInfoMarker(point, address, avpicon, title);
		//gmarkersGlobal.push(marker);
		//GEvent.addListener(marker, "click", function () 
		//{
			//map.setMapType(G_SATELLITE_MAP);
			//map.setCenter (new GLatLng(71.32298,-156.61575), 14);
		//});

		//Pt. Reyes- General
		var point = new GPoint(-122.9555296, 38.091809);
		address = "<a href=\"/sites/amf\" target=\"info\">Mobile Facility</a> - <a href=\"/sites/amf/pye/\" target=\"info\">Pt. Reyes, CA, USA</a><br />Shelters: 38&deg; 5' 30.51\" N, 122&deg; 57' 19.90\" W<br />Instr. Field: 38&deg; 5' 27.6\" N, 122&deg; 57' 25.8\" W<br />Altitude: 8 meters<br /><a href=\"/sites/amf/pye/docs/amf_pye_layout_all.pdf\" target=\"info\">Site Layout- All</a><br /><a href=\"/sites/amf/pye/docs/amf_pye_layout_detail.pdf\" target=\"info\">Site Layout- Detail</a>";
		title = "Mobile Facility - Pt. Reyes, CA";
		var marker = createInfoMarker(point, address, amficon, title);
		gmarkersINT.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng( 38.091809, -122.9555296), 11);
			map.setMapType(G_NORMAL_MAP);
		});
		//Pt. Reyes
		var point = new GPoint(-122.9555296, 38.091809);
		address = "<a href=\"/sites/amf\" target=\"info\">Mobile Facility</a> - <a href=\"/sites/amf/pye/\" target=\"info\">Pt. Reyes, CA, USA</a><br />Shelters: 38&deg; 5' 30.51\" N, 122&deg; 57' 19.90\" W<br />Instr. Field: 38&deg; 5' 27.6\" N, 122&deg; 57' 25.8\" W<br />Altitude: 8 meters<br /><a href=\"/sites/amf/pye/docs/amf_pye_layout_all.pdf\" target=\"info\">Site Layout- All</a><br /><a href=\"/sites/amf/pye/docs/amf_pye_layout_detail.pdf\" target=\"info\">Site Layout- Detail</a>";
		title = "Mobile Facility - Pt. Reyes, CA";
		var marker = createInfoMarker(point, address, amficon, title);
		gmarkersAMF.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng( 38.091809, -122.9555296), 18);
			map.setMapType(G_SATELLITE_MAP);
			var PYE_overview_insert = new EInsert(new GLatLng(38.091809,-122.9555296), "/sites/amf/pye/docs/amf_pye_layout_detail.jpg", new GSize(3084,2098), 21);
			map.addOverlay(PYE_overview_insert);
			PYE_overview_insert.hide();  // do not show at this initial zoom level
			GEvent.addListener(map, "zoomend", function(oldzoom,zoom)
			{
				if (zoom < 19) {PYE_overview_insert.hide(); map.setMapType(G_SATELLITE_MAP);}
				else {map.setMapType(map.getMapTypes()[3]); PYE_overview_insert.show();}
			});
		});

		// Niamey- Ancillary Site
		var point = new GPoint(2.63235, 13.521983);
		address = "<a href=\"/sites/amf\" target=\"info\">Ancillary Facility</a> - <a href=\"/sites/amf/nim/\" target=\"info\">Niamey, Niger</a><br />Site: 13&deg; 31' 19.14\" N, 2&deg; 37' 56.46\" E<br />Altitude: 228.29 meters";
		title = "Ancillary Facility - Niamey, Niger";
		var marker = createInfoMarker(point, address, amficon, title);
		gmarkersAMF.push(marker);

		// Niamey
		var point = new GPoint(2.174338103, 13.47754215);
		address = "<a href=\"/sites/amf\" target=\"info\">Mobile Facility</a> - <a href=\"/sites/amf/nim/\" target=\"info\">Niamey, Niger</a><br />Main Site: 13&deg; 28' 39.15\" N, 2&deg; 10' 27.62\" E <br />Altitude: 223 meters<br /><a href=\"/sites/amf/nim/docs/amf_niger_layout.pdf\" target=\"info\">Site Layout</a><br /><a href=\"/sites/amf/nim/docs/amf_niger_layout_vans.pdf\" target=\"info\">Van Layout</a>";
		title = "Mobile Facility - Niamey, Niger";
		var marker = createInfoMarker(point, address, amficon, title);
		gmarkersINT.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng(16.51516716, 8.9032597), 5);
			map.setMapType(G_NORMAL_MAP);
		});

		// Niamey- Main Site
		var point = new GPoint(2.174338102, 13.47754215);
		address = "<a href=\"/sites/amf\" target=\"info\">Mobile Facility</a> - <a href=\"/sites/amf/nim/\" target=\"info\">Niamey, Niger</a><br />Main Site: 13&deg; 28' 39.15\" N, 2&deg; 10' 27.62\" E <br />Altitude: 223 meters<br /><a href=\"/sites/amf/nim/docs/amf_niger_layout.pdf\" target=\"info\">Site Layout</a><br /><a href=\"/sites/amf/nim/docs/amf_niger_layout_vans.pdf\" target=\"info\">Site Layout- Vans</a>";
		title = "Mobile Facility - Niamey, Niger";
		var marker = createInfoMarker(point, address, amficon, title);
		gmarkersAMF.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setMapType(G_SATELLITE_MAP);
			map.setCenter (new GLatLng(13.47754215, 2.174338102), 18);
			var NIM_overview_insert = new EInsert(new GLatLng(13.477542,2.1743381), "/sites/amf/nim/docs/amf_niger_layout.jpg", new GSize(3098,2122), 21);
			map.addOverlay(NIM_overview_insert);
			NIM_overview_insert.hide();  // do not show at this initial zoom
			GEvent.addListener(map, "zoomend", function(oldzoom,zoom)
			{
				if (zoom < 19) {NIM_overview_insert.hide(); map.setMapType(G_SATELLITE_MAP);}
				else {map.setMapType(map.getMapTypes()[3]); NIM_overview_insert.show();}
			});
		});


		// Heselbach, Germany- General
		var point = new GPoint(8.3968666, 48.54005);
		address = "<a href=\"/sites/amf\" target=\"info\">Mobile Facility</a> - <a href=\"/sites/amf/fkb/\" target=\"info\">Heselbach, Germany</a><br />Main Site: 48&deg; 32' 24.18\" N, 08&deg; 23' 48.72\" E <br />Altitude: 511.43 meters<br /><a href=\"/sites/amf/fkb/docs/amf_germany_layout_main.pdf\" target=\"info\">Site Layout</a>";
		title = "Mobile Facility - Heselbach, Germany";
		var marker = createInfoMarker(point, address, amficon, title);
		gmarkersINT.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng(48.5400, 8.39729100), 15);
			map.setMapType(G_NORMAL_MAP);
		});
		// Heselbach, Germany
		var point = new GPoint(8.3968666, 48.54005);
		address = "<a href=\"/sites/amf\" target=\"info\">Mobile Facility</a> - <a href=\"/sites/amf/fkb/\" target=\"info\">Heselbach, Germany</a><br />Main Site: 48&deg; 32' 24.18\" N, 08&deg; 23' 48.72\" E <br />Altitude: 511.43 meters<br /><a href=\"/sites/amf/fkb/docs/amf_germany_layout_main.pdf\" target=\"info\">Site Layout</a>";
		title = "Mobile Facility - Heselbach, Germany";
		var marker = createInfoMarker(point, address, amficon, title);
		gmarkersAMF.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setMapType(G_SATELLITE_MAP);
			map.setCenter (new GLatLng(48.5400, 8.39729100), 17);
			var Germany_full_insert = new EInsert(new GLatLng(48.5400087, 8.3972668), "/sites/amf/fkb/docs/amf_germany_layout_main.jpg", new GSize(2320,2018), 21);
			map.addOverlay(Germany_full_insert);
			Germany_full_insert.hide();
			GEvent.addListener(map, "zoomend", function(oldzoom,zoom)
			{
				if (zoom == 18) {map.setMapType(G_SATELLITE_MAP); Germany_full_insert.show();}
				else if (zoom > 18) {map.setMapType(map.getMapTypes()[3]); Germany_full_insert.show();}
				else {map.setMapType(G_SATELLITE_MAP); Germany_full_insert.hide();}
			});  //end GEvent
		});

		// Graciosa Island, Azores
		var point = new GPoint(-28.029167, 39.091094);
		address = "<a href=\"/sites/amf\" target=\"info\">Mobile Facility</a> - <a href=\"/sites/amf/grw\" target=\"info\">Graciosa Island, Azores</a><br /> 39&deg; 5' 27.94\" N, 28&deg; 1' 45.00\" W <br />Altitude: 15.24 meters <br /><a href=\"/sites/amf/grw/docs/azores_layout.pdf\" target=\"info\">Site Layout</a>";
		title = "Mobile Facility - Graciosa Island, Azores";
		var marker = createInfoMarker(point, address, amficon, title);
		gmarkersGlobal.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng( 39.091094, -28.029167), 13);
			map.setMapType(G_SATELLITE_MAP);
		});


		// Xianghe, China
		var point = new GPoint(116.960125, 39.753103);
		//var point = new GPoint(116.9619444, 39.753888);
		address = "<a href=\"/sites/amf\" target=\"info\">ARM Ancillary Facility</a> - Xianghe, China<br />AAF2 Site: 39&deg; 45' 11.17\" N, 116&deg; 57' 36.45\" E <br />Altitude: 36 meters<br /><a href=\"/sites/amf/hfe/docs/AAF_Xianghe_02_rev.pdf\" target=\"info\">Site Layout</a>";
		title = "AAF2 - Xianghe, China";
		var marker = createInfoMarker(point, address, amficon, title);
		gmarkersAMF.push(marker);
		//GEvent.addListener(marker, "click", function () 
		//{
			//map.setMapType(G_SATELLITE_MAP);
			//map.setCenter (new GLatLng(39.753103, 116.960125), 18);
			//var XIA_overview_insert = new EInsert(new GLatLng(39.753105 ,116.960125), "/sites/amf/hfe/docs/Xianghe_layout.jpg", new GSize(3098,2122), 21);
			//map.addOverlay(XIA_overview_insert);
			//XIA_overview_insert.hide();  // do not show at this initial zoom
			//GEvent.addListener(map, "zoomend", function(oldzoom,zoom)
			//{
				//if (zoom < 19) {XIA_overview_insert.hide(); map.setMapType(G_SATELLITE_MAP);}
				//else {map.setMapType(map.getMapTypes()[3]); XIA_overview_insert.show();}
			//});
		//});

		// Zhangye, China
		var point = new GPoint(100.58, 38.93);
		address = "<a href=\"/sites/amf\" target=\"info\">ARM Ancillary Facility</a> - Zhangye, China<br />AAF1 Site: 38&deg; 55' 48.00\" N,  100&deg; 34' 48.00\" E <br />Altitude: 1,483 meters<br />";
		title = "AAF1 - Zhangye, China";
		var marker = createInfoMarker(point, address, amficon, title);
		gmarkersAMF.push(marker);
		//GEvent.addListener(marker, "click", function () 
		//{
			//map.setMapType(G_SATELLITE_MAP);
			//map.setCenter (new GLatLng(32.558383, 116.78195), 4);
			//var SHO_overview_insert = new EInsert(new GLatLng(32.558383 ,116.178195), "/sites/amf/hfe/docs/Shouzian_layout.jpg", new GSize(3098,2122), 21);
			//map.addOverlay(SHO_overview_insert);
			//SHO_overview_insert.hide();  // do not show at this initial zoom
			//GEvent.addListener(map, "zoomend", function(oldzoom,zoom)
			//{
				//if (zoom < 19) {SHO_overview_insert.hide(); map.setMapType(G_SATELLITE_MAP);}
				//else {map.setMapType(map.getMapTypes()[3]); SHO_overview_insert.show();}
			//});
		//});

		// Shouxian, China
		var point = new GPoint(116.78195, 32.558383);
		address = "<a href=\"/sites/amf\" target=\"info\">Mobile Facility</a> - Shouxian, China<br />Primary Site: 32&deg; 33' 30.18\" N, 116&deg; 46' 55.02\" E<br />Altitude: 22.7 meters<br /><a href=\"/sites/amf/hfe/docs/Shouxian_layout.pdf\" target=\"info\">Site Layout</a>";
		title = "Mobile Facility - Shouxian, China";
		var marker = createInfoMarker(point, address, amficon, title);
		gmarkersGlobal.push(marker);
		GEvent.addListener(marker, "click", function () 
		{
			map.setCenter (new GLatLng(33.558383, 110.78195), 4);
			map.setMapType(G_NORMAL_MAP);
		});

		//var SHO_overview_insert = new EInsert(new GLatLng(32.558383 ,116.178195), "/sites/amf/hfe/docs/Shouzian_layout.jpg", new GSize(3098,2122), 21);
		//map.addOverlay(SHO_overview_insert);
		//SHO_overview_insert.hide();  // do not show at this initial zoom
		//GEvent.addListener(map, "zoomend", function(oldzoom,zoom)
		//{
			//if (zoom < 19) {SHO_overview_insert.hide(); map.setMapType(G_SATELLITE_MAP);}
			//else {map.setMapType(map.getMapTypes()[3]); SHO_overview_insert.show();}
		//});

		// Taihu, China
		var point = new GPoint(120.21533, 31.421);
		address = "<a href=\"/sites/amf\" target=\"info\">Mobile Facility</a> - Taihu, China<br />Supplemental Site: 31&deg; 25' 15.6\" N, 120&deg; 12' 55.19\" E<br />Altitude: 7 meters<br /><a href=\"/sites/amf/hfe/docs/Taihu_layout.pdf\" target=\"info\">Site Layout</a>";
		title = "Supplemental Mobile Facility - Taihu, China";
		var marker = createInfoMarker(point, address, amficon, title);
		gmarkersAMF.push(marker);
		//GEvent.addListener(marker, "click", function () 
		//{
			//map.setMapType(G_SATELLITE_MAP);
			//map.setCenter (new GLatLng(31.421, 120.21533), 18);
			//var TAI_overview_insert = new EInsert(new GLatLng(31.421, 120.21533), "/sites/amf/hfe/docs/Taihu_layout.jpg", new GSize(3098,2122), 21);
			//map.addOverlay(TAI_overview_insert);
			//TAI_overview_insert.hide();  // do not show at this initial zoom
			//GEvent.addListener(map, "zoomend", function(oldzoom,zoom)
			//{
				//if (zoom < 19) {TAI_overview_insert.hide(); map.setMapType(G_SATELLITE_MAP);}
				//else {map.setMapType(map.getMapTypes()[3]); TAI_overview_insert.show();}
			//});
		//});

		//GEvent.addListener(marker, "click", function () 
		//{
			//map.setMapType(G_SATELLITE_MAP);
			//map.setCenter (new GLatLng(32.558383, 116.78195), 10);
			//map.setCenter (new GLatLng(31.421, 120.2153), 10);
			//map.setCenter (new GLatLng(31.405223877, 120.222702026), 10);
		//});

		// SHEBA -167.62083, 77.604175
		//var point = new GPoint(-167.62083,77.604175);
		//address = "<a href=\"http://www.db.arm.gov/cgi-bin/IOP2/selectExecSummary.pl?iopName=nsa1997sheba\">SHEBA</a><br />Surface Heat Budget of the Arctic Ocean<br />Field Campaign based in Barrow, Alaska<br />May 15 through June 24, 1998";
		//title = "SHEBA - Barrow, Alaska";
		//var marker = createInfoMarker(point, address, specialicon, title);
		//map.addOverlay(marker);

		// Eureka -85.720829,79.729175
		//var point = new GPoint(-85.720829,79.729175);
		//address = "<a href=\"\">Eureka</a><br /> Eureka, Ellesmere Is., Canada<br />for NOAA SEARCH project";
		//title = "Eureka, Ellesmere Is,. Canada";
		//var marker = createInfoMarker(point, address, specialicon, title);
		//map.addOverlay(marker);

		//Display the map with controls, etc.

		var map = new GMap2(document.getElementById("map"), {maxZoom:21});
		map.setCenter(new GLatLng(0, 0), 1);

		//uncomment out next 4 lines if have google earth 3d plugin- windows only
		//Added this maptype to NSA marker click to test; need to add to others 8/05/09
		//map.addMapType(G_SATELLITE_3D_MAP);
		//map.addControl(new GHierarchicalMapTypeControl());
		//map.addControl(new TextualZoomControl());
		//map.addControl(new GMapTypeControl());

		map.savePosition();
		if ((window.location.pathname == "/sites/nsa") || (window.location.pathname == "/sites/nsa/")) 
		{
			map.setCenter(new GLatLng(65.471975, -157.4080530), 3);
			map.setMapType(G_NORMAL_MAP);
			map.savePosition(); 
		}
		if ((window.location.pathname == "/sites/sgp") || (window.location.pathname == "/sites/sgp/")) 
		{
			map.setCenter(new GLatLng(36.605, -97.485), 6); 
			map.setMapType(G_NORMAL_MAP);
			map.savePosition(); 
		}
		if ((window.location.pathname == "/sites/twp") || (window.location.pathname == "/sites/twp/")) 
		{
			map.setCenter(new GLatLng(-8.56101004, 146.42539763), 3); 
			map.setMapType(G_NORMAL_MAP);
			map.savePosition(); 
		}
		if ((window.location.pathname == "/sites/nsa/C1/") || (window.location.pathname == "/sites/nsa/C1")) 
		{
			map.setCenter (new GLatLng(71.32298,-156.61575), 10);
			map.setMapType(G_SATELLITE_MAP);
			map.savePosition(); 
			satview = 1; 
		}
		if ((window.location.pathname == "/sites/nsa/C2/") || (window.location.pathname == "/sites/nsa/C2")) 
		{
			map.setCenter (new GLatLng(70.471975,-157.4080538), 13);
			map.setMapType(G_SATELLITE_MAP);
			map.savePosition(); 
			satview = 1; 
		}
		if ((window.location.pathname == "/sites/sgp/C/") || (window.location.pathname == "/sites/sgp/C"))
		{
			facility="E13";
			map.setCenter (new GLatLng(36.605206,-97.4856269), 16);
			var CF_overview_insert = new EInsert(new GLatLng(36.6036772,-97.48499393), "/sites/sgp/maps/CF30x40_cjb.jpg", new GSize(1917,2557), 18, -1);
			map.addOverlay(CF_overview_insert);
			map.setMapType(map.getMapTypes()[3]);
			map.savePosition(); 
		}
		if ((window.location.pathname == "/sites/twp/C3/") || (window.location.pathname == "/sites/twp/C3")) 
		{
			map.setCenter (new GLatLng(-12.4246009, 130.891596078), 10);
			map.setMapType(G_NORMAL_MAP);
			 map.savePosition(); 
		}
		if ((window.location.pathname == "/sites/twp/C2/") || (window.location.pathname == "/sites/twp/C2")) 
		{
			map.setCenter (new GLatLng(-0.515, 166.930), 13);
			map.setMapType(G_SATELLITE_MAP);
			map.savePosition(); 
			satview = 1; 
		}
		if ((window.location.pathname == "/sites/twp/C1/") || (window.location.pathname == "/sites/twp/C1")) 
		{
			map.setCenter (new GLatLng(-2.1007741, 147.225376), 8);
			map.setMapType(G_SATELLITE_MAP);
			map.savePosition(); 
			satview = 1; 
		}
		if ((window.location.pathname == "/sites/amf/pye/") || (window.location.pathname == "/sites/amf/pye")) 
		{
		//if (window.location.pathname == "/sites/amf/pye/") {
			map.setCenter (new GLatLng( 38.091809, -122.9555296), 10);
			map.setMapType(G_NORMAL_MAP);
			map.savePosition(); 
		}
		if ((window.location.pathname == "/sites/amf/hfe/") || (window.location.pathname == "/sites/amf/hfe"))  
		{
		//if (window.location.pathname == "/sites/amf/hfe/") {
			//map.setCenter (new GLatLng(32.558383, 116.78195), 4);
			map.setCenter (new GLatLng(32.558383, 100.78195), 3);
			map.setMapType(G_NORMAL_MAP);
			map.savePosition(); 
		}
		if ((window.location.pathname == "/sites/amf/fkb/") || (window.location.pathname == "/sites/amf/fkb")) 
		{
		//if (window.location.pathname == "/sites/amf/fkb/") {
			map.setCenter (new GLatLng(48.5400, 8.39729100), 14);
			map.setMapType(G_NORMAL_MAP);
			map.savePosition(); 
		}
		if ((window.location.pathname == "/sites/amf/nim/") || (window.location.pathname == "/sites/amf/nim")) 
		{
		//if (window.location.pathname == "/sites/amf/nim/") {
			//map.setCenter (new GLatLng(13.47754215, 2.174338102), 16);
			map.setCenter (new GLatLng(16.51516716, 8.9032597), 4);
			map.setMapType(G_NORMAL_MAP);
			map.savePosition(); 
		}
		if ((window.location.pathname == "/sites/amf/grw/") || (window.location.pathname == "/sites/amf/grw")) 
		{
			//map.setCenter (new GLatLng(39.091094, -28.029167), 6);
			map.setCenter (new GLatLng(37.091094, -17.029167), 4);
			map.setMapType(G_NORMAL_MAP);
			map.savePosition(); 
		}

		// draw SGP ACRF Box
		// in black with width of 2 and opacity of 1
		var polyline = new GPolyline([
			new GLatLng(34.8, -95.4),
			new GLatLng(34.8, -99.5),
			new GLatLng(38.4, -99.5),
			new GLatLng(38.4, -95.4),
			new GLatLng(34.8, -95.4)
			], "#000000", 2, 1);
		map.addOverlay(polyline);

		map.addControl(mapArrowControl, new GControlPosition(3));
		//map.addControl (new GOverviewMapControl());
		map.disableDoubleClickZoom();
		GDraggableObject.setDraggableCursor("move");
		map.addControl(mapButtonControl);
		//add scale bar
		map.addControl(new GScaleControl());

		// Ready custom map for SGP CF instruments when zoomed to 18
		var custommap = [];
		plotcustommap(map, custommap);

		//Return to original position on double click and set map type to custom map
		//  (because it will default to G_Normal_Map if not in range for custom map) 
		GEvent.addListener(map, "dblclick", function () 
		{
			map.returnToSavedPosition();
			if (satview) { map.setMapType(G_SATELLITE_MAP); } else { map.setMapType(map.getMapTypes()[3]); } 
		});

		//display lat/lon coordinates
		//GEvent.addListener(map, "dblclick", 
		//function(overlay, point)
		//{
			//if (overlay)
			//{
				//map.removeOverlay(overlay);
			//} else 
			//{
				//map.addOverlay(new GMarker(point));
			//}
			//alert (point);
		//});

		// declare marker manager and plot markers 
		mm = new GMarkerManager(map, {maxZoom:21});
		mm.addMarkers(gmarkersGlobal, 0, 18);
		mm.addMarkers(gmarkersINT, 0, 3);
		mm.addMarkers(gmarkersAMF, 4, 18);
		mm.addMarkers(gmarkersNSA, 4, 18);
		// remove markermanager.js from index.stm if dont use
		lm = new MarkerManager(map, {maxZoom:21});
		lm.addMarkers(labelsCF, 18, 21);
		mm.addMarkers(gmarkersSGP,0, 5);
		mm.addMarkers(gmarkersSGPfac,6, 14);
		mm.addMarkers(gmarkersSGPinst, 15, 20);
		mm.addMarkers(bldgsCF, 18, 21);
		mm.refresh();
	}
}
//]]>
