function radioRequired(src, image) {
	// checks if a radio button is selected
	image.style.visibility='visible';
	var itemchecked = false;
	for(var j = 0; j < src.length; j++) {
	if(src[j].checked) {
		itemchecked = true;
		break;
	}
	}
	if(itemchecked)
		image.src='/site/img/form/aan.gif';
	else
		image.src='/site/img/form/uit.gif';

	return itemchecked;
}

function normalRequired(src, image) {
	// checks if the input field is filled.
	var returnValue = false;
	image.style.visibility='visible';
	if(src.value) {
		image.src='/site/img/form/aan.gif';
		returnValue = true;
	} else {
		image.src='/site/img/form/uit.gif';
		returnValue = false;
	}
	return returnValue;
}

function checkRequired(src, image) {
	// checks if a checkbox is selected

	var itemchecked = false;
	for(var j = 0; j < src.length; j++) {
  		if(src[j].checked) {
  			itemchecked = true;
  			break;
  		}
	}
	if (image ) {
		image.style.visibility='visible';
	}
	if(src.checked && image) {
		image.src='img/form/aan.gif';
		returnValue = true;
	} else if (image){
		image.src='img/form/uit.gif';
		returnValue = false;
	} else {
		returnValue = null;
	}

	return returnValue;
}


function emailRequired(src, image){
	// Checks if an email adress is filled in correctly
	image.style.visibility='visible';
	var emailreg = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,5}$/;
		if(emailreg.test(src.value)){
			image.src='/site/img/form/aan.gif';
			returnValue = true;
		} else {
			image.src='/site/img/form/uit.gif';
			returnValue = false;
		}
	return returnValue;
}
function MainMenuRollover(obj, color) {
	obj.style.backgroundColor = color
}
function textCounter(field, maxlimit) {
	if (field.value.length > maxlimit) {
		field.value = field.value.substring(0, maxlimit);
	}	
}


var active_help = '';
function toggleHelp(id) {
	
	if (active_help != '') {
		if (active_help != id) {
			document.getElementById(active_help).style.display = 'none';
		}
	}
	
	var obj = document.getElementById(id);
	if ( obj.style.display == 'none' ){
		obj.style.display = '';
	}else{
		obj.style.display = 'none';
	}
	active_help = id;
}
