// JavaScript Document
function switchimg(next_img) {

	var active = $('#fade_images IMG.active');
	if (active.length == 0) active = $('#fade_images IMG:last');
	
	if(!next_img){
		var next =  active.next().length ? active.next() : $('#fade_images IMG:first');
	}else{
		var next = $("#fade_images").find("#"+next_img);
	}
	
	if(next.attr('id') != active.attr('id')){
		active.addClass('last-active');
		next.css({opacity: 0.0}).addClass('active').animate({opacity: 1.0}, 1000, function() {
			active.removeClass('active last-active');
		});
	}
}

$(function() {
	fade_effect = setInterval("switchimg()",3000);
	$("#you_what_links UL LI A").hover(function(){
		clearInterval(fade_effect);
		$("#fade_images IMG").stop(true,true);
		switchimg($(this).attr('rel'));
	},function(){});
});