function checkLength(form, element, maxNumOfCharacters, feedbackElementID) {
	//
	// VERSION: 1.0
	//
	// NAME: Check length of input-field or textarea.
	//
	// DESCRIPTION: Checks lengt of a given element in a given form and tells user, how many characters he has left in the given field.
	//
	// INPUT:
	// - form: Name of the form, that contains the field, that has to be checked.
	// - element: Name of the element, that has to be checked.
	// - maxNumOfCharacters: The maximum number of characters, the field is allowed to contain.
	// - feedbackElementID: The id of the element, where the feedback is has written via innerHTML
	//
	// OUTPUT:
	// Text printed in the innerHTML of the element stated by feedbackElementID
	// 
	if (document.forms[form].elements[element].value.length > maxNumOfCharacters){
		alert("Der må maksimalt skrives " + maxNumOfCharacters + " tegn!");
		document.forms[form].elements[element].value = document.forms[form].elements[element].value.substring(0,maxNumOfCharacters);
		window.status = document.forms[form].elements[element].value.length;
	}
	window.status = document.forms[form].elements[element].value.length;
	document.getElementById(feedbackElementID).innerHTML = " (" + (document.forms[form].elements[element].value.length) + "/"+maxNumOfCharacters+")";
}
