﻿
var atHomeLeftNav = {
    expandCategory:function(thePid){
    var listitem = document.getElementById(thePid);
    
    if (listitem) {
            
            // it's a parent
            if (listitem.getElementsByTagName("ul").length > 0) {
                listitem.getElementsByTagName("ul")[0].className="sub-show";
                listitem.className="category-on";
            }
            // it's a non-expandable parent
            else if (listitem.className == "noexpand-off") {
                listitem.className="noexpand-on";
            }
            // it's a child
            else {
                listitem.className="sub-on";
                if (listitem.parentNode) {
                    listitem.parentNode.className="sub-show";
                    if (listitem.parentNode.parentNode && listitem.parentNode.parentNode.tagName=="LI") {
                        
                        listitem.parentNode.parentNode.className="category-on";
                    }
                }
            }
        }
    }

}

