$(document).ready(function(){
	
	$('#lang li a img').css('opacity',0.3);
	$('#lang li a:not(.active)').hover(function(){
		$(this).find('img').css('opacity',1);	
	}, function(){
		$(this).find('img').css('opacity',0.3);
	});
	
	$('#lang li a.active img').css('opacity',1);
	
	Cufon.replace('h1:not(.noCufon)')('h2:not(.noCufon)')('h3:not(.noCufon)')('.cufonik');
	Cufon.replace('.button, .linkButton, #menu li a', {
		textShadow: '1px 1px #012B09'
	});
	Cufon.replace('ul.menuTabs li', {
		hover: true
	});

	$('.publikacje > div.mainContentBox').hide();
	$('.publikacje h2').toggle(function(){
		$(this).addClass('active');
		$(this).next('div.mainContentBox').slideDown();
	},function(){		
		$(this).removeClass('active');	
		$(this).next('div.mainContentBox').slideUp();
	});
	
	$('.archiwumList div.desc').hide();
	$('.archiwumList h3').toggle(function(){
		$(this).parent().addClass('active');
		$(this).next('div.desc').slideDown();
	},function(){		
		$(this).parent().removeClass('active');	
		$(this).next('div.desc').slideUp();
	});
	if ($('#newsletter_form').length) $('#newsletter_form').validate();
	
	/*
	$('#header #slider').nivoSlider({
        effect:'fade',
        animSpeed: 1500,
        pauseTime: 6000,
        startSlide: 0,
        directionNav: false,
        controlNav: false,
        controlNavThumbs: false,
        keyboardNav: true,
        pauseOnHover: false,
        manualAdvance: false,
    });
    */
    if ($("#slogan").length)
    {
    	$("#slogan").flash({
	        src: 'swf/top.swf',
	        id: 'slog',
	        wmode: 'transparent',
	        width: 762,
	        height: 120 },
	        { version: 8 }
	    );
    }
    
    if ($("#slogan_sub").length)
    {
    	$("#slogan_sub").flash({
	        src: 'swf/top2.swf',
	        id: 'slog',
	        wmode: 'transparent',
	        width: 762,
	        height: 120 },
	        { version: 8 }
	    );
    }
    
    
    if ($("#slider").length)
    {
    	$("#slider").flash({
	        src: 'swf/slider.swf',
	        id: 'sliderFlash',
	        wmode: 'transparent',
	        width: 966,
	        height: 213 },
	        { version: 8 }
	    );
    }
    
    if ($("#slider_sub").length)
    {
    	$("#slider_sub").flash({
	        src: 'swf/slider2.swf',
	        id: 'sliderFlash',
	        wmode: 'transparent',
	        width: 966,
	        height: 213 },
	        { version: 8 }
	    ); 
    }
	
});

