<!--

// Inhaltsverzeichnis erstellen ************************************************

var nodes = new Array;

function make_toc()
{

    var toc = document.createElement("div");
    toc.setAttribute("id","toc");

    var p = document.createElement("p");
    p.style.fontWeight="bold";
    p.style.color="#BC1C1C";
    p.appendChild( document.createTextNode( "Inhaltsverzeichnis" ) );
    toc.appendChild(p);

    var ul = document.createElement("ul");
    ul.style.paddingLeft="0px";
    ul.style.marginLeft="0px";
    ul.style.listStyle="none";


    get_all_hx_nodes( document.getElementsByTagName("div")["Inhalt"] ) ;

    for (var i=0, len=nodes.length ; i<len; i++)
    {
        if ( nodes[i].nodeName.match(/^[h|H]/) )
        {

                        var tar = document.createElement("a");
            tar.setAttribute("id","n"+i);

                        nodes[i].appendChild(tar);

                        var li = document.createElement("li");   //nodes[i].nodeName

                        if ( nodes[i].nodeName.match(/h1|H1/) )
                             {
                             li.style.fontWeight="bold";
                             }

            var a = document.createElement("a");
            a.setAttribute("href","#n"+i);
            a.appendChild(
                document.createTextNode(
                    nodes[i].firstChild.nodeValue
                )
            );

            li.appendChild(a);
            ul.appendChild(li);
            toc.appendChild(ul);

                        // neu in 3.6C
                        //nodes[i].style.backgroundColor="#cccccc";
                        nodes[i].style.border="1px solid #00682D";
                        nodes[i].style.color="#00682D";
                        nodes[i].setAttribute("class","head");

                        // neu in 3.6C
                        var z = document.createElement("a");
            z.setAttribute("href","#toc" );
            z.appendChild( document.createTextNode( "[zum Inhaltsverzeichnis]" ) );

                        try {
                                document.getElementsByTagName("div")["Inhalt"].insertBefore( z, nodes[i].nextSibling );
                        } catch (e) {
                                nodes[i].parentNode.appendChild( z );
                        }// end try/catch
        }
    }
    document.body.insertBefore(toc, document.body.firstChild );
        document.getElementById("toclink").style.display = "none";
        document.getElementById("toclink2").style.display = "none";
}// end function make_toc

function get_all_hx_nodes( current_node ) {
        var children = current_node.childNodes;

        if ( children.length >0 ) {
                if ( current_node.nodeName.match(/^[h|H]/) ) {
                        nodes.push( current_node ); // globale variable
                }
                for (var i=0, len=children.length; i<len; i++)
                {
                        get_all_hx_nodes( children[i] )
                }
        }

}// end function get_all_hx_nodes



//******************************************************************************


//-->
