// code voor refreshen pagina 

	var sURL = unescape(window.location.pathname);
	
	function doLoad()
	{
		// the timeout value should be the same as in the "refresh" meta-tag
		setTimeout( "refresh()", 5*1000 );
	}
	
	function refresh()
	{
		window.location.href = sURL;
	}
		
// Code voor resize achtergrond
var imgObj, imgRatio


function getWindowWidth() {
	var x = 0;
	if (self.innerHeight) {
		x = self.innerWidth;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		x = document.documentElement.clientWidth;
	} else if (document.body) {
		x = document.body.clientWidth;
	}
	return x;
}

function getWindowHeight() {
	var y = 0;
	if (self.innerHeight) {
		y = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		y = document.documentElement.clientHeight;
	} else if (document.body) {
		y = document.body.clientHeight;
	}
	return y;
}

function bgInit() {
	var winWidth = getWindowWidth();
	var winHeight = getWindowHeight();
	imgObj = document.getElementById('bgImg');
	var imgWidth = parseInt(imgObj.width);
	var imgHeight = parseInt(imgObj.height);
	imgRatio = imgWidth / imgHeight;
	changeSize();
}

function changeSize() {
	if (imgObj) {
		var winWidth = getWindowWidth();
		var winHeight = getWindowHeight();
		var winRatio = winWidth / winHeight;
		if (winRatio > imgRatio) {
			var imgWidth = winWidth;
			var imgHeight = (imgRatio > 1)?parseInt(imgWidth / imgRatio):parseInt(imgWidth * imgRatio);
		} else {
			var imgHeight = winHeight;
			var imgWidth = (imgRatio < 1)?parseInt(imgHeight / imgRatio):parseInt(imgHeight * imgRatio);
		}
		var imgX = 0;
		var imgY = 0;
		
		
		//if (imgHeight > winHeight) imgHeight = winHeight;
		//if (imgWidth > winWidth) imgWidth = winWidth;
		
		
		if (imgWidth > winWidth) imgX = 0 - parseInt((imgWidth - winWidth) / 2)
		if (imgHeight > winHeight) imgY = 0 - parseInt((imgHeight - winHeight) / 2)
				
		//imgWidth-=18;
		//imgHeight-=25;
		
		var w = imgWidth + 'px';
		var h = imgHeight + 'px';
		var x = imgX + 'px';
		var y = imgY + 'px';
		imgObj.style.left = x;
		imgObj.style.top = y;
		imgObj.style.width = w;
		imgObj.style.height = h;
	}
}




