// JavaScript Document
function initialize() {
    if (GBrowserIsCompatible()) {
        
        // Create and Center a Map
        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(39.479367, -0.380324), 15);
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
 
        // bind a search control to the map, suppress result list
        map.addControl(new google.maps.LocalSearch(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,10)));
		var baseIcon = new GIcon(G_DEFAULT_ICON);
		baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
		baseIcon.iconSize = new GSize(20, 34);
		baseIcon.shadowSize = new GSize(37, 34);
		baseIcon.iconAnchor = new GPoint(9, 34);
		baseIcon.infoWindowAnchor = new GPoint(9, 2);
	 
		// Creates a marker whose info window displays the letter corresponding
		// to the given index.
		function createMarker(point, index) {
			// Create a lettered icon for this point using our icon class
			var letter = String.fromCharCode("A".charCodeAt(0) + index);
			var letteredIcon = new GIcon(baseIcon);
			letteredIcon.image ="images/casita.gif";
		 
			// Set up our GMarkerOptions object
			markerOptions = { icon:letteredIcon };
			var marker = new GMarker(point, markerOptions);
			GEvent.addListener(marker, "click", function() {
					marker.openInfoWindowHtml("Casa Angelitos <br> Calle de Los Sogueros 15 pta 4<br>46003 Valencia, Spain");
			});
			return marker;
		}
		var latlng = new GLatLng(39.479367, -0.380324);
		map.addOverlay(createMarker(latlng, 1));
	}
}
//GSearch.setOnLoadCallback(initialize);