function setBackgroundsource() {
    
    var screenWidth = 0;
    var screenHeight = 0;
    
    if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		screenWidth = window.innerWidth;
		screenHeight = window.innerHeight;
		
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		screenWidth = document.documentElement.clientWidth;
		screenHeight = document.documentElement.clientHeight;
		
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		screenWidth = document.body.clientWidth;
		screenHeight = document.body.clientHeight;
	}	
    
    var bgHeight = 2259;
    var bgWidth = 981;
    
    ratio = bgHeight / bgWidth;
    screenratio = screenHeight  / screenWidth;
    
    if(bgHeight > screenHeight && bgWidth > screenWidth) {
        
        SizeDiff = bgHeight - screenHeight;
        newImgHeight = bgHeight - (SizeDiff * ratio);
        newImgWidth = screenWidth;
        
    } else {
        
        newImgHeight = screenHeight;
        newImgWidth = screenWidth;
        
    }
    
    var source = 'http://www.rivageverhuur.nl/includes/systems/image.php/bgimg.jpg?width='+newImgWidth+'&height='+newImgHeight+'&cropratio=1:'+screenratio+'&image=http://www.rivageverhuur.nl/includes/gui/img/bgimg.jpg';
    
    //document.write('<img src="'+source+'" style="position: fixed; z-index: -1;" />');
    document.getElementById('bgImage').src = source;
    //alert (source);
    //BgElement.setAttribute("src", source);
    //document.getElementById('imageBackground').src = 'http://website.mooiwestzvl.nl/includes/systems/image.php/bg.jpg?width='+newImgWidth+'&amp;height='+newImgHeight+'&amp;cropratio=1:1&amp;image=http://website.mooiwestzvl.nl/includes/gui/img/bg.jpg';
    //document.getElementById('imageBackground').style.display = 'block';
    // alert('klaar');
}		
