function fwGMapBuild(map, address, zoom, mapType, mapControl, typeControl, metric, scale, overview, useMarker, fontFamily, text, item)
{
	var fwMap = new GMap2(document.getElementById(map));
	_mPreferMetric = metric;
	geocoder = new GClientGeocoder();
	showAddress(address, zoom, fwMap, useMarker, fontFamily, text, item);
	fwMap.setMapType(mapType);
	if(typeControl)
		fwMap.addControl(typeControl);
	if(mapControl)
		fwMap.addControl(mapControl);
	if(scale)
		fwMap.addControl(scale);
	if(overview)
		fwMap.addControl(overview);
  }
 
function showAddress(address, zoom, fwMap, useMarker, fontFamily, text, item)
{
	geocoder.getLatLng(address, function(point) {
		if (!point)
			alert(address + " not found");
		else  {
			if(address.match(/-?\d*?\.\d*?\,\s-?\d*?\.\d*?/))
			{
				fwMap.setCenter(new google.maps.LatLng(address.split(",")[0], address.split(",")[1]), zoom);
				if(useMarker) {
					var marker = new GMarker(new google.maps.LatLng(address.split(",")[0], address.split(",")[1]));
					fwMap.addOverlay(marker);
				}
			}
			else
			{
				fwMap.setCenter(point, zoom);
				if(useMarker) {
					var marker = new GMarker(point);
					fwMap.addOverlay(marker);
				}
			}
			if(text)
				marker.openInfoWindowHtml("<div style=\"width: 210px; padding-right: 10px; font-size:12px; font-family:"+fontFamily+";\">"+text+"</"+"div>");
			else if(item)
				marker.openInfoWindowHtml("<div style=\"width: 210px; padding-right: 10px;\">"+document.getElementById(item).innerHTML+"</"+"div>");
		}
	});
}
 
 
function fwGMapInit()
{
	fwGMapBuild('fwGeneratedMap1', '45.665317, 13.104548', 15, G_NORMAL_MAP, new GLargeMapControl(), new GMapTypeControl(), true, new GScaleControl(), new GOverviewMapControl(), true, 'Times,\'Times New Roman\',serif', 'Agenzia Immobiliare Casarsa Christian, Arco del Libeccio 17 (Pineta) - LIGNANO SABBIADORO (Italy)', '');
	
}




