/* $Header: /NAA/NAAWeb/Utils.htm 2 20/03/03 7:32a Michaelh $ */ function BrowserType() { var a; a = "" + navigator.appName + "^" + navigator.appVersion; if (a.indexOf("MSIE") != -1) return("I"); else if (a.indexOf("Netscape") != -1) return("N"); else { window.alert("Browser version not supported"); return("X"); } } function CheckEmptyFields(strInput) { var nInput = parseInt(strInput); if (isNaN(nInput)) nInput = 0; return(nInput); } function Disable(obj) { // Disable a text box obj.disabled = true; if (BrowserType() == "I") obj.style.backgroundColor = window.document.bgColor; } function Enable(obj) { // Enable a text box obj.disabled = false; if (BrowserType() == "I") obj.style.backgroundColor = "WHITE"; } function ReplaceSpaces(strInput) { // Replace spaces with + strInput = "" + strInput; strInput = strInput.replace(/ /g, "+"); return(strInput); } function OpenTop(strDest) { // Open a new document, replacing the whole contents of the current browser top.location.href = ReplaceSpaces(strDest); } function OpenWindow(strDest) { // Open a new document, replacing the whole contents of the current // window. Note that if the window is a frame then the current frame // will have its contents replaced. window.location.href = ReplaceSpaces(strDest); } function OpenFrame(objFrame, strDest) { // Open a new document, replacing the whole contents of the nominated frame. // For example, OpenFrame(parent.f1, "x.htm") will replace the contents of the // f1 frame with the contents of X.htm. Note that there are no quotes around // the first argument, and it must always be preceded by parent. objFrame.location.href = ReplaceSpaces(strDest); } function NewBrowser(strDest, strName) { // Open a window in a new browser session. strName is a name for the window. // The new window is NOT modal. window.open(ReplaceSpaces(strDest), strName); }