function allScores()
{
  var width = (window.innerWidth) ? window.innerWidth : document.body.clientWidth;

  var layer = document.createElement('div');
  layer.style.zIndex = 8;
  layer.id = 'layer';
  layer.style.position = 'absolute';
  layer.style.top = '0px';
  layer.style.left = '0px';
  layer.style.height = document.documentElement.scrollHeight + 'px';
  layer.style.width = width + 'px';
  layer.style.backgroundColor = 'black';
  layer.style.opacity = '0';
  layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=0)");
  document.body.appendChild(layer);  

  var div = document.createElement('div');
  div.style.zIndex = 9;
  div.id = 'box';
  div.style.position = 'absolute';
  div.style.top = '90px';
  div.style.left = (width / 2) - (540 / 2) + 'px'; 
  div.style.height = '450px';
  div.style.width = '540px';
  div.style.backgroundColor = '#6d5331';
  div.style.border = '2px solid white';
  div.style.padding = '5px';
  document.body.appendChild(div);

  var a = document.createElement('a');
  a.innerHTML = '<center><table><tr><td><font size="4">High Scores</font></td></tr></table></center><br />' +
    '<table width="100%" border="0" cellpadding="0" cellspacing="0">' +
    '<tr><td align="center"><iframe src="scores.php" height="360" width="520" marginheight="0" marginwidth="0" scrolling="auto">' +
    '</iframe></td></tr>' +
    '<tr><td colspan="2" align="right">' +
    '<form><table border="0" cellpadding="5" cellspacing="0"><tr>' +
    '<td><button type="button" onClick="closeScores()">&nbsp; OK &nbsp;</button></td></tr></table></form></tr></table>';
  div.appendChild(a);

  document['onkeydown'] = onKeyDownScores;
}
function closeScores() 
{
  document['onkeydown'] = onKeyDownMain;
  document.body.removeChild(document.getElementById('layer'));
  document.body.removeChild(document.getElementById('box'));
}
function onKeyDownScores(e)
{
  var evt = e || window.event;
  if ((evt.keyCode == 13) || (evt.keyCode == 27))
  {
    closeScores();
    return false;
  }
  return true;
}