
	var ten, fps, step, pic1, pic2, imgwidth, imgmax, imgmin;
	
	function basicSetup(){
		fps = 20;
		step = 1;
		pic1H = $('#pic1')[0];
		pic2H = $('#pic2')[0];
		pic1 = pic1H.style;
		pic2 = pic2H.style;
		imgwidth = 1312; 			//$('#pic1').width(); because Google Chrome can't read width of image that was inserted by javascript ( I guess )
		imgmax = imgwidth;
		imgmin = -(imgwidth);
	}
	
	function triggerMove(){
		basicSetup();
		picturesSetup();
		ten = window.setInterval("move()",1000.0/fps);
	}
	function move(){
		if(pic1Left < imgmax && pic2Left < imgmax){
			pic1Left += step;
			pic2Left += step;
			pic1.left = pic1Left + 'px';
			pic2.left = pic2Left + 'px';
		} else {
			resetup();
		}
	}
	function resetup(){
		if(pic1Left < imgmax){
			pic1Left = imgmin;
		} else {
			picturesSetup();
		}
	}
	function stopMove(){
		ten = window.clearInterval(ten);
	}
	function pauseMove(){
		ten = window.clearInterval(ten);
	}
	function continueMove(){
		ten = window.setInterval("move()",1000.0/fps);
	}
	function picturesSetup(){
		pic1Left = 0;
		pic2Left = imgmin;
		pic1.left = pic1Left + 'px';
		pic2.left = pic2Left + 'px';
	}
	function changeLogo(){
		newimage = new Image();
		newimage.src = 'simg/logo.png';
		newimage.onload = changeLogoShow();
	}
	function changeLogoShow(){
		newcontent = '<img src="/simg/logo.png" onmouseover="pauseMove();" onmouseout="continueMove();" id="pic1" alt="Young Life Česká republika" /><img src="/simg/logo.png" onmouseover="pauseMove();" onmouseout="continueMove();" id="pic2" alt="Logo Younglife" />';
		$('#logospace').html(newcontent);
		
		triggerMove();
	}