// ========================================================================================
	function setIcons() {
		icons["cis"] = new GIcon(); 
		icons["cis"].image = "http://www.omahacomfortinn.com/images/map/circle.png"; 
		icons["cis"].shadow="http://www.omahacomfortinn.com/images/map/circles.png"; 
		icons["cis"].iconSize=new GSize(32, 32); 
		icons["cis"].shadowSize=new GSize(59, 32); 
		icons["cis"].iconAnchor=new GPoint(16,32); 
		icons["cis"].infoWindowAnchor=new GPoint(16,0); 

		icons["red"] = new GIcon(); 
		icons["red"].image = "http://www.omahacomfortinn.com/images/map/red.png"; 
		icons["red"].shadow="http://www.omahacomfortinn.com/images/map/shadow.png"; 
		icons["red"].iconSize=new GSize(16, 16); 
		icons["red"].shadowSize=new GSize(25.6, 16); 
		icons["red"].iconAnchor=new GPoint(8,16); 
		icons["red"].infoWindowAnchor=new GPoint(8,1.3333333); 
		icons["red"].infoShadowAnchor=new GPoint(18,25); 
		icons["red"].printImage="http://www.omahacomfortinn.com/images/map/redP.gif"; 
		icons["red"].mozPrintImage="http://www.omahacomfortinn.com/images/map/redM.gif"; 
		icons["red"].printShadow="http://www.omahacomfortinn.com/images/map/shadow.gif"; 
		icons["red"].transparent="http://www.omahacomfortinn.com/images/map/transparent.png";
		icons["red"].imageMap=[8,16,7,10,5,7,3.5,5,5,2,8,0,11,2,12.5,5,11,7,9,10];

		getIcon("black")
		getIcon("blue")
		getIcon("gray")
		getIcon("green")
		getIcon("lime")
		getIcon("orange")
		getIcon("pink")
		getIcon("turq")
		getIcon("white")
		getIcon("yellow")
	}

// ========================================================================================
	function getIcon(iconColor) {
		if ((typeof(iconColor)=="undefined") || (iconColor==null)) { 
			// iconColor = "red";
      return;
		}
		if (!icons[iconColor]) {
			icons[iconColor] = new GIcon(icons["red"]);
			icons[iconColor].image = "http://www.omahacomfortinn.com/images/map/"+ iconColor +".png";
			icons[iconColor].printImage="http://www.omahacomfortinn.com/images/map/"+iconColor+"P.gif"; 
			icons[iconColor].mozPrintImage="http://www.omahacomfortinn.com/images/map/"+iconColor+"M.gif"; 
		} 
	return icons[iconColor];
	} 

