﻿
	function fetchData(layerName)
	{
		try
		{
			// Hide any INFO WINDOW and MARKER CIRCLE that happens to be displaying...
			document.getElementById('overlayInfoWindowBlock').style.visibility = 'hidden';
		    circleSelectedMarker.setMap(null);

			
			switch (layerName)
			{
				case "Earthquake":
					
					if (!isUpdatingMapAllHazards)
					{
						document.getElementById('loadingMessage').style.visibility = 'visible';
						document.getElementById('loadingMessageText').innerHTML = "Updating Earthquake layer...";
						window.setTimeout("this.clearMessages()", 2000)	// Display this message for 2 seconds...
					}
					
					
					// Reset...
					listEarthquake_MostRecent = "";
					document.getElementById('textEarthquake_MostRecent').innerHTML = listEarthquake_MostRecent;
					


					// IMPORTANT:  First, remove all existing markers created...	
					for (var iX = 0; iX < markersEarthquake.length; iX++) 
					{
						markersEarthquake[iX].setMap(null);
					}

					markersEarthquake = [];		// Clear array...


					var selectedIndex = document.myForm.dropdownEarthquake_Magnitude.selectedIndex;
					var eqk_MagnitudeMinimum = parseInt(document.myForm.dropdownEarthquake_Magnitude.options[selectedIndex].value);


					var urlEarthquakes = urlUSGS_EHP_Earthquake_Past7Days_Mag5;
					
					if (eqk_MagnitudeMinimum < 5)
					{
						urlEarthquakes = urlUSGS_EHP_Earthquake_Past7Days_Mag25;
					}



					var eqk_markerCount = 0;
					var eqk_Count_EarthquakeEvents = 0;

	                
	
					this.downloadUrl(urlEarthquakes, function(data, responseCode)
					{
						// To ensure against HTTP errors that result in null or bad data,
						// always check status code is equal to 200 before processing the data
						if(responseCode != 200)
						{
							document.getElementById('errorMessage').innerHTML = "Error fetching Earthquake data, ResponseCode = " + responseCode;
						}
						else
						{
							var xml = this.parseXml(data);
							
							var eqk_Xml = xml.documentElement.getElementsByTagName("entry");

							// Start adding the new markers...
							for (var iX = 0; iX < eqk_Xml.length; iX++) 
							{
								var eqk_DateTime;
								var eqk_Title;
								var eqk_InfoURL;
								var eqk_Description;
								var eqk_Coordinates;

								if (detectBrowser.browser == "Explorer")
								{
									eqk_DateTime = eqk_Xml[iX].getElementsByTagName("updated")[0].firstChild.data;
									eqk_Title = eqk_Xml[iX].getElementsByTagName("title")[0].firstChild.data;
									eqk_InfoURL = eqk_Xml[iX].getElementsByTagName("id")[0].firstChild.data;
									eqk_Description = eqk_Xml[iX].getElementsByTagName("summary")[0].firstChild.data;
									eqk_Coordinates = eqk_Xml[iX].getElementsByTagName("georss:point")[0].firstChild.data.split(" ");
								}
								else	// Other browsers: Firefox, Chrome, Safari, Opera, etc...
								{
									var itemTags = eqk_Xml[iX].getElementsByTagName("*");
									
									for (var iY = 0; iY < itemTags.length; iY++)
									{
										var itemTag = itemTags[iY].nodeName;
										
										switch (itemTag)
										{
											case "updated":
												eqk_DateTime = itemTags[iY].firstChild.data;
												break;
												
											case "title":
												eqk_Title = itemTags[iY].firstChild.data;
												break;
												
											case "summary":
												eqk_Description = itemTags[iY].firstChild.data;
												break;
												
											case "id":
												eqk_InfoURL = itemTags[iY].firstChild.data;
												break;
												
											case "georss:point":
												eqk_Coordinates = itemTags[iY].firstChild.data.split(" ");
												break;
										}
									}
								}


								// Set earthquake coordinates based on the Latitude and Longitude values...
								var eqk_LatLon = new google.maps.LatLng(parseFloat(eqk_Coordinates[0]), parseFloat(eqk_Coordinates[1]));


								// Get the Event ID and Info URL values...
								var posLink = eqk_InfoURL.lastIndexOf("gov:") + 4;
								
								var eqk_EventID = eqk_InfoURL.substr(posLink, eqk_InfoURL.length - posLink).replace(":", "");
								
								eqk_InfoURL = "http://earthquake.usgs.gov/eqcenter/recenteqsww/Quakes/" + eqk_EventID + ".php";



								// Get the Date/Time values and format...
								var eqk_ProcessEvent = true;


								eqk_DateTime = eqk_DateTime.replace("Z", "");

								var eqk_DatePart = eqk_DateTime.substr(0, eqk_DateTime.indexOf("T")).split('-');

								var eqk_TimePart = this.subString_ExtractPiece(eqk_DateTime, "T", "", true).split(':');
								
								var dtValue = new Date(parseInt(eqk_DatePart[0], 10), parseInt(eqk_DatePart[1], 10) - 1, parseInt(eqk_DatePart[2], 10), 
													   parseInt(eqk_TimePart[0], 10), parseInt(eqk_TimePart[1], 10), parseInt(eqk_TimePart[2], 10), 0);

								
								dtValue.setHours(dtValue.getHours() + (localOffset_Hours));

									
								eqk_DateTime = this.formatLocalDateTimeString(dtValue, true);



								// Only process Earthquake events from the past 24 hours...
								if (document.myForm.radioEarthquake_Age[0].checked)
								{
									var milliseconds_dtEvent = dtValue.getTime();
									
									// Time difference in milliseconds...
									var millisecondsElapsed = milliseconds_dtNow - milliseconds_dtEvent;
									
									// Time difference in seconds...
									var secondsElasped = Math.round(millisecondsElapsed / 1000)

									// Time difference in minutes...
									var minutesElapsed = Math.round(secondsElasped / 60);

									// Skip processing anything older than 1440 minutes (24 hours)...
									if (minutesElapsed > 1440)
									{
										eqk_ProcessEvent = false;
									}
								}
								
								
								// Magnitude threshhold check...
								var eqk_MagnitudeNumber = parseInt(eqk_Title.substr(2, 1));
								
								if (eqk_MagnitudeMinimum > eqk_MagnitudeNumber)
								{
									eqk_ProcessEvent = false;
								}


								if (eqk_ProcessEvent)
								{
									eqk_Title = eqk_Title.replace(", ", "|");
									eqk_Title_Pieces = eqk_Title.split("|");

									var eqk_Magnitude = eqk_Title_Pieces[0].replace("M ", "Magnitude ");
									var eqk_Location = this.convertToMixedCase(eqk_Title_Pieces[1]);
									
									var eqk_Strength;
									var eqk_IconFileUrl;
									var eqk_Icon;
									var eqk_ImportanceLevel;
									
									switch (eqk_MagnitudeNumber)
									{
										case 1:
										case 9:
										case 8:
											eqk_Strength = "Great";
											eqk_IconFileUrl = iconEarthquake_Magnitude8_Url;
											eqk_Icon = iconEarthquake_Magnitude8;
											eqk_ImportanceLevel = 85;
											break;
											
										case 7:
											eqk_Strength = "Major";
											eqk_IconFileUrl = iconEarthquake_Magnitude7_Url;
											eqk_Icon = iconEarthquake_Magnitude7;
											eqk_ImportanceLevel = 75;
											break;
											
										case 6:
											eqk_Strength = "Strong";
											eqk_IconFileUrl = iconEarthquake_Magnitude6_Url;
											eqk_Icon = iconEarthquake_Magnitude6;
											eqk_ImportanceLevel = 65;
											break;
											
										case 5:
											eqk_Strength = "Moderate";
											eqk_IconFileUrl = iconEarthquake_Magnitude5_Url;
											eqk_Icon = iconEarthquake_Magnitude5;
											eqk_ImportanceLevel = 55;
											break;
											
										case 4:
											eqk_Strength = "Light";
											eqk_IconFileUrl = iconEarthquake_Magnitude4_Url;
											eqk_Icon = iconEarthquake_Magnitude4;
											eqk_ImportanceLevel = 45;
											break;
											
										case 3:
											eqk_Strength = "Minor";
											eqk_IconFileUrl = iconEarthquake_Magnitude3_Url;
											eqk_Icon = iconEarthquake_Magnitude3;
											eqk_ImportanceLevel = 35;
											break;
											
										default:
											eqk_Strength = "Micro";
											eqk_IconFileUrl = iconEarthquake_Magnitude1_Url;
											eqk_Icon = iconEarthquake_Magnitude1;
											eqk_ImportanceLevel = 25;
											break;
									}


									var eqk_MarkerTitle = "<strong>Earthquake - " + eqk_Magnitude + "</strong><br />" + 
														  eqk_Location + "<br />" + 
														  eqk_DateTime;
									

									// Modification of the raw HTML to better handle the globe image and display a local date/time value...
									var eqk_GlobeImage_Before = this.subString_ExtractPiece(eqk_Description, "<img src=", " />", false) + " />";
									var eqk_GlobeImage_After = eqk_GlobeImage_Before;
									var work_GlobeImage = this.subString_ExtractPiece(eqk_GlobeImage_After, " alt=", "", false);
									eqk_GlobeImage_After = eqk_GlobeImage_After.replace(work_GlobeImage, "");
									eqk_GlobeImage_After = eqk_GlobeImage_After.replace("<img src=", 
																						"<a href=\"" + eqk_InfoURL + "#maps" + "\" target=\"_blank\"><img width=\"140\" height=\"140\" src=");
									
									var eqk_OtherStuff_Before = this.subString_ExtractPiece(eqk_Description, "<p>", "</p>", false) + "</p>";
									var eqk_OtherStuff_After = " /></a>"+
															   "<br /><br />" +
															   "<span style=\"font-weight:bold;\">Event ID: </span>" + eqk_EventID +
															   "<br /><br />" +
															   "<span style=\"font-weight:bold;\">Strength: </span>" + eqk_Magnitude + " (" + eqk_Strength + ")";
															   

									eqk_Description = eqk_Description.replace(eqk_GlobeImage_Before, eqk_GlobeImage_After);
									eqk_Description = eqk_Description.replace(eqk_OtherStuff_Before, eqk_OtherStuff_After);
									eqk_Description = eqk_Description.replace("<strong>Depth</strong>:", "<span style=\"font-weight:bold;\">Depth: </span>");

									eqk_Description += 
										   "<br />" +
										   "<span style=\"font-weight:bold;\">Date & Time:<br /></span>" + eqk_DateTime +
										   "<br /><br />";


									var eqk_Html =
										"<div id=\"infowindowHTML\">" +
										"<img src=\"" + eqk_IconFileUrl + "\" width=\"26\" height=\"26\" /><br />" +
										"<span style=\"font-size:15px; font-weight:bold;\">" + eqk_Magnitude + "</span>" +
										"<br />" +
										"<span style=\"font-weight:bold;\">" + eqk_Location + "</span>" +
										"<br /><br />" +
										"<div style=\"text-align:center\">" +  eqk_Description + "</div>" +
										"<hr /><span style=\"font-weight:bold;\">More information:</span><br /><br />" +
									    "<img src=\"images/logo/small/USGS.png\" align=\"absmiddle\" />&nbsp;" +
										"<a href=\"" + eqk_InfoURL + "\" target=\"_blank\">U.S. Geological Survey</a>" +
										"</div>";
										

									var marker = this.createMarker(eqk_LatLon, eqk_Icon, iconEarthquake_MagnitudeX_Shadow, eqk_MarkerTitle, eqk_ImportanceLevel, eqk_Html);

		
									markersEarthquake[eqk_markerCount] = marker;
										
									if (!document.myForm.checkboxEarthquake.checked)
									{
										markersEarthquake[eqk_markerCount].setVisible(false);
									}
									else
									{
										isEnabled_Earthquake = true;
									}

									
									// We'll list the 5 most recent earthquakes on the menu as a list...
									if (eqk_markerCount < 6)
									{
										listEarthquake_MostRecent +=
											eqk_MarkerTitle.replace("Earthquake - ", "") +
			                                "<a href=\"javascript:onLinkClicked_DisplayMarkerInfoWindow('Earthquake', " + eqk_markerCount + ")\"><em>&nbsp;&nbsp;&nbsp;&nbsp;More info...</em><br /></a>"
			
			                            if (document.myForm.checkboxEarthquake.checked)
			                            {
										    document.getElementById('textEarthquake_MostRecent').innerHTML = listEarthquake_MostRecent;
										}
									}
									
									eqk_markerCount++;
										
									// Put the star marker/icon next to the most recent Earthquake event only...
									if (eqk_markerCount == 1)
									{
										markersEarthquake[eqk_markerCount] = this.createMarker(eqk_LatLon, iconMostRecent_Star, null, eqk_MarkerTitle, eqk_ImportanceLevel + 10, eqk_Html);;
										
										if (!document.myForm.checkboxEarthquake.checked)
										{
											markersEarthquake[eqk_markerCount].setVisible(false);
										}
						
										eqk_markerCount++;
									}
									
								}
							}
						}
					

						// Done...
						var countEarthquakeEvents = eqk_markerCount - 1;
						
						if (countEarthquakeEvents < 0) countEarthquakeEvents = 0;
						
						document.getElementById("lblEarthquake").innerHTML = "Earthquakes - " + countEarthquakeEvents + " event" + (countEarthquakeEvents != 1 ? "s" : "");
						    
					});
					break;
					
					
					
				case "Earthquake_PlateBoundaries":
					//document.getElementById('loadingMessage').style.visibility = 'visible';
					//document.getElementById('loadingMessageText').innerHTML = "Loading Plate Boundaries layer...";
					
					try
					{
						polylinesEarthquake_PlateBoundaries.setMap(null); 
					}
					catch (ex_GEOMAC)
					{
					}

 					polylinesEarthquake_PlateBoundaries = new google.maps.KmlLayer(urlUSGS_EHP_PlateBoundaries, {preserveViewport:true}); 
					
					polylinesEarthquake_PlateBoundaries.setMap(mapCanvas); 

					isLoaded_Earthquake_PlateBoundaries = true;
					break;
					


					
				case "Tsunami":
					
				    if (!isUpdatingMapAllHazards)
				    {
					    document.getElementById('loadingMessage').style.visibility = 'visible';
					    document.getElementById('loadingMessageText').innerHTML = "Updating Tsunami layer...";
					    window.setTimeout("this.clearMessages()", 2000)	// Display this message for 2 seconds...
				    }


				    // Reset...
                    listTsunami_MostRecent_Minutes = [];
                    listTsunami_MostRecent_Working = "";
				    listTsunami_MostRecent = "";
				    document.getElementById('textTsunami_MostRecent').innerHTML = "";


				    // IMPORTANT:  First, remove all existing markers created...	
				    for (var iX = 0; iX < markersTsunami.length; iX++) 
				    {
					    markersTsunami[iX].setMap(null);
				    }

				    markersTsunami = [];		// Clear array...


				    tsu_Count_TsunamiReports = 0;
				    tsu_MarkerCount = 0;


				    var tsu_MinutesElapsed_MostRecent = 999999999;
				    var tsu_LatLon_MostRecent;
				    var tsu_Icon_MostRecent;
				    var tsu_IconShadow_MostRecent;
				    var tsu_MarkerTitle_MostRecent = "";
				    var tsu_ImportanceLevel_MostRecent;
				    var tsu_Html_MostRecent;
				    var tsu_marker_MostRecent;

    				
    				
				    //
				    // *** PART 1: West Coast & Alaska Tsunami Warning Center (WCATWC) ***
				    //
				    var tsu_ProcessingComplete_WCATWC = false;

				    this.downloadUrl(urlNOAA_WCATWC_Tsunami_Events_HTML, function(data_WCATWC_TsunamiEventsList, responseCode)
                    {
					    // To ensure against HTTP errors that result in null or bad data,
					    // always check status code is equal to 200 before processing the data
					    if(responseCode != 200)
					    {
						    document.getElementById('errorMessage').innerHTML = "Error fetching NOAA - WCATWC Tsunami data, ResponseCode = " + responseCode;
					    }
					    else
					    {
						    data_WCATWC_TsunamiEventsList = this.subString_ExtractPiece(data_WCATWC_TsunamiEventsList, "<!-- History --", "</table>", false);

						    // Start adding the new markers...
						    while (tsu_ProcessingComplete_WCATWC == false)
                		    {
							    // Get an individual Tsunami Event block from the raw data...
							    var sWork = this.subString_ExtractPiece(data_WCATWC_TsunamiEventsList, "<tr><td id=", "</td></tr>", false);

							    // Remove the Tsunami Event block from the raw data so we don't process it again...
							    data_WCATWC_TsunamiEventsList = data_WCATWC_TsunamiEventsList.replace(sWork + "</td></tr>", "");

							    // Exit the Do-While loop here: no more WCATWC Tsunami events available to process...
							    if (sWork == "") {tsu_ProcessingComplete_WCATWC = true};

							    // Another WCATWC Tsunami event to evaluate...
							    if (!tsu_ProcessingComplete_WCATWC)
							    {
								    // Get the Event Latitude and Longitude values from the raw data...
								    var tsu_Latitude = this.subString_ExtractPiece(sWork, "Latitude: ", "</strong>", true);
								    tsu_Latitude = tsu_Latitude.replace("<strong>", "");

								    var tsu_Longitude = this.subString_ExtractPiece(sWork, "Longitude: ", "</strong>", true);
								    tsu_Longitude = tsu_Longitude.replace("<strong>", "");


								    // Special handling for TSUNAMI layer: set a small Latitude/Longitude offset so multiple simultaneously issued Tsunami alerts
								    // that reference the exact same location (e.g. with a strong/major/great Earthquake) will be offset slightly so the markers
								    // can be accessible by the user...
								    var tsu_LatLon = new google.maps.LatLng(parseFloat(tsu_Latitude) + this.randomOffsetCoordinateSlightly(), 
																		    parseFloat(tsu_Longitude) + this.randomOffsetCoordinateSlightly());


								    // Get the Event URL value from the raw data...
								    var tsu_InfoURL = "http:" + this.subString_ExtractPiece(sWork, "href=\"http:", ".htm", true) + ".htm";


								    // Get the Event ID value from the raw data...
								    var tsu_EventID = this.subString_ExtractPiece(tsu_InfoURL, "/message", ".htm", true);
    		

    								
								    // Get the Event Origin Location value from the raw data...
								    var tsu_OriginLocation = this.subString_ExtractPiece(sWork, "Location: ", "</strong>", true);
    								
								    tsu_OriginLocation = tsu_OriginLocation.replace("<strong>", "");
    								
									var tsu_OriginLocation_UPPERCASE = tsu_OriginLocation.toUpperCase();
									
								    tsu_OriginLocation = this.convertToMixedCase(tsu_OriginLocation);


								    // Set the default Affected Region value...
								    var tsu_AffectedRegion = "U.S. West Coast, Alaska, and British Columbia coastal regions";

									if (tsu_OriginLocation_UPPERCASE.indexOf("PUERTO RICO") >= 0 | tsu_OriginLocation_UPPERCASE.indexOf("VIRGIN") >= 0)
									{
										tsu_AffectedRegion = "Puerto Rico and Virgin Islands coastal regions";
									}
									else if (parseInt(tsu_Latitude, 10) > 10 & 
										     parseInt(tsu_Longitude, 10) >= -100 & parseInt(tsu_Longitude, 10) <= 0)
									{
										tsu_AffectedRegion = "U.S. and Canadian Atlantic, and Gulf of Mexico coastal regions";
									}


								    // Get the Event Title value from the raw data...
								    var tsu_Title = this.subString_ExtractPiece(sWork, "- ", "<", true).toUpperCase();


								    // Get the Event Date-Time (UTC) value from the raw data...
								    // <strong>2010/02/27 06:34:14 (UTC)</strong>
								    var iPosDateTimeUTC = sWork.indexOf("(UTC)");
								    var iPosDateTime = sWork.lastIndexOf(">", iPosDateTimeUTC) + 1;
    								
								    var tsu_DateTime = sWork.substr(iPosDateTime, iPosDateTimeUTC - iPosDateTime);

								    var tsu_DatePart = tsu_DateTime.substr(0, tsu_DateTime.indexOf(" ")).split('/');

								    var tsu_TimePart = this.subString_ExtractPiece(tsu_DateTime, " ", "", true).split(':');
    								
								    var dtValue = new Date(parseInt(tsu_DatePart[0], 10), parseInt(tsu_DatePart[1], 10) - 1, parseInt(tsu_DatePart[2], 10), 
													       parseInt(tsu_TimePart[0], 10), parseInt(tsu_TimePart[1], 10), parseInt(tsu_TimePart[2], 10), 0);

								    dtValue.setHours(dtValue.getHours() + (localOffset_Hours));


								    var milliseconds_dtEvent = dtValue.getTime();
    								
								    // Time difference in milliseconds...
								    var millisecondsElapsed = milliseconds_dtNow - milliseconds_dtEvent;
    								
								    // Time difference in seconds...
								    var secondsElasped = Math.round(millisecondsElapsed / 1000)

								    // Time difference in minutes...
								    var minutesElapsed = Math.round(secondsElasped / 60);


								    // Skip processing anything older than 24 hours...
								    var minutesElapsedThreshhold = 1440;
    								
								    // Skip processing anything older than 1 week...
								    if (document.myForm.radioTsunami_Age[1].checked)
								    {
									    minutesElapsedThreshhold = 10080;
								    }


									// Don't process those WCATWC Tsunami reports if the AGE has exceeded the defined threshhold...
									if (minutesElapsed < minutesElapsedThreshhold)
								    {
									    var tsu_IconFileUrl;
									    var tsu_Icon;
									    var tsu_IconShadow;
									    var tsu_ImportanceLevel;
    		
									    if (tsu_Title.indexOf("WARNING") >= 0)
									    {
										    tsu_Title = "Tsunami WARNING";
										    tsu_IconFileUrl = iconTsunami_Warning_Url;
										    tsu_Icon = iconTsunami_Warning;
										    tsu_IconShadow = iconTsunami_WarningWatch_Shadow;
										    tsu_ImportanceLevel = 200;
									    }
    			
									    else if (tsu_Title.indexOf("WATCH") >= 0)
									    {
										    tsu_Title = "Tsunami WATCH";
										    tsu_IconFileUrl = iconTsunami_Watch_Url;
										    tsu_Icon = iconTsunami_Watch;
										    tsu_IconShadow = iconTsunami_WarningWatch_Shadow;
										    tsu_ImportanceLevel = 100;
									    }
    									
									    else if (tsu_Title.indexOf("ADVISORY") >= 0)
									    {
										    tsu_Title = "Tsunami ADVISORY";
										    tsu_IconFileUrl = iconTsunami_Advisory_Url;
										    tsu_Icon = iconTsunami_Advisory;
										    tsu_IconShadow = iconTsunami_Advisory_Shadow;
										    tsu_ImportanceLevel = 90;
									    }
    									
									    else
									    {
										    tsu_Title = "Tsunami Information Statement";
										    tsu_IconFileUrl = iconTsunami_InfoStatement_Url;
										    tsu_Icon = iconTsunami_InfoStatement;
										    tsu_IconShadow = iconTsunami_InfoStatement_Shadow;
										    tsu_ImportanceLevel = 50;
									    }



									    // Get the Affected Region image to display as a thumbnail...
									    var tsu_Image = urlNOAA_WCATWC_Tsunami_EventOrigin_WideView_Image;
									    tsu_Image = 
										    tsu_Image.replace("<TSUNAMI_EVENT_DATE_EVENT_ID>", tsu_DateTime.substr(0, tsu_DateTime.indexOf(" ")) + "/" + tsu_EventID.replace("-", "/") + "/");
									    tsu_Image = tsu_Image.replace("<TSUNAMI_EVENT_ID>", tsu_EventID);
    													

									    tsu_DateTime = this.formatLocalDateTimeString(dtValue, true);


									    var tsu_Html =
										    "<div id=\"infowindowHTML\">" +
										    "<img src=\"" + tsu_IconFileUrl + "\" width=\"32\" height=\"32\" />" +
										    "<br />" +
										    "<span style=\"font-size:15px; font-weight:bold;\">" + tsu_Title + "</span>" +
										    "<br />" +
										    "<span style=\"font-weight:bold;\">" + tsu_AffectedRegion + "</span>" +
										    "<br /><br />" +
										    "<a href=\"" + tsu_Image + "\" target=\"_blank\">" +
										    "<img src=\"" + tsu_Image + "\" width=\"211\" height=\"185\" />" +
										    "</a>" +
										    "<br /><br />" +
										    "<span style=\"font-weight:bold;\">Event ID: </span>" + tsu_EventID +
										    "<br /><br />" +
										    "<span style=\"font-weight:bold;\">Event Origin:</span><br />" + tsu_OriginLocation +
										    "<br /><br /><br />" +
										    "<span style=\"font-weight:bold;\">Issued: </span>" + tsu_DateTime +
										    "<br /><br />" +
										    "<hr /><span style=\"font-weight:bold;\">More information:</span><br />" +
										    "<br />" +
										    "<img src=\"images/logo/small/NOAA.jpg\" align=\"absmiddle\" />&nbsp;" +
										    "<a href=\"" + tsu_InfoURL + "\" target=\"_blank\">NOAA - West Coast & Alaska Tsunami Warning Center</a>" +
										    "</div>";
    										

									    var tsu_MarkerTitle = "<strong>" + tsu_Title + "</strong><br />" + 
														      "Affected Region: " + tsu_AffectedRegion + "<br />" + 
														      "Event Origin: " + tsu_OriginLocation + "<br />" + 
														      tsu_DateTime;


									    // Skip adding a marker here if we're only going to show the "most recent" Tsunami reports...
									    if (!document.myForm.checkboxTsunami_MostRecentReportsOnly.checked)
									    {
										    var marker = this.createMarker(tsu_LatLon, tsu_Icon, tsu_IconShadow, tsu_MarkerTitle, tsu_ImportanceLevel, tsu_Html);
    			
										    markersTsunami[tsu_MarkerCount] = marker;
    										
										    if (!document.myForm.checkboxTsunami.checked)
										    {
											    markersTsunami[tsu_MarkerCount].setVisible(false);
										    }
										    else
										    {
											    isEnabled_Tsunami = true;
										    }
    										
										    tsu_MarkerCount++;
										    tsu_Count_TsunamiReports++;
									    }
    									
    									
									    if (minutesElapsed < tsu_MinutesElapsed_MostRecent)
									    {
										    tsu_LatLon_MostRecent = tsu_LatLon;
										    tsu_Icon_MostRecent = tsu_Icon;
										    tsu_IconShadow_MostRecent = tsu_IconShadow;
										    tsu_MarkerTitle_MostRecent = tsu_MarkerTitle;
										    tsu_ImportanceLevel_MostRecent = tsu_ImportanceLevel + 10;
										    tsu_Html_MostRecent = tsu_Html;
    										
										    tsu_MinutesElapsed_MostRecent = minutesElapsed;
									    }
								    }
							    }
						    }  // While loop...
					    }
    					
    					
					    // Process the "most recent" marker...
					    if (tsu_MarkerTitle_MostRecent != "")
					    {
						    tsu_marker_MostRecent = this.createMarker(tsu_LatLon_MostRecent, tsu_Icon_MostRecent, tsu_IconShadow_MostRecent, 
																      tsu_MarkerTitle_MostRecent, tsu_ImportanceLevel_MostRecent, tsu_Html_MostRecent);
    		
						    markersTsunami[tsu_MarkerCount] = tsu_marker_MostRecent;
    						
						    if (!document.myForm.checkboxTsunami.checked)
						    {
							    markersTsunami[tsu_MarkerCount].setVisible(false);
						    }
						    else
						    {
							    isEnabled_Tsunami = true;
						    }
    		
						    tsu_MarkerCount++;
    						
						    if (document.myForm.checkboxTsunami_MostRecentReportsOnly.checked)
						    {
							    tsu_Count_TsunamiReports++
						    }

    		
                            // Sort the "Most Recent" Tsunamis list by using the Minutes Elapsed value to place the most recent ones higher on the list...
	                        listTsunami_MostRecent_Minutes.push(tsu_MinutesElapsed_MostRecent);
		                    listTsunami_MostRecent_Minutes.sortNum();
        		            
							//tsu_MarkerTitle_MostRecent = "<strong>" +  tsu_MarkerTitle_MostRecent.replace("\n", "</strong><br />&nbsp;&nbsp;");
							//tsu_MarkerTitle_MostRecent = tsu_MarkerTitle_MostRecent.replace(/\n/g, "<br />&nbsp;&nbsp;");
							
		                    listTsunami_MostRecent_Working += 
                                tsu_MinutesElapsed_MostRecent +
					            tsu_MarkerTitle_MostRecent +
	                            "<a href=\"javascript:onLinkClicked_DisplayMarkerInfoWindow('Tsunami', " + tsu_MarkerCount + ")\"><em>&nbsp;&nbsp;&nbsp;&nbsp;More info...</em><br /></a>|";

        			        listTsunami_MostRecent = "";

			                for (var iX = 0; iX < listTsunami_MostRecent_Minutes.length; iX++) 
			                {
			                    listTsunami_MostRecent += this.subString_ExtractPiece(listTsunami_MostRecent_Working, listTsunami_MostRecent_Minutes[iX].toString(), "|", true);
			                }
        			    
		                    if (document.myForm.checkboxTsunami.checked)
		                    {
                                document.getElementById('textTsunami_MostRecent').innerHTML = listTsunami_MostRecent;
		                    }


						    tsu_marker_MostRecent = this.createMarker(tsu_LatLon_MostRecent, iconMostRecent_Star, null, 
																      tsu_MarkerTitle_MostRecent, tsu_ImportanceLevel_MostRecent + 10, tsu_Html_MostRecent);
    		
						    markersTsunami[tsu_MarkerCount] = tsu_marker_MostRecent;
    						
						    if (!document.myForm.checkboxTsunami.checked)
						    {
							    markersTsunami[tsu_MarkerCount].setVisible(false);
						    }
    		
						    tsu_MarkerCount++;
					    }

    					
					    // Done...
					    var countTsunamiEvents = "Tsunamis - " + tsu_Count_TsunamiReports + " alert";
					    if (tsu_Count_TsunamiReports != 1) {countTsunamiEvents += "s"};
    					
					    document.getElementById("lblTsunami").innerHTML = countTsunamiEvents;	



				        //
				        // *** PART 2: Pacific Tsunami Warning Center (PTWC) ***
				        //
        				
				        // 
				        // Process the four different PTWC regions in the separate function...
				        //
        				
				        // PACIFIC OCEAN (Pacific Ocean Basin/Pacific Rim Countries)
				        this.fetchData_Tsunami_PTWC(urlNOAA_PTWC_Tsunami_PacificOcean_RSS);
        				
				        // HAWAIIAN ISLANDS
				        this.fetchData_Tsunami_PTWC(urlNOAA_PTWC_Tsunami_Hawaii_RSS);
        				
				        // INDIAN OCEAN
				        this.fetchData_Tsunami_PTWC(urlNOAA_PTWC_Tsunami_IndianOcean_RSS);
        				
				        // CARIBBEAN SEA
				        this.fetchData_Tsunami_PTWC(urlNOAA_PTWC_Tsunami_Caribbean_RSS);
				    
                    });  // this.downloadUrl (data_WCATWC_TsunamiEventsList)

    				break;
					
					
					
					
				case "Volcano_USGS_VHP":
					this.downloadUrl(urlUSGS_VHP_Monitored, function(data, responseCode)
					{
						// To ensure against HTTP errors that result in null or bad data,
						// always check status code is equal to 200 before processing the data
						if(responseCode != 200)
						{
							document.getElementById('errorMessage').innerHTML = "Error fetching USGS VHP Actively Monitored Volcanoes data, ResponseCode = " + responseCode;
						}
						else
						{
							var xml = this.parseXml(data);
							
							markersXml_Volcano_USGS_VHP_ActivelyMonitored = xml.documentElement.getElementsByTagName("marker");


							this.downloadUrl(urlUSGS_VHP_Active, function(data, responseCode)
							{
								// To ensure against HTTP errors that result in null or bad data,
								// always check status code is equal to 200 before processing the data
								if(responseCode != 200)
								{
									document.getElementById('errorMessage').innerHTML = "Error fetching USGS VHP Volcanoes data, ResponseCode = " + responseCode;
								}
								else
								{
									var xml = this.parseXml(data);
									
									markersXml_Volcano_USGS_VHP_All = xml.documentElement.getElementsByTagName("marker");
		
									this.fetchData_Volcano_USGS_VHP("RED");
									this.fetchData_Volcano_USGS_VHP("ORANGE");
									this.fetchData_Volcano_USGS_VHP("YELLOW");
									this.fetchData_Volcano_USGS_VHP("GREEN_UNASSIGNED_SPECIAL_MONITORED");
									this.fetchData_Volcano_USGS_VHP("GREEN");
									this.fetchData_Volcano_USGS_VHP("UNASSIGNED");
								}
							});	
						}
					});
					break;
					
					
					
				case "Volcano_VAAC_Reports":

					this.downloadUrl(urlVAAC_Volcano_AshAdvisories_Reports, function(data, responseCode)
					{
						// To ensure against HTTP errors that result in null or bad data,
						// always check status code is equal to 200 before processing the data
						if(responseCode != 200)
						{
							document.getElementById('errorMessage').innerHTML = "Error fetching VAAC data, ResponseCode = " + responseCode;
						}
						else
						{
							// IMPORTANT:  First, remove all existing markers created...	
							for (var iX = 0; iX < markersVolcano_VAAC_Reports.length; iX++) 
							{
								markersVolcano_VAAC_Reports[iX].setMap(null);
							}

							markersVolcano_VAAC_Reports = [];		// Clear array...


							var vaac_VolcanoReports = "";
							var vaac_MarkerCount = 0;


							// A little preliminary cleanup: remove the <h2> header block to make sure the following VAAC report extraction loop works correctly...
							//
							// EXAMPLE: <h2 style="text-align: left;">Volcanic Ash Advisories Received in Last 7 Days</h2>
							//
							var workValue = this.subString_ExtractPiece(data, "<h2", "</h2>", false)
							
							if (workValue != "")
							{
								data = data.replace(workValue + "</h2>", "");
							}


							var workPatternMatch;
							var workPosition;


                            // Start adding the new markers...
							while (true)
							{
								var vaac_Title;
								var vaac_Coordinates;
								var vaac_Description_Raw;
								var vaac_IconColor;
								
								
								var vaac_Report_EndTag = "Received ";
								
			                    var vaac_Report = this.subString_ExtractPiece(data, "Received ", vaac_Report_EndTag, false);
								
								if (vaac_Report == "")
								{
									vaac_Report_EndTag = "</table>";
								
			                    	vaac_Report = this.subString_ExtractPiece(data, "Received ", vaac_Report_EndTag, false);
								}

								// No more VAAC reports to process, exit loop here...
								if (vaac_Report == "") {break};
								
								// Remove VAAC report currently being processed so we don't select it again...
								data = data.replace(vaac_Report, "");
								

								// Look for "</pre>" HTML tag indicating last message for the VAAC Location (e.g. Anchorage, Darwin, Tokyo, etc.)
								// currently being processed; this code prevents us from grabbing the header data for the next VAAC Location...
								//
								// EXAMPLE:
								//
								//	PLEASE SEE FVFE01 RJTD ISSUED BY TOKYO VAAC WHICH DECRIBES 
								//	
								//	CONDITIONS NEAR THE ANCHORAGE VAAC AREA OF RESPONSIBILITY.
									
								//	ERW JUN 11</pre></td>
								//	
								//		</tr>
								//		<tr> 
								//	
								//		<td><h3>Buenos Aires VAAC</h3><pre>IDD60154
								//	
								//		 VOLCANIC ASH ADVISORIES FROM BUENOS AIRES VAAC - LAST 7 DAYS
								if (vaac_Report.indexOf("</pre>") >= 0)
								{
									vaac_Report = vaac_Report.substr(0, vaac_Report.indexOf("</pre>"));
								}
								
								


								// VOLCANO NAME
								//
								// EXAMPLE: VOLCANO: KIZIMEN 1000-23
								//
								// Remove the numeric identifier that appears after the Volcano Name.
								workValue = this.trimString(this.subString_ExtractPiece(vaac_Report, "VOLCANO:", "\r\n", true));
								workPatternMatch = /\d/g;
								var vaac_VolcanoName = this.trimString(workValue.substr(0, workValue.search(workPatternMatch))).toUpperCase();

								
								// VOLCANO COORDINATES
								//
								// EXAMPLE: PSN: N5508 E16019
								// EXAMPLE: PSN: N3135E13040
								//
								workValue = this.trimString(this.subString_ExtractPiece(vaac_Report, "PSN:", "\r\n", true));
								
								workPatternMatch = /[EW]/;	// Find position of "E" or "W" letter designating the start of the Longitude value...

								workPosition = workValue.search(workPatternMatch);


								var workLatitude = this.trimString(workValue.substr(0, workPosition));

								workLatitude = workLatitude.substr(0, 1) + " " + workLatitude.substr(1, 2) + " " + workLatitude.substr(3, 2) + " 00";


								var workLongitude = workValue.substr(workPosition, workValue.length - workPosition);
								
								if (workLongitude.length > 6)
								{
									workLongitude = workLongitude.substr(0, 6);
								}
								
								switch (workLongitude.length)
								{
									case 5:		// EXAMPLE: E2536
										workLongitude = workLongitude.substr(0, 1) + " " + workLongitude.substr(1, 2) + " " + workLongitude.substr(3, 2);
										break;
										
									case 6:		// EXAMPLE: E16019
										workLongitude = workLongitude.substr(0, 1) + " " + workLongitude.substr(1, 3) + " " + workLongitude.substr(4, 2);
										break;
								}
								
								workLongitude += " 00";
								
								
								// Do not proceed with processing if missing a VOLCANO NAME or the LATITUDE/LONGITUDE values are invalid...
								if (vaac_VolcanoName != "" & workLatitude.indexOf("99") == -1 & workLongitude.indexOf("999") == -1)
								{
									
									// LATITUDE and LONGITUDE (decimal degrees format)
									var vaac_LatLon = new google.maps.LatLng(parseFloat(this.convertDecimalDegrees(workLatitude)) + this.randomOffsetCoordinateSlightly(),
																			 parseFloat(this.convertDecimalDegrees(workLongitude)) + this.randomOffsetCoordinateSlightly());


									//
									// DATE/TIME
									//
									// EXAMPLE: Received FVFE01 at 20:15 UTC, 13/06/11 from RJTD
									//
									workValue = this.subString_ExtractPiece(vaac_Report, "Received ", " from ", true);
									workValue = this.subString_ExtractPiece(workValue, " at ", "", true);
									workValue = workValue.replace(" UTC,", "");
									workValue = workValue.replace("  ", " ");
	
									// Extract the individual DATA and TIME components from the raw data to construct a formatted DATE/TIME stamp based on the local time zone...
									//
									// EXAMPLE: 20:15 13/06/11
									//
									var dtValue = new Date("20" + workValue.substr(12, 2), parseInt(workValue.substr(9, 2), 10) - 1, workValue.substr(6, 2), 
														   workValue.substr(0, 2), workValue.substr(3, 2), 0, 0);
									
									dtValue.setHours(dtValue.getHours() + (localOffset_Hours));
									
									var vaac_DateTime = this.formatLocalDateTimeString(dtValue, false);
	


									// ADVISORY NUMBER
									var vaac_AdvisoryNumber = this.trimString(this.subString_ExtractPiece(vaac_Report, "ADVISORY NR:", "\r\n", true));
																		
									
									// OFFICE
									var vaac_OfficeLocation = this.convertToMixedCase(this.trimString(this.subString_ExtractPiece(vaac_Report, "VAAC:", "\r\n", true)));
	
	
									// STATUS (COLOR) / ICON
									var vaac_ColorCode = this.trimString(this.subString_ExtractPiece(vaac_Report, "COLOUR CODE:", "\r\n", true));

									if (vaac_ColorCode == "")
									{
										vaac_ColorCode = this.trimString(this.subString_ExtractPiece(vaac_Report, "COLOR CODE:", "\r\n", true));
									}
									
									
									var vaac_IconFileUrl = iconVolcano_VAAC_Grey_Url;
									var vaac_Icon = iconVolcano_VAAC_Grey;
									var vaac_ImportanceLevel = 15;
											
									switch (vaac_ColorCode.toUpperCase())
									{
										case "RED":
											vaac_IconFileUrl = iconVolcano_VAAC_Red_Url;
											vaac_Icon = iconVolcano_VAAC_Red;
											vaac_ImportanceLevel = 99;
											break;
													
										case "ORANGE":
											vaac_IconFileUrl = iconVolcano_VAAC_Orange_Url;
											vaac_Icon = iconVolcano_VAAC_Orange;
											vaac_ImportanceLevel = 20;
											break;
													
										case "YELLOW":
											vaac_IconFileUrl = iconVolcano_VAAC_Yellow_Url;
											vaac_Icon = iconVolcano_VAAC_Yellow;
											vaac_ImportanceLevel = 18;
											break;
											
										default:
											vaac_ColorCode = "Not Assigned";
											break;
									}
									
									
									// AREA
									var vaac_Location = this.trimString(this.subString_ExtractPiece(vaac_Report, "AREA:", "\r\n", true));

									workPatternMatch = /\W/g;
									vaac_Location = vaac_Location.replace(workPatternMatch, " ");
									workPatternMatch = /[_]/g;
									vaac_Location = vaac_Location.replace(workPatternMatch, " ");
									vaac_Location = this.convertToMixedCase(vaac_Location);
									
								
									// INFORMATION SOURCE
									var vaac_InformationSource = this.trimString(this.subString_ExtractPiece(vaac_Report, "SOURCE:", "\r\n", true));
									
									if (vaac_InformationSource == "")
									{
										vaac_InformationSource = "Not Specified";
									}
																		
									
									
									// Duplication check -- only allow one VAAC report per volcano + office location; will only select the most recent report...
									var vaac_VolcanoReportKey = vaac_VolcanoName + "~" + vaac_OfficeLocation + "|";

									if (vaac_VolcanoReports.indexOf(vaac_VolcanoReportKey) == -1)
									{
										vaac_VolcanoReports += vaac_VolcanoReportKey;


										// DETAILS
										var vaac_Details = this.trimString(this.subString_ExtractPiece(vaac_Report, "ERUPTION DETAILS:", "", false));
										
										if (vaac_Details == "")
										{
											vaac_Details = this.trimString(this.subString_ExtractPiece(vaac_Report, "REMARKS:", "", false));
											
											if (vaac_Details == "")
											{
												vaac_Details = this.trimString(this.subString_ExtractPiece(vaac_Report, "RMK:", "", false));
											}
											
											if (vaac_Details == "")
											{
												vaac_Details = this.trimString(this.subString_ExtractPiece(vaac_Report, "ADVISORY NR:", "", false));
												
												if (vaac_Details != "")
												{
													vaac_Details = this.trimString(this.subString_ExtractPiece(vaac_Details, "\r\n\r\n", "", true));
												}
											}
										}
										
										// Cleanup...
										workPatternMatch = /Graphic at/g;
										vaac_Details = vaac_Details.replace(workPatternMatch, "");
										workPatternMatch = /\[lower/g;
										vaac_Details = vaac_Details.replace(workPatternMatch, "");
										workPatternMatch = /case\]/g;
										vaac_Details = vaac_Details.replace(workPatternMatch, "");
										
										workPatternMatch = /http/g;
										vaac_Details = vaac_Details.replace(workPatternMatch, "<br /><a href=\"http");
										workPatternMatch = /html/g;
										vaac_Details = vaac_Details.replace(workPatternMatch, "html\" target=\"_blank\">Click for more info from this VAAC</a><br />");
										
										workPatternMatch = /\r\n/g;
										vaac_Details = vaac_Details.replace(workPatternMatch, "<br />");

										vaac_Details += "<br /><br />";
										
										workPatternMatch = /=<br \/>/g;
										vaac_Details = vaac_Details.replace(workPatternMatch, "");
										
										workPatternMatch = /<br \/><br \/><br \/><br \/>/g;
										vaac_Details = vaac_Details.replace(workPatternMatch, "");
										
										workPatternMatch = /<br \/><br \/><br \/>/g;
										vaac_Details = vaac_Details.replace(workPatternMatch, "");

	
										var vaac_Html =
											"<div id=\"infowindowHTML\">" +
											"<img src=\"" + vaac_IconFileUrl + "\" width=\"30\" height=\"30\" /><br />" +
											"<span style=\"font-size:15px;font-weight:bold;\">" + this.convertToMixedCase(vaac_VolcanoName) + "</span>" +
											"<br />" +
											"<span style=\"font-weight:bold;\">" + vaac_Location + "</span>" +
											"<br /><br />" +
											"<span style=\"font-weight:bold;\">VAAC Advisory Number: </span>" + vaac_AdvisoryNumber + 
											"<br />" +
											"<span style=\"font-weight:bold;\">VAAC Location: </span>" + vaac_OfficeLocation +
											"<br /><br />" + 
											"<span style=\"font-weight:bold;\">Color Code: </span>" + vaac_ColorCode +
											"<br /><br />" + 
											"<span style=\"font-weight:bold;\">Information Source: </span>" + vaac_InformationSource +
											"<br /><br /><br />" +
											"<span style=\"font-weight:bold;\">Updated: </span>" + vaac_DateTime +
											"<br /><br /><br />" +
											"<div style=\"text-align:left\">" + vaac_Details +"</div>" +
											"<br />" +
											"<hr />" +
											"<span style=\"font-weight:bold;\">More information:</span>" +
											"<br /><br />" +
											"<img src=\"images/logo/small/NOAA.jpg\" align=\"absmiddle\" />&nbsp;" +
											"<a href=\"http://www.ssd.noaa.gov/VAAC/vaac.html\" target=\"_blank\">Volcanic Ash Advisory Centers</a>" +
											"</div>";
											
			
										var vaac_MarkerTitle = "<strong>Volcano</strong><br />" +
															   "Volcanic Ash Advisory report for " + vaac_VolcanoName.toUpperCase() + "<br />" +
															   vaac_DateTime;
			
			
										var marker = this.createMarker(vaac_LatLon, vaac_Icon, iconVolcano_VAAC_Shadow, vaac_MarkerTitle, vaac_ImportanceLevel, vaac_Html);
					
					
										markersVolcano_VAAC_Reports[vaac_MarkerCount] = marker;
			
										if (!document.myForm.checkboxVolcano_VAAC_Reports.checked)
										{
											markersVolcano_VAAC_Reports[vaac_MarkerCount].setVisible(false);
										}
										else
										{
											isEnabled_Volcano_VAAC_Reports = true;
										}
												
												
										vaac_MarkerCount++;
										
										
										if (markersVolcano_VAAC_Reports.length > 0)
										{
											var vaac_countReports = markersVolcano_VAAC_Reports.length + " volcanic ash advisory report";
											if (markersVolcano_VAAC_Reports.length != 1) {vaac_countReports += "s"};
											
											document.getElementById("lblVolcano_VAAC_Reports").innerHTML = vaac_countReports;
										}
									}

								}
								
							}

						}
					});
					break;
					


				case "Volcano_VAAC_Areas":
					try
					{
						polygonsVolcano_VAAC_Areas.setMap(null); 
					}
					catch (ex_GEOMAC)
					{
					}


					if (document.myForm.radioVolcano_VAAC_Areas[0].checked)
					{
 						polygonsVolcano_VAAC_Areas = new google.maps.KmlLayer(urlVAAC_Volcano_AshAdvisories_Areas.replace("<AGE>", "0-6"), {suppressInfoWindows: true, preserveViewport: true}); 
					}
					else
					{
 						polygonsVolcano_VAAC_Areas = new google.maps.KmlLayer(urlVAAC_Volcano_AshAdvisories_Areas.replace("<AGE>", "12-18"), {suppressInfoWindows: true, preserveViewport: true}); 
					}

					polygonsVolcano_VAAC_Areas.setMap(mapCanvas); 
				    break;


					
				case "Volcano_Smithsonian_GVP_New":
				case "Volcano_Smithsonian_GVP_Ongoing":
					
					this.downloadUrl(urlSmithsonian_GVP_WeeklyReports, function(data, responseCode)
					{
						// To ensure against HTTP errors that result in null or bad data,
						// always check status code is equal to 200 before processing the data
						if(responseCode != 200)
						{
							document.getElementById('errorMessage').innerHTML = "Error fetching Smithsonian GVP data, ResponseCode = " + responseCode;
						}
						else
						{
							// IMPORTANT:  First, remove all existing markers created...	
							switch (layerName)
							{
								case "Volcano_Smithsonian_GVP_New":
									for (var iX = 0; iX < markersVolcano_Smithsonian_GVP_New.length; iX++) 
									{
										markersVolcano_Smithsonian_GVP_New[iX].setMap(null);
									}
		
									markersVolcano_Smithsonian_GVP_New = [];			// Clear array...
									break;
									
								case "Volcano_Smithsonian_GVP_Ongoing":
									for (var iX = 0; iX < markersVolcano_Smithsonian_GVP_Ongoing.length; iX++) 
									{
										markersVolcano_Smithsonian_GVP_Ongoing[iX].setMap(null);
									}
		
									markersVolcano_Smithsonian_GVP_Ongoing = [];		// Clear array...
									break;
							}


							var xml = this.parseXml(data);


							// Need to do this only once: extract and display the PubDate value for the Smithsonian GVP reports...
							if (layerName == "Volcano_Smithsonian_GVP_New")
							{
								var sigvp_channel = xml.documentElement.getElementsByTagName("channel");
	
								var sigvp_PubDate;
								
								sigvp_PubDate = sigvp_channel[0].getElementsByTagName("pubDate")[0].firstChild.data;
								
								sigvp_PubDate = this.subString_ExtractPiece(sigvp_PubDate, ", ", " GMT", true);

								dtReportsPublished = new Date(sigvp_PubDate);

								dtReportsPublished.setHours(dtReportsPublished.getHours() + (localOffset_Hours));

								document.getElementById("lblSmithsonian_GVP_WeeklyReports_Updated").innerHTML = 
									"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Updated: " + this.formatLocalDateTimeString(dtReportsPublished, false);
							}


							var sigvp_Xml = xml.documentElement.getElementsByTagName("item");

							var sigvp_MarkerCount = 0;
							
							// Start adding the new markers...
							for (var iX = 0; iX < sigvp_Xml.length; iX++) 
							{
								var sigvp_Title;
								var sigvp_Coordinates;
								var sigvp_Description;
								var sigvp_InfoURL;

								if (detectBrowser.browser == "Explorer")
								{
									sigvp_Title = sigvp_Xml[iX].getElementsByTagName("title")[0].firstChild.data;
									sigvp_Description = sigvp_Xml[iX].getElementsByTagName("description")[0].firstChild.data;
									sigvp_InfoURL = sigvp_Xml[iX].getElementsByTagName("guid")[0].firstChild.data;
									sigvp_Coordinates = sigvp_Xml[iX].getElementsByTagName("georss:point")[0].firstChild.data.split(" ");
								}
								else	// Other browsers: Firefox, Chrome, Safari, Opera, etc...
								{
									var itemTags = sigvp_Xml[iX].getElementsByTagName("*");
									
									for (var iY = 0; iY < itemTags.length; iY++)
									{
										var itemTag = itemTags[iY].nodeName;
										
										switch (itemTag)
										{
											case "title":
												sigvp_Title = itemTags[iY].firstChild.data;
												break;
												
											case "description":
												sigvp_Description = itemTags[iY].firstChild.data;
												break;
												
											case "guid":
												sigvp_InfoURL = itemTags[iY].firstChild.data;
												break;
												
											case "georss:point":
												sigvp_Coordinates = itemTags[iY].firstChild.data.split(" ");
												break;
										}
									}
								}
		
		
								var sigvp_isReportToUse = false;

								switch (layerName)
								{
									case "Volcano_Smithsonian_GVP_New":
										if(sigvp_Title.indexOf(" NEW") >= 0)
										{
											sigvp_isReportToUse = true;
										}
										break;
										
									case "Volcano_Smithsonian_GVP_Ongoing":
										if(sigvp_Title.indexOf(" NEW") == -1)
										{
											sigvp_isReportToUse = true;
										}
										break;
								}
	

								if (sigvp_isReportToUse)
								{
									var sigvp_VolcanoName = sigvp_Title.substr(0, sigvp_Title.indexOf(" ("));
	
									var sigvp_LatLon = new google.maps.LatLng(parseFloat(sigvp_Coordinates[0] - .06), parseFloat(sigvp_Coordinates[1]) - .06);
		
									var sigvp_IconFileUrl;
									var sigvp_Icon;
									var sigvp_ImportanceLevel;
									
									switch (layerName)
									{
										case "Volcano_Smithsonian_GVP_New":
											sigvp_IconFileUrl = iconVolcano_SmithsonianGVP_New_Url;
											sigvp_Icon = iconVolcano_SmithsonianGVP_New;
											sigvp_ImportanceLevel = 55;
											break;
											
										case "Volcano_Smithsonian_GVP_Ongoing":
											sigvp_IconFileUrl = iconVolcano_SmithsonianGVP_Ongoing_Url;
											sigvp_Icon = iconVolcano_SmithsonianGVP_Ongoing;
											sigvp_ImportanceLevel = 50;
											break;
									}


									var osigvp_Title = sigvp_Title.split(')');
									
									sigvp_Title = osigvp_Title[0] + ")<br />" +
												  osigvp_Title[1].replace(" - ", "");
												  
									var sigvp_Status = "Ongoing Activity";
									
									if (sigvp_Title.indexOf("- NEW") >= 0)
									{
										sigvp_Status = "NEW Activity";
										
										sigvp_Title = sigvp_Title.replace("- NEW", "");
									}
									
									// Extract the VOLCANO NAME from the Title...
									var sigvp_VolcanoName = sigvp_Title.substr(0, sigvp_Title.indexOf(" ("));

									// Extract the VOLCANO LOCATION from the TITLE...
									var sigvp_Location = this.subString_ExtractPiece(sigvp_Title, "(", ")", true);
									
									
									var sigvp_UpdatedWeek = this.subString_ExtractPiece(sigvp_Title, "<br /> ", "", true).replace("Report for ", "");


									sigvp_MarkerTitle = "<strong>Volcano</strong><br />" + 
														sigvp_Status + " report for " + sigvp_VolcanoName.toUpperCase() + "<br />" +
												  		sigvp_UpdatedWeek;
												  
																							   

									var sigvp_Html =
										"<div id=\"infowindowHTML\">" +
										"<img src=\"" + sigvp_IconFileUrl + "\" width=\"32\" height=\"32\" /><br />" +
										"<span style=\"font-size:15px;font-weight:bold;\">" + sigvp_VolcanoName + "</span>" +
										"<br />" +
										"<span style=\"font-weight:bold;\">" + sigvp_Location + "</span>" +
										"<br /><br /><br />" +
										"<span style=\"font-weight:bold;\">Status: </span>" + sigvp_Status +
										"<br /><br />" +
										"<span style=\"font-weight:bold;\">Weekly Report: </span>" + sigvp_UpdatedWeek +
										"<br /><br />" +
										"<div style=\"text-align:left\">" + sigvp_Description + "</div>" +
										"<hr />" +
										"<span style=\"font-weight:bold;\">More information:</span>" +
										"<br /><br />" +
										"<img src=\"images/logo/small/Smithsonian.jpg\" align=\"absmiddle\" />&nbsp;" +
										"<a href=\"" + sigvp_InfoURL + "\" target=\"_blank\">Smithsonian Institution</a>" +
										"</div>";
										
										
									
									var marker = this.createMarker(sigvp_LatLon, sigvp_Icon, iconVolcano_SmithsonianGVP_Shadow, sigvp_MarkerTitle, sigvp_ImportanceLevel, sigvp_Html);
		
		
									switch (layerName)
									{
										case "Volcano_Smithsonian_GVP_New":
											markersVolcano_Smithsonian_GVP_New[sigvp_MarkerCount] = marker;
											
											if (!document.myForm.checkboxVolcano_Smithsonian_GVP_New.checked)
											{
												markersVolcano_Smithsonian_GVP_New[sigvp_MarkerCount].setVisible(false);
											}
											else
											{
												isEnabled_Volcano_Smithsonian_GVP_New = true;
											}
											break;
											
										case "Volcano_Smithsonian_GVP_Ongoing":
											markersVolcano_Smithsonian_GVP_Ongoing[sigvp_MarkerCount] = marker;
											
											if (!document.myForm.checkboxVolcano_Smithsonian_GVP_Ongoing.checked)

											{
												markersVolcano_Smithsonian_GVP_Ongoing[sigvp_MarkerCount].setVisible(false);
											}
											else
											{
												isEnabled_Volcano_Smithsonian_GVP_Ongoing = true;
											}
											break;
									}
									
									
									sigvp_MarkerCount++;
								}
							}


							switch (layerName)
							{
								case "Volcano_Smithsonian_GVP_New":
									if (markersVolcano_Smithsonian_GVP_New.length > 0)
									{
										var sigvp_countVolcano_New = markersVolcano_Smithsonian_GVP_New.length + " volcano";
										if (markersVolcano_Smithsonian_GVP_New.length != 1) {sigvp_countVolcano_New += "es"};
										
										document.getElementById("lblSmithsonian_GVP_WeeklyReports_New").innerHTML = "NEW activity - " + sigvp_countVolcano_New;
									}
									else
									{
										document.getElementById("lblSmithsonian_GVP_WeeklyReports_New").innerHTML = "NEW activity - 0 volcanoes";
									}
									break;
									
								case "Volcano_Smithsonian_GVP_Ongoing":
									if (markersVolcano_Smithsonian_GVP_Ongoing.length > 0)
									{
										var sigvp_countVolcano_Ongoing = markersVolcano_Smithsonian_GVP_Ongoing.length + " volcano";
										if (markersVolcano_Smithsonian_GVP_Ongoing.length != 1) {sigvp_countVolcano_Ongoing += "es"};
										
										document.getElementById("lblSmithsonian_GVP_WeeklyReports_Ongoing").innerHTML = "Ongoing activity - " + sigvp_countVolcano_Ongoing;
									}
									else
									{
										document.getElementById("lblSmithsonian_GVP_WeeklyReports_Ongoing").innerHTML = "Ongoing activity - 0 volcanoes";
									}
									break;
							}
						}
					});
					break;
					
					
					
				case "TropicalCyclone":
				
					if (!isUpdatingMapAllHazards)
					{
						document.getElementById('loadingMessage').style.visibility = 'visible';
						document.getElementById('loadingMessageText').innerHTML = "Updating Tropical Cyclone layer...";
						window.setTimeout("this.clearMessages()", 2000)	// Display this message for 2 seconds...
					}
					
					
					// IMPORTANT:  First, remove all existing markers created...	
					for (var iX = 0; iX < markersTropicalCyclone.length; iX++) 
					{
						try
						{
							markersTropicalCyclone[iX].setMap(null);
						}
						catch (ex_TropicalCyclone1)
						{
						}
					}
					
					for (var iX = 0; iX < markersTropicalCyclone_StormTrackHistory.length; iX++) 
					{
						try
						{
							markersTropicalCyclone_StormTrackHistory[iX].setMap(null);
						}
						catch (ex_TropicalCyclone2)
						{
						}
					}

					for (var iX = 0; iX < polylinesTropicalCyclone_StormTrackHistory.length; iX++) 
					{
						try
						{
							polylinesTropicalCyclone_StormTrackHistory[iX].setMap(null);
						}
						catch (ex_TropicalCyclone3)
						{
						}
					}

					markersTropicalCyclone = [];		// Clear arrays...
					markersTropicalCyclone_StormTrackHistory = [];
					polylinesTropicalCyclone_StormTrackHistory = [];


					// INVESTS...
					for (var iX = 0; iX < markersTropicalDisturbance.length; iX++) 
					{
						try
						{
							markersTropicalDisturbance[iX].setMap(null);
						}
						catch (ex_TropicalCyclone4)
						{
						}
					}
					
					for (var iX = 0; iX < markersTropicalDisturbance_StormTrackHistory.length; iX++) 
					{
						try
						{
							markersTropicalDisturbance_StormTrackHistory[iX].setMap(null);
						}
						catch (ex_TropicalCyclone5)
						{
						}
					}

					for (var iX = 0; iX < polylinesTropicalDisturbance_StormTrackHistory.length; iX++) 
					{
						try
						{
							polylinesTropicalDisturbance_StormTrackHistory[iX].setMap(null);
						}
						catch (ex_TropicalCyclone6)
						{
						}
					}

					markersTropicalDisturbance = [];		// Clear arrays...
					markersTropicalDisturbance_StormTrackHistory = [];
					polylinesTropicalDisturbance_StormTrackHistory = [];


					isEnabled_TropicalCyclone = false;
					isEnabled_TropicalDisturbance = false;
					
					document.getElementById("lblTropicalCyclone").innerHTML = "Tropical Cyclones - 0 storms";							


					
					// Reset...
					listTropicalCyclone_Active = "";
					document.getElementById('textTropicalCyclone_Active').innerHTML = listTropicalCyclone_Active;


                    // Init...
					tc_MarkerCount = 0;
					tc_MarkerCount_StormTrackHistory = 0;
					tc_PolylineCount_StormTrackHistory = 0;
					

					ti_MarkerCount = 0;
					ti_MarkerCount_StormTrackHistory = 0;
					ti_PolylineCount_StormTrackHistory = 0;
					

                    this.fetchData_TropicalCyclone_Region("at");    // NORTH ATLANTIC
                    this.fetchData_TropicalCyclone_Region("ep");    // EASTERN PACIFIC
                    this.fetchData_TropicalCyclone_Region("cp");    // CENTRAL PACIFIC
                    this.fetchData_TropicalCyclone_Region("wp");    // WESTERN PACIFIC
                    this.fetchData_TropicalCyclone_Region("sp");    // SOUTHERN PACIFIC
                    this.fetchData_TropicalCyclone_Region("io");    // INDIAN OCEAN
                    this.fetchData_TropicalCyclone_Region("na");    // ARABIAN SEA
                    this.fetchData_TropicalCyclone_Region("ni");    // INDIAN OCEAN (NORTH)
                    this.fetchData_TropicalCyclone_Region("si");    // INDIAN OCEAN (SOUTH)
                    this.fetchData_TropicalCyclone_Region("sh");    // SOUTHERN HEMISPHERE

					break;
					


				case "Fire_USFS_RSAC_Incidents":

					if (!isUpdatingMapAllHazards)
					{
						document.getElementById('loadingMessage').style.visibility = 'visible';
						document.getElementById('loadingMessageText').innerHTML = "Loading USFS-RSAC Active Fires layer...";
						window.setTimeout("this.clearMessages()", 2000)	// Display this message for 2 seconds...
					}
					
					
					// IMPORTANT:  First, remove all existing markers created...	
					for (var iX = 0; iX < markersFire_USFS_RSAC_Incidents.length; iX++) 
					{
						markersFire_USFS_RSAC_Incidents[iX].setMap(null);
					}

					markersFire_USFS_RSAC_Incidents = [];		// Clear array...
					
					isEnabled_Fire_USFS_RSAC_Incidents = false;
					
					document.getElementById("lblFire_USFS_RSAC_Incidents").innerHTML = "Active large fires - 0 incidents";		
					

					this.downloadUrl(urlFire_USFS_RSAC_Incidents, function(data_USFS_RSAC_Incidents, responseCode)
					{
						// To ensure against HTTP errors that result in null or bad data,
						// always check status code is equal to 200 before processing the data
						if(responseCode != 200)
						{
							document.getElementById('errorMessage').innerHTML = "Error fetching USFS-RSAC Fire Incidents data, ResponseCode = " + responseCode1;
						}
						else
						{
							var xml = this.parseXml(data_USFS_RSAC_Incidents);
							
							var rsac_incident_folder_xml = xml.documentElement.getElementsByTagName("Folder");


//     <Folder>
//     <name> Current Incident Locations</name>
//          <Placemark>
//               <name>HIDDEN VALLEY</name>
//               <description> <![CDATA[ <b>Report Date:</b> 03/16/2010<br/> <b>Latitude:</b> 30.444<br/> <b>Longitude:</b> -89.310<br/> <b>Fire Location:</b> <br/> <b>Fire Size:</b> 175 acres (70.8 ha)<br/> <b>Percent Contained:</b> Unknown% <br/> <b>Expected Containment:</b> Unknown<br/> <b>Fire Type:</b> Other<br/> <b>Team Type:</b> Unknown<br/> See http://www.nifc.gov/news/sitreprt.pdf for more //information  ]]></description>
//               <styleUrl>IMTOtherPlacemark</styleUrl>
//               <Point>
//                    <coordinates>-89.310,30.444,0</coordinates>
//               </Point>
//         </Placemark>

							var rsac_incident_placemarks_xml = rsac_incident_folder_xml[1].getElementsByTagName("Placemark");
	
							var rsac_incident_MarkerCount = 0;

							// Start processing (but NOT displaying) the new markers from the <Placemark> elements in the raw XML data...
							for (var iX = 0; iX < rsac_incident_placemarks_xml.length; iX++) 
							{
								var rsac_incident_Name = rsac_incident_placemarks_xml[iX].getElementsByTagName("name")[0].firstChild.data;

								var rsac_incident_Description = this.subString_ExtractPiece(data_USFS_RSAC_Incidents, rsac_incident_Name + "</name>", "]]></description>", true);
								

								// Fire Location
								var rsac_incident_Location = this.subString_ExtractPiece(rsac_incident_Description, "Location:</b> ", "<br/>", true);
								
								rsac_incident_Location = this.trimString(rsac_incident_Location);
								
								if (rsac_incident_Location == "") {rsac_incident_Location = "Location Unspecified";}
								
								
								// Report Date
								var workDate = this.subString_ExtractPiece(rsac_incident_Description, "Report Date:</b> ", "<br/>", true).split('/');

								var dtValue = new Date(parseInt(workDate[2], 10), parseInt(workDate[0], 10) - 1, parseInt(workDate[1], 10), 0, 0, 0, 0);

								dtValue.setHours(dtValue.getHours() + (localOffset_Hours));
								
								var workDate = dtValue.toLocaleDateString();;

								// Remove any leading zeroes from the date field...
								workDate = workDate.replace(" 0", " ");
								workDate = workDate.replace(", 20", " 20");
		
								var rsac_incident_ReportDate = workDate;
								

								// Process the Latitude/Longitude values...
								var rsac_incident_Latitude = this.subString_ExtractPiece(rsac_incident_Description, "Latitude:</b> ", "<br/>", true);
								var rsac_incident_Longitude = this.subString_ExtractPiece(rsac_incident_Description, "Longitude:</b> ", "<br/>", true);
								
								rsac_incident_LatLon = new google.maps.LatLng(parseFloat(rsac_incident_Latitude), parseFloat(rsac_incident_Longitude));


								// DESCRIPTION: Some cleanup and formatting improvements to the raw HTML...
								rsac_incident_Description =  this.subString_ExtractPiece(rsac_incident_Description, "<b>Fire Size:", "", false);
								
								rsac_incident_Description = this.trimString(rsac_incident_Description);
								
								var rsac_incident_MoreInfoUrl = this.subString_ExtractPiece(rsac_incident_Description, " See http://", "", false);

								rsac_incident_Description = rsac_incident_Description.replace(rsac_incident_MoreInfoUrl, "");
								
								rsac_incident_Description = rsac_incident_Description.replace(/<br\/>/g, "<br /><br />");
								
								rsac_incident_MoreInfoUrl = rsac_incident_MoreInfoUrl.replace(" See ", "");
								

								var rsac_incident_Html =
									"<div id=\"infowindowHTML\">" +
									"<img src=\"" + iconFire_USFS_RSAC_Incident_Url + "\" />" +
									"<br />" +
									"<span style=\"font-size:15px; font-weight:bold;\">Wildland Fire - " + rsac_incident_Name + "</span>";
									
									if (rsac_incident_Location.indexOf("Unspecified") == -1)
									{
										rsac_incident_Html +=
											"<br />" +
											"<span style=\"font-weight:bold;\">" + rsac_incident_Location + "</span>";
									}
									
									rsac_incident_Html +=
										"<br /><br /><br />" +
										rsac_incident_Description +
										"<br />" +
										"<span style=\"font-weight:bold;\">Updated: </span>" + rsac_incident_ReportDate +
										"<br /><br />" +
										"<hr /><span style=\"font-weight:bold;\">More information:</span><br />" +
										"<img src=\"images/logo/small/NIFC.png\" align=\"absmiddle\" />&nbsp;&nbsp;" +
										"<a target=\"_blank\" href=\"" + rsac_incident_MoreInfoUrl + "\">National Interagency Fire Center</a>" +
										"</div>";
	
	
								var rsac_incident_MarkerTitle = "<strong>Wildland Fire</strong><br />" +
																rsac_incident_Name + "<br />";
																
																
								if (rsac_incident_Location.indexOf("Unspecified") == -1)
								{
									rsac_incident_MarkerTitle += rsac_incident_Location + "<br />";
								}
								
								rsac_incident_MarkerTitle += rsac_incident_ReportDate;
	
	
								var marker = this.createMarker(rsac_incident_LatLon, iconFire_USFS_RSAC_Incident, iconFire_USFS_RSAC_Incident_Shadow, 
															   rsac_incident_MarkerTitle, 100, rsac_incident_Html);
	
	
								markersFire_USFS_RSAC_Incidents[rsac_incident_MarkerCount] = marker;

								isEnabled_Fire_USFS_RSAC_Incidents = true;
								
								rsac_incident_MarkerCount++;
								
								
								var countIncidents = "Active large fires - " +  rsac_incident_MarkerCount + " incident";
								if (rsac_incident_MarkerCount != 1) {countIncidents += "s"};
								
								document.getElementById("lblFire_USFS_RSAC_Incidents").innerHTML = countIncidents;							
	
							}	// Go process the next PLACEMARK...
						}
					});
                	break;
					
					
					
				case "Fire_USFS_RSAC_HotSpots":
				
					if (!isUpdatingMapAllHazards)
					{
						document.getElementById('loadingMessage').style.visibility = 'visible';
						document.getElementById('loadingMessageText').innerHTML = "Loading USFS-RSAC Fire Detection layer...";
						window.setTimeout("this.clearMessages()", 4000)	// Display this message for 7 seconds max...
					}


					// IMPORTANT:  First, remove all existing markers created...	
					for (var iX = 0; iX < markersFire_USFS_RSAC_HotSpots_12Hours.length; iX++) 
					{
						markersFire_USFS_RSAC_HotSpots_12Hours[iX].setMap(null);
					}

					for (var iX = 0; iX < markersFire_USFS_RSAC_HotSpots_12to24Hours.length; iX++) 
					{
						markersFire_USFS_RSAC_HotSpots_12to24Hours[iX].setMap(null);
					}

					markersFire_USFS_RSAC_HotSpots_12Hours = [];		// Clear arrays...
					markersFire_USFS_RSAC_HotSpots_12to24Hours = [];		
					
					document.getElementById("lblFire_USFS_RSAC_HotSpots").innerHTML = "Fire activity detection - 0 hot spots";		
					
					
					var rsac_hotspot_12Hours_MarkerCount = 0;
					var rsac_hotspot_12to24Hours_MarkerCount = 0;
					

					this.downloadUrl(urlFire_USFS_RSAC_HotSpots, function(data_USFS_RSAC_HotSpots, responseCode)
					{
						// To ensure against HTTP errors that result in null or bad data,
						// always check status code is equal to 200 before processing the data
						if(responseCode != 200)
						{
							document.getElementById('errorMessage').innerHTML = "Error fetching USFS-RSAC Hot Spots data, ResponseCode = " + responseCode1;
						}
						else
						{
							data_USFS_RSAC_HotSpots = this.subString_ExtractPiece(data_USFS_RSAC_HotSpots, "Distance to Town", "</table>", true);
							data_USFS_RSAC_HotSpots = this.subString_ExtractPiece(data_USFS_RSAC_HotSpots, "<tr bgcolor='#FFFFFF'>", "", false);
							
//<tr bgcolor='#FFFFFF'><td>03-20-10</td><td>1558</td><td>T</td><td>-80.155</td><td>33.605</td><td>N-A</td><td>N-A</td><td>Cropland/Natural Vegetation Mosaic</td><td>Moderate</td><td>Clarendon</td><td>South Carolina</td><td>Baggette Crossroads</td><td>1.8</td></tr>

							var rsac_hotspot_ProcessingComplete = false;
							
							while (rsac_hotspot_ProcessingComplete == false)
							{
								var rsac_hotspot_Record = this.subString_ExtractPiece(data_USFS_RSAC_HotSpots, "<tr bgcolor='#FFFFFF'>", "</tr>", true);
								
								if (rsac_hotspot_Record == "") {break;}
					
								data_USFS_RSAC_HotSpots = data_USFS_RSAC_HotSpots.replace("<tr bgcolor='#FFFFFF'>" + rsac_hotspot_Record + "</tr>", "");
								
								rsac_hotspot_Record = rsac_hotspot_Record.replace(/<td>/g, "");
								rsac_hotspot_Record = rsac_hotspot_Record.replace(/<\/td>/g, "|");

								rsac_hotspot_Record = rsac_hotspot_Record.split('|');
								
								
								// Process the Date/Time values...
								var workDate = rsac_hotspot_Record[0].split('-');
								
								var workTime = rsac_hotspot_Record[1];
								if (workTime.length == 3) {workTime = "0" + workTime;}
								
								var dtValue = new Date(parseInt("20" + workDate[2], 10), parseInt(workDate[0], 10) - 1, parseInt(workDate[1], 10), 
													   parseInt(workTime.substr(0, 2), 10), parseInt(workTime.substr(2, 2), 10), 0, 0);

								dtValue.setHours(dtValue.getHours() + (localOffset_Hours));

								var rsac_hotspot_DateTime = this.formatLocalDateTimeString(dtValue, false);
								
			
								var milliseconds_dtEvent = dtValue.getTime();
								
								// Time difference in milliseconds...
								var millisecondsElapsed = milliseconds_dtNow - milliseconds_dtEvent;
								
								// Time difference in seconds...
								var secondsElasped = Math.round(millisecondsElapsed / 1000)
			
								// Time difference in minutes...
								var minutesElapsed = Math.round(secondsElasped / 60);
		
		
								// Set threshhold at 12 hours to differentiate which bucket the markers go into...
								var bIsLessThan12HoursOld = true;
								
								if (minutesElapsed > 720)
								{
									bIsLessThan12HoursOld = false;
								}
								

								// Process the Latitude/Longitude values...
								var rsac_hotspot_Longitude = this.trimString(rsac_hotspot_Record[3]);
								var rsac_hotspot_Latitude = this.trimString(rsac_hotspot_Record[4]);
								

								// This check is here because the USFS-RSAC table data sometimes has a dummy record at the top...
								if (!isNaN(rsac_hotspot_Latitude) | !isNaN(rsac_hotspot_Longitude))
								{
									
									var rsac_hotspot_LatLon = new google.maps.LatLng(parseFloat(rsac_hotspot_Latitude), parseFloat(rsac_hotspot_Longitude));
									
								
									// Admin Unit
									var rsac_hotspot_AdminUnit = rsac_hotspot_Record[6];
									
									if (rsac_hotspot_AdminUnit == "N-A") {rsac_hotspot_AdminUnit = "None";}
	
	
									// Land Cover
									var rsac_hotspot_LandCover = rsac_hotspot_Record[7];
	
	
									// Fire Danger
									var rsac_hotspot_FireDanger = rsac_hotspot_Record[8];
									
									if (rsac_hotspot_FireDanger == "N-A") {rsac_hotspot_FireDanger = "Not Specified";}
	
	
									// Nearby Location
									var rsac_hotspot_State = rsac_hotspot_Record[10];
	
									var rsac_hotspot_Town = ""
									
									// This logic eliminates the redundant State abbreviation from the Town name if it exists...
									var workTown = rsac_hotspot_Record[11].split(' ');
									
									for (var iX = 0; iX < workTown.length; iX++) 
									{
										if (workTown[iX].length > 2)
										{
											rsac_hotspot_Town += workTown[iX] + " ";
										}
									}
									
									rsac_hotspot_Town = this.trimString(rsac_hotspot_Town);
									
									var rsac_hotspot_DistanceMiles = rsac_hotspot_Record[12];
									
									var rsac_hotspot_NearbyLocation = 
										rsac_hotspot_DistanceMiles + " miles from " + rsac_hotspot_Town + ", " + rsac_hotspot_State;
										
									
									
									var rsac_hotspot_Icon;
									var rsac_hotspot_IconUrl;
									var rsac_hotspot_ImportanceLevel;
									
									switch (bIsLessThan12HoursOld)
									{
										case true:
											rsac_hotspot_Icon = iconFire_USFS_RSAC_HotSpot_Red;
											rsac_hotspot_IconUrl = iconFire_USFS_RSAC_HotSpot_Red_Url;
											rsac_hotspot_ImportanceLevel = 95;
											break;
											
										case false:
											rsac_hotspot_Icon = iconFire_USFS_RSAC_HotSpot_Orange;
											rsac_hotspot_IconUrl = iconFire_USFS_RSAC_HotSpot_Orange_Url;
											rsac_hotspot_ImportanceLevel = 90;
											break;
									}
										
										
									var rsac_hotspot_Html =
										"<div id=\"infowindowHTML\">" +
										"<img src=\"" + rsac_hotspot_IconUrl + "\" width=\"24\" height=\"24\" align=\"abstop\" />" +
										"<br />" +
										"<span style=\"font-size:15px; font-weight:bold;\">Fire Actvity</span>" +
										"<br />" +
										"<span style=\"font-weight:bold;\">" + rsac_hotspot_NearbyLocation + "</span>" +
										"<br /><br />" +
										"<span style=\"font-weight:bold;\">Fire Danger: </span>" + rsac_hotspot_FireDanger +
										"<br /><br />" +
										"<span style=\"font-weight:bold;\">Land Cover: </span>" + rsac_hotspot_LandCover +
										"<br /><br />" +
										"<span style=\"font-weight:bold;\">Admin Unit: </span>" + rsac_hotspot_AdminUnit +
										"<br /><br /><br />" +
										"<span style=\"font-weight:bold;\">Date & Time: </span>" + rsac_hotspot_DateTime +
										"<br /><br />" +
										"<hr /><span style=\"font-weight:bold;\">More information:</span>" +
										"<br />" +
										"<img src=\"images/logo/small/USFS.png\" align=\"absmiddle\" />&nbsp;<img src=\"images/logo/small/RSAC.png\" align=\"absmiddle\" />&nbsp;&nbsp;" +
										"<a target=\"_blank\" href=\"http://activefiremaps.fs.fed.us/\">USDA Forest Service - Remote Sensing Applications Center</a>" +
										"</div>";
		
		
									var rsac_hotspot_MarkerTitle = "<strong>Fire Activity</strong><br />" + 
																   "Near " + rsac_hotspot_Town + ", " + rsac_hotspot_State + "<br />" + 
																   rsac_hotspot_DateTime;
		
		
									var marker = this.createMarker(rsac_hotspot_LatLon, rsac_hotspot_Icon, iconFire_USFS_RSAC_HotSpot_Shadow, 
																   rsac_hotspot_MarkerTitle, rsac_hotspot_ImportanceLevel, rsac_hotspot_Html);
		
		
									switch (bIsLessThan12HoursOld)
									{
										case true:
											markersFire_USFS_RSAC_HotSpots_12Hours[rsac_hotspot_12Hours_MarkerCount] = marker;
	
											if (!document.myForm.checkboxFire_USFS_RSAC_HotSpots_12Hours.checked)
											{
												markersFire_USFS_RSAC_HotSpots_12Hours[rsac_hotspot_12Hours_MarkerCount].setVisible(false);
											}
											
											rsac_hotspot_12Hours_MarkerCount++;
											break;
											
										case false:
											markersFire_USFS_RSAC_HotSpots_12to24Hours[rsac_hotspot_12to24Hours_MarkerCount] = marker;
			
											if (!document.myForm.checkboxFire_USFS_RSAC_HotSpots_12to24Hours.checked)
											{
												markersFire_USFS_RSAC_HotSpots_12to24Hours[rsac_hotspot_12to24Hours_MarkerCount].setVisible(false);
											}
											
											rsac_hotspot_12to24Hours_MarkerCount++;
											break;
									}
						
	
									var countHotSpots = "Fire activity detection - " + (rsac_hotspot_12Hours_MarkerCount + rsac_hotspot_12to24Hours_MarkerCount) + " hot spot";
									if ((rsac_hotspot_12Hours_MarkerCount + rsac_hotspot_12to24Hours_MarkerCount) != 1) {countHotSpots += "s"};
									
									document.getElementById("lblFire_USFS_RSAC_HotSpots").innerHTML = countHotSpots;							
									
								}
								
							}	// Next Hot Spot record...
						}
					});
					break;
					
					
					
				case "Fire_GEOMAC_ActivePerimeters":
					try
					{
						polygonsFire_GEOMAC_Incidents.setMap(null); 
					}
					catch (ex_GEOMAC)
					{
					}

 					polygonsFire_GEOMAC_Incidents = new google.maps.KmlLayer(urlFire_GEOMAC_ActivePerimeters, {preserveViewport: true}); 
					
					polygonsFire_GEOMAC_Incidents.setMap(mapCanvas); 
				    break;
					
					
					
				case "OtherLayers_Webcams_Volcano":
				
					document.getElementById('loadingMessage').style.visibility = 'visible';
					document.getElementById('loadingMessageText').innerHTML = "Loading Volcano Webcams layer...";
					window.setTimeout("this.clearMessages()", 1000)	// Display this message for 1 second max...


					// IMPORTANT:  First, remove all existing markers created...	
					for (var iX = 0; iX < markersOtherLayers_Webcams_Volcano.length; iX++) 
					{
						markersOtherLayers_Webcams_Volcano[iX].setMap(null);
					}

					markersOtherLayers_Webcams_Volcano = [];		// Clear array...


					this.downloadUrl(urlWebcams_Volcano, function(data_Webcams_Volcano)
					{
						var xml = this.parseXml(data_Webcams_Volcano);
						
						var webcam_Xml = xml.documentElement.getElementsByTagName("marker");

						var webcam_MarkerCount = 0;
			
						// Start adding the new markers...
						for (var iX = 0; iX < webcam_Xml.length; iX++) 
						{
							var webcam_pointLatLon = new google.maps.LatLng(parseFloat(webcam_Xml[iX].getAttribute("latitude")), parseFloat(webcam_Xml[iX].getAttribute("longitude")));

							var webcam_volcanoName = webcam_Xml[iX].getAttribute("volcanoName");
							
							var webcam_Width = Math.round(webcam_Xml[iX].getAttribute("imageWidth") * .66).toString();
							var webcam_Height = Math.round(webcam_Xml[iX].getAttribute("imageHeight") * .66).toString();
							
							var webcam_LinkUrl = webcam_Xml[iX].getAttribute("imageUrl");
							
							
							var webcam_Html =
								"<div id=\"infowindowHTML\">" +
								"<img src=\"images/misc/webcam.png\" width=\"30\" height=\"30\" alt=\"" + webcam_volcanoName.toUpperCase() + " webcam image unavailable \" />" +
								"<br />" +
								"<span style=\"font-size:15px;font-weight:bold;\">" + webcam_volcanoName + "</span>" +
								"<br /><br />" +
								"<a href=\"" + webcam_LinkUrl + "\" target=\"_blank\">" +
								"<img src=\"" + webcam_Xml[iX].getAttribute("imageUrl") + "\" " +
								"width=\"" + webcam_Width + "\" " +
								"height=\"" + webcam_Height + "\" />" +
								"</a>" +
								"<br /><br />" +
								"<span style=\"font-weight:bold;\">Volcano location:</span><br />" + webcam_Xml[iX].getAttribute("volcanoLocation") + 
								"<br /><br />" +
								"<span style=\"font-weight:bold;\">Webcam location:</span><br />" + webcam_Xml[iX].getAttribute("webcamLocation") + 
								"</div>";
								
							var webcam_MarkerTitle = "Webcam image of " + webcam_volcanoName.toUpperCase() + " volcano";


							var marker = this.createMarker(webcam_pointLatLon, iconWebcam, iconWebcam_Shadow, webcam_MarkerTitle, 400, webcam_Html);


							markersOtherLayers_Webcams_Volcano[webcam_MarkerCount] = marker;
							
							webcam_MarkerCount++;
							
							isEnabled_OtherLayers_Webcams_Volcano = true;
						}
					});
					break;




				case "History_NGDC_SignificantEvents_Earthquake":
				case "History_NGDC_SignificantEvents_Tsunami":
				case "History_NGDC_SignificantEvents_Volcano":
					var urlHistory_NGDC_SignificantEvents;
					
					switch (layerName)
					{
						case "History_NGDC_SignificantEvents_Earthquake":
							document.getElementById('lblHistory_NGDC_SignificantEvents_Earthquake_Loading').innerHTML = "&nbsp;Loading...&nbsp;";
							
							urlHistory_NGDC_SignificantEvents = urlNGDC_SignificantEvents_Earthquake;
							break;
							
						case "History_NGDC_SignificantEvents_Tsunami":
							document.getElementById('lblHistory_NGDC_SignificantEvents_Tsunami_Loading').innerHTML = "&nbsp;Loading...&nbsp;";
							
							urlHistory_NGDC_SignificantEvents = urlNGDC_SignificantEvents_Tsunami;
							break;
							
						case "History_NGDC_SignificantEvents_Volcano":
							document.getElementById('lblHistory_NGDC_SignificantEvents_Volcano_Loading').innerHTML = "&nbsp;Loading...&nbsp;";
							
							urlHistory_NGDC_SignificantEvents = urlNGDC_SignificantEvents_Volcano;
							break;
					}
					

					this.downloadUrl(urlHistory_NGDC_SignificantEvents, function(data_NGDC_SignificantEvents, responseCode)
					{
						// To ensure against HTTP errors that result in null or bad data,
						// always check status code is equal to 200 before processing the data
						if(responseCode != 200)
						{
							document.getElementById('errorMessage').innerHTML = "Error fetching NGDC Significant Events data, ResponseCode = " + responseCode1;
						}
						else
						{
							var xml = this.parseXml(data_NGDC_SignificantEvents);
							
							var ngdc_folder_xml = xml.documentElement.getElementsByTagName("Folder");


							for (var ngdc_TimePeriod = 1; ngdc_TimePeriod <= 5; ngdc_TimePeriod++)
							{
								var ngdc_FolderName_Xml = "";
								
								switch (ngdc_TimePeriod)
								{
									case 1:     // 5000 BC to 1499 AD
										ngdc_FolderName_Xml = "1499";
										break;
										
									case 2:     // 1500 to 1799 AD
										ngdc_FolderName_Xml = "1500";
										break;
										
									case 3:     // 1800 to 1899 AD
										ngdc_FolderName_Xml = "1800";
										break;
										
									case 4:     // 1900 to 1949 AD
										ngdc_FolderName_Xml = "1900";
										break;
										
									case 5:     // 1950 AD to Present
										ngdc_FolderName_Xml = "1950";
										break;
								}
								
// <Folder>
//   <name>2000 BC-1499 (122 events)</name>
//   <visibility>1</visibility>
//   <open>0</open>
// <Placemark>
// <visibility>1</visibility>
// <name>2000 BC (approx.)</name><Snippet><![CDATA[SYRIAN COASTS, SYRIA]]></Snippet>
// <description><![CDATA[<table><tr><th>Source Location:</th><td><nobr>SYRIAN COASTS</nobr></td></tr><tr><th>Source Country:</th><td><nobr>SYRIA</nobr></td></tr><tr><th>Cause of Tsunami:</th><td>Earthquake</td></tr>
// <tr><th>Validity of entry:</th><td>questionable tsunami</td></tr><tr><th>Number of deaths:</th><td>Many (~101 to 1000 deaths)</td></tr></table><hr><br><a href="http://www.ngdc.noaa.gov/nndc/struts/results?t=101650&s=9&d=228,91,95,93&nd=display&eq_0=1">Get more details from NGDC Natural Hazards Website</a><br><a href="http://www.ngdc.noaa.gov/HazardsKML/tsunamikml/runups/event0001runups.kml">Show 1 associated runups</a>]]></description>
// <styleUrl>#ts-orange</styleUrl>
// <Point>
// <coordinates>35.8,35.683,0</coordinates>
// </Point>
// <LookAt>
// <longitude>35.8</longitude>
// <latitude>35.683</latitude>
// <range>480000</range>
// <altitudeMode>clampToGround</altitudeMode>
// </LookAt>
// </Placemark>

								// Start processing the <Folder> elements in the raw XML data...
								for (var iX = 0; iX < ngdc_folder_xml.length; iX++) 
								{
									
									var ngdc_FolderName = ngdc_folder_xml[iX].getElementsByTagName("name")[0].firstChild.data;

									// Okay, we have a folder of data process...
									if (ngdc_FolderName.indexOf(ngdc_FolderName_Xml) >= 0)
									{

										var ngdc_placemarks_xml = ngdc_folder_xml[iX].getElementsByTagName("Placemark");

										var ngdc_MarkerCount = 0;

										// Start processing (but NOT displaying) the new markers from the <Placemark> elements in the raw XML data...
										for (var iY = 0; iY < ngdc_placemarks_xml.length; iY++) 
										{
											var ngdc_Date = ngdc_placemarks_xml[iY].getElementsByTagName("name")[0].firstChild.data;
											var ngdc_Location = ngdc_placemarks_xml[iY].getElementsByTagName("Snippet")[0].firstChild.data;
											var ngdc_Description = ngdc_placemarks_xml[iY].getElementsByTagName("description")[0].firstChild.data;
											var ngdc_ColorCode = ngdc_placemarks_xml[iY].getElementsByTagName("styleUrl")[0].firstChild.data;
											var ngdc_Latitude = ngdc_placemarks_xml[iY].getElementsByTagName("latitude")[0].firstChild.data;
											var ngdc_Longitude = ngdc_placemarks_xml[iY].getElementsByTagName("longitude")[0].firstChild.data;
											
											
											
											// DESCRIPTION: Some cleanup and formatting improvements to the raw HTML...
											
											// This is for the Volcano Name or anything else with an <h2> tag...
											ngdc_Description = ngdc_Description.replace("<h2>", "<span style=\"font-size:15px; font-weight:bold;\">");
											ngdc_Description = ngdc_Description.replace("</h2>", "</span><br /><br />");

											// This is for the "More Information" link...
											ngdc_Description = ngdc_Description.replace("<hr><br>", "<br /><hr />");
											
											var ngdc_Work =
												"<span style=\"font-weight:bold;\">More information:</span>" +
												"<br /><br />" +
												"<img src=\"images/logo/small/NGDC.jpg\" align=\"absmiddle\" />&nbsp;&nbsp;" +
												"<a target=\"_blank\" href=";
											ngdc_Description = ngdc_Description.replace("<a href=", ngdc_Work);

											ngdc_Description = ngdc_Description.replace("Get more details from NGDC Natural Hazards Website", "NGDC Natural Hazards");

											// This is for the Tsunami runups KML link...
											ngdc_Description = ngdc_Description.replace("</a><br><a href=", "</a><br /><br /><a target=\"_blank\" href=");

											
											
											// Process the coordinates...
											ngdc_LatLon = new google.maps.LatLng(parseFloat(ngdc_Latitude), parseFloat(ngdc_Longitude));


											// Set the event type value...
											switch (layerName)
											{
												case "History_NGDC_SignificantEvents_Earthquake":
													ngdc_EventType = "Earthquake";
													break;
													
												case "History_NGDC_SignificantEvents_Tsunami":
													ngdc_EventType = "Tsunami";
													break;
													
												case "History_NGDC_SignificantEvents_Volcano":
													ngdc_EventType = "Volcano";
													break;
											}



											var ngdc_IconFileUrl;
											var ngdc_Icon;
											var ngdc_ImportanceLevel;

											if (ngdc_ColorCode.indexOf("red") >= 0)
											{
												ngdc_ImportanceLevel = 790;
												
												switch (layerName)
												{
													case "History_NGDC_SignificantEvents_Earthquake":
														ngdc_IconFileUrl = iconEarthquake_NGDC_SignificantEvents_Red_Url;
														ngdc_Icon = iconEarthquake_NGDC_SignificantEvents_Red;
														break;
														
													case "History_NGDC_SignificantEvents_Tsunami":
														ngdc_IconFileUrl = iconTsunami_NGDC_SignificantEvents_Red_Url;
														ngdc_Icon = iconTsunami_NGDC_SignificantEvents_Red;
														break;
														
													case "History_NGDC_SignificantEvents_Volcano":
														ngdc_IconFileUrl = iconVolcano_NGDC_SignificantEvents_Red_Url;
														ngdc_Icon = iconVolcano_NGDC_SignificantEvents_Red;
														break;
												}
											}
					
											else if (ngdc_ColorCode.indexOf("orange") >= 0)
											{
												ngdc_ImportanceLevel = 780;
												
												switch (layerName)
												{
													case "History_NGDC_SignificantEvents_Earthquake":
														ngdc_IconFileUrl = iconEarthquake_NGDC_SignificantEvents_Orange_Url;
														ngdc_Icon = iconEarthquake_NGDC_SignificantEvents_Orange;
														break;
														
													case "History_NGDC_SignificantEvents_Tsunami":
														ngdc_IconFileUrl = iconTsunami_NGDC_SignificantEvents_Orange_Url;
														ngdc_Icon = iconTsunami_NGDC_SignificantEvents_Orange;
														break;
														
													case "History_NGDC_SignificantEvents_Volcano":
														ngdc_IconFileUrl = iconVolcano_NGDC_SignificantEvents_Orange_Url;
														ngdc_Icon = iconVolcano_NGDC_SignificantEvents_Orange;
														break;
												}
											}
											
											else if (ngdc_ColorCode.indexOf("yellow") >= 0)
											{
												ngdc_ImportanceLevel = 770;
												
												switch (layerName)
												{
													case "History_NGDC_SignificantEvents_Earthquake":
														ngdc_IconFileUrl = iconEarthquake_NGDC_SignificantEvents_Yellow_Url;
														ngdc_Icon = iconEarthquake_NGDC_SignificantEvents_Yellow;
														break;
														
													case "History_NGDC_SignificantEvents_Tsunami":
														ngdc_IconFileUrl = iconTsunami_NGDC_SignificantEvents_Yellow_Url;
														ngdc_Icon = iconTsunami_NGDC_SignificantEvents_Yellow;
														break;
														
													case "History_NGDC_SignificantEvents_Volcano":
														ngdc_IconFileUrl = iconVolcano_NGDC_SignificantEvents_Yellow_Url;
														ngdc_Icon = iconVolcano_NGDC_SignificantEvents_Yellow;
														break;
												}
											}
											
											else if (ngdc_ColorCode.indexOf("blue") >= 0)
											{
												ngdc_ImportanceLevel = 760;
												
												switch (layerName)
												{
													case "History_NGDC_SignificantEvents_Earthquake":
														ngdc_IconFileUrl = iconEarthquake_NGDC_SignificantEvents_Blue_Url;
														ngdc_Icon = iconEarthquake_NGDC_SignificantEvents_Blue;
														break;
														
													case "History_NGDC_SignificantEvents_Tsunami":
														ngdc_IconFileUrl = iconTsunami_NGDC_SignificantEvents_Blue_Url;
														ngdc_Icon = iconTsunami_NGDC_SignificantEvents_Blue;
														break;
														
													case "History_NGDC_SignificantEvents_Volcano":
														ngdc_IconFileUrl = iconVolcano_NGDC_SignificantEvents_Blue_Url;
														ngdc_Icon = iconVolcano_NGDC_SignificantEvents_Blue;
														break;
												}
											}
					
											else
											{
												ngdc_ImportanceLevel = 750;
												
												switch (layerName)
												{
													case "History_NGDC_SignificantEvents_Earthquake":
														ngdc_IconFileUrl = iconEarthquake_NGDC_SignificantEvents_Green_Url;
														ngdc_Icon = iconEarthquake_NGDC_SignificantEvents_Green;
														break;
														
													case "History_NGDC_SignificantEvents_Tsunami":
														ngdc_IconFileUrl = iconTsunami_NGDC_SignificantEvents_Green_Url;
														ngdc_Icon = iconTsunami_NGDC_SignificantEvents_Green;
														break;
														
													case "History_NGDC_SignificantEvents_Volcano":
														ngdc_IconFileUrl = iconVolcano_NGDC_SignificantEvents_Green_Url;
														ngdc_Icon = iconVolcano_NGDC_SignificantEvents_Green;
														break;
												}
											}
											

											var ngdc_Html =
												"<div id=\"infowindowHTML\">" +
												"<img src=\"" + ngdc_IconFileUrl + "\" width=\"24\" height=\"24\" align=\"abstop\" /><br />" +
												"<span style=\"font-size:15px; font-weight:bold;\">" + ngdc_Location + "</span>" +
												"<br /><br /><br />" +
												"<span style=\"font-weight:bold;\">Date: </span>" + ngdc_Date +
												"<br /><br />" +
												ngdc_Description +
												"</div>";

		
											var ngdc_MarkerTitle = "<strong>" + ngdc_EventType + "</strong><br />" + 
																   ngdc_Location + "<br />" + 
																   ngdc_Date;
		
		
											var marker = this.createMarker(ngdc_LatLon, ngdc_Icon, null, ngdc_MarkerTitle, ngdc_ImportanceLevel, ngdc_Html);
				
				
											var labelName_Html = "";
											
											var doAddToMarkerCluster = false;
											
											switch (ngdc_TimePeriod)
											{
												case 1:     // 5000 BC to 1499 AD
													switch (layerName)
													{
														case "History_NGDC_SignificantEvents_Earthquake":
															markersHistory_Earthquake_5000BCto1499AD.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_5000BCto1499AD_Earthquake";
															break;
															
														case "History_NGDC_SignificantEvents_Tsunami":
															markersHistory_Tsunami_5000BCto1499AD.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_5000BCto1499AD_Tsunami";
															break;
															
														case "History_NGDC_SignificantEvents_Volcano":
															markersHistory_Volcano_5000BCto1499AD.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_5000BCto1499AD_Volcano";
															break;
													}
													
													doAddToMarkerCluster = (document.myForm.checkboxHistory_NGDC_SignificantEvents_5000BCto1499AD.checked);
													break;
													
													
												case 2:     // 1500 to 1799 AD
													switch (layerName)
													{
														case "History_NGDC_SignificantEvents_Earthquake":
															markersHistory_Earthquake_1500to1799AD.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_1500to1799AD_Earthquake";
															break;
															
														case "History_NGDC_SignificantEvents_Tsunami":
															markersHistory_Tsunami_1500to1799AD.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_1500to1799AD_Tsunami";
															break;
															
														case "History_NGDC_SignificantEvents_Volcano":
															markersHistory_Volcano_1500to1799AD.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_1500to1799AD_Volcano";
															break;
													}
													
													doAddToMarkerCluster = (document.myForm.checkboxHistory_NGDC_SignificantEvents_1500to1799AD.checked);
													break;
													
													
												case 3:     // 1800 to 1899 AD
													switch (layerName)
													{
														case "History_NGDC_SignificantEvents_Earthquake":
															markersHistory_Earthquake_1800to1899AD.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_1800to1899AD_Earthquake";
															break;
															
														case "History_NGDC_SignificantEvents_Tsunami":
															markersHistory_Tsunami_1800to1899AD.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_1800to1899AD_Tsunami";
															break;
															
														case "History_NGDC_SignificantEvents_Volcano":
															markersHistory_Volcano_1800to1899AD.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_1800to1899AD_Volcano";
															break;
													}
													
													doAddToMarkerCluster = (document.myForm.checkboxHistory_NGDC_SignificantEvents_1800to1899AD.checked);
													break;
													
													
												case 4:     // 1900 to 1949 AD
													switch (layerName)
													{
														case "History_NGDC_SignificantEvents_Earthquake":
															markersHistory_Earthquake_1900to1949AD.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_1900to1949AD_Earthquake";
															break;
															
														case "History_NGDC_SignificantEvents_Tsunami":
															markersHistory_Tsunami_1900to1949AD.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_1900to1949AD_Tsunami";
															break;
															
														case "History_NGDC_SignificantEvents_Volcano":
															markersHistory_Volcano_1900to1949AD.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_1900to1949AD_Volcano";
															break;
													}
													
													doAddToMarkerCluster = (document.myForm.checkboxHistory_NGDC_SignificantEvents_1900to1949AD.checked);
													break;
													
													
												case 5:     // 1950 AD to Present
													switch (layerName)
													{
														case "History_NGDC_SignificantEvents_Earthquake":
															markersHistory_Earthquake_1950ADtoPresent.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_1950ADtoPresent_Earthquake";
															break;
															
														case "History_NGDC_SignificantEvents_Tsunami":
															markersHistory_Tsunami_1950ADtoPresent.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_1950ADtoPresent_Tsunami";
															break;
															
														case "History_NGDC_SignificantEvents_Volcano":
															markersHistory_Volcano_1950ADtoPresent.push(marker);
															
															labelName_Html = "lblHistory_NGDC_SignificantEvents_1950ADtoPresent_Volcano";
															break;
													}
													
													doAddToMarkerCluster = (document.myForm.checkboxHistory_NGDC_SignificantEvents_1950ADtoPresent.checked);
													break;
											}


                                            if (doAddToMarkerCluster)
                                            {
                   	                            markerclusterHistory.addMarker(marker);
                   	                        }

                   	                        
											ngdc_MarkerCount++;
											

											var countSignificantEvents = ngdc_MarkerCount + " event";
											if (ngdc_MarkerCount != 1) {countSignificantEvents += "s"};
											
											document.getElementById(labelName_Html).innerHTML = countSignificantEvents;							

										}	// Go process the next PLACEMARK...
									}
									
								}	// Go process the next FOLDER...
								
							}	// Go process next TIME PERIOD...
							
						}
					
					switch (layerName)
					{
						case "History_NGDC_SignificantEvents_Earthquake":
							document.getElementById('lblHistory_NGDC_SignificantEvents_Earthquake_Loading').innerHTML = "";
							break;
							
						case "History_NGDC_SignificantEvents_Tsunami":
							document.getElementById('lblHistory_NGDC_SignificantEvents_Tsunami_Loading').innerHTML = "";
							break;
							
						case "History_NGDC_SignificantEvents_Volcano":
							document.getElementById('lblHistory_NGDC_SignificantEvents_Volcano_Loading').innerHTML = "";
							break;
					}
				});
                break;
				
				
					
                case "OtherLayers_News_VolcanoLive":
					document.getElementById('loadingMessage').style.visibility = 'visible';
					document.getElementById('loadingMessageText').innerHTML = "Loading Volcano Live layer...";
					window.setTimeout("this.clearMessages()", 1000)	// Display this message for 1 second max...

					var vlReports_Location = "";
					
					this.downloadUrl(urlVolcanoLive, function(data, responseCode)
					{
						// To ensure against HTTP errors that result in null or bad data,
						// always check status code is equal to 200 before processing the data
						if(responseCode != 200)
						{
							document.getElementById('errorMessage').innerHTML = "Error fetching Volcano Live data, ResponseCode = " + responseCode;
						}
						else
						{

							// IMPORTANT:  First, remove all existing markers created...	
							for (var iX = 0; iX < markersOtherLayers_News_VolcanoLive.length; iX++) 
							{
								markersOtherLayers_News_VolcanoLive[iX].setMap(null);
							}

							markersOtherLayers_News_VolcanoLive = [];		// Clear array...
							
	
							var xml = this.parseXml(data);
							
							var vl_Xml = xml.documentElement.getElementsByTagName("item");

							var vl_MarkerCount = 0;

							// Start adding the new markers...
							for (var iX = 0; iX < vl_Xml.length; iX++) 
							{
								var vl_DateTime = "";
								var vl_Title = "";
								var vl_Latitude = "";
								var vl_Longitude = "";
								var vl_Description = "";
								var vl_InfoURL = "";

								var vl_ParsedDataOK = true;
								
								
								try
								{
									if (detectBrowser.browser == "Explorer")
									{
										vl_DateTime = vl_Xml[iX].getElementsByTagName("pubDate")[0].firstChild.data;
										vl_Title = vl_Xml[iX].getElementsByTagName("title")[0].firstChild.data;
										vl_Description = vl_Xml[iX].getElementsByTagName("content:encoded")[0].firstChild.data;
										vl_InfoURL = vl_Xml[iX].getElementsByTagName("link")[0].firstChild.data;
										vl_Latitude = vl_Xml[iX].getElementsByTagName("geo:lat")[0].firstChild.data;
										vl_Longitude = vl_Xml[iX].getElementsByTagName("geo:long")[0].firstChild.data;
									}
									else	// Other browsers: Firefox, Chrome, Safari, Opera, etc...
									{
										var itemTags = vl_Xml[iX].getElementsByTagName("*");
										
										for (var iY = 0; iY < itemTags.length; iY++)
										{
											var itemTag = itemTags[iY].nodeName;
											
											switch (itemTag)
											{
												case "pubDate":
													vl_DateTime = itemTags[iY].firstChild.data;
													break;
													
												case "title":
													vl_Title = itemTags[iY].firstChild.data;
													break;
													
												case "content:encoded":
													vl_Description = itemTags[iY].firstChild.data;
													break;
													
												case "link":
													vl_InfoURL = itemTags[iY].firstChild.data;
													break;
													
												case "geo:lat":
													vl_Latitude = itemTags[iY].firstChild.data;
													break;
													
												case "geo:long":
													vl_Longitude = itemTags[iY].firstChild.data;
													break;
											}
										}
									}
								}
								
								catch (ex_VolcanoLive)
								{
									vl_ParsedDataOK = false;
								}


									
								if (vl_ParsedDataOK & vlReports_Location.indexOf(vl_Latitude + "~" + vl_Longitude) == -1 &
									vl_DateTime != "" & vl_Latitude != "" & vl_Longitude != "")
								{
									// Prevents older reports of same location from overwriting newer reports...
									vlReports_Location += vl_Latitude + "~" + vl_Longitude + "|";

									vl_DateTime = this.subString_ExtractPiece(vl_DateTime, ", ", " GMT", true);
									dtValue = new Date(vl_DateTime);
									dtValue.setHours(dtValue.getHours() + (localOffset_Hours));
									vl_DateTime = this.formatLocalDateTimeString(dtValue, false);
									
									

									vl_Title = vl_Title.replace(" – John Seach", "");
								
									
									vl_Description = vl_Description.replace(/<a href=/g, "<br /><a target=\"_blank\" href=");
									
									
									var vl_LatLon = new google.maps.LatLng(parseFloat(vl_Latitude), parseFloat(vl_Longitude));
		
		
									var vl_IconFileUrl = iconNews_Url;
									var vl_Icon = iconNews;
									var vl_IconShadow = iconNews_Shadow;
		
		
									var vl_Html =
										"<div id=\"infowindowHTML\">" +
										"<img src=\"" + vl_IconFileUrl + "\" width=\"28\" height=\"28\" /><br />" +
										"<span style=\"font-weight:bold;\">" + vl_Title + "</span>" +
										"<br /><br />" +
										vl_DateTime +
										"<br />" +
										"<div style=\"text-align:left\">" + vl_Description + "</div>" +
										"<hr /><span style=\"font-weight:bold;\">More information:</span><br /><br />" +
										"<a href=\"http://volcanolive.com/\" target=\"_blank\">Volcano Live - John Search</a>";
										"</div>";
										
										
									var vl_MarkerTitle = "<strong>Volcano Live - John Seach</strong><br />" + 
														 vl_Title + "<br />" +
														 vl_DateTime;
														 
									
									var marker = this.createMarker(vl_LatLon, vl_Icon, vl_IconShadow, vl_MarkerTitle, 110, vl_Html);
		
		
									markersOtherLayers_News_VolcanoLive[vl_MarkerCount] = marker;
									
									vl_MarkerCount++;
								}
							}
						}
					});
					break;
				
			}
		}

		catch (ex_fetchData)
		{
			document.getElementById('errorMessage').innerHTML = "function 'fetchData' -- Error: " + ex_fetchData.description;
		}
	}



	function fetchData_Tsunami_PTWC(urlRSS)
	{
		
		//
		// *** PART 2: Pacific Tsunami Warning Center (PTWC) ***
		//
		try
		{
			var tsu_MinutesElapsed_MostRecent = 999999999;
			var tsu_LatLon_MostRecent;
			var tsu_Icon_MostRecent;
			var tsu_IconShadow_MostRecent;
			var tsu_MarkerTitle_MostRecent = "";
			var tsu_ImportanceLevel_MostRecent;
			var tsu_Html_MostRecent;
			var tsu_marker_MostRecent;
			

			// Begin processing NOAA - PTWC Tsunami data...
			this.downloadUrl(urlRSS, function(data_PTWC_TsunamiEventsList, responseCode)
			{
				// To ensure against HTTP errors that result in null or bad data,
				// always check status code is equal to 200 before processing the data
				if(responseCode != 200)
				{
					document.getElementById('errorMessage').innerHTML = "Error fetching NOAA - PTWC Tsunami data, ResponseCode = " + responseCode;
				}
				else
				{

					var xml = this.parseXml(data_PTWC_TsunamiEventsList);
					
					var tsu_Xml = xml.documentElement.getElementsByTagName("item");
						

					// Start adding the new markers...
					for (var iX = 0; iX < tsu_Xml.length; iX++) 
					{
						var tsu_Title;
						var tsu_DateTime;
						var tsu_InfoURL;
						var tsu_OriginLocation;
						var tsu_Description;
						var tsu_Latitude;
						var tsu_Longitude;
	
						if (detectBrowser.browser == "Explorer")
						{
							tsu_Title = tsu_Xml[iX].getElementsByTagName("title")[0].firstChild.data;
							tsu_InfoURL = tsu_Xml[iX].getElementsByTagName("link")[0].firstChild.data;
							tsu_OriginLocation = tsu_Xml[iX].getElementsByTagName("georss:featurename")[0].firstChild.data;
							tsu_Latitude = tsu_Xml[iX].getElementsByTagName("geo:lat")[0].firstChild.data;
							tsu_Longitude = tsu_Xml[iX].getElementsByTagName("geo:long")[0].firstChild.data;
							tsu_Description = tsu_Xml[iX].getElementsByTagName("description")[0].firstChild.data;
						}
						else	// Other browsers: Firefox, Chrome, Safari, Opera, etc...
						{
							var itemTags = tsu_Xml[iX].getElementsByTagName("*");
							
							for (var iY = 0; iY < itemTags.length; iY++)
							{
								var itemTag = itemTags[iY].nodeName;
								
								switch (itemTag)
								{
									case "title":
										tsu_Title = itemTags[iY].firstChild.data;
										break;
										
									case "link":
										tsu_InfoURL = itemTags[iY].firstChild.data;
										break;
										
									case "georss:featurename":
										tsu_OriginLocation = itemTags[iY].firstChild.data;
										break;
										
									case "geo:lat":
										tsu_Latitude = itemTags[iY].firstChild.data;
										break;
										
									case "geo:long":
										tsu_Longitude = itemTags[iY].firstChild.data;
										break;
										
									case "description":
										tsu_Description = itemTags[iY].firstChild.data;
										break;
								}
							}
						}

	
						// Special handling for TSUNAMI layer: set a small Latitude/Longitude offset so multiple simultaneously issued Tsunami alerts
						// that reference the exact same location (e.g. with a strong/major/great Earthquake) will be offset slightly so the markers
						// can be accessible by the user...
						var tsu_LatLon = new google.maps.LatLng(parseFloat(tsu_Latitude) + this.randomOffsetCoordinateSlightly(), 
																parseFloat(tsu_Longitude) + this.randomOffsetCoordinateSlightly());
	
	
						tsu_Title = tsu_Title.toUpperCase();
						
	
						// A little cleanup...
						tsu_Description = this.subString_ExtractPiece(tsu_Description, "<pre>\n", "</pre>", true);
						
						tsu_Description = "<br />" + tsu_Description;
                        tsu_Description = tsu_Description.replace(/\n/g, "<br />");
                        

						tsu_OriginLocation = this.convertToMixedCase(tsu_OriginLocation);
	


						tsu_DateTime = this.subString_ExtractPiece(tsu_InfoURL, "id=", "", true);
						tsu_DateTime = this.subString_ExtractPiece(tsu_DateTime, ".", "", true);

						var tsu_DatePart = tsu_DateTime.substr(0, 10).split('.');
						
						var tsu_TimePart = tsu_DateTime.substr(11, 6);
	
						
						var dtValue = new Date(parseInt(tsu_DatePart[0], 10), parseInt(tsu_DatePart[1], 10) - 1, parseInt(tsu_DatePart[2], 10), 
											   parseInt(tsu_TimePart.substr(0, 2), 10), parseInt(tsu_TimePart.substr(2, 2), 10), parseInt(tsu_TimePart.substr(4, 2), 10), 0);
	
						dtValue.setHours(dtValue.getHours() + (localOffset_Hours));
	
	
						tsu_DateTime = this.formatLocalDateTimeString(dtValue, true);
						
	
						var milliseconds_dtEvent = dtValue.getTime();
						
						// Time difference in milliseconds...
						var millisecondsElapsed = milliseconds_dtNow - milliseconds_dtEvent;
						
						// Time difference in seconds...
						var secondsElasped = Math.round(millisecondsElapsed / 1000)
	
						// Time difference in minutes...
						var minutesElapsed = Math.round(secondsElasped / 60);


						// Skip processing anything older than 24 hours...
						var minutesElapsedThreshhold = 1440;
						
						// Skip processing anything older than 1 week...
						if (document.myForm.radioTsunami_Age[1].checked)
						{
							minutesElapsedThreshhold = 10080;
						}


						// Don't process those PTWC Tsunami reports if the AGE has exceeded the defined threshhold...
						if (minutesElapsed < minutesElapsedThreshhold)
						{
							var tsu_IconFileUrl;
							var tsu_Icon;
							var tsu_IconShadow;
							var tsu_ImportanceLevel;

							if (tsu_Title.indexOf("WARNING") >= 0)
							{
								tsu_Title = "Tsunami WARNING" + (tsu_Title.indexOf("CANCEL") >= 0 ? " (Cancelled)" : "");
								tsu_IconFileUrl = iconTsunami_Warning_Url;
								tsu_Icon = iconTsunami_Warning;
								tsu_IconShadow = iconTsunami_WarningWatch_Shadow;
								tsu_ImportanceLevel = 200;
							}
	
							else if (tsu_Title.indexOf("WATCH") >= 0)
							{
								tsu_Title = "Tsunami WATCH" + (tsu_Title.indexOf("CANCEL") >= 0 ? " (Cancelled)" : "");
								tsu_IconFileUrl = iconTsunami_Watch_Url;
								tsu_Icon = iconTsunami_Watch;
								tsu_IconShadow = iconTsunami_WarningWatch_Shadow;
								tsu_ImportanceLevel = 100;
							}
							
							else if (tsu_Title.indexOf("ADVISORY") >= 0)
							{
								tsu_Title = "Tsunami ADVISORY" + (tsu_Title.indexOf("CANCEL") >= 0 ? " (Cancelled)" : "");
								tsu_IconFileUrl = iconTsunami_Advisory_Url;
								tsu_Icon = iconTsunami_Advisory;
								tsu_IconShadow = iconTsunami_Advisory_Shadow;
								tsu_ImportanceLevel = 90;
							}
							
							else
							{
								tsu_Title = "Tsunami Information Statement" + (tsu_Title.indexOf("CANCEL") >= 0 ? " (Cancelled)" : "");
								tsu_IconFileUrl = iconTsunami_InfoStatement_Url;
								tsu_Icon = iconTsunami_InfoStatement;
								tsu_IconShadow = iconTsunami_InfoStatement_Shadow;
								tsu_ImportanceLevel = 50;
							}


	
							// Process the Info URL to obtain the EVENT ID value...
							var sWork = this.subString_ExtractPiece(tsu_InfoURL, "id=", "", true);
	
							var oEventID = sWork.split('.');
	
							// Get the EVENT ID value...
							var tsu_EventID = oEventID[0] + "." + oEventID[1] + "." + oEventID[2] + "." + oEventID[3] + "." + oEventID[4];
	
	
							
							var tsu_AffectedRegion = "";
							var tsu_RegionID = "";
							
							if (tsu_EventID.indexOf("pacific") >= 0)
							{
								tsu_AffectedRegion = "Pacific Ocean";
								tsu_RegionID = "pacific";
							}
							else if (tsu_EventID.indexOf("hawaii") >= 0)
							{
								tsu_AffectedRegion = "Hawaiian Islands";
								tsu_RegionID = "hawaii";
							}
							else if (tsu_EventID.indexOf("indian") >= 0)
							{
								tsu_AffectedRegion = "Indian Ocean";
								tsu_RegionID = "indian";
							}
							else if (tsu_EventID.indexOf("caribe") >= 0)
							{
								tsu_AffectedRegion = "Caribbean Sea";
								tsu_RegionID = "caribe";
							}
	
	
							// Get the Affected Region image to display as a thumbnail...
							var tsu_AffectedRegion_Image = urlNOAA_PTWC_Tsunami_EventOrigin_WideView_Image;
							tsu_AffectedRegion_Image = tsu_AffectedRegion_Image.replace("<REGION_ID>", tsu_RegionID);
	
	
							var tsu_Html =
								"<div id=\"infowindowHTML\">" +
								"<img src=\"" + tsu_IconFileUrl + "\" width=\"32\" height=\"32\" />" +
								"<br />" +
								"<span style=\"font-size:15px; font-weight:bold;\">" + tsu_Title + "</span>" +
								"<br />" +
								"<span style=\"font-weight:bold;\">" + tsu_AffectedRegion + "</span>" +
								"<br /><br />" +
								"<a href=\"" + tsu_AffectedRegion_Image + "\" target=\"_blank\">" +
								"<img src=\"" + tsu_AffectedRegion_Image + "\" width=\"210\" height=\"165\" />" +
								"</a>" +
								"<br /><br />" +
								"<span style=\"font-weight:bold;\">Event ID: </span>" + tsu_EventID +
								"<br /><br />" +
								"<span style=\"font-weight:bold;\">Event Origin:</span><br />" + tsu_OriginLocation +
								"<br /><br />" +
                                "<div style=\"font-size:10px; text-align:left\">" + tsu_Description + "</div>" +
								"<br />" +
								"<span style=\"font-weight:bold;\">Issued: </span>" + tsu_DateTime +
								"<br /><br />" +
                                "<hr /><span style=\"font-weight:bold;\">More information:</span><br />" +
								"<br />" +
								"<img src=\"images/logo/small/NOAA.jpg\" align=\"absmiddle\" />&nbsp;" +
								"<a href=\"" + tsu_InfoURL + "\" target=\"_blank\">NOAA - Pacific Tsunami Warning Center</a>" +
								"</div>";
								
	
							var tsu_MarkerTitle = "<strong>" + tsu_Title + "</strong><br />" + 
												  "Affected Region: " + tsu_AffectedRegion + "<br />" + 
												  "Event Origin: " + tsu_OriginLocation + "<br />" + 
												  tsu_DateTime;
	

							// Skip adding a marker here if we're only going to show the "most recent" Tsunami report...
							if (!document.myForm.checkboxTsunami_MostRecentReportsOnly.checked)
							{
								var marker = this.createMarker(tsu_LatLon, tsu_Icon, tsu_IconShadow, tsu_MarkerTitle, tsu_ImportanceLevel, tsu_Html);
		
								markersTsunami[tsu_MarkerCount] = marker;
								
								if (!document.myForm.checkboxTsunami.checked)
								{
									markersTsunami[tsu_MarkerCount].setVisible(false);
								}
								else
								{
									isEnabled_Tsunami = true;
								}
	
								tsu_MarkerCount++;
								tsu_Count_TsunamiReports++
							}
							

							if (minutesElapsed < tsu_MinutesElapsed_MostRecent)
							{
								tsu_LatLon_MostRecent = tsu_LatLon;
								tsu_Icon_MostRecent = tsu_Icon;
								tsu_IconShadow_MostRecent = tsu_IconShadow;
								tsu_MarkerTitle_MostRecent = tsu_MarkerTitle;
								tsu_ImportanceLevel_MostRecent = tsu_ImportanceLevel + 10;
								tsu_Html_MostRecent = tsu_Html;
								
								tsu_MinutesElapsed_MostRecent = minutesElapsed;
							}
						}
						
					}	// Next tsunami report for the PTWC region currently being processed...
				}
				


				// Process the "most recent" marker...
				if (tsu_MarkerTitle_MostRecent != "")
				{
					tsu_marker_MostRecent = this.createMarker(tsu_LatLon_MostRecent, tsu_Icon_MostRecent, tsu_IconShadow_MostRecent, 
															  tsu_MarkerTitle_MostRecent, tsu_ImportanceLevel_MostRecent, tsu_Html_MostRecent);
	
					markersTsunami[tsu_MarkerCount] = tsu_marker_MostRecent;
					
					if (!document.myForm.checkboxTsunami.checked)
					{
						markersTsunami[tsu_MarkerCount].setVisible(false);
					}
					else
					{
						isEnabled_Tsunami = true;
					}
	
					tsu_MarkerCount++;
					
					if (document.myForm.checkboxTsunami_MostRecentReportsOnly.checked)
					{
						tsu_Count_TsunamiReports++
					}


                    // Sort the "Most Recent" Tsunamis list by using the Minutes Elapsed value to place the most recent ones higher on the list...
                    listTsunami_MostRecent_Minutes.push(tsu_MinutesElapsed_MostRecent);
                    listTsunami_MostRecent_Minutes.sortNum();
		            
                    //tsu_MarkerTitle_MostRecent = "<strong>" +  tsu_MarkerTitle_MostRecent.replace("\n", "</strong><br />&nbsp;&nbsp;");
					//tsu_MarkerTitle_MostRecent = tsu_MarkerTitle_MostRecent.replace(/\n/g, "<br />&nbsp;&nbsp;");
												
					listTsunami_MostRecent_Working += 
						tsu_MinutesElapsed_MostRecent +
						tsu_MarkerTitle_MostRecent +
						"<a href=\"javascript:onLinkClicked_DisplayMarkerInfoWindow('Tsunami', " + tsu_MarkerCount + ")\"><em>&nbsp;&nbsp;&nbsp;&nbsp;More info...</em><br /></a>|";

			        listTsunami_MostRecent = "";
			        
	                for (var iX = 0; iX < listTsunami_MostRecent_Minutes.length; iX++) 
	                {
			            listTsunami_MostRecent += this.subString_ExtractPiece(listTsunami_MostRecent_Working, listTsunami_MostRecent_Minutes[iX].toString(), "|", true);
	                }
			    
                    if (document.myForm.checkboxTsunami.checked)
                    {
                        document.getElementById('textTsunami_MostRecent').innerHTML = listTsunami_MostRecent;
                    }

	
					tsu_marker_MostRecent = this.createMarker(tsu_LatLon_MostRecent, iconMostRecent_Star, null, 
															  tsu_MarkerTitle_MostRecent, tsu_ImportanceLevel_MostRecent + 10, tsu_Html_MostRecent);
	
					markersTsunami[tsu_MarkerCount] = tsu_marker_MostRecent;
					
					if (!document.myForm.checkboxTsunami.checked)
					{
						markersTsunami[tsu_MarkerCount].setVisible(false);
					}
	
					tsu_MarkerCount++;
				}


				
				var countTsunamiEvents = "Tsunamis - " + tsu_Count_TsunamiReports + " alert";
				if (tsu_Count_TsunamiReports != 1) {countTsunamiEvents += "s"};
				
				document.getElementById("lblTsunami").innerHTML = countTsunamiEvents;	
				
			});
		}
		
		
		catch (ex_fetchData_Tsunami_PTWC)
		{
			document.getElementById('errorMessage').innerHTML = "function 'fetchData_Tsunami_PTWC' -- Error: " + ex_fetchData_Tsunami_PTWC.description;
		}

	}



    function fetchData_TropicalCyclone_Region(tc_RegionID)
    {
        try
        {	
            // Begin processing NOAA - WCATWC Tsunami data...
            this.downloadUrl(urlWeatherUnderground_TropicalCyclone_RSS.replace("<REGION_ID>", tc_RegionID), function(data_WU_TropicalCyclone, responseCode1)
            {
	            // To ensure against HTTP errors that result in null or bad data,
	            // always check status code is equal to 200 before processing the data
	            if(responseCode1 != 200)
	            {
		            document.getElementById('errorMessage').innerHTML = "Error fetching WEATHER UNDERGROUND Tropical Cyclone data, ResponseCode = " + responseCode1;
	            }
	            else
	            {
		            // A little cleanup to make the RSS feed data work nicely with all browsers; we only need to work with the raw data, don't care about the HTML formatting...
		            var tagDescriptionStart = "<![CDATA[";
		            var tagDescriptionEnd = "]]>";
            		
		            var posDescriptionTagStart = 0;
		            var posDescriptionTagEnd = 0;
            		
		            var tc_descriptionBlock = "";

		            while (true)
		            {
			            posDescriptionTagStart = data_WU_TropicalCyclone.indexOf(tagDescriptionStart, posDescriptionTagStart);

			            if (posDescriptionTagStart == -1) break;
            			
			            posDescriptionTagEnd = data_WU_TropicalCyclone.indexOf(tagDescriptionEnd, posDescriptionTagStart);
            			
			            var dataDescriptionBlock = data_WU_TropicalCyclone.substr(posDescriptionTagStart, posDescriptionTagEnd - posDescriptionTagStart);

			            var dataDescriptionBlock_StormID = this.subString_ExtractPiece(dataDescriptionBlock, "/tracking/", ".html", true);

			            if (dataDescriptionBlock_StormID != "")
			            {
			                dataDescriptionBlock += tagDescriptionEnd;
            			    
				            tc_descriptionBlock += dataDescriptionBlock_StormID + "|" + dataDescriptionBlock;
			            }
            			
			            data_WU_TropicalCyclone = data_WU_TropicalCyclone.replace(dataDescriptionBlock, "");
		            };


		            var xml = this.parseXml(data_WU_TropicalCyclone);
            		
		            var tc_Xml = xml.documentElement.getElementsByTagName("item");

            //<?xml version="1.0" encoding="UTF-8"?>
            //<rss version="2.0"><channel> 
            //	<title>Tropical Advisories from Weather Underground</title>
            //	<link>http://www.wunderground.com/</link>
            //	<description>Weather Underground Current Southern Pacific Tropical Advisories</description>
            //	<language>EN</language>
            //        <generator>WU-RSS</generator>
            //        <webMaster>aaron@wunderground.com</webMaster>
            //	<category>weather</category>
            //        <image>
            //                <url>http://icons.wunderground.com/graphics/smash/wunderTransparent.gif</url>
            //                <link>http://www.wunderground.com/</link>
            //                <title>Weather Underground</title> 
            //        </image>
            //        <pubDate>Fri, 15 Jan 2010 23:00:00 GMT</pubDate>
            //        <lastBuildDate>Fri, 15 Jan 2010 23:00:00 GMT</lastBuildDate>
            //	<item>
            //		<title>Tropical Cyclone Rene - Southern Pacific</title>
            //		<link>http://www.wunderground.com/tropical/tracking/sp201015.html</link>
            //		<description>	
            //<![CDATA[ Updated: <br /> <a href="http://www.wunderground.com/tropical/tracking/sp201015.html"><img src="http://www.wunderground.com/cgi-bin/resize_convert?filename=/data/images/sp201015_cone.png&width=140&height=105" width="140" height="105" alt="sp201015" /></a> <br /><br /><strong>Wind:</strong> 74 MPH | <strong>Location:</strong> -22.7S 537.1W | <strong>Movement:</strong> SW<br /><br />More Information:<br /><a href="http://www.wunderground.com/tropical/tracking/sp201015.html">Tracking Map</a><br /><a href="http://www.wunderground.com/tropical/sp201015.public.html">Public Advisory</a><br /><a href="http://www.wunderground.com/tropical/sp201015.track.html">Coordinates</a><br /><img src="http://server.as5000.com/AS5000/adserver/image?ID=WUND-00070&C=0" width="0" height="0" border="0"/> ]]>
            //		</description>
            //		<pubDate>Tue, 16 Feb 2010 05:00:00 EST</pubDate>
            //		<guid isPermaLink="false">sp201015</guid>
            //	</item>
            //
            //</channel>
            //
            //</rss>
			
		            // Start adding the new TC markers...
		            for (var iX = 0; iX < tc_Xml.length; iX++) 
		            {
			            var tc_Title;
			            var tc_InfoURL;

			            if (detectBrowser.browser == "Explorer")
			            {
				            tc_Title = tc_Xml[iX].getElementsByTagName("title")[0].firstChild.data;
				            tc_InfoURL = tc_Xml[iX].getElementsByTagName("link")[0].firstChild.data;
			            }
			            else	// Other browsers: Firefox, Chrome, Safari, Opera, etc...
			            {
				            var itemTags = tc_Xml[iX].getElementsByTagName("*");
            				
				            for (var iY = 0; iY < itemTags.length; iY++)
				            {
					            var itemTag = itemTags[iY].nodeName;
            					
					            switch (itemTag)
					            {
						            case "title":
							            tc_Title = itemTags[iY].firstChild.data;
							            break;
            							
						            case "link":
							            tc_InfoURL = itemTags[iY].firstChild.data;
							            break;
					            }
				            }
			            }


			            // Okay, we have a Tropical Cyclone data to process...
			            if (tc_Title.indexOf(" Tropical Advisories") == -1)
			            {
			                this.fetchData_TropicalCyclone_Storm(tc_Title, tc_InfoURL, tc_descriptionBlock);
			            }
		            }
	            }
            });
		}
		
		
		catch (ex_fetchData_TropicalCyclone_Region)
		{
			document.getElementById('errorMessage').innerHTML = "function 'fetchData_TropicalCyclone_Region' -- Error: " + ex_fetchData_TropicalCyclone_Region.description;
		}

	}

	

    function fetchData_TropicalCyclone_Storm(tc_Title, tc_InfoURL, tc_descriptionBlock)
    {
		try
        {	
            // Get the STORM ID value from the LINK data...
            var tc_StormID = this.subString_ExtractPiece(tc_InfoURL, "/tracking/", "_", true);

			if (tc_StormID == "")
			{
				tc_StormID = this.subString_ExtractPiece(tc_InfoURL, "/tracking/", ".", true);
			}


            var tc_Description = this.subString_ExtractPiece(tc_descriptionBlock, tc_StormID + "|", "]]>", false);
    		

            // STORM LOCATION value...
            var tc_StormLocation = this.subString_ExtractPiece(tc_Title, " - ", "", true);



            // A little cleanup on the STORM TYPE (sometimes the Weather Underground RSS feeds use abbreviations)...
            tc_Title = tc_Title.replace("TS ", "Tropical Storm ");
            tc_Title = tc_Title.replace("TD ", "Tropical Depression ");

            
            // STORM NAME value...
            var tc_StormName = "";
            var tc_StormNameWords = tc_Title.replace(" - " + tc_StormLocation, "").split(" ");
            
            // Make the actual STORM NAME value all UPPERCASE...
            for(var wordIndex = 0; wordIndex < tc_StormNameWords.length; wordIndex++)
            {
                var tc_StormNameWord = tc_StormNameWords[wordIndex];
                
                if (tc_StormNameWord.indexOf("Remnants") == -1 &
					tc_StormNameWord.indexOf("of") == -1 &
					tc_StormNameWord.indexOf("Subtropical") == -1 &
					tc_StormNameWord.indexOf("Post-Tropical") == - 1 &
					tc_StormNameWord.indexOf("Tropical") == - 1 &
                    tc_StormNameWord.indexOf("Cyclone") == - 1 &
                    tc_StormNameWord.indexOf("Invest") == - 1 &
                    tc_StormNameWord.indexOf("Depression") == - 1 &
                    tc_StormNameWord.indexOf("Storm") == - 1 &
                    tc_StormNameWord.indexOf("Hurricane") == - 1 &
                    tc_StormNameWord.indexOf("Typhoon") == - 1 &
                    tc_StormNameWord.indexOf("Super") == - 1)
                {
                    tc_StormNameWord = tc_StormNameWord.toUpperCase();
                }
                
                tc_StormName += tc_StormNameWord + " ";
            }
            
            tc_StormName = this.trimString(tc_StormName);

            
            
            // MOVEMENT (DIRECTION) value...
            var tc_MovementDirection = this.subString_ExtractPiece(tc_Description, "Movement:</strong> ", "<", true);

            switch (tc_MovementDirection)
            {
                case "N":
                    tc_MovementDirection = "North";
                    break;
                case "NNE":
                    tc_MovementDirection = "North-Northeast";
                    break;
                case "NE":
                    tc_MovementDirection = "Northeast";
                    break;
                case "ENE":
                    tc_MovementDirection = "East-Northeast";
                    break;
                case "ESE":
                    tc_MovementDirection = "East-Southeast";
                    break;
                case "SE":
                    tc_MovementDirection = "Southeast";
                    break;
                case "SSE":
                    tc_MovementDirection = "South-Southeast";
                    break;
                case "S":
                    tc_MovementDirection = "South";
                    break;
                case "SSW":
                    tc_MovementDirection = "South-Southwest";
                    break;
                case "SW":
                    tc_MovementDirection = "Southwest";
                    break;
                case "WSW":
                    tc_MovementDirection = "West-Southwest";
                    break;
                case "W":
                    tc_MovementDirection = "West";
                    break;
                case "WNW":
                    tc_MovementDirection = "West-Northwest";
                    break;
                case "NW":
                    tc_MovementDirection = "Northwest";
                    break;
                case "NNW":
                    tc_MovementDirection = "North-Northwest";
                    break;
            }


            var dtUpdate;
            var tc_Year;
            var tc_Month;
            var tc_Day;
            var tc_Hour;
            var tc_DateTime;
    		
            var tc_Latitude;
            var tc_Longitude;
            var tc_LatLon;

            var tc_WindSpeed;
            var tc_WindSpeedMPH;

            var tc_StormStrength;
            

            this.downloadUrl(urlWeatherUnderground_TropicalCyclone_Tracking.replace("<STORM_ID>", tc_StormID), function(dataWeatherUnderground_TropicalCyclone_Tracking, responseCode2)
            {
                if(responseCode2 != 200)
                {
	                document.getElementById('errorMessage').innerHTML = 
		                "Error fetching WEATHER UNDERGROUND Tropical Cyclone coordinate data, ResponseCode = " + responseCode2;
                }
                else
                {
    //<pre><p><pre> Time            Lat   Lon    Wind(mph)   Storm type
    //-------------------------------------------------------------
    //00 GMT 02/16/10  11S 59.6E    40       Tropical Storm
    //12 GMT 02/16/10  12.8S 60.5E  50       Tropical Storm
    //00 GMT 02/17/10  13.4S 60.7E  75       Category 1
    //</pre></pre>
	                var posCoordinatesLine = 0;

	                var workCoordinatesBlock = this.subString_ExtractPiece(dataWeatherUnderground_TropicalCyclone_Tracking, "<pre> Time", "</pre></pre>", true) + "</pre></pre>";


	                workCoordinatesBlock = workCoordinatesBlock.substr(workCoordinatesBlock.indexOf("-\n"), workCoordinatesBlock.length - 2);

	                var tc_StormTrackCoordinates = new Array();

	                while(true)
	                {
		                var workCoordinatesLine = this.subString_ExtractPiece(workCoordinatesBlock, "\n", "\n", true);
    					
		                if (workCoordinatesLine == "") {break;}
    					
		                workCoordinatesLine += "\n";
    					
		                workCoordinatesBlock = workCoordinatesBlock.replace(workCoordinatesLine, "");
    					

		                // Remove excess spaces between columns of values...
		                workCoordinatesLine = workCoordinatesLine.replace(/      /gm, " ");
		                workCoordinatesLine = workCoordinatesLine.replace(/     /gm, " ");
		                workCoordinatesLine = workCoordinatesLine.replace(/    /gm, " ");
		                workCoordinatesLine = workCoordinatesLine.replace(/   /gm, " ");
		                workCoordinatesLine = workCoordinatesLine.replace(/  /gm, " ");
    					
		                // Break it up into an array for easier processing...
		                workCoordinatesLine = workCoordinatesLine.split(" ");

		                // Get TIME (HOUR) value...
		                tc_Hour = this.trimString(workCoordinatesLine[0]);

		                // Get DATE value...
		                var workValue = this.trimString(workCoordinatesLine[2]).split("/");
    					
		                tc_Month = parseInt(workValue[0], 10) - 1;
		                tc_Day = parseInt(workValue[1], 10);
		                tc_Year = "20" + workValue[2];

		                // Create the full DATE-TIME (UTC) value...
		                dtUpdate = new Date(tc_Year, tc_Month, tc_Day, tc_Hour, 0, 0, 0);
    					
		                // This sets it to LOCAL time...
		                dtUpdate.setHours(dtUpdate.getHours() + (localOffset_Hours));
    					
		                tc_DateTime = this.formatLocalDateTimeString(dtUpdate, false);


						// Get LATITUDE and LONGITUDE values...
						tc_Latitude = this.trimString(workCoordinatesLine[3]);
						
						if (tc_Latitude.indexOf("S") >= 0)
						{
							tc_Latitude = "-" + tc_Latitude;
						}
						tc_Latitude = tc_Latitude.replace("N", "");
						tc_Latitude = tc_Latitude.replace("S", "");


						tc_Longitude = this.trimString(workCoordinatesLine[4]);
						
						if (tc_Longitude.indexOf("W") >= 0)
						{
							tc_Longitude = "-" + tc_Longitude;
						}
						tc_Longitude = tc_Longitude.replace("E", "");
						tc_Longitude = tc_Longitude.replace("W", "");
						
						
						var tc_LatLon_Previous = tc_LatLon;
						
						// Create the full LAT/LON COORDINATES value...
						tc_LatLon = new google.maps.LatLng(parseFloat(tc_Latitude), parseFloat(tc_Longitude));
						
						tc_StormTrackCoordinates.push(tc_LatLon);
						
						
						// WIND (SPEED) value...
						workValue = this.trimString(workCoordinatesLine[5]);

						tc_WindSpeedMPH = parseInt(workValue, 10);
						tc_WindSpeed = this.convertMilesToKilometers(tc_WindSpeedMPH) + " km/h (" + tc_WindSpeedMPH + " mph)";
							
							
						var tc_Icon_StormTrackHistory;
						var tc_IconShadow_StormTrackHistory = iconTropicalCyclone_Shadow_Small;
						
						
						
						if (tc_StormName.indexOf("Invest ") >= 0)
						{
							tc_StormStrength = "Invest";
							tc_Icon_StormTrackHistory = iconTropicalCyclone_Invest_Small;
							tc_IconShadow_StormTrackHistory = iconTropicalCyclone_Invest_Shadow_Small;
						}
						
						else if (tc_WindSpeedMPH >= 156)
						{
							tc_StormStrength = "Category 5";
							tc_Icon_StormTrackHistory = iconTropicalCyclone_Category5_Small;
						}

						else if (tc_WindSpeedMPH >= 131)
						{
							tc_StormStrength = "Category 4";
							tc_Icon_StormTrackHistory = iconTropicalCyclone_Category4_Small;
						}

						else if (tc_WindSpeedMPH >= 111)
						{
							tc_StormStrength = "Category 3";
							tc_Icon_StormTrackHistory = iconTropicalCyclone_Category3_Small;
						}

						else if (tc_WindSpeedMPH >= 96)
						{
							tc_StormStrength = "Category 2";
							tc_Icon_StormTrackHistory = iconTropicalCyclone_Category2_Small;
						}

						else if (tc_WindSpeedMPH >= 74)
						{
							tc_StormStrength = "Category 1";
							tc_Icon_StormTrackHistory = iconTropicalCyclone_Category1_Small;
						}

						else if (tc_WindSpeedMPH >= 39)
						{
							tc_StormStrength = "Tropical Storm";
							tc_Icon_StormTrackHistory = iconTropicalCyclone_Storm_Small;
						}
						
						else
						{
							tc_StormStrength = "Tropical Depression";
							tc_Icon_StormTrackHistory = iconTropicalCyclone_Depression_Small;
						}



						var workCoordinatesBlock_Remaining = this.subString_ExtractPiece(workCoordinatesBlock, "\n", "\n", true);

						// This check makes sure we don't create a Storm Track marker for the last record (most recent storm coordinates)...
						if (workCoordinatesBlock_Remaining == "") {break};
						
						// This check makes sure we don't create a duplicate Storm Track marker; WU sometimes includes duplicate records of storm tracking data)...
						if (tc_LatLon == tc_LatLon_Previous) {break};
						
						
						var tc_MarkerTitle_StormTrackHistory = "<strong>Storm track history: " + tc_StormNameWord + "</strong><br />" + 
															   tc_StormLocation + "<br />" + 
															   "Strength: " + tc_StormStrength + "<br />" + 
															   "Winds: " + tc_WindSpeed + "<br />" + 
															   tc_DateTime;


						var tc_Marker_StormTrackHistory = this.createMarker(tc_LatLon, tc_Icon_StormTrackHistory, tc_IconShadow_StormTrackHistory, tc_MarkerTitle_StormTrackHistory, 50, "");


						switch (tc_StormStrength)
						{
							case "Invest":
								markersTropicalDisturbance_StormTrackHistory[ti_MarkerCount_StormTrackHistory] = tc_Marker_StormTrackHistory;
								
								if (document.myForm.checkboxTropicalCyclone_StormTrackHistory.checked)
								{
									markersTropicalDisturbance_StormTrackHistory[ti_MarkerCount_StormTrackHistory].setVisible(true);
								}
								else
								{
									markersTropicalDisturbance_StormTrackHistory[ti_MarkerCount_StormTrackHistory].setVisible(false);
								}
								
								ti_MarkerCount_StormTrackHistory++;
								break;


							default:
								markersTropicalCyclone_StormTrackHistory[tc_MarkerCount_StormTrackHistory] = tc_Marker_StormTrackHistory;
								
								if (document.myForm.checkboxTropicalCyclone_StormTrackHistory.checked)
								{
									markersTropicalCyclone_StormTrackHistory[tc_MarkerCount_StormTrackHistory].setVisible(true);
								}
								else
								{
									markersTropicalCyclone_StormTrackHistory[tc_MarkerCount_StormTrackHistory].setVisible(false);
								}
								
								tc_MarkerCount_StormTrackHistory++;
								break;
						}
	                }


	                //
	                // Build the polyline feature for the Storm Track -- only if we have TWO or more storm track coordinates...
	                //
	                try
	                {
		                if (tc_StormTrackCoordinates.length > 1)
		                {
			                // We create pathCoordinates as an MVCArray so we can manipulate it using the insertAt() method
			                var polyLineCoordinates = new google.maps.MVCArray();
    						
			                var polyLineOptions = {path: polyLineCoordinates, strokeColor: '#FFFFFF', strokeOpacity: 1.0, strokeWeight: 3};

			                var polyLineStormTrack = new google.maps.Polyline(polyLineOptions);	
    						
			                for (var iY = 0; iY <= tc_StormTrackCoordinates.length - 1; iY++)
			                {
				                var path = polyLineStormTrack.getPath();

				                // Because path is an MVCArray, we can simply append a new coordinate value...
				                path.insertAt(path.length, tc_StormTrackCoordinates[iY]);
			                }
    						
							
							switch (tc_StormStrength)
							{
								case "Invest":
									polylinesTropicalDisturbance_StormTrackHistory[ti_MarkerCount] = polyLineStormTrack;	
									
									if (document.myForm.checkboxTropicalCyclone_StormTrackHistory.checked)
									{
										polylinesTropicalDisturbance_StormTrackHistory[ti_MarkerCount].setMap(mapCanvas); 
									}
									break;
									
								default:
									polylinesTropicalCyclone_StormTrackHistory[tc_MarkerCount] = polyLineStormTrack;	
									
									if (document.myForm.checkboxTropicalCyclone_StormTrackHistory.checked)
									{
										polylinesTropicalCyclone_StormTrackHistory[tc_MarkerCount].setMap(mapCanvas); 
									}
									break;
							}
		                }
	                }
    				
	                catch (ex_tc_StormTrackCoordinates)
	                {
	                }



	                var tc_IconFileUrl;
	                var tc_Icon;
	                var tc_IconShadow = iconTropicalCyclone_Shadow;
	                var tc_ImportanceLevel = 100;

					if (tc_StormStrength == "Invest")
					{
						tc_IconFileUrl = iconTropicalCyclone_Invest_Url;
						tc_Icon = iconTropicalCyclone_Invest;
						tc_IconShadow = iconTropicalCyclone_Invest_Shadow;
						
	                	tc_ImportanceLevel = 95;
					}
					
	                else if (tc_WindSpeedMPH >= 156)
	                {
		                tc_IconFileUrl = iconTropicalCyclone_Category5_Url;
		                tc_Icon = iconTropicalCyclone_Category5;
	                }

	                else if (tc_WindSpeedMPH >= 131)
	                {
		                tc_IconFileUrl = iconTropicalCyclone_Category4_Url;
		                tc_Icon = iconTropicalCyclone_Category4;
	                }

	                else if (tc_WindSpeedMPH >= 111)
	                {
		                tc_IconFileUrl = iconTropicalCyclone_Category3_Url;
		                tc_Icon = iconTropicalCyclone_Category3;
	                }

	                else if (tc_WindSpeedMPH >= 96)
	                {
		                tc_IconFileUrl = iconTropicalCyclone_Category2_Url;
		                tc_Icon = iconTropicalCyclone_Category2;
	                }

	                else if (tc_WindSpeedMPH >= 74)
	                {
		                tc_IconFileUrl = iconTropicalCyclone_Category1_Url;
		                tc_Icon = iconTropicalCyclone_Category1;
	                }

	                else if (tc_WindSpeedMPH >= 39)
	                {
		                tc_IconFileUrl = iconTropicalCyclone_Storm_Url;
		                tc_Icon = iconTropicalCyclone_Storm;
	                }

	                else
	                {
						tc_IconFileUrl = iconTropicalCyclone_Depression_Url;
						tc_Icon = iconTropicalCyclone_Depression;
	                }
    				


					// For Tropical Depressions to major Hurricanes/Typhoons (any tropical cyclone), display the Weather Underground TRACKING map image...
	                var tc_TrackingModels_Image = urlWeatherUnderground_TropicalCyclone_Tracking_Image.replace("<STORM_ID>", tc_StormID);

					// For INVEST (not tropical cyclones but areas of interest) display the Weather Underground MODELS map image...
					if (tc_StormStrength == "Invest")
					{
	                	tc_TrackingModels_Image = urlWeatherUnderground_TropicalCyclone_Models_Image.replace("<STORM_ID>", tc_StormID);
					}


					// Always display the Weather Underground SATELLITE image...
	                var tc_Satellite_Image = urlWeatherUnderground_TropicalCyclone_Satellite_Image.replace("<STORM_ID>", tc_StormID);


	                var tc_Html =
		                "<div id=\"infowindowHTML\">" +
		                "<img src=\"" + tc_IconFileUrl + "\" width=\"30\" height=\"29\" align=\"abstop\" /><br />" +
		                "<span style=\"font-size:15px; font-weight:bold;\">" + tc_StormName + "</span>" +
		                "<br />" +
		                "<span style=\"font-weight:bold;\">" + tc_StormLocation + "</span>" +
		                "<br /><br />" +
		                "<a href=\"" + tc_TrackingModels_Image + "\" alt=\"Image currently unavailable\" target=\"_blank\">" +
		                "<img src=\"" + tc_TrackingModels_Image + "\" width=\"211\" height=\"160\" />" +
		                "</a>&nbsp;&nbsp;" +
		                "<a href=\"" + tc_Satellite_Image + "\" alt=\"Satellite image currently unavailable\" target=\"_blank\">" +
		                "<img src=\"" + tc_Satellite_Image + "\" width=\"211\" height=\"160\" />" +
		                "</a>" +
		                "<br /><br />" +
						((tc_StormStrength != "Invest") ? "<span style=\"font-weight:bold;\">Strength: </span>" + tc_StormStrength + "<br />" : "") +
		                "<span style=\"font-weight:bold;\">Winds: </span>" + tc_WindSpeed +
		                "<br />" +
		                "<span style=\"font-weight:bold;\">Movement: </span>" + tc_MovementDirection +
		                "<br /><br /><br />" +
		                "<span style=\"font-weight:bold;\">Updated: </span>" + tc_DateTime +
		                "<br /><br />" +
		                "<hr /><span style=\"font-weight:bold;\">More information:</span>" +
		                "<br />" +
		                "<img src=\"images/logo/small/WeatherUnderground.jpg\" align=\"absmiddle\" />&nbsp;" +
		                "<a href=\"" + tc_InfoURL + "\" target=\"_blank\">Weather Underground</a>" +
		                "</div>";
    					

	                var tc_MarkerTitle = "<strong>" + tc_StormName + "</strong><br />" + 
						                 tc_StormLocation + "<br />" + 
					   	                 ((tc_StormStrength != "Invest") ? "Strength: " + tc_StormStrength + "<br />" : "") + 
					                     "Winds: " + tc_WindSpeed + "<br />" + 
					                     tc_DateTime;


	                var marker = this.createMarker(tc_LatLon, tc_Icon, tc_IconShadow, tc_MarkerTitle, tc_ImportanceLevel, tc_Html);


					switch (tc_StormStrength)
					{
						case "Invest":
							markersTropicalDisturbance[ti_MarkerCount] = marker;
							
							if (!document.myForm.checkboxTropicalCyclone_Invests.checked)
							{
								markersTropicalDisturbance[ti_MarkerCount].setVisible(false);
							}
							else
							{
								isEnabled_TropicalDisturbance = true;
							}
		
							ti_MarkerCount++;
		
		
							var countTropicalDisturbances = "Tropical disturbances - " + ti_MarkerCount + " area";
							if (ti_MarkerCount != 1) {countTropicalDisturbances += "s"};
							
							document.getElementById("lblTropicalDisturbance").innerHTML = countTropicalDisturbances;							
							break;
							
							
						default:
							markersTropicalCyclone[tc_MarkerCount] = marker;
							
							if (!document.myForm.checkboxTropicalCyclone.checked)
							{
								markersTropicalCyclone[tc_MarkerCount].setVisible(false);
							}
							else
							{
								isEnabled_TropicalCyclone = true;
							}
		
		
							// Add all active Tropical Cyclone storms to the list on the menu...
							tc_MarkerTitle = tc_MarkerTitle.replace("<br />Winds:", ", Winds:");
							
							listTropicalCyclone_Active +=
								tc_MarkerTitle +
								"<a href=\"javascript:onLinkClicked_DisplayMarkerInfoWindow('TropicalCyclone', " + tc_MarkerCount + ")\"><em>&nbsp;&nbsp;&nbsp;&nbsp;More info...</em><br /></a>";
		
							if (document.myForm.checkboxTropicalCyclone.checked)
							{
								document.getElementById('textTropicalCyclone_Active').innerHTML = listTropicalCyclone_Active;
							}
							
							
							tc_MarkerCount++;
		
		
							var countTropicalCyclones = "Tropical cyclones - " + tc_MarkerCount + " storm";
							if (tc_MarkerCount != 1) {countTropicalCyclones += "s"};
							
							document.getElementById("lblTropicalCyclone").innerHTML = countTropicalCyclones;							
							break;
					}

                }
            });
		}
		
		
		catch (ex_fetchData_TropicalCyclone_Storm)
		{
			document.getElementById('errorMessage').innerHTML = "function 'fetchData_TropicalCyclone_Storm' -- Error: " + ex_fetchData_TropicalCyclone_Storm.description;
		}

	}
	
	
	
	function fetchData_Volcano_USGS_VHP(queryColorCode)
	{
		try
		{
			// IMPORTANT:  First, remove all existing markers created...	
			switch (queryColorCode)
			{
				case "RED":
					for (var iX = 0; iX < markersVolcano_USGS_VHP_Red.length; iX++) 
					{
						markersVolcano_USGS_VHP_Red[iX].setMap(null);
					}

					markersVolcano_USGS_VHP_Red = [];		// Clear array...
					break;
					
				case "ORANGE":
					for (var iX = 0; iX < markersVolcano_USGS_VHP_Orange.length; iX++) 
					{
						markersVolcano_USGS_VHP_Orange[iX].setMap(null);
					}

					markersVolcano_USGS_VHP_Orange = [];		// Clear array...
					break;
					
				case "YELLOW":
					for (var iX = 0; iX < markersVolcano_USGS_VHP_Yellow.length; iX++) 
					{
						markersVolcano_USGS_VHP_Yellow[iX].setMap(null);
					}

					markersVolcano_USGS_VHP_Yellow = [];		// Clear array...
					break;
					
				case "GREEN_UNASSIGNED_SPECIAL_MONITORED":
					for (var iX = 0; iX < markersVolcano_USGS_VHP_GreenUnassigned_SpecialMonitored.length; iX++) 
					{
						markersVolcano_USGS_VHP_GreenUnassigned_SpecialMonitored[iX].setMap(null);
					}

					markersVolcano_USGS_VHP_GreenUnassigned_SpecialMonitored = [];		// Clear array...
					break;
					
				case "GREEN":
					for (var iX = 0; iX < markersVolcano_USGS_VHP_Green.length; iX++) 
					{
						markersVolcano_USGS_VHP_Green[iX].setMap(null);
					}

					markersVolcano_USGS_VHP_Green = [];		// Clear array...
					break;
					
				case "UNASSIGNED":
					for (var iX = 0; iX < markersVolcano_USGS_VHP_Unassigned.length; iX++) 
					{
						markersVolcano_USGS_VHP_Unassigned[iX].setMap(null);
					}

					markersVolcano_USGS_VHP_Unassigned = [];		// Clear array...
					break;
			}

		
			var vol_markerCount = 0;


			// Start adding the new markers...
			for (var iX = 0; iX < markersXml_Volcano_USGS_VHP_All.length; iX++) 
			{
				try
				{
					var volcanoName = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("volcano_name");
					var alertLevel = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("alert_level");
					var colorCode = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("color_code")
					
					
					var isActivelyMonitored = false;
					
					// Look Alert Level / Color Code for the actively monitored volcanoes...
					for (var iY = 0; iY < markersXml_Volcano_USGS_VHP_ActivelyMonitored.length; iY++) 
					{
						if (volcanoName == markersXml_Volcano_USGS_VHP_ActivelyMonitored[iY].getAttribute("volcano_name") |
						   (volcanoName == "Mount St. Helens" & markersXml_Volcano_USGS_VHP_ActivelyMonitored[iY].getAttribute("volcano_name")	== "Cascade Range"))																											
						{
							alertLevel = markersXml_Volcano_USGS_VHP_ActivelyMonitored[iY].getAttribute("alert_level");
							colorCode = markersXml_Volcano_USGS_VHP_ActivelyMonitored[iY].getAttribute("color_code");
							
							isActivelyMonitored = true;
							break;
						}
					}
				
				
					var processIt = false;
					
					switch (queryColorCode)
					{
						case "RED":
						case "ORANGE":
						case "YELLOW":
							if (isActivelyMonitored & colorCode == queryColorCode)
							{
								processIt = true;
							}
							break;
	
						case "GREEN_UNASSIGNED_SPECIAL_MONITORED":
							if (isActivelyMonitored & (colorCode == "GREEN" | colorCode == "UNASSIGNED"))
							{
								processIt = true;
							}
							break;
							
						case "GREEN":
						case "UNASSIGNED":
							if (!isActivelyMonitored & colorCode == queryColorCode)
							{
								processIt = true;
							}
							break;
					}
					
					
					if (processIt)
					{
						var vol_LatLon = new google.maps.LatLng(parseFloat(markersXml_Volcano_USGS_VHP_All[iX].getAttribute("latitude")),
																parseFloat(markersXml_Volcano_USGS_VHP_All[iX].getAttribute("longitude")));
				
						var region = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("region");
						var location = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("location");
						
						var region_location = region;
						
						if (region != location)
						{
							region_location += " - " + location;
						}
						
						var elevation = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("elevation");
				
						var threatPotential = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("nvewsthreat");
				
						var statusReport = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("status");
						var overviewVolcano = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("overview");
						
						var statusDate = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("alertdate").replace(", ", " "); 
						var statusTime = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("alerttime");
						var statusTimeZone = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("timezone");
						
						var statusUpdate_DateTime = "";
	
						
						if (statusDate != "" & statusTime != "" & statusTimeZone != "")
						{
							var oDate = statusDate.split(" ");
							var oTime = statusTime.split(":");
							
							// Process for Month...
							switch (oDate[0])
							{
								case "Jan":
									oDate[0] = 0;
									break;
									
								case "Feb":
									oDate[0] = 1;
									break;
									
								case "Mar":
									oDate[0] = 2;
									break;
									
								case "Apr":
									oDate[0] = 3;
									break;
									
								case "May":
									oDate[0] = 4;
									break;
									
								case "Jun":
									oDate[0] = 5;
									break;
									
								case "Jul":
									oDate[0] = 6;
									break;
									
								case "Aug":
									oDate[0] = 7;
									break;
									
								case "Sep":
									oDate[0] = 8;
									break;
									
								case "Oct":
									oDate[0] = 9;
									break;
									
								case "Nov":
									oDate[0] = 10;
									break;
									
								case "Dec":
									oDate[0] = 11;
									break;
							}
	
	
							var locationOffset_Hours = 0;
			
							switch (statusTimeZone)
							{
								case "EDT":
									locationOffset_Hours = 4;
									break;
			
								case "EST":
									locationOffset_Hours = 5;
									break;
			
								case "CDT":
									locationOffset_Hours = 5;
									break;
			
								case "CST":
									locationOffset_Hours = 6;
									break;
			
								case "MDT":
									locationOffset_Hours = 6;
									break;
			
								case "MST":
									locationOffset_Hours = 7;
									break;
			
								case "PDT":
									locationOffset_Hours = 7;
									break;
			
								case "PST":
									locationOffset_Hours = 8;
									break;
			
								case "ADT":
								case "AKDT":
									locationOffset_Hours = 8;
									break;
			
								case "AST":
								case "AKST":
									locationOffset_Hours = 9;
									break;
			
								case "HST":     // HAWAII: no Daylight Savings Time
									locationOffset_Hours = 10;
									break;
			
								case "GST":     // GUAM: no Daylight Savings Time
								case "MPT":     // NORTHERN MARIANA ISLANDS: no Daylight Savings Time
									locationOffset_Hours = -10;
									break;
							}
	
	
							var dtUpdate = new Date(parseInt(oDate[2], 10), parseInt(oDate[0], 10), parseInt(oDate[1], 10), 
													parseInt(oTime[0], 10), parseInt(oTime[1], 10), 0, 0);
	
							// This sets it back to UTC time...
							dtUpdate.setHours(dtUpdate.getHours() + (locationOffset_Hours));
							
							// This sets it to LOCAL time...
							dtUpdate.setHours(dtUpdate.getHours() + (localOffset_Hours));
							
							statusUpdate_DateTime = this.formatLocalDateTimeString(dtUpdate, false);
						}
						
						
						var linkVHP = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("vhplink");
						if (linkVHP == "NULL") { linkVHP = ""; };
				
						var linkGVP = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("gvplink");
						if (linkGVP == "NULL") { linkGVP = ""; };
	
	
						var moreInfoUrls = "";
						
						if (linkVHP != "")
						{
							moreInfoUrls = "<br /><hr /><span style=\"font-weight:bold;\">More information:</span><br /><br />" +
										   "<img src=\"images/logo/small/USGS.png\" align=\"absmiddle\" />&nbsp;<a href=\"" + 
										   linkVHP + "\" target=\"_blank\">U.S. Geological Survey</a>" +
										   "<br />";
						}
						
						
						// Volcano image
						var imageFile = markersXml_Volcano_USGS_VHP_All[iX].getAttribute("image");
	
	
						// Map marker icon: USGS status
						var vol_iconUrl;
						var vol_icon;
						var vol_iconShadow;
						
						switch (queryColorCode)
						{
							case "RED":
								if (alertLevel == "WARNING")
								{
									vol_iconUrl = vol_icon_USGSVHP_RedWarning_Url;
									vol_icon = iconVolcano_USGSVHP_RedWarning;
								}
								else
								{
									vol_iconUrl = iconVolcano_USGSVHP_RedWatch_Url;
									vol_icon = iconVolcano_USGSVHP_RedWatch;
								}
								vol_iconShadow = iconVolcano_USGSVHP_Red_Shadow;
								break;
				
							case "ORANGE":
								if (alertLevel == "WARNING")
								{
									vol_iconUrl = iconVolcano_USGSVHP_OrangeWarning_Url;
									vol_icon = iconVolcano_USGSVHP_OrangeWarning;
								}
								else
								{
									vol_iconUrl = iconVolcano_USGSVHP_OrangeWatch_Url;
									vol_icon = iconVolcano_USGSVHP_OrangeWatch;
								}
								vol_iconShadow = iconVolcano_USGSVHP_Orange_Shadow;
								break;
								
							case "YELLOW":
								vol_iconUrl = iconVolcano_USGSVHP_YellowAdvisory_Url;
								vol_icon = iconVolcano_USGSVHP_YellowAdvisory;
								vol_iconShadow = iconVolcano_USGSVHP_Yellow_Shadow;
								break;
								
							case "GREEN_UNASSIGNED_SPECIAL_MONITORED":
								switch (colorCode)
								{
									case "GREEN":
										vol_iconUrl = iconVolcano_USGSVHP_GreenNormal_Enlarged_Url;
										vol_icon = iconVolcano_USGSVHP_GreenNormal_Enlarged;
										vol_iconShadow = iconVolcano_USGSVHP_GreenNormal_Unassigned_Enlarged_Shadow;
										break;
										
									case "UNASSIGNED":
										vol_iconUrl = iconVolcano_USGSVHP_Unassigned_Enlarged_Url;
										vol_icon = iconVolcano_USGSVHP_Unassigned_Enlarged;
										vol_iconShadow = iconVolcano_USGSVHP_GreenNormal_Unassigned_Enlarged_Shadow;
										break;
								}
								break;
								
							case "GREEN":
								vol_iconUrl = iconVolcano_USGSVHP_GreenNormal_Enlarged_Url;
								vol_icon = iconVolcano_USGSVHP_GreenNormal;
								vol_iconShadow = iconVolcano_USGSVHP_GreenNormal_Shadow;
								break;
								
							case "UNASSIGNED":
								vol_iconUrl = iconVolcano_USGSVHP_Unassigned_Enlarged_Url;
								vol_icon = iconVolcano_USGSVHP_Unassigned;
								vol_iconShadow = iconVolcano_USGSVHP_Unassigned_Shadow;
								break;
						}
						
						
						var latitude = Math.abs(parseFloat(markersXml_Volcano_USGS_VHP_All[iX].getAttribute("latitude")));
						var latitudeNS = "°N";
						if (markersXml_Volcano_USGS_VHP_All[iX].getAttribute("latitude").indexOf("-") != -1) {latitudeNS = "°S"};
						
						var longitude = Math.abs(parseFloat(markersXml_Volcano_USGS_VHP_All[iX].getAttribute("longitude")));
						var longitudeEW = "°E";
						if (markersXml_Volcano_USGS_VHP_All[iX].getAttribute("longitude").indexOf("-") != -1) {longitudeEW = "°W"};
						
						
						volcanoName = volcanoName.replace(" Volcanic Center", "");
						volcanoName = volcanoName.replace(" volcanic center", "");
						volcanoName = volcanoName.replace(" Volcanic Field", "");
						volcanoName = volcanoName.replace(" volcanic field", "");
						
						var vol_Report =
							"<div id=\"infowindowHTML\">" +
							"<img src=\"" + vol_iconUrl + "\"/>" +
							"<br />" +
							"<span style=\"font-size:15px;font-weight:bold;\">" + volcanoName + "</span>" +
							"<br />" +
							"<span style=\"font-weight:bold;\">" + region_location + "</span>" +
							"<br /><br />";
							
						if (imageFile != "")
						{
							var imageFile_Large = imageFile;
							
							
							if (imageFile_Large.indexOf("cnmi") >= 0)
							{
								imageFile_Large = imageFile_Large.replace("_small", "");
							}
							else if (imageFile_Large.indexOf("hvo") >= 0)
							{
								imageFile_Large = imageFile_Large.replace("_S.", "_L.");
								imageFile_Large = imageFile_Large.replace("_M.", "_L.");
							}
							else if (imageFile_Large.indexOf("http://www.volcano.si.edu/images") >= 0)
							{
								imageFile_Large = imageFile_Large.replace("/small/", "/full/");						
							}
							else
							{
								imageFile_Large = imageFile_Large.replace("_small", "_large");
							}
							
							
							vol_Report +=
								"<a href=\"" + imageFile_Large + "\" target=\"_blank\">" +						
								"<img src=\"" + imageFile + "\" width=\"175\" height=\"100\" />" +
								"</a>" +
								"<br /><br />";
						}
	
							
						vol_Report +=
							"<span style=\"font-weight:bold;\">Volcano Alert Level: </span>" + alertLevel + 
							"<br />" +
							"<span style=\"font-weight:bold;\">Aviation Color Code: </span>" + colorCode + 
							"<br />" +
							"<span style=\"font-weight:bold;\">Threat Potential: </span>" + threatPotential + 
							"<br /><br />" +
							"<span style=\"font-weight:bold;\">Summit Elevation: </span>" + elevation + " meters (" + this.convertMetersToFeet(elevation) + " feet)" +
							"<br />" +
							"<span style=\"font-weight:bold;\">Latitude, Longitude: </span>" + latitude + latitudeNS + ", " + longitude + longitudeEW + 
							"<br />";
				
						if (statusUpdate_DateTime != "")
						{
							vol_Report += "<br /><br />" +
										  "<span style=\"font-weight:bold;\">Updated: </span>" + statusUpdate_DateTime + 
				  						  "<br />";
						}
						
						if (statusReport != "" | overviewVolcano != "" | linkVHP != "")
						{
							if (statusReport != "" | overviewVolcano != "")
							{
								vol_Report += "<br />" +
											  "<div style=\"text-align:left\">";
								
								if (overviewVolcano != "")
								{
									vol_Report += statusReport + 
												  "<br /><br />" + 
												  overviewVolcano;
								}
								else
								{
									vol_Report += statusReport;
								}
							}
							else if (linkVHP != "")
							{
								vol_Report += "<br />" +
											  "<div style=\"text-align:left\">Click the <em>U.S. Geological Survey</em> link below for current status on this volcano."
							}
						
							vol_Report += "</div>";
						}
						
						vol_Report += moreInfoUrls +
									  "</div>";
	
	
	
						var vol_markerImportance;
						
						switch (queryColorCode)
						{
							case "RED":
								vol_markerImportance = 100;
								break;
				
							case "ORANGE":
								vol_markerImportance = 70;
								break;
								
							case "YELLOW":
								vol_markerImportance = 60;
								break;
				
							case "GREEN_UNASSIGNED_SPECIAL_MONITORED":
								switch (colorCode)
								{
									case "GREEN":
										vol_markerImportance = 18;
										break;
										
									case "UNASSIGNED":
										vol_markerImportance = 17;
										break;
								}
								break;
								
							case "GREEN":
								vol_markerImportance = 16;
								break;
								
							case "UNASSIGNED":
								vol_markerImportance = 15;
								break;
						}
						
	
						var vol_markerTitle = "<strong>Volcano</strong><br />" +
											  "Current Status report for " + volcanoName.toUpperCase();
						
						if (statusUpdate_DateTime != "")
						{
							vol_markerTitle += "<br />" + statusUpdate_DateTime;
						}
						

						var vol_marker = this.createMarker(vol_LatLon, vol_icon, vol_iconShadow, vol_markerTitle, vol_markerImportance, vol_Report);

						
						switch (queryColorCode)
						{
							case "RED":
								markersVolcano_USGS_VHP_Red[vol_markerCount] = vol_marker;
										
								if (!document.myForm.checkboxVolcano_USGS_VHP_Red.checked)
								{
									markersVolcano_USGS_VHP_Red[vol_markerCount].setVisible(false);
								}
								else
								{
									isEnabled_Volcano_USGS_VHP_Red = true;
								}
								break;
				
							case "ORANGE":
								markersVolcano_USGS_VHP_Orange[vol_markerCount] = vol_marker;
								
								if (!document.myForm.checkboxVolcano_USGS_VHP_Orange.checked)
								{
									markersVolcano_USGS_VHP_Orange[vol_markerCount].setVisible(false);
								}
								else
								{
									isEnabled_Volcano_USGS_VHP_Orange = true;
								}
								break;
								
							case "YELLOW":
								markersVolcano_USGS_VHP_Yellow[vol_markerCount] = vol_marker;
								
								if (!document.myForm.checkboxVolcano_USGS_VHP_Yellow.checked)
								{
									markersVolcano_USGS_VHP_Yellow[vol_markerCount].setVisible(false);
								}
								else
								{
									isEnabled_Volcano_USGS_VHP_Yellow = true;
								}
								break;
				
							case "GREEN_UNASSIGNED_SPECIAL_MONITORED":
								markersVolcano_USGS_VHP_GreenUnassigned_SpecialMonitored[vol_markerCount] = vol_marker;
								
								if (!document.myForm.checkboxVolcano_USGS_VHP_GreenUnassigned_SpecialMonitored.checked)
								{
									markersVolcano_USGS_VHP_GreenUnassigned_SpecialMonitored[vol_markerCount].setVisible(false);
								}
								else
								{
									isEnabled_Volcano_USGS_VHP_GreenUnassigned_SpecialMonitored = true;
								}
								break;
								
							case "GREEN":
								markersVolcano_USGS_VHP_Green[vol_markerCount] = vol_marker;
								
								if (!document.myForm.checkboxVolcano_USGS_VHP_Green.checked)
								{
									markersVolcano_USGS_VHP_Green[vol_markerCount].setVisible(false);
								}
								else
								{
									isEnabled_Volcano_USGS_VHP_Green = true;
								}
								break;
								
							case "UNASSIGNED":
								markersVolcano_USGS_VHP_Unassigned[vol_markerCount] = vol_marker;
								
								if (!document.myForm.checkboxVolcano_USGS_VHP_Unassigned.checked)
								{
									markersVolcano_USGS_VHP_Unassigned[vol_markerCount].setVisible(false);
								}
								else
								{
									isEnabled_Volcano_USGS_VHP_Unassigned = true;
								}
								break;
						}
						
						vol_markerCount++;
					}
				}
				
				catch (ex2)
				{
					document.getElementById('errorMessage').innerHTML = "function 'fetchData_Volcano_USGS_VHP' -- Error: " + ex1.description;
				}
			}
			
			this.setCount_Volcano_USGS_VHP(queryColorCode);

		}
		
		catch (ex1)
		{
			document.getElementById('errorMessage').innerHTML = "function 'fetchData_Volcano_USGS_VHP' -- Error: " + ex1.description;
		}
	}



	
	function fetchData_VolcanoCatalog()
	{
		try
		{
			document.getElementById('errorMessage').innerHTML = "";


			var fieldValue = "";
			var queryValue = "";
			
			
			// NAME
			fieldValue = document.myForm.textboxVolcanoCatalog_FindByName.value;
			
			if (fieldValue != "")
			{
				queryValue = "&name=" + fieldValue;
			}


			// LOCATION
			fieldValue = document.myForm.textboxVolcanoCatalog_FindByLocation.value;
					
			if (fieldValue != "")
			{
				queryValue += "&location=" + fieldValue;
			}


			// VOLCANO TYPE
			var iX = document.myForm.dropdownVolcanoCatalog_FindByType.selectedIndex;
			
			if (iX >= 0)
			{
				fieldValue = document.myForm.dropdownVolcanoCatalog_FindByType.options[iX].text;
				
				if (fieldValue != "")
				{
					queryValue += "&type=" + fieldValue;
				}
			}
			


			// Only do a database query if we have an actual value to search on!
			if (queryValue != "")
			{
				document.getElementById('loadingMessage').style.visibility = 'visible';
				document.getElementById('loadingMessageText').innerHTML = "Searching volcano catalog...";
			
			
				// IMPORTANT:  First, remove all existing markers created from the Volcano Catalog (database)...	
				this.resetVolcanoCatalog(false);
	
	
				// Get volcano data from XML extracted from MySQL database table...
				this.downloadUrl("mysql_search_volcano_catalog_full.php?" + "browser=" + detectBrowser.browser + queryValue, function(data)
				{
					var xml = this.parseXml(data);
					
					var volcanoes = xml.documentElement.getElementsByTagName("marker");
			
					var jumptoLatitude;
					var jumptoLongitude;
					var firstMarker;
					
					// Then we can start adding the new markers...
					for (var iX = 0; iX < volcanoes.length; iX++) 
					{
						var volcanoName = volcanoes[iX].getAttribute("name");
						
						var pointLatLon = new google.maps.LatLng(parseFloat(volcanoes[iX].getAttribute("latitude")), parseFloat(volcanoes[iX].getAttribute("longitude")));
						
						(iX == 0)
						{
							jumptoLatitude = parseFloat(volcanoes[iX].getAttribute("latitude"));
							jumptoLongitude = parseFloat(volcanoes[iX].getAttribute("longitude"));
						}
					
						var latitude = Math.abs(parseFloat(volcanoes[iX].getAttribute("latitude")));
						var latitudeNS = "°N";
						if (volcanoes[iX].getAttribute("latitude").indexOf("-") != -1) {latitudeNS = "°S"};
						
						var longitude = Math.abs(parseFloat(volcanoes[iX].getAttribute("longitude")));
						var longitudeEW = "°E";
						if (volcanoes[iX].getAttribute("longitude").indexOf("-") != -1) {longitudeEW = "°W"};
						
						var urlGVP = "http://www.volcano.si.edu/world/volcano.cfm?vnum=" + volcanoes[iX].getAttribute("number");
	
						var moreInfoUrl = 
							"<br /><hr /><span style=\"font-weight:bold;\">More information:</span><br /><br />" +
							"<img src=\"images/logo/small/Smithsonian.jpg\" align=\"absmiddle\" />&nbsp;" +
							"<a href=\"" + urlGVP + "\" target=\"_blank\">Smithsonian Institution</a>";
	
						var htmlHeader =
							"<div id=\"infowindowHTML\">" +
							"<span style=\"font-size:15px;font-weight:bold;\">" + volcanoName + "</span>" +
							"<br /><br />";



						var imageFile_SmallSize = "";
						var imageFile_FullSize = "";
						
						if (volcanoes[iX].getAttribute("image") == "UNAVAILABLE")
						{
							imageFile_SmallSize = "images/unavailable.png";
						}
						else
						{
							imageFile_SmallSize = "http://www.volcano.si.edu/images/small/" + volcanoes[iX].getAttribute("image");
							imageFile_FullSize = "http://www.volcano.si.edu/images/full/" + volcanoes[iX].getAttribute("image");
						}
			
			
						if (imageFile_FullSize != "")
						{
							htmlHeader += "<a href=\"" + imageFile_FullSize + "\" target=\"_blank\">";
						}
						
						htmlHeader += "<img src=\"" + imageFile_SmallSize + "\" height=\"212\" width=\"320\" />";
						
						if (imageFile_FullSize != "")
						{
							htmlHeader += "</a>";
						}

						htmlHeader += "<br /><br />";


						var vol_Report = 
							htmlHeader +
						    "Location: <strong>" + volcanoes[iX].getAttribute("location") + "</strong><br />" +
						    "Volcano Number: <strong>" + volcanoes[iX].getAttribute("number") + "</strong><br />" +
						    "Type: <strong>" + volcanoes[iX].getAttribute("type") + "</strong><br />" +
						    "Status: <strong>" + volcanoes[iX].getAttribute("status") + "</strong><br />" +
						    "Summit Elevation: <strong>" + volcanoes[iX].getAttribute("elevation") + " meters (" + 
							this.convertMetersToFeet(volcanoes[iX].getAttribute("elevation")) + " feet)</strong><br />" +
						    "Latitude, Longitude: <strong>" + latitude + latitudeNS + ", " + longitude + longitudeEW + "</strong><br />" +
						    moreInfoUrl +
						    "</div>";
	
						
						var vol_Title = "<strong>Volcano Catalog</strong><br />Information on " + volcanoName.toUpperCase();
						
						var marker = this.createMarker(pointLatLon, iconVolcano_General_White, iconVolcano_General_Shadow, vol_Title, 100, vol_Report);
	

						//markersVolcano_Catalog[iX] = marker;
						markersVolcano_Catalog.push(marker);
						
						if (iX == 0)
						{
							firstMarker = marker;
						}
						
					}   // Next volcano...
	


                   	markerclusterVolcanoCatalog.addMarkers(markersVolcano_Catalog);

	
					var sPhrase = "Showing " + volcanoes.length + " volcano";
					
					if (volcanoes.length != 1)
					{
						sPhrase += "es";
					}
					
					sPhrase += " from the catalog";
					
	
					document.getElementById('loadingMessage').style.visibility = 'hidden';
			
					document.getElementById('countVolcanoCatalogSearchResults').innerHTML = sPhrase;
	
	
					this.hideMenu();
					
					
					// If the database query returned one or more results, automatically center the map over the location of the first match, moderate zoom
					// level, and display the marker's information window...
					if (markersVolcano_Catalog.length > 0)
					{
						isWorldView = false;
						
						this.positionMap(jumptoLatitude, jumptoLongitude, 5);
						
						google.maps.event.trigger(firstMarker, 'click');
					}
				});	
			}
		}
		
		catch (ex1)
		{
			document.getElementById('errorMessage').innerHTML = "function 'fetchData_VolcanoCatalog' -- Error: " + ex1.description;
		}
	}

	
	function setCount_Volcano_USGS_VHP(colorCode)
	{
		try
		{
			var countVolcanoes = "";
			
			switch (colorCode)
			{
				case "RED":
					countVolcanoes = markersVolcano_USGS_VHP_Red.length + " volcano";
					if (markersVolcano_USGS_VHP_Red.length != 1) {countVolcanoes += "es"};
					
					document.getElementById("lblUSGS_VHP_Red").innerHTML = countVolcanoes;
					break;
					
		
				case "ORANGE":
					countVolcanoes = markersVolcano_USGS_VHP_Orange.length + " volcano";
					if (markersVolcano_USGS_VHP_Orange.length != 1) {countVolcanoes += "es"};
					
					document.getElementById("lblUSGS_VHP_Orange").innerHTML = countVolcanoes;
					break;
					
					
				case "YELLOW":
					countVolcanoes = markersVolcano_USGS_VHP_Yellow.length + " volcano";
					if (markersVolcano_USGS_VHP_Yellow.length != 1) {countVolcanoes += "es"};
					
					document.getElementById("lblUSGS_VHP_Yellow").innerHTML = countVolcanoes;
					break;
					
					
				case "GREEN_UNASSIGNED_SPECIAL_MONITORED":
					countVolcanoes = markersVolcano_USGS_VHP_GreenUnassigned_SpecialMonitored.length + " volcano";
					if (markersVolcano_USGS_VHP_GreenUnassigned_SpecialMonitored.length != 1) {countVolcanoes += "es"};
					
					document.getElementById("lblUSGS_VHP_GreenUnassigned_SpecialMonitored").innerHTML = countVolcanoes;
					break;
					
					
				case "GREEN":
					countVolcanoes = markersVolcano_USGS_VHP_Green.length + " volcano";
					if (markersVolcano_USGS_VHP_Green.length != 1) {countVolcanoes += "es"};
					
					document.getElementById("lblUSGS_VHP_Green").innerHTML = countVolcanoes;
					break;
					
					
				case "UNASSIGNED":
					countVolcanoes = markersVolcano_USGS_VHP_Unassigned.length + " volcano";
					if (markersVolcano_USGS_VHP_Unassigned.length != 1) {countVolcanoes += "es"};
					
					document.getElementById("lblUSGS_VHP_Unassigned").innerHTML = countVolcanoes;
					break;
			}
		}

		catch (ex1)
		{
			document.getElementById('errorMessage').innerHTML = "function 'setCount_Volcano_USGS_VHP' -- Error: " + ex1.description;
		}
	}



	function setLegendOverlay_Weather_NWS_Alerts()
	{
		
		try
		{
			// Clear out any existing NWS Alert Names & Colors overlay legend dataset...
			if (overlayLegend_Weather_NWS_Alerts != "")
			{
				mapLegendElements = mapLegendElements.replace(overlayLegend_Weather_NWS_Alerts, "");
			
				document.getElementById('overlayLegendBlock').innerHTML = mapLegendElements;
			}



			if (!document.myForm.checkboxWeather_NWS_Alerts.checked) return;



			this.downloadUrl(urlWeather_NWS_Alerts_NamesColors, function(data, responseCode)
			{
	
				// Init...
				arrayAlerts_Names_Colors = new Array();


				// To ensure against HTTP errors that result in null or bad data,
				// always check status code is equal to 200 before processing the data
				if(responseCode != 200)
				{
					document.getElementById('errorMessage').innerHTML = "Error fetching NWS Weather Alerts-Color Codes data, ResponseCode = " + responseCode;
				}
				else
				{
					data = this.subString_ExtractPiece(data, "Start legend", "End legend", false);
					
					while(true)
					{
						var work = this.subString_ExtractPiece(data, "<li><div id=\"", "</li>", false);

						if (work == "") break;
			
						work += "</li>";

						// Remove the current record so we don't select it again...
						data = data.replace(work, "");
			
			
						// Extract the NWS Alert Name and Alert Color values...
						var alertName = this.subString_ExtractPiece(work, "wwa=", "\"", true);
			
						var alertColor = "#" + this.subString_ExtractPiece(work, "<div id=\"z", "\"", true);

						// Put them together in the master list...
						if (alertName != "" & alertColor != "")
						{
							arrayAlerts_Names_Colors.push(alertName + "|" + alertColor);
						}
					}
				};


				if (arrayAlerts_Names_Colors.length > 0)
				{
					arrayAlerts_Names_Colors.sort();
		
					var overlayLegend = 
						"<span id=\"Legend_Weather_NWS_Alerts\" >" +
						"<center>" +
						"<strong>NWS Watches, Warnings & Advisories</strong>" +
						"</center>" +
						"<br />";
										
					for (var countAlertNames = 0; countAlertNames < arrayAlerts_Names_Colors.length; countAlertNames++) 
					{
						var oValues = arrayAlerts_Names_Colors[countAlertNames].split("|");
		
						var wordAlertNameUPPERCASE = oValues[0].toUpperCase();
						
						if (wordAlertNameUPPERCASE.indexOf(" WATCH") >= 0 | wordAlertNameUPPERCASE.indexOf(" WARNING") >= 0)
						{
							overlayLegend += "&nbsp;&nbsp;<span style=\"font-size:12px; background-color:" + oValues[1] + "; opacity: 1.0;\">&nbsp;&nbsp;&nbsp;&nbsp;</span>" +
											 "&nbsp;" + oValues[0] + "&nbsp;&nbsp;<br />";
						}
					}


					var workUpdated = this.subString_ExtractPiece(data, "Created: ", " UTC", true);
					workUpdated = workUpdated.replace(" at ", " ");

					dtUpdated = new Date(workUpdated);
					
					dtUpdated.setHours(dtUpdated.getHours() + (localOffset_Hours));
					
					
					overlayLegend += "<br />" +
									 "&nbsp;&nbsp;<span style=\"font-size:10x; font-weight:normal; color:#666\">Updated: " + this.formatLocalDateTimeString(dtUpdated, false) + "</span>&nbsp;&nbsp;" +
									 "<br /><br />" +
									 "</span>";
											
											
					overlayLegend_Weather_NWS_Alerts = overlayLegend;
				}
				
				
				// Update the map legend block...                    
				mapLegendElements = mapLegendElements + overlayLegend_Weather_NWS_Alerts;
				
				document.getElementById('overlayLegendBlock').innerHTML = mapLegendElements;
			});
		}

		
		catch (ex1)
		{
			document.getElementById('errorMessage').innerHTML = "function 'setLegendOverlay_Weather_NWS_Alerts' -- Error: " + ex1.description;
		}
	}

