function highlightTableRows(tableId) {
    var previousClass = null;
    var table = document.getElementById(tableId); 
    var tbody = table.getElementsByTagName("tbody")[0];
    var rows = tbody.getElementsByTagName("tr");
    // add event handlers so rows light up and are clickable
    for (i=0; i < rows.length; i++) {
        rows[i].onmouseover = function() { previousClass=this.className;this.className+=' over' };
        rows[i].onmouseout = function() { this.className=previousClass };
        rows[i].onclick = function() {
            var cell = this.getElementsByTagName("td")[0];
            if (cell.getElementsByTagName("a").length > 0) {
                var link = cell.getElementsByTagName("a")[0];
                if (link.onclick) {
                    call = link.getAttributeValue("onclick");
                    // this will not work for links with onclick handlers that return false
                    eval(call);
                } else {
                  location.href = link.getAttribute("href");
                }
                this.style.cursor="wait";
            }
        }
    }
}

// Show the document's title on the status bar
window.defaultStatus=document.title;


// use this  instead of getElementById ... as it allows different ways to obtain the 
// element, so that it will be compatible with firefox!

/**
 This function has been extended to take (an optional) parameter formName, which allows us to identify uniquely scoped variables.
 For example, with regsitration we have a country field that relates to both the search at the top of the page as well as wanting
 to capture user related information.
*/
function getRef(name, formName) {
   // alert("getRef name="+name+"formName="+formName);
     var ref = null;
     var formObject  = null;
     if (formName != null){
        formObject = document.getElementsByName(formName)[0];
        ref = eval("formObject."+name);
      //   alert("ref1 = "+ref);
        return ref;
     }

     if (ref == null){
         ref = document.getElementsByName(name)[0];
     }
    
     if (ref == null){
         ref = document.getElementById(name);
     }

     if (ref == null) {
         ref = document.all[name];
     }


    //alert("ref = "+ref);
    return ref;
}
