function AX_Panel() {
	this.Application = null;
	this.Name = 'AX_Panel';
	this.Children = new Array();
	
	this.Visible = false;
	this.MinW = 100;
	this.MinH = 100;
	this.Width = 240;
	this.Height = 200;
	this.ParentWidth = 0;
	this.ParentHeight = 0;
	this.Left = 0;
	this.Top = 0;
	this.AutoSize = false;
	this.AutoWidth = false;
	this.AutoHeight = false;
	this.PercWidth = 100;
	this.PercHeight = 100;
	this.CenterHorz = false;
	this.CenterVert = false;
	this.Padding = 0;
	this.TextAlign = 'left';
	this.VerticalAlign = 'top';
	this.InnerRect = new Array();

	this.BackgroundImageSet = '';
	this.BackgroundURL = '';
	
	this.Parent = null;
	this.DOMContainer = null;
	this.BackgroundColor = null;
	this.BorderSize = null;
	this.BorderColor = null;
	this.BorderColorHigh = null;
	this.BorderColorShadow = null;
	this.BorderStyle = null;
	this.BackgroundImageSet = '';
	this.BackgroundURL = '';
	
	this.FontFamily = null;
	this.FontSize = null;
	this.FontColor = null;
	this.FontBold = null;
	this.FontSmallCaps = null;
	
	this.agent = null;
	this.ImagesBasePath = null;

	this.Box = null;
}


AX_Panel.prototype.undock = function(dragObject){
	var freeH = dragObject.Height;
	for (var i = 0; i < this.Children.length; i++) {
		if (this.Children[i] != dragObject) {
			this.Children[i].SetSize(this.Children[i].Left, this.Children[i].Top - freeH);
		}
	}
}

AX_Panel.prototype.dock = function(dragObject){
	var freeH = dragObject.Height;
	for (var i = 0; i < this.Children.length; i++) {
		if (this.Children[i] != dragObject) {
			this.Children[i].SetSize(this.Children[i].Left, this.Children[i].Top + freeH);
		}
	}
}

AX_Panel.prototype.getAbsolutePosition = function(){
	var ret = new Array(0, 0, 0, 0);
	var obj = this.Box;
	ret[2] = obj.offsetWidth;
	ret[3] = obj.offsetHeight;
	while (obj) {
		ret[0] += obj.offsetLeft;
		ret[1] += obj.offsetTop;
		obj = obj.offsetParent;
	}
	return ret;
}

AX_Panel.prototype.getAbsoluteClientPosition = function(){
	var ret = new Array(0, 0, 0, 0);
	var obj = this.GetDOMContainer();
	ret[2] = obj.offsetWidth;
	ret[3] = obj.offsetHeight;
	while (obj) {
		ret[0] += obj.offsetLeft;
		ret[1] += obj.offsetTop;
		obj = obj.offsetParent;
	}
	return ret;
}

AX_Panel.prototype.setParent = function(oParent){
	this.Parent = oParent;
	this.DOMContainer = this.Parent.GetDOMContainer();
	this.BackgroundColor = this.Parent.BackgroundColor;
	this.BorderSize = this.Parent.BorderSize;
	this.BorderColor = this.Parent.BorderColor;
	this.BorderColorHigh = this.Parent.BorderColorHigh;
	this.BorderColorShadow = this.Parent.BorderColorShadow;
	this.BorderStyle = this.Parent.BorderStyle;
	
	this.FontFamily = this.Parent.FontFamily;
	this.FontSize = this.Parent.FontSize;
	this.FontColor = this.Parent.FontColor;
	this.FontBold = this.Parent.FontBold;
	this.FontSmallCaps = this.Parent.FontSmallCaps;
	
	this.agent = this.Parent.agent;
	this.ImagesBasePath = this.Parent.ImagesBasePath;

	this.Box = this.Application.getDIV();
	this.Box.style.backgroundColor = this.BackgroundColor;
	this.Box.style.top = (this.Parent.Padding) + 'px';
	this.Box.style.left = (this.Parent.Padding) + 'px';
	this.Box.style.width = (this.Width - this.BorderSize * 2) + 'px';
	this.Box.style.height = (this.Height - this.BorderSize * 2) + 'px';
	this.Box.style.overflow = 'auto';
	this.drawBorder();
	this.DOMContainer.appendChild(this.Box);
}



AX_Panel.prototype.GetDOMContainer = function() {
	return (this.InnerBox ? this.InnerBox : this.Box);
}

AX_Panel.prototype.SetBorder = function(iBorderSize, sBorderStyle, colBorderColor, colBorderColor2) {
	if (iBorderSize !== false) this.BorderSize = iBorderSize;
	if (sBorderStyle !== false) this.BorderStyle = sBorderStyle;
	if (colBorderColor !== false) this.BorderColor = colBorderColor;
	if (colBorderColor !== false) this.BorderColorHigh = colBorderColor;
	if (colBorderColor2 !== false) this.BorderColorShadow = colBorderColor2;
	this.drawBorder();
	this.Box.style.width = (this.Width - this.BorderSize * 2) + 'px';
	this.Box.style.height = (this.Height - this.BorderSize * 2) + 'px';
}

AX_Panel.prototype.SetBackgroundColor = function(bgcol) {
	this.BackgroundColor = bgcol;
	this.Box.style.backgroundColor = this.BackgroundColor;
}

AX_Panel.prototype.SetBackgroundImage = function(sUrl) {
	this.BackgroundImage = sUrl;
	this.Box.style.backgroundImage = 'url(' + this.BackgroundImage + ')';
}

AX_Panel.prototype.SetBackgroundImageSet = function(sUrl, sPrefix) {
	this.BackgroundImageSet = sPrefix;
	this.BackgroundURL = sUrl;
	var w = this.Box.offsetWidth;
	var h = this.Box.offsetHeight;
	if (w > 0 && h > 0) {
		this.Box.style.backgroundImage = 'url(' + this.BackgroundURL + '?basedir=' + this.ImagesBasePath + '&basename=' + this.BackgroundImageSet + '&width=' + w + '&height=' + h + ')';
	}
}

AX_Panel.prototype.SetVisible = function(bVisible) {
	if (bVisible != this.Visible) {
		this.Visible = bVisible;
		if (bVisible) {
			this.Box.style.display = 'block';
		} else {
			this.Box.style.display = 'none';
		}
	}
}

AX_Panel.prototype.drawBorder = function() {
	if ((this.BorderSize == 1) && (this.BorderStyle.indexOf('set') > 0)) {
		var lt = '1px solid ' + this.BorderColorHigh;
		var rb = '1px solid ' + this.BorderColorShadow;
		if (this.BorderStyle == 'inset') {
			lt = '1px solid ' + this.BorderColorShadow;
			rb = '1px solid ' + this.BorderColorHigh;
		}
		this.Box.style.border = '0px solid black';
		this.Box.style.borderLeft = lt;
		this.Box.style.borderTop = lt;
		this.Box.style.borderRight = rb;
		this.Box.style.borderBottom = rb;
	} else {
		this.Box.style.border = this.BorderSize + 'px ' + this.BorderStyle + ' ' + this.BorderColor;
	}
}

