function findParent(sourceObject,tagName)
{
	var destinationObject = sourceObject;

	sourceObject.tagName != tagName && sourceObject.parentNode && (destinationObject = findParent(sourceObject.parentNode,tagName));

	return destinationObject;
}

function showProps(object)
{
	var property, content = "";

	for (property in object)
	{
		content += "name: " + property + "; value: " + object[property] + "\n";
	}

	alert (content);
}

function popup(id)
{
	id && window.open("popup.php?id=" + id, "zwitserleven_popup", 'width=495,height=564,scrollbars=yes');
}

function toggleDisplay(id)
{
	 var element = document.getElementById(id);
	 var mode = element.style.visibility;

	 element.style.visibility = (mode == "hidden" ? "visible" : "hidden");
}

function changeImage(id,value)
{
	var object = document.getElementById(id);
	var array = value.split("|");

	object.width = array[1];
	object.height = array[2];
	object.src = array[0];
}

function handleSet(set,id)
{
	var counter = 0;
	var element;

	while (document.getElementById(set + ++counter))
	{
		if (document.getElementById(set + counter).id == id)
		{
			document.getElementById(set + counter).active = true;
		}
		else
		{
			document.getElementById(set + counter).active = false;
			document.getElementById(set + counter).src = document.getElementById(set + counter).src.replace(/_on/,"");
		}
	}
}

function OpenLightview ()
{
	Lightview.show ({ href : 'http://q4g.mindgame.nl/ZL/RC3/', options : { width : 640, height : 360 } });
}

function OpenPlayer ()
{
	Lightview.show ({ href : '/player.html', options : { width : 400, height : 300 } });
}