function checkName(id, input, compare)
{
	var check=true;
	if(input==null || document.getElementById(id)==null)return;
	var text=input.value;
	if(text=='')check=false;
	
	var min=5;
	if(text.length<min)check=false;
	if( ((text.charAt(0) >= "A" && text.charAt(0) <= "Z") ||
		(text.charAt(0) >= "a" && text.charAt(0) <= "z")));else
		{check=false;}
	for(i=1;i<text.length; ++i)
		if( ((text.charAt(i) >= "A" && text.charAt(i) <= "Z") ||
			(text.charAt(i) >= "a" && text.charAt(i) <= "z") ||
			(text.charAt(i) >= "0" && text.charAt(i) <= "9") ||
			(text.charAt(i)=="_") || (text.charAt(i)=="-")));else
			{check=false;break;}
	
	if(compare!=null && document.getElementsByName(compare)[0].value!=text)check=false;
	
	setChecked(id, check);
	return check;
}
function checkEmail(id, input, compare)
{
	if(input==null || document.getElementById(id)==null)return;
	var text=input.value;
	
	var check=false;
	if((text.lastIndexOf(".") > 2) && (text.indexOf("@") > 0) && (text.length>text.lastIndexOf(".")+2))check=true;
	if(compare!=null && document.getElementsByName(compare)[0].value!=text)check=false;
	setChecked(id, check);
}

function checkNr(id,input)
{
	if(document.getElementById(id)==null)return;
	var text=input.value;
	if(text.length>=1)setChecked(id,true);
	else setChecked(id,false);
	if(!isNumber(text))setChecked(id,false);
}
function isNumber(text)
{
	for(i=0;i<text.length; i++)
		if(text.charAt(i) >= "0" && text.charAt(i) <= "9");else
		return false;
	return true;
}

function setChecked(id,check)
{
	if(check)document.getElementById(id).src="./img/form/true.png";
	else document.getElementById(id).src="./img/form/false.png";
}

