﻿//functon 0
function elmByID(elementID) {
    currentObj = document.getElementById(elementID);
    return currentObj;
}

//function 1;
var currentObj;
var ie4 = document.all;
var ns6 = document.getElementById && !document.all;
function ShowHideChildMenuDiv(elementstart, ID, show) {
    currentObj = elmByID(elementstart + ID);
    if (show == true && currentObj != null)
        elmByID(elementstart + ID).style.display = 'block';
    if (maxTdID == null)
        maxTdID = 1;
    for (i = 1; i < maxTdID; i++) {
        currentObj = elmByID(elementstart + i);
        if (ID != i && currentObj != null)
            currentObj.style.display = 'none';
    }
}

// function 2
function hide(elementID) {
    currentObj = elmByID(elementID);
    if (currentObj != null) currentObj.style.display = 'none';
}

// function 3
function show(elementID) {
    currentObj = elmByID(elementID);
    if (currentObj != null) currentObj.style.display = 'block';
}

//function 4
function dynamichide(e) {
    alert(1); if (ie4 && !currentObj.contains(e.toElement)) delayhidemenu();
    else if (ns6 && e.currentTarget != e.relatedTarget &&
!contains_ns6(e.currentTarget, e.relatedTarget)) delayhidemenu();
}

//function 5
function hidemenu(e) {
    if (typeof currentObj != null)
    { if ((ie4 || ns6) && currentObj != null) currentObj.style.display = 'none'; } 
}

//function 6
function delayhidemenu(eID) {
    if (ie4 || ns6) {
        delayhide = currentObj = elmByID(eID);
        setTimeout("hidemenu()", 5000);
    }
}
