document.write('<div id="traildiv"></div>');

$(document).ready(function() {
   $('#nav').superfish({
      delay:200,
      animation: {opacity:'show',height:'show'},
      speed: 'fast'
      });
   $('#eventcats').change(function() {
      day=$('#eventcats option:selected').val();
      window.location="/smallgroup-events/"+day;
   });
   $('#sidebar-blog .recent-post').each(function() {
      postTitle=$('h4.blogposttitle').text();
      postTitle2=$('#page-content h2').text();
      thisTitle=$(this).find('h5 a').text();
      if (thisTitle==postTitle || thisTitle==postTitle2) {
         $(this).addClass('current');
      };
   });
   $('#secondary-nav ul li.current').each(function() {
      linkHeight=$(this).height();
      if (linkHeight >="50") {
         $(this).find('a').css({
            'background' : 'url(/_img/bg_secondarynav_li_current_double.png) no-repeat right top',
            'padding-top' : '6px'
         }); 
      }; 
   });
    $('ul#quick-links li a').wrap('<span></span>');
    $('#footer li a').each(function() {
       var footerLink= $(this).attr('href');
       var footerLinkPre=footerLink.slice(0,4);
       if (footerLinkPre=="http") {
          $(this).attr('target', '_blank');
       };
    });
});
