
// Coloca la selección "msn_ent" al valor que tenga "msn_rtr"
function ColocaMes() {

	// Lo primero se oculta el presupuesto ya antiguo
	// pero SOLO si la página no es "book.htm" 
	DeshabilitaPresupuesto();

	document.formPresupuesto.msn_ent.options.selectedIndex =
	document.formPresupuesto.msn_rtr.options.selectedIndex;

}

// Coloca la selección "lgr_ent" al valor que tenga "lgr_rtr"
function ColocaEstacion() {

	DeshabilitaPresupuesto();

	document.formPresupuesto.lgr_ent.options.selectedIndex =
	document.formPresupuesto.lgr_rtr.options.selectedIndex;

}

// Vacia el contenido de "document.getElementById("Presupuesto").innerHTML=tablahtml;"
function DeshabilitaPresupuesto() {

	// Lo primero se oculta el presupuesto ya antiguo
	// pero SOLO si la página no es "book.htm" 
	var path = location.pathname;
	if (path.match("offerlist.php") != null) {
		
		// Y lo mismo para el formulario de reserva offline
		document.getElementById('Reservaoffline').style.display = 'none';
	
		var tablahtml = '<table width="96%"><tr><td><fieldset><table width="99%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center"><p class="precio">';
		tablahtml = tablahtml + '<h2>Por favor, pulse "Nuevo presupuesto"</h2>';
		document.getElementById("ListaOfertas").innerHTML = tablahtml;
		
		// Se cambia el href del padre, para que salte el evento de cambio de tamaño del frame
		//parent.location = "./elitecarhireoffers.htm#" + (new Date()).getTime();

	} else if (path.match("offer.php") != null) {
		
		// Se oculta el formulario de reserva, por si acaso estuviera desplegado
		document.getElementById('Reserva').style.display = 'none';
		// Y lo mismo para el formulario de reserva offline
		document.getElementById('Reservaoffline').style.display = 'none';
	
		var tablahtml = '<table width="96%"><tr><td><fieldset><table width="99%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center"><p class="precio">';
		tablahtml = tablahtml + '<h2>Por favor, pulse "Nuevo presupuesto"</h2>';
		document.getElementById("Presupuesto").innerHTML = tablahtml;
		
	} else if (path.match("book") != null) {

		// Se oculta el formulario de reserva, por si acaso estuviera desplegado
		document.getElementById('Reserva').style.visibility = 'hidden';

		// Y lo mismo para el formulario de reserva offline
		document.getElementById('Reservaoffline').style.visibility = 'hidden';

		var tablahtml = '<table width="96%"><tr><td><fieldset><table width="99%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center"><p class="precio">';
		tablahtml = tablahtml + '<h2>Por favor, pulse "Nuevo presupuesto"</h2>';
		document.getElementById("Presupuesto").innerHTML = tablahtml;

	}

}


// Habilita el botón "booknow", en caso de haberse aceptado las condiciones
function ClickCondiciones() {

	if (document.getElementById('accept').checked) {
		document.getElementById('reservar').disabled = false;
	} else {
		document.getElementById('reservar').disabled = true;
	}
}

// Al ser marcado, coloca el texto "None" en el número de vuelo
function ClickNovuelo() {

	if (document.getElementById('novuelo').checked) {
		document.getElementById('vuelo').disabled = true;
		document.getElementById('vuelo').value = "Ninguno";
	} else {
		document.getElementById('vuelo').disabled = false;
		document.getElementById('vuelo').value = "";
	}
}

