If worst comes to worst, you could always solve the problem by putting the <object> and adjacent <img> into <div>s that you specify the positions of.
Something like this:
Code:
<div style="position: relative; width: 100%;>
<div style="position: relative; width: 50%; text-align: right;">
<object style="width: 80%; margin-right: 5px;" ...>
</div>
<div style="position: relative; width: 50%; text-align: left;">
<img style="width: 80%; margin-left: 5px;" ...>
</div>
</div>
THat's just a stab in the dark. Play with it. But in any case, it's clearly nothing to do with JavaScript.