function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function getElementsByClassName(theClass,d,c) {
  if(!document.hasChildNodes) return false;
   
  if(!c) var c = new Array();
  if(!d) var d = document.body;
  
  if(d.nodeType == 1 && d.className.match("^" + theClass + "$")) {
    c.push(d);
  }
  
  if(d.hasChildNodes()) {
    
    for(var i = 0; i < d.childNodes.length; i++) {
      getElementsByClassName(theClass,d.childNodes[i],c);
    }
    
    return c;
    
  } else {
    
    return c;
    
  }
}

function openTerms() {
  window.open('terms.htm', 'popup2', 'width=466,height=700,resizable=0,scrollbars=1');
}

function openHedley() {
  window.open('popup.php', 'popup3', 'width=900,height=600,resizable=0,scrollbars=0');
}

function openThanks() {
  window.open('thankyou.php', 'popup4', 'width=900,height=600,resizable=0,scrollbars=0');
}