// Title: COOLjsTree PRO
// URL: http://javascript.cooldev.com/scripts/cooltreepro/
// Version: 2.4.3
// Last Modify: 8 July 2004
// Author: Sergey Nosenko <darknos@cooldev.com>
// Notes: Registration needed to use this script on your web site.
// Copyright (c) 2001-2004 by CoolDev.Com
// Copyright (c) 2001-2004 by Sergey Nosenko
//
//NOTE: This file came compressed from the vendor and has been uncompressed 
//          using a formatting tool called PolyStyle.  The uncompressed file that came
//          from the vendor was contributing to IE browser lockups
//

// COOLjsTreePRO {{{
function COOLjsTreePRO(_name, _nodes, _format) { // {{{
	this.name = this._name = _name;
	this.bw = new _BrowserDetector();
	this._ver3 = this.bw._ver3;
	this.ns4 = this.bw.ns4;
	this.fmt = this._format = new _COOLjsTreeFmtPRO(_format);
	if (!this._ver3)
		this._back = new _COOLjsTreeBackPRO(_format[9], this);
	if (_und(window.CTrees))
		window.CTrees = [];
	window.CTrees[_name] = this;
	this.jsPath = "window.CTrees['" + _name + "']";
	this.Nodes = this._nodes = [];
	this._rawNodes = _nodes;
	this._expanded = [];
	this.rootNode = this._root = new _COOLjsTreeNodePRO(this, "", "", "", null, -1);
	this._px = this.bw._operaOld ? '' : 'px';
	this._dynamic = this.bw.dom && !this.bw._operaOld;

	this._scheduledImageSourceUpdates = [];
	this.missingImagesFix = this.bw.ie;
} // }}}

// COOLjsTreePRO's methods {{{
$ = COOLjsTreePRO.prototype;

$._getElement = function (_id) { // {{{
	return (this.ns4 && this._ns4_layers[_id]) || (document.all && document.all[_id]) || document.getElementById(_id);
} // }}}

$.moveTo = function (x, y) { // {{{
	this._back.top = y;
	this._back.left = y;
	this._back.moveTo(x, y);
	this._format.top = y;
	this._format.left = x;
	this.draw();
} // }}}

$._nodeBy = function (_field, _value) { // {{{
	for (var i in this._nodes)
		if (this._nodes[i][_field] == _value)
			return this._nodes[i];

	return null;
} // }}}

$.nbn = $.nodeByName = function (_name) { // {{{
	return this._nodeBy('text', _name);
} // }}}

$.nodeByID = function (_id) { // {{{
	return this._nodeBy('nodeID',_id);
} // }}}

$.nodeByURL = function (_url) { // {{{
	return this._nodeBy('url', _url);
} // }}}

$._walk_ns4_layers = function (_collection) { // {{{
	for (var i in _collection) {
		this._ns4_layers[_collection[i].id] = _collection[i];
		if (_collection[i].layers)
			this._walk_ns4_layers(_collection[i].layers);
	}
} // }}}

$._attachLayers = function () { // {{{
	if (!this._layersAttached) {
		if (this.ns4) {
			this._ns4_layers = {};
			this._walk_ns4_layers(document.layers);
		}

		this._back.el = this._getElement(this._back._name);

		this._layersAttached = true;
	}
} // }}}

$.draw = function () { // {{{
	if (this._ver3 || !this._redrawComplete)
		return;

	this._attachLayers();

	this.currTop = this._format.top;
	this._maxHeight = 0;
	this._maxWidth = 0;
	for (var i in this._root._children)
		this._root._children[i].draw(true);

	if (this._format.rel && this._format.resize || !this._format.rel)
		this._back.resize(this._maxWidth - this._format.left, this._maxHeight - this._format.top);

	if (this.ondraw)
		this.ondraw(this);
} // }}}

