$(document).ready(function(){

/* inicializácia záložiek */
$('ul.tabs').tabs('div.panes > div');
/* /inicializácia záložiek */ 

/* funkcionalita popup menu v head-menu */
	objhide = objshow = objshowtimer = objhidetimer = null;

	$('#login-menu ul.not-logged > li').hover(function() {
		if (objhide) {
			if ($(this).attr('class') == objhide.attr('class')) {
				clearTimeout(objhidetimer);
			} else {
				checkHover();
			}
		}
		
		objshow = $(this);
		objshowtimer = setTimeout('delayedShow()', 200);
	}, function() {
		clearTimeout(objshowtimer);
		objhide = $(this);
		objhidetimer = setTimeout('checkHover()', 500);
	});
	/* /funkcionalita popup menu v head-menu */
	
	/* inline label pre query */
	input_query = $('#adresat');
	input_query.attr('value', input_query.attr('title')).bind('focus', function(){	
		if (input_query.attr('value') == input_query.attr('title')) {
			input_query.attr('value', '').removeClass('empty');
		}
	}).bind('blur', function(){
		if ((input_query.attr('value') == '') || (input_query.attr('value') == input_query.attr('title'))) {
			input_query.attr('value', input_query.attr('title')).addClass('empty');
		}
	});
	
	/* /inline label pre query */


});

/* funkcie pre popup menu v head-menu */
function checkHover() {
	if (objhide) {
		objhide.find('ul').hide();
		objhide = null;
	}
}

function delayedShow() {
	if (objshow) {
		objshow.find('ul').show();	
	}
}
/* /funkcie pre popup menu v head-menu */



