	$(document).ready(function() {
		resizeHeight();
		$('ul#navigation li').hover(
			function () {
				$(this).addClass('hover');
			}, 
			function () {
				$(this).removeClass('hover');
		});
		sponsoren();
		nieuwsbriefZijblok();
		challenge_logo();
		tof_logo();
	});
	
	function resizeHeight() {
		var	winHeight = $(window).height();
		var contentColumnHeight = winHeight - 230;
		$("#contentColumn").css("height",contentColumnHeight+"px");
	}
	$(window).resize(function(){
		resizeHeight();
	});

	function sponsoren(){
		var shuffled = $('#sponsorColumn ul').find('li').get().slice(1).sort(function(){
				return Math.round(Math.random())-0.5;//just a random number between -0.5 and 0.5
			});
		$(shuffled).appendTo($('#sponsorColumn ul'));//add them all reordered
		$('#sponsorColumn').serialScroll({
			items:'li',
			duration:5000,
			force:true,
			axis:'y',
			easing:'linear',
			lazy:false,// NOTE: it's set to true, meaning you can add/remove/reorder items and the changes are taken into account.
			interval:1, // yeah! I now added auto-scrolling
			step:1
		});	
		$('#sponsorColumn').hover(
			function(){
				$(this).trigger('stop');
			},
			function(){
				$(this).trigger('start');
			}
		);
	}
	var nieuwsbriefEmailText = '';
	function nieuwsbriefZijblok(){
		nieuwsbriefEmailText = $('#nieuwsbriefEmailText').val();
		$('#nieuwsbriefEmailText').bind('focus',function(){
			if($(this).val() == nieuwsbriefEmailText){
				$(this).val('');
			}
		}).bind('blur',function(){
			if($(this).val() == ''){
				$(this).val(nieuwsbriefEmailText);
			}
		});
		$('#nieuwsbriefZijblok').bind('submit',function(){
			if($('#nieuwsbriefEmailText').val() == nieuwsbriefEmailText){
				$('#nieuwsbriefEmailText').val('');
			}
		});
	}

	function challenge_logo(){
		$("#challengelogo").bind("click",function(){
			window.open('http://www.amsterdamdakar.nl','_blank');
			return true;
		}).css("cursor","pointer");
	}

	function tof_logo(){
		$("#toflogo").bind("click",function(){
			window.open('/index/31/24/theopticalfoundation.php','_self');
			return true;
		}).css("cursor","pointer");
	}	
