/************************************************
 * **Auto-magical click-deployed dropdown menu**
 * Use in conjunction with menu.css
 * Just add class of "expMenu" to any UL you want to make a dropdown, and voila!
 */

function getElementByClass(tag, classname){
    var rootobj = document.getElementsByTagName(tag);
    var temparray=new Array();
    var inc=0;
    var rootlength=rootobj.length;
    for (i=0; i<rootlength; i++){
        if (rootobj[i].className.indexOf(classname) >= 0) {
            temparray[inc++]=rootobj[i];
        }
    }
    return temparray
}

sfHover = function() {
	var sfEls = getElementByClass("UL", "expMenu");
    for (i = 0; i < sfEls.length; i++) {
        sfEls[i] = sfEls[i].getElementsByTagName("LI");
    	for (var x=0; x<sfEls[i].length; x++) {
            //sfEls[i][x].className +=" sfhide";
            sfEls[i][x].onclick=function() {
                if (this.className.indexOf("sfhover") >= 0 || this.className.indexOf("sfcurrent") >= 0) {
			        this.className=this.className.replace(new RegExp(" sfhover|sfcurrent\\b"), "");
		        } else {
    			    this.className+=" sfhover";
                }
    		}
        }
	}
}
womAdd('sfHover()');

