function adjustLayout()
{
  // Get natural heights
  var cHeight = xHeight("content");
  var lHeight = xHeight("left");  
    
  // Find the maximum height
  var maxHeight = Math.max(cHeight, lHeight);
  
  // Assign maximum height to all columns  
  xHeight("content", maxHeight);
  xHeight("left", maxHeight);
  
  var AvailableHeight = xClientHeight();
  var TopHeight       = xHeight("top");
  var Usedheight      = maxHeight + TopHeight;
  
  if (AvailableHeight > Usedheight)
  {
  	h = AvailableHeight - TopHeight;
  	xHeight("left", h);
  }
}

function loadlistener()
{
  xAddEventListener(window, "resize", adjustLayout, false);
  adjustLayout();  
}

// function for changing stylesheets using
// document.getElementsByTagName("link")
function setLinkedStyleSheet(title) {
  var linkNodes = document.getElementsByTagName("link");
  for ( i = 0; i < linkNodes.length; i++ ) {
    linkNode = linkNodes[i];
    relAttr = linkNode.getAttribute('rel');
    if ( relAttr && ( relAttr.indexOf("style") != -1 ) && linkNode.getAttribute("title") ) {
      linkNode.disabled = true;
      if ( linkNode.getAttribute("title") == title )
        linkNode.disabled = false;
    }
  }
}

// function for changing stylesheets using document.styleSheets
function setStyleSheet(theme) {
  for ( i = 0; i < document.styleSheets.length; i++ ) {
    if ( document.styleSheets[i].title ) {
      document.styleSheets[i].disabled = true;
      if ( document.styleSheets[i].title == theme )
        document.styleSheets[i].disabled = false;
    }
  }
}
