 var sw;
 var sh;
function getViewPortW(){
	 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
	 if (typeof window.innerWidth != 'undefined')
	 {
		  sw = window.innerWidth,
		  sh = window.innerHeight
	 }
	 
	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
	
	 else if (typeof document.documentElement != 'undefined'
		 && typeof document.documentElement.clientWidth !=
		 'undefined' && document.documentElement.clientWidth != 0)
	 {
		   sw = document.documentElement.clientWidth,
		   sh = document.documentElement.clientHeight
	 }
	 
	 // older versions of IE
	 
	 else
	 {
		   sw = document.getElementsByTagName('body')[0].clientWidth,
		   sh = document.getElementsByTagName('body')[0].clientHeight
	 }
	return sw;
}
function getViewPortH(){
	 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
	 if (typeof window.innerWidth != 'undefined')
	 {
		  sw = window.innerWidth,
		  sh = window.innerHeight
	 }
	 
	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
	
	 else if (typeof document.documentElement != 'undefined'
		 && typeof document.documentElement.clientWidth !=
		 'undefined' && document.documentElement.clientWidth != 0)
	 {
		   sw = document.documentElement.clientWidth,
		   sh = document.documentElement.clientHeight
	 }
	 
	 // older versions of IE
	 
	 else
	 {
		   sw = document.getElementsByTagName('body')[0].clientWidth,
		   sh = document.getElementsByTagName('body')[0].clientHeight
	 }
	return sh;
}
function updateViewPort(){
	sw = getViewPortW();
	sh = getViewPortH();
	pagewidth = sw;
	if(sw<=1400){
		document.getElementById('block').style.backgroundImage = 'url("/images/beeldmerk2.png")';
		document.getElementById('block').style.width = '236px';
	}else{
		document.getElementById('block').style.backgroundImage = 'url("/images/beeldmerk.png")';
		document.getElementById('block').style.width = '483px';
	}
	if(document.getElementById('content_home2') != null){
		document.getElementById('content_home2').style.minHeight = (sh-653)+'px';
		blockHeight = $('#block').height();
		centerHeight = $('#page').height() + 630;
		topMargin = centerHeight - blockHeight;
		document.getElementById('block').style.marginTop = topMargin+'px';
		leftMargin = pagewidth / 2;
		leftMargin = leftMargin + 215;
		document.getElementById('block').style.marginLeft = leftMargin+'px';
	} else {
		document.getElementById('page').style.minHeight = (sh-363)+'px'; 
		blockHeight = $('#block').height();
		centerHeight = $('#page').height() + 280;
		topMargin = centerHeight - blockHeight;
		document.getElementById('block').style.marginTop = topMargin+'px';
		leftMargin = pagewidth / 2;
		leftMargin = leftMargin + 215;
		document.getElementById('block').style.marginLeft = leftMargin+'px';
	}
		
//	document.getElementById('container').style.left = (sw-1024)/2+'px'; 
	// alert(sw+'x'+sh);	
}

window.onresize = function (){
	updateViewPort();
}

$(document).ready(function() {			   
	
updateViewPort();
	
  
});

