var maxheight = screen.availHeight*3;

var showmap = false;

document.getElementById('schleier-background').style.height = maxheight + 'px';
//window.setTimeout("hide()", 17000);

function hide() { fade(document.getElementById('schleier-background'),'0.6','0.0',0.6,25); }
function jump() {hide();}

function skip () {
	document.getElementById('schleier-background-content').style.display = "none";
	document.getElementById('schleier-background').style.display = "none";
	onshowmap();
}

function fade (element, from, to, current,speed) {
	if (typeof current == 'undefined') {
		current = from;
	}
	if (typeof element.style.opacity != 'undefined') {
		element.style.opacity = current;
	}
	else if (typeof element.style.filter != 'undefined') {
		//element.style.filter = 'progidXImageTransform.Microsoft.Alpha(opacity=' + (Math.round(current * 100)) + ')';
		element.style.filter = 'alpha(opacity = ' + Math.round(current * 100) + ')';
	}
	if (from > to) {
		current -= 0.02;
		current = Math.round(current * 100) / 100;
		if (current >= to) {
			setTimeout(function () { fade(element, from, to, current); },speed);
		} else {
			//element.style.display = "none";
			resize (element, 200, 0, current)
			document.getElementById('schleier-background-content').style.display = "none";
			onshowmap();
		}
	} else {
		current += 0.02;
		current = Math.round(current * 100) / 100;
		if (current <= to) {
			setTimeout(function () { fade(element, from, to, current); },speed);
		}
	}
}

function resize (element, from, to, current) {
	if (!current || typeof current == 'undefined') { current = element.style.height; }
	if (typeof current == 'undefined') {
		current = from;
	}
	setTimeout(function () { resize(element, from, to, current); },25);
	if (from > to) {
		current -= 1;
		//current = Math.round(current * 100) / 100;
		if (current >= to) {
			setTimeout(function () { resize(element, from, to, current); },25);
		} else {
			element.style.display = "none";
			document.getElementById('schleier-background-content').style.display = "none";
		}
	} else {
		current += 1;
		//current = Math.round(current * 100) / 100;
		if (current <= to) {
			setTimeout(function () { resize(element, from, to, current); },25);
		}
	}
}

function onshowmap() {
	showmap = true;
}
