var SearchWindow = null; function OpenSearchWindow() { if (SearchWindow && SearchWindow.open && !SearchWindow.closed) { // alert ("Window open"); SearchWindow.focus(); SearchWindow.location.href = "/TFB/tfbsearch.nsf/SearchView/$first?OpenDocument&KW="+URL_encode(document.forms[0].SSKeywords.value); } else { SearchWindow = window.open("/TFB/tfbsearch.nsf/SearchView/$first?OpenDocument&KW="+URL_encode(document.forms[0].SSKeywords.value), "SearchWindow", "toolbar=no, location=no,directories=no,status=yes,menubar=no,scrollbars=yes,width=400,height=400,resizable=1"); } } var NS = (window.Event) ? 1 : 0; function checkKey(e) { var code = (NS) ? e.which : event.keyCode; // alert(code); if (code == 13) { OpenSearchWindow(); return false; } } if (NS) document.captureEvents(Event.KEYPRESS) document.onkeypress = checkKey; var hexVals = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"); var unsafeString = "\"<>%\\^[]`"; // deleted these chars from the include list ";", "/", "?", ":", "@", "=", "&" and # // so that we could analyze actual URLs function isUnsafe(compareChar) // this function checks to see if a char is URL unsafe. // Returns bool result. True = unsafe, False = safe { if (unsafeString.indexOf(compareChar) == -1 && compareChar.charCodeAt(0) > 32 && compareChar.charCodeAt(0) < 123) { return false; } // found no unsafe chars, return false else { return true; } } function reversal(s) // part of the hex-ifying functionality { var len = s.length; var trans = ""; for (i=0; i= radix) { temp = num % radix; num = Math.floor(num / radix); hexString += hexVals[temp]; } hexString += hexVals[num]; return reversal(hexString); } function convert(val) // this converts a given char to url hex form { return "%" + decToHex(val.charCodeAt(0), 16); } function URL_encode(val) { var len = val.length; var i = 0; var newStr = ""; for (i=0;i