function findObj( id )
{
	if( id == null || id == "" ) return null;
	
	var x;
	if( !( x = document[ id ] ) && document.all ) x = document.all[ id ];
	if( !x && document.getElementById ) x = document.getElementById( id );
	if( !x && !document.all && document.getElementsByName )
	{
		x = document.getElementsByName( id );
		if( x.length == 0 ) return null;
		if( x.length == 1 ) return x[ 0 ];
	}
    
    return x;
}

function findObjByDocument( customDocument, id )
{
	if( customDocument == null || id == null || id == "" ) return null;
	
	var x;
	if( !( x = customDocument[ id ] ) && customDocument.all ) x = customDocument.all[ id ];
	if( !x && customDocument.getElementById ) x = customDocument.getElementById( id );
	if( !x && !customDocument.all && customDocument.getElementsByName )
	{
		x = customDocument.getElementsByName( id );
		if( x.length == 0 ) return null;
		if( x.length == 1 ) return x[ 0 ];
	}
    
    return x;
}

