/* openWindow(href, target) */

var newWindow = null;

function openWindow(href, target, width, height)
{
  var features = 'status,scrollbars,resizable,width=' + width + ',height=' + height;
  if(width && height && screen)
  {
    leftPix = (screen.width - width) / 2;
    topPix = (screen.height - height) / 2;
    features += ',left=' + leftPix + ',screenX=' + leftPix + ',top=' + topPix + ',screenY=' + topPix;
  }
  if(newWindow && !newWindow.closed)
    newWindow.close();
  newWindow = window.open(href, target, features);
  if(newWindow.focus)
    newWindow.focus();
}

