function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

/* custom function - */
/* needs to be improved as it merely looks for the specified text inside a class attribute so part names are picked up... */
document.getElementsByClassName = function(name) {
  var results = new Array();
  var elems = document.getElementsByTagName("*");
  for (var i=0; i<elems.length; i++) {
    if (elems[i].className.indexOf(name) != -1) {
      results[results.length] = elems[i];
    }
  }
  return results;
};

// add onload scripts here to be executed when page loads
addLoadEvent(setUpTabClickEvents);
addLoadEvent(setUpSubscribeFormFieldEvents);
addLoadEvent(setUpSearchHelpButtons);
addLoadEvent(hideShow);
addLoadEvent(setUpClickEventForResultsRadio);
addLoadEvent(addSubscribeNowClickEvent);
addLoadEvent(addMoreInfoClickEvent);
addLoadEvent(addArticleToolbarClickEvents);
addLoadEvent(pollResultsBars);
addLoadEvent(seePollResults);
