MDL-12796 iplookup rewrite
authorskodak <skodak>
Wed, 2 Jan 2008 16:47:57 +0000 (16:47 +0000)
committerskodak <skodak>
Wed, 2 Jan 2008 16:47:57 +0000 (16:47 +0000)
36 files changed:
admin/settings/location.php
course/lib.php
iplookup/README.txt
iplookup/earth.jpeg [new file with mode: 0644]
iplookup/hostip/lib.php [deleted file]
iplookup/index.php
iplookup/ipatlas/COPYING [deleted file]
iplookup/ipatlas/MOODLECHANGES [deleted file]
iplookup/ipatlas/README [deleted file]
iplookup/ipatlas/README.MOODLE.txt [deleted file]
iplookup/ipatlas/countries.txt [deleted file]
iplookup/ipatlas/earth_620.jpg [deleted file]
iplookup/ipatlas/footer.inc [deleted file]
iplookup/ipatlas/hr.gif [deleted file]
iplookup/ipatlas/ip-atlas.css [deleted file]
iplookup/ipatlas/ip-atlas_prefs.php [deleted file]
iplookup/ipatlas/languages/messages.blank.inc [deleted file]
iplookup/ipatlas/languages/messages.it.inc [deleted file]
iplookup/ipatlas/lib.php [deleted file]
iplookup/ipatlas/plot.inc [deleted file]
iplookup/ipatlas/plot.php [deleted file]
iplookup/ipatlas/plotconf.inc [deleted file]
iplookup/ipatlas/plotimage.php [deleted file]
iplookup/ipatlas/reddot.gif [deleted file]
iplookup/ipatlas/translate.inc [deleted file]
iplookup/ipatlas/yellowdot.gif [deleted file]
iplookup/marker.gif [new file with mode: 0644]
lang/en_utf8/admin.php
lang/en_utf8/error.php
lib/geoip/ChangeLog.htm [new file with mode: 0644]
lib/geoip/README.htm [new file with mode: 0644]
lib/geoip/geoip.inc [new file with mode: 0644]
lib/geoip/geoipcity.inc [new file with mode: 0644]
lib/geoip/geoipregionvars.php [new file with mode: 0644]
theme/standard/styles_fonts.css
theme/standard/styles_layout.css

index 61fa071..1b91a21 100644 (file)
@@ -13,13 +13,9 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
     $options[0] = get_string('choose') .'...';
     $temp->add(new admin_setting_configselect('country', get_string('country', 'admin'), get_string('configcountry', 'admin'), 0, $options));
 
-    $iplookups = array();
-    if ($plugins = get_list_of_plugins('iplookup')) {
-        foreach ($plugins as $plugin) {
-            $iplookups[$plugin] = $plugin;
-        }
-    }
-    $temp->add(new admin_setting_configselect('iplookup', get_string('iplookup', 'admin'), get_string('configiplookup', 'admin'), 'hostip', $iplookups));
+    $temp->add(new admin_setting_heading('iplookup', get_string('iplookup', 'admin'), get_string('iplookupinfo', 'admin')));
+    $temp->add(new admin_setting_configfile('geoipfile', get_string('geoipfile', 'admin'), get_string('configgeoipfile', 'admin', $CFG->dataroot.'/geoip/'), $CFG->dataroot.'/geoip/GeoLiteCity.dat'));
+    $temp->add(new admin_setting_configtext('googlemapkey', get_string('googlemapkey', 'admin'), get_string('configgooglemapkey', 'admin', $CFG->wwwroot), ''));
 
     $ADMIN->add('location', $temp);
 
index 67c4662..250fb31 100644 (file)
@@ -530,14 +530,14 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per
         echo "<td class=\"cell c1\" align=\"right\">".userdate($log->time, '%a').
              ' '.userdate($log->time, $strftimedatetime)."</td>\n";
         echo "<td class=\"cell c2\">\n";
-        link_to_popup_window("/iplookup/index.php?ip=$log->ip&amp;user=$log->userid", 'iplookup',$log->ip, 400, 700);
+        link_to_popup_window("/iplookup/index.php?ip=$log->ip&amp;user=$log->userid", 'iplookup',$log->ip, 440, 700);
         echo "</td>\n";
         $fullname = fullname($log, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id)));
         echo "<td class=\"cell c3\">\n";
         echo "    <a href=\"$CFG->wwwroot/user/view.php?id={$log->userid}&amp;course={$log->course}\">$fullname</a>\n";
         echo "</td>\n";
         echo "<td class=\"cell c4\">\n";
-        link_to_popup_window( make_log_url($log->module,$log->url), 'fromloglive',"$log->module $log->action", 400, 600);
+        link_to_popup_window( make_log_url($log->module,$log->url), 'fromloglive',"$log->module $log->action", 440, 700);
         echo "</td>\n";;
         echo "<td class=\"cell c5\">{$log->info}</td>\n";
         echo "</tr>\n";
index 2a80b38..eb92351 100644 (file)
@@ -1,18 +1,25 @@
-iplookup 
---------
+iplookup info
+-------------
 
-These plugins will show you something about an IP address.
+1/ old plugins are not supported anymore
 
-Moodle scripts call the index.php in this directory like this:
-   
-   /iplookup/index.php?ip=222.222.222.222&user=1
+2/ general information in admin settings "Site Administration/Location/Location settings"
 
-Both parameters are optional, they default to the current user.
+3/ technical info:
 
-index.php loads the lib.php from a specified subdirectory 
-to actually display some sort of map or description.
+xplanet commadline
+  xplanet -projection rectangular -latitude 0.00  -longitude 0.00  -num_times 1  -geometry 620x310  -output earth.jpeg -quality 90 -config config.txt
 
-The current plugin is selected using $CFG->iplookup.
+config.txt
+  [earth]
+  shade=100
 
-Cheers,
-Martin
+original Earth map from:
+  http://www.radcyberzine.com/xglobe/
+
+marker.gif
+  custom made in Inkscape
+
+Petr Skoda (skodak), January 2008  
+
+$Id$
\ No newline at end of file
diff --git a/iplookup/earth.jpeg b/iplookup/earth.jpeg
new file mode 100644 (file)
index 0000000..411d59b
Binary files /dev/null and b/iplookup/earth.jpeg differ
diff --git a/iplookup/hostip/lib.php b/iplookup/hostip/lib.php
deleted file mode 100644 (file)
index 7460bea..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php  // $Id$
-       // Lookup a user using HostIP
-
-function iplookup_display($ip, $user=0) {
-
-    print_header();
-    if ($user) {
-        if ($user = get_record('user', 'id', $user)) {
-            print_heading(fullname($user).", $user->city, $user->country", 'center', '4');
-        }
-    }
-
-    echo 'Search results: <iframe src="http://www.hostip.info/api/get.html?ip='.$ip.'" height="60" width="300"></iframe>';
-
-    echo '<object data="http://www.hostip.info/map/frame.html?ip='.$ip.'" '.
-         'type="text/html" border="0" width="610" height="330"></object>';
-
-    close_window_button();
-    print_footer('none');
-}
-
-?>
index 68bd95f..7e75bd8 100644 (file)
 <?php // $Id$
-      // Do an IP lookup of a user, using selected plugin
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// NOTICE OF COPYRIGHT                                                   //
+//                                                                       //
+// Moodle - Modular Object-Oriented Dynamic Learning Environment         //
+//          http://moodle.org                                            //
+//                                                                       //
+// Copyright (C) 2008 onwards  Petr Skoda (skodak)                       //
+//                                                                       //
+// 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:                          //
+//                                                                       //
+//          http://www.gnu.org/copyleft/gpl.html                         //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
 
-    require('../config.php');
+require('../config.php');
+require_once($CFG->libdir.'/filelib.php');
+require_once($CFG->libdir.'/geoip/geoipcity.inc');
 
-    require_login();
+require_login();
 
-    $ip   = optional_param('ip', getremoteaddr());
-    $user = optional_param('user', $USER->id);
+$ip   = optional_param('ip', getremoteaddr(), PARAM_HOST);
+$user = optional_param('user', $USER->id, PARAM_INT);
 
