function sel_refer_onchange() 
{
	
	ObjAnders = document.getElementById("REDANDERS");
	ObjAnders.value = "";
	ObjSelAnders = document.getElementById("sel_refer");
	ObjRowAnders = document.getElementById("anders");
	ObjRowAnders.style.visibility = "collapse";
	
	if (ObjSelAnders.value == 2)
	{		
		ObjRowAnders.style.visibility = "visible";
		ObjAnders.focus();
		ObjAnders.value='http://';
	}
}

function enablePW(waarde)
{		
	ObjChkVoorWaarden = document.getElementById("voorwaarden");
	ObjSubmitButton = document.getElementById("btnSubmit");
	
	if (ObjChkVoorWaarden.checked)
	{
		ObjSubmitButton.disabled=false;
	}
	else
	{
		ObjSubmitButton.disabled=true;
	}
	
}

function ConvertCase(WaardeVan) 
{
	var Waarde = WaardeVan.value;
	var NewWaarde = Waarde.toUpperCase();
	WaardeVan.value = NewWaarde;
}

function ValidateAll() 
{
	var Validated;
	var ObjShowInfo;
	var ObjValidate;
	
	ObjShowInfo = document.getElementById("validation_info");
	ObjShowInfo.innerHTML="";

	ObjValidate = document.getElementById("fld_antispam_string");
	Validated = Validate(ObjValidate, 'Antispam code');
	if (!Validated) return false;
	
	ObjValidate = document.getElementById("LOGINNAAM");
	Validated = Validate(ObjValidate, 'Inlognaam');
	if (!Validated) return;

	ObjValidate = document.getElementById("NAAM");
	Validated = Validate(ObjValidate, 'Naam');
	if (!Validated) return;
	
	ObjValidate = document.getElementById("EMAIL");
	Validated = Validate(ObjValidate, 'E-mailadres');
	if (!Validated) return;
	
	ObjValidate = document.getElementById("EMAIL");
	Validated = isEmail(ObjValidate.value)
	if (!Validated) return;																				

	document.getElementById('inschrijven').submit();
	
}

function ValidatePSV() 
{
	var Validated;
	
	ObjValidate = document.getElementById("psv_answ");
	Validated = Validate(ObjValidate, 'Antwoord op de prijsvraag');
	if (!Validated) return false;

	ObjValidate = document.getElementById("fld_antispam_string");
	Validated = Validate(ObjValidate, 'Antispam code');
	if (!Validated) return false;
	
	ObjValidate = document.getElementById("psv_voornaam");
	Validated = Validate(ObjValidate, 'Voornaam');
	if (!Validated) return false;

	ObjValidate = document.getElementById("psv_achternaam");
	Validated = Validate(ObjValidate, 'Achternaam');
	if (!Validated) return false;

	ObjValidate = document.getElementById("psv_woonplaats");
	Validated = Validate(ObjValidate, 'Woonplaats');
	if (!Validated) return false;
	
	ObjValidate = document.getElementById("psv_email");
	Validated = Validate(ObjValidate, 'e-mailadres');
	if (!Validated) return false;
	
	Validated = isEmail(ObjValidate.value);
	if (!Validated) return false;
		
	psv.submit();
}

function ValidateTaf() 
{
	var Validated;
	
	ObjValidate = document.getElementById("fld_antispam_string");
	Validated = Validate(ObjValidate, 'Antispam code');
	if (!Validated) return false;
		
	ObjValidate = document.getElementById("taf_to");
	Validated = Validate(ObjValidate, 'Naam vriend');
	if (!Validated) return false;
	
	ObjValidate = document.getElementById("taf_email");
	Validated = Validate(ObjValidate, 'E-mailadres vriend');
	if (!Validated) return false;
	
	Validated = isEmail(ObjValidate.value);
	if (!Validated) return false;
	
	ObjValidate = document.getElementById("taf_from");
	Validated = Validate(ObjValidate, 'Eigen naam');
	if (!Validated) return false;

	ObjValidate = document.getElementById("taf_fromemail");
	Validated = Validate(ObjValidate, 'Eigen e-mailadres');
	if (!Validated) return false;
	
	Validated = isEmail(ObjValidate.value);
	if (!Validated) return false;
	
	document.getElementById('taf').submit();
}

function ValidateGegevens() 
{
	var Validated;
	
	ObjValidate = document.getElementById("EMAILADRES");
	
	Validated = Validate(ObjValidate, 'e-mailadres');
	if (!Validated) return false;
	
	Validated = isEmail(ObjValidate.value);
	
	if (!Validated) return false;

	document.getElementById('gegchange').submit();
	
}

function ValidateUitnodiging() 
{
	var Validated;

	ObjValidate = document.getElementById("EMAIL");
	Validated = Validate(ObjValidate, 'e-mailadres');
	if (!Validated) return false;
	
	ObjValidate = document.getElementById("EMAIL");
	Validated = isEmail(ObjValidate.value)
	if (!Validated)
	{
		return false;
	}
		
	document.getElementById('uitnodiging').submit();
	
}

function isEmail(waarde)
{
	var rx_email = "^[a-zA-Z0-9]([\\-_]{0,1}[a-zA-Z0-9]{1,})*(\\.[a-zA-Z0-9]([\\-_]{0,1}[a-zA-Z0-9]{1,})*)*@[a-zA-Z0-9]([\\-]{0,1}[a-zA-Z0-9]{1,})*(\\.[a-zA-Z0-9]([\\-]{0,1}[a-zA-Z0-9]{1,})*)*\\.[a-zA-Z]{2,}$";
	var ObjShowInfo;
	var ObjField;
	
	ObjShowInfo = document.getElementById("validation_info");
	ObjField = document.getElementById("EMAIL");
	
	strEmail = waarde;
	ObjShowInfo.innerHTML="";
	
	if (strEmail.length > 0)
	{
		if (strEmail.search(rx_email) == -1) 
		{
			ObjShowInfo.innerHTML = "<font color=#ff6600>Je hebt geen geldig e-mailadres ingevoerd.</font><p />";
			ObjField.value = "";
			ObjField.focus();
			ObjField.className = "ERROR";
			return false;
		}
		else
		{
			return true;
		}
	}
}

function Validate(CheckField, FieldName) 
{
	var ObjShowInfo;
	ObjShowInfo = document.getElementById("validation_info");
	
	var temp = CheckField.value;
	var obj = /^(\s*)([\W\w]*)(\b\s*$)/;
	if (obj.test(temp)) { temp = temp.replace(obj, '$2'); }
	var obj = / +/g;
	temp = temp.replace(obj, " ");
	if (temp == " ") { temp = ""; }

	if (temp == "")
	{
		ObjShowInfo.innerHTML = "<font color=#ff6600>" + FieldName + " is niet ingevuld.</font><p />";
		CheckField.focus();
		CheckField.className = "ERROR";
		return false;
	}
	else
	{
		CheckField.className = "text";
		return true;
	}
}