var debug=0;		/*	debug = 1 - komunikaty włączone   debug = 0 - komunikaty wyłączone */
var nr_obrazka=4;
var delay=1200;

function ChangePicture(Pict_nr) {
if(debug) window.alert("Funkcja ChangePicture wywołana !");

document.getElementById('table_left').style.backgroundImage = "url(images/" + Pict_nr + "_lewa_photo.jpg)";
document.getElementById('top').style.backgroundImage = "url(images/" + Pict_nr + "_main_photo.jpg)";
document.getElementById('table_right').style.backgroundImage = "url(images/" + Pict_nr + "_prawa_photo.jpg)";

$('#table_left, #table_right, #top').animate({opacity: 1.0}, delay);

setTimeout(function() {
			if (++nr_obrazka > 4) nr_obrazka=1;
			AnimateHeader();
						}, 5000+delay);

return;
}
    
function AnimateHeader() {
if(debug) window.alert("Skrypt AnimateHeader wystartował !");

$('#table_left, #table_right, #top').animate({opacity: 0.05}, delay);

setTimeout(function() {
			if(debug) window.alert("1200ms Po wywołaniu funkcji ChangePicture !");
			ChangePicture(nr_obrazka);
						}, delay);						
return;
}    
     

/* window.onload=Initiation;	*/
window.onload=AnimateHeader;



