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"; return; } if (document.layers){ document.layers["BUSCADOR_HOTELES"].display=""; document.layers["BUSCADOR_VUELOS"].display="none"; document.layers["BUSCADOR_VH"].display="none"; return; } document.getElementById("BUSCADOR_VUELOS").style.display="none"; document.getElementById("BUSCADOR_HOTELES").style.display=""; document.getElementById("BUSCADOR_VH").style.display="none"; //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"; return; } if (document.layers){ document.layers["BUSCADOR_VUELOS"].display=""; document.layers["BUSCADOR_HOTELES"].display="none"; document.layers["BUSCADOR_VH"].style.display="none"; return; } document.getElementById("BUSCADOR_HOTELES").style.display="none"; document.getElementById("BUSCADOR_VH").style.display="none"; document.getElementById("BUSCADOR_VUELOS").style.display=""; } 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"; return; } if (document.layers){ document.layers["BUSCADOR_VH"].display=""; 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=""; } 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(''); else document.write(""); i++; } } function dia_options(ini,fin,sel) { var i=parseInt(ini); while (i<=parseInt(fin)){ if (sel!='' && i==parseInt(sel,10)) document.write(''); else document.write(""); i++; } } 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+""); } 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&&i0&&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'+i+''); else document.write(""); 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(""); else document.write(""); 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="" text_cal=text_cal+""; 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 //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(""); } function selectAirports_D(selMAD,selBCN,TripType) { document.write(""); }