jQuery(document).ready(function() {

    // Twitter
    jQuery(".latesttweet").getTwitter({
        userName: "worldendosoc",
        numTweets: 1,
        loaderText: "Loading tweets...",
        slideIn: true,
        slideDuration: 750,
        showHeading: false,
        showProfileLink: false,
        showTimestamp: true
    });
    
    jQuery('.feature-slider a').click(function(e) {
        jQuery('.featured-posts section.featured-post').css({
            opacity: 0,
            visibility: 'hidden'
        });
        jQuery(this.hash).css({
            opacity: 1,
            visibility: 'visible'
        });
        jQuery('.feature-slider a').removeClass('active');
        jQuery(this).addClass('active');
        e.preventDefault();
    });
    
    //Board Members Show/Hide
    jQuery('.bylawshead h3 a').click(function() {
        jQuery(this).closest('.bylawshead').find('.slidingdiv').animate({
            "height": "toggle"
        }, {
            duration: 400
        }); // Replaces default behavior
        return false;
    });
    
    //Latest News - remove margin-right from last one.
    jQuery('.newsitem:nth-child(4n+2)').addClass('end-row');
    
    //Page Slider - Ches, you should localize JS wherever possible to reduce unnecessary loads. This and the coda js should only load on membership page
    jQuery('.coda-slider').codaSlider();
    
});
