/**
 * author: Dariusz Pobożniak
 * url: http://pobozniak.pl
 *
 */
 
$(function() {
    $('.lightbox').fancybox();
    newsList();
    sideNav();
}) 

function newsList() {
    $('.news:not(:first)').find('.content').hide();
    $('.news h3').click(function() {
        $(this).parent().next('.content').slideToggle(500);
    })
}

function sideNav() {
    var $nav = $('#sidenav');
    if ($nav.length > 0) {
        $nav.find('ul ul').css('display', 'none');
        $nav.find('a').click(function () {
            var $ul = $(this).next('ul');
            if ($ul.length > 0) {
                $ul.slideToggle('500');
                return false;
            }
        });
        $nav.find('.active').parents('ul').css('display', 'block');
    }
}
