$(document).ready(function() {
	resize_bubble();
	
	$('.appear').hide()
	
});

$(window).load(function(){
	$('.appear').fadeIn(1700);
})

$(window).resize(resize_bubble);

$.viewportHeight = function() {
	return self.innerHeight ||
		jQuery.boxModel && document.documentElement.clientHeight ||
		document.body.clientHeight;
};

function resize_bubble() {
	var vh = $.viewportHeight();
	if (vh >= 980) {
		$(document.body).css('background-position', "20px 77px");
	} else if (vh < 744 && vh > 500) {
		var offset = 536 - (744 - vh);
		$('#content').css('height', offset);
		//var bg_offset = offset - 77;
		//var bg_offset = (vh - 980) + offset;
		var bg_offset = -(744 - vh) + 77;
		$(document.body).css('background-position', "20px "+bg_offset+"px");
	}
	
}
