/* 
 	. Created by Lis/2k1. rev# b 20.0.2 : 16:7:46
	------------------------------------
	. (c) Multimedia Art, 2002
*/

// CVSinfo
// $Id: cBrowserInfo.js 1888 2005-10-07 16:02:48Z phil $
// $Source: /cvsrep/Kroton/jsLib/cBrowserInfo.js,v $
// $Revision: 970 $

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) );
	}
	
	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.GetUserLanguage = function()
	{
		var result = ( this.IsIE ) ? navigator.browserLanguage : navigator.language;
		return( result );
	}
	
	this.IsIE = this.cIsIE();
	this.IsNN = this.cIsNN();
	this.IsDOM = this.cIsDOM();
	this.IsWindows = this.cIsWindows();
	this.BrowserVersion = this.GetBrowserVersion();
	this.IsNN4 = this.IsNN && (parseInt( this.BrowserVersion ) == 4);
	return(this);
}

var MA_BI = MA_BrowserInfo = new cBrowserInfo();

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.__oldW = MA_BrowserInfo.GetMaxX();
	window.__oldH = MA_BrowserInfo.GetMaxY();
	window.onresize = function () { 
		if  ( window.__oldW != MA_BrowserInfo.GetMaxX() 
			|| window.__oldH != MA_BrowserInfo.GetMaxY() )
			window.location.reload(); 
	}
}

// Fix IE5.0 bug
if ( typeof( Array().push ) == "undefined" )
	Array.prototype.push = function( iItem ){ this[this.length] = iItem; }
if ( typeof( Array().splice ) == "undefined" )
	Array.prototype.splice = function( start, deleteCount ) {
		var t = new Array();
		for(var i=0; i<this.length; i++ ) {
			if( i >= start && i < start+deleteCount )
				t.push( this[i] );
		}
		return( t );
	}