sfHover = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

function cleartextfield(id){
	document.getElementById(id).value = "";
}


function activateFlash(){
	theObjects = document.getElementsByTagName("object");
	for (var i = 0; i < theObjects.length; i++) {
		theObjects[i].outerHTML = theObjects[i].outerHTML;
	}
}

function showpic(id) {
	document.middle.src=imgar[id];
	document.big.src=imgar_big[id];
	curr_img = id;
	buttonstate();
	return false;
}

function nextpic() {
	if(enable_next==true){
		next_img = curr_img+1;
		document.middle.src=imgar[next_img];
		document.big.src=imgar_big[next_img];
		curr_img = next_img;
		buttonstate();
	}
}

function prevpic() {
	if(enable_prev==true){
		next_img = curr_img-1;
		document.middle.src=imgar[next_img];
		document.big.src=imgar_big[next_img];
		curr_img = next_img;
		buttonstate();
	}
}

function buttonstate(){
	if(curr_img>=(imgar.length-1)){
		document.getElementById("buttonnext").style.display = 'none'
		enable_next = false;
	}
	else{
		document.getElementById("buttonnext").style.display = 'block'
		enable_next = true;
	}
	if(curr_img==0){
		document.getElementById("buttonprev").style.display = 'none'
		enable_prev = false;
	}
	else{
		document.getElementById("buttonprev").style.display = 'block'
		enable_prev = true;
	}
}

function verzendFoto()
{
	//var foto = document.formpasfoto.dePasfoto.value;
	document.formpasfoto.submit();
	setTimeout( 'setPhoto4()', 3000 );
}

function setPhoto3()
{
	if(document.getElementById("pasfotonaam").value!="")
	{
		document.getElementById("pasfoto2").src = 'resources/tractorfoto/'+document.getElementById("pasfotonaam").value;
		//setTimeout("shiftOpacity('pasfoto2', 500);",500);
	}
	else
	{
			setTimeout ( 'setPhoto3()', 3000 );
	}
}
function setPhoto4()
{
	document.getElementById("pasfoto2").src = 'resources/tractorfoto/'+document.getElementById("pasfotonaam").value;
}