$(document).ready(function(){

	$('#hide').css('display','none');	

	if( $("ul.category li ul").attr('id')=='hide' )
	{
		$("#rolldown").toggle(
				function () {
					$('ul.category li ul').slideDown('slow');
				},
				function () {
					$('ul.category li ul').slideUp('slow');
		});
	}
	else
	{
		$("#rolldown").toggle(
			function () {
				$('ul.category li ul').slideUp('slow');
			},
			function () {
				$('ul.category li ul').slideDown('slow');
		});
	}
	
	$('#popis').before('<div class="false_href">Viac ...</div>');
	
	$('#popis').css('display','none');
	
	$('.false_href').click(function(){
		$('#popis').slideDown('slow');
		$('.false_href').css('display','none');
	});
	
	$('.discus_content').css('display','none');
	
	$('.discus').toggle(
		function(){
			$('.discus_content').slideDown('slow');
		},
		function () {
			$('.discus_content').slideUp('slow');
	});
	
	$('form.questions :submit').click(function(e) { 
		$.post($("form.questions").attr('action'), { 
			otazka: $("form.questions input[name='otazka']").attr('value'),
			wmd: $("form.questions input[name='wmd']").attr('value'),
			show: $("form.questions input[name='show']").attr('value'),
			vcat: $("form.questions input[name='vcat']").attr('value'),
			odpoved: $("form.questions input[name='odpoved']:checked").val(),
			name: $("form.questions input[name='name']").attr('value'),
			adresa: $("form.questions input[name='adresa']").attr('value'),
			mesto: $("form.questions input[name='mesto']").attr('value'),
			psc: $("form.questions input[name='psc']").attr('value'),
			krajina: $("form.questions input[name='krajina']").attr('value'),
			email: $("form.questions input[name='email']").attr('value')			
		} );

		$("form.questions input[name='odpoved']").attr('checked','');
		$("form.questions input[name='name']").attr('value','');
		$("form.questions input[name='adresa']").attr('value','');
		$("form.questions input[name='mesto']").attr('value','');
		$("form.questions input[name='psc']").attr('value','');
		$("form.questions input[name='krajina']").attr('value','');
		$("form.questions input[name='email']").attr('value','');
		
		tb_remove();
	
		e.preventDefault();
	});
});



function ukaz(id)
{
	document.getElementById(id).style.display = 'block';
}

