/******************************************************************************
* function adjustDivWidths()
* This function checks the width of the menu. If there is no menu, or the width
* exceeds a maximum, it corrects the width to the desired value
******************************************************************************/
function adjustDivWidths()
{
  var leftMenuTable = null;
  var leftMenuWidth = null;
  var divContentSideTwoColumn = null;
  var divContentMainTwoColumn = null;
  var newLeftWidth = 0;
  var newRightWidth = 0;
  
  var shortMenu = 10;
  var normalMenu = 115;
  var longMenu = 179;
  
  //Get the leftmenutable
  leftMenuTable = document.getElementById('ctl00_ContentPlaceHolder1_LeftMenu_Menu1');
  
  //Get the divs
  divContentSideTwoColumn = document.getElementById('content-side-two-column');
  divContentMainTwoColumn = document.getElementById('content-main-two-column');
  
  //not null?
  if (leftMenuTable != null)
  {
    //Get the width
    leftMenuWidth = leftMenuTable.offsetParent.offsetWidth;
    
    //Does the width exceed the normal amount?
    if (leftMenuWidth > 150)
    { 
      //Are both div's there?
      if ((divContentSideTwoColumn != null) && (divContentMainTwoColumn != null))
      {
        //Calculate the new widths of the divs
        newLeftWidth = leftMenuWidth;
        newRightWidth = divContentMainTwoColumn.offsetWidth - 81;
      
        //When the browser is Firefox, don't adjust
        if(navigator.userAgent.indexOf("Firefox")==-1){
          //Adjust the width of the divs
          divContentSideTwoColumn.style.width = newLeftWidth + 'px';
          divContentMainTwoColumn.style.width = newRightWidth + 'px';  
        }       
      }
    }      
  }
  else
  {
    //Are both div's there?
    if ((divContentSideTwoColumn != null) && (divContentMainTwoColumn != null))
    {
      //The left table element is null, so there is no menu.
      //Therefore, adjust the width to a minimum    
      divContentSideTwoColumn.style.width = 5 + 'px';
      divContentMainTwoColumn.style.width = 695 + 'px';
    }
  }  
}
