$(document).ready(function(){
	$('.external').click(function(){
		window.open(this.href);
		return false;
	});
});

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
         if (document.getElementById("sermonLists")) {
            document.getElementById("sermonLists").style.visibility="hidden";
         }
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			if (document.getElementById("sermonLists")) {
            document.getElementById("sermonLists").style.visibility="visible";
			}
		}
	}
	var divs=document.getElementsByTagName("div");
   for (var i=0; i < divs.length; i++) {
      if (divs[i].className.match("sermonbox")) {
         divs[i].onmouseover=function() {
            this.className+=" sfhover";
         }
         divs[i].onmouseout=function() {
   			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
         }
      }
   }	
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function gotoSermon() {
  var x=document.getElementById("sermonLists")
  if(x.selectedIndex==0) y=1;
  if(x.selectedIndex==1) window.location="/resources/recent-sermons/sermon-series/";
  if(x.selectedIndex==2) window.location="/resources/recent-sermons/sermon-category/";
  if(x.selectedIndex==3) window.location="/resources/recent-sermons/sermon-months/";
  if(x.selectedIndex==4) window.location="/resources/recent-sermons/sermon-preachers/";
}