(function($){ $.fn.disableSelection = function() { return this .attr('unselectable', 'on') .css('user-select', 'none') .on('selectstart', false); }; })(jQuery); /** ################################################################################################################################################# PANAVISION ################################################################################################################################################# **/ var selHotelPanavision = ''; var selVueloPanavision = ''; var selFlujoPanavision = -1; $(function() { /* Aviso-Legal */ $('#aviso-legal, .tandctext').each(function() { var $link = $(this); var $dialog = $('
') .load( $link.attr('href') + ' #content' ) .dialog({ autoOpen: false, title: $link.attr('title'), width: 600, height: 400, modal: true, hide: 'fold', show: 'blind' }); $link.click(function() { $dialog.dialog('open'); return false; }); }); }); function imgErr(image) { image.onerror = null; image.src = "/integra/images/sinimagen.png"; return true; } function modocupa(){ if ( parseInt($('#f_nadultos').val()) + parseInt($('#f_nninos').val()) == 1 ) { $('#f_nindividuales').val('1'); $('#f_ndobles').val('0'); $('#f_ntriples').val('0'); } } function getDisponibilidad(idcircuito,idfolleto,idzona,fsalida) { if ( $("#f_origen").val()=="" ) { alert("Selecciona un aeropuerto de origen"); $('#f_origen').focus(); return false; } if ( parseInt($('#f_nindividuales').val()) + parseInt($('#f_ndobles').val()*2) + parseInt($('#f_ntriples').val()*3) != parseInt($('#f_nadultos').val()) + parseInt($('#f_nninos').val()) ) { alert("Revisa la distribuci�n de los pasajeros y el tipo de habitaciones (no coinciden)"); $('#f_origen').focus(); return false; } $( "#formulariohoteles" ).hide('slow'); $( "#botonsiguiente" ).hide('slow'); $( "#disponibleloader" ).show('slow'); $.ajax({ type: "POST", url: "/integra/panavision_consulta_disponible.asp", data: { origen: $('#f_origen').val(), destino: idzona, idcircuito: idcircuito, idfolleto: idfolleto, fecha_salida: fsalida, n_adultos: $('#f_nadultos').val(), n_ninos: $('#f_nninos').val(), n_ind: $('#f_nindividuales').val(), n_dbl: $('#f_ndobles').val(), n_tpl: $('#f_ntriples').val() }, success: function(data) { selFlujoPanavision=0; $('#circuito_origen').val( $('#f_origen option:selected').text() ); $('#circuito_origen_cod').val( $("#f_origen").val() ); $('#circuito_adultos').val( $("#f_nadultos").val() ); $('#circuito_ninos').val( $("#f_nninos").val() ); $('#circuito_individuales').val( $("#f_nindividuales").val() ); $('#circuito_dobles').val( $("#f_ndobles").val() ); $('#circuito_triples').val( $("#f_ntriples").val() ); $( "#resultado" ).empty().append( data ); $( "#formulariohoteles" ).show('slow'); $('html, body').animate({ scrollTop: $('#formulariohoteles').offset().top - 60 }, 2000); $( "#disponibleloader" ).hide('slow'); if (data.indexOf("sindisponibilidad")>=0) { $( "#botonnuevabusqueda" ).show('slow'); } else { $('#circuito_resultxml').val( $("#resultadoXML").val() ); }; }, error: function (xhr, ajaxOptions, thrownError) { alert('Ha ocurrido un error,\nVuelva a intentarlo de nuevo'); $( "#disponibleloader" ).hide('slow'); $( "#botonsiguiente" ).show('slow'); } }); } function setHotel(hotel,idopcion,fsalida,txt) { if (hotel != selHotelPanavision && selFlujoPanavision==0) { $( ".deschoteles" ).hide('slow'); $( ".hotelesselect" ).attr("class", "hoteles"); $( "#deschotel"+hotel ).show('slow'); $( "#hotel"+hotel ).attr("class", "hotelesselect"); $( "#circuito_opcion_txt").val(txt); $( "#circuito_opcion").val(idopcion); $( "#circuito_opcion_precio").val( $("#precio_total_" + idopcion).attr( "data" ) ); $( "#botonsiguiente2" ).show('slow'); selHotelPanavision = hotel ; selFlujoPanavision = 0; } } function setVuelo(vuelo,idopcion) { if ( vuelo != selVueloPanavision && selFlujoPanavision==1 ) { $( ".vuelosselect" ).attr("class", "vuelos"); $( "#vuelo"+vuelo ).attr("class", "vuelosselect"); $( "#circuito_vuelos_opcion").val(idopcion); $( "#botonsiguiente3" ).show('slow'); selVueloPanavision = vuelo ; selFlujoPanavision = 1; } } function goViaje() { $('#formulariodatos').show('slow'); $('html, body').animate({ scrollTop: $('#formulariodatos').offset().top - 60 }, 2000); setTimeout(function() { $('#f_origen').tooltipster('update', 'Selecciona un aeropuerto de salida'); $('#f_origen').tooltipster('show'); setTimeout(function() { $('#f_origen').tooltipster('hide'); $('#f_origen').tooltipster('disable'); }, 3000); }, 2000); return false; } function goVuelos() { if (selHotelPanavision == "") { alert("Selecciona una de las opciones de alojamiento disponibles"); return false; } $('.hoteles').each(function() { if( this.id != 'hotel'+ selHotelPanavision ) $(this).hide('slow'); }); $( "#botonsiguiente2" ).hide('slow'); if ($('#f_origen').val()=='NVL' || $('#f_origen').val()=='SVO') { goContacto(); return false; } var n_pax = eval ( parseInt($('#circuito_adultos').val()) + parseInt($('#circuito_ninos').val()) ) $( "#disponibleloader_vuelos" ).show('slow'); $.ajax({ type: "POST", url: "/integra/panavision_consulta_disponible_vuelos.asp", data: { idcircuito: $('#circuito_idcircuito').val(), idfolleto: $('#circuito_idfolleto').val(), fecha: $('#circuito_fecha_salida').val(), origen: $('#circuito_origen_cod').val(), precio: $("#circuito_opcion_precio" ).val(), n_pax: n_pax }, success: function(data) { selFlujoPanavision = 1; $( "#resultadovuelos" ).empty().append( data ); $( "#formulariovuelos" ).show('slow'); $('html, body').animate({ scrollTop: $('#formulariovuelos').offset().top - 60 }, 2000); $( "#disponibleloader_vuelos" ).hide('slow'); if (data.indexOf("sindisponibilidad")>=0) { $( "#botonnuevabusqueda2" ).show('slow'); } else { $('#circuito_resultxmlvuelos').val( $("#resultadoXMLvuelos").val() ); }; }, error: function (xhr, ajaxOptions, thrownError) { alert('Ha ocurrido un error,\nVuelva a intentarlo de nuevo'); $( "#disponibleloader_vuelos" ).hide('slow'); $( "#botonsiguiente2" ).show('slow'); } }); } function goContacto() { if (!($('#f_origen').val()=='NVL' || $('#f_origen').val()=='SVO')) { if (selVueloPanavision == "") { alert("Selecciona una de las opciones de vuelos disponibles"); return false; } $('.vuelosselect').each(function() { if( this.id != 'vuelo'+ selVueloPanavision ) $(this).hide('slow'); }); } $('#botonsiguiente3').hide('slow'); $('#formulariocontacto').show('slow'); $('html, body').animate({ scrollTop: $('#formulariocontacto').offset().top - 30 }, 2000); nadultos = $('#f_nadultos').val(); nninos = $('#f_nninos').val(); for (i = 0; i <= 8; i++) { if (i<=nadultos) { $('#bloqueadulto' + i).show() } else { $('#bloqueadulto' + i).hide()}; } for (i = 0; i <= 4; i++) { if (i<=nninos){ $('#bloquenino' + i).show() } else { $('#bloquenino' + i).hide()}; } return false; } function valinput(obj,len) { if ( obj.val().length < len ) { obj.animate({ backgroundColor: "#fff3f3" }, "slow"); return false; }else{ obj.animate({ backgroundColor: "white" }, "slow"); return true; } } function validate_formcontacto(){ var valida=true; if (!(valinput($('#contacto_nombre'),1))) valida=false ; if (!(valinput($('#contacto_apellidos'),1))) valida=false; if (!(valinput($('#contacto_telefono'),5))) valida=false; if (!(valinput($('#contacto_email'),5))) valida=false; if ( $('#tpv_valida').val()=='true' ) { if (!(valinput($('#tpv_cardholder'),3))) valida=false; if (!(valinput($('#tpv_cardnumber'),16))) valida=false; if (!(valinput($('#tpv_cvv'),3))) valida=false; } if (valida==false) { alert('Debe introducir todos los campos marcados como requeridos'); return false; }; if ( $('#contacto_avisolegal').is(':checked')==false ) { alert('Debe marcar la casilla de Aceptacion de condiciones de contrataci�n') return false; }; formcontacto.submit() } function masinfotabs(liobj,obj,id) { $("ul.tabrow[id='tab" + id + "'] li").removeClass("selected"); $(liobj).addClass("selected"); var o_actual = 'mi_' + obj + '_' + id; var o_old = 'mi_' + $("#mi_o_" + id).val() + '_' + id; $("#" + o_old).hide(); $("#" + o_actual).show(); $("#mi_o_" + id).val(obj); } function moveObjOver(obj1,obj2,x,y) { obj1.innerHTML = ''; obj1.style.left = (obj2.left + x).toString() + 'px'; obj1.style.top = (obj2.top + y).toString() + 'px'; } function shwcalendar(obj, diasprecios, syear, smonth, idregistro, integracion , amoneda, dmoneda) { c = document.getElementById('calendario'); if (tmrCalendar!=null) {clearTimeout(tmrCalendar);}; moveObjOver(c, $(obj).position(),0,26); $( "#calendario" ).prepend( "
" ); $('#calendario').eventCalendar({ amoneda: amoneda, dmoneda: dmoneda,precios: diasprecios , year: syear, month:smonth, IDregistro: idregistro, Integracion: integracion }); $('#calendario').show(); } /** ################################################################################################################################################# CRUCEROS ################################################################################################################################################# **/ /** ################################################################################################################################################# SOLTOUR ################################################################################################################################################# **/ /* * jQuery UI Autocomplete HTML Extension * * Copyright 2010, Scott Gonz�lez (http://scottgonzalez.com) * Dual licensed under the MIT or GPL Version 2 licenses. * * http://github.com/scottgonzalez/jquery-ui-extensions */ (function( $ ) { var proto = $.ui.autocomplete.prototype, initSource = proto._initSource; function filter( array, term ) { var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" ); return $.grep( array, function(value) { return matcher.test( $( "
" ).html( value.label || value.value || value ).text() ); }); } $.extend( proto, { _initSource: function() { if ( this.options.html && $.isArray(this.options.source) ) { this.source = function( request, response ) { response( filter( this.options.source, request.term ) ); }; } else { initSource.call( this ); } }, _renderItem: function( ul, item) { return $( "
  • " ) .data( "item.autocomplete", item ) .append( $( "" )[ this.options.html ? "html" : "text" ]( item.label ) ) .appendTo( ul ); } }); })( jQuery );