jQuery(function($) {	
	Cufon.replace('.menu li a',{ hover: true});
	
	$('.gallery_news .images a').lightBox();
	
	$('.photo_rot').cycle();
	
	$('.lista a').click(function() {
		$('.lista a').removeClass('active');
		$(this).addClass('active');
		$('.list_rec, .list_new').hide();
		$('.list_'+$(this).parent().attr('class')).show();
		return false;
	})
	
	$(".zapisz").click(function() {
		$(".newsletter .form input[name=zapisz]").val(1);
		$(".newsletter form").submit();
		return false;
	})
		
	$(".wypisz").click(function() {
		$(".newsletter .form input[name=wypisz]").val(1);
		$(".newsletter form").submit();
		return false;
	})
	
	$('input.text2, textarea.text2').focus(function() {
		if ($(this).val()==$(this).attr('alt')) $(this).val('');
		if ($(this).hasClass('password') && $(this).val()=='') $(this).removeClass('pass');
	}).blur(function() {		
		if ($(this).hasClass('password') && $(this).val()=='') { $(this).addClass('pass'); $(this).val('');};
		if ($(this).val()=='') $(this).val($(this).attr('alt'));
	});	
	
	$('.contact_form').submit(function() {
		var good=true;
		$('.text2',this).each(function() {
			if ($(this).hasClass('required') && ( $(this).val()=='' || $(this).val()==$(this).attr('alt')))
				{
					$(this).addClass('error');
					good=false;
				}
				else $(this).removeClass('error');
		})
		
		return good;
	});
		
})
