Correct way to document.write a flash movie? A work around for the IE active conten

Hey all,
Ive been told to try a javascript document.write solution for the IE active content issue.

I am trying:

<script type=“text/javascript” language=“javascript”>
document.write(’<object classid=“clsid27CDB6E-AE6D-11cf-96B8-444553540000” codebase="[URL=“http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0”]http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width=“785” height=“330”>’);
document.write(’<param name=“movie” value=“images/final_portfolio.swf?’+<%response.write qs%>+’”>’);
document.write(’<param name=“quality” value=“high”>’);
document.write(’<embed src=“images/final_portfolio.swf?’+<%response.write qs%>+’” quality=“high” pluginspage=“http://www.macromedia.com/go/getflashplayer” type=“application/x-shockwave-flash” width=“785” height=“330”></embed>
</object>’)
</script>

But obviously I am not writing it incorrectly as I dont get anything on screen. I have also tried setting it in a function and calling the function, what am I doing wrong there? Im no JS expert.

Any help would be great.