window.onload = initialize;

var buttons = ['welkom', 'informatie', 'agenda', 'gastenboek', 'fotos', 'contact'];
function initialize(){
	var cookie = readCookie("style");

	var title = cookie ? cookie : getPreferredStyleSheet();
	setActiveStyleSheet(title);
}

function show_navigation(){
	for(i=0; i<buttons.length; i++){
		button = $('nav_' + buttons[i]);
		
		to = 0.7;
		if(button.className == 'active'){
			line = document.createElement('div');
			button.appendChild(line);
			
			window.setTimeout(function(){
				new Effect.Morph(line, {style: 'width: 100%;'});
			}, (i*200)+600);
			
			to = 1;
		}
	
		window.setTimeout('new Effect.Appear("nav_' + buttons[i] + '", {to: ' + to + ', duration: 0.7});', i*200);
	}
}

function addcodetofunction(func,code){
	if(func == undefined){
		return code;
	} else {
		return function(){
			func();
			code();
		}
	}
}