/**
 * The ID of the Flash object.
 */
var FLASH_ID = "flash";

/**
 * Sets the height of the Flash object. If the new height is smaller than
 * the height of the browser window then height of the Flash object will
 * be set to 100%.
 *
 * @param height ( uint )
 *        The new height of the Flash object, in pixels.
 */
function setFlashHeight( height )//:void
{
	var h;

	if( Number( height ) <= getWindowHeight() )
	{
		h = "100%";
	}
	else
	{
		h = height + "px";
	}

	getFlashObject().style.height = h;
}

/**
 * Returns the height of the browser window.
 */
function getWindowHeight()//:uint
{
	if( !isNaN( window.innerHeight ) )
	{
		return window.innerHeight;
	}

	if( document.documentElement && document.documentElement.clientHeight )
	{
		return document.documentElement.clientHeight;
	}

	return document.body.clientHeight;
}

/**
 * Returns the Flash object.
 */
function getFlashObject()//:Object
{
	return document.getElementById( FLASH_ID );
}