function validate(fieldname, minChar) {
	if(document.getElementById(fieldname).value.length >= minChar) {
		document.getElementById(fieldname + 'Img').src = "/bilder/stomme/check.gif";
		return true;
	} else {
		document.getElementById(fieldname + 'Img').src = "/bilder/stomme/gul_pil.gif";
		return false;
	}
}



function validRequired(formField,fieldLabel) {
	var result = true;
	
	if (formField.value == "") 	{
		alert('Du måste skriva något i "' + fieldLabel + '"-fältet!');
		formField.focus();
		result = false;
	}
	
	return result;
}

function validateJoinForm(theForm) {
	if(!validate("namn", 1)) {
		alert("Please write something in the name-field");
		document.theForm.namn.focus();
		return false;
	}
	
	if(!validate("adress", 1)) {
		alert("Please write something in the address-field");
		document.theForm.adress.focus();
		return false;
	}
	
	if(!validate("postnr", 1)) {
		alert("Please write something in the zip code-field");
		document.theForm.postnr.focus();
		return false;
	}
	
	if(!validate("stad", 1)) {
		alert("Please write something in the city-field");
		document.theForm.stad.focus();
		return false;
	}
	
	if(!validate("land", 1)) {
		alert("Please write something in the land-field");
		document.theForm.land.focus();
		return false;
	}
	
	if(!validate("telefon", 1)) {
		alert("Please write something in the telephone-field");
		document.theForm.telefon.focus();
		return false;
	}
	
	if(!validate("epost", 1)) {
		alert("Please write something in the epost-field");
		document.theForm.epost.focus();
		return false;
	}
	
	return true;
}