
	var m_curiumRulerDiv = null;
	function getCuriumRulerDiv() {

		if(m_curiumRulerDiv == null) {
			var rulerDiv = "<div id=\"curium_ruler\" style=\"position: absolute; top: 0px; left: 0px; width: 100%; \">&nbsp;</div>";
			document.body.innerHTML = rulerDiv + document.body.innerHTML;
		}

		m_curiumRulerDiv = document.getElementById("curium_ruler");

		return m_curiumRulerDiv;

	}

	function divHeight(id) {
		var element = document.getElementById(id);
if(element) {
		return element.offsetHeight;
}
else {
	return 0;
}
	}

	function getWindowWidth() {

		// Mozilla
		if(window.innerWidth) {
			var curiumRulerDiv = getCuriumRulerDiv();
			if(curiumRulerDiv.offsetWidth) {
				if(window.innerWidth != curiumRulerDiv.offsetWidth) {
					return curiumRulerDiv.offsetWidth;
				}
			}
			return (window.innerWidth);
		}


		// IE6
		if(document.documentElement.clientWidth) {
			return document.documentElement.clientWidth;
		}

		// IE DHTML-compliant any other
		if(document.body.clientWidth) {
			return document.body.clientWidth;
		}

	}

/*
	function getWindowWidth() {

		var windowWidth = 0;

		if(typeof(window.innerWidth) == 'number') {
			//Non-IE
			windowWidth = window.innerWidth;
		}

		else if(document.documentElement && (
			document.documentElement.clientWidth ||
			document.documentElement.clientHeight)) {

			//IE 6+ in 'standards compliant mode'
			windowWidth = document.documentElement.clientWidth;

		}

		else if(document.body && (
			document.body.clientWidth ||
			document.body.clientHeight)) {

			//IE 4 compatible
			windowWidth = document.body.clientWidth;
		}

		return windowWidth;

	}
*/

	/**
	 * Compare's an element's width and offsetWidth, and adjusts the width so
	 * that the offsetWidth equals the original width.
	 */
	function adjustWidthForOffset(id) {

		var region = document.getElementById(id);
if(!region) {
	return;
}

		// Get the numerical part of the width.  Assumes "px" suffix.
		var width = parseInt(
			region.style.width.substring(0, region.style.width.length - 2));

		// If the width and the offsetWidth disagree, then adjust the width
		if(width < region.offsetWidth) {
			var diff = (region.offsetWidth - width);
			region.style.width = width - diff;
		}

	}

	/**
	 * <p>
	 * Determines and returns the largest of the three supplied
	 * numerical values.
	 * </p>
	 */
	function max2(a, b) {
		if(a > b)
			return a;
		else
			return b;
	}

	/**
	 * <p>
	 * Determines and returns the largest of the three supplied
	 * numerical values.
	 * </p>
	 */
	function max3(a, b, c) {
		if(a > b && a > c)
			return a;
		else if(b > a && b > c)
			return b;
		else
			return c;
	}

	/**
	 * <p>
	 * Determines and returns the largest of the supplied
	 * numerical values.
	 * </p>
	 */
	function max4(a, b, c, d) {
		return max2(
			max2(a, b),
			max2(c, d));
	}

	/**
	 * <p>
	 * Determines and returns the largest of the supplied
	 * numerical values.
	 * </p>
	 */
	function max5(a, b, c, d, e) {
		return max2(
			max2(a, b),
			max3(c, d, e));
	}

	/**
	 * <p>
	 * Determines and returns the largest of the supplied
	 * numerical values.
	 * </p>
	 */
	function max6(a, b, c, d, e, f) {
		return max2(
			max3(a, b, c),
			max3(d, e, f));
	}

	function resizeDivLTW(id, left, top, width) {
		var div = document.getElementById(id);
if(!div) {
	return;
}
		div.style.left = left;
		if(top >= 0) div.style.top = top;
		if(width > 0) div.style.width = width;
		div.style.height = "";
div.style.display = "";
	}

	function resizeDivH(id, height) {
		var div = document.getElementById(id);
if(!div) {
	return;
}
		if(height > 0) div.style.height = height;
div.style.display = "";
	}

	function resizeDivLTWH(id, left, top, width, height) {
		var div = document.getElementById(id);
if(!div) {
	return;
}
		div.style.left = left;
		if(top >= 0) div.style.top = top;
		div.style.width = width;
		div.style.height = height;
div.style.display = "";
	}


