Hi i've currently got a button that pops up inside a hidden div. It shows an animated gif however for some reason a javascript function provided by an mp3 player is stopping the gif from animating in internet explorer. Is there a way to add a flash item instead using javascript?

My code currenlyt is:
Code:
function toggleLayer(url, mp3, title)
    {       
	    var txtBox = document.getElementById('box');
		
	    wimpy_loadAndPlay(mp3,  '', title, '', '');
	    
	    var trackCut = 1;
	
	    var newLink=document.createElement('a');
	        newLink.setAttribute('href', url);
	        newLink.className='dl';
	    
		var previewimage='./images/dl-now.gif';
		        
	    var newimg=document.createElement('img');
	    newimg.src=previewimage;
	    newLink.appendChild(newimg);
	
	    if (txtBox.style.display != 'none')
	    {
	        txtBox.style.display = 'block';
	        txtBox.innerHTML = "";
	        txtBox.appendChild(newLink);
	        return false;
	
	    }
	    else
	    {
	        txtBox.style.display = 'block';
	        txtBox.innerHTML = "";
	        txtBox.appendChild(newLink);
	        return false;
	    }
	    return false;
    }
so what i basically want to do is replace

var previewimage='./images/dl-now.gif';
var newimg=document.createElement('img');

with:

var previewimage='./images/myflash.swf;
var newimg=document.createElement('embed');

< sorry as i've been writing this i tested the embed method and it seems to work only thing that's not happening is the link is there a way to attach a html link to a flash file with my above code?

Many thanks