	// mei eigenes accordion-script, besser und kleiner als all die anderen!!!
	// V1.0 06-07-10, dirk oppelt
	
	var accOpenPanel = false;	// opened panel
	var accSteps = 15;				// animation-steps
	var accIntervals = 15;		// animation-intervals in msecs
	var accDelay = 0.2;				// >1: start delayed, <1: end delayed
	
	
	// get available panel-height
	function accGetPanelHeight(maxHeight) {
		accHeaders = getElementsByClassName('accPanelHead');
		accHeadersHeight = accHeaders.length * accHeaders[0].offsetHeight;
		if(accHeadersHeight > maxHeight) return false;
		return maxHeight - accHeadersHeight;
	}
	
	// adjuste panel height
	function accAdjustPanel(el, pHeight) {
		if(!el || pHeight<=0) return false;
		panelEl = false;
		for(var i=0; i<el.parentNode.childNodes.length; i++) {
			thisEl = el.parentNode.childNodes[i];
			if(thisEl.className == 'accPanelContent') {  // panel-content-class
				panelEl = thisEl;
				break;
			}
		}
		if(!panelEl) return false;
		panelEl.style.height = pHeight+'px';
		return true;
	}
	
	// show/hide panel
	function accSwitchPanel(el, hide) {
		if(!panelHeight) return false;
		panelEl = false;
		for(var i=0; i<el.parentNode.childNodes.length; i++) {
			thisEl = el.parentNode.childNodes[i];
			if(thisEl.className == 'accPanelContent') {  // panel-content-class
				panelEl = thisEl;
				break;
			}
		}
		if(!panelEl) return;
		if(panelEl.offsetHeight > 5) { // hide
			start = panelEl.offsetHeight;
			stop = 1;
			hide = true;
			panelEl.style.overflow = 'hidden';
			el.className = 'accPanelHead';
		} 
		else { // show
			start = 1;
			//stop = 300;
			stop = panelHeight;
			if(!hide) hide = false;
			el.className = 'accPanelHeadA';
		}
		accResizePanel(panelEl, start, stop, accSteps, accIntervals, accDelay);
		if(accOpenPanel && accOpenPanel != el) {
			accSwitchPanel(accOpenPanel, 1); // close opened panel
		}
		if(!hide) accOpenPanel = el;
		else accOpenPanel = false;
	}
	
	// animate panel display
	function accResizePanel(el, startHeight, endHeight, steps, intervals, powr) { 
    if(el.heightChange) window.clearInterval(el.heightChange);
    var actStep = 0;
    el.heightChange = window.setInterval(
			function() { 
			  el.nextHeight = smoothSize(startHeight, endHeight, steps, actStep, powr);
			  el.style.height = el.nextHeight + "px"; 
				if(el.nextHeight > 1) el.style.display = 'block';  // ie bugfix: overflow hidden only if height > 0!
			  actStep++;
			  if(actStep > steps) {
					if(el.nextHeight <= 1) { // closed
						el.style.display = 'none';
						el.style.overflow = 'hidden';
					}
					else el.style.overflow = 'auto';
					window.clearInterval(el.heightChange);
				}
			} 
		,intervals)
	}
	
	// generate smooth animation steps
	function smoothSize(minVal, maxVal, totalSteps, actStep, powr) { 
		var delta = maxVal - minVal; 
		var step = minVal + (Math.pow(((1 / totalSteps) * actStep), powr) * delta); 
		return Math.floor(step);
	} 