/* 
jQuery Accordion Script

Modified for noConflict
*/
var $jq = jQuery.noConflict();

function initMenu() {
  $jq('#nav ul').hide();
  $jq('#nav ul:first').show();
  $jq('#nav li a').click(
    function() {
      var checkElement = $jq(this).next();
      if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
        $jq('#nav ul:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );
  }
$jq(document).ready(function() {initMenu();});

function slideSwitch() {
    var $active = $jq('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $jq('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $jq('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$jq(function() {
    setInterval( "slideSwitch()", 5000 );
});