<HTML>
<HEAD>
<TITLE>New Window</TITLE>
<script LANGUAGE="JavaScript">
var newWindow
function makeNewWindow() {
if (!newWindow || newWindow.closed) {
newWindow = window.open("","","status,height=200,width=300")
if (!newWindow.opener) {
newWindow.opener = window
}
v = newWindow.opener.form0.name.value
// force small delay for IE to catch up
setTimeout("writeToWindow(v)", 50)
} else {
// window's already open; bring to front
newWindow.focus()
}
}
function writeToWindow(v) {
// assemble content for new window
var newContent = "<HTML><HEAD><TITLE>One Sub Window</TITLE></HEAD>"
newContent += "<BODY><H1>This window is brand new.</H1>"
newContent += "<FORM name=form0>"
newContent += "<input type=text name=name" + " value='" + v +"'>"
newContent += "<INPUT TYPE=button NAME=newOne VALUE='Submit'>"
newContent += "</FORM>"
newContent += "</BODY></HTML>"
// write HTML to new window document
newWindow.document.write(newContent)
newWindow.document.close() // close layout stream
}
</SCRIPT>
</HEAD>
<BODY>
<FORM name="form0">
<input type="text" name="name">
<INPUT TYPE="button" NAME="newOne" VALUE="Create New Window"
onClick="makeNewWindow()">
</FORM>
</BODY>
</HTML>