<!-- hide script from old browsers

// create map variable
var map;

function createMap(dblLatitude, dblLongitude, enumType, lngZoom) {
// creates a map with a single event marker and small zoom controls
// and centers it on the event coordinates
	if (GBrowserIsCompatible()) {
	// checks for compatible browser
		map = new GMap(document.getElementById("map"));
		map.addControl(new GSmallZoomControl());
		map.setCenter(new GLatLng(dblLatitude, dblLongitude), lngZoom);
		map.enableDoubleClickZoom();
		var icon = createEventIcon(enumType);
		var point = new GLatLng(dblLatitude, dblLongitude);
        	var marker = new GMarker(point, icon);
		map.addOverlay(marker);
	// } else {
	// message for incompatible browsers
		// document.write("&nbsp;<p/>your browser is not compatible with our maps. See the <a  href=\"http://www.google.co.uk/help/faq_maps.html#addto\" class=\"normal\">google maps documentation</a> for browser compatibility details");
	}
}

function createMediumMap(dblLatitude, dblLongitude, lngZoom) {
// creates a map with a single event marker and large zoom controls
// and centers it on the event coordinates
	if (GBrowserIsCompatible()) {
	// checks for compatible browser
		map = new GMap(document.getElementById("map"));
		map.addControl(new GLargeMapControl());
		map.addControl(new GScaleControl());
		map.setCenter(new GLatLng(dblLatitude, dblLongitude), lngZoom);
		var point = new GLatLng(dblLatitude, dblLongitude);
		var marker = new GMarker(point);
		map.addOverlay(marker);
	// } else {
	// message for incompatible browsers
		// document.write("&nbsp;<p/>your browser is not compatible with our maps. See the <a  href=\"http://www.google.co.uk/help/faq_maps.html#addto\" class=\"normal\">google maps documentation</a> for browser compatibility details");
	}
}

function createMapNoMarkers(dblLatitude, dblLongitude, lngZoom) {
// creates a large map with no markers and large zoom controls, for displaying markers
	if (GBrowserIsCompatible()) {
		map = new GMap(document.getElementById("map"));
		map.addControl(new GLargeMapControl());
		map.addControl(new GScaleControl());
		map.setCenter(new GLatLng(dblLatitude, dblLongitude), lngZoom);

	}
}

function createMapForPlacingMarkers(dblLatitude, dblLongitude, lngZoom) {
// creates a small map with no markers and large zoom controls, with cursor set for placing a marker
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map"), {draggableCursor: 'crosshair', draggingCursor: 'pointer'});
		map.addControl(new GLargeMapControl());
		map.addControl(new GScaleControl());
		map.setCenter(new GLatLng(dblLatitude, dblLongitude), lngZoom);
		map.enableDoubleClickZoom();


	}
}

function createEventMarker(dblLatitude, dblLongitude, eventName, enumType, eventID) {
// creates a marker on a previously created map, and adds callout window with link to event

		var icon = createEventIcon(enumType);
		var point = new GLatLng(dblLatitude, dblLongitude);
        	var marker = new GMarker(point, icon);
		// var marker = new GMarker(point);
		var html = "&nbsp;<br/><a href=\"eventsummary.php?eventID=" + eventID + "\" class=\"normal\">";
		html = html + eventName  + "</a>";
  		GEvent.addListener(marker, "click", function() {
    		marker.openInfoWindowHtml(html);
  		});
        	map.addOverlay(marker);

		// add mouseover text
		//var topElement = marker.iconImage;
   		//if (marker.transparentIcon) {topElement = marker.transparentIcon;}
   		//if (marker.imageMap) {topElement = marker.imageMap;}
        //topElement.setAttribute( "title" , eventName);

}

function createEventIcon(enumType) {

// Create an event marker icon based on the type of event
		var baseIcon = new GIcon();
		baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
		baseIcon.iconSize = new GSize(20, 34);
		baseIcon.shadowSize = new GSize(37, 34);
		baseIcon.iconAnchor = new GPoint(9, 34);
		baseIcon.infoWindowAnchor = new GPoint(9, 2);
		baseIcon.infoShadowAnchor = new GPoint(18, 25);
		var icon = new GIcon(baseIcon);

		if (enumType == 'accident') {
		// if accident, specify accident icon
			icon.image = "./images/markerAccident.png";
		} else if (enumType == 'robbery') {
			icon.image = "./images/markerRobbery.png";
		}

		return icon;

}

function getLatLon(latElementID, longElementID) {
// get latitude and longitude of a click, pan map, move marker, and return coordinates to longElementID and latElementID
	GEvent.addListener(map, "click", function(overlay, point){
		map.clearOverlays();
		if (point) {
			map.addOverlay(new GMarker(point));
			map.recenterOrPanToLatLng(point);
			longMsg = point.x;
			latMsg = point.y;
			document.getElementById(longElementID).value = longMsg;
			document.getElementById(latElementID).value = latMsg;
		}
	})
}

// end hiding script from old browsers -->