/* entory AG 15.07.2003
   internet_gr.js
   This File contains the Javascript Code of DZBANKInternetauftrittJ2EE-Application
   which was extracted of /navigation/nav_main.jsp and /navigation/nav_home.jsp
   The file needs to be placed in /internet_gr/_home/_javascript using NPS-Content Management System Frontend
   Nescessary changes:
   - We took buildtree_ns and buildtree_ie from nav_main.jsp
     The Code in nav_home.jsp differs in these functions and was rebuilt
   - The functions showtree(), showtree_ie()were taken from from nav_main.jsp 
     The only difference between the two functions was an extra check for "if (!use_blende)".
     We check the calling page by using if (isFunctionCallFromNavMainJSP==true)
   - function buildtree() was replaced
     nav_home.jsp calls buildtree_nav_home()
     nav_main.jsp calls buildtree_nav_main()
     These functions had some dynamic ATG Dynamo Code which must be replaced by Input-Parameters from the
     calling JSPs (e.g. lastElementCount, blende_top)
*/

function o_showmenu() {
    var n;
    for	(n=0;n<this.items.length;n++) {
        this.items[n].layer.bgColor=this.bgcolor;
        this.items[n].layer.visibility="show";
        this.items[n].text.visibility="show";
        this.items[n].over.visibility="show";
        this.items[n].trenner.visibility="show";
        this.items[n].o_trenner.visibility="hide";
        this.items[n].u_trenner.visibility="hide";
    
        }
    this.ison=1;
    this.v=1;
    
    if (!use_blende) {
        this.spacer.visibility="show";
    }
}

function o_showmenu_ie() {
    var n;
    for	(n=0;n<this.items.length;n++) {
        this.items[n].layer.background=this.bgcolor;
        this.items[n].layer.visibility="visible";
        this.items[n].text.visibility="visible";
        this.items[n].over.visibility="visible";
        this.items[n].trenner.visibility="visible";
        this.items[n].o_trenner.visibility="hidden";
        this.items[n].u_trenner.visibility="hidden";
        }
    if (!use_blende) {
        this.spacer.visibility="visible";
    }
    this.ison=1;
    this.v=1;
}

function o_hidemenu() {
    var n;
    for	(n=0;n<this.items.length;n++) {
        this.items[n].layer.bgColor=this.bgcolor;
        this.items[n].layer.visibility="hide";
        this.items[n].text.visibility="hide";
        this.items[n].over.visibility="hide";
        this.items[n].trenner.visibility="hide";
        this.items[n].o_trenner.visibility="hide";
        this.items[n].u_trenner.visibility="hide";
        this.items[n].ison=0;
        }
    if (!use_blende) {
        this.spacer.visibility="hide";
        }
    this.ison=0;
    this.v=0;
}

function o_hidemenu_ie() {
    var n;
    for	(n=0;n<this.items.length;n++) {
        this.items[n].layer.background=this.bgcolor;
        this.items[n].layer.visibility="hidden";
        this.items[n].text.visibility="hidden";
        this.items[n].over.visibility="hidden";
        this.items[n].trenner.visibility="hidden";
        this.items[n].o_trenner.visibility="hidden";
        this.items[n].u_trenner.visibility="hidden";

        this.items[n].ison=0;

        }
    if (!use_blende) {
        this.spacer.visibility="hidden";
        }
    this.ison=0;
    this.v=0;
    }

function o_menu() {
    var itemscount;
    var items;
    var ison;
    this.showmenu=o_showmenu;
    this.hidemenu=o_hidemenu;
    /* this.spacer=new Layer(item_width); */
    this.spacer=0;
    this.itemscount=0;
    this.items= new Array();
    this.left=0;
    this.top=50;
    this.height=0;
    this.width=0;
    this.bgcolor="#000000";
    this.highlight="#555555";
    }

