// create variables for validation
var voorletters, voornaam, achternaam, adres, huisnummer, postcode, plaats, telefoonPrive, telefoonMobiel, email, geboortePlaats, geboorteDag, geboorteMaand, geboorteJaar, vraag, telefoonnummer, relatienummer, zNaamOrganisatie, zPostadres, zPostcode, zPlaats, zTelefoonnummer;
var orgNaam, orgAdres, orgPostcode, orgPlaats, orgPostAdres, orgPostPostcode, orgPostPlaats, orgTelefoon, orgFax, orgLocatiecode, orgContact;
var factuurOrganisatie, factuurTAV, factuurAdres, factuurPostcode, factuurPlaats, factuurTelefoon, factuurLocatie, factuurBTW, factuurRekening;

// Radio Button Validation
// copyright Stephen Chapman, 15th Nov 2004,14th Sep 2005
// you may copy this function but please keep the copyright notice with it
function valButton(btn) {
    var cnt = -1;
    for (var i=btn.length-1; i > -1; i--) {
        if (btn[i].checked) {cnt = i; i = -1;}
    }
    if (cnt > -1) return btn[cnt].value;
    else return null;
}

function checkGeslachtButtons()
{
  var fieldsValid = true;
  var btn = valButton(document.getElementById('inschrijvenOpleiding').Geslacht);
  var lblM = document.getElementById("lblGeslachtM");
  var lblV = document.getElementById("lblGeslachtV");

  if (btn == null)
  {
    if (!lblM.hasClassName("LV_invalid_field")) lblM.addClassName("LV_invalid_field");
    if (!lblV.hasClassName("LV_invalid_field")) lblV.addClassName("LV_invalid_field");
    fieldsValid = false
  }
  else
  {
    if (lblM.hasClassName("LV_invalid_field")) lblM.removeClassName("LV_invalid_field");
    if (lblV.hasClassName("LV_invalid_field")) lblV.removeClassName("LV_invalid_field");
    fieldsValid = true;
  }
  return fieldsValid;
}

function gotoStep2(edit, trainingid, uitvoering)
{
	if (typeof edit == "undefined")
	{
		edit = 0;
	}
	if (typeof trainingid == "undefined")
	{
		trainingid = "";
	}
	if (typeof uitvoering == "undefined")
	{
		uitvoering = "";
	}
	
	if (uitvoering != ""  && trainingid != "")
	{
		qs = "&trainingid=" + trainingid + "&uitvoering=" + uitvoering;
	}
	else
	{
		qs = "";
	}
	
	document.getElementById("stap1tab").className = "";
	document.getElementById("stap2tab").className = "active";
	document.getElementById("stap3tab").className = "";
	document.getElementById("stap4tab").className = "";
	document.getElementById("stap3tab").onclick = "";
	if (edit == 0)
	{
		new Ajax.Updater('inschrijven', '/smartsite.dws?id=5161&step=3' + qs, {method: 'post', evalScripts: true});
	}
	else
	{
		//document.getElementById("stap4tab").onclick = function(){gotoStep4(1); return false;};
		new Ajax.Updater('inschrijven', '/smartsite.dws?id=5161&step=3&&edit=1' + qs, {method: 'post', evalScripts: true});
	}
}

function addPersonStep2(edit)
{
	if (typeof edit == "undefined")
	{
		edit = 0;
	}
	fieldsValid = LiveValidation.massValidate([voorletters, voornaam, achternaam, adres, postcode, plaats, telefoonPrive, telefoonMobiel, email, geboortePlaats, geboorteDag, geboorteMaand, geboorteJaar,functie]);
	
	if (fieldsValid) 
	{
		fillBirthDate();
		document.getElementById("stap1tab").className = "";
		document.getElementById("stap2tab").className = "active";
		document.getElementById("stap3tab").className = "";
		document.getElementById("stap4tab").className = "";
		new Ajax.Updater('inschrijven', '/smartsite.dws?id=5161&step=3&addperson=1&edit=' + edit, {parameters: $('inschrijvenOpleiding').serialize(true), method: 'post', evalScripts: true});
	}
}

function gotoStep3(edit, person)
{
	if (typeof edit == "undefined")
	{
		edit = 0;
	}
	
	fieldsValid = true;
	
	if (person == 1)
	{
		fieldsValid = LiveValidation.massValidate([voorletters, voornaam, achternaam, adres, postcode, plaats, telefoonPrive, telefoonMobiel, email, geboortePlaats, geboorteDag, geboorteMaand, geboorteJaar,functie]);
	}
	
	if (fieldsValid) 
	{
		if (person == 1)
		{
			fillBirthDate();
		}
		if (edit == 0)
		{
			document.getElementById("stap1tab").className = "";
			document.getElementById("stap2tab").className = "";
			document.getElementById("stap3tab").className = "active";
			document.getElementById("stap4tab").className = "";
			document.getElementById("stap2tab").onclick = function(){gotoStep2(1); return false;};
			new Ajax.Updater('inschrijven', '/smartsite.dws?id=5161&step=2&person=' + person, {parameters: $('inschrijvenOpleiding').serialize(true), method: 'post', evalScripts: true});
		}
		else
		{
			document.getElementById("stap1tab").className = "";
			document.getElementById("stap2tab").className = "";
			document.getElementById("stap3tab").className = "active";
			document.getElementById("stap4tab").className = "";
			document.getElementById("stap2tab").onclick = function(){gotoStep2(1); return false;};
			// document.getElementById("stap4tab").onclick = function(){gotoStep4(1); return false;};
			new Ajax.Updater('inschrijven', '/smartsite.dws?id=5161&step=2&edit=1&person=' + person, {parameters: $('inschrijvenOpleiding').serialize(true), method: 'post', evalScripts: true});
		}
	}
}

