$(function() {
					 
	$('.odlety').click(function() {
		$('.odlety').css("background-color","#004f82");
		$('.prilety').css("background-color","#b9c8d3");
		$('#prilety').slideUp(350)
		$('#odlety').delay(350).slideDown(350);
	});
	
	$('.prilety').click(function() {
		$('.prilety').css("background-color","#004f82");
		$('.odlety').css("background-color","#b9c8d3");
		$('#odlety').slideUp(350)
		$('#prilety').delay(350).slideDown(350);
	});
	
	
	$('.pre-cestujucich').mouseenter(function() {
		$('#table-pre-cestujucich').slideDown(350);
	}).mouseleave(function() {
		$('#table-pre-cestujucich').slideUp(350);
	});
	
	
	$('.pre-pilotov').mouseenter(function() {
		$('#table-pre-pilotov').slideDown(350);
	}).mouseleave(function() {
		$('#table-pre-pilotov').slideUp(350);
	});
	
	
	$('.historia-letiska').mouseenter(function() {
		$('#table-historia-letiska').slideDown(350);
	}).mouseleave(function() {
		$('#table-historia-letiska').slideUp(350);
	});


	$(".question:first").addClass("questionfirst");
	
	setInterval(function ()	{
		$(".prezentacia").animate({
			opacity: .5,
		}, 500 );
		$(".prezentacia").animate({
			opacity: 1,
		}, 500 );
	}, 1 * 600);
	
	
	
	
	
	
	// skry partnerov
	$('#loga .loga').hide();
	
	$('#loga .nadpis').click(function(){
		if ($(this).parent('#loga').children('.loga').is(':visible'))
			$(this).parent('#loga').children('.loga').slideUp('slow');
		else
			$(this).parent('#loga').children('.loga').slideDown('slow');
	})
	
	
	
	
	
	$('#parkovisko a').mouseenter(function(){
		$(this).children('div').show();
	}).mouseleave(function(){
		$(this).children('div').hide();
		parkovisko();
	}).click(function(){
		var id = $(this).attr('id');
		var number = id.replace("p", "")
		$('.parkplace').html('<div>'+number+'</div>');
		$(this).find('input').attr('checked', true);
		parkovisko();
		return false;
	});
	

	parkovisko();




});



function parkovisko()
{
	$('#parkovisko input').parent('a').find('div').hide();
	$('#parkovisko input:checked').parent('a').find('div').show();
}



function checkrequired(which, msg)
{
    var pass=true
    if (document.images)
    {
        for (i=0;i<which.length;i++)
        {
            var tempobj=which.elements[i]
            if (tempobj.name.substring(0,2)=="v_")
            {
                if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1))
                {
                    pass=false
                    break
                }
            }
        }
    }
    
    if (!pass)
    {
        alert(msg)
        return false
    }
    else
    return true
}





