/**
 * jQuery to go with ju5tu5.nl v4
 */

$(document).ready(function() {
	
	$(window).resize(function(){

		$('article').css({
			position:'absolute',
			left: ($(window).width() - $('article').outerWidth())/2,
			top: ($(window).height() - $('article').outerHeight())/2
		});

	});

	// To initially run the function:
	$(window).resize();
	
	/*
	$('header').css('background','none');
	$('header h1').after('<img src="/pics/logoRed.png" />').after('<img src="/pics/logoBlue.png" />');
	$('header img').first().css({position: 'relative', top: '0px', left: '0px'});
	$('header img').last().css({position: 'relative', top: '0px', left: '-145px'});
	
	$(document).mousemove(function(e){
		var h = 5/($(document).width()/2)*(e.pageX - ($(document).width()/2));
		var v = 5/($(document).height()/2)*(e.pageY - ($(document).height()/2));
		$('header img').first().css('top',(v*0.7)+'px').css('left',(h*0.7)+'px');
		$('header img').last().css('top',(v)+'px').css('left',(h-145)+'px');
		//e.pageX, e.pageY
	});
	
	/* Search for titles and add them as clickable links
	$('article h1').each(function(index) {
		$('header h1').after('<a href="#'+ $(this).html().toLowerCase().replace(/ /g,'') + '">'+ $(this).html() +'</a>');
		$(this).before('<a name="'+ $(this).html().toLowerCase().replace(/ /g,'') + '"></a>');
	});
	*/
});

