// July 13, 2006

//*******************************************************************************'
// is there text in the textbox?
// return true or false
// requires ../format/trim.js

function textInTextbox(elementObj) // as Boolean
{
	// make sure the element is of the right object type
	if
	(
		elementObj.type == "text" || 
		elementObj.type == "textbox" || 
		elementObj.type == "textarea" || 
		elementObj.type == "hidden" || 
		elementObj.type == "password" || 
		elementObj.type == "file"
	)
	{
	
		// save the passed value
		var txtValue = elementObj.value;
		
		// trim the value of leading and trailing spaces
		// from trim.js
		txtValue = Trim(txtValue)
		
		// if after trimming the length = 0...
		if (txtValue.length < 1)
		{
			// the textbox is empty
			return false;
		}
		else
		{
			// there is valid text present
			return true;
		}
		
	}
	else
	// wrong element type
	{
		return false;
	}
	
}

//-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -'
// syntax version

function textintextbox(elementObj) // as Boolean
{
	return textInTextbox(elementObj)
}

//-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -'
// syntax version

function TextInTextbox(elementObj) // as Boolean
{
	return textInTextbox(elementObj)
}

//-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -'
// example

/*
<script language="javascript">
function validateForm1(formObj)
{
	if (textInTextbox(formObj.FirstName) == false)
	{
		alert("Please enter your name.");
		formObj.FirstName.focus();
		return false;
	}
	else
	{
		return true;
	}
}
</script>
*/

//*******************************************************************************'
// is the value passed empty

function isEmpty(strValue)
{
  if (strValue.length == 0 || strValue == null)
	{ 
     return true;
  }
	else
	{
     return false;
  }
}

//-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -'
// syntax version

function isempty(strValue)
{
	return isEmpty(strValue);
}

//-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -'
// syntax version

function IsEmpty(strValue)
{
	return isEmpty(strValue);
}

