function onLoad() {
	if (GBrowserIsCompatible()) {
		var map= new GMap(document.getElementById("map"));
		
		var count= 0;
		var point1= null;

		GEvent.addListener(map, "click", function(overlay, point){
			if (overlay){
				map.clearOverlays();
				count= 0;
			}
	    		if (count<2 && point){
		    		count++;
	    	    	map.addOverlay(new GMarker(point));
	    	    
	    	    	if (count==1){
	    	    		point1= point;
	    	    	}
	    	    	else if (count==2){
				document.getElementById("z").innerHTML= map.getZoom();
				var pix= map.getCurrentMapType().getProjection().fromLatLngToPixel(point1, map.getZoom());
				document.getElementById("x1").innerHTML= pix.x;
				document.getElementById("y1").innerHTML= pix.y;
				pix= map.getCurrentMapType().getProjection().fromLatLngToPixel(point, map.getZoom());
				document.getElementById("x2").innerHTML= pix.x;
				document.getElementById("y2").innerHTML= pix.y;
			}
	    	}
	    })
	         
		map.addControl(new GMapTypeControl());
		map.addControl(new GLargeMapControl());
		map.addControl(new GScaleControl());
		map.setCenter(new GLatLng(0, 0), 2);
	}
    // display a warning if the browser was not compatible
    else {
		alert("Sorry, the Google Maps API is not compatible with this browser");
    }
}