
function initGmap(){

	if(W3CDOM) e.addEvent(window, "unload", GUnload, false);

	if (GBrowserIsCompatible()) {

		function createMarker(point, address, nombre) {

/*
			var icon = new GIcon();
			icon.image = "/design/fiesta/images/ico/gmap.gif";
			icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
			icon.iconSize = new GSize(35, 29);
			icon.shadowSize = new GSize(36, 23);
			icon.iconAnchor = new GPoint(17, 14);
			icon.infoWindowAnchor = new GPoint(35, 0);
			var marker = new GMarker(point, icon);
*/
			var marker = new GMarker(point);

/*
			var html = 'ej.';
			GEvent.addListener(marker, "click", function() {
				marker.openInfoWindowHtml(html);
			});
*/
			return marker;
		}


		// Display the map, with some controls and set the initial location
		map = new GMap2(document.getElementById("googlemap"));
		map.addControl(new GSmallMapControl());
		//map.addControl(new GMapTypeControl());
		//map.addControl(new GScaleControl());

		for(var i=0; i<gLocations.length; i++){
			var loc = gLocations[i];
			var myPoint = new GLatLng(loc['latitud'], loc['longitud']);
			if(loc['isMain'] == true){
				map.setCenter(myPoint, loc['zoom']);
			}
		}

		for(var i=0; i<gLocations.length; i++){
			var loc = gLocations[i];
			var myPoint = new GLatLng(loc['latitud'], loc['longitud']);

			var myMarker = createMarker(myPoint, loc['address'], loc['name'] );

			if(loc['isMain'] == true){
			//alert(i + "\n\n"+htmls[i]);
				//myMarker.openInfoWindowHtml(htmls[i]);
			}

			map.addOverlay(myMarker);

		}



	} else {
	  //alert("Sorry, the Google Maps API is not compatible with this browser");
	}


}

