var Fehler = false; onerror = FremdURL;
function FremdURL() {
  if (Fehler) {
    alert ("Sie werden weitergeleitet zur Startseite des TD Rot-Weiss Duesseldorf");
    top.location.href = "http://td-duesseldorf-rot-weiss.de/";
  }
  return true;
}

function TDframe(Pfad) {
  if (Pfad.indexOf("file://")) {
    Fehler = true;
    if (top.frames[0].name != "TDlinkzeile") FremdURL();
    Fehler = false;
  }
  noSpam()
}

var Pfad = self.location.href;
if (Pfad.indexOf("file://") && Pfad.indexOf("terminkalender")==-1 && !parent.frames.length) {
  var Datei = Pfad.slice(Pfad.lastIndexOf("/") + 1);
    document.close();
    with (document) {
      open();
      writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">');
      writeln('<html><head><title>TD Tanzsportclub D&uuml;sseldorf Rot-Weiss e.V.<'+'/title><'+'/head>');
      writeln('<frameset border="0" framespacing="0" frameborder="0" rows="79,*">');
      writeln('<frame name="TDlinkzeile" SRC="../index_kopf.html" scrolling="no" marginwidth="0" marginheight="1" noresize>');
      writeln('<frame name="Hauptteil" SRC="'+Datei+'?frameset" scrolling="auto" marginwidth="0" marginheight="0">');
      writeln('<'+'/frameset><'+'/html>');
      close();
    }
}

function LadeFrame() {
  if(self.location.search.length > 0)
    self.Hauptteil.location.replace(self.location.search.substring(1,self.location.search.length));
}

function Info(show) {
  if (document.getElementById) {
    if (show) document.getElementById('info').style.visibility='visible';
    else window.setTimeout("document.getElementById('info').style.visibility='hidden'",2000);
  }
}

getElementsByClassName = function (c) {
  var ret = new Array(); var j = 0;
  var objs = document.all ? document.all : document.getElementsByTagName("*");
  for(i = 0;i<objs.length;i++) {
    if(objs[i].className == c) {
      ret[j] = objs[i]; j++;
    }
  }
  return ret;
}

function noSpam() {
  var at = "@", d = "td-duesseldorf-rot-weiss.de", i = 0;
  var x = getElementsByClassName("eMail"); e = x.length;
  if(e) {
    for(i=0; i<=e; i++) {
      if(x[i].tagName == 'A') {
        var h = x[i].href; var q = h.indexOf("?");
        var m = h.slice(q+1); var s = "";
        var p = m.indexOf("&subject=");
        if (p != -1) {
          s = '?'+m.slice(p+1); m = m.slice(0,p);
        }
        x[i].href = "mailto:" + m + at + d + s;
      }
    }
  }
}

/*
function noSpam() {
  var at = "@", d = "td-duesseldorf-rot-weiss.de", i = 0;
  var x = getElementsByClassName("eMail"); e = x.length;
  if(e) {
    for(i=0; i<=e; i++) {
      if(x[i] != undefined) {
        var h = x[i].href;
        if(h.slice(0,7) != "mailto:") {
          var q = h.indexOf("?"); var p = q; // h.indexOf("#");
          var s = ""; // if (q != -1) s = h.slice(q,p);
          var atd = ""; if(h.indexOf(at) == -1) atd = at+d;
          h = h.slice(p+1); x[i].href = "mailto:" + h + atd + s;
        }
      }
    }
  }
}
*/
