function checkMandatory(poElement)
{
	// 14/10/2003 tom - handle multiple entities with the same name
	if(poElement.length)
	{
		var llOK = true;
		for(var i = 0; i < poElement.length; i++)
		{
			if(!checkMandatory(poElement[i]))
			{
				llOK = false;
			}
		}
		return llOK;
	}

	// don't complain if in a template row
	var loTR = get_parent(poElement,"TR");
	while(loTR)
	{
		if(loTR.className.match(/\browtemplate\b/i))
		{
			return true;
		}
		loTR = get_parent(loTR.parentNode,"TR");
	}

	if(poElement.value.length==0)
	{
		if(! poElement.className.match(/\bmissing\b/))
		{
			poElement.className += " missing";
		}
		return false;
	}
	else
	{
		poElement.className = poElement.className.replace(/\bmissing\b/,"");
		return true;
	}
}

function get_parent(poItem, pcTagName)
{
	while(poItem != null && poItem.tagName != pcTagName)
	{
		poItem = poItem.parentNode;
	}
	return poItem;
}

function SavePageAndNavigate(poForm)
{
	poForm.submit();	
}
