function show_childs(parent_id)
{
    var anchors = document.getElementsByTagName('a');
    for (var i = 0; i < anchors.length; i++)
    {
        var anchor = anchors[i];
        if (anchor.getAttribute('rel') == parent_id)
        {
            anchor.style.display = 'block';
        }
    }
}

function hide_childs(parent_id)
{
    var anchors = document.getElementsByTagName('a');
    for (var i = 0; i < anchors.length; i++)
    {
        var anchor = anchors[i];
        var class_name = anchor.className.slice(0,2);

        if (class_name == 'l2' || class_name == 'l3' || class_name == 'l4')
        {
            anchor.style.display = 'none';
        }

        /*
        if (anchor.getAttribute('rel') == parent_id)
        {
            anchor.style.display = 'none';
        }
        */
    }
}

function menu_toggle(obj, id)
{
    var class_name = obj.className.slice(0,2);

    if (class_name == 'l1')
    {
        if (obj.style.background.indexOf('active') > 0)
        {
            obj.style.background = 'url(/template/img/arrow1.png) 8px 10px no-repeat';
            hide_childs(id);
        }
        else
        {
            obj.style.background = 'url(/template/img/arrow1-active.png) 8px 10px no-repeat';
            show_childs(id);
        }

        
    }
    elseif (class_name == 'l2')
    {
    }
    elseif (class_name == 'l3')
    {
    }
    elseif (class_name == 'l4')
    {
    }
}
