// JavaScript Document
	var actual =1;

	function calculaFecha(horas) {
		var fecha= new Date();
		fecha.setHours(1);
		var tiempoEnMilis = fecha.getTime();
		tiempoEnMilis = tiempoEnMilis + (horas*60*60*1000);
		fecha.setTime(tiempoEnMilis)
		
		var resultado="";
		resultado = resultado  + fecha.getDate() + "/";
		resultado = resultado  + (fecha.getMonth()+1) + "/";
		resultado = resultado  + fecha.getFullYear() + " ";
		resultado = resultado  + fecha.getHours();
		resultado = resultado  + ":00 ";
		
		return resultado;
	}

	function rutaImagen(numero) {
		var url ="http://www.windfinder.com/grafiken/forecasts/";
		var zona = "wind_iberia";
		var cola = ".png";
		
		return url + zona + (numero*12) + cola;
	}
	
	function imagenMas() {
		actual++;
		if(actual>14) {
			actual=1;
		}
		
		document.getElementById("forecast").src=rutaImagen(actual);
		if (actual==14) {
			document.getElementById("change_forecast").value="Volver a " . calculaFecha(12);
		} else {
			document.getElementById("change_forecast").value="Mapa para el " + calculaFecha((actual+1)*12);
		}
	}