var $number_of_photos = 17;
var $current = Math.floor(Math.random()*$number_of_photos);

function goToImage() {
	document.getElementById("photo").style.backgroundImage="url(/pictures/home-photo-"+$current+".jpg)";
	$current += 1;
	if ($number_of_photos == $current) $current = 1;
}

function run_slideshow() {
	goToImage();
	window.setTimeout("run_slideshow()", 4000);
}