////////////////////////////////////////////////////////////////////////////////
// Set Up
//

	function curium_initializeDivAsVariableHeight(id) {
		var element = document.getElementById(id);
if(!element) {
	return;
}
/*
		if(element == null) {
			alert("Unable to find content region with id: " + id);
		}
		else {
*/
		if(element) {
			element.style.position = "absolute";
			element.style.overflowX = "hidden";
		}
	}

	function curium_initializeDivAsFixedHeightNoScroll(id) {
		var element = document.getElementById(id);
if(!element) {
	return;
}
/*
		if(element == null) {
			alert("Unable to find content region with id: " + id);
		}
		else {
*/
		if(element) {
			element.style.position = "absolute";
			element.style.overflow = "hidden";
		}
	}

	function curium_initializeDivAsFixedHeightVScroll(id) {
		var element = document.getElementById(id);
if(!element) {
	return;
}
/*
		if(element == null) {
			alert("Unable to find content region with id: " + id);
		}
		else {
*/
		if(element) {
			element.style.position = "absolute";
			element.style.overflow = "scroll";
			element.style.overflowX = "hidden";
			element.style.overflowY = "scroll";
		}
	}

var m_loaded = false;

	function curium_onload() {

m_loaded = true;

		curium_initializeDivAsFixedHeightNoScroll("masthead")
		curium_initializeDivAsFixedHeightNoScroll("imagefeature")
		curium_initializeDivAsFixedHeightNoScroll("navbar")
		curium_initializeDivAsVariableHeight("content")
		curium_initializeDivAsFixedHeightNoScroll("canvass")
		curium_initializeDivAsFixedHeightNoScroll("canvass_border_right_top")
		curium_initializeDivAsFixedHeightNoScroll("canvass_border_right_bottom")
		curium_initializeDivAsFixedHeightNoScroll("canvass_border_bottom")
		curium_initializeDivAsFixedHeightNoScroll("footerfeature")
		curium_initializeDivAsFixedHeightNoScroll("footer")

		curium_onresize();

	}

	function curium_initialize() {
		curium_initializeDivAsFixedHeightNoScroll("masthead")
		curium_initializeDivAsFixedHeightNoScroll("imagefeature")
		curium_initializeDivAsFixedHeightNoScroll("navbar")
		curium_initializeDivAsVariableHeight("content")
		curium_initializeDivAsFixedHeightNoScroll("canvass")
		curium_initializeDivAsFixedHeightNoScroll("canvass_border_right_top")
		curium_initializeDivAsFixedHeightNoScroll("canvass_border_right_bottom")
		curium_initializeDivAsFixedHeightNoScroll("canvass_border_bottom")
		curium_initializeDivAsFixedHeightNoScroll("footerfeature")
		curium_initializeDivAsFixedHeightNoScroll("footer")
	}

	function curium_onresize() {

		// Set up the browser-specific offset
		var offset = 0;
		if(navigator.appName.indexOf("Explorer") == -1) {
			//offset = 2;
		}

		// Get the window's width
		var windowWidth = getWindowWidth();

		// Work out how much free-space we'll have after fixed width columns
		// are layed out
		var totalFixedWidth = 640;
		var freeWindowWidth = windowWidth - totalFixedWidth;
		freeWindowWidth -= (offset * 7);


////////////////////////////////////////////////////////////////////////////////
// Calculate Column Widths
//

		////////////////////////////////
		// Col 1 (variable width)

		var col1_left = 0;
		var col1_minWidth = 1;
		var col1_width = max2(
			col1_minWidth,
			Math.round(freeWindowWidth / 100 * 50));

		////////////////////////////////
		// Col 2 (fixed width)

		var col2_left = col1_left + col1_width + offset;
		var col2_width = 10;

		////////////////////////////////
		// Col 3 (fixed width)

		var col3_left = col2_left + col2_width + offset;
		var col3_width = 10;

		////////////////////////////////
		// Col 4 (fixed width)

		var col4_left = col3_left + col3_width + offset;
		var col4_width = 600;

		////////////////////////////////
		// Col 5 (fixed width)

		var col5_left = col4_left + col4_width + offset;
		var col5_width = 10;

		////////////////////////////////
		// Col 6 (fixed width)

		var col6_left = col5_left + col5_width + offset;
		var col6_width = 10;

		////////////////////////////////
		// Col 7 (remainder)

		var col7_left = col6_left + col6_width + offset;
		var col7_minWidth = 1;
		var col7_width = max2(
			col7_minWidth,
			freeWindowWidth - (col1_width));


////////////////////////////////////////////////////////////////////////////////
// Resize Regions and Adjust Row Heights
//

		////////////////////////////////
		// Row 1

		// STEP 1 - Calculate the top value for the row.
		var row1_top = 0;
		var row1_height = 70;

		// STEP 2 - Apply the dimensions to rows ending in this row
		resizeDivLTW("masthead", col3_left, row1_top, col3_width + offset + col4_width + offset + col5_width);
		adjustWidthForOffset("masthead");
		// STEP 3 - Adjust this row's height to cover overflow of variable
		// height regions anchored to this row.
// (no variable-size regions anchored to this row)

		// STEP 4 - Reapply region heights
		resizeDivH("masthead", row1_height);

		////////////////////////////////
		// Row 2

		// STEP 1 - Calculate the top value for the row.
		var row2_top = row1_top + row1_height + offset;
		var row2_height = 10;

		// STEP 2 - Apply the dimensions to rows ending in this row
// (no regions anchored to this row);

		// STEP 3 - Adjust this row's height to cover overflow of variable
		// height regions anchored to this row.
// (no variable-size regions anchored to this row)

		// STEP 4 - Reapply region heights
// (no variable-size regions anchored to this row

		////////////////////////////////
		// Row 3

		// STEP 1 - Calculate the top value for the row.
		var row3_top = row2_top + row2_height + offset;
		var row3_height = 80;

		// STEP 2 - Apply the dimensions to rows ending in this row
		resizeDivLTW("imagefeature", col4_left, row3_top, col4_width);
		adjustWidthForOffset("imagefeature");
		// STEP 3 - Adjust this row's height to cover overflow of variable
		// height regions anchored to this row.
// (no variable-size regions anchored to this row)

		// STEP 4 - Reapply region heights
		resizeDivH("imagefeature", row3_height);

		////////////////////////////////
		// Row 4

		// STEP 1 - Calculate the top value for the row.
		var row4_top = row3_top + row3_height + offset;
		var row4_height = 10;

		// STEP 2 - Apply the dimensions to rows ending in this row
// (no regions anchored to this row);

		// STEP 3 - Adjust this row's height to cover overflow of variable
		// height regions anchored to this row.
// (no variable-size regions anchored to this row)

		// STEP 4 - Reapply region heights
// (no variable-size regions anchored to this row

		////////////////////////////////
		// Row 5

		// STEP 1 - Calculate the top value for the row.
		var row5_top = row4_top + row4_height + offset;
		var row5_height = 15;

		// STEP 2 - Apply the dimensions to rows ending in this row
		resizeDivLTW("navbar", col4_left, row5_top, col4_width);
		adjustWidthForOffset("navbar");
		// STEP 3 - Adjust this row's height to cover overflow of variable
		// height regions anchored to this row.
// (no variable-size regions anchored to this row)

		// STEP 4 - Reapply region heights
		resizeDivH("navbar", row5_height);

		////////////////////////////////
		// Row 6

		// STEP 1 - Calculate the top value for the row.
		var row6_top = row5_top + row5_height + offset;
		var row6_height = 15;

		// STEP 2 - Apply the dimensions to rows ending in this row
		resizeDivLTW("canvass_border_right_top", col6_left, row2_top, col6_width);
		adjustWidthForOffset("canvass_border_right_top");
		// STEP 3 - Adjust this row's height to cover overflow of variable
		// height regions anchored to this row.
// (no variable-size regions anchored to this row)

		// STEP 4 - Reapply region heights
		resizeDivH("canvass_border_right_top", row2_height + offset + row3_height + offset + row4_height + offset + row5_height + offset + row6_height);

		////////////////////////////////
		// Row 7

		// STEP 1 - Calculate the top value for the row.
		var row7_top = row6_top + row6_height + offset;
		var row7_height = 50;

		// STEP 2 - Apply the dimensions to rows ending in this row
		resizeDivLTW("content", col4_left, row7_top, col4_width);
		adjustWidthForOffset("content");
		// STEP 3 - Adjust this row's height to cover overflow of variable
		// height regions anchored to this row.
		row7_height = max2(row7_height, divHeight("content"));

		// STEP 4 - Reapply region heights
		resizeDivH("content", row7_height);

		////////////////////////////////
		// Row 8

		// STEP 1 - Calculate the top value for the row.
		var row8_top = row7_top + row7_height + offset;
		var row8_height = 15;

		// STEP 2 - Apply the dimensions to rows ending in this row
// (no regions anchored to this row);

		// STEP 3 - Adjust this row's height to cover overflow of variable
		// height regions anchored to this row.
// (no variable-size regions anchored to this row)

		// STEP 4 - Reapply region heights
// (no variable-size regions anchored to this row

		////////////////////////////////
		// Row 9

		// STEP 1 - Calculate the top value for the row.
		var row9_top = row8_top + row8_height + offset;
		var row9_height = 15;

		// STEP 2 - Apply the dimensions to rows ending in this row
		resizeDivLTW("footerfeature", col4_left, row9_top, col4_width);
		adjustWidthForOffset("footerfeature");
		// STEP 3 - Adjust this row's height to cover overflow of variable
		// height regions anchored to this row.
// (no variable-size regions anchored to this row)

		// STEP 4 - Reapply region heights
		resizeDivH("footerfeature", row9_height);

		////////////////////////////////
		// Row 10

		// STEP 1 - Calculate the top value for the row.
		var row10_top = row9_top + row9_height + offset;
		var row10_height = 10;

		// STEP 2 - Apply the dimensions to rows ending in this row
		resizeDivLTW("canvass", col3_left, row2_top, col3_width + offset + col4_width + offset + col5_width);
		adjustWidthForOffset("canvass");		resizeDivLTW("canvass_border_right_bottom", col6_left, row7_top, col6_width);
		adjustWidthForOffset("canvass_border_right_bottom");
		// STEP 3 - Adjust this row's height to cover overflow of variable
		// height regions anchored to this row.
// (no variable-size regions anchored to this row)

		// STEP 4 - Reapply region heights
		resizeDivH("canvass", row2_height + offset + row3_height + offset + row4_height + offset + row5_height + offset + row6_height + offset + row7_height + offset + row8_height + offset + row9_height + offset + row10_height);
		resizeDivH("canvass_border_right_bottom", row7_height + offset + row8_height + offset + row9_height + offset + row10_height);

		////////////////////////////////
		// Row 11

		// STEP 1 - Calculate the top value for the row.
		var row11_top = row10_top + row10_height + offset;
		var row11_height = 10;

		// STEP 2 - Apply the dimensions to rows ending in this row
		resizeDivLTW("canvass_border_bottom", col3_left, row11_top, col3_width + offset + col4_width + offset + col5_width + offset + col6_width);
		adjustWidthForOffset("canvass_border_bottom");
		// STEP 3 - Adjust this row's height to cover overflow of variable
		// height regions anchored to this row.
// (no variable-size regions anchored to this row)

		// STEP 4 - Reapply region heights
		resizeDivH("canvass_border_bottom", row11_height);

		////////////////////////////////
		// Row 12

		// STEP 1 - Calculate the top value for the row.
		var row12_top = row11_top + row11_height + offset;
		var row12_height = 10;

		// STEP 2 - Apply the dimensions to rows ending in this row
// (no regions anchored to this row);

		// STEP 3 - Adjust this row's height to cover overflow of variable
		// height regions anchored to this row.
// (no variable-size regions anchored to this row)

		// STEP 4 - Reapply region heights
// (no variable-size regions anchored to this row

		////////////////////////////////
		// Row 13

		// STEP 1 - Calculate the top value for the row.
		var row13_top = row12_top + row12_height + offset;
		var row13_height = 10;

		// STEP 2 - Apply the dimensions to rows ending in this row
		resizeDivLTW("footer", col3_left, row12_top, col3_width + offset + col4_width + offset + col5_width);
		adjustWidthForOffset("footer");
		// STEP 3 - Adjust this row's height to cover overflow of variable
		// height regions anchored to this row.
// (no variable-size regions anchored to this row)

		// STEP 4 - Reapply region heights
		resizeDivH("footer", row12_height + offset + row13_height);

	}

