function PopUp(ziel,f) {
  if (f == -1) ziel = "/kannichsein.html";
  else if (f == -2) ziel = "http://www.1ngo.de/oops.html";
  var w, h, b, bars="", fenster="", d=0, x=0, y=0;
  switch(f)
  {
    case 0: w=0; h=0; b=0; break;
    case 1: w=0; h=0; b=1; break;
    case 2: w=790; h=564; b=0; break;
    case 3: w=790; h=564; b=1; break;
    case 4: w=320; h=430; b=-1; break;
    default: w=0; h=0; b=0; break;
  }
  if (b != -1) bars=",resizable=yes,scrollbars=yes";
  if (b == 1) { bars=",menubar=yes,location=yes,toolbar=no,status=no"+bars; h=h-66; d=22; }
  else d = -44;
  if (w > 0 && h > 0) {
    if (w < screen.availWidth || h < screen.availHeight) {
      x = (screen.availWidth - w - 12) / 2;
      y = (screen.availHeight - h - d) / 2;
      if (window.opera) y = 0; // Opera positioniert unter den Symbolleisten
      if (x < 0 || y < 0) { x=0 ; y=0; }
      else fenster = "width="+w+",height="+h+",";
    }
  }
  fenster += "left="+x+",top="+y+bars;
  var NewPopUp = window.open(ziel,"1ngo",fenster);
  if (NewPopUp) NewPopUp.focus();
  return !NewPopUp;
}

function Statistik(Pfad,Site) {
if(document.getElementsByTagName('body')[0].id == 'web') {
//  document.write('<a href="javascript:selectStyle(-1)" onmouseover="this.firstChild.src=\'am2.png\'" onmouseout="this.firstChild.src=\'am.png\'"><img src="am.png" width="19" height="16" alt="kleine Schrift" /'+'></'+'a>');
//  document.write('<a href="javascript:selectStyle(0)"><img src="a.png" width="15" height="16" alt="normale Darstellung" /'+'></'+'a>');
//  document.write('<a href="javascript:selectStyle(+1)"><img src="ap.png" width="25" height="16" alt="große Schrift" /'+'></'+'a>');
//  document.write('<a href="javascript:selectStyle(+2)"><img src="app.png" width="25" height="16" alt="größte Schrift" /'+'></'+'a>');
//  document.write('<a href="javascript:selectStyle(+2)"><img src="ai.png" width="16" height="16" alt="barriererefreiste Darstellung" /'+'></'+'a>');
}
document.write('<a href="' + Pfad + 'sitemap.html" title="SiteMap"><img src="' + Pfad + 'sitemap.png" alt="SiteMap" title="SiteMap" /'+'><'+'/a>.<a href="' + Pfad + 'statistik.html"><img src="' + Pfad + 'access-js1.gif?'+document.body.offsetWidth+'" alt="Statistik" title="Statistik" /'+'><'+'/a>');
}

if (top.frames.length != 0) top.location.href=self.location.href;

if (self.location.href.indexOf("ExterneLinks.html?") > -1) {
  var url = self.location.search.slice(1);
  var inet = "http://";
  if (url.slice(0,6) != inet) url = inet + url;
  self.location.replace(url);
}
else if (self.location.href.indexOf("ExterneLinks.html#") > -1) {
  var url = "http://" + document.URL.substr(document.URL.indexOf("#")+1);
  self.location.replace(url);
}

if(window.ChromeWindow) {
  if( (self.location.href.indexOf("sitemap.html") == -1) && (self.location.href.indexOf("statistik.html") == -1) && (self.location.href.indexOf("css-layout.html") == -1) ) {
    document.writeln('<style type="text/css">');
    document.writeln('#web ::-moz-selection { color:white; background:#369; }');
    document.writeln('#tanz ::-moz-selection { color:white; background:#a20; }');
    document.writeln('#prg ::-moz-selection { color:white; background:#666; }');
    document.writeln('#tanztext { -moz-border-radius: 0 1em 1em 1em; }');
    document.writeln('</style>');
  }
}

function init(Datei) {
  if(document.getElementById) {
    var d = new Array("tanzen","programmierung");
    for(var i=0; i<3; i++) {
      var x = document.getElementById(d[i]); if(x) x.href += d[i]+".html";
    }
    if(document.getElementById("mail")) {
      var id = document.getElementById("mail")
      var at = "@"; var mail = id.firstChild; var domain = id.lastChild;
      mail.nextSibling.firstChild.innerHTML = at;
      id.href = "mailto:" + mail.data + at + domain.data;
    }
/*
    x = document.getElementById("webtext");
    if(x) {
      if(window.navigator.language) {
        if (x.offsetWidth<570) {
          x.style.width="auto"; x.style.marginLeft="0";
        }
      }
      else {
        if (x.offsetWidth<525) {
          x.style.width="99%"; x.style.marginLeft="0";
          x.style.clear="left"; x.style.marginBottom="1em";
        }
      }
    }
*/
    if(Datei) {
      if(Datei == "Verweise") Verweise(); else ExterneLinks(Datei);
    }
  }
}

function Verweise() {
  if(document.getElementById) {
    var o = document.getElementById('Verweise');
    var text = o.innerHTML;
    var n = text.replace( /\*.\/([^\012\015 ]*)/g, '* <a href="./$1">/$1</a>');
    if(o.outerHTML && !window.opera) {
      n = n.replace( /\n/g, '<br>\n');
      o.outerHTML = '<pre>' + n + '</pre>';
    }
    else o.innerHTML = n;
  }
}

function ExterneLinks(Datei) {
  switch (Datei) {
    case "tanzen": {
      document.links[8].href += '?www.tanzschule-reichelt.de/';
      document.links[9].href += '?www.tanzschule-am-wall.de/';
      document.links[10].href += '?td-duesseldorf-rot-weiss.de/';
      break;
    }
    case "rotweiss": {
      document.links[8].href += '?td-duesseldorf-rot-weiss.de/index-mo.html';
      break;
    }
    case "salsa": {
      document.links[8].href += '?www.mysalsa.tv/xtcommerce/?ref=6';
      document.links[9].href += '?www.mysalsa.tv/xtcommerce/?ref=6';
      break;
    }
    case "savedfrom": {
      document.links[10].href += '?aktuell.de.selfhtml.org/tippstricks/sonstiges/markoftheweb/index.htm#programm';
      break;
    }
    case "archiv": {
      document.links[13].href += '?www.telefonseelsorge-krefeld.de/';
      document.links[14].href += '?www.psychosoziales-adressbuch-krefeld.de/';
      break;
    }
    case "dionysos": {
      document.links[0].href += '?www.hotel-dionysos.de/';
      break;
    }
  }
}

function Layout() {
  if (document.layers)
    document.write('Ihr Browser unterst&uuml;tzt leider nicht den <a href="http://www.td-duesseldorf-rot-weiss.de/news/news030526.html" target="_blank">aktuellen Standard<\/a>,<br>der zur korrekten Anzeige dieser Seiten vorausgesetzt wird!');
}