function offerteWijzigen()
{
	window.open("","bestel","menubar=0,resizable=0,width=350,height=300");
}




function isProperNr(string){
var iChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.\'\"!@#$%^&*\(\)_=-";
for (var i = 0; i < string.length; i++) {
if (iChars.indexOf(string.charAt(i)) != -1)
return false;
}
return true;
}

function isProper(string) {
var iChars = "*|,\":<>[]{}`\';()@&$#%!?";
for (var i = 0; i < string.length; i++) {
if (iChars.indexOf(string.charAt(i)) != -1)
return false;
}
return true;
}

function isProperChar(string) {
var iChars = "*|,\":<>[]{}`\';()@&$#%!?/1234567890\\";
for (var i = 0; i < string.length; i++) {
if (iChars.indexOf(string.charAt(i)) != -1)
return false;
}
return true;
}

function isProperEmail(string) {
var iChars = "*|,\":<>[]{}`\';()&$#%!?/";
for (var i = 0; i < string.length; i++) {
if (iChars.indexOf(string.charAt(i)) != -1)
return false;
}
return true;
}

function isEmail (s) {
if (isEmpty(s)) return false;
var i = 1;
var sLength = s.length;
while ((i < sLength) && (s.charAt(i) != "@"))
{ i++
}
if ((i >= sLength) || (s.charAt(i) != "@")) return false;
else i += 2;
while ((i < sLength) && (s.charAt(i) != "."))
{ i++
}
if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
else return true;
}
function isEmpty(s) {
return ((s == null) || (s.length < 7))
}





function Form_Validator(theForm) {


//verplichte velden
if (theForm.voornaam.value == "") {
  alert("U heeft uw voornaam/voorletters niet ingevuld.");
  theForm.voornaam.focus();
  return (false);
}

if (theForm.achternaam.value == "") {
  alert("U heeft uw achternaam niet ingevuld.");
  theForm.achternaam.focus();
  return (false);
}


if (theForm.telefoon.value == "") {
  alert("U heeft uw telefoonnummer niet ingevuld.");
  theForm.telefoon.focus();
  return (false);
}

//Character check



if (!isProperChar(theForm.voornaam.value)) {
  alert("Ongeldige voornaam");
  theForm.voornaam.focus();
  theForm.voornaam.select();
  return (false);
}

if (!isProperChar(theForm.achternaam.value)) {
  alert("Ongeldige achternaam");
  theForm.achternaam.focus();
  theForm.achternaam.select();
  return (false);
}


if (!isProper(theForm.adres.value)) {
  alert("Ongeldig adres");
  theForm.adres.focus();
  theForm.adres.select();
  return (false);
}


if (!isProper(theForm.postcode.value)) {
  alert("Ongeldige postcode");
  theForm.postcode.focus();
  theForm.postcode.select();
  return (false);
}



if (!isProperNr(theForm.telefoon.value)) {
  alert("Ongeldige tekens in het telefoonnummer");
  theForm.telefoon.focus();
  theForm.telefoon.select();
  return (false);
}

if (theForm.email.value != "") {

			if (!isEmail(theForm.email.value)) {
			  alert("Ongeldig e-mail adres");
			  theForm.email.focus();
			  theForm.email.select();
			  return (false);
			}

}






return (true);
}



