/* Script Bestand voor Rechtenverkenner */

/* Algemene functies */
function getobj(id) {
    return document.getElementById(id);
}

function printDoc() {
    window.print();
}

function IsEmail(strString) {
    var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    if (filter.test(strString)) {
        testresults = true;
    } else {
        testresults = false;
    }
    return (testresults)
}

/* Hoogte instellen */
function setHeight() {	
    var terug = getobj('terug');
	var inhoud = getobj('inhoud');
	var targetheight = inhoud.clientHeight + 25;
	
	terug.style.height = targetheight + 'px';
	window.onresize = setHeight;
}

/* Menu aansturing */
var prvM = new Array();

function setSelected(ctl, lvl) {	
    if(prvM[lvl] != ctl) {	
	    try {	
		    prvM[lvl].className = '';
		} 
		catch(e){}
	}
	
	ctl.className = 'selected';	
	prvM[lvl] = ctl;
}

function setUnselected(ctl) {
    ctl.className = '';
}

/* Contactformulier functies */

function setFormFieldValue(id, value) {
    var fField = getobj(id);

    fField.value = value;
}

/* Persoonlijk profiel */

function shUitleg(button) {
    var span = button.parentNode;
    var divs = span.getElementsByTagName('DIV');

    if (divs.length > 0) {
        var div = divs[0];

        if (div.style.display == 'none') {
            div.style.display = '';
        } else {
            div.style.display = 'none';
        }
    }
}

/* PDF Link in _blank */

function setTarget() {
    document.forms[0].target = '_blank';
    document.body["oldFormAction"] = document.forms[0].action;
}

function resetTarget() {
    document.forms[0].target = '';
    if(document.body["oldFormAction"])
        document.forms[0].action = document.body["oldFormAction"];
    else
        document.forms[0].action = '';
}