Add attributes to embed tag?

Add attributes to embed tag?

I have a page with about 5 embedded videos, which look like this:
  1. <embed type="application/x-shockwave-flash" width="400" height="225" src="http://vimeo.com/moogaloop.swf?clip_id=4505537&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed>
I need to dynamically add the attribute wmode="opaque" to all embed tags.

I tried this, but it didn't work:
  1. $j('embed').attr('wmode','opaque');
I've also been looking at SWFObject, and tried the following, but couldn't get it to work either:                  
  1. var so = new SWFObject($j('embed').attr("src"), "flash-video", $j('embed').attr("width"), $j('embed').attr("height"), "8", "#000000");
  2. so.addParam("wmode", "opaque");
  3. so.write('embed');
Any help figuring this out would be greatly appreciated... Thanks!