$.expandNode = function (_index, _noRedraw, _selectNode) { // {{{
	if (!this._ver3) {
		var _node = this._nodes[_index];
		if (_selectNode)
			this.selectNode(_index);
		if (!_und(this._expanded[_index]))
			this._expanded[_index] = 1;
		if (!_und(_node) && _node._hasChildren){
			_node._setExpanded(!_node._expanded);
			if (this._format.so)
				for (var i in this._nodes)
					if (this._nodes[i] != _node && this._nodes[i]._parentNode == _node._parentNode)
						this._nodes[i]._setExpanded(false);
			if (!_noRedraw) {
				this.draw();
				if (this._format.cook)
					this.saveState();
			}
		}
	}
} // }}}

$.selectNode = function (_index) { // {{{
	this._selectedNodeIndex = _index;

	if (this._format.cook)
		this.saveState();
} // }}}

$._cutNamedField = function (_array, _index, _fieldName) { // {{{
	if (!_und(_array[_index]) && !_und(_array[_index][_fieldName]))
		return _array.splice(_index, 1)[0][_fieldName];
} // }}}

$._readNodes = function (_nodes, _parent) { // {{{
	if (_und(_nodes[_nodes.length - 1]))
		_nodes.splice(-1, 1);
	for (var i = 0; i < _nodes.length; i++) {
		var _definition = _nodes[i];
		var _id = this._cutNamedField(_definition, 0, 'id');
		var _format = this._cutNamedField(_definition, 3, 'format') || {};
		var _node = _parent._children[_parent._children.length] = this._nodes[_definition._index] = new _COOLjsTreeNodePRO(this, _parent, _definition[0], _definition[1] || '', _definition[2] || '', _definition._index);

		_node.nodeID = _id;
		_node._format = _format;

		if (!_und(_node._format.expanded))
			_node._setExpanded(_node._format.expanded);

		_node._hasNext = i < _nodes.length - 1;

		if (_definition._children) {
			_node._hasChildren = true;
			if (this._dynamic)
				_node._unparsedChildren = _definition._children;
			else
				this._readNodes(_definition._children, _node);
		}

		_node._initImages();
	}
} // }}}

$._setStateGlobally = function (_state, _needRedraw) { // {{{
	if (!this._ver3) {
		for (var i = 0; i < this._numberOfNodes; i++)
			this._expanded[i] = _state;

		for (var i in this._nodes)
			this._nodes[i]._setExpanded(_state);

		if (this._format.cook)
			this.saveState();

		if (_needRedraw)
			this.draw();
	}
} // }}}

$.collapseAll = function (_needRedraw) { // {{{
	this._setStateGlobally(0, _needRedraw);
} // }}}

$.expandAll = function (_needRedraw) { // {{{
	this._setStateGlobally(1, _needRedraw);
} // }}}

$._prepareNodes = function (_nodes, _index) { // {{{
	for (var i = 0; i < _nodes.length; i++)
		if (!_und(_nodes[i])) {
			var _p = 3;

			if (!_und(_nodes[i][0].id))
				_p++;

			if (!_und(_nodes[i][_p]) && !_und(_nodes[i][_p].format))
				_p++;

			this._expanded[_index] = 0;
			_nodes[i]._index = _index++;

			if (!_und(_nodes[i][_p])) {
				_nodes[i]._children = _nodes[i].slice(_p);
				_index = this._prepareNodes(_nodes[i]._children, _index);
			}
		}

	return _index;
} // }}}

$.init = function () { // {{{
	this._numberOfNodes = this._prepareNodes(this._rawNodes, 0);
	if (this._format.cook)
		this.restoreState();
	this._readNodes(this._rawNodes, this._root);

	var s = '';
	for (var i in this._nodes)
		s += this._nodes[i]._init();
	if (!this._ver3)
		s = this._back._init(s);
	if (this.ns4)
		s = '<div id="' + this._name + 'dummytreediv" style="position:absolute;"></div>' + s;

	document.write(s);
} // }}}

$._getCookie = function( _name){ // {{{
	return document.cookie.match(new RegExp('(\\W|^)' + _name + '=([^;]+)')) ? RegExp.$2 : null;
} // }}}

