function hideAdSlot(slotId) { var slot = document.getElementById(slotId); if(slot === null){ return; } slot.style.display = "none"; } var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; var slots_home = {}; googletag.cmd.push(function () { var width = top.innerWidth || document.documentElement.clientWidth; if (width >= 768) { slots_home['div-gpt-ad-1539613103305-0'] = googletag.defineSlot('/1003244/Leaderboard_Home_Page2', [728,90], 'div-gpt-ad-1539613103305-0').addService(googletag.pubads()); slots_home['div-gpt-ad-1368329140967-5'] = googletag.defineSlot('/1003244/MedRec_Home_Page2', [[300,250], [300,600]], 'div-gpt-ad-1368329140967-5').addService(googletag.pubads()); slots_home['div-gpt-ad-1537969626266-0'] = googletag.defineSlot('/1003244/WideSkyLeft_Home_Page', [160,600], 'div-gpt-ad-1537969626266-0').addService(googletag.pubads()); slots_home['gallery-gpt-ad-1369109490338-0'] = googletag.defineSlot('/1003244/WideskyscraperRight2', [160,600], 'gallery-gpt-ad-1369109490338-0').addService(googletag.pubads()); slots_home['div-gpt-ad-1540557322719-0'] = googletag.defineSlot('/1003244/GPT-Billboard', [[970,10], [970,250]], 'div-gpt-ad-1540557322719-0').addService(googletag.pubads()); slots_home['div-gpt-ad-1419267094495-0'] = googletag.defineSlot('/1003244/1X1Background', [1,1], 'div-gpt-ad-1419267094495-0').addService(googletag.pubads()); slots_home['div-gpt-ad-1418735985005-0'] = googletag.defineSlot('/1003244/BottomRail', [[300,250], [300,600]], 'div-gpt-ad-1418735985005-0').addService(googletag.pubads()); } else if ((width >= 300) && (width < 768)) { slots_home['div-gpt-ad-1423660047935-0'] = googletag.defineSlot('/1003244/MobileMedRecMid', [300,250], 'div-gpt-ad-1423660047935-0').addService(googletag.pubads()); slots_home['div-gpt-ad-1538017037191-0'] = googletag.defineSlot('/1003244/MobileLeaderboardTop', [320,50], 'div-gpt-ad-1538017037191-0').addService(googletag.pubads()); slots_home['div-gpt-ad-1517098912088-0'] = googletag.defineSlot('/1003244/MobileMedRec3', [300,250], 'div-gpt-ad-1517098912088-0').addService(googletag.pubads()); } googletag.companionAds().setRefreshUnfilledSlots(true); googletag.pubads().set("page_url", 'https://' + window.location.hostname); googletag.pubads().enableAsyncRendering(); googletag.pubads().collapseEmptyDivs(); googletag.enableServices(); googletag.pubads().disableInitialLoad(); }); window.onload = function() { var width = top.innerWidth || document.documentElement.clientWidth; if (width >= 768) { hideAdSlot("div-gpt-ad-1423660047935-0"); hideAdSlot("div-gpt-ad-1538017037191-0"); hideAdSlot("div-gpt-ad-1517098912088-0"); } else if ((width >= 300) && (width < 768)) { hideAdSlot("div-gpt-ad-1539613103305-0"); hideAdSlot("div-gpt-ad-1368329140967-5"); hideAdSlot("div-gpt-ad-1537969626266-0"); hideAdSlot("gallery-gpt-ad-1369109490338-0"); hideAdSlot("div-gpt-ad-1540557322719-0"); hideAdSlot("div-gpt-ad-1419267094495-0"); hideAdSlot("div-gpt-ad-1418735985005-0"); } }