/******************************************************************************* * Copyright (c) 2000, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ // Common scripts for IE and Mozilla. // requires utils.js var isMozilla = navigator.userAgent.indexOf('Mozilla') != -1 && parseInt(navigator.appVersion.substring(0,1)) >= 5; var isIE = navigator.userAgent.indexOf('MSIE') != -1; // selected node var active; var oldActive; /** * Returns the row of this click */ function getTRNode(node) { if (node.nodeType == 3) //"Node.TEXT_NODE") return node.parentNode.parentNode.parentNode; else if (node.tagName == "A") return node.parentNode.parentNode; else if (node.tagName == "TD") return node.parentNode; else if (node.tagName == "TR") return node; else if (node.tagName == "IMG") return node.parentNode.parentNode.parentNode; else return null; } /** * Returns the anchor node in this row */ function getAnchorNode(tr) { var id = tr.id.substring(1); return document.getElementById("a"+id); } /** * Return next item in the list */ function getNextDown(node) { var tr = getTRNode(node); if (tr == null) return null; var id = tr.id.substring(1); var next = 1 + eval(id); return document.getElementById("a"+next); } /** * Return previous item in the list */ function getNextUp(node) { var tr = getTRNode(node); if (tr == null) return null; var id = tr.id.substring(1); var next = eval(id) - 1; if (next >= 0) return document.getElementById("a"+next); else return null; } /** * Highlights link. Returns true if highlights. */ function highlightTopic(topic) { if (!topic || (topic.tagName != "A" && topic.parentNode.tagName != "A")) return false; var tr = getTRNode(topic); if (tr != null) { if (oldActive && oldActive != tr) { oldActive.className="list"; var oldA = getAnchorNode(oldActive); if (oldA) oldA.className = ""; } oldActive = tr; tr.className = "active"; var a = getAnchorNode(tr); if (a) { a.className = "active"; // set toolbar title if (a.onclick) a.onclick(); //if (isIE) // a.hideFocus = "true"; } active = a; return true; } return false; } /** * Selects a topic in the tree: expand tree and highlight it */ function selectTopic(topic) { if (!topic || topic == "") return; var links = document.getElementsByTagName("a"); for (var i=0; i'); document.write('.active {background:#B5D5FF;color:#000000;}'); document.write(''); } }