/* Begin jQuery code */

function onAfter(curr, next, opts, fwd){
    //get the height of the current slide
    var ht = $kuj(this).height();
    //set the container's height to that of the current slide
    var currHeight = $kuj(this).parent().height();
    if (currHeight < ht) {
        $kuj(this).parent().css('height', ht + 'px');
    }
}

$kuj(document).ready(function() {
    $kuj('body').addClass('js');
    // This is commented out when there is only one news item on the main page.
    $kuj('#nsoNews #newsContent').newsTicker();
    $kuj('.windowlist a, a.window, a.external').attr('onclick', 'return !window.open(this.href);');

    $kuj('#bannerImgs').cycle({
        timeout: 10000,
        speed:   2500
    });

    $kuj('#factList').cycle({
        timeout: 6000,
        speed:   1000,
        after:   onAfter
    });

    $kuj().panelSwitcher();
});
/* End jQuery code */
