function centerWindow(winStr, w, h) {
 //Sizes window
 if (document.all)
   var xMax = screen.width, yMax = screen.height;
  else
   if (document.layers)
    var xMax = window.outerWidth, yMax = window.outerHeight;
   else
    var xMax = 640, yMax=480;
 var xOffset = parseInt((xMax - w)/2), yOffset = parseInt((yMax - h)/2);
 winStr1="version"
 winStr2='width=' + w + ',height=' + h + ',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+',scrollbars=no'
 window.open(winStr,winStr1,winStr2);
}
<!--hide 

function newwindow() 
{ 
window.open('location.htm','jav','width=450,height=300,resizable=no'); 
} 
//--> 
