
function ensurePopupVisibility() {
	var wicketWindow = Wicket.Window.current;

	if (wicketWindow.window.offsetHeight > Wicket.Window.getViewportHeight()) {
		wicketWindow.content.style.height = (Wicket.Window.getViewportHeight() - 50) + "px";
	}
	if (wicketWindow.window.offsetWidth > Wicket.Window.getViewportWidth()) {
		wicketWindow.window.style.width = (Wicket.Window.getViewportWidth() - 50) + "px";
	}	
	wicketWindow.center();
}
