function subscribe()
{
	var email = document.getElementById("nieuwsbrief").value;
	var keeper = new sack();

	keeper.requestFile = "/ajax_subscribe.php?email="+email;
	keeper.onCompletion = function()
	{
		document.getElementById("nieuwsbriefdiv").innerHTML = "<div style=\"float:left; margin-left:30px; width:105px; color:red;\">"+keeper.response+"</div><div class=\"nieuwsbriefrestore\" onclick=\"restore()\"><div class=\"textgo\">OK</div></div><div class=\"cleardiv\"></div>";
	};
	keeper.runAJAX();
}

function restore()
{
	document.getElementById("nieuwsbriefdiv").innerHTML = "<input size=\"25\" name=\"nieuwsbrief\" id=\"nieuwsbrief\" value=\"\" style=\"float:left;  color:#000000;\"><div class=\"nieuwsbriefok\" onclick=\"subscribe()\"><div class=\"textgo\">OK</div></div><div class=\"cleardiv\"></div>";
}

function contactsubmit()
{
	var empty = "N";
	if(document.getElementById("naam").value=="")
		empty = "Y";
	if(document.getElementById("email").value=="")
		empty = "Y";
	if(document.getElementById("telefoonnummer").value=="")
		empty = "Y";
	if(empty=="N")
	{
		document.contactform.submit();
	}
	else
	{
		document.getElementById("errors").innerHTML = "Gelieve alle verplichte velden in te vullen."
	}
}

function toggleBox(szDivID)
{
	var obj = document.getElementById(szDivID);
	if (obj.style.display == '')
	{
		obj.style.display = "none";
	}
	else
	{
		obj.style.display = "";
	}
	oldDivID= szDivID;
}
function stopEvent(e) {
	if(!e) var e = window.event;

	//e.cancelBubble is supported by IE - this will kill the bubbling process.
	e.cancelBubble = true;

	//e.stopPropagation works only in Firefox.
	if (e.stopPropagation) {
		e.stopPropagation();
	}
}

function ChangeImg(obj)
{
	var oldimg=obj.src;
	var newimg=obj.getAttribute("rel");
	obj.src=newimg;
	obj.setAttribute('rel', oldimg);
}
function writeEmbed(cls, cb, mt, p) {
	var h = '', n;

	h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
	h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
	h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
	h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
	h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
	h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
	h += '>';

	for (n in p)
		h += '<param name="' + n + '" value="' + p[n] + '">';

	h += '<embed type="' + mt + '"';

	for (n in p)
		h += n + '="' + p[n] + '" ';

	h += '></embed></object>';

	document.write(h);
}

function writeFlash(p) {
	writeEmbed(
		'D27CDB6E-AE6D-11cf-96B8-444553540000',
		'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
		'application/x-shockwave-flash',
		p
	);
}

function EmbedFlash(file)
{
	document.write('<OBJECT ID=\"MediaPlayer\" classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" valign=\"center\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\" standby=\"Loading Microsoft� Windows� Media Player components...\" type=\"application/x-oleobject\" width=\"375\" height=\"288\">' +
	'<PARAM name=\"FileName\" value=\"images/filelib/'+file+'\"><PARAM NAME=\"AutoStart\" VALUE=\"1\"><PARAM NAME=\"ShowControls\" VALUE=\"1\"><PARAM NAME=\"ShowStatusBar\" VALUE=\"0\"><PARAM NAME=\"SendErrorEvents\" VALUE=\"true\"><param NAME=\"TransparentAtStart\" VALUE=\"-1\"><PARAM name=\"InvokeURLs\" value=\"false\">' +
	'<EMBED TYPE=\"application/x-mplayer2\" NAME=\"MediaPlayer\" SRC=\"images/filelib/' + file +'\" WIDTH=\"375\" HEIGHT=\"288\" autostart=\"0\" showcontrols=\"1\"></EMBED></OBJECT>');
}

