﻿﻿/*
	Flash Container Resizer - v2.0
	------------------------------------------------------------
	
	Created					September 14, 2005
	Last Updated			September 17, 2011
	
	AUTHOR(s)				Bill Mackin
	DESCRIPTION				Collection of methods to resize the div holding the Flash content at runtime.
	
	Copyright © 2005 Pixlart.
	This "Pixlart Code" is subject to the terms of the Pixlart Source Code License Agreement.  To download a copy of this license, go to http://www.pixlart.net/pixlart_source_code_license.pdf

	http://www.pixlart.net
	info [at] pixlart [dot] net
*/



//  USAGE
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
/*
	1.	Import code to HTML --- <script src="js/flash-container-resizer.js" type="text/javascript" charset="utf-8"></script>
	2.	Import code to Flash --- import FlashContainerResizer.as;
	3.	Use the API in FlashContainerResizer.as.
*/
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////

//  NOTES
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
/*
	1.	Safari 5.1 on OS X Lion shows a jump when resizing.
	2.	Passing the div id is not required.
*/
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////


function setFlashWidth(divid, newW){
	document.getElementById(divid).style.width = newW+"px";
}

function setFlashHeight(divid, newH){
	document.getElementsByTagName("object")[0].style.height = newH+"px";
	/*document.getElementById(divid).style.height = newH+"px";*/	
}

function setFlashSize(divid, newW, newH){
	setFlashWidth(divid, newW);
	setFlashHeight(divid, newH);
}
