function validate_form(form)
{
	var inputs = document.getElementsByTagName('input',form);
	var no_errors = true;
	for (i = 0; i < inputs.length; i++)
	{
		var input = inputs[i];
		if (input.id.match(form.id))
		{
			if (!input.value)
			{
				show_error(input);
				no_errors = false;		
			}else{
				clear_error(input);
			}
		}
	}
	var error = document.getElementById(form.id + 'error',form);
	if (!no_errors)
	{
		error.style.display = "table-row";
	}else{
		error.style.display = "none";
	}

	return no_errors;
}


function show_error(input)
{
	
	input.parentNode.style.backgroundColor = "red";
	
}

function clear_error(input)
{
	input.parentNode.style.backgroundColor = "#eaeaea";
	
}