function o_menu_ie() {
    var itemscount;
    var items;
    var ison;
    this.showmenu=o_showmenu_ie;
    this.hidemenu=o_hidemenu_ie;
    this.spacer=0;
    this.itemscount=0;
    this.items= new Array();
    this.left=0;
    this.top=50;
    this.height=0;
    this.width=0;
    this.bgcolor="#000000";
    this.highlight="#555555";
    }

function o_highlight() {
    if (this.layer.bgColor!=this.parent.highlight) {
        this.layer.bgColor=this.parent.highlight;
        this.o_trenner.visibility="show";
        this.u_trenner.visibility="show";
        }
    this.trenner.visibility="hide";
    this.ison=1;
    this.ishigh=1;
    }
    
function o_normal() {
    this.layer.bgColor=this.parent.bgcolor;
    this.o_trenner.visibility="hide";
    this.u_trenner.visibility="hide";
    this.trenner.visibility="show";
    this.ison=0;
    this.ishigh=0;
    }

function o_highlight_ie() {
    if (this.layer.background!=this.parent.highlight) {
        this.layer.background=this.parent.highlight;
        this.o_trenner.visibility="visible";
        this.u_trenner.visibility="visible";
        }
    this.trenner.visibility="hidden";
    this.ison=1;
    this.ishigh=1;
    }
    
function o_normal_ie() {
    this.layer.background=this.parent.bgcolor;
    this.o_trenner.visibility="hidden";
    this.u_trenner.visibility="hidden";
    this.trenner.visibility="visible";
    this.ison=0;
    this.ishigh=0;
    }

function o_item() {
    var parent;
    var ison;
    this.highlight=o_highlight;
    this.normal=o_normal;
    this.layer = new Layer(item_width);
    this.text  = new Layer(item_width);
    this.over  = new Layer(item_width);
    this.o_trenner = new Layer(item_width);
    this.u_trenner = new Layer(item_width);
    this.trenner   = new Layer(item_width);
    this.child = new o_menu();
    this.haschild = 0;
    }

function o_item_ie() {
    var parent;
    var ison;
    this.highlight=o_highlight_ie;
    this.normal=o_normal_ie;
    this.layer = 0;
    this.text  = 0;
    this.over  = 0;
    this.o_trenner = 0;
    this.u_trenner = 0;
    this.trenner   = 0;
    this.child = new o_menu_ie();
    this.haschild = 0;
    }

function reallength(label) {
var label_l;
    label_l=label.length;
    if (label.indexOf('<i>',0)!=-1) { label_l=label_l-3; }
    if (label.indexOf('</i>',0)!=-1) { label_l=label_l-4; }
    if (label.indexOf('&ouml;',0)!=-1) { label_l=label_l-5; }
    if (label.indexOf('&auml;',0)!=-1) { label_l=label_l-5; }
    if (label.indexOf('&uuml;',0)!=-1) { label_l=label_l-5; }

    return label_l
    }

function maus(e) {
    var mx;
    var my;
    mx=e.pageX;
    my=e.pageY;
    maus_ns(mx,my, topmenu);
    doshowtree(topmenu);
}

function maus_ie(e) {
    var mx;
    var my;
    mx=window.event.clientX;
    my=window.event.clientY;
    maus_ns(mx,my, topmenu);
    doshowtree(topmenu);
}

function doshowtree(menu) {
    var n;
    var n2;
    sel=0;
    /* def setzen */

    if (def_on>=0) {
        for(n=0;n<menu.items.length;n++) {
            if (menu.items[n].ison && n!=def_on) {
                sel=1;
                break;
                }
        }
        if (!sel) {
            menu.items[def_on].ison=1;
            sel2=0;
            if (def_right>=0) {
                if (menu.items[def_on].haschild) {
                    for(n2=0;n2<menu.items[def_on].child.items.length;n2++) {
                        if (menu.items[def_on].child.items[n2].ison) {
                            sel2=1;
                            break;
                        }
                    }
                    if (!sel2) {
                        menu.items[def_on].child.items[def_right].ison=1;
                    }
                }
            }
        }
    }
    showblende=0;
    showtree_ie(menu);
    if (showblende && use_blende) {
        if (browser=="netscape") {
            blende.visibility="show";
            }
        else {
            blende.visibility="visible";
            }
        }
    else {
        if (browser=="netscape") {
            blende.visibility="hide";
            }
        else {
            blende.visibility="hidden";
            }
        }
}