function gotoStep4(edit, validate)
{
	if (typeof edit == "undefined")
	{
		edit = 0;
	}
	
	if (typeof validate == "undefined")
	{
		validate = 1;
	}
	

	fieldsValid = true;
	
	if (validate == 1 && document.getElementById('FactuuradresPrive') != null)
	{
		if (!document.getElementById('FactuuradresPrive').checked) 
		{
			fieldsValid = LiveValidation.massValidate([factuurOrganisatie, factuurTAV, factuurAdres, factuurPostcode, factuurPlaats, factuurTelefoon, factuurRekening]);
		}
	}
	
	if (fieldsValid) 
	{
		if (edit == 0)
		{
			document.getElementById("stap1tab").className = "";
			document.getElementById("stap2tab").className = "";
			document.getElementById("stap3tab").className = "";
			document.getElementById("stap4tab").className = "active";
			document.getElementById("stap3tab").onclick = function(){gotoStep3(1, 0); return false;};
			new Ajax.Updater('inschrijven', '/smartsite.dws?id=5161&step=1&validate=' + validate, {parameters: $('inschrijvenOpleiding').serialize(true), method: 'post', evalScripts: true});
		}
		else
		{
			document.getElementById("stap1tab").className = "";
			document.getElementById("stap2tab").className = "";
			document.getElementById("stap3tab").className = "";
			document.getElementById("stap4tab").className = "active";
			document.getElementById("stap3tab").onclick = function(){gotoStep3(1, 0); return false;};
			new Ajax.Updater('inschrijven', '/smartsite.dws?id=5161&step=1&edit=1&validate=' + validate, {parameters: $('inschrijvenOpleiding').serialize(true), method: 'post', evalScripts: true});
		}
	}
}

function sendInschrijfform()
{
	new Ajax.Updater('inschrijven', '/smartsite.dws?id=5161&step=0', {parameters: $('inschrijvenOpleiding').serialize(true), method: 'post', evalScripts: true});
}

function showhideContent3(showelement,hideelement,hideelement2,hideelement3)
{
  var returnValue = true;
  // specific for enroll training form
  var fieldsValid = true;
  if (showelement == "stap3")
  {
    fieldsValid = LiveValidation.massValidate([voorletters, voornaam, achternaam, adres, postcode, plaats, telefoonPrive, telefoonMobiel, email, geboortePlaats, geboorteDag, geboorteMaand, geboorteJaar,functie]);
    //if (fieldsValid)
    //{
    //  fieldsValid = checkGeslachtButtons();
    //}
  }
  if (showelement == "stap4")
  {
	/*
		var tempValid = true;
		fieldsValid = LiveValidation.massValidate([orgNaam, orgAdres, orgPostcode, orgPlaats, orgPostAdres, orgPostPostcode, orgPostPlaats, orgTelefoon, orgFax, orgLocatiecode, orgContact]);

		if (getCheckedValue(document.getElementById('FactuuradresType')) == "anders")
		{
		  tempValid = LiveValidation.massValidate([factuurOrganisatie, factuurTAV, factuurAdres, factuurPostcode, factuurPlaats, factuurTelefoon, factuurLocatie, factuurBTW, factuurRekening]);
		}
		if (fieldsValid && !tempValid) fieldsValid = false;
	*/
	if (!document.getElementById('FactuuradresPrive').checked) 
	{
		arrFields = [factuurOrganisatie, factuurTAV, factuurAdres, factuurPostcode, factuurPlaats, factuurTelefoon, factuurRekening];
		//if (document.getElementById('FactuuradresOrg').checked)
		//{
		//	arrFields.push(factuurBTW);
		//}
		fieldsValid = LiveValidation.massValidate(arrFields);
	}
  }

  if (fieldsValid)
  {
    var dispStyle;

    if(navigator.appName.indexOf("Microsoft") > -1)
    {
      dispStyle = 'block';
    }
    else
    {
      dispStyle = 'block';
    }

    document.getElementById(hideelement).style.display = "none"; /* verberg div */
    if (document.getElementById(hideelement+'tab'))
    {
      document.getElementById(hideelement+'tab').className = "";
    }

    document.getElementById(hideelement2).style.display = "none"; /* verberg div */
    if (document.getElementById(hideelement2+'tab'))
    {
      document.getElementById(hideelement2+'tab').className = "";
    }

    document.getElementById(hideelement3).style.display = "none"; /* verberg div */
    if(document.getElementById(hideelement3+'tab'))
    {
      document.getElementById(hideelement3+'tab').className = "";
    }

    document.getElementById(showelement).style.display = dispStyle; /* toon div */
    if (document.getElementById(showelement+'tab'))
    {
      document.getElementById(showelement+'tab').className = "active";
    }
    returnValue = true;
  }
  else
  {
    returnValue = false;
  }
  return returnValue;
}

function showhideContentInfo(showelement,hideelement)
{
  // specific for information request form
  var fieldsValid = true;

  if (showelement == "stap1")
  {
  }

  if (showelement == "stap2")
  {
    //fieldsValid = LiveValidation.massValidate([relatienummer, voorletters, voornaam, achternaam, email]);
    fieldsValid = LiveValidation.massValidate([voorletters, voornaam, achternaam, email]);

    var addressValid = true;
    if (document.getElementById('AdresKeuzePrive').checked)
    {
      addressValid = LiveValidation.massValidate([adres, huisnummer, postcode, plaats, telefoonnummer]);
    } else {
      addressValid = LiveValidation.massValidate([zNaamOrganisatie, zPostadres, zPostcode, zPlaats, zTelefoonnummer]);
    }

    fieldsValid = fieldsValid && addressValid;
  }

  if (fieldsValid)
  {
    document.getElementById(hideelement).style.display = "none"; /* verberg div */
    if (document.getElementById(hideelement+'tab'))
    {
      document.getElementById(hideelement+'tab').className = "";
    }

    document.getElementById(showelement).style.display = 'block'; /* toon div */
    if (document.getElementById(showelement+'tab'))
    {
      document.getElementById(showelement+'tab').className = "active";
    }
  }
  return fieldsValid;
}

function displayFormTips(elementName)
{
  var divs = document.getElementsByTagName("div");
  for (i = 0; i < divs.length; i++)
  {
    if (divs[i].id.indexOf("com") == 0)
    {
      divs[i].style.display = "none";
    }
  }
  if (document.getElementById("com" + elementName))
  {
    document.getElementById("com" + elementName).style.display = "block";
  }
}

