<!--

if (self != top)
{
top.location.href=self.location.href;
}

var frame_load = "okay";
function SeiteLaden() {
        if(self.location.search.length > 0) {
                var Search_Laenge = self.location.search.length;
                var info_url = self.location.search.substring(1,Search_Laenge);
        }
}

jserror_count = 0;
function reportError(msg,url,line) {
 page_url = parent.location.href;
 par_url = top.pageFrame.err_url;
 query_string = "ihre error HTML eintragen"
  + "?url=" + escape(par_url)
  + "&parent=" + escape(page_url)
  + "&referrer=" + escape(document.referrer)
  + "&browser=" + escape(navigator.appName + " " + navigator.appVersion)
  + "&msg=" + escape(msg)
  + "&line=" + escape(line)
  + "&count=" + (++jserror_count);
 if (document.images) {
  reporter = new Image();
  reporter.src = query_string;
  //alert(query_string+"\n"+msg);
 }
 return true;
}
window.onerror = reportError;

function loadnew(x) {

    if (document.all){
    x.blur();
    }
}

function start() {
  loadData();
  drawTree();
}

function start2() {
  loadData();
  drawTree();
}

function drawTree() {
        outputFrame = top.treeFrame.window.document;
        outputFrame.open("text/html");
        outputFrame.write("<style type='text/css'>A:link {text-decoration: none} A:visited {text-decoration: none} A:active {text-decoration: none}  A:hover {text-decoration: underline}</style>\n");
        outputFrame.write("<html>\n<body background='css/bkgnd1.jpg' bgcolor='#FFFFFF' text='#000000' link='#000000' alink='#000000' vlink='#000000'>\n");
        outputFrame.write("<font face='MS Sans Serif,Arial,Helvetica' size='1' color='#FFFFFF'>\n");
        outputFrame.write("\n<nobr>\n");
        outputFrame.write("<a href='" + treeData[1].url + "' target='pageFrame' onClick=\"javascript:top.loadnew(this)\" onMouseOver=\"window.status=''; return true\"><img src='css/lok1.gif' width=16 height=16 align=texttop border=0 alt=''>&nbsp;<b>" + treeData[1].name + "</b></a><br>\n");
        drawBranch("root","");
        outputFrame.write("</nobr>");
        outputFrame.write("&nbsp;&nbsp;<p align='center'><img src='http://dk-nbahn.de/tinc?key=znFodDho&no=1'>");
        outputFrame.write("</font>\n</body>\n</html>");
        outputFrame.close();
        window.status="";
}
function drawBranch(startNode,structureString) {
        var children = extractChildrenOf(startNode);
        var currentIndex = 1;
        while (currentIndex <= children.length) {
                outputFrame.write(structureString);
                if (children[currentIndex].type == 'link') {
                        if (children[currentIndex].icon == "") {var imageString = ''}
                        else {var imageString = '' + children[currentIndex].icon}
                        if (children[currentIndex].target == "") {
                                var targetFrame = 'pageFrame';
                        }
                        else {var targetFrame = children[currentIndex].target}
                        if (currentIndex != children.length) {
                                outputFrame.write("<img src='css/acont.gif' width=19 height=16 align=texttop>")
                        }
                        else {
                                outputFrame.write("<img src='" + '' + "css/aend.gif' width=19 height=16 align=texttop>")
                        }
                        outputFrame.write("<a href='" + children[currentIndex].url + "' target='" + targetFrame + "' onClick=\"javascript:top.loadnew(this)\" onMouseOver=\"window.status=''; return true\"><img src='" + imageString + "' width=16 height=16 align=texttop border=0 alt=''>&nbsp;" + children[currentIndex].name + "</a><br>\n")
                }
                else {
                        var newStructure = structureString;
                        if (children[currentIndex].iconClosed == "") {var iconClosed = "css/doc0.gif"} else {var iconClosed = children[currentIndex].iconClosed}
                        if (children[currentIndex].iconOpen == "") {var iconOpen = "css/doc0.gif"} else {var iconOpen = children[currentIndex].iconOpen}
                        if (currentIndex != children.length) {
                                if (children[currentIndex].open == 0) {
                                        outputFrame.write("<a href=\"javascript:top.toggleFolder('" + children[currentIndex].id + "',1)\" onClick=\"javascript:top.loadnew(this)\" onMouseOver=\"window.status='Öffnen'; return true\"><img src='css/pcont.gif' width=19 height=16 alt='Öffnen' align=texttop border=0>")
                                        outputFrame.write("<img src='" + iconClosed + "' width=16 height=16 alt='Öffnen' align=texttop border=0>&nbsp;" + children[currentIndex].name + "</a><br>\n")
                                }
                                else {
                                        outputFrame.write("<a href=\"javascript:top.toggleFolder('" + children[currentIndex].id + "',0)\" onClick=\"javascript:top.loadnew(this)\" onMouseOver=\"window.status='Schließen'; return true\"><img src='css/mcont.gif' width=19 height=16 alt='Schließen' align=texttop border=0>");
                                        outputFrame.write("<img src='" + iconOpen + "' width=16 height=16 alt='Schließen' align=texttop border=0>&nbsp;" + children[currentIndex].name + "</a><br>\n");
                                        newStructure = newStructure + "<img src='css/vline.gif' width=19 height=16 align=texttop>";
                                        drawBranch(children[currentIndex].id,newStructure);
                                }
                        }
                        else {
                                if (children[currentIndex].open == 0) {
                                        outputFrame.write("<a href=\"javascript:top.toggleFolder('" + children[currentIndex].id + "',1)\" onClick=\"javascript:top.loadnew(this)\" onMouseOver=\"window.status='Öffnen'; return true\"><img src='pend.gif' wodth=19 height=16 alt='Öffnen' align=texttop border=0>")
                                        outputFrame.write("<img src='" + iconClosed + "' width=16 height=16 alt='Öffnen' align=texttop border=0>&nbsp;" + children[currentIndex].name + "</a><br>\n")
                                }
                                else {
                                        outputFrame.write("<a href=\"javascript:top.toggleFolder('" + children[currentIndex].id + "',0)\" onClick=\"javascript:top.loadnew(this)\" onMouseOver=\"window.status='Schließen'; return true\"><img src='mend.gif' width=19 height=16 alt='Schließen' align=texttop border=0>");
                                        outputFrame.write("<img src='" + iconOpen + "' widht=16 height=16 alt='Schließen' align=texttop border=0>&nbsp;" + children[currentIndex].name + "</a><br>\n");                                        newStructure = newStructure + "<img src='css/blank.gif' width=19 height=16 align=texttop>";
                                        newStructure = newStructure + "<img src='css/blank.gif' width=19 height=16 align=texttop>";
                                        drawBranch(children[currentIndex].id,newStructure);
                                }
                        }
                }
                currentIndex++;
        }
}
function toggleFolder(id,status) {
        var nodeIndex = indexOfNode(id);
        treeData[nodeIndex].open = status;
        timeOutId = setTimeout("drawTree()",100)}