function showtree(menu) {
    var n;
    for (n=0;n<menu.items.length;n++) {
        if (menu.items[n].ison) {
            menu.items[n].highlight();
            // entory AG 15.07.2003 Code of this function differs between
            // nav_home.jsp and nav_main.jsp. We need to distinguish if the call
            // was sent from nav_home or nav_main
            if (isFunctionCallFromNavMainJSP == true){
                // alert("Function called from NavMain");
                showblende=1;
            }
            if (menu.items[n].haschild) {

                if (!menu.items[n].child.v) {
                    menu.items[n].child.showmenu();
                    }
                else {
                    menu.items[n].child.ison=1;
                    }
                showblende=1;
                showtree(menu.items[n].child);
                }
            }
        else {
            menu.items[n].normal();
            if (menu.items[n].haschild) {
                if (menu.items[n].child.v) {
                    menu.items[n].child.hidemenu();
                    }
                else {
                    menu.items[n].child.ison=0;
                    }
                }

            }
    }
}

function showtree_ie(menu) {
    var n;
    for (n=0;n<menu.items.length;n++) {
        if (menu.items[n].ison) {
            menu.items[n].highlight();
            // entory AG 15.07.2003 Code of this function differs between
            // nav_home.jsp and nav_main.jsp. We need to distinguish if the call
            // was sent from nav_home or nav_main
            if (isFunctionCallFromNavMainJSP == true){
                // alert("Function called from NavMain");
                showblende=1;
            }
            if (menu.items[n].haschild) {

                if (!menu.items[n].child.v) {
                    menu.items[n].child.showmenu();
                    }
                else {
                    menu.items[n].child.ison=1;
                    }
                showblende=1;
                showtree(menu.items[n].child);
                }
            }
        else {
            menu.items[n].normal();
            if (menu.items[n].haschild) {
                menu.items[n].child.hidemenu();
                }

            }
        }
}
    
function maus_ns(mx,my, cur_menu) {
    var n;
    var n2;
    var cur_left, cur_width, cur_top, cur_height;
    for (n=0;n<cur_menu.items.length;n++) {
        /* cur_menu.items[n].ison=0; */
        if (browser=="netscape") {
            cur_left=cur_menu.items[n].layer.left;
            cur_width=cur_menu.items[n].layer.clip.width;
            cur_top=cur_menu.items[n].layer.top;
            cur_height=cur_menu.items[n].layer.clip.height;
        }
        else {
            cur_left=parseInt(cur_menu.items[n].layer.left);
            cur_width=parseInt(cur_menu.items[n].layer.width);
            cur_top=parseInt(cur_menu.items[n].layer.top);
            cur_height=parseInt(cur_menu.items[n].layer.height);
            }
        if (mx>=cur_left && mx<=cur_left+cur_width+1 && my>=cur_top && my<=cur_top+cur_height-1) {
            cur_menu.items[n].ison=1;
            if (cur_menu.items[n].haschild==1) {
                cur_menu.items[n].child.ison=1;
                for(n2=0;n2<cur_menu.items[n].child.items.length;n2++) {
                    cur_menu.items[n].child.items[n2].ison=0;
                    }
                }
            }
        else {
            if (cur_menu.items[n].haschild==1 ) {
                if (mx>=cur_menu.items[n].child.left && mx<=cur_menu.items[n].child.left+cur_menu.items[n].child.width+1 && my>=cur_menu.items[n].child.top && my<=cur_menu.items[n].child.top+cur_menu.items[n].child.height) {
                    /* unterpunkte bearbeiten */

                    if ( cur_menu.items[n].child.ison && cur_menu.items[n].child.v) {
                        maus_ns(mx,my, cur_menu.items[n].child);
                        }
                    }
                else {
                    cur_menu.items[n].ison=0;
                    cur_menu.items[n].child.ison=0;

                    for(n2=0;n2<cur_menu.items[n].child.items.length;n2++) {
                        cur_menu.items[n].child.items[n2].ison=0;
                        }

                    }
                }
            else {
                cur_menu.items[n].ison=0;
                }

            }
    }
}

