
function getval(o)
{
//alert(o);
	var p = o;
        if (typeof(o) != "object") o = document.getElementById(o);
        if (!o) { alert('is not an object '+p); return false; }
	if (!o['nodeName']) { alert('object has no prop nodeName '+p); return false; }
//alert(typeof(o));
        if (o.nodeName && o.nodeName == 'INPUT') {
		//alert(o.getAttribute('TYPE'));
		//alert(o.checked);
		if (o.getAttribute('TYPE') == 'checkbox') return o.checked;
	}
        if (o.nodeName && o.nodeName == 'SELECT') {
		return o.options[o.selectedIndex].value;
        }
        if (o.value) {
                return o.value;
        }
        return o.innerHTML;
}

function setfocus(e)
{
	if (typeof(e) != 'object') e = document.getElementById(e);
	//if (typeof(e) != 'object') return false; // log?
alert(e);
	return e.focus();
}


function display(e, s) {
	if (typeof(e) != 'object') e = document.getElementById(e);
	if (s == 'reverse') {
		if (e.style.display == 'block') return display(e, 'off');
		return display(e, 'on');
	}
	if (s == 'off' || s == false) {
		e.style.display = 'none';
		return false;
	}
	e.style.display = 'block';
	//e.style.z_index = '9';
	return true;
}

function setval(e, v) { itco_setval(e, v); }

function itco_setval(e, val)
{
//alert(e);
        if (typeof(e) != 'object') e = document.getElementById(e);
        if (e.nodeName == 'INPUT') {
		//alert(e.getAttribute('TYPE'));
		if (e.getAttribute('TYPE') == 'checkbox') return e.checked = val;
		if (e.getAttribute('TYPE') == 'radio') return e.checked = val;
		if (e.getAttribute('TYPE') == 'line') return e.value = val;
		//alert('error setval');
		//return val;
	}
        if (e.nodeName == 'SELECT') {
                return e.selectedIndex = val;
        }
        if (e.src) {
                e.src = val;
                //alert('a '+id+' '+val);
        } else {
                //if (document.getElementById(id).value) 
                // als een lege string bevat moet ie wel gevuld worden.
                if (e.value || e.value == '') {
                        e.value = val;
                        //alert('b '+id+' '+val);
                } else {
                        e.innerHTML = val;
                        //alert('c '+id+' '+val);
                }
        }
}

function promotion_correct(value)
{
	value = trim(value);
	if (value.length < 7) return false;
	if (value.search(' ') == -1) return false;
	if (value == '') return false;
	return true;

}

function trim(value) {
	if (typeof(value) != 'string' && typeof(value) != 'number') {
		alert('trim('+value+') is of type '+typeof(value));
		return '';
	}
	return value.replace(/^\s+|\s+$/,'');
}

function strlen(value) {
	if (typeof(value) != 'string' && typeof(value) != 'number') {
		alert('trim('+value+') is of type '+typeof(value));
		return '';
	}
	return value.length;
}

function sf(ret){
	if (ret == '1') return true;
	o = document.getElementById('SEARCHid');
	if (o) {
        if (o.nodeName == 'INPUT') {
                //if (o.getAttribute('TYPE') == 'line') {
			document.main.SEARCH.focus();

		//}

	}
  }
}



window.name = "main";

function windowopen_vacancy(url) {
	window.open(url,'functie','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=550,height=500');
}

function windowopen_company(url) {
	window.open(url,'functie','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=500,height=400');
}

