document.write("<div class=\"ad\"><div id=\"leader\"><div class=\"bannerContainer\">");
document.write("<div id=\"dartad0\">");
document.write("<!-- legoctl: ctl01 --><!-- NO CACHE: dartad0 -->");

function getCookies() { return ""; }

Array.prototype.unique = function ()
{
var r = new Array();
o:for(var i = 0, n = this.length; i < n; i++)
{
for(var x = 0, y = r.length; x < y; x++)
{
if(r[x]==this[i])
{
continue o;
}
}
r[r.length] = this[i];
}
return r;
}
function setSurroundCookie(value)
{
document.cookie = "surroundId=" + escape(value) + "; path=/";
}
function getCookie(cookieName)
{
var dc = document.cookie;
//load external cookies from .canada.com
var url = new Array();
url = location.href.split("/");
var domain_arr = new Array();
domain_arr = url[2].split(".");
if (domain_arr.length >= 2)
{
var current_domain = (domain_arr[domain_arr.length - 2] + "." + domain_arr[domain_arr.length - 1]);
if (current_domain != "canada.com") //load cookies from canada.com if not on canada.com
{
//load cookies
dc += ";" + getCookies(); //append to existing document cookie
}
}
var dc_array = new Array();
dc_array = dc.split("; ");
var cookie_str = ""; //this string will contain the value of the cookie name
for (x = 0; x < dc_array.length; x++) //cycles through all cookie names in cookie array, looking for all cookieName matches
{
var cookie = new Array();
var split = dc_array[x].indexOf("=");
cookie[0] = dc_array[x].substring(0,split);
if (cookie[0].indexOf(cookieName) != -1) //cookiename was found
{
cookie[1] = dc_array[x].substring(split+1,dc_array[x].length);
if (cookie[1] != "")
cookie_str += cookie[1] + ","; //concatenate cookie string with new cookie value
}
}
cookie_str = cookie_str.replace(/,,/g,","); //remove empty values
var cookie_str_array = cookie_str.split(",").unique(); //remove duplicates
cookie_str = cookie_str_array.join(",");
cookie_str = cookie_str.replace(/,/g,";"); //change commas to semicolons, was necessary b/c of values separation in cookie
return unescape(cookie_str);
}
function getAdCookie()
{
return getCookie("adcookie");
}
function getSurroundCookie()
{
var dc = document.cookie;
var prefix = "surroundId=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1)
{
begin = dc.indexOf(prefix);
if (begin != 0) return null;
}
else
{
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1) end = dc.length;
return unescape(dc.substring(begin + prefix.length, end));
}
// Setup for surround session.
var adid = ""; // used in the ad to start a surround session
var surroundTag = getSurroundCookie(); // Get surround session id from the cookie
if(surroundTag == null) // check if there was a surround session id in the cookie
{
surroundTag = "";
}
else
{
surroundTag = "srnd="+surroundTag+";"; // finish setting up the key-value for the ad tags
}
//Setup for adcookie.
var adcookieTag = getAdCookie(); // Get the ad cookie string

adcookieTag = (typeof adcookieTag !== 'undefined') ? (adcookieTag) : ('');
dartad_tile = (typeof dartad_tile !== 'undefined') ? (dartad_tile + 1) : (1);
var dartad_url = "http://ad.ca.doubleclick.net/N3081/adj/dose.ca/scripts/include;loc=theTop;loc=top;sz=468x60,728x90;dcopt=ist;kw=ron;kw=scripts;nk=ccn;pr=dose;ck=scripts;page=include;cnt=entertainment;kw=dose;tile="+dartad_tile+";"+adcookieTag+surroundTag+"ord=64285569;?"; // script ad code with adcookie, used for debug
document.write('<script language=\"JavaScript1.1\" src=\"http://ad.ca.doubleclick.net/N3081/adj/dose.ca/scripts/include;loc=theTop;loc=top;sz=468x60,728x90;dcopt=ist;kw=ron;kw=scripts;nk=ccn;pr=dose;ck=scripts;page=include;cnt=entertainment;kw=dose;tile='+dartad_tile+';'+adcookieTag+surroundTag+'ord=64285569;?\"></script>');
document.write("<noscript>");
document.write("<a target=\"_blank\" href=\"http://ad.ca.doubleclick.net/N3081/jump/dose.ca/scripts/include;loc=theTop;loc=top;sz=468x60,728x90;dcopt=ist;kw=ron;kw=scripts;nk=ccn;pr=dose;ck=scripts;page=include;cnt=entertainment;kw=dose;?\"><img align=\"TOP\" border=\"0\" vspace=\"0\" hspace=\"0\" src=\"http://ad.ca.doubleclick.net/N3081/ad/dose.ca/scripts/include;loc=theTop;loc=top;sz=468x60,728x90;dcopt=ist;kw=ron;kw=scripts;nk=ccn;pr=dose;ck=scripts;page=include;cnt=entertainment;kw=dose;?\" /></a>");
document.write("</noscript>");

if(adid != "") // check if the ad should start a surround session only if a surround session has not yet started
{
surroundTag = "srnd="+adid+";"; // setup the key-value for a surround session
setSurroundCookie(adid); // store the surround session id in a cookie.
}
document.write("</div>");
document.write("</div></div>");
document.write("</div>");