function buildtree_nav_home(lastElementCount) {
    // entory AG 15.07.2003
    // new flag, that indicates from which jsp the function was called
    // some dependend funtions are nearly the same in nav_main and nav_home.jsp
    // To avoid coding some funtions twice, we build a if (isFunctionCallFromNavMainJSP=true) - block
    // around the parts of the code, that will only be used by calls from nav_main.jsp
    isFunctionCallFromNavMainJSP=false;
    topmenu=new o_menu_ie();
    item_height=23;
    item_width=134;
    blende_height=500;
    blende_top=139;
    menu_left=1;
    menu_top=56;
    last_space=51;//hier wird die AbsatzHoehe festgelegt!
    use_blende=0;
    // PaDe
    last_items=lastElementCount;
    // alert(lastElementCount);
    def_on=-1;
    def_right=-1;

    def_on=buildtree_nav_home.arguments[1];
    //alert("buildtree_nav_home - def_on" + def_on);
    if (buildtree_nav_home.arguments.length>2) {
        def_string=buildtree_nav_home.arguments[2];

        sub=items_0[def_on][2];
        liste=eval('items_'+sub);
        for (n=0;n<liste.length;n++) {
            if (liste[n][0]==def_string) {
                def_right=n;
                break;
                }
            }
    }
    else {def_right=-1; }

    if (navigator.appName=='Netscape') { browser="netscape"; }
    else { browser="ie"; }

    if (browser=="ie") {

    bstring='<div id="blende1" style="position:absolute; z-index:1; width:'+(item_width)+'px; height:'+blende_height+'px; left: '+(menu_left+item_width+1)+'px; top: '+blende_top+'px; background-color: #ffffff; visibility: hidden"></div>';
    document.body.insertAdjacentHTML("BeforeEnd",bstring);

    blende=eval('document.all.blende1.style' );

    suffix=0;
    buildtree_ie( topmenu, items_0, "#FF6300", "#FFA267", menu_left, menu_top );


    for (n=0;n<topmenu.items.length;n++) {
        topmenu.items[n].layer.visibility="visible";
        topmenu.items[n].text.visibility="visible";
        topmenu.items[n].trenner.visibility="visible";
        topmenu.items[n].over.visibility="visible";
        }

    doshowtree(topmenu);

    document.onmousemove=maus_ie;

    document.close();

    }

else {

    blende = new Layer(item_width);
    blende.bgColor = "#ffffff";
    blende.clip.width = item_width;
    blende.clip.height= blende_height;
    blende.left=menu_left+item_width+1;
    blende.top=blende_top;

    buildtree_ns( topmenu, items_0, "#FF6300", "#FFA267", menu_left, menu_top );

    for (n=0;n<topmenu.items.length;n++) {
        topmenu.items[n].layer.visibility="show";
        topmenu.items[n].text.visibility="show";
        topmenu.items[n].trenner.visibility="show";
        topmenu.items[n].over.visibility="show";
        }

    doshowtree(topmenu);

    document.captureEvents(Event.MOUSEMOVE);
    document.onMouseMove=maus;
    }

}

