<html>
<head>
<title>Javascript examples</title>
<script language="javascript">
<!--
function CloseWindow() {
window.close();
}
function CloseAndNewPage() {
window.close();
opener.location.href = "http://www.java2s.com";
}
//-->
</script>
</head>
<body bgcolor="#ffffff" text="#000000">
This is a new Window<br>
<br>
<a href="javascript:CloseWindow()">Close This Window</a><br>
<br>
<a href="javascript:CloseAndNewPage()">Close This Window And Open This Document in Original Window</a>
</body>
</html>