// Original: Eric King (http://redrival.com/eak/)
// Modifications: Ryan Martinsen (http://blog.ryanware.com/)

function popupWindow(url, name, w, h, x, y, return_win) {
   if (!w) w = 545;
   if (!h) h = 445;
   if (!x) x = 50;
   if (!y) y = 50;

   winprops = 'toolbar=no,location=no,' +
    'directories=no,status=no,menubar=no,scrollbars=yes,' +
    'resizable=yes,copyhistory=no,width='+w+',height='+h+',' +
    'screenX='+x+',screenY='+y+',top='+x+',left='+y
   win = window.open(url, name, winprops)
   if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
   if(return_win == true) {
      return win;
   }
   else {
      return false;
   }
}
