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";
         }
      }
   }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function showBranch(branch,button,n) {
   var objBranch = document.getElementById(branch).style;
   var objButton = document.getElementById(button);
   n++;
     for (x=1;n>x;x++) {
        var z = "link"+x;
        document.getElementById(z).className="back";
     }
     objButton.className="current";
      for (x=1;n>x;x++) {
        var z = "branch"+x;
           document.getElementById(z).style.display="none";
     }
     objBranch.display="block";
}

function gotoSermon() {
  var x=document.getElementById("sermonLists")
  if(x.selectedIndex==0) y=1;
  if(x.selectedIndex==1) window.location="/worship/podcasts-by-series/";
  if(x.selectedIndex==2) window.location="/worship/podcasts-by-category/";
  if(x.selectedIndex==3) window.location="/worship/podcasts-by-month/";
  if(x.selectedIndex==4) window.location="/worship/podcasts-by-speaker/";
}

function gotoGroupEvents() {
  var x=document.getElementById("groupList")
  if(x.selectedIndex==0) y=1;
  if(x.selectedIndex==1) window.location="/group-events/men/";
  if(x.selectedIndex==2) window.location="/group-events/womens-teaching-ministry/";
  if(x.selectedIndex==3) window.location="/group-events/young-adults/";
  if(x.selectedIndex==4) window.location="/group-events/community-groups/";
  if(x.selectedIndex==5) window.location="/group-events/cares-groups/";
  if(x.selectedIndex==6) window.location="/group-events/junior-high/";
  if(x.selectedIndex==7) window.location="/group-events/senior-high/";
  if(x.selectedIndex==8) window.location="/group-events/children/";
  if(x.selectedIndex==9) window.location="/news-and-events/";
}

function gotoGroupEvents2() {
  var x=document.getElementById("groupList2")
  if(x.selectedIndex==0) y=1;
  if(x.selectedIndex==1) window.location="/group-events/men/";
  if(x.selectedIndex==2) window.location="/group-events/womens-teaching-ministry/";
  if(x.selectedIndex==3) window.location="/group-events/young-adults/";
  if(x.selectedIndex==4) window.location="/group-events/community-groups/";
  if(x.selectedIndex==5) window.location="/group-events/cares-groups/";
  if(x.selectedIndex==6) window.location="/group-events/junior-high/";
  if(x.selectedIndex==7) window.location="/group-events/senior-high/";
  if(x.selectedIndex==8) window.location="/group-events/children/";
  if(x.selectedIndex==9) window.location="/news-and-events/";
}

function gotoGroupBlog() {
  var x=document.getElementById("groupBlogList")
  if(x.selectedIndex==0) y=1;
  if(x.selectedIndex==1) window.location="/cares-groups-blog/";
  if(x.selectedIndex==2) window.location="/children-blog/";
  if(x.selectedIndex==3) window.location="/community-groups-blog/";
  if(x.selectedIndex==4) window.location="/extensions-and-missions-blog/";
  if(x.selectedIndex==5) window.location="/junior-high-blog/";
  if(x.selectedIndex==6) window.location="/men-blog/";
  if(x.selectedIndex==7) window.location="/senior-high-blog/";
  if(x.selectedIndex==8) window.location="/stephen-ministry-blog/";
  if(x.selectedIndex==9) window.location="/womens-teaching-ministry-blog/";
  if(x.selectedIndex==10) window.location="/worship-blog/";
  if(x.selectedIndex==11) window.location="/young-adults-blog/";
}
