##############################################################
## MOD Title: DHTML Collapsible Forum Index (CH204)
## MOD Author: markus_petrux < phpbb.mods@phpmix.com > (Markus) http://www.phpmix.com
## MOD Description: This MOD uses DHTML to replace the effect of the GET variable "c" on Forum Index (which requires to send
##     a request to the server). So, it expands/collapses forum categories on the browser itself. It should work on latests versions
##     of all major browsers, and is supposed to degrade correctly on non-supported browsers (ie: all categories remain open).
## MOD Version: 1.1.1(ch204)
##
## Installation Level: (Intermediate)
## Installation Time: 15 Minutes
## Files To Edit: 7
##    index.php
##    language/lang_english/lang_main.php
##    language/lang_german/lang_main.php
##    includes/functions.php
##    includes/functions_categories_hierarchy.php
##    templates/illusion/illusion.cfg
##    templates/illusion/index_body.tpl
##    templates/illusion/index_body_plus.tpl
##    templates/illusion/index_box.tpl
## Included Files: 2
##    templates/collapsible_forum_index.js
##    images/icon_sign_plus.gif
##    images/icon_sign_minus.gif
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## phpBB related:
## - Tested with phpBB 2.0.10
## - It is highly recommened to use EasyMOD to install this MOD.
##
## MOD Script related:
## - This MOD Script has been written with EasyMOD in mind, so it tries to avoid conflicts with other
##   MODs that you may have previously installed against the same files modifies here.
## - That means it may be somehow complex to follow this MOD actions manually, so... I highly recommend
##   to use EasyMOD to install this MOD. :P
## - On the other hand, I have added several comments, aimed to help you if you can't use EasyMOD for
##   whatever reason. Anyway, think twice and take it easy ...also make backups, just in case. ;-)
##
## DHTML related:
## - It's based on the onclick event for TR tag and style.display attribute.
## - It should work on latests versions of all major browsers.
## - It has been tested and works on:
##   MSIE 6, Netscape 7.1, Mozilla 1.7.2, Firefox 0.9.3, Opera 7, Mozilla/Linux and Konqueror 3.x
##   No feedback on Mac browsers, yet, but probably works on IEMac 5 and Safari.
## - It has been tested and degardes gracefully on:
##   W3C Amaya, Hotjava 3, Netscape 4, Opera 5 and 6.
## - Degrading means its features are completely disabled, so users with legacy browsers or javascript disabled
##   will not notice this MOD is there, as Forum Index will behave as standard.
##
## Categories Hierarchy MOD (CH) related:
## - In the contrib folder, you'll find another version of this MOD that works with CH.
##   *** IMPORTANT *** It ONLY works with version 2.0.4 of Categories Hierarchy MOD !!!
## - Both MOD scripts shared the same Author Notes and MOD History sections.
##   Though, they have different names. The one on the contrib folder is suffixed by (CH204).
## - For Categories Hierarchy MOD, it works when Index Packing is set to None or Medium.
##   However, it is disabled when it is set as Full. It also supports Split Categories on Index enabled or disabled.
##   *** WARNING ***
##   PROBLEM: It does NOT support sub-forums !!!
##   Problem with categories as sub-forums is they are rendered as forums. TBH, at this time, I don't know
##   how to deal with this layout (I mean, a reasonable approach). Maybe for next version. ;-)
##   WORKAROUND: you should create a new category and convert the current category/sub-forum as a plain forum
##   under (attached to) that category.
##
##############################################################
## MOD History:
##
## 2004/09/07 - 1.1.1
## - Fixed bug with CFI cookie names. Solves a problem with initial categories state for CH version.
##
## 2004/09/06 - 1.1.0
## - Added support for Categories Hierarchy MOD (CH v2.0.4). Please, read author notes (above).
## - Almost all javascript code has been re-written with a more Object Oriented approach.
## - Added CFI options panel, allows expand/collapse all, and save/restore additional state.
##
## 2004/08/22 - 1.0.3
## - Added check for display attribute support to the onload event.
## - Fixed management of the display queue.
##
## 2004/08/22 - 1.0.2
## - Added state persistence using cookies.
##   It will not collapse a category when expanding another one. And it will remind which categories are
##   expanded between sessions (using cookies). So, the end-user will be able to set the state of the
##   forum index exactly as he/she wishes.
##   The expand/collapse effect will work on all supported browsers and, for non-supported browsers,
##   degrade to standard behaviour. ie. all categories remain open and the GET var c=xx is not disabled.
##
## 2004/08/20 - 1.0.1
## - Fixed an issue with display='block'. Firefox failed to display correctly the row.
##   It now uses display=''. Works with IE, Firefox, Mozilla 1.7+
##   For browsers supporting display attribute, the GET var c=xx is disabled.
## - The display attribute is not supported by Opera(*) and legacy browsers. In such case,
##   the categories are initially opened ...and the GET var c=xx is enabled.
##   Note(*): Opera 5/6 has the display attribute, but can't be changed !!!
##
## 2004/08/20 - 1.0.0
## - Initial release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ COPY ]------------------------------------------------
#
copy javascript/collapsible_forum_index.js to templates/collapsible_forum_index.js
copy images/icon_sign_plus.gif to templates/illusion/images/icon_sign_plus.gif
copy images/icon_sign_minus.gif to templates/illusion/images/icon_sign_minus.gif
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
# NOTE --- the whole line to look for should be similar to this:
#		'FORUM_IMG' => $images['forum'],
#
'FORUM_IMG'
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//+MOD: DHTML Collapsible Forum Index MOD
		'INDEX_PACKING'			=> intval($board_config['sub_forum']),
		'U_CFI_JSLIB'			=> $phpbb_root_path . 'templates/collapsible_forum_index.js',
		'CFI_COOKIE_NAME'		=> get_cfi_cookie_name(),
		'COOKIE_PATH'			=> $board_config['cookie_path'],
		'COOKIE_DOMAIN'			=> $board_config['cookie_domain'],
		'COOKIE_SECURE'			=> $board_config['cookie_secure'],
		'L_CFI_OPTIONS'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_options']),
		'L_CFI_OPTIONS_EX'		=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_options_ex']),
		'L_CFI_CLOSE'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_close']),
		'L_CFI_DELETE'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_delete']),
		'L_CFI_RESTORE'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_restore']),
		'L_CFI_SAVE'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_save']),
		'L_CFI_EXPAND_ALL'		=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_Expand_all']),
		'L_CFI_COLLAPSE_ALL'	=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_Collapse_all']),
		'IMG_UP_ARROW'			=> $phpbb_root_path . $images['up_arrow'],
		'IMG_DW_ARROW'			=> $phpbb_root_path . $images['down_arrow'],
		'IMG_PLUS'				=> $phpbb_root_path . $images['icon_sign_plus'],
		'IMG_MINUS'				=> $phpbb_root_path . $images['icon_sign_minus'],
