var container_is_arrayVGkfQNP8SiYf = 1; if (document.getElementsByClassName('kartra_optin_containerVGkfQNP8SiYf').length != 0) { var kartra_containersVGkfQNP8SiYf = document.getElementsByClassName('kartra_optin_containerVGkfQNP8SiYf'); } else if (document.getElementsByClassName('kartra_optin_containerVGkfQNP8SiYf').length != 0) { var kartra_containersVGkfQNP8SiYf = document.getElementsByClassName('kartra_optin_containerVGkfQNP8SiYf'); } else { var currentScript = document.currentScript || (function() { var scripts = document.getElementsByTagName('script'); return scripts[scripts.length - 1]; })(); var kartra_containersVGkfQNP8SiYf = currentScript.parentNode; container_is_arrayVGkfQNP8SiYf = 0 } function kartra_do_the_optin_formVGkfQNP8SiYf() { if (container_is_arrayVGkfQNP8SiYf == 1) { for (i_optin_kartra = 0; i_optin_kartra < kartra_containersVGkfQNP8SiYf.length; i_optin_kartra++) { kartra_containersVGkfQNP8SiYf[i_optin_kartra].innerHTML = '\ \ \ \
\
\ \

ERROR!

\ \

This asset does not exist or its configuration is incomplete

\ \ \
\
\

Powered by KARTRA

\
\
\ \ \ '; } } else { kartra_containersVGkfQNP8SiYf.innerHTML = '\ \ \ \
\
\ \

ERROR!

\ \

This asset does not exist or its configuration is incomplete

\ \ \
\
\

Powered by KARTRA

\
\
\ \ \ '; } } js_jquery = document.createElement('script'); js_jquery.type = 'text/javascript'; js_jquery.src = 'https://app.kartra.com/js/node_modules/kartra-jquery/jquery-1.10.2/jquery-1.10.2.min.js'; analytics_script = document.createElement('script'); analytics_script.type = 'text/javascript'; analytics_script.src = 'https://app.kartra.com/resources/js/analytics/'; santitation_script = document.createElement('script'); santitation_script.type = 'text/javascript'; santitation_script.src = 'https://app.kartra.com/js/santitation_for_naked_checkout.js'; js_jquery.onload = function() { if (typeof r_done !== 'undefined' && r_done === false) { return; } kartra_do_the_optin_formVGkfQNP8SiYf(); jquery_VGkfQNP8SiYf = jQuery.noConflict(true); if (jquery_VGkfQNP8SiYf('.form_VGkfQNP8SiYf_overlay').length) { var $videoIframe = jquery_VGkfQNP8SiYf('.form_VGkfQNP8SiYf_overlay iframe[data-video-type]'); //If there is an iframe with video, it should have it's src rewritten to not autoplay it's content until needed if ($videoIframe.length) { var src = $videoIframe.attr('src'), type = $videoIframe.attr('data-video-type'); if ($videoIframe.attr('src') !== '') { if (type === 'kartra') { var videoData = $videoIframe.attr('data-video'); if (typeof videoData === 'undefined') { videoData = $videoIframe.attr('data-playlist'); $videoIframe.attr('data-playlist', videoData.replace(/autoplay/g, 'autoplay=false&autoplaceholder')); } else { $videoIframe.attr('data-video', videoData.replace(/autoplay/g, 'autoplay=false&autoplaceholder')); } $videoIframe.attr('src', src.replace(/autoplay/g, 'autoplay=false&autoplaceholder')); } else { $videoIframe.attr('src', src.replace(/autoplay/g, 'noautoplay')); } } } } jquery_VGkfQNP8SiYf(document).ready(function() { setTimeout(function(){ changeCaptchaColor(jquery_VGkfQNP8SiYf('.form_class_VGkfQNP8SiYf form')); }, 1000); //Custom dropdown close jquery_VGkfQNP8SiYf(document).click(function(event) { if (jquery_VGkfQNP8SiYf(event.target).closest('.kartra_optin_selectpicker').length === 0 ) { jquery_VGkfQNP8SiYf('.kartra_optin_dropdown-menu').hide(); } }); //Custom dropdown open jquery_VGkfQNP8SiYf(document).on('click', '[data-toggle="kartra_dropdown"]', function() { jquery_VGkfQNP8SiYf(this).parent().find('.kartra_optin_dropdown-menu').show(); }); //Handle custom dropdown mimicking the selectpicker behaviour jquery_VGkfQNP8SiYf(document).on('click', '.kartra_optin_customDropdown li a', function(){ var $element = jquery_VGkfQNP8SiYf(this), $parent = $element.parents('li:first'), $bootstrapSelect = $element.parents('.kartra_optin_bootstrap-select:first'), $customDropdown = $element.parents('.kartra_optin_customDropdown:first'); if (!$parent.hasClass('disabled')) { var identifier = jquery_VGkfQNP8SiYf('span', $element).attr('data-for'), value = jquery_VGkfQNP8SiYf('span', $element).attr('data-value').toString(), text = jquery_VGkfQNP8SiYf('.text', $element).text(), selectedText = ''; if (identifier === 'country_code') { selectedText = '+' + value; } else { selectedText = text; } if (value !== '' && typeof value !== 'undefined') { jquery_VGkfQNP8SiYf('.kartra_optin_filter-option', $bootstrapSelect).text(selectedText).addClass('selected'); jquery_VGkfQNP8SiYf('input[name="' + identifier + '"]').val(value); jquery_VGkfQNP8SiYf('li', $customDropdown).removeClass('selected'); $parent.addClass('selected'); } $customDropdown.hide(); } }); jquery_VGkfQNP8SiYf(document).on('click', '.closecross, .js_kartra_optin_collapser', function(event) { jquery_VGkfQNP8SiYf('.form_class_VGkfQNP8SiYf iframe').each(function(index, el) { var frameDOM = jquery_VGkfQNP8SiYf(this)[0]; var frameWindow = frameDOM.contentWindow ? frameDOM.contentWindow : frameDOM.contentDocument.defaultView; frameWindow.postMessage({"func":"pause"}, '*'); }); }); jquery_VGkfQNP8SiYf(document).on("click", ".kartra_optin_radio", function(){ jquery_VGkfQNP8SiYf("[name='"+jquery_VGkfQNP8SiYf(this).attr("name")+"']").parents(".kartra_optin_radio_parent").removeClass("ez-selected").removeClass("kartra_optin-selected"); jquery_VGkfQNP8SiYf("[name='"+jquery_VGkfQNP8SiYf(this).attr("name")+"']").each(function(index, element){ if (jquery_VGkfQNP8SiYf(element).is(":checked")) { jquery_VGkfQNP8SiYf(element).parents(".kartra_optin_radio_parent").addClass("ez-selected").addClass("kartra_optin-selected"); } }); }); jquery_VGkfQNP8SiYf(document).on("click", ".kartra_optin_chk", function(){ if (jquery_VGkfQNP8SiYf(this).is(":checked")) { jquery_VGkfQNP8SiYf(this).parents(".kartra_optin_chk_parent").addClass("ez-checked").addClass("kartra_optin-checked"); } else { jquery_VGkfQNP8SiYf(this).parents(".kartra_optin_chk_parent").removeClass("ez-checked").removeClass("kartra_optin-checked"); } }); jquery_VGkfQNP8SiYf('.form_class_VGkfQNP8SiYf .close').on('click', function() { jquery_VGkfQNP8SiYf('.form_VGkfQNP8SiYf_overlay').fadeOut(); jquery_VGkfQNP8SiYf("body").css('overflow',''); jquery_VGkfQNP8SiYf('html').css('overflow',''); jquery_VGkfQNP8SiYf('body').removeClass("kartra_body_reset"); }); jquery_VGkfQNP8SiYf(document).on('change', '#terms_VGkfQNP8SiYf', function() { var $tncCheck = jquery_VGkfQNP8SiYf(this), $form = $tncCheck.parents('.form_class_VGkfQNP8SiYf:first'), $submitButton = $form.find('.submit_button_VGkfQNP8SiYf, .kartra_optin_submit_btn'); kartra_validate_optin('VGkfQNP8SiYf'); }); jquery_VGkfQNP8SiYf('.js_gdpr_terms_check').on("change", function() { kartra_validate_optin('VGkfQNP8SiYf'); }); jquery_VGkfQNP8SiYf('.js_gdpr_communications_check').on("change", function() { kartra_validate_optin('VGkfQNP8SiYf'); }); jquery_VGkfQNP8SiYf(document).on("click", '.show_modal_VGkfQNP8SiYf,.show_modal_own_VGkfQNP8SiYf', function(){ if (jquery_VGkfQNP8SiYf('.form_VGkfQNP8SiYf_overlay:first').attr('data-autoplay-triggered') !== 'true') { jquery_VGkfQNP8SiYf('.form_VGkfQNP8SiYf_overlay:first').attr('data-autoplay-triggered', 'true'); var $videoIframe = jquery_VGkfQNP8SiYf('.form_VGkfQNP8SiYf_overlay:first iframe[data-video-type]'); if ($videoIframe.length) { var src = $videoIframe.attr('src'), type = $videoIframe.attr('data-video-type'); if ($videoIframe.attr('src') !== '' && src.indexOf('autop') > -1) { if (type === 'kartra') { var videoData = $videoIframe.attr('data-video'); if (typeof videoData === 'undefined') { videoData = $videoIframe.attr('data-playlist'); $videoIframe.attr('data-playlist', videoData.replace(/autoplay=false&/g, '')); $videoIframe.attr('data-playlist', videoData.replace(/autoplaceholder/g, 'autoplay')); } else { $videoIframe.attr('data-video', videoData.replace(/autoplay=false&/g, '')); $videoIframe.attr('data-video', videoData.replace(/autoplaceholder/g, 'autoplay')); } $videoIframe.attr('src', src.replace(/autoplay=false&/g, '')); $videoIframe.attr('src', src.replace(/autoplaceholder/g, 'autoplay')); } else { $videoIframe.attr('src', src.replace(/noautoplay/g, 'autoplay')); } } } } jquery_VGkfQNP8SiYf('.form_VGkfQNP8SiYf_overlay:first').show(); // trigger the analytics - start jquery_VGkfQNP8SiYf('.form_VGkfQNP8SiYf_overlay:first').attr('id', 'form_VGkfQNP8SiYf_overlay_shown'); var elem = document.getElementById('form_VGkfQNP8SiYf_overlay_shown'); var event = new Event('kartra_show_hidden_asset'); elem.dispatchEvent(event); jquery_VGkfQNP8SiYf('.form_VGkfQNP8SiYf_overlay:first').removeAttr('id'); // trigger the analytics - end jquery_VGkfQNP8SiYf("html").css('overflow','hidden'); jquery_VGkfQNP8SiYf('body').addClass("kartra_body_reset"); adjustFormByResolution(); }); jquery_VGkfQNP8SiYf('[data-screenshot="true"]').each(function() { var src = jquery_VGkfQNP8SiYf(this).attr('data-thumbnail'); jquery_VGkfQNP8SiYf(this).html(''); }); jquery_VGkfQNP8SiYf('input, select, button, textarea').on('focus', function() { jquery_VGkfQNP8SiYf(this).removeClass('form_VGkfQNP8SiYf_error_border'); if (jquery_VGkfQNP8SiYf(this).is(':radio') || jquery_VGkfQNP8SiYf(this).is(':checkbox')) { jquery_VGkfQNP8SiYf(this).parents('.kartra_optin_field').find('small').removeClass('form_VGkfQNP8SiYf_error_border'); } }); jquery_VGkfQNP8SiYf(document) .off('click','.form_class_VGkfQNP8SiYf .submit_button_VGkfQNP8SiYf, .form_class_VGkfQNP8SiYf .kartra_optin_submit_btn') .on('click','.form_class_VGkfQNP8SiYf .submit_button_VGkfQNP8SiYf, .form_class_VGkfQNP8SiYf .kartra_optin_submit_btn', function (e) { e.preventDefault(); jquery_VGkfQNP8SiYf('.form_class_VGkfQNP8SiYf .kartra_optin_submit_btn').attr('disabled', true); setTimeout(function(){ jquery_VGkfQNP8SiYf('.form_class_VGkfQNP8SiYf .kartra_optin_submit_btn').attr('disabled', false); }, 3000); var error = false, the_form = jquery_VGkfQNP8SiYf(this).parents('.form_class_VGkfQNP8SiYf form').first(), captchaVerification = null; jquery_VGkfQNP8SiYf.each(the_form.find('.required_VGkfQNP8SiYf'), function() { if (jquery_VGkfQNP8SiYf(this).is(':radio') || jquery_VGkfQNP8SiYf(this).is(':checkbox')) { if (the_form.find('[name="'+jquery_VGkfQNP8SiYf(this).attr('name')+'"]:checked').length==0) { the_form.find('[name="'+jquery_VGkfQNP8SiYf(this).attr('name')+'"]').siblings('small').addClass('form_VGkfQNP8SiYf_error_border'); error = true; return; } else { the_form.find('[name="'+jquery_VGkfQNP8SiYf(this).attr('name')+'"]').siblings('small').removeClass('form_VGkfQNP8SiYf_error_border'); } } if (jquery_VGkfQNP8SiYf(this).is(':hidden')) { if(jquery_VGkfQNP8SiYf(this).val()=='' || jquery_VGkfQNP8SiYf(this).val()==null) { error = true; jquery_VGkfQNP8SiYf(this).parent().find('.kartra_optin_bootstrap-select button.dropdown-toggle').addClass('form_VGkfQNP8SiYf_error_border'); } else { jquery_VGkfQNP8SiYf(this).parent().find('.kartra_optin_bootstrap-select button.dropdown-toggle').removeClass('form_VGkfQNP8SiYf_error_border'); } } else { if ( (!jquery_VGkfQNP8SiYf(this).is(':radio') && !jquery_VGkfQNP8SiYf(this).is(':checkbox')) && (jquery_VGkfQNP8SiYf(this).val()=='' || jquery_VGkfQNP8SiYf(this).val()==null || (jquery_VGkfQNP8SiYf(this).attr('name') == 'email' && !validateEmail(jquery_VGkfQNP8SiYf(this).val()))) ) { jquery_VGkfQNP8SiYf(this).addClass('form_VGkfQNP8SiYf_error_border'); error = true; return; } else { jquery_VGkfQNP8SiYf(this).removeClass('form_VGkfQNP8SiYf_error_border'); } } }); if (!error) { if (the_form.find('[name="captcha"]').length) { var captchaPattern = the_form.find('[name="captcha"]').val(), captchaPatternId = the_form.find('[name="captcha_patterns_id"]').val(), fillColor = the_form.find('[name="captcha"]').css('color'); captchaVerification = verifyCaptcha(captchaPattern, captchaPatternId, fillColor); } Promise.resolve(captchaVerification).then(function(response) { if (response && !response.success) { the_form.find('.js_kartra_captcha').html(response.new_svg.svg); the_form.find('[name="captcha_patterns_id"]').val(response.new_svg.captcha_patterns_id); the_form.find('[name="captcha"]').addClass('form_VGkfQNP8SiYf_error_border'); } else { the_form.submit(); } }); } }); jquery_VGkfQNP8SiYf('body').append(jquery_VGkfQNP8SiYf('.form_VGkfQNP8SiYf_overlay').detach()); adjustFormByResolution(); kartra_checkout_jquery = jquery_VGkfQNP8SiYf; //apply sanitation on the form window.jsVars = []; if ('undefined' !== typeof window.jsVars && 'undefined' !== typeof window.jsVars.sanitation_rules && 'function' === typeof apply_santitation) { apply_santitation(window.jsVars.sanitation_rules); } if ('undefined' !== typeof window.jsVars && 'undefined' !== typeof window.jsVars['gdpr_settings'] && 'function' === typeof kartra_init_optin_gdpr) { kartra_init_optin_gdpr('VGkfQNP8SiYf'); } if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) { jquery_VGkfQNP8SiYf('.js_kartra_gdpr_popover').find(".kartra_optin_well-inner").removeClass("kartra_optin_well-inner_npadding"); jquery_VGkfQNP8SiYf('.js_kartra_popover_gdpr_trigger').on("click",function() { jquery_VGkfQNP8SiYf('.js_kartra_gdpr_popover').fadeIn(300); var bottomBar = jquery_VGkfQNP8SiYf(this).parents('.js_kartra_optin_bar_toggle:first'), distanceGDPR = jquery_VGkfQNP8SiYf(this).parents(".js_gdpr_terms")[0].getBoundingClientRect().top; if (bottomBar.length && bottomBar.hasClass('kartra_optin_bottombar')) { var formContainerPosition = bottomBar.offset(), gdprPosition = jquery_VGkfQNP8SiYf(this).offset(), offset = formContainerPosition.top - gdprPosition.top; distanceGDPR = Math.sqrt(offset * offset); } if (distanceGDPR > 310 ){ jquery_VGkfQNP8SiYf(this).parents(".js_gdpr_terms").find(".js_kartra_gdpr_popover .kartra_optin_well-inner").css("max-height", "300px"); } else { jquery_VGkfQNP8SiYf(this).parents(".js_gdpr_terms").find(".js_kartra_gdpr_popover .kartra_optin_well-inner").css("max-height", (distanceGDPR - 10)); } }) } else { jquery_VGkfQNP8SiYf('.js_kartra_gdpr_popover').find(".kartra_optin_well-inner").addClass("kartra_optin_well-inner_npadding"); jquery_VGkfQNP8SiYf(".js_gdpr_terms").hover(function() { jquery_VGkfQNP8SiYf(this).find('.js_kartra_gdpr_popover').fadeIn(300); var bottomBar = jquery_VGkfQNP8SiYf(this).parents('.js_kartra_optin_bar_toggle:first'), distanceGDPR = jquery_VGkfQNP8SiYf(this)[0].getBoundingClientRect().top; if (bottomBar.length && bottomBar.hasClass('kartra_optin_bottombar')) { var formContainerPosition = bottomBar.offset(), gdprPosition = jquery_VGkfQNP8SiYf(this).offset(), offset = formContainerPosition.top - gdprPosition.top; distanceGDPR = Math.sqrt(offset * offset); } if (distanceGDPR > 310){ jquery_VGkfQNP8SiYf(this).find(".js_kartra_gdpr_popover .kartra_optin_well-inner").css("max-height", "300px"); } else { jquery_VGkfQNP8SiYf(this).find(".js_kartra_gdpr_popover .kartra_optin_well-inner").css("max-height", (distanceGDPR - 10)); } }, function() { jquery_VGkfQNP8SiYf(this).find('.js_kartra_gdpr_popover').hide(); }) } jquery_VGkfQNP8SiYf('.js_utility_popover_close').on('click', function() { jquery_VGkfQNP8SiYf(this).parents('.js_kartra_popover').hide(); }); jquery_VGkfQNP8SiYf('body').on('click', function(e) { if (jquery_VGkfQNP8SiYf(e.target).hasClass('js_kartra_popover') || jquery_VGkfQNP8SiYf(e.target).parents('.js_kartra_popover').length > 0 || jquery_VGkfQNP8SiYf(e.target).hasClass('js_kartra_popover_trigger') || jquery_VGkfQNP8SiYf(e.target).parents('.js_kartra_popover_trigger').length > 0) { if (jquery_VGkfQNP8SiYf(e.target).hasClass('js_kartra_popover_trigger') || jquery_VGkfQNP8SiYf(e.target).parents('.js_kartra_popover_trigger').length > 0) { if (jquery_VGkfQNP8SiYf(e.target).hasClass('js_kartra_popover_trigger')) { element = jquery_VGkfQNP8SiYf(e.target); } else { element = jquery_VGkfQNP8SiYf(e.target).parents('.js_kartra_popover_trigger') } var the_popover = typeof jquery_VGkfQNP8SiYf(element).attr('data-popover') !== 'undefined' ? jquery_VGkfQNP8SiYf(element).attr('data-popover') : 'js_kartra_gdpr_popover' ; jquery_VGkfQNP8SiYf(".js_kartra_popover").filter(function() { return jquery_VGkfQNP8SiYf(this).css('display') != 'none'}).not(jquery_VGkfQNP8SiYf('.'+the_popover)).find(" .js_utility_popover_close").trigger('click'); } } else { jquery_VGkfQNP8SiYf(".js_kartra_popover").filter(function() { return jquery_VGkfQNP8SiYf(this).css('display') != 'none'}).find(".js_utility_popover_close").trigger('click'); } }); }); jquery_VGkfQNP8SiYf(window).on('resize', function() { adjustFormByResolution(); }); function verifyCaptcha(captchaPattern, captchaPatternId, fillColor) { return jquery_VGkfQNP8SiYf.ajax({ url : 'https://app.kartra.com/process/verifyCaptcha/VGkfQNP8SiYf', type : 'POST', data : { 'captcha_pattern' : captchaPattern, 'captcha_patterns_id' : captchaPatternId, 'fill_color' : fillColor }, xhrFields : { withCredentials : true } }); } function kartra_init_optin_gdpr(form_id) { var optin_id = form_id; var $form = jquery_VGkfQNP8SiYf('.form_class_'+form_id); var optin_settings = window.jsVars['gdpr_settings']; if (optin_settings.display == true) { if (optin_settings.terms_display || optin_settings.communications_display) { $form.find('.js_gdpr_wrapper').show(); } $form.find('.js_gdpr_terms')[optin_settings.terms_display ? 'show' : 'hide'](); $form.find('.js_gdpr_communications')[optin_settings.communications_display ? 'show' : 'hide'](); $form.find('.js_gdpr_terms_check').attr('checked', optin_settings.terms_checked); $form.find('.js_gdpr_communications_check').attr('checked', optin_settings.communications_checked); $form.find('.js_gdpr_terms_text').html(optin_settings.terms_text); $form.find('.js_gdpr_label_communications').text(optin_settings.communications_label); $form.find('.js_gdpr_label_terms').text(optin_settings.terms_label); } kartra_validate_optin(form_id) } function kartra_validate_optin(form_id) { var optin_id = form_id; var $form = jquery_VGkfQNP8SiYf('.form_class_'+form_id); var valid = true; if ($form.find('#terms_'+form_id).length > 0 && !$form.find('#terms_'+form_id).is(':checked')) { valid = false; } var optin_settings = window.jsVars['gdpr_settings']; if (optin_settings.display) { if (valid && optin_settings.communications_required && !$form.find('[name="gdpr_communications"]').is(':checked')) { valid = false; } if (valid && optin_settings.terms_required && !$form.find('[name="gdpr_terms"]').is(':checked')) { valid = false; } } $submitButton = $form.find('.submit_button_'+optin_id+', .kartra_optin_submit_btn'); $submitButton.attr('disabled', !valid); } function adjustFormByResolution() { var $viewHolder = jquery_VGkfQNP8SiYf('.form_class_VGkfQNP8SiYf .js_optin_view_holder'), breakPoints = $viewHolder.data('breakpoints'), width = $viewHolder.outerWidth(); if ($viewHolder.length && typeof breakPoints !== 'undefined') { $viewHolder.removeClass (function (index, className) { return (className.match (/(^|\s)kartra_optin_force_breaking_point_\S+/g) || []).join(' '); }); if (width > breakPoints[3]) { $viewHolder.addClass('kartra_optin_force_breaking_point_xlarge'); } else if (width > breakPoints[2] && width <= breakPoints[3]) { $viewHolder.addClass('kartra_optin_force_breaking_point_large'); } else if (width > breakPoints[1] && width <= breakPoints[2]) { $viewHolder.addClass('kartra_optin_force_breaking_point_medium'); } else if (width > breakPoints[0] && width <= breakPoints[1]) { $viewHolder.addClass('kartra_optin_force_breaking_point_small'); } else { $viewHolder.addClass('kartra_optin_force_breaking_point_xsmall'); } } } function changeCaptchaColor($form) { var $captchaInput = $form.find('[name="captcha"]'), inputColor = $captchaInput.css('color'), $captchaSvgPath = $form.find('.js_kartra_captcha svg path'); $captchaSvgPath.attr('fill', inputColor); } }; document.body.appendChild(analytics_script); document.body.appendChild(santitation_script); document.body.appendChild(js_jquery); function validateEmail(email) { var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); }