// formding
function def(loc){
	if (loc.value == "bericht"){
		loc.value = "";
	}
}


// koekjes bakken
function setCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}


// verander fontgrootte en maak cookie
var fsize;
function fontSize(wat){

	// al geset?
	if (!fsize) fsize = 11;

	// verander
	if (wat == 0) fsize = fsize + 1;
	if (wat == 1) fsize = fsize - 1;
	if (wat == 2) fsize = 11;
	document.body.style.fontSize = fsize + "px";

	// cookie
	setCookie("font",fsize,365);
}

// cookie variabele
var bikky = document.cookie;
function getCookie(name){
	var index = bikky.indexOf(name + "=");
	if (index == -1) return null;
	index = bikky.indexOf("=", index) + 1;
	var endstr = bikky.indexOf(";", index);
	if (endstr == -1) endstr = bikky.length;
	return unescape(bikky.substring(index, endstr));
}

// paginahoogte
function loadFunc(){
	var y;
	if (self.innerHeight) y = self.innerHeight;
	else if (document.documentElement && document.documentElement.clientHeight){
		y = document.documentElement.clientHeight;
	}

	else if (document.body) y = document.body.clientHeight;

	document.getElementById("menu").style.height  = y - 252 + "px";
	document.getElementById("main").style.height  = y - 180 + "px";
	document.getElementById("shout").style.height = y - 180 + "px";
	document.getElementById("nest").style.height  = y -   3 + "px";

	// save y zodat je geen irritante popup krijgt
	setCookie("hoogte",y,365);
}

window.onload = loadFunc;
window.onresize = loadFunc;

// popups bij plaatjes
function pop(atag){
	window.open('viewpic.php?pic=' + atag.href, '_blank', 'toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=740, height=400');
	return false;
}