function bereken(totnaam)
{
	totnaam = totnaam.toLowerCase()
	code1=""
	code2=""
	l=0
	o=0
	v=0
	e=0
	s=0
	spatie=0
	controle=0

	teller=0
	while (teller < totnaam.length)
	{
		if (totnaam.charAt(teller)=="l") {l++}
		if (totnaam.charAt(teller)=="o") {o++}
		if (totnaam.charAt(teller)=="v") {v++}
		if (totnaam.charAt(teller)=="e") {e++}
		if (totnaam.charAt(teller)=="s") {s++}
		if (totnaam.charAt(teller)==" ") {spatie++}
		teller++
	}
	code = l+""+o+""+v+""+e+""+s

	while (code.length > 2)
	{	teller=0
		while (teller < code.length-1)
				{tussen = parseInt(code.charAt(teller)) + parseInt(code.charAt(teller + 1))
					tussen=tussen+""
						if (tussen.length==2) {tussen=parseInt(tussen.charAt(0))+parseInt(tussen.charAt(1))}
							code2=code2+tussen
								teller++}
									code=code2
										code2=""
	}
	soort=(totnaam.length-l-o-v-e-s-spatie)%4
	if (soort==0) {soort="liefde"}
	if (soort==1) {soort="vriendschap"}
	if (soort==2) {soort="hartstocht"}
	if (soort==3) {soort="haat"}

	uitkomst=code + " % " + soort

	antwoord=document.getElementById("loveform").naam1.value+" en "+document.getElementById("loveform").naam2.value+" hebben de volgende relatie: "+uitkomst+"."
	alert(antwoord)
}

