//---------------------------------------------------------------------------
// This script is based on the work of Dieter Bungers - http://www.infovation.de
// The original example for the "Cross Browser Expanding and Collapsing TOC"
// was published on http://www.siteexperts.com/tips/techniques/ts03/index.htm
//---------------------------------------------------------------------------

var tocTab = new Array();var ir=0;
tocTab[ir++] = new Array ("1", "Features", "", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("1.1", "Basic Concept", "basicconcept.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("2", "Licence Statement", "", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("2.1", "General Conditions", "generalconditions.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("2.2", "Individual Licence", "individuallicence.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("2.3", "Full Site Licence", "fullsitelicence.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("2.4", "Distribution Licence", "distributionlicence.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("2.5", "Details", "details.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("2.6", "Notes", "notes.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("3", "Installation", "", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("3.1", "System Requirements", "systemrequirements.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("3.2", "Installing FX ChemStruct on Your Computer", "installingfxchemonyourcom.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("3.3", "Installation Notes", "", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("3.3.1", "Administrator Privileges", "administratorpriveleges.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("3.3.2", "Adding To Word", "addingtoword.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("3.3.3", "Registration", "registration.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("3.3.4", "Adobe Acrobat", "adobeacrobat.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("3.3.5", "Changes FX ChemStruct Makes (Advanced)", "changesfxchemmakes(advance.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("3.3.6", "Automatic Registration and Configuration (Advanced)", "automaticregistrationandcon.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("4", "FX ChemStruct and Word", "", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("4.1", "Adding FX ChemStruct to Word", "addingfxchemtoword.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("4.2", "Using FX ChemStruct in Microsoft Word", "usingfxcheminmicrosoftwor.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5", "Using FX ChemStruct", "", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("5.1", "Accessing FX ChemStruct", "accessingfxchem.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2", "How to Enter Structures", "howtoentertheequations.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("5.2.1", "Basic Structures", "basicstructures.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.2", "Branched Structures", "branchedstructures.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.3", "Benzene Rings", "benzenerings.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.4", "Unformatted Text / Comments", "unformattedtextcomments.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.5", "Clicking on Compounds I", "clickingoncompounds.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.6", "Clicking on Compounds II", "shift_clickingoncompounds.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.7", "Rotating and Reflecting", "rotatingandreflecting.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.8", "Clearing Clicks, Rotations and Reflections", "clearingclicks.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.9", "Isomers", "isomers.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.10", "The Arrows", "arrowsequations.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.11", "Spaces", "spaces.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.12", "R &amp; R'", "rr'.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.13", "Entering Phase Information", "enteringphaseinformation.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.14", "Overriding Charges", "overridingcharges.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.15", "Ionic Compounds", "inorganiccompounds.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.16", "Polyatomic Ions", "polyatomicions.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.17", "Ring Structures", "ringstructures.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.2.18", "Preventing Bonding", "preventingbonding.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.3", "Display Options", "displayoptions.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("5.3.1", "Hiding ?-H Bonds", "hiding_hbonds.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.3.2", "Displaying Charges", "displayingcharges.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.3.3", "Compounds Without Bonds", "compoundswithoutbonds.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.3.4", "Allowing for Unbonded Electron Pairs", "allowingforunbondedelectron.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.3.5", "Showing All Electrons", "showingallelectrons.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.4", "Examples", "", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("5.4.1", "Resonance Structures", "resonancestructures.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.4.2", "Carbohydrates", "carbohydrates.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.4.3", "EDTA", "edta.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.5", "Editing Your Structures", "editingyourequations.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.6", "Co(NO3)2 becomes CO(NO3)2!", "co(no3)2becomesco(no3)2.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.7", "Changing Your Structures", "", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("5.7.1", "Tools/Font", "toolsfont.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.7.2", "Tools/Options/Equations ", "toolsoptions.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.7.3", "Tools/Options/Structures", "toolsoptionsstructures.htm", "", "cicon9.gif", "");
tocTab[ir++] = new Array ("5.8", "My Structure is Not Formatted Correctly!", "myequationisnotformattedc.htm", "", "cicon9.gif", "");
showNumbers = false,
textSizes = new Array(1, 1, 0.7, 0.7),
tocBehaviour = new Array(1,1),
tocScroll=false,
tocLinks = new Array(1,0);
var isIE = navigator.appName.toLowerCase().indexOf("explorer") > -1;
var mdi = (isIE) ? textSizes[1]:textSizes[3];
var sml = (isIE) ? textSizes[2]:textSizes[4];
var oldCurrentNumber = "", oldLastVisitNumber = "";
var toDisplay = new Array();
for (ir=0; ir<tocTab.length; ir++) {
toDisplay[ir] = tocTab[ir][0].split(".").length==1;
}
function reDisplay(currentNumber,tocChange,noLink,e) {
if (e) {
ctrlKeyDown = (isIE) ? e.ctrlKey : (e.modifiers==2);
if (tocChange && ctrlKeyDown) tocChange = 2;
}
toc.document.clear();
toc.document.write("<html>\n\r<head></head>\n\r<style type=\"text/css\">\n\r       SPAN.heading1 { font-family: Top; font-weight: normal; font-size: pt; color: #000000; text-decoration: none }\n\r       SPAN.heading2 { font-family: Previous; font-weight: normal; font-size: pt; color: #000000; text-decoration: none }\n\r       SPAN.heading3 { font-family: Next; font-weight: normal; font-size: pt; color: #000000; text-decoration: none }\n\r       SPAN.heading4 { font-family: Helvetica,Arial; font-weight: normal; font-size: 8pt; color: #000000; text-decoration: none }\n\r       SPAN.heading5 { font-family: Helvetica,Arial; font-weight: normal; font-size: 8pt; color: #000000; text-decoration: none }\n\r       SPAN.heading6 { font-family: Helvetica,Arial; font-weight: normal; font-size: 8pt; color: #000000; text-decoration: none }\n\r\n\r       SPAN.hilight1 { font-family: Top; font-weight: normal; font-size: pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight2 { font-family: Previous; font-weight: normal; font-size: pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight3 { font-family: Next; font-weight: normal; font-size: pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight4 { font-family: Helvetica,Arial; font-weight: normal; font-size: 8pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight5 { font-family: Helvetica,Arial; font-weight: normal; font-size: 8pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight6 { font-family: Helvetica,Arial; font-weight: normal; font-size: 8pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r</style>\n\r<body bgcolor=\"#FFFFFF\">\n\r  <font face=\"Top\" size=\"4\"><b>\n\rFX ChemStruct 1 Help\n\r  </b></font>\n\r  <br>\n\r  <br>\n\r\n\r  <!-- Place holder for the TOC, do not delete the line below -->\n\r  ");var currentNumArray = currentNumber.split(".");
var currentLevel = currentNumArray.length-1;
var currentIndex = 1;
if (currentNumber == "") currentNumber = top.location.href.substring(top.location.href.lastIndexOf("?")+1,top.location.href.length);
for (i=0; i<tocTab.length; i++) {
if (tocTab[i][2] == currentNumber && tocTab[i][2] != "") {
currentIndex = i;
break;
}
if (tocTab[i][0] == currentNumber) {
currentIndex = i;
break;
}
}
if (currentIndex < tocTab.length-1) {
nextLevel = tocTab[currentIndex+1][0].split(".").length-1;
currentIsExpanded = nextLevel > currentLevel && toDisplay[currentIndex+1];
}
else currentIsExpanded = false;
theHref = (noLink) ? "" : tocTab[currentIndex][2];
theTarget = tocTab[currentIndex][3];
for (i=1; i<tocTab.length; i++) {
if (tocChange) {
thisNumber = tocTab[i][0];
thisNumArray = thisNumber.split(".");
thisLevel = thisNumArray.length-1;
isOnPath = true;
if (thisLevel > 0) {
for (j=0; j<thisLevel; j++) {
isOnPath = (j>currentLevel) ? false : isOnPath && (thisNumArray[j] == currentNumArray[j]);
}
}
toDisplay[i] = (tocChange == 1) ? isOnPath : (isOnPath || toDisplay[i]);
if (thisNumber.indexOf(currentNumber+".")==0 && thisLevel > currentLevel) {
if (currentIsExpanded) toDisplay[i] = false;
else toDisplay[i] = (thisLevel == currentLevel+1);
}
}
}
var scrollY=0, addScroll=tocScroll;
for (i=0; i<tocTab.length; i++) {
if (toDisplay[i]) {
thisNumber = tocTab[i][0];
thisNumArray = thisNumber.split(".");
thisLevel = thisNumArray.length-1;
isCurrent = (i == currentIndex);
if (i < tocTab.length-1) {
nextLevel = tocTab[i+1][0].split(".").length-1;
img = (thisLevel >= nextLevel) ? tocTab[i][4] : ((toDisplay[i+1]) ? tocTab[i][5] : tocTab[i][4]);
}
else img = tocTab[i][4];
thisTextClass = ((thisNumber==currentNumber)?("hilight"):("heading"));
if (addScroll) scrollY+=((thisLevel<2)?mdi:sml)*25;
if (isCurrent) addScroll=false;
toc.document.write("<table border=0 cellspacing=0 cellpadding=2>");
toc.document.write("<tr><td width=" + ((thisLevel+1) * 20) + " align=right valign=top>");
toc.document.write("<a href=\"javaScript:history.go(0)\" onMouseDown=\"parent.reDisplay('" + thisNumber + "'," + tocBehaviour[0] + "," + tocLinks[0] + ",event)\">");
toc.document.write("<img src=\"" + img + "\" border=0></a>");
toc.document.write("</td><td align=left>");
toc.document.write("<a href=\"javaScript:history.go(0)\" onMouseDown=\"parent.reDisplay('" + thisNumber + "'," + tocBehaviour[1] + "," + tocLinks[1] + ",event)\">");
toc.document.write("<span class=\""  + thisTextClass + ((thisLevel>5) ? 6 : thisLevel+1) + "\">");
toc.document.write( ((showNumbers)?(thisNumber+" "):"") + tocTab[i][1]);
toc.document.write("</span></a>");
toc.document.writeln("</td></tr></table>");
}
}
if (!noLink) {
oldLastVisitNumber = oldCurrentNumber;
oldCurrentNumber = currentNumber;
}
toc.document.write("\n\r\n\r  <br>\n\r  <hr>\n\r  <font face=\"Top\" size=\"1\">\n\r&copy; 1993-2002 Efofex Software\n\r  </font>\n\r</body>\n\r</html>\n\r");
toc.document.close();
if (tocScroll) toc.scroll(0,scrollY);
if (theHref)
if (theTarget=="top") top.location.href = theHref;
else if (theTarget=="parent") parent.location.href = theHref;
else if (theTarget=="blank") open(theHref,"");
else content.location.href = theHref;
}
