// quick browser tests
var ns4 = (document.layers) ? true : false;
var ie4 = (document.all && !document.getElementById) ? true : false;
var ie5 = (document.all && document.getElementById) ? true : false;
var ns6 = (!document.all && document.getElementById) ? true : false;

function show(sw,obj) {
	// show/hide the divisions
	if (sw && (ie4 || ie5) ) document.all[obj].style.visibility = 'visible';
	if (!sw && (ie4 || ie5) ) document.all[obj].style.visibility = 'hidden';
	if (sw && ns4) document.layers[obj].visibility = 'visible';
	if (!sw && ns4) document.layers[obj].visibility = 'hidden';
}

//functie select 
function AutoLink()
{
	var number = document.filter.soort_volgnr.selectedIndex;
	location.href = document.filter.soort_volgnr.options[number].value;
}

function AutoLink1()
{
	var number = document.filter.race_volgnr.selectedIndex;
	location.href = document.filter.race_volgnr.options[number].value;
}

function AutoLink4()
{
	var number = document.filter.incasso_oms.selectedIndex;
	location.href = document.filter.incasso_oms.options[number].value;
}

function AutoLink5()
{
	var number = document.filter.incasso_type.selectedIndex;
	location.href = document.filter.incasso_type.options[number].value;
}

// FOTOALBUM JAVASCRIPT \\
function showhidefield() 
    { 
      if (document.gegevens.exoneratie_akkoord.checked) 
      { 
        document.getElementById("hideablearea").style.display = "block"; 
      } 
      else 
      { 
        document.getElementById("hideablearea").style.display = "none"; 
      } 
    }

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}

//functie open popup
function openpopup(){
	var popurl="aanmelden.asp?actie=opslaan"
	winpops=window.open(popurl,"","width=795,height=620,")
}

//Funtie Layers
function showHide(src) {

for (i=0;i<document.all.length;i++) 
{
	obj = document.all[i];
	if (obj.className == 'showitem') {
		obj.className = 'hideitem';
    	} 
  	}
}
//Funtie Layers
function showShow(src) {

for (i=0;i<document.all.length;i++) 
{
	obj = document.all[i];
	if (obj.className == 'hideitem') {
		obj.className = 'showitem';
    	} 
  	}
}

//smile toevoegen fotoalbum
function smileytoevoegen(iconCode) {	
	reactie.reactie_reactie.value += iconCode + " ";
}



/* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	Written by Bugimus 
	Copyright © 1998-2001 Bugimus, all rights reserved.
	You may use this code for non-commercial use provided you leave this comment block intact
	or credit me in your code.  
	A link back to Bugimus' page would be much appreciated but not required.  
	http://bugimus.com/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */

function showPic( imgName, imgCaption, imgWidth, imgHeight, textColor, bgColor ) {
	if(imgWidth<=100)imgWidth=100
	if(imgHeight<=100)imgHeight=100
	winHeight=imgHeight+20;
	w = window.open('','Demo','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no,width='+imgWidth+',height='+winHeight);
	w.document.write( "<html><head><title>"+imgCaption+"</title>" );
	w.document.write( "<STYLE TYPE='text/css'>" );
	w.document.write( "A {font-family: verdana; font-size: 10px; color: "+textColor+"; text-decoration : none;}" );
	w.document.write( "A:Visited {font-family: verdana;font-size: 10px; color: "+textColor+"; }" );
	w.document.write( "A:Active { font-family: verdana; font-size: 10px; color: "+textColor+"; }" );
	w.document.write( "A:Hover { font-family: verdana; font-size: 10px; color: "+textColor+"; }" );
	w.document.write( "IMG {border-color : "+textColor+";}" );
	w.document.write( "BODY { font-family: verdana; font-size : 10px; font-weight: normal; color : "+textColor+"; background-color : "+bgColor+"; }" );
	w.document.write( "</STYLE>" );
	w.document.write( "<script language='JavaScript'>\n");
	w.document.write( "IE5=NN4=NN6=false\n");
	w.document.write( "if(document.all)IE5=true;\n");
	w.document.write( "else if(document.getElementById)NN6=true\n");
	w.document.write( "else if(document.layers)NN4=true\n");
	w.document.write( "function autoSize() {\n");
	w.document.write( "	if(IE5) self.resizeTo(document.images[0].width+10,document.images[0].height+31+20)\n");
	w.document.write( "	else if(NN6) self.sizeToContent()\n");
	w.document.write( "	else top.window.resizeTo(document.images[0].width,document.images[0].height+20)\n");
	w.document.write( "	self.focus()\n");
	w.document.write( "}\n</scr");
	w.document.write( "ipt>\n");
	w.document.write( "</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad=" );
	w.document.write( "'javascript:autoSize();'>" );
	w.document.write( "<table cellpadding=0 cellspacing=0 border=0><tr><td colspan=3><img src='"+imgName+"' border=0 alt='"+imgCaption+"'></td></tr>" );
	w.document.write( "<tr><td align='left'>&nbsp;&nbsp;<a>&copy; <a href='http://www.tricat.nl/' target='_blank'>www.tricat.nl</a></td>" );
	w.document.write( "<td align='right'><a href='javascript:top.window.close();'>sluit scherm</a>&nbsp;&nbsp;</td></tr>" );
	w.document.write( "</table></body></html>" );
	w.document.close();
}

