//<script type="text/javascript">
		//variables fijas, no tocar
	/*	var d1;											//objetos date
		var d2;
		var c1 = new Calendar(1, d1, onSelect1, null);  //calendarios 	
		var c2 = new Calendar(1, d2, onSelect2, null);
		var arr_Precios1=new Array();					//arrays de precios inicilializados
		var arr_Precios2=new Array();	//Realizando búsqueda...
		var searchMsg = '<table class="horarios" summary="Horarios" cellspacing="0" border="1" align="center">'
						+ '<caption>Realizando búsqueda...</caption>'
						+ '<tbody></tbody></table>';	//mensaje de busqueda 		
		var searchMsgCalendar = '<strong>Buscando calendario de precios...</strong>';	//mensaje de busqueda 	
		var cabeceraVtaTxt = '<h4>Vuelo de vuelta</h4>';
		var v_tarificacionRT ='N';
		var julian_timida ='';
		var julian_timvta ='';
		var ofe_ida ='';
		var ofe_vta ='';

		var flashObject='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="275" height="80">'
			+'<param name="movie" value="swf/loading.swf" />'
			+'<param name="quality" value="high" />'
			+'<embed src="swf/loading.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="275" height="80">'+'</embed>'
			+'</object>';
		//pasajeros seleccion (combos)
		var numpaxida = null;		var numpaxvta = null;
		var today = new Date();  //fecha de carga para controlar eventos de seleccion de calendario  (Evento onSelect)
		today.setHours(0,0,0,0);
*/
var seleccion="seleccion";
// listado de aeropuertos con Dto. Residente.
var list_apts_dtores ="PMI,IBZ,MAH,TFS,TFN,LPA,ACE,FUE,TCI";

/* ini */

// Array con la lista de paises, de mercados disponibles

var paises =new Array();

		paises['ES'] = "España";
		paises['FR'] = "France";
	  paises['IT'] = "Italia";
	  paises['UK'] = "United Kingdom";
	  paises['PT'] = "Portugal";
		paises['AR'] = "Argentina";
		paises['BR'] = "Brasil";
		paises['VE'] = "Venezuela";
		paises['DO'] = "Rep. Dominicana";
		paises['MX'] = "México";
		paises['US'] = "USA";
		paises['OT'] = "Otros/Others";

var short_paises=new Array();

		short_paises['ES'] = "ES";
		short_paises['FR'] = "FR";
		short_paises['IT'] = "IT";
		short_paises['UK'] = "UK";
		short_paises['AR'] = "AR";
		short_paises['BR'] = "BR";
		short_paises['BR'] = "BR";
		short_paises['VE'] = "VE";
		short_paises['DO'] = "DO";
		short_paises['MX'] = "MX";
		short_paises['US'] = "US";
		short_paises['PT'] = "PT";
    short_paises['OT'] = "OT";
		

// Array con la descripcion de todos los idiomas disponibles

var desc_idiomas =new Array();

		desc_idiomas['IT'] = "Italiano";
		desc_idiomas['FR'] = "Français";
		desc_idiomas['ES'] = "Español";
		desc_idiomas['CA'] = "Català";
		desc_idiomas['AR'] = "Argentino";
		desc_idiomas['BR'] = "Português";
		desc_idiomas['EN'] = "English";
		desc_idiomas['PT'] = "Português";

var short_desc_idiomas =new Array();

		short_desc_idiomas['Italiano'] = "IT";
		short_desc_idiomas['Français'] = "FR";
		short_desc_idiomas['Español'] = "ES";
		short_desc_idiomas['Català'] = "CA";
		short_desc_idiomas['Argentino'] = "AR";
		short_desc_idiomas['Português'] = "BR";
		short_desc_idiomas['English'] = "EN";
		short_desc_idiomas['Português'] = "PT";

var idiomas =new Array();

		idiomas['IT'] = [['IT']];
		idiomas['FR'] = [['FR']];
		idiomas['UK'] = [['EN']];
		idiomas['ES'] = [['ES'], ['EN'], ['CA']];
		idiomas['AR'] = [['ES']];
		idiomas['BR'] = [['BR']];
		idiomas['MX'] = [['ES']];
		idiomas['DO'] = [['ES']];
		idiomas['VE'] = [['ES']];
		idiomas['US'] = [['EN']];
		idiomas['PT'] = [['PT']];
		idiomas['PE'] = [['ES']];
		idiomas['OT'] = [['EN']];	// OT = otros
/* fin */

