function openPopup(url, width, height) { /* open and center a popup window */ var sw = screen.width; var sh = screen.height; var left = sw / 2 - width / 2; var top = sh / 2 - height / 2; var win = window.open(url, 'someWindow', 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top); return win; };