/* SLIDESHOW */

function slideSwitch() {
    var $active = $('#banner img.active');

    if ( $active.length == 0 ) $active = $('#banner img:last');

    var $next =  $active.next().length ? $active.next()
        : $('#banner 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()", 4500 );
});

/* SEARCH */

$(function(){
	$('#header form fieldset#search-fields').addClass('hidden');
	$('#header form').hover(function(){
		$('#header form fieldset#search-fields').fadeIn('200');
	},
		function(){
		$('#header form fieldset#search-fields').fadeOut('200');
	});
});

/* KEEP LINK SELECTED WHILST ON DROPDOWN */

$(function(){
	$('#header ul ul').hover(function(){
		$(this.parentNode).find('a:first').addClass('selected');
	},
	function(){
		$(this.parentNode).find('a:first').removeClass('selected');
	});
});



/* IE6 DROPDOWN */

$(function(){
	$('#header ul li ul').removeClass();

	$('#header ul li').hover(function(){
		$(this).find('ul').slideDown('40');
	},
	function(){
		$(this).find('ul').slideUp('40');
	});
});


