$(document).ready(function() {
	$('h1').click(function() {
		
		active=active==true?false:true;
		
		if(animatie!=null) {
			animatie.stop();	
		}
		
		if(animatie2!=null) {
			animatie2.stop();	
		}

		if(active==false) {
			window.clearTimeout(timeout);
			paintmenu('#FFFFFF')
		} else {
			timeout = window.setTimeout("paintmenu('#000000')",400)	
		}
		
		animatie = $('#alpha').animate({
			marginLeft:(active==true?'0px':'-990px')
		},600);
		
		animatie2 = $('h2').animate({
		  marginTop: (active==true?'0px':'-100px')
		 
		},1000,'easeOutElastic');
		
	});
});
