// head

// funkacja do otwierania okien z zawartosci html
// wywolanie: javascript:displayWindow('plik.html',637szerokosc,500wysokosc)

function displayWindow(url, nazwa, wys, szer, proc) {

	if (proc==1) {
			 var width = window.screen.width * szer/100;
			 var height = window.screen.height * wys/100;
		}
		else {
			 var width =  szer;
			 var height =  wys;

		}

		var okno = window.open(url, nazwa, 'width=' + width + 'px,height=' + height + 'px,resizable=1,scrollbars=yes,menubar=yes');
	}


/***
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitch() {
    var $active = $('#slide IMG.active');

    if ( $active.length == 0 ) $active = $('#slide IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next('img').length ? $active.next('img')
        : $('#slide IMG:first');

    /*
     * 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}, 1500, function() {
            $active.removeClass('active last-active');
        });
}

function slideSwitchOff() {
	clearInterval();
}


function slideSwitchOn() {
	setInterval( "slideSwitch()", 8000 );
}


$(function() {
	slideSwitchOn();
});


