i am new to javascript
plz help me with this ......

i wrote a small javascript in which it opens a new window with some target link .then tries to get some images present in the new window,then append them in to present window.but im getting some problem with it im adding the code here,please tell me where i did mistake .

<body>
<div id="mydiv">
<script>
var myWindow = window.open("http://www.santabanta.com/wallpapers/rating.asp?catid=401267","windowName","resizable=yes");
setTimeout("Func1()", 5000);
var getvalue=myWindow.document.getElementById("wall").getAttribute("src");

var elem = document.createElement("img");
elem.setAttribute("src", getvalue);
elem.setAttribute("height", "40");
elem.setAttribute("width", "120");
document.getElementById("mydiv").appendChild(elem);
myWindow.close();
function Func1()
{
alert("Delayed 3 seconds");
}
</script>
</div>
</body>

i just made it a html file and trying to open in my browser

.......thnx in advance