(function ($) {
  $(document).ready(function() {
  
    // menu flyouts
    $("ul#main-menu li a").removeAttr("title").hover(
         function() {
           $(this).siblings("div").stop()
           .animate({
              bottom: "-50",
              opacity: 1
          },
          "fast")
          .show();
      
      },
      function() {
          $(this).siblings("div").stop()
          .animate({
              bottom: "-60",
              opacity: 0
          },
          "fast", 
          function(){
            $(this).hide()
          });
      }
    );
  
    // remove widows, from http://css-tricks.com/3563-preventing-widows-in-post-titles/
    $('.field-name-body p').each(function() {
      var wordArray = $(this).text().split(" ");
      wordArray[wordArray.length-2] += "&nbsp;" + wordArray[wordArray.length-1];
      wordArray.pop();
      jQuery(this).html(wordArray.join(" "));
    });

    
  });
}(jQuery));



