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);

$(document).ready(function(){
// equal height
  var contentHeight = $("#content").height();
  var sbHeight = $("#sidebar").height();
  if (sbHeight > contentHeight) {
    $("#content").css("height", (sbHeight - 20) + "px");
  }
  
// remove sermons nav item
  $("#nav li#nav_sermons").remove();

  
// ministry index
  var moveBody_ministry = $("#ministry_index_holder").height();
  var ministry = false;

  $("#ministry").click(function() {
    $("#ministry_index_holder").slideToggle(1100);
    if (ministry == false) {
      $('body').animate({ backgroundPositionY: moveBody_ministry + "px" }, 1100);
      $('#ministry').removeClass('closed').addClass('open');
      ministry = true;
    } else {
      $('body').animate({ backgroundPositionY:"0px" }, 1000);
      $('#ministry').removeClass('open').addClass('closed');
      ministry = false;
    }
  });

  // form required fields
    $("form.monkForm .required label").append(" <span style='color:red'>*</span>");
    $("form.monkForm fieldset legend:first").hide();
    $("form.monkForm .required p.error").each(function(){
      var inputs = $(this).next().children('input');
      inputs.addClass('error');
      inputs.focus(function(){
        inputs.css('background','none');
      });
      inputs.blur(function(){
        var errorVal = $(this).val();
        if (errorVal == '') {
          inputs.css('background','pink');
        }
      });
    });

});   // end $(document).ready
