(function($){ "use strict"; var rtime = new Date('1', '1', '2000', '12', '0', '0'); var timeout = false; var delta = 200; $(window).resize(function () { rtime = new Date(); if (timeout === false) { timeout = true; setTimeout(resizeEnd, delta); } }); function resizeEnd() { if (new Date() - rtime < delta) { setTimeout(resizeEnd, delta); } else { timeout = false; sailor.rebind_menu_events(); } } function trigger_click(){ }; var sailor = { rebind_menu_events: function() { $('.advanced-search').hide(); $('.search-trigger').off('click'); $('.search-trigger').on('click', function () { $('.advanced-search').slideToggle(500); }); }, init: function () { //SEARCH FILTER $('.filter-show').hide(500); $('.filter-hide').on('click', function () { $('aside.fixed').slideUp(500); $('.filter-show').show(500); $('.offset').css('margin-top','0'); }); $('.filter-show').on('click', function () { $('aside.fixed').slideDown(500); $('.filter-show').hide(500); $('.offset').css('margin-top','197px'); }); //ADVANCED SEARCH $('.advanced-search').hide(); $('.search-trigger').off('click'); $('.search-trigger').on('click', function () { $('.advanced-search').slideToggle(500); }); $('.search-hide').on('click', function () { $('.advanced-search').hide(500); }); //$('#startDate').datepicker({dateFormat: 'dd-mm-yy', minDate: 1}); $('.startDate').datepicker({dateFormat: 'dd-mm-yy', minDate: 1}); $('.startDate2').datepicker({dateFormat: 'dd-mm-yy', minDate: 1}); $('.startDate3').datepicker({dateFormat: 'dd-mm-yy'}); $.datepicker.regional['es'] = { closeText: "Cerrar", prevText: "<Ant", nextText: "Sig>", currentText: "Hoy", monthNames: [ "enero","febrero","marzo","abril","mayo","junio", "julio","agosto","septiembre","octubre","noviembre","diciembre" ], monthNamesShort: [ "ene","feb","mar","abr","may","jun", "jul","ago","sep","oct","nov","dic" ], dayNames: [ "domingo","lunes","martes","miércoles","jueves","viernes","sábado" ], dayNamesShort: [ "dom","lun","mar","mié","jue","vie","sáb" ], dayNamesMin: [ "D","L","M","X","J","V","S" ], weekHeader: "Sm", //dateFormat: "dd/mm/yy", firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: "" }; $.datepicker.setDefaults($.datepicker.regional['es']); $('#birthDate').datepicker({ changeMonth: true, changeYear: true, yearRange: '1920:2000', minDate: new Date(1920, 1 - 1, 25), maxDate: '+80Y' }); // CUSTOM FORM ELEMENTS $('input[type=radio], input[type=checkbox],input[type=number],select').uniform(); // ACCORDION $('.accordion dd').hide(); $('.accordion dt').on('click', function () { $(this).next('.accordion dd').slideToggle(500); $(this).toggleClass('expanded'); }); $('.accordion .next-step').on('click', function (e) { $(this).closest('.accordion dd').next('.accordion dt').next('.accordion dd').slideToggle(500); $(this).closest('.accordion dd').next('.accordion dt').toggleClass('expanded'); e.preventDefault(); }); $('.bookingSteps .thank-you-note').hide(); $('.accordion .submit-step').on('click', function (e) { $(this).closest('.accordion').slideToggle(500); $('.bookingSteps .thank-you-note').slideToggle(500); $('html, body').animate({ scrollTop: parseInt($("#tab-navigation").position().top, 10) }, 1000); e.preventDefault(); }); // BOOKING STEPS $('.booking').hide(); $('.selectDates').show(500); $('.availability .button').on('click', function () { //$('.availability').hide(); $('.selectDates').show(500); }); $('.selectDates .button').on('click', function () { $('.selectDates').hide(); $('.bookingSteps').show(500); }); // CONTACT FORM $('#contactform').submit(function(){ var action = $(this).attr('action'); $("#message").show(500,function() { $('#message').hide(); $('#submit') .after('') .attr('disabled','disabled'); $.post(action, { name: $('#name').val(), email: $('#email').val(), phone: $('#phone').val(), comments: $('#comments').val() }, function(data){ document.getElementById('message').innerHTML = data; $('#message').slideDown('slow'); $('#contactform img.loader').fadeOut('slow',function(){$(this).remove()}); $('#submit').removeAttr('disabled'); }); }); return false; }); // TABS $('.content .tab-content').hide().first().show(); $('.content .tabs li:first').addClass('current'); //$('.content .tab-content').hide(); //$(".content .tab-content:nth-child(2)").show(); //$(".content .tab-content li:nth-child(2)").addClass('current'); $('.content .tabs a').on('click', function (e) { e.preventDefault(); $(this).closest('li').addClass('current').siblings().removeClass('current'); $($(this).attr('href')).show().siblings('.tab-content').hide(); }); var hash = $.trim( window.location.hash ); if (hash) $('.content .tabs a[href$="'+hash+'"]').trigger('click'); // SMOOTH ANCHOR SCROLLING var $root = $('html, body'); $('.intro .button, .anchor').on('click', function(e) { var href = $.attr(this, 'href'); if (typeof ($(href)) != 'undefined' && $(href).length > 0) { var anchor = ''; if(href.indexOf("#") != -1) { anchor = href.substring(href.lastIndexOf("#")); } var scrollToPosition = $(anchor).offset().top - 80; if (anchor.length > 0) { $root.animate({ scrollTop: scrollToPosition }, 500, function () { window.location.hash = anchor; // This hash change will jump the page to the top of the div with the same id // so we need to force the page to back to the end of the animation $('html').animate({ 'scrollTop': scrollToPosition }, 0); }); e.preventDefault(); } } }); //MAIN MENU $().jetmenu(); }, load: function () { // UNIFY HEIGHT var maxHeight = 0; $('.heightfix').each(function(){ if ($(this).height() > maxHeight) { maxHeight = $(this).height(); } }); $('.heightfix').height(maxHeight); // PRELOADER $('.preloader').fadeOut(); } } $(document).ready(function () { sailor.init(); var $root = $('html, body'); if (window.location.hash && window.location.hash == '#tab-navigation') { var scrollToPosition = $('#tab-navigation').offset().top - 80; $root.animate({ scrollTop: scrollToPosition }, 500, function () { window.location.hash = 'tab-navigation'; // This hash change will jump the page to the top of the div with the same id // so we need to force the page to back to the end of the animation $('html').animate({ 'scrollTop': scrollToPosition }, 0); }); } }); $(window).on('load', function() { sailor.load(); }); //console.log("dia:"); function checkDia(id,fecha,noches,pasajeros){ alert(id,fecha,noches,pasajeros); } })(jQuery); $(document).ready(function () { //var dia = ''; //console.log("dia:"+dia); //$('#datepickerr').datepicker({ defaultDate: '10-11-2019' }); $('.accordion dt:first-of-type').addClass('expanded'); $('.accordion dd:first-of-type').show(); $("#gallery").lightGallery({ download:false }); }); var hemail=0,hpass=0; function acceder(){ var error=0; hemail= $("#username").val(); hpass = $("#userpass").val(); if(!hemail){ error=1; alert("Debe introducir un email"); //$("#modal-textouser").html("

Debe introducir un email

"); //$("#modaluser").modal('open'); return; } if(!hpass){ error=1; alert("Debe introducir una contraseña"); //$("#modal-textouser").html("

Debe introducir una contraseña

"); //$("#modaluser").modal('open'); return; } if(!error){ $.post('AjaxLogin.php', {hemail:hemail, hpass:hpass}, function (data) { var ok = data.indexOf("--ok--"); if(ok>0){ document.login.submit(); }else{ alert("Login incorrecto"); //$("#modal-textouser").html("

Login incorrecto

"); //$("#modaluser").modal('open'); return; } }); } }