    var baseIcon = new GIcon();
	baseIcon.iconSize = new GSize(15, 19);
	baseIcon.iconAnchor = new GPoint(8, 19);
	baseIcon.infoWindowAnchor = new GPoint(8, 1);
	baseIcon.image = "/static/images/logomini.png";
	var map; 

        function init() 
		{
			if (GBrowserIsCompatible()) 
		  	{
		        map = new GMap2(document.getElementById("mapa"));
		        var point = new GLatLng(latitude, longitude);
		        map.setCenter(point, zoom);
		        if (control_zoom == 1)
		        	map.addControl(new GSmallMapControl());
				map.addControl(new GMapTypeControl());
				map.enableDoubleClickZoom();
				//map.setMapType(G_SATELLITE_MAP);
			}
			
			loadImages();
	    }

		var coordinates = [];
		coordinates[0] = {lat: 43.382220, lng: -8.402781};
		coordinates[1] = {lat: 42.879109, lng: -8.541269};
		coordinates[2] = {lat: 42.223751, lng: -8.905449};
		

	    function loadImages()
	    {
	    	var rand = Math.floor(Math.random()*3);
	    	
			//jQuery(function() {  
			$.getJSON("/panoramio?point="+coordinates[rand].lat+","+coordinates[rand].lng+"&size=square",
				function(data)
				{
					jQuery.each(data.photos, function(i, photo) {
						jQuery('#cargando-fotos').hide();
						          	
					    var img = document.createElement('img');
					    img.setAttribute('title', photo.photo_title);
					    img.setAttribute('alt', photo.photo_title);
					    img.setAttribute('id', 'foto-'+i);
					    img.setAttribute('src', photo.photo_file_url);
					          	
						var a = document.createElement('a');
						img.setAttribute('id', 'foto-'+i);
						a.setAttribute('href', 'http://mw2.google.com/mw-panoramio/photos/medium/'+photo.photo_id+'.jpg');
						a.setAttribute('title', 'Autor: <a href="'+photo.owner_url+'">'+photo.owner_name+"</a>");
									
						a.appendChild(img);	
						document.getElementById('fotos-panoramio').appendChild(a);	
						          	
					});
							  
					jQuery('#cargando-fotos').hide();
						  	
					jQuery(function() {
				       	jQuery('#fotos-panoramio a').lightBox({txtImage: 'Las fotos de <a href="http://www.panoramio.com">Panoramio</a> están bajo el copyright de sus autores<div id="panoramio"><a href="http://www.panoramio.com"><img src="/static/images/panoramio.png"/></a></div>'});
				   	});
				});
        	//});
		}
		
		function tooltip(marker, nombre)
		{
			var tooltip = new Tooltip(marker, nombre, 4);
			marker.tooltip = tooltip;
			map.addOverlay(tooltip);
			GEvent.addListener(marker,'mouseover',function(){ this.tooltip.show(); }); 
			GEvent.addListener(marker,'mouseout',function(){ this.tooltip.hide(); });

		}

