// Background Flash JavaScript Document
$(document).ready(function(){
	var flashvars = {};
	var params = {};
	var attributes = {
		wmode: "transparent"
	};
	var flashWidth = document.documentElement.clientWidth;
	var flashHeight = checkMinimumHeight(document.documentElement.clientHeight);
	
	swfobject.embedSWF("media/background-animation.swf","flashContainer",flashWidth,flashHeight,"9.0.0",flashvars,params,attributes);
});

$(window).resize(function(){	
	var flashvars = {};
	var params = {};
	var attributes = {
		wmode: "transparent"
	};
	var flashWidth = document.documentElement.clientWidth;
	var flashHeight = checkMinimumHeight(document.documentElement.clientHeight);
	
	swfobject.embedSWF("media/background-animation.swf","flashContainer",flashWidth,flashHeight,"9.0.0",flashvars,params,attributes);
});

function checkMinimumHeight(documentHeight) {
	var documentHeight = documentHeight;
	var pageHeight = $('#pageContainer').height();
	
	if (documentHeight < pageHeight) {
		documentHeight = pageHeight;
	}
	
	return documentHeight;
}
