/***************************************************
	Revisions:
	---------
	Date		-	03/04/2004
	Author	-	Stuart Wootton (Contractor)
	Purpose	-	Update show hide div functionality
				to work correctly with NS6 and other
				browsers. Replaced original code using
				dgm__showmenu_codeX	and
				dgm__hidemenu_codeX variables to
				show hide div tag in body with call
				to generic function Show_Hide_Div() in 
				dgm_loader js using single initialized 
				variable dgm__strDivName from 
				menudatahideall js holding div name.
				By this method only the generic
				function Show_Hide_Div() has to be altered
				to cater for new browser syntax to 
				cope with show hiding the div tag. 
	Date		-	03/04/2004
	Author	-	Stuart Wootton (Contractor)
	Purpose	-	Reformated javscript.
****************************************************/

q82 = null;
q93 = null;
q94 = null;
q95 = null;
sub_q98 = "";
item_q98 = "";
onload_finished = false;
off_x = 0;
off_y = 0;

if (q150 && q145)
    {
    off_x = dqm__ie4mac_offset_X;

    off_y = dqm__ie4mac_offset_Y;
    }

strict = false;

if ((!q145) && (document.doctype))
    strict = true;

document.onmousemove = dqm__handleMouseMove;

if (!window.dqm__cancel_onload)
    {
    onresize = dqm__handleResize;

    onload = dqm__handleOnload;
    }

q18 = q100();

for (m = 0; m < q18; m++)
    if (q105[m])
        q0(m + "");

for (j = 0; j < q19.length; j++)
    q0(q19[j]);

q83 = "";

for (j = 0; j < q18; j++)
    {
    if (q121[j])
        {
        imgwh = q33(eval("dqm__rollover_wh" + j));

        q83 += "<img id=qmim" + j
                   + " style='position:absolute;cursor:hand;cursor:pointer;z-index:9;visibility:hidden;' src='" + eval(
                                                                                                                      "dqm__rollover_image" + j) + "' width=" + imgwh[0] + " height=" + imgwh[1] + " border='0' onclick=\"q32('" + j
                   + "')\">";
        }
    }

document.write(q83);
document.close();
;

function q0(mindex)
    {
    level = 0;

    i = 0;

    while ((i = mindex.indexOf("_", i + 1)) > -1)
        level++;

    bw = q15("dqm__border_width", 0, mindex);
    q50 = q15("dqm__sub_menu_width", 0, mindex);
    bc = q15("dqm__border_color", 0, mindex);
    dh = q15("dqm__divider_height", 0, mindex);
    hltc = q15("dqm__hl_textcolor", 0, mindex);
    q144 = q15("dqm__textcolor", 0, mindex);
    sd = "<div id=qm" + mindex + " style='z-index:900" + level + ";cursor:pointer;position:absolute;top:" + 0
             + "px;left:" + 0 + "px;visibility:hidden;width:" + q50 + "px;";

    if (bc != "transparent")
        sd += " background-color:" + bc + ";";

    sd += "'>";
    i = 0;

    while (q16("window.dqm__subdesc" + mindex + "_" + i))
        {
        id = mindex + "_" + i;

        if (q16("window.dqm__subdesc" + id + "_0"))
            q19 = q19.concat(new Array(id));

        iid = -1;
        tval = q16("window.dqm__icon_index" + mindex + "_" + i);

        if ((tval || tval == 0) && q16("window.dqm__icon_image" + tval))
            {
            iid = tval;

            q52 = q33(q16("dqm__icon_image_wh" + iid));
            q51 = q16("window.dqm__icon_rollover" + iid);
            }

        ttn = dqm__margin_left + dqm__margin_right;

        if (!q150 && q145)
            ttn = 0;

        q47 = "style='position:absolute;cursor:hand;left:" + bw + "px;top:" + bw + "px;width:" + (q50 - (bw * 2) - ttn)
                  + "px;";
        q48 = " font-style:" + dqm__fontstyle + ";font-weight:" + dqm__fontweight + ";font-size:" + dqm__fontsize
                  + "px;font-family:" + dqm__fontfamily + ";padding-left:" + dqm__margin_left + "px;padding-right:"
                  + dqm__margin_right + "px;padding-top:" + dqm__margin_top + "px;padding-bottom:" + dqm__margin_bottom
                  + "px;";
        q49 = "";

        if (iid > -1)
            q49 = "' border=0 width='" + q52[0] + "' height='" + q52[1] + "'>";

        q92 = q15("dqm__menu_bgcolor", 0, mindex);
        mbgc_hl = q15("dqm__hl_bgcolor", 0, mindex);
        q130 = q15("dqm__text_alignment", 0, mindex);
        sd += "<div align='" + q130 + "' id=qmitemst" + id + " " + q47 + " background-color:" + q92 + ";";
        sd += q48 + " text-decoration:" + dqm__textdecoration + ";color:" + q144 + ";'>";
        q125 = "";

        if (iid > -1)
            q125 = "<img src='" + q16("dqm__icon_image" + iid) + q49;

        tval = q16("dqm__subdesc" + id);
        (q130 == "right") ? sd += tval + q125 : sd += q125 + tval;
        q131 = "";
        q132 = "";
        q129 = "";
        q134 = "";
        tval = q16("window.dqm__2nd_icon_index" + mindex + "_" + i);

        if ((tval || tval == 0) && q16("window.dqm__2nd_icon_image" + tval))
            {
            q126 = tval;

            q127 = q33(q16("dqm__2nd_icon_image_wh" + q126));
            q128 = q33(q16("dqm__2nd_icon_image_xy" + q126));
            q129 = q16("dqm__2nd_icon_rollover" + q126);
            q134 = q16("dqm__2nd_icon_image" + q126);
            q140 = 0;

            if (q150 && q145)
                q140 = dqm__margin_left;

            (q130 == "left") ? tval = (q50 - (bw * 2) - dqm__margin_right - q127[0] + q128[0] - q140)
                : tval = bw + dqm__margin_left + q128[0];
            q131 = "<img style='position:absolute;top:" + q128[1] + "px;left:" + tval + "px;' src='";
            q132 = "' width='" + q127[0] + "' height='" + q127[1] + "'>";
            }

        sd += q131 + q134 + q132 + "</div>";
        sd += "<div align='" + q130 + "' id=qmitemhl" + id + " " + q47 + " visibility:hidden;background-color:"
                  + mbgc_hl + ";";
        sd += q48 + " text-decoration:" + dqm__hl_textdecoration + ";color:" + hltc + ";" + item_q98;
        sd += "' onclick=\"q32('" + id + "')\">";
        q125 = "";

        if (iid > -1)
            q125 += "<img src='" + q51 + q49;

        tval = q15("dqm__hl_subdesc" + id, q16("dqm__subdesc" + id));
        (q130 == "right") ? sd += tval + q125 : sd += q125 + tval;
        sd += q131 + q129 + q132 + "</div>";
        i++;
        }

    document.write(sd + "</div>");
    }

