// =========================
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	} else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body && document.body.clientHeight) {
			windowHeight = document.body.clientHeight;
		}
	}
	return windowHeight;
}
// =========================
function getWindowWidth() {
	var windowWidth = 0;
	if (typeof(window.innerWidth) == 'number') {
		windowWidth = window.innerWidth;
	} else {
		if (document.documentElement && document.documentElement.clientWidth) {
			windowWidth = document.documentElement.clientWidth;
		} else if (document.body && document.body.clientWidth) {
			windowWidth = document.body.clientWidth;
		}
	}
	return windowWidth;
}
// =========================
// custom to set body bg to left when window < min
function setPageBody() {
	if (document.getElementById) {
		var windowWidth = getWindowWidth();
		var windowMinimal = document.getElementById('main').offsetWidth;
		if (windowWidth < windowMinimal) {
			document.getElementById('bb').style.backgroundPosition = '0 0';
			// reset footer 
			document.getElementById('footer').style.top = '0px';
		} else {
			document.getElementById('bb').style.backgroundPosition = '50% 50%';
			setFooter();
		}
		setTimeout("setPageBody()", 250);
	}
}
// =========================
function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('page').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
			} else {
				footerElement.style.top = '0px';
			}
		}
		//setTimeout("setFooter()", 500);
	}
}
// =========================
/*function setRandomPhoto(PAGEID) {
	photos = new Array();
	photos[0] = "images/photo_highway.jpg";
	photos[1] = "images/photo_running.jpg";
	var photosMax = photos.length -1;
	var randomNr = photosMax * Math.random();
	randomNr = Math.round(randomNr);
	img_src = photos[randomNr];
	if(PAGEID == 1) {
		// Homepage!
		img_src = photos[1];
	}
	var img = "<img src=\"" + img_src + "\" alt=\"BeaconPartners\" width=\"270\" height=\"147\" />";
	document.getElementById('randomPhoto').innerHTML = img;
}*/
// =========================
function initBeaconFunctions(PAGEID) {
	//setRandomPhoto(PAGEID);
	setPageBody();
}

/* Functie op juiste tab te showen */
function showTab(tab)
{
	document.getElementById("tab1").style.display = 'none';
	document.getElementById("tab2").style.display = 'none';
	document.getElementById("tab3").style.display = 'none';
	document.getElementById("tab4").style.display = 'none';
	
	document.getElementById("tab"+tab).style.display = 'block';
}
// =========================