function getFlashObj(h,w){
			var flashTxt='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'">'
			+'<param name="movie" value="swf/loading.swf" />'
			+'<param name="quality" value="high" />'
			+'<embed src="swf/loading.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'">'+'</embed>'	+'</object>';
			return flashTxt;
		}
		function generaCombosPax(){
			//genera los combos de pasajeros a partir de la disponibilidad seleccionada
			numpaxida = (isNaN(numpaxida)||numpaxida==null)? 9 : numpaxida;			//en caso de valor no valido o numpax nulo 
			numpaxvta = (isNaN(numpaxvta)||numpaxvta==null)? 9 : numpaxvta;
			if (numpaxida < numpaxvta){					paxcombo = numpaxida;
			}else{										paxcombo = numpaxvta;		}
			var posCombo = 0;
			document.getElementById('comboinf').options.length = 0;				
			document.getElementById('comboadl').options.length = 0;				
			document.getElementById('combochd').options.length = 0;				
			for (numpax=0;numpax<=paxcombo;numpax++){
				if (numpax > 0)		  generaOpcionCombo(numpax,numpax,'comboadl', posCombo -1);	  //el 0 no existe para adultos
				if (numpax < paxcombo)generaOpcionCombo(numpax,numpax,'combochd', posCombo);  //uno menos que adulto
				generaOpcionCombo(numpax,numpax,'comboinf', posCombo);						  //infants => todos
				posCombo++;
			}
		}

		function showInfoPrecioMenu(valor){
			if (valor == 1){	changeVisibility('publicidad','hide');	changeVisibility('infoViaje','show');	//lo mostramos
			}else{				changeVisibility('infoViaje','hide');	changeVisibility('publicidad','show');	//lo ocultamos
			}
		}


		//variables de importes (suma total para usuario)
	/*	var l_impfee   =0;	var l_imptaxtotal=0;	
		var l_imptaxida=0;	var l_imptaxvta=0;
		var l_impbaseida=0;	var l_impbasevta=0;
		var l_imptotal=0;
		var l_coddiv;
		var ptos_ida=0;
		var ptos_vta=0;
		//
		var l_resfee   =0;
		var l_resida   =0;
		var l_resvta   =0;
		*/
		//function setInfoTime(horasalida,horallegada,coste,divisa,sentido)
		//function setInfoCostes(tasas,sfee,total,divisa,residente)
		function setVueloV3(hdep,harr,impbase,imptax,impfee,impfeeRes,impbaseRes,puntos,coddiv,codvuelo,codcla,codfb,sentido,info_adic,plazas,milis,seqofe){	
		 //l_resvta=0;
		 //l_impbasevta=0; // AQUI CHANGE
		 //l_imptaxvta=0; // AQUI CHANGE
		 if (puntos!=''){v_puntos=parseInt(puntos);
			}else{			v_puntos=0;			}
/*			alert(hdep + ' - ' + harr + '\n'
			+	codvuelo + '-'+codcla + '-' + codfb + '-'+sentido+'\n'
			+	impbase + '-'+ impbaseRes + '-'+ impfee +'-'+ impfeeRes+ '-'+ imptax);*/
			setInfoTime(hdep,harr,impbase,coddiv,sentido,info_adic);		//set del vuelo seleccionado en el menu
			putPlazasDia(sentido,plazas);									//redimensionamos combos y escribimos plazas
			if (sentido =='ida'){	
				ptos_ida=v_puntos;
				numpaxida	 = parseFloat(plazas.replace(',','.'));	
				l_impbaseida = parseFloat(impbase.replace(',','.'));						
				l_imptaxida	 = parseFloat(imptax.replace(',','.'));	
				//document.getElementById('codbloqida').value=codvuelo;		//set del formulario de bloqueo
				document.foBloqVuelos.p_codtraida.value=codvuelo;
				julian_timida =parseFloat(milis.replace(',','.'));						
				ofe_ida =seqofe;
				if (impbaseRes!=''){//se trata de dcto residente
					l_resida = parseFloat(impbaseRes.replace(',','.'));						
					l_resfee = parseFloat(impfeeRes.replace(',','.'));						
				}else{
					l_resida = 0;						
					l_resfee = 0;						
				}
			}else{				
				ptos_vta=v_puntos;			
				numpaxvta	 = parseFloat(plazas.replace(',','.'));	
				l_impbasevta = parseFloat(impbase.replace(',','.'));						
				l_imptaxvta	 = parseFloat(imptax.replace(',','.'));		
				//document.getElementById('codbloqvta').value=codvuelo;		//set del formulario de bloqueo
				document.foBloqVuelos.p_codtravta.value=codvuelo;
				julian_timvta =parseFloat(milis.replace(',','.'));						
				ofe_vta =seqofe;
				if (impbaseRes!=''){//se trata de dcto residente
					l_resvta = parseFloat(impbaseRes.replace(',','.'));						
					l_resfee = parseFloat(impfeeRes.replace(',','.'));						
				}else{
					l_resvta = 0;						
					l_resfee = 0;						
				}
			}
			l_impfee	  = parseFloat(impfee.replace(',','.'));	
			l_coddiv	  =	coddiv;
			showtotal();
			showInfoPuntos();
			generaCombosPax();														//generamos combo a partir de seleccion de usuario
		}
		
		function limpiarImpVta(){
		 l_impbasevta=0; // AQUI CHANGE
		 l_imptaxvta=0; // AQUI CHANGE
		}
    

		function showInfoPuntos(){
			/*if ((ptos_vta + ptos_ida)>0){
				var divinfoPuntos = '';
				divinfoPuntos= '<div id="infoTotal">';
				divinfoPuntos+='<h4>Para cada titular<br/>'+parseInt(ptos_vta + ptos_ida)+'&#160;ptos Fidelitas</h4>';
				divinfoPuntos+='</div>';
				writeObj(divinfoPuntos,'infoPuntos');
			}else{
				writeObj('','infoPuntos');
			}*/
		}
	
		function valida_horasvuelos(){  //&&
			//if(document.getElementById('codbloqida').value != '' && document.getElementById('codbloqvta')!='' && radio_button_checker('document.foTiptra.rbtn_tiptra') =='RT'){
			if(document.foBloqVuelos.p_codtraida.value != '' && document.foBloqVuelos.p_codtravta!='' && radio_button_checker('document.foTiptra.rbtn_tiptra') =='RT'){	
				if (julian_timida > julian_timvta){			return false;
				}else{										return true;
				}
			}
			return true;
		}


		function valida_seleccion(){//&&
			if(radio_button_checker('document.foTiptra.rbtn_tiptra') =='RT'){
			  if (document.getElementById('combo_aptdep').value=='' || document.getElementById('combo_aptarr').value==''){
			     alert('- Vous devez saisir un aéroport de départ et destination');
			     return false;
			    }
				//if (document.getElementById('codbloqida').value != '' && document.getElementById('codbloqvta').value !=''){ return true;
  		     	if (document.foBloqVuelos.p_codtraida.value != '' && document.foBloqVuelos.p_codtravta.value !=''){return true;
				}else{return false;}
			}else{
				    if (document.getElementById('combo_aptdep').value=='' || document.getElementById('combo_aptarr').value==''  || document.getElementById('combo_aptarr').value=='0' || document.getElementById('combo_aptdep').value=='0'){
				        alert('- Vous devez saisir un aéroport de départ et destination');					
				        return false;
				    }
				   // if (document.getElementById('codbloqida').value != ''){return true;
	   				if (document.foBloqVuelos.p_codtraida.value != ''){return true;				
				    }else{return false;}
			}
		}

		function valida_ofertas(){//&&
			if(radio_button_checker('document.foTiptra.rbtn_tiptra') =='RT'){
				if (ofe_ida != '' && (ofe_vta == '' || ofe_vta == null)){	return false;			}
				if ((ofe_ida == '' || ofe_ida == null) && ofe_vta != ''){	return false;			}	
				return true;
			}
			return true;
		}

    function cargaIdiomas(paisId, idiomaId){
		 var posComboIdioma=0;
		 var aptPai= document.getElementById(paisId).value;
		 var l_idioma = idiomas[aptPai];
		 //var nomIdioma;
		 document.getElementById(idiomaId).options.length=0;
		 //generaOpcionCombo('...',0,comboId,0);
		 generaOpcionCombo('...',0,idiomaId,0);
		 for(listaIdioma in l_idioma){
		 //alert('entra en bucle');
		 var arrIdioma=l_idioma[listaIdioma];
		 posComboIdioma++;
		 nomIdioma=desc_idiomas[arrIdioma[0]];
		 generaOpcionCombo(nomIdioma,arrIdioma[0],idiomaId,posComboIdioma);
		 }
		}
		
		function showDctoResi(total,coddiv,dcto){
			var divinfoResi = '';
			divinfoResi= '<div id="infoTotal">';
			divinfoResi+='<strong id="descuento">'+total+' '+coddiv+' <br/>(-'+dcto+'% dto. residente)'+'</strong>'
			divinfoResi +='</div>';
			writeObj(divinfoResi,'infoCosteResi');
		}

		function showtotal(){
			l_imptaxtotal = l_imptaxida   + l_imptaxvta;
			l_imptotal	  = l_imptaxtotal + l_impfee + l_impbaseida + l_impbasevta;
			//mostramos info costes asociados
			//alert('l_imptotal:'+l_imptotal);
			//alert('l_imbaseida:'+l_impbaseida);
     		//alert('l_imbasevta:'+l_impbasevta);
			setInfoCostes(l_imptaxtotal.toFixed(2),l_impfee.toFixed(2),l_imptotal.toFixed(2),l_coddiv,'n');	
			if (l_resida!=0){	
				l_impresidente = l_resfee + l_resida + l_resvta + l_imptaxtotal;
				showDctoResi(l_impresidente.toFixed(2),l_coddiv,'50');
			}else{
				writeObj('','infoCosteResi');
			}
		}

		//
		function setDisponibilidad(content,opener){			
			var divId;		//guarda el contenido lanzado en el iframe sobre el marco de disponibilidad de la ventana
			if (opener =='ifDispoI'){
				divId='dispoBox1';
				/*Andres: ida cargada.Desbloqueamos calendario ida */
				setClassName('calendarcontainer_ow', 'cont_cal');
				c1.bloqCalendar=false;
				changeVisibility('loadingIda','hide');
			}
			if (opener =='ifDispoV'){
				divId='dispoBox2';
				/*Andres: ida cargada.Desbloqueamos calendario vuelta */
				setClassName('calendarcontainer_rt', 'cont_cal');
				c2.bloqCalendar=false;
				changeVisibility('loadingVta','hide');
				if (document.getElementById("sec_ida").style.display=='block'){
					setClassName('calendarcontainer_ow', 'cont_cal');
					c1.bloqCalendar=false;
					changeVisibility('loadingIda','hide');
				}
			}
			writeObj(content,divId);			
		}


		function submit_SearchV3(){			//realiza la busqueda de calendario, e inicializa la reserva
			resetAll();
			v_swida  = radio_button_checker('document.foTiptra.rbtn_tiptra');
			v_tipcab = radio_button_checker('document.foTiptra.rbtn_tipcab');
			v_aptdep = document.getElementById('combo_aptdep').value;
			v_aptarr = document.getElementById('combo_aptarr').value;			
			if (v_aptarr=='0' || v_aptdep=='0' || v_aptarr=='' || v_aptdep==''){		
        return false;			
      } else {
  			//if(v_aptarr=='OTH'){    Cambiavuelo(); return false;}
  			var descAptDep = getAptName(v_aptdep);
  			var descAptArr = getAptName(v_aptarr);			
  			// creamos el trayecto en el menu derecha
  			var txtIda = '<span class="destacado">Aller: </span><strong>'+descAptDep+' > '+descAptArr+'</strong>'
  			var txtVta = '<span class="destacado">Retour: </span><strong>'+descAptArr+' > '+descAptDep+'</strong>'
  			writeObj(txtIda,'descripTraIda');
  			if (v_swida == 'RT'){	writeObj(txtVta,'descripTraVta');		
  			}else{					writeObj('<br/> ','descripTraVta');
  			}
  			//
  			document.foCalendario.p_aptdep.value=v_aptdep;
  			document.foCalendario.p_aptarr.value=v_aptarr;
  			document.foCalendario.p_swiv.value=v_swida;
  			document.foCalendario.p_tipcab.value=v_tipcab;
  			document.foCalendario.xsid.value = document.foLogin.xsid.value;
  			document.foCalendario.submit();
  			//
  		/*	document.foCalendarioDebug.p_aptdep.value=v_aptdep;
  			document.foCalendarioDebug.p_aptarr.value=v_aptarr;
  			document.foCalendarioDebug.p_swiv.value=v_swida;
  			document.foCalendarioDebug.p_tipcab.value=v_tipcab;
  			document.foCalendarioDebug.submit();*/
  
  			setInfoApts(v_aptdep,v_aptarr,descAptDep,descAptArr,v_swida);			//mostramos la primera fase de menu
  			showInfoPrecioMenu(1);
  			document.getElementById('calendarInfo').style.height='20px';
  			writeObj(searchMsgCalendar,'calendarInfo');						
      }
		}

   		function putPlazasDia(sentido,plazas){			
		//escribe mensaje con las plazas restantes en una disponibilidad
			var txt1 ='<span class="destacado">Réservez dès maintenant:&nbsp;</span> il ne reste que <strong>';
			var txt2 =' </strong> places à ce tarif';
			var txtnot1='<span class="label">Si vous souhaitez réserver un vol pour plus de <strong>';
			var txtnot2='</strong> personnes, vous pouvez faire deux réservations: une à ce tarif et une autre à un tarif supérieur pour le reste des voyageurs.'
			var msg='';
			var msg2='';
			if (plazas<=3){
				msg= txt1 + plazas + txt2;
				msg2= txtnot1+plazas+txtnot2;
			}		
			writeObj(msg2,'plazasnota');			
			if (sentido=='ida'){		
			writeObj(msg,'plazasida');
			}else{
			writeObj(msg,'plazasvta');
			}					
		}

		/*
		function putPlazasDia(sentido,plazas){			//escribe mensaje con las plazas restantes en una disponibilidad
			var txt1 ='<span class="destacado">Reserva ya:&nbsp;</span>Solo quedan <strong>';
			var txt2 =' plazas</strong> con esta tarifa';
			var msg='';
			if (plazas !=''){msg= txt1 + plazas + txt2;		}
			if (sentido=='ida'){		writeObj(msg,'plazasida');
			}else{						writeObj(msg,'plazasvta');
			}					
			}   
		*/
		function set_CalendarsData(arrida,arrvta){			//reconstruye los calendarios de precios en base a los datos pasados
			//borramos contenido 
			arr_Precios1 = arrida;		c1.refresh();			c1.show();
			arr_Precios2 = arrvta;		c2.refresh();			c2.show();
			writeObj('','calendarInfo');		
			document.getElementById('calendarInfo').style.height='0px';
		}

		function set_calendarIda(){			
			// generamos el calendario asociado a la ida (constructor)
			c1 = new Calendar(1, d1, onSelect1, null,"c1"); 
			c1.setDateFormat("%d/%m/%Y");
			c1.setRange(d1.getFullYear(), d1.getFullYear()+1);
			c1.weekNumbers = false;
			c1.yearStep = 1;
			c1.bloqCalendar=false; 
			c1.getDateStatus = function(date) {
				var min = new Date(); 
				var max = new Date();				// Márgen de funcionamiento: desde hoy hasta dentro de un año (365 días)
				min.addDays(-1);
				max.addDays(365);
				if (date.getTime() < min.getTime() || date.getTime() > max.getTime()) return true; 
				else return false; 
			}
			c1.getDateText = function (date, iday) {			//añadido por mi
				var txt  = '<div class="precio">&#160;</div>';
				if (typeof(arr_Precios1[date.print("%d/%m/%Y")]) != "undefined"){
					txt = '<div class="precio">' + arr_Precios1[date.print("%d/%m/%Y")][0]	+'</div>';
				}
				return '<div class="dia">' + iday + '</div>' + txt ;
				//return iday;
			}
			c1.create(document.getElementById("cal1"));
//			c1.hide();
			c1.show();
		}	

		function set_calendarVta(){
			// generamos el calendario asociado a la vta (constructor)
			// Calendario DOS
			c2 = new Calendar(1, d2, onSelect2, null,"c2");
			c2.setDateFormat("%d/%m/%Y");
			c2.setRange(d1.getFullYear(), d1.getFullYear()+1);
			c2.weekNumbers = false;
			c2.yearStep = 1;
			c2.bloqCalendar=false;
			c2.getDateStatus = function(date) {				// Márgen de funcionamiento: desde hoy hasta dentro de un año (365 días)
				var min = new Date(); 
				var max = new Date();
				min.addDays(-1);
				max.addDays(365);
				if (date.getTime() < min.getTime() || date.getTime() > max.getTime() || date.getTime() < c1.date.getTime()) return true; 
				else return false; 
			}
			c2.getDateText = function (date, iday) {			//añadido por mi
				var txt  = '<div class="precio">&#160;</div>';
				if (typeof(arr_Precios2[date.print("%d/%m/%Y")]) != "undefined"){
					txt = '<div class="precio">' + arr_Precios2[date.print("%d/%m/%Y")][0]	+'</div>';
				}
				return '<div class="dia">' + iday + '</div>' + txt ;
			}
			c2.electric=false;
			c2.create(document.getElementById("cal2"));
//			c2.hide();
			c2.show();
		}
		 		
		function onSelect1(calendar, date) {
		/* (Jacin, 15/01/2008): Limpiamos la lista de vuelos de la ida */      
		fLimpiarVueloIda();
		/* Limpiamos la lista de los vuelos de la vuelta y la información de costes de la vuelta */
		fLimpiarVueloVta();

			if (c1.dateClicked){
				var newdate = new Date(c1.date.getTime());
				//alert('new:'+newdate + '\nold:' + today );

				if (newdate < today ) {
					writeObj('','dispoBox1');		writeObj('','plazasida');	//fecha incorrecta, quitamos datos adicionales
				}else{
//					if (document.getElementById('divTiptraH').style.display=='none')
//						{
						datediff = c2.date.getTime() - c1.date.getTime();
						 fOcultarIda();	
						 //ANDRES
							if (radio_button_checker('document.foTiptra.rbtn_tiptra') =='RT'){
								 if (c2.date.getTime() < c1.date.getTime())
								 {  c2.setDate(newdate);
									setInfoDate(c2.date.print("%d-%m-%Y"),'vta');
									c2.dateClicked='';
								 }else{
									 if (c2.dateClicked){
										//alert('1 enviamos pet ida');
										enviaPeticionDispo('ida');
									}
								 }
							}else {
								c2.refresh(); 
								//if (c2.dateClicked) {
									//alert('1 enviamos pet ida');
									enviaPeticionDispo('ida');
								//}
								//creamos peticion y lanzamos;
								setInfoDate(c1.date.print("%d-%m-%Y"),'ida');				//generamos info en menu derecha
								//setInfoDate(c2.date.print("%d-%m-%Y"),'vta');
								writeObj('','plazasida');
								writeObj('','infoCoste');
								writeObj('','infoCosteResi');
								document.getElementById('codbloqida').value='';
							}          					
				     }
				c2.refresh(); 
			}else{		
				c1.currentDateEl.className="day";//deshabilitamos el boton de seleccionado
				writeObj('','plazasida');
				writeObj('','infoCoste');
				writeObj('','infoCosteResi');
				writeObj('','dispoBox1');				//borramos todo lo relacionado con anterior seleccion
				writeObj('','infoPuntos');
				document.getElementById('codbloqida').value='';
			}			
		}
        
	function onSelect2(calendar, date) {
	  var v_aptarr = document.getElementById('combo_aptarr').value;
    	//JMP, sólo se tiene en cuenta el calendario c2 si tipo de trayecto es ida y vuelta
    	if (radio_button_checker('document.foTiptra.rbtn_tiptra') =='RT'){	
    		 /* (Jacin, 15/01/2008): Limpiamos la lista de vuelos de la ida */
    		 fLimpiarVueloVta();
    		 fLimpiarVueloIda();
    
    			if (c2.dateClicked){
    				if ( (document.getElementById('combo_aptarr').value.substr(0,1) != 'O') ||
    				     (document.getElementById('combo_aptarr').value.substr(0,1) == 'O') && (v_aptarr.length==3) 
    				   )
    				{
    //				if (document.getElementById('divTiptraH').style.display=='none')
    //				{
    					if (radio_button_checker('document.foTiptra.rbtn_tiptra') =='RT'){
    						if ((c2.date.getTime() < today) || (c2.date.getTime() < c1.date.getTime())) {
    							writeObj('','dispoBox2');	writeObj('','plazasvta');	//fecha incorrecta, quitamos datos adicionales
    						}else{
    							datediff = c2.date.getTime() - c1.date.getTime();
    							fOcultarVta();
    							 //ANDRES
    							if (c1.dateClicked) {
    									 enviaPeticionDispo('ida');
    									 writeObj('','plazasida');
    							}
    							setInfoDate(c2.date.print("%d-%m-%Y"),'vta');			  //generamos info en menu derecha
    							setInfoDate(c1.date.print("%d-%m-%Y"),'ida');
    							writeObj('','plazasvta');
    							writeObj('','infoCoste');
    							writeObj('','infoCosteResi');
    							document.getElementById('codbloqvta').value='';
    				        }
    				    }
    				}
    			}else{	
    				c2.currentDateEl.className="day";
    				writeObj('','plazasvta');
    				writeObj('','infoCoste');
    				writeObj('','infoCosteResi');
    				writeObj('','dispoBox2');				//borramos todo lo relacionado con anterior seleccion
    				writeObj('','infoPuntos');
    				document.getElementById('codbloqvta').value='';
    			}
    	}
		}
		
		function enviaPeticionDispo(sentido){
			if (v_tarificacionRT == 'N') {
				//mostramos la informacion en el campo de disponibilidad
				var txtBox = (sentido == 'ida')?'dispoBox1':'dispoBox2';//buscamos el campo adecuado para mostrar 
				document.getElementById(txtBox).style.height='auto';    //cambiamos altura para mostar mensaje
				writeObj('',txtBox);								//borramos todo lo relacionado con anterior seleccion
				writeObj('','infoPuntos');
				//hacemos el set de los campos del formulario y submitamos
				v_swida  = radio_button_checker('document.foTiptra.rbtn_tiptra');
				v_tipcab = radio_button_checker('document.foTiptra.rbtn_tipcab');
				v_aptdep = document.getElementById('combo_aptdep').value;
				v_aptarr = document.getElementById('combo_aptarr').value;
				////////////////////////////////////////////
				if (v_swida=='OW'){ //SOLO IDA
				    //alert('entra por OW');
					changeVisibility('loadingIda','show');
					if ((v_aptdep!=0) && (v_aptarr!=0) ){		
						setClassName('calendarcontainer_ow', 'cont_cal_oneway');
						c1.bloqCalendar=true;
					}
					document.getElementById("paramfechaida").value=c1.date.print("%d/%m/%Y");  //campo del formulario
					document.getElementById("paramfechavta").value='';
					document.foDispoIda.p_auxaptdep.value=v_aptdep;
					document.foDispoIda.p_auxaptarr.value=v_aptarr;
					document.foDispoIda.p_auxtipcab.value=v_tipcab;
					document.foDispoIda.p_auxswiv.value	 =v_swida;
					document.foDispoIda.xsid.value = document.foLogin.xsid.value;
					document.foDispoIda.submit();				
					document.getElementById('codbloqida').value='';
					c1.dateClicked='';

				}else{ //IDA Y VUELTA
					//click en tarifa de ida --> carga tarifas vuelta
					if ((sentido=='vta')&&(document.getElementById("sec_ida").style.display=='block')){ 
							changeVisibility('loadingVta','show');
							/* Andres:cargando vuelta.comprobamos si estan seleccionados aeropuerto salida y aeropuerto llegada
							 si ambos estan seleccionados bloqueamos calendario mientras efectua la búsqueda.*/
							if ((v_aptdep!=0) && (v_aptarr!=0) ){
									setClassName('calendarcontainer_rt', 'cont_cal_oneway');
									c2.bloqCalendar=true;
									setClassName('calendarcontainer_ow', 'cont_cal_oneway');
									c1.bloqCalendar=true;
							}
							document.getElementById("paramfechaida2").value=c1.date.print("%d/%m/%Y");
							document.getElementById("paramfechavta2").value=c2.date.print("%d/%m/%Y");
							document.foDispoVta.p_auxaptdep.value=v_aptdep;
							document.foDispoVta.p_auxaptarr.value=v_aptarr;
							document.foDispoVta.p_auxtipcab.value=v_tipcab;
							document.foDispoVta.p_auxswiv.value	 =v_swida;
							document.foDispoVta.xsid.value = document.foLogin.xsid.value;
							document.foDispoVta.submit();
							document.getElementById('codbloqvta').value='';
//							document.getElementById('codbloqida').value='';
							//c2.dateClicked='';
					}else{
							changeVisibility('loadingIda','show');
							changeVisibility('loadingVta','show');
							/* Andres:cargando ida.comprobamos si estan seleccionados aeropuerto salida y aeropuerto llegada
							 si ambos estan seleccionados bloqueamos calendario mientras efectua la búsqueda.*/
							if ((v_aptdep!=0) && (v_aptarr!=0) ){		
								setClassName('calendarcontainer_ow', 'cont_cal_oneway');
								c1.bloqCalendar=true;
								setClassName('calendarcontainer_rt', 'cont_cal_oneway');
								c2.bloqCalendar=true;
								}
							document.getElementById("paramfechaida").value=c1.date.print("%d/%m/%Y");  //campo del formulario
							document.getElementById("paramfechavta").value=c2.date.print("%d/%m/%Y");  //campo del formulario
							document.foDispoIda.p_auxaptdep.value=v_aptdep;
							document.foDispoIda.p_auxaptarr.value=v_aptarr;
							document.foDispoIda.p_auxtipcab.value=v_tipcab;
							document.foDispoIda.p_auxswiv.value	 =v_swida;
							document.foDispoIda.xsid.value = document.foLogin.xsid.value;
							document.foDispoIda.submit();	
							document.getElementById('codbloqida').value='';
							document.getElementById("paramfechavta2").value=c2.date.print("%d/%m/%Y");
							document.getElementById("paramfechaida2").value=c1.date.print("%d/%m/%Y");
							document.foDispoVta.p_auxaptdep.value=v_aptdep;
							document.foDispoVta.p_auxaptarr.value=v_aptarr;
							document.foDispoVta.p_auxtipcab.value=v_tipcab;
							document.foDispoVta.p_auxswiv.value	 =v_swida;
							document.foDispoVta.xsid.value = document.foLogin.xsid.value;
							document.foDispoVta.submit();
							document.getElementById('codbloqvta').value='';
							c2.dateClicked='';
					}
				}
			
			}
		}
		//**************************envia el formulario hacia la web Halcon *************************************************************************
    function enviaPeticionHalcon(){
    
  		var foi=document.foHalconIda;
  		var fov=document.foHalconVuelta;
  		var txterr='';
		  if(document.getElementById('rbtn_rth').checked==true)
		   {
				  //--- cargamos formulario halcon vuelta ---------
				  if((document.getElementById('combo_aptdeph').value=='') || (document.getElementById('combo_aptdeph').value=='0')) {
						    txterr='- Vous devez saisir un aéroport de départ'+ ' \n';					   
					}
				  if (document.getElementById('combo_aptarrh').value=='' || document.getElementById('combo_aptarrh').value=='0' || document.getElementById('combo_aptarrh').value=='-- Destino --'){
						     txterr+='- Vous devez saisir un aéroport de destination '+ ' \n';					    
					}
				  if(c1.date.print("%d/%m/%Y")==''){
						     txterr+='- Vous devez saisir une date aller'+ ' \n';
				  }
				  if (txterr!=''){
						   alert(txterr);
		   				  return 0;
					}   
				  changeVisibility('idCont3pasos','hide');		
				  changeVisibility('idCont','hide');
				  changeVisibility('idCont_central','hide');
				  changeVisibility('ifHalcon','show');				
          		  changeVisibility('barcelo','hide');	               		
				  fov.p_vueloIdaVuelta.value="SI";
			      fov.p_vueloOrigen.value=document.getElementById('combo_aptdeph').value;				
				  fov.p_descripcionOrigen.value=document.getElementById('combo_aptdeph').options[document.getElementById('combo_aptdeph').selectedIndex].text;
				  fov.p_vueloDestino.value=document.getElementById('combo_aptarrh').value;
				  fov.p_descripcionDestino.value=document.getElementById('combo_aptarrh').options[document.getElementById('combo_aptarrh').selectedIndex].text;
				  fov.p_vueloFechaIda.value=c1.date.print("%d/%m/%Y");
				  fov.p_vueloFechaVuelta.value=c2.date.print("%d/%m/%Y");
		      	  fov.p_vueloNumAdultos.value=document.getElementById('comboadl').value;
				  fov.p_vueloNumNinos.value=document.getElementById('combochd').value;
				  fov.p_vueloNumBebes.value=document.getElementById('comboinf').value;
				//alert('numbebes'+fov.vueloNumBebes.value );
				 // alert('idavuelta:'+fov.vueloIdaVuelta.value+'-'+'vueloorigen:'+fov.vueloOrigen.value+'desorigen:'+fov.descripcionOrigen.value+'-'+'vuelodestino:'+fov.vueloDestino.value+'-'+'descdestino'+ fov.descripcionDestino.value+'-'+'fechaida:'+fov.vueloFechaIda.value+'-'+'fechavuelta'+fov.vueloFechaVuelta.value+'-'+'nuamdl:'+fov.vueloNumAdultos.value+'-'+'numninos'+fov.vueloNumNinos.value+'-'+'numbebes'+fov.vueloNumBebes.value);				
		      	  fov.submit();
	    	} else{
				 if(document.getElementById('combo_aptdeph').value=='' || document.getElementById('combo_aptdeph').value=='0')
					{
						    txterr='- Vous devez saisir un aéroport de départ'+ ' \n';					   
					}
					if (document.getElementById('combo_aptarrh').value=='' || document.getElementById('combo_aptarrh').value=='0'|| document.getElementById('combo_aptarrh').value=='-- Destino --')
					{
						     txterr+='- Vous devez saisir un aéroport de destination'+ ' \n';					    
					}
					if(c1.date.print("%d/%m/%Y")=='')
					{
						     txterr+='- Vous devez saisir une date aller'+ ' \n';
				  	}
					if (txterr!=''){
					   alert(txterr);
		   				  return 0;
					}  
				  changeVisibility('idCont3pasos','hide');		
				  changeVisibility('idCont','hide');
				  changeVisibility('idCont_central','hide');
				  changeVisibility('ifHalcon','show');
          		  changeVisibility('barcelo','hide');					  
			      foi.p_vueloIdaVuelta.value="NO";
          		  foi.p_vueloSoloIda.value="SI";	
          		  foi.p_vueloOrigen.value=document.getElementById('combo_aptdeph').value;
				  foi.p_descripcionOrigen.value=document.getElementById('combo_aptdeph').options[document.getElementById('combo_aptdeph').selectedIndex].text;
		          foi.p_vueloDestino.value=document.getElementById('combo_aptarrh').value;
		          foi.p_descripcionDestino.value=document.getElementById('combo_aptarrh').options[document.getElementById('combo_aptarrh').selectedIndex].text;
		          foi.p_vueloFechaIda.value=c1.date.print("%d/%m/%Y");
		          foi.p_vueloNumAdultos.value=document.getElementById('comboadl').value;
		          foi.p_vueloNumNinos.value=document.getElementById('combochd').value;
		          foi.p_vueloNumBebes.value=document.getElementById('comboinf').value;			
				 // alert('idavuelta:'+foi.vueloIdaVuelta.value+'-'+'ida:'+foi.vueloSoloIda.value+'-'+'vueloorigen:'+foi.vueloOrigen.value+'desorigen:'+foi.descripcionOrigen.value+'-'+'vuelodestino:'+foi.vueloDestino.value+'-'+'descdestino'+ foi.descripcionDestino.value+'-'+'fechaida:'+foi.vueloFechaIda.value+'-'+'nuamdl:'+foi.vueloNumAdultos.value+'-'+'numninos'+foi.vueloNumNinos.value+'-'+'numbebes'+foi.vueloNumBebes.value);
		      	  foi.submit(); 				  
		    }
		 } 
		//***************************************************************************************************************************************  
	
			function cambia_tiptra(){ 
			//lanzado en cada click de cambio de tipo de billete (i/v y tur/bus) 
			v_swida  = radio_button_checker('document.foTiptra.rbtn_tiptra');
//			v_swidah = radio_button_checker('document.foTiptraH.rbtn_tiptra');
			resetAtps();
			resetAll();
			 if (document.getElementById('divTiptra').style.display=="inline"){
				if (v_swida == 'RT'){	//oculta o visualiza el calendario en el cambio de tipo de trayecto (y datos dependientes)
					writeObj(cabeceraVtaTxt,'cabeceraVta'); //mostramos el texto de menu derecha relacionado con vuelta
					setClassName('calendarcontainer_rt', 'cont_cal');
				}else{						
					writeObj('','cabeceraVta');				//borramos dicho texto (nada depende de el) solo visualizacion
					setClassName('calendarcontainer_rt', 'cont_cal_oneway');
				}
			}else{
			     if (v_swidah == 'RT'){	//oculta o visualiza el calendario en el cambio de tipo de trayecto (y datos dependientes)
					writeObj(cabeceraVtaTxt,'cabeceraVta'); //mostramos el texto de menu derecha relacionado con vuelta
					setClassName('calendarcontainer_rt', 'cont_cal');
				}else{						
					writeObj('','cabeceraVta');				//borramos dicho texto (nada depende de el) solo visualizacion
					setClassName('calendarcontainer_rt', 'cont_cal_oneway');
			       }
				}  
			}
		
			function Cambiavuelo(){
			  if (document.getElementById('divTiptra').style.display=="inline"){
			  document.getElementById('divTiptra').style.display="none"; 
			  document.getElementById('divTiptraH').style.display="inline";	
			  document.getElementById('publibannerH').style.display="inline";
			  document.getElementById('publibanner').style.display="none";
			  changeVisibility('expl_paso2AEA','hide');
			  changeVisibility('expl_paso2H','show');
			  //alert(document.foTiptra.rbtn_rt.value);
			  document.foTiptra.rbtn_rt.checked=true;
			  cambia_tiptra();
			  resetAll();
			  resetAtps();
		      fLimpiarVueloIda();
		      fLimpiarVueloVta();
			  return 0;
			  }
			  if(document.getElementById('divTiptraH').style.display=="inline"){		  		
			     document.getElementById('divTiptraH').style.display="none";
				 document.getElementById('divTiptra').style.display="inline";	
	             document.getElementById('publibannerH').style.display="none"; 			 
				 document.getElementById('publibanner').style.display="inline"; 
				 changeVisibility('expl_paso2H','hide');
				 changeVisibility('expl_paso2AEA','show');
				 //alert(document.foTiptraH.rbtn_rth.value);
//				 document.foTiptraH.rbtn_rth.checked=true;
				 cambia_tiptra();
	             resetAll(); 			
				 resetAtps();
		         fLimpiarVueloIda();
		         fLimpiarVueloVta();
			    }
			}	


		function resetAll(){
			/*borra todo el contenido de la pantalla visualizado por el usuario 
			(en todo momento existen dichos objetos en el arbol DOM de la pagina)
			asi como variables js internas que se mantienen en todo momento		*/
			v_tarificacionRT ='N';//suponemos este valor de ante mano
			arr_Precios1=new Array();			arr_Precios2=new Array();
			c1.refresh();						c2.refresh();
			changeVisibility('loadingIda','hide');
			changeVisibility('loadingVta','hide');
			changeVisibility('notatiptar','hide');
			changeVisibility('notatiprt','hide');
			changeVisibility('tarifasabado','hide'); //RAFA: añadida nueva nota en la página principal
			writeObj('','infoPuntos');
			ptos_vta = 0;
			ptos_ida = 0;
			writeObj('','infoCoste');
			writeObj('','infoCosteResi');			
			writeObj('','infoAptIda');			writeObj('','infoDateIda');			writeObj('','infoTimIda');
			writeObj('','infoAptVta');			writeObj('','infoDateVta');			writeObj('','infoTimVta');			
			writeObj('','descripTraIda');		writeObj('','descripTraVta');					
			writeObj('','dispoBox1');			writeObj('','dispoBox2');	
			document.getElementById('codbloqvta').value='';
			document.getElementById('codbloqida').value='';
			document.getElementById('dispoBox1').style.height='0px';
			document.getElementById('dispoBox2').style.height='0px';
			writeObj('','plazasida');			writeObj('','plazasvta');			
			writeObj('','plazasnota');
			l_impbaseida = 0;					l_imptaxida	 = 0;						
			l_impbasevta = 0;					l_imptaxvta	 = 0;
			l_impfee	 = 0;					l_coddiv	 = '';
			l_imptaxtotal=0;					l_imptotal=0;
			//reset de selecciones
			document.foBloqVuelos.p_numpaxadl.value='';
			document.foBloqVuelos.p_numpaxchd.value='';
			document.foBloqVuelos.p_numpaxinf.value='';
			julian_timida ='';
			julian_timvta ='';
			ofe_ida ='';
			ofe_vta ='';
		}

		function resetAtps(){
			/*Resetea las opciones elegidas de aeropuertos*/
			document.getElementById('combo_aptdep').selectedIndex = 0;
			document.getElementById('combo_aptarr').options.length = 0;	
			generaOpcionCombo('Sélectionner..',0,'combo_aptarr', 0);
			document.getElementById('combo_aptarr').selectedIndex = 0;
      document.getElementById('combotable_input').value = "Tapez ou sélectionnez une origine ...";
      document.getElementById('combotable2_input').value = "Tapez ou sélectionnez une destination ...";
      document.getElementById('combotable_input').style.color = "gray";
      document.getElementById('combotable2_input').style.color = "gray";
			showInfoPrecioMenu(0);
		}

		function errorDisponibilidad(windowName){			
			if (windowName == 'ifDispoI'){	
				document.getElementById('dispoBox1').style.height='0px'; 
				writeObj('','dispoBox1');		
				changeVisibility('loadingIda','hide');
			}
			if (windowName == 'ifDispoV'){	
				document.getElementById('dispoBox2').style.height='0px';
				writeObj('','dispoBox2');		
				changeVisibility('loadingVta','hide');
			}
			showInfoPrecioMenu(0); //mostramos la publicidad
		}

	   function bloquea_reserva(){
      //
	    var v_aptarr = document.getElementById('combo_aptarr').value;
		  v_errtxt='';
	    //	alert('x:'+document.getElementById('divTiptra').style.display);
      //if (document.getElementById('divTiptra').style.display=='inline')
			if ( (document.getElementById('combo_aptarr').value.substr(0,1) != 'O') ||
			     (document.getElementById('combo_aptarr').value.substr(0,1) == 'O') && (v_aptarr.length==3) 
			   )
      {		
				if (v_tarificacionRT == 'N') 
				{
					v_errtxt ='';				
					if (valida_seleccion()== false || valida_horasvuelos() == false){ v_errtxt += '- Verifique los horarios de salida y llegada de los vuelos seleccionados. \n';}				
			    //
					if(v_errtxt!=''){ alert(v_errtxt);return 0;}
					//
					if (v_errtxt == '')
					{
						document.foBloqVuelos.p_numpaxadl.value=document.getElementById('comboadl').value;
						document.foBloqVuelos.p_numpaxchd.value=document.getElementById('combochd').value;
						document.foBloqVuelos.p_numpaxinf.value=document.getElementById('comboinf').value;
						document.foBloqVuelos.p_auxaptdep.value=document.getElementById('combo_aptdep').value;
						document.foBloqVuelos.p_auxaptarr.value=document.getElementById('combo_aptarr').value;
						document.foBloqVuelos.p_auxtipcab.value=radio_button_checker('document.foTiptra.rbtn_tipcab');
						document.foBloqVuelos.p_auxswiv.value  =radio_button_checker('document.foTiptra.rbtn_tiptra');
						document.foBloqVuelos.p_auxfecdep.value=c1.date.print("%d/%m/%Y");
						document.foBloqVuelos.p_auxfecarr.value=c2.date.print("%d/%m/%Y");
						document.foBloqVuelos.xsid.value = document.foLogin.xsid.value;
						
						/*	document.foBloqVuelos.p_codtraida.value='0';document.foBloqVuelos.p_codtravta.value='0';*/
						//trayectos solicitados ya insertados					
						if (valida_ofertas()==false)
						{
							if (confirm('At least one of the fligth is not permit with the offer conditions.\n ¿Would you like to continue with the offer ?'))
							{		
								document.foBloqVuelos.submit();			
							}
						}
						else
						{	
							document.foBloqVuelos.submit();			
						}					
					} 
					else 
					{ 
						alert(v_errtxt);
					}
				} 
				else 
				{
					document.foDispoRT.p_fecdep.value=c1.date.print("%d/%m/%Y");
					document.foDispoRT.p_fecarr.value=c2.date.print("%d/%m/%Y");
					document.foDispoRT.p_numpaxadl.value=document.getElementById('comboadl').value;
					document.foDispoRT.p_numpaxchd.value=document.getElementById('combochd').value;
					document.foDispoRT.p_numpaxinf.value=document.getElementById('comboinf').value;
					document.foDispoRT.p_auxaptdep.value=document.getElementById('combo_aptdep').value;
					document.foDispoRT.p_auxaptarr.value=document.getElementById('combo_aptarr').value;
					document.foDispoRT.p_auxtipcab.value=radio_button_checker('document.foTiptra.rbtn_tipcab');
					document.foDispoRT.p_auxswiv.value  =radio_button_checker('document.foTiptra.rbtn_tiptra');
					document.foDispoRT.xsid.value = document.foLogin.xsid.value;				
					document.foDispoRT.submit();								
					document.getElementById('bloqSub').style.display='none';
					writeObj(searchMsgBloq,'bloqLoad');						
				}
	  	}
	  	else
	  	{
		    enviaPeticionHalcon();
		  }
		}
		//-------------
		function fallobloqueoOW(){
			// 1. Limpiamos las listas de disponibilidades
			 fLimpiarListas(); 
		  
			//lanzamos las peticiones de disponibilidad la IDA
			enviaPeticionDispo('ida');
			
			// Si estabamos buscando IDA+VUELTA, entonces lanzamos la petición de disponibilidad también para la vuelta
			if (radio_button_checker('document.foTiptra.rbtn_tiptra') == 'RT'){							
			    enviaPeticionDispo('vta');
			}
		}

		function cambiaIdioma(valor) {	
			document.foSesionParam.xsid.value=document.foLogin.xsid.value;
			document.foSesionParam.p_codmer.value=valor;
			document.foSesionParam.p_codidi.value=valor;
			document.foSesionParam.submit();
		}

		
		
		function init_default(){	
      var l_entro = "0";
		  var fechaExp = new Date();			// Estable una fecha desde la cual se va a calcular la fecha final para la caducidad de la cookie 
	    fechaExp.setTime(calculaFechaExpiracion());
	    // Comprobamos si tenemos creado una cookie para el idioma 
      if (leerCookie(seleccion) == null) {
      //if (leerCookie(selecIdi) == null) {
        l_entro = "1";
        cargaPaises('combo_aptpai');	// Cargamos el combo de paises
      } else {
        actualizarCookie(seleccion, leerCookie(seleccion), fechaExp, "/");
        //actualizarCookie(selecIdi, leerCookie(selecIdi), fechaExp, "/");
        l_cadena = leerCookie(seleccion).split("@");
        if (l_cadena[0]=="0") {
        //if ((leerCookie(selecEnt)==null) || (leerCookie(selecEnt)=="0")) {
          l_entro = "1";
          l_cookie = "1@"+l_cadena[1]+"@"+l_cadena[2]+"@"+l_cadena[3]+"@"+l_cadena[4];
          //establecerCookie(seleccion ,l_cookie, fechaExp,"/");
          //establecerCookie(selecEnt ,"1", fechaExp);
  		    cargaPaises('combo_aptpai');
          document.getElementById('combo_aptpai').value=l_cadena[1].substring(0,2);
          //document.getElementById('combo_aptpai').value=leerCookie(selecIdi).substring(0,2);
          cargaIdiomas('combo_aptpai','combo_aptidi');
          document.getElementById('combo_aptidi').value=l_cadena[1].substring(3,5);
  		    //document.getElementById('combo_aptidi').value=leerCookie(selecIdi).substring(3,5);
        } else {
          if (l_cadena[0]=="1") {
          //if (leerCookie(selecEnt)=="1") {
            l_cookie = "0@"+l_cadena[1]+"@"+l_cadena[2]+"@"+l_cadena[3]+"@"+l_cadena[4];
            //establecerCookie(seleccion ,l_cookie, fechaExp,"/");
            //establecerCookie(selecEnt ,"0", fechaExp);
            l_idi = leerCookie(seleccion).split("@");
            l_dat = l_idi[1].split("-");
            cargaHomeCookie(l_dat[0]+"/"+l_dat[1]);
          }else{
            l_entro = "1";
            cargaPaises('combo_aptpai');	// Cargamos el combo de paises
          }
        }
      }
      if (l_entro=="1") {	
			/*Lanzado al cargar la pagina*/
//			cargaOrigenesh('combo_aptdeph');    //cargamos las rutas para los combos de halcon	
  			//cargaOrigenes('combo_aptdep');   //cargamos el combo de ida
  			fun_ready();
        Date.prototype.addDays = function(days) {			// Añadimos un método al objeto JS estándar date
  				msecInDay=1000*60*60*24;
  				days=days*msecInDay;
  				this.setTime(this.getTime()+days);
  			}
  			d1 = new Date();			// inicializamos las fechas del calendario y la diferencia entre ellas
  			d1.addDays(0);
  			d2 = new Date();
  			d2.addDays(0);
  			var datediff = d2.getTime() - d1.getTime();
  			set_calendarIda();//creamos calendario de ida
  			set_calendarVta();//creamos calendario de vta
  			resetAll();		//borramos contenido			
  			generaCombosPax();//inicializamos los combos de pasajeros al cargar, para poder continuar la ejecucion en RTs
  			//init_page();      //carga la combo de los paises
  			//document.foDatosSesion.submit();
  		}
		}
		
		function init_default_combo(){		
    			/*Lanzado al cargar la pagina*/
    			/*cargaOrigenes('combo_aptdep');						//cargamos el combo de ida*/
          fun_ready();
      		Date.prototype.addDays = function(days) {			// Añadimos un método al objeto JS estándar date
    				msecInDay=1000*60*60*24;
    				days=days*msecInDay;
    				this.setTime(this.getTime()+days);
    			}
    			d1 = new Date();			// inicializamos las fechas del calendario y la diferencia entre ellas
    			d1.addDays(0);
    			d2 = new Date();
    			d2.addDays(0);
    			var datediff = d2.getTime() - d1.getTime();
    			set_calendarIda();//creamos calendario de ida
    			set_calendarVta();//creamos calendario de vta
    			resetAll();		  //borramos contenido
    			generaCombosPax();//inicializamos los combos de pasajeros al cargar, para poder continuar la ejecucion en RTs
          init_page();      //carga la combo de los paises
    			//document.foDatosSesion1.submit();
    }

		function verLogin(){
			generaOverWinSize('Login','Cerrar',document.getElementById('textoLogin').innerHTML,'centinela','480','100',100,200);
		}
		/*function setIdses(valor){
		    parent.document.foLogin.xsid.value = valor;
		}*/

		//----------------VICKY: 26/06/06---------------------------------------
		// verNota(id,nota):
		// nota--> nombre del div.
		// id=0 then -->Oculta.
		// id=1 then -->Muestra.
		//----------------------------------------------------------------------
		function verNota(id,nota){
			if (id==1){
				changeVisibility(nota,'show');				
			}else{
				changeVisibility(nota,'hide');
			}
		}
		
		// inicio eladio
		function init_page() {
	    cargaPaises('combo_aptpai');	// Cargamos el combo de paises
		}
    
		function cargaHome(paisId, idiomaId){
		  var fechaExp = new Date();			// Estable una fecha desde la cual se va a calcular la fecha final para la caducidad de la cookie
      fechaExp.setTime(calculaFechaExpiracion());
		  var aptIdi=document.getElementById(idiomaId).value;
		  var aptPai=document.getElementById(paisId).value;
		  if (aptIdi == 'ES' && ( aptPai == 'FR' || aptPai == 'IT')){
        aptPai = 'ES';
      } 
		  document.foDatosSesion.p_codidi.value=aptIdi;
		  document.foDatosSesion.p_codmer.value=aptPai;
		  if(aptPai!='0' && aptIdi!='0'){
		    l_cadena = leerCookie(seleccion);
		    if ((l_cadena!=null) && (l_cadena!="")) {
		      l_cadena = l_cadena.split("@");
		      l_cookie = "0@"+aptPai+"-"+aptIdi+"@"+l_cadena[2]+"@"+l_cadena[3]+"@"+l_cadena[4];
		      establecerCookie(seleccion ,l_cookie, fechaExp,"/");
		      //establecerCookie(selecIdi ,aptPai+"/"+aptIdi, fechaExp,"/");
  			  //establecerCookie(selecEnt ,"0", fechaExp); 
        } else {
          l_cookie = "0@"+aptPai+"-"+aptIdi+"@@@";
          establecerCookie(seleccion,l_cookie,fechaExp,"/");
        }
			  document.foDatosSesion.submit();
		}else{
			alert('S\'il vous plaît, choisissez le pays et/ou la langue qui manquent.');
		}
		/*aptIdi=aptIdi.toLowerCase();
		aptPai=aptPai.toLowerCase();
		if(aptPai=='0' || aptIdi=='0')
		{
			document.location="index.html";
		}else{
			if(aptPai == 'ar' || aptPai == 'br')
			{
				document.location="http://www.aireuropa.com/"+aptPai+"/"+aptIdi+"/default_amadeus.html";
			}else{
				document.location="http://www.aireuropa.com/"+aptIdi+"/default.html";
			}
		}*/
		}

    function cargaPaises(comboId){
			var posCombo = 0;
			var txt = '';
			var value = '';
			//borramos contenido
			document.getElementById(comboId).options.length = 0;			
			//añadimos un elemento centinela ?->	
			generaOpcionCombo('...',0,comboId, 0);				
			for(pai in paises)
			{
				posCombo++;
				txt=paises[pai];
				generaOpcionComboPaises(txt, short_paises[pai], comboId, posCombo);
			}
		}
		
		function generaOpcionCombo(txt,value,idCombo,pos) {
    	oOption = document.createElement("OPTION");
    	oOption.text = txt;
    	oOption.value = value;
    	//asi se puede acceder al browser que sea
    	if (value=='FR'){
    		oOption.selected = "Frances";
    	}
    	document.getElementById(idCombo).options[pos] = oOption;
    }
    
    // Genera las opciones para el combobox de paises dejando seleccionado por defecto el España
    function generaOpcionComboPaises(txt,value,idCombo,pos) {
    	oOption = document.createElement("OPTION");
    	oOption.text = txt;
    	oOption.value = value;
    	document.getElementById(idCombo).options[pos] = oOption;
    }
    
		// fin eladio
	function fRestarFechas(diamesano1,diamesano2){
      var ano1;
      var mes1;
      var dia1;
      var ano2;
      var mes2;
      var dia2;
      var resta;

      if (diamesano1 != '' && diamesano2 != ''){             		
        ano1 = diamesano1.substr(6,4);
        mes1 = diamesano1.substr(3,2);
        dia1 = diamesano1.substr(0,2);
        ano2 = diamesano2.substr(6,4);
        mes2 = diamesano2.substr(3,2);
        dia2 = diamesano2.substr(0,2);
        		  
        fecha1=new Date(ano1,mes1-1,dia1);
        fecha2=new Date(ano2,mes2-1,dia2);
		resta = (fecha2-fecha1)/1000/3600/24;                              
      } else {
        resta = -1;
      }
      return resta;  
    }    
