// JavaScript Document

<!--//--><![CDATA[//><!--
startList = function() {
if (document.all&&document.getElementById) {
MenuRoot = document.getElementById("Menu");
for (x=0; x<MenuRoot.childNodes.length; x++) {
node = MenuRoot.childNodes[x];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}

if (window.attachEvent)
window.attachEvent("onload", startList)
else
window.onload=startList;

//--><!]]>

function popup_folder_url(URL){
window.open("../Folder/" + URL,"folder","toolbar=0,scrollbars=0,location=0,status=yes,menubar=0,resizable=0, width=900, height=625")
self.opener=null;
}
function popup_kaart(URL){
window.open(URL,"foto","toolbar=0,scrollbars=0,location=0,status=yes,menubar=0,resizable=0, width=600, height=470")
self.opener=null;
}

function viewFoto(URL){
	var URL = URL;
	var Maxbreedte = screen.width - 50;
	var Maxhoogte = screen.height - 100;
	Nieuwscherm =window.open("../Pages/Foto_popup.php?Foto="+URL,"foto_up","toolbar=no,location=no,scrollbars=no,status=no,menubar=no,resizable=no,width="+Maxbreedte+"px,height="+Maxhoogte+"px");
	Nieuwscherm.focus();
}
function SizeFoto(){
	var VerhoudingOrigineel = eval(pic).width / eval(pic).height;
	var Maxbreedte = screen.width - 20;
	var Maxhoogte = screen.height - 20;

	if(Maxbreedte<eval(pic).width){
		eval(pic).width = Maxbreedte;
	}
	if(Maxhoogte<eval(pic).height){
		eval(pic).height = Maxhoogte;
		eval(pic).width = (Maxhoogte*VerhoudingOrigineel);
	}

	var PositieLinks = (screen.width-eval(pic).width+28)/2;
	var PositieBoven = (screen.height-eval(pic).height+28)/2;

	window.moveTo(PositieLinks, PositieBoven);
	window.resizeTo(eval(pic).width+28, eval(pic).height+68);
	window.moveTo(PositieLinks, PositieBoven);

}






// Functie om het Nieuwsbrief formulier te controleren.
function NieuwsbriefControleer(){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	var Foutmelding = '';
	submitOK = 'True';

	var count = 0;
		for (i=0; document.NieuwsbriefFormulier.Aanhef[i]; i++) {
		   if ( document.NieuwsbriefFormulier.Aanhef[i].checked == true ) {
				count++;
		   }
		}
	
		if (count == 0) {
					   Foutmelding = Foutmelding + '- Aanhef.\n';
		}

	if (document.NieuwsbriefFormulier.Naam.value.length == 0){
		Foutmelding = Foutmelding + '- Naam.\n';
		document.NieuwsbriefFormulier.Naam.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.NieuwsbriefFormulier.Naam.style.border = '1px solid #094e93';
	}
	
	if (filter.test(document.NieuwsbriefFormulier.Email.value)){
		document.NieuwsbriefFormulier.Email.style.border = '1px solid #999999';
	}
	else{
		Foutmelding = Foutmelding + '- Vul een geldig emailadres in.\n';
		document.NieuwsbriefFormulier.Email.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	if (submitOK == 'False'){
		alert('De volgende velden zijn verplicht:\n' + Foutmelding);
		return false;
	}
}
// Einde van deze functie.

// Functie om het Vragen/Klachten formulier te controleren.
function VragenControleer(){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	var Foutmelding = '';
	submitOK = 'True';
	
	if (document.VragenForm.Barcode.value.length == 0){
		Foutmelding = Foutmelding + '- Barcode.\n';
		document.VragenForm.Barcode.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.VragenForm.Barcode.style.border = '1px solid #094e93';
	}
	//
	var count = 0;
	for (i=0; document.VragenForm.Aanhef2[i]; i++) {
		if ( document.VragenForm.Aanhef2[i].checked == true ) {
			count++;
		}
	}
	if (count == 0) {
		Foutmelding = Foutmelding + '- Aanhef.\n';
	}
	//
	if (document.VragenForm.Voornaam.value.length == 0){
		Foutmelding = Foutmelding + '- Voornaam.\n';
		document.VragenForm.Voornaam.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.VragenForm.Voornaam.style.border = '1px solid #094e93';
	}
	//
	if (document.VragenForm.Achternaam.value.length == 0){
		Foutmelding = Foutmelding + '- Achternaam.\n';
		document.VragenForm.Achternaam.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.VragenForm.Achternaam.style.border = '1px solid #094e93';
	}
	//
	if (filter.test(document.VragenForm.Email2.value)){
		document.VragenForm.Email2.style.border = '1px solid #999999';
	}
	else{
		Foutmelding = Foutmelding + '- Vul een geldig emailadres in.\n';
		document.VragenForm.Email2.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	if (document.VragenForm.Vestiging2.value == 0){
		Foutmelding = Foutmelding + '- Selecteer een vestiging.\n';
		document.VragenForm.Vestiging2.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.VragenForm.Vestiging2.style.border = '1px solid #094e93';
	}
	//
	if (document.VragenForm.Vraag.value.length == 0){
		Foutmelding = Foutmelding + '- Uw vraag, opmerking of klacht.\n';
		document.VragenForm.Vraag.style.border = '1px solid #ff0000';
		submitOK = 'False';
	}
	else{
		document.VragenForm.Vraag.style.border = '1px solid #094e93';
	}
	//
	if (submitOK == 'False'){
		alert('De volgende velden zijn verplicht:\n' + Foutmelding);
		return false;
	}
}
// Einde van deze functie.