var groups=7; 
var group=new Array(groups);
for (i=0; i<groups; i++)
group[i]=new Array();

group[0][0]=new Option("Gran Canaria","LPA");
group[0][1]=new Option("La Palma","SPC");
group[0][2]=new Option("Fuerteventura","FUE");
group[0][3]=new Option("Lanzarote","ACE");
group[0][4]=new Option(unescape("Marrakech"),"RAK");

group[1][0]=new Option("La Palma","SPC");

group[2][0]=new Option("Tenerife Norte","TFN");
group[2][1]=new Option("La Palma","SPC");
group[2][2]=new Option("Fuerteventura","FUE");
group[2][3]=new Option("Lanzarote","ACE");

//group[2][4]=new Option(unescape("El Aaiún"),"EUN");
group[2][4]=new Option(unescape("Marrakech"),"RAK");

group[3][0]=new Option("Tenerife Norte","TFN");
group[3][1]=new Option("Tenerife Sur","TFS");
group[3][2]=new Option("Gran Canaria","LPA");
group[3][3]=new Option("Fuerteventura","FUE");
group[3][4]=new Option("Lanzarote","ACE");
group[3][5]=new Option(unescape("Marrakech"),"RAK");

group[4][0]=new Option("Tenerife Norte","TFN");
group[4][1]=new Option("Gran Canaria","LPA");
group[4][2]=new Option("La Palma","SPC");
group[4][3]=new Option("Lanzarote","ACE");
group[4][4]=new Option(unescape("Marrakech"),"RAK");

group[5][0]=new Option("Tenerife Norte","TFN");
group[5][1]=new Option("Gran Canaria","LPA");
group[5][2]=new Option("La Palma","SPC");
group[5][3]=new Option("Fuerteventura","FUE");
group[5][4]=new Option(unescape("Marrakech"),"RAK");

//group[6][0]=new Option("Gran Canaria","LPA");

group[6][0]=new Option("Gran Canaria","LPA");
group[6][1]=new Option("Tenerife Norte","TFN");
group[6][2]=new Option("La Palma","SPC");
group[6][3]=new Option("Fuerteventura","FUE");
group[6][4]=new Option("Lanzarote","ACE");



function copiaDNI (pasajero, valor){
if ((document.getElementById('passengers['+pasajero+'].document.type').value=="d" ) || (document.getElementById('passengers['+pasajero+'].document.type').value=="t" ))
		document.getElementById('passengers['+pasajero+'].auth.number').value=valor;
	else
		document.getElementById('passengers['+pasajero+'].auth.number').value="";
	
}

function seleccionarcombotarifa(combo,elemento) {
   var cantidad = combo.length;
   for (i = 0; i < cantidad; i++) {
	   valor=combo[i].value.split("-");
      if (valor[0] == elemento) {
         combo[i].selected = true;
      }   
   }
}

function seleccionar(combo,elemento) {
   var cantidad = combo.length;
   for (i = 0; i < cantidad; i++) {
      if (combo[i].value == elemento) {
         combo[i].selected = true;
      }   
   }
}

function muestraidentificacion (){
		
	 aux='<table width="200" border="0">';
     aux+=' <tr>';
     aux+='        <td colspan="2"><select name="TipoDoc" id="TipoDoc" >';
     aux+='          <option value="-2">Seleccione...</option>';
     aux+='          <option value="-1">N PAS.FRECUENTE</option>';
     aux+='          <option value="1">DNI</option>';
     aux+='          <option value="2">NIE</option>';
     aux+='          <option value="3">PASAPORTE</option>';
     aux+='          <option value="4">CIF</option>';
	 aux+='          <option value="5">N AGENTE</option>';	 
     aux+='          </select></td>';
     aux+='        </tr>';
     aux+='      <tr>';
     aux+='        <td>Usuario:</td>';
     aux+='        <td><input name="Tusuario" id="Tusuario" class="box_nar" size="11" type="text" /></td>';
     aux+='        </tr>';
     aux+='      <tr>';
     aux+='        <td>Contrase&ntilde;a</td>';
     aux+='        <td><input name="Tpassword" id="Tpassword" class="box_nar" size="11" type="password" /></td>';
     aux+='      </tr>';
     aux+='    </table>';
	 return aux;
}
/*******************************************************/

function sumatasas (tarifa,indice,tasas,numplazas){
							for (ic=1; ic<=document.getElementById(tarifa+indice).length-1; ic++) {
								icimporte=document.getElementById(tarifa+indice).options[ic].value.split("-");
								icimporte[1]=redondear(icimporte[1]*1+tasas*numplazas);
								document.getElementById(tarifa+indice).options[ic].text+=" | "+icimporte[1] +" €"; 
								document.getElementById(tarifa+indice).options[ic].value+="-"+tasas;
								//document.getElementById(tarifa+indice).options[ic].value+="-"+vtasas;
							}
						}

/*******************************************************/

function generanumerosa (tipo, literal){

	var comboAdultoR=document.getElementById(tipo).options[document.getElementById(tipo).selectedIndex].value;
	aux='';
			if (comboAdultoR != ''){
			
			for (i=1;i<=comboAdultoR*1;i++){
aux+='<tr><td>'+literal+' '+i+'</td>';
aux+='<td><select name="datosFamilia'+tipo+'['+i+']" id="datosFamilia'+tipo+'['+i+']">';
aux+='<option value="ADTDC">'+txt7+'</option>';
aux+='<option value="ADTDCF1">'+txt8+'</option>';
aux+='<option value="ADTDCF2">'+txt9+'</option>';
aux+='</select><td></tr>';
			}
}
			return aux;
}

/*********************************************************/

function familianumerosa (valor){
	if (valor==1)
		document.getElementById("numerosaenvio").innerHTML="<table>"+generanumerosa("txtAdultoR",txt1)+generanumerosa("txtNinoR",txt2)+generanumerosa("txtBebeR",txt3)+generanumerosa("txtAdultoNR",txt4)+generanumerosa("txtNinoNR",txt5)+generanumerosa("txtBebeNR",txt6)+"</table>";
	else
		document.getElementById("numerosaenvio").innerHTML="";
}

/**********************************************************/

function paso1 (){
		document.getElementById('DisponibilidadVuelo').style.display='block';
		document.getElementById('PlandeVuelo').style.display='none';
}

/***********************************************************/

function paso2 (tipoida, tipovuelta){
	var error="";

	if (!(tarifaseleccionada(tipoida)))
		error="Debe Seleccionar tarifa para el vuelo de ida.\n";
	if (tipovuelta != "")
		if (!(tarifaseleccionada(tipovuelta)))
			error+="Debe Seleccionar tarifa para el vuelo de vuelta.\n";
	if (error != "")
		alert (error);
	else {
		document.getElementById('DisponibilidadVuelo').style.display='none';
		document.getElementById('PlandeVuelo').style.display='block';
		window.scroll(0,0);
	}
}

/**************************************************/

