I want to position the popup in the center of the screen and 2/3 the size of the screen?

Ive tried this:

w=Math.round(screen.availheight*2/3);
h=Math.round(screen.availwidth*2/3);
t=(screen.availheight/2)-(h/2+5)
l=(screen.availwidth/2)-(w/2+25)
resizeTo(w,h)
moveTo(t,l)

but it came out about half the width of the screen and almost full hieght. It also was positioned in the lower left with the bottom 1/3 off the screen.

Thank you