<html>
<head>
<script type="text/javascript">
function click()
{
    var event = document.createEvent('MouseEvent');
    event.initEvent('click', true, true);
    document.getElementById('link').dispatchEvent(event);
    window.close();
}
</script>
</head>
<body onload="click()">
<a id="link" href="target-frame-from-window-end.html" target="test">Click Here</a>
This is a popup.
</body>
</html>
