var _gdpr_site = {};
_gdpr_site.color = '#336699';
_gdpr_site.Cookies = 2;
_gdpr_site.GoogleAnalytics = true;
_gdpr_site.Processor = 0;
_gdpr_site.Retention = '6 months';
const _gdpr_remoteip = '3.16.137.150';
var _gdpr_poc = '';
var _gdpr_statement = '';
//Cookies
const _gdpr_anon = 1; // Anonymous info
const _gdpr_personal = 2; // Personal identifying
// Info use
const _gdpr_tracking = 512; // Tracking purposes
const _gdpr_contact = 1024; // Contact
const _gdpr_marketing = 2048; // Marketing
const _gdpr_partners = 4096; // Partners
const _gdpr_order = 8192; // Order Fulfilment
//Fields
const _gdpr_ip = 1;
const _gdpr_location = 2;
const _gdpr_name = 4;
const _gdpr_address = 8;
const _gdpr_phone = 16;
const _gdpr_email = 32;
const _gdpr_billing = 64;
var methods = [];
var others = [];
//Set up styles
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = '._gdpr_notice_class { color: '+ _gdpr_site.color+';line-height: normal;font-family: Arial, Helvetica, sans-serif;\
border-radius: 10px;z-index:19999;width: 380px; height:355px; border: 2px solid '+ _gdpr_site.color+'; background-color:#FFF;\
text-align: left; position: absolute; top: calc(50vh - (/* height */355px / 2));left: calc(50vw - (/* width */380px / 2)); }\
._gdpr_overlay_scrollstop { height: 100%; overflow: hidden;}\
._gdpr_banner{text-align: right; font-size: 14px; font-family: Arial, Helvetica, sans-serif;position: fixed; bottom: 0; \
width: 100%; border: 2px solid '+ _gdpr_site.color+'; background-color:#FFF;}\
input[type=checkbox]{-webkit-appearance:checkbox;-ms-transform: scale(2); -moz-transform: scale(2); -webkit-transform: scale(2); -o-transform: scale(2); margin: 7px;}';
document.getElementsByTagName('head')[0].appendChild(style);
function _gdpr_3rd_party(name, url, flags, poc) {
others.push([name, url, flags, poc]);
}
function _gdpr_approve() {
_gdpr_setCookie('_gdpr_ok', 'ok');
var elem = document.getElementById('_gdpr_ok');
if (!elem.checked) {
alert('You must permit the use of your information to continue on the site');
} else {
document.getElementById('_gdpr_overlay').outerHTML = "";
document.getElementById('_gdpr_notice').outerHTML = "";
document.body.classList.remove("_gdpr_overlay_scrollstop");
}
}
function _gdpr_disapprove() {
_gdpr_eraseCookie('_gdpr_ok');
window.scrollTo(0,0);
location.reload();
}
function _gdpr_banner() {
var banner = document.createElement('div');
banner.setAttribute("id", "_gdpr_banner");
banner.classList.add("_gdpr_banner");
document.body.appendChild(banner);
document.getElementById('_gdpr_banner').innerHTML = 'You have agreed to allow this site to collect identifiable information. If you wish to change this, click here ';
}
function _gdpr_check() {
if (window.location.search.indexOf('testgdpr') <= -1 && 'OK' == 'OK') {
return;
}
if (_gdpr_getCookie('_gdpr_ok') == 'ok') {
_gdpr_banner();
return;
}
document.body.classList.add("_gdpr_overlay_scrollstop");
var _gdpr_div = '\
This website, which is owned by ' + _gdpr_site.Title + ',\
uses the following information from you for the purposes listed below. If you find these usages unacceptable, please leave the site immediately. \
';
_gdpr_div += '
';
//Cookies
console.log('cookies:' + _gdpr_site.Cookies);
if (parseInt(_gdpr_site.Cookies) == 1) {_gdpr_div += 'Site uses non-personally identifiable cookies';}
else {_gdpr_div += 'Site uses personally identifiable cookies';}
var arrayLength = methods.length;
console.log(methods);
for (var i = 0; i < arrayLength; i++) {
if (methods[i][1] !== 0) {_gdpr_div += '
' + methods[i][0] + ' on the site will collect ' + _gdpr_flags2string(methods[i][1]);}
}
arrayLength = others.length;
//name, url, flags, poc
for (var i = 0; i < arrayLength; i++) {
if (others[i][1] !== 0) {_gdpr_div += '
This site shares the following information with
' + others[i][0] + ':' + _gdpr_flags2string(others[i][2]);}
}
if (_gdpr_site.GoogleAnalytics) {_gdpr_div += '
This site uses Google Analytics for tracking purposes. Please visit
Google for more infromation.';}
if (_gdpr_site.Processor !== 0) {_gdpr_div += '
This site shares the following information with ProspectTrax Inc as our data processor: ' + _gdpr_flags2string(_gdpr_site.Processor);}
_gdpr_div += '
' + _gdpr_site.Title + ' will retain this information for ' + _gdpr_site.Retention;
_gdpr_div += '
';
var elem = document.createElement('div');
elem.style.cssText = 'position:absolute;width:100%;height:100%;top:0;left:0;opacity:0.5;z-index:19998;background-color:#000;';
elem.setAttribute("id", "_gdpr_overlay");
document.body.appendChild(elem);
var notice = document.createElement('div');
notice.setAttribute("id", "_gdpr_notice");
//notice.className("_gdpr_notice_class");
document.body.appendChild(notice);
document.getElementById('_gdpr_notice').className = '_gdpr_notice_class';
document.getElementById('_gdpr_notice').innerHTML = _gdpr_div;
}
function _gdpr_Method(reason, flags) {
methods.push([reason, flags]);
}
function _gdpr_trim(e,r){return"]"===r&&(r="\\]"),"\\"===r&&(r="\\\\"),e.replace(new RegExp("^["+r+"]+|["+r+"]+$","g"),"")}
function _gdpr_flags2string(data){
var flags = _gdpr_dec2bin(data).split('');
flags = flags.reverse();
console.log(flags);
var st = '';
if (flags[0] == '1') {st += 'IP Address, ';}
if (flags[1] == '1') {st += 'physical geo-location, ';}
if (flags[2] == '1') {st += 'full name, ';}
if (flags[3] == '1') {st += 'address, ';}
if (flags[4] == '1') {st += 'phone number, ';}
if (flags[5] == '1') {st += 'email, ';}
if (flags[6] == '1') {st += 'billing information ';}
st = _gdpr_trim(st, ' ');
st = _gdpr_trim(st, ',');
st += ' for purposes of ';
if (flags[9] == '1') {st += 'tracking website use and patterns, ';}
if (flags[10] == '1') {st += 'contacting you directly, ';}
if (flags[11] == '1') {st += 'marketing and advertising, ';}
if (flags[12] == '1') {st += 'working with our partners, ';}
if (flags[13] == '1') {st += 'ordering, billing, and shiping, ';}
st = _gdpr_trim(st, ' ');
st = _gdpr_trim(st, ',');
return st;
}
function _gdpr_dec2bin(dec){
return (dec >>> 0).toString(2);
}
function _gdpr_setCookie(e,t,n){var o="";if(n){var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3),o="; expires="+i.toUTCString()}document.cookie=e+"="+(t||"")+o+"; path=/"}function _gdpr_getCookie(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o