var Window = Class.create({

  initialize: function (windowObject)
  {
    this.windowObject = windowObject;
  },

  open: function(name, url, w, h, scroll, resize)
  {
    leftPosition = screen.width ? (screen.width - w) / 2 : 100;
    topPosition = screen.height ? (screen.height - h) / 2 : 100;
    settings = 'width='+w+',height='+h+',top='+topPosition+',left='+leftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable='+resize;
    return this.windowObject.open(url, name, settings);
  },

  refreshOpener: function ()
  {
    if (this.windowObject.opener) {
      this.windowObject.opener.location.reload();
    }
  },
  urlOpener: function(href)
  {
    if (this.windowObject.opener) {
      this.windowObject.opener.location.href = href;
    }
  },

  back: function ()
  {
    this.windowObject.history.back();
  },

  close: function ()
  {
    this.windowObject.close();
  }
});

var windowObject = new Window(window);
