var map;

function showAddress(address)
{    
        if(address != '')
        {
        // Create a map object
	var map = new YMap(document.getElementById('map'));
        
	// Set map type to either of: YAHOO_MAP_SAT, YAHOO_MAP_HYB, YAHOO_MAP_REG
	map.setMapType(YAHOO_MAP_REG);

	// Display the map centered on a geocoded location	
	map.drawZoomAndCenter(address, 4);
	map.addPanControl();
	map.addZoomLong();
	
	YEvent.Capture(map, EventsList.endMapDraw, reportPosition);

	function reportPosition(_e, _c){
		// It is optional to specify the location of the Logger. 
		// Do so by sending a YCoordPoint to the initPos function.
		var mapCoordCenter = map.getCenterLatLon();

		var geoPoint = new YGeoPoint(mapCoordCenter.Lat, mapCoordCenter.Lon);
                map.addOverlay(new YMarker(geoPoint,null,'1'));
	}
        }
        else
        {
               var NOmap = document.getElementById('map');
               NOmap.style.display = 'none';
        }
}