AX_Panel.prototype.calcSize = function(w, h) {
	if (w) {
		var s = '' + w;
		if (s.indexOf('%') > 1) {
			this.AutoWidth = true;
			this.PercWidth = parseInt(w);
			this.Width = 0;
		} else {
			this.AutoWidth = false;
			this.Width = Math.max(parseInt(w), this.MinW);
		}
	}
	if (h) {
		var s = '' + h;
		if (s.indexOf('%') > 1) {
			this.AutoHeight = true;
			this.PercHeight = parseInt(h);
			this.Height = 0;
		} else {
			this.AutoHeight = false;
			this.Height = Math.max(parseInt(h), this.MinH);
		}
	}
	this.AutoSize = this.AutoWidth || this.AutoHeight || this.CenterHorz || this.CenterVert;
}

AX_Panel.prototype.Move = function(l, t) {
	this.Left = l;
	this.Top = t;
	this.Box.style.left = (this.Left + this.Parent.Padding) + 'px';
	this.Box.style.top = (this.Top + this.Parent.Padding) + 'px';
}

AX_Panel.prototype.SetSize = function(l, t, w, h, hcenter, vcenter) {
	this.CenterHorz = hcenter || false;
	this.CenterVert = vcenter || false;
	this.Left = l;
	this.Top = t;
	if (this.isDocked) {
		switch (this.dockPos) {
			case 'lefttop':
				this.Left = 0;
				this.Top = 0;
				break;
			case 'righttop':
				this.Left = this.Parent.InnerRect['width'] - this.Parent.Padding - this.Width;
				this.Top = 0;
				break;
			case 'leftbottom':
				this.Left = 0;
				this.Top = this.Parent.InnerRect['height'] - this.Parent.Padding - this.Height;
				break;
			case 'rightbottom':
				this.Left = this.Parent.InnerRect['width'] - this.Parent.Padding - this.Width;
				this.Top = this.Parent.InnerRect['height'] - this.Parent.Padding - this.Height;
				break;
			case 'center':
				this.Left = ((this.Parent.InnerRect['width'] - this.Width) / 2);
				this.Top = 0;
				break;
		}
	}
	this.Box.style.left = (this.Left + this.Parent.Padding) + 'px';
	this.Box.style.top = (this.Top + this.Parent.Padding) + 'px';
	if ((this.Width != w) || (this.Height != h)) {
		var rect = this.Parent.InnerRect;
		this.calcSize(w, h);
		if (this.AutoSize) {
			if (this.AutoWidth) {
				var newW = 0;
				if (this.CenterHorz) {
					if (this.Left > 0) {
						newW = Math.floor((rect['width'] - this.Left * 2) * this.PercWidth / 100);
					} else {
						newW = Math.floor(rect['width'] * this.PercWidth / 100);
						this.Box.style.left = ((rect['width'] - newW) / 2 + this.Parent.Padding) + 'px';
					}
				} else {
					newW = Math.floor((rect['width'] - this.Left) * this.PercWidth / 100);
				}
				if (newW != this.Width) {
					this.Width = Math.max(newW, this.MinW);
				}
			} else {
				if (this.CenterHorz) {
					this.Box.style.left = ((rect['width'] - this.Width) / 2 + this.Parent.Padding) + 'px';
				}
			}
			if (this.AutoHeight) {
				var newH = 0;
				if (this.CenterVert) {
					if (this.Top > 0) {
						newH = Math.floor((rect['height'] - this.Top * 2) * this.PercHeight / 100);
					} else {
						newH = Math.floor(rect['height'] * this.PercHeight / 100);
						this.Box.style.top = ((rect['height'] - newH) / 2 + this.Parent.Padding) + 'px';
					}
				} else {
					newH = Math.floor((rect['height'] - this.Top) * this.PercHeight / 100);
				}
				if (newH != this.Height) {
					this.Height = Math.max(newH, this.MinH);
				}
			} else {
				if (this.CenterVert) {
					this.Box.style.top = ((rect['height'] - this.Height) / 2 + this.Parent.Padding) + 'px';
				}
			}
		} else {
			if (this.CenterHorz) {
				this.Box.style.left = ((rect['width'] - this.Width) / 2 + this.Parent.Padding) + 'px';
			}
			if (this.CenterVert) {
				this.Box.style.top = ((rect['height'] - this.Height) / 2 + this.Parent.Padding) + 'px';
			}
		}
	}
	if (this.isDocked) {
		switch (this.dockPos) {
			case 'lefttop':
				this.Left = 0;
				this.Top = 0;
				break;
			case 'righttop':
				this.Left = this.Parent.InnerRect['width'] - this.Parent.Padding - this.Width;
				this.Top = 0;
				break;
			case 'leftbottom':
				this.Left = 0;
				this.Top = this.Parent.InnerRect['height'] - this.Parent.Padding - this.Height;
				break;
			case 'rightbottom':
				this.Left = this.Parent.InnerRect['width'] - this.Parent.Padding - this.Width;
				this.Top = this.Parent.InnerRect['height'] - this.Parent.Padding - this.Height;
				break;
			case 'center':
				this.Left = ((this.Parent.InnerRect['width'] - this.Width) / 2);
				this.Top = 0;
				break;
		}
	}
	this.Box.style.left = (this.Left + this.Parent.Padding) + 'px';
	this.Box.style.top = (this.Top + this.Parent.Padding) + 'px';
	this.Box.style.width = (this.Width - this.BorderSize * 2) + 'px';
	this.Box.style.height = (this.Height - this.BorderSize * 2) + 'px';
	if (this.BackgroundImageSet != '') {
		var sUrl = 'url(' + this.BackgroundURL + '?basedir=' + this.ImagesBasePath + '&basename=' + this.BackgroundImageSet + '&width=' + this.Width + '&height=' + this.Height + ')';
		this.Box.style.backgroundImage = sUrl;
	}
	var iPad = this.Padding + this.BorderSize;
  this.InnerRect['left'] = this.Padding;
  this.InnerRect['top'] = this.Padding;
  this.InnerRect['width'] = this.Width - this.Padding * 2 - this.BorderSize * 2;
  this.InnerRect['height'] = this.Height - this.Padding * 2 - this.BorderSize * 2;
	if (this.TitleBar) {
		this.TitleBar.style.width = this.Box.style.width;
		if (this.TBarPos == 'bottom') this.TitleBar.style.top = (this.Height - this.TBarH) + 'px';
		var w = this.TitleBar.offsetWidth;
		var h = this.TitleBar.offsetHeight;
		if (this.TitleBackgroundImageSet != '') {
			var sUrl = 'url(' + this.TitleBackgroundURL + '?basedir=' + this.ImagesBasePath + '&basename=' + this.TitleBackgroundImageSet + '&width=' + w + '&height=' + h + ')';
			this.TitleBar.style.backgroundImage = sUrl;
		}
	  if (this.TabStrip) {
			this.TabStrip.style.left = '0px';
			this.TabStrip.style.top = '0px';
			this.TabStrip.style.width = this.Width + 'px';
	  }
		if (this.BtnClose) {
			var w = this.BtnClose.offsetWidth;
			var h = this.BtnClose.offsetHeight;
			if (this.Width > w) {
				switch (this.btnClosePos.substr(0, 4)) {
					case 'cent':
						this.BtnClose.style.left = ((this.Width - w) / 2) + 'px';
						break;
					case 'left':
						this.BtnClose.style.left = (this.InnerBorderSize + 2) + 'px';
						break;
					case 'righ':
						this.BtnClose.style.left = (this.Width - this.InnerBorderSize - w - 2) + 'px';
						break;
				}
				switch (this.btnClosePos.substr(this.btnClosePos.length - 3)) {
					case 'dle':
						this.BtnClose.style.top = ((this.TBarH - h) / 2) + 'px';
						break;
					case 'top':
						this.BtnClose.style.top = this.InnerBorderSize + 'px';
						break;
					case 'tom':
						this.BtnClose.style.top = (this.TBarH - this.InnerBorderSize - h) + 'px';
						break;
				}
			}
		}
	}
	if (this.InnerBox) this.resizeContentPanel();
  if (this.resizeContentPanel) this.resizeContentPanel();
	for (var i = 0; i < this.Children.length; i++) {
		this.Children[i].resize();
	}
	if (this.OriginalHeight == 0) this.OriginalHeight = this.Height;
}

