/** * SWFForceSize v1.0: Flash container size limiter for SWFObject - http://blog.pixelbreaker.com/ * * SWFForceSize is (c) 2006 Gabriel Bucknall and is released under the MIT License: * http://www.opensource.org/licenses/mit-license.php * * Dependencies:  * SWFObject v2.0 - (c) 2006 Geoff Stearns. * http://blog.deconcept.com/swfobject/ */function SWFForceSize( swfObject, minWidth, minHeight, marginHorizontal , marginVertical){	this.div = swfObject.getAttribute('id');	this.minW = (minWidth == null) ? 0 : minWidth;	this.minH = (minHeight == null) ? 0 : minHeight;	this.padH = (marginHorizontal == null) ? 0 : marginHorizontal;	this.padV = (marginVertical == null) ? 0 : marginVertical;		this.addWindowEvent( 'onload', this, this.onLoadDiv );	this.addWindowEvent( 'onresize', this, this.onResizeDiv );}SWFForceSize.prototype = {	addWindowEvent: function( eventName, scope, func )	{		var oldEvent = window[ eventName ];		if (typeof window[ eventName ] != 'function') window[ eventName ] = function(){ func.call( scope ); };		else		{			window[ eventName ] = function()			{ 				if( oldEvent ) oldEvent();				func.call( scope );			}		}			},	getWinSize: function()	{		var winH, winW;		winW = document.body.clientWidth;		winH = document.body.clientHeight;		return { height: winH, width: winW };	},		onResizeDiv: function(repeat)	{		var winSize = this.getWinSize();		var w = winSize.width < this.minW? this.minW : winSize.width;		var h = winSize.height < this.minH? this.minH : winSize.height;		h -= this.padV;		w -= this.padH;		/*		 for IE on PC, turn off the disabled scrollbar 		 on the right when there's no content to scroll		*/		if (navigator.appVersion.indexOf("MSIE") != -1) {			document.body.scroll = (winSize.width < this.minW || winSize.height < this.minH)? "auto" : "no";		}		document.getElementById( this.div ).style.width = w+"px";		document.getElementById( this.div ).style.height = h+"px";		if (!repeat) this.onResizeDiv(true); //This aids safari and firefox when scrollbars appear to correctly calculate clientSize.	},		onLoadDiv: function() //not used;	{		if (navigator.appVersion.indexOf("MSIE") != -1) {			document.body.scroll = "no";		}		this.onResizeDiv();	}}
