//
// Dropdown Menu's
//

$(document).ready(function(){  
  
	// Dropdown Menu
	$('ul.top_nav li').hover(function() {
			//show its submenu
			$('ul', this).fadeIn(100);

		}, 
		function() {
			//hide its submenu
			$('ul', this).fadeOut(100);			
	});
	  
});



//
// Slideshow
//

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

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

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

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

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

$(function() {
    setInterval( "slideSwitch()", 8000 );
});


//
// Accordian
//

$(document).ready(function(){
	$(".accordion h1").css("cursor","pointer");
	$(".accordion h1:first").addClass("active");
	$(".accordion div.plist:not(:first)").hide();

	$(".accordion h1").click(function(){

	  $(this).next("div.plist").slideToggle("slow")
	  .siblings("div.plist:visible").slideUp("slow");
	  $(this).toggleClass("active");
	  $(this).siblings("h1").removeClass("active");

	});

});