AX_Panel.prototype.resize = function(bForce) {
	if (this.isDocked) {
		switch (this.dockPos) {
			case 'lefttop':
				this.Left = 0;
				this.Top = 0;
				break;
			case 'righttop':
				this.Left = this.Parent.InnerRect['width'] - this.Parent.Padding - this.Width;
				this.Top = 0;
				break;
			case 'leftbottom':
				this.Left = 0;
				this.Top = this.Parent.InnerRect['height'] - this.Parent.Padding - this.Height;
				break;
			case 'rightbottom':
				this.Left = this.Parent.InnerRect['width'] - this.Parent.Padding - this.Width;
				this.Top = this.Parent.InnerRect['height'] - this.Parent.Padding - this.Height;
				break;
			case 'center':
				this.Left = ((this.Parent.InnerRect['width'] - this.Width) / 2);
				this.Top = 0;
				break;
		}
		this.Box.style.left = (this.Left + this.Parent.Padding) + 'px';
		this.Box.style.top = (this.Top + this.Parent.Padding) + 'px';
	}
	var needresizing = false;
	if (this.AutoSize || bForce) {
		needresizing = true;
		var rect = this.Parent.InnerRect;
		if ((this.ParentWidth != rect['width']) || (this.ParentHeight != rect['height'])) {
			this.ParentWidth = rect['width'];
			this.ParentHeight = rect['height'];
			needresizing = true;
			if (this.AutoWidth) {
				var newW = 0;
				if (this.CenterHorz) {
					if (this.Left > 0) {
						newW = Math.floor((rect['width'] - this.Left * 2) * this.PercWidth / 100);
					} else {
						newW = Math.floor(rect['width'] * this.PercWidth / 100);
						this.Box.style.left = ((rect['width'] - newW) / 2 + this.Parent.Padding) + 'px';
					}
				} else {
					newW = Math.floor((rect['width'] - this.Left) * this.PercWidth / 100);
				}
				if (newW != this.Width) {
					this.Width = Math.max(newW, this.MinW);
				}
			} else {
				if (this.CenterHorz) {
					this.Box.style.left = ((rect['width'] - this.Width) / 2 + this.Parent.Padding) + 'px';
				}
			}
			if (this.AutoHeight) {
				var newH = 0;
				if (this.CenterVert) {
					if (this.Top > 0) {
						newH = Math.floor((rect['height'] - this.Top * 2) * this.PercHeight / 100);
					} else {
						newH = Math.floor(rect['height'] * this.PercHeight / 100);
						this.Box.style.top = ((rect['height'] - newH) / 2 + this.Parent.Padding) + 'px';
					}
				} else {
					newH = Math.floor((rect['height'] - this.Top) * this.PercHeight / 100);
				}
				if (newH != this.Height) {
					this.Height = Math.max(newH, this.MinH);
				}
			} else {
				if (this.CenterVert) {
					this.Box.style.top = ((rect['height'] - this.Height) / 2 + this.Parent.Padding) + 'px';
				}
			}
		}
	}
	
	if (needresizing) {
		this.Box.style.width = (this.Width - this.Parent.BorderSize * 2 - this.Padding * 2) + 'px';
		if (this.BtnClose) {
			if (this.isOpen) this.Box.style.height = (this.Height - this.Parent.BorderSize * 2 - this.Padding * 2) + 'px';
		} else {
			this.Box.style.height = (this.Height - this.Parent.BorderSize * 2 - this.Padding * 2) + 'px';
		}
		if (this.BackgroundImageSet != '') {
			var sUrl = 'url(' + this.BackgroundURL + '?basedir=' + this.ImagesBasePath + '&basename=' + this.BackgroundImageSet + '&width=' + this.Width + '&height=' + this.Height + ')';
			this.Box.style.backgroundImage = sUrl;
		}
		var iPad = this.Padding + this.BorderSize;
	  this.InnerRect['left'] = this.Padding;
	  this.InnerRect['top'] = this.Padding;
	  this.InnerRect['width'] = this.Width - this.Padding * 2 - this.BorderSize * 2;
	  this.InnerRect['height'] = this.Height - this.Padding * 2 - this.BorderSize * 2;
		if (this.TitleBar) {
			this.TitleBar.style.width = this.Box.style.width;
			if (this.TBarPos == 'bottom') this.TitleBar.style.top = (this.Height - this.TBarH) + 'px';
			var w = this.TitleBar.offsetWidth;
			var h = this.TitleBar.offsetHeight;
			if (this.TitleBackgroundImageSet != '') {
				var sUrl = 'url(' + this.TitleBackgroundURL + '?basedir=' + this.ImagesBasePath + '&basename=' + this.TitleBackgroundImageSet + '&width=' + w + '&height=' + h + ')';
				this.TitleBar.style.backgroundImage = sUrl;
			}
		  if (this.TabStrip) {
				this.TabStrip.style.left = '0px';
				this.TabStrip.style.top = '0px';
				this.TabStrip.style.width = '0px';
		  }
			if (this.BtnClose) {
				var w = this.BtnClose.offsetWidth;
				var h = this.BtnClose.offsetHeight;
				switch (this.btnClosePos.substr(0, 4)) {
					case 'cent':
						this.BtnClose.style.left = ((this.Width - w) / 2) + 'px';
						break;
					case 'left':
						this.BtnClose.style.left = (this.InnerBorderSize + 2) + 'px';
						break;
					case 'righ':
						this.BtnClose.style.left = (this.Width - this.InnerBorderSize - w - 2) + 'px';
						break;
				}
				switch (this.btnClosePos.substr(this.btnClosePos.length - 3)) {
					case 'dle':
						this.BtnClose.style.top = ((this.TBarH - h) / 2) + 'px';
						break;
					case 'top':
						this.BtnClose.style.top = this.InnerBorderSize + 'px';
						break;
					case 'tom':
						this.BtnClose.style.top = (this.TBarH - this.InnerBorderSize - h) + 'px';
						break;
				}
			}
		}
	  if (this.ClientBox) this.resizeContentPanel();
	  if (this.InnerBox) this.resizeContentPanel();
		for (var i = 0; i < this.Children.length; i++) {
			this.Children[i].resize();
		}
	}
}

