Can anyone help me... I have a website with two frames, and the page provided the frames has javascript that needs to add a div element containing an image into the first frame.

I'm no DOM expert, but can anyone help me out? Here's what I have so far... Unfortunately the javascript has to be part of the page that is creating the frames and not from within one of the framed pages itself.

Code JavaScript:
var snDiv = window.document.createElement('div');
   	snDiv.setAttribute('id', snID);
    snDiv.style.position = "absolute";
	snDiv.style.left = var1;
   	snDiv.style.top = var2;
   	snDiv.style.backgroundColor = "#ff0000";
   	snDiv.style.border = "1px solid #000000";
	snDiv.innerHTML = "<img src='admin/blah.gif' border='0'>";
   window.document.body.appendChild(snDiv);