// Inicio del comportamiento de mapa
var capaMapa = 'mapa_google'; // Identificador de la capa que contiene el mapa
var elementoDireccion = 'info_mapa'; // Identificador del elemento que contiene la dirección

google.load("maps", "2.x");
google.setOnLoadCallback(initializeGmap);

function initializeGmap() {
	
		ubicacion = document.getElementById(elementoDireccion).firstChild.nodeValue;
		showAddress(ubicacion);
	
}
function showAddress(address,zoom) {
	mapa = document.getElementById(capaMapa);
	var map = new GMap2(mapa);
	
	var geocoder = new GClientGeocoder();
	map.addControl(new GSmallMapControl());
	
	geocoder.getLatLng(
		address,function(point) {
			if (!point) {
				alert('La dirección "'+address+'" no se encuentra.');
			} else {
				map.setCenter(point, 16);
				var icono = new GIcon(G_DEFAULT_ICON);
				var marker = new GMarker(point, {draggable: false});
				map.addOverlay(marker);
			}
		}
	);
}
