function Popup(n){originOpen(n,"","top=10, left=10, width=860, height=550, status=no, menubar=no, toolbar=no, scrollbars=yes")}function ShowErrorBox(n,t,i){$form=i==null?$("#formContatto"):$(i);var r=$form.find(".message-box.error").not(".success");$form.find(".message-box.error .textError").html(n);r.removeClass("hidden");t&&$("html,body").animate({scrollTop:$form.offset().top},1e3)}function ShowSuccessBox(n,t,i){$form=i==null?$("#formContatto"):$(i);var r=$form.find(".message-box.success");$form.find(".message-box.success .textError").html(n);r.removeClass("hidden");t&&$("html,body").animate({scrollTop:$form.offset().top-1e3},1e3)}function HideErrorBox(n){$form=n==null?$("#formContatto"):$(n);var t=$form.find(".error-block").not(".success");t.addClass("hidden")}function HideSuccessBox(n){$form=n==null?$("#formContatto"):$(n);var t=$form.find(".error-block.success");t.addClass("hidden")}function AlertCampiObbligatori(){ErrorAlert($("#tipo3").data("content"))}function AlertValidazioneEmail(){ErrorAlert($("#tipo4").data("content"))}function AlertPrivacy(){ErrorAlert($("#tipo5").data("content"))}function GetLabelForElement(n){var t=$('label[for="'+n.attr("id")+'"]'),i,r;return t.length<=0&&(i=n.parent(),r=i.get(0).tagName.toLowerCase(),r=="label"&&(t=i)),t}function ApplicaError(n){n.addClass("errorF");n.hasClass("jcf-hidden")&&n.next(".jcf-select").addClass("errorF");var t=GetLabelForElement(n);t.addClass("errorL")}function PulisciError(n){n.removeClass("errorF");n.hasClass("jcf-hidden")&&n.next(".jcf-select").removeClass("errorF");var t=GetLabelForElement(n);t.removeClass("errorL")}function validateEmail(n){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)}function MenuRespIsClosed(){return!$(".menuResponsive").hasClass("active")}function apriMenuResp(){$(".menuResponsive").addClass("active");$("#oscura").addClass("active");$("body").addClass("blocca")}function chiudiMenuResp(){$(".menuResponsive").removeClass("active");$("#oscura").removeClass("active");$("body").removeClass("blocca")}$(".message-box .btn-close").click(function(){$(this).parents(".message-box").addClass("hidden")});var ErrorAlert=function(n){$.fn.jAlert({title:"errore",message:n,theme:"error"})},ConfirmAlert=function(n){var t=$("#tipoTitoloSuccess").data("content");$.fn.jAlert({title:t,message:n,theme:"success"})};$(function(){var e=$("#tipo10").data("content"),n,t,i,r,u,f;e!=""&&ConfirmAlert(e);n=$("#tipo13").data("content");n!=""&&ConfirmAlert(n);t=$("#tipo6").data("content");t!=""&&ShowErrorBox(t);i=$("#tipo7").data("content");i!=""&&ShowSuccessBox(i,!0);r=$("#tipo8").data("content");r!=""&&ConfirmAlert(r);u=$("#tipo11").data("content");u!=""&&ErrorAlert(u,!0,$("#CommentForm"));f=$("#tipo12").data("content");f!=""&&ConfirmAlert(f,!0,$("#CommentForm"))});$(document).on("submit",".validateSubmit",function(n){var i=0,t=!1,r=$(this),u=r.find("input, select, textarea").filter(".obbl");return(u.each(function(){$(this).val()==""&&(i=1,ApplicaError($(this)),t||(AlertCampiObbligatori(),t=!0));$(this).hasClass("validateEmail")&&!validateEmail($(this).val())&&(i=1,t||(AlertValidazioneEmail(),t=!0));t||!$(this).hasClass("validatePrivacy")||$(this).is(":checked")||(i=1,AlertPrivacy(),t=!0)}),i==1)?(n.preventDefault(),!1):!0});$(document).on("focus change",".errorF",function(){PulisciError($(this))});$(document).ready(function(){$(".video-block .btn-play").click(function(n){var t,i;n.preventDefault();$(this).hide();t=$(this).data("src");t.indexOf("?")<0&&(t+="?");t+="&autoplay=1";i=$("