
function initPage() {
	animateBlock();
}

var currentAniFrame = 1;

function animateBlock( step ) {
	document.getElementById('ani'+currentAniFrame).style.visibility = 'hidden';
	currentAniFrame++;
	if( currentAniFrame > 7 ) currentAniFrame = 1;
	document.getElementById('ani'+currentAniFrame).style.visibility = 'visible';

	setTimeout( animateBlock, 200 );
}

function menuOver( el ) {
	el.childNodes[1].style.visibility = 'visible';
}

function menuOut( el ) {
	el.childNodes[1].style.visibility = 'hidden';
}

function showMap() {
	$('mapImage').setOpacity(0);
	$('mapBackground').setOpacity(0);
	$('mapContainer').show();
	new Effect.Parallel( [
		new Effect.Opacity( 'mapImage', { sync: true, from: 0, to: 1 } ),
		new Effect.Opacity( 'mapBackground', { sync: true, from: 0, to: 0.7 } )
	] );
}

function hideMap() {
	new Effect.Parallel( [
		new Effect.Opacity( 'mapImage', { sync: true, from: 1, to: 0 } ),
		new Effect.Opacity( 'mapBackground', { sync: true, from: 0.7, to: 0 } )
	], { afterFinish: function() { $('mapContainer').hide(); } } );
}

