	// This is the function to record the mouse click on the map and allow free recording of a location on the map. JC 2006
	function ZoomPoint() 
{
		//code jc to record mouse click
		map.onmousedown = ZoomPoint;
		map.onmouseup = NoMouseEvent;
		map.onmousemove = NoMouseEvent;

		map.style.cursor = "crosshair";
		
		var xA = event.offsetX;
		var yA = event.offsetY;
		var EastingA;
		var NorthingA;
		
		// Calculate the new bounds
		var mapXA1 = Easting - ( Zoom / 2 );
		var mapXA2 = Easting + ( Zoom / 2 );
		var mapYA1 = Northing - ( Zoom / 2 );
		var mapYA2 = Northing + ( Zoom / 2 );

		// New Easting and Northing
		EastingA = parseFloat((xA / MapWidth * (mapXA2 - mapXA1) + mapXA1));
		NorthingA = parseFloat(mapYA2 - yA / MapHeight * (mapYA2 - mapYA1));
		EastingA = Math.round(EastingA);
		NorthingA = Math.round(NorthingA);
		// alert("newE=" + EastingA + " newN=" + NorthingA);
		
		
		
		function NoMouseEvent() { 
		// Do Nothing 
		}
		
//		getNorthingA(NorthingA);  // attempt to globalise the updated northing
//		function getNorthingA(iNorthingA)
//		{
//			var NoA = iNorthingA;
//			alert(NoA);
//		}

//		if (Zoom > 1999) //to prevent users selecting a vague point on the map
//		{
//			alert("Please use the buttons below the map to Zoom in closer and more accurately identify the location");
//			tCount = 0;
//		}
//		else if ((Zoom <= 1999) && (tCount == 0))
//		{
//
//			map.onmousedown = ZoomPoint;
//			var loc = "Easting: " + EastingA  + " Northing: " + NorthingA; 
//			//alert("loc = " + loc);
//			//document.getElementById('EastingA').value = EastingA;
//			//document.getElementById('NorthingA').value = NorthingA; 
//			//document.getElementById('location').value = loc;
//			alert("Clicking on the map will record that location. Then you can Submit the Problem Report");
//			tCount++;			
//		}
//			
//		else if  ((Zoom <= 1999) && (tCount >= 1))
//		{
//			map.onmousedown = ZoomPoint;
//			var loc = "Easting: " + EastingA  + " Northing: " + NorthingA; 
//			document.getElementById('EastingA').value = EastingA;
//			document.getElementById('NorthingA').value = NorthingA; 
//			document.getElementById('location').value = loc;
//			document.getElementById('zoom').value = Zoom;
//			alert("The map location has now been recorded ("+loc+"). You can now Submit the Problem Report");
//			tCount = 0;
//		}
		
} // closes zoompoint method
	