function addValidationInschrijvenStap2()
{
  voorletters = new LiveValidation("Voorletters", { validMessage: "" });
  voorletters.add(Validate.Presence, { failureMessage: "Voer uw voorletter(s) in." });
  voorletters.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  voornaam = new LiveValidation("Voornaam", { validMessage: "" });
  voornaam.add(Validate.Presence, { failureMessage: "Voer uw voornaam in." });
  voornaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  achternaam = new LiveValidation("Achternaam", { validMessage: "" });
  achternaam.add(Validate.Presence, { failureMessage: "Voer uw achternaam in." });
  achternaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  adres = new LiveValidation("Adres", { validMessage: "" });
  adres.add(Validate.Presence, { failureMessage: "Voer uw adres in." });
  adres.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  postcode = new LiveValidation("Postcode", { validMessage: "" });
  postcode.add(Validate.Presence, { failureMessage: "Voer uw postcode in." });
  postcode.add(Validate.Length, {maximum: 50, failureMessage: "Uw ingevoerde tekst is te lang." });
  plaats = new LiveValidation("Plaats", { validMessage: "" });
  plaats.add(Validate.Presence, { failureMessage: "Voer uw woonplaats in." });
  plaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  telefoonPrive = new LiveValidation("TelefoonPrive", { validMessage: "" });
  telefoonPrive.add(Validate.Presence, { failureMessage: "Voer uw telefoonnummer in." });
  telefoonPrive.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  telefoonMobiel = new LiveValidation("TelefoonMobiel", { validMessage: "" });
  telefoonMobiel.add(Validate.Presence, { failureMessage: "Voer uw mobiele telefoonnummer in." });
  telefoonMobiel.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  email = new LiveValidation("Email", { validMessage: "" });
  email.add(Validate.Presence, { failureMessage: "Voer een e-mail adres in." });
  email.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
  email.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  geboortePlaats = new LiveValidation("Geboorteplaats", { validMessage: "" });
  geboortePlaats.add(Validate.Presence, { failureMessage: "Voer uw geboorteplaats in." });
  geboortePlaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  geboorteDag = new LiveValidation("GeboorteDag", { validMessage: "" });
  geboorteDag.add(Validate.Numericality, {minimum: 1, tooLowMessage: "Voer uw geboortedag in." });
  geboorteMaand = new LiveValidation("GeboorteMaand", { validMessage: "" });
  geboorteMaand.add(Validate.Numericality, {minimum: 1, tooLowMessage: "Voer uw geboortemaand in." });
  geboorteJaar = new LiveValidation("GeboorteJaar", { validMessage: "" });
  geboorteJaar.add(Validate.Numericality, {minimum: 1946, tooLowMessage: "Voer uw geboortejaar in."});
  functie = new LiveValidation("Functie", {validMessage: "" });
  functie.add(Validate.Presence, { failureMessage: "Voer uw functie in." });
  functie.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
}

function addValidationInschrijvenStap3()
{
  factuurOrganisatie = new LiveValidation("FactuurOrganisatie", { validMessage: "" });
  factuurOrganisatie.add(Validate.Presence, { failureMessage: "Voer de organisatie waar de factuur naar verzonden moet worden in." });
  factuurOrganisatie.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  factuurTAV = new LiveValidation("FactuurTAV", { validMessage: "" });
  factuurTAV.add(Validate.Presence, { failureMessage: "Voer de contactpersoon voor op de factuur in." });
  factuurTAV.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  factuurAdres = new LiveValidation("FactuurAdres", {validMessage: ""});
  factuurAdres.add(Validate.Presence, { failureMessage: "Voer het adres voor op de factuur in." });
  factuurAdres.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  factuurPostcode = new LiveValidation("FactuurPostcode", { validMessage: "" });
  factuurPostcode.add(Validate.Presence, { failureMessage: "Voer de postcode voor op de factuur in." });
  factuurPostcode.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  factuurPlaats = new LiveValidation("FactuurPlaats", { validMessage: "" });
  factuurPlaats.add(Validate.Presence, { failureMessage: "Voer de plaats voor op de factuur in." });
  factuurPlaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  factuurTelefoon = new LiveValidation("FactuurTelefoon", { validMessage: "" });
  factuurTelefoon.add(Validate.Presence, { failureMessage: "Voer het telefoonnummer voor op de factuur in." });
  factuurTelefoon.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  factuurRekening = new LiveValidation("FactuurRekening", { validMessage: "" });
  factuurRekening.add(Validate.Presence, { failureMessage: "Voer een rekeningnummer voor op de factuur in." });
  factuurRekening.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
}

function addValidationOptieNemen()
{
  voorletters = new LiveValidation("Voorletters", { validMessage: "" });
  voorletters.add(Validate.Presence, { failureMessage: "Voer uw voorletter(s) in." });
  voorletters.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  voornaam = new LiveValidation("Voornaam", { validMessage: "" });
  voornaam.add(Validate.Presence, { failureMessage: "Voer uw voornaam in." });
  voornaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  achternaam = new LiveValidation("Achternaam", { validMessage: "" });
  achternaam.add(Validate.Presence, { failureMessage: "Voer uw achternaam in." });
  achternaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  adres = new LiveValidation("Adres", { validMessage: "" });
  adres.add(Validate.Presence, { failureMessage: "Voer uw adres in." });
  adres.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  postcode = new LiveValidation("Postcode", { validMessage: "" });
  postcode.add(Validate.Presence, { failureMessage: "Voer uw postcode in." });
  postcode.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  plaats = new LiveValidation("Plaats", { validMessage: "" });
  plaats.add(Validate.Presence, { failureMessage: "Voer uw plaats in." });
  plaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  telefoonPrive = new LiveValidation("Telefoon1", { validMessage: "" });
  telefoonPrive.add(Validate.Presence, { failureMessage: "Voer uw telefoonnummer in." });
  telefoonPrive.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  email = new LiveValidation("Email", { validMessage: "" });
  email.add(Validate.Presence, { failureMessage: "Voer een e-mail adres in." });
  email.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
  email.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  geboortePlaats = new LiveValidation("Geboortedatum", { validMessage: "" });
  geboortePlaats.add(Validate.Presence, { failureMessage: "Voer uw geboortedatum in." });
  geboortePlaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  geboortePlaats.add(Validate.Format, { pattern: /^[0-9]{1,2}-[0,1]{0,1}[0-9]{1}-[1-2]{1}[0,9]{1}[0-9]{2}$/ , failureMessage: "Voer een geldige datum in (dd-mm-yyyy)."});
}

