var t;
var h;
//het menu uitklappen
function showsubmenu(x){
	//timeout stoppen om onverwacht inklappen te voorkomen	
	clearTimeout(t);
	//andere nog open menu's direct inklappen
	var g = document.getElementById("nav").getElementsByTagName('ul');
	for (h=0; h < g.length; h++){
		document.getElementById("nav").getElementsByTagName('ul')[h].style.display='none';
		document.getElementById("nav").getElementsByTagName('ul')[h].parentNode.style.zIndex=1;
		document.getElementById("nav").getElementsByTagName('ul')[h].parentNode.style.background="url('flevosite_files/menu.gif')";
	}
	//dit menu uitklappen
	x.getElementsByTagName("ul")[0].style.display="inline";
	x.style.background="#6E6EE5";   
	x.style.zIndex=5;
}
//het menu inklappen
function hidesubmenu(x){
	var g = document.getElementById("nav").getElementsByTagName('ul');
	t = setTimeout(function(){
		for (h=0; h < g.length; h++){
			document.getElementById("nav").getElementsByTagName('ul')[h].style.display='none';
			document.getElementById("nav").getElementsByTagName('ul')[h].parentNode.style.zIndex=1;
			document.getElementById("nav").getElementsByTagName('ul')[h].parentNode.style.background="url('flevosite_files/menu.gif')";
		}
	},200);
}
// einde dropdownmenu //

//lightbox//
var shadow, lightbox; 
shadow = document.createElement("div");
shadow.className="shadow";	
shadow.onclick=closePic;
lightbox = document.createElement("div");
lightbox.className = "lightbox";
if (navigator.appVersion.search("MSIE 6.0")!=-1)
{
	shadow.style.position="absolute";
	shadow.style.height=1500;
	lightbox.style.position="absolute";
}
function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}
function lightbox_position() 
{
	if (f_clientHeight() < 600) 
	{
		lightbox.style.position='absolute';
		lightbox.style.top=f_scrollTop()+40 +'px';
	}
	else 
	{
		lightbox.style.position='fixed';
		lightbox.style.top='80px';
	}
}
//einde lightbox//

//foto's//
function openPic(x,y,z){
	lightbox_position()
	var inhoud;
	if (y.length > 62){yt=y.slice(0,60)+"...";}
	else {yt=y;}
	inhoud = "<div class=\"lightboxheader\"> Afbeelding: <b>"+yt+"</b> <img src=\"flevosite_files/cross.png\" onclick=\"closePic()\" /></div>";
	if (x.match("http://")){inhoud += "<img src=\"" + x + "\" alt=\"afbeelding\" onclick=\"closePic()\"><br /> ";}
	else{inhoud += "<img src=\"/picture/" + x + "\" alt=\""+y+"\" title=\""+y+"\" onclick=\"closePic()\"><br /> ";}
	if (z != '' && z != undefined && z != false){
	inhoud += z;
	}
	else {inhoud += "<p>klik op de afbeelding om te sluiten</p>";}
	lightbox.innerHTML = inhoud;
	document.body.appendChild(shadow);
	document.body.appendChild(lightbox);
}
function openMovie(x){
	lightbox_position()
	var inhoud;
	inhoud = "<div class=\"lightboxheader\"> Youtube-filmpje <img src=\"flevosite_files/cross.png\" onclick=\"closePic()\" /></div>";
	inhoud += '<br><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/' + x + '&hl=nl&fs=1&rel=0&color1=0x2b405b&color2=0x6b8ab6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + x + '&hl=nl&fs=1&rel=0&color1=0x2b405b&color2=0x6b8ab6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object><br /> ';
	inhoud += "<p><span onclick='closePic()' style='cursor:pointer'>klik hier om te sluiten</span></p>";
	lightbox.innerHTML = inhoud;
	shadow.onclick='';
	document.body.appendChild(shadow);
	document.body.appendChild(lightbox);
}
function closePic(){
	document.body.removeChild(shadow);
	document.body.removeChild(lightbox);
}
function mouseover(y) {
	y.style.border="1px inset #6565C4";
}
function mouseout(y) {
	y.style.border="1px outset #6565C4";
}
//einde foto's//
function promtMessage(x){
var test = document.createElement("div")
test.innerHTML = x;
test.className='message';
test.onclick=function(){this.style.display="none"};
document.body.insertBefore(test,document.getElementsByClassName('container')[0])
}
function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}
function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
}
function deleteFEUCookie()
{
	if ( getCookie("feu_sessionid") ) 
	{
		setCookie("feu_sessionid","",-1)
		if ( !getCookie("feu_sessionid") ) 
		{
			alert("Cookie verwijderd. Probeer het nog eens")
		}
		else 
		{
			alert("mislukt")
		}
	}
	else
	{
		alert("cookie reeds verwijderd. Probeer het nog eens")
	}
}

