jQuery.fn.splash = function() {
	var args = arguments[0];
	var divID = $(this);
	
	// display the first
	$(this).find("."+args.targetClass).css({opacity: 0.0}).hide();
	$(this).find("."+args.targetClass+":first").css({opacity: 1.0}).show().addClass("active");
	$(this).find(".splash-navi:first").addClass("splash-navi-active");
	
	var intervalHandle = setInterval(function(){
		current = divID.find(".active");
		number = current.attr("id");
		number = number.split('-');
		number = number[2];
		
		$("#navi-"+number).removeClass('splash-navi-active');
		
		next = number==args.no?"1":(parseInt(number)+1);
		
		$("#"+args.targetClass+"-"+next).show('fast', function(){	
			current.animate({opacity: 0.0}, 500, function(){
				current.hide().removeClass('active');
			});
			
			$("#"+args.targetClass+"-"+next).css({opacity: 0.0}).addClass('active').animate({opacity: 1.0}, 500);
		});
		
		$("#navi-"+next).addClass('splash-navi-active');
	}, args.timer);
	
	$(".splash-navi").click(function(){
		console.log($(this));
	
		current = divID.find(".active");
		number = current.attr("id");
		number = number.split('-');
		number = number[2];
		
		clearInterval(intervalHandle);

		$("#navi-"+number).removeClass('splash-navi-active');
		
		next = $(this).attr("number");
		
		$("#"+args.targetClass+"-"+next).show('fast', function(){	
			current.animate({opacity: 0.0}, 500, function(){
				current.hide().removeClass('active');
			});
			
			$("#"+args.targetClass+"-"+next).css({opacity: 0.0}).addClass('active').animate({opacity: 1.0}, 500);
		});		

		$("#navi-"+next).addClass('splash-navi-active');
		
		console.log($(this));
	});
};
