$(document).ready(function(){
	valideForm(".kform form");
	valideForm(".feature_box form");

	$("a.fancy").fancybox({
		'titleShow' : true,
		'titlePosition' : 'inside',
		'transitionIn' : 'elastic',
		'transitionOut' : 'elastic'
	});

	$("#emailom").fancybox({
		'titlePosition'	: 'inside',
		'transitionIn'	: 'none',
		'transitionOut'	: 'none',
		'titleShow' : false
	});

	$('.noClick').click(function(){
		return false;
	});

	$('.popisok').each(function(){
		$(this).addClass("default");
		$(this).attr("value", this.title);
	});
	$('.popisok').focus(function() {
		$(this).removeClass("default").addClass("active");
		if (this.value == this.title){
			this.value = '';
		}
		if(this.value != this.title){this.select();}
	});
	$('.popisok').blur(function() {
		if (this.value == ''){
			$(this).removeClass("active").addClass("default");
			this.value = this.title;
		} else if (this.value == this.title){$(this).removeClass("active").addClass("default");}
	});
	$('.main_menu li div').hide();
	$('.main_menu li').each(function(){
		if($(this).hasClass('current')){
			$(this).hover(
				function(){$(this).children('div').show();},
				function(){$(this).children('div').hide();}
			);
		}
		else{
			$(this).hover(
				function(){
					$(this).addClass('current');
					$(this).children('div').show();
				},
				function(){
					$(this).removeClass('current');
					$(this).children('div').hide();
				}
			);
		}
		}
	);

	$('a.blank').click(function(){
		window.open(this.href);
		return false;
	});

	$('.slovak').click(function(){
		$('.kaviarne.sk').show();
		$('.kaviarne.cz').hide();
		return false;
	});

	$('.czech').click(function(){
		$('.kaviarne.cz').show();
		$('.kaviarne.sk').hide();
		return false;
	});
		
	$('.kav').each(function(){
		var x = this.id;
		x = x.substr(1)
		x = parseInt(x);
		var y = this.title;
		y = y.substr(1)
		y = parseInt(y);
		$(this).css('left', x + 'px');
		$(this).css('top', y + 'px');
		$(this).attr('title','');
	});
	
	$('.ttp').css('opacity',0);
	
	$('.kav').hover(function(){
		$(this).children('.inkav').children('.ttp').css('display','block').stop(true,true).animate({opacity: 1}, 500).css('display','block');
	},function(){
		$(this).children('.inkav').children('.ttp').stop(true,true).animate({opacity: 0}, 100, function() {$(this).css('display','none')});
	});
});
