    var map = null;
    var geocoder = null;
    var marker = null;
    function initialize(){
        if (GBrowserIsCompatible()){
            map = new GMap2(document.getElementById("mappina"));
            map.addControl(new GSmallMapControl());
            var center = new GLatLng(53.3464524,-6.2731934);
            map.setCenter(center, 5);
            marker = new GMarker(center, {draggable: true});
            map.addOverlay(marker);
            geocoder = new GClientGeocoder();
            GEvent.addListener(marker, "dragend", 
                               function(){
                                  var pt = marker.getPoint();
	                              map.panTo(pt);
				      document.getElementById("lat").value = pt.lat().toFixed(7);
	                              document.getElementById("lon").value = pt.lng().toFixed(7);
                               });
        }
    }
    function showAddress(){
      if (geocoder){
          var address = document.getElementById("address").value + ", "
                        + document.getElementById("county").options[document.getElementById("county").selectedIndex].text+ ", "
                        + document.getElementById("town").options[document.getElementById("town").selectedIndex].text+" Ireland";
          geocoder.getLatLng(address,
                         function(point) {
                               if (!point){
                                   //alert(address + " not found");
                               }else{
                                   map.setCenter(point, 13);
                                   map.clearOverlays();
                                   marker = new GMarker(point, {draggable: true});
                                   map.addOverlay(marker);
                                   var pt = marker.getPoint();
                                   document.getElementById("lat").value = point.lat().toFixed(7);
                                   document.getElementById("lon").value = point.lng().toFixed(7);
                                   GEvent.addListener(marker, "dragend", 
                                      function(){
                                         var pt = marker.getPoint();
                                          map.panTo(pt);
                                         document.getElementById("lat").value = pt.lat().toFixed(7);
                                         document.getElementById("lon").value = pt.lng().toFixed(7);
                                      });
                               }
                           }
                       );
      }
    }
    
    function displayHidBoxes(){
    	alert(document.getElementById("lat").value + " " + document.getElementById("lon").value);
    }

