var switcher = function (clickEvent) {
    var element = Event.element(clickEvent);
    var typeId = element.id.substring(4);
    $$('.CarePlanTableHolder').invoke('hide'); //hide all
    $('Care_' + typeId).toggle(); //show the clicked element
    //swap out the graphic
    
    $('TitleGraphic').src = '/images/' + typeId + '_care.gif';
       
    
    /**grab each listitem in the subnav*/
    assignClassNames(element,$$('#PlanSwitch li'));
}

function assignClassNames(eventElement,col)
{
    var endListItem = col.pop();
    
    col.each(function(e) {
        //find the listitem that is the parent of the anchor element
        if (e.firstDescendant().id == eventElement.id) {
            e.className= 'Active';
        } else {
        
            e.className = '';
        }
    });
    /**the last item in the menu has a different background/class*/
    if (endListItem.firstDescendant().id == eventElement.id) {
        endListItem.className = 'ActiveLast';
        
    } else {
        endListItem.className = 'Last';
    }
}
