function slideSwitch() {
    var $active = $('#slideshow div.active');

    if ( $active.length == 0 ) $active = $('#slideshow div:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow div:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function pobierz_date_rozpoczecia_kursu() { $('#zgloszenie_na_kurs_kurs_data_do').attr("value", $('#zgloszenie_na_kurs_kurs_data_od').attr("value")); }
function clean_newsletter() { document.getElementById('newsletter').value = ''; }

$(function() { 
 $('.picture-left a').lightBox({fixedNavigation:true});
 $('.picture-right a').lightBox({fixedNavigation:true});
 $('.relacje-zdjecie a').lightBox({fixedNavigation:true});
 $('.picture_galeria a').lightBox({fixedNavigation:true});
 
 setInterval( "slideSwitch()", 2500 );
});

$(document).ready(function()
{	
	$('#tabs').tabs();
	$('#nl').tabs();
	
	$("#rejsy").tablesorter({ 
         headers: { 
            5: { sorter: false }
        }
    }); 
	
	$('a#rozwin_1').click(function() { $('#pokaz_1').toggle(200); return false; });
	$('a#rozwin_2').click(function() { $('#pokaz_2').toggle(200); return false; });
}); 


Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('.tabs li a', {hover: true});