//-MOD: DHTML Collapsible Forum Index MOD

#
#-----[ OPEN ]------------------------------------------
#
portal.php
#
#-----[ FIND ]------------------------------------------
#
#

'S_COLS' => $cols,

#
#-----[ BEFORE, ADD ]------------------------------------------
#
//+MOD: DHTML Collapsible Forum Index MOD
		'INDEX_PACKING'			=> intval($board_config['sub_forum']),
		'U_CFI_JSLIB'			=> $phpbb_root_path . 'templates/collapsible_forum_index.js',
		'CFI_COOKIE_NAME'		=> get_cfi_cookie_name(),
		'COOKIE_PATH'			=> $board_config['cookie_path'],
		'COOKIE_DOMAIN'			=> $board_config['cookie_domain'],
		'COOKIE_SECURE'			=> $board_config['cookie_secure'],
		'L_CFI_OPTIONS'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_options']),
		'L_CFI_OPTIONS_EX'		=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_options_ex']),
		'L_CFI_CLOSE'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_close']),
		'L_CFI_DELETE'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_delete']),
		'L_CFI_RESTORE'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_restore']),
		'L_CFI_SAVE'			=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_save']),
		'L_CFI_EXPAND_ALL'		=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_Expand_all']),
		'L_CFI_COLLAPSE_ALL'	=> str_replace(array("'",' '), array("\'",'&nbsp;'), $lang['CFI_Collapse_all']),
		'IMG_UP_ARROW'			=> $phpbb_root_path . $images['up_arrow'],
		'IMG_DW_ARROW'			=> $phpbb_root_path . $images['down_arrow'],
		'IMG_PLUS'				=> $phpbb_root_path . $images['icon_sign_plus'],
		'IMG_MINUS'				=> $phpbb_root_path . $images['icon_sign_minus'],
