Cufon.replace('body')
$(document).ready(function(){
	$('#top').mouseenter(function(){
		adjustState($('#top'), $('#bottom'));
	});
	$('#bottom').mouseenter(function(){
		adjustState($('#bottom'), $('#top'));
	});
	$('#top').click(function(e){
		e.preventDefault();
		$('body').css('background', '#111111');
		$('#page').animate({
			top: $(window).height() + 'px'
		}, 600, 'easeInOutQuint', function(){
			window.location.href = "http://www.alexander-gnaedinger.de/portfolio"
		});
	});
	$('#bottom').click(function(e){
		e.preventDefault();
		$('body').css('background', '#f1f1f1');
		$('#page').animate({
			top: -$(window).height() + 'px'
		}, 600, 'easeInOutQuint', function(){
			window.location.href = "http://www.alexander-gnaedinger.de/studio"
		});
	});
	function adjustState(a, b){
		a.stop(true).animate({
			height: ($(window).height()-200) + 'px'
		}, 600, 'easeInOutQuint');
		b.stop(true).animate({
			height: '200px'
		}, 600, 'easeInOutQuint');
		a.find('.headline').stop(true).animate({
			marginTop: '70px'
		}, 600, 'easeInOutQuint');
		b.find('.headline').stop(true).animate({
			marginTop: '10px'
		}, 600, 'easeInOutQuint');
	}
	$("#preload").load('http://www.alexander-gnaedinger.de/portfolio/ #old-browser-alert', function(response, status, xhr) {
		$("#preload").load('http://www.alexander-gnaedinger.de/studio/ #old-browser-alert', function(response, status, xhr) {

		});
	});
})