	  var E_STYLE_1 = new EStyle("ewindow", new GPoint(-70,10));
	  var E_STYLE_2 = new EStyle("ewindow", new GPoint(-70,10));

	  function EStyle(boxClass, boxOffset) {
		this.boxClass = boxClass;
		this.boxOffset = boxOffset;
	  }

      function EWindow(map,estyle) {
        // parameters
        this.map=map;
        this.estyle=estyle;
        // internal variables
        this.visible = false;
        // browser - specific variables
        this.ie = false;
        var agent = navigator.userAgent.toLowerCase();
        if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") < 1)){ this.ie = true} else {this.ie = false}
      } 
      
      EWindow.prototype = new GOverlay();

      EWindow.prototype.initialize = function(map) {
        var div1 = document.createElement("div");
        div1.style.position = "absolute";
        map.getPane(G_MAP_FLOAT_PANE).appendChild(div1);
        
	

		this.div1 = div1;
        
      }

      EWindow.prototype.openOnMap = function(point, html, offset) {
        this.offset = offset||new GPoint(0,0);
        this.point = point;
        this.div1.innerHTML = '<div class="' + this.estyle.boxClass + '"><nobr>' + html + '</nobr></div>';
        

        var z = GOverlay.getZIndex(this.point.lat());
        this.div1.style.zIndex = z;
        
		
        
		this.visible = true;
        this.show();
        this.redraw(true);
      }
      
      EWindow.prototype.openOnMarker = function(marker,html) {
        var vx = marker.getIcon().iconAnchor.x - marker.getIcon().infoWindowAnchor.x;
        var vy = marker.getIcon().iconAnchor.y - marker.getIcon().infoWindowAnchor.y;
        this.openOnMap(marker.getPoint(), html, new GPoint(vx,vy));
      }
      

      EWindow.prototype.redraw = function(force) {
        if (!this.visible) {return;}
        var p = this.map.fromLatLngToDivPixel(this.point);
        
        this.div1.style.left   = (p.x + this.offset.x + this.estyle.boxOffset.x) + "px";
        this.div1.style.bottom = (-p.y + this.offset.y + this.estyle.boxOffset.y) + "px";
      }

      EWindow.prototype.remove = function() {
        this.div1.parentNode.removeChild(this.div1);
        
        this.visible = false;
      }

      EWindow.prototype.copy = function() {
        return new EWindow(this.map, this.estyle);
      }

      EWindow.prototype.show = function() {
        this.div1.style.display="";
        
        this.visible = true;
      }
      
      EWindow.prototype.hide = function() {
        this.div1.style.display="none";
        
        this.visible = false;
      }
      
      EWindow.prototype.isHidden = function() {
        return !this.visible;
      }
      
      EWindow.prototype.supportsHide = function() {
        return true;
      }

      EWindow.prototype.zindex = function(zin) {
        var z = GOverlay.getZIndex(this.point.lat());
        this.div1.style.zIndex = z+zin;
       
      }

	function createMarkerClick(point,html) {
        var marker = new GMarker(point);
        // ========== Open the EWindow instead of a Google Info Window ==========
        GEvent.addListener(marker, "click", function() {
          ew.openOnMarker(marker,html);
        });
        return marker;
      }

	/*
	function createMarkerOver(point,html) {
        var marker = new GMarker(point);
        // ========== Open the EWindow instead of a Google Info Window ==========
        GEvent.addListener(marker, "mousedown", function() {
          ew.openOnMarker(marker,html);
        });
        return marker;
      }
	*/

	function mapsinitialize() {
		if (GBrowserIsCompatible()) {
			var startZoom = 14;
			var map = new GMap2(document.getElementById("map"));

			if (is_largermap) {
				startZoom = 10;
			}
			map.addControl(new GSmallMapControl());
			if (is_largermap) {
				map.addControl(new GMapTypeControl());
			
			}

			map.setCenter(new GLatLng(centerLatitude, centerLongitude), startZoom);

			//if (is_largermap) { 
			//	map.setMapType(G_HYBRID_MAP);
			//}


			// Create an EWindow
			ew = new EWindow(map, E_STYLE_1);      
			map.addOverlay(ew);
      
			

			function pretty(a,b) {
				return '<table border="0" cellpadding="0" cellspacing="0"><tr><td width="100%" class="etitleSmall" nowrap>' + a +
					'&nbsp;<a href="javascript:ew.hide()"><img width="14" height="13" title="Close This" src="/images/global/cross.gif" border=0 ></a>' +
					'</td></tr>' +
					'<tr><td nowrap>' + b + '</td></tr></table>';
			}

			/*
			function prettyLarge(a,b) {
				return '<table border="0" cellpadding="0" cellspacing="0"><tr><td width="100%" class="etitleSmall" nowrap>' + a +
					'<a href="javascript:ew.hide()"><img width="14" height="13" title="Close This" src="/images/global/cross.png" border=0 style="right:6px; top:6px"></a>' +
					'</td></tr>' +
					'<tr><td nowrap>' + b + '</td></tr></table>';
			}
			*/

			for (var i = 0; i < markersArray.length; i++) {
				
				var point = new GLatLng(markersArray[i]['posn'][0],markersArray[i]['posn'][1]);
				
				if (is_largermap) {
					var html = '<div class="etitleLarge">' + markersArray[i]['title'] + '</div>';
					var marker = createMarkerClick(point,html);				
				} else {
					var link = '/map.php?title=' + markersArray[i]['title'] + '&latitude=' + markersArray[i]['posn'][0] + '&longitude=' + markersArray[i]['posn'][1];
					var html = pretty(markersArray[i]['title'],'<strong><a href="' + link + '">View Larger Map</a></strong>'); 
					var marker = createMarkerClick(point,html);
				}
				map.addOverlay(marker);

				/*
				var latlng = new GLatLng(); 
				var html = markersArray[i]['title']; 
				map.addOverlay(createMarker(latlng, title));
				*/

			}

			// ========== Close the EWindow if theres a map click ==========
			
			GEvent.addListener(map, "click", function(marker,point) {
				if (point) {
					ew.hide();
				}
			});			

	}
}

// This Javascript is based on code provided by the
// Blackpool Community Church Javascript Team
// http://www.commchurch.freeserve.co.uk/   
// http://econym.googlepages.com/index.htm
// Thanks Mike Williams for providing such a useful Google Maps code base
// If you use this script, donate to the Blackpool Community Church
// 



