// expandable definition list
function prepExpandingList() {
	var dt = tag("dt");
	for(var i = 0; i < dt.length; i++) {	
		// check for dl classname
		if(theParent(dt[i]).className == "expandingList"){
			// set click function to dt's
			dt[i].onclick = function(){
			
				// see if dd is open already, or not
				var open = attr(this, "open");
				
				// reset the dl list and hide the dd's
				resetExpandingList();				
				
				// toggle the display off dd
				next(this).style.display = open ? "none" : "block";
				
				// set different class to dt when open
				attr(this, "class", open ? "" : "open");
			
				// remember if the dd is open
				attr(this, "open", open ? "" : "yes");
			}			
			// hide the dd's, could also be set by css
			next(dt[i]).style.display = "none";		
		}
	}
}
addLoadEvent(prepExpandingList);

// reset dl list
function resetExpandingList() {
	var dt = tag("dt");
	for(var j = 0; j < dt.length; j++) {
	
		if(theParent(dt[j]).className == "expandingList"){
		
			// remove the class
			attr(dt[j], "class", "");
			
			// set parameter to 'not open'
			attr(dt[j], "open", "");
			
			// hide all dd's
			next(dt[j]).style.display = "none";
		}
	}
}