sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

addEvent(window, 'load', sermonjump);
function sermonjump() {
	var sermonlists = document.getElementById('sermonLists');
	if(sermonlists) { 
		sermonlists.onchange = function() {
			if(this.selectedIndex == 1) window.location = '/mcms_page_sermonlist_sort.php?groupby=series';
			if(this.selectedIndex == 2) window.location = '/mcms_page_sermonlist_sort.php?groupby=category';
			if(this.selectedIndex == 3) window.location = '/mcms_page_sermonlist_sort.php?groupby=month';
			if(this.selectedIndex == 4) window.location = '/mcms_page_sermonlist_sort.php?groupby=preacher';
		}
	}
}

function addEvent(obj, evType, fn){
    if (obj.addEventListener) {
        obj.addEventListener(evType, fn, true);
        return true;
    } else if (obj.attachEvent) {
        var r = obj.attachEvent("on"+evType, fn);
        return r;
    } else {
	    return false;
    }
}
