var FlashWidth = 990 ;
var FlashHeight = 640 ;
var WrapID = "flash-alternate" ;

function getBrowserWidth( )
{
	if ( window.innerWidth )
	{
		return window.innerWidth ;
	}
	else if ( document.documentElement && document.documentElement.clientWidth != 0 )
	{
		return document.documentElement.clientWidth ;
	}
	else if ( document.body )
	{
		return document.body.clientWidth ;
	}
	return 0 ;
}

function getBrowserHeight( )
{
	if ( window.innerHeight )
	{
		return window.innerHeight ;
	}
	else if ( document.documentElement && document.documentElement.clientHeight != 0 )
	{
		return document.documentElement.clientHeight ;
	}
	else if ( document.body )
	{
		return document.body.clientHeight ;
	}
	return 0 ;
}

function setWrapWidth( WrapWidth )
{
	FlashWidth = WrapWidth ;
	setFlaArea( ) ;
}

function setWrapHeight( WrapHeight )
{
	FlashHeight = WrapHeight ;
	setFlaArea( ) ;
}

function setWrapSize( WrapWidth, WrapHeight )
{
	FlashWidth = WrapWidth ;
	FlashHeight = WrapHeight ;
	setFlaArea( ) ;
}

function setWrapID( IDName )
{
	WrapID = IDName ;
}

function setFlaArea( )
{
	var WrapFlashElement = document.getElementById( WrapID ) ;

	if ( getBrowserWidth( ) > FlashWidth )
	{
		WrapFlashElement.style.width = "100%" ;//"auto" ;
	}
	else
	{
		WrapFlashElement.style.width = FlashWidth + "px" ;
	}

	if ( getBrowserHeight( ) > FlashHeight )
	{
		WrapFlashElement.style.height = "100%" ;//"auto" ;
	}
	else
	{
		WrapFlashElement.style.height = FlashHeight + "px" ;
	}
}

window.onresize = setFlaArea ;