//========================================================
// GOOGLE MAP FUNCTIONS
//========================================================

// UK longitude and latitudes
var GLOBAL_longUK 			= '-2.04';
var GLOBAL_latUK			= '53.26';	


//========================================================
// DISPLAY UK ADDRESS POINTER FROM LONG & LAT
//========================================================
function DisplayAddressPointerIcon(map, maplat, maplong, comment, icon, sendToURL) {
	var point = new GLatLng(maplat, maplong);
	
	var marker = new GMarker(point,icon);
	map.addOverlay(marker);

	GEvent.addListener(marker, "click", function() { 
		marker.openInfoWindowHtml(comment); 
	}); 
	
	GEvent.addListener(marker, "mouseover", function() {
		marker.openInfoWindowHtml(comment);
	});	
}

//========================================================
// DISPLAY UK ADDRESS POINTER FROM UK POSTCODE
//========================================================
/*
function DisplayAddressPointerIcon(geocoder, map, address, comment, icon, sendToURL) {
	if (geocoder) {
		geocoder.getLatLng(address,
			function(point) {
				if (!point) {
					//alert(address + " not found");
				} else {
					var marker = new GMarker(point, icon);
					map.addOverlay(marker);
		
					GEvent.addListener(marker, "mouseover", function() {
						marker.openInfoWindowHtml(comment);
					});						
					
					GEvent.addListener(marker, "click", function() {
						marker.openInfoWindowHtml(comment);
						//location.href=sendToURL
					});
					
					return marker;
				}
			}
		);
	}
}
*/

//========================================================
// DISPLAY UK ADDRESS POSITION AND POINTER FROM LONG & LAT
//========================================================
function ShowAddress(map, maplat, maplong, comment) {
	var point = new GLatLng(maplat, maplong);
	map.setCenter(point, 13);	
	
	var marker = new GMarker(point);
	map.addOverlay(marker);

	GEvent.addListener(marker, "click", function() { 
		marker.openInfoWindowHtml(comment); 
	}); 
	
	GEvent.addListener(marker, "mouseover", function() {
		marker.openInfoWindowHtml(comment);
	});	
}
//========================================================
// DISPLAY UK ADDRESS POSITION AND POINTER FROM UK POSTCODE
//========================================================
/*
function ShowAddress(geocoder, map, address, comment) {
	if (geocoder) {
		geocoder.getLatLng(address,
			function(point) {
				if (!point) {
					//alert(address + " not found");
				} else {
					map.setCenter(point, 13);
					var marker = new GMarker(point);
					map.addOverlay(marker);

					GEvent.addListener(marker, "click", function() { 
						marker.openInfoWindowHtml(comment); 
					}); 
					
					GEvent.addListener(marker, "mouseover", function() {
						marker.openInfoWindowHtml(comment);
					});	
					
					//marker.openInfoWindowHtml(comment);
					
					return marker;					
				}
			}
		);
	}
}
*/

//========================================================
// ICON SETUP
//========================================================
var defaultIcon = null;

var redIcon = new GIcon();
redIcon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
redIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
redIcon.iconSize = new GSize(12, 20);
redIcon.shadowSize = new GSize(22, 20);
redIcon.iconAnchor = new GPoint(5,20);
redIcon.infoWindowAnchor = new GPoint(5, 1);

var blueIcon = new GIcon();
blueIcon.image = "http://labs.google.com/ridefinder/images/mm_20_blue.png";
blueIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
blueIcon.iconSize = new GSize(12, 20);
blueIcon.shadowSize = new GSize(22, 20);
blueIcon.iconAnchor = new GPoint(5,20);
blueIcon.infoWindowAnchor = new GPoint(5, 1);	

var greenIcon = new GIcon();
greenIcon.image = "http://labs.google.com/ridefinder/images/mm_20_green.png";
greenIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
greenIcon.iconSize = new GSize(12, 20);
greenIcon.shadowSize = new GSize(22, 20);
greenIcon.iconAnchor = new GPoint(5,20);
greenIcon.infoWindowAnchor = new GPoint(5, 1);	

var yellowIcon = new GIcon();
yellowIcon.image = "http://labs.google.com/ridefinder/images/mm_20_yellow.png";
yellowIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
yellowIcon.iconSize = new GSize(12, 20);
yellowIcon.shadowSize = new GSize(22, 20);
yellowIcon.iconAnchor = new GPoint(5,20);
yellowIcon.infoWindowAnchor = new GPoint(5, 1);	