johnboy: window popt nur einmal auf! warum?

Beitrag lesen

hallo,

ich habe ein js geschrieben, welches die höhe und breite eines bildes auslest eine pop-up erzeugt und jenes fenster an die größe, wiehoch und breit das bild auch immer sein mag, anpasst!
das skript funktioniert auch wunderbar nur kann ich es nur einmal ausführen!!!
wenn ich das popup schliesse und den link ein weiters mal klicke passiert nichts mehr! an was liegt das? weil ich keine *.html/*.php/*.asp site lade sondern nur ein *.jpg?

CODE:
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title></title>
</head>
<script type="text/javascript">

function foto()
{
foto= new Image();
foto.src= "test.jpg";
x= foto.width;
y= foto.height;
//alert(x);
//alert(y);
window.open(foto.src,"Ansicht","width="+x+", height="+y+""");
}

</script>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
<a href="#" onClick="foto()" >ein link</a>
</body>
</html>

danke johnboy