/* This file contains common JavaScript utilities for the HealthPartners web site */

/** Function: invokePopup
 *
 *	- Popups are appropriate for small amounts of ancillary information...
 *	- Always display popups smaller than the parent window, so that the user knows it's a different window.
 *	- The address bar, status bar, standard buttons, and resize handle should be visible and functional
 *	  (unless there is a compelling reason to deviate.)
 *	- There should always be a "Close Window" link in the bottom center.
 */
function invokePopup(url, width, height, windowname) {
	var options = "addressbar=yes,menubar=no,resizable=yes,toolbar=yes,scrollbars=auto";
	if (width > 0) options += ",width="+width;
	if (height > 0) options += ",height="+height;
	var x = window.screenLeft + 20, y = window.screenTop + 40;
	options += ",screenLeft="+x+",screenTop="+y;
	var popup = window.open("about:blank", windowname, options);
	popup.document.open("text/html");
	popup.document.writeln("<frameset rows=\"*,24\" frameborder=\"0\" border=\"0\"><frame src=\""+url+"\" scrollbars=\"auto\"/><frame src=\"/close.html\" scrollbars=\"no\"/></frameset>");
	popup.document.close();
}