//    
	function fExisteFinde(diamesano1,diamesano2) {
		var ano1;
		var mes1;
		var dia1;
		var ano2;
		var mes2;
		var dia2;
		var f1;
		var f2;
		var l_dif1;
		var l_dif2;	
		
		if (diamesano1 != '' && diamesano2 != ''){ 
			mes1 = diamesano1.substr(3,2);
			dia1 = diamesano1.substr(0,2);
			ano1 = diamesano1.substr(6,4);	  
    		dia2 = diamesano2.substr(0,2);
			mes2 = diamesano2.substr(3,2);
			ano2 = diamesano2.substr(6,4);
			f1=new Date(ano1,mes1-1,dia1);
			f2=new Date(ano2,mes2-1,dia2);
			l_dif1= (f2-f1)/1000/3600/24;
			l_dif2 =(l_dif1/7);
			if (l_dif2>=1){
				return true;
			}else{
				dia1=f1.getDay();
				dia2=f2.getDay();
				if (dia2 < dia1){
					return true;
				}else{
					return false;
				}
			}
		 }else{
		  return false;
		 }  
  }
  function resetCombo(){
			/*borra todo el contenido de la pantalla visualizado por el usuario 
			(en todo momento existen dichos objetos en el arbol DOM de la pagina)
			asi como variables js internas que se mantienen en todo momento		*/
			v_tarificacionRT ='N';//suponemos este valor de ante mano
			arr_Precios1=new Array();			arr_Precios2=new Array();
			c1.refresh();						c2.refresh();
			writeObj('','infoPuntos');
			ptos_vta = 0;
			ptos_ida = 0;
			writeObj('','infoCoste');
			writeObj('','infoCosteResi');			
			writeObj('','infoAptIda');			writeObj('','infoDateIda');			writeObj('','infoTimIda');
			writeObj('','infoAptVta');			writeObj('','infoDateVta');			writeObj('','infoTimVta');			
			writeObj('','descripTraIda');		writeObj('','descripTraVta');					
			writeObj('','dispoBox1');			writeObj('','dispoBox2');	
			document.getElementById('codbloqvta').value='';
			document.getElementById('codbloqida').value='';
			document.getElementById('dispoBox1').style.height='0px';
			document.getElementById('dispoBox2').style.height='0px';
			writeObj('','plazasida');			writeObj('','plazasvta');			
			writeObj('','plazasnota');
			l_impbaseida = 0;					l_imptaxida	 = 0;						
			l_impbasevta = 0;					l_imptaxvta	 = 0;
			l_impfee	 = 0;					l_coddiv	 = '';
			l_imptaxtotal=0;					l_imptotal=0;
			//reset de selecciones
			document.foBloqVuelos.p_numpaxadl.value='';
			document.foBloqVuelos.p_numpaxchd.value='';
			document.foBloqVuelos.p_numpaxinf.value='';
			julian_timida ='';
			julian_timvta ='';
			ofe_ida ='';
			ofe_vta ='';
		}
		
		function mostrar_api(p_mostrar) {
    if (p_mostrar=='S') {
      changeVisibility('cab_1','hide');
      changeVisibility('cuerpo_res','hide');
      changeVisibility('pie_1','hide');
      changeVisibility('tarifasabado','hide');
      changeVisibility('bloqSub','hide');
      cargaFecha(document.getElementById('B_DIA_1'),document.getElementById('B_DIA_2'),document.getElementById('B_MES_1'),document.getElementById('B_MES_2'));
      //changeVisibility('cuerpo_api_ama','show');
      //changeVisibility('bot_api','show');
      //document.getElementById('id_oculto').style.height = '101px';
    } else {
      changeVisibility('cab_1','show');
      changeVisibility('cuerpo_res','show');
      changeVisibility('pie_1','show');
      changeVisibility('bloqSub','show');
      //changeVisibility('cuerpo_api_ama','hide');
      //changeVisibility('bot_api','hide');
      //document.getElementById('id_oculto').style.height = '0px';
    }
    resetAll();
		v_swida  = radio_button_checker('document.foTiptra.rbtn_tiptra');
		v_tipcab = radio_button_checker('document.foTiptra.rbtn_tipcab');
		v_aptdep = document.getElementById('combo_aptdep').value;
		v_aptarr = document.getElementById('combo_aptarr').value;			
		var descAptDep = getAptName(v_aptdep);
		var descAptArr = getAptName(v_aptarr);			
		// creamos el trayecto en el menu derecha
		var txtIda = '<span class="destacado">Ida: </span><strong>'+descAptDep+' > '+descAptArr+'</strong>'
		var txtVta = '<span class="destacado">Vuelta: </span><strong>'+descAptArr+' > '+descAptDep+'</strong>'
		writeObj(txtIda,'descripTraIda');
		if (v_swida == 'RT'){	
      writeObj(txtVta,'descripTraVta');
      //document.objForm.TRIP_TYPE.value = 'R';
		}else{					
      writeObj('<br/> ','descripTraVta');
      //document.objForm.TRIP_TYPE.value = 'O';
		}
		if (v_aptarr.length==4){
		  v_aptarr=v_aptarr.substring(1,4);
		  setInfoApts(v_aptdep,v_aptarr,descAptDep,descAptArr,v_swida);			//mostramos la primera fase de menu
		  showInfoPrecioMenu(1);
    }
    //if (v_tipcab=='TUR') {
    //  document.objForm.CABIN.value = 'E';
    //} else {
    //  document.objForm.CABIN.value = 'B';
    //}
	
  }     
  function empezar_reserva_api() {
    changeVisibility('idCont3pasos','hide');
    changeVisibility('idCont','hide');
    changeVisibility('idCont_central','hide');
	  changeVisibility('barcelo','hide');
   	changeVisibility('pie','hide');
   	changeVisibility('menu_inf','hide');
    changeVisibility('loadingapi','show');
    changeVisibility('if_api_ama','show');
   	
  }
