// ==UserScript==
// @name          License Explorer
// @description   Parse license information in web pages
// @version       2005-10-11
// @namespace     http://diveintomark.org/projects/greasemonkey/
// @include       *
// ==/UserScript==
//
// Tested with
// - Firefox 1.0 and 1.5, Greasemonkey 0.5 <http://greasemonkey.mozdev.org/>

/* BEGIN LICENSE BLOCK
Copyright (C) 2005 Mark Pilgrim

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You can download a copy of the GNU General Public License at
http://diveintomark.org/projects/greasemonkey/COPYING
or get a free printed copy by writing to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
END LICENSE BLOCK */

// licenses
var unknown;
var gLicenseUrl = {
    'http://gnu.org/copyleft/gpl.html': 'gpl-2',
    'http://gnu.org/licenses/gpl.txt': 'gpl-2',
    'http://gnu.org/licenses/gpl.texi': 'gpl-2',
    'http://gnu.org/licenses/gpl-2.0.tex': 'gpl-2',
    'http://gnu.org/licenses/gpl.dbk': 'gpl-2',
    'http://fsf.org/licensing/licenses/gpl.html': 'gpl-2',
    'http://fsf.org/licensing/licenses/gpl.txt': 'gpl-2',
    'http://fsf.org/licensing/licenses/gpl.texi': 'gpl-2',
    'http://fsf.org/licensing/licenses/gpl-2.0.tex': 'gpl-2',
    'http://fsf.org/licensing/licenses/gpl.xml': 'gpl-2',
    'http://opensource.org/licenses/gpl-license.php': 'gpl-2',
    'http://creativecommons.org/license/cc-gpl': 'gpl-2',
    'http://creativecommons.org/licenses/GPL/2.0/': 'gpl-2',
    'http://poespas.co.za/wiki/index.php/GNU_Algemene_Publieke_Lisensie': 'gpl-2',
    'http://alblinux.net/dok/GPL.html': 'gpl-2',
    'http://magnux.org/doc/GPL-pt_BR.txt': 'gpl-2',
    'http://bulgaria.sourceforge.net/prava/gplbg.html': 'gpl-2',
    'http://ca.dodds.net/gnu/gpl.ca.html': 'gpl-2',
    'http://gnu.freehostingguru.com/gpl/': 'gpl-2',
    'http://linux.org.tw/CLDP/OLD/doc/GPL.html': 'gpl-2',
    'http://slat.org/project/legal/GNU_GPL_Chinese': 'gpl-2',
    'http://staff.cesnet.cz/~lhotka/gnugpl-cz.html': 'gpl-2',
    'http://gnu.cz/article.php?id_art=32': 'gpl-2',
    'http://fundanemt.com/gpl_da.html': 'gpl-2',
    'http://users.skynet.be/xterm/gpld.txt': 'gpl-2',
    'http://esperanto.mv.ru/Cetero/gpl.html': 'gpl-2',
    'http://kaveh.org/gnu/gpl-fa.html': 'gpl-2',
    'http://turre.com/licenses/gpl_fi.php': 'gpl-2',
    'http://april.org/gnu/gpl_french.html': 'gpl-2',
    'http://members.tripod.com.br/RamonFlores/GNU/gpl.html': 'gpl-2',
    'http://aiet.qartuli.net/projects/gnu-gpl_en.php': 'gpl-2',
    'http://gnu.de/gpl-ger.html': 'gpl-2',
    'http://stillmover.tripod.com/Adana/gpl_el.pdf': 'gpl-2',
    'http://stillmover.tripod.com/Adana/gpl_el.txt': 'gpl-2',
    'http://law.co.il/computer-law/gpl-hebrew.html': 'gpl-2',
    'http://vlsm.org/etc/gpl-unofficial.id.html': 'gpl-2',
    'http://softwarelibero.it/gnudoc/gpl.it.txt': 'gpl-2',
    'http://autopenhosting.org/gnu/gpl.ja.html': 'gpl-2',
    'ftp://ftp.sra.co.jp/pub/gnu/local-fix/GPL2-j/': 'gpl-2',
    'http://korea.gnu.org/people/chsong/copyleft/gpl.ko.html': 'gpl-2',
    'http://mif.vu.lt/~vydv1916/gnu_gpl.html': 'gpl-2',
    'http://slobodensoftver.org.mk/dokumenti/gnu_gpl_mk.html': 'gpl-2',
    'http://arkiv.bonaveo.net/2005/07/28-nosk-gnu-general-public-licence-gpl.html': 'gpl-2',
    'http://gnu.org.pl/text/licencja-gnu.html': 'gpl-2',
    'http://neoscopio.com/licenca_GPL_pt.txt': 'gpl-2',
    'http://roedu.net/gplro.html': 'gpl-2',
    'http://infolex.narod.ru/gpl_gnu/gplrus.html': 'gpl-2',
    'http://law.bugtraq.ru/freesoft/gplrus3.html': 'gpl-2',
    'http://alas.matf.bg.ac.yu/~mr99164/ojl.html': 'gpl-2',
    'http://garaitia.com/new/gpl-spanish.php': 'gpl-2',
    'http://fsl.org.mx/tiki-read_article.php?articleId=16': 'gpl-2',
    'http://developer.thai.net/gpl/': 'gpl-2',
    'http://arayan.com/da/gpl_tr.html': 'gpl-2',
    'http://belgeler.org/KiTAPLIK/gpl.html': 'gpl-2',
    'http://asahi-net.or.jp/~as9d-kvlv/translations/GPL-License.v.2-uk.txt': 'gpl-2',
    'http://hebffinia.com/gpl_cymraeg/': 'gpl-2',
    'http://gugs.sindominio.net/licencias/gples.html': 'gpl-2',
    'http://gugs.sindominio.net/licencias/gpl-es.html': 'gpl-2',
    'http://gugs.sindominio.net/licencias/doc142.html': 'gpl-2',
    'http://gugs.sindominio.net/licencias/node831.html': 'gpl-2',
    'http://gugs.sindominio.net/licencias/gpl-2-es_MX.html': 'gpl-2',
    'http://www.gnu.org/copyleft/gpl.html': 'gpl-2',
    'http://www.gnu.org/licenses/gpl.txt': 'gpl-2',
    'http://www.gnu.org/licenses/gpl.texi': 'gpl-2',
    'http://www.gnu.org/licenses/gpl-2.0.tex': 'gpl-2',
    'http://www.gnu.org/licenses/gpl.dbk': 'gpl-2',
    'http://www.fsf.org/licensing/licenses/gpl.html': 'gpl-2',
    'http://www.fsf.org/licensing/licenses/gpl.txt': 'gpl-2',
    'http://www.fsf.org/licensing/licenses/gpl.texi': 'gpl-2',
    'http://www.fsf.org/licensing/licenses/gpl-2.0.tex': 'gpl-2',
    'http://www.fsf.org/licensing/licenses/gpl.xml': 'gpl-2',
    'http://www.opensource.org/licenses/gpl-license.php': 'gpl-2',
    'http://www.creativecommons.org/license/cc-gpl': 'gpl-2',
    'http://www.creativecommons.org/licenses/GPL/2.0/': 'gpl-2',
    'http://www.poespas.co.za/wiki/index.php/GNU_Algemene_Publieke_Lisensie': 'gpl-2',
    'http://www.alblinux.net/dok/GPL.html': 'gpl-2',
    'http://www.magnux.org/doc/GPL-pt_BR.txt': 'gpl-2',
    'http://www.linux.org.tw/CLDP/OLD/doc/GPL.html': 'gpl-2',
    'http://www.slat.org/project/legal/GNU_GPL_Chinese': 'gpl-2',
    'http://www.fundanemt.com/gpl_da.html': 'gpl-2',
    'http://www.esperanto.mv.ru/Cetero/gpl.html': 'gpl-2',
    'http://www.kaveh.org/gnu/gpl-fa.html': 'gpl-2',
    'http://www.turre.com/licenses/gpl_fi.php': 'gpl-2',
    'http://www.april.org/gnu/gpl_french.html': 'gpl-2',
    'http://www.gnu.de/gpl-ger.html': 'gpl-2',
    'http://www.law.co.il/computer-law/gpl-hebrew.html': 'gpl-2',
    'http://www.softwarelibero.it/gnudoc/gpl.it.txt': 'gpl-2',
    'http://www.autopenhosting.org/gnu/gpl.ja.html': 'gpl-2',
    'http://www.mif.vu.lt/~vydv1916/gnu_gpl.html': 'gpl-2',
    'http://www.slobodensoftver.org.mk/dokumenti/gnu_gpl_mk.html': 'gpl-2',
    'http://www.neoscopio.com/licenca_GPL_pt.txt': 'gpl-2',
    'http://www.roedu.net/gplro.html': 'gpl-2',
    'http://www.infolex.narod.ru/gpl_gnu/gplrus.html': 'gpl-2',
    'http://www.garaitia.com/new/gpl-spanish.php': 'gpl-2',
    'http://www.fsl.org.mx/tiki-read_article.php?articleId=16': 'gpl-2',
    'http://www.arayan.com/da/gpl_tr.html': 'gpl-2',
    'http://www.belgeler.org/KiTAPLIK/gpl.html': 'gpl-2',
    'http://www.asahi-net.or.jp/~as9d-kvlv/translations/GPL-License.v.2-uk.txt': 'gpl-2',
    'http://www.hebffinia.com/gpl_cymraeg/': 'gpl-2',

    'http://gnu.org/copyleft/lesser.html': 'lgpl-21',
    'http://gnu.org/copyleft/lesser.txt': 'lgpl-21',
    'http://gnu.org/copyleft/lesser.texi': 'lgpl-21',
    'http://fsf.org/licensing/licenses/lgpl.html': 'lgpl-21',
    'http://fsf.org/licensing/licenses/lgpl.txt': 'lgpl-21',
    'http://fsf.org/licensing/licenses/lgpl.texi': 'lgpl-21',
    'http://opensource.org/licenses/lgpl-license.php': 'lgpl-21',
    'http://creativecommons.org/license/cc-lgpl': 'lgpl-21',
    'http://creativecommons.org/licenses/LGPL/2.1/': 'lgpl-21',
    'http://gnu.freehostingguru.com/lgpl/': 'lgpl-21',
    'http://linux.org.tw/CLDP/OLD/doc/LGPL.html': 'lgpl-21',
    'http://gnu.sythe.org/nl.lgpl.html': 'lgpl-21',
    'http://rodage.org/lgpl.fr.html': 'lgpl-21',
    'http://gnu.de/lgpl-ger.html': 'lgpl-21',
    'http://autopenhosting.org/gnu/lgpl.ja.html': 'lgpl-21',
    'http://korea.gnu.org/people/chsong/copyleft/lgpl.ko.html': 'lgpl-21',
    'http://hyperjump4.republika.pl/gnu/konradgnulgpl.html': 'lgpl-21',
    'http://hyperjump4.republika.pl/gnu/elizagnulgpl.html': 'lgpl-21',
    'http://infolex.narod.ru/gpl_gnu/lgplrus.html': 'lgpl-21',
    'http://gugs.sindominio.net/licencias/lgpl-es.html': 'lgpl-21',
    'http://arayan.com/da/lgpl_tr.html': 'lgpl-21',
    'http://belgeler.org/KiTAPLIK/lgpl.html': 'lgpl-21',
    'http://www.gnu.org/copyleft/lesser.html': 'lgpl-21',
    'http://www.gnu.org/copyleft/lesser.txt': 'lgpl-21',
    'http://www.gnu.org/copyleft/lesser.texi': 'lgpl-21',
    'http://www.fsf.org/licensing/licenses/lgpl.html': 'lgpl-21',
    'http://www.fsf.org/licensing/licenses/lgpl.txt': 'lgpl-21',
    'http://www.fsf.org/licensing/licenses/lgpl.texi': 'lgpl-21',
    'http://www.opensource.org/licenses/lgpl-license.php': 'lgpl-21',
    'http://www.creativecommons.org/license/cc-lgpl': 'lgpl-21',
    'http://www.creativecommons.org/licenses/LGPL/2.1/': 'lgpl-21',
    'http://www.linux.org.tw/CLDP/OLD/doc/LGPL.html': 'lgpl-21',
    'http://www.rodage.org/lgpl.fr.html': 'lgpl-21',
    'http://www.gnu.de/lgpl-ger.html': 'lgpl-21',
    'http://www.autopenhosting.org/gnu/lgpl.ja.html': 'lgpl-21',
    'http://www.hyperjump4.republika.pl/gnu/konradgnulgpl.html': 'lgpl-21',
    'http://www.hyperjump4.republika.pl/gnu/elizagnulgpl.html': 'lgpl-21',
    'http://www.infolex.narod.ru/gpl_gnu/lgplrus.html': 'lgpl-21',
    'http://www.arayan.com/da/lgpl_tr.html': 'lgpl-21',
    'http://www.belgeler.org/KiTAPLIK/lgpl.html': 'lgpl-21',

    'http://gnu.org/licenses/fdl.html': 'gfdl-12',
    'http://gnu.org/licenses/fdl.txt': 'gfdl-12',
    'http://gnu.org/licenses/fdl.texi': 'gfdl-12',
    'http://gnu.org/licenses/fdl.xml': 'gfdl-12',
    'http://gnu.org/licenses/fdl.tex': 'gfdl-12',
    'http://poespas.co.za/wiki/index.php/GNU_Vrye_Dokumentasie_Lisensie': 'gfdl-12',
    'http://isocsyria.org/gfdl.html': 'gfdl-12',
    'http://softcatala.org/llicencies/fdl-ca.html': 'gfdl-12',
    'http://linuxfans.org/nuke/modules.php?name=Forums&file=viewtopic&t=69454': 'gfdl-12',
    'http://edt1023.sayya.org/license/fdl-zh.html': 'gfdl-12',
    'http://huizen.dto.tudelft.nl/devries/fdl.nl.html': 'gfdl-12',
    'http://kaveh.org/gnu/fdl-fa.html': 'gfdl-12',
    'http://giese-online.de/gnufdl-de.html': 'gfdl-12',
    'http://kinneret.berlios.de/doc/he/gfdl_license.html': 'gfdl-12',
    'http://autopenhosting.org/gnu/fdl.ja.html': 'gfdl-12',
    'http://korea.gnu.org/people/chsong/copyleft/fdl-1.2.ko.html': 'gfdl-12',
    'http://ic.unicamp.br/~norton/fdl.html': 'gfdl-12',
    'http://ro.wikipedia.org/wiki/GNU_FDL': 'gfdl-12',
    'http://curso-sobre.berlios.de/introsobre/': 'gfdl-12',
    'http://cy.wikipedia.org/wiki/GNU_FDL/cyfieithiad_FDL': 'gfdl-12',
    'http://www.gnu.org/licenses/fdl.html': 'gfdl-12',
    'http://www.gnu.org/licenses/fdl.txt': 'gfdl-12',
    'http://www.gnu.org/licenses/fdl.texi': 'gfdl-12',
    'http://www.gnu.org/licenses/fdl.xml': 'gfdl-12',
    'http://www.gnu.org/licenses/fdl.tex': 'gfdl-12',
    'http://www.poespas.co.za/wiki/index.php/GNU_Vrye_Dokumentasie_Lisensie': 'gfdl-12',
    'http://www.isocsyria.org/gfdl.html': 'gfdl-12',
    'http://www.softcatala.org/llicencies/fdl-ca.html': 'gfdl-12',
    'http://www.linuxfans.org/nuke/modules.php?name=Forums&file=viewtopic&t=69454': 'gfdl-12',
    'http://www.kaveh.org/gnu/fdl-fa.html': 'gfdl-12',
    'http://www.giese-online.de/gnufdl-de.html': 'gfdl-12',
    'http://www.autopenhosting.org/gnu/fdl.ja.html': 'gfdl-12',
    'http://www.ic.unicamp.br/~norton/fdl.html': 'gfdl-12',

    'http://gnu.org/licenses/old-licenses/fdl-1.1.html': 'gfdl-11',
    'http://gnu.org/licenses/old-licenses/fdl-1.1.txt': 'gfdl-11',
    'http://gnu.org/licenses/old-licenses/fdl-1.1.texi': 'gfdl-11',
    'http://gnu.org/licenses/old-licenses/fdl-1.1.sgml': 'gfdl-11',
    'http://gnu.org/licenses/old-licenses/fdl-1.1.tex': 'gfdl-11',
    'http://ead.unicamp.br/minicurso/bw/texto/fdl.pt.html': 'gfdl-11',
    'http://cesarx.free.fr/gfdlf.html': 'gfdl-11',
    'http://idealx.org/dossier/oss/gfdl.fr.html': 'gfdl-11',
    'http://nautix.sourceforge.net/docs/fdl.de.html': 'gfdl-11',
    'http://geocities.com/alkuma/linux/fdl.html': 'gfdl-11',
    'http://softwarelibero.it/gnudoc/fdl.it.html': 'gfdl-11',
    'http://korea.gnu.org/people/chsong/copyleft/fdl.ko.html': 'gfdl-11',
    'http://gnu.org.pl/text/GFDL-pl.html': 'gfdl-11',
    'http://ead.unicamp.br/minicurso/bw/texto/fdl.pt.html': 'gfdl-11',
    'http://infolex.narod.ru/gpl_gnu/gfdlrus.html': 'gfdl-11',
    'http://geocities.com/larteaga/gnu/gfdl.html': 'gfdl-11',
    'http://gugs.sindominio.net/licencias/fdl-es.html': 'gfdl-11',
    'http://www.gnu.org/licenses/old-licenses/fdl-1.1.html': 'gfdl-11',
    'http://www.gnu.org/licenses/old-licenses/fdl-1.1.txt': 'gfdl-11',
    'http://www.gnu.org/licenses/old-licenses/fdl-1.1.texi': 'gfdl-11',
    'http://www.gnu.org/licenses/old-licenses/fdl-1.1.sgml': 'gfdl-11',
    'http://www.gnu.org/licenses/old-licenses/fdl-1.1.tex': 'gfdl-11',
    'http://www.ead.unicamp.br/minicurso/bw/texto/fdl.pt.html': 'gfdl-11',
    'http://www.idealx.org/dossier/oss/gfdl.fr.html': 'gfdl-11',
    'http://www.softwarelibero.it/gnudoc/fdl.it.html': 'gfdl-11',
    'http://www.ead.unicamp.br/minicurso/bw/texto/fdl.pt.html': 'gfdl-11',
    'http://www.infolex.narod.ru/gpl_gnu/gfdlrus.html': 'gfdl-11',
    'http://www.geocities.com/larteaga/gnu/gfdl.html': 'gfdl-11',

    'http://web.resource.org/cc/PublicDomain': 'pd',
    'http://creativecommons.org/licenses/publicdomain/': 'pd',
    'http://www.creativecommons.org/licenses/publicdomain/': 'pd',

    'http://creativecommons.org/licenses/devnations/2.0/': 'cc-devnations-20',
    'http://www.creativecommons.org/licenses/devnations/2.0/': 'cc-devnations-20',

    'http://creativecommons.org/licenses/sampling/1.0/': 'cc-sampling-10',
    'http://www.creativecommons.org/licenses/sampling/1.0/': 'cc-sampling-10',

    'http://creativecommons.org/licenses/sampling+/1.0/': 'cc-sampling+-10',
    'http://www.creativecommons.org/licenses/sampling+/1.0/': 'cc-sampling+-10',

    'http://creativecommons.org/licenses/nc-sampling+/1.0/': 'cc-nc-sampling+-10',
    'http://www.creativecommons.org/licenses/nc-sampling+/1.0/': 'cc-nc-sampling+-10',

    'http://creativecommons.org/licenses/sa/1.0/': 'cc-sa-10',
    'http://www.creativecommons.org/licenses/sa/1.0/': 'cc-sa-10',

    'http://creativecommons.org/licenses/nc-sa/1.0/': 'cc-nc-sa-10',
    'http://www.creativecommons.org/licenses/nc-sa/1.0/': 'cc-nc-sa-10',

    'http://creativecommons.org/licenses/nc/1.0/': 'cc-nc-10',
    'http://www.creativecommons.org/licenses/nc/1.0/': 'cc-nc-10',

    'http://creativecommons.org/licenses/nd-nc/1.0/': 'cc-nd-nc-10',
    'http://www.creativecommons.org/licenses/nd-nc/1.0/': 'cc-nd-nc-10',

    'http://creativecommons.org/licenses/nd/1.0/': 'cc-nd-10',
    'http://www.creativecommons.org/licenses/nd/1.0/': 'cc-nd-10',

    'http://creativecommons.org/licenses/by/2.0/': 'cc-by-20',
    'http://www.creativecommons.org/licenses/by/2.0/': 'cc-by-20',

    'http://creativecommons.org/licenses/by-nd/2.0/': 'cc-by-nd-20',
    'http://www.creativecommons.org/licenses/by-nd/2.0/': 'cc-by-nd-20',

    'http://creativecommons.org/licenses/by-nc-nd/2.0/': 'cc-by-nc-nd-20',
    'http://www.creativecommons.org/licenses/by-nc-nd/2.0/': 'cc-by-nc-nd-20',

    'http://creativecommons.org/licenses/by-nc/2.0/': 'cc-by-nc-20',
    'http://www.creativecommons.org/licenses/by-nc/2.0/': 'cc-by-nc-20',
    
    'http://creativecommons.org/licenses/by-nc-sa/2.0/': 'cc-by-nc-sa-20',
    'http://www.creativecommons.org/licenses/by-nc-sa/2.0/': 'cc-by-nc-sa-20',
    
    'http://creativecommons.org/licenses/by-sa/2.0/': 'cc-by-sa-20',
    'http://www.creativecommons.org/licenses/by-sa/2.0/': 'cc-by-sa-20',
    
    'http://creativecommons.org/licenses/by/2.5/': 'cc-by-25',
    'http://www.creativecommons.org/licenses/by/2.5/': 'cc-by-25',

    'http://creativecommons.org/licenses/by-nd/2.5/': 'cc-by-nd-25',
    'http://www.creativecommons.org/licenses/by-nd/2.5/': 'cc-by-nd-25',

    'http://creativecommons.org/licenses/by-nc-nd/2.5/': 'cc-by-nc-nd-25',
    'http://www.creativecommons.org/licenses/by-nc-nd/2.5/': 'cc-by-nc-nd-25',

    'http://creativecommons.org/licenses/by-nc/2.5/': 'cc-by-nc-25',
    'http://www.creativecommons.org/licenses/by-nc/2.5/': 'cc-by-nc-25',
    
    'http://creativecommons.org/licenses/by-nc-sa/2.5/': 'cc-by-nc-sa-25',
    'http://www.creativecommons.org/licenses/by-nc-sa/2.5/': 'cc-by-nc-sa-25',
    
    'http://creativecommons.org/licenses/by-sa/2.5/': 'cc-by-sa-25',
    'http://www.creativecommons.org/licenses/by-sa/2.5/': 'cc-by-sa-25',

    'http://opensource.org/licenses/afl-2.1.php': 'afl-21',
    'http://opensource.org/licenses/afl-2.1.txt': 'afl-21',
    'http://www.opensource.org/licenses/afl-2.1.php': 'afl-21',
    'http://www.opensource.org/licenses/afl-2.1.txt': 'afl-21',
    
    'http://opensource.org/licenses/afl-2.0.php': 'afl-20',
    'http://opensource.org/licenses/afl-2.0.txt': 'afl-20',
    'http://www.opensource.org/licenses/afl-2.0.php': 'afl-20',
    'http://www.opensource.org/licenses/afl-2.0.txt': 'afl-20',
    
    'http://opensource.org/licenses/academic.php': 'afl-12',
    'http://opensource.org/licenses/afl-1.2.txt': 'afl-12',
    'http://www.opensource.org/licenses/academic.php': 'afl-12',
    'http://www.opensource.org/licenses/afl-1.2.txt': 'afl-12',

    'http://opensource.org/licenses/afl-1.1.txt': 'afl-11',
    'http://www.opensource.org/licenses/afl-1.1.txt': 'afl-11',

    'http://opensource.org/licenses/apl1.0.php': 'apl-10',
    'http://opensource.org/licenses/apl1.0.txt': 'apl-10',
    'http://www.opensource.org/licenses/apl1.0.php': 'apl-10',
    'http://www.opensource.org/licenses/apl1.0.txt': 'apl-10',
    
    'http://apache.org/licenses/LICENSE-1.0': 'asl-10',
    'http://www.apache.org/licenses/LICENSE-1.0': 'asl-10',
    
    'http://apache.org/licenses/LICENSE-1.1': 'asl-11',
    'http://opensource.org/licenses/apachepl.php': 'asl-11',
    'http://www.apache.org/licenses/LICENSE-1.1': 'asl-11',
    'http://www.opensource.org/licenses/apachepl.php': 'asl-11',

    'http://apache.org/licenses/LICENSE-2.0': 'asl-20',
    'http://apache.org/licenses/LICENSE-2.0.txt': 'asl-20',
    'http://apache.org/licenses/LICENSE-2.0.html': 'asl-20',
    'http://opensource.org/licenses/apache2.0.php': 'asl-20',
    'http://opensource.org/licenses/apache2.0.txt': 'asl-20',
    'http://www.apache.org/licenses/LICENSE-2.0': 'asl-20',
    'http://www.apache.org/licenses/LICENSE-2.0.txt': 'asl-20',
    'http://www.apache.org/licenses/LICENSE-2.0.html': 'asl-20',
    'http://www.opensource.org/licenses/apache2.0.php': 'asl-20',
    'http://www.opensource.org/licenses/apache2.0.txt': 'asl-20',

    'http://opensource.apple.com/apsl/': 'apple-20',
    'http://opensource.apple.com/apsl/2.0.html': 'apple-20',
    'http://opensource.apple.com/apsl/2.0.txt': 'apple-20',
    'http://opensource.org/licenses/apsl-2.0.php': 'apple-20',
    'http://opensource.org/licenses/apsl-2.0.txt': 'apple-20',
    'http://www.opensource.apple.com/apsl/': 'apple-20',
    'http://www.opensource.apple.com/apsl/2.0.html': 'apple-20',
    'http://www.opensource.apple.com/apsl/2.0.txt': 'apple-20',
    'http://www.opensource.org/licenses/apsl-2.0.php': 'apple-20',
    'http://www.opensource.org/licenses/apsl-2.0.txt': 'apple-20',

    'http://opensource.apple.com/apsl/1.2.html': 'apple-12',
    'http://opensource.apple.com/apsl/1.2.txt': 'apple-12',
    'http://opensource.org/licenses/apsl.php': 'apple-12',
    'http://www.opensource.apple.com/apsl/1.2.html': 'apple-12',
    'http://www.opensource.apple.com/apsl/1.2.txt': 'apple-12',
    'http://www.opensource.org/licenses/apsl.php': 'apple-12',

    'http://opensource.apple.com/apsl/1.1.html': 'apple-11',
    'http://opensource.apple.com/apsl/1.1.txt': 'apple-11',
    'http://www.opensource.apple.com/apsl/1.1.html': 'apple-11',
    'http://www.opensource.apple.com/apsl/1.1.txt': 'apple-11',

    'http://opensource.apple.com/apsl/1.0.html': 'apple-10',
    'http://opensource.apple.com/apsl/1.0.txt': 'apple-10',
    'http://www.opensource.apple.com/apsl/1.0.html': 'apple-10',
    'http://www.opensource.apple.com/apsl/1.0.txt': 'apple-10',

    /* TODO
    'http://opensource.org/licenses/artistic-license.php': 'artistic',
    'http://www.opensource.org/licenses/artistic-license.php': 'artistic',
    */

    'http://dev.perl.org/perl6/rfc/346.html': 'art-20b4',

    'http://opensource.org/licenses/attribution.php': 'attr',
    'http://www.opensource.org/licenses/attribution.php': 'attr',

    'http://opensource.org/licenses/bsd-license.php': 'bsd-mod',
    'http://debian.org/misc/bsd.license': 'bsd-mod',
    'http://www.opensource.org/licenses/bsd-license.php': 'bsd-mod',
    'http://www.debian.org/misc/bsd.license': 'bsd-mod',
    'http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5': 'bsd-mod',

    'http://xfree86.org/3.3.6/COPYRIGHT2.html#6': 'bsd-orig',
    'http://www.xfree86.org/3.3.6/COPYRIGHT2.html#6': 'bsd-orig',
    
    'http://opensource.org/licenses/ca-tosl1.1.php': 'catosl-11',
    'http://opensource.org/licenses/ca-tosl1.1.txt': 'catosl-11',
    'http://www.opensource.org/licenses/ca-tosl1.1.php': 'catosl-11',
    'http://www.opensource.org/licenses/ca-tosl1.1.txt': 'catosl-11',

    'http://sun.com/cddl/cddl.html': 'cddl-10',
    'http://opensource.org/licenses/cddl1.php': 'cddl-10',
    'http://opensource.org/licenses/cddl1.txt': 'cddl-10',
    'http://opensolaris.org/os/licensing/cddllicense.txt': 'cddl-10',
    'http://www.sun.com/cddl/cddl.html': 'cddl-10',
    'http://www.opensource.org/licenses/cddl1.php': 'cddl-10',
    'http://www.opensource.org/licenses/cddl1.txt': 'cddl-10',
    'http://www.opensolaris.org/os/licensing/cddllicense.txt': 'cddl-10',

    'http://opensource.org/licenses/cpl1.0.php': 'cpl-10',
    'http://opensource.org/licenses/cpl1.0.txt': 'cpl-10',
    'http://eclipse.org/legal/cpl-v10.html': 'cpl-10',
    'http://ibm.com/developerworks/opensource/library/os-beehive/os-cpl.html': 'cpl-10',
    'http://www.opensource.org/licenses/cpl1.0.php': 'cpl-10',
    'http://www.opensource.org/licenses/cpl1.0.txt': 'cpl-10',
    'http://www.eclipse.org/legal/cpl-v10.html': 'cpl-10',
    'http://www-128.ibm.com/developerworks/opensource/library/os-beehive/os-cpl.html': 'cpl-10',
    'http://www.ibm.com/developerworks/opensource/library/os-beehive/os-cpl.html': 'cpl-10',

    'http://opensource.org/licenses/cuaoffice.php': 'cuaopl-10',
    'http://opensource.org/licenses/cuaoffice.txt': 'cuaopl-10',
    'http://www.opensource.org/licenses/cuaoffice.php': 'cuaopl-10',
    'http://www.opensource.org/licenses/cuaoffice.txt': 'cuaopl-10',

    'http://opensource.org/licenses/eudatagrid.php': 'eudatagrid',
    'http://opensource.org/licenses/eudatagrid.txt': 'eudatagrid',
    'http://www.opensource.org/licenses/eudatagrid.php': 'eudatagrid',
    'http://www.opensource.org/licenses/eudatagrid.txt': 'eudatagrid',

    'http://eclipse.org/legal/epl-v10.html': 'epl-10',
    'http://opensource.org/licenses/eclipse-1.0.php': 'epl-10',
    'http://opensource.org/licenses/eclipse-1.0.txt': 'epl-10',
    'http://www.eclipse.org/legal/epl-v10.html': 'epl-10',
    'http://www.opensource.org/licenses/eclipse-1.0.php': 'epl-10',
    'http://www.opensource.org/licenses/eclipse-1.0.txt': 'epl-10',

    'http://opensource.org/licenses/ecl1.php': 'ecl-10',
    'http://opensource.org/licenses/ecl1.txt': 'ecl-10',
    'http://boson2x.org/article.php3?id_article=131': 'ecl-10',
    'http://www.opensource.org/licenses/ecl1.php': 'ecl-10',
    'http://www.opensource.org/licenses/ecl1.txt': 'ecl-10',
    'http://www.boson2x.org/article.php3?id_article=131': 'ecl-10',

    'http://opensource.org/licenses/eiffel.php': 'efl-10',
    'http://eiffel-nice.org/license/forum.txt': 'efl-10',
    'http://gobosoft.com/eiffel/gobo/eiffel_forum_license_v1.html': 'efl-10',
    'http://www.opensource.org/licenses/eiffel.php': 'efl-10',
    'http://www.eiffel-nice.org/license/forum.txt': 'efl-10',
    'http://www.gobosoft.com/eiffel/gobo/eiffel_forum_license_v1.html': 'efl-10',

    'http://opensource.org/licenses/ver2_eiffel.php': 'efl-20',
    'http://gnu.org/licenses/eiffel-forum-license-2.html': 'efl-20',
    'http://eiffel-nice.org/license/eiffel-forum-license-2.html': 'efl-20',
    'http://eiffel-nice.org/license/eiffel-forum-license-2.txt': 'efl-20',
    'http://www.opensource.org/licenses/ver2_eiffel.php': 'efl-20',
    'http://www.gnu.org/licenses/eiffel-forum-license-2.html': 'efl-20',
    'http://www.eiffel-nice.org/license/eiffel-forum-license-2.html': 'efl-20',
    'http://www.eiffel-nice.org/license/eiffel-forum-license-2.txt': 'efl-20',

    'http://opensource.org/licenses/entessa.php': 'ent-10',
    'http://www.opensource.org/licenses/entessa.php': 'ent-10',

    'http://opensource.org/licenses/fair.php': 'fair',
    'http://opensource.org/licenses/fair.txt': 'fair',
    'http://www.opensource.org/licenses/fair.php': 'fair',
    'http://www.opensource.org/licenses/fair.txt': 'fair',

    'http://opensource.org/licenses/frameworx.php': 'fol-10',
    'http://opensource.org/licenses/FW1.txt': 'fol-10',
    'http://www.opensource.org/licenses/frameworx.php': 'fol-10',
    'http://www.opensource.org/licenses/FW1.txt': 'fol-10',

    'http://opensource.org/licenses/historical.php': 'hist',
    'http://www.opensource.org/licenses/historical.php': 'hist',
    
    'http://opensource.org/licenses/ibmpl.php': 'ipl-10',
    'http://ibm.com/developerworks/library/os-ipl.html': 'ipl-10',
    'http://www.opensource.org/licenses/ibmpl.php': 'ipl-10',
    'http://www-128.ibm.com/developerworks/library/os-ipl.html': 'ipl-10',
    'http://www.ibm.com/developerworks/library/os-ipl.html': 'ipl-10',

    'http://opensource.org/licenses/intel-open-source-license.php': 'intel',
    'http://intel.com/technology/computing/lfm/license.htm': 'intel',
    'http://www.opensource.org/licenses/intel-open-source-license.php': 'intel',
    'http://www.intel.com/technology/computing/lfm/license.htm': 'intel',

    'http://opensource.org/licenses/jabberpl.php': 'josl-10',
    'http://jabber.org/about/josl.shtml': 'josl-10',
    'http://www.opensource.org/licenses/jabberpl.php': 'josl-10',
    'http://www.jabber.org/about/josl.shtml': 'josl-10',

    'http://opensource.org/licenses/plan9.php': 'plan9-10',
    'http://galaxquery.org/LICENSE': 'plan9-10',
    'http://www.opensource.org/licenses/plan9.php': 'plan9-10',
    'http://www.galaxquery.org/LICENSE': 'plan9-10',

    'http://opensource.org/licenses/lucent1.02.php': 'plan9-102',
    'http://opensource.org/licenses/lucent1.02.txt': 'plan9-102',
    'http://plan9.bell-labs.com/plan9dist/license.html': 'plan9-102',
    'http://www.opensource.org/licenses/lucent1.02.php': 'plan9-102',
    'http://www.opensource.org/licenses/lucent1.02.txt': 'plan9-102',
    'http://www.cs.bell-labs.com/plan9dist/license.html': 'plan9-102',

    'http://opensource.org/licenses/mit-license.php': 'mit',
    'http://jclark.com/xml/copying.txt': 'mit',
    'http://x.org/Downloads_terms.html': 'mit',
    'http://www.opensource.org/licenses/mit-license.php': 'mit',
    'http://www.jclark.com/xml/copying.txt': 'mit',
    'http://www.x.org/Downloads_terms.html': 'mit',

    'http://opensource.org/licenses/mitrepl.php': 'cvw',
    'http://www.opensource.org/licenses/mitrepl.php': 'cvw',
    'http://cvw.mitre.org/cvw/licenses/source/license.html': 'cvw',

    'http://opensource.org/licenses/motosoto.php': 'moto-091',
    'http://www.opensource.org/licenses/motosoto.php': 'moto-091',
    
    'http://opensource.org/licenses/mozilla1.0.php': 'mpl-10',
    'http://mozilla.org/MPL/MPL-1.0.html': 'mpl-10',
    'http://www.opensource.org/licenses/mozilla1.0.php': 'mpl-10',
    'http://www.mozilla.org/MPL/MPL-1.0.html': 'mpl-10',

    'http://opensource.org/licenses/mozilla1.1.php': 'mpl-11',
    'http://mozilla.org/MPL/MPL-1.1.html': 'mpl-11',
    'http://www.opensource.org/licenses/mozilla1.1.php': 'mpl-11',
    'http://www.mozilla.org/MPL/MPL-1.1.html': 'mpl-11',

    'http://opensource.org/licenses/nasa1.3.php': 'nasa-13',
    'http://opensource.org/licenses/NASA1.3.txt': 'nasa-13',
    'http://worldwind.arc.nasa.gov/worldwind-nosa-1.3.html': 'nasa-13',
    'http://opensource.arc.nasa.gov/pdf/NASA_Open_Source_Agreement_1.3.txt': 'nasa-13',
    'http://opensource.arc.nasa.gov/pdf/NASA_Open_Source_Agreement_1.3.rtf': 'nasa-13',
    'http://opensource.arc.nasa.gov/pdf/NASA_Open_Source_Agreement_1.3.pdf': 'nasa-13',
    'http://opensource.arc.nasa.gov/license.jsp': 'nasa-13',
    'http://www.opensource.org/licenses/nasa1.3.php': 'nasa-13',
    'http://www.opensource.org/licenses/NASA1.3.txt': 'nasa-13',
    
    'http://opensource.org/licenses/naumen.php': 'naumen',
    'http://zope.org/Members/naumen/NauScheduler/LICENSE/document_view': 'naumen',
    'http://www.opensource.org/licenses/naumen.php': 'naumen',
    'http://www.zope.org/Members/naumen/NauScheduler/LICENSE/document_view': 'naumen',

    'http://opensource.org/licenses/nethack.php': 'nethack',
    'http://nethack.org/common/license.html': 'nethack',
    'http://www.opensource.org/licenses/nethack.php': 'nethack',
    'http://www.nethack.org/common/license.html': 'nethack',

    'http://opensource.org/licenses/nokia.php': 'nokia-10a',
    'http://mupe.net/inet/mupe/ContMan.nsf/0/b1a1247e3d077509c2256dd0003de329?OpenDocument&Click=': 'nokia-10a',
    'http://www.opensource.org/licenses/nokia.php': 'nokia-10a',
    'http://www.mupe.net/inet/mupe/ContMan.nsf/0/b1a1247e3d077509c2256dd0003de329?OpenDocument&Click=': 'nokia-10a',

    'http://opensource.org/licenses/oclc2.php': 'oclc-2',
    'http://oclc.org/research/software/license/default.htm': 'oclc-2',
    'http://www.opensource.org/licenses/oclc2.php': 'oclc-2',
    'http://www.oclc.org/research/software/license/default.htm': 'oclc-2',

    'http://opensource.org/licenses/opengroup.php': 'opengroup',
    'http://opengroup.org/dif/blitspub/license.htm': 'opengroup',
    'http://www.opensource.org/licenses/opengroup.php': 'opengroup',
    'http://www.opengroup.org/dif/blitspub/license.htm': 'opengroup',

    'http://opensource.org/licenses/osl-2.1.php': 'osl-21',
    'http://spikesource.com/sitemgr/resources.php?nav=openSoftwareLic': 'osl-21',
    'http://www.opensource.org/licenses/osl-2.1.php': 'osl-21',
    'http://www.spikesource.com/sitemgr/resources.php?nav=openSoftwareLic': 'osl-21',

    'http://opensource.org/licenses/php.php': 'php-3',
    'http://opensource.org/licenses/php-3.0.txt': 'php-3',
    'http://php.net/license/': 'php-3',
    'http://php.net/license/3_0.txt': 'php-3',
    'http://www.opensource.org/licenses/php.php': 'php-3',
    'http://www.opensource.org/licenses/php-3.0.txt': 'php-3',
    'http://www.php.net/license/': 'php-3',
    'http://www.php.net/license/3_0.txt': 'php-3',

    'http://python.org/doc/Copyright.html': 'py-cwi',
    'http://www.python.org/doc/Copyright.html': 'py-cwi',

    'http://opensource.org/licenses/pythonpl.php': 'py-cnri',
    'http://handle.net/python_licenses/python1.6_9-5-00.html': 'py-cnri',
    'http://python.org/1.6/license.html': 'py-cnri',
    'http://python.org/1.6.1/license.html': 'py-cnri',
    'http://www.opensource.org/licenses/pythonpl.php': 'py-cnri',
    'http://www.handle.net/python_licenses/python1.6_9-5-00.html': 'py-cnri',
    'http://www.python.org/1.6/license.html': 'py-cnri',
    'http://www.python.org/1.6.1/license.html': 'py-cnri',

    'http://python.org/2.0/license.html': 'py-beopen',
    'http://www.python.org/2.0/license.html': 'py-beopen',

    /* this is annoying */
    'http://opensource.org/licenses/PythonSoftFoundation.php': 'py-psf',
    'http://python.org/2.0.1/license.html': 'py-psf',
    'http://python.org/2.1/license.html': 'py-psf',
    'http://python.org/2.1.1/license.html': 'py-psf',
    'http://python.org/2.1.2/license.html': 'py-psf',
    'http://python.org/2.1.3/license.html': 'py-psf',
    'http://python.org/2.2/license.html': 'py-psf',
    'http://python.org/2.2.1/license.html': 'py-psf',
    'http://python.org/2.2.2/license.html': 'py-psf',
    'http://python.org/2.2.3/license.html': 'py-psf',
    'http://python.org/2.3/license.html': 'py-psf',
    'http://python.org/2.3.1/license.html': 'py-psf',
    'http://python.org/2.3.2/license.html': 'py-psf',
    'http://python.org/2.3.3/license.html': 'py-psf',
    'http://python.org/2.3.4/license.html': 'py-psf',
    'http://python.org/2.3.5/license.html': 'py-psf',
    'http://python.org/2.4/license.html': 'py-psf',
    'http://python.org/2.4.1/license.html': 'py-psf',
    'http://python.org/2.4.2/license.html': 'py-psf',
    'http://www.opensource.org/licenses/PythonSoftFoundation.php': 'py-psf',
    'http://www.python.org/2.0.1/license.html': 'py-psf',
    'http://www.python.org/2.1/license.html': 'py-psf',
    'http://www.python.org/2.1.1/license.html': 'py-psf',
    'http://www.python.org/2.1.2/license.html': 'py-psf',
    'http://www.python.org/2.1.3/license.html': 'py-psf',
    'http://www.python.org/2.2/license.html': 'py-psf',
    'http://www.python.org/2.2.1/license.html': 'py-psf',
    'http://www.python.org/2.2.2/license.html': 'py-psf',
    'http://www.python.org/2.2.3/license.html': 'py-psf',
    'http://www.python.org/2.3/license.html': 'py-psf',
    'http://www.python.org/2.3.1/license.html': 'py-psf',
    'http://www.python.org/2.3.2/license.html': 'py-psf',
    'http://www.python.org/2.3.3/license.html': 'py-psf',
    'http://www.python.org/2.3.4/license.html': 'py-psf',
    'http://www.python.org/2.3.5/license.html': 'py-psf',
    'http://www.python.org/2.4/license.html': 'py-psf',
    'http://www.python.org/2.4.1/license.html': 'py-psf',
    'http://www.python.org/2.4.2/license.html': 'py-psf',

    'http://opensource.org/licenses/qtpl.php': 'qpl-10',
    'http://trolltech.com/licenses/qpl.html': 'qpl-10',
    'http://trolltech.com/developer/licensing/qpl.html': 'qpl-10',
    'http://trolltech.com/licenses/qpl-annotated.html': 'qpl-10',
    'http://www.opensource.org/licenses/qtpl.php': 'qpl-10',
    'http://www.trolltech.com/licenses/qpl.html': 'qpl-10',
    'http://www.trolltech.com/developer/licensing/qpl.html': 'qpl-10',
    'http://www.trolltech.com/licenses/qpl-annotated.html': 'qpl-10',

    'http://opensource.org/licenses/real.php': 'rpsl-10',
    'https://helixcommunity.org/content/rpsl': 'rpsl-10',
    'https://helixcommunity.org/content/rpsl.txt': 'rpsl-10',
    'http://www.opensource.org/licenses/real.php': 'rpsl-10',
    'https://www.helixcommunity.org/content/rpsl': 'rpsl-10',
    'https://www.helixcommunity.org/content/rpsl.txt': 'rpsl-10',

    'http://opensource.org/licenses/rpl.php': 'recip-11',
    'http://www.opensource.org/licenses/rpl.php': 'recip-11',
    
    'http://opensource.org/licenses/ricohpl.php': 'ricoh-10',
    'http://risource.org/RPL/RPL-1.0A.shtml': 'ricoh-10',
    'http://www.opensource.org/licenses/ricohpl.php': 'ricoh-10',
    'http://www.risource.org/RPL/RPL-1.0A.shtml': 'ricoh-10',

    'http://opensource.org/licenses/sleepycat.php': 'sleepy',
    'http://sleepycat.com/docs/sleepycat/license.html': 'sleepy',
    'http://sleepycat.com/download/oslicense.html': 'sleepy',
    'http://www.opensource.org/licenses/sleepycat.php': 'sleepy',
    'http://www.sleepycat.com/docs/sleepycat/license.html': 'sleepy',
    'http://www.sleepycat.com/download/oslicense.html': 'sleepy',

    'http://opensource.org/licenses/sisslpl.php': 'sissl-11',
    'http://openoffice.org/licenses/sissl_license.html': 'sissl-11',
    'http://openoffice.org/licenses/sissl_license_1-1.pdf': 'sissl-11',
    'http://www.opensource.org/licenses/sisslpl.php': 'sissl-11',
    'http://www.openoffice.org/licenses/sissl_license.html': 'sissl-11',
    'http://www.openoffice.org/licenses/sissl_license_1-1.pdf': 'sissl-11',

    'http://opensource.org/licenses/sunpublic.php': 'spl-10',
    'http://netbeans.org/about/legal/spl.html': 'spl-10',
    'http://www.opensource.org/licenses/sunpublic.php': 'spl-10',
    'http://www.netbeans.org/about/legal/spl.html': 'spl-10',

    'http://www.opensource.org/licenses/sybase.php': 'sybase-10',
    'http://sybase.com/detail?id=1019014': 'sybase-10', /* note: requires login; how clueless can you get? */
    'http://www.opensource.org/licenses/sybase.php': 'sybase-10',
    'http://www.sybase.com/detail?id=1019014': 'sybase-10',

    'http://opensource.org/licenses/UoI-NCSA.php': 'ncsa',
    'http://www.opensource.org/licenses/UoI-NCSA.php': 'ncsa',
    'http://www.otm.uiuc.edu/faculty/forms/opensource.asp': 'ncsa',

    'http://opensource.org/licenses/vovidapl.php': 'vsl-10',
    'http://vovida.org/About/license.html': 'vsl-10',
    'http://www.opensource.org/licenses/vovidapl.php': 'vsl-10',
    'http://www.vovida.org/About/license.html': 'vsl-10',

    'http://opensource.org/licenses/W3C.php': 'w3c',
    'http://w3.org/Consortium/Legal/2002/copyright-software-20021231': 'w3c',
    'http://www.opensource.org/licenses/W3C.php': 'w3c',
    'http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231': 'w3c',

    'http://opensource.org/licenses/wxwindows.php': 'wxwin',
    'http://opensource.org/licenses/wxwindows.txt': 'wxwin',
    'http://wxwidgets.org/licence3.txt': 'wxwin',
    'http://www.opensource.org/licenses/wxwindows.php': 'wxwin',
    'http://www.opensource.org/licenses/wxwindows.txt': 'wxwin',
    'http://www.wxwidgets.org/licence3.txt': 'wxwin',

    'http://opensource.org/licenses/xnet.php': 'xnet',
    'http://www.opensource.org/licenses/xnet.php': 'xnet',

    'http://zope.org/Resources/License/ZPL-1.1': 'zpl-11',
    'http://www.zope.org/Resources/License/ZPL-1.1': 'zpl-11',
    
    'http://opensource.org/licenses/zpl.php': 'zpl-20',
    'http://zope.org/Resources/License/ZPL-2.0': 'zpl-20',
    'http://zope.org/Resources/ZPL': 'zpl-20',
    'http://www.opensource.org/licenses/zpl.php': 'zpl-20',
    'http://www.zope.org/Resources/License/ZPL-2.0': 'zpl-20',
    'http://www.zope.org/Resources/ZPL': 'zpl-20',

    'http://www.opensource.org/licenses/zlib-license.php': 'zlib',
    'http://www.gzip.org/zlib/zlib_license.html': 'zlib',

    'http://openldap.org/software/release/license.html': 'openldap',
    'http://www.openldap.org/software/release/license.html': 'openldap',

    'http://cryptix.org/LICENSE.TXT': 'cryptix',
    'http://www.cryptix.org/LICENSE.TXT': 'cryptix',

    'http://smlnj.org/license.html': 'smlnj',
    'http://www.smlnj.org/license.html': 'smlnj',

    'http://gnu.org/licenses/ecos-license.html': 'ecos',
    'http://www.gnu.org/licenses/ecos-license.html': 'ecos',
    
    'http://vim.org/htmldoc/uganda.html': 'vim',
    'http://www.vim.org/htmldoc/uganda.html': 'vim',
    
    'http://boost.org/LICENSE_1_0.txt': 'boost-10',
    'http://www.boost.org/LICENSE_1_0.txt': 'boost-10',
    
    'http://affero.org/oagpl.html': 'affero-10',
    'http://www.affero.org/oagpl.html': 'affero-10',
    
    'http://ftp.gnu.org/gnu/non-gnu/chinese-fonts-truetype/LICENSE': 'arphic',
    'http://www.freedesktop.org/wiki/Arphic_20Public_20License': 'arphic',

    'http://condor-mirror.ucl.ac.uk/downloads/v6.4.license.html': 'condor-11',
    'http://www.cs.wisc.edu/condor/condor-public-license.html': 'condor-11',
    'http://www.uni-muenster.de/IVVNWZ/Morfeus/lizenz.html': 'condor-11',
    'http://www.ifi.uio.no/condor/LICENSE.TXT': 'condor-11',

    'http://sdisw.com/openssl.htm': 'openssl',
    'http://iona.com/support/docs/e2a/asp/5.0/corba/ssl/html/LicensesAppx2.html': 'openssl',
    'http://openssl.org/source/license.html': 'openssl',
    'http://docs.hp.com/en/T2351-90031/apas03.html': 'openssl',
    'http://www.sdisw.com/openssl.htm': 'openssl',
    'http://www.iona.com/support/docs/e2a/asp/5.0/corba/ssl/html/LicensesAppx2.html': 'openssl',
    'http://www.openssl.org/source/license.html': 'openssl',
    
    'http://phorum.org/license.txt': 'phorum-20',
    'http://www.phorum.org/license.txt': 'phorum-20',

    'http://info.borland.com/devsupport/interbase/opensource/IPL.html': 'interbase-10',
    'http://bdn.borland.com/article/0,1410,30198,00.html': 'interbase-10',
    'http://firebird.sourceforge.net/index.php?op=doc&id=ipl': 'interbase-10',
    'http://dotnetfirebird.org/files/IPLicense.txt': 'interbase-10',
    'http://www.dotnetfirebird.org/files/IPLicense.txt': 'interbase-10',

    'http://mozilla.org/MPL/NPL-1.0.html': 'npl-10',
    'http://www.mozilla.org/MPL/NPL-1.0.html': 'npl-10',

    'http://vitanuova.com/inferno/liblicence.txt': 'vita',
    'http://www.vitanuova.com/inferno/liblicence.txt': 'vita',
    
    'http://oss.sgi.com/projects/FreeB/SGIFreeSWLicB.1.1.doc': 'sgi-11',
    'http://oss.sgi.com/projects/FreeB/SGIFreeSWLicB.1.1.ps': 'sgi-11',

    'http://sun.com/software/communitysource/': 'scsl',
    'http://www.sun.com/software/communitysource/': 'scsl',

    'http://www.cs.utah.edu/~gk/teem/txt/LICENSE.txt': 'utah',

    'http://www.cs.wisc.edu/~ghost/doc/cvs/Public.htm': 'aladdin',

    'http://www.scilab.org/legal/license.html': 'scilab',
    'http://www.scilab.org/legal/licence.html': 'scilab',

    'http://jahia.org/jahia/page145.html': 'jscl',
    'http://jahia.org/jahia/webdav/shared/license/JCSL1_3_v3.pdf': 'jscl',
    'http://jahia.org/jahia/webdav/shared/license/JCSL1_3_v3.doc': 'jscl',
    'http://www.jahia.org/jahia/page145.html': 'jscl',
    'http://www.jahia.org/jahia/webdav/shared/license/JCSL1_3_v3.pdf': 'jscl',
    'http://www.jahia.org/jahia/webdav/shared/license/JCSL1_3_v3.doc': 'jscl',

    'http://www.research.att.com/sw/license/ast-open.html': 'ast',

    'http://msdn.microsoft.com/msdn-files/027/001/901/ShSourceCLIbetaLicense.htm': 'shared',

    'http://freebsd.org/copyright/freebsd-doc-license.html': 'freebsd-doc',
    'http://www.freebsd.org/copyright/freebsd-doc-license.html': 'freebsd-doc',

    'http://www.opensource.apple.com/cdl/': 'apple-doc-10',

    'http://opencontent.org/openpub/': 'openpub-10',
    'http://www.opencontent.org/openpub/': 'openpub-10',

    'http://opencontent.org/opl.shtml': 'opencontent-10',
    'http://www.opencontent.org/opl.shtml': 'opencontent-10',

    'http://dmoz.org/license.html': 'dmoz',
    'http://www.dmoz.org/license.html': 'dmoz',
    
    'http://gnu.org/licenses/dsl.html': 'dsl',
    'http://www.gnu.org/licenses/dsl.html': 'dsl',
    
    'http://artlibre.org/licence/lalgb.html': 'freeart-12',
    'http://www.artlibre.org/licence/lalgb.html': 'freeart-12',

    'http://cecill.info/licences/Licence_CeCILL_V2-en.html': 'cecill-20',
    'http://www.cecill.info/licences/Licence_CeCILL_V2-en.html': 'cecill-20'
    //map
}
var gLicense = {};
gLicense['unknown'] = {
    name: 'unknown license',
    canonicalurl: unknown,
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: unknown,
    dfsgfree: unknown,
    permits: unknown,
    requires: unknown,
    prohibits: unknown
};
gLicense['gpl-2'] = {
    name: 'GNU General Public License 2.0',
    canonicalurl: 'http://www.gnu.org/copyleft/gpl.html',
    fsffree: true,
    gplcompat: true,
    osiapproved: true,
    dfsgfree: true, /* see http://www.debian.org/legal/licenses/ */
    permits: ['Reproduction','Distribution','DerivativeWorks','CommercialUse'],
    requires: ['Notice','ShareAlike','SourceCode'],
    prohibits: []
};
gLicense['lgpl-21'] = {
    name: 'GNU Lesser Public License 2.1',
    canonicalurl: 'http://www.gnu.org/copyleft/lesser.html',
    fsffree: true,
    gplcompat: true,
    osiapproved: true,
    dfsgfree: true, /* see http://www.debian.org/legal/licenses/ */
    permits: ['Reproduction','Distribution','DerivativeWorks','CommercialUse'],
    requires: ['Notice','ShareAlike','SourceCode'],
    prohibits: []
};
gLicense['gfdl-11'] = {
    name: 'GNU Free Documentation License 1.1',
    canonicalurl: 'http://www.gnu.org/licenses/old-licenses/fdl-1.1.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','DerivativeWorks','CommercialUse'],
    requires: ['Notice','ShareAlike'],
    prohibits: []
};
gLicense['gfdl-12'] = {
    name: 'GNU Free Documentation License 1.2',
    canonicalurl: 'http://www.gnu.org/licenses/fdl.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false, /* see http://people.debian.org/~srivasta/Position_Statement */
    permits: ['Reproduction','Distribution','DerivativeWorks','CommercialUse'],
    requires: ['Notice','ShareAlike'],
    prohibits: []
};
gLicense['pd'] = {
    name: 'public domain',
    canonicalurl: 'http://creativecommons.org/licenses/publicdomain/',
    fsffree: true,
    gplcompat: true,
    osiapproved: false,
    dfsgfree: true, /* see http://www.debian.org/legal/licenses/ */
    permits: ['Reproduction','Distribution','DerivativeWorks','CommercialUse'],
    requires: [],
    prohibits: []
};
gLicense['cc-devnations-20'] = {
    name: 'Creative Commons Developing Nations License 2.0',
    canonicalurl: 'http://creativecommons.org/licenses/devnations/2.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','DerivativeWorks','CommercialUse'],
    requires: ['Notice','Attribution'],
    prohibits: ['HighIncomeNationUse']
};
gLicense['cc-sampling-10'] = {
    name: 'Creative Commons Sampling License 1.0',
    canonicalurl: 'http://creativecommons.org/licenses/sampling/1.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','DerivativeWorks','CommercialUse'],
    requires: ['Attribution','Notice'],
    prohibits: []
};
gLicense['cc-sampling+-10'] = {
    name: 'Creative Commons Sampling Plus License 1.0',
    canonicalurl: 'http://creativecommons.org/licenses/sampling+/1.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','DerivativeWorks','Sharing','CommercialUse'],
    requires: ['Attribution','Notice'],
    prohibits: []
};
gLicense['cc-nc-sampling+-10'] = {
    name: 'Creative Commons NonCommercial Sampling Plus License 1.0',
    canonicalurl: 'http://creativecommons.org/licenses/nc-sampling+/1.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','DerivativeWorks','Distribution'],
    requires: ['Attribution','Notice'],
    prohibits: ['CommercialUse']
};
gLicense['cc-sa-10'] = {
    name: 'Creative Commons ShareAlike License 1.0',
    canonicalurl: 'http://creativecommons.org/licenses/sa/1.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','DerivativeWorks','CommercialUse'],
    requires: ['Notice','ShareAlike'],
    prohibits: []
};
gLicense['cc-nc-sa-10'] = {
    name: 'Creative Commons NonCommercial ShareAlike License 1.0',
    canonicalurl: 'http://creativecommons.org/licenses/nc-sa/1.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','DerivativeWorks'],
    requires: ['Notice','ShareAlike'],
    prohibits: ['CommercialUse']
};
gLicense['cc-nc-10'] = {
    name: 'Creative Commons NonCommercial License 1.0',
    canonicalurl: 'http://creativecommons.org/licenses/nc/1.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','DerivativeWorks'],
    requires: ['Notice'],
    prohibits: ['CommercialUse']
};
gLicense['cc-nd-nc-10'] = {
    name: 'Creative Commons NoDerivs-NonCommercial License 1.0',
    canonicalurl: 'http://creativecommons.org/licenses/nd-nc/1.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution'],
    requires: ['Notice'],
    prohibits: ['CommercialUse','DerivativeWorks']
};
gLicense['cc-nd-10'] = {
    name: 'Creative Commons NoDerivs License 1.0',
    canonicalurl: 'http://creativecommons.org/licenses/nd/1.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','CommercialUse'],
    requires: ['Notice'],
    prohibits: ['DerivativeWorks']
};
gLicense['cc-by-20'] = {
    name: 'Creative Commons Attribution License 2.0',
    canonicalurl: 'http://creativecommons.org/licenses/by/2.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','DerivativeWorks','CommercialUse'],
    requires: ['Notice','Attribution'],
    prohibits: []
};
gLicense['cc-by-nd-20'] = {
    name: 'Creative Commons Attribution-NoDerivs License 2.0',
    canonicalurl: 'http://creativecommons.org/licenses/by-nd/2.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','CommercialUse'],
    requires: ['Notice','Attribution'],
    prohibits: ['DerivativeWorks']
};
gLicense['cc-by-nc-nd-20'] = {
    name: 'Creative Commons Attribution-NonCommercial-NoDerivs License 2.0',
    canonicalurl: 'http://creativecommons.org/licenses/by-nc-nd/2.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution'],
    requires: ['Notice','Attribution'],
    prohibits: ['CommercialUse','DerivativeWorks']
};
gLicense['cc-by-nc-20'] = {
    name: 'Creative Commons Attribution-NonCommercial License 2.0',
    canonicalurl: 'http://creativecommons.org/licenses/by-nc/2.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','DerivativeWorks'],
    requires: ['Notice','Attribution'],
    prohibits: ['CommercialUse']
};
gLicense['cc-by-nc-sa-20'] = {
    name: 'Creative Commons Attribution-NonCommercial-ShareAlike License 2.0',
    canonicalurl: 'http://creativecommons.org/licenses/by-nc-sa/2.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','DerivativeWorks'],
    requires: ['Notice','Attribution','ShareAlike'],
    prohibits: ['CommercialUse']
};
gLicense['cc-by-sa-20'] = {
    name: 'Creative Commons Attribution-ShareAlike License 2.0',
    canonicalurl: 'http://creativecommons.org/licenses/by-sa/2.0/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','DerivativeWorks','CommercialUse'],
    requires: ['Notice','Attribution','ShareAlike'],
    prohibits: []
};
gLicense['cc-by-25'] = {
    name: 'Creative Commons Attribution License 2.5',
    canonicalurl: 'http://creativecommons.org/licenses/by/2.5/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','DerivativeWorks','CommercialUse'],
    requires: ['Notice','Attribution'],
    prohibits: []
};
gLicense['cc-by-nd-25'] = {
    name: 'Creative Commons Attribution-NoDerivs License 2.5',
    canonicalurl: 'http://creativecommons.org/licenses/by-nd/2.5/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','CommercialUse'],
    requires: ['Notice','Attribution'],
    prohibits: ['DerivativeWorks']
};
gLicense['cc-by-nc-nd-25'] = {
    name: 'Creative Commons Attribution-NonCommercial-NoDerivs License 2.5',
    canonicalurl: 'http://creativecommons.org/licenses/by-nc-nd/2.5/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution'],
    requires: ['Notice','Attribution'],
    prohibits: ['CommercialUse','DerivativeWorks']
};
gLicense['cc-by-nc-25'] = {
    name: 'Creative Commons Attribution-NonCommercial License 2.5',
    canonicalurl: 'http://creativecommons.org/licenses/by-nc/2.5/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','DerivativeWorks'],
    requires: ['Notice','Attribution'],
    prohibits: ['CommercialUse']
};
gLicense['cc-by-nc-sa-25'] = {
    name: 'Creative Commons Attribution-NonCommercial-ShareAlike License 2.5',
    canonicalurl: 'http://creativecommons.org/licenses/by-nc-sa/2.5/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','DerivativeWorks'],
    requires: ['Notice','Attribution','ShareAlike'],
    prohibits: ['CommercialUse']
};
gLicense['cc-by-sa-25'] = {
    name: 'Creative Commons Attribution-ShareAlike License 2.5',
    canonicalurl: 'http://creativecommons.org/licenses/by-sa/2.5/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false,
    permits: ['Reproduction','Distribution','DerivativeWorks','CommercialUse'],
    requires: ['Notice','Attribution','ShareAlike'],
    prohibits: []
};
gLicense['afl-21'] = {
    name: 'Academic Free License 2.1',
    canonicalurl: 'http://www.opensource.org/licenses/afl-2.1.php',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['afl-20'] = {
    name: 'Academic Free License 2.0',
    canonicalurl: 'http://www.opensource.org/licenses/afl-2.0.php',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['afl-12'] = {
    name: 'Academic Free License 1.2',
    canonicalurl: 'http://www.opensource.org/licenses/academic.php',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['afl-11'] = {
    name: 'Academic Free License 1.1',
    canonicalurl: 'http://www.opensource.org/licenses/afl-1.1.txt',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['apl-10'] = {
    name: 'Adaptive Public License',
    canonicalurl: 'http://www.opensource.org/licenses/apl1.0.php',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['asl-10'] = {
    name: 'Apache Software License 1.0',
    canonicalurl: 'http://www.apache.org/licenses/LICENSE-1.0',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['asl-11'] = {
    name: 'Apache Software License 1.1',
    canonicalurl: 'http://www.apache.org/licenses/LICENSE-1.1',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['asl-20'] = {
    name: 'Apache Software License 2.0',
    canonicalurl: 'http://www.apache.org/licenses/LICENSE-2.0',
    fsffree: true,
    gplcompat: false, /* see http://www.apache.org/licenses/GPL-compatibility.html */
    osiapproved: true,
    dfsgfree: true /* see http://www.debian.org/legal/licenses/ */
}
gLicense['apple-20'] = {
    name: 'Apple Public Source License 2.0',
    canonicalurl: 'http://www.opensource.apple.com/apsl/2.0.html',
    fsffree: true,
    gplcompat: false, /* see http://www.gnu.org/philosophy/apsl.html */
    osiapproved: true,
    dfsgfree: false /* see http://www.debian.org/legal/licenses/ */
}
gLicense['apple-12'] = {
    name: 'Apple Public Source License 1.2',
    canonicalurl: 'http://www.opensource.apple.com/apsl/1.2.html',
    fsffree: false, /* see http://www.gnu.org/philosophy/historical-apsl.html */
    gplcompat: false,
    osiapproved: true,
    dfsgfree: false /* see http://www.debian.org/legal/licenses/ */
}
gLicense['apple-11'] = {
    name: 'Apple Public Source License 1.1',
    canonicalurl: 'http://www.opensource.apple.com/apsl/1.1.html',
    fsffree: false, /* see http://www.gnu.org/philosophy/historical-apsl.html */
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false /* see http://www.debian.org/legal/licenses/ */
}
gLicense['apple-10'] = {
    name: 'Apple Public Source License 1.0',
    canonicalurl: 'http://www.opensource.apple.com/apsl/1.0.html',
    fsffree: false, /* see http://www.gnu.org/philosophy/historical-apsl.html */
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false /* see http://www.debian.org/legal/licenses/ */
}
gLicense['art-20b4'] = {
    name: 'Artistic License 2.0beta4',
    canonicalurl: 'http://dev.perl.org/perl6/rfc/346.html',
    fsffree: true,
    gplcompat: true,
    osiapproved: true,
    dfsgfree: true /* see http://www.debian.org/legal/licenses/ */
}
gLicense['attr'] = {
    name: 'Attribution Assurance License',
    canonicalurl: 'http://www.opensource.org/licenses/attribution.php',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['bsd-mod'] = {
    name: 'Modified BSD License',
    canonicalurl: 'http://www.opensource.org/licenses/bsd-license.php',
    fsffree: true,
    gplcompat: true,
    osiapproved: true,
    dfsgfree: true /* see http://www.debian.org/legal/licenses/ */
}
gLicense['bsd-orig'] = {
    name: 'Original BSD License',
    canonicalurl: 'http://www.xfree86.org/3.3.6/COPYRIGHT2.html#6',
    fsffree: true,
    gplcompat: false,
    osiapproved: unknown,
    dfsgfree: unknown
}
gLicense['catosl-11'] = {
    name: 'Computer Associates Trusted Open Source License 1.1',
    canonicalurl: 'http://www.opensource.org/licenses/ca-tosl1.1.php',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['cddl-10'] = {
    name: 'Common Development and Distribution License 1.0',
    canonicalurl: 'http://www.sun.com/cddl/cddl.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: false /* see http://people.debian.org/~asuffield/licenses/cddl/summary.html */
}
gLicense['cpl-10'] = {
    name: 'Common Public License 1.0',
    canonicalurl: 'http://www-128.ibm.com/developerworks/opensource/library/os-beehive/os-cpl.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: unknown /* see http://lists.debian.org/debian-legal/2004/05/thrd2.html#00597 */
}
gLicense['cuaopl-10'] = {
    name: 'CUA Office Public License 1.0',
    canonicalurl: 'http://www.opensource.org/licenses/cuaoffice.php',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['eudatagrid'] = {
    name: 'EU DataGride Software License',
    canonicalurl: 'http://www.opensource.org/licenses/eudatagrid.php',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['epl-10'] = {
    name: 'Eclipse Public License 1.0',
    canonicalurl: 'http://www.eclipse.org/legal/epl-v10.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['ecl-10'] = {
    name: 'Educational Community License 1.0',
    canonicalurl: 'http://www.boson2x.org/article.php3?id_article=131',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['efl-10'] = {
    name: 'Eiffel Forum License 1.0',
    canonicalurl: 'http://www.opensource.org/licenses/eiffel.php',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['efl-20'] = {
    name: 'Eiffel Forum License 2.0',
    canonicalurl: 'http://www.eiffel-nice.org/license/eiffel-forum-license-2.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: true /* see http://lists.debian.org/debian-legal/2004/11/msg00122.html */
}
gLicense['ent-10'] = {
    name: 'Entessa Public License 1.0',
    canonicalurl: 'http://www.opensource.org/licenses/entessa.php',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['fair'] = {
    name: 'Fair License',
    canonicalurl: 'http://opensource.org/licenses/fair.php',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown  /* see http://lists.debian.org/debian-legal/2005/05/threads.html#00013 */
}
gLicense['fol-10'] = {
    name: 'Frameworx Open License 1.0',
    canonicalurl: 'http://www.opensource.org/licenses/frameworx.php',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['hist'] = {
    name: 'Historical Permission Notice and Disclaimer',
    canonicalurl: 'http://www.opensource.org/licenses/historical.php',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['ipl-10'] = {
    name: 'IBM Public License 1.0',
    canonicalurl: 'http://www-128.ibm.com/developerworks/library/os-ipl.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: unknown /* see http://lists.debian.org/debian-legal/2004/05/thrd2.html#00597 */
}
gLicense['intel'] = {
    name: 'Intel Open Source License',
    canonicalurl: 'http://www.intel.com/technology/computing/lfm/license.htm',
    fsffree: true,
    gplcompat: true,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['josl-10'] = {
    name: 'Jabber Open Source License 1.0',
    canonicalurl: 'http://www.jabber.org/about/josl.shtml',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: true /* see http://packages.debian.org/unstable/net/jabber */
}
gLicense['plan9-10'] = {
    name: 'Lucent Public License 1.0',
    canonicalurl: 'http://www.opensource.org/licenses/plan9.php',
    fsffree: false,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['plan9-102'] = {
    name: 'Lucent Public License 1.02',
    canonicalurl: 'http://www.cs.bell-labs.com/plan9dist/license.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['mit'] = {
    name: 'MIT License',
    canonicalurl: 'http://www.opensource.org/licenses/mit-license.php',
    fsffree: true,
    gplcompat: true,
    osiapproved: true,
    dfsgfree: true /* see http://www.debian.org/legal/licenses/ */
}
gLicense['cvw'] = {
    name: 'Collaborative Virtual Workspace License',
    canonicalurl: 'http://cvw.mitre.org/cvw/licenses/source/license.html',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['moto-091'] = {
    name: 'Motosoto Open Source License',
    canonicalurl: 'http://www.opensource.org/licenses/motosoto.php',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['mpl-10'] = {
    name: 'Mozilla Public License 1.0',
    canonicalurl: 'http://www.mozilla.org/MPL/MPL-1.0.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: false /* see http://lists.debian.org/debian-legal/2004/06/threads.html#00221 */
}
gLicense['mpl-11'] = {
    name: 'Mozilla Public License 1.1',
    canonicalurl: 'http://www.mozilla.org/MPL/MPL-1.1.html',
    fsffree: true,
    gplcompat: false, /* can be made compatible, see http://www.gnu.org/philosophy/license-list.html#MPL */
    osiapproved: true,
    dfsgfree: false /* see http://lists.debian.org/debian-legal/2004/06/threads.html#00221 */
}
gLicense['nasa-13'] = {
    name: 'NASA Open Source Agreement 1.3',
    canonicalurl: 'http://opensource.arc.nasa.gov/pdf/NASA_Open_Source_Agreement_1.3.txt',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['naumen'] = {
    name: 'NAUMEN Public License',
    canonicalurl: 'http://www.opensource.org/licenses/naumen.php',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['nethack'] = {
    name: 'Nethack General Public License',
    canonicalurl: 'http://www.nethack.org/common/license.html',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: true /* see http://packages.debian.org/stable/games/nethack */
}
gLicense['nokia-10a'] = {
    name: 'Nokia Open Source License 1.0a',
    canonicalurl: 'http://www.opensource.org/licenses/nokia.php',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: false /* see http://lists.debian.org/debian-legal/2003/09/msg00136.html */
}
gLicense['oclc-2'] = {
    name: 'OCLC Research Public License 2.0',
    canonicalurl: 'http://www.oclc.org/research/software/license/default.htm',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['opengroup'] = {
    name: 'Open Group Directory Test Suite License',
    canonicalurl: 'http://www.opengroup.org/dif/blitspub/license.htm',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: false /* see http://lists.debian.org/debian-legal/2005/07/msg00318.html */
}
gLicense['osl-21'] = {
    name: 'Open Software License 2.1',
    canonicalurl: 'http://www.opensource.org/licenses/osl-2.1.php',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: false /* see http://lists.debian.org/debian-legal/2004/09/msg00220.html */
}
gLicense['php-3'] = {
    name: 'PHP License 3.0',
    canonicalurl: 'http://www.php.net/license/3_0.txt',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: true /* see http://www.debian.org/legal/licenses/ */
}
gLicense['py-cwi'] = {
    name: 'CWI License',
    canonicalurl: 'http://www.python.org/doc/Copyright.html',
    fsffree: true,
    gplcompat: true,
    osiapproved: false, /* only because no one ever bothered */
    dfsgfree: true
}
gLicense['py-cnri'] = {
    name: 'CNRI Open Source License',
    canonicalurl: 'http://www.handle.net/python_licenses/python1.6_9-5-00.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: true
}
gLicense['py-beopen'] = {
    name: 'BeOpen Python Open Source License Agreement 1.0',
    canonicalurl: 'http://www.python.org/2.0/license.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: true
}
gLicense['py-psf'] = {
    name: 'Python Software Foundation License',
    canonicalurl: 'http://www.opensource.org/licenses/PythonSoftFoundation.php',
    fsffree: true,
    gplcompat: true,
    osiapproved: true,
    dfsgfree: true /* see http://www.debian.org/legal/licenses/ */
}
gLicense['qpl-10'] = {
    name: 'Q Public License 1.0',
    canonicalurl: 'http://www.trolltech.com/licenses/qpl.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: false /* see http://lists.debian.org/debian-legal/2004/07/msg00157.html */
}
gLicense['rpsl-10'] = {
    name: 'RealNetworks Public Source License 1.0',
    canonicalurl: 'https://helixcommunity.org/content/rpsl',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: false /* see http://lists.debian.org/debian-legal/2003/02/msg00082.html */
}
gLicense['recip-11'] = {
    name: 'Repicropal Public License',
    canonicalurl: 'http://www.opensource.org/licenses/rpl.php',
    fsffree: false,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['ricoh-10'] = {
    name: 'Ricoh Source Code Public License 1.0',
    canonicalurl: 'http://www.risource.org/RPL/RPL-1.0A.shtml',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['sleepy'] = {
    name: 'Sleepycat License',
    canonicalurl: 'http://www.sleepycat.com/docs/sleepycat/license.html',
    fsffree: true,
    gplcompat: true,
    osiapproved: true,
    dfsgfree: true /* see http://www.debian.org/legal/licenses/ */
}
gLicense['sissl-11'] = {
    name: 'Sun Industry Standards Source License 1.1',
    canonicalurl: 'http://www.openoffice.org/licenses/sissl_license.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['spl-10'] = {
    name: 'Sun Public License 1.0',
    canonicalurl: 'http://www.netbeans.org/about/legal/spl.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: false /* see http://lists.debian.org/debian-java/2005/08/msg00024.html and http://lists.debian.org/debian-legal/2004/06/msg00278.html */
}
gLicense['sybase-10'] = {
    name: ' Sybase Open Watcom Public License 1.0',
    canonicalurl: 'http://www.opensource.org/licenses/sybase.php',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['ncsa'] = {
    name: 'University of Illinois/NCSA Open Source License',
    canonicalurl: 'http://www.opensource.org/licenses/UoI-NCSA.php',
    fsffree: true,
    gplcompat: true,
    osiapproved: true,
    dfsgfree: true
}
gLicense['vsl-10'] = {
    name: 'Vovida Software License 1.0',
    canonicalurl: 'http://www.vovida.org/About/license.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: true /* see http://lists.debian.org/debian-legal/2001/01/msg00061.html */
}
gLicense['w3c'] = {
    name: 'W3C Software License',
    canonicalurl: 'http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231',
    fsffree: true,
    gplcompat: true,
    osiapproved: true,
    dfsgfree: true /* see http://lists.debian.org/debian-legal/2004/07/msg01696.html */
}
gLicense['wxwin'] = {
    name: 'wxWindows Library Licence',
    canonicalurl: 'http://www.wxwidgets.org/licence3.txt',
    fsffree: true,
    gplcompat: true, /* see http://www.wxwidgets.org/newlicen.htm */
    osiapproved: true,
    dfsgfree: true /* see http://lists.debian.org/debian-legal/2000/08/msg00089.html */
}
gLicense['xnet'] = {
    name: 'X.Net, Inc. License',
    canonicalurl: 'http://www.opensource.org/licenses/xnet.php',
    fsffree: unknown,
    gplcompat: unknown,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['zpl-11'] = {
    name: 'Zope Public License 1.1',
    canonicalurl: 'http://www.zope.org/Resources/License/ZPL-1.1',
    fsffree: true,
    gplcompat: false,
    osiapproved: true,
    dfsgfree: false /* see http://lists.debian.org/debian-legal/2001/09/msg00014.html */
}
gLicense['zpl-20'] = {
    name: 'Zope Public License 2.0',
    canonicalurl: 'http://www.zope.org/Resources/License/ZPL-2.0',
    fsffree: true,
    gplcompat: true,
    osiapproved: true,
    dfsgfree: unknown
}
gLicense['zlib'] = {
    name: 'zlib/libpng License',
    canonicalurl: 'http://www.gzip.org/zlib/zlib_license.html',
    fsffree: true,
    gplcompat: true,
    osiapproved: true,
    dfsgfree: true /* see http://packages.debian.org/testing/libs/zlib1g */
}
gLicense['openldap'] = {
    name: 'OpenLDAP Public License',
    canonicalurl: 'http://www.openldap.org/software/release/license.html',
    fsffree: true,
    gplcompat: true,
    osiapproved: false, /* only because no one has bothered */
    dfsgfree: true /* see http://packages.debian.org/stable/source/openldap2 */
}
gLicense['cryptix'] = {
    name: 'Cryptix General License',
    canonicalurl: 'http://www.cryptix.org/LICENSE.TXT',
    fsffree: true,
    gplcompat: true,
    osiapproved: false,
    dfsgfree: unknown
}
gLicense['smlnj'] = {
    name: 'Standard ML of New Jersey Copyright Notice, License, and Disclaimer',
    canonicalurl: 'http://www.smlnj.org/license.html',
    fsffree: true,
    gplcompat: true,
    osiapproved: false,
    dfsgfree: unknown
}
gLicense['ecos'] = {
    name: 'eCos License 2.0',
    canonicalurl: 'http://www.gnu.org/licenses/ecos-license.html',
    fsffree: true,
    gplcompat: true,
    osiapproved: false,
    dfsgfree: true /* see http://packages.debian.org/unstable/devel/ecos */
}
gLicense['vim'] = {
    name: 'Vim License',
    canonicalurl: 'http://www.vim.org/htmldoc/uganda.html',
    fsffree: true,
    gplcompat: true,
    osiapproved: false,
    dfsgfree: true /* see http://packages.debian.org/unstable/editors/vim */
}
gLicense['boost-10'] = {
    name: 'Boost Software License 1.0',
    canonicalurl: 'http://www.boost.org/LICENSE_1_0.txt',
    fsffree: true,
    gplcompat: true,
    osiapproved: false,
    dfsgfree: true /* see http://packages.debian.org/testing/source/boost */
}
gLicense['affero-10'] = {
    name: 'Affero General Public License 1.0',
    canonicalurl: 'http://www.affero.org/oagpl.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false /* see http://lists.debian.org/debian-legal/2005/06/msg00388.html */
}
gLicense['arphic'] = {
    name: 'Arphic Public License',
    canonicalurl: 'http://ftp.gnu.org/gnu/non-gnu/chinese-fonts-truetype/LICENSE',
    fsffree: true,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: true /* see http://packages.debian.org/testing/x11/ttf-arphic-bkai00mp */
}
gLicense['condor-11'] = {
    name: 'Condor Public License 1.1',
    canonicalurl: 'http://www.cs.wisc.edu/condor/condor-public-license.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: unknown
}
gLicense['openssl'] = {
    name: 'OpenSSL License',
    canonicalurl: 'http://www.openssl.org/source/license.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: true /* see http://packages.debian.org/stable/utils/openssl */
}
gLicense['phorum-20'] = {
    name: 'Phorum License 2.0',
    canonicalurl: 'http://www.phorum.org/license.txt',
    fsffree: true,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: unknown
}
gLicense['interbase-10'] = {
    name: 'Interbase Public License 1.0',
    canonicalurl: 'http://info.borland.com/devsupport/interbase/opensource/IPL.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: true /* see http://packages.debian.org/testing/source/firebird2 */
}
gLicense['npl-10'] = {
    name: 'Netscape Public License 1.0',
    canonicalurl: 'http://www.mozilla.org/MPL/NPL-1.0.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false
}
gLicense['vita'] = {
    name: 'Vita Nuova Liberal Source License',
    canonicalurl: 'http://www.vitanuova.com/inferno/liblicence.txt',
    fsffree: true,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: unknown
}
gLicense['sgi-11'] = {
    name: 'SGI Free Software License B 1.1',
    canonicalurl: 'http://oss.sgi.com/projects/FreeB/SGIFreeSWLicB.1.1.doc',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: true /* see http://packages.debian.org/unstable/source/pyopengl */
}
gLicense['scsl'] = {
    name: 'Sun Community Source License',
    canonicalurl: 'http://www.sun.com/software/communitysource/',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false
}
gLicense['utah'] = {
    name: 'University of Utah Research Foundation Public License',
    canonicalurl: 'http://www.cs.utah.edu/~gk/teem/txt/LICENSE.txt',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false
}
gLicense['aladdin'] = {
    name: 'Aladdin Free Public License',
    canonicalurl: 'http://www.cs.wisc.edu/~ghost/doc/cvs/Public.htm',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false
}
gLicense['scilab'] = {
    name: 'SCILAB License',
    canonicalurl: 'http://www.scilab.org/legal/license.html',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false
}
gLicense['jscl'] = {
    name: 'Jahia Collaborative Source License',
    canonicalurl: 'http://www.jahia.org/jahia/page145.html',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false
}
gLicense['ast'] = {
    name: 'ast Source Code Agreement',
    canonicalurl: 'http://www.research.att.com/sw/license/ast-open.html',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false
}
gLicense['shared'] = {
    name: 'Microsoft Shared Source License',
    canonicalurl: 'http://msdn.microsoft.com/msdn-files/027/001/901/ShSourceCLIbetaLicense.htm',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false
}
gLicense['freebsd-doc'] = {
    name: 'FreeBSD Documentation License',
    canonicalurl: 'http://www.freebsd.org/copyright/freebsd-doc-license.html',
    fsffree: true,
    gplcompat: true,
    osiapproved: false,
    dfsgfree: true
}
gLicense['apple-doc-10'] = {
    name: 'Common Documentation License 1.0',
    canonicalurl: 'http://www.opensource.apple.com/cdl/',
    fsffree: true,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: unknown
}
gLicense['openpub-10'] = {
    name: 'Open Publication License 1.0',
    canonicalurl: 'http://www.opencontent.org/openpub/',
    fsffree: true,
    gplcompat: unknown,
    osiapproved: false,
    dfsgfree: false /* see http://lists.debian.org/debian-legal/2004/02/msg00311.html */
}
gLicense['opencontent-10'] = {
    name: 'Open Content License 1.0',
    canonicalurl: 'http://opencontent.org/opl.shtml',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: unknown
}
gLicense['dmoz'] = {
    name: 'Open Directory License',
    canonicalurl: 'http://www.dmoz.org/license.html',
    fsffree: false,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: false
}
gLicense['dsl'] = {
    name: 'Design Science License',
    canonicalurl: 'http://www.gnu.org/licenses/dsl.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: true /* see http://packages.debian.org/stable/x11/fsviewer-icons */
}
gLicense['freeart-12'] = {
    name: 'Free Art License 1.2',
    canonicalurl: 'http://artlibre.org/licence/lalgb.html',
    fsffree: true,
    gplcompat: false,
    osiapproved: false,
    dfsgfree: true /* see http://packages.debian.org/testing/games/torcs-data-tracks */
}
gLicense['cecill-20'] = {
    name: 'CeCILL Free Software License',
    canonicalurl: 'http://www.cecill.info/licences/Licence_CeCILL_V2-en.html',
    fsffree: true,
    gplcompat: true,
    osiapproved: false,
    dfsgfree: unknown
}
//map

// standard utility methods
Array.prototype.contains = function(sString) {
    for (var i = 0; i < this.length; i++) {
	if (this[i] == sString) {
	    return true;
	}
    }
    return false;
}

Array.prototype.unique = function() {
    var arResults = [];
    var oDuplicates = {};
    for (var i = 0; i < this.length; i++) {
	var sKey = this[i];
	if (oDuplicates[sKey]) { continue; }
	arResults.push(sKey);
	oDuplicates[sKey] = 1;
    }
    return arResults;
}

String.prototype.replaceString = function(sOld, sNew) {
    var re = '';
    var arSpecialChars = ['\\', '[', ']', '(', ')', '.', '*', '+', '^', '$', '?', '|', '{', '}'];
    for (var i = 0; i < sOld.length; i++) {
	var c = sOld.charAt(i);
	if (arSpecialChars.contains(c)) {
	    re += '\\' + c;
	} else {
	    re += c;
	}
    }
    var oRegExp = new RegExp('(' + re + ')', 'gim');
    return this.replace(oRegExp, sNew);
}

String.prototype.lpad = function(cPadder, iMaxLen) {
    var s = this;
    for (var i = s.length; i < iMaxLen; i++) {
	s = cPadder + s;
    }
    return s;
}

String.prototype.endswith = function(sMatch) {
    var iPos = this.lastIndexOf(sMatch);
    return (iPos != -1 && (iPos == this.length - sMatch.length));
}

String.prototype.startswith = function(sMatch) {
    return this.indexOf(sMatch) == 0;
}

String.prototype.trim = function() {
    return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1");
}

String.prototype.normalize = function() {
    return this.replace(/\s+/g, ' ').trim();
}

String.prototype.substringBefore = function(sDelimeter) {
    var s = this;
    var iPos = s.indexOf(sDelimeter);
    if (iPos != -1) {
	s = s.substring(0, iPos);
    }
    return s;
}

String.prototype.substringAfterFirst = function(sDelimeter) {
    var s = this;
    var iPos = s.indexOf(sDelimeter);
    if (iPos != -1) {
	s = s.substring(iPos + sDelimeter.length);
    }
    return s;
}

String.prototype.substringAfterLast = function(sDelimeter) {
    var s = this;
    var iPos = s.lastIndexOf(sDelimeter);
    if (iPos != -1) {
	s = s.substring(iPos + sDelimeter.length);
    }
    return s;
}

String.prototype.containsAny = function(arKeywords) {
    var s = this.toLowerCase();
    for (var i = 0; i < arKeywords.length; i++) {
	var sKeyword = arKeywords[i].toLowerCase();
	if (s.indexOf(sKeyword) != -1) {
	    return true;
	}
    }
    return false;
}

function NSResolver(prefix) {
    return {'xhtml': 'http://www.w3.org/1999/xhtml'}[prefix];
}

function getPageLicenses() {
    var sPrefix = document.documentElement.namespaceURI ? 'xhtml:' : '';
    var elmPossible = document.evaluate("//" + sPrefix + "a[@rel][@href]",
        document, NSResolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
    var arLicenses = [];
    for (var i = 0; i < elmPossible.snapshotLength; i++) {
	var elm = elmPossible.snapshotItem(i);
	if (!elm.rel || !elm.href) { continue; }
	var sRel = elm.rel.toLowerCase().normalize();
	if ((sRel + ' ').indexOf('license ') == -1) { continue; }
	var urlLicense = elm.href.trim();
	var oLicense = gLicense[gLicenseUrl[urlLicense]] || gLicense['unknown'];
	if (!arLicenses.contains(oLicense)) {
	    arLicenses.push(oLicense);
	}
    }
    return arLicenses;
}

var arLicenses = getPageLicenses();
for (var i = 0; i < arLicenses.length; i++) {
    var oLicense = arLicenses[i];
    var s = document.location.href + '\nlicense: ' + oLicense.name;
    if (typeof oLicense.canonicalurl != 'undefined') {
	s += '\nurl: ' + oLicense.canonicalurl;
    }
    if (typeof oLicense.fsffree != 'undefined') {
	s += '\nFSF-free: ' + oLicense.fsffree.toString();
    }
    if (typeof oLicense.gplcompat != 'undefined') {
	s += '\nGPL-compatible: ' + oLicense.gplcompat.toString();
    }
    if (typeof oLicense.osiapproved != 'undefined') {
	s += '\nOSI-approved: ' + oLicense.osiapproved.toString();
    }
    if (typeof oLicense.dfsgfree != 'undefined') {
	s += '\nDFSG-free: ' + oLicense.dfsgfree.toString();
    }
    if (typeof oLicense.permits != 'undefined') {
	s += '\nPermits: ' + oLicense.permits.toString();
    }
    if (typeof oLicense.requires != 'undefined') {
	s += '\nRequires: ' + oLicense.requires.toString();
    }
    if (typeof oLicense.prohibits != 'undefined') {
	s += '\nProhibits: ' + oLicense.prohibits.toString();
    }
    GM_log(s);
}

// ---------------------------------------------------------------------
// Everything below this line is part of the unit testing harness
// ---------------------------------------------------------------------
function nextTest() {
    var elmNextTestLink = document.evaluate("//*[@rel='next test']", document, NSResolver, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
    if (!elmNextTestLink) { return; }
    var sNextTestURL = elmNextTestLink.href;
    if (!sNextTestURL) { return; }
    window.setTimeout(function() { window.location.href = sNextTestURL; }, 10);
}

var elmExpect = document.getElementById('expect');
if (elmExpect) {
    var sExpect = elmExpect.innerHTML;
    if (arLicenses.length == 0) {
	alert('license expected but none found');
    } else if (arLicenses[0].name != sExpect) {
	alert('-----found:\n\n' + arLicenses[0].name + '\n\n-----but expected:\n\n' + sExpect);
    } else {
	nextTest();
    }
} else {
    nextTest();
}

//
// ChangeLog
// 2005-10-11 - MAP - added unit tests, fixed XHTML compatibility issue
// 2005-10-02 - MAP - initial release
