function newwindowOpner(url, name, args) {
	newwindow=window.open(url,name,args);
	/*if (window.focus) {newwindow.focus()}
	return false;*/
}


/* <A HREF="javascript:newwindow()" >Click Here!</A> 

window.open('url to open','window name','attribute1,attribute2') 

This is the function that allows you to open a new browser window for the viewer to use. Note that all the names and attributes are separated with a comma rather than spaces. Here is what all the stuff inside is: 

1.	'url to open'
This is the web address of the page you wish to appear in the new window. 
2.	'window name'
You can name your window whatever you like, in case you need to make a reference to the window later. 
3.	'attribute1,attribute2'
As with alot of other things, you have a choice of attributes you can adjust. 


Window Attributes 
1.	width=300
Use this to define the width of the new window. 
2.	height=200
Use this to define the height of the new window. 
3.	resizable=yes or no
Use this to control whether or not you want the user to be able to resize the window. 
4.	scrollbars=yes or no
This lets you decide whether or not to have scrollbars on the window. 
5.	toolbar=yes or no
Whether or not the new window should have the browser navigation bar at the top (The back, foward, stop buttons..etc.). 
6.	location=yes or no
Whether or not you wish to show the location box with the current url (The place to type http://address). 
7.	directories=yes or no
Whether or not the window should show the extra buttons. (what's cool, personal buttons, etc...). 
8.	status=yes or no
Whether or not to show the window status bar at the bottom of the window. 
9.	menubar=yes or no
Whether or not to show the menus at the top of the window (File, Edit, etc...). 
10.	copyhistory=yes or no
Whether or not to copy the old browser window's history list to the new window. 

All right, here's an example code for opening a new window: 
<FORM> 
<INPUT type="button" value="New Window!" onClick="window.open('http://www.pageresource.com/jscript/jex5.htm','mywindow','width=400,height=200')"> 
</FORM> 

Closing a New Window 
Hmm.....what's with the "Close Window" button you saw in the new window? How does one do do that? To use that trick, use the window.close() function in the HTML of the new window. Just put this code wherever you want the close button to show up in the new window: 
<FORM> 
<INPUT type="button" value="Close Window" onClick="window.close()"> 
</FORM> 
Of course, the window can be closed with the "x" symbol on the top-right of the window as well. 
Set the Window Position 
There is another set of options you can use to set the position of the new window on the viewers, but it only works with NS4+ and IE4+: 
1.	screenX=number in pixels
Sets the position of the window in pixels from the left of the screen in Netscape 4+. 
2.	screenY=number in pixels
Sets the position of the window in pixels from the top of the screen in Netscape 4+. 
3.	left=number in pixels
Sets the position of the window in pixels from the left of the screen in IE 4+. 
4.	top=number in pixels
Sets the position of the window in pixels from the top of the screen in IE 4+. 
Great, but how do you decide which commands to use if there are different ones for each browser? In this case, you can use both sets of commands- the browser will ignore the set it does not recognize. The example below will give you a new window 0 pixels from the left and 100 pixels from the top of your screen: 
<FORM>
<INPUT type="button" value="New Window!" onClick="window.open('jex5.htm','mywindow','width=400,height=200,left=0,top=100,screenX=0,screenY=100')"> 
</FORM> 

Using Link Tags with JavaScript
I get this question so much, I figured I'd better get in gear and write another section to address using the link tag for javascripts (such as new windows), rather than using the old grey button. Well, there are a couple of ways to do this. I'll start with the easier to understand version first. 
The first method is to access a javascript function within the HREF attribute of your link tag. So, if you want to link to another page, you normally write: 
<A HREF="nextpage.htm">Click here</A> 
Well, you can access a javascript function you have written instead by writing the link this way: 
<A HREF="javascript:myfunction()">Click Here</A> 
Yes, now you can open that new window without using the grey button. Here is a script to give you the new window: 
First, I found that this works much better if you create your own function in the head section first. All this function needs to do is open your new window. So, in your head section, create a function like this: 
<HEAD> 
<SCRIPT language="JavaScript"> 
<!--hide 

function newwindow() 
{ 
window.open('jex5.htm','jav','width=300,height=200,resizable=yes'); 
} 
//--> 
</SCRIPT> 
The above script will open my "jex5.htm" page in a new window. As you know, replace this with url of the page you wish to open, and adjust the other attributes to your liking. If you need to know more about the window.open function, see the Opening a New Window tutorial and learn that first.....then come back and get going with the rest of this section. 
Now go into your body section to wherever you want the link to appear, and write your link tag this way: 
<A HREF="javascript:newwindow()" >Click Here!</A> 
Now you will get a link like the one below. Give it a try and see the new window appear when you click the link! 
Click Here! 
For those of you who want to use an image for the link, just do the normal "image inside the link tag" trick, but with the link tag modified for javascript like above: 
<A HREF="javascript:newwindow()" ><IMG SRC="scare.jpg" border="0"></A> 
Now you can click on the image below for a new window! 
 
The second way to do this is a little more difficult, but some people may be more comfortable with it. The trick is to go ahead and use the onClick=" " attribute in your link tag. The trick here is to keep the browser from following the actual link after running your script. Here is a sample of using the onClick attribute in the link tag: 
<A HREF="newpage.htm" onClick="newwindow();return false">Click Here!</A> 
I used the same script we had written in the head section for the first method, but I used it inside the onClick=" " command. Also notice the semicolon after the function call, and the "return false" at the end of the command. The return false part keeps the browser from going to "newpage.htm" after opening your new window. You could put any page here you want, and the link will no longer take you there (except in some older browsers). So you don't really have to put an actual url in the HREF attribute here unless you wish to offer an alternative for those with older browsers that don't recognize the onClick=" " command. As in the above example, you can also use an image inside your link tag to make a clickable image. Below is an example link where I used this second method: 

*/