Pop up window + scroll bars

I’m making a website which launches a pop-up window. the window size is 1024 x 768 - therefore when viewing with a lower resolution screen, part of the window is cut off and not visible. I can add scrollbars to fix this problem when viewing on a low res screen. However, how do i get the window to pop up so that the scroll bars only appear when the window size is too small?

this is the code that i have in the html file:

OpenWin = this.open(page, “main”, “toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=1024,height=768”);

Many thanks!!!