(function($) {

  // Google  
  $(function() {

    function addWatermark() {
      if ($('#cse-search-box input.text').val() == '') {
        $('#cse-search-box input.text').css("background-image", "url(http://www.google.com/coop/intl/en/images/google_custom_search_watermark.gif)");
      };  
    }

    addWatermark();

    $("#cse-search-box input.text").bind('focus', function(event) {
      $("#cse-search-box input.text").css("background-image", "none" );
    });

    $("#cse-search-box input.text").bind('blur', function(event) {
      addWatermark();
    });

  });
  
  
  // Home Page Guide
  $(function() {

    $("ul#icons span.text").hide();

    var current_menu_item = null;

    $("div#click p").bind('click', function(event){
      $("ul#icons li .text").hide();      
      $(".statement").css("color", "#3F4040" ); 
      $(".statement strong").css("color", "#3F4040" );
    });

    $("ul#icons li").bind('click', function(event) {
      $(".statement").css("color", "#8B8B8B" );
      $(".statement strong").css("color", "#8B8B8B" );
      $("ul#icons li .text").hide();

      $("ul#icons li span.icon").css("background-position", "0 0" ); 
      $(event.target).css("background-position", "0 -72px" ); 

      $(event.target).parent().find('.text').toggle();
      current_menu_item = event.target
    });

    $("#home .icon").hover(function() {
      $(this).css("background-position", "0 -72px"); 
    }, function() {
      if(current_menu_item != this) {
        $(this).css("background-position", "0 0"); 
      }
    });

  });

  // Video Rollover
  $(function() {
    $(".video p img").hover(function() {
      this.src = this.src.replace('.gif', '_over.gif');
    }, function () {
      this.src = this.src.replace('_over.gif', '.gif');
    });
  });
  
  // Removes underline for linked images
  $(function() {
    jQuery("a > img").parent().addClass('no-text-decoration')
  });
    
}) (jQuery);