// open a new 'pop-up' window
function pop_window(newLoc, newWidth, newHeight, xCoord, yCoord) {
  var options =  "toolbar=no,";
      options += "location=no,";
      options += "directories=no,";
      options += "dependent=yes,";
      options += "alwaysRaised=yes,";
      options += "status=yes,";
      options += "scrollbars=yes,";
      options += "menubar=yes,";
      options += "copyhistory=0,";
      options += "resizable=no,";
      options += "height=" + newHeight + ",";
      options += "width=" + newWidth + ",";
      options += "left=" + xCoord + ",";
      options += "top=" + yCoord + ",";
      options += "screenX=" + xCoord + ",";
      options += "screenY=" + yCoord;
  win = window.open("",newLoc,options);
  if (win.window.focus) {
    win.window.focus();
  }
}

function playerWindow(loc) {
  centeredWindow(loc, 215,320);
}



function centeredWindow(newLoc, newWidth, newHeight) {

  newXCoord = (screen.width) ? (screen.width-newWidth)/2 : 0;
  newYCoord = (screen.height) ? (screen.height-newHeight)/2 : 0;

  this.pop_window(newLoc, newWidth, newHeight, newXCoord, newYCoord);
}      

function closePlayer() {
  window.close();
}