    ol = 'OL';
    li = 'LI';
    ul = 'UL';
    accordionContent = 'accordionContent';
	accordionClickableCaption = 'accordionClickableCaption';
    accordionClickable = 'accordionClickable';
    accordionContainer = 'accordionContainer';

    function onloadnow(obj, recursive) {
        startindex = obj;
        ols = startindex.getElementsByTagName(ol);
        uls = startindex.getElementsByTagName(ul);
        //list through ol tags
        for(var i = 0; i < ols.length; i++) {
            parent = ols[i].parentNode; //parent = null if there is no parent..
            if(checker(ols[i], recursive)) {
                addContainerClass(ols[i]);
				addstuff(ols[i]);
	        }
        }
        //list through ul tags
        for(var b = 0; b < uls.length; b++) {
            var parent = uls[b].parentNode; 
	    	if(checker(uls[b], recursive)) {
                addContainerClass(uls[b]);
				addstuff(uls[b]);
            }
        }
    }
    function addContainerClass(obj) {
		var parent = obj.parentNode;
        if(parent.nodeName != ol && parent.nodeName != ul && parent != null && parent.nodeName != li) {
			obj.className = accordionContainer; //obj.setAttribute('class', accordionContainer);
		}
    }
    function checker(obj, recursive) {
        var parent = obj.parentNode; 
		if(recursive) {
	     	if(parent != null) {
				return true;
			} else {
				return false;
			}
		} else {
			if(parent.nodeName != ol && parent.nodeName != ul && parent != null && parent.nodeName != li) {
				return true;	
	        }  else { 
				return false;
			}
		}
    }

	function linkie(e) {
        clicked = this;
        var counter = 1;
        var sibling = clicked.nextSibling;
        if (!e) var e = window.event;
		e.cancelBubble = true;
		if (e.stopPropagation) e.stopPropagation();
		
		//Don't expand/contract if it's not the LI being clicked
		if (clicked.className != accordionClickable && clicked.parentNode.className != accordionClickable)
			return;
			
        while(sibling != null && sibling.nodeName != li) {
    	    if(sibling.nodeName == ol || sibling.nodeName == ul) {
                if(sibling.getAttribute('style').match('display: none')) {
    		        sibling.setAttribute('style', 'display: block;');
                } else {
    		        sibling.setAttribute('style', 'display: none;');
                }
            }
		    sibling = sibling.nextSibling;
        }

        var counter = 1;
        var siblings = this.childNodes;

        for(countblah = 0; countblah < siblings.length; countblah++) {
            if(this.childNodes[countblah].nodeName == ol || this.childNodes[countblah].nodeName == ul) {
                if(this.childNodes[countblah].style.display=='none') {
                    this.childNodes[countblah].style.display='block';
                } else {
        	        this.childNodes[countblah].style.display='none';
                }
            }
        }
		  
    }
    function addstuff(element) {
        echild = element.childNodes;
    
        for(var counter123 = 0; counter123 < echild.length; counter123++) {
            if( (echild[counter123].nodeName == li) ) {
                counter = 0;
				var needsIt = false;
                while((counter + counter123 < echild.length)) {
                    if( (echild[counter123 + counter].nodeName == ul) || (echild[counter123 + counter].nodeName == ol)    ) {
		        		echild[counter123 + counter].className = accordionContent;//echild[counter123 + counter].setAttribute('class', accordionContent);
						echild[counter123 + counter].onclick = accordionDontCollapse;
                    	echild[counter123 + counter].setAttribute('style', 'display:none;');
						echild[counter123].onclick = linkie;
						needsIt = true;
                    }
                    counter++;
                }
                gchild = echild[counter123].childNodes;
                for(var temp = 0; temp < gchild.length; temp++) {
                    if(gchild[temp].nodeName == ul || gchild[temp].nodeName == ol) {
						needsIt = true;
                        gchild[temp].style.display = 'none';
                        gchild[temp].className = accordionContent; //gchild[temp].setAttribute('class', accordionContent);
						gchild[temp].onclick = accordionDontCollapse;
                    }
			    } 
				if(needsIt) {
     				echild[counter123].onclick = linkie; //addEventListener('click', linkie, false);
					echild[counter123].className = accordionClickable; //echild[counter123].setAttribute('class', accordionClickable);
					newSpan = document.createElement('span');
					newSpan.className = accordionClickableCaption; //newSpan.setAttribute('class', accordionClickableCaption);
					var sausage = false;
					if (echild[counter123].firstChild.data)
						sausage = echild[counter123]; //theText = echild[counter123].firstChild.data;
					else if (echild[counter123].firstChild.firstChild.data)
						sausage = echild[counter123].firstChild; //theText = echild[counter123].firstChild.firstChild.data;
					else
						sausage = false;
					
					if(!sausage)
						theText = '';
					else
						theText = sausage.firstChild.data;
					theTextNode = document.createTextNode(theText);
					newSpan.appendChild(theTextNode);
					sausage.firstChild.data='';
					sausage.insertBefore(newSpan,sausage.firstChild.nextSibling);
					//echild[counter123].firstChild.data='';
					//echild[counter123].insertBefore(newSpan,echild[counter123].firstChild.nextSibling);
				}
            } 	    
        }
    }
	function accordionDontCollapse(e) {
		if (!e) var e = window.event;
		e.cancelBubble = true;
		if (e.stopPropagation) e.stopPropagation();
	}