//functie checkformulier - reactie
function formulier(reactie)
{
	//if(""==document.forms.reactie.reactie_naam.value)
	//{
	//	bericht1.innerHTML = "vul een naam in...";
	//	document.forms.reactie.reactie_naam.focus();
	//	return false;
	//}
	//bericht1.innerHTML = "naam:";
	//if(""==document.forms.reactie.reactie_reactie.value)
	//{
	//	bericht2.innerHTML = "vul een reactie in...";
	//	document.forms.reactie.reactie_reactie.focus();
	//	return false;
	//}
	//bericht2.innerHTML = "";
	alert("test");
	document.reactie.submit()
}


//functie checkformulier - reactie
function formulier2(reactie)
{
	if(""==document.forms.reactie.reactie_naam.value)
	{
		bericht1.innerHTML = "vul een naam in...";
		document.forms.reactie.reactie_naam.focus();
		return false;
	}
	bericht1.innerHTML = "naam:";
	if(""==document.forms.reactie.reactie_reactie.value)
	{
		bericht2.innerHTML = "vul een reactie in...";
		document.forms.reactie.reactie_reactie.focus();
		return false;
	}
	bericht2.innerHTML = "";
	document.reactie.submit()
}


	// GASTENBOEK JAVASCRIPT \\

function smileygastenboek(iconCode) {	
	gegevens.gastenboek_bericht.value += iconCode + " ";
}


