function PopUp(_name, _features) {
/**
* Generic popup class
* Don't forget to add target="_blank" to your links to support non javascript browsers
*
* @author       Jaco Vermeulen
*/
  var _self   = this;
  var _window = false;
  window.name = "mainWindow";

  if(window.attachEvent) {
    window.attachEvent("onunload", _closeWindow);
  } else {
    window.addEventListener("unload", _closeWindow, false);
  }
  function _closeWindow() {
    if (_window) _window.close();
  }
  function _loadContent(_target) {
    var _URL = _target.href;

    if(!_window || _window.closed) {
      _createWindow(_URL);
    } else {
      _window.focus();
      if (_height){
	      _window.height = _height;
      }
      if(_URL) _window.location = _URL;
    }
  }
  this.show = function(_event, _target, _height) {
    _loadContent(_target);
    if(typeof(event)!="undefined") {
      event.returnValue = false; //IE
    } else {
      _event.preventDefault();
    }
    return false;
  }
  // Can only be used with prototype
  this.showProt = function(_event) { 
    _loadContent(Event.findElement(_event, 'a'));
    Event.stop(_event);
    return false;
  }
  function _createWindow(_URL) {
    _window = open(_URL, _name, _features);
  }
  this.destruct = function() {
    _closeWindow();
  }
}