/** Flash Resizer, by Øyvind Nordhagen, http://www.oyvindnordhagen.com/blog
  *
  * Resizes Flash content to fit the width and height available in the browser window,
  * while ensuring that the browser window scrolls when available space is less than
  * a specified minimum. Useful for Flash content that should fill the browser completely
  * without cropping content when screen resolution is inadequate for the content to be visible.
  *
  * Include within <head>-tag:
  * <!-- flashResize embed by Øyvind Nordhagen http://www.oyvindnordhagen.com/blog/ -->
  * <script type="text/javascript" src="flashresizer.js"></script>
  *
  * Minimum for body tag:
  * <body onLoad="resizeFlash()" onResize="resizeFlash()">
  *
  * Use as you wish, but leave credits and comments in place.
  */
  
function resizeFlash()
{
	// Enter the name attribute of the object tag used to insert swf. Use quotes"
	var swfName = "resizeExample";
	
	// Enter the swf's original size here, or the size you want to set as the minimum.
	var flashOrigWidth = 900;
	var flashOrigHeight = 600;
	
	// Getting width and height of the viewable area of the page in the browser window.
	var wWindow = document.body.clientWidth;
	var hWindow = document.body.clientHeight;
	
	// Printing window inner width and height to title bar for debugging.
	// document.title = wWindow + " x " + hWindow;
	
	if (wWindow > flashOrigWidth)
	{
		document.all[swfName].width = wWindow;
	}
	else
	{
		document.all[swfName].width = flashOrigWidth;
	}
	
	if (hWindow > flashOrigHeight)
	{
		document.all[swfName].height = hWindow;
	}
	else
	{
		document.all[swfName].height = flashOrigHeight;
	}
}
