
//Get all the elements of the given classname of the given tag.
function getElementsByClassName(classname,tag) {
 if(!tag) tag = "*";
 var anchs =  document.getElementsByTagName(tag);
 var total_anchs = anchs.length;
 var regexp = new RegExp('\\b' + classname + '\\b');
 var class_items = new Array()

 for(var i=0;i<total_anchs;i++) { //Go thru all the links seaching for the class name
  var this_item = anchs[i];
  if(regexp.test(this_item.className)) {
   class_items.push(this_item);
  }
 }
 return class_items;
}

// --------------------------------------------------------------------- 

startList = function() {
  if (document.all&&document.getElementById) {
    // Get all UL in the class
    navRootArray = getElementsByClassName('primnav', 'UL');
	// alert('found ' + navRootArray.length);
    for (var h = 0; h < navRootArray.length; ++h) {
      navRoot = navRootArray[h];
      for (var i=0; i<navRoot.childNodes.length; i++) {
        node = navRoot.childNodes[i];
        if (node.nodeName=="LI") { 
          node.onmouseover=function() {
            this.className+=" over";
          }
          node.onmouseout=function() {
            this.className=this.className.replace(" over", "");
          }
        }
      }
    }
  }
}

window.onload=startList;