AX_Panel.prototype.SetFont = function(sFont, iFontSize, bBold, sFontCol) {
	this.FontFamily = sFont;
	this.GetDOMContainer().style.fontFamily = sFont;
	if (iFontSize) {
		this.FontSize = iFontSize;
		this.GetDOMContainer().style.fontSize = iFontSize + 'pt';
	}
	if (bBold != undefined) {
		this.FontBold = bBold;
		this.GetDOMContainer().style.fontWeight = (bBold ? 'bold' : 'normal');
	}
	if (sFontCol) {
		this.FontColor = sFontCol;
		this.GetDOMContainer().style.color = sFontCol;
	}
}

AX_Panel.prototype.SetFontFamily = function(sFont) {
	this.FontFamily = sFont;
	this.GetDOMContainer().style.fontFamily = sFont;
}
AX_Panel.prototype.SetFontColor = function(sFontCol) {
	this.FontColor = sFontCol;
	this.GetDOMContainer().style.color = sFontCol;
}
AX_Panel.prototype.SetFontBold = function(bBold) {
	this.FontBold = bBold;
	this.GetDOMContainer().style.fontWeight = (bBold ? 'bold' : 'normal');
}
AX_Panel.prototype.SetFontSize = function(iFontSize) {
	this.FontSize = iFontSize;
	this.GetDOMContainer().style.fontSize = iFontSize + 'pt';
}

AX_Panel.prototype.SetHTMLContent = function(sText) {
	this.GetDOMContainer().innerHTML = sText;
}

AX_Panel.prototype.hasChildren = function(){
	return (this.Children.length > 0);
}

AX_Panel.prototype.addChild = function(oChildObject) {
	if (oChildObject) {
		this.Children.push(oChildObject);
	}
}

AX_Panel.prototype.removeChild = function(oChildObject) {
	if (oChildObject) {
		for (var i = 0; i < this.Children.length; i++) {
			if (this.Children[i] == oChildObject) {
				this.Children.splice(i, 1);
				break;
			}
		}
	}
}


//=========================================================

function AX_FloatPanel(sDockPos, sTitlebarPos, hTitlebar) {
	this.base = AX_Panel;
	this.base();

	this.DockParent = null;
	this.isDocked = false;
	this.isMoving = false;
	this.dockPos = sDockPos || 'lefttop';
	this.btnClosePos = 'leftmiddle';
	this.ImgClose = null;
	this.ImgCloseSrc = '';
	this.ImgOpen = null;
	this.ImgOpenSrc = '';
	this.isOpen = true;
	this.DragHandler = null;
	this.BtnClose = null;
	this.TitleBar = null;
	this.TitleBackgroundColor = '';
	this.TitleBackgroundImageSet = '';
	this.TitleBackgroundURL = '';
	this.TBarH = hTitlebar || 16;
	this.TBarPos = sTitlebarPos || 'top';
	this.onPanelClose = null;
}

AX_FloatPanel.prototype = new AX_Panel;

AX_FloatPanel.prototype.setDockPosition = function(sDockPos){
	this.dockPos = sDockPos || 'lefttop';
}

AX_FloatPanel.prototype.setTitlebarHeight = function(hTitlebar){
	this.TBarH = hTitlebar;
}

AX_FloatPanel.prototype.setParent = function(oParent){
	if (this.Parent) {
		this.Parent.removeChild(this);
		this.Parent = oParent;
		this.DOMContainer = this.Parent.GetDOMContainer();
		this.DOMContainer.appendChild(this.Box);
		this.Parent.addChild(this);
	} else {
		this.DockParent = oParent;
		this.isDocked = true;
		//this.dockPos = 'lefttop';
		this.Parent = oParent;
		this.DOMContainer = this.Parent.GetDOMContainer();
		this.agent = this.Parent.agent;
		this.ImagesBasePath = this.Parent.ImagesBasePath;
		
		this.BackgroundColor = this.Parent.BackgroundColor;
		this.TitleBackgroundColor = this.Parent.BackgroundColor;
		this.BorderSize = 0;
		this.InnerBorderSize = this.Parent.BorderSize;
		this.BorderColor = this.Parent.BorderColor;
		this.BorderColorHigh = this.Parent.BorderColorHigh;
		this.BorderColorShadow = this.Parent.BorderColorShadow;
		this.BorderStyle = this.Parent.BorderStyle;

		this.Box = this.Application.getDIV();
		this.Box.style.backgroundColor = this.BackgroundColor;
		this.Box.style.top = (this.Parent.InnerRect['top']) + 'px';
		this.Box.style.left = (this.Parent.InnerRect['left']) + 'px';
		this.Box.style.width = (this.Parent.InnerRect['width']) + 'px';
		this.Box.style.height = (this.Parent.InnerRect['height']) + 'px';
		this.Box.style.overflow = 'hidden';
		this.drawBorder();
		this.DOMContainer.appendChild(this.Box);
	
		this.FontFamily = this.Parent.FontFamily;
		this.FontSize = this.Parent.FontSize;
		this.FontColor = this.Parent.FontColor;
		this.FontBold = this.Parent.FontBold;
		this.FontSmallCaps = this.Parent.FontSmallCaps;

		this.TitleBar = this.Application.getDIV();
		this.TitleBar.owner = this;
		this.TitleBar.style.width = (this.Parent.InnerRect['width']) + 'px';
		this.TitleBar.style.height = this.TBarH + 'px';
		this.TitleBar.style.backgroundColor = this.TitleBackgroundColor;
		this.TitleBar.style.display = 'block';
		this.TitleBar.style.padding = '1px';
		this.TitleBar.style.textAlign = 'center';
		this.TitleBar.style.varticalAlign = 'middle';
		if (this.TBarPos == 'bottom') this.TitleBar.style.top = (this.Parent.InnerRect['height'] - this.TBarH) + 'px';
		this.Box.appendChild(this.TitleBar);
		this.BtnClose = this.Application.getDIV();
		this.BtnClose.style.display = 'block';
		this.BtnClose.style.cursor = 'pointer';
		this.BtnClose.style.backgroundRepeat = 'no-repeat';
		this.BtnClose.style.backgroundImage = 'url(' + this.ImagesBasePath + 'blank.gif)';
		this.BtnClose.owner = this;
		this.Application.bindEvent(this.BtnClose, 'click', this, this.btnCloseHandler);
		this.TitleBar.appendChild(this.BtnClose);
	
		this.ClientBox = this.Application.getDIV();
		with (this.ClientBox.style) {
			backgroundColor = 'transparent';
			if (this.TBarPos == 'bottom') {
				top = '0px';
			} else {
				top = (this.TBarH + 4) + 'px';
			}
			left = '0px';
			width = (this.Parent.InnerRect['width']) + 'px';
			height = (this.Parent.InnerRect['height'] - this.TBarH - 1) + 'px';
			overflow = 'auto';
			display = 'block';
		}
		this.Box.appendChild(this.ClientBox);
	}
}


