
function formulatorValidateRequired(field, alerttxt)
{
	with (field)
	{
		if(value == null || value == "")
  		{
  			alert(alerttxt);
  			return false;
		}
		else 
		{
			return true
		}
	}
}

function formulatorValidateChecked(field, alerttxt)
{
	with (field)
	{
		if(checked != true)
  		{
  			alert(alerttxt);
  			return false;
		}
		else 
		{
			return true
		}
	}
}

function formulatorValidateEmail(field, alerttxt)
{
	with (field)
	{
		if(value == null || value == "")
			return true;
			
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
		if (apos < 1 || dotpos - apos < 2) 
  		{
  			alert(alerttxt);
  			return false;
		}
		else 
		{
			return true;
		}
	}
}


function formulatorValidateEmailList(field, alerttxt)
{
	with (field)
	{
		if(value == null || value == "")
			return true;
			
		chunks = value.split(/[ .,]+/);
		for(chunk in chunks)
		{
			$ret = formulatorValidateEmail(field, alerttxt);
			if(!$ret) return false;
		} 
		return true;
	}
}
