If you are already using jQuery, you could take adventage of it to produce a smaller snippet
A jQuery version of Andrew's answer:
var $idown; // Keep it outside of the function, so it's initialized once.
downloadURL : function(url) {
if ($idown) {
$idown.attr('src',url);
} else {
$idown = $('