window.addEvent('domready', function(){
	if($('mainmenu') && !$('var-small')){
		/* --- Accordion --- */
		var mainPoints = $('mainmenu').getChildren();
		var togglers = [];
		var active = -1;
		for(var i=0; i<mainPoints.length; i++){
			if(mainPoints[i].hasClass('active')){active=i;}
			togglers.push(mainPoints[i].getChildren()[0]);
		}
		var stretchers = $$('#mainmenu li ul');
		// togglers.each(function (tog) {tog.onclick = function () {return false;}}); // does not work on IE
		var myMenuAccordion = new Fx.Accordion(togglers, stretchers, {show: active, alwaysHide: false});
		/* --- Alpha effect --- */
		var elements = [$('mainmenu')];
		var menuFX = new Sheer(elements ,{eyeRadius: 300, opacity:.5});
	}
	if($('map')){
		var mapFX = new Movingmap($('map'),{duration:500, opacity:0.001});
	}
	if($$('.block') && !$('flashcontent')){
		var el = $('body');
		var fx = el.effect('opacity',{duration:1000}).set(0);
		(function(){fx.start(1);}).delay(50, this);

// ToDO: the sheet background has to be #cdcdcd (bt it currently not works with #languages)

// the following solution would be much nicer but does not work in IE
// IE has a text rendering bug with faded elements that have no background

		/* var elements=$$('.block');
		elements.each(function(el, i){
			var fx = el.effect('opacity',{duration:1000}).set(0);
			(function(){fx.start(1);}).delay((i+1)*500, this);
			(function(){el.setStyle('filter', '');}).delay(((i+1)*500)+1010, this);
		}, this); */
	}
});