// XXX looks like a constructor?
function Account()
{
  var sl = -1;
}

Account.prototype.refresh = function()
{
  var updater = new Ajax('/ajax/accountLevel.php');
  updater.makeRequest(this.updateCallback, {});
}

Account.prototype.updateCallback = function( resp )
{
  var obj;
  try
  {
    obj = eval( '(' + resp + ')' );
  }
  catch(ex)
  {
    alert(ex);
    return;
  }
  if(obj['level'])
  {
    this.sl = obj['level'];
    gAccount.sl = obj['level'];
  }
}

var gAccount = new Account;


  