//-MOD: DHTML Collapsible Forum Index MOD

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//+MOD: DHTML Collapsible Forum Index MOD
$lang['CFI_options'] = "C.F.I.";
$lang['CFI_options_ex'] = "Collapsible Forum Index Options";
$lang['CFI_close'] = "Close";
$lang['CFI_delete'] = "Delete Saved State";
$lang['CFI_restore'] = "Restore Saved State";
$lang['CFI_save'] = "Save State";
$lang['CFI_Expand_all'] = "Expand All";
$lang['CFI_Collapse_all'] = "Collapse All";
//-MOD: DHTML Collapsible Forum Index MOD

#
#-----[ OPEN ]------------------------------------------
#
language/lang_german/lang_main.php
#
#-----[ FIND ]------------------------------------------
#

?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#

//+MOD: DHTML Collapsible Forum Index MOD
$lang['CFI_options'] = "C.F.I.";
$lang['CFI_options_ex'] = "Collapsible Forum Index Options";
$lang['CFI_close'] = "Ausblenden";
$lang['CFI_delete'] = "Anzeige-Status lschen";
$lang['CFI_restore'] = "Status wiederherstellen";
$lang['CFI_save'] = "Anzeige-Status speichern";
$lang['CFI_Expand_all'] = "Alle Kategorien ffnen";
$lang['CFI_Collapse_all'] = "Alle Kategorien schlieen";
//-MOD: DHTML Collapsible Forum Index MOD

#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//+MOD: DHTML Collapsible Forum Index MOD
function get_cfi_cookie_name()
{
	global $board_config, $HTTP_GET_VARS;

	$k = $board_config['cookie_name'].'_CFI_cats';
	if( isset($board_config['sub_forum']) )
	{
		$k .= '_'.isset($board_config['sub_forum']);
		if( isset($HTTP_GET_VARS['c']) )
		{
			$k .= '_'.$HTTP_GET_VARS['c'];
		}
	}
	return $k;
}
function is_category_collapsed($cat_id)
{
	global $board_config, $HTTP_COOKIE_VARS;
	static $collapsed_cats = false;

	if( intval($board_config['sub_forum']) == 2 )
	{
		return false;
	}
	if( !is_array($collapsed_cats) )
	{
		if( isset($HTTP_COOKIE_VARS[get_cfi_cookie_name()]) )
		{
			$collapsed_cats = explode(':', $HTTP_COOKIE_VARS[get_cfi_cookie_name()]);
		}
		else
		{
			$collapsed_cats = array();
		}
	}
	return in_array($cat_id, $collapsed_cats) ? true : false;
}
//-MOD: DHTML Collapsible Forum Index MOD

#
#-----[ OPEN ]------------------------------------------
#
includes/functions_categories_hierarchy.php
#
#-----[ FIND ]------------------------------------------
#
# NOTE --- the whole line to look for should be similar to this:
#			$template->assign_block_vars('catrow.cathead', array(
#
'catrow.cathead'
#
#-----[ AFTER, ADD ]------------------------------------------
#
//+MOD: DHTML Collapsible Forum Index MOD
				'CAT_ID'			=> POST_CAT_URL.$cat_id,
				'INC_SPAN2'			=> $max_level - $level+1,
				'INC_CLASS'			=> ($level % 2) ?  'row2' : 'row1',
				'DISPLAY'			=> (is_category_collapsed(POST_CAT_URL.$cat_id) ? '' : 'none'),
