﻿var Hoy=new Date();
var HoyCal2 = new Date();
var colorLetraOn = "#000080";
var colorLetraOff = "#ffffff";
 
function pestanaOn(nomPestana, nomEnlace)
{
 document.getElementById(nomPestana).background='http://www.rumbo.es/newsletter/es/background_blanco_pest.gif';
 document.getElementById(nomEnlace).style.color=colorLetraOn;
}
 
function pestanaOff(nomPestana, nomEnlace)
{
 document.getElementById(nomPestana).background='http://www.rumbo.es/newsletter/es/background_azul_pest.gif';
 document.getElementById(nomEnlace).style.color=colorLetraOff;
}
 
function MostrarFecha(){
   var nombres_dias = new Array("Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado");
   var nombres_meses = new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
   var fecha_actual = new Date();
   dia_mes = fecha_actual.getDate();
   dia_semana = fecha_actual.getDay();
   mes = fecha_actual.getMonth() + 1;
   anio = fecha_actual.getYear();
   if (anio < 100)
      anio = '19' + anio;
   else if ( ( anio > 100 ) && ( anio < 999 ) ) {
      var cadena_anio = new String(anio);
      anio = '20' + cadena_anio.substring(1,3);
   } 
   document.write(nombres_dias[dia_semana] + " " + dia_mes + " de " + nombres_meses[mes - 1] + " de " + anio);
   }
 
function showHotels(){     
 buscador=document.hotel_search.Buscador.value.toUpperCase();  
 if (document.all){     
  document.all["BUSCADOR_HOTELES"].style.display="";     
  document.all["BUSCADOR_VUELOS"].style.display="none";       
  return;     
 }     
 if (document.layers){     
  document.layers["BUSCADOR_HOTELES"].display="";     
  document.layers["BUSCADOR_VUELOS"].display="none";     
         return;     
 }       
 document.getElementById("BUSCADOR_VUELOS").style.display="none";     
 document.getElementById("BUSCADOR_HOTELES").style.display="";  
//cambiaRegimenCategoria();
}
 
function showHotels2007(){     
  buscador=document.hotel_search.Buscador.value.toUpperCase();  
  if (document.all){     
   document.all["BUSCADOR_HOTELES"].style.display="";     
   document.all["BUSCADOR_VUELOS"].style.display="none";       
   document.all["BUSCADOR_VH"].style.display="none";
   hideViajes();
   return;     
  }     
  if (document.layers){     
   document.layers["BUSCADOR_HOTELES"].display="";     
   document.layers["BUSCADOR_VUELOS"].display="none";     
   document.layers["BUSCADOR_VH"].display="none";
   hideViajes();
      return;     
  }       
  document.getElementById("BUSCADOR_VUELOS").style.display="none";     
  document.getElementById("BUSCADOR_HOTELES").style.display="";  
  document.getElementById("BUSCADOR_VH").style.display="none";   
  hideViajes();
  
  //cambiaRegimenCategoria();
 }
       
 function showFlights(){      
  if (document.all){      
    document.all["BUSCADOR_VUELOS"].style.display="";      
    document.all["BUSCADOR_HOTELES"].style.display="none";      
     return;      
  }      
  if (document.layers){      
    document.layers["BUSCADOR_VUELOS"].display="";      
    document.layers["BUSCADOR_HOTELES"].display="none";       
          return;      
  }      
  document.getElementById("BUSCADOR_HOTELES").style.display="none";        
  document.getElementById("BUSCADOR_VUELOS").style.display="";  
 }      
 
 function showFlights2007(){      
  if (document.all){      
    document.all["BUSCADOR_VUELOS"].style.display="";      
    document.all["BUSCADOR_HOTELES"].style.display="none";      
    document.all["BUSCADOR_VH"].style.display="none";    
    hideViajes();
    return;      
  }      
  if (document.layers){      
    document.layers["BUSCADOR_VUELOS"].display="";      
    document.layers["BUSCADOR_HOTELES"].display="none"; 
    document.layers["BUSCADOR_VH"].style.display="none";        
    hideViajes();
          return;      
  }      
  document.getElementById("BUSCADOR_HOTELES").style.display="none";        
  document.getElementById("BUSCADOR_VH").style.display="none";   
  document.getElementById("BUSCADOR_VUELOS").style.display="";  
  hideViajes();
 }   
 
 function showVH2007(){
  if (document.all){      
    document.all["BUSCADOR_VH"].style.display="";      
    document.all["BUSCADOR_HOTELES"].style.display="none";      
    document.all["BUSCADOR_VUELOS"].style.display="none";  
    hideViajes();
    return;      
  }      
  if (document.layers){      
    document.layers["BUSCADOR_VH"].display="";      
    document.layers["BUSCADOR_HOTELES"].display="none"; 
    document.layers["BUSCADOR_VUELOS"].style.display="none";
    hideViajes();
    return;      
  }      
  document.getElementById("BUSCADOR_HOTELES").style.display="none";        
  document.getElementById("BUSCADOR_VUELOS").style.display="none";   
  document.getElementById("BUSCADOR_VH").style.display=""; 
  hideViajes();
 }   
 
 function showVIAJES(){
     if (document.getElementById('BUSCADOR_VIAJES')) {
         if (document.all) {
             document.all["BUSCADOR_VIAJES"].style.display = "";
             document.all["BUSCADOR_VH"].style.display = "none";
             document.all["BUSCADOR_HOTELES"].style.display = "none";
             document.all["BUSCADOR_VUELOS"].style.display = "none";
             return;
         }
         if (document.layers) {
             document.layers["BUSCADOR_VIAJES"].display = "";
             document.layers["BUSCADOR_VH"].display = "none";
             document.layers["BUSCADOR_HOTELES"].display = "none";
             document.layers["BUSCADOR_VUELOS"].style.display = "none";
             return;
         }
         document.getElementById("BUSCADOR_HOTELES").style.display = "none";
         document.getElementById("BUSCADOR_VUELOS").style.display = "none";
         document.getElementById("BUSCADOR_VH").style.display = "none";
         document.getElementById("BUSCADOR_VIAJES").style.display = "";
     }
 }
 
  
 function hideViajes(){
     if (document.getElementById('BUSCADOR_VIAJES')) {
         if (document.all) {
             document.all["BUSCADOR_VIAJES"].style.display = "none";
             return;
         }
         if (document.layers) {
             document.layers["BUSCADOR_VIAJES"].display = "none";
             return;
         }
         document.getElementById("BUSCADOR_VIAJES").style.display = "none";
     }
 }
 
 function showCars(){ 
  document.location.href="/public/jsp/coches/rb000avi.jsp";
 }      
 
 function showVueloMasHotel(){     
  document.location.href="/public/jsp/vacaciones/rb000pkn.jsp";
 }      
 
