$(document).ready(function(){  // do this stuff when the HTML is all ready
	$('#ball').html('<a style="display:block;text-align:center;margin-top:20p;" href="http://www.adobe.com/go/getflashplayer">Install Flash Plugin</a>');
	var closed;
	var so = new SWFObject("8ball.swf", "eightball", "100%", "100%", "10", "#000000");
	so.addParam("scale", "noscale");
	so.addParam("allowFullScreen", "true");
	so.addParam("wmode", "opaque");
	so.write("ball");	
	
	$('#footer').height(105);
	$('#eightball').height($(window).height()-140);
	
	$('h1, h2').click(function() {
		if(closed){
			$('#footer').height(105);
			$('#eightball').height($(window).height()-140);
			closed = false;
		}
		else{
			$('#footer').height(10);
			$('#eightball').height($(window).height()-45);
			closed = true;			
		}
	});
	
	$(window).bind("resize", resizeWindow);
	function resizeWindow(e) {
		if(closed){
			$('#eightball').height($(window).height()-45);
		}
		else{
			$('#eightball').height($(window).height()-140);
		}
	}
	
});