I was curious to this myself so here is what I quickly came up with
<html>
<head>
<script type="text/javascript" language="javascript">
var mywin;
function loadme()
{
mywin=window.open('php.php',Math.round(Math.random() * 100) + 'win');
}
window.onunload = function()
{
mywin.close();
}
</script>
</head>
<body onload="loadme()">
herro
</body>
</html>