function redondear(num)      { 		
var original=parseFloat(num); 		
var result=Math.round(original*100)/100 ; 		
return result; 	
}

/***************************************************/

function seleccionarcombo (combo, opcion){
	
 for(ii=0;ii<document.getElementById(combo).options.length;ii++){
        if(document.getElementById(combo).options[ii].value == opcion){
            document.getElementById(combo).options[ii].selected=true;
        }
    }	
}

/**************************************************/

function redirect(x,temp){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
}

/**************************************/

var numvuelo = new Array();
var fechade = new Array();
var origen = new Array();
var destino = new Array();
var horasalida = new Array();
var horallegada = new Array();
var stasas = new Array();

var numvuelov = new Array();
var fechadev = new Array();
var origenv = new Array();
var destinov = new Array();
var horasalidav = new Array();
var horallegadav = new Array();
var stasasv = new Array();

var ntarifas = new Array(2);
var vofertas = new Array(2);
vofertas[0]=0;
vofertas[1]=0;

var vofertasfee = new Array(2);
vofertasfee[0]=0;
vofertasfee[1]=0;

var vtasas = new Array(2);
vtasas[0]=0;
vtasas[1]=0;

var vtarifas = new Array(2);
vtarifas[0]=0;
vtarifas[1]=0;






/***************************************************/

function buscartarifa (tipo,vector, farebasis,salida){
		
for (i=0;i<vector.length;i++)
if ((vector[i][0]==tipo) && (vector[i][1]==farebasis)){
		if  (salida==3)
				return redondear(vector[i][salida]*1-vector[i][5]*1);
			else{
				return redondear(vector[i][salida]*1);
			}
		}
}

/*****************************************************/

function tarifaseleccionada (tipo){
	
	var combo="";
	var ultimaopcion=document.getElementsByName("vuelo"+tipo)[document.getElementsByName("vuelo"+tipo).length-1].value;
resta=1;
    for (i=1;i<=ultimaopcion;i++)
	if (document.getElementById('fila'+tipo+i)){
		if ((document.getElementsByName("vuelo"+tipo)[i-resta].checked)&& (document.getElementById('tarifa'+tipo+i).options[document.getElementById('tarifa'+tipo+i).selectedIndex].value != "") )
		 	return true;			
		}
else
			resta++; 
	return false;
}

/****************************************************/