//window.onload = curium_onload;
window.onresize = curium_onresize;


////////////////////////////////////////////////////////////////////////////////
// AsLoad Functionality
//

		var g_regions = new Array();
		var g_regionNames = new Array();

		g_regionNames[0] = "masthead";
		g_regionNames[1] = "canvass";
		g_regionNames[2] = "canvass_border_right_top";
		g_regionNames[3] = "canvass_border_right_bottom";
		g_regionNames[4] = "canvass_border_bottom";
		g_regionNames[5] = "imagefeature";
		g_regionNames[6] = "navbar";
		g_regionNames[7] = "content";
		g_regionNames[8] = "footerfeature";
		g_regionNames[9] = "footer";

		var g_asloadLoopCount = 0;

		function asload() {

			g_asloadLoopCount ++;
			var incomplete = false;

			for(var i = 0; i < g_regionNames.length; i ++) {

				if(!g_regions[i]) {

					var region = document.getElementById(g_regionNames[i]);

					if(region) {
						g_regions[i] = region;
applyLayout(region);
curium_onload();
					}
					else {
						incomplete = true;
					}

				}

			}

			if(incomplete) {
				window.setTimeout("asload();", 1);
			}

/*
			else {
				alert("complete after " + g_asloadLoopCount + " iterations");
			}
*/

		}

		function applyLayout(region) {
//			region.style.backgroundColor = "#ff0000";
		}

		// Launch the asload loop
		window.setTimeout("asload();", 0);


