// Generated 1/07/2021 8:00:58 AM (UTC) String.prototype.format = function () { var args = arguments; return this.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] != 'undefined' ? args[number] : match; }); }; var CRE = CRE || {}; CRE.isDebuggingEnabled = false; CRE.host = "www.commercialrealestate.com.au"; CRE.StatisticsAllowedDomains = ["commercialrealestate.com.au","www.commercialrealestate.com.au","domain.com.au","www.domain.com.au","afr.com","afr.com.au","www.afr.com","www.afr.com.au","afr-dev.ffxblue.com.au","fairfaxmedia.com.au","www.fairfaxmedia.com.au","smh.com.au","www.smh.com.au","watoday.com.au","www.watoday.com.au","canberratimes.com.au","www.canberratimes.com.au","brisbanetimes.com.au","www.brisbanetimes.com.au","theage.com.au","www.theage.com.au"]; CRE.eventTypes = []; CRE.logEventQueue = []; CRE.DeviceMode = { Mobile: "mobile", Medium: "medium", Desktop: "desktop" }; CRE.getScreenSize = function () { var w = window, d = document, e = d.documentElement, g=d.getElementsByTagName('body')[0], x=w.innerWidth||e.clientWidth||g.clientWidth, y=w.innerHeight||e.clientHeight||g.clientHeight; return { width: x, height: y }; }; CRE.MinMediumModeScreenWidth = 737; CRE.MinDesktopModeScreenWidth = 1201; CRE.deviceMode = function() { var size = CRE.getScreenSize(); if (size.width >= CRE.MinDesktopModeScreenWidth) { return CRE.DeviceMode.Desktop; } else if (size.width >= CRE.MinMediumModeScreenWidth) { return CRE.DeviceMode.Medium; } return CRE.DeviceMode.Mobile; }; CRE.consoleLog = function () { if (window.console && CRE.isDebuggingEnabled) { console.log.apply(console, arguments); } }; CRE.logEventXHRCall = function () { var queueLength = CRE.logEventQueue.length; let xhr = new XMLHttpRequest(); let url = CRE.host + "/statistics/addlogevent"; xhr.open('POST', url); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onerror = function () { console.error("CRE AFR Ad Widget: CRE logEventXHRCall Failed"); } xhr.onload = function () { CRE.consoleLog("%c {0} Events sent to server ".format(queueLength), "background: #222; color: #00ffff"); } let data = {Items: CRE.logEventQueue, DeviceMode: CRE.deviceMode()}; dataEncoded = encodeURI('Items[0][AdId]='+data.Items[0].AdId+'&Items[0][EventType]='+data.Items[0].EventType+'&DeviceMode='+data.DeviceMode); //Example of data to be sent: Items%5B0%5D%5BAdId%5D=2014753331&Items%5B0%5D%5BEventType%5D=2001&DeviceMode=medium xhr.send(dataEncoded); CRE.logEventQueue = []; }; CRE.logEvent = function (adId, eventName, eventCategoryName) { var eventCode = 'INVALID_EVENT_CODE'; var metadata = []; if (eventCategoryName != null){ metadata.push("AfrPageTemplateName:" + eventCategoryName); } // Get the code (number) belonging to the event name. for (i = 0; i < CRE.eventTypes.length; ++i) { if (CRE.eventTypes[i].Description == eventName){ eventCode = CRE.eventTypes[i].Value; break; } } CRE.consoleLog("%c AdID: {0} Log event: {1} ({2}) ".format(adId, eventCode, eventName), "background: #222; color: #00ffff"); // send log request only if domain in StatisticsAllowedDomains if(CRE.StatisticsAllowedDomains.indexOf(window.location.hostname) !== -1) { CRE.logEventQueue.push({ AdId: adId, EventType: eventCode, Metadata: metadata }); CRE.logEventXHRCall(); } else{ console.log("Skipping event logging. %c AdID: {0} Log event: {1} ({2}) ".format(adId, eventCode, eventName), "background: #222; color: #00ffff"); } }; (function() { var wait = function (condFunc, readyFunc, checkInterval) { var checkFunc = function () { if (condFunc()) { readyFunc(); } else { setTimeout(checkFunc, checkInterval); } }; checkFunc(); }; //Initialize widget (function() { var jsData = {"WidgetElementClassName":"cre-afr-widget","CreHttpHost":"https://www.commercialrealestate.com.au","JsScriptBundle":["/bundle/afr_widget_js_V4?v=CBvGl-d7YbgVbFvI_tl-xhpBFsf0_gDgiSFlOG7OEWQ1"],"CSS":"\r\n\r\n\u003clink rel=\"stylesheet\" href=\"https://www.commercialrealestate.com.au/Content/creicons/creicons.css\"\u003e\r\n\r\n\u003cstyle\u003e\r\n div.com__logo {\r\n margin: 0;\r\n padding: 0;\r\n height: 38px;\r\n width: 295px;\r\n border-radius: 5px 5px 0px 0px;\r\n padding: 8px 16px;\r\n margin-left: auto;\r\n margin-right: auto;\r\n }\r\n\r\n img.com__logo-image {\r\n margin: 0;\r\n padding: 0;\r\n height: 22px;\r\n width: auto;\r\n }\r\n\r\n figure.com__lead-img-container {\r\n margin: 0;\r\n padding: 0;\r\n width: 295px;\r\n height: 169px;\r\n position: relative;\r\n margin-left: auto;\r\n margin-right: auto;\r\n }\r\n\r\n figure.com__lead-img-container::before {\r\n position: absolute;\r\n content: \"\";\r\n width: 295px;\r\n height: 169px;\r\n display: block; /* FF3.6-15 */\r\n background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 1%, rgba(0,0,0,0.64) 100%); /* FF3.6-15 */\r\n background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 1%,rgba(0,0,0,0.64) 100%); /* Chrome10-25,Safari5.1-6 */\r\n background: -webkit-gradient(linear, left top, left bottom, from(rgba(0,0,0,0)),color-stop(1%, rgba(0,0,0,0)),to(rgba(0,0,0,0.64)));\r\n background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 1%,rgba(0,0,0,0.64) 100%);\r\n background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 1%,rgba(0,0,0,0.64) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */\r\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\u0027#00000000\u0027, endColorstr=\u0027#a3000000\u0027,GradientType=0 ); /* IE6-9 */\r\n z-index: 2;\r\n }\r\n\r\n img.com__lead-img {\r\n margin: 0;\r\n padding: 0;\r\n width: 295px;\r\n height: 169px;\r\n z-index: 1;\r\n }\r\n\r\n span.com__lead-price {\r\n margin: 0;\r\n padding: 0;\r\n -webkit-font-smoothing: antialiased;\r\n font-family: sans-serif, georgia;\r\n font-weight: 700;\r\n font-size: 12px;\r\n color: #FFFFFF;\r\n line-height: 16px;\r\n text-transform: uppercase;\r\n position: absolute;\r\n bottom: 16px;\r\n left: 16px;\r\n z-index: 3;\r\n max-width: 180px;\r\n }\r\n\r\n span.com__lead-status {\r\n margin: 0;\r\n padding: 0;\r\n -webkit-font-smoothing: antialiased;\r\n font-family: sans-serif, georgia;\r\n font-size: 12px;\r\n color: #FFFFFF;\r\n line-height: 16px;\r\n text-transform: uppercase;\r\n position: absolute;\r\n bottom: 16px;\r\n right: 16px;\r\n z-index: 3;\r\n }\r\n\r\n div.com__details {\r\n margin: 0;\r\n padding: 0;\r\n margin-left: auto;\r\n margin-right: auto;\r\n -webkit-font-smoothing: antialiased;\r\n font-family: sans-serif, georgia;\r\n font-weight: 700;\r\n padding: 16px;\r\n width: 295px;\r\n height: 120px;\r\n background-color: #F5F5F5;\r\n margin-bottom: 22px;\r\n position: relative;\r\n border-radius: 0px 0px 5px 5px;\r\n }\r\n\r\n div.com__details-address {\r\n margin: 0;\r\n padding: 0;\r\n font-size: 16px;\r\n font-weight: 700;\r\n color: #252525;\r\n line-height: 20px;\r\n }\r\n\r\n div.com__details-address p {\r\n margin: 0;\r\n padding: 0;\r\n font-family: sans-serif, georgia;\r\n }\r\n\r\n span.com__details-tag {\r\n margin: 0;\r\n padding: 0;\r\n -webkit-font-smoothing: antialiased;\r\n font-family: sans-serif, georgia;\r\n font-weight: 400;\r\n font-size: 12px;\r\n color: #252525;\r\n line-height: 16px;\r\n }\r\n\r\n ul.com__details-size-tag {\r\n margin: 0;\r\n padding: 0;\r\n position: absolute;\r\n bottom: 16px;\r\n left: 16px;\r\n }\r\n\r\n ul.com__details-size-tag \u003e li {\r\n font-size: .8125rem;\r\n line-height: 1.3846;\r\n padding: 0;\r\n margin-top: 8px;\r\n width: 100%;\r\n }\r\n\r\n ul.com__details-size-tag span.com__details-tag {\r\n margin: 0;\r\n padding: 0;\r\n margin-right: 8px;\r\n }\r\n\r\n div.com__details span.com__icon-afrwidget {\r\n margin: 0;\r\n padding: 0;\r\n float: left;\r\n font-size: 16px;\r\n color: #252525;\r\n margin-right: 8px;\r\n }\r\n\r\n ul#widget-container {\r\n margin: 0;\r\n padding: 0;\r\n display: -webkit-box;\r\n display: -ms-flexbox;\r\n display: flex;\r\n -ms-flex-wrap: wrap;\r\n flex-wrap: wrap;\r\n -webkit-box-align: center;\r\n -ms-flex-align: center;\r\n align-items: center;\r\n -webkit-box-pack: center;\r\n -ms-flex-pack: center;\r\n justify-content: center;\r\n }\r\n\r\n ul#widget-container * {\r\n -webkit-box-sizing: border-box;\r\n box-sizing: border-box;\r\n }\r\n\r\n ul#widget-container, ul.com__details-size-tag \u003e li {\r\n list-style: none;\r\n }\r\n\r\n article.cre-afr-widget \u003e a {\r\n margin: 0;\r\n padding: 0;\r\n text-decoration: none;\r\n }\r\n\r\n div.com__details-address \u003e p {\r\n margin: 0;\r\n padding: 0;\r\n margin-bottom: .75em;\r\n }\r\n\r\n figure.com__lead-img-container \u003e img {\r\n margin: 0;\r\n padding: 0;\r\n display: block;\r\n }\r\n\r\n ul#widget-container .creicon:before {\r\n display: inline-block;\r\n font-family: \"creicons\" !important;\r\n speak: none;\r\n font-style: normal;\r\n font-weight: normal;\r\n font-variant: normal;\r\n text-transform: none;\r\n line-height: 1;\r\n -webkit-font-smoothing: antialiased;\r\n -moz-osx-font-smoothing: grayscale;\r\n }\r\n\r\n @media only screen and (max-width:599px), only screen and (min-width:1025px) {\r\n div.com__logo, div.com__details {\r\n width: 100%;\r\n }\r\n\r\n figure.com__lead-img-container, img.com__lead-img, figure.com__lead-img-container::before {\r\n width: 100%;\r\n height: 100%;\r\n }\r\n\r\n ul#widget-container {\r\n display: block;\r\n }\r\n }\r\n\u003c/style\u003e","Contents":"[{\"Contents\":\"\\r\\n\\r\\n\\u003ca href=\\\"https://www.commercialrealestate.com.au/property/lots-1-and-2-6-bridge-street-sydney-nsw-2000-2016976537\\\" target=\\\"_blank\\\" data-adid=\\\"2016976537\\\"\\u003e\\r\\n \\u003cdiv class=\\\"com__logo\\\" style=\\\"background-color: #25408F\\\" title=\\\"Colliers International - Sydney\\\"\\u003e\\r\\n \\u003cimg class=\\\"com__logo-image\\\" src=\\\"https://res-2.cloudinary.com/cre/image/fetch/w_100,h_35,c_fit,f_auto,q_auto/https%3a%2f%2fimages.domain.com.au%2fimg%2fAgencys%2f20529%2flogo_cre_20529_v3.GIF%3fdate%3d2021-02-03-16-07-57\\\" alt=\\\"Colliers International - Sydney\\\"\\u003e\\r\\n\\r\\n \\u003c/div\\u003e\\r\\n \\r\\n\\r\\n \\u003cfigure class=\\\"com__lead-img-container\\\"\\u003e\\r\\n \\u003cimg src=\\\"https://res-3.cloudinary.com/cre/image/fetch/w_300,h_183,c_fill,f_auto,d_placeholder_viubzx.png,q_auto/https%3a%2f%2fcre.domainstatic.com.au%2f2016976537_1_1_210503_010006-w1600-h1067-w800-h600\\\" class=\\\"com__lead-img\\\"\\u003e\\r\\n\\r\\n \\u003cspan class=\\\"com__lead-price\\\"\\u003e\\r\\n Please contact agent\\r\\n \\u003c/span\\u003e\\r\\n\\r\\n \\u003cspan class=\\\"com__lead-status\\\"\\u003e\\r\\n For Sale\\r\\n \\u003c/span\\u003e\\r\\n \\u003c/figure\\u003e\\r\\n \\u003cdiv class=\\\"com__details\\\"\\u003e\\r\\n \\u003cdiv class=\\\"com__details-address\\\"\\u003e\\r\\n \\u003cp title=\\\"Lots 1 and 2, 6 Bridge Street SYDNEY NSW\\\"\\u003eLots 1 and 2, 6 Bridge Street SYDNEY NSW\\u003c/p\\u003e\\r\\n \\u003c/div\\u003e\\r\\n \\u003cul class=\\\"com__details-size-tag\\\"\\u003e\\r\\n \\u003cli\\u003e\\r\\n \\u003cspan class=\\\"com__icon-afrwidget creicon creicon-retail\\\"\\u003e\\u003c/span\\u003e\\r\\n \\u003cspan class=\\\"com__details-tag\\\"\\u003eRetail\\u003c/span\\u003e\\r\\n \\u003c/li\\u003e\\r\\n \\u003cli\\u003e\\r\\n \\r\\n \\u003cspan class=\\\"com__icon-afrwidget creicon creicon-area\\\"\\u003e\\u003c/span\\u003e\\r\\n \\u003cspan class=\\\"com__details-tag\\\"\\u003e355m\\u0026#178;\\u003c/span\\u003e\\r\\n \\r\\n \\u003c/li\\u003e\\r\\n \\u003c/ul\\u003e\\r\\n \\u003c/div\\u003e\\r\\n\\r\\n \\u003c!-- Listing State: NSW --\\u003e\\r\\n \\u003cinput type=\\\"hidden\\\" value=\\\"Web.CommercialRealEstate2014.Models.WidgetModels.AfrWidgetViewModelV4\\\" /\\u003e\\r\\n\\u003c/a\\u003e\"},{\"Contents\":\"\\r\\n\\r\\n\\u003ca href=\\\"https://www.commercialrealestate.com.au/property/1154-stockyard-hill-road-stockyard-hill-vic-3373-2017024519\\\" target=\\\"_blank\\\" data-adid=\\\"2017024519\\\"\\u003e\\r\\n \\u003cdiv class=\\\"com__logo\\\" style=\\\"background-color: #E40B21\\\" title=\\\"Elders Real Estate Melbourne\\\"\\u003e\\r\\n \\u003cimg class=\\\"com__logo-image\\\" src=\\\"https://res-3.cloudinary.com/cre/image/fetch/w_100,h_35,c_fit,f_auto,q_auto/https%3a%2f%2fimages.domain.com.au%2fimg%2fAgencys%2f1341%2flogo_cre_1341.GIF%3fdate%3d2020-05-15-13-03-14\\\" alt=\\\"Elders Real Estate Melbourne\\\"\\u003e\\r\\n\\r\\n \\u003c/div\\u003e\\r\\n \\r\\n\\r\\n \\u003cfigure class=\\\"com__lead-img-container\\\"\\u003e\\r\\n \\u003cimg src=\\\"https://res-3.cloudinary.com/cre/image/fetch/w_300,h_183,c_fill,f_auto,d_placeholder_viubzx.png,q_auto/https%3a%2f%2fcre.domainstatic.com.au%2f2017024519_1_1_210524_120223-w3000-h2000-w800-h600\\\" class=\\\"com__lead-img\\\"\\u003e\\r\\n\\r\\n \\u003cspan class=\\\"com__lead-price\\\"\\u003e\\r\\n by Expression of Interest\\r\\n \\u003c/span\\u003e\\r\\n\\r\\n \\u003cspan class=\\\"com__lead-status\\\"\\u003e\\r\\n For Sale\\r\\n \\u003c/span\\u003e\\r\\n \\u003c/figure\\u003e\\r\\n \\u003cdiv class=\\\"com__details\\\"\\u003e\\r\\n \\u003cdiv class=\\\"com__details-address\\\"\\u003e\\r\\n \\u003cp title=\\\"1154 Stockyard Hill Road STOCKYARD HILL VIC\\\"\\u003e1154 Stockyard Hill Road STOCKYARD HILL VIC\\u003c/p\\u003e\\r\\n \\u003c/div\\u003e\\r\\n \\u003cul class=\\\"com__details-size-tag\\\"\\u003e\\r\\n \\u003cli\\u003e\\r\\n \\u003cspan class=\\\"com__icon-afrwidget creicon creicon-rural\\\"\\u003e\\u003c/span\\u003e\\r\\n \\u003cspan class=\\\"com__details-tag\\\"\\u003eRural / Farming\\u003c/span\\u003e\\r\\n \\u003c/li\\u003e\\r\\n \\u003cli\\u003e\\r\\n \\r\\n \\u003cspan class=\\\"com__icon-afrwidget creicon creicon-area\\\"\\u003e\\u003c/span\\u003e\\r\\n \\u003cspan class=\\\"com__details-tag\\\"\\u003e1m\\u0026#178;\\u003c/span\\u003e\\r\\n \\r\\n \\u003c/li\\u003e\\r\\n \\u003c/ul\\u003e\\r\\n \\u003c/div\\u003e\\r\\n\\r\\n \\u003c!-- Listing State: VIC --\\u003e\\r\\n \\u003cinput type=\\\"hidden\\\" value=\\\"Web.CommercialRealEstate2014.Models.WidgetModels.AfrWidgetViewModelV4\\\" /\\u003e\\r\\n\\u003c/a\\u003e\"}]","BuildNumber":"2.0.7935.0","IsDebuggingEnabled":false,"EventTypes":[{"Value":0,"Description":"NumberOfViews"},{"Value":1,"Description":"NumberOfEnquiries"},{"Value":2,"Description":"NumberOfAgentDetailsViews"},{"Value":3,"Description":"NumberOfPhotoViews"},{"Value":4,"Description":"NumberOfMapViews"},{"Value":5,"Description":"NumberOfVideoViews"},{"Value":6,"Description":"NumberOfEbrochureViews"},{"Value":7,"Description":"NumberOfRevealedAgentPhone"},{"Value":8,"Description":"NumberOfEmailedToFriend"},{"Value":9,"Description":"NumberOfSharedViaSocialMedia"},{"Value":10,"Description":"SecondsSpentOnAd"},{"Value":11,"Description":"NumberOfSearchesIncludesAd"},{"Value":12,"Description":"NumberOfIndividualImageViews"},{"Value":13,"Description":"NumberOfProjectDetailViewsFromNewDevSearch"},{"Value":14,"Description":"NumberOfProjectDetailViewsFromBuySearch"},{"Value":15,"Description":"NumberOfSharedViaFacebook"},{"Value":16,"Description":"NumberOfSharedViaGooglePlus"},{"Value":17,"Description":"NumberOfSharedViaTwitter"},{"Value":18,"Description":"NumberOfExternalWebsiteViews"},{"Value":19,"Description":"NumberOfAd300x600Click"},{"Value":20,"Description":"NumberOfBrochureDownloads"},{"Value":21,"Description":"NumberOfClickLinkToProjectListing"},{"Value":22,"Description":"NumberOfFloorPlanViews"},{"Value":23,"Description":"NumberOfSearchCarouselView"},{"Value":24,"Description":"NumberOfAddedNotes"},{"Value":25,"Description":"NumberOfSavedInspectionTime"},{"Value":26,"Description":"NumberOfPrintPage"},{"Value":27,"Description":"NumberOfCompletedInspectionCheckList"},{"Value":28,"Description":"NumberOfCalledAgentFromMobile"},{"Value":29,"Description":"NumberOfCompletedRentalApp"},{"Value":30,"Description":"NumberOfViewThruCampaign"},{"Value":31,"Description":"NumberOfAddedToShortList"},{"Value":32,"Description":"NumberOfNewDevDetailViewsFromNewDevSearch"},{"Value":33,"Description":"NumberOfNewDevDetailViewsFromBuySearch"},{"Value":34,"Description":"NumberListingsHidden"},{"Value":35,"Description":"NumberOfSearchAdClicked"},{"Value":2001,"Description":"AfrWidgetView"},{"Value":2002,"Description":"AfrWidgetClick"},{"Value":2003,"Description":"BusinessDayWidgetView"},{"Value":2004,"Description":"BusinessDayWidgetClick"},{"Value":2005,"Description":"PropertyDetailPhotoView"},{"Value":2006,"Description":"PropertyTooltipOnMapShown"},{"Value":2007,"Description":"PropertyDetailVideoView"},{"Value":2008,"Description":"PropertyDetailMapEngagement"},{"Value":2009,"Description":"PropertyDetailFloorPlanView"},{"Value":2010,"Description":"PropertyDetailDownloadAttachment"},{"Value":2011,"Description":"PropertyDetailPrint"},{"Value":2012,"Description":"PropertyDetailTwitterShare"},{"Value":2013,"Description":"PropertyDetailFacebookShare"},{"Value":2014,"Description":"PropertyDetailGoogleShare"},{"Value":2015,"Description":"SearchResultPhotoView"},{"Value":2016,"Description":"PropertyVirtualTourLinkClicked"},{"Value":2017,"Description":"PlatinumToggleOn"},{"Value":2018,"Description":"PlatinumToggleOff"},{"Value":2019,"Description":"PropertyDetailSendToFriend"},{"Value":2020,"Description":"PropertyDetailPageView"},{"Value":2021,"Description":"PropertyAddedToShortlist"},{"Value":2022,"Description":"PropertyRemovedFromShortlist"},{"Value":2023,"Description":"AgencyDetailView"},{"Value":2024,"Description":"AgencyProfileClick"},{"Value":2025,"Description":"AgencySearchCriteria"},{"Value":2026,"Description":"AgencyVideoView"},{"Value":2027,"Description":"PropertyDetailsStreetViewSwitch"},{"Value":2028,"Description":"PropertyDetailCarouselSession"},{"Value":2029,"Description":"CreNewsSiteWidgetView"},{"Value":2030,"Description":"CreNewsSiteWidgetClick"},{"Value":2031,"Description":"PropertyDetailAgencyClick"},{"Value":2032,"Description":"PropertyDetailGetDirectionsClick"},{"Value":2033,"Description":"SavedAuctionTimeToCalendar"},{"Value":2034,"Description":"UpgradeListingViaAgentAdmin"},{"Value":2035,"Description":"UpgradeListingViaEmail"},{"Value":2036,"Description":"SlrViewReportClicked"},{"Value":2037,"Description":"SlrReportEmailForwardClicked"},{"Value":2038,"Description":"SlrReportEmailForwarded"},{"Value":2039,"Description":"PropertyDetailLinkedInShare"},{"Value":2040,"Description":"ProductRenewalClick"},{"Value":2041,"Description":"NewUserSessionId"},{"Value":2042,"Description":"LendiAdView"},{"Value":2043,"Description":"LendiAdClick"},{"Value":2044,"Description":"ListingSuggestedView"},{"Value":2045,"Description":"ListingSuggestedClick"},{"Value":2046,"Description":"CreNewsSiteArticleView"},{"Value":2047,"Description":"LoadedFromDomainDb"},{"Value":2048,"Description":"RedirectedToSearchResults"}],"AfrCategory":{"EventCategory":"AFRWidget","EventActions":{"ClickName":"UIEvent_click","ViewName":"UIEvent_impression"},"EventSubCategories":[{"PageTemplateName":"Realestate","PageTemplateUrl":"www.afr.com/real-estate"},{"PageTemplateName":"Transport","PageTemplateUrl":"www.afr.com/business/transport"},{"PageTemplateName":"Retail ","PageTemplateUrl":"www.afr.com/business/retail"},{"PageTemplateName":"Manufacturing","PageTemplateUrl":"www.afr.com/business/manufacturing"},{"PageTemplateName":"Construction","PageTemplateUrl":"www.afr.com/business/construction"},{"PageTemplateName":"Infrastructure","PageTemplateUrl":"www.afr.com/business/infrastructure"},{"PageTemplateName":"SmallBusiness","PageTemplateUrl":"www.afr.com/business/small-business"},{"PageTemplateName":"Energy","PageTemplateUrl":"www.afr.com/business/energy"},{"PageTemplateName":"Insurance","PageTemplateUrl":"www.afr.com/business/insurance"},{"PageTemplateName":"Agriculture","PageTemplateUrl":"www.afr.com/business/agriculture"},{"PageTemplateName":"LandMarkTabTest","PageTemplateUrl":"landmark.fairfaxmedia.com.au/landmark"}]},"IsHttps":true}; var cssElementId = jsData.WidgetElementClassName + "Css"; // add CSS to page if(!document.querySelector("#"+cssElementId)) { let body = document.getElementsByTagName("BODY")[0]; var cssElement = document.createElement('div'); cssElement.id = cssElementId; cssElement.innerHTML = jsData.CSS; body.appendChild(cssElement); } let allWidgetsContents = JSON.parse(jsData.Contents); let widgetElements = document.getElementsByClassName(jsData.WidgetElementClassName); for(let i=0; i< widgetElements.length; i++){ widgetElements[i].innerHTML = allWidgetsContents[i] ? allWidgetsContents[i].Contents : ""; } CRE.isDebuggingEnabled = jsData.IsDebuggingEnabled; CRE.host = jsData.CreHttpHost; CRE.isHttps = jsData.IsHttps; CRE.eventTypes = jsData.EventTypes; CRE.afrEventCategory = jsData.AfrCategory; // load JS files from widget JS bundle var pathToJSFile = jsData.CreHttpHost + jsData.JsScriptBundle[0] + "?" + jsData.BuildNumber; let script = document.createElement('script'); script.src = pathToJSFile; script.type = 'text/javascript'; script.async = true; document.body.appendChild(script); }()); })();