function horas_options(ini,fin,sel) {  
 
 var i=parseInt(ini);
 while (i<=parseInt(fin)){
  if (sel!='' && parseInt(i,10)==sel)
   document.write('<option selected="selected"  value="'+decode(i-1)+'">'+decode(i-1)+'</option>');
  else
   document.write("<option value='"+decode(i-1)+"'>"+decode(i-1)+"</option>");
  i++;
 } 
}
 
function dia_options(ini,fin,sel) {  
 var i=parseInt(ini);
 while (i<=parseInt(fin)){
  if (sel!='' && i==parseInt(sel,10))
   document.write('<option selected="selected"  value="'+decode(i-1)+'">'+decode(i-1)+'</option>');
  else   
   document.write("<option value='"+decode(i-1)+"'>"+decode(i-1)+"</option>");
  i++;
 } 
}
 
function mesanyo_options(ini,fin,sel,anyo,sel2,kind) {
    stanyo = anyo;
 i=parseInt(ini);
 months = fin; //pintamos 12 meses
 j=0;
 while (j<parseInt(fin)){
  if (kind!='') { //name of month
    if (kind=='es')     {
     k=0;
    } else if (kind=='br')     {
     k=6;
    } else k=2;
   if (sel!='' && (sel.toString()==anyo.toString()+i.toString())) {  document.write('<option selected="selected"  value="'+anyo+decode(i)+'">'+arrMes[k][i]+' '+decodeYear(anyo,stanyo)+'</option>');}
   else { document.write("<option value='"+anyo+decode(i)+"'>"+arrMes[k][i]+' '+decodeYear(anyo,stanyo)+"</option>");}
  } else {
   if (sel!='' && i==parseInt(sel,10))  document.write('<option selected="selected" value="'+i+'">'+i+'</option>');
   else document.write("<option value='"+i+"'>"+i+"</option>");
  }
  i++;
  j++;
  if (i==fin) { i=0; anyo++;}
 }
}
 

 
function decode(i) {
 if ((i+1).toString().length==1) return '0'+(i+1);
 else return (i+1);
}
 
function decodeYear(x,y) {
 if (x==y) return "";
 else return x;
}
 

//
//Nuevos js para comprobar que funcionen.
//
 
function doconcat(str1, str2)
 {
  return str1 + str2;
 }
function groupval(str, nom, islg, isln, isnm)
    {
    var sTemp = '';
        if (islg == 1)
        {sTemp = sTemp + islegal(str,nom);}
        if (isln == 1)
        {sTemp = sTemp + islength(str,nom);}
        if (isnm == 1)
        {sTemp = sTemp + isnum(str,nom);}
    return sTemp;
    }
function islegal(str,nom)
   {
   var inc = "&;`'{}[]";
   var temp = '';
       if (str.length > 0)
       {
       for (var i=0; i< str.length; i++) {
           temp = "" + str.substring(i, i+1);
  if (inc.indexOf(temp) != "-1")
           {
  return "El campo "+nom+" tiene caracteres ilegales \n";
  break;
  }
  }
  return '';
        }
        else
        {return '';}
   }
function islength(str,nom)
   {
       if (str.length == 0)
       {return 'Debe completar el campo ' + nom + '\n';}
       else
       {return '';}
   }
function isnum(str,nom)
   {
 var inc = "0123456789.,";
    var temp = '';
       if (str.length > 0)
       {
       for (var i=0; i< str.length; i++) {
           temp = "" + str.substring(i, i+1);
  if (inc.indexOf(temp) == "-1")
           {
  return "El campo "+ nom + " debe ser un numero \n";
  break;
  }
  }
  return '';
        }
        else
        {return '';}
 }
   function isNumBool(str)
   {
 var inc = "0123456789.,-";
    var temp = '';
       if (str.length > 0)
       {
        for (var i=0; i< str.length; i++) 
     {
            temp = "" + str.substring(i, i+1);
   if (inc.indexOf(temp) == "-1")
            {
    return false;
    break;
   }
  }
   return true;
       }
       else
       {return true;}
 }
 function openWin(sPath, wid, hei)
 {
  var iLeft  = 0;
  iLeft   = (screen.width / 2) - (wid / 2);
  var iTop = 0;
  iTop  = (screen.height / 2) - (hei / 2);
  window.open(sPath,"marian","width="+wid+",height="+hei+",status=no,toolbar=no,menubar=no,scrollbars=yes,top="+iTop+",left="+iLeft+""); 
 }
 
<!-- Calendario de la home -->
var HM_DOM = (document.getElementById) ? true : false;
var HM_NS4 = (document.layers) ? true : false;
var HM_IE = (document.all) ? true : false;
var HM_IE4 = HM_IE && !HM_DOM;
var HM_Mac = (navigator.appVersion.indexOf("Mac") != -1);
var HM_IE4M = HM_IE4 && HM_Mac;
var HM_IsMenu = (HM_DOM || HM_NS4 || (HM_IE && !HM_IE4M));
if(!HM_IsMenu) event = null;
var zz, zv, d, fTSR;
var gBF=false;
var g_MINY = 1601; 
var g_MAXY = 4500;
var g_month = 0;
var g_day = 0;
var g_year = 0;
var g_yLow = 1990;
var g_eC=null;
var g_eCV="";
 
var rgMC = Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
d = new Date();
fTSR=0;
zv = d.getTime();
zz = "&zz="+zv;
 
var esletra        = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.-ÑñáéíóúüÁÉÍÓÚÜ&";
var esetckt        = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-";
var esnumero       = "0123456789";
 
var DiasPorMes=[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
ie5=(ie4 && navigator.userAgent.indexOf('MSIE 5')>0);
var x = 0;
var y = 0;
var trk = 0;
var offsetx=-85;
var offsety=14;
var diaSeleccionado= ""+diaSeleccionado;
 
function callayerWrite(txt) {
    if (ns4) {
        var lyr = document.ptsDiv.document
        lyr.write(txt)
        lyr.close()
    }
    else if (ie4) document.all["calendario"].innerHTML = txt
}
 
function MM_SIR() { //v3.0
    var i,x,a=document.MM_sr; 
    for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) 
    x.src=x.oSrc;
}
 
function MM_PI() { 
    var d=document; 
    if(d.images){ 
      if(!d.MM_p) d.MM_p=new Array();
      var i,j=d.MM_p.length,a=MM_PI.arguments; 
      for(i=0; i<a.length; i++)
      if (a[i].indexOf("#")!=0){ 
         d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
      }
    }
}
 
function MM_FO(n, d) { 
    var p,i,x;  
    if(!d) d=document; 
    if((p=n.indexOf("?"))>0&&parent.frames.length) {
      d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
    }
    if(!(x=d[n])&&d.all) x=d.all[n]; 
    for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_FO(n,d.layers[i].document); return x;
}
 
