// Uses http://jQuery.com

$(function()
{
   // Show/Hide vintage details
   $('ul.careers > li > div.header').toggle(
        function()
        {
            ShowCareers($(this));
        },
        function()
        {
            HideCareers($(this));
        }
    );
    
        // Prevent links from bubbling, but we still want to follow any links
    $('a.open-all').toggle(
        function(event)
        {
            event.stopPropagation();
            $('ul.careers > li > div.header').each(
                function() 
                {
                    $('a.open-all').addClass('close-all');
                    ShowCareers($(this));
                }
             );
        },
        function(event)
        {
            event.stopPropagation();
            $('ul.careers > li > div.header').each(
                function() 
                {
                    $('a.open-all').removeClass('close-all');
                    HideCareers($(this));
                }
             );
        }
     );
});

function ShowCareers(objSummary)
{
    var objDetails = objSummary.siblings('div.description');
    objDetails.slideDown(400);
    objSummary.parent().addClass('open');
}

function HideCareers(objSummary)
{
    objSummary.siblings('div.description').slideUp(400);
    objSummary.parent().removeClass('open');
}
