// xSplitter Application

var s1, s12;

/*
  Note:
  Calling xAddEventListener before window.onload means that you must include
  the xAddEventListener source code "before" this application code.
*/

xAddEventListener(window, 'load', win_onload, false);

function win_onload()
{
  var cw = xClientWidth();
  var w = .99 * cw;
	var ch = xClientHeight();
  var h = .87 * ch;
                   // sSplId,         X, Y, W, H, Horz , BarW, BarPos, BarLim1, BarLim2, BarEn, BorW, oSplChild1, oSplChild2
  s12 = new xSplitter('idSplitter12', 0, 0, 0, 0, false, 5,    2*h/5,  h/5,     h/5,     true,  0);
  s1 = new xSplitter('idSplitter1'  , 0, 0, w, h, true , 5,    w/4,     10,     200,     true,  5,    null,       s12);

	var idContainer = document.getElementById('idContainer');
	idContainer.style.height = Math.floor(h) + "px";
  xAddEventListener(window, 'resize', win_onresize, false);
};

function win_onresize()
{
  var cw = xClientWidth();
  var w = .99 * cw;
	var ch = xClientHeight();
  var h = .87 * ch;
  s1.paint(w, h, w/4);
	var idContainer = document.getElementById('idContainer');
	idContainer.style.height = Math.floor(h) + "px";
}
