// source --> https://www.autisme.nl/wp-content/plugins/snowball_popup/js/popup.js?ver=20220615 
jQuery(document).ready(function() {


    //Scroll
    jQuery(window).on("resize scroll", function() {
      var screen = jQuery(window);
      if (screen.width() >= .768 && $('#snowball_popup').length && !sd765xs_getCookie('snowball_banner_hide')) {
        if (screen.scrollTop() > (screen.height() / 3)) {
          jQuery('#snowball_popup').addClass('show');
        }
      }
    });

    //Click close
    jQuery("#snowball_popup .close, #snowball_popup .btn").on("click touchstart",function(){
      jQuery("#snowball_popup").removeClass('show');
      sd765xs_setCookie('snowball_banner_hide', 'yes', 60 * 60 * 24 * popup_vars.cookie_days);
    });
});


function sd765xs_setCookie(cname, cvalue, exsecs) {
  var d = new Date();
  d.setTime(d.getTime() + (exsecs * 1000));
  var expires = "expires=" + d.toUTCString();
  document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}

function sd765xs_getCookie(cname) {
  var name = cname + "=";
  var decodedCookie = decodeURIComponent(document.cookie);
  var ca = decodedCookie.split(';');
  for (var i = 0; i < ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0) == ' ') {
      c = c.substring(1);
    }
    if (c.indexOf(name) == 0) {
      return c.substring(name.length, c.length);
    }
  }
  return "";
};
// source --> https://www.autisme.nl/wp-content/themes/nva_autisme_v1.3/js/form_frame_height.js?ver=202501061100 
function FormAutoHeight(obj) {
	height = obj.contentWindow.document.documentElement.scrollHeight;
	obj.height = height + 'px';
};