
// pop centered window
function newWindow(URL,pageName,w,h,scroll,resize,toolbar)
 {
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+resize+',toolbar='+toolbar+''
  win = window.open(URL,pageName,settings)
 }
 
// pop centered window full screen 
function newFullWindow(URL,pageName,w,h,scroll,resize,toolbar)
 {
  LeftPosition = 0;// (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = 0; // (screen.height) ? (screen.height-h)/2 : 0;
  
  settings = 'height='+screen.height+',width='+screen.width+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+resize+',toolbar='+toolbar+''
  win = window.open(URL,pageName,settings)
 }
/* use this code to call the script
<script language="JavaScript" type="text/javascript" src="/js/pop_win.js"></script>
<a href="#" onClick="newWindow('untitled.html','PageName','600','400','yes','yes','yes')">Link/Image or OnLoad</a>*/