/**
 * Javascript file containing various functions
 * 
 * @author Dennis Robinson
 * @date   February 15, 2009
 * @breif  Contains the core javascript functions
 */

/**
 * GetObject
 * @param string id   The id parameter of the object to retrieve
 * @return object     The requested object
 */
function GetObject(id)
{
	if (document.getElementById)
	{
		return document.getElementById(id);
	}
	else if (document.all)
	{
		return document.all[id];
	}
	else if (document.layers)
	{
		return document.layers[id];
	}

	return null;
}

/**
 * GetScrollPosition
 * @return int        The current position of the vertical scrollbar
 */
function GetScrollPosition()
{
	if (document.body.scrollTop > 0)
	{
		return document.body.scrollTop;
	}
	else if (window.pageYOffset)
	{
		return window.pageYOffset;
	}
	else if (document.body.parentElement)
	{
		return document.body.parentElement.scrollTop;
	}

	return 0;
}