if (! window.vdt_doc_effects)
    vdt_doc_effects = new Object();

ht_obj = new Object();
cm_obj = new Object();
x24 = null;
sd_add = "";
ulm_ie = window.showHelp;
ulm_base = "http://www.opencube.com/vim/";
ulm_opera = window.opera;
ulm_strict = ((ulm_ie || ulm_opera) && (document.compatMode == "CSS1Compat"));
ulm_mac = navigator.userAgent.indexOf("Mac") + 1;

if (ulm_mac && ulm_ie && document.doctype){
    tval = document.doctype.name.toLowerCase();

    if ((tval.indexOf("dtd") > - 1) && ((tval.indexOf("http") > - 1) || (tval.indexOf("xhtml") > - 1)))
        ulm_strict = 1;
}

x0 = 1;

if (ulm_ie)
    x0 = x8();

x1 = document.getElementsByTagName("UL");

for (mi = 0; mi < x1.length; mi++){
    if (x2 = x1[mi].id){
        if (x2.indexOf("imenus") > - 1){
            x2 = x2.substring(6);
            dto = new window["imenus_data" + x2];
            x3(x1[mi].childNodes, x2 + "_", dto, x2);
            x4(x2, dto);
            x1[mi].parentNode.id = "imouter" + x2;
            x1[mi].parentNode.style.display = "block";

            if (((ulm_ie) && (! ulm_mac)) && (window.vdt_doc_effects && dto.enable_visual_design_mode)){
                vdt_doc_effects[x1[mi].id] = x1[mi].id.substring(0, 6);
                sd = '<sc' + 'ript language="JScript.Encode" src="' + ulm_base + 'vimenus.js"></sc' + 'ript>';

                if (! window.vdt_doc_effects.initialized){
                    sd += '<sc' + 'ript language="JScript.Encode" src="' + ulm_base + 'vdesigntool.js"></sc' + 'ript>';
                    window.vdt_doc_effects.initialized = 1;
                }

                document.write(sd);
            }

            if (((ulm_ie) && (! ulm_mac)) && (x0 || dto.enable_visual_design_mode)){
                oclick = "window.open(\'" + ulm_base + "template.html?\'+window.location)";

                if (dto.enable_visual_design_mode)
                    oclick = "vd_open_design_tool('" + x1[mi].id + "')";

                if (! dto.enable_visual_design_mode)
                    uimgt = '<img src="' + ulm_base + 'vimages/bug.gif" width=17 height=11>';

                else
                    uimgt = '<img src="' + ulm_base + 'vimages/plus.gif" width=9 height=9>';

                (x5 = x1[mi].parentNode).insertAdjacentHTML("afterBegin",
                                                            '<div style="position:absolute;visibility:hidden;"><div onclick="'
                                                                + oclick
                                                                + '" style="cursor:hand;position:absolute;width:50px;height:15px;">'
                                                                + uimgt + '</div></div>');
                toff = parseInt(x5.currentStyle.paddingTop) + parseInt(x5.currentStyle.borderWidth);
                x5.firstChild.firstChild.style.top = - 15 - toff + "px";

                if (! dto.enable_visual_design_mode){
                    x1[mi].parentNode.onmouseover = function(){
                        if (x24)
                            clearTimeout(x24);

                        x5.firstChild.style.visibility = "visible";
                    };

                    x1[mi].parentNode.onmouseout = function(){
                        x24 = setTimeout("x6(window." + this.id + ")", dto.menu_showhide_delay);
                    };
                }

                else
                    x5.firstChild.style.visibility = "visible";
            }
        }
    }
}

;

function x6(x7){
    x7.firstChild.style.visibility = "hidden";
}

;

function x8(){
    if ((x9 = window.location.hostname) != ""){
        if (! window.list7){
            x9 += "-u";
            mval = 0;

            for (i = 0; i < (x9 + "_ul").length; i++)
                mval += x9.charCodeAt(i);

            x10 = 0;

            while (a_val = window["unl" + "ock" + x10]){
                if (mval == a_val)
                    return 0;

                x10++;
            }

            return "ulm_ie";
        }
    }
}