//functie checkformulier - GASTENBOEK
function checkformgastenboek(gegevens)
{
	if(""==document.forms.gegevens.gastenboek_naam.value)
	{
		bericht1.innerHTML = "<font color='red'>Naam :</font>";
		document.forms.gegevens.gastenboek_naam.focus();
		return false;
	}
	bericht1.innerHTML = "Naam :";
	if(""==document.forms.gegevens.gastenboek_bericht.value)
	{
		bericht2.innerHTML = "<font color='red'>Bericht :</font>";
		document.forms.gegevens.gastenboek_bericht.focus();
		return false;
	}
	bericht2.innerHTML = "Bericht :";

	if(""==document.forms.gegevens.gastenboek_bericht.value)
	{
		atPos = document.forms.gegevens.gastenboek_email.value.indexOf("@",0);
		if (atPos == -1) 
		{	
			bericht3.innerHTML = "<font color='red'>E-mailadres (@):</font>";
			document.forms.gegevens.gastenboek_email.focus();
			return false;
		}
	}
	bericht3.innerHTML = "E-mailadres:";
	document.gegevens.submit()
}
//functie checkformulier - Registratie
function checkformregistratie(gegevens)
{
	isValid(document.forms.gegevens.licentie_nummer.value, document.forms.gegevens.licentie_code.value);
	if(""==document.forms.gegevens.gegevens_achternaam.value)
	{
		bericht1.innerHTML = "<font color='red'>Achternaam</b></font>";
		document.forms.gegevens.gegevens_achternaam.focus();
		return false;
	}
	bericht1.innerHTML = "Achternaam";

	if(""==document.forms.gegevens.gegevens_voornaam.value)
	{
		bericht18.innerHTML = "<font color='red'>Voornaam</b></font>";
		document.forms.gegevens.gegevens_voornaam.focus();
		return false;
	}
	bericht18.innerHTML = "Voornaam";

	if(""==document.forms.gegevens.gegevens_adreshuisnummer.value)
	{
		bericht2.innerHTML = "<font color='red'>Adres</b></font>";
		document.forms.gegevens.gegevens_adreshuisnummer.focus();
		return false;
	}
	bericht2.innerHTML = "Adres";

	if(document.forms.gegevens.gegevens_postcodecijfers.value.length <= 3) 
	{
		bericht3.innerHTML = "<font color='red'>Postcode</b></font>";
		document.forms.gegevens.gegevens_postcodecijfers.focus();
		return false;
	}
	bericht3.innerHTML = "Postcode";

	if(""==document.forms.gegevens.gegevens_woonplaats.value)
	{
		bericht4.innerHTML = "<font color='red'>Woonplaats</b></font>";
		document.forms.gegevens.gegevens_woonplaats.focus();
		return false;
	}
	bericht4.innerHTML = "Woonplaats";

	//if(""==document.forms.gegevens.gegevens_land.value)
	//{
	//	bericht17.innerHTML = "<font color='red'>Land</b></font>";
	//	document.forms.gegevens.gegevens_land.focus();
	//	return false;
	//}
	//bericht17.innerHTML = "land";

	if(""==document.forms.gegevens.gegevens_telprive_net.value)
	{
		bericht14.innerHTML = "<font color='red'>Tel.privé</b></font>";
		document.forms.gegevens.gegevens_telprive_net.focus();
		return false;
	}
	bericht14.innerHTML = "Tel.privé";

	if(""==document.forms.gegevens.gegevens_telprive_nummer.value)
	{
		bericht14.innerHTML = "<font color='red'>Tel.privé</b></font>";
		document.forms.gegevens.gegevens_telprive_nummer.focus();
		return false;
	}
	bericht14.innerHTML = "Tel.privé";

	if(""==document.forms.gegevens.gegevens_email.value)
	{
		bericht5.innerHTML = "<font color='red'>E-mail</b></font>";
		document.forms.gegevens.gegevens_email.focus();
		return false;
	}
	bericht5.innerHTML = "E-mail";

	atPos = document.forms.gegevens.gegevens_email.value.indexOf("@",0);

	if (atPos == -1) 
	{
		bericht5.innerHTML = "<font color='red'>E-mail</b></font>";
		document.forms.gegevens.gegevens_email.focus();
		return false;
	}
	bericht5.innerHTML = "E-mail";

	if(""==document.forms.gegevens.gegevens_geboortedatumdag.value)
	{
		bericht6.innerHTML = "<font color='red'>Geboortedatum</b></font>";
		document.forms.gegevens.gegevens_geboortedatumdag.focus();
		return false;
	}
	bericht6.innerHTML = "Geboortedatum";


	if(""==document.forms.gegevens.gegevens_geboortedatummaand.value)
	{
		bericht6.innerHTML = "<font color='red'>Geboortedatum</b></font>";
		document.forms.gegevens.gegevens_geboortedatummaand.focus();
		return false;
	}
	bericht6.innerHTML = "Geboortedatum";


	if(""==document.forms.gegevens.gegevens_geboortedatumjaar.value)
	{
		bericht6.innerHTML = "<font color='red'>Geboortedatum</b></font>";
		document.forms.gegevens.gegevens_geboortedatumjaar.focus();
		return false;
	}
	bericht6.innerHTML = "Geboortedatum";

	if(document.forms.gegevens.gegevens_geboortedatumjaar.value.length <= 3) 
	{
		bericht6.innerHTML = "<font color='red'>Geboortedatum</b></font>";
		document.forms.gegevens.gegevens_geboortedatumjaar.focus();
		return false;
	}
	bericht6.innerHTML = "Geboortedatum";

	if(""==document.forms.gegevens.gegevens_bankrekeningnummer.value)
	{
		bericht7.innerHTML = "<font color='red'>Bankrekeningnummer</b></font>";
		document.forms.gegevens.gegevens_bankrekeningnummer.focus();
		return false;
	}
	bericht7.innerHTML = "Bankrekeningnummer";

	if(""==document.forms.gegevens.gegevens_ternaamstelling.value)
	{
		bericht23.innerHTML = "<font color='red'>Ter naamstelling van</b></font>";
		document.forms.gegevens.gegevens_ternaamstelling.focus();
		return false;
	}
	bericht23.innerHTML = "Ter naamstelling van";


	if(""==document.forms.gegevens.gegevens_ongeval_naam.value)
	{
		bericht20.innerHTML = "<font color='red'>Naam</b></font>";
		document.forms.gegevens.gegevens_ongeval_naam.focus();
		return false;
	}
	bericht20.innerHTML = "Naam";

	if(""==document.forms.gegevens.gegevens_ongeval_adres.value)
	{
		bericht21.innerHTML = "<font color='red'>Adres</b></font>";
		document.forms.gegevens.gegevens_ongeval_adres.focus();
		return false;
	}
	bericht21.innerHTML = "Adres";

	if(""==document.forms.gegevens.gegevens_ongeval_woonplaats.value)
	{
		bericht22.innerHTML = "<font color='red'>Woonplaats</b></font>";
		document.forms.gegevens.gegevens_ongeval_woonplaats.focus();
		return false;
	}
	bericht22.innerHTML = "Woonplaats";

	if(""==document.forms.gegevens.gegevens_ongeval_relatie.value)
	{
		bericht19.innerHTML = "<font color='red'>Relatie tot coureur</b></font>";
		document.forms.gegevens.gegevens_ongeval_relatie.focus();
		return false;
	}
	bericht19.innerHTML = "Relatie tot coureur";


	if(""==document.forms.gegevens.licentie_nummer.value)
	{
		bericht8.innerHTML = "<font color='red'>Gebruikersnaam</b></font>";
		document.forms.gegevens.licentie_nummer.focus();
		return false;
	}
	bericht8.innerHTML = "Gebruikersnaam";

	if(""==document.forms.gegevens.licentie_code.value)
	{
		bericht9.innerHTML = "<font color='red'>Persoonlijke code(min 6 tekens)</b></font>";
		document.forms.gegevens.licentie_code.focus();
		return false;
	}
	bericht9.innerHTML = "Persoonlijke code(min 6 tekens)";


	if(document.forms.gegevens.licentie_code.value.length <= 5) 
	{
		bericht9.innerHTML = "<font color='red'>Persoonlijke code</b></font>";
		document.forms.gegevens.licentie_code.focus();
		return false;
	}
	
	bericht9.innerHTML = "Persoonlijke code";

	if(""==document.forms.gegevens.licentie_code2.value)
	{
		bericht10.innerHTML = "<font color='red'>Controle persoonlijke code</font>";
		document.forms.gegevens.licentie_code2.focus();
		return false;
	}
	bericht10.innerHTML = "Controle persoonlijke code";

	if(document.forms.gegevens.licentie_code.value != document.forms.gegevens.licentie_code2.value) 
	{
		bericht15.innerHTML = "<font color='red'>* De ingevoerde wachtwoorden komen niet overheen met elkaar!</font>";
		document.forms.gegevens.licentie_code.focus();
		return false;
	}
	bericht15.innerHTML = "";

	if(""==document.forms.gegevens.motor_merk.value)
	{
		bericht11.innerHTML = "<font color='red'>Merk motor</b></font>";
		document.forms.gegevens.motor_merk.focus();
		return false;
	}
	bericht11.innerHTML = "Merk motor";

	if(""==document.forms.gegevens.motor_type.value)
	{
		bericht12.innerHTML = "<font color='red'>Type</b></font>";
		document.forms.gegevens.motor_type.focus();
		return false;
	}
	bericht12.innerHTML = "Type";

	if(""==document.forms.gegevens.motor_rijbewijs.value)
	{
		bericht16.innerHTML = "<font color='red'>Geldig rijbewijs A nr.</b></font>";
		document.forms.gegevens.motor_rijbewijs.focus();
		return false;
	}
	bericht16.innerHTML = "Geldig rijbewijs A nr.";

	if(document.forms.gegevens.motor_rijbewijs.value.length <= 7) 
	{
		bericht16.innerHTML = "<font color='red'>Geldig rijbewijs A nr.</b></font>";
		document.forms.gegevens.motor_rijbewijs.focus();
		return false;
	}
	bericht16.innerHTML = "Geldig rijbewijs A nr.";
	
	if(document.gegevens.Akkoord_Deelnemer.checked == false) { 
    	alert('U dient akkoord te gaan met de Verklaring deelnemer');
    	return false;
	} else { 
		document.gegevens.submit()
	}
}



