/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function showChildren(currCat)
{
    var currCatChild = $(currCat).nextSiblings()[0];
	
    if($(currCat).hasClassName('active'))
    {
        $(currCat).removeClassName('active');
        currCatChild.hide();
    }
    else
    {
        $(currCat).addClassName('active');            
		currCatChild.show();
    }
}

function markAsActive(element)
{
    $(element).up().siblings().each(function(sibling) {
        if($(sibling).match('li'))
        {
            $(sibling).childElements().each(function(sibling) {
                if($(sibling).match('a'))
                {
                    $(sibling).removeClassName('subopen');
                }
            });            
        }
        
    });
    $(element).addClassName('subopen');
}