$._setCookie = function (_name, _value) { // {{{
	document.cookie = this._name + _name + '=' + _value + '; path=/';
} // }}}

$._getState = function () { // {{{
	return  this._expanded.join('');
} // }}}

$.saveState = function () { // {{{
	this._setCookie('Selected', this._selectedNodeIndex);
	this._setCookie('State', this._getState());
} // }}}

$.restoreState = function (){ // {{{
	var _state = this._getCookie(this._name + 'State');
	if (_state) {
		this.stateRestored = true;
		for (var i = 0; i < this._numberOfNodes; i++)
			this._expanded[i] = _state.charAt(i) == '1' ? 1 : 0;
		var sel = this._getCookie(this._name + 'Selected');
		this.selectNode(this._getCookie(this._name + 'Selected'));
	}
} // }}}

$.image_onclick = $.button_onclick = $.caption_onclick = function (_node) { // {{{
	this.expandNode(_node.index, 1);
	this.selectNode(_node.index);
	this.draw();
	return true;
} // }}}

$.button_onclick = function (_node) { // {{{
	this.expandNode(_node.index);
	return true;
} // }}}

$.image_onmouseover = $.button_onmouseover = $.caption_onmouseover = function (_node) { // {{{
	window.status = _node.text;
	return true;
} // }}}

$.image_onmouseout = $.button_onmouseout = $.caption_onmouseout = function (node) { // {{{
	window.status = window.defaultStatus;
	return true;
} // }}}

$._setImageSource = function (_img, _src) { // {{{
	if (!this.missingImagesFix) {
		_img.src = _src;
		return;
	}

	if (_img._marked)
		return;

	_img._marked = true;

	this._scheduledImageSourceUpdates[this._scheduledImageSourceUpdates.length] = [ _img, _src ];
	if (!this._scheduledImageSourceUpdatesTimeOut)
		this._scheduledImageSourceUpdatesTimeOut = window.setTimeout(this.jsPath + '.$updateImages()', 1);
} // }}}

$.$updateImages = function () { // {{{
	for (var i in this._scheduledImageSourceUpdates) {
		this._scheduledImageSourceUpdates[i][0].src = this._scheduledImageSourceUpdates[i][1];
		this._scheduledImageSourceUpdates[i][0]._marked = false;
	}
	this._scheduledImageSourceUpdates = [];
	this._scheduledImageSourceUpdatesTimeOut = null;
} // }}}
// }}}
// }}}

// _COOLjsTreeNodePRO {{{
function _COOLjsTreeNodePRO(_tree, _parent, _caption, _url, _target, _index) { // {{{
	this._index = this.index = _index;
	this.jsPath = _tree.jsPath + '.Nodes[' + _index + ']';
	this._id = 'nt' + _tree._name + _index;
	this.treeView = this._tree = _tree;
	this._parentNode = this.parentNode = _parent;
	this.text = _caption;
	this.url = _url;
	this.target = _target;
	this._format = [];
	this._setExpanded(this._tree._expanded[this._index]);
	this.children = this._children = [];
	this._level = this.level = _parent ? _parent._level + 1 : -1;
} // }}}

// _COOLjsTreeNodePRO's methods {{{
$ = _COOLjsTreeNodePRO.prototype;

$._setExpanded = function (_value) { // {{{
	this._tree._expanded[this._index] = this.expanded = this._expanded = _value ? 1 : 0;
} // }}}

$._updateImage = function (_suffix, _cStateSrc, _eStateSrc) { // {{{
	var _img = (this._layer_d.document || document).images[this._id + _suffix], _src = this._expanded ? _eStateSrc : _cStateSrc;
	if ((this._tree._format._show[_suffix] || this._tree._format.exp) && _img && _img.src != _src)
		this._tree._setImageSource(_img, _src);
} // }}}

