// Generate code to embed Flash movie.
// Arguments are
//	Movie URL
//	Object attributes (generally width & height)
//	Background color
function runFlash(movie, attr, bgcolor, opacity)
{
 var codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
 var pluginspage = 'http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash';

 var flashvars = '';
 var parsed = movie.split('?');
 if (parsed.length > 1) {
  movie = parsed[0];
  flashvars = parsed[1];
 }

 document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
 document.write(' codebase="' + codebase + '" ' + attr + '>\n');
 document.write('<param name="movie" value="' + movie + '" />\n');
 document.write('<param name="quality" value="high">\n');
 document.write('<param name="bgcolor" value="' + bgcolor + '">\n');
 document.write('<param name="wmode" value="' + opacity + '">\n');
 if (flashvars) document.write('<param name="FlashVars" value="' + flashvars + '">');
 document.write('<embed src="' + movie + '" quality="high" bgcolor="' + bgcolor + '" ' +
                  attr + 'type="application/x-shockwave-flash"' +
		  (flashvars? (' flashvars="' + flashvars + '"') : '') +
                  ' pluginspage="' + pluginspage + '">\n');
 document.write('</object>\n');
}