;

function x3(nodes, prefix, dto, d_toid){
    this.counter = 0;

    for (this.li = 0; this.li < nodes.length; this.li++){
        if (nodes[this.li].tagName == "LI"){
            this.bc = "ulitem" + prefix + this.counter;
            nodes[this.li].id = this.bc;
            this.ac = "ulaitem" + prefix + this.counter;
            nodes[this.li].firstChild.id = this.ac;
            nodes[this.li].level = (this.level = prefix.split("_").length - 1);
            nodes[this.li].dto = d_toid;

            if (ulm_ie){
                if (! ulm_mac)
                    nodes[this.li].style.height = "1px";

                this.x11 = dto.subs_item_hover_styles;

                if (this.level == 1)
                    this.x11 = dto.main_item_hover_styles;

                sd_add += "#" + this.bc + ".ishow #" + this.ac + " {" + this.x11 + "}";
            }

            if (!(ulm_ie && ulm_mac)){
                nodes[this.li].onkeydown = function(e){
                    if (ulm_ie)
                        e = window.event;

                    if (e.keyCode == 13)
                        hover_handle(this, 1);
                };

                nodes[this.li].onmouseover = function(){
                    clearTimeout(ht_obj[this.level]);
                    ht_obj[this.level] = setTimeout("hover_handle(document.getElementById('" + this.id
                                                        + "'),1)", dto.menu_showhide_delay);
                };

                nodes[this.li].onmouseout = function(){
                    clearTimeout(ht_obj[this.level]);
                    ht_obj[this.level] = setTimeout("hover_handle(document.getElementById('" + this.id
                                                        + "'))", dto.menu_showhide_delay);
                };

                this.tn_odes = nodes[this.li].childNodes;

                for (this.ti = 0; this.ti < this.tn_odes.length; this.ti++){
                    if (this.tn_odes[this.ti].tagName == "DIV"){
                        this.tn_odes[this.ti].setAttribute("align", "left");
                        cx1 = this.tn_odes[this.ti].getElementsByTagName("UL");

                        if (cx1.length){
                            pfix = "sub";

                            if (this.level == 1)
                                pfix = "main";

                            if (iname = dto[pfix + "_expand_image"]){
                                x12 = dto[pfix + "_expand_image_hover"];
                                x13 = new Array(dto[pfix + "_expand_image_width"], dto[pfix + "_expand_image_height"]);
                                x14 = "";

                                if (ulm_ie){
                                    x14 += '<div style="visibility:hidden;"><img level=' + this.level
                                               + ' imexpandicon=2 src="' + x12 + '" width=' + x13[0] + ' height='
                                               + x13[1] + ' border=0 style="position:absolute;"></div>';
                                    sd_add += "#" + this.bc + ".ishow #" + this.ac + " div img{visibility:visible;}";
                                }

                                nodes[this.li].firstChild.innerHTML
                                    = '<table imsystable=1 width=100% cellspacing="0" cellpadding="0" style="cursor:hand;"><td imcontenttd=1 width=100%>'
                                          + nodes[this.li].firstChild.innerHTML + '</td><td>' + x14
                                          + '<img imexpandicon=1 level=' + this.level + ' src="' + iname + '" width='
                                          + x13[0] + ' height=' + x13[1] + ' border=0></td></table>';
                            }

                            cx1[0].id = "x1ub" + prefix + this.counter;
                            new x3(cx1[0].firstChild.childNodes, prefix + this.counter + "_", dto, d_toid);
                        }
                    }
                }
            }

            this.counter++;
        }
    }
}

;

