// ============================================================
//
// SwitchInfo
//
// laat een <div>...</div> zien of niet...
//
// (C) Noud van Kruysbergen aug 2007
// ============================================================
function SwitchInfo(div_id)
{
	var status;
	var style_sheet;

//	if(document.getElementById && document.getElementById(div_id))
//	{
//		style_sheet=document.getElementById(div_id).style;
//	}
//	else if (document.all && document.all(div_id))
//	{
//		style_sheet=document.all(div_id).style;
//	}
//	else if (document.layers && document.layers[div_id])
//	{
//		style_sheet=document.layers[div_id];
//	}
//	else
//	{
//		alert("Sorry, dit werkt alleen in een browser die Dynamic HTML ondersteunt");
//		return false;
//	}
//	status=style_sheet.display;
//	if (status=="none" || status=="") style_sheet.display = "block";
//	else style_sheet.display = "none";
	if (document.layers)
	{
		status = (document.layers[div_id].display != 'block') ? 'block' : 'none';
alert(div_id+' - '+document.layers[div_id].display+' = '+status);
		document.layers[div_id].display = status;
	}
	else if (document.all)
	{
		status = (document.all[div_id].style.display != 'block') ? 'block' : 'none';
alert(div_id+' -- '+document.all[div_id].style.display+' = '+status);
		document.all[div_id].style.display = status;
	}
	else if (document.getElementById)
	{
		status = (document.getElementById(div_id).style.display != 'block') ? 'block' : 'none';
alert(div_id+' --- '+document.getElementById(div_id).style.display+' = '+status);
		document.getElementById(div_id).style.display = status;
	}
}

// ============================================================
//
// check.js
//
// include file voor erbij 1.04: testen van invoer
//
// (C) Noud van Kruysbergen feb 2002
// ============================================================

// CheckItem --------------------------------------------------

function CheckItem(item,tekst)
{
	if (item.value == "")
	{
		alert("U dient een " + tekst + " in te voeren.");
		item.focus();
		return(false);
	}
	return(true);
}

// CheckDate -------------------------------------------------

function CheckDate(datum)
{
	if (CheckItem(datum,"datum"))
	{
		if (!isDate(datum.value))
		{
			alert("U dient een geldige datum in te voeren.");
			datum.focus();
			return false;
		}
		else return true;
	}
	return false;
}

// CheckLogin -------------------------------------------------

function CheckLogin(login,wachtwoord)
{
	if (login.value == "")
	{
		alert("U dient een login naam in te voeren.");
		login.focus();
		return(false);
	}
	if (wachtwoord.value == "")
	{
		alert("U dient een wachtwoord in te voeren.");
		wachtwoord.focus();
		return(false);
	}
	return(true);
}

// CheckEmail -------------------------------------------------

function CheckEmail(email)
{
	var a,d;

	if (email.value == "")
	{
		alert("U dient een emailadres in te voeren.");
		email.focus();
		return(false);
	}
	a=email.value.indexOf('@');
	d=email.value.lastIndexOf('.');
	if ((a==-1) || (d==-1) || d<a)
	{
		alert("U dient een geldig emailadres in te voeren.");
		email.focus();
		return false;
	}
	return true;
}

// CheckOrganisatie ---------------------------------------------

function CheckOrganisatie(org)
{
	if (org.value == 0)
	{
		alert("U dient een organisatie te selecteren.");
		org.focus();
		return(false);
	}
	return true;
}

// CheckProfiel --------------------------------------------------

function CheckProfiel(form)
{
	var max=55;
	var i;

	for (i=0;i<=max;i++)
	{
		if (form.profiel[i].checked)
		{
			return true;
		}
	}
	alert("U dient een profiel aan te geven.");
	return false;
}

