$(document).ready(function() {
	
	if ( $('#slideShow').length ) {
		$('#slideShow').cycle({
			fx:     'fade',
			speed:  'slow',
			timeout: 3750,
			pager:  '#slideNav'
		});
	}
	
	if ( $('#map').length ) {
		$("#lublin").hover(
		  function () {
			$('#map').css({'background-position':'0px -359px'});
		  }, 
		  function () {
			$('#map').css({'background-position':'0px 0px'});
		  }
		);
		$("#rzeszow").hover(
		  function () {
			$('#map').css({'background-position':'0px -718px'});
		  }, 
		  function () {
			$('#map').css({'background-position':'0px 0px'});
		  }
		);
	}
	
	if ( $('#contactNav').length ) {
		$('#contactDesc > div').css({'display':'none'});
		$('#contactNav ul li a').click( function(){
			var id = $(this).attr('href');
			
			$('#contactNav ul li a').removeClass('active');
			$(this).addClass('active');
			$('#contactDesc > div').css({'display':'none'});
			$(''+id+'').css({'display':'block'});
			$('html').scrollTo( {top:'600px', left:'0px'}, 800 );
			
			return false
		});
	}
	
	if ( $('a[rel="fancybox"]').length ) {
		$('a[rel=fancybox]').fancybox({
			autoScale         : false,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'titlePosition' 	: 'over',
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">Zdjęcie ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});
	}
	
});