AX_FloatPanel.prototype.btnCloseHandler = function(){
	this.closePanel();
}

AX_FloatPanel.prototype.closePanel = function(bClose) {
	if (this.isOpen || bClose) {
		this.isOpen = false;
		this.ClientBox.style.display = 'none';
		this.TitleBar.style.top = '0px';
		this.Box.style.height = (this.TBarH + 2) + 'px';
		this.BtnClose.style.backgroundImage = 'url(' + this.ImgOpenSrc + ')';
		this.BtnClose.style.zIndex = this.TitleBar.style.zIndex + 1;
		
	} else {
		this.isOpen = true;
		this.ClientBox.style.display = 'block';
		if (this.TBarPos == 'bottom') this.TitleBar.style.top = (this.Height - this.TBarH) + 'px';
		this.Box.style.height = (this.Height) + 'px';
		this.BtnClose.style.backgroundImage = 'url(' + this.ImgCloseSrc + ')';
		this.BtnClose.style.zIndex = this.TitleBar.style.zIndex + 1;
	}
	if (this.onPanelClose) {
		this.onPanelClose();
	}
}

AX_FloatPanel.prototype.GetDOMContainer = function() {
	return this.ClientBox;
}

AX_FloatPanel.prototype.drawBorder = function(bForce) {
	if (this.TitleBar && this.TitleBackgroundImageSet == '') {
		this.TitleBar.style.border = '0px solid black';
		if (((this.InnerBorderSize == 1) && (this.BorderStyle.indexOf('set') > 0)) || bForce) {
			var lt = '1px solid ' + this.BorderColorHigh;
			var rb = '1px solid ' + this.BorderColorShadow;
			if (this.BorderStyle == 'inset') {
				lt = '1px solid ' + this.BorderColorShadow;
				rb = '1px solid ' + this.BorderColorHigh;
			}
			this.TitleBar.style.borderLeft = lt;
			this.TitleBar.style.borderTop = lt;
			this.TitleBar.style.borderRight = rb;
			this.TitleBar.style.borderBottom = rb;
		} else {
			this.TitleBar.style.border = this.InnerBorderSize + 'px ' + this.BorderStyle + ' ' + this.BorderColor;
			this.TitleBar.style.borderBottom = '1px solid ' + this.BorderColorShadow;
		}
	}
	if (this.ClientBox && this.BackgroundImageSet == '') {
		if (((this.InnerBorderSize == 1) && (this.BorderStyle.indexOf('set') > 0)) || bForce) {
			var lt = '1px solid ' + this.BorderColorHigh;
			var rb = '1px solid ' + this.BorderColorShadow;
			if (this.BorderStyle == 'inset') {
				lt = '1px solid ' + this.BorderColorShadow;
				rb = '1px solid ' + this.BorderColorHigh;
			}
			this.ClientBox.style.border = '0px solid black';
			this.ClientBox.style.borderLeft = lt;
			this.ClientBox.style.borderTop = lt;
			this.ClientBox.style.borderRight = rb;
			this.ClientBox.style.borderBottom = rb;
		} else {
			this.ClientBox.style.border = this.InnerBorderSize + 'px ' + this.BorderStyle + ' ' + this.BorderColor;
		}
	}
}

AX_FloatPanel.prototype.SetBackgroundColor = function(bgcol, bgcoltitlebar) {
	if (bgcol) {
		this.BackgroundColor = bgcol;
		this.Box.style.backgroundColor = this.BackgroundColor;
	}
	if (bgcoltitlebar) {
		this.TitleBackgroundColor = bgcoltitlebar;
		this.TitleBar.style.backgroundColor = this.TitleBackgroundColor;
	}
}

AX_FloatPanel.prototype.SetBackgroundImage = function(sUrl, sUrltitlebar) {
	if (sUrl) {
		this.BackgroundImage = this.ImagesBasePath + sUrl;
		this.Box.style.backgroundImage = 'url(' + this.BackgroundImage + ')';
	}
	if (sUrltitlebar) {
		this.TitleBackgroundImage = this.ImagesBasePath + sUrltitlebar;
		this.TitleBar.style.backgroundImage = 'url(' + this.TitleBackgroundImage + ')';
	}
}

AX_FloatPanel.prototype.SetBackgroundImageSet = function(sUrl, sPrefix, sUrltitlebar, sPrefixtitlebar) {
	if (sUrl) {
		this.BackgroundImageSet = sPrefix;
		this.BackgroundURL = sUrl;
		var w = this.Box.offsetWidth;
		var h = this.Box.offsetHeight;
		if (w > 0 && h > 0) {
			this.Box.style.backgroundImage = 'url(' + this.BackgroundURL + '?basedir=' + this.ImagesBasePath + '&basename=' + this.BackgroundImageSet + '&width=' + w + '&height=' + h + ')';
		}
	}
	if (sUrltitlebar) {
		this.TitleBackgroundImageSet = sPrefixtitlebar;
		this.TitleBackgroundURL = sUrltitlebar;
		var w = this.TitleBar.offsetWidth;
		var h = this.TitleBar.offsetHeight;
		if (w > 0 && h > 0) {
			this.TitleBar.style.backgroundImage = 'url(' + this.TitleBackgroundURL + '?basedir=' + this.ImagesBasePath + '&basename=' + this.TitleBackgroundImageSet + '&width=' + w + '&height=' + h + ')';
		}
	}
}

AX_FloatPanel.prototype.SetCloseIcon = function(sPos, imgClose, imgOpen, w, h){
	this.ImgCloseSrc = this.ImagesBasePath + imgClose;
	this.ImgOpenSrc = this.ImagesBasePath + imgOpen;
	if (!this.ImgClose) {
		this.ImgClose = new Image();
		this.ImgClose.src = this.ImgCloseSrc;
		this.ImgOpen = new Image();
		this.ImgOpen.src = this.ImgOpenSrc;
	}
	this.BtnClose.style.width = w + 'px';
	this.BtnClose.style.height = h + 'px';
	this.BtnClose.style.backgroundImage = 'url(' + this.ImgCloseSrc + ')';
	this.btnClosePos = sPos;
	switch (this.btnClosePos.substr(0, 4)) {
		case 'cent':
			this.BtnClose.style.left = ((this.Width - w) / 2) + 'px';
			break;
		case 'left':
			this.BtnClose.style.left = (this.InnerBorderSize + 2) + 'px';
			break;
		case 'righ':
			this.BtnClose.style.left = (this.Width - this.InnerBorderSize - w - 2) + 'px';
			break;
	}
	switch (this.btnClosePos.substr(this.btnClosePos.length - 3)) {
		case 'dle':
			this.BtnClose.style.top = ((this.TBarH - h) / 2) + 'px';
			break;
		case 'top':
			this.BtnClose.style.top = this.InnerBorderSize + 'px';
			break;
		case 'tom':
			this.BtnClose.style.top = (this.TBarH - this.InnerBorderSize - h) + 'px';
			break;
	}
}

