Tagging = function(context) {
  this.site = 'cosmopolitan-wp';
  this.zone = 'default';
  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\": \"Gemius Traffic\", \"weight\": null, \"source\": \"<script type=\\"text/javascript\\">    var properGemId = (\'${gemius_trackid}\' != \'\' ? \'${gemius_trackid}\' : \'ndpLADcukKOKQ7YCrntNnadzHQIgY6_PLMYf.OUhN0v.v7\');        if(typeof _ceDeviceDetect.getDeviceType() !== \'undefined\' && _ceDeviceDetect.getDeviceType() != \'desktop\' && \'nXpFZjeuNb0qB5zIDnABiqcT38Mgo8bzYs3CNgg6fAz.O7\' != \'\') {        properGemId = \'nXpFZjeuNb0qB5zIDnABiqcT38Mgo8bzYs3CNgg6fAz.O7\';    }       var pp_gemius_identifier = properGemId;    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 || {};    _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);    })();        var googletag = googletag || {};    googletag.cmd = googletag.cmd || [];    googletag.cmd.push(function() {        googletag.pubads().enableSingleRequest();        googletag.pubads().collapseEmptyDivs();        googletag.enableServices();    });}</script>\"}, {\"service_name\": \"Criteo\", \"weight\": null, \"source\": \"<script async=\\"async\\" type=\\"text/javascript\\" src=\\"https://static.criteo.net/js/ld/publishertag.js\\"></script><script>    window.Criteo = window.Criteo || {};    window.Criteo.events = window.Criteo.events || [];</script>\"}]';
  this.positions_weighted['head'] = false;
  
  this.positions['body-start'] = '[{\"service_name\": \"Google Tag Manager\", \"weight\": null, \"source\": \"<noscript><iframe src=\\"//www.googletagmanager.com/ns.html?id=GTM-MQ32CN\\"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-MQ32CN\');</script>\"}]';
  this.positions_weighted['body-start'] = 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 type=\\"text/javascript\\">    (function(){        var googleCPLink = (\\"${google_cookie_policy_link}\\" != \\"\\") ? \\"${google_cookie_policy_link}\\" : \\"//centralmediacsoport.hu/Company/Central-Digitalis-Media-Adatkezelesi-tajekoztato\\";        var googleCPRename = (\\"${google_cookie_policy_rename}\\" != \\"\\") ? \\"${google_cookie_policy_rename}\\" : 1;        var hostname = document.location.hostname.split(\'.\');        hostname = \\".\\"+hostname[hostname.length-2]+\\".\\"+hostname[hostname.length-1];        window.cookieconsent_options = {            \\"message\\"   : \\"A weboldalon cookie-kat haszn&#xE1;lunk, hogy biztons&#xE1;gos b&#xF6;ng&#xE9;sz&#xE9;s mellett a legjobb felhaszn&#xE1;l&#xF3;i &#xE9;lm&#xE9;nyt ny&#xFA;jthassunk.\\",            \\"dismiss\\"   : \\"Rendben!\\",            \\"learnMore\\" : \\"R&#xE9;szletes le&#xED;r&#xE1;s\\",            \\"link\\"      : googleCPLink,            \\"theme\\"     : \\"//stat.p24.hu/CTS/helper-scripts/cookieconsent/styles/custom.css\\",            \\"expiryDays\\": 1095,            \\"domain\\"    : hostname,            \\"renamed\\"   : googleCPRename        };    })();</script><script type=\\"text/javascript\\" src=\\"//stat.p24.hu/CTS/helper-scripts/cookieconsent/cookieconsent.min.js\\"></script>\"}, {\"service_name\": \"Strossle\", \"weight\": null, \"source\": \"<script src=\\"//widgets.sprinklecontent.com/v2/sprinkle.js\\" async></script>\"}, {\"service_name\": \"Strossle\", \"weight\": null, \"source\": \"<script>    (function () {        window.strossle=window.strossle||function(){(strossle.q=strossle.q||[]).push(arguments)};        if(window._ceDisplayData != undefined && window._ceDisplayData.strossle != undefined && window._ceDisplayData.strossle.items != undefined){            var strossleItems = window._ceDisplayData.strossle.items;            for(var i=0; i<Object.keys(strossleItems).length; i++){                var strossleElId = Object.keys(strossleItems)[i],                    strossleId = window._ceDisplayData.strossle.items[strossleElId].id;                strossle(strossleId, \'#\' + strossleElId);            }        }    })();</script><script async src=\\"//assets.strossle.com/strossle-widget-sdk/1/strossle-widget-sdk.js\\"></script>\"}]';
  this.positions_weighted['body-end'] = false;
  
  this.positions['body-end-adv'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<!-- Goa3: 3984337 --><div id=\\"zone3984337\\" class=\\"goAdverticum\\"></div>\"}, {\"service_name\": \"Google Adverts\", \"weight\": null, \"source\": \"<script async src=\\"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\\"></script><script>\tif (typeof _ceDeviceDetect !== \'undefined\' && typeof _ceDeviceDetect.getDeviceType === \'function\' && _ceDeviceDetect.getDeviceType() === \'mobile\') {\t\t(adsbygoogle = window.adsbygoogle || []).push({\t\t\tgoogle_ad_client: \\"ca-pub-8962558862962174\\",\t\t\tenable_page_level_ads: true\t\t});\t }</script>\"}]';
  this.positions_weighted['body-end-adv'] = false;
  
  this.positions['content-top'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum a8a263be\\" data-adsv-name=\\"\\"></div><script>var insertedElement = document.getElementById(\'ctstemp\');var zoneForDevice = \'\';var dataAdsvName = \'\';if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {    switch (_ceDeviceDetect.getDeviceType()) {        case \'desktop\':            zoneForDevice = \'1893209\';            dataAdsvName = \'top\';            break;        case \'mobile\':            zoneForDevice = \'3952933\';            dataAdsvName = \'${adverticum_name_mobile}\';            break;        case \'tablet\':            zoneForDevice = \'1893209\';            dataAdsvName = \'${adverticum_name_tablet}\';            if(dataAdsvName == \\"\\"){                dataAdsvName = \'top\';            }            break;    }}if (zoneForDevice == \'\') {    insertedElement.parentNode.removeChild(insertedElement);} else {    insertedElement.setAttribute(\'data-adsv-name\', dataAdsvName);    insertedElement.id = \'zone\' + zoneForDevice;}</script>\"}, {\"service_name\": \"Criteo\", \"weight\": null, \"source\": \"<div id=\\"criteoTPL\\"     style=\\"width:0px;height:0px;margin:0 auto;overflow:hidden;${custom_css}\\"></div><script type=\\"text/javascript\\">    (function () {        var zoneid = 1385751,            height = 90,            width = 970,            criteoEl = document.getElementById(\\"criteoTPL\\"),            domReady = \\"${criteo_dom_ready}\\",            mutationTimeout = 5000,            mutationConf = {attributes: true, childList: true, subtree: true};        var insertCriteoBanner = function () {            criteoEl.id += Math.floor(Math.random() * 1000000);            var observer = new MutationObserver(function (mutations) {                mutations.forEach(function () {                    criteoEl.style.width = width + \\"px\\";                    criteoEl.style.height = height + \\"px\\";                    criteoEl.style.marginTop = \\"10px\\";                    criteoEl.style.marginBottom = \\"10px\\";                    observer.disconnect();                });            });            observer.observe(criteoEl, mutationConf);            setTimeout(function(){ observer.disconnect(); }, mutationTimeout);            Criteo.events.push(function () {                Criteo.DisplayAcceptableAdIfAdblocked({                    \\"zoneid\\": zoneid,                    \\"containerid\\": criteoEl.id,                    \\"overrideZoneFloor\\": true                });            });        };        if (domReady != undefined && domReady != \'\' && domReady) {            if (typeof document.addEventListener !== \'undefined\') {                document.addEventListener(\\"DOMContentLoaded\\", insertCriteoBanner);            } else {                window.attachEvent(\\"onload\\", insertCriteoBanner);            }        } else {            insertCriteoBanner();        }    })();</script>\"}]';
  this.positions_weighted['content-top'] = false;
  
  this.positions['list-content010'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum a8a263be\\" data-adsv-name=\\"\\"></div><script>var insertedElement = document.getElementById(\'ctstemp\');var zoneForDevice = \'\';var dataAdsvName = \'\';if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {    switch (_ceDeviceDetect.getDeviceType()) {        case \'desktop\':            zoneForDevice = \'${adv_zone_id_for_desktop}\';            dataAdsvName = \'${adverticum_name}\';            break;        case \'mobile\':            zoneForDevice = \'2905893\';            dataAdsvName = \'mobil_waterfall1\';            break;        case \'tablet\':            zoneForDevice = \'${adv_zone_id_for_tablet}\';            dataAdsvName = \'${adverticum_name_tablet}\';            if(dataAdsvName == \\"\\"){                dataAdsvName = \'${adverticum_name}\';            }            break;    }}if (zoneForDevice == \'\') {    insertedElement.parentNode.removeChild(insertedElement);} else {    insertedElement.setAttribute(\'data-adsv-name\', dataAdsvName);    insertedElement.id = \'zone\' + zoneForDevice;}</script>\"}]';
  this.positions_weighted['list-content010'] = false;
  
  this.positions['menu-manager'] = '[]';
  this.positions_weighted['menu-manager'] = false;
  
  this.positions['page-end'] = '[]';
  this.positions_weighted['page-end'] = false;
  
  this.positions['content010'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum a8a263be\\" data-adsv-name=\\"\\"></div><script>var insertedElement = document.getElementById(\'ctstemp\');var zoneForDevice = \'\';var dataAdsvName = \'\';if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {    switch (_ceDeviceDetect.getDeviceType()) {        case \'desktop\':            zoneForDevice = \'4127\';            dataAdsvName = \'roadblock\';            break;        case \'mobile\':            zoneForDevice = \'3124238\';            dataAdsvName = \'${adverticum_name_mobile}\';            break;        case \'tablet\':            zoneForDevice = \'4127\';            dataAdsvName = \'${adverticum_name_tablet}\';            if(dataAdsvName == \\"\\"){                dataAdsvName = \'roadblock\';            }            break;    }}if (zoneForDevice == \'\') {    insertedElement.parentNode.removeChild(insertedElement);} else {    insertedElement.setAttribute(\'data-adsv-name\', dataAdsvName);    insertedElement.id = \'zone\' + zoneForDevice;}</script>\"}, {\"service_name\": \"Criteo\", \"weight\": null, \"source\": \"<div id=\\"criteoTPL\\"     style=\\"width:0px;height:0px;margin:0 auto;overflow:hidden;${custom_css}\\"></div><script type=\\"text/javascript\\">    (function () {        var zoneid = 1168295,            height = 250,            width = 300,            criteoEl = document.getElementById(\\"criteoTPL\\"),            domReady = \\"${criteo_dom_ready}\\",            mutationTimeout = 5000,            mutationConf = {attributes: true, childList: true, subtree: true};        var insertCriteoBanner = function () {            criteoEl.id += Math.floor(Math.random() * 1000000);            var observer = new MutationObserver(function (mutations) {                mutations.forEach(function () {                    criteoEl.style.width = width + \\"px\\";                    criteoEl.style.height = height + \\"px\\";                    criteoEl.style.marginTop = \\"10px\\";                    criteoEl.style.marginBottom = \\"10px\\";                    observer.disconnect();                });            });            observer.observe(criteoEl, mutationConf);            setTimeout(function(){ observer.disconnect(); }, mutationTimeout);            Criteo.events.push(function () {                Criteo.DisplayAcceptableAdIfAdblocked({                    \\"zoneid\\": zoneid,                    \\"containerid\\": criteoEl.id,                    \\"overrideZoneFloor\\": true                });            });        };        if (domReady != undefined && domReady != \'\' && domReady) {            if (typeof document.addEventListener !== \'undefined\') {                document.addEventListener(\\"DOMContentLoaded\\", insertCriteoBanner);            } else {                window.attachEvent(\\"onload\\", insertCriteoBanner);            }        } else {            insertCriteoBanner();        }    })();</script>\"}]';
  this.positions_weighted['content010'] = false;
  
  this.positions['content020'] = '[{\"service_name\": \"Sanoma/Cosmopolitan\", \"weight\": null, \"source\": \"<script>    var defADXw = 710;    var elemWcheck = \'\';    if (document.getElementsByClassName(\'article-body\').length > 0) {        elemWcheck = properADXw = document.getElementsByClassName(\'article-body\')[0];    } else if (document.getElementsByClassName(\'articleItem\').length > 0) {        elemWcheck = document.getElementsByClassName(\'articleItem\')[0];    }    if (typeof elemWcheck === \'object\' && defADXw > elemWcheck.offsetWidth > 0) {        var ADXBannerWidth = elemWcheck.offsetWidth;    } else {\t\tvar ADXBannerWidth = defADXw;\t}    elemWcheck = undefined;    defADXw = undefined;</script>\"}, {\"service_name\": \"Rubicon\", \"weight\": null, \"source\": \"<div id=\\"RubiconAdTemp\\" class=\\"rubAd\\" style=\\"width: 100%;text-align: center;margin-top:15px;margin-bottom:15px;\\"><script language=\\"JavaScript\\" type=\\"text/javascript\\">        var rubiconZoneSize = \'\';        var rubiconSite = \'65902\';        var rubiconSiteMobile = \'81602\';        var rubiconAdType = \'${rubicon_ad_type}\';        var tplElement = document.getElementById(\\"RubiconAdTemp\\");        var advParts = {};        var insertedGoogle = false;        if(rubiconAdType == \'\'){            rubiconAdType = \'js\';        }        if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {            switch (_ceDeviceDetect.getDeviceType()) {                case \'desktop\':                    rubiconZoneSize = \'592552-198\';                    break;                case \'mobile\':                    rubiconZoneSize = \'773038-15\';                    rubiconZoneSize = rubiconZoneSize.split(\'-\')[0]+\'-15\';                    break;                case \'tablet\':                    rubiconZoneSize = \'${rubicon_ad_zone_tablet}\';                    if(rubiconZoneSize == \'\'){                        rubiconZoneSize = \'592552-198\';                    }                    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){                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\');                tplElement.appendChild(advParts.initScript);                tplElement.appendChild(advParts.body);                (adsbygoogle = window.adsbygoogle || []).push({});                tplElement.removeAttribute(\'id\');            }        }        if(!insertedGoogle){            if ((typeof noRUBICON == \'undefined\' || noRUBICON === false) && rubiconZoneSize.split(\'-\')[0] != \'\') {                rp_account   = \'13818\';                rp_site      = rubiconSite;                rp_zonesize  = rubiconZoneSize;                rp_adtype    = rubiconAdType;                tplElement.removeAttribute(\'id\');            }else{                tplElement.remove();            }        }    </script><script type=\\"text/javascript\\" src=\\"//ads.rubiconproject.com/ad/13818.js\\"></script></div>\"}]';
  this.positions_weighted['content020'] = false;
  
  this.positions['content030'] = '[]';
  this.positions_weighted['content030'] = false;
  
  this.positions['content060'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum\\"></div><script>    var insertedElement = document.getElementById(\'ctstemp\');    var zoneForDevice = \'\';    if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {        switch (_ceDeviceDetect.getDeviceType()) {                case \'desktop\':                    zoneForDevice = \'3890664\';                    break;                case \'mobile\':                    zoneForDevice = \'${adv_zone_id_for_mobile}\';                    break;                case \'tablet\':                    zoneForDevice = \'${adv_zone_id_for_tablet}\';                    break;        }    }    if (zoneForDevice == \'\') {\tinsertedElement.parentNode.removeChild(insertedElement);    } else {        insertedElement.id = \'zone\' + zoneForDevice;    }</script>\"}]';
  this.positions_weighted['content060'] = false;
  
  this.positions['content050'] = '[{\"service_name\": \"Google Adverts\", \"weight\": null, \"source\": \"<div id=\\"ctsGadxTemp\\" class=\\"ctsGadx\\" style=\\"width:100%;text-align: center;margin-top:15px;display:inline-block;${custom_css}\\"></div><script>var slotForDevice = \'\';var gadxErr = false;var dimensionForDevice = {    width: parseInt(300),    mobileWidth: parseInt(360),    minWidth: parseInt(${google_ad_min_width}),    height: parseInt(250),    mobileHeight: parseInt(266)};if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {    switch (_ceDeviceDetect.getDeviceType()) {        case \'desktop\':            slotForDevice = \'[2800553159,2553141145]\';            break;        case \'mobile\':            slotForDevice = \'${google_adx_slot_default_for_mobile}\';            dimensionForDevice.width = 300;            dimensionForDevice.minWidth = 300;            dimensionForDevice.height = 250;            if (!isNaN(dimensionForDevice.mobileWidth)) {                dimensionForDevice.width = dimensionForDevice.mobileWidth;            }            if (!isNaN(dimensionForDevice.mobileHeight)) {                dimensionForDevice.height = dimensionForDevice.mobileHeight;            }            break;        case \'tablet\':            if (\'${google_adx_slot_default_for_tablet}\' != \'\') {                slotForDevice = \'${google_adx_slot_default_for_tablet}\';            } else {                slotForDevice = \'[2800553159,2553141145]\';            }            break;    }}if ((typeof noADX == \'undefined\' || noADX === false) && slotForDevice != \'\') {    var gadxDiv = document.getElementById(\'ctsGadxTemp\'),        adNum = 1;    try {        slotForDevice = JSON.parse(slotForDevice);        if(slotForDevice.length > 0){            adNum = slotForDevice.length;        }    } catch (e) {}    var advParts = {};    advParts.initScript = document.createElement(\'script\');    advParts.initScript.src = \'//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\';    advParts.initScript.async = \'true\';    gadxDiv.appendChild(advParts.initScript);    for (var i = 0; i < adNum; i++) {        var slotNum = slotForDevice[i] != undefined ? slotForDevice[i] : slotForDevice;        advParts.body = document.createElement(\'ins\');        advParts.body.className = \'adsbygoogle\';        advParts.body.style.display = \'inline-block\';        advParts.body.style.height = dimensionForDevice.height + \'px\';        advParts.body.style.cssFloat = i == 0 ? \'left\' : \'right\';        if (!isNaN(dimensionForDevice.minWidth) && !isNaN(dimensionForDevice.width)) {            advParts.body.style.maxWidth = dimensionForDevice.width + \'px\';            advParts.body.style.minWidth = dimensionForDevice.minWidth + \'px\';            advParts.body.style.width = \'100%\';        } else {            advParts.body.style.width = dimensionForDevice.width + \'px\';        }        advParts.body.setAttribute(\'data-ad-client\', \'ca-pub-8962558862962174\');        advParts.body.setAttribute(\'data-ad-slot\', slotNum);        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}\');        }        gadxDiv.appendChild(advParts.body);        (adsbygoogle = window.adsbygoogle || []).push({});    }    gadxDiv.removeAttribute(\'id\');} else {    var adxElement = document.getElementById(\'ctsGadxTemp\');    adxElement.parentNode.removeChild(adxElement);}</script>\"}, {\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum\\"></div><script>    var insertedElement = document.getElementById(\'ctstemp\');    var zoneForDevice = \'\';    if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {        switch (_ceDeviceDetect.getDeviceType()) {                case \'desktop\':                    zoneForDevice = \'1697235\';                    break;                case \'mobile\':                    zoneForDevice = \'${adv_zone_id_for_mobile}\';                    break;                case \'tablet\':                    zoneForDevice = \'${adv_zone_id_for_tablet}\';                    break;        }    }    if (zoneForDevice == \'\') {\tinsertedElement.parentNode.removeChild(insertedElement);    } else {        insertedElement.id = \'zone\' + zoneForDevice;    }</script>\"}, {\"service_name\": \"Rubicon\", \"weight\": null, \"source\": \"<div id=\\"RubiconAdTemp\\" class=\\"rubAd\\" style=\\"width: 100%;text-align: center;${custom_css}\\"><div style=\\"text-align: right; font-size: 8px; color: #C6C6C6; margin: 0 auto;\\">HIRDET&#xC9;S</div><script language=\\"JavaScript\\" type=\\"text/javascript\\">        var rubiconZoneSize = \'\';        var rubiconSite = \'65902\';        var rubiconSiteMobile = \'81602\';        var rubiconAdType = \'${rubicon_ad_type}\';        var tplElement = document.getElementById(\\"RubiconAdTemp\\");        var advParts = {};        var insertedGoogle = false;        if(rubiconAdType == \'\'){            rubiconAdType = \'js\';        }        if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {            switch (_ceDeviceDetect.getDeviceType()) {                case \'desktop\':                    rubiconZoneSize = \'${rubicon_ad_zone_desktop}\';                    break;                case \'mobile\':                    rubiconZoneSize = \'1279226-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){                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\');                tplElement.appendChild(advParts.initScript);                tplElement.appendChild(advParts.body);                (adsbygoogle = window.adsbygoogle || []).push({});                tplElement.removeAttribute(\'id\');            }        }        if(!insertedGoogle){            if ((typeof noRUBICON == \'undefined\' || noRUBICON === false) && rubiconZoneSize.split(\'-\')[0] != \'\') {                rp_account   = \'13818\';                rp_site      = rubiconSite;                rp_zonesize  = rubiconZoneSize;                rp_adtype    = rubiconAdType;                tplElement.removeAttribute(\'id\');            }else{                tplElement.remove();            }        }    </script><script type=\\"text/javascript\\" src=\\"//ads.rubiconproject.com/ad/13818.js\\"></script></div>\"}]';
  this.positions_weighted['content050'] = false;
  
  this.positions['content040'] = '[{\"service_name\": \"Google Adverts\", \"weight\": null, \"source\": \"<div id=\\"cts_content_recomm\\" class=\\"ctsGadx\\"     style=\\"display:block;margin-top:30px;margin-bottom:30px;${custom_css}\\"></div><script type=\\"text/javascript\\">    (function () {        var slotForDevice = {                desktop: \'9035297662\',                mobile: \'7072312723\',                tablet: \'7072312723\'            },            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\\"}\'            };        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;                    break;                case \'tablet\':                    slot = slotForDevice.mobile;                    parameter = googleUniqueParameters.mobile;                    break;            }        }        if ((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){            }            recommDiv.appendChild(advParts.initScript);            recommDiv.appendChild(advParts.body);            (adsbygoogle = window.adsbygoogle || []).push({});            recommDiv.removeAttribute(\'id\');        } else {            recommDiv.parentNode.removeChild(recommDiv);        }    })();</script>\"}, {\"service_name\": \"Criteo\", \"weight\": null, \"source\": \"<div id=\\"criteoTPL\\"     style=\\"width:0px;height:0px;margin:0 auto;overflow:hidden;${custom_css}\\"></div><script type=\\"text/javascript\\">    (function () {        var zoneid = 1385752,            height = 360,            width = 640,            criteoEl = document.getElementById(\\"criteoTPL\\"),            domReady = \\"${criteo_dom_ready}\\",            mutationTimeout = 5000,            mutationConf = {attributes: true, childList: true, subtree: true};        var insertCriteoBanner = function () {            criteoEl.id += Math.floor(Math.random() * 1000000);            var observer = new MutationObserver(function (mutations) {                mutations.forEach(function () {                    criteoEl.style.width = width + \\"px\\";                    criteoEl.style.height = height + \\"px\\";                    criteoEl.style.marginTop = \\"10px\\";                    criteoEl.style.marginBottom = \\"10px\\";                    observer.disconnect();                });            });            observer.observe(criteoEl, mutationConf);            setTimeout(function(){ observer.disconnect(); }, mutationTimeout);            Criteo.events.push(function () {                Criteo.DisplayAcceptableAdIfAdblocked({                    \\"zoneid\\": zoneid,                    \\"containerid\\": criteoEl.id,                    \\"overrideZoneFloor\\": true                });            });        };        if (domReady != undefined && domReady != \'\' && domReady) {            if (typeof document.addEventListener !== \'undefined\') {                document.addEventListener(\\"DOMContentLoaded\\", insertCriteoBanner);            } else {                window.attachEvent(\\"onload\\", insertCriteoBanner);            }        } else {            insertCriteoBanner();        }    })();</script>\"}, {\"service_name\": \"Strossle\", \"weight\": null, \"source\": \"<div id=\\"strossleTPL\\" style=\\"${strossle_style}\\"></div><script>    (function () {        var strossleTPLElement = document.getElementById(\\"strossleTPL\\"),            strossleID = \\"bba60b07-7727-4fe2-bb56-4ebe8ee2bd88\\";        window._ceDisplayData = window._ceDisplayData || {};        if (strossleID != undefined && strossleID != \\"\\" && typeof localStorage.A42A6Cblck != \'undefined\' && JSON.parse(localStorage.A42A6Cblck).bl == 1) {            strossleTPLElement.id += Math.floor(Math.random() * 10000000);            window._ceDisplayData.strossle = window._ceDisplayData.strossle || {items: {}};            window._ceDisplayData.strossle.items[strossleTPLElement.id] = {};            window._ceDisplayData.strossle.items[strossleTPLElement.id].id = strossleID;        } else {            strossleTPLElement.remove();        }    })();</script>\"}]';
  this.positions_weighted['content040'] = false;
  
  this.positions['right010'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum a8a263be\\" data-adsv-name=\\"\\"></div><script>var insertedElement = document.getElementById(\'ctstemp\');var zoneForDevice = \'\';var dataAdsvName = \'\';if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {    switch (_ceDeviceDetect.getDeviceType()) {        case \'desktop\':            zoneForDevice = \'11523\';            dataAdsvName = \'box1\';            break;        case \'mobile\':            zoneForDevice = \'${adv_zone_id_for_mobile}\';            dataAdsvName = \'${adverticum_name_mobile}\';            break;        case \'tablet\':            zoneForDevice = \'11523\';            dataAdsvName = \'${adverticum_name_tablet}\';            if(dataAdsvName == \\"\\"){                dataAdsvName = \'box1\';            }            break;    }}if (zoneForDevice == \'\') {    insertedElement.parentNode.removeChild(insertedElement);} else {    insertedElement.setAttribute(\'data-adsv-name\', dataAdsvName);    insertedElement.id = \'zone\' + zoneForDevice;}</script>\"}, {\"service_name\": \"Criteo\", \"weight\": null, \"source\": \"<div id=\\"criteoTPL\\"     style=\\"width:0px;height:0px;margin:0 auto;overflow:hidden;${custom_css}\\"></div><script type=\\"text/javascript\\">    (function () {        var zoneid = 1385748,            height = 600,            width = 300,            criteoEl = document.getElementById(\\"criteoTPL\\"),            domReady = \\"${criteo_dom_ready}\\",            mutationTimeout = 5000,            mutationConf = {attributes: true, childList: true, subtree: true};        var insertCriteoBanner = function () {            criteoEl.id += Math.floor(Math.random() * 1000000);            var observer = new MutationObserver(function (mutations) {                mutations.forEach(function () {                    criteoEl.style.width = width + \\"px\\";                    criteoEl.style.height = height + \\"px\\";                    criteoEl.style.marginTop = \\"10px\\";                    criteoEl.style.marginBottom = \\"10px\\";                    observer.disconnect();                });            });            observer.observe(criteoEl, mutationConf);            setTimeout(function(){ observer.disconnect(); }, mutationTimeout);            Criteo.events.push(function () {                Criteo.DisplayAcceptableAdIfAdblocked({                    \\"zoneid\\": zoneid,                    \\"containerid\\": criteoEl.id,                    \\"overrideZoneFloor\\": true                });            });        };        if (domReady != undefined && domReady != \'\' && domReady) {            if (typeof document.addEventListener !== \'undefined\') {                document.addEventListener(\\"DOMContentLoaded\\", insertCriteoBanner);            } else {                window.attachEvent(\\"onload\\", insertCriteoBanner);            }        } else {            insertCriteoBanner();        }    })();</script>\"}]';
  this.positions_weighted['right010'] = false;
  
  this.positions['right020'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum a8a263be\\" data-adsv-name=\\"\\"></div><script>var insertedElement = document.getElementById(\'ctstemp\');var zoneForDevice = \'\';var dataAdsvName = \'\';if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {    switch (_ceDeviceDetect.getDeviceType()) {        case \'desktop\':            zoneForDevice = \'1896823\';            dataAdsvName = \'${adverticum_name}\';            break;        case \'mobile\':            zoneForDevice = \'2905894\';            dataAdsvName = \'${adverticum_name_mobile}\';            break;        case \'tablet\':            zoneForDevice = \'${adv_zone_id_for_tablet}\';            dataAdsvName = \'${adverticum_name_tablet}\';            if(dataAdsvName == \\"\\"){                dataAdsvName = \'${adverticum_name}\';            }            break;    }}if (zoneForDevice == \'\') {    insertedElement.parentNode.removeChild(insertedElement);} else {    insertedElement.setAttribute(\'data-adsv-name\', dataAdsvName);    insertedElement.id = \'zone\' + zoneForDevice;}</script>\"}]';
  this.positions_weighted['right020'] = false;
  
  this.positions['right030'] = '[]';
  this.positions_weighted['right030'] = false;
  
  this.positions['right040'] = '[]';
  this.positions_weighted['right040'] = false;
  
  this.positions['content-bottom'] = '[{\"service_name\": \"Google Adverts\", \"weight\": null, \"source\": \"<div id=\\"ctsGadxTemp\\" class=\\"ctsGadx\\" style=\\"font-family: sans-serif;display:table;margin:0 auto;\\"></div><script type=\\"text/javascript\\">    var slotForDevice = \'\';    var gadxErr = false;    var dimensionForDevice = {        width: parseInt(300),        height: parseInt(250)    };    if (typeof ADXBannerWidth !== \'undefined\') {        dimensionForDevice.width = ADXBannerWidth;    }    if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {        switch (_ceDeviceDetect.getDeviceType()) {            case \'desktop\':                slotForDevice = \'${google_adx_slot_default_for_desktop}\';                break;            case \'mobile\':                slotForDevice = \'5563433662\';                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 = \'${google_adx_slot_default_for_desktop}\';                }                break;        }    }    if ((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}\');        }        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);    }</script>\"}, {\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum\\"></div><script>    var insertedElement = document.getElementById(\'ctstemp\');    var zoneForDevice = \'\';    if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {        switch (_ceDeviceDetect.getDeviceType()) {                case \'desktop\':                    zoneForDevice = \'5415521\';                    break;                case \'mobile\':                    zoneForDevice = \'${adv_zone_id_for_mobile}\';                    break;                case \'tablet\':                    zoneForDevice = \'${adv_zone_id_for_tablet}\';                    break;        }    }    if (zoneForDevice == \'\') {\tinsertedElement.parentNode.removeChild(insertedElement);    } else {        insertedElement.id = \'zone\' + zoneForDevice;    }</script>\"}]';
  this.positions_weighted['content-bottom'] = false;
  
  this.positions['right050'] = '[]';
  this.positions_weighted['right050'] = false;
  
  this.positions['right060'] = '[]';
  this.positions_weighted['right060'] = false;
  
  this.positions['top'] = '[{\"service_name\": \"Adverticum AdServer\", \"weight\": null, \"source\": \"<div id=\\"ctstemp\\" class=\\"goAdverticum a8a263be\\" data-adsv-name=\\"\\"></div><script>var insertedElement = document.getElementById(\'ctstemp\');var zoneForDevice = \'\';var dataAdsvName = \'\';if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {    switch (_ceDeviceDetect.getDeviceType()) {        case \'desktop\':            zoneForDevice = \'${adv_zone_id_for_desktop}\';            dataAdsvName = \'${adverticum_name}\';            break;        case \'mobile\':            zoneForDevice = \'3952933\';            dataAdsvName = \'${adverticum_name_mobile}\';            break;        case \'tablet\':            zoneForDevice = \'${adv_zone_id_for_tablet}\';            dataAdsvName = \'${adverticum_name_tablet}\';            if(dataAdsvName == \\"\\"){                dataAdsvName = \'${adverticum_name}\';            }            break;    }}if (zoneForDevice == \'\') {    insertedElement.parentNode.removeChild(insertedElement);} else {    insertedElement.setAttribute(\'data-adsv-name\', dataAdsvName);    insertedElement.id = \'zone\' + zoneForDevice;}</script>\"}]';
  this.positions_weighted['top'] = false;
  
  this.positions['left010'] = '[{\"service_name\": \"Rubicon\", \"weight\": null, \"source\": \"<div id=\\"RubiconAdTemp\\" class=\\"rubAd\\" style=\\"width: 100%;text-align: center;${custom_css}\\"><script language=\\"JavaScript\\" type=\\"text/javascript\\">        var rubiconZoneSize = \'\';        var rubiconSite = \'65902\';        var rubiconSiteMobile = \'81602\';        var rubiconAdType = \'${rubicon_ad_type}\';        var tplElement = document.getElementById(\\"RubiconAdTemp\\");        var advParts = {};        var insertedGoogle = false;        if(rubiconAdType == \'\'){            rubiconAdType = \'js\';        }        if (typeof _ceDeviceDetect.getDeviceType() !== \'undefined\') {            switch (_ceDeviceDetect.getDeviceType()) {                case \'desktop\':                    rubiconZoneSize = \'1210720-10\';                    break;                case \'mobile\':                    rubiconZoneSize = \'${rubicon_ad_zone_mobile}\';                    rubiconZoneSize = rubiconZoneSize.split(\'-\')[0]+\'-15\';                    break;                case \'tablet\':                    rubiconZoneSize = \'${rubicon_ad_zone_tablet}\';                    if(rubiconZoneSize == \'\'){                        rubiconZoneSize = \'1210720-10\';                    }                    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){                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\');                tplElement.appendChild(advParts.initScript);                tplElement.appendChild(advParts.body);                (adsbygoogle = window.adsbygoogle || []).push({});                tplElement.removeAttribute(\'id\');            }        }        if(!insertedGoogle){            if ((typeof noRUBICON == \'undefined\' || noRUBICON === false) && rubiconZoneSize.split(\'-\')[0] != \'\') {                rp_account   = \'13818\';                rp_site      = rubiconSite;                rp_zonesize  = rubiconZoneSize;                rp_adtype    = rubiconAdType;                tplElement.removeAttribute(\'id\');            }else{                tplElement.remove();            }        }    </script><script type=\\"text/javascript\\" src=\\"//ads.rubiconproject.com/ad/13818.js\\"></script></div>\"}, {\"service_name\": \"Criteo\", \"weight\": null, \"source\": \"<div id=\\"criteoTPL\\"     style=\\"width:0px;height:0px;margin:0 auto;overflow:hidden;${custom_css}\\"></div><script type=\\"text/javascript\\">    (function () {        var zoneid = 1385748,            height = 600,            width = 300,            criteoEl = document.getElementById(\\"criteoTPL\\"),            domReady = \\"${criteo_dom_ready}\\",            mutationTimeout = 5000,            mutationConf = {attributes: true, childList: true, subtree: true};        var insertCriteoBanner = function () {            criteoEl.id += Math.floor(Math.random() * 1000000);            var observer = new MutationObserver(function (mutations) {                mutations.forEach(function () {                    criteoEl.style.width = width + \\"px\\";                    criteoEl.style.height = height + \\"px\\";                    criteoEl.style.marginTop = \\"10px\\";                    criteoEl.style.marginBottom = \\"10px\\";                    observer.disconnect();                });            });            observer.observe(criteoEl, mutationConf);            setTimeout(function(){ observer.disconnect(); }, mutationTimeout);            Criteo.events.push(function () {                Criteo.DisplayAcceptableAdIfAdblocked({                    \\"zoneid\\": zoneid,                    \\"containerid\\": criteoEl.id,                    \\"overrideZoneFloor\\": true                });            });        };        if (domReady != undefined && domReady != \'\' && domReady) {            if (typeof document.addEventListener !== \'undefined\') {                document.addEventListener(\\"DOMContentLoaded\\", insertCriteoBanner);            } else {                window.attachEvent(\\"onload\\", insertCriteoBanner);            }        } else {            insertCriteoBanner();        }    })();</script>\"}]';
  this.positions_weighted['left010'] = 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;
}



