		
/**********************************************************************
 BEGIN MODAL DIALOG CODE (can also be loaded as external .js file)
***********************************************************************/
// Global for browser version branching.
var Nav4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));
// One object tracks the current modal dialog opened from this window.
var dialogWin = new Object();

// Generate a modal dialog.
function openDialog(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 (Nav4) {
         // Center on the main window.
         dialogWin.left = window.screenX + ((window.outerWidth - dialogWin.width) / 2)
         dialogWin.top = window.screenY + ((window.outerHeight - dialogWin.height) / 2)
         var attr = "screenX=" + dialogWin.left + ",screenY=" + dialogWin.top + ",scrollbars=yes,resizable=no,width=" + dialogWin.width + ",height=" + dialogWin.height
      } else {
         // The best we can do is center in screen.
         dialogWin.left = (screen.width - dialogWin.width) / 2
         dialogWin.top = (screen.height - dialogWin.height) / 2
         var attr = "left=" + dialogWin.left + ",top=" + dialogWin.top + ",scrollbars=yes,resizable=no,width=" + dialogWin.width + ",height=" + dialogWin.height
      }
      // 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()
   }
}

// Function to run upon closing the dialog with "OK."
function setPrefs() {
   // We're just displaying the returned value in a text box.
   document.returned.searchURL.value = dialogWin.returnedValue
}

      