// popup.js - javascript functions for popup windows

// open a popup window with the parameters specified
// link - Web page to load in the popup (xxx.htm)
// width - width of the window to open (optional)
// height - heigth of the window to open (optional)
function OpenPopup(link, width, height)
{	
	// default parameter settings for popup window
	var param='resizable=yes,scrollbars=yes';

	// if width not specified, use % of the screen
	if (!width) {
//		if (screen.width <= 1024)	
			width = screen.width * 0.6;
//		else
//			width = screen.width * 0.6;
	}
	
	// add width to parameter
	param = param + ',width=' + width;
	
	// if left is not specified, center it
//	if (!left)
	var left = (screen.width - width) / 2.0;	
	param = param + ',left=' + left;
	
	// if height not specified, use % of the screen height
	if (!height)
		height = screen.height * 0.8;
	
	// add height to parameter		
	param = param + ',height=' + height;
	
	// if top is not specified, center it accounting for title bar
//	if (!top)
	var top = (screen.height - height) / 2.0 - 20;
	param = param  + ',top=' + top;
	
	// if windowname not defined, make it empty to use default	
//	if (!windowname)
//		windowname='';

// alert(param)
	// open the popup window
	window.open(link, '', param);
	
	// return false to ensure the main browser does not navigate anywhere
	return false;
}
