var agt=navigator.userAgent.toLowerCase(); // *** BROWSER VERSION *** // Note: On IE5, these return 4, so use is_ie5up to detect IE5. var is_major = parseInt(navigator.appVersion); var is_minor = parseFloat(navigator.appVersion); // Note: Opera and WebTV spoof Navigator. We do strict client detection. // If you want to allow spoofing, take out the tests for opera and webtv. var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1)); var is_nav2 = (is_nav && (is_major == 2)); var is_nav3 = (is_nav && (is_major == 3)); var is_nav4 = (is_nav && (is_major == 4)); var is_nav5 = (is_nav && (is_major == 5)); var is_nav5up = (is_nav && (is_major >= 5)); var is_webtv = (agt.indexOf('webtv') !=- 1); var is_ie = (agt.indexOf("msie") != -1); var is_ie3 = (is_ie && (is_major < 4)); var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 4.0") !=-1) ); var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) ); var is_ie501 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.01") !=-1) ); var is_ie55 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1) ); var is_ie6 = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.0") !=-1) ); var is_ie7 = (is_ie && (is_major == 4) && (agt.indexOf("msie 7.0") !=-1) ); var is_ie4up = (is_ie && !is_ie3); var is_ie5up = (is_ie && !is_ie3 && !is_ie4 ); var is_ie6up = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie501&& !is_ie55); var is_ie3456 = ( is_ie3 || is_ie4 || is_ie5 || is_ie501 || is_ie55 || is_ie6); var is_ieMac = (is_ie && (is_major == 4) && (agt.indexOf("mac") !=-1) ); var is_opera = (agt.indexOf("opera") != -1); var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1); var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1); var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1); var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1); var is_opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1); var is_opera7 = (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1); var is_opera7up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6); var is_opera8 = (agt.indexOf("opera 8") != -1 || agt.indexOf("opera/8") != -1); var is_opera8up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6 && !is_opera7); var is_opera9 = (agt.indexOf("opera 9") != -1 || agt.indexOf("opera/9") != -1); var is_konqueror = (agt.indexOf("konqueror") != -1); var is_konqueror1 = (agt.indexOf("konqueror/1") != -1); var is_konqueror2 = (agt.indexOf("konqueror/2") != -1); var is_konqueror3 = (agt.indexOf("konqueror/3") != -1); var is_konqueror3up = (is_konqueror && !is_konqueror1 && !is_konqueror2 ); // may not need this var is_safari = (agt.indexOf("mozilla") != -1 && agt.indexOf("safari") != -1); if (is_safari == true) { is_nav5up = false ; } var is_Mac = (agt.indexOf("mac")!=-1) ; var is_Windows = (agt.indexOf("windows")!=-1) ; var is_linux = (agt.indexOf("inux")!=-1); var is_unix = ((agt.indexOf("x11")!=-1) || is_linux); var pathView = document.URL; pos = pathView.indexOf("nsf"); var GNServerPath = pathView.substring(0, pos+3); // showArrow = new Image() ; // showArrow.src = "img_LA_CaretR.gif"; var iHeight = "420" ; var iWidth = "760" ; function openHelpPopup(helpURL){ var helpurl = helpURL ; winpops=window.open(helpurl,"HelpPopup","width=475,height=480,scrollbars=yes,resizable=yes") ; } function loadHelpPopup(helpURL){ var loadURL = GNServerPath + "/vSysHelpByTopic/" + helpURL + "?OpenDocument" ; openHelpPopup(loadURL) ; } function loadSearchHelpPopup(helpURL){ var loadURL = GNServerPath + "/vSysHelpBySearchTopic/" + helpURL + "?OpenDocument" ; openHelpPopup(loadURL) ; } function popupImage(imgURL, width, height){ var helpurl = GNServerPath + imgURL ; fWidth = width ; fHeight = height ; winpops=window.open(helpurl,"PopupImage","width=" + fWidth + ",height=" + fHeight + ",scrollbars=no,resizable=no") ; } function GNSetBkgndColor() { document.bgColor = jsFormBodyColor ; } function GNLoadPage(loadURL){ var pageURL = loadURL ; pageURL = replaceSubstring(pageURL, "XXX", "") ; if (jsUserType.indexOf( "Admin" ) != 0 ) { pageURL = replaceSubstring(pageURL, "Read", "Edit") ; } else { pageURL = replaceSubstring(pageURL, "Edit", "Read") ; } window.location = pageURL ; } function GNViewArticle(DocKey) { jsDocKey = DocKey ; fullOpenCommand = "vGNCNTDisplayByDocKey/" + jsDocKey + "?OpenDocument" ; composeString = replaceSubstring(fullOpenCommand, " ", "+") ; iWidth = "500" ; iHeight = "520" ; openGNDialog(composeString, iWidth, iHeight, GNNoAction, ",scrollbars=yes") ; } function GNViewDefault(DocKey) { jsDocKey = DocKey ; fullOpenCommand = "fCNTDspDefault?OpenForm&Cat1=LA80&Cat2=" + jsDocKey ; viewString = replaceSubstring(fullOpenCommand, " ", "+") ; window.location = GNServerPath + "/" + viewString ; } function GNSitePageLink(loadURL){ var pageURL = loadURL ; window.location = GNServerPath + replaceSubstring(pageURL, "GNPublic", "Public1") ; ; } function newLineFlip(expNum, program, mode, dockey) { jsProgram = program ; jsMode = mode ; jsDocKey = dockey ; if (viewFirstLine == "" ) { viewFirstLine = expNum} viewLastLine = expNum ; x = 1-x; xcount +=1; newOutline(x, jsProgram, jsMode, jsDocKey); } function newOutline(x, program, mode, dockey) { jsProgram = program ; jsMode = mode ; jsDocKey = dockey ; LayoutSuffix = "" ; ViewButtonHTML = '' ; EditButtonHTML = '' ; if ( jsMode == "Edit" ) { ButtonHTML = EditButtonHTML ; } else { ButtonHTML = ViewButtonHTML ; } hrefString = '' + ButtonHTML + '' document.write("") ; if (x == 1) { fullHTML = "" ; } else { fullHTML = "" ; } document.write( fullHTML ) ; } function showNextPage() { if (ViewComplete == "N" ) { return ; } catPos = pathView.indexOf("&Cat1="); startPos = pathView.indexOf("&Start="); pathLength = pathView.length ; newLastLine = parseInt(lastLine) + 1 ; if (startPos > -1) { firstString = pathView.substring(0, startPos) + "&Start=" + newLastLine; lastString = pathView.substring(catPos, pathLength) ; } else { firstString = pathView.substring(0, catPos) + "&Start=" + newLastLine; lastString = pathView.substring(catPos, pathLength) ; } newString = firstString + lastString ; window.location.replace(newString) ; } function showPreviousPage() { if (ViewComplete == "N" ) { return ; } catPos = pathView.indexOf("&Cat1="); startPos = pathView.indexOf("&Start="); pathLength = pathView.length ; prevPageFirstLine = firstLine - MaxLines ; if (prevPageFirstLine <= 1) { prevPageFirstLine = 1} if (startPos > -1) { firstString = pathView.substring(0, startPos) + "&Start=" + prevPageFirstLine; lastString = pathView.substring(catPos, pathLength) ; } else { firstString = pathView.substring(0, catPos) + "&Start=" + prevPageFirstLine; lastString = pathView.substring(catPos, pathLength) ; } newString = firstString + lastString ; window.location.replace(newString) ; } function checkSetup(jsUserMode) { // tempFormName = document.forms[0].name // showCaret = new Image() ; // showCaret.src = jsLACaret + ""; setDefaultSelection() ; setPopUpLocation() ; if ( jsUserMode == "Admin" ) { setAdminBoxLocation() ; } return ; } function setDefaultSelection() { // if ( jsLACaret == "None" ) { return ; } if (jsLAID == "LA90") return ; if (jsLAID == "LA89") return ; if (jsLAID == "LA81") return ; if (jsLAID == "LA80") return ; // set the background of the current section choice // We need to build in some hard-wiring to deal with the special links. // LA2 = Service Offerings //LA10 = Dispute, Investigations.. //LA11 = Business, Financial & ... LASpecialRow = "N"; if ( jsLAID == "LA2" || jsLAID == "LA7" || jsLAID == "LA10" || jsLAID == "LA11" || jsLAID == "LA12" ) { LASpecialRow = "Y"; } GNSelectedRowName = "GNRow" + jsLAID ; if (is_ie5up || is_nav5up || is_opera7up || is_safari || is_konqueror3up ) { RowObj = document.getElementById(GNSelectedRowName) ; } if (is_ie4) { RowObj = document.all[GNSelectedRowName] ; } if ( is_nav3 || is_nav4) { } else { if ( LASpecialRow == "Y" ) { RowObj.className = "LASpecialSelectedRow"; } else { RowObj.className = "LASelectedRow"; } } } function replaceSubstring(charString, search, replace) { var tempCharString = charString + ''; var searchChars = search + ''; var replaceChars = replace + ''; p = 0; while (p < tempCharString.length && (p = tempCharString.indexOf(searchChars, p)) >= 0) { tempCharString = tempCharString.substring(0, p) + replaceChars + tempCharString.substring(p + searchChars.length, tempCharString.length); p += replaceChars.length; } return tempCharString; } //------------------------- START Modal Dialog Code --------------------------- // Close the dialog. function closeme() { window.close() ; } // Handle click of the Cancel button. function handleCancel() { closeme() ; return false ; } // Handle click of OK button. function handleOK() { if (opener && !opener.closed) { opener.dialogWin.returnFunc() ; } else { alert("You have closed the main window.\n\nNo action will be taken on the choices in this dialog box.") } closeme() ; return false ; } function redisplayContent() { document.location.reload(true) ; } function GNNoAction() { return ; } function GNReloadSite() { jsAdminFormPath = "fCNTDspHMEdit?OpenForm&Cat1=LA0" ; fullOpenCommand = GNServerPath + "/" + jsAdminFormPath ; window.location.replace(fullOpenCommand); } // One object tracks the current modal dialog opened from this window. var dialogWin = new Object() ; // Generate a modal dialog. // Parameters: // url -- URL of the page/frameset to be loaded into dialog // width -- pixel width of the dialog window // height -- pixel height of the dialog window // returnFunc -- reference to the function (on this page) // that is to act on the data returned from the dialog // args -- [optional] any data you need to pass to the dialog function openGNDialog(url, width, height, returnFunc, args) { if (!dialogWin.win || (dialogWin.win && dialogWin.win.closed)) { // Initialize properties of the modal dialog object. dialogWin.returnFunc = returnFunc; dialogWin.returnedValue = ""; //dialogWin.args = args dialogWin.url = url; dialogWin.width = width; dialogWin.height = height; // Keep name unique so Navigator doesn't overwrite an existing dialog. dialogWin.name = (new Date()).getSeconds().toString(); // Assemble window attributes and try to center the dialog. if (is_nav4) { // Center on the main window. dialogWin.left = window.screenX + ((window.outerWidth - dialogWin.width) / 2); dialogWin.top = window.screenY + ((window.outerHeight - dialogWin.height) / 2) - 10; var attr = "screenX=" + dialogWin.left + ",screenY=" + dialogWin.top + ",resizable=no,width=" + dialogWin.width + ",height=" + dialogWin.height + args ; } else { // The best we can do is center in screen. dialogWin.left = (screen.width - dialogWin.width) / 2; dialogWin.top = (screen.height - dialogWin.height) / 2 - 15 ; var attr = "left=" + dialogWin.left + ",top=" + dialogWin.top + ",resizable=no,width=" + dialogWin.width + ",height=" + dialogWin.height + args ; } // Generate the dialog and make sure it has focus. dialogWin.win=window.open(dialogWin.url, dialogWin.name, attr); dialogWin.win.focus(); } else { dialogWin.win.focus(); } } // Event handler to inhibit Navigator form element // and IE link activity when dialog window is active. function deadend() { if (dialogWin.win && !dialogWin.win.closed) { dialogWin.win.focus() return false } } // Since links in IE4 cannot be disabled, preserve // IE link onclick event handlers while they're "disabled." // Restore when re-enabling the main window. var IELinkClicks // Disable form elements and links in all frames for IE. function disableForms() { IELinkClicks = new Array() for (var h = 0; h < frames.length; h++) { for (var i = 0; i < frames[h].document.forms.length; i++) { for (var j = 0; j < frames[h].document.forms[i].elements.length; j++) { frames[h].document.forms[i].elements[j].disabled = true } } IELinkClicks[h] = new Array() for (i = 0; i < frames[h].document.links.length; i++) { IELinkClicks[h][i] = frames[h].document.links[i].onclick frames[h].document.links[i].onclick = deadend } frames[h].window.onfocus = checkModal frames[h].document.onclick = checkModal } } // Restore IE form elements and links to normal behavior. function enableForms() { for (var h = 0; h < frames.length; h++) { for (var i = 0; i < frames[h].document.forms.length; i++) { for (var j = 0; j < frames[h].document.forms[i].elements.length; j++) { frames[h].document.forms[i].elements[j].disabled = false ; } } for (i = 0; i < frames[h].document.links.length; i++) { frames[h].document.links[i].onclick = IELinkClicks[h][i] } } } // Grab all Navigator events that might get through to form // elements while dialog is open. For IE, disable form elements. function blockEvents() { if (is_nav4) { window.captureEvents(Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.FOCUS) window.onclick = deadend } else { disableForms() } window.onfocus = checkModal } // As dialog closes, restore the main window's original // event mechanisms. function unblockEvents() { if (is_nav4) { window.releaseEvents(Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.FOCUS) window.onclick = null window.onfocus = null } else { enableForms() } } // Invoked by onFocus event handler of EVERY frame, // return focus to dialog window if it's open. function checkModal() { setTimeout("finishChecking()", 50) return true } function finishChecking() { if (dialogWin.win && !dialogWin.win.closed) { dialogWin.win.focus() } } //-------------------------END Modal Dialog Code --------------------------- //This indicates that the General library has loaded GeneralLibLoaded = "Yes";