<!--
function LayerManager(tobjID)
{
	this.objName=tobjID;
	this.SubLayerList=new Array();
	if(tobjID=="") //ROOT
	{
		this._Core=this;
		this._currentLayer=null;
	}
	
}
function LayerManager_DefualtKeyControl(tobjID, keyCode)
{
	return false;
}

LayerManager.prototype.RegManagedLayer=function (tobjID, fnKeyControl)
{
	if(tobjID=="")
		return null;
	var tobj=new LayerManager(tobjID);
	tobj.objName=tobjID;
	tobj._Core=this._Core;
	tobj.KeyControl=fnKeyControl;
	
	if(tobj.KeyControl==null)
		tobj.KeyControl=LayerManager_DefualtKeyControl;
	this.SubLayerList[this.SubLayerList.length]=tobj;
	
	return tobj;
}

LayerManager.prototype.OpenLayer=function (tobjID)
{
	if(this.SubLayerList==null)
		return;
	if(this.GetActivateWindow()!="")
	{
		this.CloseLayer(this.GetActivateWindow());
	}
	for(var i=0;i<this.SubLayerList.length;i++)
	{
		if(this.SubLayerList[i].objName!=tobjID)
		{
			if(document.getElementById(this.SubLayerList[i].objName)!=null)
			{
				this.SubLayerList[i].SubCloseAll();
				document.getElementById(this.SubLayerList[i].objName).style.display="none";
			}
		}
		else
		{
			this._Core._currentLayer=this.SubLayerList[i];
			
			
			
		}
	}
}

LayerManager.prototype.CloseLayer=function (tobjID)
{
	if(this.SubLayerList==null)
		return;
	for(var i=0;i<this.SubLayerList.length;i++)
	{
		if(this.SubLayerList[i].objName==tobjID)
		{
			if(document.getElementById(this.SubLayerList[i].objName)!=null)
			{
				this.SubLayerList[i].SubCloseAll();
				document.getElementById(this.SubLayerList[i].objName).style.display="none";
			}
			this._Core._currentLayer=null;
			
		}
		
		
	}
}
LayerManager.prototype.SubCloseAll=function ()
{
//alert(this.objName);
	if(this.SubLayerList==null)
		return;
	for(var i=0;i<this.SubLayerList.length;i++)
	{
		
		this.SubLayerList[i].CloseLayer();
		
	}
}
LayerManager.prototype.FindLayerObj=function (tobjID)
{
	if(this.SubLayerList==null)
		return;
	for(var i=0;i<this.SubLayerList.length;i++)
	{
		if(this.SubLayerList[i].objName!=tobjID)
		{
			
			return this.SubLayerList[i];
			
		}
		
	}
	return null;
}
LayerManager.prototype.GetActivateWindow=function ()
{
	if(this._Core._currentLayer!=null)
	{
		
		if(document.getElementById(this._Core._currentLayer.objName)!=null)
		{
			if(document.getElementById(this._Core._currentLayer.objName).style.display=="inline")
			{   
				return this._Core._currentLayer.objName;
				
			}
		}
	}
	return "";
}

//-->