//functie wijzigww
function checkformww(gegevens)
{

	if(""==document.forms.gegevens.licentie_code.value)
	{
		bericht9.innerHTML = "<font color='red'>Persoonlijke code(min 6 tekens)</b></font>";
		document.forms.gegevens.licentie_code.focus();
		return false;
	}
	bericht9.innerHTML = "Persoonlijke code(min 6 tekens)";


	if(document.forms.gegevens.licentie_code.value.length <= 5) 
	{
		bericht9.innerHTML = "<font color='red'>Persoonlijke code</b></font>";
		document.forms.gegevens.licentie_code.focus();
		return false;
	}	
	bericht9.innerHTML = "Persoonlijke code";

	if(""==document.forms.gegevens.licentie_code2.value)
	{
		bericht10.innerHTML = "<font color='red'>Controle persoonlijke code</font>";
		document.forms.gegevens.licentie_code2.focus();
		return false;
	}
	bericht10.innerHTML = "Controle persoonlijke code";

	if(document.forms.gegevens.licentie_code.value != document.forms.gegevens.licentie_code2.value) 
	{
		bericht15.innerHTML = "<font color='red'>* De ingevoerde wachtwoorden komen niet overheen met elkaar!</font>";
		document.forms.gegevens.licentie_code.focus();
		return false;
	}
	bericht15.innerHTML = "";
	document.gegevens.submit()
}


