function showphoto(sirka,vyska,adresa) {
	document.getElementById('foto_rb').style.display = 'block';
	document.getElementById('foto_src').style.background = 'url('+ adresa +')';
	
	document.getElementById('foto_src').style.width = sirka + 'px';
	document.getElementById('foto_src').style.height = vyska + 'px';
	document.getElementById('rb_silver').style.width = sirka+4 + 'px';
	document.getElementById('rb_silver').style.height = vyska+4 + 'px';
	document.getElementById('rb_sirka1').style.width = sirka+29 + 'px';
	document.getElementById('rb_sirka2').style.width = sirka+9 + 'px';
}

var photo_odkaz_current = null;

function showphoto2(odkaz) {
	odkaz = $(odkaz);
	photo_odkaz_current = odkaz.identify();
	
	var sirka = parseInt(odkaz.readAttribute('img:width'));
	var vyska = parseInt(odkaz.readAttribute('img:height'));
	var adresa = odkaz.readAttribute('img:src');
	var nr = odkaz.readAttribute('img:i');
	
	document.getElementById('foto_rb').style.display = 'block';
	
	$('foto_src').setStyle({
		background: 'url("'+adresa+'")',
		width: sirka+'px',
		height: vyska+'px'
	});
	document.getElementById('rb_silver').style.width = sirka+4 + 'px';
	document.getElementById('rb_silver').style.height = vyska+4 + 'px';
	document.getElementById('rb_sirka1').style.width = sirka+29 + 'px';
	document.getElementById('rb_sirka2').style.width = sirka+9 + 'px';
	document.getElementById('fotka_posun').style.zIndex = nr;
}

function zmenobrazek2(posun) {
	var odkaz = $(photo_odkaz_current);
	var dalsi = odkaz.up('li');
	dalsi = posun > 0 ? dalsi.next('li') : dalsi.previous('li');
	if (!dalsi)
		return;
	dalsi = dalsi.down('a');
	showphoto2(dalsi);
}

function OpenPictureWindow(theURL,sirka,vyska) {
	Okynko = window.open(theURL,"noveOkno", "status=0, width="+sirka+", height="+vyska);
}

/*
CSS Browser Selector v0.3.4 (Sep 29, 2009)
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/
(function() {
function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',o='opera',
h=document.getElementsByTagName('html')[0],b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?
g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1
:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')
?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')
?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js'];
c = b.join(' '); h.className += (h.className?' ':'')+c; return c;};
css_browser_selector(navigator.userAgent);
})();

parseUri.options.strictMode = true;

document.observe('dom:loaded', function() {
	
	$$('#menu-main > li.with-submenu')
		.invoke('observe', 'mouseenter', function(eo) {
			var el = $(this);
			var timer_id = el.retrieve('timer_id');
			if (timer_id)
				window.clearTimeout(timer_id);
			el.down('.submenu').style.visibility = 'visible';
		})
		.invoke('observe', 'mouseleave', function(eo) {
			var el = $(this);
			var timer_id = (function(that) {
				that.store('timer_id', null);
				that.down('.submenu').style.visibility = 'hidden';
			}).delay(.4, el);
			el.store('timer_id', timer_id);
		});
		
	/*
	$('kontclub').observe('mouseleave', function(eo) {
		$(this).hide();
	});
	
	$('menu-main-1').observe('mouseover', function(eo) {
		$('kontclub').style.display = 'block';
	});
	*/
});
