function $(id) { return document.getElementById(id); }

YAHOO.util.Event.onDOMReady(resizeFlash);
YAHOO.util.Event.on(window, "resize", resizeFlash);

function resizeFlash() {

	var flashWidth = YAHOO.util.Dom.getViewportWidth() - 20;
	var viewHeight = YAHOO.util.Dom.getViewportHeight();
	
	if (flashWidth > 780) flashWidth = 780;
	if (flashWidth < 520) flashWidth = 520;
	
	flashHeight = flashWidth * 0.718;
	
	if ((flashHeight + 40) > viewHeight)
	{
		flashHeight = viewHeight - 40;
		
		if (flashHeight > 560) flashHeight = 560;
		if (flashHeight < 373) flashHeight = 373;
		
		flashWidth = flashHeight / 0.718;
	}

	$("flash").style.width = flashWidth + "px";
	$("flash").style.height = flashHeight + "px";

	$("flashWrapper").style.marginTop = (viewHeight - flashHeight) / 2 + "px";
	$("flashWrapper").style.width = flashWidth + "px";
	$("flashWrapper").style.height = flashHeight + 20 + "px";
	$("flashWrapper").style.display = "block";
}
