if (typeof(adZone) == 'undefined') {
	var adZone = function(zones) {
			var mapzones = {
					"hockey": "nhl", 
					"baseball": "mlb", 
					"basketball": "nba", 
					"football": "nfl", 
					"nfl": "nfl", 
					"cfl": "cfl", 
					"mma": "mma", 
					"soccer": "soccer", 
					"golf": "golf", 
					"juniors": "chl", 
					"all_day_breakfast": "adb", 
					"video": "video", 
					"fantasy": "fantasy", 
					"tennis": "tennis", 
					"cricket": "cricket", 
					"": "homepage"
				};
			var path = window.location.pathname;
			path = path.replace("http://", "/");
			path = path.slice(path.indexOf('/'), path.lastIndexOf('/'));
			var pathArray = path.split('/');
			if (window.location.pathname == "/") {
				return "homepage";
			}
			var lastpath = "";
			var firstpath = "";
			for ( i = pathArray.length - 1; i > 0; i-- ) {
				if (pathArray[i] != "") {
					if (lastpath == "") lastpath = pathArray[i];
					if (Object.prototype.toString.call(zones) != "[object Array]") {
						if (firstpath == "" && typeof(mapzones[pathArray[i]]) != 'undefined') {
							firstpath = pathArray[i];
						}
					} else if (typeof(zones[pathArray[i]]) != 'undefined') {
						return pathArray[i] + (lastpath == pathArray[i]?'/hubpage':'');
					} else if (typeof(zones[mapzones[pathArray[i]]]) != 'undefined') {
						return "/" + mapzones[pathArray[i]] + (lastpath == pathArray[i]?'/hubpage':'');
					} else if (firstpath == "" && typeof(mapzones[pathArray[i]]) != 'undefined') {
						firstpath = pathArray[i];
					}
				}
			}
			return "/" + mapzones[firstpath] + (lastpath == firstpath || lastpath == mapzones[firstpath] && firstpath != ""?'/hubpage':'');
		};
}

var sponsorshipId = (typeof(authorFullName) != 'undefined' && typeof(keywords) != 'undefined')?(authorFullName + (authorFullName==""?"":",") + keywords).replace(/[^_\w,]/gi, "_").replace(/[_]+/gi, "_").toLowerCase():'';
window.adUtility = new RDMAdUtility({
		site: "rogers.sportsnet",
		zone: adZone(),
		doInline: true, 
		sponsorshipId: (typeof(ad_string) != 'undefined' && ad_string?ad_string+',':'') + "geo_" + dartRegion + "," + sponsorshipId,
		ajConfig: ca.sportsnet.ads.zones, 
		allowInterstitials : ((typeof(video_auto_play) != 'undefined')?video_auto_play:false),
		autoPlayingVideo: ((typeof(video_auto_play) != 'undefined')?video_auto_play:false)
	});