//functie checkformulier - Registratie
function checkformwijzigen(gegevens)
{
	if(""==document.forms.gegevens.gegevens_achternaam.value)
	{
		bericht1.innerHTML = "<font color='red'>Achternaam</b></font>";
		document.forms.gegevens.gegevens_achternaam.focus();
		return false;
	}
	bericht1.innerHTML = "Achternaam";

	if(""==document.forms.gegevens.gegevens_voornaam.value)
	{
		bericht2.innerHTML = "<font color='red'>Voornaam</b></font>";
		document.forms.gegevens.gegevens_voornaam.focus();
		return false;
	}
	bericht2.innerHTML = "Voornaam";

	if(""==document.forms.gegevens.gegevens_adres.value)
	{
		bericht3.innerHTML = "<font color='red'>Adres</b></font>";
		document.forms.gegevens.gegevens_adres.focus();
		return false;
	}
	bericht3.innerHTML = "Adres";

	if(document.forms.gegevens.gegevens_postcode.value.length <= 1) 
	{
		bericht4.innerHTML = "<font color='red'>Postcode</b></font>";
		document.forms.gegevens.gegevens_postcode.focus();
		return false;
	}
	bericht4.innerHTML = "Postcode";

	if(""==document.forms.gegevens.gegevens_woonplaats.value)
	{
		bericht5.innerHTML = "<font color='red'>Woonplaats</b></font>";
		document.forms.gegevens.gegevens_woonplaats.focus();
		return false;
	}
	bericht5.innerHTML = "Woonplaats";

	//if(""==document.forms.gegevens.gegevens_land.value)
	//{
	//	bericht6.innerHTML = "<font color='red'>Land</b></font>";
	//	document.forms.gegevens.gegevens_land.focus();
	//	return false;
	//}
	//bericht6.innerHTML = "Land";

	if(""==document.forms.gegevens.gegevens_telprive.value)
	{
		bericht7.innerHTML = "<font color='red'>Tel.privé</b></font>";
		document.forms.gegevens.gegevens_telprive.focus();
		return false;
	}
	bericht7.innerHTML = "Tel.privé";

	if(""==document.forms.gegevens.gegevens_email.value)
	{
		bericht8.innerHTML = "<font color='red'>E-mail</b></font>";
		document.forms.gegevens.gegevens_email.focus();
		return false;
	}
	bericht8.innerHTML = "E-mail";

	atPos = document.forms.gegevens.gegevens_email.value.indexOf("@",0);

	if (atPos == -1) 
	{
		bericht8.innerHTML = "<font color='red'>E-mail</b></font>";
		document.forms.gegevens.gegevens_email.focus();
		return false;
	}
	bericht8.innerHTML = "E-mail";

	if(""==document.forms.gegevens.gegevens_geboortedatum.value)
	{
		bericht9.innerHTML = "<font color='red'>Geboortedatum</b></font>";
		document.forms.gegevens.gegevens_geboortedatum.focus();
		return false;
	}
	bericht9.innerHTML = "Geboortedatum";

	if(""==document.forms.gegevens.gegevens_bankrekeningnummer.value)
	{
		bericht10.innerHTML = "<font color='red'>Bankrekeningnummer</b></font>";
		document.forms.gegevens.gegevens_bankrekeningnummer.focus();
		return false;
	}
	bericht10.innerHTML = "Bankrekeningnummer";

	if(""==document.forms.gegevens.gegevens_ongeval_naam.value)
	{
		bericht11.innerHTML = "<font color='red'>Naam</b></font>";
		document.forms.gegevens.gegevens_ongeval_naam.focus();
		return false;
	}
	bericht11.innerHTML = "Naam";

	if(""==document.forms.gegevens.gegevens_ongeval_adres.value)
	{
		bericht12.innerHTML = "<font color='red'>Adres</b></font>";
		document.forms.gegevens.gegevens_ongeval_adres.focus();
		return false;
	}
	bericht12.innerHTML = "Adres";

	if(""==document.forms.gegevens.gegevens_ongeval_woonplaats.value)
	{
		bericht13.innerHTML = "<font color='red'>Woonplaats</b></font>";
		document.forms.gegevens.gegevens_ongeval_woonplaats.focus();
		return false;
	}
	bericht13.innerHTML = "Woonplaats";

	if(""==document.forms.gegevens.gegevens_ongeval_relatie.value)
	{
		bericht14.innerHTML = "<font color='red'>Relatie</b></font>";
		document.forms.gegevens.gegevens_ongeval_relatie.focus();
		return false;
	}
	bericht14.innerHTML = "Relatie";

	if(""==document.forms.gegevens.motor_merk.value)
	{
		bericht15.innerHTML = "<font color='red'>Merk motor</b></font>";
		document.forms.gegevens.motor_merk.focus();
		return false;
	}
	bericht15.innerHTML = "Merk motor";

	if(""==document.forms.gegevens.motor_type.value)
	{
		bericht16.innerHTML = "<font color='red'>Type</b></font>";
		document.forms.gegevens.motor_type.focus();
		return false;
	}
	bericht16.innerHTML = "Type";
	document.gegevens.submit()
}


