﻿function getElementsByClass(searchClass, node, tag){
    var classElements = new Array();
    if ( node == null ) node = document;
    if ( tag == null ) tag = '*';
    var els = node.getElementsByTagName(tag);
    var elsLen = els.length;
    var pattern = new RegExp('(^|\\\\s)'+searchClass+'(\\\\s|$)');
    for(i = 0, j = 0; i < elsLen; i++){
        if( pattern.test(els[i].className ) ) {
            classElements[j] = els[i];
            j++;
        }
    }
    return classElements;
}

ulhover = function() {
    var ulRoots = getElementsByClass("(ulhnavdrop|ulvnavdrop)", document, null);
    var ulNavs = null;
    for ( j = 0; j < ulRoots.length; j++ ) {
	    ulNavs = ulRoots[j].getElementsByTagName("LI");
	    for ( i = 0; i < ulNavs.length; i++) {
		    ulNavs[i].onmouseover=function() {
			    this.className += " ulhover";
		    }
		    ulNavs[i].onmouseout=function() {
			    this.className = this.className.replace(new RegExp(" ulhover\\b"), "");
		    }
	    }
	}
}

if (window.attachEvent) window.attachEvent("onload", ulhover);