function marcafila(tipo,opcion,ntarifas,vtarifas,vtasas,vofertas,TAr,TNr,TBr,TA,TN,TB,TArt1,TNrt1,TBrt1,TAt1,TNt1,TBt1,TArt2,TNrt2,TBrt2,TAt2,TNt2,TBt2,NumPlazas){
	
var i;
var j=0;
var fechasalida="";
var fechallegada="";
document.getElementById('opcion'+tipo).value=opcion;

fechasalida=fechade[document.getElementById('opcionida').value][0]*1;
if (document.getElementById('opcionvuelta').value != "")
	fechallegada=fechadev[document.getElementById('opcionvuelta').value][0]*1;

if (fechasalida==fechallegada){
	if (horasalidav[document.getElementById('opcionvuelta').value][0] <= horallegada[document.getElementById('opcionida').value][numvuelo[document.getElementById('opcionida').value].length-1]){
	
	alert ("La hora de vuelta no puede ser menor o igual que la de ida");	
	document.getElementById('tarifa'+tipo+opcion).selectedIndex=0;
	return;
	}
}

var combo = document.getElementById('tarifa'+tipo+opcion).options[document.getElementById('tarifa'+tipo+opcion).selectedIndex].value.split("-");
document.getElementById('tarifa'+tipo).value=combo[0];
var combotext=document.getElementById('tarifa'+tipo+opcion).options[document.getElementById('tarifa'+tipo+opcion).selectedIndex].text;
var ultimaopcion=document.getElementsByName("vuelo"+tipo)[document.getElementsByName("vuelo"+tipo).length-1].value;

    for (i=1;i<=ultimaopcion;i++){
		if (document.getElementById('fila'+tipo+i)){
			if (document.getElementsByName("vuelo"+tipo)[j].value==opcion){
				 document.getElementById('fila'+tipo+i).style.backgroundColor="#f6b366";
				 document.getElementsByName("vuelo"+tipo)[j].checked=1; 
				 j++;
			}
			else {
           document.getElementById('fila'+tipo+i).style.backgroundColor="#FFFFFF";
		   document.getElementsByName("vuelo"+tipo)[j].checked=0; 
		   j++;
			}
		}
    }
		   if (tipo=="vuelta"){
			  ntarifas[1]=combo[0]; 
			  vtarifas[1]=combo[1];
			  vtasas[1]=combo[5];
			  vofertas[1]=combo[3];
  			  vofertasfee[1]=combo[4];
			  document.getElementById('VueltaTasas').value=stasasv[opcion];
			  numescalas=numvuelov[opcion].length;
			  /* inicializamos los vuelos **/
  		      for (ivuelo=1;ivuelo<=3;ivuelo++){
			 	document.getElementById('vueloVuelta['+ivuelo+'].numVuelo').value="";				
				document.getElementById('vueloVuelta['+ivuelo+'].origen').value="";
				document.getElementById('vueloVuelta['+ivuelo+'].destino').value="";
				document.getElementById('vueloVuelta['+ivuelo+'].fechaSalida').value="";
				document.getElementById('vueloVuelta['+ivuelo+'].clase').value="";
				document.getElementById('vueloVuelta['+ivuelo+'].HoraSalida').value="";
				document.getElementById('vueloVuelta['+ivuelo+'].HoraLlegada').value="";
			  }
			  
  		      for (ivuelo=1;ivuelo<=numescalas;ivuelo++){
			 	document.getElementById('vueloVuelta['+ivuelo+'].numVuelo').value=numvuelov[opcion][ivuelo-1];				
				document.getElementById('vueloVuelta['+ivuelo+'].origen').value=origenv[opcion][ivuelo-1];
				document.getElementById('vueloVuelta['+ivuelo+'].destino').value=destinov[opcion][ivuelo-1];
				document.getElementById('vueloVuelta['+ivuelo+'].fechaSalida').value=fechadev[opcion][ivuelo-1];
				document.getElementById('vueloVuelta['+ivuelo+'].clase').value=combo[0].substr(0,1);
				document.getElementById('vueloVuelta['+ivuelo+'].HoraSalida').value=horasalidav[opcion][ivuelo-1];
				document.getElementById('vueloVuelta['+ivuelo+'].HoraLlegada').value=horallegadav[opcion][ivuelo-1];
			  }
		   }
			else{
				ntarifas[0]=combo[0];
				vtarifas[0]=combo[1];
				vtasas[0]=combo[5];
				vofertas[0]=combo[3];
				vofertasfee[0]=combo[4];
				document.getElementById('IdaTasas').value=stasas[opcion];
				numescalas=numvuelo[opcion].length;
				for (ivuelo=1;ivuelo<=3;ivuelo++){
					document.getElementById('vueloIda['+ivuelo+'].numVuelo').value="";				
					document.getElementById('vueloIda['+ivuelo+'].origen').value="";
					document.getElementById('vueloIda['+ivuelo+'].destino').value="";
					document.getElementById('vueloIda['+ivuelo+'].fechaSalida').value="";
					document.getElementById('vueloIda['+ivuelo+'].clase').value="";
					document.getElementById('vueloIda['+ivuelo+'].HoraSalida').value="";
					document.getElementById('vueloIda['+ivuelo+'].HoraLlegada').value="";
				}				
				for (ivuelo=1;ivuelo<=numescalas;ivuelo++){
					document.getElementById('vueloIda['+ivuelo+'].numVuelo').value=numvuelo[opcion][ivuelo-1];				
					document.getElementById('vueloIda['+ivuelo+'].origen').value=origen[opcion][ivuelo-1];
					document.getElementById('vueloIda['+ivuelo+'].destino').value=destino[opcion][ivuelo-1];
					document.getElementById('vueloIda['+ivuelo+'].fechaSalida').value=fechade[opcion][ivuelo-1];
					document.getElementById('vueloIda['+ivuelo+'].clase').value=combo[0].substr(0,1);
					document.getElementById('vueloIda['+ivuelo+'].HoraSalida').value=horasalida[opcion][ivuelo-1];
					document.getElementById('vueloIda['+ivuelo+'].HoraLlegada').value=horallegada[opcion][ivuelo-1];
				}
			}
			
/*********************************************/			
			
function RellenaFormulario (TipoPasajero,tarifa,npasajeros,idayvuelta){
var Pasajeros;


if ((document.getElementById(TipoPasajero).value !="") && (document.getElementById(TipoPasajero).value !="0")){
	Pasajeros=document.getElementById(TipoPasajero).value*1;
	document.getElementById('IdaFareBasis').value=ntarifas[0];
	ImporteIda=buscartarifa ("ida",tarifa, ntarifas[0],2)/Pasajeros;
	
	OfertaIda=buscartarifa ("ida",tarifa, ntarifas[0],4)/Pasajeros;
	
	OfertaFeeIda=buscartarifa ("ida",tarifa, ntarifas[0],5)/Pasajeros;	
	Fee=buscartarifa (tipo,tarifa, combo[0],3);
	npasajeroscopia=npasajeros;
	for (i=1;i<=Pasajeros;i++){
		document.getElementById('passengers['+npasajeros+'].precio.tarifa.ida').value=redondear(ImporteIda);
		document.getElementById('passengers['+npasajeros+'].precio.fee').value=redondear(Fee*1/Pasajeros);
		document.getElementById('passengers['+npasajeros+'].descuento.billete.ida').value=redondear(OfertaIda);
		document.getElementById('passengers['+npasajeros+'].descuento.fee.ida').value=redondear(OfertaFeeIda);		
		npasajeros++;
	}
	if (idayvuelta==1){
		ImporteVuelta=buscartarifa ("vuelta",tarifa, ntarifas[1],2)/Pasajeros;
		OfertaVuelta=buscartarifa ("vuelta",tarifa, ntarifas[1],4)/Pasajeros;		
		OfertaFeeVuelta=buscartarifa ("vuelta",tarifa, ntarifas[1],5)/Pasajeros;				
		document.getElementById('VueltaFareBasis').value=ntarifas[1];
		
		for (i=1;i<=Pasajeros;i++){
			document.getElementById('passengers['+npasajeroscopia+'].precio.tarifa.vuelta').value=redondear(ImporteVuelta);
			document.getElementById('passengers['+npasajeroscopia+'].descuento.billete.vuelta').value=redondear(OfertaVuelta);			
			document.getElementById('passengers['+npasajeroscopia+'].descuento.fee.vuelta').value=redondear(OfertaFeeVuelta);						
			npasajeroscopia++;
		}
	}
}
return npasajeros;
}

/*************************************************/
			
if  (SoloIda){
	document.getElementById("ImporteTotal").style.display="block";
	document.getElementById("SinImporteTotal").style.display="none";
}

if ((vtarifas[0] > 0) && (vtarifas[1] > 0)){
	
	document.getElementById("ImporteTotal").style.display="block";
	document.getElementById("SinImporteTotal").style.display="none";
	if (combo[4]==0)	
		document.getElementById("rfee").innerHTML=redondear(combo[2]*1)+"&nbsp;&euro;";	
	else
		document.getElementById("rfee").innerHTML="<span style='text-decoration: line-through;'>"+redondear(combo[2])
	+"&nbsp;&euro;</span><br><span class='oferta'>"+redondear(combo[2]-combo[4])+"&nbsp;&euro;</span>";

	
	
	if ((vofertas[0]==0) && (vofertas[1]==0)){
		document.getElementById("rtarifa").innerHTML=redondear(vtarifas[0]*1+vtarifas[1]*1)+"&nbsp;&euro;";		
	//	document.getElementById("tdtarifa").style.display="none";
	}
	else{
		document.getElementById("rtarifa").innerHTML="<span style='text-decoration: line-through;'>"+redondear(vtarifas[0]*1+vofertas[0]*1+vtarifas[1]*1+vofertas[1]*1)+"&nbsp;&euro;</span><br><span class='oferta'>"+redondear(vtarifas[0]*1+vtarifas[1]*1)+"&nbsp;&euro;</span>";
//		document.getElementById("rtarifa").innerHTML=redondear(vtarifas[0]*1+vofertas[0]*1+vtarifas[1]*1+vofertas[1]*1);
	}
	
	if ((vofertas[0]==0) && (vofertas[1]==0) && combo[4]==0){
				document.getElementById("PrecioTotal").value=redondear(vtarifas[0]*1+vtarifas[1]*1+(vtasas[0]*1+vtasas[1]*1)*NumPlazas+combo[2]*1);	
		
			document.getElementById("rtotal").innerHTML=redondear(vtarifas[0]*1+vtarifas[1]*1+(vtasas[0]*1+vtasas[1]*1)*NumPlazas+combo[2]*1);		

	}
	else {
		document.getElementById("PrecioTotal").value=redondear((vtarifas[0]*1+vofertas[0]*1+vtarifas[1]*1+vofertas[1]*1)+(vtasas[0]*1+vtasas[1]*1)*NumPlazas+combo[2]*1);
	
document.getElementById("rtotal").innerHTML="<span style='text-decoration: line-through;'>"+redondear(vtarifas[0]*1+vofertas[0]*1+vtarifas[1]*1+vofertas[1]*1+(vtasas[0]*1+vtasas[1]*1)*NumPlazas+combo[2]*1)+"&nbsp;&euro;</span><br><span class='ofertabgnaranja'>"+redondear(vtarifas[0]*1+vtarifas[1]*1+(vtasas[0]*1+vtasas[1]*1)*NumPlazas+combo[2]*1-combo[4]*1)	+"&nbsp;&euro;</span>";
	
		
	}
	
//	document.getElementById("dtarifa").innerHTML=redondear(vofertas[0]*1+vofertas[1]*1);
	document.getElementById("rtasas").innerHTML=redondear(redondear(vtasas[0]*1+vtasas[1]*1)*NumPlazas);
	
	//document.getElementById("drfee").innerHTML=redondear(combo[4]*1);	
	//document.getElementById("rtotal").innerHTML=redondear(vtarifas[0]*1+vtarifas[1]*1+(vtasas[0]*1+vtasas[1]*1)*NumPlazas+combo[2]*1-combo[4]*1);		
	document.getElementById("ResumenTotal").innerHTML=redondear(vtarifas[0]*1+vtarifas[1]*1+(vtasas[0]*1+vtasas[1]*1)*NumPlazas+combo[2]*1-combo[4]*1);
	
		
	/*****************************************************/
			
	if (document.getElementById("RTAR"))
		document.getElementById("RTAR").innerHTML=buscartarifa ("ida",TAr, ntarifas[0],2)+buscartarifa ("vuelta",TAr, ntarifas[1],2);
		

	if (document.getElementById("RTARt1"))
		document.getElementById("RTARt1").innerHTML=buscartarifa ("ida",TArt1, ntarifas[0],2)+buscartarifa ("vuelta",TArt1, ntarifas[1],2);
		
	if (document.getElementById("RTARt2"))
		document.getElementById("RTARt2").innerHTML=buscartarifa ("ida",TArt2, ntarifas[0],2)+buscartarifa ("vuelta",TArt2, ntarifas[1],2);
		
		/******************** DESCUENTO TARIFA **********************/
		
/*	if (document.getElementById("RTARD"))
		document.getElementById("RTARD").innerHTML=buscartarifa ("ida",TAr, ntarifas[0],4)+buscartarifa ("vuelta",TAr, ntarifas[1],4);				

	if (document.getElementById("RTARDt1"))
		document.getElementById("RTARDt1").innerHTML=buscartarifa ("ida",TArt1, ntarifas[0],4)+buscartarifa ("vuelta",TArt1, ntarifas[1],4);
		
	if (document.getElementById("RTARDt2"))
		document.getElementById("RTARDt2").innerHTML=buscartarifa ("ida",TArt2, ntarifas[0],4)+buscartarifa ("vuelta",TArt2, ntarifas[1],4);*/
		
/********************************************************/

if (document.getElementById("RTaAR"))
		document.getElementById("RTaAR").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NAdultoR").value*1;
		
if (document.getElementById("RTaARt1"))
		document.getElementById("RTaARt1").innerHTML=redondear(redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NAdultoRt1").value*1);

if (document.getElementById("RTaARt2"))
		document.getElementById("RTaARt2").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NAdultoRt2").value*1;
		
/*************************** TARIFAS NIÑO RESIDENTE*****************************/		
		
	if (document.getElementById("RTNR"))
		document.getElementById("RTNR").innerHTML=redondear(buscartarifa ("ida",TNr, ntarifas[0],2)+buscartarifa ("vuelta",TNr, ntarifas[1],2));

	if (document.getElementById("RTNRt1"))
		document.getElementById("RTNRt1").innerHTML=redondear(buscartarifa ("ida",TNrt1, ntarifas[0],2)+buscartarifa ("vuelta",TNrt1, ntarifas[1],2));

	if (document.getElementById("RTNRt2"))
		document.getElementById("RTNRt2").innerHTML=redondear(buscartarifa ("ida",TNrt2, ntarifas[0],2)+buscartarifa ("vuelta",TNrt2, ntarifas[1],2));

/*	if (document.getElementById("RTNRD"))
		document.getElementById("RTNRD").innerHTML=buscartarifa ("ida",TNr, ntarifas[0],4)+buscartarifa ("vuelta",TNr, ntarifas[1],4);

	if (document.getElementById("RTNRDt1"))
		document.getElementById("RTNRDt1").innerHTML=buscartarifa ("ida",TNrt1, ntarifas[0],4)+buscartarifa ("vuelta",TNrt1, ntarifas[1],4);

	if (document.getElementById("RTNRDt2"))
		document.getElementById("RTNRDt2").innerHTML=buscartarifa ("ida",TNrt2, ntarifas[0],4)+buscartarifa ("vuelta",TNrt2, ntarifas[1],4);*/
		
/*********************************************************/		
		
if (document.getElementById("RTaNR"))
		document.getElementById("RTaNR").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NNinoR").value*1;	

if (document.getElementById("RTaNRt1"))
		document.getElementById("RTaNRt1").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NNinoRt1").value*1;	

if (document.getElementById("RTaNRt2"))
		document.getElementById("RTaNRt2").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NNinoRt2").value*1;	
		
/***************** TARIFAS BEBE RESIDENTE*********************/		

	if (document.getElementById("RTBR"))
		document.getElementById("RTBR").innerHTML=redondear(buscartarifa ("ida",TBr, ntarifas[0],2)+buscartarifa ("vuelta",TBr, ntarifas[1],2));
		
	if (document.getElementById("RTBRt1"))
		document.getElementById("RTBRt1").innerHTML=redondear(buscartarifa ("ida",TBrt1, ntarifas[0],2)+buscartarifa ("vuelta",TBrt1, ntarifas[1],2));

	if (document.getElementById("RTBRt2"))
		document.getElementById("RTBRt2").innerHTML=redondear(buscartarifa ("ida",TBrt2, ntarifas[0],2)+buscartarifa ("vuelta",TBrt2, ntarifas[1],2));
		
		
	/*if (document.getElementById("RTBRD"))
		document.getElementById("RTBRD").innerHTML=buscartarifa ("ida",TBr, ntarifas[0],4)+buscartarifa ("vuelta",TBr, ntarifas[1],4);
		
	if (document.getElementById("RTBRDt1"))
		document.getElementById("RTBRDt1").innerHTML=buscartarifa ("ida",TBrt1, ntarifas[0],4)+buscartarifa ("vuelta",TBrt1, ntarifas[1],4);

	if (document.getElementById("RTBRDt2"))
		document.getElementById("RTBRDt2").innerHTML=buscartarifa ("ida",TBrt2, ntarifas[0],4)+buscartarifa ("vuelta",TBrt2, ntarifas[1],4);*/
				
/**************************************/		
		
	if (document.getElementById("RTaBR"))
		document.getElementById("RTaBR").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NBebeR").value*1;
		
			if (document.getElementById("RTaBRt1"))
		document.getElementById("RTaBRt1").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NBebeRt1").value*1;
		
			if (document.getElementById("RTaBRt2"))
		document.getElementById("RTaBRt2").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NBebeRt2").value*1;

/******************************** TARIFAS ADULTO ***********************************************************************/

	if (document.getElementById("RTA"))
		document.getElementById("RTA").innerHTML=redondear(buscartarifa ("ida",TA, ntarifas[0],2)+buscartarifa ("vuelta",TA, ntarifas[1],2));

	if (document.getElementById("RTAt1"))
		document.getElementById("RTAt1").innerHTML=redondear(buscartarifa ("ida",TAt1, ntarifas[0],2)+buscartarifa ("vuelta",TAt1, ntarifas[1],2));

	if (document.getElementById("RTAt2"))
		document.getElementById("RTAt2").innerHTML=redondear(buscartarifa ("ida",TAt2, ntarifas[0],2)+buscartarifa ("vuelta",TAt2, ntarifas[1],2));
		
	/*if (document.getElementById("RTAD"))
		document.getElementById("RTAD").innerHTML=buscartarifa ("ida",TA, ntarifas[0],4)+buscartarifa ("vuelta",TA, ntarifas[1],4);

	if (document.getElementById("RTADt1"))
		document.getElementById("RTADt1").innerHTML=buscartarifa ("ida",TAt1, ntarifas[0],4)+buscartarifa ("vuelta",TAt1, ntarifas[1],4);

	if (document.getElementById("RTADt2"))
		document.getElementById("RTADt2").innerHTML=buscartarifa ("ida",TAt2, ntarifas[0],4)+buscartarifa ("vuelta",TAt2, ntarifas[1],4);*/
		
/**********************************/		
		
	if (document.getElementById("RTaA"))
		document.getElementById("RTaA").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NAdultoNR").value*1;

	if (document.getElementById("RTaAt1"))
		document.getElementById("RTaAt1").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NAdultoNRt1").value*1;

	if (document.getElementById("RTaAt2"))
		document.getElementById("RTaAt2").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NAdultoNRt2").value*1;

/************ TARIFAS NIÑO *************/		
		
	if (document.getElementById("RTN"))
		document.getElementById("RTN").innerHTML=redondear(buscartarifa ("ida",TN, ntarifas[0],2)+buscartarifa ("vuelta",TN, ntarifas[1],2));

	if (document.getElementById("RTNt1"))
		document.getElementById("RTNt1").innerHTML=redondear(buscartarifa ("ida",TNt1, ntarifas[0],2)+buscartarifa ("vuelta",TNt1, ntarifas[1],2));

	if (document.getElementById("RTNt2"))
		document.getElementById("RTNt2").innerHTML=redondear(buscartarifa ("ida",TNt2, ntarifas[0],2)+buscartarifa ("vuelta",TNt2, ntarifas[1],2));
		
/*	if (document.getElementById("RTND"))
		document.getElementById("RTND").innerHTML=buscartarifa ("ida",TN, ntarifas[0],4)+buscartarifa ("vuelta",TN, ntarifas[1],4);

	if (document.getElementById("RTNDt1"))
		document.getElementById("RTNDt1").innerHTML=buscartarifa ("ida",TNt1, ntarifas[0],4)+buscartarifa ("vuelta",TNt1, ntarifas[1],4);

	if (document.getElementById("RTNDt2"))
		document.getElementById("RTNDt2").innerHTML=buscartarifa ("ida",TNt2, ntarifas[0],4)+buscartarifa ("vuelta",TNt2, ntarifas[1],4);*/
		
/************************/

	if (document.getElementById("RTaN"))
		document.getElementById("RTaN").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NNinoNR").value*1;

	if (document.getElementById("RTaNt1"))
		document.getElementById("RTaNt1").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NNinoNRt1").value*1;

	if (document.getElementById("RTaNt2"))
		document.getElementById("RTaNt2").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NNinoNRt2").value*1;
		
/************* TARIFAS BEBE **********/		
		
	if (document.getElementById("RTB"))
		document.getElementById("RTB").innerHTML=redondear(buscartarifa ("ida",TB, ntarifas[0],2)+buscartarifa ("vuelta",TB, ntarifas[1],2));

	if (document.getElementById("RTBt1"))
		document.getElementById("RTBt1").innerHTML=redondear(buscartarifa ("ida",TBt1, ntarifas[0],2)+buscartarifa ("vuelta",TBt1, ntarifas[1],2));

	if (document.getElementById("RTBt2"))
		document.getElementById("RTBt2").innerHTML=redondear(buscartarifa ("ida",TBt2, ntarifas[0],2)+buscartarifa ("vuelta",TBt2, ntarifas[1],2));
		
	/*if (document.getElementById("RTBD"))
		document.getElementById("RTBD").innerHTML=redondear(buscartarifa ("ida",TB, ntarifas[0],4)+buscartarifa ("vuelta",TB, ntarifas[1],4));

	if (document.getElementById("RTBDt1"))
		document.getElementById("RTBDt1").innerHTML=redondear(buscartarifa ("ida",TBt1, ntarifas[0],4)+buscartarifa ("vuelta",TBt1, ntarifas[1],4));

	if (document.getElementById("RTBDt2"))
		document.getElementById("RTBDt2").innerHTML=redondear(buscartarifa ("ida",TBt2, ntarifas[0],4)+buscartarifa ("vuelta",TBt2, ntarifas[1],4));*/
		
/**********************/
		
	if (document.getElementById("RTaB"))
		document.getElementById("RTaB").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NBebeNR").value*1;

	if (document.getElementById("RTaBt1"))
		document.getElementById("RTaBt1").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NBebeNRt1").value*1;

	if (document.getElementById("RTaBt2"))
		document.getElementById("RTaBt2").innerHTML=redondear(vtasas[0]*1+vtasas[1]*1)*document.getElementById("NBebeNRt2").value*1;

/***********rellenar formulario *************/

npasajeros=1;
npasajeros=RellenaFormulario ("NAdultoRt1",TArt1,npasajeros,1);
npasajeros=RellenaFormulario ("NAdultoRt2",TArt2,npasajeros,1);
npasajeros=RellenaFormulario ("NAdultoR",TAr,npasajeros,1);

npasajeros=RellenaFormulario ("NNinoR",TNr,npasajeros,1);
npasajeros=RellenaFormulario ("NNinoRt1",TNrt1,npasajeros,1);
npasajeros=RellenaFormulario ("NNinoRt2",TNrt2,npasajeros,1);

npasajeros=RellenaFormulario ("NBebeR",TBr,npasajeros,1);
npasajeros=RellenaFormulario ("NBebeRt1",TBrt1,npasajeros,1);
npasajeros=RellenaFormulario ("NBebeRt2",TBrt2,npasajeros,1);

npasajeros=RellenaFormulario ("NAdultoNR",TA,npasajeros,1);
npasajeros=RellenaFormulario ("NAdultoNRt1",TAt1,npasajeros,1);
npasajeros=RellenaFormulario ("NAdultoNRt2",TAt2,npasajeros,1);

npasajeros=RellenaFormulario ("NNinoNR",TN,npasajeros,1);
npasajeros=RellenaFormulario ("NNinoNRt1",TNt1,npasajeros,1);
npasajeros=RellenaFormulario ("NNinoNRt2",TNt2,npasajeros,1);

npasajeros=RellenaFormulario ("NBebeNR",TB,npasajeros,1);
npasajeros=RellenaFormulario ("NBebeNRt1",TBt1,npasajeros,1);
npasajeros=RellenaFormulario ("NBebeNRt2",TBt2,npasajeros,1);

/******************/

}
else if (vtarifas[0] > 0){
	
	if ((vofertas[0]==0) && (vofertas[1]==0)){
		document.getElementById("rtarifa").innerHTML=redondear(vtarifas[0]*1)+"&nbsp;&euro;";
		// document.getElementById("tdtarifa").style.display="none";
document.getElementById("PrecioTotal").value=redondear(vtarifas[0]*1+vtasas[0]*NumPlazas+combo[2]*1);			
	}
	else{
		document.getElementById("rtarifa").innerHTML="<span style='text-decoration: line-through;'>"+redondear(vtarifas[0]*1+vofertas[0]*1)+"&nbsp;&euro;</span><br><span class='oferta'>"+redondear(vtarifas[0])+"&nbsp;&euro;</span>";	
		document.getElementById("PrecioTotal").value=redondear(vtarifas[0]*1+vofertas[0]*1+vtasas[0]*NumPlazas+combo[2]*1);	
	}
	//document.getElementById("dtarifa").innerHTML=redondear(vofertas[0]);
	document.getElementById("rtasas").innerHTML=redondear(vtasas[0]*NumPlazas);
	if (combo[4]==0)		
			document.getElementById("rfee").innerHTML=combo[2]+"&nbsp;&euro;";
	else
	document.getElementById("rfee").innerHTML="<span style='text-decoration: line-through;'>"+redondear(combo[2])
	+"&nbsp;&euro;</span><br><span class='oferta'>"+redondear(combo[2]-combo[4])+"&nbsp;&euro;</span>";
	//document.getElementById("drfee").innerHTML=redondear(combo[4]);
		if ((vofertas[0]==0) && (vofertas[1]==0) && (combo[4]==0)){
				document.getElementById("rtotal").innerHTML=redondear(vtarifas[0]*1+vtasas[0]*NumPlazas+combo[2]*1-combo[4]*1)+"&nbsp;&euro;";	

		}
		else
	document.getElementById("rtotal").innerHTML="<span style='text-decoration: line-through;'>"+redondear(vtarifas[0]*1+vofertas[0]*1+vtasas[0]*NumPlazas+combo[2]*1)+"&nbsp;&euro;</span><br><span class='ofertabgnaranja'>"+redondear(vtarifas[0]*1+vtasas[0]*1*NumPlazas+combo[2]*1-combo[4]*1)+"&nbsp;&euro;</span>";	
	document.getElementById("ResumenTotal").innerHTML=redondear(vtarifas[0]*1+vtasas[0]*NumPlazas+combo[2]*1-combo[4]*1);		
	
	
	/****************************************************************************/
	
	if (document.getElementById("RTAR"))
		document.getElementById("RTAR").innerHTML=buscartarifa (tipo,TAr, ntarifas[0],2);
		
	if (document.getElementById("RTARt1"))
		document.getElementById("RTARt1").innerHTML=buscartarifa (tipo,TArt1, ntarifas[0],2);
		
	if (document.getElementById("RTARt2"))
		document.getElementById("RTARt2").innerHTML=buscartarifa (tipo,TArt2, ntarifas[0],2);
		
				/*********************************** DESCUENTO TARIFAS ***************************************/		
		
/*	if (document.getElementById("RTARD"))
		document.getElementById("RTARD").innerHTML=buscartarifa (tipo,TAr, ntarifas[0],4);
		
	if (document.getElementById("RTARDt1"))
		document.getElementById("RTARDt1").innerHTML=buscartarifa (tipo,TArt1, ntarifas[0],4);
		
	if (document.getElementById("RTARDt2"))
		document.getElementById("RTARDt2").innerHTML=buscartarifa (tipo,TArt2, ntarifas[0],4);	*/	
			
	/******************************************************************/		

if (document.getElementById("RTaAR"))
		document.getElementById("RTaAR").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NAdultoR").value*1;
		
if (document.getElementById("RTaARt1"))
		document.getElementById("RTaARt1").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NAdultoRt1").value*1;

if (document.getElementById("RTaARt2"))
		document.getElementById("RTaARt2").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NAdultoRt2").value*1;

/****************************************** TARIFAS NIÑO RESIDENTE *******************************************************/
		
	if (document.getElementById("RTNR"))
		document.getElementById("RTNR").innerHTML=buscartarifa (tipo,TNr, ntarifas[0],2);
		
	if (document.getElementById("RTNRt1"))
		document.getElementById("RTNRt1").innerHTML=buscartarifa (tipo,TNrt1, ntarifas[0],2);

	if (document.getElementById("RTNRt2"))
		document.getElementById("RTNRt2").innerHTML=buscartarifa (tipo,TNrt2, ntarifas[0],2);
		
		/****** DESCUENTOS ***********/
		
/*	if (document.getElementById("RTNRD"))
		document.getElementById("RTNRD").innerHTML=buscartarifa (tipo,TNr, ntarifas[0],4);
		
	if (document.getElementById("RTNRDt1"))
		document.getElementById("RTNRDt1").innerHTML=buscartarifa (tipo,TNrt1, ntarifas[0],4);

	if (document.getElementById("RTNRDt2"))
		document.getElementById("RTNRDt2").innerHTML=buscartarifa (tipo,TNrt2, ntarifas[0],4);*/
				
/************************/		
		
if (document.getElementById("RTaNR"))
		document.getElementById("RTaNR").innerHTML=redondear(vtasas[0])*document.getElementById("NNinoR").value*1;
		
if (document.getElementById("RTaNRt1"))
		document.getElementById("RTaNRt1").innerHTML=redondear(vtasas[0])*document.getElementById("NNinoRt1").value*1;

if (document.getElementById("RTaNRt2"))
		document.getElementById("RTaNRt2").innerHTML=redondear(vtasas[0])*document.getElementById("NNinoRt2").value*1;
		
/*************** TARIFAS BEBE RESIDENTE ***********/		
		
	if (document.getElementById("RTBR"))
		document.getElementById("RTBR").innerHTML=buscartarifa (tipo,TBr, ntarifas[0],2);		

	if (document.getElementById("RTBRt1"))
		document.getElementById("RTBRt1").innerHTML=buscartarifa (tipo,TBrt1, ntarifas[0],2);

	if (document.getElementById("RTBRt2"))
		document.getElementById("RTBRt2").innerHTML=buscartarifa (tipo,TBrt2, ntarifas[0],2);
		
/*	if (document.getElementById("RTBRD"))
		document.getElementById("RTBRD").innerHTML=buscartarifa (tipo,TBr, ntarifas[0],4);		

	if (document.getElementById("RTBRDt1"))
		document.getElementById("RTBRDt1").innerHTML=buscartarifa (tipo,TBrt1, ntarifas[0],4);

	if (document.getElementById("RTBRDt2"))
		document.getElementById("RTBRDt2").innerHTML=buscartarifa (tipo,TBrt2, ntarifas[0],4);*/
				
/**************************************/		

	if (document.getElementById("RTaBR"))
		document.getElementById("RTaBR").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NBebeR").value*1;

	if (document.getElementById("RTaBRt1"))
		document.getElementById("RTaBRt1").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NBebeRt1").value*1;

	if (document.getElementById("RTaBRt2"))
		document.getElementById("RTaBRt2").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NBebeRt2").value*1;

/********* TARIFAS ADULTO ************/

	if (document.getElementById("RTA"))
		document.getElementById("RTA").innerHTML=buscartarifa (tipo,TA, ntarifas[0],2);

	if (document.getElementById("RTAt1"))
		document.getElementById("RTAt1").innerHTML=buscartarifa (tipo,TAt1, ntarifas[0],2);

	if (document.getElementById("RTAt2"))
		document.getElementById("RTAt2").innerHTML=buscartarifa (tipo,TAt2, ntarifas[0],2);
		
/*	if (document.getElementById("RTAD"))
		document.getElementById("RTAD").innerHTML=buscartarifa (tipo,TA, ntarifas[0],4);

	if (document.getElementById("RTADt1"))
		document.getElementById("RTADt1").innerHTML=buscartarifa (tipo,TAt1, ntarifas[0],4);

	if (document.getElementById("RTADt2"))
		document.getElementById("RTADt2").innerHTML=buscartarifa (tipo,TAt2, ntarifas[0],4);*/
				
/*******************/		
		
	if (document.getElementById("RTaA"))
		document.getElementById("RTaA").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NAdultoNR").value*1;
		
	if (document.getElementById("RTaAt1"))
		document.getElementById("RTaAt1").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NAdultoNRt1").value*1;

	if (document.getElementById("RTaAt2"))
		document.getElementById("RTaAt2").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NAdultoNRt2").value*1;
		
/******* TARIFAS NIÑO *********/		
		

		
	if (document.getElementById("RTN"))
		document.getElementById("RTN").innerHTML=buscartarifa (tipo,TN, ntarifas[0],2);

	if (document.getElementById("RTNt1"))
		document.getElementById("RTNt1").innerHTML=buscartarifa (tipo,TNt1, ntarifas[0],2);

	if (document.getElementById("RTNt2"))
		document.getElementById("RTNt2").innerHTML=buscartarifa (tipo,TNt2, ntarifas[0],2);

	/*if (document.getElementById("RTND"))
		document.getElementById("RTND").innerHTML=buscartarifa (tipo,TN, ntarifas[0],4);

	if (document.getElementById("RTNDt1"))
		document.getElementById("RTNDt1").innerHTML=buscartarifa (tipo,TNt1, ntarifas[0],4);

	if (document.getElementById("RTNDt2"))
		document.getElementById("RTNDt2").innerHTML=buscartarifa (tipo,TNt2, ntarifas[0],4);*/

/**********************/		
		
		if (document.getElementById("RTaN"))
		document.getElementById("RTaN").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NNinoNR").value*1;

		if (document.getElementById("RTaNt1"))
		document.getElementById("RTaNt1").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NNinoNRt1").value*1;

		if (document.getElementById("RTaNt2"))
		document.getElementById("RTaNt2").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NNinoNRt2").value*1;

/********** TARIFAS BEBE *********/		
		
	if (document.getElementById("RTB"))
		document.getElementById("RTB").innerHTML=buscartarifa (tipo,TB, ntarifas[0],2);

	if (document.getElementById("RTBt1"))
		document.getElementById("RTBt1").innerHTML=buscartarifa (tipo,TBt1, ntarifas[0],2);

	if (document.getElementById("RTBt2"))
		document.getElementById("RTBt2").innerHTML=buscartarifa (tipo,TBt2, ntarifas[0],2);
		
	/*if (document.getElementById("RTBD"))
		document.getElementById("RTBD").innerHTML=buscartarifa (tipo,TB, ntarifas[0],4);

	if (document.getElementById("RTBDt1"))
		document.getElementById("RTBDt1").innerHTML=buscartarifa (tipo,TBt1, ntarifas[0],4);

	if (document.getElementById("RTBDt2"))
		document.getElementById("RTBDt2").innerHTML=buscartarifa (tipo,TBt2, ntarifas[0],4);
				*/
/*************/		

	if (document.getElementById("RTaB"))
		document.getElementById("RTaB").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NBebeNR").value*1;	

	if (document.getElementById("RTaBt1"))
		document.getElementById("RTaBt1").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NBebeNRt1").value*1;	

	if (document.getElementById("RTaBt2"))
		document.getElementById("RTaBt2").innerHTML=redondear(vtasas[0]*1)*document.getElementById("NBebeNRt2").value*1;	
	
npasajeros=1;
npasajeros=RellenaFormulario ("NAdultoRt1",TArt1,npasajeros,0);
npasajeros=RellenaFormulario ("NAdultoRt2",TArt2,npasajeros,0);
npasajeros=RellenaFormulario ("NAdultoR",TAr,npasajeros,0);

npasajeros=RellenaFormulario ("NNinoR",TNr,npasajeros,0);
npasajeros=RellenaFormulario ("NNinoRt1",TNrt1,npasajeros,0);
npasajeros=RellenaFormulario ("NNinoRt2",TNrt2,npasajeros,0);

npasajeros=RellenaFormulario ("NBebeR",TBr,npasajeros,0);
npasajeros=RellenaFormulario ("NBebeRt1",TBrt1,npasajeros,0);
npasajeros=RellenaFormulario ("NBebeRt2",TBrt2,npasajeros,0);

npasajeros=RellenaFormulario ("NAdultoNR",TA,npasajeros,0);
npasajeros=RellenaFormulario ("NAdultoNRt1",TAt1,npasajeros,0);
npasajeros=RellenaFormulario ("NAdultoNRt2",TAt2,npasajeros,0);

npasajeros=RellenaFormulario ("NNinoNR",TN,npasajeros,0);
npasajeros=RellenaFormulario ("NNinoNRt1",TNt1,npasajeros,0);
npasajeros=RellenaFormulario ("NNinoNRt2",TNt2,npasajeros,0);

npasajeros=RellenaFormulario ("NBebeNR",TB,npasajeros,0);
npasajeros=RellenaFormulario ("NBebeNRt1",TBt1,npasajeros,0);
npasajeros=RellenaFormulario ("NBebeNRt2",TBt2,npasajeros,0);	

}

	document.getElementById("ptarifa"+tipo).innerHTML=combotext;
	document.getElementById("pcondiciones"+tipo).innerHTML='<a href="#" onclick="javascript:muestratarifa(\''+combo[0]+'\',document.getElementById(\'vueloIda[1].origen\').value,document.getElementById(\'vueloIda[1].destino\').value);"><img src="img/ico/ico-condiciones.gif" width="13" height="15"></a>';
	
	document.getElementById("pinfovuelo"+tipo).innerHTML=document.getElementById("infovuelo"+tipo+opcion).innerHTML;
					
		/***************/
		
		if (document.getElementById("RFAR"))
			document.getElementById("RFAR").innerHTML=buscartarifa (tipo,TAr, combo[0],3);
			
		if (document.getElementById("RFARt1"))
			document.getElementById("RFARt1").innerHTML=buscartarifa (tipo,TArt1, combo[0],3);
		
		if (document.getElementById("RFARt2"))
			document.getElementById("RFARt2").innerHTML=buscartarifa (tipo,TArt2, combo[0],3);
			
			
			
		/*if (document.getElementById("RFARD"))
			document.getElementById("RFARD").innerHTML=buscartarifa (tipo,TAr, combo[0],5);
			
		if (document.getElementById("RFARDt1"))
			document.getElementById("RFARDt1").innerHTML=buscartarifa (tipo,TArt1, combo[0],5);
		
		if (document.getElementById("RFARDt2"))
			document.getElementById("RFARDt2").innerHTML=buscartarifa (tipo,TArt2, combo[0],5);*/
			
			
			
			
/*********************************/			
			
	if (document.getElementById("RFNR"))		
		document.getElementById("RFNR").innerHTML=buscartarifa (tipo,TNr, combo[0],3);	

	if (document.getElementById("RFNRt1"))		
		document.getElementById("RFNRt1").innerHTML=buscartarifa (tipo,TNrt1, combo[0],3);	

	if (document.getElementById("RFNRt2"))		
		document.getElementById("RFNRt2").innerHTML=buscartarifa (tipo,TNrt2, combo[0],3);	
		
		
	/*if (document.getElementById("RFNRD"))		
		document.getElementById("RFNRD").innerHTML=buscartarifa (tipo,TNr, combo[0],5);	

	if (document.getElementById("RFNRDt1"))		
		document.getElementById("RFNRDt1").innerHTML=buscartarifa (tipo,TNrt1, combo[0],5);	

	if (document.getElementById("RFNRDt2"))		
		document.getElementById("RFNRDt2").innerHTML=buscartarifa (tipo,TNrt2, combo[0],5);	*/
		
		
/*******************************/		
				
if (document.getElementById("RFBR"))		
		document.getElementById("RFBR").innerHTML=buscartarifa (tipo,TBr, combo[0],3);	

if (document.getElementById("RFBRt1"))		
		document.getElementById("RFBRt1").innerHTML=buscartarifa (tipo,TBrt1, combo[0],3);
		
if (document.getElementById("RFBRt2"))		
		document.getElementById("RFBRt2").innerHTML=buscartarifa (tipo,TBrt2, combo[0],3);		
		
/*if (document.getElementById("RFBRD"))		
		document.getElementById("RFBRD").innerHTML=buscartarifa (tipo,TBr, combo[0],5);	

if (document.getElementById("RFBRDt1"))		
		document.getElementById("RFBRDt1").innerHTML=buscartarifa (tipo,TBrt1, combo[0],5);
		
if (document.getElementById("RFBRDt2"))		
		document.getElementById("RFBRDt2").innerHTML=buscartarifa (tipo,TBrt2, combo[0],5);				
				*/
/**********************************/		


	if (document.getElementById("RFA"))
		document.getElementById("RFA").innerHTML=buscartarifa (tipo,TA, combo[0],3);
		

				
	if (document.getElementById("RFAt1"))
		document.getElementById("RFAt1").innerHTML=buscartarifa (tipo,TAt1, combo[0],3);

	if (document.getElementById("RFAt2"))
		document.getElementById("RFAt2").innerHTML=buscartarifa (tipo,TAt2, combo[0],3);
		
	/*if (document.getElementById("RFAD"))
		document.getElementById("RFAD").innerHTML=buscartarifa (tipo,TA, combo[0],5);
				
	if (document.getElementById("RFADt1"))
		document.getElementById("RFADt1").innerHTML=buscartarifa (tipo,TAt1, combo[0],5);

	if (document.getElementById("RFADt2"))
		document.getElementById("RFADt2").innerHTML=buscartarifa (tipo,TAt2, combo[0],5);*/
		
		
/*************************************/		

	if (document.getElementById("RFN"))		
		document.getElementById("RFN").innerHTML=buscartarifa (tipo,TN, combo[0],3);	

	if (document.getElementById("RFNt1"))		
		document.getElementById("RFNt1").innerHTML=buscartarifa (tipo,TNt1, combo[0],3);	

	if (document.getElementById("RFNt2"))		
		document.getElementById("RFNt2").innerHTML=buscartarifa (tipo,TNt2, combo[0],3);	
		
	/*if (document.getElementById("RFND"))		
		document.getElementById("RFND").innerHTML=buscartarifa (tipo,TN, combo[0],5);	

	if (document.getElementById("RFNDt1"))		
		document.getElementById("RFNDt1").innerHTML=buscartarifa (tipo,TNt1, combo[0],5);	

	if (document.getElementById("RFNDt2"))		
		document.getElementById("RFNDt2").innerHTML=buscartarifa (tipo,TNt2, combo[0],5);	*/
		

/****************************************/		
	if (document.getElementById("RFB"))		
		document.getElementById("RFB").innerHTML=buscartarifa (tipo,TB, combo[0],3);

	if (document.getElementById("RFBt1"))		
		document.getElementById("RFBt1").innerHTML=buscartarifa (tipo,TBt1, combo[0],3);

	if (document.getElementById("RFBt2"))		
		document.getElementById("RFBt2").innerHTML=buscartarifa (tipo,TBt2, combo[0],3);
		
	/*if (document.getElementById("RFBD"))		
		document.getElementById("RFBD").innerHTML=buscartarifa (tipo,TB, combo[0],5);

	if (document.getElementById("RFBDt1"))		
		document.getElementById("RFBDt1").innerHTML=buscartarifa (tipo,TBt1, combo[0],5);

	if (document.getElementById("RFBDt2"))		
		document.getElementById("RFBDt2").innerHTML=buscartarifa (tipo,TBt2, combo[0],5);*/
		
		
/************************************/		
		
return vtarifas;
}

/********************************************** MUESTRA TARIFA ***************************/

function muestratarifa (fare, origen, destino){
	window.open('condicionestarifa.php?fare='+ fare.split("-")[0] + '&idioma=' + 'es&Origen='+origen+'&Destino='+destino, 'condicionestarifa', 'width=760,height=500,resizable=yes,scrollbars=yes');
	return false;

}

/***********************************/

function olvidocontrasena (){
	window.open('http://www.islaspremium.com/site/fly/microsite/recordar.php', 'condicionestarifa', 'width=611,height=500,resizable=no,scrollbars=no');
	return false;

}

