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'
       }); 
    }; 
  });
  
  $("#secondary-nav.smallGroup li#second-nav_small-groups_find-a-small-group").addClass("current");
  
  $('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');
     };
  });
  
    $('.login .thickbox, #comments .thickbox, a[title=Log In].thickbox, #content #text a.thickbox').colorbox({iframe:true,width:400, height:250});
	$('#footer .thickbox').colorbox();
	$('.rsvp .thickbox, #subnav .thickbox').colorbox({iframe:true,width:450, height:570});
	$('#options .thickbox,.section .thickbox').colorbox({iframe:true,width:500, height:570});
	
});

