/* Copied from http://jslib.mozdev.org/jsLib_glue.html.  
 * Copyright © 2000-2005 by MozDevGroup.  Used with permission.
 */

// ensure jsLib is installed
function jslibCheckInst ()
{
  if (typeof(jslib) != "object") {
    const msg = "MyExtension requires jsLib to properly operate\n"
              + "Would you like to install jsLib now? (browser restart required)";

    if (confirm(msg)) {
      const url = "http://www.mozdevgroup.com/dropbox/jslib/signed/"
                + "jslib_current_global_signed.xpi";
      try {
        _content.location = url;
      } catch (e) { open(url, "_blank", "width=1,height=1"); }
    }

    throw "Stopping any further code execution ...";
  }

  jslib.init();
}