
// ------------------------------------------------------------------------------------------------------------
//	fotosite-node-manipulation
//
// 	<http://www.muratnkonar.com/otherstuff/fotosite>
//
//	(C) 2006 murat n konar
//
// ------------------------------------------------------------------------------------------------------------



// ------------------------------------------------------------------------------------------------------------
//	nodeWithId
// ------------------------------------------------------------------------------------------------------------
function nodeWithId(id)
{
   return document.layers ? document.layers[id] : (document.getElementById ?  document.getElementById(id) : document.all[id]);
}

// ------------------------------------------------------------------------------------------------------------
//	bodyNode
// ------------------------------------------------------------------------------------------------------------
function bodyNode()
{
	return document.getElementsByTagName("body").item(0)
}

// ------------------------------------------------------------------------------------------------------------
//	replaceNode
// ------------------------------------------------------------------------------------------------------------
function replaceNode(node, replacement)
{
	var parent = node.parentNode
	if (parent != null)
	{
		parent.replaceChild(replacement, node)
	}
}


// ------------------------------------------------------------------------------------------------------------
//	node_style
// ------------------------------------------------------------------------------------------------------------
function node_style(node_id)
{
	var node_style;

	if (document.getElementById)
	{
		// this is the way the standards work
		node_style = document.getElementById(node_id).style;
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		node_style = document.all[node_id].style;
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		node_style = document.layers[node_id].style;
	}
	
	return node_style;
}