function addValidationContact()
{
  voorletters = new LiveValidation("Voorletters", { validMessage: "" });
  voorletters.add(Validate.Presence, { failureMessage: "Voer uw voorletter(s) in." });
  voorletters.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  voornaam = new LiveValidation("Voornaam", { validMessage: "" });
  voornaam.add(Validate.Presence, { failureMessage: "Voer uw voornaam in." });
  voornaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  achternaam = new LiveValidation("Achternaam", { validMessage: "" });
  achternaam.add(Validate.Presence, { failureMessage: "Voer uw achternaam in." });
  achternaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  telefoonPrive = new LiveValidation("Telefoon1", { validMessage: "" });
  telefoonPrive.add(Validate.Presence, { failureMessage: "Voer uw telefoonnummer in." });
  telefoonPrive.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  email = new LiveValidation("Email", { validMessage: "" });
  email.add(Validate.Presence, { failureMessage: "Voer een e-mail adres in." });
  email.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
  email.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  vraag = new LiveValidation("Vraag", { validMessage: "" });
  vraag.add(Validate.Presence, { failureMessage: "Voer een vraag of opmerking in." });
  vraag.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
}

function addValidationFAQContact()
{
  voorletters = new LiveValidation("Voorletters", { validMessage: "" });
  voorletters.add(Validate.Presence, { failureMessage: "Voer uw voorletter(s) in." });
  voorletters.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  voornaam = new LiveValidation("Voornaam", { validMessage: "" });
  voornaam.add(Validate.Presence, { failureMessage: "Voer uw voornaam in." });
  voornaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  achternaam = new LiveValidation("Achternaam", { validMessage: "" });
  achternaam.add(Validate.Presence, { failureMessage: "Voer uw achternaam in." });
  achternaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  //relatienummer = new LiveValidation("Relatienummer", { validMessage: "" });
  //relatienummer.add(Validate.Presence, { failureMessage: "Voer relatienummer in." });
  //relatienummer.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde relatienummer is te lang." });
  //relatienummer.add(Validate.Format, { pattern: /^[0-9]\d/ , failureMessage: "Voer een geldige relatienummer in."});
  postcode = new LiveValidation("Postcode", { validMessage: "" });
  postcode.add(Validate.Presence, { failureMessage: "Voer uw postcode in." });
  postcode.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  postcode.add(Validate.Format, { pattern: /^[0-9]{4}\s{0,1}[a-zA-Z]{2}$/ , failureMessage: "Voer een geldige postcode in."});
  telefoonPrive = new LiveValidation("Telefoon1", { validMessage: "" });
  telefoonPrive.add(Validate.Presence, { failureMessage: "Voer uw telefoonnummer in." });
  telefoonPrive.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  email = new LiveValidation("Email", { validMessage: "" });
  email.add(Validate.Presence, { failureMessage: "Voer een e-mail adres in." });
  email.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
  email.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  vraag = new LiveValidation("Vraag", { validMessage: "" });
  vraag.add(Validate.Presence, { failureMessage: "Voer een vraag of opmerking in." });
  vraag.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
}


function addValidationIncompanyContact()
{
  voorletters = new LiveValidation("Voorletters", { validMessage: "" });
  voorletters.add(Validate.Presence, { failureMessage: "Voer uw voorletter(s) in." });
  voorletters.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  voornaam = new LiveValidation("Voornaam", { validMessage: "" });
  voornaam.add(Validate.Presence, { failureMessage: "Voer uw voornaam in." });
  voornaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  achternaam = new LiveValidation("Achternaam", { validMessage: "" });
  achternaam.add(Validate.Presence, { failureMessage: "Voer uw achternaam in." });
  achternaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  telefoonPrive = new LiveValidation("Telefoon1", { validMessage: "" });
  telefoonPrive.add(Validate.Presence, { failureMessage: "Voer uw telefoonnummer in." });
  telefoonPrive.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  
  email = new LiveValidation("Email", { validMessage: "" });
  email.add(Validate.Presence, { failureMessage: "Voer een e-mail adres in." });
  email.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
  email.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  
  zNaamOrganisatie = new LiveValidation("OrgNaam", { validMessage: "" });
  zNaamOrganisatie.add(Validate.Presence, { failureMessage: "Voer de naam van de organisatie in." });
  zNaamOrganisatie.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  orgNaam = new LiveValidation("OrgAfdeling", { validMessage: "" });
  orgNaam.add(Validate.Presence, { failureMessage: "Voer de afdeling van de organisatie in." });
  orgNaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  zPostadres = new LiveValidation("Adres", { validMessage: "" });
  zPostadres.add(Validate.Presence, { failureMessage: "Voer het postadres van de organisatie in." });
  zPostadres.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  zPostcode = new LiveValidation("Postcode", { validMessage: "" });
  zPostcode.add(Validate.Presence, { failureMessage: "Voer de postcode van het postadres van de organisatie in." });
  zPostcode.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  zPlaats = new LiveValidation("Plaats", { validMessage: "" });
  zPlaats.add(Validate.Presence, { failureMessage: "Voer de plaats van het postadres van de organisatie in." });
  zPlaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  adres = new LiveValidation("Afspraak", { validMessage: "", onlyOnSubmit: true });
  adres.add(Validate.Presence, { failureMessage: "Voer een datum waarop u een afspraak wilt maken in." });
  adres.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  adres.add(Validate.Format, {pattern: /[0-9]{1,2}-[0-9]{1,2}-[0-9]{2,4}/i, failureMessage: "Voer een geldige datum waarop u een afspraak wilt maken in." });
  postcode = new LiveValidation("Branche", { validMessage: "" });
  postcode.add(Validate.Presence, { failureMessage: "Voer uw branche in." });
  postcode.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  plaats = new LiveValidation("AantalMDW", { validMessage: "" });
  plaats.add(Validate.Presence, { failureMessage: "Kies het aantal medewerkers." });
  plaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
}

