function ValidateVerzenden() 
{
    var eMailAdres = document.getElementById('email').value
    var indexOfSign1
    var indexOfSign2
    
    indexOfSign1 = eMailAdres.indexOf('@')
    indexOfSign2 = eMailAdres.indexOf('.')

    if ((indexOfSign1 < 0) || (indexOfSign2 < 0))
    {
        alert('U heeft nog geen correct E-Mailadres ingevuld');
    }
    else
    {
        document.aspnetForm.submit();
    }
}


function checkForm(value)
{
    switch (value)
    {	
        case "Bestel-formulier":
            MM_validateForm(   'Voornaam','','R',
                               'Achternaam','','R',
                               'E-Mail','','RisEmail');
            break;
        default:
            document.MM_returnValue = false 
    }

    if (document.MM_returnValue)
        {
            submitform();
        }
}

function MM_validateForm() { //v4.4 by Niels - DropDown Check + Radiobutton Check, v4.2 by Rinus
  var i,p,r,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
     if (test.indexOf('isCheckbox')!=-1) { 
        if (MM_findObj(args[i]).checked==false) { errors+='- '+MM_findObj(args[i]).name+' is niet aangevinkt.\n'; MM_findObj(args[i]).style.backgroundColor='EEE'; }
     }else if (test.indexOf('isDropDown') != -1){if(MM_findObj(args[i]).selectedIndex == 0){errors += "- "+MM_findObj(args[i]).name +' is geen item geselecteerd\n';MM_findObj(args[i]).style.backgroundColor="#FFCB2D";}
    }else if(test.indexOf('isRadio') != -1){
        var qr; var aantalnietdoorlopen;
        for( qr = 0; qr < MM_findObj(args[i]).length; qr++ ){if( MM_findObj(args[i])[qr].checked == true ){ val = MM_findObj(args[i])[qr].value;}else{ aantalnietdoorlopen++;}
        }
        if(val == "[object NodeList]" || val == "[object]"){errors += "- "+MM_findObj(args[i])[0].name + " heeft geen waarde die geselecteerd is.";for( qr = 0; qr < MM_findObj(args[i]).length; qr++ ){MM_findObj(args[i])[qr].style.backgroundColor = "FFCB2D";}
        }
    }else if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        r=val.indexOf('.');
        if (p<1 || r<1 || p==(val.length-1)) {MM_findObj(nm).style.backgroundColor='#FFCB2D'; MM_findObj(nm).value='geen geldig e-mail adres'; errors+='- '+nm+' bevat geen geldig e-mail adres.\n';}
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') {MM_findObj(nm).style.backgroundColor='#FFCB2D'; errors += '- '+nm+' is niet ingevuld.\n';} }
  } if (errors) alert('De volgende problemen zijn gevonden:\n'+errors);
    //if(navigator.appName != "Microsoft Internet Explorer") { alert('De volgende problemen zijn gevonden:\n'+errors); }
  document.MM_returnValue = (errors == '');
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function Juice_SelectVeld(veld) {
    veld.style.backgroundColor='#dddddd';
}