AX_FloatPanel.prototype.SetDraggable = function(bDraggable, sIcon, w, h) {
	var divDrag = this.Application.getDIV();
	divDrag.style.backgroundImage = 'url(' + this.ImagesBasePath + sIcon + ')';
	divDrag.style.left = '1px';
	divDrag.style.top = '1px';
	divDrag.style.width = w + 'px';
	divDrag.style.height = this.TBarH + 'px';
	var iOffset = Math.floor((this.TBarH - h) / 2);
	if (iOffset < 0) iOffset = 0;
	divDrag.style.backgroundPosition = '0px ' + iOffset + 'px';
	divDrag.style.backgroundRepeat = 'no-repeat';
	divDrag.style.display = 'block';
	divDrag.style.padding = '1px';
	divDrag.style.textAlign = 'center';
	this.TitleBar.appendChild(divDrag);
	this.DragHandler = new AX_DragHandler(this, w, h);
}

AX_FloatPanel.prototype.resizeContentPanel = function() {
	if (this.TBarPos == 'bottom') {
		this.ClientBox.style.top = '0px';
	} else {
		this.ClientBox.style.top = (this.TBarH + 4) + 'px';
	}
	this.ClientBox.style.width = (this.Width - this.BorderSize * 2) + 'px';
	if (this.isOpen) this.ClientBox.style.height = (this.Height - this.BorderSize * 2 - this.TBarH - 4) + 'px';


  this.InnerRect['left'] = this.Padding;
  this.InnerRect['top'] = this.Padding;
  this.InnerRect['width'] = this.Width - this.BorderSize * 2 - this.Padding * 2 - this.BorderSize * 2;
  this.InnerRect['height'] = this.Height - this.BorderSize * 2 - this.TBarH - 4 - this.Padding * 2 - this.BorderSize * 2;
}



function AX_DragHandler(dragObject, w, h) {
	this.dragObject = dragObject;
	this.dragDOMObject = dragObject.Box;
	this.Application = this.dragObject.Application;
	this.Box = this.Application.getDIV();
	this.Box.owner = this;
	this.Width = w || 16;
	this.Height = h || 16;
	with (this.Box.style) {
		display = 'block';
		border = '0px solid red';
		cursor = 'move';
		backgroundImage = 'url(' + this.dragObject.ImagesBasePath + 'blank.gif)';
		top = '0px';
		left = '0px';
		width = this.Width + 'px';
		height = this.Height + 'px';
	}
	this.dragDOMObject.appendChild(this.Box);
	this.isDragging = false;

	this.Application.bindEvent(this.Box, 'mousedown', this, this.dragStartEvent);
	this.Application.bindEvent(this.Box, 'mousemove', this, this.dragEvent);
	this.Application.bindEvent(this.Box, 'mouseup', this, this.dragEndEvent);
	this.Application.bindEvent(this.Box, 'mouseout', this, this.dragEndEvent);
}

AX_DragHandler.prototype.dragStartEvent = function(obj, ev, offsetX, offsetY, clientX, clientY) {
	var dragObject = this.dragObject;
	var dragDOMObject = this.dragDOMObject;
	var rootPos = this.Application.RootPanel.getAbsolutePosition();
	var absPos = dragObject.getAbsolutePosition();
	dragOriginalX = absPos[0] - rootPos[0];
	dragOriginalY = absPos[1] - rootPos[1];
	var rootBox = this.Application.RootPanel.Box;
	rootBox.appendChild(this.Box);
	with (this.Box.style) {
		display = 'block';
		zIndex = 100;
		left = '0px';
		top = '0px';
		width = (rootBox.offsetWidth - 24) + 'px';
		height = (rootBox.offsetHeight - 20) + 'px';
	}
	this.deltaX = offsetX;
	this.deltaY = offsetY;
	this.scrollX = dragOriginalX + offsetX - clientX;
	this.scrollY = dragOriginalY + offsetY - clientY;
	this.isDragging = true;
	if (dragObject.isDocked) {
		dragObject.isDocked = false;
		dragDOMObject.style.display = 'none';
		dragObject.setParent(this.Application.RootPanel);
		dragDOMObject.style.left = (dragOriginalX) + 'px';
		dragDOMObject.style.top = (dragOriginalY) + 'px';
		dragDOMObject.style.zIndex = 90;
		dragDOMObject.style.display = 'block';
		dragObject.drawBorder(true);
		dragObject.DockParent.undock(dragObject);
	} 
}

AX_DragHandler.prototype.dragEvent = function(obj, ev, offsetX, offsetY, clientX, clientY) {
	if (this.isDragging) {
		var dragObject = this.dragObject;
		var dragDOMObject = this.dragDOMObject;
		dragObject.Left = clientX - this.deltaX + this.scrollX;
		dragObject.Top = clientY - this.deltaY + this.scrollY;
		dragDOMObject.style.top = (dragObject.Top) + 'px';
		dragDOMObject.style.left = (dragObject.Left) + 'px';
	}
}

AX_DragHandler.prototype.dragEndEvent = function(obj, ev, offsetX, offsetY, clientX, clientY) {
	if (this.isDragging) {
		this.isDragging = false;
		this.deltaX = 0;
		this.deltaY = 0;
		this.scrollX = 0;
		this.scrollY = 0;
		with (this.Box.style) {
			top = '0px';
			left = '0px';
			width = this.Width + 'px';
			height = this.Height + 'px';
		}
		this.dragDOMObject.appendChild(this.Box);
		var dragObject = this.dragObject;
		var parentpos = dragObject.DockParent.getAbsoluteClientPosition();
		var newpos = dragObject.getAbsolutePosition();
		if ((Math.abs(parentpos[0] - newpos[0]) < 20) && (Math.abs(parentpos[1] - newpos[1]) < 20)) {
			dragObject.isDocked = true;
			dragObject.dockPos = 'lefttop';
			dragObject.setParent(dragObject.DockParent);
			dragObject.SetSize(0, 0);
			dragObject.drawBorder();
			dragObject.DockParent.dock(dragObject);
		} else if ((Math.abs(parentpos[2] - newpos[2] - newpos[0]) < 20) && (Math.abs(parentpos[1] - newpos[1]) < 20)) {
			dragObject.isDocked = true;
			dragObject.dockPos = 'righttop';
			dragObject.setParent(dragObject.DockParent);
			dragObject.SetSize(0, 0);
			dragObject.drawBorder();
			dragObject.DockParent.dock(dragObject);
		} else if ((Math.abs(parentpos[0] - newpos[0]) < 20) && (Math.abs(parentpos[3] + parentpos[1] - newpos[3] - newpos[1]) < 20)) {
			dragObject.isDocked = true;
			dragObject.dockPos = 'leftbottom';
			dragObject.setParent(dragObject.DockParent);
			dragObject.SetSize(0, 0);
			dragObject.drawBorder();
			dragObject.DockParent.dock(dragObject);
		} else if ((Math.abs(parentpos[2] - newpos[2] - newpos[0]) < 20) && (Math.abs(parentpos[3] + parentpos[1] - newpos[3] - newpos[1]) < 20)) {
			dragObject.isDocked = true;
			dragObject.dockPos = 'rightbottom';
			dragObject.setParent(dragObject.DockParent);
			dragObject.SetSize(0, 0);
			dragObject.drawBorder();
			dragObject.DockParent.dock(dragObject);
		}
	}
}