function addValidationPersoonlijkOntwikkelingsfonds()
{
	
	voorletters = new LiveValidation("Voorletters", { validMessage: "" });
	voorletters.add(Validate.Presence, { failureMessage: "Voer uw voorletter(s) in." });
	voorletters.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

  	achternaam = new LiveValidation("Achternaam", { validMessage: "" });
	achternaam.add(Validate.Presence, { failureMessage: "Voer uw achternaam in." });
	achternaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

	email = new LiveValidation("Email", { validMessage: "" });
	email.add(Validate.Presence, { failureMessage: "Voer een e-mail adres in." });
	email.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
	email.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

	adres = new LiveValidation("Adres", { validMessage: "" });
	adres.add(Validate.Presence, { failureMessage: "Voer uw adres in." });
	adres.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

	huisnummer = new LiveValidation("Huisnummer", { validMessage: "" });
	huisnummer.add(Validate.Presence, { failureMessage: "Voer uw huisnummer in." });
	huisnummer.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

	postcode = new LiveValidation("Postcode", { validMessage: "" });
	postcode.add(Validate.Presence, { failureMessage: "Voer uw postcode in." });
	postcode.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

	plaats = new LiveValidation("Plaats", { validMessage: "" });
	plaats.add(Validate.Presence, { failureMessage: "Voer uw woonplaats in." });
	plaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
	
	telefoonnummer = new LiveValidation("Telefoon", { validMessage: "" });
	telefoonnummer.add(Validate.Presence, { failureMessage: "Voer uw telefoonnummer in." });
	telefoonnummer.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
	
	motivatie = new LiveValidation("Motivatie", { validMessage: "" });
	motivatie.add(Validate.Presence, { failureMessage: "Voer uw motiven in." });
	motivatie.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
	
	werkgever = new LiveValidation("Werkgever", { validMessage: "" });
	werkgever.add(Validate.Presence, { failureMessage: "Voer naam werkgever in." });
	werkgever.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
	
	vestigingsplaats = new LiveValidation("Vestigingsplaats", { validMessage: "" });
	vestigingsplaats.add(Validate.Presence, { failureMessage: "Voer vesigingsplaats werkgever in." });
	vestigingsplaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
	
	werkgevertelefoon = new LiveValidation("Werkgevertelefoon", { validMessage: "" });
	werkgevertelefoon.add(Validate.Presence, { failureMessage: "Voer werkgevertelefoon in." });
	werkgevertelefoon.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
    
	actievoorwaarde = new LiveValidation("Actievoorwaarde", { validMessage: "" });
	actievoorwaarde.add(Validate.Acceptance, { failureMessage: "Voorwaarde is verplicht!" });
	
}

function addValidationBijeenkomstinschrijving()
{
	xVoorletters = new LiveValidation("Voorletters", { validMessage: "" });
	xVoorletters.add(Validate.Presence, { failureMessage: "Voer uw voorletter(s) in." });
	xVoorletters.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

	xVoornaam = new LiveValidation("Voornaam", { validMessage: "" });
	xVoornaam.add(Validate.Presence, { failureMessage: "Voer uw voornaam in." });
	xVoornaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

	xAchternaam = new LiveValidation("Achternaam", { validMessage: "" });
	xAchternaam.add(Validate.Presence, { failureMessage: "Voer uw achternaam in." });
	xAchternaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

	xStraat = new LiveValidation("Straat", { validMessage: "" });
	xStraat.add(Validate.Presence, { failureMessage: "Voer uw straat in." });
	xStraat.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

	xNummer = new LiveValidation("Nummer", { validMessage: "" });
	xNummer.add(Validate.Presence, { failureMessage: "Voer uw huisnummer in." });
	xNummer.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

	xPostcode = new LiveValidation("Postcode", { validMessage: "" });
	xPostcode.add(Validate.Presence, { failureMessage: "Voer uw postcode in." });
	xPostcode.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

	xPlaats = new LiveValidation("Plaats", { validMessage: "" });
	xPlaats.add(Validate.Presence, { failureMessage: "Voer uw woonplaats in." });
	xPlaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

	xTelefoon = new LiveValidation("Telefoon", { validMessage: "" });
	xTelefoon.add(Validate.Presence, { failureMessage: "Voer uw telefoonnummer in." });
	xTelefoon.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
	
	xVraag = new LiveValidation("Vraag", { validMessage: "" });
	xVraag.add(Validate.Presence, { failureMessage: "Voer een antwoord in." });
	xVraag.add(Validate.Length, {maximum: 350, failureMessage: "Uw ingevoerde tekst is te lang." });
	
	xEmail = new LiveValidation("Email", { validMessage: "" });
	xEmail.add(Validate.Presence, { failureMessage: "Voer een e-mail adres in." });
	xEmail.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
	xEmail.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
}

function addValidationBrochurepppppppppppppppppp()
{
  voornaam = new LiveValidation("voornaam", { validMessage: "" });
  voornaam.add(Validate.Presence, { failureMessage: "Voer uw voornaam in." });
  voornaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  achternaam = new LiveValidation("achternaam", { validMessage: "" });
  achternaam.add(Validate.Presence, { failureMessage: "Voer uw achternaam in." });
  achternaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  telefoon = new LiveValidation("telefoon", { validMessage: "" });
  telefoon.add(Validate.Presence, { failureMessage: "Voer uw telefoonnummer in." });
  telefoon.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  email = new LiveValidation("email", { validMessage: "" });
  email.add(Validate.Presence, { failureMessage: "Voer een e-mail adres in." });
  email.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
  email.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
}

function addValidationBrochure()
{
  voornaam = new LiveValidation("voornaam", { validMessage: "" });
  voornaam.add(Validate.Presence, { failureMessage: "Voer uw voornaam in." });
  voornaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  achternaam = new LiveValidation("achternaam", { validMessage: "" });
  achternaam.add(Validate.Presence, { failureMessage: "Voer uw achternaam in." });
  achternaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  straat = new LiveValidation("straat", { validMessage: "" });
  straat.add(Validate.Presence, { failureMessage: "Voer uw straat in." });
  straat.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  huisnummer = new LiveValidation("huisnummer", { validMessage: "" });
  huisnummer.add(Validate.Presence, { failureMessage: "Voer uw huisnummer in." });
  huisnummer.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  postcode = new LiveValidation("postcode", { validMessage: "" });
  postcode.add(Validate.Presence, { failureMessage: "Voer uw postcode in." });
  postcode.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  plaats = new LiveValidation("plaats", { validMessage: "" });
  plaats.add(Validate.Presence, { failureMessage: "Voer uw plaats in." });
  plaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  telefoon = new LiveValidation("telefoon", { validMessage: "" });
  telefoon.add(Validate.Presence, { failureMessage: "Voer uw telefoonnummer in." });
  telefoon.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  email = new LiveValidation("email", { validMessage: "" });
  email.add(Validate.Presence, { failureMessage: "Voer een e-mail adres in." });
  email.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
  email.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
}

