function addFlash( src, width, height, opt )
{
	// default options
	o = {
		classid : 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
		codebase: 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab',
		version: '9,0,124,0',
		id : 'flashObject',
		align : 'middle',
		allowScriptAccess : 'sameDomain',
		allowFullScreen : 'false',
		wmode : 'window',
		menu : 'false',
		quality : 'high',
		bgcolor : '#ffffff',
		FlashVars : '',
		type : 'application/x-shockwave-flash',
		pluginspage : 'http://www.macromedia.com/go/getflashplayer'
	};
	function toAttribute( name, value ) {return ' ' + name + '="' + value + '"';}
	function toParameter( name, value ) {return '<param name="' + name + '" value="' + value + '" />';}
	var oEl = '';
	var pEl = '';
	var eEl = '';
	// input option initalize
	for( var p in opt )
	{
		switch( p.toLowerCase() )
		{
			case 'allowscriptaccess':
				o.allowScriptAccess = opt[p];
				break;
			case 'allowfullscreen':
				o.allowFullScreen = opt[p];
				break;
			case 'flashvars':
				o.FlashVars = opt[p];
				break;
			case 'classid':
			case 'codebase':
			case 'version':
			case 'id':
			case 'align':
			case 'menu':
			case 'quality':
			case 'wmode':
			case 'bgcolor':
			case 'pluginspage':
				o[p] = opt[p];
				break;
		}
	}
	// write object html
	html = '';
	html += '<object';
	html += toAttribute( 'classid', o.classid );
	html += toAttribute( 'codebase', o.codebase + '#version=' + o.version );
	html += toAttribute( 'width', width );
	html += toAttribute( 'height', height );
	html += toAttribute( 'id', o.id );
	html += toAttribute( 'align', o.align );
	html += '>';
	html += toParameter( 'allowScriptAccess', o.allowScriptAccess );
	html += toParameter( 'allowFullScreen', o.allowFullScreen );
	html += toParameter( 'movie', src );
	html += toParameter( 'menu', o.menu );
	html += toParameter( 'quality', o.quality );
	html += toParameter( 'wmode', o.wmode );
	html += toParameter( 'bgcolor', o.bgcolor );
	html += toParameter( 'FlashVars', o.FlashVars );
	html += '<embed';
	html += toAttribute( 'src', src );
	html += toAttribute( 'menu', o.menu );
	html += toAttribute( 'quality', o.quality );
	html += toAttribute( 'wmode', o.wmode );
	html += toAttribute( 'bgcolor', o.bgcolor );
	html += toAttribute( 'width', width );
	html += toAttribute( 'height', height );
	html += toAttribute( 'name', o.id );
	html += toAttribute( 'align', o.align );
	html += toAttribute( 'allowScriptAccess', o.allowScriptAccess );
	html += toAttribute( 'allowFullScreen', o.allowFullScreen );
	html += toAttribute( 'type', o.type );
	html += toAttribute( 'pluginspage', o.pluginspage );
	if( !!o.FlashVars ) html += toAttribute( 'FlashVars', o.FlashVars );
	html += ' />';
	html += '</object>';

	document.write( html );
}