function submitquestion(f){ //check if 1 to 3 answers are valued with a 1 or a 2.
	number = 0;
	for (i = 0;i < 6;i++){
		if (f.elements[i].value != ''){
			switch (parseInt(f.elements[i].value)){
				case 1:
				case 2:
					number++;
				case 0:
					break; //everything is alright with 0, 1 and 2
				default:
					f.elements[i].select();
					f.elements[i].focus();
					alert('Vul alstublieft een 1 of een 2 in, of niets.');
					return false;
			}
		}
	}
	switch (number){
		case 1:
		case 2:
		case 3:
			return true;
		default:
			alert('Vul alstublieft bij 1 tot 3 vragen een 1 of een 2 in.');
			return false;
	}
}


fotolocation = 'img/Headshots/Grayscale/';
var timeout;
fotos2 = new Array; //this is filled with the photos in random order by loadfotoband, to copy when screen is too wide
function loadfotoband(){ //upon resize the fotoband is emptied (because of the width), so fill it again
	fotos = new String('Angelique,Beppo,Cees,Els,Floor,Hein,Jan-Piet,Jeroen,Karin,Marlies,Matthijs,Motormuis,Noelle,Dinand,Stefaan,Joost').split(',');
	fotodiv = MM_findObj('fotoband');
	fotodiv.style.width = w - 1 + 'px';
	nobr = document.createElement('NOBR');
	ipick = parseInt(Math.random() * fotos.length);
	for (i=0;i<fotos.length;i++){
		if (MM_findObj('img'+i)){ //use existing photo
			nobr.appendChild(MM_findObj('img'+i));
		}else{ //create new photo
			while (!fotos[ipick]){
				ipick = parseInt(Math.random() * fotos.length);
			}
			img = document.createElement('IMG');
			img.src = fotolocation + fotos[ipick] + '.jpg';
			img.id = 'img'+i;
			nobr.appendChild(img);
			fotos2[i] = fotos[ipick];
			fotos[ipick] = false;
		}
	}
	//load the photos twice, beyond that, black will appear in the fotoband
	for (i=fotos.length;i<2*fotos.length;i++){
		if (MM_findObj('img'+i)){ //use existing photo
			nobr.appendChild(MM_findObj('img'+i));
		}else{ //create new photo
			img = document.createElement('IMG');
			img.src = fotolocation + fotos2[i - fotos.length] + '.jpg';
			img.id = 'img'+i;
			nobr.appendChild(img);
		}
	}
	fotodiv.appendChild(nobr);
	// nobr.offsetWidth = 1897 = breedte van alle plaatjes, Firefox detecteert dit niet goed wanneer de pagina geladen wordt
	timeout = setTimeout('movefotoband();',1000);
}

var timeoutpreparetodie;
preparingtodie = false;
function stopfotoband(){
	coorX = w/2;
}
function movefotoband(){
	clearTimeout(timeout);
	if (coorXo == coorX){
		if (!preparingtodie){ // let only one timer run please
			preparingtodie = true;
			timeoutpreparetodie = setTimeout('stopfotoband();',5000); //stop after 5 seconds of no movement
		}
	}else{
		clearTimeout(timeoutpreparetodie);
		preparingtodie = false;
	}
	folks = MM_findObj('img0').parentNode; //mozilla doesn't put the children under nobr
	if (coorY < parseInt(findPosY(MM_findObj('fotoband')))+128){
		if (coorX > 2*w/3){ // moveleft
			temp = folks.childNodes[0];
			folks.removeChild[0];
			folks.appendChild(temp);
		}else if (coorX < w/3){ // moveright
			temp = folks.childNodes[folks.childNodes.length - 1];
			folks.removeChild[folks.childNodes.length - 1];
			folks.insertBefore(temp,folks.childNodes[0]);
		}
	}
	timeouttime = (parseInt(w - (Math.abs(coorX-w/2))));
	if (timeouttime < 100){ timeouttime = 100; }
	//alert(timeouttime);
	timeout = setTimeout('movefotoband();',timeouttime);
	coorXo = coorX;
}

function doenercode(which){
	which.innerHTML = which.id;
}

