function verifyInput(inputElement)
{
	// set the default
	inputValid = false;
	inputType = "";
	
	// first we must find the parent of this element that initiated the verification
	inputContainer  = inputElement;
	containerSearch = true;
	containerFound  = false;
	
	while (containerSearch)
	{
		// check to see if this is the input container
		if (inputContainer.getAttribute("fieldType"))
		{
			// this must be the container for our input
			// the search is over
			containerSearch = false;
			containerFound  = true;
			inputType = inputContainer.getAttribute("fieldType");
		}
		else
		{
			// check to see if this element has a parent
			if (inputContainer.parentNode)
			{
				// try the parent next time around
				inputContainer = inputContainer.parentNode;

				// the search continues
				containerSearch = true;
				containerFound  = false;
			}
			else
			{
				// we're out of parents and haven't found anything
				// the search is over
				containerSearch = false;
				containerFound  = false;
			}
		}
	}
	
	// if we've found the container, we can continue
	if (containerFound == true)
	{
		// now, using the input type, verify the data
		if (inputType.toLowerCase() == "string")
		{
			// only verify string if it is not blank
			if (inputElement.value != "")
			{
				illegalCharacterPattern	= /[\,\;\:\\\/\"\[\]]/;
				
				// make sure that it is a properly formatted string
				if (!inputElement.value.match(illegalCharacterPattern))
				{
					// this seems to be a properly formatted email address
					inputValid = true;
				}
			}
			else
			{
				inputValid = true;
			}
		}
		else if (inputType.toLowerCase() == "email")
		{
			// only verify email if it is not blank
			if (inputElement.value != "")
			{
				// set up the properly formatted email string
				properPattern		= /^.+@.+\..{2,3}$/;
				illegalCharacterPattern	= /[\ \(\)\<\>\,\;\:\\\/\"\[\]]/;
				
				// make sure that it is a properly formatted email address
				if (inputElement.value.match(properPattern)	&&
					!inputElement.value.match(illegalCharacterPattern))
				{
					// this seems to be a properly formatted email address
					inputValid = true;
				}
			}
			else
			{
				inputValid = true;
			}
		}
		else if (inputType.toLowerCase() == "phone")
		{
			// only verify phone if it is not blank
			if (inputElement.value != "")
			{
				// set up the properly formatted phone string
				properPattern		= /^\(?\d{3}\)?([-\/\.])\d{3}\1\d{4}$/;
				illegalCharacterPattern	= /[\,\;\:\\\/\"\[\]]/;
				
				// make sure that it is a properly formatted email address
				if (inputElement.value.match(properPattern)	&&
					!inputElement.value.match(illegalCharacterPattern))
				{
					// this seems to be a properly formatted email address
					inputValid = true;
				}
			}
			else
			{
				inputValid = true;
			}
		}
		else if (inputType.toLowerCase() == "text")
		{
			inputValid = true;
		}
		
		// set up our error class
		errorClass = "error";
	
		// grab the current settings
		currentStyle = inputContainer.getAttribute("class");
		if (!currentStyle)
			currentStyle = "";
		newStyle = currentStyle;
	
		// verify the data
		if (inputValid)
		{
			// the input is valid
			// switch the container to the normal state
			// remove the error class from this element if necessary
	
			// locate our error class with a space
			errorStatus = currentStyle.indexOf(" " + errorClass);
			if (errorStatus > -1)
			{
				// we need to remove the error class
				newStyle = currentStyle.substring(0, errorStatus) + currentStyle.substring(errorStatus + errorClass.length + 1, currentStyle.length);
			}
			else
			{
				// locate the error class itself
				errorStatus = currentStyle.indexOf(errorClass);
				if (errorStatus > -1)
				{
					// we need to remove the error class
					newStyle = currentStyle.substring(0, errorStatus) + currentStyle.substring(errorStatus + errorClass.length, currentStyle.length);
				}
			}
		}
		else
		{
			// the input is invalid
			// switch the container to the error state
			// locate our error class with a space
			errorStatus = currentStyle.indexOf(" " + errorClass);
			if (errorStatus > -1)
			{
				// the error class is already there
			}
			else
			{
				// locate the error class itself
				errorStatus = currentStyle.indexOf(errorClass);
				if (errorStatus > -1)
				{
					// the error class is already there
				}
				else
				{
					// we can add the error style
					newStyle = newStyle + " " + errorClass;
				}
			}
		}
	
		// set the new settings
		inputContainer.setAttribute("class", newStyle);
	}
}
