window.addEvent('domready', function() {
	$('page').set('opacity', 0);

	var blogvisible = true;
	if(firstvisit == 1)
		blogvisible = false;

	var myFunction = function() {
		var myEffect = new Fx.Morph('page', {
			duration: 2000,
			transition: Fx.Transitions.Sine.easeIn
		}).chain(function() { blogvisible = true; });

		myEffect.start({ 'opacity': 1	});
	}

	if(blogvisible)
		$('page').set('opacity', 1);
	else
		var myTimer = myFunction.delay(2000);			// myTimer = $clear(myTimer); zum abbrechen

	$('header').set('opacity', 0.93);
	$('showMap').addEvent('click', showMap);
	$('showBlog').addEvent('click', showBlog);
});
function showMap(e)
{
	if(e != null)		e.stop();
	blogvisible = false;

	var morph = new Fx.Morph($('page'));
	morph.start({ 'opacity': 0 }).chain(function() {
		map.addControl(mapControl);
		map.addControl(mapScale);
		map.enableContinuousZoom();
		map.enableScrollWheelZoom();
		$('header').set('opacity', 0);
	});
	$('mapbuttons').morph({	'opacity': 0.8 });
}

function showBlog(e)
{
	if(e != null)		e.stop();
	map.removeControl(mapControl);
	map.disableContinuousZoom();
	map.disableScrollWheelZoom();
	blogvisible = true;
	$('page').morph({ 'opacity': 1 });
	$('header').set('opacity', 0.93);
	$('mapbuttons').morph({	'opacity': 0 });
}