$._initImages = function () { // {{{
	if (this._tree._format.exp) {
		var ei = this._format.eimages || this._tree._format.expimg;
		var esz = this._tree._format.expimgsize;
		var img = ei[2];
		this._collapsedIconSrc = this._hasChildren ? ei[0] : img;
		this._expandedIconSrc = this._hasChildren ? ei[1] : img;
		var ii = this._hasNext ? 3 : 4;
		this._expandedButtonSrc = this._hasChildren ? ei[ii] : ei[ii + 5] ;
		this._collapsedButtonSrc = this._hasChildren ? ei[ii + 2] : ei[ii + 5];
		this.wimg = this._iconWidth = this._buttonWidth = esz[0];
		this.himg = this._iconHeight = this._buttonHeight = esz[1];
	} else {
		this._collapsedIconSrc = this._func('folders', 'clF', 'iF');
		this._expandedIconSrc = this._func('folders', 'exF', 'iF');
		this._collapsedButtonSrc = this._func('buttons', 'clB', 'iE');
		this._expandedButtonSrc = this._func('buttons', 'exB', 'iE');

		this._buttonWidth = _und(this._format.bsize) ? this._tree._format._buttonWidth : this._format.bsize[0];
		this._buttonHeight = _und(this._format.bsize) ? this._tree._format._buttonHeight : this._format.bsize[1];
		this._iconWidth = _und(this._format.fsize) ? this._tree._format._iconWidth : this._format.fsize[0];
		this._iconHeight = _und(this._format.fsize) ? this._tree._format._iconHeight : this._format.fsize[1];
	}
} // }}}

$._func = function (a, b, c) { // {{{
	return this._hasChildren ?
			!_und(this._format[a])
				?
				this._format[a][0]
				:
				this._tree._format[b]
			:
			!_und(this._format[a])
				?
				this._format[a][2]
				:
				this._tree._format[c]
		;
} // }}}

$._init = function (_force) { // {{{
	if (!_force && this._tree._dynamic)
		return '';
	return this._tree._ver3 ? this._getContent() : '<div id="' + this._id + 'd" style="position:absolute;visibility:hidden;' + 'z-index:' + (this.index + 10) + ';">' + this._getContent() + '</div>';
} // }}}

$._tagNonEmptyAttribute = function (_name, _value) { // {{{
	return _value ? ' ' + _name + '="' + _value + '"' : '';
} // }}}

$._anchor = function (_url, _prefix, _content, _cssClass, _needId) { // {{{
	return '<a' + this._handler('click', _prefix) + this._handler('mouseover', _prefix) + this._handler('mouseout', _prefix) + ' href="' + (_url || 'javascript:void(0)') + '"' + this._tagNonEmptyAttribute('target', _url && this.target) + this._tagNonEmptyAttribute('id', _needId && (this._id + 'an')) + this._tagNonEmptyAttribute('class', _cssClass) + '>' + _content + '</a>';
} // }}}

$._handler = function (ev, _prefix) { // {{{
	return ' on' + ev + '="' + (ev == 'click' ? 'this.blur && this.blur();' : '') + 'return ' + this._tree.jsPath + '.' + _prefix + '_on' + ev + '(' + this.jsPath + ')"';
} // }}}

$._square = function (_prefix, _suffix, _imgSrc, _needAnchor, _needUrl, w, h) { // {{{
	if (!w)
		return '';
	var i = '<img' + (_suffix ? ' name="' + this._id + _suffix + '" id="' + this._id + _suffix + '"' : '') + ' src="' + _imgSrc + '" width="' + w + '" height="' + h + '" border="0"' + (this._tree.bw.ns4 ? '' : ' style="display: block"') + ' />';
	return '<td style="font-size: 1px;" valign="' + this._tree._format._imageAlignment + '" width="' + w + '">' + (_needAnchor ? this._anchor(_needUrl && this.url, _prefix, i) : i) + '</td>';
} // }}}

$._lineSquares = function () { // {{{
	return this._level >= 0 ? this._parentNode._lineSquares() + this._square('', '', this._hasNext ? this._tree._format.expimg[7] : this._tree._format.iE, false, false, this._tree._format.expimgsize[0], this._tree._format.expimgsize[1]) : '';
} // }}}

