accounting for when specified dimensions of popup window are larger than the dimensions of the actual screen