var GeoPlayer = null;

if(isIE)
{
  document.write(
    '<object ',
    'id="GeoPlayerAX" ',
    'name="GeoPlayerAX" ',
    'width="100%" height="100%" ',
    'standby="Loading or installing GeoPlayer ActiveX control ..." ',
    'classid="CLSID:FBAA44A9-2AF3-450D-9881-BFE7BE67D852" ',
    'codebase="'+plugin_dir+'/ActiveX/GeoPlayerX.cab#version=1,5,9,1" ',
    '> ',
    '<param name="_Version" value="65536"> ',
    '<param name="_ExtentX" value="500"> ',
    '<param name="_ExtentY" value="500"> ',
    '<param name="_StockProps" value="0"> ',
    '<param name="filename" value="'+ session_url +'"> ',
    '<h2>If you see this text, then your browser is either blocking ActiveX ',
    'controls or it is not handling them properly. The current GeoPlayer ',
    'requires Microsoft Internet Explorer on a Windows PC platform. If ',
    'you see an information bar on top of this page, please choose option ',
    'to either install ActiveX control or allow blocked content.</h2> ',
    '</object>');
    GeoPlayer = GeoPlayerAX;
}
else if(isNN)
{
  var docWrapper = {
    Call : function(name, id, data)
    {
      listener[name](id,data);
    }
  };

  function xpinstallCallback(url, status)
  {
    if (status == 0)
      msg = "The GeoPlayer plugin has been installed\nPlease restart your browser to use the plugin";
    else
      msg = "XPInstall Test:   FAILED "+status+"\n";
    dump(msg);
    alert(msg);
  }

  function doInstall()
  {
    xpiFile = plugin_dir+"/"+navigator.platform+"/GeoPlayerMozilla.xpi";
    xpi= {'GeoPlayer Plugin':xpiFile};
    InstallTrigger.install(xpi,xpinstallCallback);
  }

  // Can we display Shockwave movies?
  var mimetype = navigator.mimeTypes["text/x-vnd-geofusion-session"];
 
  if (mimetype) {
    // Yes, so can we display with a plug-in?
    var plugin = mimetype.enabledPlugin;
    if (plugin && GeoPlayer == null) {
      if (session_url == "") {
        document.writeln('<embed id="GP"',
                    'width="100%"',
                    'height="100%"',
                    '_version="65536"',
                    '_extentx="1000"',
                    '_extenty="1000"',
                    'type="text/x-vnd-geofusion-session"',
                    'session_file="'+session_url +'">');
            } else {
                // Yes, so show the data in-line
                document.writeln('<embed id="GP"',
                    'width="100%"',
                    'height="100%"',
                    '_version="65536"',
                    '_extentx="1000"',
                    '_extenty="1000"',
                    'type="text/x-vnd-geofusion-session"',
                    'session_file="'+session_url +'">');
            }
            GeoPlayer = document.embeds[0];
    } else {
      // No, so provide a link to the data
      document.writeln("Cant get plugin");
    }
  } else {
    // No, so tell them so
    document.writeln("<A HREF='javascript:doInstall()'>Click here</A> to install GeoPlayer plugin.");
  }
}
else
{
    alert('Sorry, unsupported browser.');
}
  
  

