try changing the following
var newWindow = window.open(myURL, 'windowname', "toolbar=no, location=no,
directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes,
copyhistory=no, width='+w+', height='+h+', top='+top+',left='+left',
screenY='+top+', screenX='+left'");
to the next, since no variables are used, they instead appear literally as top='+top+'
var newWindow = window.open(myURL, 'windowname', "toolbar=no, location=no,
directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes,
copyhistory=no, width=" + w + ", height=" + h + ", top=" + top + ",
left=" + left + ", screenY=" + top + ", screenX=" + left);
also you may notice that the color of the variables is returned and does not blush to indicate text like the original.
Class
source
to share