$(document).ready(function() {
	
	$('ul.slidesNavigator > li:first').addClass('active');
	$('div.slidesMain').scrollable({
		vertical: true,
		speed: 400
	}).navigator('ul.slidesNavigator').autoscroll({
		interval: 5000
	});
	
	$('ul.footerPartners>   li>   a>   img:first-child').fadeOut();
	$('ul.footerPartners > li > a').hover(function() {
		$(this).find('img:first').fadeIn(200);
		$(this).find('img:last').fadeOut();
	}, function() {
		$(this).find('img:first').fadeOut();
		$(this).find('img:last').fadeIn(250);
	});
	
	$("a[href*='/dokumenty/']").addClass("doc");
	$(".articleGallery a[href*='/dokumenty/']").removeClass("doc");
	//$("a[href$='.pdf']").addClass("pdf");
	
	
	$("a[href$='png'],a[href$='jpeg'],a[href$='jpg'],a[href$='gif'],a[href$='PNG'],a[href$='JPEG'],a[href$='JPG'],a[href$='GIF']").lightBox();
	
	if( $(location).attr('href').match(/page=/) ){
		var current = $('div.pager li.current span').html();
		var url = $(location).attr('href').match(/page=(\d*)/);
		if( url != undefined ){
			if( parseInt(url[1]) > parseInt(current) ){
				window.location = $(location).attr('href').match(/^http:\/\/[^\/]*/);
			}
		}
	}

	
	$('input.innerLabel, textarea.innerLabel').each(function() {
		//$(this).attr('rel', $(this).val());
		if ($(this).val() == ''){
			$(this).val($(this).attr('rel'));
		}
	}).focus(function() {
		if ($(this).val() == $(this).attr('rel')){
			$(this).val('');
		}
	}).blur(function() {
		if ($(this).val() == ''){
			$(this).val($(this).attr('rel'));
		}
	});
	
});