//-MOD: DHTML Collapsible Forum Index MOD
#
#-----[ FIND ]------------------------------------------
#
# NOTE --- the whole line to look for should be similar to this:
#			$template->assign_block_vars('catrow.forumrow',	array(
#
'catrow.forumrow'
#
#-----[ AFTER, ADD ]------------------------------------------
#
//+MOD: DHTML Collapsible Forum Index MOD
				'CAT_ID'				=> POST_CAT_URL.$data['cat_id'],
				'FORUM_ID'				=> $type.$id,
				'DISPLAY'				=> (is_category_collapsed(POST_CAT_URL.$data['cat_id']) ? 'none' : ''),
//-MOD: DHTML Collapsible Forum Index MOD
#
#-----[ FIND ]------------------------------------------
#
# NOTE --- the whole line to look for should be similar to this:
#			$template->assign_block_vars('catrow.catfoot', array('INC_SPAN' => $max_level - $level+5));
#
'catrow.catfoot'
#
#-----[ IN-LINE FIND ]------------------------------------------
#
array(
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
'CAT_ID' => POST_CAT_URL.$cat_id, 'DISPLAY' => (is_category_collapsed(POST_CAT_URL.$cat_id) ? 'none' : ''),
#
# NOTE --- so the result should look something like this:
#			$template->assign_block_vars('catrow.catfoot', array('CAT_ID' => POST_CAT_URL.$cat_id, 'DISPLAY' => (is_category_collapsed(POST_CAT_URL.$cat_id) ? 'none' : ''), 'INC_SPAN' => $max_level - $level+5));
#

#
#-----[ OPEN ]------------------------------------------------
#
templates/illusion/illusion.cfg
#
#-----[ FIND ]------------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//+MOD: DHTML Collapsible Forum Index MOD
$images['icon_sign_plus'] = "$current_template_images/icon_sign_plus.gif";
$images['icon_sign_minus'] = "$current_template_images/icon_sign_minus.gif";
//-MOD: DHTML Collapsible Forum Index MOD

#
#-----[ OPEN ]------------------------------------------
#
templates/illusion/index_body.tpl und index_body_plus.tpl
#
#-----[ FIND ]------------------------------------------
#
# 
#
<table
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<script language="javascript" type="text/javascript" src="{U_CFI_JSLIB}"></script>
<script language="javascript" type="text/javascript">
<!--

var CFIG_Version = "DHTML Collapsible Forum Index MOD v1.1.1";

var CFIG = new _CFIG('CFIG',
		['{IMG_PLUS}', '{IMG_MINUS}'],
		['{IMG_DW_ARROW}', '{IMG_UP_ARROW}'],
		['{COOKIE_PATH}', '{COOKIE_DOMAIN}', (('{COOKIE_SECURE}' == '0') ? false : true)]);
	CFIG.T['cookie'] = '{CFI_COOKIE_NAME}';
	CFIG.T['title'] = ['{L_CFI_OPTIONS}', '{L_CFI_OPTIONS_EX}'];
	CFIG.T['close'] = '{L_CFI_CLOSE}';
	CFIG.T['delete'] = '{L_CFI_DELETE}';
	CFIG.T['restore'] = '{L_CFI_RESTORE}';
	CFIG.T['save'] = '{L_CFI_SAVE}';
	CFIG.T['expand_all'] = '{L_CFI_EXPAND_ALL}';
	CFIG.T['collapse_all'] = '{L_CFI_COLLAPSE_ALL}';
	CFIG.T['u_index'] = '{U_INDEX}';
	CFIG.allowed = Boolean({INDEX_PACKING} == 0 || {INDEX_PACKING} == 1);	// None or Medium?

	if( CFIG.IsEnabled() && ({INDEX_PACKING} == 0) && parseInt(CFIG.getQueryVar('c')) > 0 )
	{
		window.location.replace('{U_INDEX}');
	}
// -->
</script>

#
#-----[ FIND ]------------------------------------------
#
{BOARD_INDEX}
#
#-----[ BEFORE, ADD ]------------------------------------------
#
	<script language="javascript" type="text/javascript">
<!--
	CFIG.writeButton();
// -->
</script>
<script language="javascript" type="text/javascript">
<!--
	CFIG.writePanel();
// -->
</script>

#
#-----[ OPEN ]------------------------------------------
#
templates/illusion/index_box.tpl
#
#-----[ FIND ]------------------------------------------
#
# NOTE --- the following lines should be found on top of the template:
#
<!-- BEGIN catrow -->
<!-- BEGIN tablehead -->
<table
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<script language="javascript" type="text/javascript">
<!--
if( CFIG )
{
<!-- BEGIN catrow -->
<!-- BEGIN cathead -->
	CFIG.C['cat_{catrow.cathead.CAT_ID}'] = new _CFIC('{catrow.cathead.CAT_ID}', '{catrow.cathead.DISPLAY}');
<!-- END cathead -->
<!-- BEGIN forumrow -->
	if( CFIG.C['cat_{catrow.forumrow.CAT_ID}'] ) CFIG.C['cat_{catrow.forumrow.CAT_ID}'].add('forum_{catrow.forumrow.CAT_ID}_{catrow.forumrow.FORUM_ID}');
<!-- END forumrow -->
<!-- END catrow -->
}

function CFIG_slideCat(cat_id, isLink)
{
	if( CFIG && CFIG.currentStep <= 0 )
	{
		if( CFIG.IsEnabled() && CFIG.C['cat_'+cat_id] )
		{
			if( isLink ) return false;
			CFIG.createQueue();
			CFIG.slideForums(cat_id);
			CFIG.execQueue();
			CFIG.saveIndexState(CFIG.T['cookie']);
			return false;	// omit the default action of the link.
		}
		if( !isLink )
		{
			var u_index = CFIG.T['u_index'];
			u_index += ( u_index.indexOf('?') > 0 ? '&' : '?' ) + 'c=' + parseInt(cat_id);
			window.location.replace(u_index);
			return false;
		}
	}
	return true;	// let the link do its job.
}
function CFIG_onLoad()
{
	if( CFIG_oldOnLoad )
	{
		CFIG_oldOnLoad();
		CFIG_oldOnLoad = null;
	}
	if( CFIG && CFIG.IsEnabled() )
	{
		CFIG.restoreIndexState(CFIG.T['cookie']);
	}
}
var CFIG_oldOnLoad = window.onload;
window.onload = CFIG_onLoad;
// -->
</script>

#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN cathead -->
#
# NOTE --- There is no other action to apply here, just skip to next FIND.
#

#
#-----[ FIND ]------------------------------------------
#
<tr>
#
#-----[ REPLACE WITH ]------------------------------------------
#
<tr onclick="CFIG_slideCat('{catrow.cathead.CAT_ID}', false);" style="cursor:pointer;cursor:hand;" title="{catrow.cathead.CAT_DESC}">
#
#-----[ FIND ]------------------------------------------
#
# NOTE --- the whole line to look for should be similar to this:
#	<td class="{catrow.cathead.CLASS_CAT}" width="100%" colspan="{catrow.cathead.INC_SPAN}"><span class="cattitle"><a href="{catrow.cathead.U_VIEWCAT}" class="cattitle" title="{catrow.cathead.CAT_DESC}">{catrow.cathead.CAT_TITLE}</a></span></td>
#
"{catrow.cathead.U_VIEWCAT}"
#
#-----[ IN-LINE FIND ]------------------------------------------
#
>
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
&nbsp;&nbsp;<img name="icon_sign_{catrow.cathead.CAT_ID}" src="{SPACER}" border="0" />&nbsp;&nbsp;
#
#-----[ IN-LINE FIND ]------------------------------------------
#
"{catrow.cathead.U_VIEWCAT}"
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 onclick="return CFIG_slideCat('{catrow.cathead.CAT_ID}', true);" onfocus="this.blur();"
#
# NOTE --- so the result should look something like this:
#	<td class="{catrow.cathead.CLASS_CAT}" width="100%" colspan="{catrow.cathead.INC_SPAN}">&nbsp;&nbsp;<img name="icon_sign_{catrow.cathead.CAT_ID}" src="{SPACER}" border="0" />&nbsp;&nbsp;<span class="cattitle"><a href="{catrow.cathead.U_VIEWCAT}" onclick="return CFIG_slideCat('{catrow.cathead.CAT_ID}', true);" onfocus="this.blur();" class="cattitle" title="{catrow.cathead.CAT_DESC}">{catrow.cathead.CAT_TITLE}</a></span></td>
#

#
#-----[ FIND ]------------------------------------------
#
<!-- END cathead -->
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<tr id="cat_{catrow.cathead.CAT_ID}" style="display:{catrow.cathead.DISPLAY};">
	<!-- BEGIN inc -->
	<td width="46" class="{catrow.cathead.inc.INC_CLASS}"><img src="{SPACER}" width="46" height="0" /></td>
	<!-- END inc -->
	<td width="46" class="{catrow.cathead.INC_CLASS}"><img src="{SPACER}" width="46" height="0" /></td>
	<td width="100%" class="row1" colspan="{catrow.cathead.INC_SPAN2}"><img src="{SPACER}" width="46" height="0" /></td>
	<td width="250" class="row3" colspan="3"><img src="{SPACER}" width="46" height="0" /></td>
</tr>
#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN forumrow -->
#
# NOTE --- There is no other action to apply here, just skip to next FIND.
#

#
#-----[ FIND ]------------------------------------------
#
<tr>
#
#-----[ REPLACE WITH ]------------------------------------------
#
<tr id="forum_{catrow.forumrow.CAT_ID}_{catrow.forumrow.FORUM_ID}" style="display:{catrow.forumrow.DISPLAY};">
#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN catfoot -->
#
# NOTE --- There is no other action to apply here, just skip to next FIND.
#

#
#-----[ FIND ]------------------------------------------
#
<tr>
#
#-----[ REPLACE WITH ]------------------------------------------
#
<tr id="cat_{catrow.catfoot.CAT_ID}_foot" style="display:{catrow.catfoot.DISPLAY};">

#
#-----[ OPEN ]------------------------------------------
#
templates/illusion/portal_body.tpl
#
#-----[ FIND ]------------------------------------------
#
# 
#
<table
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<script language="javascript" type="text/javascript" src="{U_CFI_JSLIB}"></script>
<script language="javascript" type="text/javascript">
<!--

var CFIG_Version = "DHTML Collapsible Forum Index MOD v1.1.1";

var CFIG = new _CFIG('CFIG',
		['{IMG_PLUS}', '{IMG_MINUS}'],
		['{IMG_DW_ARROW}', '{IMG_UP_ARROW}'],
		['{COOKIE_PATH}', '{COOKIE_DOMAIN}', (('{COOKIE_SECURE}' == '0') ? false : true)]);
	CFIG.T['cookie'] = '{CFI_COOKIE_NAME}';
	CFIG.T['title'] = ['{L_CFI_OPTIONS}', '{L_CFI_OPTIONS_EX}'];
	CFIG.T['close'] = '{L_CFI_CLOSE}';
	CFIG.T['delete'] = '{L_CFI_DELETE}';
	CFIG.T['restore'] = '{L_CFI_RESTORE}';
	CFIG.T['save'] = '{L_CFI_SAVE}';
	CFIG.T['expand_all'] = '{L_CFI_EXPAND_ALL}';
	CFIG.T['collapse_all'] = '{L_CFI_COLLAPSE_ALL}';
	CFIG.T['u_index'] = '{U_INDEX}';
	CFIG.allowed = Boolean({INDEX_PACKING} == 0 || {INDEX_PACKING} == 1);	// None or Medium?

	if( CFIG.IsEnabled() && ({INDEX_PACKING} == 0) && parseInt(CFIG.getQueryVar('c')) > 0 )
	{
		window.location.replace('{U_INDEX}');
	}
// -->
</script>

#
#-----[ FIND ]------------------------------------------
#
{BOARD_INDEX}
#
#-----[ BEFORE, ADD ]------------------------------------------
#
	<script language="javascript" type="text/javascript">
<!--
	CFIG.writeButton();
// -->
</script>
<script language="javascript" type="text/javascript">
<!--
	CFIG.writePanel();
// -->
</script>

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM