Event.observe(window, 'load', function(e){
	$$('#levy ul a').each(function(f){
		Event.observe(f, 'mouseover', function(g){
			$('imgPlaceholder').setStyle({
				'backgroundImage': 'url(/img/menu/' + f.id + '.jpg)'
			});
		});
		
		Event.observe(f, 'mouseout', function(g){
			$('imgPlaceholder').style.background = 'transparent';
		});
	});
});

function setDesc( element )
{
	//alert(element);
	
	$('popis1').update( $(element + '_desc1' ).innerHTML );
	$('popis2').update( $(element + '_desc2' ).innerHTML );
	$('popis3').update( $(element + '_desc3' ).innerHTML );
	$('popis4').update( $(element + '_desc4' ).innerHTML );
//	if( popis1 )
//		$('popis1').update(popis1);
}

function clearDesc()
{
	['popis1', 'popis2', 'popis3', 'popis4'].each(function(e){$(e).update('')});
}

function initEvents()
{
	$A($$('div.galitem a')).each(function(e){
		new Event.observe(e.id, 'mouseover', function(f){setDesc(e.id);});
		new Event.observe(e.id, 'mouseout', clearDesc);
	});
	
	if( $('btnNext') )
	{
		new Event.observe($('btnNext'), 'mouseover', function(e){$('btnNext').src = '/img/next-hover.gif';});
		new Event.observe($('btnNext'), 'mouseout', function(e){$('btnNext').src = '/img/next.gif';});
	}
	
	if( $('btnPrev') )
	{
		new Event.observe($('btnPrev'), 'mouseover', function(e){$('btnPrev').src = '/img/prev-hover.gif';});
		new Event.observe($('btnPrev'), 'mouseout', function(e){$('btnPrev').src = '/img/prev.gif';});
	}
}

Event.observe(window, 'load', initEvents);
