var xx=0;
var count_image=4;

function changePos() {
	for (i=1;i<=count_image;i++) {
		n = 'photo'+i;
		document.getElementById(n).style.left = parseInt(document.getElementById(n).style.left) - 2;
		if (parseInt(document.getElementById(n).style.left)==-200) document.getElementById(n).style.left=(count_image-1)*200;
	}
}

function show(n) {
	count_image = n;
	setTimeout('start()',5000);
}

function start() {
	xx=0;
	loopfunc();
	setTimeout('start()',5000);
}

function loopfunc() {
	if (xx<100) {
		changePos();
		xx++;
		setTimeout('loopfunc()',15);
	}
}