/**
 *	This file holds shared utility functions used by different
 *	js files.
 *
 *	@author Russell Francis < r f r a n c i s AT e v DOT n e t >
 *	@date 2006-1-13
 */
/**
 *	This method will return a document element with the
 *	id passed as a paramter in a cross-platform way.
 *
 *	This method will return the element with the id passed
 *	as a parameter, it will first try the getElementById method
 *	then it will try the IE4 document.all method for retrieving
 *	the element.
 *
 *	It should also try the NN4 method of document.layers but
 *	currently doesn't, because the syntax for changing properties
 *	of that element doesn't match the previous two.
 *
 *	@param id The id of the element we wish to retrieve.
 *	@return The DOM element with said id, or null if no element
 *		could be found.
 */
function getById( id )
{
	var element = document.getElementById( id );
	if( element == null )
	{
		if( document.all )
		{
			if( document.all[id] )
			{
				element = document.all[id];
			}
		}
	}

	return( element );
}

/**
 *	Determine if a character is alpha or not a-z, A-Z.
 *
 *	@param c A character
 *	@return true if the character is alphabetic a-z, A-Z, false otherwise.
 */
function isAlpha( c )
{
	c = c.toUpperCase();
	return( ( ( c >= 'A' ) && ( c <= 'Z' ) ) ? true : false );
}

/**
 *	Determine if a character is a decimal digit or not.
 *
 *	@param c A character.
 *	@return true if it is a digit 0-9, false otherwise.
 */
function isDigit( c )
{
	return( ( ( c >= '0' ) && ( c <= '9' ) ) ? true : false );
}
