// JavaScript Document

// Author: Sebastian Friedrich (i. A. RUSKA, MARTIN, ASSOCIATES)
// Mail: friedrich@ruskamartin.de
// Web: http://ruskamartin.de

$(function(){
	var IDLE_TIMEOUT = 1500;
	var ANIM_SPEED = 1000;

	function unloadElement() {
		$("body > *:not(#startbin)").show();
		$("#startbin")
			.fadeOut(ANIM_SPEED, function() {
				$(this).remove();
				$("body").css({
						"overflow":"",
						"height":""
					})
			});
	}
	
	// Einblendeffekt bei erstem Seitenaufruf
	$("body > *").hide();
	$("body")
		.css({
			"overflow":"hidden",
			"height":$(document).height()
		})
		.append("<div id='startbin'></div>");
	$("#startbin")
		.css({
			"background":"url('../images/logo-start.png') center no-repeat #fff",
			"width":"100%",
			"height":$(document).height(),
			"cursor":"pointer",
			"position":"absolute",
			"left":0,
			"top":0
		})
		.fadeOut(0)
		.click(unloadElement)
		.fadeIn(ANIM_SPEED * 3 / 2, 
			function() { 
				setTimeout(unloadElement, IDLE_TIMEOUT)
			});
});
