var googletag     = googletag || {};
    googletag.cmd = googletag.cmd || [];

var PB        = PB || {};
    PB.gptAds = PB.gptAds || {};
    PB.PBJS   = PB.PBJS || {};

var footer = "<!-- Begin comScore Tag --><script>var _comscore = _comscore || [];_comscore.push({ c1: \"2\", c2: \"6036161\" });(function() {var s = document.createElement(\"script\"), el = document.getElementsByTagName(\"script\")[0]; s.async = true;s.src = (document.location.protocol == \"https:\" ? \"https:\/\/sb\" : \"http:\/\/b\") + \".scorecardresearch.com\/beacon.js\";el.parentNode.insertBefore(s, el);})();<\/script><noscript><img src=\"http:\/\/b.scorecardresearch.com\/p?c1=2&c2=6036161&cv=2.0&cj=1\" \/><\/noscript><!-- End comScore Tag -->";

/*
  ====================================================================================
  Init: before DOM is loaded
  ====================================================================================
*/
(function(callable, hasPrebid) {

    // Load GPT library
    (function(){
        var gads = document.createElement('script');
        gads.async = true;
        gads.type = 'text/javascript';
        var useSSL = 'https:' == document.location.protocol;
        gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js';
        var node = document.getElementsByTagName('script')[0];
        node.parentNode.insertBefore(gads, node);
    })();

    // Disable initial load
    
    // Define Ad slots
                                                (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: Home Billboard+ 728x90,970x90*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/home', [[970, 90],[728, 90]], 'home_3605').addService(googletag.pubads()).setTargeting("pos", "a").setTargeting("site", "th/wineintro").setTargeting("sect", "home");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-3605');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['home_3605'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: Home btf 728x90*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/home', [[728, 90]], 'home_3611').addService(googletag.pubads()).setTargeting("pos", "b").setTargeting("site", "th/wineintro").setTargeting("sect", "home");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-3611');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['home_3611'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: Home 300x600,300x250*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/home', [[300, 600],[300, 250]], 'home_3597').addService(googletag.pubads()).setTargeting("pos", "a").setTargeting("site", "th/wineintro").setTargeting("sect", "home");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-3597');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['home_3597'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: Home BTF1 300x250*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/home', [[300, 250]], 'home_28877').addService(googletag.pubads()).setTargeting("pos", "b").setTargeting("site", "th/wineintro").setTargeting("sect", "home");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-28877');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['home_28877'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: Home 160x600*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/home', [[160, 600]], 'home_3607').addService(googletag.pubads()).setTargeting("pos", "b").setTargeting("site", "th/wineintro").setTargeting("sect", "home");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-3607');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['home_3607'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: HOME btf 160x600*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/home', [[160, 600]], 'home_3633').addService(googletag.pubads()).setTargeting("pos", "c").setTargeting("site", "th/wineintro").setTargeting("sect", "home");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-3633');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['home_3633'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
                googletag.cmd.push(function() {
                    /*Initialization for home out of page slot*/
                                        adSlot = googletag.defineOutOfPageSlot('/4403/th/wineintro/home', 'home_adoop').addService(googletag.pubads()).setTargeting("site", "th/wineintro").setTargeting("sect", "home");
                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-3595');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['home_adoop'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
                });
        })();
                                                                        (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: Billboard+ 728x90,970x90*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/ros', [[970, 90],[728, 90]], 'ros_3615').addService(googletag.pubads()).setTargeting("pos", "a").setTargeting("site", "th/wineintro").setTargeting("sect", "ros");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-3615');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['ros_3615'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: ROS btf 728x90*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/ros', [[728, 90]], 'ros_3627').addService(googletag.pubads()).setTargeting("pos", "b").setTargeting("site", "th/wineintro").setTargeting("sect", "ros");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-3627');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['ros_3627'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: ROS 300x250*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/ros', [[300, 250]], 'ros_3617').addService(googletag.pubads()).setTargeting("pos", "a").setTargeting("site", "th/wineintro").setTargeting("sect", "ros");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-3617');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['ros_3617'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: ROS btf 300x250*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/ros', [[300, 250]], 'ros_3619').addService(googletag.pubads()).setTargeting("pos", "b").setTargeting("site", "th/wineintro").setTargeting("sect", "ros");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-3619');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['ros_3619'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: ROS 160X600*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/ros', [[160, 600]], 'ros_3621').addService(googletag.pubads()).setTargeting("pos", "b").setTargeting("site", "th/wineintro").setTargeting("sect", "ros");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-3621');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['ros_3621'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: ROS btf 160x600*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/ros', [[160, 600]], 'ros_3631').addService(googletag.pubads()).setTargeting("pos", "c").setTargeting("site", "th/wineintro").setTargeting("sect", "ros");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-3631');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['ros_3631'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
                googletag.cmd.push(function() {
                    /*Initialization for ros out of page slot*/
                                        adSlot = googletag.defineOutOfPageSlot('/4403/th/wineintro/ros', 'ros_adoop').addService(googletag.pubads()).setTargeting("site", "th/wineintro").setTargeting("sect", "ros");
                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-3613');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['ros_adoop'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
                });
        })();
                                                                        (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: Forum ATF 728x90*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/forum', [[970, 90],[728, 90]], 'forum_31993').addService(googletag.pubads()).setTargeting("pos", "a").setTargeting("site", "th/wineintro").setTargeting("sect", "forum");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-31993');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['forum_31993'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: Forum BTF 728x90*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/forum', [[970, 90],[728, 90]], 'forum_31999').addService(googletag.pubads()).setTargeting("pos", "b").setTargeting("site", "th/wineintro").setTargeting("sect", "forum");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-31999');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['forum_31999'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: Forum ATF 728x90*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/forum', [[728, 90]], 'forum_31991').addService(googletag.pubads()).setTargeting("pos", "a").setTargeting("site", "th/wineintro").setTargeting("sect", "forum");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-31991');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['forum_31991'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: Forum Right 160x600*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/forum', [[160, 600]], 'forum_32005').addService(googletag.pubads()).setTargeting("pos", "b").setTargeting("site", "th/wineintro").setTargeting("sect", "forum");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-32005');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['forum_32005'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: Forum Left 160x600*/
                                        adSlot = googletag.defineSlot('/4403/th/wineintro/forum', [[160, 600]], 'forum_32011').addService(googletag.pubads()).setTargeting("pos", "c").setTargeting("site", "th/wineintro").setTargeting("sect", "forum");

                    scriptObj = document.getElementById('evolveUniversal');
                    if (scriptObj) {
                        var customTargets = Array.prototype.filter.call(scriptObj.attributes, function(at) { return /^data-targeting-/.test(at.name); });
                        for (i = 0; i < customTargets.length; i++) {
                            adSlot.setTargeting(customTargets[i].name.substr("data-targeting-".length), customTargets[i].value);
                        }

                        var sizemap = scriptObj.attributes.getNamedItem('data-sizemap-32011');
                        if (sizemap) {
                            var mapping = googletag.sizeMapping();
                            var sizemaps = sizemap.value.split('|')
                            for (i = 0; i < sizemaps.length; i++) {
                                eval("mapping.addSize(" + sizemaps[i] + ");");
                            }
                            mapping = mapping.build();
                            adSlot.defineSizeMapping(mapping);
                        }
                    }

                    PB.gptAds['forum_32011'] = adSlot;

                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                        
    // DOM preload function
    (function checkDOMStatus(callable, hasPrebid){
        if (hasPrebid()) {
            if (PB.PBJS.Done && document.readyState == 'complete') {
                callable.call();
            } else {
                setTimeout(function() {
                    checkDOMStatus(callable, hasPrebid);
                }, 100);
            }
        } else {
            if (document.readyState == 'complete') {
                callable.call();
            } else {
                setTimeout(function() {
                    checkDOMStatus(callable, hasPrebid);
                }, 100);
            }
        }
    })(callable, hasPrebid);


    /*
      ====================================================================================
      Trigger: after DOM is loaded
      ====================================================================================
    */
    })(function() {
        // Load Ad slots
        var adsPresent = [];
        for (key in PB.gptAds) {
            if (document.getElementById(key)) {
                // this line is needed for the refresh method to work correctly
                googletag.cmd.push(function() { googletag.display(key); });
                adsPresent.push(PB.gptAds[key]);
            }
        };

        // loading the ads in one single request
        googletag.pubads().refresh(adsPresent);
        evolveFooter = document.getElementById('evolve_footer');
        if (evolveFooter) {
            evolveFooter.innerHTML = footer;
            evolveFooterScripts = evolveFooter.getElementsByTagName('script');
            for (i = 0; i < evolveFooterScripts.length; i++) {
                eval(evolveFooterScripts[i].innerHTML);
            }
        }

        // all set
        PB.PBJS.AdsRequested = true;
    }, function() {
        if (typeof PB.PBJS === 'object' && typeof PB.PBJS.Done === 'boolean') {
            return true;
        }

        return false;
    });

