//global variables 

	var viewportWidth;
	var viewportHeight;
	var mainAreaHeight;
	var mainAreaWidth;
	var header1Height;
	var header2Height;
	var footerContainerHeight;
	var navlist3Width;
	var navlist3Height;
	var pageContainerWidth;
	var pageContainerHeight;
	var pageContainerLeft;
	var smallLogoWidth;
	var mainArea_obj;
	var header1_obj;
	var header2_obj;
	var navlist3_obj;
	var smallLogo_obj;
	var pageContainer_obj;
	var smallLogoMinWidth = 196;
	var browsergroup;
	
function calculatemainAreaDims ()
{
	debug("entering cmadims");
//There are a number of things to do:
//For a home page, set the footer container height to 30px; otherwise, 15px
//A home page is one whose name ends in "home", "home page", "home more" or "home - more"
	footerContainerHeight = document.title.match(/home( (page|( - )?more))?$/) ? 30 : 15;
//set footer container height in DOM
	document.getElementById("footer_container").style.height = footerContainerHeight + "px";
//we have the footer container height, now calculate the dimensions of the other elements
//that must be repositioned
//First header1
//check if header1 is present
	header1_obj = document.getElementById("header1");
	if(header1_obj === null)
//if header1 is not present, set its height to zero
	{
	header1Height = 0;
	}
	else
//otherwise get the current height in the DOM - header1_Height
{
//for IE and Opera, use currentStyle
	if (document.documentElement.currentStyle)
	{
	header1_Height = header1_obj.currentStyle.height;
	}
//for Firefox, use getComputedStyle
	else if (window.getComputedStyle)
	{
	header1_Height = window.getComputedStyle(header1_obj,null).height;
	}
	//now remove "px" from the header1 height style-string,
	header1Height = parseInt(header1_Height, 10);
}
//Next header2
//check if header2 is present
	header2_obj = document.getElementById("header2");
	if(header2_obj === null)
//if header2 is not present, set its height and border widths to zero pixels
	{	
	header2Height = 0;
	header2borderBottomWidth = 0;
	header2borderTopWidth = 0;
	}
	else
//otherwise get the current height
	{
//for IE and Opera, use currentStyle
	if (document.documentElement.currentStyle)
	{
	header2_Height = header2_obj.currentStyle.height;
	header2_borderBottomWidth = header2_obj.currentStyle.borderBottomWidth;
	header2_borderTopWidth = header2_obj.currentStyle.borderTopWidth;
	}
//for Firefox, use getComputedStyle
	else if (window.getComputedStyle)
	{
	header2_Height = window.getComputedStyle(header2_obj,null).height;
	header2_borderBottomWidth = window.getComputedStyle(header2_obj,null).borderBottomWidth;
	header2_borderTopWidth = window.getComputedStyle(header2_obj,null).borderTopWidth;
	}
//now remove "px" from the header2-height, -width,
//& -border style-strings (TopWidth & BottomWidth )
	header2Height = parseInt(header2_Height, 10);
	header2borderBottomWidth = parseInt(header2_borderBottomWidth, 10);
	header2borderTopWidth = parseInt(header2_borderTopWidth, 10);
	}
//we have obtained, or set from the style sheet, the current style-height for footer container,
//and/or the border-width (top and bottom) for header1 and header2 if these elements
//are present in the page.  These values must be subtracted from
//the mainarea height to ensure that everything fits together
//
//ensure that the values of viewportHeight and viewportWidth are non-zero

	if(viewportHeight <= 0)
		{
		viewportHeight = 200;
		}
	if(viewportWidth <= 0)
		{
		viewportWidth = 200;
		}
//calculate the new dimensions for the main area
	mainAreaHeight = viewportHeight - header1Height - header2Height - footerContainerHeight - header2borderBottomWidth - header2borderTopWidth;
	mainAreaWidth = viewportWidth;
//To avoid browser problems (with IE), check if either main area dimension is 0 or less,
//if so set it equal to 200
	if (mainAreaHeight <= 0)
	{	
	mainAreaHeight = 200;
	debug("main area height less than 0 ");
	}
	if (mainAreaWidth <= 0)
	{	
	mainAreaWidth = 200;
	debug("main area width less than 0");
	}
	debug("leaving cmadims");
}