function initMsg()
{
	var activemsgItem = 'msgitem1_data';
	$A($$('h3.msg')).each(function(e){
		Event.observe(e.id, 'click', function(f){
			if( e.id + '_data' != activemsgItem )
			{
			
				if( activemsgItem )
					new Effect.BlindUp(activemsgItem, {duration:0.2, afterFinish: function(g){
						new Effect.BlindDown(e.id + '_data', {duration:0.3});
						activemsgItem = e.id + '_data';	
					}});
				else
				{
					new Effect.BlindDown(e.id + '_data', {duration:0.3});
					activemsgItem = e.id + '_data';
				}
			}
		});
	});
}

function initAnnos()
{
	var activeAnnoItem = 'annoitem1_data';
	$A($$('h3.anno')).each(function(e){
		Event.observe(e.id, 'click', function(f){
			if( e.id + '_data' != activeAnnoItem )
			{
				if( activeAnnoItem )
					new Effect.SlideUp(activeAnnoItem, {duration:0.2, afterFinish: function(g){
						new Effect.SlideDown(e.id + '_data', {duration:0.3});
						activeAnnoItem = e.id + '_data';	
					}});
				else
				{
					new Effect.SlideDown(e.id + '_data', {duration:0.3});
					activeAnnoItem = e.id + '_data';
				}
			}
		});
	});
}

function initPolls()
{
	$A($$('#poll a')).each(function(e){
		Event.observe(e, 'click', function(f){
			vote = e.href.match(/vote=(\d+)/)[1];
			new Ajax.Updater('pollWrapper', '/anketa/' + vote + '/', {onComplete: initPolls});
			Event.stop(f);
		});
	});
}