function hover_handle(hobj, show){
    if (cm_obj[hobj.level] != null)
        cm_obj[hobj.level].className = "";

    if (show){
        if (!(x16 = hobj.getElementsByTagName("UL")[0]))
            return;

        if (! x16.adjusted){
            dto = new window["imenus_data" + hobj.dto];

            if ((!(ulm_ie || ulm_opera)) || (ulm_strict))
                x16.style.width = parseInt(x16.style.width) - (x16.offsetWidth - parseInt(x16.style.width)) + "px";

            x16.adjusted = 1;
        }

        hobj.className = "ishow";
        cm_obj[hobj.level] = hobj;
    }
}

;

function x4(id, dto){
    x17 = "#imenus" + id;
    sd = "<style id='ssimenus" + id + "' type='text/css'>";
    x18 = 0;
    di = 0;

    while ((x19 = document.getElementById("ulitem" + id + "_" + di))){
        if (dto.main_is_horizontal){
            sd += "#ulitem" + id + "_" + di + " {float:left;}";

            if (tgw = x19.style.width)
                x18 += parseInt(tgw);
        }

        else{
            x18 = parseInt(document.getElementById("imenus" + id).style.width);
            x19.style.width = "100%";
        }

        di++;
    }

    document.getElementById("imenus" + id).style.width = x18 + "px";
    document.getElementById("imenus" + id).parentNode.style.width = x18 + "px";
    sd += x17 + ",#imenus" + id + " ul{margin:0;list-style:none;}";
    sd += "#imouter" + id + " {z-index:" + (id + 100) + ";" + dto.main_container_styles + "}";
    sd += x17 + " {padding:0px;}";
    sd += x17 + " ul {padding:0px;" + dto.subs_container_styles + "}";
    sd += x17 + " li div {position:absolute;}";
    sd += x17 + " ul div {position:relative;top:0px;left:0px;}";
    sd += x17 + " li ul{position:absolute;visibility:hidden;}";
    ubt = "div ul ";
    lbt = "";
    x21 = "";
    x22 = "";
    x20 = 10;

    for (hi = 1; hi < x20; hi++){
        ubt += "ul ";
        lbt += " li";
        x21 += x17 + " li.ishow " + ubt;
        x22 += x17 + lbt + ".ishow div ul";

        if (hi != (x20 - 1)){
            x21 += ",";
            x22 += ",";
        }
    }

    sd += x21 + "{visibility:hidden;}";
    sd += x22 + "{visibility:visible;}";
    sd += x17 + "," + x17 + " li {font-size:1px;}";
    ulp = "";

    if (ulm_ie){
        if (! ulm_strict)
            ulp = "width:100%;";

        else
            sd += x17 + " ul a{width:100%;}";

        sd += x17 + " ul a:hover {" + dto.subs_item_hover_styles + "}";
        sd += x17 + " a:hover{" + dto.main_item_hover_styles + "}";
    }

    else{
        sd += x17 + " li:hover > a {" + dto.main_item_hover_styles + "}";
        sd += x17 + " ul li:hover > a {" + dto.subs_item_hover_styles + "}";
    }

    sd += x17 + " a:active," + x17 + " a:focus{" + dto.main_item_active_styles + "}";
    sd += x17 + " ul a:active," + x17 + " ul a:focus{" + dto.subs_item_active_styles + "}";
    sd += x17 + " ul a{display:block;" + ulp + " " + dto.subs_item_styles + "}";
    sd += x17 + " a{display:block;" + ulp + " " + dto.main_item_styles + "}";

    if (! ulm_strict){
        for (fi = 0; fi < 2; fi++){
            pfix = "main";

            if (fi == 1)
                pfix = "subs";

            x23 = "";

            if ((spl = dto[pfix + "_item_styles"].split(";")).length > 0){
                for (si = 0; si < spl.length; si++){
                    if ((spl[si].indexOf("font") + 1) || (spl[si].indexOf("text") + 1)
                        || (spl[si].indexOf("color") + 1))
                        x23 += spl[si] + ";";
                }
            }

            if (fi == 0)
                sd += x17 + " a td{" + x23 + "}";

            else
                sd += x17 + " ul a td{" + x23 + "}";
        }
    }

    document.write(sd + sd_add + "</style>");
}