function printDiv (id) {
  if (document.all && window.print) {
    div2print = document.all[id];
    window.print();
  }
}

function isNumeric(val)
{
 if (Number(val) != val) 
 { alert('Alleen cijfers zijn toegestaan!');}
}

function isNumericField(val,fieldname)
{
 if (Number(val) != val)
 { 
 	alert('Alleen cijfers zijn toegestaan bij ' + fieldname);
 }
 else
 {
	 if (fieldname == 'Bankrekening')
	 	ElfProef();
 }
}

function isNumericFieldEx(val,fieldname)
{
 if (Number(val) != val)
 { 
 	alert('Alleen cijfers zijn toegestaan bij ' + fieldname);
 }
 else
 {
	 var Land = document.gegevens.gegevens_land.value;
	 if(  Land == 'Nederland')
	 {
	 	ElfProef();
	 }
 }
}

function checkForSingleQuotes()
{
	var counter = 0;
	for (a = 0; a < document.gegevens.elements.length; a++)
	{
		if (document.gegevens.elements(a).value.indexOf("'") != -1)
		{
			document.gegevens.elements(a).style.color = '#FFFFFF';
			document.gegevens.elements(a).style.backgroundColor = '#CC0000';
			counter = counter + 1;																															
		}
	}
	if (counter == 0)
	{
		document.gegevens.submit();
	}
	else
	{
		alert("In " + counter + " tekstveld(en) wordt een enkel aanhalingsteken gebruikt! Voor uw gemak (is)(zijn) deze veld(en) van een rode achtergrond voorzien... \n \n (Enkele aanhalingstekens zijn niet toegestaan, omdat de gegevens dan niet weggeschreven kunnen worden in de database)");	
	}
}

function ElfProef() 
{
	// je hebt een bankrekeningnummer
	// baknrekening nummer verdeel je in het aantal cijfers
	// elk cijfer vermenigvuldig je met het indexcijfer (1, 2, 4, 8, 16, 32, etc.)
	var totaalsom = 0;
	var elfproefUitvoeren = true;
	
	var elfproefCijfers = new Array();
	
	elfproefCijfers[0] = 10;
	elfproefCijfers[1] = 9;
	elfproefCijfers[2] = 8;
	elfproefCijfers[3] = 7;
	elfproefCijfers[4] = 6;
	elfproefCijfers[5] = 5;
	elfproefCijfers[6] = 4;
	elfproefCijfers[7] = 3;
	elfproefCijfers[8] = 2;
	elfproefCijfers[9] = 1;
	
	var bankNR = document.gegevens.gegevens_bankrekeningnummer.value; 
	
	if (bankNR.length == 9)
	{
		bankNR = "0" + bankNR;
	}
	else if (bankNR.length != 10)
	{
		elfproefUitvoeren = false;
	}
	
	if (elfproefUitvoeren == true)
	{
		for (b = 0; b < bankNR.length; b++)
		{
			var cijferUitBankNR = bankNR.substr(b, 1);
			totaalsom = totaalsom + (cijferUitBankNR * elfproefCijfers[b])
		}
		totaalsom = totaalsom / 11; // delen door 11, wanneer decimaal getal: elfproef mislukt
		totaalsom = String(totaalsom); // ff een stringetje van maken om te kunnen kont-roeleren op een puntie
		if (totaalsom.indexOf(".") != -1)
		{
			alert("Uw bankrekeningnummer is niet geldig!");
			document.gegevens.gegevens_bankrekeningnummer.style.color = "#FFFFFF";
			document.gegevens.gegevens_bankrekeningnummer.style.backgroundColor = "#CC0000";
			document.gegevens.gegevens_bankrekeningnummer.style.border = "1px solid #000000";
		}
	}
}