//========================================================
function AX_Header(oCell) {
	this.Padding = 0;
	this.BackgroundColor = 'transparent';
	this.FontFamily = 'Tahoma, Verdana, Arial, sans-serif';
	this.FontSize = 8;
	this.FontColor = '#000000';
	this.FontBold = false;
	this.TextAlign = 'center';
	this.VerticalAlign = 'middle';
	this.BorderSize = 0;
	this.BorderColor = '#000000';
	this.BorderStyle = 'solid';
	this.Box = oCell;
	this.ImagesBasePath = '';
	this.Box.style.padding = '0px';
	this.Box.style.border = '0px solid white';
}

AX_Header.prototype.SetBanner = function(sUrl, strPosizione) {
	var sPos = strPosizione || 'left';
	switch (sPos) {
		case 'left':
			this.SetTextAlign('left', 'middle');
			this.Box.innerHTML = '<img src=\"' + this.ImagesBasePath + sUrl + '\">';
			break;
		case 'right':
			this.SetTextAlign('right', 'middle');
			this.Box.innerHTML = '<img src=\"' + this.ImagesBasePath + sUrl + '\">';
			break;
		case 'center':
			this.SetTextAlign('center', 'middle');
			this.Box.innerHTML = '<img src=\"' + this.ImagesBasePath + sUrl + '\">';
			break;
		case 'repeat':
			this.SetBackground(null, sUrl, true);
			break;
	}
}

AX_Header.prototype.SetHTMLContent = function(sText) {
	this.Box.innerHTML = sText;
}

AX_Header.prototype.SetBackground = function(bgcol, bgUrl, bRepeat) {
	if (bgcol) {
		this.BackgroundColor = bgcol;
		this.Box.style.backgroundColor = this.BackgroundColor;
	}
	if (bgUrl) {
		this.BackgroundImage = this.ImagesBasePath + bgUrl;
		if (!bRepeat) this.Box.style.backgroundRepeat = 'no-repeat';
		this.Box.style.backgroundImage = 'url(' + this.BackgroundImage + ')';
	}
}

AX_Header.prototype.SetFont = function(sFont, iFontSize, bBold, sFontCol) {
	this.FontFamily = sFont;
	this.Box.style.fontFamily = sFont;
	if (iFontSize) {
		this.FontSize = iFontSize;
		this.Box.style.fontSize = iFontSize + 'pt';
	}
	if (bBold) {
		this.FontBold = bBold;
		this.Box.style.fontWeight = (bBold ? 'bold' : 'normal');
	}
	if (sFontCol) {
		this.FontColor = sFontCol;
		this.Box.style.color = sFontCol;
	}
}

AX_Header.prototype.SetBorder = function(iSize, sStyle, sColor) {
	if (iSize) {
		this.BorderSize = iSize;
	}
	if (sStyle) {
		this.BorderStyle = sStyle;
	}
	if (sColor) {
		this.BorderColor = sColor;
	}
	this.Box.style.border = this.BorderSize + 'px ' + this.BorderStyle + ' ' +  this.BorderColor;
}

AX_Header.prototype.SetFontFamily = function(sFont) {
	this.FontFamily = sFont;
	this.Box.style.fontFamily = sFont;
}
AX_Header.prototype.SetFontColor = function(sFontCol) {
	this.FontColor = sFontCol;
	this.Box.style.color = sFontCol;
}
AX_Header.prototype.SetFontBold = function(bBold) {
	this.FontBold = bBold;
	this.Box.style.fontWeight = (bBold ? 'bold' : 'normal');
}
AX_Header.prototype.SetFontSize = function(iFontSize) {
	this.FontSize = iFontSize;
	this.Box.style.fontSize = iFontSize + 'pt';
}

AX_Header.prototype.SetTextAlign = function(sAlign, sValign) {
	if (sAlign) {
		this.TextAlign = sAlign;
	}
	if (sValign) {
		this.VerticalAlign = sValign;
	}
	this.Box.style.textAlign = this.TextAlign;
	this.Box.style.verticalAlign = this.VerticalAlign;
}

//========================================================

function AX_MultiPanel() {
	this.base = AX_Panel;
	this.base();

	this.Headers = new Array();
	this.HeadersHeight = 0;
	this.Footers = new Array();
	this.FootersHeight = 0;
	
	this.OuterPadding = 2;
	this.InnerBackgroundColor = '#F0F0F0';
	this.InnerBorderSize = 1;
	this.InnerBorderColor = this.BorderColor;
	this.InnerBorderColorHigh = this.BorderColorHigh;
	this.InnerBorderColorShadow = this.BorderColorShadow;
	this.InnerBorderStyle = 'inset';
	this.InnerBox = null;
}
AX_MultiPanel.prototype = new AX_Panel;

AX_MultiPanel.prototype.SetLayout = function(iPadding, iBorderSize, sBorderStyle, colBorderColor, colBorderColor2, iOuterPadding, iInnerBorderSize, sInnerBorderStyle, colInnerBorderColor, colInnerBorderColor2) {
	if (iPadding !== false) this.Padding = iPadding;
	if (iOuterPadding !== false) this.OuterPadding = iOuterPadding;
	this.SetBorder(iBorderSize, sBorderStyle, colBorderColor, colBorderColor2);
	this.SetInnerBorder(iInnerBorderSize, sInnerBorderStyle, colInnerBorderColor, colInnerBorderColor2);
	this.resize(true);
}


AX_MultiPanel.prototype.AddBand = function(sType, sName, sColBG, iSize) {
	var ret = null;
	switch (sType) {
	case 'header':
		if (this.Headers.length == 0) {
			newBand = this.table.tBodies[0].rows[0].cells[0];
		} else {
			var row = document.createElement('TR');
			var newBand = this.Application.getTD();
			row.appendChild(newBand);
			this.table.tBodies[0].insertBefore(row, this.InnerBox);
		}
		newBand.style.position = 'absolute';
		newBand.style.height = (iSize ? iSize + 'px' : '24px');
		ret = new AX_Header(newBand);
		ret.ImagesBasePath = this.ImagesBasePath;
		this.Headers.push(ret);
		this.HeadersHeight = 0;
		for (var i = 0; i < this.Headers.length; i++) {
			this.HeadersHeight += this.Headers[i].Box.offsetHeight;
		}
		break;
	case 'footer':
		if (this.Footers.length == 0) {
			newBand = this.table.tBodies[0].rows[this.table.tBodies[0].rows.length - 1].cells[0];
		} else {
			var row = document.createElement('TR');
			var newBand = this.Application.getTD();
			row.appendChild(newBand);
			this.table.tBodies[0].appendChild(row);
		}
		newBand.style.height = (iSize ? iSize + 'px' : '24px');
		ret = new AX_Header(newBand);
		ret.ImagesBasePath = this.ImagesBasePath;
		this.Footers.push(ret);
		this.FootersHeight = 0;
		for (var i = 0; i < this.Footers.length; i++) {
			this.FootersHeight += this.Footers[i].Box.offsetHeight;
		}
		break;
	}
	this.resize();
	return ret;
}

