/* Modernizr 2.6.2 (Custom Build) | MIT & BSD * Build: http://modernizr.com/download/#-inlinesvg-svg-svgclippaths-touch-shiv-mq-cssclasses-teststyles-prefixes-ie8compat-load */ ;window.Modernizr=function(a,b,c){function y(a){j.cssText=a}function z(a,b){return y(m.join(a+";")+(b||""))}function A(a,b){return typeof a===b}function B(a,b){return!!~(""+a).indexOf(b)}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:A(f,"function")?f.bind(d||b):f}return!1}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n={svg:"http://www.w3.org/2000/svg"},o={},p={},q={},r=[],s=r.slice,t,u=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},v=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return u("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},w={}.hasOwnProperty,x;!A(w,"undefined")&&!A(w.call,"undefined")?x=function(a,b){return w.call(a,b)}:x=function(a,b){return b in a&&A(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=s.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(s.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(s.call(arguments)))};return e}),o.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:u(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},o.svg=function(){return!!b.createElementNS&&!!b.createElementNS(n.svg,"svg").createSVGRect},o.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="",(a.firstChild&&a.firstChild.namespaceURI)==n.svg},o.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(l.call(b.createElementNS(n.svg,"clipPath")))};for(var D in o)x(o,D)&&(t=D.toLowerCase(),e[t]=o[D](),r.push((e[t]?"":"no-")+t));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)x(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},y(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=m,e.mq=v,e.testStyles=u,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+r.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f'),e("head").append(''),e("head").append(''),t.matchMedia=t.matchMedia||function(e,t){var n,r=e.documentElement,i=r.firstElementChild||r.firstChild,s=e.createElement("body"),o=e.createElement("div");return o.id="mq-test-1",o.style.cssText="position:absolute;top:-100em",s.style.background="none",s.appendChild(o),function(e){return o.innerHTML='­',r.insertBefore(s,i),n=o.offsetWidth===42,r.removeChild(s),{matches:n,media:e}}}(n),Array.prototype.filter||(Array.prototype.filter=function(e){if(this==null)throw new TypeError;var t=Object(this),n=t.length>>>0;if(typeof e!="function")return;var r=[],i=arguments[1];for(var s=0;s>>0;if(n===0)return-1;var r=0;arguments.length>1&&(r=Number(arguments[1]),r!=r?r=0:r!=0&&r!=Infinity&&r!=-Infinity&&(r=(r>0||-1)*Math.floor(Math.abs(r))));if(r>=n)return-1;var i=r>=0?r:Math.max(n-Math.abs(r),0);for(;i").appendTo("head")[0].sheet,init:function(t,n,r,i,s,o){var u,a=[t,r,i,s],f=[],o=o||!1;o&&(this.nc=o),this.rtl=/rtl/i.test(e("html").attr("dir")),this.scope=t||this.scope;if(n&&typeof n=="string"&&!/reflow/i.test(n)){if(/off/i.test(n))return this.off();u=n.split(" ");if(u.length>0)for(var l=u.length-1;l>=0;l--)f.push(this.init_lib(u[l],a))}else{/reflow/i.test(n)&&(a[1]="reflow");for(var c in this.libs)f.push(this.init_lib(c,a))}return typeof n=="function"&&a.unshift(n),this.response_obj(f,a)},response_obj:function(e,t){for(var n=0,r=t.length;n=0;r--)this.lib_methods.hasOwnProperty(n[r])&&(this.libs[e.name][n[r]]=this.lib_methods[n[r]])},random_str:function(e){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");e||(e=Math.floor(Math.random()*t.length));var n="";for(var r=0;r=0;r--)i=s[r].split(":"),/true/i.test(i[1])&&(i[1]=!0),/false/i.test(i[1])&&(i[1]=!1),u(i[1])&&(i[1]=parseInt(i[1],10)),i.length===2&&i[0].length>0&&(n[a(i[0])]=a(i[1]));return n},delay:function(e,t){return setTimeout(e,t)},scrollTo:function(n,r,i){if(i<0)return;var s=r-e(t).scrollTop(),o=s/i*10;this.scrollToTimerCache=setTimeout(function(){isNaN(parseInt(o,10))||(t.scrollTo(0,e(t).scrollTop()+o),this.scrollTo(n,r,i-10))}.bind(this),10)},scrollLeft:function(e){if(!e.length)return;return"scrollLeft"in e[0]?e[0].scrollLeft:e[0].pageXOffset},empty:function(e){if(e.length&&e.length>0)return!1;if(e.length&&e.length===0)return!0;for(var t in e)if(hasOwnProperty.call(e,t))return!1;return!0},addCustomRule:function(e,t){if(t===r)Foundation.stylesheet.insertRule(e,Foundation.stylesheet.cssRules.length);else{var n=Foundation.media_queries[t];n!==r&&Foundation.stylesheet.insertRule("@media "+Foundation.media_queries[t]+"{ "+e+" }")}}},fix_outer:function(e){e.outerHeight=function(e,t){return typeof Zepto=="function"?e.height():typeof t!="undefined"?e.outerHeight(t):e.outerHeight()},e.outerWidth=function(e,t){return typeof Zepto=="function"?e.width():typeof t!="undefined"?e.outerWidth(t):e.outerWidth()}},error:function(e){return e.name+" "+e.message+"; "+e.more},off:function(){return e(this.scope).off(".fndtn"),e(t).off(".fndtn"),!0},zj:e},e.fn.foundation=function(){var e=Array.prototype.slice.call(arguments,0);return this.each(function(){return Foundation.init.apply(Foundation,[this].concat(e)),this})}})(libFuncName,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.alerts={name:"alerts",version:"4.3.2",settings:{animation:"fadeOut",speed:300,callback:function(){}},init:function(t,n,r){return this.scope=t||this.scope,Foundation.inherit(this,"data_options"),typeof n=="object"&&e.extend(!0,this.settings,n),typeof n!="string"?(this.settings.init||this.events(),this.settings.init):this[n].call(this,r)},events:function(){var t=this;e(this.scope).on("click.fndtn.alerts","[data-alert] a.close",function(n){var r=e(this).closest("[data-alert]"),i=e.extend({},t.settings,t.data_options(r));n.preventDefault(),r[i.animation](i.speed,function(){e(this).remove(),i.callback()})}),this.settings.init=!0},off:function(){e(this.scope).off(".fndtn.alerts")},reflow:function(){}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.clearing={name:"clearing",version:"4.3.2",settings:{templates:{viewing:'×'},close_selectors:".clearing-close",init:!1,locked:!1},init:function(t,n,r){var i=this;return Foundation.inherit(this,"set_data get_data remove_data throttle data_options"),typeof n=="object"&&(r=e.extend(!0,this.settings,n)),typeof n!="string"?(e(this.scope).find("ul[data-clearing]").each(function(){var t=e(this),n=n||{},r=t.find("li"),s=i.get_data(t);!s&&r.length>0&&(n.$parent=t.parent(),i.set_data(t,e.extend({},i.settings,n,i.data_options(t))),i.assemble(t.find("li")),i.settings.init||i.events().swipe_events())}),this.settings.init):this[n].call(this,r)},events:function(){var n=this;return e(this.scope).on("click.fndtn.clearing","ul[data-clearing] li",function(t,r,i){var r=r||e(this),i=i||r,s=r.next("li"),o=n.get_data(r.parent()),u=e(t.target);t.preventDefault(),o||n.init(),i.hasClass("visible")&&r[0]===i[0]&&s.length>0&&n.is_open(r)&&(i=s,u=i.find("img")),n.open(u,r,i),n.update_paddles(i)}).on("click.fndtn.clearing",".clearing-main-next",function(e){this.nav(e,"next")}.bind(this)).on("click.fndtn.clearing",".clearing-main-prev",function(e){this.nav(e,"prev")}.bind(this)).on("click.fndtn.clearing",this.settings.close_selectors,function(e){Foundation.libs.clearing.close(e,this)}).on("keydown.fndtn.clearing",function(e){this.keydown(e)}.bind(this)),e(t).on("resize.fndtn.clearing",function(){this.resize()}.bind(this)),this.settings.init=!0,this},swipe_events:function(){var t=this;e(this.scope).on("touchstart.fndtn.clearing",".visible-img",function(t){t.touches||(t=t.originalEvent);var n={start_page_x:t.touches[0].pageX,start_page_y:t.touches[0].pageY,start_time:(new Date).getTime(),delta_x:0,is_scrolling:r};e(this).data("swipe-transition",n),t.stopPropagation()}).on("touchmove.fndtn.clearing",".visible-img",function(n){n.touches||(n=n.originalEvent);if(n.touches.length>1||n.scale&&n.scale!==1)return;var r=e(this).data("swipe-transition");typeof r=="undefined"&&(r={}),r.delta_x=n.touches[0].pageX-r.start_page_x,typeof r.is_scrolling=="undefined"&&(r.is_scrolling=!!(r.is_scrolling||Math.abs(r.delta_x)');var r=e("#foundationClearingHolder"),i=this.get_data(n),s=n.detach(),o={grid:'",viewing:i.templates.viewing},u='
'+o.viewing+o.grid+"
";return r.after(u).remove()},open:function(e,t,n){var r=n.closest(".clearing-assembled"),i=r.find("div").first(),s=i.find(".visible-img"),o=s.find("img").not(e);this.locked()||(o.attr("src",this.load(e)).css("visibility","hidden"),this.loaded(o,function(){o.css("visibility","visible"),r.addClass("clearing-blackout"),i.addClass("clearing-container"),s.show(),this.fix_height(n).caption(s.find(".clearing-caption"),e).center(o).shift(t,n,function(){n.siblings().removeClass("visible"),n.addClass("visible")})}.bind(this)))},close:function(t,n){t.preventDefault();var r=function(e){return/blackout/.test(e.selector)?e:e.closest(".clearing-blackout")}(e(n)),i,s;return n===t.target&&r&&(i=r.find("div").first(),s=i.find(".visible-img"),this.settings.prev_index=0,r.find("ul[data-clearing]").attr("style","").closest(".clearing-blackout").removeClass("clearing-blackout"),i.removeClass("clearing-container"),s.hide()),!1},is_open:function(e){return e.parent().prop("style").length>0},keydown:function(t){var n=e(".clearing-blackout").find("ul[data-clearing]");t.which===39&&this.go(n,"next"),t.which===37&&this.go(n,"prev"),t.which===27&&e("a.clearing-close").trigger("click")},nav:function(t,n){var r=e(".clearing-blackout").find("ul[data-clearing]");t.preventDefault(),this.go(r,n)},resize:function(){var t=e(".clearing-blackout .visible-img").find("img");t.length&&this.center(t)},fix_height:function(t){var n=t.parent().children(),r=this;return n.each(function(){var t=e(this),n=t.find("img");t.height()>r.outerHeight(n)&&t.addClass("fix-height")}).closest("ul").width(n.length*100+"%"),this},update_paddles:function(e){var t=e.closest(".carousel").siblings(".visible-img");e.next().length>0?t.find(".clearing-main-next").removeClass("disabled"):t.find(".clearing-main-next").addClass("disabled"),e.prev().length>0?t.find(".clearing-main-prev").removeClass("disabled"):t.find(".clearing-main-prev").addClass("disabled")},center:function(e){return this.rtl?e.css({marginRight:-(this.outerWidth(e)/2),marginTop:-(this.outerHeight(e)/2)}):e.css({marginLeft:-(this.outerWidth(e)/2),marginTop:-(this.outerHeight(e)/2)}),this},load:function(e){if(e[0].nodeName==="A")var t=e.attr("href");else var t=e.parent().attr("href");return this.preload(e),t?t:e.attr("src")},preload:function(e){this.img(e.closest("li").next()).img(e.closest("li").prev())},loaded:function(e,t){function n(){t()}function r(){this.one("load",n);if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var e=this.attr("src"),t=e.match(/\?/)?"&":"?";t+="random="+(new Date).getTime(),this.attr("src",e+t)}}if(!e.attr("src")){n();return}e[0].complete||e[0].readyState===4?n():r.call(e)},img:function(e){if(e.length){var t=new Image,n=e.find("a");n.length?t.src=n.attr("href"):t.src=e.find("img").attr("src")}return this},caption:function(e,t){var n=t.data("caption");return n?e.html(n).show():e.text("").hide(),this},go:function(e,t){var n=e.find(".visible"),r=n[t]();r.length&&r.find("img").trigger("click",[n,r])},shift:function(e,t,n){var r=t.parent(),i=this.settings.prev_index||t.index(),s=this.direction(r,e,t),o=parseInt(r.css("left"),10),u=this.outerWidth(t),a;t.index()!==i&&!/skip/.test(s)?/left/.test(s)?(this.lock(),r.animate({left:o+u},300,this.unlock())):/right/.test(s)&&(this.lock(),r.animate({left:o-u},300,this.unlock())):/skip/.test(s)&&(a=t.index()-this.settings.up_count,this.lock(),a>0?r.animate({left:-(a*u)},300,this.unlock()):r.animate({left:0},300,this.unlock())),n()},direction:function(t,n,r){var i=t.find("li"),s=this.outerWidth(i)+this.outerWidth(i)/4,o=Math.floor(this.outerWidth(e(".clearing-container"))/s)-1,u=i.index(r),a;return this.settings.up_count=o,this.adjacent(this.settings.prev_index,u)?u>o&&u>this.settings.prev_index?a="right":u>o-1&&u<=this.settings.prev_index?a="left":a=!1:a="skip",this.settings.prev_index=u,a},adjacent:function(e,t){for(var n=t+1;n>=t-1;n--)if(n===e)return!0;return!1},lock:function(){this.settings.locked=!0},unlock:function(){this.settings.locked=!1},locked:function(){return this.settings.locked},outerHTML:function(e){return e.outerHTML||(new XMLSerializer).serializeToString(e)},off:function(){e(this.scope).off(".fndtn.clearing"),e(t).off(".fndtn.clearing"),this.remove_data(),this.settings.init=!1},reflow:function(){this.init()}}}(Foundation.zj,this,this.document),function(e,t,n){function i(e){return e}function s(e){return decodeURIComponent(e.replace(r," "))}var r=/\+/g,o=e.cookie=function(r,u,a){if(u!==n){a=e.extend({},o.defaults,a),u===null&&(a.expires=-1);if(typeof a.expires=="number"){var f=a.expires,l=a.expires=new Date;l.setDate(l.getDate()+f)}return u=o.json?JSON.stringify(u):String(u),t.cookie=[encodeURIComponent(r),"=",o.raw?u:encodeURIComponent(u),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}var c=o.raw?i:s,h=t.cookie.split("; ");for(var p=0,d=h.length;p0&&(e(t.target).is("[data-dropdown-content]")||e.contains(n.first()[0],t.target))){t.stopPropagation();return}r.close.call(r,e("[data-dropdown-content]"))}),e(t).on("resize.fndtn.dropdown",r.throttle(function(){r.resize.call(r)},50)).trigger("resize"),this.settings.init=!0},close:function(t){var n=this;t.each(function(){e(this).hasClass(n.settings.activeClass)&&(e(this).css(Foundation.rtl?"right":"left","-99999px").removeClass(n.settings.activeClass),e(this).trigger("closed"))})},open:function(e,t){this.css(e.addClass(this.settings.activeClass),t),e.trigger("opened")},toggle:function(t){var n=e("#"+t.data("dropdown"));if(n.length===0)return;this.close.call(this,e("[data-dropdown-content]").not(n)),n.hasClass(this.settings.activeClass)?this.close.call(this,n):(this.close.call(this,e("[data-dropdown-content]")),this.open.call(this,n,t))},resize:function(){var t=e("[data-dropdown-content].open"),n=e("[data-dropdown='"+t.attr("id")+"']");t.length&&n.length&&this.css(t,n)},css:function(n,r){var i=n.offsetParent(),s=r.offset();s.top-=i.offset().top,s.left-=i.offset().left;if(this.small())n.css({position:"absolute",width:"95%","max-width":"none",top:s.top+this.outerHeight(r)}),n.css(Foundation.rtl?"right":"left","2.5%");else{if(!Foundation.rtl&&e(t).width()>this.outerWidth(n)+r.offset().left&&!this.data_options(r).align_right){var o=s.left;n.hasClass("right")&&n.removeClass("right")}else{n.hasClass("right")||n.addClass("right");var o=s.left-(this.outerWidth(n)-this.outerWidth(r))}n.attr("style","").css({position:"absolute",top:s.top+this.outerHeight(r),left:o})}return n},small:function(){return e(t).width()<768||e("html").hasClass("lt-ie9")},off:function(){e(this.scope).off(".fndtn.dropdown"),e("html, body").off(".fndtn.dropdown"),e(t).off(".fndtn.dropdown"),e("[data-dropdown-content]").off(".fndtn.dropdown"),this.settings.init=!1},reflow:function(){}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.forms={name:"forms",version:"4.3.2",cache:{},settings:{disable_class:"no-custom",last_combo:null},init:function(t,n,r){return typeof n=="object"&&e.extend(!0,this.settings,n),typeof n!="string"?(this.settings.init||this.events(),this.assemble(),this.settings.init):this[n].call(this,r)},assemble:function(){var t=this;e('form.custom input[type="radio"],[type="checkbox"]',e(this.scope)).not('[data-customforms="disabled"]').not("."+this.settings.disable_class).each(function(e,n){t.set_custom_markup(n)}).change(function(){t.set_custom_markup(this)}),e("form.custom select",e(this.scope)).not('[data-customforms="disabled"]').not("."+this.settings.disable_class).not("[multiple=multiple]").each(this.append_custom_select)},events:function(){var r=this;e(this.scope).on("click.fndtn.forms","form.custom span.custom.checkbox",function(t){t.preventDefault(),t.stopPropagation(),r.toggle_checkbox(e(this))}).on("click.fndtn.forms","form.custom span.custom.radio",function(t){t.preventDefault(),t.stopPropagation(),r.toggle_radio(e(this))}).on("change.fndtn.forms","form.custom select",function(t,n){if(e(this).is('[data-customforms="disabled"]'))return;r.refresh_custom_select(e(this),n)}).on("click.fndtn.forms","form.custom label",function(t){if(e(t.target).is("label")){var n=e("#"+r.escape(e(this).attr("for"))).not('[data-customforms="disabled"]'),i,s;n.length!==0&&(n.attr("type")==="checkbox"?(t.preventDefault(),i=e(this).find("span.custom.checkbox"),i.length===0&&(i=n.add(this).siblings("span.custom.checkbox").first()),r.toggle_checkbox(i)):n.attr("type")==="radio"&&(t.preventDefault(),s=e(this).find("span.custom.radio"),s.length===0&&(s=n.add(this).siblings("span.custom.radio").first()),r.toggle_radio(s)))}}).on("mousedown.fndtn.forms","form.custom div.custom.dropdown",function(){return!1}).on("click.fndtn.forms","form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector",function(t){var n=e(this),s=n.closest("div.custom.dropdown"),o=i(s,"select");s.hasClass("open")||e(r.scope).trigger("click"),t.preventDefault();if(!1===o.is(":disabled"))return s.toggleClass("open"),s.hasClass("open")?e(r.scope).on("click.fndtn.forms.customdropdown",function(){s.removeClass("open"),e(r.scope).off(".fndtn.forms.customdropdown")}):e(r.scope).on(".fndtn.forms.customdropdown"),!1}).on("click.fndtn.forms touchend.fndtn.forms","form.custom div.custom.dropdown li",function(t){var r=e(this),s=r.closest("div.custom.dropdown"),o=i(s,"select"),u=0;t.preventDefault(),t.stopPropagation();if(!e(this).hasClass("disabled")){e("div.dropdown").not(s).removeClass("open");var a=r.closest("ul").find("li.selected");a.removeClass("selected"),r.addClass("selected"),s.removeClass("open").find("a.current").text(r.text()),r.closest("ul").find("li").each(function(e){r[0]===this&&(u=e)}),o[0].selectedIndex=u,o.data("prevalue",a.html());if(typeof n.createEvent!="undefined"){var f=n.createEvent("HTMLEvents");f.initEvent("change",!0,!0),o[0].dispatchEvent(f)}else o[0].fireEvent("onchange")}}),e(t).on("keydown",function(t){var r=n.activeElement,s=Foundation.libs.forms,o=e(".custom.dropdown"),u=i(o,"select"),a=e("input,select,textarea,button");if(o.length>0&&o.hasClass("open")){t.preventDefault(),t.which===9&&(e(a[e(a).index(u)+1]).focus(),o.removeClass("open")),t.which===13&&o.find("li.selected").trigger("click"),t.which===27&&o.removeClass("open");if(t.which>=65&&t.which<=90){var f=s.go_to(o,t.which),l=o.find("li.selected");f&&(l.removeClass("selected"),s.scrollTo(f.addClass("selected"),300))}if(t.which===38){var l=o.find("li.selected"),c=l.prev(":not(.disabled)");c.length>0&&(c.parent()[0].scrollTop=c.parent().scrollTop()-s.outerHeight(c),l.removeClass("selected"),c.addClass("selected"))}else if(t.which===40){var l=o.find("li.selected"),f=l.next(":not(.disabled)");f.length>0&&(f.parent()[0].scrollTop=f.parent().scrollTop()+s.outerHeight(f),l.removeClass("selected"),f.addClass("selected"))}}}),e(t).on("keyup",function(t){var r=n.activeElement,i=e(".custom.dropdown");r===i.find(".current")[0]&&i.find(".selector").focus().click()}),this.settings.init=!0},go_to:function(e,t){var n=e.find("li"),r=n.length;if(r>0)for(var i=0;i').insertAfter(n)),i.toggleClass("checked",n.is(":checked")),i.toggleClass("disabled",n.is(":disabled"))},append_custom_select:function(t,n){var r=Foundation.libs.forms,i=e(n),s=i.next("div.custom.dropdown"),o=s.find("ul"),u=s.find(".current"),a=s.find(".selector"),f=i.find("option"),l=f.filter(":selected"),c=i.attr("class")?i.attr("class").split(" "):[],h=0,p="",d,v=!1;if(s.length===0){var m=i.hasClass("small")?"small":i.hasClass("medium")?"medium":i.hasClass("large")?"large":i.hasClass("expand")?"expand":"";s=e('
    '),a=s.find(".selector"),o=s.find("ul"),p=f.map(function(){var t=e(this).attr("class")?e(this).attr("class"):"";return"
  • "+e(this).html()+"
  • "}).get().join(""),o.append(p),v=s.prepend(''+(l.html()||"")+"").find(".current"),i.after(s).addClass("hidden-field")}else p=f.map(function(){return"
  • "+e(this).html()+"
  • "}).get().join(""),o.html("").append(p);r.assign_id(i,s),s.toggleClass("disabled",i.is(":disabled")),d=o.find("li"),r.cache[s.data("id")]=d.length,f.each(function(t){this.selected&&(d.eq(t).addClass("selected"),v&&v.html(e(this).html())),e(this).is(":disabled")&&d.eq(t).addClass("disabled")});if(!s.is(".small, .medium, .large, .expand")){s.addClass("open");var r=Foundation.libs.forms;r.hidden_fix.adjust(o),h=r.outerWidth(d)>h?r.outerWidth(d):h,Foundation.libs.forms.hidden_fix.reset(),s.removeClass("open")}},assign_id:function(e,t){var n=[+(new Date),Foundation.random_str(5)].join("-");e.attr("data-id",n),t.attr("data-id",n)},refresh_custom_select:function(t,n){var r=this,i=0,s=t.next(),o=t.find("option"),u=s.find("ul"),a=s.find("li");if(o.length!==this.cache[s.data("id")]||n){u.html("");var f="";o.each(function(){var t=e(this),n=t.html(),r=this.selected;f+='
  • '+n+"
  • ",r&&s.find(".current").html(n)}),u.html(f),s.removeAttr("style"),u.removeAttr("style"),s.find("li").each(function(){s.addClass("open"),r.outerWidth(e(this))>i&&(i=r.outerWidth(e(this))),s.removeClass("open")}),a=s.find("li"),this.cache[s.data("id")]=a.length}},refresh_custom_selection:function(t){var n=e("option:selected",t).text();e("a.current",t.next()).text(n)},toggle_checkbox:function(e){var t=e.prev(),n=t[0];!1===t.is(":disabled")&&(n.checked=n.checked?!1:!0,e.toggleClass("checked"),t.trigger("change"))},toggle_radio:function(e){var t=e.prev(),n=t.closest("form.custom"),r=t[0];!1===t.is(":disabled")&&(n.find('input[type="radio"][name="'+this.escape(t.attr("name"))+'"]').next().not(e).removeClass("checked"),e.hasClass("checked")||e.toggleClass("checked"),r.checked=e.hasClass("checked"),t.trigger("change"))},escape:function(e){return e?e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):""},hidden_fix:{tmp:[],hidden:null,adjust:function(t){var n=this;n.hidden=t.parents(),n.hidden=n.hidden.add(t).filter(":hidden"),n.hidden.each(function(){var t=e(this);n.tmp.push(t.attr("style")),t.css({visibility:"hidden",display:"block"})})},reset:function(){var t=this;t.hidden.each(function(n){var i=e(this),s=t.tmp[n];s===r?i.removeAttr("style"):i.attr("style",s)}),t.tmp=[],t.hidden=null}},off:function(){e(this.scope).off(".fndtn.forms")},reflow:function(){}};var i=function(t,n){var t=t.prev();while(t.length){if(t.is(n))return t;t=t.prev()}return e()}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";var i=i||!1;Foundation.libs.joyride={name:"joyride",version:"4.3.2",defaults:{expose:!1,modal:!1,tipLocation:"bottom",nubPosition:"auto",scrollSpeed:300,timer:0,startTimerOnClick:!0,startOffset:0,nextButton:!0,tipAnimation:"fade",pauseAfter:[],exposed:[],tipAnimationFadeSpeed:300,cookieMonster:!1,cookieName:"joyride",cookieDomain:!1,cookieExpires:365,tipContainer:"body",postRideCallback:function(){},postStepCallback:function(){},preStepCallback:function(){},preRideCallback:function(){},postExposeCallback:function(){},template:{link:'×',timer:'
    ',tip:'
    ',wrapper:'
    ',button:'',modal:'
    ',expose:'
    ',exposeCover:'
    '},exposeAddClass:""},settings:{},init:function(t,n,r){return this.scope=t||this.scope,Foundation.inherit(this,"throttle data_options scrollTo scrollLeft delay"),typeof n=="object"?e.extend(!0,this.settings,this.defaults,n):e.extend(!0,this.settings,this.defaults,r),typeof n!="string"?(this.settings.init||this.events(),this.settings.init):this[n].call(this,r)},events:function(){var n=this;e(this.scope).on("click.joyride",".joyride-next-tip, .joyride-modal-bg",function(e){e.preventDefault(),this.settings.$li.next().length<1?this.end():this.settings.timer>0?(clearTimeout(this.settings.automate),this.hide(),this.show(),this.startTimer()):(this.hide(),this.show())}.bind(this)).on("click.joyride",".joyride-close-tip",function(e){e.preventDefault(),this.end()}.bind(this)),e(t).on("resize.fndtn.joyride",n.throttle(function(){if(e("[data-joyride]").length>0&&n.settings.$next_tip){if(n.settings.exposed.length>0){var t=e(n.settings.exposed);t.each(function(){var t=e(this);n.un_expose(t),n.expose(t)})}n.is_phone()?n.pos_phone():n.pos_default(!1,!0)}},100)),this.settings.init=!0},start:function(){var t=this,n=e(this.scope).find("[data-joyride]"),r=["timer","scrollSpeed","startOffset","tipAnimationFadeSpeed","cookieExpires"],i=r.length;this.settings.init||this.events(),this.settings.$content_el=n,this.settings.$body=e(this.settings.tipContainer),this.settings.body_offset=e(this.settings.tipContainer).position(),this.settings.$tip_content=this.settings.$content_el.find("> li"),this.settings.paused=!1,this.settings.attempts=0,this.settings.tipLocationPatterns={top:["bottom"],bottom:[],left:["right","top","bottom"],right:["left","top","bottom"]},typeof e.cookie!="function"&&(this.settings.cookieMonster=!1);if(!this.settings.cookieMonster||this.settings.cookieMonster&&e.cookie(this.settings.cookieName)===null)this.settings.$tip_content.each(function(n){var s=e(this);e.extend(!0,t.settings,t.data_options(s));for(var o=i-1;o>=0;o--)t.settings[r[o]]=parseInt(t.settings[r[o]],10);t.create({$li:s,index:n})}),!this.settings.startTimerOnClick&&this.settings.timer>0?(this.show("init"),this.startTimer()):this.show("init")},resume:function(){this.set_li(),this.show()},tip_template:function(t){var n,r;return t.tip_class=t.tip_class||"",n=e(this.settings.template.tip).addClass(t.tip_class),r=e.trim(e(t.li).html())+this.button_text(t.button_text)+this.settings.template.link+this.timer_instance(t.index),n.append(e(this.settings.template.wrapper)),n.first().attr("data-index",t.index),e(".joyride-content-wrapper",n).append(r),n[0]},timer_instance:function(t){var n;return t===0&&this.settings.startTimerOnClick&&this.settings.timer>0||this.settings.timer===0?n="":n=this.outerHTML(e(this.settings.template.timer)[0]),n},button_text:function(t){return this.settings.nextButton?(t=e.trim(t)||"Next",t=this.outerHTML(e(this.settings.template.button).append(t)[0])):t="",t},create:function(t){var n=t.$li.attr("data-button")||t.$li.attr("data-text"),r=t.$li.attr("class"),i=e(this.tip_template({tip_class:r,index:t.index,button_text:n,li:t.$li}));e(this.settings.tipContainer).append(i)},show:function(t){var n=null;this.settings.$li===r||e.inArray(this.settings.$li.index(),this.settings.pauseAfter)===-1?(this.settings.paused?this.settings.paused=!1:this.set_li(t),this.settings.attempts=0,this.settings.$li.length&&this.settings.$target.length>0?(t&&(this.settings.preRideCallback(this.settings.$li.index(),this.settings.$next_tip),this.settings.modal&&this.show_modal()),this.settings.preStepCallback(this.settings.$li.index(),this.settings.$next_tip),this.settings.modal&&this.settings.expose&&this.expose(),this.settings.tipSettings=e.extend(this.settings,this.data_options(this.settings.$li)),this.settings.timer=parseInt(this.settings.timer,10),this.settings.tipSettings.tipLocationPattern=this.settings.tipLocationPatterns[this.settings.tipSettings.tipLocation],/body/i.test(this.settings.$target.selector)||this.scroll_to(),this.is_phone()?this.pos_phone(!0):this.pos_default(!0),n=this.settings.$next_tip.find(".joyride-timer-indicator"),/pop/i.test(this.settings.tipAnimation)?(n.width(0),this.settings.timer>0?(this.settings.$next_tip.show(),this.delay(function(){n.animate({width:n.parent().width()},this.settings.timer,"linear")}.bind(this),this.settings.tipAnimationFadeSpeed)):this.settings.$next_tip.show()):/fade/i.test(this.settings.tipAnimation)&&(n.width(0),this.settings.timer>0?(this.settings.$next_tip.fadeIn(this.settings.tipAnimationFadeSpeed).show(),this.delay(function(){n.animate({width:n.parent().width()},this.settings.timer,"linear")}.bind(this),this.settings .tipAnimationFadeSpeed)):this.settings.$next_tip.fadeIn(this.settings.tipAnimationFadeSpeed)),this.settings.$current_tip=this.settings.$next_tip):this.settings.$li&&this.settings.$target.length<1?this.show():this.end()):this.settings.paused=!0},is_phone:function(){return i?i.mq("only screen and (max-width: 767px)")||e(".lt-ie9").length>0:e(t).width()<767},hide:function(){this.settings.modal&&this.settings.expose&&this.un_expose(),this.settings.modal||e(".joyride-modal-bg").hide(),this.settings.$current_tip.css("visibility","hidden"),setTimeout(e.proxy(function(){this.hide(),this.css("visibility","visible")},this.settings.$current_tip),0),this.settings.postStepCallback(this.settings.$li.index(),this.settings.$current_tip)},set_li:function(e){e?(this.settings.$li=this.settings.$tip_content.eq(this.settings.startOffset),this.set_next_tip(),this.settings.$current_tip=this.settings.$next_tip):(this.settings.$li=this.settings.$li.next(),this.set_next_tip()),this.set_target()},set_next_tip:function(){this.settings.$next_tip=e(".joyride-tip-guide[data-index='"+this.settings.$li.index()+"']"),this.settings.$next_tip.data("closed","")},set_target:function(){var t=this.settings.$li.attr("data-class"),r=this.settings.$li.attr("data-id"),i=function(){return r?e(n.getElementById(r)):t?e("."+t).first():e("body")};this.settings.$target=i()},scroll_to:function(){var n,r;n=e(t).height()/2,r=Math.ceil(this.settings.$target.offset().top-n+this.outerHeight(this.settings.$next_tip)),r>0&&this.scrollTo(e("html, body"),r,this.settings.scrollSpeed)},paused:function(){return e.inArray(this.settings.$li.index()+1,this.settings.pauseAfter)===-1},restart:function(){this.hide(),this.settings.$li=r,this.show("init")},pos_default:function(n,r){var i=Math.ceil(e(t).height()/2),s=this.settings.$next_tip.offset(),o=this.settings.$next_tip.find(".joyride-nub"),u=Math.ceil(this.outerWidth(o)/2),a=Math.ceil(this.outerHeight(o)/2),f=n||!1;f&&(this.settings.$next_tip.css("visibility","hidden"),this.settings.$next_tip.show()),typeof r=="undefined"&&(r=!1);if(!/body/i.test(this.settings.$target.selector)){if(this.bottom()){var l=this.settings.$target.offset().left;Foundation.rtl&&(l=this.settings.$target.offset().width-this.settings.$next_tip.width()+l),this.settings.$next_tip.css({top:this.settings.$target.offset().top+a+this.outerHeight(this.settings.$target),left:l}),this.nub_position(o,this.settings.tipSettings.nubPosition,"top")}else if(this.top()){var l=this.settings.$target.offset().left;Foundation.rtl&&(l=this.settings.$target.offset().width-this.settings.$next_tip.width()+l),this.settings.$next_tip.css({top:this.settings.$target.offset().top-this.outerHeight(this.settings.$next_tip)-a,left:l}),this.nub_position(o,this.settings.tipSettings.nubPosition,"bottom")}else this.right()?(this.settings.$next_tip.css({top:this.settings.$target.offset().top,left:this.outerWidth(this.settings.$target)+this.settings.$target.offset().left+u}),this.nub_position(o,this.settings.tipSettings.nubPosition,"left")):this.left()&&(this.settings.$next_tip.css({top:this.settings.$target.offset().top,left:this.settings.$target.offset().left-this.outerWidth(this.settings.$next_tip)-u}),this.nub_position(o,this.settings.tipSettings.nubPosition,"right"));!this.visible(this.corners(this.settings.$next_tip))&&this.settings.attempts0&&arguments[0]instanceof e)i=arguments[0];else{if(!this.settings.$target||!!/body/i.test(this.settings.$target.selector))return!1;i=this.settings.$target}if(i.length<1)return t.console&&console.error("element not valid",i),!1;n=e(this.settings.template.expose),this.settings.$body.append(n),n.css({top:i.offset().top,left:i.offset().left,width:this.outerWidth(i,!0),height:this.outerHeight(i,!0)}),r=e(this.settings.template.exposeCover),s={zIndex:i.css("z-index"),position:i.css("position")},o=i.attr("class")==null?"":i.attr("class"),i.css("z-index",parseInt(n.css("z-index"))+1),s.position=="static"&&i.css("position","relative"),i.data("expose-css",s),i.data("orig-class",o),i.attr("class",o+" "+this.settings.exposeAddClass),r.css({top:i.offset().top,left:i.offset().left,width:this.outerWidth(i,!0),height:this.outerHeight(i,!0)}),this.settings.$body.append(r),n.addClass(u),r.addClass(u),i.data("expose",u),this.settings.postExposeCallback(this.settings.$li.index(),this.settings.$next_tip,i),this.add_exposed(i)},un_expose:function(){var n,r,i,s,o,u=!1;if(arguments.length>0&&arguments[0]instanceof e)r=arguments[0];else{if(!this.settings.$target||!!/body/i.test(this.settings.$target.selector))return!1;r=this.settings.$target}if(r.length<1)return t.console&&console.error("element not valid",r),!1;n=r.data("expose"),i=e("."+n),arguments.length>1&&(u=arguments[1]),u===!0?e(".joyride-expose-wrapper,.joyride-expose-cover").remove():i.remove(),s=r.data("expose-css"),s.zIndex=="auto"?r.css("z-index",""):r.css("z-index",s.zIndex),s.position!=r.css("position")&&(s.position=="static"?r.css("position",""):r.css("position",s.position)),o=r.data("orig-class"),r.attr("class",o),r.removeData("orig-classes"),r.removeData("expose"),r.removeData("expose-z-index"),this.remove_exposed(r)},add_exposed:function(t){this.settings.exposed=this.settings.exposed||[],t instanceof e||typeof t=="object"?this.settings.exposed.push(t[0]):typeof t=="string"&&this.settings.exposed.push(t)},remove_exposed:function(t){var n,r;t instanceof e?n=t[0]:typeof t=="string"&&(n=t),this.settings.exposed=this.settings.exposed||[],r=this.settings.exposed.length;for(var i=0;ia&&(a=u),[n.offset().topn.offset().left]},visible:function(e){var t=e.length;while(t--)if(e[t])return!1;return!0},nub_position:function(e,t,n){t==="auto"?e.addClass(n):e.addClass(t)},startTimer:function(){this.settings.$li.length?this.settings.automate=setTimeout(function(){this.hide(),this.show(),this.startTimer()}.bind(this),this.settings.timer):clearTimeout(this.settings.automate)},end:function(){this.settings.cookieMonster&&e.cookie(this.settings.cookieName,"ridden",{expires:this.settings.cookieExpires,domain:this.settings.cookieDomain}),this.settings.timer>0&&clearTimeout(this.settings.automate),this.settings.modal&&this.settings.expose&&this.un_expose(),this.settings.$next_tip.data("closed",!0),e(".joyride-modal-bg").hide(),this.settings.$current_tip.hide(),this.settings.postStepCallback(this.settings.$li.index(),this.settings.$current_tip),this.settings.postRideCallback(this.settings.$li.index(),this.settings.$current_tip),e(".joyride-tip-guide").remove()},outerHTML:function(e){return e.outerHTML||(new XMLSerializer).serializeToString(e)},off:function(){e(this.scope).off(".joyride"),e(t).off(".joyride"),e(".joyride-close-tip, .joyride-next-tip, .joyride-modal-bg").off(".joyride"),e(".joyride-tip-guide, .joyride-modal-bg").remove(),clearTimeout(this.settings.automate),this.settings={}},reflow:function(){}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.magellan={name:"magellan",version:"4.3.2",settings:{activeClass:"active",threshold:0},init:function(t,n,r){return this.scope=t||this.scope,Foundation.inherit(this,"data_options"),typeof n=="object"&&e.extend(!0,this.settings,n),typeof n!="string"?(this.settings.init||(this.fixed_magellan=e("[data-magellan-expedition]"),this.set_threshold(),this.last_destination=e("[data-magellan-destination]").last(),this.events()),this.settings.init):this[n].call(this,r)},events:function(){var n=this;e(this.scope).on("arrival.fndtn.magellan","[data-magellan-arrival]",function(t){var r=e(this),i=r.closest("[data-magellan-expedition]"),s=i.attr("data-magellan-active-class")||n.settings.activeClass;r.closest("[data-magellan-expedition]").find("[data-magellan-arrival]").not(r).removeClass(s),r.addClass(s)}),this.fixed_magellan.on("update-position.fndtn.magellan",function(){var t=e(this)}).trigger("update-position"),e(t).on("resize.fndtn.magellan",function(){this.fixed_magellan.trigger("update-position")}.bind(this)).on("scroll.fndtn.magellan",function(){var r=e(t).scrollTop();n.fixed_magellan.each(function(){var t=e(this);typeof t.data("magellan-top-offset")=="undefined"&&t.data("magellan-top-offset",t.offset().top),typeof t.data("magellan-fixed-position")=="undefined"&&t.data("magellan-fixed-position",!1);var i=r+n.settings.threshold>t.data("magellan-top-offset"),s=t.attr("data-magellan-top-offset");t.data("magellan-fixed-position")!=i&&(t.data("magellan-fixed-position",i),i?(t.addClass("fixed"),t.css({position:"fixed",top:0})):(t.removeClass("fixed"),t.css({position:"",top:""})),i&&typeof s!="undefined"&&s!=0&&t.css({position:"fixed",top:s+"px"}))})}),this.last_destination.length>0&&e(t).on("scroll.fndtn.magellan",function(r){var i=e(t).scrollTop(),s=i+e(t).height(),o=Math.ceil(n.last_destination.offset().top);e("[data-magellan-destination]").each(function(){var t=e(this),r=t.attr("data-magellan-destination"),u=t.offset().top-i;u<=n.settings.threshold&&e("[data-magellan-arrival='"+r+"']").trigger("arrival"),s>=e(n.scope).height()&&o>i&&o0?this.outerHeight(this.fixed_magellan,!0):0)},off:function(){e(this.scope).off(".fndtn.magellan"),e(t).off(".fndtn.magellan")},reflow:function(){}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";var i=function(){},s=function(i,s){if(i.hasClass(s.slides_container_class))return this;var f=this,l,c=i,h,p,d,v=0,m,g,y=!1,b=!1;c.children().first().addClass(s.active_slide_class),f.update_slide_number=function(t){s.slide_number&&(h.find("span:first").text(parseInt(t)+1),h.find("span:last").text(c.children().length)),s.bullets&&(p.children().removeClass(s.bullets_active_class),e(p.children().get(t)).addClass(s.bullets_active_class))},f.update_active_link=function(t){var n=e('a[data-orbit-link="'+c.children().eq(t).attr("data-orbit-slide")+'"]');n.parents("ul").find("[data-orbit-link]").removeClass(s.bullets_active_class),n.addClass(s.bullets_active_class)},f.build_markup=function(){c.wrap('
    '),l=c.parent(),c.addClass(s.slides_container_class),s.navigation_arrows&&(l.append(e('').addClass(s.prev_class)),l.append(e('').addClass(s.next_class))),s.timer&&(d=e("
    ").addClass(s.timer_container_class),d.append(""),d.append(e("
    ").addClass(s.timer_progress_class)),d.addClass(s.timer_paused_class),l.append(d)),s.slide_number&&(h=e("
    ").addClass(s.slide_number_class),h.append(" "+s.slide_number_text+" "),l.append(h)),s.bullets&&(p=e("
      ").addClass(s.bullets_container_class),l.append(p),c.children().each(function(t,n){var r=e("
    1. ").attr("data-orbit-slide",t);p.append(r)})),s.stack_on_small&&l.addClass(s.stack_on_small_class),f.update_slide_number(0),f.update_active_link(0)},f._goto=function(t,n){if(t===v)return!1;typeof g=="object"&&g.restart();var r=c.children(),i="next";y=!0,t=r.length?t=0:t<0&&(t=r.length-1);var o=e(r.get(v)),u=e(r.get(t));o.css("zIndex",2),o.removeClass(s.active_slide_class),u.css("zIndex",4).addClass(s.active_slide_class),c.trigger("orbit:before-slide-change"),s.before_slide_change(),f.update_active_link(t);var a=function(){var e=function(){v=t,y=!1,n===!0&&(g=f.create_timer(),g.start()),f.update_slide_number(v),c.trigger("orbit:after-slide-change",[{slide_number:v,total_slides:r.length}]),s.after_slide_change(v,r.length)};c.height()!=u.height()&&s.variable_height?c.animate({height:u.height()},250,"linear",e):e()};if(r.length===1)return a(),!1;var l=function(){i==="next"&&m.next(o,u,a),i==="prev"&&m.prev(o,u,a)};u.height()>c.height()&&s.variable_height?c.animate({height:u.height()},250,"linear",l):l()},f.next=function(e){e.stopImmediatePropagation(),e.preventDefault(),f._goto(v+1)},f.prev=function(e){e.stopImmediatePropagation(),e.preventDefault(),f._goto(v-1)},f.link_custom=function(t){t.preventDefault();var n=e(this).attr("data-orbit-link");if(typeof n=="string"&&(n=e.trim(n))!=""){var r=l.find("[data-orbit-slide="+n+"]");r.index()!=-1&&f._goto(r.index())}},f.link_bullet=function(t){var n=e(this).attr("data-orbit-slide");typeof n=="string"&&(n=e.trim(n))!=""&&f._goto(parseInt(n))},f.timer_callback=function(){f._goto(v+1,!0)},f.compute_dimensions=function(){var t=e(c.children().get(v)),n=t.height();s.variable_height||c.children().each(function(){e(this).height()>n&&(n=e(this).height())}),c.height(n)},f.create_timer=function(){var e=new o(l.find("."+s.timer_container_class),s,f.timer_callback);return e},f.stop_timer=function(){typeof g=="object"&&g.stop()},f.toggle_timer=function(){var e=l.find("."+s.timer_container_class);e.hasClass(s.timer_paused_class)?(typeof g=="undefined"&&(g=f.create_timer()),g.start()):typeof g=="object"&&g.stop()},f.init=function(){f.build_markup(),s.timer&&(g=f.create_timer(),g.start()),m=new a(s,c),s.animation==="slide"&&(m=new u(s,c)),l.on("click","."+s.next_class,f.next),l.on("click","."+s.prev_class,f.prev),l.on("click","[data-orbit-slide]",f.link_bullet),l.on("click",f.toggle_timer),s.swipe&&l.on("touchstart.fndtn.orbit",function(e){e.touches||(e=e.originalEvent);var t={start_page_x:e.touches[0].pageX,start_page_y:e.touches[0].pageY,start_time:(new Date).getTime(),delta_x:0,is_scrolling:r};l.data("swipe-transition",t),e.stopPropagation()}).on("touchmove.fndtn.orbit",function(e){e.touches||(e=e.originalEvent);if(e.touches.length>1||e.scale&&e.scale!==1)return;var t=l.data("swipe-transition");typeof t=="undefined"&&(t={}),t.delta_x=e.touches[0].pageX-t.start_page_x,typeof t.is_scrolling=="undefined"&&(t.is_scrolling=!!(t.is_scrolling||Math.abs(t.delta_x)0&&(this.locked=!0,t.trigger("close"),this.toggle_bg(),this.hide(n,this.settings.css.close))},close_targets:function(){var e="."+this.settings.dismissModalClass;return this.settings.closeOnBackgroundClick?e+", ."+this.settings.bgClass:e},toggle_bg:function(){e("."+this.settings.bgClass).length===0&&(this.settings.bg=e("
      ",{"class":this.settings.bgClass}).appendTo("body")),this.settings.bg.filter(":visible").length>0?this.hide(this.settings.bg):this.show(this.settings.bg)},show:function(n,r){if(r){if(n.parent("body").length===0){var i=n.wrap('
      ').parent();n.on("closed.fndtn.reveal.wrapped",function(){n.detach().appendTo(i),n.unwrap().unbind("closed.fndtn.reveal.wrapped")}),n.detach().appendTo("body")}if(/pop/i.test(this.settings.animation)){r.top=e(t).scrollTop()-n.data("offset")+"px";var s={top:e(t).scrollTop()+n.data("css-top")+"px",opacity:1};return this.delay(function(){return n.css(r).animate(s,this.settings.animationSpeed,"linear",function(){this.locked=!1,n.trigger("opened")}.bind(this)).addClass("open")}.bind(this),this.settings.animationSpeed/2)}if(/fade/i.test(this.settings.animation)){var s={opacity:1};return this.delay(function(){return n.css(r).animate(s,this.settings.animationSpeed,"linear",function(){this.locked=!1,n.trigger("opened")}.bind(this)).addClass("open")}.bind(this),this.settings.animationSpeed/2)}return n.css(r).show().css({opacity:1}).addClass("open").trigger("opened")}return/fade/i.test(this.settings.animation)?n.fadeIn(this.settings.animationSpeed/2):n.show()},hide:function(n,r){if(r){if(/pop/i.test(this.settings.animation)){var i={top:-e(t).scrollTop()-n.data("offset")+"px",opacity:0};return this.delay(function(){return n.animate(i,this.settings.animationSpeed,"linear",function(){this.locked=!1,n.css(r).trigger("closed")}.bind(this)).removeClass("open")}.bind(this),this.settings.animationSpeed/2)}if(/fade/i.test(this.settings.animation)){var i={opacity:0};return this.delay(function(){return n.animate(i,this.settings.animationSpeed,"linear",function(){this.locked=!1,n.css(r).trigger("closed")}.bind(this)).removeClass("open")}.bind(this),this.settings.animationSpeed/2)}return n.hide().css(r).removeClass("open").trigger("closed")}return/fade/i.test(this.settings.animation)?n.fadeOut(this.settings.animationSpeed/2):n.hide()},close_video:function(t){var n=e(this).find(".flex-video"),r=n.find("iframe");r.length>0&&(r.attr("data-src",r[0].src),r.attr("src","about:blank"),n.hide())},open_video:function(t){var n=e(this).find(".flex-video"),i=n.find("iframe");if(i.length>0){var s=i.attr("data-src");if(typeof s=="string")i[0].src=i.attr("data-src");else{var o=i[0].src;i[0].src=r,i[0].src=o}n.show()}},cache_offset:function(e){var t=e.show().height()+parseInt(e.css("top"),10);return e.hide(),t},off:function(){e(this.scope).off(".fndtn.reveal")},reflow:function(){}}}(Foundation.zj,this,this.document),function(e,t,n){"use strict";Foundation.libs.section={name:"section",version:"4.3.2",settings:{deep_linking:!1,small_breakpoint:768,one_up:!0,multi_expand:!1,section_selector:"[data-section]",region_selector:"section, .section, [data-section-region]",title_selector:".title, [data-section-title]",resized_data_attr:"data-section-resized",small_style_data_attr:"data-section-small-style",content_selector:".content, [data-section-content]",nav_selector:'[data-section="vertical-nav"], [data-section="horizontal-nav"]',active_class:"active",callback:function(){}},init:function(t,n,r){var i=this;return Foundation.inherit(this,"throttle data_options position_right offset_right"),typeof n=="object"&&e.extend(!0,i.settings,n),typeof n!="string"?(this.events(),!0):this[n].call(this,r)},events:function(){var r=this,i=[],s=r.settings.section_selector,o=r.settings.region_selector.split(","),u=r.settings.title_selector.split(",");for(var a=0,f=o.length;a"+l+">"+u[c];i.push(p+" a"),i.push(p)}}e(r.scope).on("click.fndtn.section",i.join(","),function(t){var n=e(this).closest(r.settings.title_selector);r.close_navs(n),n.siblings(r.settings.content_selector).length>0&&r.toggle_active.call(n[0],t)}),e(t).on("resize.fndtn.section",r.throttle(function(){r.resize()},30)).on("hashchange.fndtn.section",r.set_active_from_hash),e(n).on("click.fndtn.section",function(t){if(t.isPropagationStopped&&t.isPropagationStopped())return;if(t.target===n)return;r.close_navs(e(t.target).closest(r.settings.title_selector))}),e(t).triggerHandler("resize.fndtn.section"),e(t).triggerHandler("hashchange.fndtn.section")},close_navs:function(t){var n=Foundation.libs.section,r=e(n.settings.nav_selector).filter(function(){return!e.extend({},n.settings,n.data_options(e(this))).one_up});if(t.length>0){var i=t.parent().parent();if(n.is_horizontal_nav(i)||n.is_vertical_nav(i))r=r.filter(function(){return this!==i[0]})}r.children(n.settings.region_selector).removeClass(n.settings.active_class)},toggle_active:function(t){var n=e(this),r=Foundation.libs.section,i=n.parent(),s=n.siblings(r.settings.content_selector),o=i.parent(),u=e.extend({},r.settings,r.data_options(o)),a=o.children(r.settings.region_selector).filter("."+r.settings.active_class);!u.deep_linking&&s.length>0&&t.preventDefault(),t.stopPropagation();if(!i.hasClass(r.settings.active_class)){if(!r.is_accordion(o)||r.is_accordion(o)&&!r.settings.multi_expand)a.removeClass(r.settings.active_class),a.trigger("closed.fndtn.section");i.addClass(r.settings.active_class),r.resize(i.find(r.settings.section_selector).not("["+r.settings.resized_data_attr+"]"),!0),i.trigger("opened.fndtn.section")}else if(i.hasClass(r.settings.active_class)&&r.is_accordion(o)||!u.one_up&&(r.small(o)||r.is_vertical_nav(o)||r.is_horizontal_nav(o)||r.is_accordion(o)))i.removeClass(r.settings.active_class),i.trigger("closed.fndtn.section");u.callback(o)},check_resize_timer:null,resize:function(t,n){var r=Foundation.libs.section,i=e(r.settings.section_selector),s=r.small(i),o=function(e,t){return!r.is_accordion(e)&&!e.is("["+r.settings.resized_data_attr+"]")&&(!s||r.is_horizontal_tabs(e))&&t===(e.css("display")==="none"||!e.parent().is(":visible"))};t=t||e(r.settings.section_selector),clearTimeout(r.check_resize_timer),s||t.removeAttr(r.settings.small_style_data_attr),t.filter(function(){return o(e(this),!1)}).each(function(){var t=e(this),i=t.children(r.settings.region_selector),s=i.children(r.settings.title_selector),o=i.children(r.settings.content_selector),u=0;if(n&&t.children(r.settings.region_selector).filter("."+r.settings.active_class).length==0){var a=e.extend({},r.settings,r.data_options(t));!a.deep_linking&&(a.one_up||!r.is_horizontal_nav(t)&&!r.is_vertical_nav(t)&&!r.is_accordion(t))&&i.filter(":visible").first().addClass(r.settings.active_class)}if(r.is_horizontal_tabs(t)||r.is_auto(t)){var f=0;s.each(function(){var t=e(this);if(t.is(":visible")){t.css(r.rtl?"right":"left",f);var n=parseInt(t.css("border-"+(r.rtl?"left":"right")+"-width"),10);n.toString()==="Nan"&&(n=0),f+=r.outerWidth(t)-n,u=Math.max(u,r.outerHeight(t))}}),s.css("height",u),i.each(function(){var t=e(this),n=t.children(r.settings.content_selector),i=parseInt(n.css("border-top-width"),10);i.toString()==="Nan"&&(i=0),t.css("padding-top",u-i)}),t.css("min-height",u)}else if(r.is_horizontal_nav(t)){var l=!0;s.each(function(){u=Math.max(u,r.outerHeight(e(this)))}),i.each(function(){var n=e(this);n.css("margin-left","-"+(l?t:n.children(r.settings.title_selector)).css("border-left-width")),l=!1}),i.css("margin-top","-"+t.css("border-top-width")),s.css("height",u),o.css("top",u),t.css("min-height",u)}else if(r.is_vertical_tabs(t)){var c=0;s.each(function(){var t=e(this);if(t.is(":visible")){t.css("top",c);var n=parseInt(t.css("border-top-width"),10);n.toString()==="Nan"&&(n=0),c+=r.outerHeight(t)-n}}),o.css("min-height",c+1)}else if(r.is_vertical_nav(t)){var h=0,p=!0;s.each(function(){h=Math.max(h,r.outerWidth(e(this)))}),i.each(function(){var n=e(this);n.css("margin-top","-"+(p?t:n.children(r.settings.title_selector)).css("border-top-width")),p=!1}),s.css("width",h),o.css(r.rtl?"right":"left",h),t.css("width",h)}t.attr(r.settings.resized_data_attr,!0)}),e(r.settings.section_selector).filter(function(){return o(e(this),!0)}).length>0&&(r.check_resize_timer=setTimeout(function(){r.resize(t.filter(function(){return o(e(this),!1)}),!0)},700)),s&&t.attr(r.settings.small_style_data_attr,!0)},is_vertical_nav:function(e){return/vertical-nav/i.test(e.data("section"))},is_horizontal_nav:function(e){return/horizontal-nav/i.test(e.data("section"))},is_accordion:function(e){return/accordion/i.test(e.data("section"))},is_horizontal_tabs:function(e){return/^tabs$/i.test(e.data("section"))},is_vertical_tabs:function(e){return/vertical-tabs/i.test(e.data("section"))},is_auto:function(e){var t=e.data("section");return t===""||/auto/i.test(t)},set_active_from_hash:function(){var n=Foundation.libs.section,r=t.location.hash.substring(1),i=e(n.settings.section_selector),s;i.each(function(){var t=e(this),i=t.children(n.settings.region_selector);i.each(function(){var i=e(this),o=i.children(n.settings.content_selector).data("slug");if((new RegExp(o,"i")).test(r))return s=t,!1});if(s!=null)return!1}),s!=null&&i.each(function(){if(s==e(this)){var t=e(this),i=e.extend({},n.settings,n.data_options(t)),o=t.children(n.settings.region_selector),u=i.deep_linking&&r.length>0,a=!1;o.each(function(){var t=e(this);if(a)t.removeClass(n.settings.active_class);else if(u){var i=t.children(n.settings.content_selector).data("slug");i&&(new RegExp(i,"i")).test(r)?(t.hasClass(n.settings.active_class)||t.addClass(n.settings.active_class),a=!0):t.removeClass(n.settings.active_class)}else t.hasClass(n.settings.active_class)&&(a=!0)}),!a&&(i.one_up||!n.is_horizontal_nav(t)&&!n.is_vertical_nav(t)&&!n.is_accordion(t))&&o.filter(":visible").first().addClass(n.settings.active_class)}})},reflow:function(){var t=Foundation.libs.section;e(t.settings.section_selector).removeAttr(t.settings.resized_data_attr),t.throttle(function(){t.resize()},30)()},small:function(t){var n=e.extend({},this.settings,this.data_options(t));return this .is_horizontal_tabs(t)?!1:t&&this.is_accordion(t)?!0:e("html").hasClass("lt-ie9")?!0:e("html").hasClass("ie8compat")?!0:e(this.scope).width()'+t+''}},cache:{},init:function(t,n,r){Foundation.inherit(this,"data_options");var i=this;typeof n=="object"?e.extend(!0,this.settings,n):typeof r!="undefined"&&e.extend(!0,this.settings,r);if(typeof n=="string")return this[n].call(this,r);Modernizr.touch?e(this.scope).on("click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip","[data-tooltip]",function(t){var n=e.extend({},i.settings,i.data_options(e(this)));n["disable-for-touch"]||(t.preventDefault(),e(n.tooltipClass).hide(),i.showOrCreateTip(e(this)))}).on("click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip",this.settings.tooltipClass,function(t){t.preventDefault(),e(this).fadeOut(150)}):e(this.scope).on("mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip","[data-tooltip]",function(t){var n=e(this);/enter|over/i.test(t.type)?i.showOrCreateTip(n):(t.type==="mouseout"||t.type==="mouseleave")&&i.hide(n)})},showOrCreateTip:function(e){var t=this.getTip(e);return t&&t.length>0?this.show(e):this.create(e)},getTip:function(t){var n=this.selector(t),r=null;return n&&(r=e('span[data-selector="'+n+'"]'+this.settings.tooltipClass)),typeof r=="object"?r:!1},selector:function(e){var t=e.attr("id"),n=e.attr("data-tooltip")||e.attr("data-selector");return(t&&t.length<1||!t)&&typeof n!="string"&&(n="tooltip"+Math.random().toString(36).substring(7),e.attr("data-selector",n)),t&&t.length>0?t:n},create:function(t){var n=e(this.settings.tipTemplate(this.selector(t),e("
      ").html(t.attr("title")).html())),r=this.inheritable_classes(t);n.addClass(r).appendTo(this.settings.appendTo),Modernizr.touch&&n.append(''+this.settings.touchCloseText+""),t.removeAttr("title").attr("title",""),this.show(t)},reposition:function(n,r,i){var s,o,u,a,f,l;r.css("visibility","hidden").show(),s=n.data("width"),o=r.children(".nub"),u=this.outerHeight(o),a=this.outerHeight(o),l=function(e,t,n,r,i,s){return e.css({top:t?t:"auto",bottom:r?r:"auto",left:i?i:"auto",right:n?n:"auto",width:s?s:"auto"}).end()},l(r,n.offset().top+this.outerHeight(n)+10,"auto","auto",n.offset().left,s);if(e(t).width()<767)l(r,n.offset().top+this.outerHeight(n)+10,"auto","auto",12.5,e(this.scope).width()),r.addClass("tip-override"),l(o,-u,"auto","auto",n.offset().left);else{var c=n.offset().left;Foundation.rtl&&(c=n.offset().left+n.offset().width-this.outerWidth(r)),l(r,n.offset().top+this.outerHeight(n)+10,"auto","auto",c,s),r.removeClass("tip-override"),i&&i.indexOf("tip-top")>-1?l(r,n.offset().top-this.outerHeight(r),"auto","auto",c,s).removeClass("tip-override"):i&&i.indexOf("tip-left")>-1?l(r,n.offset().top+this.outerHeight(n)/2-u*2.5,"auto","auto",n.offset().left-this.outerWidth(r)-u,s).removeClass("tip-override"):i&&i.indexOf("tip-right")>-1&&l(r,n.offset().top+this.outerHeight(n)/2-u*2.5,"auto","auto",n.offset().left+this.outerWidth(n)+u,s).removeClass("tip-override")}r.css("visibility","visible").hide()},inheritable_classes:function(t){var n=["tip-top","tip-left","tip-bottom","tip-right","noradius"].concat(this.settings.additionalInheritableClasses),r=t.attr("class"),i=r?e.map(r.split(" "),function(t,r){if(e.inArray(t,n)!==-1)return t}).join(" "):"";return e.trim(i)},show:function(e){var t=this.getTip(e);this.reposition(e,t,e.attr("class")),t.fadeIn(150)},hide:function(e){var t=this.getTip(e);t.fadeOut(150)},reload:function(){var t=e(this);return t.data("fndtn-tooltips")?t.foundationTooltips("destroy").foundationTooltips("init"):t.foundationTooltips("init")},off:function(){e(this.scope).off(".fndtn.tooltip"),e(this.settings.tooltipClass).each(function(t){e("[data-tooltip]").get(t).attr("title",e(this).text())}).remove()},reflow:function(){}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.topbar={name:"topbar",version:"4.3.2",settings:{index:0,stickyClass:"sticky",custom_back_text:!0,back_text:"Back",is_hover:!0,mobile_show_parent_link:!1,scrolltop:!0,init:!1},init:function(n,r,i){Foundation.inherit(this,"data_options addCustomRule");var s=this;return typeof r=="object"?e.extend(!0,this.settings,r):typeof i!="undefined"&&e.extend(!0,this.settings,i),typeof r!="string"?(e(".top-bar, [data-topbar]").each(function(){e.extend(!0,s.settings,s.data_options(e(this))),s.settings.$w=e(t),s.settings.$topbar=e(this),s.settings.$section=s.settings.$topbar.find("section"),s.settings.$titlebar=s.settings.$topbar.children("ul").first(),s.settings.$topbar.data("index",0);var n=s.settings.$topbar.parent();n.hasClass("fixed")||n.hasClass(s.settings.stickyClass)?(s.settings.$topbar.data("height",s.outerHeight(n)),s.settings.$topbar.data("stickyoffset",n.offset().top)):s.settings.$topbar.data("height",s.outerHeight(s.settings.$topbar));var r=e("
      ").insertAfter(s.settings.$topbar);s.settings.breakPoint=r.width(),r.remove(),s.assemble(),s.settings.is_hover&&s.settings.$topbar.find(".has-dropdown").addClass("not-click"),s.addCustomRule(".f-topbar-fixed { padding-top: "+s.settings.$topbar.data("height")+"px }"),s.settings.$topbar.parent().hasClass("fixed")&&e("body").addClass("f-topbar-fixed")}),s.settings.init||this.events(),this.settings.init):this[r].call(this,i)},toggle:function(){var n=this,r=e(".top-bar, [data-topbar]"),i=r.find("section, .section");n.breakpoint()&&(n.rtl?(i.css({right:"0%"}),i.find(">.name").css({right:"100%"})):(i.css({left:"0%"}),i.find(">.name").css({left:"100%"})),i.find("li.moved").removeClass("moved"),r.data("index",0),r.toggleClass("expanded").css("height","")),n.settings.scrolltop?r.hasClass("expanded")?r.parent().hasClass("fixed")&&(n.settings.scrolltop?(r.parent().removeClass("fixed"),r.addClass("fixed"),e("body").removeClass("f-topbar-fixed"),t.scrollTo(0,0)):r.parent().removeClass("expanded")):r.hasClass("fixed")&&(r.parent().addClass("fixed"),r.removeClass("fixed"),e("body").addClass("f-topbar-fixed")):(r.parent().hasClass(n.settings.stickyClass)&&r.parent().addClass("fixed"),r.parent().hasClass("fixed")&&(r.hasClass("expanded")?(r.addClass("fixed"),r.parent().addClass("expanded")):(r.removeClass("fixed"),r.parent().removeClass("expanded"),n.updateStickyPositioning())))},timer:null,events:function(){var r=this;e(this.scope).off(".fndtn.topbar").on("click.fndtn.topbar",".top-bar .toggle-topbar, [data-topbar] .toggle-topbar",function(e){e.preventDefault(),r.toggle()}).on("click.fndtn.topbar",".top-bar li.has-dropdown",function(t){var n=e(this),i=e(t.target),s=n.closest("[data-topbar], .top-bar"),o=s.data("topbar");if(i.data("revealId")){r.toggle();return}if(r.breakpoint())return;if(r.settings.is_hover&&!Modernizr.touch)return;t.stopImmediatePropagation(),i[0].nodeName==="A"&&i.parent().hasClass("has-dropdown")&&t.preventDefault(),n.hasClass("hover")?(n.removeClass("hover").find("li").removeClass("hover"),n.parents("li.hover").removeClass("hover")):n.addClass("hover")}).on("click.fndtn.topbar",".top-bar .has-dropdown>a, [data-topbar] .has-dropdown>a",function(n){if(r.breakpoint()&&e(t).width()!=r.settings.breakPoint){n.preventDefault();var i=e(this),s=i.closest(".top-bar, [data-topbar]"),o=s.find("section, .section"),u=i.next(".dropdown").outerHeight(),a=i.closest("li");s.data("index",s.data("index")+1),a.addClass("moved"),r.rtl?(o.css({right:-(100*s.data("index"))+"%"}),o.find(">.name").css({right:100*s.data("index")+"%"})):(o.css({left:-(100*s.data("index"))+"%"}),o.find(">.name").css({left:100*s.data("index")+"%"})),s.css("height",r.outerHeight(i.siblings("ul"),!0)+r.settings.$topbar.data("height"))}}),e(t).on("resize.fndtn.topbar",function(){if(typeof r.settings.$topbar=="undefined")return;var t=r.settings.$topbar.parent("."+this.settings.stickyClass),i;if(!r.breakpoint()){var s=r.settings.$topbar.hasClass("expanded");e(".top-bar, [data-topbar]").css("height","").removeClass("expanded").find("li").removeClass("hover"),s&&r.toggle()}t.length>0&&(t.hasClass("fixed")?(t.removeClass("fixed"),i=t.offset().top,e(n.body).hasClass("f-topbar-fixed")&&(i-=r.settings.$topbar.data("height")),r.settings.$topbar.data("stickyoffset",i),t.addClass("fixed")):(i=t.offset().top,r.settings.$topbar.data("stickyoffset",i)))}.bind(this)),e("body").on("click.fndtn.topbar",function(t){var n=e(t.target).closest("li").closest("li.hover");if(n.length>0)return;e(".top-bar li, [data-topbar] li").removeClass("hover")}),e(this.scope).on("click.fndtn",".top-bar .has-dropdown .back, [data-topbar] .has-dropdown .back",function(t){t.preventDefault();var n=e(this),i=n.closest(".top-bar, [data-topbar]"),s=i.find("section, .section"),o=n.closest("li.moved"),u=o.parent();i.data("index",i.data("index")-1),r.rtl?(s.css({right:-(100*i.data("index"))+"%"}),s.find(">.name").css({right:100*i.data("index")+"%"})):(s.css({left:-(100*i.data("index"))+"%"}),s.find(">.name").css({left:100*i.data("index")+"%"})),i.data("index")===0?i.css("height",""):i.css("height",r.outerHeight(u,!0)+r.settings.$topbar.data("height")),setTimeout(function(){o.removeClass("moved")},300)})},breakpoint:function(){return e(n).width()<=this.settings.breakPoint||e("html").hasClass("lt-ie9")},assemble:function(){var t=this;this.settings.$section.detach(),this.settings.$section.find(".has-dropdown>a").each(function(){var n=e(this),r=n.siblings(".dropdown"),i=n.attr("href");if(t.settings.mobile_show_parent_link&&i&&i.length>1)var s=e('
    2. '+n.text()+"
    3. ");else var s=e('
    4. ');t.settings.custom_back_text==1?s.find("h5>a").html(t.settings.back_text):s.find("h5>a").html("« "+n.html()),r.prepend(s)}),this.settings.$section.appendTo(this.settings.$topbar),this.sticky()},height:function(t){var n=0,r=this;return t.find("> li").each(function(){n+=r.outerHeight(e(this),!0)}),n},sticky:function(){var n=e(t),r=this;n.scroll(function(){r.updateStickyPositioning()})},updateStickyPositioning:function(){var n="."+this.settings.stickyClass,r=e(t);if(e(n).length>0){var i=this.settings.$topbar.data("stickyoffset");e(n).hasClass("expanded")||(r.scrollTop()>i?e(n).hasClass("fixed")||(e(n).addClass("fixed"),e("body").addClass("f-topbar-fixed")):r.scrollTop()<=i&&e(n).hasClass("fixed")&&(e(n).removeClass("fixed"),e("body").removeClass("f-topbar-fixed")))}},off:function(){e(this.scope).off(".fndtn.topbar"),e(t).off(".fndtn.topbar")},reflow:function(){}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.interchange={name:"interchange",version:"4.2.4",cache:{},images_loaded:!1,settings:{load_attr:"interchange",named_queries:{"default":"only screen and (min-width: 1px)",small:"only screen and (min-width: 768px)",medium:"only screen and (min-width: 1280px)",large:"only screen and (min-width: 1440px)",landscape:"only screen and (orientation: landscape)",portrait:"only screen and (orientation: portrait)",retina:"only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx)"},directives:{replace:function(e,t){if(/IMG/.test(e[0].nodeName)){var n=e[0].src;if((new RegExp(t,"i")).test(n))return;return e[0].src=t,e.trigger("replace",[e[0].src,n])}}}},init:function(t,n,r){return Foundation.inherit(this,"throttle"),typeof n=="object"&&e.extend(!0,this.settings,n),this.events(),this.images(),typeof n!="string"?this.settings.init:this[n].call(this,r)},events:function(){var n=this;e(t).on("resize.fndtn.interchange",n.throttle(function(){n.resize.call(n)},50))},resize:function(){var t=this.cache;if(!this.images_loaded){setTimeout(e.proxy(this.resize,this),50);return}for(var n in t)if(t.hasOwnProperty(n)){var r=this.results(n,t[n]);r&&this.settings.directives[r.scenario[1]](r.el,r.scenario[0])}},results:function(t,n){var r=n.length;if(r>0){var i=e('[data-uuid="'+t+'"]');for(var s=r-1;s>=0;s--){var o,u=n[s][2];this.settings.named_queries.hasOwnProperty(u)?o=matchMedia(this.settings.named_queries[u]):o=matchMedia(u);if(o.matches)return{el:i,scenario:n[s]}}}return!1},images:function(e){return typeof this.cached_images=="undefined"||e?this.update_images():this.cached_images},update_images:function(){var t=n.getElementsByTagName("img"),r=t.length,i=0,s="data-"+this.settings.load_attr;this.cached_images=[],this.images_loaded=!1;for(var o=r-1;o>=0;o--)this.loaded(e(t[o]),function(e){i++;if(e){var t=e.getAttribute(s)||"";t.length>0&&this.cached_images.push(e)}i===r&&(this.images_loaded=!0,this.enhance())}.bind(this));return"deferred"},loaded:function(e,t){function n(){t(e[0])}function r(){this.one("load",n);if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var e=this.attr("src"),t=e.match(/\?/)?"&":"?";t+="random="+(new Date).getTime(),this.attr("src",e+t)}}if(!e.attr("src")){n();return}e[0].complete||e[0].readyState===4?n():r.call(e)},enhance:function(){var n=this.images().length;for(var r=n-1;r>=0;r--)this._object(e(this.images()[r]));return e(t).trigger("resize")},parse_params:function(e,t,n){return[this.trim(e),this.convert_directive(t),this.trim(n)]},convert_directive:function(e){var t=this.trim(e);return t.length>0?t:"replace"},_object:function(e){var t=this.parse_data_attr(e),n=[],r=t.length;if(r>0)for(var i=r-1;i>=0;i--){var s=t[i].split(/\((.*?)(\))$/);if(s.length>1){var o=s[0].split(","),u=this.parse_params(o[0],o[1],s[1]);n.push(u)}}return this.store(e,n)},uuid:function(e){function n(){return((1+Math.random())*65536|0).toString(16).substring(1)}var t=e||"-";return n()+n()+t+n()+t+n()+t+n()+t+n()+n()+n()},store:function(e,t){var n=this.uuid(),r=e.data("uuid");return r?this.cache[r]:(e.attr("data-uuid",n),this.cache[n]=t)},trim:function(t){return typeof t=="string"?e.trim(t):t},parse_data_attr:function(e){var t=e.data(this.settings.load_attr).split(/\[(.*?)\]/),n=t.length,r=[];for(var i=n-1;i>=0;i--)t[i].replace(/[\W\d]+/,"").length>4&&r.push(t[i]);return r},reflow:function(){this.images(!0)}}}(Foundation.zj,this,this.document),function(e){"use strict";function t(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent)return e.attachEvent("on"+t,n)}function n(e,t){var n,r;for(n=0,r=e.length;n=0;r--)n.push(this.pattern(e[r]));return this.check_validation_and_apply_styles(n)},pattern:function(e){var t=e.getAttribute("type"),n=typeof e.getAttribute("required")=="string";if(this.settings.patterns.hasOwnProperty(t))return[e,this.settings.patterns[t],n];var r=e.getAttribute("pattern")||"";return this.settings.patterns.hasOwnProperty(r)&&r.length>0?[e,this.settings.patterns[r],n]:r.length>0?[e,new RegExp(r),n]:(r=/.*/,[e,r,n])},check_validation_and_apply_styles:function(t){var n=t.length,r=[];for(var i=n-1;i>=0;i--){var s=t[i][0],o=t[i][2],u=s.value,a=s.type==="radio",f=o?s.value.length>0:!0;a&&o?r.push(this.valid_radio(s,o)):t[i][1].test(u)&&f||!o&&s.value.length<1?(e(s).removeAttr("data-invalid").parent().removeClass("error"),r.push(!0)):(e(s).attr("data-invalid","").parent().addClass("error"),r.push(!1))}return r},valid_radio:function(t,r){var i=t.getAttribute("name"),s=n.getElementsByName(i),o=s.length,u=!1;for(var a=0;a holds reference to the FIRST focusable element inside modal * [1] => holds reference to the LAST focusable element inside modal */ var consent_modal_focusable = []; var settings_modal_focusable = []; /** * Keep track of enabled/disabled categories * @type {boolean[]} */ var toggle_states = []; /** * Stores all available categories * @type {string[]} */ var all_categories = []; /** * Keep track of readonly toggles * @type {boolean[]} */ var readonly_categories = []; /** * Pointers to main dom elements (to avoid retrieving them later using document.getElementById) */ var /** @type {HTMLElement} */ html_dom = document.documentElement, /** @type {HTMLElement} */ main_container, /** @type {HTMLElement} */ all_modals_container, /** @type {HTMLElement} */ consent_modal, /** @type {HTMLElement} */ consent_modal_title, /** @type {HTMLElement} */ consent_modal_description, /** @type {HTMLElement} */ consent_primary_btn, /** @type {HTMLElement} */ consent_secondary_btn, /** @type {HTMLElement} */ consent_tertiary_btn, /** @type {HTMLElement} */ consent_buttons, /** @type {HTMLElement} */ consent_modal_inner, /** @type {HTMLElement} */ settings_container, /** @type {HTMLElement} */ settings_inner, /** @type {HTMLElement} */ settings_title, /** @type {HTMLElement} */ settings_close_btn, /** @type {HTMLElement} */ settings_blocks, /** @type {HTMLElement} */ new_settings_blocks, /** @type {HTMLElement} */ settings_buttons, /** @type {HTMLElement} */ settings_save_btn, /** @type {HTMLElement} */ settings_accept_all_btn, /** @type {HTMLElement} */ settings_reject_all_btn; /** * Update config settings * @param {Object} user_config */ var _setConfig = function(_user_config){ /** * Make user configuration globally available */ user_config = _user_config; _log("CookieConsent [CONFIG]: received_config_settings ", user_config); if(typeof user_config['cookie_expiration'] === "number") _config.cookie_expiration = user_config['cookie_expiration']; if(typeof user_config['cookie_necessary_only_expiration'] === "number") _config.cookie_necessary_only_expiration = user_config['cookie_necessary_only_expiration']; if(typeof user_config['autorun'] === "boolean") _config.autorun = user_config['autorun']; if(typeof user_config['cookie_domain'] === "string") _config.cookie_domain = user_config['cookie_domain']; if(typeof user_config['cookie_same_site'] === "string") _config.cookie_same_site = user_config['cookie_same_site']; if(typeof user_config['cookie_path'] === "string") _config.cookie_path = user_config['cookie_path']; if(typeof user_config['cookie_name'] === "string") _config.cookie_name = user_config['cookie_name']; if(typeof user_config['onAccept'] === "function") onAccept = user_config['onAccept']; if(typeof user_config['onFirstAction'] === "function") onFirstAction = user_config['onFirstAction']; if(typeof user_config['onChange'] === "function") onChange = user_config['onChange']; if(user_config['mode'] === 'opt-out') _config.mode = 'opt-out'; if(typeof user_config['revision'] === "number"){ user_config['revision'] > -1 && (_config.revision = user_config['revision']); revision_enabled = true; } if(typeof user_config['autoclear_cookies'] === "boolean") _config.autoclear_cookies = user_config['autoclear_cookies']; if(user_config['use_rfc_cookie'] === true) _config.use_rfc_cookie = true; if(user_config['hide_from_bots'] === true){ is_bot = navigator && ((navigator.userAgent && /bot|crawl|spider|slurp|teoma/i.test(navigator.userAgent)) || navigator.webdriver); } _config.page_scripts = user_config['page_scripts'] === true; if (user_config['auto_language'] === 'browser' || user_config['auto_language'] === true) { _config.auto_language = 'browser'; } else if (user_config['auto_language'] === 'document') { _config.auto_language = 'document'; } _log("CookieConsent [LANG]: auto_language strategy is '" + _config.auto_language + "'"); _config.current_lang = _resolveCurrentLang(user_config.languages, user_config['current_lang']); } // /** // * Print consent date // */ // var _printConsentDateHTML = function(){ // if(!consent_date) return; // var consent_date_elements = document.querySelectorAll('[data-cc="consent-date"]'); // var last_consent_update_elements = document.querySelectorAll('[data-cc="last-consent-update"]'); // for(var i=0; i} */ function _getElements(data_role){ return (elem || document).querySelectorAll('a[data-cc="' + data_role + '"], button[data-cc="' + data_role + '"]'); } /** * Helper function: accept and then hide modals * @param {PointerEvent} e source event * @param {string} [accept_type] */ function _acceptAction(e, accept_type){ e.preventDefault(); _cookieconsent.accept(accept_type); _cookieconsent.hideSettings(); _cookieconsent.hide(); } //_printConsentDateHTML(); } /** * Get a valid language (at least 1 must be defined) * @param {string} lang - desired language * @param {Object} all_languages - all defined languages * @returns {string} validated language */ var _getValidatedLanguage = function(lang, all_languages){ if(Object.prototype.hasOwnProperty.call(all_languages, lang)){ return lang; }else if(_getKeys(all_languages).length > 0){ if(Object.prototype.hasOwnProperty.call(all_languages, _config.current_lang)){ return _config.current_lang ; }else{ return _getKeys(all_languages)[0]; } } } /** * Save reference to first and last focusable elements inside each modal * to prevent losing focus while navigating with TAB */ var _getModalFocusableData = function(){ /** * Note: any of the below focusable elements, which has the attribute tabindex="-1" AND is either * the first or last element of the modal, won't receive focus during "open/close" modal */ var allowed_focusable_types = ['[href]', 'button', 'input', 'details', '[tabindex="0"]']; function _getAllFocusableElements(modal, _array){ var focus_later=false, focus_first=false; // ie might throw exception due to complex unsupported selector => a:not([tabindex="-1"]) try{ var focusable_elems = modal.querySelectorAll(allowed_focusable_types.join(':not([tabindex="-1"]), ')); var attr, len=focusable_elems.length, i=0; while(i < len){ attr = focusable_elems[i].getAttribute('data-focus'); if(!focus_first && attr === "1"){ focus_first = focusable_elems[i]; }else if(attr === "0"){ focus_later = focusable_elems[i]; if(!focus_first && focusable_elems[i+1].getAttribute('data-focus') !== "0"){ focus_first = focusable_elems[i+1]; } } i++; } }catch(e){ return modal.querySelectorAll(allowed_focusable_types.join(', ')); } /** * Save first and last elements (used to lock/trap focus inside modal) */ _array[0] = focusable_elems[0]; _array[1] = focusable_elems[focusable_elems.length - 1]; _array[2] = focus_later; _array[3] = focus_first; } /** * Get settings modal'S all focusable elements * Save first and last elements (used to lock/trap focus inside modal) */ _getAllFocusableElements(settings_inner, settings_modal_focusable); /** * If consent modal exists, do the same */ if(consent_modal_exists){ _getAllFocusableElements(consent_modal, consent_modal_focusable); } } var _createConsentModal = function(lang){ if(user_config['force_consent'] === true) _addClass(html_dom, 'force--consent'); // Create modal if it doesn't exist if(!consent_modal){ consent_modal = _createNode('div'); var consent_modal_inner_inner = _createNode('div'); var overlay = _createNode('div'); consent_modal.id = 'cm'; consent_modal_inner_inner.id = 'c-inr-i'; overlay.id = 'cm-ov'; consent_modal.setAttribute('role', 'dialog'); consent_modal.setAttribute('aria-modal', 'true'); consent_modal.setAttribute('aria-hidden', 'false'); consent_modal.setAttribute('aria-labelledby', 'c-ttl'); consent_modal.setAttribute('aria-describedby', 'c-txt'); // Append consent modal to main container all_modals_container.appendChild(consent_modal); all_modals_container.appendChild(overlay); /** * Make modal by default hidden to prevent weird page jumps/flashes (shown only once css is loaded) */ consent_modal.style.visibility = overlay.style.visibility = "hidden"; overlay.style.opacity = 0; } // Use insertAdjacentHTML instead of innerHTML var consent_modal_title_value = user_config.languages[lang]['consent_modal']['title']; // Add title (if valid) if(consent_modal_title_value){ if(!consent_modal_title){ consent_modal_title = _createNode('div'); consent_modal_title.id = 'c-ttl'; consent_modal_title.setAttribute('role', 'heading'); consent_modal_title.setAttribute('aria-level', '2'); consent_modal_inner_inner.appendChild(consent_modal_title); } consent_modal_title.innerHTML = consent_modal_title_value; } var description = user_config.languages[lang]['consent_modal']['description']; if(revision_enabled){ if(!valid_revision){ description = description.replace("{{revision_message}}", revision_message || user_config.languages[lang]['consent_modal']['revision_message'] || ""); }else{ description = description.replace("{{revision_message}}", ""); } } if(!consent_modal_description){ consent_modal_description = _createNode('div'); consent_modal_description.id = 'c-txt'; consent_modal_inner_inner.appendChild(consent_modal_description); } // Set description content consent_modal_description.innerHTML = description; var primary_btn_data = user_config.languages[lang]['consent_modal']['primary_btn'], // accept current selection secondary_btn_data = user_config.languages[lang]['consent_modal']['secondary_btn'], tertiary_btn_data = user_config.languages[lang]['consent_modal']['tertiary_btn']; // Add primary button if not falsy if(primary_btn_data){ if(!consent_primary_btn){ consent_primary_btn = _createNode('button'); consent_primary_btn.id = 'c-p-bn'; consent_primary_btn.className = "c-bn"; var _accept_type; if(primary_btn_data['role'] === 'accept_all') _accept_type = 'all' _addEvent(consent_primary_btn, "click", function(){ _cookieconsent.hide(); _log("CookieConsent [ACCEPT]: cookie_consent was accepted!"); _cookieconsent.accept(_accept_type); }); } consent_primary_btn.innerHTML = user_config.languages[lang]['consent_modal']['primary_btn']['text']; } // Add secondary button if not falsy if(secondary_btn_data){ if(!consent_secondary_btn){ consent_secondary_btn = _createNode('button'); consent_secondary_btn.id = 'c-s-bn'; consent_secondary_btn.className = "c-bn"; if(secondary_btn_data['role'] === 'reject_all') _addEvent(consent_secondary_btn, 'click', function(){ _cookieconsent.hide(); _cookieconsent.accept([]); }); } consent_secondary_btn.innerHTML = user_config.languages[lang]['consent_modal']['secondary_btn']['text']; } // Add tertiary button if not falsy if(tertiary_btn_data){ if(!consent_tertiary_btn){ consent_tertiary_btn = _createNode('button'); consent_tertiary_btn.id = 'c-t-bn'; consent_tertiary_btn.className = "c-bn c_link"; if(tertiary_btn_data['role'] === 'accept_necessary'){ _addEvent(consent_tertiary_btn, 'click', function(){ _cookieconsent.hide(); _cookieconsent.accept([]); // accept necessary only }); }else{ _addEvent(consent_tertiary_btn, 'click', function(){ _cookieconsent.showSettings(0); }); } } consent_tertiary_btn.innerHTML = user_config.languages[lang]['consent_modal']['tertiary_btn']['text']; } // Swap buttons var gui_options_data = user_config['gui_options']; if(!consent_modal_inner){ consent_modal_inner = _createNode('div'); consent_modal_inner.id = 'c-inr'; consent_modal_inner.appendChild(consent_modal_inner_inner); } if(!consent_buttons){ consent_buttons = _createNode('div'); consent_buttons.id = "c-bns"; if(gui_options_data && gui_options_data['consent_modal'] && gui_options_data['consent_modal']['swap_buttons'] === true){ tertiary_btn_data && consent_buttons.appendChild(consent_tertiary_btn); secondary_btn_data && consent_buttons.appendChild(consent_secondary_btn); primary_btn_data && consent_buttons.appendChild(consent_primary_btn); consent_buttons.className = 'swap'; }else{ primary_btn_data && consent_buttons.appendChild(consent_primary_btn); secondary_btn_data && consent_buttons.appendChild(consent_secondary_btn); tertiary_btn_data && consent_buttons.appendChild(consent_tertiary_btn); } (primary_btn_data || secondary_btn_data || tertiary_btn_data ) && consent_modal_inner.appendChild(consent_buttons); consent_modal.appendChild(consent_modal_inner); } consent_modal_exists = true; } var _createSettingsModal = function(lang){ /** * Create all consent_modal elements */ if(!settings_container){ settings_container = _createNode('div'); var settings_container_valign = _createNode('div'); var settings = _createNode('div'); var settings_container_inner = _createNode('div'); settings_inner = _createNode('div'); settings_title = _createNode('div'); var settings_header = _createNode('div'); settings_close_btn = _createNode('button'); var settings_close_btn_container = _createNode('div'); settings_blocks = _createNode('div'); var overlay = _createNode('div'); /** * Set ids */ settings_container.id = 's-cnt'; settings_container_valign.id = "c-vln"; settings_container_inner.id = "c-s-in"; settings.id = "cs"; settings_title.id = 's-ttl'; settings_inner.id = 's-inr'; settings_header.id = "s-hdr"; settings_blocks.id = 's-bl'; settings_close_btn.id = 's-c-bn'; overlay.id = 'cs-ov'; settings_close_btn_container.id = 's-c-bnc'; settings_close_btn.className = 'c-bn'; settings_container.setAttribute('role', 'dialog'); settings_container.setAttribute('aria-modal', 'true'); settings_container.setAttribute('aria-hidden', 'true'); settings_container.setAttribute('aria-labelledby', 's-ttl'); settings_title.setAttribute('role', 'heading'); settings_container.style.visibility = overlay.style.visibility = "hidden"; overlay.style.opacity = 0; settings_close_btn_container.appendChild(settings_close_btn); // If 'esc' key is pressed inside settings_container div => hide settings _addEvent(settings_container_valign, 'keydown', function(evt){ evt = evt || window.event; if (evt.keyCode === 27) { _cookieconsent.hideSettings(0); } }, true); _addEvent(settings_close_btn, 'click', function(){ _cookieconsent.hideSettings(0); }); }else{ new_settings_blocks = _createNode('div'); new_settings_blocks.id = 's-bl'; } // Add label to close button settings_close_btn.setAttribute('aria-label', user_config.languages[lang]['settings_modal']['close_btn_label'] || 'Close'); all_blocks = user_config.languages[lang]['settings_modal']['blocks']; all_table_headers = user_config.languages[lang]['settings_modal']['cookie_table_headers']; var n_blocks = all_blocks.length; // Set settings modal title settings_title.innerHTML = user_config.languages[lang]['settings_modal']['title']; // Create settings modal content (blocks) for(var i=0; i retrieve category states from cookie * Otherwise use states defined in the user_config. object */ if(!invalid_consent){ if(_inArray(saved_cookie_content['categories'], cookie_category) > -1){ block_switch.checked = true; !new_settings_blocks && toggle_states.push(true); }else{ !new_settings_blocks && toggle_states.push(false); } }else if(toggle_data['enabled']){ block_switch.checked = true; !new_settings_blocks && toggle_states.push(true); /** * Keep track of categories enabled by default (useful when mode=='opt-out') */ if(toggle_data['enabled']) !new_settings_blocks && default_enabled_categories.push(cookie_category); }else{ !new_settings_blocks && toggle_states.push(false); } !new_settings_blocks && all_categories.push(cookie_category); /** * Set toggle as readonly if true (disable checkbox) */ if(toggle_data['readonly']){ block_switch.disabled = true; _addClass(block_switch_span, 'c-ro'); !new_settings_blocks && readonly_categories.push(true); }else{ !new_settings_blocks && readonly_categories.push(false); } _addClass(block_table_container, 'b-acc'); _addClass(block_title_container, 'b-bn'); _addClass(block_section, 'b-ex'); block_table_container.id = accordion_id; block_table_container.setAttribute('aria-hidden', 'true'); block_switch_label.appendChild(block_switch); block_switch_label.appendChild(block_switch_span); block_switch_label.appendChild(label_text_span); block_title_container.appendChild(block_switch_label); /** * On button click handle the following :=> aria-expanded, aria-hidden and act class for current block */ isExpandable && (function(accordion, block_section, btn){ _addEvent(block_title_btn, 'click', function(){ if(!_hasClass(block_section, 'act')){ _addClass(block_section, 'act'); btn.setAttribute('aria-expanded', 'true'); accordion.setAttribute('aria-hidden', 'false'); }else{ _removeClass(block_section, 'act'); btn.setAttribute('aria-expanded', 'false'); accordion.setAttribute('aria-hidden', 'true'); } }, false); })(block_table_container, block_section, block_title_btn); }else{ /** * If block is not a button (no toggle defined), * create a simple div instead */ if(title_data){ var block_title = _createNode('div'); block_title.className = 'b-tl'; block_title.setAttribute('role', 'heading'); block_title.setAttribute('aria-level', '3'); block_title.insertAdjacentHTML('beforeend', title_data); block_title_container.appendChild(block_title); } } title_data && block_section.appendChild(block_title_container); description_data && block_table_container.appendChild(block_desc); // if cookie table found, generate table for this block if(!remove_cookie_tables && typeof cookie_table_data !== 'undefined'){ var tr_tmp_fragment = document.createDocumentFragment(); /** * Use custom table headers */ for(var p=0; p ~faster value retrieval) var curr_block = all_blocks[i]; // If current block has a toggle for opt in/out if(Object.prototype.hasOwnProperty.call(curr_block, "toggle")){ // if current block has a cookie table, an off toggle, // and its preferences were just changed => delete cookies var category_just_disabled = _inArray(changed_settings, curr_block['toggle']['value']) > -1; if( !toggle_states[++count] && Object.prototype.hasOwnProperty.call(curr_block, "cookie_table") && (clearOnFirstAction || category_just_disabled) ){ var curr_cookie_table = curr_block['cookie_table']; // Get first property name var ckey = _getKeys(all_table_headers[0])[0]; // Get number of cookies defined in cookie_table var clen = curr_cookie_table.length; // set "reload_page" to true if reload=on_disable if(curr_block['toggle']['reload'] === 'on_disable') category_just_disabled && (reload_page = true); // for each row defined in the cookie table for(var j=0; j filter cookie array if(is_regex){ for(var n=0; n -1) found_cookies.push(all_cookies_array[found_index]); } _log("CookieConsent [AUTOCLEAR]: search cookie: '" + curr_cookie_name + "', found:", found_cookies); // If cookie exists -> delete it if(found_cookies.length > 0){ _eraseCookies(found_cookies, curr_cookie_path, domains); curr_block['toggle']['reload'] === 'on_clear' && (reload_page = true); } } } } } } /** * Set toggles/checkboxes based on accepted categories and save cookie * @param {string[]} accepted_categories - Array of categories to accept */ var _saveCookiePreferences = function(accepted_categories){ changed_settings = []; // Retrieve all toggle/checkbox values var category_toggles = document.querySelectorAll('.c-tgl') || []; // If there are opt in/out toggles ... if(category_toggles.length > 0){ for(var i=0; i 0) _autoclearCookies(); if(!consent_date) consent_date = new Date(); if(!consent_uuid) consent_uuid = _uuidv4(); saved_cookie_content = { "categories": accepted_categories, "revision": _config.revision, "data": cookie_data, "rfc_cookie": _config.use_rfc_cookie, "consent_date": consent_date.toISOString(), "consent_uuid": consent_uuid } // save cookie with preferences 'categories' (only if never accepted or settings were updated) if(invalid_consent || changed_settings.length > 0){ valid_revision = true; /** * Update "last_consent_update" only if it is invalid (after t) */ if(!last_consent_update) last_consent_update = consent_date; else last_consent_update = new Date(); saved_cookie_content['last_consent_update'] = last_consent_update.toISOString(); /** * Update accept type */ accept_type = _getAcceptType(_getCurrentCategoriesState()); _setCookie(_config.cookie_name, JSON.stringify(saved_cookie_content)); _manageExistingScripts(); //_printConsentDateHTML(); } if(invalid_consent){ /** * Delete unused/"zombie" cookies if consent is not valid (not yet expressed or cookie has expired) */ if(_config.autoclear_cookies) _autoclearCookies(true); if(typeof onFirstAction === 'function') onFirstAction(_cookieconsent.getUserPreferences(), saved_cookie_content); if(typeof onAccept === 'function') onAccept(saved_cookie_content); /** * Set consent as valid */ invalid_consent = false; if(_config.mode === 'opt-in') return; } // fire onChange only if settings were changed if(typeof onChange === "function" && changed_settings.length > 0) onChange(saved_cookie_content, changed_settings); /** * reload page if needed */ if(reload_page) window.location.reload(); } /** * Returns index of found element inside array, otherwise -1 * @param {Array} arr * @param {Object} value * @returns {number} */ var _inArray = function(arr, value){ return arr.indexOf(value); } /** * Helper function which prints info (console.log()) * @param {Object} print_msg * @param {Object} [optional_param] */ var _log = function(print_msg, optional_param, error){ ENABLE_LOGS && (!error ? console.log(print_msg, optional_param !== undefined ? optional_param : ' ') : console.error(print_msg, optional_param || "")); } /** * Helper function which creates an HTMLElement object based on 'type' and returns it. * @param {string} type * @returns {HTMLElement} */ var _createNode = function(type){ var el = document.createElement(type); if(type === 'button'){ el.setAttribute('type', type); } return el; } /** * Generate RFC4122-compliant UUIDs. * https://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid?page=1&tab=votes#tab-top * @returns {string} */ var _uuidv4 = function(){ return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, function(c){ return (c ^ (window.crypto || window.msCrypto).getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) }); } /** * Resolve which language should be used. * * @param {Object} languages Object with language translations * @param {string} [requested_language] Language specified by given configuration parameters * @returns {string} */ var _resolveCurrentLang = function (languages, requested_language) { if (_config.auto_language === 'browser') { return _getValidatedLanguage(_getBrowserLang(), languages); } else if (_config.auto_language === 'document') { return _getValidatedLanguage(document.documentElement.lang, languages); } else { if (typeof requested_language === 'string') { return _config.current_lang = _getValidatedLanguage(requested_language, languages); } } _log("CookieConsent [LANG]: setting current_lang = '" + _config.current_lang + "'"); return _config.current_lang; // otherwise return default } /** * Get current client's browser language * @returns {string} */ var _getBrowserLang = function(){ var browser_lang = navigator.language || navigator.browserLanguage; browser_lang.length > 2 && (browser_lang = browser_lang[0]+browser_lang[1]); _log("CookieConsent [LANG]: detected_browser_lang = '"+ browser_lang + "'"); return browser_lang.toLowerCase() } /** * Trap focus inside modal and focus the first * focusable element of current active modal */ var _handleFocusTrap = function(){ var tabbedOutsideDiv = false; var tabbedInsideModal = false; _addEvent(document, 'keydown', function(e){ e = e || window.event; // If is tab key => ok if(e.key !== 'Tab') return; // If there is any modal to focus if(current_modal_focusable){ // If reached natural end of the tab sequence => restart if(e.shiftKey){ if (document.activeElement === current_modal_focusable[0]) { current_modal_focusable[1].focus(); e.preventDefault(); } }else{ if (document.activeElement === current_modal_focusable[1]) { current_modal_focusable[0].focus(); e.preventDefault(); } } // If have not yet used tab (or shift+tab) and modal is open ... // Focus the first focusable element if(!tabbedInsideModal && !clicked_inside_modal){ tabbedInsideModal = true; !tabbedOutsideDiv && e.preventDefault(); if(e.shiftKey){ if(current_modal_focusable[3]){ if(!current_modal_focusable[2]){ current_modal_focusable[0].focus(); }else{ current_modal_focusable[2].focus(); } }else{ current_modal_focusable[1].focus(); } }else{ if(current_modal_focusable[3]){ current_modal_focusable[3].focus(); }else{ current_modal_focusable[0].focus(); } } } } !tabbedInsideModal && (tabbedOutsideDiv = true); }); if(document.contains){ _addEvent(main_container, 'click', function(e){ e = e || window.event; /** * If click is on the foreground overlay (and not inside settings_modal), * hide settings modal * * Notice: click on div is not supported in IE */ if(settings_modal_visible){ if(!settings_inner.contains(e.target)){ _cookieconsent.hideSettings(0); clicked_inside_modal = false; }else{ clicked_inside_modal = true; } }else if(consent_modal_visible){ if(consent_modal.contains(e.target)){ clicked_inside_modal = true; } } }, true); } } /** * Manage each modal's layout * @param {Object} gui_options */ var _guiManager = function(gui_options, only_consent_modal){ // If gui_options is not object => exit if(typeof gui_options !== 'object') return; var consent_modal_options = gui_options['consent_modal']; var settings_modal_options = gui_options['settings_modal']; /** * Helper function which adds layout and * position classes to given modal * * @param {HTMLElement} modal * @param {string[]} allowed_layouts * @param {string[]} allowed_positions * @param {string} layout * @param {string[]} position */ function _setLayout(modal, allowed_layouts, allowed_positions, allowed_transitions, layout, position, transition){ position = (position && position.split(" ")) || []; // Check if specified layout is valid if(_inArray(allowed_layouts, layout) > -1){ // Add layout classes _addClass(modal, layout); // Add position class (if specified) if(!(layout === 'bar' && position[0] === 'middle') && _inArray(allowed_positions, position[0]) > -1){ for(var i=0; i -1) && _addClass(modal, transition); } if(consent_modal_exists && consent_modal_options){ _setLayout( consent_modal, ['box', 'bar', 'cloud'], ['top', 'middle', 'bottom'], ['zoom', 'slide'], consent_modal_options['layout'], consent_modal_options['position'], consent_modal_options['transition'] ); } if(!only_consent_modal && settings_modal_options){ _setLayout( settings_container, ['bar'], ['left', 'right'], ['zoom', 'slide'], settings_modal_options['layout'], settings_modal_options['position'], settings_modal_options['transition'] ); } } /** * Returns true if cookie category is accepted by the user * @param {string} cookie_category * @returns {boolean} */ _cookieconsent.allowedCategory = function(cookie_category){ if(!invalid_consent || _config.mode === 'opt-in') var allowed_categories = JSON.parse(_getCookie(_config.cookie_name, 'one', true) || '{}')['categories'] || [] else // mode is 'opt-out' var allowed_categories = default_enabled_categories; return _inArray(allowed_categories, cookie_category) > -1; } /** * "Init" method. Will run once and only if modals do not exist */ _cookieconsent.run = function(user_config){ if(!document.getElementById('cc_div')){ // configure all parameters _setConfig(user_config); // if is bot, don't run plugin if(is_bot) return; // Retrieve cookie value (if set) saved_cookie_content = JSON.parse(_getCookie(_config.cookie_name, 'one', true) || "{}"); // Retrieve "consent_uuid" consent_uuid = saved_cookie_content['consent_uuid']; // If "consent_uuid" is present => assume that consent was previously given var cookie_consent_accepted = consent_uuid !== undefined; // Retrieve "consent_date" consent_date = saved_cookie_content['consent_date']; consent_date && (consent_date = new Date(consent_date)); // Retrieve "last_consent_update" last_consent_update = saved_cookie_content['last_consent_update']; last_consent_update && (last_consent_update = new Date(last_consent_update)); // Retrieve "data" cookie_data = saved_cookie_content['data'] !== undefined ? saved_cookie_content['data'] : null; // If revision is enabled and current value !== saved value inside the cookie => revision is not valid if(revision_enabled && saved_cookie_content['revision'] !== _config.revision){ valid_revision = false; } // If consent is not valid => create consent modal consent_modal_exists = invalid_consent = (!cookie_consent_accepted || !valid_revision || !consent_date || !last_consent_update || !consent_uuid); // Generate cookie-settings dom (& consent modal) _createCookieConsentHTML(); _getModalFocusableData(); _guiManager(user_config['gui_options']); _addDataButtonListeners(); if(_config.autorun && consent_modal_exists){ _cookieconsent.show(user_config['delay'] || 0); } // Add class to enable animations/transitions setTimeout(function(){_addClass(main_container, 'c--anim');}, 30); // Accessibility :=> if tab pressed => trap focus inside modal setTimeout(function(){_handleFocusTrap();}, 100); // If consent is valid if(!invalid_consent){ var rfc_prop_exists = typeof saved_cookie_content['rfc_cookie'] === "boolean"; /* * Convert cookie to rfc format (if `use_rfc_cookie` is enabled) */ if(!rfc_prop_exists || (rfc_prop_exists && saved_cookie_content['rfc_cookie'] !== _config.use_rfc_cookie)){ saved_cookie_content['rfc_cookie'] = _config.use_rfc_cookie; _setCookie(_config.cookie_name, JSON.stringify(saved_cookie_content)); } /** * Update accept type */ accept_type = _getAcceptType(_getCurrentCategoriesState()); _manageExistingScripts(); if(typeof onAccept === 'function') onAccept(saved_cookie_content); _log("CookieConsent [NOTICE]: consent already given!", saved_cookie_content); }else{ if(_config.mode === 'opt-out'){ _log("CookieConsent [CONFIG] mode='" + _config.mode + "', default enabled categories:", default_enabled_categories); _manageExistingScripts(default_enabled_categories); } _log("CookieConsent [NOTICE]: ask for consent!"); } }else{ _log("CookieConsent [NOTICE]: cookie consent already attached to body!"); } } /** * Show settings modal (with optional delay) * @param {number} delay */ _cookieconsent.showSettings = function(delay){ setTimeout(function() { _addClass(html_dom, "show--settings"); settings_container.setAttribute('aria-hidden', 'false'); settings_modal_visible = true; /** * Set focus to the first focusable element inside settings modal */ setTimeout(function(){ // If there is no consent-modal, keep track of the last focused elem. if(!consent_modal_visible){ last_elem_before_modal = document.activeElement; }else{ last_consent_modal_btn_focus = document.activeElement; } if (settings_modal_focusable.length === 0) return; if(settings_modal_focusable[3]){ settings_modal_focusable[3].focus(); }else{ settings_modal_focusable[0].focus(); } current_modal_focusable = settings_modal_focusable; }, 200); _log("CookieConsent [SETTINGS]: show settings_modal"); }, delay > 0 ? delay : 0); } /** * This function handles the loading/activation logic of the already * existing scripts based on the current accepted cookie categories * * @param {string[]} [must_enable_categories] */ var _manageExistingScripts = function(must_enable_categories){ if(!_config.page_scripts) return; // get all the scripts with "cookie-category" attribute var scripts = document.querySelectorAll('script[' + _config.script_selector + ']'); var accepted_categories = must_enable_categories || saved_cookie_content['categories'] || []; /** * Load scripts (sequentially), using a recursive function * which loops through the scripts array * @param {Element[]} scripts scripts to load * @param {number} index current script to load */ var _loadScripts = function(scripts, index){ if(index < scripts.length){ var curr_script = scripts[index]; var curr_script_category = curr_script.getAttribute(_config.script_selector); /** * If current script's category is on the array of categories * accepted by the user => load script */ if(_inArray(accepted_categories, curr_script_category) > -1){ curr_script.type = 'text/javascript'; curr_script.removeAttribute(_config.script_selector); // get current script data-src var src = curr_script.getAttribute('data-src'); // some scripts (like ga) might throw warning if data-src is present src && curr_script.removeAttribute('data-src'); // create fresh script (with the same code) var fresh_script = _createNode('script'); fresh_script.textContent = curr_script.innerHTML; // Copy attributes over to the new "revived" script (function(destination, source){ var attributes = source.attributes; var len = attributes.length; for(var i=0; i the next script will not be loaded // until the current's script onload event triggers if(fresh_script.readyState) { // only required for IE <9 fresh_script.onreadystatechange = function() { if (fresh_script.readyState === "loaded" || fresh_script.readyState === "complete" ) { fresh_script.onreadystatechange = null; _loadScripts(scripts, ++index); } }; }else{ // others fresh_script.onload = function(){ fresh_script.onload = null; _loadScripts(scripts, ++index); }; } } // Replace current "sleeping" script with the new "revived" one curr_script.parentNode.replaceChild(fresh_script, curr_script); /** * If we managed to get here and scr is still set, it means that * the script is loading/loaded sequentially so don't go any further */ if(src) return; } // Go to next script right away _loadScripts(scripts, ++index); } } _loadScripts(scripts, 0); } /** * Save custom data inside cookie * @param {object|string} new_data * @param {string} [mode] * @returns {boolean} */ var _setCookieData = function(new_data, mode){ var set = false; /** * If mode is 'update': * add/update only the specified props. */ if(mode === 'update'){ cookie_data = _cookieconsent.get('data'); var same_type = typeof cookie_data === typeof new_data; if(same_type && typeof cookie_data === "object"){ !cookie_data && (cookie_data = {}); for(var prop in new_data){ if(cookie_data[prop] !== new_data[prop]){ cookie_data[prop] = new_data[prop] set = true; } } }else if((same_type || !cookie_data) && cookie_data !== new_data){ cookie_data = new_data; set = true; } }else{ cookie_data = new_data; set = true; } if(set){ saved_cookie_content['data'] = cookie_data; _setCookie(_config.cookie_name, JSON.stringify(saved_cookie_content)); } return set; } /** * Helper method to set a variety of fields * @param {string} field * @param {object} data * @returns {boolean} */ _cookieconsent.set = function(field, data){ switch(field){ case 'data': return _setCookieData(data['value'], data['mode']); default: return false; } } /** * Retrieve data from existing cookie * @param {string} field * @param {string} [cookie_name] * @returns {any} */ _cookieconsent.get = function(field, cookie_name){ var cookie = JSON.parse(_getCookie(cookie_name || _config.cookie_name, 'one', true) || "{}"); return cookie[field]; } /** * Read current configuration value * @returns {any} */ _cookieconsent.getConfig = function(field){ return _config[field] || user_config[field]; } /** * Obtain accepted and rejected categories * @returns {{accepted: string[], rejected: string[]}} */ var _getCurrentCategoriesState = function(){ // get accepted categories accepted_categories = saved_cookie_content['categories'] || []; // calculate rejected categories (all_categories - accepted_categories) rejected_categories = all_categories.filter(function(category){ return (_inArray(accepted_categories, category) === -1); }); return { accepted: accepted_categories, rejected: rejected_categories } } /** * Calculate "accept type" given current categories state * @param {{accepted: string[], rejected: string[]}} currentCategoriesState * @returns {string} */ var _getAcceptType = function(currentCategoriesState){ var type = 'custom'; // number of categories marked as necessary/readonly var necessary_categories_length = readonly_categories.filter(function(readonly){ return readonly === true; }).length; // calculate accept type based on accepted/rejected categories if(currentCategoriesState.accepted.length === all_categories.length) type = 'all'; else if(currentCategoriesState.accepted.length === necessary_categories_length) type = 'necessary' return type; } /** * @typedef {object} userPreferences * @property {string} accept_type * @property {string[]} accepted_categories * @property {string[]} rejected_categories */ /** * Retrieve current user preferences (summary) * @returns {userPreferences} */ _cookieconsent.getUserPreferences = function(){ var currentCategoriesState = _getCurrentCategoriesState(); var accept_type = _getAcceptType(currentCategoriesState); return { 'accept_type': accept_type, 'accepted_categories': currentCategoriesState.accepted, 'rejected_categories': currentCategoriesState.rejected } } /** * Function which will run after script load * @callback scriptLoaded */ /** * Dynamically load script (append to head) * @param {string} src * @param {scriptLoaded} callback * @param {object[]} [attrs] Custom attributes */ _cookieconsent.loadScript = function(src, callback, attrs){ var function_defined = typeof callback === 'function'; // Load script only if not already loaded if(!document.querySelector('script[src="' + src + '"]')){ var script = _createNode('script'); // if an array is provided => add custom attributes if(attrs && attrs.length > 0){ for(var i=0; i run callback onload if(function_defined){ script.onload = callback; } script.src = src; /** * Append script to head */ document.head.appendChild(script); }else{ function_defined && callback(); } } /** * Manage dynamically loaded scripts: https://github.com/orestbida/cookieconsent/issues/101 * If plugin has already run, call this method to enable * the newly added scripts based on currently selected preferences */ _cookieconsent.updateScripts = function(){ _manageExistingScripts(); } /** * Show cookie consent modal (with delay parameter) * @param {number} [delay] * @param {boolean} [create_modal] create modal if it doesn't exist */ _cookieconsent.show = function(delay, create_modal){ if(create_modal === true) _createConsentModal(_config.current_lang); if(consent_modal_exists){ setTimeout(function() { _addClass(html_dom, "show--consent"); /** * Update attributes/internal statuses */ consent_modal.setAttribute('aria-hidden', 'false'); consent_modal_visible = true; setTimeout(function(){ last_elem_before_modal = document.activeElement; current_modal_focusable = consent_modal_focusable; }, 200); _log("CookieConsent [MODAL]: show consent_modal"); }, delay > 0 ? delay : (create_modal ? 30 : 0)); } } /** * Hide consent modal */ _cookieconsent.hide = function(){ if(consent_modal_exists){ _removeClass(html_dom, "show--consent"); consent_modal.setAttribute('aria-hidden', 'true'); consent_modal_visible = false; setTimeout(function(){ //restore focus to the last page element which had focus before modal opening last_elem_before_modal.focus(); current_modal_focusable = null; }, 200); _log("CookieConsent [MODAL]: hide"); } } /** * Hide settings modal */ _cookieconsent.hideSettings = function(){ _removeClass(html_dom, "show--settings"); settings_modal_visible = false; settings_container.setAttribute('aria-hidden', 'true'); setTimeout(function(){ /** * If consent modal is visible, focus him (instead of page document) */ if(consent_modal_visible){ last_consent_modal_btn_focus && last_consent_modal_btn_focus.focus(); current_modal_focusable = consent_modal_focusable; }else{ /** * Restore focus to last page element which had focus before modal opening */ last_elem_before_modal && last_elem_before_modal.focus(); current_modal_focusable = null; } clicked_inside_modal = false; }, 200); _log("CookieConsent [SETTINGS]: hide settings_modal"); } /** * Accept cookieconsent function API * @param {string[]|string} _categories - Categories to accept * @param {string[]} [_exclusions] - Excluded categories [optional] */ _cookieconsent.accept = function(_categories, _exclusions){ var categories = _categories || undefined; var exclusions = _exclusions || []; var to_accept = []; /** * Get all accepted categories * @returns {string[]} */ var _getCurrentPreferences = function(){ var toggles = document.querySelectorAll('.c-tgl') || []; var states = []; for(var i=0; i= 1){ for(i=0; i 0){ for(var i=0; i<_cookies.length; i++){ this.validCookie(_cookies[i]) && cookies.push(_cookies[i]); } }else{ this.validCookie(_cookies) && cookies.push(_cookies); } _eraseCookies(cookies, _path, domains); } /** * Set cookie, by specifying name and value * @param {string} name * @param {string} value */ var _setCookie = function(name, value) { var cookie_expiration = _config.cookie_expiration; if(typeof _config.cookie_necessary_only_expiration === 'number' && accept_type === 'necessary') cookie_expiration = _config.cookie_necessary_only_expiration; value = _config.use_rfc_cookie ? encodeURIComponent(value) : value; var date = new Date(); date.setTime(date.getTime() + (1000 * (cookie_expiration * 24 * 60 * 60))); var expires = "; expires=" + date.toUTCString(); var cookieStr = name + "=" + (value || "") + expires + "; Path=" + _config.cookie_path + ";"; cookieStr += " SameSite=" + _config.cookie_same_site + ";"; // assures cookie works with localhost (=> don't specify domain if on localhost) if(window.location.hostname.indexOf(".") > -1){ cookieStr += " Domain=" + _config.cookie_domain + ";"; } if(window.location.protocol === "https:") { cookieStr += " Secure;"; } document.cookie = cookieStr; _log("CookieConsent [SET_COOKIE]: cookie '" + name + "'=", JSON.parse(value)); _log("CookieConsent [SET_COOKIE]: '" + name + "' expires after " + cookie_expiration + " day(s)"); } /** * Get cookie value by name, * returns the cookie value if found (or an array * of cookies if filter provided), otherwise empty string: "" * @param {string} name * @param {string} filter 'one' or 'all' * @param {boolean} [get_value] set to true to obtain its value * @returns {string|string[]} */ var _getCookie = function(name, filter, get_value) { var found; if(filter === 'one'){ found = document.cookie.match("(^|;)\\s*" + name + "\\s*=\\s*([^;]+)"); found = found ? (get_value ? found.pop() : name) : ""; if(found && name === _config.cookie_name){ try{ found = JSON.parse(found) }catch(e){ try { found = JSON.parse(decodeURIComponent(found)) } catch (e) { // if I got here => cookie value is not a valid json string found = {}; } } found = JSON.stringify(found); } }else if(filter === 'all'){ // array of names of all existing cookies var cookies = document.cookie.split(/;\s*/); found = []; for(var i=0; i-1&&(j.revision=t.revision),K=!0),"boolean"==typeof t.autoclear_cookies&&(j.autoclear_cookies=t.autoclear_cookies),!0===t.use_rfc_cookie&&(j.use_rfc_cookie=!0),!0===t.hide_from_bots&&(W=navigator&&(navigator.userAgent&&/bot|crawl|spider|slurp|teoma/i.test(navigator.userAgent)||navigator.webdriver)),j.page_scripts=!0===t.page_scripts,"browser"===t.auto_language||!0===t.auto_language?j.auto_language="browser":"document"===t.auto_language&&(j.auto_language="document"),ef("CookieConsent [LANG]: auto_language strategy is '"+j.auto_language+"'"),j.current_lang=e8(t.languages,t.current_lang)},eo=function(e){for(var t="accept-",n=c("c-settings"),i=c(t+"all"),o=c(t+"necessary"),a=c(t+"custom"),r=0;r0?Object.prototype.hasOwnProperty.call(t,j.current_lang)?j.current_lang:eS(t)[0]:void 0},er=function(){var e=["[href]","button","input","details",'[tabindex="0"]'];function t(t,n){var i=!1,o=!1;try{for(var a,r=t.querySelectorAll(e.join(':not([tabindex="-1"]), ')),c=r.length,s=0;s-1?(P.checked=!0,T||Z.push(!0)):T||Z.push(!1),T||ee.push(z),g.readonly?(P.disabled=!0,eN(q,"c-ro"),T||et.push(!0)):T||et.push(!1),eN(k,"b-acc"),eN(C,"b-bn"),eN(m,"b-ex"),k.id=_,k.setAttribute("aria-hidden","true"),D.appendChild(P),D.appendChild(q),D.appendChild(F),C.appendChild(D),b&&function(e,t,n){ex(j,"click",function(){eL(t,"act")?(eT(t,"act"),n.setAttribute("aria-expanded","false"),e.setAttribute("aria-hidden","true")):(eN(t,"act"),n.setAttribute("aria-expanded","true"),e.setAttribute("aria-hidden","false"))},!1)}(k,m,j)}else if(p){var R=eg("div");R.className="b-tl",R.setAttribute("role","heading"),R.setAttribute("aria-level","3"),R.insertAdjacentHTML("beforeend",p),C.appendChild(R)}if(p&&m.appendChild(C),f&&k.appendChild(y),!$&&void 0!==v){for(var B=document.createDocumentFragment(),J=0;J
      ',h=g.children[0];var t=j.current_lang;P&&ec(t),es(t),(e||document.body).appendChild(g)};I.updateLanguage=function(e,n){if("string"==typeof e){var i=ea(e,t.languages);return(i!==j.current_lang||!0===n)&&(j.current_lang=i,P&&(ec(i),eo(_)),es(i),ef("CookieConsent [LANGUAGE]: curr_lang: '"+i+"'"),!0)}};var ed=function(e){var t=c.length,n=-1;B=!1;var i=eA("","all"),o=[j.cookie_domain,"."+j.cookie_domain];if("www."===j.cookie_domain.slice(0,4)){var a=j.cookie_domain.substr(4);o.push(a),o.push("."+a)}for(var s=0;s-1;if(!Z[++n]&&Object.prototype.hasOwnProperty.call(l,"cookie_table")&&(e||d)){var u=l.cookie_table,p=eS(r[0])[0],f=u.length;"on_disable"===l.toggle.reload&&d&&(B=!0);for(var g=0;g-1&&v.push(i[C])}ef("CookieConsent [AUTOCLEAR]: search cookie: '"+$+"', found:",v),v.length>0&&(ew(v,k,o),"on_clear"===l.toggle.reload&&(B=!0))}}}}},eu=function(e){R=[];var t=document.querySelectorAll(".c-tgl")||[];if(t.length>0)for(var a=0;a0&&ed(),n||(n=new Date),o||(o=eh()),H={categories:e,revision:j.revision,data:D,rfc_cookie:j.use_rfc_cookie,consent_date:n.toISOString(),consent_uuid:o},(G||R.length>0)&&(z=!0,i=i?new Date:n,H.last_consent_update=i.toISOString(),u=eC(ey()),e_(j.cookie_name,JSON.stringify(H)),em()),(!G||(j.autoclear_cookies&&ed(!0),"function"==typeof d&&d(I.getUserPreferences(),H),"function"==typeof s&&s(H),G=!1,"opt-in"!==j.mode))&&("function"==typeof l&&R.length>0&&l(H,R),B&&window.location.reload())},ep=function(e,t){return e.indexOf(t)},ef=function(e,t,n){},eg=function(e){var t=document.createElement(e);return"button"===e&&t.setAttribute("type",e),t},eh=function(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,function(e){return(e^(window.crypto||window.msCrypto).getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)})},e8=function(e,t){return"browser"===j.auto_language?ea(ev(),e):"document"===j.auto_language?ea(document.documentElement.lang,e):"string"==typeof t?j.current_lang=ea(t,e):(ef("CookieConsent [LANG]: setting current_lang = '"+j.current_lang+"'"),j.current_lang)},ev=function(){var e=navigator.language||navigator.browserLanguage;return e.length>2&&(e=e[0]+e[1]),ef("CookieConsent [LANG]: detected_browser_lang = '"+e+"'"),e.toLowerCase()},e$=function(){var e=!1,t=!1;ex(document,"keydown",function(n){"Tab"===(n=n||window.event).key&&(!a||(n.shiftKey?document.activeElement===a[0]&&(a[1].focus(),n.preventDefault()):document.activeElement===a[1]&&(a[0].focus(),n.preventDefault()),t||U||(t=!0,e||n.preventDefault(),n.shiftKey?a[3]?a[2]?a[2].focus():a[0].focus():a[1].focus():a[3]?a[3].focus():a[0].focus())),t||(e=!0))}),document.contains&&ex(g,"click",function(e){e=e||window.event,F?w.contains(e.target)?U=!0:(I.hideSettings(0),U=!1):q&&v.contains(e.target)&&(U=!0)},!0)},eb=function(e,t){if("object"==typeof e){var n=e.consent_modal,i=e.settings_modal;P&&n&&o(v,["box","bar","cloud"],["top","middle","bottom"],["zoom","slide"],n.layout,n.position,n.transition),!t&&i&&o(A,["bar"],["left","right"],["zoom","slide"],i.layout,i.position,i.transition)}function o(e,t,n,i,o,a,r){if(a=a&&a.split(" ")||[],ep(t,o)>-1&&(eN(e,o),!("bar"===o&&"middle"===a[0])&&ep(n,a[0])>-1))for(var c=0;c-1&&eN(e,r)}};I.allowedCategory=function(e){if(G&&"opt-in"!==j.mode)var t=Q;else var t=JSON.parse(eA(j.cookie_name,"one",!0)||"{}").categories||[];return ep(t,e)>-1},I.run=function(e){if(document.getElementById("cc_div"))ef("CookieConsent [NOTICE]: cookie consent already attached to body!");else if(ei(e),!W){var t=void 0!==(o=(H=JSON.parse(eA(j.cookie_name,"one",!0)||"{}")).consent_uuid);if((n=H.consent_date)&&(n=new Date(n)),(i=H.last_consent_update)&&(i=new Date(i)),D=void 0!==H.data?H.data:null,K&&H.revision!==j.revision&&(z=!1),P=G=!t||!z||!n||!i||!o,el(),er(),eb(e.gui_options),eo(),j.autorun&&P&&I.show(e.delay||0),setTimeout(function(){eN(g,"c--anim")},30),setTimeout(function(){e$()},100),G)"opt-out"===j.mode&&(ef("CookieConsent [CONFIG] mode='"+j.mode+"', default enabled categories:",Q),em(Q)),ef("CookieConsent [NOTICE]: ask for consent!");else{var a="boolean"==typeof H.rfc_cookie;(!a||a&&H.rfc_cookie!==j.use_rfc_cookie)&&(H.rfc_cookie=j.use_rfc_cookie,e_(j.cookie_name,JSON.stringify(H))),u=eC(ey()),em(),"function"==typeof s&&s(H),ef("CookieConsent [NOTICE]: consent already given!",H)}}},I.showSettings=function(e){setTimeout(function(){eN(en,"show--settings"),A.setAttribute("aria-hidden","false"),F=!0,setTimeout(function(){q?f=document.activeElement:p=document.activeElement,0!==Y.length&&(Y[3]?Y[3].focus():Y[0].focus(),a=Y)},200),ef("CookieConsent [SETTINGS]: show settings_modal")},e>0?e:0)};var em=function(e){if(j.page_scripts){var t=document.querySelectorAll("script["+j.script_selector+"]"),n=e||H.categories||[],i=function(e,t){if(t-1){o.type="text/javascript",o.removeAttribute(j.script_selector);var a=o.getAttribute("data-src");a&&o.removeAttribute("data-src");var r=eg("script");if(r.textContent=o.innerHTML,!function(e,t){for(var n=t.attributes,i=n.length,o=0;o0)for(var a=0;a0?e:t?30:0)},I.hide=function(){P&&(eT(en,"show--consent"),v.setAttribute("aria-hidden","true"),q=!1,setTimeout(function(){p.focus(),a=null},200),ef("CookieConsent [MODAL]: hide"))},I.hideSettings=function(){eT(en,"show--settings"),F=!1,A.setAttribute("aria-hidden","true"),setTimeout(function(){q?(f&&f.focus(),a=X):(p&&p.focus(),a=null),U=!1},200),ef("CookieConsent [SETTINGS]: hide settings_modal")},I.accept=function(e,t){var n=e||void 0,i=t||[],o=[];if(n){if("object"==typeof n&&"number"==typeof n.length)for(var a=0;a=1)for(a=0;a0)for(var a=0;a-1&&(o+=" Domain="+j.cookie_domain+";"),"https:"===window.location.protocol&&(o+=" Secure;"),document.cookie=o,ef("CookieConsent [SET_COOKIE]: cookie '"+e+"'=",JSON.parse(t)),ef("CookieConsent [SET_COOKIE]: '"+e+"' expires after "+n+" day(s)")},eA=function(e,t,n){var i;if("one"===t){if((i=(i=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))?n?i.pop():e:"")&&e===j.cookie_name){try{i=JSON.parse(i)}catch(o){try{i=JSON.parse(decodeURIComponent(i))}catch(a){i={}}}i=JSON.stringify(i)}}else if("all"===t){var r=document.cookie.split(/;\s*/);i=[];for(var c=0;c-1?"; domain="+n[a]:"")+"; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";ef("CookieConsent [AUTOCLEAR]: deleting cookie: '"+e[o]+"' path: '"+i+"' domain:",n)}};I.validCookie=function(e){return""!==eA(e,"one",!0)};var ex=function(e,t,n,i){e.addEventListener(t,n,!0===i&&{passive:!0})},eS=function(e){if("object"==typeof e)return Object.keys(e)},eN=function(e,t){e.classList.add(t)},eT=function(e,t){e.classList.remove(t)},eL=function(e,t){return e.classList.contains(t)};return I},t="initCookieConsent";"undefined"!=typeof window&&"function"!=typeof window[t]&&(window[t]=e)}();; function isSetCConsent() {var value = "; " + document.cookie;var parts = value.split("; cc_cookie=");if (parts.length == 2) return true;} function getDomain() {var hostname = window.location.hostname.match(/\w+\.\w{2,3}$/);return hostname ? hostname : 'localhost';} (function () { if (!isSetCConsent()) { var allCookies = document.cookie.split(';'); var hostname = getDomain(); for (var i = 0; i < allCookies.length; i++) { document.cookie = allCookies[i] + "=;domain=." + window.location.hostname + ";path=/;expires=" + new Date(0).toUTCString(); document.cookie = allCookies[i] + "=;domain=." + hostname + ";path=/;expires=" + new Date(0).toUTCString(); document.cookie = allCookies[i] + "=;path=/;expires=" + new Date(0).toUTCString(); document.cookie = allCookies[i] + "=;expires=" + new Date(0).toUTCString(); } } })(); function updateCC(){ // console.log('change'); typeof gtag === 'function' && gtag('consent', 'update', { 'ad_storage': !cc.allowedCategory('targeting') ? 'denied' : 'granted', 'analytics_storage': !cc.allowedCategory('analytics') ? 'denied' : 'granted', 'personalization_storage': !cc.allowedCategory('functional') ? 'denied' : 'granted' }); if(typeof gtag === 'function'){ window.dataLayer = window.dataLayer || []; dataLayer.push({'event': 'ccUpdate'}); } revisarIframes(); } function mostrarIframe(elemento){ if(elemento.dataset.src != 'undefined'){ elemento.setAttribute("src", elemento.dataset.src); elemento.style.display = "block"; var lockeds=elemento.parentNode.getElementsByClassName("iframe-locked"); if (lockeds.length>0) { elemento.parentNode.removeChild(lockeds[0]); } } } function mostrarLockIFrame(element){ var lockeds=element.parentNode.getElementsByClassName("iframe-locked"); if (lockeds.length==0) { var el = document.createElement("div"); el.setAttribute('class', 'iframe-locked'); //Estilos el.style.textAlign = "center"; el.style.fontSize = "0.85em"; el.style.background = "#E0E0E0"; el.style.display = "flex"; el.style.flexDirection = "column"; el.style.alignItems = "center"; el.style.justifyContent = "center"; if(element.width){ el.style.width = element.width +"px"; } if(element.height){ el.style.height = element.height +"px"; } var lang = document.documentElement.lang; var idioma = 'es'; //default var re =/^[a-zA-Z]{2}([-_][a-zA-Z]{2})?$/; if ((typeof lang)=="string" && re.test(lang)) idioma = lang.substring(0,2).toLowerCase(); var dcc = element.dataset.cookiecategory; var porActivar = ''; var i18n = { es: ['Cookies analíticas','Cookies de personalización','Cookies publicitarias','Contenido bloqueado por su configuración de cookies. Para verlo active:', 'Configuración de cookies'], en: ['Performance Cookies', 'Functional Cookies', 'Targeting Cookies','Blocked content by your cookie settings. To see it activate:', 'Cookie Settings'], eu: ['Errendimenduari buruzko cookieak', 'Cookie funtzionalak', 'Fokalizazio cookieak', 'Zure cookien ezarpenak edukia blokeatu du. Edukia ikusteko cookie kategoria hauek aktibatu behar dituzu:', 'Cookie konfigurazioa'], fr: ['Cookies de performance', 'Cookies de fonctionnalité', 'Cookies pour une publicité ciblée','Contenu bloqué par vos paramètres des cookies. Pour le voir, vous devez activer:', 'Paramètres des cookies'], de: ['Leistungs-Cookies', 'Funktionelle Cookies', 'Cookies für Marketingzwecke','Inhalt, der durch Ihre Cookie-Einstellungen blockiert wird. Um es zu sehen, müssen Sie aktivieren:','Cookie-Einstellungen'], pt: ['Cookies de desempenho', 'Cookies de funcionalidade', 'Cookies de publicidade','Conteúdo bloqueado por suas configurações de cookies. Para vê-lo, você deve ativar:','Definições de cookies'], }; if(dcc.includes('analytics')){ porActivar = '- ' + i18n[idioma][0]; } if(dcc.includes('functional')){ if(porActivar != '') porActivar = porActivar + '
      '; porActivar = porActivar + '- ' + i18n[idioma][1]; } if(dcc.includes('targeting')){ if(porActivar != '') porActivar = porActivar + '
      '; porActivar = porActivar + '- ' + i18n[idioma][2]; } el.innerHTML = '

      '+ i18n[idioma][3]+'
      ' + porActivar + '

      '; element.parentNode.insertBefore(el,element); } element.style.display = "none"; } function replicarClick(){document.querySelector('#pie-cc').click();} function revisarIframes(){ const divs = document.querySelectorAll('iframe'); var elements=document.getElementsByTagName("iframe"); for(var i = 0; i < elements.length; i++){ var ssrrcc = elements[i].src; var padre = elements[i].parentNode; var clasePadre = padre.className; if(ssrrcc === '' || ssrrcc === undefined){ elements[i].src = 'about:blank'; } if(!ssrrcc.includes('player.vimeo.com') && !ssrrcc.includes('dnt=true') && !ssrrcc.includes('doubleclick.net/activity') && !ssrrcc.includes('libraries/pdf.js/')){ if(ssrrcc.includes('/recaptcha/api2/') || clasePadre == 'g-recaptcha' || clasePadre.includes('g-recaptcha')){ mostrarIframe(elements[i]); } else { if(typeof elements[i].dataset.cookiecategory != undefined){ console.log(elements[i]); var categories = elements[i].dataset.cookiecategory; if(categories != ''){ var catlist = categories.split(' '); var numAccepts = 0; for(var j = 0; j < catlist.length; j++){ if(cc.allowedCategory(catlist[j])){ numAccepts++; } } if(catlist.length == numAccepts){ mostrarIframe(elements[i]); } else { mostrarLockIFrame(elements[i]); } } } } } } } var cc = initCookieConsent(); cc.run({ //current_lang: document.documentElement.lang, autoclear_cookies: true, cookie_name: 'cc_cookie', cookie_expiration: 365, page_scripts: true, // default: false force_consent: true, auto_language: 'document', // default: null; could also be 'browser' or 'document' remove_cookie_tables: true, // autorun: true, // default: true // delay: 0, // default: 0 // hide_from_bots: false, // default: false // cookie_domain: location.hostname, // default: current domain // cookie_path: '/', // default: root // cookie_same_site: 'Lax', // use_rfc_cookie: false, // default: false // revision: 0, // default: 0 gui_options: { consent_modal: { layout: 'cloud', // box,cloud,bar position: 'middle center', // bottom,middle,top + left,right,center transition: 'slide' // zoom,slide }, settings_modal: { layout: 'cloud', // box,bar position: 'middle center', // right,left (available only if bar layout selected) transition: 'slide' // zoom,slide } }, onFirstAction: function(){}, onAccept: function (cookie) {updateCC();}, onChange: function (cookie, changed_preferences) {updateCC();}, languages: { 'es': { consent_modal: { title: 'Uso de cookies', description: 'Utilizamos cookies propias y de terceros para analizar el uso del sitio web y mostrarte publicidad relacionada con tus preferencias sobre la base de un perfil elaborado a partir de tus hábitos de navegación (por ejemplo, páginas visitadas).
      Política de cookies.', primary_btn: { text: 'Aceptar cookies', role: 'accept_all', }, secondary_btn: { text: 'Rechazar cookies', role: 'reject_all', }, tertiary_btn: { text: 'Configurar', role: 'settings', }, }, settings_modal: { title: 'Configurar', save_settings_btn: 'Confirmar mis preferencias', accept_all_btn: 'Permitirlas todas', reject_all_btn: 'Rechazarlas todas', close_btn_label: 'Cerrar', cookie_table_headers: [ {col1: 'Name'} ], blocks: [ { title: 'Gestionar las cookies', description: 'Estos son los grupos de cookies que están en nuestra web. Puede configurarlas a su gusto, teniendo en cuenta que las Cookies estrictamente necesarias son imprescindibles para que pueda interactuar con esta web. Obtenga más información en el siguiente enlace: Política de cookies.', }, { title: 'Cookies estrictamente necesarias', description: 'Permiten al usuario la navegación a través de una página web, plataforma o aplicación y la utilización de las diferentes opciones o servicios que en ella existan como, por ejemplo, controlar el tráfico y la comunicación de datos, identificar la sesión, acceder a partes de acceso restringido, recordar los elementos que integran un pedido, realizar el proceso de compra de un pedido o utilizar elementos de seguridad durante la navegación.', toggle: { value: 'necessary', enabled: true, readonly: true, }}, { title: 'Cookies Analíticas', description: 'Sirven para analizar los hábitos de navegación de los usuarios, con el objetivo de optimizar las funcionalidades y el mantenimiento técnico y operativo y garantizar la mejor experiencia posible.', toggle: { value: 'analytics', enabled: false, readonly: false, }, cookie_table: [{ col1: '^_gcl', is_regex: true},{ col1: '^_ga', is_regex: true},{ col1: '_gid'}]}, { title: 'Cookies publicitarias', description: 'Son aquéllas que permiten almacenar información del comportamiento de los usuarios obtenida a través de la observación continuada de sus hábitos de navegación, lo que permite desarrollar un perfil especifico del usuario. De esta manera, se utilizan para personalizar las campañas publicitarias que se ajusten a las preferencias del usuario.', toggle: { value: 'targeting', enabled: false, readonly: false, }, cookie_table: [{ col1: 'IDE'},{ col1: 'test_cookie'},{ col1: 'VISITOR_INFO1_LIVE'},{ col1: 'CONSENT'},{ col1: 'YSC'}] }] } }, 'eu': { consent_modal: { title: 'Cookieen konfigurazioa', description: 'Gure cookieak eta hirugarrenenak erabiltzen ditugu webgunearen erabilera aztertzeko eta zure hobespenekin erlazionatutako publizitatea erakusteko, zure nabigazio ohituretatik sortutako profil batean oinarrituta (adibidez, bisitatutako orrialdeak).
      Cookie-politika.', primary_btn: { text: 'Cookieak onartu', role: 'accept_all', }, secondary_btn: { text: 'Cookieak baztertu', role: 'reject_all', }, tertiary_btn: { text: 'Konfiguratu', role: 'settings', }, }, settings_modal: { title: 'Cookieen konfigurazioa', save_settings_btn: 'Nire aukerak berretsi', accept_all_btn: 'Guztia onartu', reject_all_btn: 'Dena baztertu', close_btn_label: 'Itxi', cookie_table_headers: [ {col1: 'Name'} ], blocks: [ { title: 'Pribatutasunaren lehentasun-zentroa', description: 'Edozein webgunea bisitatzen duzunean, zure nabigatzaileri buruzko informazioa gorde edo berreskuratu daiteke, gehienetan cookie moduan. Informazioa zuri buruz, zure lehentasunei edo gailuari buruz izan daiteke. Hau, webgunea zuk espero duzun moduan funtzionatu dezan baliatu dezakegu. Informazio honek ez zaitu zuzenean identifikatzen, baina web-esperientzia pertsonalago bat eskaini diezazuke. Cookie mota batzuen baimena ezeztatu dezakezu. Informazio gehiago hemen.', }, { title: 'Ezinbesteko cookieak', description: 'Cookie hauek beharrezkoak dira webgunea funtzionatu dezan eta ezin ditugu gure sistemetatik kendu. Gehienetan zure ekintzei erantzuteko ezartzen dira; ekintza hauek zerbitzuen eskaerari lotuta daude, esate baterako, zure pribatutasun-lehentasunen konfigurazioa, saio-hasiera edo eskaera betetzea. Zure nabigatzailea konfiguratu dezakezu cookie mota hau blokeatzeko edo honi buruz ohartarazteko, baina baliteke webgunearen zati batzuk ondo ez ibiltzea.', toggle: { value: 'necessary', enabled: true, readonly: true, }}, { title: 'Errendimenduari buruzko cookieak', description: 'Cookie hauei esker bisitak eta trafikoaren jatorria aztertu ditzakegu gure webgunearen errendimendua neurtzeko eta hobetzeko. Cookie hauekin, orrialdeen ospea jakin dezakegu eta bisitariak gure webgunean nola mugitzen diren ikusi dezakegu. Errendimenduar buruzko cookieak bildutako informazio guztia gaineratzen da eta, beraz, anonimoa da. Cookie hauek onartzen ez badituzu, ezingo dugu jakin gure webgunea noiz bisitatzen duzun.', toggle: { value: 'analytics', enabled: false, readonly: false, }, cookie_table: [{ col1: '^_gcl', is_regex: true},{ col1: '^_ga', is_regex: true},{ col1: '_gid'}]}, { title: 'Fokalizazio cookieak', description: 'Gure publizitate bazkideek cookie mota hau ezartzen dute webgune guztian zehar. Fokalizazio cookiei esker, enpresa hauek zure interesen inguruko profil bat sortu dezakete, baita beste webguneetan publizitate adierazgarria erakutsi ere. Horretarako, zure nabigatzailea eta gailua identifikatzen dituzte. Cookie hauek onartzen ez badituzu, ezingo duzu webgune desberdinetan zehar publizitate personalizatuta ikusi.', toggle: { value: 'targeting', enabled: false, readonly: false, }, cookie_table: [{ col1: 'IDE'},{ col1: 'test_cookie'},{ col1: 'VISITOR_INFO1_LIVE'},{ col1: 'CONSENT'},{ col1: 'YSC'}] }] } }, } });; /*jslint unparam: true, browser: true, indent: 2 */ ;(function ($, window, document, undefined) { 'use strict'; Foundation.libs.reveal = { name : 'reveal', version : '4.3.2', locked : false, settings : { animation: 'fadeAndPop', animationSpeed: 250, closeOnBackgroundClick: true, closeOnEsc: true, dismissModalClass: 'close-reveal-modal', bgClass: 'reveal-modal-bg', open: function(){}, opened: function(){}, close: function(){}, closed: function(){}, bg : $('.reveal-modal-bg'), css : { open : { 'opacity': 0, 'visibility': 'visible', 'display' : 'block' }, close : { 'opacity': 1, 'visibility': 'hidden', 'display': 'none' } } }, init : function (scope, method, options) { Foundation.inherit(this, 'data_options delay'); if (typeof method === 'object') { $.extend(true, this.settings, method); } else if (typeof options !== 'undefined') { $.extend(true, this.settings, options); } if (typeof method !== 'string') { this.events(); return this.settings.init; } else { return this[method].call(this, options); } }, events : function () { var self = this; $(this.scope) .off('.fndtn.reveal') .on('click.fndtn.reveal', '[data-reveal-id]', function (e) { e.preventDefault(); if (!self.locked) { var element = $(this), ajax = element.data('reveal-ajax'); self.locked = true; if (typeof ajax === 'undefined') { self.open.call(self, element); } else { var url = ajax === true ? element.attr('href') : ajax; self.open.call(self, element, {url: url}); } } }) .on('click.fndtn.reveal touchend', this.close_targets(), function (e) { e.preventDefault(); if (!self.locked) { var settings = $.extend({}, self.settings, self.data_options($('.reveal-modal.open'))), bgClicked = $(e.target)[0] === $('.' + settings.bgClass)[0]; if (bgClicked && !settings.closeOnBackgroundClick) { return; } self.locked = true; self.close.call(self, bgClicked ? $('.reveal-modal.open') : $(this).closest('.reveal-modal')); } }); if($(this.scope).hasClass('reveal-modal')) { $(this.scope) .on('open.fndtn.reveal', this.settings.open) .on('opened.fndtn.reveal', this.settings.opened) .on('opened.fndtn.reveal', this.open_video) .on('close.fndtn.reveal', this.settings.close) .on('closed.fndtn.reveal', this.settings.closed) .on('closed.fndtn.reveal', this.close_video); } else { $(this.scope) .on('open.fndtn.reveal', '.reveal-modal', this.settings.open) .on('opened.fndtn.reveal', '.reveal-modal', this.settings.opened) .on('opened.fndtn.reveal', '.reveal-modal', this.open_video) .on('close.fndtn.reveal', '.reveal-modal', this.settings.close) .on('closed.fndtn.reveal', '.reveal-modal', this.settings.closed) .on('closed.fndtn.reveal', '.reveal-modal', this.close_video); } $( 'body' ).bind( 'keyup.reveal', function ( event ) { var open_modal = $('.reveal-modal.open'), settings = $.extend({}, self.settings, self.data_options(open_modal)); if ( event.which === 27 && settings.closeOnEsc) { // 27 is the keycode for the Escape key open_modal.foundation('reveal', 'close'); } }); return true; }, open : function (target, ajax_settings) { if (target) { if (typeof target.selector !== 'undefined') { var modal = $('#' + target.data('reveal-id')); } else { var modal = $(this.scope); ajax_settings = target; } } else { var modal = $(this.scope); } if (!modal.hasClass('open')) { var open_modal = $('.reveal-modal.open'); if (typeof modal.data('css-top') === 'undefined') { modal.data('css-top', parseInt(modal.css('top'), 10)) .data('offset', this.cache_offset(modal)); } modal.trigger('open'); if (open_modal.length < 1) { this.toggle_bg(); } if (typeof ajax_settings === 'undefined' || !ajax_settings.url) { this.hide(open_modal, this.settings.css.close); this.show(modal, this.settings.css.open); } else { var self = this, old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null; $.extend(ajax_settings, { success: function (data, textStatus, jqXHR) { if ( $.isFunction(old_success) ) { old_success(data, textStatus, jqXHR); } modal.html(data); $(modal).foundation('section', 'reflow'); self.hide(open_modal, self.settings.css.close); self.show(modal, self.settings.css.open); } }); $.ajax(ajax_settings); } } }, close : function (modal) { var modal = modal && modal.length ? modal : $(this.scope), open_modals = $('.reveal-modal.open'); if (open_modals.length > 0) { this.locked = true; modal.trigger('close'); this.toggle_bg(); this.hide(open_modals, this.settings.css.close); } }, close_targets : function () { var base = '.' + this.settings.dismissModalClass; if (this.settings.closeOnBackgroundClick) { return base + ', .' + this.settings.bgClass; } return base; }, toggle_bg : function () { if ($('.' + this.settings.bgClass).length === 0) { this.settings.bg = $('
      ', {'class': this.settings.bgClass}) .appendTo('body'); } if (this.settings.bg.filter(':visible').length > 0) { this.hide(this.settings.bg); } else { this.show(this.settings.bg); } }, show : function (el, css) { // is modal if (css) { if (el.parent('body').length === 0) { var placeholder = el.wrap('
      ').parent(); el.on('closed.fndtn.reveal.wrapped', function() { el.detach().appendTo(placeholder); el.unwrap().unbind('closed.fndtn.reveal.wrapped'); }); el.detach().appendTo('body'); } if (/pop/i.test(this.settings.animation)) { css.top = $(window).scrollTop() - el.data('offset') + 'px'; var end_css = { top: $(window).scrollTop() + el.data('css-top') + 'px', opacity: 1 }; return this.delay(function () { return el .css(css) .animate(end_css, this.settings.animationSpeed, 'linear', function () { this.locked = false; el.trigger('opened'); }.bind(this)) .addClass('open'); }.bind(this), this.settings.animationSpeed / 2); } if (/fade/i.test(this.settings.animation)) { var end_css = {opacity: 1}; return this.delay(function () { return el .css(css) .animate(end_css, this.settings.animationSpeed, 'linear', function () { this.locked = false; el.trigger('opened'); }.bind(this)) .addClass('open'); }.bind(this), this.settings.animationSpeed / 2); } return el.css(css).show().css({opacity: 1}).addClass('open').trigger('opened'); } // should we animate the background? if (/fade/i.test(this.settings.animation)) { return el.fadeIn(this.settings.animationSpeed / 2); } return el.show(); }, hide : function (el, css) { // is modal if (css) { if (/pop/i.test(this.settings.animation)) { var end_css = { top: - $(window).scrollTop() - el.data('offset') + 'px', opacity: 0 }; return this.delay(function () { return el .animate(end_css, this.settings.animationSpeed, 'linear', function () { this.locked = false; el.css(css).trigger('closed'); }.bind(this)) .removeClass('open'); }.bind(this), this.settings.animationSpeed / 2); } if (/fade/i.test(this.settings.animation)) { var end_css = {opacity: 0}; return this.delay(function () { return el .animate(end_css, this.settings.animationSpeed, 'linear', function () { this.locked = false; el.css(css).trigger('closed'); }.bind(this)) .removeClass('open'); }.bind(this), this.settings.animationSpeed / 2); } return el.hide().css(css).removeClass('open').trigger('closed'); } // should we animate the background? if (/fade/i.test(this.settings.animation)) { return el.fadeOut(this.settings.animationSpeed / 2); } return el.hide(); }, close_video : function (e) { var video = $(this).find('.flex-video'), iframe = video.find('iframe'); if (iframe.length > 0) { iframe.attr('data-src', iframe[0].src); iframe.attr('src', 'about:blank'); video.hide(); } }, open_video : function (e) { var video = $(this).find('.flex-video'), iframe = video.find('iframe'); if (iframe.length > 0) { var data_src = iframe.attr('data-src'); if (typeof data_src === 'string') { iframe[0].src = iframe.attr('data-src'); } else { var src = iframe[0].src; iframe[0].src = undefined; iframe[0].src = src; } video.show(); } }, cache_offset : function (modal) { var offset = modal.show().height() + parseInt(modal.css('top'), 10); modal.hide(); return offset; }, off : function () { $(this.scope).off('.fndtn.reveal'); }, reflow : function () {} }; }(Foundation.zj, this, this.document)); ; (function ($, Drupal) { Drupal.behaviors.STARTER = { attach: function(context, settings) { $('body', context).once('bod', function (e) { const urlParams = new URLSearchParams(window.location.search); const lgi = urlParams.get('lgi'); if(lgi){ if(lgi == 1){ setTimeout(function(e){ window.dataLayer.push({'event': 'login'}); }, 1500); } } const lgo = urlParams.get('lgo'); if(lgo){ if(lgo == 1){ setTimeout(function(e){ window.dataLayer.push({'event': 'logout'}); }, 1500); } } }); if(location.search == '?refresh=true'){ var newUrl = "/"; window.location.href = newUrl; } //Si no existe la cookie y no se ve la capa. //Nuevo banner de cookies $(document).on('click','#popup-buttons .seclayer',function(){ $("#popup-text").addClass("hide"); $("#first-agree").addClass("hide"); $(this).addClass('hide'); $('#sliding-popup .encabezado-cookies').toggleClass('hide'); $('#sliding-popup .texto-cookies').toggleClass('hide'); $('#sliding-popup .popup-buttons').toggleClass('hide'); $('#sliding-popup .second-layer').toggleClass('hide'); $('#sliding-popup .eu-cookie-compliance-categories-buttons').toggleClass('hide'); console.log('click en seclayer'); }); $(document).on('click', '#eu-cookie-compliance-categories input.catThree', function(){ console.log('click en botón de categoría'); if($('input.catThree#cookie-category-3').is(":checked") && $('input.catThree#cookie-category-4').is(":checked") && $('input.catThree#cookie-category-5').is(":checked") ){ $('input#cookie-category-2').attr("checked", true); console.log('ok'); } else { $('input#cookie-category-2').attr("checked", false); console.log('ko'); } }); /*setTimeout(function(){ if(!existsCookiePermission()){ console.log('n....'); var banner = Drupal.settings.eu_cookie_compliance.popup_html_info; if($('#sliding-popup').length == 0){ console.log('ss'); var wrapperBanner = '
      '+ banner +'
      '; //$('body').append(wrapperBanner); location.reload(); } else { console.log('nn'); } } else { console.log('s....'); } }, 500);*/ if(cookiePermission()){ console.log('permiso cookies'); /*var dominio = window.location.origin; //Incluir los JS if(dominio.includes('aviaenergias.es')){ includeJs("/sites/default/files/c/tapmetrik-avia.js"); } else { includeJs("/sites/default/files/c/tapmetrik-club.js"); } includeJs("https://7295928.collect.igodigital.com/collect.js"); includeJs("/sites/all/themes/acc_foundation/js/tagmanager.js"); //includeJs("/sites/all/themes/acc_foundation/js/cookies-google-ads.js"); //GOOGLE ADS console.log('cookies-googleads'); var google_conversion_id = 982009940; var google_custom_params = window.google_tag_params; var google_remarketing_only = true; includeJs("https://www.googleadservices.com/pagead/conversion.js"); // END GOOGLE ADS setTimeout(function(){ console.log('cookies-igodigital'); _etmc.push(["setOrgId", "7295928"]); _etmc.push(["trackPageView"]); } , 500);*/ } $('iframe').each(function(){ //Zona excluido var excluir = false; if($('body.section-area-de-socios').length || $('body.section-bazkideen-eremua').length){ excluir = true; } if(!excluir){ var datasrc = $(this).data('src'); var hayPermiso = cookiePermission(); console.log('Permiso: ' + hayPermiso); if( (datasrc && hayPermiso) || ( $('body.page-node-1991').length || $('body.page-node-818').length || $('body.page-node-2193').length || $('body.page-node-1457').length ) ){ if( ( $('body.page-node-1991').length || $('body.page-node-818').length || $('body.page-node-1457').length || $('body.page-node-2193').length ) && hayPermiso == false){ $(this).attr('src', datasrc + '?cookies=no'); console.log('nocook'); } else { console.log('sicook'); $(this).attr('src', datasrc); } //$(this).removeAttr('data-src'); } else { console.log('no'); if(datasrc.includes('vimeo')){ $(this).attr('src', datasrc); } else { $(this).css({"background": "#f3f3f3 url('/sites/all/themes/acc_foundation/images/disabled.jpg') no-repeat center center"}); } } } }); $('a.resetCookies').click(function() { var cookies = document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; var eqPos = cookie.indexOf("="); var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie; document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; } //location.reload(); var newUrl = "/?refresh=true"; window.location.href = newUrl; return false; }); //END Nuevo banner de cookies $('div[class^="destacadoPie"] a, div[class^="destacadoLateral"] a').click(function(){ var title = $(this).attr('title') || '(not set)'; trackGA('event', 'banners-avia-2020', $('html').attr('lang'), title, 0, false); }); $(document).ajaxComplete(function() { if ($('#formOK').attr('data-form-name')) { ga('send', 'pageview', window.location.pathname + '#enviar-DMForm-' + $('#formOK').attr('data-form-name')); $('#formOK').removeAttr('data-form-name'); dataLayer.push({'event': 'enviar-formulario',}); } }); // Get your Yeti started. var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = decodeURIComponent(window.location.search.substring(1)), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : sParameterName[1]; } } }; // replace array function String.prototype.replaceArray = function(find, replace) { var replaceString = this; for (var i = 0; i < find.length; i++) { replaceString = replaceString.replace(find[i], replace[i]); } return replaceString; }; // marcar elemento menú principal activo var section = "home"; /* var hostname = location.hostname; if (hostname.toLowerCase().indexOf("clubavia") >= 0) { section = "clubavia"; } else { var url = window.location.href.split('/'); if (url.length > 3) { if (url[3] != '') { section = url[3]; } } } */ if ($('#selected_main_menu').length) { section = $('#selected_main_menu').html(); } $('.tb-megamenu-main-menu a').each(function() { if ($(this).attr('href').toLowerCase().indexOf('.es/' + section) >= 0 || $(this).attr('href').toLowerCase().indexOf(section + '.es') >= 0 || $(this).attr('href').toLowerCase().indexOf('.es/eu/' + section) >= 0 || $(this).attr('href').toLowerCase().indexOf(section + '.es/eu') >= 0) { $(this).closest('li').addClass('active'); } }); if ($('#tb-megamenu-menu-men-corporativo .nav-collapse').length) { $('#tb-megamenu-menu-men-corporativo .nav-collapse').addClass('corporativo-hidden'); $('.block-tb-megamenu-menu-men-corporativo .tb-megamenu-button').click(function() { if ($('#tb-megamenu-menu-men-corporativo .nav-collapse').hasClass('corporativo-hidden')){ $('#tb-megamenu-menu-men-corporativo .nav-collapse').removeClass('corporativo-hidden'); $('#tb-megamenu-menu-men-corporativo .nav-collapse').addClass('corporativo-show'); } else { $('#tb-megamenu-menu-men-corporativo .nav-collapse').removeClass('corporativo-show'); $('#tb-megamenu-menu-men-corporativo .nav-collapse').addClass('corporativo-hidden'); } }); } /*if ($('.block-tb-megamenu-menu-men-corporativo .tb-megamenu-button:not(.already_clicked)').length) { $( ".block-tb-megamenu-menu-men-corporativo .tb-megamenu-button:not(.already_clicked)" ).click(function() { $(this).addClass('already_clicked'); $(".block-tb-megamenu-menu-men-corporativo .tb-megamenu-button .tb-megamenu-nav").slideToggle( 400, function() { // Animation complete. }); }); }*/ if ($('.contenidoFichaLubricante .field-name-field-formato ul li').length) { $('.contenidoFichaLubricante .field-name-field-formato ul li').each(function() { $(this).addClass('formato_' + $(this).html()); $(this).html(''); }); } if ($("body").hasClass("domain-www-clubavia-es")) { $( "#tb-megamenu-menu-men-corporativo li" ).remove( ":nth-child(4)" ); } // Check presupuesto if ($('#edit-submitted-productos-productos-select-1').length) { if (getUrlParameter('p') === 'calefaccion') { $('#edit-submitted-productos-productos-select-1').prop('checked', 'checked'); } if (getUrlParameter('p') === 'agricolaindustrial') { $('#edit-submitted-productos-productos-select-2').prop('checked', 'checked'); } if (getUrlParameter('p') === 'automocion') { $('#edit-submitted-productos-productos-select-3').prop('checked', 'checked'); } } // Filtros estaciones if ($('.filtro_estaciones').length) { $('.filtro_estaciones .views-exposed-widget').each(function() { $(this).find('label').addClass('hide'); var label = $(this).find('label').html(); $(this).find('select option:first-child').html('- ' + label + ' -'); }); } // Filtros distribuidores if ($('.filtro_destacados').length) { $('.filtro_destacados .views-exposed-widget').each(function() { $(this).find('label').addClass('hide'); var label = $(this).find('label').html(); $(this).find('select option:first-child').html('- ' + label + ' -'); }); if(!$('.distriBG').hasClass('ajax')){ $('.distriBG').addClass('hide').addClass('ajax'); } $('.form-submit').click(function() { $('.distriBG').removeClass('hide'); $('html, body').animate({ scrollTop: $("#main-content").offset().top }, 700); }); } // Mostrar Promociones Locales en caso de que el usuario provenga de La Rioja if($('li[data-id="1894"]').length) { $.ajax({ method: "POST", url: "/sites/all/ajax/location.php" }) .done(function( msg ) { if (msg == '1') { $('li[data-id="1894"]').removeClass('ocultarMenu'); } }); } // Maximo 3 checkbox if($('#webform-client-form-2579 .webform-component--descripcion-del-destino-del-premio').length > 0) { $('#webform-client-form-2579 .webform-component--descripcion-del-destino-del-premio input[type="checkbox"]').click(function(e) { if ($('#webform-client-form-2579 .webform-component--descripcion-del-destino-del-premio input[type="checkbox"]:checked').length > 3) { e.preventDefault(); } }) } /* // Campaña Gasoleo Calefaccion // $('#node-62 .botonPresupuestoRojo, #node-2007 .botonPresupuestoRojo').css('display', 'none'); $('#node-62, #node-2007').on('change', '#edit-field-provincia-tid-selective', function(){ var regionId = $(this).val(); var url = ''; switch(regionId){ case '508': url = 'http://www.aviaenergias.es/gasoleo-calefaccion/a-coruna'; break; case '70': url = 'http://www.aviaenergias.es/gasoleo-calefaccion/girona'; break; case '73': url = 'http://www.aviaenergias.es/gasoleo-calefaccion/la-rioja'; break; case '82': url = 'http://www.aviaenergias.es/gasoleo-calefaccion/zaragoza'; break; default: $('#node-62 .botonPresupuestoRojo, #node-2007 .botonPresupuestoRojo').css('display', ''); break; } if (url != ''){ window.open(url, '_blank'); } }); */ // Desplegable inferior if ($('.call_to_action:not(.already_clicked)').length) { $( ".call_to_action:not(.already_clicked)" ).click(function() { $(this).addClass('already_clicked'); $( ".action_target" ).slideToggle( 400, function() { // Animation complete. }); }); } if ($('#edit-field-provincia-tid-selective').length) { $('#edit-field-provincia-tid-selective').change(function(){ $('.call_to_action').addClass('already_clicked'); }); } //Lubricantes para automoción Menú if ($('.view-id-lubricantes').not(".lubrifikatzaileakEU").length) { var i = 0; $('.view-id-lubricantes h3').each(function() { $('
      ').insertAfter( $(this) ); $(this).addClass('agrupacion_lubricantes' + i); $(this).nextUntil( "h3" ).each(function() { if (!$(this).is('#agrupacion_lubricantes' + i)) { $(this).appendTo('#agrupacion_lubricantes' + i); } }); ++i; }); var url = window.location.pathname.split('/'); if (url.length > 4) { $('.view-id-lubricantes h3').each(function() { if (!(convertToSlug($(this).find('a').html()) === url[4])) { $( "div#" + $(this).attr('class')).css('display', 'none'); } else if (!(url.length > 5)) { $(this).addClass('active'); } }); } if (url.length > 5) { var indice = 5; if (url.length > 6) { indice = 6; } $('div.agrupacion_lubricante div').each(function() { if ((convertToSlug($(this).find('a').html()) === url[indice])) { $(this).addClass('active'); } }); } } //Lubricantes para automoción Menú PROFESIONALES EU if ($('.lubrifikatzaileakEU').length) { var i = 0; $('.view-display-id-page_1 h3').each(function() { $('
      ').insertAfter( $(this) ); $(this).addClass('agrupacion_lubricantes' + i); $(this).nextUntil( "h3" ).each(function() { if (!$(this).is('#agrupacion_lubricantes' + i)) { $(this).appendTo('#agrupacion_lubricantes' + i); } }); ++i; }); var url = window.location.pathname.split('/'); if (url.length > 5) { $('.view-display-id-page_1 h3').each(function() { if (!(convertToSlug($(this).find('a').html()) === url[5])) { $( "div#" + $(this).attr('class')).css('display', 'none'); } else if (!(url.length > 6)) { $(this).addClass('active'); } }); } if (url.length > 6) { var indice = 6; if (url.length > 7) { indice = 7; } $('div.agrupacion_lubricante div').each(function() { if ((convertToSlug($(this).find('a').html()) === url[indice])) { $(this).addClass('active'); } }); } } //Lubricantes para automoción Menú PARTICULAR if ($('.view-id-lubricantes_particulares').length) { var i = 0; $('.view-id-lubricantes_particulares h3').each(function() { $('
      ').insertAfter( $(this) ); $(this).addClass('agrupacion_lubricantes' + i); $(this).nextUntil( "h3" ).each(function() { if (!$(this).is('#agrupacion_lubricantes' + i)) { $(this).appendTo('#agrupacion_lubricantes' + i); } }); ++i; }); var url = window.location.pathname.split('/'); if (url.length > 3) { $('.view-id-lubricantes_particulares h3').each(function() { if (!(convertToSlug($(this).find('a').html()) === url[3])) { $( "div#" + $(this).attr('class')).css('display', 'none'); } else if (!(url.length > 4)) { $(this).addClass('active'); } }); } if (url.length > 4) { var indice = 4; if (url.length > 5) { indice = 5; } $('div.agrupacion_lubricante div').each(function() { //console.log(url[indice]); console.log((convertToSlug($(this).find('a').html()))); if ((convertToSlug($(this).find('a').html()) === url[indice])) { $(this).addClass('active'); } }); } } //Lubricantes para automoción Menú PARTICULAR EU if ($('.view-id-automoziorako_lubrifikatzaileak_partikularrak').length) { var i = 0; $('.view-id-automoziorako_lubrifikatzaileak_partikularrak h3').each(function() { $('
      ').insertAfter( $(this) ); $(this).addClass('agrupacion_lubricantes' + i); $(this).nextUntil( "h3" ).each(function() { if (!$(this).is('#agrupacion_lubricantes' + i)) { $(this).appendTo('#agrupacion_lubricantes' + i); } }); ++i; }); var url = window.location.pathname.split('/'); if (url.length > 4) { $('.view-id-automoziorako_lubrifikatzaileak_partikularrak h3').each(function() { if (!(convertToSlug($(this).find('a').html()) === url[4])) { $( "div#" + $(this).attr('class')).css('display', 'none'); } else if (!(url.length > 5)) { $(this).addClass('active'); } }); } if (url.length > 5) { var indice = 5; if (url.length > 6) { indice = 6; } $('div.agrupacion_lubricante div').each(function() { if ((convertToSlug($(this).find('a').html()) === url[indice])) { $(this).addClass('active'); } }); } } //Marcas asociadas if ($('.view-id-marcas_asociadas').length) { var i = 0; $('.view-id-marcas_asociadas h3').each(function() { $('
      ').insertAfter( $(this) ); $(this).addClass('marcas_asociadas' + i); $(this).append(''); $(this).nextUntil( "h3" ).each(function() { if (!$(this).is('#marcas_asociadas' + i)) { $(this).appendTo('#marcas_asociadas' + i); } }); ++i; }); } $( ".view-marcas-asociadas h3" ).click(function() { $(this).toggleClass('clicked'); $(this).next( ".marcas_asociadas" ).slideToggle( 400, function() { }); }); if ($('.view-id-marcas_asociadas_eu').length) { var i = 0; $('.view-id-marcas_asociadas_eu h3').each(function() { $('
      ').insertAfter( $(this) ); $(this).addClass('marcas_asociadas' + i); $(this).append(''); $(this).nextUntil( "h3" ).each(function() { if (!$(this).is('#marcas_asociadas' + i)) { $(this).appendTo('#marcas_asociadas' + i); } }); ++i; }); } $( ".view-marcas-asociadas-eu h3" ).click(function() { $(this).toggleClass('clicked'); $(this).next( ".marcas_asociadas" ).slideToggle( 400, function() { }); }); //FAQ $( ".views-field-title" ).click(function() { $(this).toggleClass('clicked'); $(this).next( ".views-field-body" ).slideToggle( 400, function() { }); }); // Google Maps if($('#location_map').length){ var bounds = new google.maps.LatLngBounds(); var places = Array(); $('.latlong').each(function() { var id = $(this).attr('id').replace('latlong', ''); places.push({'location': {'lng': $(this).html().split(",")[1], 'lat': $(this).html().split(",")[0]}, 'address': $('#location' + id).html()}); }); var mapOptions = { mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("location_map"), mapOptions); $(places).each(function() { var infowindow = new google.maps.InfoWindow({ content: this.address }); var point = new google.maps.LatLng(this.location.lat, this.location.lng); var marker = new google.maps.Marker({ position: point, map: map }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map, marker); }); bounds.extend(marker.position); }); if (places.length == 1) { map.setCenter(new google.maps.LatLng(places[0].location.lat, places[0].location.lng)); map.setZoom(16); } else { map.fitBounds(bounds); } } if($('#buscaMapa').length){ $('#buscaMapa').click(function () { linkModMapa = $(this).attr('href') + '&saddr=' + $('#origen').val(); window.open(linkModMapa) return false; }); $('#origen').keypress(function (e) { if (e.which == 13) { linkModMapa = $('#buscaMapa').attr('href') + '&saddr=' + $(this).val(); window.open(linkModMapa) } }); } if (!$('#footerClubAvia').length) { $( ".footer-fourth ul" ).prepend( "
    5. Club AVIA
    6. " ); } // Filtros ventajas if ($('.filtro-ventajas').length) { $('.filtro-ventajas .views-exposed-widget').each(function() { $('#edit-field-provincia-ventaja-tid-selective-wrapper').find('label').addClass('hide'); $('#edit-field-localidad-tid-selective-wrapper').find('label').addClass('hide'); var label = $(this).find('label').html(); $(this).find('select option:first-child').html('- ' + label + ' -'); }); $('#edit-field-tipo-de-ventaja-tid-wrapper .description').insertBefore('#edit-field-tipo-de-ventaja-tid-wrapper .views-widget'); var valorSelected = $('select[name=field_localidad_tid_selective]').val(); if(valorSelected != "All") { $('#page-title').append(" en " + $("#edit-field-localidad-tid-selective option:selected" ).text()); } valorSelected = $('select[name=field_provincia_ventaja_tid_selective]').val(); if(valorSelected != "All") { $('#page-title').append(" (" + $("#edit-field-provincia-ventaja-tid-selective option:selected" ).text() + ")"); } } //Lubricante para profesionales if ($('.informacionTecnica').length) { var divs = $(".informacionTecnica > div "); for(var i = 0; i < divs.length; i+=2) { divs.slice(i, i+2).wrapAll("
      "); } } // Boton cerrar para distribuidores if ($('.distriBG').length) { if(!$('#distriBGClose').length) { $('.distribuidores_info').append(''); } } // Buscador: solo mostrar resultados del idioma en curso if ($("body").hasClass("page-search-node")){ var currentLang = $("html").attr("lang"); $(".search-result").filter(function () { var resultLang = $(this).children(".title").attr("xml:lang"); return (typeof resultLang !== "undefined") && (resultLang != currentLang); }).remove(); } $(document).on('click', '#distriBGClose' , function() { $('div.distriBG').addClass('hide'); return false; }); // Cookies /* if (jQuery('.close_advice').length) { jQuery('.close_advice').click(function() { jQuery('#cookies_advice').toggle("slow"); }); } */ //Enviar datos a Analytics desde SAT $('.view-campa-a-gasoleo-agricola a.telefono').click(function() { trackGA('event', 'mostrar', $('html').attr('lang'), $(this).html(), 0, false); }); // Añadir al botón de presupuesto de la campaña gasoleo calefacción la provincia if ($('.view-campa-a-gasoleo-calefacci-n').length) { var provincia = window.location.pathname; provincia = provincia.split('-en-'); if (provincia.length > 1) { provincia = provincia[1]; $('a.botonPresupuestoRojo').attr('href', $('a.botonPresupuestoRojo').attr('href') + '?provincia=' + provincia); } } // Rellenar el campo provincia en la campaña de gasoleo calefacción if ($('#edit-submitted-datos-de-la-empresa-y-o-particular-provincia').length) { var $_GET = {}; document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () { function decode(s) { return decodeURIComponent(s.split("+").join(" ")); } $_GET[decode(arguments[1])] = decode(arguments[2]); }); if (typeof $_GET['provincia'] !== 'undefined' && $_GET['provincia'] != '') { $('#edit-submitted-datos-de-la-empresa-y-o-particular-provincia option').each(function() { var lab = $(this).text().replace('á', 'a').replace('é', 'e').replace('í', 'i').replace('ó', 'o').replace('ú', 'u').replace('ñ', 'n').toLowerCase(); console.log(lab); if (lab == $_GET['provincia'].replace('-', ' ')) { console.log('x'); $(this).parent().val($(this).val()); } }); $('input[name="submitted[campana]"]').val('1'); } } //Aviapocket if ($('.node-type-pocket').length) { $('.node-type-pocket .filtro_estaciones').addClass('row'); $('.node-type-pocket .block-dm-avia-station-network').addClass('row'); $('.node-type-pocket .portada-pocket .row .plataformas .app .field-name-field-plataformas-app a:first-child').attr('href','https://app.adjust.com/16szynbw'); $('.node-type-pocket .portada-pocket .row .plataformas .app .field-name-field-plataformas-app a:last-child').attr('href','https://app.adjust.com/16o77j9b'); if ($(window).width() < 768) { $('.node-type-pocket header .l-header-region .large-8 .volver a').html('AVIA'); $('.node-type-pocket header .form-item-lang-dropdown-select option:first-child').html('CAST'); $('.node-type-pocket header .form-item-lang-dropdown-select option:nth-child(2)').html('EUS'); } $( document ).ready(function() { $('.node-type-pocket main .como-funciona-pocket .owl-carousel .owl-wrapper .owl-item').each(function(i) { var titleData = $(this).find('h3').text(); console.log(titleData); var paginationLinks = $('.node-type-pocket .como-funciona-pocket .owl-controls .owl-pagination .owl-page span'); console.log(paginationLinks); $(paginationLinks[i]).append(titleData); }); }); $(window).scroll(function() { if ($(window).scrollTop() > $(window).height()) { $('.banner_fixed_app').css('opacity','1'); $('.banner_fixed_app').css('pointer-events','auto'); $('.banner_fixed_app').css('top','70px'); } else { $('.banner_fixed_app').css('opacity','0'); $('.banner_fixed_app').css('pointer-events','none'); $('.banner_fixed_app').css('top','0'); } }); } } }; function cookiePermission(){ var cookieCat = getCookie("cookie-agreed-categories"); if(cookieCat){ var arrayCat = decodeURI(cookieCat); if(arrayCat.includes("2")){ return true; } } return false; } function existsCookiePermission(){ var cookieCat = getCookie("cookie-agreed-categories"); if(cookieCat){ return true; } return false; } function includeJs(jsFilePath) { var js = document.createElement("script"); js.type = "text/javascript"; js.src = jsFilePath; //js.async = false; document.body.appendChild(js); } function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i