/* Variable depth automatic section numbering inserted by short, * manually added scripts. * * History * ======= * * 30-May-2007 (ADH): Imported into Wiki structure. */ var sectionNumberingDepth = 2; // Maximum allowed depth var sectionNumberingContents = new Array(); var sectionNumberingSections = new Array(); for (var i = 0; i < sectionNumberingDepth; i++) { sectionNumberingContents[i] = 1; sectionNumberingSections[i] = 1; } ////////////////////////////////////////////////////////////////////////// // Insert section number into the document. Pass the nesting level; // 1 = highest level (i.e. a major section), 'sectionNumberingDepth' // (see start of script) = lowest level (i.e. a subsection). ////////////////////////////////////////////////////////////////////////// function isn(level) { if (level > sectionNumberingDepth) return; // Must reset any section number counters at a lower level than this one // - array indices start at 0, so the loop initial condition is right. for (var i = level; i < sectionNumberingDepth; i++) sectionNumberingSections[i] = 1; sectionNumberingSections[level - 1]++; for (var i = 0; i < level; i++) document.write((sectionNumberingSections[i] - 1) + "."); document.write(" "); } ////////////////////////////////////////////////////////////////////////// // Increment section counters for a contents page. Pass the nesting // level - see function 'isn' for details. If the level is greater // than zero, a number will be output into the document as well, // indented by an appropriate amount. At levels of 1, no number is // output; it is assumed an ordered list will be being used, so that // scriptless browsers get at least some kind of sensible contents. ////////////////////////////////////////////////////////////////////////// function icsn(level) { if (level > sectionNumberingDepth) return; for (var i = level; i < sectionNumberingDepth; i++) sectionNumberingContents[i] = 1 sectionNumberingContents[level - 1]++; if (level > 1) { var indent = "     "; // Ick... document.write(""); for (var i = 1; i < level; i++) { document.write(indent); } document.write("<\/tt>"); for (var i = 0; i < level; i++) { document.write((sectionNumberingContents[i] - 1) + "."); } document.write(" "); } } ////////////////////////////////////////////////////////////////////////// // Output a grey 'banner' for a SWI, service call etc. section header; // pass the nesting level (usually 2, or 3 for (sub-)reason codes), // an anchor name, and the title text to write out. ////////////////////////////////////////////////////////////////////////// function icp(level, name, title) { var insert1 = ' \n' + ' \n' + '
\n' + ' \n'; var insert2 = ' <\/font>\n' + ' <\/td>\n' + ' \n' + ' \n' + ' ' + title + '<\/a>\n' + ' <\/font>\n' + ' <\/td>\n' + ' <\/tr>\n' + ' <\/table>\n' document.write(insert1); isn(level); document.write(insert2); }