<!--
// JavaScript Document
// setLayout
//
//
// Gets the screen size, resizes the browser window and centers the content after a small timeout (allowing the page to load)
//
// 01. Get screen size and maximise the window "on load"
//
var theWidth;
var theHeight;

function getDim () {
	theWidth = 0 
	theHeight = 0
	//alert('getting dims');
	// Window dimensions: 
	if (window.innerWidth) {
	theWidth=window.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth) {
	theWidth=document.documentElement.clientWidth;
	}
	else if (document.body) {
	theWidth=document.body.clientWidth;
	}
	if (window.innerHeight) {
	theHeight=window.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight) {
	theHeight=document.documentElement.clientHeight;
	}
	else if (document.body) {
	theHeight=document.body.clientHeight;
	}
	//alert(theWidth);
	//alert(theHeight);
}
//
// 02. Function to set the layout to center the page
//
function setLayout () {
	//alert("function setLayout");
	getDim ();
	lg=document.getElementById("logo");
	menu=document.getElementById("theMenu");
	flashC=document.getElementById("content_flash");
	topC=document.getElementById("content_top");
	lowerC=document.getElementById("content_lower");
	// define the coördinates
	logoZeroXPos = (theWidth / 2 - 400);
	logoZeroYPos = (theHeight / 2 - 215);
	centralZeroXPos = (theWidth / 2 - 400);
	centralZeroYPos = (theHeight / 2 - 150);
	menuZeroXPos = (theWidth / 2 - 400);
	menuZeroYPos = (theHeight / 2 + 150);
	lContentZeroXPos = (theWidth / 2 - 400);
	lContentZeroYPos = (theHeight / 2 + 190);
	// set display and position
	lg.style.display = 'block';
	lg.style.top = logoZeroYPos + 'px';
	lg.style.left = logoZeroXPos + 'px';
	// flashC.style.display = 'block';
	flashC.style.top = centralZeroYPos + 'px';
	flashC.style.left = centralZeroXPos + 'px';
	// topC.style.display = 'none';
	topC.style.top = centralZeroYPos + 'px';
	topC.style.left = centralZeroXPos + 'px';
	menu.style.display = 'block';
	menu.style.top = menuZeroYPos + 'px';
	menu.style.left = menuZeroXPos + 'px';
	lowerC.style.display = 'block';
	lowerC.style.top = lContentZeroYPos + 'px';
	lowerC.style.left = lContentZeroXPos + 'px';
}
//
// 03. Set the Layout
setLayout();
//
// 03. Delay the layout being set, so all elements are fully loaded
/*
function delaySetLayout(){
	setTimeout("setLayout()",1);	
}
delaySetLayout();
*/
// -->