$(document).ready( function () {

  var originalInput = $("#searchBox").val();
  var saveInput = null;
  $("#searchBox").focus( function () {
    saveInput = $(this).val();
    if(saveInput == 'Search Site') {
      $(this).val("");
    }
  });
  $("#searchBox").blur( function () {
    if($(this).val() == "") {
      $(this).val('Search Site');
    }
  });
  $("#searchButton").click( function () {
    var currentInput = $("#searchBox").val();
    if(currentInput == "" || currentInput == 'Search Site') {
      alert("Please type in the text you would like to search the site for.");
      $("#searchBox").focus();
      return false;
    }
  });
  $('.subNav li').hover(function() {
    $(this).addClass('subNavHover');
  },function() {
    $(this).removeClass('subNavHover');
  });
  $('.blogCommentButton').hover(function() {
    $(this).addClass('blogCommentButtonHover');
  },function() {
    $(this).removeClass('blogCommentButtonHover');
  });

//hide special blog comment input fields from real visitors - available to spam bots
  $('#blogCommentFirstName').hide();
  $('#blogCommentLastName').hide();

  $('#blogCommentButtonSubmit').click(function() {
    if(!$('#blogCommentName').val() || !$('#blogCommentText').val()) {
      alert('Both your name and a comment are required');
      return false;
    }
    else {
      return true;
    }
  });
  $('#blogCommentButtonReset').click(function() {
    $('#blogCommentName').val('');
    $('#blogCommentText').val('');
    return false;
  });

//blog subnav controls
  $('.blogSubNavMonthLink').click(function() {
    $(this).closest('.blogSubNavMonth').find('ul').toggle('fast');
    return false;
  });

});
