<!--
var menutimeout_value = 500;  // milli-seconds
var menu_timeout_value = 0;
var curZIndex = 100000;

var mouseovertimeout;
var currentmenu = 0;

// prototype $() function to replace document.getElementById()
function $() {
	var elements = new Array();

	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
		element = document.getElementById(element);

		if (arguments.length == 1)
		return element;

		elements.push(element);
	}

	return elements;
}

var preload = new Array();
function preload_images() {
	for (i = 1; i <= 10; i++) {
		if ($("nav" + i) != undefined) {
			preload[i] = new Image();
			preload[i].src = $("nav" + i).src.replace("_off.", "_on.");
		}
	}
	i++;
	preload[i] = new Image();
	preload[i].src = "/images/title_nieuws_gemeente.gif";
	i++;
	preload[i] = new Image();
	preload[i].src = "/images/title_nieuws_regio.gif";
	i++;
	preload[i] = new Image();
	preload[i].src = "/images/title_nieuws_nationaal.gif";
	i++;
	preload[i] = new Image();
	preload[i].src = "/images/title_kalender.gif";
	i++;
	preload[i] = new Image();
	preload[i].src = "/images/nieuwsbrief_ja.gif";
	i++;
	preload[i] = new Image();
	preload[i].src = "/images/nieuwsbrief_nee.gif";
	i++;
	preload[i] = new Image();
	preload[i].src = "/images/icon_home_on.gif";
	i++;
	preload[i] = new Image();
	preload[i].src = "/images/icon_login_on.gif";
}
	
function mout(id) {
	if ($("submenu").style.visibility == "hidden") mout2(id);
	else mouseovertimeout = setTimeout("mout2(" + id + ")", menu_timeout_value);
}

function mout2(id) {
	if ($("nav" + id) && $("nav" + id).old_src != null) $("nav" + id).src = $("nav" + id).old_src;
	nosubmenus();
}

function mover(id, menu, obj) {
	if (mouseovertimeout) {
		clearTimeout(mouseovertimeout);
		if (currentmenu != "id") mout2(currentmenu);
	}

	if ($("nav" + id).old_src == null) {
		$("nav" + id).old_src = $("nav" + id).src;
	}

	$("nav" + id).src = $("nav" + id).old_src.replace("_off.", "_on.");

	submenus(menu, obj);

	currentmenu = id;
}

function submenus(menu, obj) {
	nosubmenus();
	blur_dropdowns();

	curZIndex++;
	$("submenuIframe").style.zIndex = curZIndex;
	curZIndex++;
	$("submenu").style.zIndex = curZIndex;

	p = getpos(obj.id)
	$("submenuIframe").style.left = p[0] + "px";
	$("submenuIframe").style.top = p[1] + (submenu[menu] == undefined || submenu[menu].length == 0 ? -1 : 0) + (navigator.appName.indexOf("Opera") != -1 || navigator.userAgent.indexOf("Chrome") != -1 ? -3 : 0) + obj.offsetHeight + "px";
	$("submenu").style.left = p[0] + "px";
	$("submenu").style.top = p[1] + (submenu[menu] == undefined || submenu[menu].length == 0 ? -1 : 0) + (navigator.appName.indexOf("Opera") != -1 || navigator.userAgent.indexOf("Chrome") != -1 ? -3 : 0) + obj.offsetHeight + "px";

	submenu_width = 0;
	
	html = "<div style=\"background-color:#c2c2c2\"><img src=\"/images/dummy.gif\" width=\"71\" height=\"1\"></div>";
	
	menu_timeout_value = 0;
	
	if (submenu[menu] != undefined) {
		links = "";
		menuitems = new Array();

		for (i = 0; i < submenu[menu].length; i++) {
			internallink = "";
			externallink = "";
			menutekst = "";
			if (menu == "sites") {
				switch(submenu[menu][i][1]) {
					case "OpenZone":
						externallink = "http://www.openzone.be";
						break;
					case "OpenVld":
						externallink = "http://www.openvld.be";
						break;
				}
			}
			if (menutekst == "")  {
				menutekst = submenu[menu][i][1];
			}
			
			if (menuitems.inArray(menutekst)) {
			} else {
				menuitems.push(menutekst);
				if (externallink != "") {
					links += "<div class=\"menuitems_off\" onClick=\"window.open('" + externallink + "')\" onMouseover=\"this.className='menuitems_on'\" onMouseout=\"this.className='menuitems_off'\" id=\"menu_item_" + i + "\"><nobr>" + menutekst +"</nobr></div>";
				} else if (internallink != "") {
					links += "<div class=\"menuitems_off\" onClick=\"location.href='" + internallink + "'\" onMouseover=\"this.className='menuitems_on'\" onMouseout=\"this.className='menuitems_off'\" id=\"menu_item_" + i + "\"><nobr>" + menutekst +"</nobr></div>";
				} else {
					links += "<div class=\"menuitems_off\" onClick=\"document.location.href='?type=" + (menu == "opinie" ? "opinie" : submenu[menu][i][2]) + (submenu[menu][i][0] != "" ? "&id=" + submenu[menu][i][0] : "") + "'\" onMouseover=\"this.className='menuitems_on'\" onMouseout=\"this.className='menuitems_off'\" id=\"menu_item_" + i + "\"><nobr>" + menutekst +"</nobr></div>";
				}
			}
		}
	
		if (links != "") {
			$("submenu").innerHTML = links;
	
			submenu_width = Math.max(141, $("submenu").offsetWidth);
	
			for (i = 0; i < submenu[menu].length; i++) {
				if ($("menu_item_" + i) != undefined) $("menu_item_" + i).style.width = submenu_width - 24  + "px";
			}
	
			html = "<table cellpadding=0 cellspacing=0 border=0>";
			html += "<TR>";
			html += "<td width=" + submenu_width + " bgcolor=#e5e5e5>";
			html += $("submenu").innerHTML;
			html += "</td>";
			html += "</tr>";
			html += "<tr>";
			html += "<td bgcolor=#022c4e><img src=\"/images/dummy.gif\" width=" + submenu_width + " height=1></td>";
			html += "</tr>"; 
			html += "</table>";
			
			menu_timeout_value = menutimeout_value;
		}
	}
	
	$("submenu").innerHTML = html;
	
	submenu_height = $("submenu").offsetHeight;
	$("submenuIframe").style.width = submenu_width + "px";
	$("submenuIframe").style.height = submenu_height + "px";
	
	$("submenuIframe").style.visibility = "visible";
	$("submenu").style.visibility = "visible";
}

function nosubmenus() {
	if ($("submenu") && $("submenu").style.visibility == "visible") {
		$("submenuIframe").style.visibility = "hidden";
		$("submenu").style.visibility = "hidden";
		$("submenuIframe").style.left = -1000 + "px";
		$("submenu").style.left = -1000 + "px";
	}
}

function blur_dropdowns() {
	els = document.getElementsByTagName("select");
	for (i = 0; i < els.length; i++) {
		els[i].blur();
	}
}

function trim(str) {
	return str.replace(/^\s+|\s+$/g, "");
}

Array.prototype.inArray = function(value) {
	for (i = 0; i < this.length; i++) {
			if (this[i] == value) return true;
	}
	return false;
};

function change_news(what) {
	$("nieuws_items_nationaal").style.display = "none";
	$("nieuws_items_gemeente").style.display = "none";
	$("nieuws_items_regio").style.display = "none";
	el = $("title_nieuwsberichten");
	if (what == "nationaal") {
		el.src = "/images/title_nieuws_nationaal.gif";
		$("nieuws_items_nationaal").style.display = "inline";
	} else if (what == "gemeente") {
		el.src = "/images/title_nieuws_gemeente.gif";
		$("nieuws_items_gemeente").style.display = "inline";
	} else if (what == "regio") {
		el.src = "/images/title_nieuws_regio.gif";
		$("nieuws_items_regio").style.display = "inline";
	}
}

function do_search(obj) {
	if (trim(obj.search_value.value) == "" || trim(obj.search_value.value) == 'zoek door de site') {
		obj.search_value.focus();
		alert("Gelieve een zoekterm in te tikken.");
		return false;
	} else if (trim(obj.search_value.value).length < 4) {
		obj.search_value.focus();
		alert("Gelieve een zoekterm van minstens 4 karakters in te tikken.");
		return false;
	} else {
		return true;
	}
/*
searchlayerpos = getpos("searchbox");
	el = $("searchbox");
	el1 = $("zoekresultaatIframe");
	el2 = $("zoekresultaat");

	curZIndex++;
	el1.style.zIndex = curZIndex;
	curZIndex++;
	el2.style.zIndex = curZIndex;

	el1.style.left = searchlayerpos[0] + 9 + "px";
	el2.style.left = searchlayerpos[0] + 9 + "px";
	el1.style.top = searchlayerpos[1] + el.offsetHeight + "px";
	el2.style.top = searchlayerpos[1] + el.offsetHeight + "px";
	
	links = "";
	for (i = 1; i <= 16; i++) {
		links += "<div style=\"width:" + 238 + "px\" class=\"searchresults_off\" onClick=\"document.location.href='#'\" onMouseover=\"this.className='searchresults_on'\" onMouseout=\"this.className='searchresults_off'\">Resultaat " + i + "</div>";
	}
	html = '<table cellpadding=0 cellspacing="0" border="0" width="240" style="border: 1px solid #d5d5d5">';
	html += '<tr>';
	html += '<td>';	
	html += links;
	html += '</td>';
	html += '</tr>';
	html += '<tr>';
	html += '<td bgcolor="#d5d5d5"><img src="/images/dummy.gif" width="1" height="1" border="0"></td>';
	html += '</tr>';
	html += '<tr height="22" bgcolor="#f2f2f2">';
	html += '<td align="right" class="allsearchresults" onClick="location.href=\'#\'">Bekijk alle zoekresultaten <img src="/images/zoek_arrow.gif" width="11" height="11" border="0" align="absmiddle"></td>';
	html += '</tr>';
	html += '</table>';
	
	el2.innerHTML = html;
	
	el1.style.height = el2.offsetHeight + "px";
	el1.style.width = el2.offsetWidth + "px";
	
	el1.style.visibility = 'visible';
	el2.style.visibility = 'visible';
*/
}

function search_clear() {
	//nosubmenus();
	el1 = $("zoekresultaatIframe");
	el2 = $("zoekresultaat");
	if (el2.style.visibility == 'visible') {
		document.searchfrm.search_value.value = 'zoek door de site';
		el1.style.visibility = 'hidden';
		el2.style.visibility = 'hidden';
	}
}

function check_email(frm) {
		el = frm.email;
		if (trim(el.value) == "" || trim(el.value) == "e-mailadres") {
			alert("Gelieve een e-mailadres in te vullen.");
			el.focus();
			return;
		}
		ajax("/includes/emailcheck.php?email=" + escape(el.value), "GET", false, false, function(h, t) {
			if (t == "false") {
					alert("Gelieve een geldig e-mailadres in te vullen.");
					el.value = "";
					el.focus();
			} else {
				frm.submit();
			}
		});
}

function check_email_add(frm, nlid) {
		el = frm.email;
		if (trim(el.value) == "" || trim(el.value) == "e-mailadres") {
			alert("Gelieve een e-mailadres in te vullen.");
			el.focus();
			return;
		}
		ajax("/includes/emailcheckadd.php?nlid=" +  escape(nlid) + "&email=" + escape(el.value), "GET", false, false, function(h, t) {
			if (t == "false") {
					alert("Gelieve een geldig e-mailadres in te vullen.");
					el.value = "";
					el.focus();
			} else {
				alert("Uw e-mailadres werd toegevoegd aan de nieuwsbrief.");				
			}
		});
}

function check_uwmening(frm) {
	with (frm) {
		if (trim(naam.value) == "" || trim(naam.value) == "uw naam" || trim(email.value) == "" || trim(email.value) == "uw e-mailadres" || trim(mening.value) == "") {
			alert("Gelieve alle velden in te vullen.");
			if (trim(naam.value) == "" || trim(naam.value) == "uw naam") naam.focus();
			else if (trim(mening.value) == "") mening.focus();
			else email.focus();
			return;
		} else {
			ajax("/includes/emailcheck.php?email=" + escape(email.value), "GET", false, false, function(h, t) {
				if (t == "false") {
						alert("Gelieve een geldig e-mailadres in te vullen.");
						email.value = "";
						email.focus();
				} else {
					frm.submit();
				}
			});
		}
	}
}

function nieuwsbrief_janee(obj) {
	curstatus = (obj.src.indexOf("_ja.") != -1 ? "ja" : "nee");
	if (curstatus == "ja") {
		obj.src = obj.src.replace("_ja.", "_nee.");
		$("l" + obj.id).className = "nieuwsbrief_txt_nee";
	} else {
		obj.src = obj.src.replace("_nee.", "_ja.");
		$("l" + obj.id).className = "nieuwsbrief_txt_ja";
	}
}

var monthlabels = new Array('januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december');
var daylabels = new Array('ma', 'di', 'wo', 'do', 'vr', 'za', 'zo');

var current_day;
var current_month;
var current_year;

function show_month(direction, public) {
	if (direction == 0) {
		current_day = today_day;
		current_month = today_month;
		current_year = today_year;
	}
		
	tmp_date = new Date(current_year, current_month + direction, 1);
	current_month = tmp_date.getMonth();
	current_year = tmp_date.getFullYear();
	
	$("monthyear_label").innerHTML = monthlabels[current_month] + " " + current_year;
	prevmonth = new Date(current_year, current_month - 1, 1);
	$("prevmonthyear_label").title = monthlabels[prevmonth.getMonth()] + " " + prevmonth.getFullYear();
	nextmonth = new Date(current_year, current_month + 1, 1);
	$("nextmonthyear_label").title = monthlabels[nextmonth.getMonth()] + " " + nextmonth.getFullYear();
	
	display_month(current_month, current_year, public);
} 

var activities;
var agenda;
function display_month(month, year, public) {
	ajax("/includes/retrieve_month.php?month=" + escape(month + 1) + "&year=" + escape(year) + "&public=" + escape(public), "GET", false, false, function(h, t) {
		// alert(h + t);
		
		now = new Date();
		cnt = 0;
		activities = new Array();
		agenda = new Array();
		e = t.split("??!!??");
		for (i = 0; i < e.length - 1; i++) {
			e2 = e[i].split("||&&||");
			activities[e2[0]] = new Array();
			for (j = 1; j < e2.length; j++) {
				activities[e2[0]].push(e2[j].split("|&|"));
				if (e2[0] >= now.getFullYear() * 10000 + (now.getMonth() + 1) * 100 + now.getDate())agenda.push(e2[j].split("|&|"));
				cnt++;
			}
		}
		
		//alert(cnt);
		tmp_date1 = new Date(year, month, 1); // first day of month
		tmp_date2 = new Date(year, month + 1, 0); // last day of month
		tmp_date3 = new Date(year, month, 0); // last day of previous month
		
		first_dow = tmp_date1.getDay();
		if (first_dow == 0) first_dow = 7;
		last_dow = tmp_date2.getDay();
		if (last_dow == 0) last_dow = 7;
		num_of_days = tmp_date2.getDate();
		
		days = new Array();
		for (i = tmp_date3.getDate() - first_dow + 2; i <= tmp_date3.getDate(); i++) days.push(i); // remaining days of last month;
		if (days.length == 0) { // no remaining days of last month) {
			for (i = tmp_date3.getDate() - 6; i <= tmp_date3.getDate(); i++) days.push(i);
		}
		for (i = 1; i <= num_of_days; i++) days.push(i); // days of current month
		for (i = 1; i <= 7 - last_dow; i++) days.push(i); // complete the last week with the first days of the next month
	
		if (days.length < 42) {
			for (j = i; days.length < 42; j++) days.push(j); // add extra days for next month if less than 6 lines
		}
		
		html = '<table cellpadding="0" cellspacing="0" border="0" width="281">';
		html += '<tr class="rp_background_gray">';
		html += '<td class="agenda_spacer_start">&nbsp;</td>';
		for (i = 0; i < daylabels.length; i++) {
			html += '<td class="' + (i == 5 || i == 6 ? 'agenda_cell_weekend ' : '') + 'agenda_cell_blue">' + daylabels[i] + '</td>';
		}
		html += '<td class="agenda_spacer_end">&nbsp;</td>';
		html += '</tr>';
		html += '<tr><td colspan="9"><img src="/images/rp_grayline.gif" width="281" height="1" border="0"></td></tr>';
		html += '<tr><td colspan="6"><img src="/images/dummy.gif" width="1" height="5" border="0"></td><td colspan="2" class="agenda_cell_weekend"><img src="/images/dummy.gif" width="1" height="5" border="0"></td><td><img src="/images/dummy.gif" width="1" height="5" border="0"></td></tr>';
		cnt = 0;
		cur_month = month - 1;
		cur_month_displaying = false;
		for (i = 0; i < days.length; i++) {
			if (days[i] == 1) {
				cur_month_displaying = !cur_month_displaying;
				cur_month++;
			}
			cur_date = new Date(year, cur_month, days[i]);
			dow = cur_date.getDay();
			if (cnt % 7 == 0 && cnt > 0) { 
				html += '<td class="agenda_spacer_end">&nbsp;</td>';
				html += '</tr>';
			}
			if (cnt % 7 == 0) {
				html += '<tr class="rp_background_transparent">';
				html += '<td class="agenda_spacer_start">&nbsp;</td>';
			}
			html += '<td class="';
			if (dow == 0 || dow == 6) html += 'agenda_cell_weekend ';
			html += 'agenda_cell_';
			if (!cur_month_displaying) html += 'gray';
			else if (year == now.getFullYear() && month == now.getMonth() && days[i] == now.getDate()) html += "selected";
			else html += "black";
			html += '"';
			if (cur_month_displaying && activities[(year * 10000) + ((month + 1) * 100) + days[i]] != undefined) html += ' style="cursor:pointer" onClick="display_day(' + days[i] + ',' + month + ',' + year + ');return false;"><a class="agenda_cell_link"';
			html += '>' + days[i] + '<';
			if (cur_month_displaying && activities[days[i]] != undefined) html += '/a><';
			html += '/td>';
			cnt++;
		}
		html += '<td class="agenda_spacer_end">&nbsp;</td>';
		html += '</tr>';
		html += '<tr><td colspan="6"><img src="/images/dummy.gif" width="1" height="5" border="0"></td><td colspan="2" class="agenda_cell_weekend"><img src="/images/dummy.gif" width="1" height="5" border="0"></td><td><img src="/images/dummy.gif" width="1" height="5" border="0"></td></tr>';
		html += '</table>';
		html += '<img src="/images/rp_whiteline.gif" width="281" height="1" border="0"><br>';
		
		$("kalender").innerHTML = html; 
		
		if (arguments.length > 1) {
			dag = 0;
			if (day_clicked) dag = today_day;
			else if (month == now.getMonth() && year == now.getFullYear()) dag = now.getDate();
			display_day(dag, month, year);
		}
		day_clicked = false;
		
		html = '<table cellpadding="5" cellspacing="0" border="0" width="281">';
		if (agenda.length == 0) {
			html += '<tr class="rp_background_transparent">';
			html += '<td><img src="/images/dummy.gif" width="14" height="1" border="0"></td>';
			html += '<td class="agenda_txt_black" style="width:247px;">Er zijn geen geplande activiteiten voor deze maand.</td>';
			html += '</tr>';
			html += '<tr class="rp_background_transparent"><td style="padding: 0px"><img src="/images/dummy.gif" width="24" height="1" border="0"></td><td style="padding: 0px"><img src="/images/dummy.gif" width="257" height="1" border="0"></td></tr>';
		} else {
			for (i = 0; i < Math.min(8, agenda.length); i++) {
				html += '<tr class="rp_background_' + (i % 2 == 0 ? "transparent" : "gray") + '" onClick="location.href=\'?type=kalender&id=' + agenda[i][1] + '&d=' + (agenda[i][0].substring(6, 8) * 1) + '&m=' + (agenda[i][0].substring(4, 6) * 1) + '&y=' + (agenda[i][0].substring(0, 4) * 1) +'&cv=a\'" style="cursor:pointer">';
				//html += '<td style="padding-top: 8px;" valign="top"><div style="background-image:url(/images/activiteit_icon.gif); background-repeat:no-repeat; background-position: top center; width:20px; height:17px;" class="content_nieuws_calendar" align="center" title="Kalender"><img src="/images/dummy.gif" width="1" height="4" border="0"><br>' + (agenda[i][0].substring(6, 8) * 1) + '</div></td>';
				html += '<td style="padding: 6px 0px 0px 10px;" valign="top"><img src="/images/activiteit_pin.gif" width="14" height="17" border="0"></td>';
				html += '<td class="agenda_txt_black" style="width:247px;">';
				html += '<b>' + (agenda[i][0].substring(6,8) * 1) + " " + monthlabels[(agenda[i][0].substring(4,6) * 1) - 1] + " " + (agenda[i][0].substring(0,4) * 1) + " </b>";
				html += (agenda[i][5] != "" ? '<span class="agenda_txt_blue">' + agenda[i][5] + '</span><br>' : (agenda[i][6] != "Partij" && agenda[i][7] != undefined && agenda[i][7] != '' ? '<span class="agenda_txt_blue">' + agenda[i][7] + '</span><br>' : '')) + agenda[i][4]
				html += '</td>';
				html += '</tr>';
				html += '<tr class="rp_background_' + (i % 2 == 0 ? "transparent" : "gray") + '"><td style="padding: 0px"><img src="/images/dummy.gif" width="24" height="1" border="0"></td><td style="padding: 0px"><img src="/images/dummy.gif" width="27" height="1" border="0"></td></tr>';
				if ((i + 1) < Math.min(8, agenda.length) || agenda.length > 0) {
					html += '<tr><td colspan="2" style="padding:0px"><img src="/images/rp_whiteline.gif" width="281" height="1" border="0"></td></tr>';
				}
			}
		}
		html += '</table>';
		//if (agenda.length > 8) {
			html += '<table cellpadding="0" cellspacing="0" border="0" width="281">';
			html += '<tr>';
			html += '<td class="rp_background_gray" width="14" rowspan="100"><img src="/images/dummy.gif" width="14" height="1" border="0"></td>';
			html += '<td class="rp_background_gray"><img src="/images/dummy.gif" width="1" height="5" border="0"><br>';
			html += '<a href="?type=kalender&m=' + (month + 1) + '&y=' + year +'&cv=a" class="more_info">Meer lokale activiteiten</a><br>';
			if (e[e.length - 1] != "") html += '<img src="/images/dummy.gif" width="1" height="5" border="0"><br><a href="' + e[e.length -1] + '?type=kalender&m=' + (month + 1) + '&y=' + year +'&cv=a" class="more_info" target="_blank">Regionale activiteiten</a><br>';
			html += '<img src="/images/dummy.gif" width="1" height="5" border="0"><br><a href="http://www.openvld.be?type=kalender&m=' + (month + 1) + '&y=' + year +'&cv=a" class="more_info" target="_blank">Nationale activiteiten</a><br>';
			html += '<img src="/images/dummy.gif" width="1" height="5" border="0"><br></td>';
			html += '</tr>';
			html += '</table>';
		//}
		
		$("overzicht_extra").innerHTML = html;
	});
}

function display_day(dag, month, year) {
	html = '';
	datum = (year * 10000) + ((month + 1) * 100) + dag;
	if (dag != 0 && activities[datum] != undefined) {
		html += '<table cellpadding="5" cellspacing="0" border="0" width="281">';
		for (i = 0; i < activities[datum].length; i++) {
			html += '<tr class="rp_background_' + (i % 2 == 0 ? "transparent" : "gray") + '" onClick="location.href=\'?type=kalender&id=' + activities[datum][i][1] + '&d=' + dag + '&m=' + (month + 1) + '&y=' + year +'&cv=k\'" style="cursor:pointer">';
			//html += '<td style="padding-top: 8px;" valign="top"><div style="background-image:url(/images/activiteit_icon.gif); background-repeat:no-repeat; background-position: top center; width:20px; height:17px;" class="content_nieuws_calendar" align="center" title="Kalender"><img src="/images/dummy.gif" width="1" height="4" border="0"><br>' + dag + '</div></td>';				
			html += '<td style="padding: 6px 0px 0px 10px;" valign="top"><img src="/images/activiteit_pin.gif" width="14" height="17" border="0"></td>';
			html += '<td class="agenda_txt_black" style="width:247px;">';
			html += '<b>' + dag + ' ' + monthlabels[month] + ' ' + year + ' </b>';
			html += (activities[datum][i][5] != "" ? '<span class="agenda_txt_blue">' + activities[datum][i][5] + '</span><br>' : (activities[datum][i][6] != "Partij" && activities[datum][i][7] != undefined && activities[datum][i][7] != '' ? '<span class="agenda_txt_blue">' + activities[datum][i][7] + '</span><br>' : '')) + activities[datum][i][4]
			html += '</td>';
			html += '</tr>';
			html += '<tr class="rp_background_' + (i % 2 == 0 ? "transparent" : "gray") + '"><td style="padding: 0px"><img src="/images/dummy.gif" width="24" height="1" border="0"></td><td style="padding: 0px"><img src="/images/dummy.gif" width="257" height="1" border="0"></td></tr>';
			if ((i + 1) < activities[datum].length) {
				html += '<tr><td colspan="2" style="padding:0px"><img src="/images/rp_whiteline.gif" width="281" height="1" border="0"></td></tr>';
			}
		}
		html += '</table>';
	}
	$("overzicht").innerHTML = html;
}

function switch_view(what) {
	if (what == "a") {
		$("title_kalender").src = "/images/title_agenda.gif";
		$("kalender").style.display = 'none';
		$("overzicht").style.display = 'none';
		$("overzicht_extra").style.display = 'inline';
		$("kalender_monthnav").style.display = 'inline';
	} else {
		$("title_kalender").src = "/images/title_kalender.gif";
		$("kalender").style.display = 'inline';
		$("overzicht").style.display = 'inline';
		$("overzicht_extra").style.display = 'none';
		$("kalender_monthnav").style.display = 'inline';
	}
}

function position_beeld_overlay() {
	el = $("beeld");
	if (el == undefined) return;
	el2 = $("beeldoverlay");
	el3 = $("beeldnavigatie");
	el_top = el.offsetHeight - el2.offsetHeight;
	el2.style.top = el_top + "px";
	el2.style.visibility = 'visible';
	el3.style.top = el_top + "px";
	el3.style.visibility = 'visible';
}

function show_login(max) {
	el = $("div_login");
	if (el.offsetHeight >= max) return;
	el.style.height = (el.offsetHeight + 2) + "px";
	setTimeout("show_login(" + max + ")", 10);
}

function hide_login(max) {
	el = $("div_login");
	if (el.offsetHeight <= max) {
		el.style.visibility = "hidden";
		return;
	}
	el.style.height = (el.offsetHeight - 2) + "px";
	setTimeout("hide_login(" + max + ")", 10);
}

