function PopUp(url,w,h,resiz,scrolls) { 
var w_avail = screen.availWidth; 
var h_avail = screen.availHeight; 
var top = Math.round ((h_avail - h) * .5); 
var left = Math.round ((w_avail - w) * .5); 
// You have to use math.round in Safari because Safari will report odd numbers as availWidth and availHeigth. It subtracts the Dock and Menubar values from the real screen resolution. And if you multiply these values by .5 you'll end up with decimals. window.open wont't work with decimals as top/left values. 

var newWin = window.open(url,newWin,'width=' + w +',height=' +h + ',left=' + left + ',top=' + top + ',resizable=' + resiz + ', scrollbars=' + scrolls + ''); 
newWin.focus(); 
}