(function ($) {$(document).ready(function(){

    var defaultText = "Search the site...";

    $('#edit-search-block-form--2').each(function(){
        var $this = $(this);

        var focusFunc = function(){
            $this.addClass("focused");
            if($this.val() == defaultText) $this.val("");
        };
        var blurFunc = function(){
            if(!$this.val()){
                $this.removeClass("focused");
                $this.val(defaultText);
            }
        };

        // Bind the functions
        $this.focus(focusFunc).blur(blurFunc);

        // Initialize the search bar without actually focusing it,
        // because focusing scrolls the page to the element.
        focusFunc();
        blurFunc();
    });

    // Capture when the user mouses over the drop down list itself
    $(".menu ul ul").mouseover(function() {
      // Switch the red arrow (default) with the black arrow (hover)
      $("#history-tabby .tabby-content .tabby .menu #nav .menu-more-link a .arrow-icon").removeClass('arrow-icon-nohover').addClass('arrow-icon-hover');
    })
    .mouseout(function() {
      // Switch the black arrow (hover) with the red arrow (default)
      $("#history-tabby .tabby-content .tabby .menu #nav .menu-more-link a .arrow-icon").removeClass('arrow-icon-hover').addClass('arrow-icon-nohover');
    });

});}(jQuery));;

