function lwPopupWindow(url, width, height, options) {
	
	var xMax = 800;
	var yMax = 600;
	
	if (screen) {
		
		xMax = screen.width;
		yMax = screen.height;
		
	} else if (document.layers) {
		
		// NN 4 support
		xMax = window.outerWidth;
		yMax = window.outerHeight;
		
	}
	
	var xOffset = (xMax - width)/2;
	var yOffset = (yMax - height)/2;
	
	var str = 'width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+(yOffset-30)+',left='+xOffset+''
	
	if (options) {
		str += ','+options;  
	}
	
	// close popup window if already exists
	if (window && window._popupWindow) {
		window._popupWindow.close();
	}
	
	window._popupWindow = window.open(url, '_popupWindow', str); 
	
	if (window._popupWindow) {
		window._popupWindow.focus();
	}
	
	return window._popupWindow ? false : true;
}