

// set the given attribut to the layer IE, NS and W3C --------------------------------------
function setLayerAttribute( object, attribute, value )
{
	if (!object || !attribute || !value || object == null || attribute == null || value == null)
	{
		return;
	}
	if (document.layers )
	{
		if( isNaN( value ) == true)
		{
			eval( "object." + attribute + " = '" + value + "'" );
		}
		else
		{
			eval( "object." + attribute + " = " + value );
		}
	}
	else
	{
		if( isNaN( value ) == true)
		{
			eval(  "object.style." + attribute + " = '" + value + "'" );
		}
		else
		{
			eval(  "object.style." + attribute + " = " + value );
		}
	} 
	return;
}



// find a layer in the document IE, NS and W3C --------------------------------------
function findLayer( id, doc )
{
	if (id && id  != null)
	{
		if (!doc || doc == null)
		{
			doc = document;
		}
		var node = null;
		if ( doc.all )
		{
			node = doc.all[id];
		}
		else if ( doc.getElementById )
		{
			node = doc.getElementById(id);
		}
		else if ( doc.layers )
		{
			node = doc.layers[id];
			for( var i=0; !node && doc.layers && i < doc.layers.length; i++)
			{
				node = findLayer( id, doc.layers[i].document );
			}   
		}
		return node;
	}
	return null;
}





