/***********************************************************************Author:     Sander TiekstraCompany:    TiekstramediaURL:        http://www.tiekstramedia.nl			http://www.4rn0.nl***********************************************************************//* Initialize behaviour on page or DOM load-------------------------------------------------------------------- */if (document.addEventListener) { document.addEventListener('DOMContentLoaded',init,null); }/*@cc_on @*/ /*@if (@_win32) document.write("<script defer src=../js/init.js><"+"/script>"); /*@end @*/   window.onload = init;function init() {	if (arguments.callee.done) {		return;	}		arguments.callee.done = true;		if (typeof(document.getElementById) == 'undefined') {		document.getElementById = function(id) {			return document.all[id];		};	}		setSiteHeight();	setA();}/* Reset after window resize-------------------------------------------------------------------- */window.onresize = function() {	setSiteHeight();}/* - Defocus all links   - Send links with rel="external" to a new window -------------------------------------------------------------------- */function setA(){	var as = document.getElementsByTagName("a");	for (i=0; i<as.length; i++)	{		as[i].onfocus = function() { this.blur(); }		// Handle rel="external"		if (as[i].getAttribute('rel') == 'external') {           as[i].setAttribute('target', '_blank');       }	}}/* Get height of browser window-------------------------------------------------------------------- */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;}/* Set the height Container-------------------------------------------------------------------- */function setSiteHeight() {		if (document.getElementById('mainNav')) {		minHeight = document.getElementById('mainNav').offsetTop + document.getElementById('mainNav').offsetHeight;		if (minHeight < getWindowHeight()) {			if (document.getElementById('container')) {				document.getElementById('container').style.height = getWindowHeight() - 13 + "px";			} else {				return;			}			if (document.getElementById('content')) {				document.getElementById('content').style.height = getWindowHeight() - document.getElementById('content').offsetTop + "px";				setContentSubs();							}		} else {			if (document.getElementById('container')) {				document.getElementById('container').style.height = minHeight - 13 + "px";			} else {				return;			}			if (document.getElementById('content')) {				document.getElementById('content').style.height = minHeight - document.getElementById('content').offsetTop + "px";				setContentSubs();				}		}	}		function setContentSubs() {		contentHeight = document.getElementById('content').offsetHeight - 8;		tempHeight = 0;				mainDiv = document.getElementById('main');		subDiv = document.getElementById('sub');				if (mainDiv) {			if (mainDiv.offsetHeight < contentHeight) {				mainDiv.style.height = contentHeight + "px";			}		}		if (subDiv) {			if (subDiv.offsetHeight < contentHeight) {				subDiv.style.height = contentHeight + "px";			}		}				if (mainDiv) {			if (mainDiv.offsetHeight > tempHeight) {				tempHeight = mainDiv.offsetHeight;			}		}		if (subDiv) {			if (subDiv.offsetHeight > tempHeight) {				tempHeight = subDiv.offsetHeight;			}		}				if ((tempHeight - 8) > contentHeight) {			if (mainDiv) {				mainDiv.style.height = tempHeight + "px";			}			if (subDiv) {				subDiv.style.height = tempHeight - 8 + "px";			}		}				}}	