$._getContent = function () { // {{{
	var _indent = this._tree._format._getIndentValueForLevel(this._level);
	var w = this._tree._format._wrappingMargin;

	var s = '<table' + (w ? ' width="' + w + '"' : '') + ' cellpadding="' + this._tree._format.pg + '" cellspacing="' + this._tree._format.sp + '" border="0" class="cls' + this._tree._name + '_back' + this._level + '"><tr>';

	if (this._tree._format.exp)
		s += this._parentNode._lineSquares();
	else
		s += this._square('', '', this._tree._format.iE, false, false, _indent + (this._hasChildren ? 0 : this._tree._format.Ew), 1);

	if ((this._tree._format._show.nb && !this._format.nobuttons && this._hasChildren) || this._tree._format.exp)
		s += this._square('button', 'nb', this._expanded ? this._expandedButtonSrc : this._collapsedButtonSrc, this._hasChildren, false, this._buttonWidth, this._buttonHeight);

	if (this._tree._format._show.nf && !this._format.nofolders)
		s += this._square('image', 'nf', this._expanded ? this._expandedIconSrc : this._collapsedIconSrc, true, true, this._iconWidth, this._iconHeight);

	s += '<td' + (w ? '' : ' nowrap="nowrap"') + '><div id="' + this._id + 'a" style="position:relative;">' + this._anchor(this.url, 'caption', this.text, this._tree._format._getCssClassForLevel(this._level), true) + '</div></td>';

	return s + '</tr></table>';
} // }}}

$._moveTo = function (_x, _y) { // {{{
	if (this._tree.ns4)
		this.el.moveTo(_x, _y);
	else {
		this.el.style.left = _x + this._tree._px;
		this.el.style.top = _y + this._tree._px;
	}
} // }}}

$._refreshImgSrc = function (_node) { // {{{
	if (_node.tagName && _node.tagName == 'IMG')
		this._tree._setImageSource(_node, _node.src);
	else
		for (var i = 0; i < _node.childNodes.length; i++)
			this._refreshImgSrc(_node.childNodes[i]);
} // }}}

$._attachLayers = function () { // {{{
	if (!this._layer_d) {
		if (this._tree._dynamic) {
			var el = this._tree._format.rel ? this._tree._back.el : document.body;
			this._el = document.createElement('div');
			this._el.style.position = this._tree._format.rel ? 'relative' : 'absolute';
			this._el.style.left = this._el.style.top = '0px';
			this._el.innerHTML = this._init(true);
			el.appendChild(this._el);
		}

		this.el = this._layer_d = this._tree._getElement(this._id + 'd');
	}
} // }}}

