// Global variables var isCSS, isW3C, isIE4, isNN4, isIE6CSS; // initialize upon load to let all browsers establish content objects function initDHTMLAPI () { if (document.images) { //isCSS = (document.body && document.body.style) ? true : false; isCSS = true; isW3C = (isCSS && document.getElementById) ? true : false; isIE4 = (isCSS && document.all) ? true : false; isNN4 = (document.layers) ? true : false; isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false; } } // seek nested NN4 layer from string name function seekLayer(doc, name) { var theObj; for (var i=0; i < doc.layers.length; i++) { if (doc.layers[i].name == name) { theObj = doc.layers[i]; break; } // dive into nested layers if necessary if (doc.layers[i].document.layers.length > 0) { theObj = seekLayer(document.layers[i].document, name); } } return theObj; } // convert object name string or object reference // into a valid element object reference function getRawObject(obj) { var theObj; if (typeof obj == "string") { if (isW3C) { theObj = document.getElementById(obj); } else if (isIE4) { theObj = document.all(obj); } else if (isNN4) { theObj = seekLayer(document, obj); } } else { //pass through object reference theObj = obj; } return theObj; } // Convert object name string or object reference // into a valid style (or NN4 layer) reference function getObject(obj) { var theObj = getRawObject(obj); //alert(theObj); if (theObj && isCSS) { theObj = theObj.style; } return theObj; } //set the visibility of an object to visible (inline) function showInline(obj) { var theObj = getObject(obj); if (theObj) { theObj.display = "inline"; } } //set the visibility of an object to hidden function hide(obj) { var theObj = getObject(obj); if (theObj) { theObj.display = "none"; } } var debug=false; function isThisAnUpdateCandidate( url ) { } function processLink(tag) { } function updateLinks() { } var debug = false; function rotateToNextFontSize() { var i; var allUniqueCssTitles = getAllUniqueStyleSheetTitlesSansPrint(); var activeIndex = findValueInArray(getActiveStyleSheetTitle(), allUniqueCssTitles); if (debug) alert("main: getActiveStyleSheetTitle->"+getActiveStyleSheetTitle()+", activeIndex="+activeIndex+", getCssDirection()="+getCssDirection()); activeIndex += getCssDirection(); // Put activeIndex back in a valid range in case the user modified something if (activeIndex > allUniqueCssTitles.length-1) activeIndex = allUniqueCssTitles.length-1; else if (activeIndex < 0) activeIndex = 0; if (debug) alert(allUniqueCssTitles[activeIndex]); setActiveStyleSheet(allUniqueCssTitles[activeIndex]); /* Set the direction of the font changer */ if (activeIndex == allUniqueCssTitles.length-1){ setCssDirection(-1); if (debug) alert("main: Heading down now"); } else if (activeIndex == 0){ setCssDirection(1); if (debug) alert("main: Heading up now"); } else { if (debug) alert("main: activeIndex="+activeIndex+", allUniqueCssTitles.length-1="+(allUniqueCssTitles.length-1)+" no change in direction"); } processIncreaseButton(); } function setCssDirection(direction){ if (direction==1) createCookie("direction", "up", 365); else createCookie("direction", "down", 365); } function getCssDirection() { if (readCookie("direction")=="down") return -1; return 1; } function setPrintMode() { var linkArray = document.getElementsByTagName("link"); var returnArray = new Array(); for(i=0; (a = linkArray[i]); i++) { if( a.getAttribute("rel").indexOf("style")!=-1 && a.getAttribute("title") == "print" ) { createCookie("formerCSS", getActiveStyleSheetTitle(), 365); setActiveStyleSheet(a.getAttribute("title")); return; } } } function returnFromPrintMode() { setActiveStyleSheet( readCookie("formerCSS") ); } function getAllStyleSheets() { var linkArray = document.getElementsByTagName("link"); var returnArray = new Array(); for(i=0; (a = linkArray[i]); i++) { if( a.getAttribute("rel").indexOf("style")!=-1 && a.getAttribute("title") && ( !a.getAttribute("media") || a.getAttribute("media").indexOf("print")==-1 ) ) { returnArray.push(a); } } return returnArray; } function getAllUniqueStyleSheets() { var allStyleSheets = getAllStyleSheets(); var allCssTitles = new Array(); var allCss = new Array(); for (var i=0; i