function addValidationdownloadwhitepaper()
{
  voornaam = new LiveValidation("Voornaam", { validMessage: "" });
  voornaam.add(Validate.Presence, { failureMessage: "Voer uw voornaam in." });
  voornaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  achternaam = new LiveValidation("Achternaam", { validMessage: "" });
  achternaam.add(Validate.Presence, { failureMessage: "Voer uw achternaam in." });
  achternaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  straat = new LiveValidation("Straat", { validMessage: "" });
  straat.add(Validate.Presence, { failureMessage: "Voer uw straat in." });
  straat.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  huisnummer = new LiveValidation("Huisnummer", { validMessage: "" });
  huisnummer.add(Validate.Presence, { failureMessage: "Voer uw huisnummer in." });
  huisnummer.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  postcode = new LiveValidation("Postcode", { validMessage: "" });
  postcode.add(Validate.Presence, { failureMessage: "Voer uw postcode in." });
  postcode.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  plaats = new LiveValidation("Plaats", { validMessage: "" });
  plaats.add(Validate.Presence, { failureMessage: "Voer uw plaats in." });
  plaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  telefoon = new LiveValidation("Telefoon", { validMessage: "" });
  telefoon.add(Validate.Presence, { failureMessage: "Voer uw telefoonnummer in." });
  telefoon.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  email = new LiveValidation("Email", { validMessage: "" });
  email.add(Validate.Presence, { failureMessage: "Voer een e-mail adres in." });
  email.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
  email.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
}

function addValidationInfoPerPost()
{
  infovoornaam = new LiveValidation("infovoornaam", { validMessage: "" });
  infovoornaam.add(Validate.Presence, { failureMessage: "Voer uw voornaam in." });
  infovoornaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  infoachternaam = new LiveValidation("infoachternaam", { validMessage: "" });
  infoachternaam.add(Validate.Presence, { failureMessage: "Voer uw achternaam in." });
  infoachternaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  infostraat = new LiveValidation("infostraat", { validMessage: "" });
  infostraat.add(Validate.Presence, { failureMessage: "Voer uw straat in." });
  infostraat.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  infohuisnummer = new LiveValidation("infohuisnummer", { validMessage: "" });
  infohuisnummer.add(Validate.Presence, { failureMessage: "Voer uw huisnummer in." });
  infohuisnummer.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  infopostcode = new LiveValidation("infopostcode", { validMessage: "" });
  infopostcode.add(Validate.Presence, { failureMessage: "Voer uw postcode in." });
  infopostcode.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  infoplaats = new LiveValidation("infoplaats", { validMessage: "" });
  infoplaats.add(Validate.Presence, { failureMessage: "Voer uw plaats in." });
  infoplaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  infotelefoon = new LiveValidation("infotelefoon", { validMessage: "" });
  infotelefoon.add(Validate.Presence, { failureMessage: "Voer uw telefoonnummer in." });
  infotelefoon.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  
  infoemail = new LiveValidation("infoemail", { validMessage: "" });
  infoemail.add(Validate.Presence, { failureMessage: "Voer een e-mail adres in." });
  infoemail.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
  infoemail.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
}

function addValidationInfoAanvraag()
{
  voorletters = new LiveValidation("Voorletters", { validMessage: "" });
  voorletters.add(Validate.Presence, { failureMessage: "Voer uw voorletter(s) in." });
  voorletters.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  voornaam = new LiveValidation("Voornaam", { validMessage: "" });
  voornaam.add(Validate.Presence, { failureMessage: "Voer uw voornaam in." });
  voornaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  achternaam = new LiveValidation("Achternaam", { validMessage: "" });
  achternaam.add(Validate.Presence, { failureMessage: "Voer uw achternaam in." });
  achternaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  email = new LiveValidation("Email", { validMessage: "" });
  email.add(Validate.Presence, { failureMessage: "Voer een e-mail adres in." });
  email.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
  email.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

  zNaamOrganisatie = new LiveValidation("zNaamOrganisatie", { validMessage: "" });
  zNaamOrganisatie.add(Validate.Presence, { failureMessage: "Voer de naam van de organisatie in." });
  zNaamOrganisatie.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  zPostadres = new LiveValidation("zPostadres", { validMessage: "" });
  zPostadres.add(Validate.Presence, { failureMessage: "Voer het postadres van de organisatie in." });
  zPostadres.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  zPostcode = new LiveValidation("zPostcode", { validMessage: "" });
  zPostcode.add(Validate.Presence, { failureMessage: "Voer de postcode van het postadres van de organisatie in." });
  zPostcode.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  zPlaats = new LiveValidation("zPlaats", { validMessage: "" });
  zPlaats.add(Validate.Presence, { failureMessage: "Voer de plaats van het postadres van de organisatie in." });
  zPlaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  zTelefoonnummer = new LiveValidation("zTelefoonnummer", { validMessage: "" });
  zTelefoonnummer.add(Validate.Presence, { failureMessage: "Voer het telefoonnummer van de organisatie in." });
  zTelefoonnummer.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });

  adres = new LiveValidation("Adres", { validMessage: "" });
  adres.add(Validate.Presence, { failureMessage: "Voer uw straatnaam in." });
  adres.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  huisnummer = new LiveValidation("Huisnummer", { validMessage: "" });
  huisnummer.add(Validate.Presence, { failureMessage: "Voer uw huisnummer in." });
  huisnummer.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  postcode = new LiveValidation("Postcode", { validMessage: "" });
  postcode.add(Validate.Presence, { failureMessage: "Voer uw postcode in." });
  postcode.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  plaats = new LiveValidation("Plaats", { validMessage: "" });
  plaats.add(Validate.Presence, { failureMessage: "Voer uw woonplaats in." });
  plaats.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  telefoonnummer = new LiveValidation("Telefoonnummer", { validMessage: "" });
  telefoonnummer.add(Validate.Presence, { failureMessage: "Voer uw telefoonnummer in." });
  telefoonnummer.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
} 
 
  function fillInformatieFields()
{
  var kanaalvalue = '';
	
	if (document.getElementById('ADV').checked) kanaalvalue += document.getElementById('KanaalAdvertentieDropdown').value + ' ';
	if (document.getElementById('RAD').checked) kanaalvalue += document.getElementById('KanaalRadioDropdown').value + ' ';
	if (document.getElementById('TVC').checked) kanaalvalue += document.getElementById('kanaalTV').value + ' ';
	if (document.getElementById('ZKM').checked) kanaalvalue += document.getElementById('KanaalZoekmachineDropdown').value + ' ';
	if (document.getElementById('WED').checked) kanaalvalue += "OOO" + ' ';
	if (document.getElementById('VIA').checked) kanaalvalue += document.getElementById('KanaalviaviaDropdown').value + ' ';
	if (document.getElementById('OUD').checked) kanaalvalue += document.getElementById('KanaalBuitenreclameDropdown').value + ' ';
	if (document.getElementById('PAR').checked) kanaalvalue += document.getElementById('KanaalPartnersDropdown').value + ' ';
	if (document.getElementById('BNO').checked) kanaalvalue += document.getElementById('kanaalBanneractie').value + ' ';
	if (document.getElementById('NBO').checked) kanaalvalue += document.getElementById('kanaalISBWNieuwsbrief').value + ' ';
	if (document.getElementById('ENO').checked) kanaalvalue += document.getElementById('kanaalnieuwsbrief').value + ' ';
	if (document.getElementById('EMA').checked) kanaalvalue += document.getElementById('kanaalEmailing').value + ' ';
	if (document.getElementById('MAI').checked) kanaalvalue += document.getElementById('kanaalMailingbrief').value + ' ';
	if (document.getElementById('BEU').checked) kanaalvalue += document.getElementById('kanaalBeurs').value + ' ';
	if (document.getElementById('VLB').checked) kanaalvalue += document.getElementById('kanaalVoorlichtingsbijeenkomst').value + ' ';
	if (document.getElementById('BRI').checked) kanaalvalue += document.getElementById('kanaalbrochureIncompany').value + ' ';
	if (document.getElementById('BRH').checked) kanaalvalue += document.getElementById('kanaalBrochureHogeschool').value + ' ';
	if (document.getElementById('KanaalAnders').checked) kanaalvalue += "OOO" + ' ';
	
	document.getElementById('kanaaltekst').value = kanaalvalue;
}

