function initialize(coord1,coord2,datosmap)
{
      if (GBrowserIsCompatible()) 
	  {	

      	var map = new GMap2(document.getElementById("map_canvas"));
		map.setMapType(G_HYBRID_MAP);
        map.setCenter(new GLatLng(coord1[0],coord2[0]), 16);
		
		//creamos nuestro propio icono
	  	icono = new GIcon(G_DEFAULT_ICON, "/ico.jpg");
	  	icono.iconSize = new GSize(20, 35); //tamaņo
	  	icono.shadowSize = new GSize(20, 35); //tamaņo de la sombra
	  
	  
		function createMarker(point, message) 
		{
  			var marker = new GMarker(point,icono);
  			GEvent.addListener(marker, "click", function() 
												{
													var myHtml = message;
													map.openInfoWindowHtml(point, myHtml);
												});
  			return marker;
		}
		// AHORA COMPROBAMOS LOS PUNTOS QUE TENEMOS Y LOS CREAMOS EN NUESTRO MAPA
		for (i=0; i<=coord1.length-1;i++)
		{
			var point1 = new GLatLng(coord1[i],coord2[i]);
			map.addOverlay(createMarker(point1,datosmap[i]));	
		}
		
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
      	}
}

function initializeg(coord1,coord2,datosmap)
{
      if (GBrowserIsCompatible()) 
	  {	

      	var map = new GMap2(document.getElementById("map_canvas"));
		map.setMapType(G_HYBRID_MAP);
        map.setCenter(new GLatLng(coord1[0],coord2[0]), 16);
		
	  
		// Creates a marker whose info window displays the letter corresponding
		// to the given index.

		// Create a base icon for all of our markers that specifies the
		// shadow, icon dimensions, etc.
		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);


		function createMarker(point, index,message) 
		{
		  // Create a lettered icon for this point using our icon class
		  if(index > 19)
		  	{
				index2 = index - 20;
				var letter = String.fromCharCode("A".charCodeAt(0) + index2);
		 	 	var letteredIcon = new GIcon(baseIcon);
			  	letteredIcon.image = "http://www.google.com/mapfiles/marker_green" + letter + ".png";
			}
			else
			{
				var letter = String.fromCharCode("A".charCodeAt(0) + index);
		 	 	var letteredIcon = new GIcon(baseIcon); 
				letteredIcon.image = "http://www.google.com/mapfiles/marker" + letter + ".png";
			}
		
		  // Set up our GMarkerOptions object
		  markerOptions = { icon:letteredIcon };
		  var marker = new GMarker(point, markerOptions);
		
		  GEvent.addListener(marker, "click", function() 
													   {
															var myHtml = message;
															map.openInfoWindowHtml(point, myHtml);
		  });
		  return marker;
		}
		
		// AHORA COMPROBAMOS LOS PUNTOS QUE TENEMOS Y LOS CREAMOS EN NUESTRO MAPA
		for (i=0; i<=coord1.length-1;i++)
		{
			var point1 = new GLatLng(coord1[i],coord2[i]);
			map.addOverlay(createMarker(point1,i,datosmap[i]));	
		}
		
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
      	}
}

function cambiarImagen()
{
	var valor = Math.ceil(Math.random()*4);
	var src="/images/cabecera" + valor + ".jpg";
    document.images[1].src = src;
}

function cambiarImagenV()
{
	var valor = Math.ceil(Math.random()*4);
	var src="/images/cabecerav" + valor + ".jpg";
    document.images[1].src = src;
}
