', layerID, visibility, (nodes[i].cssClass ? nodes[i].cssClass : this.defaultClass)) : this.stringFormat('
', nodes[i].cssClass ? nodes[i].cssClass : this.defaultClass);
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 linkTarget = nodes[i].linkTarget ? nodes[i].linkTarget : this.linkTarget;
var linkStart = nodes[i].link ? this.stringFormat('
', nodes[i].link, linkTarget) : '';
var linkEnd = nodes[i].link ? '' : '';
this.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);
/**
* Traverse sub nodes ?
*/
if (nodes[i].n.length) {
var newPrepend;
/**
* 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)) {
newPrepend = '';
} else if (i < (nodes.length - 1)) {
newPrepend = prepend + this.stringFormat('
', this.iconpath);
} else {
newPrepend = prepend + this.stringFormat('
', this.iconpath);
}
this.drawMenu(nodes[i].n,
arrayCopy(level),
newPrepend,
nodes[i].expanded,
expanded ? 'inline' : 'none',
layerID);
}
}
};
/**
* Writes the output generated by drawMenu() to the page
*/
TreeMenu.prototype.writeOutput = function ()
{
document.write(this.output);
};
/**
* 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));
var is_opera = (agt.indexOf("opera") != -1);
var is_opera7 = (is_opera && is_major >= 7) || agt.indexOf("opera 7") != -1;
// Patch from Harald Fielker
if (agt.indexOf('konqueror') != -1) {
var is_nav = false;
var is_nav6up = false;
var is_gecko = false;
var is_ie = true;
var is_ie4 = true;
var is_ie4up = true;
}
//--> end hide JavaScript