//toggle visibility function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],weekdaysFull:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],weekdaysShort:["dom","lun","mar","mer","gio","ven","sab"],today:"oggi",clear:"cancella",firstDay:1,format:"dddd d mmmm yyyy",formatSubmit:"yyyy/mm/dd"}); //jQuery $(document).ready(function(){ //Custom Form if ($("#cform").length > 0) { $("input, textarea, select, button").uniform(); } //Comune click if ($(".fooleft").length > 0) { $(".fooleft").click(function(){ window.location=$(this).find("a").attr("href"); return false; }); } //toggle input value swapValue = []; $(".itxt").each(function(i){ swapValue[i] = $(this).val(); $(this).focus(function(){ if ($(this).val() == swapValue[i]) { $(this).val(""); } $(this).addClass("focus"); }).blur(function(){ if ($.trim($(this).val()) == "") { $(this).val(swapValue[i]); $(this).removeClass("focus"); } }); }); //Fadeimg $(".pimg").fadeTo("slow", 1.0); $(".pimg").hover( function(){ $(this).fadeTo("fast", 0.7); }, function(){ $(this).fadeTo("fast", 1.0); }); //Menu funcs if ($("#menu").length > 0) { $("#menu li").mouseover( function(){ $(this).addClass("active"); $(this).find("div:first").fadeIn('fast'); }); $("#menu li").mouseleave( function(){ $(this).removeClass("active"); $(this).find("div:first").fadeOut('fast'); }); $("#menu li div span").hover( function(){ $(this).css({"color":"#000", "cursor":"pointer"}); }, function(){ $(this).css({"color":"#fff"}); }); $("#menu li div span").click( function(){ window.location=$(this).find("a:first").attr("href"); return false; }); $(".selects").mouseover( function(){ $("#selsite").fadeIn('fast'); }); $("#selsite").mouseover( function(){ $("#selsite").show(); }); $("#selsite").mouseleave( function(){ $("#selsite").fadeOut('fast'); }); } //Notice if ($(".notice").length > 0) { $('.notice').fadeIn().delay(4000).fadeOut('slow'); } //Mail if ($(".mailaddr").length > 0) { $('.mailaddr').append('info' + '@' + 'parkingtour.it'); } //Toggle elements onload if ($("h1").length > 0) { $("h1").fadeIn(); } if ($("h2").length > 0) { $("h2").fadeIn(); } if ($("h3").length > 0) { $("h3").fadeIn(); } if ($("#ltop").length > 0) { $("#ltopl").fadeIn(); $("#ltopr").fadeIn(); } if ($("#menu").length > 0) { $("#menu").fadeIn(); } if ($("#footer").length > 0) { $("#footer").delay(1000).fadeIn(); } //Clickable div if ($(".dclick").length > 0) { $(".dclick").fadeTo("slow", 1.0); $(".dclick").hover( function(){ $(this).fadeTo("fast", 0.65); }, function(){ $(this).fadeTo("fast", 1.0); }); $(".dclick").click(function(){ window.location=$(this).find("a").attr("href"); return false; }); } //Validate Contact Form if( $("#contact_form").length > 0) { $("#contact_form").click(function() { if ($("#nome").val() == "") { $(".lnome").addClass('error_red'); $("#nome").focus(); return false; } else { $(".lnome").removeClass('error_red'); } if ($("#cognome").val() == "") { $(".lcognome").addClass('error_red'); $("#cognome").focus(); return false; } else { $(".lcognome").removeClass('error_red'); } if ($("#email").val() == "") { $(".lemail").addClass('error_red'); $("#email").focus(); return false; } else { $(".lemail").removeClass('error_red'); } if ($("#telefono").val() == "") { $(".ltel").addClass('error_red'); $("#telefono").focus(); return false; } else { $(".ltel").removeClass('error_red'); } if ($("#mess").val() == "") { $(".lmess").addClass('error_red'); $("#mess").focus(); return false; } else { $(".lmess").removeClass('error_red'); } //if ($("#scode").val() == "") { $(".lscode").addClass('error_red'); $("#scode").focus(); return false; } else { $(".lscode").removeClass('error_red'); } document.contact_form.submit(); }); } //Slider if( $(".bxslider").length > 0) { $('.bxslider').bxSlider({ auto: true, controls: false, preloadImages: 'all' }); } //DatePicker if( $(".datepicker").length > 0) { $('.datepicker').pickadate({ format: 'dd/mm/yyyy' }); } //Validation if( $("#prenota").length > 0) { $("#prenota").click(function() { $(".form-control").css("border","1px solid #ccc"); if ( ($("#datedacr").val() == '') || ($("#datedacr").val() == 'gg/mm/aaaa') ) { swal({ title: "Ops!", text: "Seleziona una data di ingresso nelle aree parcheggio", confirmButtonColor: "#ed193a" }); $("#datedacr").css("border","1px solid #ed193a"); return false; } if ( ($("#dateacr").val() == '') || ($("#dateacr").val() == 'gg/mm/aaaa') ) { swal({ title: "Ops!", text: "Seleziona una data di uscita dalle aree parcheggio", confirmButtonColor: "#ed193a" }); $("#dateacr").css("border","1px solid #ed193a"); return false; } if ($("#navecr").val() == '0') { swal({ title: "Ops!", text: "Seleziona una nave", confirmButtonColor: "#ed193a" }); $("#navecr").css("border","1px solid #ed193a"); return false; } if ($("#tipocr").val() == '0') { swal({ title: "Ops!", text: "Seleziona una tipologia di parcheggio", confirmButtonColor: "#ed193a" }); $("#tipocr").css("border","1px solid #ed193a"); return false; } if ($("#namecr").val() == '') { swal({ title: "Ops!", text: "Inserisci il tuo nome", confirmButtonColor: "#ed193a" }); $("#namecr").css("border","1px solid #ed193a"); return false; } if ($("#lastnamecr").val() == '') { swal({ title: "Ops!", text: "Inserisci il tuo cognome", confirmButtonColor: "#ed193a" }); $("#lastnamecr").css("border","1px solid #ed193a"); return false; } if ($("#emailcr").val() == '') { swal({ title: "Ops!", text: "Inserisci il tuo indirizzo email", confirmButtonColor: "#ed193a" }); $("#emailcr").css("border","1px solid #ed193a"); return false; } if ($("#telcr").val() == '') { swal({ title: "Ops!", text: "Inserisci un recapito telefonico", confirmButtonColor: "#ed193a" }); $("#telcr").css("border","1px solid #ed193a"); return false; } if ($("#modellocr").val() == '') { swal({ title: "Ops!", text: "Inserisci marca/modello della tua vettura", confirmButtonColor: "#ed193a" }); $("#modellocr").css("border","1px solid #ed193a"); return false; } if ($("#targacr").val() == '') { swal({ title: "Ops!", text: "Inserisci il numero di targa della tua vettura", confirmButtonColor: "#ed193a" }); $("#targacr").css("border","1px solid #ed193a"); return false; } if (!$("#privacy").is(":checked")) { swal({ title: "Ops!", text: "Devi accettare la nostra politica sulla Privacy", confirmButtonColor: "#ed193a" }); return false; } swal({ title: "", text: "Vuoi confermare la tua prenotazione?", showCancelButton: true, confirmButtonColor: "#47a447", confirmButtonText: "Conferma", cancelButtonText: "Annulla", closeOnConfirm: false, closeOnCancel: true }, function(isConfirm) { if (isConfirm){ document.prenotazione.submit() } }) }); } if( $("#send").length > 0) { $("#send").click(function() { $(".form-control").css("border","1px solid #ccc"); if ($("#nome").val() == '') { swal({ title: "Ops!", text: "Inserisci il tuo nome", confirmButtonColor: "#ed193a" }); $("#nome").css("border","1px solid #ed193a"); return false; } if ($("#cognome").val() == '') { swal({ title: "Ops!", text: "Inserisci il tuo cognome", confirmButtonColor: "#ed193a" }); $("#cognome").css("border","1px solid #ed193a"); return false; } if ($("#mail").val() == '') { swal({ title: "Ops!", text: "Inserisci il tuo indirizzo email", confirmButtonColor: "#ed193a" }); $("#mail").css("border","1px solid #ed193a"); return false; } if ($("#mess").val() == '') { swal({ title: "Ops!", text: "Inserisci il tuo messaggio", confirmButtonColor: "#ed193a" }); $("#mess").css("border","1px solid #ed193a"); return false; } document.cnt.submit(); }); } /**/ //Cookies function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } function delCookie(cname) { var expires = "expires=Thu, 01 Jan 1970 00:00:00 UTC"; document.cookie = cname + "=;" + expires + ";path=/"; } function loadServices() { //Services } //Check var ck = getCookie("cookie_accepted"); if (ck == "") { //Show Cookie Box $("#cookie_cnt").html('

Questo sito utilizza i cookie.
Utilizziamo i cookie per personalizzare contenuti ed annunci, per fornire funzionalità dei social media e per analizzare il nostro traffico. Condividiamo inoltre informazioni sul modo in cui utilizza il nostro sito con i nostri partner che si occupano di analisi dei dati web, pubblicità e social media, i quali potrebbero combinarle con altre informazioni che ha fornito loro o che hanno raccolto dal suo utilizzo dei loro servizi. Per saperne di più accedi alla Cookie Policy e alla Privacy Policy.

'); $("#cookie_btn").html('Rifiuta Accetta'); $("#cookies").show(); $(".cookie-accetta").on("click", function() { setCookie("cookie_accepted", "yes", 180); $("#cookies").hide(); loadServices(); }); $(".cookie-rifiuta").on("click", function() { setCookie("cookie_accepted", "no", 180); $("#cookies").hide(); }); } else { //Load Services' Script //delCookie("cookie_accepted"); loadServices(); } /**/ // });