Using ActionScript to call JS

I’m trying to replace a static jpeg banner on my site with a dynamic flash banner. I’m running into problem getting the link, which is a JS call, to work inside the flash movie.

The JS code is called to the page with external link, something like this:

<script type="text/javascript" src="../js/link.js">

then the link around the current banner is something like this:

<a href="#" onClick="return EPCM.doNavigate('long.url');">jpeg banner</a>

So is it possible to write an ActionScript code that will replace the href above? If so, can you please give me an idea of what it will look like.

thanks,

Andrew