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()", 5000 );
});

$(function () {
	$('div.fade').hover(function() {
		var fade = $('> div', this);
		if (fade.is(':animated')) {
			fade.stop().fadeTo(250, 1);
		} else {
			fade.fadeIn(250);
		}
	}, function () {
		var fade = $('> div', this);
		if (fade.is(':animated')) {
			fade.stop().fadeTo(2000, 0);
		} else {
			fade.fadeOut(2000);
		}
	});
});

 jQuery.fn.FadeDivToggle = function(settings) {
	 settings = jQuery.extend({
		speed:500,
		easing : "swing"
	}, settings)
	
	caller = this
	if($(caller).css("display") == "none"){
		$(caller).animate({
			opacity: 1,
			height: 'toggle'
		}, settings.speed, settings.easing);
	}else{
		$(caller).animate({
			opacity: 0,
			height: 'toggle'
		}, settings.speed, settings.easing);
	}
}; 

function FadeDiv(DivID) {
	$('#'+DivID).FadeDivToggle()
	 return false;
}