$.draw = function (_visible) { // {{{
	if (!this.visible && !_visible)
		return;

	if (this.visible != _visible) {
		this._attachLayers();

		this.visible = _visible;
		if (this._tree.ns4)
			this._layer_d.visibility = _visible ? 'show' : 'hide';
		else
			this._layer_d.style.visibility = _visible ? 'visible' : 'hidden';
	}

	if (this.visible) {
		this._attachLayers();

		if (this._tree._format.sel) {
			var _selected = this._tree._selectedNodeIndex == this._index;

			if (_selected == !this._lastSelected) {
				var _backgroundColor = this._tree._format.selC[_selected ? 1 : 0];

				var _el = this._tree._getElement(this._id + 'a');
				if (this._tree.bw.ns4)
					_el.bgColor = _backgroundColor;
				else if (_el.style)
					_el.style.backgroundColor = _backgroundColor;

				this._lastSelected = _selected;
			}

			if (this._tree.bw.dom) {
				if (_und(this._originalClassName)) {
					var el = this._tree._getElement(this._id + 'an');
					this._lastCssClass = this._originalClassName = el.className;
				}

				var _cssClass = (_selected ? this._tree._format._cssClassForSelectedNode : this._hasChildren && this._expanded ? this._tree._format._cssClassForOpenedNode : this._originalClassName) || this._originalClassName;

				if (_cssClass != this._lastCssClass) {
					var el = this._tree._getElement(this._id + 'an');
					el.className = _cssClass;
					this.h = 0;

					this._lastCssClass = _cssClass;
				}
			}
		}

		if (!this.h)
			if (this._tree.bw.gecko) {
				this.w = this._layer_d.childNodes[0].offsetWidth;
				this.h = this._layer_d.childNodes[0].offsetHeight;
			} else {
				this.w = this._layer_d.offsetWidth || this._layer_d.scrollWidth || (this._layer_d.clip && this._layer_d.clip.width) || this._layer_d.style.pixelWidth;
				this.h = this._layer_d.offsetHeight || this._layer_d.scrollHeight || (this._layer_d.clip && this._layer_d.clip.height) || this._layer_d.style.pixelHeight;
			}

		if (this.visible) {
			this._updateImage('nb', this._collapsedButtonSrc, this._expandedButtonSrc);
			this._updateImage('nf', this._collapsedIconSrc, this._expandedIconSrc);
		}

		if (this._tree.missingImagesFix)
			this._refreshImgSrc(this._layer_d);

		this._moveTo(this._tree._format.left, this._tree.currTop);
		this._tree._maxWidth = Math.max(this._tree._format.left + this.w, this._tree._maxWidth);
		this._tree.currTop += this.h;
		this._tree._maxHeight = Math.max(this._tree.currTop, this._tree._maxHeight);
	}

	if (this._hasChildren) {
		if (this._unparsedChildren) {
			this._tree._readNodes(this._unparsedChildren, this);
			this._unparsedChildren = null;
		}

		for (var i in this._children)
			this._children[i].draw(this._expanded && _visible);
	}
} // }}}
// }}}
// }}}

// _COOLjsTreeBackPRO {{{
function _COOLjsTreeBackPRO(_color, _tree) { // {{{
	this._tree = _tree;
	this.left = _tree._format.left;
	this.top = _tree._format.top;
	this._name = 'cls' + _tree._name + '_back';
	this.color = _color;
	this.resize = function (_width, _height) {
		if (this._tree.ns4)
			this.el.resizeTo(_width, _height);
		else {
			if (this._tree.bw._operaOld && !this._first) {
				this._first = true;
				return;
			}
			this.el.style.width = _width + this._tree._px;
			this.el.style.height = _height + this._tree._px;
		}
	}
	this._init = function (_html) {
		var p = 'relative', l = 0, t = 0, w = 1, h = 1;
		if (this._tree._format.rel) {
			w = this._tree._format.rels[0];
			h = this._tree._format.rels[1];
		} else {
			l = this.left;
			t = this.top;
			p = 'absolute';
		}
		return '<div style="' + (this.color == "" ? "" : (this._tree.ns4 ? 'layer-' : '') + 'background-color:' + this.color + ";") + 'position:' + p + ';top:' + t + 'px;left:' + l + 'px;width:' + w + 'px;height:' + h + 'px;z-index:0;" id="' + this._name + '">'
			+ (this._tree.ns4 ? '<img src="' + this._tree._format.iE + '" width="' + w + '" height="' + h + '" />' : '') + (this._tree._format.rel ? _html + '</div>' : '</div>' + _html);
	}
} // }}}
// }}}

function _und(_value) { // {{{
	return typeof(_value) == 'undefined';
} // }}}

function _RedrawAllTrees() { // {{{
	for (var i in window.CTrees) {
		window.CTrees[i]._redrawComplete = true;
		window.CTrees[i].draw();
	}
} // }}}

function RedrawAllTrees() {
	if (!new _BrowserDetector().ns4)
		_RedrawAllTrees();
}

