(function () { if(window.__bizonPixelInited) return; window.__bizonPixelInited = 1; var m_cookieName = '__bp'; var debug = (window.location.hostname==='localhost'); var doc = document; var m_userID = 'Spr9P@0m5HpeH9DbCX5'; var m_postURL = 'https://online.bizon365.ru/pixel/1002/js'; function post(data) { if(!m_userID) return; //error data = data || {}; data.id = m_userID; data.referrer = document.referrer; data.useragent = navigator.userAgent; data.platform = navigator.platform; data.screen = ''+screen.width+'x'+screen.height; data.search = window.location.search; data.host = window.location.host; data.pathname = window.location.pathname; data.v = 1; if(data.search && data.search.indexOf) { if(data.search.indexOf('preview=true') > 0) { return; // WP } } if(debug) console.log(data); var xhr = new XMLHttpRequest(); xhr.open('POST', m_postURL, true); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded') xhr.onreadystatechange = function() { if (xhr.readyState != 4) return; if (xhr.status != 200) { return; } //console.log('post sent, answer:' + xhr.responseText ); } data = encodeURIComponent(JSON.stringify(data)); xhr.send('data='+data); } //post function getCookie(name) { var matches; if(navigator.cookieEnabled) { matches = document.cookie.match(new RegExp( "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" )); if(matches) matches = decodeURIComponent(matches[1]); } if(!matches && window['localStorage']) { matches = window.localStorage[m_cookieName]; } return matches; } function setCookie(name, value, options) { options = options || {}; var expires = options.expires; if (typeof expires == "number" && expires) { var d = new Date(); d.setTime(d.getTime() + expires*1000); expires = options.expires = d; } if (expires && expires.toUTCString) { options.expires = expires.toUTCString(); } value = encodeURIComponent(value); var updatedCookie = name + "=" + value; for(var propName in options) { updatedCookie += "; " + propName; var propValue = options[propName]; if (propValue !== true) { updatedCookie += "=" + propValue; } } //console.log(updatedCookie); if(navigator.cookieEnabled) { document.cookie = updatedCookie; } if(window['localStorage']) window.localStorage[m_cookieName] = value; } post(); function lookingforInput() { var inputs = []; var q = doc.querySelectorAll('input[type=text]'); for(var i=0; i