//////////////////////////////////////////////////////////////////
//	IMAGE UTILITIES
//////////////////////////////////////////////////////////////////
/**
	Mouseover Function
*/
function roll(slot,src)
{
	eval("window.document." + slot + ".src=" + src + ".src");
}

/**
	Preload Image returns an image object reference
*/
function newImage(source)
{
	var image = new Image();
	image.src = source;
	return image;
}

//////////////////////////////////////////////////////////////////
//	DOM UTILITIES
//////////////////////////////////////////////////////////////////
/**
	Get the users browser type.
*/
function Browser()
{
	this.ns6 = (!document.all && document.getElementById) ? true : false;
	this.ns4 = (document.layers) ? true : false;
	this.ie4 = (document.all) ? true : false;
	return this;
}

var browser = new Browser();

/**
	Utility function that returns the appropriate layer
	reference, dependent on the browser.
*/
function getLayerRef(theString)
{
	if (browser.ns4) var ref = "document." + theString;
	if (browser.ie4) var ref = "document.all." + theString + ".style";
	if (browser.ns6) var ref = "document.getElementById('" + theString + "').style";
	return eval(ref);
}

/**
	This function shows the layers passed in the
	function argument
*/
function showLayer(theLayer)
{
	if (browser.ns4)				getLayerRef(theLayer).visibility = "show";
	if (browser.ie4 || browser.ns6)	getLayerRef(theLayer).visibility = "visible";
}

/**
	This function hides the layers passed in
	the function argument
*/
function hideLayer(theLayer)
{
	if (browser.ns4)				getLayerRef(theLayer).visibility = "hide";
	if (browser.ie4 || browser.ns6)	getLayerRef(theLayer).visibility = "hidden";
}

/**
	Swaps the content of a div with the
	document node passed as the second argument.
*/
function setContent(d, s)
{
	if (!browser.ns4)
	{
		var holder = document.getElementById(d);
		holder.replaceChild(s, holder.firstChild);
	}
}

/**
	Fix for the lack of the min-height css property
	in internet explorer for windows.
	Recursively sets child divs to the same height and
	forces the wanted height.
	- added 02/24/04
*/
function fixHeightForObject(height, object)
{
	if ((browser.ie4 || browser.ns6) && object.nodeName == "DIV")
	{
		object.style.height = height + "px";
		for (var i = 0; i < object.childNodes.length; i++)
			fixHeightForObject(height, object.childNodes[i]);
	}
}