	//defino una varibles Array con los precios de las habiaciones (segun el indice)
	var precios = new Array("","127 €","167  €","197 €","237 €")
	var datos = new Array("","Standard double with ensuite bathroom, underfloor heating-cooling, satellite TV, DVD, WI-FI, direct telephone, minibar and stunning views, Breakfast included in the rate.",
					  "Superior double with whirpool ensuite bathroom, underfloor heating-cooling, satellite TV, DVD, WI-FI, direct telephone, minibar and stunning views, Breakfast included in the rate.",
					  "Suite with living room, fireplace, jacuzzi, underfloor heating-cooling, satellite TV, DVD, WI-FI, direct telephone, minibar and stunning views, Breakfast included in the rate.",
					  "Imperial Suite with living room, fireplace, jacuzzi, underfloor heating-cooling, satellite TV, DVD, WI-FI, direct telephone, minibar and a private square metres with superb views, Breakfast included in the rate.")
	var preciosI = new Array(0,127,167 ,197,237)


	//función que cambia el precio en un campo input segun la opcion marcada en el select
   function muestraPrecio1(){
      document.miForm.precio1.value =precios[document.miForm.habitaciones1.selectedIndex]
      document.miForm.descripcion.value =datos[document.miForm.habitaciones1.selectedIndex]
      var base = (preciosI[document.miForm.habitaciones1.selectedIndex] * document.miForm.n_noches1.value) + (preciosI[document.miForm.habitaciones2.selectedIndex] * document.miForm.n_noches2.value) + (preciosI[document.miForm.habitaciones3.selectedIndex] * document.miForm.n_noches3.value)

	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 127){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 167 ){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 127){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 167 ){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }

	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 127){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 167 ){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }

      if(document.miForm.n_ninos1.checked) {
		  base = base + (30 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.n_ninos2.checked) {
		  base = base + (30 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.n_ninos3.checked) {
	  	base = base + (30 * document.miForm.n_noches3.value)
	  }
	  
      if(document.miForm.cuna1.checked) {
		  base = base + (15 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.cuna2.checked) {
		  base = base + (15 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.cuna3.checked) {
	  	base = base + (15 * document.miForm.n_noches3.value)
	  }
	  
	  var iva = (base * 7)/100
	  var total = base + iva
      document.miForm.base.value = base + " €"
      document.miForm.iva.value = iva + " €"
      document.miForm.total.value = total + " €"
   }	
   
   	//función que cambia el precio en un campo input segun la opcion marcada en el select
   function muestraPrecio11(){
      document.miForm.precio1.value =precios[document.miForm.habitaciones1.selectedIndex]
      document.miForm.descripcion.value =datos[document.miForm.habitaciones1.selectedIndex]
      var base = (preciosI[document.miForm.habitaciones1.selectedIndex] * document.miForm.n_noches1.value) + (preciosI[document.miForm.habitaciones2.selectedIndex] * document.miForm.n_noches2.value) + (preciosI[document.miForm.habitaciones3.selectedIndex] * document.miForm.n_noches3.value)

	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 127){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 167 ){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 127){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 167 ){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }

	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 127){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 167 ){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  
      if(document.miForm.n_ninos1.checked) {
		  base = base + (30 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.n_ninos2.checked) {
		  base = base + (30 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.n_ninos3.checked) {
	  	base = base + (30 * document.miForm.n_noches3.value)
	  }
	  
      if(document.miForm.cuna1.checked) {
		  base = base + (15 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.cuna2.checked) {
		  base = base + (15 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.cuna3.checked) {
	  	base = base + (15 * document.miForm.n_noches3.value)
	  }
	  
	  var iva = (base * 7)/100
	  var total = base + iva
      document.miForm.base.value = base + " €"
      document.miForm.iva.value = iva + " €"
      document.miForm.total.value = total + " €"
   }		
   
   //función que cambia el precio en un campo input segun la opcion marcada en el select
   function muestraPrecio111(){
      document.miForm.precio1.value =precios[document.miForm.habitaciones1.selectedIndex]
      document.miForm.descripcion.value =datos[document.miForm.habitaciones1.selectedIndex]
      var base = (preciosI[document.miForm.habitaciones1.selectedIndex] * document.miForm.n_noches1.value) + (preciosI[document.miForm.habitaciones2.selectedIndex] * document.miForm.n_noches2.value) + (preciosI[document.miForm.habitaciones3.selectedIndex] * document.miForm.n_noches3.value)
	  
	  
	  
      if(document.miForm.n_ninos1.checked) {
		  base = base + (30 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.n_ninos2.checked) {
		  base = base + (30 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.n_ninos3.checked) {
	  	base = base + (30 * document.miForm.n_noches3.value)
	  }

      if(document.miForm.cuna1.checked) {
		  base = base + (15 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.cuna2.checked) {
		  base = base + (15 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.cuna3.checked) {
	  	base = base + (15 * document.miForm.n_noches3.value)
	  }
	  
	  var iva = (base * 7)/100
	  var total = base + iva
      document.miForm.base.value = base + " €"
      document.miForm.iva.value = iva + " €"
      document.miForm.total.value = total + " €"
   }	

      //función que cambia el precio en un campo input segun la opcion marcada en el select
   function muestraPrecio1111(){
      document.miForm.precio1.value =precios[document.miForm.habitaciones1.selectedIndex]
      document.miForm.descripcion.value =datos[document.miForm.habitaciones1.selectedIndex]
      var base = (preciosI[document.miForm.habitaciones1.selectedIndex] * document.miForm.n_noches1.value) + (preciosI[document.miForm.habitaciones2.selectedIndex] * document.miForm.n_noches2.value) + (preciosI[document.miForm.habitaciones3.selectedIndex] * document.miForm.n_noches3.value)
	  
	 
	  
      if(document.miForm.n_ninos1.checked) {
		  base = base + (30 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.n_ninos2.checked) {
		  base = base + (30 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.n_ninos3.checked) {
	  	base = base + (30 * document.miForm.n_noches3.value)
	  }

      if(document.miForm.cuna1.checked) {
		  base = base + (15 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.cuna2.checked) {
		  base = base + (15 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.cuna3.checked) {
	  	base = base + (15 * document.miForm.n_noches3.value)
	  }
	  
	  var iva = (base * 7)/100
	  var total = base + iva
      document.miForm.base.value = base + " €"
      document.miForm.iva.value = iva + " €"
      document.miForm.total.value = total + " €"
   }	

   
   //función que cambia el precio en un campo input segun la opcion marcada en el select
   function muestraPrecio2(){
      document.miForm.precio2.value =precios[document.miForm.habitaciones2.selectedIndex]
      document.miForm.descripcion.value =datos[document.miForm.habitaciones2.selectedIndex]
      var base = (preciosI[document.miForm.habitaciones1.selectedIndex] * document.miForm.n_noches1.value) + (preciosI[document.miForm.habitaciones2.selectedIndex] * document.miForm.n_noches2.value) + (preciosI[document.miForm.habitaciones3.selectedIndex] * document.miForm.n_noches3.value)

	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 127){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 167 ){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 127){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 167 ){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }

	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 127){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 167 ){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  
      if(document.miForm.n_ninos1.checked) {
		  base = base + (30 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.n_ninos2.checked) {
		  base = base + (30 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.n_ninos3.checked) {
	  	base = base + (30 * document.miForm.n_noches3.value)
	  }
	  
      if(document.miForm.cuna1.checked) {
		  base = base + (15 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.cuna2.checked) {
		  base = base + (15 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.cuna3.checked) {
	  	base = base + (15 * document.miForm.n_noches3.value)
	  }
	  
	  var iva = (base * 7)/100
	  var total = base + iva
      document.miForm.base.value = base + " €"
      document.miForm.iva.value = iva + " €"
      document.miForm.total.value = total + " €"
   }
   
   //función que cambia el precio en un campo input segun la opcion marcada en el select
   function muestraPrecio22(){
      document.miForm.precio2.value =precios[document.miForm.habitaciones2.selectedIndex]
      document.miForm.descripcion.value =datos[document.miForm.habitaciones2.selectedIndex]
      var base = (preciosI[document.miForm.habitaciones1.selectedIndex] * document.miForm.n_noches1.value) + (preciosI[document.miForm.habitaciones2.selectedIndex] * document.miForm.n_noches2.value) + (preciosI[document.miForm.habitaciones3.selectedIndex] * document.miForm.n_noches3.value)

	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 127){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 167 ){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 127){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 167 ){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }

	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 127){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 167 ){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  
      if(document.miForm.n_ninos1.checked) {
		  base = base + (30 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.n_ninos2.checked) {
		  base = base + (30 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.n_ninos3.checked) {
	  	base = base + (30 * document.miForm.n_noches3.value)
	  }
	 
      if(document.miForm.cuna1.checked) {
		  base = base + (15 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.cuna2.checked) {
		  base = base + (15 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.cuna3.checked) {
	  	base = base + (15 * document.miForm.n_noches3.value)
	  } 
	 
	  var iva = (base * 7)/100
	  var total = base + iva
      document.miForm.base.value = base + " €"
      document.miForm.iva.value = iva + " €"
      document.miForm.total.value = total + " €"
   }
   
   //función que cambia el precio en un campo input segun la opcion marcada en el select
   function muestraPrecio222(){
      document.miForm.precio2.value =precios[document.miForm.habitaciones2.selectedIndex]
      document.miForm.descripcion.value =datos[document.miForm.habitaciones2.selectedIndex]
      var base = (preciosI[document.miForm.habitaciones1.selectedIndex] * document.miForm.n_noches1.value) + (preciosI[document.miForm.habitaciones2.selectedIndex] * document.miForm.n_noches2.value) + (preciosI[document.miForm.habitaciones3.selectedIndex] * document.miForm.n_noches3.value)

	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 127){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 167 ){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 127){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 167 ){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }

	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 127){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 167 ){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  
      if(document.miForm.n_ninos1.checked) {
		  base = base + (30 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.n_ninos2.checked) {
		  base = base + (30 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.n_ninos3.checked) {
	  	base = base + (30 * document.miForm.n_noches3.value)
	  }
	  
      if(document.miForm.cuna1.checked) {
		  base = base + (15 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.cuna2.checked) {
		  base = base + (15 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.cuna3.checked) {
	  	base = base + (15 * document.miForm.n_noches3.value)
	  }
	  
	  var iva = (base * 7)/100
	  var total = base + iva
      document.miForm.base.value = base + " €"
      document.miForm.iva.value = iva + " €"
      document.miForm.total.value = total + " €"
   }

   //función que cambia el precio en un campo input segun la opcion marcada en el select
   function muestraPrecio2222(){
      document.miForm.precio2.value =precios[document.miForm.habitaciones2.selectedIndex]
      document.miForm.descripcion.value =datos[document.miForm.habitaciones2.selectedIndex]
      var base = (preciosI[document.miForm.habitaciones1.selectedIndex] * document.miForm.n_noches1.value) + (preciosI[document.miForm.habitaciones2.selectedIndex] * document.miForm.n_noches2.value) + (preciosI[document.miForm.habitaciones3.selectedIndex] * document.miForm.n_noches3.value)

	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 127){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 167 ){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 127){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 167 ){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }

	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 127){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 167 ){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  
      if(document.miForm.n_ninos1.checked) {
		  base = base + (30 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.n_ninos2.checked) {
		  base = base + (30 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.n_ninos3.checked) {
	  	base = base + (30 * document.miForm.n_noches3.value)
	  }
	  
      if(document.miForm.cuna1.checked) {
		  base = base + (15 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.cuna2.checked) {
		  base = base + (15 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.cuna3.checked) {
	  	base = base + (15 * document.miForm.n_noches3.value)
	  }
	  
	  var iva = (base * 7)/100
	  var total = base + iva
      document.miForm.base.value = base + " €"
      document.miForm.iva.value = iva + " €"
      document.miForm.total.value = total + " €"
   }
   
	//función que cambia el precio en un campo input segun la opcion marcada en el select
   function muestraPrecio3(){
      document.miForm.precio3.value =precios[document.miForm.habitaciones3.selectedIndex]
      document.miForm.descripcion.value =datos[document.miForm.habitaciones3.selectedIndex]
      var base = (preciosI[document.miForm.habitaciones1.selectedIndex] * document.miForm.n_noches1.value) + (preciosI[document.miForm.habitaciones2.selectedIndex] * document.miForm.n_noches2.value) + (preciosI[document.miForm.habitaciones3.selectedIndex] * document.miForm.n_noches3.value)

	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 127){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 167 ){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 127){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 167 ){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }

	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 127){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 167 ){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  
      if(document.miForm.n_ninos1.checked) {
		  base = base + (30 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.n_ninos2.checked) {
		  base = base + (30 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.n_ninos3.checked) {
	  	base = base + (30 * document.miForm.n_noches3.value)
	  }
	  	  
      if(document.miForm.cuna1.checked) {
		  base = base + (15 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.cuna2.checked) {
		  base = base + (15 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.cuna3.checked) {
	  	base = base + (15 * document.miForm.n_noches3.value)
	  }
	  
	  var iva = (base * 7)/100
	  var total = base + iva
      document.miForm.base.value = base + " €"
      document.miForm.iva.value = iva + " €"
      document.miForm.total.value = total + " €"
   }

	//función que cambia el precio en un campo input segun la opcion marcada en el select
   function muestraPrecio33(){
      document.miForm.precio3.value =precios[document.miForm.habitaciones3.selectedIndex]
      document.miForm.descripcion.value =datos[document.miForm.habitaciones3.selectedIndex]
      var base = (preciosI[document.miForm.habitaciones1.selectedIndex] * document.miForm.n_noches1.value) + (preciosI[document.miForm.habitaciones2.selectedIndex] * document.miForm.n_noches2.value) + (preciosI[document.miForm.habitaciones3.selectedIndex] * document.miForm.n_noches3.value)

	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 127){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 167 ){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 127){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 167 ){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }

	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 127){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 167 ){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  
      if(document.miForm.n_ninos1.checked) {
		  base = base + (30 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.n_ninos2.checked) {
		  base = base + (30 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.n_ninos3.checked) {
	  	base = base + (30 * document.miForm.n_noches3.value)
	  }
	  
      if(document.miForm.cuna1.checked) {
		  base = base + (15 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.cuna2.checked) {
		  base = base + (15 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.cuna3.checked) {
	  	base = base + (15 * document.miForm.n_noches3.value)
	  }
	  
	  var iva = (base * 7)/100
	  var total = base + iva
      document.miForm.base.value = base + " €"
      document.miForm.iva.value = iva + " €"
      document.miForm.total.value = total + " €"
   }

   //función que cambia el precio en un campo input segun la opcion marcada en el select
   function muestraPrecio333(){
      document.miForm.precio3.value =precios[document.miForm.habitaciones3.selectedIndex]
      document.miForm.descripcion.value =datos[document.miForm.habitaciones3.selectedIndex]
      var base = (preciosI[document.miForm.habitaciones1.selectedIndex] * document.miForm.n_noches1.value) + (preciosI[document.miForm.habitaciones2.selectedIndex] * document.miForm.n_noches2.value) + (preciosI[document.miForm.habitaciones3.selectedIndex] * document.miForm.n_noches3.value)

	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 127){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 167 ){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 127){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 167 ){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }

	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 127){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 167 ){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  
      if(document.miForm.n_ninos1.checked) {
		  base = base + (30 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.n_ninos2.checked) {
		  base = base + (30 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.n_ninos3.checked) {
	  	base = base + (30 * document.miForm.n_noches3.value)
	  }
	  
      if(document.miForm.cuna1.checked) {
		  base = base + (15 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.cuna2.checked) {
		  base = base + (15 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.cuna3.checked) {
	  	base = base + (15 * document.miForm.n_noches3.value)
	  }
	  
	  var iva = (base * 7)/100
	  var total = base + iva
      document.miForm.base.value = base + " €"
      document.miForm.iva.value = iva + " €"
      document.miForm.total.value = total + " €"
   }

   //función que cambia el precio en un campo input segun la opcion marcada en el select
   function muestraPrecio3333(){
      document.miForm.precio3.value =precios[document.miForm.habitaciones3.selectedIndex]
      document.miForm.descripcion.value =datos[document.miForm.habitaciones3.selectedIndex]
      var base = (preciosI[document.miForm.habitaciones1.selectedIndex] * document.miForm.n_noches1.value) + (preciosI[document.miForm.habitaciones2.selectedIndex] * document.miForm.n_noches2.value) + (preciosI[document.miForm.habitaciones3.selectedIndex] * document.miForm.n_noches3.value)

	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 127){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones1.selectedIndex] == 167 ){
		 document.miForm.n_ninos1.checked = false;
		 document.miForm.n_ninos1.disable = true;
		 document.miForm.cuna1.checked = false;
		 document.miForm.cuna1.disable = true;
	  }
	  
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 127){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones2.selectedIndex] == 167 ){
		 document.miForm.n_ninos2.checked = false;
		 document.miForm.n_ninos2.disable = true;
		 document.miForm.cuna2.checked = false;
		 document.miForm.cuna2.disable = true;
	  }

	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 127){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  if(preciosI[document.miForm.habitaciones3.selectedIndex] == 167 ){
		 document.miForm.n_ninos3.checked = false;
		 document.miForm.n_ninos3.disable = true;
		 document.miForm.cuna3.checked = false;
		 document.miForm.cuna3.disable = true;
	  }
	  
      if(document.miForm.n_ninos1.checked) {
		  base = base + (30 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.n_ninos2.checked) {
		  base = base + (30 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.n_ninos3.checked) {
	  	base = base + (30 * document.miForm.n_noches3.value)
	  }
	  
      if(document.miForm.cuna1.checked) {
		  base = base + (15 * document.miForm.n_noches1.value)
	  }
      if(document.miForm.cuna2.checked) {
		  base = base + (15 * document.miForm.n_noches2.value)
	  }
      if(document.miForm.cuna3.checked) {
	  	base = base + (15 * document.miForm.n_noches3.value)
	  }
	  
	  var iva = (base * 7)/100
	  var total = base + iva
      document.miForm.base.value = base + " €"
      document.miForm.iva.value = iva + " €"
      document.miForm.total.value = total + " €"
   }


	// Determina si un año es bisiesto
   function es_bisiesto(anio) {
	   if (((anio % 4 == 0) && anio % 100 != 0) || anio % 400 == 0) 
		  return true;
	   return false;
   }
   
	//función que comprueba si una fecha es correcta
	function comprobar_fecha(dia, mes, anio) {
		if ((mes == 4 && dia > 30) || (mes == 6 && dia > 30) || (mes == 9 && dia > 30) || (mes == 11 && dia > 30)
			|| (mes == 2 && es_bisiesto(anio) && dia > 29) || (mes == 2 && !es_bisiesto(anio) && dia > 28))
      			return false;
   		return true; 
	}
	
	
	//función que compara la fecha de entrada con la fecha actual
	function comparar_fecha(dia_e, mes_e, anio_e) {
		var fecha = new Date();
	  	var anio = fecha.getFullYear();
	  	var mes = fecha.getMonth() + 1;
	  	var dia = fecha.getDate();
		
		if (anio > anio_e){
			return false;
		}
		if ((anio ==anio_e) && (mes > mes_e)){
			return false;
		}
		if ((anio ==anio_e) && (mes == mes_e) && (dia > dia_e)){
			return false;
		}
		
		return true;
	}


	//funcion que abre una ventana nueva con las caracteristicas indicadas en los argumentos
	function abrir(direccion, pantallacompleta, herramientas, direcciones, estado, barramenu, barrascroll, cambiatamano, ancho, alto, izquierda, arriba, sustituir){ 
	
		 var opciones = "fullscreen=" + pantallacompleta + 
					 ",toolbar=" + herramientas + 
					 ",location=" + direcciones + 
					 ",status=" + estado + 
					 ",menubar=" + barramenu + 
					 ",scrollbars=" + barrascroll + 
					 ",resizable=" + cambiatamano + 
					 ",width=" + ancho + 
					 ",height=" + alto + 
					 ",left=" + izquierda + 
					 ",top=" + arriba; 
					
		window.open(direccion,"ventana",opciones,sustituir); 
	}        


	//función que comprueba que esten rellenados todos los campos obligatorios
   function checkrequired(which){  
   
		if (document.miForm.habitaciones1.value == 0 && document.miForm.habitaciones2.value == 0 && document.miForm.habitaciones3.value == 0){
		   alert("You have selected no rooms");
				return false;
		} 
		else{
			if ((document.miForm.habitaciones1.value == 0 && document.miForm.habitaciones2.value != 0) || (document.miForm.habitaciones1.value == 0 && document.miForm.habitaciones3.value != 0)){
			   alert("You must select the rooms in order, firstly room 1");
				return false;
			} 
			if (document.miForm.habitaciones1.value != 0 && document.miForm.habitaciones2.value == 0 && document.miForm.habitaciones3.value != 0){
			   alert("You must select the room 2, before you are able to select room 3");
				return false;
			} 
			if (document.miForm.habitaciones1.value != 0 && (document.miForm.d_entrada1.value == 0 || document.miForm.m_entrada1.value == 0 || document.miForm.a_entrada1.value == 0)){
			   alert("Room 1: You haven´t selected an arrival date");
				return false;
			} 
			if (document.miForm.habitaciones2.value != 0 && (document.miForm.d_entrada2.value == 0 || document.miForm.m_entrada2.value == 0 || document.miForm.a_entrada2.value == 0)){
			   alert("Room 2: You haven´t selected an arrival date");
				return false;
			} 
			if (document.miForm.habitaciones3.value != 0 && (document.miForm.d_entrada3.value == 0 || document.miForm.m_entrada3.value == 0 || document.miForm.a_entrada3.value == 0)){
			   alert("Room 3: You haven´t selected an arrival date");
				return false;
			} 
			if (document.miForm.habitaciones1.value != 0 && document.miForm.d_entrada1.value != 0 && document.miForm.m_entrada1.value != 0 && document.miForm.a_entrada1.value != 0){
				if(!(comprobar_fecha (document.miForm.d_entrada1.value, document.miForm.m_entrada1.value, document.miForm.a_entrada1.value))){
				   alert("Room 1: Wrong date");
					return false;
				}				
				if(!(comparar_fecha (document.miForm.d_entrada1.value, document.miForm.m_entrada1.value, document.miForm.a_entrada1.value))){
					alert("Room 1: Please,do not select a day before the current one");
					return false;
				}
			} 
			if (document.miForm.habitaciones2.value != 0 && document.miForm.d_entrada2.value != 0 && document.miForm.m_entrada2.value != 0 && document.miForm.a_entrada2.value != 0){
				if(!(comprobar_fecha (document.miForm.d_entrada2.value, document.miForm.m_entrada2.value, document.miForm.a_entrada2.value))){
					alert("Room 2: Wrong date");
					return false;
				}			
				if(!(comparar_fecha (document.miForm.d_entrada2.value, document.miForm.m_entrada2.value, document.miForm.a_entrada2.value))){
					alert("Room 2: Please,do not select a day before the current one");
					return false;
				}
			} 
			if (document.miForm.habitaciones3.value != 0 && document.miForm.d_entrada3.value != 0 && document.miForm.m_entrada3.value != 0 && document.miForm.a_entrada3.value != 0){
				if(!(comprobar_fecha (document.miForm.d_entrada3.value, document.miForm.m_entrada3.value, document.miForm.a_entrada3.value))){
					alert("Room 3: Wrong date");
					return false;
				}			
				if(!(comparar_fecha (document.miForm.d_entrada3.value, document.miForm.m_entrada3.value, document.miForm.a_entrada3.value))){
					alert("Room 3: Please,do not select a day before the current one");
					return false;
				}
			} 
		}
		
	  var pass=true;
	  var val=true;

		if (document.images){
			for (i=0;i<which.length;i++){
				var tempobj=which.elements[i];

				if(which.elements[i].name=="requiredemail"){
				  val=validarEmail(which.elements[i].value);
				}

				if (tempobj.name.substring(0,8)=="required"){
				  if ((tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)){
					pass=false;
					break;
				  }
				}
			}
		}

		 if (!pass){
			 alert("You haven´t filled any compulsory field. Please, fill them and send it again!");
			 return false;
		 }
		 else{
			if (!val){
				alert("Wrong Email Address. Please, modify it and send it again!");
				return false;
			}  
		 }
	}


	//función que comprueba que el email sea correcto
	function validarEmail(valor) {
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
			return (true)
		}
		else {
			return (false);
		}
	}