function buildtree_nav_main() {
    // entory AG 15.07.2003
    // new flag, that indicates from which jsp the function was called
    // some dependend funtions are nearly the same in nav_main and nav_home.jsp
    // To avoid coding some funtions twice, we build a if (isFunctionCallFromNavMainJSP=true) - block
    // around the parts of the code, that will only be used by calls from nav_main.jsp
    isFunctionCallFromNavMainJSP=true;
    topmenu=new o_menu_ie();
    item_height=23;
    item_width=134;
    blende_height=500;

    // entory AG 15.07.2003
    // Check if there is a 3rd parameter of this function
    // it indicates the size of the blende_top-parameter
    if (buildtree_nav_main.arguments.length>2) {
        blende_top=buildtree_nav_main.arguments[2];
        // alert("blende_top is " + blende_top);        
    }else{
        blende_top=175;
    }
    menu_left=1;
    menu_top=56;
    last_space=50;
    use_blende=1;
    last_items=0;
    
    def_on=-1;
    def_right=-1;

    def_on=buildtree_nav_main.arguments[0];

    if (def_on>=0) {

        if (buildtree_nav_main.arguments.length>1) {
            def_string=buildtree_nav_main.arguments[1];

            sub=items_0[def_on][2];
            liste=eval('items_'+sub);
            for (n=0;n<liste.length;n++) {
                if (liste[n][3]==def_string) {
                    def_right=n;
                    break;
                    }
                }
            }
        }


    if (navigator.appName=='Netscape') { browser="netscape"; }
    else { browser="ie"; }

    if (browser=="ie") {

    bstring='<div id="blende1" style="position:absolute; z-index:1; width:'+(item_width)+'px; height:'+blende_height+'px; left: '+(menu_left+item_width+1)+'px; top: '+(blende_top-1)+'px; background-color: #ffffff; visibility: hidden"></div>';
    document.body.insertAdjacentHTML("BeforeEnd",bstring);

    blende=eval('document.all.blende1.style' );
    suffix=0;
    buildtree_ie( topmenu, items_0, "#FF6300", "#FFA267", menu_left, menu_top );

    for (n=0;n<topmenu.items.length;n++) {
        topmenu.items[n].layer.visibility="visible";
        topmenu.items[n].text.visibility="visible";
        topmenu.items[n].trenner.visibility="visible";
        topmenu.items[n].over.visibility="visible";
        }

    doshowtree(topmenu);

    document.onmousemove=maus_ie;

    document.close();

    }

else {

    blende = new Layer(item_width);
    blende.bgColor = "#ffffff";
    blende.clip.width = item_width;
    blende.clip.height= blende_height;
    blende.left=menu_left+item_width+1;
    blende.top=blende_top-1;

    buildtree_ns( topmenu, items_0, "#FF6300", "#FFA267", menu_left, menu_top );

    for (n=0;n<topmenu.items.length;n++) {
        topmenu.items[n].layer.visibility="show";
        topmenu.items[n].text.visibility="show";
        topmenu.items[n].trenner.visibility="show";
        topmenu.items[n].over.visibility="show";
        }

    doshowtree(topmenu);

    document.captureEvents(Event.MOUSEMOVE);
    document.onMouseMove=maus;
    }

}

