/*
	xMenu3_1.js
	Cross-Browser.com
*/

var pg = null;

function winOnResize() {
 if (pg) pg.paint();
}

function xPage() {
 this.paint = function() {
  window.scrollTo(0, 0);

  // Set widths
  xResizeTo(this.m1.ele, xClientWidth() - 225, this.m1H);
  xResizeTo(this.m2.ele, this.m2W, this.m2H);

  // set positions
  xMoveTo(this.m1.ele, 225, 125); 
  xMoveTo(this.m2.ele, 40, 120);

  // Show everything
  xShow(this.m1.ele);
  xShow(this.m2.ele);

  this.m1Left = xPageX(this.m1.ele) - xScrollLeft();
  this.m1Top = xPageY(this.m1.ele) - xScrollTop();
  this.m2Left = xPageX(this.m2.ele) - xScrollLeft();
  this.m2Top = xPageY(this.m2.ele) - xScrollTop();

  this.m1.paint();
  this.m2.paint();
 }

 // adjustable page parameters
 this.m1H = 30;
 this.m2W = 120;
 this.m2H = 300;

 // Create top menu
 this.m1 = new xMenu('xMenuTop',
  'horizontal', 5, -10,
  -12, -16, -20, -4,
  -32, -8, -10, -2,
  'myHMBarLbl', 'myHMBarLblHvr', 'myHMBarLblHvrClosed',
  'myMLbl', 'myMLblHvr',
  'myHMBar', 'myMBox');

 // Create left menu
 this.m2 = new xMenu('xMenuLeft',
  'vertical', 4, -5,
  -12, -4, -20, -12,
  -32, null, null, null,
  'myVMBarLbl', 'myVMBarLblHvr', 'myVMBarLblHvrClosed',
  'myMLbl', 'myMLblHvr',
  'myVMBar', 'myMBox');

 this.m1.load();
 this.m2.load();

 xZIndex(this.m1.ele, 1010);
 xZIndex(this.m2.ele, 100);

 // Listen to resize and scroll events
// xAddEventListener(window, 'resize', winOnResize);
// xAddEventListener(window, 'scroll', winOnScroll);
}

pg = new xPage();

window.onload = function() {
 if (pg) {
  pg.paint();
 }
}

