//---------------------------------------------------------------------------
// 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", "Introduction", "introduction.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("1.1", "Library in the pocket", "library_in_the_pocket.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("1.2", "Two kinds of bookreader midlets", "two_kinds_of_bookreaders.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("1.2.1", "Standalone applications", "standalone_applications.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("1.2.2", "Midlet with embeded book", "midlet_with_embeded_book.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("1.2.3", "Defferences beetween FULL, LITE è TINY versions of ReadManiac", "full_lite_differences.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2", "Installation", "installation.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("2.1", "WAP download", "wap_installation.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.2", "Installation by cable", "installbycable.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.3", "Installation via IRDA or Bluetooth", "irdaorbluetoothinstallation.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4", "Using Wizard to build midlet", "midlet_creation.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("2.4.1", "Building  ReadManiac FULL", "", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("2.4.1.1", "Wizard interface language selection", "wizardlanguagefull.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.1.2", "Midlet kind selection", "midletkindselectionfull.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.1.3", "Phone model selection", "phonemodelselectionfull.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.1.4", "Keys configuration selection", "keysconfigselectionfull.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.1.5", "Midlet interface language selection", "midletlanguageselectionfull.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.1.6", "Optional support of ZIP,PDB,PRC,TCR", "zipsupportselection.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.1.7", "Selecting storage directory", "selectingstoragedirectory.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.1.8", "Additional fonts selection", "fontsselectionfull.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.1.9", "Advanced options page", "advancedoptionsselectionfull.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.1.10", "Chosing destination directory", "midletsavefull.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.2", "Building ReadManiac LITE or TINY", "", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("2.4.2.1", "Wizard interface language selection", "wizardlanguageselectionlite.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.2.2", "Midlet kind selection", "midletkindselectionlite.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.2.3", "Phone model selection", "phonemodelselectionlite.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.2.4", "Keys configuration selection", "keysconfigurationselectionlite.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.2.5", "Midlet interface language selection", "midletlanguageselectionlite.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.2.6", "Additional fonts selection", "fontsselectionlite.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.2.7", "Chosing books to embed into midlet", "booksselection.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.2.8", "Midlet name and introduction text", "midletnameandintroductiont.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.2.9", "Images conversion options for HTML files", "imagesconversionselection.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.2.10", "Advanced options page", "advancedoptionsselectionlite.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.2.11", "Chosing destination directory", "midletsavelite.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.3", "Build all versions of ReadManiac FULL", "allversionsfull.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.4", "Build LITE version for a custom list of phones", "liteforlistofphones.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.5", "Advanced options", "advancedoptions.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("2.4.6", "Creating books with images and equations", "bookswithimages.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("3", "Creating fonts", "fontcreation.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("3.1", "CreateFont utility interface", "createfont.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("3.2", "Drawing fonts", "drawfont.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("3.2.1", "Installing Windows fonts", "installwindowsfont.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("3.3", "Installing ReadManiac fonts", "installreadmaniacfont.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("4", "Using ReadManiac", "", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("4.1", "Menu", "menu.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("4.1.1", "Main menu", "menumain.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("4.1.2", "File menu", "menufile.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("4.1.2.1", "File download dialog", "menudownload.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("4.1.2.2", "Search book dialog", "menusearchbook.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("4.1.3", "Options menu", "menuparameters.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("4.1.3.1", "Fonts menu", "menufonts.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("4.1.3.2", "Formating menu", "menuparagraph.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("4.1.3.3", "Layout menu", "menuscreen.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("4.1.3.4", "Codepage menu", "menucodepage.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("4.1.3.5", "Slideshow menu", "menuslideshow.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("4.1.4", "Bookmarks menu", "menubookmarks.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("4.2", "Reading book", "reading.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("4.3", "Phone keys", "phonekeys.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("4.3.1", "Custom keys configuration", "customkeysconfiguration.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5", "Glossary", "", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("5.1", "API", "api.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.2", "BlueTooth", "bluetooth.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.3", "BookReader", "bookreader.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.4", "ClearType", "cleartype.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.5", "Codepage", "codepage.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.6", "IRDA", "irda.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.7", "JAR and JAD", "jar_jad.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.8", "JAVA and J2ME", "java_j2me.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.9", "JSR-75 API", "jsr_75api.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.10", "Midlet", "midlet.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.11", "Midlet core", "core.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.12", "MIDP1.0 and  MIDP2.0", "midp1_0_midp2_0.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.13", "Motorola FileAccess API", "motorolafileaccessapi.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.14", "PDB, PRC and TCR", "pdbprctcr.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.15", "Recordstore", "recordstore.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.16", "RSA", "rsa.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.17", "SHA-1", "sha1.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.18", "Siemens File API", "siemensfileapi.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.19", "Signed midlet", "signedmidlet.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.20", "WAP", "wap.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("5.21", "ZIP", "zip.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("6", "Frequently asked questions", "", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("6.1", "What phones does ReadManiac support?", "onwhatphones.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("6.2", "What phone models allow filesystem access from midlet?", "filesystemaccessmodels.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("6.2.1", "Filesystem access on Siemens SL45i, M50 and C55", "fssl45i.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("6.2.2", "Filesystem access on Siemens S55, M55, C60, CF62 and others from 55-62 series", "fss55.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("6.2.3", "Filesystem access on Siemens 65-75 series", "fss65.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("6.2.4", "Filesystem access on Siemens S75, SL75, SXG75", "fss75.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("6.2.5", "Filesystem access on phones with JSR-75 API support", "fsjsr75.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("6.2.6", "Filesystem access on phones with Motorola FileAccess API support", "fsmoto.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("6.2.7", "Filesystem access on Motorola phones with JSR-75 API support", "fsmotojsr75.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("6.3", "How to get rid of annoying security prompts?", "howtogetrid.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("6.4", "Why midlet does not work in fullscreen?", "nofullscreen.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("6.5", "What file formats are supported by ReadManiac?", "whatformats.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("6.6", "Why midlet turn pages by 2 and more?", "pagingby2.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("6.7", "What about right-to-left languages support (Arabic, Hebrew)?", "whataboutright_to_leftlangu.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("6.8", "JavaME FAQ", "javamefaq.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("7", "Known issues", "knownissues.htm", "", "cicon1.gif", "cicon2.gif");
tocTab[ir++] = new Array ("7.1", "Motorola E680/768/760/A780", "motorolae680768760a780.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("7.2", "Nokia 6230i", "nokia6230i.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("7.3", "Samsung C100", "samsungc100.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("7.4", "Samsung D500/D600", "samsungd500d600.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("7.5", "Siemens S55", "siemenss55.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("7.6", "Siemens S75/SL75/SXG75", "siemenss75sl75sxg75.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("7.7", "Siemens SL45i", "siemenssl45i.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("7.8", "SonyErricsson K750i", "sonyerricsoonk750i.htm", "", "cicon9.gif", "cicon9.gif");
tocTab[ir++] = new Array ("8", "Contributors", "thanks.htm", "", "cicon9.gif", "cicon9.gif");
isContent = true,
isIndex = false,
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 (isIndex && (toc.location.href.substring(toc.location.href.lastIndexOf("/")+1,toc.location.href.length) != "readmaniac_en_kwindex.htm")) { isIndex=false; isContent=true; }
if (currentNumber == "navIndex") { isContent=false; }
if (currentNumber == "navContent") { isIndex=false; isContent=true; }
if (e) {
ctrlKeyDown = (isIE) ? e.ctrlKey : (e.modifiers==2);
if (tocChange && ctrlKeyDown) tocChange = 2;
}
var currentNumArray = currentNumber.split(".");
var currentLevel = currentNumArray.length-1;
var currentIndex = 0;
var scrollY=0, addScroll=tocScroll;
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][0] == currentNumber) || (tocTab[i][2] == currentNumber && tocTab[i][2] != "")) {
currentIndex = i;
currentNumber = tocTab[i][0];
currentNumArray = currentNumber.split(".");
currentLevel = currentNumArray.length-1;
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);
}
}
}
if (!isContent && !isIndex) {
toc.location.href = "readmaniac_en_kwindex.htm";
isIndex = true;
}
if (isContent) {
toc.document.write("<html>\n\r<head></head>\n\r<style type=\"text/css\">\n\r       SPAN.heading1 { font-family: Arial,Helvetica; font-weight: normal; font-size: 10pt; color: #000000; text-decoration: none }\n\r       SPAN.heading2 { font-family: Arial,Helvetica; font-weight: normal; font-size: 9pt; color: #000000; text-decoration: none }\n\r       SPAN.heading3 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #000000; text-decoration: none }\n\r       SPAN.heading4 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #000000; text-decoration: none }\n\r       SPAN.heading5 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #000000; text-decoration: none }\n\r       SPAN.heading6 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #000000; text-decoration: none }\n\r\n\r       SPAN.hilight1 { font-family: Arial,Helvetica; font-weight: normal; font-size: 10pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight2 { font-family: Arial,Helvetica; font-weight: normal; font-size: 9pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight3 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight4 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight5 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r       SPAN.hilight6 { font-family: Arial,Helvetica; font-weight: normal; font-size: 8pt; color: #FFFFFF; background: #002682; text-decoration: none }\n\r</style>\n\r<body bgcolor=\"#FFFFFF\">\n\r<meta http-equiv=\"Content-Type\" CONTENT=\"text/html; charset=windows-1251\">\n\r<font face=\"Arial,Helvetica\" size=\"4\"><b>ReadManiac Manual</b></font>\n\r\n\r  <!-- Place holder for the TOC, do not delete the line below -->\n\r  ");}
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];
if (isContent) {
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>");
} //isContent
}
}
if (!noLink) {
oldLastVisitNumber = oldCurrentNumber;
oldCurrentNumber = currentNumber;
}
if (isContent) {
toc.document.write("\n\r\n\r<hr><font face=\"Arial,Helvetica\" size=\"1\">ReadManiac © 2003-2006 by Roman Lut</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;
}

