// ----------------------------------------------------------------------------    
function onPageLoad()
{
    onPageLoadGlobal();
    var strQueryString = document.location.search;
    if(strQueryString.toLowerCase().indexOf("if_language")<0) {
	    if(strQueryString.indexOf("?")<0) {
			document.location = document.location + "?IF_Language=fra";
		}
		else {
			document.location = document.location + "&IF_Language=fra";
		}	
	}
   
   	var objMapError = document.getElementById("NM_NavMapError");
	if (objMapError != null) {
		objMapError.value = "";
	}	
	onMapResize();
}

// ----------------------------------------------------------------------------    
function onMapResize()
{
	// Determine the size of the window (leave a little extra space or browser
	// scroll bars may appear. Body style overflow: hidden is strongly recommended).
	var clientX;
	var clientY;
	if (window.innerWidth == undefined) {
		// IE
		clientX = document.body.clientWidth;
		clientY = document.body.clientHeight - 20;  // We need -20 because without it the footer goes off the bottom of the client window sometimes.
													// IE renders the table view in quirks mode, which may be why -20 is needed for IE and not for other browsers.
	}
	else {
		// NN
		clientX = window.innerWidth;
		clientY = window.innerHeight;
	}
	if (clientX > document.body.offsetWidth) {
		clientX = document.body.offsetWidth;
	}

	var spanTable = document.getElementById("SpanTable");
	// Get the amount of space left over beyond the main table.
	var offsetWidth = GetOffSet(spanTable, OFFSET_LEFT) + getRHSWidth() + GetRightPadding(spanTable);
	var mapWidth = clientX - offsetWidth;

	if (mapWidth > 0) {
		spanTable.style.width = (mapWidth) + "px";
	}
	else {
		spanTable.style.width = "auto";
	}

	var spanTableTop = GetOffSet(spanTable, OFFSET_TOP);
	var offsetHeight = spanTableTop + getBottomHeight() + GetBottomPadding(spanTable);


	var availableClientHeight = clientY - offsetHeight;
	var availableLeftColHeight = 0;
	var leftCol = document.getElementById('leftCol');
	if (leftCol != null) {
		var leftColTop = GetOffSet(leftCol, OFFSET_TOP);
		var leftColHeight = leftCol.offsetHeight;
		var leftColExtent = leftColTop + leftColHeight;
		availableLeftColHeight = leftColExtent - spanTableTop;
	}

	var mapHeight = Math.max(availableClientHeight, availableLeftColHeight);

	if (mapHeight > 0) {
		spanTable.style.height = mapHeight + "px";
	}
	else {
		spanTable.style.height = "auto";
	}
}

