// Stuff for ads
var RN = new String (Math.random());
var RNS = RN.substring (2, 11);

var protocol = document.location.href.substring(0,document.location.href.indexOf(":")+3);
var oas = protocol + "adserver.airmiles.ca/RealMedia/ads/"; 

var _version = 11;
if (navigator.userAgent.indexOf('Mozilla/3') != -1){
      _version=10;
}

function DisplayAds (position, width, height, sitepage, qs, productid) {
      var oaspage = sitepage + '/1' + RNS + '@' + position + "?" + qs + "&paid=" + productid;

      if (_version < 11) {
            document.write ('<A HREF="' + oas + 'click_nx.ads/'+ oaspage + '" TARGET="_top" ><IMG SRC="' + oas + 'adstream_nx.cgi/' + oaspage + '" BORDER="0" WIDTH="' + width + '" HEIGHT="' + height + '"></a>');
      } 
      else {
            document.write ('<SCR' + 'IPT LANGUAGE="JavaScript1.1" SRC="' + oas + 'adstream_jx.ads/' + oaspage + '">');
            document.write ('\<\!-- --\>');
            document.write ('\<\/SCR' + 'IPT\>');
            document.write ('\<\!-- --\>');
      }
}