var i, a; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("title") == "jsenabled") { a.disabled = true; a.disabled = false; } } function init_header(){ $('#linkIdiomas').click(function(){ $('#capaIdiomes').fadeIn('fast'); return false; }); $('.close').click(function(){ $(this.parentNode).hide('fast'); return false; }); $('.button').mouseover(function() {$(this).addClass("butOver");}).mouseout(function() {$(this).removeClass("butOver");}); $('.button2').mouseover(function() {$(this).addClass("butOver2");}).mouseout(function() {$(this).removeClass("butOver2");}); $('a.new-win').click(function() { window.open(this.href); return false; }); } function init_calendar(){ $(function() { $('.date-pick') .datePicker() .bind( 'click', function() { $(this).dpDisplay(); this.blur(); return false; } ) .bind( 'dateSelected', function(e, selectedDate, $td) { x = new Date(selectedDate); $('#' + e.target.id).next().next().text(x.getDayName() + ' ' +x.getDate().toString() + ' ' + x.getMonthName() + ' ' + x.getFullYear()) } ); }); $('#fechaEntrada').bind( 'dpClosed', function(e, selectedDates) { var d = selectedDates[0]; if (d) { d = new Date(d); $('#fechaSalida').dpSetStartDate(d.addDays(1).asString()); } } ); $('#fechaSalida').bind( 'dpClosed', function(e, selectedDates) { var d = selectedDates[0]; if (d) { d = new Date(d); $('#fechaEntrada').dpSetEndDate(d.addDays(-1).asString()); } } ); $('#linkTodosDestinos').click(function(){ $('#llistaPaisos').bgiframe().fadeIn('fast'); return false; }); } function init_compartir(){ $('#linkCompartir').click(function(){ $('#capaCompartir').fadeIn('fast'); return false; }); $('.close').click(function(){ $(this.parentNode).hide('fast'); return false; }); } function init_calendar_inline(){ $('#date1').bind('dateSelected', function(e, selectedDates){ var d = selectedDates[0]; if (d) { d = new Date(d); $('#fechaSalida').dpSetStartDate(d.addDays(1).asString()); } }); $('#date2').bind('dateSelected', function(e, selectedDates){ var d = selectedDates[0]; if (d) { d = new Date(d); $('#fechaEntrada').dpSetEndDate(d.addDays(-1).asString()); } }); $('.marco').datePicker({ inline: true }); $('#calendar1').bind('dateSelected', function(e, selectedDate, $td){ $('#fechaEntradaText').css('display', 'block'); $('#fechaEntradaText').val(selectedDate.getDayName() + ' ' + selectedDate.getDate().toString() + ' ' + selectedDate.getMonthName() + ' ' + selectedDate.getFullYear()); $('#fechaEntrada').val(selectedDate.asString()); }); $('#calendar2').bind('dateSelected', function(e, selectedDate, $td){ $('#fechaSalidaText').css('display', 'block'); $('#fechaSalidaText').val(selectedDate.getDayName() + ' ' + selectedDate.getDate().toString() + ' ' + selectedDate.getMonthName() + ' ' + selectedDate.getFullYear()); $('#fechaSalida').val(selectedDate.asString()); }); $('#linkTodosDestinos').click(function(){ $('#llistaPaisos').bgiframe().fadeIn('fast'); return false; }); } function init_buscador(){ var formPlegat = $('#formBuscPlegat'); var formDesplegat = $('#formBuscDesplegat'); formPlegat.find('div.titol a').click(function(){ formPlegat.hide(); formDesplegat.fadeIn('fast'); return false; }); formDesplegat.find('div.titol a').click(function(){ formDesplegat.hide(); formPlegat.fadeIn('fast'); return false; }); } var newHab; var newNino; function init_habitaciones(){ $("#formNoJs").remove(); $("select","div.ninos").change(function () { var objHab = this.parentNode.parentNode; var totNinos = this[this.selectedIndex].value; if (totNinos>0){ creaFormNinos(totNinos,objHab.id); } else{ $(objHab).find('div.edadNinos').hide().remove(); } }); newHab = $("#habitacion").clone(true); newNino = $("div#edadNinos").clone(true); var totHab = $("select#habitaciones option:selected").val(); creaForm(totHab); $("select#habitaciones").change(function () { var totHab = $("select#habitaciones option:selected").val(); if (totHab>0){ creaForm(totHab);} }); } /** Estas tres funciones son para ser sobrescritas para indicar el seleccionado */ function getSelectedAdulto( numeroHabitacion ) { return "0"; } function getSelectedNinos( numeroHabitacion ) { return "0"; } function getSelectedEdad( idHab, numNinos ) { return "0"; } function creaForm(totHab){ $("div.habitacion","#divHuespedes").remove(); for (i=0;i0){ creaFormNinos(totNinos,objHab.id); } else{ $(objHab).find('div.edadNinos').hide().remove(); } }); } if (totHab<2) { $('#divHuespedes').removeClass('on'); } else {$('#divHuespedes').addClass('on');} } function creaFormNinos(totN,idHab){ var divHab = $('#'+idHab); $("div.edadNinos","#habitacion").remove(); divHab.find("div.edadNinos").remove(); for (j=0;j'+arrayTitols[c]+'
'; } document.getElementById('videogran').innerHTML=html; } function mycarousel_initCallback(carousel) { var botoPause=$('#mycarousel-stop'); var botoPlay=$('#mycarousel-auto'); var fotosPetites = $('.jcarousel-control a'); fotosPetites.bind('click', function() { carousel.startAuto(0);// Disable autoscrolling fotosPetites.removeClass('on'); $(this).addClass('on'); carousel.scroll(jQuery.jcarousel.intval($(this).attr('title'))); botoPlay.removeClass('on'); botoPause.addClass('on'); return false; }); botoPlay.bind('click', function() { carousel.startAuto(2); //Enable autoscrolling 2 sec $(this).addClass('on'); botoPause.removeClass('on'); return false; }); botoPause.bind('click', function() { carousel.startAuto(0);// Disable autoscrolling $(this).addClass('on'); botoPlay.removeClass('on'); return false; }); $('#mycarousel-next') .bind('click', function() { carousel.next(); carousel.startAuto(0);// Disable autoscrolling botoPlay.removeClass('on'); botoPause.addClass('on'); return false; }) .mousedown(function(){$(this).addClass('on');}) .mouseup(function(){$(this).removeClass('on');}); $('#mycarousel-prev') .bind('click', function() { carousel.prev(); carousel.startAuto(0);// Disable autoscrolling botoPlay.removeClass('on'); botoPause.addClass('on'); return false; }) .mousedown(function(){$(this).addClass('on');}) .mouseup(function(){$(this).removeClass('on');}); // Pause autoscrolling if the user moves with the cursor over the clip. carousel.clip.hover(function() { carousel.stopAuto(); }, function() { carousel.startAuto(); }); //$('#fotografias .controls div').mouseover(function() {$(this).addClass("on");}).mouseout(function() {$(this).removeClass("on");}); } /* flash videos */ function playVideo(flashVideo){ $('#videogran').html('').flash({src: flashVideo,width: 422,height: 285},{version: 8}); return false; } function init_videos(){ var fotosPetites = $('.otrosVideos a'); fotosPetites.bind('click', function() { fotosPetites.removeClass('on'); $(this).addClass('on'); return false; }); } function init_submenuDetalle(){ var linkSubmenu = $('.linkSubmenu'); var submenu = $('#submenuDetalle'); var seccions = $('div.secVariable'); linkSubmenu.each(function(){ $(this).bind ('click',function(){ var seccio = $(this).attr('class').substring(12); var linkMenu=$(this); submenu.find('li').removeClass('on'); var seccioOn=$('#'+seccio); var pestanyaOn=$('#li'+seccio); pestanyaOn.addClass('on'); seccions.hide(); seccioOn.show(); }); }); var seccio,ancla,q;//variables que es passa com a paràmetre en la URI cadVariables = location.search.substring(1,location.search.length); arrVariables = cadVariables.split("&"); for (i=0; i

'+strMasOpciones+'

'); function init_click() { // Mostrem les opcions que calgui $('.masOpc a').click(function() { var $li = $(this).parent('li'); $('.' + $li.attr('id')).show(); $li.html($(this).text()); // Aquest és un patch per amagar els combos de país i destí if ($li.attr('id') == "divHotel") { $li.html(''+strPaisDestino+''); $li.attr('id', 'divPaisDesti'); $('.divPais').hide(); $('.divDestino').hide(); init_click(); } else if ($li.attr('id') == "divPaisDesti") { $li.html(''+strHotel+''); $li.attr('id', 'divHotel'); $('.divPais').show(); $('.divDestino').show(); $('.divHotel').hide(); init_click(); } return false; }); } init_click(); } /** * Aquesta funció amaga controla le opcions de cerca de la * caixa de cerca de les planes de reserva. * @date 5.9.08 */ function init_opciones_busqueda_reserva(strMasOpciones, strHotel, strCodigo, strCategoria, strPaisDestino) { $('.pHotel').hide(); $('.pCodiPromocional').hide(); $('.pCategoria').hide(); $('#pBusqueda .macro form .marcGran').append(''); function init_click() { // Mostrem les opcions que calgui $('.masOpc a').click(function() { var $li = $(this).parent('li'); $('.' + $li.attr('id')).show(); $li.html($(this).text()); // Aquest és un patch per amagar els combos de país i destí if ($li.attr('id') == "pHotel") { $li.html(''+strPaisDestino+''); $li.attr('id', 'pPaisDesti'); document.getElementById("c2").checked=true; document.getElementById("c1").checked=false; $('.pPais').hide(); $('.pDestino').hide(); init_click(); } else if ($li.attr('id') == "pPaisDesti") { $li.html(''+strHotel+''); $li.attr('id', 'pHotel'); document.getElementById("c1").checked=true; document.getElementById("c2").checked=false; $('.pPais').show(); $('.pDestino').show(); $('.pHotel').hide(); init_click(); } return false; }); } init_click(); } /*DAVID ORPI --> ORDENACION DE SELECTS */ function ordena(aux) { items=aux.options; /* los originales*/ opciones=new Array(); /* sera un doble array: con el texto, y con el valor*/ /*ordenaremos 'opciones', despues sobrescribiremos todas las opciones originales con 'opciones' que ya estaran ordenadas rellenamos 'opciones'*/ for(a=0;a