function loadOpenXAds(zoneid) {
 // OLD function...remove!
 document.MAX_ct0 ='{clickurl}';
 var m3_u = (location.protocol=='https:'?'https://d1.openx.org/ajs.php':'http://d1.openx.org/ajs.php');
 var m3_r = Math.floor(Math.random()*99999999999);
 if (!document.MAX_used) document.MAX_used = ',';
 document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
 document.write ("?zoneid=" + zoneid);
 document.write ('&amp;cb=' + m3_r);
 if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
 document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
 document.write ("&amp;loc=" + escape(window.location));
 if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
 if (document.context) document.write ("&context=" + escape(document.context));
 if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {
  document.write ("&amp;ct0=" + escape(document.MAX_ct0));
  }
 if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
 document.write ("'><\/scr"+"ipt>");
 }

document.getElementsByClassName = function(cl) {
 var retnode = [];
 var myclass = new RegExp('\\b'+cl+'\\b');
 var elem = this.getElementsByTagName('*');
 for (var i = 0; i < elem.length; i++) {
  var classes = elem[i].className;
  if (myclass.test(classes)) retnode.push(elem[i]);
  }
 return retnode;
 }

// New and improved function =)

function OpenX_ads_load() {
 // Find out which elements have the class "OpenX".  These are our zones.
 var zones = document.getElementsByClassName('OpenX');
 for (z = 0; z < zones.length; z++) {
  // Loop through each of these zones and find the Zone ID which is the first number in the className.
  var zoneid = zones[z].className.match(/\d+/);
  // iFrames seem to be the only way I can display OpenX ads after the page is loaded.
  var random = Math.floor(Math.random()*99999999999);
  zones[z].innerHTML = "<iframe src='http://d1.openx.org/afr.php?zoneid=" + zoneid + "&amp;cb=" + random + "' framespacing='0' frameborder='no' scrolling='no' width='" + zones[z].offsetWidth + "' height='" + zones[z].offsetHeight + "'></iframe>";
  }
 }

window.onload = OpenX_ads_load;