function Popup() {
window.open( "contactlijst.asp", "myWindow", 
"status = 1, height = 300, width = 300, resizable = 0" )
}

function settekst(email) { 
 gegevens.bericht_aan.value += email + " ";
}

//Funtie Layers
function showHide(src) {

for (i=0;i<document.all.length;i++) 
{
	obj = document.all[i];
	if (obj.className == 'showitem') {
		obj.className = 'hideitem';
    	} 
  	}
}
//Funtie Layers
function showShow(src) {

for (i=0;i<document.all.length;i++) 
{
	obj = document.all[i];
	if (obj.className == 'hideitem') {
		obj.className = 'showitem';
    	} 
  	}
}

//functie gastenboek
function smileytoevoegen(iconCode) {	
	gegevens.gastenboek_reactie.value += iconCode + " ";
}

//functie open popup
function openpopup(){
	var popurl="cms_beheer.asp"
	winpops=window.open(popurl,"","width=795,height=620,")
}


//functie text link submit
function submitlink ( selectedtype )
{
  document.gegevens.submittype.value = selectedtype ;
  document.gegevens.submit() ;
}

//Function to open pop up window
function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}


//functie select 
function AutoLink2()
{
	var number = document.filter.soort_volgnr.selectedIndex;
	location.href = document.filter.soort_volgnr.options[number].value;
}

function AutoLink3()
{
	var number = document.filter.race_volgnr.selectedIndex;
	location.href = document.filter.race_volgnr.options[number].value;
}

