// Author Stephen Poley
var proceed=2;  

function commonCheck2(vfld,ifld){if(!document.getElementById)return true;var elem=document.getElementById(ifld);if(!elem.firstChild)return true;if(elem.firstChild.nodeType!=node_text)return true;msg(ifld,"warn","");return proceed;}

//orginal validateCheckbox
function ____validateCheckbox(vfld,ifld,nr,cond){if(!nr||nr<2){alert('Programming error in validateCheckbox: nr<2');return true;}if(!cond)cond=0;var stat=commonCheck2(vfld,ifld);if(stat!=proceed)return stat;var count=0;for(var j=0;j<vfld.length;j++)if(vfld[j].checked)count++;if(count==nr)return true;if(count<nr&&cond==-1&&count!=0)return true;if(count>nr&&cond==1)return true;var suffix='';if(count>1)suffix='es';var errorMsg;if(count<nr)errorMsg='';if(count>nr)errorMsg='Maximaal '+nr+' categorieën';if(count==0)errorMsg='Geen categorie aangegeven';msg(ifld,"error",errorMsg);return false;}

//validateCheckbox
function validateCheckbox(ifld,nr){var errorMsg;var count=0;for(var j=1;j<8;j++)if(document.getElementById('CheckBox'+j).checked==true)count++;if(count==nr){errorMsg='';msg(ifld,"error",errorMsg);return true;}else if(count==1){errorMsg='';msg(ifld,"error",errorMsg);return true;}else if(count>nr)errorMsg='Selecteer maximaal '+nr+' categorieën';if(count==0)errorMsg='Selecteer minimaal 1 categorie';msg(ifld,"error",errorMsg);return false;}

//validateConfirm - Returns true if valid (and also if could not be executed because of old browser)
function validateConfirm1(vfld,ifld){var stat=commonCheck2(vfld,ifld);if(stat!=proceed)return stat;if(vfld.checked)return true;var errorMsg='Geef bij acceptatie een akkoord';msg(ifld,"error",errorMsg);return false;}

function validateConfirm2(vfld,ifld){var stat=commonCheck2(vfld,ifld);if(stat!=proceed)return stat;if(vfld.checked)return true;var errorMsg='Lees de Privacyregels en geef een akkoord';msg(ifld,"error",errorMsg);return false;}
