function closePopup(){ window.close(); } function scrollToNameAnchor(){ var nameAnchor = _AN_Read_href('href', _AN_Read_location('location', window)); var value = nameAnchor.split("nameAnchor="); if (value[1] != null ) { _AN_Write_location("location", document, false , value[0] + "#" + value[1]); } } function showHideImage(thisID, obj){ var imgElement = document.getElementById(thisID); var imgText = obj; if (imgElement.className == "largeImage") { _AN_Write_src("src", imgElement, false , "images/" + thisID + ".png"); imgElement.className = "smallImage"; obj.className = "showImageLink"; _AN_Write_href("href", obj, false , "#"); _AN_Write_nodevalue("nodeValue", obj.firstChild, false , terms_AHV_LARGE_GRAPHIC); window.focus(); } else { _AN_Write_src("src", imgElement, false , "images/" + thisID + "_popup.png"); imgElement.className = "largeImage"; obj.className = "hideImageLink"; _AN_Write_href("href", obj, false , "#"); _AN_Write_nodevalue("nodeValue", obj.firstChild, false , terms_AHV_SMALL_GRAPHIC); window.focus(); } } function KeyCheck(e, tree, idx){ var KeyID = (window.event)? event.keyCode: e.keyCode; var node = YAHOO.widget.TreeView.getNode(tree, idx); switch (KeyID){ case 37: node.collapse(); break ; case 39: node.expand(); break ; } } function toggleLayer(whichLayer){ if (document.getElementById) { var obj = document.getElementById(whichLayer); var img = obj.previousSibling.firstChild.firstChild; _AN_Call_setattribute("setAttribute", img, "src", "images/on.gif"); var styleatt = obj.style; styleatt.display = styleatt.display? "": "block"; if (obj.previousSibling.className === "topictitle3") { obj.previousSibling.className = "topictitle3off"; _AN_Call_setattribute("setAttribute", img, "src", "images/on.gif"); } else if (obj.previousSibling.className === "topictitle3off") { obj.previousSibling.className = "topictitle3"; _AN_Call_setattribute("setAttribute", img, "src", "images/off.gif"); } } else if (document.all) { var style2 = document.all[whichLayer].style; style2.display = style2.display? "": "block"; } } function addBookmark(bm_url_str, bm_str_label){ parent.navigation.flashProxy.call('addBookmark', bm_url_str, bm_str_label); } var upperAsciiXlatTbl = new Array(223, "ss", 230, "ae", 198, "ae", 156, "oe", 140, "oe", 240, "eth", 208, "eth", 141, "y", 159, "y"); var maxNumberOfShownSearchHits = 30; var showInputStringAlerts = 0; var navigationCookie = ""; function cookiesNotEnabled(){ return true ; } function getArgs(){ var args = new Object(); var query = _AN_Read_search("search", _AN_Read_location("location", window)).substring(1); if (_AN_Read_length("length", query) > 0) { var pairs = query.split(","); for (var i = 0; i < _AN_Read_length("length", pairs); i++ ){ var pos = pairs[i].indexOf('='); if (pos == -1) continue ; var argname = pairs[i].substring(0, pos); var value = pairs[i].substring(pos + 1); args[argname] = unescape(value); } } else { args[name] = false ; } return args; } function getCookieVal(offset){ var endstr = _AN_Read_cookie('cookie', document).indexOf(";", offset); if (endstr == -1) endstr = _AN_Read_length("length", _AN_Read_cookie("cookie", document)); return unescape(_AN_Read_cookie("cookie", document).substring(offset, endstr)); } function GetCookie(name){ var arg = name + "="; var alen = _AN_Read_length("length", arg); var clen = _AN_Read_length("length", _AN_Read_cookie("cookie", document)); var i = 0; if (cookiesNotEnabled()) { var args = getArgs(); if (args[name] !== false ) { return args[name]; } } else { while (i < clen){ var j = i + alen; if (_AN_Read_cookie("cookie", document).substring(i, j) == arg) return getCookieVal(j); i = _AN_Read_cookie("cookie", document).indexOf(" ", i) + 1; if (i == 0) break ; } return null ; } } function getTopCookieVal(offset){ var endstr = _AN_Read_cookie("cookie", document).indexOf(";", offset); if (endstr == -1) endstr = _AN_Read_length("length", _AN_Read_cookie("cookie", document)); return unescape(_AN_Read_cookie("cookie", document).substring(offset, endstr)); } function GetTopCookie(name){ var arg = name + "="; var alen = _AN_Read_length("length", arg); var clen = _AN_Read_length("length", _AN_Read_cookie("cookie", document)); var i = 0; while (i < clen){ var j = i + alen; if (_AN_Read_cookie("cookie", document).substring(i, j) == arg) return getTopCookieVal(j); i = _AN_Read_cookie("cookie", document).indexOf(" ", i) + 1; if (i == 0) break ; } return null ; } function SetCookie(n, v, minutes){ var Then = new Date(); Then.setTime(Then.getTime() + minutes * 60 * 1000); _AN_Write_cookie("cookie", document, false , n + "=" + v + ";expires=" + Then.toGMTString()); } function getContentCookie(){ var contentCookie = GetCookie("content"); _AN_Write_cookie("cookie", document, false , "content="); if ((contentCookie != null ) && (contentCookie.indexOf("htm") != -1)) { _AN_Write_cookie("cookie", document, false , "content="); _AN_Write_cookie("cookie", document, false , "histR=" + contentCookie); _AN_Call_replace("replace", _AN_Read_location("location", window), contentCookie); } } function getNavigationCookie(){ navigationCookie = GetCookie("navigation"); _AN_Write_cookie("cookie", document, false , "navigation="); if ((navigationCookie != null ) && (navigationCookie.indexOf("htm") != -1)) { _AN_Write_cookie("cookie", document, false , "navigation="); _AN_Write_cookie("cookie", document, false , "histL=" + navigationCookie); _AN_Call_replace("replace", _AN_Read_location("location", window), navigationCookie); } } function handleContext(which){ } function lastNodeOf(e){ var expr = "" + e; var to = expr.indexOf("?"); if (to !== -1) { var path = expr.substring(0, to); var pieces = path.split("/"); return pieces[_AN_Read_length("length", pieces) - 1]; } else { var pos = expr.lastIndexOf("/"); if ((pos != -1) && (pos + 1 != _AN_Read_length("length", expr))) { return expr.substr(pos + 1); } else { return expr; } } } function frameBuster(){ } function bubbleSortWithShadow(a, b){ var temp; for (var j = 1; j < _AN_Read_length("length", a); j++ ){ for (var i = 0; i < j; i++ ){ if (a[i] < a[j]) { temp = a[j]; a[j] = a[i]; a[i] = temp; temp = b[j]; b[j] = b[i]; b[i] = temp; } } } } function buildHtmlResultsStr(){ var innerHTMLstring, ndxEnd; ndxEnd = (_AN_Read_length("length", matchesArrIndices) > maxNumberOfShownSearchHits)? maxNumberOfShownSearchHits: _AN_Read_length("length", matchesArrIndices); for (var ndx = 0, resultsArr = new Array(); ndx < ndxEnd; ndx++ ){ resultsArr[_AN_Read_length("length", resultsArr)] = buildResultsStrOneLine(matchesArrIndices[ndx], matchesArrHits[ndx]); } innerHTMLstring = "
    "; for (var ndx = 0; ndx < _AN_Read_length("length", resultsArr); ndx++ ){ innerHTMLstring = innerHTMLstring + resultsArr[ndx]; } innerHTMLstring = innerHTMLstring + "
"; return innerHTMLstring; } function buildResultsStrOneLine(a, b){ var retStr; retStr = "
  • "; retStr += titleArr[a] + "
  • "; return retStr; } function checkForHits(){ var inputWords = new Array(); var tempArr = new Array(); tempArr = searchTerm.split(" "); for (var ndx = 0; ndx < _AN_Read_length("length", tempArr); ndx++ ){ if (tempArr[ndx].length) { inputWords[_AN_Read_length("length", inputWords)] = tempArr[ndx]; } } matchesArrHits = new Array(); matchesArrIndices = new Array(); maskArr = new Array(); hitsArr = new Array(); for (var ndx = 0; ndx < _AN_Read_length("length", fileArr); ndx++ ){ maskArr[_AN_Read_length("length", maskArr)] = 1; hitsArr[_AN_Read_length("length", hitsArr)] = 0; } for (var ndx = 0; ndx < _AN_Read_length("length", inputWords); ndx++ ){ if (!checkForHitsWordAgainstPages(inputWords[ndx])) { return ; } for (var ndx2 = 0; ndx2 < _AN_Read_length("length", hitsArr); ndx2++ ){ if (hitsArr[ndx2] == 0) { maskArr[ndx2] = 0; } else { if (maskArr[ndx2] != 0) { maskArr[ndx2] += hitsArr[ndx2]; } } } } for (var ndx = 0; ndx < _AN_Read_length("length", maskArr); ndx++ ){ if (maskArr[ndx]) { matchesArrHits[_AN_Read_length("length", matchesArrHits)] = maskArr[ndx]; matchesArrIndices[_AN_Read_length("length", matchesArrIndices)] = ndx; } } if (matchesArrIndices.length) { bubbleSortWithShadow(matchesArrHits, matchesArrIndices); } } function checkForHitsWordAgainstPages(w){ var hitAnywhere = 0; if (showInputStringAlerts) { alert("Length of sc2: " + _AN_Read_length("length", sc2)); } for (var ndx = 0; ndx < _AN_Read_length("length", sc2); ndx++ ){ glob_title = sc1[ndx]; glob_phrase = sc2[ndx]; if (maskArr[ndx]) { if (document.isDblByte) { hitsArr[ndx] = checkForHitsWordAgainstTitleAndLine2(w, ndx); } else { hitsArr[ndx] = checkForHitsWordAgainstTitleAndLine(w, ndx); } if (hitsArr[ndx]) { hitAnywhere = 1; } } } return hitAnywhere; } function checkForHitsWordAgainstTitleAndLine(w, lineNdx){ var words; var titleHitCnt = 0; var contentHitCnt = 0; var regex = new RegExp(w, "i"); words = new Array(); if (glob_title != null ) { words = glob_title.split(" "); } for (var ndx = 0; ndx < _AN_Read_length("length", words); ndx++ ){ if (w == words[ndx]) { titleHitCnt += 100; break ; } } words = new Array(); if (glob_phrase != null ) { words = glob_phrase.split(" "); } if (regex.test(glob_phrase)) { for (var ndx = 0; ndx < _AN_Read_length("length", words); ndx++ ){ if (w == words[ndx]) { contentHitCnt += getInstanceCount(lineNdx, ndx); break ; } } } return titleHitCnt + contentHitCnt; } function checkForHitsWordAgainstTitleAndLine2(w, lineNdx){ var titleHitCnt = 0; var contentHitCnt = 0; if (glob_title.indexOf(w) != -1) { titleHitCnt = 100; } contentHitCnt = indexesOf(glob_phrase, w); return titleHitCnt + contentHitCnt; } function checkTheInputString(){ var myArr = new Array(); var tempArr = new Array(); var foundStopOrShortWord = 0; var ptn1 = /\d\D/; var ptn2 = /\D\d/; handleWhitespaceRemoval(); searchTerm = _AN_Call_replace("replace", searchTerm, /(%20)+/g, " "); searchTerm = searchTerm.toLowerCase(); searchTerm = filterTheChars(searchTerm); handleWhitespaceRemoval(); if (searchTerm.length) { tempArr = searchTerm.split(" ", 100); if (showInputStringAlerts) { alert("size of tempArr: " + _AN_Read_length("length", tempArr)); } for (var ndx = 0; ndx < _AN_Read_length("length", tempArr); ndx++ ){ if (tempArr[ndx].charCodeAt(0) == 46) { } if (tempArr[ndx].charCodeAt(_AN_Read_length("length", tempArr[ndx]) - 1) == 46) { tempArr[ndx] = tempArr[ndx].substr(0, _AN_Read_length("length", tempArr[ndx]) - 1); } } for (var ndx = 0; ndx < _AN_Read_length("length", tempArr); ndx++ ){ var word = tempArr[ndx]; if (showInputStringAlerts) { alert("Checking word: " + word); } if (!sw[word]) { if (_AN_Read_length("length", word) < 2) { foundStopOrShortWord = 1; } else if ((_AN_Read_length("length", word) > 2) || (ptn1.test(word) || ptn2.test(word))) { myArr[_AN_Read_length("length", myArr)] = tempArr[ndx]; } else { foundStopOrShortWord = 1; } } else { foundStopOrShortWord = 1; } } searchTerm = ""; for (var ndx = 0; ndx < _AN_Read_length("length", myArr); ndx++ ){ searchTerm = searchTerm + myArr[ndx] + " "; } handleWhitespaceRemoval(); if (showInputStringAlerts) { alert("FINAL SEARCH TERM: *" + searchTerm + "*"); } if (foundStopOrShortWord && !_AN_Read_length("length", searchTerm)) { return MSG_stopAndShortWords; } srch_input_massaged = searchTerm; return ""; } else { return MSG_noSearchTermEntered; } } function checkTheInputString2(){ var tempArr = new Array(); handleWhitespaceRemoval(); searchTerm = searchTerm.toLowerCase(); if (searchTerm.length) { tempArr = searchTerm.split(" ", 100); if (showInputStringAlerts) { alert("number of search terms: " + _AN_Read_length("length", tempArr)); } searchTerm = ""; for (var ndx = 0; ndx < _AN_Read_length("length", tempArr); ndx++ ){ searchTerm = searchTerm + tempArr[ndx] + " "; } handleWhitespaceRemoval(); if (showInputStringAlerts) { alert("Massaged search term: " + searchTerm); } srch_input_massaged = searchTerm; return ""; } else { return MSG_noSearchTermEntered; } } function doIEsearch(){ var stStr = ""; document.forms[0].sh_term.value = srch_input_verbatim; if (srch_message.length) { _AN_Write_innerhtml("innerHTML", document.getElementById("results"), false , srch_message); srch_message = ""; } else if (srch_1_shot) { srch_1_shot = 0; searchTerm = srch_input_massaged; checkForHits(); if (matchesArrIndices.length) { stStr = "
    " + MSG_pagesContaining + "" + srch_input_massaged + "


    \n"; _AN_Write_innerhtml("innerHTML", document.getElementById("results"), false , stStr + buildHtmlResultsStr()); } else { _AN_Write_innerhtml("innerHTML", document.getElementById("results"), false , MSG_noPagesContain + "" + srch_input_massaged + "

    "); } } srch_input_verbatim = ""; } function getInstanceCount(lineIndex, wordIndex){ var instancesStr = instances[lineIndex]; var ch = instancesStr.substr(wordIndex, 1); return parseInt(ch); } function handleWhitespaceRemoval(){ var re_1 = /^\s/; var re_2 = /\s$/; var re_3 = /\s\s/; var temp; while (true ){ temp = _AN_Call_replace("replace", searchTerm, re_1, ""); if (temp == searchTerm) { break ; } searchTerm = temp; } while (true ){ temp = _AN_Call_replace("replace", searchTerm, re_2, ""); if (temp == searchTerm) { break ; } searchTerm = temp; } while (searchTerm.search(re_3) != -1){ temp = _AN_Call_replace("replace", searchTerm, re_3, " "); searchTerm = temp; } } function isAcceptableChar(chrNdx){ var acceptableChars = new Array(32, 46, 95); for (var ndx = 0; ndx < _AN_Read_length("length", acceptableChars); ndx++ ){ if (chrNdx == acceptableChars[ndx]) { return true ; } } return false ; } function indexesOf(str, ptn){ var position = 0; var hits = -1; var start = -1; while (position != -1){ position = str.indexOf(ptn, start + 1); hits += 1; start = position; } return hits; } function filterTheChars(line){ var retStr = "", tempStr; var ch, chCode, retChr; var ndx; for (ndx = 0; ndx < _AN_Read_length("length", line); ndx++ ){ ch = line.substr(ndx, 1); chCode = ch.charCodeAt(0); if ((chCode >= 192) && (chCode <= 221)) { chCode = chCode + 32; retChr = ASCII_to_char(chCode); } else if (withinAcceptableRanges(chCode) || isAcceptableChar(chCode)) { retChr = ch; } else { tempStr = isLigatureChar(chCode); if (tempStr.length) { retChr = ch; } else { retChr = " "; } } retStr += retChr; } return retStr; } function isLigatureChar(codeToCheck){ var xlatTblNdx, code, replStr = ""; for (xlatTblNdx = 0; xlatTblNdx < _AN_Read_length("length", upperAsciiXlatTbl); xlatTblNdx += 2){ code = upperAsciiXlatTbl[xlatTblNdx]; if (code == codeToCheck) { replStr = upperAsciiXlatTbl[xlatTblNdx + 1]; break ; } } return replStr; } function respondToSearchButton(){ var myStr; _AN_Write_innerhtml("innerHTML", document.getElementById("results"), false , ""); srch_input_verbatim = document.forms[0].sh_term.value; searchTerm = document.forms[0].sh_term.value; if (document.isDblByte) { myStr = checkTheInputString2(); } else { myStr = checkTheInputString(); } srch_message = myStr; srch_1_shot = _AN_Read_length("length", srch_message)? 0: 1; doIEsearch(); } function respondToSearchLoad(){ var externalQuery = GetCookie("externalQuery"); if (externalQuery == null ) { externalQuery = GetCookie("sh_term"); } if (externalQuery != null ) { var myStr; srch_input_verbatim = externalQuery; searchTerm = externalQuery; if (document.isDblByte) { myStr = checkTheInputString2(); } else { myStr = checkTheInputString(); } srch_message = myStr; srch_1_shot = _AN_Read_length("length", srch_message)? 0: 1; doIEsearch(); } } function strReplace(orig, src, dest){ var startPos = 0; var matchPos = orig.indexOf(src, startPos); var retLine = ""; while (matchPos != -1){ retLine = retLine + orig.substring(startPos, matchPos) + dest; startPos = matchPos + 1; matchPos = orig.indexOf(src, startPos); } if (!_AN_Read_length("length", retLine)) { return orig; } else { return retLine + orig.substring(startPos, _AN_Read_length("length", orig)); } } function withinAcceptableRanges(chrNdx){ var acceptableRanges = new Array("48-57", "65-90", "97-122", "224-229", "231-239", "241-246", "248-253", "255-255"); for (var ndx = 0; ndx < _AN_Read_length("length", acceptableRanges); ndx++ ){ var start_finish = new Array(); start_finish = acceptableRanges[ndx].split("-"); if ((chrNdx >= start_finish[0]) && (chrNdx <= start_finish[1])) { return true ; } } return false ; } function ASCII_to_char(num_in){ var str_out = ""; var num_out = parseInt(num_in); num_out = unescape('%' + num_out.toString(16)); str_out += num_out; return unescape(str_out); } var agt = navigator.userAgent.toLowerCase(); var use_ie_behavior = false ; var use_ie_6_behavior = false ; if (agt.indexOf("msie") != -1) { use_ie_behavior = true ; } if ((agt.indexOf("msie 5") != -1) || (agt.indexOf("msie 6") != -1)) { use_ie_6_behavior = true ; } var Url = { encode: function (string){ return escape(this._utf8_encode(string)); } , decode: function (string){ return this._utf8_decode(unescape(string)); } , _utf8_encode: function (string){ string = _AN_Call_replace("replace", string, /\r\n/g, "\n"); var utftext = ""; for (var n = 0; n < _AN_Read_length("length", string); n++ ){ var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if ((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; } , _utf8_decode: function (utftext){ var string = ""; var i = 0; var c = c1 = c2 = 0; while (i < _AN_Read_length("length", utftext)){ c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++ ; } else if ((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i + 1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i + 1); c3 = utftext.charCodeAt(i + 2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } } ;