function bookmarksite(title, url, object)
{
	if (document.all && !window.opera)
	{
		window.external.AddFavorite(url, title);
		return false;
	}
	else if (window.sidebar)
	{
		window.sidebar.addPanel(title, url, "");
		return false;
	}
	else if (window.opera && window.print)
	{
		object.rel = 'sidebar';
		object.href = url;
		object.title = title;
		return true;
	}
	else
	{
		window.alert('Helaas, deze link werkt alleen in Firefox, Opera en Internet Explorer.');
		return false;
	} 
}

toon_popupmenu = false;
function popupmenu(actie) {
	if (actie == "toon") {
		toon_popupmenu = true;
	}
	else {
		toon_popupmenu = false;
	}
	statustxt(toon_popupmenu);
}

function hide_popupmenu(id) {
	if (toon_popupmenu == false) {
		viewhide(id);
	}
}

function statustxt(text) {
	e = document.getElementById("statustxt");
	if (e) e.innerHTML = text;
}

function enterSearchBox(e) {
	if (e) {
		if (e.value == "Zoekwoorden...") {
			e.value = "";
			e.style.color = "#000000";
		}
	}
}
function exitSearchBox(e) {
	if (e) {
		if (e.value == "") {
			e.value = "Zoekwoorden...";
			e.style.color = "#cccccc";
		}
	}
}

function fotopopup(foto) {
	url = "popup.php?p=fotopopup&foto=" + foto;
	topentwelonlinepopup = window.open(url, "topentwelonlinepopup", "width=790,height=600,scrollbars=yes,resizable=yes");
	topentwelonlinepopup.focus();
}
function nieuwsfotopopup(url) {
	topentwelonlinepopup = window.open(url, "topentwelonlinepopup", "width=790,height=600,scrollbars=yes,resizable=yes");
	topentwelonlinepopup.focus();
}

var nieuwsfotoinnerpopupId = -1;
function leesVerder(id)
{
	if (nieuwsfotoinnerpopupId != -1) {
		nieuwsfotoinnerpopup('', nieuwsfotoinnerpopupId);
	}
	if (nieuwsfotoinnerpopupId != 'innerfoto' + id) {
		nieuwsfotoinnerpopup('', 'innerfoto' + id);
	}
	
	viewhide('item' + id + ',item' + id + 'lang,a' + id);
	return false;
}
function nieuwsfotoinnerpopup(src, id, emptyWhenFilled) {
	var e = getE(id);
	if (e) {
		if ( (src == '') || ((e.innerHTML != '') && (emptyWhenFilled == true)) ) {
			e.innerHTML = '';
			e.style.display = 'none';
			
			var e2 = getE('img' + id);
			if (e2) {
				e2.title = 'Foto vergroten';
			}
		}
		else {
			if ( (nieuwsfotoinnerpopupId != -1) && (nieuwsfotoinnerpopupId != id) ) {
				nieuwsfotoinnerpopup('', nieuwsfotoinnerpopupId);
			}
			
			e.innerHTML = '<a href="#" onclick="return nieuwsfotoinnerpopup(\'\', \'' + id + '\')">Foto sluiten<br><img alt="" src="' + unescape(src) + '" style="border: 1px solid #666666; margin-top: 4px" title="Foto sluiten"></a>';
			e.style.display = 'block';
		//	e.style.border = '1px solid #000000';
			
			nieuwsfotoinnerpopupId = id;
			
			var e2 = getE('img' + id);
			if (e2) {
				e2.title = 'Foto sluiten';
			}
		}
		return false;
	}
	return true;
}
function fotoalbumpopup(url) {
	width  = 940;
	height = 840;
	if (typeof(screen) == "object") {
		if (screen.width <= width) {
			width = screen.width - 20;
		}
		if (screen.height - 60 <= height) {
			height = screen.height - 80;
		}
	}
	topentwelonlinepopup = window.open(url, "topentwelonlinepopup", "width=" + width + ",height=" + height + ",left=10,top=10,scrollbars=yes,resizable=yes");
	topentwelonlinepopup.focus();
}

function getE(id) {
	var e = null;
	if (document.getElementById) {
		e = document.getElementById(id);
	}
	else if (document.all) {
		e = document.all[e];
	}
	return e;
}

var ua = navigator.userAgent.toLowerCase();
var css2 = true;
if (ua.indexOf("msie") >= 0) {
	if (ua.indexOf("msie 7") == -1) {
		css2 = false;
	}
}

function hide(id)
{
	var ids = id.split(",");
	for (k in ids)
	{
		id = ids[k];
		var e = getE(id);
		if (e)
		{
			e.style.display = "none";
		}
	}
}

function viewhide(id)
{
	var ids = id.split(",");
	for (k in ids)
	{
		id = ids[k];
		var e = getE(id);
		if (e)
		{
			if (e.style.display != "none")
			{
				e.style.display = "none";
			}
			else
			{
				if ( (e.tagName == "TD") && (css2) )
				{
					e.style.display = "table-cell";
				}
				else if ( (e.tagName == "TR") && (css2) )
				{
					e.style.display = "table-row";
				}
				else if ( (e.tagName == "TBODY") && (css2) )
				{
					e.style.display = "table-row-group";
				}
				else if ( (e.tagName == "TABLE") && (css2) )
				{
					e.style.display = "table";
				}
				else
				{
					e.style.display = "block";
				}
			}
		}
	}
}
