/*
	Autor: Grzegorz Jaworek
	E-mail: grzegorz.jaworek@gmail.com
	www: http://gjaworek.pl 
	Tel.: +48 696 818 300
*/

jQuery(document).ready(function(){
	jQuery('.totop').click(function () {
		scroll(0,0);
		return false;
	});
    jQuery('#menu li a').not('#menu li.current-cat a, #menu li.current_cat_parent a, #menu li.current_page_item a, #menu li.current_page_parent a')
        .css( {backgroundPosition: "0px 0px"} )
        .mouseover(function(){
            $(this).stop().animate({backgroundPosition:"(0px -100px)"}, {duration:500})
        })
        .mouseout(function(){
            $(this).stop().animate({backgroundPosition:"(0px -100px)"}, {duration:200, complete:function(){
                $(this).css({backgroundPosition: "0px 0px"})
            }})
        });
	jQuery('.sidebar .more').each(function () {
		link = jQuery(this).parents('.inner').children().find('.ngg-widget').children('a');
		jQuery(this).attr('href', link.attr('href').slice(0,link.attr('href').lastIndexOf('/')));
		jQuery(this).attr('title', link.attr('title'));
		link.attr('href', jQuery(this).attr('href'));
	});
});

	
function initCountdown(liftoffTime){ 
	jQuery('#countdown').countdown({
		until: liftoffTime, 
		format: 'dHM', 
		layout: '<span class="day">{dn}</span><span class="sep"> dni </span><span class="hour">{hn}</span> <span class="sep"> godzin </span><span class="hour">{mn}</span> <span class="sep">minut</span>', 
		compact: true, 
		description: ''
	});
}
