$(document).ready(function() {

//fadeThis
	  $('.fadeThis').append('<span class="hover"></span>').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(400, 1);
	  }, function () {
	    $span.stop().fadeTo(400, 0);
	  });
	});
	  

//show-hide 
var toggled=false;
  $('.close').click(function(){
  	$('#more-info div.big-box').hide(0);
	toggled=false;
  });
  
  $('#more-info div.big-box').toggle(0);
  $('.tutaj a').click(function(e){
		$('#more-info div.big-box').hide(0);
		if(toggled!=this.id)
		{	$('#'+this.id+'_more').toggle(400);
			toggled = this.id;
		}
		else
		{	$('#'+this.id+'_more').toggle(400);
			toggled = false;	
		}
	});
  
//kursy, publikacje
	$('div.more:eq(0)> div').hide();
	$('div.more:eq(0)> h3.more').click(function() {
	$(this).next().slideToggle('slow');
		});
		


//fancy zoom
    $('a.zoom').fancyZoom({closeOnClick: true});
	$('a.zoom-rejestracja').fancyZoom();

});




/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc. 
***/

function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});





