// July 13, 2006

// requires javascript/toolbox/format/trim.js

//*******************************************************************************'
// add strErrorMsg to the value of objIDName
function inlineErrorMsg( objIDName, strErrorMsg )
{
	// was a objIDName passed ?
	if ( trim( objIDName ) == '' )
	{
		// notify the user
		alert( "\"objIDName\" not passed." );
	}
	else
	{
		// try to get the element
		var objElement = document.getElementById( objIDName );
		
		// if the element is valid
		if ( objElement )
		{
			// if the Error Message passed is empty
			if ( trim( strErrorMsg ) == '' )	
			{
				// hide the inline Error Message
				objElement.style.display = 'none';
			}
			else
			{
				// make sure the inline Error Message is visible
				objElement.style.display = 'block';
				
				// if Internet Explorer ...
				if ( document.all )
				{
				     objElement.innerHTML += strErrorMsg + '<br/>';
				}
				
				// else if FireFox, Nextscape or anything other than IE
				else
				{
				    objElement.innerHTML += strErrorMsg + '<br/>';
				}
			}
		}
		else
		{
			// objElement was not valid or does not exist
		}
	}
}


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

function inlineerrormsg( objIDName, strErrorMsg )
{
	inlineErrorMsg( objIDName, strErrorMsg );
}


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

function InlineErrorMsg( objIDName, strErrorMsg )
{
	inlineErrorMsg( objIDName, strErrorMsg );
}


//*******************************************************************************'
// returns if objIDName value is empty or not
function errorsEmpty( objIDName ) // as Boolean
{
	// was a objIDName passed ?
	if ( trim( objIDName ) == '' )
	{
		// notify the user
		alert( "\"objIDName\" not passed." );
	}
	else
	{
		// try to get the element
		var objElement = document.getElementById( objIDName );
		
		// if the element is valid
		if ( objElement )
		{
			// see if the Error Message has any content

			// if Internet Explorer ...
			if ( document.all )
			{
				return ( trim( objElement.innerText ) == '' );
			}
			
			// else if FireFox, Nextscape or anything other than IE
			else
			{
				return ( trim( objElement.textContent ) == '' );
			}
		}
		else
		{
			return false;
		}
	}
}


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

function errorsempty( objIDName ) // as Boolean
{
	return errorsEmpty( objIDName );
}

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

function ErrorsEmpty( objIDName ) // as Boolean
{
	return errorsEmpty( objIDName );
}


//*******************************************************************************'
// clear objIDName's value
function clearErrorMsg( objIDName )
{
	// was a objIDName passed ?
	if ( trim( objIDName ) == '' )
	{
		// notify the user
		alert( "\"objIDName\" not passed." );
	}
	else
	{
		// try to get the element
		var objElement = document.getElementById( objIDName );
		
		// if the element is valid
		if ( objElement )
		{
			// clear the content

			// if Internet Explorer ...
			if ( document.all )
			{
				objElement.innerHTML  = '';
			}
			
			// else if FireFox, Nextscape or anything other than IE
			else
			{
				objElement.textContent = '';
			}
		}
	}
}


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

function clearerrormsg( objIDName )
{
	clearErrorMsg( objIDName );
}


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

function ClearErrorMsg( objIDName )
{
	clearErrorMsg( objIDName );
}

