
function Trim(strInput, strFind)
	{
	/* Trim:
	// This function uses RTrim and LTrim to 
	// remove strFind from both sides of a strInput.
	// Spaces are removed by default if strFind is omitted.
	*/
	if (strFind == null)
		{
		strFind = ""
		}
		
	if (strInput != null && strInput != "")
		{
		strInput = LTrim(strInput, strFind);
		strInput = RTrim(strInput, strFind);
		}
	return strInput
	}

function RTrim(strInput, strFind)
	{
	/* RTrim:
	// This function uses Replace to remove strFind from the 
	// right side of strInput.  Spaces are removed by default
	// if strFind is omitted.
	*/
	if (strInput != null && strInput != "")
		{
		if (strFind == null || strFind == "")
			{
			strFind = " "
			}
		strInput = Replace(strInput, strFind + "+$", "")
		}
	return strInput
	}

function LTrim(strInput, strFind)
	{
	/* LTrim:
	// This function uses Replace to remove strFind from the 
	// Left side of strInput.  Spaces are removed by default
	// if strFind is omitted.
	*/
	if (strInput != null && strInput != "")
		{
		if (strFind == null || strFind == "")
			{
			strFind = " "
			}
		strInput = Replace(strInput, "^" + strFind + "+", "")
		}
	return strInput
	}


function Replace(strInput, reFind, strRepl, strMod){
	/* Replace:
	// This function will replace reFind with strRepl in the strInput string.  Use
	// the strMod to add regular expression modifiers.
	// strInput:	String to be searched.
	// reFind:		Regular Expression string to find and be replaced. Regular Expression
	//				values are valid here but must contain double back-slashes.
	//				(i.e. "the" or "\\bthe\\b" or "\\bthe\\Scat\\b"
	// strRepl:		String to be used in place of reFind string.
	// strMod:		Regular Expression modifier. 
	//				(i.e. "g" global, "i" ignore case or "gi" both)
	*/
	var newString
	// Must have a find string
	if (reFind == "" || reFind == null)
		{
		return null;}
		
	if (strMod == null)
		{strMod = ""}

	// use empty string for default replacement string
	if ( strRepl == null)
		{strRepl = ""}

	// Instanciate RegExp object and compile expression
	var objRegExp = new RegExp();

	objRegExp.compile(reFind, strMod)
	
	if(strInput != "" && strInput != null)
		{strInput = strInput.replace(objRegExp, strRepl)}
	return strInput
	}

function ValidateForm(thisForm){

	if(Trim(thisForm.first_name.value) == ""){
		alert("Please enter first name.");
		thisForm.first_name.focus();
		return false;
	}

	if(Trim(thisForm.last_name.value) == ""){
		alert("Please enter last name.");
		thisForm.last_name.focus();
		return false;
	}


}
