






function SearchMap_Init(whichDirectory, sid) {
	if(GBrowserIsCompatible()) {
	
		// Setup map..
		var map = new GMap2(document.getElementById("searchmap_canvas"));
		map.setCenter(new GLatLng(54.5, -3.8), 5);
		map.addControl(new GSmallMapControl());
		

		// Handle mouse clicks..
		GEvent.addListener(map,"click", function(overlay,latlng) {
			if(overlay) {  return;  }
			//var tileCoordinate = new GPoint();
			var tilePoint = new GPoint();
			var currentProjection = G_NORMAL_MAP.getProjection();
			tilePoint = currentProjection.fromLatLngToPixel(latlng, map.getZoom());
			
			// Send click data..
			SearchMap_Click(latlng.lng(), latlng.lat(), whichDirectory, sid);	
		});
	
	}else {
		alert("Your browser is not capable of running the Google Maps software, you should update your browser as all modern browsers should be compatible.");
	}
}




function SearchMap_Click(long, lat, whichDirectory, sid) {
	
	window.open("../quick-search.php/submit-" + whichDirectory + "/" + long + "," + lat + "/?sid=" + sid, "_self");
	
}





