
	// Load the map pins
	function FetchMapPinsData( mouseX, mouseY ) {

		var xmlDoc;
		
		if (document.implementation && document.implementation.createDocument) {
			xmlDoc = document.implementation.createDocument("", "", null);
		}
		else if (window.ActiveXObject) {
			xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		}
		
		var sURL = "http://" + Domain + "/" + Virtual + "/dialogbox_Mappins.asp";
		
		xmlDoc.async = false; // Tell the Xml document to wait until the document has been complete read
		xmlDoc.load( sURL );
		
		displayMapPins(xmlDoc);
		
		xmlDoc = null;
		
	}

	function displayMapPins(xmlDoc) {

		var x = 0;
		var i = 0;
		var sHTML = "";

		var sElement = "";
		var pinName = "";
		var pinEasting = "";
		var pinNorthing = "";
		var pinMapWidth = "";

		rootNode = xmlDoc.documentElement;

		if ( rootNode.childNodes.length > 0 ) {

			sHTML += "<table title=\"Points of Interest\" width=\"250\">";
			sHTML += "<tr>";
			sHTML += "<td width=\"250\" colspan=\"2\"><p><h3><font color=\"#336699\">Points of Interest</font></h3></p></td>";
			sHTML += "</tr>";
			sHTML += "<tr>";

			if ( rootNode.nodeName == "PlanAccessError" ) {

				if (BrowserName == "Netscape") {
					sHTML += "<td width=\"130\" colspan=\"2\">" + rootNode.childNodes.item(0).childNodes.item(1).firstChild.nodeValue + "</td></tr>";
				} else {
					sHTML += "<td width=\"130\" colspan=\"2\">" + rootNode.childNodes.item(0).childNodes.item(1).text + "</td></tr>";
				}

			} else {

				sHTML += "<td width=\"130\" colspan=\"2\"><select size=1 id=mappins style=\"width:240;\">";

				for ( x = 0; x < rootNode.childNodes.length; x++ ) {

					if ( rootNode.childNodes.item(x).nodeName != '#text' ) {

						var pin = rootNode.childNodes.item(x)

						pinName = pin.getAttribute("Title");
						pinEasting = pin.getAttribute("Easting");
						pinNorthing = pin.getAttribute("Northing");
						pinMapWidth = pin.getAttribute("MapWidth");

						if (BrowserName == "Netscape") {

							sElement = pinEasting + "," + pinNorthing + "," + pinMapWidth;

							sHTML += "<option value='" + sElement + "'>" + pinName + "</option>";

						} else {  // Internet Explorer

							sElement = pinEasting + "," + pinNorthing + "," + pinMapWidth;

							sHTML += "<option value='" + sElement + "'>" + pinName + "</option>";

						}
					}

				}

			}

			sHTML += "</select></td></tr>";

		}		

		sHTML += "<td width=\"160\" align=left>&nbsp;</td>";
		sHTML += "<td width=\"100\" align=right><p><img src=\"images/buttons/find_up.gif\" alt=\"Find\" title=\"Find\" onclick=\"SelectPin()\"></p></td>";
		sHTML += "</table>";

		mappinsTag.innerHTML = sHTML;

	}

	// When the user has selected a map pin
	function SelectPin() {

		var obj = mappins.value;

		// Split the map pin coordinates
		var SingleArraySplit = obj.split(",");

		Easting = parseInt(SingleArraySplit[0]);
		Northing = parseInt(SingleArraySplit[1]);
		Zoom = parseInt(SingleArraySplit[2]);

		// Select the correct zoom level
		SelectZoomLevelIndicator();

		UpdateMap();

		QueryTitle.innerHTML = "<h3><font color=\"#336699\">Results of Points of Interest &#8211; Click Address to Locate on the Map</font></h3>";
	}
