Changing swf file with date. code not working

Ok i have a flash file for every day of the month and would like to have some javascript that changes the file rather than update the html everyday.

This is what i have and it’s not working for some reason. any help is greatly appreciated.

<script language=“JavaScript”>
var now = new Date();
var daynum = now.getDate();
document.write(’<param name=“movie” value="/image/tree_0’ + daynum + ‘.swf">’);
</script>

and

<script language=“JavaScript”>
var now = new Date();
var daynum = now.getDate();
document.write(’<embed wmode=“transparent” src"/image/tree_0’ + daynum + ‘.swf" quality=“high” pluginspage=“http://www.macromedia.com/go/getflashplayer” type=“application/x-shockwave-flash” width=“390” height=“431”>’);
</script>