-    if (empty($CFG->iplookup)) {
-        set_config('iplookup', 'hostip');
+if (isset($CFG->iplookup)) {
+    //clean up of old settings
+    set_config('iplookup', NULL);
+}
+
+$info = array($ip);
+$note = array();
+
+if (!preg_match('/(^\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/', $ip, $match)) {
+    print_error('invalidipformat', 'error');
+}
+
+if ($match[1] > 255 or $match[2] > 255 or $match[3] > 255 or $match[4] > 255) {
+    print_error('invalidipformat', 'error');
+}
+
+if ($match[1] == '127' or $match[1] == '10' or ($match[1] == '172' and $match[2] >= '16' and $match[2] <= '31') or ($match[1] == '192' and $match[2] == '168')) {
+    print_error('iplookupprivate', 'error');
+}
+
+if ($user) {
+    if ($user = get_record('user', 'id', $user, 'deleted', 0)) {
+        $info[] = fullname($user);
+    }
+}
+
+if (!empty($CFG->geoipfile) and file_exists($CFG->geoipfile)) {
+    $gi = geoip_open($CFG->geoipfile, GEOIP_STANDARD);
+    $location = geoip_record_by_addr($gi, $ip);
+    geoip_close($gi);
+
+    if (empty($location)) {
+        print_error('iplookupfailed', 'error', '', $ip);
     }
+    if (!empty($location->city)) {
+        $info[] = $location->city;
+    }
+
+    if (!empty($location->country_code)) {
+        $countries = get_list_of_countries();
+        if (isset($countries[$location->country_code])) {
+            // prefer our localized country names
+            $info[] = $countries[$location->country_code];
+        } else {
+            $info[] = $location->country_name;
+        }
+    }
+    $longitude = $location->longitude;
+    $latitude  = $location->latitude;
+    $note[] = get_string('iplookupmaxmindnote', 'admin');
+
+} else {
+    $ipdata = download_file_content('http://netgeo.caida.org/perl/netgeo.cgi?target='.$ip);
+    if ($ipdata === false) {
+        error('Can not connect to NetGeo server at http://netgeo.caida.org, please check proxy settings or better install MaxMind GeoLite City data file.');
+    }
+    $matches = null;
+    if (!preg_match('/LAT:\s*(-?\d+\.\d+)/s', $ipdata, $matches)) {
+        print_error('iplookupfailed', 'error', '', $ip);
+    }
+    $latitude  = (float)$matches[1];
+    if (!preg_match('/LONG:\s*(-?\d+\.\d+)/s', $ipdata, $matches)) {
+        print_error('iplookupfailed', 'error', '', $ip);
+    }
+    $longitude = (float)$matches[1];
+
+    if (preg_match('/CITY:\s*([^<]*)/', $ipdata, $matches)) {
+        if (!empty($matches[1])) {
+            $info[] = s($matches[1]);
+        }
+    }
+
+    if (preg_match('/COUNTRY:\s*([^<]*)/', $ipdata, $matches)) {
+        if (!empty($matches[1])) {
+            $countrycode = $matches[1];
+            $countries = get_list_of_countries();
+            if (isset($countries[$countrycode])) {
+                // prefer our localized country names
+                $info[] = $countries[$countrycode];
+            } else {
+                $info[] = $countrycode;
+            }
+        }
+    }
+    $note[] = get_string('iplookupnetgeonote', 'admin');
+}
+
+
+
+if (empty($CFG->googlemapkey)) {
+    $info = implode(' - ', $info);
+    $note = implode('<br />', $note);
+
+    $imgwidth  = 620;
+    $imgheight = 310;
+    $dotwidth  = 18;
+    $dotheight = 30;
+
+    $dx = round((($longitude + 180) * ($imgwidth / 360)) - $imgwidth - $dotwidth/2);
+    $dy = round((($latitude + 90) * ($imgheight / 180)));
+
+    print_header(get_string('iplookup', 'admin').': '.$info, $info);
+
+    echo '<div id="map" style="width:'.($imgwidth+$dotwidth).'px; height:'.$imgheight.'px;">';
+    echo '<img src="earth.jpeg" style="width:'.$imgwidth.'px; height:'.$imgheight.'px" alt="" />';
+    echo '<img src="marker.gif" style="width:'.$dotwidth.'px; height:'.$dotheight.'px; margin-left:'.$dx.'px; margin-bottom:'.$dy.'px;" alt="" />';
+    echo '</div>';
+    echo '<div id="note">'.$note.'</div>';
+    print_footer('empty');
+
+} else {
+    $info = implode(' - ', $info);
+    $note = implode('<br />', $note);
+
+    $meta = '
+<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key='.$CFG->googlemapkey.'" type="text/javascript"></script>
+<script type="text/javascript">
+
+//<![CDATA[
+
+function load() {
+  if (GBrowserIsCompatible()) {
+    var map = new GMap2(document.getElementById("map"));
+    map.addControl(new GSmallMapControl());
+    map.addControl(new GMapTypeControl());
+    var point = new GLatLng('.$latitude.', '.$longitude.');
+    map.setCenter(point, 4);
+    map.addOverlay(new GMarker(point));
+    map.setMapType(G_HYBRID_MAP);
+  }
+}
+
+//]]>
+</script>
+';
 
-    require("$CFG->dirroot/iplookup/$CFG->iplookup/lib.php");
+    print_header(get_string('iplookup', 'admin').': '.$info, $info, '', '', $meta, false, '&nbsp;', '', false, 'onload="load()" onunload="GUnload()"');
 
-    iplookup_display($ip, $user);
+    echo '<div id="map" style="width: 650px; height: 360px"></div>';
+    echo '<div id="note">'.$note.'</div>';
+    print_footer('empty');
+}
 
 ?>
diff --git a/iplookup/ipatlas/COPYING b/iplookup/ipatlas/COPYING
deleted file mode 100644 (file)
index d60c31a..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-                   GNU GENERAL PUBLIC LICENSE
-                      Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                           Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-\f
-                   GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-\f
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-\f
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-\f
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                           NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                    END OF TERMS AND CONDITIONS
-\f
-           How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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 should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year  name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/iplookup/ipatlas/MOODLECHANGES b/iplookup/ipatlas/MOODLECHANGES
deleted file mode 100644 (file)
index 1bba99f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-To make this program fit into Moodle, I:
-
- - deleted the black and white earth image
- - modified plotconf.inc slightly to use Moodle configs
- - modified plot.php slightly to use Moodle's background colour
-
-Martin Dougiamas, 26/8/2002
diff --git a/iplookup/ipatlas/README b/iplookup/ipatlas/README
deleted file mode 100644 (file)
index 1487d25..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-IP-Atlas version 1.0
--=----=-
-
-Description
------------
-This script uses NetGeo to plot a host on the globe.
-
-Requirements
-------------
-PHP 4 and GD (Optional).
-
-The GD library is available at http://www.boutell.com/gd/ and PHP is at
-http://www.php.net/
-
-Installation
-------------
-Put these files somewhere on your webserver, and point your browser to plot.php
-
-Note: You can symlink "ln -s plot.php index.php" if you need to. If you 
-have any problems running it, send an email to ivan@xpenguin.com
-
-Configuration
--------------
-All options can be edited in plotconf.inc. 
-
-If you want to integrate IP-Atlas into your website, open up plot.php and
-ip-atlas_prefs.php and edit the parts where it starts writing the html
-(find for "<html>") and where it ends (</html>). You should replace theses
-with your site template headers/footers.
-
-You can create a new language file for IP-Atlas if you follow the directions
-inside any language file in the languages/ directory.
-
-If you create a new language file, please email it to ivan@xpenguin.com so 
-it can be included in the next version.
-
-Bugs
-----
-1. The famous windows bug (also happens in other cirumstances)
-
-If nothing appears when running the script on windows, open up plotconf.inc
-and change the $trygd variable to "0".
-
-Contributions
--------------
-Thanks to Sten Kalenda (sten@ipjam.com) for adding security features and 
-cleaning up the code.
-
-Thanks to Armin Kunaschik (Armin.Kunaschik@varetis.de) for his proxy patch 
-that enables this program to run behind a firewall.
-
-Thanks to Daniel Quinlan (daniel@chaosengine.net) for a patch that fixes
-many problems on windows.
-
-Also thanks to many users for reporting bugs.
-
-Copyright
----------
-IP-Atlas is Copyright (c) 2002 Ivan Kozik, and can be redistributed under 
-the GPL.
diff --git a/iplookup/ipatlas/README.MOODLE.txt b/iplookup/ipatlas/README.MOODLE.txt
deleted file mode 100644 (file)
index 31e5835..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-The database for this is REALLY old now and this service is 
-next to useless.
-
-Included here for backward compatibility.
diff --git a/iplookup/ipatlas/countries.txt b/iplookup/ipatlas/countries.txt
deleted file mode 100644 (file)
index d827611..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-AD   Andorra
-AE   United Arab Emirates
-AF   Afghanistan
-AG   Antigua and Barbuda
-AI   Anguilla
-AL   Albania
-AM   Armenia
-AN   Netherlands Antilles
-AO   Angola
-AQ   Antarctica
-AR   Argentina
-AS   American Samoa
-AT   Austria
-AU   Australia
-AW   Aruba
-AZ   Azerbaijan
-BA   Bosnia and Herzegovina
-BB   Barbados
-BD   Bangladesh
-BE   Belgium
-BF   Burkina Faso
-BG   Bulgaria
-BH   Bahrain
-BI   Burundi
-BJ   Benin
-BM   Bermuda
-BN   Brunei Darussalam
-BO   Bolivia
-BR   Brazil
-BS   Bahamas
-BT   Bhutan
-BV   Bouvet Island
-BW   Botswana
-BY   Belarus
-BZ   Belize
-CA   Canada
-CC   Cocos (Keeling) Islands
-CF   Central African Republic
-CG   Congo
-CH   Switzerland
-CI   Cote D'Ivoire (Ivory Coast)
-CK   Cook Islands
-CL   Chile
-CM   Cameroon
-CN   China
-CO   Colombia
-CR   Costa Rica
-CS   Czechoslovakia (former)
-CU   Cuba
-CV   Cape Verde
-CX   Christmas Island
-CY   Cyprus
-CZ   Czech Republic
-DE   Germany
-DJ   Djibouti
-DK   Denmark
-DM   Dominica
-DO   Dominican Republic
-DZ   Algeria
-EC   Ecuador
-EE   Estonia
-EG   Egypt
-EH   Western Sahara
-ER   Eritrea
-ES   Spain
-ET   Ethiopia
-FI   Finland
-FJ   Fiji
-FK   Falkland Islands (Malvinas)
-FM   Micronesia
-FO   Faroe Islands
-FR   France
-FX   France, Metropolitan
-GA   Gabon
-GB   Great Britain (UK)
-GD   Grenada
-GE   Georgia
-GF   French Guiana
-GH   Ghana
-GI   Gibraltar
-GL   Greenland
-GM   Gambia
-GN   Guinea
-GP   Guadeloupe
-GQ   Equatorial Guinea
-GR   Greece
-GS   S. Georgia and S. Sandwich Isls.
-GT   Guatemala
-GU   Guam
-GW   Guinea-Bissau
-GY   Guyana
-HK   Hong Kong
-HM   Heard and McDonald Islands
-HN   Honduras
-HR   Croatia (Hrvatska)
-HT   Haiti
-HU   Hungary
-ID   Indonesia
-IE   Ireland
-IL   Israel
-IN   India
-IO   British Indian Ocean Territory
-IQ   Iraq
-IR   Iran
-IS   Iceland
-IT   Italy
-JM   Jamaica
-JO   Jordan
-JP   Japan
-KE   Kenya
-KG   Kyrgyzstan
-KH   Cambodia
-KI   Kiribati
-KM   Comoros
-KN   Saint Kitts and Nevis
-KP   Korea (North)
-KR   Korea (South)
-KW   Kuwait
-KY   Cayman Islands
-KZ   Kazakhstan
-LA   Laos
-LB   Lebanon
-LC   Saint Lucia
-LI   Liechtenstein
-LK   Sri Lanka
-LR   Liberia
-LS   Lesotho
-LT   Lithuania
-LU   Luxembourg
-LV   Latvia
-LY   Libya
-MA   Morocco
-MC   Monaco
-MD   Moldova
-MG   Madagascar
-MH   Marshall Islands
-MK   Macedonia
-ML   Mali
-MM   Myanmar
-MN   Mongolia
-MO   Macau
-MP   Northern Mariana Islands
-MQ   Martinique
-MR   Mauritania
-MS   Montserrat
-MT   Malta
-MU   Mauritius
-MV   Maldives
-MW   Malawi
-MX   Mexico
-MY   Malaysia
-MZ   Mozambique
-NA   Namibia
-NC   New Caledonia
-NE   Niger
-NF   Norfolk Island
-NG   Nigeria
-NI   Nicaragua
-NL   Netherlands
-NO   Norway
-NP   Nepal
-NR   Nauru
-NT   Neutral Zone
-NU   Niue
-NZ   New Zealand (Aotearoa)
-OM   Oman
-PA   Panama
-PE   Peru
-PF   French Polynesia
-PG   Papua New Guinea
-PH   Philippines
-PK   Pakistan
-PL   Poland
-PM   St. Pierre and Miquelon
-PN   Pitcairn
-PR   Puerto Rico
-PT   Portugal
-PW   Palau
-PY   Paraguay
-QA   Qatar
-RE   Reunion
-RO   Romania
-RU   Russian Federation
-RW   Rwanda
-SA   Saudi Arabia
-Sb   Solomon Islands
-SC   Seychelles
-SD   Sudan
-SE   Sweden
-SG   Singapore
-SH   St. Helena
-SI   Slovenia
-SJ   Svalbard and Jan Mayen Islands
-SK   Slovak Republic
-SL   Sierra Leone
-SM   San Marino
-SN   Senegal
-SO   Somalia
-SR   Suriname
-ST   Sao Tome and Principe
-SU   USSR (former)
-SV   El Salvador
-SY   Syria
-SZ   Swaziland
-TC   Turks and Caicos Islands
-TD   Chad
-TF   French Southern Territories
-TG   Togo
-TH   Thailand
-TJ   Tajikistan
-TK   Tokelau
-TM   Turkmenistan
-TN   Tunisia
-TO   Tonga
-TP   East Timor
-TR   Turkey
-TT   Trinidad and Tobago
-TV   Tuvalu
-TW   Taiwan
-TZ   Tanzania
-UA   Ukraine
-UG   Uganda
-UK   United Kingdom
-UM   US Minor Outlying Islands
-US   United States
-UY   Uruguay
-UZ   Uzbekistan
-VA   Vatican City State (Holy See)
-VC   Saint Vincent and the Grenadines
-VE   Venezuela
-VG   Virgin Islands (British)
-VI   Virgin Islands (U.S.)
-VN   Viet Nam
-VU   Vanuatu
-WF   Wallis and Futuna Islands
-WS   Samoa
-YE   Yemen
-YT   Mayotte
-YU   Yugoslavia
-ZA   South Africa
-ZM   Zambia
-ZR   Zaire
-ZW   Zimbabwe
diff --git a/iplookup/ipatlas/earth_620.jpg b/iplookup/ipatlas/earth_620.jpg
deleted file mode 100644 (file)
index fcb2743..0000000
Binary files a/iplookup/ipatlas/earth_620.jpg and /dev/null differ
diff --git a/iplookup/ipatlas/footer.inc b/iplookup/ipatlas/footer.inc
deleted file mode 100644 (file)
index 3f611ca..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<img src="hr.gif" width="100%" height="2" vspace="2">
-<table align="right" width="100%" cellpadding="0" cellspacing="0" border="0">
-<tr><td align="right" width="100%"><a href="http://www.xpenguin.com/ip-atlas.php">IP-Atlas</a> <?php echo $version; ?></td></tr>
-</table>
diff --git a/iplookup/ipatlas/hr.gif b/iplookup/ipatlas/hr.gif
deleted file mode 100644 (file)
index 56203a0..0000000
Binary files a/iplookup/ipatlas/hr.gif and /dev/null differ
diff --git a/iplookup/ipatlas/ip-atlas.css b/iplookup/ipatlas/ip-atlas.css
deleted file mode 100644 (file)
index a00970d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-A:link        { font-weight: bold; text-decoration: none; color: #005177; }
-A:visited     { text-decoration: none; color: #005177; font-weight: bold; }
-A:hover       { text-decoration: underline;  }
-BODY          { font-family: Verdana, Helvetica, Arial, sans-serif; font-size:12px; }
-TD            { font-family: Verdana, Helvetica, Arial, sans-serif; color: #000000; font-size: 12px; }
diff --git a/iplookup/ipatlas/ip-atlas_prefs.php b/iplookup/ipatlas/ip-atlas_prefs.php
deleted file mode 100644 (file)
index 589ba98..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-<?php  
-
-include("plotconf.inc"); 
-include("plot.inc"); 
-
-if (isset($HTTP_GET_VARS["lastquery"])){
-    $HTTP_GET_VARS["lastquery"] = clean_param($HTTP_GET_VARS["lastquery"], PARAM_HOST);
-}
-
-?>
-<?php
-
- if(shouldrun($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) { 
-   $drawmode = "GD";
- } else {
-   $drawmode = "CSS";
- }
-
-if(isset($HTTP_POST_VARS["button"])) {
-
-// cleanup post data
-$HTTP_POST_VARS["shape"]      = clean_param($HTTP_POST_VARS["shape"], PARAM_ALPHA);
-$HTTP_POST_VARS["color"]      = clean_param($HTTP_POST_VARS["color"], PARAM_ALPHA);
-$HTTP_POST_VARS["color"]      = clean_param($HTTP_POST_VARS["size"],  PARAM_INT);
-$HTTP_POST_VARS["earthimage"] = clean_param($HTTP_POST_VARS["earthimage"], PARAM_FILE);
-$HTTP_POST_VARS["cssdot"]      = clean_param($HTTP_POST_VARS["cssdot"], PARAM_FILE);
-$HTTP_POST_VARS["seldrawmode"] = clean_param($HTTP_POST_VARS["seldrawmode"],PARAM_ALPHA);
-// unset the earth image if we don't have it in our list
- if (!in_array($HTTP_POST_VARS["earthimage"],$earthimages)) {
-     unset($HTTP_POST_VARS["earthimage"]);
- }
-
-
-// save data from the POST
-setcookie ("atlasprefs", "", time() - 36000000);
-setcookie ("atlasprefs", "$HTTP_POST_VARS[shape]:$HTTP_POST_VARS[color]:$HTTP_POST_VARS[size]:$HTTP_POST_VARS[earthimage]:$HTTP_POST_VARS[cssdot]:$HTTP_POST_VARS[seldrawmode]", time() + 36000000, $cookiepath);
-
-$setshape      = $HTTP_POST_VARS["shape"];
-$setcolor      = $HTTP_POST_VARS["color"];
-$setsize       = $HTTP_POST_VARS["size"];
-$setearthimage = $HTTP_POST_VARS["earthimage"];
-$setcssdot     = $HTTP_POST_VARS["cssdot"];
-$setseldrawmode = $HTTP_POST_VARS["seldrawmode"];
-
-
-
- if($setseldrawmode == "1") {
-   $drawmode = "GD";
- } else {
-   $drawmode = "CSS";
- }
-
-} elseif(isset($HTTP_COOKIE_VARS["atlasprefs"]) && validcookie($HTTP_COOKIE_VARS["atlasprefs"])) {
-// get data from the cookie
-@list($setshape, $setcolor, $setsize, $setearthimage, $setcssdot, $setseldrawmode) = split(":", $HTTP_COOKIE_VARS["atlasprefs"]);
-} else {
-$setshape = "Diamond";
-$setsize = "3";
-$setcolor = "red";
-$setearthimage = $earthimages[$defaultimage];
-$setcssdot = "reddot.gif";
-
-if(shouldrun($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) {
-  $setseldrawmode = 1;
-} else {
-  $setseldrawmode = 0;
-}
-
-// override old cookie if there is post data
-
- if(isset($HTTP_POST_VARS["seldrawmode"])) {
-   $setsetdrawmode = $HTTP_POST_VARS["seldrawmode"];
- }
-
-}
-
-?>
-
-<?php  # START HTML
- ?>
-
-<html><head><title><?php  echo t("IP-Atlas Preferences") ?></title>
-
-<!-- your head tags here -->
-<link rel="Stylesheet" href="ip-atlas.css">
-</head><body bgcolor="#ffffff">
-
-</head><body>
-
-<b><?php  echo t("IP-Atlas preferences"); ?></b> <?php  echo t("(cookie based)"); ?><br /><br />
-
-<?php
-if(isset($HTTP_POST_VARS["button"])) {
-print t("Your settings have been saved. You can now try"); ?> <a href="plot.php<?php  if(isset($HTTP_GET_VARS["lastquery"])) { echo "?address=$HTTP_GET_VARS[lastquery]"; } ?>"><?php  print t("plotting something.")."</a>"."<br /><br />";
-}
-
-
-?>
-
-<form action="ip-atlas_prefs.php<?php  if(isset($HTTP_GET_VARS["lastquery"])) { echo "?lastquery=$HTTP_GET_VARS[lastquery]"; } ?>" method="POST">
-
-<?php  if(istheregd()) {
-echo t("Draw mode (defaults guessed for your browser):"); 
-
-print "<br /><select name=\"seldrawmode\">";
-
-if(!isset($setseldrawmode)) {
-  if(shouldrun($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) {
-    $setseldrawmode = 1;
-  } else {
-    $setseldrawmode = 0;
-  }
-}
-
-if($setseldrawmode == "1") {
-  echo "<option value=\"1\" selected>GD";
-  echo "<option value=\"0\">CSS";
-} elseif($setseldrawmode == "0") {
-  echo "<option value=\"1\">GD";
-  echo "<option value=\"0\" selected>CSS";
-}
-
-print "</select><br /><br />";
-
-} else {
-
-  print "<input type=\"hidden\" name=\"seldrawmode\" value=\"0\" />";
-
-}
-
-?>
-
-<?php  echo t("Pointer Preferences (the dot that marks lat/lon):"); ?><br />
-<?php
-if($drawmode == "GD") {
-print '
-<input type="hidden" name="cssdot" value="reddot.gif" />
-
-<table><tr>
-
-<td>'.t("Shape:").'</td><td><select name="shape">
-';
-
-$shapes = array("Diamond", "Diamond Outline", "Square", "Square Outline", "Cross");
-foreach($shapes as $curshape) {
-
-if($setshape == $curshape) {
-print "<option value=\"$curshape\" selected>".t($curshape);
-} else {
-print "<option value=\"$curshape\">".t($curshape);
-}
-
-}
-
-print "</select></td></tr><tr><td>".t("Size:")."</td><td><select name=\"size\">";
-
-$sizes = array("2", "3", "4", "5", "6", "7", "8");
-foreach($sizes as $cursize) {
-
-if($setsize == $cursize) {
-print "<option value=\"$cursize\" selected>$cursize";
-} else {
-print "<option value=\"$cursize\">$cursize";
-}
-
-}
-
-print "</select></td></tr><tr><td>".t("Color:")."</td><td><select name=\"color\">";
-
-$colors = array("red", "white", "yellow", "magenta", "cyan", "green", "violet");
-foreach($colors as $curcolor) {
-
-if($setcolor == $curcolor) {
-print "<option value=\"$curcolor\" selected>".t($curcolor);
-} else {
-print "<option value=\"$curcolor\">".t($curcolor);
-}
-
-}
-
-print "
-</select></td></tr></table>
-";
-
-} elseif($drawmode == "CSS") {
-
-print t("Pointer:")." <select name=\"cssdot\">";
-
-foreach($cssdots as $curdot) {
-
-list($filename, $curdot, , ) = split(":", $curdot);
-
-if($setcssdot == $filename) {
-print "<option value=\"$filename\" selected>$curdot";
-} else {
-print "<option value=\"$filename\">$curdot";
-}
-
-}
-
-print "</select><br />";
-
-print '
-<input type="hidden" name="shape" value="Diamond" />
-<input type="hidden" name="color" value="Red" />
-<input type="hidden" name="size" value="3" />
-';
-
-}
-
-?>
-
-<br />
-
-
-
-<?php  echo t("Other Preferences:") ?><br />
-<?php  echo t("Earth Image:") ?>&nbsp;
-<select name="earthimage">
-
-<?php
-
-foreach($earthimages as $curentry) {
-
-list($curfile, $curname, , ) = split(":", $curentry);
-
-if($setearthimage == $curfile) {
-print "<option value=\"$curfile\" selected>$curname";
-} else {
-print "<option value=\"$curfile\">$curname";
-}
-
-}
-
-
-?>
-
-</select>
-<br /><br />
-<input type="Submit" name="button" value="<?php  echo t("Save") ?>">
-
-<div align="right">
-[ <a href="plot.php<?php  if(isset($HTTP_GET_VARS["lastquery"])) { echo "?address=$HTTP_GET_VARS[lastquery]"; } ?>"><?php  echo t("main") ?></a> ]<br /><br />
-</div>
-<?php  include("footer.inc"); ?>
-</body></html>
diff --git a/iplookup/ipatlas/languages/messages.blank.inc b/iplookup/ipatlas/languages/messages.blank.inc
deleted file mode 100644 (file)
index 11a5f78..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-<?php
-
-/*
-
-Blank Language File
-
-copy this language file from messages.blank.inc to
-messages.<country code>.inc.
-
-please email new language files to ivan@xpenguin.com
-copy a language file to messages.<cc>.inc and \
-edit what $p is on encountering an english phrase.
-
-please notice the punctuation and capitilization.
-
-change the $language variable in plotconf.inc after
-creating a language file.
-
-*/
-
-function lookup($phrase) {
-  switch($phrase) {
-
-    # start translating the $p here
-
-     case "Plotting" :
-     $p = ""; break;
-
-     case "preferences" :
-     $p = ""; break;
-
-     case "locate me" :
-     $p = ""; break;
-
-     case "IP/Hostname:" :
-     $p = ""; break;
-
-     case "You at" :
-     $p = ""; break;
-
-     case "Submit" :
-     $p = ""; break;
-
-     case "main" :
-     $p = ""; break;
-
-# Used in context "(host) is located in"
-     case "is" :
-     $p = ""; break;
-
-# Used in context "You at (host) are located in"
-     case "are" :
-     $p = ""; break;
-
-     case "located in" :
-     $p = ""; break;
-
-     case "cannot be located." :
-     $p = ""; break;
-
-     case "cannot be resolved." :
-     $p = ""; break;
-
-     case "is a host in the private IP address range." :
-     $p = ""; break;
-
-     case "does not resolve." :
-     $p = ""; break;
-
-     case "is not a valid IP address." :
-     $p = ""; break;
-
-     case "Temporary lookup failure." :
-     $p = ""; break;
-
-     case "IP-Atlas Preferences" :
-     $p = ""; break;
-
-# make the 'p' lowercase if possible in your language
-
-     case "IP-Atlas preferences" :
-     $p = ""; break;
-
-     case "(cookie based)" :
-     $p = ""; break;
-
-     case "Draw mode (defaults guessed for your browser):" :
-     $p = ""; break;
-
-     // next two phrases are combined
-     case "Your settings have been saved. You can now try" :
-     $p = ""; break;
-
-     case "plotting something." :
-     $p = ""; break;
-
-     case "Pointer Preferences (the dot that marks lat/lon):" :
-     $p = ""; break;
-
-     case "Shape:" :
-     $p = ""; break;
-
-     case "Size:" :
-     $p = ""; break;
-
-     case "Color:" :
-     $p = ""; break;
-
-     case "Pointer:" :
-     $p = ""; break;
-
-     case "Other Preferences:" :
-     $p = ""; break;
-
-     case "Earth Image:" :
-     $p = ""; break;
-
-     case "Color" :
-     $p = ""; break;
-
-     case "Grayscale" :
-     $p = ""; break;
-
-     case "Save" :
-     $p = ""; break;
-
-# shape names:
-     case "Diamond" :
-     $p = ""; break;
-
-     case "Diamond Outline" :
-     $p = ""; break;
-
-     case "Square" :
-     $p = ""; break;
-
-     case "Square Outline" :
-     $p = ""; break;
-
-     case "Cross" :
-     $p = ""; break;
-
-# colors:
-
-     case "red" :
-     $p = ""; break;
-
-     case "white" :
-     $p = ""; break;
-
-     case "yellow" :
-     $p = ""; break;
-
-     case "magenta" :
-     $p = ""; break;
-
-     case "cyan" :
-     $p = ""; break;
-
-     case "green" :
-     $p = ""; break;
-
-     case "violet" :
-     $p = ""; break;
-
-     # stop here
-
-     // return in english if the phrase couldn't be found
-     default:
-     $p = $phrase; break;
-
-
-  }
-
-  // return english if match was blank
-  if($p == "") { $p = $phrase; }
-
-  return $p;
-
-}
-
-?>
diff --git a/iplookup/ipatlas/languages/messages.it.inc b/iplookup/ipatlas/languages/messages.it.inc
deleted file mode 100644 (file)
index b460ffd..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-<?php
-
-/*
-
-Italian Language File
-
-I forgot who started translating this file, email me so i can put your 
-email here.
-
-please email new language files to ivan@xpenguin.com
-copy a language file to messages.<cc>.inc and \
-edit what $p is on encountering an english phrase.
-
-you can start off with messages.blank.inc
-
-please notice the punctuation and capitilization.
-
-change the $language variable in plotconf.inc after
-creating a language file.
-
-*/
-
-function lookup($phrase) {
-  switch($phrase) {
-
-    # start translating the $p here
-
-     case "Plotting" :
-     $p = "Mappa di"; break;
-
-     case "preferences" :
-     $p = "preferenze"; break;
-
-     case "locate me" :
-     $p = "localizzami"; break;
-
-     case "IP/Hostname:" :
-     $p = "IP/Nome host:"; break;
-
-     case "You at" :
-     $p = "Tu"; break;
-
-     case "Submit" :
-     $p = ""; break;
-
-     case "main" :
-     $p = ""; break;
-
-# Used in context "(host) is located in"
-     case "is" :
-     $p = "è"; break;
-
-# Used in context "You at (host) are located in"
-     case "are" :
-     $p = "sei"; break;
-
-     case "located in" :
-     $p = "stato localizzato in"; break;
-
-     case "cannot be located." :
-     $p = "non può essere localizzato."; break;
-
-     case "cannot be resolved." :
-     $p = "non può essere risolto."; break;
-
-     case "is a host in the private IP address range." :
-     $p = "è un host in un range di IP privati."; break;
-
-     case "does not resolve." :
-     $p = "irrisolvibile."; break;
-
-     case "is not a valid IP address." :
-     $p = "non è un indirizzo IP valido."; break;
-
-     case "Temporary lookup failure." :
-     $p = "Errore temporaneo di lookup."; break;
-
-     case "IP-Atlas Preferences" :
-     $p = "Preferenze IP-Atlas"; break;
-
-# make the 'p' lowercase if possible in your language
-
-     case "IP-Atlas preferences" :
-     $p = "Preferenze IP-Atlas"; break;
-
-     case "(cookie based)" :
-     $p = "(basato su cookie)"; break;
-
-     case "Draw mode (defaults guessed for your browser):" :
-     $p = ""; break;
-
-     // next two phrases are combined
-     case "Your settings have been saved. You can now try" :
-     $p = "Le tue impostazioni sono state salvate "; break;
-
-     case "plotting something." :
-     $p = "torna indietro."; break;
-
-     case "Pointer Preferences (the dot that marks lat/lon):" :
-     $p = "Preferenze puntatore (il simbolo che indica la lat/lon):"; break;
-
-     case "Shape:" :
-     $p = "Forma:"; break;
-
-     case "Size:" :
-     $p = "Dimensione:"; break;
-
-     case "Color:" :
-     $p = "Colore:"; break;
-
-     case "Pointer:" :
-     $p = "Puntatore:"; break;
-
-# any help here?
-
-     case "Other Preferences:" :
-     $p = ""; break;
-
-     case "Earth Image:" :
-     $p = ""; break;
-
-     case "Color" :
-     $p = "Colore"; break;
-
-     case "Grayscale" :
-     $p = ""; break;
-
-     case "Save" :
-     $p = ""; break;
-
-# shape names:
-     case "Diamond" :
-     $p = ""; break;
-
-     case "Diamond Outline" :
-     $p = ""; break;
-
-     case "Square" :
-     $p = ""; break;
-
-     case "Square Outline" :
-     $p = ""; break;
-
-     case "Cross" :
-     $p = ""; break;
-
-# colors:
-
-     case "red" :
-     $p = ""; break;
-
-     case "white" :
-     $p = ""; break;
-
-     case "yellow" :
-     $p = ""; break;
-
-     case "magenta" :
-     $p = ""; break;
-
-     case "cyan" :
-     $p = ""; break;
-
-     case "green" :
-     $p = ""; break;
-
-     case "violet" :
-     $p = ""; break;
-
-     # stop here
-
-     // return in english if the phrase couldn't be found
-     default:
-     $p = $phrase; break;
-
-
-  }
-  
-  if($p == "") { $p = $phrase; }
-
-  return $p;
-
-}
-
-?>
diff --git a/iplookup/ipatlas/lib.php b/iplookup/ipatlas/lib.php
deleted file mode 100644 (file)
index 2d64512..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php  // $Id$
-       // Lookup a user using ipatlas and NetGeo
-
-       // The database for this is REALLY old now and this service is 
-       // next to useless.
-
-function iplookup_display($ip, $user=0) {
-    global $CFG;
-
-    redirect($CFG->wwwroot.'/iplookup/ipatlas/plot.php?address='.$ip.'&amp;user='.$user);
-}
-
-?>
diff --git a/iplookup/ipatlas/plot.inc b/iplookup/ipatlas/plot.inc
deleted file mode 100644 (file)
index 4a003e9..0000000
+++ /dev/null
@@ -1,398 +0,0 @@
-<?php
-
-$version = "1.0";
-
-// check for bad agents immidietly
-$blockbadagents=1;
-if($blockbadagents == 1) {
-  // those metaquery assholes at t-dialin and others can't
-  // get another dumber using the default user-agent, can they?
-
-  $agent = $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
-
-  if(
-     strstr("libwww-perl", $agent) ||
-     strstr("lwp-trivial", $agent) ||
-     strstr("LWP::Simple", $agent) ||
-     strstr("PHP/", $agent)) {
-
-    // goodbye
-    exit;
-
-  }
-
-}
-
-function s10_rfc_1918_ip($in) {
-      
-      if (ereg('^(127\.)', $in, $part)) {
-       return TRUE;
-      }
-
-      if (ereg('^(10\.)', $in, $part)) {
-       return TRUE;
-      }
-      
-      if (ereg('^(192\.168\.)', $in, $part)) {
-      return TRUE;
-      }
-
-      if (ereg('^(172\.)' . '([0-9]{1,3})', $in, $part)) {
-         if(($part[2] > 15) and ($part[2] < 32)) {
-              return TRUE;
-         }
-      }
-
-   return FALSE;
-
-}
-
-function stuffanalyze($stuff) {
-
-$stuff2[0] = array_values(preg_grep ("/CITY:/", $stuff)) or die("Sorry, but the lookup for this IP address failed! (CITY)");
-$stuff2[1] = array_values(preg_grep ("/STATE:/", $stuff)) or die("Sorry, but the lookup for this IP address failed! (STATE)");
-$stuff2[2] = array_values(preg_grep ("/COUNTRY:/", $stuff)) or die("Sorry, but the lookup for this IP address failed! (COUNTRY)");
-$stuff2[3] = array_values(preg_grep ("/LAT:/", $stuff)) or die("Sorry, but the lookup for this IP address failed! (LAT)");
-$stuff2[4] = array_values(preg_grep ("/LONG:/", $stuff)) or die("Sorry, but the lookup for this IP address failed! (LONG)");
-
-// all the stuff2 values are actually arrays, making the following code look like crap
-
-// the power of $count
-
- if(isset($stuff2[0][0])) {
-
-for ($count = 0; $count < count($stuff2); $count++) {
-  $stuff2[$count] = $stuff2[$count][0];
-  $stuff2[$count] = ucwords(strtolower(trim(substr(substr($stuff2[$count], 15), 0, -5))));
-}
-
- } else {
-
-   // if no data was found 
-   $stuff2 = array("bad", "bad", "bad", "bad", "bad");
-
- }
-
-$count = 0;
-
- return $stuff2;
-
-}
-
-function getlatdata($ip) {
-
-global $firewall_host;
-global $firewall_port;
-global $use_firewall;
-
-
-  $data = array("");
-
-if ($use_firewall) {
-
-     $fp = fsockopen ($firewall_host, $firewall_port, $errno, $errstr, 30) or die("Could not open socket to proxy");
-     if (!$fp) {
-       echo "$errstr ($errno)<br/>\n";
-     } else {
-       fputs ($fp, "GET http://netgeo.caida.org/perl/netgeo.cgi?target=$ip HTTP/1.0\r\nHost: netgeo.caida.org\r\n\r\n") or die("Could not write to socket");
-       while (!feof($fp)) {
-           $packet = fgets ($fp,128) or die("Could not read from socket");
-           array_push($data, $packet) or die("Could not push data into array");
-       }
-       fclose ($fp);
-     }
-
-} else {
-
-$fp = fsockopen ("netgeo.caida.org", 80, $errno, $errstr, 30) or die("Could not open socket to caida.org");
-if (!$fp) {
-    echo "$errstr ($errno)<br/>\n";
-} else {
-    fputs ($fp, "GET /perl/netgeo.cgi?target=$ip HTTP/1.0\r\nHost: netgeo.caida.org\r\n\r\n") or die("Could not write to socket");
-    while (!feof($fp)) {
-        $packet = fgets ($fp,128) or die("Could not read from socket");
-       array_push($data, $packet) or die("Could not push socket data into array");
-    }
-    fclose ($fp);
-}
-
-}
-
- // make it an array
-
-return $data;
-
-}
-
-function finddot($name, $cssdots, $defaultdot) {
-    foreach($cssdots as $x) {
-        list($filename, , $width, $height) = split(":", $x);
-       if($filename == $name) { $found = 1; $return = array($name, $width, $height); }
-       }
-if(isset($found)) {
-return $return;
-} else {
-$dott = $cssdots[$defaultdot];
-list($dott, , $width, $height) = split(":", $dott);
-return array($dott, $width, $height);
-}
-}
-
-function getlocationcoords($lat, $lon, $width, $height) {
-       // some cartographers weren't mathematicians, up is apparently negative to them
-       $lat = ($lat * -1);
-
-       $lat = ($lat + 90);
-       $lon = ($lon + 180);
-       $x = ($lon * ($width / 360));
-       $y = ($lat * ($height / 180));
-
-       $x = round($x);
-       $y = round($y);
-       return array($x, $y);
-}
-
-function getimagecoords($earthimages, $image) {
-    foreach($earthimages as $x) {
-       list($file, , $width, $height) = split(":", $x);
-       if($file == $image) {
-           $coords = array("$width", "$height");
-           return $coords;
-       }
-    }
-}
-
-function validcookie($cookie) {
-    if(preg_match("/.*.:.*.:.*.:.*.:.*./", $cookie)) {
-       return TRUE;
-    } else {
-       return FALSE;
-    }
-}
-
-function isvalidimage($cookie, $earthimages, $defaultimage) {
-#   list(, , , $setearthimage) = split(":", $cookie);
-    $setearthimage = $cookie;
-       if(isset($setearthimage)) {
-           // check if the image is one actually defined, not a cookie edit
-          foreach($earthimages as $image) {
-              list($testearthimage, , , ) = split(":", $image);
-              if($testearthimage == $setearthimage) {
-                  $found = 1;
-              }
-          }
-          if(isset($found)) {
-               return $setearthimage;
-          } else {
-              return $earthimages[$defaultimage];
-          }
-       } else {
-           return $earthimages[$defaultimage];
-       }
-}
-
-
-
-function istheregd() {
-  global $trygd;
-  if($trygd == 1) {
-        if (@ImageTypes() & IMG_PNG) {
-                return TRUE;
-       } else {
-                return FALSE;
-       }
-  } else {
-                 return FALSE;
-  }
-}
-
-function checkbrowser($agent) {
-       if (strstr($agent, "Mozilla/4.7") || strstr($agent, "Opera 6") || strstr($agent, "Opera/6")) {
-                return FALSE;
-       } else {
-                return TRUE;
-       }
-}
-
-function shouldrun($agent) {
-
-  // could cause probs... dunno
-  global $HTTP_COOKIE_VARS;
-
-  // check for new format of cookie with 6 parameters
-  if(@preg_match("/.*.:.*.:.*.:.*.:.*.:.*./", $HTTP_COOKIE_VARS["atlasprefs"])) {
-    list( , , , , , $drawmode) = split(":", $HTTP_COOKIE_VARS["atlasprefs"]);
-  } else {
-    $drawmode = "";
-  }
-
-  // don't try to understand below, it figures out whether
-  // to run it in css or gd based of prefs, server ability, and user agent.
-
- if(istheregd() && ($drawmode == "1")) {
-   return TRUE;
- } elseif($drawmode == "0") {
-   return FALSE;
- } elseif(checkbrowser($agent) && istheregd()) {
-   return TRUE;
- } elseif(!checkbrowser($agent)) {
-   return FALSE;
- } elseif (!istheregd()) {
-   return FALSE;
- }
-
-
-}
-
-function s10_validate_ip($in) {
-  if (is_string($in) && ereg('^([0-9]{1,3})\.([0-9]{1,3})\.' .
-                             '([0-9]{1,3})\.([0-9]{1,3})$' ,
-                            $in, $part)) {
-     if ($part[1] <= 255 && $part[2] <= 255 &&
-         $part[3] <= 255 && $part[4] <= 255)
-         return TRUE;
-  }
-  return FALSE;
- }
-
-function getstuff($address, $local) {
-
-  $address = trim($address);
-
-# some people still think that urls are hostnames
-$address = str_replace("http://", "", $address);
-$address = preg_replace("/\/.*$/", "", $address);
-
-// Security checks
-$address = escapeshellcmd($address);
-
-$values = array();
-
-$values["address"] = $address;
-
-if(eregi("[a-z]", $address)){
-$ipaddress = gethostbyname($address);
-
- if($ipaddress == $address) {
-
-$values["validity"] = "no";
-
- }
-
-$values["hostname"] = $address;
-
-$values["ishost"] = "yes";
-
-} else {
-
-if(s10_validate_ip($address)) {
-
-$ipaddress = $address;
- $values["hostname"] = "";
-} else {
-$values["validity"] = "no";
-}
-
-}
-
- if(!isset($values["validity"])) {
-   if(s10_rfc_1918_ip($ipaddress)) { 
-     $private = "yes";
-   } else {
-     $private = "no";
-   }
- } else {
-   $private = "no";
- }
-
- if(!isset($ipaddress)) { $ipaddress = ""; }
-
-$values["ipaddress"] = $ipaddress;
-
-if(!isset($values["validity"]) && ($private == "no")) {
-
-$stuff = getlatdata($ipaddress);
-
-list(
-
-     $values["city"],
-     $values["state"],
-     $values["country"],
-     $values["lat"],
-     $values["lon"]
-
-) = stuffanalyze($stuff);
-
-$desc = "";
-
-// check if it is the user's ip address
-if($local == 1) { $desc .= t("You at"); }
-
-// add the ip address and hostname
-$desc .= "<b>$values[hostname]</b> (<b>$values[ipaddress]</b>) ";
-
-// use "are" if it is the user's ip address
-if($local == 1) { $desc .= t("are"); } else { $desc .= t("is"); }
-
-$desc .= " ".t("located in")." ";
-
-// add the city if it's there
-if($values["city"]) {
-$desc .= "$values[city], ";
-}
-
-// add the state if its there
-if($values["state"]) {
-$desc .= "$values[state], ";
-}
-
-if($values["country"]) {
-// make the country code capital so its ready for lookup
-$values["country"] = strtoupper($values["country"]);
-// convert the country code to a country name
-$countries = file("countries.txt") or die("Could not open countries file");
-$precountry = array_values(preg_grep("/$values[country]  /", $countries));
-$values["country"] = trim(substr($precountry[0], 4));
-$desc .= "$values[country].";
-}
-
- $desc .= " <font color=\"#aaaaaa\">($values[lat], $values[lon])</font>";
-
- $state = $values["state"];
- $city = $values["city"];
-
-// decide if address can't resolve, be located, or if it's fine
-if($values["lat"] == "0.00" && $values["lon"] == "0.00" && (@($state != "bad" && $city != "bad"))) {
-  $values["desc"] = "<b>$values[address]</b> ".t("cannot be located.");
-$values["lat"] = "";
-$values["lon"] = "";
-} elseif($values["lat"] == "" && $values["lon"] == "") {
-  $values["desc"] = "<b>$values[address]</b> ".t("cannot be located.");
-} else {
-$values["desc"] = $desc;
-}
-
-} else {
-
-// check if it was a host before and decide on an error message
-
-if($private == "yes") {
-  $values["desc"] = "<b>$address</b> ".t("is a host in the private IP address range.");
-} elseif(@($values["state"] == "bad" && $values["city"] == "bad")) {
-$values["desc"] = t("Temporary lookup failure.");
-} elseif(isset($values["ishost"])) {
-$values["desc"] = "<b>$address</b> ".t("does not resolve.");
-} else {
-$values["desc"] = "<b>$address</b> ".t("is not a valid IP address.");
-}
-
-// some blank lat/lon for the image script or it will plot us in the center
-$values["lon"] = "";
-$values["lat"] = "";
-
-}
-
-return($values);
-}
-
-?>
diff --git a/iplookup/ipatlas/plot.php b/iplookup/ipatlas/plot.php
deleted file mode 100644 (file)
index 838469b..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-<?php  
-
-include("plotconf.inc");
-include("plot.inc");
-
-if (isset($user)) {
-    $user = get_record("user", "id", $user);
-    $fullname = fullname($user, true);
-    $username = "<b>$fullname</b> [$user->city, $user->country] : ";
-} else {
-    $username = "";
-}
-
-// cleanup
-if (isset($HTTP_GET_VARS["lastquery"])) {
-    $HTTP_GET_VARS["lastquery"] = clean_param($HTTP_GET_VARS["lastquery"], PARAM_HOST);
-}
-
-// check if it is the user's ip, or another host
-
-if(!isset($HTTP_GET_VARS["address"]) || ($HTTP_GET_VARS["address"] == "")) { 
-    $address = $HTTP_SERVER_VARS['REMOTE_ADDR'];
-    $local = 1; 
-} else {
-    $HTTP_GET_VARS["address"] = clean_param($HTTP_GET_VARS["address"], PARAM_HOST);
-    $address = $HTTP_GET_VARS["address"];
-    $local = 0; 
-}
-
-// this is the most important function, gets lat/lon and description of location
-$values = getstuff($address, $local) or die("Error in plot.inc");
-
-if(isset($logging) && is_writable("plotlog.txt")) {
-  $log = @fopen("plotlog.txt", "a") or print "";
-  @fputs($log, $HTTP_SERVER_VARS["REMOTE_ADDR"] ."\t". date("F j, Y, g:i a") . "\t$address\t$values[address]\t$values[lat]\t$values[lon]\n") or print "";
-@fclose($log);
-}
-
-if(isset($HTTP_COOKIE_VARS["atlasprefs"]) && validcookie($HTTP_COOKIE_VARS["atlasprefs"])) {
-list( , , , $imagething) = split(":", $HTTP_COOKIE_VARS["atlasprefs"]);
-$imagething = clean_param($imagething, PARAM_FILE);
-$earthimage = isvalidimage($imagething, $earthimages, $defaultimage);
-} else {
-$earthimage = $earthimages[$defaultimage];
-}
-
-if(strstr($earthimage, ":")) {
-    list($earthimage, , , ) = split(":", $earthimage);
-}
-
-// check if we need to run it in css mode
-if(!shouldrun($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) {
-
-list($width, $height) = getimagecoords($earthimages, $earthimage);
-
-  // make sure some coords were found
-  if($values["lat"] == "" || $values["lon"] == "") { 
-
-    $display = "&nbsp;";
-    $extracss = "";
-
-} else {
-
-list($x, $y) = getlocationcoords($values["lat"], $values["lon"], $width, $height);
-
-if(isset($HTTP_COOKIE_VARS["atlasprefs"])) {
-list( , , , , $dotname) = split(":", $HTTP_COOKIE_VARS["atlasprefs"]);
-$dotname = clean_param($dotname, PARAM_FILE);
-list($thedot, $dotwidth, $dotheight) = finddot($dotname, $cssdots, $defaultdot);
-} else {
-$dotname = $cssdots[$defaultdot];
-list($dotname, , , ) = split(":", $dotname);
-$dotname = clean_param($dotname, PARAM_FILE);
-list($thedot, $dotwidth, $dotheight) = finddot($dotname, $cssdots, $defaultdot);
-}
-
-// magical formula for placing the css dot
-$x = ($x - floor($dotwidth / 2));
-$y = ($y - floor($dotheight / 2));
-
-$extracss = "<style>
-#dotDiv { padding-left:$x; padding-top:$y; }
-</style>";
-$display = "<div id=\"dotDiv\"><img width=\"$dotwidth\" height=\"$dotheight\" src=\"$thedot\">";
-
-  }
-
-} else {
-
-  // gd mode
-
-list($width, $height) = getimagecoords($earthimages, $earthimage) or die("Unable to find width/height for image $earthimage in config file");
-$extracss = "";
-$display = "<img src=\"plotimage.php?lat=$values[lat]&amp;lon=$values[lon]\" width=\"$width\" height=\"$height\" alt=\"\" />";
-
-}
-
-# START HTML
-
-print '
-
-<html><head><title>'.t("Plotting").' '.$values["address"].'</title>
-'.$extracss.'
-
-<!-- your head tags here -->
-<link rel="Stylesheet" href="ip-atlas.css">
-</head><body bgcolor="#FFFFFF">
-
-
-<a name="map"></a>
-
-<table valign="top" cellpadding=0 cellspacing=0 border=0 background="'.$earthimage.'" width="'.$width.'" height="'.$height.'"><tr><td valign="top">'.$display.'</td></tr></table>
-
-
-<br />
-';
-
-if(isset($address)) {
-print "$username $values[desc]";
-}
-
-$PHP_SELF = 'plot.php';
-
-print '
-<br /><br />
-<form method="GET" action="'.$PHP_SELF.'#map">
-<table width="100%"><tr><td nowrap align="left">
-'.t("IP/Hostname:").' <input value="'.$values["address"].'" type="text" size="30" name="address" /><input type="Submit" value="'.t("Submit").'" /></td><td align="right" width="100%">
-[ <a href="ip-atlas_prefs.php?lastquery='?><?php  if(isset($HTTP_GET_VARS["address"])) { echo $HTTP_GET_VARS["address"]; } ?><?php  echo '">'.t("preferences").'</a> ]
-[ <a href="'."$PHP_SELF".'">'.t("locate me").'</a> ]
-</td></tr></table>
-</form>
-';
-
-include("footer.inc");
-
-print "</body></html>";
-
-?>
diff --git a/iplookup/ipatlas/plotconf.inc b/iplookup/ipatlas/plotconf.inc
deleted file mode 100644 (file)
index c027565..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-
-require("../../config.php");
-
-# try to find GD on the server? set this
-# to "0" if the script doesn't work or there is a broken image
-if ($CFG->gdversion == 1 or $CFG->gdversion == 2) {
-    $trygd = "1";
-} else {
-    $trygd = "0";
-}
-
-# language (look in language/ dir for language files)
-$language = "en"; global $language;
-
-include("translate.inc");
-
-# display warnings? set to "0" if there are warnings
-# on the screen. report these to ivan@xpenguin.com so
-# this option will become unnessessary.
-$warnings = "1";
-
-# earth images
-# url path:name:width:height
-# everything must be accurate!
-# take new image names out of the t()
-
-$earthimages = array();
-$earthimages[0] = "earth_620.jpg:".t("Color").":620:310";
-
-# which image out of those is the default?
-$defaultimage = 0;
-
-# css dots for netscape 4 users and systems without GD
-# url path:name:width:height
-$cssdots = array();
-$cssdots[0] = "reddot.gif:Red 7x7:7:7";
-$cssdots[1] = "yellowdot.gif:Yellow 7x7:7:7";
-$defaultdot = 0;
-
-# block user agents "libwww-perl" "lwp-trivial" "LWP::Simple" "PHP/"
-$blockbadagents = 1;
-
-# log entries? comment the line to disable.
-#$logging = "yes";
-
-# path to the cookie
-$cookiepath = "/";
-
-# set $use_firewall to "1" if behind a proxy
-if ($CFG->proxyhost and $CFG->proxyport) {
-    $use_firewall="1";
-    $firewall_host=$CFG->proxyhost;
-    $firewall_port=$CFG->proxyport;
-} else {
-    $use_firewall="";
-    $firewall_host="localhost";
-    $firewall_port=3128;
-}
-
-?>
diff --git a/iplookup/ipatlas/plotimage.php b/iplookup/ipatlas/plotimage.php
deleted file mode 100644 (file)
index 3ceecb0..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php
-
-include("plotconf.inc");
-include("plot.inc");
-
-$form_vars = ${"HTTP_".$HTTP_SERVER_VARS["REQUEST_METHOD"]."_VARS"};
-$lat = $form_vars['lat']; 
-$lon = $form_vars['lon']; 
-
-if(isset($HTTP_COOKIE_VARS["atlasprefs"]) && validcookie($HTTP_COOKIE_VARS["atlasprefs"])) {
-     list($setshape, $setcolor, $setsize, $earthimage, , ) = split(":", $HTTP_COOKIE_VARS["atlasprefs"]);
-} else {
-     $setshape = "Diamond";
-     $setcolor = "red";
-     $setsize = "3";
-     $earthimage = $earthimages[$defaultimage];
-     list($earthimage, , , ) = split(":", $earthimage);
-}
-
-$earthimage = isvalidimage($earthimage, $earthimages, $defaultimage);
-
-if(strstr($earthimage, ":")) {
-    list($earthimage, , , ) = split(":", $earthimage);
-}
-
-list($width, $height) = getimagecoords($earthimages, $earthimage);
-
-if($setsize > 8 || $setsize < 2) {
-    $setsize = 2;
-}
-
-$im = @ImageCreate ($width, $height)
-    or die ("Cannot Initialize new GD image stream");
-$background_color = ImageColorAllocate ($im, 255, 255, 255);
-
-
-// color table
-if($setcolor == "red") { $r = "255"; $g = "0"; $b = "0"; }
-elseif($setcolor == "white") { $r = "255"; $g = "255"; $b = "254"; }
-elseif($setcolor == "yellow") { $r = "255"; $g = "255"; $b = "0"; }
-elseif($setcolor == "magenta") { $r = "255"; $g = "0"; $b = "255"; }
-elseif($setcolor == "cyan") { $r = "0"; $g = "255"; $b = "255"; }
-elseif($setcolor == "green") { $r = "0"; $g = "225"; $b = "0"; }
-elseif($setcolor == "violet") { $r = "191"; $g = "0"; $b = "255"; }
-else { $r = "255"; $g = "0"; $b = "0"; }
-
-$loc_color = ImageColorAllocate ($im, $r, $g, $b);
-
-if($lat == "" && $lon == "") { } else {
-
-list($x, $y) = getlocationcoords($lat, $lon, $width, $height);
-
-if($setshape == "Diamond") {
-    ImageLine($im, ($x - $setsize), $y, $x, ($y + $setsize), $loc_color);
-    ImageLine($im, ($x - $setsize), $y, $x, ($y - $setsize), $loc_color);
-    ImageLine($im, ($x + $setsize), $y, $x, ($y + $setsize), $loc_color);
-    ImageLine($im, ($x + $setsize), $y, $x, ($y - $setsize), $loc_color);
-    ImageFill($im, $x, $y, $loc_color);
-} elseif($setshape == "Diamond Outline") {
-    ImageLine($im, ($x - $setsize), $y, $x, ($y + $setsize), $loc_color);
-    ImageLine($im, ($x - $setsize), $y, $x, ($y - $setsize), $loc_color);
-    ImageLine($im, ($x + $setsize), $y, $x, ($y + $setsize), $loc_color);
-    ImageLine($im, ($x + $setsize), $y, $x, ($y - $setsize), $loc_color);
-} elseif($setshape == "Square") {
-    ImageFilledRectangle($im, ($x - $setsize), ($y - $setsize), ($x + $setsize), ($y + $setsize), $loc_color);
-} elseif($setshape == "Square Outline") {
-    ImageRectangle($im, ($x - $setsize), ($y - $setsize), ($x + $setsize), ($y + $setsize), $loc_color);
-} elseif($setshape == "Cross") {
-    ImageLine($im, ($x - $setsize), $y, ($x + $setsize), $y, $loc_color);
-    ImageLine($im, $x, ($y - $setsize), $x, ($y + $setsize), $loc_color);
-} else {
-// draw a diamond if error
-    ImageLine($im, ($x - $setsize), $y, $x, ($y + $setsize), $loc_color);
-    ImageLine($im, ($x - $setsize), $y, $x, ($y - $setsize), $loc_color);
-    ImageLine($im, ($x + $setsize), $y, $x, ($y + $setsize), $loc_color);
-    ImageLine($im, ($x + $setsize), $y, $x, ($y - $setsize), $loc_color);
-    ImageFill($im, $x, $y, $loc_color);
-}
-
-}
-
-
-ImageColorTransparent ($im, $background_color);
-Header("Pragma: no-cache");
-Header("Expires: Thu, 26-Oct-1972 12:00:00");
-Header("Content-type: image/png");
-ImagePng ($im);
-ImageDestroy($im);
-
-
-?>
diff --git a/iplookup/ipatlas/reddot.gif b/iplookup/ipatlas/reddot.gif
deleted file mode 100644 (file)
index 6801957..0000000
Binary files a/iplookup/ipatlas/reddot.gif and /dev/null differ
diff --git a/iplookup/ipatlas/translate.inc b/iplookup/ipatlas/translate.inc
deleted file mode 100644 (file)
index 7b91971..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-
-function t($phrase) {
-  global $language;
-  if($language == "en") {
-    return $phrase;
-  } else {
-  include_once("languages/messages.$language.inc");
-  $phrase = lookup($phrase, $language);
-  return $phrase;
-  }
-}
-
-?>
\ No newline at end of file
diff --git a/iplookup/ipatlas/yellowdot.gif b/iplookup/ipatlas/yellowdot.gif
deleted file mode 100644 (file)
index b43029d..0000000
Binary files a/iplookup/ipatlas/yellowdot.gif and /dev/null differ
diff --git a/iplookup/marker.gif b/iplookup/marker.gif
new file mode 100644 (file)
index 0000000..f24822d
Binary files /dev/null and b/iplookup/marker.gif differ
index 18f2b09..481be42 100644 (file)
@@ -120,6 +120,8 @@ $string['configfrontpage'] = 'The items selected above will be displayed on the
 $string['configfrontpageloggedin'] = 'The items selected above will be displayed on the site\'s front page when a user is logged in.';
 $string['configfullnamedisplay'] = 'This defines how names are shown when they are displayed in full. For most mono-lingual sites the most efficient setting is the default \"First name + Surname\", but you may choose to hide surnames altogether, or to leave it up to the current language pack to decide (some languages have different conventions).';
 $string['configgdversion'] = 'Indicate the version of GD that is installed.  The version shown by default is the one that has been auto-detected.  Don\'t change this unless you really know what you\'re doing.';
+$string['configgeoipfile'] = 'Location of GeoIP City binary data file. This file is not part of Moodle distribution and must be obtained separately from <a href=\"http://www.maxmind.com/\">MaxMind</a>. You can either buy a commercial version or use the free version.<br />Simply download <a href=\"http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz\">http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz</a> and extract it into \"$a\" directory on your server.';
+$string['configgooglemapkey'] = 'You need to enter a special key to use Google Maps for IP address lookup visualization. You can obtain the key free of charge at <a href=\"http://code.google.com/apis/maps/signup.html\">http://code.google.com/apis/maps/signup.html</a>.<br />Your web site URL is: $a';
 $string['configgradebookroles'] = 'This setting allows you to control who appears on the gradebook.  Users need to have at least one of these roles in a course to be shown in the gradebook for that course.';
 $string['configgradeexport'] = 'Choose which gradebook export formats are your primary methods for exporting grades.  Chosen plugins will then set and use a \"last exported\" field for every grade.  For example, this might result in exported records being identified as being \"new\" or \"updated\".  If you are not sure about this then leave everything unchecked.';
 $string['configguestroleid'] = 'This role is automatically assigned to the guest user. It is also temporarily assigned to not enrolled users when they enter course that allows guests without password. Please verify that the role has moodle/legacy:guest and moodle/course:view capability.';
@@ -352,7 +354,9 @@ $string['frontpagesettings'] = 'Front Page settings';
 $string['fullnamedisplay'] = 'Full Name Format';
 $string['gdversion'] = 'GD version';
 $string['generalsettings'] = 'General settings';
+$string['geoipfile'] = 'GeoIP City data file';
 $string['globalsquoteswarning'] = '<p><strong>Security Warning</strong>: to operate properly, Moodle requires <br />that you make certain changes to your current PHP settings.<p/><p>You <em>must</em> set <code>register_globals=off</code> and/or <code>magic_quotes_gpc=on</code>. <br />If possible, you should set <code>register_globals=off</code> to improve general <br /> server security, setting <code>magic_quotes_gpc=on</code> is also recommended.<p/><p>These settings are controlled by editing your <code>php.ini</code>, Apache/IIS <br />configuration or <code>.htaccess</code> file.</p>';
+$string['googlemapkey'] = 'Google Maps API key';
 $string['gotofirst'] = 'Go to first missing string';
 $string['gradebook'] = 'Gradebook';
 $string['gradebookroles'] = 'Graded roles';
@@ -387,6 +391,12 @@ $string['intcachemax'] = 'Int. cache max';
 $string['invalidsection'] = 'Invalid section.';
 $string['invaliduserchangeme'] = 'Username \"changeme\" is reserved -- you cannot create an account with it.';
 $string['iplookup'] = 'IP address lookup';
+$string['iplookupinfo'] = '
+By default Moodle uses the free online NetGeo (The Internet Geographic Database) server to lookup location of IP addresses, unfortunately this database is not maintained anymore and may return <em>wildly incorrect</em> data.
+It is recommended to install local copy of free GeoLite City database from MaxMind.<br />
+IP address location is displayed on simple map or using Google Maps. Please note that you need to have a Google account and apply for free Google Maps API key to enable interactive maps.';
+$string['iplookupmaxmindnote'] = 'This product includes GeoLite data created by MaxMind, available from <a href=\"http://www.maxmind.com/\">http://www.maxmind.com/</a>.';
+$string['iplookupnetgeonote'] = 'The NetGeo server is currently being used to look up geographical information. For more accurate results we recommend installing a local copy of the MaxMind GeoLite database.';
 $string['keeptagnamecase'] = 'Keep tag name casing';
 $string['lang'] = 'Default language';
 $string['lang16notify'] = 'Moodle 1.6 and above allows you to install and update language packs directly from download.moodle.org by following the link below';
index 001ce45..6e4e500 100644 (file)
@@ -49,10 +49,13 @@ $string['guestnoeditprofileother'] = 'The guest user profile cannot be edited';
 $string['invalidcourse'] = 'Invalid course';
 $string['invalidfieldname'] = '\"$a\" is not a valid field name';
 $string['invalidfiletype'] = '\"$a\" is not a valid file type';
+$string['invalidipformat'] = 'Invalid IP address format';
 $string['invalidmd5'] = 'Invalid md5';
 $string['invalidrequest'] = 'Invalid request';
 $string['invalidrole'] = 'Invalid role';
 $string['invalidurl'] = 'Invalid url';
+$string['iplookupfailed'] = 'Can not find geo information about this IP address $a.';
+$string['iplookupprivate'] = 'Can not display lookup of private IP address';
 $string['invalidxmlfile'] = '\"$a\" is not a valid XML file';
 $string['listnopeers'] = 'No peers of item found.';
 $string['listnoitem'] = 'Item not found.';
diff --git a/lib/geoip/ChangeLog.htm b/lib/geoip/ChangeLog.htm
new file mode 100644 (file)
index 0000000..3925cfe
--- /dev/null
@@ -0,0 +1,44 @@
+       * Fix bug where PHP API didn't work with new edition of GeoIP ISP
+
+1.6    2007-1-10
+       * Added AX/Aland Islands, GG/Guernsey, IM/Isle of Man, JE/Jersey (ISO-3166-1 changes)
+       * Replaced CS/Serbia and Montenegro with RS/Serbia, removed ZR/Zaire, added ME/Montenegro
+       * geoip_country_(code|name)_by_addr now work against Geo(IP|Lite) City (Frank Mather)
+       * Added code to lookup zoneinfo timezone given country and region (Frank Mather)
+       * TP/East Timor changed to TL/Timor-Leste, reflecting changes in ISO-3166
+
+1.5    2005-11-1
+       * Added Shared Memory support for GeoIP City (Frank Mather)
+       * Replaced Yugoslavia with Serbia and Montenegro
+       * Removed global declaration for $GEOIP_COUNTRY_CODE_TO_NUMBER, $GEOIP_COUNTRY_CODES,
+               and $GEOIP_COUNTRY_CODES3 
+
+1.4    2005-01-13   Andrew Hill, Awarez Ltd. (http://www.awarez.net)
+ *              Formatted file according to PEAR library standards.
+ *              Moved $GEOIP_COUNTRY_CODE_TO_NUMBER, $GEOIP_COUNTRY_CODES,
+ *                  $GEOIP_COUNTRY_CODES3 and $GEOIP_COUNTRY_NAMES into the
+ *                  GeoIP class, so that library will still work even when
+ *                  not included in the $GLOBAL context.
+
+       * Updated geoip_country_code_by_addr to work with PHP5 (Eric of Host Ultra)
+       * Replaced bit operators (| and &) with logical operators (|| and &&)
+       * Defined GEOIP_ISP_EDITION
+
+1.3    2004-8-4
+       * Changed license from GPL to LGPL so code can be included in PEAR
+       * added global definitions to prevent undefined variables error when including from function (C�dric Dufour)
+       * Updated country names
+       * Added support for GeoIP City, version 1 with DMA and Area codes
+
+1.2    2003-10-28
+       * Added support for Shared Memory (Jason Priebe)
+       * Added support for Distributed queries
+       * Added support for GeoIP Region, version 1
+       * Added Anonymous Proxy and Satellite Provider code/labels
+       * Changed Taiwan, Province of China to Taiwan
+
+1.1    2003-01-15
+       * Added support for GeoIP Region and GeoIP City
+
+1.0    2002-11-21
+        * Initial checkin to CVS
diff --git a/lib/geoip/README.htm b/lib/geoip/README.htm
new file mode 100644 (file)
index 0000000..8456d2b
--- /dev/null
@@ -0,0 +1,43 @@
+Requirements
+
+None (only the 'GeoIP.dat' file is needed).  To download a free GeoIP Standard Country
+database, go to
+http://maxmind.com/download/geoip/database/
+
+Install
+
+Just place the 'geoip.inc' file somewhere according to the 'include_path' directive of
+your 'php.ini' file, or just place it in the same directory as your PHP scripts.
+
+Usage
+
+Gets country name by hostname :
+
+include("geoip.inc");
+
+$gi = geoip_open("/usr/local/share/GeoIP/GeoIP.dat",GEOIP_STANDARD);
+
+echo geoip_country_code_by_addr($gi, "24.24.24.24") . "\t" .
+     geoip_country_name_by_addr($gi, "24.24.24.24") . "\n";
+echo geoip_country_code_by_addr($gi, "80.24.24.24") . "\t" .
+     geoip_country_name_by_addr($gi, "80.24.24.24") . "\n";
+
+geoip_close($gi);
+
+Memory Caching:
+To enable memory caching, pass GEOIP_SHARED_MEMORY or
+GEOIP_MEMORY_CACHE to the second argument of geoip_open
+
+For GEOIP_SHARED_MEMORY, requires php >= 4.0.4,
+and --enable-shmop passed at configure time, see
+http://us2.php.net/manual/en/ref.shmop.php
+In addition, you should call geoip_load_shared_mem
+before calling geoip_open.  See sample_city.php for an
+example of shared memory caching.
+
+Working with PHP5.
+geoip_country_code_by_addr should work
+with PHP.  For help with the other
+routines, please contact support@maxmind.com
+
+Thanks to Jim Winstead.
diff --git a/lib/geoip/geoip.inc b/lib/geoip/geoip.inc
new file mode 100644 (file)
index 0000000..a095469
--- /dev/null
@@ -0,0 +1,498 @@
+<?php
+
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
+/* geoip.inc
+ *
+ * Copyright (C) 2007 MaxMind LLC
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+define("GEOIP_COUNTRY_BEGIN", 16776960);
+define("GEOIP_STATE_BEGIN_REV0", 16700000);
+define("GEOIP_STATE_BEGIN_REV1", 16000000);
+define("GEOIP_STANDARD", 0);
+define("GEOIP_MEMORY_CACHE", 1);
+define("GEOIP_SHARED_MEMORY", 2);
+define("STRUCTURE_INFO_MAX_SIZE", 20);
+define("DATABASE_INFO_MAX_SIZE", 100);
+define("GEOIP_COUNTRY_EDITION", 106);
+define("GEOIP_PROXY_EDITION", 8);
+define("GEOIP_ASNUM_EDITION", 9);
+define("GEOIP_NETSPEED_EDITION", 10);
+define("GEOIP_REGION_EDITION_REV0", 112);
+define("GEOIP_REGION_EDITION_REV1", 3);
+define("GEOIP_CITY_EDITION_REV0", 111);
+define("GEOIP_CITY_EDITION_REV1", 2);
+define("GEOIP_ORG_EDITION", 110);
+define("GEOIP_ISP_EDITION", 4);
+define("SEGMENT_RECORD_LENGTH", 3);
+define("STANDARD_RECORD_LENGTH", 3);
+define("ORG_RECORD_LENGTH", 4);
+define("MAX_RECORD_LENGTH", 4);
+define("MAX_ORG_RECORD_LENGTH", 300);
+define("GEOIP_SHM_KEY", 0x4f415401);
+define("US_OFFSET", 1);
+define("CANADA_OFFSET", 677);
+define("WORLD_OFFSET", 1353);
+define("FIPS_RANGE", 360);
+define("GEOIP_UNKNOWN_SPEED", 0);
+define("GEOIP_DIALUP_SPEED", 1);
+define("GEOIP_CABLEDSL_SPEED", 2);
+define("GEOIP_CORPORATE_SPEED", 3);
+
+class GeoIP {
+    var $flags;
+    var $filehandle;
+    var $memory_buffer;
+    var $databaseType;
+    var $databaseSegments;
+    var $record_length;
+    var $shmid;
+    var $GEOIP_COUNTRY_CODE_TO_NUMBER = array(
+"" => 0, "AP" => 1, "EU" => 2, "AD" => 3, "AE" => 4, "AF" => 5, 
+"AG" => 6, "AI" => 7, "AL" => 8, "AM" => 9, "AN" => 10, "AO" => 11, 
+"AQ" => 12, "AR" => 13, "AS" => 14, "AT" => 15, "AU" => 16, "AW" => 17, 
+"AZ" => 18, "BA" => 19, "BB" => 20, "BD" => 21, "BE" => 22, "BF" => 23, 
+"BG" => 24, "BH" => 25, "BI" => 26, "BJ" => 27, "BM" => 28, "BN" => 29, 
+"BO" => 30, "BR" => 31, "BS" => 32, "BT" => 33, "BV" => 34, "BW" => 35, 
+"BY" => 36, "BZ" => 37, "CA" => 38, "CC" => 39, "CD" => 40, "CF" => 41, 
+"CG" => 42, "CH" => 43, "CI" => 44, "CK" => 45, "CL" => 46, "CM" => 47, 
+"CN" => 48, "CO" => 49, "CR" => 50, "CU" => 51, "CV" => 52, "CX" => 53, 
+"CY" => 54, "CZ" => 55, "DE" => 56, "DJ" => 57, "DK" => 58, "DM" => 59, 
+"DO" => 60, "DZ" => 61, "EC" => 62, "EE" => 63, "EG" => 64, "EH" => 65, 
+"ER" => 66, "ES" => 67, "ET" => 68, "FI" => 69, "FJ" => 70, "FK" => 71, 
+"FM" => 72, "FO" => 73, "FR" => 74, "FX" => 75, "GA" => 76, "GB" => 77,
+"GD" => 78, "GE" => 79, "GF" => 80, "GH" => 81, "GI" => 82, "GL" => 83, 
+"GM" => 84, "GN" => 85, "GP" => 86, "GQ" => 87, "GR" => 88, "GS" => 89, 
+"GT" => 90, "GU" => 91, "GW" => 92, "GY" => 93, "HK" => 94, "HM" => 95, 
+"HN" => 96, "HR" => 97, "HT" => 98, "HU" => 99, "ID" => 100, "IE" => 101, 
+"IL" => 102, "IN" => 103, "IO" => 104, "IQ" => 105, "IR" => 106, "IS" => 107, 
+"IT" => 108, "JM" => 109, "JO" => 110, "JP" => 111, "KE" => 112, "KG" => 113, 
+"KH" => 114, "KI" => 115, "KM" => 116, "KN" => 117, "KP" => 118, "KR" => 119, 
+"KW" => 120, "KY" => 121, "KZ" => 122, "LA" => 123, "LB" => 124, "LC" => 125, 
+"LI" => 126, "LK" => 127, "LR" => 128, "LS" => 129, "LT" => 130, "LU" => 131, 
+"LV" => 132, "LY" => 133, "MA" => 134, "MC" => 135, "MD" => 136, "MG" => 137, 
+"MH" => 138, "MK" => 139, "ML" => 140, "MM" => 141, "MN" => 142, "MO" => 143, 
+"MP" => 144, "MQ" => 145, "MR" => 146, "MS" => 147, "MT" => 148, "MU" => 149, 
+"MV" => 150, "MW" => 151, "MX" => 152, "MY" => 153, "MZ" => 154, "NA" => 155,
+"NC" => 156, "NE" => 157, "NF" => 158, "NG" => 159, "NI" => 160, "NL" => 161, 
+"NO" => 162, "NP" => 163, "NR" => 164, "NU" => 165, "NZ" => 166, "OM" => 167, 
+"PA" => 168, "PE" => 169, "PF" => 170, "PG" => 171, "PH" => 172, "PK" => 173, 
+"PL" => 174, "PM" => 175, "PN" => 176, "PR" => 177, "PS" => 178, "PT" => 179, 
+"PW" => 180, "PY" => 181, "QA" => 182, "RE" => 183, "RO" => 184, "RU" => 185, 
+"RW" => 186, "SA" => 187, "SB" => 188, "SC" => 189, "SD" => 190, "SE" => 191, 
+"SG" => 192, "SH" => 193, "SI" => 194, "SJ" => 195, "SK" => 196, "SL" => 197, 
+"SM" => 198, "SN" => 199, "SO" => 200, "SR" => 201, "ST" => 202, "SV" => 203, 
+"SY" => 204, "SZ" => 205, "TC" => 206, "TD" => 207, "TF" => 208, "TG" => 209, 
+"TH" => 210, "TJ" => 211, "TK" => 212, "TM" => 213, "TN" => 214, "TO" => 215, 
+"TL" => 216, "TR" => 217, "TT" => 218, "TV" => 219, "TW" => 220, "TZ" => 221, 
+"UA" => 222, "UG" => 223, "UM" => 224, "US" => 225, "UY" => 226, "UZ" => 227, 
+"VA" => 228, "VC" => 229, "VE" => 230, "VG" => 231, "VI" => 232, "VN" => 233,
+"VU" => 234, "WF" => 235, "WS" => 236, "YE" => 237, "YT" => 238, "RS" => 239, 
+"ZA" => 240, "ZM" => 241, "ME" => 242, "ZW" => 243, "A1" => 244, "A2" => 245, 
+"O1" => 246, "AX" => 247, "GG" => 248, "IM" => 249, "JE" => 250
+);
+    var $GEOIP_COUNTRY_CODES = array(
+"", "AP", "EU", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ",
+"AR", "AS", "AT", "AU", "AW", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH",
+"BI", "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA",
+"CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU",
+"CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG",
+"EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "FX", "GA", "GB",
+"GD", "GE", "GF", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT",
+"GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN",
+"IO", "IQ", "IR", "IS", "IT", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM",
+"KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS",
+"LT", "LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", "ML", "MM", "MN",
+"MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA",
+"NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA",
+"PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY",
+"QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI",
+"SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD",
+"TF", "TG", "TH", "TJ", "TK", "TM", "TN", "TO", "TL", "TR", "TT", "TV", "TW",
+"TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN",
+"VU", "WF", "WS", "YE", "YT", "RS", "ZA", "ZM", "ME", "ZW", "A1", "A2", "O1",
+"AX", "GG", "IM", "JE"
+);
+    var $GEOIP_COUNTRY_CODES3 = array(
+"","AP","EU","AND","ARE","AFG","ATG","AIA","ALB","ARM","ANT","AGO","AQ","ARG",
+"ASM","AUT","AUS","ABW","AZE","BIH","BRB","BGD","BEL","BFA","BGR","BHR","BDI",
+"BEN","BMU","BRN","BOL","BRA","BHS","BTN","BV","BWA","BLR","BLZ","CAN","CC",
+"COD","CAF","COG","CHE","CIV","COK","CHL","CMR","CHN","COL","CRI","CUB","CPV",
+"CX","CYP","CZE","DEU","DJI","DNK","DMA","DOM","DZA","ECU","EST","EGY","ESH",
+"ERI","ESP","ETH","FIN","FJI","FLK","FSM","FRO","FRA","FX","GAB","GBR","GRD",
+"GEO","GUF","GHA","GIB","GRL","GMB","GIN","GLP","GNQ","GRC","GS","GTM","GUM",
+"GNB","GUY","HKG","HM","HND","HRV","HTI","HUN","IDN","IRL","ISR","IND","IO",
+"IRQ","IRN","ISL","ITA","JAM","JOR","JPN","KEN","KGZ","KHM","KIR","COM","KNA",
+"PRK","KOR","KWT","CYM","KAZ","LAO","LBN","LCA","LIE","LKA","LBR","LSO","LTU",
+"LUX","LVA","LBY","MAR","MCO","MDA","MDG","MHL","MKD","MLI","MMR","MNG","MAC",
+"MNP","MTQ","MRT","MSR","MLT","MUS","MDV","MWI","MEX","MYS","MOZ","NAM","NCL",
+"NER","NFK","NGA","NIC","NLD","NOR","NPL","NRU","NIU","NZL","OMN","PAN","PER",
+"PYF","PNG","PHL","PAK","POL","SPM","PCN","PRI","PSE","PRT","PLW","PRY","QAT",
+"REU","ROU","RUS","RWA","SAU","SLB","SYC","SDN","SWE","SGP","SHN","SVN","SJM",
+"SVK","SLE","SMR","SEN","SOM","SUR","STP","SLV","SYR","SWZ","TCA","TCD","TF",
+"TGO","THA","TJK","TKL","TLS","TKM","TUN","TON","TUR","TTO","TUV","TWN","TZA",
+"UKR","UGA","UM","USA","URY","UZB","VAT","VCT","VEN","VGB","VIR","VNM","VUT",
+"WLF","WSM","YEM","YT","SRB","ZAF","ZMB","MNE","ZWE","A1","A2","O1",
+"ALA","GGY","IMN","JEY"
+    );
+    var $GEOIP_COUNTRY_NAMES = array(
+"", "Asia/Pacific Region", "Europe", "Andorra", "United Arab Emirates",
+"Afghanistan", "Antigua and Barbuda", "Anguilla", "Albania", "Armenia",
+"Netherlands Antilles", "Angola", "Antarctica", "Argentina", "American Samoa",
+"Austria", "Australia", "Aruba", "Azerbaijan", "Bosnia and Herzegovina",
+"Barbados", "Bangladesh", "Belgium", "Burkina Faso", "Bulgaria", "Bahrain",
+"Burundi", "Benin", "Bermuda", "Brunei Darussalam", "Bolivia", "Brazil",
+"Bahamas", "Bhutan", "Bouvet Island", "Botswana", "Belarus", "Belize",
+"Canada", "Cocos (Keeling) Islands", "Congo, The Democratic Republic of the",
+"Central African Republic", "Congo", "Switzerland", "Cote D'Ivoire", "Cook
+Islands", "Chile", "Cameroon", "China", "Colombia", "Costa Rica", "Cuba", "Cape
+Verde", "Christmas Island", "Cyprus", "Czech Republic", "Germany", "Djibouti",
+"Denmark", "Dominica", "Dominican Republic", "Algeria", "Ecuador", "Estonia",
+"Egypt", "Western Sahara", "Eritrea", "Spain", "Ethiopia", "Finland", "Fiji",
+"Falkland Islands (Malvinas)", "Micronesia, Federated States of", "Faroe
+Islands", "France", "France, Metropolitan", "Gabon", "United Kingdom",
+"Grenada", "Georgia", "French Guiana", "Ghana", "Gibraltar", "Greenland",
+"Gambia", "Guinea", "Guadeloupe", "Equatorial Guinea", "Greece", "South Georgia
+and the South Sandwich Islands", "Guatemala", "Guam", "Guinea-Bissau",
+"Guyana", "Hong Kong", "Heard Island and McDonald Islands", "Honduras",
+"Croatia", "Haiti", "Hungary", "Indonesia", "Ireland", "Israel", "India",
+"British Indian Ocean Territory", "Iraq", "Iran, Islamic Republic of",
+"Iceland", "Italy", "Jamaica", "Jordan", "Japan", "Kenya", "Kyrgyzstan",
+"Cambodia", "Kiribati", "Comoros", "Saint Kitts and Nevis", "Korea, Democratic
+People's Republic of", "Korea, Republic of", "Kuwait", "Cayman Islands",
+"Kazakstan", "Lao People's Democratic Republic", "Lebanon", "Saint Lucia",
+"Liechtenstein", "Sri Lanka", "Liberia", "Lesotho", "Lithuania", "Luxembourg",
+"Latvia", "Libyan Arab Jamahiriya", "Morocco", "Monaco", "Moldova, Republic
+of", "Madagascar", "Marshall Islands", "Macedonia",
+"Mali", "Myanmar", "Mongolia", "Macau", "Northern Mariana Islands",
+"Martinique", "Mauritania", "Montserrat", "Malta", "Mauritius", "Maldives",
+"Malawi", "Mexico", "Malaysia", "Mozambique", "Namibia", "New Caledonia",
+"Niger", "Norfolk Island", "Nigeria", "Nicaragua", "Netherlands", "Norway",
+"Nepal", "Nauru", "Niue", "New Zealand", "Oman", "Panama", "Peru", "French
+Polynesia", "Papua New Guinea", "Philippines", "Pakistan", "Poland", "Saint
+Pierre and Miquelon", "Pitcairn Islands", "Puerto Rico", "Palestinian Territory",
+"Portugal", "Palau", "Paraguay", "Qatar", "Reunion", "Romania",
+"Russian Federation", "Rwanda", "Saudi Arabia", "Solomon Islands",
+"Seychelles", "Sudan", "Sweden", "Singapore", "Saint Helena", "Slovenia",
+"Svalbard and Jan Mayen", "Slovakia", "Sierra Leone", "San Marino", "Senegal",
+"Somalia", "Suriname", "Sao Tome and Principe", "El Salvador", "Syrian Arab
+Republic", "Swaziland", "Turks and Caicos Islands", "Chad", "French Southern
+Territories", "Togo", "Thailand", "Tajikistan", "Tokelau", "Turkmenistan",
+"Tunisia", "Tonga", "Timor-Leste", "Turkey", "Trinidad and Tobago", "Tuvalu",
+"Taiwan", "Tanzania, United Republic of", "Ukraine",
+"Uganda", "United States Minor Outlying Islands", "United States", "Uruguay",
+"Uzbekistan", "Holy See (Vatican City State)", "Saint Vincent and the
+Grenadines", "Venezuela", "Virgin Islands, British", "Virgin Islands, U.S.",
+"Vietnam", "Vanuatu", "Wallis and Futuna", "Samoa", "Yemen", "Mayotte",
+"Serbia", "South Africa", "Zambia", "Montenegro", "Zimbabwe",
+"Anonymous Proxy","Satellite Provider","Other",
+"Aland Islands","Guernsey","Isle of Man","Jersey"
+);
+}
+function geoip_load_shared_mem ($file) {
+
+  $fp = fopen($file, "rb");
+  if (!$fp) {
+    print "error opening $file: $php_errormsg\n";
+    exit;
+  }
+  $s_array = fstat($fp);
+  $size = $s_array['size'];
+  if ($shmid = @shmop_open (GEOIP_SHM_KEY, "w", 0, 0)) {
+    shmop_delete ($shmid);
+    shmop_close ($shmid);
+  }
+  $shmid = shmop_open (GEOIP_SHM_KEY, "c", 0644, $size);
+  shmop_write ($shmid, fread($fp, $size), 0);
+  shmop_close ($shmid);
+}
+
+function _setup_segments($gi){
+  $gi->databaseType = GEOIP_COUNTRY_EDITION;
+  $gi->record_length = STANDARD_RECORD_LENGTH;
+  if ($gi->flags & GEOIP_SHARED_MEMORY) {
+    $offset = @shmop_size ($gi->shmid) - 3;
+    for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) {
+        $delim = @shmop_read ($gi->shmid, $offset, 3);
+        $offset += 3;
+        if ($delim == (chr(255).chr(255).chr(255))) {
+            $gi->databaseType = ord(@shmop_read ($gi->shmid, $offset, 1));
+            $offset++;
+
+            if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
+                $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0;
+            } else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1){
+                $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1;
+           } else if (($gi->databaseType == GEOIP_CITY_EDITION_REV0)||
+                     ($gi->databaseType == GEOIP_CITY_EDITION_REV1) 
+                    || ($gi->databaseType == GEOIP_ORG_EDITION)
+                   || ($gi->databaseType == GEOIP_ISP_EDITION)
+                   || ($gi->databaseType == GEOIP_ASNUM_EDITION)){
+                $gi->databaseSegments = 0;
+                $buf = @shmop_read ($gi->shmid, $offset, SEGMENT_RECORD_LENGTH);
+                for ($j = 0;$j < SEGMENT_RECORD_LENGTH;$j++){
+                    $gi->databaseSegments += (ord($buf[$j]) << ($j * 8));
+                }
+                   if (($gi->databaseType == GEOIP_ORG_EDITION)||
+                       ($gi->databaseType == GEOIP_ISP_EDITION)) {
+                       $gi->record_length = ORG_RECORD_LENGTH;
+                }
+            }
+            break;
+        } else {
+            $offset -= 4;
+        }
+    }
+    if (($gi->databaseType == GEOIP_COUNTRY_EDITION)||
+        ($gi->databaseType == GEOIP_PROXY_EDITION)||
+        ($gi->databaseType == GEOIP_NETSPEED_EDITION)){
+        $gi->databaseSegments = GEOIP_COUNTRY_BEGIN;
+    }
+  } else {
+    $filepos = ftell($gi->filehandle);
+    fseek($gi->filehandle, -3, SEEK_END);
+    for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) {
+        $delim = fread($gi->filehandle,3);
+        if ($delim == (chr(255).chr(255).chr(255))){
+        $gi->databaseType = ord(fread($gi->filehandle,1));
+        if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
+            $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0;
+        }
+        else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1){
+           $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1;
+                }  else if (($gi->databaseType == GEOIP_CITY_EDITION_REV0) ||
+                 ($gi->databaseType == GEOIP_CITY_EDITION_REV1) || 
+                 ($gi->databaseType == GEOIP_ORG_EDITION) || 
+                ($gi->databaseType == GEOIP_ISP_EDITION) || 
+                 ($gi->databaseType == GEOIP_ASNUM_EDITION)){
+            $gi->databaseSegments = 0;
+            $buf = fread($gi->filehandle,SEGMENT_RECORD_LENGTH);
+            for ($j = 0;$j < SEGMENT_RECORD_LENGTH;$j++){
+            $gi->databaseSegments += (ord($buf[$j]) << ($j * 8));
+            }
+           if ($gi->databaseType == GEOIP_ORG_EDITION ||
+               $gi->databaseType == GEOIP_ISP_EDITION) {
+           $gi->record_length = ORG_RECORD_LENGTH;
+            }
+        }
+        break;
+        } else {
+        fseek($gi->filehandle, -4, SEEK_CUR);
+        }
+    }
+    if (($gi->databaseType == GEOIP_COUNTRY_EDITION)||
+        ($gi->databaseType == GEOIP_PROXY_EDITION)||
+        ($gi->databaseType == GEOIP_NETSPEED_EDITION)){
+         $gi->databaseSegments = GEOIP_COUNTRY_BEGIN;
+    }
+    fseek($gi->filehandle,$filepos,SEEK_SET);
+  }
+  return $gi;
+}
+
+function geoip_open($filename, $flags) {
+  $gi = new GeoIP;
+  $gi->flags = $flags;
+  if ($gi->flags & GEOIP_SHARED_MEMORY) {
+    $gi->shmid = @shmop_open (GEOIP_SHM_KEY, "a", 0, 0);
+    } else {
+    $gi->filehandle = fopen($filename,"rb");
+    if ($gi->flags & GEOIP_MEMORY_CACHE) {
+        $s_array = fstat($gi->filehandle);
+        $gi->memory_buffer = fread($gi->filehandle, $s_array['size']);
+    }
+  }
+
+  $gi = _setup_segments($gi);
+  return $gi;
+}
+
+function geoip_close($gi) {
+  if ($gi->flags & GEOIP_SHARED_MEMORY) {
+    return true;
+  }
+
+  return fclose($gi->filehandle);
+}
+
+function geoip_country_id_by_name($gi, $name) {
+  $addr = gethostbyname($name);
+  if (!$addr || $addr == $name) {
+    return false;
+  }
+  return geoip_country_id_by_addr($gi, $addr);
+}
+
+function geoip_country_code_by_name($gi, $name) {
+  $country_id = geoip_country_id_by_name($gi,$name);
+  if ($country_id !== false) {
+        return $gi->GEOIP_COUNTRY_CODES[$country_id];
+  }
+  return false;
+}
+
+function geoip_country_name_by_name($gi, $name) {
+  $country_id = geoip_country_id_by_name($gi,$name);
+  if ($country_id !== false) {
+        return $gi->GEOIP_COUNTRY_NAMES[$country_id];
+  }
+  return false;
+}
+
+function geoip_country_id_by_addr($gi, $addr) {
+  $ipnum = ip2long($addr);
+  return _geoip_seek_country($gi, $ipnum) - GEOIP_COUNTRY_BEGIN;
+}
+
+function geoip_country_code_by_addr($gi, $addr) {
+  if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) {
+    $record = geoip_record_by_addr($gi,$addr);
+    return $record->country_code;
+  } else {
+    $country_id = geoip_country_id_by_addr($gi,$addr);
+    if ($country_id !== false) {
+      return $gi->GEOIP_COUNTRY_CODES[$country_id];
+    }
+  }
+  return false;
+}
+
+function geoip_country_name_by_addr($gi, $addr) {
+  if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) {
+    $record = geoip_record_by_addr($gi,$addr);
+    return $record->country_name;
+  } else {
+    $country_id = geoip_country_id_by_addr($gi,$addr);
+    if ($country_id !== false) {
+      return $gi->GEOIP_COUNTRY_NAMES[$country_id];
+    }
+  }
+  return false;
+}
+
+function _geoip_seek_country($gi, $ipnum) {
+  $offset = 0;
+  for ($depth = 31; $depth >= 0; --$depth) {
+    if ($gi->flags & GEOIP_MEMORY_CACHE) {
+      $buf = substr($gi->memory_buffer,
+                            2 * $gi->record_length * $offset,
+                            2 * $gi->record_length);
+        } elseif ($gi->flags & GEOIP_SHARED_MEMORY) {
+      $buf = @shmop_read ($gi->shmid, 
+                            2 * $gi->record_length * $offset,
+                            2 * $gi->record_length );
+        } else {
+      fseek($gi->filehandle, 2 * $gi->record_length * $offset, SEEK_SET) == 0
+        or die("fseek failed");
+      $buf = fread($gi->filehandle, 2 * $gi->record_length);
+    }
+    $x = array(0,0);
+    for ($i = 0; $i < 2; ++$i) {
+      for ($j = 0; $j < $gi->record_length; ++$j) {
+        $x[$i] += ord($buf[$gi->record_length * $i + $j]) << ($j * 8);
+      }
+    }
+    if ($ipnum & (1 << $depth)) {
+      if ($x[1] >= $gi->databaseSegments) {
+        return $x[1];
+      }
+      $offset = $x[1];
+        } else {
+      if ($x[0] >= $gi->databaseSegments) {
+        return $x[0];
+      }
+      $offset = $x[0];
+    }
+  }
+  trigger_error("error traversing database - perhaps it is corrupt?", E_USER_ERROR);
+  return false;
+}
+
+function _get_org($gi,$ipnum){
+  $seek_org = _geoip_seek_country($gi,$ipnum);
+  if ($seek_org == $gi->databaseSegments) {
+    return NULL;
+  }
+  $record_pointer = $seek_org + (2 * $gi->record_length - 1) * $gi->databaseSegments;
+  if ($gi->flags & GEOIP_SHARED_MEMORY) {
+    $org_buf = @shmop_read ($gi->shmid, $record_pointer, MAX_ORG_RECORD_LENGTH);
+    } else {
+    fseek($gi->filehandle, $record_pointer, SEEK_SET);
+    $org_buf = fread($gi->filehandle,MAX_ORG_RECORD_LENGTH);
+  }
+  $org_buf = substr($org_buf, 0, strpos($org_buf, 0));
+  return $org_buf;
+}
+
+function geoip_org_by_addr ($gi,$addr) {
+  if ($addr == NULL) {
+    return 0;
+  }
+  $ipnum = ip2long($addr);
+  return _get_org($gi, $ipnum);
+}
+
+function _get_region($gi,$ipnum){
+  if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
+    $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV0;
+    if ($seek_region >= 1000){
+      $country_code = "US";
+      $region = chr(($seek_region - 1000)/26 + 65) . chr(($seek_region - 1000)%26 + 65);
+    } else {
+            $country_code = $gi->GEOIP_COUNTRY_CODES[$seek_region];
+      $region = "";
+    }
+  return array ($country_code,$region);
+    }  else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1) {
+    $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV1;
+    //print $seek_region;
+    if ($seek_region < US_OFFSET){
+      $country_code = "";
+      $region = "";  
+        } else if ($seek_region < CANADA_OFFSET) {
+      $country_code = "US";
+      $region = chr(($seek_region - US_OFFSET)/26 + 65) . chr(($seek_region - US_OFFSET)%26 + 65);
+        } else if ($seek_region < WORLD_OFFSET) {
+      $country_code = "CA";
+      $region = chr(($seek_region - CANADA_OFFSET)/26 + 65) . chr(($seek_region - CANADA_OFFSET)%26 + 65);
+    } else {
+            $country_code = $gi->GEOIP_COUNTRY_CODES[($seek_region - WORLD_OFFSET) / FIPS_RANGE];
+      $region = "";
+    }
+  return array ($country_code,$region);
+  }
+}
+
+function geoip_region_by_addr ($gi,$addr) {
+  if ($addr == NULL) {
+    return 0;
+  }
+  $ipnum = ip2long($addr);
+  return _get_region($gi, $ipnum);
+}
+
+function getdnsattributes ($l,$ip){
+  $r = new Net_DNS_Resolver();
+  $r->nameservers = array("ws1.maxmind.com");
+  $p = $r->search($l."." . $ip .".s.maxmind.com","TXT","IN");
+  $str = is_object($p->answer[0])?$p->answer[0]->string():'';
+  ereg("\"(.*)\"",$str,$regs);
+  $str = $regs[1];
+  return $str;
+}
+
+?>
diff --git a/lib/geoip/geoipcity.inc b/lib/geoip/geoipcity.inc
new file mode 100644 (file)
index 0000000..836ae93
--- /dev/null
@@ -0,0 +1,205 @@
+<?php
+
+/* geoipcity.inc
+ *
+ * Copyright (C) 2004 Maxmind LLC
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+/*
+ * Changelog:
+ *
+ * 2005-01-13   Andrew Hill, Awarez Ltd. (http://www.awarez.net)
+ *              Formatted file according to PEAR library standards.
+ *              Changed inclusion of geoip.inc file to require_once, so that
+ *                  this library can be used in the same script as geoip.inc.
+ */
+
+define("FULL_RECORD_LENGTH",50);
+
+require_once 'geoip.inc';
+require_once 'geoipregionvars.php';
+
+class geoiprecord {
+  var $country_code;
+  var $country_code3;
+  var $country_name;
+  var $region;
+  var $city;
+  var $postal_code;
+  var $latitude;
+  var $longitude;
+  var $area_code;
+  var $dma_code;
+}
+
+class geoipdnsrecord {
+  var $country_code;
+  var $country_code3;
+  var $country_name;
+  var $region;
+  var $regionname;
+  var $city;
+  var $postal_code;
+  var $latitude;
+  var $longitude;
+  var $areacode;
+  var $dmacode;
+  var $isp;
+  var $org;
+}
+
+function getrecordwithdnsservice($str){
+  $record = new geoipdnsrecord;
+  $keyvalue = split(";",$str);
+  foreach ($keyvalue as $keyvalue2){
+    list($key,$value) = split("=",$keyvalue2);
+    if ($key == "co"){
+      $record->country_code = $value;
+    }
+    if ($key == "ci"){
+      $record->city = $value;
+    }
+    if ($key == "re"){
+      $record->region = $value;
+    }
+    if ($key == "ac"){
+      $record->areacode = $value;
+    }
+    if ($key == "dm"){
+      $record->dmacode = $value;
+    }
+    if ($key == "is"){
+      $record->isp = $value;
+    }
+    if ($key == "or"){
+      $record->org = $value;
+    }
+    if ($key == "zi"){
+      $record->postal_code = $value;
+    }
+    if ($key == "la"){
+      $record->latitude = $value;
+    }
+    if ($key == "lo"){
+      $record->longitude = $value;
+    }
+  }
+  $number = $GLOBALS['GEOIP_COUNTRY_CODE_TO_NUMBER'][$record->country_code];
+  $record->country_code3 = $GLOBALS['GEOIP_COUNTRY_CODES3'][$number];
+  $record->country_name = $GLOBALS['GEOIP_COUNTRY_NAMES'][$number];
+  if ($record->region != "") {
+    if (($record->country_code == "US") || ($record->country_code == "CA")){
+      $record->regionname = $GLOBALS['ISO'][$record->country_code][$record->region];
+    } else {
+      $record->regionname = $GLOBALS['FIPS'][$record->country_code][$record->region];
+    }
+  }
+  return $record;
+}
+
+function _get_record($gi,$ipnum){
+  $seek_country = _geoip_seek_country($gi,$ipnum);
+  if ($seek_country == $gi->databaseSegments) {
+    return NULL;
+  }
+  $record_pointer = $seek_country + (2 * $gi->record_length - 1) * $gi->databaseSegments;
+  
+  if ($gi->flags & GEOIP_MEMORY_CACHE) {
+    $record_buf = substr($gi->memory_buffer,$record_pointer,FULL_RECORD_LENGTH);
+  } elseif ($gi->flags & GEOIP_SHARED_MEMORY){
+    $record_buf = @shmop_read($gi->shmid,$record_pointer,FULL_RECORD_LENGTH);
+  } else {
+    fseek($gi->filehandle, $record_pointer, SEEK_SET);
+    $record_buf = fread($gi->filehandle,FULL_RECORD_LENGTH);
+  }
+  $record = new geoiprecord;
+  $record_buf_pos = 0;
+  $char = ord(substr($record_buf,$record_buf_pos,1));
+    $record->country_code = $gi->GEOIP_COUNTRY_CODES[$char];
+    $record->country_code3 = $gi->GEOIP_COUNTRY_CODES3[$char];
+    $record->country_name = $gi->GEOIP_COUNTRY_NAMES[$char];
+  $record_buf_pos++;
+  $str_length = 0;
+    // Get region
+  $char = ord(substr($record_buf,$record_buf_pos+$str_length,1));
+  while ($char != 0){
+    $str_length++;
+    $char = ord(substr($record_buf,$record_buf_pos+$str_length,1));
+  }
+  if ($str_length > 0){
+    $record->region = substr($record_buf,$record_buf_pos,$str_length);
+  }
+  $record_buf_pos += $str_length + 1;
+  $str_length = 0;
+    // Get city
+  $char = ord(substr($record_buf,$record_buf_pos+$str_length,1));
+  while ($char != 0){
+    $str_length++;
+    $char = ord(substr($record_buf,$record_buf_pos+$str_length,1));
+  }
+  if ($str_length > 0){
+    $record->city = substr($record_buf,$record_buf_pos,$str_length);
+  }
+  $record_buf_pos += $str_length + 1;
+  $str_length = 0;
+    // Get postal code
+  $char = ord(substr($record_buf,$record_buf_pos+$str_length,1));
+  while ($char != 0){
+    $str_length++;
+    $char = ord(substr($record_buf,$record_buf_pos+$str_length,1));
+  }
+  if ($str_length > 0){
+    $record->postal_code = substr($record_buf,$record_buf_pos,$str_length);
+  }
+  $record_buf_pos += $str_length + 1;
+  $str_length = 0;
+    // Get latitude and longitude
+  $latitude = 0;
+  $longitude = 0;
+  for ($j = 0;$j < 3; ++$j){
+    $char = ord(substr($record_buf,$record_buf_pos++,1));
+    $latitude += ($char << ($j * 8));
+  }
+  $record->latitude = ($latitude/10000) - 180;
+  for ($j = 0;$j < 3; ++$j){
+    $char = ord(substr($record_buf,$record_buf_pos++,1));
+    $longitude += ($char << ($j * 8));
+  }
+  $record->longitude = ($longitude/10000) - 180;
+  if (GEOIP_CITY_EDITION_REV1 == $gi->databaseType){
+    $dmaarea_combo = 0;
+    if ($record->country_code == "US"){
+      for ($j = 0;$j < 3;++$j){
+        $char = ord(substr($record_buf,$record_buf_pos++,1));
+        $dmaarea_combo += ($char << ($j * 8));
+      }
+      $record->dma_code = floor($dmaarea_combo/1000);
+      $record->area_code = $dmaarea_combo%1000;
+    }
+  }
+  return $record;
+}
+
+function GeoIP_record_by_addr ($gi,$addr){
+  if ($addr == NULL){
+     return 0;
+  }
+  $ipnum = ip2long($addr);
+  return _get_record($gi, $ipnum);
+}
+
+?>
diff --git a/lib/geoip/geoipregionvars.php b/lib/geoip/geoipregionvars.php
new file mode 100644 (file)
index 0000000..8b9a578
--- /dev/null
@@ -0,0 +1,4119 @@
+<?php
+# Copyright 2003 Maxmind LLC All Rights Reserved
+$GEOIP_REGION_NAME = array(
+"CA" => array(
+"AB" => "Alberta",
+"BC" => "British Columbia",
+"MB" => "Manitoba",
+"NB" => "New Brunswick",
+"NF" => "Newfoundland",
+"NS" => "Nova Scotia",
+"NU" => "Nunavut",
+"ON" => "Ontario",
+"PE" => "Prince Edward Island",
+"QC" => "Quebec",
+"SK" => "Saskatchewan",
+"NT" => "Northwest Territories",
+"YT" => "Yukon Territory"),
+"US" => array(
+"AA" => "Armed Forces Americas",
+"AE" => "Armed Forces Europe, Middle East, & Canada",
+"AK" => "Alaska",
+"AL" => "Alabama",
+"AP" => "Armed Forces Pacific",
+"AR" => "Arkansas",
+"AS" => "American Samoa",
+"AZ" => "Arizona",
+"CA" => "California",
+"CO" => "Colorado",
+"CT" => "Connecticut",
+"DC" => "District of Columbia",
+"DE" => "Delaware",
+"FL" => "Florida",
+"FM" => "Federated States of Micronesia",
+"GA" => "Georgia",
+"GU" => "Guam",
+"HI" => "Hawaii",
+"IA" => "Iowa",
+"ID" => "Idaho",
+"IL" => "Illinois",
+"IN" => "Indiana",
+"KS" => "Kansas",
+"KY" => "Kentucky",
+"LA" => "Louisiana",
+"MA" => "Massachusetts",
+"MD" => "Maryland",
+"ME" => "Maine",
+"MH" => "Marshall Islands",
+"MI" => "Michigan",
+"MN" => "Minnesota",
+"MO" => "Missouri",
+"MP" => "Northern Mariana Islands",
+"MS" => "Mississippi",
+"MT" => "Montana",
+"NC" => "North Carolina",
+"ND" => "North Dakota",
+"NE" => "Nebraska",
+"NH" => "New Hampshire",
+"NJ" => "New Jersey",
+"NM" => "New Mexico",
+"NV" => "Nevada",
+"NY" => "New York",
+"OH" => "Ohio",
+"OK" => "Oklahoma",
+"OR" => "Oregon",
+"PA" => "Pennsylvania",
+"PR" => "Puerto Rico",
+"PW" => "Palau",
+"RI" => "Rhode Island",
+"SC" => "South Carolina",
+"SD" => "South Dakota",
+"TN" => "Tennessee",
+"TX" => "Texas",
+"UT" => "Utah",
+"VA" => "Virginia",
+"VI" => "Virgin Islands",
+"VT" => "Vermont",
+"WA" => "Washington",
+"WV" => "West Virginia",
+"WI" => "Wisconsin",
+"WY" => "Wyoming"),
+"AD" => array(
+"02" => "Canillo",
+"03" => "Encamp",
+"04" => "La Massana",
+"05" => "Ordino",
+"06" => "Sant Julia de Loria",
+"07" => "Andorra la Vella",
+"08" => "Escaldes-Engordany"),
+"AE" => array(
+"01" => "Abu Zaby",
+"03" => "Dubayy",
+"04" => "Al Fujayrah",
+"05" => "Ra's al Khaymah",
+"06" => "Ash Shariqah",
+"07" => "Umm al Qaywayn"),
+"AF" => array(
+"01" => "Badakhshan",
+"02" => "Badghis",
+"03" => "Baghlan",
+"05" => "Bamian",
+"06" => "Farah",
+"07" => "Faryab",
+"08" => "Ghazni",
+"09" => "Ghowr",
+"10" => "Helmand",
+"11" => "Herat",
+"13" => "Kabol",
+"14" => "Kapisa",
+"15" => "Konar",
+"16" => "Laghman",
+"17" => "Lowgar",
+"18" => "Nangarhar",
+"19" => "Nimruz",
+"20" => "Oruzgan",
+"21" => "Paktia",
+"22" => "Parvan",
+"23" => "Kandahar",
+"24" => "Kondoz",
+"26" => "Takhar",
+"27" => "Vardak",
+"28" => "Zabol",
+"29" => "Paktika",
+"30" => "Balkh",
+"31" => "Jowzjan",
+"32" => "Samangan",
+"33" => "Sar-e Pol"),
+"AG" => array(
+"01" => "Barbuda",
+"03" => "Saint George",
+"04" => "Saint John",
+"05" => "Saint Mary",
+"06" => "Saint Paul",
+"07" => "Saint Peter",
+"08" => "Saint Philip"),
+"AL" => array(
+"01" => "Berat",
+"02" => "Diber",
+"03" => "Durres",
+"04" => "Elbasan",
+"05" => "Fier",
+"06" => "Gjirokaster",
+"07" => "Gramsh",
+"08" => "Kolonje",
+"09" => "Korce",
+"10" => "Kruje",
+"11" => "Kukes",
+"12" => "Lezhe",
+"13" => "Librazhd",
+"14" => "Lushnje",
+"15" => "Mat",
+"16" => "Mirdite",
+"17" => "Permet",
+"18" => "Pogradec",
+"19" => "Puke",
+"20" => "Sarande",
+"21" => "Shkoder",
+"22" => "Skrapar",
+"23" => "Tepelene",
+"26" => "Tropoje",
+"27" => "Vlore",
+"28" => "Tirane",
+"29" => "Bulqize",
+"30" => "Delvine",
+"31" => "Devoll",
+"32" => "Has",
+"33" => "Kavaje",
+"34" => "Kucove",
+"35" => "Kurbin",
+"36" => "Malesi e Madhe",
+"37" => "Mallakaster",
+"38" => "Peqin",
+"39" => "Tirane"),
+"AM" => array(
+"01" => "Aragatsotn",
+"02" => "Ararat",
+"03" => "Armavir",
+"04" => "Geghark'unik'",
+"05" => "Kotayk'",
+"06" => "Lorri",
+"07" => "Shirak",
+"08" => "Syunik'",
+"09" => "Tavush",
+"10" => "Vayots' Dzor",
+"11" => "Yerevan"),
+"AO" => array(
+"01" => "Benguela",
+"02" => "Bie",
+"03" => "Cabinda",
+"04" => "Cuando Cubango",
+"05" => "Cuanza Norte",
+"06" => "Cuanza Sul",
+"07" => "Cunene",
+"08" => "Huambo",
+"09" => "Huila",
+"12" => "Malanje",
+"14" => "Moxico",
+"15" => "Uige",
+"16" => "Zaire",
+"17" => "Lunda Norte",
+"18" => "Lunda Sul",
+"19" => "Bengo",
+"20" => "Luanda"),
+"AR" => array(
+"01" => "Buenos Aires",
+"02" => "Catamarca",
+"03" => "Chaco",
+"04" => "Chubut",
+"05" => "Cordoba",
+"06" => "Corrientes",
+"07" => "Distrito Federal",
+"08" => "Entre Rios",
+"09" => "Formosa",
+"10" => "Jujuy",
+"11" => "La Pampa",
+"12" => "La Rioja",
+"13" => "Mendoza",
+"14" => "Misiones",
+"15" => "Neuquen",
+"16" => "Rio Negro",
+"17" => "Salta",
+"18" => "San Juan",
+"19" => "San Luis",
+"20" => "Santa Cruz",
+"21" => "Santa Fe",
+"22" => "Santiago del Estero",
+"23" => "Tierra del Fuego",
+"24" => "Tucuman"),
+"AT" => array(
+"01" => "Burgenland",
+"02" => "Karnten",
+"03" => "Niederosterreich",
+"04" => "Oberosterreich",
+"05" => "Salzburg",
+"06" => "Steiermark",
+"07" => "Tirol",
+"08" => "Vorarlberg",
+"09" => "Wien"),
+"AU" => array(
+"01" => "Australian Capital Territory",
+"02" => "New South Wales",
+"03" => "Northern Territory",
+"04" => "Queensland",
+"05" => "South Australia",
+"06" => "Tasmania",
+"07" => "Victoria",
+"08" => "Western Australia"),
+"AZ" => array(
+"01" => "Abseron",
+"02" => "Agcabadi",
+"03" => "Agdam",
+"04" => "Agdas",
+"05" => "Agstafa",
+"06" => "Agsu",
+"07" => "Ali Bayramli",
+"08" => "Astara",
+"09" => "Baki",
+"10" => "Balakan",
+"11" => "Barda",
+"12" => "Beylaqan",
+"13" => "Bilasuvar",
+"14" => "Cabrayil",
+"15" => "Calilabad",
+"16" => "Daskasan",
+"17" => "Davaci",
+"18" => "Fuzuli",
+"19" => "Gadabay",
+"20" => "Ganca",
+"21" => "Goranboy",
+"22" => "Goycay",
+"23" => "Haciqabul",
+"24" => "Imisli",
+"25" => "Ismayilli",
+"26" => "Kalbacar",
+"27" => "Kurdamir",
+"28" => "Lacin",
+"29" => "Lankaran",
+"30" => "Lankaran",
+"31" => "Lerik",
+"32" => "Masalli",
+"33" => "Mingacevir",
+"34" => "Naftalan",
+"35" => "Naxcivan",
+"36" => "Neftcala",
+"37" => "Oguz",
+"38" => "Qabala",
+"39" => "Qax",
+"40" => "Qazax",
+"41" => "Qobustan",
+"42" => "Quba",
+"43" => "Qubadli",
+"44" => "Qusar",
+"45" => "Saatli",
+"46" => "Sabirabad",
+"47" => "Saki",
+"48" => "Saki",
+"49" => "Salyan",
+"50" => "Samaxi",
+"51" => "Samkir",
+"52" => "Samux",
+"53" => "Siyazan",
+"54" => "Sumqayit",
+"55" => "Susa",
+"56" => "Susa",
+"57" => "Tartar",
+"58" => "Tovuz",
+"59" => "Ucar",
+"60" => "Xacmaz",
+"61" => "Xankandi",
+"62" => "Xanlar",
+"63" => "Xizi",
+"64" => "Xocali",
+"65" => "Xocavand",
+"66" => "Yardimli",
+"67" => "Yevlax",
+"68" => "Yevlax",
+"69" => "Zangilan",
+"70" => "Zaqatala",
+"71" => "Zardab"),
+"BA" => array(
+"01" => "Federation of Bosnia and Herzegovina",
+"02" => "Republika Srpska"),
+"BB" => array(
+"01" => "Christ Church",
+"02" => "Saint Andrew",
+"03" => "Saint George",
+"04" => "Saint James",
+"05" => "Saint John",
+"06" => "Saint Joseph",
+"07" => "Saint Lucy",
+"08" => "Saint Michael",
+"09" => "Saint Peter",
+"10" => "Saint Philip",
+"11" => "Saint Thomas"),
+"BD" => array(
+"01" => "Barisal",
+"04" => "Bandarban",
+"05" => "Comilla",
+"12" => "Mymensingh",
+"13" => "Noakhali",
+"15" => "Patuakhali",
+"22" => "Bagerhat",
+"23" => "Bhola",
+"24" => "Bogra",
+"25" => "Barguna",
+"26" => "Brahmanbaria",
+"27" => "Chandpur",
+"28" => "Chapai Nawabganj",
+"29" => "Chattagram",
+"30" => "Chuadanga",
+"31" => "Cox's Bazar",
+"32" => "Dhaka",
+"33" => "Dinajpur",
+"34" => "Faridpur",
+"35" => "Feni",
+"36" => "Gaibandha",
+"37" => "Gazipur",
+"38" => "Gopalganj",
+"39" => "Habiganj",
+"40" => "Jaipurhat",
+"41" => "Jamalpur",
+"42" => "Jessore",
+"43" => "Jhalakati",
+"44" => "Jhenaidah",
+"45" => "Khagrachari",
+"46" => "Khulna",
+"47" => "Kishorganj",
+"48" => "Kurigram",
+"49" => "Kushtia",
+"50" => "Laksmipur",
+"51" => "Lalmonirhat",
+"52" => "Madaripur",
+"53" => "Magura",
+"54" => "Manikganj",
+"55" => "Meherpur",
+"56" => "Moulavibazar",
+"57" => "Munshiganj",
+"58" => "Naogaon",
+"59" => "Narail",
+"60" => "Narayanganj",
+"61" => "Narsingdi",
+"62" => "Nator",
+"63" => "Netrakona",
+"64" => "Nilphamari",
+"65" => "Pabna",
+"66" => "Panchagar",
+"67" => "Parbattya Chattagram",
+"68" => "Pirojpur",
+"69" => "Rajbari",
+"70" => "Rajshahi",
+"71" => "Rangpur",
+"72" => "Satkhira",
+"73" => "Shariyatpur",
+"74" => "Sherpur",
+"75" => "Sirajganj",
+"76" => "Sunamganj",
+"77" => "Sylhet",
+"78" => "Tangail",
+"79" => "Thakurgaon"),
+"BE" => array(
+"01" => "Antwerpen",
+"02" => "Brabant",
+"03" => "Hainaut",
+"04" => "Liege",
+"05" => "Limburg",
+"06" => "Luxembourg",
+"07" => "Namur",
+"08" => "Oost-Vlaanderen",
+"09" => "West-Vlaanderen",
+"10" => "Brabant Wallon",
+"11" => "Brussels Hoofdstedelijk Gewest",
+"12" => "Vlaams-Brabant"),
+"BF" => array(
+"15" => "Bam",
+"16" => "Bazega",
+"17" => "Bougouriba",
+"18" => "Boulgou",
+"19" => "Boulkiemde",
+"20" => "Ganzourgou",
+"21" => "Gnagna",
+"22" => "Gourma",
+"23" => "Houet",
+"24" => "Kadiogo",
+"25" => "Kenedougou",
+"26" => "Komoe",
+"27" => "Kossi",
+"28" => "Kouritenga",
+"29" => "Mouhoun",
+"30" => "Namentenga",
+"31" => "Naouri",
+"32" => "Oubritenga",
+"33" => "Oudalan",
+"34" => "Passore",
+"35" => "Poni",
+"36" => "Sanguie",
+"37" => "Sanmatenga",
+"38" => "Seno",
+"39" => "Sissili",
+"40" => "Soum",
+"41" => "Sourou",
+"42" => "Tapoa",
+"43" => "Yatenga",
+"44" => "Zoundweogo"),
+"BG" => array(
+"33" => "Mikhaylovgrad",
+"38" => "Blagoevgrad",
+"39" => "Burgas",
+"40" => "Dobrich",
+"41" => "Gabrovo",
+"42" => "Grad Sofiya",
+"43" => "Khaskovo",
+"44" => "Kurdzhali",
+"45" => "Kyustendil",
+"46" => "Lovech",
+"47" => "Montana",
+"48" => "Pazardzhik",
+"49" => "Pernik",
+"50" => "Pleven",
+"51" => "Plovdiv",
+"52" => "Razgrad",
+"53" => "Ruse",
+"54" => "Shumen",
+"55" => "Silistra",
+"56" => "Sliven",
+"57" => "Smolyan",
+"58" => "Sofiya",
+"59" => "Stara Zagora",
+"60" => "Turgovishte",
+"61" => "Varna",
+"62" => "Veliko Turnovo",
+"63" => "Vidin",
+"64" => "Vratsa",
+"65" => "Yambol"),
+"BH" => array(
+"01" => "Al Hadd",
+"02" => "Al Manamah",
+"03" => "Al Muharraq",
+"05" => "Jidd Hafs",
+"06" => "Sitrah",
+"08" => "Al Mintaqah al Gharbiyah",
+"09" => "Mintaqat Juzur Hawar",
+"10" => "Al Mintaqah ash Shamaliyah",
+"11" => "Al Mintaqah al Wusta",
+"12" => "Madinat",
+"13" => "Ar Rifa",
+"14" => "Madinat Hamad"),
+"BI" => array(
+"02" => "Bujumbura",
+"09" => "Bubanza",
+"10" => "Bururi",
+"11" => "Cankuzo",
+"12" => "Cibitoke",
+"13" => "Gitega",
+"14" => "Karuzi",
+"15" => "Kayanza",
+"16" => "Kirundo",
+"17" => "Makamba",
+"18" => "Muyinga",
+"19" => "Ngozi",
+"20" => "Rutana",
+"21" => "Ruyigi",
+"22" => "Muramvya",
+"23" => "Mwaro"),
+"BJ" => array(
+"01" => "Atakora",
+"02" => "Atlantique",
+"03" => "Borgou",
+"04" => "Mono",
+"05" => "Oueme",
+"06" => "Zou"),
+"BM" => array(
+"01" => "Devonshire",
+"02" => "Hamilton",
+"03" => "Hamilton",
+"04" => "Paget",
+"05" => "Pembroke",
+"06" => "Saint George",
+"07" => "Saint George's",
+"08" => "Sandys",
+"09" => "Smiths",
+"10" => "Southampton",
+"11" => "Warwick"),
+"BN" => array(
+"01" => "Belait",
+"02" => "Brunei and Muara",
+"03" => "Temburong",
+"04" => "Tutong"),
+"BO" => array(
+"01" => "Chuquisaca",
+"02" => "Cochabamba",
+"03" => "El Beni",
+"04" => "La Paz",
+"05" => "Oruro",
+"06" => "Pando",
+"07" => "Potosi",
+"08" => "Santa Cruz",
+"09" => "Tarija"),
+"BR" => array(
+"01" => "Acre",
+"02" => "Alagoas",
+"03" => "Amapa",
+"04" => "Amazonas",
+"05" => "Bahia",
+"06" => "Ceara",
+"07" => "Distrito Federal",
+"08" => "Espirito Santo",
+"11" => "Mato Grosso do Sul",
+"13" => "Maranhao",
+"14" => "Mato Grosso",
+"15" => "Minas Gerais",
+"16" => "Para",
+"17" => "Paraiba",
+"18" => "Parana",
+"20" => "Piaui",
+"21" => "Rio de Janeiro",
+"22" => "Rio Grande do Norte",
+"23" => "Rio Grande do Sul",
+"24" => "Rondonia",
+"25" => "Roraima",
+"26" => "Santa Catarina",
+"27" => "Sao Paulo",
+"28" => "Sergipe",
+"29" => "Goias",
+"30" => "Pernambuco",
+"31" => "Tocantins"),
+"BS" => array(
+"05" => "Bimini",
+"06" => "Cat Island",
+"10" => "Exuma",
+"13" => "Inagua",
+"15" => "Long Island",
+"16" => "Mayaguana",
+"18" => "Ragged Island",
+"22" => "Harbour Island",
+"23" => "New Providence",
+"24" => "Acklins and Crooked Islands",
+"25" => "Freeport",
+"26" => "Fresh Creek",
+"27" => "Governor's Harbour",
+"28" => "Green Turtle Cay",
+"29" => "High Rock",
+"30" => "Kemps Bay",
+"31" => "Marsh Harbour",
+"32" => "Nichollstown and Berry Islands",
+"33" => "Rock Sound",
+"34" => "Sandy Point",
+"35" => "San Salvador and Rum Cay"),
+"BT" => array(
+"05" => "Bumthang",
+"06" => "Chhukha",
+"07" => "Chirang",
+"08" => "Daga",
+"09" => "Geylegphug",
+"10" => "Ha",
+"11" => "Lhuntshi",
+"12" => "Mongar",
+"13" => "Paro",
+"14" => "Pemagatsel",
+"15" => "Punakha",
+"16" => "Samchi",
+"17" => "Samdrup",
+"18" => "Shemgang",
+"19" => "Tashigang",
+"20" => "Thimphu",
+"21" => "Tongsa",
+"22" => "Wangdi Phodrang"),
+"BW" => array(
+"01" => "Central",
+"02" => "Chobe",
+"03" => "Ghanzi",
+"04" => "Kgalagadi",
+"05" => "Kgatleng",
+"06" => "Kweneng",
+"07" => "Ngamiland",
+"08" => "North-East",
+"09" => "South-East",
+"10" => "Southern"),
+"BY" => array(
+"01" => "Brestskaya Voblasts'",
+"02" => "Homyel'skaya Voblasts'",
+"03" => "Hrodzyenskaya Voblasts'",
+"04" => "Minsk",
+"05" => "Minskaya Voblasts'",
+"06" => "Mahilyowskaya Voblasts'",
+"07" => "Vitsyebskaya Voblasts'"),
+"BZ" => array(
+"01" => "Belize",
+"02" => "Cayo",
+"03" => "Corozal",
+"04" => "Orange Walk",
+"05" => "Stann Creek",
+"06" => "Toledo"),
+"CF" => array(
+"01" => "Bamingui-Bangoran",
+"02" => "Basse-Kotto",
+"03" => "Haute-Kotto",
+"04" => "Haute-Sangha",
+"05" => "Haut-Mbomou",
+"06" => "Kemo-Gribingui",
+"07" => "Lobaye",
+"08" => "Mbomou",
+"09" => "Nana-Mambere",
+"11" => "Ouaka",
+"12" => "Ouham",
+"13" => "Ouham-Pende",
+"14" => "Vakaga",
+"15" => "Gribingui",
+"16" => "Sangha",
+"17" => "Ombella-Mpoko",
+"18" => "Bangui"),
+"CG" => array(
+"01" => "Bouenza",
+"03" => "Cuvette",
+"04" => "Kouilou",
+"05" => "Lekoumou",
+"06" => "Likouala",
+"07" => "Niari",
+"08" => "Plateaux",
+"10" => "Sangha",
+"11" => "Pool",
+"12" => "Brazzaville"),
+"CH" => array(
+"01" => "Aargau",
+"02" => "Ausser-Rhoden",
+"03" => "Basel-Landschaft",
+"04" => "Basel-Stadt",
+"05" => "Bern",
+"06" => "Fribourg",
+"07" => "Geneve",
+"08" => "Glarus",
+"09" => "Graubunden",
+"10" => "Inner-Rhoden",
+"11" => "Luzern",
+"12" => "Neuchatel",
+"13" => "Nidwalden",
+"14" => "Obwalden",
+"15" => "Sankt Gallen",
+"16" => "Schaffhausen",
+"17" => "Schwyz",
+"18" => "Solothurn",
+"19" => "Thurgau",
+"20" => "Ticino",
+"21" => "Uri",
+"22" => "Valais",
+"23" => "Vaud",
+"24" => "Zug",
+"25" => "Zurich",
+"26" => "Jura"),
+"CI" => array(
+"01" => "Abengourou",
+"03" => "Dabakala",
+"05" => "Adzope",
+"06" => "Agboville",
+"07" => "Biankouma",
+"11" => "Bouna",
+"12" => "Boundiali",
+"14" => "Danane",
+"16" => "Divo",
+"17" => "Ferkessedougou",
+"18" => "Gagnoa",
+"20" => "Katiola",
+"21" => "Korhogo",
+"23" => "Odienne",
+"25" => "Seguela",
+"26" => "Touba",
+"27" => "Bongouanou",
+"28" => "Issia",
+"29" => "Lakota",
+"30" => "Mankono",
+"31" => "Oume",
+"32" => "Soubre",
+"33" => "Tingrela",
+"34" => "Zuenoula",
+"36" => "Bangolo",
+"37" => "Beoumi",
+"38" => "Bondoukou",
+"39" => "Bouafle",
+"40" => "Bouake",
+"41" => "Daloa",
+"42" => "Daoukro",
+"44" => "Duekoue",
+"45" => "Grand-Lahou",
+"47" => "Man",
+"48" => "Mbahiakro",
+"49" => "Sakassou",
+"50" => "San Pedro",
+"51" => "Sassandra",
+"52" => "Sinfra",
+"53" => "Tabou",
+"54" => "Tanda",
+"55" => "Tiassale",
+"56" => "Toumodi",
+"57" => "Vavoua",
+"61" => "Abidjan",
+"62" => "Aboisso",
+"63" => "Adiake",
+"64" => "Alepe",
+"65" => "Bocanda",
+"66" => "Dabou",
+"67" => "Dimbokro",
+"68" => "Grand-Bassam",
+"69" => "Guiglo",
+"70" => "Jacqueville",
+"71" => "Tiebissou",
+"72" => "Toulepleu",
+"73" => "Yamoussoukro"),
+"CL" => array(
+"01" => "Valparaiso",
+"02" => "Aisen del General Carlos Ibanez del Campo",
+"03" => "Antofagasta",
+"04" => "Araucania",
+"05" => "Atacama",
+"06" => "Bio-Bio",
+"07" => "Coquimbo",
+"08" => "Libertador General Bernardo O'Higgins",
+"09" => "Los Lagos",
+"10" => "Magallanes y de la Antartica Chilena",
+"11" => "Maule",
+"12" => "Region Metropolitana",
+"13" => "Tarapaca"),
+"CM" => array(
+"04" => "Est",
+"05" => "Littoral",
+"07" => "Nord-Ouest",
+"08" => "Ouest",
+"09" => "Sud-Ouest",
+"10" => "Adamaoua",
+"11" => "Centre",
+"12" => "Extreme-Nord",
+"13" => "Nord",
+"14" => "Sud"),
+"CN" => array(
+"01" => "Anhui",
+"02" => "Zhejiang",
+"03" => "Jiangxi",
+"04" => "Jiangsu",
+"05" => "Jilin",
+"06" => "Qinghai",
+"07" => "Fujian",
+"08" => "Heilongjiang",
+"09" => "Henan",
+"10" => "Hebei",
+"11" => "Hunan",
+"12" => "Hubei",
+"13" => "Xinjiang",
+"14" => "Xizang",
+"15" => "Gansu",
+"16" => "Guangxi",
+"18" => "Guizhou",
+"19" => "Liaoning",
+"20" => "Nei Mongol",
+"21" => "Ningxia",
+"22" => "Beijing",
+"23" => "Shanghai",
+"24" => "Shanxi",
+"25" => "Shandong",
+"26" => "Shaanxi",
+"27" => "Sichuan",
+"28" => "Tianjin",
+"29" => "Yunnan",
+"30" => "Guangdong",
+"31" => "Hainan"),
+"CO" => array(
+"01" => "Amazonas",
+"02" => "Antioquia",
+"03" => "Arauca",
+"04" => "Atlantico",
+"08" => "Caqueta",
+"09" => "Cauca",
+"10" => "Cesar",
+"11" => "Choco",
+"12" => "Cordoba",
+"14" => "Guaviare",
+"15" => "Guainia",
+"16" => "Huila",
+"17" => "La Guajira",
+"19" => "Meta",
+"20" => "Narino",
+"21" => "Norte de Santander",
+"22" => "Putumayo",
+"23" => "Quindio",
+"24" => "Risaralda",
+"25" => "San Andres y Providencia",
+"26" => "Santander",
+"27" => "Sucre",
+"28" => "Tolima",
+"29" => "Valle del Cauca",
+"30" => "Vaupes",
+"31" => "Vichada",
+"32" => "Casanare",
+"33" => "Cundinamarca",
+"34" => "Distrito Especial",
+"35" => "Bolivar",
+"36" => "Boyaca",
+"37" => "Caldas",
+"38" => "Magdalena"),
+"CR" => array(
+"01" => "Alajuela",
+"02" => "Cartago",
+"03" => "Guanacaste",
+"04" => "Heredia",
+"06" => "Limon",
+"07" => "Puntarenas",
+"08" => "San Jose"),
+"CU" => array(
+"01" => "Pinar del Rio",
+"02" => "Ciudad de la Habana",
+"03" => "Matanzas",
+"04" => "Isla de la Juventud",
+"05" => "Camaguey",
+"07" => "Ciego de Avila",
+"08" => "Cienfuegos",
+"09" => "Granma",
+"10" => "Guantanamo",
+"11" => "La Habana",
+"12" => "Holguin",
+"13" => "Las Tunas",
+"14" => "Sancti Spiritus",
+"15" => "Santiago de Cuba",
+"16" => "Villa Clara"),
+"CV" => array(
+"01" => "Boa Vista",
+"02" => "Brava",
+"03" => "Fogo",
+"04" => "Maio",
+"05" => "Paul",
+"06" => "Praia",
+"07" => "Ribeira Grande",
+"08" => "Sal",
+"09" => "Santa Catarina",
+"10" => "Sao Nicolau",
+"11" => "Sao Vicente",
+"12" => "Tarrafal"),
+"CY" => array(
+"01" => "Famagusta",
+"02" => "Kyrenia",
+"03" => "Larnaca",
+"04" => "Nicosia",
+"05" => "Limassol",
+"06" => "Paphos"),
+"CZ" => array(
+"52" => "Hlavni Mesto Praha",
+"78" => "Jihomoravsky Kraj",
+"79" => "Jihocesky Kraj",
+"80" => "Vysocina",
+"81" => "Karlovarsky Kraj",
+"82" => "Kralovehradecky Kraj",
+"83" => "Liberecky Kraj",
+"84" => "Olomoucky Kraj",
+"85" => "Moravskoslezsky Kraj",
+"86" => "Pardubicky Kraj",
+"87" => "Plzensky Kraj",
+"88" => "Stredocesky Kraj",
+"89" => "Ustecky Kraj",
+"90" => "Zlinsky Kraj"),
+"DE" => array(
+"01" => "Baden-Wurttemberg",
+"02" => "Bayern",
+"03" => "Bremen",
+"04" => "Hamburg",
+"05" => "Hessen",
+"06" => "Niedersachsen",
+"07" => "Nordrhein-Westfalen",
+"08" => "Rheinland-Pfalz",
+"09" => "Saarland",
+"10" => "Schleswig-Holstein",
+"11" => "Brandenburg",
+"12" => "Mecklenburg-Vorpommern",
+"13" => "Sachsen",
+"14" => "Sachsen-Anhalt",
+"15" => "Thuringen",
+"16" => "Berlin"),
+"DJ" => array(
+"02" => "Dikhil",
+"03" => "Djibouti",
+"04" => "Obock",
+"05" => "Tadjoura"),
+"DK" => array(
+"01" => "Arhus",
+"02" => "Bornholm",
+"03" => "Frederiksborg",
+"04" => "Fyn",
+"05" => "Kobenhavn",
+"06" => "Staden Kobenhavn",
+"07" => "Nordjylland",
+"08" => "Ribe",
+"09" => "Ringkobing",
+"10" => "Roskilde",
+"11" => "Sonderjylland",
+"12" => "Storstrom",
+"13" => "Vejle",
+"14" => "Vestsjalland",
+"15" => "Viborg"),
+"DM" => array(
+"02" => "Saint Andrew",
+"03" => "Saint David",
+"04" => "Saint George",
+"05" => "Saint John",
+"06" => "Saint Joseph",
+"07" => "Saint Luke",
+"08" => "Saint Mark",
+"09" => "Saint Patrick",
+"10" => "Saint Paul",
+"11" => "Saint Peter"),
+"DO" => array(
+"01" => "Azua",
+"02" => "Baoruco",
+"03" => "Barahona",
+"04" => "Dajabon",
+"05" => "Distrito Nacional",
+"06" => "Duarte",
+"08" => "Espaillat",
+"09" => "Independencia",
+"10" => "La Altagracia",
+"11" => "Elias Pina",
+"12" => "La Romana",
+"14" => "Maria Trinidad Sanchez",
+"15" => "Monte Cristi",
+"16" => "Pedernales",
+"17" => "Peravia",
+"18" => "Puerto Plata",
+"19" => "Salcedo",
+"20" => "Samana",
+"21" => "Sanchez Ramirez",
+"23" => "San Juan",
+"24" => "San Pedro De Macoris",
+"25" => "Santiago",
+"26" => "Santiago Rodriguez",
+"27" => "Valverde",
+"28" => "El Seibo",
+"29" => "Hato Mayor",
+"30" => "La Vega",
+"31" => "Monsenor Nouel",
+"32" => "Monte Plata",
+"33" => "San Cristobal"),
+"DZ" => array(
+"01" => "Alger",
+"03" => "Batna",
+"04" => "Constantine",
+"06" => "Medea",
+"07" => "Mostaganem",
+"09" => "Oran",
+"10" => "Saida",
+"12" => "Setif",
+"13" => "Tiaret",
+"14" => "Tizi Ouzou",
+"15" => "Tlemcen",
+"18" => "Bejaia",
+"19" => "Biskra",
+"20" => "Blida",
+"21" => "Bouira",
+"22" => "Djelfa",
+"23" => "Guelma",
+"24" => "Jijel",
+"25" => "Laghouat",
+"26" => "Mascara",
+"27" => "M'sila",
+"29" => "Oum el Bouaghi",
+"30" => "Sidi Bel Abbes",
+"31" => "Skikda",
+"33" => "Tebessa",
+"34" => "Adrar",
+"35" => "Ain Defla",
+"36" => "Ain Temouchent",
+"37" => "Annaba",
+"38" => "Bechar",
+"39" => "Bordj Bou Arreridj",
+"40" => "Boumerdes",
+"41" => "Chlef",
+"42" => "El Bayadh",
+"43" => "El Oued",
+"44" => "El Tarf",
+"45" => "Ghardaia",
+"46" => "Illizi",
+"47" => "Khenchela",
+"48" => "Mila",
+"49" => "Naama",
+"50" => "Ouargla",
+"51" => "Relizane",
+"52" => "Souk Ahras",
+"53" => "Tamanghasset",
+"54" => "Tindouf",
+"55" => "Tipaza",
+"56" => "Tissemsilt"),
+"EC" => array(
+"01" => "Galapagos",
+"02" => "Azuay",
+"03" => "Bolivar",
+"04" => "Canar",
+"05" => "Carchi",
+"06" => "Chimborazo",
+"07" => "Cotopaxi",
+"08" => "El Oro",
+"09" => "Esmeraldas",
+"10" => "Guayas",
+"11" => "Imbabura",
+"12" => "Loja",
+"13" => "Los Rios",
+"14" => "Manabi",
+"15" => "Morona-Santiago",
+"17" => "Pastaza",
+"18" => "Pichincha",
+"19" => "Tungurahua",
+"20" => "Zamora-Chinchipe",
+"22" => "Sucumbios",
+"23" => "Napo",
+"24" => "Orellana"),
+"EE" => array(
+"01" => "Harjumaa",
+"02" => "Hiiumaa",
+"03" => "Ida-Virumaa",
+"04" => "Jarvamaa",
+"05" => "Jogevamaa",
+"06" => "Kohtla-Jarve",
+"07" => "Laanemaa",
+"08" => "Laane-Virumaa",
+"09" => "Narva",
+"10" => "Parnu",
+"11" => "Parnumaa",
+"12" => "Polvamaa",
+"13" => "Raplamaa",
+"14" => "Saaremaa",
+"15" => "Sillamae",
+"16" => "Tallinn",
+"17" => "Tartu",
+"18" => "Tartumaa",
+"19" => "Valgamaa",
+"20" => "Viljandimaa",
+"21" => "Vorumaa"),
+"EG" => array(
+"01" => "Ad Daqahliyah",
+"02" => "Al Bahr al Ahmar",
+"03" => "Al Buhayrah",
+"04" => "Al Fayyum",
+"05" => "Al Gharbiyah",
+"06" => "Al Iskandariyah",
+"07" => "Al Isma'iliyah",
+"08" => "Al Jizah",
+"09" => "Al Minufiyah",
+"10" => "Al Minya",
+"11" => "Al Qahirah",
+"12" => "Al Qalyubiyah",
+"13" => "Al Wadi al Jadid",
+"14" => "Ash Sharqiyah",
+"15" => "As Suways",
+"16" => "Aswan",
+"17" => "Asyut",
+"18" => "Bani Suwayf",
+"19" => "Bur Sa'id",
+"20" => "Dumyat",
+"21" => "Kafr ash Shaykh",
+"22" => "Matruh",
+"23" => "Qina",
+"24" => "Suhaj",
+"26" => "Janub Sina'",
+"27" => "Shamal Sina'"),
+"ES" => array(
+"07" => "Islas Baleares",
+"27" => "La Rioja",
+"29" => "Madrid",
+"31" => "Murcia",
+"32" => "Navarra",
+"34" => "Asturias",
+"39" => "Cantabria",
+"51" => "Andalucia",
+"52" => "Aragon",
+"53" => "Canarias",
+"54" => "Castilla-La Mancha",
+"55" => "Castilla y Leon",
+"56" => "Cataluna",
+"57" => "Extremadura",
+"58" => "Galicia",
+"59" => "Pais Vasco",
+"60" => "Valenciana"),
+"ET" => array(
+"02" => "Amhara",
+"07" => "Somali",
+"08" => "Gambella",
+"10" => "Addis Abeba",
+"11" => "Southern",
+"12" => "Tigray",
+"13" => "Benishangul",
+"14" => "Afar",
+"44" => "Adis Abeba",
+"45" => "Afar",
+"46" => "Amara",
+"47" => "Binshangul Gumuz",
+"48" => "Dire Dawa",
+"49" => "Gambela Hizboch",
+"50" => "Hareri Hizb",
+"51" => "Oromiya",
+"52" => "Sumale",
+"53" => "Tigray",
+"54" => "YeDebub Biheroch Bihereseboch na Hizboch"),
+"FI" => array(
+"01" => "�?land",
+"06" => "Lapland",
+"08" => "Oulu",
+"13" => "Southern Finland",
+"14" => "Eastern Finland",
+"15" => "Western Finland"),
+"FJ" => array(
+"01" => "Central",
+"02" => "Eastern",
+"03" => "Northern",
+"04" => "Rotuma",
+"05" => "Western"),
+"FM" => array(
+"01" => "Kosrae",
+"02" => "Pohnpei",
+"03" => "Chuuk",
+"04" => "Yap"),
+"FR" => array(
+"97" => "Aquitaine",
+"98" => "Auvergne",
+"99" => "Basse-Normandie",
+"A1" => "Bourgogne",
+"A2" => "Bretagne",
+"A3" => "Centre",
+"A4" => "Champagne-Ardenne",
+"A5" => "Corse",
+"A6" => "Franche-Comte",
+"A7" => "Haute-Normandie",
+"A8" => "Ile-de-France",
+"A9" => "Languedoc-Roussillon",
+"B1" => "Limousin",
+"B2" => "Lorraine",
+"B3" => "Midi-Pyrenees",
+"B4" => "Nord-Pas-de-Calais",
+"B5" => "Pays de la Loire",
+"B6" => "Picardie",
+"B7" => "Poitou-Charentes",
+"B8" => "Provence-Alpes-Cote d'Azur",
+"B9" => "Rhone-Alpes",
+"C1" => "Alsace"),
+"GA" => array(
+"01" => "Estuaire",
+"02" => "Haut-Ogooue",
+"03" => "Moyen-Ogooue",
+"04" => "Ngounie",
+"05" => "Nyanga",
+"06" => "Ogooue-Ivindo",
+"07" => "Ogooue-Lolo",
+"08" => "Ogooue-Maritime",
+"09" => "Woleu-Ntem"),
+"GB" => array(
+"01" => "Avon",
+"03" => "Berkshire",
+"07" => "Cleveland",
+"08" => "Cornwall",
+"09" => "Cumbria",
+"17" => "Greater London",
+"18" => "Greater Manchester",
+"20" => "Hereford and Worcester",
+"22" => "Humberside",
+"28" => "Merseyside",
+"37" => "South Yorkshire",
+"41" => "Tyne and Wear",
+"43" => "West Midlands",
+"45" => "West Yorkshire",
+"79" => "Central",
+"82" => "Grampian",
+"84" => "Lothian",
+"87" => "Strathclyde",
+"88" => "Tayside",
+"90" => "Clwyd",
+"91" => "Dyfed",
+"92" => "Gwent",
+"94" => "Mid Glamorgan",
+"96" => "South Glamorgan",
+"97" => "West Glamorgan",
+"A1" => "Barking and Dagenham",
+"A2" => "Barnet",
+"A3" => "Barnsley",
+"A4" => "Bath and North East Somerset",
+"A5" => "Bedfordshire",
+"A6" => "Bexley",
+"A7" => "Birmingham",
+"A8" => "Blackburn with Darwen",
+"A9" => "Blackpool",
+"B1" => "Bolton",
+"B2" => "Bournemouth",
+"B3" => "Bracknell Forest",
+"B4" => "Bradford",
+"B5" => "Brent",
+"B6" => "Brighton and Hove",
+"B7" => "Bristol, City of",
+"B8" => "Bromley",
+"B9" => "Buckinghamshire",
+"C1" => "Bury",
+"C2" => "Calderdale",
+"C3" => "Cambridgeshire",
+"C4" => "Camden",
+"C5" => "Cheshire",
+"C7" => "Coventry",
+"C8" => "Croydon",
+"D1" => "Darlington",
+"D2" => "Derby",
+"D3" => "Derbyshire",
+"D4" => "Devon",
+"D5" => "Doncaster",
+"D6" => "Dorset",
+"D7" => "Dudley",
+"D8" => "Durham",
+"D9" => "Ealing",
+"E1" => "East Riding of Yorkshire",
+"E2" => "East Sussex",
+"E3" => "Enfield",
+"E4" => "Essex",
+"E5" => "Gateshead",
+"E6" => "Gloucestershire",
+"E7" => "Greenwich",
+"E8" => "Hackney",
+"E9" => "Halton",
+"F1" => "Hammersmith and Fulham",
+"F2" => "Hampshire",
+"F3" => "Haringey",
+"F4" => "Harrow",
+"F5" => "Hartlepool",
+"F6" => "Havering",
+"F7" => "Herefordshire",
+"F8" => "Hertford",
+"F9" => "Hillingdon",
+"G1" => "Hounslow",
+"G2" => "Isle of Wight",
+"G3" => "Islington",
+"G4" => "Kensington and Chelsea",
+"G5" => "Kent",
+"G6" => "Kingston upon Hull, City of",
+"G7" => "Kingston upon Thames",
+"G8" => "Kirklees",
+"G9" => "Knowsley",
+"H1" => "Lambeth",
+"H2" => "Lancashire",
+"H3" => "Leeds",
+"H4" => "Leicester",
+"H5" => "Leicestershire",
+"H6" => "Lewisham",
+"H7" => "Lincolnshire",
+"H8" => "Liverpool",
+"H9" => "London, City of",
+"I1" => "Luton",
+"I2" => "Manchester",
+"I3" => "Medway",
+"I4" => "Merton",
+"I5" => "Middlesbrough",
+"I6" => "Milton Keynes",
+"I7" => "Newcastle upon Tyne",
+"I8" => "Newham",
+"I9" => "Norfolk",
+"J1" => "Northamptonshire",
+"J2" => "North East Lincolnshire",
+"J3" => "North Lincolnshire",
+"J4" => "North Somerset",
+"J5" => "North Tyneside",
+"J6" => "Northumberland",
+"J7" => "North Yorkshire",
+"J8" => "Nottingham",
+"J9" => "Nottinghamshire",
+"K1" => "Oldham",
+"K2" => "Oxfordshire",
+"K3" => "Peterborough",
+"K4" => "Plymouth",
+"K5" => "Poole",
+"K6" => "Portsmouth",
+"K7" => "Reading",
+"K8" => "Redbridge",
+"K9" => "Redcar and Cleveland",
+"L1" => "Richmond upon Thames",
+"L2" => "Rochdale",
+"L3" => "Rotherham",
+"L4" => "Rutland",
+"L5" => "Salford",
+"L6" => "Shropshire",
+"L7" => "Sandwell",
+"L8" => "Sefton",
+"L9" => "Sheffield",
+"M1" => "Slough",
+"M2" => "Solihull",
+"M3" => "Somerset",
+"M4" => "Southampton",
+"M5" => "Southend-on-Sea",
+"M6" => "South Gloucestershire",
+"M7" => "South Tyneside",
+"M8" => "Southwark",
+"M9" => "Staffordshire",
+"N1" => "St. Helens",
+"N2" => "Stockport",
+"N3" => "Stockton-on-Tees",
+"N4" => "Stoke-on-Trent",
+"N5" => "Suffolk",
+"N6" => "Sunderland",
+"N7" => "Surrey",
+"N8" => "Sutton",
+"N9" => "Swindon",
+"O1" => "Tameside",
+"O2" => "Telford and Wrekin",
+"O3" => "Thurrock",
+"O4" => "Torbay",
+"O5" => "Tower Hamlets",
+"O6" => "Trafford",
+"O7" => "Wakefield",
+"O8" => "Walsall",
+"O9" => "Waltham Forest",
+"P1" => "Wandsworth",
+"P2" => "Warrington",
+"P3" => "Warwickshire",
+"P4" => "West Berkshire",
+"P5" => "Westminster",
+"P6" => "West Sussex",
+"P7" => "Wigan",
+"P8" => "Wiltshire",
+"P9" => "Windsor and Maidenhead",
+"Q1" => "Wirral",
+"Q2" => "Wokingham",
+"Q3" => "Wolverhampton",
+"Q4" => "Worcestershire",
+"Q5" => "York",
+"Q6" => "Antrim",
+"Q7" => "Ards",
+"Q8" => "Armagh",
+"Q9" => "Ballymena",
+"R1" => "Ballymoney",
+"R2" => "Banbridge",
+"R3" => "Belfast",
+"R4" => "Carrickfergus",
+"R5" => "Castlereagh",
+"R6" => "Coleraine",
+"R7" => "Cookstown",
+"R8" => "Craigavon",
+"R9" => "Down",
+"S1" => "Dungannon",
+"S2" => "Fermanagh",
+"S3" => "Larne",
+"S4" => "Limavady",
+"S5" => "Lisburn",
+"S6" => "Derry",
+"S7" => "Magherafelt",
+"S8" => "Moyle",
+"S9" => "Newry and Mourne",
+"T1" => "Newtownabbey",
+"T2" => "North Down",
+"T3" => "Omagh",
+"T4" => "Strabane",
+"T5" => "Aberdeen City",
+"T6" => "Aberdeenshire",
+"T7" => "Angus",
+"T8" => "Argyll and Bute",
+"T9" => "Scottish Borders, The",
+"U1" => "Clackmannanshire",
+"U2" => "Dumfries and Galloway",
+"U3" => "Dundee City",
+"U4" => "East Ayrshire",
+"U5" => "East Dunbartonshire",
+"U6" => "East Lothian",
+"U7" => "East Renfrewshire",
+"U8" => "Edinburgh, City of",
+"U9" => "Falkirk",
+"V1" => "Fife",
+"V2" => "Glasgow City",
+"V3" => "Highland",
+"V4" => "Inverclyde",
+"V5" => "Midlothian",
+"V6" => "Moray",
+"V7" => "North Ayrshire",
+"V8" => "North Lanarkshire",
+"V9" => "Orkney",
+"W1" => "Perth and Kinross",
+"W2" => "Renfrewshire",
+"W3" => "Shetland Islands",
+"W4" => "South Ayrshire",
+"W5" => "South Lanarkshire",
+"W6" => "Stirling",
+"W7" => "West Dunbartonshire",
+"W8" => "Eilean Siar",
+"W9" => "West Lothian",
+"X1" => "Isle of Anglesey",
+"X2" => "Blaenau Gwent",
+"X3" => "Bridgend",
+"X4" => "Caerphilly",
+"X5" => "Cardiff",
+"X6" => "Ceredigion",
+"X7" => "Carmarthenshire",
+"X8" => "Conwy",
+"X9" => "Denbighshire",
+"Y1" => "Flintshire",
+"Y2" => "Gwynedd",
+"Y3" => "Merthyr Tydfil",
+"Y4" => "Monmouthshire",
+"Y5" => "Neath Port Talbot",
+"Y6" => "Newport",
+"Y7" => "Pembrokeshire",
+"Y8" => "Powys",
+"Y9" => "Rhondda Cynon Taff",
+"Z1" => "Swansea",
+"Z2" => "Torfaen",
+"Z3" => "Vale of Glamorgan, The",
+"Z4" => "Wrexham"),
+"GD" => array(
+"01" => "Saint Andrew",
+"02" => "Saint David",
+"03" => "Saint George",
+"04" => "Saint John",
+"05" => "Saint Mark",
+"06" => "Saint Patrick"),
+"GE" => array(
+"01" => "Abashis Raioni",
+"02" => "Abkhazia",
+"03" => "Adigenis Raioni",
+"04" => "Ajaria",
+"05" => "Akhalgoris Raioni",
+"06" => "Akhalk'alak'is Raioni",
+"07" => "Akhalts'ikhis Raioni",
+"08" => "Akhmetis Raioni",
+"09" => "Ambrolauris Raioni",
+"10" => "Aspindzis Raioni",
+"11" => "Baghdat'is Raioni",
+"12" => "Bolnisis Raioni",
+"13" => "Borjomis Raioni",
+"14" => "Chiat'ura",
+"15" => "Ch'khorotsqus Raioni",
+"16" => "Ch'okhatauris Raioni",
+"17" => "Dedop'listsqaros Raioni",
+"18" => "Dmanisis Raioni",
+"19" => "Dushet'is Raioni",
+"20" => "Gardabanis Raioni",
+"21" => "Gori",
+"22" => "Goris Raioni",
+"23" => "Gurjaanis Raioni",
+"24" => "Javis Raioni",
+"25" => "K'arelis Raioni",
+"26" => "Kaspis Raioni",
+"27" => "Kharagaulis Raioni",
+"28" => "Khashuris Raioni",
+"29" => "Khobis Raioni",
+"30" => "Khonis Raioni",
+"31" => "K'ut'aisi",
+"32" => "Lagodekhis Raioni",
+"33" => "Lanch'khut'is Raioni",
+"34" => "Lentekhis Raioni",
+"35" => "Marneulis Raioni",
+"36" => "Martvilis Raioni",
+"37" => "Mestiis Raioni",
+"38" => "Mts'khet'is Raioni",
+"39" => "Ninotsmindis Raioni",
+"40" => "Onis Raioni",
+"41" => "Ozurget'is Raioni",
+"42" => "P'ot'i",
+"43" => "Qazbegis Raioni",
+"44" => "Qvarlis Raioni",
+"45" => "Rust'avi",
+"46" => "Sach'kheris Raioni",
+"47" => "Sagarejos Raioni",
+"48" => "Samtrediis Raioni",
+"49" => "Senakis Raioni",
+"50" => "Sighnaghis Raioni",
+"51" => "T'bilisi",
+"52" => "T'elavis Raioni",
+"53" => "T'erjolis Raioni",
+"54" => "T'et'ritsqaros Raioni",
+"55" => "T'ianet'is Raioni",
+"56" => "Tqibuli",
+"57" => "Ts'ageris Raioni",
+"58" => "Tsalenjikhis Raioni",
+"59" => "Tsalkis Raioni",
+"60" => "Tsqaltubo",
+"61" => "Vanis Raioni",
+"62" => "Zestap'onis Raioni",
+"63" => "Zugdidi",
+"64" => "Zugdidis Raioni"),
+"GH" => array(
+"01" => "Greater Accra",
+"02" => "Ashanti",
+"03" => "Brong-Ahafo",
+"04" => "Central",
+"05" => "Eastern",
+"06" => "Northern",
+"08" => "Volta",
+"09" => "Western",
+"10" => "Upper East",
+"11" => "Upper West"),
+"GL" => array(
+"01" => "Nordgronland",
+"02" => "Ostgronland",
+"03" => "Vestgronland"),
+"GM" => array(
+"01" => "Banjul",
+"02" => "Lower River",
+"03" => "MacCarthy Island",
+"04" => "Upper River",
+"05" => "Western",
+"07" => "North Bank"),
+"GN" => array(
+"01" => "Beyla",
+"02" => "Boffa",
+"03" => "Boke",
+"04" => "Conakry",
+"05" => "Dabola",
+"06" => "Dalaba",
+"07" => "Dinguiraye",
+"09" => "Faranah",
+"10" => "Forecariah",
+"11" => "Fria",
+"12" => "Gaoual",
+"13" => "Gueckedou",
+"15" => "Kerouane",
+"16" => "Kindia",
+"17" => "Kissidougou",
+"18" => "Koundara",
+"19" => "Kouroussa",
+"21" => "Macenta",
+"22" => "Mali",
+"23" => "Mamou",
+"25" => "Pita",
+"27" => "Telimele",
+"28" => "Tougue",
+"29" => "Yomou",
+"30" => "Coyah",
+"31" => "Dubreka",
+"32" => "Kankan",
+"33" => "Koubia",
+"34" => "Labe",
+"35" => "Lelouma",
+"36" => "Lola",
+"37" => "Mandiana",
+"38" => "Nzerekore",
+"39" => "Siguiri"),
+"GQ" => array(
+"03" => "Annobon",
+"04" => "Bioko Norte",
+"05" => "Bioko Sur",
+"06" => "Centro Sur",
+"07" => "Kie-Ntem",
+"08" => "Litoral",
+"09" => "Wele-Nzas"),
+"GR" => array(
+"01" => "Evros",
+"02" => "Rodhopi",
+"03" => "Xanthi",
+"04" => "Drama",
+"05" => "Serrai",
+"06" => "Kilkis",
+"07" => "Pella",
+"08" => "Florina",
+"09" => "Kastoria",
+"10" => "Grevena",
+"11" => "Kozani",
+"12" => "Imathia",
+"13" => "Thessaloniki",
+"14" => "Kavala",
+"15" => "Khalkidhiki",
+"16" => "Pieria",
+"17" => "Ioannina",
+"18" => "Thesprotia",
+"19" => "Preveza",
+"20" => "Arta",
+"21" => "Larisa",
+"22" => "Trikala",
+"23" => "Kardhitsa",
+"24" => "Magnisia",
+"25" => "Kerkira",
+"26" => "Levkas",
+"27" => "Kefallinia",
+"28" => "Zakinthos",
+"29" => "Fthiotis",
+"30" => "Evritania",
+"31" => "Aitolia kai Akarnania",
+"32" => "Fokis",
+"33" => "Voiotia",
+"34" => "Evvoia",
+"35" => "Attiki",
+"36" => "Argolis",
+"37" => "Korinthia",
+"38" => "Akhaia",
+"39" => "Ilia",
+"40" => "Messinia",
+"41" => "Arkadhia",
+"42" => "Lakonia",
+"43" => "Khania",
+"44" => "Rethimni",
+"45" => "Iraklion",
+"46" => "Lasithi",
+"47" => "Dhodhekanisos",
+"48" => "Samos",
+"49" => "Kikladhes",
+"50" => "Khios",
+"51" => "Lesvos"),
+"GT" => array(
+"01" => "Alta Verapaz",
+"02" => "Baja Verapaz",
+"03" => "Chimaltenango",
+"04" => "Chiquimula",
+"05" => "El Progreso",
+"06" => "Escuintla",
+"07" => "Guatemala",
+"08" => "Huehuetenango",
+"09" => "Izabal",
+"10" => "Jalapa",
+"11" => "Jutiapa",
+"12" => "Peten",
+"13" => "Quetzaltenango",
+"14" => "Quiche",
+"15" => "Retalhuleu",
+"16" => "Sacatepequez",
+"17" => "San Marcos",
+"18" => "Santa Rosa",
+"19" => "Solola",
+"20" => "Suchitepequez",
+"21" => "Totonicapan",
+"22" => "Zacapa"),
+"GW" => array(
+"01" => "Bafata",
+"02" => "Quinara",
+"04" => "Oio",
+"05" => "Bolama",
+"06" => "Cacheu",
+"07" => "Tombali",
+"10" => "Gabu",
+"11" => "Bissau",
+"12" => "Biombo"),
+"GY" => array(
+"10" => "Barima-Waini",
+"11" => "Cuyuni-Mazaruni",
+"12" => "Demerara-Mahaica",
+"13" => "East Berbice-Corentyne",
+"14" => "Essequibo Islands-West Demerara",
+"15" => "Mahaica-Berbice",
+"16" => "Pomeroon-Supenaam",
+"17" => "Potaro-Siparuni",
+"18" => "Upper Demerara-Berbice",
+"19" => "Upper Takutu-Upper Essequibo"),
+"HN" => array(
+"01" => "Atlantida",
+"02" => "Choluteca",
+"03" => "Colon",
+"04" => "Comayagua",
+"05" => "Copan",
+"06" => "Cortes",
+"07" => "El Paraiso",
+"08" => "Francisco Morazan",
+"09" => "Gracias a Dios",
+"10" => "Intibuca",
+"11" => "Islas de la Bahia",
+"12" => "La Paz",
+"13" => "Lempira",
+"14" => "Ocotepeque",
+"15" => "Olancho",
+"16" => "Santa Barbara",
+"17" => "Valle",
+"18" => "Yoro"),
+"HR" => array(
+"01" => "Bjelovarsko-Bilogorska",
+"02" => "Brodsko-Posavska",
+"03" => "Dubrovacko-Neretvanska",
+"04" => "Istarska",
+"05" => "Karlovacka",
+"06" => "Koprivnicko-Krizevacka",
+"07" => "Krapinsko-Zagorska",
+"08" => "Licko-Senjska",
+"09" => "Medimurska",
+"10" => "Osjecko-Baranjska",
+"11" => "Pozesko-Slavonska",
+"12" => "Primorsko-Goranska",
+"13" => "Sibensko-Kninska",
+"14" => "Sisacko-Moslavacka",
+"15" => "Splitsko-Dalmatinska",
+"16" => "Varazdinska",
+"17" => "Viroviticko-Podravska",
+"18" => "Vukovarsko-Srijemska",
+"19" => "Zadarska",
+"20" => "Zagrebacka",
+"21" => "Grad Zagreb"),
+"HT" => array(
+"03" => "Nord-Ouest",
+"06" => "Artibonite",
+"07" => "Centre",
+"08" => "Grand' Anse",
+"09" => "Nord",
+"10" => "Nord-Est",
+"11" => "Ouest",
+"12" => "Sud",
+"13" => "Sud-Est"),
+"HU" => array(
+"01" => "Bacs-Kiskun",
+"02" => "Baranya",
+"03" => "Bekes",
+"04" => "Borsod-Abauj-Zemplen",
+"05" => "Budapest",
+"06" => "Csongrad",
+"07" => "Debrecen",
+"08" => "Fejer",
+"09" => "Gyor-Moson-Sopron",
+"10" => "Hajdu-Bihar",
+"11" => "Heves",
+"12" => "Komarom-Esztergom",
+"13" => "Miskolc",
+"14" => "Nograd",
+"15" => "Pecs",
+"16" => "Pest",
+"17" => "Somogy",
+"18" => "Szabolcs-Szatmar-Bereg",
+"19" => "Szeged",
+"20" => "Jasz-Nagykun-Szolnok",
+"21" => "Tolna",
+"22" => "Vas",
+"23" => "Veszprem",
+"24" => "Zala",
+"25" => "Gyor",
+"26" => "Bekescsaba",
+"27" => "Dunaujvaros",
+"28" => "Eger",
+"29" => "Hodmezovasarhely",
+"30" => "Kaposvar",
+"31" => "Kecskemet",
+"32" => "Nagykanizsa",
+"33" => "Nyiregyhaza",
+"34" => "Sopron",
+"35" => "Szekesfehervar",
+"36" => "Szolnok",
+"37" => "Szombathely",
+"38" => "Tatabanya",
+"39" => "Veszprem",
+"40" => "Zalaegerszeg"),
+"ID" => array(
+"01" => "Aceh",
+"02" => "Bali",
+"03" => "Bengkulu",
+"04" => "Jakarta Raya",
+"05" => "Jambi",
+"07" => "Jawa Tengah",
+"08" => "Jawa Timur",
+"09" => "Papua",
+"10" => "Yogyakarta",
+"11" => "Kalimantan Barat",
+"12" => "Kalimantan Selatan",
+"13" => "Kalimantan Tengah",
+"14" => "Kalimantan Timur",
+"15" => "Lampung",
+"17" => "Nusa Tenggara Barat",
+"18" => "Nusa Tenggara Timur",
+"19" => "Riau",
+"20" => "Sulawesi Selatan",
+"21" => "Sulawesi Tengah",
+"22" => "Sulawesi Tenggara",
+"24" => "Sumatera Barat",
+"26" => "Sumatera Utara",
+"27" => "Timor Timur",
+"28" => "Maluku",
+"29" => "Maluku Utara",
+"30" => "Jawa Barat",
+"31" => "Sulawesi Utara",
+"32" => "Sumatera Selatan",
+"33" => "Banten",
+"34" => "Gorontalo",
+"35" => "Kepulauan Bangka Belitung"),
+"IE" => array(
+"01" => "Carlow",
+"02" => "Cavan",
+"03" => "Clare",
+"04" => "Cork",
+"06" => "Donegal",
+"07" => "Dublin",
+"10" => "Galway",
+"11" => "Kerry",
+"12" => "Kildare",
+"13" => "Kilkenny",
+"14" => "Leitrim",
+"15" => "Laois",
+"16" => "Limerick",
+"18" => "Longford",
+"19" => "Louth",
+"20" => "Mayo",
+"21" => "Meath",
+"22" => "Monaghan",
+"23" => "Offaly",
+"24" => "Roscommon",
+"25" => "Sligo",
+"26" => "Tipperary",
+"27" => "Waterford",
+"29" => "Westmeath",
+"30" => "Wexford",
+"31" => "Wicklow"),
+"IL" => array(
+"01" => "HaDarom",
+"02" => "HaMerkaz",
+"03" => "HaZafon",
+"04" => "Hefa",
+"05" => "Tel Aviv",
+"06" => "Yerushalayim"),
+"IN" => array(
+"01" => "Andaman and Nicobar Islands",
+"02" => "Andhra Pradesh",
+"03" => "Assam",
+"05" => "Chandigarh",
+"06" => "Dadra and Nagar Haveli",
+"07" => "Delhi",
+"09" => "Gujarat",
+"10" => "Haryana",
+"11" => "Himachal Pradesh",
+"12" => "Jammu and Kashmir",
+"13" => "Kerala",
+"14" => "Lakshadweep",
+"16" => "Maharashtra",
+"17" => "Manipur",
+"18" => "Meghalaya",
+"19" => "Karnataka",
+"20" => "Nagaland",
+"21" => "Orissa",
+"22" => "Pondicherry",
+"23" => "Punjab",
+"24" => "Rajasthan",
+"25" => "Tamil Nadu",
+"26" => "Tripura",
+"28" => "West Bengal",
+"29" => "Sikkim",
+"30" => "Arunachal Pradesh",
+"31" => "Mizoram",
+"32" => "Daman and Diu",
+"33" => "Goa",
+"34" => "Bihar",
+"35" => "Madhya Pradesh",
+"36" => "Uttar Pradesh",
+"37" => "Chhattisgarh",
+"38" => "Jharkhand",
+"39" => "Uttaranchal"),
+"IQ" => array(
+"01" => "Al Anbar",
+"02" => "Al Basrah",
+"03" => "Al Muthanna",
+"04" => "Al Qadisiyah",
+"05" => "As Sulaymaniyah",
+"06" => "Babil",
+"07" => "Baghdad",
+"08" => "Dahuk",
+"09" => "Dhi Qar",
+"10" => "Diyala",
+"11" => "Arbil",
+"12" => "Karbala'",
+"13" => "At Ta'mim",
+"14" => "Maysan",
+"15" => "Ninawa",
+"16" => "Wasit",
+"17" => "An Najaf",
+"18" => "Salah ad Din"),
+"IR" => array(
+"01" => "Azarbayjan-e Bakhtari",
+"02" => "Azarbayjan-e Khavari",
+"03" => "Chahar Mahall va Bakhtiari",
+"04" => "Sistan va Baluchestan",
+"05" => "Kohkiluyeh va Buyer Ahmadi",
+"07" => "Fars",
+"08" => "Gilan",
+"09" => "Hamadan",
+"10" => "Ilam",
+"11" => "Hormozgan",
+"13" => "Bakhtaran",
+"15" => "Khuzestan",
+"16" => "Kordestan",
+"22" => "Bushehr",
+"23" => "Lorestan",
+"25" => "Semnan",
+"26" => "Tehran",
+"28" => "Esfahan",
+"29" => "Kerman",
+"30" => "Khorasan",
+"31" => "Yazd",
+"34" => "Markazi",
+"35" => "Mazandaran",
+"36" => "Zanjan",
+"37" => "Golestan",
+"38" => "Qazvin",
+"39" => "Qom"),
+"IS" => array(
+"01" => "Akranes",
+"02" => "Akureyri",
+"03" => "Arnessysla",
+"04" => "Austur-Bardastrandarsysla",
+"05" => "Austur-Hunavatnssysla",
+"06" => "Austur-Skaftafellssysla",
+"07" => "Borgarfjardarsysla",
+"08" => "Dalasysla",
+"09" => "Eyjafjardarsysla",
+"10" => "Gullbringusysla",
+"11" => "Hafnarfjordur",
+"12" => "Husavik",
+"13" => "Isafjordur",
+"14" => "Keflavik",
+"15" => "Kjosarsysla",
+"16" => "Kopavogur",
+"17" => "Myrasysla",
+"18" => "Neskaupstadur",
+"19" => "Nordur-Isafjardarsysla",
+"20" => "Nordur-Mulasysla",
+"21" => "Nordur-Tingeyjarsysla",
+"22" => "Olafsfjordur",
+"23" => "Rangarvallasysla",
+"24" => "Reykjavik",
+"25" => "Saudarkrokur",
+"26" => "Seydisfjordur",
+"27" => "Siglufjordur",
+"28" => "Skagafjardarsysla",
+"29" => "Snafellsnes- og Hnappadalssysla",
+"30" => "Strandasysla",
+"31" => "Sudur-Mulasysla",
+"32" => "Sudur-Tingeyjarsysla",
+"33" => "Vestmannaeyjar",
+"34" => "Vestur-Bardastrandarsysla",
+"35" => "Vestur-Hunavatnssysla",
+"36" => "Vestur-Isafjardarsysla",
+"37" => "Vestur-Skaftafellssysla"),
+"IT" => array(
+"01" => "Abruzzi",
+"02" => "Basilicata",
+"03" => "Calabria",
+"04" => "Campania",
+"05" => "Emilia-Romagna",
+"06" => "Friuli-Venezia Giulia",
+"07" => "Lazio",
+"08" => "Liguria",
+"09" => "Lombardia",
+"10" => "Marche",
+"11" => "Molise",
+"12" => "Piemonte",
+"13" => "Puglia",
+"14" => "Sardegna",
+"15" => "Sicilia",
+"16" => "Toscana",
+"17" => "Trentino-Alto Adige",
+"18" => "Umbria",
+"19" => "Valle d'Aosta",
+"20" => "Veneto"),
+"JM" => array(
+"01" => "Clarendon",
+"02" => "Hanover",
+"04" => "Manchester",
+"07" => "Portland",
+"08" => "Saint Andrew",
+"09" => "Saint Ann",
+"10" => "Saint Catherine",
+"11" => "Saint Elizabeth",
+"12" => "Saint James",
+"13" => "Saint Mary",
+"14" => "Saint Thomas",
+"15" => "Trelawny",
+"16" => "Westmoreland",
+"17" => "Kingston"),
+"JO" => array(
+"02" => "Al Balqa'",
+"07" => "Ma",
+"09" => "Al Karak",
+"10" => "Al Mafraq",
+"12" => "At Tafilah",
+"13" => "Az Zarqa",
+"14" => "Irbid"),
+"JP" => array(
+"01" => "Aichi",
+"02" => "Akita",
+"03" => "Aomori",
+"04" => "Chiba",
+"05" => "Ehime",
+"06" => "Fukui",
+"07" => "Fukuoka",
+"08" => "Fukushima",
+"09" => "Gifu",
+"10" => "Gumma",
+"11" => "Hiroshima",
+"12" => "Hokkaido",
+"13" => "Hyogo",
+"14" => "Ibaraki",
+"15" => "Ishikawa",
+"16" => "Iwate",
+"17" => "Kagawa",
+"18" => "Kagoshima",
+"19" => "Kanagawa",
+"20" => "Kochi",
+"21" => "Kumamoto",
+"22" => "Kyoto",
+"23" => "Mie",
+"24" => "Miyagi",
+"25" => "Miyazaki",
+"26" => "Nagano",
+"27" => "Nagasaki",
+"28" => "Nara",
+"29" => "Niigata",
+"30" => "Oita",
+"31" => "Okayama",
+"32" => "Osaka",
+"33" => "Saga",
+"34" => "Saitama",
+"35" => "Shiga",
+"36" => "Shimane",
+"37" => "Shizuoka",
+"38" => "Tochigi",
+"39" => "Tokushima",
+"40" => "Tokyo",
+"41" => "Tottori",
+"42" => "Toyama",
+"43" => "Wakayama",
+"44" => "Yamagata",
+"45" => "Yamaguchi",
+"46" => "Yamanashi",
+"47" => "Okinawa"),
+"KE" => array(
+"01" => "Central",
+"02" => "Coast",
+"03" => "Eastern",
+"05" => "Nairobi Area",
+"06" => "North-Eastern",
+"07" => "Nyanza",
+"08" => "Rift Valley",
+"09" => "Western"),
+"KG" => array(
+"09" => "Batken"),
+"KH" => array(
+"02" => "Kampong Cham",
+"03" => "Kampong Chhnang",
+"04" => "Kampong Spoe",
+"05" => "Kampong Thum",
+"06" => "Kampot",
+"07" => "Kandal",
+"08" => "Kaoh Kong",
+"09" => "Kracheh",
+"10" => "Mondol Kiri",
+"11" => "Phnum Penh",
+"12" => "Pouthisat",
+"13" => "Preah Vihear",
+"14" => "Prey Veng",
+"15" => "Rotanokiri",
+"16" => "Siemreab-Otdar Meanchey",
+"17" => "Stoeng Treng",
+"18" => "Svay Rieng",
+"19" => "Takev",
+"29" => "Batdambang",
+"30" => "Pailin"),
+"KI" => array(
+"01" => "Gilbert Islands",
+"02" => "Line Islands",
+"03" => "Phoenix Islands"),
+"KM" => array(
+"01" => "Anjouan",
+"02" => "Grande Comore",
+"03" => "Moheli"),
+"KN" => array(
+"01" => "Christ Church Nichola Town",
+"02" => "Saint Anne Sandy Point",
+"03" => "Saint George Basseterre",
+"04" => "Saint George Gingerland",
+"05" => "Saint James Windward",
+"06" => "Saint John Capisterre",
+"07" => "Saint John Figtree",
+"08" => "Saint Mary Cayon",
+"09" => "Saint Paul Capisterre",
+"10" => "Saint Paul Charlestown",
+"11" => "Saint Peter Basseterre",
+"12" => "Saint Thomas Lowland",
+"13" => "Saint Thomas Middle Island",
+"15" => "Trinity Palmetto Point"),
+"KP" => array(
+"01" => "Chagang-do",
+"03" => "Hamgyong-namdo",
+"06" => "Hwanghae-namdo",
+"07" => "Hwanghae-bukto",
+"08" => "Kaesong-si",
+"09" => "Kangwon-do",
+"11" => "P'yongan-bukto",
+"12" => "P'yongyang-si",
+"13" => "Yanggang-do",
+"14" => "Namp'o-si",
+"15" => "P'yongan-namdo",
+"17" => "Hamgyong-bukto",
+"18" => "Najin Sonbong-si"),
+"KR" => array(
+"01" => "Cheju-do",
+"03" => "Cholla-bukto",
+"05" => "Ch'ungch'ong-bukto",
+"06" => "Kangwon-do",
+"10" => "Pusan-jikhalsi",
+"11" => "Soul-t'ukpyolsi",
+"12" => "Inch'on-jikhalsi",
+"13" => "Kyonggi-do",
+"14" => "Kyongsang-bukto",
+"15" => "Taegu-jikhalsi",
+"16" => "Cholla-namdo",
+"17" => "Ch'ungch'ong-namdo",
+"18" => "Kwangju-jikhalsi",
+"19" => "Taejon-jikhalsi",
+"20" => "Kyongsang-namdo",
+"21" => "Ulsan-gwangyoksi"),
+"KW" => array(
+"01" => "Al Ahmadi",
+"02" => "Al Kuwayt",
+"03" => "Hawalli"),
+"KY" => array(
+"01" => "Creek",
+"02" => "Eastern",
+"03" => "Midland",
+"04" => "South Town",
+"05" => "Spot Bay",
+"06" => "Stake Bay",
+"07" => "West End",
+"08" => "Western"),
+"KZ" => array(
+"01" => "Almaty",
+"02" => "Almaty City",
+"03" => "Aqmola",
+"04" => "Aqtöbe",
+"05" => "Astana",
+"06" => "Atyrau",
+"07" => "West Kazakhstan",
+"08" => "Bayqonyr",
+"09" => "Mangghystau",
+"10" => "South Kazakhstan",
+"11" => "Pavlodar",
+"12" => "Qaraghandy",
+"13" => "Qostanay",
+"14" => "Qyzylorda",
+"15" => "East Kazakhstan",
+"16" => "North Kazakhstan",
+"17" => "Zhambyl"),
+"LA" => array(
+"01" => "Attapu",
+"02" => "Champasak",
+"03" => "Houaphan",
+"04" => "Khammouan",
+"05" => "Louang Namtha",
+"06" => "Louangphrabang",
+"07" => "Oudomxai",
+"08" => "Phongsali",
+"09" => "Saravan",
+"10" => "Savannakhet",
+"11" => "Vientiane",
+"13" => "Xaignabouri",
+"14" => "Xiangkhoang"),
+"LB" => array(
+"01" => "Beqaa",
+"03" => "Liban-Nord",
+"04" => "Beyrouth",
+"05" => "Mont-Liban",
+"06" => "Liban-Sud",
+"07" => "Nabatiye"),
+"LC" => array(
+"01" => "Anse-la-Raye",
+"02" => "Dauphin",
+"03" => "Castries",
+"04" => "Choiseul",
+"05" => "Dennery",
+"06" => "Gros-Islet",
+"07" => "Laborie",
+"08" => "Micoud",
+"09" => "Soufriere",
+"10" => "Vieux-Fort",
+"11" => "Praslin"),
+"LI" => array(
+"01" => "Balzers",
+"02" => "Eschen",
+"03" => "Gamprin",
+"04" => "Mauren",
+"05" => "Planken",
+"06" => "Ruggell",
+"07" => "Schaan",
+"08" => "Schellenberg",
+"09" => "Triesen",
+"10" => "Triesenberg",
+"11" => "Vaduz"),
+"LK" => array(
+"01" => "Amparai",
+"02" => "Anuradhapura",
+"03" => "Badulla",
+"04" => "Batticaloa",
+"06" => "Galle",
+"07" => "Hambantota",
+"09" => "Kalutara",
+"10" => "Kandy",
+"11" => "Kegalla",
+"12" => "Kurunegala",
+"14" => "Matale",
+"15" => "Matara",
+"16" => "Moneragala",
+"17" => "Nuwara Eliya",
+"18" => "Polonnaruwa",
+"19" => "Puttalam",
+"20" => "Ratnapura",
+"21" => "Trincomalee",
+"23" => "Colombo",
+"24" => "Gampaha",
+"25" => "Jaffna",
+"26" => "Mannar",
+"27" => "Mullaittivu",
+"28" => "Vavuniya"),
+"LR" => array(
+"01" => "Bong",
+"02" => "Grand Jide",
+"03" => "Grand Bassa",
+"04" => "Grand Cape Mount",
+"05" => "Lofa",
+"06" => "Maryland",
+"07" => "Monrovia",
+"08" => "Montserrado",
+"09" => "Nimba",
+"10" => "Sino"),
+"LS" => array(
+"10" => "Berea",
+"11" => "Butha-Buthe",
+"12" => "Leribe",
+"13" => "Mafeteng",
+"14" => "Maseru",
+"15" => "Mohales Hoek",
+"16" => "Mokhotlong",
+"17" => "Qachas Nek",
+"18" => "Quthing",
+"19" => "Thaba-Tseka"),
+"LT" => array(
+"56" => "Alytaus Apskritis",
+"57" => "Kauno Apskritis",
+"58" => "Klaipedos Apskritis",
+"59" => "Marijampoles Apskritis",
+"60" => "Panevezio Apskritis",
+"61" => "Siauliu Apskritis",
+"62" => "Taurages Apskritis",
+"63" => "Telsiu Apskritis",
+"64" => "Utenos Apskritis",
+"65" => "Vilniaus Apskritis"),
+"LU" => array(
+"01" => "Diekirch",
+"02" => "Grevenmacher",
+"03" => "Luxembourg"),
+"LV" => array(
+"01" => "Aizkraukles",
+"02" => "Aluksnes",
+"03" => "Balvu",
+"04" => "Bauskas",
+"05" => "Césu",
+"06" => "Daugavpils",
+"07" => "Daugavpils",
+"08" => "Dobeles",
+"09" => "Gulbenes",
+"10" => "Jékabpils",
+"11" => "Jelgava",
+"12" => "Jelgavas",
+"13" => "Jurmala",
+"14" => "Kráslavas",
+"15" => "Kuldigas",
+"16" => "Liepája",
+"17" => "Liepájas",
+"18" => "Limbazu",
+"19" => "Ludzas",
+"20" => "Madonas",
+"21" => "Ogres",
+"22" => "Preilu",
+"23" => "Rézekne",
+"24" => "Rézeknes",
+"25" => "Riga",
+"26" => "Rigas",
+"27" => "Saldus",
+"28" => "Talsu",
+"29" => "Tukuma",
+"30" => "Valkas",
+"31" => "Valmieras",
+"32" => "Ventspils",
+"33" => "Ventspils"),
+"LY" => array(
+"03" => "Al",
+"05" => "Al Jufrah",
+"08" => "Al Kufrah",
+"13" => "Ash Shati'",
+"30" => "Murzuq",
+"34" => "Sabha",
+"41" => "Tarhunah",
+"42" => "Tubruq",
+"45" => "Zlitan",
+"47" => "Ajdabiya",
+"48" => "Al Fatih",
+"49" => "Al Jabal al Akhdar",
+"50" => "Al Khums",
+"51" => "An Nuqat al Khams",
+"52" => "Awbari",
+"53" => "Az Zawiyah",
+"54" => "Banghazi",
+"55" => "Darnah",
+"56" => "Ghadamis",
+"57" => "Gharyan",
+"58" => "Misratah",
+"59" => "Sawfajjin",
+"60" => "Surt",
+"61" => "Tarabulus",
+"62" => "Yafran"),
+"MA" => array(
+"01" => "Agadir",
+"02" => "Al Hoceima",
+"03" => "Azilal",
+"04" => "Ben Slimane",
+"05" => "Beni Mellal",
+"06" => "Boulemane",
+"07" => "Casablanca",
+"08" => "Chaouen",
+"09" => "El Jadida",
+"10" => "El Kelaa des Srarhna",
+"11" => "Er Rachidia",
+"12" => "Essaouira",
+"13" => "Fes",
+"14" => "Figuig",
+"15" => "Kenitra",
+"16" => "Khemisset",
+"17" => "Khenifra",
+"18" => "Khouribga",
+"19" => "Marrakech",
+"20" => "Meknes",
+"21" => "Nador",
+"22" => "Ouarzazate",
+"23" => "Oujda",
+"24" => "Rabat-Sale",
+"25" => "Safi",
+"26" => "Settat",
+"27" => "Tanger",
+"29" => "Tata",
+"30" => "Taza",
+"32" => "Tiznit",
+"33" => "Guelmim",
+"34" => "Ifrane",
+"35" => "Laayoune",
+"36" => "Tan-Tan",
+"37" => "Taounate",
+"38" => "Sidi Kacem",
+"39" => "Taroudannt",
+"40" => "Tetouan",
+"41" => "Larache"),
+"MC" => array(
+"01" => "La Condamine",
+"02" => "Monaco",
+"03" => "Monte-Carlo"),
+"MD" => array(
+"46" => "Balti",
+"47" => "Cahul",
+"48" => "Chisinau",
+"49" => "Stinga Nistrului",
+"50" => "Edinet",
+"51" => "Gagauzia",
+"52" => "Lapusna",
+"53" => "Orhei",
+"54" => "Soroca",
+"55" => "Tighina",
+"56" => "Ungheni"),
+"MG" => array(
+"01" => "Antsiranana",
+"02" => "Fianarantsoa",
+"03" => "Mahajanga",
+"04" => "Toamasina",
+"05" => "Antananarivo",
+"06" => "Toliara"),
+"MK" => array(
+"01" => "Aracinovo",
+"02" => "Bac",
+"03" => "Belcista",
+"04" => "Berovo",
+"05" => "Bistrica",
+"06" => "Bitola",
+"07" => "Blatec",
+"08" => "Bogdanci",
+"09" => "Bogomila",
+"10" => "Bogovinje",
+"11" => "Bosilovo",
+"12" => "Brvenica",
+"13" => "Cair",
+"14" => "Capari",
+"15" => "Caska",
+"16" => "Cegrane",
+"17" => "Centar",
+"18" => "Centar Zupa",
+"19" => "Cesinovo",
+"20" => "Cucer-Sandevo",
+"21" => "Debar",
+"22" => "Delcevo",
+"23" => "Delogozdi",
+"24" => "Demir Hisar",
+"25" => "Demir Kapija",
+"26" => "Dobrusevo",
+"27" => "Dolna Banjica",
+"28" => "Dolneni",
+"29" => "Dorce Petrov",
+"30" => "Drugovo",
+"31" => "Dzepciste",
+"32" => "Gazi Baba",
+"33" => "Gevgelija",
+"34" => "Gostivar",
+"35" => "Gradsko",
+"36" => "Ilinden",
+"37" => "Izvor",
+"38" => "Jegunovce",
+"39" => "Kamenjane",
+"40" => "Karbinci",
+"41" => "Karpos",
+"42" => "Kavadarci",
+"43" => "Kicevo",
+"44" => "Kisela Voda",
+"45" => "Klecevce",
+"46" => "Kocani",
+"47" => "Konce",
+"48" => "Kondovo",
+"49" => "Konopiste",
+"50" => "Kosel",
+"51" => "Kratovo",
+"52" => "Kriva Palanka",
+"53" => "Krivogastani",
+"54" => "Krusevo",
+"55" => "Kuklis",
+"56" => "Kukurecani",
+"57" => "Kumanovo",
+"58" => "Labunista",
+"59" => "Lipkovo",
+"60" => "Lozovo",
+"61" => "Lukovo",
+"62" => "Makedonska Kamenica",
+"63" => "Makedonski Brod",
+"64" => "Mavrovi Anovi",
+"65" => "Meseista",
+"66" => "Miravci",
+"67" => "Mogila",
+"68" => "Murtino",
+"69" => "Negotino",
+"70" => "Negotino-Polosko",
+"71" => "Novaci",
+"72" => "Novo Selo",
+"73" => "Oblesevo",
+"74" => "Ohrid",
+"75" => "Orasac",
+"76" => "Orizari",
+"77" => "Oslomej",
+"78" => "Pehcevo",
+"79" => "Petrovec",
+"80" => "Plasnica",
+"81" => "Podares",
+"82" => "Prilep",
+"83" => "Probistip",
+"84" => "Radovis",
+"85" => "Rankovce",
+"86" => "Resen",
+"87" => "Rosoman",
+"88" => "Rostusa",
+"89" => "Samokov",
+"90" => "Saraj",
+"91" => "Sipkovica",
+"92" => "Sopiste",
+"93" => "Sopotnica",
+"94" => "Srbinovo",
+"95" => "Staravina",
+"96" => "Star Dojran",
+"97" => "Staro Nagoricane",
+"98" => "Stip",
+"99" => "Struga",
+"A1" => "Strumica",
+"A2" => "Studenicani",
+"A3" => "Suto Orizari",
+"A4" => "Sveti Nikole",
+"A5" => "Tearce",
+"A6" => "Tetovo",
+"A7" => "Topolcani",
+"A8" => "Valandovo",
+"A9" => "Vasilevo",
+"B1" => "Veles",
+"B2" => "Velesta",
+"B3" => "Vevcani",
+"B4" => "Vinica",
+"B5" => "Vitoliste",
+"B6" => "Vranestica",
+"B7" => "Vrapciste",
+"B8" => "Vratnica",
+"B9" => "Vrutok",
+"C1" => "Zajas",
+"C2" => "Zelenikovo",
+"C3" => "Zelino",
+"C4" => "Zitose",
+"C5" => "Zletovo",
+"C6" => "Zrnovci"),
+"ML" => array(
+"01" => "Bamako",
+"02" => "Gao",
+"03" => "Kayes",
+"04" => "Mopti",
+"05" => "Segou",
+"06" => "Sikasso",
+"07" => "Koulikoro",
+"08" => "Tombouctou"),
+"MM" => array(
+"01" => "Rakhine State",
+"02" => "Chin State",
+"03" => "Irrawaddy",
+"04" => "Kachin State",
+"05" => "Karan State",
+"06" => "Kayah State",
+"07" => "Magwe",
+"08" => "Mandalay",
+"09" => "Pegu",
+"10" => "Sagaing",
+"11" => "Shan State",
+"12" => "Tenasserim",
+"13" => "Mon State",
+"14" => "Rangoon"),
+"MN" => array(
+"01" => "Arhangay",
+"02" => "Bayanhongor",
+"03" => "Bayan-Olgiy",
+"05" => "Darhan",
+"06" => "Dornod",
+"07" => "Dornogovi",
+"08" => "Dundgovi",
+"09" => "Dzavhan",
+"10" => "Govi-Altay",
+"11" => "Hentiy",
+"12" => "Hovd",
+"13" => "Hovsgol",
+"14" => "Omnogovi",
+"15" => "Ovorhangay",
+"16" => "Selenge",
+"17" => "Suhbaatar",
+"18" => "Tov",
+"19" => "Uvs",
+"20" => "Ulaanbaatar",
+"21" => "Bulgan",
+"22" => "Erdenet",
+"23" => "Darhan Uul",
+"24" => "Govi-Sumber",
+"25" => "Orhon"),
+"MO" => array(
+"01" => "Ilhas",
+"02" => "Macau"),
+"MR" => array(
+"01" => "Hodh Ech Chargui",
+"02" => "Hodh El Gharbi",
+"03" => "Assaba",
+"04" => "Gorgol",
+"05" => "Brakna",
+"06" => "Trarza",
+"07" => "Adrar",
+"08" => "Dakhlet Nouadhibou",
+"09" => "Tagant",
+"10" => "Guidimaka",
+"11" => "Tiris Zemmour",
+"12" => "Inchiri"),
+"MS" => array(
+"01" => "Saint Anthony",
+"02" => "Saint Georges",
+"03" => "Saint Peter"),
+"MU" => array(
+"12" => "Black River",
+"13" => "Flacq",
+"14" => "Grand Port",
+"15" => "Moka",
+"16" => "Pamplemousses",
+"17" => "Plaines Wilhems",
+"18" => "Port Louis",
+"19" => "Riviere du Rempart",
+"20" => "Savanne",
+"21" => "Agalega Islands",
+"22" => "Cargados Carajos",
+"23" => "Rodrigues"),
+"MV" => array(
+"01" => "Seenu",
+"02" => "Aliff",
+"03" => "Laviyani",
+"04" => "Waavu",
+"05" => "Laamu",
+"07" => "Haa Aliff",
+"08" => "Thaa",
+"12" => "Meemu",
+"13" => "Raa",
+"14" => "Faafu",
+"17" => "Daalu",
+"20" => "Baa",
+"23" => "Haa Daalu",
+"24" => "Shaviyani",
+"25" => "Noonu",
+"26" => "Kaafu",
+"27" => "Gaafu Aliff",
+"28" => "Gaafu Daalu",
+"29" => "Naviyani"),
+"MW" => array(
+"02" => "Chikwawa",
+"03" => "Chiradzulu",
+"04" => "Chitipa",
+"05" => "Thyolo",
+"06" => "Dedza",
+"07" => "Dowa",
+"08" => "Karonga",
+"09" => "Kasungu",
+"10" => "Machinga",
+"11" => "Lilongwe",
+"12" => "Mangochi",
+"13" => "Mchinji",
+"14" => "Mulanje",
+"15" => "Mzimba",
+"16" => "Ntcheu",
+"17" => "Nkhata Bay",
+"18" => "Nkhotakota",
+"19" => "Nsanje",
+"20" => "Ntchisi",
+"21" => "Rumphi",
+"22" => "Salima",
+"23" => "Zomba",
+"24" => "Blantyre",
+"25" => "Mwanza"),
+"MX" => array(
+"01" => "Aguascalientes",
+"02" => "Baja California",
+"03" => "Baja California Sur",
+"04" => "Campeche",
+"05" => "Chiapas",
+"06" => "Chihuahua",
+"07" => "Coahuila de Zaragoza",
+"08" => "Colima",
+"09" => "Distrito Federal",
+"10" => "Durango",
+"11" => "Guanajuato",
+"12" => "Guerrero",
+"13" => "Hidalgo",
+"14" => "Jalisco",
+"15" => "Mexico",
+"16" => "Michoacan de Ocampo",
+"17" => "Morelos",
+"18" => "Nayarit",
+"19" => "Nuevo Leon",
+"20" => "Oaxaca",
+"21" => "Puebla",
+"22" => "Queretaro de Arteaga",
+"23" => "Quintana Roo",
+"24" => "San Luis Potosi",
+"25" => "Sinaloa",
+"26" => "Sonora",
+"27" => "Tabasco",
+"28" => "Tamaulipas",
+"29" => "Tlaxcala",
+"30" => "Veracruz-Llave",
+"31" => "Yucatan",
+"32" => "Zacatecas"),
+"MY" => array(
+"01" => "Johor",
+"02" => "Kedah",
+"03" => "Kelantan",
+"04" => "Melaka",
+"05" => "Negeri Sembilan",
+"06" => "Pahang",
+"07" => "Perak",
+"08" => "Perlis",
+"09" => "Pulau Pinang",
+"11" => "Sarawak",
+"12" => "Selangor",
+"13" => "Terengganu",
+"14" => "Wilayah Persekutuan",
+"15" => "Labuan",
+"16" => "Sabah"),
+"MZ" => array(
+"01" => "Cabo Delgado",
+"02" => "Gaza",
+"03" => "Inhambane",
+"04" => "Maputo",
+"05" => "Sofala",
+"06" => "Nampula",
+"07" => "Niassa",
+"08" => "Tete",
+"09" => "Zambezia",
+"10" => "Manica"),
+"NA" => array(
+"01" => "Bethanien",
+"02" => "Caprivi Oos",
+"03" => "Boesmanland",
+"04" => "Gobabis",
+"05" => "Grootfontein",
+"06" => "Kaokoland",
+"07" => "Karibib",
+"08" => "Keetmanshoop",
+"09" => "Luderitz",
+"10" => "Maltahohe",
+"11" => "Okahandja",
+"12" => "Omaruru",
+"13" => "Otjiwarongo",
+"14" => "Outjo",
+"15" => "Owambo",
+"16" => "Rehoboth",
+"17" => "Swakopmund",
+"18" => "Tsumeb",
+"20" => "Karasburg",
+"21" => "Windhoek",
+"22" => "Damaraland",
+"23" => "Hereroland Oos",
+"24" => "Hereroland Wes",
+"25" => "Kavango",
+"26" => "Mariental",
+"27" => "Namaland"),
+"NE" => array(
+"01" => "Agadez",
+"02" => "Diffa",
+"03" => "Dosso",
+"04" => "Maradi",
+"05" => "Niamey",
+"06" => "Tahoua",
+"07" => "Zinder"),
+"NG" => array(
+"05" => "Lagos",
+"11" => "Abuja Capital Territory",
+"16" => "Ogun",
+"21" => "Akwa Ibom",
+"22" => "Cross River",
+"23" => "Kaduna",
+"24" => "Katsina",
+"25" => "Anambra",
+"26" => "Benue",
+"27" => "Borno",
+"28" => "Imo",
+"29" => "Kano",
+"30" => "Kwara",
+"31" => "Niger",
+"32" => "Oyo",
+"35" => "Adamawa",
+"36" => "Delta",
+"37" => "Edo",
+"39" => "Jigawa",
+"40" => "Kebbi",
+"41" => "Kogi",
+"42" => "Osun",
+"43" => "Taraba",
+"44" => "Yobe",
+"45" => "Abia",
+"46" => "Bauchi",
+"47" => "Enugu",
+"48" => "Ondo",
+"49" => "Plateau",
+"50" => "Rivers",
+"51" => "Sokoto",
+"52" => "Bayelsa",
+"53" => "Ebonyi",
+"54" => "Ekiti",
+"55" => "Gombe",
+"56" => "Nassarawa",
+"57" => "Zamfara"),
+"NI" => array(
+"01" => "Boaco",
+"02" => "Carazo",
+"03" => "Chinandega",
+"04" => "Chontales",
+"05" => "Esteli",
+"06" => "Granada",
+"07" => "Jinotega",
+"08" => "Leon",
+"09" => "Madriz",
+"10" => "Managua",
+"11" => "Masaya",
+"12" => "Matagalpa",
+"13" => "Nueva Segovia",
+"14" => "Rio San Juan",
+"15" => "Rivas",
+"16" => "Zelaya"),
+"NL" => array(
+"01" => "Drenthe",
+"02" => "Friesland",
+"03" => "Gelderland",
+"04" => "Groningen",
+"05" => "Limburg",
+"06" => "Noord-Brabant",
+"07" => "Noord-Holland",
+"08" => "Overijssel",
+"09" => "Utrecht",
+"10" => "Zeeland",
+"11" => "Zuid-Holland",
+"12" => "Dronten",
+"13" => "Zuidelijke IJsselmeerpolders",
+"14" => "Lelystad",
+"15" => "Overijssel",
+"16" => "Flevoland"),
+"NO" => array(
+"01" => "Akershus",
+"02" => "Aust-Agder",
+"04" => "Buskerud",
+"05" => "Finnmark",
+"06" => "Hedmark",
+"07" => "Hordaland",
+"08" => "More og Romsdal",
+"09" => "Nordland",
+"10" => "Nord-Trondelag",
+"11" => "Oppland",
+"12" => "Oslo",
+"13" => "Ostfold",
+"14" => "Rogaland",
+"15" => "Sogn og Fjordane",
+"16" => "Sor-Trondelag",
+"17" => "Telemark",
+"18" => "Troms",
+"19" => "Vest-Agder",
+"20" => "Vestfold"),
+"NP" => array(
+"01" => "Bagmati",
+"02" => "Bheri",
+"03" => "Dhawalagiri",
+"04" => "Gandaki",
+"05" => "Janakpur",
+"06" => "Karnali",
+"07" => "Kosi",
+"08" => "Lumbini",
+"09" => "Mahakali",
+"10" => "Mechi",
+"11" => "Narayani",
+"12" => "Rapti",
+"13" => "Sagarmatha",
+"14" => "Seti"),
+"NR" => array(
+"01" => "Aiwo",
+"02" => "Anabar",
+"03" => "Anetan",
+"04" => "Anibare",
+"05" => "Baiti",
+"06" => "Boe",
+"07" => "Buada",
+"08" => "Denigomodu",
+"09" => "Ewa",
+"10" => "Ijuw",
+"11" => "Meneng",
+"12" => "Nibok",
+"13" => "Uaboe",
+"14" => "Yaren"),
+"NZ" => array(
+"01" => "Akaroa",
+"03" => "Amuri",
+"04" => "Ashburton",
+"07" => "Bay of Islands",
+"08" => "Bruce",
+"09" => "Buller",
+"10" => "Chatham Islands",
+"11" => "Cheviot",
+"12" => "Clifton",
+"13" => "Clutha",
+"14" => "Cook",
+"16" => "Dannevirke",
+"17" => "Egmont",
+"18" => "Eketahuna",
+"19" => "Ellesmere",
+"20" => "Eltham",
+"21" => "Eyre",
+"22" => "Featherston",
+"24" => "Franklin",
+"26" => "Golden Bay",
+"27" => "Great Barrier Island",
+"28" => "Grey",
+"29" => "Hauraki Plains",
+"30" => "Hawera",
+"31" => "Hawke's Bay",
+"32" => "Heathcote",
+"33" => "Hobson",
+"34" => "Hokianga",
+"35" => "Horowhenua",
+"36" => "Hutt",
+"37" => "Inangahua",
+"38" => "Inglewood",
+"39" => "Kaikoura",
+"40" => "Kairanga",
+"41" => "Kiwitea",
+"43" => "Lake",
+"45" => "Mackenzie",
+"46" => "Malvern",
+"47" => "Manawatu",
+"48" => "Mangonui",
+"49" => "Maniototo",
+"50" => "Marlborough",
+"51" => "Masterton",
+"52" => "Matamata",
+"53" => "Mount Herbert",
+"54" => "Ohinemuri",
+"55" => "Opotiki",
+"56" => "Oroua",
+"57" => "Otamatea",
+"58" => "Otorohanga",
+"59" => "Oxford",
+"60" => "Pahiatua",
+"61" => "Paparua",
+"63" => "Patea",
+"65" => "Piako",
+"66" => "Pohangina",
+"67" => "Raglan",
+"68" => "Rangiora",
+"69" => "Rangitikei",
+"70" => "Rodney",
+"71" => "Rotorua",
+"72" => "Southland",
+"73" => "Stewart Island",
+"74" => "Stratford",
+"76" => "Taranaki",
+"77" => "Taumarunui",
+"78" => "Taupo",
+"79" => "Tauranga",
+"81" => "Tuapeka",
+"82" => "Vincent",
+"83" => "Waiapu",
+"84" => "Waihemo",
+"85" => "Waikato",
+"86" => "Waikohu",
+"88" => "Waimairi",
+"89" => "Waimarino",
+"90" => "Waimate",
+"91" => "Waimate West",
+"92" => "Waimea",
+"93" => "Waipa",
+"95" => "Waipawa",
+"96" => "Waipukurau",
+"97" => "Wairarapa South",
+"98" => "Wairewa",
+"99" => "Wairoa",
+"A1" => "Whangarei",
+"A2" => "Whangaroa",
+"A3" => "Woodville",
+"A4" => "Waitaki",
+"A6" => "Waitomo",
+"A8" => "Waitotara",
+"B2" => "Wanganui",
+"B3" => "Westland",
+"B4" => "Whakatane",
+"D4" => "Hurunui",
+"D5" => "Silverpeaks",
+"D6" => "Strathallan",
+"D8" => "Waiheke",
+"D9" => "Hikurangi",
+"E1" => "Manaia",
+"E2" => "Runanga",
+"E3" => "Saint Kilda",
+"E4" => "Thames-Coromandel",
+"E5" => "Waverley",
+"E6" => "Wallace"),
+"OM" => array(
+"01" => "Ad Dakhiliyah",
+"02" => "Al Batinah",
+"03" => "Al Wusta",
+"04" => "Ash Sharqiyah",
+"05" => "Az Zahirah",
+"06" => "Masqat",
+"07" => "Musandam",
+"08" => "Zufar"),
+"PA" => array(
+"01" => "Bocas del Toro",
+"02" => "Chiriqui",
+"03" => "Cocle",
+"04" => "Colon",
+"05" => "Darien",
+"06" => "Herrera",
+"07" => "Los Santos",
+"08" => "Panama",
+"09" => "San Blas",
+"10" => "Veraguas"),
+"PE" => array(
+"01" => "Amazonas",
+"02" => "Ancash",
+"03" => "Apurimac",
+"04" => "Arequipa",
+"05" => "Ayacucho",
+"06" => "Cajamarca",
+"07" => "Callao",
+"08" => "Cusco",
+"09" => "Huancavelica",
+"10" => "Huanuco",
+"11" => "Ica",
+"12" => "Junin",
+"13" => "La Libertad",
+"14" => "Lambayeque",
+"15" => "Lima",
+"16" => "Loreto",
+"17" => "Madre de Dios",
+"18" => "Moquegua",
+"19" => "Pasco",
+"20" => "Piura",
+"21" => "Puno",
+"22" => "San Martin",
+"23" => "Tacna",
+"24" => "Tumbes",
+"25" => "Ucayali"),
+"PG" => array(
+"01" => "Central",
+"02" => "Gulf",
+"03" => "Milne Bay",
+"04" => "Northern",
+"05" => "Southern Highlands",
+"06" => "Western",
+"07" => "North Solomons",
+"08" => "Chimbu",
+"09" => "Eastern Highlands",
+"10" => "East New Britain",
+"11" => "East Sepik",
+"12" => "Madang",
+"13" => "Manus",
+"14" => "Morobe",
+"15" => "New Ireland",
+"16" => "Western Highlands",
+"17" => "West New Britain",
+"18" => "Sandaun",
+"19" => "Enga",
+"20" => "National Capital"),
+"PH" => array(
+"01" => "Abra",
+"02" => "Agusan del Norte",
+"03" => "Agusan del Sur",
+"04" => "Aklan",
+"05" => "Albay",
+"06" => "Antique",
+"07" => "Bataan",
+"08" => "Batanes",
+"09" => "Batangas",
+"10" => "Benguet",
+"11" => "Bohol",
+"12" => "Bukidnon",
+"13" => "Bulacan",
+"14" => "Cagayan",
+"15" => "Camarines Norte",
+"16" => "Camarines Sur",
+"17" => "Camiguin",
+"18" => "Capiz",
+"19" => "Catanduanes",
+"20" => "Cavite",
+"21" => "Cebu",
+"22" => "Basilan",
+"23" => "Eastern Samar",
+"24" => "Davao",
+"25" => "Davao del Sur",
+"26" => "Davao Oriental",
+"27" => "Ifugao",
+"28" => "Ilocos Norte",
+"29" => "Ilocos Sur",
+"30" => "Iloilo",
+"31" => "Isabela",
+"32" => "Kalinga-Apayao",
+"33" => "Laguna",
+"34" => "Lanao del Norte",
+"35" => "Lanao del Sur",
+"36" => "La Union",
+"37" => "Leyte",
+"38" => "Marinduque",
+"39" => "Masbate",
+"40" => "Mindoro Occidental",
+"41" => "Mindoro Oriental",
+"42" => "Misamis Occidental",
+"43" => "Misamis Oriental",
+"44" => "Mountain",
+"46" => "Negros Oriental",
+"47" => "Nueva Ecija",
+"48" => "Nueva Vizcaya",
+"49" => "Palawan",
+"50" => "Pampanga",
+"51" => "Pangasinan",
+"53" => "Rizal",
+"54" => "Romblon",
+"55" => "Samar",
+"56" => "Maguindanao",
+"57" => "North Cotabato",
+"58" => "Sorsogon",
+"59" => "Southern Leyte",
+"60" => "Sulu",
+"61" => "Surigao del Norte",
+"62" => "Surigao del Sur",
+"63" => "Tarlac",
+"64" => "Zambales",
+"65" => "Zamboanga del Norte",
+"66" => "Zamboanga del Sur",
+"67" => "Northern Samar",
+"68" => "Quirino",
+"69" => "Siquijor",
+"70" => "South Cotabato",
+"71" => "Sultan Kudarat",
+"72" => "Tawitawi",
+"A1" => "Angeles",
+"A2" => "Bacolod",
+"A3" => "Bago",
+"A4" => "Baguio",
+"A5" => "Bais",
+"A6" => "Basilan City",
+"A7" => "Batangas City",
+"A8" => "Butuan",
+"A9" => "Cabanatuan",
+"B1" => "Cadiz",
+"B2" => "Cagayan de Oro",
+"B3" => "Calbayog",
+"B4" => "Caloocan",
+"B5" => "Canlaon",
+"B6" => "Cavite City",
+"B7" => "Cebu City",
+"B8" => "Cotabato",
+"B9" => "Dagupan",
+"C1" => "Danao",
+"C2" => "Dapitan",
+"C3" => "Davao City",
+"C4" => "Dipolog",
+"C5" => "Dumaguete",
+"C6" => "General Santos",
+"C7" => "Gingoog",
+"C8" => "Iligan",
+"C9" => "Iloilo City",
+"D1" => "Iriga",
+"D2" => "La Carlota",
+"D3" => "Laoag",
+"D4" => "Lapu-Lapu",
+"D5" => "Legaspi",
+"D6" => "Lipa",
+"D7" => "Lucena",
+"D8" => "Mandaue",
+"D9" => "Manila",
+"E1" => "Marawi",
+"E2" => "Naga",
+"E3" => "Olongapo",
+"E4" => "Ormoc",
+"E5" => "Oroquieta",
+"E6" => "Ozamis",
+"E7" => "Pagadian",
+"E8" => "Palayan",
+"E9" => "Pasay",
+"F1" => "Puerto Princesa",
+"F2" => "Quezon City",
+"F3" => "Roxas",
+"F4" => "San Carlos",
+"F5" => "San Carlos",
+"F6" => "San Jose",
+"F7" => "San Pablo",
+"F8" => "Silay",
+"F9" => "Surigao",
+"G1" => "Tacloban",
+"G2" => "Tagaytay",
+"G3" => "Tagbilaran",
+"G4" => "Tangub",
+"G5" => "Toledo",
+"G6" => "Trece Martires",
+"G7" => "Zamboanga",
+"G8" => "Aurora",
+"H2" => "Quezon",
+"H3" => "Negros Occidental"),
+"PK" => array(
+"01" => "Federally Administered Tribal Areas",
+"02" => "Balochistan",
+"03" => "North-West Frontier",
+"04" => "Punjab",
+"05" => "Sindh",
+"06" => "Azad Kashmir",
+"07" => "Northern Areas",
+"08" => "Islamabad"),
+"PL" => array(
+"23" => "Biala Podlaska",
+"24" => "Bialystok",
+"25" => "Bielsko",
+"26" => "Bydgoszcz",
+"27" => "Chelm",
+"28" => "Ciechanow",
+"29" => "Czestochowa",
+"30" => "Elblag",
+"31" => "Gdansk",
+"32" => "Gorzow",
+"33" => "Jelenia Gora",
+"34" => "Kalisz",
+"35" => "Katowice",
+"36" => "Kielce",
+"37" => "Konin",
+"38" => "Koszalin",
+"39" => "Krakow",
+"40" => "Krosno",
+"41" => "Legnica",
+"42" => "Leszno",
+"43" => "Lodz",
+"44" => "Lomza",
+"45" => "Lublin",
+"46" => "Nowy Sacz",
+"47" => "Olsztyn",
+"48" => "Opole",
+"49" => "Ostroleka",
+"50" => "Pila",
+"51" => "Piotrkow",
+"52" => "Plock",
+"53" => "Poznan",
+"54" => "Przemysl",
+"55" => "Radom",
+"56" => "Rzeszow",
+"57" => "Siedlce",
+"58" => "Sieradz",
+"59" => "Skierniewice",
+"60" => "Slupsk",
+"61" => "Suwalki",
+"62" => "Szczecin",
+"63" => "Tarnobrzeg",
+"64" => "Tarnow",
+"65" => "Torun",
+"66" => "Walbrzych",
+"67" => "Warszawa",
+"68" => "Wloclawek",
+"69" => "Wroclaw",
+"70" => "Zamosc",
+"71" => "Zielona Gora"),
+"PT" => array(
+"02" => "Aveiro",
+"03" => "Beja",
+"04" => "Braga",
+"05" => "Braganca",
+"06" => "Castelo Branco",
+"07" => "Coimbra",
+"08" => "Evora",
+"09" => "Faro",
+"10" => "Madeira",
+"11" => "Guarda",
+"13" => "Leiria",
+"14" => "Lisboa",
+"16" => "Portalegre",
+"17" => "Porto",
+"18" => "Santarem",
+"19" => "Setubal",
+"20" => "Viana do Castelo",
+"21" => "Vila Real",
+"22" => "Viseu",
+"23" => "Azores"),
+"PY" => array(
+"01" => "Alto Parana",
+"02" => "Amambay",
+"03" => "Boqueron",
+"04" => "Caaguazu",
+"05" => "Caazapa",
+"06" => "Central",
+"07" => "Concepcion",
+"08" => "Cordillera",
+"10" => "Guaira",
+"11" => "Itapua",
+"12" => "Misiones",
+"13" => "Neembucu",
+"15" => "Paraguari",
+"16" => "Presidente Hayes",
+"17" => "San Pedro",
+"18" => "Alto Paraguay",
+"19" => "Canindeyu",
+"20" => "Chaco",
+"21" => "Nueva Asuncion"),
+"QA" => array(
+"01" => "Ad Dawhah",
+"02" => "Al Ghuwariyah",
+"03" => "Al Jumaliyah",
+"04" => "Al Khawr",
+"05" => "Al Wakrah",
+"06" => "Ar Rayyan",
+"07" => "Jariyan al Batnah",
+"08" => "Madinat ach Shamal",
+"09" => "Umm Salal"),
+"RO" => array(
+"01" => "Alba",
+"02" => "Arad",
+"03" => "Arges",
+"04" => "Bacau",
+"05" => "Bihor",
+"06" => "Bistrita-Nasaud",
+"07" => "Botosani",
+"08" => "Braila",
+"09" => "Brasov",
+"10" => "Bucuresti",
+"11" => "Buzau",
+"12" => "Caras-Severin",
+"13" => "Cluj",
+"14" => "Constanta",
+"15" => "Covasna",
+"16" => "Dambovita",
+"17" => "Dolj",
+"18" => "Galati",
+"19" => "Gorj",
+"20" => "Harghita",
+"21" => "Hunedoara",
+"22" => "Ialomita",
+"23" => "Iasi",
+"25" => "Maramures",
+"26" => "Mehedinti",
+"27" => "Mures",
+"28" => "Neamt",
+"29" => "Olt",
+"30" => "Prahova",
+"31" => "Salaj",
+"32" => "Satu Mare",
+"33" => "Sibiu",
+"34" => "Suceava",
+"35" => "Teleorman",
+"36" => "Timis",
+"37" => "Tulcea",
+"38" => "Vaslui",
+"39" => "Valcea",
+"40" => "Vrancea",
+"41" => "Calarasi",
+"42" => "Giurgiu"),
+"RU" => array(
+"01" => "Adygey",
+"02" => "Aga Buryat",
+"03" => "Gorno-Altay",
+"04" => "Altay",
+"05" => "Amur",
+"06" => "Arkhangel'sk",
+"07" => "Astrakhan'",
+"08" => "Bashkortostan",
+"09" => "Belgorod",
+"10" => "Bryansk",
+"11" => "Buryat",
+"12" => "Chechnya",
+"13" => "Chelyabinsk",
+"14" => "Chita",
+"15" => "Chukot",
+"16" => "Chuvash",
+"17" => "Dagestan",
+"18" => "Evenk",
+"19" => "Ingush",
+"20" => "Irkutsk",
+"21" => "Ivanovo",
+"22" => "Kabardin-Balkar",
+"23" => "Kaliningrad",
+"24" => "Kalmyk",
+"25" => "Kaluga",
+"26" => "Kamchatka",
+"27" => "Karachay-Cherkess",
+"28" => "Karelia",
+"29" => "Kemerovo",
+"30" => "Khabarovsk",
+"31" => "Khakass",
+"32" => "Khanty-Mansiy",
+"33" => "Kirov",
+"34" => "Komi",
+"35" => "Komi-Permyak",
+"36" => "Koryak",
+"37" => "Kostroma",
+"38" => "Krasnodar",
+"39" => "Krasnoyarsk",
+"40" => "Kurgan",
+"41" => "Kursk",
+"42" => "Leningrad",
+"43" => "Lipetsk",
+"44" => "Magadan",
+"45" => "Mariy-El",
+"46" => "Mordovia",
+"47" => "Moskva",
+"48" => "Moscow City",
+"49" => "Murmansk",
+"50" => "Nenets",
+"51" => "Nizhegorod",
+"52" => "Novgorod",
+"53" => "Novosibirsk",
+"54" => "Omsk",
+"55" => "Orenburg",
+"56" => "Orel",
+"57" => "Penza",
+"58" => "Perm'",
+"59" => "Primor'ye",
+"60" => "Pskov",
+"61" => "Rostov",
+"62" => "Ryazan'",
+"63" => "Sakha",
+"64" => "Sakhalin",
+"65" => "Samara",
+"66" => "Saint Petersburg City",
+"67" => "Saratov",
+"68" => "North Ossetia",
+"69" => "Smolensk",
+"70" => "Stavropol'",
+"71" => "Sverdlovsk",
+"72" => "Tambov",
+"73" => "Tatarstan",
+"74" => "Taymyr",
+"75" => "Tomsk",
+"76" => "Tula",
+"77" => "Tver'",
+"78" => "Tyumen'",
+"79" => "Tuva",
+"80" => "Udmurt",
+"81" => "Ul'yanovsk",
+"82" => "Ust-Orda Buryat",
+"83" => "Vladimir",
+"84" => "Volgograd",
+"85" => "Vologda",
+"86" => "Voronezh",
+"87" => "Yamal-Nenets",
+"88" => "Yaroslavl'",
+"89" => "Yevrey"),
+"RW" => array(
+"01" => "Butare",
+"02" => "Byumba",
+"03" => "Cyangugu",
+"04" => "Gikongoro",
+"05" => "Gisenyi",
+"06" => "Gitarama",
+"07" => "Kibungo",
+"08" => "Kibuye",
+"09" => "Kigali",
+"10" => "Ruhengeri"),
+"SA" => array(
+"02" => "Al Bahah",
+"03" => "Al Jawf",
+"05" => "Al Madinah",
+"06" => "Ash Sharqiyah",
+"08" => "Al Qasim",
+"09" => "Al Qurayyat",
+"10" => "Ar Riyad",
+"13" => "Ha'il",
+"14" => "Makkah",
+"15" => "Al Hudud ash Shamaliyah",
+"16" => "Najran",
+"17" => "Jizan",
+"19" => "Tabuk"),
+"SB" => array(
+"03" => "Malaita",
+"04" => "Western",
+"05" => "Central",
+"06" => "Guadalcanal",
+"07" => "Isabel",
+"08" => "Makira",
+"09" => "Temotu"),
+"SC" => array(
+"01" => "Anse aux Pins",
+"02" => "Anse Boileau",
+"03" => "Anse Etoile",
+"04" => "Anse Louis",
+"05" => "Anse Royale",
+"06" => "Baie Lazare",
+"07" => "Baie Sainte Anne",
+"08" => "Beau Vallon",
+"09" => "Bel Air",
+"10" => "Bel Ombre",
+"11" => "Cascade",
+"12" => "Glacis",
+"13" => "Grand' Anse",
+"14" => "Grand' Anse",
+"15" => "La Digue",
+"16" => "La Riviere Anglaise",
+"17" => "Mont Buxton",
+"18" => "Mont Fleuri",
+"19" => "Plaisance",
+"20" => "Pointe La Rue",
+"21" => "Port Glaud",
+"22" => "Saint Louis",
+"23" => "Takamaka"),
+"SD" => array(
+"27" => "Al Wusta",
+"28" => "Al Istiwa'iyah",
+"29" => "Al Khartum",
+"30" => "Ash Shamaliyah",
+"31" => "Ash Sharqiyah",
+"32" => "Bahr al Ghazal",
+"33" => "Darfur",
+"34" => "Kurdufan"),
+"SE" => array(
+"01" => "Alvsborgs Lan",
+"02" => "Blekinge Lan",
+"03" => "Gavleborgs Lan",
+"04" => "Goteborgs och Bohus Lan",
+"05" => "Gotlands Lan",
+"06" => "Hallands Lan",
+"07" => "Jamtlands Lan",
+"08" => "Jonkopings Lan",
+"09" => "Kalmar Lan",
+"10" => "Kopparbergs Lan",
+"11" => "Kristianstads Lan",
+"12" => "Kronobergs Lan",
+"13" => "Malmohus Lan",
+"14" => "Norrbottens Lan",
+"15" => "Orebro Lan",
+"16" => "Ostergotlands Lan",
+"17" => "Skaraborgs Lan",
+"18" => "Sodermanlands Lan",
+"21" => "Uppsala Lan",
+"22" => "Varmlands Lan",
+"23" => "Vasterbottens Lan",
+"24" => "Vasternorrlands Lan",
+"25" => "Vastmanlands Lan",
+"26" => "Stockholms Lan",
+"27" => "Skane Lan",
+"28" => "Vastra Gotaland"),
+"SH" => array(
+"01" => "Ascension",
+"02" => "Saint Helena",
+"03" => "Tristan da Cunha"),
+"SK" => array(
+"01" => "Banska Bystrica",
+"02" => "Bratislava",
+"03" => "Kosice",
+"04" => "Nitra",
+"05" => "Presov",
+"06" => "Trencin",
+"07" => "Trnava",
+"08" => "Zilina"),
+"SL" => array(
+"01" => "Eastern",
+"02" => "Northern",
+"03" => "Southern",
+"04" => "Western Area"),
+"SM" => array(
+"01" => "Acquaviva",
+"02" => "Chiesanuova",
+"03" => "Domagnano",
+"04" => "Faetano",
+"05" => "Fiorentino",
+"06" => "Borgo Maggiore",
+"07" => "San Marino",
+"08" => "Monte Giardino",
+"09" => "Serravalle"),
+"SN" => array(
+"01" => "Dakar",
+"03" => "Diourbel",
+"04" => "Saint-Louis",
+"05" => "Tambacounda",
+"07" => "Thies",
+"08" => "Louga",
+"09" => "Fatick",
+"10" => "Kaolack",
+"11" => "Kolda",
+"12" => "Ziguinchor"),
+"SO" => array(
+"01" => "Bakool",
+"02" => "Banaadir",
+"03" => "Bari",
+"04" => "Bay",
+"05" => "Galguduud",
+"06" => "Gedo",
+"07" => "Hiiraan",
+"08" => "Jubbada Dhexe",
+"09" => "Jubbada Hoose",
+"10" => "Mudug",
+"11" => "Nugaal",
+"12" => "Sanaag",
+"13" => "Shabeellaha Dhexe",
+"14" => "Shabeellaha Hoose",
+"15" => "Togdheer",
+"16" => "Woqooyi Galbeed"),
+"SR" => array(
+"10" => "Brokopondo",
+"11" => "Commewijne",
+"12" => "Coronie",
+"13" => "Marowijne",
+"14" => "Nickerie",
+"15" => "Para",
+"16" => "Paramaribo",
+"17" => "Saramacca",
+"18" => "Sipaliwini",
+"19" => "Wanica"),
+"ST" => array(
+"01" => "Principe",
+"02" => "Sao Tome"),
+"SV" => array(
+"01" => "Ahuachapan",
+"02" => "Cabanas",
+"03" => "Chalatenango",
+"04" => "Cuscatlan",
+"05" => "La Libertad",
+"06" => "La Paz",
+"07" => "La Union",
+"08" => "Morazan",
+"09" => "San Miguel",
+"10" => "San Salvador",
+"11" => "Santa Ana",
+"12" => "San Vicente",
+"13" => "Sonsonate",
+"14" => "Usulutan"),
+"SY" => array(
+"01" => "Al Hasakah",
+"02" => "Al Ladhiqiyah",
+"03" => "Al Qunaytirah",
+"04" => "Ar Raqqah",
+"05" => "As Suwayda'",
+"06" => "Dar",
+"07" => "Dayr az Zawr",
+"08" => "Rif Dimashq",
+"09" => "Halab",
+"10" => "Hamah",
+"11" => "Hims",
+"12" => "Idlib",
+"13" => "Dimashq",
+"14" => "Tartus"),
+"SZ" => array(
+"01" => "Hhohho",
+"02" => "Lubombo",
+"03" => "Manzini",
+"04" => "Shiselweni",
+"05" => "Praslin"),
+"TD" => array(
+"01" => "Batha",
+"02" => "Biltine",
+"03" => "Borkou-Ennedi-Tibesti",
+"04" => "Chari-Baguirmi",
+"05" => "Guera",
+"06" => "Kanem",
+"07" => "Lac",
+"08" => "Logone Occidental",
+"09" => "Logone Oriental",
+"10" => "Mayo-Kebbi",
+"11" => "Moyen-Chari",
+"12" => "Ouaddai",
+"13" => "Salamat",
+"14" => "Tandjile"),
+"TG" => array(
+"01" => "Amlame",
+"02" => "Aneho",
+"03" => "Atakpame",
+"04" => "Bafilo",
+"05" => "Bassar",
+"06" => "Dapaong",
+"07" => "Kante",
+"08" => "Klouto",
+"09" => "Lama-Kara",
+"10" => "Lome",
+"11" => "Mango",
+"12" => "Niamtougou",
+"13" => "Notse",
+"14" => "Kpagouda",
+"15" => "Badou",
+"16" => "Sotouboua",
+"17" => "Tabligbo",
+"18" => "Tsevie",
+"19" => "Tchamba",
+"20" => "Tchaoudjo",
+"21" => "Vogan"),
+"TH" => array(
+"01" => "Mae Hong Son",
+"02" => "Chiang Mai",
+"03" => "Chiang Rai",
+"04" => "Nan",
+"05" => "Lamphun",
+"06" => "Lampang",
+"07" => "Phrae",
+"08" => "Tak",
+"09" => "Sukhothai",
+"10" => "Uttaradit",
+"11" => "Kamphaeng Phet",
+"12" => "Phitsanulok",
+"13" => "Phichit",
+"14" => "Phetchabun",
+"15" => "Uthai Thani",
+"16" => "Nakhon Sawan",
+"17" => "Nong Khai",
+"18" => "Loei",
+"19" => "Udon Thani",
+"20" => "Sakon Nakhon",
+"21" => "Nakhon Phanom",
+"22" => "Khon Kaen",
+"23" => "Kalasin",
+"24" => "Maha Sarakham",
+"25" => "Roi Et",
+"26" => "Chaiyaphum",
+"27" => "Nakhon Ratchasima",
+"28" => "Buriram",
+"29" => "Surin",
+"30" => "Sisaket",
+"31" => "Narathiwat",
+"32" => "Chai Nat",
+"33" => "Sing Buri",
+"34" => "Lop Buri",
+"35" => "Ang Thong",
+"36" => "Phra Nakhon Si Ayutthaya",
+"37" => "Saraburi",
+"38" => "Nonthaburi",
+"39" => "Pathum Thani",
+"40" => "Krung Thep",
+"41" => "Phayao",
+"42" => "Samut Prakan",
+"43" => "Nakhon Nayok",
+"44" => "Chachoengsao",
+"45" => "Prachin Buri",
+"46" => "Chon Buri",
+"47" => "Rayong",
+"48" => "Chanthaburi",
+"49" => "Trat",
+"50" => "Kanchanaburi",
+"51" => "Suphan Buri",
+"52" => "Ratchaburi",
+"53" => "Nakhon Pathom",
+"54" => "Samut Songkhram",
+"55" => "Samut Sakhon",
+"56" => "Phetchaburi",
+"57" => "Prachuap Khiri Khan",
+"58" => "Chumphon",
+"59" => "Ranong",
+"60" => "Surat Thani",
+"61" => "Phangnga",
+"62" => "Phuket",
+"63" => "Krabi",
+"64" => "Nakhon Si Thammarat",
+"65" => "Trang",
+"66" => "Phatthalung",
+"67" => "Satun",
+"68" => "Songkhla",
+"69" => "Pattani",
+"70" => "Yala",
+"71" => "Ubon Ratchathani",
+"72" => "Yasothon"),
+"TM" => array(
+"01" => "Ahal",
+"02" => "Balkan",
+"03" => "Dashoguz",
+"04" => "Lebap",
+"05" => "Mary"),
+"TN" => array(
+"02" => "Al Qasrayn",
+"03" => "Al Qayrawan",
+"06" => "Jundubah",
+"10" => "Qafsah",
+"14" => "Al Kaf",
+"15" => "Al Mahdiyah",
+"16" => "Al Munastir",
+"17" => "Bajah",
+"18" => "Banzart",
+"19" => "Nabul",
+"22" => "Silyanah",
+"23" => "Susah",
+"26" => "Aryanah",
+"27" => "Bin",
+"28" => "Madanin",
+"29" => "Qabis",
+"31" => "Qibili",
+"32" => "Safaqis",
+"33" => "Sidi Bu Zayd",
+"34" => "Tatawin",
+"35" => "Tawzar",
+"36" => "Tunis",
+"37" => "Zaghwan"),
+"TO" => array(
+"01" => "Ha",
+"02" => "Tongatapu",
+"03" => "Vava"),
+"TR" => array(
+"02" => "Adiyaman",
+"03" => "Afyon",
+"04" => "Agri",
+"05" => "Amasya",
+"07" => "Antalya",
+"08" => "Artvin",
+"09" => "Aydin",
+"10" => "Balikesir",
+"11" => "Bilecik",
+"12" => "Bingol",
+"13" => "Bitlis",
+"14" => "Bolu",
+"15" => "Burdur",
+"16" => "Bursa",
+"17" => "Canakkale",
+"19" => "Corum",
+"20" => "Denizli",
+"21" => "Diyarbakir",
+"22" => "Edirne",
+"23" => "Elazig",
+"24" => "Erzincan",
+"25" => "Erzurum",
+"26" => "Eskisehir",
+"28" => "Giresun",
+"31" => "Hatay",
+"32" => "Icel",
+"33" => "Isparta",
+"34" => "Istanbul",
+"35" => "Izmir",
+"37" => "Kastamonu",
+"38" => "Kayseri",
+"39" => "Kirklareli",
+"40" => "Kirsehir",
+"41" => "Kocaeli",
+"43" => "Kutahya",
+"44" => "Malatya",
+"45" => "Manisa",
+"46" => "Kahramanmaras",
+"48" => "Mugla",
+"49" => "Mus",
+"50" => "Nevsehir",
+"52" => "Ordu",
+"53" => "Rize",
+"54" => "Sakarya",
+"55" => "Samsun",
+"57" => "Sinop",
+"58" => "Sivas",
+"59" => "Tekirdag",
+"60" => "Tokat",
+"61" => "Trabzon",
+"62" => "Tunceli",
+"63" => "Sanliurfa",
+"64" => "Usak",
+"65" => "Van",
+"66" => "Yozgat",
+"68" => "Ankara",
+"69" => "Gumushane",
+"70" => "Hakkari",
+"71" => "Konya",
+"72" => "Mardin",
+"73" => "Nigde",
+"74" => "Siirt",
+"75" => "Aksaray",
+"76" => "Batman",
+"77" => "Bayburt",
+"78" => "Karaman",
+"79" => "Kirikkale",
+"80" => "Sirnak",
+"81" => "Adana",
+"82" => "Cankiri",
+"83" => "Gaziantep",
+"84" => "Kars",
+"85" => "Zonguldak",
+"86" => "Ardahan",
+"87" => "Bartin",
+"88" => "Igdir",
+"89" => "Karabuk",
+"90" => "Kilis",
+"91" => "Osmaniye",
+"92" => "Yalova"),
+"TT" => array(
+"01" => "Arima",
+"02" => "Caroni",
+"03" => "Mayaro",
+"04" => "Nariva",
+"05" => "Port-of-Spain",
+"06" => "Saint Andrew",
+"07" => "Saint David",
+"08" => "Saint George",
+"09" => "Saint Patrick",
+"10" => "San Fernando",
+"11" => "Tobago",
+"12" => "Victoria"),
+"TW" => array(
+"01" => "Fu-chien",
+"02" => "Kao-hsiung",
+"03" => "T'ai-pei",
+"04" => "T'ai-wan"),
+"TZ" => array(
+"01" => "Arusha",
+"02" => "Pwani",
+"03" => "Dodoma",
+"04" => "Iringa",
+"05" => "Kigoma",
+"06" => "Kilimanjaro",
+"07" => "Lindi",
+"08" => "Mara",
+"09" => "Mbeya",
+"10" => "Morogoro",
+"11" => "Mtwara",
+"12" => "Mwanza",
+"13" => "Pemba North",
+"14" => "Ruvuma",
+"15" => "Shinyanga",
+"16" => "Singida",
+"17" => "Tabora",
+"18" => "Tanga",
+"19" => "Kagera",
+"20" => "Pemba South",
+"21" => "Zanzibar Central",
+"22" => "Zanzibar North",
+"23" => "Dar es Salaam",
+"24" => "Rukwa",
+"25" => "Zanzibar Urban"),
+"UA" => array(
+"01" => "Cherkas'ka Oblast'",
+"02" => "Chernihivs'ka Oblast'",
+"03" => "Chernivets'ka Oblast'",
+"04" => "Dnipropetrovs'ka Oblast'",
+"05" => "Donets'ka Oblast'",
+"06" => "Ivano-Frankivs'ka Oblast'",
+"07" => "Kharkivs'ka Oblast'",
+"08" => "Khersons'ka Oblast'",
+"09" => "Khmel'nyts'ka Oblast'",
+"10" => "Kirovohrads'ka Oblast'",
+"11" => "Krym",
+"12" => "Kyyiv",
+"13" => "Kyyivs'ka Oblast'",
+"14" => "Luhans'ka Oblast'",
+"15" => "L'vivs'ka Oblast'",
+"16" => "Mykolayivs'ka Oblast'",
+"17" => "Odes'ka Oblast'",
+"18" => "Poltavs'ka Oblast'",
+"19" => "Rivnens'ka Oblast'",
+"20" => "Sevastopol'",
+"21" => "Sums'ka Oblast'",
+"22" => "Ternopil's'ka Oblast'",
+"23" => "Vinnyts'ka Oblast'",
+"24" => "Volyns'ka Oblast'",
+"25" => "Zakarpats'ka Oblast'",
+"26" => "Zaporiz'ka Oblast'",
+"27" => "Zhytomyrs'ka Oblast'"),
+"UG" => array(
+"05" => "Busoga",
+"08" => "Karamoja",
+"12" => "South Buganda",
+"18" => "Central",
+"20" => "Eastern",
+"21" => "Nile",
+"22" => "North Buganda",
+"23" => "Northern",
+"24" => "Southern",
+"25" => "Western",
+"65" => "Adjumani",
+"66" => "Bugiri",
+"67" => "Busia",
+"69" => "Katakwi",
+"73" => "Nakasongola",
+"74" => "Sembabule"),
+"UY" => array(
+"01" => "Artigas",
+"02" => "Canelones",
+"03" => "Cerro Largo",
+"04" => "Colonia",
+"05" => "Durazno",
+"06" => "Flores",
+"07" => "Florida",
+"08" => "Lavalleja",
+"09" => "Maldonado",
+"10" => "Montevideo",
+"11" => "Paysandu",
+"12" => "Rio Negro",
+"13" => "Rivera",
+"14" => "Rocha",
+"15" => "Salto",
+"16" => "San Jose",
+"17" => "Soriano",
+"18" => "Tacuarembo",
+"19" => "Treinta y Tres"),
+"UZ" => array(
+"01" => "Andijon",
+"02" => "Bukhoro",
+"03" => "Farghona",
+"04" => "Jizzakh",
+"05" => "Khorazm",
+"06" => "Namangan",
+"07" => "Nawoiy",
+"08" => "Qashqadaryo",
+"09" => "Qoraqalpoghiston",
+"10" => "Samarqand",
+"11" => "Sirdaryo",
+"12" => "Surkhondaryo",
+"13" => "Toshkent",
+"14" => "Toshkent"),
+"VC" => array(
+"01" => "Charlotte",
+"02" => "Saint Andrew",
+"03" => "Saint David",
+"04" => "Saint George",
+"05" => "Saint Patrick",
+"06" => "Grenadines"),
+"VE" => array(
+"01" => "Amazonas",
+"02" => "Anzoategui",
+"03" => "Apure",
+"04" => "Aragua",
+"05" => "Barinas",
+"06" => "Bolivar",
+"07" => "Carabobo",
+"08" => "Cojedes",
+"09" => "Delta Amacuro",
+"11" => "Falcon",
+"12" => "Guarico",
+"13" => "Lara",
+"14" => "Merida",
+"15" => "Miranda",
+"16" => "Monagas",
+"17" => "Nueva Esparta",
+"18" => "Portuguesa",
+"19" => "Sucre",
+"20" => "Tachira",
+"21" => "Trujillo",
+"22" => "Yaracuy",
+"23" => "Zulia",
+"24" => "Dependencias Federales",
+"25" => "Distrito Federal",
+"26" => "Vargas"),
+"VN" => array(
+"02" => "Bac Thai",
+"03" => "Ben Tre",
+"05" => "Cao Bang",
+"11" => "Ha Bac",
+"12" => "Hai Hung",
+"13" => "Hai Phong",
+"22" => "Lai Chau",
+"23" => "Lam Dong",
+"24" => "Long An",
+"29" => "Quang Nam-Da Nang",
+"30" => "Quang Ninh",
+"32" => "Son La",
+"33" => "Tay Ninh",
+"34" => "Thanh Hoa",
+"35" => "Thai Binh",
+"37" => "Tien Giang",
+"39" => "Lang Son",
+"43" => "An Giang",
+"44" => "Dac Lac",
+"45" => "Dong Nai",
+"46" => "Dong Thap",
+"47" => "Kien Giang",
+"48" => "Minh Hai",
+"49" => "Song Be",
+"50" => "Vinh Phu",
+"51" => "Ha Noi",
+"52" => "Ho Chi Minh",
+"53" => "Ba Ria-Vung Tau",
+"54" => "Binh Dinh",
+"55" => "Binh Thuan",
+"56" => "Can Tho",
+"57" => "Gia Lai",
+"58" => "Ha Giang",
+"59" => "Ha Tay",
+"60" => "Ha Tinh",
+"61" => "Hoa Binh",
+"62" => "Khanh Hoa",
+"63" => "Kon Tum",
+"64" => "Lao Cai",
+"65" => "Nam Ha",
+"66" => "Nghe An",
+"67" => "Ninh Binh",
+"68" => "Ninh Thuan",
+"69" => "Phu Yen",
+"70" => "Quang Binh",
+"71" => "Quang Ngai",
+"72" => "Quang Tri",
+"73" => "Soc Trang",
+"74" => "Thua Thien",
+"75" => "Tra Vinh",
+"76" => "Tuyen Quang",
+"77" => "Vinh Long",
+"78" => "Yen Bai"),
+"VU" => array(
+"05" => "Ambrym",
+"06" => "Aoba",
+"07" => "Banks",
+"08" => "Efate",
+"09" => "Epi",
+"10" => "Malakula",
+"11" => "Paama",
+"12" => "Pentecote",
+"13" => "Santo",
+"14" => "Shepherd",
+"15" => "Tafea"),
+"WS" => array(
+"02" => "Aiga-i-le-Tai",
+"03" => "Atua",
+"04" => "Fa",
+"05" => "Gaga",
+"06" => "Va",
+"07" => "Gagaifomauga",
+"08" => "Palauli",
+"09" => "Satupa",
+"10" => "Tuamasaga",
+"11" => "Vaisigano"),
+"YE" => array(
+"01" => "Abyan",
+"03" => "Al Mahrah",
+"04" => "Hadramawt",
+"05" => "Shabwah",
+"06" => "Lahij",
+"07" => "Al Bayda'",
+"08" => "Al Hudaydah",
+"09" => "Al Jawf",
+"10" => "Al Mahwit",
+"11" => "Dhamar",
+"12" => "Hajjah",
+"13" => "Ibb",
+"14" => "Ma'rib",
+"15" => "Sa",
+"16" => "San",
+"17" => "Ta"),
+"ZA" => array(
+"01" => "Cape Province",
+"02" => "Natal",
+"03" => "Orange Free State",
+"04" => "Transvaal"),
+"ZM" => array(
+"01" => "Western",
+"02" => "Central",
+"03" => "Eastern",
+"04" => "Luapula",
+"05" => "Northern",
+"06" => "North-Western",
+"07" => "Southern",
+"08" => "Copperbelt",
+"09" => "Lusaka"),
+"ZR" => array(
+"01" => "Bandundu",
+"02" => "Equateur",
+"03" => "Kasai-Occidental",
+"04" => "Kasai-Oriental",
+"05" => "Shaba",
+"06" => "Kinshasa",
+"07" => "Kivu",
+"08" => "Bas-Zaire",
+"09" => "Haut-Zaire"),
+"ZW" => array(
+"01" => "Manicaland",
+"02" => "Midlands",
+"03" => "Mashonaland Central",
+"04" => "Mashonaland East",
+"05" => "Mashonaland West",
+"06" => "Matabeleland North",
+"07" => "Matabeleland South",
+"08" => "Masvingo",
+"09" => "Bulawayo",
+"10" => "Harare")
+);
+?>
index cf82008..5793cc9 100644 (file)
@@ -675,6 +675,14 @@ body#user-index #longtimenosee {
   font-size: 0.8em;
 }
 
+.iplookup #header h1.headermain {
+  font-size:1em;
+}
+
+.iplookup #note {
+  font-size:0.8em;
+  font-style: italic;
+}
 
 /***
  *** Modules: Assignment
index 3bab97f..b020f9c 100644 (file)
@@ -3150,6 +3150,14 @@ body#user-index .rolesform {
   height:100%;
 }
 
+.iplookup #map {
+  margin:auto;
+}
+
+.iplookup #note {
+  text-align:center;
+}
+
 /***
  *** Modules: Assignment
  ***/