//	</script>

  // FUNCIONES COOKIES:
  //-----------------------------------
  
  // Funcion que se encargara de calcular una fecha de expiracion 4 meses despues de la fecha actual
  function calculaFechaExpiracion(){
	 var fechaAct= new Date();	// Establece una fecha desde la cual se va a calcular la fecha final para la caducidad de la cookie
	 var MSxDia=24*60*60*1000;	// Cantidad de milisegundos que tiene un dia
	 var fechaFin = new Date(fechaAct.getTime()+MSxDia*120);	// 
	 return fechaFin;
  }
  
  // Lee el contenido de una cookie para posteriormente, realizar las gestiones pertinentes
  function leerCookie(name){
    var cname = name + "=";               
    var dc = document.cookie;             
    if (dc.length > 0) {              
      begin = dc.indexOf(cname);       
      if (begin != -1) {           
        begin += cname.length;       
        end = dc.indexOf(";", begin);
        if (end == -1) end = dc.length;
          return unescape(dc.substring(begin, end));
      } 
    }
    return null;
  }
  
  // Crea una cooki en funcion de la seleccion del usuarios respecto al idioma y el pais
  // para que el navegador se acuerde en ocasiones venideras, de dicha seleccion.
  function establecerCookie (name, value, expires, path, domain, secure){
    document.cookie = name + "=" + escape(value) + 
    ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
    ((path == null) ? "" : "; path=" + path) +
    ((domain == null) ? "" : "; domain=" + domain) +
    ((secure == null) ? "" : "; secure");
  }

  function actualizarCookie (name, value, expires, path, domain, secure){
    //alert('actualizarCookie -> '+value);
    document.cookie = name + "=" + escape(value) + 
    ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
    ((path == null) ? "" : "; path=" + path) +
    ((domain == null) ? "" : "; domain=" + domain) +
    ((secure == null) ? "" : "; secure");
  }

  function borrarCookie (name,path,domain) {
    //if (getCookie(name)) {
      document.cookie = name + "=" +
      ((path == null) ? "" : "; path=" + path) +
      ((domain == null) ? "" : "; domain=" + domain) +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    //}
  }
  
  //Funcion cargaHomeCookie
  function cargaHomeCookie(redireccion){
	if (redireccion=='BR/ES'||redireccion=='BR/BR'||redireccion=='AR/ES'||redireccion=='AR/EN'||redireccion=='DO/EN'||redireccion=='DO/ES'||redireccion=='VE/EN'||redireccion=='VE/ES'||redireccion=='MX/EN'||redireccion=='MX/ES'||redireccion=='US/ES'||redireccion=='US/EN'||redireccion=='PT/ES'||redireccion=='PT/PT'){
		if (redireccion=='BR/ES'){
			document.foDatosSesion.p_codmer.value='BR';
			document.foDatosSesion.p_codidi.value='ES';
		}else if (redireccion=='BR/EN'){
			document.foDatosSesion.p_codmer.value='BR';
			document.foDatosSesion.p_codidi.value='BR';
		}else if (redireccion=='AR/ES'){
			document.foDatosSesion.p_codmer.value='AR';
			document.foDatosSesion.p_codidi.value='ES';
		}else if (redireccion=='AR/EN'){
			document.foDatosSesion.p_codmer.value='AR';
			document.foDatosSesion.p_codidi.value='EN';
		}else if (redireccion=='VE/ES'){
			document.foDatosSesion.p_codmer.value='DO';
			document.foDatosSesion.p_codidi.value='ES';
		}else if (redireccion=='DO/RN'){
			document.foDatosSesion.p_codmer.value='DO';
			document.foDatosSesion.p_codidi.value='EN';
		}else if (redireccion=='DO/ES'){
			document.foDatosSesion.p_codmer.value='MX';
			document.foDatosSesion.p_codidi.value='ES';
		}else if (redireccion=='VE/EN'){
			document.foDatosSesion.p_codmer.value='MX';
			document.foDatosSesion.p_codidi.value='EN';
		}else if (redireccion=='MX/ES'){
			document.foDatosSesion.p_codmer.value='VE';
			document.foDatosSesion.p_codidi.value='EN';
		}else if (redireccion=='MX/EN'){
			document.foDatosSesion.p_codmer.value='VE';
			document.foDatosSesion.p_codidi.value='EN';
		}else if (redireccion=='US/ES'){
			document.foDatosSesion.p_codmer.value='US';
			document.foDatosSesion.p_codidi.value='ES';
		}else if (redireccion=='US/EN'){
			document.foDatosSesion.p_codmer.value='US';
			document.foDatosSesion.p_codidi.value='EN';
		}else if (redireccion=='UK/ES'){
			 document.foDatosSesion.p_codmer.value='UK';
			 document.foDatosSesion.p_codidi.value='ES';
		}else if (redireccion=='UK/EN'){
			 document.foDatosSesion.p_codmer.value='UK';
			 document.foDatosSesion.p_codidi.value='EN';
    }else if (redireccion=='PT/ES'){
			 document.foDatosSesion.p_codmer.value='PT';
			 document.foDatosSesion.p_codidi.value='ES';
		}else if (redireccion=='PT/PT'){
			 document.foDatosSesion.p_codmer.value='PT';
			 document.foDatosSesion.p_codidi.value='PT';
    }
		if (redireccion=='US/ES'|| redireccion=='US/EN' || redireccion=='UK/ES'|| redireccion=='UK/EN'|| redireccion=='PT/ES'|| redireccion=='PT/PT')
    {
    redireccion=redireccion.toLowerCase();
		document.location="http://www.aireuropa.com/"+redireccion+"/default.html";
    }else{
		redireccion=redireccion.toLowerCase();
		document.location="http://www.aireuropa.com/"+redireccion+"/default_amadeus.html";
	  }
	}else{
		if (redireccion=='ES/ES'){
			document.foDatosSesion.p_codmer.value='ES';
			document.foDatosSesion.p_codidi.value='ES';
      document.location.href="http://www.aireuropa.com/es/default.html";
		}else if (redireccion=='ES/EN'){
			document.foDatosSesion.p_codmer.value='ES';
			document.foDatosSesion.p_codidi.value='EN';
			document.location="http://www.aireuropa.com/en/default.html";			
		}else if (redireccion=='ES/CA'){
			document.foDatosSesion.p_codmer.value='ES';
			document.foDatosSesion.p_codidi.value='CA';
			document.location="http://www.aireuropa.com/ca/default.html";
		}else if (redireccion=='FR/FR'){
			document.foDatosSesion.p_codmer.value='FR';
			document.foDatosSesion.p_codidi.value='FR';
			document.location="http://www.aireuropa.com/fr/default.html";
		}else if (redireccion=='FR/ES'){
			document.foDatosSesion.p_codmer.value='FR';
			document.foDatosSesion.p_codidi.value='FR';
			document.location="http://www.aireuropa.com/es/default.html";
		}else if (redireccion=='IT/IT'){
			document.foDatosSesion.p_codmer.value='IT';
			document.foDatosSesion.p_codidi.value='IT';
			document.location="http://www.aireuropa.com/it/default.html";
		}else if (redireccion=='IT/ES'){
			document.foDatosSesion.p_codmer.value='IT';
			document.foDatosSesion.p_codidi.value='ES';
			document.location="http://www.aireuropa.com/es/default.html";
		}else if (redireccion=='OT/EN'){
			document.foDatosSesion.p_codmer.value='OT';
			document.foDatosSesion.p_codidi.value='EN';
			document.location="http://www.aireuropa.com/en/default.html";
		}else{
			document.foDatosSesion.p_codmer.value='OT';
			document.foDatosSesion.p_codidi.value='ES';
			document.location="http://www.aireuropa.com/es/default.html";
		}
	 }
  }

