
        var jump = "0";
        var popdownid;
        var interval;
        var lev = "0";
        var current_id = '';
        var enter = '';

        function select_image(id,active,img)
        {
          var id_array = id.split('_');
          if(wp_chapter_id == id_array[1] && active != '' && enter=='' )
           {
              document[img].src = active;
              enter= 'no';
           }
           setTimeout('select_image()', 10);
           return true;

        }

        function expand(id)
        {
          try{
            var ul = document.getElementById("UL"+id);
            if (ul)
            {
                var listElementStyle=ul.style;
                listElementStyle.display="block";
            }
          }
          catch(e){}
        }
        function hover_menu_image_exists(id)
        {
          return hover_menu_images[id] != undefined && hover_menu_images[id] != "";
        }
        function active_menu_image_exists(id)
        {
          return active_menu_images[id] != undefined && active_menu_images[id] != "";
        }
        function mark_active(id)
        {
            // --- set current active
            try{
                if(active_menu_image_exists(id))
                {
                      var id_array = id.split('_');

                      if(wp_chapter_id == id_array[1])
                      {
                        document.getElementById("LI"+id + "_img").src = active_menu_images[id];
                        var orgFunction = document.getElementById("LI"+id).getAttribute("onmouseout").toString();
                        var oldImage = standard_menu_images[id];
                        var newImage = active_menu_images[id];
                        orgFunction = orgFunction.replace(oldImage, newImage);
                        var newFunction = new Function("(" + orgFunction + ")();");
                        document.getElementById("LI"+id).onmouseout = newFunction;

                        var orgFunction1 = document.getElementById("LI"+id).getAttribute("onmouseover").toString();
                        var oldImage1 = hover_menu_images[id];
                        var newImage1 = active_menu_images[id];
                        orgFunction1 = orgFunction1.replace(oldImage1, newImage1);
                        var newFunction1 = new Function("(" + orgFunction1 + ")();");
                        document.getElementById("LI"+id).onmouseover = newFunction1;
                        
                        hover_menu_images[id] = active_menu_images[id];


                      }
                }
            } 
            catch(e)
            {
                document.getElementById("LI"+id).className = document.getElementById("LI"+id).className + "_over";
            }

            // --- set parents active too
            try {
                var current_chap = document.getElementById("LI"+id);
                while(current_chap != "null" && current_chap.className.indexOf('root') == -1)
                {
                    try
                    {
                        if(active_menu_image_exists(current_chap.id.replace("ULnavigation", "navigation")))
                        {
                            document.getElementById(current_chap.id.replace("ULnavigation", "LInavigation") + "_img").src = active_menu_images[current_chap.id.replace("ULnavigation", "navigation")];

                            var orgFunction = document.getElementById(current_chap.id.replace("ULnavigation", "LInavigation")).getAttribute("onmouseout").toString();
                            var oldImage = standard_menu_images[current_chap.id.replace("ULnavigation", "navigation")];
                            var newImage = active_menu_images[current_chap.id.replace("ULnavigation", "navigation")];
                            orgFunction = orgFunction.replace(oldImage, newImage);
                            var newFunction = new Function("(" + orgFunction + ")();");
                            document.getElementById(current_chap.id.replace("ULnavigation", "LInavigation")).onmouseout = newFunction;
                        }
                    }
                    catch (e)
                    {
                        document.getElementById(current_chap.id.replace("ULnavigation", "LInavigation")).className = document.getElementById(current_chap.id.replace("ULnavigation", "LInavigation")).className + "_over";

                    }
                    current_chap = current_chap.parentNode;
                }
            } catch(e) {}
        }
        function expand_this_and_parents(id)
        {
              // --- make current and all it's parent UL nodes visible
            expand(id);
            try {
                var current_chap = document.getElementById("LI"+id);
                // --- recurse up to root node
                while(current_chap != "null" 
                    && current_chap.className.indexOf('root') == -1)
                {
                    // -- only affects UL (=level) nodes
                    if (current_chap.id.indexOf('ULnavigation') != -1)
                        current_chap.style.display = "block";
                    current_chap = current_chap.parentNode;
                }
            } catch(e) {}

            // --- set current active
            try{
                if(hover_menu_image_exists(id))
                {
                      var id_array = id.split('_');

                      if(wp_chapter_id == id_array[1])
                      {
                        document.getElementById("LI"+id + "_img").src = hover_menu_images[id];
                        /*
                        var orgFunction = document.getElementById("LI"+id).getAttribute("onmouseout").toString();
                        var oldImage = standard_menu_images[id];
                        var newImage = active_menu_images[id];
                        orgFunction = orgFunction.replace(oldImage, newImage);
                        var newFunction = new Function("(" + orgFunction + ")();");
                        document.getElementById("LI"+id).onmouseout = newFunction;
                        */
                      }
                }
            } 
            catch(e)
            {
                document.getElementById("LI"+id).className = document.getElementById("LI"+id).className + "_over";
            }

            // --- set parents active too
            try {
                var current_chap = document.getElementById("LI"+id);
                while(current_chap != "null" && current_chap.className.indexOf('root') == -1)
                {
                    try
                    {
                        if(hover_menu_image_exists(current_chap.id.replace("ULnavigation", "navigation")))
                        {
                            document.getElementById(current_chap.id.replace("ULnavigation", "LInavigation") + "_img").src = hover_menu_images[current_chap.id.replace("ULnavigation", "navigation")];
                            /*
                            var orgFunction = document.getElementById(current_chap.id.replace("ULnavigation", "LInavigation")).getAttribute("onmouseout").toString();
                            var oldImage = standard_menu_images[current_chap.id.replace("ULnavigation", "navigation")];
                            var newImage = active_menu_images[current_chap.id.replace("ULnavigation", "navigation")];
                            orgFunction = orgFunction.replace(oldImage, newImage);
                            var newFunction = new Function("(" + orgFunction + ")();");
                            document.getElementById(current_chap.id.replace("ULnavigation", "LInavigation")).onmouseout = newFunction;
                            */
                        }
                    }
                    catch (e)
                    {
                        document.getElementById(current_chap.id.replace("ULnavigation", "LInavigation")).className = document.getElementById(current_chap.id.replace("ULnavigation", "LInavigation")).className + "_over";

                    }
                    current_chap = current_chap.parentNode;
                }
            } catch(e) {}
        }

        function minimize(id){
          try{ 
            var ul = document.getElementById("UL"+id);
            if (ul)
            {
                var listElementStyle=ul.style;
                listElementStyle.display="none";
            }
          }
          catch(e){}
        }

        function popup(id, posclass, iover, level)
        {
          
            var el = document.getElementById("LI"+id);
            
            var cl = document.getElementById("LI"+id).className;

            var imgov = document.getElementById("LI"+id+"_img");

           if (imgov) {
               if (iover !='') imgov.src =iover;
            }

            if (el) el.className = "L"+level+posclass+"_over";

            var ul = document.getElementById("UL"+id);
            if (ul) ul.style.display="block";
        }

        function navHi(id, posclass, iover, level)
        {
            try
            {
                var el = document.getElementById("LI"+id);            
                var cl = document.getElementById("LI"+id).className;
                var imgov = document.getElementById("LI"+id+"_img");            
                if (imgov) if (iover !='') imgov.src =iover;
                if (el) el.className = "L"+level+posclass+"_over";
            } catch(e) {}
        }
        function navLo(id, posclass, iout, level)
        {
            try
            {
                var el = document.getElementById("LI"+id);
                var cl = document.getElementById("LI"+id).className;
                if (el) el.className = "L"+level+""+posclass;
                var imgout = document.getElementById("LI"+id+"_img");
                if (iout !='') if (imgout) imgout.src =iout;
            } catch(e) {}
        }

        function jumpto(link, id)
        {
                jumper = id.length/2; 
                if (jump == '0')
                {
                    window.location.href= wpPathToRoot + link + 'index' + wp_file_lang + '.html';
                    jump = jumper;
                }
                if (jumper == '1') jump = '0';
        }
        function pdwn(id, posclass, iout, level)
        {
            popdown(id, posclass, iout, level);
        }
        function popdown(id, posclass, iout, level)
        {
                if (id!="")
                {
                    var ul = document.getElementById("UL"+id);
                    if (ul)
                    {
                        var listElementStyle=ul.style;
                        listElementStyle.display="none";
                    }
                    var el = document.getElementById("LI"+id);
                    var cl = document.getElementById("LI"+id).className;
                    if (el) el.className = "L"+level+""+posclass;
                    var imgout = document.getElementById("LI"+id+"_img");
                    
                    if (iout !='') if (imgout) imgout.src =iout;
                }
        }
        function popdownAll()
        {
            while (openIDs.length > 0)
            {
                var openID = openIDs.pop();
                popdown(openID[0], openID[1], openID[2], openID[3]); 
            }
        }

    