;

function q1(id, main)
    {
    sub = q141("qm" + id);

    if (!q145)
        subc = sub.getElementsByTagName("div");

    else
        subc = sub.children;

    bw = q15("dqm__border_width", 0, id);
    dh = q15("dqm__divider_height", 0, id);
    q140 = 0;

    if (q145 && q150)
        q140 = dqm__margin_top + dqm__margin_bottom;

    ih = bw;

    for (j = 0; j < subc.length; j = j + 2)
        {
        subc[j].style.top = ih + "px";

        subc[j + 1].style.top = ih + "px";
        ih += subc[j].offsetHeight + dh + q140;

        if (j > subc.length - 3)
            ih -= dh;
        }

    ih += bw;
    sub.style.height = ih + "px";
    sub.lasthl = null;
    sub.q60 = null;
    sxy = q33(q15("dqm__sub_xy" + id, dqm__sub_xy));

    if (main)
        {
        if (!q145)
            q140 = document.getElementById("dqm_menu" + id);

        else
            q140 = eval("document.dqm_menu" + id);

        if (q140)
            {
            q85 = q141("dqm_menu" + id);

            tc = q17(q85);
            sub.style.left = tc.x + sxy[0] + q85.offsetWidth + off_x + "px";
            sub.style.top = tc.y + sxy[1] + off_y + "px";
            }
        }

    else
        {
        psub = q141("qm" + id.substring(0, id.lastIndexOf("_")));

        nenuzz = parseInt(q141("qmitemst" + id).style.top);
        sub.style.left = psub.offsetLeft + psub.offsetWidth + sxy[0] + "px";
        sub.style.top = psub.offsetTop + nenuzz + sxy[1] + "px";
        }
    }

;

function q103(id)
    {
    if (!q145)
        q140 = document.getElementById("dqm_menu" + id);

    else
        q140 = eval("document.dqm_menu" + id);

    if ((q140) && (q121[id]))
        {
        q87 = q17(q141("dqm_menu" + id));

        q88 = q141("qmim" + id);
        q88.style.left = q87.x + off_x + "px";
        q88.style.top = q87.y + off_y + "px";
        }
    }

;

function q4(menu)
    {
    q141("qmitemhl" + menu.lasthl).style.visibility = "hidden";

    q122(true);
    menu.lasthl = null;
    }

;

function q5(menu, hl_id)
    {
    q30(menu);

    q141("qmitemhl" + hl_id).style.visibility = "visible";
    q122(false, hl_id);
    q86 = menu.q60;

    if ((q86 != null) && (hl_id.indexOf(q86) == -1))
        {
        q141("qmitemhl" + q86).style.visibility = "hidden";

        q6(q86);
        }

    menu.q60 = null;

    if (popIt(hl_id))
        menu.q60 = hl_id;

    menu.lasthl = hl_id;
    q95 = menu;
    }

;

function q111()
    {
    if (q93 != null)
        clearTimeout(q93);
    }

;

function detectSource(o)
    {
    if (!q145)
        q64 = o.parentNode;

    else
        q64 = o.parentElement;

    while (q64 != null)
        {
        if (q64.id != "")
            return q64.id;

        if (!q145)
            q64 = q64.parentNode;

        else
            q64 = q64.parentElement;
        }

    return "";
    }

