// jQuery
$(document).ready(function() {

	// FormTable.js
	$('.addition table td:even').addClass('lefa');;
	$('.addition table td:odd').addClass('prafa');;

	// definice barev a délky trvání efektů
	var hover_in_duration = 'fast';
	var hover_out_duration = 'slow';
		
	// efekt pro nadpisy levého menu
	$('h3.headerbar a').hover(function() {
		$(this).stop().animate({
			color: '#35A8C2'
		}, hover_in_duration);
	}, function() {
		if (!$(this).parent().hasClass('selected')) {
			$(this).stop().animate({
				color: '#473112'
			}, hover_out_duration);
		}
	});
	$('h3.headerbar a').mousedown(function() {
		if (!$(this).parent().hasClass('selected')) {
			$(this).stop().animate({
				color: '#267A8C'
			}, 100);
		}
	});
	$('h3.headerbar a').mouseup(function() {
		$(this).stop().animate({
			color: '#35A8C2'
		}, hover_out_duration)
	});
	$('h3.headerbar a').click(function() {
		if (!$(this).parent().hasClass('selected')) {
			$('h3.headerbar.selected a').animate({
				color: '#473112'
			}, hover_out_duration);
		}
	});
	
	
	// efekt pro nadpisy hlavičky menu
	$('#header ul.navi li a').hover(function() {
		$(this).stop().animate({
			color: '#f8ecd4'
		}, hover_in_duration);
	}, function() {
		if (!$(this).parent().hasClass('active')) {
			$(this).stop().animate({
				color: '#eac484'
			}, hover_out_duration);
		} else {
			$(this).stop().animate({
				color: '#ead0ad'
			}, hover_out_duration);
		}
	});
	$('#header ul.navi li a').mousedown(function() {
		$(this).stop().animate({
			color: '#ead0ad'
		}, 100);
	});
	$('#header ul.navi li a').click(function() {
		if (!$(this).parent().hasClass('active')) {
			$('#header ul.navi li.active a').animate({
				color: '#eac484'
			}, hover_out_duration);
		}
	});

});

