function isObject( variable )
{
	return ( typeof variable == 'object' );
}

function isValidObject( variable )
{
	return ( isObject(variable) && !isNull(variable) );	
}

function isNull( variable )
{
	return ( variable == null );
}

function isString( variable )
{
	return ( typeof variable == 'string' );
}

function isValidString( variable )
{
	return ( typeof variable == 'string' && variable.length > 0 );
}

function isArray( variable )
{
	return ( typeof variable == 'array' );
}

function isUndefined( variable )
{
	return ( typeof variable == 'undefined' );
}

function isDefined( variable )
{
	return ( typeof variable != 'undefined');
}

function isNumber( variable )
{
	return ( typeof variable == 'number' );
}

function isFunction( variable )
{
	return ( typeof variable == 'function' );
}

function isWholeNumber( variable )
{
	return ( isNumber(variable) && ( parseInt(variable) == parseFloat(variable) ) );
}

function isValidColor( variable )
{
	// Check by length and range of characters (zero or one leading #, 0-f)
	if( variable.length < 3 )//|| variable.length > 7 || variable.length == 5 )
		return false;
	
	validChars = '0123456789ABCDEF';
	variable = variable.toUpperCase();
	
	// Loop through each character, and if an invalid one is found, return false
	for( i = 0; i < variable.length; i++ )
	{
		// A # at position 1 is allowed
		if( i == 0 && variable.charAt(i) == '#' )
			continue;
		
		// If this character is invalid, so is the entire color
		if( validChars.indexOf(variable.charAt(i)) < 0 )
		{
			return false;
		}
	}
	
	return true;
}


// Set some useful variables
/*
if( document.body.scrollHeight && document.body.scrollWidth )
{
	DOCUMENT_WIDTH = document.body.scrollWidth
	DOCUMENT_HEIGHT  = document.body.scrollHeight;
}
else if( document.body.offsetHeight && document.body.offsetWidth )
{	
	DOCUMENT_WIDTH = document.body.offsetWidth;
	DOCUMENT_HEIGHT  = document.body.offsetHeight;
}
*/

/*
 * Returns an object if one is found with the id
 * passed in the parameters
 *
 * @param	String;	Object ID
 * @return	Object;	Returns the object found, if any
 */
function getObj( elementID )
{
	
	if( !isString(elementID) || elementID.length < 1 )
		return null

	// First use getElementById
	theObj = document.getElementById(elementID);
	//theObj = eval( 'document.getElementById("' + elementID + '")' );
	
	if(document.getElementById(elementID))
		theObj = eval( 'document.getElementById("' + elementID + '")' );
	//else
		//alert("Missing Obj on page: " +elementID);
	
	// If an object wasn't found, try using getElementByName, if available
	if( !isValidObject(theObj) && isFunction(document.getElementsByName) )
	{
		theObj = document.getElementsByName(elementID);
	}
	
	if( isValidObject(theObj) )
		return theObj;
	else
		return null;		
	
}

/* alias of 'getObj' */
function getO( elementID ) { return getObj( elementID ); }

// Browser detect stuff 
var nAV = navigator.appVersion.toLowerCase();
var nUA = navigator.userAgent.toLowerCase();
var nP = navigator.platform.toLowerCase();
var isIE = nAV.indexOf('msie')!=-1;
var isIE6 = (nAV.indexOf('msie 6')!=-1 || nAV.indexOf('msie 5')!=-1);
var isIE7 = (nAV.indexOf('msie 7')!=-1);
var isFirefox = (nUA.indexOf('firefox')!=-1);
var isOpera = (nUA.indexOf('opera')!=-1);
var isSafari = (nUA.indexOf('safari')!=-1);
var isWin32 = (nP.indexOf('win')!=-1);
var isMac = (nP.indexOf('mac')!=-1);
if (isOpera) {
  isIE = false;
  isIE6 = false;
  isIE7 = false;
}