function hideElemento(elemento){
	var habitacion = document.getElementById(elemento);
    habitacion.style.display='none';
}

function showElemento(elemento){
	var habitacion = document.getElementById(elemento);
    habitacion.style.display = '';
}

function checkCasasAldeaIntegra(value) {
	if(value >= 1 && value <=4) {
		if(document.getElementById('tipo'+value).checked) {
			document.getElementById('tipo5').checked = false;
			showElemento("unidades");
			showElemento("habitacion1");			
			hideElemento("totalpersonas");
		}
	} else if(value==5) {
	
		if(document.getElementById('tipo5').checked) {
			for(i=1; i<=4;i++) {
				document.getElementById('tipo'+i).checked = false;
			}		
			hideElemento("unidades");
			hideElemento("habitacion1");
			hideElemento("habitacion2");
			hideElemento("habitacion3");
			hideElemento("habitacion4");
			hideElemento("habitacion5");
			showElemento("totalpersonas");
			document.getElementById('unidadesHabitacion').value = 1;
			document.getElementById('unidadesAdulto1').value = 2;
			document.getElementById('unidadesNino1').value = 0;
		} else {
			showElemento("unidades");
			showElemento("habitacion1");			
			hideElemento("totalpersonas");
			document.getElementById('unidadesHabitacion').value = 1;
			document.getElementById('unidadesAdulto1').value = 2;
			document.getElementById('unidadesNino1').value = 0;
		
		}
		
		
	}
}

function checkHabitaciones(){
	var numHabitaciones = document.getElementById("unidadesHabitacion");
	if (numHabitaciones.value == 1){
		showElemento("habitacion1");
		hideElemento("habitacion2");
		hideElemento("habitacion3");
		hideElemento("habitacion4");
		hideElemento("habitacion5");
	}else{
		if(numHabitaciones.value == 2){
			showElemento("habitacion1");
			showElemento("habitacion2");
			hideElemento("habitacion3");
			hideElemento("habitacion4");
			hideElemento("habitacion5");
		}else{
		 	if(numHabitaciones.value == 3){
		 		showElemento("habitacion1");
				showElemento("habitacion2");
				showElemento("habitacion3");
				hideElemento("habitacion4");
				hideElemento("habitacion5");
		 	}else{
		 		if(numHabitaciones.value == 4){
		 			showElemento("habitacion1");
					showElemento("habitacion2");
					showElemento("habitacion3");
					showElemento("habitacion4");
					hideElemento("habitacion5");
		 		}else{
		 			if (numHabitaciones.value == 5){
			 			showElemento("habitacion1");
						showElemento("habitacion2");
						showElemento("habitacion3");
						showElemento("habitacion4");
						showElemento("habitacion5");		 	
		 			}
		  		}
			}
		}
	}
}

function checkHabitacionesReserva(){
	var numHabitaciones = document.getElementById("unidadesHabitacionReserva");
	if (numHabitaciones.value == 1){
		showElemento("habitacion1Reserva");
		hideElemento("habitacion2Reserva");
		hideElemento("habitacion3Reserva");
		hideElemento("habitacion4Reserva");
		hideElemento("habitacion5Reserva");
	}else{
		if(numHabitaciones.value == 2){
			showElemento("habitacion1Reserva");
			showElemento("habitacion2Reserva");
			hideElemento("habitacion3Reserva");
			hideElemento("habitacion4Reserva");
			hideElemento("habitacion5Reserva");
		}else{
		 	if(numHabitaciones.value == 3){
		 		showElemento("habitacion1Reserva");
				showElemento("habitacion2Reserva");
				showElemento("habitacion3Reserva");
				hideElemento("habitacion4Reserva");
				hideElemento("habitacion5Reserva");
		 	}else{
		 		if(numHabitaciones.value == 4){
		 			showElemento("habitacion1Reserva");
					showElemento("habitacion2Reserva");
					showElemento("habitacion3Reserva");
					showElemento("habitacion4Reserva");
					hideElemento("habitacion5Reserva");
		 		}else{
		 			if (numHabitaciones.value == 5){
			 			showElemento("habitacion1Reserva");
						showElemento("habitacion2Reserva");
						showElemento("habitacion3Reserva");
						showElemento("habitacion4Reserva");
						showElemento("habitacion5Reserva");		 	
		 			}
		  		}
			}
		}
	}
}

function checkCasasAldea(){
	var checkCasasAldea = document.getElementById("tipo3");
	if(checkCasasAldea.checked == 1){
		showElemento("notacasasdealdea");
	}else{
		hideElemento("notacasasdealdea");
	}
}