function display_login() {
	el1 = $("div_login");
	el2 = $("icon_login");
	pos = getpos("div_kopstuk");
	x = pos[0] + $("div_kopstuk").offsetWidth - el1.offsetWidth + 1; 
	y = pos[1] - 1;
	el1.style.left = x + "px";
	el1.style.top = y + "px";
	if (el1.style.visibility == "hidden") {
		el1.style.height = "2px";
		el1.style.visibility = "visible";
		setTimeout("show_login(128)", 10);
		el2.src = el2.src.replace("_off", "_on");
	} else {
		setTimeout("hide_login(2)", 10);
		el2.src = el2.src.replace("_on", "_off");
	}
}

function update_pw_field(fld, what, classname, width, fld_name) {
	fld_content = ""
	fld_id = fld.id;
	if (what == "focus") {
		if (fld.type == "text") {
			fld_content = '<input type="password" id="' + fld_id + '" name="' + fld_name + '" class="' + classname + '" style="width:' + width + 'px; height:17px; border:none; background-color:transparent;" onBlur="update_pw_field(this, \'blur\', \'' + classname + '\', ' + width + ', \'' + fld_name + '\');">';
		}
	} else if (what == "blur") {
		if (trim(fld.value) == "") {
			fld_content = '<input type="text" id="' + fld_id + '" name="' + fld_name + '" value="paswoord" class="' + classname + '" style="width:' + width + 'px; height:17px; border:none; background-color:transparent;" onFocus="update_pw_field(this, \'focus\', \'' + classname + '\', ' + width + ', \'' + fld_name + '\');">';
		}
	}
	if (fld_content != "") {
		$("div_" + fld_id).innerHTML = fld_content;
		if (what == "focus") window.setTimeout(function() { $(fld.id).focus(); }, 100);
	}
}

function check_login(frm) {
	with (frm) {
		if (trim(gebruiker_naam.value) == "" || trim(gebruiker_naam.value) == "e-mailadres" || trim(gebruiker_pas.value) == "" || trim(gebruiker_pas.value) == "paswoord") {
			alert("Gelieve zowel e-mailadres als paswoord in te vullen.");
			if (trim(gebruiker_naam.value) == "" || trim(gebruiker_naam.value) == "e-mailadres") {
				gebruiker_naam.focus();
			} else {
				gebruiker_pas.focus();
			}
			return;
		}
		submit();
	}
}

function getRealLeft(el){
	xPos = $(el).offsetLeft;
	tempEl = $(el).offsetParent;
	while (tempEl != null) {
		xPos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
	}
	return xPos;
}

function getRealTop(el){
	yPos = $(el).offsetTop;
	tempEl = $(el).offsetParent;
	while (tempEl != null) {
		yPos += tempEl.offsetTop;
		tempEl = tempEl.offsetParent;
	}
	return yPos;
}

function getpos(isID){
	trueX = getRealLeft(isID);
	trueY = getRealTop(isID);
	return Array(trueX, trueY);
}

addevent(window, "load", preload_images);
addevent(window, "load", position_beeld_overlay);
addevent(document, "mouseup", search_clear);
-->