// xSplitter Application

var s7, s71, s72, s4, s41;

/*
  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 = .98 * cw;
  var h = xClientHeight() - 120; //300;
                   // sSplId,         X, Y, W, H, Horz , BarW, BarPos, BarLim1, BarLim2, BarEn, BorW, oSplChild1, oSplChild2
  //s41 = new xSplitter('idSplitter41', 0, 0, 0, 0, false, 5,    3*h/4,  h/10,     h/10,     true,  0);
  //s4 = new xSplitter('idSplitter4'  , 0, 0, w, h, true , 5,      w/7,  w/10,     20,     true,  1, s41);
  
  //s12 = new xSplitter('idSplitter12', 0, 0, 0, 0, false, 5,    3*h/4,  h/2,     h/2,     true,  0);
  //s11 = new xSplitter('idSplitter11', 0, 0, 0, 0, false, 5,    3*h/4,  h/10,     h/10,     true,  0);
  //s1 = new xSplitter('idSplitter1'  , 0, 0, w, h, true , 5,      w/7,  w/10,     20,     true,  1, s11);
//  s1 = new xSplitter('idSplitter1'  , 0, 0, w, h, true , 8,    w/2,    200,      20,     true,  3);

//  s2 = new xSplitter('idSplitter2'  , 0, 0, w, h, false, 8,    h/2,    100,      40,     true,  2);

//  s32 = new xSplitter('idSplitter32', 0, 0, 0, 0, false, 8,    3*h/4,  h/5,     h/5,     true,  0);
//  s3 = new xSplitter('idSplitter3'  , 0, 0, w, h, true , 8,    w/4,     10,     200,     true,  8, null, s32);

//  s41 = new xSplitter('idSplitter41', 0, 0, 0, 0, false, 8,    3*h/4,  h/5,     h/5,     true,  0);
//  s4 = new xSplitter('idSplitter4'  , 0, 0, w, h, true , 8,    3*w/4,  w/5,     w/5,     true,  1, s41);

//  s51 = new xSplitter('idSplitter51', 0, 0, 0, 0, true , 8,    2*w/3,  w/5,     w/5,     true,  0);
//  s5 = new xSplitter('idSplitter5'  , 0, 0, w, h, false, 8,    h/2,    h/5,     h/5,     true,  2, s51);

//  s62 = new xSplitter('idSplitter62', 0, 0, 0, 0, true , 8,    w/3,    w/5,     w/5,     true,  0);
//  s6 = new xSplitter('idSplitter6'  , 0, 0, w, h, false, 8,    h/3,    h/5,     h/5,     true,  2, null, s62);

  s71 = new xSplitter('idSplitter71', 0, 0, 0, 0, false, 5,    3*h/6,  h/5,     h/5,     true,  0);
  s72 = new xSplitter('idSplitter72', 0, 0, 0, 0, true,  5,    (w/2)+ 190,    w/20,     50,     true,  0);
  s7 = new xSplitter('idSplitter7'  , 0, 0, w, h, true,  5,    w/7,    w/20,     50,     true,  0, s71, s72);
 
  xAddEventListener(window, 'resize', win_onresize, false);
};

function win_onresize()
{
  var cw = xClientWidth();
  var w = .98 * cw;
  //var h = .8 * xClientHeight();
  var h = xClientHeight() - 120; //300;
  //s1.paint(w, h, w/2);
  //s2.paint(w, h, h/2);
  //s3.paint(w, h, w/4);
  //s4.paint(w, h, 3*w/4, w/5, w/5);
  //s5.paint(w, h, h/2, h/5, h/5);
  //s6.paint(w, h, h/3, h/5, h/5);
  s7.paint(w, h, w/7, w/20, 50);
  //s7.paint(w, h, w/2);
}
