<!--
  //
  // popup.js
  //
  // Routines for handling mini-windows (popups)
  // Customised for QROTI
  // by Proceed Media Pty Ltd Copyright 2001-2003
  // http://www.proceed.com.au
  //

  var popupwin_detailed = "";
  var popupwin_legend = "";


  function PM_popup_compat()
  {
    return ((navigator.appName.indexOf('Netscape') > -1) &&
        (parseInt(navigator.appVersion) == 4) &&
        (navigator.platform.indexOf('Mac') > -1)) ?
      0 : 1;
  }

  function PM_popup(page)
  {
    var URL;

    // Calculate URL for page name
    if (page == "detailed")
    {
      URL = "detail"

      // Delete previous incarnation of the window (helps keep it raised)
      if ( (popupwin_detailed != "") && (!(popupwin_detailed.closed)) )
      {
        popupwin_detailed.location = URL
      }
      else
      {
        popupwin_detailed = window.open(URL,
                              page,
                              config='height=480,width=640,resizable=1,scrollbars=1,status=1')
      }
      popupwin_detailed.focus();
      return;
    }
    if (page == "legend")
    {
      URL = "/cgi/placeinfo.pl?Show=legend"

      // Delete previous incarnation of the window (helps keep it raised)
      if ( (popupwin_legend != "") && (!(popupwin_legend.closed)) )
      {
        popupwin_legend.location = URL
      }
      else
      {
        popupwin_legend = window.open(URL,
                              page,
                              config='height=390,width=300,resizable=0,scrollbars=0')
      }
      popupwin_legend.focus();
      return;
    }

    URL = '/cgi/placeinfo.pl?Show=svgmap,details&ID='+page;

    // Delete previous incarnation of the window (helps keep it raised)
    if ( (popupwin_detailed != "") && (!(popupwin_detailed.closed)) )
    {
      popupwin_detailed.location = URL
    }
    else
    {
      popupwin_detailed = window.open(URL,
                            page,
                            config='height=480,width=640,resizable=1,scrollbars=1,status=1')
    }
    popupwin_detailed.focus();

  }

//-->
