function popup(picture){
	window.open('showpicture.jsp?resource='+picture,'window','height=400, width=400, resizable=1');
	return;
}
function openElearning(cursus) {
	var presentatie82 = window.open('/elearning/presentatie82.jsp?cursus='+cursus, 'presentatie82','width=750,height=540, location=no,menubar=no,status=no,resizable=no,scrollbars=no');
}
function check_all(parent){
	var theElement = "";
	var parentName = "sector_"+parent;
	for(var i=0; i < sectoren.length; i=i+2){
		if (sectoren[i+1]==parent){
			theElement = getObjectByName("sector_"+sectoren[i]);
			if (getObjectByName(parentName).checked) theElement.checked=true; else theElement.checked=false;
		}
	}
}
function getObjectByName(name){
	if (window.document.all!=null) {
		for (i = 0; i < window.document.all.length; i++) {
			if (window.document.all[i].name != null && window.document.all[i].name == name) {
				return window.document.all[i];
			}
		}
		return false;
	}else{
		return document.getElementById(name);
	}
}
function scrollRef(id,positie) {
	var ref = window.open('/scrollref.jsp?id='+id+'&positie='+positie, 'ref','width=400,height=300, location=no,menubar=no,status=no,resizable=no,scrollbars=no');
}
function maskField(str,mask){
	var theReturn = '';
	nr = makenumeric(str);
	//alert(mask);
	var j = 0;
	for(var i=0;i<mask.length;i++){
		ch = mask.charAt(i); 
		if (IsNumeric(ch)){
			var part = nr.charAt(j);
			theReturn += part;
			if (j>=nr.length) break;
		j++;
		}else{
			theReturn += ch;
		}
	}
	return theReturn;
}
function makenumeric(str){
	var result = '';
	for(var i=0;i<str.length;i++){
		var ch = str.substring(i, i+1);
		if (IsNumeric(ch)) result += ch;
	}
	return result;
}
function IsNumeric(sText){
	var ValidChars = "0123456789";
	var IsNumber=true;
	var Char;
	for (i = 0; i < sText.length && IsNumber == true; i++){ 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1){
			IsNumber = false;
		}
	}
	return IsNumber;   
}
function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); }}}