// ========================================================================================
	function getXMLfile(filename) {
		xmlhttp=null;
		if (window.XMLHttpRequest)
		  {// code for all new browsers
		  xmlhttp=new XMLHttpRequest();
		  }
		else if (window.ActiveXObject)
		  {// code for IE5 and IE6
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		if (xmlhttp!=null)
		  {
			if (filename.length == 0) {
				alert("Please enter a filename!");
				return false; 
			}
		  xmlhttp.open("GET",filename,false);
		  xmlhttp.send(null);

			if (xmlhttp.readyState==4)
			  {// 4 = "loaded"
			  if (xmlhttp.status==200)
			    {// 200 = OK
//		    alert("Retrieved XML Data");

					var xmlDoc  = GXml.parse(xmlhttp.responseText);
					var markers = xmlDoc.documentElement.getElementsByTagName("marker");

//				alert("processing "+markers.length+" markers");
      
					for (var tm = 0; tm < markers.length; tm++) {
						// obtain the attributes of each marker
						aType[tm] = markers[tm].getAttribute("typ");
						if 				(aType[tm] == "Hotel") {
							aIcon[tm] = 'cis';
						} else if	(aType[tm] == "Attractions") {
							aIcon[tm] = 'blue';
						} else if (aType[tm] == "Entertainment") {
							aIcon[tm] = 'pink';
						} else if (aType[tm] == "Event") {
							aIcon[tm] = 'orange';
						} else if (aType[tm] == "Golf") {
							aIcon[tm] = 'lime';
						} else if (aType[tm] == "Park") {
							aIcon[tm] = 'green';
						} else if (aType[tm] == "School") {
							aIcon[tm] = 'black';
						} else if (aType[tm] == "Shop") {
							aIcon[tm] = 'red';
						} else if (aType[tm] == "Theatre") {
							aIcon[tm] = 'turq';
						} else {
							aIcon[tm] = 'white';
						}
//						aIcon[tm] = markers[tm].getAttribute("icon");
						aLat[tm] 	= parseFloat(markers[tm].getAttribute("lat"));
						aLng[tm] 	= parseFloat(markers[tm].getAttribute("lng"));
						aLbl[tm] 	= markers[tm].getAttribute("label");
						if (markers[tm].getAttribute("html") > "") {
							aInfo[tm]	= '<a class=txtLink target=_blank href=http://'+markers[tm].getAttribute("html")+'>'+aLbl[tm]+'</a><br>'+markers[tm].getAttribute("addr1")+'<br>'+markers[tm].getAttribute("addr2")+'<br>'+markers[tm].getAttribute("typ")
							}
						else {
							aInfo[tm]	= aLbl[tm]+'<br>'+markers[tm].getAttribute("addr1")+'<br>'+markers[tm].getAttribute("addr2")+'<br>'+markers[tm].getAttribute("typ")
							}
						}	// end For Loop
					return true;
			    }
			  else
			    {
			    alert("Problem retrieving XML data");
			    }
			  }
		  }
		else
		  {
		  alert("Your browser does not support XMLHTTP.");
		  }
		}

// ========================================================================================
// automatically calculate center and zoom on bounds 
	GMap2.prototype.centerAndZoomOnBounds = function(bounds) { 
//		alert("centerAndZoomOnBounds");
		var largerBounds = bounds.extendByRatio(0.05); 
		var center_lat = 
			(largerBounds.getNorthEast().lat() + largerBounds.getSouthWest().lat()) / 2.0; 
		var center_lng = 
			(largerBounds.getNorthEast().lng() + largerBounds.getSouthWest().lng()) / 2.0; 
		var zoom = map.getBoundsZoomLevel(largerBounds);
		if (zoom > 12) {zoom = 12};
		map.setCenter(new GLatLng(center_lat, center_lng), zoom);
//	alert("Lat  = "+center_lat+"<br>"+"Lng  = "+center_lng+"<br>"+"Zoom = "+map.getZoom());
	}

// ========================================================================================
	GLatLngBounds.prototype.extendByRatio = function(ratio) { 
//		alert("extendByRatio");
		// initialize bounds to be the same as original 
		var largerBounds = new GLatLngBounds(this.getSouthWest(), this.getNorthEast()); 
		// get lat, lng of north east and south west 
		var northEastLat = this.getNorthEast().lat(); 
		var northEastLng = this.getNorthEast().lng(); 
		var southWestLat = this.getSouthWest().lat(); 
		var southWestLng = this.getSouthWest().lng(); 
		var diffLat = northEastLat - southWestLat; 
		var diffLng = northEastLng - southWestLng; 
		// multiply with ratio 
		northEastLat += diffLat * ratio; 
		southWestLat -= diffLat * ratio; 
		northEastLng += diffLng * ratio; 
		southWestLng -= diffLng * ratio; 
		// extend north east 
		if (northEastLat <   30) northEastLat = 41.345
		if (northEastLng < -100) northEastLng = -95.88
		largerBounds.extend(new GLatLng(northEastLat, northEastLng)); 
		// extend south west 
		if (southWestLat <   30) southWestLat = 41.345
		if (southWestLng < -100) southWestLng = -95.88
		largerBounds.extend(new GLatLng(southWestLat, southWestLng)); 
//  alert("NE: "+northEastLat+","+northEastLng);
//  alert("SW: "+southWestLat+","+southWestLng);
	return largerBounds; 
	} 
	
// ========================================================================================
// This function picks up the click and opens the corresponding info window
	function myclick(tm) {
		GEvent.trigger(aMarker[tm], "click");
	}