// For shadowbox configuration
Shadowbox.loadLanguage('sv', '/js/shadowbox/lang');
Shadowbox.loadSkin('classic', '/js/shadowbox/skin');

$(function(){

   // For the shadowbox on PDF files
    var boxOpts = Shadowbox.getOptions();boxOpts.ext.iframe.push('pdf');Shadowbox.init(boxOpts);

    // For the picture slideshow
    var slideshow = $('#slideshow');
	
    if( $('img',slideshow).size() > 1 ){
	
	// Appending the controls, right after the slideshow
	slideshow.after('<ul><li id="back"></li><li id="pause"></li><li id="forward"></li></ul>');

	slideshow.cycle({
	    fx:           'fade', // name of transition effect (or comma separated names, ex: fade,scrollUp,shuffle) 
	    speed:         3000,  // speed of the transition (any valid fx speed value) 
	    next:          $('li#forward'),  // selector for element to use as click trigger for next slide 
	    prev:          $('li#back'),  // selector for element to use as click trigger for previous slide 
	    startingSlide: 0     // zero-based index of the first slide to be displayed 
	    //pause:         0,     // true to enable "pause on hover" 
	});
	
	$('li#pause').click(function(){
	    var t = $(this); t.toggleClass('play');
	    if( t.hasClass('play') ){ slideshow.cycle('pause'); }
	    else { slideshow.cycle('resume'); }
	});
    }

    $("body#nyheter .news:first").css({
	borderTop:'none',
	paddingTop:0
    });

});

