"use strict";!function(o){var e=".hover-join",n=".hover-join-form",i=".hover-join .join-option",t=".hover-join h4",s="killedJoinFormOnScroll";"undefined"==typeof EdgeCms&&(EdgeCms={}),EdgeCms.HoverJoinForm={shouldShow:!0,selectedPackage:null,construct:function(){this.attachEvents(),this.shouldShow="yes"!=Cookies.get(s)},attachEvents:function(){o(i).on("click ontouchend",this.savePackageChoice.bind(this)),o(".join-option .price").on("click ontouchend",this.savePackageChoice.bind(this)),o(i).on("click ontouchend",this.promptForUsernameAndPassword.bind(this)),o(".hover-join .close-btn").on("click ontouchend",this.closeForm.bind(this)),o(window).on("scroll",this.displayForm.bind(this))},promptForUsernameAndPassword:function(e){"Loading your selection..."!=o(t).html()&&o(t).slideUp(300,(function(){o(t).html("Loading your selection..."),o(t).slideDown(300)})),o(i).each((function(n,i){i!=e.currentTarget?o(i).fadeTo(300,.3):(o(i).find('input[type="radio"]').prop("checked",!0),o(i).fadeTo(0,1))})),EdgeCms.JoinFormUsernamePrompt.promptForUsernameAndPassword(e,this)},submitForm:function(e){o(n).submit()},closeForm:function(n){o(e).fadeOut(),Cookies.set(s,"yes",{expires:7,path:"/"}),n.preventDefault()},clearForm:function(){o(e).fadeOut()},displayForm:function(){this.shouldShow&&o(window).scrollTop()>1500&&o(window).width()>779&&(o(e).fadeIn(),this.shouldShow=!1)},assignPackage:function(e){this.selectedPackage=e,o(n).find('[name="pkg"]').val(e)},savePackageChoice:function(e){if(o(e.target).is(i))var n=o(e.target);else n=o(e.target).parents(i);var t=n.find('[type="radio"]');this.assignPackage(t.val())}},EdgeCms.HoverJoinForm.construct()}(jQuery);