//kalender
function show_calendar(str_target, str_datetime) {
	var arr_months = ["Januari", "Februari", "Maart", "April", "Mei", "Juni",
		"Juli", "Augustus", "September", "Oktober", "November", "December"];
	var week_days = ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"];
	var n_weekstart = 1; // day week starts from (normally 0 or 1)

	var dt_datetime = (str_datetime == null || str_datetime =="" ?  new Date() : str2dt(str_datetime));
	var dt_prev_month = new Date(dt_datetime);
	dt_prev_month.setMonth(dt_datetime.getMonth()-1);
	var dt_next_month = new Date(dt_datetime);
	dt_next_month.setMonth(dt_datetime.getMonth()+1);
	var dt_firstday = new Date(dt_datetime);
	dt_firstday.setDate(1);
	dt_firstday.setDate(1-(7+dt_firstday.getDay()-n_weekstart)%7);
	var dt_lastday = new Date(dt_next_month);
	dt_lastday.setDate(0);
	
	// html generation (feel free to tune it for your particular application)
	// print calendar header
	var str_buffer = new String (
		"<html>\n"+
		"<head>\n"+
		"	<title>kalender</title>\n"+
		"<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\" />\n"+
		"</head>\n"+
		"<body bgcolor=\"White\" topmargin=0 leftmargin=0 bottommargin=0 rightmargin=0>\n"+
		"<table  cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n"+
		"<tr><td>\n"+
		"<table cellspacing=\"0\" cellpadding=\"3\" border=\"0\" width=\"100%\">\n"+
		"<tr>\n	<td style=\"background-image: url(images/header_top.gif);\"><a href=\"javascript:window.opener.show_calendar('"+
		str_target+"', '"+ dt2dtstr(dt_prev_month)+"'+document.cal.time.value);\">"+
		"<img src=\"images/app_vorige.gif\"  border=\"0\""+
		" alt=\"Vorige maand\"></a></td>\n"+
		"	<td colspan=\"5\" align=\"center\" style=\"background-image: url(images/header_top.gif);\">"+
		"<font color=\"#DDDDDD\" face=\"tahoma, verdana\" size=\"2\">"
		+arr_months[dt_datetime.getMonth()]+" "+dt_datetime.getFullYear()+"</font></td>\n"+
		"	<td align=\"right\" style=\"background-image: url(images/header_top.gif);\"><a href=\"javascript:window.opener.show_calendar('"
		+str_target+"', '"+dt2dtstr(dt_next_month)+"'+document.cal.time.value);\">"+
		"<img src=\"images/app_volgende.gif\" border=\"0\""+
		" alt=\"Volgende maand\"></a></td>\n</tr>\n"
	);

	var dt_current_day = new Date(dt_firstday);
	// print weekdays titles
	str_buffer += "<tr>\n";
	for (var n=0; n<7; n++)
		str_buffer += "	<td bgcolor=\"#729EBA\" align=\"center\">"+
		week_days[(n_weekstart+n)%7]+"</td>\n";
	// print calendar table
	str_buffer += "</tr>\n";
	while (dt_current_day.getMonth() == dt_datetime.getMonth() ||
		dt_current_day.getMonth() == dt_firstday.getMonth()) {
		// print row heder
		str_buffer += "<tr>\n";
		for (var n_current_wday=0; n_current_wday<7; n_current_wday++) {
				if (dt_current_day.getDate() == dt_datetime.getDate() &&
					dt_current_day.getMonth() == dt_datetime.getMonth())
					// print current date
					str_buffer += "	<td bgcolor=\"#FFB6C1\" align=\"center\">";
				else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)
					// weekend days
					str_buffer += "	<td bgcolor=\"#DBEAF5\" align=\"center\">";
				else
					// print working days of current month
					str_buffer += "	<td bgcolor=\"white\" align=\"center\">";

				if (dt_current_day.getMonth() == dt_datetime.getMonth())
					// print days of current month
					str_buffer += "<a href=\"javascript:window.opener."+str_target+
					".value='"+dt2dtstr(dt_current_day)+"'+document.cal.time.value; window.close();\">"+
					"";
				else 
					// print days of other months
					str_buffer += "<a href=\"javascript:window.opener."+str_target+
					".value='"+dt2dtstr(dt_current_day)+"'+document.cal.time.value; window.close();\">"+
					"";
				str_buffer += dt_current_day.getDate()+"</font></a></td>\n";
				dt_current_day.setDate(dt_current_day.getDate()+1);
		}
		// print row footer
		str_buffer += "</tr>\n";
	}
	// print calendar footer
	str_buffer +=
		"<form name=\"cal\">\n<tr><td colspan=\"7\" bgcolor=\"#729EBA\">"+
		"Tijd: <input type=\"text\" name=\"time\" value=\""+dt2tmstr(dt_datetime)+
		"\" size=\"8\" maxlength=\"8\"></font></td></tr>\n</form>\n" +
		"</table>\n" +
		"</tr>\n</td>\n</table>\n" +
		"</body>\n" +
		"</html>\n";

	var vWinCal = window.open("", "Calendar", 
		"width=200,height=195,status=no,resizable=no,top=200,left=200");
	vWinCal.opener = self;
	var calc_doc = vWinCal.document;
	calc_doc.write (str_buffer);
	calc_doc.close();
}
// datetime parsing and formatting routimes. modify them if you wish other datetime format
function str2dt (str_datetime) {
	var re_date = /^(\d+)\-(\d+)\-(\d+)\s+(\d+)\:(\d+)\:(\d+)$/;
	if (!re_date.exec(str_datetime))
		return alert("Ongeldige datum: "+ str_datetime);
	return (new Date (RegExp.$3, RegExp.$2-1, RegExp.$1, RegExp.$4, RegExp.$5, RegExp.$6));
}
function dt2dtstr (dt_datetime) {
	return (new String (
			dt_datetime.getDate()+"-"+(dt_datetime.getMonth()+1)+"-"+dt_datetime.getFullYear()+" "));
}
function dt2tmstr (dt_datetime) {
	return (new String (
			dt_datetime.getHours()+":"+dt_datetime.getMinutes()+":"+dt_datetime.getSeconds()));
}

function browser_checker() {
	var browser = navigator.appName;
	//var b_version=navigator.appVersion;
	//alert(browser + ", versie " + b_version);
	//var version=parseFloat(b_version);

	if ((browser == "Microsoft Internet Explorer") && (window.XMLHttpRequest))
	{
		document.getElementById("inhoud").style.position="absolute";
		document.getElementById("inhoud").style.top="75px";
		document.getElementById("menu").style.marginTop="25px";
		document.getElementById("menu").style.marginLeft="259px";
	} 
	else if (browser == "Netscape")
	{
		document.getElementById("inhoud").style.position="absolute";
		document.getElementById("inhoud").style.marginTop="35px";
		document.getElementById("menu").style.marginTop="41px";
		document.getElementById("menu").style.marginLeft="259px";
	}
}