Tagging = function(context) {
  this.site = 'ng';
  this.zone = 'nyitooldal';
  this.protocol = window.location.protocol;
  this.autodetect_url = this.protocol + '//cts.p24.hu/service/detect/';
  this.context = context;
  this.positions = {};
  this.positions_weighted = {};

  this.positions['head'] = '[{\"service_name\": \"Sanoma\", \"weight\": null, \"source\": \"<script src=\\"//stat.p24.hu/mobile_detect/mobile_detect.js\\"></script>\"}, {\"service_name\": \"CMP\", \"weight\": null, \"source\": \"<!-- Quantcast Choice. Consent Manager Tag v2.0 (for TCF 2.0) --><script type=\\"text/javascript\\" async=true>(function() {  var host = window.location.hostname;  var element = document.createElement(\'script\');  var firstScript = document.getElementsByTagName(\'script\')[0];  var url = \'https://quantcast.mgr.consensu.org\'.concat(\'/choice/\', \'ZWemmHq85Y1fR\', \'/\', host, \'/choice.js\');  var uspTries = 0;  var uspTriesLimit = 3;  element.async = true;  element.type = \'text/javascript\';  element.src = url;  firstScript.parentNode.insertBefore(element, firstScript);  function makeStub() {    var TCF_LOCATOR_NAME = \'__tcfapiLocator\';    var queue = [];    var win = window;    var cmpFrame;    function addFrame() {      var doc = win.document;      var otherCMP = !!(win.frames[TCF_LOCATOR_NAME]);      if (!otherCMP) {        if (doc.body) {          var iframe = doc.createElement(\'iframe\');          iframe.style.cssText = \'display:none\';          iframe.name = TCF_LOCATOR_NAME;          doc.body.appendChild(iframe);        } else {          setTimeout(addFrame, 5);        }      }      return !otherCMP;    }    function tcfAPIHandler() {      var gdprApplies;      var args = arguments;      if (!args.length) {        return queue;      } else if (args[0] === \'setGdprApplies\') {        if (          args.length > 3 &&          args[2] === 2 &&          typeof args[3] === \'boolean\'        ) {          gdprApplies = args[3];          if (typeof args[2] === \'function\') {            args[2](\'set\', true);          }        }      } else if (args[0] === \'ping\') {        var retr = {          gdprApplies: gdprApplies,          cmpLoaded: false,          cmpStatus: \'stub\'        };        if (typeof args[2] === \'function\') {          args[2](retr);        }      } else {        queue.push(args);      }    }    function postMessageEventHandler(event) {      var msgIsString = typeof event.data === \'string\';      var json = {};      try {        if (msgIsString) {          json = JSON.parse(event.data);        } else {          json = event.data;        }      } catch (ignore) {}      var payload = json.__tcfapiCall;      if (payload) {        window.__tcfapi(          payload.command,          payload.version,          function(retValue, success) {            var returnMsg = {              __tcfapiReturn: {                returnValue: retValue,                success: success,                callId: payload.callId              }            };            if (msgIsString) {              returnMsg = JSON.stringify(returnMsg);            }            event.source.postMessage(returnMsg, \'*\');          },          payload.parameter        );      }    }    while (win) {      try {        if (win.frames[TCF_LOCATOR_NAME]) {          cmpFrame = win;          break;        }      } catch (ignore) {}      if (win === window.top) {        break;      }      win = win.parent;    }    if (!cmpFrame) {      addFrame();      win.__tcfapi = tcfAPIHandler;      win.addEventListener(\'message\', postMessageEventHandler, false);    }  };  makeStub();  var uspStubFunction = function() {    var arg = arguments;    if (typeof window.__uspapi !== uspStubFunction) {      setTimeout(function() {        if (typeof window.__uspapi !== \'undefined\') {          window.__uspapi.apply(window.__uspapi, arg);        }      }, 500);    }  };  var checkIfUspIsReady = function() {    uspTries++;    if (window.__uspapi === uspStubFunction && uspTries < uspTriesLimit) {      console.warn(\'USP is not accessible\');    } else {      clearInterval(uspInterval);    }  };  if (typeof window.__uspapi === \'undefined\') {    window.__uspapi = uspStubFunction;    var uspInterval = setInterval(checkIfUspIsReady, 6000);  }})();</script><!-- End Quantcast Choice. Consent Manager Tag v2.0 (for TCF 2.0) -->\"}, {\"service_name\": \"Gemius Traffic\", \"weight\": null, \"source\": \"<script type=\\"text/javascript\\">var pp_gemius_identifier = (\'10aV7_8iJdBOjvKKuUO_CuW0TBjdYCxzmpnPntDtEn3.l7\' != \'\') ? \'10aV7_8iJdBOjvKKuUO_CuW0TBjdYCxzmpnPntDtEn3.l7\' : \'10aV7_8iJdBOjvKKuUO_CuW0TBjdYCxzmpnPntDtEn3.l7\';function gemius_pending(i) { window[i] = window[i] || function() {var x = window[i+\'_pdata\'] = window[i+\'_pdata\'] || []; x[x.length]=arguments;};};gemius_pending(\'gemius_hit\'); gemius_pending(\'gemius_event\'); gemius_pending(\'pp_gemius_hit\'); gemius_pending(\'pp_gemius_event\');(function(d,t) {try {var gt=d.createElement(t),s=d.getElementsByTagName(t)[0],l=\'http\'+((location.protocol==\'https:\')?\'s\':\'\'); gt.setAttribute(\'async\',\'async\');gt.setAttribute(\'defer\',\'defer\'); gt.src=l+\'://gahu.hit.gemius.pl/xgemius.js\'; s.parentNode.insertBefore(gt,s);} catch (e) {}})(document,\'script\');</script>\"}, {\"service_name\": \"Sanoma\", \"weight\": null, \"source\": \"<script type=\\"text/javascript\\" src=\\"//ad-blacklist.p24.hu/adx_blacklist.js\\"></script><script type=\\"text/javascript\\" src=\\"//ad-blacklist.p24.hu/rubicon_blacklist.js\\"></script><script type=\\"text/javascript\\">    (function(){        var blacklistsToCheck = [\'ADX\', \'RUBICON\'];        for (var i=0; i<blacklistsToCheck.length; i++) {            var typeName = blacklistsToCheck[i].charAt(0) + blacklistsToCheck[i].substr(1).toLowerCase();            window[\'no\' + blacklistsToCheck[i]] = false;            if (                typeof window[\'blck\' + typeName] != \'undefined\' &&                typeof window[\'blck\' + typeName][window.location.hostname] != \'undefined\' &&                window[\'blck\' + typeName][window.location.hostname].indexOf(location.pathname) >= 0            ) {                window[\'no\' + blacklistsToCheck[i]] = true;            }        }    })();</script>\"}, {\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<script>function ip2latlong(data) {    centralGeoTarget.ip2latlong(data);}var centralGeoTarget = {    referrer: document.referrer,    geoLocInfo: \\"geoLocInfo\\",    onPositionUpdate: function (position) {        var latitude = position.coords.latitude,            longitude = position.coords.longitude;        centralGeoTarget.buildUpMetaTag(latitude, longitude);        var geoLocationInfoSting = \'latitude=\' + latitude + \'|longitude=\' + longitude;        centralGeoTarget.createCookie(centralGeoTarget.geoLocInfo, geoLocationInfoSting, 168);    },    ip2latlong: function (data) {        var latitude = data.latitude,            longitude = data.longitude;        centralGeoTarget.buildUpMetaTag(latitude, longitude);        if (centralGeoTarget.readCookie(centralGeoTarget.geoLocInfo) == \\"\\") {            var geoLocationInfoSting = \'latitude=\' + latitude + \'|longitude=\' + longitude;            centralGeoTarget.createCookie(centralGeoTarget.geoLocInfo, geoLocationInfoSting, 168);        }    },    ipGeoLocation: function () {        script = document.createElement(\'script\');        script.type = \'text/javascript\';        script.src = \'//geoip.p24.hu/latlong.js\';        document.head.appendChild(script);    },    getLocationFromCookie: function () {        var coordinates = centralGeoTarget.readCookie(centralGeoTarget.geoLocInfo);        var coordinateVals = (function () {            var pairs = coordinates.split(\'|\');            var coo = {};            for (var i = 0; i < pairs.length; i++) {                var temp = pairs[i].split(\'=\');                coo[temp[0]] = temp[1];            }            return coo;        })();        if ((typeof coordinateVals.latitude == \'undefined\') || (typeof coordinateVals.longitude == \'undefined\')) {            return null;        }        var latitudeVal = parseFloat(coordinateVals.latitude),            longitudeVal = parseFloat(coordinateVals.longitude);        if (isNaN(latitudeVal) || isNaN(longitudeVal)) {            return null;        }        return {            latitude: latitudeVal,            longitude: longitudeVal        }    },    onPositionUpdateError: function (e) {        if (centralGeoTarget.readCookie(centralGeoTarget.geoLocInfo) == \\"\\") {            centralGeoTarget.ipGeoLocation();        } else {            var savedData = centralGeoTarget.getLocationFromCookie();            if (savedData != null) {                centralGeoTarget.buildUpMetaTag(savedData.latitude, savedData.longitude);            }        }    },    createCookie: function (cname, cvalue, expiry) {        var d = new Date();        d.setHours(d.getHours() + expiry);        var expires = \\"expires=\\" + d.toUTCString();        document.cookie = cname + \'=\' + cvalue + \';\' + expires + \';domain=.\' + document.domain + \';path=/\';    },    readCookie: function (cname) {        var name = cname + \\"=\\";        var ca = document.cookie.split(\';\');        for (var i = 0; i < ca.length; i++) {            var c = ca[i].trim();            if (c.indexOf(name) == 0) return c.substring(name.length, c.length);        }        return \\"\\";    },    buildUpMetaTag: function (latitude, longitude) {        var userdb_id = 65;        var createMetaElement = true;        var metaElements = document.querySelectorAll(\\"[name=\'customtarget\']\\");        if (metaElements != undefined) {            if (metaElements.length != undefined) {                if (metaElements.length > 0) {                    createMetaElement = false;                }            }        }        if (createMetaElement) {            var adverticumMeta = document.createElement(\'meta\');            adverticumMeta.name = \'customtarget\';            adverticumMeta.content = window.btoa(unescape(encodeURIComponent(\'userdb_id=\' + userdb_id + \'&latitude=\' + latitude + \'&longitude=\' + longitude)));            document.getElementsByTagName(\'head\')[0].appendChild(adverticumMeta);        } else {            var defaultMetaVal = metaElements[0].getAttribute(\\"content\\");            var newMetaVal = window.atob(unescape(defaultMetaVal)) + \'&userdb_id=\' + userdb_id + \'&latitude=\' + latitude + \'&longitude=\' + longitude;            metaElements[0].setAttribute(\\"content\\", window.btoa(unescape(encodeURIComponent(newMetaVal))));        }    },    init: function () {        if (typeof _ceDeviceDetect.getDeviceType() != \'undefined\') {            if (_ceDeviceDetect.getDeviceType() != \\"desktop\\") {                var savedData = centralGeoTarget.getLocationFromCookie();                if (centralGeoTarget.referrer.indexOf(\\"facebook\\") == -1) {                    if (savedData != null) {                        centralGeoTarget.buildUpMetaTag(savedData.latitude, savedData.longitude);                    } else {                        navigator.geolocation.getCurrentPosition(centralGeoTarget.onPositionUpdate, centralGeoTarget.onPositionUpdateError);                        if(centralGeoTarget.getLocationFromCookie() == null){                            centralGeoTarget.ipGeoLocation();                        }                    }                } else {                    if (savedData != null) {                        centralGeoTarget.buildUpMetaTag(savedData.latitude, savedData.longitude);                    } else {                        centralGeoTarget.ipGeoLocation();                    }                }            }        }    }};centralGeoTarget.init();</script>\"}, {\"service_name\": \"Sanoma\", \"weight\": null, \"source\": \"<script type=\\"text/javascript\\" src=\\"//segment.p24.hu/cerment.min.js\\" async></script>\"}, {\"service_name\": \"Google Adverts\", \"weight\": null, \"source\": \"<script>    if (typeof _ceDeviceDetect != \'undefined\' && typeof _ceDeviceDetect.getDeviceType == \'function\') {        var _ceDisplayData = _ceDisplayData || {},            googletag,            loader = function (multipleAds) {                _ceDisplayData.gpt = _ceDisplayData.gpt || { items: [], defContName: \'div-gpt-ad\' };                (function () {                    var scriptInserter = document.createElement(\'script\');                    scriptInserter.src = \'https://www.googletagservices.com/tag/js/gpt.js\';                    scriptInserter.async = true;                    /*document.head.appendChild(scriptInserter);*/                    document.head.insertBefore(scriptInserter, document.head.firstChild);                })();                if (multipleAds) {                    googletag = {};                    googletag.cmd = [];                } else {                    googletag = googletag || {};                    googletag.cmd = googletag.cmd || [];                }                googletag.cmd.push(function () {                    googletag.pubads().enableSingleRequest();                    googletag.pubads().collapseEmptyDivs();                    googletag.enableServices();                });            };        loader();        window.addEventListener(\'_ceDisplayDataLoadHeader\', loader);    }</script>\"}, {\"service_name\": \"Google Adverts\", \"weight\": null, \"source\": \"<script>    (function () {        if (window.Element && !Element.prototype.closest) {            Element.prototype.closest = function (s) {                var matches = (this.document || this.ownerDocument).querySelectorAll(s),                    i,                    el = this;                do {                    i = matches.length;                    while (--i >= 0 && matches.item(i) !== el) { };                } while ((i < 0) && (el = el.parentElement));                return el;            };        }        window.googletag = window.googletag || { cmd: [] };        googletag.cmd.push(function () {            window.googletag.pubads().addEventListener(\'slotRenderEnded\', function (event) {                if (event.isEmpty) {                    var slotEl = document.getElementById(event.slot.getSlotId().getDomId());                    try {                        var advEl = slotEl.closest(\\".goAdverticum\\");                        if (advEl != undefined && advEl != null && advEl.contains(slotEl)) {                            slotEl = advEl;                        }                    } catch (e) { }                    slotEl.style.display = \'none\';                }            });        });    })();</script>\"}, {\"service_name\": \"Gemius\", \"weight\": null, \"source\": \"<script src=\\"//spl.hit.gemius.pl/gplayer.js\\" type=\\"text/javascript\\"></script>\"}]';
  this.positions_weighted['head'] = false;
  
  this.positions['body-end'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<script type=\\"text/javascript\\" src=\\"//stat.p24.hu/CTS/helper-scripts/waterfall_empty/closer.min.js\\"></script>\"}, {\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<script type=\\"text/javascript\\" src=\\"//ad.adverticum.net/g3.js\\"></script>\"}, {\"service_name\": \"Google Adverts\", \"weight\": null, \"source\": \"<script>    (function () {        var isSubscribed = false;        if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData() != undefined && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {            isSubscribed = true;        }        if (!isSubscribed) {            var dfpfunc = function () {                try {                    if (                        typeof _ceDisplayData != \'undefined\' &&                        typeof _ceDisplayData.gpt != \'undefined\' &&                        _ceDisplayData.gpt.items.length > 0                    ) {                        googletag.cmd.push(function () {                            for (var i = 0; i < _ceDisplayData.gpt.items.length; i++) {                                var slotData = _ceDisplayData.gpt.items[i];                                googletag.defineSlot(\'/52203547/\' + \'ng\' + \'_\' + slotData.name, JSON.parse(slotData.size), _ceDisplayData.gpt.defContName + \'-\' + slotData.id).addService(googletag.pubads());                            }                        });                        for (var i = 0; i < _ceDisplayData.gpt.items.length; i++) {                            var slotData = _ceDisplayData.gpt.items[i];                            googletag.cmd.push(function () { googletag.display(_ceDisplayData.gpt.defContName + \'-\' + slotData.id); });                        }                    }                } catch (e) {                }            };            dfpfunc();            window.addEventListener(\'_ceDisplayDataFireDFP\', function (ev) {                dfpfunc();            });        }    })();</script>\"}, {\"service_name\": \"Gemius\", \"weight\": null, \"source\": \"<script src=\\"//stat.p24.hu/CTS/measuring-codes/gem_stream.min.js?t=202010121\\" type=\\"text/javascript\\"></script>\"}]';
  this.positions_weighted['body-end'] = false;
  
  this.positions['body-start'] = '[{\"service_name\": \"Google Tag Manager\", \"weight\": null, \"source\": \"<noscript><iframe src=\\"//www.googletagmanager.com/ns.html?id=GTM-TH7ML6\\"height=\\"0\\" width=\\"0\\" style=\\"display:none;visibility:hidden\\"></iframe></noscript><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({\'gtm.start\':new Date().getTime(),event:\'gtm.js\'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!=\'dataLayer\'?\'&l=\'+l:\'\';j.async=true;j.src=\'//www.googletagmanager.com/gtm.js?id=\'+i+dl;f.parentNode.insertBefore(j,f);})(window,document,\'script\',\'dataLayer\',\'GTM-TH7ML6\');</script>\"}]';
  this.positions_weighted['body-start'] = false;
  
  this.positions['body-end-adv'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<!-- Goa3:  --><div id=\\"ctstemp\\" class=\\"goAdverticum\\" style=\\"display: none;\\"><script>        (function () {            var insertedElement = document.getElementById(\\"ctstemp\\");            var isSubscribed = false;            if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData() != undefined && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {                isSubscribed = true;            }            if (!isSubscribed) {                insertedElement.id = \\"zone\\";                if (insertedElement.getAttribute(\\"ctsStyle\\") != null) {                    insertedElement.style = insertedElement.getAttribute(\\"ctsStyle\\");                    insertedElement.removeAttribute(\\"ctsStyle\\");                } else {                    insertedElement.removeAttribute(\\"style\\");                }            } else {                insertedElement.parentNode.removeChild(insertedElement);            }        })();    </script></div>\"}]';
  this.positions_weighted['body-end-adv'] = false;
  
  this.positions['top'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": 0, \"source\": \"<!-- Goa3: 1652201 --><div id=\\"zone1652201\\" class=\\"goAdverticum a8a263be\\" data-adsv-name=\\"top\\" style=\\"text-align:center; display: table; margin: 0 auto;\\"></div>\"}, {\"service_name\": \"Adverticum AdServer\", \"weight\": 100, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum a8a263be\\" style=\\"display: none;\\"><script>        (function () {            var insertedElement = document.getElementById(\'ctstemp\');            var zoneForDevice = \'\';            var dataAdsvName = \'\';            var isSubscribed = false;            if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {                isSubscribed = true;            }            if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {                switch (_ceDeviceDetect.getDeviceType()) {                    case \'desktop\':                        zoneForDevice = \'1652201\';                        dataAdsvName = \'top\';                        break;                    case \'mobile\':                        zoneForDevice = \'6376263\';                        dataAdsvName = \'mobil_waterfall1\';                        break;                    case \'tablet\':                        zoneForDevice = \'${adv_zone_id_for_tablet}\';                        dataAdsvName = \'${adverticum_name_tablet}\';                        if (dataAdsvName == \\"\\") {                            dataAdsvName = \'top\';                        }                        break;                }            }            if (zoneForDevice == \'\' || isSubscribed) {                insertedElement.parentNode.removeChild(insertedElement);            } else {                insertedElement.setAttribute(\'data-adsv-name\', dataAdsvName);                insertedElement.id = \'zone\' + zoneForDevice;                if (insertedElement.getAttribute(\\"ctsStyle\\") != null) {                    insertedElement.style = insertedElement.getAttribute(\\"ctsStyle\\");                    insertedElement.removeAttribute(\\"ctsStyle\\");                } else {                    insertedElement.removeAttribute(\\"style\\");                }            }        })();    </script></div>\"}]';
  this.positions_weighted['top'] = true;
  
  this.positions['right010'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<!-- Goa3: 55911 --><div id=\\"ctstemp\\" class=\\"goAdverticum\\" data-adsv-name=\\"box1\\" style=\\"display: none;\\"><script>        (function () {            var insertedElement = document.getElementById(\\"ctstemp\\");            var isSubscribed = false;            if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData() != undefined && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {                isSubscribed = true;            }            if (!isSubscribed) {                insertedElement.id = \\"zone55911\\";                if (insertedElement.getAttribute(\\"ctsStyle\\") != null) {                    insertedElement.style = insertedElement.getAttribute(\\"ctsStyle\\");                    insertedElement.removeAttribute(\\"ctsStyle\\");                } else {                    insertedElement.removeAttribute(\\"style\\");                }            } else {                insertedElement.parentNode.removeChild(insertedElement);            }        })();    </script></div>\"}]';
  this.positions_weighted['right010'] = false;
  
  this.positions['content-bottom'] = '[{\"service_name\": \"Google Adverts\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"ctsGadx\\" ctsStyle=\\"margin-bottom: 10px;\\" style=\\"display: none;\\"><div style=\\"width: 920px; text-align: right; font-size: 8px; color: #C6C6C6;\\">HIRDET&#xC9;S</div><script type=\\"text/javascript\\">\t\t(function () {\t\t\tvar insertedElement = document.getElementById(\'ctstemp\');\t\t\tvar isSubscribed = false;\t\t\tif (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {\t\t\t\tisSubscribed = true;\t\t\t}\t\t\tif (!isSubscribed && (typeof noADX == \'undefined\' || noADX === false)) {\t\t\t\tvar gaAdxSlots = [\t\t\t\t\t{\t\t\t\t\t\tsource: \'(direct)\',\t\t\t\t\t\tslots: [\t\t\t\t\t\t\t{ slot: \'${google_adx_slot_direct}\' }\t\t\t\t\t\t]\t\t\t\t\t},\t\t\t\t\t{\t\t\t\t\t\tsource: \'hirkereso.hu\',\t\t\t\t\t\tslots: [\t\t\t\t\t\t\t{ slot: \'${google_adx_slot_hirkereso}\' }\t\t\t\t\t\t]\t\t\t\t\t},\t\t\t\t\t{\t\t\t\t\t\tsource: \'hirstart.hu\',\t\t\t\t\t\tslots: [\t\t\t\t\t\t\t{ slot: \'${google_adx_slot_hirstart}\' }\t\t\t\t\t\t]\t\t\t\t\t},\t\t\t\t\t{\t\t\t\t\t\tsource: \'kapu.hu\',\t\t\t\t\t\tslots: [\t\t\t\t\t\t\t{ slot: \'${google_adx_slot_kapu}\' }\t\t\t\t\t\t]\t\t\t\t\t},\t\t\t\t\t{\t\t\t\t\t\tsource: \'startlap\',\t\t\t\t\t\tslots: [\t\t\t\t\t\t\t{ slot: \'${google_adx_slot_startlap}\' }\t\t\t\t\t\t]\t\t\t\t\t},\t\t\t\t\t{\t\t\t\t\t\tsource: \'adbox\',\t\t\t\t\t\tslots: [\t\t\t\t\t\t\t{ slot: \'${google_adx_slot_adbox}\' }\t\t\t\t\t\t]\t\t\t\t\t},\t\t\t\t\t{\t\t\t\t\t\tsource: \'hirek.oldal.info\',\t\t\t\t\t\tslots: [\t\t\t\t\t\t\t{ slot: \'${google_adx_slot_hirekoldalinfo}\' }\t\t\t\t\t\t]\t\t\t\t\t},\t\t\t\t\t{\t\t\t\t\t\tsource: \'newsletter\',\t\t\t\t\t\tslots: [\t\t\t\t\t\t\t{ slot: \'${google_adx_slot_newsletter}\' }\t\t\t\t\t\t]\t\t\t\t\t},\t\t\t\t\t{\t\t\t\t\t\tsource: \'tombola.hu\',\t\t\t\t\t\tslots: [\t\t\t\t\t\t\t{ slot: \'${google_adx_slot_tombola}\' }\t\t\t\t\t\t]\t\t\t\t\t},\t\t\t\t\t{\t\t\t\t\t\tsource: \'facebook\',\t\t\t\t\t\tslots: [\t\t\t\t\t\t\t{ slot: \'${google_adx_slot_facebook_organic}\' },\t\t\t\t\t\t\t{ slot: \'${google_adx_slot_facebook_cpc}\' }\t\t\t\t\t\t]\t\t\t\t\t},\t\t\t\t\t{\t\t\t\t\t\tsource: \'google\',\t\t\t\t\t\tslots: [\t\t\t\t\t\t\t{ slot: \'${google_adx_slot_google_organic}\' },\t\t\t\t\t\t\t{ slot: \'${google_adx_slot_google_cpc}\' }\t\t\t\t\t\t]\t\t\t\t\t}\t\t\t\t];\t\t\t\tfunction readAsCookie(cname) {\t\t\t\t\tvar name = cname + \\"=\\";\t\t\t\t\tvar ca = document.cookie.split(\';\');\t\t\t\t\tfor (var i = 0; i < ca.length; i++) {\t\t\t\t\t\tvar c = ca[i].trim();\t\t\t\t\t\tif (c.indexOf(name) == 0) return c.substring(name.length, c.length);\t\t\t\t\t}\t\t\t\t\treturn \\"\\";\t\t\t\t}\t\t\t\tvar utmz = readAsCookie(\'__utmz\');\t\t\t\tvar utmzVals = (function () {\t\t\t\t\tvar pairs = utmz.split(\'.\').slice(4).join(\'.\').split(\'|\');\t\t\t\t\tvar ga = {};\t\t\t\t\tfor (var i = 0; i < pairs.length; i++) {\t\t\t\t\t\tvar temp = pairs[i].split(\'=\');\t\t\t\t\t\tga[temp[0]] = temp[1];\t\t\t\t\t}\t\t\t\t\treturn ga;\t\t\t\t})();\t\t\t\tif (typeof utmzVals.utmccn == \'undefined\') utmzVals.utmccn = \'undefined\';\t\t\t\tif (typeof utmzVals.utmcsr == \'undefined\') utmzVals.utmcsr = \'undefined\';\t\t\t\tif (typeof utmzVals.utmcmd == \'undefined\') utmzVals.utmcmd = \'undefined\';\t\t\t\tvar gaAdxSlotIdentifier = \'8105101400/3535225040\';\t\t\t\tfor (var x = 0; x < gaAdxSlots.length; x++) {\t\t\t\t\tif (utmzVals.utmccn.indexOf(gaAdxSlots[x].source) != -1 || utmzVals.utmcsr.indexOf(gaAdxSlots[x].source) != -1) {\t\t\t\t\t\tswitch (gaAdxSlots[x].source) {\t\t\t\t\t\t\tcase \'google\':\t\t\t\t\t\t\tcase \'facebook\':\t\t\t\t\t\t\t\tif (utmzVals.utmcmd == \'cpc\') {\t\t\t\t\t\t\t\t\tgaAdxSlotIdentifier = gaAdxSlots[x].slots[1].slot;\t\t\t\t\t\t\t\t} else if (utmzVals.utmcmd == \'organic\') {\t\t\t\t\t\t\t\t\tgaAdxSlotIdentifier = gaAdxSlots[x].slots[0].slot;\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\tdefault:\t\t\t\t\t\t\t\tgaAdxSlotIdentifier = gaAdxSlots[x].slots[0].slot;\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t}\t\t\t\t\t\tbreak;\t\t\t\t\t}\t\t\t\t}\t\t\t\tif (gaAdxSlotIdentifier == \'\') gaAdxSlotIdentifier = \'8105101400/3535225040\';\t\t\t\tgaAdxSlotIdentifier = \'5491763120/\' + gaAdxSlotIdentifier;\t\t\t\tgoogle_ad_client = \\"ca-pub-1984646123858990\\";\t\t\t\tgoogle_ad_slot = gaAdxSlotIdentifier;\t\t\t\tgoogle_ad_width = parseInt(\\"920\\");\t\t\t\tgoogle_ad_height = parseInt(\\"120\\");\t\t\t\tgoogle_max_num_ads = parseInt(\\"1\\");\t\t\t\tif (insertedElement.getAttribute(\\"ctsStyle\\") != null) {\t\t\t\t\tinsertedElement.style = insertedElement.getAttribute(\\"ctsStyle\\");\t\t\t\t\tinsertedElement.removeAttribute(\\"ctsStyle\\");\t\t\t\t} else {\t\t\t\t\tinsertedElement.removeAttribute(\\"style\\");\t\t\t\t}\t\t\t} else {\t\t\t\tvar elements = document.getElementsByClassName(\\"ctsGadx\\");\t\t\t\twhile (elements.length > 0) {\t\t\t\t\telements[0].parentNode.removeChild(elements[0]);\t\t\t\t}\t\t\t}\t\t})();\t</script><script type=\\"text/javascript\\" src=\\"//pagead2.googlesyndication.com/pagead/show_ads.js\\"></script></div>\"}]';
  this.positions_weighted['content-bottom'] = false;
  
  this.positions['content010'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum a8a263be\\" style=\\"display: none;\\"><script>        (function () {            var insertedElement = document.getElementById(\'ctstemp\');            var zoneForDevice = \'\';            var dataAdsvName = \'\';            var isSubscribed = false;            if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {                isSubscribed = true;            }            if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {                switch (_ceDeviceDetect.getDeviceType()) {                    case \'desktop\':                        zoneForDevice = \'5716109\';                        dataAdsvName = \'roadblock\';                        break;                    case \'mobile\':                        zoneForDevice = \'\';                        dataAdsvName = \'${adverticum_name_mobile}\';                        break;                    case \'tablet\':                        zoneForDevice = \'${adv_zone_id_for_tablet}\';                        dataAdsvName = \'${adverticum_name_tablet}\';                        if (dataAdsvName == \\"\\") {                            dataAdsvName = \'roadblock\';                        }                        break;                }            }            if (zoneForDevice == \'\' || isSubscribed) {                insertedElement.parentNode.removeChild(insertedElement);            } else {                insertedElement.setAttribute(\'data-adsv-name\', dataAdsvName);                insertedElement.id = \'zone\' + zoneForDevice;                if (insertedElement.getAttribute(\\"ctsStyle\\") != null) {                    insertedElement.style = insertedElement.getAttribute(\\"ctsStyle\\");                    insertedElement.removeAttribute(\\"ctsStyle\\");                } else {                    insertedElement.removeAttribute(\\"style\\");                }            }        })();    </script></div>\"}]';
  this.positions_weighted['content010'] = false;
  
  this.positions['content020'] = '[{\"service_name\": \"Google Adverts\", \"weight\": null, \"source\": \"<div id=\'ctsGptTemp\' ctsStyle=\\"text-align:center;\\" style=\\"display: none;\\"><script>        (function () {            var insertedElement = document.getElementById(\'ctsGptTemp\'),                slotData = { id: \'\', name: \'\', size: \'\' };            var isSubscribed = false;            if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData() != undefined && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {                isSubscribed = true;            }            if (!isSubscribed && typeof _ceDeviceDetect != \'unedfined\' && typeof _ceDeviceDetect.getDeviceType == \'function\' && typeof _ceDisplayData != \'undefined\') {                switch (_ceDeviceDetect.getDeviceType()) {                    case \'desktop\':                        slotData.id = \'1565766986544-0\';                        slotData.name = \'cikkveg\';                        slotData.size = \'[[300, 250], [640, 360]]\';                        break;                    case \'mobile\':                        slotData.id = \'${google_dfp_mobile_slot_id}\';                        slotData.name = \'${google_dfp_mobile_slot_name}\';                        slotData.size = \'${google_dfp_mobile_slot_size}\';                        break;                    case \'tablet\':                        if (\'${google_dfp_tablet_slot_id}\' != \'\' && \'${google_dfp_tablet_slot_name}\' != \'\' && \'${google_dfp_tablet_slot_size}\' != \'\') {                            slotData.id = \'${google_dfp_tablet_slot_id}\';                            slotData.name = \'${google_dfp_tablet_slot_name}\';                            slotData.size = \'${google_dfp_tablet_slot_size}\';                        } else {                            slotData.id = \'1565766986544-0\';                            slotData.name = \'cikkveg\';                            slotData.size = \'[[300, 250], [640, 360]]\';                        }                        break;                }                if (slotData.id != \'\' && slotData.name != \'\' && slotData.size != \'\') {                    insertedElement.id = _ceDisplayData.gpt.defContName + \'-\' + slotData.id;                    if (insertedElement.getAttribute(\\"ctsStyle\\") != null) {                        insertedElement.style = insertedElement.getAttribute(\\"ctsStyle\\");                        insertedElement.removeAttribute(\\"ctsStyle\\");                    } else {                        insertedElement.removeAttribute(\\"style\\");                    }                    _ceDisplayData.gpt.items.push(slotData);                    window.dispatchEvent(new Event(\'_ceDisplayDataFireDFP\'));                } else {                    insertedElement.parentNode.removeChild(insertedElement);                }            } else {                insertedElement.parentNode.removeChild(insertedElement);            }        })();    </script></div>\"}, {\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum\\" style=\\"display: none;\\"><script>        (function () {            var insertedElement = document.getElementById(\'ctstemp\');            var zoneForDevice = \'\';            var isSubscribed = false;            if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {                isSubscribed = true;            }            if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {                switch (_ceDeviceDetect.getDeviceType()) {                    case \'desktop\':                        zoneForDevice = \'${adv_zone_id_for_desktop}\';                        break;                    case \'mobile\':                        zoneForDevice = \'5993778\';                        break;                    case \'tablet\':                        zoneForDevice = \'${adv_zone_id_for_tablet}\';                        break;                }            }            if (zoneForDevice == \'\' || isSubscribed) {                insertedElement.parentNode.removeChild(insertedElement);            } else {                insertedElement.id = \'zone\' + zoneForDevice;                if (insertedElement.getAttribute(\\"ctsStyle\\") != null) {                    insertedElement.style = insertedElement.getAttribute(\\"ctsStyle\\");                    insertedElement.removeAttribute(\\"ctsStyle\\");                } else {                    insertedElement.removeAttribute(\\"style\\");                }            }        })();    </script></div>\"}, {\"service_name\": \"Google Adverts\", \"weight\": null, \"source\": \"<div id=\\"cts_content_recomm\\" class=\\"ctsGadx\\" ctsStyle=\\"display:block;margin-top:30px;margin-bottom:30px;${custom_css}\\"    style=\\"display: none;\\"></div><script type=\\"text/javascript\\">    (function () {        var slotForDevice = {            desktop: \'2452210460\',            mobile: \'1616806061\',            tablet: \'1616806061\'        },            recommDiv = document.getElementById(\'cts_content_recomm\'),            slot = \'\',            parameter = \'\',            googleUniqueParameters = {                desktop: \'${google_recomm_unique_parameters}\',                mobile: \'{\\"data-matched-content-rows-num\\": \\"12,6\\", \\"data-matched-content-columns-num\\": \\"1,2\\", \\"data-matched-content-ui-type\\": \\"image_sidebyside,image_sidebyside\\"}\',                tablet: \'{\\"data-matched-content-rows-num\\": \\"12,6\\", \\"data-matched-content-columns-num\\": \\"1,2\\", \\"data-matched-content-ui-type\\": \\"image_sidebyside,image_sidebyside\\"}\'            },            isSubscribed = false;        if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData() != undefined && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {            isSubscribed = true;        }        if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {            switch (_ceDeviceDetect.getDeviceType()) {                case \'desktop\':                    slot = slotForDevice.desktop;                    parameter = googleUniqueParameters.desktop;                    break;                case \'mobile\':                    slot = slotForDevice.mobile;                    parameter = googleUniqueParameters.mobile;                    if (slot == \'\') {                        slot = slotForDevice.desktop;                    }                    break;                case \'tablet\':                    slot = slotForDevice.mobile;                    parameter = googleUniqueParameters.mobile;                    if (slot == \'\') {                        slot = slotForDevice.desktop;                    }                    break;            }        }        if (!isSubscribed && (typeof noADX == \'undefined\' || noADX === false) && slot != \'\') {            var advParts = {};            advParts.initScript = document.createElement(\'script\');            advParts.initScript.src = \'//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\';            advParts.initScript.async = \'true\';            advParts.initScript.onload = function () {                (adsbygoogle = window.adsbygoogle || []).push({});            };            advParts.body = document.createElement(\'ins\');            advParts.body.className = \'adsbygoogle\';            advParts.body.style.display = \'block\';            advParts.body.setAttribute(\'data-ad-format\', \'autorelaxed\');            advParts.body.setAttribute(\'data-ad-client\', \'ca-pub-8962558862962174\');            advParts.body.setAttribute(\'data-ad-slot\', slot);            try {                parameter = JSON.parse(parameter);                for (var key in parameter) {                    if (parameter.hasOwnProperty(key)) {                        advParts.body.setAttribute(key, parameter[key]);                    }                }            } catch (e) {            }            if (recommDiv.getAttribute(\\"ctsStyle\\") != null) {                recommDiv.style = recommDiv.getAttribute(\\"ctsStyle\\");                recommDiv.removeAttribute(\\"ctsStyle\\");            } else {                recommDiv.removeAttribute(\\"style\\");            }            recommDiv.appendChild(advParts.body);            recommDiv.appendChild(advParts.initScript);            recommDiv.removeAttribute(\'id\');        } else {            recommDiv.parentNode.removeChild(recommDiv);        }    })();</script>\"}]';
  this.positions_weighted['content020'] = false;
  
  this.positions['right020'] = '[{\"service_name\": \"Google Adverts\", \"weight\": null, \"source\": \"<div id=\\"ctsGadxTemp\\" class=\\"ctsGadx\\" ctsStyle=\\"margin-bottom: 10px;\\" style=\\"display: none;\\"><script type=\\"text/javascript\\">\t(function () {        var slotForDevice = \'\';        var gadxErr = false;        var dimensionForDevice = {            width: parseInt(300),            height: parseInt(350)        };        var isSubscribed = false;        if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData() != undefined && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {            isSubscribed = true;        }        if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {            switch (_ceDeviceDetect.getDeviceType()) {                case \'desktop\':                    slotForDevice = \'3871643660\';                    break;                case \'mobile\':                    slotForDevice = \'${google_adx_slot_default_for_mobile}\';                    dimensionForDevice.width = 300;                    dimensionForDevice.height = 250;                    break;                case \'tablet\':                    if (\'${google_adx_slot_default_for_tablet}\' != \'\') {                        slotForDevice = \'${google_adx_slot_default_for_tablet}\';                    } else {                        slotForDevice = \'3871643660\';                    }                    break;            }            try {            } catch (err) {                gadxErr = true;            }        }        if (!isSubscribed && (typeof noADX == \'undefined\' || noADX === false) && slotForDevice != \'\') {            var advParts = {};            var gadxDiv = document.getElementById(\'ctsGadxTemp\');            advParts.initScript = document.createElement(\'script\');            advParts.initScript.src = \'//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\';            advParts.initScript.async = \'true\';            advParts.body = document.createElement(\'ins\');            advParts.body.className = \'adsbygoogle\';            advParts.body.style.display = \'table\';            advParts.body.style.margin = \'0 auto\';            advParts.body.style.width = dimensionForDevice.width + \'px\';            advParts.body.style.height = dimensionForDevice.height + \'px\';            advParts.body.setAttribute(\'data-ad-client\', \'ca-pub-8962558862962174\');            advParts.body.setAttribute(\'data-ad-slot\', slotForDevice);            advParts.body.setAttribute(\'data-max-num-ads\', parseInt(3));            if (typeof \'${google_ad_page_url}\' !== \'undefined\' && \'${google_ad_page_url}\' != \'\') {                advParts.body.setAttribute(\'data-page-url\', \'${google_ad_page_url}\');            }            if (gadxDiv.getAttribute(\\"ctsStyle\\") != null) {                gadxDiv.style = gadxDiv.getAttribute(\\"ctsStyle\\");                gadxDiv.removeAttribute(\\"ctsStyle\\");            } else {                gadxDiv.removeAttribute(\\"style\\");            }            gadxDiv.appendChild(advParts.initScript);            gadxDiv.appendChild(advParts.body);            (adsbygoogle = window.adsbygoogle || []).push({});            gadxDiv.removeAttribute(\'id\');        } else {            var adxElement = document.getElementById(\'ctsGadxTemp\');            adxElement.parentNode.removeChild(adxElement);        }    })();\t</script></div>\"}]';
  this.positions_weighted['right020'] = false;
  
  this.positions['mobile-content020'] = '[{\"service_name\": \"Rubicon\", \"weight\": null, \"source\": \"<div id=\\"RubiconAdTemp\\" class=\\"rubAd\\" ctsStyle=\\"width: 100%;text-align: center;${custom_css}\\" style=\\"display: none;\\"><script language=\\"JavaScript\\" type=\\"text/javascript\\">\t(function () {        var rubiconZoneSize = \'\';        var rubiconSite = \'${rubicon_ad_site}\';        var rubiconSiteMobile = \'90774\';        var rubiconAdType = \'${rubicon_ad_type}\';        var tplElement = document.getElementById(\\"RubiconAdTemp\\");        var advParts = {};        var insertedGoogle = false;        var isSubscribed = false;        if (rubiconAdType == \'\') {            rubiconAdType = \'js\';        }        if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData() != undefined && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {            isSubscribed = true;        }        if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {            switch (_ceDeviceDetect.getDeviceType()) {                case \'desktop\':                    rubiconZoneSize = \'${rubicon_ad_zone_desktop}\';                    break;                case \'mobile\':                    rubiconZoneSize = \'773064-15\';                    rubiconZoneSize = rubiconZoneSize.split(\'-\')[0] + \'-15\';                    break;                case \'tablet\':                    rubiconZoneSize = \'${rubicon_ad_zone_tablet}\';                    if (rubiconZoneSize == \'\') {                        rubiconZoneSize = \'${rubicon_ad_zone_desktop}\';                    }                    break;            }            if (_ceDeviceDetect.getDeviceType() != \'desktop\' && rubiconSiteMobile != undefined && rubiconSiteMobile != \'\' && rubiconSiteMobile != \'undefined\') {                rubiconSite = rubiconSiteMobile;            }            if (navigator.userAgent.toLowerCase().indexOf(\\"ipad\\") !== -1 && navigator.userAgent.toLowerCase().indexOf(\\"iphone\\") === -1) {                if (!isSubscribed) {                    insertedGoogle = true;                    advParts.initScript = document.createElement(\'script\');                    advParts.initScript.src = \'//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\';                    advParts.initScript.async = \'true\';                    advParts.body = document.createElement(\'ins\');                    advParts.body.className = \'adsbygoogle\';                    advParts.body.style = \\"display:inline-block;min-width:320px;max-width:1200px;width:100%;height:200px\\";                    advParts.body.setAttribute(\'data-ad-client\', \'ca-pub-8962558862962174\');                    advParts.body.setAttribute(\'data-ad-slot\', \'5920657040\');                    if (tplElement.getAttribute(\\"ctsStyle\\") != null) {                        tplElement.style = tplElement.getAttribute(\\"ctsStyle\\");                        tplElement.removeAttribute(\\"ctsStyle\\");                    } else {                        tplElement.removeAttribute(\\"style\\");                    }                    tplElement.appendChild(advParts.initScript);                    tplElement.appendChild(advParts.body);                    (adsbygoogle = window.adsbygoogle || []).push({});                    tplElement.removeAttribute(\'id\');                }            }        }        if (!insertedGoogle) {            if (!isSubscribed && (typeof noRUBICON == \'undefined\' || noRUBICON === false) && rubiconZoneSize.split(\'-\')[0] != \'\') {                rp_account = \'13818\';                rp_site = rubiconSite;                rp_zonesize = rubiconZoneSize;                rp_adtype = rubiconAdType;                tplElement.removeAttribute(\'id\');                if (tplElement.getAttribute(\\"ctsStyle\\") != null) {                    tplElement.style = tplElement.getAttribute(\\"ctsStyle\\");                    tplElement.removeAttribute(\\"ctsStyle\\");                } else {                    tplElement.removeAttribute(\\"style\\");                }            } else {                tplElement.remove();            }        }    })();\t</script><script type=\\"text/javascript\\" src=\\"//ads.rubiconproject.com/ad/13818.js\\"></script></div>\"}, {\"service_name\": \"Google Adverts\", \"weight\": null, \"source\": \"<div id=\\"cts_content_recomm\\" class=\\"ctsGadx\\" ctsStyle=\\"display:block;margin-top:30px;margin-bottom:30px;${custom_css}\\"    style=\\"display: none;\\"><script type=\\"text/javascript\\">        (function () {            var slotForDevice = {                desktop: \'2452210460\',                mobile: \'1616806061\',                tablet: \'1616806061\'            },                recommDiv = document.getElementById(\'cts_content_recomm\'),                slot = \'\',                parameter = \'\',                googleUniqueParameters = {                    desktop: \'${google_recomm_unique_parameters}\',                    mobile: \'{\\"data-matched-content-rows-num\\": \\"12,6\\", \\"data-matched-content-columns-num\\": \\"1,2\\", \\"data-matched-content-ui-type\\": \\"image_sidebyside,image_sidebyside\\"}\',                    tablet: \'{\\"data-matched-content-rows-num\\": \\"12,6\\", \\"data-matched-content-columns-num\\": \\"1,2\\", \\"data-matched-content-ui-type\\": \\"image_sidebyside,image_sidebyside\\"}\'                };            var isSubscribed = false;            if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData() != undefined && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {                isSubscribed = true;            }            if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {                switch (_ceDeviceDetect.getDeviceType()) {                    case \'desktop\':                        slot = slotForDevice.desktop;                        parameter = googleUniqueParameters.desktop;                        break;                    case \'mobile\':                        slot = slotForDevice.mobile;                        parameter = googleUniqueParameters.mobile;                        if (slot == \'\') {                            slot = slotForDevice.desktop;                        }                        break;                    case \'tablet\':                        slot = slotForDevice.mobile;                        parameter = googleUniqueParameters.mobile;                        if (slot == \'\') {                            slot = slotForDevice.desktop;                        }                        break;                }            }            if (!isSubscribed && (typeof noADX == \'undefined\' || noADX === false) && slot != \'\') {                var advParts = {};                advParts.initScript = document.createElement(\'script\');                advParts.initScript.src = \'//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\';                advParts.initScript.async = \'true\';                advParts.body = document.createElement(\'ins\');                advParts.body.className = \'adsbygoogle\';                advParts.body.style.display = \'block\';                advParts.body.setAttribute(\'data-ad-format\', \'autorelaxed\');                advParts.body.setAttribute(\'data-ad-client\', \'ca-pub-8962558862962174\');                advParts.body.setAttribute(\'data-ad-slot\', slot);                try {                    parameter = JSON.parse(parameter);                    for (var key in parameter) {                        if (parameter.hasOwnProperty(key)) {                            advParts.body.setAttribute(key, parameter[key]);                        }                    }                } catch (e) {                }                if (recommDiv.getAttribute(\\"ctsStyle\\") != null) {                    recommDiv.style = recommDiv.getAttribute(\\"ctsStyle\\");                    recommDiv.removeAttribute(\\"ctsStyle\\");                } else {                    recommDiv.removeAttribute(\\"style\\");                }                recommDiv.appendChild(advParts.initScript);                recommDiv.appendChild(advParts.body);                (adsbygoogle = window.adsbygoogle || []).push({});                recommDiv.removeAttribute(\'id\');            } else {                recommDiv.parentNode.removeChild(recommDiv);            }        })();    </script></div>\"}]';
  this.positions_weighted['mobile-content020'] = false;
  
  this.positions['list-content010'] = '[]';
  this.positions_weighted['list-content010'] = false;
  
  this.positions['bottom'] = '[{\"service_name\": \"Google Adverts\", \"weight\": null, \"source\": \"<div id=\\"ctsGadxTemp\\" class=\\"ctsGadx\\" ctsStyle=\\"display:table;margin:0 auto;\\" style=\\"display: none;\\"><script type=\\"text/javascript\\">\t(function () {        var slotForDevice = \'\';        var gadxErr = false;        var dimensionForDevice = {            width: parseInt(1200),            height: parseInt(200)        };        var isSubscribed = false;        if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData() != undefined && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {            isSubscribed = true;        }        if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {            switch (_ceDeviceDetect.getDeviceType()) {                case \'desktop\':                    slotForDevice = \'2173052214\';                    break;                case \'mobile\':                    slotForDevice = \'2173052214\';                    dimensionForDevice.width = 300;                    dimensionForDevice.height = 250;                    break;                case \'tablet\':                    if (\'${google_adx_slot_default_for_tablet}\' != \'\') {                        slotForDevice = \'${google_adx_slot_default_for_tablet}\';                    } else {                        slotForDevice = \'2173052214\';                    }                    break;            }            try {            } catch (err) {                gadxErr = true;            }        }        if (!isSubscribed && (typeof noADX == \'undefined\' || noADX === false) && slotForDevice != \'\') {            var advParts = {};            var gadxDiv = document.getElementById(\'ctsGadxTemp\');            advParts.initScript = document.createElement(\'script\');            advParts.initScript.src = \'//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\';            advParts.initScript.async = \'true\';            advParts.body = document.createElement(\'ins\');            advParts.body.className = \'adsbygoogle\';            advParts.body.style.display = \'table\';            advParts.body.style.margin = \'0 auto\';            advParts.body.style.width = dimensionForDevice.width + \'px\';            advParts.body.style.height = dimensionForDevice.height + \'px\';            advParts.body.setAttribute(\'data-ad-client\', \'ca-pub-8962558862962174\');            advParts.body.setAttribute(\'data-ad-slot\', slotForDevice);            advParts.body.setAttribute(\'data-max-num-ads\', parseInt(1));            if (typeof \'${google_ad_page_url}\' !== \'undefined\' && \'${google_ad_page_url}\' != \'\') {                advParts.body.setAttribute(\'data-page-url\', \'${google_ad_page_url}\');            }            if (gadxDiv.getAttribute(\\"ctsStyle\\") != null) {                gadxDiv.style = gadxDiv.getAttribute(\\"ctsStyle\\");                gadxDiv.removeAttribute(\\"ctsStyle\\");            } else {                gadxDiv.removeAttribute(\\"style\\");            }            gadxDiv.appendChild(advParts.initScript);            gadxDiv.appendChild(advParts.body);            (adsbygoogle = window.adsbygoogle || []).push({});            gadxDiv.removeAttribute(\'id\');        } else {            var adxElement = document.getElementById(\'ctsGadxTemp\');            adxElement.parentNode.removeChild(adxElement);        }    })();\t</script></div>\"}]';
  this.positions_weighted['bottom'] = false;
  
  this.positions['right060'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum\\" style=\\"display: none;\\"><script>        (function () {            var insertedElement = document.getElementById(\'ctstemp\');            var zoneForDevice = \'\';            var isSubscribed = false;            if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {                isSubscribed = true;            }            if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {                switch (_ceDeviceDetect.getDeviceType()) {                    case \'desktop\':                        zoneForDevice = \'6041319\';                        break;                    case \'mobile\':                        zoneForDevice = \'6041321\';                        break;                    case \'tablet\':                        zoneForDevice = \'${adv_zone_id_for_tablet}\';                        break;                }            }            if (zoneForDevice == \'\' || isSubscribed) {                insertedElement.parentNode.removeChild(insertedElement);            } else {                insertedElement.id = \'zone\' + zoneForDevice;                if (insertedElement.getAttribute(\\"ctsStyle\\") != null) {                    insertedElement.style = insertedElement.getAttribute(\\"ctsStyle\\");                    insertedElement.removeAttribute(\\"ctsStyle\\");                } else {                    insertedElement.removeAttribute(\\"style\\");                }            }        })();    </script></div>\"}]';
  this.positions_weighted['right060'] = false;
  
  this.positions['list-content020'] = '[]';
  this.positions_weighted['list-content020'] = false;
  
  this.positions['menu-manager'] = '[]';
  this.positions_weighted['menu-manager'] = false;
  
  this.positions['page-end'] = '[]';
  this.positions_weighted['page-end'] = false;
  
  this.positions['list-content020'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum\\" style=\\"display: none;\\"><script>        (function () {            var insertedElement = document.getElementById(\'ctstemp\');            var zoneForDevice = \'\';            var isSubscribed = false;            if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {                isSubscribed = true;            }            if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {                switch (_ceDeviceDetect.getDeviceType()) {                    case \'desktop\':                        zoneForDevice = \'6041318\';                        break;                    case \'mobile\':                        zoneForDevice = \'6041320\';                        break;                    case \'tablet\':                        zoneForDevice = \'${adv_zone_id_for_tablet}\';                        break;                }            }            if (zoneForDevice == \'\' || isSubscribed) {                insertedElement.parentNode.removeChild(insertedElement);            } else {                insertedElement.id = \'zone\' + zoneForDevice;                if (insertedElement.getAttribute(\\"ctsStyle\\") != null) {                    insertedElement.style = insertedElement.getAttribute(\\"ctsStyle\\");                    insertedElement.removeAttribute(\\"ctsStyle\\");                } else {                    insertedElement.removeAttribute(\\"style\\");                }            }        })();    </script></div>\"}]';
  this.positions_weighted['list-content020'] = false;
  
  this.positions['top'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum a8a263be\\" style=\\"display: none;\\"><script>        (function () {            var insertedElement = document.getElementById(\'ctstemp\');            var zoneForDevice = \'\';            var dataAdsvName = \'\';            var isSubscribed = false;            if (typeof _ceSubscriptionDetect != \'undefined\' && _ceSubscriptionDetect.getSubscriptionData().isSubscribed) {                isSubscribed = true;            }            if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {                switch (_ceDeviceDetect.getDeviceType()) {                    case \'desktop\':                        zoneForDevice = \'${adv_zone_id_for_desktop}\';                        dataAdsvName = \'${adverticum_name}\';                        break;                    case \'mobile\':                        zoneForDevice = \'6376260\';                        dataAdsvName = \'mobil_waterfall1\';                        break;                    case \'tablet\':                        zoneForDevice = \'${adv_zone_id_for_tablet}\';                        dataAdsvName = \'${adverticum_name_tablet}\';                        if (dataAdsvName == \\"\\") {                            dataAdsvName = \'${adverticum_name}\';                        }                        break;                }            }            if (zoneForDevice == \'\' || isSubscribed) {                insertedElement.parentNode.removeChild(insertedElement);            } else {                insertedElement.setAttribute(\'data-adsv-name\', dataAdsvName);                insertedElement.id = \'zone\' + zoneForDevice;                if (insertedElement.getAttribute(\\"ctsStyle\\") != null) {                    insertedElement.style = insertedElement.getAttribute(\\"ctsStyle\\");                    insertedElement.removeAttribute(\\"ctsStyle\\");                } else {                    insertedElement.removeAttribute(\\"style\\");                }            }        })();    </script></div>\"}]';
  this.positions_weighted['top'] = false;
}

Tagging.prototype.get_json = function(text) {
  return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g, '')))
         && eval('(' + text + ')');
}

Tagging.prototype.random_tag = function(position) {
  var tags = [];
  var weighted_tags = [];

  for (index in position) {
    tag = position[index];
    tags[index] = tag.source;

    for (var i = 0; i < tag.weight; i++) {
      weighted_tags.push(index);
    }
  }

  // Pick a random tag from array based on weight
  var random_index = weighted_tags[Math.floor((Math.random() * weighted_tags.length))];
  return tags[random_index];
}

Tagging.prototype.all_tags = function(position) {
  var tags = [], index, tag;
  for (index in position) {
    tag = position[index];
    tags[index] = tag.source;
  }
  return tags.join("\n");
}

Tagging.prototype.render = function(slug, context) {
    document.write(this.get_source(slug, context));
}

Tagging.prototype.get_source = function(slug, context) {
  if (typeof this.positions[slug] == 'undefined') {
    // This position doesn't exist, call the autodetect
    this._detect(slug);
  } else {
    var position = this.get_json(this.positions[slug]);
    var tag_source = "";

    if (this.positions_weighted[slug]) {
      tag_source = this.random_tag(position)
    } else {
      tag_source = this.all_tags(position);
    }

    // Replace variables
    var variables = {};
    for (variable in this.context) {
      variables[variable] = this.context[variable];
    }
    for (variable in context) {
      variables[variable] = context[variable];
    }
    tag_source = this._replace_variables(tag_source, variables);

    // Remove unset variables and return result
    return tag_source.replace(/\$\w+/g, "").replace(/\${\w+}/g, "");
  }
  return '';
}

Tagging.prototype.log = function(err) {
  //this._load(error_endpoint);
}

Tagging.prototype._load = function(url) {
  var head = document.getElementsByTagName('head')[0] || document.documentElement,
      script = document.createElement('script');

  script.type = 'text/javascript';
  script.src = url;
  head.appendChild(script);
}

Tagging.prototype._detect = function(position) {
  this._load(this.autodetect_url + this.site +'/'+ this.zone +'/' + position + '/');
}

Tagging.prototype._replace_variables = function(content, variables) {
  var RE_VALID_IDENT = /^[a-zA-Z_]\w*$/;
  for (variable in variables) {
    if (RE_VALID_IDENT.test(variable)) {
      var regexes = [new RegExp('\\$' + variable, 'g'), new RegExp('\\${' + variable + '}', 'g')];

      for (re in regexes) {
        content = content.replace(regexes[re], variables[variable]);
      }
    } else {
      throw "'" + variable + "' is not a valid identifier.";
    }
  }
  return content;
}



