// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
function MostrarInstalacion(Nombre, longitud, latitud){
	$('#map').jmap('AddMarker',
				   {'pointLatLng':[latitud, longitud],
                    'pointHTML':Nombre,
	 			    'centerMap':true,
				    'centerMoveMethod':'pan'
                   });
}
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
function CargarProximosEventos(elem, fecha){
	$('#capa_calendario').empty();
	$('#capa_calendario').html(mostrar_agenda(fecha, 'ESP'));
	$('#' + elem).html('<ul><li>Cargando...</li></ul>');
	$.get('ajax_proximoseventos.asp', {fecha: fecha},
		   function (data){
			   $('#' + elem).html(data);
		   });
}
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
function MostrarEventoVisor(URLImagen, Titular, FechaInicio, HoraInicio, id, key){	
	var texto; 
	texto = '<span class="titular_descripcion_visor">' + Titular + '</span><br />';	
	if (FechaInicio != ''){texto = texto + FechaInicio}
	if (HoraInicio != ''){texto = texto + '&middot;' + HoraInicio + ' horas'}
		
	$('#enlace_imagen_evento').attr('href', 'eventos.asp?id=' + id);		
	//$('#imagen_evento').AjustarImagen(410,305);
	//$('#imagen_evento').attr('src', URLImagen);	
	$('#imagen_evento').attr('src', URLImagen);
	
	//$('#submenu2_1').html(texto); ??????
	document.getElementById('submenu3_1').innerHTML = texto;
}
// ////////////////////////////////////////////////////////////////////////////////////
function RefrescarVisorEventos(){
	if (NumeroEventos > 0){		
		if (IndiceEventoActual == (NumeroEventos-1)){
			IndiceEventoActual = 0;
		}else{
			IndiceEventoActual = IndiceEventoActual + 1;
		}

		MostrarEventoVisor(URLImagenesEventos[IndiceEventoActual], 
						   TitularesEventos[IndiceEventoActual], 
						   FechaInicioEventos[IndiceEventoActual], 
						   HoraInicioEventos[IndiceEventoActual], 
						   IdsEventos[IndiceEventoActual], 
						   KeysEventos[IndiceEventoActual]);
	}
}
// ////////////////////////////////////////////////////////////////////////////////////
function MostrarImagenEvento(URLImagen){
	$('#imagen_visor_evento').attr('src', URLImagen);
}
// ////////////////////////////////////////////////////////////////////////////////////
$.preloadImages = function(){
	for(var i = 0; i < arguments.length; i++){
		$('<img>').attr('src', arguments[i]);
	}
}
// ////////////////////////////////////////////////////////////////////////////////////