<!--[62,36,2821] published at 2006-06-15 14:54:39 from #008 by 517-->

    <!--
    var Tree = new Array;

Tree[0] = "2|0|<b><font color=#000000 class=f14>装修流程表</font></b>|0";
Tree[1] = "1|2|<A href='javascript:oc(1,0);'><font color=#000000 class=f14>一、前期准备</font></a>|1";
Tree[2] = "11|1|<a href='002.html' class=ti2 target='lcnr'>101 收房验房</a>|2";
Tree[3] = "12|1|<a href='003.html' class=ti2 target='lcnr'>102 调查研究</a>|2";
Tree[4] = "13|1|<a href='004.html' class=ti2 target='lcnr'>103 资金准备</a>|2";
Tree[5] = "3|2|<A href='javascript:oc(3,0);'><font color=#000000 class=f14>二、选择装修公司</font>|1";
Tree[6] = "31|3|<a href='005.html' class=ti2 target='lcnr'>201 资质考察</a>|2";
Tree[7] = "32|3|<a href='006.html' class=ti2 target='lcnr'>202 装修合同</a>|2";
Tree[8] = "33|3|<a href='007.html' class=ti2 target='lcnr'>203 杀价技巧</a>|2";
Tree[9] = "4|2|<A href='javascript:oc(4,0);'><font color=#000000 class=f14>三、设计选定方案</font>|1";
Tree[10] = "41|4|<a href='008.html' class=ti2 target='lcnr'>301 整体设计</a>|2";
Tree[11] = "42|4|<a href='009.html' class=ti2 target='lcnr'>302 制定预算</a>|2";
Tree[12] = "5|2|<A href='javascript:oc(5,0);'><font color=#000000 class=f14>四、选购建材</font>|1";
Tree[13] = "51|5|<a href='010.html' class=ti2 target='lcnr'>401 建材城</a>|2";
Tree[14] = "52|5|<a href='011.html' class=ti2 target='lcnr'>402 瓷砖</a>|2";
Tree[15] = "53|5|<a href='012.html' class=ti2 target='lcnr'>403 地板</a>|2";
Tree[16] = "54|5|<a href='013.html' class=ti2 target='lcnr'>404 橱柜</a>|2";
Tree[17] = "55|5|<a href='014.html' class=ti2 target='lcnr'>405 洁具</a>|2";
Tree[18] = "56|5|<a href='015.html' class=ti2 target='lcnr'>406 门窗</a>|2";
Tree[19] = "57|5|<a href='016.html' class=ti2 target='lcnr'>407 涂料</a>|2";
Tree[20] = "58|5|<a href='017.html' class=ti2 target='lcnr'>408 五金</a>|2";
Tree[21] = "59|5|<a href='018.html' class=ti2 target='lcnr'>409 灯具</a>|2";
Tree[22] = "510|5|<a href='019.html' class=ti2 target='lcnr'>410 板材</a>|2";
Tree[23] = "511|5|<a href='020.html' class=ti2 target='lcnr'>411 其他</a>|2";
Tree[24] = "6|2|<A href='javascript:oc(6,0);'><font color=#000000 class=f14>五、装修施工</font>|1";
Tree[25] = "61|6|<a href='021.html' class=ti2 target='lcnr'>501 开工准备</a>|2";
Tree[26] = "62|6|<a href='022.html' class=ti2 target='lcnr'>502 材料进场</a>|2";
Tree[27] = "63|6|<a href='023.html' class=ti2 target='lcnr'>503 结构改造</a>|2";
Tree[28] = "64|6|<a href='024.html' class=ti2 target='lcnr'>504 水电改造</a>|2";
Tree[29] = "65|6|<a href='025.html' class=ti2 target='lcnr'>505 隐蔽工程</a>|2";
Tree[30] = "66|6|<a href='026.html' class=ti2 target='lcnr'>506 贴瓷砖</a>|2";
Tree[31] = "67|6|<a href='027.html' class=ti2 target='lcnr'>507 铺地板</a>|2";
Tree[32] = "68|6|<a href='028.html' class=ti2 target='lcnr'>508 木工活</a>|2";
Tree[33] = "69|6|<a href='029.html' class=ti2 target='lcnr'>509 刷油漆涂料</a>|2";
Tree[34] = "610|6|<a href='030.html' class=ti2 target='lcnr'>510 贴壁纸</a>|2";
Tree[35] = "7|2|<A href='javascript:oc(7,0);'><font color=#000000 class=f14>六、监督验收</font>|1";
Tree[36] = "71|7|<a href='031.html' class=ti2 target='lcnr'>601 家装监理</a>|2";
Tree[37] = "72|7|<a href='032.html' class=ti2 target='lcnr'>602 核算装修款</a>|2";
Tree[38] = "73|7|<a href='033.html' class=ti2 target='lcnr'>603 完工验收</a>|2";
Tree[39] = "74|7|<a href='034.html' class=ti2 target='lcnr'>604 保修服务</a>|2";
Tree[40] = "75|7|<a href='035.html' class=ti2 target='lcnr'>605 装修污染</a>|2";
Tree[41] = "8|2|<a href='http://bbs.homedg.com/bbs/index.asp?boardid=11' class=ti2 target='blank'><font class=f14>七、我要投诉</font></a>|1";
    // Arrays for nodes and icons
    var nodes	= new Array();
    var icons	= new Array(6);

    var aNodeValues  = new Array(Tree.length);
    for (i=0; i<Tree.length; i++) {
        aNodeValues[i] = Tree[i].split("|");
    }

    // Loads all icons that are used in the tree
    function preloadIcons() {
        icons[0] = new Image();
        icons[0].src = "images/plus.gif";
        icons[1] = new Image();
        icons[1].src = "images/plusbottom.gif";
        icons[2] = new Image();
        icons[2].src = "images/minus.gif";
        icons[3] = new Image();
        icons[3].src = "images/minusbottom.gif";
        icons[4] = new Image();
        icons[4].src = "images/folder.gif";
        icons[5] = new Image();
        icons[5].src = "images/folderopen.gif";
    }

    // Create the tree
    function createTree(arrName, startNode) {
        nodes = arrName;
        if (nodes.length > 0) {
            preloadIcons();
            if (startNode == null) startNode = 0;
            if (startNode !=0) {
                var nodeValues = nodes[getArrayId(startNode)].split("|");
                document.write("<img src=\"images/folderopen.gif\" align=\"absmiddle\" alt=\"\" />" + nodeValues[2] + "<br />");
            } else document.write("<img src=\"images/base.gif\" align=\"absmiddle\" alt=\"\" />Website<br />");

            var recursedNodes = new Array();
            addNode(startNode, recursedNodes, 0);

        }
    }
    // Returns the position of a node in the array
    function getArrayId(node) {
        for (i=0; i<nodes.length; i++) {
            if (aNodeValues[i][0]==node) return i;
        }
    }

    // Checks if a node has any children
    function hasChildNode(i) {
        if (i < Tree.length-1) {
            if (aNodeValues[i][3] < aNodeValues[i + 1][3]) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
    // Checks if a node is the last sibling
    function lastSibling (i) {
        if (i < Tree.length-1) {
            if (aNodeValues[i][3] > aNodeValues[i + 1][3]) {
                return true;
            } else if (aNodeValues[i][3] == aNodeValues[i + 1][3]) {
                return false;
            } else if (aNodeValues[i][3] < aNodeValues[i + 1][3]) {
                for (k = i + 2 ; k < Tree.length; k++) {
                    if (aNodeValues[i][1] == aNodeValues[k][1]) {
                        return false;
                    }
                }
                return true;
            }
        } else {
            return true;
        }
    }

    // Adds a new node in the tree
    function addNode(parentNode, recursedNodes, k) {

        for (var i = k; i < nodes.length; i++) {
            if (aNodeValues[i][1] == parentNode) {

                var ls	= lastSibling(i);
                var hcn	= hasChildNode(i);
                var ino = (current.substring(i-1,i) == 1)?true:false;

                // Write out line & empty icons
                for (g=0; g<recursedNodes.length; g++) {
                    if (recursedNodes[g] == 1) {
                        document.write("<img src=\"images/line.gif\" align=\"absmiddle\" alt=\"\" />");
                    } else {
                        document.write("<img src=\"images/empty.gif\" align=\"absmiddle\" alt=\"\" />");
                    }
                }

                // put in array line & empty icons
                if (ls) {
                    recursedNodes.push(0);
                } else {
                    recursedNodes.push(1);
                }

                // Write out join icons
                if (hcn) {
                    if (ls) {
                        document.write("<a onClick=\"toggle(" + i + ")\" href=\"javascript: oc(" + aNodeValues[i][0] + ", 1);\"><img id=\"join" + aNodeValues[i][0] + "\" src=\"images/");
                        if (ino) {
                            document.write("minus");
                        } else {
                            document.write("plus");
                        }
                        document.write("bottom.gif\" align=\"absmiddle\" alt=\"打开/关闭\" /></a>");
                    } else {
                        document.write("<a onClick=\"toggle(" + i + ")\" href=\"javascript: oc(" + aNodeValues[i][0] + ", 0);\"><img id=\"join" + aNodeValues[i][0] + "\" src=\"images/");
                        if (ino) {
                            document.write("minus");
                        } else {
                            document.write("plus");
                        }
                        document.write(".gif\" align=\"absmiddle\" alt=\"打开/关闭\" /></a>");
                    }
                    // Write out folder & page icons
                    document.write("<img id=\"icon" + aNodeValues[i][0] + "\" src=\"images/folder")
                    if (ino) {
                        document.write("open");
                    }
                    document.write(".gif\" align=\"absmiddle\" alt=\"文件包\" />");
                } else {
                    if (ls) {
                        document.write("<img src=\"images/join.gif\" align=\"absmiddle\" alt=\"\" />");
                    } else {
                        document.write("<img src=\"images/joinbottom.gif\" align=\"absmiddle\" alt=\"\" />");
                    }
                    // Write out folder & page icons
                    document.write("<img id=\"icon" + aNodeValues[i][0] + "\" src=\"images/page.gif\" align=\"absmiddle\" alt=\"页面\" />");
                }

                // Write out node name
                document.write(aNodeValues[i][2]);
                document.write("<br/>");

                if (hcn) {
                    // If node has children write out divs and go deeper
                    document.write("<div id=\"div" + aNodeValues[i][0] + "\"");
                    if (!ino) {
                        document.write(" style=\"display: none;\"");
                    }
                    document.write(">");
                    addNode(aNodeValues[i][0], recursedNodes, i);
                    document.write("</div>");
                }

                // remove last line or empty icon
                recursedNodes.pop();
            }
        }
    }

    // Opens or closes a node
    function oc(node, bottom) {
        var theDiv  = document.getElementById("div" + node);
        var theJoin = document.getElementById("join" + node);
        var theIcon = document.getElementById("icon" + node);

        if (theDiv.style.display == 'none') {
            if (bottom==1) theJoin.src = icons[3].src;
            else theJoin.src = icons[2].src;
            theIcon.src = icons[5].src;
            theDiv.style.display = '';
        } else {
            if (bottom==1) theJoin.src = icons[1].src;
            else theJoin.src = icons[0].src;
            theIcon.src = icons[4].src;
            theDiv.style.display = 'none';
        }
    }

    // Push and pop not implemented in IE
    if(!Array.prototype.push) {
        function array_push() {
            for(var i=0;i<arguments.length;i++)
                this[this.length]=arguments[i];
            return this.length;
        }
        Array.prototype.push = array_push;
    }
    if(!Array.prototype.pop) {
        function array_pop(){
            lastElement = this[this.length-1];
            this.length = Math.max(this.length-1,0);
            return lastElement;
        }
        Array.prototype.pop = array_pop;
    }

    // Get current cookie setting
    var current=getCurrState()
    function getCurrState() {
      var label = "currState="
      var labelLen = label.length
      var cLen = document.cookie.length
      var i = 0
      while (i < cLen) {
        var j = i + labelLen
        if (document.cookie.substring(i,j) == label) {
          var cEnd = document.cookie.indexOf(";",j)
          if (cEnd == -1) { cEnd = document.cookie.length }
          return unescape(document.cookie.substring(j,cEnd))
        }
        i++
      }
      return ""
    }

    // Record current settings in cookie
    function setCurrState(setting) {
      var expire = new Date();
      expire.setTime(expire.getTime() + ( 30*24*60*60*1000 ) ); // expire in 1 month
      document.cookie = "currState=" + escape(setting) + "; expires=" + expire.toGMTString();
      }

    // Set the initial state if no current state or length changed
    if (current == "" || current.length != (Tree.length-1)) {
      current = ""
      initState = ""
      for (i = 1; i < Tree.length; i++) {
        initState += "0"
        current += "0"
      }
      setCurrState(initState);
    }

    // toggles an outline mother entry, storing new value in the cookie
    function toggle(n) {
      if (n != 0) {
        var newString = ""
        var expanded = current.substring(n-1,n) // of clicked item
        newString += current.substring(0,n-1)
        newString += expanded ^ 1 // Bitwise XOR clicked item
        newString += current.substring(n,current.length)
        setCurrState(newString) // write new state back to cookie
        current=newString;
      }
    }
createTree(Tree,2);
//toggle(1);
oc(1,0);
//toggle(3);
oc(3,0);
//toggle(4);
oc(4,0);
//toggle(5);
oc(5,0);
//toggle(6);
oc(6,0);
//toggle(7);
oc(7,0);

    //-->

