function SetEuro(veld) {
	var bedrag = 0;
	bedrag = parseFloat(document.getElementById(veld).value);
	document.getElementById(veld).value = '€ ' + bedrag.toFixed(2).replace('.',',');
}

function SetField(veld,bedrag){

	document.getElementById(veld).value = bedrag;
	SetEuro(veld);
	
}

function CheckRekNr(veld){
	
	reknr = document.getElementById(veld).value;
	ERROR = '';
	
	if (reknr.length>0) {
	
		reknr = reknr.replace(/[^0-9]/g,'');
		
		if (reknr.length == 12) {
			
			prefix = reknr.substr(0,10);
			suffix = reknr.substr(10,2);
			
			if ((parseFloat(prefix) % 97 != suffix && suffix != 97) || (parseFloat(prefix) % 97 != 0 && suffix == 97) )
				ERROR = ERROR + '- Het rekening nummer is geen geldig rekening nummer.\n';
		} 
		else 
			ERROR = ERROR + '- Het rekening nummer moet 12 cijfers tellen.\n';
		
		reknr = reknr.substr(0,3) + '-' + reknr.substr(3,7) + '-' + reknr.substr(10,12);
	}
	
	if (ERROR) {
		alert('Het rekening nummer dat u ingaf, bevat fouten:\n' + ERROR + 'Gelieve opnieuw te proberen.');
		document.getElementById(veld).value = '';
	} else {
		document.getElementById(veld).value = reknr;			
	}
	
}

heightSMALL = 300;
widthSMALL = 600;
posXS = (screen.width/2 - widthSMALL/2).toString();
posYS = (screen.height/2 - heightSMALL/2).toString();

function openSMALL(URLStr)
	{ var w = window.open(URLStr,"_blank","height=" + heightSMALL + ",width=" + widthSMALL + ",top=" + posYS + ",left=" + posXS + ",screenX=" + posXS + ",screenY=" + posYS + ",menubar=no,resizable=yes,scrollbars=yes");
	  return void(0); }

heightBIG = 450;
widthBIG = 700;
posXB = (screen.width/2 - widthBIG/2).toString();
posYB = (screen.height/2 - heightBIG/2).toString();

function openBIG(URLStr)
	{ var w = window.open(URLStr,"_blank","height=" + heightBIG + ",width=" + widthBIG + ",top=" + posYB + ",left=" + posXB + ",screenX=" + posXB + ",screenY=" + posYB + ",menubar=no,resizable=yes,scrollbars=yes");
	  return void(0); }

heightCOLOUR = 197;
widthCOLOUR = 600;
posXC = (screen.width/2 - widthCOLOUR/2).toString();
posYC = (screen.height/2 - heightCOLOUR/2).toString();

function openCOLOUR(URLStr)
	{ var w = window.open("getcolour.php","_blank","height=" + heightCOLOUR + ",width=" + widthCOLOUR + ",top=" + posYC + ",left=" + posXC + ",screenX=" + posXC + ",screenY=" + posYC + ",menubar=no,resizable=no,scrollbars=no");
	  return void(0); }

function openWindow(URLStr,w,h)
	{ posXC = (screen.width/2 - w/2).toString();
	  posYC = (screen.height/2 - h/2).toString();
	  var w = window.open(URLStr,"_blank","height=" + h + ",width=" + w + ",top=" + posYB + ",left=" + posXB + ",screenX=" + posXB + ",screenY=" + posYB + ",menubar=no,resizable=yes,scrollbars=yes");
	  return void(0); }