function changebg(a,b) {
	if(a == "highlighted") {
		thisObject('home-random').style.backgroundColor = b;
	} else {
		a.style.backgroundColor = b;
	}
}
function changebg2(a,b) {
	var c = a.getElementsByTagName("li");
	for(i=0; i<c.length; i++) {
		c[i].style.backgroundColor = b;
	}	
	
}
function gotourl(a) {
	window.location=a;
}
function thisObject(id){
	// current standard for IE5+ Mozilla/NS6+
	if (document.getElementById) {
		return(document.getElementById(id));
	// IE 4 compatible
	} else if (document.all) {
		return(document.all[id]);
	} 
}
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;

window.addEvent('domready', function(){
	if(this.homes == undefined) {
		this.homes = false; 
	}
	if(this.homes == true) {
		picSwap(false);
	} else {
		numish = $random(1,7);
		$('header-foto').setStyle("background","url(img/header/foto"+numish+".jpg) top left no-repeat");
	}
});

function picSwap(num) {
	myTimer = $clear(myTimer);
	if(num == false) {
		$('swapping-header').setStyle('opacity','0');
		num = $random(1,10);
	} else { 
		$('welkom').setStyle("background","url(img/home/foto"+num+".jpg) top left no-repeat");
		num = num + 1;
		if(num > 10) {
			num = 1;
		}
	}
	$('swapping-header').setStyle('opacity','0');
	$('swapping-header').setStyle("background","url(img/home/foto"+num+".jpg) top left no-repeat");
	$('swapping-header').setStyle('display','block');
	var fx3 = $('swapping-header').effects({duration: 3000, transition: Fx.Transitions.Back.easeOut});

	fx3.start({
		'opacity': 1
	}).chain(function(){
		$('welkom').setStyle("background","url(img/home/foto"+num+".jpg) top left no-repeat");
	});

	var myTimer = picSwap.delay(5000,this,num);
}