', layerID, visibility, (nodes[i].cssClass ? nodes[i].cssClass : this.defaultClass)) : this.stringFormat('
', '');
var onMDown = this.doesMenu() && nodes[i].n.length && nodes[i].isDynamic ? this.stringFormat('onmousedown="{0}.toggleBranch(\'{1}\', true)" style="cursor: pointer; cursor: hand"', this.myname, layerID) : '';
var imgTag = this.stringFormat('
', this.iconpath, gifname, modifier, layerID, onMDown);
var linkStart = nodes[i].link ? this.stringFormat('
', nodes[i].link, this.linkTarget) : '';
var linkEnd = nodes[i].link ? '' : '';
output = this.stringFormat('{0}
{1}{2}{3}{4}{6}{7}',
layerTag,
prepend,
parentLayerID == null && (nodes.length == 1 || this.noTopLevelImages) ? '' : imgTag,
iconimg,
linkStart,
eventHandlers,
nodes[i].title,
linkEnd);
/**
* Write out the HTML. Uses document.write for speed over layers and
* innerHTML. This however means no dynamic adding/removing nodes on
* the client side. This could be conditional I guess if dynamic
* adding/removing is required.
*/
document.write(output + "\r\n");
/**
* Traverse sub nodes ?
*/
if (nodes[i].n.length) {
/**
* Determine what to prepend. If there is only one root
* node then the prepend to pass to children is nothing.
* Otherwise it depends on where we are in the tree.
*/
if (parentLayerID == null && (nodes.length == 1 || this.noTopLevelImages)) {
var newPrepend = '';
} else if (i < (nodes.length - 1)) {
var newPrepend = prepend + this.stringFormat('
', this.iconpath);
} else {
var newPrepend = prepend + this.stringFormat('
', this.iconpath);
}
this.drawMenu(nodes[i].n,
level,
newPrepend,
nodes[i].expanded,
expanded ? 'inline' : 'none',
layerID);
}
}
}
/**
* Toggles a branches visible status. Called from resetBranches()
* and also when a +/- graphic is clicked.
*/
TreeMenu.prototype.toggleBranch = function (layerID, updateStatus) // OPTIONAL ARGS: fireEvents = true
{
var currentDisplay = this.getLayer(layerID).style.display;
var newDisplay = (this.branchStatus[layerID] && currentDisplay == 'inline') ? 'none' : 'inline';
var fireEvents = arguments[2] != null ? arguments[2] : true;
for (var i=0; i
= 5));
var is_gecko = (agt.indexOf('gecko') != -1);
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie4up = (is_ie && (is_major >= 4));
//--> end hide JavaScript