/*>

//_______________________________________________________________________________________________________

parameter formats :

path:String(path/filename.swf)
id:String(id & name)
version:Number(5 | 6 | 7 | 8)
width:Number(movie width)
height:Number(movie height)

//_______________________________________________________________________________________________________

optional parameters:

quality:String(low | medium | high | autolow | autohigh | best)			[default:high]
scaleMode:String(exactFit | showAll | noBorder | noScale)				[default:showAll]
menu:Boolean(true | false)									[default:true] 
wmode:String(Window | Opaque | Transparent)						[default:Window] [object tag only]
bgcolor:String(#efefef)											[default:no defaults] 
value:String(myURL=http://weblogs.macromedia.com/ | myValue=10)	[default:no defaults] 

//_______________________________________________________________________________________________________

examples optional parameters:

flashObject('./flash/FileCenter.swf', 'FileCenter', '750', '320');						[all optional parameters set default]
flashObject('./flash/FileCenter.swf', 'FileCenter', '750', '320', 'best');					[quality set best]
flashObject('./flash/FileCenter.swf', 'FileCenter', '750', '320', '', 'noScale');				[scaleMode set noScale]
flashObject('./flash/FileCenter.swf', 'FileCenter', '750', '320', '', '', 'false');				[menu set false]
flashObject('./flash/FileCenter.swf', 'FileCenter', '750', '320', '', '', '', 'Transparent'); 		[wmode set transparent]
flashObject('./flash/FileCenter.swf', 'FileCenter', '750', '320', '', '', '', '', '#efefef'); 			[bgcolor set white]
flashObject('./flash/FileCenter.swf', 'FileCenter', '750', '320', '', '', '', '', '', 'myValue=10');	[FlashVars set myValue=10]

//_______________________________________________________________________________________________________

example function call in html body:

<script type="text/javascript">

	flashObject('./flash/FileCenter.swf', 'FileCenter', '8', '750', '320', 'best')

</script>

//_______________________________________________________________________________________________________

<*/

flashObject = function(path, id, version, width, height, quality, scaleMode, menu, wmode, bgcolor, value){

	var flashObjectTag = '';
	
	flashObjectTag = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
	flashObjectTag += 'codebase="http://fpdownload.macromedia.com/pub/shockwave/';
	flashObjectTag += 'cabs/flash/swflash.cab#version=' + version + ',0,0,0" ';
	flashObjectTag += 'width="' + width + '" height="' + height + '" id="' + id + '" align="middle">';
	
		flashObjectTag += '<param name="allowScriptAccess" value="sameDomain" />';
		flashObjectTag += '<param name="movie" value="' + path + '" />';
		
		if(value){
			flashObjectTag += '<param name="FlashVars" value="' + value + '">';
			var flashvars = 'FlashVars="' + value + '"';
		}
		if(quality){
			flashObjectTag += '<param name="quality" value="' + quality + '" />';
			var embedQuality = ' quality="' + quality + '"';
		}
		if(scaleMode){
			flashObjectTag += '<param name="scale" value="' + scaleMode + '" />';
			var embedScale = ' scale="' + scaleMode + '"';
		}
		if(wmode){
			flashObjectTag += '<param name="wmode" value="' + wmode + '" />';
			var embedWmode = ' wmode="' + wmode + '"';
		}
		if(bgcolor){
			flashObjectTag += '<param name="bgcolor" value="' + bgcolor + '" />';
			var embedBgcolor = ' bgcolor="' + bgcolor + '"';
		}
		
		flashObjectTag += '<embed src="' + path + '"' + flashvars + embedQuality;
		flashObjectTag += embedScale + embedWmode + embedBgcolor + '" width="';
		flashObjectTag += width + '" height="' + height + '" name="' + id + '" align="middle"';
		flashObjectTag += 'allowScriptAccess="sameDomain" type="application/x-shockwave-flash"';
		flashObjectTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	
	flashObjectTag += '</object>';
				
	document.write(flashObjectTag);	

};
