/*******
** vp ** 1.03 21 April 2005	
*******/

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;
}

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 setBlur() {
	entries = document.getElementsByTagName('a');
	for (var i=0; i < entries.length; i++) {
		entries[i].onfocus = function() {this.blur()}
	}
}

var DEFAULTCONTENTHEIGHT = 0;

function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			DEFAULTCONTENTHEIGHT = document.getElementById('con').offsetHeight;
			var footerElement = document.getElementById('con_footer');
			var footerHeight = footerElement.offsetHeight;
			if (windowHeight - (DEFAULTCONTENTHEIGHT + footerHeight) >= 0) {
				footerElement.style.position = 'absolute';
				footerElement.style.top = (windowHeight - footerHeight + 0) + 'px'; // het getal erbij is de padding van de 'con' container. 
			}
			else {
				//footerElement.style.position = 'static';
				footerElement.style.position = 'absolute';
				footerElement.style.top = (DEFAULTCONTENTHEIGHT + 0) + 'px'; // het getal erbij is de padding van de 'con' container.
			}
		}
	}
}


var preloaded = new Array();
function setMOhandler() {
	var aEls = ['img','input']
	for(var j=0; j < aEls.length; j++){
		var entries = document.getElementsByTagName(aEls[j]);
		for (var i=0; i < entries.length; i++) {
			if (entries[i].className == 'MO') {
				var onImageSrc = entries[i].src.replace('_n.', '_o.');
				preloaded[preloaded.length] = new Image();
				preloaded[preloaded.length-1].src = onImageSrc;
				entries[i].onmouseover = function () {this.src = this.src.replace('_n.', '_o.')}
				entries[i].onmouseout = function () {this.src = this.src.replace('_o.', '_n.')}
			}
		}
	}
}	

	
function setCenter() {
	var windowWidth = getWindowWidth();
	var con = document.getElementById('con')
	var footer = document.getElementById('footer')
	if (navigator.appName == 'Microsoft Internet Explorer') {
		if (windowWidth > 760) { 
			if (windowWidth % 2) { // == odd
				con.style.left ='+1px';
				con.style.margin = '';
				footer.style.left ='+1px';
				footer.style.margin = '';
			}
			else { // === even
				con.style.left ='';
				con.style.margin = '0 auto';
				footer.style.left ='';
				footer.style.margin = '0 auto';
			
			}
		}
	}
}

