
function endisable( ) {
	if (document.forms['formularz'].elements['role'].value == '2') {
		document.forms['formularz'].elements['label'].disabled = false;
		document.forms['formularz'].elements['label'].className = 'odblokowane';
	}else {
		document.forms['formularz'].elements['label'].disabled = true;
		document.forms['formularz'].elements['label'].className = 'zablokowane';
		document.forms['formularz'].elements['label'].value = ''; 
	}
}

var i;
function showHide(){				
	if(document.getElementById('next').checked){
	    document.getElementById('nextform').style.visibility = 'visible';
	}else{
	    document.getElementById('nextform').style.visibility = 'hidden';
	}
}


$(document).ready(function(){
	$("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("distabled", 5000, true);
	
	$(".specialShowBox dl a.show-1").click( function() {
		$(".show-1-1").fadeIn(900);
	});
	$(".specialShowBox dl a.show-2").click( function() {
		$(".show-2-2").fadeIn(900);
	});
	$(".specialShowBox dl a.show-3").click( function() {
		$(".show-3-3").fadeIn(900);
	});
	$(".specialShowBox dl a.show-4").click( function() {
		$(".show-4-4").fadeIn(900);
	});
	$(".specialShowBox dl a.show-5").click( function() {
		$(".show-5-5").fadeIn(900);
	});
	$(".specialShowBox dl a.show-6").click( function() {
		$(".show-6-6").fadeIn(900);
	});
	$(".specialShowBox dl a.show-7").click( function() {
		$(".show-7-7").fadeIn(900);
	});
	$(".specialShowBox dl a.show-8").click( function() {
		$(".show-8-8").fadeIn(900);
	});
	$(".specialShowBox dl a.show-9").click( function() {
		$(".show-9-9").fadeIn(900);
	});
	$(".specialShowBox dl a.show-10").click( function() {
		$(".show-10-10").fadeIn(900);
	});
	
	$(".close").click( function() {
		$(".specialShowBox dl div").fadeOut(900);
	});
	
	$('.datepicker').datepicker({ 
		dateFormat: 'yy-mm-dd',
		dayNamesMin: ['Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'Sb', 'Nd'],
		monthNames: ['Styczeń', 'Luty', 'Marzec', 'Kwiecień', 'Maj', 'Czerwiec', 'Lipiec', 'Sierpień', 'Wrzesień', 'Październik', 'Listopad', 'Grudzień']
	});
		
	//gallery
	$('.gallery photos-list a,.newsBoxLeft a').fancybox({
		'zoomSpeedIn'			: 600,
		'zoomSpeedOut'			: 500,
		'easingIn'				: 'easeOutBack',
		'easingOut'				: 'easeInBack',
		'imageScale'			: true,
		'titleShow'				: true,
		'title'					: 'title'

	});
	
	$('a.zoom').fancybox({
		'zoomSpeedIn'			: 600,
		'zoomSpeedOut'			: 500,
		'easingIn'				: 'easeOutBack',
		'easingOut'				: 'easeInBack',
		'imageScale'			: true,
		'titleShow'				: true

	});
	
	$('input.suggest').each(function() {
		var $this = $(this);
		$this.suggest_ext(base_uri+'ajax/suggest', {
			minchars: 3
		});
	});
	
	//fb
	$('#fb').each(function() {
		var $this = $(this);
		var in_motion = false;
		$this.hover(function() {
			if (!in_motion) {
				in_motion = true;
				$this.animate({right: '0px'}, 750, function() {
					in_motion = false;
				});
			}
		}, function() {
			$this.animate({right: '-300px'}, 750, function() {
			});
		});
	});
	
});

