Cufon.replace('nav a', {hover:true})('h1')('h2')('h3')('h4')('h5');



$(document).ready(function(){



// last li

	$('ul li:last-child').addClass('last');


// kategorie hover

	$('.kategorie li').hover(
		function(){
			$(this).find('span').animate({paddingBottom: 15}, 300);
		},
		function(){
			$(this).find('span').animate({paddingBottom: 10}, 300);
		}
	);



// font changer

	$('.smallFont a').click(function(){
		$('#lid *, #main *, .news *').css('fontSize', '0.7em');
	});
	$('.mediumFont a').click(function(){
		$('#lid *, #main *, .news *').css('fontSize', '.85em');
	});

	$('.bigFont a').click(function(){
		$('#lid *, #main *, .news *').css('fontSize', '1.2em');
	});



// rozwijane menu



	$('.lvl2').hide();

	$('.hit .lvl2').show();



	$('.lvl1 > li > a').css('cursor', 'pointer');



	$('.lvl1 li').click(function(){

		$('li .lvl2').not(this).slideUp();

		$(this).find('.lvl2').slideToggle();

	});



// search input val



	searchVal = $('#search input').val();



	$('input').click(function(){

		$(this).val("");

	});



	$('input').blur(function(){

		if($(this).val() == "") {

			$(this).val(searchVal);

		}

	});



// Slideshow



	if($('#slideshow').length > 0) {

		$.getScript('js/jquery.cycle.all.min.js', function(){

			$('#slideshow').cycle({

				sync: 1,

				timeout: 4000,

				speed: 1200

			});

		});

	}



// Galeria



	if ($('.gallery').length > 0) {

		$.getScript('js/jquery.prettyPhoto.js', function(){

			$("a[rel^='prettyPhoto[pp_gal]']").prettyPhoto({

				theme: 'light_rounded'

			});

		});

	}



// Form validate



			$('#error').hide();

			$('form').not('#search').bind('submit', function(){

				var valid = true;

				$('.required').click(function(){

					$(this).removeClass('error-input');

				});

				$('.required').not('#subject').each(function(){

					if(($(this).val()=='') || ($('#subject').val()!='')){

						$(this).addClass('error-input');

						 valid = false;

					}else{

						$(this).removeClass('error-input');

					}

				});

				if(!valid){

					$('#error').fadeIn();

					return false;

				}

			});



	// jquery form



		if($('form').length > 0) {

			$.getScript('js/jquery.form.js', function(){

				$('form').not('#search').ajaxForm(function(){

					if($('#error').is(':visible') == true) {

						$('#error').fadeOut(300);

						$('#ok').delay(300).fadeIn(300);

					} else {

						$('#ok').fadeIn(300);

					}



					$('input, textarea').attr('disabled', 'disabled');

				});

			});

		}





// img link anim



	$('a').not('#logo').hover(function(){

		$(this).find('img').animate({opacity: 0.7}, 'fast');

	},

	function(){

		$(this).find('img').stop(true, false).animate({opacity: 1});

	});




$('tr:even').not(':first-child').addClass('even');






}); // ready end
