var openBox = '';
var foldBox = function(box,specialmode){
	if (openBox == ''){
		// box oeffnen
		setActiveBox(box);
		Effect.BlindDown(box, { duration:1, beforeStart:activateBox(box) });
	} else {
		if ($(box).id == openBox){
			// geoeffnete box nochmal angeklickt - einklappen
			if(specialmode) {
				return true;
			} else {
				Effect.BlindUp(box, { duration:0.5, afterFinish:deactivateBox(box) });
				setActiveBox(-1);
			}
		} else {
			// andere box angeklicked, alte einklappen und neue ausklappen
			Effect.BlindUp(openBox, { duration:0.5, afterFinish:deactivateBox(openBox) });
			setActiveBox(box);
			Effect.BlindDown(box, { duration:1, beforeStart:activateBox(box) });
		}
	}
}

   var activateBox = function(item){
	$(item).addClassName('activeBox');
	//Element.addClassName(item, 'activeBox');
}

var deactivateBox = function(item){
	$(item).removeClassName('activeBox');
}
	
var setActiveBox = function(item){
	if (item == -1)
		openBox = '';
	else
		openBox = $(item).id;
}