/**
 * 
 *	ARCHIVO DE FUNCIONES JAVASCRIPT
 *	
 *	@link service.reglowmixer.com/web/vuelos/includes/functions.js
 *	@author Oliver Martín
 * 	@access last mofication: 26/09/06
 *	 
 *	function valor_tipo (tipo)
 *  function ocultaerrorciudades()
 *	function ocultaerrorpasajeros()
 *	function ocultaerroredades()
 *  function muestraTelefono() {
 */


/**
*	valor_tipo
*/
function comprobarMiform(){
	var error=0;
	var mensaje='';
		

	if(document.miform.origen.value.length<3){
		error=1;
		if(idioma=='es'){
			mensaje+= "Escoja el origen de su vuelo\n\n";
		}else{
			mensaje+= "hola hola";
		}
	}
	if(document.miform.destino.value.length<3){
		error=1;
		mensaje+= "Escoja el destino de su vuelo\n\n";
	}
	if(document.miform.adultos.value==0 && document.miform.menores.value==0){
		error=1;
		mensaje+= "Eliga el número de pasajeros que van a viajar\n\n";
	}
	if(document.miform.bebes.value> document.miform.adultos.value){
		error= 1;
		mensaje += "El número de bebes no puede ser superior al de adultos";
	}
	if (error==0){
			return true;
			
		
	}else{
			alert("Atención!!!\n\n"+mensaje);
			return false;
	}		
}


/**
* funciona Cambiar se encarga de habilitar o deshabilitar cuando se elige ida o ida y vuelta en el formulario de búsqueda
*/
function Cambiar(tip){
 if (tip=='ida'){
	  document.miform.hvuelta.disabled = true;
	  document.miform.fvuelta.disabled = true;
	  document.miform.hvuelta.style.backgroundColor='silver';
	  document.miform.fvuelta.style.backgroundColor='silver';
	  if (busquedaAvanzada.style.display == 'block'){
	  	if (busquedaAvanzadaVuelta.style.display == 'block'){
	  		busquedaAvanzadaVuelta.style.display = 'none';
	  	}
	  }
 }
 else {
	  document.miform.hvuelta.disabled = false;
	  document.miform.hvuelta.style.backgroundColor='white';
	  document.miform.fvuelta.disabled = false;
	  document.miform.fvuelta.style.backgroundColor='white';
	  if (busquedaAvanzada.style.display == 'block'){
	  	if (busquedaAvanzadaVuelta.style.display == 'none'){
	  		busquedaAvanzadaVuelta.style.display = 'block';
	  	}
	  }
 }
}

