// JavaScript Document
function clima_ciudad(CityName,CountryName){
	 $.ajax({
	   type: "GET",
	   dataType: "json",
	   url: "/nucleo/booking/frontoffice/ajax/temperatura-ciudad-json.asp?CityName="+CityName+"&CountryName="+CountryName,
	   success: function(data){
		   
		 $("#clima").empty();
		
		 if (data.clima.Estado == 'Success'){
			 switch (data.clima.Cielo){
				case 'obscured':
					$("#clima").append("<img src='/nucleo/booking/frontoffice/images/weather/37s.png' alt='Cielo Oscuro' width='61' height='34' />");
					break;
				case 'partly cloudy': 
					$("#clima").append("<img src='/nucleo/booking/frontoffice/images/weather/34s.png' alt='Parcialmente Nublado' width='61' height='34'/>");
					break;
				case 'mostly cloudy': 
					$("#clima").append("<img src='/nucleo/booking/frontoffice/images/weather/28s.png' alt='Nublado' width='61' height='34'/>");
					break;
				case 'overcast': 
					$("#clima").append("<img src='/nucleo/booking/frontoffice/images/weather/14s.png' alt='Cubierto' width='61' height='34'/>");
					break;
				case 'mostly clear': 
					$("#clima").append("<img src='/nucleo/booking/frontoffice/images/weather/34s.png' alt='Parcialmente Despejado' width='61' height='34'/>");
					break;
				case 'claer': 
					$("#clima").append("<img src='/nucleo/booking/frontoffice/images/weather/36s.png' alt='Despejado' width='61' height='34'/>");
					break;
				default :
					alert('sin datos');
					break;
				}
				
			 $("#clima").append("<br />Temperatura " + CityName + ": <span class='clima_resultado temperatura'>" + data.clima.Temperatura + '</span>');
			 $("#clima").append("<br />Cielo " + CityName + ": <span class='clima_resultado'>" + data.clima.Cielo + '</span>');	
			 $("#clima").append("<br />Hora Actual " + CityName + ": <span class='clima_resultado'>" + data.clima.HoraActual + '</span>');
			 $("#clima").append("<br />Viento " + CityName + ": <span class='clima_resultado'>" + data.clima.Viento + '</span>');
			 $("#clima").append("<br />Visibilidad " + CityName + ": <span class='clima_resultado'>" + data.clima.Visibilidad + '</span>');
			 $("#clima").append("<br />Temperatura Minima " + CityName + ": <span class='clima_resultado'>" + data.clima.TemperaturaMinima + '</span>');
			 $("#clima").append("<br />Humedad " + CityName + ": <span class='clima_resultado'>" + data.clima.Humedad + '</span>');
			 $("#clima").append("<br />Presion " + CityName + ": <span class='clima_resultado'>" + data.clima.Presion + '</span>');
			 $("#clima").append("<br />Estado: <span class='clima_resultado'>" + data.clima.Estado + '</span>');
		 }
		 else
		 {
			$("#clima").append("Información del clima de " + CityName + " momentaneamente no disponible."); 
		 }
		
		
	   }
	 });
	 
}