function img_open(source_file) {
  window.open(source_file,'popup','top=100,left=200,width=200,height=100,toolbars=no,maximize=yes,resize=yes,location=no,directories=no,scrollbars=no');
}

function PopWindowImageInit() {
  PopWindowImage('picture');
  return false;
}

function PopWindowImage(picname) { 
	var picture = document.picname;
	var SRC = document.picture.src;
	var height = document.picture.height + 36 + 51 + 70; 
	var width = document.picture.width + 10 + 12;
  
	if (width < 350) {
  		width = 350;
	}
	window.resizeTo(width,height);
}

function CSetFocus() {
	document.contactformulier.naam.focus();
}

function move(elmnt,content) {
	if (content.length==elmnt.maxLength) {
		next=elmnt.tabIndex
		if (next<document.forms[0].elements.length) {
		document.forms[0].elements[next].focus()
		}
	}
}

function pc1(field) {
  if (ok=field.value.match(/^(-?\d*)+$/g)) {
  } else {
    alert("Ongeldige invoer: " + field.value + "\nDit veld accepteert alleen cijfers.");
    field.focus();
    field.select();
  }
}
function pc2(field) {
  if (ok=field.value.match(/^(-?[a-zA-Z]*)+$/g)) {
	field.value=field.value.toUpperCase();
  } else {
    alert("Ongeldige invoer: " + field.value + "\nDit veld accepteert alleen letters.");
    field.focus();
    field.select();  //last char only!
  }
}
function checkemail(field) {
  if (ok=field.value.match(/^(-?[a-zA-Z0-9@.-]*)+$/g)) {
  } else {
    alert("Ongeldige invoer: " + field.value + "\nDit géén geldig character voor een emailadres.");
    field.focus();
    field.select();  //last char only!
  }
}

function CheckFormAll() {
    if (document.getElementById('naam').value.length == 0) {
		alert('Er is geen naam ingevuld. Vul uw naam in.');
		document.getElementById('naam').focus();
		return false;
    }
    if (document.getElementById('email').value.length == 0) {
		alert('Er is geen emailadres ingevuld. Vul uw emailadres in.');
		document.getElementById('email').focus();
		return false;
    }
    if (document.getElementById('bericht').value.length == 0) {
		alert('Er is geen bericht ingevuld. Vul uw bericht in.');
		document.getElementById('bericht').focus();
		return false;
    }
     if (document.getElementById('captchacode').value.length == 0) {
		alert('Er is geen captchacode ingevuld. Vul uw bericht in.');
		document.getElementById('captchacode').focus();
		return false;
    }

}
