/* Expanding and Collapsing Lists
   ------------------------------*/
function CollapsingModule(id){
    this.module = document.getElementById(id);
    this.firstlevelList = getElements('first_level', 'ul', id)[0]; 
    this.switches = this.getSwitches();
    this.handleSwitchClicks();
}
CollapsingModule.prototype.getSwitches = function(){
    var allListItems = getElements('first_level', 'ul', this.module)[0].getElementsByTagName('LI');
    var switches = [];
    for(var i=0; i<allListItems.length; i++) 
        if(allListItems[i].parentNode == this.firstlevelList) switches.push(allListItems[i])
    return switches;
}
CollapsingModule.prototype.handleSwitchClicks = function(){
    for(var i=0; i<this.switches.length; i++)
        this.switches[i].onclick = this.doSwitch;
}
CollapsingModule.prototype.doSwitch = function(){
    if( this.className.match(/expanded/) ){
        this.className = this.className.replace(/expanded/,'collapsed');
        return;
    }
    if( this.className.match(/collapsed/) ){
        this.className = this.className.replace(/collapsed/,'expanded');
        return;
    }
    this.className += 'expanded';
}
/****************************************************/



































































