function AdSpot(site,zone,tile,width,height) {
 var ad_serverurl = 'http://ad.doubleclick.net';
 var ad_targ = 'rogers.' + site + '/' + zone + ';';
 var ad_tile = 'tile=' + tile + ';';
 if(zone!='_default') {
  ad_int = 'dcopt=ist;'
 } else {
  ad_int = '';
 }

 //alert(navigator.userAgent.toLowerCase());

/* Basic solution to the document.write()/XHTML problem */
 if (navigator.userAgent.toLowerCase().indexOf("firefox") != -1) {
  document.write = function(str){
    var moz = !window.opera && !/Apple/.test(navigator.vendor);


    // Watch for writing out closing tags, we just
    // ignore these (as we auto-generate our own)
    if ( str.match(/^<\//) ) return;

    // Make sure & are formatted properly, but Opera
    // messes this up and just ignores it
    if ( !window.opera )
        str = str.replace(/&(?![#a-z0-9]+;)/g, "&amp;");

    // Watch for when no closing tag is provided
    // (Only does one element, quite weak)
//    str = str.replace(/<([a-z]+)(.*[^\/])>$/, "<$1$2></$1>");

	//alert(str)

    // Mozilla assumes that everything in XHTML innerHTML
    // is actually XHTML - Opera and Safari assume that it's XML
    //if ( !moz )
        //str = str.replace(/(<[a-z]+)/g, "$1 xmlns='http://www.w3.org/1999/xhtml'");

    // The HTML needs to be within a XHTML element
    //var div = document.createElementNS("http://www.w3.org/1999/xhtml","div");
    var div = document.createElement("div");
    div.innerHTML = str;
	//alert('div.innerHTML: ' + div.innerHTML);

    // Find the last element in the document
    var pos;

    // Opera and Safari treat getElementsByTagName("*") accurately
    // always including the last element on the page
    if ( !moz ) {
        pos = document.getElementsByTagName("*");
        pos = pos[pos.length - 1];

        // Mozilla does not, we have to traverse manually
    } else {
        pos = document;
        while ( pos.lastChild && pos.lastChild.nodeType == 1 )
            pos = pos.lastChild;
    }

    // Add all the nodes in that position
    var nodes = div.childNodes;
    while ( nodes.length )
        pos.parentNode.appendChild( nodes[0] );
  };
 }

if (navigator.userAgent.toLowerCase().indexOf("firefox") != -1) {
	if (tile == "1") {
		renderTile1();
	}
	else if (tile == "5") {
		renderTile5();
	}
	else if (tile == "8") {
		renderTile8();
	}
 }
 else
 {
 	document.write('<script language="javascript1.1" src="' + ad_serverurl + '/adj/' + ad_targ + ad_tile + ad_int + 'sz=' + width + 'x' + height + ';"></script>');
 }

 if ((!document.images && navigator.userAgent.indexOf('Mozilla/2.') >= 0) || navigator.userAgent.indexOf("WebTV") >= 0) {
  	//**missing ord parameter** document.write('<a href="' + ad_serverurl + '/jump/' + ad_targ + ad_tile + ad_int + 'sz=' + width + 'x' + height + ';ord=' + ord + '?" target="_blank"><img src="' + ad_serverurl + '/ad/' + ad_targ + ad_tile + ad_int + 'sz=' + width + 'x' + height + ';" width="' + width + '" height="' + height + ';ord=' + ord + '?" border="0"/></a>');
  	document.write('<a href="' + ad_serverurl + '/jump/' + ad_targ + ad_tile + ad_int + 'sz=' + width + 'x' + height + ';" target="_blank"><img src="' + ad_serverurl + '/ad/' + ad_targ + ad_tile + ad_int + 'sz=' + width + 'x' + height + ';" width="' + width + '" height="' + height + ';" border="0"/></a>');
 }

}

function renderTile1() {
	document.write('<script src="http://m1.2mdn.net/879366/flashwrite_1_2.js"/><object width="728" height="90" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="FLASH_AD"><param name="movie" value="http://m1.2mdn.net/1202825/728x90_Eng_02B.swf?clickTag=http%3A//ad.doubleclick.net/click%253Bh%3Dv8/3674/3/0/%252a/n%253B181376664%253B0-0%253B0%253B24339318%253B3454-728/90%253B24497824/24515677/1%253B%253B%257Efdr%253D165096556%253B0-0%253B0%253B22958647%253B3454-728/90%253B24543616/24561469/1%253B%253B%257Esscs%253D%253fhttp%3A//www.ichotelsgroup.com/h/d/hi/1/en/c/2/content/dec/teaser/hi/1/en/lp/meetingrewards.html%20%3Fcm_mmc%3DHI-_-PCMR-_-OLA-_-mtgcnda"/><param name="quality" value="high"/><param name="bgcolor" value="#"/><param name="wmode" value="opaque"/><param name="AllowScriptAccess" value="never"/><embed width="728" height="90" src="http://m1.2mdn.net/1202825/728x90_Eng_02B.swf?clickTag=http%3A//ad.doubleclick.net/click%253Bh%3Dv8/3674/3/0/%252a/n%253B181376664%253B0-0%253B0%253B24339318%253B3454-728/90%253B24497824/24515677/1%253B%253B%257Efdr%253D165096556%253B0-0%253B0%253B22958647%253B3454-728/90%253B24543616/24561469/1%253B%253B%257Esscs%253D%253fhttp%3A//www.ichotelsgroup.com/h/d/hi/1/en/c/2/content/dec/teaser/hi/1/en/lp/meetingrewards.html%20%3Fcm_mmc%3DHI-_-PCMR-_-OLA-_-mtgcnda" quality="high" wmode="opaque" swLiveConnect="TRUE" bgcolor="#" type="application/x-shockwave-flash" AllowScriptAccess="never"/></object>');
	document.write('<noscript><a target=\"_blank\" href=\"http://ad.doubleclick.net/click%3Bh=v8/3674/3/0/%2a/n%3B181376664%3B0-0%3B0%3B24339318%3B3454-728/90%3B24497824/24515677/1%3B%3B%7Efdr%3D165096556%3B0-0%3B0%3B22958647%3B3454-728/90%3B24543616/24561469/1%3B%3B%7Esscs%3D%3fhttp://www.ichotelsgroup.com/h/d/hi/1/en/c/2/content/dec/teaser/hi/1/en/lp/meetingrewards.html ?cm_mmc=HI-_-PCMR-_-OLA-_-mtgcnda\"><img src=\"http://m1.2mdn.net/1202825/728x90engB.gif\" alt=\"\" border="0"/></a></noscript>');
	return false;
}

function renderTile5() {
	document.write('<script src="http://m1.2mdn.net/879366/flashwrite_1_2.js"/><object width="300" height="250" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="FLASH_AD"><param name="movie" value="http://m1.2mdn.net/1202825/300x250_Eng_04B.swf?clickTag=http%3A//ad.doubleclick.net/click%253Bh%3Dv8/3671/3/0/%252a/z%253B181412381%253B0-0%253B0%253B24339370%253B4307-300/250%253B24498884/24516737/1%253B%253B%257Efdr%253D188186385%253B0-0%253B0%253B22958647%253B4307-300/250%253B24877931/24895784/1%253B%253B%257Esscs%253D%253fhttp%3A//www.ichotelsgroup.com/h/d/hi/1/en/c/2/content/dec/teaser/hi/1/en/lp/meetingrewards.html%20%3Fcm_mmc%3DHI-_-PCMR-_-OLA-_-mtgcnda"/><param name="quality" value="high"/><param name="bgcolor" value="#"/><param name="wmode" value="opaque"/><param name="AllowScriptAccess" value="never"/>'+
	'<embed width="300" height="250" src="http://m1.2mdn.net/1202825/300x250_Eng_04B.swf?clickTag=http%3A//ad.doubleclick.net/click%253Bh%3Dv8/3674/3/0/%252a/n%253B181376664%253B0-0%253B0%253B24339318%253B3454-728/90%253B24497824/24515677/1%253B%253B%257Efdr%253D165096556%253B0-0%253B0%253B22958647%253B3454-728/90%253B24543616/24561469/1%253B%253B%257Esscs%253D%253fhttp%3A//www.ichotelsgroup.com/h/d/hi/1/en/c/2/content/dec/teaser/hi/1/en/lp/meetingrewards.html%20%3Fcm_mmc%3DHI-_-PCMR-_-OLA-_-mtgcnda" quality="high" wmode="opaque" swLiveConnect="TRUE" bgcolor="#" type="application/x-shockwave-flash" AllowScriptAccess="never"/></object>');
	document.write('<noscript><a target=\"_blank\" href=\"http://ad.doubleclick.net/click%3Bh=v8/3671/3/0/%2a/z%3B181412381%3B0-0%3B0%3B24339370%3B4307-300/250%3B24498884/24516737/1%3B%3B%7Efdr%3D188186385%3B0-0%3B0%3B22958647%3B4307-300/250%3B24877931/24895784/1%3B%3B%7Esscs%3D%3fhttp://www.ichotelsgroup.com/h/d/hi/1/en/c/2/content/dec/teaser/hi/1/en/lp/meetingrewards.html ?cm_mmc=HI-_-PCMR-_-OLA-_-mtgcnda\"><img src=\"http://m1.2mdn.net/1202825/300x250engB.gif\" alt=\"\" border="0"/></a></noscript>');
	return false;
}

function renderTile8() {
    document.write('<a target="_blank" href="http://ad.doubleclick.net/click;h=v8/368f/0/0/%2a/z;196771667;0-0;0;22958647;969-200/90;25498832/25516689/1;;%7Esscs=%3fhttp://www.meetingscanada.com/Incentiveworks/index.html"><img src="http://m1.2mdn.net/viewad/1663455/iw_200x90_e_mar08.jpg" alt="Click here to find out more!" border="0"/></a>');
	return false;
}