function bindings(){$(".scroll-down, .anchors a, .showcase .node, .play-button, .video-overlay .close, .tabs .tab, .selection-wrapper .selection, .result-count .btn, .results-inner .product .compare-item, .btn.compare, .next-form-step, .prev-form-step, #register-product .submit, .btn.show-advanced, .add-to-compare, .model-info, .blog h2.expand, .trigger-selections, .show-all, .premiere .image-showcase .images, .open-video, .tab-reviews, .museum-overlay .close, .schedule-visit").unbind("click");$("#museum-form").unbind("submit");$(".scroll-down").on("click",function(){var n=$(this).parent().next(".container");$("html, body").animate({scrollTop:n.offset().top},400)});$(".anchors a").on("click",function(n){n.preventDefault();var t=$(this).attr("href"),i=$(t);$("html, body").animate({scrollTop:i.offset().top},400)});$(".tab-reviews").on("click",function(n){n.preventDefault();$(".tabs .tab[data-tab='reviews']").click();$("html, body").animate({scrollTop:$(".tabs").offset().top},400)});$(".showcase .node").on("click",function(){var n=$(this).index(),t=$(this).attr("data-label");$(".showcase .node, .showcase .images img").removeClass("active");$(this).addClass("active");$(".showcase .images img").eq(n).addClass("active");$(".showcase .label").text(t)});$(".touchevents").length&&$(".premiere .image-showcase .images").swipe({swipeRight:function(){var n=$(".node.active").prev().index(),t=$(".node.active").prev().attr("data-label");$(".showcase .node, .showcase .images img").removeClass("active");$(".node").eq(n).addClass("active");$(".showcase .images img").eq(n).addClass("active");$(".showcase .label").text(t)},swipeLeft:function(){var n=$(".node.active").next().index(),t=$(".node.active").next().attr("data-label");-1===n&&(n=0,t=$(".node").eq(n).attr("data-label"));$(".showcase .node, .showcase .images img").removeClass("active");$(".node").eq(n).addClass("active");$(".showcase .images img").eq(n).addClass("active");$(".showcase .label").text(t)},threshold:35});$(".premiere .image-showcase .images").on("click",function(){if(!$(".touchevents").length){var n=$(".node.active").next().index(),t=$(".node.active").next().attr("data-label");-1===n&&(n=0,t=$(".node").eq(n).attr("data-label"));$(".showcase .node, .showcase .images img").removeClass("active");$(".node").eq(n).addClass("active");$(".showcase .images img").eq(n).addClass("active");$(".showcase .label").text(t)}});$(".play-button").on("click",function(){if(sliderChk===!1){var t=$(this).parent().attr("data-video"),n=t.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{10,12})/i);null!=n?gww>640?($(".video-overlay .video").html('<iframe width="560" height="315" src="https://www.youtube.com/embed/'+n[1]+'?autoplay=1&rel=0" frameborder="0" allowfullscreen><\/iframe>'),$(".video-overlay").addClass("active")):window.open("https://www.youtube.com/watch?v="+n[1],"_blank"):console.log("not a youtube url")}});$(".open-video").on("click",function(){if(sliderChk===!1){var t=$(this).attr("data-video"),n=t.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{10,12})/i);null!=n?gww>640?($(".video-overlay .video").html('<iframe width="560" height="315" src="https://www.youtube.com/embed/'+n[1]+'?autoplay=1&rel=0" frameborder="0" allowfullscreen><\/iframe>'),$(".video-overlay").addClass("active")):window.open("https://www.youtube.com/watch?v="+n[1],"_blank"):console.log("not a youtube url")}});$(".slider-container .slide img").on("click",function(){if(sliderChk===!1&&gww>640){var n=$(this).parent().attr("data-full-image");$(".video-overlay .video").html('<img src="'+n+'" />');$(".video-overlay").addClass("active")}});$(".video-overlay .close").on("click",function(){$(".video-overlay").removeClass("active");$("body").removeClass("overflow");setTimeout(function(){$(".video-overlay .video").html("")},400)});$(".tabs .tab").on("click",function(){var n=$(this).attr("data-tab");$(".tabs .tab, .tab-container > div").removeClass("active");$(this).addClass("active");$("#tab-"+n).addClass("active");closeDropdown()});$(".compare-model").on("click",function(){var n=$(this).parent().index();$(".compare .dropdown").attr("data-column",n);$(".compare .dropdown").data("column",n);$(".compare .dropdown").slideDown()});$(".dropdown .close").on("click",function(){closeDropdown()});$(".selection-wrapper .selection").on("click",function(){selectorToolSelection($(this))});$(".show-all").on("click",function(){selectorToolSelection($(this),!0);$(".initial-selection").hide();$(".result-count").hide();$(".choice-wrapper").hide();$(".selector-tool").show();$(".results").show()});$(".result-count .btn").on("click",function(){$(this).hasClass("disabled")||($(this).hasClass("active")?($(this).removeClass("active"),$(this).text("Show me the results"),$(".choice-wrapper").slideDown(600),$(".results").slideUp(600)):($(this).addClass("active"),$(this).text("Back to the questions"),$(".choice-wrapper").slideUp(600),$(".results").slideDown(600)),700>gww&&$(".btn.compare").text("Select 2 products to compare"),$("html, body").animate({scrollTop:$(".selector-tool").offset().top},600))});$(".trigger-selections").on("click",function(){$(".initial-selection").hide();$(".selector-tool").show()});$(".results-inner .product .compare-item").on("click touchstart",function(n){var t=3,u=n.target.nodeName,i=n.target.className,f=$(".selector-tool").data("type"),r;(dataLayer.push({category:f,action:"Comparison Interactions",label:$(this).parent().find("h1").text()}),$(".touchevents").length)&&(r=n.originalEvent.targetTouches[0],u=r.target.nodeName,i=r.target.className);700>gww&&(t=2);$(this).hasClass("disabled")||($(this).hasClass("active")&&"btn"!==i?$(this).removeClass("active"):$(this).hasClass("active")&&"btn"===i?runCompare():$(this).addClass("active"));$(".compare-item.active").length>1&&$(".compare-item.active").length<t||2===t&&$(".compare-item.active").length<t?($(".compare-item p").removeClass("btn"),$(".compare-item.active").length>1&&$(".compare-item.active p").addClass("btn"),(1===$(".compare-item.active").length&&2===t||$(".compare-item.active").length<=2&&3===t)&&$(".compare-item:not(.active)").removeClass("disabled")):$(".compare-item.active").length===t?($(".compare-item.active p").addClass("btn"),$(".compare-item:not(.active)").addClass("disabled")):($(".compare-item p").removeClass("btn"),$(this).children("p").removeClass("btn"));$(".compare-item.active").length>1?($(".btn.compare").removeClass("disabled").addClass("shadow"),$(".btn.compare").text("Compare selected models")):($(".btn.compare").addClass("disabled").removeClass("shadow"),$(".btn.compare").text(3===t?"Select 2-3 products to compare":"Select 2 products to compare"))});$(".btn.show-advanced").on("click",function(n){n.preventDefault();$(this).toggleClass("active");$(this).hasClass("active")?($(".advanced-specs").slideDown(600),$(".btn.show-advanced").text("Show Reduced Specs"),$("html, body").animate({scrollTop:$(".advanced-specs").offset().top-100},600)):($(".advanced-specs").slideUp(600),$(".btn.show-advanced").text("Show Advanced Specs"),$("html, body").animate({scrollTop:$(".advanced-specs").offset().top-100},600))});$(".btn.compare").on("click",function(){runCompare()});$(".next-form-step").on("click",function(n){n.preventDefault();nextFormStep(!1)});$("#register-product .submit").on("click",function(n){n.preventDefault();nextFormStep(!0)});$(".prev-form-step").on("click",function(n){n.preventDefault();prevFormStep()});$(".model-info").on("click",".remove",function(){var n=$(this).parent().parent().index();$(".compare-models-wrapper table tr:not(.grey)").each(function(){var t=$(this).children("td").eq(n);0===$(this).index()?(t.children(".model-info").html(""),t.children(".add-model").removeClass("hidden"),$(this).children("td").eq(n+1).addClass("hidden"),$(this).children("td").eq(n-1).find(".remove").show()):t.children("p").html("")})});$(".schedule-visit").on("click",function(n){n.preventDefault();$(".museum-overlay").addClass("active")});$(".museum-overlay .close").on("click",function(){$(".museum-overlay").removeClass("active")});var n=!1;$("#museum-form").on("submit",function(t){var u;t.preventDefault();var i=$(this),r=!1,f=/^[^@\s]+@[^@\s]+\.[^@\s]+$/,e=/\b(http|https)?(:\/\/)?(\S*)\.(\w{2,4})(.*)/g;i.find("#dealer_id").val();i.find("#first_name").val();(i.find("input").each(function(){var n=$(this),t=n.val(),i=n.attr("name");"name"===i&&""===t&&(n.parent().addClass("error"),r=!0);"date"===i&&""===t&&(n.parent().addClass("error"),r=!0);"time"===i&&""===t&&(n.parent().addClass("error"),r=!0);"email"!==i||t.match(f)||(n.parent().addClass("error"),r=!0);"email"!=i&&t.match(e)&&(n.parent().addClass("error"),r=!0)}),r===!1)?(u='{"name":"'+i.find("input[name='name']").val()+'", "email":"'+i.find("input[name='email']").val()+'", "clubName":"'+i.find("input[name='clubName']").val()+'", "date":"'+i.find("input[name='date']").val()+'", "time":"'+i.find("input[name='time']").val()+'", "length":"'+i.find("input[name='length']").val()+'", "adults":"'+i.find("input[name='adults']").val()+'", "children":"'+i.find("input[name='children']").val()+'", "handicap":"'+i.find("input[name='handicap']").val()+'", "general":"'+i.find("textarea[name='general']").val()+'"}',n===!1&&(n=!0,$.ajax({type:"POST",url:"/service/museumrequest",contentType:"application/json; charset=utf-8",data:u,dataType:"json",error:function(n,t,i){console.log("Request: "+n.toString()+"\n\nStatus: "+t+"\n\nError: "+i)},success:function(){$(".museum-overlay").removeClass("active");$(".schedule-visit").before("<p><strong>Thank you for scheduling your visit,<br>someone will be in touch with you soon.<\/strong><\/p>");$("html, body").animate({scrollTop:$(".schedule-visit").parent().offset().top},400);$(".schedule-visit").remove();n=!1}}))):(i.find("error").first(),$(".museum-form").animate({scrollTop:i.find(".error").first().position().top},400))})}function setCookie(n,t,i){var r=new Date,u;r.setTime(r.getTime()+i*864e5);u="expires="+r.toUTCString();document.cookie=n+"="+t+";"+u+";path=/"}function getCookie(n){for(var t,r=n+"=",u=document.cookie.split(";"),i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1);if(t.indexOf(r)==0)return t.substring(r.length,t.length)}return""}$(document).ready(function(){var n=$(window).innerHeight(),t=$(window).innerWidth();$(".open-video").on("click",function(){var i=$(this).attr("data-video"),n=i.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{10,12})/i);null!=n?t>640?($(".video-overlay .video").html('<iframe width="560" height="315" src="https://www.youtube.com/embed/'+n[1]+'?autoplay=1&rel=0" frameborder="0" allowfullscreen><\/iframe>'),$(".video-overlay").addClass("active")):window.open("https://www.youtube.com/watch?v="+n[1],"_blank"):console.log("not a youtube url")});$(".video-overlay .close").on("click",function(){$(".video-overlay").removeClass("active");$("body").removeClass("overflow");setTimeout(function(){$(".video-overlay .video").html("")},400)});$(".mobile-toggle").on("click",function(){$(this).hasClass("active")?($(this).removeClass("active"),$(".main-nav").removeClass("open"),$("body").removeClass("hide-scroll")):($(".toggle").removeClass("active"),$(this).addClass("active"),$(".main-nav").addClass("open"),window.innerWidth<=480&&$("body").addClass("hide-scroll"))});$(".toggle.region-toggle, .mobile.region-toggle").on("click",function(){$(this).hasClass("active")?($(this).removeClass("active"),$(".mobile-toggle").css("pointer-events","all"),$(".region-menu").removeClass("open")):($(".toggle").removeClass("active"),$(this).addClass("active"),$(".mobile-toggle").css("pointer-events","none"),$(".menu.open").removeClass("open"),$(".region-menu").addClass("open"))});$(".toggle.search-toggle").on("click",function(){$(this).hasClass("active")?($(this).removeClass("active"),$(".search-menu").removeClass("open"),$("input[name='k']").blur()):($(".toggle").removeClass("active"),$(this).addClass("active"),$(".menu.open").removeClass("open"),$(".search-menu").addClass("open"),$("input[name='k']").focus())});$(window).on("scroll",function(){var i=$("html").scrollTop()|$("body").scrollTop(),t=.8;t=n>=800?.8:1.05;$(".scroll-in").each(function(){var r=$(this);i>=r.offset().top-n*t?r.addClass("scrolled"):r.removeClass("scrolled")})});$(".showcase .node").on("click",function(){var n=$(this).index(),t=$(this).attr("data-label");$(".showcase .node, .showcase .images img").removeClass("active");$(this).addClass("active");$(".showcase .images img").eq(n).addClass("active");$(".showcase .label").text(t)});$(".touchevents").length&&$(".premiere .image-showcase .images").swipe({swipeRight:function(){var n=$(".node.active").prev().index(),t=$(".node.active").prev().attr("data-label");$(".showcase .node, .showcase .images img").removeClass("active");$(".node").eq(n).addClass("active");$(".showcase .images img").eq(n).addClass("active");$(".showcase .label").text(t)},swipeLeft:function(){var n=$(".node.active").next().index(),t=$(".node.active").next().attr("data-label");-1===n&&(n=0,t=$(".node").eq(n).attr("data-label"));$(".showcase .node, .showcase .images img").removeClass("active");$(".node").eq(n).addClass("active");$(".showcase .images img").eq(n).addClass("active");$(".showcase .label").text(t)},threshold:35});$(".premiere .image-showcase .images").on("click",function(){if(!$(".touchevents").length){var n=$(".node.active").next().index(),t=$(".node.active").next().attr("data-label");-1===n&&(n=0,t=$(".node").eq(n).attr("data-label"));$(".showcase .node, .showcase .images img").removeClass("active");$(".node").eq(n).addClass("active");$(".showcase .images img").eq(n).addClass("active");$(".showcase .label").text(t)}});$(".expand-trigger").on("click",function(n){n.preventDefault();$(this).toggleClass("open");$(this).hasClass("open")?$(this).closest(".block").children(".expand").slideDown():$(this).closest(".block").children(".expand").slideUp()})})