function indexOfNode(id) {
        var currentIndex = 1;
        while (currentIndex <= treeData.length) {
                if ((treeData[currentIndex].type == 'root') || (treeData[currentIndex].type == 'folder')) {
                        if (treeData[currentIndex].id == id) {return currentIndex}}
                currentIndex++}
        return -1}

function extractChildrenOf(node) {
        var children = new Collection();
        var currentIndex = 1;
        while (currentIndex <= treeData.length) {
                if ((treeData[currentIndex].type == 'folder') || (treeData[currentIndex].type == 'link')) {
                        if (treeData[currentIndex].parent == node) {
                                children.add(treeData[currentIndex])}}
                currentIndex++}
        return children}

function Collection() {
        this.length = 0;
        this.add = add;
        return this}

function add(object) {
        this.length++;
        this[this.length] = object}

function RootNode(id,name,url,target,icon) {
        this.id = id;
        this.name = name;
        this.url = url;
        this.target = target;
        this.icon = icon;
        this.type = 'root';
        return this}

function FolderNode(id,parent,name,iconClosed,iconOpen) {
        this.id = id;
        this.parent = parent;
        this.name = name;
        this.iconClosed = iconClosed;
        this.iconOpen = iconOpen;
        this.type = 'folder';
        this.open = 0;
        return this}

function LinkNode(parent,name,url,target,icon) {
        this.parent = parent;
        this.name = name;
        this.url = url;
        this.target = target;
        this.icon = icon;
        this.type = 'link';
        return this}

