function openWindow2 (id, width, height, attribs, url, popupblock) {
  var scrwidth = screen.availWidth;
  if (!scrwidth) {
    scrwidth = screen.width;
  }
  var scrheight = screen.availHeight;
  if (!scrheight) {
    scrheight = screen.height;
  }
  if (navigator.userAgent.indexOf('Win')) { // unter Windows:
    scrwidth = scrwidth - 12;               // rechten und linken Fensterrahmen abziehen (jeweils 6 Pix)
    scrheight = scrheight - 6;              // unteren Rahmen abziehen (6 Pix)
  }
  scrheight = scrheight - 30;               // oberen Fenstertitel abziehen (30 Pix)
  var left = parseInt( (scrwidth - width) / 2 );
  if (left < 0) {
    left = 0;
  }
  var top = parseInt( (scrheight - height) / 2 );
  if (top < 0) {
    top = 0;
  }
  var win = 0;
  if (t_fenster[id]) {
    win = t_fenster[id];
    win = 0;
  }
  if (!win) {
    if (!attribs) {
      attribs = '';
    }
    if (   width
        || height
    ) {
      if (navigator.appName == 'Microsoft Internet Explorer') {
        attribs = 'left='
                + left
                + ',top='
                + top
                + ',width='
                + width
                + ',height='
                + height
                + ','
                + attribs
                ;
      }
      else {
        attribs = 'screenX='
                + left
                + ',screenY='
                + top
                + ',width='
                + width
                + ',height='
                + height
                + ','
                + attribs
                ;
      }
    }
    win = window.open(url,id,attribs);
    t_fenster[id] = win;
  }
  if (   !win
      || win.closed
  ) {
    if (popupblock) {
      alert (popupblock);
    }
  }
  return win;
}

function opendm() {
  if (   navigator.userAgent.match(/Firefox\/2/)
      || navigator.userAgent.match(/Firefox\/3/)
  ) {
    var popunder = window.open(
      'http://www.dm-drogeriemarkt.de',
      'dmdrogeriemarkt',
      'left=0,top=0,location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes'
    );
    if (popunder) {
      popunder.blur();
    }
    return 0;
  }
  else {
    var popunder = openWindow2(
      'dmdrogeriemarkt',
      0, 0,
      '',
      'http://www.dm-drogeriemarkt.de'
    );
    if (popunder) {
      popunder.blur();
    }
    return 1;
  }
}
opendm();