;

function dqm__handleMouseMove(e)
    {
    if (!q61)
        {
        if ((q145) && (onload_finished))
            {
            dqm__handleOnload();

            q61 = true;
            }

        return;
        }

    if (!q145)
        {
        q84 = e.target.id;

        q81 = detectSource(e.target);
        }

    else
        {
        q84 = event.srcElement.id;

        q81 = detectSource(event.srcElement);
        }

    if (!q81)
        q81 = "";

    if (!q84)
        q84 = "";

    tid = "n";

    if (q84.indexOf("dqm_menu") > -1)
        {
        q111();

        tid = q84.substring(8);
        q79(tid);
        }

    else
        {
        if (q84.indexOf("qmitem") > -1)
            tid = q84;

        else if (q81.indexOf("qmitem") > -1)
            tid = q81;

        else
            {
            if ((q82 != null) && (q84.indexOf("qm") < 0))
                {
                q122(true);

                q94 = q82;

                if (q95 != null)
                    q30(q95);

                q111();
                (q105[q94]) ? q93 = setTimeout("q96()", dqm__mouse_off_delay) : q96();
                return;
                }

            if (q84.indexOf("qmim") > -1)
                {
                q111();

                q84 = q84.substring(4);
                q122(false, q84);

                if (q105[q84])
                    q89(q84);

                return;
                }
            }

        q111();

        if (tid.indexOf("st") > -1)
            {
            tid = tid.substring(8);

            q5(q141("qm" + tid.substring(0, tid.lastIndexOf("_"))), tid);
            return;
            }

        else if (tid.indexOf("qmitemhl") > -1)
            {
            tid = tid.substring(8);

            q90 = q141("qm" + tid.substring(0, tid.lastIndexOf("_")));

            if (q90.q60 != null)
                {
                q122(false, tid);

                q89(tid);
                }
            }
        }
    }

;

function q89(index)
    {
    q91 = q141("qm" + index);

    if (q91.q60 != null)
        {
        q6(q91.q60);

        q91.q60 = null;
        }

    q30(q91);
    }

;

function q79(id)
    {
    if (q82 != id)
        {
        if (q82 != null)
            {
            if (eval("window.dqm__subdesc" + q82 + "_0"))
                q6(q82);

            q142(q82);
            }

        if (q121[id])
            q141("qmim" + id).style.visibility = "visible";

        popIt(id);
        q82 = id;
        Show_Hide_Div(false);
        }
    }

;

function popIt(id)
    {
    if (q15("dqm__subdesc" + id + "_0", null) != null)
        {
        q141("qm" + id).style.visibility = "visible";

        return true;
        }
    }

;

function q96()
    {
    q6(q94);

    q142(q82);
    q82 = null;
    }

;

function q142(uid)
    {
    if (q121[uid])
        q141("qmim" + uid).style.visibility = "hidden";

    Show_Hide_Div(true);
    }

;

function q6(id)
    {
    if (eval("window.dqm__subdesc" + id + "_0"))
        {
        tm = q141("qm" + id);

        tm.style.visibility = "hidden";

        if (tm.lasthl != null)
            q141("qmitemhl" + tm.lasthl).style.visibility = "hidden";

        ts = tm.q60;

        if (ts != null)
            {
            q141("qmitemhl" + tm.q60).style.visibility = "hidden";

            tm.q60 = null;
            q6(ts);
            }
        }
    }

;

function hideMenu(e)
    {
    return;
    }

;

function showMenu(e)
    {
    return;
    }

;

function q15(pname, rv, id)
    {
    tindex = "";

    if (id || id == 0)
        {
        tindex = id;

        rv = q16(pname);
        }

    if (q16("window." + pname + tindex))
        return q16(pname + tindex);

    else
        return rv;
    }

;

function q16(id)
    {
    return eval(id);
    }

;

function q141(id)
    {
    if (!q145)
        return document.getElementById(id);

    else
        return eval(id);
    }

;

function dqm__handleResize()
    {
    for (i = 0; i < q18; i++)
        {
        q103(i);

        if (q105[i])
            q1(i, true);
        }

    for (i = 0; i < q19.length; i++)
        q1(q19[i], false);
    }

;

function q17(o)
    {
    q70 = new Object();

    q70.x = o.offsetLeft;
    q70.y = o.offsetTop;

    if (q150 && q145)
        q64 = o.parentElement;

    else
        q64 = o.offsetParent;

    while (q64 != null)
        {
        q70.y += q64.offsetTop;

        q70.x += q64.offsetLeft;

        if (q150 && q145)
            q64 = q64.parentElement;

        else
            q64 = q64.offsetParent;
        }

    return q70;
    }

;

function dqm__handleOnload()
    {
    if (q61)
        return;

    dqm__handleResize();

    if (!q150 || !q145)
        q61 = true;

    onload_finished = true;
    eval(window.dqm__onload_code);
    }

;

function q27(uid)
    {
    if (q121[uid])
        eval("q16(qmim" + uid + ")." + q59);

    Show_Hide_Div(true);
    }

