/*function resizePage()
{
	document.getElementById("contentWrapper").style.minHeight = 
		document.getElementById("rightSideBar").style.height;
}*/

var request = false;
var request2 = false;
try {
	request = new XMLHttpRequest();
	request2 = new XMLHttpRequest();
} catch (trymicrosoft) {
	try {
		request = new ActiveXObject("Msxml2.XMLHTTP");
		request2 = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (othermicrosoft) {
		try {
			request = new ActiveXObject("Microsoft.XMLHTTP");
			request2 = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (failed) {
			request = false;
			request2 = false;
		}  
	}
}

var INTERVAL_GAAT_HET_DOOR = 30 * 1000;//1 * 60 * 1000; //5000
var INTERVAL_PHOTO = 15 * 1000; //3333
var INTERVAL_BUIEN = 5 * 60 * 1000; //7000
var INTERVAL_BANNER = 0;//10000;//2 * 60 * 1000;
var INTERVAL_FADE = 2500; //1500
var COOKIE_PREFIX = "cmsms_ffsv4_";
var OPT_FADE_PHOTO = true;
var OPT_FADE_STEP = 5;

if (!request)
{
//	alert("Error initializing XMLHttpRequest!");
}

function mMin(var1, var2)
{
	if (var1 > var2)
		return var2;
	else
		return var1;
}

function mMax(var1, var2)
{
	if (var1 < var2)
		return var2;
	else
		return var1;
}

function clog(msg)
{
	if (typeof(console) == 'object')
		if (console != undefined)
			if (console.log != undefined)
				console.log(msg);
}

function hovertekst2(elem, imgUrl)
{
	if (document.getElementById('lblCollectionDiv') == null)
		return;	// document is still loading, just don't do anything

	var _hoverElem = document.getElementById('_hoverElem');

	if (_hoverElem == null)
	{
		_hoverElem = document.createElement('div');
		_hoverElem.id = "_hoverElem";
		_hoverElem.style.position = "absolute";
		var ihvi = document.getElementById('inhoud_vast_inner');
		ihvi.insertBefore(_hoverElem, ihvi.firstChild);
	}

	var img = document.getElementById('_hoverImg');
	if (elem == undefined || imgUrl == undefined)
	{
//clog("clear hover label");
		_hoverElem.style.visibility = 'hidden';

		var img = _hoverElem.firstChild; //document.getElementById("iclcd" + imgUrl);
		if (img != null)
			document.getElementById('lblCollectionDiv').appendChild(img);
	}
	else
	{
//clog("set hover label: " + imgUrl);
		var img = document.getElementById("iclcd" + imgUrl);
		_hoverElem.appendChild(img);

		var offset = elem.offsetLeft;
		offset += (elem.clientWidth - _hoverElem.clientWidth) / 2 + 27;
		offset = mMax(0, offset);
		offset = mMin(900 - _hoverElem.clientWidth, offset);
		_hoverElem.style.left = offset + "px";
//		_hoverElem.style.top = (parseInt(elem.style.top) + 30) + "px";
var yh = document.getElementById('header').clientHeight;
		_hoverElem.style.top = (elem.offsetTop + 30 + 122 + yh) + "px";
		_hoverElem.style.visibility = 'visible';
//clog("offset for " + elem.id + ": " + offset);
	}
}

function initKnopTeksten()
{
	var wrapper = document.getElementById('wrapper');
	if (wrapper != null)
	{
		var lblCollectionDiv = document.createElement('div');
		lblCollectionDiv.style.display = 'none';
		lblCollectionDiv.id = 'lblCollectionDiv';
		wrapper.appendChild(lblCollectionDiv);

		var imgNames = ["start", "info", "routearchief", "agenda", "fotos", "smsservice", "links", "media", "merchandise", "forum", "gaathetdoor"];
		var img;

		var i;
		for (i = 0; i < imgNames.length; i++)
		{
			img = document.createElement('img');
			img.id = 'iclcd' + imgNames[i];
			img.src = "/cmsms/templates/FFSV4/knopteksten/" + imgNames[i] + ".png";
			lblCollectionDiv.appendChild(img);
		}
	}
}

function reloadGaatHetDoor()
{
	var url = "index.php?page=gaat-het-door-kaal";
	request2.open("GET", url, true);
	request2.onreadystatechange = reloadGaatHetDoorReady;
	request2.send(null);
}

function reloadGaatHetDoorReady()
{
	if (request2.readyState == 4)
	{
		if (request2.status == 200)
		{
			var response = request2.responseText;
			var e = document.getElementById("divGaatHetDoorSB");
			e.innerHTML = response;
		}
	}
}

function reloadBuienradar()
{
	var dbr = document.getElementById("divBrNL");
	dbr.innerHTML = '<a target="_blank" href="http://www.buienradar.nl/"><img src="http://m.buienradar.nl/?' + Math.floor(Math.random() * 100) + '" alt="Buienradar NL" /></a>';
	dbr = document.getElementById("divBrEU");
	dbr.innerHTML = '<a target="_blank" href="http://www.meteox.nl/"><img src="http://pda.meteox.nl/images.aspx?jaar=-3&amp;soort=loop3uur256&amp;' + Math.floor(Math.random() * 100) + '" alt="Buienradar EU" /></a>';
}

function nextRandomPicture()
{
	var url = "index.php?page=random-image-kaal";
	request.open("GET", url, true);
	request.onreadystatechange = nextRandomPictureReady;
	request.send(null);
}

var fIdx = 1;
function nextRandomPictureReady()
{
	if (request.readyState == 4)
	{
		if (request.status == 200)
		{
//			var oldFIdx = fIdx;
			if (OPT_FADE_PHOTO)
			{
				fIdx = fIdx % 2 + 1;
			}
//			else
//			{
//				oldFIdx = fIdx % 2 + 1;
//			}
			var response = request.responseText;
			var photoIn = document.getElementById("fotoGalleryCanvas" + fIdx);
			photoIn.innerHTML = response;
			$(function() {
				$('#fotoGalleryCanvas' + fIdx + ' a').colorbox();
			});
			setTimeout("startPhotoFadeIn();", INTERVAL_PHOTO);
		}
		else
		{
			initpic(500);
		}
	}
}

function startPhotoFadeIn()
{
	var oldFIdx = fIdx % 2 + 1;
	var photoIn = document.getElementById("fotoGalleryCanvas" + fIdx);
	var photoOut = document.getElementById("fotoGalleryCanvas" + oldFIdx);
	photoOut.style.zIndex = 1;
	photoIn.style.zIndex = 2;
	if (OPT_FADE_PHOTO)
	{
		fadeIn(photoIn.id, 0, null, "startPhotoFadeOut();");
		// niets hier!
	}
	else
	{
		photoIn.style.opacity = "1.0";
		photoIn.style.filter = "alpha(opacity=100)";
		photoIn.style.visibility = "visible";
		photoIn.style.display = "";
		photoOut.style.opacity = "0.0";
		photoOut.style.filter = "alpha(opacity=0)";
		photoOut.style.visibility = "hidden";
		photoOut.style.display = "none";
		initpic(/***INTERVAL_PHOTO***/ 0);
	}
	// niets hier!
}

function startPhotoFadeOut()
{
	var oldFIdx = fIdx % 2 + 1;
	if (OPT_FADE_PHOTO)
	{
		fadeOut("fotoGalleryCanvas" + oldFIdx, 100, 1000, "postPhotoRotate();");
		// niets hier!
	}
	else
	{
		// hier komt 'ie als het goed is nooit eens langs!
		var photoOut = document.getElementById("fotoGalleryCanvas" + oldFIdx);
		photoOut.style.opacity = "0.0";
		photoOut.style.filter = "alpha(opacity=0)";
		photoOut.style.visibility = "hidden";
	}
	// niets hier!
}

function postPhotoRotate(elemId)
{
	var currentPhoto = document.getElementById("fotoGalleryCanvas" + fIdx);
	// add hooks for decorating the currently visible element
	initpic(/***INTERVAL_PHOTO***/ 0);
}

function initpic(intrvl)
{
	setTimeout("nextRandomPicture();", intrvl);
}

function fadeOut(elementName, startOpacity, interval, callback)
{
	fade(elementName, startOpacity, interval, callback, -1);
}

function fadeIn(elementName, startOpacity, interval, callback)
{
	fade(elementName, startOpacity, interval, callback, 1);
}

function fade(elementName, startOpacity, interval, callback, direction)
{
	if (interval == undefined || interval == null)
		interval = INTERVAL_FADE;
	if (callback == undefined || callback == null)
		callback = "";
	if (direction > 0)
	{
		//startOpacity++;
		startOpacity += OPT_FADE_STEP;
	}
	else
	{
		//startOpacity--;
		startOpacity -= OPT_FADE_STEP;
	}
//clog("fade header " + elementName + ": " + startOpacity);
	var e = document.getElementById(elementName);
	if ((direction > 0 && startOpacity <= 100) || (direction < 0 && startOpacity > 0))
	{
		e.style.visibility = 'visible';
		e.style.opacity = "" + (startOpacity / 100);
		e.style.filter = "alpha(opacity=" + startOpacity + ")";
		e.style.display = "";
//clog("fade header " + elementName + ": step ready - init next step");
		setTimeout("fade('" + elementName + "', " + startOpacity + ", " + interval + ", \"" + callback + "\", " + direction + ");", interval / 100 * OPT_FADE_STEP);
		// niets hier!
	}
	else
	{
clog("fade header " + elementName + ": ready - init next rotate");
//		if (callback == "")
//			callback = "bannerRotate();";
		if (direction > 0)
		{
			e.style.opacity = "1.0";
			e.style.visibility = "visible";
			e.style.filter = "alpha(opacity=100)";
			e.style.display = "";
		}
		else
		{
			e.style.opacity = "0.0";
			e.style.visibility = "hidden";
			e.style.filter = "alpha(opacity=0)";
			e.style.display = "none";
		}
		if (!(callback == "" || callback == null))
		{
			//setTimeout(callback, 1 /*interval*/);
			eval(callback);
		}
	}
	// niets hier!
}

function getRandomBackground2()
{
	//return "banner0" + Math.floor(Math.random() * 9) + ".jpg";
	return "banner10.jpg";
}

function getRandomBackground()
{
	var urls = ["banner_home_03.jpg"
				, "banner_skatergroep_03.jpg"
				, "banner_skates_03.jpg"
//				, "banner_skyline_03.jpg"
//				, "banner_wereldbol_03.jpg"
				, "banner_zonsondergang.jpg"
//				, "banner_prikbord.jpg"
//				, "banner_groeninga.jpg"
//				, "banner_luchtfoto.jpg"
//				, "banner_bedumvaart.jpg"
//				, "banner_koninginnedag.jpg"
				, "banner_buggies.jpg"
//				, "banner_oversteek.jpg"
				, "banner_plantsoen.jpg"
//				, "banner_skates_02.jpg"
				, "banner_blockers.jpg"
				, "banner_skatergroep_02.jpg"
//				, "banner_skates_01.jpg"
//				, "banner_skatergroep_01.jpg"
//				, "banner_2s9c7b9.jpg"
	];
	return urls[Math.floor(Math.random() * urls.length)];
}

var bOnTop = 1;
function bannerRotate()
{
	var headerIn;
	var headerOut;
	if (bOnTop == 1)
	{
		headerOut = document.getElementById('header_banner_container1');
		headerIn = document.getElementById('header_banner_container2');
	}
	else
	{
		headerIn = document.getElementById('header_banner_container1');
		headerOut = document.getElementById('header_banner_container2');
	}
	bOnTop = (bOnTop + 1) % 2;

	var url = getRandomBackground2();
	if (headerIn.style.background.toString().indexOf(url) >= 0)	// geen while loop (indien er maar 1 element is, loopt het vast)
		url = getRandomBackground2();
	var urlbg = "url(/cmsms/templates/FFSV4/banners2/" + url + ")"
	setCookie(COOKIE_PREFIX + "banner", url);
	setCookie(COOKIE_PREFIX + "banner_time", new Date().getTime());

clog("fade " + headerIn.id + " into: " + url);
	headerIn.style.background = urlbg;
	headerIn.style.opacity = "0.0";
	headerIn.style.filter = "alpha(opacity=0)";
	headerIn.style.zIndex = "2";
	headerOut.style.zIndex = "1";
	// fadeIn(headerIn.id, 0, null, "bannerRotate();");
	fadeIn(headerIn.id, 0, null, "bannerRotateCallback();");
}

function bannerRotateCallback()
{
	if (INTERVAL_BANNER > 0)
		setTimeout('bannerRotate();', INTERVAL_BANNER);
}

var msgNode;
var msgParentNode;
function popopenDiv(elemID)
{
	msgNode = document.getElementById(elemID);
	msgParentNode = msgNode.parentNode;
	var fuzzB = document.getElementById("fuzzMsgBox");
	fuzzB.appendChild(msgNode);
	if ($("#fuzz") != null)
		$("#fuzz").fadeIn();
}

/*function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}*/

function initMsgBoxes()
{
	//Adjust height of overlay to fill screen when page loads
	$("#fuzz").css("height", $(document).height());

	//When the message box is closed, fade out
	$("a.close").click(function(){
		$("#fuzz").fadeOut();
		msgParentNode.appendChild(msgNode);
		return false;
	});
  
	//Adjust height of overlay to fill screen when browser gets resized
	$(window).bind("resize", function(){
		$("#fuzz").css("height", $(document).height());
	});
}

function initAllOnLoad()
{
	var rsb = document.getElementById('rightSideBar');
	if (rsb != null)
	{
		if (request)
		{
			initpic(/***INTERVAL_PHOTO***/ 0);
		}
		//setTimeout("reloadBuienradar();", INTERVAL_BUIEN);
		setInterval("reloadBuienradar();", INTERVAL_BUIEN);
		if (request2)
		{
			setInterval("reloadGaatHetDoor();", INTERVAL_GAAT_HET_DOOR);
		}
	}
	initKnopTeksten();
	var interval = INTERVAL_BANNER;
	//if (interval > 0)
	{
		var prevBnrTime = parseInt(getCookie(COOKIE_PREFIX + "banner_time"));
		clog("cookie sez bnr time: " + prevBnrTime);
		if (prevBnrTime != null && prevBnrTime > 0)
		{
			var currentTime = new Date().getTime();
			interval = currentTime - prevBnrTime;
			clog("seconds to go: " + ((INTERVAL_BANNER - interval) / 1000));
			if (interval > INTERVAL_BANNER)
			{
				interval = 1;
			}
		}
		if (document.getElementById('header_banner_container1') != null)
			setTimeout("bannerRotate();", interval);
	}

	//var x = document.getElementById('samen').offsetHeight;
	//document.getElementById('left').style.height = '' + x + 'px';
	//document.getElementById('right').style.height = '' + x + 'px';

	var e_ivi = document.getElementById('inhoud_vast_inner');
	if (e_ivi != null)
	{
		var HEIGHT = 825 - document.getElementById('header').clientHeight;//510;
		e_ivi.style.minHeight = HEIGHT + 'px';
		if (rsb != null)	// in case of the forum, this isn't included
		{
			if (rsb.style.position == 'absolute')	// don't when floaty
			{
				e_ivi.style.minHeight = mMax(rsb.clientHeight + 28, HEIGHT) + 'px';
				$("#rightSideBar").bind("resize", function(){
					$('#inhoud_vast_inner').css("height", mMax($("#rightSideBar").height() + 28, HEIGHT));
				});
			}
		}
	}

	try {
		initMsgBoxes();
	} catch (e) {
		alert(e);
	}
}

var hideFloatyTimeout = null;
function popopenGaatHetDoor()
{
	if (navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf("MSIE 7.0") > -1)
		return true;

	if (hideFloatyTimeout != null)
		clearTimeout(hideFloatyTimeout);

	var doloop = false;
	var flashies = new Array();
	flashies[0] = "het gaat door.swf";
	flashies[1] = "gaat niet door.swf";
	flashies[2] = "nog niet bekend.swf";
	flashies[3] = "winterstop.swf";
	var elem = document.getElementById('ffsGHDSdiv');
	if (elem != null)
	{
		var status = parseInt(elem.innerHTML);
		if (gup("status") != "")
			status = parseInt(gup("status"));
		var flashy = '/cmsms/templates/FFSV4/flash/' + flashies[status];
		//var factor = 3 / 4;
		var factor = 1
		var owidth = 600;
		var oheight = 200;
		//var iHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + (owidth * factor) + '" height="' + (oheight * factor) + '" id="thea" align="middle" ><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="' + flashy + '" /><param name="loop" value="' + (doloop ? "true" : "false") + '" /><param name="menu" value="false" /><param name="quality" value="medium" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="' + flashy + '" loop="' + (doloop ? "true" : "false") + '" menu="false" quality="medium" wmode="transparent" bgcolor="#ffffff" width="' + (owidth * factor) + '" height="' + (oheight * factor) + '" name="thea" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
		var iHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="thea" align="middle" ><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="' + flashy + '" /><param name="loop" value="' + (doloop ? "true" : "false") + '" /><param name="menu" value="false" /><param name="quality" value="medium" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="' + flashy + '" loop="' + (doloop ? "true" : "false") + '" menu="false" quality="medium" wmode="transparent" bgcolor="#ffffff" width="100%" height="100%" name="thea" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
		//var iHTML = '<img src="templates/FFSV4/images/status_stop.png"/>'
		var flashbanner = document.getElementById('flashbanner');
		var floaty = document.getElementById('floaty');
		if (flashbanner == null) //(floaty == null)
		{
			flashbanner = document.createElement('div');
			flashbanner.id = "flashbanner";
			flashbanner.style.position = "absolute";
			flashbanner.style.top = "0";
			flashbanner.style.left = "0";
			flashbanner.style.right = "0";
			flashbanner.style.bottom = "0";
			flashbanner.style.opactiy = "1.0";
			flashbanner.style.filter = "alpha(opacity=100)";
			var header = document.getElementById('header');
			header.appendChild(flashbanner);
			
			var fbg = document.createElement('div');
			fbg.style.position = 'absolute';
			fbg.style.top = "0";
			fbg.style.right = "0";
			fbg.style.zIndex = "4";
			fbg.style.height = "179px";
			fbg.style.width = (owidth/* * factor*/ + 4) + "px";//"604px";
			fbg.style.background = "#000";
			fbg.style.opacity = "0.4";
			fbg.style.filter = "alpha(opacity=40)";
			fbg.className = "floatyDiv";
			//var header = document.getElementById('header');
			//header.appendChild(fbg);
			flashbanner.appendChild(fbg);

			var www = 280;// + (owidth * (1 - factor));
			var step = 7;
			step = www / 40
			var op;
			var tfbg;
			for (var x = 0; x < www; x += step)
			{
				tfbg = document.createElement('div');

				tfbg.style.position = 'absolute';
				tfbg.style.top = "0";
				tfbg.style.left = x + "px";
				tfbg.style.zIndex = "4";
				tfbg.style.height = "179px";
				tfbg.style.width = step + "px";
				tfbg.style.background = "#000";
				op = 1 / 10 * 4 / 284 * x;
				tfbg.style.opacity = op;
				tfbg.style.filter = "alpha(opacity=" + Math.round(op * 100) + ")";
				tfbg.className = "floatyDiv";
				//var header = document.getElementById('header');
				//header.appendChild(tfbg);
				flashbanner.appendChild(tfbg);

//				fbg.style.opacity = op;
//				fbg.style.filter = "alpha(opacity=" + Math.round(op * 100) + ")";
			}

			floaty = document.createElement('div');
			floaty.style.position = 'absolute';
			floaty.style.top = (-18 + ((oheight / 2) - (oheight * factor / 2))) + "px";
			floaty.style.right = 10 /*+ (owidth / 2 - (owidth * factor / 2))*/ + "px";
			floaty.style.height = (oheight * factor) + "px";
			floaty.style.width = (owidth * factor) + "px";
			floaty.style.zIndex = "5";
			floaty.id = "floaty";
			floaty.className = "floatyDiv";
		}
		floaty.innerHTML = iHTML;
		//var header = document.getElementById('header');
		//header.appendChild(floaty);
		flashbanner.appendChild(floaty);
		hideFloatyTimeout = setTimeout("hideFloatyGaatHetDoor()", 7000);
	}
	return false;
}

// http://daniel.glazman.free.fr/weblog/newarchive/2003_06_01_glazblogarc.html#s95320189
document.getElementsByClassName = function(needle) {
	var xpathResult = document.evaluate('//*[@class = needle]', document, null, 0, null);
	var outArray = new Array();
	while ((outArray[outArray.length] = xpathResult.iterateNext())) {
	}
	return outArray;
}

// http://www.dustindiaz.com/add-and-remove-html-elements-dynamically-with-javascript/
document.removeElement = function removeElement(divNum) {
	var olddiv;
	if (typeof divNum == 'string')
		olddiv = document.getElementById(divNum);
	else
		olddiv = divNum;
	olddiv.parentNode.removeChild(olddiv);
}

function hideFloatyGaatHetDoor()
{
	fadeOut("flashbanner", 100, 1000, "hideFloatyGaatHetDoorReady();");
	//$("#flashbanner").fadeOut();
	//hideFloatyGaatHetDoorReady();
}
function hideFloatyGaatHetDoorReady()
{
/*	var elems = document.getElementsByClassName("floatyDiv");
	for (var elem in elems)
	{
		document.removeElement(elems[elem]);
	}*/
	hideFloatyTimeout = null;
	var node = document.getElementById('flashbanner');
	node.parentNode.removeChild(node);
}

// http://www.netlobo.com/url_query_string_javascript.html
function gup(name)
{
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	var regexS = "[\\?&]"+name+"=([^&#]*)";
	var regex = new RegExp( regexS );
	var results = regex.exec( window.location.href );
	if( results == null )
		return "";
	else
		return results[1];
}

function aankledingKoninginnedag()
{
	var parentdiv = document.getElementById('samen');

	var kroonlinks = document.createElement('div');
	kroonlinks.innerHTML = '<img src="/cmsms/templates/FFSV4/koninginnedag/kroontje1.png" alt="Kroon" />';
	kroonlinks.style.position = "absolute";
	kroonlinks.style.left = "-50px";
	kroonlinks.style.top = "10px";
	kroonlinks.style.zIndex = "100";
	parentdiv.appendChild(kroonlinks);

	var kroonrechts = document.createElement('div');
	kroonrechts.innerHTML = '<img src="/cmsms/templates/FFSV4/koninginnedag/kroontje2.png" alt="Kroon" />';
	kroonrechts.style.position = "absolute";
	kroonrechts.style.right = "-50px";
	kroonrechts.style.top = "10px";
	kroonrechts.style.zIndex = "100";
	parentdiv.appendChild(kroonrechts);

	var vlaglinks = document.createElement('div');
	vlaglinks.innerHTML = '<img src="/cmsms/templates/FFSV4/koninginnedag/vlag2.png" alt="Vlag" />';
	vlaglinks.style.position = "absolute";
	vlaglinks.style.left = "577px";
	vlaglinks.style.top = "102px";
	vlaglinks.style.zIndex = "100";
	parentdiv.appendChild(vlaglinks);

	var vlagrechts = document.createElement('div');
	vlagrechts.innerHTML = '<img src="/cmsms/templates/FFSV4/koninginnedag/vlag1.png" alt="Vlag" />';
	vlagrechts.style.position = "absolute";
	vlagrechts.style.left = "621px";
	vlagrechts.style.top = "106px";
	vlagrechts.style.zIndex = "100";
	parentdiv.appendChild(vlagrechts);
}

//window.onload = initAllOnLoad;
addLoadEvent(initAllOnLoad);

if (true)
{
	var nu = new Date();
	if ((nu.getMonth() == 3 && nu.getDate() >= 28) || (nu.getMonth() == 4 && nu.getDate() < 2))
	{
		addLoadEvent(aankledingKoninginnedag);
	}
}
