Had a question before that was partially solved. I'm having trouble getting just one part of it to work.

preload = new Element('iframe', {
                    'src': URL,
                     'id': mediaId,
                     width: mediaWidth,
                     height: mediaHeight,
                     scrolling : 'no',
                     'frameborder': 0
                preload.style.visibility = 'hidden'; 

So my issue is the preload.style.visibility = hidden.
I'm trying to make it so iframe is hidden until completed. I think Onload is the right command for that. So what is the equivalent to the preload.style.visibility = 'hidden'; line to get it to work? Thanks!

Quick note guys: I found out that my program wasn't updating so the preload.style.visibility = 'hidden'; did actually work. The issue is using an ONLOAD function to make it visible. I don't know how to phrase it.
I know it's preload.style.visibility = 'visible';
But I don't know how I incorporate onload to it

function startEffect() {
//and see if it works the way you need it.
        if (mediaType == "img"){...