function dodaj() {

    var tytul = 'Parafia pw. Świętego Idziego w Wyszkowie';
    var adres = 'http://www.idzik.net';

    //FireFox
    if (window.sidebar) { 

        window.sidebar.addPanel(tytul, adres, ""); 

    //IE
    } else if (window.external) {

        window.external.AddFavorite(adres, tytul); 

    //Opera
    } else if (window.opera && window.print) {

        var a = document.createElement('a');
        a.setAttribute('href', adres);
        a.setAttribute('title', tytul);
        a.setAttribute('rel','sidebar');
        a.click();
    }
}

	function slideSwitch() {
    var $active = $('.flash div.active');

    if ( $active.length == 0 ) $active = $('.flash div:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('.flash div:first');

    // uncomment below to pull the divs randomly
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


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

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
} 
	$(document).ready(function(){
	if (window.external || window.sidebar || 
    (window.opera  && window.print) ) {
    	$("#hButtons .favourite a").attr("href", "javascript:dodaj()");
	}
	else {
		alert("aga");
	}
    setInterval( "slideSwitch()", 3000 );
    
    $("a[rel=lightbox]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
			
	});
	


