// JScript source code
var isDHTML = 0;
var isID = 0;
var isAll = 0;
var isLayers = 0;

// Set some variables describing browser's capabilities.
if (document.getElementById)
{
	isID = 1;
	isDHTML = 1;
}
else
{
	if (document.all)
	{
		isAll = 1;
		isDHTML = 1;
	}
	else
	{
		browserVersion = parseInt(navigator.appVersion);
		if ((navigator.appName.indexOf('Netscape') != -1) &&
			(browserVersion == 4))
		{
			isLayers = 1;
			isDHTML = 1;
		}
	}
}

var bIsNS= (document.getElementById && !document.all) ? 1 : 0;
var bIsIE = document.all ? 1 : 0;

// 
//	Given the ID of an object, the function finds that object
//	from the dicument and rrturn to user.
//
function getDOMObject(id)
{
	if (isID)
	{
		return document.getElementById(id);
	}
	else
	{
		if (isAll)
		{
			return document.all[id];
		}
		else
		{
			if (isLayers)
			{
				return document.layers[id];
			}
		}
	}
	return null;
}

// 
//	Given the ID of an object, the function finds that object
//	from the document and returns its style.
//
function getDOMObjectStyle(id)
{
	var ob = getDOMObject(id);
	if (null != ob)
	{
		return ob.style;
	}
	return null;
}

//
//	Function returns the pixel depth value of the colors
//	used by browser.
//
function getColorDepth()
{
	return screen.colorDepth;
}

//
//	Function returns the height of browser window, including the
//	controls and menus around the visible area.
//	This function only works in Netscape.
//
function getBrowserHeight()
{
	if (window.outerHeight != null)
	{
		return window.outerHeight;
	}
	
	return null;
}

//
//	Function returns the width of browser window, including the
//	controls around the visible area.
//	This function only works in Netscape.
//
function getBrowserWidth()
{
	if (window.outerWidth != null)
	{
		return window.outerWidth;
	}
	
	return null;
}

//
//	Function returns the height of browser window.
//
function getLivePageHeight()
{
	if (window.innerHeight != null)
	{
		return window.innerHeight;
	}
	
	if (document.body.clientHeight != null)
	{
		return document.body.clientHeight;
	}
	
	return null;
}

//
//	Function returns the width of browser window.
//
function getLivePageWidth()
{
	if (window.innerWidth != null)
	{
		return window.innerWidth;
	}
	
	if (document.body.clientWidth != null)
	{
		return document.body.clientWidth;
	}
}

function getScrollLeft()
{
	if (window.pageXOffset != null)
	{
		return window.pageXOffset;
	}
	
	if (document.body.scrollWidth != null)
	{
		return document.body.scrollLeft;
	}
	
	return null;
}

function getScrollTop()
{
	if (window.pageYOffset != null)
	{
		return window.pageYOffset;
	}
	
	if (document.body.scrollHeight != null)
	{
		return document.body.scrollTop;
	}
	
	return null;
}

