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

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) {
 
    // 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: Leaderboard combo*/
                                        PB.gptAds['ros_2261'] = googletag.defineSlot('/4403/th/imperfectparent/ros', [[970, 90],[728, 90]], 'ros_2261').addService(googletag.pubads()).setTargeting("pos", "a").setTargeting("sect", "ros").setTargeting("dc_ref", "'+encodeURIComponent(location.href)+'");
                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: Mobile combo*/
                                        PB.gptAds['ros_4133'] = googletag.defineSlot('/4403/th/imperfectparent/ros', [[320, 150],[320, 100],[320, 50]], 'ros_4133').addService(googletag.pubads()).setTargeting("pos", "a").setTargeting("sect", "ros").setTargeting("dc_ref", "'+encodeURIComponent(location.href)+'");
                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: Mrec combo*/
                                        PB.gptAds['ros_2263'] = googletag.defineSlot('/4403/th/imperfectparent/ros', [[300, 600],[300, 250]], 'ros_2263').addService(googletag.pubads()).setTargeting("pos", "a").setTargeting("sect", "ros").setTargeting("dc_ref", "'+encodeURIComponent(location.href)+'");
                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
            googletag.cmd.push(function() {
                /*Initialization for slot: Skyscraper*/
                                        PB.gptAds['ros_2265'] = googletag.defineSlot('/4403/th/imperfectparent/ros', [[160, 600]], 'ros_2265').addService(googletag.pubads()).setTargeting("pos", "b").setTargeting("sect", "ros").setTargeting("dc_ref", "'+encodeURIComponent(location.href)+'");
                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
            });
        })();
                                                    (function(){
                googletag.cmd.push(function() {
                    /*Initialization for ros out of page slot*/ 
                                        PB.gptAds['ros_adoop'] = googletag.defineOutOfPageSlot('/4403/th/imperfectparent/ros', 'ros_adoop').addService(googletag.pubads()).setTargeting("sect", "ros").setTargeting("kw", "").setTargeting("ct", "").setTargeting("ci", "");
                    googletag.pubads().setTargeting("dc_ref", "'+encodeURIComponent(location.href)+'");
                    googletag.pubads().enableSingleRequest();
                    googletag.pubads().disableInitialLoad();
                    googletag.pubads().collapseEmptyDivs(true);
                    googletag.enableServices();
                });
        })();
                                         
 
 
 
    // DOM preload function
    (function checkDOMStatus(callable){
        if (document.readyState=='complete')
            callable.call();
        else
            setTimeout(function(){checkDOMStatus(callable)}, 100);
    })(callable);
 
 
    /*
      ====================================================================================
      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;
        }
    });

