function setNavSelected(nav1Class, nav2Class) {
    $(function() {
        $('.nav-1 li.' + nav1Class + ' a').addClass('selected');
        $('.nav-2 li.' + nav2Class).addClass('selected');
    });
}
function pageLoad() {

    $(".pic a img:not([alt])").each(function() {
        var container = $(this).parent().parent();
        $(this).attr("alt", $("p.caption", container).html());
    })

    //Set title based upon alt text
    $("img:not([title])").each(function() {
        $(this).attr("title", $(this).attr("alt"));
    })

    //In lightbox, set the caption from the alt tag of the enclosed image
    $(".gallery a img, .lightbox a img").each(function() {
        $(this).parent().attr("title", $(this).attr("alt"));
    })

    $(function() {
        if (!isRunningIE6OrBelow) {
            $('a.lightbox').lightBox(); //Select all links with lightbox class
            $('.gallery').each(
                function() {
                   $("a", this).lightBox(); //All gallery items
                });
        }
        $('#fade-images').cycle({
            fx:    'fade',
            speed:  4000
        });
    });
    
    //Rounded corners
    Nifty("#dying-matters","big");
    Nifty("div.quote-wrapper","medium");
    Nifty("div.rounded","medium");
    Nifty("div.highlight","medium");
    Nifty("p.highlight-wide","medium");
    Nifty("blockquote.poem","medium");

    //Automatically page images etc
    if (!isRunningIE6OrBelow) {
        $(".paged").quickPager({pageSize:6});
    }    
}