function getAptCod(aptDep, aptArr){
  var destinos=trayectos[aptDep];
  var i,j,x;
	if(!destinos) return;
	for(listaZona=0,j=destinos.length;j;j--,listaZona++){
		var arrZonaDestino=destinos[listaZona];
		if(arrZonaDestino!='.'){
			if(arrZonaDestino[0] !='.' ){ //saltamos el elemento centinela
				//insertamos todos los asociados
				var listaApts=arrZonaDestino[1];
 				for(x=0,i=listaApts.length;i;i--,x++){
					if(x!='.' && listaApts[x]!='.'){
						var aptCod=listaApts[x];
						if (aptCod.indexOf(aptArr)!=-1){
              return aptCod;
            }else if (aptArr.indexOf(aptCod)!=-1){
              return aptCod;
            } 
					}
				}
			}
		}
	}
}

function cargar_trayecto() {
  l_cadena = leerCookie(seleccion);
  if (l_cadena != null) {
    l_cadena = l_cadena.split("@");
    if (l_cadena[0]=="1") {
      if (l_cadena[2]!="") {
        l_tray = l_cadena[2].split("-");
        if (l_cadena[3]=='RT') {
          document.foTiptra.rbtn_tiptra[0].checked=true;
        } else {
          document.foTiptra.rbtn_tiptra[1].checked=true;
        }
        if (l_cadena[4]=='TUR') {
          document.foTiptra.rbtn_tipcab[0].checked=true;
        } else {
          document.foTiptra.rbtn_tipcab[1].checked=true;
        }
        cambia_tiptra();
        document.getElementById('combo_aptdep').value=l_tray[0];//.substring(0,3);
   		  document.getElementById('combotable_input').style.color = "#000000";
   		  document.getElementById('combotable_input').value=parent.getAptName(l_tray[0]);//l_tray.substring(0,3));
   		  document.getElementById('cod_or').innerHTML=l_tray;//.substring(0,3);
   		  cargaDestinos('combo_aptdep','combo_aptarr');
   		  rellenaDestino();
       		
        document.getElementById('combo_aptarr').value=getAptCod(l_tray[0], l_tray[1]);//.substring(4,7);
   		  document.getElementById('combotable2_input').style.color = "#000000";
   		  document.getElementById('combotable2_input').value=getAptName(l_tray[1]);//l_tray.substring(4,7));
        document.getElementById('cod_des').innerHTML=getAptCod(l_tray[0], l_tray[1]);//.substring(4,7);

        resetAll();
   		  fLimpiarVueloIda();
   		  fLimpiarVueloVta();
   		  if ( document.getElementById('cod_des').innerHTML.length>=4) {
   		    mostrar_api('S');
   		    // Check de descuento de Residente Marca Blanca Amadeus.
   		    if (document.getElementById('combo_aptarr').value.substr(0,1) == 'A'){
   		    // Tratamos destino para controlar los valores enviados en el parámetro
		        var ori =    new RegExp(document.getElementById('combo_aptdep').value);
		        var dest_aux = document.getElementById('combo_aptarr').value.substr(1,3);
            var dest =   new RegExp(dest_aux);
		        if(ori.test(list_apts_dtores)|| dest.test(list_apts_dtores))
		        {
              changeVisibility('dtores','show');
		        }else{
		          changeVisibility('dtores','hide');
            }
          }else{
          changeVisibility('dtores','hide');
          }
   		    if (l_cadena[3]=='RT') {
   		      document.getElementById('B_DIA_2').disabled = false;
			      document.getElementById('B_MES_2').disabled = false;
          } else {
            document.getElementById('B_DIA_2').disabled = true;
			      document.getElementById('B_MES_2').disabled = true;
          }
          //cargar_dispoH();
        } else {
          mostrar_api('N');
          submit_SearchV3();
        }
      }
    }
  }
}

function cargar_dispo() {
  l_cadena = leerCookie(seleccion).split("@");
  if ((l_cadena[5]!=null) && (l_cadena[5]!="")) {
    c1.dateClicked=true;
    c1.parseDate(l_cadena[5]);
    c1._init2(1,Date.parseDate(l_cadena[5],"%d/%m/%Y"));
    onSelect1('c1',l_cadena[5]);
    if (l_cadena[6]!='') {
      c2.dateClicked=true;
      c2.parseDate(l_cadena[6]);
      c2._init2(1,Date.parseDate(l_cadena[6],"%d/%m/%Y")); 
      onSelect2('c2',l_cadena[6]);
    }
  }
}

function cargar_dispoH() {
  l_cadena = leerCookie(seleccion).split("@");
  if ((l_cadena[5]!=null) && (l_cadena[5]!="")) {
    l_dat = l_cadena[5].split("-");
    document.getElementById('B_DIA_1').value=l_dat[0];
    document.getElementById('B_MES_1').value=l_dat[1];
    if (l_cadena[6]!='') {
      l_dat = l_cadena[6].split("-");
      document.getElementById('B_DIA_2').value=l_dat[0];
      document.getElementById('B_MES_2').value=l_dat[1];
    }
  }
}