function MM_SI() { 
    var i,j=0,x,a=MM_SI.arguments; 
    document.MM_sr=new Array; 
    for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_FO(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
 
       /*Escribe los options con valores desde ini hasta fi de 1 en 1*/
 
 var fechaActual = new Date();
 var iniAnio = fechaActual.getYear();
 
       function escriu_options1(ini, fi, sel){
 
 var i=parseInt(ini);
 while (i<=parseInt(fi)){
  if (sel!='' && i==parseInt(sel,10))
   document.write('<option selected="selected">'+i+'</option>');
  else   
   document.write("<option value='"+i+"'>"+i+"</option>");
  i++;
 }
      }
       /*Como escriu_options, pero para el anio*/
       function anyo_options(ini, fi, sel){
         
 var i=parseInt(ini);
 while (i<=parseInt(fi)){
  if (i==iniAnio)
   document.write("<option selected value='"+i+"'>"+i+"</option>");
  else
   document.write("<option value='"+i+"'>"+i+"</option>");
  i++;
  }
      }
 
    var elementType;
 var fe_dia ;
    var fe_mes;
    var fe_anyo ;
    var fs_dia;
 var fs_mes;
    var fs_anyo;
    var fe ;
    var fs ;
 
 function Calendario(tipo,pais_an,x ,y, elementTyp, fe_di, fe_me, fe_any, fs_di, fs_me, fs_any, fe_date, fs_date){
     elementType = elementTyp;
     fe_dia = fe_di;
     fe_mes = fe_me;
     fe_anyo =  fe_any;
     fs_dia =  fs_di;
     fs_mes = fs_me;
     fs_anyo = fs_any;
     fe = fe_date;
     fs = fs_date;
 // Las fechas que se seleccionen en el calendario desplegable pueden querer ser almacenadas en dos tipos de elementos del formulario
 //desde el qeu se llama al calendario:
 
 // - o en un type select , en cuyo caso tendremos una select para el dia de entrada (fe_dia), otra para el mes de entrada(fe_mes), a?o de entrada
 //(fe_anyo), dia de salida (fs_dia), mes de salida (fs_mes), a?o de salida (fs_anyo)
 // - o en un type input text, en cuyo caso tendremos un input text para la fecha de entrada (fe) y otro para la fecha de salida (fs)
 
    //Para mantener compatibilidad con  la versi?n vieja de la funci?n Calendario:
 if ( elementType ==null) {
  
  elementType = 'input';
  fe  =  document.AIR.fechaI;
  fs  =  document.AIR.fechaV;
 }
         if (x!=null)
         {
           xCalendario=x;
           yCalendario=y;
         }else
         {
           xCalendario="245";
           yCalendario="320";
         }
 tipoFecha=tipo;
 pais=pais_an;
 
 if (calendario.style.visibility=="visible")
 {
         cerrarCalendario();
      return;
 }
 abrirCalendario(tipo);
}
 
function showObject(obj) {
if (ns4) obj.visibility = "show"
else if (ie4) obj.visibility = "visible"
}
 
function hideObject(obj) {
if (ns4) obj.visibility = "hide"
else if (ie4) obj.visibility = "hidden"
}
 
var nombresMeses = new Array("ENERO", "FEBRERO", "MARZO", "ABRIL", "MAYO", "JUNIO", "JULIO", "AGOSTO", "SEPTIEMBRE", "OCTUBRE", "NOVIEMBRE", "DICIEMBRE");
 
function abrirCalendario(tipoFecha)
{
  try{cerrarCalendario();}catch(err){}
  var text_cal="";
  fecha_real =new Date();
  anio_real = fecha_real.getFullYear();
  mes_real = fecha_real.getMonth();
  dia_real = fecha_real.getDate();
 
  if (tipoFecha=='I')  {
     if (elementType.toLowerCase()=='input'){
   fechaInputSeleccionada=fe.value.substring(fe.value.indexOf("/"),fe.value.length);
   diaYaSeleccionado=1*fe.value.substring(0,fe.value.indexOf('/'));
  } else {
    if (fe_mes.options[fe_mes.selectedIndex].value.length==1) {
     fechaInputSeleccionada='/'+'0'+fe_mes.options[fe_mes.selectedIndex].value+'/'+fe_anyo.options[fe_anyo.selectedIndex].value.substring(2,4);
    } else {
    fechaInputSeleccionada='/'+fe_mes.options[fe_mes.selectedIndex].value+'/'+fe_anyo.options[fe_anyo.selectedIndex].value.substring(2,4);
    }
    if (fe_dia.options[fe_dia.selectedIndex].value.length==1) {
    diaYaSeleccionado='0'+fe_dia.options[fe_dia.selectedIndex].value;
         } else {
    diaYaSeleccionado=fe_dia.options[fe_dia.selectedIndex].value;
             }
  }
  }
  else if(tipoFecha=='V')
  {
           if (elementType.toLowerCase()=='input'){
   fechaInputSeleccionada=fs.value.substring(fs.value.indexOf("/"),fs.value.length);
   diaYaSeleccionado=1*fs.value.substring(0,fs.value.indexOf('/'));
    } else {
     if (fs_mes.options[fs_mes.selectedIndex].value.length==1) {
         fechaInputSeleccionada='/'+'0'+fs_mes.options[fs_mes.selectedIndex].value+'/'+fs_anyo.options[fs_anyo.selectedIndex].value.substring(2,4);
   } else {
    fechaInputSeleccionada='/'+fs_mes.options[fs_mes.selectedIndex].value+'/'+fs_anyo.options[fs_anyo.selectedIndex].value.substring(2,4);
       }
   if (fs_dia.options[fs_dia.selectedIndex].value.length==1) {
     diaYaSeleccionado='0'+fs_dia.options[fs_dia.selectedIndex].value;
      } else {
     diaYaSeleccionado=fs_dia.options[fs_dia.selectedIndex].value;
          }
    }
 
  }else   if (tipoFecha=='CI')  {
         //solo se usa para tipo input, si se usara como select habria q implementarlo
       //  fechaInputSeleccionada=fe.value.substring(document.FormRicerca.calendarioI.value.indexOf("/"),document.FormRicerca.calendarioI.value.length);
      fechaInputSeleccionada=document.FormRicerca.calendarioI.value.substring(document.FormRicerca.calendarioI.value.indexOf("/"),document.FormRicerca.calendarioI.value.length);
         diaYaSeleccionado=1*document.FormRicerca.calendarioI.value.substring(0,document.FormRicerca.calendarioI.value.indexOf('/'));
  }
  else if (tipoFecha=='CV')  {
   //solo se usa para tipo input, si se usara como select habria q implementarlo
      // fechaInputSeleccionada=document.FormRicerca.calendarioV.value.substring(document.FormRicerca.calendarioV.value.indexOf("/"),document.AIR.fechaV.value.length);
  fechaInputSeleccionada=document.FormRicerca.calendarioV.value.substring(document.FormRicerca.calendarioV.value.indexOf("/"),document.FormRicerca.calendarioV.value.length);
         diaYaSeleccionado=1*document.FormRicerca.calendarioV.value.substring(0,document.FormRicerca.calendarioV.value.indexOf('/'));
  }
else if (tipoFecha=="FI") {
 fechaInputSeleccionada=fe.value;
 diaYaSeleccionado=fe.value;
}
else if (tipoFecha=="FV"){
 fechaInputSeleccionada=fe.value; 
 diaYaSeleccionado=fe.value;
}
 
  ano = "" +Hoy.getYear();
  mes = (Hoy.getMonth()+1);
  mes = (mes<10?"0":"")+mes;
  fechaSeleccionada="/"+mes+"/"+ano.substring(2,4);
 
  var Anyo=Hoy.getYear(); // Si el a?o es anterior a 2000 debe sumarse 1900 a la cantidad obtenida
   // Observacion: El anyo se contabiliza a partir de 1900
   var EsteDia=Hoy.getDate();
 
  // Actualizacion del mes de Febrero (por los anyos bisiestos)
  if (((Anyo % 4 == 0) && (Anyo % 100 != 0)) || (Anyo % 400 == 0))
    DiasPorMes[1] = 29;
  // Numero de dias del mes actual
  NDias =DiasPorMes[Hoy.getMonth()];
 
  // Calculo que dia de la semana es el primero del mes
  PrimerDia=Hoy;
  PrimerDia.setDate(1);
 // Observacion: Obtengo el dia de hoy (p.e, 10-11-1999) y calculo que dia de la semana
 // es el dia 1 del mismo mes y anyo (p.e, 1-11-1999)
 
  Comienzo=PrimerDia.getDay();
 
  if (Comienzo==0) Comienzo=6;
    else Comienzo=PrimerDia.getDay()-1;
 
 // Escritura en la pantalla de la tabla correspondiente al mes actual 
 
   text_cal="<div id='calendario' style='position:absolute; VISIBILITY: hidden;z-index=28;left:"+xCalendario+";top:"+yCalendario+"'>"
   //text_cal=text_cal+"<CENTER>"
   text_cal=text_cal+"<TABLE BORDER=0 cellspacing=0 cellpadding=1><tr><td>" 
   text_cal=text_cal+"<TABLE BORDER=0 cellspacing=0 cellpadding=1 bgcolor=000000 width=150>"
   text_cal=text_cal+"<tr><td>"
   text_cal=text_cal+"<TABLE BORDER=0 height='135' cellspacing=0 cellpadding=0 bgcolor=FFFFFF>"
   text_cal=text_cal+"<TR class=titular_blanco>" 
 
   // Escribo en nombre del mes en la cabecera de la tabla
 

   if ( Hoy.getMonth() == mes_real && Hoy.getFullYear() == anio_real )
     text_cal=text_cal+"<TD align=left width=20>&nbsp;"
   else
    //old, no se ven las imagenes text_cal=text_cal+"<TD align=center width='20'><a href='Javascript:void(null)' onClick='mesAtras(&quot;"+tipoFecha+"&quot;, fe_dia, fe_mes, fe_anyo, fs_dia, fs_mes, fs_anyo, fe, fs)'><img src='/viajes/pic/"+pais+"/pic012.gif' border=0 ></a>"
     text_cal=text_cal+"<TD align=center width='20'><a href='Javascript:void(0);' onMouseOut='MM_SIR();' onMouseOver='MM_SI(\"atras\",\"\",\"/pictures/"+pais+"/pic012.gif\",1);' onClick='mesAtras(\""+tipoFecha+"\");MM_SIR();'><img name='atras' src='/pictures/"+pais+"/pic012.gif' border=0 ></a>";
 
  text_cal=text_cal+"</TD>"
 
 text_cal=text_cal+'<td COLSPAN=5 align=center>'+nombresMeses[Hoy.getMonth()*1]
 
   // Observacion: Los meses se numeran desde 0 hasta 11
 
   text_cal=text_cal+" "
   text_cal=text_cal+Anyo
   // old , no se ven las imagenes  text_cal=text_cal+"<TD align=center width='20'><a href='Javascript:void(null)' onClick='mesAdelante(&quot;"+tipoFecha+"&quot;)'><img src='/pictures/"+pais+"/pic013.gif' border=0 ></a>"
     text_cal=text_cal+"<TD align=center width='20'>";//<a href='Javascript:void(0)'  onMouseOut='MM_SIR();' onMouseOver='MM_SI(\"atras2\",\"\",\"/pictures/"+pais+"/pic013.gif\",1);' onClick='mesAdelante(\""+tipoFecha+"\");'  ><img name='atras2' src='/pictures/"+pais+"/pic013.gif' border=0 ></a>";
 
  
  text_cal=text_cal+"</TD></TR>"
  text_cal=text_cal+"<tr><td colspan=7 bgcolor=000000><img src='/pictures/rmbes/t.gif' height=1 border=0></td></tr>"
      if (typeof(DiasSemana)!='undefined')   {
   text_cal=text_cal+"<TR class=tit_rojo><td align=center>"+DiasSemana[0]+"<td align=center>"+DiasSemana[1]+"<td align=center>"+DiasSemana[2]+"<td align=center>"+DiasSemana[3]+"<td align=center>"+DiasSemana[4]+"<td align=center>"+DiasSemana[5]+"<td align=center>"+DiasSemana[6]+"</TR>"
   } else {
   text_cal=text_cal+"<TR class=tit_rojo><td align=center>L<td align=center>M<td align=center>X<td align=center>J<td align=center>V<td align=center>S<td align=center>D</TR>"
   }
   text_cal=text_cal+"<tr><td colspan=7 bgcolor=000000><img src='/pictures/rmbes/t.gif' height=1 border=0></td></tr>"
 
 // Escritura de los espacios en blanco de la tabla
 
 text_cal=text_cal+"<TR>"
   columna=0;
 
   for (i=0; i<Comienzo; i++)
      {
        text_cal=text_cal+"<TD>"
        columna++;
        text_cal=text_cal+"</TD>"
      }
 
   // Escritura de los dias del mes
 for (i=1; i<=NDias; i++)
      {
      text_cal=text_cal+"<TD class=B width='20'>"
        if ((i == diaYaSeleccionado)&&(fechaInputSeleccionada == fechaSeleccionada))
             estilo="class='azul'";
        else if (columna == 6)
             estilo="class='rojo'";
        else 
             estilo="class='normal'";
   if ( Hoy.getMonth() == mes_real && Hoy.getFullYear() == anio_real && i < dia_real)
        text_cal=text_cal+"<center><font color='#CCCCCC' size='2'>"+i+"</font></center>"
   else
        text_cal=text_cal+"<center><div id="+i+" style='cursor:hand' onclick='javascript:diaSeleccionado="+i+";verDiaSeleccionado(\""+tipoFecha+"\",\"S\")'><a href='Javascript:void(null)' "+estilo+">"+i+"</a></div></center>"
 
        if (i == EsteDia || columna == 6)
             text_cal=text_cal
        else if (columna == 0)
             text_cal=text_cal
        text_cal=text_cal+"</TD>"
columna++;
        if (columna == 7)
          { text_cal=text_cal+"</TR><TR>"; // Comienza una nueva fila
            columna=0;
          }
    }//fin del for
  text_cal=text_cal+"</TR>"
  text_cal=text_cal+"<TR>"
 
  text_cal=text_cal+"<TD colspan=5></td><td colspan=2 align=right><a href='Javascript:void(null)' onClick='cerrarCalendario()'><img src='/pictures/"+pais+"/pic014.gif' border=0 ></a>"
  text_cal=text_cal+"</TD>"
  text_cal=text_cal+"</TR>"
text_cal=text_cal+"</TABLE>"
  text_cal=text_cal+"</TD>"
  text_cal=text_cal+"</TR>"
text_cal=text_cal+"</TABLE>"
text_cal=text_cal+"</td>"
//text_cal=text_cal+"</CENTER>"
 
//aqui metemos el segundo calendario.
 
if (Hoy.getMonth()==11){
   mesActual=0;
   anoActual=Hoy.getYear()+1;
  }
  else{
  mesActual=Hoy.getMonth()+1;
  anoActual=Hoy.getYear();
  }
HoyCal2=new Date(anoActual,mesActual,1); //a?o,mes,dia 
 
Anyo=HoyCal2.getYear(); // Si el a?o es anterior a 2000 debe sumarse 1900 a la cantidad obtenida
// Observacion: El anyo se contabiliza a partir de 1900
EsteDia=HoyCal2.getDate();
// Actualizacion del mes de Febrero (por los anyos bisiestos)
if (((Anyo % 4 == 0) && (Anyo % 100 != 0)) || (Anyo % 400 == 0))
  DiasPorMes[1] = 29;
// Numero de dias del mes actual
NDias =DiasPorMes[HoyCal2.getMonth()];
 
  // Calculo que dia de la semana es el primero del mes
  PrimerDia=HoyCal2;
  PrimerDia.setDate(1);
 // Observacion: Obtengo el dia de hoy (p.e, 10-11-1999) y calculo que dia de la semana
 // es el dia 1 del mismo mes y anyo (p.e, 1-11-1999)
 
  Comienzo=PrimerDia.getDay();
 
  if (Comienzo==0) Comienzo=6;
    else Comienzo=PrimerDia.getDay()-1;
 
 //text_cal=text_cal+"<CENTER>"
   text_cal=text_cal+"<td>"
   text_cal=text_cal+"<TABLE BORDER=0 cellspacing=0 cellpadding=1 bgcolor=000000 width=150>"
   text_cal=text_cal+"<tr><td>"
   text_cal=text_cal+"<TABLE BORDER=0 height='135' cellspacing=0 cellpadding=0 bgcolor=FFFFFF>"
   text_cal=text_cal+"<TR class=titular_blanco>" 
 
   // Escribo en nombre del mes en la cabecera de la tabla
 

   if (HoyCal2.getMonth() == mes_real && Hoy.getFullYear() == anio_real )
     text_cal=text_cal+"<TD align=left width=20>&nbsp;"
   else
    //old, no se ven las imagenes text_cal=text_cal+"<TD align=center width='20'><a href='Javascript:void(null)' onClick='mesAtras(&quot;"+tipoFecha+"&quot;, fe_dia, fe_mes, fe_anyo, fs_dia, fs_mes, fs_anyo, fe, fs)'><img src='/viajes/pic/"+pais+"/pic012.gif' border=0 ></a>"
     text_cal=text_cal+"<TD align=center width='20'>";
     //<a href='Javascript:void(0);' onMouseOut='MM_SIR();' onMouseOver='MM_SI(\"atras\",\"\",\"/pictures/"+pais+"/pic012.gif\",1);' onClick='mesAtras(\""+tipoFecha+"\");MM_SIR();'><img name='atras' src='/pictures/"+pais+"/pic012.gif' border=0 ></a>";
 
  text_cal=text_cal+"</TD>"
 
 text_cal=text_cal+'<td COLSPAN=5 align=center>'+nombresMeses[HoyCal2.getMonth()*1]
 
   // Observacion: Los meses se numeran desde 0 hasta 11
 
   text_cal=text_cal+" "
   text_cal=text_cal+Anyo
   // old , no se ven las imagenes  text_cal=text_cal+"<TD align=center width='20'><a href='Javascript:void(null)' onClick='mesAdelante(&quot;"+tipoFecha+"&quot;)'><img src='/pictures/"+pais+"/pic013.gif' border=0 ></a>"
     text_cal=text_cal+"<TD align=center width='20'><a href='Javascript:void(0)'  onMouseOut='MM_SIR();' onMouseOver='MM_SI(\"atras2\",\"\",\"/pictures/"+pais+"/pic013.gif\",1);' onClick='mesAdelante(\""+tipoFecha+"\");'  ><img name='atras2' src='/pictures/"+pais+"/pic013.gif' border=0 ></a>";
 
  
  text_cal=text_cal+"</TD></TR>"
  text_cal=text_cal+"<tr><td colspan=7 bgcolor=000000><img src='/pictures/rmbes/t.gif' height=1 border=0></td></tr>"
      if (typeof(DiasSemana)!='undefined')   {
   text_cal=text_cal+"<TR class=tit_rojo><td align=center>"+DiasSemana[0]+"<td align=center>"+DiasSemana[1]+"<td align=center>"+DiasSemana[2]+"<td align=center>"+DiasSemana[3]+"<td align=center>"+DiasSemana[4]+"<td align=center>"+DiasSemana[5]+"<td align=center>"+DiasSemana[6]+"</TR>"
   } else {
   text_cal=text_cal+"<TR class=tit_rojo><td align=center>L<td align=center>M<td align=center>X<td align=center>J<td align=center>V<td align=center>S<td align=center>D</TR>"
   }
   text_cal=text_cal+"<tr><td colspan=7 bgcolor=000000><img src='/pictures/rmbes/t.gif' height=1 border=0></td></tr>"
 
 // Escritura de los espacios en blanco de la tabla
 
 text_cal=text_cal+"<TR>"
   columna=0;
 
   for (i=0; i<Comienzo; i++)
      {
        text_cal=text_cal+"<TD>"
        columna++;
        text_cal=text_cal+"</TD>"
      }
 
   // Escritura de los dias del mes
 for (i=1; i<=NDias; i++)
      {
      text_cal=text_cal+"<TD class=B width='20'>"
        if ((i == diaYaSeleccionado)&&(fechaInputSeleccionada == fechaSeleccionada))
             estilo="class='azul'";
        else if (columna == 6)
             estilo="class='rojo'";
        else 
             estilo="class='normal'";                          
  
   if (HoyCal2.getMonth() == mes_real && HoyCal2.getFullYear() == anio_real && i < dia_real)
        text_cal=text_cal+"<center><font color='#CCCCCC'>"+i+"</font></center>"
   else
        text_cal=text_cal+"<center><div id="+i+" style='cursor:hand' onclick='javascript:diaSeleccionado="+i+";verDiaSeleccionado(\""+tipoFecha+"\",\"I\")'><a href='Javascript:void(null)' "+estilo+">"+i+"</a></div></center>"
 
        if (i == EsteDia || columna == 6)
             text_cal=text_cal
        else if (columna == 0)
             text_cal=text_cal
        text_cal=text_cal+"</TD>"
columna++;
 
        if (columna == 7)
          { text_cal=text_cal+"</TR><TR>"; // Comienza una nueva fila
            columna=0;            
          }
    }//fin del for  
  
  text_cal=text_cal+"</TR>"
  text_cal=text_cal+"<TR>"
 
  text_cal=text_cal+"<TD colspan=5></td><td colspan=2 align=right><a href='Javascript:void(null)' onClick='cerrarCalendario()'><img src='/pictures/"+pais+"/pic014.gif' border=0 ></a>"
  text_cal=text_cal+"</TD>"
  text_cal=text_cal+"</TR>"
text_cal=text_cal+"</TABLE>"
  text_cal=text_cal+"</TD>"
  text_cal=text_cal+"</TR>"
text_cal=text_cal+"</TABLE>"
text_cal=text_cal+"</td></tr></table>"
//text_cal=text_cal+"</CENTER>"
 
text_cal=text_cal+"</div>"
text_cal=text_cal+"<iframe id='DivShim' src='javascript:false;' scrolling='no' frameborder='0' style='position:absolute; top:0px; left:0px; display:none;'></iframe>";
 
calendario.outerHTML = text_cal;
calendario.style.visibility = "visible";
 var IfrRef = document.getElementById('DivShim');
    IfrRef.style.width   = calendario.offsetWidth;
    IfrRef.style.height  = calendario.offsetHeight;
    IfrRef.style.top   = calendario.style.top;
    IfrRef.style.left   = calendario.style.left;
    IfrRef.style.zIndex  = calendario.style.zIndex - 1;
    IfrRef.style.display  = "block";
}//fin de abrir calendario
 
function cerrarCalendario(){
     calendario.style.visibility="hidden";
     var IfrRef = document.getElementById('DivShim');
     IfrRef.style.display  = "none";
}
 
function verDiaSeleccionado(tipoFecha,cual){
//miramos si el calendario es el superior o el inferior
if(cual=="S"){
 mesActual=Hoy.getMonth()+1;
 anoActual=Hoy.getYear();
}
else if(cual=="I"){
 mesActual=HoyCal2.getMonth()+1;
 anoActual=HoyCal2.getYear();
}
anoActual=""+anoActual;
mesActual= ""+mesActual;
mesActual = mesActual.length==2 ? mesActual : "0"+mesActual;
diaSeleccionado= ""+diaSeleccionado;
diaSeleccionado = diaSeleccionado.length==2 ? diaSeleccionado : "0"+diaSeleccionado;
 
if (tipoFecha=="I") {
 
if (elementType=='input'){
 fe.value=diaSeleccionado+"/"+mesActual+"/"+anoActual.substring(2,4);
} else {
 i=0; 
 while (i<fe_dia.length) {
           if ((fe_dia[i].value==diaSeleccionado&&fe_dia[i].value.length==2)||('0'+fe_dia[i].value==diaSeleccionado&&fe_dia[i].value.length==1))
           {
   index=i;
   break;
           }
     i++;
 }
 i=0;
 fe_dia.selectedIndex=index;
 while (i<fe_mes.length) {
           if ((fe_mes[i].value==mesActual&&fe_mes[i].value.length==2)||('0'+fe_mes[i].value==mesActual&&fe_mes[i].value.length==1))
           {
   index=i;
   break;
           }
     i++;
 }
 i=0;
 fe_mes.selectedIndex=index;
 while (i<fe_anyo.length) {
           if (fe_anyo[i].value.substring(2,4)==anoActual.substring(2,4))
           {
   index=i;
   break;
           }
     i++;
 }
 fe_anyo.selectedIndex=index;
 actualizar_fS(fe_dia);   //funci?n que calcula el numero de noches comprendidas entre la fecha de entrada y la de salida.
    i=0;
}
}
else if (tipoFecha=="V"){
 if (elementType=='input'){
  document.AIR.fechaV.value=diaSeleccionado+"/"+mesActual+"/"+anoActual.substring(2,4);
 } else {
      i=0;
  //document.TH_AVAIL.fechaV.value=diaSeleccionado+"/"+mesActual+"/"+anoActual.substring(2,4);
  while (i<fs_dia.length) {
     if ((fs_dia[i].value==diaSeleccionado&&fs_dia[i].value.length==2)||('0'+fs_dia[i].value==diaSeleccionado&&fs_dia[i].value.length==1))   {
   index=i;
   break;  }
     i++;
  }
  i=0;
  fs_dia.selectedIndex=index;
  while (i<fs_mes.length) {
     if ((fs_mes[i].value==mesActual&&fs_mes[i].value.length==2)||('0'+fs_mes[i].value==mesActual&&fs_mes[i].value.length==1))   {
   index=i;
   break;  }
     i++;
  }
  i=0;
  fs_mes.selectedIndex=index;
  while (i<fs_anyo.length){
     if (fs_anyo[i].value.substring(2,4)==anoActual.substring(2,4)) {
   index=i;
   break;  }
     i++;
  }
  fs_anyo.selectedIndex=index;
  actualizar_Noches(fs_dia); //funcion para calcular las noches entre la fs y la fe
  }
}
else if (tipoFecha=="CI") {
 document.FormRicerca.calendarioI.value=diaSeleccionado+"/"+mesActual+"/"+anoActual.substring(2,4);
}
else if (tipoFecha=="CV"){
 document.FormRicerca.calendarioV.value=diaSeleccionado+"/"+mesActual+"/"+anoActual.substring(2,4);
}
else if (tipoFecha=="FI") {
 fe.value=diaSeleccionado;
 fs.value=anoActual+mesActual;
}
else if (tipoFecha=="FV"){
 fe.value=diaSeleccionado;
 fs.value=anoActual+mesActual;
}
cerrarCalendario();
    //Hoy=new Date(2002,0,28); //a?o,mes,dia
//control_fecha();
   }//fin verDiaSeleccionado
 
function mesAtras(tipoFecha, elementType, fe_dia, fe_mes, fe_anyo, fs_dia, fs_mes, fs_anyo, fe, fs){
   if (Hoy.getMonth()==0){
  mesActual=11;
  anoActual=Hoy.getYear()-1;
  }
  else{
  mesActual=Hoy.getMonth()-1;
  anoActual=Hoy.getYear();
  }
//     Hoy=new Date(anoActual,mesActual,28); //a?o,mes,dia
      Hoy=new Date(anoActual,mesActual,1); //a?o,mes,dia
      abrirCalendario(tipoFecha, elementType, fe_dia, fe_mes, fe_anyo, fs_dia, fs_mes, fs_anyo, fe, fs);
}//fin mesAtras
 
function mesAdelante(tipoFecha){
 
  if (Hoy.getMonth()==11){
   mesActual=0;
   anoActual=Hoy.getYear()+1;
  }
  else{
  mesActual=Hoy.getMonth()+1;
  anoActual=Hoy.getYear();
  }
      Hoy=new Date(anoActual,mesActual,1); //a?o,mes,dia
//      Hoy=new Date(anoActual,mesActual,28); //a?o,mes,dia
      abrirCalendario(tipoFecha);
}//fin mesAdelante
 
function QuitarAcentos(st) {
   st = st.replace(/á/gi,"a");
   st = st.replace(/à/gi,"a");
   st = st.replace(/â/gi,"a");
   st = st.replace(/ä/gi,"a");
   st = st.replace(/ª/gi,"a");
   
   st = st.replace(/é/gi,"e");
   st = st.replace(/è/gi,"e");
   st = st.replace(/ê/gi,"e");
   st = st.replace(/ë/gi,"e");
   
   st = st.replace(/ì/gi,"i");
   st = st.replace(/í/gi,"i");
   st = st.replace(/î/gi,"i");
   st = st.replace(/ï/gi,"i");
   
   st = st.replace(/ò/gi,"o");
   st = st.replace(/ó/gi,"o");
   st = st.replace(/ô/gi,"o");
   st = st.replace(/ö/gi,"o");
   
   st = st.replace(/ú/gi,"u");
   st = st.replace(/ù/gi,"u");
   st = st.replace(/û/gi,"u");
   st = st.replace(/ü/gi,"u");
   
   st = st.replace(/ç/gi,"c");
   st = st.replace(/ñ/gi, "n");
   return st;
}
 
/*Retorna la cadena sin ning?n espacio*/
 
function SinEspacios(cadena){
 var s = new String(cadena);
 var i=0;
    do {
  s = s.replace(" ","");
  i=i+1;
 }
    while ((s.search(/\s*/)!=-1) && (i<15));
    return(s);
}
 

//-->
 
//Array de meses
arrMes = new Array();
arrMes[0] = new Array(12);
arrMes[0][0] = "ENE";
arrMes[0][1] = "FEB";
arrMes[0][2] = "MAR";
arrMes[0][3] = "ABR";
arrMes[0][4] = "MAY";
arrMes[0][5] = "JUN";
arrMes[0][6] = "JUL";
arrMes[0][7] = "AGO";
arrMes[0][8] = "SEP";
arrMes[0][9] = "OCT";
arrMes[0][10] = "NOV";
arrMes[0][11] = "DIC";
arrMes[1] = new Array(12);
arrMes[1][0] = "Januar";
arrMes[1][1] = "Februar";
arrMes[1][2] = "März";
arrMes[1][3] = "April";
arrMes[1][4] = "Mai";
arrMes[1][5] = "Juni";
arrMes[1][6] = "Juli";
arrMes[1][7] = "August";
arrMes[1][8] = "September";
arrMes[1][9] = "Oktober";
arrMes[1][10] = "November";
arrMes[1][11] = "Dezember";
arrMes[2] = new Array(12);
arrMes[2][0] = "Gennaio";
arrMes[2][1] = "Febbraio";
arrMes[2][2] = "Marzo";
arrMes[2][3] = "Aprile";
arrMes[2][4] = "Maggio";
arrMes[2][5] = "Giugno";
arrMes[2][6] = "Luglio";
arrMes[2][7] = "Agosto";
arrMes[2][8] = "Settembre";
arrMes[2][9] = "Ottobre";
arrMes[2][10] = "Novembre";
arrMes[2][11] = "Dicembre";
arrMes[3] = new Array(12);
arrMes[3][0] = "Janvier";
arrMes[3][1] = "Février";
arrMes[3][2] = "Mars";
arrMes[3][3] = "Avril";
arrMes[3][4] = "Mai";
arrMes[3][5] = "Juin";
arrMes[3][6] = "Juillet";
arrMes[3][7] = "Août";
arrMes[3][8] = "Septembre";
arrMes[3][9] = "Octobre";
arrMes[3][10] = "Novembre";
arrMes[3][11] = "Décembre";
arrMes[4] = new Array(12);
arrMes[4][0] = "Janvier";
arrMes[4][1] = "Février";
arrMes[4][2] = "Mars";
arrMes[4][3] = "Avril";
arrMes[4][4] = "Mai";
arrMes[4][5] = "Juin";
arrMes[4][6] = "Juillet";
arrMes[4][7] = "Août";
arrMes[4][8] = "Septembre";
arrMes[4][9] = "Octobre";
arrMes[4][10] = "Novembre";
arrMes[4][11] = "Décembre";
arrMes[5] = new Array(12);
arrMes[5][0] = "Janvier";
arrMes[5][1] = "Février";
arrMes[5][2] = "Mars";
arrMes[5][3] = "Avril";
arrMes[5][4] = "Mai";
arrMes[5][5] = "Juin";
arrMes[5][6] = "Juillet";
arrMes[5][7] = "Août";
arrMes[5][8] = "Septembre";
arrMes[5][9] = "Octobre";
arrMes[5][10] = "Novembre";
arrMes[5][11] = "Décembre";
arrMes[6] = new Array(12);
arrMes[6][0] = "Janeiro";
arrMes[6][1] = "Fevereiro";
arrMes[6][2] = "Março";
arrMes[6][3] = "Abril";
arrMes[6][4] = "Maio";
arrMes[6][5] = "Junho";
arrMes[6][6] = "Julho";
arrMes[6][7] = "Agosto";
arrMes[6][8] = "Setembro";
arrMes[6][9] = "Outubro";
arrMes[6][10] = "Novembro";
arrMes[6][11] = "Dezembro";
 
function getDaysInMonth(month,ani)
{
 var days;
 if ((month==0)||(month==2)||(month==4)||(month==6)||(month==7)||(month==9)||(month==11))
 {
  days=31;
 }
 else if ((month==3) || (month==5) || (month==8) || (month==10))
 {
  days=30;
 }
 else if (month==1)
 { var a=isLeapYear(ani);
  if (a)
  {
   days=29;
  }
  else
  {
   days=28;
  }
 }
return (days);
}
 
function isLeapYear (Year)
{
 if ( ((Year % 4)==0) & ((Year % 100)!=0) || ((Year % 400)==0) )
 {
    return (true);
 }
 else
 {
  return (false);
 }
}
 
function validateNewsletter(cual)  
 {  
 if (!EMailOk(document.newsletter.EMAIL.value)) { 
    alert(textIncorrectEmail()); 
       document.newsletter.EMAIL.select(); 
      document.newsletter.EMAIL.focus(); 
    } else { 
      var EMAIL = document.newsletter.EMAIL.value; 
      var emailType = "" ;
      for (i=0; i<2;i++) { 
        if (document.newsletter.emailType[i].checked) { 
          emailType=document.newsletter.emailType[i].value ;
        } 
      } 
      var URL = cual+'?EMAIL='+EMAIL+'&emailType='+emailType;    
      document.newsletter.EMAIL.value = "";     
   openwindow(URL,'Rumbo','scrollbars=no,toolbars=no,screenX=0,screenY=0,width=350,height=200') ;
    } 
 } 
 
function Validar_Newsletter() 
{
 /*Se comprueba el formato del e-mail*/
 if(newsletterForm.email.value != "")
 {
   var addressPattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
      if (! addressPattern.test(newsletterForm.email.value)) 
   {
   alert("Sintaxis incorrecta. Por favor, verifique el campo Email");
    newsletterForm.email.focus();
   }else
   {
   openwindow('','Boletin','scrollbars=no,toolbars=no,screenX=0,screenY=0,width=375,height=150') ;
   newsletterForm.target="Boletin";
   newsletterForm.submit();
   }
 }
 else
 {
  alert("Por favor, rellene el campo Email");
 }
}
 
function EMailOk(s_email) { 
  //var addressPattern =     /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; mas restrictivo
  var addressPattern =    /^[^\s\n]+\@[a-zA-Z0-9][a-zA-Z0-9\-\.]*\.[a-zA-Z]{2,4}$/;
  //alert(addressPattern.test(s_email));
     if (! addressPattern.test(s_email)) return false;
  return (s_email.length <= 128);  
}
 
function textIncorrectEmail(){
 return "Email incorrecto"
 }
 
function openwindow(direccion, name, cadena)  
{  
  var winf = window.open(direccion,name,cadena);  
  winf.focus();  
} 
 
function selectAirports(selMAD,selBCN,TripType) {
document.write("<option value=\"ALC\">Alicante</option><option value=\"LEI\">Almería</option><option value=\"AMS\">Amsterdam</option><option value=\"BJZ\">Badajoz</option><option value=\"BCN\" "+selBCN+">Barcelona</option><option value=\"BIO\">Bilbao</option><option value=\"BRU\">Bruselas</option><option value=\"BUE\">Buenos Aires</option><option value=\"CPH\">Copenhagen</option><option value=\"DUB\">Dublín</option><option value=\"DUS\">Dusseldorf</option><option value=\"STO\">Estocolmo</option><option value=\"FRA\">Frankfurt</option><option value=\"FUE\">Fuerteventura</option><option value=\"GVA\">Ginebra</option><option value=\"GRX\">Granada</option><option value=\"IBZ\">Ibiza </option><option value=\"XRY\">Jerez</option><option value=\"LCG\">La Coruña</option><option value=\"SPC\">La Palma</option><option value=\"ACE\">Lanzarote</option><option value=\"LPA\">Las Palmas G. Canaria</option><option value=\"LEN\">León</option><option value=\"LIS\">Lisboa</option><option value=\"RJL\">Logroño</option><option value=\"LON\">Londres</option><option value=\"MAD\" "+selMAD+">Madrid</option><option value=\"AGP\">Málaga</option><option value=\"MAH\">Menorca</option><option value=\"MIL\">Milán</option><option value=\"MJV\">Murcia</option><option value=\"NYC\">Nueva York</option><option value=\"OPO\">Oporto</option><option value=\"OVD\">Oviedo</option><option value=\"PMI\">Palma de Mallorca</option><option value=\"PNA\">Pamplona</option><option value=\"PAR\">París</option><option value=\"ROM\">Roma</option><option value=\"EAS\">San Sebastián</option><option value=\"SDR\">Santander</option><option value=\"SCQ\">Santiago Compostela</option><option value=\"SVQ\">Sevilla</option><option value=\"TCI\">Tenerife</option><option value=\"VLC\">Valencia</option><option value=\"VLL\">Valladolid</option><option value=\"VGO\">Vigo</option><option value=\"ZIC\">Vitoria</option><option value=\"ZAZ\">Zaragoza</option><option value=\"ZRH\">Zurich</option><option value=\"OTH\">"+TripType+"</OPTION>");
}

function selectAirports_D(selMAD,selBCN,TripType) {
document.write("<option value=\"ALC\">Alicante</option><option value=\"LEI\">Almería</option><option value=\"AMS\">Amsterdam</option><option value=\"BCN\" "+selBCN+">Barcelona</option><option value=\"BER\">Berlín</option><option value=\"BIO\">Bilbao</option><option value=\"BRU\">Bruselas</option><option value=\"BUE\">Buenos Aires</option><option value=\"CPH\">Copenhagen</option><option value=\"DUB\">Dublín</option><option value=\"DUS\">Dusseldorf</option><option value=\"STO\">Estocolmo</option><option value=\"FRA\">Frankfurt</option><option value=\"FUE\">Fuerteventura</option><option value=\"GVA\">Ginebra</option><option value=\"GRX\">Granada</option><option value=\"IBZ\">Ibiza </option><option value=\"XRY\">Jerez</option><option value=\"LCG\">La Coruña</option><option value=\"ACE\">Lanzarote</option><option value=\"LPA\">Las Palmas G. Canaria</option><option value=\"LIS\">Lisboa</option><option value=\"LON\">Londres</option><option value=\"MAD\" "+selMAD+">Madrid</option><option value=\"AGP\">Málaga</option><option value=\"MAH\">Menorca</option><option value=\"MEX\">México</option><option value=\"MIA\">Miami</option><option value=\"MIL\">Milán</option><option value=\"MUC\">Munich</option><option value=\"NYC\">Nueva York</option><option value=\"OPO\">Oporto</option><option value=\"OVD\">Oviedo</option><option value=\"PMI\">Palma de Mallorca</option><option value=\"PNA\">Pamplona</option><option value=\"PAR\">París</option><option value=\"PRG\">Praga</option><option value=\"ROM\">Roma</option><option value=\"EAS\">San Sebastián</option><option value=\"SDR\">Santander</option><option value=\"SCQ\">Santiago Compostela</option><option value=\"SVQ\">Sevilla</option><option value=\"STR\">Stuttgart</option><option value=\"TCI\">Tenerife</option><option value=\"VLC\">Valencia</option><option value=\"VCE\">Venecia</option><option value=\"VIE\">Viena</option><option value=\"VGO\">Vigo</option><option value=\"ZRH\">Zurich</option><option value=\"OTH\">"+TripType+"</OPTION>");
}
