/* <![CDATA[ */

// Set tab-related variables
var tpfx = 'fr_';

// Function to hide all showing fullreads
function hideAllFullReads() {
    $('div.column').not('.fullread').fadeIn();
    $('div.fullread.ani:visible').slideUp();
}

// Upon the DOM being ready
$(document).ready(function() {
    
    // Look for links inside column headings for content revealage
    $('div.column > h2 > a').each(function() {
        if (this.id) {
            var tid = this.id;
            $('div.fullread#' + tpfx + tid).addClass('ani');
            if (this.href) {
                $('a[href$="#'+tid+'"]').click(function(e) {
                    e.preventDefault();
                    hideAllFullReads();
                    $('div.fullread#' + tpfx + tid).slideDown();
                    $('div.column').not('.fullread').not('.static').fadeOut();
                });
            }
        }
    });
    
    // Map hide function to heading of fullread
    $('div.fullread.ani > h2').each(function() {
        $(this).append(' (click here to hide)');
        $(this).addClass('handcursor');
        $(this).click(function() {
            hideAllFullReads();
        });
    });
    
});

/* ]]> */