window.onerror = null;
onUnload = LayerContainer.prototype.hideAll;
app_ver=navigator.appVersion;

document.write( '<SCRIPT LANGUAGE="JavaScript1.2" SRC="/01NET/JavaScript/Mouse.js" TYPE="text/javascript"></SCRIPT>' );
if (app_ver.indexOf('Macintosh')!=-1) 
    document.write( '<SCRIPT LANGUAGE="JavaScript1.2" SRC="/01NET/JavaScript/LayerMC.js" TYPE="text/javascript"></SCRIPT>' );
else if ( document.getElementById ) 
	document.write( '<SCRIPT LANGUAGE="JavaScript1.2" SRC="/01NET/JavaScript/LayerDOM.js" TYPE="text/javascript"></SCRIPT>' );
else if ( document.layers )
	document.write( '<SCRIPT LANGUAGE="JavaScript1.2" SRC="/01NET/JavaScript/LayerNS.js" TYPE="text/javascript"></SCRIPT>' );
else if ( document.all )
	document.write( '<SCRIPT LANGUAGE="JavaScript1.2" SRC="/01NET/JavaScript/LayerIE4.js" TYPE="text/javascript"></SCRIPT>' );


/*	----------------
	Layer Container
	---------------- */
function LayerContainer ( )
{
	/*
		Class variables
	 */
	this.layers = new Array;
	this.layer = null;

	this.timer = null;
	this.timerIsOn = false;
	this.timerDelay = 0;

	/*
		Prototype initializator
	 */
	if ( typeof( _LayerContainer_prototype_ ) == 'undefined' )
	{
		_LayerContainer_prototype_ = true;
		LayerContainer.prototype.add = add;

		LayerContainer.prototype.show = show;
		LayerContainer.prototype.showMouseRelative = showMouseRelative;
		LayerContainer.prototype.hide = hide;
		LayerContainer.prototype.hideDelay = hideDelay;
		LayerContainer.prototype.hideAll = hideAll;

		LayerContainer.prototype.move = move;

		LayerContainer.prototype.timerToHideLayer = timerToHideLayer;
		LayerContainer.prototype.resetTimer = resetTimer;
	} 
  
	/*
		Populate container
	 */
	function add ( layerName )
	{
		this.layers[ this.layers.length ] = layerName;
	}

	/*
		Visibility
	 */
	function show ( layerName )
	{
		if ( layerName != this.layer )
		{
			this.hide();
			showLayer( layerName, true );
			this.layer = layerName;
		}
		this.resetTimer();
	}

	function showMouseRelative ( layerName, e, x, y )
	{
		if ( layerName != this.layer )
		{
			this.hide();
			showLayerMouseRelative( layerName, e, x, y );
			this.layer = layerName;
		}
		this.resetTimer();
		
	}

	function hide ( )
	{
		if ( this.layer )
		{
			showLayer( this.layer, false );
			this.layer = null;
		}
		this.resetTimer();
	}

	function hideDelay ( lc, sec )
	{
		this.timerToHideLayer( lc, sec );
	}

	function hideAll ( )
	{
		for ( var i = 0; i < this.layers.length; i++ )
		{
			this.layer = this.layers[ i ];
			this.hide();
		}
	}

	function move ( layerName, x, y )
	{
		moveLayer( layerName, x, y );
	}

	/*
		Timer
	 */
	function timerToHideLayer ( lc, sec )
	{
		this.timer = setTimeout( "__timeOutLayer( " + lc + " )", sec * 1000 );
	}

	function resetTimer ( )
	{
		if ( this.timer ) clearTimeout( this.timer );
		this.timer = null;
	}
}

function __timeOutLayer ( lc )
{
	lc.hide();
}

