Will this code work to replace alternate content with a SWF?

Hello,

I am trying to show alternate content to the user if they don’t have Flash player. Will this work?

The HTML code.


<script type="text/javascript"> 
loadSwfToDiv("c2/data/sld10.swf", "c2",600,500)
</script> 

<div id="c2"><img src="images/sunset.jpg"></div>

The external JS code.


function loadSwfToDiv(swf_url, div_id, ww, hh)
{
 var flashvars = {};
 var params = {};
 params.wmode = "transparent";
 var attributes = {};
 swfobject.embedSWF(swf_url, div_id, ww , hh, "9.0.0", false, flashvars, params, attributes);
}