

window.onload = function() {
	//determine whether startani already shown or not
	
	ani_shown = false;
	if (document.cookie) 
	{	
		if (document.cookie.indexOf("ani_shown=true")>=0)
		{
			ani_shown = true;
			document.cookie = "ani_shown=true;";
			document.getElementById('all').style.visibility = 'visible';
		}
		else
		{
			ani_shown = false;
			document.cookie = "ani_shown=true;";
		}
	}

	if (ani_shown == false)
	{
		duration = 10000;
		showstartani();
		setTimeout("hidestartani();", duration);
	}
}

function showstartani()
{
	// div
	var div_grey = document.createElement("DIV");
	div_grey.style.width = "100%";
	div_grey.style.height = "100%";
	div_grey.style.zIndex = 500;
	div_grey.style.backgroundRepeat = 'repeat';
	div_grey.style.backgroundPosition = '0px 0px'; 
	div_grey.id = 'bg_grey';

	// grey_bg
	var img_grey = document.createElement("IMG");
	img_grey.src = '/templates/fsb_bihp/img/transparent_black.png';
	img_grey.style.position = "fixed";
	img_grey.style.top = "0px";
	img_grey.style.left = "0px";
	img_grey.style.width = '100%';
	img_grey.style.height = '100%';
	
	// animation
	
	ani_img = document.createElement('img');
	ani_img.src = 'images/stories/fsb-typoanimation.gif';
	ani_img.style.verticalAlign = "middle";
	ani_img.style.textAlign = "center";
	ani_img.style.zIndex = "500";
	ani_img.style.position = "fixed";
	ani_img.style.top = "50%";
	ani_img.style.left = "50%";
	ani_img.style.margin = "-178px 0 0 -178px";
	
	// put together
	div_grey.appendChild(img_grey);
	div_grey.appendChild(ani_img);

	document.getElementsByTagName('body')[0].appendChild(div_grey);
	
	e = document.createElement("A");
	e.id = 'intro_skip';
	e.style.zIndex = 2000;
	e.style.position = 'absolute';
	e.style.bottom = '40px';
	e.style.left = '50%';
	e.style.color = '#666';
	e.style.fontFamily = 'Arial';
	e.style.fontSize = '11px';
	e.style.fontWeight = 'bold';
	e.style.cursor = 'pointer';
	e.style.visibility = 'hidden';
	e.innerHTML = '&Uuml;berspringen &gt;&gt;';
	e.onclick = new Function("", "hidestartani()");
	document.body.appendChild(e);

	document.getElementById('intro_skip').style.marginLeft = Math.ceil(document.getElementById('intro_skip').offsetWidth / 2) * -1 + 'px';
	document.getElementById('intro_skip').style.visibility = 'visible';

	
}


function hidestartani()
{
	document.getElementById('bg_grey').parentNode.removeChild(document.getElementById('bg_grey'));
	document.getElementById('intro_skip').parentNode.removeChild(document.getElementById('intro_skip'));
	document.getElementById('all').style.visibility = 'visible';
}