function loadData() {
        treeData = new Collection();

        treeData.add(new RootNode('root',' Home','home.html','',''));
                treeData.add(new LinkNode('root','Geschichte','geschichte.html','','css/npad.gif'));

        treeData.add(new FolderNode('anl','root','Anlage','',''));
                treeData.add(new LinkNode('anl','Gleisplan','gleisplan.html','','css/doc1.gif'));
                treeData.add(new LinkNode('anl','Umbau','umbau.html','','css/doc1.gif'));
                treeData.add(new LinkNode('anl','Hintergrund','hintergrund.html','','css/doc1.gif'));
                treeData.add(new LinkNode('anl','Betriebswerk','betriebswerk.html','','css/doc1.gif'));
                treeData.add(new LinkNode('anl','Daten','daten.html','','css/doc1.gif'));

        treeData.add(new FolderNode('elek','root','Steuerung','',''));
                treeData.add(new LinkNode('elek','System','system.html','','css/doc1.gif'));
                treeData.add(new LinkNode('elek','Stellpult','gbs.html','','css/doc1.gif'));
                treeData.add(new LinkNode('elek','MPC-Steuerung','mpc.html','','css/doc1.gif'));
                treeData.add(new LinkNode('elek','MPC-Automatik','mpcauto.html','','css/doc1.gif'));
                treeData.add(new LinkNode('elek','Schrankensteuerung','schranken.html','','css/doc1.gif'));
                treeData.add(new LinkNode('elek','Fahrplan','fahrpl.html','','css/doc1.gif'));
                treeData.add(new LinkNode('elek','Lokumsetzen','lokumsetz.html','','css/doc1.gif'));

        treeData.add(new FolderNode('estw','root','ESTW','',''));
                treeData.add(new LinkNode('estw','Definition','estw-dk-def.html','','css/doc1.gif'));
                treeData.add(new LinkNode('estw','Erste Studie','dkestw-f.html','','css/doc1.gif'));
                treeData.add(new LinkNode('estw','Meine Anlage','dkestw.html','','css/doc1.gif'));
                treeData.add(new LinkNode('estw','Beispiele','beispielmpc.html','','css/doc1.gif'));
                treeData.add(new LinkNode('estw','Überblick','estw-dk-st.html','','css/doc1.gif'));
                treeData.add(new LinkNode('estw','Forschritte','estw-dk.html','','css/doc1.gif'));
                treeData.add(new LinkNode('estw','Automatiken','estw-dk-auto.html','','css/doc1.gif'));
                treeData.add(new LinkNode('estw','Tutorial','tutor1.html','','css/doc1.gif'));
                treeData.add(new LinkNode('estw','Bilder','screen.html','','css/doc1.gif'));
                treeData.add(new LinkNode('estw','MPC-Test','mpc-test.html','','css/doc1.gif'));

        treeData.add(new FolderNode('fahrz','root','Fahrzeuge','',''));
                treeData.add(new LinkNode('fahrz','Übersicht','fahrzeuge.html','','css/doc1.gif'));
                treeData.add(new LinkNode('fahrz','Dampfloks','dampfloks.html','','css/doc1.gif'));
                treeData.add(new LinkNode('fahrz','E-Loks','e-loks.html','','css/doc1.gif'));
                treeData.add(new LinkNode('fahrz','Dieselloks','diesel.html','','css/doc1.gif'));
                treeData.add(new LinkNode('fahrz','Triebwagen','triebw.html','','css/doc1.gif'));

        treeData.add(new FolderNode('sonst','root','Sonstiges','',''));
                treeData.add(new LinkNode('sonst','Manueller Paternoster','paternoster.html','','css/doc1.gif'));
                treeData.add(new LinkNode('sonst','Oberleitung','oberleitung.html','','css/doc1.gif'));
                treeData.add(new LinkNode('sonst','Gleisreinigung','staubsaugen.html','','css/doc1.gif'));
                treeData.add(new LinkNode('sonst','Elektr.Stellwerk','dkestw.html','','css/doc1.gif'));
                treeData.add(new LinkNode('sonst','Seilbahn Burgruine','seilbahn.html','','css/doc1.gif'));

        treeData.add(new FolderNode('gross','root','Vorbilder','',''));
                treeData.add(new LinkNode('gross','Furka-Dampfbahn','furkadb.html','','css/doc1.gif'));
                treeData.add(new LinkNode('gross','Albulastrecke','albula.html','','css/doc1.gif'));
                treeData.add(new LinkNode('gross','Landwasserviadukt','landwasser.html','','css/doc1.gif'));
                treeData.add(new LinkNode('gross','Kreisviadukt in Brusio','bernina.html','','css/doc1.gif'));

        treeData.add(new LinkNode('root','Tipps/Erfahrungen','tipps.html','','css/page.gif'));
        treeData.add(new LinkNode('root','Bilder','fotos.html','','css/photo.gif'));
        treeData.add(new LinkNode('root','Download','downloads.html','','css/down.gif'));
        treeData.add(new LinkNode('root','Links','links.html','','css/links.gif'));
        treeData.add(new LinkNode('root','Filme Digitalisieren','filmdigi.html','','css/page.gif'));
        treeData.add(new LinkNode('root','Kontakt','kontakt.html','','css/mail.gif'));

}
//-->