function buildtree_ns( menu, liste, bgcolor, highlight, xpos, ypos ) {
var n;
var newcolor;
var cur_y;
var cur_height;
var lines;
var fcolor;
cur_y=ypos;

fcolor="#ffffff";

for (n=0;n<liste.length;n++) {

    if (liste.length-n==last_items && last_items!=0 && menu==topmenu) { cur_y=cur_y+last_space; fcolor="#D6D7D6"; }
    else {
        //search in list param3 for "isKonzernToechter" set in the nav_main.jsp if the menu ebene1 item is "KonzernToechter"
        var iSuche = -1;
        if (liste[n][3] != null) iSuche = liste[n][3].indexOf("isKonzernToechter");
        if (iSuche!=-1) {
            //alert("buildtree_ie - \nLabel   = " + liste[n][0] + "\nListe1 = " + liste[n][1] + "\nListe2 = " + liste[n][2] + "\nListe3 = " + liste[n][3]);
            cur_y=cur_y+last_space; fcolor="#D6D7D6";
        }
    }
    
    label=liste[n][0];
    if (reallength(label)>19) { lines=1.7; label=label+"&nbsp;&nbsp;&nbsp;"; }
    else { lines=1; }

    //search in list param4 for "isKonzernToechter" set in the nav_main.jsp if the menu ebene1 item is "KonzernToechter"
    var iSuche4 = -1;
    if (liste[n][4] != null) iSuche4 = liste[n][4].indexOf("isKonzernToechter");
        if (iSuche4!=-1) {
            lines=4.2;
    }

    cur_height=parseInt(item_height*lines);

    menu.items[n]=new o_item();
    menu.items[n].parent=menu;
    menu.itemscount=menu.itemscount+1;

    if (liste[n][4] != null && liste[n][4].indexOf("viewIsFalse")>=0) {
        //alert("Liste - \nLabe0   = " + liste[n][0] + "\nListe1 = " + liste[n][1] + "\nListe2 = " + liste[n][2] + "\nListe3 = " + liste[n][3] + "\nListe4 = " + liste[n][4]);
        cur_height=0
    } else {

    menu.items[n].layer.bgColor = bgcolor;
    menu.items[n].layer.clip.width = item_width;
    menu.items[n].layer.clip.height= cur_height;
    menu.items[n].layer.left=xpos;
    menu.items[n].layer.top=cur_y;


    menu.items[n].text.clip.width = item_width-8;
    menu.items[n].text.clip.height= cur_height-2;
    menu.items[n].text.left=xpos+7;
    menu.items[n].text.top=cur_y+2;
    menu.items[n].text.document.open();
    HM_FontFamily="Arial,sans-serif";
    HM_FontSize=12;
    menu.items[n].text.document.write("<FONT color=white FACE='" + HM_FontFamily + "' style=\"font-size: "+ HM_FontSize +"px\";>" + label + "</FONT>");
    menu.items[n].text.document.close();

    menu.items[n].trenner.bgColor = "#FFC199";
    menu.items[n].trenner.clip.width = item_width;
    menu.items[n].trenner.clip.height= 1;
    menu.items[n].trenner.left=xpos;
    menu.items[n].trenner.top=cur_y+cur_height-1;

    menu.items[n].over.clip.width = item_width;
    menu.items[n].over.clip.height= cur_height;
    menu.items[n].over.left=xpos;
    menu.items[n].over.top=cur_y;

    menu.items[n].o_trenner.bgColor = "#ffffff";
    menu.items[n].o_trenner.clip.width = item_width;
    menu.items[n].o_trenner.clip.height= 1;
    menu.items[n].o_trenner.left=xpos;
    menu.items[n].o_trenner.top=cur_y-1;
    menu.items[n].u_trenner.bgColor = "#ffffff";
    menu.items[n].u_trenner.clip.width = item_width;
    menu.items[n].u_trenner.clip.height= 1;
    menu.items[n].u_trenner.left=xpos;
    menu.items[n].u_trenner.top=cur_y+cur_height-1;

    if (iSuche4!=-1) {
        //no href on konzerntoechter sites at the übersicht menue
    } else {
        menu.items[n].over.document.open();
        menu.items[n].over.document.write('<a class="link-loesung" target="_top" href="'+ liste[n][1] +'"><img src="/repository/1/internet_gr/_home/_imagesDynamo/trans.gif" width='+item_width+'height='+(cur_height)+' border=0 alt=""></a>');
        menu.items[n].over.document.close();
    }

    if (liste[n][2]!=0) {
        menu.items[n].haschild=1;

        if (n==def_on) { t_cur_y=blende_top; }
        else { t_cur_y=cur_y; }
        buildtree_ns ( menu.items[n].child, eval ('items_'+liste[n][2]), "#FF6300", "#FFA267", item_width+xpos+1, t_cur_y);
    }
    cur_y=cur_y+cur_height;
    }}
    // entory AG 15.07.2003 The following !use_blende check was not in the nav_home.jsp javscript-funtion (only in nav_main.jsp)
    if (isFunctionCallFromNavMainJSP == true){
        if (!use_blende) {
            // alert("!use_blende (NavMain");
            menu.spacer=new Layer(item_width);
            menu.spacer.bgColor= bgcolor;
            menu.spacer.clip.width = item_width;
            menu.spacer.clip.height= last_space;
            menu.spacer.left=xpos;
            menu.spacer.top=cur_y;
            cur_y=cur_y+last_space;
            }
    }
    menu.bgcolor=bgcolor;
    menu.highlight=highlight;
    menu.height=cur_y-ypos;
    menu.width=item_width;
    menu.left=xpos;
    menu.top=ypos;
}

