
 //<![CDATA[ 
			 
  window.addEvent('domready', function() {
									   
// set up the instance
var slideshow = new SlideShow('slides',{
    delay: 6000,
    duration: 1000,
    transition: 'fadeThroughBackground',
    autoplay: true
});

// set up the instance
var ref = new SlideShow('references_slider',{
    delay: 3000,
    duration: 500,
    transition: 'fadeThroughBackground',
    autoplay: false
});


var manualPaused = false;
// add play / pause elements are hovered
var hoverEvents = {
    mouseenter: function(){ slideshow.pause(); },
    mouseleave: function(){ 
        if (!manualPaused) slideshow.play(); 
    }
};

ref.element.addEvents($merge(hoverEvents,{
    // can send transition and duration information to show methods
    click: function() { ref.showNext({transition: 'fadeThroughBackground', duration: '500'}) }
}));
$('ref_next').addEvent('click', function(){
	ref.showNext({transition: 'fadeThroughBackground', duration: '500'})	
});
$('ref_prev').addEvent('click', function(){
	ref.showPrevious({transition: 'fadeThroughBackground', duration: '500'})	
});
//$$('ul').addEvents(hoverEvents);

// create navigation controls for slideshow
var navs = $$('.tabs');
navs.each(function(element, index){
    element.addEvents({
        click: function(){
            // index of list items match index of slides
            slideshow.show(index, {transition: 'fadeThroughBackground', duration: 1000});
        },
        mouseenter: function(){
            element.tween('background-color','#fff');
        },
        mouseleave: function(){
            if (!element.hasClass('current')) 
                element.tween('background-color','#aaa');
        }
    });
});

// create navigation controls for references
var navsRef = $$('.refs');
navsRef.each(function(element, index){
    element.addEvents({
        click: function(){
            // index of list items match index of slides
            ref.show(index, {transition: 'fadeThroughBackground', duration: 1000});
        }
       /* mouseenter: function(){
            //element.tween('background-color','#b9b9b9');
        },
        mouseleave: function(){
            if (!element.hasClass('current')) 
                //element.tween('background-color','#0099FF');
        }*/
    });
});
ref.addEvent('show', function(slideData){
    // args of the show event are the previous/next slides and their index
    // again, nav index matches slide index so this is cake
    navsRef[slideData.previous.index].removeClass('current');
    navsRef[slideData.next.index].addClass('current');
});

slideshow.addEvent('show', function(slideData){
    // args of the show event are the previous/next slides and their index
    // again, nav index matches slide index so this is cake
    navs[slideData.previous.index].removeClass('current');
    navs[slideData.next.index].addClass('current');
});


$('pause').addEvent('click', function(){
    manualPaused = true;
    slideshow.pause();
});

$('play').addEvent('click', function(){
    manualPaused = false;
    slideshow.play();
});

//aktualnosci




  });
  //]]> 
