function onResize() {
	var screenHeight = $(window).height();
	$('#bubbleMenu').css('top', (screenHeight - 390) + 'px');
	$('#danPanosian').css('top', (screenHeight - 160) + 'px');
	
	if( screenHeight > 736 )
		$('#aboutContent').css('top', (screenHeight - 690) + 'px');
	$('#aboutContent').css('height', (screenHeight - 250) + 'px');
	
	if( screenHeight > 656 )
		$('#contactContent').css('top', (screenHeight - 620) + 'px');
	$('#contactContent').css('height', (screenHeight - 260) + 'px');
	
	var rowCount = Math.floor((screenHeight - 260)/63);
	$('#galleryContent').css('height', (rowCount * 67 - 20) + 'px');
	$('#galleryMenu').css('top', (rowCount * 67) + 'px');
}

var galleryTop = 0;
function galleryUp() {
	galleryTop += $('#galleryContent').height();
	if( galleryTop > 0 )
		galleryTop = 0;
	$('#gallerySubcontent').animate({marginTop: galleryTop+"px"}, 1000);
}
function galleryDown() {
	galleryTop -= $('#galleryContent').height();
	var maxTop = $('#galleryContent').height() - $('#gallerySubcontent').height();
	if( galleryTop < maxTop )
		galleryTop = maxTop + 23;
	$('#gallerySubcontent').animate({marginTop: galleryTop+"px"}, 1000);
}

$(document).ready(function() {
	
	setTimeout(function(){
		$('#bubbleMenu').fadeIn(2000);
		$('#galleryMenu').fadeIn(2000);
	}, 500);
	
	$('#bubbleMenu li').click(function(){
		location.href = $(this).children().attr('href');
	});
	$('#bubbleMenu li a').hide();

	$(window).resize(onResize);
	onResize();
	
});

