function resize() {

	var w = $(window).width();
	var h = $(window).height();
	
	//console.log("w : " + w);
	//console.log("h : " + h);
	
	var bg = document.getElementById('bg');
	if (bg) {
		if (!bg.aspectRatio) {
			if (bg.offsetWidth && bg.offsetHeight) {
				bg.aspectRatio = bg.offsetWidth / bg.offsetHeight;
			} else {
				return;
			}
		}
		
		if ((w/h) > bg.aspectRatio) {
			bg.style.width = '100%';
			bg.style.height = '';
		} else {
			bg.style.width = '';
			bg.style.height = '100%';
		}
	}
	
	$("#content").css("height",h);
	
	var columnWidth = 250;
	var contentWidth = parseInt(w - ( 2*columnWidth));
	
	$("#player").css("top",h - 380);
	$("#player").css("left", contentWidth + columnWidth - 270);
	
	
	$("#boekingeneninformatie").css("right",contentWidth + columnWidth - (250));
	$("#boekingeneninformatie").css("top",h - 320);
	$("#impressie").css("right",contentWidth + columnWidth - (50));
	$("#impressie").css("top",h - 200);
	$("#deelnemers").css("top",h - 120);
	$("#deelnemers").css("right",contentWidth + columnWidth - (250));
}

// setInterval('resize()',50);
$(function () {
	var tabContainers = $('div.tabs > div');
	tabContainers.hide();
	$('#home').show();
	
	$('div.tabs ul.tabNavigation a').mouseover(function (e) {
		tabContainers.hide().filter(this.hash).show();
		
		$('div.tabs ul.tabNavigation a').removeClass('selected');
		$(this).addClass('selected');
		
		return false;
	});
});

var theImages = new Array()
theImages[0] = 'images/bg1.jpg'
theImages[1] = 'images/bg2.jpg'
theImages[2] = 'images/bg3.jpg'
theImages[3] = 'images/bg4.jpg'
theImages[4] = 'images/bg5.jpg'
theImages[5] = 'images/bg6.jpg'
theImages[6] = 'images/bg7.jpg'
theImages[7] = 'images/bg8.jpg'
theImages[8] = 'images/bg9.jpg'


var whichImage = Math.round(Math.random()*(theImages.length-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'" id="bg" alt="" title="" />');
}

function showMessage(message,append) {
	if(append == 0) {
		$("#contact").html(message);
	} else {
		$("#contact").append(message);
	}
}
