// $Header: /HBI Websites/_client_common/js/popup_window.js 7     5/05/03 13:26 Matthew.van.eerde $

// usage:
// 1. from an <a>,
//  specify target="_blank"
//  specify href="whatever"
//  specify onclick="return !popup_window(whatever, 100, 50);"
//
// the return above allows the href to fire if the popup_window fails
// (say, if popup blocking is turned on)
//
// or
// 2. from an onload,
//  specify onload="popup_window(whatever, 100, 50);"

function popup_window(
	URL, 
	width, 
	height, 
	options
)
{	var features;
	var the_window;
	
	if (options == "")
	{
		features =
			"width=" + width + ", " +
			"height=" + height + ", " +
			"toolbars=no, " +
			"titlebar=no, " +
			"menubar=no, " +
			"directories=no, " +
			"resizable=no, " +
			"status=no, " +
			"scrollbars=no";
	}
	else
	{			
		features = 
			"width=" + width + 
			", height=" + height +
			", " + options;
	}
	
	the_window = window.open(
		URL,
		"_blank",
		features
	);

	return the_window;
}