function _BrowserDetector() { // {{{
	var _is_major = parseInt(navigator.appVersion);
//	this.nver = _is_major;
	this.ver = navigator.appVersion;
	this.agent = navigator.userAgent;
	this.dom = document.getElementById ? 1 : 0;
	this.opera = window.opera ? 1 : 0;
	this.ie5 = this.ver.match(/MSIE 5/) && this.dom && !this.opera;
	this.ie6 = this.ver.match(/MSIE 6/) && this.dom && !this.opera;
	this.ie4 = document.all && !this.dom && !this.opera;
	this.ie = this.ie4 || this.ie5 || this.ie6;
//	this.mac = this.agent.match(/Mac/);
//	this.ns6 = this.dom && parseInt(this.ver) >= 5;
	this.ie3 = this.ver.match(/MSIE/) && _is_major < 4;
	this.hotjava = this.agent.match(/hotjava/i);
	this.ns4 = document.layers && !this.dom && !this.hotjava;
//	this.bw = this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera;
	this._ver3 = this.hotjava || this.ie3;
	this.opera7 = this.agent.match(/opera.7/i);
	this.gecko = this.agent.match(/gecko/i);
	this._operaOld = this.opera && !this.opera7;
} // }}}

function _preloadImages(_list) { // {{{
	for (var i in _list)
		(new Image()).src = _list[i];
} // }}}

function _COOLjsTreeFmtPRO(_format) { // {{{
	this.left = _format[0];
	this.top = _format[1];
	this._show = {
		nb:_format[2],
		nf:_format[5]
	};
	this.clB = _format[3][0];
	this.exB = _format[3][1];
	this.iE = _format[3][2];
	this._buttonWidth = _format[4][0];
	this._buttonHeight = _format[4][1];
	this.Ew = _format[4][2];
	this.clF = _format[6][0];
	this.exF = _format[6][1];
	this.iF = _format[6][2];
	this._iconWidth = _format[7][0];
	this._iconHeight = _format[7][1];
	this.ident = _format[8];
	this.nst = _format[10];
	this.nstl = _format[11];
	this.so = _format[12];
	this.pg = _format[13][0];
	this.sp = _format[13][1];
	this.exp = _format[14];
	this.expimg = _format[15];
	this.expimgsize = _format[16];
	this.cook = _format[17];
	this.rel = _format[18];
	this.rels = _format[19];
	this.resize = _format[20];
	this.sel = _format[21];
	this.selC = _format[22];
	this._cssClassForSelectedNode = _format[22] ? _format[22][2] : '';
	this._cssClassForOpenedNode = _format[22] ? _format[22][3] : '';
	this._wrappingMargin = _format[23] || 0;
	this._imageAlignment = _format[24] || 'middle';

	if (this._show.nb)
		_preloadImages(_format[3]);

	if (this._show.nf)
		_preloadImages(_format[6]);

	this._getCssClassForLevel = function (_level) {
		return this.nstl[_level] || this.nst;
	}

	this._getIndentValueForLevel = function (_level) {
		return _und(this.ident[_level]) ? this.ident[0] * _level : this.ident[_level];
	}
} // }}}

window._oldCTPOnLoad = window.onload;

window.onload = function () { // {{{
	var bw=new _BrowserDetector();
	if (bw._operaOld)window.operaResizeTimer=setTimeout('resizeHandler()',1000);
	if (typeof(window._oldCTPOnLoad)=='function') window._oldCTPOnLoad();
	if (bw.ns4) {
		window.onresize=resizeHandler;
		_RedrawAllTrees();
	}
} // }}}

function resizeHandler() { // {{{
	if (window.reloading) return;
	if (!window.origWidth){
		window.origWidth=window.innerWidth;
		window.origHeight=window.innerHeight;
	}
	var reload=window.innerWidth != window.origWidth || window.innerHeight != window.origHeight;
	window.origWidth=window.innerWidth;window.origHeight=window.innerHeight;
	if (window.operaResizeTimer)clearTimeout(window.operaResizeTimer);
	if (reload) {window.reloading=1;document.location.reload();return};
	if (new _BrowserDetector()._operaOld){window.operaResizeTimer=setTimeout('resizeHandler()',500)};
} // }}}