AX_MultiPanel.prototype.setParent = function(oParent){
	this.Parent = oParent;
	this.DOMContainer = this.Parent.GetDOMContainer();
	this.BackgroundColor = this.Parent.BackgroundColor;
	this.BorderSize = this.Parent.BorderSize;
	this.BorderColor = this.Parent.BorderColor;
	this.BorderColorHigh = this.Parent.BorderColorHigh;
	this.BorderColorShadow = this.Parent.BorderColorShadow;
	this.BorderStyle = this.Parent.BorderStyle;
	
	this.FontFamily = this.Parent.FontFamily;
	this.FontSize = this.Parent.FontSize;
	this.FontColor = this.Parent.FontColor;
	this.FontBold = this.Parent.FontBold;
	this.FontSmallCaps = this.Parent.FontSmallCaps;
	
	this.agent = this.Parent.agent;
	this.ImagesBasePath = this.Parent.ImagesBasePath;
	
	this.Box = this.Application.getDIV();
	with (this.Box.style) {
		backgroundColor = this.BackgroundColor;
		top = (this.Parent.Padding) + 'px';
		left = (this.Parent.Padding) + 'px';
		width = (this.Width - this.BorderSize * 2) + 'px';
		height = (this.Height - this.BorderSize * 2) + 'px';
		overflow = 'hidden';
	}
	this.drawBorder();
	this.DOMContainer.appendChild(this.Box);

	var sTable = '<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">';
	sTable += '<tr><td></td></tr>';
	sTable += '<tr><td></td></tr>';
	sTable += '<tr><td></td></tr>';
	sTable += '</table>';
	this.Box.innerHTML = sTable;
	this.table = this.Box.getElementsByTagName('TABLE')[0];
	with (this.table.style) {
		position = 'absolute';
		backgroundColor = 'transparent';
		top = '0px';
		left = '0px';
		width = '100%';
		height = '100%';
		textAlign = 'left';
		verticalAlign = 'top';
	}
	this.table.tBodies[0].rows[0].style.position = 'absolute';
	this.table.tBodies[0].rows[1].style.position = 'absolute';
	this.table.tBodies[0].rows[2].style.position = 'absolute';
	
	this.InnerBackgroundColor = 'transparent';
	this.InnerBorderSize = 0;
	this.InnerBorderColor = this.BorderColor;
	this.InnerBorderColorHigh = this.BorderColorHigh;
	this.InnerBorderColorShadow = this.BorderColorShadow;
	this.InnerBorderStyle = 'inset';

	with (this.table.tBodies[0].rows[0].cells[0].style) {
		position = 'absolute';
		padding = '0px';
		border = '0px';
		margin = '0px';
	}
	with (this.table.tBodies[0].rows[2].cells[0].style) {
		position = 'absolute';
		padding = '0px';
		border = '0px';
		margin = '0px';
	}

	this.InnerBox = this.table.tBodies[0].rows[1].cells[0];
	with (this.InnerBox.style) {
		position = 'absolute';
		padding = '0px';
		border = '0px';
		margin = '0px';
		backgroundColor = this.InnerBackgroundColor;
		width = '100%';
		height = '100%';
		overflow = 'hidden';
	}
	this.drawInnerBorder();
}

AX_MultiPanel.prototype.drawInnerBorder = function() {
	if ((this.InnerBorderSize == 1) && (this.InnerBorderStyle.indexOf('set') > 0)) {
		var lt = '1px solid ' + this.InnerBorderColorHigh;
		var rb = '1px solid ' + this.InnerBorderColorShadow;
		if (this.InnerBorderStyle == 'inset') {
			lt = '1px solid ' + this.InnerBorderColorShadow;
			rb = '1px solid ' + this.InnerBorderColorHigh;
		}
		with (this.InnerBox.style) {
			border = '0px solid black';
			borderLeft = lt;
			borderTop = lt;
			borderRight = rb;
			borderBottom = rb;
		}
	} else {
		this.InnerBox.style.border = this.InnerBorderSize + 'px ' + this.InnerBorderStyle + ' ' + this.InnerBorderColor;
	}
}

AX_MultiPanel.prototype.SetInnerBorder = function(iBorderSize, sBorderStyle, colBorderColor, colBorderColor2) {
	if (iBorderSize !== false) this.InnerBorderSize = iBorderSize;
	if (sBorderStyle !== false) this.InnerBorderStyle = sBorderStyle;
	if (colBorderColor !== false) this.InnerBorderColor = colBorderColor;
	if (colBorderColor !== false) this.InnerBorderColorHigh = colBorderColor;
	if (colBorderColor2 !== false) this.InnerBorderColorShadow = colBorderColor2;
	this.drawInnerBorder();
}

AX_MultiPanel.prototype.SetBackgroundColors = function(bgcolext, bgcolint) {
	this.BackgroundColor = bgcolext;
	this.Box.style.backgroundColor = this.BackgroundColor;
	this.InnerBackgroundColor = bgcolint;
	this.InnerBox.style.backgroundColor = this.InnerBackgroundColor;
}


AX_MultiPanel.prototype.resizeContentPanel = function() {
	var l = this.OuterPadding;
	var t = this.OuterPadding;
	var w = this.Width - this.OuterPadding * 2 - this.BorderSize * 2 - this.InnerBorderSize * 2;
	this.HeadersHeight = 0;
	for (var i = 0; i < this.Headers.length; i++) {
		with (this.Headers[i].Box.style) {
			top = (this.HeadersHeight + this.OuterPadding) + 'px';
			left = l + 'px';
			width = w + 'px';
		}
		this.HeadersHeight += this.Headers[i].Box.offsetHeight;
	}
	this.FootersHeight = 0;
	for (var i = this.Footers.length - 1; i > -1; i--) {
		this.FootersHeight += this.Footers[i].Box.offsetHeight;
		with (this.FootersHeight[i].Box.style) {
			top = (this.Height - this.OuterPadding - this.FootersHeight) + 'px';
			left = l + 'px';
			width = w + 'px';
		}
		
	}
	with (this.InnerBox.style) {
		top = (this.HeadersHeight + this.OuterPadding) + 'px';
		left = l + 'px';
		width = w + 'px';
		height = (this.Height - this.HeadersHeight - this.FootersHeight - this.OuterPadding * 2) + 'px';
	}
  this.InnerRect['left'] = this.Padding;
  this.InnerRect['top'] = this.Padding;
  this.InnerRect['width'] = this.InnerBox.offsetWidth - this.Padding * 2 - this.InnerBorderSize * 2 - this.BorderSize * 2;
  this.InnerRect['height'] = this.InnerBox.offsetHeight - this.Padding * 2 - this.InnerBorderSize * 2 - this.BorderSize * 2;
}