function buildtree_ie( menu, liste, bgcolor, highlight, xpos, ypos ) {
var n;
    var newcolor;
    var cur_y;
    var cur_height;
    var lines;
    var fcolor;
    cur_y=ypos;
    fcolor="#ffffff";

    for (n=0;n<liste.length;n++) {

        if (liste.length-n==last_items && last_items!=0 && menu==topmenu) { cur_y=cur_y+last_space; fcolor="#D6D7D6"; }
        else {
            //search in list param3 for "isKonzernToechter" set in the nav_home.jsp if the menu ebene1 item is "KonzernToechter"
            var iSuche = -1;
            if (liste[n][3] != null) iSuche = liste[n][3].indexOf("isKonzernToechter");
            if (iSuche!=-1) {
                //alert("buildtree_ie - \nLabel   = " + liste[n][0] + "\nListe1 = " + liste[n][1] + "\nListe2 = " + liste[n][2] + "\nListe3 = " + liste[n][3]);
                cur_y=cur_y+last_space; fcolor="#D6D7D6";
            }
        }

        suffix=suffix+1;
        label=liste[n][0];
        if (reallength(label)>19) { lines=1.7; }
        else { lines=1; }

        //search in list param4 for "isKonzernToechter" set in the nav_main.jsp if the menu ebene1 item is "KonzernToechter"
        var iSuche4 = -1;
        if (liste[n][4] != null) iSuche4 = liste[n][4].indexOf("isKonzernToechter");
            if (iSuche4!=-1) {
                lines=4.2;
        }

        cur_height=parseInt(item_height*lines);

        menu.items[n]=new o_item_ie();
        menu.items[n].parent=menu;
        menu.itemscount=menu.itemscount+1;

        if (liste[n][4] != null && liste[n][4].indexOf("viewIsFalse")>=0) {
            //alert("Liste - \nLabe0   = " + liste[n][0] + "\nListe1 = " + liste[n][1] + "\nListe2 = " + liste[n][2] + "\nListe3 = " + liste[n][3] + "\nListe4 = " + liste[n][4]);
            cur_height=0
        } else {

        lstring='<div id="menue_layer'+suffix+'" style="position:absolute; z-index:3; width:'+item_width+'px; height:'+cur_height+'px; left: '+xpos+'px; top: '+cur_y+'px; background-color: '+bgcolor+'; visibility: hidden"></div>';
        document.body.insertAdjacentHTML("BeforeEnd",lstring);
        menu.items[n].layer=eval('document.all.menue_layer'+suffix+'.style' );

        HM_FontFamily="Helvetica, Arial,sans-serif";
        HM_FontSize=10;

        lstring='<div id="menue_text'+suffix+'" style="position:absolute; z-index:3; width:'+(item_width-8)+'px; height:'+(cur_height-2)+'px; left: '+(xpos+7)+'px; top: '+(cur_y+2)+'px; visibility: hidden"><p style="font-size:13px"><font face="Arial, Helvetica, sans-serif" color="'+fcolor+'">' + label + '</FONT></p></div>';
        document.body.insertAdjacentHTML("BeforeEnd",lstring);
        menu.items[n].text=eval('document.all.menue_text'+suffix+'.style' );

        lstring='<div id="menue_trenner'+suffix+'" style="position:absolute; z-index:3; width:'+item_width+'px; height:1px; left: '+xpos+'px; top: '+(cur_y+cur_height-1)+'px; background-color: #FFC199; visibility: hidden"><img src="/repository/1/internet_gr/_home/_imagesDynamo/trans.gif" width=1 height=1></div>';
        document.body.insertAdjacentHTML("BeforeEnd",lstring);
        menu.items[n].trenner=eval('document.all.menue_trenner'+suffix+'.style' );

        if (iSuche4!=-1) {
            //no href on konzerntoechter sites at the übersicht menue
        } else {
            lstring='<div id="menue_over'+suffix+'" style="position:absolute; z-index:3; width:'+item_width+'px; height:'+cur_height+'px; left: '+xpos+'px; top: '+cur_y+'px; visibility: hidden"><a class="link-loesung" target="_top" href="'+ liste[n][1] +'"><img src="/repository/1/internet_gr/_home/_imagesDynamo/trans.gif" width='+item_width+' height='+(cur_height)+' border=0 alt=""></a></div>';
            document.body.insertAdjacentHTML("BeforeEnd",lstring);
            menu.items[n].over=eval('document.all.menue_over'+suffix+'.style' );
        }
        lstring='<div id="menue_o_trenner'+suffix+'" style="position:absolute; z-index:4; width:'+item_width+'px; height:1px; left: '+xpos+'px; top: '+(cur_y-1)+'px; background-color: #ffffff; visibility: hidden"><img src="/repository/1/internet_gr/_home/_imagesDynamo/trans.gif" width=1 height=1></div>';
        document.body.insertAdjacentHTML("BeforeEnd",lstring);
        menu.items[n].o_trenner=eval('document.all.menue_o_trenner'+suffix+'.style' );

        lstring='<div id="menue_u_trenner'+suffix+'" style="position:absolute; z-index:4; width:'+item_width+'px; height:1px; left: '+xpos+'px; top: '+(cur_y+cur_height-1)+'px; background-color: #ffffff; visibility: hidden"><img src="/repository/1/internet_gr/_home/_imagesDynamo/trans.gif" width=1 height=1></div>';
        document.body.insertAdjacentHTML("BeforeEnd",lstring);
        menu.items[n].u_trenner=eval('document.all.menue_u_trenner'+suffix+'.style' );
        
        if (liste[n][2]!=0) {
            menu.items[n].haschild=1;

            if (n==def_on) { t_cur_y=blende_top; }
            else { t_cur_y=cur_y; }

            buildtree_ie ( menu.items[n].child, eval ('items_'+liste[n][2]), "#FF6300", "#FFA267", item_width+xpos+1, t_cur_y);
        }
        cur_y=cur_y+cur_height;
    }}
    // entory AG 15.07.2003 The following !use_blende check was not in the nav_home.jsp javscript-funtion (only in nav_main.jsp)
    if (isFunctionCallFromNavMainJSP == true){
        if (!use_blende) {
            // alert("!use_blende (NavMain");
            lstring='<div id="spacer'+suffix+'" style="position:absolute; z-index:3; width:'+item_width+'px; height:'+last_space+'px; left: '+xpos+'px; top: '+cur_y+'px; background-color: '+bgcolor+'; visibility: hidden"></div>';
            document.body.insertAdjacentHTML("BeforeEnd",lstring);
            menu.spacer=eval('document.all.spacer'+suffix+'.style' );
            cur_y=cur_y+last_space;
        }
    }
    menu.bgcolor=bgcolor;
    menu.highlight=highlight;
    menu.height=cur_y-ypos;
    menu.width=item_width;
    menu.left=xpos;
    menu.top=ypos;
}