function addValidationOpleidingsadvies()
{
  voorletters = new LiveValidation("Voorletters", { validMessage: "" });
  voorletters.add(Validate.Presence, { failureMessage: "Voer uw voorletter(s) in." });
  voorletters.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  voornaam = new LiveValidation("Voornaam", { validMessage: "" });
  voornaam.add(Validate.Presence, { failureMessage: "Voer uw voornaam in." });
  voornaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  achternaam = new LiveValidation("Achternaam", { validMessage: "" });
  achternaam.add(Validate.Presence, { failureMessage: "Voer uw achternaam in." });
  achternaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  telefoon = new LiveValidation("Telefoon", { validMessage: "" });
  telefoon.add(Validate.Presence, { failureMessage: "Voer uw telefoonnummer in." });
  telefoon.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  email = new LiveValidation("Email", { validMessage: "" });
  email.add(Validate.Presence, { failureMessage: "Voer een e-mail adres in." });
  email.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
  email.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
}

function addValidationMailAFriend()
{
  friendnaam = new LiveValidation("Friendnaam", { validMessage: "" });
  friendnaam.add(Validate.Presence, { failureMessage: "Voer de naam van ontvanger." });
  friendnaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  friendEmail = new LiveValidation("FriendEmail", { validMessage: "" });
  friendEmail.add(Validate.Presence, { failureMessage: "Voer een e-mail adres van de ontvanger in." });
  friendEmail.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
  friendEmail.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  mijnnaam = new LiveValidation("Mijnnaam", { validMessage: "" });
  mijnnaam.add(Validate.Presence, { failureMessage: "Voer uw naam in." });
  mijnnaam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  mijnEmail = new LiveValidation("MijnEmail", { validMessage: "" });
  mijnEmail.add(Validate.Presence, { failureMessage: "Voer uw e-mail adres in." });
  mijnEmail.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
  mijnEmail.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
}

function addValidationExternOpleiding()
{
  naam = new LiveValidation("Naam", { validMessage: "" });
  naam.add(Validate.Presence, { failureMessage: "Voer uw naam in." });
  naam.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  email = new LiveValidation("Email", { validMessage: "" });
  email.add(Validate.Presence, { failureMessage: "Voer een e-mail adres van de ontvanger in." });
  email.add(Validate.Email, { failureMessage: "Voer een geldig e-mail adres in: 'voorbeeld@site.nl'." });
  email.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
  telefoon = new LiveValidation("Telefoon", { validMessage: "" });
  telefoon.add(Validate.Presence, { failureMessage: "Voer uw telefoonnummer in." });
  telefoon.add(Validate.Length, {maximum: 150, failureMessage: "Uw ingevoerde tekst is te lang." });
}

