var isDOM			= document.getElementById;																		// DOM1 browser (IE 5+, Netscape 6, Opera 5+)
var isOpera5		= window.opera && isDOM;																		// Opera 5+
var isOpera6		= isOpera5 && window.print;																		// Opera 6+
var isOpera7		= isOpera5 && document.readyState;																// Opera 7+
var isOpera8		= false;																						// Opera 8+ (defined after page onLoad event)
var isOpera			= (isOpera5||isOpera6||isOpera7);																// Opera
var isMSIE			= document.all && document.all.item && !isOpera;												// IE 4+
var isMSIE5			= isDOM && isMSIE;																				// IE 5+
var isNetscape4		= document.layers;																				// Netscape 4.*
var isMozilla		= isDOM && navigator.appName=="Netscape";														// Netscape 6.*
var isFirefox		= navigator.product=='Gecko' && navigator.userAgent.indexOf('KHTML') == -1;						// Firefox 2.x

/*
// Firefox
navigator.userAgent = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
navigator.vendor = 
navigator.platform = Win32
navigator.appVersion = 5.0 (Windows; en-US)
navigator.appCodeName = Mozilla
navigator.appName = Netscape
navigator.language = en-US
navigator.mimeTypes = [object MimeTypeArray]
navigator.oscpu = Windows NT 5.1
navigator.vendorSub = 
navigator.product = Gecko
navigator.productSub = 20080311
navigator.plugins = [object PluginArray]
navigator.securityPolicy = 
navigator.cookieEnabled = true
navigator.onLine = true
navigator.javaEnabled = function javaEnabled() {
    [native code]
}
navigator.taintEnabled = function taintEnabled() {
    [native code]
}
navigator.buildID = 2008031114
navigator.preference = function preference() {
    [native code]
}
navigator.registerContentHandler = function registerContentHandler() {
    [native code]
}
navigator.registerProtocolHandler = function registerProtocolHandler() {
    [native code]
}
*/

var browserHelper =
{
	getBrowserName: function()
	{
		if (isMSIE)
			return 'ie';

		if (isFirefox)
			return 'firefox';

		if (isOpera)
			return 'opera';

		return 'unknown';	
	},

	getBodyScrollTop: function()
	{
		return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
	},

	getBodyScrollLeft: function()
	{
		return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
	},

	getClientWidth: function()
	{
		return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
	},

	getClientHeight: function()
	{
		return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
	},

	getPageScroll: function()
	{
		var yScroll = 0;
		if (self.pageYOffset)
		{
			yScroll = self.pageYOffset;
		}
		else if (document.documentElement && document.documentElement.scrollTop) // IE6 Strict
		{	 
			yScroll = document.documentElement.scrollTop;
		}
		else if (document.body) // all IE
		{
			yScroll = document.body.scrollTop;
		}
		return yScroll;
	},

	getPageSize: function()
	{
		var xScroll, yScroll;

		if (window.innerHeight && window.scrollMaxY)
		{
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		}
		else if (document.body.scrollHeight > document.body.offsetHeight) // all but Explorer Mac
		{ 
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		}
		else // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		{ 
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}

		var windowWidth, windowHeight;
		if (self.innerHeight) // all except Explorer
		{	
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		}
		else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
		{ 
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		}
		else if (document.body) // other Explorers
		{ 
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}

		// for small pages with total height less then height of the viewport
		if (yScroll < windowHeight)
		{
			pageHeight = windowHeight;
		}
		else
		{
			pageHeight = yScroll;
		}

		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth)
		{
			pageWidth = windowWidth;
		}
		else
		{
			pageWidth = xScroll;
		}

		pageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight);

		return pageSize;
	}
};

addOnLoadHandler(function()
{
	if (isOpera === true && ('object' != (typeof document.body.currentStyle)))
		isOpera8 = true;
}, 1000);
