<!--
//////// Use for setting the content area height to 100% //////// 

// global variable used in the functions below to represent the height required by the content
// in NS7 scrollHeight = height of vertical scrollbar even if scrollbar is not visible (bad when content height < client height)
var scrollHgt;
var scrollWidth;

// called by page onload event
function setScrollHeight()
{
	scrollHgt = document.body.scrollHeight;
} 

// called by page onload & onresize events
function resizeMain()
{
	var clientHgt = document.body.clientHeight;
	// note: scrollHgt is set in onload event (don't reset in onresize event)
	var baseHeight = (scrollHgt <= clientHgt ? clientHgt:scrollHgt);
	var divPageContainer = document.getElementById("page_container");
	var divPage = document.getElementById("page");
	
	if(divPageContainer) divPageContainer.style.height = baseHeight;
	if(divPage) divPage.style.height = baseHeight;
	
	setBackground();
}

////////  use for setting background image position in the center of the window //////// 
function setBackground()
{
	var pagecontainerDiv = document.getElementById("page_container");
	if(pagecontainerDiv)
	{
		var pagecontainerDivXpos = getXPos(pagecontainerDiv);
		var clientWidth = document.body.clientWidth;
		//display bg image in center of screen so that pagecontainerDiv has shadow on left & right sides
		// (1000px bg img width - 792px page container width) / 2 = 104px
		var bgposition = pagecontainerDivXpos - 104;
		document.body.style.backgroundImage = "url(/images/bg_page.jpg)";
		document.body.style.backgroundPosition = bgposition + "px 0px";
		document.body.style.backgroundRepeat = "repeat-y";
	}
}

function getXPos(obj)
{
	var curX = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curX += obj.offsetLeft;
			obj = obj.offsetParent;
		}
	}
	else if (obj.x) curX += obj.x;
	return curX;
}


//-->