function getRandomNum(lbound, ubound) {
	return (Math.floor(Math.random() * (ubound - lbound)) + lbound);
}
var newnr=getRandomNum(1,11);
var oldnr=newnr;
function randomon() {
	pics=10;
	if (newnr<=pics) {
		document.images['homepic'+oldnr].src='img/homepic'+oldnr+'_off.jpg';
		document.images['homepic'+newnr].src='img/homepic'+newnr+'_on.jpg';
		oldnr=newnr;
		newnr=getRandomNum(1,11);
	}else {
		newnr=1;
	}
}
var interval='';
window.clearInterval(interval);
interval = window.setInterval("randomon()", 2000);

function flip(nr,onoff) {
	document.images['homepic'+nr].src='img/homepic'+nr+'_'+onoff+'.jpg';
}
