// Global ----------------------- var popupState = -1; // -1 - unknown; 0 - loading; 1 - loaded; var popupDocument = null; var popClientPos = null; var popUpShown = null; var nstextHeight = -1; var _d2hInlinePopup = null; var _d2hIndex = new d2hIndexTable(); var _d2hPopupMenu = null; var _isPrinting = false; // ------------------------------ // Constants var d2hNormalButton = 1; var d2hSelectedButton = 2; var d2hHoverButton = 3; var d2hPassiveButton = 4; // Border adjustment modes var d2hRemoveRight = 1; var d2hRemoveLeft = 2; var d2hRestoreTopicLeft = 3; // Variable names var d2hLeftPaneCaption = "%LeftPaneCaption%"; var d2hTopicTitle = "%TopicTitle%"; var d2hTopicURL = "%TopicURL%"; function isOpera() { var strUserAgent = navigator.userAgent.toLowerCase(); var res = strUserAgent.indexOf("opera") == -1 ? false : true; return res; } function getOperaVersionNumber() { var strUserAgent = navigator.userAgent.toLowerCase(); var indx = strUserAgent.indexOf("opera"); if (indx < 0) { return 0; } var end = strUserAgent.indexOf(" ", indx + 6); var ver = strUserAgent.substring(indx + 6, end); return parseFloat(ver); } function isIE() { var appname = navigator.appName.toLowerCase(); return (appname == "microsoft internet explorer"); } function getIEVersion() { var ua = navigator.userAgent; var MSIEOffset = ua.indexOf("MSIE "); if (MSIEOffset == -1) return "0"; else return ua.substring(MSIEOffset + 5, ua.indexOf(";", MSIEOffset)); } function getIEVersionNumber() { return parseFloat(getIEVersion()); } function isNN() { var ua = navigator.userAgent.toLowerCase(); var bGecko = (ua.indexOf("gecko") > -1); if (bGecko) { return ua.indexOf("netscape") > -1; } return false; } function getNNVersionNumber( ) { var ua = navigator.userAgent.toLowerCase(); var indx = ua.indexOf("netscape"); if (indx == -1) { return 0; } else { var indxN = ua.indexOf("/", indx); if (indxN > -1) { indx = indxN + 1; } else { indx += 10; } var end = ua.indexOf(" ", indx); if (end == -1) { end = ua.length; } var ver = ua.substring(indx, end); indx = ver.indexOf("."); if (indx > -1) { var val = ver.substring(0, indx + 1); while (ver.indexOf(".", indx) > -1) { ver = ver.replace(".", ""); } ver = val + ver.substring(indx); } return parseFloat(ver); } } function isMozilla() { var ua = navigator.userAgent.toLowerCase(); var bGecko = (ua.indexOf("gecko") > -1); if (bGecko) { return ua.indexOf("netscape") < 0; } return false; } function getMozillaVersionNumber( ) { var ua = navigator.userAgent.toLowerCase(); var indx = ua.indexOf("rv:"); if (indx == -1) { return 0; } else { indx += 3; var end = ua.indexOf(")", indx); if (end > -1) { return parseFloat(ua.substring(indx, end)); } else { return parseFloat(ua.substring(indx)); } } } function verifyBrowser() { if (isOpera()) { if (getOperaVersionNumber() < 7.54) { browserNotSupported(); return false; } } else if (isNN()) { if (getNNVersionNumber() < 6.23) { browserNotSupported(); return false; } } else if (isMozilla()) { if (getMozillaVersionNumber() < 1.2) { browserNotSupported(); return false; } } return true; } function getSearchVal(strS, offset) { var endstr = strS.indexOf('&', offset); if (endstr == -1) { endstr = strS.length + 1; } var val = strS.substring(offset, endstr); var test = val.replace('+', ' '); while (val.indexOf(test) == -1) { val = test; test = val.replace('+', ' '); } return decodeURIComponent(test); } function getQueryVal(strS, name) { var arg = name + "="; var alen = arg.length; var clen = strS.length; var i = 0; while (i < clen) { var j = i + alen; if (strS.substring(i, j) == arg) { return getSearchVal(strS, j); } i = strS.indexOf("&", i) + 1; if (i == 0) break; } return ""; } function getElemById(doc, id) { try { if (typeof doc.all != "undefined") return doc.all(id); else return doc.getElementById(id); } catch(e) { } return null; } function getFrameByName(strName, wnd) { var frm = null; try { if (typeof wnd == "undefined" || wnd == null) wnd = window; if (typeof wnd.parent.document.frames != "undefined") frm = wnd.parent.document.frames[strName]; else { var arrFrames = wnd.parent.document.getElementsByName(strName); if (arrFrames == null || arrFrames.length == 0) return null; frm = arrFrames[0]; } } catch(e) { } return frm; } function getIFrameById(strId) { var frm; if (typeof document.frames != "undefined") frm = document.frames[strId]; else frm = getElemById(document, strId); return frm; } function getFrameDocument(frm) { if (!frm) return null; var doc = null; try { if (typeof frm.contentWindow != "undefined" && typeof frm.contentWindow.document != "undefined") doc = frm.contentWindow.document; else if (typeof frm.contentDocument != "undefined") doc = frm.contentDocument; else if (typeof frm.document != "undefined") doc = frm.document; } catch(e) { } return doc; } function getDocumentByFrameNameOrCurrentDocument(strName) { var frm = getFrameByName(strName); if (frm == null) return document; else return getFrameDocument(frm); } function getDoc(wnd) { return getFrameDocument(wnd); } function getWindow(doc) { var wnd = null; if (typeof doc.defaultView != "undefined") wnd = doc.defaultView; else if (typeof doc.contentWindow != "undefined") wnd = doc.contentWindow; else if (typeof doc.parentWindow != "undefined") wnd = doc.parentWindow; return wnd; } function d2hGetOwnerDocument(elem) { var doc = null; if (typeof elem.document != "undefined") doc = elem.document; else if (typeof elem.ownerDocument != "undefined") doc = elem.ownerDocument; return doc; } function getNsTextHeight(doc) { var text = getElemById(doc, "nstext"); if (text == null) text = doc.body; var res = 16; var wnd = getWindow(doc); if (text.style.overflow == "auto") { if (typeof text.clientHeight != "undefined") res = text.clientHeight - 2; else { if (wnd != null && typeof wnd.getComputedStyle != "undefined") res = parseInt(wnd.getComputedStyle(text, '').getPropertyValue("height")) - 16; else res = parseInt(text.style.height) - 16; } } else { var topicBody = getElemById(doc, "D2HTopicOuterBody"); if (topicBody && topicBody.style.overflow == "auto") { if (typeof topicBody.clientHeight != "undefined") res = topicBody.clientHeight - 2; else { if (wnd != null && typeof wnd.getComputedStyle != "undefined") res = parseInt(wnd.getComputedStyle(topicBody, '').getPropertyValue("height")) - 16; else res = parseInt(topicBody.style.height) - 16; } } else res = typeof doc.body.clientHeight != "undefined" ? (doc.body.clientHeight - 2) : (wnd.innerHeight - 16); } return res; } function getNsTextWidth(doc) { var text = getElemById(doc, "nstext"); if (text == null) text = doc.body; var res = 16; var wnd = getWindow(doc); if (text.style.overflow == "auto") { if (typeof text.clientWidth != "undefined") res = text.clientWidth - 2; else { if (wnd != null && typeof wnd.getComputedStyle != "undefined") res = parseInt(wnd.getComputedStyle(text, '').getPropertyValue("width")) - 16; else res = parseInt(text.style.width) - 16; } } else { var topicBody = getElemById(doc, "D2HTopicOuterBody"); if (topicBody && topicBody.style.overflow == "auto") { if (typeof topicBody.clientWidth != "undefined") res = topicBody.clientWidth - 2; else { if (wnd != null && typeof wnd.getComputedStyle != "undefined") res = parseInt(wnd.getComputedStyle(topicBody, '').getPropertyValue("width")) - 16; else res = parseInt(topicBody.style.width) - 16; } } else res = typeof doc.body.clientWidth != "undefined" ? (doc.body.clientWidth - 2) : (wnd.innerWidth - 16); } return res; } function point(x, y) { this.x = x; this.y = y; } function getNsTextLocation(doc) { if (doc == null) doc = document; var text = getElemById(doc, "nstext"); if (text == null) text = doc.body; if (text.style.overflow == "auto") return new point(text.offsetLeft, text.offsetTop); else return new point(0, 0); } function getMouseAtNsText(doc, pop, evt) { if (doc == null) doc = document; var pt = getNsTextLocation(doc); var ptRes; if (pop != null) { if (typeof evt.pageX != "undefined") ptRes = new point(parseInt(evt.pageX) + parseInt(pop.offsetLeft), parseInt(evt.pageY) + parseInt(pop.offsetTop)); else ptRes = new point(parseInt(evt.offsetX) + parseInt(pop.offsetLeft), parseInt(evt.offsetY) + parseInt(pop.offsetTop)); if (typeof doc.body.scrollLeft != "undefined") { ptRes.x -= parseInt(doc.body.scrollLeft) + parseInt(document.body.scrollLeft); ptRes.y -= parseInt(doc.body.scrollTop) + parseInt(document.body.scrollTop); } else if (typeof window.pageXOffset != "undefined") { var wnd = getWindow(doc); if (wnd != null) { ptRes.x -= parseInt(wnd.pageXOffset); ptRes.y -= parseInt(wnd.pageYOffset); } wnd = getWindow(document); if (wnd != null) { ptRes.x -= parseInt(wnd.pageXOffset); ptRes.y -= parseInt(wnd.pageYOffset); } } } else ptRes = new point(evt.x ? evt.x : evt.clientX, evt.y ? evt.y : evt.clientY); ptRes.x -= pt.x; ptRes.y -= pt.y; return ptRes; } function rectangle(x, y, width, height) { this.x = x; this.y = y; this.height = height; this.width = width; } function getPopup(doc, popDoc, frm, pt, clientPt, initialWidth) { if (doc == null) doc = document; var w = getNsTextWidth(doc); if (initialWidth > w) initialWidth = w; var pop = getElemById(doc, "d2h_popupFrameWnd"); var delta = 0; if (clientPt.x + initialWidth > w) delta = clientPt.x + initialWidth - w; if (pt.x < delta) { initialWidth += pt.x - delta; pt.x = 0; } else pt.x -= delta; if (pop != null) pop.style.width = initialWidth; var rect = new rectangle(pt.x, 0, initialWidth, 0); var h = getNsTextHeight(doc); var initialHeigth = getAvailableHeight(frm, popDoc); delta = (2*h)/3; var bDown = delta > clientPt.y; var popH; if (bDown) popH = h - clientPt.y; else popH = clientPt.y; if (initialHeigth > popH) { if (initialHeigth > h) initialHeigth = h > 20 ? h - 20 : h / 2; if (clientPt.y + initialHeigth >= h) { pt.y -= clientPt.y + initialHeigth - h; initialHeigth -= 20; } rect.y = pt.y; rect.height = initialHeigth; } else { rect.height = initialHeigth + 1; if (bDown) rect.y = pt.y + 15; else { rect.y = pt.y - 15; rect.y -= rect.height; } } return rect; } function getPopCoords(bPopupOpen, doc, evt) { if (doc == null) doc = document; var elem = (evt.target) ? evt.target : evt.srcElement; var nstx = getElemById(doc, "nstext"); if (nstx == null) nstx = doc.body; var topicBody = getElemById(doc, "D2HTopicOuterBody"); var pt = new point(0, 0); var pop = getElemById(doc, "d2h_popupFrameWnd"); var isOp = false; if (isOpera() && typeof nstx.offsetLeft != "undefined") { isOp = true; pt.x = evt.x; pt.y = evt.y; if (!bPopupOpen) { pt.x += doc.body.scrollLeft; pt.y += doc.body.scrollTop; if (nstx && nstx.style.overflow == "auto") pt.y += nstx.scrollTop; if (topicBody) pt.y += topicBody.scrollTop; } } else if (typeof evt.layerY != "undefined") { pt.x = evt.pageX; pt.y = evt.pageY; } else { if (bPopupOpen) { pt.x = evt.offsetX; pt.y = evt.offsetY; } else { pt.x = evt.x + doc.body.scrollLeft; pt.y = evt.y + doc.body.scrollTop; if (nstx) pt.y -= nstx.offsetTop - nstx.scrollTop; if (topicBody) pt.y -= topicBody.offsetTop - topicBody.scrollTop; } } if (bPopupOpen) { pt.x += pop.offsetLeft; pt.y += pop.offsetTop if (!isOp) { if (typeof document.body.scrollLeft != "undefined") { pt.x -= document.body.scrollLeft; pt.y -= document.body.scrollTop; } else if (typeof window.pageXOffset != "undefined") { pt.x -= window.pageXOffset; pt.y -= window.pageYOffset; } } } return pt; } function getAvailableHeight(frm, popDoc) { var hgt = 140; if (frm != null && typeof frm.self != "undefined" && typeof frm.self.document.body.scrollHeight != "undefined") { hgt = frm.self.document.body.scrollHeight; if (isOpera()) hgt += 7; } else { if (typeof popDoc.body.scrollHeight != "undefined") hgt = popDoc.body.scrollHeight; else if (typeof popDoc.body.offsetHeight != "undefined") { hgt = popDoc.body.offsetHeight; hgt = hgt + 18; } } return hgt; } function d2hCreatePopupIFrame(doc) { var frm = null; var nstx = getElemById(doc, "nstext"); if (nstx == null) nstx = doc.body; if (!isOpera() && typeof doc.body.insertAdjacentHTML != "undefined") { nstx.insertAdjacentHTML("BeforeEnd", "
") var div = getElemById(document, "popupDiv"); if (div == null) return null; div.innerHTML = ""; frm = getElemById(doc, "d2h_popupFrameWnd"); if (typeof div.removeNode != "undefined") div.removeNode(false); } else { frm = doc.createElement("iframe"); frm.id = "d2h_popupFrameWnd"; frm.name = "d2h_popupFrameWnd"; frm.frameBorder = "no"; frm.height = "0px" frm.width = "0px" frm.style.visibility = "hidden"; frm.style.position = "absolute"; nstx.appendChild(frm); } frm.style.margin = "0pt"; frm.style.padding = "0pt"; return frm; } function dhtml_popup(evt, url) { ANCHOR = ""; var mainDoc, pop, main, body, x, y, pt; // no url? then hide the popup if (url == null || url.length == 0) { pop = getElemById(document, "d2h_popupFrameWnd"); if (pop != null) { pop.style.display = "none"; pop.left = 0; pop.top = 0; pop.width = 0; pop.height = 0; pop.style.visibility = "hidden"; pop.style.border = ""; pop.setAttribute("src", "about:blank"); } return; } popUpShown = false; // if the popup frame is already open, close it first if (dhtml_popup_is_open()) { popUpShown = true; // the main window is the parent of the popup frame main = window.parent; mainDoc = getDoc(main); body = main.document.body; pop = getElemById(main.document, "d2h_popupFrameWnd"); pt = getPopCoords(popUpShown, mainDoc, evt); x = pt.x; y = pt.y; main.popClientPos = getMouseAtNsText(mainDoc, pop, evt); // hide the popup frame if (!isNN()) pop.style.display = "none"; pop.style.visibility = "hidden"; } else { // the main window is the current window main = window; mainDoc = getDoc(main); body = document.body; pop = getElemById(document, "d2h_popupFrameWnd"); // use the event coordinates for positioning the popup pt = getPopCoords(popUpShown, mainDoc, evt); x = pt.x; y = pt.y; popClientPos = getMouseAtNsText(mainDoc, null, evt); // get the popup frame, creating it if needed if (pop == null) pop = d2hCreatePopupIFrame(document); } if (pop == null) { d2hwindow(url, "d2hPopup"); return; } // get frame style var sty = pop.style; // load url into frame var anchorIndex = url.indexOf("#", 0); setPopupState(-1, popUpShown); pop.setAttribute("src", d2hGetRelativePath(document, "_d2hblank.htm")); pop.style.display = "block"; setPopupState(0, popUpShown); var strUrl; if (anchorIndex >= 0) { ANCHOR = url.substr(anchorIndex + 1); //workaround to reset current src strUrl = url.substr(0, anchorIndex); } else strUrl = url; if (popUpShown) open(strUrl, isOpera() ? "_self" : "d2h_popupFrameWnd"); else { if (isOpera() && getOperaVersionNumber() >= 9.0) open(strUrl, "d2h_popupFrameWnd"); else pop.src = strUrl; } // initialize frame size/position sty.border = "1px solid #cccccc"; sty.left = x - 30000; sty.top = y - 30000; var wid = getInsideWindowWidth(mainDoc) - 60; if (wid < 10) wid += 60; sty.width = (wid > 500)? wid * 0.6: wid; sty.height = 0; // wait until the document is loaded to finish positioning main.setTimeout("dhtml_popup_position()", 100); } function dhtml_popup_is_open() { return window.name == "d2h_popupFrameWnd"; } function popDocIsLoad() { if (window.popupState == 1 || window.g_d2hIterationCount == 10) { // g_d2hIterationCount is used for Opera 8.0 and higher, where OnLoad is not fired if the window is invisible (Opera bug) window.g_d2hIterationCount = 0; return true; } if (typeof window.g_d2hIterationCount == "undefined") window.g_d2hIterationCount = 1; else window.g_d2hIterationCount++; return false; } function dhtml_popup_position() { if (!popDocIsLoad()) { window.setTimeout("dhtml_popup_position()", 100); return; } // get frame var pop = getElemById(document, "d2h_popupFrameWnd"); var frm = getIFrameById("d2h_popupFrameWnd"); var sty = pop.style; if (!popupDocument) popupDocument = getDoc(frm); if (popupDocument) { if (getAllElements(popupDocument).length == 0) //if frame is empty, it contains its document, workaround must be applied d2h_set_popup_html(popupDocument); if (ANCHOR != "") //for non-splitting mode topics that are not needed must be hidden d2h_hide_unused_elements(popupDocument); // hide navigation/nonscrolling elements, if present dhtml_popup_elements(popupDocument); var popWnd = getWindow(popupDocument); if (popWnd) { popWnd.d2hPrepareAnchors4Popup(); popWnd.g_bMainWnd = false; } } var popDoc = popupDocument; // get containing element (scrolling text region or document body) var body = getElemById(document, "nstext"); var poptext = getElemById(popDoc, "nstext"); var nsbanner = getElemById(popDoc, "_d2hTitleNavigator"); d2hStandardizePopupMargin(popDoc.body, poptext, nsbanner); if (body == null) body = document.body; sty.visibility = "visible"; setPopupState(-1, popUpShown); // make content visible var pt = new point(parseInt(sty.left) + 30000, parseInt(sty.top) + 30000); var rect = getPopup(document, popDoc, frm, pt, popClientPos, parseInt(sty.width)); sty.left = rect.x; sty.top = rect.y; sty.width = rect.width; sty.height = rect.height; } function dhtml_popup_elements(doc) { d2hShowTopicTitleInPopup(doc); d2hHideBreadcrumbs(doc); // set popup background style doc.body.style.backgroundColor = POPUP_COLOR; doc.body.style.backgroundImage = "url('" + d2hGetRelativePath(doc, POPUP_IMAGE) + "')"; doc.body.style.backgroundRepeat = POPUP_REPEAT; doc.body.style.overflow = "auto"; // reset background image/color of topic, if present var outerBody = getElemById(doc, "D2HTopicOuterBody"); if (outerBody != null) { outerBody.style.backgroundImage = "none"; outerBody.style.backgroundColor = "transparent"; outerBody.style.overflow = "visible"; outerBody.style.width = ""; outerBody.style.height = ""; } // reset background image/color of scrolling text region, if present var nstx = getElemById(doc, "nstext"); if (nstx != null) { nstx.style.overflow = "visible"; nstx.style.backgroundImage = "none"; nstx.style.backgroundColor = "transparent"; } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // d2h functions: browser-independent // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function d2hie() { if (isOpera() || isNN() || isMozilla()) return false; else return isIE(); } function d2hpopup(evt, url) { evt = (evt) ? evt : ((window.event) ? event : null); if (_d2hInlinePopup != null) { var elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if (elem == null || !d2hElementInContainer(elem, _d2hInlinePopup)) { d2hHideInline(_d2hInlinePopup); _d2hInlinePopup = null; } } d2hClosePopupMenu(evt); // use dhtml if we can dhtml_popup(evt, url); return false; } function d2hwindow(url, name) { if (name != 'main') { var wnd = window.open(url, name, 'scrollbars=1,resizable=1,toolbar=0,directories=0,status=0,location=0,menubar=0,height=300,width=400'); wnd.focus(); return false; } return true; } function d2hcancel(msg, url, line) { return true; } function d2hload() { window.focus(); window.onerror = d2hcancel; setPopupState(1, true); d2hPrepareAnchors4Popup(); } function setPopupState(state, fromPop) { if (fromPop) { if (window.parent) { if (state == 1) window.parent.popupDocument = document; else window.parent.popupDocument = null; window.parent.popupState = state; } } else { if (state == 1) popupDocument = document; else popupDocument = null; popupState = state; } } function d2hframeload() { // for compatibility with HTML generated by earlier versions } function d2hGetCurrentStyleAttribute(elem, name) { if (typeof elem.currentStyle != "undefined" && typeof elem.currentStyle.getAttribute != "undefined") return elem.currentStyle.getAttribute(name); else { var doc = d2hGetOwnerDocument(elem); var wnd = doc ? getWindow(doc) : null; if (doc && wnd && typeof wnd.getComputedStyle != "undefined") return wnd.getComputedStyle(elem, '').getPropertyValue(name); else elem.style.getAttribute(name); } } function evalHideTocElem(elem) { var id = elem.id; if (id == undefined || id == null) return true; var res = true; var id1 = id.substring(0, 1); var id2 = id.substring(0, 2); if (id1 == "c") { elem.style.display = "none"; res = false; } else if (id1 == "a") { //fill book/topic properties elem.onmouseover = d2hItemOver; elem.onmouseout = d2hItemOut; elem.onfocus = d2hItemOver; elem.onblur = d2hItemOut; if (USE_SECTION_508 != "yes") elem.hideFocus = true; elem.title = getInnerText(elem); if (id2 == "am") elem.onkeypress = d2hclick; else if (id2 == "at") { elem.href = "javascript:void(0)"; elem.onkeypress = d2hclick; } else elem.onclick = d2hLinkClick; } else if (id1 == "i") { //fill book/topic image properties elem.align="absMiddle"; elem.border = "0"; elem.hspace = "0"; elem.vspace = "0"; if (id2 == "im" || id2 == "it") d2himage(elem, IMAGE_CLOSE, USE_SECTION_508, false); else d2himage(elem, IMAGE_TOPIC, USE_SECTION_508); } return res; } function reverseVisibileTocElem(elem, img, mode) { if (elem.style.display == "none") { if (mode != 2) { elem.style.display = ""; d2himage(img, IMAGE_OPEN, USE_SECTION_508, true); } } else { if (mode != 1) { elem.style.display = "none"; d2himage(img, IMAGE_CLOSE, USE_SECTION_508, false); } } } function getAllElements(doc) { if (typeof doc.all != "undefined") return doc.all; else return doc.getElementsByTagName("*"); } function d2htocload() { var elem = getElemById(document, "c-_root"); if (elem) d2hPrepareTocChildNodes(elem); } function d2hPrepareTocChildNodes(parent) { if (d2hGetAttribute(parent, "done") == "1") return; d2hTraverseElements(parent, evalHideTocElem, false, true); parent.setAttribute("done", "1"); } function d2hclick(evt) { evt = (evt) ? evt : ((typeof window.event != "undefined") ? event : null); if (evt) { var elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if (!elem) { return true; } if (elem.nodeType == 3) elem = elem.parentNode; if (elem.tagName.toLowerCase() == "span") elem = elem.parentNode; var id = elem.id; if (id == "D2HSyncToc") { return true; } var expand = false, shrink = false, needToRevert = false; var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode); if (evt.type == "keypress" && charCode < 13) return; expand = charCode == 43; shrink = charCode == 45; var isClick = evt.type == "click" || charCode == 13; needToRevert = expand || shrink || (id.substring(0, 2) == "at" && isClick); if (elem.tagName.toLowerCase() == "a" && !needToRevert) { showSelection(document, elem); return true; } if (id.substring(1, 2) != "m" && id.substring(1, 2) != "t") return true; var sub = id.substring(2); var elt = getElemById(document, "c" + sub); var img = getElemById(document, ((id.substring(1, 2) == "m") ? "im" : "it") + sub); if (elt != null) { d2hPrepareTocChildNodes(elt); reverseVisibileTocElem(elt, img, expand ? 1 : (shrink ? 2 : 0)); cancelEvent(evt); return false; } } return true; } function d2hItemSelect(evt) { evt = (evt) ? evt : ((typeof window.event != "undefined") ? event : null); if (evt) { var elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if (!elem) { return; } if (elem.nodeType == 3) elem = elem.parentNode; var id = elem.id; if (elem.tagName.toLowerCase() == "a") showSelection(document, elem); } } function d2hSearchItemSelect(href, evt) { d2hSetClickState("onresult"); d2hItemSelect(evt); d2hInitSecondaryWindows(); var lowhref = href.toLowerCase(); var wnd = _d2hSecondaryWindowsByTopics[lowhref]; if (typeof (wnd) == "undefined" || wnd == null || wnd == "") return true; else { var sWndFeatures = ""; if (typeof d2hInitWindowParams != "undefined") { d2hInitWindowParams(); if (_d2hWindowParamsByWindows[wnd]) sWndFeatures = _d2hWindowParamsByWindows[wnd]; } var hwnd = window.open(href, wnd, sWndFeatures); hwnd.focus(); } return false; } function d2hItemOver(evt) { evt = (evt) ? evt : ((window.event) ? event : null); if (evt) { var elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if (!elem) { return; } if (elem.nodeType == 3) elem = elem.parentNode; elem = findActualElementOver(elem); elem.className = CLASS_ITEMOVER; } } function d2hItemOut(evt) { evt = (evt) ? evt : ((window.event) ? event : null); if (evt) { var elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if (!elem) { return; } if (elem.nodeType == 3) elem = elem.parentNode; elem = findActualElementOver(elem); var curSel = getElemById(document, "curSel"); if (curSel != null && curSel.value == elem.id) elem.className = CLASS_ITEMCURSEL; else hideSelection(elem); } } function hideSelection(elem) { elem.className = CLASS_ITEMOUT; } function showSelection(doc, elem) { var curSel = getElemById(doc, "curSel"); if (!curSel) { return; } if (curSel.value != "") { var old = getElemById(doc, curSel.value); if (old) hideSelection(old); } curSel.value = elem.id; elem.className = CLASS_ITEMCURSEL; } //if element has special ID and special SPAN inside, this SPAN is returned function findActualElementOver(element) { var foundElem = null; var id = element.id.toLowerCase(); if (id.substring(0, 1) == "i") { foundElem = d2hGetParentElement(element); id = foundElem.id.toLowerCase(); } if (id.substring(0, 2) == "at") { var spanID = "st" + id.substring(2); foundElem = getElemById(document, spanID); } return foundElem == null ? element : foundElem; } // Sets a specified relative URL of image to specified HTML element function d2himage(element, image, apply508, isOpen) { if (element != null) { // Hide element if image is missing if (image == "") element.style.visibility = "hidden"; // Sets the specified image to element and displays it else { element.src = d2hGetRelativePath(d2hGetOwnerDocument(element), image); element.style.visibility = "visible"; if (apply508 == "yes") { var id = element.id.substring(0, 2); if (id == "im") element.alt = isOpen ? ALT_OPEN_BOOK_TOPIC : ALT_CLOSED_BOOK_TOPIC; else if (id == "it") element.alt = isOpen ? ALT_OPEN_BOOK_NO_TOPIC : ALT_CLOSED_BOOK_NO_TOPIC; else element.alt = ALT_TOPIC; element.title = element.alt; } if (apply508 == "no") element.alt = "" } } } function d2hnsresize(evt) { var ps = false; try { if (typeof window.parent.popupState != "undefined" && window.parent.popupState == 0) ps = true; } catch(e) { } if (window.parent && ps) setPopupState(1, true); else { if (d2hie()) dhtml_nonscrolling_resize(); else dhtml_NNscrollingStyle(); } } function d2h_before_print(doc) { if (_isPrinting) return; if (!doc) doc = document; doc.body.style.overflow = "visible"; doc.body.style.margin = "0pt"; var oText = getElemById(doc, "D2HTopicOuterBody"); if (oText != null) { oText.style.overflow = "visible"; oText.style.width = "100%"; } var nsText = getElemById(doc, "nstext"); if (nsText != null) { nsText.style.overflow = "visible"; nsText.style.width = "100%"; } var nav = getElemById(doc, "ienav"); if (nav != null) nav.style.display = "none"; var oBanner = getElemById(doc, "nsbanner"); if (oBanner != null) { oBanner.style.borderBottom = "0px"; oBanner.style.margin = "0px 0px 0px 0px"; oBanner.style.width = "100%"; } } function d2h_after_print(doc) { if (!doc) doc = document; doc.location.reload(); } function d2h_set_popup_html(doc) { doc.body.innerHTML = document.body.innerHTML; var frame = getFrameById("d2h_popupFrameWnd"); if (frame != null) frame.removeNode(true); var nst = getElemById(doc, "nstext"); if (nst != null) { nst.style.paddingTop = "0px"; nst.style.paddingLeft = "10px"; nst.style.removeAttribute("top", false); nst.style.removeAttribute("width", false); nst.style.removeAttribute("height", false); } var elt, i; //need to reset onclick event to prevent script error //because scripts don't work when body is copied from document to frame var listObj = doc.getElementsByTagName("a"); for (i = 0; i < listObj.lenght; i++) { elt = listObj.item(i); elt.onclick = ""; } } function d2h_hide_unused_elements(doc) { var title = getElemById(doc, "TitleRow"); if (title != null) title.style.display = "none"; var nsb = getElemById(doc, "nsbanner"); if (nsb != null) nsb.style.display = "none"; var listObj = getAllElements(doc); var count = listObj.length; var show = false, inTopic = false, id, elt, i; for (i = 0; i < count; i++) { elt = listObj.item(i); id = elt.id; if (!inTopic && (id.length > 10) && (id.substring(0, 10) == "_D2HTopic_")) inTopic = true; if (elt.className == "_D2HAnchor") show = (elt.name == ANCHOR); if (inTopic && !show) elt.style.display = "none"; } } function expandTreeNode(doc, elem) { if (elem.id == "") return; var imgId = null; if (elem.id.substring(0, 1) == "a") { imgId = elem.id.substring(2); } expandNodes(doc, elem, imgId); } function expandNodes(doc, elem, selID) { if (typeof elem.tagName == "undefined" || elem.tagName.toLowerCase == "body" || elem.id == "c-_root") return; if (elem.parentNode) expandNodes(doc, elem.parentNode, selID); elem.style.display = ""; if (elem.id == "") return; var imgId = null; if (elem.id.substring(0, 1) == "c") { d2hPrepareTocChildNodes(elem); imgId = elem.id.substring(2); } else if (elem.id.substring(0, 1) == "a") imgId = elem.id.substring(2); if (imgId) { if (selID == imgId) return; var imgId1 = "im-" + imgId; var img = getElemById(doc, imgId1); if (!img) { imgId1 = "it-" + imgId; img = getElemById(doc, imgId1); } if (img) d2himage(img, IMAGE_OPEN, USE_SECTION_508, true); } } function getTocAnchorByhRef(doc, linkHref) { var listObj = doc.getElementsByTagName("a"); var strHref; var curLink = null; for (var i = 0; (i < listObj.length) && curLink == null; i++) { if (listObj[i].href) { strHref = listObj[i].href.toLowerCase(); if (strHref == linkHref) curLink = listObj[i]; } } return curLink; } function d2hSyncTocMouseDown(evt) { var elem = getElemById(document, "D2HSyncToc"); if (elem != null) { elem.className = "syncTocSelected"; var img = getElemById(document, elem.id + "Image"); if (img != null) d2himage(img, SYNCTOC_SELECTED); } } function d2hSyncTocMouseUp(evt) { var elem = getElemById(document, "D2HSyncToc"); if (elem != null) { elem.className = "syncToc"; var img = getElemById(document, elem.id + "Image"); if (img != null) d2himage(img, SYNCTOC_UNSELECTED); } } function d2hSyncTocMouseOut(evt) { d2hSyncTocMouseUp(evt); } function d2hSyncTocMouseMove(evt) { d2hSyncTocMouseUp(evt); } function SyncTocBody(linkHref, scrollByHorizontal, selectAndExpand) { var frm = getFrameByName("left"); if (frm) { var doc = getFrameDocument(frm); if (doc != null) { if (doc.forms && doc.forms.length == 0) return; linkHref = linkHref.toLowerCase(); var anchorIndex = linkHref.indexOf("#", 0); if (anchorIndex >= 0) linkHref = linkHref.substr(0, anchorIndex); var curLink = getTocAnchorByhRef(doc, linkHref); if (curLink == null) return; if (selectAndExpand) { expandTreeNode(doc, curLink); showSelection(doc, curLink); } if (USE_SECTION_508 == "yes") curLink.focus(); if (scrollByHorizontal) { var ie = isIE(); if (isOpera() || ie) curLink.scrollIntoView(); else if (typeof(doc.location.hash) != "undefined") doc.location.hash = curLink.id; } else { var scrollArea = getElemById(doc, "scrollArea"); scrollArea.scrollTop = curLink.offsetTop; } } } } function d2hSyncDynamicToc(scrollByHorizontal) { var frm = getFrameByName("right"); if (frm) { var doc = getFrameDocument(frm); if (doc != null) { var loc = doc.location.href; SyncTocBody(loc, scrollByHorizontal, true); } } return false; } function d2hSyncStaticToc(scrollByHorizontal) { var frm = getFrameByName("right"); if (frm) { var doc = getFrameDocument(frm); if (doc != null) { var loc = doc.location.href; SyncTocBody(loc, scrollByHorizontal, false); } } return false; } function getInsideWindowWidth(doc) { var wid = 0; if (doc == null) doc = document; if (typeof doc.body.clientWidth != "undefined") wid = doc.body.clientWidth; else if (typeof doc.body.parentElement != "undefined" && typeof doc.body.parentElement.clientWidth != "undefined") wid = doc.body.parentElement.clientWidth; else { var wnd = getWindow(doc); if (wnd != null && typeof wnd.innerWidth != "undefined") wid = wnd.innerWidth; } return wid; } function getInsideWindowHeight(doc) { var hgt = 0; if (doc == null) doc = document; if (typeof doc.body.clientHeight != "undefined") hgt = doc.body.clientHeight; else if (typeof doc.body.parentElement != "undefined" && typeof doc.body.parentElement.clientHeight != "undefined") hgt = doc.body.parentElement.clientHeight; else { var wnd = getWindow(doc); if (wnd != null && typeof window.innerHeight != "undefined") hgt = wnd.innerHeight; } return hgt; } function isServerSide() { var str = document.location.toString().toLowerCase(); return !(str.length > 7 && str.substring(0, 7) == "file://"); } function getDocHeight(doc) { if (typeof doc.body.offsetHeight != "undefined") return doc.body.offsetHeight; else if (typeof doc.body.scrollHeight != "undefined") return doc.body.scrollHeight; return doc.body.style.height; } function d2hGetRelativePath(doc, path) { if (path.length >= 0 && doc != null) { var relPart = d2hGetAttribute(doc.body, "relPart"); if (relPart == null) relPart = ""; return relPart + path; } else return ""; } function d2hHideInline(elem) { if (elem != null) { elem.style.position = "absolute"; elem.style.visibility = "hidden"; if (typeof elem.style.display != "undefined") elem.style.display = "none"; } } function d2hShowInline(elem) { if (elem != null) { elem.style.position = ""; elem.style.visibility = "visible"; if (typeof elem.style.display != "undefined") elem.style.display = ""; } } function d2hInitInlineDropdown(elemId) { var elem = getElemById(document, elemId); d2hHideInline(elem); } function d2hInitInlineExpand(elemId) { var elem = getElemById(document, elemId); d2hHideInline(elem); } function d2hInitInlinePopup(elemId) { var elem = getElemById(document, elemId); if (elem != null) { d2hHideInline(elem); elem.style.backgroundColor = POPUP_COLOR; elem.style.backgroundImage = "url('" + d2hGetRelativePath(document, POPUP_IMAGE) + "')"; elem.style.backgroundRepeat = POPUP_REPEAT; elem.style.border = "1px solid #cccccc"; } } function d2hInlineExpand(evt, elemId) { var elem = getElemById(document, elemId); if (elem != null) { if (elem.style.visibility == "hidden") d2hShowInline(elem); else d2hHideInline(elem); } return false; } function d2hInlineDropdown(evt, elemId) { var elem = getElemById(document, elemId); if (elem != null) { if (elem.style.visibility == "hidden") d2hShowInline(elem); else d2hHideInline(elem); } return false; } function d2hInlinePopup(evt, elemId) { var elem = getElemById(document, elemId); if (elem != null) { if (elem.style.visibility == "hidden") { if (d2hNeedSendToBody(elem)) d2hSend2Body(elem); if (typeof elem.style.display != "undefined") elem.style.display = ""; elem.style.width = "auto"; elem.style.height = "auto"; var pt = d2hGetInlinePosition(evt); elem.style.visibility = "visible"; setInlinePopup2Pos(elem, pt.x, pt.y); _d2hInlinePopup = elem; } else { d2hHideInline(elem); elem.style.left = 0; elem.style.top = 0; } } return false; } function setInlinePopup2Pos(popupElem, x, y) { var nstext = getElemById(document, "nstext"); if (nstext == null) nstext = document.getElementsByTagName((document.compatMode && document.compatMode == "CSS1Compat") ? "HTML" : "BODY")[0]; d2hStandardizePopupMargin(popupElem); var w_width = nstext.clientWidth ? nstext.clientWidth + nstext.scrollLeft : window.innerWidth + window.pageXOffset; var w_height = nstext.clientHeight ? nstext.clientHeight + nstext.scrollTop : window.innerHeight + window.pageYOffset; popupElem.style.width = "auto"; popupElem.style.height = "auto"; var textWidth = popupElem.offsetWidth; var w = (w_width > 300)? w_width * 0.6: w_width; if (textWidth > w) textWidth = w; popupElem.style.width = textWidth + "px"; var t_width = popupElem.offsetWidth; var t_height = popupElem.offsetHeight; textWidth = Math.sqrt(16*t_width*t_height/9); popupElem.style.width = Math.round(textWidth) + "px"; t_width = popupElem.offsetWidth; t_height = popupElem.offsetHeight; popupElem.style.left = x + 8 + "px"; popupElem.style.top = y + 8 + "px"; var x_body_bottom = (document.body.clientWidth ? document.body.clientWidth : window.innerWidth) + document.body.scrollLeft; var y_body_bottom = (document.body.clientHeight ? document.body.clientHeight : window.innerHeight) + document.body.scrollTop; if (x + t_width > x_body_bottom) popupElem.style.left = x_body_bottom - t_width + "px"; if (y + t_height > y_body_bottom) popupElem.style.top = y_body_bottom - t_height + "px"; } function getInnerText(elem) { if (typeof elem.innerText != "undefined") return elem.innerText; else if (typeof elem.textContent != "undefined") return elem.textContent; else return elem.text; } function setInnerText(elem, text) { if (typeof elem.innerText != "undefined") elem.innerText = text; else if (typeof elem.textContent != "undefined") elem.textContent = text; } function d2hIndex(val) { this._key = getInnerText(val).toLowerCase(); this._elem = val; } function d2hIndexArray() { this._indexes = new Array(); d2hIndexArray.prototype.Add = function(val) { this._indexes[this._indexes.length] = new d2hIndex(val); } d2hIndexArray.prototype.IndexKeyComparer = function(a, b) { if (a._key < b._key) return -1; if (a._key > b._key) return 1; return 0; } d2hIndexArray.prototype.sort = function() { this._indexes.sort(this.IndexKeyComparer); } d2hIndexArray.prototype.length = function() { return this._indexes.length; } d2hIndexArray.prototype.SearchStringComparer = function(a, b, prune) { var stra, strb; if ((prune & 7) != 0) { if (a.length > b.length) { if ((prune & 7) == 1) return 1; stra = a.substring(0, b.length); strb = b; } else { if ((prune & 7) == 2) return -1; stra = a; strb = b.substring(0, a.length); } } else { stra = a; strb = b; } if (stra < strb) return -1; if (stra > strb) return 1; return 0; } d2hIndexArray.prototype.find = function(findKey, prevIndex) { if (findKey == null || findKey.length == 0) return null; findKey = findKey.toLowerCase(); var low, hight; if (prevIndex == null) { low = 0; high = this._indexes.length - 1; } else { var prevKey = this._indexes[prevIndex]._key; var cmp = this.SearchStringComparer(findKey, prevKey, 0); if (cmp < 0) { low = 0; high = prevIndex; } else if (cmp > 0) { low = prevIndex; high = this._indexes.length - 1; } else return prevIndex; } var Ki; var K = findKey; var c; var j = null; for (;(high > low);) { j = Math.floor((high+low)/2); Ki = this._indexes[j]._key; if (K < Ki) high = j - 1; else if (K > Ki) low = j + 1; else return j; } c = this.SearchStringComparer(K, this._indexes[low]._key, 3); if (c < 0) return low - 1; else if (high > -1) { c = this.SearchStringComparer(K, this._indexes[high]._key, 3); if (c == 0) return high; else if (c > 0) return high + 1; } return low; } } function d2hIndexTable() { this._table = new Array(); this._first = null; this._singleLetterIndex = null; this._timerID = null; this._textControl = null; this._onTextChanged = null; this._timeout = null; this._currText = ""; this._prevIndex = null; this._capitalLetter = null; this._prevCapitalIndex = null; d2hIndexTable.prototype.LoadAllIndexCapitalLetter = function() { if (this._capitalLetter != null) return; this._capitalLetter = new d2hIndexArray(); var arr = document.getElementsByName("_d2h_capitalletter"); for (var i = arr.length - 1; i >= 0; i--) this._capitalLetter.Add(arr[i]); this._capitalLetter.sort(); } d2hIndexTable.prototype.GetAllIndexesWithFirstLetter = function(firstLetter) { var indx; if (this._table[firstLetter] != null) indx = this._table[firstLetter]; else { var name = "_d2h_" + firstLetter.toString(); indx = new d2hIndexArray(); var arr = document.getElementsByName(name); for (var i = arr.length - 1; i >= 0; i--) indx.Add(arr[i]); indx.sort(); this._table[firstLetter] = indx; } return indx; } d2hIndexTable.prototype.GetIndex = function(key) { if (key == null || key.length == 0) return null; this.LoadAllIndexCapitalLetter(); var code = key.substring(0, 1); var prevCapital = null; if (this._capitalLetter.length() == 0) return null; if (this._prevCapitalIndex != null) prevCapital = this._capitalLetter._indexes[this._prevCapitalIndex]._key; var indx; if (prevCapital != code) { indx = this._capitalLetter.find(code, this._prevCapitalIndex); if (indx == -1) indx = 0; else if (indx > this._capitalLetter.length() - 1) return null; this._prevCapitalIndex = indx; } else indx = this._prevCapitalIndex; code = this._capitalLetter._indexes[indx]._key; var ch = code.charCodeAt(0); var prevIndex = null; if (this._first == null || ch != this._first) { this._first = ch; this._singleLetterIndex = this.GetAllIndexesWithFirstLetter(ch); } else prevIndex = this._prevIndex; if (this._singleLetterIndex == null || this._singleLetterIndex.length() == 0) return null; indx = this._singleLetterIndex.find(key, prevIndex); if (indx < 0) { if (this._prevCapitalIndex == 0) return this._singleLetterIndex._indexes[0]._elem; else { code = this._capitalLetter._indexes[this._prevCapitalIndex - 1]._key; ch = code.charCodeAt(0); var arr = this.GetAllIndexesWithFirstLetter(ch) return arr._indexes[arr.length() - 1]._elem; } } else if (indx > this._singleLetterIndex.length() - 1) return this._singleLetterIndex._indexes[this._singleLetterIndex.length() - 1]._elem; else { this._prevIndex = indx; return this._singleLetterIndex._indexes[indx]._elem; } } d2hIndexTable.prototype.FindIfTextChanged = function() { if (this._textControl == null) return; var curr = this._textControl.value.toLowerCase(); if (this._currText != curr) { this.SuspendIndexSearchListener(); this._currText = curr var obj = this.GetIndex(curr); if (obj != null) this._onTextChanged(obj); this.ResumeIndexSearchListener(); } } d2hIndexTable.prototype.Find = function(key) { if (this._textControl == null) return null; var curr = key.toLowerCase(); this.SuspendIndexSearchListener(); this._currText = curr var obj = this.GetIndex(curr); this.ResumeIndexSearchListener(); return obj; } d2hIndexTable.prototype.StartIndexSearchListener = function(textControl, timeout, handler) { this._textControl = textControl; this._onTextChanged = handler; this._timeout = timeout; this.SuspendIndexSearchListener(); this.ResumeIndexSearchListener(); } d2hIndexTable.prototype.StopIndexSearchListener = function() { this.SuspendIndexSearchListener(); } d2hIndexTable.prototype.SuspendIndexSearchListener = function() { if (this._timerID != null) { clearInterval(this._timerID); this._timerID = null; } } d2hIndexTable.prototype.ResumeIndexSearchListener = function() { if (this._timerID == null) this._timerID = setInterval("_d2hIndex.FindIfTextChanged()", this._timeout); } } function d2hAdjustFrameHeigth(framesetId) { var layout = getElemById(window.parent.document, framesetId); var nn = isNN(); if (layout != null && ((nn && getNNVersionNumber() >= 6.23) || !nn)) { var h = document.body.scrollHeight; if (nn && (typeof g_BorderMargin != "undefined")) h = h + g_BorderMargin; layout.rows = h.toString() + "px, 100%"; } } function d2hGetIndexTextProvider() { var frm = getFrameByName("textprovider"); if (frm != null) { var doc = getFrameDocument(frm); if (doc != null) return getElemById(doc, "incrsText"); } return null; } function d2hAddIndexSearchHandler() { var ctext = d2hGetIndexTextProvider(); _d2hIndex.StartIndexSearchListener(ctext, 100, d2hOnIndexFind); } function d2hRemoveIndexSearchHandler() { _d2hIndex.StopIndexSearchListener(); } function d2hOnIndexFind(obj) { obj.scrollIntoView(); showSelection(document, obj); } function d2hGo2Index(key) { var frm = getFrameByName("indexlist"); if (frm != null) { var doc = getFrameDocument(frm); if (doc != null) { var wnd = getWindow(doc); var obj = wnd._d2hIndex.Find(key); if (obj != null && obj != "") { d2hOnIndexFind(obj); var f = obj.onclick; var evt = new Object(); evt.target = obj; obj.setAttribute("indx", "1"); var x = obj.offsetLeft; var y = obj.offsetTop; if (typeof obj.scrollLeft != "undefined" && !isOpera()) { var p = getElemById(doc, "scrollArea"); if (p) { x -= p.scrollLeft; y -= p.scrollTop; } } evt.pageX = evt.clientX = x; if (obj.offsetHeight) y += obj.offsetHeight; evt.pageY = evt.clientY = y; f(evt); } } } } function d2hIncrsText_onkeyup(evt) { if (evt.keyCode == 13) { var textElem = getElemById(document, "incrsText"); if (textElem != null) { d2hGo2Index(textElem.value.toString()); textElem.focus(); } } } function d2hSetFocusTo(elemId) { var elem = getElemById(document, elemId); if (elem != null) { if (typeof elem.focus != "undefined") elem.focus(); } } function d2hAdjustFrameAndSetFocus(framesetid, setFocusTo) { d2hAdjustFrameHeigth(framesetid); setTimeout("d2hSetFocusTo(\"" + setFocusTo + "\")", 40); } function d2hIndexLookup_onload() { d2hAdjustFrameAndSetFocus('indexlayout', "incrsText"); } function d2hSearchLookup_onload() { d2hAdjustFrameAndSetFocus('searchlayout', "query"); cUseHighlight = getElemById(document, "useHighlight" ); if (cUseHighlight) d2hUpdateLastHighlightState(cUseHighlight); } function d2hIsTopicTitle(elem) { if (elem.nodeType != 1) return false; var tagName = elem.tagName; tagName = tagName.substring(0, 1).toLowerCase(); if (tagName == "h" || tagName == "p") return true; return false; } function d2hTraverseElements(elem, func, execForCurrentElem, useFuncResultToBreak) { if (execForCurrentElem) if (useFuncResultToBreak) { if (!func(elem)) return; } else func(elem); var c = elem.firstChild; while (c != null) { if (c.nodeType == 1) { var res = func(c); if (useFuncResultToBreak) { if (res) d2hTraverseElements(c, func, true, useFuncResultToBreak); } else d2hTraverseElements(c, func, true, useFuncResultToBreak); } c = c.nextSibling; } } function d2hSetZeroMargin(elem) { elem.style.margin = "0pt"; elem.style.padding = "0pt"; } function d2hGetFirstChildElement(parent) { var c = parent.firstChild; while (c != null && c.nodeType != 1) c = c.nextSibling; if (c != null && c.nodeType == 1) return c; return null; } function d2hStandardizePopupMargin(elem, marginpading2zeroElem, ienav) { elem.style.margin = "0pt"; elem.style.padding = marginpading2zeroElem ? "0pt" : "6pt"; var h = null; var contents; if (typeof marginpading2zeroElem != "undefined" && marginpading2zeroElem != null) { d2hSetZeroMargin(marginpading2zeroElem); marginpading2zeroElem.style.padding = "6pt"; contents = marginpading2zeroElem; if (typeof ienav != "undefined" && ienav != null) { ienav.className = ""; d2hTraverseElements(ienav, d2hSetZeroMargin, true, false); ienav.style.padding = "6pt"; } } else contents = elem; if (contents != null) h = d2hGetFirstChildElement(contents); if (h != null) { var tagName = h.tagName.toLowerCase(); if (tagName == "div") { d2hSetZeroMargin(h); h = d2hGetFirstChildElement(h); } if (h != null && d2hIsTopicTitle(h)) d2hSetZeroMargin(h); } } function d2hGetParentElement(elem) { var parent = null; if (typeof elem != "undefined" && elem != null) { if (typeof elem.parentElement != "undefined") parent = elem.parentElement; else { parent = elem.parentNode; if (parent != null && parent.nodeType != 1) { parent = parent.parentNode; if (parent != null && parent.nodeType != 1) parent = null; } } } return parent; } function d2hGetParentByTagName(elem, tagName) { if (elem.tagName.toLowerCase() == tagName) return elem; else if (elem.tagName.toLowerCase() == "body" || elem.tagName.toLowerCase() == "head" || elem.tagName.toLowerCase() == "html") return null; else return d2hGetParentByTagName(d2hGetParentElement(elem), tagName); } function d2hGetSelectedCell(evt) { evt = (evt) ? evt : ((window.event) ? event : null); if (!evt) return; var elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if (!elem) return; if (elem.tagName.toLowerCase() == "td") return elem; var result = d2hGetParentElement(elem); while (result.tagName.toLowerCase() != "td" && result.tagName.toLowerCase() != "body") result = d2hGetParentElement(result); if (result.tagName.toLowerCase() == "body") return elem; else return result; } function d2hShowTopicTitleInPopup(doc) { var nav = getElemById(doc, "nsbanner"); if (nav == null) return; var title = getElemById(doc, "_d2hTitleNavigator"); if (title == null) { nav.style.display = "none"; return; } var parent = d2hGetParentElement(nav); if (parent == null) return; var objTitle = null; if (typeof title.removeNode != "undefined") objTitle = title.removeNode(true); else objTitle = title.cloneNode(true); parent.replaceChild(objTitle, nav); } function d2hHideBreadcrumbs(doc) { var breadcrumbs = getElemById(doc, "d2h_breadcrumbs"); if (breadcrumbs != null) breadcrumbs.style.display = "none"; } function d2hNeedSendToBody(elem) { var p = d2hGetParentElement(elem); return !(p == null || p == document.body); } function d2hMoveToEnd(elem, newParent) { var obj = null; if (typeof elem.removeNode != "undefined") obj = elem.removeNode(true); else { var parent = d2hGetParentElement(elem); obj = parent.removeChild(elem); } newParent.appendChild(obj); } function d2hSend2Body(elem) { var body = document.body; d2hMoveToEnd(elem, body); } function d2hGetInlinePosition(evt) { var pt; if (evt.pageX) pt = new point(evt.pageX, evt.pageY); else pt = new point(evt.clientX + document.body.scrollLeft, evt.clientY + document.body.scrollTop); return pt; } function d2hGetRoot(strPath) { var i, ch; for (i = strPath.length - 1; i > 0; i--) { ch = strPath.substring(i - 1, i); if (ch == '\\' || ch == '/') return strPath.substring(0, i - 1); } return ""; } function d2hIsAscii(charCode) { return (charCode > 7 && charCode < 127); } function d2hIsAsciiOnly(str) { for (var i = 0; i < str.length; i++) { if (!d2hIsAscii(str.charCodeAt(i))) return false; } return true; } function d2hGetServerType() { if (isServerSide()) { var def = "jsp"; var platform = d2hServerPlatform ? d2hServerPlatform.toLowerCase() : def; if (platform != "asp" && platform != "jsp") platform = def; return platform; } else return "htm"; } function d2hGetMainThemeWnd(wnd) { if (!wnd) return null; var nm = wnd.name.toLowerCase(); if (wnd.g_bMainWnd == true || nm == "" || nm == "right") return wnd; return d2hGetMainThemeWnd(wnd.parent); } function d2hGetMainLayoutWnd(wnd, considerTopWndAsMain) { if (!wnd) return null; if (wnd.g_mainLayout == true) return wnd; if (wnd == wnd.parent) return considerTopWndAsMain ? wnd : null; return d2hGetMainLayoutWnd(wnd.parent); } function d2hGetHRefWithoutHash(href) { var indx = href.indexOf("#"); if (indx > -1) href = href.substring(0, indx); return href; } function IsScriptHref(href) { var l = href.length; if (l >= 8) { var protocol = href.substring(0, 8); if (protocol == "jscript:") return true; if (l >= 9) { protocol = href.substring(0, 9); if (protocol == "vbscript:") return true; if (l >= 11) { protocol = href.substring(0, 11); if (protocol == "javascript:") return true; } } } return false; } function d2hPrepareAnchors4Popup() { var hRefCurWnd = d2hGetHRefWithoutHash(window.location.href).toLowerCase(); var doc = getDoc(window) var listObj = doc.getElementsByTagName("a"); var elem, hr; for (i = 0; i < listObj.length; i++) { elem = listObj.item(i); hr = d2hGetHRefWithoutHash(elem.href).toLowerCase(); if (hr.length != 0 && !elem.onclick && elem.target.length == 0 && !IsScriptHref(hr) && hr != hRefCurWnd) elem.onclick = d2hOnClickAInPopupWnd; } } function d2hOnClickAInPopupWnd(evt) { var mainWnd = d2hGetMainThemeWnd(window); if (!mainWnd) return true; evt = (evt) ? evt : ((typeof window.event != "undefined") ? event : null); if (evt) { var elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if (elem) { if (elem.nodeType == 3) elem = elem.parentNode; if (elem.tagName.toLowerCase() == "a") { if (typeof evt.cancelBubble != "undefined") evt.cancelBubble = true; if (typeof evt.preventDefault != "undefined" && typeof evt.stopPropagation != "undefined") { evt.preventDefault(); evt.stopPropagation(); } var h = elem.href; if (window.parent) window.parent.dhtml_popup(); mainWnd.location.href = h; return false; } } } return true; } function d2hProcessTopicLinksForCSH() { if (window.g_bCSHTopic || (typeof window.g_bCSHTopic == "undefined" && d2hIsCSH())) { var wnd = d2hGetMainThemeWnd(window); var listObj = document.getElementsByTagName("a"); for (i = 0; i < listObj.length; i++) d2hProcessLinkElemForCSH(listObj.item(i), wnd.name); listObj = document.getElementsByTagName("button"); for (i = 0; i < listObj.length; i++) d2hProcessLinkElemForCSH(listObj.item(i), wnd.name); listObj = document.getElementsByTagName("area"); for (i = 0; i < listObj.length; i++) d2hProcessLinkElemForCSH(listObj.item(i), wnd.name); } } function d2hProcessLinkElemForCSH(elem, mainWnd) { var t = d2hGetAttribute(elem, "target"); if (t == "right") elem.setAttribute("target", mainWnd); var elemTarget = d2hGetAttribute(elem, "href"); if (!elemTarget) return; var hr = d2hGetHRefWithoutHash(elemTarget); if (hr.length > 0) { var hash = ""; if (hr.length < elemTarget.length) hash = elemTarget.substring(hr.length, elemTarget.length); if (hr.indexOf("?") == -1) hr += "?csh=1"; else hr += "&csh=1"; hr += hash; elem.setAttribute("href", hr); } } function d2hGetAttribute(elem, name) { if (elem == null) return null; var res = null; if (typeof elem.getAttribute != "undefined") res = elem.getAttribute(name); if (typeof res != "undefined" && res != "") return res; if (typeof elem.outerHTML != "undefined") { var elemBody = elem.outerHTML; elemBody = elemBody.substring(elem.tagName.length + 1, elemBody.length); var indx = elemBody.indexOf(">"); if (indx > -1) { elemBody = elemBody.substring(0, indx); var eBodyLow = elemBody.toLowerCase() name = name.toLowerCase() + "="; indx = eBodyLow.indexOf(name); if (indx > -1) { elemBody = elemBody.substring(indx + name.length + 1, elemBody.length); indx = elemBody.indexOf('"'); if (indx > -1) res = elemBody.substring(0, indx); else res = elemBody; } } } return res; } function d2hProcessTopicNavForCSH() { if (d2hIsCSH()) { d2hHideMainNav(); window.g_bCSHTopic = true; window.self.g_bMainWnd = true; } d2hProcessTabParam(); } function d2hProcessTabParam() { var mainWnd = d2hGetMainLayoutWnd(window, false); if (mainWnd && mainWnd.tabProcessed) return; var tabId = d2hGetSearchVal(document, "tab"); if (!tabId || tabId.length == 0) { if (mainWnd && mainWnd != window) { var doc = getDoc(mainWnd); if (doc) tabId = d2hGetSearchVal(doc, "tab"); } } if (tabId && tabId.length > 0 && (tabId = GetButtonId(tabId)) != null) { d2hCommand(tabId); mainWnd.tabProcessed = true; } } function d2hGetSearchVal(doc, query) { var strSearch = doc.location.search; strSearch = strSearch.substring(1, strSearch.length); return getQueryVal(strSearch, query); } function GetButtonId(tabId) { var buttonID = null; if (tabId == "0") buttonID = 'D2HContents'; else if (tabId == "1") buttonID = 'D2HIndex'; else if (tabId == "2") buttonID = 'D2HSearch'; else if (tabId == "3") buttonID = 'D2HFavorites'; return buttonID; } function d2hHideMainNav() { var nav = getElemById(document, "_d2hNavigatorLinks"); if (nav) { nav.style.visibility = "hidden"; nav.style.display = "none"; } } function d2hIsCSH() { var strSearch = document.location.search; strSearch = strSearch.substring(1, strSearch.length); var cshVal = getQueryVal(strSearch, "csh"); return cshVal == "1"; } function d2hButtonClick(evt) { d2hLinkClick(evt); } function d2hLinkClick(evt) { evt = (evt) ? evt : ((typeof window.event != "undefined") ? event : null); if (evt) { var elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if (elem) { if (elem.nodeType == 3) elem = elem.parentNode; var tag = elem.tagName.toLowerCase(); if (tag != "a" && tag != "button" && tag != "area") elem = elem.parentNode; var target = d2hGetAttribute(elem, "target"); var sWndFeatures = ""; var isMenuItem = elem.getAttribute("mnui") == "1"; var isIndexItem = elem.getAttribute("indx") == "1"; if (typeof d2hInitWindowParams != "undefined") { d2hInitWindowParams(); if (_d2hWindowParamsByWindows[target]) sWndFeatures = _d2hWindowParamsByWindows[target]; else if (elem.tagName.toLowerCase() == "a" && !isMenuItem && !isIndexItem) return true; } var href = d2hGetAttribute(elem, "href"); var wnd = null; var w = isMenuItem ? window.parent : window; if (href && target) { if (isOpera()) { var doc = getDoc(w); wnd = w.open(d2hGetRelativePath(doc, "_d2hblank.htm"), target, sWndFeatures); wnd.location.href = href; } else wnd = w.open(href, target, sWndFeatures); } else if (href) wnd = w.open(href, "_self"); if (wnd && typeof wnd.focus != "undefined") wnd.focus(); return wnd == null; } } return true; } function d2hRegisterEventHandler(obj, altObj, eventName, handler) { var o = altObj; var oldHandler = o[eventName.toLowerCase()]; if (typeof oldHandler == "undefined") { o = obj; oldHandler = o[eventName.toLowerCase()]; } if (typeof oldHandler == "undefined") { if (typeof document.scripts != "undefined") { var objName = typeof obj.open != "undefined" ? "window" : obj.tagName.toLowerCase(); var altName = typeof altObj.open != "undefined" ? "window" : altObj.tagName.toLowerCase(); for (var i = 0; i < document.scripts.length; i++) { var script = document.scripts[i]; if ((script.htmlFor == obj.id || script.htmlFor == objName || script.htmlFor == altObj.id || script.htmlFor == altName) && script.event == eventName) { oldHandler = script.innerHTML; break; } } } } else { var defFunc = ""; if (oldHandler) defFunc = oldHandler.toString(); var beg = defFunc.indexOf('{'); var end = defFunc.lastIndexOf('}'); if (beg > 0 || end > beg) oldHandler = defFunc.substring(beg + 1, end - 1); } if (oldHandler && oldHandler.indexOf(handler) >= 0) return; var newHandler = oldHandler; if (oldHandler == null || newHandler.length == 0) newHandler = handler; else newHandler += "; " + handler; o[eventName.toLowerCase()] = new Function("event", newHandler); } function d2hInitMainThemeHandlers(prev, next) { d2hRegisterEventHandler(window, document.body, "onload", "d2hnsresize(event);d2hSetNavigatorState(" + prev + "," + next + ");d2hProcessTopicLinksForCSH();d2hProcessHighlight();"); d2hRegisterEventHandler(window, document.body, "onmousedown", "d2hpopup(event);"); } function d2hInitSecThemeHandlers() { d2hRegisterEventHandler(window, document.body, "onload", "d2hload();d2hProcessHighlight();"); d2hRegisterEventHandler(window, document.body, "onmousedown", "d2hpopup(event);"); } function d2hGetMenuPanel(doc) { var mnuId = "_d2h_popup_menu" var mnu = _d2hPopupMenu ? _d2hPopupMenu : getElemById(doc, mnuId); if (mnu == null) { mnu = doc.createElement("div"); mnu.id = mnuId; mnu.height = "0px" mnu.width = "0px" mnu.className = "d2hPopupMenu"; mnu.style.zIndex = 1000; mnu.noWrap = true; d2hHidePopupMenu(mnu); doc.body.appendChild(mnu); } else { d2hHidePopupMenu(mnu); mnu.innerHTML = ""; mnu.height = "0px" mnu.width = "0px" } return mnu; } function d2hSetPopupMenuPos(doc, popupElem, x, y) { var nstext = getElemById(doc, "nstext"); var wnd = getWindow(doc); if (nstext == null) nstext = doc.getElementsByTagName((doc.compatMode && doc.compatMode == "CSS1Compat") ? "HTML" : "BODY")[0]; var w_width = nstext.clientWidth ? nstext.clientWidth + nstext.scrollLeft : wnd.innerWidth + wnd.pageXOffset; var w_height = nstext.clientHeight ? nstext.clientHeight + nstext.scrollTop : wnd.innerHeight + wnd.pageYOffset; popupElem.style.width = "auto"; popupElem.style.height = "auto"; var textWidth = popupElem.offsetWidth; if (textWidth < 100) textWidth += 30; popupElem.style.width = textWidth + "px"; var t_width = popupElem.offsetWidth; var t_height = popupElem.offsetHeight; popupElem.style.left = x + "px"; popupElem.style.top = y + "px"; var x_body_bottom = (doc.body.clientWidth ? doc.body.clientWidth : wnd.innerWidth) + doc.body.scrollLeft; var y_body_bottom = (doc.body.clientHeight ? doc.body.clientHeight : wnd.innerHeight) + doc.body.scrollTop; if (x + t_width > x_body_bottom) { x_body_bottom = x_body_bottom - t_width; if (x_body_bottom < 0) x_body_bottom = 0; popupElem.style.left = x_body_bottom + "px"; } if (y + t_height > y_body_bottom) { y_body_bottom = y_body_bottom - t_height; if (y_body_bottom < 0) y_body_bottom = 0; popupElem.style.top = y_body_bottom + "px"; } } function d2hShowPopupMenu(evt, doc, menu, arrLinks) { if (typeof menu.style.display != "undefined") menu.style.display = ""; var pt = d2hGetInlinePosition(evt); menu.style.width = "auto"; menu.style.height = "auto"; d2hSetPopupMenuPos(doc, menu, pt.x, pt.y); var isPopupObj = typeof window.createPopup != "undefined"; var ie = isIE(); if (arrLinks != null) { for (var i = 0; i < arrLinks.length; i++) { if (ie) { arrLinks[i].style.width = "100%"; arrLinks[i].tabIndex = -1; } arrLinks[i].setAttribute("mnui", "1"); if (isPopupObj) arrLinks[i].onclick = "d2hMenuItemClick(event)"; else arrLinks[i].onclick = d2hMenuItemClick; } } if (!isPopupObj) { menu.style.visibility = "visible"; return; } var popDoc = null; if (typeof menu.g_popupLayer == "undefined") { menu.g_popupLayer = window.createPopup(); popDoc = getDoc(menu.g_popupLayer); var relpath = d2hGetAttribute(doc.body, "relPart"); if (!relpath) relpath = ""; popDoc.createStyleSheet(relpath + "Theme/popupmenu.css"); d2hLoadScript(popDoc, "", relpath + "linker.js"); d2hLoadScript(popDoc, "", relpath + "special.js"); d2hLoadScript(popDoc, "", relpath + "common.js"); var wnd = getWindow(popDoc); if (typeof d2hInitWindowParams != "undefined") { d2hInitWindowParams(); wnd.d2hInitWindowParams = new Function(); wnd._d2hWindowParamsByWindows = _d2hWindowParamsByWindows; } } else popDoc = getDoc(menu.g_popupLayer); var popup = menu.g_popupLayer; if (popDoc) { var oPopBody = popDoc.body; oPopBody.innerHTML = ""; oPopBody.innerHTML = menu.outerHTML; var popMenu = getElemById(popDoc, "_d2h_popup_menu"); if (popMenu) { popMenu.style.position = ""; popMenu.style.left = "0"; popMenu.style.top = "0"; popMenu.style.visibility = "visible"; popup.show(evt.clientX, evt.clientY, menu.offsetWidth, menu.offsetHeight, doc.body); return; } } menu.style.visibility = "visible"; } function d2hHidePopupMenu(menu) { if (!menu) return; if (typeof menu.g_popupLayer != "undefined") menu.g_popupLayer.hide(); d2hHideInline(menu); } function d2hClosePopupMenu(evt, force) { if (_d2hPopupMenu != null) { if (!force) { var pt = d2hGetInlinePosition(evt); var l = parseInt(_d2hPopupMenu.style.left); var t = parseInt(_d2hPopupMenu.style.top); var isLeftButton = true; var w3DOM = !(isIE() || (isOpera() && getOperaVersionNumber() < 8.0 /* In Opera, before 8.0: event.button == 1 for left mouse button, in 8.0 and higher: event.button == 0 */)); if (typeof evt.button != "undefined") { if (evt.button != 1 && !w3DOM) isLeftButton = false; else if (evt.button != 0 && w3DOM) isLeftButton = false; } if (isLeftButton && pt.x > l && pt.y > t && pt.x <= l + _d2hPopupMenu.offsetWidth && pt.y <= t + _d2hPopupMenu.offsetHeight) return; } d2hHidePopupMenu(_d2hPopupMenu); _d2hPopupMenu = null; } } function d2hLoadKeywordList() { var strSearch = document.location.search; if (strSearch == null || strSearch.length == 0) return; strSearch = strSearch.substring(1, strSearch.length); if (strSearch == null || strSearch.length == 0) return; var linkID = getQueryVal(strSearch, "id"); if (linkID == null || linkID.length == 0) return; window.g_d2hMenuItemsLoaded = d2hShowKeywordList; d2hLoadMenuItems(linkID, "AKLinks/" + linkID + '.js', true); } function d2hShowKeywordList(items) { var arr = items; if (arr == undefined) return true; var header = getElemById(document, 'd2hKeywordTitle'); if (header == null) return true; var list = getElemById(document, 'd2hKeywordList'); if (list == null) return true; header.innerHTML = MSG_MANY_TOPICS_FOUND.replace('%d', arr.length); for (var i = 0; i < arr.length; i++) { var text = '' + '