[Pmap-commits] r1 - / config config/default doc doc/img images images/buttons images/buttons/pan images/cursors images/dtree images/legend images/slider images/slider/new images/tree incphp incphp/extlib incphp/init incphp/locale incphp/modules incphp/modules/export incphp/print incphp/print/fonts incphp/print/fonts/freefont incphp/query incphp/xajax javascript templates util util/arcview3

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Oct 29 15:54:56 CET 2006


Author: cavallini
Date: 2006-10-29 15:54:24 +0100 (Sun, 29 Oct 2006)
New Revision: 1

Added:
   README.txt
   blank.html
   config/
   config/config.ini
   config/default/
   config/default/js_config.php
   config/default/php_config.php
   config/default/pmapper_demo.map
   config/startup_config.php
   doc/
   doc/acknowledgements.txt
   doc/changelog_versions.txt
   doc/img/
   doc/img/frameset.gif
   doc/img/logo.gif
   doc/license.txt
   doc/manual.html
   doc/quick_install.txt
   download.phtml
   downloaddlg.phtml
   images/
   images/blank.gif
   images/buttons/
   images/buttons/auto_identify_off.gif
   images/buttons/back_off.gif
   images/buttons/back_on.gif
   images/buttons/buttons.psd
   images/buttons/coords_off.gif
   images/buttons/coords_on.gif
   images/buttons/digitize_off.gif
   images/buttons/digitize_on.gif
   images/buttons/download_off.gif
   images/buttons/download_on.gif
   images/buttons/fwd_off.gif
   images/buttons/home_off.gif
   images/buttons/home_on.gif
   images/buttons/identify_off.gif
   images/buttons/identify_on.gif
   images/buttons/measure_off.gif
   images/buttons/measure_on.gif
   images/buttons/pan/
   images/buttons/pan/pane_off.gif
   images/buttons/pan/pann_off.gif
   images/buttons/pan/pannw_off.gif
   images/buttons/pan/pans_off.gif
   images/buttons/pan/panw_off.gif
   images/buttons/pan_e.gif
   images/buttons/pan_n.gif
   images/buttons/pan_off.gif
   images/buttons/pan_on.gif
   images/buttons/pan_s.gif
   images/buttons/pan_w.gif
   images/buttons/poi_off.gif
   images/buttons/poi_on.gif
   images/buttons/print_off.gif
   images/buttons/print_on.gif
   images/buttons/reload_off.gif
   images/buttons/reload_on.gif
   images/buttons/resize_off.gif
   images/buttons/select_off.gif
   images/buttons/select_on.gif
   images/buttons/separatorh.gif
   images/buttons/separatorv.gif
   images/buttons/space.gif
   images/buttons/zoomin_off.gif
   images/buttons/zoomin_off0.gif
   images/buttons/zoomin_on.gif
   images/buttons/zoomin_on.gif_
   images/buttons/zoomminus.gif
   images/buttons/zoomminus0.gif
   images/buttons/zoomout_off.gif
   images/buttons/zoomout_off_0.gif
   images/buttons/zoomout_on.gif
   images/buttons/zoomplus.gif
   images/buttons/zoomplus0.gif
   images/close.gif
   images/close1.gif
   images/close2.gif
   images/cursors/
   images/cursors/center.cur
   images/cursors/cross.cur
   images/cursors/hourglass.cur
   images/cursors/identify.cur
   images/cursors/link.cur
   images/cursors/measure.cur
   images/cursors/measure.gif
   images/cursors/pan.cur
   images/cursors/pencil.cur
   images/cursors/select.cur
   images/cursors/xy.cur
   images/cursors/zoomin.ani
   images/cursors/zoomin.cur
   images/cursors/zoomout.cur
   images/downsimple.png
   images/dtree/
   images/dtree/base.gif
   images/dtree/cd.gif
   images/dtree/empty.gif
   images/dtree/folder.gif
   images/dtree/folderopen.gif
   images/dtree/globe.gif
   images/dtree/imgfolder.gif
   images/dtree/join.gif
   images/dtree/joinbottom.gif
   images/dtree/layers.gif
   images/dtree/layers0.gif
   images/dtree/line.gif
   images/dtree/minus.gif
   images/dtree/minusbottom.gif
   images/dtree/musicfolder.gif
   images/dtree/nolines_minus.gif
   images/dtree/nolines_plus.gif
   images/dtree/page.gif
   images/dtree/plus.gif
   images/dtree/plusbottom.gif
   images/dtree/question.gif
   images/dtree/trash.gif
   images/favicon.ico
   images/layer.gif
   images/layers.gif
   images/legend/
   images/legend/cities_i0.png
   images/legend/cities_i1.png
   images/legend/cities_i2.png
   images/legend/cities_i3.png
   images/legend/corine1_i0.png
   images/legend/corine1_i1.png
   images/legend/corine1_i10.png
   images/legend/corine1_i11.png
   images/legend/corine1_i12.png
   images/legend/corine1_i13.png
   images/legend/corine1_i14.png
   images/legend/corine1_i15.png
   images/legend/corine1_i16.png
   images/legend/corine1_i17.png
   images/legend/corine1_i18.png
   images/legend/corine1_i19.png
   images/legend/corine1_i2.png
   images/legend/corine1_i20.png
   images/legend/corine1_i21.png
   images/legend/corine1_i22.png
   images/legend/corine1_i23.png
   images/legend/corine1_i24.png
   images/legend/corine1_i25.png
   images/legend/corine1_i26.png
   images/legend/corine1_i27.png
   images/legend/corine1_i28.png
   images/legend/corine1_i29.png
   images/legend/corine1_i3.png
   images/legend/corine1_i30.png
   images/legend/corine1_i31.png
   images/legend/corine1_i32.png
   images/legend/corine1_i33.png
   images/legend/corine1_i34.png
   images/legend/corine1_i4.png
   images/legend/corine1_i5.png
   images/legend/corine1_i6.png
   images/legend/corine1_i7.png
   images/legend/corine1_i8.png
   images/legend/corine1_i9.png
   images/legend/countries_i0.png
   images/legend/createimg.log
   images/legend/rivers_i0.png
   images/load.gif
   images/loading.gif
   images/logo.gif
   images/logo.png
   images/logo2.gif
   images/map.png
   images/map0.png
   images/mapserver.gif
   images/mapserver_65_bw_t.gif
   images/mimg.gif
   images/pixel.gif
   images/pmapper.png
   images/powered_mapserver.png
   images/refcross.gif
   images/refcross0.gif
   images/reference.jpg
   images/reference.png
   images/reference_world.png
   images/slider/
   images/slider/0_sl_off.gif
   images/slider/0_sl_on.gif
   images/slider/1_sl_off.gif
   images/slider/1_sl_on.gif
   images/slider/2_sl_off.gif
   images/slider/2_sl_on.gif
   images/slider/3_sl_off.gif
   images/slider/3_sl_on.gif
   images/slider/4_sl_off.gif
   images/slider/4_sl_on.gif
   images/slider/5_sl_off.gif
   images/slider/5_sl_on.gif
   images/slider/6_sl_off.gif
   images/slider/6_sl_on.gif
   images/slider/7_sl_off.gif
   images/slider/7_sl_on.gif
   images/slider/new/
   images/slider/new/0_sl_off.gif
   images/slider/new/0_sl_on.gif
   images/slider/new/1_sl_off.gif
   images/slider/new/1_sl_on.gif
   images/slider/new/2_sl_off.gif
   images/slider/new/2_sl_on.gif
   images/slider/new/3_sl_off.gif
   images/slider/new/3_sl_on.gif
   images/slider/new/4_sl_off.gif
   images/slider/new/4_sl_on.gif
   images/slider/new/5_sl_off.gif
   images/slider/new/5_sl_on.gif
   images/slider/new/6_sl_off.gif
   images/slider/new/6_sl_on.gif
   images/slider/new/7_sl_off.gif
   images/slider/new/7_sl_on.gif
   images/slider/zoomminus.gif
   images/slider/zoomplus.gif
   images/tree/
   images/tree/empty.gif
   images/tree/layers.gif
   images/tree/minus.gif
   images/tree/plus.gif
   images/upsimple.png
   images/valid-xhtml10.png
   images/zoomto.gif
   images/zoomto1.gif
   images/zoomtoall.gif
   incphp/
   incphp/common.php
   incphp/custom.php
   incphp/customlayers.php
   incphp/extlib/
   incphp/extlib/json.php
   incphp/globals.php
   incphp/group.php
   incphp/init/
   incphp/init/init.php
   incphp/init/initmap.php
   incphp/init/startup.php
   incphp/initgroups.php
   incphp/js_custom.php
   incphp/js_locales.php
   incphp/js_preloadimages.php
   incphp/legend.php
   incphp/locale/
   incphp/locale/Copy of load.php
   incphp/locale/Copy of localedb.db
   incphp/locale/extract_locales.php
   incphp/locale/language_de.php
   incphp/locale/language_en.php
   incphp/locale/language_fr.php
   incphp/locale/language_it.php
   incphp/locale/language_nl.php
   incphp/locale/language_se.php
   incphp/locale/load.php
   incphp/locale/localedb.db
   incphp/locale/localedb.tmf
   incphp/map.php
   incphp/modules/
   incphp/modules/export/
   incphp/modules/export/exportquery.php
   incphp/modules/export/testresult.txt
   incphp/print/
   incphp/print/fonts/
   incphp/print/fonts/.noencode
   incphp/print/fonts/FreeSans.ctg.z
   incphp/print/fonts/FreeSans.z
   incphp/print/fonts/FreeSansBold.ctg.z
   incphp/print/fonts/FreeSansBold.z
   incphp/print/fonts/FreeSansBoldOblique.ctg.z
   incphp/print/fonts/FreeSansBoldOblique.z
   incphp/print/fonts/FreeSansOblique.ctg.z
   incphp/print/fonts/FreeSansOblique.z
   incphp/print/fonts/README.TXT
   incphp/print/fonts/freefont/
   incphp/print/fonts/freefont/AUTHORS
   incphp/print/fonts/freefont/CREDITS
   incphp/print/fonts/freefont/ChangeLog
   incphp/print/fonts/freefont/INSTALL
   incphp/print/fonts/freefont/README
   incphp/print/fonts/freesans.php
   incphp/print/fonts/freesansb.php
   incphp/print/fonts/freesansbi.php
   incphp/print/fonts/freesansi.php
   incphp/print/pdfprint.php
   incphp/print/print.php
   incphp/print/tcpdf.php
   incphp/query/
   incphp/query/json_query_doc.txt
   incphp/query/query.php
   incphp/query/squery.php
   incphp/util.php
   incphp/xajax/
   incphp/xajax/x_info.php
   incphp/xajax/x_layer_update.php
   incphp/xajax/x_load.php
   incphp/xajax/x_poi.php
   incphp/xajax/x_select.php
   incphp/xajax/x_toc.php
   incphp/xajax/x_toc_update.php
   index.html
   info.phtml
   javascript/
   javascript/common.js
   javascript/compress_js.php
   javascript/custom.js
   javascript/dragresize.js
   javascript/dtree.js
   javascript/geometry.js
   javascript/mapserver.js
   javascript/measure.js
   javascript/pmapper.js
   javascript/pmdraw.js
   javascript/pmjson.js
   javascript/sorttable.js
   javascript/toc.js
   javascript/wz_jsgraphics.js
   javascript/xmlhttp.js
   javascript/zoombox.js
   javascript/zslider.js
   map.phtml
   printdlg.phtml
   printmap.phtml
   templates/
   templates/default.css
   templates/dom.css
   templates/dtree.css
   templates/layout.css
   templates/print.css
   templates/query.css
   templates/query_classic.css
   templates/toc.css
   templates/zoombox.gif
   util/
   util/arcview3/
   util/arcview3/avpmapper.apr
   util/arcview3/avpmapper.avx
   util/arcview3/avpmapper.ini
   util/arcview3/license.txt
   util/arcview3/readme.txt
   util/group.php
   util/readsession.php_
   util/test_mapfile.phtml
Log:
Initial import

Added: README.txt
===================================================================
--- README.txt	2006-10-05 22:45:01 UTC (rev 0)
+++ README.txt	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,16 @@
+
+----------------------------------
+        p.mapper README
+----------------------------------
+
+See directory /doc for
+
+* quick install instructions (quick_install.txt)
+
+* documentation (manual.html)
+
+* acknowledgements (acknowledgements.txt)
+
+* license (license.txt)
+
+* change log (changelog_versions.txt)

Added: blank.html
===================================================================
--- blank.html	2006-10-05 22:45:01 UTC (rev 0)
+++ blank.html	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,8 @@
+<HTML>
+<HEAD>
+ <link rel="stylesheet" href="templates/default.css"><style type="text/css"></style>
+</HEAD>
+<BODY>
+</BODY>
+</HTML>
+

Added: config/config.ini
===================================================================
--- config/config.ini	2006-10-05 22:45:01 UTC (rev 0)
+++ config/config.ini	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,291 @@
+;*********************************************************************************
+; Copyright (c) 2003-2006 Armin Burger
+; 
+; Permission is hereby granted, free of charge, to any person obtaining 
+; a copy of this software and associated documentation files (the "Software"), 
+; to deal in the Software without restriction, including without limitation 
+; the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+; and/or sell copies of the Software, and to permit persons to whom the Software 
+; is furnished to do so, subject to the following conditions:
+; 
+; The above copyright notice and this permission notice shall be included 
+; in all copies or substantial portions of the Software.
+; 
+; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+; FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+; COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+; IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+;**********************************************************************************
+
+
+;************************************************;
+;  CONFIGURATION FILE FOR MAPSERVER APPLICATION  ;
+;  Is read by init.php and startup_config.php    ;
+;  Change according to application               ;
+;  Comments are semicolons ;                     ;
+;************************************************;
+
+
+[GENERAL]
+
+; p.mapper version
+pmapper = 2.1.2
+
+
+;====================================================
+; MapServer Version 
+; necessary only if extension dl() function is used
+; corresponding to naming of php_mapscript_xx.dll/.so
+; e.g. for php_mapscript_44.dll set
+; msVersion = 44
+; === MANDATORY ===
+;----------------------------------------------------
+;msVersion = 48
+msVersion = 4.10.0
+
+
+;=======================================
+; Configuration directory for
+; js_config.php & php_config.php
+; without slashes or backslashes
+; === OPTIONAL ===
+;---------------------------------------
+pm_config_location = default
+
+
+;=================================
+; WEB LOCATION for INCPHP dir
+; === OPTIONAL ===
+;---------------------------------
+;pm_incphp_location = ../../pmapper2lib/incphp
+
+
+;=================================
+; WEB LOCATION for JAVASCRIPT dir
+; === OPTIONAL ===
+;---------------------------------
+;pm_javascript_location = ../../pmapper2lib/javascript
+
+
+;==================================================================
+; MAP FILE
+; absolute path in file system or filename in 'pm_config_location'
+; Use slashes (/), no backslashes (\)
+; === MANDATORY ===
+;------------------------------------------------------------------
+;mapFile =  d:/webdoc/eclipse/pmapper2/config/default/pmapper_demo.map
+mapFile = pmapper_demo.map
+
+
+;=================================
+; DEFAULT LANGUAGE
+;---------------------------------
+pm_default_language = en
+
+
+
+;===============================
+; Character encoding settings 
+
+; Default character set
+; UTF-8
+;------------------------
+defCharset = UTF-8
+
+; if map file contains non-ASCII characters 
+; eg for layer DESCRIPTION or CLASS names, set value to 1
+;----------------------------------------------------------
+map2unicode = 1
+
+
+
+;==========================================================================
+;
+; LAYERS/GROUPS DEFINED MANUALLY
+;
+;==========================================================================
+
+; ALL groups displayed in TOC in this order
+; - without definition, the order from map file will be taken.
+; - separated with commas
+; === MANDATORY ===
+;-----------------------------------------------------------
+allGroups = countries, cities, corine, dem, rivers, jpl_wms_global_mosaic 
+
+; Default Groups (visible at start)
+; === RECOMMENDED ===
+;----------------------------------
+defGroups = countries, cities
+
+; Groups/Layers that shall be mutually disabled 
+; if one is clicked, the other ones will be disabled
+;-------------------------------------------------------------
+;mutualDisableList = dem, jpl_wms_global_mosaic, corine
+
+
+; Automatically refresh map when selection of 
+; layers/grouops has changed in TOC
+;--------------------------------------------
+layerAutoRefresh = 1
+
+
+
+;==========================================================================
+;                                   
+; SETTINGS FOR IDENTIFY/SEARCH/SELECT
+;
+;--------------------------------------------------------------------------
+
+; Limit for results of selection with select tool or search
+;----------------------------------------------------------
+limitResult = 300
+
+; Highlight color for identify/search zoom in
+; RGB values, separated with commas
+;---------------------------------------------
+highlightColor = 0, 255, 255
+
+; Defines if SELECT function causes feature highlight
+;-----------------------------------------------------
+highlightSelected = on
+
+; AUTOZOOM: zoom in automatically after results are displayed
+; possible values: off  search  nquery (= select)
+;-------------------------------------------------------------
+autoZoom = search nquery
+
+; Add button 'zoom to All Features' to result table
+; - possible values: off  search  nquery (= select)
+;---------------------------------------------------
+zoomAll = search  nquery
+
+
+; WINDOW DESIGN:
+; Query results (identify/search) in separate WINDOW or FRAME
+;-------------------------------------------------------------
+infoWin = window
+;infoWin = frame
+
+
+; Automatically align column contents of result tables of queries
+; with regard to data type (default, numeric, currency, etc)
+; algorithm in 'sorttable.js', function 'ts_alignCols(table)'
+;-----------------------------------------------------------------
+alignQueryResults = 1
+
+
+; Extent buffer for zoom extent for point layers in queries
+;-----------------------------------------------------------------
+pointBuffer = 10000
+
+
+;========================================================================
+; LEGEND: ICONS SIZE AND FORMAT, LEGEND STYLE
+;------------------------------------------------------------------------
+
+; Categories Style: 
+; - tree or flat
+;-----------------------------------------
+catStyle = tree
+;catStyle = flat
+
+; Group/Layer Style: 
+; - tree or flat
+;-----------------------------------------
+grpStyle = tree
+;grpStyle = flat
+
+; Legend Style: 
+; - attached: together with TOC
+; - swap: swapping with TOC
+; - popup: separate popup over map
+;-----------------------------------------
+legStyle = attached
+;legStyle = swap
+;legStyle = popup   ;;;; experimental ;;;;
+
+
+; Use categories to thematically group layers 
+; categories defined in incphp/custom.php
+; works for TOC setting 'flat' and 'tree'
+; 1 = yes,  0 = no
+;--------------------------------------------
+useCategories = 1
+
+
+; Layer list (TOC) automatically updated according to scale
+;-----------------------------------------------------------
+scaleLayers = 1
+
+; Icon Width in pixels
+;----------------------
+icoW = 18
+
+; Icon Height in pixels
+;-----------------------
+icoH = 14
+
+
+;====================================================================
+; IMAGE FORMATS
+; Image format for map and legend icons 
+; - possible values: png  jpeg  gif
+;--------------------------------------------------------------------
+;imgFormat = jpeg 
+imgFormat = png
+
+; alternative Image format for map 
+; useful eg. for imagery data
+; - possible values: png  jpeg  gif
+altImgFormat = jpeg
+
+; layer list (comma separated) that shall activate alternative
+; image format when one of these layers has status ON
+altImgFormatLayers = jpl_wms_global_mosaic, dem
+
+
+
+;=============================================================
+; DEFINE START AND END SCALE FOR ZOOM SLIDER
+; => Adapt to specific extents of the datasets
+; or use 'max' for automatically calculate from map file
+; -> in file 'map.phtml'
+;-------------------------------------------------------------
+;sliderMax = 40000000
+sliderMax = max
+sliderMin = 100000
+
+
+
+;=============================================================
+; TOOLBAR ORIENTATION
+; - vertical or horizontal (horizontal currently not working)
+;-------------------------------------------------------------
+toolBarOrientation = vertical
+;toolBarOrientation = horizontal
+
+
+;==============================================================
+; PDF PRINT RESOLUTION
+; - Factor to increase resolution for better image quality 
+;--------------------------------------------------------------
+pdfres = 2
+
+
+;==============================================================
+; DPI levels for map download
+; - used in downloaddlg.phtml
+;--------------------------------------------------------------
+dpiLevels = 150, 200, 300
+
+
+
+;==============================================================
+; Enable pan mode if right mouse button is pressed
+; independent of selected tool
+;--------------------------------------------------------------
+enableRightMousePan = 1
+
+

Added: config/default/js_config.php
===================================================================
--- config/default/js_config.php	2006-10-05 22:45:01 UTC (rev 0)
+++ config/default/js_config.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,61 @@
+<?php
+/****************************************************
+
+ JavaScript specific configuration settings
+
+*****************************************************/
+
+session_start();
+
+require_once($_SESSION['PM_INCPHP'] . "/common.php");
+$gLanguage = $_SESSION["gLanguage"];
+require_once($_SESSION['PM_INCPHP'] . "/locale/language_" . $gLanguage . ".php");
+
+?>
+
+
+//<script type="text/javascript">
+
+<?php 
+//include_once($_SESSION['PM_INCPHP'] . "/js_locales.php");
+?>
+
+
+/**
+ * Decide if SELECT/NQUERY includes also IQUERY (auto-identify)
+ */
+var combinedSelectIquery = true;
+
+
+
+/*************************************************************************************/
+
+
+// ARRAY FOR ATTRIBUTE SEARCH
+    // DEFINE SEARCH OPTIONS
+    // NOTE: the search always has to be performed on the LAYER, not the group (different to other query functions)
+    // * for TEXT field use # before field name
+    // * Field names must be in UPPER CASE for SHAPEFILES, LOWER CASE for PostGIS layers
+    // * for search with wildcards (explicetly set) use * before field name (for text fields after the #)
+    // * search without wildcards explicetly set, always uses search with wildcards before and after
+    //   search string => regex /searchstring/
+    // * in the hidden input define for 'VALUE' the layer name as it is in the map file and NAME="qlayer"
+    // 
+    // * you can specify more than one field for search by separating the search fields with a double ampersand &&
+    // SYNTAX of search array: 
+    // searchList['layer_name'] = new Array('Layer_description_for_select_box', '#FIELD_NAME', 'Field identifier as displayed in application', 
+    //                            'dbtable for PostGIS layers if layer.name != table.name, else keep empty');
+
+
+var searchList = new Object;
+//searchList['images'] = new Array('<?php echo _p("Images")?>', '#sat_id&&acq_year', '<?php echo _p("Satellite") ?>&&<?php echo _p("Acqusition Year") ?>','');
+searchList['countries'] = new Array('<?php echo _p("Country") ?>', '#NAME', '<?php echo _p("Country") ?>','');
+searchList['cities'] = new Array('<?php echo _p("City")?>', '#CITY_NAME', '<?php echo _p("City") ?>','');
+//searchList['cities_xylayer'] = new Array('<?php echo _p("City")?>', '#CITY_NAME', '<?php echo _p("City") ?>','');
+//searchList['settlements'] = new Array('<?php echo _p("Settlements")?>', '#stsinm', '<?php echo _p("Settlement") ?>','');
+
+
+
+
+
+//</script>
\ No newline at end of file

Added: config/default/php_config.php
===================================================================
--- config/default/php_config.php	2006-10-05 22:45:01 UTC (rev 0)
+++ config/default/php_config.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,76 @@
+<?php
+
+$gLanguage = $_SESSION["gLanguage"];
+
+//
+// TOOLBAR BUTTONS
+// * First array element: text for tool tip (=> img 'alt' or 'title')
+// * Tools/buttons that change status (zoom, pan, identify, select, measure):
+//     => have "0" as last array element
+//     => are using javascript function "domouseclick('zoom')
+// * Tools/buttons that keep status (zoomfullext, print, back):
+//     => have the name of the javascript function as last array element
+// * spaceX: space between buttons, space in pixels as argument
+//     => need to have unique names (e.g. space1, space2, space...)
+// * separatorX: separator (image) between buttons, argument will be ignored
+//     => need to have unique names (e.g. separator1, separator2, separator...)
+//
+
+$buttons = array (
+    "home"        => array(_p("Zoom To Full Extent"), "zoomfullext()"),
+    "back"        => array(_p("Back"), "goback()"),
+    "fwd"         => array(_p("Forward"), "gofwd()"),
+    "separator1"  => "15",
+    "zoomin"      => array(_p("Zoom in"), "0"),
+    "zoomout"     => array(_p("Zoom out"), "0"),
+    //"space2"   => "15",
+    "pan"         => array(_p("Pan"), "0"),
+    "separator2"  => "15",
+    "identify"    => array(_p("Identify"), "0"),
+    "select"      => array(_p("Select"), "0"),
+    "auto_identify"    => array(_p("Auto Identify"), "0"),
+    "separator3"  => "15",
+    "measure"     => array(_p("Measure"), "0"),
+    //"find"      => array(_p("Search"), "searchOpen()"),
+    "poi"         => array(_p("Add Point of Interest"), "0"),
+    "separator4"  => "15",
+    "reload"      => array(_p("Refresh Map"), "clearInfo()"),
+    //"resize"      => array(_p("Resize Map"), "resizeMap()"),
+    "print"       => array(_p("Print Map"), "openPrintDlg()"),
+    //"help"       => array($gString[18][$gLanguage], "openPrintDlg()")
+    "download"    => array(_p("Download"), "openDownloadDlg()")
+);
+
+
+$buttons2 = array (
+    "home"        => array(_p("Zoom To Full Extent"), "zoomfullext()"),
+    "back"        => array(_p("Back"), "goback()"),
+    "fwd"         => array(_p("Forward"), "gofwd()")
+);
+
+
+/**
+ * Definition of categories for legend/TOC
+ */
+$categories['cat_admin']  = array("countries", "cities", "settlements", "cities_xylayer");
+$categories['cat_nature'] = array("rivers", "corine");
+$categories['cat_raster'] = array("dem", "jpl_wms_global_mosaic", "wmstest");
+
+$_SESSION['categories'] = $categories;
+
+
+
+/**
+ * Title and Heading of application
+ */
+$pmTitle = _p("p.mapper $PM_VERSION: MapServer PHP/MapScript Demo Suite");
+
+$pmHeading = "<a href=\"http://mapserver.gis.umn.edu\" id=\"mshref_1\" title=\"UMN MapServer homepage\" onclick=\"this.target = '_new';\">MapServer</a>&nbsp; 
+              <a href=\"http://www.dmsolutions.ca\" id=\"dmsol_href\" title=\"DM Solutions homepage\" onclick=\"this.target = '_new';\">PHP/MapScript</a>&nbsp; 
+              Demo Suite 2.1";
+
+
+
+
+
+?>
\ No newline at end of file

Added: config/default/pmapper_demo.map
===================================================================
--- config/default/pmapper_demo.map	2006-10-05 22:45:01 UTC (rev 0)
+++ config/default/pmapper_demo.map	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,581 @@
+# Adapt settings in map file <tt>pmapper_demo.map</tt> for the following tags to match settings
+# on your machine (see additionally MapServer documentation for detailed information):
+
+ # MAP
+   # SHAPEPATH 
+   # FONTSET
+   # SYMBOLSET
+  
+ # WEB
+   # IMAGEPATH  
+   # IMAGEURL    
+
+
+#
+# Start of map file  
+#
+MAP
+EXTENT  1988372 1400000 6411627 5400000 
+ 
+UNITS meters
+#EXTENT -15 30 40 70
+#UNITS dd
+SIZE 900 900
+SHAPEPATH "../../../../demodata"
+#SYMBOLSET "../demodata/symbols/symbols35.sym"   
+#FONTSET "../../../data/fonts/msfontset.txt"
+RESOLUTION 96
+IMAGETYPE png
+INTERLACE OFF
+#CONFIG "PROJ_LIB" "C:/proj/nad/"
+PROJECTION
+  # ETRS-LAEA
+  # <3035> +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs  no_defs <>
+  "proj=laea"   
+  "lat_0=52.000000"
+  "lon_0=10.000000"
+  "x_0=4321000"
+  "y_0=3210000"
+  "ellps=GRS80"
+  "units=m"
+  "no_defs"
+END  
+
+
+
+OUTPUTFORMAT
+  NAME png
+  DRIVER "GD/PNG"
+  MIMETYPE "image/png"
+  IMAGEMODE RGB
+  FORMATOPTION  INTERLACE=OFF
+  TRANSPARENT OFF
+END
+
+OUTPUTFORMAT
+  NAME png8
+  DRIVER "GD/PNG"
+  MIMETYPE "image/png"
+  IMAGEMODE PC256
+  FORMATOPTION  INTERLACE=OFF
+  TRANSPARENT OFF
+END
+
+OUTPUTFORMAT
+  NAME GTiff
+  DRIVER "GDAL/GTiff"
+  MIMETYPE "image/tiff"
+  IMAGEMODE RGB
+  #FORMATOPTION "TFW=YES"
+  #FORMATOPTION "COMPRESS=PACKBITS"
+END
+
+OUTPUTFORMAT
+  NAME imagemap
+  MIMETYPE "text/html"
+  FORMATOPTION SKIPENDTAG=OFF
+  DRIVER imagemap
+END
+
+#
+# Start of web interface definition
+#
+WEB
+  TEMPLATE "map.html"
+  IMAGEPATH "d:\webdoc\tmp\"
+  IMAGEURL "/tmp/"
+  METADATA
+  END  # Metadata
+END  # Web
+
+#
+# Start of Reference map definition
+#
+REFERENCE
+  EXTENT 1496247 1332616 7055632 5502154 #2200000 1400000 8000000 5400000
+  IMAGE "../../images/reference.png"
+  SIZE 199 149
+  COLOR -1 -1 -1
+  OUTLINECOLOR 255 0 0
+END  # Reference
+
+LEGEND
+END
+
+#
+# Start of ScaleBar definition
+#
+SCALEBAR
+  STATUS embed
+  TRANSPARENT off
+  INTERVALS 4
+  SIZE 200 3
+  UNITS kilometers
+  COLOR 250 250 250
+  OUTLINECOLOR 0 0 0
+  BACKGROUNDCOLOR 100 100 100
+  STYLE 0
+  POSTLABELCACHE true
+  LABEL
+    COLOR 0 0 90
+    #OUTLINECOLOR 200 200 200
+    SIZE small
+  END  # Label
+END  # Reference
+
+
+
+# SYMBOLS USED IN PMAPPER
+# - 'circle' always necessary (used e.g. for highlight)
+# - 'square' used in currecnt map file
+# Symbols can also be defined via tag SYMBOLSET (see above)
+Symbol
+  Name 'circle'
+  Type ELLIPSE
+  Filled TRUE
+  Points
+    1 1
+  END
+END 
+
+Symbol
+  Name 'square'
+  Type VECTOR
+  Filled TRUE
+  Points
+    0 1
+    0 0
+    1 0
+    1 1
+    0 1
+  END
+END
+
+
+#================== START OF LAYER SECTION =====================#
+
+
+LAYER
+  NAME "jpl_wms_global_mosaic"
+  TYPE RASTER
+  STATUS OFF
+  CONNECTION "http://wms.jpl.nasa.gov/wms.cgi?"
+  CONNECTIONTYPE WMS
+  PROJECTION
+    "init=epsg:4326"
+  END
+  METADATA
+    "DESCRIPTION"         "JPL Global Mosaic (WMS)"
+    "wms_name"            "global_mosaic_base"
+    "wms_style"           "visual"
+    "wms_server_version"  "1.1.1"
+    "wms_format"          "image/jpeg"
+  END
+END
+
+
+#
+# LAYER DGM
+#
+LAYER
+  NAME "dem"
+  TYPE Raster
+  STATUS OFF
+  DATA 'europa_dem.jpg'
+  MINSCALE 3000000
+  PROJECTION
+    "init=epsg:4326"
+  END
+  METADATA
+    "DESCRIPTION"   "NGDC Shaded  relief"
+    "LEGENDICON"    "images/legend/dem.png"
+  END
+END
+
+
+#
+# LAYER CORINE LANDCOVER
+# can be downloaded at: 
+# http://dataservice.eea.eu.int/dataservice/metadetails.asp?id=188&i=1
+#
+LAYER  # corine100
+  NAME "corine1" 
+  GROUP "corine" 
+  TYPE Raster
+  STATUS ON
+  DATA 'D:\home\gis\data\images\corine\lceugr100.tif'
+  TOLERANCE 0
+  TOLERANCEUNITS pixels
+  MAXSCALE 8000000
+  #CLASSITEM "[pixel]"
+  PROJECTION
+      "proj=laea"   
+      "lat_0=52.000000"
+      "lon_0=10.000000"
+      "x_0=4321000"
+      "y_0=3210000"
+      "ellps=GRS80"
+      "units=m"
+      "no_defs"
+  END
+  METADATA
+    "DESCRIPTION"   "Corine Landcover"
+    "RESULT_FIELDS" "class, value_0"
+    "RESULT_HEADERS" "CLASS, VALUE"
+    "RESULT_HYPERLINK" "class"
+  END
+  CLASS
+    EXPRESSION ([pixel] <= 11)
+    NAME 'Urban and industrial fabric'
+    COLOR 230 0 30
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 12)
+    NAME 'Non-irrigated arable land'
+    COLOR 255 255 166
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 13)
+    NAME 'Permanently irrigated land'
+    COLOR 255 255 0
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 14)
+    NAME 'Rice fields'
+    COLOR 230 230 0
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 15)
+    NAME 'Vineyards'
+    COLOR 230 128 0
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 16)
+    NAME 'Fruit trees and berry plantations'
+    COLOR 242 166 77
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 17)
+    NAME 'Olive groves'
+    COLOR 230 166 0
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 18)
+    NAME 'Pastures'
+    COLOR 230 230 77
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 19)
+    NAME 'Annual crops associated with permanent crops'
+    COLOR 255 230 166
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 20)
+    NAME 'Complex cultivation patterns'
+    COLOR 255 230 77
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 21)
+    NAME 'Agriculture, with natural vegetation'
+    COLOR 230 204 77
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 22)
+    NAME 'Agro-forestry areas'
+    COLOR 242 204 166
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 23)
+    NAME 'Broad-leaved forest'
+    COLOR 128 255 0
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 24)
+    NAME 'Coniferous forest'
+    COLOR 0 166 0
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 25)
+    NAME 'Mixed forest'
+    COLOR 77 255 0
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 26)
+    NAME 'Natural grassland'
+    COLOR 204 242 77
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 27)
+    NAME 'Moors and heathland'
+    COLOR 166 255 128
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 28)
+    NAME 'Sclerophyllous vegetation'
+    COLOR 166 230 77
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 29)
+    NAME 'Transitional woodland-shrub'
+    COLOR 166 242 0
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 30)
+    NAME 'Beaches, dunes, and sand plains'
+    COLOR 230 230 230
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 31)
+    NAME 'Bare rock'
+    COLOR 204 204 204
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 32)
+    NAME 'Sparsely vegetated areas'
+    COLOR 204 255 204
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 33)
+    NAME 'Burnt areas'
+    COLOR 0 0 0
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 34)
+    NAME 'Glaciers and perpetual snow'
+    COLOR 166 230 204
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 35)
+    NAME 'Inland marshes'
+    COLOR 166 166 255
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 36)
+    NAME 'Peatbogs'
+    COLOR 160 120 230 #77 77 255
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 37)
+    NAME 'Salt-marshes'
+    COLOR 204 204 255
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 38)
+    NAME 'Salines'
+    COLOR 230 230 255
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 39)
+    NAME 'Intertidal flats'
+    COLOR 166 166 230
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 40 or [pixel] = 41)
+    NAME 'Water bodies'
+    COLOR 0 204 242
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 42)
+    NAME 'Coastal lagoons'
+    COLOR 0 255 166
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 43)
+    NAME 'Estuaries'
+    COLOR 166 255 230
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 44)
+    NAME 'Sea and ocean'
+    COLOR 230 242 255
+    TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 49)
+    NAME 'No Data'
+    COLOR 220 220 220
+      TEMPLATE "void"
+  END # Class
+  CLASS
+    EXPRESSION ([pixel] = 50)
+    NAME 'Sea and ocean'
+    COLOR 80 140 210 #60 120 200
+    TEMPLATE "void"
+  END # Class
+
+END
+ 
+ 
+#
+# Start of Layer Countries.shp
+#
+LAYER
+  NAME "countries"
+  TYPE polygon
+  DATA "countries"
+  TRANSPARENCY 30
+  PROJECTION
+    "init=epsg:4326"
+  END
+  METADATA 
+    "DESCRIPTION" "Countries"
+    "RESULT_FIELDS" "NAME,AREA"
+    "RESULT_HEADERS" "Name,Area"
+  END  # Metadata 
+  CLASS
+    Name 'Countries'
+    COLOR 200 254 199
+    OUTLINECOLOR 0 0 0
+    TEMPLATE void
+  END  # Class
+END  # Layer
+
+
+
+#
+# Start of Layer Cities.shp
+#
+LAYER
+  NAME "cities" 
+  TYPE point
+  DATA "cities"
+  TOLERANCE 10
+  TOLERANCEUNITS pixels
+  LABELITEM "CITY_NAME"
+  LABELMAXSCALE 15000000
+  PROJECTION
+    "init=epsg:4326"
+  END
+  METADATA 
+    "DESCRIPTION" "Cities"
+    "RESULT_FIELDS" "CITY_NAME,ADMIN_NAME,CNTRY_NAME,STATUS,POP_CLASS"
+    "RESULT_HEADERS" "Name,Administrative Entity,Country,Status,Inhabitants"
+    "RESULT_HYPERLINK" "CITY_NAME, CNTRY_NAME||Link on detail"
+    #"LAYER_ENCODING" "UTF-8"
+  END  # Metadata  
+  
+  CLASS
+    NAME "> 5'000'000"
+    EXPRESSION ([POP_RANK] = 1)
+    COLOR 255 0 0 
+    SYMBOL 'square' 
+    SIZE 9
+    LABEL
+      POSITION Auto
+      COLOR 0 0 150 
+      BACKGROUNDCOLOR 255 255 128
+      BACKGROUNDSHADOWCOLOR 150 150 150
+      BACKGROUNDSHADOWSIZE 2 2
+      BUFFER 2
+      #TYPE truetype
+      #FONT verdana
+      #SIZE 8
+      #MAXSIZE 9
+      SIZE small
+    END #Label  
+
+    TEMPLATE void
+  END  # Class
+  CLASS
+    NAME "1'000'000 - 5'000'000"
+    EXPRESSION ([POP_RANK] = 2)
+    COLOR 255 0 0
+    SYMBOL 'square' 
+    SIZE 7
+    LABEL
+      POSITION Auto
+      COLOR 0 0 150 
+      BACKGROUNDCOLOR 255 255 128
+      BACKGROUNDSHADOWCOLOR 150 150 150
+      BACKGROUNDSHADOWSIZE 2 2
+      BUFFER 2
+      #TYPE truetype
+      #FONT verdana
+      #SIZE 8
+      #MAXSIZE 9
+      SIZE small
+    END #Label  
+    TEMPLATE void
+  END  # Class
+  CLASS
+    NAME "500'000 - 1'000'000"
+    EXPRESSION ([POP_RANK] = 3)
+    COLOR 255 0 0
+    SYMBOL 'circle' 
+    SIZE 6
+    TEMPLATE void
+  END  # Class
+  CLASS
+    NAME "< 500'000 Inhabitants"
+    EXPRESSION ([POP_RANK] = 4)
+    COLOR 0 0 0
+    SYMBOL 'circle' 
+    SIZE 5
+    TEMPLATE void
+  END  # Class
+
+END  # Layer
+
+
+#
+# Start of Layer Rivers.shp
+#
+LAYER
+  NAME "rivers"
+  TYPE line
+  DATA "rivers"
+  TOLERANCE 3
+  TOLERANCEUNITS pixels
+  PROJECTION
+    "init=epsg:4326"
+  END
+  METADATA 
+    "DESCRIPTION" "Rivers"
+    "RESULT_FIELDS" "NAME,LENGTH"
+    "RESULT_HEADERS" "Name,Length"
+  END  # Metadata 
+  CLASS
+    Name 'Rivers'
+    COLOR 0 0 255
+    TEMPLATE void
+  END  # Class
+END  # Layer
+
+
+
+
+
+
+END  #Map

Added: config/startup_config.php
===================================================================
--- config/startup_config.php	2006-10-05 22:45:01 UTC (rev 0)
+++ config/startup_config.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,179 @@
+<?php
+
+/*********************************************************************************
+ Copyright (c) 2003-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+
+/************************************************************************
+ * Initializes basic configuration settings and writes 
+   settings to PHP session.
+   
+   !!!THIS FILE IS NOT A CONFIG FILE FOR CUSTOMIZATION!!!
+   !!!DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING!!!
+   
+ ************************************************************************/
+
+/**
+ * Config settings
+ */
+
+// Check if config is set via URL
+if (isset($_GET['config'])) {
+    $config = trim($_GET['config']);
+} elseif (isset($_SESSION['config'])) {
+    $config = $_SESSION['config'];
+} else {
+    $config = "";
+}
+
+$PM_BASECONFIG_DIR = str_replace('\\', '/', dirname(__FILE__));
+$PM_INI_FILE = $PM_BASECONFIG_DIR . "/" . (strlen($config) > 0 ? "config_$config.ini" : "config.ini");
+$ini = parse_ini_file($PM_INI_FILE); 
+
+if (isset($ini['pm_config_location'])) {
+    $PM_CONFIG_LOCATION  = $ini['pm_config_location'];
+} else {
+    $PM_CONFIG_LOCATION  = "default";
+}
+
+$PM_CONFIG_DIR = str_replace('\\', '/', realpath($PM_BASECONFIG_DIR . "/" . $PM_CONFIG_LOCATION));
+$PM_JS_CONFIG  = $PM_CONFIG_LOCATION . "/" . "js_config.php";
+$PM_PHP_CONFIG = $PM_CONFIG_LOCATION . "/" . "php_config.php";
+
+
+
+/**
+ * Map file
+ */
+$mapFileIni = trim($ini["mapFile"]);
+// try as absolute path
+if ($mapFileIni{0} == "/" || $mapFileIni{1} == ":") {
+    $PM_MAP_FILE = str_replace('\\', '/', $mapFileIni);
+// else as relative to $PM_CONFIG_DIR
+} else {
+    $PM_MAP_FILE = str_replace('\\', '/', realpath($PM_CONFIG_DIR . "/" . $mapFileIni));  
+}
+
+if (!file_exists($PM_MAP_FILE)) {
+    error_log ("P.MAPPER-ERROR: Cannot find map file '$mapFileIni'. Check 'config.ini' file at section 'mapFile'.", 0);
+    exit();
+}
+
+
+/**
+ * Set character set for correct display of special characters
+ */
+if (isset($ini['defCharset'])) {
+    $defCharset = $ini['defCharset'];
+} else {
+    $defCharset = "UTF-8";
+}
+
+
+/**
+ * WEB location INCPHP 
+ */
+if (isset($ini['pm_incphp_location'])) {
+    $PM_INCPHP_LOCATION  = trim($ini['pm_incphp_location']);
+    $PM_INCPHP = str_replace('\\', '/', realpath(dirname(__FILE__) . "/../" . $PM_INCPHP_LOCATION));
+    if (!$PM_INCPHP) {
+        error_log("P.MAPPER-ERROR: location '$PM_INCPHP_LOCATION' not existing. Check config at section 'pm_incphp_location'");
+        exit();
+    }
+} else {
+    $PM_INCPHP_LOCATION = "incphp";
+    $PM_INCPHP = str_replace('\\', '/', realpath(dirname(__FILE__) . "/../incphp"));
+} 
+
+
+/**
+ * Directory location XAJAX 
+ */
+$PM_XAJAX_LOCATION = $PM_INCPHP_LOCATION . "/xajax/";
+
+
+
+/**
+ * Directory JAVASCRIPT 
+ */
+if (isset($ini['pm_javascript_location'])) {
+    $PM_JAVASCRIPT  = trim($ini['pm_javascript_location']);
+} else {
+    $PM_JAVASCRIPT = "javascript";
+}
+
+if (!realpath(dirname(__FILE__) . "/../" . $PM_JAVASCRIPT)) {
+    error_log("P.MAPPER-ERROR: location '$PM_JAVASCRIPT' not existing. Check config at section 'pm_javascript'");
+    exit();
+} else {
+    $PM_JAVASCRIPT_REALPATH = realpath(dirname(__FILE__) . "/../" . $PM_JAVASCRIPT);
+}
+
+
+/**
+ * MapServer version 
+ */
+if (isset($ini["msVersion"])) {
+    $msVersion = $ini["msVersion"];
+} else {
+    error_log("P.MAPPER-ERROR: Missing entry for MapServer version. Check config at section 'msVersion'");
+    exit();
+}
+
+
+
+
+/**
+ * Application language
+ */
+if (isset($_GET['language'])) {
+    $gLanguage = trim($_GET['language']);
+} elseif (isset($_SESSION['language'])) {
+    $gLanguage = trim($_SESSION['language']);
+} elseif (isset($ini['pm_default_language'])) {
+    $gLanguage = trim($ini['pm_default_language']);
+} elseif (isset($_ENV['PM_DEFAULT_LANGUAGE'])) {
+    $gLanguage = trim($_ENV['PM_DEFAULT_LANGUAGE']);
+} else {
+    $gLanguage = "en";   // default language
+}
+
+
+
+/**
+ * Write vars to session
+ */
+$_SESSION['PM_BASECONFIG_DIR']  = $PM_BASECONFIG_DIR;
+$_SESSION['PM_CONFIG_LOCATION'] = $PM_CONFIG_LOCATION;
+$_SESSION['PM_CONFIG_DIR']      = $PM_CONFIG_DIR;
+$_SESSION['PM_INCPHP']          = $PM_INCPHP;
+$_SESSION['PM_INCPHP_LOCATION'] = $PM_INCPHP_LOCATION;
+$_SESSION['PM_JAVASCRIPT']      = $PM_JAVASCRIPT;
+$_SESSION['PM_MAP_FILE']        = $PM_MAP_FILE;
+
+$_SESSION['gLanguage']  = $gLanguage;
+$_SESSION['defCharset'] = $defCharset;
+$_SESSION['msVersion']  = $msVersion;
+
+$_SESSION['session_alive'] = 1;
+
+
+?>
\ No newline at end of file

Added: doc/acknowledgements.txt
===================================================================
--- doc/acknowledgements.txt	2006-10-05 22:45:01 UTC (rev 0)
+++ doc/acknowledgements.txt	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,23 @@
+
+======================
+   ACKNOWLEDGEMENTS
+======================  
+
+I would like to thank all who provided contributions 
+to the p.mapper development:
+
+
+Federico Nieri and Alessandro Radaelli from Comune di Prato:
+-------------------------------------------------------------
+Contributions in quite a few files (Javascript and PHP) in order 
+to make p.mapper 2 compliant with W3C XHTML standards.
+Re-structured measure functions, including geometry.js libary.
+
+
+Luca Marletta from beOpen.it
+-----------------------------
+For regularly testing of development versions and reporting bugs.
+
+
+
+Armin
\ No newline at end of file

Added: doc/changelog_versions.txt
===================================================================
--- doc/changelog_versions.txt	2006-10-05 22:45:01 UTC (rev 0)
+++ doc/changelog_versions.txt	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,110 @@
+
+====================================
+ p.mapper 2.1.2  October 20, 2006
+====================================
+* only bug fix release
+  fixes bugs in startup_config.php (map file reference)
+  and squery.php (Postgis attribute search)
+  substituting these 2 files is sufficient to upgrade
+  existing installations
+  
+  
+====================================
+ p.mapper 2.1.1  September 09, 2006
+====================================
+* only bug fix release
+  fixes bugs for: select, sorttables, coordinate display,
+  POI and non-ascii characters 
+
+
+====================================
+ p.mapper 2.1.0  August 24, 2006
+====================================
+* new structured configuration settings 
+* re-designed PHP and Javascript structure: flexible 
+  placement of PHP/JS libs (also outside of application tree)
+* re-structured measure functions using geometry.js libary 
+  - Provided by Federico Nieri 
+* new auto-identify function, inspired by Natalia Zoppardo's
+  development for Faunalia
+  available as separate function or with select
+* various smaller bug fixes:
+  layer selection after reload; mouse wheel zoom; IE map resize
+* improved error logging 
+
+
+
+====================================
+ p.mapper 2.0.0  [July 23, 2006]
+====================================
+* fully compliant with W3C XHTML 1.0 Strict
+  (thanks to Federico Nieri and Alessandro Radaelli)
+* new, more flexible definition of query results
+  based on JSON encoding (www.json.org) 
+* bug fixes: 
+  slider positioning; IE resizing, XY layers; 
+  certain grouping combinations and query; 
+  special characters and query; etc.
+* PDF printing supports Unicode characters
+  (using TCPDF instead of basic FPDF)
+* definition of initial map extent
+* custom function for tmp image creation in order
+  to deal with PHP/MapScript bug
+* reference image definition taken from map file
+
+
+
+====================================
+ p.mapper 1.9.5  [February 23, 2006]
+====================================
+* IMPORTANT: moved to Unicode (UTF-8) character encoding
+  see dcumenation for details ("Multilingual User Interface")
+* new styles for legend and TOC;
+  not using any more dtree.js for TOC/legend
+* bug fixes
+* renamed function '_()' to '_p()' to avoid 
+  conflicts with existing PHP getext installations
+* possibility to define an alternative image format
+  and layers that cause to switch to this format
+  if set active (status ON) 
+* new digitize function to add labeled points to map  
+  
+
+
+===================================
+ p.mapper 1.9.4  [October 10, 2005]
+===================================
+* fixed some bugs (measure function, reference map,
+  attribute search on PostGIS layers)
+* using newer dtree.js instead of tree.js
+  for tree-like TOC/legend
+* added hyperlinking possibility to current map
+* re-strucured code for initialization
+
+
+
+==================================
+ p.mapper 1.9.3  [August 20, 2005]
+==================================
+* using now XMLHTTP requests to call PHP/Mapscript
+  from JavaScript instead of using hidden IFRAMEs
+* modified display of layers for toc_tree
+* result tables for queries with column sort and 
+  align function 
+
+
+==================================
+ p.mapper 1.9.2  [June 19, 2005]
+==================================
+* Bug fixes for attribute search of PostGIS layers
+* Zoom in/out with mouse wheel (IE only)
+
+
+===================================
+ p.mapper 1.9.1  [June 06, 2005]
+===================================
+* completely new layout:
+  using DIV's instead of frames
+* new navigation/zoom functions with keyboard
+* new layer/legend display mode 'combi'
+* new definition of attribute search

Added: doc/img/frameset.gif
===================================================================
(Binary files differ)


Property changes on: doc/img/frameset.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: doc/img/logo.gif
===================================================================
(Binary files differ)


Property changes on: doc/img/logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: doc/license.txt
===================================================================
--- doc/license.txt	2006-10-05 22:45:01 UTC (rev 0)
+++ doc/license.txt	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,294 @@
+-----------------
+    p.mapper
+-----------------
+Copyright (c) 2002-2006 Armin Burger
+
+Permission is hereby granted, free of charge, to any person obtaining 
+a copy of this software and associated documentation files (the "Software"), 
+to deal in the Software without restriction, including without limitation 
+the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+and/or sell copies of the Software, and to permit persons to whom the Software 
+is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included 
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+
+**********************************************************************************
+
+
+=========
+ CREDITS
+=========
+p.mapper application is based on several OpenSource projects with their own
+license types. All projects and products that p.mapper is based on or uses
+code snippets from or that gave ideas for the development are listed below,
+together with their licenses:
+
+
+
+
+-----------
+ MAPSERVER
+-----------
+Copyright (c) 1996-2001 Regents of the University of Minnesota.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies of this Software or works derived from this Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+------------------------------------------
+ PHP/MapScript extension for MapServer
+ GMAP75 (included in ROSA application) 
+------------------------------------------
+**********************************************************************
+ * Copyright (c) 2000-2002, DM Solutions Group
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ * DEALINGS IN THE SOFTWARE.
+ ********************************************************************** 
+
+
+
+
+----------
+ JTREE.JS
+----------
+Copyright (c) 2001 Geir Landrö (drop at destroydrop.com)
+JavaScript Tree - www.destroydrop.com/hugi/javascript/tree/
+Version 0.96	
+
+This script can be used freely as long as all copyright messages are
+intact.
+
+
+
+----------
+ PHP PEAR
+----------
++----------------------------------------------------------------------+
+| Copyright (c) 1997-2002 The PHP Group                                |
++----------------------------------------------------------------------+
+| This source file is subject to version 2.0 of the PHP license,       |
+| that is bundled with this package in the file LICENSE, and is        |
+| available at through the world-wide-web at                           |
+| http://www.php.net/license/2_02.txt.                                 |
+| If you did not receive a copy of the PHP license and are unable to   |
+| obtain it through the world-wide-web, please send a note to          |
+| license at php.net so we can mail you a copy immediately.               |
++----------------------------------------------------------------------+
+| Authors: Sterling Hughes <sterling at php.net>                          |
+|          Stig Bakken <ssb at fast.no>                                   |
+|          Tomas V.V.Cox <cox at idecnet.com>                             |
++----------------------------------------------------------------------+
+
+
+
+-----------
+ SLIDER.JS
+----------- 
+/************************************************************
+                    Slider control creator
+              By Mark Wilton-Jones 12-13/10/2002
+Version 1.1 updated 22/10/2003 to provide hand cursor option
+*************************************************************
+
+Please see http://www.howtocreate.co.uk/jslibs/ for details and a demo of this script
+Please see http://www.howtocreate.co.uk/jslibs/termsOfUse.html for terms of use
+
+
+
+-------------------
+ WZ_JSGRAPHICS.JS
+-------------------
+/* This notice must be untouched at all times.
+
+wz_jsgraphics.js    v. 2.3
+The latest version is available at
+http://www.walterzorn.com
+or http://www.devira.com
+or http://www.walterzorn.de
+
+Copyright (c) 2002-2004 Walter Zorn. All rights reserved.
+Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com )
+Last modified: 29. 9. 2004
+
+Performance optimizations for Internet Explorer
+by Thomas Frank and John Holdsworth.
+fillPolygon method implemented by Matthieu Haller.
+
+High Performance JavaScript Graphics Library.
+Provides methods
+- to draw lines, rectangles, ellipses, polygons
+  with specifiable line thickness,
+- to fill rectangles and ellipses
+- to draw text.
+NOTE: Operations, functions and branching have rather been optimized
+to efficiency and speed than to shortness of source code.
+
+LICENSE: LGPL
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License (LGPL) 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,
+or see http://www.gnu.org/copyleft/lesser.html 
+*/
+
+
+
+-----------
+  ka-Map
+-----------  
+
+ **********************************************************************
+ * Copyright (c) 2005, DM Solutions Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ * DEALINGS IN THE SOFTWARE.
+ ********************************************************************** 
+
+
+
+----------
+ XMLHTTP
+----------
+EXAMPLES FOR XMLHTTP TAKEN FROM DREW MCLELLAN ON
+ http://www.xml.com/pub/a/2005/02/09/xml-http-request.html
+ 
+ 
+ 
+----------------
+ SORTTABLE.JS
+--------------- 
+ Code downloaded from the Browser Experiments section of 
+ kryogenix.org is licenced under the so-called MIT licence. 
+ The licence is below.
+
+ Copyright (c) 1997-date Stuart Langridge
+
+ Permission is hereby granted, free of charge, to any person 
+ obtaining a copy of this software and associated documentation 
+ files (the "Software"), to deal in the Software without 
+ restriction, including without limitation the rights to use, 
+ copy, modify, merge, publish, distribute, sublicense, and/or 
+ sell copies of the Software, and to permit persons to whom the 
+ Software is furnished to do so, subject to the following conditions:
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ DEALINGS IN THE SOFTWARE.
+
+
+
+---------
+ TCPDF
+---------
+============================================================+
+ File name   : tcpdf.php
+ Begin       : 2002-08-03
+ Last Update : 2006-07-16
+ Author      : Nicola Asuni
+ Version     : 1.53.0.TC022_PHP4
+ License     : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
+
+ Description : This is a PHP4 class for generating PDF files 
+               on-the-fly without requiring external 
+               extensions.
+
+ IMPORTANT:
+ This class is an extension and improvement of the public Domain 
+ FPDF class by Olivier Plathey (http://www.fpdf.org).
+
+ Main changes by Nicola Asuni:
+    PHP4 porting;
+    UTF-8 Unicode support;
+    code refactoring;
+    source code clean up;
+    code style and formatting;
+    source code documentation using phpDocumentor (www.phpdoc.org);
+    All ISO page formats were included;
+    image scale factor;
+    includes methods to parse and printsome XHTML code, supporting the following elements: h1, h2, h3, h4, h5, h6, b, u, i, a, img, p, br, strong, em, font, blockquote, li, ul, ol, hr, td, th, tr, table, sup, sub, small;
+    includes a method to print various barcode formats using an improved version of "Generic Barcode Render Class" by Karim Mribti (http://www.mribti.com/barcode/) (require GD library: http://www.boutell.com/gd/);
+    defines standard Header() and Footer() methods.
+============================================================+
+
+
+--------------
+ Prototype
+--------------
+/*  Prototype JavaScript framework, version 1.4.0
+ *  (c) 2005 Sam Stephenson <sam at conio.net>
+ *
+ *  Prototype is freely distributable under the terms of an MIT-style license.
+ *  For details, see the Prototype web site: http://prototype.conio.net/
+/*--------------------------------------------------------------------------*/

Added: doc/manual.html
===================================================================
--- doc/manual.html	2006-10-05 22:45:01 UTC (rev 0)
+++ doc/manual.html	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,20 @@
+<html>
+<head>
+<title>p.mapper Documentation</title>
+<style type="text/css">
+<!--
+H1,H2,H3,H4 {font-family: VERDANA,ARIAL,HELVETICA;}
+body {font-family: ARIAL,HELVETICA;}
+-->
+</style>
+</head>
+<body>
+
+<img src="img/logo.gif" border="0" alt="">
+<h2>p.mapper Documentation</h2>
+
+
+<h3>See the <a href="http://www.pmapper.net/wiki">p.mapper Wiki</a> for the latest documentation</h3>
+
+</body>
+</html>
\ No newline at end of file

Added: doc/quick_install.txt
===================================================================
--- doc/quick_install.txt	2006-10-05 22:45:01 UTC (rev 0)
+++ doc/quick_install.txt	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,98 @@
+''''''''''''''''''''''''''''''''''''''''''''
+ QUICK INSTALL INSTRUCTIONS FOR P.MAPPER 2
+''''''''''''''''''''''''''''''''''''''''''''
+
+###########################################
+#                                         #
+#   An updated version is available at    #
+#                                         #
+#   http://www.pmapper.net/wiki           #
+#                                         #
+###########################################
+
+
+============== 
+ PHP Settings
+==============
+PHP/MapScript Library and WebServer
+Install the PHP/MapScript library in the appropriate place and configure your 
+webserver to parse *.php and *.phtml files with PHP. Name the PHP/Mapscript
+extension accoring to the mapserver version, like php_mapscript_48.so or
+(php_mapscript_48.dll on Windows) for MapServer 4.8
+
+See the documentation for PHP/MapScript and MapServer Wiki for details.
+
+LIBICONV: PHP needs to be compiled with support of the ICONV library. 
+          This should be the default on Windows and Unix versions of PHP
+
+PHP.INI
+-------
+In section [PHP] under the paragraph Paths and Directories set:
+  enable_dl = On 
+alternatively: load the extension via the php.ini 
+               (required on Windows for IIS or Apache and PHP as module)
+
+The application uses PHP sessions to store user settings during the session. 
+Modify the php.ini file to the following settings below section [Session]:
+  session.save_path = ... : Set a valid path
+  session.use_trans_sid = 0 : set to 0 in order to be compliant with W3C XHTML Strict 
+  session.auto_start = 0 
+  
+  
+======================
+ Application settings
+======================
+config/config.ini 
+The main configuration for p.mapper is set under the subdirectory config 
+in the file config.ini. Adapt following settings to your environment:
+
+  msVersion: e.g. for php_mapscript_48.dll set to 48
+
+  mapFile: Map file location (absolute path, no backslash)
+  
+  allGroups: a comma-separated list of layers/groups available in the application
+             general rule: if a layer belongs to a group, use the group name, 
+                           otherwise use the layer name        
+  
+  
+===================
+ Other settings
+===================
+Directory '/images/legend/'
+Has to be writeable for the user that runs the web server 
+(used for automatic update of legend icons). 
+
+On a Debian system for example, this could be achieved with the command
+># chown -R www-data /var/www/pmapper_demo/images/legend/ 
+
+On Windows and IIS set the directory security properties to 'Modify' 
+for user IUSR_hostname
+
+
+
+
+============
+ Demo data
+============
+You can download the demo dataset (demodata.zip) and test p.mapper with the 
+supplied map file pmapper_demo.map. 
+
+in  pmapper_demo.map adapt settings for
+  MAP
+    SHAPEPATH 
+    (FONTSET) 
+    (SYMBOLSET)
+ 
+  WEB
+    IMAGEPATH 
+    IMAGEURL 
+    
+  
+================
+ Start p.mapper  
+================
+Starting p.mapper can be done via the map.phtml file or a link from index.html.
+
+
+
+

Added: download.phtml
===================================================================
--- download.phtml	2006-10-05 22:45:01 UTC (rev 0)
+++ download.phtml	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,86 @@
+<?php
+require_once("config/startup_config.php");
+require_once("$PM_INCPHP/group.php");
+session_start();
+require_once("$PM_INCPHP/globals.php");
+require_once("$PM_INCPHP/common.php");
+require_once("$PM_INCPHP/map.php");
+require_once("$PM_INCPHP/print/print.php");
+
+
+// GET NEW DPI FOR OUT IMG
+if (isset ($_POST["dldpi"])) {
+   $imgDPI = $_POST["dldpi"];
+} else {
+   $imgDPI = 300; 
+}
+
+if (isset ($_POST["imgFormat"])) {
+    $imgFormat = $_POST["imgFormat"];
+} else {
+    $imgFormat = false;
+}
+
+// CALCULATE NEW MAP SIZES
+$mapfileDPI = $map->resolution;
+$mapW = $_SESSION["mapwidth"];
+$mapH = $_SESSION["mapheight"];
+
+$dpiFactor = $imgDPI/$mapfileDPI;
+$newMapW = round($mapW * $dpiFactor);
+$newMapH = round($mapH * $dpiFactor);
+
+
+// APPLY TO MAP
+$map->set("width", $newMapW);
+$map->set("height", $newMapH);
+$map->set("resolution", $imgDPI);
+
+$scale = round($_SESSION["geo_scale"]);
+
+
+// APPLY ON VISIBLE GROUPS/LAYERS
+$groups = $_SESSION["groups"];
+// call function
+setGroups($map, $groups, 0, 1);
+
+/*   
+// Show also feature highlight
+// ADD RESULTLAYERS
+if (isset($_SESSION["resultlayers"])) {
+    $resultlayers = $_SESSION["resultlayers"];
+    foreach ($resultlayers as $reslayer => $shpindexes) {
+        addResultLayer($map, $reslayer, $shpindexes);
+    }
+} 
+*/
+
+
+// GET MAP IMAGE URL
+$printMap = new PrintMap($map, $newMapW, $newMapH, $scale, "dl", $imgDPI, $imgFormat);
+$printUrlList = $printMap->returnImgUrlList(); 
+$printmapUrl = $printUrlList[0];
+
+
+if ($imgFormat):
+    header('Content-type: image/tiff');
+    header('Content-Disposition: attachment; filename="mapdownload.tif"');
+    readfile($printmapUrl);
+
+else:  
+    $printlegUrl = $printUrlList[1];
+    ?>
+    <HTML>
+    <HEAD>
+    <TITLE>Download</TITLE>
+    </HEAD>
+    <BODY>
+     <?php echo ("<img src='$printmapUrl' border=0> $basePath <br><br> <!-- <img src='$printlegUrl' border=0> $basePath -->") ?>
+    </BODY>
+    </HTML>
+
+<?php
+ endif;
+?> 
+
+

Added: downloaddlg.phtml
===================================================================
--- downloaddlg.phtml	2006-10-05 22:45:01 UTC (rev 0)
+++ downloaddlg.phtml	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,57 @@
+<?php
+session_start();
+
+require_once($_SESSION['PM_INCPHP'] . "/common.php");
+require_once($_SESSION['PM_INCPHP'] . "/globals.php");
+
+header("Content-type: text/html; charset=$defCharset");
+
+if (isset($_SESSION['dpiLevels'])) {
+    $dpiList = preg_split('/[\s,]+/', $_SESSION['dpiLevels']);
+} else {
+    $dpiList = array(100, 200, 300);
+}
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo $gLanguage ?>" xml:lang="<?php echo $gLanguage ?>">
+
+<head>
+ <script type="text/javascript">
+    function initPage() {
+        document.getElementById('dlform').target = 'dlwin';
+        window.focus();
+    }
+ </script>
+ <title>Download</title>
+ <link rel="stylesheet" href="templates/print.css" type="text/css" />
+</head>
+
+<body class="PRDLG" onload="initPage()">
+ 
+<h4> <?php echo (_p("Map Resolution for Download")) ?> :</h4>
+<form id="dlform" action="download.phtml" method="post">
+ <p>
+  <?php
+    foreach($dpiList as $d) {
+        echo ("<input type=\"radio\" name=\"dldpi\" value=\"$d\" />$d DPI<br />\n");
+    }
+  ?>
+  </p>
+  <p>
+   <input type="checkbox" name="imgFormat" value="GTiff" />GeoTIFF
+  </p>
+  <p>
+   <input type="button" value=" OK " onclick="javascript:submit();self.close()" />
+  </p>
+  <p>  
+   <?php echo ("<input type=\"hidden\" name=\"" . ini_get("session.name") . "\" value=\"" . session_id() . "\" />") ?>
+  </p>
+</form>
+
+</body>
+</html>
+
+
+
+

Added: images/blank.gif
===================================================================
(Binary files differ)


Property changes on: images/blank.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/auto_identify_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/auto_identify_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/back_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/back_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/back_on.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/back_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/buttons.psd
===================================================================
(Binary files differ)


Property changes on: images/buttons/buttons.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/coords_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/coords_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/coords_on.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/coords_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/digitize_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/digitize_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/digitize_on.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/digitize_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/download_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/download_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/download_on.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/download_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/fwd_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/fwd_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/home_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/home_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/home_on.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/home_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/identify_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/identify_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/identify_on.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/identify_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/measure_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/measure_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/measure_on.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/measure_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/pan/pane_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/pan/pane_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/pan/pann_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/pan/pann_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/pan/pannw_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/pan/pannw_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/pan/pans_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/pan/pans_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/pan/panw_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/pan/panw_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/pan_e.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/pan_e.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/pan_n.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/pan_n.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/pan_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/pan_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/pan_on.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/pan_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/pan_s.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/pan_s.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/pan_w.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/pan_w.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/poi_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/poi_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/poi_on.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/poi_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/print_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/print_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/print_on.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/print_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/reload_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/reload_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/reload_on.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/reload_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/resize_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/resize_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/select_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/select_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/select_on.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/select_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/separatorh.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/separatorh.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/separatorv.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/separatorv.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/space.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/space.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/zoomin_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/zoomin_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/zoomin_off0.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/zoomin_off0.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/zoomin_on.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/zoomin_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/zoomin_on.gif_
===================================================================
(Binary files differ)


Property changes on: images/buttons/zoomin_on.gif_
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/zoomminus.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/zoomminus.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/zoomminus0.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/zoomminus0.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/zoomout_off.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/zoomout_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/zoomout_off_0.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/zoomout_off_0.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/zoomout_on.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/zoomout_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/zoomplus.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/zoomplus.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/buttons/zoomplus0.gif
===================================================================
(Binary files differ)


Property changes on: images/buttons/zoomplus0.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/close.gif
===================================================================
(Binary files differ)


Property changes on: images/close.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/close1.gif
===================================================================
(Binary files differ)


Property changes on: images/close1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/close2.gif
===================================================================
(Binary files differ)


Property changes on: images/close2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/cursors/center.cur
===================================================================
(Binary files differ)


Property changes on: images/cursors/center.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/cursors/cross.cur
===================================================================
(Binary files differ)


Property changes on: images/cursors/cross.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/cursors/hourglass.cur
===================================================================
(Binary files differ)


Property changes on: images/cursors/hourglass.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/cursors/identify.cur
===================================================================
(Binary files differ)


Property changes on: images/cursors/identify.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/cursors/link.cur
===================================================================
(Binary files differ)


Property changes on: images/cursors/link.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/cursors/measure.cur
===================================================================
(Binary files differ)


Property changes on: images/cursors/measure.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/cursors/measure.gif
===================================================================
(Binary files differ)


Property changes on: images/cursors/measure.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/cursors/pan.cur
===================================================================
(Binary files differ)


Property changes on: images/cursors/pan.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/cursors/pencil.cur
===================================================================
(Binary files differ)


Property changes on: images/cursors/pencil.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/cursors/select.cur
===================================================================
(Binary files differ)


Property changes on: images/cursors/select.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/cursors/xy.cur
===================================================================
(Binary files differ)


Property changes on: images/cursors/xy.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/cursors/zoomin.ani
===================================================================
(Binary files differ)


Property changes on: images/cursors/zoomin.ani
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/cursors/zoomin.cur
===================================================================
(Binary files differ)


Property changes on: images/cursors/zoomin.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/cursors/zoomout.cur
===================================================================
(Binary files differ)


Property changes on: images/cursors/zoomout.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/downsimple.png
===================================================================
(Binary files differ)


Property changes on: images/downsimple.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/base.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/base.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/cd.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/cd.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/empty.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/empty.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/folder.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/folder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/folderopen.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/folderopen.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/globe.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/globe.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/imgfolder.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/imgfolder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/join.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/join.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/joinbottom.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/joinbottom.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/layers.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/layers.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/layers0.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/layers0.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/line.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/line.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/minus.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/minus.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/minusbottom.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/minusbottom.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/musicfolder.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/musicfolder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/nolines_minus.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/nolines_minus.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/nolines_plus.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/nolines_plus.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/page.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/page.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/plus.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/plus.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/plusbottom.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/plusbottom.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/question.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/question.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/dtree/trash.gif
===================================================================
(Binary files differ)


Property changes on: images/dtree/trash.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/favicon.ico
===================================================================
(Binary files differ)


Property changes on: images/favicon.ico
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/layer.gif
===================================================================
(Binary files differ)


Property changes on: images/layer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/layers.gif
===================================================================
(Binary files differ)


Property changes on: images/layers.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/cities_i0.png
===================================================================
(Binary files differ)


Property changes on: images/legend/cities_i0.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/cities_i1.png
===================================================================
(Binary files differ)


Property changes on: images/legend/cities_i1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/cities_i2.png
===================================================================
(Binary files differ)


Property changes on: images/legend/cities_i2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/cities_i3.png
===================================================================
(Binary files differ)


Property changes on: images/legend/cities_i3.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i0.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i0.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i1.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i10.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i10.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i11.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i11.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i12.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i12.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i13.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i13.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i14.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i14.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i15.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i15.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i16.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i16.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i17.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i17.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i18.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i18.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i19.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i19.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i2.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i20.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i20.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i21.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i21.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i22.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i22.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i23.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i23.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i24.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i24.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i25.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i25.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i26.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i26.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i27.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i27.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i28.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i28.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i29.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i29.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i3.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i3.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i30.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i30.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i31.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i31.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i32.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i32.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i33.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i33.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i34.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i34.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i4.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i4.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i5.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i5.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i6.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i6.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i7.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i7.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i8.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i8.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/corine1_i9.png
===================================================================
(Binary files differ)


Property changes on: images/legend/corine1_i9.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/countries_i0.png
===================================================================
(Binary files differ)


Property changes on: images/legend/countries_i0.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/legend/createimg.log
===================================================================
--- images/legend/createimg.log	2006-10-05 22:45:01 UTC (rev 0)
+++ images/legend/createimg.log	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1 @@
+Created legend icons newly on:  11:50:44; 9/September/2006
\ No newline at end of file

Added: images/legend/rivers_i0.png
===================================================================
(Binary files differ)


Property changes on: images/legend/rivers_i0.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/load.gif
===================================================================
(Binary files differ)


Property changes on: images/load.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/loading.gif
===================================================================
(Binary files differ)


Property changes on: images/loading.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/logo.gif
===================================================================
(Binary files differ)


Property changes on: images/logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/logo.png
===================================================================
(Binary files differ)


Property changes on: images/logo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/logo2.gif
===================================================================
(Binary files differ)


Property changes on: images/logo2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/map.png
===================================================================
(Binary files differ)


Property changes on: images/map.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/map0.png
===================================================================
(Binary files differ)


Property changes on: images/map0.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/mapserver.gif
===================================================================
(Binary files differ)


Property changes on: images/mapserver.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/mapserver_65_bw_t.gif
===================================================================
(Binary files differ)


Property changes on: images/mapserver_65_bw_t.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/mimg.gif
===================================================================
(Binary files differ)


Property changes on: images/mimg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/pixel.gif
===================================================================
(Binary files differ)


Property changes on: images/pixel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/pmapper.png
===================================================================
(Binary files differ)


Property changes on: images/pmapper.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/powered_mapserver.png
===================================================================
(Binary files differ)


Property changes on: images/powered_mapserver.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/refcross.gif
===================================================================
(Binary files differ)


Property changes on: images/refcross.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/refcross0.gif
===================================================================
(Binary files differ)


Property changes on: images/refcross0.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/reference.jpg
===================================================================
(Binary files differ)


Property changes on: images/reference.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/reference.png
===================================================================
(Binary files differ)


Property changes on: images/reference.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/reference_world.png
===================================================================
(Binary files differ)


Property changes on: images/reference_world.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/0_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/0_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/0_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/0_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/1_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/1_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/1_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/1_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/2_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/2_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/2_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/2_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/3_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/3_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/3_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/3_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/4_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/4_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/4_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/4_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/5_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/5_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/5_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/5_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/6_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/6_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/6_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/6_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/7_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/7_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/7_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/7_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/0_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/0_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/0_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/0_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/1_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/1_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/1_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/1_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/2_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/2_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/2_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/2_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/3_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/3_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/3_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/3_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/4_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/4_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/4_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/4_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/5_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/5_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/5_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/5_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/6_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/6_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/6_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/6_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/7_sl_off.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/7_sl_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/new/7_sl_on.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/new/7_sl_on.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/zoomminus.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/zoomminus.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/slider/zoomplus.gif
===================================================================
(Binary files differ)


Property changes on: images/slider/zoomplus.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/tree/empty.gif
===================================================================
(Binary files differ)


Property changes on: images/tree/empty.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/tree/layers.gif
===================================================================
(Binary files differ)


Property changes on: images/tree/layers.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/tree/minus.gif
===================================================================
(Binary files differ)


Property changes on: images/tree/minus.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/tree/plus.gif
===================================================================
(Binary files differ)


Property changes on: images/tree/plus.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/upsimple.png
===================================================================
(Binary files differ)


Property changes on: images/upsimple.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/valid-xhtml10.png
===================================================================
(Binary files differ)


Property changes on: images/valid-xhtml10.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/zoomto.gif
===================================================================
(Binary files differ)


Property changes on: images/zoomto.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/zoomto1.gif
===================================================================
(Binary files differ)


Property changes on: images/zoomto1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: images/zoomtoall.gif
===================================================================
(Binary files differ)


Property changes on: images/zoomtoall.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: incphp/common.php
===================================================================
--- incphp/common.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/common.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,294 @@
+<?php
+/*********************************************************************************
+ Copyright (c) 2003-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+
+//************************************** COMMON FUNCTIONS **************************************************************//
+
+
+
+/* 
+ * GETTEXT-LIKE FUNCTION FOR MULTILINGUAL APPLICATION
+ ******************************************************/
+
+/**
+ * USING PHP ARRAYS
+ */
+function _p($string)
+{
+    global $_sl;
+    if (isset($_sl[$string])) {
+        return $_sl[$string];
+    } else {
+        return $string;
+    }
+}
+
+function _pjs($string)
+{
+    return addslashes(_p($string));
+}
+
+
+/**
+ * USING SQLite DB
+ * Load SQLite extension 
+ */
+function __p($string)
+{
+    // Load SQLite extension 
+    if (!extension_loaded('sqlite')) {
+            if (!dl(stristr(PHP_OS, "WIN") ? "php_sqlite.dll" : "sqlite.so"))
+                exit("Could not load the SQLite extension.\n");
+    }
+    
+    global $gLanguage;
+
+    $dsn = is_file("incphp/locale/localedb.db") ? "incphp/locale/localedb.db" : "locale/localedb.db";
+    $dbh = sqlite_open($dsn, 0666, $sqliteerror);
+    $sql = "SELECT $gLanguage FROM locales WHERE base='" . str_replace("'", "''", $string) . "' LIMIT 1";
+    $res = sqlite_query($dbh, $sql);
+    
+    if (sqlite_num_rows($res) > 0) {
+        $resstring = sqlite_fetch_single($res);
+        if (strlen($resstring) > 0) {
+            $string = $resstring;
+        }
+    }
+    
+    sqlite_close($dbh);
+    
+    return $string;
+}
+
+
+
+/**
+ * ENABLE/DISABLE GROUPS IN MAP
+ */
+function setGroups($map, $groups, $scale, $setLabelItem, $query=false)
+{
+    // APPLY ON LAYERS DEFINED IN MAP FILE
+    //$grouplist = $_SESSION["grouplist"];
+    //$grouplist = array_unique($_SESSION["grouplist"]);  // does NOT work with PHP4 
+    $grouplist = array_unique_key($_SESSION["grouplist"]);
+    
+    foreach ($grouplist as $grp){
+        $glayerList = $grp->getLayers();
+
+        if (in_array($grp->groupName, $groups, TRUE)) {
+            $activeGroups[] = $grp;
+            foreach ($glayerList as $glayer) {
+                $layer = $map->getLayer($glayer->getLayerIdx());
+                $layerType = $layer->type;
+                
+                // if defined use only layers visible at current scale (useful for queries)
+                if ($scale > 0) {
+                    if (checkScale($map, $layer, $scale) == 1) {
+                        $querylayers[] = $layer;   
+                        $layer->set("status", MS_ON);
+                        
+                        // set labelitem if defined
+                        if ($setLabelItem) {
+                            if ($glayer->getLabelItem()) {
+                                $layer->set("labelitem", $glayer->getLabelItem());
+                            }
+                        }
+                        
+                        // Layer Transparency
+                        $layer->set("transparency", $glayer->getTransparency());
+                        
+                    } else {
+                        $layer->set("status", MS_OFF);
+                    }
+                } else {
+                    $layer->set("status", MS_ON);
+                    // set labelitem if defined
+                    if ($setLabelItem) {
+                        if ($glayer->getLabelItem()) {
+                            $layer->set("labelitem", $glayer->getLabelItem());
+                        }
+                    }
+                    $layer->set("transparency", $glayer->getTransparency());
+                }
+            }
+        } else {
+            foreach ($glayerList as $glayer) {
+                $layer = $map->getLayer($glayer->getLayerIdx());
+                $layer->set("status", MS_OFF);
+            }
+        }
+    }
+}
+
+
+/**
+ * Removes duplicate keys from an array
+ */
+function array_unique_key($array) {
+    $result = array();
+    foreach (array_unique(array_keys($array)) as $tvalue) {
+        $result[$tvalue] = $array[$tvalue];
+    }
+    return $result;
+}
+
+
+/**
+ * CHECK IF LAYER IS IN VALID SCALE DIMENSION (USED FOR QUERIES)
+ * Based on a script by CHIP HANKLEY found on MapServer Wiki 
+ */
+function checkScale($map, $qLayer, $scale)
+{
+    if ($qLayer->maxscale == -1 && $qLayer->minscale == -1) {
+        return 1;
+    } elseif ($scale > $qLayer->maxscale AND $qLayer->maxscale != -1) {
+        return 0;
+    } elseif ($scale < $qLayer->minscale AND $qLayer->minscale != -1) {
+        return 0;
+    } else {
+        return 1;
+    }
+}
+
+
+/**
+ * Get the group to which a glayer belongs
+ */
+function returnGroupGlayer($layname)
+{
+    $grouplist = $_SESSION["grouplist"];
+    foreach ($grouplist as $grp) {
+        $glayerList = $grp->getLayers();
+        foreach ($glayerList as $gl) {
+            $glayername = $gl->getLayerName();
+            if ($layname == $glayername) {
+                return array($grp, $gl);
+            }
+        }
+    }
+}
+
+
+/**
+ * Print out debug info (including arrays)
+ */
+function printDebug($dbgstr0)
+{
+    ob_start();
+    print_r($dbgstr0);
+    $dbgstr = ob_get_contents();
+    ob_end_clean();   
+    
+    $outMapFN = str_replace('\\', '/', dirname(ini_get("error_log"))) . "/debug.txt";
+    $fpOut = fopen($outMapFN, "a+");
+    fwrite($fpOut, "\n$dbgstr");
+    fclose($fpOut);
+}
+
+
+/**
+ * Workaround for Mapscript bug and temp image file names
+ */
+function mapSaveWebImage($map, $mapImg, $refImg=false)
+{
+    $now = (string)microtime();
+    $now = explode(' ', $now);
+    $microsec = $now[1].str_replace('.', '', $now[0]);
+    unset($now);
+
+    $imgFormat = $refImg ? substr(strtolower(trim($map->reference->image)), -3) : $map->outputformat->extension;
+
+    $tmpImgBaseName = session_id() . $microsec . "." . $imgFormat;
+    $tmpFileNameAbs = str_replace('\\', '/', $map->web->imagepath) . $tmpImgBaseName ;
+    $imgURL =  $map->web->imageurl . $tmpImgBaseName ;
+    $mapImg->saveImage($tmpFileNameAbs, $map);
+
+    return $imgURL;
+}
+
+
+/**
+ * Parses a JSON (www.json.org) string
+ * using if available the PHP-JSON extension
+ * or else the json.php parser by Michal Migurski
+ * default action is decoding
+ */
+function parseJSON($input, $action="decode") 
+{
+    if (!extension_loaded('json')) {
+        @dl("php_json." . PHP_SHLIB_SUFFIX);
+    }
+    
+    if (extension_loaded('json')) {
+        if ($action == "decode") {
+            return json_decode($input);
+        } else {
+            return json_encode($input);
+        }
+    
+    } else {
+        require_once($_SESSION['PM_INCPHP'] . "/extlib/json.php");
+        $json = new Services_JSON();
+        if ($action == "decode") {
+            return $json->decode($input);
+        } else {
+            return $json->encode($input);
+        }
+    }
+}
+
+
+/**
+ * Log errors for PEAR DB connections/queries
+ */
+function db_logErrors($db)
+{
+    $err .=  "===== P.MAPPER: DB ERROR =====\n";
+    $err .=  'Standard Message:   ' . $db->getMessage() . "\n";
+    //$err .=  'Standard Code:      ' . $db->getCode() . "\n";
+    //$err .=  'DBMS/User Message:  ' . $db->getUserInfo() . "\n";
+    $err .=  'DBMS/Debug Message: ' . $db->getDebugInfo() . "\n";
+    
+    error_log($err);
+}
+
+
+/**
+ * Scan a dir for files with a certain extension
+ */
+function scandirByExt($dir, $extension)
+{
+    $dh  = opendir($dir);
+    while (false !== ($filename = readdir($dh))) {
+        if (substr(strrchr($filename, "."), 1) == $extension) {
+            $files[] = $filename;
+        }
+    }
+    return $files;
+}
+    
+   
+
+
+
+
+?>
\ No newline at end of file

Added: incphp/custom.php
===================================================================
--- incphp/custom.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/custom.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,18 @@
+<?php
+
+$gLanguage = $_SESSION["gLanguage"];
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+?>

Added: incphp/customlayers.php
===================================================================
--- incphp/customlayers.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/customlayers.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,76 @@
+<?php
+
+class URL_Layer
+{
+
+    function URL_Layer($map, $mapImg=false)
+    {
+        $this->map = $map;
+        $this->mapImg = $mapImg;
+        
+        $this->url_createLayer();
+    
+    
+    }
+    
+    function url_createLayer()
+    {
+        
+        $txtLayer = ms_newLayerObj($this->map);
+        $txtLayer->set("name", "url_txtlayer");
+        $txtLayer->set("type", 0);
+        $txtLayer->set("status", MS_ON);
+        
+        $url_points = $_SESSION['url_points'];
+        
+        foreach ($url_points as $upnt) {
+            // Create line, add xp point, create shape and add line and text, add shape to layer
+            //$pointList = explode(",", $f);
+            $px  = $upnt[0];
+            $py  = $upnt[1];
+            $txt = $upnt[2];
+            
+            $newLine = ms_newLineObj();
+            $newLine->addXY($px, $py);
+            
+            $newShape = ms_newShapeObj(0);
+            $newShape->add($newLine);
+            $newShape->set("text", $txt);
+            $txtLayer->addFeature($newShape);
+            
+            // Class properties
+            $pntClass = ms_newClassObj($txtLayer);
+            $clStyle = ms_newStyleObj($pntClass);
+            $clStyle->color->setRGB(0, 0, 255);
+            $clStyle->outlinecolor->setRGB(255, 0, 0);
+            $clStyle->set("symbolname", "circle");
+            $symSize = 10;
+            $clStyle->set("size", $symSize);
+            
+            // Label properties
+            //$pntClass->label->set("position", MS_UR);
+            $pntClass->label->set("position", MS_AUTO);
+            $pntClass->label->set("size", "small");
+            //$pntClass->label->set("font", "verdana");
+            //$pntClass->label->set("type", MS_TRUETYPE);
+            //$pntClass->label->set("size", 8);
+            //$pntClass->label->set("antialias", MS_FALSE);
+            $pntClass->label->set("buffer", 2);
+            $pntClass->label->set("wrap", ",");
+            $pntClass->label->color->setRGB(0, 0 , 0);
+            $pntClass->label->backgroundcolor->setRGB(255, 255, 210);
+            $pntClass->label->backgroundshadowcolor->setRGB(170, 170 , 170);
+            $pntClass->label->set("backgroundshadowsizex", 2);
+            $pntClass->label->set("backgroundshadowsizey", 2);
+            //$pntClass->label->set("force", MS_TRUE);
+        
+        }
+    
+    }
+
+
+
+}
+
+
+?>

Added: incphp/extlib/json.php
===================================================================
--- incphp/extlib/json.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/extlib/json.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,806 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Converts to and from JSON format.
+ *
+ * JSON (JavaScript Object Notation) is a lightweight data-interchange
+ * format. It is easy for humans to read and write. It is easy for machines
+ * to parse and generate. It is based on a subset of the JavaScript
+ * Programming Language, Standard ECMA-262 3rd Edition - December 1999.
+ * This feature can also be found in  Python. JSON is a text format that is
+ * completely language independent but uses conventions that are familiar
+ * to programmers of the C-family of languages, including C, C++, C#, Java,
+ * JavaScript, Perl, TCL, and many others. These properties make JSON an
+ * ideal data-interchange language.
+ *
+ * This package provides a simple encoder and decoder for JSON notation. It
+ * is intended for use with client-side Javascript applications that make
+ * use of HTTPRequest to perform server communication functions - data can
+ * be encoded into JSON notation for use in a client-side javascript, or
+ * decoded from incoming Javascript requests. JSON format is native to
+ * Javascript, and can be directly eval()'ed with no further parsing
+ * overhead
+ *
+ * All strings should be in ASCII or UTF-8 format!
+ *
+ * LICENSE: Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met: Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following
+ * disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * @category
+ * @package     Services_JSON
+ * @author      Michal Migurski <mike-json at teczno.com>
+ * @author      Matt Knapp <mdknapp[at]gmail[dot]com>
+ * @author      Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
+ * @copyright   2005 Michal Migurski
+ * @version     CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $
+ * @license     http://www.opensource.org/licenses/bsd-license.php
+ * @link        http://pear.php.net/pepr/pepr-proposal-show.php?id=198
+ */
+
+/**
+ * Marker constant for Services_JSON::decode(), used to flag stack state
+ */
+define('SERVICES_JSON_SLICE',   1);
+
+/**
+ * Marker constant for Services_JSON::decode(), used to flag stack state
+ */
+define('SERVICES_JSON_IN_STR',  2);
+
+/**
+ * Marker constant for Services_JSON::decode(), used to flag stack state
+ */
+define('SERVICES_JSON_IN_ARR',  3);
+
+/**
+ * Marker constant for Services_JSON::decode(), used to flag stack state
+ */
+define('SERVICES_JSON_IN_OBJ',  4);
+
+/**
+ * Marker constant for Services_JSON::decode(), used to flag stack state
+ */
+define('SERVICES_JSON_IN_CMT', 5);
+
+/**
+ * Behavior switch for Services_JSON::decode()
+ */
+define('SERVICES_JSON_LOOSE_TYPE', 16);
+
+/**
+ * Behavior switch for Services_JSON::decode()
+ */
+define('SERVICES_JSON_SUPPRESS_ERRORS', 32);
+
+/**
+ * Converts to and from JSON format.
+ *
+ * Brief example of use:
+ *
+ * <code>
+ * // create a new instance of Services_JSON
+ * $json = new Services_JSON();
+ *
+ * // convert a complexe value to JSON notation, and send it to the browser
+ * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));
+ * $output = $json->encode($value);
+ *
+ * print($output);
+ * // prints: ["foo","bar",[1,2,"baz"],[3,[4]]]
+ *
+ * // accept incoming POST data, assumed to be in JSON notation
+ * $input = file_get_contents('php://input', 1000000);
+ * $value = $json->decode($input);
+ * </code>
+ */
+class Services_JSON
+{
+   /**
+    * constructs a new JSON instance
+    *
+    * @param    int     $use    object behavior flags; combine with boolean-OR
+    *
+    *                           possible values:
+    *                           - SERVICES_JSON_LOOSE_TYPE:  loose typing.
+    *                                   "{...}" syntax creates associative arrays
+    *                                   instead of objects in decode().
+    *                           - SERVICES_JSON_SUPPRESS_ERRORS:  error suppression.
+    *                                   Values which can't be encoded (e.g. resources)
+    *                                   appear as NULL instead of throwing errors.
+    *                                   By default, a deeply-nested resource will
+    *                                   bubble up with an error, so all return values
+    *                                   from encode() should be checked with isError()
+    */
+    function Services_JSON($use = 0)
+    {
+        $this->use = $use;
+    }
+
+   /**
+    * convert a string from one UTF-16 char to one UTF-8 char
+    *
+    * Normally should be handled by mb_convert_encoding, but
+    * provides a slower PHP-only method for installations
+    * that lack the multibye string extension.
+    *
+    * @param    string  $utf16  UTF-16 character
+    * @return   string  UTF-8 character
+    * @access   private
+    */
+    function utf162utf8($utf16)
+    {
+        // oh please oh please oh please oh please oh please
+        if(function_exists('mb_convert_encoding')) {
+            return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
+        }
+
+        $bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
+
+        switch(true) {
+            case ((0x7F & $bytes) == $bytes):
+                // this case should never be reached, because we are in ASCII range
+                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                return chr(0x7F & $bytes);
+
+            case (0x07FF & $bytes) == $bytes:
+                // return a 2-byte UTF-8 character
+                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                return chr(0xC0 | (($bytes >> 6) & 0x1F))
+                     . chr(0x80 | ($bytes & 0x3F));
+
+            case (0xFFFF & $bytes) == $bytes:
+                // return a 3-byte UTF-8 character
+                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                return chr(0xE0 | (($bytes >> 12) & 0x0F))
+                     . chr(0x80 | (($bytes >> 6) & 0x3F))
+                     . chr(0x80 | ($bytes & 0x3F));
+        }
+
+        // ignoring UTF-32 for now, sorry
+        return '';
+    }
+
+   /**
+    * convert a string from one UTF-8 char to one UTF-16 char
+    *
+    * Normally should be handled by mb_convert_encoding, but
+    * provides a slower PHP-only method for installations
+    * that lack the multibye string extension.
+    *
+    * @param    string  $utf8   UTF-8 character
+    * @return   string  UTF-16 character
+    * @access   private
+    */
+    function utf82utf16($utf8)
+    {
+        // oh please oh please oh please oh please oh please
+        if(function_exists('mb_convert_encoding')) {
+            return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
+        }
+
+        switch(strlen($utf8)) {
+            case 1:
+                // this case should never be reached, because we are in ASCII range
+                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                return $utf8;
+
+            case 2:
+                // return a UTF-16 character from a 2-byte UTF-8 char
+                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                return chr(0x07 & (ord($utf8{0}) >> 2))
+                     . chr((0xC0 & (ord($utf8{0}) << 6))
+                         | (0x3F & ord($utf8{1})));
+
+            case 3:
+                // return a UTF-16 character from a 3-byte UTF-8 char
+                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                return chr((0xF0 & (ord($utf8{0}) << 4))
+                         | (0x0F & (ord($utf8{1}) >> 2)))
+                     . chr((0xC0 & (ord($utf8{1}) << 6))
+                         | (0x7F & ord($utf8{2})));
+        }
+
+        // ignoring UTF-32 for now, sorry
+        return '';
+    }
+
+   /**
+    * encodes an arbitrary variable into JSON format
+    *
+    * @param    mixed   $var    any number, boolean, string, array, or object to be encoded.
+    *                           see argument 1 to Services_JSON() above for array-parsing behavior.
+    *                           if var is a strng, note that encode() always expects it
+    *                           to be in ASCII or UTF-8 format!
+    *
+    * @return   mixed   JSON string representation of input var or an error if a problem occurs
+    * @access   public
+    */
+    function encode($var)
+    {
+        switch (gettype($var)) {
+            case 'boolean':
+                return $var ? 'true' : 'false';
+
+            case 'NULL':
+                return 'null';
+
+            case 'integer':
+                return (int) $var;
+
+            case 'double':
+            case 'float':
+                return (float) $var;
+
+            case 'string':
+                // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
+                $ascii = '';
+                $strlen_var = strlen($var);
+
+               /*
+                * Iterate over every character in the string,
+                * escaping with a slash or encoding to UTF-8 where necessary
+                */
+                for ($c = 0; $c < $strlen_var; ++$c) {
+
+                    $ord_var_c = ord($var{$c});
+
+                    switch (true) {
+                        case $ord_var_c == 0x08:
+                            $ascii .= '\b';
+                            break;
+                        case $ord_var_c == 0x09:
+                            $ascii .= '\t';
+                            break;
+                        case $ord_var_c == 0x0A:
+                            $ascii .= '\n';
+                            break;
+                        case $ord_var_c == 0x0C:
+                            $ascii .= '\f';
+                            break;
+                        case $ord_var_c == 0x0D:
+                            $ascii .= '\r';
+                            break;
+
+                        case $ord_var_c == 0x22:
+                        case $ord_var_c == 0x2F:
+                        case $ord_var_c == 0x5C:
+                            // double quote, slash, slosh
+                            $ascii .= '\\'.$var{$c};
+                            break;
+
+                        case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
+                            // characters U-00000000 - U-0000007F (same as ASCII)
+                            $ascii .= $var{$c};
+                            break;
+
+                        case (($ord_var_c & 0xE0) == 0xC0):
+                            // characters U-00000080 - U-000007FF, mask 110XXXXX
+                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                            $char = pack('C*', $ord_var_c, ord($var{$c + 1}));
+                            $c += 1;
+                            $utf16 = $this->utf82utf16($char);
+                            $ascii .= sprintf('\u%04s', bin2hex($utf16));
+                            break;
+
+                        case (($ord_var_c & 0xF0) == 0xE0):
+                            // characters U-00000800 - U-0000FFFF, mask 1110XXXX
+                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                            $char = pack('C*', $ord_var_c,
+                                         ord($var{$c + 1}),
+                                         ord($var{$c + 2}));
+                            $c += 2;
+                            $utf16 = $this->utf82utf16($char);
+                            $ascii .= sprintf('\u%04s', bin2hex($utf16));
+                            break;
+
+                        case (($ord_var_c & 0xF8) == 0xF0):
+                            // characters U-00010000 - U-001FFFFF, mask 11110XXX
+                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                            $char = pack('C*', $ord_var_c,
+                                         ord($var{$c + 1}),
+                                         ord($var{$c + 2}),
+                                         ord($var{$c + 3}));
+                            $c += 3;
+                            $utf16 = $this->utf82utf16($char);
+                            $ascii .= sprintf('\u%04s', bin2hex($utf16));
+                            break;
+
+                        case (($ord_var_c & 0xFC) == 0xF8):
+                            // characters U-00200000 - U-03FFFFFF, mask 111110XX
+                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                            $char = pack('C*', $ord_var_c,
+                                         ord($var{$c + 1}),
+                                         ord($var{$c + 2}),
+                                         ord($var{$c + 3}),
+                                         ord($var{$c + 4}));
+                            $c += 4;
+                            $utf16 = $this->utf82utf16($char);
+                            $ascii .= sprintf('\u%04s', bin2hex($utf16));
+                            break;
+
+                        case (($ord_var_c & 0xFE) == 0xFC):
+                            // characters U-04000000 - U-7FFFFFFF, mask 1111110X
+                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                            $char = pack('C*', $ord_var_c,
+                                         ord($var{$c + 1}),
+                                         ord($var{$c + 2}),
+                                         ord($var{$c + 3}),
+                                         ord($var{$c + 4}),
+                                         ord($var{$c + 5}));
+                            $c += 5;
+                            $utf16 = $this->utf82utf16($char);
+                            $ascii .= sprintf('\u%04s', bin2hex($utf16));
+                            break;
+                    }
+                }
+
+                return '"'.$ascii.'"';
+
+            case 'array':
+               /*
+                * As per JSON spec if any array key is not an integer
+                * we must treat the the whole array as an object. We
+                * also try to catch a sparsely populated associative
+                * array with numeric keys here because some JS engines
+                * will create an array with empty indexes up to
+                * max_index which can cause memory issues and because
+                * the keys, which may be relevant, will be remapped
+                * otherwise.
+                *
+                * As per the ECMA and JSON specification an object may
+                * have any string as a property. Unfortunately due to
+                * a hole in the ECMA specification if the key is a
+                * ECMA reserved word or starts with a digit the
+                * parameter is only accessible using ECMAScript's
+                * bracket notation.
+                */
+
+                // treat as a JSON object
+                if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
+                    $properties = array_map(array($this, 'name_value'),
+                                            array_keys($var),
+                                            array_values($var));
+
+                    foreach($properties as $property) {
+                        if(Services_JSON::isError($property)) {
+                            return $property;
+                        }
+                    }
+
+                    return '{' . join(',', $properties) . '}';
+                }
+
+                // treat it like a regular array
+                $elements = array_map(array($this, 'encode'), $var);
+
+                foreach($elements as $element) {
+                    if(Services_JSON::isError($element)) {
+                        return $element;
+                    }
+                }
+
+                return '[' . join(',', $elements) . ']';
+
+            case 'object':
+                $vars = get_object_vars($var);
+
+                $properties = array_map(array($this, 'name_value'),
+                                        array_keys($vars),
+                                        array_values($vars));
+
+                foreach($properties as $property) {
+                    if(Services_JSON::isError($property)) {
+                        return $property;
+                    }
+                }
+
+                return '{' . join(',', $properties) . '}';
+
+            default:
+                return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
+                    ? 'null'
+                    : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
+        }
+    }
+
+   /**
+    * array-walking function for use in generating JSON-formatted name-value pairs
+    *
+    * @param    string  $name   name of key to use
+    * @param    mixed   $value  reference to an array element to be encoded
+    *
+    * @return   string  JSON-formatted name-value pair, like '"name":value'
+    * @access   private
+    */
+    function name_value($name, $value)
+    {
+        $encoded_value = $this->encode($value);
+
+        if(Services_JSON::isError($encoded_value)) {
+            return $encoded_value;
+        }
+
+        return $this->encode(strval($name)) . ':' . $encoded_value;
+    }
+
+   /**
+    * reduce a string by removing leading and trailing comments and whitespace
+    *
+    * @param    $str    string      string value to strip of comments and whitespace
+    *
+    * @return   string  string value stripped of comments and whitespace
+    * @access   private
+    */
+    function reduce_string($str)
+    {
+        $str = preg_replace(array(
+
+                // eliminate single line comments in '// ...' form
+                '#^\s*//(.+)$#m',
+
+                // eliminate multi-line comments in '/* ... */' form, at start of string
+                '#^\s*/\*(.+)\*/#Us',
+
+                // eliminate multi-line comments in '/* ... */' form, at end of string
+                '#/\*(.+)\*/\s*$#Us'
+
+            ), '', $str);
+
+        // eliminate extraneous space
+        return trim($str);
+    }
+
+   /**
+    * decodes a JSON string into appropriate variable
+    *
+    * @param    string  $str    JSON-formatted string
+    *
+    * @return   mixed   number, boolean, string, array, or object
+    *                   corresponding to given JSON input string.
+    *                   See argument 1 to Services_JSON() above for object-output behavior.
+    *                   Note that decode() always returns strings
+    *                   in ASCII or UTF-8 format!
+    * @access   public
+    */
+    function decode($str)
+    {
+        $str = $this->reduce_string($str);
+
+        switch (strtolower($str)) {
+            case 'true':
+                return true;
+
+            case 'false':
+                return false;
+
+            case 'null':
+                return null;
+
+            default:
+                $m = array();
+
+                if (is_numeric($str)) {
+                    // Lookie-loo, it's a number
+
+                    // This would work on its own, but I'm trying to be
+                    // good about returning integers where appropriate:
+                    // return (float)$str;
+
+                    // Return float or int, as appropriate
+                    return ((float)$str == (integer)$str)
+                        ? (integer)$str
+                        : (float)$str;
+
+                } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) {
+                    // STRINGS RETURNED IN UTF-8 FORMAT
+                    $delim = substr($str, 0, 1);
+                    $chrs = substr($str, 1, -1);
+                    $utf8 = '';
+                    $strlen_chrs = strlen($chrs);
+
+                    for ($c = 0; $c < $strlen_chrs; ++$c) {
+
+                        $substr_chrs_c_2 = substr($chrs, $c, 2);
+                        $ord_chrs_c = ord($chrs{$c});
+
+                        switch (true) {
+                            case $substr_chrs_c_2 == '\b':
+                                $utf8 .= chr(0x08);
+                                ++$c;
+                                break;
+                            case $substr_chrs_c_2 == '\t':
+                                $utf8 .= chr(0x09);
+                                ++$c;
+                                break;
+                            case $substr_chrs_c_2 == '\n':
+                                $utf8 .= chr(0x0A);
+                                ++$c;
+                                break;
+                            case $substr_chrs_c_2 == '\f':
+                                $utf8 .= chr(0x0C);
+                                ++$c;
+                                break;
+                            case $substr_chrs_c_2 == '\r':
+                                $utf8 .= chr(0x0D);
+                                ++$c;
+                                break;
+
+                            case $substr_chrs_c_2 == '\\"':
+                            case $substr_chrs_c_2 == '\\\'':
+                            case $substr_chrs_c_2 == '\\\\':
+                            case $substr_chrs_c_2 == '\\/':
+                                if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
+                                   ($delim == "'" && $substr_chrs_c_2 != '\\"')) {
+                                    $utf8 .= $chrs{++$c};
+                                }
+                                break;
+
+                            case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):
+                                // single, escaped unicode character
+                                $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))
+                                       . chr(hexdec(substr($chrs, ($c + 4), 2)));
+                                $utf8 .= $this->utf162utf8($utf16);
+                                $c += 5;
+                                break;
+
+                            case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
+                                $utf8 .= $chrs{$c};
+                                break;
+
+                            case ($ord_chrs_c & 0xE0) == 0xC0:
+                                // characters U-00000080 - U-000007FF, mask 110XXXXX
+                                //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                                $utf8 .= substr($chrs, $c, 2);
+                                ++$c;
+                                break;
+
+                            case ($ord_chrs_c & 0xF0) == 0xE0:
+                                // characters U-00000800 - U-0000FFFF, mask 1110XXXX
+                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                                $utf8 .= substr($chrs, $c, 3);
+                                $c += 2;
+                                break;
+
+                            case ($ord_chrs_c & 0xF8) == 0xF0:
+                                // characters U-00010000 - U-001FFFFF, mask 11110XXX
+                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                                $utf8 .= substr($chrs, $c, 4);
+                                $c += 3;
+                                break;
+
+                            case ($ord_chrs_c & 0xFC) == 0xF8:
+                                // characters U-00200000 - U-03FFFFFF, mask 111110XX
+                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                                $utf8 .= substr($chrs, $c, 5);
+                                $c += 4;
+                                break;
+
+                            case ($ord_chrs_c & 0xFE) == 0xFC:
+                                // characters U-04000000 - U-7FFFFFFF, mask 1111110X
+                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                                $utf8 .= substr($chrs, $c, 6);
+                                $c += 5;
+                                break;
+
+                        }
+
+                    }
+
+                    return $utf8;
+
+                } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
+                    // array, or object notation
+
+                    if ($str{0} == '[') {
+                        $stk = array(SERVICES_JSON_IN_ARR);
+                        $arr = array();
+                    } else {
+                        if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
+                            $stk = array(SERVICES_JSON_IN_OBJ);
+                            $obj = array();
+                        } else {
+                            $stk = array(SERVICES_JSON_IN_OBJ);
+                            $obj = new stdClass();
+                        }
+                    }
+
+                    array_push($stk, array('what'  => SERVICES_JSON_SLICE,
+                                           'where' => 0,
+                                           'delim' => false));
+
+                    $chrs = substr($str, 1, -1);
+                    $chrs = $this->reduce_string($chrs);
+
+                    if ($chrs == '') {
+                        if (reset($stk) == SERVICES_JSON_IN_ARR) {
+                            return $arr;
+
+                        } else {
+                            return $obj;
+
+                        }
+                    }
+
+                    //print("\nparsing {$chrs}\n");
+
+                    $strlen_chrs = strlen($chrs);
+
+                    for ($c = 0; $c <= $strlen_chrs; ++$c) {
+
+                        $top = end($stk);
+                        $substr_chrs_c_2 = substr($chrs, $c, 2);
+
+                        if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
+                            // found a comma that is not inside a string, array, etc.,
+                            // OR we've reached the end of the character list
+                            $slice = substr($chrs, $top['where'], ($c - $top['where']));
+                            array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
+                            //print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
+
+                            if (reset($stk) == SERVICES_JSON_IN_ARR) {
+                                // we are in an array, so just push an element onto the stack
+                                array_push($arr, $this->decode($slice));
+
+                            } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
+                                // we are in an object, so figure
+                                // out the property name and set an
+                                // element in an associative array,
+                                // for now
+                                $parts = array();
+                                
+                                if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
+                                    // "name":value pair
+                                    $key = $this->decode($parts[1]);
+                                    $val = $this->decode($parts[2]);
+
+                                    if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
+                                        $obj[$key] = $val;
+                                    } else {
+                                        $obj->$key = $val;
+                                    }
+                                } elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
+                                    // name:value pair, where name is unquoted
+                                    $key = $parts[1];
+                                    $val = $this->decode($parts[2]);
+
+                                    if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
+                                        $obj[$key] = $val;
+                                    } else {
+                                        $obj->$key = $val;
+                                    }
+                                }
+
+                            }
+
+                        } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
+                            // found a quote, and we are not inside a string
+                            array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
+                            //print("Found start of string at {$c}\n");
+
+                        } elseif (($chrs{$c} == $top['delim']) &&
+                                 ($top['what'] == SERVICES_JSON_IN_STR) &&
+                                 ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
+                            // found a quote, we're in a string, and it's not escaped
+                            // we know that it's not escaped becase there is _not_ an
+                            // odd number of backslashes at the end of the string so far
+                            array_pop($stk);
+                            //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
+
+                        } elseif (($chrs{$c} == '[') &&
+                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
+                            // found a left-bracket, and we are in an array, object, or slice
+                            array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
+                            //print("Found start of array at {$c}\n");
+
+                        } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
+                            // found a right-bracket, and we're in an array
+                            array_pop($stk);
+                            //print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
+
+                        } elseif (($chrs{$c} == '{') &&
+                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
+                            // found a left-brace, and we are in an array, object, or slice
+                            array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
+                            //print("Found start of object at {$c}\n");
+
+                        } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
+                            // found a right-brace, and we're in an object
+                            array_pop($stk);
+                            //print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
+
+                        } elseif (($substr_chrs_c_2 == '/*') &&
+                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
+                            // found a comment start, and we are in an array, object, or slice
+                            array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
+                            $c++;
+                            //print("Found start of comment at {$c}\n");
+
+                        } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
+                            // found a comment end, and we're in one now
+                            array_pop($stk);
+                            $c++;
+
+                            for ($i = $top['where']; $i <= $c; ++$i)
+                                $chrs = substr_replace($chrs, ' ', $i, 1);
+
+                            //print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
+
+                        }
+
+                    }
+
+                    if (reset($stk) == SERVICES_JSON_IN_ARR) {
+                        return $arr;
+
+                    } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
+                        return $obj;
+
+                    }
+
+                }
+        }
+    }
+
+    /**
+     * @todo Ultimately, this should just call PEAR::isError()
+     */
+    function isError($data, $code = null)
+    {
+        if (class_exists('pear')) {
+            return PEAR::isError($data, $code);
+        } elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
+                                 is_subclass_of($data, 'services_json_error'))) {
+            return true;
+        }
+
+        return false;
+    }
+}
+
+if (class_exists('PEAR_Error')) {
+
+    class Services_JSON_Error extends PEAR_Error
+    {
+        function Services_JSON_Error($message = 'unknown error', $code = null,
+                                     $mode = null, $options = null, $userinfo = null)
+        {
+            parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
+        }
+    }
+
+} else {
+
+    /**
+     * @todo Ultimately, this class shall be descended from PEAR_Error
+     */
+    class Services_JSON_Error
+    {
+        function Services_JSON_Error($message = 'unknown error', $code = null,
+                                     $mode = null, $options = null, $userinfo = null)
+        {
+
+        }
+    }
+
+}
+    
+?>

Added: incphp/globals.php
===================================================================
--- incphp/globals.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/globals.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,67 @@
+<?php
+
+/*********************************************************************************
+ Copyright (c) 2003-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+// ******************** //
+//  GLOBAL PARAMETERS
+// ******************** //
+
+
+// Set character set for correct display of special characters
+$defCharset = $_SESSION['defCharset'];
+
+
+/**
+ * LANGUAGE
+ */
+$gLanguage = $_SESSION["gLanguage"];
+include_once($_SESSION['PM_INCPHP'] . "/locale/language_" . $gLanguage . ".php");
+
+
+
+/**
+ * LOAD MAPSCRIPT MODULE
+ */
+$msVersion = $_SESSION['msVersion']; 
+if (!extension_loaded('MapScript')) {
+    dl("php_mapscript_$msVersion." . PHP_SHLIB_SUFFIX);
+}
+
+
+
+/**
+ * INITIALIZE MAP
+ */
+$PM_MAP_FILE = $_SESSION['PM_MAP_FILE'];
+$map = ms_newMapObj($PM_MAP_FILE);
+
+
+
+/** ========== DEPRECATED ==============
+ * DEFINE ZOOM STEPS FOR ZOOM SLIDER 
+ */
+//$gSlide = preg_split('/[\s,]+/', $ini["gSlide"]);
+
+
+
+
+?>
\ No newline at end of file

Added: incphp/group.php
===================================================================
--- incphp/group.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/group.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,239 @@
+<?php
+/*********************************************************************************
+ Copyright (c) 2002-2003 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+
+/*
+ * CLASS FOR GROUPS
+ *******************************************************************/
+class GROUP
+{
+    function GROUP($groupName)
+    {
+        $this->groupName = $groupName;
+        $this->selHeaders = array();
+        $this->layerList = array();
+    }
+
+    function setDescription($description)
+    {
+        $this->description = $description;
+    }
+
+    function addLayer($layer)
+    {
+        array_push($this->layerList, $layer);
+    }
+
+    function setResHeaders($selHeaders)
+    {
+        $this->selHeaders = $selHeaders;
+    }
+
+    function printGroupName()
+    {
+        echo $this->groupName;
+    }
+
+
+    //*** RETURN FUNCTIONS ***//
+    function getGroupName()
+    {
+        return $this->groupName;
+    }
+
+    function getDescription()
+    {
+        return $this->description;
+    }
+    
+    function getLayers()
+    {
+        return $this->layerList;
+    }
+    
+    function getResHeaders()
+    {
+        return $this->selHeaders;
+    }
+
+}
+
+
+/*
+ * CLASS FOR GROUP LAYERS
+ *******************************************************************/
+
+class GLAYER
+{
+    function GLAYER($glayerName)
+    {
+        $this->glayerName = $glayerName;
+        $this->selFields = array();
+        $this->hyperFields = array();
+    }
+
+    function setLayerIdx($glayerIdx)
+    {
+        $this->glayerIdx = $glayerIdx;
+    }
+
+    function setLayerType($glayerType)
+    {
+        $this->glayerType = $glayerType;
+    }
+
+    function setResFields($selFields)
+    {
+        $this->selFields = $selFields;
+    }
+
+    function setHyperFields($hyperFields)
+    {
+        $this->hyperFields = $hyperFields;
+    }
+
+    function setTableJoin($joinList)
+    {
+        $this->joinList = $joinList;
+    }
+
+    function setClasses($classes)
+    {
+        $this->classes = $classes;
+    }
+    
+    function setLabelItem($labelItem)
+    {
+        $this->labelItem = $labelItem;
+    }
+
+    function setXYLayerAttribute()
+    {
+        $this->isXYLayer = 1;
+    }
+    
+    function setXYLayerProperties($XYLayerProperties)
+    {
+        $this->XYLayerProperties = $XYLayerProperties;
+    }
+    
+    function setSkipLegend($skipLegend)
+    {
+        $this->skipLegend = $skipLegend;
+    }
+    
+    function setTransparency($transparency)
+    {
+        $this->glayerTransparency = $transparency;
+    }
+    
+    function setLayerEncoding($encoding)
+    {
+        $this->layerEncoding = $encoding;
+    }
+    
+
+    //*** GLOBAL RETURN FUNCTIONS ***//
+
+    function getLayerName()
+    {
+        return $this->glayerName;
+    }
+
+    function getLayerIdx()
+    {
+        return $this->glayerIdx;
+    }
+
+    function getLayerType()
+    {
+        return $this->glayerType;
+    }
+
+    function getResFields()
+    {
+        return $this->selFields;
+    }
+
+    function getHyperFields()
+    {
+        return $this->hyperFields;
+    }
+
+    function getTableJoin()
+    {
+        return $this->joinList;
+    }
+
+    function getClasses()
+    {
+        return $this->classes;
+    }
+    
+    function getLabelItem()
+    {
+        return $this->labelItem;
+    }
+    
+    function checkForXYLayer()
+    {
+        return $this->isXYLayer;
+    }
+    
+    function getXYLayerProperties()
+    {
+        return $this->XYLayerProperties;
+    }
+    
+    function getSkipLegend()
+    {
+        return $this->skipLegend;
+    }
+    
+    function getTransparency()
+    {
+        return $this->glayerTransparency;
+    }
+    
+    function getLayerEncoding()
+    {
+        return $this->layerEncoding;
+    }
+}
+
+
+
+function getGLayerByName($gLayerName) 
+{
+    $grouplist = $_SESSION["grouplist"];
+    foreach ($grouplist as $grp) {
+        $glayerList = $grp->getLayers();
+        foreach ($glayerList as $glayer) {
+            if ($glayer->getLayerName() == $gLayerName) {
+                return $glayer;
+            }
+        }
+    }
+}
+
+
+?>

Added: incphp/init/init.php
===================================================================
--- incphp/init/init.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/init/init.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,74 @@
+<?php
+
+/**
+ * Initialize settings (using "initmap.php")
+ */
+$initMap = new Init_map($map, $PM_MAP_FILE, $ini, $gLanguage);
+
+$infoWin = $_SESSION['infoWin'];
+$enableRightMousePan = $_SESSION['enableRightMousePan'];
+
+$mapW = 540;
+$mapH = 430;
+
+// Write variables to session
+$_SESSION["mapwidth"]  = $mapW;
+$_SESSION["mapheight"] = $mapH;
+
+
+/**
+ * Reference map section
+ */
+$refmap = $map->reference;
+$refW = $refmap->width;
+$refH = $refmap->height;
+$refImg = basename($refmap->image);
+
+
+/**
+ * Toolbar
+ */
+$toolBarOrientation = "vertical";
+
+
+/**
+ * p.mapper version
+ */
+$PM_VERSION = $ini["pmapper"];
+
+
+
+/**
+ * JS Arrays for legend/TOC
+ */
+$jsArrays = writeJSArrays();
+
+
+/**
+ * ZOOM TO PRE-DEFINED EXTENTS
+ */
+if (isset($_GET["zoomLayer"])) {          // EXTENT READ FROM FEATURE
+    $zoomLayer = $_GET["zoomLayer"];
+    $zoomQuery = $_GET["zoomQuery"];
+    $mapFrameURL = $initMap->getMapInitURL($map, $zoomLayer, $zoomQuery);
+}
+
+
+/**
+ * Parameters for Slider
+ */
+if ($ini['sliderMax'] == "max") {
+    $maxScale = $initMap->returnMaxScale($map, $mapH);
+} else {
+    $maxScale = $ini['sliderMax'];
+}
+
+$dgeo = $initMap->returnXYGeoDimensions();
+
+$minScale = $ini['sliderMin'];
+
+
+
+
+
+?>
\ No newline at end of file

Added: incphp/init/initmap.php
===================================================================
--- incphp/init/initmap.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/init/initmap.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,610 @@
+<?php
+/*********************************************************************************
+ Copyright (c) 2003-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+
+/************************************************************************
+ * Initializes application settings and writes settings to PHP session.
+ * Creates legend icons if the map file has been modified
+ ************************************************************************/
+
+class Init_map
+{
+    
+    // Class variables
+    var $map;
+    var $mapFile;
+    var $ini;
+    var $gLanguage;
+    
+    
+    function Init_map($map, $mapFile, $ini, $gLanguage)
+    {
+        $this->map = $map;
+        $this->mapFile = $mapFile;
+        $this->ini = $ini;
+        $this->gLanguage = $gLanguage;
+        
+        $this->_initExtParams();
+        $this->_initConfig();
+        $this->_initGroups();
+        $this->_initQuery();
+        $this->_initLegend();
+        $this->_initDataPath();
+        
+    }
+    
+   
+   /**
+    * Get external parameters via URL (eg from links)
+    *
+    */    
+    function _initExtParams()
+    {
+        if (isset($_GET['me'])) {
+            $ext = explode(',', $_GET['me']);
+            $_SESSION['zoom_extparams'] = $ext;
+        }
+        
+        if (isset($_GET['up'])) {
+            //$_SESSION['ul'] = $_GET['ul'];
+            $pointList = explode("@@@", $_GET['up']);
+            foreach($pointList as $p) {
+                $upnt = explode("@@", $p);
+                $url_points[] = $upnt;
+            }
+            $_SESSION['url_points'] = $url_points;
+        }
+    
+    }
+    
+    
+
+   /**
+    * Check INI settings for errors
+    */    
+    function _initConfig()
+    {
+        /*** Test if resolution tag is set ***/
+        if ($this->map->resolution != "96") {
+            error_log ("P.MAPPER-ERROR: RESOLUTION tag not set to 96. This value is needed for proper function of PDF print.", 0);
+        }
+
+        /*** LAYERS ***/        
+        // Test for groups with blanks
+        $gList = $this->map->getAllGroupNames();
+        foreach ($gList as $gr) {
+            if (preg_match('/\s/', $gr)) {
+                error_log ("P.MAPPER-ERROR: Group '$gr' defined in the map file has blanks in its name. This is not possible for the p.mapper application. Remove blanks or substitute with e.g. '_'.", 0);
+            }
+        }
+        // Test for layers with blanks
+        $gList = $this->map->getAllLayerNames();
+        foreach ($gList as $ly) {
+            if (preg_match('/\s/', $ly)) {
+                error_log ("P.MAPPER-ERROR: Layer '$ly' defined in the map file has blanks in its name. This is not possible for the p.mapper application. Remove blanks or substitute with e.g. '_'.", 0);
+            }
+        }
+        
+        /*** Enable map pan with right mouse button pressed ***/
+        $_SESSION['enableRightMousePan'] = $this->ini['enableRightMousePan'];
+        
+        /*** PDF print resolution ***/
+        if (isset($this->ini["pdfres"])) {
+            $pdfres = $this->ini["pdfres"];
+        } else {
+            $pdfres = 1.5;
+        }
+        $_SESSION["pdfres"] = $pdfres;
+        
+        $_SESSION['pmapper'] = $this->ini['pmapper'];
+        
+        if (isset($this->ini['dpiLevels'])) {
+            $_SESSION['dpiLevels'] = $this->ini['dpiLevels'];
+        }
+    }
+    
+    
+    
+   /**
+    * Initialize p.mapper-related groups/layers
+    */ 
+    function _initGroups()
+    {
+        /*** LAYERS DEFINED MANUALLY ***
+        displayed in TOC in this order
+        without definition, the order from map file will be taken  */
+        
+        $mapGrps = $this->map->getAllGroupNames();
+        $mapLays = $this->map->getAllLayerNames();
+        $GrpLay  = array_merge($mapGrps, $mapLays);
+        
+        if (isset($this->ini["allGroups"])) {
+            $allGroups = preg_split('/[\s,]+/', $this->ini["allGroups"]);
+            // Check for errors
+            foreach ($allGroups as $g) {
+               if (!in_array($g, $GrpLay) ) {
+                   error_log ("P.MAPPER-ERROR: Layer/Group '$g' not existing. Check '/config/config.ini' file definition for section 'allGroups'.", 0);
+               }
+            }
+        } else {
+            $allGroups = $this->map->getAllGroupNames();
+        }
+        
+        $_SESSION["allGroups"] = $allGroups;
+        
+    
+        /*** LAYERS SWITCHED ON BY DEFAULT ***
+        default groups, visible at start
+        without definition, ALL groups will be set visible  */
+        
+        // Check if layers are set externally via URL
+        if (isset($_GET['dg'])) {
+            $defGroupsGET = explode(',', $_GET['dg']);
+            $defGroups = array();
+            foreach ($defGroupsGET as $gG) {
+                if (in_array($gG, $allGroups)) {
+                    $defGroups[] = $gG;
+                }
+            }
+            // if no valid layers supplied, take first from ini
+            if (count($defGroups) < 1) $defGroups = array($allGroups[0]); 
+        
+        // Else take them from config.ini settings 
+        } elseif (isset($this->ini["defGroups"])) {
+            $defGroups = preg_split('/[\s,]+/', $this->ini["defGroups"]);
+            // Check for errors
+            foreach ($defGroups as $g) {
+                if (!in_array($g, $GrpLay )) {
+                   error_log ("P.MAPPER-ERROR: Layer/Group '$g' not existing. Check '/config/config.ini' file definition for section 'defGroups'.", 0);
+                   $defGroups = $allGroups; //$this->map->getAllGroupNames();
+                }
+            }
+        // Else take all
+        } else {
+            $defGroups = array(); //$allGroups;
+        }
+        
+        $_SESSION["defGroups"] = $defGroups;
+        
+        
+        /*** LAYERS DISABLING EACH OTHER ***/
+        if (isset($this->ini['mutualDisableList'])) {
+            $mutualDisableList = preg_split('/[\s,]+/', $this->ini['mutualDisableList']); 
+            foreach ($mutualDisableList as $mg) {
+               if (!in_array($mg, $allGroups )) {
+                   error_log ("P.MAPPER-ERROR: Layer/Group '$mg' not existing. Check '/config/config.ini' file definition for section 'mutualDisableList'.", 0);
+                   $mutualDisableList = array(); 
+               }
+            }
+        } else {
+            $mutualDisableList = array(); 
+        }
+        
+        $_SESSION['mutualDisableList'] = $mutualDisableList; 
+        
+        
+        /*** LAYERS CAUSING MAP TO SWITCH TO ALTERNATIVE IMAGE FORMAT ***/
+        if (isset($this->ini['altImgFormatLayers'])) {
+            $altImgFormatLayers = preg_split('/[\s,]+/', $this->ini['altImgFormatLayers']); 
+            foreach ($altImgFormatLayers as $mg) {
+               if (!in_array($mg, $allGroups )) {
+                   error_log ("P.MAPPER-ERROR: Layer/Group '$mg' not existing. Check '/config/config.ini' file definition for section 'mutualDisableList'.", 0);
+                   $altImgFormatLayers = 0; 
+               }
+            }
+        } else {
+            $altImgFormatLayers = 0; 
+        }
+        
+        $_SESSION['altImgFormatLayers'] = $altImgFormatLayers;
+        
+        
+        /*** Specify GROUP objects ***/
+        require_once($_SESSION['PM_INCPHP'] . "/initgroups.php");
+        $iG = new Init_groups($this->map, $allGroups, $this->gLanguage, $this->ini['map2unicode']);
+    
+    }
+    
+    
+   /**
+    * Settings for identify/search/select
+    *
+    */
+    function _initQuery()
+    {
+        // Limit for results of selection with select tool
+        $_SESSION["limitResult"] = $this->ini["limitResult"];
+        
+        //Defines if SELECT function causes feature highlight
+        $_SESSION["highlightSelected"] = $this->ini["highlightSelected"];
+        
+        // Highlight color for identify/search zoom in
+        if (isset($this->ini["highlightColor"])) {
+            $_SESSION["highlightColor"] = $this->ini["highlightColor"];
+        } else {
+            $_SESSION["highlightColor"] = "0, 255, 255";    // set to a default
+        }
+        
+        // Auto Zoom
+        $autoZoom = $this->ini["autoZoom"];
+        if (!preg_match ("/search|nquery|off/i", $autoZoom )) {
+            error_log ("P.MAPPER-ERROR: Wrong entry in '/config/config.ini' file for section 'autoZoom'. Can only be 'search', 'nquery' or 'off'", 0);
+            $autoZoom = "off";    // set to a default
+        }
+        $_SESSION["autoZoom"] = $autoZoom;
+        
+        // Zoom All Button
+        $zoomAll = $this->ini["zoomAll"];
+        if (!preg_match ("/search|nquery|off/i", $zoomAll )) {
+            error_log ("P.MAPPER-ERROR: Wrong entry in '/config/config.ini' file for section 'zoomAll'. Can only be 'search', 'nquery' or 'off'", 0);
+            $zoomAll = "off";    // set to a default
+        }
+        $_SESSION["zoomAll"] = $zoomAll;
+        
+        // Automatically sort result tables of queries
+        $_SESSION['alignQueryResults'] = $this->ini['alignQueryResults'];
+        
+        // WINDOW DESIGN: Query results (identify/search) in separate WINDOW or FRAME
+        $infoWin = $this->ini["infoWin"];
+        if (!preg_match ("/window|frame/", $infoWin))  {
+            error_log ("P.MAPPER-ERROR: Wrong entry in '/config/config.ini' file for section 'infoWin'. Must be either 'window' or 'frame'", 0);
+            $infoWin = "window";   // set to a default
+        }
+        $_SESSION["infoWin"] = $infoWin;
+        
+        
+        $_SESSION["layerAutoRefresh"] = $this->ini["layerAutoRefresh"];
+        
+        $_SESSION["pointBuffer"] = $this->ini["pointBuffer"];
+    
+    }
+    
+    
+
+   /**
+    * Settings for legend/TOC
+    *
+    */
+    function _initLegend()
+    {
+                // Style of CATEGORIES
+        $catStyle = strtolower($this->ini["catStyle"]);
+        if (!preg_match ("/flat|tree|Off/i", $catStyle)) {
+            error_log ("P.MAPPER-ERROR: Wrong entry in '/config/config.ini' file for section 'tocStyle'. Must be either 'flat', 'tree' or 'Off'", 0);
+            $catStyle = "Off";    // set to a default
+        }
+        $_SESSION["catStyle"] = $catStyle;     
+        
+        // Style of GROUPS
+        $grpStyle = strtolower($this->ini["grpStyle"]);
+        if (!preg_match ("/flat|tree|combi/i", $grpStyle)) {
+            error_log ("P.MAPPER-ERROR: Wrong entry in '/config/config.ini' file for section 'grpStyle'. Must be either 'flat', 'tree' or 'combi'", 0);
+            $grpStyle = "flat";    // set to a default
+        }
+        $_SESSION["grpStyle"] = $grpStyle;
+        
+        // Style of LEGEND
+        $legStyle = trim(strtolower($this->ini["legStyle"]));
+        if (!preg_match ("/^(attached|swap|popup)$/i", $legStyle)) {
+            error_log ("P.MAPPER-ERROR: Wrong entry in '/config/config.ini' file for section 'legStyle'. Must be either attached, swap, or popup", 0);
+            $legStyle = "attached";    // set to a default
+        }
+        $_SESSION["legStyle"] = $legStyle;
+
+        
+        // LAYERS UPDATED ACCORDING TO SCALE
+        $_SESSION["scaleLayers"] = $this->ini["scaleLayers"];
+        
+        // Use categories to thematically group layers 
+        $_SESSION["useCategories"] = $this->ini["useCategories"];
+        
+        
+        // ICON SIZE AND FORMAT
+        if (isset($this->ini["icoW"]) && isset($this->ini["icoH"])) {
+            $icoW = $this->ini["icoW"];  // Width in pixels
+            $icoH = $this->ini["icoH"];  // Height in pixels
+        } else {
+            $icoW = 18;
+            $icoH = 14;
+        }   
+        $_SESSION["icoW"] = $icoW;
+        $_SESSION["icoH"] = $icoH;
+        
+        // Image Format
+        if (isset($this->ini["imgFormat"])) {
+            $imgFormat = $this->ini["imgFormat"];
+        } else {
+            $imgFormat = "jpeg";
+        }
+        $_SESSION["imgFormat"] = $imgFormat;
+        $_SESSION["altImgFormat"] = $this->ini["altImgFormat"];
+        
+        
+        
+        /*** WRITES LEGEND ICONS ***/
+        
+        // Check if images have to be created
+        // => if map file is newer than last written log file
+        $writeNew = 0;
+        
+        $pwd = str_replace('\\', '/', getcwd());
+        $legPath = "$pwd/images/legend/";
+        $imgLogFile = $legPath.'createimg.log';
+        
+        if (!is_file($imgLogFile)) {
+            $writeNew = 1;
+        } else {
+            $mapfile_mtime = filemtime($this->mapFile);
+            $imglogfile_mtime = filemtime($imgLogFile);
+            if ($mapfile_mtime > $imglogfile_mtime) {
+                $writeNew = 1;
+            }
+        }
+        
+        // If necessary re-create legend icons
+        if ($writeNew == 1) {
+        
+            $this->map->selectOutputFormat($imgFormat);
+            $allLayers = $this->map->getAllLayerNames();
+            
+            
+            // Define background image for legend icons
+            $icoBGLayer = ms_newLayerObj($this->map);
+            $icoBGLayer->set("type", 2);
+            // Add class
+            $bgClass = ms_newClassObj($icoBGLayer);
+            $bgClStyle = ms_newStyleObj($bgClass);
+            $bgClStyle->color->setRGB(255, 255, 255);
+            $bgClStyle->outlinecolor->setRGB(180, 180, 180);
+        
+        
+            foreach ($allLayers as $layName) {
+                $qLayer = $this->map->getLayerByName($layName);
+        
+                // All layers but RASTER or ANNOTATION layers
+                //if ($qLayer->type < 3) {
+        
+                    $numclasses = $qLayer->numclasses;
+                    if ($numclasses > 0) {
+                        for ($cl=0; $cl < $numclasses; $cl++) {
+                            $class = $qLayer->getClass($cl);
+                            $clname = ($numclasses < 2 ? "" : $class->name);
+                            $clStyle = ms_newStyleObj($class);
+                            
+                            // Set outline for line themes to background color
+                            if ($qLayer->type == 1) {
+                               #$clStyle->setcolor("outlinecolor", 180, 180, 180);
+                               #$clStyle->outlinecolor->setRGB(180, 180, 180);
+                            }
+                            // set outline to main color if no outline defined (workaround for a bug in the icon creation)
+                            if ($qLayer->type == 2) {
+                                if ($clStyle->outlinecolor < 1) {
+                                   #$clStyle->setcolor("outlinecolor", $clStyle->color);
+                                   $clStyle->outlinecolor->setRGB($clStyle->color);
+                                }
+                            }
+            
+                            $icoImg = $class->createLegendIcon($icoW, $icoH);  // needed for ms 3.7
+                            $imgFile = $legPath.$layName.'_i'.$cl . '.'.$_SESSION["imgFormat"];
+            
+                            $icoUrl = $icoImg->saveImage($imgFile);
+                            $icoImg->free();
+                        }
+                    
+                    }
+                //}
+            }
+        
+        
+            $today = getdate();
+            $datestr =  $today['hours'].':'.$today['minutes'].':'.$today['seconds'].'; '.$today['mday'].'/'.$today['month'].'/'.$today['year'];
+        
+            $logStr = "Created legend icons newly on:  $datestr";
+            $imgLogFileFH = fopen ($imgLogFile, 'w+');
+            fwrite($imgLogFileFH, $logStr);
+            fclose($imgLogFileFH);
+        
+        }
+    }
+    
+   /**
+    * Get absolute data path from map file
+    *
+    */ 
+    function _initDataPath()
+    {
+        $shapepath = trim($this->map->shapepath);
+        
+        // absolute path in map file
+        if ($shapepath{0} == "/" || $shapepath{1} == ":") {
+            $_SESSION['datapath'] = str_replace('\\', '/', $shapepath);
+        
+        // relative path in map file, get absolute as combination of shapepath and map file location
+        } else {
+            $_SESSION['datapath'] = str_replace('\\', '/', realpath(dirname($_SESSION['PM_MAP_FILE']) . "/" . $shapepath) );
+        }
+    }
+    
+    
+   /**
+    * FUNCTION TO RETURN URL FOR MAPFRAME
+    * used for starting application with pre-defined extent
+    * extent read from shape features
+    */
+    function getMapInitURL($map, $zoomLayer, $zoomQuery) 
+    {
+        $qLayer = $this->map->getLayerByName($zoomLayer);
+        
+        // Query parameters
+        $queryList = split('@', $zoomQuery);
+        $queryField = $queryList[0];
+        $queryFieldType = $queryList[1];
+        //$queryValue = "/^" . $queryList[2] ."$/";
+        $queryValue = $queryList[2];
+        $highlFeature = $queryList[3];
+        $setMaxExtent = $queryList[4];
+        
+        // Modify filter for PostGIS & Oracle layers
+        if ($qLayer->connectiontype == 6 || $qLayer->connectiontype == 8) {
+            $q = $queryFieldType == 1 ? "'" : "";
+            $queryValue = "$queryField = $q$queryValue$q";
+            //error_log($queryValue);
+        }
+        
+        // Query layer
+        @$qLayer->queryByAttributes($queryField, $queryValue, MS_MULTIPLE);
+        $numResults = $qLayer->getNumResults();
+        $qLayer->open();
+        
+        // Return query results (SINGLE FEATURE): shape index and feature extent
+        /*
+        $qRes = $qLayer->getResult(0);
+        $qShape = $qLayer->getShape($qRes->tileindex,$qRes->shapeindex);
+        $qShpIdx = $qShape->index;
+        $qShpBounds = $qShape->bounds;
+        */
+        
+        // Check if layer has different projection than map
+        // if yes, re-project extent from layer to map projection 
+        $mapProjStr = $this->map->getProjection();
+        $qLayerProjStr = $qLayer->getProjection();
+        if ($mapProjStr && $qLayerProjStr && $mapProjStr != $qLayerProjStr) {
+            $mapProjObj = ms_newprojectionobj($mapProjStr);
+            $qLayerProjObj = ms_newprojectionobj($qLayerProjStr);
+            //$qShpBounds->project($this->qLayerProjObj, $this->mapProjObj);
+            $reprojectShape = 1;
+        }
+        
+        
+        // initial max/min values
+        $mExtMinx = 999999999;
+        $mExtMiny = 999999999;
+        $mExtMaxx = -999999999;
+        $mExtMaxy = -999999999;
+        
+        // Return query results: shape index and feature extent
+        for ($iRes=0; $iRes < $numResults; $iRes++) {
+            $qRes = $qLayer->getResult($iRes);
+            $qShape = $qLayer->getShape($qRes->tileindex,$qRes->shapeindex);
+        
+            $qShpIdx = $qShape->index;
+            $qShpBounds = $qShape->bounds;
+            if ($reprojectShape) {
+                $qShpBounds->project($qLayerProjObj, $mapProjObj);
+            }
+
+            $shpMinx = $qShpBounds->minx;
+            $shpMiny = $qShpBounds->miny;
+            $shpMaxx = $qShpBounds->maxx;
+            $shpMaxy = $qShpBounds->maxy;
+            
+            // Get max/min values of ALL features
+            $mExtMinx = min($mExtMinx, $shpMinx);
+            $mExtMiny = min($mExtMiny, $shpMiny);
+            $mExtMaxx = max($mExtMaxx, $shpMaxx);
+            $mExtMaxy = max($mExtMaxy, $shpMaxy);
+        }
+        
+        // Apply buffer (in units of features)
+        //$buffer = 20000;   // <<<<<<<<<<<<<<<<<<<<<< ADAPT VALUE <<<<<<<<<<<<<<<<<
+        $buffer = 0.05 * ((($mExtMaxx - $mExtMinx) + ($mExtMaxy - $mExtMiny)) / 2);
+        $mExtMinx -= $buffer;
+        $mExtMiny -= $buffer;
+        $mExtMaxx += $buffer;
+        $mExtMaxy += $buffer;
+        
+        $roundFact = ($map->units != 5 ? 0 : 6); 
+        $shpMinx = round($mExtMinx, $roundFact);
+        $shpMiny = round($mExtMiny, $roundFact);
+        $shpMaxx = round($mExtMaxx, $roundFact);
+        $shpMaxy = round($mExtMaxy, $roundFact);
+                        
+        $ext = array ($shpMinx, $shpMiny, $shpMaxx, $shpMaxy);
+        $_SESSION['zoom_extparams'] = $ext;
+        
+        
+        // Set Max Extent for map
+        if ($setMaxExtent) {
+            $mapMaxExt['minx'] = $shpMinx;
+            $mapMaxExt['miny'] = $shpMiny;
+            $mapMaxExt['maxx'] = $shpMaxx;
+            $mapMaxExt['maxy'] = $shpMaxy;
+            
+            $_SESSION['mapMaxExt'] = $mapMaxExt;
+        }
+
+        // Add highlight feature if defined in URL parameters
+        if ($highlFeature) {
+            $resultlayers[$zoomLayer] = array($qShpIdx); 
+            $_SESSION["resultlayers"] = $resultlayers;
+        }
+        
+        
+        // Return URL
+        $searchString = "&mode=map&zoom_type=zoomextent&extent=" . $shpMinx ."+". $shpMiny ."+". $shpMaxx ."+". $shpMaxy . ($highlFeature ? "&resultlayer=$zoomLayer+$qShpIdx" : ""); 
+        $mapInitURL = "map.phtml?$searchString";
+        
+        return $mapInitURL;
+    }
+    
+    
+   /**
+    * Calculate max scale for slider max settings (JS variable s1)
+    * works only for units dd or meters
+    */
+    function returnMaxScale($map, $mapheight)
+    {
+        $initExtent = $this->map->extent;
+        $y_dgeo = $initExtent->maxy - $initExtent->miny;
+        $scrRes = $this->map->resolution;
+        $this->mapUnits = $this->map->units;
+        
+        $y_dgeo_m = ($this->mapUnits == 5 ? $y_dgeo * 111120 : $y_dgeo);
+        
+        $maxScale = ($y_dgeo_m / $mapheight) / (0.0254 / $scrRes);
+        
+        return round($maxScale);
+    
+    }
+    
+    function returnXYGeoDimensions()
+    {
+        //$initExtent = $this->map->extent;
+        if (isset($_SESSION['mapMaxExt'])) {
+            $me = $_SESSION['mapMaxExt'];
+            $initExtent = ms_newrectObj();
+            $initExtent->setextent($me["minx"],$me["miny"],$me["maxx"],$me["maxy"]);
+        } else {
+            $initExtent = $this->map->extent;
+        }
+        
+        $dgeo['x'] = $initExtent->maxx - $initExtent->minx;
+        $dgeo['y'] = $initExtent->maxy - $initExtent->miny;
+        $dgeo['c'] = $this->map->units == 5 ? 111120 : 1;
+
+        return $dgeo;
+    }
+
+
+}
+
+?>

Added: incphp/init/startup.php
===================================================================
--- incphp/init/startup.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/init/startup.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,7 @@
+<?php
+
+
+
+
+
+?>
\ No newline at end of file

Added: incphp/initgroups.php
===================================================================
--- incphp/initgroups.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/initgroups.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,357 @@
+<?php
+/*********************************************************************************
+ Copyright (c) 2002-2005 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+/********************************************************************************
+ * INITIALIZE GROUPS AND GLAYERS AND SAVE DEFINITIONS IN SESSION
+ ********************************************************************************/
+
+require_once("group.php");
+
+
+class Init_groups
+{
+    var $map;
+    var $allGroups;
+    var $gLanguage;
+    var $map2unicode; 
+    
+    function Init_groups($map, $allGroups, $gLanguage, $map2unicode)
+    {
+        $this->map = $map;
+        $this->allGroups = $allGroups;
+        $this->gLanguage = $gLanguage;
+        $this->map2unicode = $map2unicode;
+
+        $initGroups = $this->_defineLists();
+        $this->_createGroups($initGroups);
+    
+    }
+    
+    
+    function _defineLists()
+    {
+        $groupOrder = $this->allGroups;
+        
+        $mapGroupsNames = $this->map->getAllGroupNames();
+        $mapLayers = $this->map->getAllLayerNames();
+        
+        // Create array for groups in map file
+        foreach ($mapGroupsNames as $mgn) {
+            $mapGroups[$mgn] = $this->map->getLayersIndexByGroup($mgn);
+        }
+        
+        //Add layers as groups if not assigned to any group
+        foreach($mapLayers as $l) {
+            $layer = $this->map->getLayerByName($l);
+            $layIdx = $layer->index;
+            $layGrp = $layer->group;
+            if ($layGrp == "") {
+                $mapGroups[$l] = array($layIdx);
+            }
+        }
+        
+        // Sort group array according to order of $groupOrder
+        foreach($groupOrder as $g) {
+            if (count($mapGroups[$g]) > 0) {
+                $initGroups[$g] =  $mapGroups[$g];
+            } else {
+                error_log("Could not create group '$g' defined in groupOrder in 'config.ini'. Check if name is correct.", 0);
+            }
+        }
+        
+        return $initGroups;
+    }   
+
+    
+   /**
+    * Initialize GROUPS
+    * set group and layer properties
+    *
+    */
+    function _createGroups($initGroups)
+    {
+
+        foreach ($initGroups as $gn=>$layerList) {
+            $group = new GROUP($gn);
+        
+            $i = 1;
+        
+            // Loop through LAYERS of current group
+            foreach ($layerList as $layIdx) {
+                // Get layer info from map file
+                $mapLay = $this->map->getLayer($layIdx);
+                $mapLayName = $mapLay->name;
+                $mapLayType = $mapLay->type;
+        
+                // Write layer properties to glayer object
+                $glayer = new GLAYER($mapLayName);
+                $glayer->setLayerIdx($layIdx);
+                $glayer->setLayerType($mapLayType);
+        
+                // Add result field list
+                if ($mapLayType <= 3 || $mapLayType == 5) {    // result fields only for queryable layers point (0), line (1), polygon (2), annotation (5)
+                    $selFields0 = $this->_initResultFields($this->map, $mapLay, $mapLayType);
+                    
+                    // Trim spaces
+                    if (count($selFields0) > 0) {
+                        $selFields = array();
+                        foreach ($selFields0 as $sf0) {
+                            // If field name starts with '&' then translate
+                            $sf = (substr(trim($sf0), 0, 1) == '&' ? _p(trim($sf0)) : trim($sf0));
+                            $selFields[] = $sf;
+                        }
+                        $glayer->setResFields($selFields);
+                    }
+                    
+                }
+                
+                // Add hyperlink fields
+                if ($this->_getHyperFieldList($mapLay)) {
+                    $glayer->setHyperFields($this->_getHyperFieldList($mapLay));
+                }
+                
+                // Add JOIN properties if defined
+                if ($this->_getJoinProperties($mapLay)) {
+                    $glayer->setTableJoin($this->_getJoinProperties($mapLay));
+                }
+                
+                // Add classes
+                $numclasses = $mapLay->numclasses;
+                $classes = array();
+                for ($cl=0; $cl < $numclasses; $cl++) {
+                    $class = $mapLay->getClass($cl);
+                    $className = $class->name;
+                    if ($this->map2unicode) $className = utf8_encode($className);
+                    $classname = _p(trim($className));
+                    $classes[] = $classname; //str_replace("'", "\\'", $classname);
+
+                }
+                $glayer->setClasses($classes);
+        
+        
+                // Check/Set labelitems if defined
+                if ($mapLay->labelitem) {
+                    $labelItem = _p($mapLay->labelitem);
+                    $glayer->setLabelItem($labelItem);
+                }
+                
+                
+                // Check/Set layer transparency (opacity)
+                $glayer->setTransparency($mapLay->transparency);
+                
+                
+                // Check if layer is XY layer
+                $XYLayerPropStr = $this->_returnMetaData($mapLay, "XYLAYER_PROPERTIES");
+                if ($XYLayerPropStr != "") {
+                    $glayer->setXYLayerAttribute();
+                    $XYLayerPropList = $this->_getXYLayerPropList($XYLayerPropStr);
+                    $glayer->setXYLayerProperties($XYLayerPropList);
+                    
+                    // Set in sessionid that XYLayer exists
+                    $_SESSION["existsXYLayer"] = 1;
+                
+                }
+                
+                //Check for skipLegend
+                // 1: only for TOC_TREE, 2: always skip legend
+                $skipLegend = $this->_returnMetaData($mapLay, "SKIP_LEGEND");
+                $skipLegend = ($skipLegend == "" ? 0 : $skipLegend);
+                $glayer->setSkipLegend($skipLegend);
+                
+                // Layer Encoding
+                $glayer->setLayerEncoding($this->_returnMetaData($mapLay, "LAYER_ENCODING"));                
+                
+                // now add layer to group
+                $group->addLayer($glayer);
+        
+                // set group description and result headers, process only for 1st layer of group
+                if ($i == 1) {
+                    // Set group description
+                    $description  = $this->_initDescription($mapLay);
+                    $group->setDescription($description);
+        
+                    // Set result group headers
+                    if ($mapLayType <= 3 || $mapLayType == 5) {
+                        $selHeaders  = $this->_initResultHeaders($this->map, $mapLay, $mapLayType, $this->gLanguage);
+                        $group->setResHeaders($selHeaders);
+                    }
+                    $i = 0;
+                }
+        
+            }
+            $grouplist[$gn] = $group;
+        }
+        
+        // Save everything in session
+        $_SESSION["grouplist"] = $grouplist;
+    
+    }
+    
+    
+    
+   /**
+    * Get layer description, result fields and headers from map file 
+    * or take default values if there's no definition in map file
+    */
+    
+    function _returnMetaData($layer, $metaTag) {
+        $metaString = $layer->getMetaData($metaTag);
+        return $metaString;
+    }
+    
+    
+    function _initResultFields($map, $mapLay, $mapLayType) {
+        $metaString = $this->_returnMetaData($mapLay, "RESULT_FIELDS");
+        
+        if ($metaString != "") {
+            $metaList = split(",", $metaString);
+        } else {
+            if ($mapLayType != 3) {
+                $mapLay->open();       
+                $metaList = $mapLay->getItems();
+            } else {
+                $metaList = array();
+            }
+        }
+        return $metaList;    
+    }
+    
+    
+    function _initResultHeaders($map, $mapLay, $mapLayType) {
+        $metaString = $this->_returnMetaData($mapLay, "RESULT_HEADERS");
+        
+        if ($metaString != "") {
+            $metaList0 = split(",", $metaString);
+            foreach ($metaList0 as $m) {
+                if ($this->map2unicode) $m = utf8_encode($m);
+                $metaList[] = _p(trim($m));
+            }
+            
+        } else {
+            if ($mapLayType != 3) {
+                $mapLay->open();       
+                $metaList = $mapLay->getItems();
+            } else {
+                $metaList = array();
+            }
+        }
+        return $metaList;    
+    }
+    
+    function _initDescription($mapLay) {
+        $metaString = $this->_returnMetaData($mapLay, "DESCRIPTION");
+        
+        if ($metaString != "") {
+            if ($this->map2unicode) $metaString = utf8_encode($metaString);
+            $descriptionTag = _p($metaString);
+        } else {
+            $descriptionTag = $mapLay->name;
+        }
+
+        return preg_replace(array("/\\\/", "/\|/"), array("", ""), trim($descriptionTag));  // ESCAPE APOSTROPHES (SINGLE QUOTES) IN NAME WITH BACKSLASH
+    }
+    
+    
+   /**
+    * CHECK FOR HYPERLINK FIELDS
+    * Check if hyperlink fields have been declared in map file
+    */
+    function _getHyperFieldList($glayer)
+    {
+        // First split string into field arrays, then the chunks into field name and alias for link
+        if ($hyperMeta = $glayer->getMetaData("RESULT_HYPERLINK")) {
+            $hyperStr = preg_split('/,/', $hyperMeta);
+            foreach ($hyperStr as $hs) {
+                if (preg_match ('/\|\|/', $hs)) {
+                    $hfa = preg_split('/\|\|/', $hs);
+                    $hyperAliasStr = trim($hfa[1]);
+                    if ($this->map2unicode) $hyperAliasStr = utf8_encode($hyperAliasStr);
+                    $hyperFieldsAlias[trim($hfa[0])] = _p($hyperAliasStr);
+                    $hyperFieldsValues[] = trim($hfa[0]);
+                } else {
+                    $hyperFieldsValues[] = trim($hs);
+                }
+            }
+            return array($hyperFieldsValues, $hyperFieldsAlias);
+        } else {
+            return NULL;
+        }
+    }
+    
+    
+   /**
+    * CHECK FOR DB JOINS
+    * Check if DB joins have been declared in map file
+    */
+    function _getXYLayerPropList($XLLayerMetaStr) 
+    {
+        $XYLayerList = preg_split("/\|\|/", $XLLayerMetaStr);
+        
+        $XYLayerProperties["dsn"] = $XYLayerList[0];
+        $XYLayerProperties["xyTable"] = $XYLayerList[1];
+                
+        $XYLayerFldList = preg_split("/,/", $XYLayerList[2]);
+        $XYLayerProperties["x_fld"]        = $XYLayerFldList[0];
+        $XYLayerProperties["y_fld"]        = $XYLayerFldList[1];
+        $XYLayerProperties["classidx_fld"] = $XYLayerFldList[2];
+        
+        return $XYLayerProperties;
+    }
+    
+    
+    
+   /**
+    * CHECK FOR DB JOINS
+    * Check if DB joins have been declared in map file
+    */
+    function _getJoinProperties($qLayer) 
+    {
+        if ($qLayer->getMetaData("RESULT_JOIN") != "") {
+            $joinStrMeta = $qLayer->getMetaData("RESULT_JOIN");
+            $joinList = preg_split("/\|\|/", $joinStrMeta);
+            
+            $joinPropList["dsn"] = $joinList[0];
+    
+            // Join table properties
+            $tableProp  = preg_split("/\@/", $joinList[1]);
+            $joinPropList["fromTable"]     = $tableProp[0];
+            $joinPropList["fromField"]     = $tableProp[1];
+            $joinPropList["fromFieldType"] = $tableProp[2];
+            $joinFieldStr = $tableProp[3];
+            $joinPropList["joinFields"] = $joinFieldStr;        
+    
+            // Field in Shapefile to join to
+            $joinPropList["toField"] =  $joinList[2];
+    
+            // Join type: one-to-one (0) or one-to-many (1)
+            $joinPropList["one2many"] = $joinList[3];
+            
+            return $joinPropList;
+        } else {
+            return NULL;
+        }
+    }
+
+
+} // class
+
+?>
\ No newline at end of file

Added: incphp/js_custom.php
===================================================================
--- incphp/js_custom.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/js_custom.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,80 @@
+<?php
+/****************************************************
+ some annotations in the correct locale have to be 
+ available directly from JavaScript
+ They are produced as associated array 'localeList'
+ creating the entries via PHP
+
+*****************************************************/
+
+session_start();
+$gLanguage = $_SESSION["gLanguage"];
+require_once($_SESSION['PM_INCPHP'] . "/common.php");
+require_once($_SESSION['PM_INCPHP'] . "/locale/language_" . $gLanguage . ".php");
+
+?>
+
+//<SCRIPT LANGUAGE="Javascript">
+
+<?php 
+include_once("js_locales.php")
+?>
+
+/*************************************************************************************/
+
+
+function createSearchOptions() {
+    var sStr = '';
+    sStr += '<td NOWRAP></td>';
+    sStr += '<td class="TDAC"><select name="findlist" onChange="createSearchInput()">';
+    sStr += '<option value="#"><?php echo _p("Search for") ?></option>';
+    for (var s in searchList) {
+        sStr += '<option value="' + s + '">' + searchList[s][0] + '</option>'; 
+    }
+    sStr += '</select></td><div id="searchInput"></div>';
+    //alert(sStr);
+    
+    document.getElementById('bottom1').innerHTML = sStr;
+     
+}
+
+
+function createSearchInput() {
+    var searchForm = document.getElementById("searchForm");
+    var searchItem = searchForm.findlist.options[searchForm.findlist.selectedIndex].value;
+    if (searchItem != '#') {
+        var paramList = searchList[searchItem];
+        var fieldStr = paramList[1];
+        var annoStr = paramList[2];
+
+        if (fieldStr.match(/&&/)) {
+            var fieldList = fieldStr.split('&&');
+            var annoList = annoStr.split('&&');
+        } else {
+            var fieldList = new Array(fieldStr);
+            var annoList = new Array(annoStr);
+        }
+        
+        var iStr = '';
+        for (var f=0; f<fieldList.length; f++) {
+            iStr += '<td>' + annoList[f] + '</td>';
+            iStr += '<td><input type=text name="' + fieldList[f] + '" size=15></td>';
+        }
+        iStr += '<td><input type="submit" value="' + localeList['Search'] + '" size=20  onsubmit="submitSearch()" onmouseover="changeButtonClr(this, \'over\')" onmouseout="changeButtonClr (this, \'out\')"></td>';
+        iStr += '<input type=hidden name="qlayer" value="' + searchItem + '">';
+        if (paramList[3].length > 1) {
+            iStr += '<input type=hidden name="dbtable" value="' + paramList[3] + '">';
+        }
+        
+        iStr += <?php echo ("'<input type=\"hidden\" name=\"" . ini_get("session.name") . "\" value=\"" . session_id() . "\">'") ?>;
+        
+        //alert(iStr);
+        document.getElementById('bottom2').innerHTML = iStr;
+        searchForm.findlist.options[0].selected = true; 
+    }
+}
+
+
+
+
+//</SCRIPT>
\ No newline at end of file

Added: incphp/js_locales.php
===================================================================
--- incphp/js_locales.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/js_locales.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,13 @@
+// ARRAY FOR ANNOTATIONS
+var localeList = new Object;
+localeList['Total']         = '<?php echo _pjs("Total") ?>';
+localeList['Segment']       = '<?php echo _pjs("Segment") ?>';
+localeList['Clear']         = '<?php echo _pjs("Clear") ?>';
+localeList['Area']          = '<?php echo _pjs("Area") ?>';
+localeList['Search']        = '<?php echo _pjs("Search") ?>';
+localeList['Maplink']       = '<?php echo _pjs("Link to this map") ?>';
+localeList['sessionExpired'] = '<?php echo _pjs("Session expired. Reloading application.") ?>';
+localeList['addLocation']   = '<?php echo _pjs("Add location description") ?>';
+localeList['addLocation']   = '<?php echo _pjs("Add location description") ?>';
+localeList['zoomSelected']  = '<?php echo _pjs("Zoom to Selected Features") ?>';
+localeList['noRecords']     = '<?php echo _pjs("No records found") ?>';

Added: incphp/js_preloadimages.php
===================================================================
--- incphp/js_preloadimages.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/js_preloadimages.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,94 @@
+<?php
+/****************************************************
+ some annotations in the correct locale have to be 
+ available directly from JavaScript
+ They are produced as associated array 'localeList'
+ creating the entries via PHP
+
+*****************************************************/
+include_once("group.php");
+session_start();
+
+
+function returnImgSrc()
+{
+    $grouplist = $_SESSION["grouplist"];
+    $allGroups = $_SESSION["allGroups"];
+    $imgFormat = $_SESSION["imgFormat"];
+    $scaleLayers = $_SESSION["scaleLayers"];
+
+    $legPath =  "images/legend/";
+     
+    foreach ($grouplist as $grp){
+                           
+        $glayerList = $grp->getLayers();
+        foreach ($glayerList as $glayer) {
+            //$legLayer = $map->getLayer($glayer->getLayerIdx());
+            $legLayerType = $glayer->getLayerType();
+            $skipLegend = $glayer->getSkipLegend();
+            $numClasses = count($glayer->getClasses());
+            
+            if (($legLayerType < 3 || $legIconPath || $numClasses > 1) && $skipLegend < 2) {
+                $legLayerName = $glayer->getLayerName();
+                
+                if ($legLayerType < 3 || $numClasses > 1) { 
+                    $classes = $glayer->getClasses();
+                } else {
+                    $classes = array($grpDescription);
+                }
+                
+                $clno = 0;
+                foreach ($classes as $cl) {
+                    if ($legLayerType < 3 || $numClasses > 0) { 
+                        $icoUrlList[] = $legPath.$legLayerName.'_i'.$clno.'.'.$imgFormat;
+                    }
+                    $clno++;
+                }
+            }
+        }
+    }
+    
+    $treeList = array("base.gif", "cd.gif", "empty.gif","folder.gif","folderopen.gif","globe.gif","imgfolder.gif", "join.gif","joinbottom.gif","layers.gif",   "layers0.gif","line.gif","minus.gif","minusbottom.gif","musicfolder.gif","nolines_minus.gif","nolines_plus.gif","page.gif","plus.gif","plusbottom.gif","question.gif","trash.gif");    
+    //printDebug($icoUrlList);
+    foreach ($treeList as $timg) {
+        $icoUrlList[] = "images/tree/$timg";
+    }
+    
+    
+    return $icoUrlList;
+}
+
+
+
+
+?>
+
+//<SCRIPT LANGUAGE="Javascript">
+
+function preloadImages() {
+    var imgUrlList = new Array();
+<?php 
+    $icoUrlList = returnImgSrc();
+    $i=0;  
+    foreach ($icoUrlList as $u) {
+        $js .= "imgUrlList[$i] = '$u;'\n";
+        $i++;
+    }
+    //$js .= "imgUrlList[$i++] = '$u;'\n";
+    //error_log($js);
+    echo $js;
+    echo ("var listCnt = 3;");
+?>
+    
+    var preload_image_object = new Image();
+    for(var i=0; i<=listCnt; i++) {
+        //alert(imgUrlList[i]);
+        preload_image_object.src = imgUrlList[i];
+        //if (!preload_image_object.complete) preload_image_object.src = imgUrlList[i];
+    }
+}
+
+
+
+//</SCRIPT>
+

Added: incphp/legend.php
===================================================================
--- incphp/legend.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/legend.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,318 @@
+<?php
+/********************************************************************************
+ Copyright (c) 2002-2005 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software. 
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+class Legend
+{
+    var $map;         
+    var $categories;  
+    var $legendonly;  
+    var $legPath; 
+    var $catStyle;    
+    var $grpStyle;    
+    var $legStyle;    
+    var $grouplist;   
+    var $defGroups;   
+    var $allGroups;
+    var $groups;    
+    var $icoW;        
+    var $icoH;        
+    var $imgFormat;   
+    var $scaleLayers; 
+    var $scale;       
+       
+    
+    function Legend($map, $categories=0, $legendonly=0)
+    {
+        $this->map         = $map;
+        $this->categories  = $categories;
+        $this->legendonly  = $legendonly;
+        $this->legPath     = "images/legend/";
+        
+        //$this->mutualDisableList = $_SESSION['mutualDisableList'];
+        $this->catStyle    = $_SESSION["catStyle"];
+        $this->grpStyle    = $_SESSION["grpStyle"];
+        $this->legStyle    = $_SESSION["legStyle"];
+        $this->grouplist   = $_SESSION["grouplist"];
+        $this->defGroups   = $_SESSION["defGroups"];
+        $this->allGroups   = $_SESSION["allGroups"];
+        $this->icoW        = $_SESSION["icoW"];  // Width in pixels
+        $this->icoH        = $_SESSION["icoH"];  // Height in pixels
+        $this->imgFormat   = $_SESSION["imgFormat"];
+        $this->scaleLayers = $_SESSION["scaleLayers"];
+        $this->scale       = $_SESSION['geo_scale'];
+    
+        // GET LAYERS FOR DRAWING AND IDENTIFY
+        if (isset ($_SESSION["groups"]) && count($_SESSION["groups"]) > 0){
+            $this->groups = $_SESSION["groups"];
+        } else {
+            $this->groups = $this->defGroups;
+        }    
+    }
+    
+    
+    function writeToc()
+    {
+        // Legend style POPUP: add 'show' button        
+        if ($this->legStyle == "popup" && !$this->legendonly) {    
+            $toc .= $this->printButton(_p("Show Legend"), "showPopupLegend()");         
+        } 
+        
+        // Legend stle SWAP: add 'show' button
+        if ($this->legStyle == "swap") {    
+            if (!$this->legendonly) {
+                $toc .=  $this->printButton(_p("Show Legend"), "swapToLegendView()");
+            } else {
+                $toc .=  $this->printButton(_p("Show Layers"), "swapToLayerView()");
+            }       
+        }
+        
+        $tabclass = $this->legendonly ? "class=\"legtab\"" : "";   
+        $catW     = $this->legStyle == "attached" ?  "100" : "98";
+        $toc .= "<table width=\"$catW%\" $tabclass cellspacing=\"0\" cellpadding=\"0\">";
+        
+        // using CATEGORIES
+        if ($this->categories && !$this->legendonly) {
+            $toc .= $this->_printCategory();
+        
+        // NO categories
+        } else {
+            foreach ($this->grouplist as $grp){
+                if ($this->legendonly) {
+                    if (in_array($grp->getGroupName(), $this->groups) && $this->checkGroup($this->map, $grp, $this->scale)) {
+                        $toc .= $this->_printGroup($grp);
+                    }
+                } else {
+                    $toc .= $this->_printGroup($grp);
+                }
+            }
+        }
+        
+        $toc .= "</table>";
+        
+        // Add dummy image for onLoad event to initialize tree or reset checkboxes of groups
+        if ((($this->grpStyle == "tree" && $this->legStyle == "attached") || $this->catStyle == "tree" ) && !$this->legendonly) {            
+            $toc .= "<script type=\"text/javascript\">treeInit(\"$this->catStyle\", \"$this->grpStyle\");</script>";
+        } elseif (!$this->legendonly) {            
+            $toc .= "<script type=\"text/javascript\">resetCheckedGroups();</script>";
+        }
+        return $toc;
+    }  
+    
+    
+    function printButton($value, $jsFunction) 
+    {
+        $bstr  = "<div class=\"TOOLFRAME\">";
+        $bstr .= "<input type=\"button\" value=\"$value\"  id=\"legbutton\" onclick=\"$jsFunction\"";  //style=\"margin:3px 0px 5px 0px;width:100%; height:22px\"
+        $bstr .= "onmouseover=\"changeButtonClr(this, \\'over\\')\" onmouseout=\"changeButtonClr (this, \\'out\\')\"";
+        $bstr .= " /></div>";  
+        return $bstr; 
+    }
+    
+    
+    
+    function _printCategory()
+    {
+        $cstr = "";
+        foreach ($this->categories as $cat=>$catL) {
+            $catDescr = addslashes(_p($cat));
+            $cstr .= "<tr>";
+            
+                // Add open/close icon for TREE style
+                if ($this->catStyle == "tree") {
+                    $cstr .= "<td class=\"opcl\"><img src=\"images/tree/plus.gif\" id=\"" . $cat . "_timg\" onclick=\"tg(\\'$cat\\')\" alt=\"*\" /></td>";
+                }
+                
+                $cstr .= "<th colspan=\"2\" class=\"cat\">";
+                
+                // Add open/close HREF for TREE style
+                if ($this->catStyle == "tree") {      
+                    $cstr .= "<a href=\"javascript:tg(\\'$cat\\')\">$catDescr</a>";
+                } else {
+                    $cstr .= "$catDescr";
+                }
+                
+                $cstr .= "</th>";
+                
+            $cstr .= "</tr>";
+            $cstr .= "<tr>";
+            $cstr .= "<td></td>";            
+            $cstr .= "<td><div class=\"catc\" id=\"$cat\">";
+            $cstr .= "<table class=\"TOC\"  width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">";
+            
+            foreach ($this->grouplist as $grp){
+                if (in_array($grp->groupName, $catL, TRUE)) {
+                    $cstr .= $this->_printGroup($grp);
+                }
+            }
+            $cstr .= "</table></div></td></tr>";
+        }
+        
+        return $cstr;
+    }
+    
+       
+
+    function _printGroup($grp)
+    {
+        $grpName = $grp->getGroupName();
+        $grpDescr = addslashes($grp->getDescription());
+        $glayerList = $grp->getLayers();
+        
+        // Settings for groups with raster layer without classes
+        $ltype = 0; 
+        $numClassesGrp = 0;       
+        foreach ($glayerList as $glayer) {
+            $skipLegend = $glayer->getSkipLegend();
+            $numClassesGrp += count($glayer->getClasses());
+            $legLayer = $this->map->getLayer($glayer->getLayerIdx());
+            //if ($legLayer->getMetadata("LEGENDICON")) $numClassesGrp += 1;
+        }
+        
+        $gstr .= "<tr>";
+        
+            // Add open/close IMG icon for TREE style
+            if ($this->grpStyle == "tree" && $this->legStyle == "attached" && !$this->legendonly) {
+                $ocImg = $numClassesGrp > 0 ? "plus" : "empty";
+                //error_log("$grpName  $ocImg");
+                $gstr .= "<td class=\"opcl\"><img alt=\"*\" src=\"images/tree/$ocImg.gif\" id=\"" . $grpName . "_timg\" onclick=\"tg(\\'$grpName\\')\" /></td>";
+            }
+            
+            // Add  <input type="checkbox"  >
+            if (!$this->legendonly) {
+                $gstr .= "<td class=\"cbx\"><input type=\"checkbox\" name=\"groupscbx\" value=\"$grpName\" id=\"ginput_$grpName\" onclick=\"javascript:setlayers(\\'$grpName\\')\" /></td>";
+                $grpcolspan = "";
+            } else {
+                $grpcolspan = " colspan=\"2\"";
+            }
+            
+            // Add open/close HREF for TREE style
+            $gstr .= "<th class=\"grp\" $grpcolspan>";
+            if ($this->grpStyle == "tree" && $this->legStyle == "attached" && !$this->legendonly && $numClassesGrp > 0) {      
+                $gstr .= "<a href=\"javascript:tg(\\'$grpName\\')\"><span class=\"vis\" id=\"spxg_$grpName\">$grpDescr</span></a>";
+                
+            } else {
+                $gstr .= "<span class=\"vis\" id=\"spxg_$grpName\">$grpDescr</span>";
+            }
+            $gstr .= "</th>";
+        
+        $gstr .= "</tr>";
+        
+        // Create CLASS entries for all LAYERS
+        if ($this->legStyle == "attached" || $this->legendonly) {
+            if (!$this->legendonly && $numClassesGrp > 0) {
+            // If not only legend and if group has classes: add DIV for tree
+                $colspan = ($this->grpStyle == "tree" ? 2 : 1);
+                $gstr .= "<tr>";
+                $gstr .= "<td colspan=\"$colspan\"></td>";
+                $gstr .= "<td>";
+                $gstr .= "<div class=\"grpc\" id=\"$grpName\">";
+                $gstr .= "<table width=\"100%\"  class=\"legtab\" cellspacing=\"0\" cellpadding=\"0\">";
+            }
+            
+            $count = 0;
+            foreach ($glayerList as $glayer) {
+                $legLayer = $this->map->getLayer($glayer->getLayerIdx());
+                $legLayerName = $legLayer->name;
+                $legLayerType = $legLayer->type;
+                $legIconPath = $legLayer->getMetadata("LEGENDICON");
+                $skipLegend = $glayer->getSkipLegend();
+                $numClassesLay = count($glayer->getClasses());
+                                            
+                // All layers but RASTER layers WITHOUT class definitions
+                if ((($legLayer->type < 3 && $skipLegend < 1) || $numClassesLay > 0) && $skipLegend != 2) {
+    
+                    $classes = $glayer->getClasses();
+                    $clno = 0;
+                    foreach ($classes as $cl) {
+                        $icoUrl = $this->legPath.$legLayerName.'_i'.$clno.'.'.$this->imgFormat;
+                        
+                        $gstr .= "<tr>";
+                        $gstr .= "<td style=\"width: " . $this->icoW . "px\"><img alt=\"legend\" src=\"$icoUrl\" width=\"$this->icoW\" height=\"$this->icoH\" /> </td>";
+                        $gstr .= "<td><span class=\"vis\" id=\"spxg_$grpName$count$clno\">" . addslashes($cl) . "</span></td>";
+                        $gstr .= "</tr> ";
+                        $clno++;
+                    }
+                    
+                    $totalClno += $clno;  // used for condition adding group to 'mainNodes' JS array (see below)
+                }
+                
+                $count++;
+            }
+            
+            if (!$this->legendonly && $numClassesGrp > 0) $gstr .= "</table></div></td></tr>";
+        }
+        
+        return $gstr;
+    
+    }
+
+
+
+    // CHECK IF GROUP HAS VISIBLE LAYER AT CURRENT SCALE
+    function checkGroup($map, $grp, $scale)
+    {
+        $printGroup = 0;
+        $glayerList = $grp->getLayers();
+        foreach ($glayerList as $glayer) {
+            $tocLayer = $map->getLayer($glayer->getLayerIdx());
+            if ((checkScale($map, $tocLayer, $scale) == 1) && $tocLayer->type != 5) {
+                $printGroup = 1;
+            }
+        }
+        return $printGroup;
+    }
+    
+    
+
+}
+
+
+
+
+function writeJSArrays()
+{
+    $mutualDisableList = $_SESSION['mutualDisableList'];   
+    if (count($mutualDisableList) > 0) {
+        $js_array = "var mutualDisableList = ['" . implode("','", $mutualDisableList) . "'];";
+    } else {
+        $js_array = "var mutualDisableList = false;";
+    }   
+    
+    if (isset($_SESSION["groups"]) && count($_SESSION["groups"]) > 0) {
+    	$defGroups   = $_SESSION["groups"];
+    }else{
+    	$defGroups   = $_SESSION["defGroups"];
+    }
+    
+    $js_array .= "\nvar defGroupList = ['ginput_" . implode("','ginput_", $defGroups) . "'];";
+
+
+    return $js_array;
+}
+
+
+
+
+
+
+
+?>

Added: incphp/locale/Copy of load.php
===================================================================
--- incphp/locale/Copy of load.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/locale/Copy of load.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,24 @@
+<?php
+
+dl('php_sqlite.dll');
+require_once 'language_de.php';
+
+
+$dsn = "d:/webdoc/data/sqlite/gisdb.db";
+
+$dbh = sqlite_open($dsn, 0777, $sqliteerror);
+
+
+
+foreach($_sl as $k => $s) {
+     
+     //$sql = "INSERT INTO locales(lang_key, lang_1) values('$k', '$s')";
+    $sql = "UPDATE locales set lang_0='$s'  WHERE lang_key='$k'";
+
+     $q = sqlite_query($dbh, $sql);
+
+
+}
+
+//echo "finished";
+?>

Added: incphp/locale/Copy of localedb.db
===================================================================
(Binary files differ)


Property changes on: incphp/locale/Copy of localedb.db
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: incphp/locale/extract_locales.php
===================================================================
--- incphp/locale/extract_locales.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/locale/extract_locales.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,48 @@
+<?php
+
+
+
+if (!extension_loaded('php_pdo')) {
+        //if (!dl(stristr(PHP_OS, "WIN") ? "php_pdo.dll" : "php_pdo.so"))
+        //    exit("Could not load the SQLite extension.\n");
+}
+
+// Load SQLite extension 
+if (!extension_loaded('sqlite')) {
+        if (!dl(stristr(PHP_OS, "WIN") ? "php_sqlite.dll" : "sqlite.so"))
+            exit("Could not load the SQLite extension.\n");
+}
+
+$langList = array("en", "de", "it", "fr", "se", "nl");
+    
+$dsn = "localedb.db";
+$dbh = sqlite_open($dsn, 0666, $sqliteerror);
+
+foreach ($langList as $lang) {
+    //$sql = "SELECT base, $lang  FROM locales";
+    $sql = "SELECT base, $lang  FROM locales ORDER BY UPPER(base)";
+    
+    $rstr = '<?php' . "\n";
+    
+    $q = sqlite_query($dbh, $sql); 
+    $rows = array(); 
+    while ($r = sqlite_fetch_array($q)) { 
+        //$rstr .= $r[0] . " @@ " . $r[1] . "\n";
+        if (strlen($r[1]) > 0) { 
+            $rstr .= '$_sl["' . $r[0] . '"] = "' . $r[1] . '";' . "\n"; 
+        }
+    }
+    
+    $rstr .= "\n" . '?>';
+    //echo $rstr;
+    
+    $fh = fopen("language_$lang.php", "w+");
+    //$fh = fopen("language_$lang.txt", "w+");
+    //fwrite($fh, $rstr);    // keep output in ISO-8859-1
+    fwrite($fh, utf8_encode($rstr));  // Encode output to UTF-8
+    fclose($fh);    
+}
+
+sqlite_close($dbh);
+
+?>
\ No newline at end of file

Added: incphp/locale/language_de.php
===================================================================
--- incphp/locale/language_de.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/locale/language_de.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,131 @@
+<?php
+$_sl["Add location description"] = "Ortsbeschreibung hinzufügen";
+$_sl["Add Point of Interest"] = "Punkt hinzufügen";
+$_sl["Administrative Entity"] = "Verwaltungseinheit";
+$_sl["Agriculture, with natural vegetation"] = "Landwirstschaftlich genutztes Land mit natuerlicher Vegetation";
+$_sl["Agro-forestry areas"] = "Land- und forstwirschftliche Flächen";
+$_sl["Annual crops associated with permanent crops"] = "Einjährige Kulturen in Verbindung mit Dauerkulturen";
+$_sl["Area"] = "Fläche";
+$_sl["BACK"] = "ZURÃœCK";
+$_sl["Back"] = "Zurück";
+$_sl["Bare rock"] = "Felsflächen ohne Vegetation";
+$_sl["Beaches, dunes, and sand plains"] = "Strände, Dünen und Sandflächen";
+$_sl["Broad-leaved forest"] = "Laubwälder";
+$_sl["Burnt areas"] = "Brandflächen";
+$_sl["cat_admin"] = "Verwaltungsdaten";
+$_sl["cat_nature"] = "Naturräumliche Daten";
+$_sl["cat_raster"] = "Rasterdaten";
+$_sl["cat_satimages"] = "Satellitenbilder";
+$_sl["cat_srtm"] = "SRTM Daten";
+$_sl["Cities"] = "Städte";
+$_sl["City"] = "Stadt";
+$_sl["Clear"] = "Löschen";
+$_sl["Coastal lagoons"] = "Lagunen";
+$_sl["Coastlines"] = "Küstenlinie";
+$_sl["Commune"] = "Gemeinde";
+$_sl["Communes"] = "Gemeinden";
+$_sl["Complex cultivation patterns"] = "Komplexe Parzeilenstrukturen";
+$_sl["Coniferous forest"] = "Nadelwälder";
+$_sl["Copy Path"] = "Pfad kopieren";
+$_sl["Countries"] = "Länder";
+$_sl["Country"] = "Land";
+$_sl["Create PDF Document"] = "PDF Dokument ezeugen";
+$_sl["Create Print Page"] = "Seite für den Druck erstellen";
+$_sl["Description"] = "Beschreibung";
+$_sl["Digital Elevation Model"] = "Digitales Höhenmodell";
+$_sl["Digital Terrain Model"] = "Digitales Geländemodell";
+$_sl["Digitize"] = "Digitalisieren";
+$_sl["Display Limit"] = "Darstellungs-Limit";
+$_sl["Estuaries"] = "Mündungsgebiete";
+$_sl["EU Satellite Coverage"] = "EU Satellitenbild-Mosaik";
+$_sl["Forward"] = "Vorwärts";
+$_sl["Fruit trees and berry plantations"] = "Obst- und Beerenobstbestände";
+$_sl["Geo-data source"] = "Geodaten-Quelle";
+$_sl["Glaciers and perpetual snow"] = "Gletscher und Dauerschneegebiete";
+$_sl["Help"] = "Hilfe";
+$_sl["Hide Legend"] = "Legende ausblenden";
+$_sl["Hydrography"] = "Hydrographie";
+$_sl["ID"] = "ID";
+$_sl["Identify"] = "Information";
+$_sl["Images"] = "Bilder";
+$_sl["Infrastructure"] = "Infrastruktur";
+$_sl["Inhabitants"] = "Einwohner";
+$_sl["Inland marshes"] = "Sümpfe";
+$_sl["Intertidal flats"] = "In der Gezeitenzone liegende Flächen";
+$_sl["Lakes"] = "Seen";
+$_sl["Large"] = "Groß";
+$_sl["Layer"] = "Layer";
+$_sl["Layers"] = "Layer";
+$_sl["Legend"] = "Legende";
+$_sl["Length"] = "Länge";
+$_sl["Link on detail"] = "Link auf Detail";
+$_sl["Link to current map"] = "Link zur aktuellen Karte";
+$_sl["Load WMS Service"] = "WMS Service laden";
+$_sl["Map Resolution for Download"] = "Kartenauflösung für Download";
+$_sl["Map window size"] = "Größe des Kartenfensters";
+$_sl["Measure"] = "Messen";
+$_sl["Medium"] = "Mittel";
+$_sl["Mixed forest"] = "Mischwälder";
+$_sl["Moors and heathland"] = "Heiden und Moorheiden";
+$_sl["Name"] = "Name";
+$_sl["Natural grassland"] = "Natürliches Grünland";
+$_sl["Navigation"] = "Navigation";
+$_sl["NEXT"] = "WEITER";
+$_sl["No data"] = "Keine Daten";
+$_sl["No records found"] = "Keine Einträge gefunden";
+$_sl["Non-irrigated arable land"] = "Nicht bewässertes Ackerland";
+$_sl["Olive groves"] = "Olivenhaine";
+$_sl["On map click"] = "Bei Klick in die Karte";
+$_sl["Pan"] = "Verschieben";
+$_sl["Pastures"] = "Wiesen und Weiden";
+$_sl["Peatbogs"] = "Torfmoore";
+$_sl["Permanently irrigated land"] = "Regelmässig bewässertes Ackerland";
+$_sl["Print Map"] = "Karte drucken";
+$_sl["Print Settings"] = "Druck-Einstellungen";
+$_sl["Print Title"] = "Drucktitel";
+$_sl["Print View"] = "Druckansicht";
+$_sl["Query Results"] = "Abfrageergebnisse";
+$_sl["records exceeded"] = " Einträgen überschritten. Weitere Einträge wurden nicht dargestellt.";
+$_sl["Refresh Map"] = "Karte aktualisieren";
+$_sl["Restrict Search to Map Extent"] = "Suche auf Kartenausschnitt beschränken";
+$_sl["Rice fields"] = "Reisfelder";
+$_sl["Rivers"] = "Flüsse";
+$_sl["Run Search"] = "Suche starten";
+$_sl["Salines"] = "Salinen";
+$_sl["Salt-marshes"] = "Salzwiesen";
+$_sl["Scale"] = "Maßstab";
+$_sl["Sclerophyllous vegetation"] = "Hartlaubbewuchs";
+$_sl["Sea and ocean"] = "Meere und Ozeane";
+$_sl["Search"] = "Suche";
+$_sl["Search for"] = "Suche nach...";
+$_sl["Search Image"] = "Bild suchen";
+$_sl["Search results for layer"] = "Suchergebnisse für Layer ";
+$_sl["Segment"] = "Segment";
+$_sl["Select"] = "Selektieren";
+$_sl["Select Image Format"] = "WMS Bildformat wählen";
+$_sl["Select/Search limit of"] = "Selektions-/Such-Limit von";
+$_sl["Selection for Layer"] = "Selektieren für Layer";
+$_sl["Set Scale"] = "Maßstab wählen";
+$_sl["Settlements"] = "Ortschaften";
+$_sl["Show"] = "anzeigen";
+$_sl["Show Layers"] = "Layeransicht einschalten";
+$_sl["Show Legend"] = "Legende anzeigen";
+$_sl["Site"] = "Gebiet";
+$_sl["Slope"] = "Hangneigung";
+$_sl["Small"] = "Klein";
+$_sl["Sparsely vegetated areas"] = "Flächen mit spärlicher Vegetation";
+$_sl["Start Search"] = "Suche starten";
+$_sl["Total"] = "Gesamt";
+$_sl["Transitional woodland-shrub"] = "Wald-Strauch-Ãœbergangsstadien";
+$_sl["Urban and industrial fabric"] = "Durchgängig städtische Prägung";
+$_sl["Vineyards"] = "Weinbauflächen";
+$_sl["Water bodies"] = "Gewässer";
+$_sl["With Overview Map"] = "Mit Ãœbersichtskarte";
+$_sl["Zoom"] = "Zoom";
+$_sl["Zoom in"] = "Hineinzoomen";
+$_sl["Zoom out"] = "Herauszoomen";
+$_sl["Zoom to All Features Found"] = "Zoom auf alle gefundenen Elemente";
+$_sl["Zoom To Full Extent"] = "Zoom maximal";
+$_sl["Zoom to Selected Features"] = "Zoom auf alle selektierten Elemente";
+
+?>
\ No newline at end of file

Added: incphp/locale/language_en.php
===================================================================
--- incphp/locale/language_en.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/locale/language_en.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,9 @@
+<?php
+$_sl["cat_admin"] = "Administrative Data";
+$_sl["cat_nature"] = "Nature-spatial Data";
+$_sl["cat_raster"] = "Raster Data";
+$_sl["cat_satimages"] = "Satellite Imagery";
+$_sl["cat_srtm"] = "SRTM data";
+$_sl["records exceeded"] = " records exceeded. Subsequent records not displayed.";
+
+?>
\ No newline at end of file

Added: incphp/locale/language_fr.php
===================================================================
--- incphp/locale/language_fr.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/locale/language_fr.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,132 @@
+<?php
+$_sl["Add location description"] = "Ajout d'une description de la localité";
+$_sl["Add Point of Interest"] = "Ajout d'un lieu remarquable";
+$_sl["Administrative Entity"] = "Unité administrative";
+$_sl["Agriculture, with natural vegetation"] = "L'agriculture, avec végétation naturelle";
+$_sl["Agro-forestry areas"] = "Territoires agro-forestiers";
+$_sl["Annual crops associated with permanent crops"] = "Cultures annuelles associées aux cultures permanentes";
+$_sl["Area"] = "Surface";
+$_sl["BACK"] = "PRÉCÉDENT";
+$_sl["Back"] = "Précédent";
+$_sl["Bare rock"] = "Roches nues";
+$_sl["Beaches, dunes, and sand plains"] = "Plages, dunes, sable";
+$_sl["Broad-leaved forest"] = "Forêts de feuillus";
+$_sl["Burnt areas"] = "Zones incendiées";
+$_sl["cat_admin"] = "Données administratives";
+$_sl["cat_nature"] = "Ressources naturelles";
+$_sl["cat_raster"] = "Données raster";
+$_sl["cat_satimages"] = "Images satellite";
+$_sl["cat_srtm"] = "Données SRTM";
+$_sl["Cities"] = "Villes";
+$_sl["City"] = "Ville";
+$_sl["Clear"] = "Annuler";
+$_sl["Coastal lagoons"] = "Lagunes littorales";
+$_sl["Coastlines"] = "Côte";
+$_sl["Commune"] = "Commune";
+$_sl["Communes"] = "Communes";
+$_sl["Complex cultivation patterns"] = "Systèmes culturaux et parcellaires complexes";
+$_sl["Coniferous forest"] = "Forêts de conifères";
+$_sl["Copy Path"] = "Copier le chemin";
+$_sl["Countries"] = "Pays";
+$_sl["Country"] = "Pays";
+$_sl["Create PDF Document"] = "Créer un document PDF";
+$_sl["Create Print Page"] = "Créer la page d'impression";
+$_sl["Description"] = "Description";
+$_sl["Digital Elevation Model"] = "Modèle numérique d'élévation";
+$_sl["Digital Terrain Model"] = "Modèle numérique de terrain";
+$_sl["Digitize"] = "Numériser";
+$_sl["Display Limit"] = "Nb d'enregistrements par page";
+$_sl["Download"] = "Télécharger";
+$_sl["Estuaries"] = "Estuaires";
+$_sl["EU Satellite Coverage"] = "Mosaïque d'images satellite de l'UE";
+$_sl["Forward"] = "Suivant";
+$_sl["Fruit trees and berry plantations"] = "Vergers et petits fruits";
+$_sl["Geo-data source"] = "Source des données spatiales";
+$_sl["Glaciers and perpetual snow"] = "Glaciers et neiges éternelles";
+$_sl["Help"] = "Aide";
+$_sl["Hide Legend"] = "Cacher la légende";
+$_sl["Hydrography"] = "Hydrograhie";
+$_sl["ID"] = "ID";
+$_sl["Identify"] = "Informations";
+$_sl["Images"] = "Images";
+$_sl["Infrastructure"] = "Infrastructure";
+$_sl["Inhabitants"] = "Habitants";
+$_sl["Inland marshes"] = "Marais intérieurs";
+$_sl["Intertidal flats"] = "Zones intertidales";
+$_sl["Lakes"] = "Lacs";
+$_sl["Large"] = "Grand";
+$_sl["Layer"] = "Couche";
+$_sl["Layers"] = "Couches";
+$_sl["Legend"] = "Légende";
+$_sl["Length"] = "Distance";
+$_sl["Link on detail"] = "Lien pour plus de détails";
+$_sl["Link to current map"] = "Lien vers la carte courante";
+$_sl["Load WMS Service"] = "Charger un service WMS";
+$_sl["Map Resolution for Download"] = "Résolution de la carte à télécharger";
+$_sl["Map window size"] = "Taille de la fenêtre";
+$_sl["Measure"] = "Mesurer";
+$_sl["Medium"] = "Moyen";
+$_sl["Mixed forest"] = "Forêts mélangées";
+$_sl["Moors and heathland"] = "Landes et broussailles";
+$_sl["Name"] = "Nom";
+$_sl["Natural grassland"] = "Pelouses et pâturages naturels";
+$_sl["Navigation"] = "Navigation";
+$_sl["NEXT"] = "SUIVANT";
+$_sl["No data"] = "Pas de données";
+$_sl["No records found"] = "Aucun résultat trouvé";
+$_sl["Non-irrigated arable land"] = "Terres arables hors périmètres d'irrigation";
+$_sl["Olive groves"] = "Oliveraies";
+$_sl["On map click"] = "Cliquer sur la carte";
+$_sl["Pan"] = "Recadrage";
+$_sl["Pastures"] = "Prairies";
+$_sl["Peatbogs"] = "Tourbière";
+$_sl["Permanently irrigated land"] = "Périmètres irrigués en permanence";
+$_sl["Print Map"] = "Imprimer la carte";
+$_sl["Print Settings"] = "Paramètres d'impression";
+$_sl["Print Title"] = "Titre de l'impression";
+$_sl["Print View"] = "Fenêtre d'impression";
+$_sl["Query Results"] = "Résultats de la requête";
+$_sl["records exceeded"] = ". Les enregistrements supplémentaires ne sont pas affichés.";
+$_sl["Refresh Map"] = "Rafraîchir la vue";
+$_sl["Restrict Search to Map Extent"] = "Limiter la recherche à la zone affichée";
+$_sl["Rice fields"] = "Rizières";
+$_sl["Rivers"] = "Cours d'eau";
+$_sl["Run Search"] = "Lancer la recherche";
+$_sl["Salines"] = "Marais salants";
+$_sl["Salt-marshes"] = "Marais maritimes";
+$_sl["Scale"] = "Échelle";
+$_sl["Sclerophyllous vegetation"] = "Végétations schlérophyles";
+$_sl["Sea and ocean"] = "Mer et océan";
+$_sl["Search"] = "Rechercher";
+$_sl["Search for"] = "Chercher...";
+$_sl["Search Image"] = "Recherche d'images";
+$_sl["Search results for layer"] = "Résultats de la recherche sur cette couche";
+$_sl["Segment"] = "Segment";
+$_sl["Select"] = "Sélectionner";
+$_sl["Select Image Format"] = "Sélection du format d'image";
+$_sl["Select/Search limit of"] = "Limites de la recherche";
+$_sl["Selection for Layer"] = "Sélection pour la couche";
+$_sl["Set Scale"] = "Échelle";
+$_sl["Settlements"] = "Agglomérations";
+$_sl["Show"] = "Afficher";
+$_sl["Show Layers"] = "Afficher la liste des couches";
+$_sl["Show Legend"] = "Afficher la légende";
+$_sl["Site"] = "Site";
+$_sl["Slope"] = "Pente";
+$_sl["Small"] = "Petit";
+$_sl["Sparsely vegetated areas"] = "Végétation clairsemée";
+$_sl["Start Search"] = "Lancer la recherche";
+$_sl["Total"] = "Total";
+$_sl["Transitional woodland-shrub"] = "Forêts et végétation arbustive en mutation";
+$_sl["Urban and industrial fabric"] = "Tissu urbain continu";
+$_sl["Vineyards"] = "Vignobles";
+$_sl["Water bodies"] = "Cours et voies d'eau";
+$_sl["With Overview Map"] = "Avec carte d'aide à la localisation";
+$_sl["Zoom"] = "Zoom";
+$_sl["Zoom in"] = "Zoom avant";
+$_sl["Zoom out"] = "Zoom arrière";
+$_sl["Zoom to All Features Found"] = "Zoom sur tous les éléments trouvés";
+$_sl["Zoom To Full Extent"] = "Zoom sur l'ensemble des données";
+$_sl["Zoom to Selected Features"] = "Zoom sur tous les éléments sélectionnés";
+
+?>
\ No newline at end of file

Added: incphp/locale/language_it.php
===================================================================
--- incphp/locale/language_it.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/locale/language_it.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,131 @@
+<?php
+$_sl["Add location description"] = "Aggiungere descrizione della località";
+$_sl["Add Point of Interest"] = "Marca un punto di interesse";
+$_sl["Administrative Entity"] = "Unità amministrativa";
+$_sl["Agriculture, with natural vegetation"] = "Agricoltura, con vegetazione naturale";
+$_sl["Agro-forestry areas"] = "Aree agroforestali";
+$_sl["Annual crops associated with permanent crops"] = "Colture temporanee associate a colture permanenti";
+$_sl["Area"] = "Area";
+$_sl["BACK"] = "INDIETRO";
+$_sl["Back"] = "Vai indietro";
+$_sl["Bare rock"] = "Rocce nude";
+$_sl["Beaches, dunes, and sand plains"] = "Spiagge, dune e sabbie";
+$_sl["Broad-leaved forest"] = "Boschi di latifoglie";
+$_sl["Burnt areas"] = "Aree percorse da incendi";
+$_sl["cat_admin"] = "Dati amministrativi";
+$_sl["cat_nature"] = "Dati naturali-spaziali";
+$_sl["cat_raster"] = "Dati raster";
+$_sl["cat_satimages"] = "Immagini satellitari";
+$_sl["cat_srtm"] = "Dati SRTM";
+$_sl["Cities"] = "Città";
+$_sl["City"] = "Città";
+$_sl["Clear"] = "Cancella";
+$_sl["Coastal lagoons"] = "Lagune";
+$_sl["Coastlines"] = "Costa";
+$_sl["Commune"] = "Comune";
+$_sl["Communes"] = "Comuni";
+$_sl["Complex cultivation patterns"] = "Sistemi colturali e particellari complessi";
+$_sl["Coniferous forest"] = "Boschi di conifere";
+$_sl["Copy Path"] = "Copia percorso";
+$_sl["Countries"] = "Nazioni";
+$_sl["Country"] = "Paese";
+$_sl["Create PDF Document"] = "Crea documento PDF";
+$_sl["Create Print Page"] = "Crea pagina di stampa";
+$_sl["Description"] = "Descrizione";
+$_sl["Digital Elevation Model"] = "Modello di elevazione digitale";
+$_sl["Digital Terrain Model"] = "Modello di terreno digitale";
+$_sl["Digitize"] = "Digitalizzare";
+$_sl["Display Limit"] = "Limite di visualizzazione";
+$_sl["Estuaries"] = "Estuari";
+$_sl["EU Satellite Coverage"] = "Mosaico immagini satellitari della UE";
+$_sl["Forward"] = "Vai avanti";
+$_sl["Fruit trees and berry plantations"] = "Frutteti e frutti minori";
+$_sl["Geo-data source"] = "Sorgente geodati";
+$_sl["Glaciers and perpetual snow"] = "Ghiacciai e nevi perenni";
+$_sl["Help"] = "Aiuto";
+$_sl["Hide Legend"] = "Nascondi legenda";
+$_sl["Hydrography"] = "Idrografia";
+$_sl["ID"] = "ID";
+$_sl["Identify"] = "Identifica";
+$_sl["Images"] = "Immagini";
+$_sl["Infrastructure"] = "Infrastruttura";
+$_sl["Inhabitants"] = "Abitanti";
+$_sl["Inland marshes"] = "Paludi interne";
+$_sl["Intertidal flats"] = "Zone intertidali";
+$_sl["Lakes"] = "Laghi";
+$_sl["Large"] = "Grande";
+$_sl["Layer"] = "Livello";
+$_sl["Layers"] = "Livelli";
+$_sl["Legend"] = "Legenda";
+$_sl["Length"] = "Lunghezza";
+$_sl["Link on detail"] = "Link sul dettaglio";
+$_sl["Link to current map"] = "Link sulla mappa attuale";
+$_sl["Load WMS Service"] = "Caricare un servizio WMS";
+$_sl["Map Resolution for Download"] = "Risoluzione per il download";
+$_sl["Map window size"] = "Larghezza finestra mappa";
+$_sl["Measure"] = "Misurare";
+$_sl["Medium"] = "Media";
+$_sl["Mixed forest"] = "Boschi misti";
+$_sl["Moors and heathland"] = "Brughiere e cespuglieti";
+$_sl["Name"] = "Nome";
+$_sl["Natural grassland"] = "Aree a pascolo naturale e praterie";
+$_sl["Navigation"] = "Navigazione";
+$_sl["NEXT"] = "AVANTI";
+$_sl["No data"] = "Nessun dato";
+$_sl["No records found"] = "Nessun dato trovato";
+$_sl["Non-irrigated arable land"] = "Seminativi in aree non irrigue";
+$_sl["Olive groves"] = "Oliveti";
+$_sl["On map click"] = "Cliccando nella mappa";
+$_sl["Pan"] = "Spostare";
+$_sl["Pastures"] = "Pascoli";
+$_sl["Peatbogs"] = "Torbiere";
+$_sl["Permanently irrigated land"] = "Seminativi in aree irrigue";
+$_sl["Print Map"] = "Stampa mappa";
+$_sl["Print Settings"] = "Impostazioni di stampa";
+$_sl["Print Title"] = "Titolo di stampa";
+$_sl["Print View"] = "Vista di stampa";
+$_sl["Query Results"] = "Risultati della richiesta";
+$_sl["records exceeded"] = " . Altri records non visualizzati.";
+$_sl["Refresh Map"] = "Rigenera mappa";
+$_sl["Restrict Search to Map Extent"] = "Restringere la ricerca sull'estensione della mappa";
+$_sl["Rice fields"] = "Risaie";
+$_sl["Rivers"] = "Fiumi";
+$_sl["Run Search"] = "Effetua ricerca";
+$_sl["Salines"] = "Saline";
+$_sl["Salt-marshes"] = "Paludi salmastre";
+$_sl["Scale"] = "Scala";
+$_sl["Sclerophyllous vegetation"] = "Aree a vegetazione sclerofilla";
+$_sl["Sea and ocean"] = "Mari e oceani";
+$_sl["Search"] = "Ricerca";
+$_sl["Search for"] = "Ricerca per...";
+$_sl["Search Image"] = "Ricerca immagine";
+$_sl["Search results for layer"] = "Risultati della ricerca per il layer ";
+$_sl["Segment"] = "Segmento";
+$_sl["Select"] = "Selezionare";
+$_sl["Select Image Format"] = "Selezionare formato immagine";
+$_sl["Select/Search limit of"] = "Limite di selezione/ricerca";
+$_sl["Selection for Layer"] = "Selezionare per livello";
+$_sl["Set Scale"] = "Seleziona scala";
+$_sl["Settlements"] = "Località";
+$_sl["Show"] = "mostra";
+$_sl["Show Layers"] = "Mostra i livelli";
+$_sl["Show Legend"] = "Mostra la legenda";
+$_sl["Site"] = "Sito";
+$_sl["Slope"] = "Clivometria";
+$_sl["Small"] = "Piccolo";
+$_sl["Sparsely vegetated areas"] = "Aree con vegetazione rada";
+$_sl["Start Search"] = "Avvia ricerca";
+$_sl["Total"] = "Totale";
+$_sl["Transitional woodland-shrub"] = "Aree a vegetazione boschiva ed arbustiva in evoluzione";
+$_sl["Urban and industrial fabric"] = "Zone residenziali a tessuto continuo";
+$_sl["Vineyards"] = "Vigneti";
+$_sl["Water bodies"] = "Corsi e bacini d'acqua";
+$_sl["With Overview Map"] = "Con mappa di vista generale";
+$_sl["Zoom"] = "Zoom";
+$_sl["Zoom in"] = "Ingrandire";
+$_sl["Zoom out"] = "Ridurre";
+$_sl["Zoom to All Features Found"] = "Zoom su tutti gli elementi trovati";
+$_sl["Zoom To Full Extent"] = "Zoom estensione massima";
+$_sl["Zoom to Selected Features"] = "Zoom sugli elementi selezionati";
+
+?>
\ No newline at end of file

Added: incphp/locale/language_nl.php
===================================================================
--- incphp/locale/language_nl.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/locale/language_nl.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,131 @@
+<?php
+$_sl["Add location description"] = "Voeg een Plaatsbeschrijving toe";
+$_sl["Add Point of Interest"] = "Nuttige plaats toevoegen";
+$_sl["Administrative Entity"] = "Administratieve Eenheid";
+$_sl["Agro-forestry areas"] = "Agro-forestry gebieden";
+$_sl["Annual crops associated with permanent crops"] = "Eenjarige gewassen";
+$_sl["Area"] = "Oppervlak";
+$_sl["BACK"] = "TERUG";
+$_sl["Back"] = "Terug";
+$_sl["Bare rock"] = "Onbegroeide rotsen";
+$_sl["Broad-leaved forest"] = "Loofbos";
+$_sl["Burnt areas"] = "Afgebrande gebieden";
+$_sl["cat_admin"] = "Adminitratieve Gegevens";
+$_sl["cat_nature"] = "Natuurlijke Hulpbronnen";
+$_sl["cat_raster"] = "Rastergegevens";
+$_sl["cat_satimages"] = "Satellietbeelden";
+$_sl["cat_srtm"] = "SRTM gegevens";
+$_sl["Cities"] = "Steden";
+$_sl["City"] = "Stad";
+$_sl["Clear"] = "Annuleer";
+$_sl["Coastal lagoons"] = "Kustlagunes";
+$_sl["Coastlines"] = "Kustlijn";
+$_sl["Commune"] = "Gemeente";
+$_sl["Communes"] = "Gemeenten";
+$_sl["Complex cultivation patterns"] = "Complexe landbouwuitbatingspatronen";
+$_sl["Coniferous forest"] = "Naaldbossen";
+$_sl["Copy Path"] = "Kopieer het pad";
+$_sl["Corine Landcover"] = "Corine Landcover";
+$_sl["Countries"] = "Landen";
+$_sl["Country"] = "Land";
+$_sl["Create PDF Document"] = "Creeer PDF Document";
+$_sl["Create Print Page"] = "Creeer Afdrukpagina";
+$_sl["Description"] = "Beschrijving";
+$_sl["Digital Elevation Model"] = "Digitaal Hoogte Model";
+$_sl["Digital Terrain Model"] = "Digitaal Terrein Model";
+$_sl["Digitize"] = "Digitaliseer";
+$_sl["Display Limit"] = "Aantal lijnen per blad";
+$_sl["Download"] = "Download";
+$_sl["Estuaries"] = "Estuaria";
+$_sl["EU Satellite Coverage"] = "EU Satelliet Mosaiek";
+$_sl["Forward"] = "Voorwaarts";
+$_sl["Fruit trees and berry plantations"] = "Fruitbomen and aanplantingen van bessen";
+$_sl["Geo-data source"] = "Geo-data bron";
+$_sl["Glaciers and perpetual snow"] = "Gletchers en Permanente Sneeuw";
+$_sl["Help"] = "Help";
+$_sl["Hide Legend"] = "Legende Verbergen";
+$_sl["Hydrography"] = "Hydrografie";
+$_sl["ID"] = "ID";
+$_sl["Identify"] = "Identifieren";
+$_sl["Images"] = "Beelden";
+$_sl["Infrastructure"] = "Infrastructuur";
+$_sl["Inhabitants"] = "Inwoners";
+$_sl["Inland marshes"] = "Zoetwatermoerassen";
+$_sl["Intertidal flats"] = "Getijdenvlakte";
+$_sl["Lakes"] = "Meren";
+$_sl["Large"] = "Groot";
+$_sl["Layer"] = "Laag";
+$_sl["Layers"] = "Lagen";
+$_sl["Legend"] = "Legende";
+$_sl["Length"] = "Afstand";
+$_sl["Link on detail"] = "Koppeling naar detail";
+$_sl["Link to current map"] = "Koppeling naar de huidige kaart";
+$_sl["Load WMS Service"] = "Laad WMS Dienst";
+$_sl["Map Resolution for Download"] = "Kaartresolutie voor Download";
+$_sl["Map window size"] = "Kaartvenstergrootte";
+$_sl["Measure"] = "Opmeten";
+$_sl["Medium"] = "Gemiddeld";
+$_sl["Mixed forest"] = "Gemengde bossen";
+$_sl["Moors and heathland"] = "Heide en ruwtes";
+$_sl["Name"] = "Naam";
+$_sl["Natural grassland"] = "Natuurlijk grasland";
+$_sl["Navigation"] = "Navigatie";
+$_sl["NEXT"] = "VOLGENDE";
+$_sl["No data"] = "Geen gegevens";
+$_sl["No records found"] = "Geen resultaat gevonden";
+$_sl["Non-irrigated arable land"] = "Niet Geirrigeerd akkerland";
+$_sl["Olive groves"] = "Olijfgaarden";
+$_sl["On map click"] = "Klik op de kaart";
+$_sl["Pan"] = "Pannen";
+$_sl["Pastures"] = "Weide";
+$_sl["Peatbogs"] = "Veenland";
+$_sl["Permanently irrigated land"] = "Permanent geirrigeerd akkerland";
+$_sl["Print Map"] = "Kaart afdrukken";
+$_sl["Print Settings"] = "Instellingen afdrukken";
+$_sl["Print Title"] = "Opschrift afdrukken";
+$_sl["Print View"] = "Deze Voorstelling afdrukken";
+$_sl["Query Results"] = "Zoekresultaten";
+$_sl["records exceeded"] = "De Overtallige resultaten worden niet getoond";
+$_sl["Refresh Map"] = "Kaart Vernieuwen";
+$_sl["Restrict Search to Map Extent"] = "Zoekopdracht Beperken tot de getoonde kaart";
+$_sl["Rice fields"] = "Rijstvelden";
+$_sl["Rivers"] = "Rivieren";
+$_sl["Run Search"] = "Zoekopdracht starten";
+$_sl["Salines"] = "Brakwatermoerassen";
+$_sl["Salt-marshes"] = "Zoutmoerassen";
+$_sl["Scale"] = "Schaal";
+$_sl["Sclerophyllous vegetation"] = "Sclerophyle vegetatie";
+$_sl["Sea and ocean"] = "Zee en Oceaan";
+$_sl["Search"] = "Opzoeken";
+$_sl["Search for"] = "Zoeken naar";
+$_sl["Search Image"] = "Beeld zoeken";
+$_sl["Search results for layer"] = "Zoeken binnen deze laag";
+$_sl["Segment"] = "Segment";
+$_sl["Select"] = "Selecteren";
+$_sl["Select Image Format"] = "Beeldformaat Selecteren";
+$_sl["Select/Search limit of"] = "Zoekopdracht Begrenzen";
+$_sl["Selection for Layer"] = "Selecteer voor deze laag";
+$_sl["Set Scale"] = "Schaal Instellen";
+$_sl["Settlements"] = "Nederzettingen";
+$_sl["Show"] = "Tonen";
+$_sl["Show Layers"] = "Lijst van Lagen Tonen";
+$_sl["Show Legend"] = "Legende tonen";
+$_sl["Site"] = "Plaats";
+$_sl["Slope"] = "Helling";
+$_sl["Small"] = "Klein";
+$_sl["Sparsely vegetated areas"] = "Gebieden met schaarse vegetatie";
+$_sl["Start Search"] = "Zoekopdracht starten";
+$_sl["Total"] = "Totaal";
+$_sl["Transitional woodland-shrub"] = "Overgangsbossen";
+$_sl["Urban and industrial fabric"] = "Stedelijk en industrieel weefsel";
+$_sl["Vineyards"] = "Wijngaarden";
+$_sl["Water bodies"] = "Watervlakten";
+$_sl["With Overview Map"] = "Met Overzichtskaart";
+$_sl["Zoom"] = "Zoomfuncties";
+$_sl["Zoom in"] = "Inzomen";
+$_sl["Zoom out"] = "Uitzomen";
+$_sl["Zoom to All Features Found"] = "Zomen op de gevonden resultaten";
+$_sl["Zoom To Full Extent"] = "Zomen op de volledige kaart";
+$_sl["Zoom to Selected Features"] = "Zomen op de geselecteerde elementen";
+
+?>
\ No newline at end of file

Added: incphp/locale/language_se.php
===================================================================
--- incphp/locale/language_se.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/locale/language_se.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,131 @@
+<?php
+$_sl["Add location description"] = "Lägg till platsbeskrivning";
+$_sl["Add Point of Interest"] = "Lägg till Plats av särskilt intresse";
+$_sl["Administrative Entity"] = "Administrativ enhet";
+$_sl["Agriculture, with natural vegetation"] = "Jordbruk med naturlig vegetation";
+$_sl["Agro-forestry areas"] = "Skogsbruksområden";
+$_sl["Annual crops associated with permanent crops"] = "Årlig och permanent gröda";
+$_sl["Area"] = "Area";
+$_sl["BACK"] = "TILLBAKA";
+$_sl["Back"] = "Tillbaka";
+$_sl["Bare rock"] = "Öppet berg";
+$_sl["Beaches, dunes, and sand plains"] = "Stränder, dyner och sandfläckar";
+$_sl["Broad-leaved forest"] = "Lövskog";
+$_sl["Burnt areas"] = "Avbrända ytor";
+$_sl["cat_admin"] = "Administrativ data";
+$_sl["cat_nature"] = "Terrängdata";
+$_sl["cat_raster"] = "Rasterdata";
+$_sl["cat_satimages"] = "Satellitbilder";
+$_sl["cat_srtm"] = "SRTM data";
+$_sl["Cities"] = "Stader";
+$_sl["City"] = "Stad";
+$_sl["Clear"] = "Rensa";
+$_sl["Coastal lagoons"] = "Laguner";
+$_sl["Coastlines"] = "Kustlinje";
+$_sl["Commune"] = "Kommun";
+$_sl["Communes"] = "Kommuner";
+$_sl["Complex cultivation patterns"] = "Komplexa odlingsmönster";
+$_sl["Coniferous forest"] = "Barrskog";
+$_sl["Copy Path"] = "Kopiera sökväg";
+$_sl["Countries"] = "Länder";
+$_sl["Country"] = "Land";
+$_sl["Create PDF Document"] = "Skapa PDF-dokument";
+$_sl["Create Print Page"] = "Skapa utskrift";
+$_sl["Description"] = "Beskrivning";
+$_sl["Digital Elevation Model"] = "Digital höjdmodell";
+$_sl["Digital Terrain Model"] = "Digital terrängmodell";
+$_sl["Digitize"] = "Digitalisera";
+$_sl["Display Limit"] = "Visa begränsning";
+$_sl["Estuaries"] = "Estuarium";
+$_sl["EU Satellite Coverage"] = "Satellittäckning över EU";
+$_sl["Forward"] = "Fram";
+$_sl["Fruit trees and berry plantations"] = "Frukt- och bärplantage";
+$_sl["Geo-data source"] = "Geo-datakälla";
+$_sl["Glaciers and perpetual snow"] = "Glaciärer och permanent snö";
+$_sl["Help"] = "Hjälp";
+$_sl["Hide Legend"] = "Göm legend";
+$_sl["Hydrography"] = "Hydrografi";
+$_sl["ID"] = "ID";
+$_sl["Identify"] = "Information";
+$_sl["Images"] = "Bilder";
+$_sl["Infrastructure"] = "Infrastruktur";
+$_sl["Inhabitants"] = "Invånare";
+$_sl["Inland marshes"] = "Sumpmark";
+$_sl["Intertidal flats"] = "Intertidal flats";
+$_sl["Lakes"] = "Sjöar";
+$_sl["Large"] = "Stur";
+$_sl["Layer"] = "Lager";
+$_sl["Layers"] = "Layer";
+$_sl["Legend"] = "Legend";
+$_sl["Length"] = "Längd";
+$_sl["Link on detail"] = "Länk på detalj";
+$_sl["Link to current map"] = "Länk till visad karta";
+$_sl["Load WMS Service"] = "Ladda WMS-service";
+$_sl["Map Resolution for Download"] = "Kartupplösning vid nedladdning";
+$_sl["Map window size"] = "Kartan i fönsterstorlek";
+$_sl["Measure"] = "Mät";
+$_sl["Medium"] = "Mellan";
+$_sl["Mixed forest"] = "Blandskog";
+$_sl["Moors and heathland"] = "Hed- och torvområde";
+$_sl["Name"] = "Namn";
+$_sl["Natural grassland"] = "Naturliga gräsområden";
+$_sl["Navigation"] = "Navigation";
+$_sl["NEXT"] = "FRAM";
+$_sl["No data"] = "Ingen information";
+$_sl["No records found"] = "Sökning misslyckades";
+$_sl["Non-irrigated arable land"] = "Obevattnad åkermark";
+$_sl["Olive groves"] = "Olivlundar";
+$_sl["On map click"] = "Kartklick";
+$_sl["Pan"] = "Pan";
+$_sl["Pastures"] = "Betesmark";
+$_sl["Peatbogs"] = "Torfmoore";
+$_sl["Permanently irrigated land"] = "Permanent bevattnad åkermark";
+$_sl["Print Map"] = "Skriv ut";
+$_sl["Print Settings"] = "Skrivarinställningar";
+$_sl["Print Title"] = "Skriv ut titel";
+$_sl["Print View"] = "Skriv ut vy";
+$_sl["Query Results"] = "Sökresultat";
+$_sl["records exceeded"] = "Överfullt";
+$_sl["Refresh Map"] = "Uppdatera";
+$_sl["Restrict Search to Map Extent"] = "Begränsa sökning till kartan";
+$_sl["Rice fields"] = "Risfält";
+$_sl["Rivers"] = "Älvar/Floder";
+$_sl["Run Search"] = "Sök";
+$_sl["Salines"] = "Saltvatten";
+$_sl["Salt-marshes"] = "Saltträsk";
+$_sl["Scale"] = "Skala";
+$_sl["Sclerophyllous vegetation"] = "Sclerophyll vegetation";
+$_sl["Sea and ocean"] = "Hav och oceaner";
+$_sl["Search"] = "Sök";
+$_sl["Search for"] = "Sök...";
+$_sl["Search Image"] = "Sök bild";
+$_sl["Search results for layer"] = "Sök lager";
+$_sl["Segment"] = "Segment";
+$_sl["Select"] = "Välj";
+$_sl["Select Image Format"] = "Välj bildformat";
+$_sl["Select/Search limit of"] = "Markerings-/Sökbegränsning";
+$_sl["Selection for Layer"] = "Val för lager";
+$_sl["Set Scale"] = "Ange skala";
+$_sl["Settlements"] = "Bosättningar";
+$_sl["Show"] = "Visa";
+$_sl["Show Layers"] = "Visa lagerlista";
+$_sl["Show Legend"] = "Visa legend";
+$_sl["Site"] = "Läge";
+$_sl["Slope"] = "Lutning";
+$_sl["Small"] = "Liten";
+$_sl["Sparsely vegetated areas"] = "Begränsad växtlighet";
+$_sl["Start Search"] = "Starta sökning";
+$_sl["Total"] = "Total";
+$_sl["Transitional woodland-shrub"] = "Övergångsmark skog-buskmark";
+$_sl["Urban and industrial fabric"] = "Urban och industriell";
+$_sl["Vineyards"] = "Vingårdar";
+$_sl["Water bodies"] = "VÃ¥tvatten";
+$_sl["With Overview Map"] = "Med översiktskarta";
+$_sl["Zoom"] = "Zoom";
+$_sl["Zoom in"] = "Zooma in";
+$_sl["Zoom out"] = "Zooma ut";
+$_sl["Zoom to All Features Found"] = "Zooma till alla sökträffat";
+$_sl["Zoom To Full Extent"] = "Zoom max";
+$_sl["Zoom to Selected Features"] = "Zooma till de valda";
+
+?>
\ No newline at end of file

Added: incphp/locale/load.php
===================================================================
--- incphp/locale/load.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/locale/load.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,26 @@
+<?php
+
+//dl('php_sqlite.dll');
+//require_once 'language_de.php';
+
+
+
+$dsn = "localedb.db";
+
+$dbh = sqlite_open($dsn, 0777, $sqliteerror);
+
+
+
+foreach($_sl as $k => $s) {
+     
+     //$sql = "INSERT INTO locales(base, de) values('$k', '$s')";
+    $sql = "UPDATE locales set it='$s'  WHERE base='$k'";
+
+     $q = sqlite_query($dbh, $sql);
+
+
+}
+
+sqlite_close($dbh);
+//echo "finished";
+?>

Added: incphp/locale/localedb.db
===================================================================
(Binary files differ)


Property changes on: incphp/locale/localedb.db
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: incphp/locale/localedb.tmf
===================================================================
--- incphp/locale/localedb.tmf	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/locale/localedb.tmf	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,4 @@
+set tables(count,locales) {115}
+set tables(columns,locales) {base en de it fr se es pl pt}
+set tables(sql,locales) {CREATE TABLE locales (base varchar(200), en varchar(200), de varchar(200), it varchar(200), fr varchar(200), se varchar(200), es varchar(200), pl varchar(200), pt varchar(200))}
+set indexes(sql,locales) {CREATE INDEX idx_locales_base ON locales(base ASC)}

Added: incphp/map.php
===================================================================
--- incphp/map.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/map.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,922 @@
+<?php
+/*********************************************************************************
+ Copyright (c) 2002-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
+**********************************************************************************/
+
+/*
+  CENTRAL CLASS TO CREATE MAP IMAGE
+*/
+
+
+class PMap
+{
+    /*===========================================================================
+                                  PUBLIC FUNCTIONS
+     ============================================================================*/
+
+    function PMap($map)
+    {
+        $this->map = $map;
+        
+        $this->pmap_addCustomLayers();
+        $this->pmap_getGroups();
+        //$this->setTransp();
+        setGroups($this->map, $this->groups, 0, 1);
+        
+        
+        $this->pmap_setGeoExt();
+        $this->pmap_setMapWH();
+        
+        $this->pmap_createMap();
+        $this->pmap_createMapImage();
+        
+        $this->pmap_setHistory();
+        $this->pmap_registerSession();
+    }
+    
+    
+    function pmap_addCustomLayers()
+    {
+        include_once("customlayers.php");
+        //$this->pmap_addWMSGroups();
+        if (isset($_SESSION['url_points'])) {
+            if (count($_SESSION['url_points']) > 0) {
+                $urlLayer = new URL_Layer($this->map);
+            }
+        }
+        
+    }
+    
+    //TEST
+    function setTransp() 
+    {
+        $corlay = getGLayerByName("corine1");
+        $corlay->setTransparency(60);
+    }
+    
+    
+    /**
+     * Return the URL to map image
+     */
+    function pmap_returnMapImgURL()
+    {
+        return $this->mapURL;
+    }
+    
+    function pmap_returnScalebarImgURL()
+    {
+        return $this->scalebarURL;
+    }
+
+    /**
+     * Create JavaScript variables from PHP variables
+     */
+    function pmap_returnMapJSParams()
+    {
+        $this->xdelta_geo = $this->GEOEXT["maxx"] - $this->GEOEXT["minx"];
+        $this->ydelta_geo = $this->GEOEXT["maxy"] - $this->GEOEXT["miny"];
+        
+        $this->pmap_getRefBoxStr();
+        
+        //$no_dd = ($this->map->units != 5 ? 0 : 1);        
+        $mstr['mapW'] = $this->mapwidth;
+        $mstr['mapH'] = $this->mapheight;
+        $mstr['refW'] = $this->refW;
+        $mstr['refH'] = $this->refH;
+        $mstr['minx_geo'] = $this->GEOEXT["minx"];
+        $mstr['maxy_geo'] = $this->GEOEXT["maxy"];
+        $mstr['xdelta_geo'] = $this->xdelta_geo;
+        $mstr['ydelta_geo'] = $this->ydelta_geo;
+        $mstr['refBoxStr'] = $this->refBoxStr;
+
+        return $mstr;
+    }
+    
+    /**
+     * Return the pan string for the reference box
+     */
+    function pmap_returnRefBoxStr()
+    {
+        return $this->refBoxStr;
+    }
+
+    function pmap_returnMapW()
+    {
+        return $this->mapwidth;
+    }
+    
+    function pmap_returnMapH()
+    {
+        return$this->mapheight;
+    }
+
+    /**
+     * Return the scale
+     */
+    function pmap_returnGeoScale()
+    {
+        return round($this->geo_scale, -1);
+    }
+    
+
+
+    /*========================================================================================
+                                     PRIVATE FUNCTIONS
+     ========================================================================================*/
+
+    /*
+     * SWITCH ON/OFF LAYERS/GROUPS (READ FROM URL || SID)
+     ******************************************************************/
+    function pmap_getGroups() 
+    {
+        if (isset($_GET["groups"])) {
+            $drawGroupStr = $_GET["groups"];
+            $this->groups = explode(",", $drawGroupStr);
+        } elseif (isset($_SESSION["groups"]) && count($_SESSION["groups"]) > 0) {
+            $this->groups = $_SESSION["groups"];
+        } else {
+            $this->groups = $_SESSION["defGroups"];
+        }
+    }
+
+
+
+    /*
+     * SET EXTENTS OF GEOEXT-OBJECT:
+     * - from map file if first called
+     * - from SID for next calls
+     ********************************************************/
+    function pmap_setGeoExt()
+    {
+        // 2nd OR HIGHER CALL
+        if (isset($_SESSION["GEOEXT"])) {
+            $this->GEOEXT = $_SESSION["GEOEXT"];
+            $this->geoext0 = ms_newrectObj();
+            $this->geoext0->setextent($this->GEOEXT["minx"],$this->GEOEXT["miny"],$this->GEOEXT["maxx"],$this->GEOEXT["maxy"]);
+        
+            $this->old_geo_scale = $_SESSION["geo_scale"];
+        
+        
+        } elseif (isset($_SESSION['zoom_extparams'])) {
+            $ext = $_SESSION['zoom_extparams'];
+            $this->map->setextent($ext[0], $ext[1], $ext[2],$ext[3]);
+            //unset($_SESSION['zoom_extparams']);
+            
+            $this->geoext0 = ms_newrectObj();
+            $this->geoext0->setextent($ext[0], $ext[1], $ext[2],$ext[3]);
+            
+            $this->historyBack = array();
+            $this->historyFwd = array();
+        
+        // INITIAL START
+        } else {
+            if (isset($_SESSION['mapMaxExt'])) {
+                $me = $_SESSION['mapMaxExt'];
+                $this->geoext0 = ms_newrectObj();
+                $this->geoext0->setextent($me["minx"],$me["miny"],$me["maxx"],$me["maxy"]);
+                
+            } else {
+                $this->geoext0 = $this->map->extent;
+            }
+            
+            
+            $this->GEOEXT["minx"] = $this->geoext0->minx;
+            $this->GEOEXT["miny"] = $this->geoext0->miny;
+            $this->GEOEXT["maxx"] = $this->geoext0->maxx;
+            $this->GEOEXT["maxy"] = $this->geoext0->maxy;
+            $_SESSION["GEOEXT"] = $this->GEOEXT;
+        
+            // calculate scale
+            $dpi = $this->map->resolution;
+            $mapW = $_SESSION["mapwidth"];
+            $this->old_geo_scale = ($this->mapW /($this->GEOEXT["maxx"] - $this->GEOEXT["minx"])) / (0.0254 / $dpi);
+            
+            $this->historyBack = array();
+            $this->historyFwd = array();
+        }
+    }
+
+
+
+    /*
+     * MAP DIMENSION X/Y
+     *****************************************/
+    function pmap_setMapWH()
+    {
+        $this->mapwidth = $_SESSION["mapwidth"];
+        $this->mapheight = $_SESSION["mapheight"];
+        $this->map->set("width", $this->mapwidth);
+        $this->map->set("height", $this->mapheight);
+    }
+
+
+    
+    /*
+     * SET HISTORY EXTENTS IN ARRAYS FOR BACK AND FORWARD 
+     ******************************************************************/
+    function pmap_setHistory()
+    {
+        $maxHistory = 8; // <===== ADAPT IF NECESSARY <=====
+        
+        $this->historyBack = $_SESSION["historyBack"];
+        $this->historyFwd  = $_SESSION["historyFwd"];
+        
+        // Compare new with old extent (just take minx and maxy)
+        // if different: add new extent to history
+        if ($this->GEOEXT["minx"] != $this->OLDGEOEXT["minx"] && $this->GEOEXT["maxy"] != $this->OLDGEOEXT["maxy"] && is_array($this->OLDGEOEXT)) {
+            if ($_GET["zoom_type"] == "zoomback") {
+                $this->historyFwd[] = $this->OLDGEOEXT;
+            } else {
+                $this->historyBack[] = $this->OLDGEOEXT;
+            }
+            
+            //Limit history arrays to max value
+            if (count($this->historyBack) > $maxHistory) {
+                array_shift($this->historyBack);
+            }
+            if (count($this->historyFwd) > $maxHistory) {
+                array_shift($this->historyFwd);
+            }
+        }
+    }
+
+
+
+    /*
+     * REFERENCE MAP: ADJUST REFBOX
+     *************************************************************/
+    function pmap_getRefBoxStr()
+    {
+        // REFERENCE MAP DIMENSION X/Y
+        $refMap = $this->map->reference;
+        $this->refW = $refMap->width;
+        $this->refH = $refMap->height;
+        
+        $refExtent = $refMap->extent;
+        $refXmin = $refExtent->minx;
+        $refYmin = $refExtent->miny;
+        $refXmax = $refExtent->maxx;
+        $refYmax = $refExtent->maxy;
+        
+        $xdelta_ref = $refXmax - $refXmin;
+        $ydelta_ref = $refYmax - $refYmin;
+        
+        $pixSizeX = $xdelta_ref / $this->refW;
+        $pixSizeY = $ydelta_ref / $this->refH;
+        $refBoxL  = max(0, round((($this->GEOEXT["minx"]-$refXmin) / $pixSizeX) - 0.5));
+        $refBoxT  = max(0, round((($refYmax - $this->GEOEXT["maxy"]) / $pixSizeY)) - 1);
+        $refBoxW  = min(($this->refW - $refBoxL), round($this->xdelta_geo / $pixSizeX));
+        $refBoxH  = min(($this->refH - $refBoxT), round($this->ydelta_geo / $pixSizeY));
+        
+        $this->refBoxStr = "$refBoxL,$refBoxT,$refBoxW,$refBoxH";
+        
+        //return $refBoxStr;
+    }
+    
+    
+    
+    /*
+     * CREATE MAP IMAGE
+     *****************************************/
+    function  pmap_createMapImage()
+    {
+        // Set image format according to settings
+        $this->pmap_setImgFormat();
+        
+        
+        // DRAW MAP AND SET GEO EXTENT (IN MAP UNITS) IN SID FOR SUBSEQUENT ZOOM ACTIONS //
+        $mapImg = $this->map->draw();
+        
+        // CHECK iF THERE'S AN XY-LAYER AND THEN DRAW IT
+        if ($_SESSION["existsXYLayer"]) {
+            $this->pmap_drawXYLayer($mapImg); 
+        }
+        
+        // write old geoextent to var before changing
+        $this->OLDGEOEXT = $this->GEOEXT; 
+        //error_log($this->OLDGEOEXT);
+        
+        // convert numbers for GEOEXT and geo_scale to string 
+        // to avoid saving numbers as full float number in SID
+        $this->GEOEXT["minx"] = strval($this->map->extent->minx);
+        $this->GEOEXT["miny"] = strval($this->map->extent->miny);
+        $this->GEOEXT["maxx"] = strval($this->map->extent->maxx);
+        $this->GEOEXT["maxy"] = strval($this->map->extent->maxy);
+        
+        $this->geo_scale = $this->map->scale;
+        
+        
+        // PRODUCE MAP, REFERENCE AND SCALEBAR IMAGE //
+        //$this->mapURL = $mapImg->saveWebImage();
+        $this->mapURL = mapSaveWebImage($this->map, $mapImg);
+        
+        $scalebarImg = $this->map->drawScaleBar();
+        //$this->scalebarURL = $scalebarImg->saveWebImage();
+        $this->scalebarURL = mapSaveWebImage($this->map, $scalebarImg);
+        
+        
+        if (isset($_SESSION['ul'])) {
+            //error_log($_SESSION['ul']);
+            //$urlLayer = new URL_Layer($this->map, $mapImg);
+        }
+        
+        
+        $mapImg->free();
+        $scalebarImg->free();
+    }
+    
+    /* 
+     * Set image format according to settings
+     * if alternative format is defined for some layers
+     * and if one of these layers is active, then use altImgFormat
+     **************************************************************/
+    function  pmap_setImgFormat()
+    {
+        $altImgFormatLayers = $_SESSION['altImgFormatLayers'];
+        $altImgFormat = $_SESSION['altImgFormat'];
+        $useAltImgFormat = 0;
+        if ($altImgFormatLayers && $altImgFormat) {
+            foreach ($altImgFormatLayers as $ai) {
+                if (in_array($ai, $this->groups)) {
+                    $useAltImgFormat = 1;
+                }
+            }
+        }
+        
+        if ($useAltImgFormat) {
+            $this->map->selectOutputFormat($_SESSION["altImgFormat"]);
+        } else {
+            $this->map->selectOutputFormat($_SESSION["imgFormat"]);
+        }
+    }
+    
+
+    /*
+     * CREATE NEW MAP
+     * 
+     *****************************************************************************/
+    function pmap_createMap()
+    {
+        
+        // CHECK IF THERE ARE RESULTLAYERS (HIGHLIGHT) AND ADD THEM TO MAP
+        $this->pmap_checkResultLayers();
+    
+        //
+        // GET ZOOMTYPE
+        // zoomrect, zoompoint, zoomscale, zoomfull, zoomextent, ref, zoomback, zoomfwd
+        // Default:  start with 'zoom rect'
+        if (isset($_GET["zoom_type"])) {
+            $zoom_type = $_GET["zoom_type"];
+        } else {
+            $zoom_type = "zoomrect";
+        }
+    
+        //
+        // GET ZOOMFACTOR
+        // <0: zoom out, 1: pan, >1: zoom in
+        // Default: 1
+        if (isset($_GET["zoom_factor"])) {
+            $this->zoom_factor = $_GET["zoom_factor"];
+        } else {
+            $this->zoom_factor = "1";
+        }
+    
+    
+        // =================   APPLY PARAMETERS TO MAP ================= //
+    
+        $this->maxextent = $this->getMapMaxExtent();
+    
+        // ZOOM TO RECTANGLE (ZOOMBOX -> PIXEL COORDINATES) OR FULL EXTENT
+        if ($zoom_type == "zoomrect") {
+            $this->pmap_zoomrect();
+           
+        // ZOOM TO POINT -> Pan, Zoomout
+        } elseif ($zoom_type == "zoompoint") {
+            $this->pmap_zoompoint();
+    
+        // ZOOM TO SCALE
+        } elseif ($zoom_type == "zoomscale") {
+            $scale = $_GET["scale"];
+            $this->pmap_zoomscale($scale);
+            
+        // ZOOM TO FULL EXTENT
+        } elseif ($zoom_type == "zoomfull") {
+            // Get external parameters via URL (eg from links)
+            if (isset($_SESSION['zoom_extparams'])) {
+                $ext = $_SESSION['zoom_extparams'];
+                //printDebug($ext);
+                $this->map->setextent($ext[0], $ext[1], $ext[2],$ext[3]);
+                unset($_SESSION['zoom_extparams']);
+            } else {
+                $this->map->setextent($this->maxextent->minx, $this->maxextent->miny, $this->maxextent->maxx, $this->maxextent->maxy);
+            }
+    
+        // ZOOM TO EXTENT (GEO-EXTENT)
+        } elseif ($zoom_type == "zoomextent") {
+            $this->pmap_zoomextent(); 
+    
+        // PAN VIA REFERENCE MAP
+        } elseif ($zoom_type == "ref") {
+            $this->pmap_zoomref();
+    
+        // ZOOM BACK TO PREVIOUS EXTENT
+        } elseif ($zoom_type == "zoomback") {
+            $this->pmap_zoomback();
+            
+        // ZOOM FORWARD 
+        } elseif ($zoom_type == "zoomfwd") {
+            $this->pmap_zoomfwd();
+        }
+    
+    } // END OF pmap_createMap()
+    
+    
+    /*
+     * ZOOM&PAN FUNCTIONS
+     ************************************************/
+    function pmap_zoomrect()
+    {
+        if (isset($_GET["imgbox"])) {
+            $imgbox_str = $_GET["imgbox"];
+            //error_log($imgbox_str);
+            if ($imgbox_str != "") {
+                $imgbox_arr = explode(" ", $imgbox_str);
+                // New map extent in image pixel ((0,0) top-left)
+                $pix_minx = $imgbox_arr[0];
+                $pix_miny = $imgbox_arr[1];
+                $pix_maxx = $imgbox_arr[2];
+                $pix_maxy = $imgbox_arr[3];
+                
+                if ($pix_minx == $pix_maxx) $pix_maxx = $pix_maxx + 3;  ## increase max extent if min==max
+                if ($pix_miny == $pix_maxy) $pix_maxy = $pix_maxy - 3;  ##
+
+                $pixext = ms_newrectObj();
+                $pixext->setextent($pix_minx,$pix_miny,$pix_maxx,$pix_maxy);
+            }
+            
+        // Zoom to full extent when starting
+        } else {
+            $pixext = ms_newrectObj();
+            $pixext->setextent(0, 0, $this->mapwidth, $this->mapheight);
+        }
+        
+        $this->map->zoomrectangle($pixext, $this->mapwidth, $this->mapheight, $this->geoext0);
+        $pixext->free();
+    }
+    
+    function pmap_zoompoint()
+    {
+        if ($_GET["imgxy"] != "") {
+            $imgxy_str = $_GET["imgxy"];
+            $imgxy_arr = explode(" ", $imgxy_str);
+        } else {
+            $imgxy_arr = array ($this->mapwidth/2, $this->mapheight/2);
+        }
+
+        // Create x/y-point for zoom center
+        $x_pix = $imgxy_arr[0];
+        $y_pix = $imgxy_arr[1];
+        $xy_pix = ms_newPointObj();
+        $xy_pix->setXY($x_pix, $y_pix);
+        
+        $this->map->zoompoint($this->zoom_factor, $xy_pix, $this->mapwidth, $this->mapheight, $this->geoext0, $this->maxextent);
+        $xy_pix->free();
+    }
+    
+    function pmap_zoomscale($scale)
+    {
+        $x_pix = $this->mapwidth/2;
+        $y_pix = $this->mapheight/2;
+        $xy_pix = ms_newPointObj();
+        $xy_pix->setXY($x_pix, $y_pix);
+        $this->map->zoomscale($scale, $xy_pix, $this->mapwidth, $this->mapheight, $this->geoext0, $this->maxextent);
+        $xy_pix->free();
+    }
+    
+    function pmap_zoomextent()
+    {
+        $extent_str = $_GET["extent"];
+        $extent_arr = explode(" ", $extent_str);
+        $this->map->setextent($extent_arr[0], $extent_arr[1], $extent_arr[2],$extent_arr[3]);
+    }
+    
+    function pmap_zoomref()
+    {
+        $imgxy_str = $_GET["imgxy"];
+        $imgxy_arr = explode(" ", $imgxy_str);
+        $x_pix = $imgxy_arr[0];
+        $y_pix = $imgxy_arr[1];
+
+        $refmap = $this->map->reference;
+        $refmapwidth = $refmap->width;
+        $refmapheight = $refmap->height;
+
+        $GEOEXT = $_SESSION["GEOEXT"];
+        $geo0DeltaX = $GEOEXT["maxx"] - $GEOEXT["minx"];
+        $geo0DeltaY = $GEOEXT["maxy"] - $GEOEXT["miny"];
+        $newMapExtent = $this->refMapClick ($this->map, $x_pix, $y_pix, $refmapwidth, $refmapheight, $geo0DeltaX, $geo0DeltaY);
+
+        $this->map->setextent($newMapExtent[0], $newMapExtent[1], $newMapExtent[2], $newMapExtent[3] );
+    }
+    
+    function pmap_zoomback()
+    {
+        $historyBack = $_SESSION["historyBack"];
+        if (count($historyBack) > 0 ) {
+            $OLDGEOEXT = array_pop($historyBack);
+            $_SESSION["historyBack"] = $historyBack;
+            $this->map->setextent($OLDGEOEXT["minx"], $OLDGEOEXT["miny"], $OLDGEOEXT["maxx"], $OLDGEOEXT["maxy"] );
+        } else {
+            $GEOEXT = $_SESSION["GEOEXT"];
+            $this->map->setextent($GEOEXT["minx"], $GEOEXT["miny"], $GEOEXT["maxx"], $GEOEXT["maxy"] );
+        }
+    }
+    
+    function pmap_zoomfwd()
+    {
+        $historyFwd = $_SESSION["historyFwd"];
+        if (count($historyFwd) > 0) {
+            $OLDGEOEXT = array_pop($historyFwd);
+            $_SESSION["historyFwd"] = $historyFwd;
+            $this->map->setextent($OLDGEOEXT["minx"], $OLDGEOEXT["miny"], $OLDGEOEXT["maxx"], $OLDGEOEXT["maxy"] );
+        } else {
+            $GEOEXT = $_SESSION["GEOEXT"];
+            $this->map->setextent($GEOEXT["minx"], $GEOEXT["miny"], $GEOEXT["maxx"], $GEOEXT["maxy"] );
+        }
+    }
+    
+    /**
+     * Set map maximum extent
+     * takes values from session if set via URL (in initmap()->getMapInitURL())
+     */
+    function getMapMaxExtent()
+    {
+        if (isset($_SESSION['mapMaxExt'])) {
+            $me = $_SESSION['mapMaxExt'];
+            $mapMaxExt = ms_newrectObj();
+            $mapMaxExt->setextent($me["minx"],$me["miny"],$me["maxx"],$me["maxy"]);
+        } else {
+            $mapMaxExt = $this->map->extent;
+        }
+        
+        return $mapMaxExt;
+    }
+    
+    
+    /*
+     * CHECK IF THERE ARE RESULTLAYERS TO ADD
+     ********************************************************/
+    function pmap_checkResultLayers()
+    {
+        // ADD RESULTLAYER: MARKING SHAPE(S) AND ADD AS IN NEW CREATED LAYER
+        if (isset($_GET["resultlayer"])) {
+            $resultlayerStr = $_GET["resultlayer"];
+            if ($resultlayerStr == "remove") {
+                session_unregister("resultlayers");
+            } else {
+                $resultlayer = explode(" ", $resultlayerStr);
+                $reslayname = $resultlayer[0];
+                $shpindexes = explode("|", $resultlayer[1]);
+                $resultlayers[$reslayname] = $shpindexes;
+                $this->pmap_addResultLayer($reslayname, $shpindexes);
+                $_SESSION["resultlayers"] = $resultlayers;
+            }
+        } elseif (isset($_SESSION["resultlayers"])) {
+            $resultlayers = $_SESSION["resultlayers"];
+            foreach ($resultlayers as $reslayer => $shpindexes) {
+                $this->pmap_addResultLayer($reslayer, $shpindexes);
+            }
+        }
+    }
+    
+
+    /*
+     * FOR ZOOM TO SELECTED.
+     * Adds a new layer to the map for highlighting feature
+     *****************************************************************/
+    function pmap_addResultLayer($reslayer, $shpindexes)
+    {
+        $resulttilelayers = $_SESSION["resulttilelayers"];
+        $resulttilelayer = $resulttilelayers[$reslayer];
+    
+        $qLayer = $this->map->getLayerByName($reslayer);
+        $layNum = count($this->map->getAllLayerNames());
+    
+    
+        // TEST IF LAYER HAS THE SAME PROJECTION AS MAP
+        $mapProjStr = $this->map->getProjection();
+        $qLayerProjStr = $qLayer->getProjection();
+    
+        if ($mapProjStr && $qLayerProjStr && $mapProjStr != $qLayerProjStr) {
+            $changeLayProj = 1;
+            $mapProjObj = ms_newprojectionobj($mapProjStr);
+            $qLayerProjObj = ms_newprojectionobj($qLayerProjStr);
+        }
+    
+        // NEW RESULT LAYER
+        $newResLayer = ms_newLayerObj($this->map);
+        $newResLayer->set("name", "reslayer");
+        $qlayType = $qLayer->type;
+    
+        if ($qlayType == 0) {
+            $newResLayer->set("type", 0);  // Point for point layer
+        } elseif ($qlayType == 1 || $qlayType == 2) {
+            $newResLayer->set("type", 1);  // Line for line && polygon layers
+        }
+        ##$newResLayer->set("type", $qlayType);  // Take always same layer type as layer itself
+    
+        // ADD SELECTED SHAPE TO NEW LAYER
+        //# when layer is an event theme
+        if ($qLayer->getMetaData("XYLAYER_PROPERTIES") != "") {
+            foreach ($shpindexes as $cStr) {
+                $cList = preg_split('/@/', $cStr);
+                $xcoord = $cList[0];
+                $ycoord = $cList[1];
+                $resLine = ms_newLineObj();   // needed to use a line because only a line can be added to a shapeObj  
+                $resLine->addXY($xcoord, $ycoord);
+                $resShape = ms_newShapeObj(1);
+                $resShape->add($resLine);
+                $newResLayer->addFeature($resShape);
+            }
+        //# 'normal' layers
+        } else {
+            // Add selected shape to new layer
+            $qLayer->open();
+            foreach ($shpindexes as $resShpIdx) {
+                $resTileShpIdx = $resulttilelayer[$resShpIdx];
+                $resShape = $qLayer->getShape($resTileShpIdx, $resShpIdx);
+                
+                // Change projection to map projection if necessary
+                if ($changeLayProj) {
+                    // If error appears here for Postgis layers, then DATA is not defined properly as:
+                    // "the_geom from (select the_geom, oid, xyz from layer) AS new USING UNIQUE oid USING SRID=4258" 
+                    $resShape->project($qLayerProjObj, $mapProjObj);
+                }
+                
+                $newResLayer->addFeature($resShape);
+            }
+            
+            $qLayer->close();
+        }
+        
+        
+        $newResLayer->set("status", MS_ON);
+        $newResLayerIdx = $newResLayer->index;
+    
+        // SELECTION COLOR
+        $iniClrStr = trim($_SESSION["highlightColor"]);
+        $iniClrList = preg_split('/[\s,]+/', $iniClrStr);
+        $iniClr0 = $iniClrList[0];
+        $iniClr1 = $iniClrList[1];
+        $iniClr2 = $iniClrList[2];
+    
+        // CREATE NEW CLASS
+        $resClass = ms_newClassObj($newResLayer);
+        $clStyle = ms_newStyleObj($resClass);
+        $clStyle->color->setRGB($iniClr0, $iniClr1, $iniClr2);
+        $clStyle->set("symbolname", "circle");
+        $symSize = ($qlayType < 1 ? 10 : 5);
+        $clStyle->set("size", $symSize);
+    
+        // Move layer to top (is it working???)
+        //$layOrder = $this->map->getLayersDrawingOrder();
+        while ($newResLayerIdx < ($layNum-1)) {
+            $this->map->moveLayerUp($newResLayerIdx);
+        }
+    }
+    
+    
+    
+    /*
+     * REGISTER SESSION VARIABLES
+     **/
+    function pmap_registerSession()
+    {    
+        $_SESSION["groups"]  = $this->groups;
+        if (isset($this->resultlayers)) $_SESSION["resultlayers"] = $this->resultlayers;
+        $_SESSION["GEOEXT"]      = $this->GEOEXT;
+        $_SESSION["geo_scale"]   = $this->geo_scale;
+        $_SESSION["historyBack"] = $this->historyBack;
+        $_SESSION["historyFwd"]  = $this->historyFwd;
+    } 
+    
+    
+    
+    
+    
+    /*
+     * RETURN NEW MAP EXTENT FOR CLICK ON REF IMAGE
+     * Taken from the gMap demo by DMSolution
+     *******************************************************************************************************/
+    function refMapClick ($map, $nClickPixX, $nClickPixY, $dfWidthPix, $dfHeightPix, $dfDeltaX, $dfDeltaY)
+    {
+        $dfKeyMapXMin = $map->reference->extent->minx;
+        $dfKeyMapYMin = $map->reference->extent->miny;
+        $dfKeyMapXMax = $map->reference->extent->maxx;
+        $dfKeyMapYMax = $map->reference->extent->maxy;
+    
+        $nClickGeoX = $this->mapPix2Geo($nClickPixX, 0, $dfWidthPix, $dfKeyMapXMin,  $dfKeyMapXMax, 0);
+        $nClickGeoY = $this->mapPix2Geo($nClickPixY, 0, $dfHeightPix, $dfKeyMapYMin, $dfKeyMapYMax, 1);
+    
+        $dfMiddleX = $nClickGeoX;
+        $dfMiddleY = $nClickGeoY;
+    
+        $dfNewMinX = $dfMiddleX - ($dfDeltaX/2);
+        $dfNewMinY = $dfMiddleY - ($dfDeltaY/2);
+        $dfNewMaxX = $dfMiddleX + ($dfDeltaX/2);
+        $dfNewMaxY = $dfMiddleY + ($dfDeltaY/2);
+    
+    
+        // --------------------------------------------------------------------
+        //      not go outside the borders (map extent as in map file).
+        // --------------------------------------------------------------------
+        $maxExtent = $map->extent;
+        $dfMaxExtMinX = $maxExtent->minx;
+        $dfMaxExtMinY = $maxExtent->minY;
+        $dfMaxExtMaxX = $maxExtent->maxx;
+        $dfMaxExtMaxY = $maxExtent->maxy;
+    
+        if ($dfNewMinX < $dfMaxExtMinX) {
+            $dfNewMinX = $dfMaxExtMinX;
+            $dfNewMaxX = $dfNewMinX + ($dfDeltaX);
+        }
+        if ($dfNewMaxX > $dfMaxExtMaxX) {
+            $dfNewMaxX = $dfMaxExtMaxX;
+            $dfNewMinX = $dfNewMaxX - ($dfDeltaX);
+        }
+        if ($dfNewMinY < $dfMaxExtMinY) {
+            $dfNewMinY = $dfMaxExtMinY;
+            $dfNewMaxY = $dfNewMinY + ($dfDeltaY);
+        }
+        if ($dfNewMaxY > $dfMaxExtMaxY) {
+            $dfNewMaxY = $dfMaxExtMaxY;
+            $dfNewMinY = $dfNewMaxY - ($dfDeltaY);
+        }
+    
+        $mapExtents = array ($dfNewMinX, $dfNewMinY, $dfNewMaxX, $dfNewMaxY);
+        return ($mapExtents) ;
+    }
+    
+    
+    /* TRANSFORM PIXEL COORDINATE TO MAP UNITS
+     * Taken from the gMap demo by DMSolution
+     *****************************************************************************************/
+    function mapPix2Geo($nPixPos, $dfPixMin, $dfPixMax, $dfGeoMin, $dfGeoMax, $nInversePix)
+    {
+        $dfWidthGeo = $dfGeoMax - $dfGeoMin;
+        $dfWidthPix = $dfPixMax - $dfPixMin;
+    
+        $dfPixToGeo = $dfWidthGeo / $dfWidthPix;
+    
+        if (!$nInversePix)
+            $dfDeltaPix = $nPixPos - $dfPixMin;
+        else
+            $dfDeltaPix = $dfPixMax - $nPixPos;
+    
+        $dfDeltaGeo = $dfDeltaPix * $dfPixToGeo;
+        $dfPosGeo = $dfGeoMin + $dfDeltaGeo;
+    
+        return ($dfPosGeo);
+    }
+    
+    
+    
+    /*
+     * DRAW XY LAYER: ADD POINTS FROM DB TO MAP IMAGE
+     **/
+    function pmap_drawXYLayer($img) 
+    {
+        $grouplist = $_SESSION["grouplist"];
+        
+        // Loop through groups and layers to find XYLayers
+        foreach ($grouplist as $grp) {
+            $glayerList = $grp->getLayers();
+            foreach ($glayerList as $glayer) {
+                $XYLayerProperties = $glayer->getXYLayerProperties();
+                
+                if ($XYLayerProperties) {       // XYLayer found, now process 
+                
+                    $mLayer = $this->map->getLayer($glayer->getLayerIdx());
+                    $mLayerStatus = $mLayer->status;
+                    
+                    if ($mLayerStatus == MS_ON) {        // Check if XYLayer is switched ON
+                        require_once ("DB.php");
+                        require_once ("query/query.php");
+                        
+                        // Check if Layer projection deferes from Map projection
+                        $changeLayProj = $this->checkProjection($mLayer);
+                        //error_log("Change projection: $changeLayProj");
+                        
+                        // Map extent for limiting query 
+                        $mapExt = $this->map->extent;
+                        if ($changeLayProj) {
+                            $mapExt->project($this->mapProjObj, $this->xyLayerProjObj);
+                        }
+                        $map_xmin = $mapExt->minx;
+                        $map_ymin = $mapExt->miny;
+                        $map_xmax = $mapExt->maxx;
+                        $map_ymax = $mapExt->maxy;
+                        
+                        // XY Layer Properties
+                        $dsn          = $XYLayerProperties["dsn"];
+                        $xyTable      = $XYLayerProperties["xyTable"];
+                        $x_fld        = $XYLayerProperties["x_fld"];
+                        $y_fld        = $XYLayerProperties["y_fld"];
+                        $classidx_fld = $XYLayerProperties["classidx_fld"];
+                        
+                        $resFldStr = $mLayer->getMetaData("RESULT_FIELDS");
+                        $resFieldList = preg_split('/[\s,]+/', $resFldStr);
+                        
+                        // Prepare query
+                        if (preg_match("/@/", $xyTable)) {          // Check for WHERE filter in table definition
+                            $xyList = preg_split('/@/', $xyTable);
+                            $whereFilter = $xyList[1];
+                            $xyTable = $xyList[0];
+                        }
+                        $sql_SELECT = "SELECT $x_fld, $y_fld, $classidx_fld FROM $xyTable ";
+                        $sql_WHERE  = "WHERE " . ($whereFilter ? $whereFilter . " AND " : "") . " $x_fld >= $map_xmin  AND $x_fld <= $map_xmax AND $y_fld >= $map_ymin AND $y_fld <= $map_ymax";
+                        
+                        $sql = ("$sql_SELECT  $sql_WHERE");
+                        //error_log($sql);
+  
+                        // Connect to DB and retrieve data
+                        $dbh = DB::connect($dsn);
+                        if (DB::isError($dbh)) {
+                            db_logErrors($dbh);
+                            die();
+                        }
+                        
+                        // Execute query
+                        $res = $dbh->query($sql);
+                        if (DB::isError($res)) {
+                            db_logErrors($res);
+                            die();
+                        }
+    
+                        while ($xyRow = $res->fetchRow()) {
+                            $ptX = $xyRow[0];
+                            $ptY = $xyRow[1];
+                            $clIdx = $xyRow[2];
+                            //error_log("$ptX  ");
+                            
+                            $xyPoint = ms_newPointObj();
+                            $xyPoint->setXY($ptX, $ptY);
+                            
+                            // Change PROJECTION to map projection if necessary || DOES NOT WORK CORRECTLY!!!
+                            if ($changeLayProj) {
+                                $xyPoint->project($this->xyLayerProjObj, $this->mapProjObj);
+                                //$myX = $xyPoint->x;
+                                //error_log("X: $myX");
+                            }
+                            $xyPoint->draw($this->map, $mLayer, $img, $clIdx, "");
+                            $xyPoint->free();
+                        }
+                        
+                        $res->free();
+                        $dbh->disconnect();
+                        
+                    }
+                }
+            }
+        }
+    }
+    
+    function checkProjection($xyLayer)
+    {
+        $mapProjStr    = $this->map->getProjection();
+        $xyLayerProjStr = $xyLayer->getProjection();
+        //error_log("$mapProjStr \n $xyLayerProjStr");
+    
+        if ($mapProjStr && $xyLayerProjStr && $mapProjStr != $xyLayerProjStr) {
+            $this->changeLayProj = 1;
+            $this->mapProjObj = ms_newprojectionobj($mapProjStr);
+            $this->xyLayerProjObj = ms_newprojectionobj($xyLayerProjStr);
+            //echo "pippo"; 
+        } else {
+            $this->changeLayProj = 0;
+        }
+        return $this->changeLayProj;
+    }
+
+
+}
+
+
+?>

Added: incphp/modules/export/exportquery.php
===================================================================
--- incphp/modules/export/exportquery.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/modules/export/exportquery.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,123 @@
+<?php
+/*********************************************************************************
+ Copyright (c) 2002-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+
+
+class ExportQuery
+{
+    function ExportQuery($json)
+    {
+        $this->jsonList = parseJSON($json);
+
+    }
+
+
+    /**
+     * Export results to Excel 5 spreadsheet
+     * requires PEAR modules OLE and Spreadsheet_Excel_Writer
+     */
+    function export_excel()
+    {
+        require_once 'Spreadsheet/Excel/Writer.php';
+        
+        $groups = $this->jsonList[0];  
+
+        $workbook = new Spreadsheet_Excel_Writer();
+        
+        $format_bold =& $workbook->addFormat();
+        $format_bold->setBold();
+        $format_title =& $workbook->addFormat();
+        $format_title->setBold();
+        $format_title->setColor('blue');
+        
+        $worksheet =& $workbook->addWorksheet();
+        
+        $r = 0;
+        foreach ($groups as $grp) {
+            //echo $grp->name . "\n";
+            $worksheet->write($r, 0, $grp->description, $format_title);
+            $r++;
+            
+            $headerList = $grp->header; 
+            $hL = count($headerList);
+            $col = 0;
+            for ($hi=0; $hi < $hL; $hi++) {
+                $headline = $headerList[$hi];
+                if ($headline == "@") {
+                    //$col--;
+                } else {
+                    $worksheet->write($r, $col, $headline, $format_bold);
+                    $col++;
+                }
+            }
+            $r++;
+            
+            $values = $grp->values; 
+            
+            foreach ($values as $vList) {
+                $vcol = 0;
+                foreach ($vList as $v) {
+
+                    if (is_object($v)) {
+                        $shplink = $v->shplink;
+                        if ($shplink) {
+                        }
+                        
+                        $hyperlink = $v->hyperlink;
+                        if ($hyperlink) {
+                            $worksheet->write($r, $vcol, $hyperlink[3]);           
+                            $vcol++;
+                        }
+                    
+                    } else {
+                        //error_log(" $v, "); 
+                        $worksheet->write($r, $vcol, $v); 
+                        $vcol++;
+                    }
+                }
+                $r++;
+            }
+            
+            $r++;
+            
+            
+        }
+    
+        
+        $workbook->send('test.xls');
+        $workbook->close();
+        
+    }
+    
+}
+
+
+
+$json = file("testresult.txt");
+
+require_once("../common.php");
+//print_r(parseJSON($json[0]));
+
+$export = new ExportQuery($json[0]);
+$export->export_excel();
+
+?>
\ No newline at end of file

Added: incphp/modules/export/testresult.txt
===================================================================
--- incphp/modules/export/testresult.txt	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/modules/export/testresult.txt	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1 @@
+[ [{"name": "countries", "description": "Countries", "header": ["@","Name","Area"], "values": [ [{"shplink": ["countries","11","4008125.859932+2684688.9415412+4702289.3128702+3561283.5862486"]}, "Germany", "357210446577.205"]]} , {"name": "cities", "description": "Cities", "header": ["@","Name","Administrative Entity","Country","Status","Inhabitants"], "values": [ [{"shplink": ["cities","226","4095636.3905495+3086841.1348855+4115636.4055193+3106841.1577069"]}, {"hyperlink": ["cities","CITY_NAME","Koln","Köln"]}, "Nordrhein-Westfalen", {"hyperlink": ["cities","CNTRY_NAME","Germany","Link on detail"]}, "Other", "500,000 to 1,000,000"], [{"shplink": ["cities","232","4106308.749611+3063269.1402337+4126308.7645932+3083269.1630262"]}, {"hyperlink": ["cities","CITY_NAME","Bonn","Bonn"]}, "Nordrhein-Westfalen", {"hyperlink": ["cities","CNTRY_NAME","Germany","Link on detail"]}, "Other", "250,000 to 500,000"]]} ], {"allextent": "", "zoomall": false, "autozoom": false, "infoWin": "window"}  ]
\ No newline at end of file

Added: incphp/print/fonts/.noencode
===================================================================

Added: incphp/print/fonts/FreeSans.ctg.z
===================================================================
(Binary files differ)


Property changes on: incphp/print/fonts/FreeSans.ctg.z
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: incphp/print/fonts/FreeSans.z
===================================================================
(Binary files differ)


Property changes on: incphp/print/fonts/FreeSans.z
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: incphp/print/fonts/FreeSansBold.ctg.z
===================================================================
--- incphp/print/fonts/FreeSansBold.ctg.z	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/print/fonts/FreeSansBold.ctg.z	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,4 @@
+xœíÛuUÕðo}ëÐÝ]
Ò‚” H‡4Rҍ¨H	Jˆ” Ò(Ò)% „”tw‡ Ô»ïÃøžúÔ'ÈŒ|¿™}ÖٽξgîøMüí®Ÿqˆ€ˆˆ„Ȉ‚¨ˆ†èˆ˜ˆ…؈ƒ¸ˆ‡øH€„H„ÄH‚¤H†äH”H…ÔHƒGð(ÃãH‹tHȈLÈŒ,ÈŠ'
Ù‘O"'r!7ò /ò!?žBÄÓ(„Â(‚¢(†gPÏâ9<P%ñ"^B)¼ŒÒ(ƒ²(‡ò¨€Š¨„ʨ‚WPÕP5PµPû=á暑WQõP
Я¡£	š†zš¡9Z %Z¡5Ú -Ú¡=^G¼7ñ:âmtBgtAWtÃ;èŽx=ѽñú /úá}|€þ€„1a†b†c>ÆHŒÂ'1‹q	˜ˆIøŸa2¦`*¦a:f`&fás|Ùøs0ó0°‹°K°Ë°_aVbVc
¾ÆZ¬Ãz|ƒo±±	›ñ¶`+¶a;và{ìÄ.ìÆìÅ>ìÇÄ!ÆÅ1Ç	œÄ)œÆœÅ9œÇ\Ä%\Æü€«¸†ñ®ãnânÌŒæX‹h‘,²E±¨Í¢[‹i±,¶Å±¸Ïâ[Kh‰,±%±¤–Ì’[
+Ki©,µ¥±GìQ{Ì·´–ÎÒ[Ëh™,³e±¬ö„e³ì–Þ´œ–Ër[Ëkù,¿=e¬ =m…þÈl…ïÉ{ò¿÷(bE­˜=cÅíY{Ξ·¬„•´í%+e/[i+ce­œ•·
+VÑ*Ye«šóŠU
Ï­fÕñ†Õ´ZVÛêØ«V×êÝY¹¾5°†w÷yÍYckbM­™5·ᶖÖ*[[›plkí±½½Žìp|ÓÞ²Žö¶u²Î÷ÿD>Öźþî˜nöŽu·ö®õü;rú§°^Öûîý{wbŸŸõ÷µ~ö¾}`ým€
Õ…ʇ68týȆØPfÃm„}l#m”}b£mŒµq6Þ&ØÄИIö©}f“mŠMµi6ÝfØL›eŸÛ6Û¾´96×æÙ|[`m‘-¶%¶Ô–ÙrûÊVØJ[e«m}mkm­·oì[Û`m“m¶ïþ†sÙb[m›m·ö½í´]¶ÛöØ^Ûgû퀴CvØŽØQ;fÇ턝´SvÚÎØY;gçí‚]´KvÙ®Øvծُö“]·vÓnÙm‚FÒ0#2#3
+£2£3c2c3ã2ã323	“2“3S2S3
á£|Œ3-Ó1=30#313³0+Ÿ`6fg>y¿Î…9™‹¹™‡y™ùù° Ÿf!fe1>Ãâ|–Ïñy¾À,ÉùKñe–f–e9–gVd%Vf¾Âª¬Æê¬Áš¬ÅÚ¬ÃWY—õXŸ
ؐ¯±³IxצlŽÍÙâN-ÙŠ­Ù†mÙŽíù:;ð
¾É·Ø‘o³;³»²ßawöà»ìÉ^ìÍ÷؇}ُïóöç ä ~ÈÁáõ>âûufòKÊaÎü˜#9ŠŸp4Ç„ZÇrÇs'r?ågœÌ)¿1*§q:gp&gñs~ÁÙü’s8—ó8Ÿ¸‹¸˜K¸”˸œ_qWrWÿlþ~͵\Çõ÷äi¾á·ÜÀÜÄÍwÛþã_Š[Be+·…®Û¹ãnë÷÷bw‘‡wrws÷r÷ó òóòóOòOóÏò\xüy^àE^âe^	×àU^ãü‰×yƒ7y‹·nNw<‚GôHÙ£xTæÑ=†ÇôXÛãx\çñ='ôDžØ“xROöïõ<¹§ð”žÊS{špýÔóÇ=­§óôž!Ô’1T2…JæPÉâYý	ÏæÙ=‡?é9=—çö<ž×óy~ÊxAÚya/âE½˜?ãÅýYΟ÷¼„—¯ÿ¢¿ä¥üe/íe¼¬—óò^Á+z%¯ìUü¯êÕ¼º×ðš^Ëk{Õëz=¯ï
¼¡¿æ¼±7ñ¦ÞÌ›{oé­¼µ·ñ¶ÞÎÛûëÞÁßð7ý-ïèo{'ïÚ«‹wõnþŽw÷þ®÷ô^ÞÛßó>Þ×ûùû¡þ¼¿ð>È?ôÁþ‘ñ¡>̇ûÿ8œëHåŸøhãcCµq>Þ'øDŸäŸúg>Ù§øTŸæÓ}†ÏôYþ¹á³ýËð¼9>×ç…â|_à}‘/ö%¾Ô—ùò?ú–øW¾âÎÝJ_å«CqíkCq¯÷oîô}û+37ü¢e£oú•q›Ùv/ùo~Ké[|«oóí÷p¯¡ò}ñä;ØλÔÎÿ$¾ûNÜó«½{}ßµì¿Ï	ý	~àN<è‡l&"""~ЈˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆÈïó#~ԏùq?á'ý”Ÿö3:£ÏÏþéçîG"""òpðó~áÿšwÑ/ùe¿â?øU¿æ?úO~ÝoøM¿å·0ð "ƒHAä J5ˆуAÌ V;t'TâñB×øA‚Ð5a(H$	’É‚äAŠ eê^?­ˆˆÈ_¤~Јü5ÿž‡²
\ No newline at end of file

Added: incphp/print/fonts/FreeSansBold.z
===================================================================
(Binary files differ)


Property changes on: incphp/print/fonts/FreeSansBold.z
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: incphp/print/fonts/FreeSansBoldOblique.ctg.z
===================================================================
(Binary files differ)


Property changes on: incphp/print/fonts/FreeSansBoldOblique.ctg.z
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: incphp/print/fonts/FreeSansBoldOblique.z
===================================================================
(Binary files differ)


Property changes on: incphp/print/fonts/FreeSansBoldOblique.z
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: incphp/print/fonts/FreeSansOblique.ctg.z
===================================================================
(Binary files differ)


Property changes on: incphp/print/fonts/FreeSansOblique.ctg.z
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: incphp/print/fonts/FreeSansOblique.z
===================================================================
(Binary files differ)


Property changes on: incphp/print/fonts/FreeSansOblique.z
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: incphp/print/fonts/README.TXT
===================================================================
--- incphp/print/fonts/README.TXT	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/print/fonts/README.TXT	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,19 @@
+To embed TrueType fonts (.TTF) files, you need to extract the font metrics and 
+build the required tables using the provided utility (/fonts/ttf2ufm). 
+
+TTF2UFM is a modified version of Mark Heath's TTF 2 PT1 converter 
+(http://ttf2pt1.sourceforge.net/) by Steven Wittens <steven at acko.net> 
+(http://www.acko.net/blog/ufpdf). ttf2ufm, is included in /ttf2ufm-src. 
+The /fonts/ttf2ufm folder contains a compiled Windows binary. 
+TTF 2 UFM is identical to TTF 2 PT1 except that it also generates a .ufm file 
+for usage with makefontuni.php.
+
+
+Setting up a Truetype font for usage with TCPDF:
+  1) Generate the font's .ufm metrics file by processing it with the provided 
+     ttf2ufm program (modified ttf2pt1). For example:
+     $ ttf2ufm -a -F myfont.ttf
+  2) Run makefontuni.php with the .ttf and .ufm filenames as argument:
+     $ php -q makefontuni.php myfont.ttf myfont.ufm
+  3) Copy the resulting .php, .z and .ctg.z file to the TCPDF font directory.
+  
\ No newline at end of file

Added: incphp/print/fonts/freefont/AUTHORS
===================================================================
--- incphp/print/fonts/freefont/AUTHORS	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/print/fonts/freefont/AUTHORS	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,143 @@
+-*-text-*-
+$Id: AUTHORS,v 1.5 2003/10/08 12:22:24 peterlin Exp $
+
+The free UCS scalable font collection is being maintained by Primo¾
+Peterlin <primoz.peterlin AT biofiz.mf.uni-lj.si>. The folowing list
+cites the other contributors that contributed to particular ISO 10646
+blocks.
+
+* URW++ Design & Development GmbH <http://www.urwpp.de/>
+
+	Basic Latin				(U+0041-U+007A)
+	Latin-1 Supplement                      (U+00C0-U+00FF) (most)
+	Latin Extended-A                        (U+0100-U+017F)
+	Spacing Modifier Letters		(U+02B0-U+02FF)
+	Mathematical Operators			(U+2200-U+22FF) (parts)
+	Block Elements				(U+2580-U+259F)
+	Dingbats				(U+2700-U+27BF)
+
+* Yannis Haralambous <yannis.haralambous AT enst-bretagne.fr> and John
+  Plaice <plaice AT omega.cse.unsw.edu.au>
+
+	Latin Extended-B                        (U+0180-U+024F)
+	IPA Extensions				(U+0250-U+02AF)
+	Greek					(U+0370-U+03FF)
+	Armenian				(U+0530-U+058F)
+	Hebrew					(U+0590-U+05FF)
+	Arabic					(U+0600-U+06FF)
+	Currency Symbols			(U+20A0-U+20CF)
+	Arabic Presentation Forms-A		(U+FB50-U+FDFF)
+	Arabic Presentation Forms-B		(U+FE70-U+FEFF)
+
+* Young U. Ryu <ryoung AT utdallas.edu>
+
+	Arrows					(U+2190-U+21FF)
+	Mathematical Symbols			(U+2200-U+22FF)
+
+* Valek Filippov <frob AT df.ru>
+
+	Cyrillic				(U+0400-U+04FF)
+
+* Wadalab Kanji Comittee
+
+	Hiragana				(U+3040-U+309F)
+	Katakana				(U+30A0-U+30FF)
+
+* Angelo Haritsis <ah AT computer.org>
+
+	Greek					(U+0370-U+03FF)
+
+* Yannis Haralambous and Virach Sornlertlamvanich
+
+	Thai					(U+0E00-U+0E7F)
+
+* Shaheed R. Haque <srhaque AT iee.org>
+
+	Bengali					(U+0980-U+09FF)
+
+* Sam Stepanyan <sam AT arminco.com>
+
+	Armenian				(U+0530-U+058F)
+
+* Mohamed Ishan <ishan AT mitf.f2s.com>
+
+	Thaana					(U+0780-U+07BF)
+
+* Sushant Kumar Dash <sushant AT writeme.com>
+
+	Oriya					(U+0B00-U+0B7F)
+
+* Harsh Kumar <harshkumar AT vsnl.com>
+
+	Devanagari				(U+0900-U+097F)
+	Bengali					(U+0980-U+09FF)
+	Gurmukhi				(U+0A00-U+0A7F)
+	Gujarati				(U+0A80-U+0AFF)
+
+* Prasad A. Chodavarapu <chprasad AT hotmail.com>
+
+	Telugu					(U+0C00-U+0C7F)
+
+* Frans Velthuis <velthuis AT rc.rug.nl> and Anshuman Pandey
+  <apandey AT u.washington.edu> 
+
+	Devanagari				(U+0900-U+097F)
+
+* Hardip Singh Pannu <HSPannu AT aol.com>
+
+	Gurmukhi				(U+0A00-U+0A7F)
+
+* Jeroen Hellingman <jehe AT kabelfoon.nl>
+
+	Oriya					(U+0B00-U+0B7F)
+	Malayalam				(U+0D00-U+0D7F)
+
+* Thomas Ridgeway <email needed>
+
+	Tamil					(U+0B80-U+0BFF)
+
+* Berhanu Beyene <1beyene AT informatik.uni-hamburg.de>,
+  Prof. Dr. Manfred Kudlek <kudlek AT informatik.uni-hamburg.de>, Olaf
+  Kummer <kummer AT informatik.uni-hamburg.de>, and Jochen Metzinger <?>
+
+	Ethiopic				(U+1200-U+137F)
+
+* Maxim Iorsh <iorsh AT users.sourceforge.net>
+
+	Hebrew					(U+0590-U+05FF)
+
+
+* Vyacheslav Dikonov <sdiconov AT mail.ru>
+
+	Syriac					(U+0700-U+074A)
+	Braille					(U+2800-U+28FF)
+
+* M.S. Sridhar <mssridhar AT vsnl.com>
+
+	Devanagari				(U+0900-U+097F)
+	Bengali					(U+0980-U+09FF)
+	Gurmukhi				(U+0A00-U+0A7F)
+	Gujarati				(U+0A80-U+0AFF)
+	Oriya					(U+0B00-U+0B7F)
+	Tamil					(U+0B80-U+0BFF)
+	Telugu					(U+0C00-U+0C7F)
+	Kannada					(U+0C80-U+0CFF)	
+	Malayalam				(U+0D00-U+0D7F)
+
+* DMS Electronics, The Sri Lanka Tipitaka Project, and Noah Levitt
+  <nlevitt AT columbia.edu>
+
+	Sinhala					(U+0D80-U+0DFF)
+        
+* Dan Shurovich Chirkov <dansh AT chirkov.com>
+
+	Cyrillic				(U+0400-U+04FF)
+
+* Abbas Izad <abbasizad AT hotmail.com>
+
+	Arabic					(U+0600-U+06FF)
+	Arabic Presentation Forms-A		(U+FB50-U+FDFF)
+	Arabic Presentation Forms-B		(U+FE70-U+FEFF)
+
+Please see the CREDITS file for details on who contributed particular
+subsets of the glyphs in font files.

Added: incphp/print/fonts/freefont/CREDITS
===================================================================
--- incphp/print/fonts/freefont/CREDITS	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/print/fonts/freefont/CREDITS	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,388 @@
+-*-text-*-
+$Id: CREDITS,v 1.4 2003/03/27 08:40:03 peterlin Exp $
+
+This file lists the contributors and contributions to the free UCS
+scalable font project.
+
+
+* URW++ Design & Development GmbH <http://www.urwpp.de/>
+
+URW++ donated a set of 35 core PostScript Type 1 fonts to the
+Ghostscript project <http://www.cs.wisc.edu/~ghost/>, to be available
+under the terms of GNU General Public License (GPL).
+
+	Basic Latin				(U+0041-U+007A)
+	Latin-1 Supplement                      (U+00C0-U+00FF)
+	Latin Extended-A                        (U+0100-U+017F)
+	Spacing Modifier Letters		(U+02B0-U+02FF)
+	Mathematical Operators			(U+2200-U+22FF)
+	Block Elements				(U+2580-U+259F)
+	Dingbats				(U+2700-U+27BF)
+
+
+* Yannis Haralambous <yannis.haralambous AT enst-bretagne.fr> and John
+  Plaice <plaice AT omega.cse.unsw.edu.au>
+
+Yannis Haralambous and John Plaice are the authors of Omega
+typesetting system, <http://omega.cse.unsw.edu.au/>. Omega is an
+extension of TeX. Its first release, aims primarily at improving TeX's
+multilingual abilities. In Omega all characters and pointers into
+data-structures are 16-bit wide, instead of 8-bit, thereby eliminating
+many of the trivial limitations of TeX. Omega also allows multiple
+input and output character sets, and uses programmable filters to
+translate from one encoding to another, to perform contextual
+analysis, etc. Internally, Omega uses the universal 16-bit Unicode
+standard character set, based on ISO-10646. These improvements not
+only make it a lot easier for TeX users to cope with multiple or
+complex languages, like Arabic, Indic, Khmer, Chinese, Japanese or
+Korean, in one document, but will also form the basis for future
+developments in other areas, such as native color support and
+hypertext features. ... Fonts for UT1 (omlgc family) and UT2 (omah
+family) are under development: these fonts are in PostScript format
+and visually close to Times and Helvetica font families. (from the
+Omega WWW site). Omega fonts are available subject to GPL
+<http://www.ctan.org/tex-archive/help/Catalogue/entries/omegafonts.html>.
+
+	Latin Extended-B                        (U+0180-U+024F)
+	IPA Extensions				(U+0250-U+02AF)
+	Greek					(U+0370-U+03FF)
+	Armenian				(U+0530-U+058F)
+	Hebrew					(U+0590-U+05FF)
+	Arabic					(U+0600-U+06FF)
+	Currency Symbols			(U+20A0-U+20CF)
+	Arabic Presentation Forms-A		(U+FB50-U+FDFF)
+	Arabic Presentation Forms-B		(U+FE70-U+FEFF)
+
+
+* Valek Filippov <frob AT df.ru>
+
+Valek Filippov added Cyrillic glyphs and composite Latin Extended A to
+the whole set of the abovementioned URW set of 35 PostScript core
+fonts, <ftp://ftp.gnome.ru/fonts/urw/>. The fonts are available under
+GPL.
+
+	Latin Extended-A                        (U+0100-U+017F)
+	Cyrillic				(U+0400-U+04FF)
+
+
+* Wadalab Kanji Comittee
+
+Between April 1990 and March 1992, Wadalab Kanji Comittee put together
+a series of scalable font files with Japanese scripts, in four forms:
+Sai Micho, Chu Mincho, Cho Kaku and Saimaru. The font files are
+written in custom file format, while tools for conversion into
+Metafont and PostScript Type 1 are also supplied. The Wadalab Kanji
+Comittee has later been dismissed, and the resulting files can be now
+found on the FTP server of the Depertment of Mathematical Engineering
+and Information Physics, Faculty of Engineering, University of Tokyo
+<ftp://ftp.ipl.t.u-tokyo.ac.jp/Font/>.
+
+	Hiragana				(U+3040-U+309F)
+	Katakana				(U+30A0-U+30FF)
+
+
+* Young U. Ryu <ryoung AT utdallas.edu>
+
+Young Ryu is the author of Txfonts, a set of mathematical symbols
+designed to accompany text typeset in Times or its variants. In the
+documentation, Young adresses the design of mathematical symbols: "The
+Adobe Times fonts are thicker than the CM fonts. Designing math fonts
+for Times based on the rule thickness of Times = , , + , / , < ,
+etc. would result in too thick math symbols, in my opinion. In the TX
+fonts, these glyphs are thinner than those of original Times
+fonts. That is, the rule thickness of these glyphs is around 85% of
+that of the Times fonts, but still thicker than that of the CM fonts."
+TX fonts are are distributed under the GNU public license
+(GPL). Pointers to their location are available on
+<http://www.utdallas.edu/~ryoung/txfonts/>.
+
+	Arrows					(U+2190-U+21FF)
+	Mathematical Symbols			(U+2200-U+22FF)
+
+
+* Angelo Haritsis <ah AT computer.org>
+
+Angelo Haritsis has compiled a set of Greek Type 1 fonts, available on
+<ftp://ftp.hellug.gr/pub/unix/linux/GREEK/fonts/greekXfonts-Type1-1.1.tgz>.
+The glyphs from this source has been used to compose Greek glyphs in
+FreeSans and FreeMono.
+
+Angelo's licence says: "You can enjoy free use of these fonts for
+educational or commercial purposes.  All derived works should include
+this paragraph.  If you want to change something please let me have
+your changes (via email) so that they can go into the next
+version. You can also send comments etc to the above address."
+
+	Greek					(U+0370-U+03FF)
+
+
+* Yannis Haralambous and Virach Sornlertlamvanich
+
+In 1999, Yannis Haralambous and Virach Sornlertlamvanich made a set of
+glyphs covering the Thai national standard NF3, in both upright and
+slanted shape. The collection of glyphs have been made part of GNU
+intlfonts 1.2 package and is available on
+<ftp://ftp.gnu.org/pub/gnu/intlfonts/> under GPL.
+
+	Thai					(U+0E00-U+0E7F)
+
+
+* Shaheed R. Haque <srhaque AT iee.org>
+
+Shaheed Haque has developed a basic set of basic Bengali glyphs
+(without ligatures), using ISO10646 encoding. They are available under
+the XFree86 license at <http://www.btinternet.com/~shaheedhaque/>.
+
+Copyright (C) 2001 S.R.Haque <srhaque AT iee.org>.  All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL S.R.HAQUE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of S.R.Haque shall not be
+used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from
+S.R.Haque.
+
+	Bengali					(U+0980-U+09FF)
+
+
+* Sam Stepanyan <sam AT arminco.com>
+
+Sam Stepanyan created a set of Armenian sans serif glyphs visually
+compatible with Helvetica or Arial. Available on
+<http://www.editum.com.ar/mashtots/html/fonts/ara.tar.gz>. On
+2002-01-24, Sam writes: "Arial Armenian font is free for
+non-commercial use, so it is OK to use under GPL license."
+
+	Armenian				(U+0530-U+058F)
+
+
+* Mohamed Ishan <ishan AT mitf.f2s.com>
+
+Mohamed Ishan has started a Thaana Unicode Project
+<http://thaana.sourceforge.net/> and among other things created a
+couple of Thaana fonts, available under FDL or BDF license.
+
+	Thaana					(U+0780-U+07BF)
+
+
+* Sushant Kumar Dash <sushant AT writeme.com> (*)
+
+Sushant Dash has created a font in his mother tongue, Oriya. As he
+states on his web page <http://members.tripod.com/~sushantdash/>:
+"Please feel free to foreword this mail to your Oriya friends. No
+copyright law is applied for this font. It is totally free!!! Feel
+free to modify this using any font editing tools. This is designed for
+people like me, who are away from Orissa and want to write letters
+home using Computers, but suffer due to unavailability of Oriya
+fonts.(Or the cost of the available packages are too much)."
+
+	Oriya					(U+0B00-U+0B7F)
+
+
+* Harsh Kumar <harshkumar AT vsnl.com>
+
+Harsh Kumar has started BharatBhasha <http://www.bharatbhasha.net/> -
+an effort to provide "FREE software, Tutorial, Source Codes
+etc. available for working in Hindi, Marathi, Gujarati, Gurmukhi and
+Bangla. You can type text, write Web pages or develop Indian Languages
+Applications on Windows and on Linux. We also offer FREE help to
+users, enthusiasts and software developers for their work in Indian
+languages."
+
+	Devanagari				(U+0900-U+097F)
+	Bengali					(U+0980-U+09FF)
+	Gurmukhi				(U+0A00-U+0A7F)
+	Gujarati				(U+0A80-U+0AFF)
+
+
+* Prasad A. Chodavarapu <chprasad AT hotmail.com>
+
+Prasad A. Chodavarapu created Tikkana, a Telugu font available in Type
+1 and TrueType format on <http://chaitanya.bhaavana.net/fonts/>. 
+Tikkana exceeds the Unicode Telugu range with some composite glyphs.
+Available under the GNU General Public License.
+
+	Telugu					(U+0C00-U+0C7F)
+
+
+* Frans Velthuis <velthuis AT rc.rug.nl> and Anshuman Pandey
+  <apandey AT u.washington.edu>
+
+In 1991, Frans Velthuis from the Groningen University, The
+Netherlands, released a Devanagari font as Metafont source, available
+under the terms of GNU GPL. Later, Anshuman Pandey from the Washington
+University, Seattle, USA, took over the maintenance of font. Fonts can
+be found on CTAN, <ftp://ftp.dante.de/tex-archive/language/devanagari/>. I
+converted the font to Type 1 format using Péter Szabó's TeXtrace
+program <http://www.inf.bme.hu/~pts/textrace/> and removed some
+redundant control points with PfaEdit.
+
+	Devanagari				(U+0900-U+097F)
+
+
+* Hardip Singh Pannu <HSPannu AT aol.com>
+
+In 1991, Hardip Singh Pannu has created a free Gurmukhi TrueType font,
+available as regular, bold, oblique and bold oblique form. Its license
+says "Please remember that these fonts are copyrighted (by me) and are
+for non-profit use only." 
+
+	Gurmukhi				(U+0A00-U+0A7F)
+
+
+* Jeroen Hellingman <jehe AT kabelfoon.nl>
+
+Jeroen Hellingman created a set of Malayalam metafonts in 1994, and a
+set of Oriya metafonts in 1996. Malayalam fonts were created as
+uniform stroke only, while Oriya metafonts exist in both uniform and
+modulated stroke. From private communication: "It is my intention to
+release the fonts under GPL, but not all copies around have this
+notice on them." Metafonts can be found on CTAN,
+<ftp://ftp.dante.de/tex-archive/language/oriya/> and
+<ftp://ftp.dante.de/tex-archive/language/malayalam/>.
+
+	Oriya					(U+0B00-U+0B7F)
+	Malayalam				(U+0D00-U+0D7F)
+
+
+* Thomas Ridgeway <> (*)
+
+Thomas Ridgeway, then at the Humanities And Arts Computing Center,
+Washington University, Seattle, USA, (now defunct), created a Tamil
+metafont in 1990. Anshuman Pandey from the same university took over
+the maintenance of font. Fonts can be found at CTAN,
+<ftp://ftp.dante.de/tex-archive/language/tamil/wntamil/>.
+
+	Tamil					(U+0B80-U+0BFF)
+
+
+* Berhanu Beyene <1beyene AT informatik.uni-hamburg.de>,
+  Prof. Dr. Manfred Kudlek <kudlek AT informatik.uni-hamburg.de>, Olaf
+  Kummer <kummer AT informatik.uni-hamburg.de>, and Jochen Metzinger <?>
+
+Beyene, Kudlek, Kummer and Metzinger from the Theoretical Foundations
+of Computer Science, University of Hamburg, prepared a set of Ethiopic
+metafonts, found on
+<ftp://ftp.dante.de/tex-archive/language/ethiopia/ethiop/>. They also
+maintain home page on the Ethiopic font project,
+<http://www.informatik.uni-hamburg.de/TGI/mitarbeiter/wimis/kummer/ethiop_eng.html>,
+and can be reached at <ethiop AT informatik.uni-hamburg.de>. The current
+version of fonts is 0.7 (1998), and they are released under GNU GPL. I
+converted the fonts to Type 1 format using Péter Szabó's TeXtrace
+program <http://www.inf.bme.hu/~pts/textrace/> and removed some
+redundant control points with PfaEdit.
+
+	Ethiopic				(U+1200-U+137F)
+
+
+* Maxim Iorsh <iorsh AT users.sourceforge.net>
+
+In 2002, Maxim Iorsh started the Culmus project, aiming at providing
+Hebrew-speaking Linux and Unix community with a basic collection of
+Hebrew fonts for X Windows. The fonts are visually compatible with
+URW++ Century Schoolbook L, URW++ Nimbus Sans L and URW++ Nimbus Mono
+L families, respectively, and are released under GNU GPL license. See
+also <http://culmus.sourceforge.net/>.
+
+	Hebrew					(U+0590-U+05FF)
+
+
+* Vyacheslav Dikonov <sdiconov AT mail.ru>
+
+Vyacheslav Dikonov made a braille unicode font that could be merged
+with the UCS fonts to fill the 2800-28FF range completely. (uniform
+scaling is possible to adapt it to any cell size). He also contributed
+a free syriac font, whose glyphs (about half of them) are borrowed
+from the "Carlo Ator" font freely downloadable from
+<http://www.aacf.asso.fr/>. Vyacheslav also filled in a few missing
+spots in the U+2000-U+27FF area, e.g. the box drawing section, sets of
+subscript and superscript digits and capital Roman numbers.
+
+	Syriac					(U+0700-U+074A)
+	Box Drawing				(U+2500-U+257F)
+	Braille					(U+2800-U+28FF)
+
+
+* M.S. Sridhar <mssridhar AT vsnl.com>
+
+M/S Cyberscape Multimedia Limited, Mumbai, developers of Akruti
+Software for Indian Languages (http://www.akruti.com/), have released
+a set of TTF fonts for nine Indian scripts (Devanagari, Gujarati,
+Telugu, Tamil, Malayalam, Kannada, Bengali, Oriya, and Gurumukhi)
+under the GNU General Public License (GPL). You can download the fonts
+from the Free Software Foundation of India WWW site
+(http://www.gnu.org.in/software/software.html#akruti) or from the
+Akruti website.
+
+For any further information or assistance regarding these fonts,
+please contact mssridhar AT vsnl.com.
+
+	Devanagari				(U+0900-U+097F)
+	Bengali					(U+0980-U+09FF)
+	Gurmukhi				(U+0A00-U+0A7F)
+	Gujarati				(U+0A80-U+0AFF)
+	Oriya					(U+0B00-U+0B7F)
+	Tamil					(U+0B80-U+0BFF)
+	Telugu					(U+0C00-U+0C7F)
+	Kannada					(U+0C80-U+0CFF)	
+	Malayalam				(U+0D00-U+0D7F)
+
+
+* DMS Electronics, The Sri Lanka Tipitaka Project, and Noah Levitt
+  <nlevitt AT columbia.edu>
+
+Noah Levitt found out that the Sinhalese fonts available on the site
+<http://www.metta.lk/fonts/> are released under GNU GPL, or,
+precisely, "Public Domain under GNU Licence
 Produced by DMS
+Electronics for The Sri Lanka Tipitaka Project" (taken from the font
+comment), and took the effort of recoding the font to Unicode.
+
+	Sinhala					(U+0D80-U+0DFF)
+       
+
+* Daniel Shurovich Chirkov <dansh AT chirkov.com>
+
+Dan Chirkov updated the FreeSerif font with the missing Cyrillic
+glyphs needed for conformance to Unicode 3.2. The effort is part of
+the Slavjanskij package for Mac OS X,
+<http://www.versiontracker.com/dyn/moreinfo/macosx/18680>.
+
+	Cyrillic				(U+0400-U+04FF)
+
+
+* Primo¾ Peterlin <primoz.peterlin AT biofiz.mf.uni-lj.si>
+
+Primo¾ Peterlin filled in missing glyphs here and there (e.g. Latin
+Extended-B and IPA Extensions ranges in the FreeMono familiy), and
+created the following UCS blocks:
+
+	Latin Extended-B                        (U+0180-U+024F)
+	IPA Extensions				(U+0250-U+02AF)
+	Arrows					(U+2190-U+21FF)
+	Box Drawing				(U+2500-U+257F)
+	Block Elements				(U+2580-U+259F)
+	Geometrical Shapes			(U+25A0-U+25FF)
+
+
+Notes:
+
+*: The glyph collection looks license-compatible, but its author has
+   not yet replied and agreed on his/her work being used in part of
+   this glyph collection.

Added: incphp/print/fonts/freefont/ChangeLog
===================================================================
--- incphp/print/fonts/freefont/ChangeLog	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/print/fonts/freefont/ChangeLog	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,630 @@
+2003-10-08  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* FreeMonoOblique.sfd, FreeSerifBoldItalic.sfd,
+	FreeSerifItalic.sfd - applied Josef Segur's corrections from
+	Oct. 5.
+
+2003-10-02  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerif.sfd - Abbas Izad's contributed Arabic/Farsi
+	characters added.
+	
+	* sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd,
+	sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd,
+	sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd,
+	sfd/FreeSansBoldOblique.sfd, sfd/FreeSerif.sfd,
+	sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd,
+	sfd/FreeSerifBoldItalic.sfd - Combining characters (U+0300 -
+	U+036F) moved left, so that they have negative horizontal values
+	and zero advance width.
+
+2003-09-15  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerifBold.sfd, sfd/FreeSerifItalic.sfd - Started working
+	on super- and subscripts. 
+
+2003-09-12  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSans.sfd, sfd/FreeSerif.sfd - Added some missing
+	 Hiragana and Katakana characters.
+
+	* sfd/FreeSansBold.sfd - Cleared background characters in Latin
+	Extended-A. Added some automatically constructed characters in
+	Latin Extended-B. Started with superscripts and subscripts.
+
+	* sfd/FreeSans.sfd - Subscript numerals (U+2080-U+2089) completed.
+	
+2003-05-19  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerif.sfd - Thai characters po pla and bo baimai
+	swapped; Thai character fongman corrected; all courtesy Theppitak
+	Karoonboonyanan.
+
+2003-05-17  Panayotis Katsaloulis  <panayotis at panayotis.com>
+
+	* sfd/FreeSerif.sfd, sfd/FreeSerifItalic.sfd,
+	sfd/FreeSerifBold.sfd, sfd/FreeSerifBoldItalic.sfd - Full support
+	of all ancient greek glyphs
+
+2003-05-15  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* tools/KerningNumerals.pl - A Perl script for moving kerning
+	information from ASCII numerals (U+0030...) to characters in the
+	Adobe corporate use area (U+F6xx).
+
+	* sfd/FreeSansBold.sfd, sfd/FreeSansOblique.sfd,
+	sfd/FreeSansBoldOblique.sfd - Created kerned numerals in the Adobe
+	corporate use area (U+F6xx) and moved kerning information from
+	ASCII numerals to the kerned numerals.
+
+2003-05-14  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSans.sfd - First approximation of super- and subscript
+	numerals and vulgar fractions.
+
+	* sfd/FreeSerif.sfd - Super- and subscript numerals complete,
+	vulgar fractions completed and redone as references rather than
+	outlines.
+
+2003-05-12  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerif.sfd - Clean-up of the Cyrillic letters added on
+	March 27; super- and subscripts, vulgar fractions.
+
+2003-05-09  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMonoBold.sfd - Added a couple of characters to
+	the Latin Extended-B area and the IPA extensions area.
+
+2003-05-08  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerifBoldItalic.sfd - Added a couple of characters to
+	the Latin Extended-B area.
+
+	* sfd/FreeSerif.sfd, sfd/FreeSerifItalic.sfd,
+	sfd/FreeSerifBold.sfd, sfd/FreeSerifBoldItalic.sfd - ASCII
+	numerals now monospaced; kerned numerals moved to Adobe corporate
+	use area
+	(U+F6xx).
+
+2003-05-07  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerif.sfd - Roman numerals now more complete.
+
+	* sfd/FreeSansOblique.sfd, sfd/FreeSansBoldOblique.sfd - Accented
+	characters added in the Latin Extended-B area.
+
+	* sfd/FreeSans.sfd - Greek accents added in the Greek Extended
+	area, characters added in the Latin Extended-B area, Roman
+	numerals added.
+
+	* sfd/FreeMonoOblique.sfd - Kerning pairs removed (what were they
+	doing in a monospaced font, anyway?).
+
+	* sfd/FreeMonoBoldOblique.sfd - Additions in Latin Extended-B and
+	Basic Greek.
+
+	* sfd/FreeMono.sfd, sfd/FreeMonoBold.sfd, sfd/FreeMonoOblique.sfd,
+	sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd,
+	sfd/FreeSansBold.sfd, sfd/FreeSansOblique.sfd,
+	sfd/FreeSansBoldOblique.sfd - Major cleanup (fixed widths, open
+	paths, path directions (clockwise/counter-clockwise), points
+	rounded to integer values; outlines simplified etc.)
+
+2003-05-06  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* tools/OS2UnicodeRange - A simple script to display OS/2 Unicode
+	range table in TrueType fonts.
+
+	* sfd/FreeSans.sfd, sfd/FreeSansBold.sfd - ASCII numerals now
+	monospaced; kerned numerals moved to Adobe corporate use area
+	(U+F6xx). FreeSans is done, FreeSansBold half-way.
+
+	* sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd,
+	sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd,
+	sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd,
+	sfd/FreeSansBoldOblique.sfd, sfd/FreeSerif.sfd,
+	sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd,
+	sfd/FreeSerifBoldItalic.sfd - Added 2003 in copyright info.
+
+2003-03-27  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerif.sfd - Cyrillic and Cyrillic Supplement blocks
+	brought to conformance with Unicode 3.2, courtesy Daniel Shurovich
+	Chirkov.
+
+2003-03-19  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSans.sfd, sfd/FreeSansOblique.sfd - somewhat wider
+	germandbls (U+00DF), due to complaints by Walter Schmidt.
+
+2003-03-18  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSans.sfd - Added Sinhala glyphs from the Tipitaka
+	project <http://www.metta.lk>, recoded to Unicode by Noah Levitt.
+
+2003-02-19  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSans.sfd - Minor changes on mathematical operators.
+
+2003-02-18  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - minor cleanup of glyph backgrounds; changed
+	integral signs (U+222B - U+2230)
+
+2003-02-05  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSans.sfd - added a couple of glyphs in the IPA and
+	African Latin ranges.
+
+2003-01-30  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSans.sfd, sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd,
+	sfd/FreeSansBoldOblique.sfd, sfd/FreeMonoBold.sfd,
+	sfd/FreeMonoBoldOblique.sfd - Corrected Maltese Hbar (U+0126)
+	and/or hbar (U+0127).
+
+2003-01-28  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerifItalic.sfd - Corrected Maltese hbar (U+0127).
+
+2002-12-18  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* tools/ConvertFont - PfaEdit script for converting SFD files to
+	TrueType fonts.
+
+	* sfd/FreeSans.sfd - Added Tamil and Kannada glyphs from the
+	Akruti Indic fonts.
+
+2002-12-17  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSans.sfd - Added Devanagari and Gujarati glyphs from the
+	Akruti Indic fonts.
+
+	* www/index.html - Added information on Rogier van Dalen's tools.
+
+	* AUTHORS - Added M.S. Sridhar.
+
+	* CREDITS - Correct spelling of Culmus project. Added M.S. Sridhar.
+
+2002-12-06  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - Added Braille glyphs, courtesy Vyacheslav
+	Dikonov.
+
+	* sfd/FreeSans.sfd - Added Unicode Syriac glyphs, courtesy
+	Vyacheslav Dikonov.
+
+2002-10-11  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* www/index.html - Added information on the availability of the
+	Debian GNU/Linux package.
+
+	* sfd/FreeSerif.sfd, sfd/FreeSans.sfd - added some kern pairs
+	beyond Latin-1 area.
+
+	* sfd/FreeSerif.sfd, sfd/FreeSerifItalic.sfd,
+	sfd/FreeSerifBold.sfd, sfd/FreeSerifBoldItalic.sfd - re-introduced
+	all the emtpy glyph slots (changes from Sep 23 made PfaEdit
+	crash). 
+
+2002-09-23  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerif.sfd, sfd/FreeSerifItalic.sfd,
+	sfd/FreeSerifBold.sfd, sfd/FreeSerifBoldItalic.sfd - imported
+	kerning information from the URW++ AFM files
+
+2002-09-11  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd,
+	sfd/FreeMonoOblique.sfd - updated Hebrew parts to comply with
+	Culmus v0.6.
+
+	* sfd/FreeSans.sfd, sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd,
+	sfd/FreeSansOblique.sfd - Added Danilo Segan's Serbian Cyrillic
+	glyphs; updated Hebrew parts to comply with Culmus v0.6.
+
+2002-09-09  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd,
+	sfd/FreeMonoOblique.sfd, sfd/FreeSans.sfd,
+	sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd,
+	sfd/FreeSansOblique.sfd - Updated Cyrillic part to match
+	Filippov's 1.0.7pre14
+
+	* sfd/FreeSansOblique.sfd - added Sam Stepanyan's Armenian glyphs
+	from FreeSans (skewed for 12 degrees).
+
+2002-09-06  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSans.sfd, sfd/FreeSansOblique.sfd,
+	sfd/FreeSansBold.sfd, sfd/FreeSansOblique.sfd - Added Maxim
+	Iorsh's Hebrew characters.
+
+2002-08-29  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd,
+	sfd/FreeMonoBold.sfd, sfd/FreeMonoOblique.sfd - Added Maxim
+	Iorsh's Hebrew characters.
+
+	* AUTHORS, CREDITS - Added Maxim Iorsh as author.
+
+2002-08-28  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* www/index.html - Added information of Microsoft's withdrawal of
+	freely available Unicode TrueType fonts
+
+	* www/resources.html - Added link to Maxim Iorsh's Culmus project.
+	
+2002-07-26  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - Added a couple of characters (Arrows area).
+
+2002-06-11  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - Applied Michalis Kabrianis's patch concerning
+	perispomeni in Greek politoniko.
+
+2002-05-23  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - Applied Michalis Kabrianis's patch concerning
+	psili in Greek politoniko. Also added two working variants of
+	chars in the IPA range.
+
+2002-05-15  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSans.sfd, sfd/FreeSansBold.sfd, sfd/FreeSerif.sfd,
+	sfd/FreeSerifBold.sfd - Deleted explicit ".notdef" character with
+	no contours.
+
+2002-05-14  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd,
+	sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd,
+	sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd,
+	sfd/FreeSansBoldOblique.sfd, sfd/FreeSerif.sfd,
+	sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd,
+	sfd/FreeSerifBoldItalic.sfd - The new version of PfaEdit saves
+	correctly formed Panose and LineGap lines.
+
+	* sfd/FreeSansBoldOblique.sfd - Filled-in the missing TTFWidth and
+	TTFWeight values.
+
+2002-05-09  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSans.sfd - Added diacritics to the Spacing Modifier
+	Letters and Combining Diacritical Marks areas. Added composed
+	glyphs to the Latin Extended-B area.
+
+2002-05-07  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd,
+	sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd,
+	sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd,
+	sfd/FreeSansBoldOblique.sfd, sfd/FreeSerif.sfd,
+	sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd,
+	sfd/FreeSerifBoldItalic.sfd - Updated Panose information with data
+	provided by Josef W. Segur. Updated TTF headers with English and
+	Slovenian text.
+
+2002-04-30  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMonoBold.sfd - Working on Greek small letters. Several
+	minor changes (lower carons etc.)
+
+2002-04-29  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* FreeMonoBoldOblique.sfd - Started adding Greek.
+
+	* sfd/FreeMonoBold.sfd - Added glyphs in the Geometrical Shapes
+	and Miscellaneous Symbols area. Harmonizing Greek with Latin. Done
+	with capitals.
+
+	* sfd/FreeMono.sfd - Deleted the explicit .notdef character. Added
+	one glyph to the Geometrical Shapes area, which is now completed;
+	added three glyphs to the Miscellaneous Symbols area. Harmonizing
+	Greek with Latin. Done with the capitals.
+
+2002-04-26  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSans.sfd - Adjusted accent positions on several glyphs
+	in the Latin Extended-A area.
+
+2002-04-25  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMonoBold.sfd - Box Drawing area completed. Added a
+	couple of glyphs in the Geometrical Shapes area.
+
+	* sfd/FreeMono.sfd - Small corrections in the Box Drawing area.
+
+2002-04-24  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - Box Drawing area completed.
+
+2002-04-23  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* tools/WGL4.lst - corrected.
+
+	* sfd/FreeMono.sfd, sfd/FreeMonoBold.sfd - Working on Box Drawing
+	area.
+
+2002-04-22  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd, sfd/FreeMonoBold.sfd - Working on Latin
+	Extended-B and Greek.
+
+2002-04-19  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerif.sfd - Somewhat cleaner chess figures.
+
+	* tools/MES-2.txt, tools/MES-2.lst - Corrected list (it is not
+	203C-203E, it is 203C and 203E).
+
+	* sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd,
+	sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd,
+	sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd,
+	sfd/FreeSansBoldOblique.sfd, sfd/FreeSerif.sfd,
+	sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd,
+	sfd/FreeSerifBoldItalic.sfd - Changed "Family Name" from Free to
+	FreeSerif, FreeSans and FreeMono, as appropriate. Changed Font
+	Modifiers from MonoBold etc. to Bold, Italic, Oblique, BoldOblique
+	and BoldItalic.
+
+2002-04-18  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd,
+	sfd/FreeMonoBoldOblique.sfd - Corrected metrics; now all character
+	widths are set to 600.
+
+2002-04-17  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerif.sfd - Corrected glyphs in the Box Drawing area and
+	Block Elements area, which should extend through the ascender *and
+	descender* height.
+
+	* sfd/FreeMonoBold.sfd - Continued working on harmonizing Greek
+	letters with Latin and Cyrillic.
+
+	* sfd/FreeMonoBold.sfd - Added some box drawing characters.
+
+2002-04-16  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* www/design-notes.html - Updated notes on stroke width for
+	symbols in Free Mono Bold.
+
+	* sfd/FreeMono.sfd - Added a handful of characters in the
+	Miscellaneous Symbols area.
+
+	* sfd/FreeMonoBoldOblique.sfd - Added subscripts, superscripts and
+	vulgar fractions.
+
+	* sfd/FreeMonoBold.sfd - Started harmonizing Greek letters with
+	Latin and Cyrillic.
+
+	* sfd/FreeMonoBold.sfd - Added subscripts, superscripts and vulgar
+	fractions.
+
+2002-04-15  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* www/design-notes.html - Updated notes on super-/subscripts in
+	Free Mono Bold. Separate subsections for Free Mono regular and
+	Free Mono Bold.
+
+2002-04-12  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerif.sfd - Added Ethiopian glyphs, converted from the
+	Metafont sources from TGI, Universität Hamburg (authors Berhanu
+	Beyene, Prof. Dr. Manfred Kudlek, Olaf Kummer, and Jochen
+	Metzinger) using Szabo's TeXtrace and retouched using
+	PfaEdit. Ethiopian metafonts are released under GNU GPL,
+	<http://www.informatik.uni-hamburg.de/TGI/mitarbeiter/wimis/kummer/ethiop_eng.html>.
+
+	* sfd/FreeMonoBold.sfd - Added 40 characters, mostly in the Latin
+	Extended-B and IPA Extensions areas.
+
+2002-04-11  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - Added a handful of characters in the Latin
+	Extended-B, IPA Extensions, Currency Symbols and Miscellaneous
+	Symbols areas.
+
+2002-04-09  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - Correcting accent positioning in the Extended
+	Greek area; adding a couple of characters here and there. Still 20
+	characters short of MES-2 conformance.
+
+2002-04-08  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - Added some characters in the Arrows area;
+	more or less completed Extended Greek area (accents still need to
+	be fine-tuned).
+
+2002-04-05  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - Modern non-Russian Cyrilic mostly completed.
+
+	* sfd/FreeMonoOblique.sfd - Synchronized with FreeMono.
+
+	* sfd/FreeSerif.sfd - Added Thomas Ridgeway's Tamil characters
+	(converted from Metafont and edited somehwat).
+	
+2002-04-04  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMonoOblique.sfd - Armenian letters added.
+
+	* sfd/FreeMonoBold.sfd - Serbian Cyrillic letters dje, tshe, lje
+	and nje corrected.
+
+	* sfd/FreeMono.sfd - Serbian Cyrillic letters dje and tshe
+	corrected. Some other non-Russian Cyrillic letters modified and
+	"welded together".
+
+2002-04-03  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - Added more or less complete Armenian
+	area. The glyphs are a tidied-up version based on the Armenian
+	Courier on the <http://www.cilicia.com/armo8.html>. Now we have
+	1673 characters.
+
+2002-03-28  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - Added some mathematical symbols.
+
+2002-03-26  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSans.sfd - took H.S. Pannu's Gurmukhi from FreeSerif. It
+	actually fits to FreeSans much better. It seems I'll have to look
+	for another Gurmukhi font with modulated stroke for FreeSerif.
+
+	* sfd/FreeSerifItalic.sfd - replaced existing Hebrew glyphs by
+	those from FreeSerif (slanted for 15.5 degrees).
+
+	* sfd/FreeSerif.sfd - Added dotted Hebrew letters. Changed barred H.
+
+	* sfd/FreeMono.sfd - Completed vulgar fractions; minor changes in
+	Greek; added some mathematical operators.
+
+	* sfd/FreeMonoBold.sfd - added 12 characters to Latin Extended-B
+	and IPA Extensions areas (total 984).
+
+2002-03-25  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMonoBold.sfd - started adding Latin Extended-B and IPA
+	Extensions.
+
+	* sfd/FreeMono.sfd - Minor cosmetic changes; cleaning up Greek
+	(removing redundant control points), added some non-European
+	Cyrillic glyphs as a test.
+
+2002-03-22  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - Some minor modifications; letters in Latin
+	Extended-B area "welded" together.
+
+2002-03-20  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* www/index.html - finally linked the resources and design notes
+	pages.
+
+	* www/design-notes.html - added scaling information for super- and
+	subscript numerals in FreeMono.
+
+2002-03-19  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - the Latin Extended-B and IPA Extension area
+	characters moved from FreeMono and skewed for 12 degrees.
+
+2002-03-18  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - added a dozen or two of new characters, in
+	particular in the Latin Extended-B and IPA Extension area.
+
+2002-03-15  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - added a dozen of two of new characters, in
+	particular in the IPA Extension area.
+
+	* www/design-notes.html - Corrected data for x-height in FreeMono;
+	information on constructing small caps.
+
+2002-03-14  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeMono.sfd - added three smiley characters to the
+	Miscallaneous Symbols area.
+
+2002-03-10  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerif.sfd - Anshuman Pandey has only converted Gurmukhi
+	from TrueType to Metafont; the original author of Gurkmukhi font
+	is Hardip Singh Pannu <http://members.aol.com/hspannu/punjabi.html>.
+	Got the permission from him to include the Gurmukhi glyph set.
+
+2002-03-08  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerif.sfd - Added some more glyphs in the Mathematical
+	Symbols area to a total number of 3374.
+
+2002-03-06  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerif.sfd - Added a basic Gurmukhi set.
+
+	* www/design-notes.html - started a page on design notes
+
+	* sfd/FreeMono.sfd - realized that glyphs in the Box Drawing area
+	and Block Elements area should extend through the ascender *and
+	descender* height, and corrected it.
+
+	* sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd - added some musical
+	glyphs, linking "no-break space" to space, "soft hyphen" to
+	hyphen-minus etc.
+
+2002-03-05  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* tools/WGL4.lst - Added Windows Glyph List 4.0
+
+	* tools/LigatureList.pl - Wrote a Perl script, which lists the
+	GSUB list (ligature list) of a OpenType font.
+
+	* sfd/FreeSerifBold.sfd, sfd/FreeSerifBoldItalic.sfd,
+	sfd/FreeSerifItalic.sfd - auxilliary Hebrew glyphs added. They are
+	too light compared with Latin and will be substituted with better
+	ones.
+
+2002-03-04  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerif.sfd - Added some more glyphs to the Mathematical
+	Operators area (page 0x22).
+
+	* sfd/FreeSerif.sfd - Incomplete and fragmentary support for
+	Devanagari, originating from Harsh Kumar's Shusha fonts was
+	replaced by Frans Velthuis' Devanagari metafont, now maintained by
+	Anshuman Pandey <apandey at u.washington.edu> and available under
+	GPL. Until I figure out how to provide glyph substitution table in
+	OpenType, only the Unicode part is there.
+
+2002-02-28  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* ChangeLog file created
+
+	* sfd/FreeSerif.sfd - Added some Telugu glyphs to page 0x0C,
+	courtesy  Prasad A. Chodavarapu <http://chaitanya.bhaavana.net/fonts/>
+
+	* sfd/FreeSerif.sfd - Added some glyphs to the Miscellaneous
+	Symbols page (0x26).
+	
+2002-02-26  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* mailing lists freefont-announce and freefont-bugs created
+
+2002-02-25  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/FreeSerif.sfd - Added a couple of glyphs in Mathematics
+	Operators area.
+
+	* sfd/FreeMono.sfd 
+	- Added some more glyphs, in particular in the Mathematical
+	Operators section.
+	- Changed FamilyName to Free, FontName to FreeMono, and Full name
+	to "Free Monospaced".
+
+2002-02-20  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* sfd/ directory added containing FreeSerif, FreeSans and FreeMono
+	families.
+
+	* tools/ directory added containing lists with characters required
+	for MES (Multilinguag European Subset) compliance.
+
+	* tools/mes-list-expand.pl created - a Perl script for expanding MES
+	ranges into simple one-char-per-line format
+
+	* tools/CheckConformance.pl created - a Perl script for checking
+	conformance of a font file with a given coded character set
+
+	* homepage <http://www.freesoftware.fsf.org/freefont/> created
+
+2002-02-19  Primoz Peterlin  <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+	* freefont (Free UCS Scalable Fonts) project approved on
+	savannah.gnu.org: <http://savannah.gnu.org/projects/freefont/>

Added: incphp/print/fonts/freefont/INSTALL
===================================================================
--- incphp/print/fonts/freefont/INSTALL	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/print/fonts/freefont/INSTALL	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,57 @@
+-*-mode:text;-*-
+$Id: INSTALL,v 1.1 2002/12/12 15:09:05 peterlin Exp $
+
+
+		Installing the Free UCS outline fonts
+		=====================================
+
+
+These installation notes are supposed to provide a helpful guidance
+through the process of installation of free UCS outline fonts. They
+can probably be significantly improved. Please direct your comments,
+suggestions for improvements, criticisms etc. to Primoz PETERLIN
+<primoz.peterlin at biofiz.mf.uni-lj.si> and thus help improve them.
+
+
+1. UNIX/GNU/Linux/BSD Systems
+
+The rather awkward "UNIX/GNU/Linux/BSD" agglomeration is used to
+denote any system capable of running XFree86 server with FreeType
+<http://www.freetype.org/>, a high-quality free font rasterizer.
+
+1.1 The rough way
+
+Unfortunately, hardly any other way exists at the moment.
+
+1) Fetch the freefont-ttf.tar.gz package with Free UCS outline fonts
+   in the TrueType format.
+
+2) Unpack TrueType fonts into a suitable directory,
+   e.g. /usr/share/fonts/default/TrueType/.
+
+3) If you have chosen any other directory, make sure the directory you
+   used to install the fonts is listed in the path searched by the X
+   Font Server. Append the directory to the "catalogue=" in the
+   /etc/X11/fs/config.
+
+4) Run ttmkfdir in the directory where you unpacked the fonts.
+
+
+1.2 Debian GNU/Linux
+
+Users of Debian GNU/Linux system will probably want to use the
+pre-packed Debian package, as available from the Debian site, 
+<http://packages.debian.org/unstable/x11/ttf-freefont.html>, or
+any of its mirrors. You can install them by issuing the command
+
+apt-get install ttf-freefont
+
+
+2. Microsoft Windows 95/98/NT/2000/XP
+
+To be written.
+
+
+3. MacOS
+
+To be written.

Added: incphp/print/fonts/freefont/README
===================================================================
--- incphp/print/fonts/freefont/README	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/print/fonts/freefont/README	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,113 @@
+-*-text-*-
+$Id: README,v 1.1 2002/11/28 10:10:30 peterlin Exp $
+
+Summary: This project aims to privide a set of free scalable
+(PostScript Type0, TrueType, OpenType...) fonts covering the ISO
+10646/Unicode UCS (Universal Character Set).
+
+
+Why do we need free scalable UCS fonts?
+
+A large number of free software users switched from free X11
+bitmapped fonts to proprietary Microsoft Truetype fonts, as a) they
+used to be freely downloaded from Microsoft Typography page
+<http://www.microsoft.com/typography/free.htm>, b) they contain a more
+or less decent subsed of the ISO 10646 UCS (Universal Character Set),
+c) they are high-quality, well hinted scalable Truetype fonts, and d)
+Freetype <http://www.freetype.org/>, a free high-quality Truetype font
+renderer exists and has been integrated into the latest release of
+XFree86, the free X11 server.
+
+Building a dependence on non-free software, even a niche one like
+fonts, is dangerous. Microsoft Truetype core fonts are not free, they
+are just costless. For now, at least. Citing the TrueType core fonts
+for the Web FAQ <http://www.microsoft.com/typography/faq/faq8.htm>:
+"You may only redistribute the fonts in their original form (.exe or
+.sit.hqx) and with their original file name from your Web site or
+intranet site. You must not supply the fonts, or any derivative fonts
+based on them, in any form that adds value to commercial products,
+such as CD-ROM or disk based multimedia programs, application software
+or utilities." As of August 2002, however, the fonts are not
+anymore available on the Web, which makes the situation clearer.
+
+Aren't there any free high-quality scalable fonts? Yes, there are.
+URW++, a German digital typefoundry, released their own version of the
+35 Postscript Type 1 core fonts under GPL as their donation to the
+Ghostscript project <http://www.gimp.org/fonts.html>. The Wadalab
+Kanji comittee has produced Type 1 font files with thousands of
+filigree Japanese glyphs <ftp://ftp.ipl.t.u-tokyo.ac.jp/pub/Font/>.
+Yannis Haralambous has drawn beautiful glyphs for the Omega
+typesetting system <http://omega.cse.unsw.edu.au:8080/>. And so
+on. Scattered around the internet there are numerous other free
+resources for other national scripts, many of them aiming to be a
+suitable match for Latin fonts like Times or Helvetica.
+
+
+What do we plan to achieve, and how?
+
+Our aim is to collect available resources, fill in the missing pieces,
+and provide a set of free high-quality scalable (Type 1 and Truetype)
+UCS fonts, released under GPL. 
+
+Free UCS scalable fonts will cover the following character sets
+
+* ISO 8859 parts 1-15
+* CEN MES-3 European Unicode Subset
+  http://www.evertype.com/standards/iso10646/pdf/cwa13873.pdf
+* IBM/Microsoft code pages 437, 850, 852, 1250, 1252 and more
+* Microsoft/Adobe Windows Glyph List 4 (WGL4)
+  http://partners.adobe.com/asn/developer/opentype/appendices/wgl4.html
+* KOI8-R and KOI8-RU
+* DEC VT100 graphics symbols
+* International Phonetic Alphabet
+* Arabic, Hebrew, Armenian, Georgian, Ethiopian, Thai and Lao alphabets,
+  including Arabic presentation forms A/B
+* Japanese Katakana and Hiragana
+* mathematical symbols, including the whole TeX repertoire of symbols
+* APL symbols
+  etc.
+
+A free Postscript font editor, George Williams's Pfaedit
+<http://pfaedit.sourceforge.net/> will be used for creating new
+glyphs.
+
+Which font shapes should be made? As historical style terms like
+Renaissance or Baroque letterforms cannot be applied beyond
+Latin/Cyrillic/Greek scripts to any greater extent than Kufi or Nashki
+can be applied beyond Arabic script, a smaller subset of styles will
+be made: one monospaced and two proportional (one with uniform stroke
+and one with modulated) will be made at the start.
+
+In the beginning, however, we don't believe that Truetype hinting will
+be good enough to compete with neither the hand-crafted bitmapped
+fonts at small sizes, nor with commercial TrueType fonts. A companion
+program for modifying the TrueType font tables, TtfMod, is in the
+works, though: <http://pfaedit.sourceforge.net/TtfMod/>. For
+applications like xterm, users are referred to the existing UCS bitmap
+fonts, <http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html>.
+
+
+What do the file suffices mean?
+
+The files with .sfd (Spline Font Database) are in PfaEdit's native
+format. Please use these if you plan to modify the font files. PfaEdit
+can export these to mostly any existing font file format.
+
+TrueType fonts for immediate consumption are the files with the .ttf
+(TrueType Font) suffix. You can use them directly, e.g. with the X
+font server.
+
+The files with .ps (PostScript) suffix are not font files at all -
+they are merely PostScript files with glyph tables, which can be used
+for overview, which glyphs are contained in which font file.
+
+You may have noticed the lacking of PostScript Type 1 (.pfa/.pfb) font
+files. Type 1 format does not support large (> 256) encoding vectors,
+so they can not be used with ISO 10646 encoding. If your printer
+supports it, you can use Type 0 format, though. Please use PfaEdit for
+conversion to Type 0.
+
+
+Primoz Peterlin, <primoz.peterlin at biofiz.mf.uni-lj.si>
+
+Free UCS scalable fonts: ftp://biofiz.mf.uni-lj.si/pub/fonts/elbrus/

Added: incphp/print/fonts/freesans.php
===================================================================
--- incphp/print/fonts/freesans.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/print/fonts/freesans.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,149 @@
+<?php
+$type='TrueTypeUnicode';
+$name='FreeSans';
+$desc=array('Ascent'=>1141,'Descent'=>-459,'CapHeight'=>1141,'Flags'=>32,'FontBBox'=>'[-797 -459 1632 1141]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600);
+$up=-151;
+$ut=50;
+$cw=array(
+	13=>333, 32=>278, 33=>278, 34=>355, 35=>556, 36=>556, 37=>889, 38=>667, 39=>191, 40=>333, 41=>333, 42=>389, 43=>584, 44=>278, 45=>333, 46=>278, 
+	47=>278, 48=>556, 49=>556, 50=>556, 51=>556, 52=>556, 53=>556, 54=>556, 55=>556, 56=>556, 57=>556, 58=>278, 59=>278, 60=>584, 61=>584, 62=>584, 
+	63=>556, 64=>1015, 65=>667, 66=>667, 67=>722, 68=>722, 69=>667, 70=>611, 71=>778, 72=>722, 73=>278, 74=>500, 75=>667, 76=>556, 77=>833, 78=>722, 
+	79=>778, 80=>667, 81=>778, 82=>722, 83=>667, 84=>611, 85=>722, 86=>667, 87=>944, 88=>667, 89=>667, 90=>611, 91=>278, 92=>278, 93=>278, 94=>469, 
+	95=>556, 96=>333, 97=>556, 98=>556, 99=>500, 100=>556, 101=>556, 102=>278, 103=>556, 104=>556, 105=>222, 106=>222, 107=>500, 108=>222, 109=>833, 110=>556, 
+	111=>556, 112=>556, 113=>556, 114=>333, 115=>500, 116=>278, 117=>556, 118=>500, 119=>722, 120=>500, 121=>500, 122=>500, 123=>334, 124=>260, 125=>334, 126=>584, 
+	8364=>556, 1027=>611, 8218=>222, 402=>556, 8222=>333, 8230=>1000, 8224=>556, 8225=>556, 710=>333, 8240=>1000, 352=>667, 8249=>333, 338=>1000, 1036=>667, 381=>611, 1039=>722, 
+	8216=>222, 8217=>221, 8220=>333, 8221=>333, 8226=>350, 8211=>556, 8212=>1000, 732=>333, 8482=>1000, 353=>500, 8250=>333, 339=>944, 1116=>500, 382=>500, 376=>667, 160=>278, 
+	161=>333, 162=>556, 163=>556, 164=>556, 165=>556, 166=>260, 167=>556, 168=>333, 169=>737, 170=>370, 171=>556, 172=>584, 173=>333, 174=>737, 175=>333, 176=>606, 
+	177=>584, 178=>351, 179=>351, 180=>333, 181=>556, 182=>537, 183=>278, 184=>333, 185=>351, 186=>365, 187=>556, 188=>869, 189=>869, 190=>869, 191=>611, 192=>667, 
+	193=>667, 194=>667, 195=>667, 196=>667, 197=>667, 198=>1000, 199=>722, 200=>667, 201=>667, 202=>667, 203=>667, 204=>278, 205=>278, 206=>278, 207=>278, 208=>722, 
+	209=>722, 210=>778, 211=>778, 212=>778, 213=>778, 214=>778, 215=>584, 216=>778, 217=>722, 218=>722, 219=>722, 220=>722, 221=>666, 222=>666, 223=>611, 224=>556, 
+	225=>556, 226=>556, 227=>556, 228=>556, 229=>556, 230=>889, 231=>500, 232=>556, 233=>556, 234=>556, 235=>556, 236=>278, 237=>278, 238=>278, 239=>278, 240=>556, 
+	241=>556, 242=>556, 243=>556, 244=>556, 245=>556, 246=>556, 247=>584, 248=>611, 249=>556, 250=>556, 251=>556, 252=>556, 253=>500, 254=>555, 255=>500, 256=>667, 
+	257=>556, 258=>667, 259=>556, 260=>667, 261=>556, 262=>722, 263=>500, 264=>722, 265=>500, 266=>722, 267=>500, 268=>722, 269=>500, 270=>722, 271=>635, 272=>722, 
+	273=>556, 274=>667, 275=>556, 276=>667, 277=>556, 278=>667, 279=>556, 280=>667, 281=>556, 282=>667, 283=>556, 284=>778, 285=>556, 286=>778, 287=>556, 288=>778, 
+	289=>556, 290=>778, 291=>556, 292=>722, 293=>556, 294=>722, 295=>556, 296=>278, 297=>278, 298=>278, 299=>222, 300=>278, 301=>278, 302=>278, 303=>222, 304=>278, 
+	305=>278, 306=>700, 307=>374, 308=>500, 309=>222, 310=>667, 311=>500, 312=>500, 313=>556, 314=>222, 315=>556, 316=>222, 317=>556, 318=>292, 319=>556, 320=>500, 
+	321=>556, 322=>222, 323=>722, 324=>556, 325=>722, 326=>556, 327=>722, 328=>556, 329=>556, 330=>722, 331=>556, 332=>778, 333=>556, 334=>778, 335=>556, 336=>778, 
+	337=>556, 340=>722, 341=>333, 342=>722, 343=>333, 344=>722, 345=>333, 346=>667, 347=>500, 348=>667, 349=>500, 350=>667, 351=>500, 354=>611, 355=>278, 356=>611, 
+	357=>308, 358=>611, 359=>278, 360=>722, 361=>556, 362=>722, 363=>556, 364=>722, 365=>556, 366=>722, 367=>556, 368=>722, 369=>556, 370=>722, 371=>556, 372=>944, 
+	373=>722, 374=>667, 375=>500, 377=>611, 378=>500, 379=>611, 380=>500, 383=>278, 384=>556, 386=>667, 387=>556, 388=>667, 389=>556, 390=>722, 391=>722, 392=>500, 
+	393=>722, 395=>667, 396=>556, 398=>667, 399=>778, 400=>667, 401=>611, 403=>778, 409=>500, 413=>722, 414=>556, 415=>778, 421=>556, 423=>667, 424=>500, 425=>611, 
+	427=>278, 429=>278, 430=>611, 452=>1311, 453=>1208, 454=>1056, 455=>1056, 456=>778, 457=>444, 458=>1158, 459=>944, 460=>778, 461=>667, 462=>556, 463=>278, 464=>278, 
+	465=>778, 466=>556, 467=>722, 468=>556, 469=>722, 470=>556, 471=>722, 472=>556, 473=>722, 474=>556, 475=>722, 476=>556, 477=>556, 478=>667, 479=>556, 480=>667, 
+	481=>556, 482=>1000, 483=>889, 486=>778, 487=>556, 488=>667, 489=>500, 490=>778, 491=>556, 492=>778, 493=>556, 496=>222, 497=>1333, 498=>1222, 499=>1056, 500=>778, 
+	501=>556, 504=>722, 505=>556, 506=>667, 507=>556, 508=>1000, 509=>889, 510=>778, 511=>611, 512=>667, 513=>556, 514=>667, 515=>556, 516=>667, 517=>556, 518=>667, 
+	519=>556, 520=>278, 521=>278, 522=>278, 523=>278, 524=>778, 525=>556, 526=>778, 527=>556, 528=>722, 529=>333, 530=>722, 531=>333, 532=>722, 533=>556, 534=>722, 
+	535=>556, 536=>667, 537=>500, 538=>611, 539=>278, 542=>722, 543=>556, 550=>667, 551=>556, 552=>667, 553=>556, 554=>778, 555=>556, 556=>778, 557=>556, 558=>778, 
+	559=>556, 560=>778, 561=>556, 562=>667, 563=>500, 592=>556, 593=>556, 594=>556, 595=>556, 596=>500, 598=>556, 599=>556, 600=>556, 601=>556, 603=>500, 604=>500, 
+	608=>556, 609=>556, 613=>556, 614=>556, 615=>556, 616=>222, 617=>222, 618=>278, 621=>222, 623=>833, 624=>833, 625=>833, 626=>556, 627=>556, 629=>556, 633=>333, 
+	634=>333, 635=>333, 636=>333, 637=>333, 638=>278, 639=>278, 642=>500, 643=>278, 644=>278, 645=>278, 647=>278, 648=>278, 649=>556, 652=>500, 653=>722, 654=>500, 
+	656=>500, 668=>500, 670=>500, 672=>556, 711=>333, 714=>333, 715=>333, 728=>333, 729=>333, 730=>333, 731=>333, 733=>333, 768=>0, 769=>0, 770=>0, 771=>0, 
+	772=>0, 774=>0, 775=>0, 776=>0, 778=>0, 779=>0, 780=>0, 783=>0, 785=>0, 786=>0, 787=>0, 788=>0, 806=>0, 807=>0, 808=>0, 884=>199, 
+	885=>199, 890=>332, 894=>278, 900=>414, 901=>747, 902=>730, 903=>278, 904=>664, 905=>681, 906=>230, 908=>792, 910=>710, 911=>758, 912=>286, 913=>684, 914=>628, 
+	915=>582, 916=>684, 917=>650, 918=>628, 919=>683, 920=>750, 921=>236, 922=>684, 923=>684, 924=>800, 925=>654, 926=>630, 927=>750, 928=>721, 929=>638, 931=>628, 
+	932=>628, 933=>684, 934=>717, 935=>723, 936=>745, 937=>720, 938=>236, 939=>684, 940=>608, 941=>528, 942=>547, 943=>307, 944=>515, 945=>596, 946=>516, 947=>531, 
+	948=>560, 949=>510, 950=>462, 951=>526, 952=>526, 953=>286, 954=>516, 955=>560, 956=>574, 957=>504, 958=>470, 959=>550, 960=>661, 961=>566, 962=>535, 963=>616, 
+	964=>532, 965=>515, 966=>741, 967=>572, 968=>662, 969=>740, 970=>286, 971=>515, 972=>553, 973=>518, 974=>740, 1024=>667, 1025=>667, 1026=>766, 1028=>722, 1029=>667, 
+	1030=>278, 1031=>278, 1032=>500, 1033=>1080, 1034=>1014, 1035=>766, 1037=>722, 1038=>650, 1040=>667, 1041=>667, 1042=>667, 1043=>611, 1044=>812, 1045=>667, 1046=>1023, 1047=>667, 
+	1048=>728, 1049=>728, 1050=>667, 1051=>673, 1052=>844, 1053=>719, 1054=>778, 1055=>719, 1056=>667, 1057=>722, 1058=>611, 1059=>650, 1060=>936, 1061=>667, 1062=>741, 1063=>648, 
+	1064=>828, 1065=>850, 1066=>897, 1067=>872, 1068=>667, 1069=>722, 1070=>1032, 1071=>702, 1072=>556, 1073=>556, 1074=>522, 1075=>430, 1076=>602, 1077=>556, 1078=>837, 1079=>500, 
+	1080=>567, 1081=>567, 1082=>510, 1083=>557, 1084=>618, 1085=>558, 1086=>556, 1087=>557, 1088=>576, 1089=>500, 1090=>496, 1091=>500, 1092=>912, 1093=>500, 1094=>578, 1095=>520, 
+	1096=>692, 1097=>712, 1098=>734, 1099=>690, 1100=>552, 1101=>500, 1102=>758, 1103=>543, 1104=>556, 1105=>556, 1106=>568, 1107=>430, 1108=>500, 1109=>500, 1110=>222, 1111=>278, 
+	1112=>222, 1113=>840, 1114=>850, 1115=>568, 1117=>556, 1118=>500, 1119=>556, 1164=>667, 1165=>552, 1166=>667, 1167=>556, 1168=>611, 1169=>430, 1170=>611, 1171=>430, 1172=>611, 
+	1173=>430, 1174=>1023, 1175=>837, 1176=>667, 1177=>500, 1178=>667, 1179=>500, 1180=>667, 1181=>500, 1182=>667, 1183=>500, 1184=>667, 1185=>500, 1186=>722, 1187=>556, 1188=>1060, 
+	1189=>764, 1190=>722, 1191=>556, 1192=>722, 1193=>500, 1194=>722, 1195=>500, 1196=>611, 1197=>496, 1198=>667, 1199=>500, 1200=>667, 1201=>500, 1202=>667, 1203=>500, 1204=>774, 
+	1205=>608, 1206=>642, 1207=>508, 1208=>642, 1209=>508, 1210=>642, 1211=>508, 1212=>778, 1213=>556, 1214=>688, 1215=>556, 1216=>278, 1217=>1023, 1218=>837, 1219=>667, 1220=>500, 
+	1223=>722, 1224=>556, 1227=>642, 1228=>508, 1232=>667, 1233=>556, 1234=>667, 1235=>556, 1236=>1000, 1237=>889, 1238=>667, 1239=>556, 1240=>778, 1241=>556, 1242=>778, 1243=>556, 
+	1244=>1023, 1245=>837, 1246=>667, 1247=>500, 1248=>667, 1249=>500, 1250=>728, 1251=>567, 1252=>728, 1253=>567, 1254=>778, 1255=>556, 1256=>778, 1257=>556, 1258=>778, 1259=>556, 
+	1260=>722, 1261=>500, 1262=>650, 1263=>500, 1264=>650, 1265=>500, 1266=>650, 1267=>500, 1268=>648, 1269=>520, 1272=>872, 1273=>690, 1329=>722, 1330=>705, 1331=>774, 1332=>754, 
+	1333=>722, 1334=>751, 1335=>485, 1336=>722, 1337=>782, 1338=>655, 1339=>699, 1340=>417, 1341=>853, 1342=>791, 1343=>711, 1344=>588, 1345=>663, 1346=>665, 1347=>665, 1348=>756, 
+	1349=>623, 1350=>773, 1351=>603, 1352=>722, 1353=>648, 1354=>722, 1355=>751, 1356=>750, 1357=>722, 1358=>748, 1359=>667, 1360=>699, 1361=>623, 1362=>417, 1363=>785, 1364=>638, 
+	1365=>778, 1366=>716, 1370=>222, 1371=>133, 1372=>325, 1373=>333, 1374=>344, 1377=>833, 1378=>556, 1379=>572, 1380=>581, 1381=>550, 1382=>588, 1383=>448, 1384=>556, 1385=>568, 
+	1386=>582, 1387=>545, 1388=>301, 1389=>799, 1390=>556, 1391=>554, 1392=>533, 1393=>548, 1394=>552, 1395=>552, 1396=>544, 1397=>222, 1398=>544, 1399=>456, 1400=>556, 1401=>390, 
+	1402=>833, 1403=>509, 1404=>547, 1405=>533, 1406=>610, 1407=>887, 1408=>556, 1409=>545, 1410=>352, 1411=>853, 1412=>588, 1413=>579, 1414=>690, 1415=>545, 1417=>278, 1418=>367, 
+	1456=>70, 1457=>335, 1458=>329, 1459=>329, 1460=>70, 1461=>200, 1462=>200, 1463=>188, 1464=>188, 1465=>70, 1467=>329, 1468=>70, 1469=>70, 1470=>488, 1471=>200, 1472=>212, 
+	1473=>0, 1474=>0, 1475=>278, 1476=>70, 1488=>640, 1489=>591, 1490=>466, 1491=>598, 1492=>622, 1493=>212, 1494=>351, 1495=>623, 1496=>608, 1497=>200, 1498=>526, 1499=>550, 
+	1500=>600, 1501=>623, 1502=>621, 1503=>212, 1504=>378, 1505=>607, 1506=>587, 1507=>575, 1508=>568, 1509=>540, 1510=>590, 1511=>606, 1512=>547, 1513=>776, 1514=>687, 1792=>600, 
+	1793=>201, 1794=>201, 1795=>201, 1796=>201, 1797=>500, 1798=>500, 1799=>500, 1800=>370, 1801=>370, 1802=>574, 1803=>574, 1804=>645, 1805=>574, 1808=>452, 1809=>452, 1810=>574, 
+	1811=>645, 1812=>645, 1813=>509, 1814=>509, 1815=>682, 1816=>585, 1817=>404, 1818=>627, 1819=>718, 1820=>718, 1821=>484, 1822=>682, 1823=>600, 1824=>660, 1825=>682, 1826=>538, 
+	1827=>718, 1828=>718, 1829=>718, 1830=>574, 1831=>574, 1832=>638, 1833=>585, 1834=>509, 1835=>682, 1836=>682, 1840=>1, 1841=>1, 1842=>1, 1843=>1, 1844=>1, 1845=>1, 
+	1846=>1, 1847=>1, 1848=>1, 1849=>1, 1850=>1, 1851=>1, 1852=>1, 1853=>1, 1854=>1, 1855=>1, 1856=>1, 1857=>1, 1858=>1, 1859=>1, 1860=>1, 1861=>1, 
+	1862=>1, 1863=>1, 1864=>1, 1865=>1, 1866=>1, 2305=>6, 2306=>6, 2309=>644, 2310=>816, 2311=>392, 2312=>392, 2313=>459, 2314=>661, 2315=>641, 2317=>423, 2320=>423, 
+	2321=>816, 2323=>816, 2324=>816, 2325=>393, 2326=>622, 2327=>424, 2328=>472, 2329=>508, 2330=>517, 2331=>583, 2332=>549, 2333=>503, 2334=>538, 2335=>444, 2336=>480, 2337=>519, 
+	2338=>479, 2339=>504, 2340=>439, 2341=>542, 2342=>427, 2343=>520, 2344=>415, 2345=>415, 2346=>401, 2347=>401, 2348=>442, 2349=>520, 2350=>463, 2351=>451, 2352=>319, 2353=>319, 
+	2354=>549, 2355=>641, 2357=>442, 2358=>589, 2359=>398, 2360=>506, 2361=>430, 2364=>6, 2365=>438, 2366=>172, 2367=>172, 2368=>172, 2369=>6, 2370=>6, 2371=>6, 2373=>6, 
+	2375=>6, 2376=>6, 2377=>172, 2379=>172, 2380=>172, 2381=>6, 2384=>898, 2385=>6, 2406=>584, 2407=>584, 2408=>584, 2409=>584, 2410=>584, 2411=>584, 2412=>584, 2413=>584, 
+	2414=>584, 2415=>584, 2416=>898, 2433=>300, 2434=>400, 2435=>300, 2437=>640, 2438=>780, 2439=>520, 2440=>520, 2441=>530, 2442=>550, 2443=>620, 2444=>420, 2447=>480, 2448=>620, 
+	2451=>620, 2452=>720, 2453=>652, 2454=>500, 2455=>490, 2456=>466, 2457=>540, 2458=>490, 2459=>540, 2460=>630, 2461=>590, 2462=>680, 2463=>510, 2464=>490, 2465=>520, 2466=>520, 
+	2467=>470, 2468=>540, 2469=>490, 2470=>470, 2471=>490, 2472=>452, 2474=>560, 2475=>650, 2476=>480, 2477=>588, 2478=>480, 2479=>470, 2480=>480, 2482=>472, 2486=>512, 2487=>470, 
+	2488=>470, 2489=>520, 2492=>160, 2494=>180, 2495=>180, 2496=>180, 2497=>320, 2498=>329, 2499=>195, 2500=>260, 2503=>340, 2504=>340, 2507=>740, 2508=>740, 2509=>400, 2519=>180, 
+	2524=>540, 2525=>520, 2527=>470, 2528=>612, 2529=>420, 2530=>234, 2531=>360, 2534=>460, 2535=>420, 2536=>520, 2537=>540, 2538=>400, 2539=>400, 2540=>560, 2541=>390, 2542=>480, 
+	2543=>420, 2544=>480, 2545=>470, 2546=>400, 2547=>470, 2548=>400, 2549=>400, 2550=>400, 2551=>120, 2552=>440, 2553=>420, 2554=>420, 2565=>744, 2566=>914, 2567=>690, 2568=>670, 
+	2569=>596, 2570=>596, 2575=>498, 2576=>744, 2579=>596, 2580=>744, 2581=>550, 2582=>534, 2583=>618, 2584=>690, 2585=>546, 2586=>518, 2587=>592, 2588=>492, 2589=>574, 2590=>514, 
+	2591=>526, 2592=>556, 2593=>524, 2594=>528, 2595=>574, 2596=>484, 2597=>534, 2598=>504, 2599=>534, 2600=>538, 2602=>534, 2603=>506, 2604=>562, 2605=>516, 2606=>546, 2607=>670, 
+	2608=>538, 2610=>726, 2611=>726, 2613=>514, 2614=>546, 2616=>546, 2617=>517, 2620=>286, 2622=>172, 2623=>190, 2624=>190, 2625=>1, 2626=>1, 2631=>1, 2632=>1, 2635=>1, 
+	2636=>1, 2637=>1, 2649=>534, 2650=>618, 2651=>492, 2652=>484, 2654=>506, 2662=>616, 2663=>480, 2664=>560, 2665=>480, 2666=>468, 2667=>492, 2668=>514, 2669=>538, 2670=>572, 
+	2671=>560, 2672=>1, 2674=>498, 2675=>596, 2676=>900, 2689=>33, 2690=>33, 2693=>767, 2694=>961, 2695=>500, 2696=>495, 2697=>528, 2698=>702, 2699=>885, 2709=>501, 2710=>612, 
+	2711=>619, 2712=>569, 2713=>532, 2714=>358, 2715=>620, 2716=>606, 2717=>602, 2718=>631, 2719=>495, 2720=>528, 2721=>531, 2722=>511, 2723=>614, 2724=>294, 2725=>344, 2726=>425, 
+	2727=>345, 2728=>611, 2730=>512, 2731=>578, 2732=>428, 2733=>423, 2734=>231, 2735=>582, 2736=>344, 2738=>558, 2739=>670, 2741=>537, 2742=>592, 2743=>568, 2744=>600, 2745=>544, 
+	2749=>531, 2750=>232, 2751=>232, 2752=>232, 2753=>33, 2754=>33, 2755=>33, 2759=>33, 2760=>33, 2763=>232, 2764=>232, 2768=>903, 2790=>479, 2791=>416, 2792=>465, 2793=>469, 
+	2794=>498, 2795=>463, 2796=>451, 2797=>510, 2798=>455, 2799=>488, 2818=>131, 2819=>302, 2821=>560, 2822=>644, 2823=>632, 2825=>630, 2827=>553, 2831=>604, 2835=>520, 2837=>572, 
+	2838=>570, 2839=>580, 2840=>565, 2842=>580, 2844=>564, 2845=>575, 2847=>565, 2848=>565, 2849=>524, 2858=>572, 2859=>700, 2863=>655, 2864=>620, 2866=>652, 2867=>560, 2870=>565, 
+	2871=>565, 2872=>545, 2873=>524, 2878=>128, 2879=>1, 2880=>190, 2881=>1, 2882=>1, 2883=>1, 2887=>396, 2912=>563, 2918=>508, 2919=>424, 2920=>440, 2921=>600, 2922=>600, 
+	2923=>600, 2924=>600, 2925=>600, 2926=>511, 2927=>483, 2946=>479, 2947=>893, 2949=>1018, 2950=>1170, 2951=>916, 2952=>676, 2953=>836, 2954=>1225, 2958=>744, 2959=>744, 2960=>848, 
+	2962=>813, 2963=>813, 2964=>813, 2965=>688, 2969=>744, 2970=>676, 2972=>848, 2974=>984, 2975=>777, 2979=>1338, 2980=>664, 2984=>561, 2985=>1029, 2986=>607, 2990=>697, 2991=>697, 
+	2992=>434, 2993=>617, 2994=>869, 2995=>859, 2996=>697, 2997=>869, 2999=>1145, 3000=>1064, 3001=>1316, 3006=>424, 3007=>125, 3008=>596, 3009=>539, 3014=>596, 3015=>650, 3016=>973, 
+	3018=>1286, 3019=>1286, 3020=>1706, 3021=>333, 3031=>859, 3034=>778, 3035=>881, 3036=>876, 3037=>648, 3041=>744, 3203=>342, 3205=>620, 3206=>591, 3207=>600, 3208=>776, 3209=>1138, 
+	3210=>1464, 3214=>574, 3215=>570, 3216=>580, 3218=>589, 3219=>597, 3220=>625, 3221=>256, 3222=>565, 3223=>326, 3224=>604, 3225=>651, 3226=>408, 3228=>611, 3230=>843, 3231=>610, 
+	3232=>258, 3233=>317, 3234=>328, 3235=>803, 3236=>317, 3237=>328, 3238=>352, 3239=>352, 3240=>317, 3248=>248, 3249=>621, 3250=>620, 3251=>620, 3302=>649, 3303=>550, 3304=>573, 
+	3305=>567, 3306=>562, 3307=>557, 3308=>562, 3309=>567, 3310=>557, 3311=>557, 3458=>468, 3459=>318, 3461=>660, 3465=>778, 3466=>807, 3467=>830, 3473=>838, 3476=>860, 3481=>1000, 
+	3482=>973, 3483=>860, 3484=>997, 3486=>740, 3488=>838, 3489=>886, 3490=>886, 3492=>1295, 3493=>1295, 3495=>838, 3496=>860, 3497=>860, 3498=>860, 3499=>1403, 3501=>973, 3502=>838, 
+	3503=>660, 3504=>860, 3505=>973, 3507=>660, 3508=>886, 3509=>838, 3510=>860, 3511=>973, 3512=>838, 3513=>860, 3514=>886, 3515=>807, 3517=>830, 3520=>838, 3521=>973, 3522=>886, 
+	3523=>886, 3524=>973, 3525=>830, 3526=>973, 3530=>0, 3535=>432, 3536=>380, 3537=>420, 3538=>0, 3539=>0, 3540=>0, 3542=>0, 3544=>501, 3545=>652, 3551=>648, 7936=>596, 
+	7937=>596, 7938=>596, 7939=>596, 7940=>596, 7941=>596, 7942=>596, 7943=>596, 7944=>684, 7945=>684, 7946=>684, 7947=>684, 7948=>684, 7949=>684, 7950=>684, 7951=>684, 7952=>510, 
+	7953=>510, 7954=>510, 7955=>510, 7956=>510, 7957=>510, 7960=>650, 7961=>650, 7962=>650, 7963=>650, 7964=>650, 7965=>650, 7968=>526, 7969=>526, 7970=>526, 7971=>526, 7972=>526, 
+	7973=>526, 7974=>526, 7975=>526, 7976=>683, 7977=>683, 7978=>683, 7979=>683, 7980=>683, 7981=>683, 7982=>683, 7983=>683, 7984=>286, 7985=>286, 7986=>286, 7987=>286, 7988=>286, 
+	7989=>286, 7990=>286, 7991=>286, 7992=>236, 7993=>236, 7994=>236, 7995=>236, 7996=>236, 7997=>236, 7998=>236, 7999=>236, 8000=>550, 8001=>550, 8002=>550, 8003=>550, 8004=>550, 
+	8005=>550, 8008=>750, 8009=>750, 8010=>750, 8011=>750, 8012=>750, 8013=>750, 8016=>515, 8017=>515, 8018=>515, 8019=>515, 8020=>515, 8021=>515, 8022=>515, 8023=>515, 8025=>684, 
+	8027=>684, 8029=>684, 8031=>684, 8032=>740, 8033=>740, 8034=>740, 8035=>740, 8036=>740, 8037=>740, 8038=>740, 8039=>740, 8040=>720, 8041=>720, 8042=>720, 8043=>720, 8044=>720, 
+	8045=>720, 8046=>720, 8047=>720, 8048=>596, 8049=>596, 8050=>510, 8051=>510, 8052=>526, 8053=>526, 8054=>286, 8055=>286, 8056=>550, 8057=>550, 8058=>515, 8059=>515, 8060=>740, 
+	8061=>740, 8064=>596, 8065=>596, 8066=>596, 8067=>596, 8068=>596, 8069=>596, 8070=>596, 8071=>596, 8072=>882, 8073=>882, 8074=>882, 8075=>882, 8076=>882, 8077=>882, 8078=>882, 
+	8079=>882, 8080=>526, 8081=>526, 8082=>526, 8083=>526, 8084=>526, 8085=>526, 8086=>526, 8087=>526, 8088=>857, 8089=>857, 8090=>857, 8091=>857, 8092=>857, 8093=>857, 8094=>857, 
+	8095=>857, 8096=>740, 8097=>740, 8098=>740, 8099=>740, 8100=>740, 8101=>740, 8102=>740, 8103=>740, 8104=>945, 8105=>945, 8106=>945, 8107=>945, 8108=>945, 8109=>945, 8110=>945, 
+	8111=>945, 8112=>596, 8113=>596, 8114=>596, 8115=>596, 8116=>596, 8118=>596, 8119=>596, 8120=>684, 8121=>684, 8122=>684, 8123=>684, 8124=>882, 8125=>278, 8126=>201, 8127=>333, 
+	8128=>278, 8129=>333, 8130=>526, 8131=>526, 8132=>536, 8134=>526, 8135=>526, 8136=>650, 8137=>650, 8138=>683, 8139=>683, 8140=>857, 8141=>582, 8142=>582, 8143=>333, 8144=>286, 
+	8145=>286, 8146=>286, 8147=>286, 8150=>286, 8151=>312, 8152=>236, 8153=>236, 8154=>236, 8155=>236, 8157=>582, 8158=>582, 8159=>333, 8160=>515, 8161=>515, 8162=>515, 8163=>515, 
+	8164=>566, 8165=>566, 8166=>515, 8167=>515, 8168=>684, 8169=>684, 8170=>684, 8171=>684, 8172=>638, 8173=>333, 8174=>393, 8175=>333, 8178=>740, 8179=>740, 8180=>740, 8182=>740, 
+	8183=>740, 8184=>750, 8185=>750, 8186=>720, 8187=>720, 8188=>939, 8189=>333, 8190=>333, 8208=>333, 8219=>221, 8223=>333, 8227=>350, 8241=>1360, 8242=>278, 8243=>469, 8244=>680, 
+	8245=>278, 8246=>469, 8247=>680, 8251=>622, 8252=>556, 8253=>556, 8260=>167, 8263=>1112, 8264=>834, 8265=>834, 8267=>537, 8304=>351, 8305=>351, 8308=>351, 8309=>351, 8310=>351, 
+	8311=>351, 8312=>351, 8313=>351, 8320=>351, 8321=>351, 8322=>351, 8323=>351, 8324=>351, 8325=>353, 8326=>351, 8327=>351, 8328=>351, 8329=>351, 8359=>1445, 8360=>1222, 8362=>869, 
+	8459=>969, 8460=>615, 8464=>809, 8465=>519, 8466=>874, 8470=>1008, 8475=>850, 8476=>644, 8486=>720, 8487=>720, 8488=>512, 8490=>667, 8491=>667, 8492=>908, 8493=>623, 8496=>562, 
+	8497=>611, 8498=>611, 8499=>1080, 8531=>869, 8532=>869, 8533=>869, 8534=>869, 8535=>869, 8536=>869, 8537=>869, 8538=>869, 8539=>869, 8540=>869, 8541=>869, 8542=>869, 8543=>869, 
+	8544=>278, 8545=>556, 8546=>834, 8547=>945, 8548=>667, 8549=>945, 8550=>1223, 8551=>1501, 8552=>945, 8553=>667, 8554=>945, 8555=>1223, 8556=>556, 8557=>722, 8558=>722, 8559=>833, 
+	8560=>222, 8561=>444, 8562=>666, 8563=>722, 8564=>500, 8565=>722, 8566=>944, 8567=>1166, 8568=>722, 8569=>500, 8570=>722, 8571=>944, 8572=>222, 8573=>500, 8574=>556, 8575=>833, 
+	8592=>987, 8593=>603, 8594=>987, 8595=>603, 8596=>1042, 8597=>1042, 8629=>658, 8656=>987, 8657=>603, 8658=>987, 8659=>603, 8660=>1042, 8704=>667, 8706=>556, 8707=>667, 8709=>556, 
+	8710=>711, 8711=>711, 8712=>713, 8713=>713, 8719=>823, 8720=>823, 8721=>804, 8722=>584, 8723=>584, 8727=>500, 8730=>542, 8733=>713, 8734=>713, 8736=>768, 8743=>603, 8744=>603, 
+	8745=>768, 8746=>768, 8747=>556, 8748=>796, 8749=>956, 8750=>556, 8756=>863, 8764=>549, 8766=>584, 8769=>584, 8770=>584, 8771=>584, 8777=>636, 8800=>548, 8804=>584, 8805=>584, 
+	8853=>768, 8854=>768, 8855=>768, 8869=>658, 8960=>823, 9674=>489, 9834=>555, 12289=>1000, 12290=>1000, 12291=>1000, 12293=>1000, 12295=>1000, 12296=>1000, 12297=>1000, 12298=>1000, 12299=>1000, 
+	12300=>1000, 12301=>1000, 12302=>1000, 12303=>1000, 12304=>1000, 12305=>1000, 12308=>1000, 12309=>1000, 12353=>1000, 12354=>1000, 12355=>1000, 12356=>1000, 12357=>1000, 12358=>1000, 12359=>1000, 12360=>1000, 
+	12361=>1000, 12362=>1000, 12363=>1000, 12364=>1000, 12365=>1000, 12366=>1000, 12367=>1000, 12368=>1000, 12369=>1000, 12370=>1000, 12371=>1000, 12372=>1000, 12373=>1000, 12374=>1000, 12375=>1000, 12376=>1000, 
+	12377=>1000, 12378=>1000, 12379=>1000, 12380=>1000, 12381=>1000, 12382=>1000, 12383=>1000, 12384=>1000, 12385=>1000, 12386=>1000, 12387=>1000, 12388=>1000, 12389=>1000, 12390=>1000, 12391=>1000, 12392=>1000, 
+	12393=>1000, 12394=>1000, 12395=>1000, 12396=>1000, 12397=>1000, 12398=>1000, 12399=>1000, 12400=>1000, 12401=>1000, 12402=>1000, 12403=>1000, 12404=>1000, 12405=>1000, 12406=>1000, 12407=>1000, 12408=>1000, 
+	12409=>1000, 12410=>1000, 12411=>1000, 12412=>1000, 12413=>1000, 12414=>1000, 12415=>1000, 12416=>1000, 12417=>1000, 12418=>1000, 12419=>1000, 12420=>1000, 12421=>1000, 12422=>1000, 12423=>1000, 12424=>1000, 
+	12425=>1000, 12426=>1000, 12427=>1000, 12428=>1000, 12429=>1000, 12430=>1000, 12431=>1000, 12432=>1000, 12433=>1000, 12434=>1000, 12435=>1000, 12441=>1000, 12443=>1000, 12449=>1000, 12450=>1000, 12451=>1000, 
+	12452=>1000, 12453=>1000, 12454=>1000, 12455=>1000, 12456=>1000, 12457=>1000, 12458=>1000, 12459=>1000, 12460=>1000, 12461=>1000, 12462=>1000, 12463=>1000, 12464=>1000, 12465=>1000, 12466=>1000, 12467=>1000, 
+	12468=>1000, 12469=>1000, 12470=>1000, 12471=>1000, 12472=>1000, 12473=>1000, 12474=>1000, 12475=>1000, 12476=>1000, 12477=>1000, 12478=>1000, 12479=>1000, 12480=>1000, 12481=>1000, 12482=>1000, 12483=>1000, 
+	12484=>1000, 12485=>1000, 12486=>1000, 12487=>1000, 12488=>1000, 12489=>1000, 12490=>1000, 12491=>1000, 12492=>1000, 12493=>1000, 12494=>1000, 12495=>1000, 12496=>1000, 12497=>1000, 12498=>1000, 12499=>1000, 
+	12500=>1000, 12501=>1000, 12502=>1000, 12503=>1000, 12504=>1000, 12505=>1000, 12506=>1000, 12507=>1000, 12508=>1000, 12509=>1000, 12510=>1000, 12511=>1000, 12512=>1000, 12513=>1000, 12514=>1000, 12515=>1000, 
+	12516=>1000, 12517=>1000, 12518=>1000, 12519=>1000, 12520=>1000, 12521=>1000, 12522=>1000, 12523=>1000, 12524=>1000, 12525=>1000, 12526=>1000, 12527=>1000, 12528=>1000, 12529=>1000, 12530=>1000, 12531=>1000, 
+	12532=>1000, 12533=>1000, 12534=>1000, 12535=>1000, 12536=>1000, 12537=>1000, 12538=>1000, 12539=>278, 12540=>1000, 12541=>1000, 12542=>1000, 63033=>556, 63034=>556, 63035=>556, 63036=>556, 63037=>556, 
+	63038=>556, 63039=>556, 63040=>556, 63041=>556, 63166=>222, 63171=>333, 63196=>556, 64256=>556, 64257=>500, 64258=>500, 64259=>778, 64260=>778, 64261=>556, 64262=>778, 64285=>200, 64286=>305, 
+	64287=>400, 64288=>587, 64289=>890, 64290=>848, 64291=>872, 64292=>800, 64293=>850, 64294=>873, 64295=>797, 64296=>937, 64297=>584, 64298=>776, 64299=>776, 64300=>776, 64301=>776, 64302=>640, 
+	64303=>640, 64304=>640, 64305=>591, 64306=>466, 64307=>598, 64308=>622, 64309=>262, 64310=>351, 64312=>608, 64313=>270, 64314=>526, 64315=>550, 64316=>600, 64318=>621, 64320=>378, 64321=>607, 
+	64323=>575, 64324=>568, 64326=>590, 64327=>606, 64328=>547, 64329=>776, 64330=>687, 64331=>212, 64332=>591, 64333=>550, 64334=>568, 64335=>640, 65533=>788);
+$enc='';
+$diff='';
+$file='FreeSans.z';
+$ctg='FreeSans.ctg.z';
+$originalsize=264072;
+?>

Added: incphp/print/fonts/freesansb.php
===================================================================
--- incphp/print/fonts/freesansb.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/print/fonts/freesansb.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,79 @@
+<?php
+$type='TrueTypeUnicode';
+$name='FreeSansBold';
+$desc=array('Ascent'=>1159,'Descent'=>-355,'CapHeight'=>1159,'Flags'=>32,'FontBBox'=>'[-459 -355 1300 1159]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>600);
+$up=-155;
+$ut=69;
+$cw=array(
+	13=>333, 32=>278, 33=>333, 34=>474, 35=>556, 36=>556, 37=>889, 38=>722, 39=>238, 40=>333, 41=>333, 42=>389, 43=>584, 44=>278, 45=>333, 46=>278, 
+	47=>278, 48=>556, 49=>556, 50=>556, 51=>556, 52=>556, 53=>556, 54=>556, 55=>556, 56=>556, 57=>556, 58=>333, 59=>333, 60=>584, 61=>584, 62=>584, 
+	63=>611, 64=>975, 65=>722, 66=>722, 67=>722, 68=>722, 69=>667, 70=>611, 71=>778, 72=>722, 73=>278, 74=>556, 75=>722, 76=>611, 77=>833, 78=>722, 
+	79=>778, 80=>667, 81=>778, 82=>722, 83=>667, 84=>611, 85=>722, 86=>667, 87=>944, 88=>667, 89=>667, 90=>611, 91=>333, 92=>278, 93=>333, 94=>584, 
+	95=>556, 96=>333, 97=>556, 98=>611, 99=>556, 100=>611, 101=>556, 102=>333, 103=>611, 104=>611, 105=>278, 106=>278, 107=>556, 108=>278, 109=>889, 110=>611, 
+	111=>611, 112=>611, 113=>611, 114=>389, 115=>556, 116=>333, 117=>611, 118=>556, 119=>778, 120=>556, 121=>556, 122=>500, 123=>389, 124=>280, 125=>389, 126=>584, 
+	8364=>556, 1027=>611, 8218=>278, 402=>556, 8222=>500, 8230=>1000, 8224=>556, 8225=>556, 710=>333, 8240=>1000, 352=>667, 8249=>333, 338=>1000, 1036=>722, 381=>611, 1039=>722, 
+	8216=>278, 8217=>278, 8220=>500, 8221=>500, 8226=>350, 8211=>556, 8212=>1000, 732=>333, 8482=>1000, 353=>556, 8250=>333, 339=>944, 1116=>573, 382=>500, 376=>667, 161=>333, 
+	162=>556, 163=>556, 164=>556, 165=>556, 166=>280, 167=>556, 168=>333, 169=>737, 170=>370, 171=>556, 172=>584, 174=>737, 175=>333, 176=>606, 177=>584, 178=>351, 
+	179=>351, 180=>333, 181=>611, 182=>556, 183=>278, 184=>333, 185=>351, 186=>365, 187=>556, 188=>869, 189=>869, 190=>869, 191=>611, 192=>722, 193=>722, 194=>722, 
+	195=>722, 196=>722, 197=>722, 198=>1000, 199=>722, 200=>667, 201=>667, 202=>667, 203=>667, 204=>278, 205=>278, 206=>278, 207=>278, 208=>722, 209=>722, 210=>778, 
+	211=>778, 212=>778, 213=>778, 214=>778, 215=>584, 216=>778, 217=>722, 218=>722, 219=>722, 220=>722, 221=>667, 222=>667, 223=>611, 224=>556, 225=>556, 226=>556, 
+	227=>556, 228=>556, 229=>556, 230=>889, 231=>556, 232=>556, 233=>556, 234=>556, 235=>556, 236=>278, 237=>278, 238=>278, 239=>278, 240=>611, 241=>611, 242=>611, 
+	243=>611, 244=>611, 245=>611, 246=>611, 247=>584, 248=>611, 249=>611, 250=>611, 251=>611, 252=>611, 253=>556, 254=>611, 255=>556, 256=>722, 257=>556, 258=>722, 
+	259=>556, 260=>722, 261=>556, 262=>722, 263=>556, 264=>722, 265=>556, 266=>722, 267=>556, 268=>722, 269=>556, 270=>722, 271=>611, 272=>722, 273=>611, 274=>667, 
+	275=>556, 276=>667, 277=>556, 278=>667, 279=>556, 280=>667, 281=>556, 282=>667, 283=>556, 284=>778, 285=>611, 286=>778, 287=>611, 288=>778, 289=>611, 290=>778, 
+	291=>611, 292=>722, 293=>611, 294=>722, 295=>611, 296=>278, 297=>278, 298=>278, 299=>278, 300=>278, 301=>278, 302=>278, 303=>278, 304=>278, 305=>278, 306=>808, 
+	307=>492, 308=>556, 309=>278, 310=>722, 311=>556, 312=>573, 313=>611, 314=>278, 315=>611, 316=>278, 317=>611, 318=>278, 319=>611, 320=>556, 321=>611, 322=>278, 
+	323=>722, 324=>611, 325=>722, 326=>611, 327=>722, 328=>611, 329=>611, 330=>722, 331=>611, 332=>778, 333=>611, 334=>778, 335=>611, 336=>778, 337=>611, 340=>722, 
+	341=>389, 342=>722, 343=>389, 344=>722, 345=>389, 346=>667, 347=>556, 348=>667, 349=>556, 350=>667, 351=>556, 354=>611, 355=>333, 356=>611, 357=>333, 358=>611, 
+	359=>333, 360=>722, 361=>611, 362=>722, 363=>611, 364=>722, 365=>611, 366=>722, 367=>611, 368=>722, 369=>611, 370=>722, 371=>611, 372=>944, 373=>778, 374=>667, 
+	375=>556, 377=>611, 378=>500, 379=>611, 380=>500, 383=>333, 452=>1333, 453=>1222, 454=>1111, 455=>1167, 456=>889, 457=>556, 458=>1278, 459=>1000, 460=>889, 461=>722, 
+	462=>556, 463=>278, 464=>278, 465=>778, 466=>611, 467=>722, 468=>611, 469=>722, 470=>611, 471=>722, 472=>611, 473=>722, 474=>611, 475=>722, 476=>611, 478=>722, 
+	479=>556, 482=>1000, 483=>889, 486=>778, 487=>611, 488=>722, 489=>556, 490=>778, 491=>611, 492=>778, 493=>611, 497=>1333, 498=>1222, 499=>1111, 504=>722, 505=>611, 
+	506=>722, 507=>556, 508=>1000, 509=>889, 510=>778, 511=>611, 514=>722, 515=>556, 518=>667, 519=>556, 522=>278, 523=>278, 526=>778, 527=>611, 530=>722, 531=>389, 
+	534=>722, 535=>611, 536=>667, 537=>556, 538=>611, 539=>333, 711=>333, 728=>333, 729=>333, 730=>333, 731=>333, 733=>333, 884=>379, 885=>379, 890=>332, 894=>333, 
+	900=>325, 901=>658, 902=>761, 903=>474, 904=>706, 905=>733, 906=>285, 908=>785, 910=>823, 911=>819, 913=>722, 914=>722, 915=>642, 916=>726, 917=>667, 918=>611, 
+	919=>722, 920=>810, 921=>278, 922=>722, 923=>744, 924=>860, 925=>714, 926=>690, 927=>822, 928=>781, 929=>698, 931=>688, 932=>688, 933=>804, 934=>777, 935=>783, 
+	936=>805, 937=>780, 938=>278, 939=>804, 940=>660, 941=>559, 942=>560, 943=>356, 944=>575, 945=>656, 946=>576, 947=>591, 948=>620, 949=>570, 950=>522, 951=>586, 
+	952=>586, 953=>346, 954=>576, 955=>620, 956=>667, 957=>564, 958=>530, 959=>610, 960=>721, 961=>626, 962=>595, 963=>676, 964=>592, 965=>575, 966=>801, 967=>632, 
+	968=>722, 969=>800, 970=>346, 971=>575, 972=>599, 973=>567, 974=>1125, 1024=>667, 1025=>709, 1026=>790, 1028=>722, 1029=>667, 1030=>278, 1031=>278, 1032=>556, 1033=>1110, 
+	1034=>1113, 1035=>790, 1037=>726, 1038=>718, 1040=>722, 1041=>722, 1042=>722, 1043=>611, 1044=>900, 1045=>709, 1046=>1093, 1047=>672, 1048=>757, 1049=>757, 1050=>750, 1051=>729, 
+	1052=>874, 1053=>753, 1054=>778, 1055=>753, 1056=>671, 1057=>722, 1058=>611, 1059=>718, 1060=>892, 1061=>667, 1062=>816, 1063=>685, 1064=>1057, 1065=>1183, 1066=>928, 1067=>949, 
+	1068=>687, 1069=>722, 1070=>1109, 1071=>698, 1072=>556, 1073=>606, 1074=>572, 1075=>454, 1076=>685, 1077=>556, 1078=>809, 1079=>546, 1080=>615, 1081=>615, 1082=>573, 1083=>577, 
+	1084=>666, 1085=>603, 1086=>611, 1087=>603, 1088=>611, 1089=>556, 1090=>454, 1091=>556, 1092=>957, 1093=>556, 1094=>652, 1095=>578, 1096=>886, 1097=>968, 1098=>693, 1099=>811, 
+	1100=>562, 1101=>564, 1102=>908, 1103=>596, 1104=>556, 1105=>556, 1106=>606, 1107=>454, 1108=>556, 1109=>556, 1110=>278, 1111=>278, 1112=>278, 1113=>900, 1114=>611, 1115=>606, 
+	1117=>608, 1118=>556, 1119=>608, 1164=>687, 1165=>562, 1166=>667, 1167=>611, 1168=>611, 1169=>454, 1170=>611, 1171=>454, 1172=>611, 1173=>454, 1174=>1093, 1175=>809, 1176=>672, 
+	1177=>546, 1178=>722, 1179=>573, 1180=>722, 1181=>573, 1182=>722, 1183=>573, 1184=>722, 1185=>573, 1186=>722, 1187=>608, 1188=>722, 1189=>608, 1190=>722, 1191=>608, 1192=>722, 
+	1193=>556, 1194=>722, 1195=>556, 1196=>611, 1197=>454, 1198=>667, 1199=>556, 1200=>667, 1201=>556, 1202=>667, 1203=>556, 1204=>814, 1205=>685, 1206=>675, 1207=>580, 1208=>675, 
+	1209=>580, 1210=>675, 1211=>580, 1212=>722, 1213=>556, 1214=>722, 1215=>556, 1216=>278, 1217=>1093, 1218=>809, 1219=>722, 1220=>573, 1223=>722, 1224=>608, 1227=>675, 1228=>580, 
+	1232=>722, 1233=>556, 1234=>722, 1235=>556, 1236=>1000, 1237=>889, 1238=>709, 1239=>556, 1240=>722, 1241=>556, 1242=>722, 1243=>556, 1244=>1093, 1245=>809, 1246=>672, 1247=>546, 
+	1248=>672, 1249=>546, 1250=>757, 1251=>615, 1252=>757, 1253=>615, 1254=>778, 1255=>611, 1256=>778, 1257=>611, 1258=>778, 1259=>611, 1260=>722, 1261=>564, 1262=>718, 1263=>556, 
+	1264=>718, 1265=>556, 1266=>718, 1267=>556, 1268=>685, 1269=>578, 1272=>949, 1273=>811, 1456=>82, 1457=>347, 1458=>341, 1459=>341, 1460=>82, 1461=>211, 1462=>211, 1463=>200, 
+	1464=>200, 1465=>82, 1467=>341, 1468=>82, 1469=>82, 1470=>516, 1471=>200, 1472=>297, 1473=>1038, 1474=>1038, 1475=>333, 1476=>82, 1488=>714, 1489=>651, 1490=>557, 1491=>638, 
+	1492=>682, 1493=>297, 1494=>443, 1495=>682, 1496=>670, 1497=>284, 1498=>590, 1499=>595, 1500=>667, 1501=>683, 1502=>704, 1503=>297, 1504=>429, 1505=>670, 1506=>653, 1507=>661, 
+	1508=>660, 1509=>616, 1510=>671, 1511=>672, 1512=>600, 1513=>840, 1514=>756, 1520=>554, 1521=>550, 1522=>542, 1523=>238, 1524=>474, 1559=>556, 1560=>778, 1561=>944, 1562=>611, 
+	1563=>278, 1564=>889, 1569=>844, 1576=>923, 1578=>922, 1579=>922, 1581=>649, 1582=>704, 1587=>1221, 7936=>656, 7937=>656, 7938=>656, 7939=>656, 7940=>656, 7941=>656, 7942=>656, 
+	7943=>656, 7944=>722, 7945=>722, 7946=>722, 7947=>722, 7948=>722, 7949=>722, 7950=>722, 7951=>722, 7952=>570, 7953=>570, 7954=>570, 7955=>570, 7956=>570, 7957=>570, 7960=>667, 
+	7961=>667, 7962=>667, 7963=>667, 7964=>667, 7965=>667, 7968=>586, 7969=>586, 7970=>586, 7971=>586, 7972=>586, 7973=>586, 7974=>586, 7975=>586, 7976=>722, 7977=>722, 7978=>722, 
+	7979=>722, 7980=>722, 7981=>722, 7982=>722, 7983=>722, 7984=>346, 7985=>346, 7986=>346, 7987=>346, 7988=>346, 7989=>346, 7990=>346, 7991=>346, 7992=>278, 7993=>278, 7994=>278, 
+	7995=>278, 7996=>278, 7997=>278, 7998=>278, 7999=>278, 8000=>610, 8001=>610, 8002=>610, 8003=>610, 8004=>610, 8005=>610, 8008=>822, 8009=>822, 8010=>822, 8011=>822, 8012=>822, 
+	8013=>822, 8016=>575, 8017=>575, 8018=>575, 8019=>575, 8020=>575, 8021=>575, 8022=>575, 8023=>575, 8025=>804, 8027=>804, 8029=>804, 8031=>804, 8032=>800, 8033=>800, 8034=>800, 
+	8035=>800, 8036=>800, 8037=>800, 8038=>800, 8039=>800, 8040=>780, 8041=>780, 8042=>780, 8043=>780, 8044=>780, 8045=>780, 8046=>780, 8047=>780, 8048=>656, 8049=>656, 8050=>570, 
+	8051=>570, 8052=>586, 8053=>586, 8054=>346, 8055=>346, 8056=>610, 8057=>610, 8058=>575, 8059=>575, 8060=>800, 8061=>800, 8064=>656, 8065=>656, 8066=>656, 8067=>656, 8068=>656, 
+	8069=>656, 8070=>656, 8071=>656, 8072=>968, 8073=>968, 8074=>968, 8075=>968, 8076=>968, 8077=>968, 8078=>968, 8079=>968, 8080=>586, 8081=>586, 8082=>586, 8083=>586, 8084=>586, 
+	8085=>586, 8086=>586, 8087=>586, 8088=>968, 8089=>968, 8090=>968, 8091=>968, 8092=>968, 8093=>968, 8094=>968, 8095=>968, 8096=>800, 8097=>800, 8098=>800, 8099=>800, 8100=>800, 
+	8101=>800, 8102=>800, 8103=>800, 8104=>1026, 8105=>1026, 8106=>1026, 8107=>1026, 8108=>1026, 8109=>1026, 8110=>1026, 8111=>1026, 8112=>656, 8113=>656, 8114=>656, 8115=>656, 8116=>660, 
+	8118=>656, 8119=>656, 8120=>722, 8121=>722, 8122=>722, 8123=>722, 8124=>968, 8125=>278, 8126=>346, 8127=>278, 8128=>278, 8129=>333, 8130=>586, 8131=>586, 8132=>560, 8134=>586, 
+	8135=>586, 8136=>667, 8137=>667, 8138=>722, 8139=>722, 8140=>968, 8141=>492, 8142=>489, 8143=>394, 8144=>346, 8145=>346, 8146=>346, 8147=>346, 8150=>346, 8151=>346, 8152=>278, 
+	8153=>278, 8154=>278, 8155=>278, 8157=>481, 8158=>589, 8159=>333, 8160=>575, 8161=>575, 8162=>575, 8163=>575, 8164=>626, 8165=>626, 8166=>575, 8167=>575, 8168=>804, 8169=>804, 
+	8170=>804, 8171=>804, 8172=>698, 8173=>333, 8174=>333, 8175=>333, 8178=>800, 8179=>800, 8180=>1125, 8182=>800, 8183=>800, 8184=>822, 8185=>822, 8186=>780, 8187=>780, 8188=>1111, 
+	8189=>333, 8190=>278, 8260=>167, 8308=>351, 8321=>351, 8322=>351, 8323=>351, 8324=>351, 8362=>1049, 8543=>869, 8706=>490, 8710=>729, 8721=>711, 8722=>584, 8730=>542, 8800=>548, 
+	8804=>584, 8805=>584, 9674=>489, 63033=>556, 63034=>556, 63035=>556, 63036=>556, 63037=>556, 63038=>556, 63039=>556, 63040=>556, 63041=>556, 63171=>333, 63196=>556, 64257=>611, 64258=>611, 
+	64285=>284, 64286=>305, 64287=>542, 64288=>653, 64289=>964, 64290=>888, 64291=>932, 64292=>845, 64293=>917, 64294=>933, 64295=>850, 64296=>1006, 64297=>584, 64298=>840, 64299=>840, 64300=>840, 
+	64301=>840, 64302=>714, 64303=>714, 64304=>714, 64305=>651, 64306=>557, 64307=>638, 64308=>682, 64309=>367, 64310=>443, 64312=>670, 64313=>354, 64314=>590, 64315=>595, 64316=>667, 64318=>704, 
+	64320=>429, 64321=>670, 64323=>661, 64324=>660, 64326=>671, 64327=>672, 64328=>600, 64329=>840, 64330=>756, 64331=>297, 64332=>651, 64333=>595, 64334=>660, 64335=>714, 65182=>636);
+$enc='';
+$diff='';
+$file='FreeSansBold.z';
+$ctg='FreeSansBold.ctg.z';
+$originalsize=91432;
+?>

Added: incphp/print/fonts/freesansbi.php
===================================================================
--- incphp/print/fonts/freesansbi.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/print/fonts/freesansbi.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,76 @@
+<?php
+$type='TrueTypeUnicode';
+$name='FreeSansBoldOblique';
+$desc=array('Ascent'=>979,'Descent'=>-309,'CapHeight'=>979,'Flags'=>96,'FontBBox'=>'[-379 -309 1283 979]','ItalicAngle'=>-12,'StemV'=>120,'MissingWidth'=>600);
+$up=-111;
+$ut=69;
+$cw=array(
+	13=>333, 32=>278, 33=>333, 34=>474, 35=>556, 36=>556, 37=>889, 38=>722, 39=>238, 40=>333, 41=>333, 42=>389, 43=>584, 44=>278, 45=>333, 46=>278, 
+	47=>278, 48=>556, 49=>556, 50=>556, 51=>556, 52=>556, 53=>556, 54=>556, 55=>556, 56=>556, 57=>556, 58=>333, 59=>333, 60=>584, 61=>584, 62=>584, 
+	63=>611, 64=>975, 65=>722, 66=>722, 67=>722, 68=>722, 69=>667, 70=>611, 71=>778, 72=>722, 73=>278, 74=>556, 75=>722, 76=>611, 77=>833, 78=>722, 
+	79=>778, 80=>667, 81=>778, 82=>722, 83=>667, 84=>611, 85=>722, 86=>667, 87=>944, 88=>667, 89=>667, 90=>611, 91=>333, 92=>278, 93=>333, 94=>584, 
+	95=>556, 96=>333, 97=>556, 98=>611, 99=>556, 100=>611, 101=>556, 102=>333, 103=>611, 104=>611, 105=>278, 106=>278, 107=>556, 108=>278, 109=>889, 110=>611, 
+	111=>611, 112=>611, 113=>611, 114=>389, 115=>556, 116=>333, 117=>611, 118=>556, 119=>778, 120=>556, 121=>556, 122=>500, 123=>389, 124=>280, 125=>389, 126=>584, 
+	8364=>556, 1027=>611, 8218=>278, 402=>556, 8222=>500, 8230=>1000, 8224=>556, 8225=>556, 710=>333, 8240=>1000, 352=>667, 8249=>333, 338=>1000, 1036=>722, 381=>611, 1039=>722, 
+	8216=>278, 8217=>278, 8220=>500, 8221=>500, 8226=>350, 8211=>556, 8212=>1000, 732=>333, 8482=>1000, 353=>556, 8250=>333, 339=>944, 1116=>556, 382=>500, 376=>667, 161=>333, 
+	162=>556, 163=>556, 164=>556, 165=>556, 166=>280, 167=>556, 168=>333, 169=>737, 170=>370, 171=>556, 172=>584, 174=>737, 175=>333, 176=>606, 177=>584, 178=>444, 
+	179=>444, 180=>333, 181=>611, 182=>556, 183=>278, 184=>333, 185=>444, 186=>365, 187=>556, 188=>1055, 189=>1055, 190=>1055, 191=>611, 192=>722, 193=>722, 194=>722, 
+	195=>722, 196=>722, 197=>722, 198=>1000, 199=>722, 200=>667, 201=>667, 202=>667, 203=>667, 204=>278, 205=>278, 206=>278, 207=>278, 208=>722, 209=>722, 210=>778, 
+	211=>778, 212=>778, 213=>778, 214=>778, 215=>584, 216=>778, 217=>722, 218=>722, 219=>722, 220=>722, 221=>667, 222=>667, 223=>611, 224=>556, 225=>556, 226=>556, 
+	227=>556, 228=>556, 229=>556, 230=>889, 231=>556, 232=>556, 233=>556, 234=>556, 235=>556, 236=>278, 237=>278, 238=>278, 239=>278, 240=>611, 241=>611, 242=>611, 
+	243=>611, 244=>611, 245=>611, 246=>611, 247=>584, 248=>611, 249=>611, 250=>611, 251=>611, 252=>611, 253=>556, 254=>611, 255=>556, 256=>722, 257=>556, 258=>722, 
+	259=>556, 260=>722, 261=>556, 262=>722, 263=>556, 264=>722, 265=>556, 266=>722, 267=>556, 268=>722, 269=>556, 270=>722, 271=>722, 272=>722, 273=>611, 274=>667, 
+	275=>556, 276=>667, 277=>556, 278=>667, 279=>556, 280=>667, 281=>556, 282=>667, 283=>556, 284=>778, 285=>611, 286=>778, 287=>611, 288=>778, 289=>611, 290=>778, 
+	291=>611, 292=>722, 293=>611, 294=>722, 295=>611, 296=>278, 297=>278, 298=>278, 299=>278, 300=>278, 301=>278, 302=>278, 303=>268, 304=>278, 305=>278, 306=>278, 
+	307=>278, 308=>556, 309=>278, 310=>722, 311=>556, 312=>529, 313=>611, 314=>278, 315=>611, 316=>278, 317=>611, 318=>384, 319=>611, 320=>556, 321=>611, 322=>278, 
+	323=>722, 324=>611, 325=>722, 326=>611, 327=>722, 328=>611, 329=>611, 330=>722, 331=>611, 332=>778, 333=>611, 334=>778, 335=>611, 336=>778, 337=>611, 340=>722, 
+	341=>389, 342=>722, 343=>389, 344=>722, 345=>389, 346=>667, 347=>556, 348=>667, 349=>556, 350=>667, 351=>556, 354=>611, 355=>333, 356=>611, 357=>404, 358=>611, 
+	359=>333, 360=>722, 361=>611, 362=>722, 363=>611, 364=>722, 365=>611, 366=>722, 367=>611, 368=>722, 369=>611, 370=>722, 371=>611, 372=>944, 373=>778, 374=>667, 
+	375=>556, 377=>611, 378=>500, 379=>611, 380=>500, 383=>333, 536=>667, 537=>556, 538=>611, 539=>333, 711=>333, 728=>333, 729=>333, 730=>333, 731=>333, 733=>333, 
+	768=>0, 769=>0, 770=>0, 771=>0, 772=>0, 774=>0, 775=>0, 776=>0, 778=>0, 779=>0, 780=>0, 783=>0, 785=>0, 787=>0, 788=>0, 884=>208, 
+	885=>247, 890=>364, 894=>333, 900=>308, 901=>446, 902=>688, 903=>418, 904=>642, 905=>743, 906=>228, 908=>754, 910=>736, 911=>743, 912=>346, 913=>764, 914=>688, 
+	915=>642, 916=>744, 917=>710, 918=>688, 919=>743, 920=>810, 921=>296, 922=>744, 923=>744, 924=>860, 925=>714, 926=>690, 927=>822, 928=>781, 929=>698, 931=>688, 
+	932=>688, 933=>744, 934=>777, 935=>783, 936=>805, 937=>780, 938=>296, 939=>744, 940=>640, 941=>530, 942=>597, 943=>339, 944=>575, 945=>656, 946=>576, 947=>591, 
+	948=>620, 949=>570, 950=>522, 951=>586, 952=>586, 953=>346, 954=>576, 955=>620, 956=>667, 957=>564, 958=>530, 959=>610, 960=>721, 961=>626, 962=>595, 963=>676, 
+	964=>592, 965=>575, 966=>801, 967=>632, 968=>722, 969=>800, 970=>346, 971=>575, 972=>609, 973=>604, 974=>769, 1024=>666, 1025=>666, 1026=>790, 1028=>722, 1029=>667, 
+	1030=>278, 1031=>278, 1032=>556, 1033=>1110, 1034=>1088, 1035=>790, 1037=>722, 1038=>718, 1040=>722, 1041=>722, 1042=>723, 1043=>611, 1044=>918, 1045=>666, 1046=>1054, 1047=>659, 
+	1048=>722, 1049=>722, 1050=>720, 1051=>722, 1052=>843, 1053=>722, 1054=>778, 1055=>722, 1056=>649, 1057=>837, 1058=>611, 1059=>698, 1060=>902, 1061=>664, 1062=>730, 1063=>671, 
+	1064=>1101, 1065=>1179, 1066=>816, 1067=>939, 1068=>639, 1069=>737, 1070=>1080, 1071=>690, 1072=>554, 1073=>611, 1074=>621, 1075=>475, 1076=>804, 1077=>552, 1078=>775, 1079=>556, 
+	1080=>636, 1081=>636, 1082=>529, 1083=>608, 1084=>697, 1085=>636, 1086=>611, 1087=>636, 1088=>611, 1089=>554, 1090=>454, 1091=>552, 1092=>989, 1093=>554, 1094=>690, 1095=>606, 
+	1096=>934, 1097=>987, 1098=>741, 1099=>839, 1100=>619, 1101=>575, 1102=>908, 1103=>636, 1104=>552, 1105=>552, 1106=>606, 1107=>454, 1108=>556, 1109=>556, 1110=>278, 1111=>278, 
+	1112=>278, 1113=>900, 1114=>611, 1115=>606, 1117=>636, 1118=>556, 1119=>636, 1164=>639, 1165=>619, 1166=>649, 1167=>611, 1168=>611, 1169=>454, 1170=>611, 1171=>475, 1172=>611, 
+	1173=>475, 1174=>1054, 1175=>775, 1176=>659, 1177=>556, 1178=>720, 1179=>529, 1180=>720, 1181=>529, 1182=>720, 1183=>529, 1184=>720, 1185=>529, 1186=>722, 1187=>636, 1188=>722, 
+	1189=>636, 1190=>722, 1191=>636, 1192=>837, 1193=>554, 1194=>837, 1195=>554, 1196=>611, 1197=>454, 1198=>667, 1199=>556, 1200=>667, 1201=>556, 1202=>664, 1203=>554, 1204=>730, 
+	1205=>690, 1206=>671, 1207=>606, 1208=>671, 1209=>606, 1210=>671, 1211=>606, 1212=>837, 1213=>554, 1214=>837, 1215=>554, 1216=>278, 1217=>1054, 1218=>775, 1219=>720, 1220=>529, 
+	1223=>722, 1224=>636, 1227=>671, 1228=>606, 1232=>722, 1233=>554, 1234=>722, 1235=>554, 1236=>1000, 1237=>889, 1238=>666, 1239=>552, 1240=>837, 1241=>554, 1242=>837, 1243=>554, 
+	1244=>1054, 1245=>775, 1246=>659, 1247=>556, 1248=>659, 1249=>556, 1250=>722, 1251=>636, 1252=>722, 1253=>636, 1254=>778, 1255=>611, 1256=>778, 1257=>611, 1258=>778, 1259=>611, 
+	1260=>737, 1261=>575, 1262=>698, 1263=>552, 1264=>698, 1265=>552, 1266=>698, 1267=>552, 1268=>671, 1269=>606, 1272=>939, 1273=>839, 1456=>82, 1457=>347, 1458=>341, 1459=>341, 
+	1460=>82, 1461=>211, 1462=>211, 1463=>200, 1464=>200, 1465=>82, 1467=>341, 1468=>82, 1469=>82, 1470=>516, 1471=>200, 1472=>297, 1473=>1038, 1474=>1038, 1475=>333, 1476=>82, 
+	1488=>714, 1489=>651, 1490=>557, 1491=>638, 1492=>682, 1493=>297, 1494=>443, 1495=>682, 1496=>670, 1497=>284, 1498=>590, 1499=>595, 1500=>667, 1501=>683, 1502=>704, 1503=>297, 
+	1504=>429, 1505=>670, 1506=>653, 1507=>661, 1508=>660, 1509=>616, 1510=>671, 1511=>672, 1512=>600, 1513=>840, 1514=>756, 1520=>554, 1521=>550, 1522=>542, 1523=>238, 1524=>474, 
+	7936=>656, 7937=>656, 7938=>656, 7939=>656, 7940=>656, 7941=>656, 7942=>656, 7943=>656, 7944=>764, 7945=>764, 7946=>764, 7947=>764, 7948=>764, 7949=>764, 7950=>764, 7951=>764, 
+	7952=>570, 7953=>570, 7954=>570, 7955=>570, 7956=>570, 7957=>570, 7960=>710, 7961=>710, 7962=>710, 7963=>710, 7964=>710, 7965=>710, 7968=>586, 7969=>586, 7970=>586, 7971=>586, 
+	7972=>586, 7973=>586, 7974=>586, 7975=>586, 7976=>743, 7977=>743, 7978=>743, 7979=>743, 7980=>743, 7981=>743, 7982=>743, 7983=>743, 7984=>346, 7985=>346, 7986=>346, 7987=>346, 
+	7988=>346, 7989=>346, 7990=>346, 7991=>346, 7992=>296, 7993=>296, 7994=>296, 7995=>296, 7996=>296, 7997=>296, 7998=>296, 7999=>296, 8000=>610, 8001=>610, 8002=>610, 8003=>610, 
+	8004=>610, 8005=>610, 8008=>822, 8009=>822, 8010=>822, 8011=>822, 8012=>822, 8013=>822, 8016=>575, 8017=>575, 8018=>575, 8019=>575, 8020=>575, 8021=>575, 8022=>575, 8023=>575, 
+	8025=>744, 8027=>744, 8029=>744, 8031=>744, 8032=>800, 8033=>800, 8034=>800, 8035=>800, 8036=>800, 8037=>800, 8038=>800, 8039=>800, 8040=>780, 8041=>780, 8042=>780, 8043=>780, 
+	8044=>780, 8045=>780, 8046=>780, 8047=>780, 8048=>656, 8049=>656, 8050=>570, 8051=>570, 8052=>586, 8053=>586, 8054=>346, 8055=>346, 8056=>610, 8057=>610, 8058=>575, 8059=>575, 
+	8060=>800, 8061=>800, 8064=>656, 8065=>656, 8066=>656, 8067=>656, 8068=>656, 8069=>656, 8070=>656, 8071=>656, 8072=>1007, 8073=>1007, 8074=>1007, 8075=>1007, 8076=>1007, 8077=>1007, 
+	8078=>1007, 8079=>1007, 8080=>586, 8081=>586, 8082=>586, 8083=>586, 8084=>586, 8085=>586, 8086=>586, 8087=>586, 8088=>986, 8089=>986, 8090=>986, 8091=>986, 8092=>986, 8093=>986, 
+	8094=>986, 8095=>986, 8096=>800, 8097=>800, 8098=>800, 8099=>800, 8100=>800, 8101=>800, 8102=>800, 8103=>800, 8104=>1023, 8105=>1023, 8106=>1023, 8107=>1023, 8108=>1023, 8109=>1023, 
+	8110=>1023, 8111=>1023, 8112=>656, 8113=>656, 8114=>656, 8115=>656, 8116=>640, 8118=>656, 8119=>656, 8120=>764, 8121=>764, 8122=>764, 8123=>764, 8124=>1007, 8125=>278, 8126=>201, 
+	8127=>147, 8128=>278, 8129=>333, 8130=>586, 8131=>586, 8132=>597, 8134=>586, 8135=>586, 8136=>710, 8137=>710, 8138=>743, 8139=>743, 8140=>986, 8141=>402, 8142=>403, 8143=>147, 
+	8144=>346, 8145=>346, 8146=>346, 8147=>346, 8150=>346, 8151=>346, 8152=>296, 8153=>296, 8154=>296, 8155=>296, 8157=>434, 8158=>433, 8159=>333, 8160=>575, 8161=>575, 8162=>575, 
+	8163=>575, 8164=>626, 8165=>626, 8166=>575, 8167=>575, 8168=>744, 8169=>744, 8173=>333, 8174=>351, 8175=>303, 8182=>800, 8183=>800, 8184=>822, 8185=>822, 8186=>780, 8187=>780, 
+	8188=>1023, 8189=>333, 8190=>159, 8260=>167, 8263=>1222, 8264=>944, 8265=>944, 8362=>1049, 8706=>490, 8710=>729, 8721=>711, 8722=>584, 8730=>542, 8800=>584, 8804=>584, 8805=>584, 
+	9674=>489, 63033=>556, 63034=>556, 63035=>556, 63036=>556, 63037=>556, 63038=>556, 63039=>556, 63040=>556, 63041=>556, 63166=>278, 63171=>333, 63196=>556, 64256=>666, 64257=>611, 64258=>611, 
+	64259=>944, 64260=>944, 64261=>666, 64262=>889, 64285=>284, 64286=>305, 64287=>542, 64288=>653, 64289=>964, 64290=>888, 64291=>932, 64292=>845, 64293=>917, 64294=>933, 64295=>850, 64296=>1006, 
+	64297=>584, 64298=>840, 64299=>840, 64300=>840, 64301=>840, 64302=>714, 64303=>714, 64304=>714, 64305=>651, 64306=>557, 64307=>638, 64308=>682, 64309=>367, 64310=>443, 64312=>670, 64313=>354, 
+	64314=>590, 64315=>595, 64316=>667, 64318=>704, 64320=>429, 64321=>670, 64323=>661, 64324=>660, 64326=>671, 64327=>672, 64328=>600, 64329=>840, 64330=>756, 64331=>297, 64332=>651, 64333=>595, 
+	64334=>660, 64335=>714);
+$enc='';
+$diff='';
+$file='FreeSansBoldOblique.z';
+$ctg='FreeSansBoldOblique.ctg.z';
+$originalsize=95508;
+?>

Added: incphp/print/fonts/freesansi.php
===================================================================
--- incphp/print/fonts/freesansi.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/print/fonts/freesansi.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,85 @@
+<?php
+$type='TrueTypeUnicode';
+$name='FreeSansOblique';
+$desc=array('Ascent'=>1141,'Descent'=>-419,'CapHeight'=>1141,'Flags'=>96,'FontBBox'=>'[-313 -419 1129 1141]','ItalicAngle'=>-12,'StemV'=>70,'MissingWidth'=>600);
+$up=-151;
+$ut=50;
+$cw=array(
+	13=>333, 32=>278, 33=>278, 34=>355, 35=>556, 36=>556, 37=>889, 38=>667, 39=>191, 40=>333, 41=>333, 42=>389, 43=>584, 44=>278, 45=>333, 46=>278, 
+	47=>278, 48=>556, 49=>556, 50=>556, 51=>556, 52=>556, 53=>556, 54=>556, 55=>556, 56=>556, 57=>556, 58=>278, 59=>278, 60=>584, 61=>584, 62=>584, 
+	63=>556, 64=>1015, 65=>667, 66=>667, 67=>722, 68=>722, 69=>667, 70=>611, 71=>778, 72=>722, 73=>278, 74=>500, 75=>667, 76=>556, 77=>833, 78=>722, 
+	79=>778, 80=>667, 81=>778, 82=>722, 83=>667, 84=>611, 85=>722, 86=>667, 87=>944, 88=>667, 89=>667, 90=>611, 91=>278, 92=>278, 93=>278, 94=>469, 
+	95=>556, 96=>333, 97=>556, 98=>556, 99=>500, 100=>556, 101=>556, 102=>278, 103=>556, 104=>556, 105=>222, 106=>222, 107=>500, 108=>222, 109=>833, 110=>556, 
+	111=>556, 112=>556, 113=>556, 114=>333, 115=>500, 116=>278, 117=>556, 118=>500, 119=>722, 120=>500, 121=>500, 122=>500, 123=>334, 124=>260, 125=>334, 126=>584, 
+	8364=>556, 1027=>611, 8218=>222, 402=>556, 8222=>333, 8230=>1000, 8224=>556, 8225=>556, 710=>333, 8240=>1000, 352=>667, 8249=>333, 338=>1000, 1036=>667, 381=>611, 1039=>722, 
+	8216=>222, 8217=>222, 8220=>333, 8221=>333, 8226=>350, 8211=>556, 8212=>1000, 732=>333, 8482=>1000, 353=>500, 8250=>333, 339=>944, 1116=>500, 382=>500, 376=>667, 161=>333, 
+	162=>556, 163=>556, 164=>556, 165=>556, 166=>260, 167=>556, 168=>333, 169=>737, 170=>370, 171=>556, 172=>584, 173=>333, 174=>737, 175=>333, 176=>606, 177=>584, 
+	178=>390, 179=>390, 180=>333, 181=>556, 182=>537, 183=>278, 184=>333, 185=>390, 186=>365, 187=>556, 188=>947, 189=>947, 190=>947, 191=>611, 192=>667, 193=>667, 
+	194=>667, 195=>667, 196=>667, 197=>667, 198=>1000, 199=>722, 200=>667, 201=>667, 202=>667, 203=>667, 204=>278, 205=>278, 206=>278, 207=>278, 208=>722, 209=>722, 
+	210=>778, 211=>778, 212=>778, 213=>778, 214=>778, 215=>584, 216=>778, 217=>722, 218=>722, 219=>722, 220=>722, 221=>667, 222=>667, 223=>611, 224=>556, 225=>556, 
+	226=>556, 227=>556, 228=>556, 229=>556, 230=>889, 231=>500, 232=>556, 233=>556, 234=>556, 235=>556, 236=>278, 237=>278, 238=>278, 239=>278, 240=>556, 241=>556, 
+	242=>556, 243=>556, 244=>556, 245=>556, 246=>556, 247=>584, 248=>611, 249=>556, 250=>556, 251=>556, 252=>556, 253=>500, 254=>556, 255=>500, 256=>667, 257=>556, 
+	258=>667, 259=>556, 260=>667, 261=>556, 262=>722, 263=>500, 264=>722, 265=>500, 266=>722, 267=>500, 268=>722, 269=>500, 270=>722, 271=>650, 272=>722, 273=>556, 
+	274=>667, 275=>556, 276=>667, 277=>556, 278=>667, 279=>556, 280=>667, 281=>556, 282=>667, 283=>556, 284=>778, 285=>556, 286=>778, 287=>556, 288=>778, 289=>556, 
+	290=>778, 291=>527, 292=>722, 293=>556, 294=>722, 295=>556, 296=>278, 297=>278, 298=>278, 299=>222, 300=>278, 301=>278, 302=>278, 303=>222, 304=>278, 305=>278, 
+	306=>742, 307=>362, 308=>500, 309=>222, 310=>667, 311=>500, 312=>510, 313=>556, 314=>222, 315=>556, 316=>222, 317=>556, 318=>307, 319=>556, 320=>500, 321=>556, 
+	322=>222, 323=>722, 324=>556, 325=>722, 326=>556, 327=>722, 328=>556, 329=>556, 330=>722, 331=>556, 332=>778, 333=>556, 334=>778, 335=>556, 336=>778, 337=>556, 
+	340=>722, 341=>333, 342=>722, 343=>333, 344=>722, 345=>333, 346=>667, 347=>500, 348=>667, 349=>500, 350=>667, 351=>500, 354=>611, 355=>278, 356=>611, 357=>319, 
+	358=>611, 359=>278, 360=>722, 361=>556, 362=>722, 363=>556, 364=>722, 365=>556, 366=>722, 367=>556, 368=>722, 369=>556, 370=>722, 371=>556, 372=>944, 373=>722, 
+	374=>667, 375=>500, 377=>611, 378=>500, 379=>611, 380=>500, 383=>278, 461=>667, 462=>556, 463=>278, 464=>278, 465=>778, 466=>556, 467=>722, 468=>556, 469=>722, 
+	470=>556, 471=>722, 472=>556, 473=>722, 474=>556, 475=>722, 476=>556, 478=>667, 479=>556, 482=>1000, 483=>889, 486=>778, 487=>556, 488=>667, 489=>500, 490=>778, 
+	491=>556, 492=>778, 493=>556, 496=>222, 500=>778, 501=>556, 504=>722, 505=>556, 506=>667, 507=>556, 508=>1000, 509=>889, 510=>778, 511=>611, 512=>667, 513=>556, 
+	514=>667, 515=>556, 516=>667, 517=>556, 518=>667, 519=>556, 520=>278, 521=>278, 522=>278, 523=>278, 524=>778, 525=>556, 526=>778, 527=>556, 528=>722, 529=>333, 
+	530=>722, 531=>333, 532=>722, 533=>556, 534=>722, 535=>556, 536=>667, 537=>500, 538=>611, 539=>278, 711=>333, 728=>333, 729=>333, 730=>333, 731=>333, 733=>333, 
+	768=>0, 769=>0, 770=>0, 771=>0, 772=>0, 774=>0, 775=>0, 776=>0, 778=>0, 779=>0, 783=>0, 785=>0, 787=>0, 788=>0, 884=>199, 885=>199, 
+	890=>332, 894=>278, 900=>291, 901=>624, 902=>659, 903=>358, 904=>657, 905=>678, 906=>183, 908=>729, 910=>699, 911=>747, 912=>286, 913=>684, 914=>628, 915=>582, 
+	916=>684, 917=>650, 918=>628, 919=>683, 920=>750, 921=>236, 922=>684, 923=>684, 924=>800, 925=>654, 926=>630, 927=>750, 928=>721, 929=>638, 931=>628, 932=>628, 
+	933=>684, 934=>717, 935=>723, 936=>745, 937=>720, 938=>236, 939=>684, 940=>593, 941=>519, 942=>595, 943=>271, 944=>515, 945=>596, 946=>516, 947=>531, 948=>560, 
+	949=>510, 950=>462, 951=>526, 952=>526, 953=>286, 954=>516, 955=>560, 956=>607, 957=>504, 958=>470, 959=>550, 960=>661, 961=>566, 962=>535, 963=>616, 964=>532, 
+	965=>515, 966=>741, 967=>572, 968=>662, 969=>740, 970=>286, 971=>515, 972=>535, 973=>503, 974=>725, 1024=>667, 1025=>667, 1026=>766, 1028=>722, 1029=>667, 1030=>278, 
+	1031=>278, 1032=>500, 1033=>968, 1034=>1173, 1035=>766, 1037=>731, 1038=>650, 1040=>667, 1041=>639, 1042=>667, 1043=>611, 1044=>816, 1045=>667, 1046=>897, 1047=>652, 1048=>731, 
+	1049=>731, 1050=>664, 1051=>646, 1052=>833, 1053=>722, 1054=>778, 1055=>722, 1056=>667, 1057=>722, 1058=>611, 1059=>530, 1060=>891, 1061=>667, 1062=>722, 1063=>642, 1064=>836, 
+	1065=>837, 1066=>866, 1067=>886, 1068=>698, 1069=>717, 1070=>1079, 1071=>691, 1072=>556, 1073=>556, 1074=>538, 1075=>430, 1076=>640, 1077=>556, 1078=>818, 1079=>495, 1080=>560, 
+	1081=>560, 1082=>510, 1083=>556, 1084=>621, 1085=>561, 1086=>556, 1087=>560, 1088=>556, 1089=>500, 1090=>400, 1091=>500, 1092=>916, 1093=>500, 1094=>560, 1095=>497, 1096=>695, 
+	1097=>695, 1098=>640, 1099=>734, 1100=>523, 1101=>534, 1102=>788, 1103=>564, 1104=>556, 1105=>556, 1106=>568, 1107=>430, 1108=>500, 1109=>500, 1110=>222, 1111=>278, 1112=>222, 
+	1113=>840, 1114=>850, 1115=>568, 1117=>560, 1118=>500, 1119=>560, 1164=>698, 1165=>523, 1166=>667, 1167=>556, 1168=>611, 1169=>430, 1170=>611, 1171=>430, 1172=>611, 1173=>430, 
+	1174=>897, 1175=>818, 1176=>652, 1177=>495, 1178=>664, 1179=>510, 1180=>664, 1181=>510, 1182=>664, 1183=>510, 1184=>664, 1185=>510, 1186=>722, 1187=>561, 1188=>722, 1189=>561, 
+	1190=>722, 1191=>560, 1192=>722, 1193=>495, 1194=>722, 1195=>495, 1196=>611, 1197=>400, 1198=>667, 1199=>500, 1200=>667, 1201=>500, 1202=>665, 1203=>496, 1204=>722, 1205=>560, 
+	1206=>642, 1207=>497, 1208=>642, 1209=>497, 1210=>642, 1211=>497, 1212=>722, 1213=>495, 1214=>722, 1215=>495, 1216=>278, 1217=>897, 1218=>818, 1219=>664, 1220=>510, 1223=>722, 
+	1224=>561, 1227=>642, 1228=>497, 1232=>667, 1233=>556, 1234=>667, 1235=>556, 1236=>1000, 1237=>889, 1238=>667, 1239=>556, 1240=>722, 1241=>495, 1242=>722, 1243=>495, 1244=>897, 
+	1245=>818, 1246=>652, 1247=>495, 1248=>652, 1249=>495, 1250=>731, 1251=>560, 1252=>731, 1253=>560, 1254=>778, 1255=>556, 1256=>780, 1257=>554, 1258=>780, 1259=>554, 1260=>717, 
+	1261=>534, 1262=>530, 1263=>500, 1264=>530, 1265=>500, 1266=>530, 1267=>500, 1268=>642, 1269=>497, 1272=>886, 1273=>734, 1329=>722, 1330=>705, 1331=>774, 1332=>754, 1333=>722, 
+	1334=>751, 1335=>485, 1336=>722, 1337=>782, 1338=>655, 1339=>699, 1340=>417, 1341=>853, 1342=>791, 1343=>711, 1344=>588, 1345=>663, 1346=>665, 1347=>665, 1348=>756, 1349=>623, 
+	1350=>773, 1351=>603, 1352=>722, 1353=>648, 1354=>722, 1355=>751, 1356=>750, 1357=>722, 1358=>748, 1359=>667, 1360=>699, 1361=>623, 1362=>417, 1363=>785, 1364=>638, 1365=>778, 
+	1366=>716, 1370=>222, 1371=>133, 1372=>325, 1373=>333, 1374=>344, 1377=>833, 1378=>556, 1379=>572, 1380=>581, 1381=>550, 1382=>588, 1383=>448, 1384=>556, 1385=>568, 1386=>582, 
+	1387=>545, 1388=>301, 1389=>799, 1390=>556, 1391=>554, 1392=>533, 1393=>548, 1394=>552, 1395=>552, 1396=>544, 1397=>222, 1398=>544, 1399=>456, 1400=>556, 1401=>390, 1402=>833, 
+	1403=>509, 1404=>547, 1405=>533, 1406=>610, 1407=>887, 1408=>556, 1409=>545, 1410=>352, 1411=>853, 1412=>588, 1413=>579, 1414=>690, 1415=>545, 1417=>278, 1418=>367, 1456=>70, 
+	1457=>335, 1458=>329, 1459=>329, 1460=>70, 1461=>200, 1462=>200, 1463=>188, 1464=>188, 1465=>70, 1467=>329, 1468=>70, 1469=>70, 1470=>488, 1471=>200, 1472=>212, 1473=>0, 
+	1474=>0, 1475=>278, 1476=>70, 1488=>640, 1489=>591, 1490=>466, 1491=>598, 1492=>622, 1493=>212, 1494=>351, 1495=>623, 1496=>608, 1497=>200, 1498=>526, 1499=>550, 1500=>600, 
+	1501=>623, 1502=>621, 1503=>212, 1504=>378, 1505=>607, 1506=>587, 1507=>575, 1508=>568, 1509=>540, 1510=>590, 1511=>606, 1512=>547, 1513=>776, 1514=>687, 1520=>424, 1521=>412, 
+	1522=>400, 1523=>184, 1524=>344, 7936=>596, 7937=>596, 7938=>596, 7939=>596, 7940=>596, 7941=>596, 7942=>596, 7943=>596, 7944=>684, 7945=>684, 7946=>684, 7947=>684, 7948=>684, 
+	7949=>684, 7950=>684, 7951=>684, 7952=>510, 7953=>510, 7954=>510, 7955=>510, 7956=>510, 7957=>510, 7960=>650, 7961=>650, 7962=>650, 7963=>650, 7964=>650, 7965=>650, 7968=>526, 
+	7969=>526, 7970=>526, 7971=>526, 7972=>526, 7973=>526, 7974=>526, 7975=>526, 7976=>683, 7977=>683, 7978=>683, 7979=>683, 7980=>683, 7981=>683, 7982=>683, 7983=>683, 7984=>286, 
+	7985=>286, 7986=>286, 7987=>286, 7988=>286, 7989=>286, 7990=>286, 7991=>286, 7992=>236, 7993=>236, 7994=>236, 7995=>236, 7996=>236, 7997=>236, 7998=>236, 7999=>236, 8000=>550, 
+	8001=>550, 8002=>550, 8003=>550, 8004=>550, 8005=>550, 8008=>750, 8009=>750, 8010=>750, 8011=>750, 8012=>750, 8013=>750, 8016=>515, 8017=>515, 8018=>515, 8019=>515, 8020=>515, 
+	8021=>515, 8022=>515, 8023=>515, 8025=>684, 8027=>684, 8029=>684, 8031=>684, 8032=>740, 8033=>740, 8034=>740, 8035=>740, 8036=>740, 8037=>740, 8038=>740, 8039=>740, 8040=>720, 
+	8041=>720, 8042=>720, 8043=>720, 8044=>720, 8045=>720, 8046=>720, 8047=>720, 8048=>596, 8049=>596, 8050=>510, 8051=>510, 8052=>526, 8053=>526, 8054=>286, 8055=>286, 8056=>550, 
+	8057=>550, 8058=>515, 8059=>515, 8060=>740, 8061=>740, 8064=>596, 8065=>596, 8066=>596, 8067=>596, 8068=>596, 8069=>596, 8070=>596, 8071=>596, 8072=>900, 8073=>900, 8074=>900, 
+	8075=>900, 8076=>900, 8077=>900, 8078=>900, 8079=>900, 8080=>526, 8081=>526, 8082=>526, 8083=>526, 8084=>526, 8085=>526, 8086=>526, 8087=>526, 8088=>899, 8089=>899, 8090=>899, 
+	8091=>899, 8092=>899, 8093=>899, 8094=>899, 8095=>899, 8096=>740, 8097=>740, 8098=>740, 8099=>740, 8100=>740, 8101=>740, 8102=>740, 8103=>740, 8104=>936, 8105=>936, 8106=>936, 
+	8107=>936, 8108=>936, 8109=>936, 8110=>936, 8111=>936, 8112=>596, 8113=>596, 8114=>596, 8115=>596, 8116=>593, 8118=>596, 8119=>596, 8120=>684, 8121=>684, 8122=>684, 8123=>684, 
+	8124=>900, 8125=>278, 8126=>201, 8127=>147, 8128=>278, 8129=>333, 8130=>526, 8131=>526, 8132=>595, 8134=>526, 8135=>526, 8136=>650, 8137=>650, 8138=>683, 8139=>683, 8140=>899, 
+	8141=>602, 8142=>601, 8143=>333, 8144=>286, 8145=>286, 8146=>286, 8147=>286, 8150=>286, 8151=>286, 8152=>236, 8153=>236, 8154=>236, 8155=>236, 8157=>434, 8158=>433, 8159=>333, 
+	8160=>515, 8161=>515, 8162=>515, 8163=>515, 8164=>566, 8165=>566, 8166=>515, 8167=>515, 8168=>684, 8169=>684, 8170=>684, 8171=>684, 8172=>638, 8173=>333, 8174=>624, 8175=>303, 
+	8178=>740, 8179=>740, 8180=>725, 8182=>740, 8183=>740, 8184=>750, 8185=>750, 8186=>720, 8187=>720, 8188=>936, 8189=>333, 8190=>159, 8260=>167, 8362=>869, 8706=>490, 8710=>712, 
+	8721=>711, 8722=>584, 8730=>542, 8800=>584, 8804=>584, 8805=>584, 9674=>489, 63033=>556, 63034=>556, 63035=>556, 63036=>556, 63037=>556, 63038=>556, 63039=>556, 63040=>556, 63041=>556, 
+	63166=>222, 63171=>333, 63196=>556, 64256=>556, 64257=>500, 64258=>500, 64259=>778, 64260=>778, 64261=>556, 64262=>778, 64285=>200, 64286=>305, 64287=>400, 64288=>587, 64289=>890, 64290=>848, 
+	64291=>872, 64292=>800, 64293=>850, 64294=>873, 64295=>797, 64296=>937, 64297=>584, 64298=>776, 64299=>776, 64300=>776, 64301=>776, 64302=>640, 64303=>640, 64304=>640, 64305=>591, 64306=>466, 
+	64307=>598, 64308=>622, 64309=>262, 64310=>351, 64312=>608, 64313=>270, 64314=>526, 64315=>550, 64316=>600, 64318=>621, 64320=>378, 64321=>607, 64323=>575, 64324=>568, 64326=>590, 64327=>606, 
+	64328=>547, 64329=>776, 64330=>687, 64331=>212, 64332=>591, 64333=>550, 64334=>568, 64335=>640);
+$enc='';
+$diff='';
+$file='FreeSansOblique.z';
+$ctg='FreeSansOblique.ctg.z';
+$originalsize=110740;
+?>

Added: incphp/print/pdfprint.php
===================================================================
--- incphp/print/pdfprint.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/print/pdfprint.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,375 @@
+<?php
+/********************************************************************************
+ Copyright (c) 2002-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+
+require_once('tcpdf.php');
+require_once('print.php');
+
+
+class Pdf extends TCPDF
+{
+
+    function Pdf($map, $prScale, $orientation, $units, $format, $prefmap=true)
+    {
+        $this->TCPDF($orientation,$units,$format,true);
+        
+        $mapW = 700; 
+        $mapH = 530;
+        $this->prefmap = $prefmap;
+        
+        $printMap = new PRINTMAP($map, $mapW, $mapH, $prScale, "pdf", 144);
+        $printUrlList = $printMap->returnImgUrlList();
+        
+        $this->initPDF("Armin Burger", "p.mapper", "FreeSans", 9);
+        //$this->initPDF("Armin Burger", "p.mapper", "Helvetica", 9);
+        $this->setPrTitle($prTitle); 
+        $this->printPDF($map, $mapW, $mapH, $printUrlList, $prScale);
+        $this->printScale(_p("Scale"), $prScale);
+        $this->printLegendPDF($map, $prScale, 30, 500);
+    }
+    
+    
+    function initPDF($author, $title, $defFontType, $defFontSize)
+    {
+        $this->SetFont($defFontType, "B", $defFontSize);
+        $this->setAuthor($author);
+        $this->setTitle($title);
+        $this->Open();
+        $this->SetLineWidth(1.5);
+        $this->AddPage();
+        $this->defaultFontType = $defFontType;
+        $this->defaultFontSize = $defFontSize;
+    }
+    
+    
+    // TITLE
+    function setPrTitle($prTitle) 
+    {
+        $this->prTitle = $prTitle;
+    }
+    
+    function getPrTitle() 
+    {
+        $prTitle = $this->prTitle;
+        return $prTitle;
+    }
+    
+    
+    // FONTS 
+    function resetDefaultFont()
+    {
+        $this->SetFont($this->defaultFontType, "", $this->defaultFontSize); 
+        $this->SetTextColor(0, 0, 0);
+    }
+    
+    
+    
+    /*
+     * PRINT FUNCTIONS
+     ***********************/
+    
+    // MAIN PDF PAGE PTINTING
+    function printPDF($map, $pdfMapW, $pdfMapH, $printUrlList, $prScale)
+    {
+        $printmapUrl  = $printUrlList[0];
+        $printrefUrl  = $printUrlList[1];
+        $printsbarUrl = $printUrlList[2];
+    
+        // Dimensions: A4 Portrait
+        $pageWidth = 595;
+        $pageHeight = 842;
+    
+        // Reduction factor, calculated from PDF resolution (72 dpi)
+        // reolution from map file and factor for increased map size for PDF output
+        //$redFactor = 72/(($map->resolution) / $_SESSION["pdfres"]);
+        $redFactor = 72 / 96; 
+    
+        $imgWidth = $pdfMapW * $redFactor;
+        $imgHeight = $pdfMapH * $redFactor;
+    
+        // Margin lines around page
+        $this->margin = round(($pageWidth - ($pdfMapW * $redFactor)) / 2);
+        $this->xminM = $this->margin;                                     //   ____________
+        $this->yminM = $this->margin;                                     //  |             |topLineDelta
+        $this->xmaxM = $pageWidth - $this->margin;                        //  |------------  topLineY
+        $this->ymaxM = $pageHeight - $this->margin;                       //  |   IMG
+                                                                          //  |
+        $this->topLineDelta = 26;                                         //  |------------  botLineY
+        $this->topLineY = $this->yminM + $this->topLineDelta;             //  |   LEG
+        $this->botLineY = $this->topLineY + $imgHeight;                   //  |------------
+    
+    
+        // Draw Map Image
+        $web = $map->web;
+        $basePath = $web->imagepath;
+        $mapImgBaseName = basename($printmapUrl);
+        $mapImgFullName = $basePath . $mapImgBaseName;
+        $this->Image($mapImgFullName, $this->xminM, $this->topLineY , $imgWidth, $imgHeight);
+    
+        //Draw Reference Image
+        if ($this->prefmap) {
+            $refImgBaseName = basename($printrefUrl);
+            $refImgFullName = $basePath . $refImgBaseName;
+            $refmap = $map->reference;
+            $this->refmapwidth = ($refmap->width) * $redFactor ;
+            $this->refmapheight = ($refmap->height) * $redFactor ;
+            $this->Image($refImgFullName, $this->xminM, $this->topLineY, $this->refmapwidth, $this->refmapheight);
+        }
+        
+        //Draw Scalebar Image
+        $sbarImgBaseName = basename($printsbarUrl);
+        $sbarImgFullName = $basePath . $sbarImgBaseName;
+        $sbar = $map->scalebar;
+        $sbarwidth = ($sbar->width) * $redFactor ;
+        $sbarheight = ($sbar->height);
+        $this->Image($sbarImgFullName, $this->xminM, $this->botLineY - 20, $sbarwidth, $sbarheight + 15);
+        
+        // Print title bar with logo
+        $this->printTitle($this->getPrTitle());
+        
+        // Print frame lines (margins, inner frames)
+        $this->printFrameLines(1);
+        
+        $this->redFactor = $redFactor;
+    }
+    
+    
+    // PRINT OUTER AND INNER FRAME LINES AROUND IMAGE AND LEGEND
+    function printFrameLines($firstPage)
+    {
+        $this->printMargins();
+    
+        // Inner frame lines
+        $this->SetLineWidth(1);
+        $this->Line($this->xminM, $this->topLineY, $this->xmaxM, $this->topLineY);
+        
+        if ($firstPage) { 
+            // Bottom line for map image
+            $this->Line($this->xminM, $this->botLineY, $this->xmaxM, $this->botLineY);
+        
+            // Frame around ref map
+            if ($this->prefmap) {
+                $this->Line($this->xminM, $this->topLineY + $this->refmapheight, $this->xminM + $this->refmapwidth, $this->topLineY + $this->refmapheight);
+                $this->Line($this->xminM + $this->refmapwidth, $this->topLineY + $this->refmapheight, $this->xminM + $this->refmapwidth, $this->topLineY);
+            }
+        }
+    }
+    
+    // OUTER (MARGIN) LINES
+    function printMargins()
+    {
+        // Outer margin
+        $this->SetLineWidth(1.5);
+        $this->Line($this->xminM, $this->yminM, $this->xminM, $this->ymaxM);
+        $this->Line($this->xminM, $this->ymaxM, $this->xmaxM, $this->ymaxM);
+        $this->Line($this->xmaxM, $this->ymaxM, $this->xmaxM, $this->yminM);
+        $this->Line($this->xmaxM, $this->yminM, $this->xminM, $this->yminM);
+    }
+    
+    
+    // TITLE IN TITLE BAR
+    function printTitle($prTitle)
+    {
+        // Draw background in image color
+        $this->SetFillColor(51, 102, 153);
+        $this->Rect($this->xminM, $this->yminM, $this->xmaxM - $this->xminM, $this->topLineDelta , "F");
+        
+        // Print logo image
+        $this->Image('./images/logo.png', $this->xminM, $this->yminM, 124);
+        
+        if (strlen($prTitle) > 0) {
+            $prTitle = $prTitle;
+            // Print title
+            $this->SetTextColor(255, 255, 255);
+            $this->SetFont($this->defaultFontType, "B", $this->defaultFontSize + 5);
+            $this->SetXY($this->xminM + 120, $this->yminM + (0.5 * $this->topLineDelta));
+            $this->Cell(0, 0, $prTitle);
+        }    	
+    }
+    
+    // SCALE ABOVE SCALEBAR
+    function printScale($prString, $prScale)
+    {
+        $prString = $prString;    
+        
+        $this->SetTextColor(0, 0, 0);
+        //$this->SetFont($this->defaultFontType, "B", $this->defaultFontSize);
+        $scaleStr = $prString . " 1: $prScale";
+        $this->SetXY($this->xminM + 6, $this->botLineY - 25);
+        $this->Cell(50, 0, $scaleStr);
+    }
+    
+    
+    // 2-COLUMN LEGEND
+    function printLegendPDF($map, $scale)
+    {
+        $grouplist = $_SESSION["grouplist"];
+        $defGroups = $_SESSION["defGroups"];
+        $icoW      = $_SESSION["icoW"] * $this->redFactor;  // Width in pixels
+        $icoH      = $_SESSION["icoH"] * $this->redFactor;  // Height in pixels
+        $imgFormat = $_SESSION["imgFormat"];
+        
+        // Vertical differerence between lines (for new groups and classes)
+        /*$dy_grp = $icoH + 4;
+        $dy_cls = $icoH + 2; */
+    
+        // GET LAYERS FOR DRAWING AND IDENTIFY
+        if (isset ($_SESSION["groups"]) && count($_SESSION["groups"]) > 0){
+            $groups = $_SESSION["groups"];
+        }else{
+            $groups = $defGroups;
+        }
+    
+        $legPath = "images/legend/";
+    
+        $x0 = $this->xminM + 10;
+        $x = $x0;
+        $y = $this->botLineY + 10;
+    
+        $xr = (($this->xmaxM - $this->xminM) + (2 * $this->margin)) / 2 + 5;
+        $mcellW = (($this->xmaxM - $this->xminM) / 2) - $icoW - 28;
+    
+        // Text Color for legend annotations
+        $this->SetTextColor(0, 0, 0);
+    
+        foreach ($grouplist as $grp){
+            if (in_array($grp->getGroupName(), $groups, TRUE)) {
+                $glayerList = $grp->getLayers();
+                $grpClassList = array();
+                $grpcnt = -1;  // used to identify if layers are still in the same group
+    
+                // Get number of classes for each group
+                // write group classes to array
+                $numcls = 0;
+                foreach ($glayerList as $glayer) {
+                    $legendLayer = $map->getLayer($glayer->getLayerIdx());
+                    $numClasses = count($glayer->getClasses());
+                    $skipLegend = $glayer->getSkipLegend();
+                    
+                    //if ($legendLayer->type < 3 && checkScale($map, $legendLayer, $scale) == 1) {
+                    if (($legendLayer->type < 3 || $legIconPath || $numClasses > 1) && checkScale($map, $legendLayer, $scale) == 1 && $skipLegend < 2) {
+    
+                        $leglayers[] = $legendLayer;
+                        $numcls += $legendLayer->numclasses;
+                        
+                        $legLayerName = $glayer->getLayerName();
+                        $layClasses = $glayer->getClasses();
+                        $clsno = 0;
+                        foreach ($layClasses as $cl) {
+                            $icoUrl = $legPath.$legLayerName.'_i'.$clsno.'.'.$imgFormat;
+                            $grpClassList[] = array($cl, $icoUrl);
+                            $clsno++;
+                        }
+                    }
+                }
+    
+                //error_log("$numcls  \n");
+                // Only 1 class for all Layers -> 1 Symbol for Group
+                if ($numcls == 1) {
+                    $legLayer = $leglayers[0];
+                    $legLayerName = $legLayer->name;
+                    $icoUrl = $legPath.$legLayerName.'_i0.'.$imgFormat;
+    
+                    // Putput PDF
+                    $this->Image($icoUrl, $x, $y, $icoW, $icoH);
+                    $this->SetXY($x + $icoW + 5, $y + 6);
+                    $this->SetFont($this->defaultFontType, "B", $this->defaultFontSize);
+                    
+                    $grpDescription = $grp->getDescription();
+                    $this->Cell(0, 0, $grpDescription);
+    
+                    $y += 18;   // y-difference between GROUPS
+    
+                // More than 2 classes for Group  -> symbol for *every* class
+                } elseif ($numcls > 1) {
+                    $this->SetXY($x - 2, $y + 6);
+                    //$this->SetFont($this->defaultFontType, "B", $this->defaultFontSized);
+                    
+                    $grpDescription = $grp->getDescription();
+                    $this->Cell(0, 0, $grpDescription);
+                    $y += 14;  // y-difference between GROUP NAME and first class element
+    
+                    $allc = 0;
+                    $clscnt = 0;
+    
+                    #if ($clscnt < $numcls) {
+                    foreach ($grpClassList as $cls) {
+                        $clsStr = $cls[0];
+                        $icoUrl = $cls[1];
+                        $clno = 0;
+                        
+                        // Output PDF
+                        $this->Image($icoUrl, $x, $y, $icoW, $icoH);
+                        $this->SetFont($this->defaultFontType, "", $this->defaultFontSized);
+    
+                        // What to do if CLASS string is too large for cell box
+                        if ($this->GetStringWidth($clsStr) >= $mcellW) {   // test if string is wider than cell box
+                            $mcellH = 10;
+                            $ydiff = 0;
+                            $yadd = 1;
+                        } else {
+                            $mcellH = 0;
+                            $ydiff = 6;
+                        }
+                        $this->SetXY($x + $icoW + 5, $y + $ydiff);
+                        $this->MultiCell($mcellW, $mcellH, $clsStr, 0, "L", 0);
+    
+                        // change x and y coordinates for img and cell placement
+                        if ($clscnt % 2) {   // after printing RIGHT column
+                            $y += 16;
+                            $y += ($clscnt == ($numcls - 1) ? 2 : 0);  // Begin new group when number of printed classes equals total class number
+                            $x = $x0;
+                            if ($yadd) $y += 8;
+                            $yadd = 0;
+                        } else {           // after printing LEFT column
+                            if ($clscnt == ($numcls - 1)) {    // Begin new group when number of printed classes equals total class number
+                                $y += 18;
+                                $x = $x0;
+                            } else {
+                                $x = $xr;     // Continue in same group, add only new class item
+                            }
+                        }
+                        
+                        $allc++;
+                        $clscnt++;
+    
+                        // if Y too big add new PDF page and reset Y to beginning of document
+                        if ($y > (($this->ymaxM) - 30)) {
+                            $this->AddPage("P");
+                            $this->printTitle("");
+                            $this->printFrameLines(0);
+                            $this->resetDefaultFont();
+                            $y = $this->yminM + 35;
+                        }
+                    }
+                }
+            }
+            unset($leglayers);
+            unset($grpClassList);
+        }
+    }
+
+
+}  // END CLASS
+
+
+?>

Added: incphp/print/print.php
===================================================================
--- incphp/print/print.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/print/print.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,363 @@
+<?php
+/********************************************************************************
+ Copyright (c) 2002-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+
+//===============================================================//
+//                 FUNCTIONS FOR PRINTING                        //
+//===============================================================//
+
+
+class PrintMap extends PMap
+{
+    var $map;   
+    var $mapW;  
+    var $mapH;  
+    var $scale; 
+    var $groups;
+    var $imgUrlList;
+    var $rStr;
+    
+    
+    function PrintMap($map, $mapW, $mapH, $scale, $printType, $imgDPI, $imgFormat=false, $prefmap=true)
+    {
+        $this->map    = $map;
+        $this->mapW   = $mapW;
+        $this->mapH   = $mapH;
+        $this->scale  = $scale;
+        $this->groups = $_SESSION["groups"];
+        
+        // Check for custom layers
+        $this->pmap_addCustomLayers();
+        
+        // Set active groups/layers
+        setGroups($map, $this->groups, $scale, 1);
+        
+        // Check and if necessary add result layers to map
+        $this->pmap_checkResultLayers();
+        
+        // Check for XY Layers (event layers)
+        $existsXYLayer = ($_SESSION["existsXYLayer"] ? 1 : 0);
+        
+        // Set width and height
+        $this->map->set("width", $this->mapW);
+        $this->map->set("height", $this->mapH);
+    
+        // ZOOM TO PRE-DEFINED SCALE OR MAP EXTENT FROM SESSIONID
+        $this->zoom2scale();
+    
+        
+        // DEFINE SCALEBAR/REFERENCE-MAP IMG
+        $sbarImg = $this->createScaleBar($printType, $imgDPI);
+        $this->map->selectOutputFormat("jpeg");
+        $refImg = $this->map->drawReferenceMap();
+        
+        
+        // CREATE MAP IMAGE AND PASTE SCALEBAR AND REFERENCE MAP
+        switch ($printType) {
+            // HTML OUTPUT
+            case "html":
+                $this->pmap_setImgFormat();
+                $mapImg = $this->map->draw();
+                
+                // CHECK iF THERE'S AN XY-LAYER AND THEN DRAW IT
+                if ($existsXYLayer) {
+                    $this->pmap_drawXYLayer($mapImg); 
+                }
+                
+                $mapImg->pasteImage($sbarImg, 0, 3, $this->mapH-25);
+                if ($prefmap) $mapImg->pasteImage($refImg, -1);
+                //$this->imgUrlList[] = $mapImg->saveWebImage();
+                $this->imgUrlList[] = mapSaveWebImage($this->map, $mapImg);
+                $mapImg->free();
+                
+                $this->writePrintLegendHTML();
+                
+                break;
+        
+            // PDF OUTPUT
+            case "pdf":
+                // Increase size and resolution for better print quality (factor set in config.ini -> pdfres)
+                // Note: resolution has to be increased, too, to keep scale dependency of layers
+                $this->pmap_setImgFormat();
+                $pdfres = $_SESSION["pdfres"];
+                
+                // Increase Label size according to magnificion for PDF output
+                $this->increaseLabels($pdfres);
+                
+                $this->map->set("width", $this->mapW * $pdfres);
+                $this->map->set("height", $this->mapH * $pdfres);
+                $this->map->set("resolution", 96 * $pdfres);
+                $mapImgHR = $this->map->draw();
+                
+                // CHECK iF THERE'S AN XY-LAYER AND THEN DRAW IT
+                if ($existsXYLayer) {
+                    $this->pmap_drawXYLayer($mapImgHR); 
+                }
+                
+                /*$this->imgUrlList[] = $mapImgHR->saveWebImage();
+                $this->imgUrlList[] = $refImg->saveWebImage();
+                $this->imgUrlList[] = $sbarImg->saveWebImage();*/
+                
+                $this->imgUrlList[] = mapSaveWebImage($this->map, $mapImgHR);
+                $this->imgUrlList[] = mapSaveWebImage($this->map, $refImg, true);
+                //$this->imgUrlList[] = $refImg->saveWebImage();
+                $this->imgUrlList[] = mapSaveWebImage($this->map, $sbarImg);
+    
+                $mapImgHR->free();
+                break;
+        
+            // DOWNLOAD HIGH RESOLUTION IMAGE
+            case "dl":
+                //$this->map->selectOutputFormat("jpeg");
+                if ($imgFormat) {
+                    $this->map->selectOutputFormat($imgFormat);  
+                } else {
+                    $this->pmap_setImgFormat();
+                }
+                
+                // Increase Label size according to DPI
+                $factor = round($imgDPI / 96);
+                $this->increaseLabels($factor);
+                
+                $mapImgHR = $this->map->draw();
+                
+                // CHECK iF THERE'S AN XY-LAYER AND THEN DRAW IT
+                if ($existsXYLayer) {
+                    $this->drawXYLayer($mapImgHR); 
+                }
+                
+                // GeoTIFF output
+                if ($imgFormat) {
+                    $tmpFileName = str_replace('\\', '/', $this->map->web->imagepath) . substr(SID, 10) . ".tif";
+                    $mapImgHR->saveImage($tmpFileName, $this->map);
+                    $this->imgUrlList[] = $tmpFileName;
+                
+                // JPG or PNG output
+                } else {
+                    $this->imgUrlList[] = mapSaveWebImage($this->map, $mapImgHR);
+                    $legImg = $this->map->drawLegend();
+                    $this->imgUrlList[] = mapSaveWebImage($this->map, $legImg);
+                    $legImg->free();
+                }
+                
+                $mapImgHR->free();
+                break;
+        }
+    
+        $refImg->free();
+        $sbarImg->free();
+    
+    }
+    
+    function returnImgUrlList()
+    {
+        return $this->imgUrlList;
+    }
+    
+    
+    
+    function returnLegStr()
+    {
+        return $this->rStr;
+    }
+    
+    
+    
+    /**
+     * Increase label size for PDF print and download
+     */
+    function increaseLabels($factor)
+    {
+        $layers = $this->map->getAllLayerNames();
+        
+        foreach ($layers as $ln) {
+            $layer = $this->map->getLayerByName($ln);
+            if ($layer->labelitem) {
+                $numclasses = $layer->numclasses;
+                $classes = array();
+                for ($cl=0; $cl < $numclasses; $cl++) {
+                    $class = $layer->getClass($cl);
+                    if ($label = $class->label) {
+                        if ($label->type == 0) {
+                            $labelSize0 = $label->size;
+                            $label->set("size", $labelSize0 * $factor);
+                        }
+                    }
+                }
+            }
+        }
+    }
+    
+    
+    /**
+     * ZOOM MAP TO SPECIFIED SCALE
+     */
+    function zoom2scale()
+    {
+        $GEOEXT = $_SESSION["GEOEXT"];
+        $geoext0 = ms_newrectObj();
+        $geoext0->setextent($GEOEXT["minx"],$GEOEXT["miny"],$GEOEXT["maxx"],$GEOEXT["maxy"]);
+    
+        // PREPARE MAP IMG 
+        $x_pix = $this->mapW/2;
+        $y_pix = $this->mapH/2;
+    
+        $xy_pix = ms_newPointObj();
+        $xy_pix->setXY($x_pix, $y_pix);
+    
+        $this->map->zoomscale($this->scale, $xy_pix, $this->mapW, $this->mapH, $geoext0);
+        $xy_pix->free();
+    }
+
+
+
+    /*
+     * Draw Scale Bar
+     ***************************************/
+    function createScaleBar($printType, $imgDPI)
+    {
+        $this->pmap_setImgFormat(); 
+        $scalebar = $this->map->scalebar;
+        $sbarlabel = $scalebar->label;
+        $scalebar->set("transparent", MS_OFF);
+    
+        if ($printType == "dl" && $imgDPI >= 200) {
+            $sbarlabel->set("size", MS_GIANT);
+            $scalebar->set("width", $this->map->width * 0.3);
+            $scalebar->set("height", $this->map->height * 0.011);
+        }
+        
+        $sbarlabel->color->setRGB(0, 0, 0);
+        $sbarlabel->outlinecolor->setRGB(255, 255, 255);
+    
+        $sbarImg = $this->map->drawScaleBar();
+    
+        return $sbarImg;
+    }
+    
+    
+    
+    
+    
+    //===================================================================================//
+    //                            LEGEND                                                 //
+    //===================================================================================//
+    
+    /*
+     * CREATES HTML LEGEND FOR PRINT OUTPUT
+     *********************************************************************************/
+    function writePrintLegendHTML()
+    {
+        $grouplist = $_SESSION["grouplist"];
+        $defGroups = $_SESSION["defGroups"];
+        $icoW      = $_SESSION["icoW"];  // Width in pixels
+        $icoH      = $_SESSION["icoH"];  // Height in pixels
+        $imgFormat = $_SESSION["imgFormat"];
+    
+        // GET LAYERS FOR DRAWING AND IDENTIFY
+        if (isset ($_SESSION["groups"]) && count($_SESSION["groups"]) > 0){
+            $groups = $_SESSION["groups"];
+        }else{
+            $groups = $defGroups;
+        }
+    
+    
+        $legPath = "images/legend/";
+    
+        foreach ($grouplist as $grp){
+            if (in_array($grp->getGroupName(), $groups, TRUE)) {
+                $glayerList = $grp->getLayers();
+    
+                $numcls = 0;
+                            
+                foreach ($glayerList as $glayer) {
+                    $legendLayer = $this->map->getLayer($glayer->getLayerIdx());
+                    $numClasses = count($glayer->getClasses());
+                    $skipLegend = $glayer->getSkipLegend();
+                    
+                    if (($legendLayer->type < 3 || $legIconPath || $numClasses > 1) && checkScale($this->map, $legendLayer, $this->scale) == 1 && $skipLegend < 2) {
+                    //if ($legendLayer->type < 3 && checkScale($map, $legendLayer, $scale) == 1) {
+                        $numcls += $legendLayer->numclasses;
+                        
+                        $legLayerName = $glayer->getLayerName();
+                        $layClasses = $glayer->getClasses();
+                        $clsno = 0;
+                        foreach ($layClasses as $cl) {
+                            $icoUrl = $legPath.$legLayerName.'_i'.$clsno.'.'.$imgFormat;
+                            $grpClassList[] = array($cl, $icoUrl);
+                            $clsno++;
+                        }
+                    }
+                }
+                
+    
+                // Only 1 class for Layer -> 1 Symbol for Group
+                if ($numcls == 1) {
+                    $legLayer = $leglayers[0];
+                    $icoUrl = $grpClassList[0][1];
+    
+                    $this->rStr  .=  "  <tr>";
+                    $this->rStr  .=  "<th><img src=\"$icoUrl\" width=\"$icoW\" height=\"$icoH\" alt=\"ico\" /></th>";
+                    $this->rStr  .=  "<th style=\"width:100%\" colspan=\"3\">" . $grp->getDescription() . "</th>";
+                    $this->rStr  .=  "</tr> \n";
+    
+                // More than 2 classes for Group  -> symbol for *every* class
+                } elseif ($numcls > 1) {
+                    $this->rStr  .=  ("\n  <tr><th colspan=\"4\">" . $grp->getDescription() . "</th></tr> \n");
+    
+                    $clscnt = 0;
+                    foreach ($grpClassList as $cls) {
+                        $clsStr = $cls[0];
+                        $icoUrl = $cls[1];
+    
+                        $legLayerName = $legLayer->name;
+                        $classes = $glayer->getClasses();                   
+                        
+                        $this->rStr .= (($clscnt % 2) ? "" : "  <tr>" ); 
+    
+                        $this->rStr .= ("<td style=\"width:$icoW\"><img src=\"$icoUrl\" width=\"$icoW\" height=\"$icoH\" alt=\"ico\" /> </td>");  
+                        $this->rStr .= ("<td>$clsStr</td> ");
+    
+                        if ($clscnt % 2) {   // after printing RIGHT column
+                            $this->rStr .= ("</tr> \n");
+                        } else {           // after printing LEFT column
+                            if ($clscnt == ($numcls - 1)) {    // Begin new group when number of printed classes equals total class number
+                                $this->rStr .= ("<td></td></tr> \n");
+                            } else {
+                                     // Continue in same group, add only new class item
+                            }
+                        }
+                        $clscnt++;
+                    }
+                }
+                unset($grpClassList);
+            }
+        }
+    }
+
+
+} // END CLASS PRINTMAP
+
+
+
+
+?>

Added: incphp/print/tcpdf.php
===================================================================
--- incphp/print/tcpdf.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/print/tcpdf.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,4157 @@
+<?php
+//============================================================+
+// File name   : tcpdf.php
+// Begin       : 2002-08-03
+// Last Update : 2006-07-16
+// Author      : Nicola Asuni
+// Version     : 1.53.0.TC022_PHP4
+// License     : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
+//
+// Description : This is a PHP4 class for generating PDF files 
+//               on-the-fly without requiring external 
+//               extensions.
+//
+// IMPORTANT:
+// This class is an extension and improvement of the public Domain 
+// FPDF class by Olivier Plathey (http://www.fpdf.org).
+//
+// Main changes by Nicola Asuni:
+//    PHP4 porting;
+//    UTF-8 Unicode support;
+//    code refactoring;
+//    source code clean up;
+//    code style and formatting;
+//    source code documentation using phpDocumentor (www.phpdoc.org);
+//    All ISO page formats were included;
+//    image scale factor;
+//    includes methods to parse and printsome XHTML code, supporting the following elements: h1, h2, h3, h4, h5, h6, b, u, i, a, img, p, br, strong, em, font, blockquote, li, ul, ol, hr, td, th, tr, table, sup, sub, small;
+//    includes a method to print various barcode formats using an improved version of "Generic Barcode Render Class" by Karim Mribti (http://www.mribti.com/barcode/) (require GD library: http://www.boutell.com/gd/);
+//    defines standard Header() and Footer() methods.
+//============================================================+
+
+
+
+//=============================================================================================
+
+/**
+ * Added by Armin Burger for use with p.mapper: dir where to find fonts
+ */
+define ("FPDF_FONTPATH", str_replace('\\', '/', realpath( dirname(__FILE__))) . "/fonts/");
+
+//=============================================================================================
+
+
+
+
+/**
+ * include configuration file
+ */
+//require_once(dirname(__FILE__).'/config/tcpdf_config.php');
+
+
+/**
+ * TCPDF Class.
+ * @package com.tecnick.tcpdf
+ */
+ 
+/**
+ * This is a PHP4 class for generating PDF files on-the-fly without requiring external extensions.<br>
+ * TCPDF project (http://tcpdf.sourceforge.net) is based on the public Domain FPDF class by Olivier Plathey (http://www.fpdf.org).<br>
+ * <h3>TCPDF main changes from FPDF are:</h3><ul>
+ * <li>PHP4 porting</li>
+ * <li>UTF-8 Unicode support</li>
+ * <li>source code clean up</li>
+ * <li>code style and formatting</li>
+ * <li>source code documentation using phpDocumentor (www.phpdoc.org)</li>
+ * <li>All ISO page formats were included</li>
+ * <li>image scale factor</li>
+ * <li>includes methods to parse and printsome XHTML code, supporting the following elements: h1, h2, h3, h4, h5, h6, b, u, i, a, img, p, br, strong, em, font, blockquote, li, ul, ol, hr, td, th, tr, table, sup, sub, small;</li>
+ * <li>includes a method to print various barcode formats using an improved version of "Generic Barcode Render Class" by Karim Mribti (http://www.mribti.com/barcode/) (require GD library: http://www.boutell.com/gd/)</li>
+ * <li>defines standard Header() and Footer() methods.</li>
+ * </ul>
+ * Tools to encode your unicode fonts can be found at: http://www.acko.net/blog/ufpdf</p>
+ * @name TCPDF
+ * @package com.tecnick.tcpdf
+ * @abstract Class for generating PDF files on-the-fly without requiring external extensions.
+ * @author Nicola Asuni
+ * @copyright 2004-2006 Tecnick.com S.r.l (www.tecnick.com) Via Ugo Foscolo n.19 - 09045 Quartu Sant'Elena (CA) - ITALY - www.tecnick.com - info at tecnick.com
+ * @link http://tcpdf.sourceforge.net
+ * @license http://www.gnu.org/copyleft/lesser.html LGPL
+ @version 1.53.0.TC022_PHP4
+ */
+
+//if(!class_exists('TCPDF', false)) {
+	/**
+	 * define default PDF document producer
+	 */ 
+	define('PDF_PRODUCER','TCPDF 1.53.0.TC022_PHP4 (http://tcpdf.sourceforge.net)');
+	
+	/**
+	* This is a PHP4 class for generating PDF files on-the-fly without requiring external extensions.<br>
+	* This class is an extension and improvement of the FPDF class by Olivier Plathey (http://www.fpdf.org).<br>
+	* This version contains some changes: [porting to PHP4, support for UTF-8 Unicode, code style and formatting, php documentation (www.phpdoc.org), ISO page formats, minor improvements, image scale factor]<br>
+	* TCPDF project (http://tcpdf.sourceforge.net) is based on the public Domain FPDF class by Olivier Plathey (http://www.fpdf.org).<br>
+	* To add your own TTF fonts please read /fonts/README.TXT
+	* @name TCPDF
+	* @package com.tecnick.tcpdf
+	* @version 1.53.0.TC022
+	* @author Nicola Asuni
+	* @link http://tcpdf.sourceforge.net
+	* @license http://www.gnu.org/copyleft/lesser.html LGPL
+	*/
+	class TCPDF {
+		//var properties
+
+		/**
+		* @var current page number
+		* @access protected
+		*/
+		var $page;
+
+		/**
+		* @var current object number
+		* @access protected
+		*/
+		var $n;
+
+		/**
+		* @var array of object offsets
+		* @access protected
+		*/
+		var $offsets;
+
+		/**
+		* @var buffer holding in-memory PDF
+		* @access protected
+		*/
+		var $buffer;
+
+		/**
+		* @var array containing pages
+		* @access protected
+		*/
+		var $pages;
+
+		/**
+		* @var current document state
+		* @access protected
+		*/
+		var $state;
+
+		/**
+		* @var compression flag
+		* @access protected
+		*/
+		var $compress;
+
+		/**
+		* @var default orientation
+		* @access protected
+		*/
+		var $DefOrientation;
+
+		/**
+		* @var current orientation
+		* @access protected
+		*/
+		var $CurOrientation;
+
+		/**
+		* @var array indicating orientation changes
+		* @access protected
+		*/
+		var $OrientationChanges;
+
+		/**
+		* @var scale factor (number of points in user unit)
+		* @access protected
+		*/
+		var $k;
+
+		/**
+		* @var width of page format in points
+		* @access protected
+		*/
+		var $fwPt;
+
+		/**
+		* @var height of page format in points
+		* @access protected
+		*/
+		var $fhPt;
+
+		/**
+		* @var width of page format in user unit
+		* @access protected
+		*/
+		var $fw;
+
+		/**
+		* @var height of page format in user unit
+		* @access protected
+		*/
+		var $fh;
+
+		/**
+		* @var current width of page in points
+		* @access protected
+		*/
+		var $wPt;
+
+		/**
+		* @var current height of page in points
+		* @access protected
+		*/
+		var $hPt;
+
+		/**
+		* @var current width of page in user unit
+		* @access protected
+		*/
+		var $w;
+
+		/**
+		* @var current height of page in user unit
+		* @access protected
+		*/
+		var $h;
+
+		/**
+		* @var left margin
+		* @access protected
+		*/
+		var $lMargin;
+
+		/**
+		* @var top margin
+		* @access protected
+		*/
+		var $tMargin;
+
+		/**
+		* @var right margin
+		* @access protected
+		*/
+		var $rMargin;
+
+		/**
+		* @var page break margin
+		* @access protected
+		*/
+		var $bMargin;
+
+		/**
+		* @var cell margin
+		* @access protected
+		*/
+		var $cMargin;
+
+		/**
+		* @var current horizontal position in user unit for cell positioning
+		* @access protected
+		*/
+		var $x;
+
+		/**
+		* @var current vertical position in user unit for cell positioning
+		* @access protected
+		*/
+		var $y;
+
+		/**
+		* @var height of last cell printed
+		* @access protected
+		*/
+		var $lasth;
+
+		/**
+		* @var line width in user unit
+		* @access protected
+		*/
+		var $LineWidth;
+
+		/**
+		* @var array of standard font names
+		* @access protected
+		*/
+		var $CoreFonts;
+
+		/**
+		* @var array of used fonts
+		* @access protected
+		*/
+		var $fonts;
+
+		/**
+		* @var array of font files
+		* @access protected
+		*/
+		var $FontFiles;
+
+		/**
+		* @var array of encoding differences
+		* @access protected
+		*/
+		var $diffs;
+
+		/**
+		* @var array of used images
+		* @access protected
+		*/
+		var $images;
+
+		/**
+		* @var array of links in pages
+		* @access protected
+		*/
+		var $PageLinks;
+
+		/**
+		* @var array of internal links
+		* @access protected
+		*/
+		var $links;
+
+		/**
+		* @var current font family
+		* @access protected
+		*/
+		var $FontFamily;
+
+		/**
+		* @var current font style
+		* @access protected
+		*/
+		var $FontStyle;
+
+		/**
+		* @var underlining flag
+		* @access protected
+		*/
+		var $underline;
+
+		/**
+		* @var current font info
+		* @access protected
+		*/
+		var $CurrentFont;
+
+		/**
+		* @var current font size in points
+		* @access protected
+		*/
+		var $FontSizePt;
+
+		/**
+		* @var current font size in user unit
+		* @access protected
+		*/
+		var $FontSize;
+
+		/**
+		* @var commands for drawing color
+		* @access protected
+		*/
+		var $DrawColor;
+
+		/**
+		* @var commands for filling color
+		* @access protected
+		*/
+		var $FillColor;
+
+		/**
+		* @var commands for text color
+		* @access protected
+		*/
+		var $TextColor;
+
+		/**
+		* @var indicates whether fill and text colors are different
+		* @access protected
+		*/
+		var $ColorFlag;
+
+		/**
+		* @var word spacing
+		* @access protected
+		*/
+		var $ws;
+
+		/**
+		* @var automatic page breaking
+		* @access protected
+		*/
+		var $AutoPageBreak;
+
+		/**
+		* @var threshold used to trigger page breaks
+		* @access protected
+		*/
+		var $PageBreakTrigger;
+
+		/**
+		* @var flag set when processing footer
+		* @access protected
+		*/
+		var $InFooter;
+
+		/**
+		* @var zoom display mode
+		* @access protected
+		*/
+		var $ZoomMode;
+
+		/**
+		* @var layout display mode
+		* @access protected
+		*/
+		var $LayoutMode;
+
+		/**
+		* @var title
+		* @access protected
+		*/
+		var $title;
+
+		/**
+		* @var subject
+		* @access protected
+		*/
+		var $subject;
+
+		/**
+		* @var author
+		* @access protected
+		*/
+		var $author;
+
+		/**
+		* @var keywords
+		* @access protected
+		*/
+		var $keywords;
+
+		/**
+		* @var creator
+		* @access protected
+		*/
+		var $creator;
+
+		/**
+		* @var alias for total number of pages
+		* @access protected
+		*/
+		var $AliasNbPages;
+
+		/**
+		* @var right-bottom corner X coordinate of inserted image
+		* @since 2002-07-31
+		* @author Nicola Asuni
+		* @access protected
+		*/
+		var $img_rb_x;
+
+		/**
+		* @var right-bottom corner Y coordinate of inserted image
+		* @since 2002-07-31
+		* @author Nicola Asuni
+		* @access protected
+		*/
+		var $img_rb_y;
+
+		/**
+		* @var image scale factor
+		* @since 2004-06-14
+		* @author Nicola Asuni
+		* @access protected
+		*/
+		var $imgscale = 1;
+
+		/**
+		* @var boolean set to true when the input text is unicode (require unicode fonts)
+		* @since 2005-01-02
+		* @author Nicola Asuni
+		* @access protected
+		*/
+		var $isunicode = false;
+
+		/**
+		* @var PDF version
+		* @since 1.5.3
+		* @access protected
+		*/
+		var $PDFVersion = "1.3";
+		
+		
+		// ----------------------
+		
+		/**
+		 * @var Minimum distance between header and top page margin.
+		 * @access private
+		 */
+		var $header_margin;
+		
+		/**
+		 * @var Minimum distance between footer and bottom page margin.
+		 * @access private
+		 */
+		var $footer_margin;
+		
+		/**
+		 * @var original left margin value
+		 * @access private
+		 * @since 1.53.0.TC013
+		 */
+		var $original_lMargin;
+		
+		/**
+		 * @var original right margin value
+		 * @access private
+		 * @since 1.53.0.TC013
+		 */
+		var $original_rMargin;
+			
+		/**
+		 * @var Header font.
+		 * @access private
+		 */
+		var $header_font;
+		
+		/**
+		 * @var Footer font.
+		 * @access private
+		 */
+		var $footer_font;
+		
+		/**
+		 * @var Language templates.
+		 * @access private
+		 */
+		var $l;
+		
+		/**
+		 * @var Barcode to print on page footer (only if set).
+		 * @access private
+		 */
+		var $barcode = false;
+		
+		/**
+		 * @var If true prints header
+		 * @access private
+		 */
+		var $print_header = true;
+		
+		/**
+		 * @var If true prints footer.
+		 * @access private
+		 */
+		var $print_footer = true;
+		
+		/**
+		 * @var Header width (0 = full page width).
+		 * @access private
+		 */
+		var $header_width = 0;
+		
+		/**
+		 * @var Header image logo.
+		 * @access private
+		 */
+		var $header_logo = "";
+		
+		/**
+		 * @var Header image logo width in mm.
+		 * @access private
+		 */
+		var $header_logo_width = 30;
+		
+		/**
+		 * @var String to print as title on document header.
+		 * @access private
+		 */
+		var $header_title = "";
+		
+		/**
+		 * @var String to print on document header.
+		 * @access private
+		 */
+		var $header_string = "";
+		
+		/**
+		 * @var Default number of columns for html table.
+		 * @access private
+		 */
+		var $default_table_columns = 4;
+		
+		
+		// variables for html parser
+		
+		/**
+		 * @var HTML PARSER: store current link.
+		 * @access private
+		 */
+		var $HREF;
+		
+		/**
+		 * @var HTML PARSER: store font list.
+		 * @access private
+		 */
+		var $fontList;
+		
+		/**
+		 * @var HTML PARSER: true when font attribute is set.
+		 * @access private
+		 */
+		var $issetfont;
+		
+		/**
+		 * @var HTML PARSER: true when color attribute is set.
+		 * @access private
+		 */
+		var $issetcolor;
+		
+		/**
+		 * @var HTML PARSER: true in case of ordered list (OL), false otherwise.
+		 * @access private
+		 */
+		var $listordered = false;
+		
+		/**
+		 * @var HTML PARSER: count list items.
+		 * @access private
+		 */
+		var $listcount = 0;
+		
+		/**
+		 * @var HTML PARSER: size of table border.
+		 * @access private
+		 */
+		var $tableborder = 0;
+		
+		/**
+		 * @var HTML PARSER: true at the beginning of table.
+		 * @access private
+		 */
+		var $tdbegin = false;
+		
+		/**
+		 * @var HTML PARSER: table width.
+		 * @access private
+		 */
+		var $tdwidth = 0;
+		
+		/**
+		 * @var HTML PARSER: table height.
+		 * @access private
+		 */
+		var $tdheight = 0;
+		
+		/**
+		 * @var HTML PARSER: table align.
+		 * @access private
+		 */
+		var $tdalign = "L";
+		
+		/**
+		 * @var HTML PARSER: table background color.
+		 * @access private
+		 */
+		var $tdbgcolor = false;
+		
+		/**
+		 * @var Store temporary font size in points.
+		 * @access private
+		 */
+		var $tempfontsize = 10;
+		
+		/**
+		 * @var Bold font style status.
+		 * @access private
+		 */
+		var $b;
+		
+		/**
+		 * @var Underlined font style status.
+		 * @access private
+		 */
+		var $u;
+		
+		/**
+		 * @var Italic font style status.
+		 * @access private
+		 */
+		var $i;
+		
+		/**
+		 * @var spacer for LI tags.
+		 * @access private
+		 */
+		var $lispacer = "";
+		
+		/**
+		 * @var default encoding
+		 * @access private
+		 * @since 1.53.0.TC010
+		 */
+		var $encoding = "UTF-8";
+		
+		/**
+		 * @var PHP internal encoding
+		 * @access private
+		 * @since 1.53.0.TC016
+		 */
+		var $internal_encoding;
+		
+		/**
+		 * @var store previous fill color as RGB array
+		 * @access private
+		 * @since 1.53.0.TC017
+		 */
+		var $prevFillColor = array(255,255,255);
+		
+		/**
+		 * @var store previous text color as RGB array
+		 * @access private
+		 * @since 1.53.0.TC017
+		 */
+		var $prevTextColor = array(0,0,0);
+		
+		/**
+		 * @var store previous font family
+		 * @access private
+		 * @since 1.53.0.TC017
+		 */
+		var $prevFontFamily;
+		
+		/**
+		 * @var store previous font style
+		 * @access private
+		 * @since 1.53.0.TC017
+		 */
+		var $prevFontStyle;
+
+		//------------------------------------------------------------
+		// var methods
+		//------------------------------------------------------------
+
+		/**
+		 * This is the class constructor. 
+		 * It allows to set up the page format, the orientation and 
+		 * the measure unit used in all the methods (except for the font sizes).
+		 * @since 1.0
+		 * @param string $orientation page orientation. Possible values are (case insensitive):<ul><li>P or Portrait (default)</li><li>L or Landscape</li></ul>
+		 * @param string $unit User measure unit. Possible values are:<ul><li>pt: point</li><li>mm: millimeter (default)</li><li>cm: centimeter</li><li>in: inch</li></ul><br />A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit.
+		 * @param mixed $format The format used for pages. It can be either one of the following values (case insensitive) or a custom format in the form of a two-element array containing the width and the height (expressed in the unit given by unit).<ul><li>4A0</li><li>2A0</li><li>A0</li><li>A1</li><li>A2</li><li>A3</li><li>A4 (default)</li><li>A5</li><li>A6</li><li>A7</li><li>A8</li><li>A9</li><li>A10</li><li>B0</li><li>B1</li><li>B2</li><li>B3</li><li>B4</li><li>B5</li><li>B6</li><li>B7</li><li>B8</li><li>B9</li><li>B10</li><li>C0</li><li>C1</li><li>C2</li><li>C3</li><li>C4</li><li>C5</li><li>C6</li><li>C7</li><li>C8</li><li>C9</li><li>C10</li><li>RA0</li><li>RA1</li><li>RA2</li><li>RA3</li><li>RA4</li><li>SRA0</li><li>SRA1</li><li>SRA2</li><li>SRA3</li><li>SRA4</li><li>LETTER</li><li>LEGAL</li><li>EXECUTIVE</li><li>FOLIO</li></ul>
+		 * @param boolean $unicode TRUE means that the input text is unicode (default = true)
+		 * @param String $encoding charset encoding; default is UTF-8
+		 */
+		function TCPDF($orientation='P', $unit='mm', $format='A4', $unicode=true, $encoding="UTF-8") {
+			
+			/* Set internal character encoding to ASCII */
+			if (function_exists("mb_internal_encoding") AND mb_internal_encoding()) {
+				$this->internal_encoding = mb_internal_encoding();
+				mb_internal_encoding("ASCII");
+			}
+				
+			//Some checks
+			$this->_dochecks();
+			//Initialization of properties
+			$this->isunicode=$unicode;
+			$this->page=0;
+			$this->n=2;
+			$this->buffer='';
+			$this->pages=array();
+			$this->OrientationChanges=array();
+			$this->state=0;
+			$this->fonts=array();
+			$this->FontFiles=array();
+			$this->diffs=array();
+			$this->images=array();
+			$this->links=array();
+			$this->InFooter=false;
+			$this->lasth=0;
+			$this->FontFamily='';
+			$this->FontStyle='';
+			$this->FontSizePt=12;
+			$this->underline=false;
+			$this->DrawColor='0 G';
+			$this->FillColor='0 g';
+			$this->TextColor='0 g';
+			$this->ColorFlag=false;
+			$this->ws=0;
+            
+            $this->print_footer = false;
+            $this->print_header = false;
+            
+			//Standard Unicode fonts
+			$this->CoreFonts=array(
+			'courier'=>'Courier',
+			'courierB'=>'Courier-Bold',
+			'courierI'=>'Courier-Oblique',
+			'courierBI'=>'Courier-BoldOblique',
+			'helvetica'=>'Helvetica',
+			'helveticaB'=>'Helvetica-Bold',
+			'helveticaI'=>'Helvetica-Oblique',
+			'helveticaBI'=>'Helvetica-BoldOblique',
+			'times'=>'Times-Roman',
+			'timesB'=>'Times-Bold',
+			'timesI'=>'Times-Italic',
+			'timesBI'=>'Times-BoldItalic',
+			'symbol'=>'Symbol',
+			'zapfdingbats'=>'ZapfDingbats'
+			);
+
+			//Scale factor
+			// 2003-06-11 - Nicola Asuni : changed if/else with switch statement
+			switch (strtolower($unit)){
+				case 'pt': {$this->k=1; break;}
+				case 'mm': {$this->k=72/25.4; break;}
+				case 'cm': {$this->k=72/2.54; break;}
+				case 'in': {$this->k=72; break;}
+				default : {$this->Error('Incorrect unit: '.$unit); break;}
+			}
+
+			//Page format
+			if(is_string($format)) {
+				// 2002-07-24 - Nicola Asuni (info at tecnick.com)
+				// Added new page formats (45 standard ISO paper formats and 4 american common formats).
+				// Paper cordinates are calculated in this way: (inches * 72) where (1 inch = 2.54 cm)
+				switch (strtoupper($format)){
+					case '4A0': {$format = array(4767.87,6740.79); break;}
+					case '2A0': {$format = array(3370.39,4767.87); break;}
+					case 'A0': {$format = array(2383.94,3370.39); break;}
+					case 'A1': {$format = array(1683.78,2383.94); break;}
+					case 'A2': {$format = array(1190.55,1683.78); break;}
+					case 'A3': {$format = array(841.89,1190.55); break;}
+					case 'A4': default: {$format = array(595.28,841.89); break;}
+					case 'A5': {$format = array(419.53,595.28); break;}
+					case 'A6': {$format = array(297.64,419.53); break;}
+					case 'A7': {$format = array(209.76,297.64); break;}
+					case 'A8': {$format = array(147.40,209.76); break;}
+					case 'A9': {$format = array(104.88,147.40); break;}
+					case 'A10': {$format = array(73.70,104.88); break;}
+					case 'B0': {$format = array(2834.65,4008.19); break;}
+					case 'B1': {$format = array(2004.09,2834.65); break;}
+					case 'B2': {$format = array(1417.32,2004.09); break;}
+					case 'B3': {$format = array(1000.63,1417.32); break;}
+					case 'B4': {$format = array(708.66,1000.63); break;}
+					case 'B5': {$format = array(498.90,708.66); break;}
+					case 'B6': {$format = array(354.33,498.90); break;}
+					case 'B7': {$format = array(249.45,354.33); break;}
+					case 'B8': {$format = array(175.75,249.45); break;}
+					case 'B9': {$format = array(124.72,175.75); break;}
+					case 'B10': {$format = array(87.87,124.72); break;}
+					case 'C0': {$format = array(2599.37,3676.54); break;}
+					case 'C1': {$format = array(1836.85,2599.37); break;}
+					case 'C2': {$format = array(1298.27,1836.85); break;}
+					case 'C3': {$format = array(918.43,1298.27); break;}
+					case 'C4': {$format = array(649.13,918.43); break;}
+					case 'C5': {$format = array(459.21,649.13); break;}
+					case 'C6': {$format = array(323.15,459.21); break;}
+					case 'C7': {$format = array(229.61,323.15); break;}
+					case 'C8': {$format = array(161.57,229.61); break;}
+					case 'C9': {$format = array(113.39,161.57); break;}
+					case 'C10': {$format = array(79.37,113.39); break;}
+					case 'RA0': {$format = array(2437.80,3458.27); break;}
+					case 'RA1': {$format = array(1729.13,2437.80); break;}
+					case 'RA2': {$format = array(1218.90,1729.13); break;}
+					case 'RA3': {$format = array(864.57,1218.90); break;}
+					case 'RA4': {$format = array(609.45,864.57); break;}
+					case 'SRA0': {$format = array(2551.18,3628.35); break;}
+					case 'SRA1': {$format = array(1814.17,2551.18); break;}
+					case 'SRA2': {$format = array(1275.59,1814.17); break;}
+					case 'SRA3': {$format = array(907.09,1275.59); break;}
+					case 'SRA4': {$format = array(637.80,907.09); break;}
+					case 'LETTER': {$format = array(612.00,792.00); break;}
+					case 'LEGAL': {$format = array(612.00,1008.00); break;}
+					case 'EXECUTIVE': {$format = array(521.86,756.00); break;}
+					case 'FOLIO': {$format = array(612.00,936.00); break;}
+					// default: {$this->Error('Unknown page format: '.$format); break;}
+					// END CHANGES Nicola Asuni
+				}
+				$this->fwPt=$format[0];
+				$this->fhPt=$format[1];
+			}
+			else {
+				$this->fwPt=$format[0]*$this->k;
+				$this->fhPt=$format[1]*$this->k;
+			}
+
+			$this->fw=$this->fwPt/$this->k;
+			$this->fh=$this->fhPt/$this->k;
+
+			//Page orientation
+			$orientation=strtolower($orientation);
+			if($orientation=='p' or $orientation=='portrait') {
+				$this->DefOrientation='P';
+				$this->wPt=$this->fwPt;
+				$this->hPt=$this->fhPt;
+			}
+			elseif($orientation=='l' or $orientation=='landscape') {
+				$this->DefOrientation='L';
+				$this->wPt=$this->fhPt;
+				$this->hPt=$this->fwPt;
+			}
+			else {
+				$this->Error('Incorrect orientation: '.$orientation);
+			}
+
+			$this->CurOrientation=$this->DefOrientation;
+			$this->w=$this->wPt/$this->k;
+			$this->h=$this->hPt/$this->k;
+			//Page margins (1 cm)
+			$margin=28.35/$this->k;
+			$this->SetMargins($margin,$margin);
+			//Interior cell margin (1 mm)
+			$this->cMargin=$margin/10;
+			//Line width (0.2 mm)
+			$this->LineWidth=.567/$this->k;
+			//Automatic page break
+			$this->SetAutoPageBreak(true,2*$margin);
+			//Full width display mode
+			$this->SetDisplayMode('fullwidth');
+			//Compression
+			$this->SetCompression(true);
+			//Set default PDF version number
+			$this->PDFVersion = "1.3";
+			
+			$this->encoding = $encoding;
+			$this->b = 0;
+			$this->i = 0;
+			$this->u = 0;
+			$this->HREF = '';
+			$this->fontlist = array("arial", "times", "courier", "helvetica", "symbol");
+			$this->issetfont = false;
+			$this->issetcolor = false;
+			$this->tableborder = 0;
+			$this->tdbegin = false;
+			$this->tdwidth=  0;
+			$this->tdheight = 0;
+			$this->tdalign = "L";
+			$this->tdbgcolor = false;
+			
+			$this->SetFillColor(200, 200, 200, true);
+			$this->SetTextColor(0, 0, 0, true);
+		}
+
+		/**
+		* Set the image scale.
+		* @param float $scale image scale.
+		* @author Nicola Asuni
+		* @since 1.5.2
+		*/
+		function setImageScale($scale) {
+			$this->imgscale=$scale;
+		}
+
+		/**
+		* Returns the image scale.
+		* @return float image scale.
+		* @author Nicola Asuni
+		* @since 1.5.2
+		*/
+		function getImageScale() {
+			return $this->imgscale;
+		}
+
+		/**
+		* Returns the page width in units.
+		* @return int page width.
+		* @author Nicola Asuni
+		* @since 1.5.2
+		*/
+		function getPageWidth() {
+			return $this->w;
+		}
+
+		/**
+		* Returns the page height in units.
+		* @return int page height.
+		* @author Nicola Asuni
+		* @since 1.5.2
+		*/
+		function getPageHeight() {
+			return $this->fh;
+		}
+
+		/**
+		* Returns the page break margin.
+		* @return int page break margin.
+		* @author Nicola Asuni
+		* @since 1.5.2
+		*/
+		function getBreakMargin() {
+			return $this->bMargin;
+		}
+
+		/**
+		* Returns the scale factor (number of points in user unit).
+		* @return int scale factor.
+		* @author Nicola Asuni
+		* @since 1.5.2
+		*/
+		function getScaleFactor() {
+			return $this->k;
+		}
+
+		/**
+		* Defines the left, top and right margins. By default, they equal 1 cm. Call this method to change them.
+		* @param float $left Left margin.
+		* @param float $top Top margin.
+		* @param float $right Right margin. Default value is the left one.
+		* @since 1.0
+		* @see SetLeftMargin(), SetTopMargin(), SetRightMargin(), SetAutoPageBreak()
+		*/
+		function SetMargins($left, $top, $right=-1) {
+			//Set left, top and right margins
+			$this->lMargin=$left;
+			$this->tMargin=$top;
+			if($right==-1) {
+				$right=$left;
+			}
+			$this->rMargin=$right;
+		}
+
+		/**
+		* Defines the left margin. The method can be called before creating the first page. If the current abscissa gets out of page, it is brought back to the margin.
+		* @param float $margin The margin.
+		* @since 1.4
+		* @see SetTopMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins()
+		*/
+		function SetLeftMargin($margin) {
+			//Set left margin
+			$this->lMargin=$margin;
+			if(($this->page>0) and ($this->x<$margin)) {
+				$this->x=$margin;
+			}
+		}
+
+		/**
+		* Defines the top margin. The method can be called before creating the first page.
+		* @param float $margin The margin.
+		* @since 1.5
+		* @see SetLeftMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins()
+		*/
+		function SetTopMargin($margin) {
+			//Set top margin
+			$this->tMargin=$margin;
+		}
+
+		/**
+		* Defines the right margin. The method can be called before creating the first page.
+		* @param float $margin The margin.
+		* @since 1.5
+		* @see SetLeftMargin(), SetTopMargin(), SetAutoPageBreak(), SetMargins()
+		*/
+		function SetRightMargin($margin) {
+			//Set right margin
+			$this->rMargin=$margin;
+		}
+
+		/**
+		* Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm.
+		* @param boolean $auto Boolean indicating if mode should be on or off.
+		* @param float $margin Distance from the bottom of the page.
+		* @since 1.0
+		* @see Cell(), MultiCell(), AcceptPageBreak()
+		*/
+		function SetAutoPageBreak($auto, $margin=0) {
+			//Set auto page break mode and triggering margin
+			$this->AutoPageBreak=$auto;
+			$this->bMargin=$margin;
+			$this->PageBreakTrigger=$this->h-$margin;
+		}
+
+		/**
+		* Defines the way the document is to be displayed by the viewer. The zoom level can be set: pages can be displayed entirely on screen, occupy the full width of the window, use real size, be scaled by a specific zooming factor or use viewer default (configured in the Preferences menu of Acrobat). The page layout can be specified too: single at once, continuous display, two columns or viewer default. By default, documents use the full width mode with continuous display.
+		* @param mixed $zoom The zoom to use. It can be one of the following string values or a number indicating the zooming factor to use. <ul><li>fullpage: displays the entire page on screen </li><li>fullwidth: uses maximum width of window</li><li>real: uses real size (equivalent to 100% zoom)</li><li>default: uses viewer default mode</li></ul>
+		* @param string $layout The page layout. Possible values are:<ul><li>single: displays one page at once</li><li>continuous: displays pages continuously (default)</li><li>two: displays two pages on two columns</li><li>default: uses viewer default mode</li></ul>
+		* @since 1.2
+		*/
+		function SetDisplayMode($zoom, $layout='continuous') {
+			//Set display mode in viewer
+			if($zoom=='fullpage' or $zoom=='fullwidth' or $zoom=='real' or $zoom=='default' or !is_string($zoom)) {
+				$this->ZoomMode=$zoom;
+			}
+			else {
+				$this->Error('Incorrect zoom display mode: '.$zoom);
+			}
+			if($layout=='single' or $layout=='continuous' or $layout=='two' or $layout=='default') {
+				$this->LayoutMode=$layout;
+			}
+			else {
+				$this->Error('Incorrect layout display mode: '.$layout);
+			}
+		}
+
+		/**
+		* Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default.
+		* Note: the Zlib extension is required for this feature. If not present, compression will be turned off.
+		* @param boolean $compress Boolean indicating if compression must be enabled.
+		* @since 1.4
+		*/
+		function SetCompression($compress) {
+			//Set page compression
+			if(function_exists('gzcompress')) {
+				$this->compress=$compress;
+			}
+			else {
+				$this->compress=false;
+			}
+		}
+
+		/**
+		* Defines the title of the document.
+		* @param string $title The title.
+		* @since 1.2
+		* @see SetAuthor(), SetCreator(), SetKeywords(), SetSubject()
+		*/
+		function SetTitle($title) {
+			//Title of document
+			$this->title=$title;
+		}
+
+		/**
+		* Defines the subject of the document.
+		* @param string $subject The subject.
+		* @since 1.2
+		* @see SetAuthor(), SetCreator(), SetKeywords(), SetTitle()
+		*/
+		function SetSubject($subject) {
+			//Subject of document
+			$this->subject=$subject;
+		}
+
+		/**
+		* Defines the author of the document.
+		* @param string $author The name of the author.
+		* @since 1.2
+		* @see SetCreator(), SetKeywords(), SetSubject(), SetTitle()
+		*/
+		function SetAuthor($author) {
+			//Author of document
+			$this->author=$author;
+		}
+
+		/**
+		* Associates keywords with the document, generally in the form 'keyword1 keyword2 ...'.
+		* @param string $keywords The list of keywords.
+		* @since 1.2
+		* @see SetAuthor(), SetCreator(), SetSubject(), SetTitle()
+		*/
+		function SetKeywords($keywords) {
+			//Keywords of document
+			$this->keywords=$keywords;
+		}
+
+		/**
+		* Defines the creator of the document. This is typically the name of the application that generates the PDF.
+		* @param string $creator The name of the creator.
+		* @since 1.2
+		* @see SetAuthor(), SetKeywords(), SetSubject(), SetTitle()
+		*/
+		function SetCreator($creator) {
+			//Creator of document
+			$this->creator=$creator;
+		}
+
+		/**
+		* Defines an alias for the total number of pages. It will be substituted as the document is closed.<br />
+		* <b>Example:</b><br />
+		* <pre>
+		* class PDF extends FPDF {
+		* 	function Footer() {
+		* 		//Go to 1.5 cm from bottom
+		* 		$this->SetY(-15);
+		* 		//Select Arial italic 8
+		* 		$this->SetFont('Arial','I',8);
+		* 		//Print current and total page numbers
+		* 		$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
+		* 	}
+		* }
+		* $pdf=new PDF();
+		* $pdf->AliasNbPages();
+		* </pre>
+		* @param string $alias The alias. Default value: {nb}.
+		* @since 1.4
+		* @see PageNo(), Footer()
+		*/
+		function AliasNbPages($alias='{nb}') {
+			//Define an alias for total number of pages
+			$this->AliasNbPages = $this->_escapetext($alias);
+		}
+
+		/**
+		* This method is automatically called in case of fatal error; it simply outputs the message and halts the execution. An inherited class may override it to customize the error handling but should always halt the script, or the resulting document would probably be invalid.
+		* 2004-06-11 :: Nicola Asuni : changed bold tag with strong
+		* @param string $msg The error message
+		* @since 1.0
+		*/
+		function Error($msg) {
+			//Fatal error
+			die('<strong>FPDF error: </strong>'.$msg);
+		}
+
+		/**
+		* This method begins the generation of the PDF document. It is not necessary to call it explicitly because AddPage() does it automatically.
+		* Note: no page is created by this method
+		* @since 1.0
+		* @see AddPage(), Close()
+		*/
+		function Open() {
+			//Begin document
+			$this->state=1;
+		}
+
+		/**
+		* Terminates the PDF document. It is not necessary to call this method explicitly because Output() does it automatically. If the document contains no page, AddPage() is called to prevent from getting an invalid document.
+		* @since 1.0
+		* @see Open(), Output()
+		*/
+		function Close() {
+			//Terminate document
+			if($this->state==3) {
+				return;
+			}
+			if($this->page==0) {
+				$this->AddPage();
+			}
+			//Page footer
+			$this->InFooter=true;
+			$this->Footer();
+			$this->InFooter=false;
+			//Close page
+			$this->_endpage();
+			//Close document
+			$this->_enddoc();
+		}
+
+		/**
+		* Adds a new page to the document. If a page is already present, the Footer() method is called first to output the footer. Then the page is added, the current position set to the top-left corner according to the left and top margins, and Header() is called to display the header.
+		* The font which was set before calling is automatically restored. There is no need to call SetFont() again if you want to continue with the same font. The same is true for colors and line width.
+		* The origin of the coordinate system is at the top-left corner and increasing ordinates go downwards.
+		* @param string $orientation Page orientation. Possible values are (case insensitive):<ul><li>P or Portrait</li><li>L or Landscape</li></ul> The default value is the one passed to the constructor.
+		* @since 1.0
+		* @see FPDF(), Header(), Footer(), SetMargins()
+		*/
+		function AddPage($orientation='') {
+			//Start a new page
+			if($this->state==0) {
+				$this->Open();
+			}
+			$family=$this->FontFamily;
+			$style=$this->FontStyle.($this->underline ? 'U' : '');
+			$size=$this->FontSizePt;
+			$lw=$this->LineWidth;
+			$dc=$this->DrawColor;
+			$fc=$this->FillColor;
+			$tc=$this->TextColor;
+			$cf=$this->ColorFlag;
+			if($this->page>0) {
+				//Page footer
+				$this->InFooter=true;
+				$this->Footer();
+				$this->InFooter=false;
+				//Close page
+				$this->_endpage();
+			}
+			//Start new page
+			$this->_beginpage($orientation);
+			//Set line cap style to square
+			$this->_out('2 J');
+			//Set line width
+			$this->LineWidth=$lw;
+			$this->_out(sprintf('%.2f w',$lw*$this->k));
+			//Set font
+			if($family) {
+				$this->SetFont($family,$style,$size);
+			}
+			//Set colors
+			$this->DrawColor=$dc;
+			if($dc!='0 G') {
+				$this->_out($dc);
+			}
+			$this->FillColor=$fc;
+			if($fc!='0 g') {
+				$this->_out($fc);
+			}
+			$this->TextColor=$tc;
+			$this->ColorFlag=$cf;
+			//Page header
+			$this->Header();
+			//Restore line width
+			if($this->LineWidth!=$lw) {
+				$this->LineWidth=$lw;
+				$this->_out(sprintf('%.2f w',$lw*$this->k));
+			}
+			//Restore font
+			if($family) {
+				$this->SetFont($family,$style,$size);
+			}
+			//Restore colors
+			if($this->DrawColor!=$dc) {
+				$this->DrawColor=$dc;
+				$this->_out($dc);
+			}
+			if($this->FillColor!=$fc) {
+				$this->FillColor=$fc;
+				$this->_out($fc);
+			}
+			$this->TextColor=$tc;
+			$this->ColorFlag=$cf;
+		}
+		
+		
+		
+		/**
+	 	 * Set header data.
+		 * @param string $ln header image logo
+		 * @param string $lw header image logo width in mm
+		 * @param string $ht string to print as title on document header
+		 * @param string $hs string to print on document header
+		*/
+		function setHeaderData($ln="", $lw=0, $ht="", $hs="") {
+			$this->header_logo = $ln;
+			$this->header_logo_width = $lw;
+			$this->header_title = $ht;
+			$this->header_string = $hs;
+		}
+		
+		/**
+	 	 * Set header margin.
+		 * (minimum distance between header and top page margin)
+		 * @param int $hm distance in millimeters
+		*/
+		function setHeaderMargin($hm=10) {
+			$this->header_margin = $hm;
+		}
+		
+		/**
+	 	 * Set footer margin.
+		 * (minimum distance between footer and bottom page margin)
+		 * @param int $fm distance in millimeters
+		*/
+		function setFooterMargin($fm=10) {
+			$this->footer_margin = $fm;
+		}
+		
+		/**
+	 	 * This method is used to render the page header.
+	 	 * It is automatically called by AddPage() and could be overwritten in your own inherited class.
+		 */
+		function Header() {
+			if ($this->print_header) {
+				
+				if (!isset($this->original_lMargin)) {
+					$this->original_lMargin = $this->lMargin;
+				}
+				if (!isset($this->original_rMargin)) {
+					$this->original_rMargin = $this->rMargin;
+				}
+				
+				//set current position
+				$this->SetXY($this->original_lMargin, $this->header_margin);
+				
+				if (($this->header_logo) AND ($this->header_logo != K_BLANK_IMAGE)) {
+					$this->Image(K_PATH_IMAGES.$this->header_logo, $this->original_lMargin, $this->header_margin, $this->header_logo_width);
+				}
+				else {
+					$this->img_rb_y = $this->GetY();
+				}
+				
+				$cell_height = round((K_CELL_HEIGHT_RATIO * $this->header_font[2]) / $this->k, 2);
+				
+				$header_x = $this->original_lMargin + ($this->header_logo_width * 1.05); //set left margin for text data cell
+				
+				// header title
+				$this->SetFont($this->header_font[0], 'B', $this->header_font[2] + 1);
+				$this->SetX($header_x);
+				$this->Cell($this->header_width, $cell_height, $this->header_title, 0, 1, 'L'); 
+				
+				// header string
+				$this->SetFont($this->header_font[0], $this->header_font[1], $this->header_font[2]);
+				$this->SetX($header_x);
+				$this->MultiCell($this->header_width, $cell_height, $this->header_string, 0, 'L', 0);
+				
+				// print an ending header line
+				if (empty($this->header_width)) {
+					//set style for cell border
+					$this->SetLineWidth(0.3);
+					$this->SetDrawColor(0, 0, 0);
+					$this->SetY(1 + max($this->img_rb_y, $this->GetY()));
+					$this->SetX($this->original_lMargin);
+					$this->Cell(0, 0, '', 'T', 0, 'C'); 
+				}
+				
+				//restore position
+				$this->SetXY($this->original_lMargin, $this->tMargin);
+			}
+		}
+		
+		/**
+	 	 * This method is used to render the page footer. 
+	 	 * It is automatically called by AddPage() and could be overwritten in your own inherited class.
+		 */
+		function Footer() {
+			if ($this->print_footer) {
+				
+				if (!isset($this->original_lMargin)) {
+					$this->original_lMargin = $this->lMargin;
+				}
+				if (!isset($this->original_rMargin)) {
+					$this->original_rMargin = $this->rMargin;
+				}
+				
+				//set font
+				$this->SetFont($this->footer_font[0], $this->footer_font[1] , $this->footer_font[2]);
+				//set style for cell border
+				$line_width = 0.3;
+				$this->SetLineWidth($line_width);
+				$this->SetDrawColor(0, 0, 0);
+				
+				$footer_height = round((K_CELL_HEIGHT_RATIO * $this->footer_font[2]) / $this->k, 2); //footer height
+				//get footer y position
+				$footer_y = $this->h - $this->footer_margin - $footer_height;
+				//set current position
+				$this->SetXY($this->original_lMargin, $footer_y); 
+				
+				//print document barcode
+				if ($this->barcode) {
+					$this->Ln();
+					$barcode_width = round(($this->w - $this->original_lMargin - $this->original_rMargin)); //max width
+					$this->writeBarcode($this->original_lMargin, $footer_y + $line_width, $barcode_width, $footer_height - $line_width, "C128B", false, false, 2, $this->barcode);
+				}
+				
+				$this->SetXY($this->original_lMargin, $footer_y); 
+				
+				//Print page number
+				$this->Cell(0, $footer_height, $this->l['w_page']." ".$this->PageNo().' / {nb}', 'T', 0, 'R'); 
+			}
+		}
+		
+		/**
+		* Returns the current page number.
+		* @return int page number
+		* @since 1.0
+		* @see AliasNbPages()
+		*/
+		function PageNo() {
+			//Get current page number
+			return $this->page;
+		}
+
+		/**
+		* Defines the color used for all drawing operations (lines, rectangles and cell borders). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.
+		* @param int $r If g et b are given, red component; if not, indicates the gray level. Value between 0 and 255
+		* @param int $g Green component (between 0 and 255)
+		* @param int $b Blue component (between 0 and 255)
+		* @since 1.3
+		* @see SetFillColor(), SetTextColor(), Line(), Rect(), Cell(), MultiCell()
+		*/
+		function SetDrawColor($r, $g=-1, $b=-1) {
+			//Set color for all stroking operations
+			if(($r==0 and $g==0 and $b==0) or $g==-1) {
+				$this->DrawColor=sprintf('%.3f G',$r/255);
+			}
+			else {
+				$this->DrawColor=sprintf('%.3f %.3f %.3f RG',$r/255,$g/255,$b/255);
+			}
+			if($this->page>0) {
+				$this->_out($this->DrawColor);
+			}
+		}
+
+		/**
+		* Defines the color used for all filling operations (filled rectangles and cell backgrounds). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.
+		* @param int $r If g et b are given, red component; if not, indicates the gray level. Value between 0 and 255
+		* @param int $g Green component (between 0 and 255)
+		* @param int $b Blue component (between 0 and 255)
+		* @param boolean $storeprev if true stores the RGB array on $prevFillColor variable.
+		* @since 1.3
+		* @see SetDrawColor(), SetTextColor(), Rect(), Cell(), MultiCell()
+		*/
+		function SetFillColor($r, $g=-1, $b=-1, $storeprev=false) {
+			//Set color for all filling operations
+			if(($r==0 and $g==0 and $b==0) or $g==-1) {
+				$this->FillColor=sprintf('%.3f g',$r/255);
+			}
+			else {
+				$this->FillColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);
+			}
+			$this->ColorFlag=($this->FillColor!=$this->TextColor);
+			if($this->page>0) {
+				$this->_out($this->FillColor);
+			}
+			if ($storeprev) {
+				// store color as previous value
+				$this->prevFillColor = array($r, $g, $b);
+			}
+		}
+
+		/**
+		* Defines the color used for text. It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.
+		* @param int $r If g et b are given, red component; if not, indicates the gray level. Value between 0 and 255
+		* @param int $g Green component (between 0 and 255)
+		* @param int $b Blue component (between 0 and 255)
+		* @param boolean $storeprev if true stores the RGB array on $prevTextColor variable.
+		* @since 1.3
+		* @see SetDrawColor(), SetFillColor(), Text(), Cell(), MultiCell()
+		*/
+		function SetTextColor($r, $g=-1, $b=-1, $storeprev=false) {
+			//Set color for text
+			if(($r==0 and $g==0 and $b==0) or $g==-1) {
+				$this->TextColor=sprintf('%.3f g',$r/255);
+			}
+			else {
+				$this->TextColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);
+			}
+			$this->ColorFlag=($this->FillColor!=$this->TextColor);
+			if ($storeprev) {
+				// store color as previous value
+				$this->prevTextColor = array($r, $g, $b);
+			}
+		}
+
+		/**
+		* Returns the length of a string in user unit. A font must be selected.<br>
+		* Support UTF-8 Unicode [Nicola Asuni, 2005-01-02]
+		* @param string $s The string whose length is to be computed
+		* @return int
+		* @since 1.2
+		*/
+		function GetStringWidth($s) {
+			//Get width of a string in the current font
+			$s = (string)$s;
+			$cw = &$this->CurrentFont['cw'];
+			$w = 0;
+			if($this->isunicode) {
+				$unicode = $this->UTF8StringToArray($s);
+				foreach($unicode as $char) {
+					if (isset($cw[$char])) {
+						$w+=$cw[$char];
+					} elseif(isset($cw[ord($char)])) {
+						$w+=$cw[ord($char)];
+					} elseif(isset($cw[chr($char)])) {
+						$w+=$cw[chr($char)];
+					} elseif(isset($this->CurrentFont['desc']['MissingWidth'])) {
+						$w += $this->CurrentFont['desc']['MissingWidth']; // set default size
+					} else {
+						$w += 500;
+					}
+				}
+			} else {
+				$l = strlen($s);
+				for($i=0; $i<$l; $i++) {
+					if (isset($cw[$s{$i}])) {
+						$w += $cw[$s{$i}];
+					} else if (isset($cw[ord($s{$i})])) {
+						$w += $cw[ord($s{$i})];
+					}
+				}
+			}
+			return ($w * $this->FontSize / 1000);
+		}
+
+		/**
+		* Defines the line width. By default, the value equals 0.2 mm. The method can be called before the first page is created and the value is retained from page to page.
+		* @param float $width The width.
+		* @since 1.0
+		* @see Line(), Rect(), Cell(), MultiCell()
+		*/
+		function SetLineWidth($width) {
+			//Set line width
+			$this->LineWidth=$width;
+			if($this->page>0) {
+				$this->_out(sprintf('%.2f w',$width*$this->k));
+			}
+		}
+
+		/**
+		* Draws a line between two points.
+		* @param float $x1 Abscissa of first point
+		* @param float $y1 Ordinate of first point
+		* @param float $x2 Abscissa of second point
+		* @param float $y2 Ordinate of second point
+		* @since 1.0
+		* @see SetLineWidth(), SetDrawColor()
+		*/
+		function Line($x1, $y1, $x2, $y2) {
+			//Draw a line
+			$this->_out(sprintf('%.2f %.2f m %.2f %.2f l S', $x1*$this->k, ($this->h-$y1)*$this->k, $x2*$this->k, ($this->h-$y2)*$this->k));
+		}
+
+		/**
+		* Outputs a rectangle. It can be drawn (border only), filled (with no border) or both.
+		* @param float $x Abscissa of upper-left corner
+		* @param float $y Ordinate of upper-left corner
+		* @param float $w Width
+		* @param float $h Height
+		* @param string $style Style of rendering. Possible values are:<ul><li>D or empty string: draw (default)</li><li>F: fill</li><li>DF or FD: draw and fill</li></ul>
+		* @since 1.0
+		* @see SetLineWidth(), SetDrawColor(), SetFillColor()
+		*/
+		function Rect($x, $y, $w, $h, $style='') {
+			//Draw a rectangle
+			if($style=='F') {
+				$op='f';
+			}
+			elseif($style=='FD' or $style=='DF') {
+				$op='B';
+			}
+			else {
+				$op='S';
+			}
+			$this->_out(sprintf('%.2f %.2f %.2f %.2f re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op));
+		}
+
+		/**
+		* Imports a TrueType or Type1 font and makes it available. It is necessary to generate a font definition file first with the makefont.php utility. The definition file (and the font file itself when embedding) must be present either in the current directory or in the one indicated by FPDF_FONTPATH if the constant is defined. If it could not be found, the error "Could not include font definition file" is generated.
+		* Support UTF-8 Unicode [Nicola Asuni, 2005-01-02].
+		* <b>Example</b>:<br />
+		* <pre>
+		* $pdf->AddFont('Comic','I');
+		* // is equivalent to:
+		* $pdf->AddFont('Comic','I','comici.php');
+		* </pre>
+		* @param string $family Font family. The name can be chosen arbitrarily. If it is a standard family name, it will override the corresponding font.
+		* @param string $style Font style. Possible values are (case insensitive):<ul><li>empty string: regular (default)</li><li>B: bold</li><li>I: italic</li><li>BI or IB: bold italic</li></ul>
+		* @param string $file The font definition file. By default, the name is built from the family and style, in lower case with no space.
+		* @since 1.5
+		* @see SetFont()
+		*/
+		function AddFont($family, $style='', $file='') {
+			if(empty($family)) {
+				return;
+			}
+
+			//Add a TrueType or Type1 font
+			$family = strtolower($family);
+			if((!$this->isunicode) AND ($family == 'arial')) {
+				$family = 'helvetica';
+			}
+
+			$style=strtoupper($style);
+			$style=str_replace('U','',$style);
+			if($style == 'IB') {
+				$style = 'BI';
+			}
+
+			$fontkey = $family.$style;
+			// check if the font has been already added
+			if(isset($this->fonts[$fontkey])) {
+				return;
+			}
+
+			if($file=='') {
+				$file = str_replace(' ', '', $family).strtolower($style).'.php';
+			}
+			if(!file_exists($this->_getfontpath().$file)) {
+				// try to load the basic file without styles
+				$file = str_replace(' ', '', $family).'.php';
+			}
+
+			include($this->_getfontpath().$file);
+
+			if(!isset($name) AND !isset($fpdf_charwidths)) {
+				$this->Error('Could not include font definition file');
+			}
+
+			$i = count($this->fonts)+1;
+
+			if($this->isunicode) {
+				$this->fonts[$fontkey] = array('i'=>$i, 'type'=>$type, 'name'=>$name, 'desc'=>$desc, 'up'=>$up, 'ut'=>$ut, 'cw'=>$cw, 'enc'=>$enc, 'file'=>$file, 'ctg'=>$ctg);
+				$fpdf_charwidths[$fontkey] = $cw;
+			} else {
+				$this->fonts[$fontkey]=array('i'=>$i, 'type'=>'core', 'name'=>$this->CoreFonts[$fontkey], 'up'=>-100, 'ut'=>50, 'cw'=>$fpdf_charwidths[$fontkey]);
+			}
+
+			if(isset($diff) AND (!empty($diff))) {
+				//Search existing encodings
+				$d=0;
+				$nb=count($this->diffs);
+				for($i=1;$i<=$nb;$i++) {
+					if($this->diffs[$i]==$diff) {
+						$d=$i;
+						break;
+					}
+				}
+				if($d==0) {
+					$d=$nb+1;
+					$this->diffs[$d]=$diff;
+				}
+				$this->fonts[$fontkey]['diff']=$d;
+			}
+			if(!empty($file)) {
+				if((strcasecmp($type,"TrueType") == 0) OR (strcasecmp($type,"TrueTypeUnicode") == 0)) {
+					$this->FontFiles[$file]=array('length1'=>$originalsize);
+				}
+				else {
+					$this->FontFiles[$file]=array('length1'=>$size1,'length2'=>$size2);
+				}
+			}
+		}
+
+		/**
+		* Sets the font used to print character strings. It is mandatory to call this method at least once before printing text or the resulting document would not be valid.
+		* The font can be either a standard one or a font added via the AddFont() method. Standard fonts use Windows encoding cp1252 (Western Europe).
+		* The method can be called before the first page is created and the font is retained from page to page.
+		If you just wish to change the current font size, it is simpler to call SetFontSize().
+		* Note: for the standard fonts, the font metric files must be accessible. There are three possibilities for this:<ul><li>They are in the current directory (the one where the running script lies)</li><li>They are in one of the directories defined by the include_path parameter</li><li>They are in the directory defined by the FPDF_FONTPATH constant</li></ul><br />
+		* Example for the last case (note the trailing slash):<br />
+		* <pre>
+		* define('FPDF_FONTPATH','/home/www/font/');
+		* require('fpdf.php');
+		*
+		* //Times regular 12
+		* $pdf->SetFont('Times');
+		* //Arial bold 14
+		* $pdf->SetFont('Arial','B',14);
+		* //Removes bold
+		* $pdf->SetFont('');
+		* //Times bold, italic and underlined 14
+		* $pdf->SetFont('Times','BIU');
+		* </pre><br />
+		* If the file corresponding to the requested font is not found, the error "Could not include font metric file" is generated.
+		* @param string $family Family font. It can be either a name defined by AddFont() or one of the standard families (case insensitive):<ul><li>Courier (fixed-width)</li><li>Helvetica or Arial (synonymous; sans serif)</li><li>Times (serif)</li><li>Symbol (symbolic)</li><li>ZapfDingbats (symbolic)</li></ul>It is also possible to pass an empty string. In that case, the current family is retained.
+		* @param string $style Font style. Possible values are (case insensitive):<ul><li>empty string: regular</li><li>B: bold</li><li>I: italic</li><li>U: underline</li></ul>or any combination. The default value is regular. Bold and italic styles do not apply to Symbol and ZapfDingbats
+		* @param float $size Font size in points. The default value is the current size. If no size has been specified since the beginning of the document, the value taken is 12
+		* @since 1.0
+		* @see AddFont(), SetFontSize(), Cell(), MultiCell(), Write()
+		*/
+		function SetFont($family, $style='', $size=0) {
+			//error_log("family: $family , style: $style, sise: $size");
+            // save previous values
+			$this->prevFontFamily = $this->FontFamily;
+			$this->prevFontStyle = $this->FontStyle;
+
+			//Select a font; size given in points
+			global $fpdf_charwidths;
+
+			$family=strtolower($family);
+			if($family=='') {
+				$family=$this->FontFamily;
+			}
+			if((!$this->isunicode) AND ($family == 'arial')) {
+				$family = 'helvetica';
+			}
+			elseif(($family=="symbol") OR ($family=="zapfdingbats")) {
+				$style='';
+			}
+			$style=strtoupper($style);
+
+			if(strpos($style,'U')!==false) {
+				$this->underline=true;
+				$style=str_replace('U','',$style);
+			}
+			else {
+				$this->underline=false;
+			}
+			if($style=='IB') {
+				$style='BI';
+			}
+			if($size==0) {
+				$size=$this->FontSizePt;
+			}
+
+			// try to add font (if not already added)
+			if($this->isunicode) {
+				$this->AddFont($family, $style);
+			}
+			
+			//Test if font is already selected
+			if(($this->FontFamily == $family) AND ($this->FontStyle == $style) AND ($this->FontSizePt == $size)) {
+				return;
+			}
+			
+			$fontkey = $family.$style;
+			//if(!isset($this->fonts[$fontkey]) AND isset($this->fonts[$family])) {
+			//	$style='';
+			//}
+
+			//Test if used for the first time
+			if(!isset($this->fonts[$fontkey])) {
+				//Check if one of the standard fonts
+				if(isset($this->CoreFonts[$fontkey])) {
+					if(!isset($fpdf_charwidths[$fontkey])) {
+						//Load metric file
+						$file = $family;
+						if(($family!='symbol') AND ($family!='zapfdingbats')) {
+							$file .= strtolower($style);
+						}
+						if(!file_exists($this->_getfontpath().$file.'.php')) {
+							// try to load the basic file without styles
+							$file = $family;
+							$fontkey = $family;
+						}
+						include($this->_getfontpath().$file.'.php');
+						if (($this->isunicode AND !isset($ctg)) OR ((!$this->isunicode) AND (!isset($fpdf_charwidths[$fontkey]))) ) {
+							$this->Error("Could not include font metric file [".$fontkey."]: ".$this->_getfontpath().$file.".php");
+						}
+					}
+					$i = count($this->fonts) + 1;
+
+					if($this->isunicode) {
+						$this->fonts[$fontkey] = array('i'=>$i, 'type'=>$type, 'name'=>$name, 'desc'=>$desc, 'up'=>$up, 'ut'=>$ut, 'cw'=>$cw, 'enc'=>$enc, 'file'=>$file, 'ctg'=>$ctg);
+						$fpdf_charwidths[$fontkey] = $cw;
+					} else {
+						$this->fonts[$fontkey]=array('i'=>$i, 'type'=>'core', 'name'=>$this->CoreFonts[$fontkey], 'up'=>-100, 'ut'=>50, 'cw'=>$fpdf_charwidths[$fontkey]);
+					}
+				}
+				else {
+					$this->Error('Undefined font: '.$family.' '.$style);
+				}
+			}
+			//Select it
+			$this->FontFamily = $family;
+			$this->FontStyle = $style;
+			$this->FontSizePt = $size;
+			$this->FontSize = $size / $this->k;
+			$this->CurrentFont = &$this->fonts[$fontkey];
+			if($this->page>0) {
+				$this->_out(sprintf('BT /F%d %.2f Tf ET', $this->CurrentFont['i'], $this->FontSizePt));
+			}
+		}
+
+		/**
+		* Defines the size of the current font.
+		* @param float $size The size (in points)
+		* @since 1.0
+		* @see SetFont()
+		*/
+		function SetFontSize($size) {
+			//Set font size in points
+			if($this->FontSizePt==$size) {
+				return;
+			}
+			$this->FontSizePt = $size;
+			$this->FontSize = $size / $this->k;
+			if($this->page > 0) {
+				$this->_out(sprintf('BT /F%d %.2f Tf ET', $this->CurrentFont['i'], $this->FontSizePt));
+			}
+		}
+
+		/**
+		* Creates a new internal link and returns its identifier. An internal link is a clickable area which directs to another place within the document.<br />
+		* The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is defined with SetLink().
+		* @since 1.5
+		* @see Cell(), Write(), Image(), Link(), SetLink()
+		*/
+		function AddLink() {
+			//Create a new internal link
+			$n=count($this->links)+1;
+			$this->links[$n]=array(0,0);
+			return $n;
+		}
+
+		/**
+		* Defines the page and position a link points to
+		* @param int $link The link identifier returned by AddLink()
+		* @param float $y Ordinate of target position; -1 indicates the current position. The default value is 0 (top of page)
+		* @param int $page Number of target page; -1 indicates the current page. This is the default value
+		* @since 1.5
+		* @see AddLink()
+		*/
+		function SetLink($link, $y=0, $page=-1) {
+			//Set destination of internal link
+			if($y==-1) {
+				$y=$this->y;
+			}
+			if($page==-1) {
+				$page=$this->page;
+			}
+			$this->links[$link]=array($page,$y);
+		}
+
+		/**
+		* Puts a link on a rectangular area of the page. Text or image links are generally put via Cell(), Write() or Image(), but this method can be useful for instance to define a clickable area inside an image.
+		* @param float $x Abscissa of the upper-left corner of the rectangle
+		* @param float $y Ordinate of the upper-left corner of the rectangle
+		* @param float $w Width of the rectangle
+		* @param float $h Height of the rectangle
+		* @param mixed $link URL or identifier returned by AddLink()
+		* @since 1.5
+		* @see AddLink(), Cell(), Write(), Image()
+		*/
+		function Link($x, $y, $w, $h, $link) {
+			//Put a link on the page
+			$this->PageLinks[$this->page][] = array($x * $this->k, $this->hPt - $y * $this->k, $w * $this->k, $h*$this->k, $link);
+		}
+
+		/**
+		* Prints a character string. The origin is on the left of the first charcter, on the baseline. This method allows to place a string precisely on the page, but it is usually easier to use Cell(), MultiCell() or Write() which are the standard methods to print text.
+		* @param float $x Abscissa of the origin
+		* @param float $y Ordinate of the origin
+		* @param string $txt String to print
+		* @since 1.0
+		* @see SetFont(), SetTextColor(), Cell(), MultiCell(), Write()
+		*/
+		function Text($x, $y, $txt) {
+			//Output a string
+			$s=sprintf('BT %.2f %.2f Td (%s) Tj ET', $x * $this->k, ($this->h-$y) * $this->k, $this->_escapetext($txt));
+			if($this->underline AND ($txt!='')) {
+				$s .= ' '.$this->_dounderline($x,$y,$txt);
+			}
+			if($this->ColorFlag) {
+				$s='q '.$this->TextColor.' '.$s.' Q';
+			}
+			$this->_out($s);
+		}
+
+		/**
+		* Whenever a page break condition is met, the method is called, and the break is issued or not depending on the returned value. The default implementation returns a value according to the mode selected by SetAutoPageBreak().<br />
+		* This method is called automatically and should not be called directly by the application.<br />
+		* <b>Example:</b><br />
+		* The method is overriden in an inherited class in order to obtain a 3 column layout:<br />
+		* <pre>
+		* class PDF extends FPDF {
+		* 	var $col=0;
+		*
+		* 	function SetCol($col) {
+		* 		//Move position to a column
+		* 		$this->col=$col;
+		* 		$x=10+$col*65;
+		* 		$this->SetLeftMargin($x);
+		* 		$this->SetX($x);
+		* 	}
+		*
+		* 	function AcceptPageBreak() {
+		* 		if($this->col<2) {
+		* 			//Go to next column
+		* 			$this->SetCol($this->col+1);
+		* 			$this->SetY(10);
+		* 			return false;
+		* 		}
+		* 		else {
+		* 			//Go back to first column and issue page break
+		* 			$this->SetCol(0);
+		* 			return true;
+		* 		}
+		* 	}
+		* }
+		*
+		* $pdf=new PDF();
+		* $pdf->Open();
+		* $pdf->AddPage();
+		* $pdf->SetFont('Arial','',12);
+		* for($i=1;$i<=300;$i++) {
+		*     $pdf->Cell(0,5,"Line $i",0,1);
+		* }
+		* $pdf->Output();
+		* </pre>
+		* @return boolean
+		* @since 1.4
+		* @see SetAutoPageBreak()
+		*/
+		function AcceptPageBreak() {
+			//Accept automatic page break or not
+			return $this->AutoPageBreak;
+		}
+
+		/**
+		* Prints a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.<br />
+		* If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.
+		* @param float $w Cell width. If 0, the cell extends up to the right margin.
+		* @param float $h Cell height. Default value: 0.
+		* @param string $txt String to print. Default value: empty string.
+		* @param mixed $border Indicates if borders must be drawn around the cell. The value can be either a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul>or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul>
+		* @param int $ln Indicates where the current position should go after the call. Possible values are:<ul><li>0: to the right</li><li>1: to the beginning of the next line</li><li>2: below</li></ul>
+		Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
+		* @param string $align Allows to center or align the text. Possible values are:<ul><li>L or empty string: left align (default value)</li><li>C: center</li><li>R: right align</li></ul>
+		* @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0.
+		* @param mixed $link URL or identifier returned by AddLink().
+		* @since 1.0
+		* @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), AddLink(), Ln(), MultiCell(), Write(), SetAutoPageBreak()
+		*/
+		function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=0, $link='') {
+			//Output a cell
+			$k=$this->k;
+			if(($this->y + $h) > $this->PageBreakTrigger AND empty($this->InFooter) AND $this->AcceptPageBreak()) {
+				//Automatic page break
+				$x = $this->x;
+				$ws = $this->ws;
+				if($ws > 0) {
+					$this->ws = 0;
+					$this->_out('0 Tw');
+				}
+				$this->AddPage($this->CurOrientation);
+				$this->x = $x;
+				if($ws > 0) {
+					$this->ws = $ws;
+					$this->_out(sprintf('%.3f Tw',$ws * $k));
+				}
+			}
+			if($w == 0) {
+				$w = $this->w - $this->rMargin - $this->x;
+			}
+			$s = '';
+			if(($fill == 1) OR ($border == 1)) {
+				if($fill == 1) {
+					$op = ($border == 1) ? 'B' : 'f';
+				}
+				else {
+					$op = 'S';
+				}
+				$s = sprintf('%.2f %.2f %.2f %.2f re %s ', $this->x * $k, ($this->h - $this->y) * $k, $w * $k, -$h * $k, $op);
+			}
+			if(is_string($border)) {
+				$x=$this->x;
+				$y=$this->y;
+				if(strpos($border,'L')!==false) {
+					$s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
+				}
+				if(strpos($border,'T')!==false) {
+					$s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
+				}
+				if(strpos($border,'R')!==false) {
+					$s.=sprintf('%.2f %.2f m %.2f %.2f l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
+				}
+				if(strpos($border,'B')!==false) {
+					$s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
+				}
+			}
+			if($txt != '') {
+				$width = $this->GetStringWidth($txt);
+				if($align == 'R') {
+					$dx = $w - $this->cMargin - $width;
+				}
+				elseif($align=='C') {
+					$dx = ($w - $width)/2;
+				}
+				else {
+					$dx = $this->cMargin;
+				}
+				if($this->ColorFlag) {
+					$s .= 'q '.$this->TextColor.' ';
+				}
+				$txt2 = $this->_escapetext($txt);
+				$s.=sprintf('BT %.2f %.2f Td (%s) Tj ET', ($this->x + $dx) * $k, ($this->h - ($this->y + 0.5 * $h + 0.3 * $this->FontSize)) * $k, $txt2);
+				if($this->underline) {
+					$s.=' '.$this->_dounderline($this->x + $dx, $this->y + 0.5 * $h + 0.3 * $this->FontSize, $txt);
+				}
+				if($this->ColorFlag) {
+					$s.=' Q';
+				}
+				if($link) {
+					$this->Link($this->x + $dx, $this->y + 0.5 * $h - 0.5 * $this->FontSize, $width, $this->FontSize, $link);
+				}
+			}
+			if($s) {
+				$this->_out($s);
+			}
+			$this->lasth = $h;
+			if($ln>0) {
+				//Go to next line
+				$this->y += $h;
+				if($ln == 1) {
+					$this->x = $this->lMargin;
+				}
+			}
+			else {
+				$this->x += $w;
+			}
+		}
+
+		/**
+		* This method allows printing text with line breaks. They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, one below the other.<br />
+		* Text can be aligned, centered or justified. The cell block can be framed and the background painted.
+		* @param float $w Width of cells. If 0, they extend up to the right margin of the page.
+		* @param float $h Height of cells.
+		* @param string $txt String to print
+		* @param mixed $border Indicates if borders must be drawn around the cell block. The value can be either a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul>or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul>
+		* @param int $ln Indicates where the current position should go after the call. Possible values are:<ul><li>0: to the right</li><li>1: to the beginning of the next line</li><li>2: below</li></ul>
+		Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
+		* @param string $align Allows to center or align the text. Possible values are:<ul><li>L or empty string: left align</li><li>C: center</li><li>R: right align</li><li>J: justification (default value)</li></ul>
+		* @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0.
+		* @since 1.3
+		* @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), Cell(), Write(), SetAutoPageBreak()
+		*/
+		function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0) {
+			//Output text with automatic or explicit line breaks
+			$cw = &$this->CurrentFont['cw'];
+
+			if($w == 0) {
+				$w = $this->w - $this->rMargin - $this->x;
+			}
+
+			$wmax = ($w - 2 * $this->cMargin);
+
+			$s = str_replace("\r", '', $txt); // remove carriage returns
+			$nb = strlen($s);
+
+			$b=0;
+			if($border) {
+				if($border==1) {
+					$border='LTRB';
+					$b='LRT';
+					$b2='LR';
+				}
+				else {
+					$b2='';
+					if(strpos($border,'L')!==false) {
+						$b2.='L';
+					}
+					if(strpos($border,'R')!==false) {
+						$b2.='R';
+					}
+					$b=(strpos($border,'T')!==false) ? $b2.'T' : $b2;
+				}
+			}
+			$sep=-1;
+			$i=0;
+			$j=0;
+			$l=0;
+			$ns=0;
+			$nl=1;
+			while($i<$nb) {
+				//Get next character
+				$c = $s{$i};
+				if(preg_match("/[\n]/u", $c)) {
+					//Explicit line break
+					if($this->ws > 0) {
+						$this->ws = 0;
+						$this->_out('0 Tw');
+					}
+					$this->Cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill);
+					$i++;
+					$sep=-1;
+					$j=$i;
+					$l=0;
+					$ns=0;
+					$nl++;
+					if($border and $nl==2) {
+						$b = $b2;
+					}
+					continue;
+				}
+				if(preg_match("/[ ]/u", $c)) {
+					$sep = $i;
+					$ls = $l;
+					$ns++;
+				}
+
+				$l = $this->GetStringWidth(substr($s, $j, $i-$j));
+
+				if($l > $wmax) {
+					//Automatic line break
+					if($sep == -1) {
+						if($i == $j) {
+							$i++;
+						}
+						if($this->ws > 0) {
+							$this->ws = 0;
+							$this->_out('0 Tw');
+						}
+						$this->Cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill);
+					}
+					else {
+						if($align=='J') {
+							$this->ws = ($ns>1) ? ($wmax-$ls)/($ns-1) : 0;
+							$this->_out(sprintf('%.3f Tw', $this->ws * $this->k));
+						}
+						$this->Cell($w, $h, substr($s, $j, $sep-$j), $b, 2, $align, $fill);
+						$i = $sep + 1;
+					}
+					$sep=-1;
+					$j=$i;
+					$l=0;
+					$ns=0;
+					$nl++;
+					if($border AND ($nl==2)) {
+						$b=$b2;
+					}
+				}
+				else {
+					$i++;
+				}
+			}
+			//Last chunk
+			if($this->ws>0) {
+				$this->ws=0;
+				$this->_out('0 Tw');
+			}
+			if($border and is_int(strpos($border,'B'))) {
+				$b.='B';
+			}
+			$this->Cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill);
+			$this->x=$this->lMargin;
+		}
+
+		/**
+		* This method prints text from the current position. When the right margin is reached (or the \n character is met) a line break occurs and text continues from the left margin. Upon method exit, the current position is left just at the end of the text. It is possible to put a link on the text.<br />
+		* <b>Example:</b><br />
+		* <pre>
+		* //Begin with regular font
+		* $pdf->SetFont('Arial','',14);
+		* $pdf->Write(5,'Visit ');
+		* //Then put a blue underlined link
+		* $pdf->SetTextColor(0,0,255);
+		* $pdf->SetFont('','U');
+		* $pdf->Write(5,'www.fpdf.org','http://www.fpdf.org');
+		* </pre>
+		* @param float $h Line height
+		* @param string $txt String to print
+		* @param mixed $link URL or identifier returned by AddLink()
+		* @param int $fill Indicates if the background must be painted (1) or transparent (0). Default value: 0.
+		* @since 1.5
+		* @see SetFont(), SetTextColor(), AddLink(), MultiCell(), SetAutoPageBreak()
+		*/
+		function Write($h, $txt, $link='', $fill=0) {
+
+			//Output text in flowing mode
+			$cw = &$this->CurrentFont['cw'];
+			$w = $this->w - $this->rMargin - $this->x;
+			$wmax = ($w - 2 * $this->cMargin);
+
+			$s = str_replace("\r", '', $txt);
+			$nb = strlen($s);
+
+			// handle single space character
+			if(($nb==1) AND preg_match("/[ ]/u", $s)) {
+				$this->x += $this->GetStringWidth($s);
+				return;
+			}
+
+			$sep=-1;
+			$i=0;
+			$j=0;
+			$l=0;
+			$nl=1;
+			while($i<$nb) {
+				//Get next character
+				$c=$s{$i};
+				if(preg_match("/[\n]/u", $c)) {
+					//Explicit line break
+					$this->Cell($w, $h, substr($s, $j, $i-$j), 0, 2, '', $fill, $link);
+					$i++;
+					$sep = -1;
+					$j = $i;
+					$l = 0;
+					if($nl == 1) {
+						$this->x = $this->lMargin;
+						$w = $this->w - $this->rMargin - $this->x;
+						$wmax = ($w - 2 * $this->cMargin);
+					}
+					$nl++;
+					continue;
+				}
+				if(preg_match("/[ ]/u", $c)) {
+					$sep= $i;
+				}
+
+				$l = $this->GetStringWidth(substr($s, $j, $i-$j));
+
+				if($l > $wmax) {
+					//Automatic line break (word wrapping)
+					if($sep == -1) {
+						if($this->x > $this->lMargin) {
+							//Move to next line
+							$this->x = $this->lMargin;
+							$this->y += $h;
+							$w=$this->w - $this->rMargin - $this->x;
+							$wmax=($w - 2 * $this->cMargin);
+							$i++;
+							$nl++;
+							continue;
+						}
+						if($i==$j) {
+							$i++;
+						}
+						$this->Cell($w, $h, substr($s, $j, $i-$j), 0, 2, '', $fill, $link);
+					}
+					else {
+						$this->Cell($w, $h, substr($s, $j, $sep-$j), 0, 2, '', $fill, $link);
+						$i=$sep+1;
+					}
+					$sep = -1;
+					$j = $i;
+					$l = 0;
+					if($nl==1) {
+						$this->x = $this->lMargin;
+						$w = $this->w - $this->rMargin - $this->x;
+						$wmax = ($w - 2 * $this->cMargin);
+					}
+					$nl++;
+				}
+				else {
+					$i++;
+				}
+			}
+			
+			//Last chunk
+			if($i!=$j) {
+				$this->Cell($this->GetStringWidth(substr($s, $j)."  "), $h, substr($s, $j), 0, 0, '', $fill, $link);
+			}
+		}
+
+		/**
+		* Puts an image in the page. The upper-left corner must be given. The dimensions can be specified in different ways:<ul><li>explicit width and height (expressed in user unit)</li><li>one explicit dimension, the other being calculated automatically in order to keep the original proportions</li><li>no explicit dimension, in which case the image is put at 72 dpi</li></ul>
+		* Supported formats are JPEG and PNG.
+		* For JPEG, all flavors are allowed:<ul><li>gray scales</li><li>true colors (24 bits)</li><li>CMYK (32 bits)</li></ul>
+		* For PNG, are allowed:<ul><li>gray scales on at most 8 bits (256 levels)</li><li>indexed colors</li><li>true colors (24 bits)</li></ul>
+		* but are not supported:<ul><li>Interlacing</li><li>Alpha channel</li></ul>
+		* If a transparent color is defined, it will be taken into account (but will be only interpreted by Acrobat 4 and above).<br />
+		* The format can be specified explicitly or inferred from the file extension.<br />
+		* It is possible to put a link on the image.<br />
+		* Remark: if an image is used several times, only one copy will be embedded in the file.<br />
+		* @param string $file Name of the file containing the image.
+		* @param float $x Abscissa of the upper-left corner.
+		* @param float $y Ordinate of the upper-left corner.
+		* @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated.
+		* @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated.
+		* @param string $type Image format. Possible values are (case insensitive): JPG, JPEG, PNG. If not specified, the type is inferred from the file extension.
+		* @param mixed $link URL or identifier returned by AddLink().
+		* @since 1.1
+		* @see AddLink()
+		*/
+		function Image($file, $x, $y, $w=0, $h=0, $type='', $link='') {
+			//Put an image on the page
+			if(!isset($this->images[$file])) {
+				//First use of image, get info
+				if($type == '') {
+					$pos = strrpos($file,'.');
+					if(empty($pos)) {
+						$this->Error('Image file has no extension and no type was specified: '.$file);
+					}
+					$type = substr($file, $pos+1);
+				}
+				$type = strtolower($type);
+				$mqr = get_magic_quotes_runtime();
+				set_magic_quotes_runtime(0);
+				if($type == 'jpg' or $type == 'jpeg') {
+					$info=$this->_parsejpg($file);
+				}
+				elseif($type == 'png') {
+					$info=$this->_parsepng($file);
+				}
+				else {
+					//Allow for additional formats
+					$mtd='_parse'.$type;
+					if(!method_exists($this,$mtd)) {
+						$this->Error('Unsupported image type: '.$type);
+					}
+					$info=$this->$mtd($file);
+				}
+				set_magic_quotes_runtime($mqr);
+				$info['i']=count($this->images)+1;
+				$this->images[$file]=$info;
+			}
+			else {
+				$info=$this->images[$file];
+			}
+			//Automatic width and height calculation if needed
+			if(($w == 0) and ($h == 0)) {
+				//Put image at 72 dpi
+				// 2004-06-14 :: Nicola Asuni, scale factor where added
+				$w = $info['w'] / ($this->imgscale * $this->k);
+				$h = $info['h'] / ($this->imgscale * $this->k);
+			}
+			if($w == 0) {
+				$w = $h * $info['w'] / $info['h'];
+			}
+			if($h == 0) {
+				$h = $w * $info['h'] / $info['w'];
+			}
+			$this->_out(sprintf('q %.2f 0 0 %.2f %.2f %.2f cm /I%d Do Q', $w*$this->k, $h*$this->k, $x*$this->k, ($this->h-($y+$h))*$this->k, $info['i']));
+			if($link) {
+				$this->Link($x, $y, $w, $h, $link);
+			}
+
+			//2002-07-31 - Nicola Asuni
+			// set right-bottom corner coordinates
+			$this->img_rb_x = $x + $w;
+			$this->img_rb_y = $y + $h;
+		}
+
+		/**
+		* Performs a line break. The current abscissa goes back to the left margin and the ordinate increases by the amount passed in parameter.
+		* @param float $h The height of the break. By default, the value equals the height of the last printed cell.
+		* @since 1.0
+		* @see Cell()
+		*/
+		function Ln($h='') {
+			//Line feed; default value is last cell height
+			$this->x=$this->lMargin;
+			if(is_string($h)) {
+				$this->y+=$this->lasth;
+			}
+			else {
+				$this->y+=$h;
+			}
+		}
+
+		/**
+		* Returns the abscissa of the current position.
+		* @return float
+		* @since 1.2
+		* @see SetX(), GetY(), SetY()
+		*/
+		function GetX() {
+			//Get x position
+			return $this->x;
+		}
+
+		/**
+		* Defines the abscissa of the current position. If the passed value is negative, it is relative to the right of the page.
+		* @param float $x The value of the abscissa.
+		* @since 1.2
+		* @see GetX(), GetY(), SetY(), SetXY()
+		*/
+		function SetX($x) {
+			//Set x position
+			if($x>=0) {
+				$this->x=$x;
+			}
+			else {
+				$this->x=$this->w+$x;
+			}
+		}
+
+		/**
+		* Returns the ordinate of the current position.
+		* @return float
+		* @since 1.0
+		* @see SetY(), GetX(), SetX()
+		*/
+		function GetY() {
+			//Get y position
+			return $this->y;
+		}
+
+		/**
+		* Moves the current abscissa back to the left margin and sets the ordinate. If the passed value is negative, it is relative to the bottom of the page.
+		* @param float $y The value of the ordinate.
+		* @since 1.0
+		* @see GetX(), GetY(), SetY(), SetXY()
+		*/
+		function SetY($y) {
+			//Set y position and reset x
+			$this->x=$this->lMargin;
+			if($y>=0) {
+				$this->y=$y;
+			}
+			else {
+				$this->y=$this->h+$y;
+			}
+		}
+
+		/**
+		* Defines the abscissa and ordinate of the current position. If the passed values are negative, they are relative respectively to the right and bottom of the page.
+		* @param float $x The value of the abscissa
+		* @param float $y The value of the ordinate
+		* @since 1.2
+		* @see SetX(), SetY()
+		*/
+		function SetXY($x, $y) {
+			//Set x and y positions
+			$this->SetY($y);
+			$this->SetX($x);
+		}
+
+		/**
+		* Send the document to a given destination: string, local file or browser. In the last case, the plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.<br />
+		* The method first calls Close() if necessary to terminate the document.
+		* @param string $name The name of the file. If not given, the document will be sent to the browser (destination I) with the name doc.pdf.
+		* @param string $dest Destination where to send the document. It can take one of the following values:<ul><li>I: send the file inline to the browser. The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.</li><li>D: send to the browser and force a file download with the name given by name.</li><li>F: save to a local file with the name given by name.</li><li>S: return the document as a string. name is ignored.</li></ul>If the parameter is not specified but a name is given, destination is F. If no parameter is specified at all, destination is I.<br />Note: for compatibility with previous versions, a boolean value is also accepted (false for F and true for D).
+		* @since 1.0
+		* @see Close()
+		*/
+		function Output($name='',$dest='') {
+			//Output PDF to some destination
+			//Finish document if necessary
+			if($this->state < 3) {
+				$this->Close();
+			}
+			//Normalize parameters
+			if(is_bool($dest)) {
+				$dest=$dest ? 'D' : 'F';
+			}
+			$dest=strtoupper($dest);
+			if($dest=='') {
+				if($name=='') {
+					$name='doc.pdf';
+					$dest='I';
+				} else {
+					$dest='F';
+				}
+			}
+			switch($dest) {
+				case 'I': {
+					//Send to standard output
+					if(ob_get_contents()) {
+						$this->Error('Some data has already been output, can\'t send PDF file');
+					}
+					if(php_sapi_name()!='cli') {
+						//We send to a browser
+						header('Content-Type: application/pdf');
+						if(headers_sent()) {
+							$this->Error('Some data has already been output to browser, can\'t send PDF file');
+						}
+						header('Content-Length: '.strlen($this->buffer));
+						header('Content-disposition: inline; filename="'.$name.'"');
+					}
+					echo $this->buffer;
+					break;
+				}
+				case 'D': {
+					//Download file
+					if(ob_get_contents()) {
+						$this->Error('Some data has already been output, can\'t send PDF file');
+					}
+					if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'],'MSIE')) {
+						header('Content-Type: application/force-download');
+					} else {
+						header('Content-Type: application/octet-stream');
+					}
+					if(headers_sent()) {
+						$this->Error('Some data has already been output to browser, can\'t send PDF file');
+					}
+					header('Content-Length: '.strlen($this->buffer));
+					header('Content-disposition: attachment; filename="'.$name.'"');
+					echo $this->buffer;
+					break;
+				}
+				case 'F': {
+					//Save to local file
+					$f=fopen($name,'wb');
+					if(!$f) {
+						$this->Error('Unable to create output file: '.$name);
+					}
+					fwrite($f,$this->buffer,strlen($this->buffer));
+					fclose($f);
+					break;
+				}
+				case 'S': {
+					//Return as a string
+					return $this->buffer;
+				}
+				default: {
+					$this->Error('Incorrect output destination: '.$dest);
+				}
+			}
+			return '';
+		}
+
+		// var methods
+
+		/**
+		* Check for locale-related bug
+		* @access protected
+		*/
+		function _dochecks() {
+			//Check for locale-related bug
+			if(1.1==1) {
+				$this->Error('Don\'t alter the locale before including class file');
+			}
+			//Check for decimal separator
+			if(sprintf('%.1f',1.0)!='1.0') {
+				setlocale(LC_NUMERIC,'C');
+			}
+		}
+
+		/**
+		* Return fonts path
+		* @access protected
+		*/
+		function _getfontpath() {
+			if(!defined('FPDF_FONTPATH') AND is_dir(dirname(__FILE__).'/font')) {
+				define('FPDF_FONTPATH', dirname(__FILE__).'/font/');
+			}
+			return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : '';
+		}
+
+		/**
+		* Start document
+		* @access protected
+		*/
+		function _begindoc() {
+			//Start document
+			$this->state=1;
+			$this->_out('%PDF-1.3');
+		}
+
+		/**
+		* _putpages
+		* @access protected
+		*/
+		function _putpages() {
+			$nb = $this->page;
+			if(!empty($this->AliasNbPages)) {
+				$nbstr = $this->UTF8ToUTF16BE($nb, false);
+				//Replace number of pages
+				for($n=1;$n<=$nb;$n++) {
+					$this->pages[$n]=str_replace($this->AliasNbPages, $nbstr, $this->pages[$n]);
+				}
+			}
+			if($this->DefOrientation=='P') {
+				$wPt=$this->fwPt;
+				$hPt=$this->fhPt;
+			}
+			else {
+				$wPt=$this->fhPt;
+				$hPt=$this->fwPt;
+			}
+			$filter=($this->compress) ? '/Filter /FlateDecode ' : '';
+			for($n=1;$n<=$nb;$n++) {
+				//Page
+				$this->_newobj();
+				$this->_out('<</Type /Page');
+				$this->_out('/Parent 1 0 R');
+				if(isset($this->OrientationChanges[$n])) {
+					$this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$hPt,$wPt));
+				}
+				$this->_out('/Resources 2 0 R');
+				if(isset($this->PageLinks[$n])) {
+					//Links
+					$annots='/Annots [';
+					foreach($this->PageLinks[$n] as $pl) {
+						$rect=sprintf('%.2f %.2f %.2f %.2f',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]);
+						$annots.='<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] ';
+						if(is_string($pl[4])) {
+							$annots.='/A <</S /URI /URI ('.$this->_escape($pl[4]).')>>>>';
+						}
+						else {
+							$l=$this->links[$pl[4]];
+							$h=isset($this->OrientationChanges[$l[0]]) ? $wPt : $hPt;
+							$annots.=sprintf('/Dest [%d 0 R /XYZ 0 %.2f null]>>',1+2*$l[0],$h-$l[1]*$this->k);
+						}
+					}
+					$this->_out($annots.']');
+				}
+				$this->_out('/Contents '.($this->n+1).' 0 R>>');
+				$this->_out('endobj');
+				//Page content
+				$p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n];
+				$this->_newobj();
+				$this->_out('<<'.$filter.'/Length '.strlen($p).'>>');
+				$this->_putstream($p);
+				$this->_out('endobj');
+			}
+			//Pages root
+			$this->offsets[1]=strlen($this->buffer);
+			$this->_out('1 0 obj');
+			$this->_out('<</Type /Pages');
+			$kids='/Kids [';
+			for($i=0;$i<$nb;$i++) {
+				$kids.=(3+2*$i).' 0 R ';
+			}
+			$this->_out($kids.']');
+			$this->_out('/Count '.$nb);
+			$this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$wPt,$hPt));
+			$this->_out('>>');
+			$this->_out('endobj');
+		}
+
+		/**
+		* Adds fonts
+		* _putfonts
+		* @access protected
+		*/
+		function _putfonts() {
+			$nf=$this->n;
+			foreach($this->diffs as $diff) {
+				//Encodings
+				$this->_newobj();
+				$this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>');
+				$this->_out('endobj');
+			}
+			$mqr=get_magic_quotes_runtime();
+			set_magic_quotes_runtime(0);
+			foreach($this->FontFiles as $file=>$info) {
+				//Font file embedding
+				$this->_newobj();
+				$this->FontFiles[$file]['n']=$this->n;
+				$font='';
+				$f=fopen($this->_getfontpath().$file,'rb',1);
+                //error_log($this->_getfontpath().$file);
+				if(!$f) {
+					$this->Error('Font file not found');
+				}
+				while(!feof($f)) {
+					$font .= fread($f, 8192);
+				}
+				fclose($f);
+				$compressed=(substr($file,-2)=='.z');
+				if(!$compressed && isset($info['length2'])) {
+					$header=(ord($font{0})==128);
+					if($header) {
+						//Strip first binary header
+						$font=substr($font,6);
+					}
+					if($header && ord($font{$info['length1']})==128) {
+						//Strip second binary header
+						$font=substr($font,0,$info['length1']).substr($font,$info['length1']+6);
+					}
+				}
+				$this->_out('<</Length '.strlen($font));
+				if($compressed) {
+					$this->_out('/Filter /FlateDecode');
+				}
+				$this->_out('/Length1 '.$info['length1']);
+				if(isset($info['length2'])) {
+					$this->_out('/Length2 '.$info['length2'].' /Length3 0');
+				}
+				$this->_out('>>');
+				$this->_putstream($font);
+				$this->_out('endobj');
+			}
+			set_magic_quotes_runtime($mqr);
+			foreach($this->fonts as $k=>$font) {
+				//Font objects
+				$this->fonts[$k]['n']=$this->n+1;
+				$type=$font['type'];
+				$name=$font['name'];
+				if($type=='core') {
+					//Standard font
+					$this->_newobj();
+					$this->_out('<</Type /Font');
+					$this->_out('/BaseFont /'.$name);
+					$this->_out('/Subtype /Type1');
+					if($name!='Symbol' && $name!='ZapfDingbats') {
+						$this->_out('/Encoding /WinAnsiEncoding');
+					}
+					$this->_out('>>');
+					$this->_out('endobj');
+				} elseif($type=='Type1' || $type=='TrueType') {
+					//Additional Type1 or TrueType font
+					$this->_newobj();
+					$this->_out('<</Type /Font');
+					$this->_out('/BaseFont /'.$name);
+					$this->_out('/Subtype /'.$type);
+					$this->_out('/FirstChar 32 /LastChar 255');
+					$this->_out('/Widths '.($this->n+1).' 0 R');
+					$this->_out('/FontDescriptor '.($this->n+2).' 0 R');
+					if($font['enc']) {
+						if(isset($font['diff'])) {
+							$this->_out('/Encoding '.($nf+$font['diff']).' 0 R');
+						} else {
+							$this->_out('/Encoding /WinAnsiEncoding');
+						}
+					}
+					$this->_out('>>');
+					$this->_out('endobj');
+					//Widths
+					$this->_newobj();
+					$cw=&$font['cw'];
+					$s='[';
+					for($i=32;$i<=255;$i++) {
+						$s.=$cw[chr($i)].' ';
+					}
+					$this->_out($s.']');
+					$this->_out('endobj');
+					//Descriptor
+					$this->_newobj();
+					$s='<</Type /FontDescriptor /FontName /'.$name;
+					foreach($font['desc'] as $k=>$v) {
+						$s.=' /'.$k.' '.$v;
+					}
+					$file = $font['file'];
+					if($file) {
+						$s.=' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R';
+					}
+					$this->_out($s.'>>');
+					$this->_out('endobj');
+				} else {
+					//Allow for additional types
+					$mtd='_put'.strtolower($type);
+					if(!method_exists($this, $mtd)) {
+						$this->Error('Unsupported font type: '.$type);
+					}
+					$this->$mtd($font);
+				}
+			}
+		}
+
+		/**
+		* _putimages
+		* @access protected
+		*/
+		function _putimages() {
+			$filter=($this->compress) ? '/Filter /FlateDecode ' : '';
+			reset($this->images);
+			while(list($file,$info)=each($this->images)) {
+				$this->_newobj();
+				$this->images[$file]['n']=$this->n;
+				$this->_out('<</Type /XObject');
+				$this->_out('/Subtype /Image');
+				$this->_out('/Width '.$info['w']);
+				$this->_out('/Height '.$info['h']);
+				if($info['cs']=='Indexed') {
+					$this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]');
+				}
+				else {
+					$this->_out('/ColorSpace /'.$info['cs']);
+					if($info['cs']=='DeviceCMYK') {
+						$this->_out('/Decode [1 0 1 0 1 0 1 0]');
+					}
+				}
+				$this->_out('/BitsPerComponent '.$info['bpc']);
+				if(isset($info['f'])) {
+					$this->_out('/Filter /'.$info['f']);
+				}
+				if(isset($info['parms'])) {
+					$this->_out($info['parms']);
+				}
+				if(isset($info['trns']) and is_array($info['trns'])) {
+					$trns='';
+					for($i=0;$i<count($info['trns']);$i++) {
+						$trns.=$info['trns'][$i].' '.$info['trns'][$i].' ';
+					}
+					$this->_out('/Mask ['.$trns.']');
+				}
+				$this->_out('/Length '.strlen($info['data']).'>>');
+				$this->_putstream($info['data']);
+				unset($this->images[$file]['data']);
+				$this->_out('endobj');
+				//Palette
+				if($info['cs']=='Indexed') {
+					$this->_newobj();
+					$pal=($this->compress) ? gzcompress($info['pal']) : $info['pal'];
+					$this->_out('<<'.$filter.'/Length '.strlen($pal).'>>');
+					$this->_putstream($pal);
+					$this->_out('endobj');
+				}
+			}
+		}
+
+		/**
+		* _putxobjectdict
+		* @access protected
+		*/
+		function _putxobjectdict() {
+			foreach($this->images as $image) {
+				$this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
+			}
+		}
+
+		/**
+		* _putresourcedict
+		* @access protected
+		*/
+		function _putresourcedict(){
+			$this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
+			$this->_out('/Font <<');
+			foreach($this->fonts as $font) {
+				$this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
+			}
+			$this->_out('>>');
+			$this->_out('/XObject <<');
+			$this->_putxobjectdict();
+			$this->_out('>>');
+		}
+
+		/**
+		* _putresources
+		* @access protected
+		*/
+		function _putresources() {
+			$this->_putfonts();
+			$this->_putimages();
+			//Resource dictionary
+			$this->offsets[2]=strlen($this->buffer);
+			$this->_out('2 0 obj');
+			$this->_out('<<');
+			$this->_putresourcedict();
+			$this->_out('>>');
+			$this->_out('endobj');
+		}
+		
+		/**
+		* _putinfo
+		* @access protected
+		*/
+		function _putinfo() {
+			$this->_out('/Producer '.$this->_textstring(PDF_PRODUCER));
+			if(!empty($this->title)) {
+				$this->_out('/Title '.$this->_textstring($this->title));
+			}
+			if(!empty($this->subject)) {
+				$this->_out('/Subject '.$this->_textstring($this->subject));
+			}
+			if(!empty($this->author)) {
+				$this->_out('/Author '.$this->_textstring($this->author));
+			}
+			if(!empty($this->keywords)) {
+				$this->_out('/Keywords '.$this->_textstring($this->keywords));
+			}
+			if(!empty($this->creator)) {
+				$this->_out('/Creator '.$this->_textstring($this->creator));
+			}
+			$this->_out('/CreationDate '.$this->_textstring('D:'.date('YmdHis')));
+		}
+
+		/**
+		* _putcatalog
+		* @access protected
+		*/
+		function _putcatalog() {
+			$this->_out('/Type /Catalog');
+			$this->_out('/Pages 1 0 R');
+			if($this->ZoomMode=='fullpage') {
+				$this->_out('/OpenAction [3 0 R /Fit]');
+			}
+			elseif($this->ZoomMode=='fullwidth') {
+				$this->_out('/OpenAction [3 0 R /FitH null]');
+			}
+			elseif($this->ZoomMode=='real') {
+				$this->_out('/OpenAction [3 0 R /XYZ null null 1]');
+			}
+			elseif(!is_string($this->ZoomMode)) {
+				$this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode/100).']');
+			}
+			if($this->LayoutMode=='single') {
+				$this->_out('/PageLayout /SinglePage');
+			}
+			elseif($this->LayoutMode=='continuous') {
+				$this->_out('/PageLayout /OneColumn');
+			}
+			elseif($this->LayoutMode=='two') {
+				$this->_out('/PageLayout /TwoColumnLeft');
+			}
+		}
+
+		/**
+		* _puttrailer
+		* @access protected
+		*/
+		function _puttrailer() {
+			$this->_out('/Size '.($this->n+1));
+			$this->_out('/Root '.$this->n.' 0 R');
+			$this->_out('/Info '.($this->n-1).' 0 R');
+		}
+
+		/**
+		* _putheader
+		* @access protected
+		*/
+		function _putheader() {
+			$this->_out('%PDF-'.$this->PDFVersion);
+		}
+
+		/**
+		* _enddoc
+		* @access protected
+		*/
+		function _enddoc() {
+			$this->_putheader();
+			$this->_putpages();
+			$this->_putresources();
+			//Info
+			$this->_newobj();
+			$this->_out('<<');
+			$this->_putinfo();
+			$this->_out('>>');
+			$this->_out('endobj');
+			//Catalog
+			$this->_newobj();
+			$this->_out('<<');
+			$this->_putcatalog();
+			$this->_out('>>');
+			$this->_out('endobj');
+			//Cross-ref
+			$o=strlen($this->buffer);
+			$this->_out('xref');
+			$this->_out('0 '.($this->n+1));
+			$this->_out('0000000000 65535 f ');
+			for($i=1;$i<=$this->n;$i++) {
+				$this->_out(sprintf('%010d 00000 n ',$this->offsets[$i]));
+			}
+			//Trailer
+			$this->_out('trailer');
+			$this->_out('<<');
+			$this->_puttrailer();
+			$this->_out('>>');
+			$this->_out('startxref');
+			$this->_out($o);
+			$this->_out('%%EOF');
+			$this->state=3;
+		}
+
+		/**
+		* _beginpage
+		* @access protected
+		*/
+		function _beginpage($orientation) {
+			$this->page++;
+			$this->pages[$this->page]='';
+			$this->state=2;
+			$this->x=$this->lMargin;
+			$this->y=$this->tMargin;
+			$this->FontFamily='';
+			//Page orientation
+			if(empty($orientation)) {
+				$orientation=$this->DefOrientation;
+			}
+			else {
+				$orientation=strtoupper($orientation{0});
+				if($orientation!=$this->DefOrientation) {
+					$this->OrientationChanges[$this->page]=true;
+				}
+			}
+			if($orientation!=$this->CurOrientation) {
+				//Change orientation
+				if($orientation=='P') {
+					$this->wPt=$this->fwPt;
+					$this->hPt=$this->fhPt;
+					$this->w=$this->fw;
+					$this->h=$this->fh;
+				}
+				else {
+					$this->wPt=$this->fhPt;
+					$this->hPt=$this->fwPt;
+					$this->w=$this->fh;
+					$this->h=$this->fw;
+				}
+				$this->PageBreakTrigger=$this->h-$this->bMargin;
+				$this->CurOrientation=$orientation;
+			}
+		}
+
+		/**
+		* End of page contents
+		* @access protected
+		*/
+		function _endpage() {
+			$this->state=1;
+		}
+
+		/**
+		* Begin a new object
+		* @access protected
+		*/
+		function _newobj() {
+			$this->n++;
+			$this->offsets[$this->n]=strlen($this->buffer);
+			$this->_out($this->n.' 0 obj');
+		}
+
+		/**
+		* Underline text
+		* @access protected
+		*/
+		function _dounderline($x,$y,$txt) {
+			$up = $this->CurrentFont['up'];
+			$ut = $this->CurrentFont['ut'];
+			$w = $this->GetStringWidth($txt) + $this->ws * substr_count($txt,' ');
+			return sprintf('%.2f %.2f %.2f %.2f re f', $x * $this->k, ($this->h - ($y - $up / 1000 * $this->FontSize)) * $this->k, $w * $this->k, -$ut / 1000 * $this->FontSizePt);
+		}
+
+		/**
+		* Extract info from a JPEG file
+		* @access protected
+		*/
+		function _parsejpg($file) {
+			$a=GetImageSize($file);
+			if(empty($a)) {
+				$this->Error('Missing or incorrect image file: '.$file);
+			}
+			if($a[2]!=2) {
+				$this->Error('Not a JPEG file: '.$file);
+			}
+			if(!isset($a['channels']) or $a['channels']==3) {
+				$colspace='DeviceRGB';
+			}
+			elseif($a['channels']==4) {
+				$colspace='DeviceCMYK';
+			}
+			else {
+				$colspace='DeviceGray';
+			}
+			$bpc=isset($a['bits']) ? $a['bits'] : 8;
+			//Read whole file
+			$f=fopen($file,'rb');
+			$data='';
+			while(!feof($f)) {
+				$data.=fread($f,4096);
+			}
+			fclose($f);
+			return array('w'=>$a[0],'h'=>$a[1],'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data);
+		}
+
+		/**
+		* Extract info from a PNG file
+		* @access protected
+		*/
+		function _parsepng($file) {
+			$f=fopen($file,'rb');
+			if(empty($f)) {
+				$this->Error('Can\'t open image file: '.$file);
+			}
+			//Check signature
+			if(fread($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) {
+				$this->Error('Not a PNG file: '.$file);
+			}
+			//Read header chunk
+			fread($f,4);
+			if(fread($f,4)!='IHDR') {
+				$this->Error('Incorrect PNG file: '.$file);
+			}
+			$w=$this->_freadint($f);
+			$h=$this->_freadint($f);
+			$bpc=ord(fread($f,1));
+			if($bpc>8) {
+				$this->Error('16-bit depth not supported: '.$file);
+			}
+			$ct=ord(fread($f,1));
+			if($ct==0) {
+				$colspace='DeviceGray';
+			}
+			elseif($ct==2) {
+				$colspace='DeviceRGB';
+			}
+			elseif($ct==3) {
+				$colspace='Indexed';
+			}
+			else {
+				$this->Error('Alpha channel not supported: '.$file);
+			}
+			if(ord(fread($f,1))!=0) {
+				$this->Error('Unknown compression method: '.$file);
+			}
+			if(ord(fread($f,1))!=0) {
+				$this->Error('Unknown filter method: '.$file);
+			}
+			if(ord(fread($f,1))!=0) {
+				$this->Error('Interlacing not supported: '.$file);
+			}
+			fread($f,4);
+			$parms='/DecodeParms <</Predictor 15 /Colors '.($ct==2 ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w.'>>';
+			//Scan chunks looking for palette, transparency and image data
+			$pal='';
+			$trns='';
+			$data='';
+			do {
+				$n=$this->_freadint($f);
+				$type=fread($f,4);
+				if($type=='PLTE') {
+					//Read palette
+					$pal=fread($f,$n);
+					fread($f,4);
+				}
+				elseif($type=='tRNS') {
+					//Read transparency info
+					$t=fread($f,$n);
+					if($ct==0) {
+						$trns=array(ord(substr($t,1,1)));
+					}
+					elseif($ct==2) {
+						$trns=array(ord(substr($t,1,1)),ord(substr($t,3,1)),ord(substr($t,5,1)));
+					}
+					else {
+						$pos=strpos($t,chr(0));
+						if($pos!==false) {
+							$trns=array($pos);
+						}
+					}
+					fread($f,4);
+				}
+				elseif($type=='IDAT') {
+					//Read image data block
+					$data.=fread($f,$n);
+					fread($f,4);
+				}
+				elseif($type=='IEND') {
+					break;
+				}
+				else {
+					fread($f,$n+4);
+				}
+			}
+			while($n);
+			if($colspace=='Indexed' and empty($pal)) {
+				$this->Error('Missing palette in '.$file);
+			}
+			fclose($f);
+			return array('w'=>$w, 'h'=>$h, 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'FlateDecode', 'parms'=>$parms, 'pal'=>$pal, 'trns'=>$trns, 'data'=>$data);
+		}
+
+		/**
+		* Read a 4-byte integer from file
+		* @access protected
+		*/
+		function _freadint($f) {
+			//Read a 4-byte integer from file
+			$a=unpack('Ni',fread($f,4));
+			return $a['i'];
+		}
+
+		/**
+		* Format a text string
+		* @access protected
+		*/
+		function _textstring($s) {
+			if($this->isunicode) {
+				//Convert string to UTF-16BE
+				$s = $this->UTF8ToUTF16BE($s, true);
+			}
+			return '('. $this->_escape($s).')';
+		}
+
+		/**
+		* Format a text string
+		* @access protected
+		*/
+		function _escapetext($s) {
+			if($this->isunicode) {
+				//Convert string to UTF-16BE
+				$s = $this->UTF8ToUTF16BE($s, false);
+			}
+			return $this->_escape($s);
+		}
+
+		/**
+		* Add \ before \, ( and )
+		* @access protected
+		*/
+		function _escape($s) {
+			return strtr($s, array(')' => '\\)', '(' => '\\(', '\\' => '\\\\'));
+		}
+
+		/**
+		*
+		* @access protected
+		*/
+		function _putstream($s) {
+			$this->_out('stream');
+			$this->_out($s);
+			$this->_out('endstream');
+		}
+
+		/**
+		* Add a line to the document
+		* @access protected
+		*/
+		function _out($s) {
+			if($this->state==2) {
+				$this->pages[$this->page] .= $s."\n";
+			}
+			else {
+				$this->buffer .= $s."\n";
+			}
+		}
+
+		/**
+		* Adds unicode fonts.<br>
+		* Based on PDF Reference 1.3 (section 5)
+		* @access protected
+		* @author Nicola Asuni
+		* @since 1.52.0.TC005 (2005-01-05)
+		*/
+		function _puttruetypeunicode($font) {
+			// Type0 Font
+			// A composite font—a font composed of other fonts, organized hierarchically
+			$this->_newobj();
+			$this->_out('<</Type /Font');
+			$this->_out('/Subtype /Type0');
+			$this->_out('/BaseFont /'.$font['name'].'');
+			$this->_out('/Encoding /Identity-H'); //The horizontal identity mapping for 2-byte CIDs; may be used with CIDFonts using any Registry, Ordering, and Supplement values.
+			$this->_out('/DescendantFonts ['.($this->n + 1).' 0 R]');
+			$this->_out('>>');
+			$this->_out('endobj');
+			
+			// CIDFontType2
+			// A CIDFont whose glyph descriptions are based on TrueType font technology
+			$this->_newobj();
+			$this->_out('<</Type /Font');
+			$this->_out('/Subtype /CIDFontType2');
+			$this->_out('/BaseFont /'.$font['name'].'');
+			$this->_out('/CIDSystemInfo '.($this->n + 1).' 0 R'); 
+			$this->_out('/FontDescriptor '.($this->n + 2).' 0 R');
+			if (isset($font['desc']['MissingWidth'])){
+				$this->_out('/DW '.$font['desc']['MissingWidth'].''); // The default width for glyphs in the CIDFont MissingWidth
+			}
+			$w = "";
+			foreach ($font['cw'] as $cid => $width) {
+				$w .= ''.$cid.' ['.$width.'] '; // define a specific width for each individual CID
+			}
+			$this->_out('/W ['.$w.']'); // A description of the widths for the glyphs in the CIDFont
+			$this->_out('/CIDToGIDMap '.($this->n + 3).' 0 R');
+			$this->_out('>>');
+			$this->_out('endobj');
+			
+			// CIDSystemInfo dictionary
+			// A dictionary containing entries that define the character collection of the CIDFont.
+			$this->_newobj();
+			$this->_out('<</Registry (Adobe)'); // A string identifying an issuer of character collections
+			$this->_out('/Ordering (UCS)'); // A string that uniquely names a character collection issued by a specific registry
+			$this->_out('/Supplement 0'); // The supplement number of the character collection.
+			$this->_out('>>');
+			$this->_out('endobj');
+			
+			// Font descriptor
+			// A font descriptor describing the CIDFont’s default metrics other than its glyph widths
+			$this->_newobj();
+			$this->_out('<</Type /FontDescriptor');
+			$this->_out('/FontName /'.$font['name']);
+			foreach ($font['desc'] as $key => $value) {
+				$this->_out('/'.$key.' '.$value);
+			}
+			if ($font['file']) {
+				// A stream containing a TrueType font program
+				$this->_out('/FontFile2 '.$this->FontFiles[$font['file']]['n'].' 0 R');
+			}
+			$this->_out('>>');
+			$this->_out('endobj');
+
+			// Embed CIDToGIDMap
+			// A specification of the mapping from CIDs to glyph indices
+			$this->_newobj();
+			$ctgfile = $this->_getfontpath().$font['ctg'];
+			if(!file_exists($ctgfile)) {
+				$this->Error('Font file not found: '.$ctgfile);
+			}
+			$size = filesize($ctgfile);
+			$this->_out('<</Length '.$size.'');
+			if(substr($ctgfile, -2) == '.z') { // check file extension
+				/* Decompresses data encoded using the public-domain 
+				zlib/deflate compression method, reproducing the 
+				original text or binary data */
+				$this->_out('/Filter /FlateDecode');
+			}
+			$this->_out('>>');
+			$this->_putstream(file_get_contents($ctgfile));
+			$this->_out('endobj');
+		}
+
+		 /**
+		 * Converts UTF-8 strings to codepoints array.<br>
+		 * Invalid byte sequences will be replaced with 0xFFFD (replacement character)<br>
+		 * Based on: http://www.faqs.org/rfcs/rfc3629.html
+		 * <pre>
+		 * 	  Char. number range  |        UTF-8 octet sequence
+		 *       (hexadecimal)    |              (binary)
+		 *    --------------------+-----------------------------------------------
+		 *    0000 0000-0000 007F | 0xxxxxxx
+		 *    0000 0080-0000 07FF | 110xxxxx 10xxxxxx
+		 *    0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
+		 *    0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+		 *    ---------------------------------------------------------------------
+		 *
+		 *   ABFN notation:
+		 *   ---------------------------------------------------------------------
+		 *   UTF8-octets = *( UTF8-char )
+		 *   UTF8-char   = UTF8-1 / UTF8-2 / UTF8-3 / UTF8-4
+		 *   UTF8-1      = %x00-7F
+		 *   UTF8-2      = %xC2-DF UTF8-tail
+		 *
+		 *   UTF8-3      = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) /
+		 *                 %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail )
+		 *   UTF8-4      = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) /
+		 *                 %xF4 %x80-8F 2( UTF8-tail )
+		 *   UTF8-tail   = %x80-BF
+		 *   ---------------------------------------------------------------------
+		 * </pre>
+		 * @param string $str string to process.
+		 * @return array containing codepoints (UTF-8 characters values)
+		 * @access protected
+		 * @author Nicola Asuni
+		 * @since 1.53.0.TC005 (2005-01-05)
+		 */
+		function UTF8StringToArray($str) {
+			if(!$this->isunicode) {
+				return $str; // string is not in unicode
+			}
+			$unicode = array(); // array containing unicode values
+			$bytes  = array(); // array containing single character byte sequences
+			$numbytes  = 1; // number of octetc needed to represent the UTF-8 character
+			
+			$str .= ""; // force $str to be a string
+			$length = strlen($str);
+			
+			for($i = 0; $i < $length; $i++) {
+				$char = ord($str{$i}); // get one string character at time
+				if(count($bytes) == 0) { // get starting octect
+					if ($char <= 0x7F) {
+						$unicode[] = $char; // use the character "as is" because is ASCII
+						$numbytes = 1;
+					} elseif (($char >> 0x05) == 0x06) { // 2 bytes character (0x06 = 110 BIN)
+						$bytes[] = ($char - 0xC0) << 0x06; 
+						$numbytes = 2;
+					} elseif (($char >> 0x04) == 0x0E) { // 3 bytes character (0x0E = 1110 BIN)
+						$bytes[] = ($char - 0xE0) << 0x0C; 
+						$numbytes = 3;
+					} elseif (($char >> 0x03) == 0x1E) { // 4 bytes character (0x1E = 11110 BIN)
+						$bytes[] = ($char - 0xF0) << 0x12; 
+						$numbytes = 4;
+					} else {
+						// use replacement character for other invalid sequences
+						$unicode[] = 0xFFFD;
+						$bytes = array();
+						$numbytes = 1;
+					}
+				} elseif (($char >> 0x06) == 0x02) { // bytes 2, 3 and 4 must start with 0x02 = 10 BIN
+					$bytes[] = $char - 0x80;
+					if (count($bytes) == $numbytes) {
+						// compose UTF-8 bytes to a single unicode value
+						$char = $bytes[0];
+						for($j = 1; $j < $numbytes; $j++) {
+							$char += ($bytes[$j] << (($numbytes - $j - 1) * 0x06));
+						}
+						if ((($char >= 0xD800) AND ($char <= 0xDFFF)) OR ($char >= 0x10FFFF)) {
+							/* The definition of UTF-8 prohibits encoding character numbers between
+							U+D800 and U+DFFF, which are reserved for use with the UTF-16
+							encoding form (as surrogate pairs) and do not directly represent
+							characters. */
+							$unicode[] = 0xFFFD; // use replacement character
+						}
+						else {
+							$unicode[] = $char; // add char to array
+						}
+						// reset data for next char
+						$bytes = array(); 
+						$numbytes = 1;
+					}
+				} else {
+					// use replacement character for other invalid sequences
+					$unicode[] = 0xFFFD;
+					$bytes = array();
+					$numbytes = 1;
+				}
+			}
+			return $unicode;
+		}
+		
+		/**
+		 * Converts UTF-8 strings to UTF16-BE.<br>
+		 * Based on: http://www.faqs.org/rfcs/rfc2781.html
+	 	 * <pre>
+		 *   Encoding UTF-16:
+		 * 
+ 		 *   Encoding of a single character from an ISO 10646 character value to
+		 *    UTF-16 proceeds as follows. Let U be the character number, no greater
+		 *    than 0x10FFFF.
+		 * 
+		 *    1) If U < 0x10000, encode U as a 16-bit unsigned integer and
+		 *       terminate.
+		 * 
+		 *    2) Let U' = U - 0x10000. Because U is less than or equal to 0x10FFFF,
+		 *       U' must be less than or equal to 0xFFFFF. That is, U' can be
+		 *       represented in 20 bits.
+		 * 
+		 *    3) Initialize two 16-bit unsigned integers, W1 and W2, to 0xD800 and
+		 *       0xDC00, respectively. These integers each have 10 bits free to
+		 *       encode the character value, for a total of 20 bits.
+		 * 
+		 *    4) Assign the 10 high-order bits of the 20-bit U' to the 10 low-order
+		 *       bits of W1 and the 10 low-order bits of U' to the 10 low-order
+		 *       bits of W2. Terminate.
+		 * 
+		 *    Graphically, steps 2 through 4 look like:
+		 *    U' = yyyyyyyyyyxxxxxxxxxx
+		 *    W1 = 110110yyyyyyyyyy
+		 *    W2 = 110111xxxxxxxxxx
+		 * </pre>
+		 * @param string $str string to process.
+		 * @param boolean $setbom if true set the Byte Order Mark (BOM = 0xFEFF)
+		 * @return string
+		 * @access protected
+		 * @author Nicola Asuni
+		 * @since 1.53.0.TC005 (2005-01-05)
+		 * @uses UTF8StringToArray
+		 */
+		function UTF8ToUTF16BE($str, $setbom=true) {
+			if(!$this->isunicode) {
+				return $str; // string is not in unicode
+			}
+			$outstr = ""; // string to be returned
+			$unicode = $this->UTF8StringToArray($str); // array containing UTF-8 unicode values
+			$numitems = count($unicode);
+			
+			if ($setbom) {
+				$outstr .= "\xFE\xFF"; // Byte Order Mark (BOM)
+			}
+			foreach($unicode as $char) {
+				if($char == 0xFFFD) {
+					$outstr .= "\xFF\xFD"; // replacement character
+				} elseif ($char < 0x10000) {
+					$outstr .= chr($char >> 0x08);
+					$outstr .= chr($char & 0xFF);
+				} else {
+					$char -= 0x10000;
+					$w1 = 0xD800 | ($char >> 0x10);
+					$w2 = 0xDC00 | ($char & 0x3FF);	
+					$outstr .= chr($w1 >> 0x08);
+					$outstr .= chr($w1 & 0xFF);
+					$outstr .= chr($w2 >> 0x08);
+					$outstr .= chr($w2 & 0xFF);
+				}
+			}
+			return $outstr;
+		}
+		
+		// ====================================================
+		
+		/**
+	 	 * Set header font.
+		 * @param array $font font
+		 * @since 1.1
+		 */
+		function setHeaderFont($font) {
+			$this->header_font = $font;
+		}
+		
+		/**
+	 	 * Set footer font.
+		 * @param array $font font
+		 * @since 1.1
+		 */
+		function setFooterFont($font) {
+			$this->footer_font = $font;
+		}
+		
+		/**
+	 	 * Set language array.
+		 * @param array $language
+		 * @since 1.1
+		 */
+		function setLanguageArray($language) {
+			$this->l = $language;
+		}
+		
+		/**
+	 	 * Set document barcode.
+		 * @param string $bc barcode
+		 */
+		function setBarcode($bc="") {
+			$this->barcode = $bc;
+		}
+		
+		/**
+	 	 * Print Barcode.
+		 * @param int $x x position in user units
+		 * @param int $y y position in user units
+		 * @param int $w width in user units
+		 * @param int $h height position in user units
+		 * @param string $type type of barcode (I25, C128A, C128B, C128C, C39)
+		 * @param string $style barcode style
+		 * @param string $font font for text
+		 * @param int $xres x resolution
+		 * @param string $code code to print
+		 */
+		function writeBarcode($x, $y, $w, $h, $type, $style, $font, $xres, $code) {
+			require_once("barcode/barcode.php");
+			require_once("barcode/i25object.php");
+			require_once("barcode/c39object.php");
+			require_once("barcode/c128aobject.php");
+			require_once("barcode/c128bobject.php");
+			require_once("barcode/c128cobject.php");
+			
+			if (empty($code)) {
+				return;
+			}
+			
+			if (empty($style)) {
+				$style  = BCS_ALIGN_LEFT;
+				$style |= BCS_IMAGE_PNG;
+				$style |= BCS_TRANSPARENT;
+				//$style |= BCS_BORDER;
+				//$style |= BCS_DRAW_TEXT;
+				//$style |= BCS_STRETCH_TEXT;
+				//$style |= BCS_REVERSE_COLOR;
+			}
+			if (empty($font)) {$font = BCD_DEFAULT_FONT;}
+			if (empty($xres)) {$xres = BCD_DEFAULT_XRES;}
+			
+			$scale_factor = 1.5 * $xres * $this->k;
+			$bc_w = round($w * $scale_factor); //width in points
+			$bc_h = round($h * $scale_factor); //height in points
+			
+			switch (strtoupper($type)) {
+				case "I25": {
+					$obj = new I25Object($bc_w, $bc_h, $style, $code);
+					break;
+				}
+				case "C128A": {
+					$obj = new C128AObject($bc_w, $bc_h, $style, $code);
+					break;
+				}
+				default:
+				case "C128B": {
+					$obj = new C128BObject($bc_w, $bc_h, $style, $code);
+					break;
+				}
+				case "C128C": {
+					$obj = new C128CObject($bc_w, $bc_h, $style, $code);
+					break;
+				}
+				case "C39": {
+					$obj = new C39Object($bc_w, $bc_h, $style, $code);
+					break;
+				}
+			}
+			
+			$obj->SetFont($font);   
+			$obj->DrawObject($xres);
+			
+			//use a temporary file....
+			$tmpName = tempnam(K_PATH_CACHE,'img');
+			imagepng($obj->getImage(), $tmpName);
+			$this->Image($tmpName, $x, $y, $w, $h, 'png');
+			$obj->DestroyObject();
+			unset($obj);
+			unlink($tmpName);
+		}
+		
+		/**
+	 	 * Returns the PDF data.
+		 */
+		function getPDFData() {
+			if($this->state < 3) {
+				$this->Close();
+			}
+			return $this->buffer;
+		}
+		
+		// --- HTML PARSER FUNCTIONS ---
+		
+		/**
+		 * Allows to preserve some HTML formatting.<br />
+		 * Supports: h1, h2, h3, h4, h5, h6, b, u, i, a, img, p, br, strong, em, font, blockquote, li, ul, ol, hr, td, th, tr, table, sup, sub, small
+		 * @param string $html text to display
+		 * @param boolean $ln if true add a new line after text (default = true)
+		 * @param int $fill Indicates if the background must be painted (1) or transparent (0). Default value: 0.
+		 */
+		function writeHTML($html, $ln=true, $fill=0) {
+						
+			// store some variables
+			$html=strip_tags($html,"<h1><h2><h3><h4><h5><h6><b><u><i><a><img><p><br><strong><em><font><blockquote><li><ul><ol><hr><td><th><tr><table><sup><sub><small>"); //remove all unsupported tags
+			//replace carriage returns, newlines and tabs
+			$repTable = array("\t" => " ", "\n" => " ", "\r" => " ", "\0" => " ", "\x0B" => " "); 
+			$html = strtr($html, $repTable);
+			$pattern = '/(<[^>]+>)/Uu';
+			$a = preg_split($pattern, $html, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); //explodes the string
+			
+			if (empty($this->lasth)) {
+				//set row height
+				$this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO; 
+			}
+			
+			foreach($a as $key=>$element) {
+				if (!preg_match($pattern, $element)) {
+					//Text
+					if($this->HREF) {
+						$this->addHtmlLink($this->HREF, $element, $fill);
+					}
+					elseif($this->tdbegin) {
+						if((strlen(trim($element)) > 0) AND ($element != "&nbsp;")) {
+							$this->Cell($this->tdwidth, $this->tdheight, $this->unhtmlentities($element), $this->tableborder, '', $this->tdalign, $this->tdbgcolor);
+						}
+						elseif($element == "&nbsp;") {
+							$this->Cell($this->tdwidth, $this->tdheight, '', $this->tableborder, '', $this->tdalign, $this->tdbgcolor);
+						}
+					}
+					else {
+						$this->Write($this->lasth, stripslashes($this->unhtmlentities($element)), '', $fill);
+					}
+				}
+				else {
+					$element = substr($element, 1, -1);
+					//Tag
+					if($element{0}=='/') {
+						$this->closedHTMLTagHandler(strtolower(substr($element, 1)));
+					}
+					else {
+						//Extract attributes
+						// get tag name
+						preg_match('/([a-zA-Z0-9]*)/', $element, $tag);
+						$tag = strtolower($tag[0]);
+						// get attributes
+						preg_match_all('/([^=\s]*)=["\']?([^"\']*)["\']?/', $element, $attr_array, PREG_PATTERN_ORDER);
+						$attr = array(); // reset attribute array
+						while(list($id,$name)=each($attr_array[1])) {
+							$attr[strtolower($name)] = $attr_array[2][$id];
+						}
+						$this->openHTMLTagHandler($tag, $attr, $fill);
+					}
+				}
+			}
+			if ($ln) {
+				$this->Ln($this->lasth);
+			}
+		}
+		
+		/**
+		 * Prints a cell (rectangular area) with optional borders, background color and html text string. The upper-left corner of the cell corresponds to the current position. After the call, the current position moves to the right or to the next line.<br />
+		 * If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.
+		 * @param float $w Cell width. If 0, the cell extends up to the right margin.
+		 * @param float $h Cell minimum height. The cell extends automatically if needed.
+		 * @param float $x upper-left corner X coordinate
+		 * @param float $y upper-left corner Y coordinate
+		 * @param string $html html text to print. Default value: empty string.
+		 * @param mixed $border Indicates if borders must be drawn around the cell. The value can be either a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul>or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul>
+		 * @param int $ln Indicates where the current position should go after the call. Possible values are:<ul><li>0: to the right</li><li>1: to the beginning of the next line</li><li>2: below</li></ul>
+	Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
+		 * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0.
+		 * @see Cell()
+		 */
+		function writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=0) {
+			
+			if (empty($this->lasth)) {
+				//set row height
+				$this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO; 
+			}
+			
+			if (empty($x)) {
+				$x = $this->GetX();
+			}
+			if (empty($y)) {
+				$y = $this->GetY();
+			}
+			
+			// get current page number
+			$pagenum = $this->page;
+			
+			$this->SetX($x);
+			$this->SetY($y);
+					
+			if(empty($w)) {
+				$w = $this->fw - $x - $this->rMargin;
+			}
+			
+			// store original margin values
+			$lMargin = $this->lMargin;
+			$rMargin = $this->rMargin;
+			
+			// set new margin values
+			$this->SetLeftMargin($x);
+			$this->SetRightMargin($this->fw - $x - $w);
+					
+			// calculate remaining vertical space on page
+			$restspace = $this->getPageHeight() - $this->GetY() - $this->getBreakMargin();
+			
+			$this->writeHTML($html, true, $fill); // write html text
+			
+			$currentY =  $this->GetY();
+			
+			// check if a new page has been created
+			if ($this->page > $pagenum) {
+				// design a cell around the text on first page
+				$currentpage = $this->page;
+				$this->page = $pagenum;
+				$this->SetY($this->getPageHeight() - $restspace - $this->getBreakMargin());
+				$h = $restspace - 1;
+				$this->Cell($w, $h, "", $border, $ln, 'L', 0);
+				// design a cell around the text on last page
+				$this->page = $currentpage;
+				$h = $currentY - $this->tMargin;
+				$this->SetY($this->tMargin); // put cursor at the beginning of text
+				$this->Cell($w, $h, "", $border, $ln, 'L', 0);
+			} else {
+				$h = max($h, ($currentY - $y));
+				$this->SetY($y); // put cursor at the beginning of text
+				// design a cell around the text
+				$this->Cell($w, $h, "", $border, $ln, 'L', 0);
+			}
+			
+			// restore original margin values
+			$this->SetLeftMargin($lMargin);
+			$this->SetRightMargin($rMargin);
+			
+			if ($ln) {
+				$this->Ln(0);
+			}
+		}
+		
+		/**
+		 * Process opening tags.
+		 * @param string $tag tag name (in uppercase)
+		 * @param string $attr tag attribute (in uppercase)
+		 * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0.
+		 * @access private
+		 */
+		function openHTMLTagHandler($tag, $attr, $fill=0) {
+			//Opening tag
+			switch($tag) {
+				case 'table': {
+					if ((isset($attr['border'])) AND ($attr['border'] != '')) {
+						$this->tableborder = $attr['border'];
+					}
+					else {
+						$this->tableborder = 0;
+					}
+					break;
+				}
+				case 'tr': {
+					break;
+				}
+				case 'td':
+				case 'th': {
+					if ((isset($attr['width'])) AND ($attr['width'] != '')) {
+						$this->tdwidth = ($attr['width']/4);
+					}
+					else {
+						$this->tdwidth = (($this->w - $this->lMargin - $this->rMargin) / $this->default_table_columns);
+					}
+					if ((isset($attr['height'])) AND ($attr['height'] != '')) {
+						$this->tdheight=($attr['height'] / $this->k);
+					}
+					else {
+						$this->tdheight = $this->lasth;
+					}
+					if ((isset($attr['align'])) AND ($attr['align'] != '')) {
+						switch ($attr['align']) {
+							case 'center': {
+								$this->tdalign = "C";
+								break;
+							}
+							case 'right': {
+								$this->tdalign = "R";
+								break;
+							}
+							default:
+							case 'left': {
+								$this->tdalign = "L";
+								break;
+							}
+						}
+					}
+					if ((isset($attr['bgcolor'])) AND ($attr['bgcolor'] != '')) {
+						$coul = $this->convertColorHexToDec($attr['bgcolor']);
+						$this->SetFillColor($coul['R'], $coul['G'], $coul['B']);
+						$this->tdbgcolor=true;
+					}
+					$this->tdbegin=true;
+					break;
+				}
+				case 'hr': {
+					$this->Ln();
+					if ((isset($attr['width'])) AND ($attr['width'] != '')) {
+						$hrWidth = $attr['width'];
+					}
+					else {
+						$hrWidth = $this->w - $this->lMargin - $this->rMargin;
+					}
+					$x = $this->GetX();
+					$y = $this->GetY();
+					$this->SetLineWidth(0.2);
+					$this->Line($x, $y, $x + $hrWidth, $y);
+					$this->SetLineWidth(0.2);
+					$this->Ln();
+					break;
+				}
+				case 'strong': {
+					$this->setStyle('b', true);
+					break;
+				}
+				case 'em': {
+					$this->setStyle('i', true);
+					break;
+				}
+				case 'b':
+				case 'i':
+				case 'u': {
+					$this->setStyle($tag, true);
+					break;
+				}
+				case 'a': {
+					$this->HREF = $attr['href'];
+					break;
+				}
+				case 'img': {
+					if(isset($attr['src'])) {
+						// replace relative path with real server path
+						$attr['src'] = str_replace(K_PATH_URL_CACHE, K_PATH_CACHE, $attr['src']);
+						if(!isset($attr['width'])) {
+							$attr['width'] = 0;
+						}
+						if(!isset($attr['height'])) {
+							$attr['height'] = 0;
+						}
+						
+						$this->Image($attr['src'], $this->GetX(),$this->GetY(), $this->pixelsToMillimeters($attr['width']), $this->pixelsToMillimeters($attr['height']));
+						//$this->SetX($this->img_rb_x);
+						$this->SetY($this->img_rb_y);
+						
+					}
+					break;
+				}
+				case 'ul': {
+					$this->listordered = false;
+					$this->listcount = 0;
+					break;
+				}
+				case 'ol': {
+					$this->listordered = true;
+					$this->listcount = 0;
+					break;
+				}
+				case 'li': {
+					$this->Ln();
+					if ($this->listordered) {
+						$this->lispacer = "    ".(++$this->listcount).". ";
+					}
+					else {
+						//unordered list simbol
+						$this->lispacer = "    -  ";
+					}
+					$this->Write($this->lasth, $this->lispacer, '', $fill);
+					break;
+				}
+				case 'tr':
+				case 'blockquote':
+				case 'br': {
+					$this->Ln();
+					if(strlen($this->lispacer) > 0) {
+						$this->x += $this->GetStringWidth($this->lispacer);
+					}
+					break;
+				}
+				case 'p': {
+					$this->Ln();
+					$this->Ln();
+					break;
+				}
+				case 'sup': {
+					$currentFontSize = $this->FontSize;
+					$this->tempfontsize = $this->FontSizePt;
+					$this->SetFontSize($this->FontSizePt * K_SMALL_RATIO);
+					$this->SetXY($this->GetX(), $this->GetY() - (($currentFontSize - $this->FontSize)*(K_SMALL_RATIO)));
+					break;
+				}
+				case 'sub': {
+					$currentFontSize = $this->FontSize;
+					$this->tempfontsize = $this->FontSizePt;
+					$this->SetFontSize($this->FontSizePt * K_SMALL_RATIO);
+					$this->SetXY($this->GetX(), $this->GetY() + (($currentFontSize - $this->FontSize)*(K_SMALL_RATIO)));
+					break;
+				}
+				case 'small': {
+					$currentFontSize = $this->FontSize;
+					$this->tempfontsize = $this->FontSizePt;
+					$this->SetFontSize($this->FontSizePt * K_SMALL_RATIO);
+					$this->SetXY($this->GetX(), $this->GetY() + (($currentFontSize - $this->FontSize)/3));
+					break;
+				}
+				case 'font': {
+					if (isset($attr['color']) AND $attr['color']!='') {
+						$coul = $this->convertColorHexToDec($attr['color']);
+						$this->SetTextColor($coul['R'],$coul['G'],$coul['B']);
+						$this->issetcolor=true;
+					}
+					if (isset($attr['face']) and in_array(strtolower($attr['face']), $this->fontlist)) {
+						$this->SetFont(strtolower($attr['FACE']));
+						$this->issetfont=true;
+					}
+					if (isset($attr['size'])) {
+						$headsize = intval($attr['size']);
+					} else {
+						$headsize = 0;
+					}
+					$currentFontSize = $this->FontSize;
+					$this->tempfontsize = $this->FontSizePt;
+					$this->SetFontSize($this->FontSizePt + $headsize);
+					$this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO;
+					break;
+				}
+				case 'h1': 
+				case 'h2': 
+				case 'h3': 
+				case 'h4': 
+				case 'h5': 
+				case 'h6': {
+					$headsize = (4 - substr($tag, 1)) * 2;
+					$currentFontSize = $this->FontSize;
+					$this->tempfontsize = $this->FontSizePt;
+					$this->SetFontSize($this->FontSizePt + $headsize);
+					$this->setStyle('b', true);
+					$this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO;
+					break;
+				}
+			}
+		}
+		
+		/**
+		 * Process closing tags.
+		 * @param string $tag tag name (in uppercase)
+		 * @access private
+		 */
+		function closedHTMLTagHandler($tag) {
+			//Closing tag
+			switch($tag) {
+				case 'td':
+				case 'th': {
+					$this->tdbegin = false;
+					$this->tdwidth = 0;
+					$this->tdheight = 0;
+					$this->tdalign = "L";
+					$this->tdbgcolor = false;
+					$this->SetFillColor($this->prevFillColor[0], $this->prevFillColor[1], $this->prevFillColor[2]);
+					break;
+				}
+				case 'tr': {
+					$this->Ln();
+					break;
+				}
+				case 'table': {
+					$this->tableborder=0;
+					break;
+				}
+				case 'strong': {
+					$this->setStyle('b', false);
+				}
+				case 'em': {
+					$this->setStyle('i', false);
+				}
+				case 'b':
+				case 'i':
+				case 'u': {
+					$this->setStyle($tag, false);
+					break;
+				}
+				case 'a': {
+					$this->HREF = '';
+					break;
+				}
+				case 'sup': {
+					$currentFontSize = $this->FontSize;
+					$this->SetFontSize($this->tempfontsize);
+					$this->tempfontsize = $this->FontSizePt;
+					$this->SetXY($this->GetX(), $this->GetY() - (($currentFontSize - $this->FontSize)*(K_SMALL_RATIO)));
+					break;
+				}
+				case 'sub': {
+					$currentFontSize = $this->FontSize;
+					$this->SetFontSize($this->tempfontsize);
+					$this->tempfontsize = $this->FontSizePt;
+					$this->SetXY($this->GetX(), $this->GetY() + (($currentFontSize - $this->FontSize)*(K_SMALL_RATIO)));
+					break;
+				}
+				case 'small': {
+					$currentFontSize = $this->FontSize;
+					$this->SetFontSize($this->tempfontsize);
+					$this->tempfontsize = $this->FontSizePt;
+					$this->SetXY($this->GetX(), $this->GetY() - (($this->FontSize - $currentFontSize)/3));
+					break;
+				}
+				case 'font': {
+					if ($this->issetcolor == true) {
+						$this->SetTextColor($this->prevTextColor[0], $this->prevTextColor[1], $this->prevTextColor[2]);
+					}
+					if ($this->issetfont) {
+						$this->FontFamily = $this->prevFontFamily;
+						$this->FontStyle = $this->prevFontStyle;
+						$this->SetFont($this->FontFamily);
+						$this->issetfont = false;
+					}
+					$currentFontSize = $this->FontSize;
+					$this->SetFontSize($this->tempfontsize);
+					$this->tempfontsize = $this->FontSizePt;
+					//$this->TextColor = $this->prevTextColor;
+					$this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO;
+					break;
+				}
+				case 'ul': {
+					$this->Ln();
+					break;
+				}
+				case 'ol': {
+					$this->Ln();
+					break;
+				}
+				case 'li': {
+					$this->lispacer = "";
+					break;
+				}
+				case 'h1': 
+				case 'h2': 
+				case 'h3': 
+				case 'h4': 
+				case 'h5': 
+				case 'h6': {
+					$currentFontSize = $this->FontSize;
+					$this->SetFontSize($this->tempfontsize);
+					$this->tempfontsize = $this->FontSizePt;
+					$this->setStyle('b', false);
+					$this->Ln();
+					$this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO;
+					break;
+				}
+				default : {
+					break;
+				}
+			}
+		}
+		
+		/**
+		 * Sets font style.
+		 * @param string $tag tag name (in lowercase)
+		 * @param boolean $enable
+		 * @access private
+		 */
+		function setStyle($tag, $enable) {
+			//Modify style and select corresponding font
+			$this->$tag += ($enable ? 1 : -1);
+			$style='';
+			foreach(array('b', 'i', 'u') as $s) {
+				if($this->$s > 0) {
+					$style .= $s;
+				}
+			}
+			$this->SetFont('', $style);
+		}
+		
+		/**
+		 * Output anchor link.
+		 * @param string $url link URL
+		 * @param string $name link name
+		 * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0.
+		 * @access public
+		 */
+		function addHtmlLink($url, $name, $fill=0) {
+			//Put a hyperlink
+			$this->SetTextColor(0, 0, 255);
+			$this->setStyle('u', true);
+			$this->Write($this->lasth, $name, $url, $fill);
+			$this->setStyle('u', false);
+			$this->SetTextColor(0);
+		}
+		
+		/**
+		 * Returns an associative array (keys: R,G,B) from 
+		 * a hex html code (e.g. #3FE5AA).
+		 * @param string $color hexadecimal html color [#rrggbb]
+		 * @return array
+		 * @access private
+		 */
+		function convertColorHexToDec($color = "#000000"){
+			$tbl_color = array();
+			$tbl_color['R'] = hexdec(substr($color, 1, 2));
+			$tbl_color['G'] = hexdec(substr($color, 3, 2));
+			$tbl_color['B'] = hexdec(substr($color, 5, 2));
+			return $tbl_color;
+		}
+		
+		/**
+		 * Converts pixels to millimeters in 72 dpi.
+		 * @param int $px pixels
+		 * @return float millimeters
+		 * @access private
+		 */
+		function pixelsToMillimeters($px){
+			return $px * 25.4 / 72;
+		}
+			
+		/**
+		 * Reverse function for htmlentities.
+		 * Convert entities in UTF-8.
+		 *
+		 * @param $text_to_convert Text to convert.
+		 * @return string converted
+		 */
+		function unhtmlentities($text_to_convert) {
+			require_once(dirname(__FILE__).'/html_entity_decode_php4.php');
+			return html_entity_decode_php4($text_to_convert);
+		}
+	} // END OF CLASS
+
+	//Handle special IE contype request
+	if(isset($_SERVER['HTTP_USER_AGENT']) AND ($_SERVER['HTTP_USER_AGENT']=='contype')) {
+		header('Content-Type: application/pdf');
+		exit;
+	}
+	
+//}
+//============================================================+
+// END OF FILE
+//============================================================+
+?>

Added: incphp/query/json_query_doc.txt
===================================================================
--- incphp/query/json_query_doc.txt	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/query/json_query_doc.txt	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,133 @@
+
+in case no recors found for query, JSON output is 0.
+
+
+
+ Structure of the JSON output of queries
+------------------------------------------
+
+[ 
+
+    [
+        {"name": "countries", 
+         "description": "Countries", 
+         "header": ["@","Name","Area"], 
+         "values":  [ 
+                        [    
+                            {"shplink": ["countries","10","3057923.0500429+2026548.815946+4290283.2615152+3218639.2567819"]}, 
+                            "France", 
+                            "548780908430.388"
+                        ], 
+                        
+                        [   {"shplink": ["countries","18","4010837.8743164+1381902.3825304+5099564.4860098+2701742.8339509"]}, 
+                            "Italy", 
+                            "301635595620.649"
+                        ]
+                    ]
+        } , 
+        
+        {"name": "cities", 
+         "description": "Cities", 
+         "header": ["@","Name","Administrative Entity","Country","Status","Inhabitants"], 
+         "values":  [ 
+                        [
+                            {"shplink": ["cities","284","3756950.5208565+2881684.8778978+3776950.5376764+2901684.9015424"]}, 
+                            {"hyperlink": ["cities","CITY_NAME","Paris","Paris"]}, 
+                            "Ile-del-France", {"hyperlink": ["cities","CNTRY_NAME","France","Link on detail"]}, 
+                            "Provincial capital", 
+                            "1,000,000 to 5,000,000"
+                        ]
+                    ]
+        } 
+    ], 
+    
+    {"allextent": "", "zoomall": false, "autozoom": false, "infoWin": "window"} 
+];
+
+
+
+
+ROOT ARRAY
+----------
+ROOT ARRAY (line 5-41) containing 
+* result ARRAY (7-38)
+* zoom parameters OBJECT (40)
+
+
+    RESULT ARRAY
+    ------------
+    every GROUP is an object, e.g. the group countries line 8-23, cities 25-37
+
+
+        GROUP OBJECT
+        ------------
+        properties: 
+        * name: NAME in map file
+        * description: METADATA "DESCRIPTION" in map file (STRING)
+        * header: METADATA "RESULT_HEADERS" in map file (ARRAY)
+            header ARRAY : list of header values
+            ------------
+        
+        * values: ARRAY of all records (=rows)
+          (same number of elements as 'header' array)
+
+            values ARRAY
+            ------------
+            ARRAY for each record (feature)
+            
+                RECORD ARRAY
+                ------------
+                    list of STRINGS (normal values) and OBJECTS (shplink and hyperlink)
+
+                    shplink OBJECT
+                    --------------
+                    properties: 
+                    ARRAY of 3 values: 
+                        1) group name 
+                        2) feature index in dataset
+                        3) feature extent
+                    NOT existing for WMS layers
+
+                    hyperlink OBJECT
+                    ----------------
+                    properties: 
+                    ARRAY of 4 values: 
+                        1) layer name 
+                        2) field name (as in dataset)
+                        3) field value
+                        4) display name query results
+
+                    'normal' value as STRING
+                
+                
+        
+        
+        
+    ZOOM PARAMETERS OBJECT
+    ----------------------
+    properties:
+    * allextent: 
+        STRING with max zoom extent (search & select/nquery)
+    
+    * zoomall: 
+        false (identify) OR true (search & select/nquery)   
+            if true:  should do: add button/link with max extent 
+        
+    * autozoom: 
+        false: identify (query)
+        "auto": initiate automatic zoom (after search or select)
+                     should do: applying max extent for all retrieved features (from zoomall)
+        "highlight": initiate map refresh to add highlight features to map
+        
+        
+    * infoWin: infoWin settings in config.ini
+        "window" OR "frame"
+        used to determine link target
+        
+                
+    
+
+
+
+
+

Added: incphp/query/query.php
===================================================================
--- incphp/query/query.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/query/query.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,870 @@
+<?php
+
+/*********************************************************************************
+ Copyright (c) 2002-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+
+class Query 
+{ 
+
+    // ======================== PUBLIC FUNCTIONS =====================//
+
+    function Query($map)
+    {
+        $this->map = $map;
+    
+        if (isset($_GET["mode"])) {
+            $this->mode = $_GET["mode"];
+        } else {
+            $this->mode= "search";
+        }
+        
+        if (isset($_GET["imgxy"])) {
+            $imgxy_str = $_GET["imgxy"];
+            $this->imgxy_arr = explode(" ", $imgxy_str);
+        }
+        
+        // Take groups for query from URL or SESSION-ID
+        if (isset($_GET["groups"])) {
+            $this->querygroups[] = $_GET["groups"];
+        } else {
+            $this->querygroups = $_SESSION["groups"];
+        }
+        
+        $this->highlightSelected = $_SESSION["highlightSelected"];
+        //$this->limitResult = $_SESSION["limitResult"];
+        
+        $this->scale     = $_SESSION["geo_scale"];
+        $this->infoWin   = $_SESSION["infoWin"];
+        $this->mapwidth  = $_SESSION["mapwidth"];
+        $this->mapheight = $_SESSION["mapheight"];
+        $this->GEOEXT    = $_SESSION["GEOEXT"];
+        
+        $this->autoZoom = $_SESSION["autoZoom"];
+        $this->zoomAll = $_SESSION["zoomAll"];
+        
+        $this->grouplist = $_SESSION["grouplist"];
+
+        $_SESSION["mode"] = $this->mode;
+        
+        
+        // RESTRICT QUERY TO VISIBLE LAYERS IN THE SCOPE OF CURRENT SCALE
+        if ($this->mode != search) {
+            setGroups($this->map, $this->querygroups, $this->scale, 0, 1);
+        }
+    }
+
+    
+    function q_processQuery()
+    {
+        if ($this->mode != "search") {
+            $this->q_checkZoomSettings();
+            $this->q_setExtents();
+            $this->q_execMapQuery();
+            $this->q_printGroups();
+        } else {
+            $this->q_checkZoomSettings();
+            $this->q_execAttributeQuery();
+            $this->q_printAttributeQuery();
+        }
+        
+        // Write result to session
+        if ($this->mode != "iquery") {
+            $_SESSION['JSON_Results'] = $this->allResStr;
+        }
+    }
+    
+    
+    function q_returnQueryResult()
+    {
+        if ($this->numResultsTotal > 0) {
+            return $this->allResStr;
+        } else {
+            return 0;
+        }
+    }
+    
+    
+    function q_returnNumResultsTotal()
+    {
+        return $this->numResultsTotal;
+    }
+    
+    
+    
+    
+    // ======================== PRIVATE FUNCTIONS =====================//
+    
+    /*
+     * CHECK SETTINGS FOR ZOOM/AUTOZOOM
+     **/
+    function q_checkZoomSettings()
+    {
+        // SELECTION (nquery) and SEARCH: check for zoom settings
+        if ($this->mode != "query") {
+            // Check for autozoom
+            if (preg_match("/$this->mode/i", $this->autoZoom)) {
+                $this->doAutoZoom = 1;
+                $this->zoomFull = 1;
+            }
+            // Check for adding 'Zoom2All' button
+            if (preg_match("/$this->mode/i", $this->zoomAll)) {
+                $this->doZoomAll = 1;
+                $this->zoomFull = 1;
+            }
+            $_SESSION["activegroup"] = $this->querygroups[0];
+        }
+    }    
+
+
+
+    /*
+     * SET MAP EXTENTS
+     **/
+    function q_setExtents()
+    {
+        $this->minx_geo = $this->GEOEXT["minx"];
+        $this->maxx_geo = $this->GEOEXT["maxx"];
+        $this->miny_geo = $this->GEOEXT["miny"];
+        $this->maxy_geo = $this->GEOEXT["maxy"];
+        
+        $this->xdelta_geo = $this->maxx_geo - $this->minx_geo;
+        $this->ydelta_geo = $this->maxy_geo - $this->miny_geo;
+    }
+
+
+    /*
+     * EXECUTE QUERY 
+     **/
+    function q_execMapQuery()
+    {
+        // query by point
+        if (count($this->imgxy_arr) == 2) {
+            $this->pointQuery = 1;
+            
+            $this->x_pix = $this->imgxy_arr[0];
+            $this->y_pix = $this->imgxy_arr[1];
+        
+            $x_geo = $this->minx_geo + (($this->x_pix/$this->mapwidth) * $this->xdelta_geo);
+            $y_geo = $this->maxy_geo - (($this->y_pix/$this->mapheight) * $this->ydelta_geo);
+        
+            $XY_geo = ms_newPointObj();
+            $XY_geo->setXY($x_geo, $y_geo);
+        
+            $searchArea = -1;   // ===> USE TOLERANCE IN MAP FILE FOR EACH LAYER <===
+            
+            // Set $this->map->extent to values of current map extent
+            // otherwise values of TOLERANCE in map file are not interpreted correctly
+            $this->map->setExtent($this->GEOEXT['minx'], $this->GEOEXT['miny'], $this->GEOEXT['maxx'], $this->GEOEXT['maxy']);
+            
+            // Use '@' to avoid warning if query found nothing
+            @$this->map->queryByPoint($XY_geo, MS_MULTIPLE, $searchArea);
+            $XY_geo->free();
+        
+        // query by Rectangle
+        } else {
+            $this->pointQuery = 0;
+            
+            $minx_pix = $this->imgxy_arr[0];
+            $miny_pix = $this->imgxy_arr[1];
+            $maxx_pix = $this->imgxy_arr[2];
+            $maxy_pix = $this->imgxy_arr[3];
+            
+            if ($minx_pix == $maxx_pix) $maxx_pix = $maxx_pix + 2;  // increase max extent if min==max
+            if ($miny_pix == $maxy_pix) $maxy_pix = $maxy_pix - 2;  // -- " --
+            
+            $this->minx_sel_geo = $this->minx_geo + (($minx_pix/$this->mapwidth)  * $this->xdelta_geo);
+            $this->miny_sel_geo = $this->maxy_geo - (($maxy_pix/$this->mapheight) * $this->ydelta_geo);
+            $this->maxx_sel_geo = $this->minx_geo + (($maxx_pix/$this->mapwidth)  * $this->xdelta_geo);
+            $this->maxy_sel_geo = $this->maxy_geo - (($miny_pix/$this->mapheight) * $this->ydelta_geo);
+        
+            $selrect = ms_newrectObj();
+            $selrect->setextent($this->minx_sel_geo, $this->miny_sel_geo, $this->maxx_sel_geo, $this->maxy_sel_geo);
+                 
+            @$this->map->queryByRect($selrect);
+            $selrect->free();
+            
+            //$queryFile = "d:/webdoc/tmp/qresults.txt";
+            //$savedq = $this->map->savequery($queryFile);
+            //printDebug($this->map->loadquery($queryFile));
+            //error_log(
+        }
+        
+        
+    
+    }
+    
+
+    
+    /*
+     * PRINT RESULTS FOR GROUP
+     **/
+    function q_printGroups()
+    {
+        $this->numResultsTotal = 0;
+        $this->allResStr = "[ [";
+        
+        // Write results for all query groups
+        $c = 0;
+        
+        foreach ($this->grouplist as $grp){
+            if (in_array($grp->groupName, $this->querygroups, TRUE)) {
+        
+                $this->selHeaders = $grp->getResHeaders();
+                $glayerList = $grp->getLayers();
+        
+                $this->grpNumResults = 0;
+                $lp = 1;  
+                
+                // Process all layers for group 
+                $this->layersResStr = "";
+                $glayerListCount = count($glayerList);
+                $this->lc = 0;
+                foreach ($glayerList as $l) {
+                    $this->glayer = $l;
+                    $layType = $this->q_printLayer();      //@@@@@@// 
+                    
+                    // Add comma separator if more than one layer per group adds result row
+                    if ($this->query && $layType != 4) {
+                        if ($this->query->getLayNumResults() > 0 ) {
+                            $this->lc++;
+                        }
+                    }
+                    
+                    // Unset query variable (otherwise duplicated values in some cases)
+                    unset($this->query);
+                    
+                    
+                }
+                
+                if ($this->grpNumResults > 0) {
+                    //error_log($this->grpNumResults);
+                    if ($c > 0) $this->allResStr .= ", ";
+                    $this->numResultsTotal += $this->grpNumResults;
+                    $this->printGrpResString($grp);
+                    //unset($this->query);
+                    $c++;
+                }
+                
+            }
+        }
+        
+        $zp = $this->q_printZoomParameters();
+        
+        $this->allResStr .= "], $zp ]";
+
+    }
+ 
+ 
+    function printGrpResString($grp)
+    {
+        $grpName = $grp->getGroupName();
+        $grpDesc = $grp->getDescription();
+        
+        $grpResStr .= "{\"name\": \"$grpName\", \"description\": \"$grpDesc\", ";
+        $grpResStr .= $this->fieldHeaderStr;
+        $grpResStr .= $this->layersResStr;
+        $grpResStr .= "]} ";
+
+        $this->allResStr .= $grpResStr;
+    }
+
+ 
+    /*
+     * PRINT RESULTS GROUP LAYER
+     **/
+    function q_printLayer()
+    {
+        $this->qLayer = $this->map->getLayer($this->glayer->getLayerIdx());
+        $resFldList = $this->glayer->getResFields();
+        $qLayerType = $this->qLayer->type;
+        $qLayerConnType = $this->qLayer->connectiontype;
+        $this->qLayerName = $this->qLayer->name;
+
+        // Exclude WMS and annotation layers and layers with no result fields defined
+        if ($qLayerConnType != 7  &&  $qLayerType != 4  &&  $resFldList[0] != '0') {
+            $XYLayerProperties = $this->glayer->getXYLayerProperties();
+            
+            // Normal Layer
+            if (!$XYLayerProperties) {
+                $this->q_printStandardLayer();  //@@@@@@//
+            
+            // XY Layer
+            } else {
+                $this->q_printXYLayer();        //@@@@@@//
+            }
+            
+            if ($this->query) {
+                $this->fieldHeaderStr = $this->query->getFieldHeaderStr($this->selHeaders);
+                $this->colspan = count($this->selHeaders) + 1;
+            }
+            
+            
+        // WMS layer
+        } elseif ($qLayerType == 3 && $qLayerConnType == 7 ) {
+            $this->fieldHeaderStr = "";
+            $this->q_printWMSLayer();           //@@@@@@//
+        }
+        
+        if ($this->query && $qLayerType != 4) {
+            //if ($this->qLayer->getNumResults() > 0) {
+            
+            if ($this->query->getLayNumResults() > 0) {
+                $sep = $this->lc > 0 ? ", " : "";
+                $this->layersResStr .= $sep . $this->query->getResultString(); 
+                $this->grpNumResults += $this->query->getLayNumResults();
+            }
+        }
+        
+        return $qLayerType;
+
+    }
+ 
+ 
+    /*
+     * PRINT RESULTS FOR STANDARD LAYER
+     **/    
+    function q_printStandardLayer()
+    {   
+        if ($this->qLayer->getNumResults() > 0) {
+                                            
+            $this->query = &new DQuery($this->map, $this->qLayer, $this->glayer, $this->zoomFull);
+            
+            // For Select function (nquery): get indexes of result shapes and max extent of all shapes
+            if ($this->mode == "nquery") {
+                $this->resultlayers[$this->qLayerName] = $this->query->returnResultindexes();
+                $resulttilelayers[$this->qLayerName] = $this->query->returnResultTileindexes();
+                $_SESSION['resulttilelayers'] = $resulttilelayers;
+                $this->Extents[] = $this->query->returnMaxExtent();
+            } 
+        }
+    }
+    
+    
+    /*
+     * PRINT RESULTS FOR XY LAYER
+     **/
+    function q_printXYLayer()
+    {
+        $x_geo = $this->minx_geo + (($this->x_pix/$this->mapwidth) * $this->xdelta_geo);
+        $y_geo = $this->maxy_geo - (($this->y_pix/$this->mapheight) * $this->ydelta_geo);
+        $xyLayQueryList["x_geo"]= $x_geo;
+        $xyLayQueryList["y_geo"]= $y_geo;
+        if ($this->pointQuery) {
+            $pixGeoSize = ($this->xdelta_geo/$this->mapwidth);
+            $eAdd = 2;  // search radius in map units
+            $xyLayQueryList["xmin"] = round($x_geo - ($pixGeoSize * $eAdd)); 
+            $xyLayQueryList["ymin"] = round($y_geo - ($pixGeoSize * $eAdd));
+            $xyLayQueryList["xmax"] = round($x_geo + ($pixGeoSize * $eAdd));
+            $xyLayQueryList["ymax"] = round($y_geo + ($pixGeoSize * $eAdd));
+        } else {
+            $xyLayQueryList["xmin"] = $this->minx_sel_geo;
+            $xyLayQueryList["ymin"] = $this->miny_sel_geo;
+            $xyLayQueryList["xmax"] = $this->maxx_sel_geo;
+            $xyLayQueryList["ymax"] = $this->maxy_sel_geo;
+        }                         
+        
+        $this->query = &new XYQuery($this->qLayer, $this->glayer, $xyLayQueryList, 0, $this->zoomFull);
+
+        if ($this->mode == "nquery") {
+            $resultlayers[$this->qLayerName] = $this->query->returnResultindexes();
+            $resulttilelayers[$this->qLayerName] = $this->query->returnResultTileindexes();
+            $this->Extents[] = $this->query->returnMaxExtent();
+        }
+    
+        if ($this->query) {
+            $fieldHeaderStr = $this->query->getFieldHeaderStr($this->selHeaders);
+            $this->colspan = count($this->selHeaders) + 1;
+        }
+    }
+    
+    
+    /*
+     * PRINT RESULTS FOR WMS LAYER
+     **/
+    function q_printWMSLayer()
+    {
+        // Set map width, height and extent for use in WMS query
+        $this->map->set("width", $this->mapwidth);
+        $this->map->set("height", $this->mapheight);
+        $this->map->setextent($this->minx_geo, $this->miny_geo, $this->maxx_geo, $this->maxy_geo);
+        
+        // Run query and print put results
+        $this->query = new WMSQuery($grp, $this->qLayer, $this->x_pix, $this->y_pix );
+        $fieldHeaderStr = $this->query->getFieldHeaderStr($this->selHeaders);
+        $this->colspan = $this->query->colspan;
+    }
+    
+    
+    /*
+     *  PROCESS ZOOM INFO AND SET RESULTLAYERS
+     **/
+    function q_printZoomParameters()
+    {
+        
+        $zp = "{";
+        
+        // Get the maximum extent for more than 1 layer if 'autoZoom' or button 'zoomAll' selcted in config 
+        //print_r($this->Extents);
+        if ($this->zoomFull && $this->numResultsTotal > 0) {
+            //if (!is_array($this->Extents) ) {
+            if (count($this->Extents) < 2) {
+                $allExtStr = join("+", $this->Extents[0]);
+            } else {
+                $minx = $this->Extents[0][0];
+                $miny = $this->Extents[0][1];
+                $maxx = $this->Extents[0][2];
+                $maxy = $this->Extents[0][3];
+        
+                for($i=1; $i<count($this->Extents); $i++) {
+                    $minx = min($minx, $this->Extents[$i][0]);
+                    $miny = min($miny, $this->Extents[$i][1]);
+                    $maxx = max($maxx, $this->Extents[$i][2]);
+                    $maxy = max($maxy, $this->Extents[$i][3]);
+                }
+                $allExtStr = $minx .'+'. $miny .'+'. $maxx .'+'. $maxy;
+            }
+        }
+        
+        
+        $zp .= "\"allextent\": \"$allExtStr\", ";
+        
+        // Add 'Zoom To All' button if 'zoomAll' selcted in config
+        if ($this->doZoomAll && $this->numResultsTotal > 1) {
+            $zp .= "\"zoomall\": true, ";
+        } else {
+            $zp .= "\"zoomall\": false, ";
+        }
+        
+        
+        
+        // Message for more records found than limit set in ini file
+        if ($this->numResultsTotal == $this->limitResult) {
+            
+        }
+        
+        // Autozoom to selected fatures if 'autoZoom' selcted in config
+        if ($this->mode != "query"  && $this->doAutoZoom && $this->numResultsTotal > 0) {
+            $zp .= "\"autozoom\": \"auto\", ";
+        // Re-load map frame to highlight selected features
+        } elseif ($this->mode != "query"  && $this->highlightSelected) {
+            $zp .= "\"autozoom\": \"highlight\", ";
+        } else {
+            $zp .= "\"autozoom\": false, ";
+        }
+        
+        $zp .= "\"infoWin\": \"". $_SESSION['infoWin'] ."\"";
+        
+        $zp .= "}";
+        
+        // Register resultlayers for highlight in case of nquery (selection)
+        if ($this->mode != "query"  &&  $this->mode != "iquery" && $this->highlightSelected && $this->numResultsTotal > 0) {
+            $_SESSION["resultlayers"] = $this->resultlayers;
+        }
+        
+        //$this->allResStr .= $zStr;
+        return $zp;
+
+    }
+    
+    
+
+    
+    
+    /* 
+     * RETURNS THE RESULT STRING (FROM VARABLE $qStr)
+     *********************************************************************/
+    function getResultString()
+    {
+        return $this->qStr;
+    }
+    
+    
+    /* 
+     * RETURNS THE NUMBER OF RECORDS OF THE QUERY RESULT FOR A LAYER
+     *********************************************************************/
+    function getLayNumResults()
+    {
+        return $this->numResults;
+    }
+    
+    
+    // Abstract methods: returnNumResults
+    function setNumResults(){}
+    
+    
+    function returnResultindexes()
+    {
+        return $this->resultindexes;
+    }
+    
+    function returnResultTileindexes()
+    {
+        return $this->resulttileindexes;
+    }
+    
+    
+    
+    /* Return maximum extent for all shapes found in query
+     * used for NQUERY
+     ********************************************************/
+    function returnMaxExtent() 
+    {
+        $bufX = 0.05 *($this->mExtMaxx - $this->mExtMinx);
+        $bufY = 0.05 *($this->mExtMaxy - $this->mExtMiny);
+        $ExtMinx = $this->mExtMinx - $bufX;
+        $ExtMiny = $this->mExtMiny - $bufY;
+        $ExtMaxx = $this->mExtMaxx + $bufX;
+        $ExtMaxy = $this->mExtMaxy + $bufY;
+        
+        if ($ExtMinx == $ExtMaxx || $ExtMiny == $ExtMaxy) {
+            $ExtMinx = $ExtMinx - (abs($bufX * $ExtMinx));
+            $ExtMiny = $ExtMiny - (abs($bufY * $ExtMiny));
+            $ExtMaxx = $ExtMaxx + (abs($bufX * $ExtMaxx));
+            $ExtMaxy = $ExtMaxy + (abs($bufY * $ExtMaxy));
+        }
+
+        $maxExtent = array($ExtMinx, $ExtMiny, $ExtMaxx, $ExtMaxy);
+        
+        return $maxExtent;
+    }
+
+
+   
+    
+    /* RESULT TABLE: FIELD HEADER
+    * Print the table header for every single group/layer
+    ************************************************************************/
+    function getFieldHeaderStr($selHeaders)
+    {
+        $slink = $this->qLayerType != 3 ? "@" : "#";
+        // TABLE HEADER: ATTRIBUTE NAMES...
+        $pStr = "\"header\": [\"$slink\"";
+        for ($iField=0; $iField < sizeof($selHeaders); $iField++) {
+            $pStr .= ",\"" . $selHeaders[$iField] . "\"";
+        }
+        $pStr .= "], \"values\": [ ";
+        
+        return $pStr;
+    }
+    
+    
+    /* RESULT TABLE: FIELD VALUES
+     * Print all field values (except shapeindex) for single layer
+     ***********************************************************************/
+    function printFieldValues($fldName, $fldValue)
+    {
+        // Change format for decimal field values
+        /*
+        if (is_numeric($fldValue)) {
+            if (preg_match('/\./', $fldValue)) {
+                $fldValue = number_format($fldValue, 2, ',', '');
+            }
+        } 
+        */
+        
+        // !!!! ENCODE ALL STRINGS IN UTF-8 !!!!
+        if ($this->layerEncoding) {
+            if ($this->layerEncoding != "UTF-8") {
+                $fldValue = iconv($this->layerEncoding, "UTF-8", $fldValue);
+            }
+        } else {
+            $fldValue = utf8_encode($fldValue);
+        }
+
+
+        // Escape double quote sign
+        //$fldValue = str_replace('"', '\\"', $fldValue);
+        $fldValue = addslashes($fldValue);
+        
+        
+        $valStr = ", ";
+    
+        $hyperFieldList = $this->glayer->getHyperFields();
+        $hyperFieldsValues = $hyperFieldList[0];
+        $hyperFieldsAlias = $hyperFieldList[1];
+    
+        // Check for hyperlinks
+        if (count($hyperFieldsValues) > 0) {
+            if (in_array($fldName, $hyperFieldsValues)) {
+                $valStr .= "{\"hyperlink\": [\"$this->qLayerName\",\"$fldName\",\"$fldValue\",\"";
+                // Print ALIAS if defined
+                if (strlen($hyperFieldsAlias[$fldName]) > 0) {
+                    $valStr .= $hyperFieldsAlias[$fldName];
+                // else field VALUE
+                } else {
+                    $valStr .= $fldValue;
+                }
+                
+                $valStr .= "\"]}";
+           } else {
+                $valStr .= "\"$fldValue\"";
+           }
+           
+        // NO hyperlink so just print normal output
+        } else {
+            $valStr .= "\"$fldValue\"";
+        }
+        
+        return $valStr;
+    }
+    
+    
+    
+    // Connect to DB with jointable, return connection handler
+    function dbConnect($dsn)
+    {
+        $dbh = DB::connect($dsn);
+        if (DB::isError($dbh)) {
+            #die ($dbh->getMessage());
+            db_logErrors($dbh);
+            return NULL;
+        } else {
+            return $dbh;
+        }
+    }
+
+
+
+    /*
+     * SEARCH VIA ATTRIBUTES
+     ****************************************************************************/
+    function q_execAttributeQuery()
+    {
+        $this->qLayerName = $_GET["qlayer"];
+        
+        $getvars =  $_GET;
+        
+        // Return layer type
+        $this->qLayer = $this->map->getLayerByName($this->qLayerName);
+        $this->qLayerType = $this->qLayer->connectiontype;
+        
+        // Get group and glayer objects
+        $GroupGlayer = returnGroupGlayer($this->qLayerName);
+        $this->grp = $GroupGlayer[0];
+        $this->glayer = $GroupGlayer[1];
+        $this->XYLayerProperties = $this->glayer->getXYLayerProperties();
+        
+        $this->layerEncoding = $this->glayer->getLayerEncoding();
+
+        
+        // QUERY ON POSTGIS LAYER
+        if ($this->qLayerType == 6  || $this->XYLayerProperties) {
+            foreach ($getvars as $var => $val0) {
+                if ($var != "PHPSESSID" && $var != "qlayer" && $var != "dbtable" && $var != "findlist" && $var != "mode") {
+                    $val = $this->q_strDecode($_GET["$var"]);
+                    if ($this->qLayerType == 6) {
+                        $varValStr = returnVar($var, $val, "postgis");
+                    } else {
+                        $varValStr = returnVar($var, $val, "db");
+                        //error_log("db");
+                    }
+                    if (strlen(trim($val)) > 0) {
+                        $qStr .= $varValStr . " AND ";
+                    }
+                }
+            }
+        
+            $this->qStr = str_replace(';', ' 0 ERROR 0 ', substr($qStr, 0, -5)) ;
+            //echo $this->qStr;
+            
+        
+        // QUERY ON SHAPEFILE (ETC.) LAYER
+        } else {
+            $qStr = "(";
+        
+            // STANDARD QUERY 
+            foreach ($getvars as $var => $val0) {
+                if ($var != "PHPSESSID" && $var != "qlayer" && $var != "dbtable" && $var != "findlist" && $var != "mode") {
+                    $fldName = preg_replace("/\#|\*/ie", "", $var);
+                    $val = $this->q_strDecode($_GET["$var"]);
+                    $varValStr = returnVar($var, $val, "shape");
+                    
+                    if (strlen(trim($val)) > 0) {
+                        $qStr .= $varValStr . " AND ";
+                    }
+                }
+            }
+            
+            $qStr = substr($qStr, 0, strlen($qStr)-5) . ")";
+            //error_log("$fldName ---- $qStr");
+
+            @$this->qLayer->queryByAttributes($fldName, $qStr, MS_MULTIPLE);
+        
+        }
+    }
+    
+    
+    function q_printAttributeQuery()
+    {
+        $selHeaders = $this->grp->getResHeaders();
+        $this->colspan = count($selHeaders) + 1;
+        
+        // PROCESS QUERY DEPENDING ON LAYER TYPE
+        if ($this->qLayerType == 6) {
+            $this->query = new PGQuery($this->map, $this->qLayer, $this->glayer, $this->qStr, $this->zoomFull);
+        } else {
+            // Normal Layer
+            if (!$this->XYLayerProperties) {
+                $this->query = new DQuery($this->map, $this->qLayer, $this->glayer, $this->zoomFull);
+            } else {
+                //echo $this->qStr;
+                $this->query = new XYQuery($this->qLayer, $this->glayer, $this->qStr, 1, $this->zoomFull);
+            }
+        }
+        
+        
+        $this->layersResStr .= $this->query->getResultString();
+        $this->numResultsTotal += $this->query->getLayNumResults();
+        $this->fieldHeaderStr = $this->query->getFieldHeaderStr($selHeaders);
+        if ($this->numResultsTotal > 0) {
+            $this->resultlayers[$this->qLayerName] = $this->query->returnResultindexes();
+            $resulttilelayers[$this->qLayerName] = $this->query->returnResultTileindexes();
+            $_SESSION['resulttilelayers'] = $resulttilelayers;
+        }
+        $this->Extents[] = $this->query->returnMaxExtent();
+        
+        $this->allResStr = "[ [";
+        $this->printGrpResString($this->grp);
+        
+        $zp = $this->q_printZoomParameters();
+        
+        $this->allResStr .= "], $zp ]";
+
+        //echo "total : $this->numResultsTotal ";
+            
+    }
+
+
+    function q_strDecode($inval)
+    {
+        // DECODE QUERY STRING FROM UTF-8 
+        if ($this->layerEncoding) {
+            if ($this->layerEncoding != "UTF-8") {
+                return iconv("UTF-8", $this->layerEncoding, $inval);
+            } else {
+                return $inval;
+            }
+        } else {
+            return utf8_decode($inval);
+        }
+    }
+
+
+   /* 
+    * Test if layer has the same projection as map
+    ***************************************************/
+    function checkProjection()
+    {
+        $mapProjStr = $this->map->getProjection();
+        $qLayerProjStr = $this->qLayer->getProjection();
+    
+        if ($mapProjStr && $qLayerProjStr && $mapProjStr != $qLayerProjStr) {
+            $changeLayProj = 1;
+            $this->mapProjObj = ms_newprojectionobj($mapProjStr);
+            $this->qLayerProjObj = ms_newprojectionobj($qLayerProjStr);
+        } else {
+            $changeLayProj = 0;
+        }
+        
+        return $changeLayProj;
+    }
+
+
+
+} // END CLASS
+
+
+
+
+
+
+
+/* 
+ * AUXILLIARY FUNCTION FOR ATTRIBUTE SEARCH
+ * returns var and value; 
+ **************************************************/
+function returnVar($var, $val, $datatype)
+{
+    // CHAR Field
+    if ($var{0} == "#") {
+        // SEARCH WITH WILDCARD
+        if ($var{1} == "*") {
+            // Layertype = POSTGIS
+            if ($datatype == "postgis") {
+                $val = addslashes($val);
+                $valStr =  substr($var,2,strlen($var)-1) . " ~* '" . ($val{1} == "*" ? $val : "^". $val) .  (substr($val,-1) == "*" ? "'"  : "$'")  ;
+                $valStr = str_replace("\*", "", $valStr);       // REMOVE WILDCARD * SIGN WITH ESCAPING \ FROM SEARCH STRING
+            
+            } elseif ($datatype == "db") {            
+                $val = addslashes($val);
+                $varStr = "UPPER(" . strtolower(substr($var,2,strlen($var)-1)) . ") LIKE ";
+                $valStr = "'" . str_replace("*", "%", strtoupper($val)) . "'";
+                
+            } else {
+                $varStr = "'[" . strtoupper(substr($var,2,strlen($var)-1)) . "]' =~ ";
+                $val = preg_quote($val);
+                $val = preg_replace("/[a-z]/ie", "'('. strtoupper(\\0) . '|' . strtolower(\\0) .')'", $val);    // FOR CASE-INSENSITIVE QUERY
+                $valStr =  "/" . ($val{1} == "*" ? $val : "^". $val) .  (substr($val,-1) == "*" ? "/"  : "$/")  ;
+                $valStr = str_replace("\*", "", $valStr);       // REMOVE WILDCARD * SIGN WITH ESCAPING \ FROM SEARCH STRING
+            }
+        // SEARCH WITHOUT WILDCARD
+        } else {
+            // Layertype = POSTGIS
+            if ($datatype == "postgis") {
+                $val = addslashes($val);
+                $valStr = substr($var,1,strlen($var)-1) .  " ~* '$val'";
+
+            } elseif ($datatype == "db") {  
+                $val = addslashes($val);
+                $varStr = "UPPER(" . strtolower(substr($var,1,strlen($var)-1)) . ") LIKE ";
+                $valStr = "'%" . strtoupper($val) . "%'";
+            
+            } else {
+                $varStr = "'[" . strtoupper(substr($var,1,strlen($var)-1)) . "]' =~ ";
+                $val = preg_quote($val);
+                $val = preg_replace ("/[a-z]/ie", "'('. strtoupper($0) . '|' . strtolower($0) .')'", $val);    // FOR CASE-INSENSITIVE QUERY
+                // FOR CASE-INSENSITIVE QUERY
+                $valStr =  "/" . $val . "/" ;
+            }
+        }
+
+        return "$varStr $valStr";            
+        
+
+    // NUMERIC Field
+    } else {
+        // Layertype = POSTGIS
+        if ($datatype == "postgis" || $datatype == "db") {
+            $varStr = strtolower($var) . " = ";
+            $valStr = $val ;
+        } else {
+            $varStr = "[" . strtoupper($var) . "] = ";
+            $valStr = $val ;
+        }
+
+        return "$varStr $valStr";            
+    }
+}
+
+
+
+?>
\ No newline at end of file

Added: incphp/query/squery.php
===================================================================
--- incphp/query/squery.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/query/squery.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,775 @@
+<?php
+
+/*********************************************************************************
+ Copyright (c) 2002-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+require_once("query.php");
+
+
+/**********************************************
+ *  STANDARD QUERY RESULTS NORMAL LAYER
+ **********************************************/
+class DQuery extends Query
+{ 
+
+    function DQuery($map, $qLayer, $glayer, $zoomFull)
+    {
+        //$this->QUERY($map);
+        $this->map = $map;
+        $this->qLayer = $qLayer;
+        $this->qLayerName = $this->qLayer->name;
+        $this->qLayerType = $this->qLayer->type;
+        $this->glayer = $glayer;
+        $this->selFields = $glayer->getResFields();
+        $this->zoomFull = $zoomFull;
+        $this->infoWin = $_SESSION["infoWin"];
+        
+        $this->limitResult = $_SESSION["limitResult"];
+        $this->pointBuffer  = $_SESSION["pointBuffer"];
+        $this->layerEncoding = $glayer->getLayerEncoding();
+        
+        // dump results to resultString 
+        $this->dumpQueryResults();
+        //error_log($this->qStr);
+    }
+    
+    
+    function getResultString()
+    {
+        return $this->qStr;
+    }
+    
+    
+    // Get the number of results for query on the layer
+    function setNumResults()
+    {
+        $this->qLayer->open();       
+        $this->numResults = $this->qLayer->getNumResults();
+
+        // Apply limit for query results
+        if ($this->numResults > $this->limitResult) $this->numResults = $this->limitResult;
+    }
+
+
+
+   /**
+    * DUMP QUERY RESULTS INTO QUERY STRING $qStr
+    *******************************************************/
+    function dumpQueryResults()
+    {
+        if ($this->zoomFull) {
+            // Maximum extents
+            $this->mExtMinx = 999999999;
+            $this->mExtMiny = 999999999;
+            $this->mExtMaxx = -999999999;
+            $this->mExtMaxy = -999999999;
+        }
+        
+        $this->returnTableJoinProperties();
+        
+        $this->setNumResults();
+        //error_log($this->numResults);
+        for ($iRes=0; $iRes < $this->numResults; $iRes++) {
+            $qRes = $this->qLayer->getResult($iRes);
+            $qShape = $this->qLayer->getShape($qRes->tileindex,$qRes->shapeindex);
+            
+            $this->qStr .= $this->printResultRow($qShape);
+            $this->qStr .= $iRes < ($this->numResults - 1) ? ", " : "";
+            $this->resultindexes[] = $qRes->shapeindex;
+            $this->resulttileindexes[$qRes->shapeindex] = $qRes->tileindex;
+        }
+        //error_log($this->qStr);
+    }
+
+
+    function printResultRow($qShape)
+    {
+        $this->qStr .= "[";
+        
+        // DO NOT PRINT LINK FOR RASTER LAYERS (TYPE 3), ONLY FOR VECTOR
+        $this->qStr .= ($this->qLayerType != 3 ? $this->printShapeField($qShape) : "\"r\""); 
+        
+        $this->printFields($qShape);
+        $this->qStr .= "]";
+    }
+
+
+
+   /** 
+    * Print SHAPEINDEX COLUMN as HTML hyperlink (for zoom-to-feature link)
+    *************************************************************************/
+    function printShapeField($qShape)
+    {
+        // Add LINK with shape extent and javascript zoom function as new column  //
+        $qShpIdx = $qShape->index;
+        $qShpBounds = $qShape->bounds;
+        $changeLayProj = $this->checkProjection();
+        
+        //$this->resultindexes[] = $qShpIdx;
+        
+        // Change PROJECTION to map projection if necessary
+        if ($changeLayProj) {
+            if ($this->qLayerType == 0) {
+                // Apply buffer in order to have a correct re-projection of POINT layers
+                $pjbuff = 0.0000001;    
+                $sMinx = $qShpBounds->minx - $pjbuff;
+                $sMiny = $qShpBounds->miny - $pjbuff;
+                $sMaxx = $qShpBounds->maxx + $pjbuff;
+                $sMaxy = $qShpBounds->maxy + $pjbuff;
+                
+                $qShpBounds = ms_newRectObj();
+                $qShpBounds->set("minx", $sMinx);
+                $qShpBounds->set("miny", $sMiny);
+                $qShpBounds->set("maxx", $sMaxx);
+                $qShpBounds->set("maxy", $sMaxy);
+            }
+            
+            $qShpBounds->project($this->qLayerProjObj, $this->mapProjObj);
+        }   
+        
+        //Get MIN/MAX values for shape extent rectangle       
+        $shpMinx = $qShpBounds->minx;
+        $shpMiny = $qShpBounds->miny;
+        $shpMaxx = $qShpBounds->maxx;
+        $shpMaxy = $qShpBounds->maxy;
+        
+        
+        // Buffer for points: ADAPT BUFFER VALUE TO SCALE RANGE   [ needs to be improved though ]
+        if ($this->qLayerType == 0) {
+            $buf = $this->pointBuffer;        // set buffer depending on dimensions of your coordinate system
+            $shpMinx -= $buf;
+            $shpMiny -= $buf;
+            $shpMaxx += $buf;
+            $shpMaxy += $buf;
+        }
+        
+        
+        // Get maximum extents if zoomAll or autoZoom is enabled
+        if ($this->zoomFull) {
+            $this->mExtMinx = min($this->mExtMinx, $shpMinx);
+            $this->mExtMiny = min($this->mExtMiny, $shpMiny);
+            $this->mExtMaxx = max($this->mExtMaxx, $shpMaxx);
+            $this->mExtMaxy = max($this->mExtMaxy, $shpMaxy);
+        }     
+        // Define if for zoom2extent for select and search the single click should change highlight
+        ##$jsLink = "zoom2extent(" . ($this->zoomFull ? "0, 0"  :  "'" . $this->qLayerName ."',".$qShpIdx) .",'". $shpMinx ."+". $shpMiny ."+". $shpMaxx ."+". $shpMaxy ."')";
+        ##$qShpLink = "<td class=\"zoomlink\"><a href=\"javascript:" . ($this->infoWin == "frame" ? "" : "opener.parent.mapFrame.") . $jsLink . "\"><img src=\"images/zoomto.gif\" border=\"0\"></a></td>";
+        
+        $qShpLink = "{\"shplink\": [" . ($this->zoomFull ? "\"0\",\"0"  :  "\"" . $this->qLayerName ."\",\"".$qShpIdx) ."\",\"". $shpMinx ."+". $shpMiny ."+". $shpMaxx ."+". $shpMaxy ."\"]}";
+        
+        return $qShpLink;
+    }
+    
+    
+
+        
+
+   /**
+    * Print results for rest of fields (all but shape)
+    *************************************************/
+    function printFields($qShape)
+    {
+        
+        // PRINT RESULT ROW
+        $loop = 2;     // Used for one-to-many joins to break while loop when all DB data printed
+        $dbloop = 0;   // Used for one-to-many joins as index to step through join table
+
+        while($loop > 0) {
+
+            ##$this->qStr .= "pippo anzahl felder:" . sizeof($this->selFields);
+            // Add shape index to array, used for highlight
+            //$resultindexes[] = $qShpIdx;
+
+            // Print all OTHER COLUMNS from SHAPE
+            for ($iField=0; $iField < sizeof($this->selFields); $iField++) {
+                $fldName  = $this->selFields[$iField];
+                $fldValue = $qShape->values[$fldName];
+                //$this->qStr .= $fldValue;
+                
+                $this->qStr .= $this->printFieldValues($fldName, $fldValue);
+            }
+
+            ##print_r($this->joinList);
+            // Now add JOIN COLUMNS from DB if defined
+            if ($this->joinList && $this->dbh) {
+                $toValue = $qShape->values[$this->toField];
+                $joinFieldList = split(',', $this->joinFields);
+                //echo $this->sql;
+                // get data only once from DB
+                if ($dbloop == 0) {
+                    $data = $this->returnData($this->dbh, $this->sql, $toValue, $this->fromFieldType, $this->one2many);
+                    $dbresCount = count($data);
+                }
+
+                //print_r($data);
+                //exit;
+                //
+                if ($dbresCount > 0) {
+                    $jfldi = 0;
+                    foreach($data[$dbloop] as $val) {
+                        $fldName =  trim($joinFieldList[$jfldi]);
+                        $jfldi++;
+                        $this->qStr .= $this->printFieldValues($fldName, $val);
+                    }
+                    $dbloop++;
+
+                    // if NO one2many set $dbloop to end value and stop after first record
+                    if (!$this->one2many) {
+                        $dbloop = $dbresCount;
+                    }
+
+                    // if all recors from one2many retrieved (or only one2one) stop loop
+                    if ($dbloop == $dbresCount) $loop = 0;
+                } else {
+                    $loop = 0;
+                }
+
+            // NO JOIN field defined, so break while loop and continue with next record
+            } else {
+                $loop = 0;
+            }
+            
+        }
+    
+    }
+
+    
+   /**
+    * FUNCTIONS FOR JOINING DB TABLES TO QUERY RESULT
+    ************************************************************/
+    
+    // Get properties for DB table join
+    function returnTableJoinProperties()
+    {
+        if ($this->glayer->getTableJoin()) {
+            //$dsn, $fromTable, $fromField, $fromFieldType, $joinFields, $toField, $one2many
+            require_once ("DB.php");
+            $joinList = $this->glayer->getTableJoin();
+
+            // Join table properties
+            $fromTable  = $joinList["fromTable"];
+            $fromField  = $joinList["fromField"];
+            $this->fromFieldType  = $joinList["fromFieldType"];
+            $this->joinFields = $joinList["joinFields"];
+    
+            // Layer field to join TO
+            $this->toField =  $joinList["toField"];
+    
+            // Join type: one-to-one (0) or one-to-many (1)
+            $this->one2many = $joinList["one2many"];
+    
+            // Connnect to DB
+            $dsn = $joinList["dsn"];
+            $dbh = $this->dbConnect($dsn);
+            
+            if (!$dbh) error_log ("Could not connect to DB defined for Layer '" 
+                . $this->glayer->getLayerName() . "'. Check map file entry for JOIN definition.", 0);
+            }
+            
+            $this->sql = "SELECT " . $this->joinFields . " FROM $fromTable WHERE $fromField=";
+            $this->dbh = $dbh;
+                
+            $this->joinList = $joinList;
+    }
+    
+    
+    
+    // Get data from DB
+    function returnData($dbh, $sql, $toValue, $fromFieldType)
+    {
+        $quote = ($fromFieldType == "1" ? "'" : "");
+        $sqlRun = $sql.$quote.$toValue.$quote;
+        $data = $dbh->getAll($sqlRun);   // For 1:n Joins
+        #$data = $dbh->getRow($sqlRun);
+        if (PEAR::isError($data)) {
+            db_logErrors($data);
+            die();
+        }
+        return $data;
+    }
+
+
+
+} // end CLASS DQUERY
+
+
+
+
+/**********************************************
+ *  QUERY RESULTS FOR WMS LAYER
+ **********************************************/
+class WMSQuery extends Query
+{
+    function WMSQuery($grp, $qLayer, $x_pix, $y_pix )
+    {
+        //$this->QUERY($qLayer);
+        $this->grp = $grp;
+        $this->qLayer = $qLayer;
+        $this->x_pix = $x_pix;
+        $this->y_pix = $y_pix;
+        
+        // dump results to resultString 
+        $this->dumpWMSQueryResults();
+    }
+
+
+    function dumpWMSQueryResults()
+    {
+        $wmsResultURL = $this->qLayer->getWMSFeatureInfoURL($this->x_pix, $this->y_pix, 10, "MIME");
+        error_log($wmsResultURL);
+        $wmsResult = file($wmsResultURL);
+        $wmsNumRes = count($wmsResult);
+        //print_r($wmsResult);
+      
+        //echo $wmsResultURL;
+        
+        if ($wmsNumRes > 4) {
+            $firstRun = 1;
+            $featureCount = 0;
+            $fldHeaderStr = "[";
+            $resRowStr = "\"values\": [ [";
+            
+            foreach ($wmsResult as $row) {
+                if (preg_match ("/\sFeature\s/i", $row)) {
+                    $featureCount++;
+                    if (!$firstRun) {
+                        $resRowStr = substr($resRowStr, 0, -1);
+                        $resRowStr .= "],[";
+                    }
+                    $firstRun = 0;
+                } elseif (preg_match ("/\=/", $row)) {
+                    $resRowStr .= "";
+                    $resFld = preg_split ("/\=/", $row);
+                    if ($featureCount < 2) {
+                        $fldHeaderStr .= "\"" . trim($resFld[0]) . "\",";
+                    }
+                    
+                    $resRowStr .= "\"" . utf8_encode(trim(str_replace("'","",$resFld[1]))) . "\",";
+                }
+
+            }
+            
+            $fldHeaderStr = "\"header\": " . substr($fldHeaderStr, 0, -1) . "], ";
+            $resRowStr = substr($resRowStr, 0, -1) . "]";
+            
+            $this->numResults = $wmsNumRes - 4;
+            $this->colspan = $colspan;
+            $this->fieldHeaderStr = $fldHeaderStr; 
+            $this->qStr = "$fldHeaderStr $resRowStr";
+        }
+    }
+
+
+
+} // end CLASS WMSQUERY
+
+
+
+
+/**********************************************
+ *  QUERY RESULTS FOR XY ('EVENT') LAYER
+ **********************************************/
+class XYQuery extends Query
+{ 
+
+    function XYQUERY($qLayer, $glayer, $xyLayQueryList, $search, $zoomFull)
+    {
+        //$this->QUERY($qLayer);
+        $this->glayer = $glayer;
+        $this->qLayer = $qLayer;
+        $this->qLayerName = $qLayer->name;
+        $this->xyLayQueryList = $xyLayQueryList;
+        $this->zoomFull = $zoomFull;
+        $this->search = $search;
+        $this->layerEncoding = $glayer->getLayerEncoding();
+        $this->limitResult = $_SESSION["limitResult"];
+        $this->pointBuffer  = $_SESSION["pointBuffer"];
+
+        // dump results to resultString 
+        $this->dumpXYQueryResults();
+        
+    }
+
+
+
+    function dumpXYQueryResults()
+    {
+        require_once ("DB.php");
+        $eqr = $_SESSION["equeryRect"];
+        
+        // XY Layer Properties
+        $XYLayerProperties = $this->glayer->getXYLayerProperties();
+        
+        $dsn = $XYLayerProperties["dsn"];
+        $xyTable = $XYLayerProperties["xyTable"];
+        $x_fld = $XYLayerProperties["x_fld"];
+        $y_fld = $XYLayerProperties["y_fld"];
+        $classidx_fld = $XYLayerProperties["classidx_fld"];
+        
+        $resFieldList = $this->glayer->getResFields();
+        $resFldStr = join(',', $resFieldList);
+        
+        
+        // Prepare SQL query
+        if (preg_match("/@/", $xyTable)) {          // Check for WHERE filter in table definition
+            $xyList = preg_split('/@/', $xyTable);
+            $whereFilter = $xyList[1];
+            $xyTable = $xyList[0];
+        }
+
+        $sql_select = "SELECT $x_fld, $y_fld, $resFldStr FROM $xyTable";
+        
+        $qr = $this->xyLayQueryList;
+        if ($this->search) {
+            $sql_where  = "WHERE " . ($whereFilter ? $whereFilter . " AND " : "") . $qr;
+        } else {
+            $sql_where  = "WHERE " . ($whereFilter ? $whereFilter . " AND " : "") . " $x_fld >= " . $qr["xmin"] . " AND $x_fld <= " . $qr["xmax"] . " AND $y_fld >= " . $qr["ymin"] . " AND $y_fld <= " . $qr["ymax"];
+        }
+
+        $sql = "$sql_select  $sql_where";
+        //echo $sql;
+        
+        
+        // Connect to DB       
+        $dbh = DB::connect($dsn);
+        if (DB::isError($dbh)) {
+            db_logErrors($dbh);
+            die();
+        }
+        
+        // Execute query 
+        $res = $dbh->query($sql);
+        if (DB::isError($res)) {
+            db_logErrors($res);
+            die();
+        } 
+        
+        
+        $this->mExtMinx = 999999999;
+        $this->mExtMiny = 999999999;
+        $this->mExtMaxx = -999999999;
+        $this->mExtMaxy = -999999999;
+        
+        // Now print results as JSON
+        $nres = 0;
+        $numrows = $res->numRows();
+        while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {
+            $buf = $this->pointBuffer;
+            //error_log($buf);
+            $shpMinx = $row["$x_fld"] - $buf;
+            $shpMiny = $row["$y_fld"] - $buf;
+            $shpMaxx = $row["$x_fld"] + $buf;
+            $shpMaxy = $row["$y_fld"] + $buf;
+
+            
+            if ($this->zoomFull) {
+                $this->mExtMinx = min($this->mExtMinx, $shpMinx);
+                $this->mExtMiny = min($this->mExtMiny, $shpMiny);
+                $this->mExtMaxx = max($this->mExtMaxx, $shpMaxx);
+                $this->mExtMaxy = max($this->mExtMaxy, $shpMaxy); 
+            }
+            
+            // Link for zoom to feature
+            $qShpIdx = $row["$oid_fld"];
+            $this->resultindexes[] = $row["$x_fld"] ."@". $row["$y_fld"];
+            
+            // Output JSON
+            $qShpLink = "{\"shplink\": [\"0\",\"0\",\"" . $shpMinx ."+". $shpMiny ."+". $shpMaxx ."+". $shpMaxy ."\"]}";
+
+            if ($nres > 0)  $this->qStr .= ", "; 
+            
+            // Add shape link
+            $this->qStr .= "[" . $qShpLink;
+            
+            // Add 'normal' field values
+            foreach ($resFieldList as $fn) {
+                $this->qStr .= $this->printFieldValues($fn, $row["$fn"]);
+            }
+            
+            $this->qStr .= "]";
+            
+            $nres++;
+            
+            // Stop query if result records exceed limit set in config.ini
+            if ($nres > $this->limitResult) break;
+        }
+        
+        $this->numResults = $nres;
+        
+        $res->free();
+        $dbh->disconnect();
+          
+    }
+
+
+} // END CLASS XYQUERY
+
+
+
+/**********************************************
+ *  ATTRIBUTE QUERY RESULTS FOR POSTGIS LAYER
+ **********************************************/
+class PGQuery extends Query
+{ 
+    function PGQuery($map, $qLayer, $glayer, $queryStr, $zoomFull)
+    {
+        $this->map = $map;
+        $this->qLayer = $qLayer;
+        $this->qLayerType = $this->qLayer->type;
+        $this->glayer = $glayer;
+        $this->zoomFull = $zoomFull;
+        $this->layerEncoding = $glayer->getLayerEncoding();
+        
+        $this->limitResult  = $_SESSION["limitResult"];
+        $this->pointBuffer  = $_SESSION["pointBuffer"];
+        
+        $this->changeLayProj = $this->checkProjection();
+        //error_log("change proj: " . $this->changeLayProj);
+        
+        // dump results to resultString 
+        $this->dumpPGQueryResults($queryStr);
+    }
+    
+    
+    function dumpPGQueryResults($queryStr)
+    {
+        $layerDataList = $this->pgLayerParseData();
+        $geom = $layerDataList['geocol'];
+        $dbtable = $layerDataList['dbtable'];
+        $unique_field = $layerDataList['unique_field'];
+                
+        // Load PGSQL extension if necessary
+        if (PHP_OS == "WINNT" || PHP_OS == "WIN32") {
+            if (! extension_loaded('pgsql')) {
+                dl('php_pgsql.dll');
+            }
+        }
+        
+        // CONNECT TO DB
+        $connString = $this->qLayer->connection;
+        if (!($connection = pg_Connect($connString))){
+           error_log ("P.MAPPER: Could not connect to database");
+           error_log ("P.MAPPER: PG Connection error: " . pg_last_error($connection));
+           exit();
+        }
+    
+        // FIELDS and FIELD HEADERS for result   
+        $selFields   = $this->glayer->getResFields();
+        foreach ($selFields as $f) {
+            $s .= "$f,";
+        }
+        
+        // Select string for DB query
+        $select = substr($s, 0, -1);
+        
+        // Apply already existing filter on layer
+        $pg_filter = trim(str_replace('"', '', $this->qLayer->getFilter()));
+        if (strlen($pg_filter) > 2 &&  $pg_filter != "(null)") {
+            $queryStr .= " AND $pg_filter ";
+        }
+        
+        // Limit search to limit set in INI file
+        $searchlimit = $this->limitResult + 1;
+    
+        // RUN DB DEFINE QUERY
+        $query = "SELECT $unique_field, 
+                         xmin(box3d($geom)), 
+                         ymin(box3d($geom)), 
+                         xmax(box3d($geom)), 
+                         ymax(box3d($geom)), 
+                         $select 
+                    FROM $dbtable 
+                   WHERE $queryStr
+                   LIMIT $searchlimit";
+        //error_log($query);
+        
+        //$qresult = pg_Exec ($connection, $query);
+        $qresult = pg_query ($connection, $query);
+        if (!$qresult) {
+            error_log("P.MAPPER: PG Query error for : $query" . pg_result_error($qresult));
+        }
+        $numrows = pg_numrows ($qresult);
+        $this->numResults = $numrows;
+    
+    
+        // CREATE HTML OUPTPUT
+        if ($numrows > 0){
+            
+            if ($this->zoomFull) {
+                // Maximum start extents
+                $mExtMinx = 999999999;
+                $mExtMiny = 999999999;
+                $mExtMaxx = -999999999;
+                $mExtMaxy = -999999999;
+            }
+            
+            // Fetch records from db and print them out
+            for ($r=0; $r < $numrows; ++$r){
+                $a = pg_fetch_row($qresult, $r);
+                $a_rows = count($a);
+                $qShpIdx = $a[0]; 
+                $oids[] = $qShpIdx;
+                
+                // If map and layer have different proj, re-project extents
+                if ($this->changeLayProj) {
+                    $pb = $this->reprojectExtent($a);
+                    $xmin = $pb['shpMinx'];
+                    $ymin = $pb['shpMiny'];
+                    $xmax = $pb['shpMaxx'];
+                    $ymax = $pb['shpMaxy'];
+                } else {
+                    $xmin = $a[1];
+                    $ymin = $a[2];
+                    $xmax = $a[3];
+                    $ymax = $a[4];
+                }
+                
+                // Set buffer for point layers
+                if ($this->qLayerType == 0) {
+                    $buf = $this->pointBuffer;        // set buffer depending on dimensions of your coordinate system
+                    $xmin -= $buf;
+                    $ymin -= $buf;
+                    $xmax += $buf;
+                    $ymax += $buf;
+                }     
+                
+                // Look for min/max extents of ALL features
+                if ($this->zoomFull) {
+                    $mExtMinx = min($mExtMinx, $xmin);
+                    $mExtMiny = min($mExtMiny, $ymin);
+                    $mExtMaxx = max($mExtMaxx, $xmax);
+                    $mExtMaxy = max($mExtMaxy, $ymax);
+                }
+                
+                // Output JSON
+                $qShpLink = "{\"shplink\": [" . ($this->zoomFull ? "\"0\",\"0"  :  "\"" . $this->qLayerName ."\",\"".$qShpIdx) ."\",\"". $xmin ."+". $ymin ."+". $xmax ."+". $ymax ."\"]}";
+                
+                // print SHAPEINDEX link
+                $this->qStr .= "[" . $qShpLink;
+    
+                // Print all OTHER FIELDS
+                for ($i=5; $i < $a_rows; ++$i) {
+                     //printFieldValues($glayer, $qlayerName, $fldName, $a[$i]);
+                     $this->qStr .= $this->printFieldValues($fldName, $a[$i]);
+                }
+                $this->qStr .= "]";
+                if ($r < ($numrows - 1)) $this->qStr .= ", "; 
+                //$this->qStr .= "\n";
+                
+            }
+    
+            // Full extent for ALL features
+            if ($this->zoomFull) {
+                $this->maxExtent = array($mExtMinx, $mExtMiny, $mExtMaxx, $mExtMaxy);
+            } else {
+                $this->maxExtent = 0;
+            }
+            
+            $this->resultindexes = $oids;
+            
+        }
+    
+        pg_Close ($connection);
+    
+    }
+    
+   /**
+    * Parse DATA tag from PostGIS layer
+    */    
+    function pgLayerParseData()
+    {
+        $pg_data = $this->qLayer->data; //"the_geom from images";
+        $dl = preg_split('/ from /i', $pg_data);
+        $data_list['geocol'] = trim($dl[0]);
+        $flds = trim($dl[1]);
+        
+        if (substr($flds, 0, 1) == '(') {
+            // is of type "the_geom from (select the_geom, oid, from mytable) AS foo USING UNIQUE gid USING SRID=4258"
+            $tabl = preg_split('/as ([a-z]|_|[A-Z]|[0-9])+ using unique /i', $dl[2]);
+            $unique_list = preg_split('/[\s,]+/', $tabl[1]);
+            
+            $data_list['dbtable'] = $flds . " from " . trim($tabl[0]) . " as foo ";
+            $data_list['unique_field'] = trim($unique_list[0]);
+        } else {
+            $tabl = preg_split('/using unique/i', $dl[1]);
+            if (count($tabl) > 1) {
+                // is of type "the_geom from mytable USING UNIQUE gid "
+                $data_list['dbtable'] = trim($tabl[0]);
+                //$data_list['unique_field'] = trim($tabl[1]);
+                $unique_list = preg_split('/[\s]+/', trim($tabl[1]));
+                $data_list['unique_field'] = trim($unique_list[0]);
+            } else {
+                // is of type "the_geom from mytable"
+                $dbtable = trim($dl[1]);
+                $data_list['dbtable'] = $dbtable;
+                $data_list['unique_field'] = "oid";
+                error_log("P.MAPPER Warning: no UNIQUE field specified for PostGIS table '$dbtable'. Trying using OID field...");
+            }
+        }
+        //print_r($data_list);
+        return $data_list; 
+    }
+    
+    
+    
+    function reprojectExtent($inExt)
+    {
+        $qShpBounds = ms_newRectObj();
+        
+        // Apply buffer in order to have a correct re-projection of POINT layers
+        $pjbuff = ($this->qLayer->type == 0 ? 0.0000001 : 0);    
+        $sMinx = $inExt[1] - $pjbuff;
+        $sMiny = $inExt[2] - $pjbuff;
+        $sMaxx = $inExt[3] + $pjbuff;
+        $sMaxy = $inExt[4] + $pjbuff;
+        
+        $qShpBounds->set("minx", $sMinx);
+        $qShpBounds->set("miny", $sMiny);
+        $qShpBounds->set("maxx", $sMaxx);
+        $qShpBounds->set("maxy", $sMaxy);
+
+        
+        $qShpBounds->project($this->qLayerProjObj, $this->mapProjObj);
+        
+        $pb['shpMinx'] = $qShpBounds->minx;
+        $pb['shpMiny'] = $qShpBounds->miny;
+        $pb['shpMaxx'] = $qShpBounds->maxx;
+        $pb['shpMaxy'] = $qShpBounds->maxy;
+        
+        return $pb;
+    }  
+    
+    
+    function returnMaxExtent() 
+    {
+        return $this->maxExtent;
+    }
+    
+    
+    
+} //END CLASS PGQUERY
+
+
+
+
+
+
+?>
\ No newline at end of file

Added: incphp/util.php
===================================================================
--- incphp/util.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/util.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,104 @@
+<?php
+
+/**********************************************************************************
+ * The newer version uses class styles from the TD elements that contain the images 
+ * The new method is more flexible with regard to other selected colors
+ * If you want to have an image swap for image on/off, use the older version
+ * available with writebuttonsImgSwap()
+ * -> look at toolbar.phtml for changing the onLoad function and the loading of writebuttons...()
+ **********************************************************************************/
+
+
+/*
+ * WRITE ZOOM SLIDER
+ * called from top.phtml
+ ******************************************************************************/
+function writescaleslider($gSlide)
+{
+    for ($i=0;$i<count($gSlide);$i++) {
+        $sln = $gSlide[$i];
+        echo ("<td><a href=\"javascript:zoom2scale($sln)\"><img src=\"images/slider/".$i."_sl_off.gif\" name=\"slbut$sln\" border=0  width=12 title=\"1:$sln\" alt=\"1:$sln\"></a></td> \n");
+    }
+}
+
+
+
+/*
+ * PRINT TOOLBAR BUTTONS, NEW VERSION
+ * called from toolbar.phtml
+ *******************************************************************************/
+
+function writebuttons($buttons, $toolBarOrientation)
+{   
+    echo ("<table class=\"TOOLBAR\" border=\"0\" cellspacing=\"3\" cellpadding=\"0\">\n");
+    echo ($toolBarOrientation == "vertical" ? "" : "<tr>");
+
+    foreach ($buttons as $b => $ba) {
+        echo ($toolBarOrientation == "vertical" ? "<tr>" : "");
+
+        if (preg_match("/^space/i", $b)) {
+            echo ("<td class=\"tsep\"><img id=\"sep\" alt=\"separator\" src=\"images/buttons/space.gif\" style=\"border-width:0px;\" " . ($toolBarOrientation == "vertical" ? "height" : "width") . "=$ba /></td>");
+
+        } elseif (preg_match("/^separator/i", $b)) {
+            if ($toolBarOrientation == "vertical") {
+                echo ("<td class=\"tsep\"><img alt=\"separator\" src=\"images/buttons/separatorv.gif\" style=\"border-width:0px;\" width=\"26\" height=\"10\" /></td> ");
+            } else {
+                echo ("<td class=\"tsep\"><img alt=\"separator\" src=\"images/buttons/separatorh.gif\" style=\"border-width:0px;\" width=\"10\" height=\"26\" /></td> ");
+            }
+        } else {
+            echo ("<td class=\"TOOLBARTD\" id=\"$b\" onmouseover=\"TbOverOut('$b', 'on')\" onmouseout=\"TbOverOut('$b', 'off')\" " . 
+                    ($ba[1] == "0" ?  "onmousedown=\"setTbTDButton('$b');domouseclick('$b')\"" : "onmousedown=\"TbDownUp('$b', 'd')\" onmouseup=\"TbDownUp('$b', 'u')\"") .
+                    " onclick=\"" . ($ba[1] == "0" ? "domouseclick('$b')" : "$ba[1]") .  "\">" .
+                    "<img id=\"img_$b\"  src=\"images/buttons/$b"."_off.gif\" title=\"$ba[0]\" alt=\"$ba[0]\"  /></td>" );
+        }
+
+        echo ($toolBarOrientation == "vertical" ? "</tr> \n" : "\n");
+    }
+
+    echo ($toolBarOrientation == "vertical" ? "" : "</tr> \n");
+    echo ("</table>"); 
+}
+
+
+
+
+/*
+ * PRINT TOOLBAR BUTTONS, OLD VERSION WITH IMAGE SWAP
+ * -> swaps images from imgname_on.gif to imgname_off.gif and vice versa
+ * adapt toolbar.phtml  (find detailed descriptions there)
+ *******************************************************************************/
+
+function writebuttonsImgSwap($buttons, $toolBarOrientation)
+{
+    #echo ($toolBarOrientation); exit();
+    echo ($toolBarOrientation == "vertical" ? "" : "<tr>");
+
+    foreach ($buttons as $b => $ba) {
+        echo ($toolBarOrientation == "vertical" ? "<tr>" : "");
+
+        if (preg_match("/^space/i", $b)) {
+            echo ("<td><img src=\"images/buttons/space.gif\" style=\"border-width:0px;\" " . ($toolBarOrientation == "vertical" ? "height" : "width") . "=$ba /></td>");
+
+        } elseif (preg_match("/^separator/i", $b)) {
+            if ($toolBarOrientation == "vertical") {
+                echo ("<td><img src=\"images/buttons/separatorv.gif\" style=\"border-width:0px;\" width=\"26\" height=\"10\" /></td> ");
+            } else {
+                echo ("<td><img src=\"images/buttons/separatorh.gif\" style=\"border-width:0px;\" width=\"10\" height=\"26\" /></td> ");
+            }
+        } else {
+            echo ("<td><img id=\"$b\"  src=\"images/buttons/$b"."_off.gif\"  border=\"0\" title=\"$ba[0]\" " .
+                    ($ba[1] == "0" ?  "onmousedown=\"setButton('$b')\"" : "onmousedown=\"setImg('$b','on')\"  onmouseup=\"setImg('$b','off')\"") .
+                    "onclick=\"" . ($ba[1] == "0" ? "domouseclick('$b')" : $ba[1]) .  "\" /></td>" );
+        }
+
+        echo ($toolBarOrientation == "vertical" ? "</tr> \n" : "\n");
+    }
+
+    echo ($toolBarOrientation == "vertical" ? "" : "</tr> \n");
+}
+
+
+
+
+
+?>

Added: incphp/xajax/x_info.php
===================================================================
--- incphp/xajax/x_info.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/xajax/x_info.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,47 @@
+<?php
+/*********************************************************************************
+ Copyright (c) 2003-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+require_once("../group.php");
+session_start();
+require_once("../globals.php");
+require_once("../common.php");
+require_once("../query/squery.php");
+
+header("Content-type: text/plain; charset=$defCharset");
+
+$mode = $_GET['mode'];
+//$infoWin = $_SESSION['infoWin'];
+//$alignQueryResults = $_SESSION['alignQueryResults'];
+
+// Run QUERY
+$mapQuery = &new Query($map);
+$mapQuery->q_processQuery();
+$queryResult = $mapQuery->q_returnQueryResult();
+//$numResultsTotal = $mapQuery->q_returnNumResultsTotal();
+
+/*
+$mcl = explode(" ", microtime());
+error_log(date("H:i:s", $mcl[1]) . " " . $mcl[0] );
+*/
+
+echo "{method:'getQueryResult', mode:'$mode', queryResult:$queryResult}";
+?>
\ No newline at end of file

Added: incphp/xajax/x_layer_update.php
===================================================================
--- incphp/xajax/x_layer_update.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/xajax/x_layer_update.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,18 @@
+<?php
+require_once("../group.php");
+session_start();
+require_once("../globals.php");
+require_once("../common.php");
+
+header("Content-Type: text/plain; charset=$defCharset");
+
+if (isset($_GET["groups"])) {
+    $drawGroupStr = $_GET["groups"];
+    $groups = explode(",", $drawGroupStr);
+    $_SESSION["groups"]  = $groups;
+}
+
+// return JS object literals "{}" for XMLHTTP request 
+echo "{method:'updateSelLayers', sellayers: '' }";
+
+?>
\ No newline at end of file

Added: incphp/xajax/x_load.php
===================================================================
--- incphp/xajax/x_load.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/xajax/x_load.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,106 @@
+<?php
+// Send header for XMLHTTP request
+header("Cache-Control: no-cache, must-revalidate, private, pre-check=0, post-check=0, max-age=0");
+header("Expires: " . gmdate('D, d M Y H:i:s', time()) . " GMT");
+header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");      
+header("Pragma: no-cache"); 
+
+header('Content-Type: text/plain');
+
+
+require_once("../group.php");
+session_start();
+
+// Check if PHP session still exists
+if (!isset($_SESSION['session_alive'])) {
+    echo "{method:'updateMap', sessionerror:'true'}";
+   
+} else {
+
+    require_once("../globals.php");
+    require_once("../common.php");
+    require_once("../map.php");
+    
+    if (isset($_GET['mapW'])) {
+        $_SESSION['mapwidth']  = $_GET['mapW'];
+        $_SESSION['mapheight'] = $_GET['mapH'];
+    }
+    
+    // GET SESSION VARS 
+    $old_geo_scale = $_SESSION['geo_scale'];
+    $scaleLayers   = $_SESSION["scaleLayers"];
+    $tocStyle      = $_SESSION["tocStyle"];
+    $grouplist     = $_SESSION['grouplist'];
+    $url_points    = $_SESSION['url_points'];
+    
+    
+    // CREATE NEW MAP
+    $pmap = &new PMAP($map);
+    
+    $mapURL      = $pmap->pmap_returnMapImgURL();
+    $scalebarURL = $pmap->pmap_returnScalebarImgURL();
+    $mapJS       = $pmap->pmap_returnMapJSParams();
+    $refBoxStr   = $pmap->pmap_returnRefBoxStr();
+    $mapwidth    = $pmap->pmap_returnMapW();
+    $mapheight   = $pmap->pmap_returnMapH();
+    $geo_scale   = $pmap->pmap_returnGeoScale();
+    
+    
+    // Check if layers in TOC should be refreshed
+    if ($scaleLayers) {
+        foreach ($grouplist as $grp) {
+            $layerList = $grp->getLayers();
+            foreach ($layerList as $glayer) {
+                $layName = $glayer->getLayerName();
+                $qLayer = $map->getLayerByName($layName);
+                if (checkScale($map, $qLayer, $geo_scale)) {
+                    $visGroupsAfter[] = $layName;
+                }
+                if (checkScale($map, $qLayer, $old_geo_scale)) {
+                    $visGroupsBefore[] = $layName;
+                }
+            }
+        }
+        
+        if ($visGroupsAfter == $visGroupsBefore) {
+            $refreshToc = 0;
+        } else {
+            $refreshToc = 1;
+        }
+        
+        if (isset($_SESSION['zoom_extparams'])) {
+            unset($_SESSION['zoom_extparams']);
+            //error_log("pippo");
+            $refreshToc = 1;
+        } 
+    } else {
+        $refreshToc = 0;
+    }
+    
+    
+    // JS objects from map creation
+    $strJS .= "mapW:'" . $mapJS['mapW'] . "', ";
+    $strJS .= "mapH:'" . $mapJS['mapH'] . "', ";
+    $strJS .= "refW:'" . $mapJS['refW'] . "', ";
+    $strJS .= "refH:'" . $mapJS['refH'] . "', ";
+    $strJS .= "minx_geo:'" . $mapJS['minx_geo'] . "', ";
+    $strJS .= "maxy_geo:'" . $mapJS['maxy_geo'] . "', ";
+    $strJS .= "xdelta_geo:'" . $mapJS['xdelta_geo'] . "', ";
+    $strJS .= "ydelta_geo:'" . $mapJS['ydelta_geo'] . "' ";
+    
+    
+    // Serialize url_points
+    if (is_array($url_points)) {
+        foreach ($url_points as $up) {
+            $urlPntStr .= $up[0] . "@@" . $up[1] . "@@" . urlencode($up[2]) . '@@@'; 
+        }
+        $urlPntStr = addslashes(substr($urlPntStr, 0, -3));
+        //error_log($urlPntStr);
+    }
+    
+    // return JS object literals "{}" for XMLHTTP request 
+    echo "{method:'updateMap', sessionerror:'false',  mapURL:'$mapURL', scalebarURL:'$scalebarURL', geo_scale:'$geo_scale', refBoxStr:'$refBoxStr', tocStyle:'$tocStyle', refreshToc:'$refreshToc', urlPntStr:'$urlPntStr', $strJS}";
+
+}
+
+?>
\ No newline at end of file

Added: incphp/xajax/x_poi.php
===================================================================
--- incphp/xajax/x_poi.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/xajax/x_poi.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,22 @@
+<?php
+session_start();
+require_once("../globals.php");
+require_once("../common.php");
+
+$up = $_GET['up'];
+$pointList = explode("@@", $up);
+$px  = $pointList[0];
+$py  = $pointList[1];
+$txt = urldecode($pointList[2]);
+
+$_SESSION['url_points'][] = $pointList; 
+
+
+
+
+header("Content-Type: text/plain; charset=$defCharset");
+
+// return JS object literals "{}" for XMLHTTP request 
+echo "{method:'addPOI', retvalue:'$txt'}";
+
+?>
\ No newline at end of file

Added: incphp/xajax/x_select.php
===================================================================
--- incphp/xajax/x_select.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/xajax/x_select.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,81 @@
+<?php
+require_once("../group.php");
+session_start();
+require_once("../globals.php");
+require_once("../common.php");
+require_once("../query/query.php");
+
+header("Content-Type: text/plain; charset=$defCharset");
+
+
+$mode = $_GET["mode"];
+$scale = $_SESSION["geo_scale"];
+$grouplist = $_SESSION["grouplist"];
+
+if (isset($_GET["groups"])) {
+    $drawGroupStr = $_GET["groups"];
+    $groups = explode(" ", $drawGroupStr);
+} else {
+    $groups = $_SESSION["groups"];
+}
+
+// Check for active group for selection
+if (isset($_GET["activegroup"])) {
+    $activegroup = $_GET["activegroup"];
+} elseif (isset($_SESSION["activegroup"])) {
+    $activegroup = $_SESSION["activegroup"];
+    $_SESSION["activegroup"] = $activegroup;
+} else {
+    $activegroup = "";
+}
+
+
+
+// APPLY ON LAYERS DEFINED IN MAP FILE AND VISIBLE AT CURRENT SCALE
+foreach ($grouplist as $grp){
+    if (in_array($grp->getGroupName(), $groups, TRUE)) {
+        $glayerList = $grp->getLayers();
+        foreach ($glayerList as $glayer) {
+            $resFldList = $glayer->getResFields();
+            $mapLayer = $map->getLayer($glayer->getLayerIdx());
+            
+            // Check for template
+            $hasTemplate = 0;
+            if ($mapLayer->template) $hasTemplate = 1;
+            $numclasses = $mapLayer->numclasses;
+            for ($cl=0; $cl < $numclasses; $cl++) {
+                $class = $mapLayer->getClass($cl);
+                $classTemplate = $class->template;
+                if ($class->template) $hasTemplate = 1;
+            }
+
+            if ($mapLayer->type < 3 && checkScale($map, $mapLayer, $scale) == 1 &&  $resFldList[0] != '0' && $hasTemplate) {
+                $showgroups[] = $grp;
+                break;
+            }
+        }
+    }
+}
+
+
+// Print combo box with all visible groups
+$gstr = "<form id=\"selform\"><div class=\"selectbox\">";
+if (count($showgroups) > 0) {
+
+    $gstr .=  _p("Selection for Layer") . "";
+    $gstr .= "";
+    $gstr .= "<select name=\"selgroup\" >";
+    
+    foreach ($showgroups as $g) {
+       $gstr .= "<option value=\"" . $g->groupName . "\" ";
+       if ($g->groupName == $activegroup) $gstr .= " selected=\"selected\" ";
+       $gstr .= ">" . $g->getDescription() . "</option> ";
+    }
+    $gstr .= "</select>";
+}
+$gstr .= "</div></form>";
+
+
+// return JS object literals "{}" for XMLHTTP request 
+echo "{method:'updateSelectTool', selStr:'$gstr'}";
+?>
\ No newline at end of file

Added: incphp/xajax/x_toc.php
===================================================================
--- incphp/xajax/x_toc.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/xajax/x_toc.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,36 @@
+<?php
+require_once("../group.php");
+session_start();
+
+require_once("../common.php");
+require_once("../globals.php");
+require_once("../legend.php");
+require_once("../custom.php");
+
+$scale            = $_SESSION['geo_scale'];
+$defGroups        = $_SESSION['defGroups'];
+$useCategories    = $_SESSION['useCategories'];
+$layerAutoRefresh = $_SESSION['layerAutoRefresh'];
+
+if (isset($_GET['legendonly'])) {
+    $legendonly = 1; 
+    if (isset($_GET['swaplegend'])) {
+        $method = "swapLegend";
+    } else {
+        $method = "showMapLegend";
+    }
+} else {
+    $method = "updateToc";
+}
+
+$categories = $useCategories ? $_SESSION['categories'] : false;
+
+$toc = new Legend($map, $categories, $legendonly);
+$tocHTML = $toc->writeToc();
+
+header("Content-Type: text/plain; charset=$defCharset");
+
+// return JS object literals "{}" for XMLHTTP request 
+echo "{method:'$method', tocHTML:'$tocHTML'}";
+
+?>

Added: incphp/xajax/x_toc_update.php
===================================================================
--- incphp/xajax/x_toc_update.php	2006-10-05 22:45:01 UTC (rev 0)
+++ incphp/xajax/x_toc_update.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,47 @@
+<?php
+require_once("../group.php");
+session_start();
+require_once("../common.php");
+require_once("../globals.php");
+require_once("../legend.php");
+require_once("../custom.php"); 
+
+header("Content-Type: text/plain; charset=$defCharset");
+
+$scale         = $_SESSION["geo_scale"];
+$grouplist     = $_SESSION["grouplist"];
+$defGroups     = $_SESSION["defGroups"];
+$allGroups     = $_SESSION["allGroups"];
+$imgFormat     = $_SESSION["imgFormat"];
+$scaleLayers   = $_SESSION["scaleLayers"];
+//$layerAutoRefresh = $_SESSION['layerAutoRefresh'];
+
+// GET LAYERS FOR DRAWING AND IDENTIFY
+if (isset ($_SESSION["groups"]) && count($_SESSION["groups"]) > 0){
+    $groups = $_SESSION["groups"];
+} else {
+    $groups = $defGroups;
+}
+
+
+foreach ($grouplist as $grp){
+    if (in_array($grp->groupName, $allGroups, TRUE)) {
+        $grpName = $grp->getGroupName();
+        $grpDesc = $grp->getDescription();
+        $glayerList = $grp->getLayers();
+        
+        if (Legend::checkGroup($map, $grp, $scale)) {
+            $layerList[] = "$grpName:'vis'";
+        } else {
+            $layerList[] = "$grpName:'unvis'";
+        }
+    }
+}
+
+// JS layer object literal
+$layers = '{' . implode(',', $layerList) . '}';
+//error_log($layers);
+
+// return JS object literals "{}" for XMLHTTP request 
+echo "{method:'updateTocScale', layers: $layers}";
+?>
\ No newline at end of file

Added: index.html
===================================================================
--- index.html	2006-10-05 22:45:01 UTC (rev 0)
+++ index.html	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,33 @@
+<HTML>
+<HEAD>
+<SCRIPT LANGUAGE="JavaScript1.2">
+  function openFrames(sizevals, gLanguage, config, startParameters){
+    var sizearray = sizevals.split('#');
+    var winwidth  = parseInt(sizearray[0]);
+    var winheight = parseInt(sizearray[1]);
+    var winsize   = sizearray[2];
+    myw=window.open("map.phtml?winsize=" + winsize + "&language=" + gLanguage + "&config=" + config + startParameters, "MapServerTestSuite", "width=" + winwidth + ",height=" + winheight + ",menubar=no,scrollbar=auto,resizable=yes,top=0,left=0,status=yes");
+  }
+</SCRIPT>
+</HEAD>
+<HTML>
+<BODY bgcolor="white" >
+<h2> Examples how to start the application from hyperlinks</h2>
+
+
+<h3>Starting with different window size, style and language:</h3>
+<a href="javascript:openFrames('820#580#small', 'en', '', 'flat')">Small, layer flat view, English</a><p>
+<a href="javascript:openFrames('960#700#medium', 'de', '', '')">Medium, layer tree view, German </a><p>
+<a href="javascript:openFrames('1100#860#large', 'fr', '', '')">Large, layer tree view, French </a><p>
+<a href="javascript:openFrames('960#700#medium', 'en', '', 'world')">Medium, layer flat view, EN, World </a><p>
+<p><br><br>
+
+<h3>Zoom to pre-defined extent:</h3>
+<a href="javascript:openFrames('820#580#small', 'en', '', '&me=3678982,2134585,4721175,3092410')">Extent defined manually (x/y min/max)</a><p>
+<a href="javascript:openFrames('960#700#medium', 'it', '', '&zoomLayer=countries&zoomQuery=NAME at 1@Italy at 1@1')">Extent from feature (countries, Italy), Italian</a><p>
+<a href="javascript:openFrames('960#700#medium', 'it', '', '&zoomLayer=countries&zoomQuery=name at 1@Italy at 0@1')">Extent from feature, NO highlight</a><p>
+<a href="javascript:openFrames('960#700#medium', 'it', '', '&zoomLayer=countries&zoomQuery=NAME at 1@Italy at 0@0')">Extent from feature, NO highlight, NO max extent</a><p>
+<br>
+
+</BODY>
+</HTML>

Added: info.phtml
===================================================================
--- info.phtml	2006-10-05 22:45:01 UTC (rev 0)
+++ info.phtml	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,60 @@
+<?php
+/*********************************************************************************
+ Copyright (c) 2002-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+session_start();
+require_once($_SESSION['PM_INCPHP'] . "/common.php");
+require_once($_SESSION['PM_INCPHP'] . "/globals.php");
+
+header("Content-type: text/html; charset=$defCharset");
+
+$infoWin = $_SESSION['infoWin'];
+$alignQueryResults = $_SESSION['alignQueryResults'];
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo $gLanguage ?>" xml:lang="<?php echo $gLanguage ?>">
+
+<head>
+<title><?php echo (_p("Query Results")) ?></title>
+ <script type="text/javascript" src="<?php echo $_SESSION['PM_JAVASCRIPT'] ?>/common.js"></script>
+ <script type="text/javascript" src="<?php echo $_SESSION['PM_JAVASCRIPT'] ?>/sorttable.js"></script>
+ <script type="text/javascript" src="<?php echo $_SESSION['PM_JAVASCRIPT'] ?>/custom.js"></script>
+ <script type="text/javascript" src="<?php echo $_SESSION['PM_JAVASCRIPT'] ?>/pmjson.js"></script>
+ <script type="text/javascript" src="<?php echo ($_SESSION['PM_INCPHP_LOCATION'] . "/js_custom.php?" . SID) ?>"></script>
+
+ <script type="text/javascript">
+   var SID = '<?php echo SID ?>';
+   var resultJSON = <?php  echo $_SESSION['JSON_Results']; ?>;
+
+ </script>
+ 
+ <link rel="stylesheet" href="templates/default.css" type="text/css" />
+ <link rel="stylesheet" href="templates/query.css" type="text/css" />
+</head>
+
+<body  onload="writeQResult(); window.focus(); <?php if ($alignQueryResults) echo "ts_alignTables();" ?>">
+
+
+<div id="queryresult"></div>
+
+</body>
+</html>

Added: javascript/common.js
===================================================================
--- javascript/common.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/common.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,116 @@
+
+/**
+ * Returns the key-value-pairs of a form
+ * as URL encoded string
+ */
+function getFormKVP(formid) {
+    var htmlform = document.getElementById(formid);
+    var el = htmlform.elements;
+    var skvp = '';
+    for (var i=0; i < el.length; i++) {
+        if (el[i].name.length > 0) {
+            skvp += (i>0?'&':'') + escape(el[i].name)  + '=' + escape(el[i].value);
+        }
+    }
+    return skvp;
+}
+
+/**
+ * inArray function
+ * Returns true if the passed value is found in the
+ * array.  Returns false if it is not.
+ * Usage: if (myList.inArray('search term')) {
+ */
+Array.prototype.inArray = function (value)
+{
+    var i;
+    for (i=0; i < this.length; i++) {
+        // Matches identical (===), not just similar (==).
+        if (this[i] === value) {
+            return true;
+        }
+    }
+    return false;
+};
+
+
+/*  Prototype JavaScript framework, version 1.4.0
+ *  (c) 2005 Sam Stephenson <sam at conio.net>
+ *
+ *  Prototype is freely distributable under the terms of an MIT-style license.
+ *  For details, see the Prototype web site: http://prototype.conio.net/
+/*--------------------------------------------------------------------------*/
+function $() {
+    var elements = new Array();
+
+    for (var i = 0; i < arguments.length; i++) {
+        var element = arguments[i];
+        if (typeof element == 'string')
+            element = document.getElementById(element);
+
+        if (arguments.length == 1)
+            return element;
+
+        elements.push(element);
+    }
+
+    return elements;
+}
+
+
+/*
+ * DOM generic functions
+ ****************************/
+function getRawEl(obj) {
+    return document.getElementById(obj);
+}
+
+function rawLeft(obj) {
+    return parseInt($(obj).style.left);
+}
+
+function rawTop(obj) {
+    return parseInt($(obj).style.top);
+}
+
+function rawW(obj) {
+    return parseInt($(obj).style.width);
+}
+
+function rawH(obj) {
+    return parseInt($(obj).style.height);
+}
+
+function hideRaw(obj) {
+    $(obj).style.visibility = 'hidden';
+}
+
+function showRaw(obj) {
+    $(obj).style.visibility = 'visible';
+}
+
+
+function objLeft(obj) {	
+    return parseInt(obj.style.left || obj.offsetLeft);
+}
+
+function objTop(obj) {
+    return parseInt(obj.style.top || obj.offsetTop);
+}
+
+function objW(obj) {
+	return parseInt( obj.style.width || obj.clientWidth );
+}
+
+function objH(obj) {		
+    return parseInt( obj.style.height || obj.clientHeight);    
+}
+
+function hideObj(obj) {
+    obj.style.visibility = 'hidden';
+}
+
+function showObj(obj) {
+    obj.style.visibility = 'visible';
+}
+

Added: javascript/compress_js.php
===================================================================
--- javascript/compress_js.php	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/compress_js.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,64 @@
+<?php
+/*
+ * compress a javascript file by removing whitespace and optionally 
+ * modifying variable and function names
+ */
+
+
+function compressJS( $szJSfile, $szCJSfile )
+{
+    if (file_exists($szJSfile)) {
+        $szContents = file_get_contents($szJSfile);
+        
+        $aSearch = array('/\/\/.*/', // c++ style comments - //something
+                         '/\/\*.*\*\//sU', // c style comments - /* something */
+                         '/\s{2,}/s', //2 or more spaces down to one space
+                         '/\n/', //newlines removed
+                         '/\s*(=|;|\}|\{|\)|\(|\)|\+|\*|\-|\,|\/|>|<|:|\?|\|\||\&\&)\s*/',
+                         '/\}(\w+)/',
+                         '/\};(catch|finally|else)/',
+
+                         );
+        
+        $aReplace = array( '',
+                           '',
+                           ' ',
+                           '',
+                           '\1',
+                           '};\1',
+                           '}\1',
+                          );
+                          
+        //remove c++ comments
+        $szContents = preg_replace( $aSearch, $aReplace, $szContents );
+    
+        $cjsF = "compressed/$szCJSfile";
+        $fh = fopen($cjsF, "w");
+        fwrite( $fh, $szContents);
+        fclose($fh);
+        
+        $cratio = round(100 *(filesize($cjsF) / filesize($szJSfile)));
+        echo "compress ratio $cratio %\n";
+        
+    } else {
+        echo "File $szCJSfile not existing!";
+    }   
+}
+ 
+
+//compressJS('zoombox.js', 'zoombox.cjs');
+
+
+$fileList = scandir(".");
+//print_r($fileList);
+foreach ($fileList as $f) {
+    
+    if (substr($f, -3) == ".js") {
+        echo "compressing $f\n";
+        compressJS($f, $f);
+    }
+
+}
+
+
+?>

Added: javascript/custom.js
===================================================================
--- javascript/custom.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/custom.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,44 @@
+
+
+//
+// HYPERLINK FUNCTION FOR RESULT WINDOW
+//
+
+function openHyperlink(layer, fldName, fldValue) {
+    
+    switch(layer) {
+        case 'cities':
+            //if (fldName == 'CITY_NAME') {
+                window.open('http://en.wikipedia.org/wiki/' + fldValue, 'wikiquery');
+            //}
+            break;
+            
+        default:
+            alert ('See function openHyperlink in custom.js: ' + layer + ' - ' + fldName + ' - ' + fldValue);
+    }
+}
+
+
+
+function alertSize() {
+  var myWidth = 0, myHeight = 0;
+  if( typeof( window.innerWidth ) == 'number' ) {
+    //Non-IE
+    myWidth = window.innerWidth;
+    myHeight = window.innerHeight;
+  } else if( document.documentElement &&
+      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
+    //IE 6+ in 'standards compliant mode'
+    myWidth = document.documentElement.clientWidth;
+    myHeight = document.documentElement.clientHeight;
+  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
+    //IE 4 compatible
+    myWidth = document.body.clientWidth;
+    myHeight = document.body.clientHeight;
+  }
+  window.alert( 'Width = ' + myWidth );
+  window.alert( 'Height = ' + myHeight );
+}
+
+
+

Added: javascript/dragresize.js
===================================================================
--- javascript/dragresize.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/dragresize.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,14 @@
+/*
+
+DragResize v1.0
+(c) 2005-2006 Angus Turnbull, TwinHelix Designs http://www.twinhelix.com
+
+Licensed under the CC-GNU LGPL, version 2.1 or later:
+http://creativecommons.org/licenses/LGPL/2.1/
+This is distributed WITHOUT ANY WARRANTY; without even the implied
+warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+*/
+
+
+if(typeof addEvent!='function'){var addEvent=function(o,t,f,l){var d='addEventListener',n='on'+t,rO=o,rT=t,rF=f,rL=l;if(o[d]&&!l)return o[d](t,f,false);if(!o._evts)o._evts={};if(!o._evts[t]){o._evts[t]=o[n]?{b:o[n]}:{};o[n]=new Function('e','var r=true,o=this,a=o._evts["'+t+'"],i;for(i in a){o._f=a[i];r=o._f(e||window.event)!=false&&r;o._f=null}return r');if(t!='unload')addEvent(window,'unload',function(){removeEvent(rO,rT,rF,rL)})}if(!f._i)f._i=addEvent._i++;o._evts[t][f._i]=f};addEvent._i=1;var removeEvent=function(o,t,f,l){var d='removeEventListener';if(o[d]&&!l)return o[d](t,f,false);if(o._evts&&o._evts[t]&&f._i)delete o._evts[t][f._i]}}function cancelEvent(e,c){e.returnValue=false;if(e.preventDefault)e.preventDefault();if(c){e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation()}};function DragResize(myName,config){var props={myName:myName,enabled:true,handles:['tl','tm','tr','ml','mr','bl','bm','br'],isElement:null,isHandle:null,element:null,handle:null,minWidth:10,minHeight:10,minLeft:0,maxLeft:9999,minTop:0,maxTop:9999,zIndex:1,mouseX:0,mouseY:0,lastMouseX:0,lastMouseY:0,mOffX:0,mOffY:0,elmX:0,elmY:0,elmW:0,elmH:0,allowBlur:true,ondragfocus:null,ondragstart:null,ondragmove:null,ondragend:null,ondragblur:null};for(var p in props)this[p]=(typeof config[p]=='undefined')?props[p]:config[p]};DragResize.prototype.apply=function(node){var obj=this;addEvent(node,'mousedown',function(e){obj.mouseDown(e)});addEvent(node,'mousemove',function(e){obj.mouseMove(e)});addEvent(node,'mouseup',function(e){obj.mouseUp(e)})};DragResize.prototype.select=function(newElement){with(this){if(!document.getElementById||!enabled)return;if(newElement&&(newElement!=element)&&enabled){element=newElement;element.style.zIndex=++zIndex;if(this.resizeHandleSet)this.resizeHandleSet(element,true);elmX=parseInt(element.style.left);elmY=parseInt(element.style.top);elmW=element.offsetWidth;elmH=element.offsetHeight;if(ondragfocus)this.ondragfocus()}}};DragResize.prototype.deselect=function(delHandles){with(this){if(!document.getElementById||!enabled)return;if(delHandles){if(ondragblur)this.ondragblur();if(this.resizeHandleSet)this.resizeHandleSet(element,false);element=null}handle=null;mOffX=0;mOffY=0}};DragResize.prototype.mouseDown=function(e){with(this){if(!document.getElementById||!enabled)return true;var elm=e.target||e.srcElement,newElement=null,newHandle=null,hRE=new RegExp(myName+'-([trmbl]{2})','');while(elm){if(elm.className){if(!newHandle&&(hRE.test(elm.className)||isHandle(elm)))newHandle=elm;if(isElement(elm)){newElement=elm;break}}elm=elm.parentNode}if(element&&(element!=newElement)&&allowBlur)deselect(true);if(newElement&&(!element||(newElement==element))){if(newHandle)cancelEvent(e);select(newElement,newHandle);handle=newHandle;if(handle&&ondragstart)this.ondragstart(hRE.test(handle.className))}}};DragResize.prototype.mouseMove=function(e){with(this){if(!document.getElementById||!enabled)return true;mouseX=e.pageX||e.clientX+document.documentElement.scrollLeft;mouseY=e.pageY||e.clientY+document.documentElement.scrollTop;var diffX=mouseX-lastMouseX+mOffX;var diffY=mouseY-lastMouseY+mOffY;mOffX=mOffY=0;lastMouseX=mouseX;lastMouseY=mouseY;if(!handle)return true;var isResize=false;if(this.resizeHandleDrag&&this.resizeHandleDrag(diffX,diffY)){isResize=true}else{var dX=diffX,dY=diffY;if(elmX+dX<minLeft)mOffX=(dX-(diffX=minLeft-elmX));else if(elmX+elmW+dX>maxLeft)mOffX=(dX-(diffX=maxLeft-elmX-elmW));if(elmY+dY<minTop)mOffY=(dY-(diffY=minTop-elmY));else if(elmY+elmH+dY>maxTop)mOffY=(dY-(diffY=maxTop-elmY-elmH));elmX+=diffX;elmY+=diffY}with(element.style){left=elmX+'px';width=elmW+'px';top=elmY+'px';height=elmH+'px'}if(window.opera&&document.documentElement){var oDF=document.getElementById('op-drag-fix');if(!oDF){var oDF=document.createElement('input');oDF.id='op-drag-fix';oDF.style.display='none';document.body.appendChild(oDF)}oDF.focus()}if(ondragmove)this.ondragmove(isResize);cancelEvent(e)}};DragResize.prototype.mouseUp=function(e){with(this){if(!document.getElementById||!enabled)return;var hRE=new RegExp(myName+'-([trmbl]{2})','');if(handle&&ondragend)this.ondragend(hRE.test(handle.className));deselect(false)}};DragResize.prototype.resizeHandleSet=function(elm,show){with(this){if(!elm._handle_tr){for(var h=0;h<handles.length;h++){var hDiv=document.createElement('div');hDiv.className=myName+' '+myName+'-'+handles[h];elm['_handle_'+handles[h]]=elm.appendChild(hDiv)}}for(var h=0;h<handles.length;h++){elm['_handle_'+handles[h]].style.visibility=show?'inherit':'hidden'}}};DragResize.prototype.resizeHandleDrag=function(diffX,diffY){with(this){var hClass=handle&&handle.className&&handle.className.match(new RegExp(myName+'-([tmblr]{2})'))?RegExp.$1:'';var dY=diffY,dX=diffX,processed=false;if(hClass.indexOf('t')>=0){rs=1;if(elmH-dY<minHeight)mOffY=(dY-(diffY=elmH-minHeight));else if(elmY+dY<minTop)mOffY=(dY-(diffY=minTop-elmY));elmY+=diffY;elmH-=diffY;processed=true}if(hClass.indexOf('b')>=0){rs=1;if(elmH+dY<minHeight)mOffY=(dY-(diffY=minHeight-elmH));else if(elmY+elmH+dY>maxTop)mOffY=(dY-(diffY=maxTop-elmY-elmH));elmH+=diffY;processed=true}if(hClass.indexOf('l')>=0){rs=1;if(elmW-dX<minWidth)mOffX=(dX-(diffX=elmW-minWidth));else if(elmX+dX<minLeft)mOffX=(dX-(diffX=minLeft-elmX));elmX+=diffX;elmW-=diffX;processed=true}if(hClass.indexOf('r')>=0){rs=1;if(elmW+dX<minWidth)mOffX=(dX-(diffX=minWidth-elmW));else if(elmX+elmW+dX>maxLeft)mOffX=(dX-(diffX=maxLeft-elmX-elmW));elmW+=diffX;processed=true}return processed}};
\ No newline at end of file

Added: javascript/dtree.js
===================================================================
--- javascript/dtree.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/dtree.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,395 @@
+/*--------------------------------------------------|
| dTree 2.05 | www.destroydrop.com/javascript/tree/ |
|---------------------------------------------------|
| Copyright (c) 2002-2003 Geir Landrö               |
|                                                   |
| This script can be used freely as long as all     |
| copyright messages are intact.                    |
|                                                   |
| Updated: 17.04.2003                               |
|--------------------------------------------------*/
+/*
+
+ Modifications for use with p.mapper by Armin Burger
+
+*/
+
+// Node object
function Node(id, pid, name, url, title, target, icon, iconOpen, open, value, sl_value, checktype) {
+	this.id = id;
+	this.pid = pid;
+	this.name = name;
+	this.url = url;
+	this.title = title;
+	this.target = target;
+	this.icon = icon;
+	this.iconOpen = iconOpen;
+    this.value = value;
+    this.sl_value = sl_value;
+    this.checktype = checktype;
+	this._io = open || false;
+	this._is = false;
+	this._ls = false;
+	this._hc = false;
+	this._ai = 0;
+	this._p;
+};
+
+// Tree object
function dTree(objName) {
+	this.config = {
+		target			: null,
+		folderLinks		: true,
+		useSelection	: true,
+		useCookies		: true,
+		useLines		: true,
+		useIcons		: true,
+		useStatusText	: false,
+		closeSameLevel	: false,
+		inOrder			: false,
+        wmsdlg  	    : false
+	};
+    var imgBasePath = (this.config.wmsdlg ? '../' : '');
+    //alert(this.config.useIcons);
+	
+    this.icon = {
+        root			: imgBasePath + 'images/tree/layers.gif',
+		//folder			: imgBasePath + 'images/tree/folder.gif',
+		//folderOpen	    : imgBasePath + 'images/tree/folderopen.gif',
+        folder			: imgBasePath + 'images/tree/layers.gif',
+		folderOpen	    : imgBasePath + 'images/tree/layers.gif',
+		//node			: imgBasePath + 'images/tree/page.gif',
+        node			: imgBasePath + 'images/tree/layers.gif',
+		empty			: imgBasePath + 'images/tree/empty.gif',
+		line			: imgBasePath + 'images/tree/line.gif',
+		join			: imgBasePath + 'images/tree/join.gif',
+		joinBottom	    : imgBasePath + 'images/tree/joinbottom.gif',
+		plus			: imgBasePath + 'images/tree/plus.gif',
+		plusBottom	    : imgBasePath + 'images/tree/plusbottom.gif',
+		minus			: imgBasePath + 'images/tree/minus.gif',
+		minusBottom	    : imgBasePath + 'images/tree/minusbottom.gif',
+		nlPlus			: imgBasePath + 'images/tree/nolines_plus.gif',
+		nlMinus			: imgBasePath + 'images/tree/nolines_minus.gif'
+	};
+	this.obj = objName;
+	this.aNodes = [];
+	this.aIndent = [];
+	this.root = new Node(-1);
+	this.selectedNode = null;
+	this.selectedFound = false;
+	this.completed = false;
+};
+
+// Adds a new node to the node array
+dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open, value, sl_value, checktype) {
+	this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open, value, sl_value, checktype);
+};
+
+// Open/close all nodes
+dTree.prototype.openAll = function() {
+	this.oAll(true);
+};
+dTree.prototype.closeAll = function() {
+	this.oAll(false);
+};
+
+// Outputs the tree to the page
+dTree.prototype.toString = function() {
+	var str = '<div class="dtree">\n';
+	if (document.getElementById) {
+		if (this.config.useCookies) this.selectedNode = this.getSelected();
+		str += this.addNode(this.root);
+	} else str += 'Browser not supported.';
+	str += '</div>';
+	
+    if (!this.selectedFound) this.selectedNode = null;
+	this.completed = true;
+	
+    return str;
+};
+
+// Creates the tree structure
+dTree.prototype.addNode = function(pNode) {
+	var str = '';
+	var n=0;
+	if (this.config.inOrder) n = pNode._ai;
+	for (n; n<this.aNodes.length; n++) {
+		if (this.aNodes[n].pid == pNode.id) {
+			var cn = this.aNodes[n];
+			cn._p = pNode;
+			cn._ai = n;
+			this.setCS(cn);
+			
+            if (!cn.target && this.config.target) cn.target = this.config.target;
+			if (cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id);
+			if (!this.config.folderLinks && cn._hc) cn.url = null;
+			if (this.config.useSelection && cn.id == this.selectedNode && !this.selectedFound) {
+					cn._is = true;
+					this.selectedNode = n;
+					this.selectedFound = true;
+			}
+			str += this.node(cn, n);
+			if (cn._ls) break;
+		}
+	}
+	return str;
+};
+
+// Creates the node icon, url and text
+dTree.prototype.node = function(node, nodeId) {
+	var str = '<div class="dTreeNode">' + this.indent(node, nodeId);
+    
+    
+    //--------------------------------------------------------------------------------------------------------------------------
+    
+    // Checkbox and radio button
+    if (node.checktype == 1) {
+        var chckd = (node.value.match(/default/) ? ' checked ' : '');
+        str += '<input type="radio" value="' + node.value + '" name="' + node.sl_value + '" ' + chckd + '>';
+    } else if (node.checktype == 2) {
+        if (node.id > 0) {
+            var cbxName = (this.config.wmsdlg ? 'wmslayers' : 'groups');
+            str += '<input type="checkbox" value="' + node.value + '" name="' + cbxName + '" id="laycbx_' + node.value + '"  onClick="javascript:setlayers()">';
+        }
+    }
+    
+    //--------------------------------------------------------------------------------------------------------------------------
+    
+    
+	if (this.config.useIcons) {
+		if (!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);
+		if (!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node;
+		if (this.root.id == node.pid) {
+			node.icon = this.icon.root;
+			node.iconOpen = this.icon.root;
+		}
+		str += '<img id="i' + this.obj + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" />';
+	} else {
+        if (node.icon)
+            str += '<img id="i' + this.obj + nodeId + '" src="' +  node.icon + '" alt="" />';
+    }
+	if (node.url) {
+		str += '<a id="s' + this.obj + nodeId + '" class="' + ((this.config.useSelection) ? ((node._is ? 'nodeSel' : 'node')) : 'node') + '" href="' + node.url + '"';
+		if (node.title) str += ' title="' + node.title + '"';
+		if (node.target) str += ' target="' + node.target + '"';
+		if (this.config.useStatusText) str += ' onmouseover="window.status=\'' + node.name + '\';return true;" onmouseout="window.status=\'\';return true;" ';
+		if (this.config.useSelection && ((node._hc && this.config.folderLinks) || !node._hc))
+			str += ' onclick="javascript: ' + this.obj + '.s(' + nodeId + ');"';
+		str += '>';
+	}
+	else if ((!this.config.folderLinks || !node.url) && node._hc && node.pid != this.root.id)
+		str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');" class="node">';
+	
+    // -------------------------------------------------------------------------
+    // SPANs for the group name
+    str += '<span id="sp_' + node.value + '" class="vis"><span ';
+    if (node.pid == 0)  str += 'class="maingrp"';
+    str += '>' + node.name + '</span></span>';
    
+    // -------------------------------------------------------------------------
+    
+    
+	if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += '</a>';
+	str += '</div>';
+	if (node._hc) {
+		str += '<div id="d' + this.obj + nodeId + '" class="clip" style="display:' + ((this.root.id == node.pid || node._io) ? 'block' : 'none') + ';">';
+		str += this.addNode(node);
+		str += '</div>';
    }
+	this.aIndent.pop();
+	return str;
+};
+
+// Adds the empty and line icons
+dTree.prototype.indent = function(node, nodeId) {
+	var str = '';
+	if (this.root.id != node.pid) {
+		for (var n=0; n<this.aIndent.length; n++)
+			str += '<img src="' + ( (this.aIndent[n] == 1 && this.config.useLines) ? this.icon.line : this.icon.empty ) + '" alt="" />';
+		(node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);
+		if (node._hc) {
+			str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');"><img id="j' + this.obj + nodeId + '" src="';
+			if (!this.config.useLines) str += (node._io) ? this.icon.nlMinus : this.icon.nlPlus;
+			else str += ( (node._io) ? ((node._ls && this.config.useLines) ? this.icon.minusBottom : this.icon.minus) : ((node._ls && this.config.useLines) ? this.icon.plusBottom : this.icon.plus ) );
+			str += '" alt="" /></a>';
+		} else str += '<img src="' + ( (this.config.useLines) ? ((node._ls) ? this.icon.joinBottom : this.icon.join ) : this.icon.empty) + '" alt="" />';
+	}
+	return str;
+};
+
+// Checks if a node has any children and if it is the last sibling
+dTree.prototype.setCS = function(node) {
+	var lastId;
+	for (var n=0; n<this.aNodes.length; n++) {
+		if (this.aNodes[n].pid == node.id) node._hc = true;
+		if (this.aNodes[n].pid == node.pid) lastId = this.aNodes[n].id;
+	}
+	if (lastId==node.id) node._ls = true;
+};
+
+// Returns the selected node
+dTree.prototype.getSelected = function() {
+	var sn = this.getCookie('cs' + this.obj);
+	return (sn) ? sn : null;
+};
+
+// Highlights the selected node
+dTree.prototype.s = function(id) {
+	if (!this.config.useSelection) return;
+	var cn = this.aNodes[id];
+	if (cn._hc && !this.config.folderLinks) return;
+	if (this.selectedNode != id) {
+		if (this.selectedNode || this.selectedNode==0) {
+			eOld = document.getElementById("s" + this.obj + this.selectedNode);
+			eOld.className = "node";
+		}
+		eNew = document.getElementById("s" + this.obj + id);
+		eNew.className = "nodeSel";
+		this.selectedNode = id;
+		if (this.config.useCookies) this.setCookie('cs' + this.obj, cn.id);
+	}
+};
+
+// Toggle Open or close
+dTree.prototype.o = function(id) {
+	var cn = this.aNodes[id];
+	this.nodeStatus(!cn._io, id, cn._ls);
+	cn._io = !cn._io;
+	if (this.config.closeSameLevel) this.closeLevel(cn);
+	if (this.config.useCookies) this.updateCookie();
+};
+
+// Open or close all nodes
+dTree.prototype.oAll = function(status) {
+	for (var n=0; n<this.aNodes.length; n++) {
+		if (this.aNodes[n]._hc && this.aNodes[n].pid != this.root.id) {
+			this.nodeStatus(status, n, this.aNodes[n]._ls)
+			this.aNodes[n]._io = status;
		}
+	}
+	if (this.config.useCookies) this.updateCookie();
+};
+
+// Opens the tree to a specific node
+dTree.prototype.openTo = function(nId, bSelect, bFirst) {
+	if (!bFirst) {
+		for (var n=0; n<this.aNodes.length; n++) {
+			if (this.aNodes[n].id == nId) {
+				nId=n;
+				break;
			}
+		}
+	}
+	var cn=this.aNodes[nId];
+	if (cn.pid==this.root.id || !cn._p) return;
+	cn._io = true;
+	cn._is = bSelect;
+	if (this.completed && cn._hc) this.nodeStatus(true, cn._ai, cn._ls);
+	if (this.completed && bSelect) this.s(cn._ai);
+	else if (bSelect) this._sn=cn._ai;
+	this.openTo(cn._p._ai, false, true);
+};
+
+// Closes all nodes on the same level as certain node
+dTree.prototype.closeLevel = function(node) {
+	for (var n=0; n<this.aNodes.length; n++) {
+		if (this.aNodes[n].pid == node.pid && this.aNodes[n].id != node.id && this.aNodes[n]._hc) {
+			this.nodeStatus(false, n, this.aNodes[n]._ls);
+			this.aNodes[n]._io = false;
+			this.closeAllChildren(this.aNodes[n]);
+		}
+	}
+}
+
+// Closes all children of a node
+dTree.prototype.closeAllChildren = function(node) {
+	for (var n=0; n<this.aNodes.length; n++) {
+		if (this.aNodes[n].pid == node.id && this.aNodes[n]._hc) {
+			if (this.aNodes[n]._io) this.nodeStatus(false, n, this.aNodes[n]._ls);
+			this.aNodes[n]._io = false;
+			this.closeAllChildren(this.aNodes[n]);		
+		}
+	}
+}
+
+// Change the status of a node(open or closed)
+dTree.prototype.nodeStatus = function(status, id, bottom) {
+	eDiv	= document.getElementById('d' + this.obj + id);
+	eJoin	= document.getElementById('j' + this.obj + id);
+	if (this.config.useIcons) {
+		eIcon	= document.getElementById('i' + this.obj + id);
+		eIcon.src = (status) ? this.aNodes[id].iconOpen : this.aNodes[id].icon;
+	}
+	eJoin.src = (this.config.useLines)?
+	((status)?((bottom)?this.icon.minusBottom:this.icon.minus):((bottom)?this.icon.plusBottom:this.icon.plus)):
+	((status)?this.icon.nlMinus:this.icon.nlPlus);
+	eDiv.style.display = (status) ? 'block': 'none';
+};
+
+// [Cookie] Clears a cookie
+dTree.prototype.clearCookie = function() {
+	var now = new Date();
+	var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
+	this.setCookie('co'+this.obj, 'cookieValue', yesterday);
+	this.setCookie('cs'+this.obj, 'cookieValue', yesterday);
+};
+
+// [Cookie] Sets value in a cookie
+dTree.prototype.setCookie = function(cookieName, cookieValue, expires, path, domain, secure) {
+	document.cookie =
+		escape(cookieName) + '=' + escape(cookieValue)
+		+ (expires ? '; expires=' + expires.toGMTString() : '')
+		+ (path ? '; path=' + path : '')
		+ (domain ? '; domain=' + domain : '')
+		+ (secure ? '; secure' : '');
+};
+
+// [Cookie] Gets a value from a cookie
+dTree.prototype.getCookie = function(cookieName) {
+	var cookieValue = '';
+	var posName = document.cookie.indexOf(escape(cookieName) + '=');
+	if (posName != -1) {
+		var posValue = posName + (escape(cookieName) + '=').length;
+		var endPos = document.cookie.indexOf(';', posValue);
+		if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));
+		else cookieValue = unescape(document.cookie.substring(posValue));
+	}
+	return (cookieValue);
+};
+
+// [Cookie] Returns ids of open nodes as a string
+dTree.prototype.updateCookie = function() {
+	var str = '';
+	for (var n=0; n<this.aNodes.length; n++) {
+		if (this.aNodes[n]._io && this.aNodes[n].pid != this.root.id) {
+			if (str) str += '.';
+			str += this.aNodes[n].id;
+		}
+	}
+	this.setCookie('co' + this.obj, str);
+};
+
+// [Cookie] Checks if a node id is in a cookie
+dTree.prototype.isOpen = function(id) {
+	var aOpen = this.getCookie('co' + this.obj).split('.');
+	for (var n=0; n<aOpen.length; n++)
+		if (aOpen[n] == id) return true;
+	return false;
+};
+
+// If Push and pop is not implemented by the browser
+if (!Array.prototype.push) {
+	Array.prototype.push = function array_push() {
+		for(var i=0;i<arguments.length;i++)
+			this[this.length]=arguments[i];
+		return this.length;
+	}
+};
+if (!Array.prototype.pop) {
+	Array.prototype.pop = function array_pop() {
+		lastElement = this[this.length-1];
+		this.length = Math.max(this.length-1,0);
+		return lastElement;
+	}
+};
+
+
+
+
+//-----------------------------------------------------------------------
+
+
+
+
+
+
+
+
+
+//-----------------------------------------------------------------------
+
+

Added: javascript/geometry.js
===================================================================
--- javascript/geometry.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/geometry.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,380 @@
+/*********************************************************
+
+  Geometry library by Federico Nieri, Commune di Prato
+
+
+**********************************************************/
+
+
+/**************************************/
+/*************   POINT   **************/
+/**************************************/
+
+/**
+ * Point constructor
+ * @param x: x coordinate
+ * @param y: y coordinate
+ */
+function Point(x,y){	
+	this.x = parseFloat(x);
+	this.y = parseFloat(y);
+}
+
+/**
+ * Overriting of the standard toString Object method.
+ * @param xySeparator: chars separating x coordinate from y coordinate of a point. Default " ".
+ * @return a string that is the sequence of the point coordinates
+ *
+ * Example:
+ * var p = new Point(1,2);
+ * p.toString();    // return "1 2"
+ * p.toString("|"); // return "1|2"
+ */
+Point.prototype.toString = function(xySeparator){
+	xySeparator = !xySeparator ? " " : ("" + xySeparator);
+	return (this.x + xySeparator + this.y);
+}
+
+/**
+ * Return true if this point has the same coordinates of the passed point
+ * @param otherPoint: Point object to compare
+ */
+Point.prototype.equals = function(otherPoint){
+	return (this.x == otherPoint.x && this.y == otherPoint.y);
+}
+
+/**************************************/
+/*************    LINE    *************/
+/**************************************/
+
+/**
+ * Line constructor
+ * @param firstPoint:  first Point objetc
+ * @param secondPoint: second Point objetc
+ */
+function Line(firstPoint,secondPoint){
+	this.firstPoint = firstPoint;
+	this.secondPoint = secondPoint;	
+}
+
+/**
+ * Return true if this line has defining points with same coordinates of those
+ * defining the passed line
+ * @param otherPoint: Line object to compare
+ */
+Line.prototype.equals = function(otherLine){
+	return (this.getFirstPoint().equals(otherLine.getFirstPoint()) && this.getSecondPoint().equals(otherLine.getSecondPoint()));
+}
+
+/**
+ * Return the length of the line (distance from first point to second point)
+ */
+Line.prototype.getLength = function(){
+	return Math.sqrt((Math.pow(this.secondPoint.x - this.firstPoint.x, 2)) + (Math.pow(this.secondPoint.y - this.firstPoint.y, 2)));
+}
+
+/**
+ * Return the first Point object of the line
+ */
+Line.prototype.getFirstPoint = function(){
+	return this.firstPoint;
+}
+
+/**
+ * Return the second Point object of the line
+ */
+Line.prototype.getSecondPoint = function(){
+	return this.secondPoint;
+}
+
+/**
+ * Overriting of the standard toString Object method.
+ * @param xySeparator: chars separating x coordinate from y coordinate of a point. Default " ".
+ * @param ptSeparator: chars separating first point coordinates from second point coordinates. Default ",".
+ * @return a string that is the sequence of the first point coordinates and the second point coordinates
+ *
+ * Example:
+ * var p1 = new Point(1,2);
+ * var p2 = new Point(3,4);
+ * var ln = new Line(p1,p2);
+ * ln.toString();         // return "1 2,3 4"
+ * ln.toString("|","-");  // return "1|2-3|4"
+ * var s = "" + ln;       // s = "1 2,3 4"
+ */
+Line.prototype.toString = function(xySeparator, ptSeparator){
+
+	if(!xySeparator) xySeparator=" ";
+	if(!ptSeparator) ptSeparator=",";
+	
+	return (this.firstPoint.toString() + ptSeparator + this.secondPoint.toString());
+}
+
+/***************************************/
+/******   POLYGON (POLYLINE)  **********/
+/***************************************/
+
+/**
+ * Polygon constructor
+ * @param points: array of Point objects (vertexes of polygon)
+ */
+function Polygon(points){
+	this.setPoints(points);
+}
+
+/**
+ * Return the area of the polyon. If the polyline is not closed or the number of
+ * points is less than 4 (closed triangol) the returned value is 0.
+ */
+Polygon.prototype.getArea = function(){
+	
+	if(!this.isClosed()) return 0;
+	
+	var points = this.getPoints();
+	
+	if(points.length < 4) return 0;
+		    
+    var area = 0;
+    for(var k=0; k < (points.length-1) ; k++) {        	
+       area += (( points[k+1].x - points[k].x ) * ( points[k+1].y + points[k].y ));                     
+    }
+    area = area / 2;    
+    return area;	
+    
+}
+
+/**
+ * Return the length of the polyline (perimeter of polygon).
+ */
+Polygon.prototype.getPerimeter = function(){
+	
+	var nSides = this.getSidesNumber();
+	var perimeter = 0;
+	
+    for(var n = 1; n <= nSides ; n++) {        	
+       perimeter += this.getSideLength(n);
+    }
+    
+    return perimeter;	
+}
+
+/**
+ * Return an array containing all the points of the polyline
+ */
+Polygon.prototype.getPoints = function(){
+	var tmpPoints = new Array();
+	for(var i = 0 ; i < this.points.length; i++){
+		tmpPoints[i] = this.points[i];
+	}
+	return tmpPoints;
+}
+
+/**
+ * Return the point specified. Indexes start from 0.
+ * @param index: index of the point in the list
+ */ 
+Polygon.prototype.getPoint = function(index){
+	return this.points[index];
+}
+
+/**
+ * Set the array of points defining the polyline
+ * @param points: array of Point objects
+ */
+Polygon.prototype.setPoints = function(points){
+	if(points && points instanceof Array){
+		this.points = points;
+	}else{
+		this.points = new Array();
+	}
+}
+
+/**
+ * Add a point a the end of the polyline
+ * @param point: Point object
+ */
+Polygon.prototype.addPoint = function(point){
+	this.points.push(point);
+}
+
+/**
+ * Return the number of points of the polyline
+ */
+Polygon.prototype.getPointsNumber = function(){	
+	return this.points.length;
+}
+
+/**
+ * Return the number of sides
+ */
+Polygon.prototype.getSidesNumber = function(){	
+	return this.points.length-1;
+}
+
+/**
+ * Return an array containing the list of the x coordinate of all points 
+ */
+Polygon.prototype.getXList = function(){	
+	var xList = new Array();
+	for(var i = 0 ; i < this.points.length; i++){
+		xList[i] = this.points[i].x;
+	}
+	return xList;
+}
+
+/**
+ * Return an array containing the list of the y coordinate of all points 
+ */
+Polygon.prototype.getYList = function(){	
+	var yList = new Array();
+	for(var i = 0 ; i < this.points.length; i++){
+		yList[i] = this.points[i].y;
+	}
+	return yList;
+}
+
+/**
+ * Delete the point specified by index
+ * @param index: index of the point to delete
+ */
+Polygon.prototype.delPoint = function(index){
+	this.points.splice(index,1);
+}
+
+/**
+ * Close the polyline, to obtain a polygon, if this isn't closed yet.
+ * A polyline is closed if the last point is equals to the first one.
+ */
+Polygon.prototype.close = function(){
+	if(!this.isClosed()){
+		this.addPoint(this.getPoint(0));
+	}
+}
+
+/**
+ * Return true if the last point is equals to the first one, 
+ * false otherwise.
+ */
+Polygon.prototype.isClosed = function(){
+	var points = this.getPoints();
+	return points[0].equals(points[points.length-1]);
+}
+
+
+
+/* resituisce la lunghezza del lato indicato.
+   Il numero dei lati comincia dal lato 1 */
+Polygon.prototype.getSideLength = function(sideNumber){
+	return Math.sqrt((Math.pow(this.points[sideNumber].x - this.points[sideNumber-1].x, 2)) + (Math.pow(this.points[sideNumber].y - this.points[sideNumber-1].y, 2)));
+}
+
+/**
+ * Return a Line object that is the last side of the polyline
+ * Indexes start from 1
+ * @param sideNumber: index of the sides
+ */
+Polygon.prototype.getSide = function(sideNumber){
+	if(sideNumber==0) return null;
+	if(sideNumber > this.getSidesNumber()) return null;
+	
+	return new Line(this.getPoint(sideNumber-1),this.getPoint(sideNumber));
+}
+
+/**
+ * Return the last Line object of the polyline
+ */
+Polygon.prototype.getLastSide = function(){
+	return this.getSide(this.getSidesNumber());
+}
+
+/**
+ * Return the first Line object of the polyline
+ */
+Polygon.prototype.getFirstSide = function(){
+	return this.getSide(1);
+}
+
+/**
+ * Reset the array of points defining the polyline
+ */
+Polygon.prototype.reset = function(){
+	this.points.length = 0;
+}
+
+/**
+ * Overriting of the standard toString Object method.
+ * @param xySeparator: chars separating x coordinate from y coordinate of a point. Default " ".
+ * @param ptSeparator: chars separating points coordinates from one to another. Default ",".
+ * @return a string that is the sequence of points coordinates of the polyline
+ *
+ * Example:
+ * var p1 = new Point(1,2);
+ * var p2 = new Point(3,4);
+ * var p3 = new Point(5,6);
+ * var points = new Array(p1,p2,p3);
+ * var poly = new Polygon(points);
+ *
+ * poly.toString();       // return "1 2,3 4,5 6"
+ * poly.toString("|","-");  // return "1|2-3|4-5|6"
+ * var s = "" + poly;       // s = "1 2,3 4,5 6"
+ */
+Polygon.prototype.toString = function(xySeparator, ptSeparator){
+	
+	if(!xySeparator) xySeparator=" ";
+	if(!ptSeparator) ptSeparator=",";
+			
+	var pointsString = "";
+	var points = this.getPoints();
+	
+	for(var i = 0; i < points.length; i++){
+		pointsString += points[i].toString(xySeparator);
+		if(i < (points.length-1)){
+			pointsString += ptSeparator;
+		}
+	}
+	return pointsString;
+}
+
+
+/*
+
+var p1 = new Point(0,4); // 1
+var p2 = new Point(3,0); // 2
+var p3 = new Point(0,4); // 1
+var p4 = new Point(3,0); // 2
+var p5 = new Point(4,0); // 3
+
+var l1 = new Line(p1,p2);
+var l2 = new Line(p3,p4);
+var l3 = new Line(p4,p5);
+
+var pol = new Polygon([p1,p2,p3]);
+alert(" p1 uguale a p2 ? "+p1.equals(p2));
+alert(" p1 uguale a p3 ? "+p1.equals(p3));
+alert(" l1 uguale a l2 ? "+l1.equals(l2));
+alert(" l1 uguale a l3 ? "+l1.equals(l3));
+alert(" l1.toString() = "+l1.toString());
+alert(" pol.toString('_','|') = "+pol.toString("_","|"));
+*/
+/*
+var points = new Array();
+
+points[0] = p1;
+points[1] = p2;
+points[2] = p3;
+
+var pol = new Polygon();
+
+pol.addPoint(p1);
+pol.addPoint(p2);
+pol.addPoint(p3);
+
+alert("1 - is closed : ("+pol+") " + pol.isClosed());
+
+alert("1 - Area = " + pol.getArea());
+pol.close();
+
+alert("2 - is closed : ("+pol+") " + pol.isClosed());
+alert("2 - Area  = " + pol.getArea());
+alert("2 - Perim = " + pol.getPerimeter());
+
+*/
\ No newline at end of file

Added: javascript/mapserver.js
===================================================================
--- javascript/mapserver.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/mapserver.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,576 @@
+/*********************************************************************************
+ Copyright (c) 2002-2005 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+
+//********************************************************
+// CONFIGURATION
+//********************************************************//
+
+
+// SET TO TRUE IF CURSOR SHALL CHANGE ACCORDING TO ACTIVE TOOL
+var useCustomCursor = true;
+
+
+
+//******************************************************* //
+//         JAVASCRIPT FUNCTIONS FOR ZOOM, QUERY,          //
+//******************************************************* //
+
+/* Specifies how far (in pixels) a user needs to drag the mouse
+ * to enable zoom to rectangle, otherwise zoom to point.
+ * Should be set to >3
+ ****************************************************************/
+var jitter = 10;
+
+
+/*****************************************************************************
+ * FUNCTION IS CALLED BY ZOOMBOX -> FUNCTION chkMouseUp(e)
+ * main function for zoom/pan interface
+ * calls different zoom functions (see below)
+ *****************************************************************************/
+function zoombox_apply(minx, miny, maxx, maxy) {
+    var imgbox = minx + "+" + miny + "+" + maxx + "+" + maxy;
+    var imgxy  = minx + "+" + miny;
+
+    // NORMAL MOUSE ACTIONS IN MAIN MAP //
+    if (refmapClick == false) {
+
+        // ZOOM/PAN ACTIONS
+        var varform = document.getElementById("varform");
+        if (varform.mode.value == 'map' || rightMouseButton) {
+            showloading();
+            // Only click
+            if ((minx + jitter) > maxx && (miny + jitter) > maxy) {
+                if (varform.zoom_type.value == 'zoomrect') {
+                    if (rightMouseButton) {
+                        zoom_factor = 1; 
+                    } else {
+                        zoom_factor = 2;
+                    }
+                    zoompoint(zoom_factor, imgxy);
+                    
+                } else {
+                   // Pan
+                   var zoom_factor = varform.zoom_factor.value;
+                   zoompoint(zoom_factor, imgxy);
+                }
+            
+            // Zoombox 
+            } else {
+                zoomin(imgbox);
+            }
+
+        // QUERY/IDENTIFY ACTIONS
+        // query on all visible groups
+        } else if (varform.mode.value == 'query') {
+            showqueryresult('query', imgxy);
+        // query only on selected group with multiselect
+        } else if (varform.mode.value == 'nquery') {
+        	var selform = document.getElementById("selform");
+            if (!selform.selgroup) return false;
+            if (selform.selgroup.selectedIndex != -1) {
+                // only with single click
+                if ((minx + jitter) > maxx && (miny + jitter) > maxy) {     // x/y point
+                    showqueryresult('nquery', imgxy);
+                // with zoom box
+                } else {
+                    showqueryresult('nquery', imgbox);                      // rectangle
+                }
+            }
+            
+        } else if (varform.mode.value == 'digitize') {
+            openDigitizeDlg(imgxy);
+        } else if (varform.mode.value == 'poi') {
+            openPoiDlg(imgxy);
+        } else if (varform.mode.value == 'coords') {
+            showCoords(imgxy);
+        }
+
+    // ACTIONS IN REF MAP //
+    } else {
+        zoomref(imgxy);
+    }
+}
+
+
+
+/*****************************************************************************
+ * ZOOM FUNCTIONS
+ *******************/
+
+
+/*
+ * ZOOM TO POINT
+ *****************/
+function zoompoint(zoomfactor, imgxy) {
+    var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&mode=map&zoom_type=zoompoint&zoom_factor='+zoomfactor+'&imgxy='+imgxy;
+    showloading();
+    updateMap(mapurl, '');
+}
+
+/*
+ * ZOOM TO RECTANGLE
+ ********************/
+function zoomin(extent) {
+    var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&mode=map&zoom_type=zoomrect&imgbox='+extent  ;
+    //alert(mapurl);
+    updateMap(mapurl, '');
+}
+
+/*
+ * ZOOM TO GEO-EXTENT (MAP UNITS), APPLIED FROM INFO PAGE LINK
+ ***************************************************************/
+function zoom2extent(layer,idx,geoextent) {
+    showloading();
+    /*if (top.infoWin == "frame") {
+       stoploading();
+    } else {
+       opener.parent.mapFrame.stoploading();
+    }*/
+    // Check if resultlayers shall be passed
+    if (layer == 0 && idx == 0) {                            // no
+        var layerstring = '';
+    } else {
+        var layerstring = '&resultlayer='+layer+'+'+idx;     // yes
+    }
+    var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&mode=map&zoom_type=zoomextent&extent='+geoextent+layerstring;
+    //document.varform.zoomselected.value = '1';
+    updateMap(mapurl, '');
+}
+
+/*
+ * ZOOM TO FULL EXTENT
+ **********************/
+function zoomfullext() {
+    showloading();
+    var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&mode=map&zoom_type=zoomfull';
+    updateMap(mapurl, '');
+}
+
+/*
+ * GO BACK TO PEVIOUS EXTENT
+ ******************************/
+function goback() {
+    showloading();
+    var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&mode=map&zoom_type=zoomback';
+    updateMap(mapurl, '');
+}
+
+/*
+ * GO FORWARD
+ ******************************/
+function gofwd() {
+    showloading();
+    var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&mode=map&zoom_type=zoomfwd';
+    updateMap(mapurl, '');
+}
+
+
+// DRAW MAP WITH NEW LAYERS/GROUPS
+function changeLayersDraw() {
+   	showloading();
+    var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&zoom_type=zoompoint';
+    updateMap(mapurl, '');
+}
+
+
+
+function clickStopLoading() {
+    stoploading();
+    if (document.all) { 
+        document.execCommand('Stop')
+    } else {
+        window.stop();
+    }
+}
+
+
+
+
+/*
+ * PAN VIA ARROW BUTTONS OR KEYBOARD
+ **************************************/
+function arrowpan(direction) {
+    showloading();
+    var pansize = 0.1;   // defines how much to pan
+    var px, py;
+    if (direction == 'n') {
+        px = (mapW - 1) / 2;
+        py = (0 + pansize) * mapH;
+    } else if (direction == 's') {
+        px = (mapW - 1) / 2;
+        py = (1 - pansize) * mapH;
+    } else if (direction == 'e') {
+        px = (1 - pansize) * mapW;
+        py = (mapH - 1) / 2;
+    } else if (direction == 'w') {
+        px = (0 + pansize) * mapW;
+        py = (mapH - 1) / 2;
+    }
+    
+    zoompoint(1, px + "+" + py);
+}
+
+
+/*
+ * REFERENCE IMAGE ZOOM/PAN
+ ****************************/
+function zoomref(imgxy) {
+    showloading();
+    var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&mode=map&zoom_type=ref&imgxy='+imgxy  ;
+    updateMap(mapurl, '');
+}
+
+// SET OVERVIEW IMAGE TO NEW ONE
+function setRefImg(refimgsrc){
+     var refimg = parent.refFrame.document.getElementById('refimg');
+     refimg.src = refimgsrc;
+}
+
+
+/*
+ * ZOOM TO SCALE
+ *****************/
+function zoom2scale(scale) {
+    showloading();
+    var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&mode=map&zoom_type=zoomscale&scale='+scale;
+    updateMap(mapurl, '');
+}
+
+/*
+ * WRITE SCALE TO INPUT FIELD AFTER MAP REFRESH
+ *************************************************/
+function writescale(scale) {   
+    document.getElementById("scaleform").scale.value = scale;
+}
+
+
+/****************************************************************************
+ * CHANGE LAYERS
+ *****************/
+function setlayers(selelem) {
+    // Check if layers should be mutually disabled     
+    if (mutualDisableList) {
+        if (mutualDisableList.inArray(selelem)) {
+            for (var i=0; i<mutualDisableList.length; i++) {
+                if (mutualDisableList[i] != selelem) {
+                    document.getElementById('ginput_' + mutualDisableList[i]).checked = false;
+                }
+            }
+        }
+    }
+
+    var layerstring = '&groups=' + getLayers();    
+    
+    if (top.layerAutoRefresh == '1') {    	
+        showloading();
+        var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&zoom_type=zoompoint'+ layerstring;
+        updateMap(mapurl, '');
+    } else {
+        var passurl = 'incphp2/xajax/x_layer_update.php?'+SID+layerstring;
+        //alert(passurl);
+        updateSelLayers(passurl, '');
+    }
+}
+
+/*
+ * RETURN LAYERS/GROUPS
+ ************************/
+function getLayers() {
+    var layerstring = '';   
+    var layerForm = document.getElementById("layerform");
+    if (layerForm.groupscbx) {
+        for (var i=0; i<layerForm.groupscbx.length; i++) {
+               if (layerForm.groupscbx[i].checked == true) {
+                      layerstring += layerForm.groupscbx[i].value+',';
+            }
+        }
+        layerstring = layerstring.substr(0, layerstring.length - 1);
+        return layerstring;
+    } else {
+        return false; 
+    }
+}
+
+
+
+
+/*****************************************************************************
+ * QUERY RESULT
+ ***************/
+/**
+ * Start identify (query) or select (nquery) 
+ */
+function showqueryresult(type, xy) {
+	var varform = document.getElementById("varform");
+    if (type == 'query') {
+        var queryurl = PM_XAJAX_LOCATION + 'x_info.php?' +SID+ '&mode='+type + '&imgxy='+xy; // + layerstring;
+    } else {
+        var queryurl = PM_XAJAX_LOCATION + 'x_info.php?' +SID+ '&mode='+type + '&imgxy='+xy + '&groups=' + getSelectLayer();
+        varform.zoomselected.value = '1';
+    }
+
+    if (infoWin == 'window') {
+        openResultwin('blank.html');
+    }
+    
+    getQueryResult(queryurl, '');
+}
+
+/**
+ * Start auto-identify (iquery)
+ */
+var iquery_timer;
+
+function applyIquery(mx, my) {
+    var imgxy  = mx + "+" + my;
+    var queryurl = PM_XAJAX_LOCATION + 'x_info.php?' +SID+ '&mode=iquery' + '&imgxy='+imgxy + '&groups=' + getSelectLayer();
+    getQueryResult(queryurl, '');
+}
+
+/**
+ * Display result in DIV and postion it correctly
+ */
+function showIQueryResults(queryResult) {
+    var iQL = $('iqueryLayer');
+    iQL.style.left = (rawLeft('toolBar') - objW(iQL) - 4) + 'px';
+    iQL.style.top  = rawTop('mapFrame') - rawH('topMapFrame') - 5 + 'px';
+    
+    var IQueryResult = parseJSON_IQuery(queryResult);
+    
+    if (IQueryResult) {
+        iQL.innerHTML = IQueryResult;
+        showObj(iQL);
+    } else {
+        iQL.innerHTML = '';
+        hideObj(iQL);
+    }
+}
+
+/**
+ * Start attribute search
+ */
+function submitSearch() {
+    var searchForm = $('searchForm');
+    if (infoWin == 'frame') {
+        searchForm.target='infoFrame';
+    } else {
+        var skvp = getFormKVP('searchForm');
+        //alert(skvp);
+        var resultwin = openResultwin('blank.html');
+        searchForm.target='resultwin';
+        
+        var queryurl = PM_XAJAX_LOCATION + 'x_info.php?' + skvp + '&mode=search';
+        //alert(queryurl);
+        getQueryResult(queryurl, '');
+    }
+}
+
+
+
+
+/*
+ * RETURN LAYER/GROUP FOR SELECTION
+ *************************************/
+function getSelectLayer() {
+	var selform = $("selform");
+    if (selform) {
+        if (selform.selgroup) {
+            var sellayer = selform.selgroup.options[selform.selgroup.selectedIndex].value;
+            var layerstring = "&groups=" + sellayer;
+            //alert(sellayer);
+            return sellayer;
+        } else {
+            return false;
+        }
+    } else {
+        return false;
+    }
+}
+
+
+
+
+/*****************************************************************************
+ * MOUSE CLICK BUTTON FUNCTIONS (FOR TOOLBAR)
+ **********************************************/
+function domouseclick(button) {
+	var varform = $("varform");
+    if (button == 'zoomin') {
+        resetFrames();
+        varform.mode.value = 'map';
+        varform.zoom_type.value = 'zoomrect';
+        varform.maction.value = 'box';
+        varform.tool.value = 'zoomin';
+    } else if (button == 'zoomout') {
+        resetFrames();
+        varform.mode.value = 'map';
+        varform.zoom_type.value = 'zoompoint';
+        varform.zoom_factor.value = '-2';
+        varform.maction.value = 'click';
+        varform.tool.value = 'zoomout';
+    } else if (button == 'identify') {
+        resetFrames();
+        varform.mode.value = 'query';
+        varform.maction.value = 'click';
+        varform.tool.value = 'identify';
+    } else if (button == 'pan') {
+        resetFrames();
+        varform.mode.value = 'map';
+        varform.zoom_type.value = 'zoompoint';
+        varform.zoom_factor.value = '1';
+        varform.maction.value = 'pan';
+        varform.tool.value = 'pan';
+    } else if (button == 'select') {
+        resetFrames();
+        varform.mode.value = 'nquery';
+        varform.maction.value = 'box';
+        var selurl = PM_XAJAX_LOCATION + 'x_select.php?'+SID;
+        updateSelectTool(selurl, '');
+        //$('loadFrame').src = selurl;
+        varform.tool.value = 'select';
+    } else if (button == 'auto_identify') {
+        resetFrames();
+        varform.mode.value = 'iquery';
+        varform.maction.value = 'move';
+        varform.tool.value = 'auto_identify';
+        var selurl = PM_XAJAX_LOCATION + 'x_select.php?'+SID;
+        updateSelectTool(selurl, '');
+    } else if (button == 'measure') {
+        varform.maction.value = 'measure';
+        varform.mode.value = 'measure';
+        //var measureurl = 'measure.phtml?'+SID;
+        varform.tool.value = 'measure';
+        createMeasureInput();
+    } else if (button == 'digitize') {
+        varform.mode.value = 'digitize';
+        varform.maction.value = 'click';
+        varform.tool.value = 'digitize';
+    } else if (button == 'poi') {
+        varform.mode.value = 'poi';
+        varform.maction.value = 'click';
+        varform.tool.value = 'poi';    
+    } else if (button == 'coords') {
+        varform.mode.value = 'coords';
+        varform.maction.value = 'click';
+        varform.tool.value = 'coords';
+    }
+    
+    // Set cursor appropritae to slected tool 
+    if (useCustomCursor) {
+        setCursor(false);
+    }
+}
+
+
+
+
+function resetFrames() {
+	var varform = $("varform");
+    if (varform.mode.value == 'nquery' || varform.mode.value == 'iquery' || varform.maction.value == 'measure') {
+        if (varform.maction.value == 'measure') jg.clear();
+        if (varform.mode.value == 'iquery') hideLayer('iqueryLayer');
+        
+    } else {
+        $('bottomMapFrame').innerHTML = '';
+    }
+}
+
+
+
+function createMeasureInput() {
+    //alert(localeList['Total']);
+    var mStr =  '<form name="measureForm"><table class="TOOLFRAME"><tr><td NOWRAP>' + localeList['Total'] + '</td><td><input type=text size=9 name="sumLen"></td>';
+        mStr += '<td id="mSegTxt" value="&nbsp;&nbsp;' + localeList['Segment'] + '" NOWRAP>&nbsp;&nbsp;' + localeList['Segment'] + '</td><td><input type=text size=9 name="segLen"></td>';
+        mStr += '<td width=130 class="TDAR"><input type="button" value="' + localeList['Clear'];
+        mStr += '"  class="button_off"  onClick="javascript:resetMeasure()" onmouseover="changeButtonClr(this, \'over\')" onmouseout="changeButtonClr (this, \'out\')" ></td>';
+        mStr += '</tr></table></form>';
+    //alert(mStr);
+    
+    $('bottomMapFrame').innerHTML = mStr;
+}
+
+
+
+/*****************************************************************************
+ * RELOAD APPLICATION
+ **********************/
+function reloadMap(remove) {
+    var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&zoom_type=zoompoint';
+    if (remove) mapurl += '&resultlayer=remove';
+    updateMap(mapurl, '');
+}
+
+
+/*****************************************************************************
+ * CLOSE INFO WIN AND UNREGISTER SESSION VAR 'resultlayer'
+ **********************************************************/
+function clearInfo() {
+	var varform = $("varform");
+    //alert(varform.zoomselected.value);
+    //if (infoWin == "frame") frames.infoFrame.location.href = "blank.html";
+    //this.location = "blank.html";
+    //if (varform.zoomselected.value == '1') {
+        varform.zoomselected.value = '0';
+        reloadMap(true);
+    //}
+}
+
+
+
+
+/*****************************************************************************
+ * SHOW/HIDE LOADING SPLASH IMAGE
+ *********************************/
+function showloading(){    // waiting/working gif-animation
+    var loadLayer = $("loading")
+    if (!loadLayer) {
+        loadLayer = window.parent.document.getElementById("loading");
+    } 
+    loadLayer.style.visibility = "visible";
+}
+
+function stoploading(){
+    var loadLayer = document.getElementById("loading")
+    if (!loadLayer) {
+        loadLayer = window.parent.document.getElementById("loading");
+    } 
+    loadLayer.style.visibility = "hidden";
+}
+
+
+
+
+/******************************************************************************
+ * SET SLIDER IMAGE DEPENDING ON SCALE
+ * Values defined in 'config.ini'
+ *************************************/
+function setSlider(curscale) {
+    if (window.parent.myslider) {
+        var sliderPos = getSliderPosition(curscale);
+        window.parent.myslider.setPosition(sliderPos);
+        window.parent.document.getElementById('refsliderbox').style.visibility = "hidden";
+    }
+    return false;
+}
+
+
+

Added: javascript/measure.js
===================================================================
--- javascript/measure.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/measure.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,232 @@
+/*********************************************************************************
+ Copyright (c) 2002-2005 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ 
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 
+  USES THE JAVASCRIPT LIBRARIES JSGRAPHICS FROM WALTER ZORN
+  SEE FILE /JAVASCRIPT/WZ_JSGRAPHICS.JS FOR DETAILS OF COPYRIGHT
+  
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 
+ Modifications for polygon drawing provided by Federico Nieri 
+ 
+**********************************************************************************/
+
+// -------------------------
+//  FUNCTIONS FOR MEASURING
+// -------------------------
+
+// ADAPT LINE COLOR
+var lineColor = '#FF0000';
+
+// ADAPT LINE WIDTH
+var lineWidth = 2;
+
+// ADAPT FACTOR FOR DISTANCE/AREA CALCULATION
+// eg. 1000 for km, 1 for m
+var calcFact = 1000;
+
+var numSize;
+
+// Mouse click X/Y
+var clickXprev;      // Previous clicks
+var clickYprev;
+var clickCount = 0;  // Counter for clicks; reset when clearing lines
+
+
+// For area measurement
+var xc = new Array;
+var yc = new Array;
+var xcPixel = new Array;
+var ycPixel = new Array;
+var nc = 0;
+var area = 0;
+
+
+//
+// MAIN FUNCTION, DRAWS SYMBOL POINTS BETWEEN MOUSECLICKS
+//
+function measureDrawSymbols(e, clickX, clickY, dblClick) {
+    
+    // Reset everything when last measure ended with double click
+    if (clickCount == 0) resetMeasure();
+    
+    // Don't go outside map
+    outerloop:
+    if ((clickX < mapW) && (clickY < mapH)) {
+        var x_geo = minx_geo + ((clickX/mapW)  * xdelta_geo);
+        var y_geo = maxy_geo - ((clickY/mapH) * ydelta_geo);
+        
+        // First point for start click
+        if (clickCount < 1) {
+            drawLineSegment(clickX, clickY, clickX, clickY); 
+            clickCount++;
+    
+        // Fill distance between clicks with symbol points
+        } else {
+            // Diff X/Y between current new and previous click
+            var x_delta = clickXprev - clickX;
+            var y_delta = clickYprev - clickY;
+            
+            // SINGLE CLICK
+            if (dblClick != 1) { 
+                // Segment length in Pixel
+                var segLenPix = Math.sqrt((Math.pow(x_delta, 2)) + (Math.pow(y_delta, 2)));
+                
+                // Segment length in  map coordinates,  write values to input boxes
+                var segLenGEO_0 = ((segLenPix/mapW) * xdelta_geo) / calcFact ;
+                var cntSegLen = Math.round(segLenGEO_0).toString().length;
+                numSize = Math.max(0, (4 - cntSegLen));
+                var segLenGEO = roundN(segLenGEO_0, numSize); 
+        
+                
+                if (document.measureForm.sumLen.value != '') {
+                    sumLenGEO = roundN(parseFloat(document.measureForm.sumLen.value) + segLenGEO, numSize);
+                } else {
+                    sumLenGEO = roundN(segLenGEO, numSize);
+                }
+    
+                document.measureForm.sumLen.value = sumLenGEO;
+                document.measureForm.segLen.value = segLenGEO;
+                
+                
+                // USE wz_jsgraphics.js TO DRAW LINE
+                drawLineSegment(clickXprev, clickYprev, clickX, clickY);
+                
+            
+            // DOUBLE CLICK => CALCULATE AREA
+            } else if (dblClick) {
+                counter = 0;
+
+                // calculate polygon area
+                xc[xc.length] = xc[0] - xc[(xc.length)-1]; 
+                yc[yc.length] = yc[0] - yc[(yc.length)-1]; 
+
+                area = 0;
+                for(var k=0; k<nc; k++) {
+                   var j = (k+1);
+                   area = area + ( xc[k] * yc[j] );
+                   area = area - ( xc[j] * yc[k] );
+                }
+                area = area / 2;
+                area = Math.abs(roundN (area / (calcFact * calcFact), numSize-1)) ;
+                //alert('Area: ' + area + ' m2');
+
+                // Change input text box to 'Area'
+                document.getElementById("mSegTxt").innerHTML = localeList['Area']; 
+                document.measureForm.segLen.value = area;
+                
+                // Close the Polygon
+                // and delete the nc point born to calculate area		        
+		        xc[nc-1] = xc[0];
+		    	yc[nc-1] = yc[0];
+		    	xc.length = nc;
+		    	yc.length = nc;		    	
+		    	xcPixel[nc-1] = xcPixel[0];
+		    	ycPixel[nc-1] = ycPixel[0];		         
+         	
+               	drawLineSegment(xcPixel[nc-1], ycPixel[nc-1], clickX, clickY)               	
+                
+                // Reset variables and delete measure points
+                nc = 0;
+                area = 0;
+                xc = new Array;
+                yc = new Array;
+                xcPixel = new Array;
+                ycPixel = new Array;
+                clickCount = 0;
+                
+                // remove measure line
+                //jg.clear();
+                
+                break outerloop;
+            }
+        }
+        
+        // Set previous click to current, increase counter         
+        clickXprev = clickX;
+        clickYprev = clickY;
+        clickCount = 2;
+        
+        // Add x/y clicks to array for area measurement
+        xc[nc] = x_geo;
+    	yc[nc] = y_geo;
+    	xcPixel[nc] = clickX;
+    	ycPixel[nc] = clickY;
+        nc++; 
+    }    
+}
+
+// REDRAW THE LAST AND THE CLOSING SIDE OF THE POLYGON
+function redrawAll(currX, currY) {
+
+    if (nc>0) {    	
+        jg.clear();
+    	jg.setColor(lineColor); 
+    	jg.setStroke(lineWidth); 
+	    jg.drawPolyline(xcPixel, ycPixel);
+   
+	    // Drawing last side	    
+	    jg.drawLine(xcPixel[nc-1], ycPixel[nc-1], currX, currY);
+	    
+  	    // Drawing closing side  	    
+	    jg.setStroke(Stroke.DOTTED); 
+	    jg.drawLine(xcPixel[0], ycPixel[0], currX, currY);
+	    
+	    jg.paint();
+	}		    
+
+}
+
+//
+// DRAW LINE USING JSGRAPHICS
+//
+function drawLineSegment(xfrom, yfrom, xto, yto) {
+    jg.setColor(lineColor); 
+    jg.setStroke(lineWidth); 
+    jg.drawLine(xfrom, yfrom, xto, yto); 
+    jg.paint();
+}
+
+
+//
+// Remove all measure settings
+//
+function resetMeasure() {
+    // remove lines
+    jg.clear();
+    
+    // Reset form fields 
+    if (document.measureForm) {
+        document.measureForm.sumLen.value = '';
+        document.measureForm.segLen.value = '';
+        document.getElementById("mSegTxt").innerHTML = localeList['Segment']; 
+    }
+    // Reset Click counter
+    clickCount = 0;
+}
+
+
+//
+// Round to a specified decimal
+//
+function roundN(numin, rf) {
+    return ( Math.round(numin * Math.pow(10, rf)) / Math.pow(10, rf) );
+} 

Added: javascript/pmapper.js
===================================================================
--- javascript/pmapper.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/pmapper.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,650 @@
+/*********************************************************************************
+ Copyright (c) 2002-2005 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+
+// Global for resize timer/setTimeout
+var resize_timer;
+
+
+
+/**************************************************** 
+ * LOAD MAP IMAGE INTO PARENT WINDOW MAP DIV
+ * Reset parameters of some DIV's
+ ****************************************************/
+function loadMapImg(mapImgSrc) {
+    // SWAP MAP IMG
+    var theMapImg = $("mapImg");
+    theMapImg.src = mapImgSrc;
+}
+
+function resetMapImgParams() {
+    var theMapImgL = $("mapimgLayer");
+    var theMapImg = $("mapImg");
+    
+    theMapImg.style.width = mapW+"px";
+    theMapImg.style.height = mapH+"px";
+    
+    theMapImgL.style.top  = 0+"px";  
+    theMapImgL.style.left = 0+"px";
+    theMapImgL.style.width = mapW+"px";
+    theMapImgL.style.height = mapH+"px";
+    
+    theMapImgL.style.clip = 'rect(auto auto auto auto)';  // NEEDED TO RESET DIV TO NON-CLIPPED AND ORIGINAL SIZE
+    
+    $("zoombox").style.visibility = 'hidden';
+    $('loading').style.visibility = 'hidden';
+    
+    maploading = false;
+}
+
+
+/**
+ * Initialize function; called by 'onload' event of map.phtml
+ * initializes several parameters by calling other JS function
+ */
+function init() {
+    // Add Resize Event to main window, using initResize() because of IE (see below)
+    //window.onresize = function(){initResize();}
+    window.onresize = function(){resizeDiv();}
+    
+    // Add properties to mapImg
+    var imgTmpMap = $("mapImg");
+    imgTmpMap.onload = resetMapImgParams;
+    imgTmpMap.onmouseover = startUp;
+    
+    // Resize all layout DIV's with respect to window size
+    resizeDiv();
+    
+    // Initialize TOC/legend
+    initToc();
+    
+    // Set zoombox class for Opera and Konqueror to non-semitransparent
+    if (navigator.userAgent.match(/Opera|Konqueror/i)) {
+        $("zoombox").className = 'zoombox_nontransp';
+    }
+    
+    createZSlider('zslider');
+    createSearchOptions();
+    domouseclick('zoomin');
+    setTbTDButton('zoomin');
+    
+}   
+
+
+/**
+ * Resize all layout DIV's with respect to window size
+ * needs to be adpated when default layout is modified
+ */
+
+
+function resizeDiv() {
+    // Margins in application window
+    var lMargin  = 15; // LEFT 
+    var mMargin  = 10; // MIDDLE, between map and toc 
+    var rMargin  = 15; // RIGHT
+    var tMargin  = 10; // TOP
+    var bMargin  = 10; // BOTTOM
+    var m2Margin = 10; // MIDDLE, between TOC and refmap
+
+    var winix = 0, winiy = 0;
+    if( typeof( window.innerWidth ) == 'number' ) {
+      //Non-IE
+      winix = window.innerWidth;
+      winiy = window.innerHeight;
+    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
+      //IE 6+ in 'standards compliant mode'
+      winix = parseInt(document.documentElement.clientWidth);
+      winiy = parseInt(document.documentElement.clientHeight) - 2;
+    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
+      //IE 4 compatible
+      winix = document.body.clientWidth;
+      winiy = document.body.clientHeight;
+    }
+
+    // Element definitions
+    var top             = $('top');
+    var bottom          = $('bottom');
+    var mapFrame        = $('mapFrame');
+    var mapimgLayer     = $('mapimgLayer');
+    var mapImg          = $('mapImg');
+    var zoombox         = $('zoombox');
+    var toolBar         = $('toolBar');
+    var topMapFrame     = $('topMapFrame');
+    var botMapFrame     = $('bottomMapFrame');
+    var toc             = $('toc');
+    var refmap          = $('refmap');
+    var refmapBG        = $('refmapBG');
+    var loading         = $('loading');
+        
+    
+    // Position (T, L) and sizes (W, H) of elements
+    var mapFrameL       = objLeft(mapFrame);
+    var tocW            = objW(toc);
+    var toolBarW        = objW(toolBar);
+    var mapimgLayerW    = objW(mapimgLayer);
+    var mapimgLayerL    = objLeft(mapimgLayer);
+    var bottomW         = objW(bottom);
+    var topW            = objW(top);
+    
+    var topH            = objH(top);
+    var bottomH         = objH(bottom);
+    var mapFrameT       = objTop(mapFrame);
+    var tocH            = objH(toc);
+    var refmapH         = objH(refmap);
+    var toolBarH        = objH(toolBar);
+    var mapimgLayerH    = objH(mapimgLayer);
+    var mapimgLayerT    = objTop(mapimgLayer);
+    var topMapFrameH    = objH(topMapFrame);
+    var botMapFrameH    = objH(botMapFrame);
+    
+    
+    // NEW sizes
+    var newImgLayerW    = winix - lMargin - mMargin - rMargin - tocW - toolBarW;
+    //alert(winix+" - "+lMargin+" - "+mMargin+" - "+rMargin+" - "+tocW+" - "+toolBarW);
+    var newImgLayerH    = winiy - tMargin - bMargin - topH - bottomH - topMapFrameH - botMapFrameH;
+    //alert(winiy+" - "+tMargin+" - "+bMargin+" - "+topH+" - "+bottomH+" - "+topMapFrameH+" - "+botMapFrameH);
+    var newToolBarL     = mapimgLayerL + newImgLayerW;
+    var newTocL         = mapFrameL + newImgLayerW + toolBarW + mMargin;
+    var newTocH         = newImgLayerH + topMapFrameH + botMapFrameH - refmapH - m2Margin;
+
+    
+    // RESIZE elements
+    mapW = newImgLayerW;
+    mapH = newImgLayerH;
+    //alert("mapW = "+mapW+" , mapH = "+mapH);
+    
+    mapFrame.style.width        = newImgLayerW + 'px';
+    mapFrame.style.height       = newImgLayerH + topMapFrameH + 'px';
+    mapFrame.style.top          = topH + tMargin + 'px';
+    mapFrame.style.left         = lMargin + 'px';
+    
+    mapimgLayer.style.width     = newImgLayerW + 'px';
+    mapimgLayer.style.height    = newImgLayerH + 'px';
+    
+    mapImg.style.width          = newImgLayerW + 'px';
+    mapImg.style.height         = newImgLayerH + 'px';
+    
+    zoombox.style.width         = newImgLayerW + 'px';
+    zoombox.style.height        = newImgLayerH + 'px';
+    
+    topMapFrame.style.width     = newImgLayerW + 'px';
+    botMapFrame.style.width     = newImgLayerW + 'px';
+    botMapFrame.style.top       = mapimgLayerT + topMapFrameH + newImgLayerH + 'px';
+    
+    toolBar.style.left          = newToolBarL + 'px';
+    toolBar.style.height        = topMapFrameH + botMapFrameH + newImgLayerH + 'px';
+    
+    toc.style.left              = newTocL + 'px';
+    toc.style.height            = newTocH + 'px';
+    
+    refmap.style.left           = newTocL + 'px';
+    refmap.style.top            = mapFrameT + newTocH + m2Margin + 'px';
+    refmapBG.style.left         = newTocL + 'px';
+    refmapBG.style.top          = mapFrameT + newTocH + m2Margin + 'px';
+    
+    top.style.width             = winix + 'px';
+    bottom.style.width          = winix + 'px';
+    
+    loading.style.left          = mapW/2 - 60 + 'px';
+    loading.style.top           = mapH/2 - 20 + 'px';
+
+    
+    // Update Slider
+    updateSlider_s1(newImgLayerW, newImgLayerH) ;
+    
+    // RELOAD MAP!!!
+    var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+ '&mapW=' + newImgLayerW + '&mapH=' + newImgLayerH + '&zoom_type=zoompoint';
+
+    // Timer-controlled resize of map for stupid IE resize event behaviour
+    if (navigator.appName.indexOf("Microsoft")!=-1) {
+        clearTimeout(resize_timer);
+        resize_timer = setTimeout("updateMap('" + mapurl + "', '')",500);     
+    } else {
+        updateMap(mapurl, '');   
+    }
+}
+
+
+
+/**
+ * Update s1 value for slider settings
+ */
+function updateSlider_s1(pixW, pixH) {
+    var maxScale1 = ((dgeo_x * dgeo_c) / pixW) / (0.0254 / 96);
+    var maxScale2 = ((dgeo_y * dgeo_c) / pixH) / (0.0254 / 96);
+    s1 = Math.max(maxScale1, maxScale2);
+}
+
+
+function pMap () {
+    //this.setMapProperties = pMap_setMapProperties;
+    //this.getMapProperties = pMap_getMapProperties;
+    this.getMapScale = pMap_setMapScale;
+    this.RefMapW = pMap_getRefMapW;
+    this.RefMapH = pMap_getRefMapH; 
+}
+
+function pMap_setMapProperties(width, height, scale) {
+    var mapimgLayer = $('mapimgLayer');
+    
+    mapimgLayer.style.width = width;
+    mapimgLayer.style.height = height;
+    
+    this.width  = width;
+    this.height = height;
+    this.scale  = scale;
+}
+
+
+function pMap_getMapProperties() {
+    var width = this.width;
+    var height = this.height; 
+    //alert(width + ' - ' + height);
+    //loadMapImg0();
+}
+
+
+/**
+ * SCALE OF CURRENT MAP
+ */
+function pMap_setMapScale(scale) {
+    //alert (scale);
+    this.scale = scale;
+}
+
+function pMap_getMapScale() {
+    //alert(this.scale);
+    return this.scale;
+}
+
+
+/**
+ * REFERENCE MAP WIDTH/HEIGHT
+ */
+function pMap_setRefMapW(refW) {
+    this.RefMapW = refW;
+}
+
+function pMap_setRefMapH(refH) {
+    this.RefMapH = refH;
+}
+
+function pMap_getRefMapW() {
+    return this.RefMapW;
+}
+
+function pMap_getRefMapH() {
+    return this.RefMapH;
+}
+
+
+
+
+
+
+/*****************************************************************************
+ * SWAP FUNCTIONS FOR TOOLBAR TD -> USE ALTERNATIVELY TO IMAGE SWAP
+ * Changes TD class (default.css -> .TOOLBARTD...) in toolbar
+ ********************************************************************/
+// Function for state buttons (CLICKED TOOLS: zoomin, pan, identify, select, measure)
+function setTbTDButton(button) {
+    //var tdarr = document.getElementsByName('tbtd');  //!!!!! DOES NOT WORK WITH CRAPPY IE !!!!
+    var tdarr = document.getElementsByTagName('td');
+    for (var i = 0; i < tdarr.length; i++) {
+        var tdid = tdarr[i].id;
+        //alert(tdid);
+        //if (tdid != 'tsep') {
+        
+        //!!!!! WORKAROUND FOR CRAPPY IE !!!!
+        if (tdid == 'zoomin' || tdid == 'zoomout' || tdid == 'pan' || tdid == 'identify' || tdid == 'select' || tdid == 'measure' || tdid == 'poi' || tdid == 'auto_identify') {
+            if (tdid != button) {
+                rmHighlTD(tdid)
+            } else {
+                highlTD(tdid);
+            }
+        }
+    }
+}
+
+function highlTD(elId) {
+    var but = $(elId);
+    if (but) but.className='TOOLBARTD_ON';
+}
+
+function rmHighlTD(elId) {
+    //alert(elId);
+    var but = $(elId);
+    if (but) but.className='TOOLBARTD';
+}
+
+
+// Functions for MouseOver/Out
+function TbOverOut(elId, status){
+    var but = $(elId);
+    if (but) {
+        if (but.className != 'TOOLBARTD_ON') {
+            if (status == 'on') {
+                but.className='TOOLBARTD_OVER';
+            } else {
+                but.className='TOOLBARTD';
+            }
+        }
+    }
+}
+
+// MouseDown/Up, only set for stateless buttons
+function TbDownUp(elId, status){
+    var but = $(elId);
+    if (status == 'd') {
+        but.className='TOOLBARTD_ON';
+    } else {
+        but.className='TOOLBARTD';
+    }
+}
+
+function changeButtonClr(myObj, myAction) {
+    switch (myAction) {
+        case 'over':
+            myObj.className = 'button_on';
+            break;
+            alert(myAction);
+            
+        case 'out':
+            myObj.className = 'button_off';
+            break;
+    }
+}
+
+
+
+
+/*****************************************************************************
+ * IMAGE SWAP FUNCTIONS FOR TOOLBAR
+ * swaps images from imgname_on.gif to imgname_off.gif and vice versa
+ *********************************************************************/
+// SWITCH IMAGE OF CLICKED TOOL TO 'ON', ALL OTHERS TO 'OFF'
+function setButton(button) {
+    var imgarr = document.getElementsByTagName('img');
+    for (var i = 0; i < imgarr.length; i++) {
+        var butid = imgarr[i].id;
+        if (butid != 'sep') {
+            if (butid != button) {
+                setImg(butid, 'off');
+            } else {
+                setImg(butid, 'on');
+            }
+        }
+    }
+}
+
+// set image to ON or OFF
+function setImg(obj, status){
+    var source = 'images/buttons/' + obj + '_' + status + '.gif';
+    imgobj = $(obj);
+    imgobj.src = source;
+}
+
+
+
+
+/**************************************************
+ * Set cursor symbol according to tool selection
+ *************************************************/
+// return root path of application
+function getRootPath() {
+	var theLoc = document.location.href;
+	var theLastPos = theLoc.lastIndexOf('/');
+	var RootPath = theLoc.substr(0,theLastPos) + '/';
+	
+	return RootPath;
+}
+
+/** 
+ * set the cursor to standard internal cursors
+ * or special *.cur url (IE6+ only)
+ */
+function setCursor(rmc) {	
+    if (!rmc) {
+    	var varform = $("varform");
+        if (varform) {
+            var toolType = varform.tool.value;
+        } else {
+            var toolType = 'zoomin';
+        }
+    } else {
+        toolType = 'pan';
+    }
+
+    
+    /* Define settings for cursor to be used for tools
+       set to true if you want to use the same cursors for all browsers (incl. IE) */
+    var internalCursor = ((navigator.version < 6) || (navigator.appName == 'Netscape'));
+    //var internalCursor = true; 
+    
+    var rootPath = getRootPath();
+    var usedCursor = (internalCursor) ? toolType : "url(" +rootPath + "images/cursors/zoomin.cur)";
+    
+    $('mapimgLayer').style.cursor = usedCursor;
+    
+    switch (toolType) {
+		case "zoomin" :
+			var usedCursor = (internalCursor) ? 'crosshair' : 'url("' +rootPath + 'images/cursors/zoomin.ani")';	
+			break;
+        
+        case "zoomout" :
+			var usedCursor = (internalCursor) ? 'e-resize' : 'url(' +rootPath + 'images/cursors/zoomout.cur)';	
+			break;
+        
+        case "identify" :
+			//var usedCursor = (internalCursor) ? 'help' : 'url(' +rootPath + 'images/cursors/identify.cur)';	
+			var usedCursor = 'help';	
+            break;
+        
+        case "auto_identify" :	
+			var usedCursor = 'pointer';	
+            break;
+
+        case "pan" :
+			//var usedCursor = (internalCursor) ? 'move' : 'url(' +rootPath + 'images/cursors/pan.cur)';	
+            var usedCursor = 'move';
+			break;
+            
+        case "select" :
+			//var usedCursor = (internalCursor) ? 'help' : 'url(' +rootPath + 'images/cursors/select.cur)';
+            var usedCursor = (internalCursor) ? 'help' : 'help';	            
+			break;
+            
+        case "measure" :
+			var usedCursor = (internalCursor) ? 'crosshair' : 'url(' +rootPath + 'images/cursors/measure.cur)';	
+			break;
+            
+        case "digitize" :
+			var usedCursor =  'crosshair';	
+			break;
+            
+        default:
+            var usedCursor = 'default';
+    }
+    
+    $('mapimgLayer').style.cursor = usedCursor;
+    
+}
+
+
+
+
+/*
+ * OPEN RESULT WINDOW FOR IDEBNTIFY AND SEARCH
+ ***********************************************/
+function openResultwin(winurl) {
+    var w = window.open(winurl, "resultwin", "width=500,height=200,status=yes,resizable=yes,scrollbars=yes");
+    return w;
+}
+
+
+/*****************************************************************************
+ * SEARCH
+ **********/
+// CLOSE SEARCH PAGE
+function searchClose() {
+    parent.searchFrame.location = "blank.html";
+}
+
+// OPEN SEARCH PAGE
+function searchOpen() {
+    parent.searchFrame.location = "search.phtml?"+SID;
+}
+
+
+
+/******************************************************************************
+ * PRINT FUNCTIONS
+ *******************/
+function openPrintDlg() {
+    var pwin = window.open("printdlg.phtml?"+SID,"printdlg","width=300,height=180,status=no,resizable=no");
+}
+
+function printMap() {
+    var w = window.open("printmap.phtml?"+SID,"printdlg","width=300,height=180,status=no,resizable=no");
+}
+
+
+
+/*
+ * OPEN HELP WINDOW 
+ *************************************/
+function openHelp() {
+    window.open("help.phtml", "help","width=400,height=500,status=no,resizable=yes");
+}
+
+
+
+/************************************************************************************
+ * DOWNLOAD FUNCTIONS
+ * get image with higher resolution for paste in othet programs
+ ****************************************************************/
+function openDownloadDlg() {
+    window.open("downloaddlg.phtml?"+SID, "dldlg","width=300,height=180,status=no,resizable=no");
+}
+
+function openDownload() {
+    window.open("download.phtml?"+SID, "download");
+}
+
+
+
+
+function openPoiDlg(imgxy) {
+    //alert(imgxy);
+    var coordsList = imgxy.split('+');
+    var mpoint = getCoords(coordsList[0], coordsList[1], false);
+    
+    // Round values (function 'roundN()' in 'measure.js')
+    var rfactor = 4;
+    var px = isNaN(mpoint.x) ? '' : roundN(mpoint.x, rfactor);
+    var py = isNaN(mpoint.y) ? '' : roundN(mpoint.y, rfactor);
+    
+    var inserttxt = prompt(localeList['addLocation'], '');
+    
+    if (inserttxt) {
+        //alert(inserttxt + ' --- ' + px + ' -- ' + py);
+        //var ul = + px + ',' + py + ',' + inserttxt;
+        var digitizeurl = PM_XAJAX_LOCATION + 'x_poi.php?' +SID + '&up=' + px + '@@' + py + '@@' + escape(inserttxt);
+        //alert(digitizeurl);
+        addPOI(digitizeurl, '');
+    }
+}
+
+
+
+
+
+
+
+
+/**
+ * DOM window functions using dragresize.js
+ *
+ */
+
+function initDOMWin(resizeable, wid) {    
+    var dragresize = new DragResize('dragresize',
+        { handles: ['tm', 'br'], minWidth: 50, minHeight: 50, minLeft: 2, minTop: 2, elmW: 20 });
+    
+    dragresize.isElement = function(elm)
+    {
+        if (elm.className && elm.className.indexOf('drsElement') > -1) return true;
+    };
+    
+    dragresize.isHandle = function(elm)
+    {
+        if (elm.className && elm.className.indexOf('drsMoveHandle') > -1) return true;
+    };
+
+    dragresize.apply(document);
+}
+
+
+function createDOMWin(wid, W, H, T, L, oCl ) {
+    var win_div = document.createElement('div');
+    win_div.id = wid + '_domwin';
+    win_div.className = 'drsElement';
+    win_div.style.width  = W + 'px';
+    win_div.style.height = H + 'px';
+    win_div.style.top    = T + 'px';
+    win_div.style.left   = L + 'px';
+    win_div.style.visibility = 'hidden';
+    
+    var mh_div = document.createElement('div');
+    mh_div.id = wid + '_mhandle';
+    mh_div.className = 'drsMoveHandle';
+    win_div.appendChild(mh_div);
+    
+    var con_div = document.createElement('div');
+    con_div.id = wid + '_content';
+    con_div.className = 'drsContent';
+    win_div.appendChild(con_div);
+    
+    var clb_div = document.createElement('div');
+    clb_div.id = wid + '_closebutton';
+    clb_div.className = 'drsClosebutton';
+    clb_div.onclick = oCl;
+    con_div.appendChild(clb_div);
+       
+    document.body.appendChild(win_div);
+    
+    initDOMWin();
+}
+
+
+function createAllDOMWindows() {
+    createDOMWin('query', 600, 200, 100, 100, domWinClose ) ;
+    createDOMWin('print',  200, 150, 100, 100, domWinClose ) ;
+    createDOMWin('download',  200, 150, 100, 100, domWinClose ) ;
+}
+
+
+function domWinClose() {
+    var winId = this.id.split('_')[0] + '_domwin';
+    document.getElementById(winId).style.visibility = 'hidden';
+}
+
+

Added: javascript/pmdraw.js
===================================================================
--- javascript/pmdraw.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/pmdraw.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,239 @@
+/*********************************************************************************
+ Copyright (c) 2003-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ 
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 
+  USES THE JAVASCRIPT LIBRARIES JSGRAPHICS FROM WALTER ZORN
+  SEE FILE /JAVASCRIPT/WZ_JSGRAPHICS.JS FOR DETAILS OF COPYRIGHT
+  
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 
+ Modifications for polygon drawing provided by Federico Nieri 
+ 
+**********************************************************************************/
+
+// -------------------------
+//  FUNCTIONS FOR MEASURING
+// -------------------------
+
+// ADAPT LINE COLOR
+var lineColor = '#FF0000';
+
+// ADAPT LINE WIDTH
+var lineWidth = 2;
+
+// ADAPT FACTOR FOR DISTANCE/AREA CALCULATION
+// eg. 1000 for km, 1 for m
+var calcFact = 1000;
+
+var numSize;
+
+/** 
+ * Return a Point object with geo coordinate instead of px coordinate
+ * @param pxPoint: Point object with px coordinate
+ */
+function toGeoPoint(pxPoint){
+	var x_geo = minx_geo + ((pxPoint.x/mapW)  * xdelta_geo);
+	var y_geo = maxy_geo - ((pxPoint.y/mapH) * ydelta_geo);
+	return new Point(x_geo,y_geo);
+}
+
+/** 
+ * Return a Polygon object with geo coordinate instead of px coordinate
+ * @param pxPolygon: Polygon object with px coordinate
+ */
+function toGeoPolygon(pxPolygon){
+	var pxPoints = pxPolygon.getPoints();
+	var geoPolygon = new Polygon();
+	for(var i = 0; i < pxPoints.length; i++){
+		geoPolygon.addPoint(toGeoPoint(pxPoints[i]));
+	}
+	return geoPolygon;
+}
+
+/**
+ * Return a geography measure unit instead of px
+ * @param pxLength: length in px
+ */
+function toGeoLength(pxLength){
+	return (pxLength/mapW) * xdelta_geo;
+}
+
+
+var polyline = new Polygon();
+
+/**
+ * Main function, draws symbol points between mouseclicks
+ * @return void
+ */
+function measureDrawSymbols(e, clickX, clickY, dblClick) {
+    // Polyline points number before to add the current click point
+    var nPoints = polyline.getPointsNumber();    
+    // Reset everything when last measure ended with double click
+    if (nPoints == 0) resetMeasure();        
+    // Don't go outside map
+    if ((clickX < mapW) && (clickY < mapH)) { 
+        
+        // SINGLE CLICK
+        if (dblClick != 1) { 
+	        
+	        polyline.addPoint(new Point(clickX,clickY));
+	        	        
+        	// First point for start click
+        	if (nPoints < 1) {
+    			
+        		drawLineSegment(clickX, clickY, clickX, clickY);         			
+
+    		// Fill distance between clicks with symbol points
+    		}else{
+                                                              
+                // USE wz_jsgraphics.js TO DRAW LINE. lastSegment is of Line type                 
+                var lastSegment = polyline.getLastSide();                
+                drawLineSegment(lastSegment.getFirstPoint().x, lastSegment.getFirstPoint().y, lastSegment.getSecondPoint().x, lastSegment.getSecondPoint().y);                
+                // calls the handler of the side (segment) digitation and pass it the polyline in px coords
+                onDigitizedSide(polyline);
+                                                
+        	}      	        	        	        	                                  
+                        	
+        // DOUBLE CLICK => CALCULATE AREA
+        } else if (dblClick) {
+                        	            	    		    	
+	    	// Removes the last duplicated point because of the last 2 single click	    	
+	    	polyline.delPoint(polyline.getPointsNumber()-1);
+	    	// Closing the polyline to have a polygon
+	    	polyline.close();	    	
+	    	// fix the last side	    	
+	    	var lastSegment = polyline.getLastSide();	    		
+	    	if(lastSegment != null){    	
+	    		drawLineSegment(lastSegment.getFirstPoint().x, lastSegment.getFirstPoint().y, lastSegment.getSecondPoint().x, lastSegment.getSecondPoint().y);           	
+	    	}
+           	// calls the handler of the polygon digitation before reset the polygon
+           	onDigitizedPolygon(polyline);
+            // remove all points from the polygon          
+    		polyline.reset();
+                        
+        }                   
+    }    
+}
+
+
+/** 
+ * Handler of the digitized polygon action. It is called when a double click
+ * close tha drawing polygon
+ * @param poly: Polygon object passed to the handler
+ */
+function onDigitizedPolygon(poly){
+	
+	var polyGEO = toGeoPolygon(poly);
+	var perimGEO = polyGEO.getPerimeter()/calcFact;	
+	
+    var cntPerLen = Math.round(perimGEO).toString().length;
+    numSize = Math.max(0, (4 - cntPerLen));
+    
+    perimGEO = roundN(perimGEO, numSize); 
+    
+    var areaGEO = Math.abs(roundN (polyGEO.getArea() / (calcFact * calcFact), numSize-1)) ;
+                
+	// Change input text box to 'Area'
+	document.measureForm.sumLen.value = perimGEO;
+    document.getElementById("mSegTxt").innerHTML = localeList['Area']; 
+    document.measureForm.segLen.value = areaGEO;
+    
+}
+
+/** 
+ * Handler of the digitized line action. It is called when a new click cause draw a new line
+ * @param poly: Polygon object passed to the handler
+ */
+function onDigitizedSide(poly){
+	// Polygon in map coordinates
+	var polyGEO = toGeoPolygon(poly);
+        
+    // Segment length in  map coordinates,  write values to input boxes
+    var segLenGEO_0 = polyGEO.getSideLength(polyGEO.getSidesNumber()) / calcFact ;
+    var perimGEO_0  = polyGEO.getPerimeter() / calcFact ;
+    
+    var cntSegLen = Math.round(segLenGEO_0).toString().length;
+    numSize = Math.max(0, (4 - cntSegLen));
+    var segLenGEO = roundN(segLenGEO_0, numSize); 
+	var perimGEO  = roundN(perimGEO_0, numSize);     
+
+    document.measureForm.sumLen.value = perimGEO;
+    document.measureForm.segLen.value = segLenGEO;
+}
+
+/**
+ * REDRAW THE LAST AND THE CLOSING SIDE OF THE POLYGON
+ */
+function redrawAll(currX, currY) {
+
+    if (polyline.getPointsNumber()>0) {    	
+        jg.clear();
+    	jg.setColor(lineColor); 
+    	jg.setStroke(lineWidth); 
+	    jg.drawPolyline(polyline.getXList(), polyline.getYList());
+      		
+	    // Drawing last side	    
+	    var lastPoint = polyline.getPoint(polyline.getPointsNumber()-1);
+	    jg.drawLine(lastPoint.x, lastPoint.y, currX, currY);
+	    
+  	    // Drawing closing side  	      	    
+	    jg.setStroke(Stroke.DOTTED); 
+	    var firstPoint = polyline.getPoint(0);
+	    jg.drawLine(firstPoint.x, firstPoint.y, currX, currY);
+	    
+	    jg.paint();
+	}		    
+
+}
+
+/**
+ * DRAW LINE USING JSGRAPHICS
+ */
+function drawLineSegment(xfrom, yfrom, xto, yto) {
+    jg.setColor(lineColor); 
+    jg.setStroke(lineWidth); 
+    jg.drawLine(xfrom, yfrom, xto, yto); 
+    jg.paint();
+}
+
+
+/**
+ * Remove all measure settings
+ */
+function resetMeasure() {
+    // remove lines
+    jg.clear();
+    
+    // Reset form fields 
+    if (document.measureForm) {
+        document.measureForm.sumLen.value = '';
+        document.measureForm.segLen.value = '';
+        document.getElementById("mSegTxt").innerHTML = localeList['Segment']; 
+    }    
+}
+
+
+/**
+ * Round to a specified decimal
+ */
+function roundN(numin, rf) {
+    return ( Math.round(numin * Math.pow(10, rf)) / Math.pow(10, rf) );
+} 

Added: javascript/pmjson.js
===================================================================
--- javascript/pmjson.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/pmjson.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,295 @@
+/*********************************************************************************
+ Copyright (c) 2002-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+
+
+/**
+ * Parse JSON result string from query into HTML
+ */
+function parseJSON(jsonstr, infoWin) {
+    //alert(infoWin);
+    var rhtml = '';
+
+    // Nothing found with query, return only header 
+    if (jsonstr == 0) {
+        rhtml += '<table class="restable" cellspacing="0" cellpadding="0">';
+        rhtml += '<td>' + localeList['noRecords'] + '</td>'; 
+        rhtml += '<td><a href="javascript:this.close();"><img align="right" src="images/close.gif" border=0 ></a></td>';
+        rhtml += '</tr></table>';
+    
+        return rhtml;
+    }
+
+
+    // Features found, parse JSON string
+    var groups = jsonstr[0];    
+    
+    var jlen = groups.length;
+    
+    
+    for (var i=0; i<jlen; i++) {
+        var layObj = groups[i];
+        
+        rhtml += '<div class="LAYERHEADER">' + layObj.description + '</div>';
+        rhtml += '<table class="sortable" border="0" cellspacing="0" cellpadding="0">';
+        
+        //*** Header line ***/
+        var hL = layObj.header;
+        if (hL[0] == '@') {
+            var withShpLink = true;
+        } else {
+            var withShpLink = false;
+            //var withShpLink = true;
+        }
+        
+        var hLlen = hL.length;
+        rhtml += '<tr>';
+        var startcol = withShpLink ? 0 : 1;
+        for (var hi=startcol; hi<hLlen; hi++) {
+            rhtml += '<th>' + hL[hi] + '</th>';
+        }
+        rhtml += '</tr>';
+        
+        
+        //*** Values of the layer ***/
+        var vL = layObj.values;
+        var vLlen = vL.length;
+        
+        for (var vi=0; vi<vLlen; vi++) {
+            
+            //--- Rows ---//
+            var rowL = vL[vi];
+            var rowLlen = rowL.length;
+            
+            rhtml += '<tr>';
+            for (var ri=startcol; ri<rowLlen; ri++) {
+                // Write out shape link for zoom
+                if (withShpLink && ri < 1) {
+                    var shplinkL = rowL[ri].shplink;
+                    rhtml += '<td class=\"zoomlink\"><a href="javascript:' + (infoWin == 'frame' ? '' : 'opener.') + 'zoom2extent(\'' + shplinkL[0] + '\', \'' + shplinkL[1] + '\', \'' + shplinkL[2] + '\')">';
+                    rhtml += '<img src="images/zoomto.gif" alt="zoomto"></a></td>';
+                } else {
+                    // Check for Hyperlinks
+                    if (isObject(rowL[ri])) {
+                        var hypLinkL = rowL[ri].hyperlink;
+                        rhtml += '<td><a href="javascript:openHyperlink(\'' + hypLinkL[0] + '\', \'' + hypLinkL[1] + '\', \'' + hypLinkL[2] + '\')">' + hypLinkL[3] + '</a></td>';
+                    } else {
+                        rhtml += '<td>' + rowL[ri] + '</td>';
+                    }
+                }
+            }
+            rhtml += '</tr>';
+        }
+        
+
+        rhtml += '</table>';
+    }
+    
+    
+    /*** Zoom parameters ***/
+    var zp = jsonstr[1];
+    var infoWin = zp.infoWin;
+    
+    var allextent = zp.allextent;
+    
+    var zoomall = zp.zoomall;
+    if (zoomall) {
+        //alert('ja');
+        var zStr = '<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr><td class=\"zoomlink\">';
+        zStr += "<a href=\"javascript:";
+        zStr += (infoWin == 'frame' ? '' : 'opener.') + 'zoom2extent(0,0,\'' + allextent + '\')';
+        zStr += '\"><img src=\"images/zoomtoall.gif\"alt=\"za\"></a></td><td class=\"TDAL\">' + localeList['zoomSelected'] + '</td></tr></table>';
+        
+        rhtml += zStr;
+    }
+    
+    
+    var autozoom = zp.autozoom;
+    // Add image for onload event
+    var azStr = '<img src=\"images/blank.gif\" onload=\"';  
+    if (autozoom) {
+        //var azStr = '<script type=\"text/javascript\">';
+        
+        if (autozoom == 'auto') {
+            azStr += (infoWin == 'frame' ? 'window.parent.' : 'opener.') + 'zoom2extent(0,0,\'' + allextent + '\');';
+        } else if (autozoom == 'highlight') {
+            azStr += (infoWin == 'frame' ? 'window.parent.' : 'opener.') + 'updateMap(opener.PM_XAJAX_LOCATION + \'x_load.php?' + SID +  '&mode=map&zoom_type=zoompoint\', \'\')';
+        }
+        //alert(azStr);
+        //azStr += '</script>';
+        
+    } else {
+        azStr += (infoWin == 'frame' ? 'window.parent.' : 'opener.') + 'hideLayer(\'zoombox\');';
+    }
+    
+    azStr += '\" />';
+    rhtml += azStr;
+    
+    //alert( rhtml);
+    
+    return rhtml;
+}
+
+
+
+/**
+ * Parse JSON result string with parseJSON()
+ * and insert resulting HTML into queryresult DIV
+ */
+function writeQResult() {
+    var resstr = parseJSON(resultJSON, opener.infoWin);
+    $('queryresult').innerHTML = resstr;
+    //window.onload = function() {alert('pippo')};
+    sortables_init();
+}
+
+
+
+function isObject(a) {
+    return (a && typeof a == 'object') || typeof a == 'function';
+} 
+
+
+function parseJSON_IQuery(jsonstr) {
+
+    // Nothing found with query 
+    if (jsonstr == 0) {
+        return false;
+    }
+
+    // Features found, parse JSON string
+    var groups = jsonstr[0];    
+    
+    // Only take the first layer from group
+    var layObj = groups[0];
+    
+    var startcol = 1; 
+    
+    //*** Header line ***/
+    var hL = layObj.header;    
+    var hLlen = hL.length;
+    
+    //*** Values of the layer ***/
+    var vL = layObj.values;  
+        
+    //--- Rows ---//
+    var rowL = vL[0];  // <====== Only take the first from result
+   
+   
+    // Loop through records and create HTML
+    var rhtml = '';
+    rhtml += '<table class="iquery" border="0" cellspacing="0" cellpadding="0">';
+    rhtml += '<tr><th colspan="2" class="header">' + layObj.description + '</td></tr>';
+    
+    for (var hi=startcol; hi<hLlen; hi++) {
+        rhtml += '<tr>';
+        rhtml += '<th>' + hL[hi] + '</th>';
+        
+        // Check for Hyperlinks
+        if (isObject(rowL[hi])) {
+            var hypLinkL = rowL[hi].hyperlink;
+            rhtml += '<td>' + hypLinkL[3] + '</td>';
+        } else {
+            rhtml += '<td>' + rowL[hi] + '</td>';
+        }
+        
+        rhtml += '</tr>';
+    }
+
+    rhtml += '</table>';
+    
+    return rhtml;
+}
+
+
+
+
+function parseJSON_IQuery_0(jsonstr) {
+    
+    var rhtml = '';
+
+    // Nothing found with query, return only header 
+    if (jsonstr == 0) {
+        return false;
+    }
+
+
+    // Features found, parse JSON string
+    var groups = jsonstr[0];    
+    
+    var jlen = groups.length;
+    
+    
+    for (var i=0; i<jlen; i++) {
+        var layObj = groups[i];
+        
+        rhtml += '<div class="LAYERHEADER">' + layObj.description + '</div>';
+        rhtml += '<table class="iquery" border="0" cellspacing="0" cellpadding="0">';
+        
+        //*** Header line ***/
+        var hL = layObj.header;
+        if (hL[0] == '@') {
+            var withShpLink = true;
+        } else {
+            var withShpLink = false;
+        }
+        
+        var hLlen = hL.length;
+        rhtml += '<tr>';
+        var startcol = 1; //withShpLink ? 0 : 1;
+        for (var hi=startcol; hi<hLlen; hi++) {
+            rhtml += '<th>' + hL[hi] + '</th>';
+        }
+        rhtml += '</tr>';
+        
+        
+        //*** Values of the layer ***/
+        var vL = layObj.values;
+        var vLlen = vL.length;
+        
+        for (var vi=0; vi<vLlen; vi++) {
+            
+            //--- Rows ---//
+            var rowL = vL[vi];
+            var rowLlen = rowL.length;
+            
+            rhtml += '<tr>';
+            for (var ri=startcol; ri<rowLlen; ri++) {
+                // Write out shape link for zoom
+
+                // Check for Hyperlinks
+                if (isObject(rowL[ri])) {
+                    var hypLinkL = rowL[ri].hyperlink;
+                    rhtml += '<td>' + hypLinkL[3] + '</td>';
+                } else {
+                    rhtml += '<td>' + rowL[ri] + '</td>';
+                }
+                
+            }
+            rhtml += '</tr>';
+        }
+        
+
+        rhtml += '</table>';
+    }
+    
+    return rhtml;
+}

Added: javascript/sorttable.js
===================================================================
--- javascript/sorttable.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/sorttable.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,257 @@
+/*******************************************************************
+ http://www.kryogenix.org/code/browser/sorttable/
+ 
+ Code downloaded from the Browser Experiments section of 
+ kryogenix.org is licenced under the so-called MIT licence. 
+ The licence is below.
+
+ Copyright (c) 1997-date Stuart Langridge
+
+ Permission is hereby granted, free of charge, to any person 
+ obtaining a copy of this software and associated documentation 
+ files (the "Software"), to deal in the Software without 
+ restriction, including without limitation the rights to use, 
+ copy, modify, merge, publish, distribute, sublicense, and/or 
+ sell copies of the Software, and to permit persons to whom the 
+ Software is furnished to do so, subject to the following conditions:
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER  
+ DEALINGS IN THE SOFTWARE.
+
+********************************************************************/
+
+//addEvent(window, "load", sortables_init);
+
+var SORT_COLUMN_INDEX;
+
+function sortables_init() {
+    // Find all tables with class sortable and make them sortable
+    if (!document.getElementsByTagName) return;
+    var tbls = document.getElementsByTagName("table");
+    //alert(tbls.length);
+    for (ti=0;ti<tbls.length;ti++) {
+        thisTbl = tbls[ti];
+        //alert(thisTbl.className);
+        //if (((' '+thisTbl.className+' ').indexOf("sortable") != -1) && (thisTbl.id)) {
+        if (thisTbl.className == "sortable") {
+            //initTable(thisTbl.id);
+            ts_makeSortable(thisTbl);
+        }
+    }
+}
+
+function ts_makeSortable(table) {
+    if (table.rows && table.rows.length > 0) {
+        var firstRow = table.rows[0];
+    }
+    if (!firstRow) return;
+    
+    // We have a first row: assume it's the header, and make its contents clickable links
+    for (var i=0;i<firstRow.cells.length;i++) {
+        var cell = firstRow.cells[i];
+        var txt = ts_getInnerText(cell);
+        var headerHtml = '<a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'+txt+'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a>';
+        //alert(headerHtml);
+        cell.innerHTML = headerHtml;
+    }
+}
+
+function ts_getInnerText(el) {
+	if (typeof el == "string") return el;
+	if (typeof el == "undefined") { return el };
+	if (el.innerText) return el.innerText;	//Not needed but it is faster
+	var str = "";
+	
+	var cs = el.childNodes;
+	var l = cs.length;
+	for (var i = 0; i < l; i++) {
+		switch (cs[i].nodeType) {
+			case 1: //ELEMENT_NODE
+				str += ts_getInnerText(cs[i]);
+				break;
+			case 3:	//TEXT_NODE
+				str += cs[i].nodeValue;
+				break;
+		}
+	}
+	return str;
+}
+
+/**
+ * Functions to align column contents of tables
+ * --- Added by Armin Burger ---
+ */
+function ts_alignTables() {
+    var tableList = document.getElementsByTagName("table");
+    for (var t=0; t<tableList.length; t++) {
+        if (tableList[t].className == 'sortable') {
+            ts_alignCols(tableList[t]);
+        }
+    }
+}
+
+function ts_alignCols(table) {
+    if (!table.rows[1]) return false;
+    var colList = table.rows[1].cells;
+    for (var cl=0; cl<colList.length; cl++) {
+        var itm = ts_getInnerText(table.rows[1].cells[cl]);
+        align = "left";
+        if (table.rows[1].cells[cl].className == 'zoomlink') align = "center";
+        if (itm.match(/^\d\d[\/-]\d\d[\/-]\d\d\d\d$/)) align = "right";
+        if (itm.match(/^\d\d[\/-]\d\d[\/-]\d\d$/)) align = "right";
+        if (itm.match(/^[£$€]/)) align = "right";
+        if (itm.match(/^[\d\.]+$/)) align = "right";
+        
+        for (var r=0; r<table.rows.length;r++) {
+            if (table.rows[r].cells[cl]) {
+                table.rows[r].cells[cl].style.textAlign = align;
+            }
+        }
+    }
+}
+
+
+
+
+function ts_resortTable(lnk) {
+    // get the span
+    var span;
+    for (var ci=0;ci<lnk.childNodes.length;ci++) {
+        if (lnk.childNodes[ci].tagName && lnk.childNodes[ci].tagName.toLowerCase() == 'span') span = lnk.childNodes[ci];
+    }
+    var spantext = ts_getInnerText(span);
+    var td = lnk.parentNode;
+    var column = td.cellIndex;
+    var table = getParent(td,'TABLE');
+    
+    //ts_alignCols(table);
+    
+    // Work out a type for the column
+    if (table.rows.length <= 1) return;
+    var itm = ts_getInnerText(table.rows[1].cells[column]);
+    sortfn = ts_sort_caseinsensitive;
+    if (itm.match(/^\d\d[\/-]\d\d[\/-]\d\d\d\d$/)) sortfn = ts_sort_date;
+    if (itm.match(/^\d\d[\/-]\d\d[\/-]\d\d$/)) sortfn = ts_sort_date;
+    if (itm.match(/^[£$]/)) sortfn = ts_sort_currency;
+    if (itm.match(/^[\d\.]+$/)) sortfn = ts_sort_numeric;
+    SORT_COLUMN_INDEX = column;
+        
+    var firstRow = new Array();
+    var newRows = new Array();
+    for (i=0;i<table.rows[0].length;i++) { firstRow[i] = table.rows[0][i]; }
+    for (j=1;j<table.rows.length;j++) { newRows[j-1] = table.rows[j]; }
+
+    newRows.sort(sortfn);
+
+    if (span.getAttribute("sortdir") == 'down') {
+        //ARROW = '&nbsp;&nbsp;&uarr;';
+        ARROW = '&nbsp;&nbsp;<img src="images/upsimple.png">';
+        newRows.reverse();
+        span.setAttribute('sortdir','up');
+    } else {
+        //ARROW = '&nbsp;&nbsp;&darr;';
+        ARROW = '&nbsp;&nbsp;<img src="images/downsimple.png">';
+        span.setAttribute('sortdir','down');
+    }
+    
+    // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones
+    // don't do sortbottom rows
+    for (i=0;i<newRows.length;i++) { if (!newRows[i].className || (newRows[i].className && (newRows[i].className.indexOf('sortbottom') == -1))) table.tBodies[0].appendChild(newRows[i]);}
+    // do sortbottom rows only
+    for (i=0;i<newRows.length;i++) { if (newRows[i].className && (newRows[i].className.indexOf('sortbottom') != -1)) table.tBodies[0].appendChild(newRows[i]);}
+    
+    // Delete any other arrows there may be showing
+    var allspans = document.getElementsByTagName("span");
+    for (var ci=0;ci<allspans.length;ci++) {
+        if (allspans[ci].className == 'sortarrow') {
+            if (getParent(allspans[ci],"table") == getParent(lnk,"table")) { // in the same table as us?
+                allspans[ci].innerHTML = '&nbsp;&nbsp;&nbsp;';
+            }
+        }
+    }
+        
+    span.innerHTML = ARROW;
+}
+
+function getParent(el, pTagName) {
+	if (el == null) return null;
+	else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase())	// Gecko bug, supposed to be uppercase
+		return el;
+	else
+		return getParent(el.parentNode, pTagName);
+}
+function ts_sort_date(a,b) {
+    // y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX
+    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);
+    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);
+    if (aa.length == 10) {
+        dt1 = aa.substr(6,4)+aa.substr(3,2)+aa.substr(0,2);
+    } else {
+        yr = aa.substr(6,2);
+        if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; }
+        dt1 = yr+aa.substr(3,2)+aa.substr(0,2);
+    }
+    if (bb.length == 10) {
+        dt2 = bb.substr(6,4)+bb.substr(3,2)+bb.substr(0,2);
+    } else {
+        yr = bb.substr(6,2);
+        if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; }
+        dt2 = yr+bb.substr(3,2)+bb.substr(0,2);
+    }
+    if (dt1==dt2) return 0;
+    if (dt1<dt2) return -1;
+    return 1;
+}
+
+function ts_sort_currency(a,b) { 
+    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');
+    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');
+    return parseFloat(aa) - parseFloat(bb);
+}
+
+function ts_sort_numeric(a,b) { 
+    aa = parseFloat(ts_getInnerText(a.cells[SORT_COLUMN_INDEX]));
+    if (isNaN(aa)) aa = 0;
+    bb = parseFloat(ts_getInnerText(b.cells[SORT_COLUMN_INDEX])); 
+    if (isNaN(bb)) bb = 0;
+    return aa-bb;
+}
+
+function ts_sort_caseinsensitive(a,b) {
+    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).toLowerCase();
+    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).toLowerCase();
+    if (aa==bb) return 0;
+    if (aa<bb) return -1;
+    return 1;
+}
+
+function ts_sort_default(a,b) {
+    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);
+    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);
+    if (aa==bb) return 0;
+    if (aa<bb) return -1;
+    return 1;
+}
+
+
+function addEvent(elm, evType, fn, useCapture)
+// addEvent and removeEvent
+// cross-browser event handling for IE5+,  NS6 and Mozilla
+// By Scott Andrew
+{
+  if (elm.addEventListener){
+    elm.addEventListener(evType, fn, useCapture);
+    return true;
+  } else if (elm.attachEvent){
+    var r = elm.attachEvent("on"+evType, fn);
+    return r;
+  } else {
+    alert("Handler could not be removed");
+  }
+} 

Added: javascript/toc.js
===================================================================
--- javascript/toc.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/toc.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,275 @@
+/*********************************************************************************
+ Copyright (c) 2002-2005 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+/**********************************************************
+ * 
+ *
+ *
+ *********************************************************/
+var legendContainer = new Object();
+
+/**
+ * initialize and write TOC by calling XMLHttp function 'updateToc()' 
+ * 
+ */
+function initToc() {
+    legendContainer.checkedGrpList = defGroupList;
+    var tocurl = PM_XAJAX_LOCATION + 'x_toc.php?' + SID;
+    updateToc(tocurl, ''); 
+}
+
+
+/**
+ * Toggle groups and categories (and related images)
+ * attached as onClick script to plus/minus icons and links
+ */
+function tg(group) {
+    var crIE = (document.all && !document.getElementById && !navigator.userAgent.match(/Opera|Konqueror|Safari/i) ? true : false);
+    var divobj = document.getElementById(group);
+    var dheight;
+    var visToSet;
+
+    if (divobj.style.visibility == 'hidden') {
+        visToSet = 'visible';
+        if (crIE) {        	
+            dheight = 0+"px";
+            divobj.style.width = 'auto';
+        } else {        	
+            dheight = 'auto';
+            divobj.style.overflow = "visible";
+        }
+        document.getElementById(group + '_timg').src = 'images/tree/minus.gif';
+    } else {
+        visToSet = 'hidden';
+        if (crIE) {
+            divobj.style.width = 0+"px";
+            dheight = 1+"px";
+        } else {
+            dheight = 0+"px";
+        }
+        divobj.style.overflow = 'hidden';
+        document.getElementById(group + '_timg').src = 'images/tree/plus.gif';
+    }
+    
+    divobj.style.height = dheight;
+    divobj.style.visibility = visToSet;    
+    //document.getElementById('pmtree').style.overflow = 'auto';
+}
+ 
+
+/**
+ * Initialize TOC tree
+ * attached as onLoad script to hidden image in legend/TOC
+ */
+function treeInit(catStyle, grpStyle) { 
+    //alert('init');
+    legendContainer.catStyle = catStyle;
+    
+    if (catStyle == 'tree') {    	
+        var divList = document.getElementsByTagName('div');
+        var catcList = [];
+        var grpcList = [];
+
+        var c = 0;
+        var g = 0;
+        for (var d=0; d<divList.length; d++) {
+            if (divList[d].className == 'catc') {
+                catcList[c] = divList[d];
+                c++;
+                //alert(divList[d].id);
+            } else if (divList[d].className == 'grpc') {
+                grpcList[g] = divList[d];
+                g++;
+            }
+        }
+        
+        if (catcList.length > 0) {
+            for (var i=0; i<catcList.length; i++) {  
+                catcList[i].style.visibility='hidden';
+                tg(catcList[i].id);
+            }
+        } 
+        
+        if (grpStyle == 'tree') {
+            if (grpcList.length > 0) {
+                for (var j=0; j<grpcList.length; j++) {
+                    grpcList[j].style.visibility='visible';
+                    tg(grpcList[j].id);
+                }
+            }
+        }
+        
+        legendContainer.catcList = catcList;
+        legendContainer.grpcList = grpcList;
+        
+    }
+    
+    // In case of reload from 'swapToLayerView()' reset active categories for Layer View
+    if (legendContainer.catcListV) {
+        resetLayerViewSettings();
+    }
+    
+    resetCheckedGroups();
+}    
+
+
+/**
+ * Sets popup legedn over map visible
+ * attached as onClick script to button
+ */
+function showPopupLegend() {
+    var tocurl = PM_XAJAX_LOCATION + 'x_toc.php?' + SID + '&legendonly=1';
+    showMapLegend(tocurl, ''); 
+}
+
+
+/**
+ * for legStyle 'swap': swap from LAYER view to LEGEND view
+ * attached as onClick script to button
+ */
+function swapToLegendView() {
+    if (legendContainer.catStyle == 'tree') getActiveCats();
+    var tocurl = PM_XAJAX_LOCATION + 'x_toc.php?' + SID + '&legendonly=1&swaplegend=1';
+    swapLegend(tocurl, ''); 
+    
+    getCheckedGroups();
+}
+
+/**
+ * for legStyle 'swap': swap from LEGEND view to LAYER view
+ * attached as onClick script to button
+ */
+function swapToLayerView() {
+    var legDiv = document.getElementById('toclegend');
+    var tocDiv = document.getElementById('toc');
+    //legDiv.style.visibility = 'hidden';
+    tocDiv.style.visibility = 'visible';
+    tocDiv.innerHTML = legendContainer.legTxt;
+	resetCheckedGroups();
+    // update TOC CSS depending on scale
+    var tocurl = PM_XAJAX_LOCATION + 'x_toc_update.php?' + SID;
+    updateTocScale(tocurl, '');
+    
+    //window.setTimeout("resetLayerViewSettings()", 200);
+}
+
+/**
+ * for legStyle 'swap': when swapping back from LEGEND view to LAYER view:
+ * reset settings for opened tree nodes
+ */
+function resetLayerViewSettings() {
+    catcListV = legendContainer.catcListV;
+    catcListH = legendContainer.catcListH;
+    
+    for (var v=0; v<catcListV.length; v++) {  
+        document.getElementById(catcListV[v].id).style.visibility = 'hidden';
+        tg(catcListV[v].id);
+    }
+    
+    for (var h=0; h<catcListH.length; h++) {  
+        document.getElementById(catcListH[h].id).style.visibility = 'visible';
+        tg(catcListH[h].id);
+    }
+}
+
+function resetCheckedGroups() {
+    //alert(legendContainer.checkedGrpList);
+    if (legendContainer.checkedGrpList) {
+        var checkedGrpList = legendContainer.checkedGrpList;
+        var checkedGrpListL = checkedGrpList.length;
+        
+        if (checkedGrpListL > 0) {
+            for (var x=0; x<checkedGrpListL; x++) {
+                var chkGrp = document.getElementById(checkedGrpList[x]);
+                if (chkGrp) {
+                    chkGrp.checked = true;
+                }
+            }
+        }
+    }
+}
+
+/**
+ * Get and set active (opened) categories
+ * store arrays for visible and hidden category contents in object property 
+ */
+function getActiveCats() { 
+    var catcList = legendContainer.catcList;
+    
+    var catcListV = [];
+    var catcListH = [];
+    var v = 0;
+    var h = 0;
+    
+    for (var i=0; i<catcList.length; i++) {  
+        if (catcList[i].style.visibility == 'visible') {
+            catcListV[v] = catcList[i];
+            v++;
+        } else {
+            catcListH[h] = catcList[i];
+            h++;
+        }
+    }
+    
+    legendContainer.catcListV = catcListV;
+    legendContainer.catcListH = catcListH;
+}
+
+function getCheckedGroups() {
+    var checkedGrpList = [];
+    var g = 0;
+    var cbxList = document.getElementsByName('groupscbx');
+    if (cbxList.length > 0) {
+        for (var i=0; i<cbxList.length; i++) {
+            if (cbxList[i].checked) {
+                checkedGrpList[g] = cbxList[i].id;
+                g++;
+            }
+        }
+    }
+    
+    /*
+    var radList = document.getElementsByName('groupsrad');
+    if (radList.length > 0) {
+        for (var j=0; j<radList.length; j++) {
+            if (radList[j].checked) {
+                checkedGrpList[g] = radList[j].id;
+                g++;
+            }
+        }
+    }
+    */
+    
+    legendContainer.checkedGrpList = checkedGrpList;
+}
+
+
+
+function setDefGroups() {
+    //for (var i=0; i<defGroups.length; i++) {
+        //document.getElementById('laycbx_' + defGroups[i]).checked = true ;
+    //}
+
+    //tg('cat_admin');
+}
+
+
+

Added: javascript/wz_jsgraphics.js
===================================================================
--- javascript/wz_jsgraphics.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/wz_jsgraphics.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,930 @@
+/* This notice must be untouched at all times.
+
+wz_jsgraphics.js    v. 2.3
+The latest version is available at
+http://www.walterzorn.com
+or http://www.devira.com
+or http://www.walterzorn.de
+
+Copyright (c) 2002-2004 Walter Zorn. All rights reserved.
+Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com )
+Last modified: 29. 9. 2004
+
+Performance optimizations for Internet Explorer
+by Thomas Frank and John Holdsworth.
+fillPolygon method implemented by Matthieu Haller.
+
+High Performance JavaScript Graphics Library.
+Provides methods
+- to draw lines, rectangles, ellipses, polygons
+  with specifiable line thickness,
+- to fill rectangles and ellipses
+- to draw text.
+NOTE: Operations, functions and branching have rather been optimized
+to efficiency and speed than to shortness of source code.
+
+LICENSE: LGPL
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License (LGPL) 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,
+or see http://www.gnu.org/copyleft/lesser.html 
+*/
+
+
+var jg_ihtm, jg_ie, jg_fast, jg_dom, jg_moz,
+jg_n4 = (document.layers && typeof document.classes != "undefined");
+
+
+function chkDHTM(x, i)
+{
+	x = document.body || null;
+	jg_ie = x && typeof x.insertAdjacentHTML != "undefined";
+	jg_dom = (x && !jg_ie &&
+		typeof x.appendChild != "undefined" &&
+		typeof document.createRange != "undefined" &&
+		typeof (i = document.createRange()).setStartBefore != "undefined" &&
+		typeof i.createContextualFragment != "undefined");
+	jg_ihtm = !jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined";
+	jg_fast = jg_ie && document.all && !window.opera;
+	jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined";
+}
+
+
+function pntDoc()
+{
+	this.wnd.document.write(jg_fast? this.htmRpc() : this.htm);
+	this.htm = '';
+}
+
+
+function pntCnvDom()
+{
+	var x = document.createRange();
+	x.setStartBefore(this.cnv);
+	x = x.createContextualFragment(jg_fast? this.htmRpc() : this.htm);
+	this.cnv.appendChild(x);
+	this.htm = '';
+}
+
+
+function pntCnvIe()
+{
+	this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this.htmRpc() : this.htm);
+	this.htm = '';
+}
+
+
+function pntCnvIhtm()
+{
+	this.cnv.innerHTML += this.htm;
+	this.htm = '';
+}
+
+
+function pntCnv()
+{
+	this.htm = '';
+}
+
+
+function mkDiv(x, y, w, h)
+{
+	this.htm += '<div style="position:absolute;'+
+		'left:' + x + 'px;'+
+		'top:' + y + 'px;'+
+		'width:' + w + 'px;'+
+		'height:' + h + 'px;'+
+		'clip:rect(0,'+w+'px,'+h+'px,0);'+
+		'background-color:' + this.color +
+		(!jg_moz? ';overflow:hidden' : '')+
+		';"><\/div>';
+}
+
+
+function mkDivIe(x, y, w, h)
+{
+	this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';';
+}
+
+
+function mkDivPrt(x, y, w, h)
+{
+	this.htm += '<div style="position:absolute;'+
+		'border-left:' + w + 'px solid ' + this.color + ';'+
+		'left:' + x + 'px;'+
+		'top:' + y + 'px;'+
+		'width:0px;'+
+		'height:' + h + 'px;'+
+		'clip:rect(0,'+w+'px,'+h+'px,0);'+
+		'background-color:' + this.color +
+		(!jg_moz? ';overflow:hidden' : '')+
+		';"><\/div>';
+}
+
+
+function mkLyr(x, y, w, h)
+{
+	this.htm += '<layer '+
+		'left="' + x + '" '+
+		'top="' + y + '" '+
+		'width="' + w + '" '+
+		'height="' + h + '" '+
+		'bgcolor="' + this.color + '"><\/layer>\n';
+}
+
+
+var regex =  /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g;
+function htmRpc()
+{
+	return this.htm.replace(
+		regex,
+		'<div style="overflow:hidden;position:absolute;background-color:'+
+		'$1;left:$2;top:$3;width:$4;height:$5"></div>\n');
+}
+
+
+function htmPrtRpc()
+{
+	return this.htm.replace(
+		regex,
+		'<div style="overflow:hidden;position:absolute;background-color:'+
+		'$1;left:$2;top:$3;width:$4;height:$5;border-left:$4px solid $1"></div>\n');
+}
+
+
+function mkLin(x1, y1, x2, y2)
+{
+	if (x1 > x2)
+	{
+		var _x2 = x2;
+		var _y2 = y2;
+		x2 = x1;
+		y2 = y1;
+		x1 = _x2;
+		y1 = _y2;
+	}
+	var dx = x2-x1, dy = Math.abs(y2-y1),
+	x = x1, y = y1,
+	yIncr = (y1 > y2)? -1 : 1;
+
+	if (dx >= dy)
+	{
+		var pr = dy<<1,
+		pru = pr - (dx<<1),
+		p = pr-dx,
+		ox = x;
+		while ((dx--) > 0)
+		{
+			++x;
+			if (p > 0)
+			{
+				this.mkDiv(ox, y, x-ox, 1);
+				y += yIncr;
+				p += pru;
+				ox = x;
+			}
+			else p += pr;
+		}
+		this.mkDiv(ox, y, x2-ox+1, 1);
+	}
+
+	else
+	{
+		var pr = dx<<1,
+		pru = pr - (dy<<1),
+		p = pr-dy,
+		oy = y;
+		if (y2 <= y1)
+		{
+			while ((dy--) > 0)
+			{
+				if (p > 0)
+				{
+					this.mkDiv(x++, y, 1, oy-y+1);
+					y += yIncr;
+					p += pru;
+					oy = y;
+				}
+				else
+				{
+					y += yIncr;
+					p += pr;
+				}
+			}
+			this.mkDiv(x2, y2, 1, oy-y2+1);
+		}
+		else
+		{
+			while ((dy--) > 0)
+			{
+				y += yIncr;
+				if (p > 0)
+				{
+					this.mkDiv(x++, oy, 1, y-oy);
+					p += pru;
+					oy = y;
+				}
+				else p += pr;
+			}
+			this.mkDiv(x2, oy, 1, y2-oy+1);
+		}
+	}
+}
+
+
+function mkLin2D(x1, y1, x2, y2)
+{
+	if (x1 > x2)
+	{
+		var _x2 = x2;
+		var _y2 = y2;
+		x2 = x1;
+		y2 = y1;
+		x1 = _x2;
+		y1 = _y2;
+	}
+	var dx = x2-x1, dy = Math.abs(y2-y1),
+	x = x1, y = y1,
+	yIncr = (y1 > y2)? -1 : 1;
+
+	var s = this.stroke;
+	if (dx >= dy)
+	{
+		if (s-3 > 0)
+		{
+			var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx;
+			_s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1;
+		}
+		else var _s = s;
+		var ad = Math.ceil(s/2);
+
+		var pr = dy<<1,
+		pru = pr - (dx<<1),
+		p = pr-dx,
+		ox = x;
+		while ((dx--) > 0)
+		{
+			++x;
+			if (p > 0)
+			{
+				this.mkDiv(ox, y, x-ox+ad, _s);
+				y += yIncr;
+				p += pru;
+				ox = x;
+			}
+			else p += pr;
+		}
+		this.mkDiv(ox, y, x2-ox+ad+1, _s);
+	}
+
+	else
+	{
+		if (s-3 > 0)
+		{
+			var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy;
+			_s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1;
+		}
+		else var _s = s;
+		var ad = Math.round(s/2);
+
+		var pr = dx<<1,
+		pru = pr - (dy<<1),
+		p = pr-dy,
+		oy = y;
+		if (y2 <= y1)
+		{
+			++ad;
+			while ((dy--) > 0)
+			{
+				if (p > 0)
+				{
+					this.mkDiv(x++, y, _s, oy-y+ad);
+					y += yIncr;
+					p += pru;
+					oy = y;
+				}
+				else
+				{
+					y += yIncr;
+					p += pr;
+				}
+			}
+			this.mkDiv(x2, y2, _s, oy-y2+ad);
+		}
+		else
+		{
+			while ((dy--) > 0)
+			{
+				y += yIncr;
+				if (p > 0)
+				{
+					this.mkDiv(x++, oy, _s, y-oy+ad);
+					p += pru;
+					oy = y;
+				}
+				else p += pr;
+			}
+			this.mkDiv(x2, oy, _s, y2-oy+ad+1);
+		}
+	}
+}
+
+
+function mkLinDott(x1, y1, x2, y2)
+{
+	if (x1 > x2)
+	{
+		var _x2 = x2;
+		var _y2 = y2;
+		x2 = x1;
+		y2 = y1;
+		x1 = _x2;
+		y1 = _y2;
+	}
+	var dx = x2-x1, dy = Math.abs(y2-y1),
+	x = x1, y = y1,
+	yIncr = (y1 > y2)? -1 : 1,
+	drw = true;
+	if (dx >= dy)
+	{
+		var pr = dy<<1,
+		pru = pr - (dx<<1),
+		p = pr-dx;
+		while ((dx--) > 0)
+		{
+			if (drw) this.mkDiv(x, y, 1, 1);
+			drw = !drw;
+			if (p > 0)
+			{
+				y += yIncr;
+				p += pru;
+			}
+			else p += pr;
+			++x;
+		}
+		if (drw) this.mkDiv(x, y, 1, 1);
+	}
+
+	else
+	{
+		var pr = dx<<1,
+		pru = pr - (dy<<1),
+		p = pr-dy;
+		while ((dy--) > 0)
+		{
+			if (drw) this.mkDiv(x, y, 1, 1);
+			drw = !drw;
+			y += yIncr;
+			if (p > 0)
+			{
+				++x;
+				p += pru;
+			}
+			else p += pr;
+		}
+		if (drw) this.mkDiv(x, y, 1, 1);
+	}
+}
+
+
+function mkOv(left, top, width, height)
+{
+	var a = width>>1, b = height>>1,
+	wod = width&1, hod = (height&1)+1,
+	cx = left+a, cy = top+b,
+	x = 0, y = b,
+	ox = 0, oy = b,
+	aa = (a*a)<<1, bb = (b*b)<<1,
+	st = (aa>>1)*(1-(b<<1)) + bb,
+	tt = (bb>>1) - aa*((b<<1)-1),
+	w, h;
+	while (y > 0)
+	{
+		if (st < 0)
+		{
+			st += bb*((x<<1)+3);
+			tt += (bb<<1)*(++x);
+		}
+		else if (tt < 0)
+		{
+			st += bb*((x<<1)+3) - (aa<<1)*(y-1);
+			tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3);
+			w = x-ox;
+			h = oy-y;
+			if (w&2 && h&2)
+			{
+				this.mkOvQds(cx, cy, -x+2, ox+wod, -oy, oy-1+hod, 1, 1);
+				this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1);
+			}
+			else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h);
+			ox = x;
+			oy = y;
+		}
+		else
+		{
+			tt -= aa*((y<<1)-3);
+			st -= (aa<<1)*(--y);
+		}
+	}
+	this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod);
+	this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod);
+}
+
+
+function mkOv2D(left, top, width, height)
+{
+	var s = this.stroke;
+	width += s-1;
+	height += s-1;
+	var a = width>>1, b = height>>1,
+	wod = width&1, hod = (height&1)+1,
+	cx = left+a, cy = top+b,
+	x = 0, y = b,
+	aa = (a*a)<<1, bb = (b*b)<<1,
+	st = (aa>>1)*(1-(b<<1)) + bb,
+	tt = (bb>>1) - aa*((b<<1)-1);
+
+	if (s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0))
+	{
+		var ox = 0, oy = b,
+		w, h,
+		pxl, pxr, pxt, pxb, pxw;
+		while (y > 0)
+		{
+			if (st < 0)
+			{
+				st += bb*((x<<1)+3);
+				tt += (bb<<1)*(++x);
+			}
+			else if (tt < 0)
+			{
+				st += bb*((x<<1)+3) - (aa<<1)*(y-1);
+				tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3);
+				w = x-ox;
+				h = oy-y;
+
+				if (w-1)
+				{
+					pxw = w+1+(s&1);
+					h = s;
+				}
+				else if (h-1)
+				{
+					pxw = s;
+					h += 1+(s&1);
+				}
+				else pxw = h = s;
+				this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h);
+				ox = x;
+				oy = y;
+			}
+			else
+			{
+				tt -= aa*((y<<1)-3);
+				st -= (aa<<1)*(--y);
+			}
+		}
+		this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod);
+		this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod);
+	}
+
+	else
+	{
+		var _a = (width-((s-1)<<1))>>1,
+		_b = (height-((s-1)<<1))>>1,
+		_x = 0, _y = _b,
+		_aa = (_a*_a)<<1, _bb = (_b*_b)<<1,
+		_st = (_aa>>1)*(1-(_b<<1)) + _bb,
+		_tt = (_bb>>1) - _aa*((_b<<1)-1),
+
+		pxl = new Array(),
+		pxt = new Array(),
+		_pxb = new Array();
+		pxl[0] = 0;
+		pxt[0] = b;
+		_pxb[0] = _b-1;
+		while (y > 0)
+		{
+			if (st < 0)
+			{
+				st += bb*((x<<1)+3);
+				tt += (bb<<1)*(++x);
+				pxl[pxl.length] = x;
+				pxt[pxt.length] = y;
+			}
+			else if (tt < 0)
+			{
+				st += bb*((x<<1)+3) - (aa<<1)*(y-1);
+				tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3);
+				pxl[pxl.length] = x;
+				pxt[pxt.length] = y;
+			}
+			else
+			{
+				tt -= aa*((y<<1)-3);
+				st -= (aa<<1)*(--y);
+			}
+
+			if (_y > 0)
+			{
+				if (_st < 0)
+				{
+					_st += _bb*((_x<<1)+3);
+					_tt += (_bb<<1)*(++_x);
+					_pxb[_pxb.length] = _y-1;
+				}
+				else if (_tt < 0)
+				{
+					_st += _bb*((_x<<1)+3) - (_aa<<1)*(_y-1);
+					_tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-3);
+					_pxb[_pxb.length] = _y-1;
+				}
+				else
+				{
+					_tt -= _aa*((_y<<1)-3);
+					_st -= (_aa<<1)*(--_y);
+					_pxb[_pxb.length-1]--;
+				}
+			}
+		}
+
+		var ox = 0, oy = b,
+		_oy = _pxb[0],
+		l = pxl.length,
+		w, h;
+		for (var i = 0; i < l; i++)
+		{
+			if (typeof _pxb[i] != "undefined")
+			{
+				if (_pxb[i] < _oy || pxt[i] < oy)
+				{
+					x = pxl[i];
+					this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy);
+					ox = x;
+					oy = pxt[i];
+					_oy = _pxb[i];
+				}
+			}
+			else
+			{
+				x = pxl[i];
+				this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod);
+				this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
+				ox = x;
+				oy = pxt[i];
+			}
+		}
+		this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod);
+		this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
+	}
+}
+
+
+function mkOvDott(left, top, width, height)
+{
+	var a = width>>1, b = height>>1,
+	wod = width&1, hod = height&1,
+	cx = left+a, cy = top+b,
+	x = 0, y = b,
+	aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1,
+	st = (aa2>>1)*(1-(b<<1)) + bb,
+	tt = (bb>>1) - aa2*((b<<1)-1),
+	drw = true;
+	while (y > 0)
+	{
+		if (st < 0)
+		{
+			st += bb*((x<<1)+3);
+			tt += (bb<<1)*(++x);
+		}
+		else if (tt < 0)
+		{
+			st += bb*((x<<1)+3) - aa4*(y-1);
+			tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3);
+		}
+		else
+		{
+			tt -= aa2*((y<<1)-3);
+			st -= aa4*(--y);
+		}
+		if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1);
+		drw = !drw;
+	}
+}
+
+
+function mkRect(x, y, w, h)
+{
+	var s = this.stroke;
+	this.mkDiv(x, y, w, s);
+	this.mkDiv(x+w, y, s, h);
+	this.mkDiv(x, y+h, w+s, s);
+	this.mkDiv(x, y+s, s, h-s);
+}
+
+
+function mkRectDott(x, y, w, h)
+{
+	this.drawLine(x, y, x+w, y);
+	this.drawLine(x+w, y, x+w, y+h);
+	this.drawLine(x, y+h, x+w, y+h);
+	this.drawLine(x, y, x, y+h);
+}
+
+
+function jsgFont()
+{
+	this.PLAIN = 'font-weight:normal;';
+	this.BOLD = 'font-weight:bold;';
+	this.ITALIC = 'font-style:italic;';
+	this.ITALIC_BOLD = this.ITALIC + this.BOLD;
+	this.BOLD_ITALIC = this.ITALIC_BOLD;
+}
+var Font = new jsgFont();
+
+
+function jsgStroke()
+{
+	this.DOTTED = -1;
+}
+var Stroke = new jsgStroke();
+
+
+function jsGraphics(id, wnd)
+{
+	this.setColor = new Function('arg', 'this.color = arg.toLowerCase();');
+
+	this.setStroke = function(x)
+	{
+		this.stroke = x;
+		if (!(x+1))
+		{
+			this.drawLine = mkLinDott;
+			this.mkOv = mkOvDott;
+			this.drawRect = mkRectDott;
+		}
+		else if (x-1 > 0)
+		{
+			this.drawLine = mkLin2D;
+			this.mkOv = mkOv2D;
+			this.drawRect = mkRect;
+		}
+		else
+		{
+			this.drawLine = mkLin;
+			this.mkOv = mkOv;
+			this.drawRect = mkRect;
+		}
+	};
+
+
+	this.setPrintable = function(arg)
+	{
+		this.printable = arg;
+		if (jg_fast)
+		{
+			this.mkDiv = mkDivIe;
+			this.htmRpc = arg? htmPrtRpc : htmRpc;
+		}
+		else this.mkDiv = jg_n4? mkLyr : arg? mkDivPrt : mkDiv;
+	};
+
+
+	this.setFont = function(fam, sz, sty)
+	{
+		this.ftFam = fam;
+		this.ftSz = sz;
+		this.ftSty = sty || Font.PLAIN;
+	};
+
+
+	this.drawPolyline = this.drawPolyLine = function(x, y, s)
+	{
+		for (var i=0 ; i<x.length-1 ; i++ )
+			this.drawLine(x[i], y[i], x[i+1], y[i+1]);
+	};
+
+
+	this.fillRect = function(x, y, w, h)
+	{
+		this.mkDiv(x, y, w, h);
+	};
+
+
+	this.drawPolygon = function(x, y)
+	{
+		this.drawPolyline(x, y);
+		this.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]);
+	};
+
+
+	this.drawEllipse = this.drawOval = function(x, y, w, h)
+	{
+		this.mkOv(x, y, w, h);
+	};
+
+
+	this.fillEllipse = this.fillOval = function(left, top, w, h)
+	{
+		var a = (w -= 1)>>1, b = (h -= 1)>>1,
+		wod = (w&1)+1, hod = (h&1)+1,
+		cx = left+a, cy = top+b,
+		x = 0, y = b,
+		ox = 0, oy = b,
+		aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1,
+		st = (aa2>>1)*(1-(b<<1)) + bb,
+		tt = (bb>>1) - aa2*((b<<1)-1),
+		pxl, dw, dh;
+		if (w+1) while (y > 0)
+		{
+			if (st < 0)
+			{
+				st += bb*((x<<1)+3);
+				tt += (bb<<1)*(++x);
+			}
+			else if (tt < 0)
+			{
+				st += bb*((x<<1)+3) - aa4*(y-1);
+				pxl = cx-x;
+				dw = (x<<1)+wod;
+				tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3);
+				dh = oy-y;
+				this.mkDiv(pxl, cy-oy, dw, dh);
+				this.mkDiv(pxl, cy+oy-dh+hod, dw, dh);
+				ox = x;
+				oy = y;
+			}
+			else
+			{
+				tt -= aa2*((y<<1)-3);
+				st -= aa4*(--y);
+			}
+		}
+		this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod);
+	};
+
+
+
+/* fillPolygon method, implemented by Matthieu Haller.
+This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib.
+C source of GD 1.8.4 found at http://www.boutell.com/gd/
+
+THANKS to Kirsten Schulz for the polygon fixes!
+
+The intersection finding technique of this code could be improved
+by remembering the previous intertersection, and by using the slope.
+That could help to adjust intersections to produce a nice
+interior_extrema. */
+	this.fillPolygon = function(array_x, array_y)
+	{
+		var i;
+		var y;
+		var miny, maxy;
+		var x1, y1;
+		var x2, y2;
+		var ind1, ind2;
+		var ints;
+
+		var n = array_x.length;
+
+		if (!n) return;
+
+
+		miny = array_y[0];
+		maxy = array_y[0];
+		for (i = 1; i < n; i++)
+		{
+			if (array_y[i] < miny)
+				miny = array_y[i];
+
+			if (array_y[i] > maxy)
+				maxy = array_y[i];
+		}
+		for (y = miny; y <= maxy; y++)
+		{
+			var polyInts = new Array();
+			ints = 0;
+			for (i = 0; i < n; i++)
+			{
+				if (!i)
+				{
+					ind1 = n-1;
+					ind2 = 0;
+				}
+				else
+				{
+					ind1 = i-1;
+					ind2 = i;
+				}
+				y1 = array_y[ind1];
+				y2 = array_y[ind2];
+				if (y1 < y2)
+				{
+					x1 = array_x[ind1];
+					x2 = array_x[ind2];
+				}
+				else if (y1 > y2)
+				{
+					y2 = array_y[ind1];
+					y1 = array_y[ind2];
+					x2 = array_x[ind1];
+					x1 = array_x[ind2];
+				}
+				else continue;
+
+				 // modified 11. 2. 2004 Walter Zorn
+				if ((y >= y1) && (y < y2))
+					polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1);
+
+				else if ((y == maxy) && (y > y1) && (y <= y2))
+					polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1);
+			}
+			polyInts.sort(integer_compare);
+
+			for (i = 0; i < ints; i+=2)
+			{
+				w = polyInts[i+1]-polyInts[i]
+				this.mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1);
+			}
+		}
+	};
+
+
+	this.drawString = function(txt, x, y)
+	{
+		this.htm += '<div style="position:absolute;white-space:nowrap;'+
+			'left:' + x + 'px;'+
+			'top:' + y + 'px;'+
+			'font-family:' +  this.ftFam + ';'+
+			'font-size:' + this.ftSz + ';'+
+			'color:' + this.color + ';' + this.ftSty + '">'+
+			txt +
+			'<\/div>';
+	}
+
+
+	this.drawImage = function(imgSrc, x, y, w, h)
+	{
+		this.htm += '<div style="position:absolute;'+
+			'left:' + x + 'px;'+
+			'top:' + y + 'px;'+
+			'width:' +  w + ';'+
+			'height:' + h + ';">'+
+			'<img src="' + imgSrc + '" width="' + w + '" height="' + h + '">'+
+			'<\/div>';
+	}
+
+
+	this.clear = function()
+	{
+		this.htm = "";
+		if (this.cnv) this.cnv.innerHTML = this.defhtm;
+	};
+
+
+	this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h)
+	{
+		this.mkDiv(xr+cx, yt+cy, w, h);
+		this.mkDiv(xr+cx, yb+cy, w, h);
+		this.mkDiv(xl+cx, yb+cy, w, h);
+		this.mkDiv(xl+cx, yt+cy, w, h);
+	};
+
+	this.setStroke(1);
+	this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN);
+	this.color = '#000000';
+	this.htm = '';
+	this.wnd = wnd || window;
+
+	if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM();
+	if (typeof id != 'string' || !id) this.paint = pntDoc;
+	else
+	{
+		this.cnv = document.all? (this.wnd.document.all[id] || null)
+			: document.getElementById? (this.wnd.document.getElementById(id) || null)
+			: null;
+		this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : '';
+		this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv;
+	}
+
+	this.setPrintable(false);
+}
+
+
+
+function integer_compare(x,y)
+{
+	return (x < y) ? -1 : ((x > y)*1);
+}
+

Added: javascript/xmlhttp.js
===================================================================
--- javascript/xmlhttp.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/xmlhttp.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,375 @@
+/*********************************************************************************
+ Copyright (c) 2003-2006 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ 
+ --------------------------------------------------------------------------------
+ 
+ EXAMPLES FOR XMLHTTP TAKEN FROM DREW MCLELLAN ON
+ http://www.xml.com/pub/a/2005/02/09/xml-http-request.html
+ with additional ideas/concepts from 
+ Chirp Internet: www.chirp.com.au
+ 
+**********************************************************************************/
+
+var xn = 0;
+var maploading = false;
+
+
+
+/**
+ * GENERIC XMLHTTP FUNCTIONS
+ */
+function AjaxRequest()
+{
+    var req;
+   
+    //var method = "GET";
+    //var nocache = true;
+    
+    this.loadXMLDoc = function(url) 
+    {
+        // branch for native XMLHttpRequest object
+        if (window.XMLHttpRequest) {
+            try {
+                req = new XMLHttpRequest();
+            } catch(e) {
+                req = false;
+            }
+        // branch for IE/Windows ActiveX version
+        } else if (window.ActiveXObject) {
+            try {
+                req = new ActiveXObject("Msxml2.XMLHTTP");
+            } catch(e) {
+                try {
+                    req = new ActiveXObject("Microsoft.XMLHTTP");
+                } catch(e) {
+                    req = false;
+                }
+            }
+        }
+        
+        if (req) {
+            req.onreadystatechange = processReqChange;
+            // avoid caching by adding arbitrary values
+            //url += '&zxyq=' + (new Date()).getTime();
+            req.open("GET", url, true);
+            req.send(null);
+        }
+    }
+    
+    
+    var processReqChange = function()
+    {
+        // only if req shows "complete"
+        if (req.readyState == 4) {
+            // only if "OK"
+            //if (req.status == 0 || req.status == 200) {
+            if (req.status == 200) {
+                // processing statements go here
+                eval('response = ' + req.responseText);
+                method = response.method;
+                
+                eval(method + '(\'\',' + req.responseText + ')');
+                
+            } else {
+                
+            }
+        }
+    }
+}
+
+
+
+/*==================================================================================================*/
+
+
+/**
+ * P.MAPPER-RELATED XMLHTTP FUNCTIONS
+ */
+
+// For loading/updating the MAP
+function updateMap(url, response) {
+    var loadObj = document.getElementById("loading");
+
+    if (response != '') {     
+        // Response mode
+        // Reload application when PHP session expired
+        var sessionerror = response.sessionerror;
+        if (sessionerror == 'true') {
+           errormsg = localeList['sessionExpired']; 
+           //alert(errormsg);
+           window.location.reload();
+           return false;
+        }
+        
+        var rBxL = response.refBoxStr.split(',');
+        //var refW = response.refW;
+        //var refH = response.refH;
+        minx_geo = parseFloat(response.minx_geo);
+        maxy_geo = parseFloat(response.maxy_geo);
+        xdelta_geo = parseFloat(response.xdelta_geo);
+        ydelta_geo = parseFloat(response.ydelta_geo);
+        var geo_scale = response.geo_scale;
+        var urlPntStr = response.urlPntStr;
+        
+        // Load new map image
+        loadMapImg(response.mapURL);
+        
+        
+        // Check if TOC has to be updated
+        var tocStyle = response.tocStyle;
+        var refreshToc = eval(response.refreshToc);
+        refreshToc = true;
+        if (refreshToc) {
+            var tocurl = PM_XAJAX_LOCATION + 'x_toc_update.php?' + SID;
+            updateTocScale(tocurl, '');
+        }
+        
+        //alert(geo_scale);
+        
+        // Scale-related activities
+        writescale(geo_scale);
+        setSlider(geo_scale);
+        pMap_setMapScale(geo_scale);
+        
+        
+        // Reference image: set DHTML objects
+        setRefBox(rBxL[0], rBxL[1], rBxL[2], rBxL[3]);
+        
+        // reset cursor
+        setCursor(false);
+        
+        // Update SELECT tool OPTIONs in case of 'select' mode
+        var varformMode = $("varform").mode.value;
+        //alert(varformMode);
+        if (varformMode == 'nquery' || varformMode == 'iquery') {
+            var selurl = PM_XAJAX_LOCATION + 'x_select.php?'+ SID + '&activegroup=' + getSelectLayer() ;
+            updateSelectTool(selurl, '');
+        }
+        
+        // If measure was active, delete all emasure elements
+        if (varformMode == 'measure') resetMeasure();
+        
+        
+        //Update map link
+        var dg = getLayers();
+        var maxx_geo = xdelta_geo + minx_geo;
+        var miny_geo = maxy_geo - ydelta_geo;
+        var me = minx_geo + ',' + miny_geo + ',' + maxx_geo + ',' + maxy_geo;
+        var confpar = config.length > 0 ? '&config=' + config : '';
+        var urlPntStrPar = urlPntStr.length > 1 ? '&up=' + urlPntStr : '';
+        var loc = window.location;
+        var linkhref = loc.protocol + '//' + loc.hostname + loc.port + loc.pathname + '?dg=' + dg + '&me=' + me + '&language=' + gLanguage + confpar + urlPntStrPar; 
+
+        $('current_maplink').href = linkhref;
+         
+    } else {
+        // Input mode
+        //if (maploading == false) {
+            maploading = true;
+            loadObj.style.visibility = "visible";
+            var req = new AjaxRequest();   
+            req.loadXMLDoc(url);
+        //}
+    }   
+}
+
+function setInnerHTML(elementId , html){
+	var el = $('toc');
+	el.innerHTML = html; 
+    evalInnerJS(el);
+}
+
+function evalInnerJS(element) {
+	var scripts = element.getElementsByTagName('script');
+	var code;
+	for (var i = 0; i < scripts.length; i++) {
+		code =	scripts[i].innerHTML ? scripts[i].innerHTML : 
+			scripts[i].text ? scripts[i].text : 
+			scripts[i].textContent;
+		try {
+			eval(code);
+		} catch(e) {
+			alert(e);
+		}
+	}
+}
+
+
+// Update the TOC //
+function updateToc(tocurl, response) {
+    if (response != ''){     
+        // Response mode
+        var tocHTML = response.tocHTML;        
+                        
+        setInnerHTML('toc',tocHTML);        
+        legendContainer.legTxt = tocHTML;
+        
+        var tocurl = PM_XAJAX_LOCATION + 'x_toc_update.php?' + SID;
+        //window.setTimeout("updateTocScale(tocurl, ''))", 300);
+        updateTocScale(tocurl, '');
+        
+    } else {
+        // Input mode
+        var req = new AjaxRequest();   
+        req.loadXMLDoc(tocurl);
+    }   
+}
+
+
+// Update the TOC //
+function updateTocScale(tocurl, response) {
+    // Response mode
+    if (response != '') {
+        /* UPDATE TOC APPLYING DIFFERENT STYLES TO VISIBLE/NOT-VISIBLE LAYERS*/
+        var layers = response.layers;
+        
+        for (var l in layers) {
+            var spanList = document.getElementsByTagName('span');
+            var sl = spanList.length;
+            for (var s=0; s<sl; s++) {
+                var spanObj = spanList[s];                 
+                if (spanObj.id.indexOf( 'spxg_' + l) != -1) {
+                    spanObj.className = layers[l];
+                }
+            }
+        }
+        
+    } else {
+        // Input mode
+        var req = new AjaxRequest();   
+        req.loadXMLDoc(tocurl);
+    }   
+}
+
+
+
+// Show legend over MAP //
+function showMapLegend(tocurl, response) {
+    if (response != ''){     
+        // Response mode
+        var tocHTML = response.tocHTML;
+       // alert(tocHTML);       
+        var legDiv = $('maplegend');                
+        //alert("legDiv = "+legDiv);
+        setInnerHTML('maplegend',tocHTML);
+        legDiv.style.visibility = 'visible';
+    } else {
+        // Input mode
+        var req = new AjaxRequest();   
+        req.loadXMLDoc(tocurl);
+    }   
+}
+
+
+// Swap from TOC to LEGEND view //
+function swapLegend(tocurl, response) {
+    //alert(tocurl);
+    if (response != ''){     
+        // Response mode
+        var tocHTML = response.tocHTML;
+        var legDiv = $('toclegend');
+        var tocDiv = $('toc');        
+        setInnerHTML('toc',tocHTML);
+        //legDiv.style.visibility = 'visible';
+        //tocDiv.style.visibility = 'hidden';
+    } else {
+        // Input mode
+        var req = new AjaxRequest();   
+        req.loadXMLDoc(tocurl);
+    }   
+}
+
+
+
+// For SELECT tool //
+function updateSelectTool(selurl, response) {
+    if (response != ''){     
+        // Response mode
+        var selStr = response.selStr;
+        $('bottomMapFrame').innerHTML = selStr;
+    } else {
+        // Input mode
+        var req = new AjaxRequest();   
+        req.loadXMLDoc(selurl);
+    }   
+}
+
+
+function updateSelLayers(mapurl, response) {
+    if (response != ''){     
+        // Response mode
+        var sellayers = response.sellayers;
+        
+        // Update SELECT tool OPTIONs in case of 'select' mode
+        var vMode = $("varform").mode.value;
+        if (vMode == 'nquery' || vMode == 'iquery') {
+            var selurl = PM_XAJAX_LOCATION + 'x_select.php?'+ SID + '&activegroup=' + getSelectLayer() ;
+            updateSelectTool(selurl, '');
+        }
+        
+    } else {
+        // Input mode
+        var req = new AjaxRequest();   
+        req.loadXMLDoc(mapurl);
+    }
+}
+
+
+
+function addPOI(digitizeurl, response) {
+    if (response != ''){     
+        // Response mode
+        var txt = response.retvalue;
+        changeLayersDraw();
+        
+    } else {
+        // Input mode
+        var req = new AjaxRequest();   
+        req.loadXMLDoc(digitizeurl);
+    }
+}
+
+
+// For QUERY //
+function getQueryResult(qurl, response) {
+    if (response != ''){     
+        // Response mode
+        var mode = response.mode;
+        var queryResult = response.queryResult;
+        
+        if (mode != 'iquery') {
+            if (infoWin == 'window') {
+                openResultwin('info.phtml?'+SID);
+            } else {
+                $('infoFrame').innerHTML = parseJSON(queryResult, infoWin);
+            }
+        } else {
+            // Display result in DIV and postion it correctly
+            showIQueryResults(queryResult);
+        }
+
+    } else {
+        // Input mode
+        var req = new AjaxRequest();   
+        req.loadXMLDoc(qurl);
+    }   
+}
+
+

Added: javascript/zoombox.js
===================================================================
--- javascript/zoombox.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/zoombox.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,827 @@
+/*********************************************************************************
+ Copyright (c) 2002-2003 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+// ================== FUNCTIONS FOR ZOOM AND PAN  =====================//
+// will only work with modern browsers, NOT with 4.x versions          //
+// Successfully tested with Mozilla 1.0+, Firefox, IE 5.5+, Opera 6+, Konqueror 3//
+
+  
+/*
+ * GLOBAL VARIABLES
+ ******************************************************/
+var mouseDrag = false;    // TRUE when mouse is pressed
+var maction;
+
+var rightMouseButton = false;
+
+var downX, downY;
+var upX, upY;
+var moveX, moveY;
+
+//var offsX = 0; 	// horizontal image offset
+//var offsY = 0;    // vertical image offset
+
+var rBoxMinW = 8;   // Minimal width until to show refBox; below threshold switches to refCross
+var rOffs = 13;     // Offset of refCross Image, adapt to Image size and refbox border
+
+if (document.all) {
+    var zBorder = 0;
+} else {
+    var zBorder = 4;
+}
+
+var refmapClick = false;
+var mapcL, mapcT, mapcL, mapcR;
+var mapElem; 
+
+var isIE = (document.all) ? true : false;
+
+var iquery_timer;
+
+
+
+/*
+ * DEFINE MOUSE ACTIONS, CALLED AS 'ONLOAD' SCRIPT
+ ******************************************************/
+// FOR MOUSE OVER MAP
+function startUp() {
+    refmapClick = false;
+    
+    // ENABLES ACTIONS FOR KEYBOARD KEYS
+    // comment out if not wanted
+    if (document.all) document.onkeydown = kp;
+    document.onkeypress = kp;
+    
+    mapElem = $('map');
+    if (mapElem) {
+        mapElem.onmousedown = doMouseDown; 
+        mapElem.onmouseup   = doMouseUp;
+        mapElem.onmousemove = doMouseMove; 
+                
+        // ENABLES ACTIONS FOR MOUSE WHEEL
+        if (isIE) {
+            mapElem.onmousewheel = omw;
+        } else {
+            mapElem.addEventListener('DOMMouseScroll', omw, false);
+        }
+        mapElem.oncontextmenu = disableContextMenu;
+        
+        setCursorMinMax('map');
+    }
+    
+}
+
+
+
+// FOR MOUSE OVER REFERENCE MAP
+function startUpRef() {
+    clearTimeout(iquery_timer);  // necessary for iquery mode
+    refmapClick = true;
+    refElem = $('refmap');
+    if (refElem) {
+        refElem.onmousedown = doMouseDown; 
+        refElem.onmouseup   = doMouseUp;
+        refElem.onmousemove = doMouseMove;   
+    
+        // ENABLES ACTIONS FOR MOUSE WHEEL ON MAP
+        if (isIE) {
+            refElem.onmousewheel = omw;
+        } else {
+            refElem.addEventListener('DOMMouseScroll', omw, false);
+        }
+        
+        setCursorMinMax('refmap');
+    }
+}
+
+
+// MIN AND MAX VALUES FOR MOUSE
+function setCursorMinMax(elem) {
+    // MAP
+    if (elem == 'map') {
+        mapcL = rawLeft('mapFrame') + rawLeft('map');
+        mapcT = rawTop('mapFrame') + rawTop('map');
+        mapcR = mapcL + mapW;
+        mapcB = mapcT + mapH;
+    // REFERENCE MAP
+    } else {
+        mapcL = rawLeft('refmap');
+        mapcT = rawTop('refmap');
+        mapcR = mapcL + refW;
+        mapcB = mapcT + refH;
+    }
+    
+    offsX = mapcL + 1; 		// horizontal image offset
+    offsY = mapcT + 1; 
+}
+
+
+function checkCursorPosition(cX, cY) {
+    if (cX >= mapcL && cX <= mapcR && cY >= mapcT && cY <= mapcB) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
+
+/*
+ * FUNCTIONS TO GET MOUSE POSITIONS
+ ******************************************************/
+// For MouseDown
+function getDownXY(e) {
+    if (document.all) {
+		eX = event.clientX;
+        eY = event.clientY;
+	} else {
+		eX = e.pageX;
+		eY = e.pageY;
+	}
+	// subtract offsets
+        
+    downX = eX - offsX;
+    downY = eY - offsY;
+    
+    mapElem.onmouseup   = doMouseUp;
+    mapElem.onmousemove = doMouseMove;
+    mapElem.ondblclick  = doMouseDblClick;  // used for measure area, comment out if area measurement not wanted
+
+    //alert (downX + ' - ' + downY);
+
+    return false;	
+}
+
+
+// For MouseUp
+function getUpXY(e) {
+    if (document.all) {
+        eX = event.clientX;
+        eY = event.clientY;
+    } else {
+        eX = e.pageX;
+        eY = e.pageY;
+    }
+    // subtract offsets from left and top and don't go outside of map
+    
+    if (!refmapClick) {
+        upX = Math.min(eX - offsX, mapW);
+        upY = Math.min(eY - offsY, mapH);
+    } else {
+        upX = eX - offsX;
+        upY = eY - offsY;
+    }
+
+    return false;
+}
+
+
+// For MouseMove
+function getMoveXY(e) {
+    if (document.all) {
+        moveX = event.clientX;
+        moveY = event.clientY;
+    } else {
+        moveX = e.pageX;
+        moveY = e.pageY;
+    }
+    // subtract offsets from left and top
+    /*moveX = Math.min(moveX - offsX, mapW);
+    moveY = Math.min(moveY - offsY, mapH); */
+    moveX = moveX - offsX;
+    moveY = moveY - offsY;             
+}
+
+
+/*
+ * BASIC MOUSE FUNCTIONS: DOWN, UP, MOVE
+ ******************************************************/
+
+function doMouseDown(e) {
+    e = (e)?e:((event)?event:null);
+    
+    if (enableRightMousePan) {
+        if (e.button == 2) {
+            rightMouseButton = true;
+            setCursor(true);
+        } else {
+            rightMouseButton = false;
+        }
+    }
+
+    // ENABLES ACTIONS FOR KEYBOARD KEYS
+    // comment out if not wanted
+    if (document.all) document.onkeydown = kp;
+    document.onkeypress = kp;
+    
+    mouseDrag = true;
+    getDownXY(e);
+    
+    if (refmapClick) {
+        if (downX < 1 || downY < 1 || downX > refW || downY > refH) {        // Don't go ouside of map
+            return false;
+        } else {
+            moveRefBox('shift');
+        }
+    }
+
+    return false;
+}
+
+
+function doMouseUp(e) {
+    e = (e)?e:((event)?event:null);
+    //alert (rightMouseButton);
+    
+    mouseDrag = false;
+    getUpXY(e);
+
+    var varform = $("varform");
+
+    // Click in main map
+    if (!refmapClick) {
+
+        maction = varform.maction.value;
+
+        if (rightMouseButton) {
+            maction = 'pan';
+        }
+        
+        if (maction == 'measure') {
+            //alert(upX + ' - ' + upY);
+            measureDrawSymbols(e, upX, upY, 0);
+
+        } else if (maction == 'pan'){
+            var diffX = upX - downX;
+            var diffY = upY - downY;
+            // pan with click
+            if (diffX == 0 && diffY == 0) {
+                var newX = upX;
+                var newY = upY;
+            // pan with drag
+            } else {
+                var newX = (mapW / 2) - diffX ;
+                var newY = (mapH / 2) - diffY;
+            }
+            
+            zoombox_apply(newX, newY, newX, newY);
+            
+            //Reset after right-mouse pan
+            maction = varform.maction.value;
+            rightMouseButton = false;
+        
+        } else if (maction == 'click'){
+            zoombox_apply(downX, downY, downX, downY);
+                
+        } else if (maction == 'move'){
+            // do nothing
+            return false;
+
+        } else {
+            zoombox_apply(Math.min(downX,upX), Math.min(downY,upY), Math.max(downX,upX), Math.max(downY,upY));
+        }
+
+    // Click in reference map
+    } else {
+        if (upX < 1 || upY < 1 || upX > refW || upY > refH) {   // Don't go ouside of map
+            return false;
+        } else {
+            //alert(upX +', '+ upY +', '+ upX +', '+ upY);
+            zoombox_apply(upX, upY, upX, upY);
+        }
+    }
+    
+    return false;    
+}
+
+
+function doMouseMove(e) {
+    e = (e)?e:((event)?event:null);
+    
+    getMoveXY(e);
+    /* * Draw a zoombox when mouse is pressed and zoom-in or select function are active
+       * move map layer when pan function is active
+       * do nothing for all others                                                      */
+
+    // Actions in MAIN MAP
+    if (!refmapClick) {
+    	var varform = $("varform");
+        if (varform) {
+            maction = varform.maction.value;
+        }
+        
+        if (rightMouseButton) {
+            maction = 'pan';
+        }
+
+        
+        // Display coordinates of current cursor position
+        displayCoordinates();        
+        	
+        
+        switch (maction) {
+            //# zoom-in, select
+            case 'box':
+                if (mouseDrag == true) { 
+                    startZoomBox(e, moveX, moveY);
+                } else if (varform.mode.value == 'nquery') {
+                    try {
+                        if (combinedSelectIquery) {
+                            clearTimeout(iquery_timer);
+                            iquery_timer = setTimeout("applyIquery(" + moveX + "," + moveY + ")", 300);
+                        }
+                    } catch(e) {
+                        return false;
+                    }
+                }
+                break;
+    
+            //# zoom-out, identify
+            case 'click':
+                hideLayer('zoombox');
+                break;
+    
+            //# pan with drag
+            case 'pan':
+                hideLayer('zoombox');
+                startPan(e, moveX, moveY);
+                break;
+    
+            //# measure
+            case 'measure':
+                showLayer('measureLayer');
+                redrawAll(moveX , moveY);                
+                break;
+                
+            //# move
+            case 'move':
+                if (varform.mode.value == 'iquery') {    //# iquery
+                    clearTimeout(iquery_timer);
+                    iquery_timer = setTimeout("applyIquery(" + moveX + "," + moveY + ")", 300);
+                }
+                break;
+        }
+        
+    // Actions in REFERENCE MAP
+    } else {
+        hideLayer('zoombox');
+        if (mouseDrag) {
+            moveRefBox('move');
+        }
+    }
+    
+    return false;    
+}
+
+
+// For DOUBLE CLICK 
+// currently only used for measure function: end measure, calculate polygon area
+function doMouseDblClick(e) {
+    getUpXY(e);
+    var varform = $("varform");
+    maction = varform.maction.value;
+    if (maction == 'measure') {
+        measureDrawSymbols(e, upX, upY, 1);
+    }
+}  
+
+
+
+
+/*
+ * FUNCTIONS FOR ZOOM BOX && PAN MOVING MAP
+ ******************************************************/
+
+// DRAG ZOOM BOX (ZOOM IN, SELECT)
+function startZoomBox(e, moveX, moveY) {
+    if (mouseDrag == true) {
+        if (checkCursorPosition(moveX + offsX, moveY + offsY)) {
+            showLayer('zoombox');
+            var boxL = Math.min(moveX, downX);
+            var boxT = Math.min(moveY, downY);
+            var boxW = Math.abs(moveX - downX);
+            var boxH = Math.abs(moveY - downY);
+
+            var theZoomBox = $("zoombox");            
+            theZoomBox.style.left   = boxL+"px";
+            theZoomBox.style.top    = boxT+"px";
+            theZoomBox.style.width  = boxW+"px";
+            theZoomBox.style.height = boxH+"px";
+        }
+    }
+    return false;
+}
+
+// PAN
+function startPan(e, moveX, moveY) {
+    if (mouseDrag == true) {
+        
+        if (checkCursorPosition(moveX + offsX, moveY + offsY)) {
+            var mapL = moveX - downX;
+            var mapT = moveY - downY;
+    
+            var theMapImg = $("mapimg");
+            var theMapImgL = $("mapimgLayer");
+            
+            var clipT = 0;
+            var clipR = mapW;
+            var clipB = mapH;
+            var clipL = 0;
+            
+            theMapImgL.style.top  = mapT+"px";
+            theMapImgL.style.left = mapL+"px";
+            
+            if (mapT > 0) {
+                clipB = mapH - parseInt(theMapImgL.style.top);
+            } else {
+                clipT = -1 * parseInt(theMapImgL.style.top);     
+            }
+            
+            if (mapL > 0) {
+                clipR = mapW - parseInt(theMapImgL.style.left);
+            } else {
+                clipL = -1 * parseInt(theMapImgL.style.left);
+            }
+            
+    
+            var clipRect = 'rect(' + clipT + 'px ' 
+                                   + clipR + 'px '
+                                   + clipB + 'px ' 
+                                   + clipL + 'px)'; 
+            //window.status = clipRect;
+            theMapImgL.style.clip = clipRect;
+
+        }
+    }
+    return false;
+}
+
+
+/*
+ * FUNCTIONS FOR REFERENCE MAP RECTANGLE
+ ******************************************************/
+function setRefBox(boxL, boxT, boxW, boxH) {
+    //showLayer('refbox');
+    var rBox   = $("refbox");
+    var sBox   = $("sliderbox");
+    var rCross = $("refcross");
+    
+    if (rBox) {
+        rBox.style.left   = boxL+"px";
+        rBox.style.top    = boxT+"px";
+        rBox.style.width  = boxW+"px"; //Math.max(4, boxW);
+        rBox.style.height = boxH+"px"; //Math.max(4, boxH);
+    }
+    
+    if (rCross) {
+        if (boxW < rBoxMinW) {
+            rBox.style.visibility = "hidden";
+            rCross.style.visibility = "visible";
+            setRefCross(rCross, boxL, boxT, boxW, boxH);
+        } else {
+            rCross.style.visibility = "hidden";
+            rBox.style.visibility = "visible";
+        }
+    }
+    
+    if (sBox) {
+        sBox.style.visibility = "hidden";
+    }
+}
+
+// MOVE RECTANGLE WITH MOUSE PAN
+function moveRefBox(moveAction) {
+    var rBox   = $("refbox");
+    var rCross = $("refcross");
+
+    var boxL = parseInt(rBox.style.left);
+    var boxT = parseInt(rBox.style.top);
+    var boxW = parseInt(rBox.style.width);
+    var boxH = parseInt(rBox.style.height);
+    
+    if (moveAction == 'shift') {
+        var newX = downX; 
+        var newY = downY;        
+    } else {
+        var newX = moveX; 
+        var newY = moveY; 
+    }
+    
+    boxLnew = newX - (boxW / 2) - 1; 
+    boxTnew = newY - (boxH / 2) - 1;
+    
+    if (boxLnew < 0 || boxTnew < 0 || (boxLnew + boxW) > refW || (boxTnew + boxH) > refH) {
+        return false;
+    } else {
+        rBox.style.left = boxLnew+"px";
+        rBox.style.top  = boxTnew+"px";
+        window.status = (boxLnew + boxW + ' - ' + refW);
+        
+        if (boxW < rBoxMinW) {
+            setRefCross(rCross, boxLnew, boxTnew, boxW, boxH);
+        }
+    }
+}
+
+
+// Change position of reference cross
+// => symbol used when refbox below threshold
+function setRefCross(rCross, boxL, boxT, boxW, boxH) {	
+    boxcX = parseInt(boxL) + parseInt((boxW / 2));
+    boxcY = parseInt(boxT) + parseInt((boxH / 2));
+    rCross.style.left = Math.round((boxcX - rOffs))+"px";
+    rCross.style.top  = Math.round((boxcY - rOffs))+"px";    
+}
+
+
+
+// SET DIV LAYER VISIBLE - HIDDEN
+function showLayer(elementID) {
+    $(elementID).style.visibility = "visible";
+}
+
+function hideLayer(elementID) {
+    $(elementID).style.visibility = "hidden";
+}
+
+
+
+/*******************************************************************
+ * Resize map image while zooming with slider
+ * called from sliderMove() in slider.js
+ ********************************************/
+function resizeMap(sizeFactor) {
+    //alert(sizeFactor);
+    var theMapImg = $('mapImg');
+    var theMapLay = $('mapimgLayer');
+    
+    var oldW = mapW;
+    var oldH = mapH;
+    var newW = oldW * sizeFactor;
+    var newH = oldH * sizeFactor;
+    
+    var newLeft = (oldW - newW) / 2;
+    var newTop  = (oldH - newH) / 2;
+
+    theMapImg.style.width  = newW+"px";
+    theMapImg.style.height = newH+"px";
+    theMapLay.style.left   = newLeft+"px"; 
+    theMapLay.style.top    = newTop+"px";
+    
+    if (sizeFactor > 1) {
+        var diffW = parseInt((newW - oldW) / 2);
+        var diffH = parseInt((newH - oldH) / 2);
+        clipT = diffH;
+        clipR = diffW + oldW;
+        clipB = diffH + oldH;
+        clipL = diffW;
+
+        var clipRect = 'rect(' + clipT + 'px ' 
+                               + clipR + 'px '
+                               + clipB + 'px ' 
+                               + clipL + 'px)'; 
+        //window.status = clipRect;
+        theMapLay.style.clip = clipRect;
+        
+        theMapLay.style.width   = newW+"px";
+        theMapLay.style.height  = newH+"px";
+    } 
+}
+
+
+function resizeRefBox(sizeFactor) { 
+    var refZoomBox = $('refbox');
+    var refSliderBox = $('refsliderbox');
+    
+    if (refSliderBox) {
+        refSliderBox.style.visibility = "visible";
+    }
+    
+    if (refZoomBox) {
+        var refBoxBorderW = 1;  // adapt to border width in CSS
+
+        var oldRefW = parseInt(refZoomBox.style.width);
+        var oldRefH = parseInt(refZoomBox.style.height);
+        var oldRefLeft = parseInt(refZoomBox.style.left);
+        var oldRefTop = parseInt(refZoomBox.style.top);
+        
+        var newRefW = Math.round(oldRefW / sizeFactor);
+        var newRefH = Math.round(oldRefH / sizeFactor);
+        
+        var newRefLeft = parseInt(oldRefLeft + ((oldRefW - newRefW) / 2) + refBoxBorderW);
+        var newRefTop  = parseInt(oldRefTop + ((oldRefH - newRefH) / 2) + refBoxBorderW);
+        
+        refSliderBox.style.left   = newRefLeft+"px";
+        refSliderBox.style.top    = newRefTop+"px";
+        refSliderBox.style.width  = newRefW+"px";
+        refSliderBox.style.height = newRefH+"px";
+    }
+}
+
+
+
+/*
+ * KEYBOARD FUNCTIONS
+ * original script taken from http://ka-map.maptools.org/
+ ******************************************************************/
+function kp(e) {
+    e = (e)?e:((event)?event:null);
+    if(e) {
+        var charCode=(e.charCode)?e.charCode:e.keyCode;
+        //alert(charCode);
+        var b=true;
+        var nStep = 16;
+        switch(charCode){
+          case 63232://safari up arrow
+          case 38://up arrow
+            arrowpan('n');
+            break;
+          case 63233://safari down arrow
+          case 40://down arrow
+            arrowpan('s');
+            break;
+          case 63234://safari left arrow
+          case 37:// left arrow
+            arrowpan('w');
+            break;
+          case 63235://safari right arrow
+          case 39://right arrow
+            arrowpan('e');
+            break;
+          case 63276://safari pageup
+          case 33://pageup
+            gofwd();
+            break;
+          case 63277://safari pagedown
+          case 34://pagedown
+            goback();
+            break;
+          case 63273://safari home (left)
+          case 36://home
+            zoomfullext();
+            break;
+          case 63275://safari end (right)
+          case 35://end
+            slideBy(-viewportWidth/2,0);
+            break;
+          case 43:
+            //if (!navigator.userAgent.match(/Opera|Konqueror/i))  
+            zoompoint(2, '');
+            break;
+         case 45:
+            zoompoint(-2, '');
+            break;
+          default:
+            b=false;
+        }
+    }
+}
+
+
+
+/*
+ * MOUSEWHEEL FUNCTIONS (zoom in/out)
+ * only works with IE
+ ******************************************************************/
+function omw(e) {
+    e = (e)?e:((event)?event:null);
+    if(e) {
+        var wD = e.wheelDelta ? e.wheelDelta : e.detail*-1;
+        clearTimeout(resize_timer);
+        if (wD < 0) {
+            //zoompoint(2, '');
+            resize_timer = setTimeout("zoompoint(2, '')",300);  
+            return false;
+        } else if (wD > 0) {
+            //zoompoint(-2, '');
+            resize_timer = setTimeout("zoompoint(-2, '')",300);  
+            return false;
+        }
+    }
+}
+
+
+
+function disableContextMenu(e) {
+    e = (e)?e:((event)?event:null);
+    return false;
+}
+
+
+
+
+/* 
+ * FUNCTIONS FOR COODINATE DIPLAY FUNCTIONS
+ ***********************************************/
+// GET MAP COORDINATES FOR MOUSE MOVE
+function getCoords(mouseX, mouseY, convert2latlon) {
+    var x_geo = minx_geo + ((mouseX/mapW) * xdelta_geo);
+    var y_geo = maxy_geo - ((mouseY/mapH) * ydelta_geo);
+    
+    if (convert2latlon) {
+        // Just for ETRS-LAEA projection: convert from LAEA to latlon coordinates
+        var mpoint = laea2latlon(x_geo, y_geo);
+    
+    } else {
+        // Display mouse position in MAP coordinates 
+        var mpoint = new Object();
+        mpoint.x = x_geo;
+        mpoint.y = y_geo;
+    }
+    
+    return  mpoint;
+}
+
+
+
+
+// DISPLAY MAP COORDINATES FOR MOUSE MOVE
+function displayCoordinates() {
+    var mpoint = getCoords(moveX, moveY, false);
+    //var mpoint = getCoords(moveX, moveY, true);
+    
+    // Round values (function 'roundN()' in 'measure.js')
+    var rfactor = 0;
+    var px = isNaN(mpoint.x) ? '' : roundN(mpoint.x, rfactor);
+    var py = isNaN(mpoint.y) ? '' : roundN(mpoint.y, rfactor);
+    
+    // Display in status bar
+    /*
+    var mapCoords = 'X: ' + px + '  Y: ' + py;
+    window.status = mapCoords;
+    */
+    
+    // Display in DIV over MAP 
+    $('xcoord').innerHTML = 'X: ' + px; // + ' &deg;';
+    $('ycoord').innerHTML = 'Y: ' + py; // + ' &deg;';
+}
+
+
+
+// Convert XY coordinates from ETRS-LAEA to lat/lon
+function laea2latlon(X, Y) {
+    var a   = 6378137;
+    var f   = 1 / 298.257222101;
+    var e2  = (2*f) - (f*f);
+    var e   = Math.sqrt(e2);
+    var ph0 = 52 / 180 * Math.PI ;
+    var la0 = 10 / 180 * Math.PI;
+    var X0  = 4321000.0;
+    var Y0  = 3210000.0;
+    
+    
+    var q0 = (1-e2) *  ((Math.sin(ph0) / (1 - (e2 * Math.pow(Math.sin(ph0), 2)))) - ((1/(2*e)) * Math.log((1 - (e * Math.sin(ph0))) / (1 + (e * Math.sin(ph0))))));    
+    
+    var qp = (1-e2) *  ( (1 / (1-e2)) - ((1/(2*e)) * Math.log((1-e)/(1+e)) ) ) ;
+    
+    var beta0 = Math.asin(q0/qp);
+    
+    var Rq = a * Math.sqrt(qp/2);
+    
+    var D  =  (a * Math.cos(ph0)) / (Math.sqrt(1 - (e2 * Math.pow(Math.sin(ph0), 2))) * (Rq * Math.cos(beta0))  );
+    
+    var p = Math.sqrt(Math.pow((X-X0)/D, 2) + Math.pow(D * (Y-Y0), 2));
+    
+    var C = 2 * Math.asin(p / (2*Rq));
+    
+    var beta_ = Math.asin((Math.cos(C) * Math.sin(beta0))  +  (((D * (Y-Y0)) * Math.sin(C) * Math.cos(beta0)) / p));
+    
+    
+    // Latitude
+    var lat1 = ((e2/3) + ((31*Math.pow(e2, 2)) / 180) + ((517*Math.pow(e2, 3)) / 5040)) * Math.sin(2*beta_);
+    var lat2 = (((23*Math.pow(e2, 2)) / 360) + ((251*Math.pow(e2, 3)) / 3780)) * Math.sin(4*beta_);
+    var lat3 = ((761*Math.pow(e2, 3)) / 45360) * Math.sin(6*beta_);
+    var lat = (beta_ + lat1 + lat2 + lat3) * (180/Math.PI);
+    
+    
+    //Longitude
+    var lon = (la0 + Math.atan( ((X-X0) * Math.sin(C)) / ((D * p * Math.cos(beta0) * Math.cos(C)) - (D*D * (Y-Y0) * Math.sin(beta0) * Math.sin(C))))) * (180/Math.PI);  
+    
+    
+    // Return Point
+    var mpoint = new Object();
+    mpoint.x = lon;
+    mpoint.y = lat;
+    
+    return mpoint;
+}
+
+

Added: javascript/zslider.js
===================================================================
--- javascript/zslider.js	2006-10-05 22:45:01 UTC (rev 0)
+++ javascript/zslider.js	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,185 @@
+/************************************************************
+                    Slider control creator
+              By Mark Wilton-Jones 12-13/10/2002
+Version 1.1 updated 22/10/2003 to provide hand cursor option
+*************************************************************
+
+Please see http://www.howtocreate.co.uk/jslibs/ for details and a demo of this script
+Please see http://www.howtocreate.co.uk/jslibs/termsOfUse.html for terms of use
+
+___________________________________________________________________________________________*/
+
+
+/* Modifications and new functions by Armin Burger for use with MapServer */
+
+// ***************** START OF CODE BY Armin Burger ************************
+
+/*
+ * Functions for setting scale to form input and load map
+ **************************************************************************/
+var myslider;
+var slScale;
+
+function createZSlider(sliderElemId) {
+    myslider = new slider(
+    sliderElemId,  // id of DIV where slider is inserted
+    12,        //height of track
+    160,       //width of track
+    '#EBEBEB', //colour of track
+    1,         //thickness of track border
+    '#003366', //colour of track border
+    2,         //thickness of runner (in the middle of the track)
+    '#666666', //colour of runner
+    18,        //height of button
+    10,        //width of button
+    '#CCCCCC', //colour of button
+    2,         //thickness of button border (shaded to give 3D effect)
+    '<font size="2"></font>', //text of button (if any)
+    true,      //direction of travel (true = horizontal, false = vertical)
+    'sliderMove', //the name of the function to execute as the slider moves
+    'sliderStop', //the name of the function to execute when the slider stops
+    true          //the functions must have already been defined (or use null for none)
+    
+    );
+}
+
+
+
+/**
+ * Set Scale by moving slider
+ */
+function sliderMove(sliderPosition) {
+    currScale = pMap_getMapScale(); //top.currScale;
+    slScale = sliderx2Scale(sliderPosition);
+    var strlenSlScale = parseInt(slScale).toString().length;
+    var redFact = Math.pow(10, strlenSlScale - 2);
+    
+    slScale = Math.round(slScale/redFact) * redFact;
+    
+    /* FEDE */
+    //document.scaleform.scale.value = slScale;
+    document.getElementById("scaleform").scale.value = slScale;
+    
+    var scaleRatio = currScale / slScale;
+    
+    // Resize map image according to new scale
+    // call resizeMap() from zoombox.js
+    resizeMap(scaleRatio);
+    //window.status = scaleRatio;
+
+    // Resize refbox according to new scale
+    // call resizeRefBox() from zoombox.js
+    resizeRefBox(scaleRatio);
+}
+
+function sliderx2Scale(x) {
+    var sliderScale = (1 - x) * s1  + (x * s2) - (x * (1 - x) * s1)  ;  
+    return sliderScale;
+}
+
+function sliderStop() {
+    zoom2scale(slScale);
+    mouseIsPressed = false;
+    return false;
+}
+
+
+/**
+ * Returns the slider position value (0 to 1) with regard to the new map scale
+ * Contribution by Paul Hasenohr
+ */
+function getSliderPosition(curscale) {
+    var eqPart = Math.sqrt((s2*s2) + (4*s1*curscale) - (4*s1*s2))
+    
+    var pos = ((2 * s1) - s2 + eqPart) / (2*s1) ;
+    if (pos < 0 || pos > 1) {
+        pos = ((2 * s1) - s2 - eqPart) / (2*s1) ;
+    }
+    if (pos > 1 || isNaN(pos)) pos = 1;
+    
+    return pos;
+}
+
+
+
+
+// ***************** START OF ORIGINAL CODE ************************
+
+
+var mouseIsPressed = false;
+
+var MWJ_slider_controls = 0;
+
+function sliderMousePos(e) {
+	//get the position of the mouse
+	if( !e ) { e = window.event; } if( !e || ( typeof( e.pageX ) != 'number' && typeof( e.clientX ) != 'number' ) ) { return [0,0]; }
+	if( typeof( e.pageX ) == 'number' ) { var xcoord = e.pageX; var ycoord = e.pageY; } else {
+		var xcoord = e.clientX; var ycoord = e.clientY;
+		if( !( ( window.navigator.userAgent.indexOf( 'Opera' ) + 1 ) || ( window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1 ) || window.navigator.vendor == 'KDE' ) ) {
+			if( document.documentElement && ( document.documentElement.scrollTop || document.documentElement.scrollLeft ) ) {
+				xcoord += document.documentElement.scrollLeft; ycoord += document.documentElement.scrollTop;
+			} else if( document.body && ( document.body.scrollTop || document.body.scrollLeft ) ) {
+				xcoord += document.body.scrollLeft; ycoord += document.body.scrollTop; } } }
+	return [xcoord,ycoord];
+}
+
+function slideIsDown(e) {
+	//make note of starting positions and detect mouse movements
+	window.msStartCoord = sliderMousePos(e); window.lyStartCoord = this.style?[parseInt(this.style.left),parseInt(this.style.top)]:[parseInt(this.left),parseInt(this.top)];
+	if( document.captureEvents && Event.MOUSEMOVE ) { document.captureEvents(Event.MOUSEMOVE); document.captureEvents(Event.MOUSEUP); }
+	window.storeMOUSEMOVE = document.onmousemove; window.storeMOUSEUP = document.onmouseup; window.storeLayer = this;
+	mouseIsPressed = true;
+    document.onmousemove = slideIsMove; document.onmouseup = slideIsMove; return false;
+}
+
+function slideIsMove(e) {
+    if (mouseIsPressed) {
+        //move the slider to its newest position
+        var msMvCo = sliderMousePos(e); if( !e ) { e = window.event ? window.event : ( new Object() ); }
+        var theLayer = window.storeLayer.style ? window.storeLayer.style : window.storeLayer; var oPix = document.childNodes ? 'px' : 0;
+        if( window.storeLayer.hor ) {
+            var theNewPos = window.lyStartCoord[0] + ( msMvCo[0] - window.msStartCoord[0] );
+            if( theNewPos < 0 ) { theNewPos = 0; } if( theNewPos > window.storeLayer.maxLength ) { theNewPos = window.storeLayer.maxLength; }
+            theLayer.left = theNewPos + oPix;
+        } else {
+            var theNewPos = window.lyStartCoord[1] + ( msMvCo[1] - window.msStartCoord[1] );
+            if( theNewPos < 0 ) { theNewPos = 0; } if( theNewPos > window.storeLayer.maxLength ) { theNewPos = window.storeLayer.maxLength; }
+            theLayer.top = theNewPos + oPix;
+        }
+        //run the user's functions and reset the mouse monitoring as before
+        if( e.type && e.type.toLowerCase() == 'mousemove' ) {
+            if( window.storeLayer.moveFunc ) { window.storeLayer.moveFunc(theNewPos/window.storeLayer.maxLength); }
+        } else {
+            document.onmousemove = storeMOUSEMOVE; document.onmouseup = window.storeMOUSEUP;
+            if( window.storeLayer.stopFunc ) { window.storeLayer.stopFunc(theNewPos/window.storeLayer.maxLength); }
+        }
+    } 
+}
+
+function setSliderPosition(oPortion) {
+	//set the slider's position
+	if( isNaN( oPortion ) || oPortion < 0 ) { oPortion = 0; } if( oPortion > 1 ) { oPortion = 1; }
+	var theDiv = document.getElementById(this.id); if( theDiv.style ) { theDiv = theDiv.style; }
+	oPortion = Math.round( oPortion * this.maxLength ); var oPix = document.childNodes ? 'px' : 0;
+	if( this.align ) { theDiv.left = oPortion + oPix; } else { theDiv.top = oPortion + oPix; }
+}
+
+function slider(sliderElemId,oThght,oTwdth,oTcol,oTBthk,oTBcol,oTRthk,oTRcol,oBhght,oBwdth,oBcol,oBthk,oBtxt,oAlgn,oMf,oSf,oCrs) {
+    //--- Modifications by Armin Burger ---//
+    //draw the slider using huge amounts of nested layers (makes the borders look normal in as many browsers as possible)
+    var sliderStr = (
+        '<div style="position:relative;left:0px;top:0px;height:'+(oThght+(2*oTBthk))+'px;width:'+(oTwdth+(2*oTBthk))+'px;background-color:'+oTBcol+';font-size:0px;">'+
+        '<div style="position:relative;left:'+oTBthk+'px;top:'+oTBthk+'px;height:'+oThght+'px;width:'+oTwdth+'px;background-color:'+oTcol+';font-size:0px;">'+
+        '<div style="position:absolute;left:'+(oAlgn?0:Math.floor((oTwdth-oTRthk)/2))+'px;top:'+(oAlgn?Math.floor((oThght-oTRthk)/2):0)+'px;height:'+(oAlgn?oTRthk:oThght)+'px;width:'+(oAlgn?oTwdth:oTRthk)+'px;background-color:'+oTRcol+';font-size:0px;"><\/div>'+
+        '<div style="position:absolute;left:'+(oAlgn?0:Math.floor((oTwdth-(oBwdth+(2*oBthk)))/2))+'px;top:'+(oAlgn?Math.floor((oThght-(oBhght+(2*oBthk)))/2):0)+'px;height:'+(oBhght+(2*oBthk))+'px;width:'+(oBwdth+(2*oBthk))+'px;font-size:0px;" ondragstart="return false;" onselectstart="return false;" onmouseover="this.hor='+oAlgn+';this.maxLength='+((oAlgn?oTwdth:oThght)-((oAlgn?oBwdth:oBhght)+(2*oBthk)))+';this.moveFunc='+oMf+';this.stopFunc='+oSf+';this.onmousedown=slideIsDown;" id="MWJ_slider_controls'+MWJ_slider_controls+'">'+
+        '<div style="border-top:'+oBthk+'px solid #ffffff;border-left:'+oBthk+'px solid #ffffff;border-right:'+oBthk+'px solid #000000;border-bottom:'+oBthk+'px solid #000000;">'+
+        '<div style="height:'+oBhght+'px;width:'+oBwdth+'px;font-size:0px;background-color:'+oBcol+';cursor:'+(oCrs?'pointer;cursor:e-resize':'default')+';">'+
+        '<span style="width:100%;text-align:center;">'+oBtxt+'<\/span><\/div><\/div><\/div><\/div><\/div>'
+    );
+    
+    document.getElementById(sliderElemId).innerHTML = sliderStr;
+    
+    this.id = 'MWJ_slider_controls'+MWJ_slider_controls; this.maxLength = (oAlgn?oTwdth:oThght)-((oAlgn?oBwdth:oBhght)+(2*oBthk));
+	this.align = oAlgn; this.setPosition = setSliderPosition; MWJ_slider_controls++;
+}
+

Added: map.phtml
===================================================================
--- map.phtml	2006-10-05 22:45:01 UTC (rev 0)
+++ map.phtml	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,245 @@
+<?php
+/*********************************************************************************
+ Copyright (c) 2003-2006 Armin Burger
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the Software
+ is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+/*
+header("Cache-Control: no-cache, must-revalidate, private, pre-check=0, post-check=0, max-age=0");
+header("Expires: " . gmdate('D, d M Y H:i:s', time()) . " GMT");
+header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
+header("Pragma: no-cache");
+*/
+
+session_start();
+
+// INCLUDE PHP FILES
+require_once("config/startup_config.php");
+require_once("$PM_INCPHP/group.php");
+require_once("$PM_INCPHP/globals.php");
+require_once("$PM_INCPHP/common.php");
+require_once("$PM_INCPHP/custom.php");
+require_once("$PM_INCPHP/util.php");
+require_once("$PM_INCPHP/init/initmap.php");
+require_once("$PM_INCPHP/legend.php");
+include_once("$PM_INCPHP/init/init.php");
+include_once("config/$PM_PHP_CONFIG");
+
+
+header("Content-type: text/html; charset=$defCharset");
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo $gLanguage ?>" xml:lang="<?php echo $gLanguage ?>">
+
+<head>
+ <meta name="description" content="p.mapper - MapServer PHP/MapScript Demo Suite" />
+ <meta name="author" content="Armin Burger" />
+ <meta name="keywords" content="p.mapper, pmapper, MapServer, PHP, MapScript" />
+
+ <title><?php echo $pmTitle ?></title>
+
+ <script type="text/javascript" src="<?php echo $PM_JAVASCRIPT ?>/common.js"></script>
+ <script type="text/javascript" src="<?php echo $PM_JAVASCRIPT ?>/pmapper.js"></script>
+ <script type="text/javascript" src="<?php echo $PM_JAVASCRIPT ?>/zoombox.js"></script>
+ <script type="text/javascript" src="<?php echo $PM_JAVASCRIPT ?>/mapserver.js"></script>
+ <script type="text/javascript" src="<?php echo $PM_JAVASCRIPT ?>/wz_jsgraphics.js"></script>
+ <script type="text/javascript" src="<?php echo $PM_JAVASCRIPT ?>/geometry.js"></script>
+ <script type="text/javascript" src="<?php echo $PM_JAVASCRIPT ?>/pmdraw.js"></script>
+ <script type="text/javascript" src="<?php echo $PM_JAVASCRIPT ?>/toc.js"></script>
+ <script type="text/javascript" src="<?php echo $PM_JAVASCRIPT ?>/zslider.js"></script>
+ <script type="text/javascript" src="<?php echo $PM_JAVASCRIPT ?>/xmlhttp.js"></script>
+ <script type="text/javascript" src="<?php echo $PM_JAVASCRIPT ?>/custom.js"></script>
+ <script type="text/javascript" src="<?php echo $PM_JAVASCRIPT ?>/pmjson.js"></script>
+ <script type="text/javascript" src="<?php echo $PM_JAVASCRIPT ?>/dragresize.js"></script>
+ <script type="text/javascript" src="<?php echo $PM_INCPHP_LOCATION ?>/js_custom.php?<?php echo SID ?>"></script>
+ <script type="text/javascript" src="config/<?php echo "$PM_JS_CONFIG?" . SID ?>"></script>
+ 
+ <script type="text/javascript">
+	
+    var PM_XAJAX_LOCATION = '<?php echo $PM_XAJAX_LOCATION ?>';
+    
+    var gLanguage = '<?php echo $gLanguage ?>';
+    var config = '<?php echo trim($config) ?>';
+    var tocStyle = '<?php echo $_SESSION["tocStyle"] ?>';
+    var mapW = <?php echo $mapW ?>;
+    var mapH = <?php echo $mapH ?>;
+    var refW = <?php echo $refW ?>;
+    var refH = <?php echo $refH ?>;
+    var SID = '<?php echo SID ?>';
+    var infoWin = '<?php echo $infoWin ?>';
+
+    var minx_geo, maxy_geo;
+    var xdelta_geo, ydelta_geo;
+    var dgeo_x = <?php echo $dgeo['x'] ?>;
+    var dgeo_y = <?php echo $dgeo['y'] ?>;
+    var dgeo_c = <?php echo $dgeo['c'] ?>;
+    var s1 = <?php echo $maxScale ?>;
+    var s2 = <?php echo $minScale ?>;
+
+    var enableRightMousePan = <?php echo $enableRightMousePan ?>;
+
+    var layerAutoRefresh = <?php echo ($_SESSION['layerAutoRefresh']) ?>;
+
+	<?php echo $jsArrays ?>
+	
+ 
+ </script>
+ 
+ <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
+ <link rel="stylesheet" href="templates/default.css" type="text/css" />
+ <link rel="stylesheet" href="templates/layout.css" type="text/css" />
+ <link rel="StyleSheet" href="templates/dtree.css" type="text/css" />
+ <link rel="StyleSheet" href="templates/toc.css" type="text/css" />
+</head>
+
+<body class="BGCLG" onload="init();">
+
+<!-- TOP AND BOTTOM OF WINDOW -->
+<div id="top" class="FRAME1">
+    <table width="100%">
+     <tr>
+      <td style="width:120px; white-space: nowrap;">
+      <a href="http://pmapper.sourceforge.net" id="home_href" title="p.mapper homepage" onclick="this.target = '_blank';"><img src="images/logo.gif" alt="logo" /></a>      
+      </td>
+      <td class="HEADING1"> <?php echo $pmHeading ?>  </td>
+      <td ><a href="" id="current_maplink"><?php echo _p("Link to current map") ?></a></td>
+     </tr>
+    </table>
+</div>
+
+<div id="bottom" class="FRAME1">
+    <form id="searchForm" action="blank.html" onsubmit="submitSearch()">
+      <div style="float:left; margin:8px 10px 1px 3px ;">
+        <div id="bottom1" style="position:absolute; left:20px; top:7px"></div>
+        <div id="bottom2" style="position:absolute; left:140px; top:8px; width:400px"></div>
+      </div>
+      <div style="float:right; margin:4px 10px 1px 3px ;">
+        <a href="http://validator.w3.org/check?uri=referer"><img
+            src="images/valid-xhtml10.png"
+            alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
+      </div>
+      <div style="float:right; margin:4px 10px 1px 3px ;"><a href="http://mapserver.gis.umn.edu" id="mapserver_href_2" onclick="this.target = '_blank';"><img src="images/powered_mapserver.png" title="UMN MapServer homepage" alt="logo map server" /></a></div>
+      <div style="float:right; margin:8px 10px 1px 3px ;"><?php echo _p("Geo-data source") ?>: DCW; <a href="http://www.geotorrent.org" id="geotorrent_href" onclick="this.target = '_new';">geoTorrent</a></div>
+    </form>
+</div>
+
+
+<!-- MAIN MAP WITH NAVIGATION BARS-->
+<div id="mapFrame" style="position:absolute; left:20px; top:45px; width:580px; height:500px">
+
+    <!-- TOP WITH SCALE AND SLIDER-->
+    <div id="topMapFrame" class="TOOLFRAME" style="height: 35px;">
+        <form id="scaleform" action="javascript:zoom2scale(document.getElementById('scaleinput').value)">
+        <div style="position:absolute; left:10px; top:5px; margin:3px 4px 4px 3px ;"><?php echo (_p("Scale")) ?>
+            <input type="text" id="scaleinput" name="scale" size="10" value="" />
+        </div>
+        </form>
+
+        <div id="sliderArea" style="position:absolute; left:250px; top:5px; margin-top:5px; white-space: nowrap;">
+            <div style="position:absolute; left:5px; ">Zoom &#177; &nbsp;<img src="images/buttons/zoomminus.gif" alt="zoom out" /></div>
+            <div id="zslider" style="position:absolute; left:70px;"></div>
+            <div style="position:absolute; left:240px; "><img src="images/buttons/zoomplus.gif" alt="zoom in" /></div>
+        </div>
+    </div>
+
+    <!-- MAIN MAP -->
+    <div id="map" style="left:0px; top:35px">
+        <div id="scalebarimg" style="position:absolute; left:5px; top:0px; z-index:90"></div>
+        <div id="showcoords" class="showcoords"><div id="xcoord"></div><div id="ycoord"></div></div>
+        <div id="iqueryLayer" style="position:absolute; right:10px; top:2px;"></div>
+        <div id="mapimgLayer" style="position:absolute; left:0px; top:0px; <?php echo ("width:" . $mapW . "px; height:" . $mapH . "px") ?>; z-index:0; overflow: hidden">
+                <img id="mapImg"   src="images/pixel.gif"  style="overflow:hidden; <?php echo ("width:" . $mapW ."px; height:" . $mapH ."px") ?>" alt="map image" />
+        </div>
+        <div id="measureLayer" class="measureLayer"></div>
+        <div id="zoombox" class="zoombox"></div>
+        <div id="loading" style="position: absolute; z-index: 96;
+             <?php echo ("left:" . ($mapW/2 - 60) . "px; top:" . ($mapH/2 -20) ."px;\"") ?> >
+             <img id="pixel" src="images/loading.gif" width="118" height="32" alt="loading" />
+        </div>
+        
+    </div>
+
+    <!-- TOOL BAR -->
+    <div id="toolBar" class="TOOLFRAME"   style="width:40px; height:500px">
+        <?php  writebuttons($buttons, $toolBarOrientation); ?>
+    </div>
+
+    <div id="bottomMapFrame" class="TOOLFRAME" style="height: 35px;"></div>
+</div>
+
+
+<!-- LEGEND/TOC -->
+<form id="layerform" method="get" action="">
+<div id="toc" class="TOC" style="position:absolute; left:610px; top:45px; width:220px; height:350px; overflow: auto; z-index:0;">
+    <table width="100%" border="0" cellspacing="0" cellpadding="2">
+      <?php
+        if ($_SESSION['layerAutoRefresh'] == 0) {
+            echo ("<tr><td class=\"TOOLFRAME\"><input class=\"button_off\" type=\"button\"
+                    onClick=\"changeLayersDraw()\"
+                    onmouseover=\"changeButtonClr(this, 'over')\"
+                    onmouseout=\"changeButtonClr (this, 'out')\"
+                    size=\"10\" value=\"" . _p("Refresh Map") . "\" /></td></td></tr>");
+        }
+      ?>
+     <tr>
+      <td>
+       <div></div>
+      </td>
+     </tr>
+    </table>
+</div>
+</form>
+
+
+<!-- REFERENCE MAP -->
+<div id="refmap" class="refmap" style="position:absolute; left:615px; top:400px;
+     <?php echo (" width:{$refW}px; height:{$refH}px") ?>; z-index:10"  >
+    <img id="refMapImg" <?php echo (" src=\"images/$refImg\" width=\"$refW\"  height=\"$refH\"")?> onmouseover="startUpRef()"  alt="reference" />
+    <div id="refsliderbox" class="sliderbox"></div>
+    <div id="refbox" class="refbox"></div>
+    <div id="refzoombox" class="zoombox"></div>
+    <div id="refcross" class="refcross"><img id="refcrossimg" src="images/refcross.gif"  alt="reference cross image" /> </div>
+</div>
+<div id="refmapBG" class="TOOLFRAME" style="position:absolute; left:610px; top:400px; z-index:2; width:220px; <?php echo (" height:{$refH}px") ?>"></div>
+
+
+<!-- IFRAME FOR IDENTIFY -->
+<?php if($infoWin == "frame"): ?>
+  <div id="infoFrame" name="infoFrame" style="visibility:visible; border:1px; position:absolute; left:20px; top:554px; width:810px; height:100px; z-index:10"></div>
+<?php endif; ?>
+
+
+<!-- FORM FOR STORING STATUS VARIABLES -->
+<form id="varform" action="">
+ <div>
+ <input type="hidden" name="mode" value="map" />
+ <input type="hidden" name="zoom_type" value="zoomrect" />
+ <input type="hidden" name="zoom_factor" value="1" />
+ <input type="hidden" name="maction" value="box" />
+ <input type="hidden" name="zoomselected" value="0" />
+ <input type="hidden" name="tool" value="zoomin" />
+ </div>
+</form>
+
+<script type="text/javascript">
+    // Create drawing object for measure function
+    jg = new jsGraphics('measureLayer');
+</script>
+</body>
+</html>

Added: printdlg.phtml
===================================================================
--- printdlg.phtml	2006-10-05 22:45:01 UTC (rev 0)
+++ printdlg.phtml	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,43 @@
+<?php
+session_start();
+require_once($_SESSION['PM_INCPHP'] . "/common.php");
+require_once($_SESSION['PM_INCPHP'] . "/globals.php");
+
+$geo_scale0 = round($_SESSION["geo_scale"]);
+$geo_scale = round($geo_scale0, -1 * (strlen($geo_scale0) - 2));
+
+header("Content-type: text/html; charset=$defCharset");
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo $gLanguage ?>" xml:lang="<?php echo $gLanguage ?>">
+
+<head>
+<script type="text/javascript">
+    function initPage() {
+        document.getElementById('choosescale').target = 'blank';
+        window.focus();
+    }
+</script>
+
+<link rel="stylesheet" href="templates/print.css" type="text/css" />
+
+<title><?php echo (_p("Print Map"))?></title>
+</head>
+<body class="PRDLG" onload="initPage()">
+<form action="printmap.phtml" id="choosescale" method="get" >
+
+ <table border="0" cellspacing="3" cellpadding="2">
+  <tr><td><b><?php echo (_p("Print Settings"))?></b></td></tr>
+  <tr><td><?php echo (_p("Set Scale"))?> &nbsp;&nbsp;1: <input type="text" name="prscale" value="<?php echo $geo_scale ?>" /></td></tr>
+  <tr><td><input type=checkbox name="prefmap" value="on" checked><?php echo (_p("With Overview Map"))?></td></tr>
+  <tr><td><input type="checkbox" name="docformat" value="pdf" /><?php echo (_p("Create PDF Document"))?></td></tr>
+  <tr><td><hr></td></tr>
+  <tr><td><input type="button"  value="<?php echo (_p("Create Print Page")) ?>"  onclick="submit();setTimeout('self.close()', 1000)" /></td></tr>
+  <tr><td> 
+    <?php echo ("<input type=\"hidden\" name=\"" . ini_get("session.name") . "\" value=\"" . session_id() . "\" />") ?>
+  </td></tr>  
+</table>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: printmap.phtml
===================================================================
--- printmap.phtml	2006-10-05 22:45:01 UTC (rev 0)
+++ printmap.phtml	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,87 @@
+<?php
+require_once("config/startup_config.php");
+require_once("$PM_INCPHP/group.php");
+session_start();
+session_cache_limiter('private');
+require_once("$PM_INCPHP/globals.php");
+require_once("$PM_INCPHP/common.php");
+require_once("$PM_INCPHP/map.php");
+require_once("$PM_INCPHP/print/print.php");
+require_once("$PM_INCPHP/print/pdfprint.php");
+
+
+$prScale = $_GET["prscale"];
+if (isset($_GET["prTitle"])) {
+    $prTitle = $_GET["prTitle"];
+} else {
+    $prTitle = _p("Print Title");
+}
+
+if (isset($_GET["prefmap"])) {
+    $prefmap = true;
+} else {
+    $prefmap = false;
+}
+
+
+//
+// Create PRINT PAGE: PDF or HTML
+//
+
+// =====> PDF <=====
+if (isset($_GET["docformat"])):
+    //define('FPDF_FONTPATH','./incphp/fonts/');
+    
+    $pdf = new PDF($map, $prScale, 'P', 'pt', 'A4', $prefmap);
+    //Header('Pragma: public');
+    //header('Content-type: application/pdf');
+    $pdf->Output();
+    exit();
+
+// =====> HTML <=====
+else :
+    $printMap = new PrintMap($map, 630, 540, $prScale, "html", 250, 0, $prefmap);
+    $printUrlList = $printMap->returnImgUrlList(); 
+    $legendString = $printMap->returnLegStr();
+    
+    header("Content-Type: text/html; charset=$defCharset");
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo $gLanguage ?>" xml:lang="<?php echo $gLanguage ?>">
+
+<head>
+<link rel="stylesheet" href="templates/print.css" type="text/css" />
+<title><?php echo (_p("Print View")) ?></title>
+</head>
+<body>
+
+<table border="2" cellpadding="0" cellspacing="0">
+ <tr>
+  <td>
+   <table border="0" cellpadding="2" cellspacing="1" width="100%" class="PRTITLE" >
+    <tr>
+     <td><img src="images/logo.png" alt="logo" /></td>
+     <td class="PRTITLE"><?php echo ($prTitle) ?></td>
+    </tr>
+   </table>
+  </td>
+ </tr>      
+ <tr><td><img src="<?php echo $printUrlList[0] ?>" alt="map" /></td></tr>
+ <tr><td align="left" valign="middle"><?php echo ("&nbsp;&nbsp;" . _p("Scale") . " 1: $prScale") ?></td></tr>
+ <tr>
+   <td>
+    <table>
+     <?php
+       echo $legendString;
+     ?>
+    </table>
+  </td>
+ </tr>
+</table>
+
+</body>
+</html>
+
+<?php endif; ?>

Added: templates/default.css
===================================================================
--- templates/default.css	2006-10-05 22:45:01 UTC (rev 0)
+++ templates/default.css	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,224 @@
+/****************************************
+  MAIN STYLES
+*****************************************/
+
+/* 
+ * DEFAULTS FOR BODY AND TABLES 
+ */
+BODY {
+    font-size : 11px;
+    font-family: Arial, Helvetica, sans-serif;
+    color: #000000;
+    background : #003366;
+    cursor: default;
+    overflow: hidden;
+}
+     
+TH {
+    font-size: 11px;
+    font-family: Arial, Helvetica, sans-serif;
+    text-align: left;
+    color: #000000;
+}
+
+TD {
+    font-size: 11px;
+    font-family: Arial, Helvetica, sans-serif;
+    text-align: left;
+    color: #000000;
+}
+
+A {
+    color: #FFFFFF;
+    text-decoration: none;
+}
+
+A:hover {
+    text-decoration: underline;
+    /*background-color: B1BBC5;*/
+}
+
+IMG {
+	border-width: 0px;
+}
+
+
+/* 
+ * TOOL BUTTONS IN TOOLBAR.PHTML 
+ * Used for mouseDown/Up and mouseOver/Out actions 
+ */
+.TOOLBAR {
+    color: #000000;    
+}
+
+.TOOLBARTD{
+    padding: 2px;
+    text-align:center;
+    vertical-align:middle;
+    width: 28px;
+    height: 28px;
+    /*border:   1px solid #B1BBC5;*/
+}
+
+.TOOLBARTD_ON{
+    padding: 2px 1px 0px 1px;
+    width: 28px;
+    height: 28px;
+    overflow: hide;
+    text-align:center;
+    vertical-align:middle;
+    background-color: #CCCCCC; /*#336699;*/  
+    border-top:    1px solid #666666;
+    border-bottom: 1px solid #F0F0F0;
+    border-right:  1px solid #F0F0F0;
+    border-left:   1px solid #666666;  
+}                
+
+.TOOLBARTD_OVER{
+    padding: 2px 1px 0px 1px;
+    width: 28px;
+    height: 28px;
+    overflow: hide;
+    text-align:center;
+    vertical-align:middle;
+    border-top:    1px solid #F0F0F0;
+    border-bottom: 1px solid #666666;
+    border-right:  1px solid #666666;
+    border-left:   1px solid #F0F0F0;
+}
+
+
+
+.TOOLBAR IMG {
+	border: 0px;
+}
+
+#tsep {
+    /*padding-left: 6px;*/
+    text-align: center;
+} 
+
+
+.TOPBOTTOM {
+    background-color: #999999;
+}
+
+/* 
+ * TOOL FRAME AROUND MAP AND TOC
+ */
+.TOOLFRAME, .TOC {
+    background-color: #B1BBC5;  /*#B1BBC5;#C0C0C0;*/
+    color: #000000; 
+}
+
+
+.TOOLFRAME TD {
+    font-size: 12px;
+    color: #000000;    
+    vertical-align:middle;
+}
+
+.TOOLFRAME vc{
+    vertical-align:baseline;
+}
+
+/* FRAME FOR HEADER AND FOOTER */
+.FRAME1 {
+    color: #FFFFFF;
+    font-size: 11px;
+    background-color: #336699;
+    border-top:    1px solid #E0E0E0;
+    border-bottom: 1px solid #E0E0E0;
+}
+
+
+/* HEADING, e.g. in top frame*/
+.HEADING1 {
+    color: #FFFFFF;
+    text-align:left;
+    font-size:16px;
+    font-weight:bold;
+}
+
+
+
+/* 
+ * FORM ELEMENTS 
+ */
+INPUT {	
+    font-size : 12px;
+}
+
+SELECT {
+	background-color : #EBEBEB;
+	border-color :  #003366;
+	border-width : 0px; 
+	width : 100px;
+	font-size : 11px;
+	padding-left: 5px;
+}
+
+
+.TOOLFRAME input, .FRAME1 input {
+	background-color : #EBEBEB;
+	border-color : #003366;
+	border-style : solid;
+	border-width : 1px;
+	font-size : 12px;
+}
+
+/* Input Button colors on/off */
+.TOOLFRAME input.button_on, .FRAME1 input.button_on {
+    background-color : #003366;
+    color: #FFFFFF;
+    border-color: #FFFFFF;
+}
+
+.TOOLFRAME input.button_off, .FRAME1 input.button_off {
+    background-color : #EBEBEB;
+}
+
+.selectbox {
+	padding-top: 3px;
+}
+
+
+/* ADDITIONAL TABLE TD */
+.TDAL{text-align:left;}
+.TDAR{text-align:right;}
+.TDAC{text-align:center;}
+
+
+/* IQuery */
+
+.iquery {
+	background:#D1D1D1;
+	layer-background-color:#D1D1D1;
+	filter: alpha(opacity=80); 
+	-moz-opacity:0.8;
+	border-width:1px; 
+	border-color:#AEAEAE; 
+	border-style:inset;
+	padding: 4px;
+	
+}
+
+.iquery TH.header {
+	color: #000080;
+	border-bottom: 2px groove #666666;
+	padding-left: 1px;
+
+}
+
+.iquery TD {
+	padding-left: 2px;
+	vertical-align:top;
+	/*border-top:  1px solid #000000;*/
+
+}
+
+.iquery TH {
+	padding-left: 4px;
+	vertical-align:top;
+	
+}

Added: templates/dom.css
===================================================================
--- templates/dom.css	2006-10-05 22:45:01 UTC (rev 0)
+++ templates/dom.css	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,74 @@
+
+/* Apply the element you want to drag/resize */
+.drsElement {
+    position: absolute;
+    /*border: 1px solid #333;*/
+    background-color: #eeeeee;
+    border: 2px outset #999999;
+}
+
+/*
+ The main mouse handle that moves the whole element.
+ You can apply to the same tag as drsElement if you want.
+*/
+.drsMoveHandle {
+    height: 18px;
+    background-color: #8AADD8; /* #5978AE #9FC3EA;*/
+    border-bottom: 1px solid #666;
+    cursor: move;
+}
+
+/*
+ The DragResize object name is automatically applied to all generated
+ corner resize handles, as well as one of the individual classes below.
+*/
+.dragresize {
+    position: absolute;
+    width: 14px;
+    height: 14px;
+    font-size: 1px;
+    background: #EEE;
+    border: 1px solid #333;
+}
+
+/*
+ Individual corner classes - required for resize support.
+ These are based on the object name plus the handle ID.
+*/
+.dragresize-br {
+    bottom: -1px;
+    right: -1px;
+    background-image:url(corner_br.gif);
+    cursor: se-resize;
+    visibility: visible;
+}
+
+.drsClosebutton {
+    position: absolute;
+    right: 2px;
+    top: 2px;
+    width: 14px;
+    height: 14px;
+    background-image:url(close4.gif);
+    cursor: default;
+    border: none;
+	font: 13px/20px sans-serif;
+}
+
+.dragresize-tm {
+    top: -6px;
+    left: 3%;
+    height: 6px;
+    width: 93%;
+    margin-left: -4px;
+    background: none;
+    border: none;
+    cursor: n-resize;
+}
+
+.dragresize-tl { top: -8px; left: -8px; cursor: nw-resize; }
+.dragresize-tr { top: -8px; right: -8px; cursor: ne-resize; }
+.dragresize-ml { top: 50%; margin-top: -4px; left: -8px; cursor: w-resize; }
+.dragresize-mr { top: 50%; margin-top: -4px; right: -8px; cursor: e-resize; }
+.dragresize-bl { bottom: -8px; left: -8px; cursor: sw-resize; }
+.dragresize-bm { bottom: -8px; left: 50%; margin-left: -4px; cursor: s-resize; }

Added: templates/dtree.css
===================================================================
--- templates/dtree.css	2006-10-05 22:45:01 UTC (rev 0)
+++ templates/dtree.css	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,67 @@
+/*--------------------------------------------------|
+| dTree 2.05 | www.destroydrop.com/javascript/tree/ |
+|---------------------------------------------------|
+| Copyright (c) 2002-2003 Geir Landrö               |
+|--------------------------------------------------*/
+
+/* --- Modifications for p.mapper by Armin Burger ---*/
+
+.dtree {
+	font-family: Arial, Helvetica, sans-serif;
+	font-size: 11px;
+	color: #000000;
+	white-space: nowrap;
+    vertical-align: middle;
+    padding-left: 2px;
+}
+
+.dtree img {
+	border: 0px;
+	vertical-align: middle;
+}
+
+.dtree a {
+	color: #000000;
+	text-decoration: none;
+}
+
+.dtree a.node, .dtree a.nodeSel {
+	white-space: nowrap;
+}
+
+.dtree a.node:hover, .dtree a.nodeSel:hover {
+	color: #000000;
+	text-decoration: underline;
+}
+
+.dtree a.nodeSel {
+	background-color: #c0d2ec;
+}
+
+.dtree .clip {
+    overflow: visible;
+}
+
+.dtree input {
+	border: 0px;
+	vertical-align: middle;
+}
+
+
+.maingrp {
+    font-weight: bold;
+    padding: 1px 3px 1px 1px;
+}
+
+
+/* Color for visible layers */
+.vis {
+    color: #000000;
+    padding: 1px 1px 1px 4px;
+}
+
+/* Color for unvisible layers */
+.unvis {
+    color: #999999;
+    padding: 1px 1px 1px 4px;
+}
\ No newline at end of file

Added: templates/layout.css
===================================================================
--- templates/layout.css	2006-10-05 22:45:01 UTC (rev 0)
+++ templates/layout.css	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,225 @@
+
+.mapTab {
+    background-color: #eeeeee;
+}
+
+
+#map {
+    position: absolute;
+    left : 0;
+    top : 0;
+    /*background-color: #000000;*/
+}
+
+
+#mapFrame {
+    background-color: #666666;
+} 
+
+
+
+#toolBar {
+    position: absolute;
+    right : 0px;
+    top : 0px;
+    z-index : 5;
+	overflow: hidden;
+}
+
+#bottomMapFrame {
+    position: absolute;
+    left : 0px;
+    /*bottom : 0px;*/
+    top: 470px;
+    width: 100%;
+    overflow: hidden;
+    z-index : 3;
+	text-align: right;
+}
+
+
+
+
+#topMapFrame {
+    position: absolute;
+    left : 0px;
+    top : 0px;
+    width: 100%;
+    height: 40px;
+    z-index : 3;
+}
+
+
+#top {
+    position: absolute;
+    left : 0;
+    top : 0;
+    width: 100%;
+    z-index:15;
+}
+
+#bottom {
+    position: absolute;
+    left : 0;
+    /*top : 550px;*/
+    bottom: 0px;
+    width: 100%;
+    z-index:15;
+}
+
+
+
+.zoombox {
+    position: relative;
+    visibility: visible;
+    width: 1px;
+    height: 1px;
+    border-color : #FF0000;
+    border-width : 1px;
+	border-style : solid;
+    z-index:95;
+    background:#eeeeee;
+    layer-background-color:#eeeeee;
+    filter: alpha(opacity=40); 
+    -moz-opacity:0.4;
+}
+
+/* STYLE FOR ZOOMBOX FOR OPERA AND KONQUEROR */
+.zoombox_nontransp {
+    position: absolute;
+    visibility: hidden;
+    overflow: hidden;
+    left : 0;
+    top : 0;
+    border-color: #FF0000;
+    border-width: 1px;
+    border-style: solid;
+} 
+
+
+/* STYLE FOR MEASURE ELEMENTS */
+#measureLayer {
+    position:relative; 
+    top: 0px;
+    left : 0px;
+    visibility: visible;
+    z-index:94;
+
+}
+
+
+/* STYLE FOR REFERENCE MAP */
+.refmap {
+    /*background-color: #000000;*/
+}
+
+/* STYLE FOR REFERENCE MAP BOX */
+.refbox {
+    visibility: visible;
+    overflow: hidden;
+    position: absolute;
+    border-color : #FF0000;
+    border-width : 2px;
+    border-style : solid;
+}
+
+
+/* STYLE FOR REFERENCE MAP CROSS */
+#refcross, .refcrossimg  {
+    visibility: hidden;
+    position: absolute;
+    z-index:90;
+}
+
+
+/* STYLE FOR REFERENCE MAP BOX */
+.sliderbox {
+    visibility: hidden;
+    overflow: hidden;
+    position: absolute;
+    border-color : #FF0000;
+    border-width : 1px;
+    border-style : solid;
+    background:#eeeeee;
+    layer-background-color:#eeeeee;
+    filter: alpha(opacity=60); 
+    -moz-opacity:0.6;
+}
+
+.ref {
+    position: absolute;
+}
+
+
+
+
+#mImg {
+    background-color : #FF0000;
+}
+
+
+/* Coordinates Display */
+#showcoords {
+    visibility: visible;
+    position: absolute;
+    left : 4px;
+    top : 4px;
+    width: 160px;
+    height: 18px;
+    z-index : 96;
+    color: #000000;
+    background:#D1D1D1;
+    layer-background-color:#D1D1D1;
+    filter: alpha(opacity=80); 
+    -moz-opacity:0.8;
+    border-width:1px; 
+    border-color:#AEAEAE; 
+    border-style:inset; 
+}
+
+#xcoord {
+    position: absolute;
+    left : 10px;
+    top : 2px;
+}
+
+#ycoord {
+    position: absolute;
+    left : 80px;
+    top : 2px;
+}
+
+
+#iqueryLayer {
+	visibility: hidden;
+    position: absolute;
+	overflow: hidden;
+    width: 180px;
+    height: 250px;
+    z-index : 96;
+}
+
+
+#infoFrame {
+	visibility: hidden;
+    position: absolute;
+	overflow: auto;
+    width: 180px;
+    height: 250px;
+    z-index : 96;
+    
+	color: #000000;
+    background:#eeeeee;
+    layer-background-color:#eeeeee;
+    filter: alpha(opacity=80); 
+    -moz-opacity:0.8;
+    border-width:1px; 
+    border-color:#AEAEAE; 
+    border-style:inset; 
+	padding: 4px;
+	
+}
+
+#selform TABLE{
+	height: 20px;
+}

Added: templates/print.css
===================================================================
--- templates/print.css	2006-10-05 22:45:01 UTC (rev 0)
+++ templates/print.css	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,48 @@
+/* STYLE FOR PRINT OUTPUT */
+
+/* General settings for HTML print, especially legend */
+
+BODY {
+    font-family: Arial, Helvetica, sans-serif;
+    font-size: 12px;
+    background : white;
+    color: black;
+}
+
+
+TH {
+    font-size: 11px;
+    font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+    font-weight: bold;
+    text-align: left;
+    
+}
+
+TD {
+    font-size: 10px;
+    text-align: left;
+}
+
+
+
+/* Print Title */
+.PRTITLE {
+    background-color: #336699;
+    color: #FFFFFF;
+    font-size: 14px;
+    font-weight: bold;
+}
+
+
+/* Print Dialog Window */
+.PRDLG {background-color: #B1BBC5;}
+
+.PRDLG TABLE {
+    width: 100%;
+}
+
+.PRDLG TD {
+    font-size: 12px;
+    text-align: left;
+}
+

Added: templates/query.css
===================================================================
--- templates/query.css	2006-10-05 22:45:01 UTC (rev 0)
+++ templates/query.css	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,120 @@
+/* STYLE FOR QUERY OUTPUT (SEARCH, IDENTIFY, SELECT) */
+
+BODY {
+    font-family: Verdana, Arial, Helvetica, sans-serif;
+    color: #D4D0C8;
+    overflow: auto;
+}
+
+TABLE {
+    width: 100%;
+    color: #D4D0C8;
+    border-left:  1px solid #D4D0C8;
+    border-bottom:  1px solid #D4D0C8;
+    /*border-top:  1px solid #D4D0C8;*/
+}
+
+/*
+TH {
+    font-size: 11px;
+    font-weight: bold;
+    text-align: center;
+    background-color: #D2D2D2;
+    padding: 3px;
+}
+*/
+
+TD {
+    font-size: 10px;
+    text-align: center;
+    color: #000000;
+    background-color: #FBFBFB;
+    padding: 1px 3px 1px 4px;
+    border-top:    1px solid #D4D0C8;
+    border-left:   none;
+    border-right:  1px solid #D4D0C8;
+    border-bottom: none;
+}   
+
+/* Link for zoom to feature */
+TD.zoomlink {
+    width: 25px;
+    background-color:#EBEADB;
+    border-top:  1px solid #D4D0C8;
+    border-left: 1px solid #FFFFFF;
+    border-right: 1px solid #ACA899;
+    border-bottom: none;
+}
+
+
+/* FRAME for closing query win */
+TABLE.close {
+    border: none;
+}
+
+TD.close {
+    text-align: right;
+    background-color:#EBEADB;
+    border-top:  1px solid #D4D0C8;
+    border-left: 1px solid #FFFFFF;
+    border-right: 1px solid #ACA899;
+    border-bottom: none;
+    padding: 1px;
+}
+
+/* Link for zoom to feature */
+.sortable A {
+    color: #000000;
+    text-decoration: underline;
+}
+
+img {
+    border: 0;
+    padding-top: 1px;
+}
+
+
+
+/* TITLE BAR (with close button) */
+.QUERYHEADER TD {
+    background-color: #B1BBC5; 
+    /*background-color: #336699;*/
+}
+
+/* LAYER NAME */
+.LAYERHEADER  {
+    font-size: 11px;
+    font-weight: bold;
+    text-align: left;
+    padding: 6px 3px 1px 3px;
+}
+
+
+
+/** 
+ * SORTABLE TABLES 
+ */
+ 
+ /* header line with <TH> */
+table.sortable a.sortheader {
+    font-size: 10px;
+    font-weight: bold;
+    text-align: center;
+    text-decoration: none;
+    white-space: nowrap; 
+    color:#003333;
+    display: block;
+    background-color:#EBEADB;
+    padding: 2px;
+    border-top: 0px solid #FFFFFF;
+    border-left: 1px solid #FFFFFF;
+    border-right: 1px solid #ACA899;
+    border-bottom: 2px solid #D6D2C2;
+}
+
+table.sortable span.sortarrow {
+    color: black;
+    text-decoration: none;
+}
+
+

Added: templates/query_classic.css
===================================================================
--- templates/query_classic.css	2006-10-05 22:45:01 UTC (rev 0)
+++ templates/query_classic.css	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,94 @@
+/* STYLE FOR QUERY OUTPUT (SEARCH, IDENTIFY, SELECT) */
+
+BODY {
+    font-family: Verdana, Arial, Helvetica, sans-serif;
+    color: #D4D0C8;
+}
+
+TABLE {
+    width: 100%;
+    color: #D4D0C8;
+    border-left:  1px solid #D4D0C8;
+    border-bottom:  1px solid #D4D0C8;
+}
+
+/*
+TH {
+    font-size: 11px;
+    font-weight: bold;
+    text-align: center;
+    background-color: #D2D2D2;
+    padding: 3px;
+}
+*/
+
+TD {
+    font-size: 10px;
+    text-align: center;
+    color: #000000;
+    background-color: #FBFBFB;
+    padding: 1px;
+    border-top:    1px solid #D4D0C8;
+    border-left:   none;
+    border-right:  1px solid #D4D0C8;
+    border-bottom: none;
+}   
+
+TD.zoomlink {
+    width: 35px;
+    background-color:#D4D0C8;
+    border-top:  1px solid #FFFFFF;
+    border-left: 1px solid #FFFFFF;
+    border-right: 1px solid #808080;
+    border-bottom: 1px solid #808080;
+}
+
+
+A {
+    color: #000000;
+    text-decoration: underline;
+}
+
+
+/* TITLE BAR (with close button) */
+.QUERYHEADER TD {
+    background-color: #B1BBC5; 
+    /*background-color: #336699;*/
+}
+
+/* LAYER NAME */
+.LAYERHEADER  {
+    font-size: 11px;
+    font-weight: bold;
+    text-align: left;
+    padding: 6px 3px 1px 3px;
+    /*border-top: 1px solid #E0E0E0;*/
+    /*border-left:   1px solid #E0E0E0;*/
+}
+
+
+/* SORTABLE TABLES */
+table.sortable a.sortheader {
+    font-size: 10px;
+    font-weight: bold;
+    text-align: center;
+    text-decoration: none;
+    white-space: nowrap; 
+    color:#003333;
+    display: block;
+    background-color:#D4D0C8;
+    padding: 3px;
+    border-top: 1px solid #FFFFFF;
+    border-left: 1px solid #FFFFFF;
+    border-right: 1px solid #808080;
+    border-bottom: 2px solid #808080;
+}
+
+table.sortable span.sortarrow {
+    color: black;
+    text-decoration: none;
+}
+
+img {
+    border: 0;
+}
\ No newline at end of file

Added: templates/toc.css
===================================================================
--- templates/toc.css	2006-10-05 22:45:01 UTC (rev 0)
+++ templates/toc.css	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,216 @@
+/******************************************************* 
+ * STYLE FOR TOC/LEGEND  
+ *******************************************************/
+
+
+
+.toc BODY {
+    background-color : #B1BBC5;
+}
+
+.toc TD,TH {
+    color: #000000;
+    text-align: left;
+}
+
+/*** Links: eg. open/close nodes ***/
+.toc A, .cat A {
+    color: #000000;
+    text-align: left;
+    text-decoration: none;
+}
+
+.toc A:hover, .cat A:hover {
+	text-decoration: underline;
+}
+
+.toc A:visited {
+	color: #000000;
+}
+
+
+
+
+/*** checkboxes ***/
+TD.cbx {
+    color: #000000;
+    width: 16px;
+    text-align: left;
+    padding: 0px 0px 0px 1px;
+    /*
+    background-color : #EBEBEB;
+    border-top:    1px solid #999999;
+    border-left:   1px solid #999999;
+    */
+}
+
+.cbx INPUT {
+    color: #000000;
+    width: 14px;
+    text-align: left;
+}
+
+
+/*** open/close img ***/
+TD.opcl {
+    width: 12px;
+}
+
+
+/*** Categories ***/
+TH.cat {
+    text-align: left;
+	color: #000000;
+    padding: 0px 0px 0px 3px;
+    /*
+    background-color : #D1D1D1;
+    border-top:    1px solid #999999;
+    border-left:   1px solid #999999;
+    padding: 3px;
+    margin-top: 3px;
+    */
+}
+
+/*** Groups/Layers ***/
+TH.grp {
+    text-align: left;
+    padding: 0px 0px 0px 3px;
+    /*
+    background-color : #EBEBEB;
+    border-top:    1px solid #999999;
+    border-left:   1px solid #999999;
+    */
+}
+
+
+IMG {
+    border: none;
+}
+
+
+
+/* Text Color for visible layers */
+.vis {
+    color: #000000;
+}
+
+/* Text Color for unvisible layers (not visible at current scale)*/
+.unvis {
+    color: #999999;
+}
+
+
+
+/**** BUTTONS  ****/
+.toc .button_on {
+    color: #000000;
+    background-color : #003366;
+    text-align: center;    
+    border: 1px solid #FFFFFF;
+    width: 50%;
+}
+
+.toc .button_off {
+    background-color : #EBEBEB;
+    text-align: center;
+    border: 1px solid #003366;
+    width: 50%;
+}
+
+
+
+/**** STYLE FOR TOC/LEGEND ITEMS ****/
+
+.legtab  {
+    margin: 2px 3px 2px 3px;
+}
+
+
+.legtab TABLE {
+    border-left:  1px solid #999999;
+    border-right: 1px solid #999999;
+    border-bottom: 1px solid #999999;
+    
+}
+
+.legtab TD {
+    color: #000000;
+    background-color : #EBEBEB;
+    padding: 1px 3px 1px 3px;
+    text-align: left;
+    border-top:    1px solid #999999;
+    border-left:   1px solid #999999;
+    border-bottom: none; /*1px solid #999999;*/
+    border-right:  none; /*1px solid #999999;*/
+    /*white-space: nowrap;*/
+}
+
+.legtab TH {
+    color: #000000;
+    padding: 0px 0px 0px 2px;   
+    margin-top: 10px;   
+}
+
+.legtab IMG {
+    margin-top: 2px;
+}
+
+
+/* Buttons used in TOC and legend */
+#legbutton {
+    margin: 3px 0px 5px 0px;
+    width: 100%; 
+    height: 22px;
+}
+
+
+/*** TOC & Legend ***/
+.toclegend {
+    overflow: visible;
+    width: 100%;
+    height: auto;
+    padding: 0px;
+    z-index : 90; 
+}
+
+
+
+/*** Legend displayed over map  ***/
+.maplegend {
+    position: absolute;
+    visibility: hidden;
+    overflow: auto;
+    left : 0;
+    top : 0;
+    width: 200px;
+    height: auto;
+    padding: 5px;
+    z-index : 90; 
+    border-color: #333333;
+    border-width: 1px;
+    border-style: solid;
+    background: #EEEEEE;
+    layer-background-color: #EEEEEE;
+    filter: alpha(opacity=90); 
+    -moz-opacity: 0.9;
+}
+
+
+
+
+.toclegend0 {
+    position: absolute;
+    visibility: visible;
+    overflow: auto;
+    left : 0;
+    top : 0;
+    width: 100%;
+    height: 100%;
+    padding: 0px;
+    z-index : 90; 
+}
+
+
+
+
+

Added: templates/zoombox.gif
===================================================================
(Binary files differ)


Property changes on: templates/zoombox.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: util/arcview3/avpmapper.apr
===================================================================
--- util/arcview3/avpmapper.apr	2006-10-05 22:45:01 UTC (rev 0)
+++ util/arcview3/avpmapper.apr	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,6068 @@
+/3.2
+(ODB.1
+	Dependencies:	"$AVEXT/dialog.avx\n"
+	FirstRootClassName:	"Project"
+	Roots:	2
+	Version:	32
+)
+
+(Project.2
+	Name:	"avpmapper.apr"
+	CreationDate:	"Thursday, 17 October, 2002 21:37:07"
+	GUIName:	"Project"
+	Win:	3
+	CSMgr:	4
+	DocExts:	5
+	VisGUIWidth:	70
+	Doc:	6
+	Doc:	10
+	Doc:	14
+	Doc:	18
+	Doc:	22
+	Doc:	26
+	Doc:	30
+	Doc:	34
+	Doc:	38
+	Doc:	132
+	Doc:	136
+	Doc:	140
+	Doc:	144
+	Doc:	148
+	Doc:	211
+	Doc:	215
+	Doc:	219
+	Doc:	223
+	Doc:	227
+	Doc:	231
+	Doc:	235
+	Doc:	239
+	Doc:	243
+	Doc:	247
+	Doc:	251
+	Doc:	255
+	Doc:	259
+	Doc:	263
+	ActiveDoc:	6
+	Buttons:	267
+	Buttons:	268
+	Buttons:	269
+	Dependencies:	270
+	Scripts:	271
+	Prefs:	272
+	GUI:	280
+	GUI:	549
+	GUI:	948
+	WorkDir:	1240
+	WinX:	10
+	WinY:	3
+	WinW:	1097
+	WinH:	971
+	SerialNumber:	"825911104264"
+	GUINames:	1241
+	GUINames:	1242
+	GUINames:	1243
+	GUINames:	1244
+	GUINames:	1245
+	GUINames:	1246
+	GUINames:	1247
+	GUINames:	1248
+	TocWidthScale:	1.00000000000000
+)
+
+(DocWin.3
+	Owner:	2
+	Open:	1
+	X:	11
+	Y:	13
+	W:	330
+	H:	520
+)
+
+(CSMgr.4
+)
+
+(DocAct.5
+	Doc:	2
+)
+
+(SEd.6
+	Name:	"avmscfg.BaseConfig"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	7
+	CSMgr:	8
+	DocExts:	9
+	Source:	"\n''=================================================================\n'' BASIC CONFIGURATION FOR MAP FILE\n''\n'' Calls script \"avmscfg.BaseConfig.ReturnThmProp\" for each theme\n''\n''=================================================================\n\n\ntheView = av.GetActiveDoc\n_avmscfg_theView = theView\n\n\nexistingConfig = FALSE\n\n' CHECK IF VIEW HAS ALREADY BEEN CONFIGURED\n'' Ask what to do\nif (av.Run(\"avmscfg.CheckViewOTag\",theView) = true) then\n  existingConfig = TRUE\n  reconfigure = msgBox.YesNo(\"Current view 
+has already been configured for use with MapServer. \" + \n               \"If you reconfigure all manual configuration \" + nl + \"will be lost.\" + nl +\n               \"Do you want to continue?\",\n               \"WARNING: Re-Configure?\", FALSE)\n  if (reconfigure = false) then\n    exit\n  end\n \nend   \n\n\ntheunits = theView.getunits.asstring\nif (theunits = \"UNITS_LINEAR_UNKNOWN\") then\n  msgbox.info(\"It is important to have the map units set in the view properties. This is needed by mapserver. Please set them in the 
+View-Properties dialog and try again\", \"MapServer\")\n  exit\nend\n\n\nu = \"meters\"\nif (theunits = \"UNITS_LINEAR_METERS\") then u = \"meters\" end\nif (theunits = \"UNITS_UNITS_LINEAR_DEGREES\") then u = \"dd\" end\nif (theunits = \"UNITS_LINEAR_INCHES\") then u = \"inches\" end\nif (theunits = \"UNITS_LINEAR_FEET\") then u = \"feet\" end\nif (theunits = \"UNITS_LINEAR_MILES\") then u = \"miles\" end\nif (theunits = \"UNITS_LINEAR_KILOMETERS\") then u = \"kilometers\" end\n\n\nviewExtent = theView.getdisplay.ReturnVisExtent\ntotalExtent = theVi
+ew.ReturnExtent\n\nmapExtent = viewExtent.getleft.SetFormat( \"d.ddd\" ).asstring + \" \"+ viewExtent.getbottom.SetFormat( \"d.ddd\" ).asstring +\" \" + viewextent.getright.SetFormat( \"d.ddd\" ).asstring +\" \"+ viewextent.gettop.SetFormat( \"d.ddd\" ).asstring\nthetotalextent = totalextent.getleft.SetFormat( \"d.ddd\" ).asstring + \" \"+ totalextent.getbottom.SetFormat( \"d.ddd\" ).asstring +\" \" + totalextent.getright.SetFormat( \"d.ddd\" ).asstring +\" \"+ totalextent.gettop.SetFormat( \"d.ddd\" ).asstring\n\ndefLayStr = \"\"\nfor each l
+ in theView.GetThemes\n  bn = l.getSrcName.getFilename.GetBaseName\n  layName = bn.Substitute(\".shp\", \"\")\n\n  defLayStr = defLayStr + layName + \",\"\nend\ndefLayStr = defLayStr.left(defLayStr.Count -1)\n\n\n\n\n\n'-----------------------------\n'# PARAMETERS FOR MAP AND WEB\n'-----------------------------\n'# GET DEFAULT VALUES FROM INI FILE\ndatadir     = av.Run(\"avmscfg.ReadIni\", {\"MAPFILE\",\"datadir\"})\nimagecolor  = av.Run(\"avmscfg.ReadIni\", {\"MAPFILE\",\"imagecolor\"})\nfontset     = av.Run(\"avmscfg.ReadIni\", {\"MAPFILE\",\"fo
+ntset\"})\nsymbolset   = av.Run(\"avmscfg.ReadIni\", {\"MAPFILE\",\"symbolset\"})\nimgpath     = av.Run(\"avmscfg.ReadIni\", {\"MAPFILE\",\"imgpath\"})\nimgurl      = av.Run(\"avmscfg.ReadIni\", {\"MAPFILE\",\"imgurl\"})\n\n\nlabels   = {\"MAP: SHAPEPATH * \", \"MAP: IMAGECOLOR\", \"MAP: FONTSET *  \", \"MAP: SYMBOLSET *   \",                     \"WEB: IMAGEPATH *   \",      \"WEB: IMAGEURL *     \"}\ndefaults = {datadir, imagecolor, fontset, symbolset, imgpath, imgurl }  \nMapWebParam = MsgBox.MultiInput (\"Settings for MAP and WEB\", \"Settings 
+MAP and WEB\", labels, defaults)\n\nif (MapWebParam.Count = 0) then exit end\n\nshpPath  = MapWebParam.Get(0) \nimgColor = MapWebParam.Get(1)\nfontSet  = MapWebParam.Get(2)\nsymbSet  = MapWebParam.Get(3)\nimgPath  = MapWebParam.Get(4)\nimgURL   = MapWebParam.Get(5)\n\n\n'-----------------------------\n'# STRINGS FOR MAP AND WEB\n'-----------------------------\n\nmapStr = \"\"\nmapStr = mapStr + \"#\" + nl\nmapStr = mapStr + \"# Start of map file - created \" + date.now.asstring + nl\nmapStr = mapStr + \"#\" + nl\nmapStr = mapStr + \"MAP
+\" + nl\nmapStr = mapStr + \"EXTENT \" + mapExtent + nl\nmapStr = mapStr + \"UNITS \" + u + nl\nmapStr = mapStr + \"SHAPEPATH \" + shpPath.Quote + nl\nmapStr = mapStr + \"FONTSET \" + fontSet.Quote + nl\nmapStr = mapStr + \"SYMBOLSET \" + symbSet.Quote + nl\nmapStr = mapStr + \"RESOLUTION 96\" + nl\n\n\nwebStr = \"\"\nwebStr = webStr + \"#\" + nl\nwebStr = webStr + \"# Start of web interface definition\" + nl\nwebStr = webStr + \"#\" + nl\nwebStr = webStr + \"WEB\" + nl\nwebStr = webStr + \"  TEMPLATE \"\"map.html\"\"\" + nl \nwebStr = webStr + \"  IM
+AGEPATH \" + imgPath.Quote  + nl\nwebStr = webStr + \"  IMAGEURL \" + imgURL.Quote  + nl\nwebStr = webStr + \"  METADATA\" + nl\nwebStr = webStr + \"  END  # Metadata\" + nl\nwebStr = webStr + \"END  # Web\" + nl\n\n\n\n\n'----------------------------------------\n'# PARAMETERS FOR REFERENCE AND SCALEBAR \n'----------------------------------------\nlabels   = {\"REF: IMAGE * \", \"REF: SIZE \", \"SBAR: INTERVALS\", \"SBAR: SIZE\" }\ndefaults = {\"images/reference.png\", \"180 140\", \"4\", \"200 3\" }  \nRefSbarParam = MsgBox.MultiInput (\"Settin
+gs for REFERENCE MAP and SCALEBAR\", \"Settings REFERENCE MAP and SCALEBAR\", labels, defaults)\n\nif (RefSbarParam.Count = 0) then exit end\n\n\nrefImg   = RefSbarParam.Get(0) \nrefSize  = RefSbarParam.Get(1)\nsbarInt  = RefSbarParam.Get(2)\nsbarSize = RefSbarParam.Get(3)\n\n\nrefStr = \"\"\nrefStr = refStr + \"#\" + nl\nrefStr = refStr + \"# Start of Reference map definition\" + nl\nrefStr = refStr + \"#\" + nl\nrefStr = refStr + \"REFERENCE\" + nl\nrefStr = refStr + \"  EXTENT \" + mapExtent + nl\nrefStr = refStr + \"  IMAGE \" + refImg.
+Quote + nl\nrefStr = refStr + \"  SIZE \" + refSize + nl\nrefStr = refStr + \"  COLOR -1 -1 -1\" + nl\nrefStr = refStr + \"  OUTLINECOLOR 255 0 0\" + nl\nrefStr = refStr + \"END  # Reference\" + nl\n\n\n\nsbarStr = \"\"\nsbarStr = sbarStr + \"#\" + nl\nsbarStr = sbarStr + \"# Start of ScaleBar definition\" + nl\nsbarStr = sbarStr + \"#\" + nl\nsbarStr = sbarStr + \"SCALEBAR\" + nl\nsbarStr = sbarStr + \"  INTERVALS \" + sbarInt + nl\nsbarStr = sbarStr + \"  SIZE \" + sbarSize + nl\nsbarStr = sbarStr + \"  UNITS \" + u + nl\nsbarStr = sbarStr + \" 
+ COLOR 250 250 250\" + nl\nsbarStr = sbarStr + \"  OUTLINECOLOR 0 0 0\" + nl\nsbarStr = sbarStr + \"  BACKGROUNDCOLOR 100 100 100\" + nl\nsbarStr = sbarStr + \"  STYLE 0\" + nl\nsbarStr = sbarStr + \"  POSTLABELCACHE true\" + nl\nsbarStr = sbarStr + \"  LABEL\" + nl\nsbarStr = sbarStr + \"    COLOR 255 255 255\" + nl\nsbarStr = sbarStr + \"    OUTLINECOLOR 0 0 0\" + nl\nsbarStr = sbarStr + \"    SIZE small\" + nl\nsbarStr = sbarStr + \"  END  # Label\" + nl\nsbarStr = sbarStr + \"END  # Reference\" + nl\n\n\n'# WRITE STRING LIST TO VIEW OBJ
+ECT TAG\nviewOTag = {\"avmscfg\",{\"MAP\",mapStr}, {\"WEB\",webStr}, {\"REFERENCE\",refStr}, {\"SCALEBAR\",sbarStr} }\ntheView.SetObjectTag(viewOTag)\n\n\n\n'------------------------------------\n' CREATE LAYER ENTRY FOR EACH THEME\n'------------------------------------\nif (existingConfig = TRUE) then\n  reconfigThms = msgBox.YesNo(\"Do you want to re-configure also all THEMES/LAYERS?. \" + \n               \"All existing manual configuration will be lost.\" + nl +\n               \"Do you want to continue?\",\n               \"WARNING
+: Re-Configure THEMES?\", FALSE)\n  if (reconfigThms = false) then\n    exit\n  end  \nend\n\n\ntheThemes = theView.GetThemes\n\nfor each t in theThemes\n  layConfig = av.Run(\"avmscfg.BaseConfig.ReturnThmProp\", t)\n  t.SetObjectTag(layConfig)\nend  \n\n\n"
+	SearchStr:	"existingconfig"
+)
+
+(DocWin.7
+	Owner:	6
+	Open:	1
+	X:	215
+	Y:	59
+	W:	820
+	H:	734
+)
+
+(CSMgr.8
+)
+
+(DocAct.9
+	Doc:	6
+)
+
+(SEd.10
+	Name:	"avmscfg.BaseConfig.ReturnThmProp"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	11
+	CSMgr:	12
+	DocExts:	13
+	Source:	"\n''\n'' RETURNS THEME/LAYER PROPERTIES\n'' Is called from script \"avmscfg.BaseConfig\"\n''\n\n\n'v = av.GetActiveDoc\n't = v.GetActiveThemes.Get(0)\n\nt = self\ntheLegend = t.GetLegend\n\nlayType = \"type???\"\nif (t.Is(FTheme)) then\n  tType = \"f\"\n  if (t.GetFTab.GetSrcName.GetSubName = \"Point\") then\n    layType = \"point\"  \n  elseif (t.GetFTab.GetSrcName.GetSubName = \"Arc\") then\n    layType = \"line\"   \n  elseif (t.GetFTab.GetSrcName.GetSubName = \"Polygon\") then\n    layType = \"polygon\"\n  end  \nelseif (t.Is(ITheme)) then\n  t
+Type = \"i\"\n  layType = \"raster\"\nend  \n\n\nbn = t.getSrcName.getFilename.GetBaseName\nlayData = bn.Substitute(\".shp\", \"\")\n\n'msgBox.info(layData,\"\")\nlayDescr = t.GetName\n\nlayStr = \"\"\nlayStr = layStr + \"#\" + nl\nlayStr = layStr + \"# Start of Layer \"+ layDescr + nl\nlayStr = layStr + \"#\" + nl\n\nlayStr = layStr + \"LAYER\" + nl\nlayStr = layStr + \"  NAME \" + layData.Quote + nl\nlayStr = layStr + \"  TYPE \" + layType + nl\nlayStr = layStr + \"  DATA \" + layData.Quote + nl\n\n\n' MIN/MAXSCALE\nthmThreshold = t.GetThreshold \nif (th
+mThreshold  <> nil) then\n  if (thmThreshold.IsMaximumOn) then\n    layStr = layStr + \"  MAXSCALE \" + thmThreshold.GetMaximum.AsString + nl\n  end   \n  if (thmThreshold.IsMinimumOn) then\n    layStr = layStr + \"  MINSCALE \" + thmThreshold.GetMinimum.AsString + nl\n  end\nend\n\n' SYMBOL SCALED TO REF SCALE\nif (theLegend.IsScaled) then\n  refScale = theLegend.GetRefScale.SetFormat(\"d\")\n  layStr = layStr + \"  SYMBOLSCALE \" + refScale.AsString + nl\nend  \n\n\n' METADATA SECTION\n'------------------\nlayStr = layStr + \"  MET
+ADATA \"  + nl\nlayStr = layStr + \"    \"\"DESCRIPTION\"\" \"  +  layDescr.Quote +  nl\n\n\n'# FIELD NAMES FOR FEATURE THEMES\nif (tType = \"f\") then\n  FieldList = t.GetFTab.GetFields \n  fld0 = \"\"\n  for each f in FieldList\n    if (f.IsTypeShape.Not) then \n      fld0 = fld0 + f.GetName + \",\"\n    end\n  end\n  fldStr = fld0.left(fld0.Count -1).Quote\n\n  layStr = layStr + \"    \"\"RESULT_FIELDS\"\" \" + fldStr.Ucase + nl\n  layStr = layStr + \"    \"\"RESULT_HEADERS\"\" \" + fldStr + nl\nend\n\nlayStr = layStr + \"  END  # Metadata \"  + nl 
+\n\n\nif (t.getlabelfield.asstring <> \"\") then\n  if (t.getgraphics.count >0) then\n    layStr = layStr + \"LABELITEM \" + t.getLabelField.asString.Quote + nl\n  end\nend\n\n\n\n'----------------------------\n' CLASSES FOR FEATURE THEMES\n'----------------------------\n\nif (tType = \"f\") then\n\n  'msgBox.Info(t.GetLegend.GetLegendType.asString, \"\")\n\n  '# SINGLE SYMBOL\n  '----------------\n  if (t.GetLegend.GetLegendType.asString = \"LEGEND_TYPE_SIMPLE\") then \n\n    lstSymbols = t.GetLegend.GetSymbols\n    theSymbol = lstSymbols.
+get(0)\n\n    theColor = theSymbol.GetColor\n    lstRGB = theColor.GetRGBList\n    fgRGB = lstRGB.get(0).asstring +\" \"+ lstRGB.get(1).asstring +\" \"+ lstRGB.get(2).asstring\n\n\n    layStr = layStr + \"  CLASS\" + nl\n    layStr = layStr + \"    Name '\" + t.getname + \"'\" + nl\n    layStr = layStr + \"    COLOR \" + fgRGB + nl\n\n\n    if (layType = \"polygon\") then \n      if (theSymbol.IsOutlined) then\n        outlColor = theSymbol.GetOlColor \n        lstRGB = outlColor.GetRGBList\n        outlRGB = lstRGB.get(0).asstring +\" \"
++ lstRGB.get(1).asstring +\" \"+ lstRGB.get(2).asstring\n        layStr = layStr + \"    OUTLINECOLOR \" + outlRGB + nl\n      end\n    elseif ((layType = \"point\") or (layType = \"line\")) then \n      symSize = theSymbol.GetSize.Round\n      if (symSize = 0) then \n        symSize = 1 \n      end\n      layStr = layStr + \"    SYMBOL 'circle' \" + nl\n      layStr = layStr + \"    SIZE \" + symSize.AsString  + nl  \n    end\n\n    layStr = layStr + \"    TEMPLATE void\" + nl\n    layStr = layStr + \"  END  # Class\" + nl\n\n\n\n  '# UNI
+QUE VALUE\n  '---------------\n  elseif (t.GetLegend.GetLegendType.asString = \"LEGEND_TYPE_UNIQUE\") then \n\n    lstSymbols = t.GetLegend.GetSymbols\n    theclasses = t.GetLegend.getClassifications\n    classIndex = 0\n    classFldName = t.getlegend.getFieldNames.get(0)\n\n    layStr = layStr + \"  CLASSITEM \" + classFldName + nl\n\n    for each theSymbol in lstSymbols\n      theColor  = theSymbol.GetColor\n\n      if (theColor.isTransparent.not) then \n        lstRGB = theColor.GetRGBList\n        fgRGB = lstRGB.get(0).ass
+tring +\" \"+ lstRGB.get(1).asstring +\" \"+ lstRGB.get(2).asstring\n\n        theId = theClasses.get(classIndex).ReturnMaximum.AsString\n        clsName = theClasses.get(classIndex).getLabel\n\n        layStr = layStr + \"  CLASS\" + nl\n        layStr = layStr + \"    NAME \" + clsName.Quote  + nl\n        layStr = layStr + \"    EXPRESSION \" + theId.Quote + nl\n        layStr = layStr + \"    COLOR \" + fgRGB + nl\n\n        if (layType = \"polygon\") then\n          if (theSymbol.IsOutlined) then\n            outlColor = theSym
+bol.GetOlColor\n            lstRGB = outlColor.GetRGBList\n            outlRGB = lstRGB.get(0).asstring +\" \"+ lstRGB.get(1).asstring +\" \"+ lstRGB.get(2).asstring\n\n            layStr = layStr + \"    OUTLINECOLOR \" + outlRGB + nl      \n          end\n        end\n        \n        \n        \n\n        layStr = layStr + \"    TEMPLATE void\" + nl\n        layStr = layStr + \"  END  # Class\"  + nl \n\n        classindex  = classindex + 1   \n      end\n    end\n\n\n  '# GRADUATED COLORS VALUE\n  '-------------------------\n  elsei
+f (t.GetLegend.GetLegendType.asString = \"LEGEND_TYPE_COLOR\") then \n\n    lstSymbols = t.GetLegend.GetSymbols\n    theclasses = t.GetLegend.getClassifications\n    classIndex = 0\n\n    classFldName = t.getLegend.getFieldNames.get(0)\n    classFld = t.GetFTab.FindField(classFldName)\n\n    for each theSymbol in lstSymbols\n      theColor  = theSymbol.GetColor\n\n      if (theColor.isTransparent.not) then \n        lstRGB = theColor.GetRGBList\n        fgRGB = lstRGB.get(0).asString +\" \"+ lstRGB.get(1).asstring +\" \"+ lstR
+GB.get(2).asstring\n\n        clsName = theClasses.get(classIndex).getLabel\n\n\n        '# CLASS EXPRESSION\n        valPrecision = t.GetLegend.GetPrecision \n        if (valPrecision < 0) then\n          numFormat = \"d.\"\n          for each n in 1..valPrecision.Abs \n            numFormat = numFormat + \"d\"\n          end \n        else\n          numFormat = \"d\"\n        end\n\n        'msgBox.Info(valPrecision.AsString,\"\")\n\n        minValStr = theClasses.get(classIndex).ReturnMinimum.SetFormat(numFormat).AsString\n      
+  maxValStr = theClasses.get(classIndex).ReturnMaximum.SetFormat(numFormat).AsString\n\n\n        clsExpr = \"([\" + classFldName.Ucase + \"]>\" + minValStr + \" AND [\" + classFldName.Ucase + \"]<=\" + maxValStr +\")\"          \n\n\n        layStr = layStr + \"  CLASS\" + nl\n        layStr = layStr + \"    NAME \" + clsName.Quote  + nl\n        layStr = layStr + \"    EXPRESSION \" + clsExpr + nl\n        layStr = layStr + \"    COLOR \" + fgRGB + nl\n\n        if (layType = \"polygon\") then\n          if (theSymbol.IsOutlined) then\n 
+           outlColor = theSymbol.GetOlColor\n            lstRGB = outlColor.GetRGBList\n            outlRGB = lstRGB.get(0).asstring +\" \"+ lstRGB.get(1).asstring +\" \"+ lstRGB.get(2).asstring\n\n            layStr = layStr + \"    OUTLINECOLOR \" + outlRGB + nl      \n          end\n        end\n\n        layStr = layStr + \"    TEMPLATE void\" + nl\n        layStr = layStr + \"  END  # Class\" + nl\n\n        classindex  = classindex + 1   \n      end\n    end\n\n  \n  '# Graduated Symbol Legend\n  '--------------------------\n  e
+lseif (t.GetLegend.GetLegendType.asString = \"LEGEND_TYPE_SYMBOL\") then \n\n    lstSymbols = t.GetLegend.GetSymbols\n    theclasses = t.GetLegend.getClassifications\n    classIndex = 0\n\n    classFldName = t.getLegend.getFieldNames.get(0)\n    classFld = t.GetFTab.FindField(classFldName)\n\n    for each theSymbol in lstSymbols\n      'msgBox.Info(lstSymbols.Count.AsString, \"\")\n      theColor  = theSymbol.GetColor\n\n      if (theColor.isTransparent.not) then \n        lstRGB = theColor.GetRGBList\n        fgRGB = lstRGB.
+get(0).asString +\" \"+ lstRGB.get(1).asstring +\" \"+ lstRGB.get(2).asstring\n\n        clsName = theClasses.get(classIndex).getLabel\n\n\n        '# CLASS EXPRESSION\n        valPrecision = t.GetLegend.GetPrecision \n        if (valPrecision < 0) then\n          numFormat = \"d.\"\n          for each n in 1..valPrecision.Abs \n            numFormat = numFormat + \"d\"\n          end \n        else\n          numFormat = \"d\"\n        end\n\n        symSize = theSymbol.GetSize.Round\n\n        'msgBox.Info(valPrecision.AsString,\"\")\n
+\n        minValStr = theClasses.get(classIndex).ReturnMinimum.SetFormat(numFormat).AsString\n        maxValStr = theClasses.get(classIndex).ReturnMaximum.SetFormat(numFormat).AsString\n\n        if (minValStr = minValStr) then\n          clsExpr = \"([\" + classFldName.Ucase + \"] = \" + minValStr +\")\"\n        else\n          clsExpr = \"([\" + classFldName.Ucase + \"]>\" + minValStr + \" AND [\" + classFldName.Ucase + \"]<=\" + maxValStr +\")\"          \n        end\n\n        layStr = layStr + \"  CLASS\" + nl\n        layStr = 
+layStr + \"    NAME \" + clsName.Quote  + nl\n        layStr = layStr + \"    EXPRESSION \" + clsExpr + nl\n        layStr = layStr + \"    COLOR \" + fgRGB + nl\n        layStr = layStr + \"    SYMBOL 'circle' \" + nl\n        layStr = layStr + \"    SIZE \" + symSize.AsString  + nl\n\n\n\n        layStr = layStr + \"    TEMPLATE void\" + nl\n        layStr = layStr + \"  END  # Class\" + nl\n\n        classindex  = classindex + 1   \n      end\n    end\n  \n  end\n \n\nend  ' for feature themes  \n\nlayStr = layStr + \"END  # Layer\" + nl +
+ nl\n\n\n''msgBox.Report(layStr,\"\")\n\nlayConfig = {\"avmscfg\", bn, layStr}\n\n\nreturn layConfig\n\n\n\n"
+)
+
+(DocWin.11
+	Owner:	10
+	X:	50
+	Y:	50
+	W:	943
+	H:	763
+)
+
+(CSMgr.12
+)
+
+(DocAct.13
+	Doc:	10
+)
+
+(SEd.14
+	Name:	"avmscfg.CheckThemeOTag"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	15
+	CSMgr:	16
+	DocExts:	17
+	Source:	"\n'' avmscfg.CheckThemeOTag\n'' Checks if theme has assigned ObjectTag\n''\n\n't = av.GetActiveDoc\nt = self\n\n\nviewOTag = t.GetObjectTag\n\nif (viewOTag = nil) then\n    return false\nelse\n  if (viewOTag.Is(List).Not) then\n    return false\n  else  \n    if (viewOTag.Get(0) <> \"avmscfg\") then\n      return false\n    else\n      return true\n    end\n  end          \nend"
+)
+
+(DocWin.15
+	Owner:	14
+	X:	65
+	Y:	65
+	W:	365
+	H:	247
+)
+
+(CSMgr.16
+)
+
+(DocAct.17
+	Doc:	14
+)
+
+(SEd.18
+	Name:	"avmscfg.CheckViewOTag"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	19
+	CSMgr:	20
+	DocExts:	21
+	Source:	"\n'' avmscfg.CheckViewOTag\n'' Checks if current view has extension object tag assigned to\n''\n\n'v = av.GetActiveDoc\nv = self\n\n\nviewOTag = v.GetObjectTag\n\nif (viewOTag = nil) then\n    return false\nelse\n  if (viewOTag.Is(List).Not) then\n    return false\n  else  \n    if (viewOTag.Get(0) <> \"avmscfg\") then\n      return false\n    else\n      return true\n    end\n  end          \nend"
+)
+
+(DocWin.19
+	Owner:	18
+	X:	80
+	Y:	80
+)
+
+(CSMgr.20
+)
+
+(DocAct.21
+	Doc:	18
+)
+
+(SEd.22
+	Name:	"avmscfg.DefineThemeFields"
+	CreationDate:	"Tuesday, 15 July, 2003 21:55:23"
+	GUIName:	"Script"
+	Win:	23
+	CSMgr:	24
+	DocExts:	25
+	Source:	"' avmscfg.DefineThemeFields\n\n\ntheTheme = self\n\ntheView = av.GetActiceDoc\ntheTheme = theView.GetActiveThemes.Get(0)\n\ntheFTab = theTheme.GetFtab\n\n"
+	FontSize:	1
+)
+
+(DocWin.23
+	Owner:	22
+	X:	373
+	Y:	268
+	W:	548
+	H:	401
+)
+
+(CSMgr.24
+)
+
+(DocAct.25
+	Doc:	22
+)
+
+(SEd.26
+	Name:	"avmscfg.EditIni"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	27
+	CSMgr:	28
+	DocExts:	29
+	Source:	"\n'' LOAD INI FILE INTO NOTEPAD\n\nhomeVar = system.getEnvVar(\"AVHOME\")\niniFile = homeVar + \"\\etc\\avpmapper.ini\"\nif (iniFile.AsFileName.IsFile.Not) then\n  msgBox.Error(\"Config file  avpmapper.ini not in directory ..\\ARCVIEW\\ETC\", \"INI File Not Found\")\n  exit\nend  \n\ncmd = \"notepad.exe \" + iniFile \nsystem.Execute(cmd)"
+)
+
+(DocWin.27
+	Owner:	26
+	X:	95
+	Y:	95
+	W:	810
+	H:	516
+)
+
+(CSMgr.28
+)
+
+(DocAct.29
+	Doc:	26
+)
+
+(SEd.30
+	Name:	"avmscfg.ImgCat2TileShape"
+	CreationDate:	"Thursday, 17 October, 2002 21:52:53"
+	GUIName:	"Script"
+	Win:	31
+	CSMgr:	32
+	DocExts:	33
+	Source:	"' TILEINDEX FOR MAPSERVER FROM ESRI IMAGECATALOG\n' Author: Armin Burger\n' Calculates the tileindex shape file from an ESRI \n' image catalog for use in the MapServer map file.\n' Usage: Load dbf/Info table as table in ArcView.  \n' Run the script for this table.\n\n\n'-----------------------------------------\n' INTABLE - INPUT TABLE FOR IMAGE CATALOG\n'-----------------------------------------\ntheInTable = av.GetActiveDoc\ntheInVTab = theInTable.GetVTab\ntheInFields = theInVTab.GetFields\n\ntheLocFld = theInVTab.FindF
+ield(\"IMAGE\")\nminXFld = theInVTab.FindField(\"XMIN\")\nminYFld = theInVTab.FindField(\"YMIN\")\nmaxXFld = theInVTab.FindField(\"XMAX\")\nmaxYFld = theInVTab.FindField(\"YMAX\")\n\n'-----------------------------------\n' OUT SHAPE FILE AS TILEINDEX SHAPE\n'-----------------------------------\nfileDef = av.GetProject.MakeFileName(\"tileind\", \"shp\")\nmyFileName = FileDialog.Put(fileDef,\"*.shp\",\"Save the new theme\")\nnewFTab = FTab.MakeNew(myFileName,Polygon)\n\nGrdID = Field.Make(\"ID\", #FIELD_LONG, 10, 0)\ntheLoc = Field.Make(\"Loca
+tion\", #FIELD_CHAR, 100, 0)\n\nfldList = {}\nfldList.Add(GrdID)\nfldList.Add(theLoc)\n\nnewFTab.AddFields(fldList)\n\n\n'------------------------------\n' CALCULATE COORDINATES\n'------------------------------\nid = 1\nfor each rec in theInVTab \n\n   ' POINTS\n       ' 2--3   <== order of points\n       ' |  |\n       ' 1--4\n\n    minX = theInVTab.ReturnValueNumber(minXFld, rec)\n    minY = theInVTab.ReturnValueNumber(minYFld, rec)\n    maxX = theInVTab.ReturnValueNumber(maxXFld, rec)\n    maxY = theInVTab.ReturnValueNumber(max
+YFld, rec)\n\n    p1 = Point.Make(minX,minY)\n    p2 = Point.Make(minX,maxY)\n    p3 = Point.Make(maxX,maxY)\n    p4 = Point.Make(maxX,minY)\n    \n    ' POLYGON AND ATTRIBUTE VALUES\n    newPoly = Polygon.Make({{p1, p2, p3, p4}})\n    \n    n = newFTab.AddRecord\n    newFTab.SetValue(newFTab.FindField(\"Shape\"),n,newPoly)\n    \n    newFTab.SetValue(GrdID,n,id)\n    id = id + 1\n    \n    newFTab.SetValue(theLoc,n,theInVTab.ReturnValue(theLocFld, rec))\n     \nend\n"
+	FontSize:	1
+)
+
+(DocWin.31
+	Owner:	30
+	X:	35
+	Y:	35
+	W:	365
+	H:	247
+)
+
+(CSMgr.32
+)
+
+(DocAct.33
+	Doc:	30
+)
+
+(SEd.34
+	Name:	"avmscfg.Map2Browser"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	35
+	CSMgr:	36
+	DocExts:	37
+	Source:	"\n'-----------------------------------------------------------\n' NOW CALL DEFAULT BROWSER AND OPEN QUERY RESULT HTML FILE\n' © for this part by Juna Papajorgji, University of Florida\n'-----------------------------------------------------------\n\nmapURL = self\n\n\n'Setup DLL file objects.\n'-------------------------------------------------------------\nif (System.GetOSVariant = #SYSTEM_OSVARIANT_MSWNT) then\n 	dllShell32 = DLL.Make(FileName.FindInSystemSearchPath(\"shell32.dll\"))\n	 dllUser32 = DLL.Make(FileName.FindI
+nSystemSearchPath(\"user32.dll\"))\nElseIf (System.GetOSvariant = #SYSTEM_OSVARIANT_MSW95) then\n	 dllShell32 = DLL.Make(FileName.FindInSystemSearchPath(\"shell32.dll\"))\n	 dllUser32 = DLL.Make(FileName.FindInSystemSearchPath(\"user32.dll\"))\nElse\n	 MsgBox.Warning(\"Required DLL files cannot be found\"+NL+\"Check that the SYSTEM folder is in your path.\", \"Stop, is this a Windoze machine?\")\n	 return nil\nEnd\n\n'Setup Win32API functions as Avenue DLLProc objects\ndpGetActivewindow = DLLProc.Make(dllUser32, \"GetActiveWindow
+\",\n                                  #DLLPROC_TYPE_INT32,	'return value type\n                                  {})                		'argument list\n\ndpShellExecute = DLLProc.Make(dllShell32, \"ShellExecuteA\",\n                              #DLLPROC_TYPE_INT32,		'return value type\n                            	{#DLLPROC_TYPE_INT32,		'argument list\n                            	 #DLLPROC_TYPE_STR,\n                            	 #DLLPROC_TYPE_STR,\n                            	 #DLLPROC_TYPE_STR,\n                    
+        	 #DLLPROC_TYPE_STR,\n                            	 #DLLPROC_TYPE_INT32})\n\n\n'Get the Window Handle (hWnd) of the ArcView window\n'---------------------------------------------------\nhWnd_active = dpGetActivewindow.Call({})\n'''or-> hWnd_active = DLL.GetAVWindowHandle\n\n\n'Send the URL to the default browser\n'-------------------------------------------\nretvalue = dpShellExecute.Call({hWnd_active, \"Open\", mapURL, \"\", FileName.GetCWD.AsString, 1})\n\n\n'Let the user know if the link failed.  The \"ShellExecuteA
+\"\n'function returns an integer greater than 32 if the process succeeded.\n'---------------------------------------------------------------------\nif	(retvalue <=32) then                    \n  MsgBox.Warning (\"Loading map failed.\",\"Server error\")\nEnd\n\n"
+)
+
+(DocWin.35
+	Owner:	34
+	X:	93
+	Y:	79
+	W:	398
+	H:	296
+)
+
+(CSMgr.36
+)
+
+(DocAct.37
+	Doc:	34
+)
+
+(DEd.38
+	Name:	"avmscfg.mapDlg"
+	CreationDate:	"Saturday, 12 October, 2002 16:42:34"
+	GUIName:	"DialogEditor"
+	Win:	39
+	CSMgr:	40
+	DocExts:	42
+	DocExts:	43
+	Graphics:	44
+	Dpy:	83
+	Dialog:	86
+	DialogExtent:	131
+	Compiled:	1
+)
+
+(DocWin.39
+	Owner:	38
+	X:	241
+	Y:	65
+	W:	593
+	H:	545
+)
+
+(CSMgr.40
+	Client:	41
+)
+
+(CSClient.41
+	Client:	42
+	ReqName:	"ClientNfy"
+)
+
+(PanMgr.42
+	Doc:	38
+)
+
+(DocAct.43
+	Doc:	38
+)
+
+(GList.44
+	Child:	45
+	Child:	48
+	Child:	51
+	Child:	54
+	Child:	57
+	Child:	61
+	Child:	64
+	Child:	67
+	Child:	71
+	Child:	74
+	Child:	77
+	Child:	80
+	Dpy:	83
+	FormatNumb:	85
+)
+
+(GCtrl.45
+	Name:	"but_map"
+	Bounds:	46
+	ControlConstraints:	0x55
+	Control:	47
+	Editable:	1
+)
+
+(RectD.46
+	Left:	0.40625000000000
+	Top:	4.73958333333333
+	Right:	1.64583333333333
+	Bottom:	4.50000000000000
+)
+
+(LButn.47
+	InternalName:	"but_map"
+	UseGraphicNfy:	1
+	Tag:	"1"
+	Label:	"MAP"
+	Click:	"avmscfg.mDlg.ShowParams"
+)
+
+(GCtrl.48
+	Name:	"but_web"
+	Bounds:	49
+	ControlConstraints:	0x55
+	Control:	50
+	Editable:	1
+)
+
+(RectD.49
+	Left:	0.40625000000000
+	Top:	4.40625000000000
+	Right:	1.64583333333333
+	Bottom:	4.16666666666667
+)
+
+(LButn.50
+	InternalName:	"but_web"
+	UseGraphicNfy:	1
+	Tag:	"2"
+	Label:	"WEB"
+	Click:	"avmscfg.mDlg.ShowParams"
+)
+
+(GCtrl.51
+	Name:	"but_ref"
+	Bounds:	52
+	ControlConstraints:	0x55
+	Control:	53
+	Editable:	1
+)
+
+(RectD.52
+	Left:	0.40625000000000
+	Top:	4.06250000000000
+	Right:	1.64583333333333
+	Bottom:	3.82291666666667
+)
+
+(LButn.53
+	InternalName:	"but_ref"
+	UseGraphicNfy:	1
+	Tag:	"3"
+	Label:	"REFERENCE"
+	Click:	"avmscfg.mDlg.ShowParams"
+)
+
+(GCtrl.54
+	Name:	"but_sbar"
+	Bounds:	55
+	ControlConstraints:	0x55
+	Control:	56
+	Editable:	1
+)
+
+(RectD.55
+	Left:	0.40625000000000
+	Top:	3.72916666666667
+	Right:	1.64583333333333
+	Bottom:	3.48958333333333
+)
+
+(LButn.56
+	InternalName:	"but_sbar"
+	UseGraphicNfy:	1
+	Tag:	"4"
+	Label:	"SCALEBAR"
+	Click:	"avmscfg.mDlg.ShowParams"
+)
+
+(GCtrl.57
+	Name:	"tbx_params"
+	Bounds:	58
+	ControlConstraints:	0x33
+	Control:	59
+	Editable:	1
+)
+
+(RectD.58
+	Left:	2.02083333333333
+	Top:	4.79166666666667
+	Right:	5.32291666666667
+	Bottom:	1.09375000000000
+)
+
+(TextBox.59
+	InternalName:	"tbx_params"
+	UseGraphicNfy:	1
+	Listening:	1
+	Constraints:	0x55
+	Changed:	"avmscfg.SaveEnableBut"
+	VerticalScroll:	1
+	HorizontalScroll:	1
+	NextControl:	60
+)
+
+(Nil.60
+)
+
+(GCtrl.61
+	Name:	"but_save"
+	Bounds:	62
+	ControlConstraints:	0x65
+	Control:	63
+	Editable:	1
+)
+
+(RectD.62
+	Left:	2.01041666666667
+	Top:	1.00000000000000
+	Right:	2.61458333333333
+	Bottom:	0.77083333333333
+)
+
+(LButn.63
+	InternalName:	"but_save"
+	UseGraphicNfy:	1
+	Disabled:	1
+	Label:	"Save"
+	Click:	"avmscfg.SaveParams"
+)
+
+(GCtrl.64
+	Name:	"but_clear"
+	Bounds:	65
+	ControlConstraints:	0x56
+	Control:	66
+	Editable:	1
+)
+
+(RectD.65
+	Left:	4.71875000000000
+	Top:	4.97916666666667
+	Right:	5.30208333333333
+	Bottom:	4.78125000000000
+)
+
+(LButn.66
+	InternalName:	"but_clear"
+	UseGraphicNfy:	1
+	Label:	"Clear"
+	Click:	"avmscfg.mDlg.ClearBut"
+)
+
+(GCtrl.67
+	Name:	"lbx_layers"
+	Bounds:	68
+	ControlConstraints:	0x35
+	Control:	69
+	Editable:	1
+)
+
+(RectD.68
+	Left:	0.32291666666667
+	Top:	3.20833333333333
+	Right:	1.88541666666667
+	Bottom:	0.77083333333333
+)
+
+(AVLBox.69
+	InternalName:	"lbx_layers"
+	UseGraphicNfy:	1
+	NextControl:	60
+	ContentKind:	4
+	Constraints:	0x55
+	ColumnCount:	1
+	HorizontalScroll:	1
+	Listening:	1
+	VerticalScroll:	1
+	SelectionStyle:	70
+	Apply:	"avmscfg.mDlg.ShowThmParams"
+)
+
+(AVEnum.70
+	Name:	"LISTBOX_SELECTION_MULTIRANGE"
+)
+
+(GCtrl.71
+	Name:	"but_writemap"
+	Bounds:	72
+	ControlConstraints:	0x66
+	Control:	73
+	Editable:	1
+)
+
+(RectD.72
+	Left:	4.35416666666667
+	Top:	1.00000000000000
+	Right:	5.29166666666667
+	Bottom:	0.77083333333333
+)
+
+(LButn.73
+	InternalName:	"but_writemap"
+	UseGraphicNfy:	1
+	Tag:	"write"
+	Label:	"Write Map File"
+	Click:	"avmscfg.WriteMapFile"
+)
+
+(GCtrl.74
+	Name:	"txt_layers"
+	Bounds:	75
+	ControlConstraints:	0x55
+	Control:	76
+	Editable:	1
+)
+
+(RectD.75
+	Left:	0.34375000000000
+	Top:	3.38541666666667
+	Right:	1.57291666666667
+	Bottom:	3.18750000000000
+)
+
+(TextLabel.76
+	InternalName:	"txt_layers"
+	UseGraphicNfy:	1
+	Constraints:	0x55
+	Label:	"Layers/Themes"
+	Listening:	1
+)
+
+(GCtrl.77
+	Name:	"txt_params"
+	Bounds:	78
+	ControlConstraints:	0x55
+	Control:	79
+	Editable:	1
+)
+
+(RectD.78
+	Left:	2.03125000000000
+	Top:	4.94791666666667
+	Right:	5.02083333333333
+	Bottom:	4.69791666666667
+)
+
+(TextLabel.79
+	InternalName:	"txt_params"
+	UseGraphicNfy:	1
+	Constraints:	0x55
+	Label:	"Parameters"
+	Listening:	1
+)
+
+(GCtrl.80
+	Name:	"but_testmap"
+	Bounds:	81
+	ControlConstraints:	0x66
+	Control:	82
+	Editable:	1
+)
+
+(RectD.81
+	Left:	3.19791666666667
+	Top:	1.00000000000000
+	Right:	4.13541666666667
+	Bottom:	0.77083333333333
+)
+
+(LButn.82
+	InternalName:	"but_testmap"
+	UseGraphicNfy:	1
+	Tag:	"test"
+	Label:	"Test Map File"
+	Click:	"avmscfg.WriteMapFile"
+)
+
+(PageDpy.83
+	Top:	5.39583333333333
+	Right:	6.08333333333333
+	ReportUnits:	1
+	Units:	1
+	Scale:	84
+	ZoomRight:	6.08333333333333
+	ZoomTop:	5.39583333333333
+	GridSpacingX:	0.10000000000000
+	GridSpacingY:	0.10000000000000
+)
+
+(Numb.84
+	N:	0.16438356164384
+)
+
+(Numb.85
+)
+
+(AVDLog.86
+	Name:	"avmscfg.mapDlg"
+	X:	26
+	Y:	55
+	W:	496
+	H:	418
+	ConstrainedControlNames:	87
+	ConstrainedControlNames:	88
+	ConstrainedControlNames:	89
+	ConstrainedControlNames:	90
+	ConstrainedControlNames:	91
+	ConstrainedControlNames:	92
+	ConstrainedControlNames:	93
+	ConstrainedControlNames:	94
+	Constraints:	95
+	Constraints:	96
+	Constraints:	97
+	Constraints:	98
+	Constraints:	99
+	Constraints:	100
+	Constraints:	101
+	Constraints:	102
+	Server:	103
+	ControlPanel:	104
+	Title:	"MapFile Creator"
+	EscapeEnabled:	1
+	Modal:	1
+	Resizable:	1
+	AlwaysOnTop:	1
+	HasTitleBar:	1
+	Closeable:	1
+	DefaultButton:	130
+)
+
+(AVStr.87
+	S:	"but_map"
+)
+
+(AVStr.88
+	S:	"but_web"
+)
+
+(AVStr.89
+	S:	"but_ref"
+)
+
+(AVStr.90
+	S:	"but_sbar"
+)
+
+(AVStr.91
+	S:	"but_save"
+)
+
+(AVStr.92
+	S:	"but_clear"
+)
+
+(AVStr.93
+	S:	"but_writemap"
+)
+
+(AVStr.94
+	S:	"but_testmap"
+)
+
+(Numb.95
+	N:	85.00000000000000
+)
+
+(Numb.96
+	N:	85.00000000000000
+)
+
+(Numb.97
+	N:	85.00000000000000
+)
+
+(Numb.98
+	N:	85.00000000000000
+)
+
+(Numb.99
+	N:	101.00000000000000
+)
+
+(Numb.100
+	N:	86.00000000000000
+)
+
+(Numb.101
+	N:	102.00000000000000
+)
+
+(Numb.102
+	N:	102.00000000000000
+)
+
+(Nil.103
+)
+
+(CPanel.104
+	Child:	105
+	Child:	106
+	Child:	107
+	Child:	108
+	Child:	109
+	Child:	110
+	Child:	111
+	Child:	112
+	Child:	114
+	Child:	115
+	Child:	116
+	Child:	117
+	ResBox:	118
+	ResBox:	119
+	ResBox:	120
+	ResBox:	121
+	ResBox:	122
+	ResBox:	123
+	ResBox:	124
+	ResBox:	125
+	ResBox:	126
+	ResBox:	127
+	ResBox:	128
+	ResBox:	129
+	Listening:	1
+)
+
+(LButn.105
+	InternalName:	"but_map"
+	Tag:	"1"
+	Label:	"MAP"
+	Click:	"avmscfg.mDlg.ShowParams"
+)
+
+(LButn.106
+	InternalName:	"but_web"
+	Tag:	"2"
+	Label:	"WEB"
+	Click:	"avmscfg.mDlg.ShowParams"
+)
+
+(LButn.107
+	InternalName:	"but_ref"
+	Tag:	"3"
+	Label:	"REFERENCE"
+	Click:	"avmscfg.mDlg.ShowParams"
+)
+
+(LButn.108
+	InternalName:	"but_sbar"
+	Tag:	"4"
+	Label:	"SCALEBAR"
+	Click:	"avmscfg.mDlg.ShowParams"
+)
+
+(TextBox.109
+	InternalName:	"tbx_params"
+	Listening:	1
+	Constraints:	0x33
+	Changed:	"avmscfg.SaveEnableBut"
+	VerticalScroll:	1
+	HorizontalScroll:	1
+	NextControl:	103
+)
+
+(LButn.110
+	InternalName:	"but_save"
+	Disabled:	1
+	Label:	"Save"
+	Click:	"avmscfg.SaveParams"
+)
+
+(LButn.111
+	InternalName:	"but_clear"
+	Label:	"Clear"
+	Click:	"avmscfg.mDlg.ClearBut"
+)
+
+(AVLBox.112
+	InternalName:	"lbx_layers"
+	NextControl:	103
+	ContentKind:	4
+	Constraints:	0x35
+	ColumnCount:	1
+	HorizontalScroll:	1
+	Listening:	1
+	VerticalScroll:	1
+	SelectionStyle:	113
+	Apply:	"avmscfg.mDlg.ShowThmParams"
+)
+
+(AVEnum.113
+	Name:	"LISTBOX_SELECTION_MULTIRANGE"
+)
+
+(LButn.114
+	InternalName:	"but_writemap"
+	Tag:	"write"
+	Label:	"Write Map File"
+	Click:	"avmscfg.WriteMapFile"
+)
+
+(TextLabel.115
+	InternalName:	"txt_layers"
+	Constraints:	0x55
+	Label:	"Layers/Themes"
+	Listening:	1
+)
+
+(TextLabel.116
+	InternalName:	"txt_params"
+	Constraints:	0x55
+	Label:	"Parameters"
+	Listening:	1
+)
+
+(LButn.117
+	InternalName:	"but_testmap"
+	Tag:	"test"
+	Label:	"Test Map File"
+	Click:	"avmscfg.WriteMapFile"
+)
+
+(RectD.118
+	Left:	16.00000000000000
+	Top:	52.00000000000000
+	Right:	135.00000000000000
+	Bottom:	29.00000000000000
+)
+
+(RectD.119
+	Left:	16.00000000000000
+	Top:	84.00000000000000
+	Right:	135.00000000000000
+	Bottom:	61.00000000000000
+)
+
+(RectD.120
+	Left:	16.00000000000000
+	Top:	117.00000000000000
+	Right:	135.00000000000000
+	Bottom:	94.00000000000000
+)
+
+(RectD.121
+	Left:	16.00000000000000
+	Top:	149.00000000000000
+	Right:	135.00000000000000
+	Bottom:	126.00000000000000
+)
+
+(RectD.122
+	Left:	171.00000000000000
+	Top:	379.00000000000000
+	Right:	488.00000000000000
+	Bottom:	24.00000000000000
+)
+
+(RectD.123
+	Left:	170.00000000000000
+	Top:	410.00000000000000
+	Right:	228.00000000000000
+	Bottom:	388.00000000000000
+)
+
+(RectD.124
+	Left:	430.00000000000000
+	Top:	25.00000000000000
+	Right:	486.00000000000000
+	Bottom:	6.00000000000000
+)
+
+(RectD.125
+	Left:	8.00000000000000
+	Top:	410.00000000000000
+	Right:	158.00000000000000
+	Bottom:	176.00000000000000
+)
+
+(RectD.126
+	Left:	395.00000000000000
+	Top:	410.00000000000000
+	Right:	485.00000000000000
+	Bottom:	388.00000000000000
+)
+
+(RectD.127
+	Left:	10.00000000000000
+	Top:	178.00000000000000
+	Right:	128.00000000000000
+	Bottom:	159.00000000000000
+)
+
+(RectD.128
+	Left:	172.00000000000000
+	Top:	33.00000000000000
+	Right:	459.00000000000000
+	Bottom:	9.00000000000000
+)
+
+(RectD.129
+	Left:	284.00000000000000
+	Top:	410.00000000000000
+	Right:	374.00000000000000
+	Bottom:	388.00000000000000
+)
+
+(Nil.130
+)
+
+(RectD.131
+	Left:	0.23958333333333
+	Top:	5.04166666666667
+	Right:	5.40625000000000
+	Bottom:	0.68750000000000
+)
+
+(SEd.132
+	Name:	"avmscfg.mDlg.ClearBut"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	133
+	CSMgr:	134
+	DocExts:	135
+	Source:	"\n' avmscfg.mDlg.ClearBut\n\nmapDlg = av.FindDialog(\"avmscfg.mapDlg\")\n\nparamTxtBox = mapDlg.FindByName(\"tbx_params\")\nparamTxtBox.Empty\n\nparamTxtLabl = mapDlg.FindByName(\"txt_params\")\nparamTxtLabl.SetLabel(\"Parameters\")\n\n\n\n"
+)
+
+(DocWin.133
+	Owner:	132
+	X:	20
+	Y:	20
+)
+
+(CSMgr.134
+)
+
+(DocAct.135
+	Doc:	132
+)
+
+(SEd.136
+	Name:	"avmscfg.mDlg.Open"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	137
+	CSMgr:	138
+	DocExts:	139
+	Source:	"\n'====================================\n' OPEN DIALOG FOR MAP FILE CREATION\n'====================================\n\ntheView = av.GetActiveDoc\n_avmscfg_theView = theView\n\n\n'-------------------------------------------\n' CHECK IF VIEW IS CONFIGURED FOR MAPSERVER\n'-------------------------------------------\nif (av.Run(\"avmscfg.CheckViewOTag\",theView) = false) then\n  msgBox.Error(\"Current view has not been configured yet for \" + nl + \n               \"use with MapServer.\" + nl +\n               \"Please run menu 'Bas
+e Configuration' first\", \"\")\n  return nil\nend               \n\n\n'-------------------------------------------------------\n' CHECK FOR NEW THEMES NOT YET CONFIGURED FOR MAPSERVER\n'-------------------------------------------------------\ntheLayers = theView.GetThemes\n\nnewLayers = {}\nnewLayerStr = \"\"\nfor each lay in theLayers\n  if (av.Run(\"avmscfg.CheckThemeOTag\", lay) = false) then\n    newLayers.Add(lay)\n    newLayerStr = newLayerStr + lay.GetName + \" \"\n  end\nend\n\nif (newLayers.Count > 0) then\n  runConfig = msgB
+ox.YesNo(\"The themes \" + newLayerStr + \"have been added to the view and are not configured for inclusion in MapServer map file.\" + nl+\n                           \"Do you want to run configuration for them?\", \"Configure New Themes?\", TRUE) \n  if (runConfig) then\n    for each lay in newLayers\n      layConfig = av.Run(\"avmscfg.BaseConfig.ReturnThmProp\", lay)\n      lay.SetObjectTag(layConfig)\n    end\n  end \nend\n\n\n'-------------\n' OPEN DIALOG\n'-------------\nmapDlg = av.FindDialog(\"avmscfg.mapDlg\")\nlayLBox = mapD
+lg.FindByName(\"lbx_layers\")\nlayLBox.DefineFromList(theLayers)\n\nparamTxtBox = mapDlg.FindByName(\"tbx_params\")\nparamTxtBox.Empty\n\nparamTxtLabl = mapDlg.FindByName(\"txt_params\")\nparamTxtLabl.SetLabel(\"Parameters\")\n\n\nmapDlg.Open\n\n\n\n"
+)
+
+(DocWin.137
+	Owner:	136
+	X:	35
+	Y:	35
+	W:	365
+	H:	247
+)
+
+(CSMgr.138
+)
+
+(DocAct.139
+	Doc:	136
+)
+
+(SEd.140
+	Name:	"avmscfg.mDlg.ShowParams"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	141
+	CSMgr:	142
+	DocExts:	143
+	Source:	"\n' SHOW PARAMETERS READ FROM VIEW OBJECT TAG FOR\n' MAP, WEB, REFERENCE, SCALEBAR\n\ntheView = _avmscfg_theView\nviewOTag = theView.GetObjectTag\n\n\nmapDlg = av.FindDialog(\"avmscfg.mapDlg\")\n\nparamTxtBox = mapDlg.FindByName(\"tbx_params\")\nparamTxtLabl = mapDlg.FindByName(\"txt_params\")\n\n\nidx = self.GetTag.AsNumber\n\nelemOTag = viewOTag.Get(idx)\nelemName = elemOTag.Get(0)\nloadStr = elemOTag.Get(1)\n\n_avmscfg_LoadedTag = {\"view\", idx, elemName}\n\nparamTxtLabl.SetLabel(\"Parameters for \" + elemName)\nparamTxtBox.SetText(loa
+dStr)\n\nmapDlg.FindByName(\"but_save\").SetEnabled(FALSE)\n\n\n\n\n\n\n"
+)
+
+(DocWin.141
+	Owner:	140
+	X:	50
+	Y:	50
+)
+
+(CSMgr.142
+)
+
+(DocAct.143
+	Doc:	140
+)
+
+(SEd.144
+	Name:	"avmscfg.mDlg.ShowThmParams"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	145
+	CSMgr:	146
+	DocExts:	147
+	Source:	"\n'' \n'' SHOW PARAMETERS FOR SELECTED THEME/LAYER\n'' Read from theme object tag\n''\n\n\ntheView = _avmscfg_theView\n\nmapDlg = av.FindDialog(\"avmscfg.mapDlg\")\nparamTxtBox = mapDlg.FindByName(\"tbx_params\")\nparamTxtLabl = mapDlg.FindByName(\"txt_params\")\nlayerLBox = mapDlg.FindByName(\"lbx_layers\")\n\nlayIdx = layerLBox.GetCurrentRow\ntheLayer = layerLBox.GetSelection.Get(0) \nloadStr = theLayer.GetObjectTag.Get(2)\n\n_avmscfg_LoadedTag = {\"theme\", layIdx}\n\nparamTxtBox.SetText(loadStr)\nparamTxtLabl.SetLabel(\"Parameters for
+ layer/theme \" + theLayer.GetName.Quote)\n\nmapDlg.FindByName(\"but_save\").SetEnabled(FALSE)"
+)
+
+(DocWin.145
+	Owner:	144
+	X:	65
+	Y:	65
+	W:	742
+	H:	558
+)
+
+(CSMgr.146
+)
+
+(DocAct.147
+	Doc:	144
+)
+
+(DEd.148
+	Name:	"avmscfg.metadata"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:25"
+	GUIName:	"DialogEditor"
+	Win:	149
+	CSMgr:	150
+	DocExts:	152
+	DocExts:	153
+	Graphics:	154
+	Dpy:	183
+	Dialog:	186
+	DialogExtent:	210
+	Compiled:	1
+)
+
+(DocWin.149
+	Owner:	148
+	X:	358
+	Y:	99
+	W:	605
+	H:	537
+)
+
+(CSMgr.150
+	Client:	151
+)
+
+(CSClient.151
+	Client:	152
+	ReqName:	"ClientNfy"
+)
+
+(PanMgr.152
+	Doc:	148
+)
+
+(DocAct.153
+	Doc:	148
+)
+
+(GList.154
+	Child:	155
+	Child:	158
+	Child:	161
+	Child:	166
+	Child:	170
+	Child:	174
+	Child:	177
+	Child:	180
+	Dpy:	183
+	FormatNumb:	185
+)
+
+(GCtrl.155
+	Name:	"txt_title"
+	Bounds:	156
+	ControlConstraints:	0x55
+	Control:	157
+	Editable:	1
+)
+
+(RectD.156
+	Left:	0.62500000000000
+	Top:	4.67708333333333
+	Right:	1.44791666666667
+	Bottom:	4.48958333333333
+)
+
+(TextLabel.157
+	InternalName:	"txt_title"
+	UseGraphicNfy:	1
+	Constraints:	0x55
+	Label:	"wms_title"
+	Listening:	1
+)
+
+(GCtrl.158
+	Name:	"txt_onlineresource"
+	Bounds:	159
+	ControlConstraints:	0x55
+	Control:	160
+	Editable:	1
+)
+
+(RectD.159
+	Left:	0.62500000000000
+	Top:	4.35416666666667
+	Right:	1.85416666666667
+	Bottom:	4.16666666666667
+)
+
+(TextLabel.160
+	InternalName:	"txt_onlineresource"
+	UseGraphicNfy:	1
+	Constraints:	0x55
+	Label:	"wms_onlineresource"
+	Listening:	1
+)
+
+(GCtrl.161
+	Name:	"txl_title"
+	Bounds:	162
+	ControlConstraints:	0x55
+	Control:	163
+	Editable:	1
+)
+
+(RectD.162
+	Left:	1.68750000000000
+	Top:	4.68750000000000
+	Right:	4.45833333333333
+	Bottom:	4.47916666666667
+)
+
+(TextLine.163
+	InternalName:	"txl_title"
+	UseGraphicNfy:	1
+	Label:	" "
+	Constraints:	0x55
+	Listening:	1
+	TextType:	164
+	NextControl:	165
+)
+
+(AVEnum.164
+	Name:	"TEXTLINE_TYPE_ALL"
+)
+
+(Nil.165
+)
+
+(GCtrl.166
+	Name:	"txl_onlineres"
+	Bounds:	167
+	ControlConstraints:	0x55
+	Control:	168
+	Editable:	1
+)
+
+(RectD.167
+	Left:	1.67708333333333
+	Top:	4.38541666666667
+	Right:	4.44791666666667
+	Bottom:	4.17708333333333
+)
+
+(TextLine.168
+	InternalName:	"txl_onlineres"
+	UseGraphicNfy:	1
+	Label:	" "
+	Constraints:	0x55
+	Listening:	1
+	TextType:	169
+	NextControl:	165
+)
+
+(AVEnum.169
+	Name:	"TEXTLINE_TYPE_ALL"
+)
+
+(GCtrl.170
+	Name:	"txl_srs"
+	Bounds:	171
+	ControlConstraints:	0x55
+	Control:	172
+	Editable:	1
+)
+
+(RectD.171
+	Left:	1.66666666666667
+	Top:	4.06250000000000
+	Right:	4.43750000000000
+	Bottom:	3.85416666666667
+)
+
+(TextLine.172
+	InternalName:	"txl_srs"
+	UseGraphicNfy:	1
+	Label:	" "
+	Constraints:	0x55
+	Listening:	1
+	TextType:	173
+	NextControl:	165
+)
+
+(AVEnum.173
+	Name:	"TEXTLINE_TYPE_ALL"
+)
+
+(GCtrl.174
+	Name:	"but_srs"
+	Bounds:	175
+	ControlConstraints:	0x55
+	Control:	176
+	Editable:	1
+)
+
+(RectD.175
+	Left:	0.61458333333333
+	Top:	4.07291666666667
+	Right:	1.41666666666667
+	Bottom:	3.86458333333333
+)
+
+(LButn.176
+	InternalName:	"but_srs"
+	UseGraphicNfy:	1
+	Label:	"wms_srs"
+)
+
+(GCtrl.177
+	Name:	"aTextBox8"
+	Bounds:	178
+	ControlConstraints:	0x55
+	Control:	179
+	Editable:	1
+)
+
+(RectD.178
+	Left:	0.60416666666667
+	Top:	3.43750000000000
+	Right:	4.45833333333333
+	Bottom:	1.98958333333333
+)
+
+(TextBox.179
+	InternalName:	"aTextBox8"
+	UseGraphicNfy:	1
+	Listening:	1
+	Constraints:	0x55
+	VerticalScroll:	1
+	NextControl:	165
+)
+
+(GCtrl.180
+	Name:	"aTextLabel9"
+	Bounds:	181
+	ControlConstraints:	0x55
+	Control:	182
+	Editable:	1
+)
+
+(RectD.181
+	Left:	0.61458333333333
+	Top:	3.60416666666667
+	Right:	1.19791666666667
+	Bottom:	3.40625000000000
+)
+
+(TextLabel.182
+	InternalName:	"aTextLabel9"
+	UseGraphicNfy:	1
+	Constraints:	0x55
+	Label:	"Other"
+	Listening:	1
+)
+
+(PageDpy.183
+	Top:	5.31250000000000
+	Right:	6.20833333333333
+	ReportUnits:	1
+	Units:	1
+	Scale:	184
+	ZoomRight:	6.20833333333333
+	ZoomTop:	5.31250000000000
+	GridSpacingX:	0.10000000000000
+	GridSpacingY:	0.10000000000000
+)
+
+(Numb.184
+	N:	0.16107382550336
+)
+
+(Numb.185
+)
+
+(AVDLog.186
+	Name:	"avmscfg.metadata"
+	X:	221
+	Y:	478
+	W:	419
+	H:	333
+	ConstrainedControlNames:	187
+	Constraints:	188
+	Server:	165
+	ControlPanel:	189
+	Title:	"Metadata"
+	EscapeEnabled:	1
+	Resizable:	1
+	AlwaysOnTop:	1
+	HasTitleBar:	1
+	Closeable:	1
+	DefaultButton:	209
+)
+
+(AVStr.187
+	S:	"but_srs"
+)
+
+(Numb.188
+	N:	85.00000000000000
+)
+
+(CPanel.189
+	Child:	190
+	Child:	191
+	Child:	192
+	Child:	194
+	Child:	196
+	Child:	198
+	Child:	199
+	Child:	200
+	ResBox:	201
+	ResBox:	202
+	ResBox:	203
+	ResBox:	204
+	ResBox:	205
+	ResBox:	206
+	ResBox:	207
+	ResBox:	208
+	Listening:	1
+)
+
+(TextLabel.190
+	InternalName:	"txt_title"
+	Constraints:	0x55
+	Label:	"wms_title"
+	Listening:	1
+)
+
+(TextLabel.191
+	InternalName:	"txt_onlineresource"
+	Constraints:	0x55
+	Label:	"wms_onlineresource"
+	Listening:	1
+)
+
+(TextLine.192
+	InternalName:	"txl_title"
+	Label:	" "
+	Constraints:	0x55
+	Listening:	1
+	TextType:	193
+	NextControl:	165
+)
+
+(AVEnum.193
+	Name:	"TEXTLINE_TYPE_ALL"
+)
+
+(TextLine.194
+	InternalName:	"txl_onlineres"
+	Label:	" "
+	Constraints:	0x55
+	Listening:	1
+	TextType:	195
+	NextControl:	165
+)
+
+(AVEnum.195
+	Name:	"TEXTLINE_TYPE_ALL"
+)
+
+(TextLine.196
+	InternalName:	"txl_srs"
+	Label:	" "
+	Constraints:	0x55
+	Listening:	1
+	TextType:	197
+	NextControl:	165
+)
+
+(AVEnum.197
+	Name:	"TEXTLINE_TYPE_ALL"
+)
+
+(LButn.198
+	InternalName:	"but_srs"
+	Label:	"wms_srs"
+)
+
+(TextBox.199
+	InternalName:	"aTextBox8"
+	Listening:	1
+	Constraints:	0x55
+	VerticalScroll:	1
+	NextControl:	165
+)
+
+(TextLabel.200
+	InternalName:	"aTextLabel9"
+	Constraints:	0x55
+	Label:	"Other"
+	Listening:	1
+)
+
+(RectD.201
+	Left:	14.00000000000000
+	Top:	42.00000000000000
+	Right:	93.00000000000000
+	Bottom:	24.00000000000000
+)
+
+(RectD.202
+	Left:	14.00000000000000
+	Top:	73.00000000000000
+	Right:	132.00000000000000
+	Bottom:	55.00000000000000
+)
+
+(RectD.203
+	Left:	116.00000000000000
+	Top:	43.00000000000000
+	Right:	382.00000000000000
+	Bottom:	23.00000000000000
+)
+
+(RectD.204
+	Left:	115.00000000000000
+	Top:	72.00000000000000
+	Right:	381.00000000000000
+	Bottom:	52.00000000000000
+)
+
+(RectD.205
+	Left:	114.00000000000000
+	Top:	103.00000000000000
+	Right:	380.00000000000000
+	Bottom:	83.00000000000000
+)
+
+(RectD.206
+	Left:	13.00000000000000
+	Top:	102.00000000000000
+	Right:	90.00000000000000
+	Bottom:	82.00000000000000
+)
+
+(RectD.207
+	Left:	12.00000000000000
+	Top:	282.00000000000000
+	Right:	382.00000000000000
+	Bottom:	143.00000000000000
+)
+
+(RectD.208
+	Left:	13.00000000000000
+	Top:	146.00000000000000
+	Right:	69.00000000000000
+	Bottom:	127.00000000000000
+)
+
+(Nil.209
+)
+
+(RectD.210
+	Left:	0.47916666666667
+	Top:	4.92708333333333
+	Right:	4.84375000000000
+	Bottom:	1.45833333333333
+)
+
+(SEd.211
+	Name:	"avmscfg.ReadIni"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	212
+	CSMgr:	213
+	DocExts:	214
+	Source:	"\n'====================================\n' READ INI FILE AND RETURN KEY VALUE\n'-----------------------------------\n' Armin Burger\n'====================================\n\n'-------------------------\n' INITIALIZE KERNEL32.DLL\n'-------------------------\nkernel32 = DLL.Make(FileName.FindInSystemSearchPath(\"kernel32.dll\"))\nif (kernel32 = nil) then\n  msgBox.Error(\"Cannot find file kernel32.dll\",\"\")\n  exit\nend  \n\n\n'--------------------------------------\n' GET INPUT PARAMETERS AND GET INI KEY\n'-------------------------
+-------------\n\nhomeVar = system.getEnvVar(\"AVHOME\")\niniFile = homeVar + \"\\etc\\avpmapper.ini\"\nif (iniFile.AsFileName.IsFile.Not) then\n  msgBox.Error(\"Config file  avpgcon.ini not in directory ..\\ARCVIEW\\ETC\", \"INI File Not Found\")\n  return nil\nend  \n\n\n\niniSection  = self.Get(0)\niniKey      = self.Get(1)\n\nkeyValue = String.MakeBuffer(100)\n\niniFName = Filename.Make(iniFile)       '' CHECK FOR INI FILE\nif (File.Exists(iniFName)=FALSE) then\n  msgBox.Error(\"INI file \" + nl+ iniFName.AsString + nl + \"not found. Te
+rminating\",\"\")\n  exit\nend  \n\nReadIni =  DLLProc.Make(kernel32, \"GetPrivateProfileStringA\", \n            #DLLPROC_TYPE_INT32, {#DLLPROC_TYPE_STR, #DLLPROC_TYPE_STR, #DLLPROC_TYPE_STR, #DLLPROC_TYPE_STR, #DLLPROC_TYPE_INT32,   #DLLPROC_TYPE_STR})\n''           returnMsg              SECTION [..]        Key                  \"\"             EmptyInValueStr   Count(EmptyInValueStr)   ini-FileName\n\niniReadVal = ReadIni.Call({iniSection, iniKey, \"\", keyValue, keyValue.Count, iniFName.AsString})   \n\nif (iniReadVal <=
+ 0) then\n  msgBox.Error(\"Section = \" + iniSection + \" or Key = \" + iniKey + \" not found in .INI file\" + nl+ iniFile, \"\")\n  exit \nend\n\nkeyValue = keyValue.Substitute(\"*null*\",\"\")\nreturn keyValue\n"
+)
+
+(DocWin.212
+	Owner:	211
+	X:	80
+	Y:	80
+	W:	726
+	H:	453
+)
+
+(CSMgr.213
+)
+
+(DocAct.214
+	Doc:	211
+)
+
+(SEd.215
+	Name:	"avmscfg.ReConfig.Themes"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	216
+	CSMgr:	217
+	DocExts:	218
+	Source:	"\n' RE-CONFIGURE SELECTED THEMES\n' e.g. after changes to legend\n\n\ntheView = av.GetActiveDoc\ntheThemes = theView.GetThemes\n\nnewThemes = msgBox.MultiListAsString(theThemes, \"Select themes that you want to re-configure.\" + nl+\n                                                \"Note: all manual changes will be lost\", \"Themes to Re-Configure\")\n\nif (newThemes = nil) then exit end\n\nfor each t in newThemes\n  layConfig = av.Run(\"avmscfg.BaseConfig.ReturnThmProp\", t)\n  t.SetObjectTag(layConfig)\nend\n\n"
+)
+
+(DocWin.216
+	Owner:	215
+	X:	95
+	Y:	95
+	W:	365
+	H:	247
+)
+
+(CSMgr.217
+)
+
+(DocAct.218
+	Doc:	215
+)
+
+(SEd.219
+	Name:	"avmscfg.SaveEnableBut"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	220
+	CSMgr:	221
+	DocExts:	222
+	Source:	"\n' CHANGE SCRIPT FOR TEXT BOX\n' is called when user modifies text and thus enables \"Save\" button\n\nmapDlg = av.FindDialog(\"avmscfg.mapDlg\")\nmapDlg.FindByName(\"but_save\").SetEnabled(TRUE)"
+)
+
+(DocWin.220
+	Owner:	219
+	X:	5
+	Y:	5
+)
+
+(CSMgr.221
+)
+
+(DocAct.222
+	Doc:	219
+)
+
+(SEd.223
+	Name:	"avmscfg.SaveParams"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	224
+	CSMgr:	225
+	DocExts:	226
+	Source:	"\n''\n'' SAVE PARAMETERS MODIFIED BY USER BACK TO OBJECT TAGS\n''\n\ntheView = _avmscfg_theView\nmapDlg = av.FindDialog(\"avmscfg.mapDlg\")\nparamTxtBox = mapDlg.FindByName(\"tbx_params\")\n\nif (paramTxtBox.IsEmpty.Not) then\n\n  paramList = _avmscfg_LoadedTag\n  pObj = paramList.Get(0)\n  objIdx = paramList.Get(1)  \n  ''msgBox.Info(objIdx.AsString,\"\")\n\n  '# CHANGE PARAMETERS FOR MAP, WEB, REF, SBAR\n  if (pObj = \"view\") then\n\n    viewOTag = theView.GetObjectTag\n    elemParams = viewOTag.Get(objIdx) \n\n    elemParams.Set(1, 
+paramTxtBox.GetText)\n    viewOTag.Set(objIdx, elemParams) \n\n  '# CHANGE PARAMETERS FOR LAYERS\n  else\n    theLayers = theView.GetThemes\n    curLayer = theLayers.Get(objIdx)\n    layOTag = curLayer.GetObjectTag\n    layOTag.Set(2, paramTxtBox.GetText)\n\n  end\n\n\n  self.SetEnabled(FALSE)\n\n\nend  "
+)
+
+(DocWin.224
+	Owner:	223
+	X:	20
+	Y:	20
+)
+
+(CSMgr.225
+)
+
+(DocAct.226
+	Doc:	223
+)
+
+(SEd.227
+	Name:	"avmscfg.TileIndexShape"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	228
+	CSMgr:	229
+	DocExts:	230
+	Source:	"\n' =======================================================================================\n'  CREATE TILE POLYGONS FROM IMAGE EXTENTS FOR USE IN MAPSERVER\n'\n'  creates tileindex shapes for images\n'  NOTES: for processing JPEGs, the appropriate extension has to be loaded before\n'         for UNIX servers the images have to be accessable by the Win host via SAMBA \n'\n' =======================================================================================\n\n'----------------------\n' GET IMAGES FROM DISK\n'------
+----------------\nimgList = {}\nwhile (TRUE)\n  srcList = SourceDialog.Showclass(\"Select Images\",ImgSrc)\n  if (srcList.Count < 1) then\n    exit\n  end\n\n  for each i in srcList\n    imgPath = i.GetFileName.AsString.Substitute(\"\\\",\"/\")\n    imgList.Add(imgPath)\n  end\n\n  again = MsgBox.YesNo( \"Do you want to add other images?\", \"Add Other Images\", FALSE )  \n  if (not again) then    \n    break  \n  end\nend\n\n'msgBox.multiListAsString(imgList,\"\",\"\")\n\n\n\n'-----------------------------------\n' OUT SHAPE FILE AS TILEINDEX S
+HAPE\n'-----------------------------------\nfileDef = av.GetProject.MakeFileName(\"tileind\", \"shp\")\nmyFileName = FileDialog.Put(fileDef,\"*.shp\",\"Save the new theme\")\nif (myFileName = nil) then\n  exit\nend  \nnewFTab = FTab.MakeNew(myFileName,Polygon)\n\nGrdID = Field.Make(\"ID_NR\", #FIELD_LONG, 10, 0)\ntheLoc = Field.Make(\"Location\", #FIELD_CHAR, 130, 0)\n\nfldList = {}\nfldList.Add(GrdID)\nfldList.Add(theLoc)\n\nnewFTab.SetEditable(TRUE)\nnewFTab.AddFields(fldList)\n\n\n\n'------------------------\n' WRITE TILE POLYGONS\n'-----
+-------------------\n\n''''''''''''''''''''''''unix'''''''''''''''''''''''''''''''''''''''''''''\n'' FOR UNIX SERVERS \nlabels = {\"WIN PATH\", \"UNIX PATH\"}\ndefVals = {imgList.Get(0).Left(3), \"/var/www/mapserver/\"}     '' <=== CHANGE DEFAULT UNIX PATH HERE\naskStr = \"Change paths WIN -> UNIX.  CANCEL for WIN environment.\"\nsubstLst = msgBox.MultiInput(askStr, \"??? win2unix ???\", labels, defVals)\nif (substLst.Count > 1) then \n  isUnix = TRUE \n  winPath = substLst.Get(0)\n  unixPath = substLst.Get(1)\nelse\n  isUnix = F
+ALSE\nend    \n''''''''''''''''''''''''unix'''''''''''''''''''''''''''''''''''''''''''''\n\nid = 1\nfor each img in imgList\n    myTheme = Theme.Make(SrcName.Make(img))\n    if (myTheme = nil) then\n      continue\n    end  \n\n    minX = myTheme.ReturnExtent.GetLeft.SetFormat(\"d.dddd\")   ''.AsString\n    minY = myTheme.ReturnExtent.GetBottom.SetFormat(\"d.dddd\") ''.AsString\n    maxX = myTheme.ReturnExtent.GetRight.SetFormat(\"d.dddd\")  ''.AsString\n    maxY = myTheme.ReturnExtent.GetTop.SetFormat(\"d.dddd\")    ''.AsString
+\n\n    ' POINTS\n       ' 2--3   <== order of points\n       ' |  |\n       ' 1--4\n\n    p1 = Point.Make(minX,minY)\n    p2 = Point.Make(minX,maxY)\n    p3 = Point.Make(maxX,maxY)\n    p4 = Point.Make(maxX,minY)\n\n    ' POLYGON AND ATTRIBUTE VALUES\n    newPoly = Polygon.Make({{p1, p2, p3, p4}})\n\n    n = newFTab.AddRecord\n    newFTab.SetValue(newFTab.FindField(\"Shape\"),n,newPoly)\n\n    newFTab.SetValue(GrdID,n,id)\n    id = id + 1\n\n    if (isUnix = TRUE) then\n      img = img.Substitute(winPath, unixPath)\n    end  \n\n   
+ newFTab.SetValue(theLoc,n,img)\n\nend\n\nnewFTab.SetEditable(FALSE)\nnewFTab.Flush\n\n\n\n\n\n\n\n\n\n\n\n\n"
+)
+
+(DocWin.228
+	Owner:	227
+	X:	35
+	Y:	35
+)
+
+(CSMgr.229
+)
+
+(DocAct.230
+	Doc:	227
+)
+
+(SEd.231
+	Name:	"avmscfg.WriteIni"
+	CreationDate:	"Sunday, December 07, 2003 12:02:42"
+	GUIName:	"Script"
+	Win:	232
+	CSMgr:	233
+	DocExts:	234
+	Source:	"'====================================\n' WRITE NEW KEY TO INI FILE \n'====================================\n\n' takes input \n' * iniFile      as path to .INI file\n' * iniSection   as SECTION [...]\n' * iniKey       as Key\n' * newKeyVal    as the new Key\n\n' outputs\n' * TRUE         if successfull\n\n' SYNTAX\n' retMsg = av.run(\"WriteIni\",{iniFile, iniSection, iniKey, newKeyVal})   ''=> BOOLEAN\n\n'=====================================\n\n'-------------------------\n' INITIALIZE KERNEL32.DLL\n'-------------------------\nker
+nel32 = DLL.Make(FileName.FindInSystemSearchPath(\"kernel32.dll\"))\nif (kernel32 = nil) then\n  msgBox.Error(\"Cannot find file kernel32.dll\",\"\")\n  exit\nend  \n\n\n'--------------------------------------\n' GET INPUT PARAMETERS AND GET INI KEY\n'--------------------------------------\n\niniFile     = self.Get(0)\niniSection  = self.Get(1)\niniKey      = self.Get(2)\nnewKeyVal   = self.Get(3)\n\niniFName = Filename.Make(iniFile)       '' CHECK FOR INI FILE\nif (File.Exists(iniFName)=FALSE) then\n  msgBox.Error(\"INI file \" + n
+l+ iniFName.AsString + nl + \"not found. Terminating\",\"\")\n  exit\nend  \n\nWriteini = DLLProc.Make(kernel32, \"WritePrivateProfileStringA\", \n            #DLLPROC_TYPE_INT32, {#DLLPROC_TYPE_STR, #DLLPROC_TYPE_STR, #DLLPROC_TYPE_STR, #DLLPROC_TYPE_STR})\n''           returnMsg              SECTION [..]        Key                newKeyValue        ini-FileName \n\niniWriteVal = WriteIni.Call({iniSection, iniKey, newKeyVal, iniFName.AsString})\n\nif (iniWriteVal <= 0) then\n  return  FALSE\nelse\n  return  TRUE    \nend\n\n"
+	FontSize:	1
+)
+
+(DocWin.232
+	Owner:	231
+	X:	200
+	Y:	79
+	W:	660
+	H:	521
+)
+
+(CSMgr.233
+)
+
+(DocAct.234
+	Doc:	231
+)
+
+(SEd.235
+	Name:	"avmscfg.WriteMapFile"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	236
+	CSMgr:	237
+	DocExts:	238
+	Source:	"\n'' WRITE VIEW AND THEME PARAMS TO MAP FILE\n'' avmscfg.WriteMapFile\n\n\nmapFileType = self.GetTag\n\n\n\ntheView = _avmscfg_theView\nviewOTag = theView.GetObjectTag\n\n'------------------------\n' MAP FILE HEADER PARAMS\n'------------------------\nmapStr  = viewOTag.Get(1).Get(1)\nwebStr  = viewOTag.Get(2).Get(1)\nrefStr  = viewOTag.Get(3).Get(1)\nsbarStr = viewOTag.Get(4).Get(1)\nlegStr  = \"LEGEND\" + nl + \"END\" + nl\n\n'--------\n' LAYERS\n'--------\nmapDlg = av.FindDialog(\"avmscfg.mapDlg\")\nlayerLBox = mapDlg.FindByName(\"lbx_l
+ayers\")\n\nmapLayers = layerLBox.GetSelection\nif (mapLayers.Count = 0) then\n  mapLayers = layerLBox.GetList\nend\n\nnumLayers = mapLayers.Count\nallLayStr = \"#================== START OF LAYER SECTION =====================#\" +nl\n\nfor each layId in (numLayers -1)..0 by -1\n  mapLay = mapLayers.Get(layId)\n  layStr = mapLay.GetObjectTag.Get(2)\n  allLayStr = allLayStr + layStr + nl \nend  \n\nmapFileStr = mapStr + nl + webStr + nl + refStr + nl + legStr + nl +sbarStr + nl+nl +allLayStr + nl + \"END  #Map\"\n'msgBox.Report(m
+apFileStr,\"\")\n\n\n'------------\n' WRITE FILE\n'------------\n' WRITE MAP FILE FOR USE IN APPLICATION\nif (mapFileType = \"write\") then\n\n  mapFilename = FileDialog.Put(\"pmapper.map\".AsFilename, \"*.map\", \"Save File As...\")\n  if (mapFilename = nil) then \n    return nil \n  end\n\n  txtF = TextFile.Make(mapFilename, #FILE_PERM_WRITE )\n  txtF.Write (mapFileStr, mapFileStr.Count)\n  txtF.Close\n\n\n' WRITE TEST MAP FILE AND LOAD INTO BROWSER\nelse\n\n  webServer = av.Run(\"avmscfg.ReadIni\", {\"SERVER\",\"webserver\"})\n  testpage  = a
+v.Run(\"avmscfg.ReadIni\", {\"SERVER\",\"testpage\"})\n  mapdir    = av.Run(\"avmscfg.ReadIni\", {\"SERVER\",\"mapdir\"})\n\n  mapFilePath = mapdir + \"/pmappertest.map\"\n  mapFilename = mapFilePath.AsFilename\n  txtF = TextFile.Make(mapFilename, #FILE_PERM_WRITE )\n  txtF.Write (mapFileStr, mapFileStr.Count)\n  txtF.Close\n\n  baseURL = webServer + \"/\" + testpage + \"?mapfile=\" + mapFilePath\n  baseURL = baseURL.Substitute(\"//\", \"/\")\n  mapURL = \"http://\" + baseURL \n\n  av.Run(\"avmscfg.Map2Browser\", mapURL)\n\n\n\n\n\n\n\nend\n\n\n"
+)
+
+(DocWin.236
+	Owner:	235
+	X:	191
+	Y:	175
+	W:	874
+	H:	650
+)
+
+(CSMgr.237
+)
+
+(DocAct.238
+	Doc:	235
+)
+
+(SEd.239
+	Name:	"avmscfg_Extension_Install"
+	CreationDate:	"Wednesday, May 08, 1996 11:00:05"
+	GUIName:	"Script"
+	Win:	240
+	CSMgr:	241
+	DocExts:	242
+	Source:	"'DO NOT EDIT!!!\n\nif (av.getproject=nil) then return(nil) end\n\n\ntheDocs = SELF.get(0)\ntheDialogs = SELF.get(1)\ntheControlList = SELF.get(2)\ntheMenuList = SELF.get(3)\ntheToolMenuList=SELF.Get(4)\ntheProject=Av.getproject\n\n\n'Add the Docs\n'\nfor each adoc in theDocs\n theProject.addDoc(adoc)\nend\n\n'Add the Dialogs\n'\nfor each adialog in theDialogs\n theProject.addDialog(adialog)\nend\n\n'Add the Controls\n'\nfor each totalControl in theControlList\n   'The Control list\n   acontrol=totalControl.get(0)\n   \n   'The physical c
+ontrol\n   theControl = totalControl.get(1)\n   \n   'The control Index\n   theCindex=totalControl.get(2)\n\n   'Find the DocGUI\n   theControlDoc=av.getproject.findGUI(aControl.get(0))\n     if (theControlDoc=NIL) then   \n       MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n       return(nil)\n     end\n   \n   'This finds the control set  \n  thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n  thescript1=Script.Make(thecommand)\n  thec
+ontrolset=thescript1.doit(\"\")\n  \n  'Add the control to the control set\n  theControlSet.Add(theControl,theCindex)\nend\n\n\n'Add the menus\nfor each totalcontrol in theMenuList\n  \n   'The Control list\n   acontrol=totalControl.get(0)\n      mDoc=acontrol.get(0)\n      mMenu=acontrol.get(1)\n      mMenuItem=acontrol.get(2)\n\n   'The physical control\n   theControl = totalControl.get(1)\n   \n   'The control Index\n   theCindex=totalControl.get(2)\n\n   'Find the DocGUI\n   theControlDoc=av.getproject.findGUI(aControl.get(0))\n
+     if (theControlDoc=NIL) then   \n       MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n       return(nil)\n     end\n   \n  theMbar=av.getproject.findGUI(mDoc).GetMenuBar\n  themenu=theMbar.findbylabel(mMenu)\n  if (themenu=NiL) then\n      themenu=menu.make\n      themenu.setlabel(mMenu)\n      theMbar.add(themenu,999)\n  end\n  \n  themenu.add(thecontrol, theCindex)\nend\n   \n   \n'Add the Tool Menus\n\nfor each totalControl in theToolMenuList\n   'The Control list\n 
+  acontrol=totalControl.get(0)\n   \n   'The physical control\n   theControl = totalControl.get(1)\n   \n   'The control Index\n   theCindex=totalControl.get(2)\n\n   'Find the DocGUI\n   theControlDoc=av.getproject.findGUI(aControl.get(0))\n     if (theControlDoc=NIL) then   \n       MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n       return(nil)\n     end\n   \n   'This finds the control set  \n  thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontr
+ol.get(1)\n  thescript1=Script.Make(thecommand)\n  thecontrolset=av.getproject.findGUI(aControl.get(0)).GetToolBar\n  \n  'Add the control to the control set\n  theControlSet.Add(theControl,theCindex)\nend\n\n\nav.getproject.setmodified(true)\n\n\n'And the scripts add themselves\n"
+	SearchStr:	"exit"
+	FontSize:	1
+)
+
+(DocWin.240
+	Owner:	239
+	X:	-3
+	Y:	2
+	W:	582
+	H:	383
+)
+
+(CSMgr.241
+)
+
+(DocAct.242
+	Doc:	239
+)
+
+(SEd.243
+	Name:	"avmscfg_Extension_MAKE"
+	CreationDate:	"Wednesday, May 08, 1996 11:00:05"
+	GUIName:	"Script"
+	Win:	244
+	CSMgr:	245
+	DocExts:	246
+	Source:	"' Name:  Extension Builder - Source Code\n'\n' Title: Extension Builder - Source Code\n'\n' Topics:  \n'\n' Description:  \n'\n' Requires:  \n'\n' Self:  \n'\n' Returns:  \n\n\n\n'------------------------------\n 'the Filename of the extension\n '\ntheExtensionFile = \"$AVEXT\\avpmapper.avx\"\n\n'------------------------------\n 'The Name of the extension to be displayed in the\n 'extension dialog\ntheExtensionName = \"AV-p.mapper\"\n\n'------------------------------\n 'The description of the extension to be displayed\n ' in the extension 
+dialog\n \ntheDescription = \"AV-p.mapper is a utility for creating map files for p.mapper application.\"\n\n'------------------------------\n 'The version of the extension\ntheVersion = 1.0\n\n'------------------------------\n 'Install Script\n ' The Script to use to install the extension\n 'NOTE: \"My Extension Install\" is a pre-perpared script for this\nInScriptName=\"avmscfg_Extension_Install\"\n\n'------------------------------\n 'Uninstall Script\n ' The Script to use to uninstall the extension\n 'NOTE: \"My Extension Unins
+tall\" is a pre-perpared script for this\n\nUnScriptName=\"avmscfg_Extension_Uninstall\"\n\n'------------------------------\n 'Any document Names to include\n ' This is a list of any documents to include\n ' e.g. theDocs={\"View1\",\"Layout1\"}\ntheDocs={}\n\n'------------------------------\n 'Controls (Buttons and normal Tools) to include\n 'Controls {GUI name,ControlType,ScriptName}\n 'e.g. TheControlList={{\"View\",\"ButtonBar\",\"View.ZoomIn\"}, {\"View\",\"ToolBar\",\"View.Identify\"}}\nTheControllist={{\"View\",\"ButtonBar\",\"avmscfg.mDl
+g.Open\"},\n                {\"Table\",\"ButtonBar\",\"avmscfg.ImgCat2TileShape\"} \n               }\n\n\n'------------------------------\n 'Tool menus to include\n ' This is a list of which tool menus to include.  Tool menus are specified\n ' by giving a GUI name and a script name of one of the tools in the tool menu\n ' Using this to locate the tool menu ALL other tools inb that menu and \n ' their scripts will be extracted\n ' theToolMenu={{\"View\",\"View.PointTool\"}}\nTheToolMenuList={}\n\n\n'------------------------------\n '
+The Menus to include (a list of menu items listing the doc, the top menu, and the script for the menu item)\n 'The MenuList {Doc name, Main Menu name , menu item Scriptname}\n ' e.g. The MenuList={{\"View\", \"File\", \"View.Export\"}}\nTheMenuList={{\"View\", \"p.mapper\", \"avmscfg.mDlg.Open\"},\n             {\"View\", \"p.mapper\", \"avmscfg.BaseConfig\"},\n             {\"View\", \"p.mapper\", \"avmscfg.ReConfig.Themes\"},\n             {\"View\", \"p.mapper\", \"avmscfg.EditIni\"}, \n             {\"View\", \"p.mapper\", \"avmscfg.TileIndexSh
+ape\"}\n            }\n\n'------------------------------\n 'The scripts to include, not in controls or menus\n 'e.g. theScripts={\"My.Script\",\"View.export\"}\n theScripts={ \"avmscfg.BaseConfig.ReturnThmProp\",\n              \"avmscfg.CheckThemeOTag\",\n              \"avmscfg.CheckViewOTag\",\n              \"avmscfg.ReadIni\",\n              \"avmscfg.WriteIni\",\n              \"avmscfg.Map2Browser\",\n              \"avmscfg.mDlg.ClearBut\",\n              \"avmscfg.mDlg.ShowParams\",\n              \"avmscfg.mDlg.ShowThmParams\",\n     
+         \"avmscfg.SaveEnableBut\",\n              \"avmscfg.SaveParams\",\n              \"avmscfg.WriteMapFile\"        \n             }\n\n\n'------------------------------\n 'The dialogs to include\n 'e.g. theDialogs={\"Dialog Name\"}\ntheDialogs={\"avmscfg.mapDlg\"}\n\n\n'------------------------------\n 'The  Dependencies\ntheDependencies={}\n\n'------------------------------\n' ATTENTION!!!!!!!!!!!!!!!\n' Do NOT alter the script after these lines, the remainer of this script\n' uses the lists you provided above to build the exte
+nsion object.\n'_______________________________________________________________\n'_______________________________________________________________\n'_______________________________________________________________\n'_______________________________________________________________\n'_______________________________________________________________\n'_______________________________________________________________\n'_______________________________________________________________\n'__________________________________________
+_____________________\n'_______________________________________________________________\n\n'Create a total list of the needed scripts\nTheNeeded={}\n\nfor each ControlScript in thecontrolList\n TheNeeded.add(ConTrolScript.get(2))\nend\n\nFor each MenuScript in theMenuList\n theNeeded.add(MenuScript.get(2))\nend\n \ntotalscripts=thescripts.merge(theNeeded)\nTotalScripts.removeduplicates\n \ntheInstall=av.GetProject.FindScript(InscriptName)\nif (theInstall=NIL) then \n  Msgbox.Error(\"The install Script \"+InScriptName+\" was not 
+found\",\"Script not found\")\n  return(nil)\nend\n\ntheUninstall=av.GetProject.FindScript(unscriptName)\nif (theUninstall=NIL) then \n  Msgbox.Error(\"The install Script \"+UnScriptName+\" was not found\",\"Script not found\")\n  return(nil)\nend\n\n\n'Create the extension\n' Extension.Make(ExtensionFile, theExtensionName, InstallScript, UninstallScript, Dependancies_\n\nmyExt = Extension.Make(theExtensionFile.asFilename, \n              theExtensionName,\n              theInstall,\n              theUninstall,              \n       
+       theDependencies)\n\n\n\nTheDocList={}\nTheDialogList={}\nTheTotalControls={}\nThetotalMenus={}\ntheTotalToolMenus={}\n\n' Process the Document List\n'__________________________________________\nfor each aDoc in TheDocs\n  if ((av.getproject.findDoc(aDoc)=\"Null\").NOT) then\n     TheDocList.Add(av.GetProject.FindDoc(aDoc))\n   else\n      MsgBox.Warning(\"The Doc \"+adoc.asstring+\" cannot be found in the current project.\",\"Script Error\")\n      return(nil)\n end\nend\n\n'Add the List of Documents\nMyExt.add(TheDocList)\n\n\n' Pr
+ocess the Dialog List\n'__________________________________________\nfor each aDialog in TheDialogs\n  if ((av.getproject.findDialog(aDialog)=\"Null\").NOT) then\n     TheDialogList.Add(av.GetProject.FindDialog(aDialog))\n   else\n      MsgBox.Warning(\"The Dialog \"+aDialog.asstring+\" cannot be found in the current project.\",\"Script Error\")\n      return(nil)\n end\nend\n\n'Add the List of Documents\nMyExt.add(TheDialogList)\n\n\n\n' Process the control List\n'__________________________________________\n\n'Controls {GUI,ControlTy
+pe,Scriptname}\n'__________________________________________\n'__________________________________________\n'__________________________________________\n\nfor each aControl in TheControlList\n  theControlDoc=av.getproject.findGUI(aControl.get(0))\n    if (theControlDoc=NIL) then   \n      MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Error\")\n      return(nil)\n    end\n  thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n  'msgbox.info(thecomma
+nd,\"\")\n  thescript1=Script.Make(thecommand)\n  thecontrolset=thescript1.doit(\"\")\n  theFoundControl=TheControlSet.FindbyScript(aControl.get(2))\n    if (theFoundControl=NIL) then   \n      MsgBox.Warning(\"No Control found with the script \"+aControl.get(2)+\" in \"+acontrol.get(1),\"Warning\")\n      return(nil)\n    end\n    if (theFoundControl.is(ToolMenu)) then \n      MsgBox.Warning(\"The script \"+aControl.get(2)+\" in \"+acontrol.get(1)+\" is for a tool menu.\",\"Not Supported\")\n      return(nil)\n    end\n         \n  TheT
+otalControls.Add({aControl,thefoundControl,theControlSet.getcontrols.find(thefoundcontrol)})\nend  \n'Add to Ext\nMyExt.add(TheTotalControls)\n\n'__________________________________________\n\n'The MenuList {Doc, Menu, MenuScript}\n'__________________________________________\n'__________________________________________\n'__________________________________________\n\nFor each aMenu in themenulist\n  mDoc=aMenu.get(0)\n  mMenu=aMenu.get(1)\n  mScript=aMenu.get(2)\n  \n  themDoc=av.getproject.findGUI(mDoc)\n  if (themDoc=NIL) th
+en   \n      MsgBox.Warning(\"The GUI \"+mDoc+\" cannot be found in the current project.\",\"Script Error\")\n      return(nil)\n    end\n  theMbar=av.getproject.findGUI(mDoc).GetMenuBar\n  themenu=theMbar.findbylabel(mMenu)\n  if (themenu=NiL) then\n      MsgBox.Warning(\"The menu named \"+mMenu+\" is not here.\",\"Script Error\")\n      return(nil)\n  end\n    \n  themenucontrol=themenu.findbyScript(mScript)\n\n  if (themenucontrol=NiL) then\n      MsgBox.Warning(\"The script \"+mScript+\" not found.\",\"Warning\")\n      return(nil)\n  e
+nd\n  themenuitemidx=themenu.getcontrols.find(themenucontrol)\n  thetotalmenus.add({amenu,theMenuControl,theMenuItemIdx})\n\nend\n\nmyext.add(thetotalmenus)\n  \n'__________________________________________\n\n'Process the Tool Menu List\n'__________________________________________\n'__________________________________________\n'__________________________________________\n \nfor each aControl in TheToolMenuList\n  theControlDoc=av.getproject.findGUI(aControl.get(0))\n    if (theControlDoc=NIL) then   \n      MsgBox.Warning(\"Th
+e GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Error\")\n      return(nil)\n    end\n  thecontrolset=theControlDoc.getToolbar\n  theFoundControl=TheControlSet.FindbyScript(aControl.get(1))\n    if (theFoundControl=NIL) then   \n      MsgBox.Warning(\"No Control found with the script \"+aControl.get(1)+\" in \"+acontrol.get(1),\"Warning\")\n      return(nil)\n    end\n    if (theFoundControl.is(ToolMenu).not) then \n      MsgBox.Warning(\"The script \"+aControl.get(1)+\" is NOT for a tool menu.\",\"Use
+r Error\")\n      return(nil)\n    end        \n  \n  TheTotalToolMenus.Add({aControl,thefoundControl,theControlSet.getcontrols.find(thefoundcontrol)})\nend  \n\nmyext.add(thetotalToolmenus)\n  \n\n'__________________________________________\n\n' Process the Script list\n'__________________________________________\n'__________________________________________\n'__________________________________________\n\nfor each ascript in TotalScripts\n  if ((av.getproject.findscript(ascript)=\"Null\").NOT) then\n     myExt.Add(av.GetProject.
+FindScript(ascript))\n   else\n      MsgBox.Warning(\"The script \"+ascript+\" cannot be found in the current project.\",\"Script Eror\")\n      return(nil)\n end\nend\n \nmyExt.SetAbout(theDescription)\nmyExt.SetExtVersion(theVersion)\nmyExt.Commit"
+	SearchStr:	"exit"
+	FontSize:	1
+)
+
+(DocWin.244
+	Owner:	243
+	X:	284
+	Y:	8
+	W:	591
+	H:	567
+)
+
+(CSMgr.245
+)
+
+(DocAct.246
+	Doc:	243
+)
+
+(SEd.247
+	Name:	"avmscfg_Extension_Uninstall"
+	CreationDate:	"Wednesday, May 08, 1996 11:00:05"
+	GUIName:	"Script"
+	Win:	248
+	CSMgr:	249
+	DocExts:	250
+	Source:	"'DO NOT EDIT!!!\n\n'The SELF is the Extension\n\ntheDocs = SELF.get(0)\ntheDialogs = SELF.get(1)\ntheControlList = SELF.get(2)\ntheMenuList = SELF.get(3)\ntheToolMenuList=SELF.get(4)\ntheProject=Av.getproject\n\n\n'Remove the Docs\n'\nfor each adoc in theDocs\n If (theProject.finddoc(adoc.getname)<>NIL) then \n  theAnswer=msgbox.yesno(\"Remove the Document \"+adoc.getname+\"?\",\"Remove Document?\",TRUE)\n  if (theAnswer=TRUE) then theProject.RemoveDoc(adoc) end\n end\nend\n\n'Remove the Dialogs\n'\nfor each adialog in theDialogs\n  the
+Project.RemoveDialog(adialog.AsString)\nend\n\n'Removethe Controls\n'\nfor each totalControl in theControlList\n   'Get the control list from the Ext\n   acontrol=totalControl.get(0)\n   \n   'Get the physical Control\n   theControl = totalControl.get(1)\n   \n   'Get the Controls Index\n   theCindex=totalControl.get(2)\n\n   'Find the DocGUI for the Control\n   theControlDoc=av.getproject.findGUI(aControl.get(0))\n     if (theControlDoc=NIL) then   \n       MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the 
+current project.\",\"Script Eror\")\n       return(nil)\n     end\n   \n   'This sequence finds the appropiate control set\n   thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n   thescript1=Script.Make(thecommand)\n   thecontrolset=thescript1.doit(\"\")\n\n   'See if the control is in the set , if so remove it\n    if (theControlSet.GetControls.find(theControl)<>NIL) then\n      theControlSet.remove(theControl)\n      if (thecontrol = \"ToolBar\") then\n        theControlSet.selectdefault\n      
+end\n    end\nend\n\n\n'Remove the Menus\n'\nfor each totalcontrol in theMenuList\n  \n   'The Control list\n    acontrol=totalControl.get(0)\n      mDoc=acontrol.get(0)\n      mMenu=acontrol.get(1)\n      mMenuItem=acontrol.get(2)\n\n   'The physical control\n   theControl = totalControl.get(1)\n   \n   'The control Index\n   theCindex=totalControl.get(2)\n\n   'Find the DocGUI\n   theControlDoc=av.getproject.findGUI(aControl.get(0))\n     if (theControlDoc=NIL) then   \n       MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot b
+e found in the current project.\",\"Script Eror\")\n       return(nil)\n     end\n   \n  theMbar=av.getproject.findGUI(mDoc).GetMenuBar\n  themenu=theMbar.findbylabel(mMenu)\n  if (themenu=NiL) then\n       MsgBox.Warning(\"The menu named \"+mMenu+\" is not here.\",\"Script Eror\")\n      'return(nil)\n  else\n  \n    thething=themenu.getcontrols.find(thecontrol)\n    if (thething<>NIL) then \n      themenu.remove(thecontrol) \n    end\n    'msgbox.info(themenu.GetControls.count.asstring,\"\")\n    if (themenu.GetControls.count<1) th
+en\n      theMbar.remove(themenu)\n    end\n  end\nend\n   \nfor each totalControl in theToolMenuList\n   'Get the control list from the Ext\n   acontrol=totalControl.get(0)\n   \n   'Get the physical Control\n   theControl = totalControl.get(1)\n   \n   'Get the Controls Index\n   theCindex=totalControl.get(2)\n\n   'Find the DocGUI for the Control\n   theControlDoc=av.getproject.findGUI(aControl.get(0))\n     if (theControlDoc=NIL) then   \n       MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current pr
+oject.\",\"Script Eror\")\n       return(nil)\n     end\n   \n   'This sequence finds the appropiate control set\n   thecontrolset=av.getproject.findGUI(aControl.get(0)).GetToolBar\n\n \n    'See if the control is in the set , if so remove it\n    if (theControlSet.GetControls.find(theControl)<>NIL) then\n \n      theControlSet.remove(theControl)\n      theControlSet.selectdefault\n    end\n\nend\n   \n\n'And the scripts delete themselves\n\n\nav.getproject.setmodified(true)\n"
+	SearchStr:	"exit"
+	FontSize:	1
+)
+
+(DocWin.248
+	Owner:	247
+	Y:	8
+	W:	574
+	H:	551
+)
+
+(CSMgr.249
+)
+
+(DocAct.250
+	Doc:	247
+)
+
+(SEd.251
+	Name:	"ImgCat2MSTileIndex"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:00"
+	GUIName:	"Script"
+	Win:	252
+	CSMgr:	253
+	DocExts:	254
+	Source:	"\n' TILEINDEX FOR MAPSERVER FROM ESRI IMAGECATALOG\n' Author: Armin Burger\n' Calculates the tileindex shape file from an ESRI \n' image catalog for use in the MapServer map file.\n' Usage: Load dbf/Info table as table in ArcView.  \n' Run the script for this table.\n\n\n'-----------------------------------------\n' INTABLE - INPUT TABLE FOR IMAGE CATALOG\n'-----------------------------------------\ntheInTable = av.GetActiveDoc\ntheInVTab = theInTable.GetVTab\ntheInFields = theInVTab.GetFields\n\ntheLocFld = theInVTab.Find
+Field(\"IMAGE\")\nminXFld = theInVTab.FindField(\"XMIN\")\nminYFld = theInVTab.FindField(\"YMIN\")\nmaxXFld = theInVTab.FindField(\"XMAX\")\nmaxYFld = theInVTab.FindField(\"YMAX\")\n\n'-----------------------------------\n' OUT SHAPE FILE AS TILEINDEX SHAPE\n'-----------------------------------\nfileDef = av.GetProject.MakeFileName(\"tileind\", \"shp\")\nmyFileName = FileDialog.Put(fileDef,\"*.shp\",\"Save the new theme\")\nnewFTab = FTab.MakeNew(myFileName,Polygon)\n\nGrdID = Field.Make(\"ID\", #FIELD_LONG, 10, 0)\ntheLoc = Field.Make(\"Loc
+ation\", #FIELD_CHAR, 100, 0)\n\nfldList = {}\nfldList.Add(GrdID)\nfldList.Add(theLoc)\n\nnewFTab.AddFields(fldList)\n\n\n'------------------------------\n' CALCULATE COORDINATES\n'------------------------------\nid = 1\nfor each rec in theInVTab \n\n   ' POINTS\n       ' 2--3   <== order of points\n       ' |  |\n       ' 1--4\n\n    minX = theInVTab.ReturnValueNumber(minXFld, rec)\n    minY = theInVTab.ReturnValueNumber(minYFld, rec)\n    maxX = theInVTab.ReturnValueNumber(maxXFld, rec)\n    maxY = theInVTab.ReturnValueNumber(ma
+xYFld, rec)\n\n    p1 = Point.Make(minX,minY)\n    p2 = Point.Make(minX,maxY)\n    p3 = Point.Make(maxX,maxY)\n    p4 = Point.Make(maxX,minY)\n\n    ' POLYGON AND ATTRIBUTE VALUES\n    newPoly = Polygon.Make({{p1, p2, p3, p4}})\n\n    n = newFTab.AddRecord\n    newFTab.SetValue(newFTab.FindField(\"Shape\"),n,newPoly)\n\n    newFTab.SetValue(GrdID,n,id)\n    id = id + 1\n\n    newFTab.SetValue(theLoc,n,theInVTab.ReturnValue(theLocFld, rec))\n\nend\n\n\n"
+)
+
+(DocWin.252
+	Owner:	251
+	X:	65
+	Y:	65
+)
+
+(CSMgr.253
+)
+
+(DocAct.254
+	Doc:	251
+)
+
+(SEd.255
+	Name:	"LICENSE"
+	CreationDate:	"Monday, 23 June, 2003 21:02:38"
+	GUIName:	"Script"
+	Win:	256
+	CSMgr:	257
+	DocExts:	258
+	Source:	"'Copyright (c) 2002-2003 Armin Burger\n'\n'Permission is hereby granted, free of charge, to any person obtaining \n'a copy of this software and associated documentation files (the \"Software\"), \n'to deal in the Software without restriction, including without limitation \n'the rights to use, copy, modify, merge, publish, distribute, sublicense, \n'and/or sell copies of the Software, and to permit persons to whom the Software \n'is furnished to do so, subject to the following conditions:\n'\n'The above copyright notic
+e and this permission notice must be included \n'in all copies or substantial portions of the Software and in supporting \n'documentation.\n'\n'THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \n'IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS \n'FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR \n'COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER \n'IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN \n'CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
+	FontSize:	1
+)
+
+(DocWin.256
+	Owner:	255
+	X:	5
+	Y:	5
+	W:	842
+	H:	595
+)
+
+(CSMgr.257
+)
+
+(DocAct.258
+	Doc:	255
+)
+
+(SEd.259
+	Name:	"x_gezAllScripts"
+	CreationDate:	"Thursday, 17 October, 2002 21:37:48"
+	GUIName:	"Script"
+	Win:	260
+	CSMgr:	261
+	DocExts:	262
+	Source:	"fullList = av.GetProject.GetDocs\nScrList0 = {}\nfor each d in fullList\n   if (d.Is(SED)) then\n      ScrList0.Add(d)\n   end\nend   \n'msgBox.ListAsString(ScrList,\"\",\"\")\n\nScrList = msgBox.MultiListAsString(ScrList0, \"\",\"\")\n\nScrString = \"\"\nfor each i in ScrList\n  ScrString = ScrString+\"\"\"\"+i.AsString+\"\"\"\"+\",\"+nl\nend\n\nClipboard.The.Empty\nClipboard.The.Add(ScrString)\nClipboard.The.Update\n\nmsgBox.Report(ScrString,\"\")  \n"
+	FontSize:	1
+)
+
+(DocWin.260
+	Owner:	259
+	X:	20
+	Y:	20
+	W:	365
+	H:	247
+)
+
+(CSMgr.261
+)
+
+(DocAct.262
+	Doc:	259
+)
+
+(SEd.263
+	Name:	"x_scriptscompileall"
+	CreationDate:	"Thursday, 17 October, 2002 21:38:08"
+	GUIName:	"Script"
+	Win:	264
+	CSMgr:	265
+	DocExts:	266
+	Source:	"fullList = av.GetProject.GetDocs\nScrList0 = {}\nfor each d in fullList\n   if (d.Is(SED)) then\n      ScrList0.Add(d)\n   end\nend   \n\nfor each s in ScrList0\n  if (s.IsCompiled.Not) then\n    s.Compile\n  end\nend    "
+	FontSize:	1
+)
+
+(DocWin.264
+	Owner:	263
+	X:	80
+	Y:	80
+	W:	365
+	H:	247
+)
+
+(CSMgr.265
+)
+
+(DocAct.266
+	Doc:	263
+)
+
+(LButn.267
+	HelpTopic:	"New_button"
+	Update:	"Doc.NewUpdate"
+	Label:	"&New"
+	Click:	"Script.New"
+)
+
+(LButn.268
+	HelpTopic:	"Open_button"
+	Update:	"Doc.OpenUpdate"
+	Label:	"&Open"
+	Click:	"Doc.Open"
+)
+
+(LButn.269
+	HelpTopic:	"Run_button"
+	Update:	"Script.ActionUpdate"
+	Label:	"&Run"
+	Click:	"Script.Action"
+)
+
+(FN.270
+	Path:	"$AVEXT/dialog.avx"
+)
+
+(NameDict.271
+)
+
+(NameDict.272
+	Obj:	273
+	Obj:	274
+	Obj:	277
+)
+
+(AVDict.273
+	InternalName:	"Table of Contents Defaults Dialog"
+)
+
+(AVDict.274
+	InternalName:	"Dialog Designer"
+	Key:	275
+	Value:	276
+)
+
+(AVStr.275
+	S:	"IsVisible"
+)
+
+(Bool.276
+	Truth:	1
+)
+
+(AVDict.277
+	InternalName:	"_Thor_"
+	Key:	278
+	Value:	279
+)
+
+(AVStr.278
+	S:	"DLOGS"
+)
+
+(NameDict.279
+)
+
+(DocGUI.280
+	Name:	"View"
+	Type:	"View"
+	Modified:	1
+	Visible:	1
+	MenuBar:	281
+	ButnBar:	406
+	Popups:	449
+	ToolBar:	471
+	NewScript:	"View.New"
+	OpenScript:	"Doc.Open"
+	ActionScript:	"Doc.Action"
+	NewUpdateScript:	"Doc.NewUpdate"
+	OpenUpdateScript:	"Doc.OpenUpdate"
+	ActionUpdateScript:	"Doc.ActionUpdate"
+	Title:	"Views"
+	Icon:	548
+)
+
+(MenuBar.281
+	Child:	282
+	Child:	299
+	Child:	319
+	Child:	342
+	Child:	365
+	Child:	383
+	Child:	395
+	Child:	400
+)
+
+(PMenu.282
+	InternalName:	"File"
+	Child:	283
+	Child:	284
+	Child:	285
+	Child:	286
+	Child:	287
+	Child:	288
+	Child:	289
+	Child:	290
+	Child:	291
+	Child:	292
+	Child:	293
+	Child:	294
+	Child:	295
+	Child:	296
+	Child:	297
+	Child:	298
+	Label:	"&File"
+)
+
+(Choice.283
+	Help:	"Closes the active component"
+	HelpTopic:	"Close"
+	Label:	"&Close"
+	Click:	"Project.CloseDoc"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.284
+	Help:	"Closes all components"
+	HelpTopic:	"Close_All"
+	Label:	"Close &All"
+	Click:	"Project.CloseAll"
+	Shortcut:	"Keys.None"
+)
+
+(Space.285
+)
+
+(Choice.286
+	Help:	"Allows you to specify the current working directory"
+	HelpTopic:	"Set_Working_Directory"
+	Label:	"Set &Working Directory..."
+	Click:	"Project.SetProjectWorkDir"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.287
+	Help:	"Saves the current project"
+	HelpTopic:	"Save_Project"
+	Label:	"&Save Project"
+	Click:	"Project.Save"
+	Shortcut:	"Keys.Ctrl+S"
+)
+
+(Choice.288
+	Help:	"Saves the current project with a new name"
+	HelpTopic:	"Save_Project_As"
+	Label:	"Save Project As..."
+	Click:	"Project.SaveAs"
+	Shortcut:	"Keys.None"
+)
+
+(Space.289
+)
+
+(Choice.290
+	Help:	"Displays the Extensions dialog"
+	HelpTopic:	"Extensions"
+	Label:	"Extensions..."
+	Click:	"Appl.GetExtensionWin"
+	Shortcut:	"Keys.None"
+)
+
+(Space.291
+)
+
+(Choice.292
+	Help:	"Prints the view"
+	HelpTopic:	"Print"
+	Label:	"&Print..."
+	Click:	"View.Print"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.293
+	Help:	"Edits the printer and the printing options"
+	HelpTopic:	"Print_Setup"
+	Label:	"P&rint Setup..."
+	Click:	"Project.PrintSetup"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.294
+	Disabled:	1
+	Help:	"Exports the view"
+	HelpTopic:	"Export"
+	Update:	"View.HasThemesUpdate"
+	Label:	"&Export..."
+	Click:	"View.ExportDisp"
+	Shortcut:	"Keys.None"
+)
+
+(Space.295
+)
+
+(Choice.296
+	Help:	"Displays the dialog box to delete, edit, and copy data sources"
+	HelpTopic:	"Manage_Sources"
+	Label:	"&Manage Data Sources..."
+	Click:	"View.ManageSources"
+	Shortcut:	"Keys.None"
+)
+
+(Space.297
+)
+
+(Choice.298
+	Help:	"Exits ArcView"
+	HelpTopic:	"Exit"
+	Label:	"E&xit"
+	Click:	"Project.Exit"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.299
+	InternalName:	"Edit"
+	Child:	300
+	Child:	301
+	Child:	302
+	Child:	303
+	Child:	304
+	Child:	305
+	Child:	306
+	Child:	307
+	Child:	308
+	Child:	309
+	Child:	310
+	Child:	311
+	Child:	312
+	Child:	313
+	Child:	314
+	Child:	315
+	Child:	316
+	Child:	317
+	Child:	318
+	Label:	"&Edit"
+)
+
+(Choice.300
+	Disabled:	1
+	Help:	"Cuts the active themes to the clipboard"
+	HelpTopic:	"Cut_Themes"
+	Update:	"View.ActiveDeletableThemesUpdate"
+	Label:	"Cut T&hemes"
+	Click:	"View.CutThemes"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.301
+	Disabled:	1
+	Help:	"Copies the active themes to the clipboard"
+	HelpTopic:	"Copy_Themes"
+	Update:	"View.ActiveThemesUpdate"
+	Label:	"Cop&y Themes"
+	Click:	"View.CopyThemes"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.302
+	Disabled:	1
+	Help:	"Removes the active themes from the view"
+	HelpTopic:	"Delete_Themes"
+	Update:	"View.ActiveDeletableThemesUpdate"
+	Label:	"De&lete Themes"
+	Click:	"View.DeleteThemes"
+	Shortcut:	"Keys.None"
+)
+
+(Space.303
+)
+
+(Choice.304
+	Disabled:	1
+	Help:	"Undo the last edit to graphics on a view"
+	HelpTopic:	"Undo_Graphic_Edit_on_a_view"
+	Update:	"View.UndoEditUpdate"
+	Label:	"&Undo Graphic Edit"
+	Click:	"View.UndoEdit"
+	Shortcut:	"Keys.Ctrl+Z"
+)
+
+(Choice.305
+	Disabled:	1
+	Invisible:	1
+	Help:	"Redo the last edit operation on a theme that was undone"
+	HelpTopic:	"Redo_Feature_Edit_on_a_view"
+	Update:	"View.RedoEditUpdate"
+	Label:	"&Redo Feature Edit"
+	Click:	"View.RedoEdit"
+	Shortcut:	"Keys.Ctrl+Y"
+)
+
+(Space.306
+)
+
+(Choice.307
+	Disabled:	1
+	Help:	"Cuts the selected graphics to the clipboard"
+	HelpTopic:	"Cut_Graphics"
+	Update:	"View.CutUpdate"
+	Label:	"Cu&t Graphics"
+	Click:	"View.CutGraphics"
+	Shortcut:	"Keys.Ctrl+X"
+)
+
+(Choice.308
+	Disabled:	1
+	Help:	"Copies the selected graphics to the clipboard"
+	HelpTopic:	"Copy_Graphics"
+	Update:	"View.CopyUpdate"
+	Label:	"&Copy Graphics"
+	Click:	"View.CopyGraphics"
+	Shortcut:	"Keys.Ctrl+C"
+)
+
+(Choice.309
+	Disabled:	1
+	Help:	"Removes the selected graphics from the view"
+	HelpTopic:	"Delete_Graphics"
+	Update:	"View.DeleteUpdate"
+	Label:	"&Delete Graphics"
+	Click:	"View.DeleteGraphics"
+	Shortcut:	"Keys.Del"
+)
+
+(Space.310
+)
+
+(Choice.311
+	Disabled:	1
+	Help:	"Combines the selected polygons"
+	HelpTopic:	"Combine_Graphics"
+	Update:	"View.CombineUpdate"
+	Label:	"Com&bine Graphics"
+	Click:	"View.CombineGraphics"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.312
+	Disabled:	1
+	Help:	"Unions the selected graphics to create a new graphic"
+	HelpTopic:	"Union_Graphics"
+	Update:	"View.UnionUpdate"
+	Label:	"U&nion Graphics"
+	Click:	"View.UnionGraphics"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.313
+	Disabled:	1
+	Help:	"Subtracts one selected polygon from the other selected polygon"
+	HelpTopic:	"Subtract_Graphics"
+	Update:	"View.SubtractUpdate"
+	Label:	"&Subtract Graphics"
+	Click:	"View.SubtractGraphics"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.314
+	Disabled:	1
+	Help:	"Creates a new polygon from the area  of overlap between the selected polygons"
+	HelpTopic:	"Intersect_Graphics"
+	Update:	"View.IntersectUpdate"
+	Label:	"&Intersect Graphics"
+	Click:	"View.IntersectGraphics"
+	Shortcut:	"Keys.None"
+)
+
+(Space.315
+)
+
+(Choice.316
+	Disabled:	1
+	Help:	"Inserts the contents of the clipboard"
+	HelpTopic:	"Paste"
+	Update:	"View.PasteUpdate"
+	Label:	"&Paste"
+	Click:	"View.Paste"
+	Shortcut:	"Keys.Ctrl+V"
+)
+
+(Space.317
+)
+
+(Choice.318
+	Disabled:	1
+	Help:	"Selects all graphics in the view"
+	HelpTopic:	"Select_All_Graphics"
+	Update:	"View.HasGraphicsUpdate"
+	Label:	"Select &All Graphics"
+	Click:	"Graphic.SelectAll"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.319
+	InternalName:	"View"
+	Child:	320
+	Child:	321
+	Child:	322
+	Child:	323
+	Child:	324
+	Child:	325
+	Child:	326
+	Child:	327
+	Child:	328
+	Child:	329
+	Child:	330
+	Child:	331
+	Child:	332
+	Child:	333
+	Child:	334
+	Child:	335
+	Child:	336
+	Child:	337
+	Child:	338
+	Child:	339
+	Child:	340
+	Child:	341
+	Label:	"&View"
+)
+
+(Choice.320
+	Help:	"Displays the dialog box to edit properties of the view"
+	HelpTopic:	"View_Properties"
+	Label:	"&Properties..."
+	Click:	"View.Properties"
+	Shortcut:	"Keys.None"
+)
+
+(Space.321
+)
+
+(Choice.322
+	Help:	"Inserts themes into the view"
+	HelpTopic:	"Add_Theme"
+	Label:	"&Add Theme..."
+	Click:	"View.Add"
+	Shortcut:	"Keys.Ctrl+T"
+)
+
+(Choice.323
+	Disabled:	1
+	Help:	"Displays a dialog box to create a geocoded theme"
+	HelpTopic:	"Geocode_Addresses"
+	Update:	"View.GeocodeUpdate"
+	Label:	"&Geocode Addresses..."
+	Click:	"View.Geocode"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.324
+	Disabled:	1
+	Help:	"Displays a dialog box to create an XY or dynamic segmentation event-based theme "
+	HelpTopic:	"Add_Event_Theme"
+	Update:	"View.AddEventUpdate"
+	Label:	"Add &Event Theme..."
+	Click:	"View.AddEvent"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.325
+	Help:	"Creates a new theme"
+	HelpTopic:	"New_Theme"
+	Label:	"&New Theme..."
+	Click:	"View.NewTheme"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.326
+	Disabled:	1
+	Help:	"Makes all themes visible"
+	HelpTopic:	"Themes_On_Themes_Off"
+	Update:	"View.HasThemesUpdate"
+	Label:	"&Themes On"
+	Click:	"View.ThemesOn"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.327
+	Disabled:	1
+	Help:	"Makes all themes invisible"
+	HelpTopic:	"Themes_On_Themes_Off"
+	Update:	"View.HasThemesUpdate"
+	Label:	"T&hemes Off"
+	Click:	"View.ThemesOff"
+	Shortcut:	"Keys.None"
+)
+
+(Space.328
+)
+
+(Choice.329
+	Disabled:	1
+	Help:	"Create a Layout from the View"
+	HelpTopic:	"Layout_menu_choice"
+	Update:	"View.HasThemesUpdate"
+	Label:	"La&yout..."
+	Click:	"View.Layout"
+	Shortcut:	"Keys.None"
+)
+
+(Space.330
+)
+
+(Choice.331
+	Help:	"Shows a dialog where you can change the style of the TOC"
+	HelpTopic:	"TOC_Defaults"
+	Update:	"TocDefs.ShowUpdate"
+	Label:	"TOC Style..."
+	Click:	"TocDefs.Show"
+	Shortcut:	"Keys.None"
+)
+
+(Space.332
+)
+
+(Choice.333
+	Disabled:	1
+	Help:	"Zooms to the extent of all themes"
+	HelpTopic:	"Zoom_to_Full_Extent"
+	Update:	"View.HasDataUpdate"
+	Label:	"Full E&xtent"
+	Click:	"View.ZoomFullExtent"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.334
+	Disabled:	1
+	Help:	"Zooms in on the center of the display"
+	HelpTopic:	"Zoom_In"
+	Update:	"View.HasDataUpdate"
+	Label:	"Zoom &In"
+	Click:	"View.ZoomIn"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.335
+	Disabled:	1
+	Help:	"Zooms out from the center of the display"
+	HelpTopic:	"Zoom_Out"
+	Update:	"View.HasDataUpdate"
+	Label:	"Zoom &Out"
+	Click:	"View.ZoomOut"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.336
+	Disabled:	1
+	Help:	"Zooms to the extent of active themes"
+	HelpTopic:	"Zoom_to_Active_Theme"
+	Update:	"View.ActiveThemesUpdate"
+	Label:	"&Zoom To Themes"
+	Click:	"View.ZoomToThemes"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.337
+	Disabled:	1
+	Help:	"Zooms to the extent of the selected features"
+	HelpTopic:	"Zoom_to_Selected"
+	Update:	"View.SelectableThemesUpdate"
+	Label:	"Zoom To &Selected"
+	Click:	"View.ZoomToSelected"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.338
+	Disabled:	1
+	Help:	"Goes back to the previous extent you were viewing"
+	HelpTopic:	"Zoom_Previous"
+	Update:	"View.UndoZoomUpdate"
+	Label:	"Zoom Pre&vious"
+	Click:	"View.UndoZoom"
+	Shortcut:	"Keys.None"
+)
+
+(Space.339
+)
+
+(Choice.340
+	Disabled:	1
+	Help:	"Finds features in the active themes using the text you enter"
+	HelpTopic:	"Find"
+	Update:	"View.TabularThemesUpdate"
+	Label:	"&Find..."
+	Click:	"View.Find"
+	Shortcut:	"Keys.Ctrl+F"
+)
+
+(Choice.341
+	Disabled:	1
+	Help:	"Locates an address in the active, matchable theme"
+	HelpTopic:	"Locate_Address"
+	Update:	"View.LocateUpdate"
+	Label:	"&Locate Address..."
+	Click:	"View.Locate"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.342
+	InternalName:	"Theme"
+	Child:	343
+	Child:	344
+	Child:	345
+	Child:	346
+	Child:	347
+	Child:	348
+	Child:	349
+	Child:	350
+	Child:	351
+	Child:	352
+	Child:	353
+	Child:	354
+	Child:	355
+	Child:	356
+	Child:	357
+	Child:	358
+	Child:	359
+	Child:	360
+	Child:	361
+	Child:	362
+	Child:	363
+	Child:	364
+	Label:	"&Theme"
+)
+
+(Choice.343
+	Disabled:	1
+	Help:	"Displays the dialog box to edit properties of the active theme"
+	HelpTopic:	"Theme_Properties"
+	Update:	"View.ActiveThemesUpdate"
+	Label:	"&Properties..."
+	Click:	"View.ThemeProperties"
+	Shortcut:	"Keys.None"
+)
+
+(Space.344
+)
+
+(Choice.345
+	Disabled:	1
+	Help:	"Starts or stops editing of shapefile"
+	HelpTopic:	"Start_Stop_Editing_in_a_view"
+	Update:	"View.ToggleEditingUpdate"
+	Label:	"Start &Editing"
+	Click:	"View.ToggleEditing"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.346
+	Disabled:	1
+	Help:	"Save edits to the source shapefile"
+	HelpTopic:	"Save_edits_theme"
+	Update:	"View.SaveEditsUpdate"
+	Label:	"Save Ed&its"
+	Click:	"View.SaveEdits"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.347
+	Disabled:	1
+	Help:	"Saves edits to a new shapefile"
+	HelpTopic:	"Save_edits_as_theme"
+	Update:	"View.SaveEditsUpdate"
+	Label:	"Save E&dits As..."
+	Click:	"View.SaveEditsAs"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.348
+	Disabled:	1
+	Help:	"Converts a theme to a shapefile"
+	HelpTopic:	"Convert_to_Shapefile"
+	Update:	"View.ExportUpdate"
+	Label:	"Convert to &Shapefile..."
+	Click:	"View.Export"
+	Shortcut:	"Keys.None"
+)
+
+(Space.349
+)
+
+(Choice.350
+	Disabled:	1
+	Help:	"Displays the legends of the active themes"
+	HelpTopic:	"Edit_Legend"
+	Update:	"View.ActiveThemesUpdate"
+	Label:	"Edit &Legend..."
+	Click:	"View.EditLegendClick"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.351
+	Disabled:	1
+	Help:	"Shows or hides the active themes' legends"
+	HelpTopic:	"Hide_show_Legend"
+	Update:	"View.ActiveThemesUpdate"
+	Label:	"&Hide/Show Legend"
+	Click:	"View.ToggleLegend"
+	Shortcut:	"Keys.None"
+)
+
+(Space.352
+)
+
+(Choice.353
+	Disabled:	1
+	Help:	"Displays the Re-match dialog for re-matching addresses"
+	HelpTopic:	"Re_match_Addresses"
+	Update:	"View.EditMatchUpdate"
+	Label:	"&Re-match Addresses..."
+	Click:	"View.EditMatch"
+	Shortcut:	"Keys.None"
+)
+
+(Space.354
+)
+
+(Choice.355
+	Disabled:	1
+	Help:	"Labels features in active, visible themes"
+	HelpTopic:	"Auto_label"
+	Update:	"View.LabelThemesUpdate"
+	Label:	"&Auto-label..."
+	Click:	"View.LabelThemes"
+	Shortcut:	"Keys.Ctrl+L"
+)
+
+(Choice.356
+	Disabled:	1
+	Help:	"Removes any labels from active themes"
+	HelpTopic:	"Remove_Labels"
+	Update:	"View.RemoveThemeLabelsUpdate"
+	Label:	"Rem&ove Labels"
+	Click:	"View.RemoveThemeLabels"
+	Shortcut:	"Keys.Ctrl+R"
+)
+
+(Choice.357
+	Disabled:	1
+	Help:	"Removes the overlapping labels from active themes, if they are still green."
+	HelpTopic:	"Remove_Overlapping_Labels"
+	Update:	"View.RemoveOverlapThemeLabelsUpdate"
+	Label:	"Remove Overlappi&ng Labels"
+	Click:	"View.RemoveOverlapThemeLabels"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.358
+	Disabled:	1
+	Help:	"Converts selected overlapping labels to symbol of selected good label"
+	HelpTopic:	"Convert_Overlapping_Labels"
+	Update:	"View.ConvertOverlapLabelsUpdate"
+	Label:	"&Convert Overlapping Labels"
+	Click:	"View.ConvertOverlapLabels"
+	Shortcut:	"Keys.Ctrl+O"
+)
+
+(Space.359
+)
+
+(Choice.360
+	Disabled:	1
+	Help:	"Opens the tables of the active themes"
+	HelpTopic:	"Open_Theme_Table"
+	Update:	"View.TabularThemesUpdate"
+	Label:	"&Table..."
+	Click:	"View.ShowTable"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.361
+	Disabled:	1
+	Help:	"Displays the Query Builder to select features with a logical expression"
+	HelpTopic:	"Query_Builder"
+	Update:	"View.AttributeThemesUpdate"
+	Label:	"&Query..."
+	Click:	"View.Query"
+	Shortcut:	"Keys.Ctrl+Q"
+)
+
+(Choice.362
+	Disabled:	1
+	Help:	"Selects features in the active themes using another theme's features"
+	HelpTopic:	"Select_By_Theme"
+	Update:	"View.SelectableThemesUpdate"
+	Label:	"Select &By Theme..."
+	Click:	"View.SelectByTheme"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.363
+	Disabled:	1
+	Help:	"Creates buffers around features"
+	HelpTopic:	"Create_Buffer_Choice"
+	Update:	"WizardBuffer.OpenDialogUpdate"
+	Label:	"Create Buffers..."
+	Click:	"WizardBuffer.OpenDialog"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.364
+	Disabled:	1
+	Help:	"Unselects the selected features of all active themes"
+	HelpTopic:	"Clear_Selected_Features"
+	Update:	"View.AttributeThemesUpdate"
+	Label:	"Clear Selected &Features"
+	Click:	"View.ClearSelect"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.365
+	InternalName:	"Graphics"
+	Child:	366
+	Child:	367
+	Child:	368
+	Child:	369
+	Child:	370
+	Child:	371
+	Child:	372
+	Child:	373
+	Child:	374
+	Child:	377
+	Child:	378
+	Child:	379
+	Child:	380
+	Child:	381
+	Child:	382
+	Label:	"&Graphics"
+)
+
+(Choice.366
+	Disabled:	1
+	Help:	"Displays the property editor for the selected graphic"
+	HelpTopic:	"Graphic_Properties"
+	Update:	"Graphic.HasSelectionUpdate"
+	Label:	"&Properties..."
+	Click:	"Graphic.Edit"
+	Shortcut:	"Keys.None"
+)
+
+(Space.367
+)
+
+(Choice.368
+	Help:	"Shows a dialog where you can set the default values for the label and text tools"
+	HelpTopic:	"Default_settings_for_text_and_label_tools"
+	Label:	"&Text and Label Defaults..."
+	Click:	"Graphic.Label Defaults Show"
+	Shortcut:	"Keys.None"
+)
+
+(Space.369
+)
+
+(Choice.370
+	Disabled:	1
+	Help:	"Displays a dialog box to adjust size and position of selected graphic"
+	HelpTopic:	"Size_and_Position"
+	Update:	"Graphic.SingleSelectionUpdate"
+	Label:	"&Size and Position..."
+	Click:	"Graphic.SizePos"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.371
+	Disabled:	1
+	Help:	"Aligns the selected graphics"
+	HelpTopic:	"Align"
+	Update:	"Graphic.HasSelectionUpdate"
+	Label:	"&Align..."
+	Click:	"Graphic.Align"
+	Shortcut:	"Keys.Ctrl+A"
+)
+
+(Space.372
+)
+
+(Choice.373
+	Disabled:	1
+	Help:	"Moves selected graphics in front of other graphics"
+	HelpTopic:	"Bring_to_Front_on_a_view"
+	Update:	"Graphic.HasSelectionUpdate"
+	Label:	"Bring to &Front"
+	Click:	"Graphic.ToFront"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.374
+	Disabled:	1
+	Help:	"Moves selected graphics behind other graphics"
+	HelpTopic:	"Send_to_Back_on_a_view"
+	Update:	"Graphic.HasSelectionUpdate"
+	Label:	"Send to &Back "
+	Click:	"Graphic.ToBack"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.377
+	Disabled:	1
+	Help:	"Groups selected graphics"
+	HelpTopic:	"Group_on_a_view"
+	Update:	"Graphic.GroupUpdate"
+	Label:	"&Group"
+	Click:	"Graphic.Group"
+	Shortcut:	"Keys.Ctrl+G"
+)
+
+(Choice.378
+	Disabled:	1
+	Help:	"Ungroups selected graphics"
+	HelpTopic:	"Ungroup_on_a_view"
+	Update:	"Graphic.UngroupUpdate"
+	Label:	"&Ungroup"
+	Click:	"Graphic.Ungroup"
+	Shortcut:	"Keys.Ctrl+U"
+)
+
+(Space.379
+)
+
+(Choice.380
+	Disabled:	1
+	Help:	"Associates selected graphics with active themes"
+	HelpTopic:	"Attach_Graphics"
+	Update:	"View.AddGraphicsUpdate"
+	Label:	"A&ttach Graphics"
+	Click:	"View.AddGraphics"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.381
+	Disabled:	1
+	Help:	"Removes association between graphics and active themes"
+	HelpTopic:	"Detach_Graphics"
+	Update:	"View.ClearGraphicsUpdate"
+	Label:	"&Detach Graphics"
+	Click:	"View.ClearGraphics"
+	Shortcut:	"Keys.None"
+)
+
+(Space.382
+)
+
+(PMenu.383
+	InternalName:	"Window"
+	Child:	384
+	Child:	385
+	Child:	386
+	Child:	387
+	Child:	388
+	Child:	390
+	Child:	392
+	Child:	393
+	Child:	394
+	Label:	"&Window"
+)
+
+(Choice.384
+	Help:	"Arranges windows as non-overlapping tiles"
+	HelpTopic:	"Tile"
+	Label:	"&Tile"
+	Click:	"Project.Tile"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.385
+	Help:	"Arranges windows"
+	HelpTopic:	"Cascade"
+	Label:	"&Cascade"
+	Click:	"Project.Cascade"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.386
+	Help:	"Arranges iconified windows"
+	HelpTopic:	"Arrange_Icons"
+	Label:	"&Arrange Icons"
+	Click:	"Project.ArrangeIcons"
+	Shortcut:	"Keys.None"
+)
+
+(Space.387
+)
+
+(Choice.388
+	Help:	"Shows the symbol window"
+	HelpTopic:	"Show_Symbol_Window"
+	Label:	"Show Symbol Window..."
+	Click:	"Project.ShowHideSymWin"
+	Shortcut:	"Keys.Ctrl+P"
+)
+
+(Space.390
+	ObjectTag:	391
+	Update:	"WindowMenuUpdate"
+)
+
+(AVStr.391
+	S:	"makedef.apr View.Highway5 Apply View1"
+)
+
+(Choice.392
+	Help:	"Activates makedef.apr"
+	Label:	"&1 makedef.apr"
+	Click:	"WindowActivate"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.393
+	Help:	"Activates View.Highway5 Apply"
+	Label:	"&2 View.Highway5 Apply"
+	Click:	"WindowActivate"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.394
+	Help:	"Activates View1"
+	Label:	"&3 View1"
+	Click:	"WindowActivate"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.395
+	InternalName:	"Help"
+	Child:	396
+	Child:	397
+	Child:	398
+	Child:	399
+	Label:	"&Help"
+)
+
+(Choice.396
+	Help:	"Displays the dialog for browsing and searching ArcView's help system"
+	HelpTopic:	"Help_on_Help_Topics"
+	Label:	"Help &Topics..."
+	Click:	"Project.HelpTopics"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.397
+	Help:	"Provides instructions for how to obtain help from ArcView"
+	HelpTopic:	"Help_on_How_to_Get_Help"
+	Label:	"&How to Get Help..."
+	Click:	"Project.HelpHelp"
+	Shortcut:	"Keys.None"
+)
+
+(Space.398
+)
+
+(Choice.399
+	Help:	"Provides information about ArcView"
+	HelpTopic:	"About"
+	Label:	"&About ArcView..."
+	Click:	"Project.About"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.400
+	Child:	401
+	Child:	402
+	Child:	403
+	Child:	404
+	Child:	405
+	Label:	"p.mapper"
+)
+
+(Choice.401
+	Label:	"MapFile Creator"
+	Click:	"avmscfg.mDlg.Open"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.402
+	Label:	"Base Configuration"
+	Click:	"avmscfg.BaseConfig"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.403
+	Label:	"Re-Configure Theme"
+	Click:	"avmscfg.ReConfig.Themes"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.404
+	Label:	"Edit INI File"
+	Click:	"avmscfg.EditIni"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.405
+	Label:	"Create Tile Shape"
+	Click:	"avmscfg.TileIndexShape"
+	Shortcut:	"Keys.None"
+)
+
+(ButnBar.406
+	Child:	407
+	Child:	409
+	Child:	410
+	Child:	412
+	Child:	413
+	Child:	415
+	Child:	417
+	Child:	419
+	Child:	420
+	Child:	422
+	Child:	424
+	Child:	426
+	Child:	427
+	Child:	429
+	Child:	431
+	Child:	433
+	Child:	435
+	Child:	437
+	Child:	439
+	Child:	440
+	Child:	442
+	Child:	444
+	Child:	445
+	Child:	447
+)
+
+(Butn.407
+	Help:	"Save Project//Saves the current project"
+	HelpTopic:	"Save_Project"
+	Icon:	408
+	Click:	"Project.Save"
+)
+
+(AVIcon.408
+	Name:	"Save"
+	Res:	"Icons.Save"
+
+)
+
+(Space.409
+)
+
+(Butn.410
+	Help:	"Add Theme//Inserts themes into the view"
+	HelpTopic:	"Add_Theme"
+	Icon:	411
+	Click:	"View.Add"
+)
+
+(AVIcon.411
+	Name:	"AddTheme"
+	Res:	"Icons.AddTheme"
+
+)
+
+(Space.412
+)
+
+(Butn.413
+	Disabled:	1
+	Help:	"Theme Properties//Displays the dialog box to edit properties of the active theme"
+	HelpTopic:	"Theme_Properties"
+	Update:	"View.ActiveThemesUpdate"
+	Icon:	414
+	Click:	"View.ThemeProperties"
+)
+
+(AVIcon.414
+	Name:	"Props"
+	Res:	"Icons.Props"
+
+)
+
+(Butn.415
+	Disabled:	1
+	Help:	"Edit Legend//Displays the legends of the active themes"
+	HelpTopic:	"Edit_Legend"
+	Update:	"View.ActiveThemesUpdate"
+	Icon:	416
+	Click:	"View.EditLegendClick"
+)
+
+(AVIcon.416
+	Name:	"Legend"
+	Res:	"Icons.Legend"
+
+)
+
+(Butn.417
+	Disabled:	1
+	Help:	"Open Theme Table//Opens the tables of the active themes"
+	HelpTopic:	"Open_Theme_Table"
+	Update:	"View.TabularThemesUpdate"
+	Icon:	418
+	Click:	"View.ShowTable"
+)
+
+(AVIcon.418
+	Name:	"Table"
+	Res:	"Icons.Table"
+
+)
+
+(Space.419
+)
+
+(Butn.420
+	Disabled:	1
+	Help:	"Find//Finds features in the active themes using the text you enter"
+	HelpTopic:	"Find"
+	Update:	"View.TabularThemesUpdate"
+	Icon:	421
+	Click:	"View.Find"
+)
+
+(AVIcon.421
+	Name:	"Find"
+	Res:	"Icons.Find"
+
+)
+
+(Butn.422
+	Disabled:	1
+	Help:	"Locate Address//Locates an address in the active, matchable theme"
+	HelpTopic:	"Locate_Address"
+	Update:	"View.LocateUpdate"
+	Icon:	423
+	Click:	"View.Locate"
+)
+
+(AVIcon.423
+	Name:	"AddMatch"
+	Res:	"Icons.AddMatch"
+
+)
+
+(Butn.424
+	Disabled:	1
+	Help:	"Query Builder//Displays the Query Builder to select features with a logical expression"
+	HelpTopic:	"Query_Builder"
+	Update:	"View.AttributeThemesUpdate"
+	Icon:	425
+	Click:	"View.Query"
+)
+
+(AVIcon.425
+	Name:	"QueryBuilder"
+	Res:	"Icons.QueryBuilder"
+
+)
+
+(Space.426
+)
+
+(Butn.427
+	Disabled:	1
+	Help:	"Zoom to Full Extent//Zooms to the extent of all themes"
+	HelpTopic:	"Zoom_to_Full_Extent"
+	Update:	"View.HasDataUpdate"
+	Icon:	428
+	Click:	"View.ZoomFullExtent"
+)
+
+(AVIcon.428
+	Name:	"ZoomView"
+	Res:	"Icons.ZoomView"
+
+)
+
+(Butn.429
+	Disabled:	1
+	Help:	"Zoom to Active Theme(s)//Zooms to the extent of active themes"
+	HelpTopic:	"Zoom_to_Active_Theme"
+	Update:	"View.ActiveThemesUpdate"
+	Icon:	430
+	Click:	"View.ZoomToThemes"
+)
+
+(AVIcon.430
+	Name:	"ZoomTheme"
+	Res:	"Icons.ZoomTheme"
+
+)
+
+(Butn.431
+	Disabled:	1
+	Help:	"Zoom to Selected//Zooms to the extent of the selected features"
+	HelpTopic:	"Zoom_to_Selected"
+	Update:	"View.SelectableThemesUpdate"
+	Icon:	432
+	Click:	"View.ZoomToSelected"
+)
+
+(AVIcon.432
+	Name:	"ZoomToSelected"
+	Res:	"Icons.ZoomToSelected"
+
+)
+
+(Butn.433
+	Disabled:	1
+	Help:	"Zoom In//Zooms in on the center of the display"
+	HelpTopic:	"Zoom_In"
+	Update:	"View.HasDataUpdate"
+	Icon:	434
+	Click:	"View.ZoomIn"
+)
+
+(AVIcon.434
+	Name:	"ZoomIn"
+	Res:	"Icons.ZoomIn"
+
+)
+
+(Butn.435
+	Disabled:	1
+	Help:	"Zoom Out//Zooms out from the center of the display"
+	HelpTopic:	"Zoom_Out"
+	Update:	"View.HasDataUpdate"
+	Icon:	436
+	Click:	"View.ZoomOut"
+)
+
+(AVIcon.436
+	Name:	"ZoomOut"
+	Res:	"Icons.ZoomOut"
+
+)
+
+(Butn.437
+	Disabled:	1
+	Help:	"Zoom to Previous Extent//Goes back to the previous extent you were viewing"
+	HelpTopic:	"Zoom_Previous"
+	Update:	"View.UndoZoomUpdate"
+	Icon:	438
+	Click:	"View.UndoZoom"
+)
+
+(AVIcon.438
+	Name:	"ZoomPrevious"
+	Res:	"Icons.ZoomPrevious"
+
+)
+
+(Space.439
+)
+
+(Butn.440
+	Disabled:	1
+	Help:	"Select Features Using Graphic//Selects features in active themes using selected graphics"
+	HelpTopic:	"Select_Features_Using_Graphic"
+	Update:	"View.SpatialSelectUpdate"
+	Icon:	441
+	Click:	"View.SpatialSelect"
+)
+
+(AVIcon.441
+	Name:	"SpatialSelect"
+	Res:	"Icons.SpatialSelect"
+
+)
+
+(Butn.442
+	Disabled:	1
+	Help:	"Clear Selected Features//Unselects the selected features of all active themes"
+	HelpTopic:	"Clear_Selected_Features"
+	Update:	"View.AttributeThemesUpdate"
+	Icon:	443
+	Click:	"View.ClearSelect"
+)
+
+(AVIcon.443
+	Name:	"SelectNone"
+	Res:	"Icons.SelectNone"
+
+)
+
+(Space.444
+)
+
+(Butn.445
+	Help:	"Open MapFile Creator//Open MapFile Creator"
+	Icon:	446
+	Click:	"avmscfg.mDlg.Open"
+)
+
+(AVIcon.446
+	Name:	"M"
+	Res:	"Icons.M"
+
+)
+
+(Butn.447
+	Help:	"Help//Gets help about the next button, tool, or menu choice you click"
+	HelpTopic:	"Help_button"
+	Icon:	448
+	Click:	"Help.Tool"
+)
+
+(AVIcon.448
+	Name:	"HelpTool"
+	Res:	"Icons.HelpTool"
+
+)
+
+(PopupSet.449
+	Child:	450
+)
+
+(Popup.450
+	Child:	451
+	Child:	452
+	Child:	453
+	Child:	454
+	Child:	455
+	Child:	456
+	Child:	457
+	Child:	458
+	Child:	459
+	Child:	460
+	Child:	461
+	Child:	462
+	Child:	463
+	Child:	464
+	Child:	465
+	Child:	466
+	Child:	467
+	Child:	468
+	Child:	469
+	Child:	470
+	Label:	"Menu"
+)
+
+(Choice.451
+	Disabled:	1
+	Invisible:	1
+	Help:	"Deletes the last entered point on the line or polygon being drawn"
+	Update:	"View.DelLastPointUpdate"
+	Label:	"Delete Last Point"
+	Click:	"View.DeleteLastPoint"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.452
+	Disabled:	1
+	Help:	"Undo the last edit to graphics on a view"
+	HelpTopic:	"Undo_Graphic_Edit_on_a_view"
+	Update:	"View.UndoEditUpdate"
+	Label:	"Undo Graphic Edit"
+	Click:	"View.UndoEdit"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.453
+	Disabled:	1
+	Invisible:	1
+	Help:	"Redo the last edit operation on a theme that was undone"
+	Update:	"View.RedoEditUpdate"
+	Label:	"Redo Feature Edit"
+	Click:	"View.RedoEdit"
+	Shortcut:	"Keys.None"
+)
+
+(Space.454
+)
+
+(Choice.455
+	Disabled:	1
+	Invisible:	1
+	Help:	"Turns general snapping on"
+	Update:	"View.ToggleGeneralSnapUpdate"
+	Label:	"Enable General Snapping"
+	Click:	"View.ToggleGeneralSnap"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.456
+	Disabled:	1
+	Invisible:	1
+	Help:	"Turns interactive snapping on"
+	Update:	"View.ToggleInteractiveSnapUpdate"
+	Label:	"Enable Interactive Snapping"
+	Click:	"View.ToggleInteractiveSnap"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.457
+	Help:	"Turns snap tolerance cursor on"
+	Update:	"View.ToggleTolCursorUpdate"
+	Label:	"Show Snap Tolerance Cursor"
+	Click:	"View.ToggleTolCursor"
+	Shortcut:	"Keys.None"
+)
+
+(Space.458
+)
+
+(Choice.459
+	Disabled:	1
+	Invisible:	1
+	Help:	"Snaps the next entered point to the nearest vertex within the user tolerance"
+	Update:	"View.InteractiveSnapUpdate"
+	Label:	"Snap to Vertex"
+	Click:	"View.SnapToVertex"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.460
+	Disabled:	1
+	Invisible:	1
+	Help:	"Snaps the next entered point to the nearest line segment"
+	Update:	"View.InteractiveSnapUpdate"
+	Label:	"Snap to Boundary"
+	Click:	"View.SnapToBoundary"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.461
+	Disabled:	1
+	Invisible:	1
+	Help:	"Snaps the next entered point to the nearest node common to two or more features"
+	Update:	"View.InteractiveSnapUpdate"
+	Label:	"Snap to Intersection"
+	Click:	"View.SnapToIntersection"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.462
+	Disabled:	1
+	Invisible:	1
+	Help:	"Snaps the next entered point to the nearest endpoint of an existing line"
+	Update:	"View.SnapToEndPointUpdate"
+	Label:	"Snap to Endpoint"
+	Click:	"View.SnapToEndPoint"
+	Shortcut:	"Keys.None"
+)
+
+(Space.463
+)
+
+(Choice.464
+	Disabled:	1
+	Help:	"Unselects the selected features in all active themes"
+	Update:	"View.AttributeThemesUpdate"
+	Label:	"Clear Selection"
+	Click:	"View.ClearSelect"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.465
+	Disabled:	1
+	Help:	"Zooms in at point where you click to bring up popup menu"
+	Update:	"View.HasDataUpdate"
+	Label:	"Zoom In"
+	Click:	"View.PopupZoomIn"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.466
+	Disabled:	1
+	Help:	"Zooms out from point where you click to bring up popup menu"
+	Update:	"View.HasDataUpdate"
+	Label:	"Zoom Out"
+	Click:	"View.PopupZoomOut"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.467
+	Disabled:	1
+	Help:	"Zooms to the extent of the selected features"
+	Update:	"View.SelectableThemesUpdate"
+	Label:	"Zoom to Selected"
+	Click:	"View.ZoomToSelected"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.468
+	Disabled:	1
+	Help:	"Centers display on point where you click to bring up popup"
+	Update:	"View.HasDataUpdate"
+	Label:	"Pan"
+	Click:	"View.PopupPan"
+	Shortcut:	"Keys.None"
+)
+
+(Space.469
+)
+
+(Choice.470
+	Disabled:	1
+	Help:	"Opens the shape properties window for editing vertex locations"
+	Update:	"ShapeWin.PopUp Update"
+	Label:	"Shape Properties"
+	Click:	"ShapeWin.PopUp Open"
+	Shortcut:	"Keys.None"
+)
+
+(ToolBar.471
+	Child:	472
+	Child:	474
+	Child:	476
+	Child:	478
+	Child:	480
+	Child:	482
+	Child:	484
+	Child:	486
+	Child:	488
+	Child:	490
+	Child:	492
+	Child:	511
+	Child:	524
+	Child:	543
+)
+
+(Tool.472
+	Disabled:	1
+	Help:	"Identify//Provides information about a feature"
+	HelpTopic:	"Identify_tool"
+	Update:	"View.IdentifyUpdate"
+	Icon:	473
+	Cursor:	"Cursors.ID"
+	Apply:	"View.Identify"
+)
+
+(AVIcon.473
+	Name:	"ID"
+	Res:	"Icons.ID"
+
+)
+
+(Tool.474
+	Disabled:	1
+	Help:	"Pointer//Selects, moves, and resizes graphics"
+	HelpTopic:	"Pointer_tool"
+	Update:	"View.HasDataUpdate"
+	Icon:	475
+	Cursor:	"Cursors.Select"
+	Apply:	"View.Select"
+	Click:	"View.SelectTool"
+)
+
+(AVIcon.475
+	Name:	"Select"
+	Res:	"Icons.Select"
+
+)
+
+(Tool.476
+	Disabled:	1
+	Help:	"Vertex Edit//Adds, moves, and deletes vertices of features and graphics"
+	HelpTopic:	"Vertex_Edit_tool"
+	Update:	"View.SelectToEditUpdate"
+	Icon:	477
+	Cursor:	"Cursors.SelectEdit"
+	Apply:	"View.SelectToEdit"
+	Click:	"View.SelectToEditTool"
+)
+
+(AVIcon.477
+	Name:	"SelectEdit"
+	Res:	"Icons.SelectEdit"
+
+)
+
+(Tool.478
+	Disabled:	1
+	Help:	"Select Feature//Selects features in the active themes by pointing or dragging"
+	HelpTopic:	"Select_Feature_tool"
+	Update:	"View.SelectableThemesUpdate"
+	Icon:	479
+	Cursor:	"Cursors.Default"
+	Apply:	"View.SelectPoint"
+)
+
+(AVIcon.479
+	Name:	"FeatureSelect"
+	Res:	"Icons.FeatureSelect"
+
+)
+
+(Tool.480
+	Disabled:	1
+	Help:	"Zoom In//Zooms in at a point you click or zooms in on a rectangle you drag"
+	HelpTopic:	"Zoom_In_tool"
+	Update:	"View.HasDataUpdate"
+	Icon:	481
+	Cursor:	"Cursors.ZoomIn"
+	Apply:	"View.ZoomInTool"
+)
+
+(AVIcon.481
+	Name:	"ZoomInTool"
+	Res:	"Icons.ZoomInTool"
+
+)
+
+(Tool.482
+	Disabled:	1
+	Help:	"Zoom Out//Zooms out from a point you click or zooms out to include a rectangle you drag"
+	HelpTopic:	"Zoom_Out_tool"
+	Update:	"View.HasDataUpdate"
+	Icon:	483
+	Cursor:	"Cursors.ZoomOut"
+	Apply:	"View.ZoomOutTool"
+)
+
+(AVIcon.483
+	Name:	"ZoomOutTool"
+	Res:	"Icons.ZoomOutTool"
+
+)
+
+(Tool.484
+	Disabled:	1
+	Help:	"Pan//Drags the display in the direction you move the cursor"
+	HelpTopic:	"Pan_tool"
+	Update:	"View.HasDataUpdate"
+	Icon:	485
+	Cursor:	"Cursors.Pan"
+	Apply:	"View.Pan"
+)
+
+(AVIcon.485
+	Name:	"Pan"
+	Res:	"Icons.Pan"
+
+)
+
+(Tool.486
+	Disabled:	1
+	Help:	"Measure//Measures distance"
+	HelpTopic:	"Measure_tool"
+	Update:	"View.HasDataUpdate"
+	Icon:	487
+	Cursor:	"Cursors.Measure"
+	Apply:	"View.Measure"
+)
+
+(AVIcon.487
+	Name:	"Measure"
+	Res:	"Icons.Measure"
+
+)
+
+(Tool.488
+	Disabled:	1
+	Help:	"Hot Link//Follows a hot link in the active themes"
+	HelpTopic:	"Hot_Link_tool"
+	Update:	"View.HotLinkUpdate"
+	Icon:	489
+	Cursor:	"Cursors.Media"
+	Apply:	"View.HotLink"
+)
+
+(AVIcon.489
+	Name:	"Media"
+	Res:	"Icons.Media"
+
+)
+
+(Tool.490
+	Disabled:	1
+	Help:	"Area of Interest//Sets the view's Area Of Interest for library-based themes"
+	HelpTopic:	"Area_Of_Interest_tool"
+	Update:	"View.AOIToolUpdate"
+	Icon:	491
+	Cursor:	"Cursors.Default"
+	Apply:	"View.AOITool"
+)
+
+(AVIcon.491
+	Name:	"AOI"
+	Res:	"Icons.AOI"
+
+)
+
+(ToolMenu.492
+	Disabled:	1
+	Help:	"Label//Labels a feature in the active theme with data from its table"
+	HelpTopic:	"Label_Tool"
+	Update:	"View.LabelToolUpdate"
+	Icon:	493
+	Cursor:	"Cursors.Tag"
+	Apply:	"View.LabelTool"
+	Child:	494
+	Child:	495
+	Child:	497
+	Child:	499
+	Child:	501
+	Child:	503
+	Child:	505
+	Child:	507
+	Child:	509
+)
+
+(AVIcon.493
+	Name:	"Tag"
+	Res:	"Icons.Tag"
+
+)
+
+(Tool.494
+	Disabled:	1
+	Help:	"Label//Labels a feature in the active theme with data from its table"
+	HelpTopic:	"Label_Tool"
+	Update:	"View.LabelToolUpdate"
+	Icon:	493
+	Cursor:	"Cursors.Tag"
+	Apply:	"View.LabelTool"
+)
+
+(Tool.495
+	Disabled:	1
+	Help:	"Callout Label//Click on a feature and drag in the direction you want the label to appear"
+	HelpTopic:	"Label_Tool"
+	Update:	"View.CalloutUpdate"
+	Icon:	496
+	Cursor:	"Cursors.Tag"
+	Apply:	"View.CalloutLabelTool"
+)
+
+(AVIcon.496
+	Name:	"CallOutLabel1"
+	Res:	"Icons.CallOutLabel1"
+
+)
+
+(Tool.497
+	Disabled:	1
+	Help:	"Bullet Leader Label//Click on a feature and drag in the direction you want the label to appear"
+	HelpTopic:	"Label_Tool"
+	Update:	"View.CalloutUpdate"
+	Icon:	498
+	Cursor:	"Cursors.Tag"
+	Apply:	"View.BulletLeaderLabelTool"
+)
+
+(AVIcon.498
+	Name:	"CallOutLabel2"
+	Res:	"Icons.CallOutLabel2"
+
+)
+
+(Tool.499
+	Disabled:	1
+	Help:	"Banner Label//Click on a feature you want to label"
+	HelpTopic:	"Label_Tool"
+	Update:	"View.CalloutUpdate"
+	Icon:	500
+	Cursor:	"Cursors.Tag"
+	Apply:	"View.ShadowBoxLabelTool"
+)
+
+(AVIcon.500
+	Name:	"CallOutLabel3"
+	Res:	"Icons.CallOutLabel3"
+
+)
+
+(Tool.501
+	Disabled:	1
+	Help:	"U.S. Interstate//Click where you want to place a highway shield"
+	HelpTopic:	"Label_Tool"
+	Update:	"View.CalloutUpdate"
+	Icon:	502
+	Cursor:	"Cursors.Tag"
+	Apply:	"View.Highway1 Apply"
+)
+
+(AVIcon.502
+	Name:	"BW US Interstate"
+	Res:	"Icons.BW US Interstate"
+
+)
+
+(Tool.503
+	Disabled:	1
+	Help:	"U.S. Route//Click where you want to place a highway shield"
+	HelpTopic:	"Label_Tool"
+	Update:	"View.CalloutUpdate"
+	Icon:	504
+	Cursor:	"Cursors.Tag"
+	Apply:	"View.Highway2 Apply"
+)
+
+(AVIcon.504
+	Name:	"USRoute"
+	Res:	"Icons.USRoute"
+
+)
+
+(Tool.505
+	Disabled:	1
+	Help:	"Generic State Hwy//Click where you want to place a highway shield"
+	HelpTopic:	"Label_Tool"
+	Update:	"View.CalloutUpdate"
+	Icon:	506
+	Cursor:	"Cursors.Tag"
+	Apply:	"View.Highway3 Apply"
+)
+
+(AVIcon.506
+	Name:	"GenericStateHighway"
+	Res:	"Icons.GenericStateHighway"
+
+)
+
+(Tool.507
+	Disabled:	1
+	Help:	"Generic Square Hwy//Click where you want to place a highway shield"
+	HelpTopic:	"Label_Tool"
+	Update:	"View.CalloutUpdate"
+	Icon:	508
+	Cursor:	"Cursors.Tag"
+	Apply:	"View.Highway4 Apply"
+)
+
+(AVIcon.508
+	Name:	"GenericHighway1"
+	Res:	"Icons.GenericHighway1"
+
+)
+
+(Tool.509
+	Disabled:	1
+	Help:	"Generic Oval Hwy//Click where you want to place a highway shield"
+	Update:	"View.CalloutUpdate"
+	Icon:	510
+	Cursor:	"Cursors.Tag"
+	Apply:	"View.Highway5 Apply"
+)
+
+(AVIcon.510
+	Name:	"GenericHighway2"
+	Res:	"Icons.GenericHighway2"
+
+)
+
+(ToolMenu.511
+	Disabled:	1
+	Help:	"Text//Creates text on the display"
+	HelpTopic:	"Text_tool"
+	Update:	"View.TextToolUpdate"
+	Icon:	512
+	Cursor:	"Cursors.Text"
+	Apply:	"View.TextTool"
+	Click:	"SymWin.DisplayFontPanel"
+	Child:	513
+	Child:	514
+	Child:	516
+	Child:	518
+	Child:	520
+	Child:	522
+)
+
+(AVIcon.512
+	Name:	"Text"
+	Res:	"Icons.Text"
+
+)
+
+(Tool.513
+	Disabled:	1
+	Help:	"Text//Creates text on the display"
+	HelpTopic:	"Text_tool"
+	Update:	"View.TextToolUpdate"
+	Icon:	512
+	Cursor:	"Cursors.Text"
+	Apply:	"View.TextTool"
+	Click:	"SymWin.DisplayFontPanel"
+)
+
+(Tool.514
+	Disabled:	1
+	Help:	"Callout Text//Click and drag to where you want your text to appear, then enter the text"
+	HelpTopic:	"Text_tool"
+	Update:	"View.TextToolUpdate"
+	Icon:	515
+	Cursor:	"Cursors.Bullseye"
+	Apply:	"View.CalloutTextTool"
+)
+
+(AVIcon.515
+	Name:	"CallOutText1"
+	Res:	"Icons.CallOutText1"
+
+)
+
+(Tool.516
+	Disabled:	1
+	Help:	"Bullet Leader Text//Click and drag to where you want your text to appear, then enter the text"
+	HelpTopic:	"Text_tool"
+	Update:	"View.TextToolUpdate"
+	Icon:	517
+	Cursor:	"Cursors.Bullseye"
+	Apply:	"View.BulletLeaderTextTool"
+)
+
+(AVIcon.517
+	Name:	"CallOutText2"
+	Res:	"Icons.CallOutText2"
+
+)
+
+(Tool.518
+	Disabled:	1
+	Help:	"Banner Text//Click where you want your label to appear and enter your text"
+	HelpTopic:	"Text_tool"
+	Update:	"View.TextToolUpdate"
+	Icon:	519
+	Cursor:	"Cursors.Bullseye"
+	Apply:	"View.ShadowBoxTextTool"
+)
+
+(AVIcon.519
+	Name:	"CallOutText3"
+	Res:	"Icons.CallOutText3"
+
+)
+
+(Tool.520
+	Disabled:	1
+	Help:	"Drop-Shadow Text//Click where you want your text to appear and enter your text"
+	HelpTopic:	"Text_tool"
+	Update:	"View.TextToolUpdate"
+	Icon:	521
+	Cursor:	"Cursors.Target"
+	Apply:	"View.CreateDropShadowText"
+)
+
+(AVIcon.521
+	Name:	"DropShadowText"
+	Res:	"Icons.DropShadowText"
+
+)
+
+(Tool.522
+	Help:	"Spline Text//Adds text that is aligned to a splined baseline"
+	HelpTopic:	"Text_tool"
+	Update:	"View.TextToolUpdate"
+	Icon:	523
+	Cursor:	"Cursors.Bullseye"
+	Apply:	"View.SplineText"
+)
+
+(AVIcon.523
+	Name:	"TextAligned"
+	Res:	"Icons.TextAligned"
+
+)
+
+(ToolMenu.524
+	Help:	"Draw Point//Creates a point on the display"
+	HelpTopic:	"Draw_tool"
+	Update:	"View.PointToolUpdate"
+	Icon:	525
+	Cursor:	"Cursors.CrossHair"
+	Apply:	"View.PointTool"
+	Click:	"SymWin.DisplayMarkerPanel"
+	Child:	526
+	Child:	527
+	Child:	529
+	Child:	531
+	Child:	533
+	Child:	535
+	Child:	537
+	Child:	539
+	Child:	541
+)
+
+(AVIcon.525
+	Name:	"Point"
+	Res:	"Icons.Point"
+
+)
+
+(Tool.526
+	Help:	"Draw Point//Creates a point on the display"
+	HelpTopic:	"Draw_tool"
+	Update:	"View.PointToolUpdate"
+	Icon:	525
+	Cursor:	"Cursors.CrossHair"
+	Apply:	"View.PointTool"
+	Click:	"SymWin.DisplayMarkerPanel"
+)
+
+(Tool.527
+	Help:	"Draw Straight Line//Creates a line on the display"
+	HelpTopic:	"Draw_tool"
+	Update:	"View.GraphicToolUpdate"
+	Icon:	528
+	Cursor:	"Cursors.CrossHair"
+	Apply:	"View.LineTool"
+	Click:	"SymWin.DisplayPenPanel"
+)
+
+(AVIcon.528
+	Name:	"SelectLine"
+	Res:	"Icons.SelectLine"
+
+)
+
+(Tool.529
+	Help:	"Draw Line//Creates a line with two or more points on the display"
+	HelpTopic:	"Draw_tool"
+	Update:	"View.PolyLineToolUpdate"
+	Icon:	530
+	Cursor:	"Cursors.CrossHair"
+	Apply:	"View.PolyLineTool"
+	Click:	"SymWin.DisplayPenPanel"
+)
+
+(AVIcon.530
+	Name:	"Lines"
+	Res:	"Icons.Lines"
+
+)
+
+(Tool.531
+	Help:	"Draw Rectangle//Creates a rectangle on the display"
+	HelpTopic:	"Draw_tool"
+	Update:	"View.PolyToolUpdate"
+	Icon:	532
+	Cursor:	"Cursors.CrossHair"
+	Apply:	"View.RectTool"
+	Click:	"SymWin.DisplayFillPanel"
+)
+
+(AVIcon.532
+	Name:	"Rect"
+	Res:	"Icons.Rect"
+
+)
+
+(Tool.533
+	Help:	"Draw Circle//Creates a circle on the display"
+	HelpTopic:	"Draw_tool"
+	Update:	"View.PolyToolUpdate"
+	Icon:	534
+	Cursor:	"Cursors.CrossHair"
+	Apply:	"View.CircleTool"
+	Click:	"SymWin.DisplayFillPanel"
+)
+
+(AVIcon.534
+	Name:	"Disk"
+	Res:	"Icons.Disk"
+
+)
+
+(Tool.535
+	Help:	"Draw Polygon//Creates a polygon on the display"
+	HelpTopic:	"Draw_tool"
+	Update:	"View.PolyToolUpdate"
+	Icon:	536
+	Cursor:	"Cursors.CrossHair"
+	Apply:	"View.PolyTool"
+	Click:	"SymWin.DisplayFillPanel"
+)
+
+(AVIcon.536
+	Name:	"Poly"
+	Res:	"Icons.Poly"
+
+)
+
+(Tool.537
+	Disabled:	1
+	Help:	"Draw Line to Split Feature//Creates a line to split line features"
+	HelpTopic:	"Draw_tool"
+	Update:	"View.SplitLineToolUpdate"
+	Icon:	538
+	Cursor:	"Cursors.CrossHair"
+	Apply:	"View.SplitTool"
+)
+
+(AVIcon.538
+	Name:	"SplitLine"
+	Res:	"Icons.SplitLine"
+
+)
+
+(Tool.539
+	Disabled:	1
+	Help:	"Draw Line to Split Polygon//Creates a line to split polygon features"
+	HelpTopic:	"Draw_tool"
+	Update:	"View.SplitPolyToolUpdate"
+	Icon:	540
+	Cursor:	"Cursors.CrossHair"
+	Apply:	"View.SplitTool"
+)
+
+(AVIcon.540
+	Name:	"SplitPoly"
+	Res:	"Icons.SplitPoly"
+
+)
+
+(Tool.541
+	Disabled:	1
+	Help:	"Draw Line to Append Polygon//Appends a new polygon adjacent to other polygons"
+	HelpTopic:	"Draw_tool"
+	Update:	"View.AutoCompleteUpdate"
+	Icon:	542
+	Cursor:	"Cursors.CrossHair"
+	Apply:	"View.AutoCompleteTool"
+)
+
+(AVIcon.542
+	Name:	"AutoComplete"
+	Res:	"Icons.AutoComplete"
+
+)
+
+(ToolMenu.543
+	Disabled:	1
+	Invisible:	1
+	Help:	"Snap//Sets the general snapping tolerance for the editable theme"
+	HelpTopic:	"Snap_tools"
+	Update:	"View.SnapToolUpdate"
+	Icon:	544
+	Cursor:	"Cursors.Default"
+	Apply:	"View.SnapTool"
+	Child:	545
+	Child:	546
+)
+
+(AVIcon.544
+	Name:	"SnapTool"
+	Res:	"Icons.SnapTool"
+
+)
+
+(Tool.545
+	Disabled:	1
+	Invisible:	1
+	Help:	"Snap//Sets the general snapping tolerance for the editable theme"
+	HelpTopic:	"Snap_tools"
+	Update:	"View.SnapToolUpdate"
+	Icon:	544
+	Cursor:	"Cursors.Default"
+	Apply:	"View.SnapTool"
+)
+
+(Tool.546
+	Disabled:	1
+	Invisible:	1
+	Help:	"Snap//Sets the interactive snapping tolerance for the editable theme"
+	HelpTopic:	"Snap_tools"
+	Update:	"View.InteractiveSnapToolUpdate"
+	Icon:	547
+	Cursor:	"Cursors.Default"
+	Apply:	"View.InteractiveSnapTool"
+)
+
+(AVIcon.547
+	Name:	"SnapFeatureTool"
+	Res:	"Icons.SnapFeatureTool"
+
+)
+
+(AVIcon.548
+	Name:	"Icon"
+	Res:	"View.Icon"
+
+)
+
+(DocGUI.549
+	Name:	"Table"
+	Type:	"Table"
+	Modified:	1
+	Visible:	1
+	MenuBar:	550
+	ButnBar:	623
+	Popups:	668
+	ToolBar:	669
+	NewScript:	"Table.New"
+	OpenScript:	"Doc.Open"
+	ActionScript:	"Table.Action"
+	NewUpdateScript:	"Doc.NewUpdate"
+	OpenUpdateScript:	"Doc.OpenUpdate"
+	ActionUpdateScript:	"Table.ActionUpdate"
+	Title:	"Tables"
+	Icon:	676
+)
+
+(MenuBar.550
+	Child:	551
+	Child:	565
+	Child:	581
+	Child:	599
+	Child:	608
+	Child:	618
+)
+
+(PMenu.551
+	InternalName:	"File"
+	Child:	552
+	Child:	553
+	Child:	554
+	Child:	555
+	Child:	556
+	Child:	557
+	Child:	558
+	Child:	559
+	Child:	560
+	Child:	561
+	Child:	562
+	Child:	563
+	Child:	564
+	Label:	"&File"
+)
+
+(Choice.552
+	Help:	"Closes the active component"
+	HelpTopic:	"Close"
+	Label:	"&Close"
+	Click:	"Project.CloseDoc"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.553
+	Help:	"Closes all components"
+	HelpTopic:	"Close_All"
+	Label:	"Close &All"
+	Click:	"Project.CloseAll"
+	Shortcut:	"Keys.None"
+)
+
+(Space.554
+)
+
+(Choice.555
+	Help:	"Saves the current project"
+	HelpTopic:	"Save_Project"
+	Label:	"&Save Project"
+	Click:	"Project.Save"
+	Shortcut:	"Keys.Ctrl+S"
+)
+
+(Choice.556
+	Help:	"Saves the current project with a new name"
+	HelpTopic:	"Save_Project_As"
+	Label:	"Save Project As..."
+	Click:	"Project.SaveAs"
+	Shortcut:	"Keys.None"
+)
+
+(Space.557
+)
+
+(Choice.558
+	Help:	"Displays the Extensions Dialog"
+	HelpTopic:	"Extensions"
+	Label:	"Extensions..."
+	Click:	"Appl.GetExtensionWin"
+	Shortcut:	"Keys.None"
+)
+
+(Space.559
+)
+
+(Choice.560
+	Help:	"Prints the table"
+	HelpTopic:	"Print"
+	Label:	"&Print..."
+	Click:	"Doc.Print"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.561
+	Help:	"Edits the printer and the printing options"
+	HelpTopic:	"Print_Setup"
+	Update:	"PrintSetupUpdate"
+	Label:	"P&rint Setup..."
+	Click:	"Project.PrintSetup"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.562
+	Help:	"Exports the current table to a dBASE, INFO, or text file"
+	HelpTopic:	"Export_Table"
+	Update:	"Table.ExportUpdate"
+	Label:	"&Export..."
+	Click:	"Table.Export"
+	Shortcut:	"Keys.None"
+)
+
+(Space.563
+)
+
+(Choice.564
+	Help:	"Exits ArcView"
+	HelpTopic:	"Exit"
+	Label:	"E&xit"
+	Click:	"Project.Exit"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.565
+	InternalName:	"Edit"
+	Child:	566
+	Child:	567
+	Child:	568
+	Child:	569
+	Child:	570
+	Child:	571
+	Child:	572
+	Child:	573
+	Child:	574
+	Child:	575
+	Child:	576
+	Child:	577
+	Child:	578
+	Child:	579
+	Child:	580
+	Label:	"&Edit"
+)
+
+(Choice.566
+	Disabled:	1
+	Help:	"Cuts the selected cell to the clipboard"
+	HelpTopic:	"Cut"
+	Update:	"Table.CutUpdate"
+	Label:	"Cu&t"
+	Click:	"Table.Cut"
+	Shortcut:	"Keys.Ctrl+X"
+)
+
+(Choice.567
+	Disabled:	1
+	Help:	"Copies the selected cell to the clipboard"
+	HelpTopic:	"Copy"
+	Update:	"Table.CutUpdate"
+	Label:	"&Copy"
+	Click:	"Table.Copy"
+	Shortcut:	"Keys.Ctrl+C"
+)
+
+(Choice.568
+	Disabled:	1
+	Help:	"Inserts the contents of the Clipboard into the active cell"
+	HelpTopic:	"Paste"
+	Update:	"Table.CutUpdate"
+	Label:	"&Paste"
+	Click:	"Table.Paste"
+	Shortcut:	"Keys.Ctrl+V"
+)
+
+(Space.569
+)
+
+(Choice.570
+	Disabled:	1
+	Help:	"Undo the last edit operation on the Table"
+	HelpTopic:	"Undo_Edit_on_a_table"
+	Update:	"Table.UndoEditUpdate"
+	Label:	"&Undo Edit"
+	Click:	"Table.UndoEdit"
+	Shortcut:	"Keys.Ctrl+Z"
+)
+
+(Choice.571
+	Disabled:	1
+	Help:	"Redo the last undone operation on the Table"
+	HelpTopic:	"Redo_Edit_on_a_table"
+	Update:	"Table.RedoEditUpdate"
+	Label:	"Red&o Edit"
+	Click:	"Table.RedoEdit"
+	Shortcut:	"Keys.Ctrl+Y"
+)
+
+(Space.572
+)
+
+(Choice.573
+	Disabled:	1
+	Help:	"Adds a new field to the table"
+	HelpTopic:	"Add_Field"
+	Update:	"Table.AddFieldUpdate"
+	Label:	"Add &Field..."
+	Click:	"Table.AddField"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.574
+	Disabled:	1
+	Help:	"Adds a new record at the bottom of the table"
+	HelpTopic:	"Add_Record"
+	Update:	"Table.AddRecordUpdate"
+	Label:	"Add &Record"
+	Click:	"Table.AddRecord"
+	Shortcut:	"Keys.Ctrl+A"
+)
+
+(Choice.575
+	Disabled:	1
+	Help:	"Deletes the active field from the table"
+	HelpTopic:	"Delete_Field"
+	Update:	"Table.DeleteFieldUpdate"
+	Label:	"&Delete Field"
+	Click:	"Table.DeleteField"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.576
+	Disabled:	1
+	Help:	"Deletes the selected records from the table"
+	HelpTopic:	"Delete_Records"
+	Update:	"Table.DeleteRecordsUpdate"
+	Label:	"D&elete Records"
+	Click:	"Table.DeleteRecords"
+	Shortcut:	"Keys.None"
+)
+
+(Space.577
+)
+
+(Choice.578
+	Help:	"Selects all records in the table"
+	HelpTopic:	"Select_All"
+	Label:	"Select &All"
+	Click:	"Table.SelectAll"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.579
+	Help:	"Unselects all records in the table"
+	HelpTopic:	"Select_None_in_a_table"
+	Label:	"Select &None"
+	Click:	"Table.UnselectAll"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.580
+	Help:	"Toggles selected and unselected records in the table"
+	HelpTopic:	"Switch_Selection"
+	Label:	"&Switch Selection"
+	Click:	"Table.SwitchSelection"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.581
+	InternalName:	"Table"
+	Child:	582
+	Child:	583
+	Child:	584
+	Child:	585
+	Child:	586
+	Child:	587
+	Child:	588
+	Child:	589
+	Child:	590
+	Child:	591
+	Child:	592
+	Child:	593
+	Child:	594
+	Child:	595
+	Child:	596
+	Child:	597
+	Child:	598
+	Label:	"&Table"
+)
+
+(Choice.582
+	Help:	"Displays the dialog box to edit properties of the table"
+	HelpTopic:	"Table_Properties"
+	Label:	"&Properties..."
+	Click:	"Table.Properties"
+	Shortcut:	"Keys.None"
+)
+
+(Space.583
+)
+
+(Choice.584
+	Help:	"Creates a chart from the table"
+	HelpTopic:	"Create_Chart"
+	Update:	"Table.ChartUpdate"
+	Label:	"&Chart..."
+	Click:	"Table.Chart"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.585
+	Help:	"Starts or stops editing of table values"
+	HelpTopic:	"Start_Stop_Editing"
+	Update:	"Table.ToggleEditingUpdate"
+	Label:	"Start &Editing"
+	Click:	"Table.ToggleEditing"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.586
+	Disabled:	1
+	Help:	"Saves edits to the source file"
+	HelpTopic:	"Save_edits_table"
+	Update:	"Table.SaveEditsUpdate"
+	Label:	"Save Ed&its"
+	Click:	"Table.SaveEdits"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.587
+	Disabled:	1
+	Help:	"Save edits to a new source file"
+	HelpTopic:	"Save_edits_as_table"
+	Update:	"Table.SaveEditsUpdate"
+	Label:	"Save E&dits As..."
+	Click:	"Table.SaveEditsAs"
+	Shortcut:	"Keys.None"
+)
+
+(Space.588
+)
+
+(Choice.589
+	Help:	"Finds the row in the table using the text you enter"
+	HelpTopic:	"Find"
+	Label:	"&Find..."
+	Click:	"Table.Find"
+	Shortcut:	"Keys.Ctrl+F"
+)
+
+(Choice.590
+	Help:	"Displays the Query Builder to select records with a logical expression"
+	HelpTopic:	"Query_Builder"
+	Label:	"&Query..."
+	Click:	"Table.Query"
+	Shortcut:	"Keys.Ctrl+Q"
+)
+
+(Choice.591
+	Disabled:	1
+	Help:	"Promotes selected rows to the top of the table"
+	HelpTopic:	"Promote"
+	Update:	"Table.PromoteUpdate"
+	Label:	"Pr&omote"
+	Click:	"Table.Promote"
+	Shortcut:	"Keys.None"
+)
+
+(Space.592
+)
+
+(Choice.593
+	Disabled:	1
+	Help:	"Appends the fields of another table to the active table based on a common field"
+	HelpTopic:	"Join"
+	Update:	"Table.JoinUpdate"
+	Label:	"&Join"
+	Click:	"Table.Join"
+	Shortcut:	"Keys.Ctrl+J"
+)
+
+(Choice.594
+	Disabled:	1
+	Help:	"Removes any fields joined to the table"
+	HelpTopic:	"Remove_All_Joins"
+	Update:	"Table.HasJoinsUpdate"
+	Label:	"&Remove All Joins"
+	Click:	"Table.RemoveAllJoins"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.595
+	Disabled:	1
+	Help:	"Associates the selection of the active table with another table"
+	HelpTopic:	"Link"
+	Update:	"Table.LinkUpdate"
+	Label:	"&Link"
+	Click:	"Table.Link"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.596
+	Disabled:	1
+	Help:	"Removes the association between the active table and its linked tables"
+	HelpTopic:	"Remove_All_Links"
+	Update:	"Table.HasLinksUpdate"
+	Label:	"Re&move All Links"
+	Click:	"Table.RemoveAllLinks"
+	Shortcut:	"Keys.None"
+)
+
+(Space.597
+)
+
+(Choice.598
+	Help:	"Refreshes the table"
+	HelpTopic:	"Refresh"
+	Label:	"Refres&h"
+	Click:	"Table.Refresh"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.599
+	InternalName:	"Field"
+	Child:	600
+	Child:	601
+	Child:	602
+	Child:	603
+	Child:	604
+	Child:	605
+	Child:	606
+	Child:	607
+	Label:	"F&ield"
+)
+
+(Choice.600
+	Disabled:	1
+	Help:	"Sorts rows in ascending order (A-Z), (0-9)"
+	HelpTopic:	"Sort_table"
+	Update:	"Table.SortUpdate"
+	Label:	"Sort &Ascending"
+	Click:	"Table.SortAscending"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.601
+	Disabled:	1
+	Help:	"Sorts rows in descending order (Z-A), (9-0)"
+	HelpTopic:	"Sort_table"
+	Update:	"Table.SortUpdate"
+	Label:	"Sort &Descending"
+	Click:	"Table.SortDescending"
+	Shortcut:	"Keys.None"
+)
+
+(Space.602
+)
+
+(Choice.603
+	Disabled:	1
+	Help:	"Creates or removes an index on the active field"
+	HelpTopic:	"Create_Remove_Index"
+	Update:	"Table.IndexUpdate"
+	Label:	"Create &Index"
+	Click:	"Table.Index"
+	Shortcut:	"Keys.None"
+)
+
+(Space.604
+)
+
+(Choice.605
+	Disabled:	1
+	Help:	"Creates a summary table grouped by the active field"
+	HelpTopic:	"Summarize"
+	Update:	"Table.SortUpdate"
+	Label:	"&Summarize..."
+	Click:	"Table.Summarize"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.606
+	Disabled:	1
+	Help:	"Calculates the value of a field"
+	HelpTopic:	"Calculate"
+	Update:	"Table.CalculateUpdate"
+	Label:	"&Calculate..."
+	Click:	"Table.Calculate"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.607
+	Disabled:	1
+	Help:	"Generates a report of statistics for data in the active, numeric field"
+	HelpTopic:	"Statistics"
+	Update:	"Table.StatisticsUpdate"
+	Label:	"S&tatistics..."
+	Click:	"Table.Statistics"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.608
+	InternalName:	"Window"
+	Child:	609
+	Child:	610
+	Child:	611
+	Child:	612
+	Child:	613
+	Child:	614
+	Child:	616
+	Child:	617
+	Label:	"&Window"
+)
+
+(Choice.609
+	Help:	"Arranges windows as non-overlapping tiles"
+	HelpTopic:	"Tile"
+	Label:	"&Tile"
+	Click:	"Project.Tile"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.610
+	Help:	"Arranges windows"
+	HelpTopic:	"Cascade"
+	Label:	"&Cascade"
+	Click:	"Project.Cascade"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.611
+	Help:	"Arranges iconified windows"
+	HelpTopic:	"Arrange_Icons"
+	Label:	"&Arrange Icons"
+	Click:	"Project.ArrangeIcons"
+	Shortcut:	"Keys.None"
+)
+
+(Space.612
+)
+
+(Choice.613
+	Help:	"Shows the symbol window"
+	HelpTopic:	"Show_Symbol_Window"
+	Label:	"Show Symbol Window..."
+	Click:	"Project.ShowHideSymWin"
+	Shortcut:	"Keys.Ctrl+P"
+)
+
+(Space.614
+	ObjectTag:	615
+	Update:	"WindowMenuUpdate"
+)
+
+(AVStr.615
+	S:	"Untitled grid.dbf"
+)
+
+(Choice.616
+	Help:	"Activates Untitled"
+	Label:	"&1 Untitled"
+	Click:	"WindowActivate"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.617
+	Help:	"Activates grid.dbf"
+	Label:	"&2 grid.dbf"
+	Click:	"WindowActivate"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.618
+	InternalName:	"Help"
+	Child:	619
+	Child:	620
+	Child:	621
+	Child:	622
+	Label:	"&Help"
+)
+
+(Choice.619
+	Help:	"Displays the dialog for browsing and searching ArcView's help system"
+	HelpTopic:	"Help_on_Help_Topics"
+	Label:	"Help &Topics..."
+	Click:	"Project.HelpTopics"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.620
+	Help:	"Provides instructions for how to obtain help from ArcView"
+	HelpTopic:	"Help_on_How_to_Get_Help"
+	Label:	"&How to Get Help..."
+	Click:	"Project.HelpHelp"
+	Shortcut:	"Keys.None"
+)
+
+(Space.621
+)
+
+(Choice.622
+	Help:	"Provides information about ArcView"
+	HelpTopic:	"About"
+	Label:	"&About ArcView..."
+	Click:	"Project.About"
+	Shortcut:	"Keys.None"
+)
+
+(ButnBar.623
+	Child:	624
+	Child:	626
+	Child:	627
+	Child:	629
+	Child:	631
+	Child:	633
+	Child:	634
+	Child:	636
+	Child:	638
+	Child:	640
+	Child:	641
+	Child:	643
+	Child:	644
+	Child:	646
+	Child:	648
+	Child:	650
+	Child:	651
+	Child:	653
+	Child:	654
+	Child:	656
+	Child:	658
+	Child:	659
+	Child:	661
+	Child:	663
+	Child:	664
+	Child:	666
+)
+
+(Butn.624
+	Help:	"Save Project//Saves the current project"
+	HelpTopic:	"Save_Project"
+	Icon:	625
+	Click:	"Project.Save"
+)
+
+(AVIcon.625
+	Name:	"Save"
+	Res:	"Icons.Save"
+
+)
+
+(Space.626
+)
+
+(Butn.627
+	Disabled:	1
+	Help:	"Cut//Cuts the selected cell to the clipboard"
+	HelpTopic:	"Cut"
+	Update:	"Table.CutUpdate"
+	Icon:	628
+	Click:	"Table.Cut"
+)
+
+(AVIcon.628
+	Name:	"Cut"
+	Res:	"Icons.Cut"
+
+)
+
+(Butn.629
+	Disabled:	1
+	Help:	"Copy//Copies the selected cell to the clipboard"
+	HelpTopic:	"Copy"
+	Update:	"Table.CutUpdate"
+	Icon:	630
+	Click:	"Table.Copy"
+)
+
+(AVIcon.630
+	Name:	"Copy"
+	Res:	"Icons.Copy"
+
+)
+
+(Butn.631
+	Disabled:	1
+	Help:	"Paste//Inserts the contents of the Clipboard into the active cell"
+	HelpTopic:	"Paste"
+	Update:	"Table.CutUpdate"
+	Icon:	632
+	Click:	"Table.Paste"
+)
+
+(AVIcon.632
+	Name:	"Paste"
+	Res:	"Icons.Paste"
+
+)
+
+(Space.633
+)
+
+(Butn.634
+	Help:	"Select All//Selects all records in the table"
+	HelpTopic:	"Select_All"
+	Icon:	635
+	Click:	"Table.SelectAll"
+)
+
+(AVIcon.635
+	Name:	"SelectAll"
+	Res:	"Icons.SelectAll"
+
+)
+
+(Butn.636
+	Help:	"Select None//Unselects all records in the table"
+	HelpTopic:	"Select_None_in_a_table"
+	Icon:	637
+	Click:	"Table.UnselectAll"
+)
+
+(AVIcon.637
+	Name:	"SelectNone"
+	Res:	"Icons.SelectNone"
+
+)
+
+(Butn.638
+	Help:	"Switch Selection//Toggles selected and unselected records in the table"
+	HelpTopic:	"Switch_Selection"
+	Icon:	639
+	Click:	"Table.SwitchSelection"
+)
+
+(AVIcon.639
+	Name:	"SwitchSelect"
+	Res:	"Icons.SwitchSelect"
+
+)
+
+(Space.640
+)
+
+(Butn.641
+	Help:	"Create Chart//Creates a chart from the table"
+	HelpTopic:	"Create_Chart"
+	Update:	"Table.ChartUpdate"
+	Icon:	642
+	Click:	"Table.Chart"
+)
+
+(AVIcon.642
+	Name:	"MakeChart"
+	Res:	"Icons.MakeChart"
+
+)
+
+(Space.643
+)
+
+(Butn.644
+	Help:	"Find//Finds the row in the table using the text you enter"
+	HelpTopic:	"Find"
+	Icon:	645
+	Click:	"Table.Find"
+)
+
+(AVIcon.645
+	Name:	"Find"
+	Res:	"Icons.Find"
+
+)
+
+(Butn.646
+	Help:	"Query Builder//Displays the Query Builder to select records with a logical expression"
+	HelpTopic:	"Query_Builder"
+	Icon:	647
+	Click:	"Table.Query"
+)
+
+(AVIcon.647
+	Name:	"QueryBuilder"
+	Res:	"Icons.QueryBuilder"
+
+)
+
+(Butn.648
+	Disabled:	1
+	Help:	"Promote//Promotes selected rows to the top of the table"
+	HelpTopic:	"Promote"
+	Update:	"Table.PromoteUpdate"
+	Icon:	649
+	Click:	"Table.Promote"
+)
+
+(AVIcon.649
+	Name:	"Promote"
+	Res:	"Icons.Promote"
+
+)
+
+(Space.650
+)
+
+(Butn.651
+	Disabled:	1
+	Help:	"Join//Appends the fields of another table to the active table based on a common field"
+	HelpTopic:	"Join"
+	Update:	"Table.JoinUpdate"
+	Icon:	652
+	Click:	"Table.Join"
+)
+
+(AVIcon.652
+	Name:	"Join"
+	Res:	"Icons.Join"
+
+)
+
+(Space.653
+)
+
+(Butn.654
+	Disabled:	1
+	Help:	"Summarize//Creates a summary table grouped by the active field"
+	HelpTopic:	"Summarize"
+	Update:	"Table.SortUpdate"
+	Icon:	655
+	Click:	"Table.Summarize"
+)
+
+(AVIcon.655
+	Name:	"Summarize"
+	Res:	"Icons.Summarize"
+
+)
+
+(Butn.656
+	Disabled:	1
+	Help:	"Calculate//Calculates the value of a field"
+	HelpTopic:	"Calculate"
+	Update:	"Table.CalculateUpdate"
+	Icon:	657
+	Click:	"Table.Calculate"
+)
+
+(AVIcon.657
+	Name:	"Calculator"
+	Res:	"Icons.Calculator"
+
+)
+
+(Space.658
+)
+
+(Butn.659
+	Disabled:	1
+	Help:	"Sort Ascending//Sorts rows in ascending order (A-Z), (0-9)"
+	HelpTopic:	"Sort_table"
+	Update:	"Table.SortUpdate"
+	Icon:	660
+	Click:	"Table.SortAscending"
+)
+
+(AVIcon.660
+	Name:	"SortAscending"
+	Res:	"Icons.SortAscending"
+
+)
+
+(Butn.661
+	Disabled:	1
+	Help:	"Sort Descending//Sorts rows in descending order (Z-A), (9-0)"
+	HelpTopic:	"Sort_table"
+	Update:	"Table.SortUpdate"
+	Icon:	662
+	Click:	"Table.SortDescending"
+)
+
+(AVIcon.662
+	Name:	"SortDescending"
+	Res:	"Icons.SortDescending"
+
+)
+
+(Space.663
+)
+
+(Butn.664
+	Help:	"Help//Gets help about the next button, tool, or menu choice you click"
+	HelpTopic:	"Help_button"
+	Icon:	665
+	Click:	"Help.Tool"
+)
+
+(AVIcon.665
+	Name:	"HelpTool"
+	Res:	"Icons.HelpTool"
+
+)
+
+(Butn.666
+	Help:	"Convert ImageCatalog to TileShape//Convert ImageCatalog to TileShape"
+	Icon:	667
+	Click:	"avmscfg.ImgCat2TileShape"
+)
+
+(AVIcon.667
+	Name:	"RandomColor"
+	Res:	"Icons.RandomColor"
+
+)
+
+(PopupSet.668
+)
+
+(ToolBar.669
+	Child:	670
+	Child:	672
+	Child:	674
+)
+
+(Tool.670
+	Help:	"Select//Selects records in the table"
+	HelpTopic:	"Select_tool"
+	Icon:	671
+	Cursor:	"Cursors.Default"
+	Apply:	"Table.Select"
+	Click:	"Table.StopEditing"
+)
+
+(AVIcon.671
+	Name:	"Select"
+	Res:	"Icons.Select"
+
+)
+
+(Tool.672
+	Disabled:	1
+	Help:	"Edit//Changes cell values"
+	HelpTopic:	"Edit_tool"
+	Update:	"Table.IsEditableUpdate"
+	Icon:	673
+	Cursor:	"Cursors.Finger"
+	Apply:	"Table.Edit"
+)
+
+(AVIcon.673
+	Name:	"Edit"
+	Res:	"Icons.Edit"
+
+)
+
+(Tool.674
+	Help:	"Identify//Provides information about a record"
+	HelpTopic:	"Identify_tool"
+	Icon:	675
+	Cursor:	"Cursors.ID"
+	Apply:	"Table.Identify"
+	Click:	"Table.StopEditing"
+)
+
+(AVIcon.675
+	Name:	"ID"
+	Res:	"Icons.ID"
+
+)
+
+(AVIcon.676
+	Name:	"Icon"
+	Res:	"Table.Icon"
+
+)
+
+(DocGUI.948
+	Name:	"Script"
+	Type:	"SEd"
+	Modified:	1
+	Visible:	1
+	MenuBar:	949
+	ButnBar:	1011
+	Popups:	1055
+	ToolBar:	1056
+	NewScript:	"Script.New"
+	OpenScript:	"Doc.Open"
+	ActionScript:	"Script.Action"
+	NewUpdateScript:	"Doc.NewUpdate"
+	OpenUpdateScript:	"Doc.OpenUpdate"
+	ActionUpdateScript:	"Script.ActionUpdate"
+	Title:	"Scripts"
+	Icon:	1057
+)
+
+(MenuBar.949
+	Child:	950
+	Child:	963
+	Child:	979
+	Child:	996
+	Child:	1006
+)
+
+(PMenu.950
+	InternalName:	"File"
+	Child:	951
+	Child:	952
+	Child:	953
+	Child:	954
+	Child:	955
+	Child:	956
+	Child:	957
+	Child:	958
+	Child:	959
+	Child:	960
+	Child:	961
+	Child:	962
+	Label:	"&File"
+)
+
+(Choice.951
+	Help:	"Closes the active component"
+	HelpTopic:	"Close"
+	Label:	"&Close"
+	Click:	"Project.CloseDoc"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.952
+	Help:	"Closes all components"
+	HelpTopic:	"Close_All"
+	Label:	"Close &All"
+	Click:	"Project.CloseAll"
+	Shortcut:	"Keys.None"
+)
+
+(Space.953
+)
+
+(Choice.954
+	Help:	"Saves the current project"
+	HelpTopic:	"Save_Project"
+	Label:	"&Save Project"
+	Click:	"Project.Save"
+	Shortcut:	"Keys.Ctrl+S"
+)
+
+(Choice.955
+	Help:	"Saves the current project with a new name"
+	HelpTopic:	"Save_Project_As"
+	Label:	"Save Project As..."
+	Click:	"Project.SaveAs"
+	Shortcut:	"Keys.None"
+)
+
+(Space.956
+)
+
+(Choice.957
+	Help:	"Displays the Extensions Dialog"
+	HelpTopic:	"Extensions"
+	Label:	"Extensions..."
+	Click:	"Appl.GetExtensionWin"
+	Shortcut:	"Keys.None"
+)
+
+(Space.958
+)
+
+(Choice.959
+	Help:	"Prints the script"
+	HelpTopic:	"Print"
+	Label:	"&Print..."
+	Click:	"Doc.Print"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.960
+	Help:	"Edits the printer and the printing options"
+	HelpTopic:	"Print_Setup"
+	Update:	"PrintSetupUpdate"
+	Label:	"P&rint Setup..."
+	Click:	"Project.PrintSetup"
+	Shortcut:	"Keys.None"
+)
+
+(Space.961
+)
+
+(Choice.962
+	Help:	"Exits ArcView"
+	HelpTopic:	"Exit"
+	Label:	"E&xit"
+	Click:	"Project.Exit"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.963
+	InternalName:	"Edit"
+	Child:	964
+	Child:	965
+	Child:	966
+	Child:	967
+	Child:	968
+	Child:	969
+	Child:	970
+	Child:	971
+	Child:	972
+	Child:	973
+	Child:	974
+	Child:	975
+	Child:	976
+	Child:	977
+	Child:	978
+	Label:	"&Edit"
+)
+
+(Choice.964
+	Help:	"Undoes the last change"
+	HelpTopic:	"Undo__Script_"
+	Label:	"&Undo"
+	Click:	"Script.Undo"
+	Shortcut:	"Keys.Ctrl+Z"
+)
+
+(Space.965
+)
+
+(Choice.966
+	Help:	"Finds the selected or specified string"
+	HelpTopic:	"Script_Find"
+	Label:	"&Find..."
+	Click:	"Script.Find"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.967
+	Help:	"Finds the next occurrence of the string"
+	HelpTopic:	"Script_FindNext"
+	Update:	"Script.FindNextUpdate"
+	Label:	"Find &Next"
+	Click:	"Script.FindNext"
+	Shortcut:	"Keys.F3"
+)
+
+(Choice.968
+	Help:	"Replaces the selected or specifed string"
+	HelpTopic:	"Script_Replace"
+	Label:	"Rep&lace..."
+	Click:	"Script.Replace"
+	Shortcut:	"Keys.None"
+)
+
+(Space.969
+)
+
+(Choice.970
+	Disabled:	1
+	Help:	"Cuts the selection and puts it into the clipboard"
+	HelpTopic:	"Cut"
+	Update:	"Script.HasSelUpdate"
+	Label:	"Cu&t"
+	Click:	"Script.Cut"
+	Shortcut:	"Keys.Ctrl+X"
+)
+
+(Choice.971
+	Disabled:	1
+	Help:	"Copies the selection and puts it into the clipboard"
+	HelpTopic:	"Copy"
+	Update:	"Script.HasSelUpdate"
+	Label:	"&Copy"
+	Click:	"Script.Copy"
+	Shortcut:	"Keys.Ctrl+C"
+)
+
+(Choice.972
+	Help:	"Inserts the contents of the clipboard"
+	HelpTopic:	"Paste"
+	Label:	"&Paste"
+	Click:	"Script.Paste"
+	Shortcut:	"Keys.Ctrl+V"
+)
+
+(Space.973
+)
+
+(Choice.974
+	Help:	"Selects all text in the script editor"
+	HelpTopic:	"Select_All_in_a_script"
+	Label:	"Select &All"
+	Click:	"Script.SelectAll"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.975
+	Help:	"Deletes text from the cursor to the left margin"
+	HelpTopic:	"Delete_Left"
+	Label:	"&Delete Left"
+	Click:	"Script.KillLine"
+	Shortcut:	"Keys.Ctrl+U"
+)
+
+(Space.976
+)
+
+(Choice.977
+	Disabled:	1
+	Help:	"Comments selected text"
+	HelpTopic:	"Comment"
+	Update:	"Script.HasSelUpdate"
+	Label:	"C&omment"
+	Click:	"Script.Comment"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.978
+	Disabled:	1
+	Help:	"Uncomments selected text"
+	HelpTopic:	"Remove_Comment"
+	Update:	"Script.HasSelUpdate"
+	Label:	"&Remove Comment"
+	Click:	"Script.Uncomment"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.979
+	InternalName:	"Script"
+	Child:	980
+	Child:	981
+	Child:	982
+	Child:	983
+	Child:	984
+	Child:	985
+	Child:	986
+	Child:	987
+	Child:	988
+	Child:	989
+	Child:	990
+	Child:	991
+	Child:	992
+	Child:	993
+	Child:	994
+	Child:	995
+	Label:	"&Script"
+)
+
+(Choice.980
+	Help:	"Displays the dialog box to edit properties of the script"
+	HelpTopic:	"Script_Properties"
+	Label:	"&Properties..."
+	Click:	"Script.Properties"
+	Shortcut:	"Keys.None"
+)
+
+(Space.981
+)
+
+(Choice.982
+	Disabled:	1
+	Help:	"Compiles the script"
+	HelpTopic:	"Compile"
+	Update:	"Script.CompileUpdate"
+	Label:	"&Compile"
+	Click:	"Script.Compile"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.983
+	Help:	"Executes one request or object reference in the compiled script"
+	HelpTopic:	"Step"
+	Update:	"Script.RunUpdate"
+	Label:	"&Step"
+	Click:	"Script.Step"
+	Shortcut:	"Keys.F8"
+)
+
+(Choice.984
+	Help:	"Runs the compiled script"
+	HelpTopic:	"Run"
+	Update:	"Script.RunUpdate"
+	Label:	"&Run"
+	Click:	"Script.Run"
+	Shortcut:	"Keys.F5"
+)
+
+(Space.985
+)
+
+(Choice.986
+	Help:	"Toggles a breakpoint on or off at the current cursor position"
+	HelpTopic:	"Toggle_Breakpoint"
+	Update:	"Script.RunUpdate"
+	Label:	"Toggle &Breakpoint"
+	Click:	"Script.ToggleBreak"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.987
+	Help:	"Clears all breakpoints"
+	HelpTopic:	"Clear_All_Breakpoints"
+	Update:	"Script.RunUpdate"
+	Label:	"Clear &All Breakpoints"
+	Click:	"Script.ClearAllBreaks"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.988
+	Help:	"Displays the current value of local and global variables"
+	HelpTopic:	"Examine_Variables"
+	Update:	"Script.RunUpdate"
+	Label:	"E&xamine Variables..."
+	Click:	"Script.ShowVariables"
+	Shortcut:	"Keys.Ctrl+E"
+)
+
+(Space.989
+)
+
+(Choice.990
+	Help:	"Inserts the source code of a system script"
+	HelpTopic:	"Load_System_Script"
+	Label:	"&Load System Script..."
+	Click:	"Script.SystemLoad"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.991
+	Help:	"Inserts the contents of a text file"
+	HelpTopic:	"Load_Text_File"
+	Label:	"Load &Text File..."
+	Click:	"Script.FileLoad"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.992
+	Help:	"Writes the entire script or the selected text to a text file"
+	HelpTopic:	"Write_Text_File"
+	Label:	"&Write Text File..."
+	Click:	"Script.FileWrite"
+	Shortcut:	"Keys.None"
+)
+
+(Space.993
+)
+
+(Choice.994
+	Help:	"Embeds the script in the project and deletes its window"
+	HelpTopic:	"Embed_Script"
+	Update:	"Script.RunUpdate"
+	Label:	"&Embed Script"
+	Click:	"Script.Embed"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.995
+	Disabled:	1
+	Help:	"Removes specified script from embedded scripts and puts it in a SEd"
+	HelpTopic:	"Script_Unembed"
+	Update:	"Script.UnembedUpdate"
+	Label:	"&Unembed Script..."
+	Click:	"Script.Unembed"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.996
+	InternalName:	"Window"
+	Child:	997
+	Child:	998
+	Child:	999
+	Child:	1000
+	Child:	1001
+	Child:	1002
+	Child:	1004
+	Child:	1005
+	Label:	"&Window"
+)
+
+(Choice.997
+	Help:	"Arranges windows as non-overlapping tiles"
+	HelpTopic:	"Tile"
+	Label:	"&Tile"
+	Click:	"Project.Tile"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.998
+	Help:	"Arranges windows"
+	HelpTopic:	"Cascade"
+	Label:	"&Cascade"
+	Click:	"Project.Cascade"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.999
+	Help:	"Arranges iconified windows"
+	HelpTopic:	"Arrange_Icons"
+	Label:	"&Arrange Icons"
+	Click:	"Project.ArrangeIcons"
+	Shortcut:	"Keys.None"
+)
+
+(Space.1000
+)
+
+(Choice.1001
+	Help:	"Shows the symbol window"
+	HelpTopic:	"Show_Symbol_Window"
+	Label:	"Show Symbol Window..."
+	Click:	"Project.ShowHideSymWin"
+	Shortcut:	"Keys.Ctrl+P"
+)
+
+(Space.1002
+	ObjectTag:	1003
+	Update:	"WindowMenuUpdate"
+)
+
+(AVStr.1003
+	S:	"avpmapper.apr avmscfg.BaseConfig"
+)
+
+(Choice.1004
+	Help:	"Activates avpmapper.apr"
+	Label:	"&1 avpmapper.apr"
+	Click:	"WindowActivate"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.1005
+	Help:	"Activates avmscfg.BaseConfig"
+	Label:	"&2 avmscfg.BaseConfig"
+	Click:	"WindowActivate"
+	Shortcut:	"Keys.None"
+)
+
+(PMenu.1006
+	InternalName:	"Help"
+	Child:	1007
+	Child:	1008
+	Child:	1009
+	Child:	1010
+	Label:	"&Help"
+)
+
+(Choice.1007
+	Help:	"Displays the dialog for browsing and searching ArcView's help system"
+	HelpTopic:	"Help_on_Help_Topics"
+	Label:	"Help &Topics..."
+	Click:	"Project.HelpTopics"
+	Shortcut:	"Keys.None"
+)
+
+(Choice.1008
+	Help:	"Provides instructions for how to obtain help from ArcView"
+	HelpTopic:	"Help_on_How_to_Get_Help"
+	Label:	"&How to Get Help"
+	Click:	"Project.HelpHelp"
+	Shortcut:	"Keys.None"
+)
+
+(Space.1009
+)
+
+(Choice.1010
+	Help:	"Provides information about ArcView"
+	HelpTopic:	"About"
+	Label:	"&About ArcView..."
+	Click:	"Project.About"
+	Shortcut:	"Keys.None"
+)
+
+(ButnBar.1011
+	Child:	1012
+	Child:	1014
+	Child:	1015
+	Child:	1017
+	Child:	1019
+	Child:	1021
+	Child:	1022
+	Child:	1024
+	Child:	1025
+	Child:	1027
+	Child:	1029
+	Child:	1030
+	Child:	1032
+	Child:	1034
+	Child:	1036
+	Child:	1038
+	Child:	1040
+	Child:	1041
+	Child:	1043
+	Child:	1045
+	Child:	1047
+	Child:	1048
+	Child:	1050
+	Child:	1051
+	Child:	1053
+)
+
+(Butn.1012
+	Help:	"Save Project//Saves the current project"
+	HelpTopic:	"Save_Project"
+	Icon:	1013
+	Click:	"Project.Save"
+)
+
+(AVIcon.1013
+	Name:	"Save"
+	Res:	"Icons.Save"
+
+)
+
+(Space.1014
+)
+
+(Butn.1015
+	Disabled:	1
+	Help:	"Cut//Cuts the selection and puts it into the clipboard"
+	HelpTopic:	"Cut"
+	Update:	"Script.HasSelUpdate"
+	Icon:	1016
+	Click:	"Script.Cut"
+)
+
+(AVIcon.1016
+	Name:	"Cut"
+	Res:	"Icons.Cut"
+
+)
+
+(Butn.1017
+	Disabled:	1
+	Help:	"Copy//Copies the selection and puts it into the clipboard"
+	HelpTopic:	"Copy"
+	Update:	"Script.HasSelUpdate"
+	Icon:	1018
+	Click:	"Script.Copy"
+)
+
+(AVIcon.1018
+	Name:	"Copy"
+	Res:	"Icons.Copy"
+
+)
+
+(Butn.1019
+	Help:	"Paste//Inserts the contents of the clipboard"
+	HelpTopic:	"Paste"
+	Icon:	1020
+	Click:	"Script.Paste"
+)
+
+(AVIcon.1020
+	Name:	"Paste"
+	Res:	"Icons.Paste"
+
+)
+
+(Space.1021
+)
+
+(Butn.1022
+	Help:	"Undo//Undoes the last modification to the script editor text"
+	HelpTopic:	"Undo__Script_"
+	Icon:	1023
+	Click:	"Script.Undo"
+)
+
+(AVIcon.1023
+	Name:	"Undo"
+	Res:	"Icons.Undo"
+
+)
+
+(Space.1024
+)
+
+(Butn.1025
+	Help:	"Shift Lines Left//Shifts selected lines or current line two spaces to the left"
+	HelpTopic:	"Shift_lines_left_or_right"
+	Icon:	1026
+	Click:	"Script.ShiftLeft"
+)
+
+(AVIcon.1026
+	Name:	"ShiftLeft"
+	Res:	"Icons.ShiftLeft"
+
+)
+
+(Butn.1027
+	Help:	"Shift Lines Right//Shifts selected lines or current line two spaces to the right"
+	HelpTopic:	"Shift_lines_left_or_right"
+	Icon:	1028
+	Click:	"Script.ShiftRight"
+)
+
+(AVIcon.1028
+	Name:	"ShiftRight"
+	Res:	"Icons.ShiftRight"
+
+)
+
+(Space.1029
+)
+
+(Butn.1030
+	Disabled:	1
+	Help:	"Compile//Compiles the script"
+	HelpTopic:	"Compile"
+	Update:	"Script.CompileUpdate"
+	Icon:	1031
+	Click:	"Script.Compile"
+)
+
+(AVIcon.1031
+	Name:	"Check"
+	Res:	"Icons.Check"
+
+)
+
+(Butn.1032
+	Help:	"Run//Runs the compiled script"
+	HelpTopic:	"Run"
+	Update:	"Script.RunUpdate"
+	Icon:	1033
+	Click:	"Script.Run"
+)
+
+(AVIcon.1033
+	Name:	"Run"
+	Res:	"Icons.Run"
+
+)
+
+(Butn.1034
+	Help:	"Step//Executes one request or object reference in the compiled script"
+	HelpTopic:	"Step"
+	Update:	"Script.RunUpdate"
+	Icon:	1035
+	Click:	"Script.Step"
+)
+
+(AVIcon.1035
+	Name:	"Footprints"
+	Res:	"Icons.Footprints"
+
+)
+
+(Butn.1036
+	Help:	"Toggle Breakpoint//Toggles a breakpoint on or off at the current cursor position"
+	HelpTopic:	"Toggle_Breakpoint"
+	Update:	"Script.RunUpdate"
+	Icon:	1037
+	Click:	"Script.ToggleBreak"
+)
+
+(AVIcon.1037
+	Name:	"Hand"
+	Res:	"Icons.Hand"
+
+)
+
+(Butn.1038
+	Help:	"Examine Variables//Displays the current value of local and global variables"
+	HelpTopic:	"Examine_Variables"
+	Update:	"Script.RunUpdate"
+	Icon:	1039
+	Click:	"Script.ShowVariables"
+)
+
+(AVIcon.1039
+	Name:	"Examine"
+	Res:	"Icons.Examine"
+
+)
+
+(Space.1040
+)
+
+(Butn.1041
+	Help:	"Load System Script//Inserts the source code of a system script"
+	HelpTopic:	"Load_System_Script"
+	Icon:	1042
+	Click:	"Script.SystemLoad"
+)
+
+(AVIcon.1042
+	Name:	"LoadScript"
+	Res:	"Icons.LoadScript"
+
+)
+
+(Butn.1043
+	Help:	"Load Text File//Inserts the contents of a text file"
+	HelpTopic:	"Load_Text_File"
+	Icon:	1044
+	Click:	"Script.FileLoad"
+)
+
+(AVIcon.1044
+	Name:	"Open"
+	Res:	"Icons.Open"
+
+)
+
+(Butn.1045
+	Help:	"Write Text File//Writes the entire script or the selected text to a text file"
+	HelpTopic:	"Write_Text_File"
+	Icon:	1046
+	Click:	"Script.FileWrite"
+)
+
+(AVIcon.1046
+	Name:	"Write"
+	Res:	"Icons.Write"
+
+)
+
+(Space.1047
+)
+
+(Butn.1048
+	Icon:	1049
+	Click:	"x_scriptscompileall"
+)
+
+(AVIcon.1049
+	Name:	"C"
+	Res:	"Icons.C"
+
+)
+
+(Butn.1050
+	Icon:	446
+	Click:	"avmscfg_Extension_MAKE"
+)
+
+(Butn.1051
+	Help:	"Script Help//Searches for help using the current selection"
+	HelpTopic:	"Getting_help_about_script_components"
+	Icon:	1052
+	Click:	"Script.Help"
+)
+
+(AVIcon.1052
+	Name:	"Help"
+	Res:	"Icons.Help"
+
+)
+
+(Butn.1053
+	Help:	"Help//Gets help about the next button, tool, or menu choice you click"
+	HelpTopic:	"Help_button"
+	Icon:	1054
+	Click:	"Help.Tool"
+)
+
+(AVIcon.1054
+	Name:	"HelpTool"
+	Res:	"Icons.HelpTool"
+
+)
+
+(PopupSet.1055
+)
+
+(ToolBar.1056
+)
+
+(AVIcon.1057
+	Name:	"Icon"
+	Res:	"SEd.Icon"
+
+)
+
+(FN.1240
+	Path:	"$HOME"
+)
+
+(AVStr.1241
+	S:	"View"
+)
+
+(AVStr.1242
+	S:	"Table"
+)
+
+(AVStr.1243
+	S:	"Chart"
+)
+
+(AVStr.1244
+	S:	"Layout"
+)
+
+(AVStr.1245
+	S:	"Script"
+)
+
+(AVStr.1246
+	S:	"Project"
+)
+
+(AVStr.1247
+	S:	"Appl"
+)
+
+(AVStr.1248
+	S:	"DialogEditor"
+)
+

Added: util/arcview3/avpmapper.avx
===================================================================
--- util/arcview3/avpmapper.avx	2006-10-05 22:45:01 UTC (rev 0)
+++ util/arcview3/avpmapper.avx	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,787 @@
+/3.2
+(Extension.1
+	Name:	"AV-p.mapper"
+	FirstRootClassName:	"List"
+	Roots:	2
+	Roots:	3
+	Roots:	49
+	Roots:	66
+	Roots:	102
+	Roots:	103
+	Roots:	104
+	Roots:	105
+	Roots:	106
+	Roots:	107
+	Roots:	108
+	Roots:	109
+	Roots:	110
+	Roots:	111
+	Roots:	112
+	Roots:	113
+	Roots:	114
+	Roots:	115
+	Roots:	116
+	Roots:	117
+	Roots:	118
+	Roots:	119
+	Roots:	120
+	Version:	32
+	About:	"AV-p.mapper is a utility for creating map files for p.mapper application."
+	InstallScript:	121
+	UninstallScript:	122
+	ExtVersion:	1
+)
+
+(List.2
+)
+
+(List.3
+	Child:	4
+)
+
+(AVDLog.4
+	Name:	"avmscfg.mapDlg"
+	X:	26
+	Y:	55
+	W:	496
+	H:	418
+	ConstrainedControlNames:	5
+	ConstrainedControlNames:	6
+	ConstrainedControlNames:	7
+	ConstrainedControlNames:	8
+	ConstrainedControlNames:	9
+	ConstrainedControlNames:	10
+	ConstrainedControlNames:	11
+	ConstrainedControlNames:	12
+	Constraints:	13
+	Constraints:	14
+	Constraints:	15
+	Constraints:	16
+	Constraints:	17
+	Constraints:	18
+	Constraints:	19
+	Constraints:	20
+	Server:	21
+	ControlPanel:	22
+	Title:	"MapFile Creator"
+	EscapeEnabled:	1
+	Modal:	1
+	Resizable:	1
+	AlwaysOnTop:	1
+	HasTitleBar:	1
+	Closeable:	1
+	DefaultButton:	48
+)
+
+(AVStr.5
+	S:	"but_map"
+)
+
+(AVStr.6
+	S:	"but_web"
+)
+
+(AVStr.7
+	S:	"but_ref"
+)
+
+(AVStr.8
+	S:	"but_sbar"
+)
+
+(AVStr.9
+	S:	"but_save"
+)
+
+(AVStr.10
+	S:	"but_clear"
+)
+
+(AVStr.11
+	S:	"but_writemap"
+)
+
+(AVStr.12
+	S:	"but_testmap"
+)
+
+(Numb.13
+	N:	85.00000000000000
+)
+
+(Numb.14
+	N:	85.00000000000000
+)
+
+(Numb.15
+	N:	85.00000000000000
+)
+
+(Numb.16
+	N:	85.00000000000000
+)
+
+(Numb.17
+	N:	101.00000000000000
+)
+
+(Numb.18
+	N:	86.00000000000000
+)
+
+(Numb.19
+	N:	102.00000000000000
+)
+
+(Numb.20
+	N:	102.00000000000000
+)
+
+(Nil.21
+)
+
+(CPanel.22
+	Child:	23
+	Child:	24
+	Child:	25
+	Child:	26
+	Child:	27
+	Child:	28
+	Child:	29
+	Child:	30
+	Child:	32
+	Child:	33
+	Child:	34
+	Child:	35
+	ResBox:	36
+	ResBox:	37
+	ResBox:	38
+	ResBox:	39
+	ResBox:	40
+	ResBox:	41
+	ResBox:	42
+	ResBox:	43
+	ResBox:	44
+	ResBox:	45
+	ResBox:	46
+	ResBox:	47
+	Listening:	1
+)
+
+(LButn.23
+	InternalName:	"but_map"
+	Tag:	"1"
+	Label:	"MAP"
+	Click:	"avmscfg.mDlg.ShowParams"
+)
+
+(LButn.24
+	InternalName:	"but_web"
+	Tag:	"2"
+	Label:	"WEB"
+	Click:	"avmscfg.mDlg.ShowParams"
+)
+
+(LButn.25
+	InternalName:	"but_ref"
+	Tag:	"3"
+	Label:	"REFERENCE"
+	Click:	"avmscfg.mDlg.ShowParams"
+)
+
+(LButn.26
+	InternalName:	"but_sbar"
+	Tag:	"4"
+	Label:	"SCALEBAR"
+	Click:	"avmscfg.mDlg.ShowParams"
+)
+
+(TextBox.27
+	InternalName:	"tbx_params"
+	Listening:	1
+	Constraints:	0x33
+	Changed:	"avmscfg.SaveEnableBut"
+	VerticalScroll:	1
+	HorizontalScroll:	1
+	NextControl:	21
+)
+
+(LButn.28
+	InternalName:	"but_save"
+	Disabled:	1
+	Label:	"Save"
+	Click:	"avmscfg.SaveParams"
+)
+
+(LButn.29
+	InternalName:	"but_clear"
+	Label:	"Clear"
+	Click:	"avmscfg.mDlg.ClearBut"
+)
+
+(AVLBox.30
+	InternalName:	"lbx_layers"
+	NextControl:	21
+	ContentKind:	4
+	Constraints:	0x35
+	ColumnCount:	1
+	HorizontalScroll:	1
+	Listening:	1
+	VerticalScroll:	1
+	SelectionStyle:	31
+	Apply:	"avmscfg.mDlg.ShowThmParams"
+)
+
+(AVEnum.31
+	Name:	"LISTBOX_SELECTION_MULTIRANGE"
+)
+
+(LButn.32
+	InternalName:	"but_writemap"
+	Tag:	"write"
+	Label:	"Write Map File"
+	Click:	"avmscfg.WriteMapFile"
+)
+
+(TextLabel.33
+	InternalName:	"txt_layers"
+	Constraints:	0x55
+	Label:	"Layers/Themes"
+	Listening:	1
+)
+
+(TextLabel.34
+	InternalName:	"txt_params"
+	Constraints:	0x55
+	Label:	"Parameters"
+	Listening:	1
+)
+
+(LButn.35
+	InternalName:	"but_testmap"
+	Tag:	"test"
+	Label:	"Test Map File"
+	Click:	"avmscfg.WriteMapFile"
+)
+
+(RectD.36
+	Left:	16.00000000000000
+	Top:	52.00000000000000
+	Right:	135.00000000000000
+	Bottom:	29.00000000000000
+)
+
+(RectD.37
+	Left:	16.00000000000000
+	Top:	84.00000000000000
+	Right:	135.00000000000000
+	Bottom:	61.00000000000000
+)
+
+(RectD.38
+	Left:	16.00000000000000
+	Top:	117.00000000000000
+	Right:	135.00000000000000
+	Bottom:	94.00000000000000
+)
+
+(RectD.39
+	Left:	16.00000000000000
+	Top:	149.00000000000000
+	Right:	135.00000000000000
+	Bottom:	126.00000000000000
+)
+
+(RectD.40
+	Left:	171.00000000000000
+	Top:	379.00000000000000
+	Right:	488.00000000000000
+	Bottom:	24.00000000000000
+)
+
+(RectD.41
+	Left:	170.00000000000000
+	Top:	410.00000000000000
+	Right:	228.00000000000000
+	Bottom:	388.00000000000000
+)
+
+(RectD.42
+	Left:	430.00000000000000
+	Top:	25.00000000000000
+	Right:	486.00000000000000
+	Bottom:	6.00000000000000
+)
+
+(RectD.43
+	Left:	8.00000000000000
+	Top:	410.00000000000000
+	Right:	158.00000000000000
+	Bottom:	176.00000000000000
+)
+
+(RectD.44
+	Left:	395.00000000000000
+	Top:	410.00000000000000
+	Right:	485.00000000000000
+	Bottom:	388.00000000000000
+)
+
+(RectD.45
+	Left:	10.00000000000000
+	Top:	178.00000000000000
+	Right:	128.00000000000000
+	Bottom:	159.00000000000000
+)
+
+(RectD.46
+	Left:	172.00000000000000
+	Top:	33.00000000000000
+	Right:	459.00000000000000
+	Bottom:	9.00000000000000
+)
+
+(RectD.47
+	Left:	284.00000000000000
+	Top:	410.00000000000000
+	Right:	374.00000000000000
+	Bottom:	388.00000000000000
+)
+
+(Nil.48
+)
+
+(List.49
+	Child:	50
+	Child:	58
+)
+
+(List.50
+	Child:	51
+	Child:	55
+	Child:	57
+)
+
+(List.51
+	Child:	52
+	Child:	53
+	Child:	54
+)
+
+(AVStr.52
+	S:	"View"
+)
+
+(AVStr.53
+	S:	"ButtonBar"
+)
+
+(AVStr.54
+	S:	"avmscfg.mDlg.Open"
+)
+
+(Butn.55
+	Help:	"Open MapFile Creator//Open MapFile Creator"
+	Icon:	56
+	Click:	"avmscfg.mDlg.Open"
+)
+
+(AVIcon.56
+	Name:	"M"
+	Res:	"Icons.M"
+
+)
+
+(Numb.57
+	N:	22.00000000000000
+)
+
+(List.58
+	Child:	59
+	Child:	63
+	Child:	65
+)
+
+(List.59
+	Child:	60
+	Child:	61
+	Child:	62
+)
+
+(AVStr.60
+	S:	"Table"
+)
+
+(AVStr.61
+	S:	"ButtonBar"
+)
+
+(AVStr.62
+	S:	"avmscfg.ImgCat2TileShape"
+)
+
+(Butn.63
+	Help:	"Convert ImageCatalog to TileShape//Convert ImageCatalog to TileShape"
+	Icon:	64
+	Click:	"avmscfg.ImgCat2TileShape"
+)
+
+(AVIcon.64
+	Name:	"RandomColor"
+	Res:	"Icons.RandomColor"
+
+)
+
+(Numb.65
+	N:	25.00000000000000
+)
+
+(List.66
+	Child:	67
+	Child:	74
+	Child:	81
+	Child:	88
+	Child:	95
+)
+
+(List.67
+	Child:	68
+	Child:	72
+	Child:	73
+)
+
+(List.68
+	Child:	69
+	Child:	70
+	Child:	71
+)
+
+(AVStr.69
+	S:	"View"
+)
+
+(AVStr.70
+	S:	"p.mapper"
+)
+
+(AVStr.71
+	S:	"avmscfg.mDlg.Open"
+)
+
+(Choice.72
+	Label:	"MapFile Creator"
+	Click:	"avmscfg.mDlg.Open"
+	Shortcut:	"Keys.None"
+)
+
+(Numb.73
+)
+
+(List.74
+	Child:	75
+	Child:	79
+	Child:	80
+)
+
+(List.75
+	Child:	76
+	Child:	77
+	Child:	78
+)
+
+(AVStr.76
+	S:	"View"
+)
+
+(AVStr.77
+	S:	"p.mapper"
+)
+
+(AVStr.78
+	S:	"avmscfg.BaseConfig"
+)
+
+(Choice.79
+	Label:	"Base Configuration"
+	Click:	"avmscfg.BaseConfig"
+	Shortcut:	"Keys.None"
+)
+
+(Numb.80
+	N:	1.00000000000000
+)
+
+(List.81
+	Child:	82
+	Child:	86
+	Child:	87
+)
+
+(List.82
+	Child:	83
+	Child:	84
+	Child:	85
+)
+
+(AVStr.83
+	S:	"View"
+)
+
+(AVStr.84
+	S:	"p.mapper"
+)
+
+(AVStr.85
+	S:	"avmscfg.ReConfig.Themes"
+)
+
+(Choice.86
+	Label:	"Re-Configure Theme"
+	Click:	"avmscfg.ReConfig.Themes"
+	Shortcut:	"Keys.None"
+)
+
+(Numb.87
+	N:	2.00000000000000
+)
+
+(List.88
+	Child:	89
+	Child:	93
+	Child:	94
+)
+
+(List.89
+	Child:	90
+	Child:	91
+	Child:	92
+)
+
+(AVStr.90
+	S:	"View"
+)
+
+(AVStr.91
+	S:	"p.mapper"
+)
+
+(AVStr.92
+	S:	"avmscfg.EditIni"
+)
+
+(Choice.93
+	Label:	"Edit INI File"
+	Click:	"avmscfg.EditIni"
+	Shortcut:	"Keys.None"
+)
+
+(Numb.94
+	N:	3.00000000000000
+)
+
+(List.95
+	Child:	96
+	Child:	100
+	Child:	101
+)
+
+(List.96
+	Child:	97
+	Child:	98
+	Child:	99
+)
+
+(AVStr.97
+	S:	"View"
+)
+
+(AVStr.98
+	S:	"p.mapper"
+)
+
+(AVStr.99
+	S:	"avmscfg.TileIndexShape"
+)
+
+(Choice.100
+	Label:	"Create Tile Shape"
+	Click:	"avmscfg.TileIndexShape"
+	Shortcut:	"Keys.None"
+)
+
+(Numb.101
+	N:	4.00000000000000
+)
+
+(List.102
+)
+
+(Script.103
+	Name:	"avmscfg.BaseConfig.ReturnThmProp"
+	SourceCode:	"\n''\n'' RETURNS THEME/LAYER PROPERTIES\n'' Is called from script \"avmscfg.BaseConfig\"\n''\n\n\n'v = av.GetActiveDoc\n't = v.GetActiveThemes.Get(0)\n\nt = self\ntheLegend = t.GetLegend\n\nlayType = \"type???\"\nif (t.Is(FTheme)) then\n  tType = \"f\"\n  if (t.GetFTab.GetSrcName.GetSubName = \"Point\") then\n    layType = \"point\"  \n  elseif (t.GetFTab.GetSrcName.GetSubName = \"Arc\") then\n    layType = \"line\"   \n  elseif (t.GetFTab.GetSrcName.GetSubName = \"Polygon\") then\n    layType = \"polygon\"\n  end  \nelseif (t.Is(ITheme)) then\n  t
+Type = \"i\"\n  layType = \"raster\"\nend  \n\n\nbn = t.getSrcName.getFilename.GetBaseName\nlayData = bn.Substitute(\".shp\", \"\")\n\n'msgBox.info(layData,\"\")\nlayDescr = t.GetName\n\nlayStr = \"\"\nlayStr = layStr + \"#\" + nl\nlayStr = layStr + \"# Start of Layer \"+ layDescr + nl\nlayStr = layStr + \"#\" + nl\n\nlayStr = layStr + \"LAYER\" + nl\nlayStr = layStr + \"  NAME \" + layData.Quote + nl\nlayStr = layStr + \"  TYPE \" + layType + nl\nlayStr = layStr + \"  DATA \" + layData.Quote + nl\n\n\n' MIN/MAXSCALE\nthmThreshold = t.GetThreshold \nif (th
+mThreshold  <> nil) then\n  if (thmThreshold.IsMaximumOn) then\n    layStr = layStr + \"  MAXSCALE \" + thmThreshold.GetMaximum.AsString + nl\n  end   \n  if (thmThreshold.IsMinimumOn) then\n    layStr = layStr + \"  MINSCALE \" + thmThreshold.GetMinimum.AsString + nl\n  end\nend\n\n' SYMBOL SCALED TO REF SCALE\nif (theLegend.IsScaled) then\n  refScale = theLegend.GetRefScale.SetFormat(\"d\")\n  layStr = layStr + \"  SYMBOLSCALE \" + refScale.AsString + nl\nend  \n\n\n' METADATA SECTION\n'------------------\nlayStr = layStr + \"  MET
+ADATA \"  + nl\nlayStr = layStr + \"    \"\"DESCRIPTION\"\" \"  +  layDescr.Quote +  nl\n\n\n'# FIELD NAMES FOR FEATURE THEMES\nif (tType = \"f\") then\n  FieldList = t.GetFTab.GetFields \n  fld0 = \"\"\n  for each f in FieldList\n    if (f.IsTypeShape.Not) then \n      fld0 = fld0 + f.GetName + \",\"\n    end\n  end\n  fldStr = fld0.left(fld0.Count -1).Quote\n\n  layStr = layStr + \"    \"\"RESULT_FIELDS\"\" \" + fldStr.Ucase + nl\n  layStr = layStr + \"    \"\"RESULT_HEADERS\"\" \" + fldStr + nl\nend\n\nlayStr = layStr + \"  END  # Metadata \"  + nl 
+\n\n\nif (t.getlabelfield.asstring <> \"\") then\n  if (t.getgraphics.count >0) then\n    layStr = layStr + \"LABELITEM \" + t.getLabelField.asString.Quote + nl\n  end\nend\n\n\n\n'----------------------------\n' CLASSES FOR FEATURE THEMES\n'----------------------------\n\nif (tType = \"f\") then\n\n  'msgBox.Info(t.GetLegend.GetLegendType.asString, \"\")\n\n  '# SINGLE SYMBOL\n  '----------------\n  if (t.GetLegend.GetLegendType.asString = \"LEGEND_TYPE_SIMPLE\") then \n\n    lstSymbols = t.GetLegend.GetSymbols\n    theSymbol = lstSymbols.
+get(0)\n\n    theColor = theSymbol.GetColor\n    lstRGB = theColor.GetRGBList\n    fgRGB = lstRGB.get(0).asstring +\" \"+ lstRGB.get(1).asstring +\" \"+ lstRGB.get(2).asstring\n\n\n    layStr = layStr + \"  CLASS\" + nl\n    layStr = layStr + \"    Name '\" + t.getname + \"'\" + nl\n    layStr = layStr + \"    COLOR \" + fgRGB + nl\n\n\n    if (layType = \"polygon\") then \n      if (theSymbol.IsOutlined) then\n        outlColor = theSymbol.GetOlColor \n        lstRGB = outlColor.GetRGBList\n        outlRGB = lstRGB.get(0).asstring +\" \"
++ lstRGB.get(1).asstring +\" \"+ lstRGB.get(2).asstring\n        layStr = layStr + \"    OUTLINECOLOR \" + outlRGB + nl\n      end\n    elseif ((layType = \"point\") or (layType = \"line\")) then \n      symSize = theSymbol.GetSize.Round\n      if (symSize = 0) then \n        symSize = 1 \n      end\n      layStr = layStr + \"    SYMBOL 'circle' \" + nl\n      layStr = layStr + \"    SIZE \" + symSize.AsString  + nl  \n    end\n\n    layStr = layStr + \"    TEMPLATE void\" + nl\n    layStr = layStr + \"  END  # Class\" + nl\n\n\n\n  '# UNI
+QUE VALUE\n  '---------------\n  elseif (t.GetLegend.GetLegendType.asString = \"LEGEND_TYPE_UNIQUE\") then \n\n    lstSymbols = t.GetLegend.GetSymbols\n    theclasses = t.GetLegend.getClassifications\n    classIndex = 0\n    classFldName = t.getlegend.getFieldNames.get(0)\n\n    layStr = layStr + \"  CLASSITEM \" + classFldName + nl\n\n    for each theSymbol in lstSymbols\n      theColor  = theSymbol.GetColor\n\n      if (theColor.isTransparent.not) then \n        lstRGB = theColor.GetRGBList\n        fgRGB = lstRGB.get(0).ass
+tring +\" \"+ lstRGB.get(1).asstring +\" \"+ lstRGB.get(2).asstring\n\n        theId = theClasses.get(classIndex).ReturnMaximum.AsString\n        clsName = theClasses.get(classIndex).getLabel\n\n        layStr = layStr + \"  CLASS\" + nl\n        layStr = layStr + \"    NAME \" + clsName.Quote  + nl\n        layStr = layStr + \"    EXPRESSION \" + theId.Quote + nl\n        layStr = layStr + \"    COLOR \" + fgRGB + nl\n\n        if (layType = \"polygon\") then\n          if (theSymbol.IsOutlined) then\n            outlColor = theSym
+bol.GetOlColor\n            lstRGB = outlColor.GetRGBList\n            outlRGB = lstRGB.get(0).asstring +\" \"+ lstRGB.get(1).asstring +\" \"+ lstRGB.get(2).asstring\n\n            layStr = layStr + \"    OUTLINECOLOR \" + outlRGB + nl      \n          end\n        end\n        \n        \n        \n\n        layStr = layStr + \"    TEMPLATE void\" + nl\n        layStr = layStr + \"  END  # Class\"  + nl \n\n        classindex  = classindex + 1   \n      end\n    end\n\n\n  '# GRADUATED COLORS VALUE\n  '-------------------------\n  elsei
+f (t.GetLegend.GetLegendType.asString = \"LEGEND_TYPE_COLOR\") then \n\n    lstSymbols = t.GetLegend.GetSymbols\n    theclasses = t.GetLegend.getClassifications\n    classIndex = 0\n\n    classFldName = t.getLegend.getFieldNames.get(0)\n    classFld = t.GetFTab.FindField(classFldName)\n\n    for each theSymbol in lstSymbols\n      theColor  = theSymbol.GetColor\n\n      if (theColor.isTransparent.not) then \n        lstRGB = theColor.GetRGBList\n        fgRGB = lstRGB.get(0).asString +\" \"+ lstRGB.get(1).asstring +\" \"+ lstR
+GB.get(2).asstring\n\n        clsName = theClasses.get(classIndex).getLabel\n\n\n        '# CLASS EXPRESSION\n        valPrecision = t.GetLegend.GetPrecision \n        if (valPrecision < 0) then\n          numFormat = \"d.\"\n          for each n in 1..valPrecision.Abs \n            numFormat = numFormat + \"d\"\n          end \n        else\n          numFormat = \"d\"\n        end\n\n        'msgBox.Info(valPrecision.AsString,\"\")\n\n        minValStr = theClasses.get(classIndex).ReturnMinimum.SetFormat(numFormat).AsString\n      
+  maxValStr = theClasses.get(classIndex).ReturnMaximum.SetFormat(numFormat).AsString\n\n\n        clsExpr = \"([\" + classFldName.Ucase + \"]>\" + minValStr + \" AND [\" + classFldName.Ucase + \"]<=\" + maxValStr +\")\"          \n\n\n        layStr = layStr + \"  CLASS\" + nl\n        layStr = layStr + \"    NAME \" + clsName.Quote  + nl\n        layStr = layStr + \"    EXPRESSION \" + clsExpr + nl\n        layStr = layStr + \"    COLOR \" + fgRGB + nl\n\n        if (layType = \"polygon\") then\n          if (theSymbol.IsOutlined) then\n 
+           outlColor = theSymbol.GetOlColor\n            lstRGB = outlColor.GetRGBList\n            outlRGB = lstRGB.get(0).asstring +\" \"+ lstRGB.get(1).asstring +\" \"+ lstRGB.get(2).asstring\n\n            layStr = layStr + \"    OUTLINECOLOR \" + outlRGB + nl      \n          end\n        end\n\n        layStr = layStr + \"    TEMPLATE void\" + nl\n        layStr = layStr + \"  END  # Class\" + nl\n\n        classindex  = classindex + 1   \n      end\n    end\n\n  \n  '# Graduated Symbol Legend\n  '--------------------------\n  e
+lseif (t.GetLegend.GetLegendType.asString = \"LEGEND_TYPE_SYMBOL\") then \n\n    lstSymbols = t.GetLegend.GetSymbols\n    theclasses = t.GetLegend.getClassifications\n    classIndex = 0\n\n    classFldName = t.getLegend.getFieldNames.get(0)\n    classFld = t.GetFTab.FindField(classFldName)\n\n    for each theSymbol in lstSymbols\n      'msgBox.Info(lstSymbols.Count.AsString, \"\")\n      theColor  = theSymbol.GetColor\n\n      if (theColor.isTransparent.not) then \n        lstRGB = theColor.GetRGBList\n        fgRGB = lstRGB.
+get(0).asString +\" \"+ lstRGB.get(1).asstring +\" \"+ lstRGB.get(2).asstring\n\n        clsName = theClasses.get(classIndex).getLabel\n\n\n        '# CLASS EXPRESSION\n        valPrecision = t.GetLegend.GetPrecision \n        if (valPrecision < 0) then\n          numFormat = \"d.\"\n          for each n in 1..valPrecision.Abs \n            numFormat = numFormat + \"d\"\n          end \n        else\n          numFormat = \"d\"\n        end\n\n        symSize = theSymbol.GetSize.Round\n\n        'msgBox.Info(valPrecision.AsString,\"\")\n
+\n        minValStr = theClasses.get(classIndex).ReturnMinimum.SetFormat(numFormat).AsString\n        maxValStr = theClasses.get(classIndex).ReturnMaximum.SetFormat(numFormat).AsString\n\n        if (minValStr = minValStr) then\n          clsExpr = \"([\" + classFldName.Ucase + \"] = \" + minValStr +\")\"\n        else\n          clsExpr = \"([\" + classFldName.Ucase + \"]>\" + minValStr + \" AND [\" + classFldName.Ucase + \"]<=\" + maxValStr +\")\"          \n        end\n\n        layStr = layStr + \"  CLASS\" + nl\n        layStr = 
+layStr + \"    NAME \" + clsName.Quote  + nl\n        layStr = layStr + \"    EXPRESSION \" + clsExpr + nl\n        layStr = layStr + \"    COLOR \" + fgRGB + nl\n        layStr = layStr + \"    SYMBOL 'circle' \" + nl\n        layStr = layStr + \"    SIZE \" + symSize.AsString  + nl\n\n\n\n        layStr = layStr + \"    TEMPLATE void\" + nl\n        layStr = layStr + \"  END  # Class\" + nl\n\n        classindex  = classindex + 1   \n      end\n    end\n  \n  end\n \n\nend  ' for feature themes  \n\nlayStr = layStr + \"END  # Layer\" + nl +
+ nl\n\n\n''msgBox.Report(layStr,\"\")\n\nlayConfig = {\"avmscfg\", bn, layStr}\n\n\nreturn layConfig\n\n\n\n"
+)
+
+(Script.104
+	Name:	"avmscfg.CheckThemeOTag"
+	SourceCode:	"\n'' avmscfg.CheckThemeOTag\n'' Checks if theme has assigned ObjectTag\n''\n\n't = av.GetActiveDoc\nt = self\n\n\nviewOTag = t.GetObjectTag\n\nif (viewOTag = nil) then\n    return false\nelse\n  if (viewOTag.Is(List).Not) then\n    return false\n  else  \n    if (viewOTag.Get(0) <> \"avmscfg\") then\n      return false\n    else\n      return true\n    end\n  end          \nend"
+)
+
+(Script.105
+	Name:	"avmscfg.CheckViewOTag"
+	SourceCode:	"\n'' avmscfg.CheckViewOTag\n'' Checks if current view has extension object tag assigned to\n''\n\n'v = av.GetActiveDoc\nv = self\n\n\nviewOTag = v.GetObjectTag\n\nif (viewOTag = nil) then\n    return false\nelse\n  if (viewOTag.Is(List).Not) then\n    return false\n  else  \n    if (viewOTag.Get(0) <> \"avmscfg\") then\n      return false\n    else\n      return true\n    end\n  end          \nend"
+)
+
+(Script.106
+	Name:	"avmscfg.ReadIni"
+	SourceCode:	"\n'====================================\n' READ INI FILE AND RETURN KEY VALUE\n'-----------------------------------\n' Armin Burger\n'====================================\n\n'-------------------------\n' INITIALIZE KERNEL32.DLL\n'-------------------------\nkernel32 = DLL.Make(FileName.FindInSystemSearchPath(\"kernel32.dll\"))\nif (kernel32 = nil) then\n  msgBox.Error(\"Cannot find file kernel32.dll\",\"\")\n  exit\nend  \n\n\n'--------------------------------------\n' GET INPUT PARAMETERS AND GET INI KEY\n'-------------------------
+-------------\n\nhomeVar = system.getEnvVar(\"AVHOME\")\niniFile = homeVar + \"\\etc\\avpmapper.ini\"\nif (iniFile.AsFileName.IsFile.Not) then\n  msgBox.Error(\"Config file  avpgcon.ini not in directory ..\\ARCVIEW\\ETC\", \"INI File Not Found\")\n  return nil\nend  \n\n\n\niniSection  = self.Get(0)\niniKey      = self.Get(1)\n\nkeyValue = String.MakeBuffer(100)\n\niniFName = Filename.Make(iniFile)       '' CHECK FOR INI FILE\nif (File.Exists(iniFName)=FALSE) then\n  msgBox.Error(\"INI file \" + nl+ iniFName.AsString + nl + \"not found. Te
+rminating\",\"\")\n  exit\nend  \n\nReadIni =  DLLProc.Make(kernel32, \"GetPrivateProfileStringA\", \n            #DLLPROC_TYPE_INT32, {#DLLPROC_TYPE_STR, #DLLPROC_TYPE_STR, #DLLPROC_TYPE_STR, #DLLPROC_TYPE_STR, #DLLPROC_TYPE_INT32,   #DLLPROC_TYPE_STR})\n''           returnMsg              SECTION [..]        Key                  \"\"             EmptyInValueStr   Count(EmptyInValueStr)   ini-FileName\n\niniReadVal = ReadIni.Call({iniSection, iniKey, \"\", keyValue, keyValue.Count, iniFName.AsString})   \n\nif (iniReadVal <=
+ 0) then\n  msgBox.Error(\"Section = \" + iniSection + \" or Key = \" + iniKey + \" not found in .INI file\" + nl+ iniFile, \"\")\n  exit \nend\n\nkeyValue = keyValue.Substitute(\"*null*\",\"\")\nreturn keyValue\n"
+)
+
+(Script.107
+	Name:	"avmscfg.WriteIni"
+	SourceCode:	"'====================================\n' WRITE NEW KEY TO INI FILE \n'====================================\n\n' takes input \n' * iniFile      as path to .INI file\n' * iniSection   as SECTION [...]\n' * iniKey       as Key\n' * newKeyVal    as the new Key\n\n' outputs\n' * TRUE         if successfull\n\n' SYNTAX\n' retMsg = av.run(\"WriteIni\",{iniFile, iniSection, iniKey, newKeyVal})   ''=> BOOLEAN\n\n'=====================================\n\n'-------------------------\n' INITIALIZE KERNEL32.DLL\n'-------------------------\nker
+nel32 = DLL.Make(FileName.FindInSystemSearchPath(\"kernel32.dll\"))\nif (kernel32 = nil) then\n  msgBox.Error(\"Cannot find file kernel32.dll\",\"\")\n  exit\nend  \n\n\n'--------------------------------------\n' GET INPUT PARAMETERS AND GET INI KEY\n'--------------------------------------\n\niniFile     = self.Get(0)\niniSection  = self.Get(1)\niniKey      = self.Get(2)\nnewKeyVal   = self.Get(3)\n\niniFName = Filename.Make(iniFile)       '' CHECK FOR INI FILE\nif (File.Exists(iniFName)=FALSE) then\n  msgBox.Error(\"INI file \" + n
+l+ iniFName.AsString + nl + \"not found. Terminating\",\"\")\n  exit\nend  \n\nWriteini = DLLProc.Make(kernel32, \"WritePrivateProfileStringA\", \n            #DLLPROC_TYPE_INT32, {#DLLPROC_TYPE_STR, #DLLPROC_TYPE_STR, #DLLPROC_TYPE_STR, #DLLPROC_TYPE_STR})\n''           returnMsg              SECTION [..]        Key                newKeyValue        ini-FileName \n\niniWriteVal = WriteIni.Call({iniSection, iniKey, newKeyVal, iniFName.AsString})\n\nif (iniWriteVal <= 0) then\n  return  FALSE\nelse\n  return  TRUE    \nend\n\n"
+)
+
+(Script.108
+	Name:	"avmscfg.Map2Browser"
+	SourceCode:	"\n'-----------------------------------------------------------\n' NOW CALL DEFAULT BROWSER AND OPEN QUERY RESULT HTML FILE\n' © for this part by Juna Papajorgji, University of Florida\n'-----------------------------------------------------------\n\nmapURL = self\n\n\n'Setup DLL file objects.\n'-------------------------------------------------------------\nif (System.GetOSVariant = #SYSTEM_OSVARIANT_MSWNT) then\n 	dllShell32 = DLL.Make(FileName.FindInSystemSearchPath(\"shell32.dll\"))\n	 dllUser32 = DLL.Make(FileName.FindI
+nSystemSearchPath(\"user32.dll\"))\nElseIf (System.GetOSvariant = #SYSTEM_OSVARIANT_MSW95) then\n	 dllShell32 = DLL.Make(FileName.FindInSystemSearchPath(\"shell32.dll\"))\n	 dllUser32 = DLL.Make(FileName.FindInSystemSearchPath(\"user32.dll\"))\nElse\n	 MsgBox.Warning(\"Required DLL files cannot be found\"+NL+\"Check that the SYSTEM folder is in your path.\", \"Stop, is this a Windoze machine?\")\n	 return nil\nEnd\n\n'Setup Win32API functions as Avenue DLLProc objects\ndpGetActivewindow = DLLProc.Make(dllUser32, \"GetActiveWindow
+\",\n                                  #DLLPROC_TYPE_INT32,	'return value type\n                                  {})                		'argument list\n\ndpShellExecute = DLLProc.Make(dllShell32, \"ShellExecuteA\",\n                              #DLLPROC_TYPE_INT32,		'return value type\n                            	{#DLLPROC_TYPE_INT32,		'argument list\n                            	 #DLLPROC_TYPE_STR,\n                            	 #DLLPROC_TYPE_STR,\n                            	 #DLLPROC_TYPE_STR,\n                    
+        	 #DLLPROC_TYPE_STR,\n                            	 #DLLPROC_TYPE_INT32})\n\n\n'Get the Window Handle (hWnd) of the ArcView window\n'---------------------------------------------------\nhWnd_active = dpGetActivewindow.Call({})\n'''or-> hWnd_active = DLL.GetAVWindowHandle\n\n\n'Send the URL to the default browser\n'-------------------------------------------\nretvalue = dpShellExecute.Call({hWnd_active, \"Open\", mapURL, \"\", FileName.GetCWD.AsString, 1})\n\n\n'Let the user know if the link failed.  The \"ShellExecuteA
+\"\n'function returns an integer greater than 32 if the process succeeded.\n'---------------------------------------------------------------------\nif	(retvalue <=32) then                    \n  MsgBox.Warning (\"Loading map failed.\",\"Server error\")\nEnd\n\n"
+)
+
+(Script.109
+	Name:	"avmscfg.mDlg.ClearBut"
+	SourceCode:	"\n' avmscfg.mDlg.ClearBut\n\nmapDlg = av.FindDialog(\"avmscfg.mapDlg\")\n\nparamTxtBox = mapDlg.FindByName(\"tbx_params\")\nparamTxtBox.Empty\n\nparamTxtLabl = mapDlg.FindByName(\"txt_params\")\nparamTxtLabl.SetLabel(\"Parameters\")\n\n\n\n"
+)
+
+(Script.110
+	Name:	"avmscfg.mDlg.ShowParams"
+	SourceCode:	"\n' SHOW PARAMETERS READ FROM VIEW OBJECT TAG FOR\n' MAP, WEB, REFERENCE, SCALEBAR\n\ntheView = _avmscfg_theView\nviewOTag = theView.GetObjectTag\n\n\nmapDlg = av.FindDialog(\"avmscfg.mapDlg\")\n\nparamTxtBox = mapDlg.FindByName(\"tbx_params\")\nparamTxtLabl = mapDlg.FindByName(\"txt_params\")\n\n\nidx = self.GetTag.AsNumber\n\nelemOTag = viewOTag.Get(idx)\nelemName = elemOTag.Get(0)\nloadStr = elemOTag.Get(1)\n\n_avmscfg_LoadedTag = {\"view\", idx, elemName}\n\nparamTxtLabl.SetLabel(\"Parameters for \" + elemName)\nparamTxtBox.SetText(loa
+dStr)\n\nmapDlg.FindByName(\"but_save\").SetEnabled(FALSE)\n\n\n\n\n\n\n"
+)
+
+(Script.111
+	Name:	"avmscfg.mDlg.ShowThmParams"
+	SourceCode:	"\n'' \n'' SHOW PARAMETERS FOR SELECTED THEME/LAYER\n'' Read from theme object tag\n''\n\n\ntheView = _avmscfg_theView\n\nmapDlg = av.FindDialog(\"avmscfg.mapDlg\")\nparamTxtBox = mapDlg.FindByName(\"tbx_params\")\nparamTxtLabl = mapDlg.FindByName(\"txt_params\")\nlayerLBox = mapDlg.FindByName(\"lbx_layers\")\n\nlayIdx = layerLBox.GetCurrentRow\ntheLayer = layerLBox.GetSelection.Get(0) \nloadStr = theLayer.GetObjectTag.Get(2)\n\n_avmscfg_LoadedTag = {\"theme\", layIdx}\n\nparamTxtBox.SetText(loadStr)\nparamTxtLabl.SetLabel(\"Parameters for
+ layer/theme \" + theLayer.GetName.Quote)\n\nmapDlg.FindByName(\"but_save\").SetEnabled(FALSE)"
+)
+
+(Script.112
+	Name:	"avmscfg.SaveEnableBut"
+	SourceCode:	"\n' CHANGE SCRIPT FOR TEXT BOX\n' is called when user modifies text and thus enables \"Save\" button\n\nmapDlg = av.FindDialog(\"avmscfg.mapDlg\")\nmapDlg.FindByName(\"but_save\").SetEnabled(TRUE)"
+)
+
+(Script.113
+	Name:	"avmscfg.SaveParams"
+	SourceCode:	"\n''\n'' SAVE PARAMETERS MODIFIED BY USER BACK TO OBJECT TAGS\n''\n\ntheView = _avmscfg_theView\nmapDlg = av.FindDialog(\"avmscfg.mapDlg\")\nparamTxtBox = mapDlg.FindByName(\"tbx_params\")\n\nif (paramTxtBox.IsEmpty.Not) then\n\n  paramList = _avmscfg_LoadedTag\n  pObj = paramList.Get(0)\n  objIdx = paramList.Get(1)  \n  ''msgBox.Info(objIdx.AsString,\"\")\n\n  '# CHANGE PARAMETERS FOR MAP, WEB, REF, SBAR\n  if (pObj = \"view\") then\n\n    viewOTag = theView.GetObjectTag\n    elemParams = viewOTag.Get(objIdx) \n\n    elemParams.Set(1, 
+paramTxtBox.GetText)\n    viewOTag.Set(objIdx, elemParams) \n\n  '# CHANGE PARAMETERS FOR LAYERS\n  else\n    theLayers = theView.GetThemes\n    curLayer = theLayers.Get(objIdx)\n    layOTag = curLayer.GetObjectTag\n    layOTag.Set(2, paramTxtBox.GetText)\n\n  end\n\n\n  self.SetEnabled(FALSE)\n\n\nend  "
+)
+
+(Script.114
+	Name:	"avmscfg.WriteMapFile"
+	SourceCode:	"\n'' WRITE VIEW AND THEME PARAMS TO MAP FILE\n'' avmscfg.WriteMapFile\n\n\nmapFileType = self.GetTag\n\n\n\ntheView = _avmscfg_theView\nviewOTag = theView.GetObjectTag\n\n'------------------------\n' MAP FILE HEADER PARAMS\n'------------------------\nmapStr  = viewOTag.Get(1).Get(1)\nwebStr  = viewOTag.Get(2).Get(1)\nrefStr  = viewOTag.Get(3).Get(1)\nsbarStr = viewOTag.Get(4).Get(1)\nlegStr  = \"LEGEND\" + nl + \"END\" + nl\n\n'--------\n' LAYERS\n'--------\nmapDlg = av.FindDialog(\"avmscfg.mapDlg\")\nlayerLBox = mapDlg.FindByName(\"lbx_l
+ayers\")\n\nmapLayers = layerLBox.GetSelection\nif (mapLayers.Count = 0) then\n  mapLayers = layerLBox.GetList\nend\n\nnumLayers = mapLayers.Count\nallLayStr = \"#================== START OF LAYER SECTION =====================#\" +nl\n\nfor each layId in (numLayers -1)..0 by -1\n  mapLay = mapLayers.Get(layId)\n  layStr = mapLay.GetObjectTag.Get(2)\n  allLayStr = allLayStr + layStr + nl \nend  \n\nmapFileStr = mapStr + nl + webStr + nl + refStr + nl + legStr + nl +sbarStr + nl+nl +allLayStr + nl + \"END  #Map\"\n'msgBox.Report(m
+apFileStr,\"\")\n\n\n'------------\n' WRITE FILE\n'------------\n' WRITE MAP FILE FOR USE IN APPLICATION\nif (mapFileType = \"write\") then\n\n  mapFilename = FileDialog.Put(\"pmapper.map\".AsFilename, \"*.map\", \"Save File As...\")\n  if (mapFilename = nil) then \n    return nil \n  end\n\n  txtF = TextFile.Make(mapFilename, #FILE_PERM_WRITE )\n  txtF.Write (mapFileStr, mapFileStr.Count)\n  txtF.Close\n\n\n' WRITE TEST MAP FILE AND LOAD INTO BROWSER\nelse\n\n  webServer = av.Run(\"avmscfg.ReadIni\", {\"SERVER\",\"webserver\"})\n  testpage  = a
+v.Run(\"avmscfg.ReadIni\", {\"SERVER\",\"testpage\"})\n  mapdir    = av.Run(\"avmscfg.ReadIni\", {\"SERVER\",\"mapdir\"})\n\n  mapFilePath = mapdir + \"/pmappertest.map\"\n  mapFilename = mapFilePath.AsFilename\n  txtF = TextFile.Make(mapFilename, #FILE_PERM_WRITE )\n  txtF.Write (mapFileStr, mapFileStr.Count)\n  txtF.Close\n\n  baseURL = webServer + \"/\" + testpage + \"?mapfile=\" + mapFilePath\n  baseURL = baseURL.Substitute(\"//\", \"/\")\n  mapURL = \"http://\" + baseURL \n\n  av.Run(\"avmscfg.Map2Browser\", mapURL)\n\n\n\n\n\n\n\nend\n\n\n"
+)
+
+(Script.115
+	Name:	"avmscfg.mDlg.Open"
+	SourceCode:	"\n'====================================\n' OPEN DIALOG FOR MAP FILE CREATION\n'====================================\n\ntheView = av.GetActiveDoc\n_avmscfg_theView = theView\n\n\n'-------------------------------------------\n' CHECK IF VIEW IS CONFIGURED FOR MAPSERVER\n'-------------------------------------------\nif (av.Run(\"avmscfg.CheckViewOTag\",theView) = false) then\n  msgBox.Error(\"Current view has not been configured yet for \" + nl + \n               \"use with MapServer.\" + nl +\n               \"Please run menu 'Bas
+e Configuration' first\", \"\")\n  return nil\nend               \n\n\n'-------------------------------------------------------\n' CHECK FOR NEW THEMES NOT YET CONFIGURED FOR MAPSERVER\n'-------------------------------------------------------\ntheLayers = theView.GetThemes\n\nnewLayers = {}\nnewLayerStr = \"\"\nfor each lay in theLayers\n  if (av.Run(\"avmscfg.CheckThemeOTag\", lay) = false) then\n    newLayers.Add(lay)\n    newLayerStr = newLayerStr + lay.GetName + \" \"\n  end\nend\n\nif (newLayers.Count > 0) then\n  runConfig = msgB
+ox.YesNo(\"The themes \" + newLayerStr + \"have been added to the view and are not configured for inclusion in MapServer map file.\" + nl+\n                           \"Do you want to run configuration for them?\", \"Configure New Themes?\", TRUE) \n  if (runConfig) then\n    for each lay in newLayers\n      layConfig = av.Run(\"avmscfg.BaseConfig.ReturnThmProp\", lay)\n      lay.SetObjectTag(layConfig)\n    end\n  end \nend\n\n\n'-------------\n' OPEN DIALOG\n'-------------\nmapDlg = av.FindDialog(\"avmscfg.mapDlg\")\nlayLBox = mapD
+lg.FindByName(\"lbx_layers\")\nlayLBox.DefineFromList(theLayers)\n\nparamTxtBox = mapDlg.FindByName(\"tbx_params\")\nparamTxtBox.Empty\n\nparamTxtLabl = mapDlg.FindByName(\"txt_params\")\nparamTxtLabl.SetLabel(\"Parameters\")\n\n\nmapDlg.Open\n\n\n\n"
+)
+
+(Script.116
+	Name:	"avmscfg.ImgCat2TileShape"
+	SourceCode:	"' TILEINDEX FOR MAPSERVER FROM ESRI IMAGECATALOG\n' Author: Armin Burger\n' Calculates the tileindex shape file from an ESRI \n' image catalog for use in the MapServer map file.\n' Usage: Load dbf/Info table as table in ArcView.  \n' Run the script for this table.\n\n\n'-----------------------------------------\n' INTABLE - INPUT TABLE FOR IMAGE CATALOG\n'-----------------------------------------\ntheInTable = av.GetActiveDoc\ntheInVTab = theInTable.GetVTab\ntheInFields = theInVTab.GetFields\n\ntheLocFld = theInVTab.FindF
+ield(\"IMAGE\")\nminXFld = theInVTab.FindField(\"XMIN\")\nminYFld = theInVTab.FindField(\"YMIN\")\nmaxXFld = theInVTab.FindField(\"XMAX\")\nmaxYFld = theInVTab.FindField(\"YMAX\")\n\n'-----------------------------------\n' OUT SHAPE FILE AS TILEINDEX SHAPE\n'-----------------------------------\nfileDef = av.GetProject.MakeFileName(\"tileind\", \"shp\")\nmyFileName = FileDialog.Put(fileDef,\"*.shp\",\"Save the new theme\")\nnewFTab = FTab.MakeNew(myFileName,Polygon)\n\nGrdID = Field.Make(\"ID\", #FIELD_LONG, 10, 0)\ntheLoc = Field.Make(\"Loca
+tion\", #FIELD_CHAR, 100, 0)\n\nfldList = {}\nfldList.Add(GrdID)\nfldList.Add(theLoc)\n\nnewFTab.AddFields(fldList)\n\n\n'------------------------------\n' CALCULATE COORDINATES\n'------------------------------\nid = 1\nfor each rec in theInVTab \n\n   ' POINTS\n       ' 2--3   <== order of points\n       ' |  |\n       ' 1--4\n\n    minX = theInVTab.ReturnValueNumber(minXFld, rec)\n    minY = theInVTab.ReturnValueNumber(minYFld, rec)\n    maxX = theInVTab.ReturnValueNumber(maxXFld, rec)\n    maxY = theInVTab.ReturnValueNumber(max
+YFld, rec)\n\n    p1 = Point.Make(minX,minY)\n    p2 = Point.Make(minX,maxY)\n    p3 = Point.Make(maxX,maxY)\n    p4 = Point.Make(maxX,minY)\n    \n    ' POLYGON AND ATTRIBUTE VALUES\n    newPoly = Polygon.Make({{p1, p2, p3, p4}})\n    \n    n = newFTab.AddRecord\n    newFTab.SetValue(newFTab.FindField(\"Shape\"),n,newPoly)\n    \n    newFTab.SetValue(GrdID,n,id)\n    id = id + 1\n    \n    newFTab.SetValue(theLoc,n,theInVTab.ReturnValue(theLocFld, rec))\n     \nend\n"
+)
+
+(Script.117
+	Name:	"avmscfg.BaseConfig"
+	SourceCode:	"\n''=================================================================\n'' BASIC CONFIGURATION FOR MAP FILE\n''\n'' Calls script \"avmscfg.BaseConfig.ReturnThmProp\" for each theme\n''\n''=================================================================\n\n\ntheView = av.GetActiveDoc\n_avmscfg_theView = theView\n\n\nexistingConfig = FALSE\n\n' CHECK IF VIEW HAS ALREADY BEEN CONFIGURED\n'' Ask what to do\nif (av.Run(\"avmscfg.CheckViewOTag\",theView) = true) then\n  existingConfig = TRUE\n  reconfigure = msgBox.YesNo(\"Current view 
+has already been configured for use with MapServer. \" + \n               \"If you reconfigure all manual configuration \" + nl + \"will be lost.\" + nl +\n               \"Do you want to continue?\",\n               \"WARNING: Re-Configure?\", FALSE)\n  if (reconfigure = false) then\n    exit\n  end\n \nend   \n\n\ntheunits = theView.getunits.asstring\nif (theunits = \"UNITS_LINEAR_UNKNOWN\") then\n  msgbox.info(\"It is important to have the map units set in the view properties. This is needed by mapserver. Please set them in the 
+View-Properties dialog and try again\", \"MapServer\")\n  exit\nend\n\n\nu = \"meters\"\nif (theunits = \"UNITS_LINEAR_METERS\") then u = \"meters\" end\nif (theunits = \"UNITS_UNITS_LINEAR_DEGREES\") then u = \"dd\" end\nif (theunits = \"UNITS_LINEAR_INCHES\") then u = \"inches\" end\nif (theunits = \"UNITS_LINEAR_FEET\") then u = \"feet\" end\nif (theunits = \"UNITS_LINEAR_MILES\") then u = \"miles\" end\nif (theunits = \"UNITS_LINEAR_KILOMETERS\") then u = \"kilometers\" end\n\n\nviewExtent = theView.getdisplay.ReturnVisExtent\ntotalExtent = theVi
+ew.ReturnExtent\n\nmapExtent = viewExtent.getleft.SetFormat( \"d.ddd\" ).asstring + \" \"+ viewExtent.getbottom.SetFormat( \"d.ddd\" ).asstring +\" \" + viewextent.getright.SetFormat( \"d.ddd\" ).asstring +\" \"+ viewextent.gettop.SetFormat( \"d.ddd\" ).asstring\nthetotalextent = totalextent.getleft.SetFormat( \"d.ddd\" ).asstring + \" \"+ totalextent.getbottom.SetFormat( \"d.ddd\" ).asstring +\" \" + totalextent.getright.SetFormat( \"d.ddd\" ).asstring +\" \"+ totalextent.gettop.SetFormat( \"d.ddd\" ).asstring\n\ndefLayStr = \"\"\nfor each l
+ in theView.GetThemes\n  bn = l.getSrcName.getFilename.GetBaseName\n  layName = bn.Substitute(\".shp\", \"\")\n\n  defLayStr = defLayStr + layName + \",\"\nend\ndefLayStr = defLayStr.left(defLayStr.Count -1)\n\n\n\n\n\n'-----------------------------\n'# PARAMETERS FOR MAP AND WEB\n'-----------------------------\n'# GET DEFAULT VALUES FROM INI FILE\ndatadir     = av.Run(\"avmscfg.ReadIni\", {\"MAPFILE\",\"datadir\"})\nimagecolor  = av.Run(\"avmscfg.ReadIni\", {\"MAPFILE\",\"imagecolor\"})\nfontset     = av.Run(\"avmscfg.ReadIni\", {\"MAPFILE\",\"fo
+ntset\"})\nsymbolset   = av.Run(\"avmscfg.ReadIni\", {\"MAPFILE\",\"symbolset\"})\nimgpath     = av.Run(\"avmscfg.ReadIni\", {\"MAPFILE\",\"imgpath\"})\nimgurl      = av.Run(\"avmscfg.ReadIni\", {\"MAPFILE\",\"imgurl\"})\n\n\nlabels   = {\"MAP: SHAPEPATH * \", \"MAP: IMAGECOLOR\", \"MAP: FONTSET *  \", \"MAP: SYMBOLSET *   \",                     \"WEB: IMAGEPATH *   \",      \"WEB: IMAGEURL *     \"}\ndefaults = {datadir, imagecolor, fontset, symbolset, imgpath, imgurl }  \nMapWebParam = MsgBox.MultiInput (\"Settings for MAP and WEB\", \"Settings 
+MAP and WEB\", labels, defaults)\n\nif (MapWebParam.Count = 0) then exit end\n\nshpPath  = MapWebParam.Get(0) \nimgColor = MapWebParam.Get(1)\nfontSet  = MapWebParam.Get(2)\nsymbSet  = MapWebParam.Get(3)\nimgPath  = MapWebParam.Get(4)\nimgURL   = MapWebParam.Get(5)\n\n\n'-----------------------------\n'# STRINGS FOR MAP AND WEB\n'-----------------------------\n\nmapStr = \"\"\nmapStr = mapStr + \"#\" + nl\nmapStr = mapStr + \"# Start of map file - created \" + date.now.asstring + nl\nmapStr = mapStr + \"#\" + nl\nmapStr = mapStr + \"MAP
+\" + nl\nmapStr = mapStr + \"EXTENT \" + mapExtent + nl\nmapStr = mapStr + \"UNITS \" + u + nl\nmapStr = mapStr + \"SHAPEPATH \" + shpPath.Quote + nl\nmapStr = mapStr + \"FONTSET \" + fontSet.Quote + nl\nmapStr = mapStr + \"SYMBOLSET \" + symbSet.Quote + nl\nmapStr = mapStr + \"RESOLUTION 96\" + nl\n\n\nwebStr = \"\"\nwebStr = webStr + \"#\" + nl\nwebStr = webStr + \"# Start of web interface definition\" + nl\nwebStr = webStr + \"#\" + nl\nwebStr = webStr + \"WEB\" + nl\nwebStr = webStr + \"  TEMPLATE \"\"map.html\"\"\" + nl \nwebStr = webStr + \"  IM
+AGEPATH \" + imgPath.Quote  + nl\nwebStr = webStr + \"  IMAGEURL \" + imgURL.Quote  + nl\nwebStr = webStr + \"  METADATA\" + nl\nwebStr = webStr + \"  END  # Metadata\" + nl\nwebStr = webStr + \"END  # Web\" + nl\n\n\n\n\n'----------------------------------------\n'# PARAMETERS FOR REFERENCE AND SCALEBAR \n'----------------------------------------\nlabels   = {\"REF: IMAGE * \", \"REF: SIZE \", \"SBAR: INTERVALS\", \"SBAR: SIZE\" }\ndefaults = {\"images/reference.png\", \"180 140\", \"4\", \"200 3\" }  \nRefSbarParam = MsgBox.MultiInput (\"Settin
+gs for REFERENCE MAP and SCALEBAR\", \"Settings REFERENCE MAP and SCALEBAR\", labels, defaults)\n\nif (RefSbarParam.Count = 0) then exit end\n\n\nrefImg   = RefSbarParam.Get(0) \nrefSize  = RefSbarParam.Get(1)\nsbarInt  = RefSbarParam.Get(2)\nsbarSize = RefSbarParam.Get(3)\n\n\nrefStr = \"\"\nrefStr = refStr + \"#\" + nl\nrefStr = refStr + \"# Start of Reference map definition\" + nl\nrefStr = refStr + \"#\" + nl\nrefStr = refStr + \"REFERENCE\" + nl\nrefStr = refStr + \"  EXTENT \" + mapExtent + nl\nrefStr = refStr + \"  IMAGE \" + refImg.
+Quote + nl\nrefStr = refStr + \"  SIZE \" + refSize + nl\nrefStr = refStr + \"  COLOR -1 -1 -1\" + nl\nrefStr = refStr + \"  OUTLINECOLOR 255 0 0\" + nl\nrefStr = refStr + \"END  # Reference\" + nl\n\n\n\nsbarStr = \"\"\nsbarStr = sbarStr + \"#\" + nl\nsbarStr = sbarStr + \"# Start of ScaleBar definition\" + nl\nsbarStr = sbarStr + \"#\" + nl\nsbarStr = sbarStr + \"SCALEBAR\" + nl\nsbarStr = sbarStr + \"  INTERVALS \" + sbarInt + nl\nsbarStr = sbarStr + \"  SIZE \" + sbarSize + nl\nsbarStr = sbarStr + \"  UNITS \" + u + nl\nsbarStr = sbarStr + \" 
+ COLOR 250 250 250\" + nl\nsbarStr = sbarStr + \"  OUTLINECOLOR 0 0 0\" + nl\nsbarStr = sbarStr + \"  BACKGROUNDCOLOR 100 100 100\" + nl\nsbarStr = sbarStr + \"  STYLE 0\" + nl\nsbarStr = sbarStr + \"  POSTLABELCACHE true\" + nl\nsbarStr = sbarStr + \"  LABEL\" + nl\nsbarStr = sbarStr + \"    COLOR 255 255 255\" + nl\nsbarStr = sbarStr + \"    OUTLINECOLOR 0 0 0\" + nl\nsbarStr = sbarStr + \"    SIZE small\" + nl\nsbarStr = sbarStr + \"  END  # Label\" + nl\nsbarStr = sbarStr + \"END  # Reference\" + nl\n\n\n'# WRITE STRING LIST TO VIEW OBJ
+ECT TAG\nviewOTag = {\"avmscfg\",{\"MAP\",mapStr}, {\"WEB\",webStr}, {\"REFERENCE\",refStr}, {\"SCALEBAR\",sbarStr} }\ntheView.SetObjectTag(viewOTag)\n\n\n\n'------------------------------------\n' CREATE LAYER ENTRY FOR EACH THEME\n'------------------------------------\nif (existingConfig = TRUE) then\n  reconfigThms = msgBox.YesNo(\"Do you want to re-configure also all THEMES/LAYERS?. \" + \n               \"All existing manual configuration will be lost.\" + nl +\n               \"Do you want to continue?\",\n               \"WARNING
+: Re-Configure THEMES?\", FALSE)\n  if (reconfigThms = false) then\n    exit\n  end  \nend\n\n\ntheThemes = theView.GetThemes\n\nfor each t in theThemes\n  layConfig = av.Run(\"avmscfg.BaseConfig.ReturnThmProp\", t)\n  t.SetObjectTag(layConfig)\nend  \n\n\n"
+)
+
+(Script.118
+	Name:	"avmscfg.ReConfig.Themes"
+	SourceCode:	"\n' RE-CONFIGURE SELECTED THEMES\n' e.g. after changes to legend\n\n\ntheView = av.GetActiveDoc\ntheThemes = theView.GetThemes\n\nnewThemes = msgBox.MultiListAsString(theThemes, \"Select themes that you want to re-configure.\" + nl+\n                                                \"Note: all manual changes will be lost\", \"Themes to Re-Configure\")\n\nif (newThemes = nil) then exit end\n\nfor each t in newThemes\n  layConfig = av.Run(\"avmscfg.BaseConfig.ReturnThmProp\", t)\n  t.SetObjectTag(layConfig)\nend\n\n"
+)
+
+(Script.119
+	Name:	"avmscfg.EditIni"
+	SourceCode:	"\n'' LOAD INI FILE INTO NOTEPAD\n\nhomeVar = system.getEnvVar(\"AVHOME\")\niniFile = homeVar + \"\\etc\\avpmapper.ini\"\nif (iniFile.AsFileName.IsFile.Not) then\n  msgBox.Error(\"Config file  avpmapper.ini not in directory ..\\ARCVIEW\\ETC\", \"INI File Not Found\")\n  exit\nend  \n\ncmd = \"notepad.exe \" + iniFile \nsystem.Execute(cmd)"
+)
+
+(Script.120
+	Name:	"avmscfg.TileIndexShape"
+	SourceCode:	"\n' =======================================================================================\n'  CREATE TILE POLYGONS FROM IMAGE EXTENTS FOR USE IN MAPSERVER\n'\n'  creates tileindex shapes for images\n'  NOTES: for processing JPEGs, the appropriate extension has to be loaded before\n'         for UNIX servers the images have to be accessable by the Win host via SAMBA \n'\n' =======================================================================================\n\n'----------------------\n' GET IMAGES FROM DISK\n'------
+----------------\nimgList = {}\nwhile (TRUE)\n  srcList = SourceDialog.Showclass(\"Select Images\",ImgSrc)\n  if (srcList.Count < 1) then\n    exit\n  end\n\n  for each i in srcList\n    imgPath = i.GetFileName.AsString.Substitute(\"\\\",\"/\")\n    imgList.Add(imgPath)\n  end\n\n  again = MsgBox.YesNo( \"Do you want to add other images?\", \"Add Other Images\", FALSE )  \n  if (not again) then    \n    break  \n  end\nend\n\n'msgBox.multiListAsString(imgList,\"\",\"\")\n\n\n\n'-----------------------------------\n' OUT SHAPE FILE AS TILEINDEX S
+HAPE\n'-----------------------------------\nfileDef = av.GetProject.MakeFileName(\"tileind\", \"shp\")\nmyFileName = FileDialog.Put(fileDef,\"*.shp\",\"Save the new theme\")\nif (myFileName = nil) then\n  exit\nend  \nnewFTab = FTab.MakeNew(myFileName,Polygon)\n\nGrdID = Field.Make(\"ID_NR\", #FIELD_LONG, 10, 0)\ntheLoc = Field.Make(\"Location\", #FIELD_CHAR, 130, 0)\n\nfldList = {}\nfldList.Add(GrdID)\nfldList.Add(theLoc)\n\nnewFTab.SetEditable(TRUE)\nnewFTab.AddFields(fldList)\n\n\n\n'------------------------\n' WRITE TILE POLYGONS\n'-----
+-------------------\n\n''''''''''''''''''''''''unix'''''''''''''''''''''''''''''''''''''''''''''\n'' FOR UNIX SERVERS \nlabels = {\"WIN PATH\", \"UNIX PATH\"}\ndefVals = {imgList.Get(0).Left(3), \"/var/www/mapserver/\"}     '' <=== CHANGE DEFAULT UNIX PATH HERE\naskStr = \"Change paths WIN -> UNIX.  CANCEL for WIN environment.\"\nsubstLst = msgBox.MultiInput(askStr, \"??? win2unix ???\", labels, defVals)\nif (substLst.Count > 1) then \n  isUnix = TRUE \n  winPath = substLst.Get(0)\n  unixPath = substLst.Get(1)\nelse\n  isUnix = F
+ALSE\nend    \n''''''''''''''''''''''''unix'''''''''''''''''''''''''''''''''''''''''''''\n\nid = 1\nfor each img in imgList\n    myTheme = Theme.Make(SrcName.Make(img))\n    if (myTheme = nil) then\n      continue\n    end  \n\n    minX = myTheme.ReturnExtent.GetLeft.SetFormat(\"d.dddd\")   ''.AsString\n    minY = myTheme.ReturnExtent.GetBottom.SetFormat(\"d.dddd\") ''.AsString\n    maxX = myTheme.ReturnExtent.GetRight.SetFormat(\"d.dddd\")  ''.AsString\n    maxY = myTheme.ReturnExtent.GetTop.SetFormat(\"d.dddd\")    ''.AsString
+\n\n    ' POINTS\n       ' 2--3   <== order of points\n       ' |  |\n       ' 1--4\n\n    p1 = Point.Make(minX,minY)\n    p2 = Point.Make(minX,maxY)\n    p3 = Point.Make(maxX,maxY)\n    p4 = Point.Make(maxX,minY)\n\n    ' POLYGON AND ATTRIBUTE VALUES\n    newPoly = Polygon.Make({{p1, p2, p3, p4}})\n\n    n = newFTab.AddRecord\n    newFTab.SetValue(newFTab.FindField(\"Shape\"),n,newPoly)\n\n    newFTab.SetValue(GrdID,n,id)\n    id = id + 1\n\n    if (isUnix = TRUE) then\n      img = img.Substitute(winPath, unixPath)\n    end  \n\n   
+ newFTab.SetValue(theLoc,n,img)\n\nend\n\nnewFTab.SetEditable(FALSE)\nnewFTab.Flush\n\n\n\n\n\n\n\n\n\n\n\n\n"
+)
+
+(Script.121
+	Name:	"avmscfg_Extension_Install"
+	SourceCode:	"'DO NOT EDIT!!!\n\nif (av.getproject=nil) then return(nil) end\n\n\ntheDocs = SELF.get(0)\ntheDialogs = SELF.get(1)\ntheControlList = SELF.get(2)\ntheMenuList = SELF.get(3)\ntheToolMenuList=SELF.Get(4)\ntheProject=Av.getproject\n\n\n'Add the Docs\n'\nfor each adoc in theDocs\n theProject.addDoc(adoc)\nend\n\n'Add the Dialogs\n'\nfor each adialog in theDialogs\n theProject.addDialog(adialog)\nend\n\n'Add the Controls\n'\nfor each totalControl in theControlList\n   'The Control list\n   acontrol=totalControl.get(0)\n   \n   'The physical c
+ontrol\n   theControl = totalControl.get(1)\n   \n   'The control Index\n   theCindex=totalControl.get(2)\n\n   'Find the DocGUI\n   theControlDoc=av.getproject.findGUI(aControl.get(0))\n     if (theControlDoc=NIL) then   \n       MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n       return(nil)\n     end\n   \n   'This finds the control set  \n  thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n  thescript1=Script.Make(thecommand)\n  thec
+ontrolset=thescript1.doit(\"\")\n  \n  'Add the control to the control set\n  theControlSet.Add(theControl,theCindex)\nend\n\n\n'Add the menus\nfor each totalcontrol in theMenuList\n  \n   'The Control list\n   acontrol=totalControl.get(0)\n      mDoc=acontrol.get(0)\n      mMenu=acontrol.get(1)\n      mMenuItem=acontrol.get(2)\n\n   'The physical control\n   theControl = totalControl.get(1)\n   \n   'The control Index\n   theCindex=totalControl.get(2)\n\n   'Find the DocGUI\n   theControlDoc=av.getproject.findGUI(aControl.get(0))\n
+     if (theControlDoc=NIL) then   \n       MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n       return(nil)\n     end\n   \n  theMbar=av.getproject.findGUI(mDoc).GetMenuBar\n  themenu=theMbar.findbylabel(mMenu)\n  if (themenu=NiL) then\n      themenu=menu.make\n      themenu.setlabel(mMenu)\n      theMbar.add(themenu,999)\n  end\n  \n  themenu.add(thecontrol, theCindex)\nend\n   \n   \n'Add the Tool Menus\n\nfor each totalControl in theToolMenuList\n   'The Control list\n 
+  acontrol=totalControl.get(0)\n   \n   'The physical control\n   theControl = totalControl.get(1)\n   \n   'The control Index\n   theCindex=totalControl.get(2)\n\n   'Find the DocGUI\n   theControlDoc=av.getproject.findGUI(aControl.get(0))\n     if (theControlDoc=NIL) then   \n       MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current project.\",\"Script Eror\")\n       return(nil)\n     end\n   \n   'This finds the control set  \n  thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontr
+ol.get(1)\n  thescript1=Script.Make(thecommand)\n  thecontrolset=av.getproject.findGUI(aControl.get(0)).GetToolBar\n  \n  'Add the control to the control set\n  theControlSet.Add(theControl,theCindex)\nend\n\n\nav.getproject.setmodified(true)\n\n\n'And the scripts add themselves\n"
+)
+
+(Script.122
+	Name:	"avmscfg_Extension_Uninstall"
+	SourceCode:	"'DO NOT EDIT!!!\n\n'The SELF is the Extension\n\ntheDocs = SELF.get(0)\ntheDialogs = SELF.get(1)\ntheControlList = SELF.get(2)\ntheMenuList = SELF.get(3)\ntheToolMenuList=SELF.get(4)\ntheProject=Av.getproject\n\n\n'Remove the Docs\n'\nfor each adoc in theDocs\n If (theProject.finddoc(adoc.getname)<>NIL) then \n  theAnswer=msgbox.yesno(\"Remove the Document \"+adoc.getname+\"?\",\"Remove Document?\",TRUE)\n  if (theAnswer=TRUE) then theProject.RemoveDoc(adoc) end\n end\nend\n\n'Remove the Dialogs\n'\nfor each adialog in theDialogs\n  the
+Project.RemoveDialog(adialog.AsString)\nend\n\n'Removethe Controls\n'\nfor each totalControl in theControlList\n   'Get the control list from the Ext\n   acontrol=totalControl.get(0)\n   \n   'Get the physical Control\n   theControl = totalControl.get(1)\n   \n   'Get the Controls Index\n   theCindex=totalControl.get(2)\n\n   'Find the DocGUI for the Control\n   theControlDoc=av.getproject.findGUI(aControl.get(0))\n     if (theControlDoc=NIL) then   \n       MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the 
+current project.\",\"Script Eror\")\n       return(nil)\n     end\n   \n   'This sequence finds the appropiate control set\n   thecommand=\"av.getproject.findGUI(\"\"\"+aControl.get(0)+\"\"\").Get\"+acontrol.get(1)\n   thescript1=Script.Make(thecommand)\n   thecontrolset=thescript1.doit(\"\")\n\n   'See if the control is in the set , if so remove it\n    if (theControlSet.GetControls.find(theControl)<>NIL) then\n      theControlSet.remove(theControl)\n      if (thecontrol = \"ToolBar\") then\n        theControlSet.selectdefault\n      
+end\n    end\nend\n\n\n'Remove the Menus\n'\nfor each totalcontrol in theMenuList\n  \n   'The Control list\n    acontrol=totalControl.get(0)\n      mDoc=acontrol.get(0)\n      mMenu=acontrol.get(1)\n      mMenuItem=acontrol.get(2)\n\n   'The physical control\n   theControl = totalControl.get(1)\n   \n   'The control Index\n   theCindex=totalControl.get(2)\n\n   'Find the DocGUI\n   theControlDoc=av.getproject.findGUI(aControl.get(0))\n     if (theControlDoc=NIL) then   \n       MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot b
+e found in the current project.\",\"Script Eror\")\n       return(nil)\n     end\n   \n  theMbar=av.getproject.findGUI(mDoc).GetMenuBar\n  themenu=theMbar.findbylabel(mMenu)\n  if (themenu=NiL) then\n       MsgBox.Warning(\"The menu named \"+mMenu+\" is not here.\",\"Script Eror\")\n      'return(nil)\n  else\n  \n    thething=themenu.getcontrols.find(thecontrol)\n    if (thething<>NIL) then \n      themenu.remove(thecontrol) \n    end\n    'msgbox.info(themenu.GetControls.count.asstring,\"\")\n    if (themenu.GetControls.count<1) th
+en\n      theMbar.remove(themenu)\n    end\n  end\nend\n   \nfor each totalControl in theToolMenuList\n   'Get the control list from the Ext\n   acontrol=totalControl.get(0)\n   \n   'Get the physical Control\n   theControl = totalControl.get(1)\n   \n   'Get the Controls Index\n   theCindex=totalControl.get(2)\n\n   'Find the DocGUI for the Control\n   theControlDoc=av.getproject.findGUI(aControl.get(0))\n     if (theControlDoc=NIL) then   \n       MsgBox.Warning(\"The GUI \"+aControl.get(0)+\" cannot be found in the current pr
+oject.\",\"Script Eror\")\n       return(nil)\n     end\n   \n   'This sequence finds the appropiate control set\n   thecontrolset=av.getproject.findGUI(aControl.get(0)).GetToolBar\n\n \n    'See if the control is in the set , if so remove it\n    if (theControlSet.GetControls.find(theControl)<>NIL) then\n \n      theControlSet.remove(theControl)\n      theControlSet.selectdefault\n    end\n\nend\n   \n\n'And the scripts delete themselves\n\n\nav.getproject.setmodified(true)\n"
+)
+

Added: util/arcview3/avpmapper.ini
===================================================================
--- util/arcview3/avpmapper.ini	2006-10-05 22:45:01 UTC (rev 0)
+++ util/arcview3/avpmapper.ini	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,38 @@
+;################################
+; CONFIG FILE FOR AVp.mapper
+; Copy to ArcView /etc directory
+;################################
+
+[SERVER]
+
+;; WebServer name
+webserver = orion
+
+
+;;=======================================================
+;; WEB location of PHP Test Page
+;; indicate 'test_mapfile40.phtml' for MapServer 3.7/4.0
+testpage = /pmapper_demo/test_mapfile.phtml
+
+
+;;===========================================
+;; Directory for test map file 
+;; Must be identical with web location
+mapdir = d:/webdoc/pmapper_demo/
+
+
+;#######################################
+
+[MAPFILE]
+
+datadir    = data
+imagecolor = 255 255 255
+fontset    = d:\webdoc\data\fonts\msfontset.txt
+symbolset  = data/symbols/symbols35.sym
+imgpath    = d:\webdoc\tmp\
+imgurl     = /tmp/
+
+refmapview = View1
+refmapfile = d:\webdoc\tmp\reference.jpg
+
+

Added: util/arcview3/license.txt
===================================================================
--- util/arcview3/license.txt	2006-10-05 22:45:01 UTC (rev 0)
+++ util/arcview3/license.txt	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,27 @@
+-----------------
+   AV-p.mapper
+-----------------
+Copyright (c) 2002-2003 Armin Burger
+
+Permission is hereby granted, free of charge, to any person obtaining 
+a copy of this software and associated documentation files (the "Software"), 
+to deal in the Software without restriction, including without limitation 
+the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+and/or sell copies of the Software, and to permit persons to whom the Software 
+is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included 
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+
+
+

Added: util/arcview3/readme.txt
===================================================================
--- util/arcview3/readme.txt	2006-10-05 22:45:01 UTC (rev 0)
+++ util/arcview3/readme.txt	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,34 @@
+----------------------------------------
+AVPMAPPER 
+ArcView 3 Utility for creating Map files
+----------------------------------------
+
+INSTALLATION
+* Copy the .avx file to the extension directory of ArcView 
+  (e.g. C:\ESRI\AV_GIS30\ARCVIEW\EXT32)
+
+* copy the .ini file to the /etc directory of ArcView
+  (e.g. C:\ESRI\AV_GIS30\ARCVIEW\ETC)
+  modify default values to meet your local configuration
+  the part under [SERVER] is only neede if you want to test
+  the settings with the php script 'test_mapfile.phtml'
+  
+  
+  
+USAGE
+* run 'p.mapper - Base Configuration' to define basic parameters
+* open the main dialog window with the menu item 'MapFile Creator'
+* change settings if needed
+
+
+TEST
+If the configuration in the ini file is correct for the path in the
+section [SERVER] you can test your map file in the MapFile Creator Dialog
+using the button 'Test Map File'. This function requires a correct 
+setup of your PHP/MapScript installation.
+
+
+TODO
+Add configuration dialog for theme fields to be included in query.
+
+

Added: util/group.php
===================================================================
--- util/group.php	2006-10-05 22:45:01 UTC (rev 0)
+++ util/group.php	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,220 @@
+<?php
+/*********************************************************************************
+ Copyright (c) 2002-2003 Armin Burger
+ 
+ Permission is hereby granted, free of charge, to any person obtaining 
+ a copy of this software and associated documentation files (the "Software"), 
+ to deal in the Software without restriction, including without limitation 
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ and/or sell copies of the Software, and to permit persons to whom the Software 
+ is furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included 
+ in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR 
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+**********************************************************************************/
+
+
+/*
+ * CLASS FOR GROUPS
+ *******************************************************************/
+class GROUP
+{
+    function GROUP($groupName)
+    {
+        $this->groupName = $groupName;
+        $this->selHeaders = array();
+        $this->layerList = array();
+    }
+
+    function setDescription($description)
+    {
+        $this->description = $description;
+    }
+
+    function addLayer($layer)
+    {
+        array_push($this->layerList, $layer);
+    }
+
+    function setResHeaders($selHeaders)
+    {
+        $this->selHeaders = $selHeaders;
+    }
+
+    function printGroupName()
+    {
+        echo $this->groupName;
+    }
+
+
+    //*** RETURN FUNCTIONS ***//
+    function getGroupName()
+    {
+        return $this->groupName;
+    }
+
+    function getDescription()
+    {
+        return $this->description;
+    }
+    
+    function getLayers()
+    {
+        return $this->layerList;
+    }
+    
+    function getResHeaders()
+    {
+        return $this->selHeaders;
+    }
+
+}
+
+
+/*
+ * CLASS FOR GROUP LAYERS
+ *******************************************************************/
+
+class GLAYER
+{
+    function GLAYER($glayerName)
+    {
+        $this->glayerName = $glayerName;
+        $this->selFields = array();
+        $this->hyperFields = array();
+    }
+
+    function setLayerIdx($glayerIdx)
+    {
+        $this->glayerIdx = $glayerIdx;
+    }
+
+    function setLayerType($glayerType)
+    {
+        $this->glayerType = $glayerType;
+    }
+
+    function setResFields($selFields)
+    {
+        $this->selFields = $selFields;
+    }
+
+    function setHyperFields($hyperFields)
+    {
+        $this->hyperFields = $hyperFields;
+    }
+
+    function setTableJoin($joinList)
+    {
+        $this->joinList = $joinList;
+    }
+
+    function setClasses($classes)
+    {
+        $this->classes = $classes;
+    }
+    
+    function setLabelItem($labelItem)
+    {
+        $this->labelItem = $labelItem;
+    }
+
+    function setXYLayerAttribute()
+    {
+        $this->isXYLayer = 1;
+    }
+    
+    function setXYLayerProperties($XYLayerProperties)
+    {
+        $this->XYLayerProperties = $XYLayerProperties;
+    }
+    
+    function setSkipLegend($skipLegend)
+    {
+        $this->skipLegend = $skipLegend;
+    }
+    
+
+
+    //*** GLOBAL RETURN FUNCTIONS ***//
+
+    function getLayerName()
+    {
+        return $this->glayerName;
+    }
+
+    function getLayerIdx()
+    {
+        return $this->glayerIdx;
+    }
+
+    function getLayerType()
+    {
+        return $this->glayerType;
+    }
+
+    function getResFields()
+    {
+        return $this->selFields;
+    }
+
+    function getHyperFields()
+    {
+        return $this->hyperFields;
+    }
+
+    function getTableJoin()
+    {
+        return $this->joinList;
+    }
+
+    function getClasses()
+    {
+        return $this->classes;
+    }
+    
+    function getLabelItem()
+    {
+        return $this->labelItem;
+    }
+    
+    function checkForXYLayer()
+    {
+        return $this->isXYLayer;
+    }
+    
+    function getXYLayerProperties()
+    {
+        return $this->XYLayerProperties;
+    }
+    
+    function getSkipLegend()
+    {
+        return $this->skipLegend;
+    }
+}
+
+
+
+function getGLayerByName($gLayerName) 
+{
+    $grouplist = $_SESSION["grouplist"];
+    foreach ($grouplist as $grp) {
+        $glayerList = $grp->getLayers();
+        foreach ($glayerList as $glayer) {
+            if ($glayer->getLayerName() == $gLayerName) {
+                return $glayer;
+            }
+        }
+    }
+}
+
+
+?>

Added: util/readsession.php_
===================================================================
--- util/readsession.php_	2006-10-05 22:45:01 UTC (rev 0)
+++ util/readsession.php_	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,91 @@
+<?php
+require_once("group.php");
+
+
+$sessLocation = str_replace('\\', '/', ini_get("session.save_path"));
+
+
+if (isset($_GET['PHPSESSID'])) {
+    $sessid = $_GET['PHPSESSID'];
+    $sessFile = str_replace('\\', '/', realpath($sessLocation . "/sess_" . $sessid));
+} else {
+    $fl = scandir_by_mtime($sessLocation);
+    $sessFile = str_replace('\\', '/', realpath($sessLocation . "/". array_pop($fl)));
+}
+
+
+if (is_file($sessFile)) {
+    $fh = fopen($sessFile, "r");
+    $sess_data = fread($fh, filesize($sessFile));
+    //echo($sess_data);
+    fclose($fh);
+
+    $sess_list = unserialize_session_data($sess_data);
+    ksort($sess_list);
+    
+    $fileOK = 1;
+}
+
+
+function unserialize_session_data($serialized_string) 
+{
+   $variables = array(  );
+   $a = preg_split( "/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
+   for( $i = 0; $i < count( $a ); $i = $i+2 ) {
+       $variables[$a[$i]] = unserialize( $a[$i+1] );
+   }
+   return( $variables );
+}
+
+
+function scandir_by_mtime($folder) {
+    $dircontent = scandir($folder);
+    $arr = array();
+    foreach($dircontent as $filename) {
+        if ($filename != '.' && $filename != '..' && substr($filename, 0, 5) == "sess_") {
+            if (filemtime($folder . "/" . $filename) === false) return false;
+            $dat = date("YmdHis", filemtime($folder . "/" . $filename));
+            $arr[$dat] = $filename;
+        }
+    }
+    if (!ksort($arr)) return false;
+    return $arr;
+}
+
+
+?>
+<html>
+<body>
+
+Newest Session File: <?php echo $sessFile ?>
+<p>
+
+<form action="readsession.php">
+    PHPSESSID
+    <input type="text" size=20 value="<?php echo $sessid ?>" name="PHPSESSID">
+</form>
+<pre>
+<?php 
+
+//print_r($sess_list);
+if ($fileOK) {
+    foreach ($sess_list as $k=>$v) {
+        if (!is_array($sess_list[$k])) {
+            $na .= "[<b>$k</b>]: $v\n";
+        } else {
+            $al[$k] = $sess_list[$k];
+        }
+    }
+    
+    echo $na;
+    
+    foreach ($al as $ak=>$a) {
+        echo("\n[<b>$ak</b>]:\n");  
+        print_r($a);
+    }
+}
+?>
+</pre>
+
+</body>
+</html>
\ No newline at end of file

Added: util/test_mapfile.phtml
===================================================================
--- util/test_mapfile.phtml	2006-10-05 22:45:01 UTC (rev 0)
+++ util/test_mapfile.phtml	2006-10-29 14:54:24 UTC (rev 1)
@@ -0,0 +1,208 @@
+<?php
+
+/**********************************************************************************************
+  USAGE: call the page like
+  http://host/pmapper/test_mapfile.phtml?mapfile=/home/www/pmapper/config/pmapper_demo.map
+***********************************************************************************************/
+
+session_start();
+
+
+// Load MapScript module.
+if (!extension_loaded('MapScript')) {
+    if (PHP_OS == "WINNT" || PHP_OS == "WIN32") {
+        dl("php_mapscript_48.dll");
+    } else {
+        dl("php_mapscript.so");
+    }
+}
+
+
+// Initialize MAP
+if (isset($_GET["mapfile"])) {
+    $mapfile = $_GET["mapfile"];
+} elseif (isset($_SESSION["mapfile"])) {
+    $mapfile = $_SESSION["mapfile"];
+}
+
+
+$map = ms_newMapObj($mapfile);
+
+// MAP dimension x/y
+$mapwidth = 500;
+$mapheight = 350;
+
+// Set MAP size
+$map->set(width, $mapwidth);
+$map->set(height, $mapheight);
+
+// Max extent
+$maxextent = $map->extent;
+
+// DEFAULT LAYERS
+//$defLayers = $map->getAllLayerNames();
+$defLayers = array("municipal");
+
+
+//
+// Switch ON/OFF Layers
+//
+// ead from url || SID || common.php
+if (isset($_GET["drawlayers"])) {
+    $drawlayers = $_GET["drawlayers"];
+} elseif ($_SESSION["drawlayers"] != "" && count($_SESSION["drawlayers"]) > 0) {
+    $drawlayers = $_SESSION["drawlayers"];
+} else {
+    $drawlayers = $defLayers;
+}
+
+// APPLY ON LAYERS DEFINED IN MAP FILE
+$alllayers = $map->getAllLayerNames();
+
+foreach ($alllayers as $i){
+    if (in_array($i, $drawlayers, TRUE)) {
+        $lay = $map->getLayerByName($i);
+        $lay->set(status, MS_ON);
+    } else {
+        $lay = $map->getLayerByName($i);
+        $lay->set(status, MS_OFF);
+    }
+}
+
+if (isset($_GET["PHPSESSID"])) {
+    // zoom/pan actions
+    if (isset($_GET["mapimg_x"])) {
+        $pix_xy = ms_newPointObj();
+        $pix_xy->setXY($_GET["mapimg_x"], $_GET["mapimg_y"]);
+        $zoomfactor = $_GET["zoom"];
+    } else {
+        $pix_xy = ms_newPointObj();
+        $pix_xy->setXY($mapwidth/2, $mapheight/2);
+        $zoomfactor = 1;
+    }
+
+    $geoext0 = ms_newrectObj();
+    $geoext0->setextent($_SESSION["geo_minx"],$_SESSION["geo_miny"],$_SESSION["geo_maxx"],$_SESSION["geo_maxy"]);
+
+    $map->zoompoint($zoomfactor, $pix_xy, $mapwidth, $mapheight, $geoext0, $maxextent);
+    $pix_xy->free();
+}
+
+
+if (isset($_GET["zoom"])) {
+    $zoom = $_GET["zoom"];
+} else {
+    $zoom = 2;
+}
+
+
+// MAP
+$map->selectOutputFormat("png");
+$map_img = $map->draw();
+$map_url = $map_img->saveWebImage();
+$map_img->free();
+
+$geo_minx = $map->extent->minx;
+$geo_miny = $map->extent->miny;
+$geo_maxx = $map->extent->maxx;
+$geo_maxy = $map->extent->maxy;
+$geo_scale = $map->scale;
+
+
+//SCALEBAR
+$scalebar_img = $map->drawScaleBar();
+$scalebarurl = $scalebar_img->saveWebImage();
+$scalebar_img->free();
+
+
+// LEGEND
+$legend = $map->legend;
+$legend->set("keysizex", 20);
+$legend->set("keysizey", 15);
+
+$leglabl = $legend->label;
+#$leglabl->set("offsetx", 2);
+$leglabl->set("offsety", -2);
+$leglabl->set("type", MS_BITMAP);
+$leglabl->set("size", MS_SMALL);
+
+$leglabl->color->setRGB(0, 0, 0);
+
+$leg_img = $map->drawLegend();
+$legurl = $leg_img->saveWebImage();
+$leg_img->free();
+
+
+?>
+<HTML>
+<HEAD> <TITLE> MapFile Test Suite </TITLE>
+</HEAD>
+<BODY BGCOLOR="#CCCCCC">
+<form name="layerform" method=get action="test_mapfile.phtml">
+ <table>
+  <tr>
+   <td valign="top">
+    <table border=0 cellspacing=0 cellpadding=0>
+     <tr>
+      <td colspan=2><input type=image name="mapimg" <?php echo("SRC=$map_url >") ?> </td>
+     </tr>
+     <tr BGCOLOR="#E2E2E2">
+      <td><img src="<? echo $scalebarurl ?>"></td>
+      <td>Scale 1: <? echo round($geo_scale) ?></td>
+     </tr>
+    </table>
+   <td valign="top">
+    <table>
+     <tr>
+      <td>
+        <input type=radio name="zoom" <? echo ($zoom ==2 ? "checked " : "") ?> value="2">Zoom IN <br>
+        <input type=radio name="zoom" <? echo ($zoom ==1 ? "checked " : "") ?>value="1">PAN <br>
+        <input type=radio name="zoom" <? echo ($zoom ==-2 ? "checked " : "") ?>value="-2">Zoom OUT <p>
+        <input type=submit value="Refresh Map"><br><p>
+      </td>
+     </tr>
+     <tr><td>
+         <table>
+          <tr><td><b>LAYERS</b></td></tr>
+          <?php
+             foreach ($alllayers as $l){
+                echo "      <tr> \n";
+                echo "        <td><input type=\"checkbox\" name=\"drawlayers[]\" value=\"$l\" onclick=submit() ";
+                if (in_array($l, $drawlayers, TRUE)){
+                    echo "checked";
+                }
+                echo ">$l</td> \n";
+                echo "      </tr> \n";
+             }
+           ?>
+         </table>
+      </tr>
+     </table>
+
+   </td>
+   
+   <td valign="top">
+    LEGEND <br>
+    <!-- <img src="<? echo $legurl ?>"> -->
+   </td>
+  </tr>
+ <table>
+</form>
+
+<?php
+
+// SESSION VARS
+$_SESSION["mapfile"]    = $mapfile;
+$_SESSION["zoom"]       = $zoom;
+$_SESSION["drawlayers"] = $drawlayers;
+$_SESSION["geo_minx"]   = $geo_minx;
+$_SESSION["geo_miny"]   = $geo_miny;
+$_SESSION["geo_maxx"]   = $geo_maxx;
+$_SESSION["geo_maxy"]   = $geo_maxy;
+$_SESSION["geo_scale"]  = $geo_scale;
+
+
+?>
+</BODY>
+</HTML>
+



More information about the Pmap-commits mailing list