function createSummary(form, element)
{
  var output = "";
  output += "<dl class='formElementen'>";

  output += "<dt><strong>Deelnemer</strong></dt><dd>&nbsp;</dd>";
  output += "<dt>Voorletters</dt><dd>" + form.Voorletters.value + "</dd>";
  output += "<dt>&nbsp;</dt><dd>" + getCheckedValue(form.Geslacht) + "</dd>";
  output += "<dt>Voornaam</dt><dd>" + form.Voornaam.value + "</dd>";
  output += "<dt>Tussenvoegsel</dt><dd>" + form.Tussenvoegsel.value + "</dd>";
  output += "<dt>Achternaam</dt><dd>" + form.Achternaam.value + "</dd>";
  output += "<dt>Adres</dt><dd>" + form.Adres.value + "</dd>";
  output += "<dt>Postcode</dt><dd>" + form.Postcode.value + "</dd>";
  output += "<dt>Plaats</dt><dd>" + form.Plaats.value + "</dd>";
  output += "<dt>Tel.Prive</dt><dd>" + form.TelefoonPrive.value + "</dd>";
  output += "<dt>Tel. zakelijk (direct)</dt><dd>" + form.TelefoonWerk.value + "</dd>";
  output += "<dt>Tel. mobiel</dt><dd>" + form.TelefoonMobiel.value + "</dd>";
  output += "<dt>E-mail</dt><dd>" + form.Email.value + "</dd>";
  output += "<dt>Geboorteplaats</dt><dd>" + form.Geboorteplaats.value + "</dd>";
  output += "<dt>Geboortedatum</dt><dd>" + form.GeboorteDag.value + "-" + form.GeboorteMaand.value + "-" + form.GeboorteJaar.value + "</dd>";
  output += "<dt>Functie</dt><dd>" + form.Functie.value + "</dd>";
  
  output += "<dt>&nbsp;</dt><dd>&nbsp;</dd>";
  output += "<dt>De factuur wordt verzonden naar:</dt><dd>" + getCheckedValue(form.FactuuradresType) + "</dd>";

  if (!document.getElementById('FactuuradresPrive').checked)
  {
    output += "<dt>Organisatie/afdeling</dt><dd>" + form.FactuurOrganisatie.value + "</dd>";
    output += "<dt>T.a.v.</dt><dd>" + form.FactuurTAV.value + "</dd>";
    output += "<dt>&nbsp;</dt><dd>" + getCheckedValue(form.FactuurTAVGeslacht) + "</dd>";
	if (document.getElementById('FactuuradresOrg').checked)
	{
	    output += "<dt>Bezoekadres</dt><dd>" + form.OrgAdres.value + "</dd>";
		output += "<dt>Postcode</dt><dd>" + form.OrgPostcode.value + "</dd>";
		output += "<dt>Plaats</dt><dd>" + form.OrgPlaats.value + "</dd>";
	}
	output += "<dt>Postadres</dt><dd>" + form.FactuurAdres.value + "</dd>";
    output += "<dt>Postcode</dt><dd>" + form.FactuurPostcode.value + "</dd>";
    output += "<dt>Plaats</dt><dd>" + form.FactuurPlaats.value + "</dd>";
    output += "<dt>Tel. (direct)</dt><dd>" + form.FactuurTelefoon.value + "</dd>";
    output += "<dt>Locatiecode</dt><dd>" + form.FactuurLocatie.value + "</dd>";
    output += "<dt>BTW-nummer</dt><dd>" + form.FactuurBTW.value + "</dd>";
    output += "<dt>Rekeningnummer</dt><dd>" + form.FactuurRekening.value + "</dd>";
  }

  output += "</dl>";

  document.getElementById(element).innerHTML = output;
}

function showFactuurFields(show, org)
{
  if (show)
  {
    document.getElementById('factuurFields').style.display = "block";
	document.getElementById('factuurFieldsContinued').style.display = "block";
	if (org)
	{
		document.getElementById('orgFields').style.display = "block";
		//factuurBTW.add(Validate.Presence, { failureMessage: "Voer het BTW-nummer voor op de factuur in." });
	}
	else
	{
		document.getElementById('orgFields').style.display = "none";
		//factuurBTW.remove(Validate.Presence, { failureMessage: "Voer het BTW-nummer voor op de factuur in." });
	}
  }
  else
  {
    document.getElementById('factuurFields').style.display = "none";
	document.getElementById('factuurFieldsContinued').style.display = "none";
	document.getElementById('orgFields').style.display = "none";
  }
}

function getCheckedValue(radioObj) {
  if(!radioObj)
    return "";
  var radioLength = radioObj.length;
  if(radioLength == undefined)
    if(radioObj.checked)
      return radioObj.value;
    else
      return "";
  for(var i = 0; i < radioLength; i++) {
    if(radioObj[i].checked) {
      return radioObj[i].value;
    }
  }
  return "";
}

function sendInschrijfForm(form)
{
	arrFields =
    [
		voorletters, voornaam, achternaam, adres, postcode, plaats, telefoonPrive, telefoonMobiel, email, geboortePlaats, geboorteDag, geboorteMaand, geboorteJaar
	];
	arrFactuurFields = 
	[
      factuurOrganisatie, factuurTAV, factuurAdres, factuurPostcode, factuurPlaats, factuurTelefoon, factuurRekening
    ];
	if (form.FactuuradresType[0].checked || form.FactuuradresType[2].checked) arrFields = arrFields.concat(arrFactuurFields);
	if (LiveValidation.massValidate(arrFields))
	{
		form.submit();
	}	
}

function fillBirthDate()
{
	document.getElementById('GeboorteDatum').value = document.getElementById('GeboorteMaand').value + "-" + document.getElementById('GeboorteDag').value + "-" + document.getElementById('GeboorteJaar').value;
}

function fillIncompanyFields()
{
	var afspraakvalue = '';
	var kanaalvalue = '';
	
	afspraakvalue = document.getElementById('Afspraak').value;
	for(var i = 0; i < counter; i++) {
		afspraakvalue += ' of ' + document.getElementById('Afspraak_'+i).value;
	}
	document.getElementById('afspraakverzameling').value = afspraakvalue;
	
	if (document.getElementById('KanaalRadioText').value != '') kanaalvalue += document.getElementById('KanaalRadioText').value + ' ';
	if (document.getElementById('KanaalTvText').value != '') kanaalvalue += document.getElementById('KanaalTvText').value + ' ';
	if (document.getElementById('KanaalInternetText').value != '') kanaalvalue += document.getElementById('KanaalInternetText').value + ' ';
	if (document.getElementById('KanaalVakbladText').value != '') kanaalvalue += document.getElementById('KanaalVakbladText').value + ' ';
	if (document.getElementById('KanaalKrantText').value != '') kanaalvalue += document.getElementById('KanaalKrantText').value + ' ';
	if (document.getElementById('KanaalBeursText').value != '') kanaalvalue += document.getElementById('KanaalBeursText').value + ' ';
	if (document.getElementById('KanaalEmailingText').value != '') kanaalvalue += document.getElementById('KanaalEmailingText').value + ' ';
	if (document.getElementById('KanaalOpleidingText').value != '') kanaalvalue += document.getElementById('KanaalOpleidingText').value + ' ';
	if (document.getElementById('KanaalAndersText').value != '') kanaalvalue += document.getElementById('KanaalAndersText').value + ' ';
	
	document.getElementById('kanaaltekst').value = kanaalvalue;
}
















