[] isIE8 = true; Date.now = Date.now || function() { return +new Date; }; ” }; socast_page.url = window.location; var adMacros = socast_page; var Page = socast_page; var gvars = { cdnStatic : ” }; var CDN_HOST_MEDIA = ‘https://media.socastsrm.com’; var isMobileUserAgent = false; var communityUserName = null; var communityUserIcon = null; var V3_RECAPTCHA_SITE_KEY = ‘6LchdXMgAAAAAP4dU47UWMAhU0Tc8Uf0ldZrstqZ’; ]]> -1 || Page.categories.indexOf(“Community”) > -1) { pagetype = ‘community’; } else if (Page.categories.indexOf(“Sports”) > -1) { pagetype = ‘sports’; } else if (Page.categories.toString().indexOf(‘NDTR’) > -1) { pagetype = ‘indigenous’; $(function() { $(‘.sc-sidebar’).css(‘display’, ‘none’); }); } else if (Page.categories.indexOf(“Weather”) > -1) { pagetype = ‘weather’; } else if (Page.categories.indexOf(“Smile Sundays”) > -1) { pagetype = ‘smilesundays’; } else if (Page.categories.indexOf(“Pro Tips”) > -1) { pagetype = ‘protips’; } else if (Page.categories.indexOf(“Municipal Election”) > -1) { pagetype = ‘municipalelection’; } else if (Page.categories.indexOf(“CHAT News Live Stream”) > -1) { pagetype = ‘livestream’; } else if (Page.categories.indexOf(“Holiday Lights Map”) > -1) { pagetype = ‘holidaylightsmap’; } else if (Page.categories.indexOf(“IG Finance Report”) > -1) { pagetype = ‘finance’; } else if (Page.categories.indexOf(“5 Things Friday”) > -1) { pagetype = ‘5thingsfriday’; } else if (Page.categories.indexOf(“Prairie Christmas”) > -1) { pagetype = ‘prairiechristmas’; } else { pagetype = ‘news’; } } } function get_classifieds_pagetype() { if ($(‘.cat-obituaries’)[0]) { pagetype = ‘obituaries’; } else if ($(‘.cat-real-estate’)[0] || $(‘.cat-open-house’)[0] || $(‘.cat-real-estate-report’)[0]) { pagetype = ‘realestate’; } else if ($(‘.cat-automall’)[0]) { pagetype = ‘automall’; } else if ($(‘.cat-seniors-week-2021’)[0]) { pagetype = ‘seniors’; } else if ($(‘.cat-municipal-election-2021’)[0]) { pagetype = ‘municipalelection’; } else { pagetype = ‘community’; } return pagetype; } var place = 0; var pid = getRandomInt(0, 999999); function classifieds_sidebar_ad(slot_id) { pagetype = get_classifieds_pagetype(); var show_ros = true; if (typeof(page_adtypes[pagetype]) != ‘undefined’) { if (typeof(page_adtypes[pagetype][‘sidebar’]) != ‘undefined’) { show_ros = false; } } if (show_ros == true) { get_ad(‘ros_bigbox’, slot_id); } else { get_ad(‘sidebar’, slot_id); } } function get_ad(adtype, adslot, bookend_slot, placement_id) { if (adtype in ros_adtypes) { adtag = ros_adtypes[adtype]; } else { adtag = page_adtypes[pagetype][adtype]; } // Use Adbutler HBR request to get more info adtag = adtag.replace(‘json’, ‘hbr’); if (placement_id !== undefined) { adtag = adtag.replace(‘type=hbr;’, ‘type=hbr;placements=’ + placement_id + ‘;’); } // Cache bust to make sure ads are unique adtag = adtag.replace(‘click=’, ‘cb=’ + +new Date() + ‘;click=’); $.getJSON( adtag, function( json ) { if (typeof(json.ad_code) === ‘undefined’) { var html = ”; } else { var html = json.ad_code; } if (adtype === ‘fullwidth’ || html.indexOf(‘iframe’) !== -1) { html = html.replace(/width=”(d+)”/, ‘width=”100%”‘); html = html.replace(/height=”(d+)”/, ‘height=”100%”‘); } if (adtype === ‘midcontent’ && html.indexOf(‘img’) !== -1) { html = html.replace(/width=”(d+)”/, ”); } // Code to handle in-app ads, which need 2 additional query params if (adtype === ‘testad’) { html = html.replaceAll(‘servedbyadbutler.com%2Fredirect.spark%3F’, ‘servedbyadbutler.com%2Fredirect.spark%3Frad_cta_target_top=1%26socast_link_external=1%26’); } placement_id = json.placement_id; $(‘#’ + adslot).html(html); }).done(function (data) { $(function() { if (bookend_slot !== undefined) { if (bookend_slot.length > 1) { get_ad(‘fullwidth’, bookend_slot, ”, placement_id); } } }); }); } function showAd(adtype, bookend_slot) { unique_id = adtype + ‘-‘ + generateUID(); document.write(”); get_ad(adtype, unique_id, bookend_slot); } ]]> 0 && ‘alberta’ != ‘null’) { window.dataLayer = window.dataLayer || []; console.log(‘Sending Categories to Google Analytics’); var categoryName = ‘alberta’.split(‘,’); for (var i = 0; i ‘; }); } ]]>
-1 || getCookie(‘platform’) == ‘app’) { showAd(‘fullwidth’, ‘fullwidth-ad-bottom-app’); } ]]>
{ }); }); ]]> 0) { get_ad(bumperads, ‘bumper-slot-1’); } if ($(‘#bumper-slot-2’).length > 0) { get_ad(bumperads, ‘bumper-slot-2’); } if ($(‘#bumper-slot-3’).length > 0) { get_ad(bumperads, ‘bumper-slot-3’); } } ]]>
Source