function doSomething(x) {
    c="current";
	processed = false;
	
	if (document.getElementById) 
	{
        navRoot = document.getElementById("nav");
        if(navRoot && navRoot.childNodes)
        {
            for (i=0; i < navRoot.childNodes.length; i++) 
            {
                node = navRoot.childNodes[i];
                if (node.nodeName == "LI") 
                {
                    if(x != node.id)
                    {
                        node.className = "";
                    }
                    else
                    {
                        node.className = c;
                    }
                }
            }
            processed = true;
        }
    }
    
    if(!processed)
    {
        var y=document.getElementById('nav').className;
	    if (y)	document.getElementById(y).className="nav";
	    document.getElementById(x).className=c;
	    document.getElementById('nav').className=x;
	}
}

$(document).ready(function() {
  $('#an_calendar a').click(function(){
    $('#branch1').addClass("current");
    $('#branch2').removeClass("current");
    $(this).addClass("current");
    $('#an_agenda a').removeClass("current");
    return false;
  });
  $('#an_agenda a').click(function(){
    $('#branch2').addClass("current");
    $('#branch1').removeClass("current");
    $(this).addClass("current");
    $('#an_calendar a').removeClass("current");
    return false;
  });
});

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