// window.js
// February 27, 2004
// {5


/*   spawnWindow

a compatibility wrapper for window.open to open a window and set commonly-used prefs

opens a new window with the options that you specify

ALL options MUST be specified

INPUTS
url				string, location of page to open in the new window
width			number, window width in pixels
height			number, window height in pixels
resizable		boolean
scrollbars		boolean
toolbar			boolean, this has things like Back & Forward buttons
statusbar		boolean, status bar at the bottom of the window
menubar			boolean
locationbar		boolean, text field where you can enter/edit the page URL at top of window

RETURNS
void

CAVEATS
creates a unique window name but doesn't return that value

EXAMPLE USAGE
<a href="javascript: spawnWindow('mypage.html', 640, 480, false, true, false, true, false, false);">open</a>

*/
function spawnWindow (url, width, height, resizable, scrollbars, toolbar, statusbar, menubar, locationbar) {
	var opt = '';
	var now = new Date();
	
	opt += 'width=' + String(width);
	opt += ',height=' + String(height);
	opt += (resizable ? ',resizable' : '');
	opt += (scrollbars ? ',scrollbars' : '');
	opt += (toolbar ? ',toolbar' : '');
	opt += (statusbar ? ',status' : '');
	opt += (menubar ? ',menubar' : '');
	opt += (locationbar ? ',location' : '');
	
	window.open(url, 'win'+String(now.getTime()), opt);
	
	return void(0);  // obviates need for a call to void() in HREF tags
}
