function reLoadJS() {
  // put all of your onload functions in here
  activateFields();
}

function findByTags() {
  //list all of the tags in a form that you want to highlight when focussed on
  var tags = new Array("input","select","textarea");
  allTags = new Array;
  for (var i = tags.length - 1; i >= 0; i--){
    var toCollect = $A(document.getElementsByTagName(tags[i]));
    allTags = allTags.concat(toCollect);
  }
  return allTags;
}

function activateFields() {
  params = findByTags();
  for (var i = params.length - 1; i >= 0; i--) {
    if (params[i].type != "submit") {
      params[i].onfocus = function() {
        $(this).addClassName("textFocus");
      }
      params[i].onblur = function() {
        $(this).removeClassName("textFocus");
      }
    }
  }
}

// -------------------- ADD EVENT LISTENERS TO TRIGGER THE FUNCTION --------------------

// for mozilla 
if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", reLoadJS, false);
}
// for Internet Explorer (using conditional comments)

/*@cc_on @*/
/*@if (@_win32)
document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
var script = document.getElementById("__ie_onload");
script.onreadystatechange = function() {
    if (this.readyState == "complete") {
        reLoadJS(); // call the onload handler
    }
};
/*@end @*/

// for safari

if (/WebKit/i.test(navigator.userAgent)) { // sniff
    var _timer = setInterval(function() {
        if (/loaded|complete/.test(document.readyState)) {
            clearInterval(_timer);
            reLoadJS(); // call the onload handler
        }
    }, 10);
}
