$(document).ready(function () {

    $('#tabs-content .browseJobs').hide();
    $('#tabs-content div[id^="tabs-"]:not(:first)').hide();
    $('#ipsTabs li:first').addClass('r-selected');
    $('#ipsTabs li:first a').addClass('l-selected');

    $('#ipsTabs li').click(function () {

        $('#ipsTabs li').removeClass('r-selected');
        $('#ipsTabs li a').removeClass('l-selected');
        $('#tabs-content div[id^="tabs-"]').hide();

        var id = $(this).find('a').attr('class');
        $("#" + id).show();
        $(this).addClass('r-selected');
        $(this).find('a').addClass('l-selected');
        return false;

    });

    var showText = '(show)';
    var hideText = '(hide)';
    $('#BrowseJobsbF .listColumn span').css('cursor', 'pointer');
    $('#BrowseJobsbF .listColumn ul:not(:first)').hide();
    $('#BrowseJobsbF .listColumn span:not(:first)').append(' <a href="#" class="toggleLink">' + showText + '</a>');
    $('#BrowseJobsbF .listColumn span:first').append(' <a href="#" class="toggleLink">' + hideText + '</a>');

    $('#BrowseJobsbF .listColumn span').click(function () {
        $("a", this).click();
    });

    $('a.toggleLink').click(function () {
        if ($(this).html() == showText) {
            $(this).html(hideText);
        }
        else {
            $(this).html(showText);
        }
        $(this).parent().next('ul').toggle('slow');
        return false;
    });

});
