/*
 * @preserve
 * Filename: functions.lib.js
 *
 * Created: 06/10/2016 (09:58:58)
 * Created by: Lorenzo Saibal Forti <lorenzo.forti@gmail.com>
 *
 * Last update: 06/10/2016 (09:58:58)
 * Updated by: Lorenzo Saibal Forti <lorenzo.forti@gmail.com>
 *
 * Copyleft: 2020 - Tutti i diritti riservati
 *
 * Comments: questo file contiene, in maggioranza, le funzioni di gestione layout del template generico. vengono incluse anche alcune funzioni generiche utili a tutti i siti (ad esempio funzioni di log o popup)
 */
"use strict";var defParams={"layoutMenuVersion":"v","isMultiLanguage":"y","showBackTop":"y","closeMenuOnclick":"y","validateFormByClass":"n","dropdownAnimation":"y","amountScrolled":500,"eBackTop":"#back-to-top","eMainContainer":"#main-container","eMainPageContent":"#main-page-content","eHeader":"#header","eFooter":"#footer","eOverLay":"#overlay","eNavMobile":"#nav-mobile","eMenuH":"#menu-h","eMenuContainerH":"#main-menu-container-h","eFixedHead":"#fixed-bar","eFixedBarWrapper":"#fixed-bar-wrapper","eTopNavWrapper":"#top-nav-wrapper","eHeaderWrapper":"#header-wrapper","eSidebarContainer":"#sidebar-container","eSidebarMenu":"#sidebar-menu","eSidebar":"#sidebar","eJsTableSaw":"#js-table-saw","eUploadTitle":"#uploaded-title","eLoader":"#loader","eWinBackCont":"#winback","eJsActionConfirm":".js-action-confirm","eJsDisableAction":".js-disable-action","eSidebarMenuClass":".side-menu","eTableSaw":".tablesaw","eDateIt":".dateit","eRemoveOnSubmit":".js-remove-onsubmit","eJsSubmitOutForm":".js-submit-out-form","eSortableBtn":".tablesaw-sortable-btn","eSortableSelect":".tablesaw-btn-select","eJsMenu":".jsmenu","eJsCopyToClipboard":".js-copy-to-clipboard","eInputBgFrame":".inputbg-frame","ePrintLink":".printlink","eLinkExternal":".external","eTareaCountChars":".count-chars","eCharsLeft":".chars-left","eSelectDynamic":".sel-dynamic","eSelectHasChild":".sel-haschild","eGroupFormCont":".form-group","eReadOnly":".input666","ePageContent":".page-content","ePageHeader":".page-header","eLangLongList":".lang-longlist","eOpenThis":".openthis","eSelectPicker":".selectpicker","eDropDown":".dropdown","eFixedMenuHWrapper":".fixed-menu-h-wrapper","eCollapse":".collapse","eCheckBoxAll":".checkbox-all","eCheckBoxAllDisable":".checkbox-all-disable","eFixElement":".fixit","eCloseit":".closeit","ePassShow":".show-password","eShowPolicy":".show-policy","eOnlyUserMenu":".onlyuser-menu","eDropDownMenu":".dropdown-menu","eIsChainselHide":".is-chainsel-hide","eMultiLevelMenu":".multilevel-menu","eLevelMenu2":".menu-level-2","eTopLinksWrapper":".desktop-usermenu-wrapper","eSwitchIcon":".switchicon","eMultiLineEllipsis":".multi-line-ellipsis","eSwitchInputToggle":".switch-input-toggle","eSwitchDataOnlyDisab":".switch-input-onlydisable","eModal":".modal","eModalHeader":".modal-header","eModalBody":".modal-body","eModalDownload":".modal-download","eTruncate":".truncate","eSameHeight":".same-height","eSecondsRedir":".seconds-redir","eLeaveDisabled":".leave-disabled","ePopover":".popover","eChainSelGroup":"chainsel-group","eIsChildData":"childid","isIeOld":"is-ieold","multiLevelMenuIn":"in","menuActiveClass":"active","lastChild":"last-child","switchDataInput":"switch-input","switchInputActive":"switch-input-active","disableOnLoad":"disable-onload","cloneMenuDataSource":"desktop-usermenu","cloneMenuDataTarget":"fixed-bar-wrapper","cloneMenuDataTarget2":"mobile-usermenu-h","cloneMenuDataTarget3":"mobile-usermenu-v","darkOverlay":"dark-overlay","hidePolicyOnKeyDown":"hide-policy-on-keydown","hideBtnOnly":"js-hide-btn-only","switchIconEven":"switchicon-even","switchIconOdd":"switchicon-odd","selectDynamic":"sel-dynamic","selectHasChild":"sel-haschild","jsDisableCheckboxAllLoad":"js-disable-checkbox-all-load","limitCharsEllipsis":0,"funcTimeOut":2e4,"dialogCloseTime":3e3,"isDebug":!1},opt=$.extend(!0,{},defParams);!function(e){e.fn.toLog=function(e,o){var n=void 0!==o&&""!==o;opt.isDebug&&(n?alert(e):window.console&&window.console.log&&window.console.log(e))},e.fn.isMobile=function(){var e=!1;return/iPhone|iPod|iPad|Android|BlackBerry|webOS/i.test(navigator.userAgent)&&(e=!0),e},e.fn.checkLocalStorage=function(o){return"undefined"!=typeof Storage||(void 0!==o&&e.fn.showDialog({"title":"Attenzione","bodyMsg":"Funzione localstorage non supportata","typecast":"info","type":"info"}),e.fn.toLog("funzione localstorage non supportata"),!1)},e.fn.showPopover=function(o,n){var t=void 0!==o?o:"",a=void 0!==n?n:"popover",i=[];if("popover-action"===a&&(t.delay={"hide":200}),e("[data-toggle='"+a+"']").addClass("invisible"),t.whiteListTag){var s=e.fn.tooltip.Constructor.DEFAULTS.whiteList,l=t.whiteListTag,c=Object.keys(l);e(c).each((function(o){var n=e.Deferred();l[c[o]].map((function(e){-1===s[c[o]].indexOf(e)&&s[c[o]].push(e),n.resolve()})),i.push(n)}))}e.when.apply(e,i).done((function(){e("[data-toggle='"+a+"']").popover(t).removeClass("invisible"),void 0!==t.btnclose&&t.btnclose&&e("[data-toggle='"+a+"']").on("shown.bs.popover",(function(){e(opt.eCloseit).on("click",(function(){e(this).closest(opt.ePopover).popover("hide")}))})),e("[data-toggle='"+a+"']").on("shown.bs.popover",(function(){"function"==typeof t.callbackShown&&t.callbackShown.call(this)})),e("body").on("hidden.bs.popover",(function(o){e(o.target).data("bs.popover").inState.click=!1}))}))},e.fn.pageAnchor=function(o){var n=e("html,body"),t=e.extend(!0,{},{"anchorLink":"","anchorChar":"#","offset":0,"callbackFunc":""},o);if(""!==t.anchorLink){if("#"!==t.anchorChar&&window.location.href.indexOf(t.anchorChar)>-1){var a=window.location.hash.replace(t.anchorChar,"#");e(a).length&&setTimeout((function(){n.animate({"scrollTop":e(a).offset().top+parseInt(t.offset)},"slow")}),300)}e(t.anchorLink).click((function(o){o.preventDefault();var a,i=e(this),s=i.attr("href"),l=i.data("history-title");e(s).length&&(a="#"!==t.anchorChar?s.replace("#",t.anchorChar):s,n.animate({"scrollTop":e(s).offset().top+parseInt(t.offset)},"slow"),window.history.pushState("",l,a))})),"function"==typeof t.callbackFunc&&t.callbackFunc.call(this)}},e.fn.historyBack=function(){e(opt.eWinBackCont).click((function(){if(""!==document.referrer)history.back();else{var e=location.href.split("?");window.location.href=e[0].substring(0,e[0].lastIndexOf("/")+1)}}))},e.fn.newTabLinks=function(){e(opt.eLinkExternal).click((function(){return window.open(e(this).attr("href")),!1}))},e.fn.autoRedirect=function(){e("a[data-autoredirect]").on("redir-now",(function(){var o=e(this),n=o.data("autoredirect");e(opt.eSecondsRedir).html(n),setTimeout((function(){window.location=o.attr("href")}),1e3*n)})).trigger("redir-now")},e.fn.urlParam=function(e){var o=new RegExp("[?&]"+e+"=([^&#]*)").exec(window.location.href);return null===o?null:o[1]||0},e.fn.hamburgerStatus=function(){var o="none"!==e(opt.eNavMobile).css("display");e("body").data("hamburgerStatus",o)},e.fn.toggleSwitchIcon=function(o){void 0!==o&&e(o).toggleClass(e(o).data(opt.switchIconEven)).toggleClass(e(o).data(opt.switchIconOdd))},e.fn.slideAnimantion=function(e,o){"y"===opt.dropdownAnimation&&"bs.dropdown"===o.namespace&&("show"===o.type&&e.find(opt.eDropDownMenu).stop(!0,!0).slideDown(),"hide"===o.type&&e.find(opt.eDropDownMenu).stop(!0,!0).slideUp())},e.fn.manageMenuH=function(){var o={},n=e("body");return e(opt.eMenuH).scrollTop(0),o.open=function(){e(opt.eMenuContainerH).css("min-height",e(opt.eMainPageContent).height()),e(opt.eMenuContainerH).css("display","block"),n.css("overflow","hidden"),e.fn.toLog("aperto")},o.close=function(){e(opt.eMenuContainerH).css("min-height","auto"),n.css("overflow","auto"),e("body").data("hamburgerStatus")?(e(opt.eMenuContainerH).css("display","none"),e.fn.toLog("menu mobile chiuso onclick")):(e(opt.eMenuContainerH).css("display","block"),e.fn.toLog("menu mobile aperto per desktop"))},o},e.fn.manageMenuV=function(){var o,n={};return n.open=function(){e(window).scrollTop(0),e(opt.eSidebarContainer).css("display","block"),e(opt.eFooter).addClass("hidden"),0===e(opt.eOverLay).length&&e(opt.eMainContainer).before(e.parseHTML('<div id="overlay"></div>')),e(opt.eOverLay).addClass(opt.darkOverlay),o=e(opt.eMainPageContent).innerHeight()>e("body").data("sizeViewport")?e(opt.eMainPageContent).innerHeight():e("body").data("sizeViewport"),e(opt.eOverLay).css("min-height",o),e(opt.eSidebarContainer).css("min-height",o),e.fn.toLog("aperto")},n.close=function(){e("body").data("hamburgerStatus")?(e(opt.eSidebarContainer).css("display","none"),e.fn.toLog("menu mobile chiuso onclick")):(e(opt.eSidebarContainer).css("display","block"),e.fn.toLog("menu mobile aperto per desktop")),e(opt.eOverLay).removeClass("dark-overlay"),e(opt.eFooter).removeClass("hidden")},n},e.fn.manageHamburger=function(){var o,n;switch("h"===opt.layoutMenuVersion||"u"===opt.layoutMenuVersion?(o=new e.fn.manageMenuH,n=opt.cloneMenuDataTarget2):(o=new e.fn.manageMenuV,n=opt.cloneMenuDataTarget3),e("body").data("hamburgerStatus")&&e(this).length&&e(opt.eNavMobile).toggleClass("open"),e(opt.eNavMobile).hasClass("open")){case!0:e("body").data("hamburgerStatus")?("y"===opt.closeMenuOnclick&&e("body").one("click",opt.eOverLay,(function(){e.fn.manageHamburger.call(e(this))})),o.open(),e.fn.domCloneIt({"cloneSource":opt.cloneMenuDataSource,"cloneDest":n,"cloneContainer":"n","callbackFunc":function(){"u"===opt.layoutMenuVersion&&(e(opt.eOnlyUserMenu+" "+opt.eDropDownMenu).height()>=e(window).height()-150?e(opt.eOnlyUserMenu+" "+opt.eDropDownMenu).css("margin-bottom",e(opt.eOnlyUserMenu+" "+opt.eDropDownMenu).height()):e(opt.eOnlyUserMenu+" "+opt.eDropDownMenu).css("margin-bottom","0"));var o=e("[data-clone-target='"+n+"']");"open"===o.data("clone-status")&&setTimeout((function(){o.addClass("open"),"y"===opt.dropdownAnimation&&o.find(opt.eDropDownMenu).first().stop(!0,!0).slideDown()}))}})):(e(opt.eNavMobile).removeClass("open"),e.fn.manageHamburger(),e.fn.toLog("menu mobile chiuso auto"));break;case!1:default:o.close()}},e.fn.closeDropDown=function(o){e(o).hasClass("open")&&(e(o).removeClass("open"),"y"===opt.dropdownAnimation&&e(o).find(e(opt.eDropDown+" "+opt.eDropDownMenu)).first().hide(),e.fn.toLog("chiudo menu utente"))},e.fn.checkLayout=function(){e.fn.hamburgerStatus();var o=e(opt.ePageHeader).innerHeight(),n=e(opt.eFooter).innerHeight(),t=e(window).height()-(o+n),a=e(window).height()-o;switch(e("body").data("sizeViewport",a),opt.layoutMenuVersion){case"v":e(opt.eMenuContainerH).css("display","none"),e(opt.eNavMobile).css("visibility","visible");break;case"h":default:case"u":e(opt.eSidebarContainer).css("display","none"),e(opt.eNavMobile).css("visibility","visible")}e("body").innerHeight()<=e(window).height()&&e(opt.ePageContent).css("min-height",t),!1===e("body").data("hamburgerStatus")&&!0===e("html").hasClass("is-ie8")&&e(opt.ePageContent).css("height","100%")},e.fn.resizeSidebar=function(){setTimeout((function(){e(opt.eSidebarContainer).height()-80>=e(opt.ePageContent).height()||e(opt.eSidebarContainer).css("min-height",e(opt.ePageContent).height()+80),e(opt.ePageContent).css("min-height",e(opt.eSidebarContainer).height())}),150)},e.fn.domCloneIt=function(o){var n,t=e.extend(!0,{},{"cloneSource":"","cloneDest":"","cloneType":"appendTo","cloneContainer":"y","callOnce":"","callprevFunc":"","callbackFunc":""},o);if(""!==t.cloneSource&&""!==t.cloneDest){if("function"==typeof t.callprevFunc&&t.callprevFunc.call(this),void 0===e("body").data(t.cloneSource+"_"+t.cloneDest)){n="n"===t.cloneContainer?e("[data-clone-source="+t.cloneSource+"]:first").contents():e("[data-clone-source="+t.cloneSource+"]:first");var a=e("[data-clone-target="+t.cloneDest+"]");n.clone().removeAttr("data-clone-source")[t.cloneType](a).promise().done((function(){e("body").data(t.cloneSource+"_"+t.cloneDest,!0),e.fn.toLog(t.cloneSource+": oggetto clonato")})),"function"==typeof t.callOnce&&t.callOnce.call(this)}"function"==typeof t.callbackFunc&&t.callbackFunc.call(this)}},e.fn.fixbarShowHide=function(){e(window).on("scroll resize load",(function(){!1===e("body").data("hamburgerStatus")?e(window).scrollTop()>=e(opt.eFixedHead).data("offset")?"none"===e(opt.eFixedHead).css("display")&&(e.fn.closeDropDown(opt.eTopNavWrapper+" "+opt.eTopLinksWrapper),e.fn.domCloneIt({"cloneSource":opt.cloneMenuDataSource,"cloneDest":opt.cloneMenuDataTarget,"callbackFunc":function(){"y"===opt.dropdownAnimation&&void 0===e(opt.eFixedHead).data(opt.cloneMenuDataSource+"_"+opt.cloneMenuDataTarget)&&e(opt.eFixedBarWrapper+" "+opt.eDropDown).on("show.bs.dropdown hide.bs.dropdown",(function(o){e.fn.slideAnimantion(e(this),o)})).promise().done((function(){e(opt.eFixedHead).data(opt.cloneMenuDataSource+"_"+opt.cloneMenuDataTarget,!0)}))}}),e(opt.eFixedHead).fadeIn(100,(function(){e(opt.eFixedHead).show()})),e.fn.toLog("menu mobile non visibile. attivo la fixbar")):"none"!==e(opt.eFixedHead).css("display")&&e(opt.eFixedHead).hide().promise().done((function(){e.fn.closeDropDown(opt.eFixedBarWrapper+" "+opt.eTopLinksWrapper)})):(e(opt.eFixedHead).hide(),e(window).off("scroll",opt.eFixedHead),e.fn.toLog("menu mobile visibile"))}))},e.fn.showDialog=function(o){var n=e.extend(!0,{},{"typecast":"show","type":"info","title":"","bodyMsg":"","buttonLabel":"Chiudi","btnCancelLabel":"Annulla","btnOKLabel":"Conferma","cssClass":"","autoClose":!1,"draggable":!1,"closable":!0,"customZindex":1102,"showCallback":"","shownCallback":"","hideCallback":"","hiddenCallback":"","callbackFunc":""},o),t={"info":BootstrapDialog.TYPE_INFO,"primary":BootstrapDialog.TYPE_PRIMARY,"success":BootstrapDialog.TYPE_SUCCESS,"warning":BootstrapDialog.TYPE_WARNING,"danger":BootstrapDialog.TYPE_DANGER,"normal":BootstrapDialog.TYPE_DEFAULT};switch(n.typecast){case"alert":case"info":BootstrapDialog.alert({"title":n.title,"message":n.bodyMsg,"type":t[n.type],"cssClass":n.cssClass,"closable":n.closable,"draggable":n.draggable,"buttonLabel":n.buttonLabel,"callback":function(e){"function"==typeof n.callbackFunc&&n.callbackFunc.call(this,e)}});break;case"confirm":BootstrapDialog.configDefaultOptions({"cssClass":n.cssClass}),BootstrapDialog.confirm({"title":n.title,"message":n.bodyMsg,"type":t[n.type],"closable":n.closable,"draggable":n.draggable,"btnCancelLabel":n.btnCancelLabel,"btnOKLabel":n.btnOKLabel,"callback":function(e){"function"==typeof n.callbackFunc&&n.callbackFunc.call(this,e)}});break;case"show":default:BootstrapDialog.show({"title":n.title,"message":n.bodyMsg,"type":t[n.type],"cssClass":n.cssClass,"closable":n.closable,"draggable":n.draggable,"buttonLabel":n.buttonLabel,"onshow":function(e){!0===n.autoClose&&setTimeout((function(){e.close()}),opt.dialogCloseTime),"function"==typeof n.showCallback&&n.showCallback.call(this,e)},"onshown":function(o){""!==n.customZindex&&e(o)[0].$modal.css("z-index",n.customZindex),"function"==typeof n.shownCallback&&n.shownCallback.call(this,o)},"onhide":function(e){"function"==typeof n.hideCallback&&n.hideCallback.call(this,e)},"onhidden":function(e){"function"==typeof n.hiddenCallback&&n.hiddenCallback.call(this,e)}})}},e.fn.confirmActionLink=function(){e(opt.eJsActionConfirm).on("click",(function(o){var n=e(this),t=void 0!==n.data("modal-title")?n.data("modal-title"):"",a=void 0!==n.data("modal-bodymsg")?n.data("modal-bodymsg"):"",i=void 0!==n.data("modal-type")?n.data("modal-type"):"info";o.preventDefault(),e.fn.showDialog({"typecast":"confirm","type":i,"title":t,"bodyMsg":a,"callbackFunc":function(e){e&&(window.location.href=n.attr("href"))}})}))},e.fn.disableAction=function(o){var n=e.extend(!0,{},{"parent":"","overlayZindex":"","waitText":"","showLoader":!1},o);e(opt.eJsDisableAction).on("click",(function(){var o=e(this),t=e("body");""!=n.parent&&(t=o.parent(n.parent)),""!=n.waitText&&o.text(n.waitText),t.css("position","relative").promise().done((function(){t.append('<div class="'+validationParams.disableOverlay+'"></div>'),""!=n.overlayZindex&&e("."+validationParams.disableOverlay).css("z-index",n.overlayZindex),n.showLoader&&e("body").append('<div id="loader">Attendere...<div class="cssload-loader"><span></span></div></div>')}))}))},e.fn.autoCloseDialog=function(o){var n=e.extend(!0,{},{"idModal":"","timeOut":1e3,"callbackFunc":""},o);""!==n.idModal&&setTimeout((function(){e(n.idModal).modal("hide")}),n.timeOut)},e.fn.toggleLoader=function(o){switch(void 0===o?"show":o){case"show":e(opt.eLoader).removeClass("invisible");break;case"hide":default:e(opt.eLoader).addClass("invisible")}},e.fn.datePicker=function(o){var n={"format":"dd/mm/yyyy","language":"it","clearBtn":!0,"autoclose":!0,"disableTouchKeyboard":!0},t=n,a=opt.eDateIt;void 0!==o&&(t=e.extend(!0,{},n,o)),void 0!==t.selector&&(a=t.selector),e(a).datepicker(t).on("show",(function(){var o=e(this);o.keydown((function(){return!1})),o.on("cut copy paste",(function(e){e.preventDefault()}))}))},e.fn.datePickerDestroy=function(){e(opt.eDateIt).datepicker("destroy")},e.fn.ulToSelect=function(o){if("none"===e(o).css("display")){var n="select-"+o.slice(1);if(0===e("."+n).length){var t=e("<select />").addClass(n),a=[];e.each(e(o).children("li"),(function(){var o=e(this).children("a").hasClass("active")?'selected="selected"':"";a.push('<option data-link-url="'+e(this).find("a").attr("href")+'" '+o+">"+e(this).text()+"</option>")})),e(t).html(a.join("")).insertAfter(e(o)),e.fn.selectLocation("."+n,"lang")}}},e.fn.selectLocation=function(o,n){var t,a=void 0===n?"":n;e(o).change((function(){var o=e(this),n=e("option:selected",o).attr("value"),i=e("option:selected",o).data("link-url"),s={};if(t=void 0!==i?i:window.location.href,void 0===n)return window.location.href=t,!1;t.replace(/[?&]+([^=&]+)=([^&]*)/gi,(function(e,o,n){o!==a&&(s[o]=n)}));var l,c=t.indexOf("?")>0&&Object.keys(s).length>0?"&":"",r=t.split("?"),d=e.param(s);return l=""!==a?a+"="+n:n,window.location.href=r[0]+"?"+d+c+l,!1}))},e.fn.linkBackTop=function(){e(window).scroll((function(){e(window).scrollTop()>opt.amountScrolled?(e(opt.eBackTop).fadeIn("slow"),e(opt.eBackTop).css("bottom","54px")):e(opt.eBackTop).fadeOut("slow")})),e(opt.eBackTop).click((function(){return e("html, body").animate({"scrollTop":0},700),!1}))},e.fn.errorBoxCallback=function(){"v"===opt.layoutMenuVersion&&e.fn.resizeSidebar()},e.fn.copyText=function(o){var n=e.extend(!0,{},{"target":"","messageSuccess":"","msHideMsg":3e3},o),t=function(){if(""!==n.messageSuccess){if(!1===e(n.messageSuccess).hasClass("hidden"))return;e(n.messageSuccess).removeClass("hidden");var o=parseInt(n.msHideMsg,10)&&n.msHideMsg>0?n.msHideMsg:3e3;setTimeout((function(){e(n.messageSuccess).addClass("hidden")}),o)}};!function(){if(""===n.target)throw"parametro target obbligatorio"}(),e(n.target).select(),document.execCommand("copy"),t()}}(jQuery),$(document).ready((function(){$.fn.checkLayout(),$.fn.fixbarShowHide(),"y"===opt.isMultiLanguage&&$.fn.ulToSelect(opt.eLangLongList),"y"===opt.showBackTop&&$.fn.linkBackTop(),"n"!==opt.layoutMenuVersion&&($(opt.eNavMobile).click((function(){$.fn.manageHamburger.call($(this))})),$(opt.eSidebarMenu+" "+opt.eOpenThis+","+opt.eSidebarMenuClass+" "+opt.eOpenThis).each((function(){$(this).parents(opt.eMultiLevelMenu).addBack().addClass(opt.multiLevelMenuIn);var e=$(this).parents().children("a").find(opt.eSwitchIcon);$.fn.toggleSwitchIcon(e),$(opt.ePageContent).css("min-height",$(opt.eSidebarContainer).innerHeight())})),$("[data-toggle='collapse']").click((function(e){var o=$(this);e.preventDefault(),o.parent().children().find(".multilevel-menu").collapse("hide")})),$(opt.ePrintLink).click((function(e){e.preventDefault(),window.print()})),$(opt.eDropDown+","+opt.eCollapse).on("show.bs.dropdown hide.bs.dropdown show.bs.collapse hide.bs.collapse shown.bs.collapse hidden.bs.collapse",(function(e){var o,n=$(this);n.is(e.target)&&("bs.dropdown"===e.namespace?o=n.find(opt.eSwitchIcon):"bs.collapse"===e.namespace&&(o=n.prev().find(opt.eSwitchIcon+":first")),"show"!==e.type&&"hide"!==e.type||"bs.collapse"!==e.namespace&&"bs.dropdown"!==e.namespace||($.fn.toggleSwitchIcon(o),$.fn.slideAnimantion(n,e)),"shown"!==e.type&&"hidden"!==e.type||"bs.collapse"!==e.namespace||("hidden"===e.type&&$(opt.eFooter).hide(),!1===$("body").data("hamburgerStatus")?$.fn.resizeSidebar():$(opt.ePageContent).css("min-height",$("body").data("sizeViewport")),!1===$(opt.eFooter).is(":visible")&&$(opt.eFooter).fadeIn(100)))})),$(window).on("resize",(function(){$.fn.fixbarShowHide(),$.fn.checkLayout(),"n"!==opt.layoutMenuVersion&&$.fn.manageHamburger(),"y"===opt.isMultiLanguage&&$.fn.ulToSelect(opt.eLangLongList)})),$(window).on("load",(function(){$.fn.resizeSidebar()})))}));
/**
* @preserve
* Filename:	custom.lib.js
*
* Created: 	22/11/2016 (17:08:05)
* Created by: 	Lorenzo Saibal Forti <lorenzo.forti@gmail.com>
*
* Last Updated:	22/11/2016 (17:08:05)
* Updated by: 	Lorenzo Saibal Forti <lorenzo.forti@gmail.com>
*
* Copyleft:	2016 - Tutti i diritti riservati
*
* Comments: questo file contiene le funzioni di validazione specifiche per i form del sito. normalmente viene copiato nella root del sito specifico
**/
var c_defParams={"eNewTab":".newtab","eJsToggleFooter":".js-toggle-footer","funcTimeOut":2e4,"isDebug":!1},c_opt=$.extend(!0,{},c_defParams);opt=$.extend(defParams,{"layoutMenuVersion":"u"});!function(e){e.fn.observeSpidBtn=function(){var o=e(c_opt.eJsToggleFooter),n=window.MutationObserver||window.WebKitMutationObserver,t=100;new n((function(n){"true"==o.attr("aria-expanded")?(e(opt.eFooter).css("visibility","hidden"),e(window).scrollTop()-e(window).height()<=400&&(t=50),e("html, body").animate({scrollTop:e(window).scrollTop()+t},700)):e(opt.eFooter).css("visibility","visible")})).observe(o[0],{attributes:!0})}}(jQuery),$(document).ready((function(){$.fn.historyBack(),$(c_opt.eNewTab).click((function(){return window.open($(this).attr("href")),!1}))}));