window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-3938643-24'); jQuery(document).ready(function() { var isOpen = false; jQuery("#miniCart").hover(function() { if (!isOpen) jQuery("#miniCartDiv").not(":animated").slideDown('500').css('display', 'block'); isOpen = true; }, function() { jQuery("#miniCartDiv").slideUp('500'); isOpen = false; }); }); /*$('#user-rating-form').on('change','[name="rating"]',function(){ $('#selected-rating').text($('[name="rating"]:checked').val()); });*/ jQuery(document).ready(function() { //setTimeout('$(".grecaptcha-badge").hide();',100); jQuery(".btnEscribir").click(function() { //$(".grecaptcha-badge").show(); var id_review = $(this).data("review"); grecaptcha.ready(function() { grecaptcha.execute("6LecO4MUAAAAACd76VNXkHVzwH6qdWnldjEg44Vz", {action: "action_name"}) .then(function(token) { $('[name="g-recaptcha-response"]').val(token); if (id_review !== undefined) { $("#id_review").val(id_review); $(".user-rating").hide(); $("#titulo").hide(); $("#titulo").val(' '); } }); }); const { value: formValues } = Swal.fire({ title: 'Escribir una reseña', html: '
', focusConfirm: false, showCancelButton: true, preConfirm: () => { if ($("#frmRating #nombre").val() == '') { Swal.showValidationMessage( 'Nombre obligatorio' ) } else { if ($("#frmRating #email").val() == '' || !isEmail($("#frmRating #email").val())) { Swal.showValidationMessage( 'Email obligatorio' ) } else { if ($("#frmRating #titulo").val() == '') { Swal.showValidationMessage( 'Título obligatorio' ) } else { if ($("#frmRating #comentario").val() == '') { Swal.showValidationMessage( 'Comentario obligatorio' ) } else { jQuery.ajax({ contentType: "application/x-www-form-urlencoded", type: "POST", url: "setajaxvars?clean=1", data: "action=setReview&" + $("#frmRating").serialize(), success: function(datos){ location.href = location.href; } }); } } } } $(".grecaptcha-badge").hide(); return [ //document.getElementById('swal-input1').value, //document.getElementById('swal-input2').value ] } }); if (formValues) { Swal.fire(JSON.stringify(formValues)) } }); }); function isEmail(email) { var regex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/; return regex.test(email); } jQuery("img").error(function() { jQuery(this).attr("title", jQuery(this).attr("src")); jQuery(this).attr("src", "https://www.factinet.com/images/no-picture.png"); jQuery(this).css({"width":"150px","opacity":"0.2"}); //jQuery(this).hide(); }); jQuery("#div_descripcion div,#div_descripcion p,#div_descripcion span,#div_descripcion a").not(".button").css( {'color' : '', 'font-size' : '', 'text-indent' : '', 'background-color' : 'transparent' } ); jQuery("#div_descripcion img").css({'max-width' : '700px'}); jQuery(document).ready(function() { jQuery(".vlightbox1:not(.noColorbox)").colorbox({ rel:'vlightbox1', maxWidth:'100%', maxHeight:'100%', slideshow:true, slideshowSpeed:600, slideshowStart: "Continuar", slideshowStop: "Parar", current: "{current} de {total}" }); jQuery('a[href$=".jpg"], a[href$=".jpeg"], a[href$=".gif"], a[href$=".png"], a[href$=".JPG"], a[href$=".JPEG"], a[href$=".GIF"], a[href$=".PNG"]').not(".noColorbox").colorbox({maxWidth:'100%',maxHeight:'100%',slideshow:true,slideshowSpeed:6000}); /*jQuery('a[href$=".jpg"], a[href$=".gif"], a[href$=".png"], a[href$=".JPG"], a[href$=".GIF"], a[href$=".PNG"]').not(".wall-item").each(function() { jQuery(this).addClass('vlightbox1'); jQuery.getScript("engine/js/vlightbox/noir/thumbscript1.js") jQuery.getScript("engine/js/vlightbox/noir/vlbdata1.js") });*/ jQuery("a[href^='http']") .not("[href*='"+location.host+"']") .attr('target','_blank'); }); jQuery(document).ready(function() { jQuery('#shareme, .shareme').sharrre({ share: { facebook: true, twitter: true, googlePlus: false, pinterest: false }, buttons: { googlePlus : { url: 'http://sabarraca.com/libro-de-visitas?lng=de', size: 'medium', lang: 'es-ES', annotation: '' }, facebook: { url: 'http://sabarraca.com/libro-de-visitas?lng=de', action: 'like', layout: 'button_count', width: '', send: 'false', faces: 'false', colorscheme: '', font: '', lang: 'es_ES' }, twitter: { url: 'http://sabarraca.com/libro-de-visitas?lng=de', count: 'horizontal', via: ' pasada a gratuita en 2020-02-02 20:16:03 pasada a gratuita en 2021-02-10 22:51:01 pasada a gratuita en 2022-02-10 12:41:02 pasada a gratuita en @ruralgia', hashtags: 'turismorural', related: '', lang: 'es' }, pinterest: { url: 'http://sabarraca.com/libro-de-visitas?lng=de', media: '/uploads/grupos/e8463ca939544aa6811266eb59686971_entrada_nueva.jpg', description: 'Pequeño hostal económico de carácter familiar y trato agradable situado en la colina, a solo 3 minutos del mar. Todas las habitaciones tienen baño y terraza privados, con una maravillosa vista al mar, Parking privado y gratuito. Servicio de habitación y desayuno. Abierto todo el año.', layout: 'horizontal' } }, enableHover: false, enableCounter: false, enableTracking: true }); $('a[href*="#"]:not([href="#"])').click(function(event) { if (typeof($($.attr(this, 'href')).offset()) != 'undefined') { event.preventDefault(); $('html, body').animate({ scrollTop: $($.attr(this, 'href')).offset().top - ($(".capaFija").is(":visible") * -100) - 100 }, 500); } }); }); jQuery(document).ready(function() { jQuery("#jpMute, .sliderVolume").mouseover(function() { jQuery(".sliderVolume").css("display","block"); }); jQuery("#jpMute, .sliderVolume").mouseout(function() { jQuery(".sliderVolume").css("display","none"); }); jQuery("[data-slider]") .bind("slider:ready slider:changed", function (event, data) { jQuery("#jpId").jPlayer( "volume", data.value.toFixed(3)); }); jQuery("#jpId").jPlayer( { loop: true, ready: function () { jQuery(this).jPlayer("setMedia", { mp3: "/uploads/musica/sabarraca.mp3?v=2.8d" // Defines the mp3 url }).jPlayer("play",0); if (jQuery("#jpMute").attr("rel") == 'off' || 0) { jQuery(this).jPlayer("mute",true); jQuery("#jpMute").attr("rel","off"); jQuery("#jpMute").attr("src","https://www.ruralgia.com//images/icons/sound_off.png"); } } }); //console.log("time: 0"); jQuery("#jpId").jPlayer( "volume", 0.2); jQuery("#jpMute").click(function() { if (jQuery("#jpMute").attr("rel") == 'on') { jQuery("#jpMute").attr("src","https://www.ruralgia.com//images/icons/sound_off.png"); jQuery("#jpId").jPlayer("mute",true); jQuery("#jpMute").attr("rel",'off'); setCookie('jpMute','1'); } else { jQuery("#jpMute").attr("src","https://www.ruralgia.com//images/icons/sound_on.png"); jQuery("#jpId").jPlayer( "unmute",true); jQuery("#jpMute").attr("rel",'on'); setCookie('jpMute','0'); } }); jQuery(window).bind('beforeunload', function(){ //window.onbeforeunload = function(e) { var currentTime = jQuery("#jpId").data("jPlayer").status.currentTime; //console.log(currentTime) setCookie('jpCurrentTime',currentTime); }); });