var validNavigation = false; var survey_showed1 = false; var disabledConfirm_exit = false; var surveyID = 119; var conversieWrapper1 = '#conversieToolInfo119'; var conversie_lasttime1 = readCookie('conversiepopup119_lasttime'); var visitor_type1 = 'new'; var visitor_from1 = 'all'; var when_appear1 = 'timer'; var where_appear_url1 = ''; var where_appear_operator1 = 'undefined'; var where_appear_condition1 = 'undefined'; var where_appear_value1 = ''; var appear_time1 = ''; var pop_effect1 = ''; var is_unregistered1 = 'false'; var mailing_id1 = ''; var current_page = window.location.href.toLowerCase(); var time_fromlast1 = 0; function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var ca = document.cookie.split(';'); var nameEQ = name + "="; for(var i=0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; } var count_visited1 = readCookie('conversiepopup119_counter'); if( count_visited1 == 'null' || count_visited1 == null) { count_visited1 = 1; } else { count_visited1++; } createCookie('conversiepopup119_counter', count_visited1 ,365); var isActive1 = '0'; //var isPopup = readCookie('conversiepopup119'); var isPopup1 = '1'; //if( appear_time1 == '' || parseInt(count_visited1) < parseInt(appear_time1)) { //isPopup = '0'; //} if( appear_time1 == '') { appear_time1 = '0';} if( appear_time1 == '0' || parseInt(count_visited1) <= parseInt(appear_time1)) { isPopup1 = '0'; } if( is_unregistered1 == 'true') { //check if the user already sign up using the mailing tool var conversie_mailing = readCookie('conversie_mailing_thankyou_' + mailing_id1); if( conversie_mailing == null) { conversie_mailing = '';} if( conversie_mailing.indexOf(window.location.host) >= 0) { isPopup1 = '1'; } } if( (isPopup1 != '1' || when_appear1 == 'leave') && isActive1 == '1') { var url = 'https://conversietools.be//js/jquery.js'; var url_jqueryui = 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js'; var head = document.getElementsByTagName('head')[0]; if(!window.jQuery) { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; //script.onreadystatechange = callback1; script.onload = callback1; head.appendChild(script); } else { callback1(); } var link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = 'https://conversietools.be//css/style_embed_popup.css'; link.media = 'all'; head.appendChild(link); } function embedValidNavigation() { // Attach the event keypress to exclude the F5 refresh jQuery('document').bind('keypress', function(e) { if (e.keyCode == 116){ validNavigation = true; } }); // Attach the event click for all links in the page jQuery("a").bind("click", function() { validNavigation = true; }); // Attach the event submit for all forms in the page jQuery("form").bind("submit", function() { validNavigation = true; }); // Attach the event click for all inputs in the page jQuery("input[type=submit]").bind("click", function() { validNavigation = true; }); } function callback1() { if( sessionStorage.getItem('sid_conversie_119') == '1') { survey_showed1 = true; } if( when_appear1 == 'leave' && (appear_time1 == '0' || parseInt(count_visited1) <= parseInt(appear_time1))) { survey_showed1 = false; } //for debug if( surveyID == 141) survey_showed1 = false; if( survey_showed1) return; var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'https://conversietools.be//js/jquery-ui.min.js'; head.appendChild(script); embedValidNavigation(); var timeframe = 30 * 24 * 60 * 60 * 1000; if( conversie_lasttime1 == 'null' || conversie_lasttime1 == null || count_visited1 < 2) { createCookie('conversiepopup119_lasttime', new Date().getTime() ,365); createCookie('conversiepopup119_counter', 1 ,365); if( visitor_type1 == 'return') return; } time_fromlast1 = new Date().getTime() - conversie_lasttime1; var current_visitor_type1 = 'new'; if( time_fromlast1 < timeframe) current_visitor_type1 = 'return'; createCookie('conversiepopup119_lasttime', new Date().getTime() ,365); current_visitor_type1 = visitor_type1; if( current_visitor_type1 != visitor_type1) { return; } var referer = document.referrer; var current_visitor_from1 = ''; if( referer.indexOf('facebook') > -1) current_visitor_from1 = 'facebook'; if( referer.indexOf('twitter') > -1) current_visitor_from1 = 'twitter'; if( referer.indexOf('utm') > -1) current_visitor_from1 = 'google_organic'; if( referer.indexOf('adword') > -1) current_visitor_from1 = 'adword'; visitor_from1 = 'all'; if( current_visitor_from1 != visitor_from1 && visitor_from1 != 'all') return; /*switch(where_appear) { case 'home': opensurvey_lightbox1(); break; case 'specific': if( where_appear.toLowerCase().indexOf(current_page) > 0) { opensurvey_lightbox1(); } break; case 'all': opensurvey_lightbox1(); break; }*/ switch(when_appear1) { case 'enter': //opensurvey_lightbox1(); checkWhereAppear(); break; case 'leave': var isLeave = 0; if( isLeave == 1) { addEvent(document, 'mouseout', function(evt) { if (evt.toElement == null && evt.relatedTarget == null) { if( survey_showed1) return; checkWhereAppear(); } }); } break; case 'timer': var timeout = 7; timeout *= 1000; window.setTimeout(opensurvey_lightbox1, timeout); break; case 'pages': var totalPageVisited = readCookie('conversiepopup119_totalvisited'); if( totalPageVisited == null) totalPageVisited = 0; totalPageVisited++; createCookie('conversiepopup119_totalvisited', totalPageVisited ,365); var countPages = 0; if( totalPageVisited == countPages) { opensurvey_lightbox1(); } break; default: opensurvey_lightbox1(); break; } }; function opensurvey_lightbox1() { if( !survey_showed1) { var lightbox_url = 'https://conversietools.be//popup/jsPopupContent/119&callback=?'; jQuery.ajax({ cache: false, url: lightbox_url, dataType: 'jsonp', crossDomain: true, success: function(data) { if( jQuery(conversieWrapper1).length == 0) { conversieWrapper1 = '#conversieToolInfo'; } jQuery(conversieWrapper1).html(data[0]); jQuery.getScript('https://conversietools.be//js/embed_popup.js'); var buttonText = jQuery('#hdButtonText').val(); var buttonStyle = jQuery('#hdButtonStyle').val(); var hdBulletColor = jQuery('#hdBulletColor').val(); var hdEmailColorFont = jQuery('#hdEmailColorFont').val(); jQuery('#conversie_aweber form input[type=submit]').attr('style', buttonStyle); jQuery('#conversie_aweber form input[type=submit]').val(buttonText); jQuery('#conversie_popup_corner table ul li').each(function() { var tmp = jQuery(this).text(); jQuery(this).html('' + tmp + ''); }) jQuery('#conversie_popup_corner table ul li').css('color', hdBulletColor); jQuery('#conversie_popup_corner table ul li span').css('color', hdEmailColorFont); var isLightbox = jQuery('#conversieTool_lightbox').val(); if( isLightbox == '1') { if (jQuery('#overlay').length == 0) { jQuery('body').append('
'); } var ww = jQuery(window).width(); var left_pos = (ww - jQuery('#conversie_popup_corner').width()) / 2; if( left_pos < 0) left_pos = 0; if( jQuery('#conversie_popup_corner').attr('mobile') == '1') left_pos = 0; if( jQuery('#conversie_popup_corner').width() == ww) left_pos = 0; jQuery('#conversie_popup_corner').css('left', left_pos + 'px'); jQuery('#conversie_popup_corner').css('top', '100px'); jQuery('#conversie_popup_corner').css('bottom', 'inherit'); } jQuery('#conversie_close_button').click(function(e) { e.stopPropagation(); jQuery('#overlay').remove(); jQuery('#conversie_popup_corner').remove(); }); jQuery('#overlay').on('click', function(){ jQuery('#conversie_popup_corner').remove(); jQuery(this).remove(); }); //show effect if( pop_effect1 == 'fade') { jQuery(conversieWrapper1).fadeIn(); } else if( pop_effect1 == 'shake') { jQuery(conversieWrapper1).show(function() { jQuery('#conversie_popup_corner').effect("shake", { times:5 }, 1000); }); } else if( pop_effect1 == 'bounce') { jQuery(conversieWrapper1).show(function() { jQuery('#conversie_popup_corner').effect("shake", { times:5 }, 1000); }); } else { jQuery(conversieWrapper1).show(); } survey_showed1 = true; sessionStorage.setItem('sid_conversie_119', '1'); createCookie('conversiepopup119','1'); } }); } } function checkWhereAppear() { if (where_appear_value1 == '') { opensurvey_lightbox1(); } else { var show = false; switch(where_appear_operator1) { case 'exactly_match': if( where_appear_value1 == current_page) { show = true; } break; case 'matching_regexp': var patt = new RegExp(where_appear_value1); show = patt.test(current_page); break; case 'begins_with': show = strStartsWith( current_page, where_appear_value1); break; case 'ends_with': show = strEndsWith(current_page, where_appear_value1); break; case 'containing': show = (current_page.indexOf(where_appear_value1) >= 0); break; } if( show) { opensurvey_lightbox1(); } } } function strStartsWith(str, prefix) { return str.indexOf(prefix) === 0; } function strEndsWith(str, suffix) { return str.match(suffix+"$")==suffix; } function addEvent(obj, evt, fn) { if (obj.addEventListener) { obj.addEventListener(evt, fn, false); } else if (obj.attachEvent) { obj.attachEvent("on" + evt, fn); } }