function europa(nr,max) {
	var nrd;
	nr = nr%(max+1);
	if (nr == 0) nrd=max; else nrd = nr-1;
	

	losowax = Math.floor(Math.random() * 200) + 0;
	losoway = Math.floor(Math.random() * 80) + 20;

	document.getElementById('europa'+nr).style.marginLeft = losowax+'px';
	document.getElementById('europa'+nr).style.marginTop = losoway+'px';

	new Effect.Parallel([
		new Effect.Appear('europa'+nr,{ sync: true }),
		new Effect.Fade('europa'+nrd,{ sync: true})
		], { 
		duration: 5.0,
		delay: 0.5
	});



}

function europa2(tablica,max) {
	
	var tab = eval(tablica);
	var i=0;
	//alert(tablica[0].Event.id);
	rozm = tablica.size();
	zmien = tablica;
	
	setInterval("europa3(zmien)",8000);
	

}

function europa3(tab) {
	
//	new Effect.Fade('eurtekst');
	losowa = Math.floor(Math.random() * tab.size()) + 0;
	losowax = Math.floor(Math.random() * 200) + 0;
	losoway = Math.floor(Math.random() * 80) + 20;
	
	if (tab[losowa]) {
	var el = document.getElementById('eurtekst');	
	el.innerHTML=tab[losowa].Event.title;
	el.href='/events/show/'+tab[losowa].Event.id;
	el.style.marginTop=losoway+'px';
	el.style.marginLeft=losowax+'px';

	new Effect.Appear('eurtekst',{ duration: 2.0 });
	
	setTimeout("europa4()",5000);
	}
}

function europa4() {
	
	new Effect.Fade('eurtekst',{ duration: 2.0 });
	
}
