/* 
 	. Created by Lis/2k1. rev# b 20.0.2 : 16:7:46
	------------------------------------
	. (c) Multimedia Art, 2002
*/

// CVSinfo
// $Id: cBrowserInfo.js,v 1.5 2002/04/24 10:30:12 lis Exp $
// $Source: D:/cvsrepo/mres/Kroton/jsLib/cBrowserInfo.js,v $
// $Revision: 1.5 $

function cBrowserInfo()
{
	this.cIsIE = function() 
	{
		return( (navigator.appName.indexOf("Microsoft")>=0 ) ? 1 : 0 );
	}
	
	this.cIsNN = function() 
	{
		return( (navigator.appName.indexOf("Netscape")>=0 ) ? 1 : 0 );
	}
	
	this.cIsWindows = function()
	{
		return( navigator.userAgent.indexOf("Windows") != -1 ? 1 : 0 );
	}
	
	this.cIsDOM = function() 
	{
		var result = (typeof(document.getElementsByTagName) != 'undefined'
			&& typeof(document.createElement) != 'undefined') ? 1 : 0;
		return( result );
	}
	
	this.GetBrowserVersion = function() 
	{
		return( parseFloat(navigator.appVersion.substring(0, 3)) );
	}
	
	this.GetMaxX = function()
	{
		var result = (this.IsIE) ? document.body.clientWidth : window.innerWidth;
		return( result ); 
	}
	
	this.GetMaxY = function()
	{
		var result = (this.IsIE) ? document.body.clientHeight : window.innerHeight;
		return( result ); 
	}
	
	this.GetScrolledLeft = function()
	{
		var result = (this.IsIE) ? document.body.scrollLeft : window.scrollX;
		return( result );
	}
	
	this.GetScrolledUp = function()
	{
		var result = (this.IsDOM) ? document.body.scrollTop : window.scrollX;
		return( result );
	}
	
	this.IsIE = this.cIsIE();
	this.IsNN = this.cIsNN();
	this.IsDOM = this.cIsDOM();
	this.IsWindows = this.cIsWindows();
	this.BrowserVersion = this.GetBrowserVersion();
	return(this);
}

var MA_BrowserInfo = new cBrowserInfo();
var MA_BI = MA_BrowserInfo;

var mouseX, mouseY;
function SaveMouseXY( ev )
{
	if( MA_BrowserInfo.IsIE ) 
	{
		mouseX = window.event.x;
		mouseY = window.event.y;
	}
	else
	{
		mouseX = ev.pageX;
		mouseY = ev.pageY;
	}
}

if ( MA_BrowserInfo.IsIE || MA_BrowserInfo.IsDOM )
{
	document.onmousemove = SaveMouseXY;
}
else
{
	window.captureEvents( Event.MOUSEMOVE | Event.RESIZE );
	window.onmousemove = SaveMouseXY;
	window.onresize = function () { window.location.reload(); }
}

// Fix IE5.0 bug
if ( typeof( Array().push ) == "undefined" )
	Array.prototype.push = function( iItem ){ this[this.length] = iItem; }


