var dhtmlgoodies_slideSpeed = 10;	// Higher value = faster
var dhtmlgoodies_timer = 10;	// Lower value = faster

var objectIdToSlideDown = false;
var dhtmlgoodies_activeId = false;
var dhtmlgoodies_slideInProgress = false;
var dhtmlgoodies_slideInProgress = false;
var dhtmlgoodies_expandMultiple = false; // true if you want to be able to have multiple items expanded at the same time.

function showHideContent(e,inputId)
{
	if(dhtmlgoodies_slideInProgress)return;
	dhtmlgoodies_slideInProgress = true;
	if(!inputId)inputId = this.id;
	inputId = inputId + '';
	var numericId = inputId.replace(/[^0-9]/g,'');
	var answerDiv = document.getElementById('dhtmlgoodies_a' + numericId);

	objectIdToSlideDown = false;

	if(!answerDiv.style.display || answerDiv.style.display=='none'){
		if(dhtmlgoodies_activeId &&  dhtmlgoodies_activeId!=numericId && !dhtmlgoodies_expandMultiple){
			objectIdToSlideDown = numericId;
			slideContent(dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));
		}else{

			answerDiv.style.display='block';
			answerDiv.style.visibility = 'visible';

			slideContent(numericId,dhtmlgoodies_slideSpeed);
		}
	}else{
		slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));
		dhtmlgoodies_activeId = false;
	}
}

function slideContent(inputId,direction)
{

	var obj =document.getElementById('dhtmlgoodies_a' + inputId);
	var contentObj = document.getElementById('dhtmlgoodies_ac' + inputId);
	height = obj.clientHeight;
	if(height==0)height = obj.offsetHeight;
	height = height + direction;
	rerunFunction = true;
	if(height>contentObj.offsetHeight){
		height = contentObj.offsetHeight;
		rerunFunction = false;
	}
	if(height<=1){
		height = 1;
		rerunFunction = false;
	}

	obj.style.height = height + 'px';
	var topPos = height - contentObj.offsetHeight;
	if(topPos>0)topPos=0;
	contentObj.style.top = topPos + 'px';
	if(rerunFunction){
		setTimeout('slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer);
	}else{
		if(height<=1){
			obj.style.display='none';
			if(objectIdToSlideDown && objectIdToSlideDown!=inputId){
				document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.display='block';
				document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.visibility='visible';
				slideContent(objectIdToSlideDown,dhtmlgoodies_slideSpeed);
			}else{
				dhtmlgoodies_slideInProgress = false;
			}
		}else{
			dhtmlgoodies_activeId = inputId;
			dhtmlgoodies_slideInProgress = false;
		}
	}
}



function initShowHideDivs()
{
	var divs = document.getElementsByTagName('DIV');
	var divCounter = 1;
	for(var no=0;no<divs.length;no++){
		if(divs[no].className=='SB_01'){
			divs[no].onclick = showHideContent;
			divs[no].id = 'dhtmlgoodies_q'+divCounter;
			var answer = divs[no].nextSibling;
			while(answer && answer.tagName!='DIV'){
				answer = answer.nextSibling;
			}
			answer.id = 'dhtmlgoodies_a'+divCounter;
			contentDiv = answer.getElementsByTagName('DIV')[0];
			contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px';
			contentDiv.className='dhtmlgoodies_answer_content';
			contentDiv.id = 'dhtmlgoodies_ac' + divCounter;
			answer.style.display='none';
			answer.style.height='1px';
			divCounter++;
		}
	}
}
window.onload = initShowHideDivs;


	<!--
	var factive_color = '{T_ACTIVE_COLOR}';
	var faonmouse_color = '{T_ONMOUSE_COLOR}';
	var faonmouse2_color = '{T_ONMOUSE2_COLOR}';
	var l_empty_message = '{L_EMPTY_MESSAGE}';
	var no_text_selected = '{L_NO_TEXT_SELECTED}';
	var cname = '{UNIQUE_COOKIE_NAME}';
	var cpath = '{COOKIE_PATH}';
	var cdomain = '{COOKIE_DOMAIN}';
	var csecure = '{COOKIE_SECURE}';

	<!-- BEGIN ajaxSb -->var sV={a:{ajaxSb.a},e:{ajaxSb.e},eOwn:{ajaxSb.e_own},d:{ajaxSb.d},dOwn:{ajaxSb.d_own},s:{ajaxSb.s},u:{ajaxSb.u},lang:[{ajaxSb.lang}],sid:'{ajaxSb.sid}',smilies:{ajaxSb.smilies},bbcode:{ajaxSb.bbcode},makeLinks:{ajaxSb.makelinks},textL:{ajaxSb.textlenght},wordL:{ajaxSb.wordlenght},ref:{ajaxSb.reftime},inRef:{ajaxSb.inactivereftime},inTime:{ajaxSb.inactivetime},turnOFF:{ajaxSb.turnofftime},smiles:{code:[{ajaxSb.smilesCode}],url:[{ajaxSb.smilesURL}]}};<!-- END ajaxSb --> 


	<!-- BEGIN switch_enable_pm_popup -->
	if ( {PRIVATE_MESSAGE_NEW_FLAG} )
	{
		window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225, resizable=yes, WIDTH=400');
	}
	<!-- END switch_enable_pm_popup -->
	<!-- BEGIN switch_report_popup -->
	report = window.open('{switch_report_popup.U_REPORT_POPUP}', '_phpbbreport', 'HEIGHT={switch_report_popup.S_HEIGHT}, resizable=yes, scrollbars=yes, WIDTH={switch_report_popup.S_WIDTH}');
	report.focus();
	<!-- END switch_report_popup -->
	<!-- BEGIN switch_enable_greeting_popup -->
	var greeting_flag = {GREETING_FLAG};
	if ( greeting_flag )
	{
		window.open('{U_GREETING_POPUP}', '_phpbbprivmsg', 'HEIGHT=225, resizable=yes, WIDTH=400');
	}
	<!-- END switch_enable_greeting_popup -->
	//-->
