[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mapbender-commits
Subject:    [Mapbender-commits] r2566 - in branches: . testbaudson_dev
From:       svn_mapbender () osgeo ! org
Date:       2008-06-30 14:13:04
Message-ID: 20080630141304.36387E01897 () lists ! osgeo ! org
[Download RAW message or body]

Author: christoph
Date: 2008-06-30 10:13:03 -0400 (Mon, 30 Jun 2008)
New Revision: 2566

Added:
   branches/testbaudson_dev/
   branches/testbaudson_dev/ext/
   branches/testbaudson_dev/ext/JSON.php
   branches/testbaudson_dev/ext/OpenLayers.js
   branches/testbaudson_dev/ext/jqjson.js
   branches/testbaudson_dev/ext/jquery-1.2.6.min.js
   branches/testbaudson_dev/ext/jquery-ui-personalized-1.5.min.js
   branches/testbaudson_dev/ext/jquery.ajaxmanager.js
   branches/testbaudson_dev/ext/jquery.mousewheel.min.js
   branches/testbaudson_dev/ext/phpmailer-1.72/
   branches/testbaudson_dev/lib/database-mysql.php
   branches/testbaudson_dev/lib/database-pgsql.php
   branches/testbaudson_dev/mod/
   branches/testbaudson_dev/mod/body/
   branches/testbaudson_dev/mod/body/body.js
   branches/testbaudson_dev/mod/editApplication/
   branches/testbaudson_dev/mod/editApplication/alignButton.js
   branches/testbaudson_dev/mod/editApplication/draggableButton.js
   branches/testbaudson_dev/mod/editApplication/resizableButton.js
   branches/testbaudson_dev/mod/editApplication/saveButton.js
   branches/testbaudson_dev/mod/editApplication/selectableButton.js
   branches/testbaudson_dev/mod/mapframe1/
   branches/testbaudson_dev/mod/mapframe1/map.js
   branches/testbaudson_dev/mod/mapframe1/map_obj.js
   branches/testbaudson_dev/mod/mapframe1/mapframe1.php
   branches/testbaudson_dev/mod/mapframe1/wfs_obj.js
   branches/testbaudson_dev/mod/mapframe1/wms.js
   branches/testbaudson_dev/mod/ol/
   branches/testbaudson_dev/mod/ol/openlayers.php
Removed:
   branches/testbaudson_dev/http/classes/phpmailer-1.72/
   branches/testbaudson_dev/http/extensions/JSON.php
   branches/testbaudson_dev/http/extensions/OpenLayers.js
   branches/testbaudson_dev/http/extensions/jqjson.js
   branches/testbaudson_dev/http/extensions/jquery-1.2.6.min.js
   branches/testbaudson_dev/http/extensions/jquery-ui-personalized-1.5.min.js
   branches/testbaudson_dev/http/extensions/jquery.ajaxmanager.js
   branches/testbaudson_dev/http/extensions/jquery.js
   branches/testbaudson_dev/http/extensions/jquery.mousewheel.min.js
   branches/testbaudson_dev/http/extensions/json.js
   branches/testbaudson_dev/http/frames/jquery.html
   branches/testbaudson_dev/http/javascripts/initOpenLayersWms.php
   branches/testbaudson_dev/http/javascripts/initWms.php
   branches/testbaudson_dev/http/javascripts/map.js
   branches/testbaudson_dev/http/javascripts/map_obj.js
   branches/testbaudson_dev/http/javascripts/mod_openlayers.php
   branches/testbaudson_dev/http/javascripts/wfs_obj.js
   branches/testbaudson_dev/http/javascripts/wms.js
   branches/testbaudson_dev/http/php/database-mysql.php
   branches/testbaudson_dev/http/php/database-pgsql.php
   branches/testbaudson_dev/lib/alignButton.js
   branches/testbaudson_dev/lib/draggableButton.js
   branches/testbaudson_dev/lib/resizableButton.js
   branches/testbaudson_dev/lib/saveButton.js
   branches/testbaudson_dev/lib/selectableButton.js
Modified:
   branches/testbaudson_dev/conf/mapbender.conf-dist
   branches/testbaudson_dev/http/classes/class_administration.php
   branches/testbaudson_dev/http/classes/class_checkInput.php
   branches/testbaudson_dev/http/classes/class_connector.php
   branches/testbaudson_dev/http/classes/class_json.php
   branches/testbaudson_dev/http/classes/class_mb_exception.php
   branches/testbaudson_dev/http/classes/class_mb_log.php
   branches/testbaudson_dev/http/classes/class_mb_notice.php
   branches/testbaudson_dev/http/classes/class_mb_warning.php
   branches/testbaudson_dev/http/classes/class_user.php
   branches/testbaudson_dev/http/classes/class_wmc.php
   branches/testbaudson_dev/http/classes/class_wms.php
   branches/testbaudson_dev/http/javascripts/map.php
   branches/testbaudson_dev/http/php/mod_editApplication.php
   branches/testbaudson_dev/lib/core.js
Log:


Copied: branches/testbaudson_dev (from rev 2556, trunk/mapbender)

Modified: branches/testbaudson_dev/conf/mapbender.conf-dist
==================================================================--- \
                trunk/mapbender/conf/mapbender.conf-dist	2008-06-24 12:33:05 UTC (rev \
                2556)
+++ branches/testbaudson_dev/conf/mapbender.conf-dist	2008-06-30 14:13:03 UTC (rev \
2566) @@ -23,7 +23,7 @@
 	define("OWNER", "<owner>");
 	define("PW", "<password>");

-	include_once(dirname(__FILE__) . "/../http/php/database-mysql.php");
+	include_once(dirname(__FILE__) . "/../lib/database-mysql.php");

 	# --------------------------------------------
 	# database with geos functions
@@ -43,7 +43,7 @@
 	define("OWNER", "<owner>");
 	define("PW", "<password>");

-	include_once(dirname(__FILE__) . "/../http/php/database-pgsql.php");
+	include_once(dirname(__FILE__) . "/../lib/database-pgsql.php");
 }

 # --------------------------------------------

Copied: branches/testbaudson_dev/ext/JSON.php (from rev 2556, \
trunk/mapbender/http/extensions/JSON.php) \
==================================================================--- \
                branches/testbaudson_dev/ext/JSON.php	                        (rev 0)
+++ branches/testbaudson_dev/ext/JSON.php	2008-06-30 14:13:03 UTC (rev 2566)
@@ -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@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?id8
+ */
+
+/**
+ * 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) +        {
+
+        }
+    }
+
+}
+
+?>

Copied: branches/testbaudson_dev/ext/OpenLayers.js (from rev 2556, \
trunk/mapbender/http/extensions/OpenLayers.js) \
==================================================================--- \
                branches/testbaudson_dev/ext/OpenLayers.js	                        \
                (rev 0)
+++ branches/testbaudson_dev/ext/OpenLayers.js	2008-06-30 14:13:03 UTC (rev 2566)
@@ -0,0 +1,1382 @@
+/*
+
+  OpenLayers.js -- OpenLayers Map Viewer Library
+
+  Copyright 2005-2008 MetaCarta, Inc., released under the Clear BSD license.
+  Please see http://svn.openlayers.org/trunk/openlayers/license.txt
+  for the full text of the license.
+
+  Includes compressed code under the following licenses:
+
+  (For uncompressed versions of the code used please see the
+  OpenLayers SVN repository: <http://openlayers.org/>)
+
+*/
+
+/* Contains portions of Prototype.js:
+ *
+ * Prototype JavaScript framework, version 1.4.0
+ *  (c) 2005 Sam Stephenson <sam@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/
+ *
+ *--------------------------------------------------------------------------*/
+
+/**
+*
+*  Contains portions of Rico <http://openrico.org/>
+*
+*  Copyright 2005 Sabre Airline Solutions
+*
+*  Licensed under the Apache License, Version 2.0 (the "License"); you
+*  may not use this file except in compliance with the License. You
+*  may obtain a copy of the License at
+*
+*         http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+*  implied. See the License for the specific language governing
+*  permissions and limitations under the License.
+*
+**/
+
+var OpenLayers={singleFile:true};(function(){var singleFile=(typeof \
OpenLayers=="object"&&OpenLayers.singleFile);window.OpenLayers={_scriptName:(!singleFile)?"lib/OpenLayers.js":"OpenLayers.js",_getScriptLocation:function(){var \
scriptLocation="";var scriptName=OpenLayers._scriptName;var \
scripts=document.getElementsByTagName('script');for(var i=0;i<scripts.length;i++){var \
src=scripts[i].getAttribute('src');if(src){var index=src.lastIndexOf(scriptName);var \
pathLength=src.lastIndexOf('?');if(pathLength<0){pathLength=src.length;} \
+if((index>-1)&&(index+scriptName.length==pathLength)){scriptLocation=src.slice(0,pathLength-scriptName.length);break;}}}
 +return scriptLocation;}};if(!singleFile){var jsfiles=new \
Array("OpenLayers/Util.js","OpenLayers/BaseTypes.js","OpenLayers/BaseTypes/Class.js"," \
OpenLayers/BaseTypes/Bounds.js","OpenLayers/BaseTypes/Element.js","OpenLayers/BaseType \
s/LonLat.js","OpenLayers/BaseTypes/Pixel.js","OpenLayers/BaseTypes/Size.js","OpenLayer \
s/Console.js","OpenLayers/Tween.js","Rico/Corner.js","Rico/Color.js","OpenLayers/Ajax. \
js","OpenLayers/Events.js","OpenLayers/Projection.js","OpenLayers/Map.js","OpenLayers/ \
Layer.js","OpenLayers/Icon.js","OpenLayers/Marker.js","OpenLayers/Marker/Box.js","Open \
Layers/Popup.js","OpenLayers/Tile.js","OpenLayers/Tile/Image.js","OpenLayers/Tile/WFS. \
js","OpenLayers/Layer/Image.js","OpenLayers/Layer/SphericalMercator.js","OpenLayers/La \
yer/EventPane.js","OpenLayers/Layer/FixedZoomLevels.js","OpenLayers/Layer/Google.js"," \
OpenLayers/Layer/VirtualEarth.js","OpenLayers/Layer/Yahoo.js","OpenLayers/Layer/HTTPRequest.js","OpenLayers/Layer/Grid.js","OpenLayers/Layer/MapGuide.js","Ope
  nLayers/Layer/MapServer.js","OpenLayers/Layer/MapServer/Untiled.js","OpenLayers/Laye \
r/KaMap.js","OpenLayers/Layer/MultiMap.js","OpenLayers/Layer/Markers.js","OpenLayers/L \
ayer/Text.js","OpenLayers/Layer/WorldWind.js","OpenLayers/Layer/WMS.js","OpenLayers/La \
yer/WMS/Untiled.js","OpenLayers/Layer/GeoRSS.js","OpenLayers/Layer/Boxes.js","OpenLaye \
rs/Layer/TMS.js","OpenLayers/Layer/TileCache.js","OpenLayers/Popup/Anchored.js","OpenL \
ayers/Popup/AnchoredBubble.js","OpenLayers/Popup/Framed.js","OpenLayers/Popup/FramedCl \
oud.js","OpenLayers/Feature.js","OpenLayers/Feature/Vector.js","OpenLayers/Feature/WFS \
.js","OpenLayers/Handler.js","OpenLayers/Handler/Click.js","OpenLayers/Handler/Hover.j \
s","OpenLayers/Handler/Point.js","OpenLayers/Handler/Path.js","OpenLayers/Handler/Poly \
gon.js","OpenLayers/Handler/Feature.js","OpenLayers/Handler/Drag.js","OpenLayers/Handl \
er/RegularPolygon.js","OpenLayers/Handler/Box.js","OpenLayers/Handler/MouseWheel.js","OpenLayers/Handler/Keyboard.js","OpenLayers/C
  ontrol.js","OpenLayers/Control/Attribution.js","OpenLayers/Control/Button.js","OpenL \
ayers/Control/ZoomBox.js","OpenLayers/Control/ZoomToMaxExtent.js","OpenLayers/Control/ \
DragPan.js","OpenLayers/Control/Navigation.js","OpenLayers/Control/MouseDefaults.js"," \
OpenLayers/Control/MousePosition.js","OpenLayers/Control/OverviewMap.js","OpenLayers/C \
ontrol/KeyboardDefaults.js","OpenLayers/Control/PanZoom.js","OpenLayers/Control/PanZoo \
mBar.js","OpenLayers/Control/ArgParser.js","OpenLayers/Control/Permalink.js","OpenLaye \
rs/Control/Scale.js","OpenLayers/Control/ScaleLine.js","OpenLayers/Control/LayerSwitch \
er.js","OpenLayers/Control/DrawFeature.js","OpenLayers/Control/DragFeature.js","OpenLa \
yers/Control/ModifyFeature.js","OpenLayers/Control/Panel.js","OpenLayers/Control/Selec \
tFeature.js","OpenLayers/Control/NavigationHistory.js","OpenLayers/Geometry.js","OpenL \
ayers/Geometry/Rectangle.js","OpenLayers/Geometry/Collection.js","OpenLayers/Geometry/Point.js","OpenLayers/Geometry/MultiPoint.js"
  ,"OpenLayers/Geometry/Curve.js","OpenLayers/Geometry/LineString.js","OpenLayers/Geom \
etry/LinearRing.js","OpenLayers/Geometry/Polygon.js","OpenLayers/Geometry/MultiLineStr \
ing.js","OpenLayers/Geometry/MultiPolygon.js","OpenLayers/Geometry/Surface.js","OpenLa \
yers/Renderer.js","OpenLayers/Renderer/Elements.js","OpenLayers/Renderer/SVG.js","Open \
Layers/Renderer/VML.js","OpenLayers/Layer/Vector.js","OpenLayers/Layer/PointTrack.js", \
"OpenLayers/Layer/GML.js","OpenLayers/Style.js","OpenLayers/StyleMap.js","OpenLayers/R \
ule.js","OpenLayers/Filter.js","OpenLayers/Filter/FeatureId.js","OpenLayers/Filter/Log \
ical.js","OpenLayers/Filter/Comparison.js","OpenLayers/Format.js","OpenLayers/Format/X \
ML.js","OpenLayers/Format/GML.js","OpenLayers/Format/KML.js","OpenLayers/Format/GeoRSS \
.js","OpenLayers/Format/WFS.js","OpenLayers/Format/WKT.js","OpenLayers/Format/OSM.js", \
"OpenLayers/Format/SLD.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/SLD/v1_0_0.js","OpenLayers/Format/Text.js","OpenLayers/
  Format/JSON.js","OpenLayers/Format/GeoJSON.js","OpenLayers/Format/WMC.js","OpenLayer \
s/Format/WMC/v1.js","OpenLayers/Format/WMC/v1_0_0.js","OpenLayers/Format/WMC/v1_1_0.js \
","OpenLayers/Layer/WFS.js","OpenLayers/Control/MouseToolbar.js","OpenLayers/Control/N \
avToolbar.js","OpenLayers/Control/EditingToolbar.js","OpenLayers/Lang.js","OpenLayers/Lang/en.js");var \
agent=navigator.userAgent;var \
docWrite=(agent.match("MSIE")||agent.match("Safari"));if(docWrite){var \
allScriptTags=new Array(jsfiles.length);} +var \
host=OpenLayers._getScriptLocation()+"lib/";for(var \
i=0;i<jsfiles.length;i++){if(docWrite){allScriptTags[i]="<script \
src='"+host+jsfiles[i]+"'></script>";}else{var \
s=document.createElement("script");s.src=host+jsfiles[i];var \
h=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;h.appendChild(s);}}
 +if(docWrite){document.write(allScriptTags.join(""));}}})();OpenLayers.VERSION_NUMBER="$Revision: \
6819 $";OpenLayers.String={startsWith:function(str,sub){return(str.indexOf(sub)==0);}, \
contains:function(str,sub){return(str.indexOf(sub)!=-1);},trim:function(str){return \
str.replace(/^\s*(.*?)\s*$/,"$1");},camelize:function(str){var \
oStringList=str.split('-');var camelizedString=oStringList[0];for(var \
i=1;i<oStringList.length;i++){var \
s=oStringList[i];camelizedString+=s.charAt(0).toUpperCase()+s.substring(1);} +return \
camelizedString;},format:function(template,context,args){if(!context){context=window;}
 +var tokens=template.split("${");var item,last,replacement;for(var \
i=1;i<tokens.length;i++){item=tokens[i];last=item.indexOf("}");if(last>0){replacement=context[item.substring(0,last)];if(typeof \
replacement=="function"){replacement=args?replacement.apply(null,args):replacement();}
 +tokens[i]=replacement+item.substring(++last);}else{tokens[i]="${"+item;}}
+return tokens.join("");}};if(!String.prototype.startsWith){String.prototype.startsWit \
h=function(sStart){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{'newMethod':'OpenLayers.String.startsWith'}));return \
OpenLayers.String.startsWith(this,sStart);};} \
+if(!String.prototype.contains){String.prototype.contains=function(str){OpenLayers.Con \
sole.warn(OpenLayers.i18n("methodDeprecated",{'newMethod':'OpenLayers.String.contains'}));return \
OpenLayers.String.contains(this,str);};} \
+if(!String.prototype.trim){String.prototype.trim=function(){OpenLayers.Console.warn(O \
penLayers.i18n("methodDeprecated",{'newMethod':'OpenLayers.String.trim'}));return \
OpenLayers.String.trim(this);};} \
+if(!String.prototype.camelize){String.prototype.camelize=function(){OpenLayers.Consol \
e.warn(OpenLayers.i18n("methodDeprecated",{'newMethod':'OpenLayers.String.camelize'}));return \
OpenLayers.String.camelize(this);};} \
+OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(num,sig){var \
fig=0;if(sig>0){fig=parseFloat(num.toPrecision(sig));} +return \
fig;},format:function(num,dec,tsep,dsep){dec=(typeof \
dec!="undefined")?dec:0;tsep=(typeof \
tsep!="undefined")?tsep:OpenLayers.Number.thousandsSeparator;dsep=(typeof \
dsep!="undefined")?dsep:OpenLayers.Number.decimalSeparator;if(dec!=null){num=parseFloat(num.toFixed(dec));}
 +var parts=num.toString().split(".");if(parts.length==1&&dec==null){dec=0;}
+var integer=parts[0];if(tsep){var \
thousands=/(-?[0-9]+)([0-9]{3})/;while(thousands.test(integer)){integer=integer.replace(thousands,"$1"+tsep+"$2");}}
 +var str;if(dec==0){str=integer;}else{var \
rem=parts.length>1?parts[1]:"0";if(dec!=null){rem=rem+new \
Array(dec-rem.length+1).join("0");} +str=integer+dsep+rem;}
+return str;}};if(!Number.prototype.limitSigDigs){Number.prototype.limitSigDigs=functi \
on(sig){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{'newMethod':'OpenLayers.String.limitSigDigs'}));return \
OpenLayers.Number.limitSigDigs(this,sig);};} \
+OpenLayers.Function={bind:function(func,object){var \
args=Array.prototype.slice.apply(arguments,[2]);return function(){var \
newArgs=args.concat(Array.prototype.slice.apply(arguments,[0]));return \
func.apply(object,newArgs);};},bindAsEventListener:function(func,object){return \
function(event){return \
func.call(object,event||window.event);};}};if(!Function.prototype.bind){Function.proto \
type.bind=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{'newM \
ethod':'OpenLayers.String.bind'}));Array.prototype.unshift.apply(arguments,[this]);return \
OpenLayers.Function.bind.apply(null,arguments);};} \
+if(!Function.prototype.bindAsEventListener){Function.prototype.bindAsEventListener=fu \
nction(object){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{'newMethod':'OpenLayers.String.bindAsEventListener'}));return \
OpenLayers.Function.bindAsEventListener(this,object);};} \
+OpenLayers.Array={filter:function(array,callback,caller){var \
selected=[];if(Array.prototype.filter){selected=array.filter(callback,caller);}else{var \
len=array.length;if(typeof callback!="function"){throw new TypeError();} +for(var \
i=0;i<len;i++){if(i in array){var \
val=array[i];if(callback.call(caller,val,i,array)){selected.push(val);}}}} +return \
selected;}};OpenLayers.Class=function(){var \
Class=function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments);}};var \
extended={};var parent;for(var i=0;i<arguments.length;++i){if(typeof \
arguments[i]=="function"){parent=arguments[i].prototype;}else{parent=arguments[i];} \
+OpenLayers.Util.extend(extended,parent);} +Class.prototype=extended;return \
Class;};OpenLayers.Class.isPrototype=function(){};OpenLayers.Class.create=function(){return \
function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments);}};};OpenLayers.Class.inherit=function(){var \
superClass=arguments[0];var proto=new \
superClass(OpenLayers.Class.isPrototype);for(var \
i=1;i<arguments.length;i++){if(typeof arguments[i]=="function"){var \
mixin=arguments[i];arguments[i]=new mixin(OpenLayers.Class.isPrototype);} \
+OpenLayers.Util.extend(proto,arguments[i]);} +return \
proto;};OpenLayers.Util={};OpenLayers.Util.getElement=function(){var \
elements=[];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;};if($==null){var $=OpenLayers.Util.getElement;}
+OpenLayers.Util.extend=function(destination,source){if(destination&&source){for(var \
property in source){var \
value=source[property];if(value!==undefined){destination[property]=value;}} +var \
sourceIsEvt=typeof window.Event=="function"&&source instanceof \
window.Event;if(!sourceIsEvt&&source.hasOwnProperty&&source.hasOwnProperty('toString')){destination.toString=source.toString;}}
 +return destination;};OpenLayers.Util.removeItem=function(array,item){for(var \
i=array.length-1;i>=0;i--){if(array[i]==item){array.splice(i,1);}} +return \
array;};OpenLayers.Util.clearArray=function(array){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{'newMethod':'array \
= []'}));array.length=0;};OpenLayers.Util.indexOf=function(array,obj){for(var \
i=0;i<array.length;i++){if(array[i]==obj){return i;}} \
+return-1;};OpenLayers.Util.modifyDOMElement=function(element,id,px,sz,position,border,overflow,opacity){if(id){element.id=id;}
 +if(px){element.style.left=px.x+"px";element.style.top=px.y+"px";}
+if(sz){element.style.width=sz.w+"px";element.style.height=sz.h+"px";}
+if(position){element.style.position=position;}
+if(border){element.style.border=border;}
+if(overflow){element.style.overflow=overflow;}
+if(parseFloat(opacity)>=0.0&&parseFloat(opacity)<1.0){element.style.filter='alpha(opacity='+(opacity*100)+')';element.style.opacity=opacity;}else \
if(parseFloat(opacity)==1.0){element.style.filter='';element.style.opacity='';}};OpenL \
ayers.Util.createDiv=function(id,px,sz,imgURL,position,border,overflow,opacity){var \
dom=document.createElement('div');if(imgURL){dom.style.backgroundImage='url('+imgURL+')';}
 +if(!id){id=OpenLayers.Util.createUniqueID("OpenLayersDiv");}
+if(!position){position="absolute";}
+OpenLayers.Util.modifyDOMElement(dom,id,px,sz,position,border,overflow,opacity);return \
dom;};OpenLayers.Util.createImage=function(id,px,sz,imgURL,position,border,opacity,delayDisplay){var \
image=document.createElement("img");if(!id){id=OpenLayers.Util.createUniqueID("OpenLayersDiv");}
 +if(!position){position="relative";}
+OpenLayers.Util.modifyDOMElement(image,id,px,sz,position,border,null,opacity);if(dela \
yDisplay){image.style.display="none";OpenLayers.Event.observe(image,"load",OpenLayers. \
Function.bind(OpenLayers.Util.onImageLoad,image));OpenLayers.Event.observe(image,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,image));}
 +image.style.alt=id;image.galleryImg="no";if(imgURL){image.src=imgURL;}
+return image;};OpenLayers.Util.setOpacity=function(element,opacity){OpenLayers.Util.m \
odifyDOMElement(element,null,null,null,null,null,null,opacity);};OpenLayers.Util.onIma \
geLoad=function(){if(!this.viewRequestID||(this.map&&this.viewRequestID==this.map.view \
RequestID)){this.style.backgroundColor=null;this.style.display="";}};OpenLayers.Util.o \
nImageLoadErrorColor="pink";OpenLayers.IMAGE_RELOAD_ATTEMPTS=0;OpenLayers.Util.onImage \
LoadError=function(){this._attempts=(this._attempts)?(this._attempts+1):1;if(this._att \
empts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){this.src=this.src;}else{this.style.backgroundColor=OpenLayers.Util.onImageLoadErrorColor;}
 +this.style.display="";};OpenLayers.Util.alphaHack=function(){var \
arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);var \
filterúlse;try{filter=!!(document.body.filters);}catch(e){} \
+return(filter&&(version>=5.5)&&(version<7));};OpenLayers.Util.modifyAlphaImageDiv=fun \
ction(div,id,px,sz,imgURL,position,border,sizing,opacity){OpenLayers.Util.modifyDOMElement(div,id,px,sz,null,null,null,opacity);var \
img=div.childNodes[0];if(imgURL){img.src=imgURL;} \
+OpenLayers.Util.modifyDOMElement(img,div.id+"_innerImage",null,sz,"relative",border); \
if(OpenLayers.Util.alphaHack()){div.style.display="inline-block";if(sizing==null){sizing="scale";}
 +div.style.filter="progid:DXImageTransform.Microsoft"+".AlphaImageLoader(src='"+img.src+"', \
"+"sizingMethod='"+sizing+"')";if(parseFloat(div.style.opacity)>=0.0&&parseFloat(div.style.opacity)<1.0){div.style.filter+=" \
alpha(opacity="+div.style.opacity*100+")";} \
+img.style.filter="alpha(opacity=0)";}};OpenLayers.Util.createAlphaImageDiv=function(id,px,sz,imgURL,position,border,sizing,opacity,delayDisplay){var \
div=OpenLayers.Util.createDiv();var \
img=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);div.appendCh \
ild(img);if(delayDisplay){img.style.display="none";OpenLayers.Event.observe(img,"load" \
,OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,div));OpenLayers.Event.observe(img,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,div));}
 +OpenLayers.Util.modifyAlphaImageDiv(div,id,px,sz,imgURL,position,border,sizing,opacity);return \
div;};OpenLayers.Util.upperCaseObject=function(object){var uObject={};for(var key in \
object){uObject[key.toUpperCase()]=object[key];} +return \
uObject;};OpenLayers.Util.applyDefaults=function(to,from){var fromIsEvt=typeof \
window.Event=="function"&&from instanceof window.Event;for(var key in \
from){if(to[key]===undefined||(!fromIsEvt&&from.hasOwnProperty&&from.hasOwnProperty(key)&&!to.hasOwnProperty(key))){to[key]=from[key];}}
 +if(!fromIsEvt&&from.hasOwnProperty&&from.hasOwnProperty('toString')&&!to.hasOwnProperty('toString')){to.toString=from.toString;}
 +return to;};OpenLayers.Util.getParameterString=function(params){var \
paramsArray=[];for(var key in params){var value=params[key];if((value!=null)&&(typeof \
value!='function')){var encodedValue;if(typeof \
value=='object'&&value.constructor==Array){var encodedItemArray=[];for(var \
itemIndex=0;itemIndex<value.length;itemIndex++){encodedItemArray.push(encodeURIComponent(value[itemIndex]));}
 +encodedValue=encodedItemArray.join(",");}
+else{encodedValue=encodeURIComponent(value);}
+paramsArray.push(encodeURIComponent(key)+"="+encodedValue);}}
+return paramsArray.join("&");};OpenLayers.ImgPath='';OpenLayers.Util.getImagesLocation=function(){return \
OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/");};OpenLayers.Util.Try=function(){var \
returnValue=null;for(var i=0;i<arguments.length;i++){var \
lambda=arguments[i];try{returnValue=lambda();break;}catch(e){}} +return \
returnValue;};OpenLayers.Util.getNodes=function(p,tagName){var \
nodes=OpenLayers.Util.Try(function(){return \
OpenLayers.Util._getNodes(p.documentElement.childNodes,tagName);},function(){return \
OpenLayers.Util._getNodes(p.childNodes,tagName);});return \
nodes;};OpenLayers.Util._getNodes=function(nodes,tagName){var retArray=[];for(var \
i=0;i<nodes.length;i++){if(nodes[i].nodeName==tagName){retArray.push(nodes[i]);}} \
+return retArray;};OpenLayers.Util.getTagText=function(parent,item,index){var \
result=OpenLayers.Util.getNodes(parent,item);if(result&&(result.length>0)) \
+{if(!index){index=0;} +if(result[index].childNodes.length>1){return \
result.childNodes[1].nodeValue;} +else if(result[index].childNodes.length==1){return \
result[index].firstChild.nodeValue;}}else{return"";}};OpenLayers.Util.getXmlNodeValue=function(node){var \
val=null;OpenLayers.Util.Try(function(){val=node.text;if(!val){val=node.textContent;} \
+if(!val){val=node.firstChild.nodeValue;}},function(){val=node.textContent;});return \
val;};OpenLayers.Util.mouseLeft=function(evt,div){var \
target=(evt.relatedTarget)?evt.relatedTarget:evt.toElement;while(target!=div&&target!=null){target=target.parentNode;}
 +return(target!=div);};OpenLayers.Util.rad=function(x){return \
x*Math.PI/180;};OpenLayers.Util.distVincenty=function(p1,p2){var \
ac78137,bc56752.3142,f=1/298.257223563;var L=OpenLayers.Util.rad(p2.lon-p1.lon);var \
U1=Math.atan((1-f)*Math.tan(OpenLayers.Util.rad(p1.lat)));var \
U2=Math.atan((1-f)*Math.tan(OpenLayers.Util.rad(p2.lat)));var \
sinU1=Math.sin(U1),cosU1=Math.cos(U1);var sinU2=Math.sin(U2),cosU2=Math.cos(U2);var \
lambda=L,lambdaP=2*Math.PI;var iterLimit \
;while(Math.abs(lambda-lambdaP)>1e-12&&--iterLimit>0){var \
sinLambda=Math.sin(lambda),cosLambda=Math.cos(lambda);var \
sinSigma=Math.sqrt((cosU2*sinLambda)*(cosU2*sinLambda)+ \
+(cosU1*sinU2-sinU1*cosU2*cosLambda)*(cosU1*sinU2-sinU1*cosU2*cosLambda));if(sinSigma==0){return \
0;} +var cosSigma=sinU1*sinU2+cosU1*cosU2*cosLambda;var \
sigma=Math.atan2(sinSigma,cosSigma);var \
alpha=Math.asin(cosU1*cosU2*sinLambda/sinSigma);var \
cosSqAlpha=Math.cos(alpha)*Math.cos(alpha);var \
cos2SigmaM=cosSigma-2*sinU1*sinU2/cosSqAlpha;var \
C=f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha));lambdaP=lambda;lambda=L+(1-C)*f*Math.sin(alpha)*(sigma+C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)));}
 +if(iterLimit==0){return NaN;}
+var uSq=cosSqAlpha*(a*a-b*b)/(b*b);var \
A=1+uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));var \
B=uSq/1024*(256+uSq*(-128+uSq*(74-47*uSq)));var \
deltaSigma=B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)- \
+B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM)));var \
s=b*A*(sigma-deltaSigma);var d=s.toFixed(3)/1000;return \
d;};OpenLayers.Util.getParameters=function(url){url=url||window.location.href;var \
paramsString="";if(OpenLayers.String.contains(url,'?')){var \
start=url.indexOf('?')+1;var \
end=OpenLayers.String.contains(url,"#")?url.indexOf('#'):url.length;paramsString=url.substring(start,end);}
 +var parameters={};var pairs=paramsString.split(/[&;]/);for(var \
i=0;i<pairs.length;++i){var keyValue=pairs[i].split('=');if(keyValue[0]){var \
keyÞcodeURIComponent(keyValue[0]);var \
value=keyValue[1]||'';value=value.split(",");for(var \
j=0;j<value.length;j++){value[j]ÞcodeURIComponent(value[j]);} \
+if(value.length==1){value=value[0];} +parameters[key]=value;}}
+return parameters;};OpenLayers.Util.getArgs=function(url){OpenLayers.Console.warn(Ope \
nLayers.i18n("methodDeprecated",{'newMethod':'OpenLayers.Util.getParameters'}));return \
OpenLayers.Util.getParameters(url);};OpenLayers.Util.lastSeqID=0;OpenLayers.Util.createUniqueID=function(prefix){if(prefix==null){prefix="id_";}
 +OpenLayers.Util.lastSeqID+=1;return \
prefix+OpenLayers.Util.lastSeqID;};OpenLayers.INCHES_PER_UNIT={'inches':1.0,'ft':12.0, \
'mi':63360.0,'m':39.3701,'km':39370.1,'dd':4374754,'yd':36};OpenLayers.INCHES_PER_UNIT \
["in"]=OpenLayers.INCHES_PER_UNIT.inches;OpenLayers.INCHES_PER_UNIT["degrees"]=OpenLay \
ers.INCHES_PER_UNIT.dd;OpenLayers.INCHES_PER_UNIT["nmi"]52*OpenLayers.INCHES_PER_UNIT.m;OpenLayers.DOTS_PER_INCHr;OpenLayers.Util.normalizeScale=function(scale){var \
normScale=(scale>1.0)?(1.0/scale):scale;return \
normScale;};OpenLayers.Util.getResolutionFromScale=function(scale,units){if(units==null){units="degrees";}
 +var normScale=OpenLayers.Util.normalizeScale(scale);var \
resolution=1/(normScale*OpenLayers.INCHES_PER_UNIT[units]*OpenLayers.DOTS_PER_INCH);return \
resolution;};OpenLayers.Util.getScaleFromResolution=function(resolution,units){if(units==null){units="degrees";}
 +var scale=resolution*OpenLayers.INCHES_PER_UNIT[units]*OpenLayers.DOTS_PER_INCH;return \
scale;};OpenLayers.Util.safeStopPropagation=function(evt){OpenLayers.Event.stop(evt,true);};OpenLayers.Util.pagePosition=function(forElement){var \
valueT=0,valueL=0;var element=forElement;var \
child=forElement;while(element){if(element==document.body){if(child&&child.style&&OpenLayers.Element.getStyle(child,'position')=='absolute'){break;}}
 +valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;child=element;try{element \
=element.offsetParent;}catch(e){OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{'elemId':element.id}));break;}}
 +element=forElement;while(element){valueT-=element.scrollTop||0;valueL-=element.scrollLeft||0;element=element.parentNode;}
 +return[valueL,valueT];};OpenLayers.Util.isEquivalentUrl=function(url1,url2,options){ \
options=options||{};OpenLayers.Util.applyDefaults(options,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var \
urlObj1=OpenLayers.Util.createUrlObject(url1,options);var \
urlObj2=OpenLayers.Util.createUrlObject(url2,options);for(var key in \
urlObj1){if(options.test){alert(key+"\n1:"+urlObj1[key]+"\n2:"+urlObj2[key]);} +var \
val1=urlObj1[key];var \
val2=urlObj2[key];switch(key){case"args":break;case"host":case"port":case"protocol":if((val1=="")||(val2=="")){break;}
 +default:if((key!="args")&&(urlObj1[key]!=urlObj2[key])){return false;}
+break;}}
+for(var key in urlObj1.args){if(urlObj1.args[key]!=urlObj2.args[key]){return false;}
+delete urlObj2.args[key];}
+for(var key in urlObj2.args){return false;}
+return true;};OpenLayers.Util.createUrlObject=function(url,options){options=options||{};var \
urlObject={};if(options.ignoreCase){url=url.toLowerCase();} +var \
a=document.createElement('a');a.href=url;urlObject.host=a.host;var \
port=a.port;if(port.length<=0){var \
newHostLength=urlObject.host.length-(port.length);urlObject.host=urlObject.host.substring(0,newHostLength);}
 +urlObject.protocol=a.protocol;urlObject.port=((port=="80")&&(options.ignorePort80))?"":port;urlObject.hash=(options.ignoreHash)?"":a.hash;var \
queryString=a.search;if(!queryString){var \
qMark=url.indexOf("?");queryString=(qMark!=-1)?url.substr(qMark):"";} \
+urlObject.args=OpenLayers.Util.getParameters(queryString);if(((urlObject.protocol=="f \
ile:")&&(url.indexOf("file:")!=-1))||((urlObject.protocol!="file:")&&(urlObject.host!=""))){urlObject.pathname=a.pathname;var \
qIndex=urlObject.pathname.indexOf("?");if(qIndex!=-1){urlObject.pathname=urlObject.pathname.substring(0,qIndex);}}else{var \
relStr=OpenLayers.Util.removeTail(url);var backs=0;do{var \
index=relStr.indexOf("../");if(index==0){backs++;relStr=relStr.substr(3);}else \
if(index>=0){var prevChunk=relStr.substr(0,index-1);var \
slash=prevChunk.indexOf("/");prevChunk=(slash!=-1)?prevChunk.substr(0,slash+1):"";var \
postChunk=relStr.substr(index+3);relStr=prevChunk+postChunk;}}while(index!=-1) +var \
windowAnchor=document.createElement("a");var \
windowUrl=window.location.href;if(options.ignoreCase){windowUrl=windowUrl.toLowerCase();}
 +windowAnchor.href=windowUrl;urlObject.protocol=windowAnchor.protocol;var \
splitter=(windowAnchor.pathname.indexOf("/")!=-1)?"/":"\\";var \
dirs=windowAnchor.pathname.split(splitter);dirs.pop();while((backs>0)&&(dirs.length>0)){dirs.pop();backs--;}
 +relStr=dirs.join("/")+"/"+relStr;urlObject.pathname=relStr;}
+if((urlObject.protocol=="file:")||(urlObject.protocol=="")){urlObject.host="localhost";}
 +return urlObject;};OpenLayers.Util.removeTail=function(url){var head=null;var \
qMark=url.indexOf("?");var \
hashMark=url.indexOf("#");if(qMark==-1){head=(hashMark!=-1)?url.substr(0,hashMark):url \
;}else{head=(hashMark!=-1)?url.substr(0,Math.min(qMark,hashMark)):url.substr(0,qMark);}
 +return head;};OpenLayers.Util.getBrowserName=function(){var browserName="";var \
ua=navigator.userAgent.toLowerCase();if(ua.indexOf("opera")!=-1){browserName="opera";}else \
if(ua.indexOf("msie")!=-1){browserName="msie";}else \
if(ua.indexOf("safari")!=-1){browserName="safari";}else \
if(ua.indexOf("mozilla")!=-1){if(ua.indexOf("firefox")!=-1){browserName="firefox";}else{browserName="mozilla";}}
 +return browserName;};OpenLayers.Util.getRenderedDimensions=function(contentHTML,size){var \
w=h=null;var container=document.createElement("div");container.style.overflow="";conta \
iner.style.position="absolute";container.style.left="-9999px";if(size){if(size.w){w=container.style.width=size.w;}else \
if(size.h){h=container.style.height=size.h;}} +var \
content=document.createElement("div");content.innerHTML=contentHTML;container.appendCh \
ild(content);document.body.appendChild(container);if(!w){w=parseInt(content.scrollWidth);container.style.width=w+"px";}
 +if(!h){h=parseInt(content.scrollHeight);}
+container.removeChild(content);document.body.removeChild(container);return new \
OpenLayers.Size(w,h);};OpenLayers.Util.getScrollbarWidth=function(){var \
scrollbarWidth=OpenLayers.Util._scrollbarWidth;if(scrollbarWidth==null){var \
scr=null;var inn=null;var wNoScroll=0;var \
wScroll=0;scr=document.createElement('div');scr.style.position='absolute';scr.style.to \
p='-1000px';scr.style.left='-1000px';scr.style.width='100px';scr.style.height='50px';s \
cr.style.overflow='hidden';inn=document.createElement('div');inn.style.width='100%';in \
n.style.height='200px';scr.appendChild(inn);document.body.appendChild(scr);wNoScroll=i \
nn.offsetWidth;scr.style.overflow='scroll';wScroll=inn.offsetWidth;document.body.remov \
eChild(document.body.lastChild);OpenLayers.Util._scrollbarWidth=(wNoScroll-wScroll);scrollbarWidth=OpenLayers.Util._scrollbarWidth;}
 +return scrollbarWidth;};OpenLayers.Rico=new \
Object();OpenLayers.Rico.Corner={round:function(e,options){e=OpenLayers.Util.getElement(e);this._setOptions(options);var \
color=this.options.color;if(this.options.color=="fromElement"){color=this._background(e);}
 +var bgColor=this.options.bgColor;if(this.options.bgColor=="fromParent"){bgColor=this._background(e.offsetParent);}
 +this._roundCornersImpl(e,color,bgColor);},changeColor:function(theDiv,newColor){theDiv.style.backgroundColor=newColor;var \
spanElements=theDiv.parentNode.getElementsByTagName("span");for(var \
currIdx=0;currIdx<spanElements.length;currIdx++){spanElements[currIdx].style.backgroundColor=newColor;}},changeOpacity:function(theDiv,newOpacity){var \
mozillaOpacity=newOpacity;var \
ieOpacity='alpha(opacity='+newOpacity*100+')';theDiv.style.opacity=mozillaOpacity;theDiv.style.filter=ieOpacity;var \
spanElements=theDiv.parentNode.getElementsByTagName("span");for(var \
currIdx=0;currIdx<spanElements.length;currIdx++){spanElements[currIdx].style.opacity=m \
ozillaOpacity;spanElements[currIdx].style.filter=ieOpacity;}},reRound:function(theDiv,options){var \
topRico=theDiv.parentNode.childNodes[0];var \
bottomRico=theDiv.parentNode.childNodes[2];theDiv.parentNode.removeChild(topRico);theD \
iv.parentNode.removeChild(bottomRico);this.round(theDiv.parentNode,options);},_roundCornersImpl:function(e,color,bgColo
  r){if(this.options.border){this._renderBorder(e,bgColor);}
+if(this._isTopRounded()){this._roundTopCorners(e,color,bgColor);}
+if(this._isBottomRounded()){this._roundBottomCorners(e,color,bgColor);}},_renderBorder:function(el,bgColor){var \
borderValue="1px solid "+this._borderColor(bgColor);var borderL="border-left: \
"+borderValue;var borderR="border-right: "+borderValue;var \
style="style='"+borderL+";"+borderR+"'";el.innerHTML="<div \
"+style+">"+el.innerHTML+"</div>";},_roundTopCorners:function(el,color,bgColor){var \
corner=this._createCorner(bgColor);for(var \
i=0;i<this.options.numSlices;i++){corner.appendChild(this._createCornerSlice(color,bgColor,i,"top"));}
 +el.style.paddingTop=0;el.insertBefore(corner,el.firstChild);},_roundBottomCorners:function(el,color,bgColor){var \
corner=this._createCorner(bgColor);for(var \
i=(this.options.numSlices-1);i>=0;i--){corner.appendChild(this._createCornerSlice(color,bgColor,i,"bottom"));}
 +el.style.paddingBottom=0;el.appendChild(corner);},_createCorner:function(bgColor){var \
corner=document.createElement("div");corner.style.backgroundColor=(this._isTransparent()?"transparent":bgColor);return \
corner;},_createCornerSlice:function(color,bgColor,n,position){var \
slice=document.createElement("span");var \
inStyle=slice.style;inStyle.backgroundColor=color;inStyle.display="block";inStyle.height="1px";inStyle.overflow="hidden";inStyle.fontSize="1px";var \
borderColor=this._borderColor(color,bgColor);if(this.options.border&&n==0){inStyle.bor \
derTopStyle="solid";inStyle.borderTopWidth="1px";inStyle.borderLeftWidth="0px";inStyle \
.borderRightWidth="0px";inStyle.borderBottomWidth="0px";inStyle.height="0px";inStyle.borderColor=borderColor;}
 +else if(borderColor){inStyle.borderColor=borderColor;inStyle.borderStyle="solid";inStyle.borderWidth="0px \
1px";} +if(!this.options.compact&&(n==(this.options.numSlices-1))){inStyle.height="2px";}
 +this._setMargin(slice,n,position);this._setBorder(slice,n,position);return \
slice;},_setOptions:function(options){this.options={corners:"all",color:"fromElement", \
bgColor:"fromParent",blend:true,border:false,compact:false};OpenLayers.Util.extend(thi \
s.options,options||{});this.options.numSlices=this.options.compact?2:4;if(this._isTran \
sparent()){this.options.blendúlse;}},_whichSideTop:function(){if(this._hasString(this.options.corners,"all","top")){return"";}
 +if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0){return"";}
 +if(this.options.corners.indexOf("tl")>=0){return"left";}else \
if(this.options.corners.indexOf("tr")>=0){return"right";} \
+return"";},_whichSideBottom:function(){if(this._hasString(this.options.corners,"all","bottom")){return"";}
 +if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0){return"";}
 +if(this.options.corners.indexOf("bl")>=0){return"left";}else \
if(this.options.corners.indexOf("br")>=0){return"right";} \
+return"";},_borderColor:function(color,bgColor){if(color=="transparent"){return \
bgColor;}else if(this.options.border){return this.options.border;}else \
if(this.options.blend){return \
this._blend(bgColor,color);}else{return"";}},_setMargin:function(el,n,corners){var \
marginSize=this._marginSize(n);var \
whichSide=corners=="top"?this._whichSideTop():this._whichSideBottom();if(whichSide=="left"){el.style.marginLeft=marginSize+"px";el.style.marginRight="0px";}
 +else if(whichSide=="right"){el.style.marginRight=marginSize+"px";el.style.marginLeft="0px";}
 +else{el.style.marginLeft=marginSize+"px";el.style.marginRight=marginSize+"px";}},_setBorder:function(el,n,corners){var \
borderSize=this._borderSize(n);var \
whichSide=corners=="top"?this._whichSideTop():this._whichSideBottom();if(whichSide=="left"){el.style.borderLeftWidth=borderSize+"px";el.style.borderRightWidth="0px";}
 +else if(whichSide=="right"){el.style.borderRightWidth=borderSize+"px";el.style.borderLeftWidth="0px";}
 +else{el.style.borderLeftWidth=borderSize+"px";el.style.borderRightWidth=borderSize+"px";}
 +if(this.options.border!úlse){el.style.borderLeftWidth=borderSize+"px";el.style.borde \
rRightWidth=borderSize+"px";}},_marginSize:function(n){if(this._isTransparent()){return \
0;} +var marginSizes=[5,3,2,1];var blendedMarginSizes=[3,2,1,0];var \
compactMarginSizes=[2,1];var \
smBlendedMarginSizes=[1,0];if(this.options.compact&&this.options.blend){return \
smBlendedMarginSizes[n];}else if(this.options.compact){return \
compactMarginSizes[n];}else if(this.options.blend){return \
blendedMarginSizes[n];}else{return marginSizes[n];}},_borderSize:function(n){var \
transparentBorderSizes=[5,3,2,1];var blendedBorderSizes=[2,1,1,1];var \
compactBorderSizes=[1,0];var \
actualBorderSizes=[0,2,0,0];if(this.options.compact&&(this.options.blend||this._isTransparent())){return \
1;}else if(this.options.compact){return compactBorderSizes[n];}else \
if(this.options.blend){return blendedBorderSizes[n];}else \
if(this.options.border){return actualBorderSizes[n];}else \
if(this._isTransparent()){return transparentBorderSizes[n];} +return \
0;},_hasString:function(str){for(var \
i=1;i<arguments.length;i++)if(str.indexOf(arguments[i])>=0){return true;}return \
false;},_blend:function(c1,c2){var \
cc1=OpenLayers.Rico.Color.createFromHex(c1);cc1.blend(OpenLayers.Rico.Color.createFromHex(c2));return \
cc1;},_background:function(el){try{return \
OpenLayers.Rico.Color.createColorFromBackground(el).asHex();}catch(err){return"#ffffff";}},_isTransparent:function(){return \
this.options.color=="transparent";},_isTopRounded:function(){return \
this._hasString(this.options.corners,"all","top","tl","tr");},_isBottomRounded:function(){return \
this._hasString(this.options.corners,"all","bottom","bl","br");},_hasSingleTextChild:function(el){return \
el.childNodes.length==1&&el.childNodes[0].nodeType==3;}};OpenLayers.ProxyHost="";OpenL \
ayers.nullHandler=function(request){alert(OpenLayers.i18n("unhandledRequest",{'statusT \
ext':request.statusText}));};OpenLayers.loadURL=function(uri,params,caller,onComplete,onFailure){var \
success=(onComplete  \
)?OpenLayers.Function.bind(onComplete,caller):OpenLayers.nullHandler;var \
failure=(onFailure)?OpenLayers.Function.bind(onFailure,caller):OpenLayers.nullHandler;var \
request=new OpenLayers.Ajax.Request(uri,{method:'get',parameters:params,onComplete:success,onFailure:failure});return \
request.transport;};OpenLayers.parseXMLString=function(text){var \
index=text.indexOf('<');if(index>0){text=text.substring(index);} +var \
ajaxResponse=OpenLayers.Util.Try(function(){var xmldom=new \
ActiveXObject('Microsoft.XMLDOM');xmldom.loadXML(text);return \
xmldom;},function(){return new \
DOMParser().parseFromString(text,'text/xml');},function(){var req=new \
XMLHttpRequest();req.open("GET","data:"+"text/xml"+";charset=utf-8,"+encodeURIComponent(text),false);if(req.overrideMimeType){req.overrideMimeType("text/xml");}
 +req.send(null);return req.responseXML;});return \
ajaxResponse;};OpenLayers.Ajax={emptyFunction:function(){},getTransport:function(){return \
OpenLayers.Util.Try(function(){return new XMLHttpRequest();},function(){return new \
ActiveXObject('Msxml2.XMLHTTP');},function(){return new \
ActiveXObject('Microsoft.XMLHTTP');})||false;},activeRequestCount:0};OpenLayers.Ajax.Responders={responders:[],register:function(responderToAdd){for(var \
i=0;i<this.responders.length;i++){if(responderToAdd==this.responders[i]){return;}} \
+this.responders.push(responderToAdd);},unregister:function(responderToRemove){OpenLay \
ers.Util.removeItem(this.reponders,responderToRemove);},dispatch:function(callback,request,transport){var \
responder;for(var i=0;i<this.responders.length;i++){responder=this.responders[i];if(responder[callback]&&typeof \
responder[callback]=='function'){try{responder[callback].apply(responder,[request,tran \
sport]);}catch(e){}}}}};OpenLayers.Ajax.Responders.register({onCreate:function(){OpenL \
ayers.Ajax.activeRequestCount++;},onComplete:function(){OpenLayers.Ajax.activeRequestC \
ount--;}});OpenLayers.Ajax.Base=OpenLayers.Class({initialize:function(options){this.op \
tions={method:'post',asynchronous:true,contentType:'application/xml',parameters:''};Op \
enLayers.Util.extend(this.options,options||{});this.options.method=this.options.method.toLowerCase();if(typeof \
this.options.parameters=='string'){this.options.parameters=OpenLayers.Util.getParameters(this.options.parameters);}}});OpenLayers.Ajax.Request=Op
  enLayers.Class(OpenLayers.Ajax.Base,{_complete:false,initialize:function(url,options \
){OpenLayers.Ajax.Base.prototype.initialize.apply(this,[options]);if(OpenLayers.ProxyH \
ost&&OpenLayers.String.startsWith(url,"http")){url=OpenLayers.ProxyHost+encodeURIComponent(url);}
 +this.transport=OpenLayers.Ajax.getTransport();this.request(url);},request:function(url){this.url=url;this.method=this.options.method;var \
params=OpenLayers.Util.extend({},this.options.parameters);if(this.method!='get'&&this.method!='post'){params['_method']=this.method;this.method='post';}
 +this.parameters=params;if(params=OpenLayers.Util.getParameterString(params)){if(this.method=='get'){this.url+=((this.url.indexOf('?')>-1)?'&':'?')+params;}else \
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){params+='&_=';}} +try{var \
response=new OpenLayers.Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(response);}
 +OpenLayers.Ajax.Responders.dispatch('onCreate',this,response);this.transport.open(th \
is.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchrono \
us){window.setTimeout(OpenLayers.Function.bind(this.respondToReadyState,this,1),10);} \
+this.transport.onreadystatechange=OpenLayers.Function.bind(this.onStateChange,this);t \
his.setRequestHeaders();this.body=this.method=='post'?(this.options.postBody||params): \
null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.over \
rideMimeType){this.onStateChange();}}catch(e){this.dispatchException(e);}},onStateChange:function(){var \
readyState=this.transport.readyState;if(readyState>1&&!((readyState==4)&&this._complet \
e)){this.respondToReadyState(this.transport.readyState);}},setRequestHeaders:function(){var \
headers={'X-Requested-With':'XMLHttpRequest','Accept':'text/javascript, text/html, \
application/xml, text/xml, \
*/*','OpenLayers':true};if(this.method=='post'){headers['Content-type']=this.options.contentType+
 +(this.options.encoding?'; \
charset='+this.options.encoding:'');if(this.transport.overrideMimeType&&(navigator.use \
rAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){headers['Connection']='close';}} \
+if(typeof this.options.requestHeaders=='object'){var \
extras=this.options.requestHeaders;if(typeof extras.push=='function'){for(var \
i=0,length=extras.length;i<length;i+=2){headers[extras[i]]=extras[i+1];}}else{for(var \
i in extras){headers[i]=pair[i];}}} +for(var name in \
headers){this.transport.setRequestHeader(name,headers[name]);}},success:function(){var \
status=this.getStatus();return!status||(status> \
0&&status<300);},getStatus:function(){try{return \
this.transport.status||0;}catch(e){return \
0;}},respondToReadyState:function(readyState){var \
state=OpenLayers.Ajax.Request.Events[readyState];var response=new \
OpenLayers.Ajax.Response(this);if(state=='Complete'){try{this._complete=true;(this.opt \
ions['on'+response.status]||this.options['on'+(this.success()?'Success':'Failure')]||OpenLayers.Ajax.emptyFunction)(response);}catch(e){this.dispatchException(e);}
 +var contentType=response.getHeader('Content-type');}
+try{(this.options['on'+state]||OpenLayers.Ajax.emptyFunction)(response);OpenLayers.Aj \
ax.Responders.dispatch('on'+state,this,response);}catch(e){this.dispatchException(e);}
 +if(state=='Complete'){this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction;}},getHeader:function(name){try{return \
this.transport.getResponseHeader(name);}catch(e){return \
null;}},dispatchException:function(exception){var \
handler=this.options.onException;if(handler){handler(this,exception);OpenLayers.Ajax.Responders.dispatch('onException',this,exception);}else{var \
listenerúlse;var responders=OpenLayers.Ajax.Responders.responders;for(var \
i=0;i<responders.length;i++){if(responders[i].onException){listener=true;break;}} \
+if(listener){OpenLayers.Ajax.Responders.dispatch('onException',this,exception);}else{throw \
exception;}}}});OpenLayers.Ajax.Request.Events=['Uninitialized','Loading','Loaded','In \
teractive','Complete'];OpenLayers.Ajax.Response=OpenLayers.Class({status:0,statusText:'',initialize:function(request){this.request=request;var \
transport=this.transport=request.transport,readyState=this.readyState=transport.readyS \
tate;if((readyState>2&&!(!!(window.attachEvent&&!window.opera)))||readyState==4){this. \
status=this.getStatus();this.statusText=this.getStatusText();this.responseText=transport.responseText==null?'':String(transport.responseText);}
 +if(readyState==4){var \
xml=transport.responseXML;this.responseXML=xml===undefined?null:xml;}},getStatus:OpenLayers.Ajax.Request.prototype.getStatus,getStatusText:function(){try{return \
this.transport.statusText||'';}catch(e){return'';}},getHeader:OpenLayers.Ajax.Request.prototype.getHeader,getResponseHeader:function(name){return \
this.transport.getResponseHeader(name);}});OpenLayers.Ajax.getElementsByTagNameNS=function(parentnode,nsuri,nsprefix,tagname){var \
elem=null;if(parentnode.getElementsByTagNameNS){elem=parentnode.getElementsByTagNameNS \
(nsuri,tagname);}else{elem=parentnode.getElementsByTagName(nsprefix+':'+tagname);} \
+return elem;};OpenLayers.Ajax.serializeXMLToString=function(xmldom){var \
serializer=new XMLSerializer();var data=serializer.serializeToString(xmldom);return \
data;};OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,i \
nitialize:function(left,bottom,right,top){if(left!=null){this.left=parseFloat(left);} \
+if(bottom!=null){this.bottom=parseFloat(bottom);} \
+if(right!=null){this.right=parseFloat(right);} \
+if(top!=null){this.top=parseFloat(top);}},clone:function(){return new \
OpenLayers.Bounds(this.left,this.bottom,this.right,this.top);},equals:function(bounds){var \
equalsúlse;if(bounds!=null){equals=((this.left==bounds.left)&&(this.right==bounds.right)&&(this.top==bounds.top)&&(this.bottom==bounds.bottom));}
 +return equals;},toString:function(){return("left-bottom=("+this.left+","+this.bottom+")"
 ++" right-top=("+this.right+","+this.top+")");},toArray:function(){return[this.left,t \
his.bottom,this.right,this.top];},toBBOX:function(decimal){if(decimal==null){decimal=6;}
 +var mult=Math.pow(10,decimal);var bbox=Math.round(this.left*mult)/mult+","+
+Math.round(this.bottom*mult)/mult+","+
+Math.round(this.right*mult)/mult+","+
+Math.round(this.top*mult)/mult;return bbox;},toGeometry:function(){return new \
OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new \
OpenLayers.Geometry.Point(this.left,this.bottom),new \
OpenLayers.Geometry.Point(this.right,this.bottom),new \
OpenLayers.Geometry.Point(this.right,this.top),new \
OpenLayers.Geometry.Point(this.left,this.top)])]);},getWidth:function(){return(this.ri \
ght-this.left);},getHeight:function(){return(this.top-this.bottom);},getSize:function(){return \
new OpenLayers.Size(this.getWidth(),this.getHeight());},getCenterPixel:function(){return \
new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2);},getCenterLonLat:function(){return \
new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2);},add:function(x,y){if((x==null)||(y==null)){var \
msg=OpenLayers.i18n("boundsAddError");OpenLayers.Console.error(msg);return null;} \
+return new OpenLayers.Bounds(this.left+x,this.bottom+y,this.right+x,this.top+y);},extend:function(object){var \
bounds=null;if(object){switch(object.CLASS_NAME){case"OpenLayers.LonLat":bounds=new \
OpenLayers.Bounds(object.lon,object.lat,object.lon,object.lat);break;case"OpenLayers.Geometry.Point":bounds=new \
OpenLayers.Bounds(object.x,object.y,object.x,object.y);break;case"OpenLayers.Bounds":bounds=object;break;}
 +if(bounds){if((this.left==null)||(bounds.left<this.left)){this.left=bounds.left;}
+if((this.bottom==null)||(bounds.bottom<this.bottom)){this.bottom=bounds.bottom;}
+if((this.right==null)||(bounds.right>this.right)){this.right=bounds.right;}
+if((this.top==null)||(bounds.top>this.top)){this.top=bounds.top;}}}},containsLonLat:function(ll,inclusive){return \
this.contains(ll.lon,ll.lat,inclusive);},containsPixel:function(px,inclusive){return \
this.contains(px.x,px.y,inclusive);},contains:function(x,y,inclusive){if(inclusive==null){inclusive=true;}
 +var containsúlse;if(inclusive){contains=((x>=this.left)&&(x<=this.right)&&(y>=this.b \
ottom)&&(y<=this.top));}else{contains=((x>this.left)&&(x<this.right)&&(y>this.bottom)&&(y<this.top));}
 +return contains;},intersectsBounds:function(bounds,inclusive){if(inclusive==null){inclusive=true;}
 +var inBottom=(bounds.bottom==this.bottom&&bounds.top==this.top)?true:(((bounds.botto \
m>this.bottom)&&(bounds.bottom<this.top))||((this.bottom>bounds.bottom)&&(this.bottom<bounds.top)));var \
inTop=(bounds.bottom==this.bottom&&bounds.top==this.top)?true:(((bounds.top>this.botto \
m)&&(bounds.top<this.top))||((this.top>bounds.bottom)&&(this.top<bounds.top)));var \
inRight=(bounds.right==this.right&&bounds.left==this.left)?true:(((bounds.right>this.l \
eft)&&(bounds.right<this.right))||((this.right>bounds.left)&&(this.right<bounds.right)));var \
inLeft=(bounds.right==this.right&&bounds.left==this.left)?true:(((bounds.left>this.lef \
t)&&(bounds.left<this.right))||((this.left>bounds.left)&&(this.left<bounds.right)));re \
turn(this.containsBounds(bounds,true,inclusive)||bounds.containsBounds(this,true,inclu \
sive)||((inTop||inBottom)&&(inLeft||inRight)));},containsBounds:function(bounds,partial,inclusive){if(partial==null){partialúlse;}
 +if(inclusive==null){inclusive=true;}
+var inLeft;var inTop;var inRight;var \
inBottom;if(inclusive){inLeft=(bounds.left>=this.left)&&(bounds.left<=this.right);inTo \
p=(bounds.top>=this.bottom)&&(bounds.top<=this.top);inRight=(bounds.right>=this.left)& \
&(bounds.right<=this.right);inBottom=(bounds.bottom>=this.bottom)&&(bounds.bottom<=thi \
s.top);}else{inLeft=(bounds.left>this.left)&&(bounds.left<this.right);inTop=(bounds.to \
p>this.bottom)&&(bounds.top<this.top);inRight=(bounds.right>this.left)&&(bounds.right<this.right);inBottom=(bounds.bottom>this.bottom)&&(bounds.bottom<this.top);}
 +return(partial)?(inTop||inBottom)&&(inLeft||inRight):(inTop&&inLeft&&inBottom&&inRight);},determineQuadrant:function(lonlat){var \
quadrant="";var center=this.getCenterLonLat();quadrant+=(lonlat.lat<center.lat)?"b":"t";quadrant+=(lonlat.lon<center.lon)?"l":"r";return \
quadrant;},transform:function(source,dest){var \
ll=OpenLayers.Projection.transform({'x':this.left,'y':this.bottom},source,dest);var \
lr=OpenLayers.Projection.transform({'x':this.right,'y':this.bottom},source,dest);var \
ul=OpenLayers.Projection.transform({'x':this.left,'y':this.top},source,dest);var \
ur=OpenLayers.Projection.transform({'x':this.right,'y':this.top},source,dest);this.lef \
t=Math.min(ll.x,ul.x);this.bottom=Math.min(ll.y,lr.y);this.right=Math.max(lr.x,ur.x);this.top=Math.max(ul.y,ur.y);return \
this;},wrapDateLine:function(maxExtent,options){options=options||{};var \
leftTolerance=options.leftTolerance||0;var \
rightTolerance=options.rightTolerance||0;var \
newBounds=this.clone();if(maxExtent){while(newBounds.left<m  \
axExtent.left&&(newBounds.right-rightTolerance)<=maxExtent.left){newBounds=newBounds.add(maxExtent.getWidth(),0);}
 +while((newBounds.left+leftTolerance)>=maxExtent.right&&newBounds.right>maxExtent.right){newBounds=newBounds.add(-maxExtent.getWidth(),0);}}
 +return newBounds;},CLASS_NAME:"OpenLayers.Bounds"});OpenLayers.Bounds.fromString=function(str){var \
bounds=str.split(",");return \
OpenLayers.Bounds.fromArray(bounds);};OpenLayers.Bounds.fromArray=function(bbox){return \
new OpenLayers.Bounds(parseFloat(bbox[0]),parseFloat(bbox[1]),parseFloat(bbox[2]),parseFloat(bbox[3]));};OpenLayers.Bounds.fromSize=function(size){return \
new OpenLayers.Bounds(0,size.h,size.w,0);};OpenLayers.Bounds.oppositeQuadrant=function(quadrant){var \
opp="";opp+=(quadrant.charAt(0)=='t')?'b':'t';opp+=(quadrant.charAt(1)=='l')?'r':'l';return \
opp;};OpenLayers.Element={visible:function(element){return \
OpenLayers.Util.getElement(element).style.display!='none';},toggle:function(){for(var \
i=0;i<arguments.length;i++){var element=OpenLayers.Util.getElement(arguments[i]);var \
display=OpenLayers.Element.visible(element)?'hide':'show';OpenLayers.Element[display](element);}},hide:function(){for(var \
i=0;i<arguments.length;i++){var element=OpenLayers.Util.getElement(argumen  \
ts[i]);element.style.display='none';}},show:function(){for(var \
i=0;i<arguments.length;i++){var \
element=OpenLayers.Util.getElement(arguments[i]);element.style.display='';}},remove:fu \
nction(element){element=OpenLayers.Util.getElement(element);element.parentNode.removeC \
hild(element);},getHeight:function(element){element=OpenLayers.Util.getElement(element);return \
element.offsetHeight;},getDimensions:function(element){element=OpenLayers.Util.getElem \
ent(element);if(OpenLayers.Element.getStyle(element,'display')!='none'){return{width:element.offsetWidth,height:element.offsetHeight};}
 +var els=element.style;var originalVisibility=els.visibility;var \
originalPosition=els.position;els.visibility='hidden';els.position='absolute';els.display='';var \
originalWidth=element.clientWidth;var \
originalHeight=element.clientHeight;els.display='none';els.position=originalPosition;e \
ls.visibility=originalVisibility;return{width:originalWidth,height:originalHeight};},getStyle:function(element,style){element=OpenLayers.Util.getElement(element);var \
value=element.style[OpenLayers.String.camelize(style)];if(!value){if(document.defaultView&&document.defaultView.getComputedStyle){var \
css=document.defaultView.getComputedStyle(element,null);value=css?css.getPropertyValue(style):null;}else \
if(element.currentStyle){value=element.currentStyle[OpenLayers.String.camelize(style)];}}
 +var positions=['left','top','right','bottom'];if(window.opera&&(OpenLayers.Util.inde \
xOf(positions,style)!=-1)&&(OpenLayers.Element.getStyle(element,'position')=='static')){value='auto';}
 +return value=='auto'?null:value;}};OpenLayers.LonLat=OpenLayers.Class({lon:0.0,lat:0 \
.0,initialize:function(lon,lat){this.lon=parseFloat(lon);this.lat=parseFloat(lat);},to \
String:function(){return("lon="+this.lon+",lat="+this.lat);},toShortString:function(){return(this.lon+", \
"+this.lat);},clone:function(){return new \
OpenLayers.LonLat(this.lon,this.lat);},add:function(lon,lat){if((lon==null)||(lat==null)){var \
msg=OpenLayers.i18n("lonlatAddError");OpenLayers.Console.error(msg);return null;} \
+return new OpenLayers.LonLat(this.lon+lon,this.lat+lat);},equals:function(ll){var \
equalsúlse;if(ll!=null){equals=((this.lon==ll.lon&&this.lat==ll.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(ll.lon)&&isNaN(ll.lat)));}
 +return equals;},transform:function(source,dest){var \
point=OpenLayers.Projection.transform({'x':this.lon,'y':this.lat},source,dest);this.lon=point.x;this.lat=point.y;return \
this;},wrapDateLine:function(maxExtent){var \
newLonLat=this.clone();if(maxExtent){while(newLonLat.lon<maxExtent.left){newLonLat.lon+=maxExtent.getWidth();}
 +while(newLonLat.lon>maxExtent.right){newLonLat.lon-=maxExtent.getWidth();}}
+return newLonLat;},CLASS_NAME:"OpenLayers.LonLat"});OpenLayers.LonLat.fromString=function(str){var \
pair=str.split(",");return new \
OpenLayers.LonLat(parseFloat(pair[0]),parseFloat(pair[1]));};OpenLayers.Pixel=OpenLaye \
rs.Class({x:0.0,y:0.0,initialize:function(x,y){this.x=parseFloat(x);this.y=parseFloat( \
y);},toString:function(){return("x="+this.x+",y="+this.y);},clone:function(){return \
new OpenLayers.Pixel(this.x,this.y);},equals:function(px){var \
equalsúlse;if(px!=null){equals=((this.x==px.x&&this.y==px.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(px.x)&&isNaN(px.y)));}
 +return equals;},add:function(x,y){if((x==null)||(y==null)){var \
msg=OpenLayers.i18n("pixelAddError");OpenLayers.Console.error(msg);return null;} \
+return new OpenLayers.Pixel(this.x+x,this.y+y);},offset:function(px){var \
newPx=this.clone();if(px){newPx=this.add(px.x,px.y);} +return \
newPx;},CLASS_NAME:"OpenLayers.Pixel"});OpenLayers.Size=OpenLayers.Class({w:0.0,h:0.0, \
initialize:function(w,h){this.w=parseFloat(w);this.h=parseFloat(h);},toString:function(){return("w="+this.w+",h="+this.h);},clone:function(){return \
new OpenLayers.Size(this.w,this.h);},equals:function(sz){var \
equalsúlse;if(sz!=null){equals=((this.w==sz.w&&this.h==sz.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(sz.w)&&isNaN(sz.h)));}
 +return equals;},CLASS_NAME:"OpenLayers.Size"});OpenLayers.Console={log:function(){}, \
debug:function(){},info:function(){},warn:function(){},error:function(){},assert:funct \
ion(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},gro \
upEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profile \
End:function(){},count:function(){},CLASS_NAME:"OpenLayers.Console"};(function(){if(window.console){var \
scripts=document.getElementsByTagName("script");for(var \
i=0;i<scripts.length;++i){if(scripts[i].src.indexOf("firebug.js")!=-1){OpenLayers.Util \
.extend(OpenLayers.Console,console);break;}}}})();OpenLayers.Control=OpenLayers.Class( \
{id:null,map:null,div:null,type:null,allowSelection:false,displayClass:"",title:"",act \
ive:null,handler:null,eventListeners:null,events:null,EVENT_TYPES:["activate","deactiv \
ate"],initialize:function(options){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");OpenLayers.Util.extend(this,
  options);this.events=new \
OpenLayers.Events(this,null,this.EVENT_TYPES);if(this.eventListeners instanceof \
Object){this.events.on(this.eventListeners);} \
+this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");},destroy:function(){if(this.events){if(this.eventListeners){this.events.un(this.eventListeners);}
 +this.events.destroy();this.events=null;}
+this.eventListeners=null;if(this.handler){this.handler.destroy();this.handler=null;}
+if(this.handlers){for(var key in \
this.handlers){if(this.handlers.hasOwnProperty(key)&&typeof \
this.handlers[key].destroy=="function"){this.handlers[key].destroy();}} \
+this.handlers=null;} \
+if(this.map){this.map.removeControl(this);this.map=null;}},setMap:function(map){this. \
map=map;if(this.handler){this.handler.setMap(map);}},draw:function(px){if(this.div==nu \
ll){this.div=OpenLayers.Util.createDiv(this.id);this.div.className=this.displayClass;if(!this.allowSelection){this.div.className+=" \
olControlNoSelect";this.div.setAttribute("unselectable","on",0);this.div.onselectstart=function(){return(false);};}
 +if(this.title!=""){this.div.title=this.title;}}
+if(px!=null){this.position=px.clone();}
+this.moveTo(this.position);return \
this.div;},moveTo:function(px){if((px!=null)&&(this.div!=null)){this.div.style.left=px \
.x+"px";this.div.style.top=px.y+"px";}},activate:function(){if(this.active){return \
false;} +if(this.handler){this.handler.activate();}
+this.active=true;this.events.triggerEvent("activate");return \
true;},deactivate:function(){if(this.active){if(this.handler){this.handler.deactivate();}
 +this.activeúlse;this.events.triggerEvent("deactivate");return true;}
+return false;},CLASS_NAME:"OpenLayers.Control"});OpenLayers.Control.TYPE_BUTTON=1;Ope \
nLayers.Control.TYPE_TOGGLE=2;OpenLayers.Control.TYPE_TOOL=3;OpenLayers.Icon=OpenLayer \
s.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,ini \
tialize:function(url,size,offset,calculateOffset){this.url=url;this.size=(size)?size:new \
OpenLayers.Size(20,20);this.offset=offset?offset:new \
OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));this.calculateOffsetÊlculateOffset;var \
id=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlph \
aImageDiv(id);},destroy:function(){OpenLayers.Event.stopObservingElement(this.imageDiv \
.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null;},clone:function(){return \
new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset);},setSize:function(size){if(size!=null){this.size=size;}
 +this.draw();},setUrl:function(url){if(url!=null){this.url=url;}
+this.draw();},draw:function(px){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");this.moveTo(px);return \
this.imageDiv;},setOpacity:function(opacity){OpenLayers.Util.modifyAlphaImageDiv(this. \
imageDiv,null,null,null,null,null,null,null,opacity);},moveTo:function(px){if(px!=null){this.px=px;}
 +if(this.imageDiv!=null){if(this.px==null){this.display(false);}else{if(this.calculateOffset){this.offset=this.calculateOffset(this.size);}
 +var offsetPx=this.px.offset(this.offset);OpenLayers.Util.modifyAlphaImageDiv(this.im \
ageDiv,null,offsetPx);}}},display:function(display){this.imageDiv.style.display=(displ \
ay)?"":"none";},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){if(!OpenLayers.Lang.code){OpenLayers.Lang.setCode();}
 +return OpenLayers.Lang.code;},setCode:function(code){var \
lang;if(!code){code=(OpenLayers.Util.getBrowserName()=="msie")?navigator.userLanguage:navigator.language;}
 +var parts=code.split('-');parts[0]=parts[0].toLowerCase();if(typeof \
OpenLayers.Lang[parts[0]]=="object"){lang=parts[0];} +if(parts[1]){var \
testLang=parts[0]+'-'+parts[1].toUpperCase();if(typeof \
OpenLayers.Lang[testLang]=="object"){lang=testLang;}} \
+if(!lang){OpenLayers.Console.warn('Failed to find \
OpenLayers.Lang.'+parts.join("-")+' dictionary, falling back to default \
language');lang=OpenLayers.Lang.defaultCode;} \
+OpenLayers.Lang.code=lang;},translate:function(key,context){var \
dictionary=OpenLayers.Lang[OpenLayers.Lang.getCode()];var \
message=dictionary[key];if(!message){message=key;} \
+if(context){message=OpenLayers.String.format(message,context);} +return \
message;}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Popup=OpenLayers.Class \
({events:null,id:"",lonlat:null,div:null,size:null,contentHTML:"",backgroundColor:"",o \
pacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:false,minSize:null,maxSize:null,padding:0,fixPadding:function(){if(typeof \
this.padding=="number"){this.padding=new \
OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding);}},panMapIfOutO \
fView:false,map:null,initialize:function(id,lonlat,size,contentHTML,closeBox,closeBoxCallback){if(id==null){id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");}
 +this.id=id;this.lonlat=lonlat;this.size=(size!=null)?size:new \
OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);if(contentHTML!=null){this.contentHTML=contentHTML;}
 +this.backgroundColor=OpenLayers.Popup.COLOR;this.opacity=OpenLayers.Popup.OPACITY;th \
is.border=OpenLayers.Popup.BORDER;this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");this.div.className='olPopup';var \
groupDivId=this.id+"_GroupDiv";this.groupDiv=OpenLayers.Util.createDiv(groupDivId,null,null,null,"relative",null,"hidden");var \
id=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(id,null,this.si \
ze.clone(),null,"relative");this.contentDiv.className='olPopupContent';this.groupDiv.a \
ppendChild(this.contentDiv);this.div.appendChild(this.groupDiv);if(closeBox){this.addCloseBox(closeBoxCallback);}
 +this.registerEvents();},destroy:function(){this.id=null;this.lonlat=null;this.size=n \
ull;this.contentHTML=null;this.backgroundColor=null;this.opacity=null;this.border=null \
;this.events.destroy();this.events=null;if(this.closeDiv){OpenLayers.Event.stopObservingElement(this.closeDiv);this.groupDiv.removeChild(this.closeDiv);}
 +this.closeDiv=null;this.div.removeChild(this.groupDiv);this.groupDiv=null;if(this.map!=null){this.map.removePopup(this);}
 +this.map=null;this.div=null;this.autoSize=null;this.minSize=null;this.maxSize=null;t \
his.padding=null;this.panMapIfOutOfView=null;},draw:function(px){if(px==null){if((this \
.lonlat!=null)&&(this.map!=null)){px=this.map.getLayerPxFromLonLat(this.lonlat);}} \
+if(OpenLayers.Util.getBrowserName()=='firefox'){this.map.events.register("movestart",this,function(){var \
style=document.defaultView.getComputedStyle(this.contentDiv,null);var \
currentOverflow=style.getPropertyValue("overflow");if(currentOverflow!="hidden"){this. \
contentDiv._oldOverflow=currentOverflow;this.contentDiv.style.overflow="hidden";}});this.map.events.register("moveend",this,function(){var \
oldOverflow=this.contentDiv._oldOverflow;if(oldOverflow){this.contentDiv.style.overflow=oldOverflow;this.contentDiv._oldOverflow=null;}});}
 +this.moveTo(px);if(!this.autoSize){this.setSize(this.size);}
+this.setBackgroundColor();this.setOpacity();this.setBorder();this.setContentHTML();if(this.panMapIfOutOfView){this.panIntoView();}
 +return this.div;},updatePosition:function(){if((this.lonlat)&&(this.map)){var \
px=this.map.getLayerPxFromLonLat(this.lonlat);if(px){this.moveTo(px);}}},moveTo:functi \
on(px){if((px!=null)&&(this.div!=null)){this.div.style.left=px.x+"px";this.div.style.top=px.y+"px";}},visible:function(){return \
OpenLayers.Element.visible(this.div);},toggle:function(){if(this.visible()){this.hide( \
);}else{this.show();}},show:function(){OpenLayers.Element.show(this.div);if(this.panMa \
pIfOutOfView){this.panIntoView();}},hide:function(){OpenLayers.Element.hide(this.div);},setSize:function(size){this.size=size;var \
contentSize=this.size.clone();var contentDivPadding=this.getContentDivPadding();var \
wPadding=contentDivPadding.left+contentDivPadding.right;var \
hPadding=contentDivPadding.top+contentDivPadding.bottom;this.fixPadding();wPadding+=th \
is.padding.left+this.padding.right;hPadding+=this.padding.top+this.padding.bottom;if(this.closeDiv){var \
closeDivWidth=parseInt(this.closeDiv.style.width);wPadding+=c  \
loseDivWidth+contentDivPadding.right;} \
+this.size.w+=wPadding;this.size.h+=hPadding;if(OpenLayers.Util.getBrowserName()=="msi \
e"){contentSize.w+=contentDivPadding.left+contentDivPadding.right;contentSize.h+=contentDivPadding.bottom+contentDivPadding.top;}
 +if(this.div!=null){this.div.style.width=this.size.w+"px";this.div.style.height=this.size.h+"px";}
 +if(this.contentDiv!=null){this.contentDiv.style.width=contentSize.w+"px";this.conten \
tDiv.style.height=contentSize.h+"px";}},setBackgroundColor:function(color){if(color!=undefined){this.backgroundColor=color;}
 +if(this.div!=null){this.div.style.backgroundColor=this.backgroundColor;}},setOpacity:function(opacity){if(opacity!=undefined){this.opacity=opacity;}
 +if(this.div!=null){this.div.style.opacity=this.opacity;this.div.style.filter='alpha( \
opacity='+this.opacity*100+')';}},setBorder:function(border){if(border!=undefined){this.border=border;}
 +if(this.div!=null){this.div.style.border=this.border;}},setContentHTML:function(contentHTML){if(contentHTML!=null){this.contentHTML=contentHTML;}
 +if(this.autoSize){var \
realSize=OpenLayers.Util.getRenderedDimensions(this.contentHTML);var \
safeSize=this.getSafeContentSize(realSize);var \
newSize=null;if(safeSize.equals(realSize)){newSize=realSize;}else{var fixedSize=new \
OpenLayers.Size();fixedSize.w=(safeSize.w<realSize.w)?safeSize.w:null;fixedSize.h=(saf \
eSize.h<realSize.h)?safeSize.h:null;if(fixedSize.w&&fixedSize.h){newSize=safeSize;}else{var \
clippedSize=OpenLayers.Util.getRenderedDimensions(this.contentHTML,fixedSize);var \
currentOverflow=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if((currentOverflow!="hidden")&&(clippedSize.equals(safeSize))){var \
scrollBar=OpenLayers.Util.getScrollbarWidth();if(fixedSize.w){clippedSize.h+=scrollBar;}else{clippedSize.w+=scrollBar;}}
 +newSize=this.getSafeContentSize(clippedSize);}}
+this.setSize(newSize);}
+if(this.contentDiv!=null){this.contentDiv.innerHTML=this.contentHTML;}},getSafeContentSize:function(size){var \
safeContentSize=size.clone();var contentDivPadding=this.getContentDivPadding();var \
wPadding=contentDivPadding.left+contentDivPadding.right;var \
hPadding=contentDivPadding.top+contentDivPadding.bottom;this.fixPadding();wPadding+=th \
is.padding.left+this.padding.right;hPadding+=this.padding.top+this.padding.bottom;if(this.closeDiv){var \
closeDivWidth=parseInt(this.closeDiv.style.width);wPadding+=closeDivWidth+contentDivPadding.right;}
 +if(this.minSize){safeContentSize.w=Math.max(safeContentSize.w,(this.minSize.w-wPadding));safeContentSize.h=Math.max(safeContentSize.h,(this.minSize.h-hPadding));}
 +if(this.maxSize){safeContentSize.w=Math.min(safeContentSize.w,(this.maxSize.w-wPadding));safeContentSize.h=Math.min(safeContentSize.h,(this.maxSize.h-hPadding));}
 +if(this.map&&this.map.size){var maxY=this.map.size.h-
+this.map.paddingForPopups.top-
+this.map.paddingForPopups.bottom-
+hPadding;var maxX=this.map.size.w-
+this.map.paddingForPopups.left-
+this.map.paddingForPopups.right-
+wPadding;safeContentSize.w=Math.min(safeContentSize.w,maxX);safeContentSize.h=Math.min(safeContentSize.h,maxY);}
 +return safeContentSize;},getContentDivPadding:function(){var \
contentDivPadding=this._contentDivPadding;if(!contentDivPadding){this.div.style.display="none";document.body.appendChild(this.div);contentDivPadding=new \
OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,"padding-left"),OpenLaye \
rs.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this \
.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv,"padding-top" \
));this._contentDivPadding=contentDivPadding;document.body.removeChild(this.div);this.div.style.display="";}
 +return contentDivPadding;},addCloseBox:function(callback){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new \
OpenLayers.Size(17,17));this.closeDiv.className="olPopupCloseBox";var \
contentDivPadding=this.getContentDivPadding();this.closeDiv.style.right=contentDivPadd \
ing.right+"px";this.closeDiv.style.top=contentDivPadding.top+"px";this.groupDiv.appendChild(this.closeDiv);var \
closePopupÊllback||function(e){this.hide();OpenLayers.Event.stop(e);};OpenLayers.Event \
.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(closePopup,this));},panIntoView:function(){var \
mapSize=this.map.getSize();var origTL=this.map.getViewPortPxFromLayerPx(new \
OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));var \
newTL=origTL.clone();if(origTL.x<this.map.paddingForPopups.left){newTL.x=this.map.paddingForPopups.left;}else
 +if((origTL.x+this.size.w)>(mapSize.w-this.map.paddingForPopups.right)){newTL.x=mapSize.w-this.map.paddingForPopups.right-this.size.w;}
 +if(origTL.y<this.map.paddingForPopups.top){newTL.y=this.map.paddingForPopups.top;}else
 +if((origTL.y+this.size.h)>(mapSize.h-this.map.paddingForPopups.bottom)){newTL.y=mapSize.h-this.map.paddingForPopups.bottom-this.size.h;}
 +var dx=origTL.x-newTL.x;var \
dy=origTL.y-newTL.y;this.map.pan(dx,dy);},registerEvents:function(){this.events=new \
OpenLayers.Events(this,this.div,null,true);this.events.on({"mousedown":this.onmousedow \
n,"mousemove":this.onmousemove,"mouseup":this.onmouseup,"click":this.onclick,"mouseout \
":this.onmouseout,"dblclick":this.ondblclick,scope:this});},onmousedown:function(evt){ \
this.mousedown=true;OpenLayers.Event.stop(evt,true);},onmousemove:function(evt){if(thi \
s.mousedown){OpenLayers.Event.stop(evt,true);}},onmouseup:function(evt){if(this.moused \
own){this.mousedownúlse;OpenLayers.Event.stop(evt,true);}},onclick:function(evt){OpenL \
ayers.Event.stop(evt,true);},onmouseout:function(evt){this.mousedownúlse;},ondblclick: \
function(evt){OpenLayers.Event.stop(evt,true);},CLASS_NAME:"OpenLayers.Popup"});OpenLayers.Popup.WIDTH \
0;OpenLayers.Popup.HEIGHT \
0;OpenLayers.Popup.COLOR="white";OpenLayers.Popup.OPACITY=1;OpenLayers.Popup.BORDER="0px";OpenLayers.Renderer=OpenLayers.Class({container:
  null,extent:null,size:null,resolution:null,map:null,initialize:function(containerID) \
{this.container=OpenLayers.Util.getElement(containerID);},destroy:function(){this.cont \
ainer=null;this.extent=null;this.size=null;this.resolution=null;this.map=null;},supported:function(){return \
false;},setExtent:function(extent){this.extent=extent.clone();this.resolution=null;},s \
etSize:function(size){this.size=size.clone();this.resolution=null;},getResolution:function(){this.resolution=this.resolution||this.map.getResolution();return \
this.resolution;},drawFeature:function(feature,style){if(style==null){styleþature.style;}
 +if(feature.geometry){this.drawGeometry(feature.geometry,style,feature.id);}},drawGeo \
metry:function(geometry,style,featureId){},clear:function(){},getFeatureIdFromEvent:function(evt){},eraseFeatures:function(features){if(!(features \
instanceof Array)){features=[features];} +for(var \
i=0;i<features.length;++i){this.eraseGeometry(features[i].geometry);}},eraseGeometry:f \
unction(geometry){},CLASS_NAME:"OpenLayers.Renderer"});OpenLayers.Tween=OpenLayers.Cla \
ss({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:null,time:n \
ull,interval:null,playing:false,initialize:function(easing){this.easing=(easing)?easin \
g:OpenLayers.Easing.Expo.easeOut;},start:function(begin,finish,duration,options){this. \
playing=true;this.begin¾gin;this.finish=finish;this.duration=duration;this.callbacks=o \
ptions.callbacks;this.time=0;if(this.interval){window.clearInterval(this.interval);this.interval=null;}
 +if(this.callbacks&&this.callbacks.start){this.callbacks.start.call(this,this.begin);}
 +this.interval=window.setInterval(OpenLayers.Function.bind(this.play,this),this.INTERVAL);},stop:function(){if(!this.playing){return;}
 +if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish);}
 +window.clearInterval(this.interval);this.interval=null;this.playingúlse;},play:function(){var \
value={};for(var i in this.begin){var b=this.begin[i];var \
f=this.finish[i];if(b==null||f==null||isNaN(b)||isNaN(f)){OpenLayers.Console.error('invalid \
value for Tween');} +var \
c=f-b;value[i]=this.easing.apply(this,[this.time,b,c,this.duration]);} \
+this.time++;if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,value);}
 +if(this.time>this.duration){if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish);this.playingúlse;}
 +window.clearInterval(this.interval);this.interval=null;}},CLASS_NAME:"OpenLayers.Twe \
en"});OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};OpenLayers.Easing.Linear={easeIn:function(t,b,c,d){return \
c*t/d+b;},easeOut:function(t,b,c,d){return \
c*t/d+b;},easeInOut:function(t,b,c,d){return \
c*t/d+b;},CLASS_NAME:"OpenLayers.Easing.Linear"};OpenLayers.Easing.Expo={easeIn:functi \
on(t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOut:function(t,b,c,d){retu \
rn(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOut:function(t,b,c,d){if(t==0)return \
b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return \
c/2*(-Math.pow(2,-10*--t)+2)+b;},CLASS_NAME:"OpenLayers.Easing.Expo"};OpenLayers.Easing.Quad={easeIn:function(t,b,c,d){return \
c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOut:function(t,b,c,d){if((t/=d/2)<1)return \
c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},CLASS_NAME:"OpenLayers.Easing.Quad"};OpenLayers.Rico.Color=OpenLayers.Class({initial
  ize:function(red,green,blue){this.rgb={r:red,g:green,b:blue};},setRed:function(r){th \
is.rgb.r=r;},setGreen:function(g){this.rgb.g=g;},setBlue:function(b){this.rgb.b=b;},setHue:function(h){var \
hsb=this.asHSB();hsb.h=h;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},setSaturation:function(s){var \
hsb=this.asHSB();hsb.s=s;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},setBrightness:function(b){var \
hsb=this.asHSB();hsb.b=b;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},darken:function(percent){var \
hsb=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.max(hsb.b-percent,0));},brighten:function(percent){var \
hsb=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.min(hsb.b+pe \
rcent,1));},blend:function(other){this.rgb.r=Math.floor((this.rgb.r+other.rgb.r)/2);th \
is.rgb.g=Math.floor((this.rgb.g+other.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+other.rgb.b)/2);},isBright:function(){var \
hsb=this.asHSB();return th  \
is.asHSB().b>0.5;},isDark:function(){return!this.isBright();},asRGB:function(){return" \
rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")";},asHex:function(){return"#"+this.r \
gb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart();},asHSB:function(){return \
OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b);},toString:function(){return \
this.asHex();}});OpenLayers.Rico.Color.createFromHex=function(hexCode){if(hexCode.length==4){var \
shortHexCode=hexCode;var hexCode='#';for(var \
i=1;i<4;i++){hexCode+=(shortHexCode.charAt(i)+ +shortHexCode.charAt(i));}}
+if(hexCode.indexOf('#')==0){hexCode=hexCode.substring(1);}
+var red=hexCode.substring(0,2);var green=hexCode.substring(2,4);var \
blue=hexCode.substring(4,6);return new \
OpenLayers.Rico.Color(parseInt(red,16),parseInt(green,16),parseInt(blue,16));};OpenLayers.Rico.Color.createColorFromBackground=function(elem){var \
actualColor=RicoUtil.getElementsComputedStyle(OpenLayers.Util.getElement(elem),"backgr \
oundColor","background-color");if(actualColor=="transparent"&&elem.parentNode){return \
OpenLayers.Rico.Color.createColorFromBackground(elem.parentNode);} \
+if(actualColor==null){return new OpenLayers.Rico.Color(255,255,255);} \
+if(actualColor.indexOf("rgb(")==0){var \
colors¬tualColor.substring(4,actualColor.length-1);var \
colorArray=colors.split(",");return new \
OpenLayers.Rico.Color(parseInt(colorArray[0]),parseInt(colorArray[1]),parseInt(colorArray[2]));}
 +else if(actualColor.indexOf("#")==0){return \
OpenLayers.Rico.Color.createFromHex(actualColor);} +else{return new \
OpenLayers.Rico.Color(255,255,255);}};OpenLayers.Rico.Color.HSBtoRGB=function(hue,saturation,brightness){var \
red=0;var green=0;var \
blue=0;if(saturation==0){red=parseInt(brightness*255.0+0.5);green=red;blue=red;} \
+else{var h=(hue-Math.floor(hue))*6.0;var f=h-Math.floor(h);var \
p=brightness*(1.0-saturation);var q=brightness*(1.0-saturation*f);var \
t=brightness*(1.0-(saturation*(1.0-f)));switch(parseInt(h)){case \
0:red=(brightness*255.0+0.5);green=(t*255.0+0.5);blue=(p*255.0+0.5);break;case \
1:red=(q*255.0+0.5);green=(brightness*255.0+0.5);blue=(p*255.0+0.5);break;case \
2:red=(p*255.0+0.5);green=(brightness*255.0+0.5);blue=(t*255.0+0.5);break;case \
3:red=(p*255.0+0.5);green=(q*255.0+0.5);blue=(brightness*255.0+0.5);break;case \
4:red=(t*255.0+0.5);green=(p*255.0+0.5);blue=(brightness*255.0+0.5);break;case \
5:red=(brightness*255.0+0.5);green=(p*255.0+0.5);blue=(q*255.0+0.5);break;}} \
+return{r:parseInt(red),g:parseInt(green),b:parseInt(blue)};};OpenLayers.Rico.Color.RGBtoHSB=function(r,g,b){var \
hue;var saturation;var brightness;var cmax=(r>g)?r:g;if(b>cmax){cmax=b;} +var \
cmin=(r<g)?r:g;if(b<cmin){cmin=b;} \
+brightness=cmax/255.0;if(cmax!=0){saturation=(cmax-cmin)/cmax;}else{saturation=0;} \
+if(saturation==0){hue=0;}else{var redc=(cmax-r)/(cmax-cmin);var \
greenc=(cmax-g)/(cmax-cmin);var \
bluec=(cmax-b)/(cmax-cmin);if(r==cmax){hue=bluec-greenc;}else \
if(g==cmax){hue=2.0+redc-bluec;}else{hue=4.0+greenc-redc;} \
+hue=hue/6.0;if(hue<0){hue=hue+1.0;}} \
+return{h:hue,s:saturation,b:brightness};};OpenLayers.Control.ArgParser=OpenLayers.Cla \
ss(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,initia \
lize:function(options){OpenLayers.Control.prototype.initialize.apply(this,arguments);} \
,setMap:function(map){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var \
i=0;i<this.map.controls.length;i++){var \
control=this.map.controls[i];if((control!=this)&&(control.CLASS_NAME=="OpenLayers.Cont \
rol.ArgParser")){if(control.displayProjection!=this.displayProjection){this.displayProjection=control.displayProjection;}
 +break;}}
+if(i==this.map.controls.length){var \
args=OpenLayers.Util.getParameters();if(args.layers){this.layers=args.layers;this.map.events.register('addlayer',this,this.configureLayers);this.configureLayers();}
 +if(args.lat&&args.lon){this.center=new \
OpenLayers.LonLat(parseFloat(args.lon),parseFloat(args.lat));if(args.zoom){this.zoom=parseInt(args.zoom);}
 +this.map.events.register('changebaselayer',this,this.setCenter);this.setCenter();}}} \
,setCenter:function(){if(this.map.baseLayer){this.map.events.unregister('changebaselay \
er',this,this.setCenter);if(this.displayProjection){this.center.transform(this.displayProjection,this.map.getProjectionObject());}
 +this.map.setCenter(this.center,this.zoom);}},configureLayers:function(){if(this.laye \
rs.length==this.map.layers.length){this.map.events.unregister('addlayer',this,this.configureLayers);for(var \
i=0;i<this.layers.length;i++){var layer=this.map.layers[i];var \
c=this.layers.charAt(i);if(c=="B"){this.map.setBaseLayer(layer);}else \
if((c=="T")||(c=="F")){layer.setVisibility(c=="T");}}}},CLASS_NAME:"OpenLayers.Control \
.ArgParser"});OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control,{separator:", \
",initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,argu \
ments);},destroy:function(){this.map.events.un({"removelayer":this.updateAttribution," \
addlayer":this.updateAttribution,"changelayer":this.updateAttribution,"changebaselayer \
":this.updateAttribution,scope:this});OpenLayers.Control.prototype.destroy.apply(this, \
arguments);},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.map.events.on({'changebaselayer':this.updateAttri
  bution,'changelayer':this.updateAttribution,'addlayer':this.updateAttribution,'removelayer':this.updateAttribution,scope:this});this.updateAttribution();return \
this.div;},updateAttribution:function(){var \
attributions=[];if(this.map&&this.map.layers){for(var \
i=0;i<this.map.layers.length;i++){var \
layer=this.map.layers[i];if(layer.attribution&&layer.getVisibility()){attributions.push(layer.attribution);}}
 +this.div.innerHTML=attributions.join(this.separator);}},CLASS_NAME:"OpenLayers.Contr \
ol.Attribution"});OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type: \
OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.But \
ton"});OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{activeCol \
or:"darkblue",layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataL \
bl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending \
:true,initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this, \
arguments);this.layerStates=[];},destroy:function(){OpenLayers.Event.stopObservingElem \
ent(this.div);OpenLayers.Event.stopObservingElement(this.minimizeDiv);OpenLayers.Event \
.stopObservingElement(this.maximizeDiv);this.clearLayersArray("base");this.clearLayers \
Array("data");this.map.events.un({"addlayer":this.redraw,"changelayer":this.redraw,"removelayer":this.redraw,"changebaselayer":this
                
 .redraw,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments);},set \
Map:function(map){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.e \
vents.on({"addlayer":this.redraw,"changelayer":this.redraw,"removelayer":this.redraw," \
changebaselayer":this.redraw,scope:this});},draw:function(){OpenLayers.Control.prototy \
pe.draw.apply(this);this.loadContents();if(!this.outsideViewport){this.minimizeControl();}
 +this.redraw();return this.div;},clearLayersArray:function(layersType){var \
layers=this[layersType+"Layers"];if(layers){for(var i=0;i<layers.length;i++){var \
layer=layers[i];OpenLayers.Event.stopObservingElement(layer.inputElem);OpenLayers.Event.stopObservingElement(layer.labelSpan);}}
 +this[layersType+"LayersDiv"].innerHTML="";this[layersType+"Layers"]=[];},checkRedraw:function(){var \
redrawúlse;if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){redraw=true;}else{for(var \
i=0;i<this.layerStates.length;i++){var layerState=this.layerStates[i];var \
layer=this.map.layers[i];if((layerState.name!=layer.name)||(layerState.inRange!=layer. \
inRange)||(layerState.id!=layer.id)||(layerState.visibility!=layer.visibility)){redraw=true;break;}}}
 +return redraw;},redraw:function(){if(!this.checkRedraw()){return this.div;}
+this.clearLayersArray("base");this.clearLayersArray("data");var \
containsOverlaysúlse;var containsBaseLayersúlse;this.layerStates=new \
Array(this.map.layers.length);for(var i=0;i<this.map.layers.length;i++){var \
layer=this.map.layers[i];this.layerStates[i]={'name':layer.name,'visibility':layer.visibility,'inRange':layer.inRange,'id':layer.id};}
 +var layers=this.map.layers.slice();if(!this.ascending){layers.reverse();}
+for(var i=0;i<layers.length;i++){var layer=layers[i];var \
baseLayer=layer.isBaseLayer;if(layer.displayInLayerSwitcher){if(baseLayer){containsBaseLayers=true;}else{containsOverlays=true;}
 +var checked=(baseLayer)?(layer==this.map.baseLayer):layer.getVisibility();var \
inputElem=document.createElement("input");inputElem.id="input_"+layer.name;inputElem.n \
ame=(baseLayer)?"baseLayers":layer.name;inputElem.type=(baseLayer)?"radio":"checkbox"; \
inputElem.value=layer.name;inputElem.checked=checked;inputElem.defaultChecked=checked;if(!baseLayer&&!layer.inRange){inputElem.disabled=true;}
 +var context={'inputElem':inputElem,'layer':layer,'layerSwitcher':this};OpenLayers.Ev \
ent.observe(inputElem,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,context));var \
labelSpan=document.createElement("span");if(!baseLayer&&!layer.inRange){labelSpan.style.color="gray";}
 +labelSpan.innerHTML=layer.name;labelSpan.style.verticalAlign=(baseLayer)?"bottom":"b \
aseline";OpenLayers.Event.observe(labelSpan,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,context));var \
br=document.createElement("br");var \
groupArray=(baseLayer)?this.baseLayers:this.dataLayers;groupArray.push({'layer':layer,'inputElem':inputElem,'labelSpan':labelSpan});var \
groupDiv=(baseLayer)?this.baseLayersDiv:this.dataLayersDiv;groupDiv.appendChild(inputElem);groupDiv.appendChild(labelSpan);groupDiv.appendChild(br);}}
 +this.dataLbl.style.display=(containsOverlays)?"":"none";this.baseLbl.style.display=(containsBaseLayers)?"":"none";return \
this.div;},onInputClick:function(e){if(!this.inputElem.disabled){if(this.inputElem.typ \
e=="radio"){this.inputElem.checked=true;this.layer.map.setBaseLayer(this.layer);}else{this.inputElem.checked=!this.inputElem.checked;this.layerSwitcher.updateMap();}}
 +OpenLayers.Event.stop(e);},onLayerClick:function(e){this.updateMap();},updateMap:function(){for(var \
i=0;i<this.baseLayers.length;i++){var \
layerEntry=this.baseLayers[i];if(layerEntry.inputElem.checked){this.map.setBaseLayer(layerEntry.layer,false);}}
 +for(var i=0;i<this.dataLayers.length;i++){var \
layerEntry=this.dataLayers[i];layerEntry.layer.setVisibility(layerEntry.inputElem.chec \
ked);}},maximizeControl:function(e){this.div.style.width="20em";this.div.style.height= \
"";this.showControls(false);if(e!=null){OpenLayers.Event.stop(e);}},minimizeControl:fu \
nction(e){this.div.style.width="0px";this.div.style.height="0px";this.showControls(tru \
e);if(e!=null){OpenLayers.Event.stop(e);}},showControls:function(minimize){this.maximi \
zeDiv.style.display=minimize?"":"none";this.minimizeDiv.style.display=minimize?"none": \
"";this.layersDiv.style.display=minimize?"none":"";},loadContents:function(){this.div. \
style.position="absolute";this.div.style.top="25px";this.div.style.right="0px";this.di \
v.style.left="";this.div.style.fontFamily="sans-serif";this.div.style.fontWeight="bold \
";this.div.style.marginTop="3px";this.div.style.marginLeft="3px";this.div.style.margin \
Bottom="3px";this.div.style.fontSize="smaller";this.div.style.color="white";this.di  \
v.style.backgroundColor="transparent";OpenLayers.Event.observe(this.div,"mouseup",Open \
Layers.Function.bindAsEventListener(this.mouseUp,this));OpenLayers.Event.observe(this. \
div,"click",this.ignoreEvent);OpenLayers.Event.observe(this.div,"mousedown",OpenLayers \
.Function.bindAsEventListener(this.mouseDown,this));OpenLayers.Event.observe(this.div, \
"dblclick",this.ignoreEvent);this.layersDiv=document.createElement("div");this.layersD \
iv.id="layersDiv";this.layersDiv.style.paddingTop="5px";this.layersDiv.style.paddingLe \
ft="10px";this.layersDiv.style.paddingBottom="5px";this.layersDiv.style.paddingRight=" \
75px";this.layersDiv.style.backgroundColor=this.activeColor;this.layersDiv.style.width \
="100%";this.layersDiv.style.height="100%";this.baseLbl=document.createElement("div"); \
this.baseLbl.innerHTML=OpenLayers.i18n("baseLayer");this.baseLbl.style.marginTop="3px" \
;this.baseLbl.style.marginLeft="3px";this.baseLbl.style.marginBottom="3px";this.baseLayersDiv=document.createElement("div");this.
  baseLayersDiv.style.paddingLeft="10px";this.dataLbl=document.createElement("div");th \
is.dataLbl.innerHTML=OpenLayers.i18n("overlays");this.dataLbl.style.marginTop="3px";th \
is.dataLbl.style.marginLeft="3px";this.dataLbl.style.marginBottom="3px";this.dataLayer \
sDiv=document.createElement("div");this.dataLayersDiv.style.paddingLeft="10px";if(this \
.ascending){this.layersDiv.appendChild(this.baseLbl);this.layersDiv.appendChild(this.b \
aseLayersDiv);this.layersDiv.appendChild(this.dataLbl);this.layersDiv.appendChild(this \
.dataLayersDiv);}else{this.layersDiv.appendChild(this.dataLbl);this.layersDiv.appendCh \
ild(this.dataLayersDiv);this.layersDiv.appendChild(this.baseLbl);this.layersDiv.appendChild(this.baseLayersDiv);}
 +this.div.appendChild(this.layersDiv);OpenLayers.Rico.Corner.round(this.div,{corners:"tl \
bl",bgColor:"transparent",color:this.activeColor,blend:false});OpenLayers.Rico.Corner.changeOpacity(this.layersDiv,0.75);var \
imgLocation=OpenLayers.Util.getImagesLocation();var sz=new OpenLayers.Size(18,18);var \
img=imgLocation+'layer-switcher-maximize.png';this.maximizeDiv=OpenLayers.Util.createA \
lphaImageDiv("OpenLayers_Control_MaximizeDiv",null,sz,img,"absolute");this.maximizeDiv \
.style.top="5px";this.maximizeDiv.style.right="0px";this.maximizeDiv.style.left="";thi \
s.maximizeDiv.style.display="none";OpenLayers.Event.observe(this.maximizeDiv,"click",O \
penLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var \
img=imgLocation+'layer-switcher-minimize.png';var sz=new \
OpenLayers.Size(18,18);this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayer \
s_Control_MinimizeDiv",null,sz,img,"absolute");this.minimizeDiv.style.top="5px";this.minimize
  Div.style.right="0px";this.minimizeDiv.style.left="";this.minimizeDiv.style.display= \
"none";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEve \
ntListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv);},ignore \
Event:function(evt){OpenLayers.Event.stop(evt);},mouseDown:function(evt){this.isMouseD \
own=true;this.ignoreEvent(evt);},mouseUp:function(evt){if(this.isMouseDown){this.isMou \
seDownúlse;this.ignoreEvent(evt);}},CLASS_NAME:"OpenLayers.Control.LayerSwitcher"});Op \
enLayers.Control.MouseDefaults=OpenLayers.Class(OpenLayers.Control,{performedDrag:fals \
e,wheelObserver:null,initialize:function(){OpenLayers.Control.prototype.initialize.app \
ly(this,arguments);},destroy:function(){if(this.handler){this.handler.destroy();} \
+this.handler=null;this.map.events.un({"click":this.defaultClick,"dblclick":this.defau \
ltDblClick,"mousedown":this.defaultMouseDown,"mouseup":this.defaultMouseUp,"mousemove" \
:this.defaultMouseMove,"mouseout":this.defaultMouseOut,scope:this});OpenLayers.Event.s \
topObserving(window,"DOMMouseScroll",this.wheelObserver);OpenLayers.Event.stopObservin \
g(window,"mousewheel",this.wheelObserver);OpenLayers.Event.stopObserving(document,"mou \
sewheel",this.wheelObserver);this.wheelObserver=null;OpenLayers.Control.prototype.dest \
roy.apply(this,arguments);},draw:function(){this.map.events.on({"click":this.defaultCl \
ick,"dblclick":this.defaultDblClick,"mousedown":this.defaultMouseDown,"mouseup":this.d \
efaultMouseUp,"mousemove":this.defaultMouseMove,"mouseout":this.defaultMouseOut,scope: \
this});this.registerWheelEvents();},registerWheelEvents:function(){this.wheelObserver= \
OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this);OpenLayers.Event.observe(window,"DOMMouseScroll",this.wheelObserve
  r);OpenLayers.Event.observe(window,"mousewheel",this.wheelObserver);OpenLayers.Event \
.observe(document,"mousewheel",this.wheelObserver);},defaultClick:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
 +var notAfterDrag=!this.performedDrag;this.performedDragúlse;return \
notAfterDrag;},defaultDblClick:function(evt){var \
newCenter=this.map.getLonLatFromViewPortPx(evt.xy);this.map.setCenter(newCenter,this.map.zoom+1);OpenLayers.Event.stop(evt);return \
false;},defaultMouseDown:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
 +this.mouseDragStart=evt.xy.clone();this.performedDragúlse;if(evt.shiftKey){this.map. \
div.style.cursor="crosshair";this.zoomBox=OpenLayers.Util.createDiv('zoomBox',this.mouseDragStart,null,null,"absolute","2px \
solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.filter="alph \
a(opacityP)";this.zoomBox.style.opacity="0.50";this.zoomBox.style.fontSize="1px";this. \
zoomBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.viewPortDiv.appendChild(this.zoomBox);}
 +document.onselectstart=function(){return \
false;};OpenLayers.Event.stop(evt);},defaultMouseMove:function(evt){this.mousePosition=evt.xy.clone();if(this.mouseDragStart!=null){if(this.zoomBox){var \
deltaX=Math.abs(this.mouseDragStart.x-evt.xy.x);var \
deltaY=Math.abs(this.mouseDragStart.y-evt.xy.y);this.zoomBox.style.width=Math.max(1,de \
ltaX)+"px";this.zoomBox.style.height=Math.max(1,deltaY)+"px";if(evt.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=evt.xy.x+"px";}
 +if(evt.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=evt.xy.y+"px";}}else{var \
deltaX=this.mouseDragStart.x-evt.xy.x;var deltaY=this.mouseDragStart.y-evt.xy.y;var \
size=this.map.getSize();var newXY=new \
OpenLayers.Pixel(size.w/2+deltaX,size.h/2+deltaY);var \
newCenter=this.map.getLonLatFromViewPortPx(newXY);this.map.setCenter(newCenter,null,true);this.mouseDragStart=evt.xy.clone();this.map.div.style.cursor="move";}
 +this.performedDrag=true;}},defaultMouseUp:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
 +if(this.zoomBox){this.zoomBoxEnd(evt);}else{if(this.performedDrag){this.map.setCenter(this.map.center);}}
 +document.onselectstart=null;this.mouseDragStart=null;this.map.div.style.cursor="";}, \
defaultMouseOut:function(evt){if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(evt,this.map.div)){if(this.zoomBox){this.removeZoomBox();}
 +this.mouseDragStart=null;}},defaultWheelUp:function(evt){if(this.map.getZoom()<=this \
.map.getNumZoomLevels()){this.map.setCenter(this.map.getLonLatFromPixel(evt.xy),this.m \
ap.getZoom()+1);}},defaultWheelDown:function(evt){if(this.map.getZoom()>0){this.map.se \
tCenter(this.map.getLonLatFromPixel(evt.xy),this.map.getZoom()-1);}},zoomBoxEnd:functi \
on(evt){if(this.mouseDragStart!=null){if(Math.abs(this.mouseDragStart.x-evt.xy.x)>5||Math.abs(this.mouseDragStart.y-evt.xy.y)>5){var \
start=this.map.getLonLatFromViewPortPx(this.mouseDragStart);var \
end=this.map.getLonLatFromViewPortPx(evt.xy);var top=Math.max(start.lat,end.lat);var \
bottom=Math.min(start.lat,end.lat);var left=Math.min(start.lon,end.lon);var \
right=Math.max(start.lon,end.lon);var bounds=new \
OpenLayers.Bounds(left,bottom,right,top);this.map.zoomToExtent(bounds);}else{var \
end=this.map.getLonLatFromViewPortPx(evt.xy);this.map.setCenter(new \
OpenLayers.LonLat((end.lon),(end.lat)),this.map.getZoom()+1);} \
+this.removeZoomBox();}},removeZoomBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null;},onWheelEvent:function(e){var \
inMapúlse;var elem=OpenLayers.Event.element(e);while(elem!=null){if(this.map&&elem==this.map.div){inMap=true;break;}
 +elem=elem.parentNode;}
+if(inMap){var delta=0;if(!e){e=window.event;}
+if(e.wheelDelta){delta=e.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){delta=-delta;}}else \
if(e.detail){delta=-e.detail/3;} \
+if(delta){e.xy=this.mousePosition;if(delta<0){this.defaultWheelDown(e);}else{this.defaultWheelUp(e);}}
 +OpenLayers.Event.stop(e);}},CLASS_NAME:"OpenLayers.Control.MouseDefaults"});OpenLaye \
rs.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{element:null,prefix:'',separator:', \
',suffix:'',numdigits:5,granularity:10,lastXy:null,displayProjection:null,initialize:f \
unction(options){OpenLayers.Control.prototype.initialize.apply(this,arguments);},destr \
oy:function(){if(this.map){this.map.events.unregister('mousemove',this,this.redraw);} \
+OpenLayers.Control.prototype.destroy.apply(this,arguments);},draw:function(){OpenLaye \
rs.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.left="";this.div.top="";this.element=this.div;}
 +this.redraw();return this.div;},redraw:function(evt){var \
lonLat;if(evt==null){lonLat=new \
OpenLayers.LonLat(0,0);}else{if(this.lastXy==null||Math.abs(evt.xy.x-this.lastXy.x)>this.granularity||Math.abs(evt.xy.y-this.lastXy.y)>this.granularity)
 +{this.lastXy=evt.xy;return;}
+lonLat=this.map.getLonLatFromPixel(evt.xy);if(!lonLat){return;}
+if(this.displayProjection){lonLat.transform(this.map.getProjectionObject(),this.displayProjection);}
 +this.lastXy=evt.xy;}
+var newHtml=this.formatOutput(lonLat);if(newHtml!=this.element.innerHTML){this.element.innerHTML=newHtml;}},formatOutput:function(lonLat){var \
digits=parseInt(this.numdigits);var newHtml=this.prefix+ +lonLat.lon.toFixed(digits)+
+this.separator+
+lonLat.lat.toFixed(digits)+
+this.suffix;return newHtml;},setMap:function(){OpenLayers.Control.prototype.setMap.ap \
ply(this,arguments);this.map.events.register('mousemove',this,this.redraw);},CLASS_NAM \
E:"OpenLayers.Control.MousePosition"});OpenLayers.Control.NavigationHistory=OpenLayers \
.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOGGLE,previous:null,previousO \
ptions:null,next:null,nextOptions:null,limit:50,activateOnDraw:true,clearOnDeactivate: \
false,registry:null,nextStack:null,previousStack:null,listeners:null,restoring:false,i \
nitialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,[option \
s]);this.registry=OpenLayers.Util.extend({"moveend":function(){return{center:this.map. \
getCenter(),resolution:this.map.getResolution()};}},this.registry);this.clear();var \
previousOptions={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayCl \
ass:this.displayClass+"Previous"};OpenLayers.Util.extend(previousOptions,this.previousOptions);this.previous=new \
OpenLayers.Control.  Button(previousOptions);var \
nextOptions={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this \
.displayClass+"Next"};OpenLayers.Util.extend(nextOptions,this.nextOptions);this.next=new \
OpenLayers.Control.Button(nextOptions);},onPreviousChange:function(state,length){if(state&&!this.previous.active){this.previous.activate();}else \
if(!state&&this.previous.active){this.previous.deactivate();}},onNextChange:function(state,length){if(state&&!this.next.active){this.next.activate();}else \
if(!state&&this.next.active){this.next.deactivate();}},destroy:function(){OpenLayers.C \
ontrol.prototype.destroy.apply(this);this.previous.destroy();this.next.destroy();this.deactivate();for(var \
prop in this){this[prop]=null;}},setMap:function(map){this.map=map;this.next.setMap(ma \
p);this.previous.setMap(map);},draw:function(){OpenLayers.Control.prototype.draw.apply \
(this,arguments);this.next.draw();this.previous.draw();if(this.activateOnDraw){this.activate();}},previousTrigger:functio
  n(){var current=this.previousStack.shift();var \
state=this.previousStack.shift();if(state!=undefined){this.nextStack.unshift(current); \
this.previousStack.unshift(state);this.restoring=true;this.restore(state);this.restori \
ngúlse;this.onNextChange(this.nextStack[0],this.nextStack.length);this.onPreviousChang \
e(this.previousStack[1],this.previousStack.length-1);}else{this.previousStack.unshift(current);}
 +return state;},nextTrigger:function(){var \
state=this.nextStack.shift();if(state!=undefined){this.previousStack.unshift(state);th \
is.restoring=true;this.restore(state);this.restoringúlse;this.onNextChange(this.nextSt \
ack[0],this.nextStack.length);this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);}
 +return state;},clear:function(){this.previousStack=[];this.nextStack=[];},restore:function(state){var \
zoom=this.map.getZoomForResolution(state.resolution);this.map.setCenter(state.center,zoom);},setListeners:function(){this.listeners={};for(var \
type in this.registry){this.listeners[type]=OpenLayers.Function.bind(function(){if(!this.restoring){var \
state=this.registry[type].apply(this,arguments);this.previousStack.unshift(state);if(t \
his.previousStack.length>1){this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);}
 +if(this.previousStack.length>(this.limit+1)){this.previousStack.pop();}
+if(this.nextStack.length>0){this.nextStack=[];this.onNextChange(null,0);}}
+return true;},this);}},activate:function(){var \
activatedúlse;if(this.map){if(OpenLayers.Control.prototype.activate.apply(this)){if(this.listeners==null){this.setListeners();}
 +for(var type in this.listeners){this.map.events.register(type,this,this.listeners[type]);}
 +activated=true;if(this.previousStack.length==0){this.initStack();}}}
+return activated;},initStack:function(){if(this.map.getCenter()){this.listeners.moveend();}},deactivate:function(){var \
deactivatedúlse;if(this.map){if(OpenLayers.Control.prototype.deactivate.apply(this)){for(var \
type in this.listeners){this.map.events.unregister(type,this,this.listeners[type]);} \
+if(this.clearOnDeactivate){this.clear();} +deactivated=true;}}
+return deactivated;},CLASS_NAME:"OpenLayers.Control.NavigationHistory"});OpenLayers.C \
ontrol.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,buttons:null,position:null,initialize:function(options){this.position=new \
OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);OpenLayers \
.Control.prototype.initialize.apply(this,arguments);},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);while(this.buttons.length){var \
btn=this.buttons.shift();btn.map=null;OpenLayers.Event.stopObservingElement(btn);} \
+this.buttons=null;this.position=null;},draw:function(px){OpenLayers.Control.prototype.draw.apply(this,arguments);px=this.position;this.buttons=[];var \
sz=new OpenLayers.Size(18,18);var centered=new \
OpenLayers.Pixel(px.x+sz.w/2,px.y);this._addButton("panup","north-mini.png",centered,s \
z);px.yÎntered.y+sz.h;this._addButton("panleft","west-mini.png",px,sz);this._addButton \
("panright","east-mini.png",px.add(sz.w,0),sz);this._addButton("pandown","south-mini.p \
ng",centered.add(0,sz.h*2),sz);this._addButton("zoomin","zoom-plus-mini.png",centered. \
add(0,sz.h*3+5),sz);this._addButton("zoomworld","zoom-world-mini.png",centered.add(0,s \
z.h*4+5),sz);this._addButton("zoomout","zoom-minus-mini.png",centered.add(0,sz.h*5+5),sz);return \
this.div;},_addButton:function(id,img,xy,sz){var \
imgLocation=OpenLayers.Util.getImagesLocation()+img;var \
btn=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_PanZoom_"+id,xy,sz,imgLocation,"absolute");this.div.appendChild(btn);OpenLayers.Event.observe(btn,
  "mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,btn));OpenLayers \
.Event.observe(btn,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick \
,btn));OpenLayers.Event.observe(btn,"click",OpenLayers.Function.bindAsEventListener(th \
is.doubleClick,btn));btn.action=id;btn.map=this.map;btn.slideFactor=this.slideFactor;this.buttons.push(btn);return \
btn;},doubleClick:function(evt){OpenLayers.Event.stop(evt);return \
false;},buttonDown:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;} \
+switch(this.action){case"panup":this.map.pan(0,-this.slideFactor);break;case"pandown" \
:this.map.pan(0,this.slideFactor);break;case"panleft":this.map.pan(-this.slideFactor,0 \
);break;case"panright":this.map.pan(this.slideFactor,0);break;case"zoomin":this.map.zo \
omIn();break;case"zoomout":this.map.zoomOut();break;case"zoomworld":this.map.zoomToMaxExtent();break;}
 +OpenLayers.Event.stop(evt);},CLASS_NAME:"OpenLayers.Control.PanZoom"});OpenLayers.Co \
ntrol.PanZoom.X=4;OpenLayers.Control.PanZoom.Y=4;OpenLayers.Control.Panel=OpenLayers.C \
lass(OpenLayers.Control,{controls:null,defaultControl:null,initialize:function(options \
){OpenLayers.Control.prototype.initialize.apply(this,[options]);this.controls=[];},des \
troy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var \
i=this.controls.length-1;i>=0;i--){if(this.controls[i].events){this.controls[i].events.un({"activate":this.redraw,"deactivate":this.redraw,scope:this});}
 +OpenLayers.Event.stopObservingElement(this.controls[i].panel_div);this.controls[i].p \
anel_div=null;}},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){for(var \
i=0;i<this.controls.length;i++){if(this.controls[i]==this.defaultControl){this.controls[i].activate();}}
 +this.redraw();return true;}else{return \
false;}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var \
i=0;i<this.controls.length;i++){this.controls[i].deactivate();} +return \
true;}else{return false;}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);for(var \
i=0;i<this.controls.length;i++){this.map.addControl(this.controls[i]);this.controls[i] \
.deactivate();this.controls[i].events.on({"activate":this.redraw,"deactivate":this.redraw,scope:this});}
 +this.activate();return \
this.div;},redraw:function(){this.div.innerHTML="";if(this.active){for(var \
i=0;i<this.controls.length;i++){var \
element=this.controls[i].panel_div;if(this.controls[i].active){element.className=this. \
controls[i].displayClass+"ItemActive";}else{element.className=this.controls[i].displayClass+"ItemInactive";}
 +this.div.appendChild(element);}}},activateControl:function(control){if(!this.active){return \
false;} +if(control.type==OpenLayers.Control.TYPE_BUTTON){control.trigger();return;}
+if(control.type==OpenLayers.Control.TYPE_TOGGLE){if(control.active){control.deactivate();}else{control.activate();}
 +return;}
+for(var i=0;i<this.controls.length;i++){if(this.controls[i]!=control){if(this.controls[i].type!=OpenLayers.Control.TYPE_TOGGLE){this.controls[i].deactivate();}}}
 +control.activate();},addControls:function(controls){if(!(controls instanceof \
Array)){controls=[controls];} +this.controls=this.controls.concat(controls);for(var \
i=0;i<controls.length;i++){var element=document.createElement("div");var \
textNode=document.createTextNode(" \
");controls[i].panel_div=element;if(controls[i].title!=""){controls[i].panel_div.title=controls[i].title;}
 +OpenLayers.Event.observe(controls[i].panel_div,"click",OpenLayers.Function.bind(this \
.onClick,this,controls[i]));OpenLayers.Event.observe(controls[i].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop));}
 +if(this.map){for(var \
i=0;i<controls.length;i++){this.map.addControl(controls[i]);controls[i].deactivate();c \
ontrols[i].events.on({"activate":this.redraw,"deactivate":this.redraw,scope:this});} \
+this.redraw();}},onClick:function(ctrl,evt){OpenLayers.Event.stop(evt?evt:window.event);this.activateControl(ctrl);},getControlsBy:function(property,match){var \
test=(typeof match.test=="function");var \
found=OpenLayers.Array.filter(this.controls,function(item){return \
item[property]==match||(test&&match.test(item[property]));});return \
found;},getControlsByName:function(match){return \
this.getControlsBy("name",match);},getControlsByClass:function(match){return \
this.getControlsBy("CLASS_NAME",match);},CLASS_NAME:"OpenLayers.Control.Panel"});OpenL \
ayers.Control.Permalink=OpenLayers.Class(OpenLayers.Control,{element:null,base:'',disp \
layProjection:null,initialize:function(element,base,options){OpenLayers.Control.protot \
ype.initialize.apply(this,[options]);this.element=OpenLayers.Util.getElement(element); \
this.baseºse||document.location.href;},destroy:function(){if(this.element.parentNode==this.div){this.div.removeChild(this.element);}
 +this.element=null;this.map.events.unregister('moveend',this,this.updateLink);OpenLay \
ers.Control.prototype.destroy.apply(this,arguments);},setMap:function(map){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var \
i=0;i<this.map.controls.length;i++){var \
control=this.map.controls[i];if(control.CLASS_NAME=="OpenLayers.Control.ArgParser"){if \
(control.displayProjection!=this.displayProjection){this.displayProjection=control.displayProjection;}
 +break;}}
+if(i==this.map.controls.length){this.map.addControl(new \
OpenLayers.Control.ArgParser({'displayProjection':this.displayProjection}));}},draw:fu \
nction(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){thi \
s.element=document.createElement("a");this.element.innerHTML=OpenLayers.i18n("permalink");this.element.href="";this.div.appendChild(this.element);}
 +this.map.events.on({'moveend':this.updateLink,'changelayer':this.updateLink,'changebaselayer':this.updateLink,scope:this});return \
this.div;},updateLink:function(){var center=this.map.getCenter();if(!center){return;} \
+var params=OpenLayers.Util.getParameters(this.base);params.zoom=this.map.getZoom();var \
latÎnter.lat;var lonÎnter.lon;if(this.displayProjection){var \
mapPosition=OpenLayers.Projection.transform({x:lon,y:lat},this.map.getProjectionObject(),this.displayProjection);lon=mapPosition.x;lat=mapPosition.y;}
 +params.lat=Math.round(lat*100000)/100000;params.lon=Math.round(lon*100000)/100000;params.layers='';for(var \
i=0;i<this.map.layers.length;i++){var \
layer=this.map.layers[i];if(layer.isBaseLayer){params.layers+=(layer==this.map.baseLayer)?"B":"0";}else{params.layers+=(layer.getVisibility())?"T":"F";}}
 +var href=this.base;if(href.indexOf('?')!=-1){href=href.substring(0,href.indexOf('?'));}
 +href+='?'+OpenLayers.Util.getParameterString(params);this.element.href=href;},CLASS_ \
NAME:"OpenLayers.Control.Permalink"});OpenLayers.Control.Scale=OpenLayers.Class(OpenLa \
yers.Control,{element:null,initialize:function(element,options){OpenLayers.Control.pro \
totype.initialize.apply(this,[options]);this.element=OpenLayers.Util.getElement(elemen \
t);},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this. \
element){this.element=document.createElement("div");this.div.appendChild(this.element);}
 +this.map.events.register('moveend',this,this.updateScale);this.updateScale();return \
this.div;},updateScale:function(){var scale=this.map.getScale();if(!scale){return;} \
+if(scale>•00&&scale<•0000){scale=Math.round(scale/1000)+"K";}else \
if(scale>•0000){scale=Math.round(scale/1000000)+"M";}else{scale=Math.round(scale);} \
+this.element.innerHTML=OpenLayers.i18n("scale",{'scaleDenom':scale});},CLASS_NAME:"Op \
enLayers.Control.Scale"});OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Con \
trol,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:" \
ft",eTop:null,eBottom:null,initialize:function(options){OpenLayers.Control.prototype.i \
nitialize.apply(this,[options]);},draw:function(){OpenLayers.Control.prototype.draw.ap \
ply(this,arguments);if(!this.eTop){this.div.style.display="block";this.div.style.posit \
ion="absolute";this.eTop=document.createElement("div");this.eTop.className=this.displayClass+"Top";var \
theLen=this.topInUnits.length;this.div.appendChild(this.eTop);if((this.topOutUnits=="" \
)||(this.topInUnits=="")){this.eTop.style.visibility="hidden";}else{this.eTop.style.visibility="visible";}
 +this.eBottom=document.createElement("div");this.eBottom.className=this.displayClass+ \
"Bottom";this.div.appendChild(this.eBottom);if((this.bottomOutUnits=="")||(this.bottom \
InUnits=="")){this.eBottom.style.visibility="hidden";}else{this.eBottom.style.visibility="visible";}}
 +this.map.events.register('moveend',this,this.update);this.update();return \
this.div;},getBarLen:function(maxLen){var \
digits=parseInt(Math.log(maxLen)/Math.log(10));var pow10=Math.pow(10,digits);var \
firstChar=parseInt(maxLen/pow10);var barLen;if(firstChar>5){barLen=5;}else \
if(firstChar>2){barLen=2;}else{barLen=1;} +return \
barLen*pow10;},update:function(){var res=this.map.getResolution();if(!res){return;} \
+var curMapUnits=this.map.units;var inches=OpenLayers.INCHES_PER_UNIT;var \
maxSizeData=this.maxWidth*res*inches[curMapUnits];var topUnits;var \
bottomUnits;if(maxSizeData>100000){topUnits=this.topOutUnits;bottomUnits=this.bottomOutUnits;}else{topUnits=this.topInUnits;bottomUnits=this.bottomInUnits;}
 +var topMax=maxSizeData/inches[topUnits];var \
bottomMax=maxSizeData/inches[bottomUnits];var topRounded=this.getBarLen(topMax);var \
bottomRounded=this.getBarLen(bottomMax);topMax=topRounded/inches[curMapUnits]*inches[topUnits];bottomMax=bottomRounded/inches[curMapUnits]*inches[bottomUnits];var \
topPx=topMax/res;var \
bottomPx=bottomMax/res;this.eTop.style.width=Math.round(topPx)+"px";this.eBottom.style.width=Math.round(bottomPx)+"px";this.eTop.innerHTML=topRounded+" \
"+topUnits;this.eBottom.innerHTML=bottomRounded+" \
"+bottomUnits;},CLASS_NAME:"OpenLayers.Control.ScaleLine"});OpenLayers.Control.ZoomToM \
axExtent=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trig \
ger:function(){if(this.map){this.map.zoomToMaxExtent();}},CLASS_NAME:"OpenLayers.Contr \
ol.ZoomToMaxExtent"});OpenLayers.Event={observers:false,KEY_BACKSPACE:8,KEY_TAB:9,KEY_ \
RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(event){return \
event.target||even  t.srcElement;},isLeftClick:function(event){return(((event.which)&& \
(event.which==1))||((event.button)&&(event.button==1)));},stop:function(event,allowDef \
ault){if(!allowDefault){if(event.preventDefault){event.preventDefault();}else{event.returnValueúlse;}}
 +if(event.stopPropagation){event.stopPropagation();}else{event.cancelBubble=true;}},findElement:function(event,tagName){var \
element=OpenLayers.Event.element(event);while(element.parentNode&&(!element.tagName||( \
element.tagName.toUpperCase()!=tagName.toUpperCase()))){element=element.parentNode;} \
+return element;},observe:function(elementParam,name,observer,useCapture){var \
element=OpenLayers.Util.getElement(elementParam);useCapture=useCapture||false;if(name= \
='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.attachEvent)){name='keydown';}
 +if(!this.observers){this.observers={};}
+if(!element._eventCacheID){var \
idPrefix="eventCacheID_";if(element.id){idPrefix=element.id+"_"+idPrefix;} \
+element._eventCacheID=OpenLayers.Util.createUniqueID(idPrefix);} +var \
cacheID=element._eventCacheID;if(!this.observers[cacheID]){this.observers[cacheID]=[];}
 +this.observers[cacheID].push({'element':element,'name':name,'observer':observer,'use \
Capture':useCapture});if(element.addEventListener){element.addEventListener(name,observer,useCapture);}else \
if(element.attachEvent){element.attachEvent('on'+name,observer);}},stopObservingElement:function(elementParam){var \
element=OpenLayers.Util.getElement(elementParam);var \
cacheID=element._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[ \
cacheID]);},_removeElementObservers:function(elementObservers){if(elementObservers){for(var \
i=elementObservers.length-1;i>=0;i--){var entry=elementObservers[i];var args=new \
Array(entry.element,entry.name,entry.observer,entry.useCapture);var \
removed=OpenLayers.Event.stopObserving.apply(this,args);}}},stopObserving:function(elementParam,name,observer,useCapture){useCapture=useCapture||false;var \
element=OpenLayers.Util.getElement(elementParam);var \
cacheID=element._eventCacheID;if(name=='keypress'){if(navigator.appVersion.match(/Konqueror|Sa
  fari|KHTML/)||element.detachEvent){name='keydown';}}
+var foundEntryúlse;var \
elementObservers=OpenLayers.Event.observers[cacheID];if(elementObservers){var \
i=0;while(!foundEntry&&i<elementObservers.length){var \
cacheEntry=elementObservers[i];if((cacheEntry.name==name)&&(cacheEntry.observer==obser \
ver)&&(cacheEntry.useCapture==useCapture)){elementObservers.splice(i,1);if(elementObservers.length==0){delete \
OpenLayers.Event.observers[cacheID];} +foundEntry=true;break;}
+i++;}}
+if(foundEntry){if(element.removeEventListener){element.removeEventListener(name,observer,useCapture);}else \
if(element&&element.detachEvent){element.detachEvent('on'+name,observer);}} +return \
foundEntry;},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var \
cacheID in OpenLayers.Event.observers){var \
elementObservers=OpenLayers.Event.observers[cacheID];OpenLayers.Event._removeElementObservers.apply(this,[elementObservers]);}
 +OpenLayers.Event.observersúlse;}},CLASS_NAME:"OpenLayers.Event"};OpenLayers.Event.ob \
serve(window,'unload',OpenLayers.Event.unloadCache,false);if(window.Event){OpenLayers.Util.applyDefaults(window.Event,OpenLayers.Event);}else{var \
Event=OpenLayers.Event;} \
+OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown \
","mouseup","mousemove","click","dblclick","resize","focus","blur"],listeners:null,obj \
ect:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,initialize:fu \
nction(object,element,eventTypes,fallThrough){this.object=object;this.element=element; \
this.eventTypes=eventTypes;this.fallThroughúllThrough;this.listeners={};this.eventHand \
ler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);if(this.eventTypes!=null){for(var \
i=0;i<this.eventTypes.length;i++){this.addEventType(this.eventTypes[i]);}} \
+if(this.element!=null){this.attachToElement(element);}},destroy:function(){if(this.element){OpenLayers.Event.stopObservingElement(this.element);}
 +this.element=null;this.listeners=null;this.object=null;this.eventTypes=null;this.fal \
lThrough=null;this.eventHandler=null;},addEventType:function(eventName){if(!this.liste \
ners[eventName]){this.listeners[eventName]=[];}},attachToElement:function(element){for(var \
i=0;i<this.BROWSER_EVENTS.length;i++){var \
eventType=this.BROWSER_EVENTS[i];this.addEventType(eventType);OpenLayers.Event.observe(element,eventType,this.eventHandler);}
 +OpenLayers.Event.observe(element,"dragstart",OpenLayers.Event.stop);},on:function(object){for(var \
type in object){if(type!="scope"){this.register(type,object.scope,object[type]);}}},re \
gister:function(type,obj,func){if(func!=null&&((this.eventTypes&&OpenLayers.Util.index \
Of(this.eventTypes,type)!=-1)||OpenLayers.Util.indexOf(this.BROWSER_EVENTS,type)!=-1)){if(obj==null){obj=this.object;}
 +var listeners=this.listeners[type];if(listeners!=null){listeners.push({obj:obj,func: \
func});}}},registerPriority:function(type,obj,func){if(func!=null){if(obj==null){obj=this.object;}
 +var listeners=this.listeners[type];if(listeners!=null){listeners.unshift({obj:obj,func:func});}}},un:function(object){for(var \
type in object){if(type!="scope"){this.unregister(type,object.scope,object[type]);}}},unregister:function(type,obj,func){if(obj==null){obj=this.object;}
 +var listeners=this.listeners[type];if(listeners!=null){for(var \
i=0;i<listeners.length;i++){if(listeners[i].obj==obj&&listeners[i].func==func){listene \
rs.splice(i,1);break;}}}},remove:function(type){if(this.listeners[type]!=null){this.listeners[type]=[];}},triggerEvent:function(type,evt){if(evt==null){evt={};}
 +evt.object=this.object;evt.element=this.element;if(!evt.type){evt.type=type;}
+var listeners=(this.listeners[type])?this.listeners[type].slice():null;if((listeners!=null)&&(listeners.length>0)){var \
continueChain;for(var i=0;i<listeners.length;i++){var \
callback=listeners[i];continueChainÊllback.func.apply(callback.obj,[evt]);if((continueChain!=undefined)&&(continueChain=úlse)){break;}}
 +if(!this.fallThrough){OpenLayers.Event.stop(evt,true);}}
+return continueChain;},handleBrowserEvent:function(evt){evt.xy=this.getMousePosition( \
evt);this.triggerEvent(evt.type,evt);},getMousePosition:function(evt){if(!this.element \
.offsets){this.element.offsets=OpenLayers.Util.pagePosition(this.element);this.element \
.offsets[0]+=(document.documentElement.scrollLeft||document.body.scrollLeft);this.element.offsets[1]+=(document.documentElement.scrollTop||document.body.scrollTop);}
 +return new OpenLayers.Pixel((evt.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))-this.element.offsets[0]
 +-(document.documentElement.clientLeft||0),(evt.clientY+(document.documentElement.scrollTop||document.body.scrollTop))-this.element.offsets[1]
 +-(document.documentElement.clientTop||0));},CLASS_NAME:"OpenLayers.Events"});OpenLay \
ers.Format=OpenLayers.Class({externalProjection:null,internalProjection:null,initializ \
e:function(options){OpenLayers.Util.extend(this,options);},read:function(data){alert(O \
penLayers.i18n("readNotImplemented"));},write:function(object){alert(OpenLayers.i18n(" \
writeNotImplemented"));},CLASS_NAME:"OpenLayers.Format"});OpenLayers.Lang.en={'unhandledRequest':"Unhandled \
request return ${statusText}",'permalink':"Permalink",'overlays':"Overlays",'baseLayer':"Base \
Layer",'sameProjection':"The overview map only works when it is in the same \
projection as the main map",'readNotImplemented':"Read not \
implemented.",'writeNotImplemented':"Write not implemented.",'noFID':"Can't update a \
feature for which there is no FID.",'errorLoadingGML':"Error in loading GML file \
${url}",'browserNotSupported':"Your browser does not support vector rendering. \
Currently supported renderers are:\n${renderers}",'componentShoul  dBe':"addFeatures \
: component should be an ${geomType}",'getFeatureError':"getFeatureFromEvent called \
on layer with no renderer. This usually means you "+"destroyed a layer, but not some \
handler which is associated with it.",'minZoomLevelError':"The minZoomLevel property \
is only intended for use "+"with the FixedZoomLevels-descendent layers. That this \
"+"wfs layer checks for minZoomLevel is a relic of the"+"past. We cannot, however, \
remove it without possibly "+"breaking OL based applications that may depend on \
it."+" Therefore we are deprecating it -- the minZoomLevel "+"check below will be \
removed at 3.0. Please instead "+"use min/max resolution setting as described here: \
"+"http://trac.openlayers.org/wiki/SettingZoomLevels",'commitSuccess':"WFS \
Transaction: SUCCESS ${response}",'commitFailed':"WFS Transaction: FAILED \
${response}",'googleWarning':"The Google Layer was unable to load \
correctly.<br><br>"+"To get rid of this message, select a new BaseLayer "+"in the \
layer swi  tcher in the upper-right corner.<br><br>"+"Most likely, this is because \
the Google Maps library "+"script was either not included, or does not contain the \
"+"correct API key for your site.<br><br>"+"Developers: For help getting this working \
correctly, "+"<a href='http://trac.openlayers.org/wiki/Google' \
"+"target='_blank'>click here</a>",'getLayerWarning':"The ${layerType} Layer was \
unable to load correctly.<br><br>"+"To get rid of this message, select a new \
BaseLayer "+"in the layer switcher in the upper-right corner.<br><br>"+"Most likely, \
this is because the ${layerLib} library "+"script was either not correctly \
included.<br><br>"+"Developers: For help getting this working correctly, "+"<a \
href='http://trac.openlayers.org/wiki/${layerLib}' "+"target='_blank'>click \
here</a>",'scale':"Scale = 1 : ${scaleDenom}",'layerAlreadyAdded':"You tried to add \
the layer: ${layerName} to the map, but it has already been \
added",'reprojectDeprecated':"You are using the 'reproject' option "  +"on the \
${layerName} layer. This option is deprecated: "+"its use was designed to support \
displaying data over commercial "+"basemaps, but that functionality should now be \
achieved by using "+"Spherical Mercator support. More information is available from \
"+"http://trac.openlayers.org/wiki/SphericalMercator.",'methodDeprecated':"This \
method has been deprecated and will be removed in 3.0. "+"Please use ${newMethod} \
instead.",'boundsAddError':"You must pass both x and y values to the add \
function.",'lonlatAddError':"You must pass both lon and lat values to the add \
function.",'pixelAddError':"You must pass both x and y values to the add \
function.",'unsupportedGeometryType':"Unsupported geometry type: \
${geomType}",'pagePositionFailed':"OpenLayers.Util.pagePosition failed: element with \
id ${elemId} may be misplaced.",'end':''};OpenLayers.Popup.Anchored=OpenLayers.Class(O \
penLayers.Popup,{relativePosition:null,anchor:null,initialize:function(id,lonlat,size,contentHTML,anchor,close
  Box,closeBoxCallback){var newArguments=new \
Array(id,lonlat,size,contentHTML,closeBox,closeBoxCallback);OpenLayers.Popup.prototype.initialize.apply(this,newArguments);this.anchor=(anchor!=null)?anchor:{size:new \
OpenLayers.Size(0,0),offset:new \
OpenLayers.Pixel(0,0)};},destroy:function(){this.anchor=null;this.relativePosition=nul \
l;OpenLayers.Popup.prototype.destroy.apply(this,arguments);},show:function(){this.upda \
tePosition();OpenLayers.Popup.prototype.show.apply(this,arguments);},moveTo:function(px){var \
oldRelativePosition=this.relativePosition;this.relativePosition=this.calculateRelativePosition(px);var \
newPx=this.calculateNewPx(px);var newArguments=new \
Array(newPx);OpenLayers.Popup.prototype.moveTo.apply(this,newArguments);if(this.relati \
vePosition!=oldRelativePosition){this.updateRelativePosition();}},setSize:function(siz \
e){OpenLayers.Popup.prototype.setSize.apply(this,arguments);if((this.lonlat)&&(this.map)){var \
px=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(px);  \
}},calculateRelativePosition:function(px){var \
lonlat=this.map.getLonLatFromLayerPx(px);var extent=this.map.getExtent();var \
quadrant=extent.determineQuadrant(lonlat);return \
OpenLayers.Bounds.oppositeQuadrant(quadrant);},updateRelativePosition:function(){},calculateNewPx:function(px){var \
newPx=px.offset(this.anchor.offset);var \
top=(this.relativePosition.charAt(0)=='t');newPx.y+=(top)?-this.size.h:this.anchor.size.h;var \
left=(this.relativePosition.charAt(1)=='l');newPx.x+=(left)?-this.size.w:this.anchor.size.w;return \
newPx;},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Projection=OpenLayers.Clas \
s({proj:null,projCode:null,initialize:function(projCode,options){OpenLayers.Util.extend(this,options);this.projCode=projCode;if(window.Proj4js){this.proj=new \
Proj4js.Proj(projCode);}},getCode:function(){return \
this.proj?this.proj.srsCode:this.projCode;},getUnits:function(){return \
this.proj?this.proj.units:null;},toString:function(){return \
this.getCode();},equals:function(projectio  \
n){if(projection&&projection.getCode){return \
this.getCode()==projection.getCode();}else{return false;}},destroy:function(){delete \
this.proj;delete this.projCode;},CLASS_NAME:"OpenLayers.Projection"});OpenLayers.Proje \
ction.transforms={};OpenLayers.Projection.addTransform=function(from,to,method){if(!Op \
enLayers.Projection.transforms[from]){OpenLayers.Projection.transforms[from]={};} \
+OpenLayers.Projection.transforms[from][to]=method;};OpenLayers.Projection.transform=f \
unction(point,source,dest){if(source.proj&&dest.proj){point=Proj4js.transform(source.proj,dest.proj,point);}else \
if(source&&dest&&OpenLayers.Projection.transforms[source.getCode()]&&OpenLayers.Projec \
tion.transforms[source.getCode()][dest.getCode()]){OpenLayers.Projection.transforms[source.getCode()][dest.getCode()](point);}
 +return point;};OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{re \
ndererRoot:null,root:null,xmlns:null,minimumSymbolizer:{strokeLinecap:"round",strokeOp \
acity:1,fillOpacity:1,pointRadius:0},initialize:function(containerID){OpenLayers.Rende \
rer.prototype.initialize.apply(this,arguments);this.rendererRoot=this.createRenderRoot \
();this.root=this.createRoot();this.rendererRoot.appendChild(this.root);this.container \
.appendChild(this.rendererRoot);},destroy:function(){this.clear();this.rendererRoot=nu \
ll;this.root=null;this.xmlns=null;OpenLayers.Renderer.prototype.destroy.apply(this,arg \
uments);},clear:function(){if(this.root){while(this.root.childNodes.length>0){this.roo \
t.removeChild(this.root.firstChild);}}},getNodeType:function(geometry,style){},drawGeometry:function(geometry,style,featureId){var \
className=geometry.CLASS_NAME;if((className=="OpenLayers.Geometry.Collection")||(class \
Name=="OpenLayers.Geometry.MultiPoint")||(className=="OpenLayers.Geometry.MultiLineStr
  ing")||(className=="OpenLayers.Geometry.MultiPolygon")){for(var \
i=0;i<geometry.components.length;i++){this.drawGeometry(geometry.components[i],style,featureId);}
 +return;};if(style.display!="none"){var \
nodeType=this.getNodeType(geometry,style);var \
node=this.nodeFactory(geometry.id,nodeType);node._featureIdþatureId;node._geometryClas \
s=geometry.CLASS_NAME;node._style=style;node=this.drawGeometryNode(node,geometry);if(node.parentNode!=this.root){this.root.appendChild(node);}
 +this.postDraw(node);}else{node=OpenLayers.Util.getElement(geometry.id);if(node){node \
.parentNode.removeChild(node);}}},drawGeometryNode:function(node,geometry,style){style \
=style||node._style;OpenLayers.Util.applyDefaults(style,this.minimumSymbolizer);var \
options={'isFilled':true,'isStroked':!!style.strokeWidth};switch(geometry.CLASS_NAME){ \
case"OpenLayers.Geometry.Point":this.drawPoint(node,geometry);break;case"OpenLayers.Ge \
ometry.LineString":options.isFilledúlse;this.drawLineString(node,geometry);break;case" \
OpenLayers.Geometry.LinearRing":this.drawLinearRing(node,geometry);break;case"OpenLaye \
rs.Geometry.Polygon":this.drawPolygon(node,geometry);break;case"OpenLayers.Geometry.Su \
rface":this.drawSurface(node,geometry);break;case"OpenLayers.Geometry.Rectangle":this.drawRectangle(node,geometry);break;default:break;}
 +node._style=style;node._options=options;return \
this.setStyle(node,style,options,geometry);},postDraw:function(node){},drawPoint:funct \
ion(node,geometry){},drawLineString:function(node,geometry){},drawLinearRing:function( \
node,geometry){},drawPolygon:function(node,geometry){},drawRectangle:function(node,geo \
metry){},drawCircle:function(node,geometry){},drawSurface:function(node,geometry){},getFeatureIdFromEvent:function(evt){var \
node=evt.target||evt.srcElement;return \
node._featureId;},eraseGeometry:function(geometry){if((geometry.CLASS_NAME=="OpenLayer \
s.Geometry.MultiPoint")||(geometry.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(geometry.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")){for(var \
i=0;i<geometry.components.length;i++){this.eraseGeometry(geometry.components[i]);}}else{var \
element=OpenLayers.Util.getElement(geometry.id);if(element&&element.parentNode){element.parentNode.removeChild(element);}}},nodeFactory:function(id,type){var \
node=OpenLayers.Util.getElement  \
(id);if(node){if(!this.nodeTypeCompare(node,type)){node.parentNode.removeChild(node);node=this.nodeFactory(id,type);}}else{node=this.createNode(type,id);}
 +return node;},CLASS_NAME:"OpenLayers.Renderer.Elements"});OpenLayers.Tile=OpenLayers \
.Class({EVENT_TYPES:["loadstart","loadend","reload","unload"],events:null,id:null,laye \
r:null,url:null,bounds:null,size:null,position:null,isLoading:false,isBackBuffer:false \
,lastRatio:1,isFirstDraw:true,backBufferTile:null,initialize:function(layer,position,b \
ounds,url,size){this.layer=layer;this.position=position.clone();this.bounds=bounds.clo \
ne();this.url=url;this.size=size.clone();this.id=OpenLayers.Util.createUniqueID("Tile_");this.events=new \
OpenLayers.Events(this,null,this.EVENT_TYPES);},unload:function(){if(this.isLoading){t \
his.isLoadingúlse;this.events.triggerEvent("unload");}},destroy:function(){if(OpenLaye \
rs.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){thi \
s.layer.events.unregister("loadend",this,this.resetBackBuffer);this.events.unregister( \
'loadend',this,this.resetBackBuffer);}else{this.events.unregister('loadend',this,this.showTile);}
 +this.layer=null;this.bounds=null;this.size=null;this.position=null;this.events.destr \
oy();this.events=null;if(this.backBufferTile){this.backBufferTile.destroy();this.backBufferTile=null;}},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size);} \
+OpenLayers.Util.applyDefaults(obj,this);return obj;},draw:function(){var \
maxExtent=this.layer.maxExtent;var \
withinMaxExtent=(maxExtent&&this.bounds.intersectsBounds(maxExtent,false));var \
drawTile=(withinMaxExtent||this.layer.displayOutsideMaxExtent);if(OpenLayers.Util.inde \
xOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(drawTile){if \
(!this.backBufferTile){this.backBufferTile=this.clone();this.backBufferTile.hide();thi \
s.backBufferTile.isBackBuffer=true;this.events.register('loadend',this,this.resetBackBuffer);this.layer.events.register("loadend",this,this.resetBackBuffer);}
 +this.startTransition();}else{if(this.backBufferTile){this.backBufferTile.clear();}}} \
else{if(drawTile&&this.isFirstDraw){this.events.register('loadend',this,this.showTile);this.isFirstDrawúlse;}}
 +this.shouldDraw=drawTile;this.clear();return \
drawTile;},moveTo:function(bounds,position,redraw){if(redraw==null){redraw=true;} \
+this.bounds=bounds.clone();this.position=position.clone();if(redraw){this.draw();}},clear:function(){},getBoundsFromBaseLayer:function(position){var \
msg=OpenLayers.i18n('reprojectDeprecated',{'layerName':this.layer.name});OpenLayers.Console.warn(msg);var \
topLeft=this.layer.map.getLonLatFromLayerPx(position);var \
bottomRightPx=position.clone();bottomRightPx.x+=this.size.w;bottomRightPx.y+=this.size.h;var \
bottomRight=this.layer.map.getLonLatFromLayerPx(bottomRightPx);if(topLeft.lon>bottomRi \
ght.lon){if(topLeft.lon<0){topLeft.lon=-180-(topLeft.lon+180);}else{bottomRight.lon0+bottomRight.lon+180;}}
 +var bounds=new OpenLayers.Bounds(topLeft.lon,bottomRight.lat,bottomRight.lon,topLeft.lat);return \
bounds;},startTransition:function(){},resetBackBuffer:function(){this.showTile();if(th \
is.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)){this.isFirstDrawúlse;var \
maxExtent=this.layer.maxExtent;var \
withinMaxExtent=(maxExtent&&this.bounds.intersectsBounds(maxExtent,false));if(withinMa \
xExtent){this.backBufferTile.position=this.position;this.backBufferTile.bounds=this.bo \
unds;this.backBufferTile.size=this.size;this.backBufferTile.imageSize=this.layer.image \
Size||this.size;this.backBufferTile.imageOffset=this.layer.imageOffset;this.backBuffer \
Tile.resolution=this.layer.getResolution();this.backBufferTile.renderTile();}}},showTi \
le:function(){if(this.shouldDraw){this.show();}},show:function(){},hide:function(){},C \
LASS_NAME:"OpenLayers.Tile"});OpenLayers.Control.MouseToolbar=OpenLayers.Class(OpenLayers.Control.MouseDefaults,{mode:null,buttons:null,direction:"vertical",but
  tonClicked:null,initialize:function(position,direction){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.position=new \
OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,OpenLayers.Control.MouseToolbar.Y);if(position){this.position=position;}
 +if(direction){this.direction=direction;}
+this.measureDivs=[];},destroy:function(){for(var btnId in this.buttons){var \
btn=this.buttons[btnId];btn.map=null;btn.events.destroy();} \
+OpenLayers.Control.MouseDefaults.prototype.destroy.apply(this,arguments);},draw:funct \
ion(){OpenLayers.Control.prototype.draw.apply(this,arguments);OpenLayers.Control.MouseDefaults.prototype.draw.apply(this,arguments);this.buttons={};var \
sz=new OpenLayers.Size(28,28);var centered=new \
OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,0);this._addButton("zoombox","drag-rectangle-off.png","drag-rectangle-on.png",centered,sz,"Shift->Drag \
to zoom to area");centeredÎntered.add((this.direction=="vertical"?0:sz.w),(this.direct \
ion=="vertical"?sz.h:0));this._addButton("pan","panning-hand-off.png","panning-hand-on.png",centered,sz,"Drag \
the map to pan.");centeredÎntered.add((this.direction=="vertical"?0:sz.w),(this.direction=="vertical"?sz.h:0));this.switchModeTo("pan");return \
this.div;},_addButton:function(id,img,activeImg,xy,sz,title){var \
imgLocation=OpenLayers.Util.getImagesLocation()+img;var \
activeImgLocation=OpenLayers.Util.getImagesLocation()+activeImg;var \
                btn=OpenLayers.Util
 .createAlphaImageDiv("OpenLayers_Control_MouseToolbar_"+id,xy,sz,imgLocation,"absolut \
e");this.div.appendChild(btn);btn.imgLocation=imgLocation;btn.activeImgLocation¬tiveImgLocation;btn.events=new \
OpenLayers.Events(this,btn,null,true);btn.events.on({"mousedown":this.buttonDown,"mous \
eup":this.buttonUp,"dblclick":OpenLayers.Event.stop,scope:this});btn.action=id;btn.title=title;btn.alt=title;btn.map=this.map;this.buttons[id]=btn;return \
btn;},buttonDown:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;} \
+this.buttonClicked=evt.element.action;OpenLayers.Event.stop(evt);},buttonUp:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
 +if(this.buttonClicked!=null){if(this.buttonClicked==evt.element.action){this.switchModeTo(evt.element.action);}
 +OpenLayers.Event.stop(evt);this.buttonClicked=null;}},defaultDblClick:function(evt){this.switchModeTo("pan");this.performedDragúlse;var \
newCenter=this.map.getLonLatFromViewPortPx(evt.xy);this.map.setCenter(newCenter,this.map.zoom+1);OpenLayers.Event.stop(evt);return \
false;},defaultMouseDown:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
 +this.mouseDragStart=evt.xy.clone();this.performedDragúlse;this.startViaKeyboardúlse; \
if(evt.shiftKey&&this.mode!="zoombox"){this.switchModeTo("zoombox");this.startViaKeyboard=true;}else \
if(evt.altKey&&this.mode!="measure"){this.switchModeTo("measure");}else \
if(!this.mode){this.switchModeTo("pan");} \
+switch(this.mode){case"zoombox":this.map.div.style.cursor="crosshair";this.zoomBox=OpenLayers.Util.createDiv('zoomBox',this.mouseDragStart,null,null,"absolute","2px \
solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.filter="alph \
a(opacityP)";this.zoomBox.style.opacity="0.50";this.zoomBox.style.fontSize="1px";this. \
zoomBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.viewPortDiv.appendChild(this.zoomBox);this.performedDrag=true;break;case"measure":var \
distance="";if(this.measureStart){var \
measureEnd=this.map.getLonLatFromViewPortPx(this.mouseDragStart);distance=OpenLayers.U \
til.distVincenty(this.measureStart,measureEnd);distance=Math.round(distance*100)/100;distance=distance+"km";this.measureStartBox=this.measureBox;}
 +this.measureStart=this.map.getLonLatFromViewPortPx(this.mouseDragStart);;this.measur \
eBox=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layer \
ContainerDiv.style.left),-2-parseInt(this.map.layerContainerDiv.style.top)),null,null, \
"absolute");this.measureBox.style.width="4px";this.measureBox.style.height="4px";this. \
measureBox.style.fontSize="1px";this.measureBox.style.backgroundColor="red";this.measu \
reBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.layerContainerDiv.appendC \
hild(this.measureBox);if(distance){this.measureBoxDistance=OpenLayers.Util.createDiv(n \
ull,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),2-parse \
Int(this.map.layerContainerDiv.style.top)),null,null,"absolute");this.measureBoxDistan \
ce.innerHTML=distance;this.measureBoxDistance.style.zIndex=this.map.Z_INDEX_BASE["Popu \
p"]-1;this.map.layerContainerDiv.appendChild(this.measureBoxDistance);this.measureDivs.push(this.measureBoxDistance);}
 +this.measureBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.layerContaine \
rDiv.appendChild(this.measureBox);this.measureDivs.push(this.measureBox);break;default:this.map.div.style.cursor="move";break;}
 +document.onselectstart=function(){return \
false;};OpenLayers.Event.stop(evt);},switchModeTo:function(mode){if(mode!=this.mode){i \
f(this.mode&&this.buttons[this.mode]){OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode],null,null,null,this.buttons[this.mode].imgLocation);}
 +if(this.mode=="measure"&&mode!="measure"){for(var \
i=0;i<this.measureDivs.length;i++){if(this.measureDivs[i]){this.map.layerContainerDiv.removeChild(this.measureDivs[i]);}}
 +this.measureDivs=[];this.measureStart=null;}
+this.mode=mode;if(this.buttons[mode]){OpenLayers.Util.modifyAlphaImageDiv(this.buttons[mode],null,null,null,this.buttons[mode].activeImgLocation);}
 +switch(this.mode){case"zoombox":this.map.div.style.cursor="crosshair";break;default: \
this.map.div.style.cursor="";break;}}},leaveMode:function(){this.switchModeTo("pan");} \
,defaultMouseMove:function(evt){if(this.mouseDragStart!=null){switch(this.mode){case"zoombox":var \
deltaX=Math.abs(this.mouseDragStart.x-evt.xy.x);var \
deltaY=Math.abs(this.mouseDragStart.y-evt.xy.y);this.zoomBox.style.width=Math.max(1,de \
ltaX)+"px";this.zoomBox.style.height=Math.max(1,deltaY)+"px";if(evt.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=evt.xy.x+"px";}
 +if(evt.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=evt.xy.y+"px";}
+break;default:var deltaX=this.mouseDragStart.x-evt.xy.x;var \
deltaY=this.mouseDragStart.y-evt.xy.y;var size=this.map.getSize();var newXY=new \
OpenLayers.Pixel(size.w/2+deltaX,size.h/2+deltaY);var \
newCenter=this.map.getLonLatFromViewPortPx(newXY);this.map.setCenter(newCenter,null,true);this.mouseDragStart=evt.xy.clone();}
 +this.performedDrag=true;}},defaultMouseUp:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
 +switch(this.mode){case"zoombox":this.zoomBoxEnd(evt);if(this.startViaKeyboard){this.leaveMode();}
 +break;case"pan":if(this.performedDrag){this.map.setCenter(this.map.center);}}
+document.onselectstart=null;this.mouseDragStart=null;this.map.div.style.cursor="defau \
lt";},defaultMouseOut:function(evt){if(this.mouseDragStart!=null&&OpenLayers.Util.mous \
eLeft(evt,this.map.div)){if(this.zoomBox){this.removeZoomBox();if(this.startViaKeyboard){this.leaveMode();}}
 +this.mouseDragStart=null;this.map.div.style.cursor="default";}},defaultClick:function(evt){if(this.performedDrag){this.performedDragúlse;return \
false;}},CLASS_NAME:"OpenLayers.Control.MouseToolbar"});OpenLayers.Control.MouseToolba \
r.X=6;OpenLayers.Control.MouseToolbar.Y00;OpenLayers.Control.PanZoomBar=OpenLayers.Cla \
ss(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEv \
ents:null,zoomBarDiv:null,divEvents:null,zoomWorldIcon:false,initialize:function(){Ope \
nLayers.Control.PanZoom.prototype.initialize.apply(this,arguments);},destroy:function( \
){this.div.removeChild(this.slider);this.slider=null;this.sliderEvents.destroy();this. \
sliderEvents=null;this.div.removeChild(this.zoombarDiv);this.zoomBarDiv=null;this.divE \
vents.destroy();this.divEvents=null;this.map.events.un({"zoomend":this.moveZoomBar,"ch \
angebaselayer":this.redraw,scope:this});OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments);},setMap:function(map){OpenLayers.Control.PanZ
  oom.prototype.setMap.apply(this,arguments);this.map.events.register("changebaselayer \
",this,this.redraw);},redraw:function(){if(this.div!=null){this.div.innerHTML="";} \
+this.draw();},draw:function(px){OpenLayers.Control.prototype.draw.apply(this,arguments);px=this.position.clone();this.buttons=[];var \
sz=new OpenLayers.Size(18,18);var centered=new OpenLayers.Pixel(px.x+sz.w/2,px.y);var \
wposition=sz.w;if(this.zoomWorldIcon){centered=new OpenLayers.Pixel(px.x+sz.w,px.y);} \
+this._addButton("panup","north-mini.png",centered,sz);px.yÎntered.y+sz.h;this._addBut \
ton("panleft","west-mini.png",px,sz);if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",px.add(sz.w,0),sz);wposition*=2;}
 +this._addButton("panright","east-mini.png",px.add(wposition,0),sz);this._addButton(" \
pandown","south-mini.png",centered.add(0,sz.h*2),sz);this._addButton("zoomin","zoom-pl \
us-mini.png",centered.add(0,sz.h*3+5),sz);centered=this._addZoomBar(centered.add(0,sz.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",centered,sz);return \
this.div;},_addZoomBar:function(centered){var \
imgLocation=OpenLayers.Util.getImagesLocation();var \
id="OpenLayers_Control_PanZoomBar_Slider"+this.map.id;var \
zoomsToEnd=this.map.getNumZoomLevels()-1-this.map.getZoom();var \
slider=OpenLayers.Util.createAlphaImageDiv(id,centered.add(-1,zoomsToEnd*this.zoomStopHeight),new \
OpenLayers.Size(20,9),imgLocation+"slider.png","absolute");this.slider=slider;this.sliderEvents=new \
OpenLayers.Events(this,slider,null,true);this.sliderEvents.on({"mousedown":this.zoomBa \
rDown,"mousemove":this.zoomBarDrag,"mouseup":this.zoomBarUp,"dblclick":this.doubleClick,"click":this.doubleClick});var \
                sz=new OpenLayers.Size();sz.h=this
 .zoomStopHeight*this.map.getNumZoomLevels();sz.w=this.zoomStopWidth;var \
div=null;if(OpenLayers.Util.alphaHack()){var \
id="OpenLayers_Control_PanZoomBar"+this.map.id;div=OpenLayers.Util.createAlphaImageDiv(id,centered,new \
OpenLayers.Size(sz.w,this.zoomStopHeight),imgLocation+"zoombar.png","absolute",null,"c \
rop");div.style.height=sz.h;}else{div=OpenLayers.Util.createDiv('OpenLayers_Control_PanZoomBar_Zoombar'+this.map.id,centered,sz,imgLocation+"zoombar.png");}
 +this.zoombarDiv=div;this.divEvents=new \
OpenLayers.Events(this,div,null,true);this.divEvents.on({"mousedown":this.divClick,"mo \
usemove":this.passEventToSlider,"dblclick":this.doubleClick,"click":this.doubleClick}) \
;this.div.appendChild(div);this.startTop=parseInt(div.style.top);this.div.appendChild( \
slider);this.map.events.register("zoomend",this,this.moveZoomBar);centeredÎntered.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());return \
centered;},passEventToSlider:function(evt){this.sliderEvents.handleBrowserEvent(evt);},divClick:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
 +var y=evt.xy.y;var top=OpenLayers.Util.pagePosition(evt.object)[1];var \
levels=(y-top)/this.zoomStopHeight;if(!this.map.fractionalZoom){levels=Math.floor(levels);}
 +var zoom=(this.map.getNumZoomLevels()-1)-levels;zoom=Math.min(Math.max(zoom,0),this. \
map.getNumZoomLevels()-1);this.map.zoomTo(zoom);OpenLayers.Event.stop(evt);},zoomBarDown:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
 +this.map.events.on({"mousemove":this.passEventToSlider,"mouseup":this.passEventToSli \
der,scope:this});this.mouseDragStart=evt.xy.clone();this.zoomStart=evt.xy.clone();this \
.div.style.cursor="move";this.zoombarDiv.offsets=null;OpenLayers.Event.stop(evt);},zoomBarDrag:function(evt){if(this.mouseDragStart!=null){var \
deltaY=this.mouseDragStart.y-evt.xy.y;var \
offsets=OpenLayers.Util.pagePosition(this.zoombarDiv);if((evt.clientY-offsets[1])>0&&(evt.clientY-offsets[1])<parseInt(this.zoombarDiv.style.height)-2){var \
newTop=parseInt(this.slider.style.top)-deltaY;this.slider.style.top=newTop+"px";} \
+this.mouseDragStart=evt.xy.clone();OpenLayers.Event.stop(evt);}},zoomBarUp:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
 +if(this.zoomStart){this.div.style.cursor="";this.map.events.un({"mouseup":this.passEventToSlider,"mousemove":this.passEventToSlider,scope:this});var \
deltaY=this.zoomStart.y-evt.xy.y;var \
zoomLevel=this.map.zoom;if(this.map.fractionalZoom){zoomLevel+ÞltaY/this.zoomStopHeigh \
t;zoomLevel=Math.min(Math.max(zoomLevel,0),this.map.getNumZoomLevels()-1);}else{zoomLevel+=Math.round(deltaY/this.zoomStopHeight);}
 +this.map.zoomTo(zoomLevel);this.moveZoomBar();this.mouseDragStart=null;OpenLayers.Event.stop(evt);}},moveZoomBar:function(){var \
newTop=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.s \
tartTop+1;this.slider.style.top=newTop+"px";},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:" \
",space:" ",newline:"\n",level:0,pretty:false,initialize:function(options){OpenLayers. \
Format.prototype.initialize.apply(this,[options]);},read:function(json,filter){try{if( \
/^[\],:{}\s]*$/.test(json.replace(/\\["\\\/bfnrtu]/g,'@').replace(/"[^"\\\n\r]*"|true| \
false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){var \
object=eval('('+json+')');if(typeof filter==='function'){function \
walk(k,v){if(v&&typeof v==='object'){for(var i in \
v){if(v.hasOwnProperty(i)){v[i]=walk(i,v[i]);}}} +return filter(k,v);}
+object=walk('',object);}
+return object;}}catch(e){}
+return null;},write:function(value,pretty){this.pretty=!!pretty;var json=null;var \
type=typeof value;if(this.serialize[type]){json=this.serialize[type].apply(this,[value]);}
 +return json;},writeIndent:function(){var pieces=[];if(this.pretty){for(var \
i=0;i<this.level;++i){pieces.push(this.indent);}} +return \
pieces.join('');},writeNewline:function(){return(this.pretty)?this.newline:'';},writeS \
pace:function(){return(this.pretty)?this.space:'';},serialize:{'object':function(object){if(object==null){return"null";}
 +if(object.constructor=Úte){return this.serialize.date.apply(this,[object]);}
+if(object.constructor==Array){return this.serialize.array.apply(this,[object]);}
+var pieces=['{'];this.level+=1;var key,keyJSON,valueJSON;var addCommaúlse;for(key in \
object){if(object.hasOwnProperty(key)){keyJSON=OpenLayers.Format.JSON.prototype.write. \
apply(this,[key,this.pretty]);valueJSON=OpenLayers.Format.JSON.prototype.write.apply(t \
his,[object[key],this.pretty]);if(keyJSON!=null&&valueJSON!=null){if(addComma){pieces.push(',');}
 +pieces.push(this.writeNewline(),this.writeIndent(),keyJSON,':',this.writeSpace(),valueJSON);addComma=true;}}}
 +this.level-=1;pieces.push(this.writeNewline(),this.writeIndent(),'}');return \
pieces.join('');},'array':function(array){var json;var \
pieces=['['];this.level+=1;for(var \
i=0;i<array.length;++i){json=OpenLayers.Format.JSON.prototype.write.apply(this,[array[i],this.pretty]);if(json!=null){if(i>0){pieces.push(',');}
 +pieces.push(this.writeNewline(),this.writeIndent(),json);}}
+this.level-=1;pieces.push(this.writeNewline(),this.writeIndent(),']');return \
pieces.join('');},'string':function(string){var \
m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};if(/[ \
"\\\x00-\x1f]/.test(string)){return'"'+string.replace(/([\x00-\x1f\\"])/g,function(a,b){var \
c=m[b];if(c){return c;} +c=b.charCodeAt();return'\\u00'+
+Math.floor(c/16).toString(16)+
+(c%16).toString(16);})+'"';}
+return'"'+string+'"';},'number':function(number){return \
isFinite(number)?String(number):"null";},'boolean':function(bool){return \
String(bool);},'date':function(date){function \
format(number){return(number<10)?'0'+number:number;} \
+return'"'+date.getFullYear()+'-'+ +format(date.getMonth()+1)+'-'+
+format(date.getDate())+'T'+
+format(date.getHours())+':'+
+format(date.getMinutes())+':'+
+format(date.getSeconds())+'"';}},CLASS_NAME:"OpenLayers.Format.JSON"});OpenLayers.For \
mat.XML=OpenLayers.Class(OpenLayers.Format,{xmldom:null,initialize:function(options){if(window.ActiveXObject){this.xmldom=new \
ActiveXObject("Microsoft.XMLDOM");} \
+OpenLayers.Format.prototype.initialize.apply(this,[options]);},read:function(text){var \
index=text.indexOf('<');if(index>0){text=text.substring(index);} +var \
node=OpenLayers.Util.Try(OpenLayers.Function.bind((function(){var \
xmldom;if(window.ActiveXObject&&!this.xmldom){xmldom=new \
ActiveXObject("Microsoft.XMLDOM");}else{xmldom=this.xmldom;} \
+xmldom.loadXML(text);return xmldom;}),this),function(){return new \
DOMParser().parseFromString(text,'text/xml');},function(){var req=new \
XMLHttpRequest();req.open("GET","data:"+"text/xml"+";charset=utf-8,"+encodeURIComponent(text),false);if(req.overrideMimeType){req.overrideMimeType("text/xml");}
 +req.send(null);return req.responseXML;});return node;},write:function(node){var \
data;if(this.xmldom){data=node.xml;}else{var serializer=new \
XMLSerializer();if(node.nodeType==1){var \
doc=document.implementation.createDocument("","",null);if(doc.importNode){node=doc.importNode(node,true);}
 +doc.appendChild(node);data=serializer.serializeToString(doc);}else{data=serializer.serializeToString(node);}}
 +return data;},createElementNS:function(uri,name){var \
element;if(this.xmldom){if(typeof \
uri=="string"){element=this.xmldom.createNode(1,name,uri);}else{element=this.xmldom.createNode(1,name,"");}}else{element=document.createElementNS(uri,name);}
 +return element;},createTextNode:function(text){var \
node;if(this.xmldom){node=this.xmldom.createTextNode(text);}else{node=document.createTextNode(text);}
 +return node;},getElementsByTagNameNS:function(node,uri,name){var \
elements=[];if(node.getElementsByTagNameNS){elements=node.getElementsByTagNameNS(uri,name);}else{var \
allNodes=node.getElementsByTagName("*");var potentialNode,fullName;for(var \
i=0;i<allNodes.length;++i){potentialNode=allNodes[i];fullName=(potentialNode.prefix)?( \
potentialNode.prefix+":"+name):name;if((name=="*")||(fullName==potentialNode.nodeName) \
){if((uri=="*")||(uri==potentialNode.namespaceURI)){elements.push(potentialNode);}}}} \
+return elements;},getAttributeNodeNS:function(node,uri,name){var \
attributeNode=null;if(node.getAttributeNodeNS){attributeNode=node.getAttributeNodeNS(uri,name);}else{var \
attributes=node.attributes;var potentialNode,fullName;for(var \
i=0;i<attributes.length;++i){potentialNode=attributes[i];if(potentialNode.namespaceURI \
==uri){fullName=(potentialNode.prefix)?(potentialNode.prefix+":"+name):name;if(fullName==potentialNode.nodeName){attributeNode=potentialNode;break;}}}}
 +return attributeNode;},getAttributeNS:function(node,uri,name){var \
attributeValue="";if(node.getAttributeNS){attributeValue=node.getAttributeNS(uri,name)||"";}else{var \
attributeNode=this.getAttributeNodeNS(node,uri,name);if(attributeNode){attributeValue=attributeNode.nodeValue;}}
 +return attributeValue;},getChildValue:function(node,def){var \
value;try{value=node.firstChild.nodeValue;}catch(e){value=(def!=undefined)?def:"";} \
+return value;},concatChildValues:function(node,def){var value="";var \
child=node.firstChild;var \
childValue;while(child){childValue=child.nodeValue;if(childValue){value+=childValue;} \
+child=child.nextSibling;} +if(value==""&&def!=undefined){valueÞf;}
+return value;},hasAttributeNS:function(node,uri,name){var \
foundúlse;if(node.hasAttributeNS){found=node.hasAttributeNS(uri,name);}else{found=!!this.getAttributeNodeNS(node,uri,name);}
 +return found;},setAttributeNS:function(node,uri,name,value){if(node.setAttributeNS){node.setAttributeNS(uri,name,value);}else{if(this.xmldom){if(uri){var \
attribute=node.ownerDocument.createNode(2,name,uri);attribute.nodeValue=value;node.set \
AttributeNode(attribute);}else{node.setAttribute(name,value);}}else{throw"setAttributeNS \
not implemented";}}},CLASS_NAME:"OpenLayers.Format.XML"});OpenLayers.Handler=OpenLayer \
s.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:f \
unction(control,callbacks,options){OpenLayers.Util.extend(this,options);this.control=control;this.callbacksÊllbacks;if(control.map){this.setMap(control.map);}
 +OpenLayers.Util.extend(this,options);this.id=OpenLayers.Util.createUniqueID(this.CLA \
SS_NAME+"_");},setMap:function(map){this.map=map;},checkModifiers:function(evt){if(this.keyMask==null){return \
true;} +var keyModifiers=(evt.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(evt.ctrlKey?Op \
enLayers.Handler.MOD_CTRL:0)|(evt.altKey?OpenLayers.Handler.MOD_ALT:0);return(keyModifiers==this.keyMask);},activate:function(){if(this.active){return \
false;} +var events=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var \
i=0;i<events.length;i++){if(this[events[i]]){this.register(events[i],this[events[i]]);}}
 +this.active=true;return true;},deactivate:function(){if(!this.active){return \
false;} +var events=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var \
i=0;i<events.length;i++){if(this[events[i]]){this.unregister(events[i],this[events[i]]);}}
 +this.activeúlse;return \
true;},callback:function(name,args){if(name&&this.callbacks[name]){this.callbacks[name \
].apply(this.control,args);}},register:function(name,method){this.map.events.registerP \
riority(name,this,method);this.map.events.registerPriority(name,this,this.setEvent);}, \
unregister:function(name,method){this.map.events.unregister(name,this,method);this.map \
.events.unregister(name,this,this.setEvent);},setEvent:function(evt){this.evt=evt;return \
true;},destroy:function(){this.deactivate();this.control=this.map=null;},CLASS_NAME:"O \
penLayers.Handler"});OpenLayers.Handler.MOD_NONE=0;OpenLayers.Handler.MOD_SHIFT=1;Open \
Layers.Handler.MOD_CTRL=2;OpenLayers.Handler.MOD_ALT=4;OpenLayers.Map=OpenLayers.Class \
({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Popup:750,Control:1000},EVENT_TYPES:["preadd \
layer","addlayer","removelayer","changelayer","movestart","move","moveend","zoomend"," \
popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove",
  "dragstart","drag","dragend","changebaselayer"],id:null,fractionalZoom:false,events: \
null,div:null,dragging:false,size:null,viewPortDiv:null,layerContainerOrigin:null,laye \
rContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,re \
solution:null,zoom:0,viewRequestID:0,tileSize:null,projection:"EPSG:4326",units:'degre \
es',resolutions:null,maxResolution:1.40625,minResolution:null,maxScale:null,minScale:n \
ull,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,di \
splayProjection:null,fallThrough:true,panTween:null,eventListeners:null,panMethod:Open \
Layers.Easing.Expo.easeOut,paddingForPopups:null,initialize:function(div,options){this.tileSize=new \
OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,OpenLayers.Map.TILE_HEIGHT);this.maxExtent=new \
OpenLayers.Bounds(-180,-90,180,90);this.paddingForPopups=new \
OpenLayers.Bounds(15,15,15,15);this.theme=OpenLayers._getScriptLocation()+'theme/default/style.css';OpenLayers.Util.extend(this,options);th
  is.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");this.div=OpenLayers.Util.getElement(div);var \
id=this.div.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(id,nu \
ll,null,null,"relative",null,"hidden");this.viewPortDiv.style.width="100%";this.viewPo \
rtDiv.style.height="100%";this.viewPortDiv.className="olMapViewport";this.div.appendCh \
ild(this.viewPortDiv);id=this.div.id+"_OpenLayers_Container";this.layerContainerDiv=Op \
enLayers.Util.createDiv(id);this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE['Popup']-1;this.viewPortDiv.appendChild(this.layerContainerDiv);this.events=new \
OpenLayers.Events(this,this.div,this.EVENT_TYPES,this.fallThrough);this.updateSize();if(this.eventListeners \
instanceof Object){this.events.on(this.eventListeners);} \
+this.events.register("movestart",this,this.updateSize);if(OpenLayers.String.contains( \
navigator.appName,"Microsoft")){this.events.register("resize",this,this.updateSize);}e \
lse{this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this);OpenLayers.Event.observe(window,'resize',this.updateSizeDestroy);}
 +if(this.theme){var addNode=true;var \
nodes=document.getElementsByTagName('link');for(var \
i=0;i<nodes.length;++i){if(OpenLayers.Util.isEquivalentUrl(nodes.item(i).href,this.theme)){addNodeúlse;break;}}
 +if(addNode){var cssNode=document.createElement('link');cssNode.setAttribute('rel','s \
tylesheet');cssNode.setAttribute('type','text/css');cssNode.setAttribute('href',this.theme);document.getElementsByTagName('head')[0].appendChild(cssNode);}}
 +this.layers=[];if(this.controls==null){if(OpenLayers.Control!=null){this.controls=[new \
OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoom(),new \
OpenLayers.Control.ArgParser(),new \
OpenLayers.Control.Attribution()];}else{this.controls=[];}} +for(var \
i=0;i<this.controls.length;i++){this.addControlToMap(this.controls[i]);} \
+this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLay \
ers.Event.observe(window,'unload',this.unloadDestroy);},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy){return \
false;} +OpenLayers.Event.stopObserving(window,'unload',this.unloadDestroy);this.unloa \
dDestroy=null;if(this.updateSizeDestroy){OpenLayers.Event.stopObserving(window,'resize \
',this.updateSizeDestroy);}else{this.events.unregister("resize",this,this.updateSize);}
 +this.paddingForPopups=null;if(this.controls!=null){for(var \
i=this.controls.length-1;i>=0;--i){this.controls[i].destroy();} +this.controls=null;}
+if(this.layers!=null){for(var \
i=this.layers.length-1;i>=0;--i){this.layers[i].destroy(false);} +this.layers=null;}
+if(this.viewPortDiv){this.div.removeChild(this.viewPortDiv);}
+this.viewPortDiv=null;if(this.eventListeners){this.events.un(this.eventListeners);this.eventListeners=null;}
 +this.events.destroy();this.events=null;},setOptions:function(options){OpenLayers.Util.extend(this,options);},getTileSize:function(){return \
this.tileSize;},getBy:function(array,property,match){var test=(typeof \
match.test=="function");var \
found=OpenLayers.Array.filter(this[array],function(item){return \
item[property]==match||(test&&match.test(item[property]));});return \
found;},getLayersBy:function(property,match){return \
this.getBy("layers",property,match);},getLayersByName:function(match){return \
this.getLayersBy("name",match);},getLayersByClass:function(match){return \
this.getLayersBy("CLASS_NAME",match);},getControlsBy:function(property,match){return \
this.getBy("controls",property,match);},getControlsByClass:function(match){return \
this.getControlsBy("CLASS_NAME",match);},getLayer:function(id){var \
foundLayer=null;for(var i=0;i<this.layers.length;i++){var \
layer=this.layers[i];if(layer.id==id){foundLayer=layer;break;}} +return \
foundLayer;},setLayerZIndex:function(layer,zIdx){layer.setZIndex(this.Z_INDEX_BASE[layer.isBaseLayer?'BaseLayer':'Overlay']
 ++zIdx*5);},resetLayersZIndex:function(){for(var i=0;i<this.layers.length;i++){var \
layer=this.layers[i];this.setLayerZIndex(layer,i);}},addLayer:function(layer){for(var \
i=0;i<this.layers.length;i++){if(this.layers[i]==layer){var \
msg=OpenLayers.i18n('layerAlreadyAdded',{'layerName':layer.name});OpenLayers.Console.warn(msg);return \
false;}} +this.events.triggerEvent("preaddlayer",{layer:layer});layer.div.className="o \
lLayerDiv";layer.div.style.overflow="";this.setLayerZIndex(layer,this.layers.length);i \
f(layer.isFixed){this.viewPortDiv.appendChild(layer.div);}else{this.layerContainerDiv.appendChild(layer.div);}
 +this.layers.push(layer);layer.setMap(this);if(layer.isBaseLayer){if(this.baseLayer== \
null){this.setBaseLayer(layer);}else{layer.setVisibility(false);}}else{layer.redraw();}
 +this.events.triggerEvent("addlayer",{layer:layer});},addLayers:function(layers){for(var \
i=0;i<layers.length;i++){this.addLayer(layers[i]);}},removeLayer:function(layer,setNewBaseLayer){if(setNewBaseLayer==null){setNewBaseLayer=true;}
 +if(layer.isFixed){this.viewPortDiv.removeChild(layer.div);}else{this.layerContainerDiv.removeChild(layer.div);}
 +OpenLayers.Util.removeItem(this.layers,layer);layer.removeMap(this);layer.map=null;if(this.baseLayer==layer){this.baseLayer=null;if(setNewBaseLayer){for(var \
i=0;i<this.layers.length;i++){var \
iLayer=this.layers[i];if(iLayer.isBaseLayer){this.setBaseLayer(iLayer);break;}}}} \
+this.resetLayersZIndex();this.events.triggerEvent("removelayer",{layer:layer});},getNumLayers:function(){return \
this.layers.length;},getLayerIndex:function(layer){return \
OpenLayers.Util.indexOf(this.layers,layer);},setLayerIndex:function(layer,idx){var \
base=this.getLayerIndex(layer);if(idx<0){idx=0;}else \
if(idx>this.layers.length){idx=this.layers.length;} \
+if(base!=idx){this.layers.splice(base,1);this.layers.splice(idx,0,layer);for(var \
i=0;i<this.layers.length;i++){this.setLayerZIndex(this.layers[i],i);} \
+this.events.triggerEvent("changelayer",{layer:layer,property:"order"});}},raiseLayer:function(layer,delta){var \
idx=this.getLayerIndex(layer)+delta;this.setLayerIndex(layer,idx);},setBaseLayer:function(newBaseLayer){var \
oldExtent=null;if(this.baseLayer){oldExtent=this.baseLayer.getExtent();} \
+if(newBaseLayer!=this.baseLayer){if(OpenLayers.Util.indexOf(this.layers,newBaseLayer)!=-1){if(this.baseLayer!=null){this.baseLayer.setVisibility(false);}
 +this.baseLayer=newBaseLayer;this.viewRequestID++;this.baseLayer.visibility=true;var \
center=this.getCenter();if(center!=null){var \
newCenter=(oldExtent)?oldExtent.getCenterLonLat():center;var \
newZoom=(oldExtent)?this.getZoomForExtent(oldExtent,true):this.getZoomForResolution(this.resolution,true);this.setCenter(newCenter,newZoom,false,true);}
 +this.events.triggerEvent("changebaselayer",{layer:this.baseLayer});}}},addControl:fu \
nction(control,px){this.controls.push(control);this.addControlToMap(control,px);},addC \
ontrolToMap:function(control,px){control.outsideViewport=(control.div!=null);if(this.d \
isplayProjection&&!control.displayProjection){control.displayProjection=this.displayProjection;}
 +control.setMap(this);var \
div=control.draw(px);if(div){if(!control.outsideViewport){div.style.zIndex=this.Z_INDEX_BASE['Control']+
 +this.controls.length;this.viewPortDiv.appendChild(div);}}},getControl:function(id){var \
returnControl=null;for(var i=0;i<this.controls.length;i++){var \
control=this.controls[i];if(control.id==id){returnControl=control;break;}} +return \
returnControl;},removeControl:function(control){if((control)&&(control==this.getContro \
l(control.id))){if(control.div&&(control.div.parentNode==this.viewPortDiv)){this.viewPortDiv.removeChild(control.div);}
 +OpenLayers.Util.removeItem(this.controls,control);}},addPopup:function(popup,exclusive){if(exclusive){for(var \
i=this.popups.length-1;i>=0;--i){this.removePopup(this.popups[i]);}} \
+popup.map=this;this.popups.push(popup);var \
popupDiv=popup.draw();if(popupDiv){popupDiv.style.zIndex=this.Z_INDEX_BASE['Popup']+ \
+this.popups.length;this.layerContainerDiv.appendChild(popupDiv);}},removePopup:functi \
on(popup){OpenLayers.Util.removeItem(this.popups,popup);if(popup.div){try{this.layerContainerDiv.removeChild(popup.div);}
 +catch(e){}}
+popup.map=null;},getSize:function(){var \
size=null;if(this.size!=null){size=this.size.clone();} +return \
size;},updateSize:function(){this.events.element.offsets=null;var \
newSize=this.getCurrentSize();var \
oldSize=this.getSize();if(oldSize==null){this.size=oldSize=newSize;} \
+if(!newSize.equals(oldSize)){this.size=newSize;for(var \
i=0;i<this.layers.length;i++){this.layers[i].onMapResize();} \
+if(this.baseLayer!=null){var center=new \
OpenLayers.Pixel(newSize.w/2,newSize.h/2);var \
centerLL=this.getLonLatFromViewPortPx(center);var \
zoom=this.getZoom();this.zoom=null;this.setCenter(this.getCenter(),zoom);}}},getCurrentSize:function(){var \
size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){var \
dim=OpenLayers.Element.getDimensions(this.div);size.w=dim.width;size.h=dim.height;} \
+if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=parseInt(this.div.style.width);size.h=parseInt(this.div.style.height);}
 +return size;},calculateBounds:function(center,resolution){var \
extent=null;if(center==null){center=this.getCenter();} \
+if(resolution==null){resolution=this.getResolution();} \
+if((center!=null)&&(resolution!=null)){var size=this.getSize();var \
w_deg=size.w*resolution;var h_deg=size.h*resolution;extent=new \
OpenLayers.Bounds(center.lon-w_deg/2,center.lat-h_deg/2,center.lon+w_deg/2,center.lat+h_deg/2);}
 +return extent;},getCenter:function(){return this.center;},getZoom:function(){return \
this.zoom;},pan:function(dx,dy,options){if(!options){options={};} \
+OpenLayers.Util.applyDefaults(options,{animate:true,dragging:false});var \
centerPx=this.getViewPortPxFromLonLat(this.getCenter());var \
newCenterPxÎnterPx.add(dx,dy);if(!options.dragging||!newCenterPx.equals(centerPx)){var \
newCenterLonLat=this.getLonLatFromViewPortPx(newCenterPx);if(options.animate){this.pan \
To(newCenterLonLat);}else{this.setCenter(newCenterLonLat,null,options.dragging);}}},pa \
nTo:function(lonlat){if(this.panMethod&&this.getExtent().containsLonLat(lonlat)){if(!this.panTween){this.panTween=new \
OpenLayers.Tween(this.panMethod);} +var center=this.getCenter();var \
from={lon:center.lon,lat:center.lat};var \
to={lon:lonlat.lon,lat:lonlat.lat};this.panTween.start(from,to,50,{callbacks:{start:Op \
enLayers.Function.bind(function(lonlat){this.events.triggerEvent("movestart");},this),eachStep:OpenLayers.Function.bind(function(lonlat){lonlat=new \
OpenLayers.LonLat(lonlat.lon,lonlat.lat);this.moveTo(lonlat,this.zoom,{'dragging':true \
,'noEvent':true});},this),done:OpenLayers.Function.bind(function(lonlat){lonlat=new \
OpenLayers.LonLat(lonlat.lon,lonlat.lat);this.moveTo(lonlat,this.zoom,{'noEvent':true} \
);this.events.triggerEvent("moveend");},this)}});}else{this.setCenter(lonlat);}},setCe \
nter:function(lonlat,zoom,dragging,forceZoomChange){this.moveTo(lonlat,zoom,{'dragging \
':dragging,'forceZoomChange':forceZoomChange,'caller':'setCenter'});},moveTo:function(lonlat,zoom,options){if(!options){options={};}
 +var dragging=options.dragging;var forceZoomChange=options.forceZoomChange;var \
noEvent=options.noEvent;if(this.panTween&&options.caller=="setCenter"){this.panTween.stop();}
 +if(!this.center&&!this.isValidLonLat(lonlat)){lonlat=this.maxExtent.getCenterLonLat();}
 +if(this.restrictedExtent!=null){if(lonlat==null){lonlat=this.getCenter();}
+if(zoom==null){zoom=this.getZoom();}
+var resolution=this.getResolutionForZoom(zoom);var \
extent=this.calculateBounds(lonlat,resolution);if(!this.restrictedExtent.containsBounds(extent)){var \
maxCenter=this.restrictedExtent.getCenterLonLat();if(extent.getWidth()>this.restrictedExtent.getWidth()){lonlat=new \
OpenLayers.LonLat(maxCenter.lon,lonlat.lat);}else \
if(extent.left<this.restrictedExtent.left){lonlat=lonlat.add(this.restrictedExtent.left-
 +extent.left,0);}else \
if(extent.right>this.restrictedExtent.right){lonlat=lonlat.add(this.restrictedExtent.right-
 +extent.right,0);}
+if(extent.getHeight()>this.restrictedExtent.getHeight()){lonlat=new \
OpenLayers.LonLat(lonlat.lon,maxCenter.lat);}else \
if(extent.bottom<this.restrictedExtent.bottom){lonlat=lonlat.add(0,this.restrictedExtent.bottom-
 +extent.bottom);}
+else if(extent.top>this.restrictedExtent.top){lonlat=lonlat.add(0,this.restrictedExtent.top-
 +extent.top);}}}
+var zoomChanged=forceZoomChange||((this.isValidZoomLevel(zoom))&&(zoom!=this.getZoom()));var \
centerChanged=(this.isValidLonLat(lonlat))&&(!lonlat.equals(this.center));if(zoomChang \
ed||centerChanged||!dragging){if(!this.dragging&&!noEvent){this.events.triggerEvent("movestart");}
 +if(centerChanged){if((!zoomChanged)&&(this.center)){this.centerLayerContainer(lonlat);}
 +this.center=lonlat.clone();}
+if((zoomChanged)||(this.layerContainerOrigin==null)){this.layerContainerOrigin=this.c \
enter.clone();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px";}
 +if(zoomChanged){this.zoom=zoom;this.resolution=this.getResolutionForZoom(zoom);this.viewRequestID++;}
 +var bounds=this.getExtent();this.baseLayer.moveTo(bounds,zoomChanged,dragging);bounds=this.baseLayer.getExtent();for(var \
i=0;i<this.layers.length;i++){var layer=this.layers[i];if(!layer.isBaseLayer){var \
inRange=layer.calculateInRange();if(layer.inRange!=inRange){layer.inRange=inRange;if(!inRange){layer.display(false);}
 +this.events.triggerEvent("changelayer",{layer:layer,property:"visibility"});}
+if(inRange&&layer.visibility){layer.moveTo(bounds,zoomChanged,dragging);}}}
+if(zoomChanged){for(var \
i=0;i<this.popups.length;i++){this.popups[i].updatePosition();}} \
+this.events.triggerEvent("move");if(zoomChanged){this.events.triggerEvent("zoomend");}}
 +if(!dragging&&!noEvent){this.events.triggerEvent("moveend");}
+this.dragging=!!dragging;},centerLayerContainer:function(lonlat){var \
originPx=this.getViewPortPxFromLonLat(this.layerContainerOrigin);var \
newPx=this.getViewPortPxFromLonLat(lonlat);if((originPx!=null)&&(newPx!=null)){this.la \
yerContainerDiv.style.left=Math.round(originPx.x-newPx.x)+"px";this.layerContainerDiv. \
style.top=Math.round(originPx.y-newPx.y)+"px";}},isValidZoomLevel:function(zoomLevel){ \
return((zoomLevel!=null)&&(zoomLevel>=0)&&(zoomLevel<this.getNumZoomLevels()));},isValidLonLat:function(lonlat){var \
validúlse;if(lonlat!=null){var \
maxExtent=this.getMaxExtent();valid=maxExtent.containsLonLat(lonlat);} +return \
valid;},getProjection:function(){var projection=this.getProjectionObject();return \
projection?projection.getCode():null;},getProjectionObject:function(){var \
projection=null;if(this.baseLayer!=null){projection=this.baseLayer.projection;} \
+return projection;},getMaxResolution:function(){var \
maxResolution=null;if(this.baseLayer!=null){maxResolution=this.baseLayer.maxResolution;}
 +return maxResolution;},getMaxExtent:function(){var \
maxExtent=null;if(this.baseLayer!=null){maxExtent=this.baseLayer.maxExtent;} +return \
maxExtent;},getNumZoomLevels:function(){var \
numZoomLevels=null;if(this.baseLayer!=null){numZoomLevels=this.baseLayer.numZoomLevels;}
 +return numZoomLevels;},getExtent:function(){var \
extent=null;if(this.baseLayer!=null){extent=this.baseLayer.getExtent();} +return \
extent;},getResolution:function(){var \
resolution=null;if(this.baseLayer!=null){resolution=this.baseLayer.getResolution();} \
+return resolution;},getScale:function(){var scale=null;if(this.baseLayer!=null){var \
res=this.getResolution();var \
units=this.baseLayer.units;scale=OpenLayers.Util.getScaleFromResolution(res,units);} \
+return scale;},getZoomForExtent:function(bounds,closest){var \
zoom=null;if(this.baseLayer!=null){zoom=this.baseLayer.getZoomForExtent(bounds,closest);}
 +return zoom;},getResolutionForZoom:function(zoom){var \
resolution=null;if(this.baseLayer){resolution=this.baseLayer.getResolutionForZoom(zoom);}
 +return resolution;},getZoomForResolution:function(resolution,closest){var \
zoom=null;if(this.baseLayer!=null){zoom=this.baseLayer.getZoomForResolution(resolution,closest);}
 +return zoom;},zoomTo:function(zoom){if(this.isValidZoomLevel(zoom)){this.setCenter(n \
ull,zoom);}},zoomIn:function(){this.zoomTo(this.getZoom()+1);},zoomOut:function(){this.zoomTo(this.getZoom()-1);},zoomToExtent:function(bounds){var \
center=bounds.getCenterLonLat();if(this.baseLayer.wrapDateLine){var \
maxExtent=this.getMaxExtent();bounds=bounds.clone();while(bounds.right<bounds.left){bounds.right+=maxExtent.getWidth();}
 +center=bounds.getCenterLonLat().wrapDateLine(maxExtent);}
+this.setCenter(center,this.getZoomForExtent(bounds));},zoomToMaxExtent:function(){this.zoomToExtent(this.getMaxExtent());},zoomToScale:function(scale){var \
res=OpenLayers.Util.getResolutionFromScale(scale,this.baseLayer.units);var \
size=this.getSize();var w_deg=size.w*res;var h_deg=size.h*res;var \
center=this.getCenter();var extent=new \
OpenLayers.Bounds(center.lon-w_deg/2,center.lat-h_deg/2,center.lon+w_deg/2,center.lat+ \
h_deg/2);this.zoomToExtent(extent);},getLonLatFromViewPortPx:function(viewPortPx){var \
lonlat=null;if(this.baseLayer!=null){lonlat=this.baseLayer.getLonLatFromViewPortPx(viewPortPx);}
 +return lonlat;},getViewPortPxFromLonLat:function(lonlat){var \
px=null;if(this.baseLayer!=null){px=this.baseLayer.getViewPortPxFromLonLat(lonlat);} \
+return px;},getLonLatFromPixel:function(px){return \
this.getLonLatFromViewPortPx(px);},getPixelFromLonLat:function(lonlat){var \
px=this.getViewPortPxFromLonLat(lonlat);px.x=Math.round(px.x);px.y=Math.round(px.y);return \
px;},getViewPortPxFromLayerPx:function(layerPx){var \
viewPortPx=null;if(layerPx!=null){var \
dX=parseInt(this.layerContainerDiv.style.left);var \
dY=parseInt(this.layerContainerDiv.style.top);viewPortPx=layerPx.add(dX,dY);} +return \
viewPortPx;},getLayerPxFromViewPortPx:function(viewPortPx){var \
layerPx=null;if(viewPortPx!=null){var \
dX=-parseInt(this.layerContainerDiv.style.left);var \
dY=-parseInt(this.layerContainerDiv.style.top);layerPx=viewPortPx.add(dX,dY);if(isNaN(layerPx.x)||isNaN(layerPx.y)){layerPx=null;}}
 +return layerPx;},getLonLatFromLayerPx:function(px){px=this.getViewPortPxFromLayerPx(px);return \
this.getLonLatFromViewPortPx(px);},getLayerPxFromLonLat:function(lonlat){var \
px=this.getPixelFromLonLat(lonlat);return \
this.getLayerPxFromViewPortPx(px);},CLASS_NAME:"OpenLayers.Map"});OpenLayers.Map.TILE_ \
WIDTH%6;OpenLayers.Map.TILE_HEIGHT%6;OpenLayers.Marker=OpenLayers.Class({icon:null,lon \
lat:null,events:null,map:null,initialize:function(lonlat,icon){this.lonlat=lonlat;var \
newIcon=(icon)?icon:OpenLayers.Marker.defaultIcon();if(this.icon==null){this.icon=newI \
con;}else{this.icon.url=newIcon.url;this.icon.size=newIcon.size;this.icon.offset=newIcon.offset;this.icon.calculateOffset=newIcon.calculateOffset;}
 +this.events=new OpenLayers.Events(this,this.icon.imageDiv,null);},destroy:function() \
{this.map=null;this.events.destroy();this.events=null;if(this.icon!=null){this.icon.destroy();this.icon=null;}},draw:function(px){return \
this.icon.draw(px);},moveTo:function(px){if((px!=null)&&(this.icon!=null)){this.icon.moveTo(px);}
 +this.lonlat=this.map.getLonLatFromLayerPx(px);},onScreen:function(){var \
onScreenúlse;if(this.map){var \
screenBounds=this.map.getExtent();onScreen=screenBounds.containsLonLat(this.lonlat);} \
+return onScreen;},inflate:function(inflate){if(this.icon){var newSize=new \
OpenLayers.Size(this.icon.size.w*inflate,this.icon.size.h*inflate);this.icon.setSize(n \
ewSize);}},setOpacity:function(opacity){this.icon.setOpacity(opacity);},setUrl:functio \
n(url){this.icon.setUrl(url);},display:function(display){this.icon.display(display);},CLASS_NAME:"OpenLayers.Marker"});OpenLayers.Marker.defaultIcon=function(){var \
url=OpenLayers.Util.getImagesLocation()+"marker.png";var size=new \
OpenLayers.Size(21,25);var calculateOffset=function(size){return new \
OpenLayers.Pixel(-(size.w/2),-size.h);};return new \
OpenLayers.Icon(url,size,null,calculateOffset);};OpenLayers.Popup.AnchoredBubble=OpenL \
ayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(id,lonlat,size,contentHTML,anchor,closeBox,closeBoxCallback){this.padding=new \
OpenLayers.Bounds(0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE,0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);OpenLayers.Popup.Anchored.prototype.initializ
  e.apply(this,arguments);},draw:function(px){OpenLayers.Popup.Anchored.prototype.draw \
.apply(this,arguments);this.setContentHTML();this.setBackgroundColor();this.setOpacity();return \
this.div;},updateRelativePosition:function(){this.setRicoCorners();},setSize:function( \
size){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.setRicoCo \
rners();},setBackgroundColor:function(color){if(color!=undefined){this.backgroundColor=color;}
 +if(this.div!=null){if(this.contentDiv!=null){this.div.style.background="transparent" \
;OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor);}}},setOpacity \
:function(opacity){OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,opacity);i \
f(this.div!=null){if(this.groupDiv!=null){OpenLayers.Rico.Corner.changeOpacity(this.gr \
oupDiv,this.opacity);}}},setBorder:function(border){this.border=0;},setRicoCorners:function(){var \
corners=this.getCornersToRound(this.relativePosition);var \
options={corners:corners,color:this.backgroundColor,bgColor:"transparent",blend:false} \
;if(!this.rounded){OpenLayers.Rico.Corner.round(this.div,options);this.rounded=true;}e \
lse{OpenLayers.Rico.Corner.reRound(this.groupDiv,options);this.setBackgroundColor();this.setOpacity();}},getCornersToRound:function(){var \
corners=['tl','tr','bl','br'];var \
corner=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);OpenLayers.Util.removeItem(corners,corner);return \
corners.join(" ");},CLASS_NAME:"  \
OpenLayers.Popup.AnchoredBubble"});OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenL \
ayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize \
:null,isAlphaImage:false,positionBlocks:null,blocks:null,fixedRelativePosition:false,i \
nitialize:function(id,lonlat,size,contentHTML,anchor,closeBox,closeBoxCallback){OpenLa \
yers.Popup.Anchored.prototype.initialize.apply(this,arguments);if(this.fixedRelativePo \
sition){this.updateRelativePosition();this.calculateRelativePosition=function(px){return \
this.relativePosition;};} \
+this.contentDiv.style.position="absolute";this.contentDiv.style.zIndex=1;if(closeBox){this.closeDiv.style.zIndex=1;}
 +this.groupDiv.style.position="absolute";this.groupDiv.style.top="0px";this.groupDiv. \
style.left="0px";this.groupDiv.style.height="100%";this.groupDiv.style.width="100%";}, \
destroy:function(){this.imageSrc=null;this.imageSize=null;this.isAlphaImage=null;this.fixedRelativePositionúlse;this.positionBlocks=null;for(var \
i=0;i<this.blocks.length;i++){var \
block=this.blocks[i];if(block.image){block.div.removeChild(block.image);} \
+block.image=null;if(block.div){this.groupDiv.removeChild(block.div);} \
+block.div=null;} +this.blocks=null;OpenLayers.Popup.Anchored.prototype.destroy.apply( \
this,arguments);},setBackgroundColor:function(color){},setBorder:function(){},setOpaci \
ty:function(opacity){},setSize:function(size){OpenLayers.Popup.Anchored.prototype.setS \
ize.apply(this,arguments);this.updateBlocks();},updateRelativePosition:function(){this \
.padding=this.positionBlocks[this.relativePosition].padding;if(this.closeDiv){var \
contentDivPadding=this.getContentDivPadding();this.closeDiv.style.right=contentDivPadding.right+
 +this.padding.right+"px";this.closeDiv.style.top=contentDivPadding.top+
+this.padding.top+"px";}
+this.updateBlocks();},calculateNewPx:function(px){var \
newPx=OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);newPx=newPx.offset(this.positionBlocks[this.relativePosition].offset);return \
newPx;},createBlocks:function(){this.blocks=[];var firstPosition=null;for(var key in \
this.positionBlocks){firstPosition=key;break;} +var \
position=this.positionBlocks[firstPosition];for(var \
i=0;i<position.blocks.length;i++){var block={};this.blocks.push(block);var \
divId=this.id+'_FrameDecorationDiv_'+i;block.div=OpenLayers.Util.createDiv(divId,null,null,null,"absolute",null,"hidden",null);var \
imgId=this.id+'_FrameDecorationImg_'+i;var \
imageCreator=(this.isAlphaImage)?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.c \
reateImage;block.image=imageCreator(imgId,null,this.imageSize,this.imageSrc,"absolute" \
,null,null,null);block.div.appendChild(block.image);this.groupDiv.appendChild(block.div);}},updateBlocks:function(){if(!this.blocks){this.createBlocks();}
 +if(this.relativePosition){var \
position=this.positionBlocks[this.relativePosition];for(var \
i=0;i<position.blocks.length;i++){var positionBlock=position.blocks[i];var \
block=this.blocks[i];var l=positionBlock.anchor.left;var \
b=positionBlock.anchor.bottom;var r=positionBlock.anchor.right;var \
t=positionBlock.anchor.top;var \
w=(isNaN(positionBlock.size.w))?this.size.w-(r+l):positionBlock.size.w;var \
h=(isNaN(positionBlock.size.h))?this.size.h-(b+t):positionBlock.size.h;block.div.style \
.width=w+'px';block.div.style.height=h+'px';block.div.style.left=(l!=null)?l+'px':'';b \
lock.div.style.bottom=(b!=null)?b+'px':'';block.div.style.right=(r!=null)?r+'px':'';bl \
ock.div.style.top=(t!=null)?t+'px':'';block.image.style.left=positionBlock.position.x+'px';block.image.style.top=positionBlock.position.y+'px';}
 +this.contentDiv.style.left=this.padding.left+"px";this.contentDiv.style.top=this.pad \
ding.top+"px";}},CLASS_NAME:"OpenLayers.Popup.Framed"});OpenLayers.Renderer.SVG=OpenLa \
yers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",MAX_PIXEL: \
15000,localResolution:null,initialize:function(containerID){if(!this.supported()){return;}
 +OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);},destroy:fu \
nction(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments);},supported:function(){var \
svgFeature="http://www.w3.org/TR/SVG11/feature#";return(document.implementation&&(docu \
ment.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeatur \
e(svgFeature+"SVG","1.1")||document.implementation.hasFeature(svgFeature+"BasicStructu \
re","1.1")));},inValidRange:function(x,y){return(x>=-this.MAX_PIXEL&&x<=this.MAX_PIXEL \
&&y>=-this.MAX_PIXEL&&y<=this.MAX_PIXEL);},setExtent:function(extent){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var \
resolution=this.getResolution();if(!this.localResolution||resolution!=this.localResolution){this.left=-extent.left/resolution;this.top=extent.top/resolution;}
 +var left=0;var top=0;if(this.localResolution&&resolution==this.localResolution){left=(this.left)-(-extent.left/resolution);top=(this.top)-(extent.top/resolution);}
 +this.localResolution=resolution;var extentString=left+" "+top+" "+
+extent.getWidth()/resolution+" \
"+extent.getHeight()/resolution;this.rendererRoot.setAttributeNS(null,"viewBox",extent \
String);},setSize:function(size){OpenLayers.Renderer.prototype.setSize.apply(this,argu \
ments);this.rendererRoot.setAttributeNS(null,"width",this.size.w);this.rendererRoot.se \
tAttributeNS(null,"height",this.size.h);},getNodeType:function(geometry,style){var \
nodeType=null;switch(geometry.CLASS_NAME){case"OpenLayers.Geometry.Point":nodeType=sty \
le.externalGraphic?"image":"circle";break;case"OpenLayers.Geometry.Rectangle":nodeType \
="rect";break;case"OpenLayers.Geometry.LineString":nodeType="polyline";break;case"Open \
Layers.Geometry.LinearRing":nodeType="polygon";break;case"OpenLayers.Geometry.Polygon" \
:case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":nodeType="path";break;default:break;}
 +return nodeType;},setStyle:function(node,style,options){style=style||node._style;options=options||node._options;var \
r=parseFloat(node.getAttributeNS(null,"r"));if(node._geometryClass=="OpenLayers.Geometry.Point"&&r){if(style.externalGraphic){var \
x=parseFloat(node.getAttributeNS(null,"cx"));var \
y=parseFloat(node.getAttributeNS(null,"cy"));if(style.graphicWidth&&style.graphicHeight){node.setAttributeNS(null,"preserveAspectRatio","none");}
 +var width=style.graphicWidth||style.graphicHeight;var \
height=style.graphicHeight||style.graphicWidth;width=width?width:style.pointRadius*2;height=height?height:style.pointRadius*2;var \
xOffset=(style.graphicXOffset!=undefined)?style.graphicXOffset:-(0.5*width);var \
yOffset=(style.graphicYOffset!=undefined)?style.graphicYOffset:-(0.5*height);var \
opacity=style.graphicOpacity||style.fillOpacity;node.setAttributeNS(null,"x",(x+xOffse \
t).toFixed());node.setAttributeNS(null,"y",(y+yOffset).toFixed());node.setAttributeNS( \
null,"width",width);node.setAttributeNS(null,"height",height);node.setAttributeNS("htt \
p://www.w3.org/1999/xlink","href",style.externalGraphic);node.setAttributeNS(null,"style","opacity: \
"+opacity);}else{node.setAttributeNS(null,"r",style.pointRadius);}} \
+if(options.isFilled){node.setAttributeNS(null,"fill",style.fillColor);node.setAttribu \
teNS(null,"fill-opacity",style.fillOpacity);}else{node.setAttributeNS(null,"fill","none");}
 +if(options.isStroked){node.setAttributeNS(null,"stroke",style.strokeColor);node.setA \
ttributeNS(null,"stroke-opacity",style.strokeOpacity);node.setAttributeNS(null,"stroke \
-width",style.strokeWidth);node.setAttributeNS(null,"stroke-linecap",style.strokeLinecap);}else{node.setAttributeNS(null,"stroke","none");}
 +if(style.pointerEvents){node.setAttributeNS(null,"pointer-events",style.pointerEvents);}
 +if(style.cursor!=null){node.setAttributeNS(null,"cursor",style.cursor);}
+return node;},createNode:function(type,id){var \
node=document.createElementNS(this.xmlns,type);if(id){node.setAttributeNS(null,"id",id);}
 +return node;},nodeTypeCompare:function(node,type){return(type==node.nodeName);},createRenderRoot:function(){return \
this.nodeFactory(this.container.id+"_svgRoot","svg");},createRoot:function(){return \
this.nodeFactory(this.container.id+"_root","g");},drawPoint:function(node,geometry){this.drawCircle(node,geometry,1);},drawCircle:function(node,geometry,radius){var \
resolution=this.getResolution();var x=(geometry.x/resolution+this.left);var \
y=(this.top-geometry.y/resolution);if(this.inValidRange(x,y)){node.setAttributeNS(null \
,"cx",x);node.setAttributeNS(null,"cy",y);node.setAttributeNS(null,"r",radius);}else{n \
ode.setAttributeNS(null,"cx","");node.setAttributeNS(null,"cy","");node.setAttributeNS \
(null,"r",0);}},drawLineString:function(node,geometry){node.setAttributeNS(null,"point \
s",this.getComponentsString(geometry.components));},drawLinearRing:function(node,geome \
try){node.setAttributeNS(null,"points",this.getComponentsString(geometry.components));},drawPolygon:function(node,geome
  try){var d="";var draw=true;for(var j=0;j<geometry.components.length;j++){var \
linearRing=geometry.components[j];d+=" M";for(var \
i=0;i<linearRing.components.length;i++){var \
component=this.getShortString(linearRing.components[i]);if(component){d+=" \
"+component;}else{drawúlse;}}} +d+=" \
z";if(draw){node.setAttributeNS(null,"d",d);node.setAttributeNS(null,"fill-rule","even \
odd");}else{node.setAttributeNS(null,"d","");}},drawRectangle:function(node,geometry){var \
resolution=this.getResolution();var x=(geometry.x/resolution+this.left);var \
y=(this.top-geometry.y/resolution);if(this.inValidRange(x,y)){node.setAttributeNS(null \
,"x",x);node.setAttributeNS(null,"y",y);node.setAttributeNS(null,"width",geometry.widt \
h/resolution);node.setAttributeNS(null,"height",geometry.height/resolution);}else{node \
.setAttributeNS(null,"x","");node.setAttributeNS(null,"y","");node.setAttributeNS(null \
,"width",0);node.setAttributeNS(null,"height",0);}},drawSurface:function(node,geometry){var \
d=null;var draw=true;for(var \
i=0;i<geometry.components.length;i++){if((i%3)==0&&(i/3)==0){var \
component=this.getShortString(geometry.components[i]);if(!component){drawúlse;} +d="M \
"+component;}else if((i%3)==1){var \
component=this.getShortString(geometry.components[i]);if(!component){drawúlse;} +d+=" \
C "+component;}else{var \
component=this.getShortString(geometry.components[i]);if(!component){drawúlse;} +d+=" \
"+component;}} +d+=" \
Z";if(draw){node.setAttributeNS(null,"d",d);}else{node.setAttributeNS(null,"d","");}},getComponentsString:function(components){var \
strings=[];for(var i=0;i<components.length;i++){var \
component=this.getShortString(components[i]);if(component){strings.push(component);}} \
+return strings.join(",");},getShortString:function(point){var \
resolution=this.getResolution();var x=(point.x/resolution+this.left);var \
y=(this.top-point.y/resolution);if(this.inValidRange(x,y)){return \
x+","+y;}else{return \
false;}},CLASS_NAME:"OpenLayers.Renderer.SVG"});OpenLayers.Renderer.VML=OpenLayers.Cla \
ss(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",initialize:function(containerID){if(!this.supported()){return;}
 +if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);var \
style=document.createStyleSheet();style.addRule('olv\\:*',"behavior: \
url(#default#VML); "+"position: absolute; display: inline-block;");} \
+OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);},destroy:fun \
ction(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments);},support \
ed:function(){return!!(document.namespaces);},setExtent:function(extent){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var \
resolution=this.getResolution();var org=extent.left/resolution+" "+ \
+extent.top/resolution;this.root.setAttribute("coordorigin",org);var \
size=extent.getWidth()/resolution+" "+ \
+-extent.getHeight()/resolution;this.root.setAttribute("coordsize",size);},setSize:fun \
ction(size){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);this.rendererR \
oot.style.width=this.size.w;this.rendererRoot.style.height=this.size.h;this.root.style \
.width=this.size.w;this.root.style.height=this.size.h;},getNodeType:function(geometry,style){var \
nodeType=null;switch(geometry.CLASS_NAME){case"OpenLayers.Geometry.Point":nodeType=sty \
le.externalGraphic?"olv:rect":"olv:oval";break;case"OpenLayers.Geometry.Rectangle":nod \
eType="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.L \
inearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":nodeType="olv:shape";break;default:break;}
 +return nodeType;},setStyle:function(node,style,options,geometry){style=style||node._ \
style;options=options||node._options;if(node._geometryClass=="OpenLayers.Geometry.Point"){if(style.externalGraphic){var \
width=style.graphicWidth||style.graphicHeight;var \
height=style.graphicHeight||style.graphicWidth;width=width?width:style.pointRadius*2;height=height?height:style.pointRadius*2;var \
resolution=this.getResolution();var \
xOffset=(style.graphicXOffset!=undefined)?style.graphicXOffset:-(0.5*width);var \
yOffset=(style.graphicYOffset!=undefined)?style.graphicYOffset:-(0.5*height);node.styl \
e.left=((geometry.x/resolution)+xOffset).toFixed();node.style.top=((geometry.y/resolut \
ion)-(yOffset+height)).toFixed();node.style.width=width;node.style.height=height;style \
.fillColor="none";options.isStrokedúlse;}else{this.drawCircle(node,geometry,style.pointRadius);}}
 +if(options.isFilled){node.setAttribute("fillcolor",style.fillColor);}else{node.setAttribute("filled","false");}
 +var fills=node.getElementsByTagName("fill");var \
fill=(fills.length==0)?null:fills[0];if(!options.isFilled){if(fill){node.removeChild(fill);}}else{if(!fill){fill=this.createNode('olv:fill',node.id+"_fill");}
 +fill.setAttribute("opacity",style.fillOpacity);if(node._geometryClass=="OpenLayers.G \
eometry.Point"&&style.externalGraphic){if(style.graphicOpacity){fill.setAttribute("opacity",style.graphicOpacity);}
 +fill.setAttribute("src",style.externalGraphic);fill.setAttribute("type","frame");nod \
e.style.flip="y";if(!(style.graphicWidth&&style.graphicHeight)){fill.aspect="atmost";}}
 +if(fill.parentNode!=node){node.appendChild(fill);}}
+if(options.isStroked){node.setAttribute("strokecolor",style.strokeColor);node.setAttr \
ibute("strokeweight",style.strokeWidth+"px");}else{node.setAttribute("stroked","false");}
 +var strokes=node.getElementsByTagName("stroke");var \
stroke=(strokes.length==0)?null:strokes[0];if(!options.isStroked){if(stroke){node.remo \
veChild(stroke);}}else{if(!stroke){stroke=this.createNode('olv:stroke',node.id+"_stroke");node.appendChild(stroke);}
 +stroke.setAttribute("opacity",style.strokeOpacity);stroke.setAttribute("endcap",!style.strokeLinecap||style.strokeLinecap=='butt'?'flat':style.strokeLinecap);}
 +if(style.cursor!=null){node.style.cursor=style.cursor;}
+return node;},postDraw:function(node){var fillColor=node._style.fillColor;var \
strokeColor=node._style.strokeColor;if(fillColor=="none"&&node.getAttribute("fillcolor")!=fillColor){node.setAttribute("fillcolor",fillColor);}
 +if(strokeColor=="none"&&node.getAttribute("strokecolor")!=strokeColor){node.setAttribute("strokecolor",strokeColor);}},setNodeDimension:function(node,geometry){var \
bbox=geometry.getBounds();if(bbox){var resolution=this.getResolution();var \
scaledBox=new OpenLayers.Bounds((bbox.left/resolution).toFixed(),(bbox.bottom/resoluti \
on).toFixed(),(bbox.right/resolution).toFixed(),(bbox.top/resolution).toFixed());node. \
style.left=scaledBox.left;node.style.top=scaledBox.top;node.style.width=scaledBox.getWidth();node.style.height=scaledBox.getHeight();node.coordorigin=scaledBox.left+" \
"+scaledBox.top;node.coordsize=scaledBox.getWidth()+" \
"+scaledBox.getHeight();}},createNode:function(type,id){var \
node=document.createElement(type);if(id){node.setAttribute('id',id);} \
+node.setAttribute('unselectable','on',0);node.onselectstart=function(){return(false);};return \
node;},nodeTypeCompare:function(node,type){var subType=type;var \
splitIndex=subType.indexOf(":");if(splitIndex!=-1){subType=subType.substr(splitIndex+1);}
 +var nodeName=node.nodeName;splitIndex=nodeName.indexOf(":");if(splitIndex!=-1){nodeName=nodeName.substr(splitIndex+1);}
 +return(subType==nodeName);},createRenderRoot:function(){return \
this.nodeFactory(this.container.id+"_vmlRoot","div");},createRoot:function(){return \
this.nodeFactory(this.container.id+"_root","olv:group");},drawPoint:function(node,geom \
etry){this.drawCircle(node,geometry,1);},drawCircle:function(node,geometry,radius){if(!isNaN(geometry.x)&&!isNaN(geometry.y)){var \
resolution=this.getResolution();node.style.left=(geometry.x/resolution).toFixed()-radius;node.style.top=(geometry.y/resolution).toFixed()-radius;var \
diameter=radius*2;node.style.width=diameter;node.style.height=diameter;}},drawLineStri \
ng:function(node,geometry){this.drawLine(node,geometry,false);},drawLinearRing:functio \
n(node,geometry){this.drawLine(node,geometry,true);},drawLine:function(node,geometry,closeLine){this.setNodeDimension(node,geometry);var \
resolution=this.getResolution();var numComponents=geometry.components.length;var \
parts=new Array(numComponents);var comp,x,y;for(var \
i=0;i<numComponents;i++){comp=geome  \
try.components[i];x=(comp.x/resolution);y=(comp.y/resolution);parts[i]=" \
"+x.toFixed()+","+y.toFixed()+" l ";} +var end=(closeLine)?" x e":" \
e";node.path="m"+parts.join("")+end;},drawPolygon:function(node,geometry){this.setNodeDimension(node,geometry);var \
resolution=this.getResolution();var path=[];var linearRing,i,comp,x,y;for(var \
j=0;j<geometry.components.length;j++){linearRing=geometry.components[j];path.push("m") \
;for(i=0;i<linearRing.components.length;i++){comp=linearRing.components[i];x=comp.x/resolution;y=comp.y/resolution;path.push(" \
"+x.toFixed()+","+y.toFixed());if(i==0){path.push(" l");}} +path.push(" x ");}
+path.push("e");node.path=path.join("");},drawRectangle:function(node,geometry){var \
resolution=this.getResolution();node.style.left=geometry.x/resolution;node.style.top=g \
eometry.y/resolution;node.style.width=geometry.width/resolution;node.style.height=geom \
etry.height/resolution;},drawSurface:function(node,geometry){this.setNodeDimension(node,geometry);var \
resolution=this.getResolution();var path=[];var comp,x,y;for(var \
i=0;i<geometry.components.length;i++){comp=geometry.components[i];x=comp.x/resolution;y=comp.y/resolution;if((i%3)==0&&(i/3)==0){path.push("m");}else \
if((i%3)==1){path.push(" c");} +path.push(" "+x+","+y);}
+path.push(" x e");node.path=path.join("");},CLASS_NAME:"OpenLayers.Renderer.VML"});Op \
enLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null, \
layerAlphaHack:null,initialize:function(layer,position,bounds,url,size){OpenLayers.Til \
e.prototype.initialize.apply(this,arguments);this.url=url;this.frame=document.createEl \
ement('div');this.frame.style.overflow='hidden';this.frame.style.position='absolute';t \
his.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack();},destroy:function(){ \
if(this.imgDiv!=null){if(this.layerAlphaHack){OpenLayers.Event.stopObservingElement(th \
is.imgDiv.childNodes[0].id);}else{OpenLayers.Event.stopObservingElement(this.imgDiv.id);}
 +if(this.imgDiv.parentNode==this.frame){this.frame.removeChild(this.imgDiv);this.imgDiv.map=null;}}
 +this.imgDiv=null;if((this.frame!=null)&&(this.frame.parentNode==this.layer.div)){this.layer.div.removeChild(this.frame);}
 +this.frame=null;OpenLayers.Tile.prototype.destroy.apply(this,arguments);},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size);} \
+obj=OpenLayers.Tile.prototype.clone.apply(this,[obj]);obj.imgDiv=null;return \
obj;},draw:function(){if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){this.bounds=this.getBoundsFromBaseLayer(this.position);}
 +if(!OpenLayers.Tile.prototype.draw.apply(this,arguments)){return false;}
+if(this.isLoading){this.events.triggerEvent("reload");}else{this.isLoading=true;this.events.triggerEvent("loadstart");}
 +return this.renderTile();},renderTile:function(){if(this.imgDiv==null){this.initImgDiv();}
 +this.imgDiv.viewRequestID=this.layer.map.viewRequestID;this.url=this.layer.getURL(th \
is.bounds);OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);var \
imageSize=this.layer.getImageSize();if(this.layerAlphaHack){OpenLayers.Util.modifyAlph \
aImageDiv(this.imgDiv,null,null,imageSize,this.url);}else{OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,imageSize);this.imgDiv.src=this.url;}
 +return true;},clear:function(){if(this.imgDiv){this.hide();if(OpenLayers.Tile.Image. \
useBlankTile){this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif";}}},initImgDiv:function(){var \
offset=this.layer.imageOffset;var \
size=this.layer.getImageSize();if(this.layerAlphaHack){this.imgDiv=OpenLayers.Util.cre \
ateAlphaImageDiv(null,offset,size,null,"relative",null,null,null,true);}else{this.imgD \
iv=OpenLayers.Util.createImage(null,offset,size,null,"relative",null,null,true);} \
+this.imgDiv.className='olTileImage';this.frame.style.zIndex=this.isBackBuffer?0:1;thi \
s.frame.appendChild(this.imgDiv);this.layer.div.appendChild(this.frame);if(this.layer. \
opacity!=null){OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity);}
 +this.imgDiv.map=this.layer.map;var \
onload=function(){if(this.isLoading){this.isLoadingúlse;this.events.triggerEvent("load \
end");}};if(this.layerAlphaHack){OpenLayers.Event.observe(this.imgDiv.childNodes[0],'l \
oad',OpenLayers.Function.bind(onload,this));}else{OpenLayers.Event.observe(this.imgDiv,'load',OpenLayers.Function.bind(onload,this));}
 +var onerror=function(){if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){on \
load.call(this);}};OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(onerror,this));},checkImgURL:function(){if(this.layer){var \
loaded=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;if(!OpenLayers.U \
til.isEquivalentUrl(loaded,this.url)){this.hide();}}},startTransition:function(){if(!this.backBufferTile||!this.backBufferTile.imgDiv){return;}
 +var ratio=1;if(this.backBufferTile.resolution){ratio=this.backBufferTile.resolution/this.layer.getResolution();}
 +if(ratio!=this.lastRatio){if(this.layer.transitionEffect=='resize'){var \
upperLeft=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);var \
size=new OpenLayers.Size(this.backBufferTile.size.w*ratio,this.backBufferTile.size.h*ratio);var \
px=this.layer.map.getLayerPxFromLonLat(upperLeft);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,px,size);var \
imageSize=this.backBufferTile.imageSize;imageSize=new \
OpenLayers.Size(imageSize.w*ratio,imageSize.h*ratio);var \
imageOffset=this.backBufferTile.imageOffset;if(imageOffset){imageOffset=new \
OpenLayers.Pixel(imageOffset.x*ratio,imageOffset.y*ratio);} \
+OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,imageOffset,imageSiz \
e);this.backBufferTile.show();}}else{if(this.layer.singleTile){this.backBufferTile.show();}else{this.backBufferTile.hide();}}
 +this.lastRatio=ratio;},show:function(){this.frame.style.display='';if(OpenLayers.Uti \
l.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(naviga \
tor.userAgent.toLowerCase().indexOf("gecko")!=-1){this.frame.scrollLeft=this.frame.scr \
ollLeft;}}},hide:function(){this.frame.style.display='none';},CLASS_NAME:"OpenLayers.T \
ile.Image"});OpenLayers.Tile.Image.useBlankTile=(OpenLayers.Util.getBrowserName()=="sa \
fari"||OpenLayers.Util.getBrowserName()=="opera");OpenLayers.Tile.WFS=OpenLayers.Class \
(OpenLayers.Tile,{features:null,url:null,request:null,initialize:function(layer,positi \
on,bounds,url,size){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.ur \
l=url;this.features=[];},destroy:function(){OpenLayers.Tile.prototype.destroy.apply(th \
is,arguments);this.destroyAllFeatures();this.features=null;this.url=null;if(this.reque \
st){this.request.abort();this.request=null;}},clear:function(){this.destroyAllFeatures();},draw:function(){if(OpenLayers.Tile.proto
  type.draw.apply(this,arguments)){if(this.isLoading){this.events.triggerEvent("reload");}else{this.isLoading=true;this.events.triggerEvent("loadstart");}
 +this.loadFeaturesForRegion(this.requestSuccess);}},loadFeaturesForRegion:function(success,failure){if(this.request){this.request.abort();}
 +this.request=OpenLayers.loadURL(this.url,null,this,success);},requestSuccess:function(request){if(this.features){var \
doc=request.responseXML;if(!doc||!doc.documentElement){doc=OpenLayers.Format.XML.prototype.read(request.responseText);}
 +if(this.layer.vectorMode){this.layer.addFeatures(this.layer.formatObject.read(doc));}else{var \
resultFeatures=OpenLayers.Ajax.getElementsByTagNameNS(doc,"http://www.opengis.net/gml","gml","featureMember");this.addResults(resultFeatures);}}
 +if(this.events){this.events.triggerEvent("loadend");}
+this.request=null;},addResults:function(results){for(var \
i=0;i<results.length;i++){var feature=new \
this.layer.featureClass(this.layer,results[i]);this.features.push(feature);}},destroyAllFeatures:function(){while(this.features.length>0){var \
feature=this.features.shift();feature.destroy();}},CLASS_NAME:"OpenLayers.Tile.WFS"}); \
OpenLayers.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:new \
OpenLayers.Size(180,90),layers:null,minRectSize:15,minRectDisplayClass:"RectReplacemen \
t",minRatio:8,maxRatio:32,mapOptions:null,handlers:null,initialize:function(options){t \
his.layers=[];this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,[options]);},destroy:function(){if(!this.mapDiv){return;}
 +this.handlers.click.destroy();this.mapDiv.removeChild(this.extentRectangle);this.ext \
entRectangle=null;this.rectEvents.destroy();this.rectEvents=null;this.ovmap.destroy(); \
this.ovmap=null;this.element.removeChild(this.mapDiv);this.mapDiv=null;this.div.remove \
Child(this.element);this.element=null;if(this.maximizeDiv){OpenLayers.Event.stopObserv \
ingElement(this.maximizeDiv);this.div.removeChild(this.maximizeDiv);this.maximizeDiv=null;}
 +if(this.minimizeDiv){OpenLayers.Event.stopObservingElement(this.minimizeDiv);this.div.removeChild(this.minimizeDiv);this.minimizeDiv=null;}
 +this.map.events.un({"moveend":this.update,"changebaselayer":this.baseLayerDraw,scope \
:this});OpenLayers.Control.prototype.destroy.apply(this,arguments);},draw:function(){O \
penLayers.Control.prototype.draw.apply(this,arguments);if(!(this.layers.length>0)){if(this.map.baseLayer){var \
layer=this.map.baseLayer.clone();this.layers=[layer];}else{this.map.events.register("changebaselayer",this,this.baseLayerDraw);return \
this.div;}} +this.element=document.createElement('div');this.element.className=this.di \
splayClass+'Element';this.element.style.display='none';this.mapDiv=document.createElem \
ent('div');this.mapDiv.style.width=this.size.w+'px';this.mapDiv.style.height=this.size \
.h+'px';this.mapDiv.style.position='relative';this.mapDiv.style.overflow='hidden';this \
.mapDiv.id=OpenLayers.Util.createUniqueID('overviewMap');this.extentRectangle=document \
.createElement('div');this.extentRectangle.style.position='absolute';this.extentRectan \
gle.style.zIndex00;this.extentRectangle.className=this.displayClass+'ExtentRectangle' \
;this.mapDiv.appendChild(this.extentRectangle);this.element.appendChild(this.mapDiv);t \
his.div.appendChild(this.element);if(!this.outsideViewport){this.div.className+=" \
"+this.displayClass+'Container';var \
imgLocation=OpenLayers.Util.getImagesLocation();var \
img=imgLocation+'layer-switcher-maximize.png';this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+'MaximizeButton',null,new
  OpenLayers.Size(18,18),img,'absolute');this.maximizeDiv.style.display='none';this.ma \
ximizeDiv.className=this.displayClass+'MaximizeButton';OpenLayers.Event.observe(this.m \
aximizeDiv,'click',OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var \
img=imgLocation+'layer-switcher-minimize.png';this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv('OpenLayers_Control_minimizeDiv',null,new \
OpenLayers.Size(18,18),img,'absolute');this.minimizeDiv.style.display='none';this.mini \
mizeDiv.className=this.displayClass+'MinimizeButton';OpenLayers.Event.observe(this.min \
imizeDiv,'click',OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv);var \
eventsToStop=['dblclick','mousedown'];for(var \
i=0;i<eventsToStop.length;i++){OpenLayers.Event.observe(this.maximizeDiv,eventsToStop[ \
i],OpenLayers.Event.stop);OpenLayers.Event.observe(this.minimizeDiv,eventsToStop[i],OpenLayers.Event.stop);}
 +this.minimizeControl();}else{this.element.style.display='';}
+if(this.map.getExtent()){this.update();}
+this.map.events.register('moveend',this,this.update);return \
this.div;},baseLayerDraw:function(){this.draw();this.map.events.unregister("changebaselayer",this,this.baseLayerDraw);},rectDrag:function(px){var \
deltaX=this.handlers.drag.last.x-px.x;var \
deltaY=this.handlers.drag.last.y-px.y;if(deltaX!=0||deltaY!=0){var \
rectTop=this.rectPxBounds.top;var rectLeft=this.rectPxBounds.left;var \
rectHeight=Math.abs(this.rectPxBounds.getHeight());var \
rectWidth=this.rectPxBounds.getWidth();var \
newTop=Math.max(0,(rectTop-deltaY));newTop=Math.min(newTop,this.ovmap.size.h-this.hComp-rectHeight);var \
newLeft=Math.max(0,(rectLeft-deltaX));newLeft=Math.min(newLeft,this.ovmap.size.w-this.wComp-rectWidth);this.setRectPxBounds(new \
OpenLayers.Bounds(newLeft,newTop+rectHeight,newLeft+rectWidth,newTop));}},mapDivClick:function(evt){var \
pxCenter=this.rectPxBounds.getCenterPixel();var deltaX=evt.xy.x-pxCenter.x;var \
deltaY=evt.xy.y-pxCenter.y;var top=this.rectPxBounds.top;var \
left=this.rectPxBounds.left;va  r height=Math.abs(this.rectPxBounds.getHeight());var \
width=this.rectPxBounds.getWidth();var \
newTop=Math.max(0,(top+deltaY));newTop=Math.min(newTop,this.ovmap.size.h-height);var \
newLeft=Math.max(0,(left+deltaX));newLeft=Math.min(newLeft,this.ovmap.size.w-width);this.setRectPxBounds(new \
OpenLayers.Bounds(newLeft,newTop+height,newLeft+width,newTop));this.updateMapToRect(); \
},maximizeControl:function(e){this.element.style.display='';this.showToggle(false);if( \
e!=null){OpenLayers.Event.stop(e);}},minimizeControl:function(e){this.element.style.di \
splay='none';this.showToggle(true);if(e!=null){OpenLayers.Event.stop(e);}},showToggle: \
function(minimize){this.maximizeDiv.style.display=minimize?'':'none';this.minimizeDiv. \
style.display=minimize?'none':'';},update:function(){if(this.ovmap==null){this.createMap();}
 +if(!this.isSuitableOverview()){this.updateOverview();}
+this.updateRectToMap();},isSuitableOverview:function(){var \
mapExtent=this.map.getExtent();var maxExtent=this.map.maxExtent;var testExtent=new \
OpenLayers.Bounds(Math.max(mapExtent.left,maxExtent.left),Math.max(mapExtent.bottom,ma \
xExtent.bottom),Math.min(mapExtent.right,maxExtent.right),Math.min(mapExtent.top,maxExtent.top));var \
resRatio=this.ovmap.getResolution()/this.map.getResolution();return((resRatio>this.min \
Ratio)&&(resRatio<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(testExtent)));},updateOverview:function(){var \
mapRes=this.map.getResolution();var targetRes=this.ovmap.getResolution();var \
resRatio=targetRes/mapRes;if(resRatio>this.maxRatio){targetRes=this.minRatio*mapRes;}else \
if(resRatio<=this.minRatio){targetRes=this.maxRatio*mapRes;} \
+this.ovmap.setCenter(this.map.center,this.ovmap.getZoomForResolution(targetRes));this.updateRectToMap();},createMap:function(){var \
options=OpenLayers.Util.extend({controls:[],maxResolution:'auto',fallThrough:false},this.mapOptions);this.ovmap=new \
OpenLayers.Map(this.mapDiv,options);OpenLayers.Event.stopObserving(window,'unload',thi \
s.ovmap.unloadDestroy);this.ovmap.addLayers(this.layers);this.ovmap.zoomToMaxExtent(); \
this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,'border-left-width'))+
 +parseInt(OpenLayers.Element.getStyle(this.extentRectangle,'border-right-width'));thi \
s.wComp=(this.wComp)?this.wComp:2;this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,'border-top-width'))+
 +parseInt(OpenLayers.Element.getStyle(this.extentRectangle,'border-bottom-width'));this.hComp=(this.hComp)?this.hComp:2;this.handlers.drag=new \
OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap});this.handlers.click=new \
OpenLayers.Handler.Click(this,{"click":this.mapDivClick},{"single":true,"double":false \
,"stopSingle":true,"stopDouble":true,"pixelTolerance":1,map:this.ovmap});this.handlers.click.activate();this.rectEvents=new \
OpenLayers.Events(this,this.extentRectangle,null,true);this.rectEvents.register("mouse \
over",this,function(e){if(!this.handlers.drag.active&&!this.map.dragging){this.handler \
s.drag.activate();}});this.rectEvents.register("mouseout",this,function(e){if(!this.ha \
ndlers.drag.dragging){this.handlers.drag.deactivate();}});},updateRectToMap:function() \
{if(this.map.units!='degrees'){if(this.ovmap.getProjection()&&(this.map.getProjection()!=this.ovmap.getProjection())){alert(OpenLayers.i18n("sameProjection"));}}
 +var pxBounds=this.getRectBoundsFromMapBounds(this.map.getExtent());if(pxBounds){this.setRectPxBounds(pxBounds);}},updateMapToRect:function(){var \
lonLatBounds=this.getMapBoundsFromRectBounds(this.rectPxBounds);this.map.panTo(lonLatBounds.getCenterLonLat());},setRectPxBounds:function(pxBounds){var \
top=Math.max(pxBounds.top,0);var left=Math.max(pxBounds.left,0);var \
bottom=Math.min(pxBounds.top+Math.abs(pxBounds.getHeight()),this.ovmap.size.h-this.hComp);var \
right=Math.min(pxBounds.left+pxBounds.getWidth(),this.ovmap.size.w-this.wComp);var \
width=Math.max(right-left,0);var \
height=Math.max(bottom-top,0);if(width<this.minRectSize||height<this.minRectSize){this.extentRectangle.className=this.displayClass+
 +this.minRectDisplayClass;var rLeft=left+(width/2)-(this.minRectSize/2);var \
rTop=top+(height/2)-(this.minRectSize/2);this.extentRectangle.style.top=Math.round(rTo \
p)+'px';this.extentRectangle.style.left=Math.round(rLeft)+'px';this.extentRectangle.st \
yle.height=this.minRectSize+'px';this.extentRectangle.style.width=this.minRectSize+'px \
';}else{this.extentRectangle.className=this.displayClass+'ExtentRectangle';this.extent \
Rectangle.style.top=Math.round(top)+'px';this.extentRectangle.style.left=Math.round(le \
ft)+'px';this.extentRectangle.style.height=Math.round(height)+'px';this.extentRectangle.style.width=Math.round(width)+'px';}
 +this.rectPxBounds=new \
OpenLayers.Bounds(Math.round(left),Math.round(bottom),Math.round(right),Math.round(top));},getRectBoundsFromMapBounds:function(lonLatBounds){var \
leftBottomLonLat=new OpenLayers.LonLat(lonLatBounds.left,lonLatBounds.bottom);var \
rightTopLonLat=new OpenLayers.LonLat(lonLatBounds.right,lonLatBounds.top);var \
leftBottomPx=this.getOverviewPxFromLonLat(leftBottomLonLat);var \
rightTopPx=this.getOverviewPxFromLonLat(rightTopLonLat);var \
bounds=null;if(leftBottomPx&&rightTopPx){bounds=new \
OpenLayers.Bounds(leftBottomPx.x,leftBottomPx.y,rightTopPx.x,rightTopPx.y);} +return \
bounds;},getMapBoundsFromRectBounds:function(pxBounds){var leftBottomPx=new \
OpenLayers.Pixel(pxBounds.left,pxBounds.bottom);var rightTopPx=new \
OpenLayers.Pixel(pxBounds.right,pxBounds.top);var \
leftBottomLonLat=this.getLonLatFromOverviewPx(leftBottomPx);var \
rightTopLonLat=this.getLonLatFromOverviewPx(rightTopPx);return new \
OpenLayers.Bounds(leftBottomLonLat.lon,leftBottomLonLat.lat,rightTopLonLat.lon,rightTopLonLat.lat);},getLonLatFromOverviewPx:function(overviewMapPx){var \
size=this.ovmap.size;var res=this.ovmap.getResolution();var \
center=this.ovmap.getExtent().getCenterLonLat();var \
delta_x=overviewMapPx.x-(size.w/2);var delta_y=overviewMapPx.y-(size.h/2);return new \
OpenLayers.LonLat(center.lon+delta_x*res,center.lat-delta_y*res);},getOverviewPxFromLonLat:function(lonlat){var \
res=this.ovmap.getResolution();var extent=this.ovmap.getExtent();var \
px=null;if(extent){px=new \
OpenLayers.Pixel(Math.round(1/res*(lonlat.lon-extent.left)),Math.round(1/res*(extent.top-lonlat.lat))
  );}
+return px;},CLASS_NAME:'OpenLayers.Control.OverviewMap'});OpenLayers.Feature=OpenLaye \
rs.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:OpenLayers.P \
opup.AnchoredBubble,popup:null,initialize:function(layer,lonlat,data){this.layer=layer \
;this.lonlat=lonlat;this.data=(data!=null)?data:{};this.id=OpenLayers.Util.createUniqu \
eID(this.CLASS_NAME+"_");},destroy:function(){if((this.layer!=null)&&(this.layer.map!=null)){if(this.popup!=null){this.layer.map.removePopup(this.popup);}}
 +this.layer=null;this.id=null;this.lonlat=null;this.data=null;if(this.marker!=null){this.destroyMarker(this.marker);this.marker=null;}
 +if(this.popup!=null){this.destroyPopup(this.popup);this.popup=null;}},onScreen:function(){var \
onScreenúlse;if((this.layer!=null)&&(this.layer.map!=null)){var \
screenBounds=this.layer.map.getExtent();onScreen=screenBounds.containsLonLat(this.lonlat);}
 +return onScreen;},createMarker:function(){if(this.lonlat!=null){this.marker=new \
OpenLayers.Marker(this.lonlat,this.data.icon);} +return \
this.marker;},destroyMarker:function(){this.marker.destroy();},createPopup:function(closeBox){if(this.lonlat!=null){var \
id=this.id+"_popup";var \
anchor=(this.marker)?this.marker.icon:null;if(!this.popup){this.popup=new \
this.popupClass(id,this.lonlat,this.data.popupSize,this.data.popupContentHTML,anchor,closeBox);}
 +if(this.data.overflow!=null){this.popup.contentDiv.style.overflow=this.data.overflow;}
 +this.popup.feature=this;}
+return this.popup;},destroyPopup:function(){if(this.popup){this.popup.feature=null;th \
is.popup.destroy();this.popup=null;}},CLASS_NAME:"OpenLayers.Feature"});OpenLayers.For \
mat.WMC=OpenLayers.Class({defaultVersion:"1.1.0",version:null,layerOptions:null,parser \
:null,initialize:function(options){OpenLayers.Util.extend(this,options);this.options=options;},read:function(data,options){if(typeof \
data=="string"){data=OpenLayers.Format.XML.prototype.read.apply(this,[data]);} +var \
rootÚta.documentElement;var \
version=this.version;if(!version){version=root.getAttribute("version");if(!version){version=this.defaultVersion;}}
 +if(!this.parser||this.parser.VERSION!=version){var \
format=OpenLayers.Format.WMC["v"+version.replace(/\./g,"_")];if(!format){throw"Can't \
find a WMC parser for version "+ +version;}
+this.parser=new format(this.options);}
+var context=this.parser.read(data,options);var \
map;if(options.map){this.context=context;if(options.map instanceof \
OpenLayers.Map){map=this.mergeContextToMap(context,options.map);}else{map=this.contextToMap(context,options.map);}}else{map=context;}
 +return map;},contextToMap:function(context,id){var map=new \
OpenLayers.Map(id,{maxExtent:context.maxExtent,projection:context.projection});map.add \
Layers(context.layers);map.setCenter(context.bounds.getCenterLonLat(),map.getZoomForExtent(context.bounds,true));return \
map;},mergeContextToMap:function(context,map){map.addLayers(context.layers);return \
map;},write:function(obj,options){if(obj.CLASS_NAME=="OpenLayers.Map"){obj=this.mapToContext(obj);}
 +var version=(options&&options.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=version){var \
format=OpenLayers.Format.WMC["v"+version.replace(/\./g,"_")];if(!format){throw"Can't \
find a WMS capabilities parser for version "+ +version;}
+this.parser=new format(this.options);}
+var wmc=this.parser.write(obj,options);return wmc;},mapToContext:function(map){var \
context={bounds:map.getExtent(),maxExtent:map.maxExtent,projection:map.projection,layers:map.layers,size:map.getSize()};return \
context;},CLASS_NAME:"OpenLayers.Format.WMC"});OpenLayers.Format.WMC.v1=OpenLayers.Cla \
ss(OpenLayers.Format.XML,{namespaces:{ol:"http://openlayers.org/context",wmc:"http://w \
ww.opengis.net/context",sld:"http://www.opengis.net/sld",xlink:"http://www.w3.org/1999 \
/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"",getNamespacePrefix:function(uri){var \
prefix=null;if(uri==null){prefix=this.namespaces[this.defaultPrefix];}else{for(prefix \
in this.namespaces){if(this.namespaces[prefix]==uri){break;}}} +return \
prefix;},defaultPrefix:"wmc",rootPrefix:null,defaultStyleName:"",defaultStyleTitle:"De \
fault",initialize:function(options){OpenLayers.Format.XML.prototype.initialize.apply(this,[options]);},read:function(data){if(typeof \
data=="string"){data=OpenLayers.Format.XML.prototype.read.apply(this,[data]);} +var \
rootÚta.documentElement;this.rootPrefix=root.prefix;var \
context={version:root.getAttribute("version")};this.runChildNodes(context,root);return \
context;},runChildNodes:function(obj,node){var children=node.childNodes;var \
childNode,processor,prefix,local;for(var \
i=0;i<children.length;++i){childNode=children[i];if(childNode.nodeType==1){prefix=this \
.getNamespacePrefix(childNode.namespaceURI);local=childNode.nodeName.split(":").pop(); \
processor=this["read_"+prefix+"_"+local];if(processor){processor.apply(this,[obj,child \
Node]);}}}},read_wmc_General:function(context,node){this.runChildNodes(context,node);} \
,read_wmc_BoundingBox:function(context,node){context.projection=node.getAttribute("SRS");context.bounds=new \
OpenLayers.Bounds(parseFloat(node.getAttribute("minx")),parseFloat(node.getAttribute(" \
miny")),parseFloat(node.getAttribute("maxx")),parseFloat(node.getAttribute("maxy")));} \
,read_wmc_LayerList:function(context,node){context.layers=[];this.runChildNodes(context,node);},rea
  d_wmc_Layer:function(context,node){var \
layerInfo={params:{},options:{visibility:(node.getAttribute("hidden")!="1")},queryable \
:(node.getAttribute("queryable")=="1"),formats:[],styles:[]};this.runChildNodes(layerI \
nfo,node);layerInfo.params.layers=layerInfo.name;layerInfo.options.maxExtent=layerInfo.maxExtent;var \
layer=this.getLayerFromInfo(layerInfo);context.layers.push(layer);},getLayerFromInfo:function(layerInfo){var \
options=layerInfo.options;if(this.layerOptions){OpenLayers.Util.applyDefaults(options,this.layerOptions);}
 +var layer=new OpenLayers.Layer.WMS(layerInfo.title,layerInfo.href,layerInfo.params,options);return \
layer;},read_wmc_Extension:function(obj,node){this.runChildNodes(obj,node);},read_ol_u \
nits:function(layerInfo,node){layerInfo.options.units=this.getChildValue(node);},read_ol_maxExtent:function(obj,node){var \
bounds=new OpenLayers.Bounds(node.getAttribute("minx"),node.getAttribute("miny"),node. \
getAttribute("maxx"),node.getAttribute("maxy"));obj.maxExtent=bounds;},read_ol_transpa \
rent:function(layerInfo,node){layerInfo.params.transparent=this.getChildValue(node);}, \
read_ol_numZoomLevels:function(layerInfo,node){layerInfo.options.numZoomLevels=parseIn \
t(this.getChildValue(node));},read_ol_opacity:function(layerInfo,node){layerInfo.optio \
ns.opacity=parseFloat(this.getChildValue(node));},read_ol_singleTile:function(layerInf \
o,node){layerInfo.options.singleTile=(this.getChildValue(node)=="true");},read_ol_isBaseLayer:function(layerInfo,node){layerInfo.options.isBaseLayer=(this.getChildVal
  ue(node)=="true");},read_ol_displayInLayerSwitcher:function(layerInfo,node){layerInf \
o.options.displayInLayerSwitcher=(this.getChildValue(node)=="true");},read_wmc_Server: \
function(layerInfo,node){layerInfo.params.version=node.getAttribute("version");this.ru \
nChildNodes(layerInfo,node);},read_wmc_FormatList:function(layerInfo,node){this.runChildNodes(layerInfo,node);},read_wmc_Format:function(layerInfo,node){var \
format=this.getChildValue(node);layerInfo.formats.push(format);if(node.getAttribute("c \
urrent")=="1"){layerInfo.params.format=format;}},read_wmc_StyleList:function(layerInfo \
,node){this.runChildNodes(layerInfo,node);},read_wmc_Style:function(layerInfo,node){var \
style={};this.runChildNodes(style,node);if(node.getAttribute("current")=="1"){if(style.href){layerInfo.params.sld=style.href;}else \
if(style.body){layerInfo.params.sld_body=style.body;}else{layerInfo.params.styles=style.name;}}
 +layerInfo.styles.push(style);},read_wmc_SLD:function(style,node){this.runChildNodes(style,node);},read_sld_StyledLayerDescriptor:function(sld,node){var \
xml=OpenLayers.Format.XML.prototype.write.apply(this,[node]);sld.body=xml;},read_wmc_O \
nlineResource:function(obj,node){obj.href=this.getAttributeNS(node,this.namespaces.xlink,"href");},read_wmc_Name:function(obj,node){var \
name=this.getChildValue(node);if(name){obj.name=name;}},read_wmc_Title:function(obj,node){var \
title=this.getChildValue(node);if(title){obj.title=title;}},read_wmc_Abstract:function(obj,node){var \
abst=this.getChildValue(node);if(abst){obj["abstract"]«st;}},read_wmc_LatLonBoundingBo \
x:function(layer,node){layer.llbbox=[parseFloat(node.getAttribute("minx")),parseFloat( \
node.getAttribute("miny")),parseFloat(node.getAttribute("maxx")),parseFloat(node.getAttribute("maxy"))];},read_wmc_LegendURL:function(style,node){var \
legend={width:node.getAttribute('width'),height:node.getAttribute('height')};var \
links=node.getE  lementsByTagName("OnlineResource");if(links.length>0){this.read_wmc_OnlineResource(legend,links[0]);}
 +style.legend=legend;},write:function(context,options){var \
root=this.createElementDefaultNS("ViewContext");this.setAttributes(root,{version:this.VERSION,id:(options&&typeof \
options.id=="string")?options.id:OpenLayers.Util.createUniqueID("OpenLayers_Context_") \
});this.setAttributeNS(root,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocati \
on);root.appendChild(this.write_wmc_General(context));root.appendChild(this.write_wmc_LayerList(context));return \
OpenLayers.Format.XML.prototype.write.apply(this,[root]);},createElementDefaultNS:function(name,childValue,attributes){var \
node=this.createElementNS(this.namespaces[this.defaultPrefix],name);if(childValue){node.appendChild(this.createTextNode(childValue));}
 +if(attributes){this.setAttributes(node,attributes);}
+return node;},setAttributes:function(node,obj){var value;for(var name in \
obj){value=obj[name].toString();if(value.match(/[A-Z]/)){this.setAttributeNS(node,null \
,name,value);}else{node.setAttribute(name,value);}}},write_wmc_General:function(context){var \
node=this.createElementDefaultNS("General");if(context.size){node.appendChild(this.cre \
ateElementDefaultNS("Window",null,{width:context.size.w,height:context.size.h}));} \
+var bounds=context.bounds;node.appendChild(this.createElementDefaultNS("BoundingBox", \
null,{minx:bounds.left.toPrecision(10),miny:bounds.bottom.toPrecision(10),maxx:bounds. \
right.toPrecision(10),maxy:bounds.top.toPrecision(10),SRS:context.projection}));node.a \
ppendChild(this.createElementDefaultNS("Title",context.title));node.appendChild(this.write_ol_MapExtension(context));return \
node;},write_ol_MapExtension:function(context){var \
node=this.createElementDefaultNS("Extension");var \
bounds=context.maxExtent;if(bounds){var \
maxExtent=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(m \
axExtent,{minx:bounds.left.toPrecision(10),miny:bounds.bottom.toPrecision(10),maxx:bou \
nds.right.toPrecision(10),maxy:bounds.top.toPrecision(10)});node.appendChild(maxExtent);}
 +return node;},write_wmc_LayerList:function(context){var \
list=this.createElementDefaultNS("LayerList");var layer;for(var \
i=0;i<context.layers.length;++i){layer=context.layers[i];if(layer instanceof \
OpenLayers.Layer.WMS){list.appendChild(this.write_wmc_Layer(layer));}} +return \
list;},write_wmc_Layer:function(layer){var \
node=this.createElementDefaultNS("Layer",null,{queryable:"1",hidden:layer.visibility?" \
0":"1"});node.appendChild(this.write_wmc_Server(layer));node.appendChild(this.createEl \
ementDefaultNS("Name",layer.params["LAYERS"]));node.appendChild(this.createElementDefa \
ultNS("Title",layer.name));node.appendChild(this.write_wmc_FormatList(layer));node.app \
endChild(this.write_wmc_StyleList(layer));node.appendChild(this.write_wmc_LayerExtension(layer));return \
node;},write_wmc_LayerExtension:function(layer){var \
node=this.createElementDefaultNS("Extension");var bounds=layer.maxExtent;var \
maxExtent=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(m \
axExtent,{minx:bounds.left.toPrecision(10),miny:bounds.bottom.toPrecision(10),maxx:bou \
nds.right.toPrecision(10),maxy:bounds.top.toPrecision(10)});node.appendChild(maxExtent);var \
param=layer.params["TRANSPARENT"];if(param){var \
trans=this.createElementNS(this.namespaces.ol,"ol:  \
transparent");trans.appendChild(this.createTextNode(param));node.appendChild(trans);} \
+var properties=["numZoomLevels","units","isBaseLayer","opacity","displayInLayerSwitcher","singleTile"];var \
child;for(var i=0;i<properties.length;++i){child=this.createOLPropertyNode(layer,properties[i]);if(child){node.appendChild(child);}}
 +return node;},createOLPropertyNode:function(obj,prop){var \
node=null;if(obj[prop]!=null){node=this.createElementNS(this.namespaces.ol,"ol:"+prop);node.appendChild(this.createTextNode(obj[prop].toString()));}
 +return node;},write_wmc_Server:function(layer){var \
node=this.createElementDefaultNS("Server");this.setAttributes(node,{service:"OGC:WMS", \
version:layer.params["VERSION"]});node.appendChild(this.write_wmc_OnlineResource(layer.url));return \
node;},write_wmc_FormatList:function(layer){var \
node=this.createElementDefaultNS("FormatList");node.appendChild(this.createElementDefaultNS("Format",layer.params["FORMAT"],{current:"1"}));return \
node;},write_wmc_StyleList:function(layer){var \
node=this.createElementDefaultNS("StyleList");var \
style=this.createElementDefaultNS("Style",null,{current:"1"});if(layer.params["SLD"]){var \
sld=this.createElementDefaultNS("SLD");var \
link=this.write_wmc_OnlineResource(layer.params["SLD"]);sld.appendChild(link);style.appendChild(sld);}else \
if(layer.params["SLD_BODY"]){var sld=this.createElementDefaultNS("SLD");var \
body=layer.params["SLD_BODY"];var \
doc=OpenLayers.Format.XML.prototype.read.apply(this,[body]);var \
imported=doc.documentElement;if(sld.ownerDocum  \
ent&&sld.ownerDocument.importNode){imported=sld.ownerDocument.importNode(imported,true);}
 +sld.appendChild(imported);style.appendChild(sld);}else{var \
name=layer.params["STYLES"]?layer.params["STYLES"]:this.defaultStyleName;style.appendC \
hild(this.createElementDefaultNS("Name",name));style.appendChild(this.createElementDefaultNS("Title",this.defaultStyleTitle));}
 +node.appendChild(style);return node;},write_wmc_OnlineResource:function(href){var \
node=this.createElementDefaultNS("OnlineResource");this.setAttributeNS(node,this.names \
paces.xlink,"xlink:type","simple");this.setAttributeNS(node,this.namespaces.xlink,"xlink:href",href);return \
node;},CLASS_NAME:"OpenLayers.Format.WMC.v1"});OpenLayers.Handler.Click=OpenLayers.Cla \
ss(OpenLayers.Handler,{delay:300,single:true,'double':false,pixelTolerance:0,stopSingl \
e:false,stopDouble:false,timerId:null,down:null,initialize:function(control,callbacks, \
options){OpenLayers.Handler.prototype.initialize.apply(this,arguments);if(this.pixelTolerance!=null){this.mousedown=function(evt){this.down=evt.xy;return \
true;};}},mousedown:null,dblclick:function(evt){if(this.passesTolerance(evt)){if(this["double"]){this.callback('dblclick',[evt]);}
 +this.clearTimer();}
+return!this.stopDouble;},click:function(evt){if(this.passesTolerance(evt)){if(this.timerId!=null){this.clearTimer();}else{var \
clickEvent=this.single?OpenLayers.Util.extend({},evt):null;this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,clickEvent),this.delay);}}
 +return!this.stopSingle;},passesTolerance:function(evt){var \
passes=true;if(this.pixelTolerance!=null&&this.down){var \
dpx=Math.sqrt(Math.pow(this.down.x-evt.xy.x,2)+ \
+Math.pow(this.down.y-evt.xy.y,2));if(dpx>this.pixelTolerance){passesúlse;}} +return \
passes;},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId \
);this.timerId=null;}},delayedCall:function(evt){this.timerId=null;if(evt){this.callback('click',[evt]);}},deactivate:function(){var \
deactivatedúlse;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();this.down=null;deactivated=true;}
 +return deactivated;},CLASS_NAME:"OpenLayers.Handler.Click"});OpenLayers.Handler.Drag \
=OpenLayers.Class(OpenLayers.Handler,{started:false,stopDown:true,dragging:false,last: \
null,start:null,oldOnselectstart:null,initialize:function(control,callbacks,options){O \
penLayers.Handler.prototype.initialize.apply(this,arguments);},down:function(evt){},mo \
ve:function(evt){},up:function(evt){},out:function(evt){},mousedown:function(evt){var \
propagate=true;this.draggingúlse;if(this.checkModifiers(evt)&&OpenLayers.Event.isLeftC \
lick(evt)){this.started=true;this.start=evt.xy;this.last=evt.xy;this.map.div.style.cur \
sor="move";this.down(evt);this.callback("down",[evt.xy]);OpenLayers.Event.stop(evt);if \
(!this.oldOnselectstart){this.oldOnselectstart=(document.onselectstart)?document.onselectstart:function(){return \
true;};document.onselectstart=function(){return false;};} \
+propagate=!this.stopDown;}else{this.startedúlse;this.start=null;this.last=null;} \
+return propagate;},mousemove:function(evt){if(this.started){if(evt.xy.x!=this.last.x| \
|evt.xy.y!=this.last.y){this.dragging=true;this.move(evt);this.callback("move",[evt.xy \
]);if(!this.oldOnselectstart){this.oldOnselectstart=document.onselectstart;document.onselectstart=function(){return \
false;};} +this.last=evt.xy;}}
+return true;},mouseup:function(evt){if(this.started){var \
dragged=(this.start!=this.last);this.startedúlse;this.draggingúlse;this.map.div.style. \
cursor="";this.up(evt);this.callback("up",[evt.xy]);if(dragged){this.callback("done",[evt.xy]);}
 +document.onselectstart=this.oldOnselectstart;}
+return true;},mouseout:function(evt){if(this.started&&OpenLayers.Util.mouseLeft(evt,this.map.div)){var \
dragged=(this.start!=this.last);this.startedúlse;this.draggingúlse;this.map.div.style. \
cursor="";this.out(evt);this.callback("out",[]);if(dragged){this.callback("done",[evt.xy]);}
 +if(document.onselectstart){document.onselectstart=this.oldOnselectstart;}}
+return true;},click:function(evt){return(this.start==this.last);},activate:function(){var \
activatedúlse;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.draggingúlse;activated=true;}
 +return activated;},deactivate:function(){var \
deactivatedúlse;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.startedúlse;this.draggingúlse;this.start=null;this.last=null;deactivated=true;}
 +return deactivated;},CLASS_NAME:"OpenLayers.Handler.Drag"});OpenLayers.Handler.Featu \
re=OpenLayers.Class(OpenLayers.Handler,{EVENTMAP:{'click':{'in':'click','out':'clickou \
t'},'mousemove':{'in':'over','out':'out'},'dblclick':{'in':'dblclick','out':null},'mou \
sedown':{'in':null,'out':null},'mouseup':{'in':null,'out':null}},feature:null,lastFeat \
ure:null,down:null,up:null,clickoutTolerance:4,geometryTypes:null,stopClick:true,stopD \
own:true,stopUp:true,layerIndex:null,initialize:function(control,layer,callbacks,optio \
ns){OpenLayers.Handler.prototype.initialize.apply(this,[control,callbacks,options]);this.layer=layer;},mousedown:function(evt){this.down=evt.xy;return \
this.handle(evt)?!this.stopDown:true;},mouseup:function(evt){this.up=evt.xy;return \
this.handle(evt)?!this.stopUp:true;},click:function(evt){return \
this.handle(evt)?!this.stopClick:true;},mousemove:function(evt){this.handle(evt);return \
true;},dblclick:function(evt){return!this.handle(evt);},geometryTypeMatches:function(feat
  ure){return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,feature.geometry.CLASS_NAME)>-1;},handle:function(evt){var \
type=evt.type;var handledúlse;var previouslyIn=!!(this.feature);var \
click=(type=="click"||type=="dblclick");this.feature=this.layer.getFeatureFromEvent(evt);if(this.feature){var \
inNew=(this.feature!=this.lastFeature);if(this.geometryTypeMatches(this.feature)){if(p \
reviouslyIn&&inNew){this.triggerCallback(type,'out',[this.lastFeature]);this.triggerCallback(type,'in',[this.feature]);}else \
if(!previouslyIn||click){this.triggerCallback(type,'in',[this.feature]);} \
+this.lastFeature=this.feature;handled=true;}else{if(previouslyIn&&inNew||(click&&this.lastFeature)){this.triggerCallback(type,'out',[this.lastFeature]);}
 +this.feature=null;}}else{if(previouslyIn||(click&&this.lastFeature)){this.triggerCallback(type,'out',[this.lastFeature]);}}
 +return handled;},triggerCallback:function(type,mode,args){var \
key=this.EVENTMAP[type][mode];if(key){if(type=='click'&&mode=='out'&&this.up&&this.down){var \
dpx=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+ \
+Math.pow(this.up.y-this.down.y,2));if(dpx<=this.clickoutTolerance){this.callback(key,args);}}else{this.callback(key,args);}}},activate:function(){var \
activatedúlse;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.lay \
erIndex=this.layer.div.style.zIndex;this.layer.div.style.zIndex=this.map.Z_INDEX_BASE['Popup']-1;activated=true;}
 +return activated;},deactivate:function(){var \
deactivatedúlse;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){if(this.layer&&this.layer.div){this.layer.div.style.zIndex=this.layerIndex;}
 +this.feature=null;this.lastFeature=null;this.down=null;this.up=null;deactivated=true;}
 +return deactivated;},CLASS_NAME:"OpenLayers.Handler.Feature"});OpenLayers.Handler.Ho \
ver=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:false, \
px:null,timerId:null,initialize:function(control,callbacks,options){OpenLayers.Handler \
.prototype.initialize.apply(this,arguments);},mousemove:function(evt){if(this.passesTo \
lerance(evt.xy)){this.clearTimer();this.callback('move',[evt]);this.px=evt.xy;evt=Open \
Layers.Util.extend({},evt);this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,evt),this.delay);}
 +return!this.stopMove;},mouseout:function(evt){if(OpenLayers.Util.mouseLeft(evt,this.map.div)){this.clearTimer();this.callback('move',[evt]);}
 +return true;},passesTolerance:function(px){var \
passes=true;if(this.pixelTolerance&&this.px){var \
dpx=Math.sqrt(Math.pow(this.px.x-px.x,2)+ \
+Math.pow(this.px.y-px.y,2));if(dpx<this.pixelTolerance){passesúlse;}} +return \
passes;},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId \
);this.timerId=null;}},delayedCall:function(evt){this.callback('pause',[evt]);},deactivate:function(){var \
deactivatedúlse;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();deactivated=true;}
 +return deactivated;},CLASS_NAME:"OpenLayers.Handler.Hover"});OpenLayers.Handler.Keyb \
oard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keypress","keyup"],ev \
entListener:null,initialize:function(control,callbacks,options){OpenLayers.Handler.pro \
totype.initialize.apply(this,arguments);this.eventListener=OpenLayers.Function.bindAsE \
ventListener(this.handleKeyEvent,this);},destroy:function(){this.deactivate();this.eve \
ntListener=null;OpenLayers.Handler.prototype.destroy.apply(this,arguments);},activate: \
function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){for(var \
i=0;i<this.KEY_EVENTS.length;i++){OpenLayers.Event.observe(window,this.KEY_EVENTS[i],this.eventListener);}
 +return true;}else{return false;}},deactivate:function(){var \
deactivatedúlse;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(var \
i=0;i<this.KEY_EVENTS.length;i++){OpenLayers.Event.stopObserving(window,this.KEY_EVENTS[i],this.eventListener);}
 +deactivated=true;}
+return deactivated;},handleKeyEvent:function(evt){if(this.checkModifiers(evt)){this.c \
allback(evt.type,[evt.charCode||evt.keyCode]);}},CLASS_NAME:"OpenLayers.Handler.Keyboa \
rd"});OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener \
:null,mousePosition:null,initialize:function(control,callbacks,options){OpenLayers.Han \
dler.prototype.initialize.apply(this,arguments);this.wheelListener=OpenLayers.Function \
.bindAsEventListener(this.onWheelEvent,this);},destroy:function(){OpenLayers.Handler.p \
rototype.destroy.apply(this,arguments);this.wheelListener=null;},onWheelEvent:function(e){if(!this.map||!this.checkModifiers(e)){return;}
 +var overScrollableDivúlse;var overLayerDivúlse;var overMapDivúlse;var \
elem=OpenLayers.Event.element(e);while((elem!=null)&&!overMapDiv&&!overScrollableDiv){ \
if(!overScrollableDiv){try{if(elem.currentStyle){overflow=elem.currentStyle["overflow"];}else{var \
style=document.defaultView.getComputedStyle(elem,null);var \
overflow=style.getPropertyValue("overflow");} \
+overScrollableDiv=(overflow&&(overflow=="auto")||(overflow=="scroll"));}catch(err){}}
 +if(!overLayerDiv){for(var \
i=0;i<this.map.layers.length;i++){if(elem==this.map.layers[i].div||elem==this.map.layers[i].pane){overLayerDiv=true;break;}}}
 +overMapDiv=(elem==this.map.div);elem=elem.parentNode;}
+if(!overScrollableDiv&&overMapDiv){if(overLayerDiv){this.wheelZoom(e);}
+OpenLayers.Event.stop(e);}},wheelZoom:function(e){var \
delta=0;if(!e){e=window.event;} \
+if(e.wheelDelta){delta=e.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){delta=-delta;}}else \
if(e.detail){delta=-e.detail/3;} \
+if(delta){if(this.mousePosition){e.xy=this.mousePosition;} \
+if(!e.xy){e.xy=this.map.getPixelFromLonLat(this.map.getCenter());} \
+if(delta<0){this.callback("down",[e,delta]);}else{this.callback("up",[e,delta]);}}},m \
ousemove:function(evt){this.mousePosition=evt.xy;},activate:function(evt){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var \
wheelListener=this.wheelListener;OpenLayers.Event.observe(window,"DOMMouseScroll",whee \
lListener);OpenLayers.Event.observe(window,"mousewheel",wheelListener);OpenLayers.Event.observe(document,"mousewheel",wheelListener);return \
true;}else{return false;}},deactivate:function(evt){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var \
wheelListener=this.wheelListener;OpenLayers.Event.stopObserving(window,"DOMMouseScroll \
",wheelListener);OpenLayers.Event.stopObserving(window,"mousewheel",wheelListener);OpenLayers.Event.stopObserving(document,"mousewheel",wheelListener);return \
true;}else{return false;}},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});OpenLayers.Lay \
er=OpenLayers.Class({id:null,name:null,div:null,opacity:null,EVENT_TYPES:["loadstart  \
","loadend","loadcancel","visibilitychanged"],events:null,map:null,isBaseLayer:false,a \
lpha:false,displayInLayerSwitcher:true,visibility:true,attribution:null,inRange:false, \
imageSize:null,imageOffset:null,options:null,eventListeners:null,gutter:0,projection:n \
ull,units:null,scales:null,resolutions:null,maxExtent:null,minExtent:null,maxResolutio \
n:null,minResolution:null,numZoomLevels:null,minScale:null,maxScale:null,displayOutsid \
eMaxExtent:false,wrapDateLine:false,transitionEffect:null,SUPPORTED_TRANSITIONS:['resi \
ze'],initialize:function(name,options){this.addOptions(options);this.name=name;if(this \
.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");this.div=OpenLa \
yers.Util.createDiv(this.id);this.div.style.width="100%";this.div.style.height="100%";this.events=new \
OpenLayers.Events(this,this.div,this.EVENT_TYPES);if(this.eventListeners instanceof \
Object){this.events.on(this.eventListeners);}} \
+if(this.wrapDateLine){this.displayOutsideMaxExtent=true;}},destroy:function(setNewBaseLayer){if(setNewBaseLayer==null){setNewBaseLayer=true;}
 +if(this.map!=null){this.map.removeLayer(this,setNewBaseLayer);}
+this.projection=null;this.map=null;this.name=null;this.div=null;this.options=null;if(this.events){if(this.eventListeners){this.events.un(this.eventListeners);}
 +this.events.destroy();}
+this.eventListeners=null;this.events=null;},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Layer(this.name,this.options);} \
+OpenLayers.Util.applyDefaults(obj,this);obj.map=null;return \
obj;},setName:function(newName){if(newName!=this.name){this.name=newName;if(this.map!= \
null){this.map.events.triggerEvent("changelayer",{layer:this,property:"name"});}}},addOptions:function(newOptions){if(this.options==null){this.options={};}
 +OpenLayers.Util.extend(this.options,newOptions);OpenLayers.Util.extend(this,newOptions);},onMapResize:function(){},redraw:function(){var \
redrawnúlse;if(this.map){this.inRange=this.calculateInRange();var \
extent=this.getExtent();if(extent&&this.inRange&&this.visibility){this.moveTo(extent,true,false);redrawn=true;}}
 +return redrawn;},moveTo:function(bounds,zoomChanged,dragging){var \
display=this.visibility;if(!this.isBaseLayer){display=display&&this.inRange;} \
+this.display(display);},setMap:function(map){if(this.map==null){this.map=map;this.max \
Extent=this.maxExtent||this.map.maxExtent;this.projection=this.projection||this.map.projection;if(this.projection&&typeof \
this.projection=="string"){this.projection=new \
OpenLayers.Projection(this.projection);} \
+this.units=this.projection.getUnits()||this.units||this.map.units;this.initResolutions();if(!this.isBaseLayer){this.inRange=this.calculateInRange();var \
show=((this.visibility)&&(this.inRange));this.div.style.display=show?"":"none";} \
+this.setTileSize();}},removeMap:function(map){},getImageSize:function(){return(this.imageSize||this.tileSize);},setTileSize:function(size){var \
tileSize=(size)?size:((this.tileSize)?this.tileSize:this.map.getTileSize());this.tileSize=tileSize;if(this.gutter){this.imageOffset=new \
OpenLayers.Pixel(-this.gutter,-this.gutter);this.imageSize=new \
OpenLayers.Size(tileSize.w+(2*this.gutter),tileSize.h+(2*this.gutter));}},getVisibility:function(){return \
this.visibility;},setVisibility:function(visibility){if(visibility!=this.visibility){t \
his.visibility=visibility;this.display(visibility);this.redraw();if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"});}
 +this.events.triggerEvent("visibilitychanged");}},display:function(display){var \
inRange=this.calculateInRange();if(display!=(this.div.style.display!="none")){this.div \
.style.display=(display&&inRange)?"block":"none";}},calculateInRange:function(){var \
inRangeúlse;if(this.map){var \
resolution=this.map.getResolution();inRange=((resolution>=this.minResolution)&&(resolution<=this.maxResolution));}
 +return inRange;},setIsBaseLayer:function(isBaseLayer){if(isBaseLayer!=this.isBaseLay \
er){this.isBaseLayer=isBaseLayer;if(this.map!=null){this.map.events.triggerEvent("changebaselayer",{layer:this});}}},initResolutions:function(){var \
props=new Array('projection','units','scales','resolutions','maxScale','minScale','max \
Resolution','minResolution','minExtent','maxExtent','numZoomLevels','maxZoomLevel');var \
confProps={};for(var i=0;i<props.length;i++){var \
property=props[i];confProps[property]=this.options[property]||this.map[property];} \
+if(this.options.minScale!=null&&this.options.maxScale!=null&&this.options.scales==null){confProps.scales=null;}
 +if(this.options.minResolution!=null&&this.options.maxResolution!=null&&this.options.resolutions==null){confProps.resolutions=null;}
 +if((!confProps.numZoomLevels)&&(confProps.maxZoomLevel)){confProps.numZoomLevels=confProps.maxZoomLevel+1;}
 +if((confProps.scales!=null)||(confProps.resolutions!=null)){if(confProps.scales!=null){confProps.resolutions=[];for(var \
i=0;i<confProps.scales.length;i++){var \
scale=confProps.scales[i];confProps.resolutions[i]=OpenLayers.Util.getResolutionFromScale(scale,confProps.units);}}
 +confProps.numZoomLevels=confProps.resolutions.length;}else{if(confProps.minScale){co \
nfProps.maxResolution=OpenLayers.Util.getResolutionFromScale(confProps.minScale,confProps.units);}else \
if(confProps.maxResolution=="auto"){var viewSize=this.map.getSize();var \
wRes=confProps.maxExtent.getWidth()/viewSize.w;var \
hRes=confProps.maxExtent.getHeight()/viewSize.h;confProps.maxResolution=Math.max(wRes,hRes);}
 +if(confProps.maxScale!=null){confProps.minResolution=OpenLayers.Util.getResolutionFromScale(confProps.maxScale,confProps.units);}else \
if((confProps.minResolution=="auto")&&(confProps.minExtent!=null)){var \
viewSize=this.map.getSize();var wRes=confProps.minExtent.getWidth()/viewSize.w;var \
hRes=confProps.minExtent.getHeight()/viewSize.h;confProps.minResolution=Math.max(wRes,hRes);}
 +if(confProps.minResolution!=null&&this.options.numZoomLevels==undefined){var \
ratio=confProps.maxResolution/confProps.minResolution;confProps.numZoomLevels=Math.floor(Math.log(ratio)/Math.log(2))+1;}
 +confProps.resolutions=new Array(confProps.numZoomLevels);var base=2;if(typeof \
confProps.minResolution=="number"&&confProps.numZoomLevels>1){base=Math.pow((confProps.maxResolution/confProps.minResolution),(1/(confProps.numZoomLevels-1)));}
 +for(var i=0;i<confProps.numZoomLevels;i++){var \
res=confProps.maxResolution/Math.pow(base,i);confProps.resolutions[i]=res;}} \
+confProps.resolutions.sort(function(a,b){return(b-a);});this.resolutions=confProps.resolutions;this.maxResolution=confProps.resolutions[0];var \
lastIndex=confProps.resolutions.length-1;this.minResolution=confProps.resolutions[lastIndex];this.scales=[];for(var \
i=0;i<confProps.resolutions.length;i++){this.scales[i]=OpenLayers.Util.getScaleFromResolution(confProps.resolutions[i],confProps.units);}
 +this.minScale=this.scales[0];this.maxScale=this.scales[this.scales.length-1];this.numZoomLevels=confProps.numZoomLevels;},getResolution:function(){var \
zoom=this.map.getZoom();return \
this.getResolutionForZoom(zoom);},getExtent:function(){return \
this.map.calculateBounds();},getZoomForExtent:function(extent,closest){var \
viewSize=this.map.getSize();var \
idealResolution=Math.max(extent.getWidth()/viewSize.w,extent.getHeight()/viewSize.h);return \
this.getZoomForResolution(idealResolution,closest);},getDataExtent:function(){},getRes \
olutionForZoom:function(zoom){zoom=Math.max(0,Math.min(zoom,this.resolutions.length-1));var \
resolution;if(this.map.fractionalZoom){var low=Math.floor(zoom);var \
high=Math.ceil(zoom);resolution=this.resolutions[high]+ \
+((zoom-low)*(this.resolutions[low]-this.resolutions[high]));}else{resolution=this.resolutions[Math.round(zoom)];}
 +return resolution;},getZoomForResolution:function(resolution,closest){var \
zoom;if(this.map.fractionalZoom){var lowZoom=0;var \
highZoom=this.resolutions.length-1;var highRes=this.resolutions[lowZoom];var \
lowRes=this.resolutions[highZoom];var res;for(var \
i=0;i<this.resolutions.length;++i){res=this.resolutions[i];if(res>=resolution){highRes=res;lowZoom=i;}
 +if(res<=resolution){lowRes=res;highZoom=i;break;}}
+var dRes=highRes-lowRes;if(dRes>0){zoom=lowZoom+((resolution-lowRes)/dRes);}else{zoom=lowZoom;}}else{var \
diff;var minDiff=Number.POSITIVE_INFINITY;for(var \
i=0;i<this.resolutions.length;i++){if(closest){diff=Math.abs(this.resolutions[i]-resolution);if(diff>minDiff){break;}
 +minDiff=diff;}else{if(this.resolutions[i]<resolution){break;}}}
+zoom=Math.max(0,i-1);}
+return zoom;},getLonLatFromViewPortPx:function(viewPortPx){var \
lonlat=null;if(viewPortPx!=null){var size=this.map.getSize();var \
center=this.map.getCenter();if(center){var res=this.map.getResolution();var \
delta_x=viewPortPx.x-(size.w/2);var delta_y=viewPortPx.y-(size.h/2);lonlat=new \
OpenLayers.LonLat(center.lon+delta_x*res,center.lat-delta_y*res);if(this.wrapDateLine){lonlat=lonlat.wrapDateLine(this.maxExtent);}}}
 +return lonlat;},getViewPortPxFromLonLat:function(lonlat){var \
px=null;if(lonlat!=null){var resolution=this.map.getResolution();var \
extent=this.map.getExtent();px=new \
OpenLayers.Pixel((1/resolution*(lonlat.lon-extent.left)),(1/resolution*(extent.top-lonlat.lat)));}
 +return px;},setOpacity:function(opacity){if(opacity!=this.opacity){this.opacity=opacity;for(var \
i=0;i<this.div.childNodes.length;++i){var \
element=this.div.childNodes[i].firstChild;OpenLayers.Util.modifyDOMElement(element,nul \
l,null,null,null,null,null,opacity);}}},setZIndex:function(zIndex){this.div.style.zIndex=zIndex;},adjustBounds:function(bounds){if(this.gutter){var \
mapGutter=this.gutter*this.map.getResolution();bounds=new \
OpenLayers.Bounds(bounds.left-mapGutter,bounds.bottom-mapGutter,bounds.right+mapGutter,bounds.top+mapGutter);}
 +if(this.wrapDateLine){var \
wrappingOptions={'rightTolerance':this.getResolution()};bounds=bounds.wrapDateLine(this.maxExtent,wrappingOptions);}
 +return bounds;},CLASS_NAME:"OpenLayers.Layer"});OpenLayers.Marker.Box=OpenLayers.Cla \
ss(OpenLayers.Marker,{bounds:null,div:null,initialize:function(bounds,borderColor,bord \
erWidth){this.bounds=bounds;this.div=OpenLayers.Util.createDiv();this.div.style.overflow='hidden';this.events=new \
OpenLayers.Events(this,this.div,null);this.setBorder(borderColor,borderWidth);},destro \
y:function(){this.bounds=null;this.div=null;OpenLayers.Marker.prototype.destroy.apply(this,arguments);},setBorder:function(color,width){if(!color){color="red";}
 +if(!width){width=2;}
+this.div.style.border=width+"px solid \
"+color;},draw:function(px,sz){OpenLayers.Util.modifyDOMElement(this.div,null,px,sz);return \
this.div;},onScreen:function(){var onScreenúlse;if(this.map){var \
screenBounds=this.map.getExtent();onScreen=screenBounds.containsBounds(this.bounds,true,true);}
 +return onScreen;},display:function(display){this.div.style.display=(display)?"":"non \
e";},CLASS_NAME:"OpenLayers.Marker.Box"});OpenLayers.Popup.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed,{autoSize:true,panMapIfOutOfView:true,imageSize:new \
OpenLayers.Size(676,736),isAlphaImage:false,fixedRelativePosition:false,positionBlocks:{"tl":{'offset':new \
OpenLayers.Pixel(44,0),'padding':new OpenLayers.Bounds(8,40,8,9),'blocks':[{size:new \
OpenLayers.Size('auto','auto'),anchor:new OpenLayers.Bounds(0,51,22,0),position:new \
OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,'auto'),anchor:new \
OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new \
OpenLayers.Size('auto',21),anchor:new OpenLayers.Bounds(0,32,80,null),position:new \
OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new \
OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new \
OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(null,0,0,null),position  :new \
OpenLayers.Pixel(0,-668)}]},"tr":{'offset':new OpenLayers.Pixel(-45,0),'padding':new \
OpenLayers.Bounds(8,40,8,9),'blocks':[{size:new \
OpenLayers.Size('auto','auto'),anchor:new OpenLayers.Bounds(0,51,22,0),position:new \
OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,'auto'),anchor:new \
OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new \
OpenLayers.Size('auto',21),anchor:new OpenLayers.Bounds(0,32,22,null),position:new \
OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new \
OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new \
OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(0,0,null,null),position:new \
OpenLayers.Pixel(-215,-668)}]},"bl":{'offset':new \
OpenLayers.Pixel(45,0),'padding':new OpenLayers.Bounds(8,9,8,40),'blocks':[{size:new \
OpenLayers.Size('auto','auto'),anchor:new OpenLayers.Bounds(0,21,22,32),position:new \
OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,'auto'),anchor:new OpenLa  \
yers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new \
OpenLayers.Size('auto',21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new \
OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new \
OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new \
OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(null,null,0,0),position:new \
OpenLayers.Pixel(-101,-674)}]},"br":{'offset':new \
OpenLayers.Pixel(-44,0),'padding':new OpenLayers.Bounds(8,9,8,40),'blocks':[{size:new \
OpenLayers.Size('auto','auto'),anchor:new OpenLayers.Bounds(0,21,22,32),position:new \
OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,'auto'),anchor:new \
OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new \
OpenLayers.Size('auto',21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new \
OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new \
OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629  \
)},{size:new OpenLayers.Size(81,54),anchor:new \
OpenLayers.Bounds(0,null,null,0),position:new \
OpenLayers.Pixel(-311,-674)}]}},minSize:new OpenLayers.Size(105,10),maxSize:new \
OpenLayers.Size(600,660),initialize:function(id,lonlat,size,contentHTML,anchor,closeBo \
x,closeBoxCallback){this.imageSrc=OpenLayers.Util.getImagesLocation()+'cloud-popup-rel \
ative.png';OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);this.con \
tentDiv.className="olFramedCloudPopupContent";},destroy:function(){OpenLayers.Popup.Fr \
amed.prototype.destroy.apply(this,arguments);},CLASS_NAME:"OpenLayers.Popup.FramedClou \
d"});OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes \
:null,onStart:function(feature,pixel){},onDrag:function(feature,pixel){},onComplete:fu \
nction(feature,pixel){},layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},l \
astPixel:null,initialize:function(layer,options){OpenLayers.Control.prototype.initialize.apply(this,[options]);this.layer=layer;
  this.handlers={drag:new \
OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.m \
oveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks)),feature:new \
OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({over:this.overFeatu \
re,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})};}, \
destroy:function(){this.layer=null;OpenLayers.Control.prototype.destroy.apply(this,[]) \
;},activate:function(){return(this.handlers.feature.activate()&&OpenLayers.Control.pro \
totype.activate.apply(this,arguments));},deactivate:function(){this.handlers.drag.deac \
tivate();this.handlers.feature.deactivate();this.feature=null;this.draggingúlse;this.lastPixel=null;return \
OpenLayers.Control.prototype.deactivate.apply(this,arguments);},overFeature:function(f \
eature){if(!this.handlers.drag.dragging){this.featureþature;this.handlers.drag.activate();this.over=true;this.map.div.style.cursor="move";}else{if(thi
  s.feature.id=þature.id){this.over=true;}else{this.overúlse;}}},downFeature:function( \
pixel){this.lastPixel=pixel;this.onStart(this.feature,pixel);},moveFeature:function(pixel){var \
res=this.map.getResolution();this.feature.geometry.move(res*(pixel.x-this.lastPixel.x) \
,res*(this.lastPixel.y-pixel.y));this.layer.drawFeature(this.feature);this.lastPixel=p \
ixel;this.onDrag(this.feature,pixel);},upFeature:function(pixel){if(!this.over){this.h \
andlers.drag.deactivate();this.feature=null;this.map.div.style.cursor="default";}},don \
eDragging:function(pixel){this.onComplete(this.feature,pixel);},outFeature:function(fe \
ature){if(!this.handlers.drag.dragging){this.overúlse;this.handlers.drag.deactivate(); \
this.map.div.style.cursor="default";this.feature=null;}else{if(this.feature.id=þature. \
id){this.overúlse;}}},cancel:function(){this.handlers.drag.deactivate();this.overúlse; \
},setMap:function(map){this.handlers.drag.setMap(map);this.handlers.feature.setMap(map);OpenLayers.Control.pro
  totype.setMap.apply(this,arguments);},CLASS_NAME:"OpenLayers.Control.DragFeature"}); \
OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:false,draw:function(){this.handler=new \
OpenLayers.Handler.Drag(this,{"move":this.panMap,"done":this.panMapDone});},panMap:fun \
ction(xy){this.panned=true;this.map.pan(this.handler.last.x-xy.x,this.handler.last.y-x \
y.y,{dragging:this.handler.dragging,animate:false});},panMapDone:function(xy){if(this. \
panned){this.panMap(xy);this.pannedúlse;}},CLASS_NAME:"OpenLayers.Control.DragPan"});O \
penLayers.Control.KeyboardDefaults=OpenLayers.Class(OpenLayers.Control,{slideFactor:75 \
,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments);},destroy:function(){if(this.handler){this.handler.destroy();}
 +this.handler=null;OpenLayers.Control.prototype.destroy.apply(this,arguments);},draw:function(){this.handler=new \
OpenLayers.Handler.Keyboard(this,{"keypress":this.defaultKeyPress});this.activate();},defaultKeyPress:function(code){switch(code){case \
OpenLayers.Event.KEY_LEFT:this.map.pan(-this.slideFactor,0);break;case \
OpenLayers.Event.KEY_RIGHT:this.map.pan(this.slideFactor,0);break;case \
OpenLayers.Event.KEY_UP:this.map.pan(0,-this.slideFactor);break;case \
OpenLayers.Event.KEY_DOWN:this.map.pan(0,this.slideFactor);break;case 33:var \
size=this.map.getSize();this.map.pan(0,-0.75*size.h);break;case 34:var \
size=this.map.getSize();this.map.pan(0,0.75*size.h);break;case 35:var \
size=this.map.getSize();this.map.pan(0.75*size.w,0);break;case 36:var \
size=this.map.getSize();this.map.pan(-0.75*size.w,0);break;case \
43:this.map.zoomIn();break;case 45:this.map.zoomOut();break;case \
107:this.map.zoomIn();break;case \
109:this.map.zoomOut();break;}},CLASS_NAME:"OpenLayers.Control.KeyboardDefaults"}  \
);OpenLayers.State={UNKNOWN:'Unknown',INSERT:'Insert',UPDATE:'Update',DELETE:'Delete'} \
;OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature,{fid:null,geometry:null \
,attributes:null,state:null,style:null,renderIntent:"default",initialize:function(geom \
etry,attributes,style){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,a \
ttributes]);this.lonlat=null;this.geometry=geometry;this.state=null;this.attributes={} \
;if(attributes){this.attributes=OpenLayers.Util.extend(this.attributes,attributes);} \
+this.style=style?style:null;},destroy:function(){if(this.layer){this.layer.removeFeatures(this);this.layer=null;}
 +this.geometry=null;OpenLayers.Feature.prototype.destroy.apply(this,arguments);},clone:function(){return \
new OpenLayers.Feature.Vector(this.geometry.clone(),this.attributes,this.style);},onScreen:function(boundsOnly){var \
onScreenúlse;if(this.layer&&this.layer.map){var \
screenBounds=this.layer.map.getExtent();if(boundsOnly){var \
featureBounds=this.geometry.getBounds();onScreen=screenBounds.intersectsBounds(featureBounds);}else{var \
screenPoly=screenBounds.toGeometry();onScreen=screenPoly.intersects(this.geometry);}} \
+return onScreen;},createMarker:function(){return \
null;},destroyMarker:function(){},createPopup:function(){return \
null;},atPoint:function(lonlat,toleranceLon,toleranceLat){var \
atPointúlse;if(this.geometry){atPoint=this.geometry.atPoint(lonlat,toleranceLon,toleranceLat);}
 +return atPoint;},destroyPopup:function(){},toState:function(state){if(state==OpenLayers.State.UPDATE){switch(this.state){case \
OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=state;break;case \
OpenLayers.State.UPDATE:case OpenLayers.State.INSERT:break;}}else \
if(state==OpenLayers.State.INSERT){switch(this.state){case \
OpenLayers.State.UNKNOWN:break;default:this.state=state;break;}}else \
if(state==OpenLayers.State.DELETE){switch(this.state){case \
OpenLayers.State.INSERT:break;case OpenLayers.State.DELETE:break;case \
OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state=state;break;}}else \
if(state==OpenLayers.State.UNKNOWN){this.state=state;}},CLASS_NAME:"OpenLayers.Feature \
.Vector"});OpenLayers.Feature.Vector.style={'default':{fillColor:"#ee9900",fillOpacity \
:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#ee9900",strokeOpacity:1 \
,strokeWidth:1,strokeLinecap:"round",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,
  hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:""},'sel \
ect':{fillColor:"blue",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,str \
okeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",hoverStrokeColor:" \
red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverP \
ointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer"},'temporary':{fillColor:" \
yellow",fillOpacity:0.2,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"yello \
w",strokeOpacity:1,strokeLinecap:"round",strokeWidth:4,hoverStrokeColor:"red",hoverStr \
okeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%", \
pointerEvents:"visiblePainted",cursor:""}};OpenLayers.Feature.WFS=OpenLayers.Class(OpenLayers.Feature,{initialize:function(layer,xmlNode){var \
newArguments=arguments;var data=this.processXMLNode(xmlNode);newArguments=new \
Array(layer,data.lonlat,data);OpenLayers.Feature.prototype.initialize.apply(this,ne  \
wArguments);this.createMarker();this.layer.addMarker(this.marker);},destroy:function(){if(this.marker!=null){this.layer.removeMarker(this.marker);}
 +OpenLayers.Feature.prototype.destroy.apply(this,arguments);},processXMLNode:function(xmlNode){var \
point=OpenLayers.Ajax.getElementsByTagNameNS(xmlNode,"http://www.opengis.net/gml","gml","Point");var \
text=OpenLayers.Util.getXmlNodeValue(OpenLayers.Ajax.getElementsByTagNameNS(point[0],"http://www.opengis.net/gml","gml","coordinates")[0]);var \
floats=text.split(",");return{lonlat:new \
OpenLayers.LonLat(parseFloat(floats[0]),parseFloat(floats[1])),id:null};},CLASS_NAME:" \
OpenLayers.Feature.WFS"});OpenLayers.Format.WMC.v1_0_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/context \
http://schemas.opengis.net/context/1.0.0/context.xsd",initialize:function(options){Ope \
nLayers.Format.WMC.v1.prototype.initialize.apply(this,[options]);},CLASS_NAME:"OpenLay \
ers.Format.WMC.v1_0_0"});OpenLayers.Format.WMC.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/context \
http://schemas.opengis.net/  \
context/1.1.0/context.xsd",initialize:function(options){OpenLayers.Format.WMC.v1.proto \
type.initialize.apply(this,[options]);},read_sld_MinScaleDenominator:function(layerInf \
o,node){layerInfo.options.maxScale=this.getChildValue(node);},read_sld_MaxScaleDenomin \
ator:function(layerInfo,node){layerInfo.options.minScale=this.getChildValue(node);},write_wmc_Layer:function(layer){var \
node=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[layer]);if(layer.o \
ptions.resolutions||layer.options.scales||layer.options.minResolution||layer.options.maxScale){var \
minSD=this.createElementNS(this.namespaces.sld,"sld:MinScaleDenominator");minSD.append \
Child(this.createTextNode(layer.maxScale.toPrecision(10)));node.insertBefore(minSD,node.childNodes[3]);}
 +if(layer.options.resolutions||layer.options.scales||layer.options.maxResolution||layer.options.minScale){var \
maxSD=this.createElementNS(this.namespaces.sld,"sld:MaxScaleDenominator");maxSD.append \
Child(this.createTextNode(layer.minScale.toPrecision(10)));node.insertBefore(maxSD,node.childNodes[4]);}
 +return node;},CLASS_NAME:"OpenLayers.Format.WMC.v1_1_0"});OpenLayers.Handler.Box=Ope \
nLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:'olHandlerBoxZoomBo \
x',initialize:function(control,callbacks,options){OpenLayers.Handler.prototype.initialize.apply(this,arguments);var \
callbacks={"down":this.startBox,"move":this.moveBox,"out":this.removeBox,"up":this.endBox};this.dragHandler=new \
OpenLayers.Handler.Drag(this,callbacks,{keyMask:this.keyMask});},setMap:function(map){ \
OpenLayers.Handler.prototype.setMap.apply(this,arguments);if(this.dragHandler){this.dr \
agHandler.setMap(map);}},startBox:function(xy){this.zoomBox=OpenLayers.Util.createDiv( \
'zoomBox',this.dragHandler.start);this.zoomBox.className=this.boxDivClassName;this.zoo \
mBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.viewPortDiv.appendChild(this.zoomBox);this.map.div.style.cursor="crosshair";},moveBox:function(xy){var \
deltaX=Math.abs(this.dragHandler.start.x-xy.x);var deltaY=Math.abs(this.dragHandler.  \
start.y-xy.y);this.zoomBox.style.width=Math.max(1,deltaX)+"px";this.zoomBox.style.heig \
ht=Math.max(1,deltaY)+"px";if(xy.x<this.dragHandler.start.x){this.zoomBox.style.left=xy.x+"px";}
 +if(xy.y<this.dragHandler.start.y){this.zoomBox.style.top=xy.y+"px";}},endBox:function(end){var \
result;if(Math.abs(this.dragHandler.start.x-end.x)>5||Math.abs(this.dragHandler.start.y-end.y)>5){var \
start=this.dragHandler.start;var top=Math.min(start.y,end.y);var \
bottom=Math.max(start.y,end.y);var left=Math.min(start.x,end.x);var \
right=Math.max(start.x,end.x);result=new \
OpenLayers.Bounds(left,bottom,right,top);}else{result=this.dragHandler.start.clone();}
 +this.removeBox();this.map.div.style.cursor="";this.callback("done",[result]);},remov \
eBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null;},act \
ivate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragHandler.activate();return \
true;}else{return false;}},deactivate:function(){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.dragHandler.deactivate();return \
true;}else{return false;}},CLASS_NAME:"OpenLayers.Handler.Box"});OpenLayers.Handler.Re \
gularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:n \
ull,snapToggle:'shiftKey',persist:false,irregular:false,angle:null,fixedRadius:false,f \
eature:null,layer:null,origin:null,initialize:function(control,callbacks,options){this \
.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style['default'],{});OpenLayer \
s.Handler.prototype.initialize.apply(this,[control,callbacks,options]);this.options=(options)?options:new \
Object();},setO  ptions:function(newOptions){OpenLayers.Util.extend(this.options,newOptions);OpenLayers.Util.extend(this,newOptions);},activate:function(){var \
activatedúlse;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var \
options={displayInLayerSwitcher:false};this.layer=new \
OpenLayers.Layer.Vector(this.CLASS_NAME,options);this.map.addLayer(this.layer);activated=true;}
 +return activated;},deactivate:function(){var \
deactivatedúlse;if(OpenLayers.Handler.Drag.prototype.deactivate.apply(this,arguments)){if(this.dragging){this.cancel();}
 +if(this.layer.map!=null){this.layer.destroy(false);if(this.feature){this.feature.destroy();}}
 +this.layer=null;this.feature=null;deactivated=true;}
+return deactivated;},down:function(evt){this.fixedRadius=!!(this.radius);var \
maploc=this.map.getLonLatFromPixel(evt.xy);this.origin=new \
OpenLayers.Geometry.Point(maploc.lon,maploc.lat);if(!this.fixedRadius||this.irregular){this.radius=this.map.getResolution();}
 +if(this.persist){this.clear();}
+this.feature=new OpenLayers.Feature.Vector();this.createGeometry();this.layer.addFeat \
ures([this.feature],{silent:true});this.layer.drawFeature(this.feature,this.style);},move:function(evt){var \
maploc=this.map.getLonLatFromPixel(evt.xy);var point=new \
OpenLayers.Geometry.Point(maploc.lon,maploc.lat);if(this.irregular){var \
ry=Math.sqrt(2)*Math.abs(point.y-this.origin.y)/2;this.radius=Math.max(this.map.getResolution()/2,ry);}else \
if(this.fixedRadius){this.origin=point;}else{this.calculateAngle(point,evt);this.radius=Math.max(this.map.getResolution()/2,point.distanceTo(this.origin));}
 +this.modifyGeometry();if(this.irregular){var dx=point.x-this.origin.x;var \
dy=point.y-this.origin.y;var \
ratio;if(dy==0){ratio=dx/(this.radius*Math.sqrt(2));}else{ratio=dx/dy;} \
+this.feature.geometry.resize(1,this.origin,ratio);this.feature.geometry.move(dx/2,dy/2);}
 +this.layer.drawFeature(this.feature,this.style);},up:function(evt){this.finalize();} \
,out:function(evt){this.finalize();},createGeometry:function(){this.angle=Math.PI*((1/this.sides)-(1/2));if(this.snapAngle){this.angle+=this.snapAngle*(Math.PI/180);}
 +this.feature.geometry=OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin,this.radius,this.sides,this.snapAngle);},modifyGeometry:function(){var \
angle,dx,dy,point;var \
ring=this.feature.geometry.components[0];if(ring.components.length!=(this.sides+1)){this.createGeometry();ring=this.feature.geometry.components[0];}
 +for(var i=0;i<this.sides;++i){point=ring.components[i];angle=this.angle+(i*2*Math.PI \
/this.sides);point.x=this.origin.x+(this.radius*Math.cos(angle));point.y=this.origin.y \
+(this.radius*Math.sin(angle));point.clearBounds();}},calculateAngle:function(point,evt){var \
alpha=Math.atan2(point.y-this.origin.y,point.x-this.origin.x);if(this.snapAngle&&(this.snapToggle&&!evt[this.snapToggle])){var \
snapAngleRad=(Math.PI/180)*this.snapAngle;this.angle=Math.round(alpha/snapAngleRad)*sn \
apAngleRad;}else{this.angle=alpha;}},cancel:function(){this.callback("cancel",null);th \
is.finalize();},finalize:function(){this.origin=null;this.radius=this.options.radius;} \
,clear:function(){this.layer.renderer.clear();this.layer.destroyFeatures();},callback: \
function(name,args){if(this.callbacks[name]){this.callbacks[name].apply(this.control,[this.feature.geometry.clone()]);}
 +if(!this.persist&&(name=="done"||name=="cancel")){this.clear();}},CLASS_NAME:"OpenLa \
yers.Handler.RegularPolygon"});OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers. \
Layer,{smoothDragPan:true,isBaseLayer:true,isFixed:true,pane:null,mapObject:null,initi \
alize:function(name,options){OpenLayers.Layer.prototype.initialize.apply(this,argument \
s);if(this.pane==null){this.pane=OpenLayers.Util.createDiv(this.div.id+"_EventPane");} \
},destroy:function(){this.mapObject=null;OpenLayers.Layer.prototype.destroy.apply(this \
,arguments);},setMap:function(map){OpenLayers.Layer.prototype.setMap.apply(this,argume \
nts);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1;this.pane.style.display= \
this.div.style.display;this.pane.style.width="100%";this.pane.style.height="100%";if(O \
penLayers.Util.getBrowserName()=="msie"){this.pane.style.background="url("+OpenLayers.Util.getImagesLocation()+"blank.gif)";}
 +if(this.isFixed){this.map.viewPortDiv.appendChild(this.pane);}else{this.map.layerContainerDiv.appendChild(this.pane);}
 +this.loadMapObject();if(this.mapObject==null){this.loadWarningMessage();}},removeMap \
:function(map){if(this.pane&&this.pane.parentNode){this.pane.parentNode.removeChild(this.pane);this.pane=null;}
 +OpenLayers.Layer.prototype.removeMap.apply(this,arguments);},loadWarningMessage:function(){this.div.style.backgroundColor="darkblue";var \
viewSize=this.map.getSize();var msgW=Math.min(viewSize.w,300);var \
msgH=Math.min(viewSize.h,200);var size=new OpenLayers.Size(msgW,msgH);var \
centerPx=new OpenLayers.Pixel(viewSize.w/2,viewSize.h/2);var \
topLeftÎnterPx.add(-size.w/2,-size.h/2);var \
div=OpenLayers.Util.createDiv(this.name+"_warning",topLeft,size,null,null,null,"auto") \
;div.style.padding="7px";div.style.backgroundColor="yellow";div.innerHTML=this.getWarn \
ingHTML();this.div.appendChild(div);},getWarningHTML:function(){return"";},display:fun \
ction(display){OpenLayers.Layer.prototype.display.apply(this,arguments);this.pane.styl \
e.display=this.div.style.display;},setZIndex:function(zIndex){OpenLayers.Layer.prototy \
pe.setZIndex.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zInd \
ex)+1;},moveTo:function(bounds,zoomChanged,dragging){OpenLayers.Layer.prototype.moveTo.ap
  ply(this,arguments);if(this.mapObject!=null){var newCenter=this.map.getCenter();var \
newZoom=this.map.getZoom();if(newCenter!=null){var \
moOldCenter=this.getMapObjectCenter();var \
oldCenter=this.getOLLonLatFromMapObjectLonLat(moOldCenter);var \
moOldZoom=this.getMapObjectZoom();var \
oldZoom=this.getOLZoomFromMapObjectZoom(moOldZoom);if(!(newCenter.equals(oldCenter))||!(newZoom==oldZoom)){if(dragging&&this.dragPanMapObject&&this.smoothDragPan){var \
oldPx=this.map.getViewPortPxFromLonLat(oldCenter);var \
newPx=this.map.getViewPortPxFromLonLat(newCenter);this.dragPanMapObject(newPx.x-oldPx.x,oldPx.y-newPx.y);}else{var \
center=this.getMapObjectLonLatFromOLLonLat(newCenter);var \
zoom=this.getMapObjectZoomFromOLZoom(newZoom);this.setMapObjectCenter(center,zoom,dragging);}}}}},getLonLatFromViewPortPx:function(viewPortPx){var \
lonlat=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var \
moPixel=this.getMapObjectPixelFromOLPixel(viewPortPx);var \
moLonLat=this.getMapObjectLonLatFr  \
omMapObjectPixel(moPixel);lonlat=this.getOLLonLatFromMapObjectLonLat(moLonLat);} \
+return lonlat;},getViewPortPxFromLonLat:function(lonlat){var \
viewPortPx=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var \
moLonLat=this.getMapObjectLonLatFromOLLonLat(lonlat);var \
moPixel=this.getMapObjectPixelFromMapObjectLonLat(moLonLat);viewPortPx=this.getOLPixelFromMapObjectPixel(moPixel);}
 +return viewPortPx;},getOLLonLatFromMapObjectLonLat:function(moLonLat){var \
olLonLat=null;if(moLonLat!=null){var \
lon=this.getLongitudeFromMapObjectLonLat(moLonLat);var \
lat=this.getLatitudeFromMapObjectLonLat(moLonLat);olLonLat=new \
OpenLayers.LonLat(lon,lat);} +return \
olLonLat;},getMapObjectLonLatFromOLLonLat:function(olLonLat){var \
moLatLng=null;if(olLonLat!=null){moLatLng=this.getMapObjectLonLatFromLonLat(olLonLat.lon,olLonLat.lat);}
 +return moLatLng;},getOLPixelFromMapObjectPixel:function(moPixel){var \
olPixel=null;if(moPixel!=null){var x=this.getXFromMapObjectPixel(moPixel);var \
y=this.getYFromMapObjectPixel(moPixel);olPixel=new OpenLayers.Pixel(x,y);} +return \
olPixel;},getMapObjectPixelFromOLPixel:function(olPixel){var \
moPixel=null;if(olPixel!=null){moPixel=this.getMapObjectPixelFromXY(olPixel.x,olPixel.y);}
 +return moPixel;},CLASS_NAME:"OpenLayers.Layer.EventPane"});OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){var \
props=new Array('minZoomLevel','maxZoomLevel','numZoomLevels');for(var \
i=0;i<props.length;i++){var \
property=props[i];this[property]=(this.options[property]!=null)?this.options[property]:this.map[property];}
 +if((this.minZoomLevel==null)||(this.minZoomLevel<this.MIN_ZOOM_LEVEL)){this.minZoomLevel=this.MIN_ZOOM_LEVEL;}
 +var limitZoomLevels=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;if(this.numZoomLevels!=n \
ull){this.numZoomLevels=Math.min(this.numZoomLevels,limitZoomLevels);}else{if(this.maxZoomLevel!=null){var \
zoomDiff=this.maxZoomLevel-this.minZoomLevel+1;this.numZoomLevels=Math.min(zoomDiff,limitZoomLevels);}else{this.numZoomLevels=limitZoomLevels;}}
 +this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;if(this.RESOLUTIONS!=null){var \
resolutionsIndex=0;this.resolutions=[];for(var \
i=this.minZoomLevel;i<=this.maxZoomLevel;i++){this.resolutions[resolutionsIndex++]=this.RESOLUTIONS[i];}
 +this.maxResolution=this.resolutions[0];this.minResolution=this.resolutions[this.resolutions.length-1];}},getResolution:function(){if(this.resolutions!=null){return \
OpenLayers.Layer.prototype.getResolution.apply(this,arguments);}else{var \
resolution=null;var viewSize=this.map.getSize();var \
extent=this.getExtent();if((viewSize!=null)&&(extent!=null)){resolution=Math.max(extent.getWidth()/viewSize.w,extent.getHeight()/viewSize.h);}
 +return resolution;}},getExtent:function(){var extent=null;var \
size=this.map.getSize();var tlPx=new OpenLayers.Pixel(0,0);var \
tlLL=this.getLonLatFromViewPortPx(tlPx);var brPx=new \
OpenLayers.Pixel(size.w,size.h);var \
brLL=this.getLonLatFromViewPortPx(brPx);if((tlLL!=null)&&(brLL!=null)){extent=new \
OpenLayers.Bounds(tlLL.lon,brLL.lat,brLL.lon,tlLL.lat);} +return \
extent;},getZoomForResolution:function(resolution){if(this.resolutions!=null){return \
OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments);}else{var \
extent=OpenLayers.Layer.prototype.getExtent.apply(this,[]);return \
this.getZoomForExtent(extent);}},getOLZoomFromMapObjectZoom:function(moZoom){var \
zoom=null;if(moZoom!=null){zoom=moZoom-this.minZoomLevel;} +return \
zoom;},getMapObjectZoomFromOLZoom:function(olZoom){var \
zoom=null;if(olZoom!=null){zoom=olZoom+this.minZoomLevel;} +return \
zoom;},CLASS_NAME:"FixedZoomLevels.js"});OpenLayers.Layer.HTTPRequest=OpenLayers.Class \
(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:false,initialize:function(name,url,params,options){var \
newArguments=arguments;newArguments=[name,options];OpenLayers.Layer.prototype.initiali \
ze.apply(this,newArguments);this.url=url;this.params=OpenLayers.Util.extend({},params) \
;},destroy:function(){this.url=null;this.params=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments);},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.options);} \
+obj=OpenLayers.Layer.prototype.clone.apply(this,[obj]);return \
obj;},setUrl:function(newUrl){this.url=newUrl;},mergeNewParams:function(newParams){this.params=OpenLayers.Util.extend(this.params,newParams);return \
this.redraw();},redraw:function(force){if(force){return \
this.mergeNewParams({"_olSalt":Math.random()});}else{return \
OpenLayers.Layer.prototype.redraw.apply(this,[]);}},selectUrl:function(paramString,urls){var \
product=1;for(var i=0;i<paramString.length;i++){product*=paramString.charCodeAt(i)*this.URL_HASH_FACTOR;product-=Math.floor(product);}
 +return urls[Math.floor(product*urls.length)];},getFullRequestString:function(newParams,altUrl){var \
url=altUrl||this.url;var \
allParams=OpenLayers.Util.extend({},this.params);allParams=OpenLayers.Util.extend(allParams,newParams);var \
paramsString=OpenLayers.Util.getParameterString(allParams);if(url instanceof \
Array){url=this.selectUrl(paramsString,url);} +var \
urlParams=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(url));for(var \
key in allParams){if(key.toUpperCase()in urlParams){delete allParams[key];}} \
+paramsString=OpenLayers.Util.getParameterString(allParams);var \
requestString=url;if(paramsString!=""){var \
lastServerChar=url.charAt(url.length-1);if((lastServerChar=="&")||(lastServerChar=="?" \
)){requestString+=paramsString;}else{if(url.indexOf('?')==-1){requestString+='?'+paramsString;}else{requestString+='&'+paramsString;}}}
 +return requestString;},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"});OpenLayers.Layer. \
Image=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:true,url:null,extent:null,size:nu \
ll,tile:null,aspectRatio:null,initialize:function(name,url,extent,size,options){this.u \
rl=url;this.extent=extent;this.size=size;OpenLayers.Layer.prototype.initialize.apply(t \
his,[name,options]);this.aspectRatio=(this.extent.getHeight()/this.size.h)/(this.exten \
t.getWidth()/this.size.w);},destroy:function(){if(this.tile){this.tile.destroy();this.tile=null;}
 +OpenLayers.Layer.prototype.destroy.apply(this,arguments);},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Layer.Image(this.name,this.url,this.extent,this.size,this.options);} \
+obj=OpenLayers.Layer.prototype.clone.apply(this,[obj]);return \
obj;},setMap:function(map){if(this.options.maxResolution==null){this.options.maxResolution=this.aspectRatio*this.extent.getWidth()/this.size.w;}
 +OpenLayers.Layer.prototype.setMap.apply(this,arguments);},moveTo:function(bounds,zoomChanged,dragging){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var \
firstRendering=(this.tile==null);if(zoomChanged||firstRendering){this.setTileSize();var \
ul=new OpenLayers.LonLat(this.extent.left,this.extent.top);var \
ulPx=this.map.getLayerPxFromLonLat(ul);if(firstRendering){this.tile=new \
OpenLayers.Tile.Image(this,ulPx,this.extent,null,this.tileSize);}else{this.tile.size=this.tileSize.clone();this.tile.position=ulPx.clone();}
 +this.tile.draw();}},setTileSize:function(){var \
tileWidth=this.extent.getWidth()/this.map.getResolution();var \
tileHeight=this.extent.getHeight()/this.map.getResolution();this.tileSize=new \
OpenLayers.Size(tileWidth,tileHeight);},setUrl:function(newUrl){this.url=newUrl;this.tile.draw();},getURL:function(bounds){return \
this.url;},CLASS_NAME:"OpenLayers.Layer.Image"});OpenLayers.Layer.Markers=OpenLayers.C \
lass(OpenLayers.Layer,{isBaseLayer:false,markers:null,drawn:false,initialize:function( \
name,options){OpenLayers.Layer.prototype.initialize.apply(this,arguments);this.markers \
=[];},destroy:function(){this.clearMarkers();this.markers=null;OpenLayers.Layer.protot \
ype.destroy.apply(this,arguments);},setOpacity:function(opacity){if(opacity!=this.opacity){this.opacity=opacity;for(var \
i=0;i<this.markers.length;i++){this.markers[i].setOpacity(this.opacity);}}},moveTo:fun \
ction(bounds,zoomChanged,dragging){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(zoomChanged||!this.drawn){fo
  r(var i=0;i<this.markers.length;i++){this.drawMarker(this.markers[i]);}
+this.drawn=true;}},addMarker:function(marker){this.markers.push(marker);if(this.opacity!=null){marker.setOpacity(this.opacity);}
 +if(this.map&&this.map.getExtent()){marker.map=this.map;this.drawMarker(marker);}},re \
moveMarker:function(marker){if(this.markers&&this.markers.length){OpenLayers.Util.remo \
veItem(this.markers,marker);if((marker.icon!=null)&&(marker.icon.imageDiv!=null)&&(mar \
ker.icon.imageDiv.parentNode==this.div)){this.div.removeChild(marker.icon.imageDiv);ma \
rker.drawnúlse;}}},clearMarkers:function(){if(this.markers!=null){while(this.markers.length>0){this.removeMarker(this.markers[0]);}}},drawMarker:function(marker){var \
px=this.map.getLayerPxFromLonLat(marker.lonlat);if(px==null){marker.display(false);}else{var \
markerImg=marker.draw(px);if(!marker.drawn){this.div.appendChild(markerImg);marker.drawn=true;}}},getDataExtent:function(){var \
maxExtent=null;if(this.markers&&(this.markers.length>0)){var maxExtent=new \
OpenLayers.Bounds();for(var i=0;i<this.markers.length;i++){var \
marker=this.markers[i];maxExtent.extend(marker.lonlat);}} +return \
maxExtent;},CLASS_NAME:"OpenLayers.Layer.Markers"});OpenLayers.Layer.SphericalMercator={getExtent:function(){var \
extent=null;if(this.sphericalMercator){extent=this.map.calculateBounds();}else{extent=OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this);}
 +return extent;},initMercatorParameters:function(){this.RESOLUTIONS=[];var \
maxResolution6543.0339;for(var \
zoom=0;zoom<=this.MAX_ZOOM_LEVEL;++zoom){this.RESOLUTIONS[zoom]=maxResolution/Math.pow(2,zoom);}
 +this.units="m";this.projection="EPSG:900913";},forwardMercator:function(lon,lat){var \
x=lon*20037508.34/180;var \
y=Math.log(Math.tan((90+lat)*Math.PI/360))/(Math.PI/180);y=y*20037508.34/180;return \
new OpenLayers.LonLat(x,y);},inverseMercator:function(x,y){var \
lon=(x/20037508.34)*180;var \
lat=(y/20037508.34)*180;lat0/Math.PI*(2*Math.atan(Math.exp(lat*Math.PI/180))-Math.PI/2);return \
new OpenLayers.LonLat(lon,lat);},projectForward:function(point){var \
lonlat=OpenLayers.Layer.SphericalMercator.forwardMercator(point.x,point.y);point.x=lonlat.lon;point.y=lonlat.lat;return \
point;},projectInverse:function(point){var \
lonlat=OpenLayers.Layer.SphericalMercator.inverseMercator(point.x,point.y);point.x=lonlat.lon;point.y=lonlat.lat;return \
point;}};OpenLayers.Projection.addTransform("EPSG:4326","EPSG:900913",OpenLayers.Layer \
.SphericalMercator.projectForward);OpenLayers.Projection.addTransform("EPSG:900913","E \
PSG:4326",OpenLayers.Layer.SphericalMercator.projectInverse);OpenLayers.Control.Dr  \
awFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,featureAdded: \
function(){},handlerOptions:null,initialize:function(layer,handler,options){OpenLayers \
.Control.prototype.initialize.apply(this,[options]);this.callbacks=OpenLayers.Util.extend({done:this.drawFeature},this.callbacks);this.layer=layer;this.handler=new \
handler(this,this.callbacks,this.handlerOptions);},drawFeature:function(geometry){var \
feature=new OpenLayers.Feature.Vector(geometry);this.layer.addFeatures([feature]);this \
.featureAdded(feature);},CLASS_NAME:"OpenLayers.Control.DrawFeature"});OpenLayers.Cont \
rol.SelectFeature=OpenLayers.Class(OpenLayers.Control,{multipleKey:null,toggleKey:null \
,multiple:false,clickout:true,toggle:false,hover:false,onSelect:function(){},onUnselec \
t:function(){},geometryTypes:null,layer:null,callbacks:null,selectStyle:null,renderInt \
ent:"select",handler:null,initialize:function(layer,options){OpenLayers.Control.prototype.initialize.apply(this,[options]);this.layer=lay
  er;this.callbacks=OpenLayers.Util.extend({click:this.clickFeature,clickout:this.clickoutFeature,over:this.overFeature,out:this.outFeature},this.callbacks);var \
handlerOptions={geometryTypes:this.geometryTypes};this.handler=new \
OpenLayers.Handler.Feature(this,layer,this.callbacks,handlerOptions);},unselectAll:function(options){var \
feature;for(var i=this.layer.selectedFeatures.length-1;i>=0;--i){feature=this.layer.se \
lectedFeatures[i];if(!options||options.except!þature){this.unselect(feature);}}},clickFeature:function(feature){if(!this.hover){var \
selected=(OpenLayers.Util.indexOf(this.layer.selectedFeatures,feature)>-1);if(selected){if(this.toggleSelect()){this.unselect(feature);}else \
if(!this.multipleSelect()){this.unselectAll({except:feature});}}else{if(!this.multipleSelect()){this.unselectAll({except:feature});}
 +this.select(feature);}}},multipleSelect:function(){return \
this.multiple||this.handler.evt[this.multipleKey];},toggleSelect:function(){return \
this.toggle||this.handler.evt[this.toggleKey];},clickoutFeature:function(feature){if(! \
this.hover&&this.clickout){this.unselectAll();}},overFeature:function(feature){if(this \
.hover&&(OpenLayers.Util.indexOf(this.layer.selectedFeatures,feature)==-1)){this.selec \
t(feature);}},outFeature:function(feature){if(this.hover){this.unselect(feature);}},select:function(feature){this.layer.selectedFeatures.push(feature);var \
selectStyle=this.selectStyle||this.renderIntent;this.layer.drawFeature(feature,selectS \
tyle);this.layer.events.triggerEvent("featureselected",{feature:feature});this.onSelec \
t(feature);},unselect:function(feature){this.layer.drawFeature(feature,"default");Open \
Layers.Util.removeItem(this.layer.selectedFeatures,feature);this.layer.events.triggerE \
vent("featureunselected",{feature:feature});this.onUnselect(feature);},setMap:function(map)
  {this.handler.setMap(map);OpenLayers.Control.prototype.setMap.apply(this,arguments); \
},CLASS_NAME:"OpenLayers.Control.SelectFeature"});OpenLayers.Control.ZoomBox=OpenLayer \
s.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:false,draw:function(){this.handler=new \
OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask});},zoomBox:function(position){if(position \
instanceof OpenLayers.Bounds){if(!this.out){var minXY=this.map.getLonLatFromPixel(new \
OpenLayers.Pixel(position.left,position.bottom));var \
maxXY=this.map.getLonLatFromPixel(new \
OpenLayers.Pixel(position.right,position.top));var bounds=new \
OpenLayers.Bounds(minXY.lon,minXY.lat,maxXY.lon,maxXY.lat);}else{var \
pixWidth=Math.abs(position.right-position.left);var \
pixHeight=Math.abs(position.top-position.bottom);var \
zoomFactor=Math.min((this.map.size.h/pixHeight),(this.map.size.w/pixWidth));var \
extent=this.map.getExtent();var \
center=this.map.getLonLatFromPixel(position.getCenterPixel());var xminÎnte  \
r.lon-(extent.getWidth()/2)*zoomFactor;var \
xmaxÎnter.lon+(extent.getWidth()/2)*zoomFactor;var \
yminÎnter.lat-(extent.getHeight()/2)*zoomFactor;var \
ymaxÎnter.lat+(extent.getHeight()/2)*zoomFactor;var bounds=new \
OpenLayers.Bounds(xmin,ymin,xmax,ymax);} \
+this.map.zoomToExtent(bounds);}else{if(!this.out){this.map.setCenter(this.map.getLonL \
atFromPixel(position),this.map.getZoom()+1);}else{this.map.setCenter(this.map.getLonLa \
tFromPixel(position),this.map.getZoom()-1);}}},CLASS_NAME:"OpenLayers.Control.ZoomBox" \
});OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(optio \
ns){this.regExes={'typeStr':/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,'spaces':/\s+/,'parenComm \
a':/\)\s*,\s*\(/,'doubleParenComma':/\)\s*\)\s*,\s*\(\s*\(/,'trimParens':/^\s*\(?(.*?) \
\)?\s*$/};OpenLayers.Format.prototype.initialize.apply(this,[options]);},read:function(wkt){var \
features,type,str;var \
matches=this.regExes.typeStr.exec(wkt);if(matches){type=matches[1].toLowerCase();str=matches[2];if(this.parse[type]){features=this.parse[type].apply(this,[str]);}
 +if(this.internalProjection&&this.externalProjection){if(features&&features.CLASS_NAM \
E=="OpenLayers.Feature.Vector"){features.geometry.transform(this.externalProjection,this.internalProjection);}else \
if(features&&typeof features=="object"){for(var i=0;i<features.length;i++){var \
componentþatures[i];component.geometry.transform(this.externalProjection,this.internalProjection);}}}}
 +return features;},write:function(features){var \
collection,geometry,type,data,isCollection;if(features.constructor==Array){collectionþatures;isCollection=true;}else{collection=[features];isCollectionúlse;}
 +var pieces=[];if(isCollection){pieces.push('GEOMETRYCOLLECTION(');}
+for(var i=0;i<collection.length;++i){if(isCollection&&i>0){pieces.push(',');}
+geometry=collection[i].geometry;type=geometry.CLASS_NAME.split('.')[2].toLowerCase();if(!this.extract[type]){return \
null;} +if(this.internalProjection&&this.externalProjection){geometry=geometry.clone();geometry.transform(this.internalProjection,this.externalProjection);}
 +data=this.extract[type].apply(this,[geometry]);pieces.push(type.toUpperCase()+'('+data+')');}
 +if(isCollection){pieces.push(')');}
+return pieces.join('');},extract:{'point':function(point){return point.x+' \
'+point.y;},'multipoint':function(multipoint){var array=[];for(var \
i=0;i<multipoint.components.length;++i){array.push(this.extract.point.apply(this,[multipoint.components[i]]));}
 +return array.join(',');},'linestring':function(linestring){var array=[];for(var \
i=0;i<linestring.components.length;++i){array.push(this.extract.point.apply(this,[linestring.components[i]]));}
 +return array.join(',');},'multilinestring':function(multilinestring){var \
array=[];for(var i=0;i<multilinestring.components.length;++i){array.push('('+ \
+this.extract.linestring.apply(this,[multilinestring.components[i]])+')');} +return \
array.join(',');},'polygon':function(polygon){var array=[];for(var \
i=0;i<polygon.components.length;++i){array.push('('+ \
+this.extract.linestring.apply(this,[polygon.components[i]])+')');} +return \
array.join(',');},'multipolygon':function(multipolygon){var array=[];for(var \
i=0;i<multipolygon.components.length;++i){array.push('('+ \
+this.extract.polygon.apply(this,[multipolygon.components[i]])+')');} +return \
array.join(',');}},parse:{'point':function(str){var \
coords=OpenLayers.String.trim(str).split(this.regExes.spaces);return new \
OpenLayers.Feature.Vector(new \
OpenLayers.Geometry.Point(coords[0],coords[1]));},'multipoint':function(str){var \
points=OpenLayers.String.trim(str).split(',');var components=[];for(var \
i=0;i<points.length;++i){components.push(this.parse.point.apply(this,[points[i]]).geometry);}
 +return new OpenLayers.Feature.Vector(new \
OpenLayers.Geometry.MultiPoint(components));},'linestring':function(str){var \
points=OpenLayers.String.trim(str).split(',');var components=[];for(var \
i=0;i<points.length;++i){components.push(this.parse.point.apply(this,[points[i]]).geometry);}
 +return new OpenLayers.Feature.Vector(new \
OpenLayers.Geometry.LineString(components));},'multilinestring':function(str){var \
line;var lines=OpenLayers.String.trim(str).split(this.regExes.parenComma);var \
components=[];for(var \
i=0;i<lines.length;++i){line=lines[i].replace(this.regExes.trimParens,'$1');components.push(this.parse.linestring.apply(this,[line]).geometry);}
 +return new OpenLayers.Feature.Vector(new \
OpenLayers.Geometry.MultiLineString(components));},'polygon':function(str){var \
ring,linestring,linearring;var \
rings=OpenLayers.String.trim(str).split(this.regExes.parenComma);var \
components=[];for(var \
i=0;i<rings.length;++i){ring=rings[i].replace(this.regExes.trimParens,'$1');linestring=this.parse.linestring.apply(this,[ring]).geometry;linearring=new \
OpenLayers.Geometry.LinearRing(linestring.components);components.push(linearring);} \
+return new OpenLayers.Feature.Vector(new \
OpenLayers.Geometry.Polygon(components));},'multipolygon':function(str){var \
polygon;var polygons=OpenLayers.String.trim(str).split(this.regExes.doubleParenComma);var \
components=[];for(var \
i=0;i<polygons.length;++i){polygon=polygons[i].replace(this.regExes.trimParens,'$1');components.push(this.parse.polygon.apply(this,[polygon]).geometry);}
 +return new OpenLayers.Feature.Vector(new \
OpenLayers.Geometry.MultiPolygon(components));},'geometrycollection':function(str){str=str.replace(/,\s*([A-Za-z])/g,'|$1');var \
wktArray=OpenLayers.String.trim(str).split('|');var components=[];for(var \
i=0;i<wktArray.length;++i){components.push(OpenLayers.Format.WKT.prototype.read.apply(this,[wktArray[i]]));}
 +return components;}},CLASS_NAME:"OpenLayers.Format.WKT"});OpenLayers.Layer.Boxes=Ope \
nLayers.Class(OpenLayers.Layer.Markers,{initialize:function(name,options){OpenLayers.L \
ayer.Markers.prototype.initialize.apply(this,arguments);},drawMarker:function(marker){var \
bounds=marker.bounds;var topleft=this.map.getLayerPxFromLonLat(new \
OpenLayers.LonLat(bounds.left,bounds.top));var \
botright=this.map.getLayerPxFromLonLat(new \
OpenLayers.LonLat(bounds.right,bounds.bottom));if(botright==null||topleft==null){marker.display(false);}else{var \
sz=new OpenLayers.Size(Math.max(1,botright.x-topleft.x),Math.max(1,botright.y-topleft.y));var \
markerDiv=marker.draw(topleft,sz);if(!marker.drawn){this.div.appendChild(markerDiv);ma \
rker.drawn=true;}}},removeMarker:function(marker){OpenLayers.Util.removeItem(this.mark \
ers,marker);if((marker.div!=null)&&(marker.div.parentNode==this.div)){this.div.removeC \
hild(marker.div);}},CLASS_NAME:"OpenLayers.Layer.Boxes"});OpenLayers.Layer.GeoRSS=OpenLayers.Class(OpenLaye
  rs.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:nul \
l,icon:null,popupSize:null,useFeedTitle:true,initialize:function(name,location,options \
){OpenLayers.Layer.Markers.prototype.initialize.apply(this,[name,options]);this.locati \
on=location;this.features=[];},destroy:function(){OpenLayers.Layer.Markers.prototype.d \
estroy.apply(this,arguments);this.clearFeatures();this.features=null;},loadRSS:functio \
n(){if(!this.loaded){this.events.triggerEvent("loadstart");OpenLayers.loadURL(this.loc \
ation,null,this,this.parseData);this.loaded=true;}},moveTo:function(bounds,zoomChanged \
,minor){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);if(this.visibi \
lity&&!this.loaded){this.events.triggerEvent("loadstart");this.loadRSS();}},parseData:function(ajaxRequest){var \
doc=ajaxRequest.responseXML;if(!doc||!doc.documentElement){doc=OpenLayers.Format.XML.prototype.read(ajaxRequest.responseText);}
 +if(this.useFeedTitle){var \
name=null;try{name=doc.getElementsByTagNameNS('*','title')[0].firstChild.nodeValue;} \
+catch(e){name=doc.getElementsByTagName('title')[0].firstChild.nodeValue;} \
+if(name){this.setName(name);}} +var \
options={};OpenLayers.Util.extend(options,this.formatOptions);if(this.map&&!this.proje \
ction.equals(this.map.getProjectionObject())){options.externalProjection=this.projection;options.internalProjection=this.map.getProjectionObject();}
 +var format=new OpenLayers.Format.GeoRSS(options);var \
features=format.read(doc);for(var i=0;i<features.length;i++){var data={};var \
featureþatures[i];if(!feature.geometry){continue;} +var \
titleþature.attributes.title?feature.attributes.title:"Untitled";var \
descriptionþature.attributes.description?feature.attributes.description:"No \
description.";var linkþature.attributes.link?feature.attributes.link:"";var \
locationþature.geometry.getBounds().getCenterLonLat();data.icon=this.icon==null?OpenLa \
yers.Marker.defaultIcon():this.icon.clone();data.popupSize=this.popupSize?this.popupSize.clone():new \
OpenLayers.Size(250,120);if(title||description){var contentHTML='<div \
class="olLayerGeoRSSClose">[x]</div>';contentHTML+='<div \
class="olLayerGeoRSSTitle">';if(link){contentHTML+='<a class="link" href="'+link+'" \
target="_blank">';} +contentHTML+=title;if(link){contentHTML+='</a>';}
+contentHTML+='</div>';contentHTML+='<div style="" \
class="olLayerGeoRSSDescription">';contentHTML+Þscription;contentHTML+='</div>';data['popupContentHTML']=contentHTML;}
 +var feature=new OpenLayers.Feature(this,location,data);this.features.push(feature);var \
markerþature.createMarker();marker.events.register('click',feature,this.markerClick);this.addMarker(marker);}
 +this.events.triggerEvent("loadend");},markerClick:function(evt){var \
sameMarkerClicked=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!sameMarkerClicked)?this:null;for(var \
i=0;i<this.layer.map.popups.length;i++){this.layer.map.removePopup(this.layer.map.popups[i]);}
 +if(!sameMarkerClicked){var \
popup=this.createPopup();OpenLayers.Event.observe(popup.div,"click",OpenLayers.Function.bind(function(){for(var \
i=0;i<this.layer.map.popups.length;i++){this.layer.map.removePopup(this.layer.map.popups[i]);}},this));this.layer.map.addPopup(popup);}
 +OpenLayers.Event.stop(evt);},clearFeatures:function(){if(this.features!=null){while(this.features.length>0){var \
feature=this.features[0];OpenLayers.Util.removeItem(this.features,feature);feature.des \
troy();}}},CLASS_NAME:"OpenLayers.Layer.GeoRSS"});OpenLayers.Layer.Google=OpenLayers.C \
lass(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX \
_ZOOM_LEVEL:19,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.043945 \
3125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0 \
.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.000 \
04291534423828125,0.00002145767211914062,0.00001072883605957031,0.00000536441802978515 \
,0.00000268220901489257],type:null,sphericalMercator:false,dragObject:null,initialize: \
function(name,options){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,argu \
ments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);this.addContainerPxF
  unction();if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.Sp \
hericalMercator);this.initMercatorParameters();}},loadMapObject:function(){try{this.mapObject=new \
GMap2(this.div);if(typeof \
this.mapObject.getDragObject=="function"){this.dragObject=this.mapObject.getDragObject();}else{this.dragPanMapObject=null;}
 +var poweredBy=this.div.lastChild;this.div.removeChild(poweredBy);this.pane.appendChild(poweredBy);poweredBy.className="olLayerGooglePoweredBy \
gmnoprint";poweredBy.style.left="";poweredBy.style.bottom="";var \
termsOfUse=this.div.lastChild;this.div.removeChild(termsOfUse);this.pane.appendChild(t \
ermsOfUse);termsOfUse.className="olLayerGoogleCopyright";termsOfUse.style.right="";ter \
msOfUse.style.bottom="";}catch(e){OpenLayers.Console.error(e);}},setMap:function(map){ \
OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);if(this.type!=null){ \
this.map.events.register("moveend",this,this.setMapType);}},setMapType:function(){if(t \
his.mapObject.getCenter()!=null){if(OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)==-1){this.mapObject.addMapType(this.type);}
 +this.mapObject.setMapType(this.type);this.map.events.unregister("moveend",this,this. \
setMapType);}},onMapResize:function(){this.mapObject.checkResize();},getOLBoundsFromMapObjectBounds:function(moBounds){var \
olBounds=null;if(moBounds!=null){var sw=moBounds.getSouthWest();var \
ne=moBounds.getNorthEast();if(this.sphericalMercator){sw=this.forwardMercator(sw.lng(),sw.lat());ne=this.forwardMercator(ne.lng(),ne.lat());}else{sw=new \
OpenLayers.LonLat(sw.lng(),sw.lat());ne=new OpenLayers.LonLat(ne.lng(),ne.lat());} \
+olBounds=new OpenLayers.Bounds(sw.lon,sw.lat,ne.lon,ne.lat);} +return \
olBounds;},getMapObjectBoundsFromOLBounds:function(olBounds){var \
moBounds=null;if(olBounds!=null){var \
sw=this.sphericalMercator?this.inverseMercator(olBounds.bottom,olBounds.left):new \
OpenLayers.LonLat(olBounds.bottom,olBounds.left);var \
ne=this.sphericalMercator?this.inverseMercator(olBounds.top,olBounds.right):new \
OpenLayers.LonLat(olBounds.top,olBounds.right);moBounds=new GLatLngBounds(new \
GLatLng(sw.lat,sw.lon),new GLatLng(ne.lat,ne.lon));} +return \
moBounds;},addContainerPxFunction:function(){if((typeof \
GMap2!="undefined")&&!GMap2.prototype.fromLatLngToContainerPixel){GMap2.prototype.fromLatLngToContainerPixel=function(gLatLng){var \
gPoint=this.fromLatLngToDivPixel(gLatLng);var \
div=this.getContainer().firstChild.firstChild;gPoint.x+=div.offsetLeft;gPoint.y+=div.offsetTop;return \
gPoint;};}},getWarningHTML:function(){return \
OpenLayers.i18n("googleWarning");},setMapObjectCenter:function(center,zoom){this.mapOb \
ject.setCenter(center,zoom);},dragPanMapObject:function(dX,dY){this.dragObject.moveBy(new \
GSize(-dX,dY));},getMapObjectCenter:function(){return \
this.mapObject.getCenter();},getMapObjectZoom:function(){return \
this.mapObject.getZoom();},getMapObjectLonLatFromMapObjectPixel:function(moPixel){return \
this.mapObject.fromContainerPixelToLatLng(moPixel);},getMapObjectPixelFromMapObjectLonLat:function(moLonLat){return \
this.mapObject.fromLatLngToContainerPixel(moLonLat);},getMapObjectZoomFromMapObjectBounds:function(moBo
  unds){return this.mapObject.getBoundsZoomLevel(moBounds);},getLongitudeFromMapObjectLonLat:function(moLonLat){return \
this.sphericalMercator?this.forwardMercator(moLonLat.lng(),moLonLat.lat()).lon:moLonLat.lng();},getLatitudeFromMapObjectLonLat:function(moLonLat){var \
lat=this.sphericalMercator?this.forwardMercator(moLonLat.lng(),moLonLat.lat()).lat:moLonLat.lat();return \
lat;},getMapObjectLonLatFromLonLat:function(lon,lat){var \
gLatLng;if(this.sphericalMercator){var \
lonlat=this.inverseMercator(lon,lat);gLatLng=new \
GLatLng(lonlat.lat,lonlat.lon);}else{gLatLng=new GLatLng(lat,lon);} +return \
gLatLng;},getXFromMapObjectPixel:function(moPixel){return \
moPixel.x;},getYFromMapObjectPixel:function(moPixel){return \
moPixel.y;},getMapObjectPixelFromXY:function(x,y){return new \
GPoint(x,y);},CLASS_NAME:"OpenLayers.Layer.Google"});OpenLayers.Layer.Grid=OpenLayers. \
Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,grid:null,singleTile:false,ratio:1.5 \
,buffer:2,numLoadingTiles:0,initialize:function(name,url,params,options){OpenLayers.La \
yer.HTTPRequest.prototype.initialize.apply(this,arguments);this.events.addEventType("t \
ileloaded");this.grid=[];},destroy:function(){this.clearGrid();this.grid=null;this.til \
eSize=null;OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments);},clearGrid:function(){if(this.grid){for(var \
iRow=0;iRow<this.grid.length;iRow++){var row=this.grid[iRow];for(var \
iCol=0;iCol<row.length;iCol++){var \
tile=row[iCol];this.removeTileMonitoringHooks(tile);tile.destroy();}} \
+this.grid=[];}},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Layer.Grid(this.name,this.url,this.params,this.options);} \
+obj=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[obj]);if(this.tileSize!=null){obj.tileSize=this.tileSize.clone();}
 +obj.grid=[];return \
obj;},moveTo:function(bounds,zoomChanged,dragging){OpenLayers.Layer.HTTPRequest.protot \
ype.moveTo.apply(this,arguments);bounds=bounds||this.map.getExtent();if(bounds!=null){var \
forceReTile=!this.grid.length||zoomChanged;var \
tilesBounds=this.getTilesBounds();if(this.singleTile){if(forceReTile||(!dragging&&!til \
esBounds.containsBounds(bounds))){this.initSingleTile(bounds);}}else{if(forceReTile||! \
tilesBounds.containsBounds(bounds,true)){this.initGriddedTiles(bounds);}else{this.move \
GriddedTiles(bounds);}}}},setTileSize:function(size){if(this.singleTile){size=this.map \
.getSize().clone();size.h=parseInt(size.h*this.ratio);size.w=parseInt(size.w*this.ratio);}
 +OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[size]);},getGridBounds:function(){var \
msg="The getGridBounds() function is deprecated. It will be "+"removed in 3.0. Please \
use getTilesBounds() instead.";OpenLayers.Console.warn(msg);return \
this.getTilesBounds();},getTilesBounds:function(){var \
bounds=null;if(this.grid.length){var bottom=this.grid.length-1;var \
bottomLeftTile=this.grid[bottom][0];var right=this.grid[0].length-1;var \
topRightTile=this.grid[0][right];bounds=new \
OpenLayers.Bounds(bottomLeftTile.bounds.left,bottomLeftTile.bounds.bottom,topRightTile.bounds.right,topRightTile.bounds.top);}
 +return bounds;},initSingleTile:function(bounds){var \
center=bounds.getCenterLonLat();var tileWidth=bounds.getWidth()*this.ratio;var \
tileHeight=bounds.getHeight()*this.ratio;var tileBounds=new \
OpenLayers.Bounds(center.lon-(tileWidth/2),center.lat-(tileHeight/2),center.lon+(tileWidth/2),center.lat+(tileHeight/2));var \
ul=new OpenLayers.LonLat(tileBounds.left,tileBounds.top);var \
px=this.map.getLayerPxFromLonLat(ul);if(!this.grid.length){this.grid[0]=[];} +var \
tile=this.grid[0][0];if(!tile){tile=this.addTile(tileBounds,px);this.addTileMonitoringHooks(tile);tile.draw();this.grid[0][0]=tile;}else{tile.moveTo(tileBounds,px);}
 +this.removeExcessTiles(1,1);},calculateGridLayout:function(bounds,extent,resolution){var \
tilelon=resolution*this.tileSize.w;var tilelat=resolution*this.tileSize.h;var \
offsetlon=bounds.left-extent.left;var \
tilecol=Math.floor(offsetlon/tilelon)-this.buffer;var \
tilecolremain=offsetlon/tilelon-tilecol;var \
tileoffsetx=-tilecolremain*this.tileSize.w;var \
tileoffsetlon=extent.left+tilecol*tilelon;var \
offsetlat=bounds.top-(extent.bottom+tilelat);var \
tilerow=Math.ceil(offsetlat/tilelat)+this.buffer;var \
tilerowremain=tilerow-offsetlat/tilelat;var \
tileoffsety=-tilerowremain*this.tileSize.h;var \
tileoffsetlat=extent.bottom+tilerow*tilelat;return{tilelon:tilelon,tilelat:tilelat,til \
eoffsetlon:tileoffsetlon,tileoffsetlat:tileoffsetlat,tileoffsetx:tileoffsetx,tileoffsety:tileoffsety};},initGriddedTiles:function(bounds){var \
viewSize=this.map.getSize();var minRows=Math.ceil(viewSize.h/this.tileSize.h)+ \
+Math.max(1,2*this.buffer);var minCols=Math.ceil(viewSize.w/this.tileSize.w)+ \
+Math.max(1,2*this.buffer);var extent=this.map.getMaxExtent();var \
resolution=this.map.getResolution();var \
tileLayout=this.calculateGridLayout(bounds,extent,resolution);var \
tileoffsetx=Math.round(tileLayout.tileoffsetx);var \
tileoffsety=Math.round(tileLayout.tileoffsety);var \
tileoffsetlon=tileLayout.tileoffsetlon;var tileoffsetlat=tileLayout.tileoffsetlat;var \
tilelon=tileLayout.tilelon;var tilelat=tileLayout.tilelat;this.origin=new \
OpenLayers.Pixel(tileoffsetx,tileoffsety);var startX=tileoffsetx;var \
startLon=tileoffsetlon;var rowidx=0;var \
layerContainerDivLeft=parseInt(this.map.layerContainerDiv.style.left);var \
layerContainerDivTop=parseInt(this.map.layerContainerDiv.style.top);do{var \
row=this.grid[rowidx++];if(!row){row=[];this.grid.push(row);} \
+tileoffsetlon=startLon;tileoffsetx=startX;var colidx=0;do{var tileBounds=new \
OpenLayers.Bounds(tileoffsetlon,tileoffsetlat,tileoffsetlon+tilelon,tileoffsetlat+tilelat);var \
x=tileoffsetx;x-=layerContainerDivLeft;var y=tileoffsety;y-=layerContainerDivTop;var \
px=new OpenLayers.Pixel(x,y);var \
tile=row[colidx++];if(!tile){tile=this.addTile(tileBounds,px);this.addTileMonitoringHooks(tile);row.push(tile);}else{tile.moveTo(tileBounds,px,false);}
 +tileoffsetlon+=tilelon;tileoffsetx+=this.tileSize.w;}while((tileoffsetlon<=bounds.right+tilelon*this.buffer)||colidx<minCols)
 +tileoffsetlat-=tilelat;tileoffsety+=this.tileSize.h;}while((tileoffsetlat>=bounds.bottom-tilelat*this.buffer)||rowidx<minRows)
 +this.removeExcessTiles(rowidx,colidx);this.spiralTileLoad();},spiralTileLoad:function(){var \
tileQueue=[];var directions=["right","down","left","up"];var iRow=0;var iCell=-1;var \
direction=OpenLayers.Util.indexOf(directions,"right");var \
directionsTried=0;while(directionsTried<directions.length){var testRow=iRow;var \
testCell=iCell;switch(directions[direction]){case"right":testCell++;break;case"down":testRow++;break;case"left":testCell--;break;case"up":testRow--;break;}
 +var tile=null;if((testRow<this.grid.length)&&(testRow>=0)&&(testCell<this.grid[0].length)&&(testCell>=0)){tile=this.grid[testRow][testCell];}
 +if((tile!=null)&&(!tile.queued)){tileQueue.unshift(tile);tile.queued=true;directions \
Tried=0;iRow=testRow;iCell=testCell;}else{direction=(direction+1)%4;directionsTried++;}}
 +for(var i=0;i<tileQueue.length;i++){var \
tile=tileQueue[i];tile.draw();tile.queuedúlse;}},addTile:function(bounds,position){},a \
ddTileMonitoringHooks:function(tile){tile.onLoadStart=function(){if(this.numLoadingTiles==0){this.events.triggerEvent("loadstart");}
 +this.numLoadingTiles++;};tile.events.register("loadstart",this,tile.onLoadStart);til \
e.onLoadEnd=function(){this.numLoadingTiles--;this.events.triggerEvent("tileloaded");i \
f(this.numLoadingTiles==0){this.events.triggerEvent("loadend");}};tile.events.register \
("loadend",this,tile.onLoadEnd);tile.events.register("unload",this,tile.onLoadEnd);},r \
emoveTileMonitoringHooks:function(tile){tile.unload();tile.events.un({"loadstart":tile \
.onLoadStart,"loadend":tile.onLoadEnd,"unload":tile.onLoadEnd,scope:this});},moveGriddedTiles:function(bounds){var \
buffer=this.buffer||1;while(true){var tlLayer=this.grid[0][0].position;var \
tlViewPort=this.map.getViewPortPxFromLayerPx(tlLayer);if(tlViewPort.x>-this.tileSize.w*(buffer-1)){this.shiftColumn(true);}else \
if(tlViewPort.x<-this.tileSize.w*buffer){this.shiftColumn(false);}else \
if(tlViewPort.y>-this.tileSize.h*(buffer-1)){this.shiftRow(true);}else \
if(tlViewPort.y<-this.tileSize.h*buffer){this.shiftRow(false);}else{break;}};},shiftRow:function(prep
  end){var modelRowIndex=(prepend)?0:(this.grid.length-1);var grid=this.grid;var \
modelRow=grid[modelRowIndex];var resolution=this.map.getResolution();var \
deltaY=(prepend)?-this.tileSize.h:this.tileSize.h;var deltaLat=resolution*-deltaY;var \
row=(prepend)?grid.pop():grid.shift();for(var i=0;i<modelRow.length;i++){var \
modelTile=modelRow[i];var bounds=modelTile.bounds.clone();var \
position=modelTile.position.clone();bounds.bottom=bounds.bottom+deltaLat;bounds.top=bounds.top+deltaLat;position.y=position.y+deltaY;row[i].moveTo(bounds,position);}
 +if(prepend){grid.unshift(row);}else{grid.push(row);}},shiftColumn:function(prepend){var \
deltaX=(prepend)?-this.tileSize.w:this.tileSize.w;var \
resolution=this.map.getResolution();var deltaLon=resolution*deltaX;for(var \
i=0;i<this.grid.length;i++){var row=this.grid[i];var \
modelTileIndex=(prepend)?0:(row.length-1);var modelTile=row[modelTileIndex];var \
bounds=modelTile.bounds.clone();var \
position=modelTile.position.clone();bounds.left=bounds.left+deltaLon;bounds.right=bounds.right+deltaLon;position.x=position.x+deltaX;var \
tile=prepend?this.grid[i].pop():this.grid[i].shift();tile.moveTo(bounds,position);if(p \
repend){row.unshift(tile);}else{row.push(tile);}}},removeExcessTiles:function(rows,columns){while(this.grid.length>rows){var \
row=this.grid.pop();for(var i=0,l=row.length;i<l;i++){var \
tile=row[i];this.removeTileMonitoringHooks(tile);tile.destroy();}} \
+while(this.grid[0].length>columns){for(var i=0,l=this.grid.length;i<l;i++){var \
row=this.grid[i];var \
tile=row.pop();this.removeTileMonitoringHooks(tile);tile.destroy();}}},onMapResize:fun \
ction(){if(this.singleTile){this.clearGrid();this.setTileSize();}},getTileBounds:function(viewPortPx){var \
maxExtent=this.map.getMaxExtent();var resolution=this.getResolution();var \
tileMapWidth=resolution*this.tileSize.w;var \
tileMapHeight=resolution*this.tileSize.h;var \
mapPoint=this.getLonLatFromViewPortPx(viewPortPx);var \
tileLeft=maxExtent.left+(tileMapWidth*Math.floor((mapPoint.lon- \
+maxExtent.left)/tileMapWidth));var \
tileBottom=maxExtent.bottom+(tileMapHeight*Math.floor((mapPoint.lat- \
+maxExtent.bottom)/tileMapHeight));return new \
OpenLayers.Bounds(tileLeft,tileBottom,tileLeft+tileMapWidth,tileBottom+tileMapHeight); \
},CLASS_NAME:"OpenLayers.Layer.Grid"});OpenLayers.Layer.MultiMap=OpenLayers.Class(Open \
Layers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEV \
EL:17,RESOLUTIONS:[9,1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0. \
02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.000686 \
6455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.0000429153 \
4423828125],type:null,initialize:function(name,options){OpenLayers.Layer.EventPane.pro \
totype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.ini \
tialize.apply(this,arguments);if(this.sphericalMercator){OpenLayers.Util.extend(this,O \
penLayers.Layer.SphericalMercator);this.initMercatorParameters();this.RESOLUTIONS.unshift(10);}},loadMapObject:function(){try{this.mapObject=new \
MultimapViewer(this.div);  }catch(e){}},getWarningHTML:function(){return \
OpenLayers.i18n("getLayerWarning",{'layerType':"MM",'layerLib':"MultiMap"});},setMapOb \
jectCenter:function(center,zoom){this.mapObject.goToPosition(center,zoom);},getMapObjectCenter:function(){return \
 ion(lon,lat){var mmLatLon;if(this.sphericalMercator){var \
lonlat=this.inverseMercator(lon,lat);mmLatLon=new \
MMLatLon(lonlat.lat,lonlat.lon);}else{mmLatLon=new MMLatLon(lat,lon);} +return \
mmLatLon;},getXFromMapObjectPixel:function(moPixel){return \
moPixel.x;},getYFromMapObjectPixel:function(moPixel){return \
moPixel.y;},getMapObjectPixelFromXY:function(x,y){return new \
MMPoint(x,y);},CLASS_NAME:"OpenLayers.Layer.MultiMap"});OpenLayers.Layer.Text=OpenLaye \
rs.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,sele \
ctedFeature:null,initialize:function(name,options){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments);this.features=new \
Array();},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arg \
uments);this.clearFeatures();this.features=null;},loadText:function(){if(!this.loaded){if(this.location!=null){var \
onFail=function(e){this.events.triggerEvent("loadend");};this.events.triggerEvent("loa \
dstart");OpenLayers.loadURL(this.location,null,this,this.parseData,onFail);this.loaded \
=true;}}},moveTo:function(bounds,zoomChanged,minor){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);if(t
  his.visibility&&!this.loaded){this.events.triggerEvent("loadstart");this.loadText();}},parseData:function(ajaxRequest){var \
text=ajaxRequest.responseText;var \
options={};OpenLayers.Util.extend(options,this.formatOptions);if(this.map&&!this.proje \
ction.equals(this.map.getProjectionObject())){options.externalProjection=this.projection;options.internalProjection=this.map.getProjectionObject();}
 +var parser=new OpenLayers.Format.Text(options);features=parser.read(text);for(var \
i=0;i<features.length;i++){var data={};var featureþatures[i];var location;var \
iconSize,iconOffset;location=new \
OpenLayers.LonLat(feature.geometry.x,feature.geometry.y);if(feature.style.graphicWidth&&feature.style.graphicHeight){iconSize=new \
OpenLayers.Size(feature.style.graphicWidth,feature.style.graphicHeight);} \
+if(feature.style.graphicXOffset&&feature.style.graphicYOffset){iconOffset=new \
OpenLayers.Pixel(feature.style.graphicXOffset,feature.style.graphicYOffset);} \
+if(feature.style.externalGraphic!=null){data.icon=new \
OpenLayers.Icon(feature.style.externalGraphic,iconSize,iconOffset);}else{data.icon=OpenLayers.Marker.defaultIcon();if(iconSize!=null){data.icon.setSize(iconSize);}}
 +if((feature.attributes.title!=null)&&(feature.attributes.description!=null)){data['p \
opupContentHTML']='<h2>'+feature.attributes.title+'</h2>'+'<p>'+feature.attributes.description+'</p>';}
 +data['overflow']þature.attributes.overflow||"auto";var markerFeature=new \
OpenLayers.Feature(this,location,data);this.features.push(markerFeature);var \
marker=markerFeature.createMarker();if((feature.attributes.title!=null)&&(feature.attr \
ibutes.description!=null)){marker.events.register('click',markerFeature,this.markerClick);}
 +this.addMarker(marker);}
+this.events.triggerEvent("loadend");},markerClick:function(evt){var \
sameMarkerClicked=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!sameMarkerClicked)?this:null;for(var \
i=0;i<this.layer.map.popups.length;i++){this.layer.map.removePopup(this.layer.map.popups[i]);}
 +if(!sameMarkerClicked){this.layer.map.addPopup(this.createPopup());}
+OpenLayers.Event.stop(evt);},clearFeatures:function(){if(this.features!=null){while(this.features.length>0){var \
feature=this.features[0];OpenLayers.Util.removeItem(this.features,feature);feature.des \
troy();}}},CLASS_NAME:"OpenLayers.Layer.Text"});OpenLayers.Layer.VirtualEarth=OpenLaye \
rs.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1 \
,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.04 \
39453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.0013732910156 \
25,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0 \
.00004291534423828125],type:null,sphericalMercator:false,initialize:function(name,opti \
ons){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers. \
Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.sphericalMerc \
ator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters();}},
  loadMapObject:function(){var veDiv=OpenLayers.Util.createDiv(this.name);var \
sz=this.map.getSize();veDiv.style.width=sz.w;veDiv.style.height=sz.h;this.div.appendChild(veDiv);try{this.mapObject=new \
VEMap(this.name);}catch(e){} \
+if(this.mapObject!=null){try{this.mapObject.LoadMap(null,null,this.type,true);this.mapObject.AttachEvent("onmousedown",function(){return \
true;});}catch(e){} +this.mapObject.HideDashboard();}
+if(!this.mapObject||!this.mapObject.vemapcontrol||!this.mapObject.vemapcontrol.PanMap||(typeof \
this.mapObject.vemapcontrol.PanMap!="function")){this.dragPanMapObject=null;}},getWarningHTML:function(){return \
OpenLayers.i18n("getLayerWarning",{'layerType':'VE','layerLib':'VirtualEarth'});},setM \
apObjectCenter:function(center,zoom){this.mapObject.SetCenterAndZoom(center,zoom);},getMapObjectCenter:function(){return \
this.mapObject.GetCenter();},dragPanMapObject:function(dX,dY){this.mapObject.vemapcontrol.PanMap(dX,-dY);},getMapObjectZoom:function(){return \
this.mapObject.GetZoomLevel();},getMapObjectLonLatFromMapObjectPixel:function(moPixel){return \
this.mapObject.PixelToLatLong(moPixel.x,moPixel.y);},getMapObjectPixelFromMapObjectLonLat:function(moLonLat){return \
this.mapObject.LatLongToPixel(moLonLat);},getLongitudeFromMapObjectLonLat:function(moLonLat){return \
this.sphericalMercator?this.forwardMercator(moLonLat.Longitude,moLonLat.Latitude).lon:moLonLat.Longitude;},getLatitudeFromM
  apObjectLonLat:function(moLonLat){return \
this.sphericalMercator?this.forwardMercator(moLonLat.Longitude,moLonLat.Latitude).lat:moLonLat.Latitude;},getMapObjectLonLatFromLonLat:function(lon,lat){var \
veLatLong;if(this.sphericalMercator){var \
lonlat=this.inverseMercator(lon,lat);veLatLong=new \
VELatLong(lonlat.lat,lonlat.lon);}else{veLatLong=new VELatLong(lat,lon);} +return \
veLatLong;},getXFromMapObjectPixel:function(moPixel){return \
moPixel.x;},getYFromMapObjectPixel:function(moPixel){return \
moPixel.y;},getMapObjectPixelFromXY:function(x,y){return new \
Msn.VE.Pixel(x,y);},CLASS_NAME:"OpenLayers.Layer.VirtualEarth"});OpenLayers.Layer.Yaho \
o=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZO \
OM_LEVEL:0,MAX_ZOOM_LEVEL:15,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.0878 \
90625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001 \
373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.00008583068 \
84765625,0.00004291534423828125],type:null,sphericalMercator:false,initialize:function \
(name,options){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);O \
penLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.sph \
ericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters();}},
  loadMapObject:function(){try{var \
size=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject=new \
YMap(this.div,this.type,size);this.mapObject.disableKeyControls();this.mapObject.disableDragMap();if(!this.mapObject.moveByXY||(typeof \
this.mapObject.moveByXY!="function")){this.dragPanMapObject=null;}}catch(e){}},onMapResize:function(){try{var \
size=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject.resizeTo(size) \
;}catch(e){}},setMap:function(map){OpenLayers.Layer.EventPane.prototype.setMap.apply(t \
his,arguments);this.map.events.register("moveend",this,this.fixYahooEventPane);},fixYahooEventPane:function(){var \
yahooEventPane=OpenLayers.Util.getElement("ygddfdiv");if(yahooEventPane!=null){if(yaho \
oEventPane.parentNode!=null){yahooEventPane.parentNode.removeChild(yahooEventPane);} \
+this.map.events.unregister("moveend",this,this.fixYahooEventPane);}},getWarningHTML:function(){return \
OpenLayers.i18n("getLayerWarning",{'layerType':'Yahoo','layerLib':'Yahoo'});},getOLZoomFromMapObjectZoom:function(moZoom){var \
zoom=null;if(moZoom!=null){zoom=OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this,[moZoom]);zoom-zoom;}
 +return zoom;},getMapObjectZoomFromOLZoom:function(olZoom){var \
zoom=null;if(olZoom!=null){zoom=OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this,[olZoom]);zoom-zoom;}
 +return zoom;},setMapObjectCenter:function(center,zoom){this.mapObject.drawZoomAndCenter(center,zoom);},getMapObjectCenter:function(){return \
this.mapObject.getCenterLatLon();},dragPanMapObject:function(dX,dY){this.mapObject.moveByXY({'x':-dX,'y':dY});},getMapObjectZoom:function(){return \
this.mapObject.getZoomLevel();},getMapObjectLonLatFromMapObjectPixel:function(moPixel){return \
this.mapObject.convertXYLatLon(moPixel);},getMapObjectPixelFromMapObjectLonLat:function(moLonLat){return \
this.mapObject.convertLatLonXY(moLonLat);},getLongitudeFromMapObjectLonLat:function(moLonLat){return \
this.sphericalMercator?this.forwardMercator(moLonLat.Lon,moLonLat.Lat).lon:moLonLat.Lon;},getLatitudeFromMapObjectLonLat:function(moLonLat){return \
this.sphericalMercator?this.forwardMercator(moLonLat.Lon,moLonLat.Lat).lat:moLonLat.Lat;},getMapObjectLonLatFromLonLat:function(lon,lat){var \
yLatLong;if(this.sphericalMercator){var \
lonlat=this.inverseMercator(lon,lat);yLatLong=new YGeoPoint(lonlat.lat,lon  \
lat.lon);}else{yLatLong=new YGeoPoint(lat,lon);} +return \
yLatLong;},getXFromMapObjectPixel:function(moPixel){return \
moPixel.x;},getYFromMapObjectPixel:function(moPixel){return \
moPixel.y;},getMapObjectPixelFromXY:function(x,y){return new \
YCoordPoint(x,y);},getMapObjectSizeFromOLSize:function(olSize){return new \
YSize(olSize.w,olSize.h);},CLASS_NAME:"OpenLayers.Layer.Yahoo"});OpenLayers.Style=Open \
Layers.Class({name:null,title:null,description:null,layerName:null,isDefault:false,rul \
es:null,context:null,defaultStyle:null,propertyStyles:null,initialize:function(style,o \
ptions){this.rules=[];this.setDefaultStyle(style||OpenLayers.Feature.Vector.style["default"]);OpenLayers.Util.extend(this,options);},destroy:function(){for(var \
i=0;i<this.rules.length;i++){this.rules[i].destroy();this.rules[i]=null;} \
+this.rules=null;this.defaultStyle=null;},createSymbolizer:function(feature){var \
style=this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),feature);var \
rules=this.rules;var rule,context;var elseRules=[];var appliedRulesúlse;for(var \
i=0;i<rules.length;i++){rule=rules[i];var \
applies=rule.evaluate(feature);if(applies){if(rule instanceof \
OpenLayers.Rule&&rule.elseFilter){elseRules.push(rule);}else{appliedRules=true;this.applySymbolizer(rule,style,feature);}}}
 +if(appliedRules=úlse&&elseRules.length>0){appliedRules=true;for(var \
i=0;i<elseRules.length;i++){this.applySymbolizer(elseRules[i],style,feature);}} \
+if(rules.length>0&&appliedRules=úlse){style.display="none";}else{style.display="";} \
+return style;},applySymbolizer:function(rule,style,feature){var \
symbolizerPrefixþature.geometry?this.getSymbolizerPrefix(feature.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];var \
symbolizer=rule.symbolizer[symbolizerPrefix]||rule.symbolizer;return \
this.createLiterals(OpenLayers.Util.extend(style,symbolizer),feature);},createLiterals:function(style,feature){var \
context=this.context||feature.attributes||feature.data;for(var i in \
this.propertyStyles){style[i]=OpenLayers.Style.createLiteral(style[i],context,feature);}
 +return style;},findPropertyStyles:function(){var propertyStyles={};var \
style=this.defaultStyle;this.addPropertyStyles(propertyStyles,style);var \
rules=this.rules;var symbolizer,value;for(var i=0;i<rules.length;i++){var \
symbolizer=rules[i].symbolizer;for(var key in \
symbolizer){value=symbolizer[key];if(typeof \
value=="object"){this.addPropertyStyles(propertyStyles,value);}else{this.addPropertyStyles(propertyStyles,symbolizer);break;}}}
 +return propertyStyles;},addPropertyStyles:function(propertyStyles,symbolizer){var \
property;for(var key in symbolizer){property=symbolizer[key];if(typeof \
property=="string"&&property.match(/\$\{\w+\}/)){propertyStyles[key]=true;}} +return \
propertyStyles;},addRules:function(rules){this.rules=this.rules.concat(rules);this.pro \
pertyStyles=this.findPropertyStyles();},setDefaultStyle:function(style){this.defaultSt \
yle=style;this.propertyStyles=this.findPropertyStyles();},getSymbolizerPrefix:function(geometry){var \
prefixes=OpenLayers.Style.SYMBOLIZER_PREFIXES;for(var \
i=0;i<prefixes.length;i++){if(geometry.CLASS_NAME.indexOf(prefixes[i])!=-1){return \
prefixes[i];}}},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(value,context,feature){if(typeof \
value=="string"&&value.indexOf("${")!=-1){value=OpenLayers.String.format(value,context,[feature]);value=(isNaN(value)||!value)?value:parseFloat(value);}
 +return value;};OpenLayers.Style.SYMBOLIZER_PREFIXES=['Point','Line','Polygon'];OpenL \
ayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,cl \
ickout:true,toggle:true,layer:null,feature:null,vertices:null,virtualVertices:null,sel \
ectControl:null,dragControl:null,handlers:null,deleteCodes:null,virtualStyle:null,mode \
:null,radiusHandle:null,dragHandle:null,onModificationStart:function(){},onModificatio \
n:function(){},onModificationEnd:function(){},initialize:function(layer,options){this. \
layer=layer;this.vertices=[];this.virtualVertices=[];this.virtualStyle=OpenLayers.Util \
.extend({},this.layer.style||this.layer.styleMap.createSymbolizer());this.virtualStyle \
.fillOpacity=0.3;this.virtualStyle.strokeOpacity=0.3;this.deleteCodes=[46,100];this.mo \
de=OpenLayers.Control.ModifyFeature.RESHAPE;OpenLayers.Control.prototype.initialize.apply(this,[options]);if(!(this.deleteCodes \
instanceof Array)){this.deleteCodes=[this.deleteCodes];} +var control=this;var \
selectOptions={geometryTypes:this.geometryTypes,clickout:this.clickout,toggle:this.toggle};this.selectControl=new \
OpenLayers.Control.SelectFeature(layer,selectOptions);this.layer.events.on({"featurese \
lected":this.selectFeature,"featureunselected":this.unselectFeature,scope:this});var \
dragOptions={geometryTypes:["OpenLayers.Geometry.Point"],snappingOptions:this.snapping \
Options,onStart:function(feature,pixel){control.dragStart.apply(control,[feature,pixel \
]);},onDrag:function(feature){control.dragVertex.apply(control,[feature]);},onComplete \
:function(feature){control.dragComplete.apply(control,[feature]);}};this.dragControl=new \
OpenLayers.Control.DragFeature(layer,dragOptions);var \
keyboardOptions={keypress:this.handleKeypress};this.handlers={keyboard:new \
OpenLayers.Handler.Keyboard(this,keyboardOptions)};},destroy:function(){this.layer.eve \
nts.un({"featureselected":this.selectFeature,"featureunselected":this.unselectFeature,scope:this});this.layer=null;this.s
  electControl.destroy();this.dragControl.destroy();OpenLayers.Control.prototype.destr \
oy.apply(this,[]);},activate:function(){return(this.selectControl.activate()&&this.han \
dlers.keyboard.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments));},deactivate:function(){var \
deactivatedúlse;if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this \
.layer.removeFeatures(this.vertices);this.layer.removeFeatures(this.virtualVertices);t \
his.vertices=[];this.dragControl.deactivate();if(this.feature&&this.feature.geometry){this.selectControl.unselect.apply(this.selectControl,[this.feature]);}
 +this.selectControl.deactivate();this.handlers.keyboard.deactivate();deactivated=true;}
 +return deactivated;},selectFeature:function(object){this.feature=object.feature;this \
.resetVertices();this.dragControl.activate();this.onModificationStart(this.feature);th \
is.layer.events.triggerEvent("beforefeaturemodified",{feature:this.feature});},unselec \
tFeature:function(object){this.layer.removeFeatures(this.vertices);this.vertices=[];th \
is.layer.destroyFeatures(this.virtualVertices);this.virtualVertices=[];if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle]);delete \
this.dragHandle;} +if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle]);delete \
this.radiusHandle;} +this.feature=null;this.dragControl.deactivate();this.onModificati \
onEnd(object.feature);this.layer.events.triggerEvent("afterfeaturemodified",{feature:o \
bject.feature});},dragStart:function(feature,pixel){if(feature!=this.feature&&!feature \
.geometry.parent&&feature!=this.dragHandle&&feature!=this.radiusHandle){if(this.feature){this.selectControl.clickFeature.apply(this.selectControl,[this.feature]);}
 +if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,feature.geom \
etry.CLASS_NAME)!=-1){this.selectControl.clickFeature.apply(this.selectControl,[featur \
e]);this.dragControl.overFeature.apply(this.dragControl,[feature]);this.dragControl.la \
stPixel=pixel;this.dragControl.handlers.drag.started=true;this.dragControl.handlers.dr \
ag.start=pixel;this.dragControl.handlers.drag.last=pixel;}}},dragVertex:function(verte \
x){if(this.feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){if(this.feature!= \
vertex){this.feature=vertex;}}else{if(vertex._index){vertex.geometry.parent.addComponent(vertex.geometry,vertex._index);delete \
vertex._index;OpenLayers.Util.removeItem(this.virtualVertices,vertex);this.vertices.push(vertex);}else \
if(vertex==this.dragHandle){this.layer.removeFeatures(this.vertices);this.vertices=[]; \
if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle]);this.radiusHandle=null;}}
 +if(this.virtualVertices.length>0){this.layer.destroyFeatures(this.virtualVertices);this.virtualVertices=[];}
 +this.layer.drawFeature(this.feature,this.selectControl.renderIntent);}
+this.layer.drawFeature(vertex);},dragComplete:function(vertex){this.resetVertices();t \
his.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{fea \
ture:this.feature});},resetVertices:function(){if(this.dragControl.feature){this.dragControl.outFeature(this.dragControl.feature);}
 +if(this.vertices.length>0){this.layer.removeFeatures(this.vertices);this.vertices=[];}
 +if(this.virtualVertices.length>0){this.layer.removeFeatures(this.virtualVertices);this.virtualVertices=[];}
 +if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle]);this.dragHandle=null;}
 +if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle]);this.radiusHandle=null;}
 +if(this.feature&&this.feature.geometry.CLASS_NAME!="OpenLayers.Geometry.Point"){if((this.mode&OpenLayers.Control.ModifyFeature.DRAG)){this.collectDragHandle();}
 +if((this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE))){this.collectRadiusHandle();}
 +if((this.mode&OpenLayers.Control.ModifyFeature.RESHAPE)){this.collectVertices();}}}, \
handleKeypress:function(code){if(this.feature&&OpenLayers.Util.indexOf(this.deleteCodes,code)!=-1){var \
vertex=this.dragControl.feature;if(vertex&&OpenLayers.Util.indexOf(this.vertices,verte \
x)!=-1&&!this.dragControl.handlers.drag.dragging&&vertex.geometry.parent){vertex.geome \
try.parent.removeComponent(vertex.geometry);this.layer.drawFeature(this.feature,this.s \
electControl.renderIntent);this.resetVertices();this.onModification(this.feature);this \
.layer.events.triggerEvent("featuremodified",{feature:this.feature});}}},collectVertices:function(){this.vertices=[];this.virtualVertices=[];var \
control=this;function collectComponentVertices(geometry){var \
i,vertex,component;if(geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){vertex=new \
OpenLayers.Feature.Vector(geometry);control.vertices.push(vertex);}else{var \
numVert=geometry.components.length;if(geometry.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){
  numVert-=1;}
+for(i=0;i<numVert;++i){component=geometry.components[i];if(component.CLASS_NAME=="OpenLayers.Geometry.Point"){vertex=new \
OpenLayers.Feature.Vector(component);control.vertices.push(vertex);}else{collectComponentVertices(component);}}
 +if(geometry.CLASS_NAME!="OpenLayers.Geometry.MultiPoint"){for(i=0;i<geometry.components.length-1;++i){var \
prevVertex=geometry.components[i];var \
nextVertex=geometry.components[i+1];if(prevVertex.CLASS_NAME=="OpenLayers.Geometry.Point"&&nextVertex.CLASS_NAME=="OpenLayers.Geometry.Point"){var \
x=(prevVertex.x+nextVertex.x)/2;var y=(prevVertex.y+nextVertex.y)/2;var point=new \
OpenLayers.Feature.Vector(new \
OpenLayers.Geometry.Point(x,y),null,control.virtualStyle);point.geometry.parent=geometry;point._index=i+1;control.virtualVertices.push(point);}}}}}
 +collectComponentVertices.call(this,this.feature.geometry);this.layer.addFeatures(thi \
s.vertices,{silent:true});this.layer.addFeatures(this.virtualVertices,{silent:true});},collectDragHandle:function(){var \
geometry=this.feature.geometry;var center=geometry.getBounds().getCenterLonLat();var \
originGeometry=new OpenLayers.Geometry.Point(center.lon,center.lat);var origin=new \
OpenLayers.Feature.Vector(originGeometry);originGeometry.move=function(x,y){OpenLayers \
.Geometry.Point.prototype.move.call(this,x,y);geometry.move(x,y);};this.dragHandle=ori \
gin;this.layer.addFeatures([this.dragHandle],{silent:true});},collectRadiusHandle:function(){var \
geometry=this.feature.geometry;var bounds=geometry.getBounds();var \
center=bounds.getCenterLonLat();var originGeometry=new \
OpenLayers.Geometry.Point(center.lon,center.lat);var radiusGeometry=new \
OpenLayers.Geometry.Point(bounds.right,bounds.bottom);var radius=new \
OpenLayers.Feature.Vector(radiusGeometry);var resize=(this.mode&OpenLayers.Control.Mo \
difyFeature.RESIZE);var \
rotate=(this.mode&OpenLayers.Control.ModifyFeature.ROTATE);radiusGeometry.move=function(x,y){OpenLayers.Geometry.Point.prototype.move.call(this,x,y);var \
dx1=this.x-originGeometry.x;var dy1=this.y-originGeometry.y;var dx0=dx1-x;var \
dy0=dy1-y;if(rotate){var a0=Math.atan2(dy0,dx0);var a1=Math.atan2(dy1,dx1);var \
angle¡-a0;angle*0/Math.PI;geometry.rotate(angle,originGeometry);} +if(resize){var \
l0=Math.sqrt((dx0*dx0)+(dy0*dy0));var \
l1=Math.sqrt((dx1*dx1)+(dy1*dy1));geometry.resize(l1/l0,originGeometry);}};this.radius \
Handle=radius;this.layer.addFeatures([this.radiusHandle],{silent:true});},setMap:funct \
ion(map){this.selectControl.setMap(map);this.dragControl.setMap(map);OpenLayers.Contro \
l.prototype.setMap.apply(this,arguments);},CLASS_NAME:"OpenLayers.Control.ModifyFeatur \
e"});OpenLayers.Control.ModifyFeature.RESHAPE=1;OpenLayers.Control.ModifyFeature.RESIZ \
E=2;OpenLayers.Control.ModifyFeature.ROTATE=4;OpenLayers.Control.ModifyFeature.DRAG=8; \
OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,zoomBo \
x:null,zoomWheelEnabled:true,initialize:function(options){this.handlers={};OpenLayers. \
Control.prototype.initialize.apply(this,arguments);},destroy:function(){this.deactivate();if(this.dragPan){this.dragPan.destroy();}
 +this.dragPan=null;if(this.zoomBox){this.zoomBox.destroy();}
+this.zoomBox=null;OpenLayers.Control.prototype.destroy.apply(this,arguments);},activa \
te:function(){this.dragPan.activate();if(this.zoomWheelEnabled){this.handlers.wheel.activate();}
 +this.handlers.click.activate();this.zoomBox.activate();return \
OpenLayers.Control.prototype.activate.apply(this,arguments);},deactivate:function(){th \
is.zoomBox.deactivate();this.dragPan.deactivate();this.handlers.click.deactivate();this.handlers.wheel.deactivate();return \
OpenLayers.Control.prototype.deactivate.apply(this,arguments);},draw:function(){this.handlers.click=new \
OpenLayers.Handler.Click(this,{'dblclick':this.defaultDblClick},{'double':true,'stopDouble':true});this.dragPan=new \
OpenLayers.Control.DragPan({map:this.map});this.zoomBox=new \
OpenLayers.Control.ZoomBox({map:this.map,keyMask:OpenLayers.Handler.MOD_SHIFT});this.dragPan.draw();this.zoomBox.draw();this.handlers.wheel=new \
OpenLayers.Handler.MouseWheel(this,{"up":this.wheelUp,"down":this.wheelDown});this.activate();},defaultDblClick:function(evt){var \
newCenter=this.map.getLonLatFromViewPortPx(evt.xy);this.map.setCenter(newCenter,this.map.zoom+1);},wheelChange:function(evt,deltaZ){var \
newZoom=this.map.getZoom()+d  eltaZ;if(!this.map.isValidZoomLevel(newZoom)){return;}
+var size=this.map.getSize();var deltaX=size.w/2-evt.xy.x;var \
deltaY=evt.xy.y-size.h/2;var \
newRes=this.map.baseLayer.getResolutionForZoom(newZoom);var \
zoomPoint=this.map.getLonLatFromPixel(evt.xy);var newCenter=new \
OpenLayers.LonLat(zoomPoint.lon+deltaX*newRes,zoomPoint.lat+deltaY*newRes);this.map.se \
tCenter(newCenter,newZoom);},wheelUp:function(evt){this.wheelChange(evt,1);},wheelDown \
:function(evt){this.wheelChange(evt,-1);},disableZoomWheel:function(){this.zoomWheelEn \
abledúlse;this.handlers.wheel.deactivate();},enableZoomWheel:function(){this.zoomWheel \
Enabled=true;if(this.active){this.handlers.wheel.activate();}},CLASS_NAME:"OpenLayers. \
Control.Navigation"});OpenLayers.Filter=OpenLayers.Class({initialize:function(options) \
{OpenLayers.Util.extend(this,options);},destroy:function(){},evaluate:function(context){return \
true;},CLASS_NAME:"OpenLayers.Filter"});OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=OpenLayers.Util.create
  UniqueID(this.CLASS_NAME+"_");},destroy:function(){this.id=null;this.bounds=null;},clone:function(){return \
new OpenLayers.Geometry();},setBounds:function(bounds){if(bounds){this.bounds=bounds.c \
lone();}},clearBounds:function(){this.bounds=null;if(this.parent){this.parent.clearBounds();}},extendBounds:function(newBounds){var \
bounds=this.getBounds();if(!bounds){this.setBounds(newBounds);}else{this.bounds.extend \
(newBounds);}},getBounds:function(){if(this.bounds==null){this.calculateBounds();} \
+return this.bounds;},calculateBounds:function(){},atPoint:function(lonlat,toleranceLon,toleranceLat){var \
atPointúlse;var bounds=this.getBounds();if((bounds!=null)&&(lonlat!=null)){var \
dX=(toleranceLon!=null)?toleranceLon:0;var dY=(toleranceLat!=null)?toleranceLat:0;var \
toleranceBounds=new OpenLayers.Bounds(this.bounds.left-dX,this.bounds.bottom-dY,this.b \
ounds.right+dX,this.bounds.top+dY);atPoint=toleranceBounds.containsLonLat(lonlat);} \
+return atPoint;},getLength:function(){return 0.0;},getArea:function(){return \
0.0;},toString:function(){return OpenLayers.Format.WKT.prototype.write(new \
OpenLayers.Feature.Vector(this));},CLASS_NAME:"OpenLayers.Geometry"});OpenLayers.Geometry.segmentsIntersect=function(seg1,seg2,point){var \
intersectionúlse;var x11_21=seg1.x1-seg2.x1;var y11_21=seg1.y1-seg2.y1;var \
x12_11=seg1.x2-seg1.x1;var y12_11=seg1.y2-seg1.y1;var y22_21=seg2.y2-seg2.y1;var \
x22_21=seg2.x2-seg2.x1;var d=(y22_21*x12_11)-(x22_21*y12_11);var \
n1=(x22_21*y11_21)-(y22_21*x11_21);var \
n2=(x12_11*y11_21)-(y12_11*x11_21);if(d==0){if(n1==0&&n2==0){intersection=true;}}else{var \
along1=n1/d;var along2=n2/d;if(along1>=0&&along1<=1&&along2>=0&&along2<=1){if(!point){intersection=true;}else{var \
x=seg1.x1+(along1*x12_11);var y=seg1.y1+(along1*y12_11);intersection=new \
OpenLayers.Geometry.Point(x,y);}}} +return \
intersection;};OpenLayers.Layer.KaMap=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLa \
yer:true,units:null,resolution:OpenLayers.DOTS_PER_INCH,DEFAULT_PARAMS:{i:'jpeg',map:''},initialize:function(name,url,params,options){var \
newArguments=[];newArguments.push(name,url,params,options);OpenLayers.Layer.Grid.proto \
type.initialize.apply(this,newArguments);this.params=(params?params:{});if(params){Ope \
nLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);}},getURL:function(bounds){bounds=this.adjustBounds(bounds);var \
mapRes=this.map.getResolution();var \
scale=Math.round((this.map.getScale()*10000))/10000;var \
pX=Math.round(bounds.left/mapRes);var pY=-Math.round(bounds.top/mapRes);return \
this.getFullRequestString({t:pY,l:pX,s:scale});},addTile:function(bounds,position){var \
url=this.getURL(bounds);return new \
OpenLayers.Tile.Image(this,position,bounds,url,this.tileSize);},calculateGridLayout:function(bounds,extent,resolution){var \
tilelon=resolution*this.tileSize.w;var tilelat  =resolution*this.tileSize.h;var \
offsetlon=bounds.left;var tilecol=Math.floor(offsetlon/tilelon)-this.buffer;var \
tilecolremain=offsetlon/tilelon-tilecol;var \
tileoffsetx=-tilecolremain*this.tileSize.w;var tileoffsetlon=tilecol*tilelon;var \
offsetlat=bounds.top;var tilerow=Math.ceil(offsetlat/tilelat)+this.buffer;var \
tilerowremain=tilerow-offsetlat/tilelat;var \
tileoffsety=-(tilerowremain+1)*this.tileSize.h;var \
tileoffsetlat=tilerow*tilelat;return{tilelon:tilelon,tilelat:tilelat,tileoffsetlon:til \
eoffsetlon,tileoffsetlat:tileoffsetlat,tileoffsetx:tileoffsetx,tileoffsety:tileoffsety};},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Layer.KaMap(this.name,this.url,this.params,this.options);} \
+obj=OpenLayers.Layer.Grid.prototype.clone.apply(this,[obj]);if(this.tileSize!=null){obj.tileSize=this.tileSize.clone();}
 +obj.grid=[];return obj;},getTileBounds:function(viewPortPx){var \
resolution=this.getResolution();var tileMapWidth=resolution*this.tileSize.w;var \
tileMapHeight=resolution*this.tileSize.h;var \
mapPoint=this.getLonLatFromViewPortPx(viewPortPx);var \
tileLeft=tileMapWidth*Math.floor(mapPoint.lon/tileMapWidth);var \
tileBottom=tileMapHeight*Math.floor(mapPoint.lat/tileMapHeight);return new \
OpenLayers.Bounds(tileLeft,tileBottom,tileLeft+tileMapWidth,tileBottom+tileMapHeight); \
},CLASS_NAME:"OpenLayers.Layer.KaMap"});OpenLayers.Layer.MapGuide=OpenLayers.Class(Ope \
nLayers.Layer.Grid,{isBaseLayer:true,singleTile:false,TILE_PARAMS:{operation:'GETTILEI \
MAGE',version:'1.2.0'},SINGLE_TILE_PARAMS:{operation:'GETMAPIMAGE',format:'PNG',locale:'en',clip:'1',version:'1.0.0'},defaultSize:new \
OpenLayers.Size(300,300),initialize:function(name,url,params,options){OpenLayers.Layer \
.Grid.prototype.initialize.apply(this,arguments);if(options==null||options.isBaseLayer==null){this.isBaseLayer=((this.transparent
                
 !="true")&&(this.transparent!=true));}
+if(this.singleTile){OpenLayers.Util.applyDefaults(this.params,this.SINGLE_TILE_PARAMS \
);}else{OpenLayers.Util.applyDefaults(this.params,this.TILE_PARAMS);this.setTileSize(this.defaultSize);}},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Layer.MapGuide(this.name,this.url,this.params,this.options);} \
+obj=OpenLayers.Layer.Grid.prototype.clone.apply(this,[obj]);return \
obj;},addTile:function(bounds,position){return new \
OpenLayers.Tile.Image(this,position,bounds,null,this.tileSize);},getURL:function(bounds){var \
url;var center=bounds.getCenterLonLat();var \
mapSize=this.map.getCurrentSize();if(this.singleTile){var \
params={};params.setdisplaydpi=OpenLayers.DOTS_PER_INCH;params.setdisplayheight=mapSiz \
e.h*this.ratio;params.setdisplaywidth=mapSize.w*this.ratio;params.setviewcenterxÎnter. \
lon;params.setviewcenteryÎnter.lat;params.setviewscale=this.map.getScale();if(!this.isBaseLayer){this.params.operation="GETDYNAMICMAPOVERLAYIMAGE";var \
getVisParams={};getVisParams.operation="GETVISIBLEMAPEXTENT";getVisParams.version="1.0 \
.0";getVisParams.session=this.params.session;getVisParams.mapName=this.params.mapName; \
getVisParams.format='text/xml';getVisParams=OpenLayers.Util.extend(getVisParams,params);new \
OpenLayers.Ajax.Request(this.url,{parameters:getVisParams,method:'get',asynchronous:f \
alse});} +url=this.getFullRequestString(params);}else{var \
currentRes=this.map.getResolution();var \
colidx=Math.floor((bounds.left-this.maxExtent.left)/currentRes);colidx=Math.round(colidx/this.tileSize.w);var \
rowidx=Math.floor((this.maxExtent.top-bounds.top)/currentRes);rowidx=Math.round(rowidx \
/this.tileSize.h);url=this.getFullRequestString({tilecol:colidx,tilerow:rowidx,scaleindex:this.resolutions.length-this.map.zoom-1});}
 +return url;},getFullRequestString:function(newParams,altUrl){var \
url=(altUrl==null)?this.url:altUrl;if(typeof \
url=="object"){url=url[Math.floor(Math.random()*url.length)];} +var \
requestString=url;var \
allParams=OpenLayers.Util.extend({},this.params);allParams=OpenLayers.Util.extend(allParams,newParams);var \
urlParams=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getArgs(url));for(var key \
in allParams){if(key.toUpperCase()in urlParams){delete allParams[key];}} +var \
paramsString=OpenLayers.Util.getParameterString(allParams);paramsString=paramsString.replace(/,/g,"+");if(paramsString!=""){var \
lastServerChar=url.charAt(url.length-1);if((lastServerChar=="&")||(lastServerChar=="?" \
)){requestString+=paramsString;}else{if(url.indexOf('?')==-1){requestString+='?'+paramsString;}else{requestString+='&'+paramsString;}}}
 +return requestString;},calculateGridLayout:function(bounds,extent,resolution){var \
tilelon=resolution*this.tileSize.w;var tilelat=resolution*this.tileSize.h;var \
offsetlon=bounds.left-extent.left;var \
tilecol=Math.floor(offsetlon/tilelon)-this.buffer;var \
tilecolremain=offsetlon/tilelon-tilecol;var \
tileoffsetx=-tilecolremain*this.tileSize.w;var \
tileoffsetlon=extent.left+tilecol*tilelon;var \
offsetlat=extent.top-bounds.top+tilelat;var \
tilerow=Math.floor(offsetlat/tilelat)-this.buffer;var \
tilerowremain=tilerow-offsetlat/tilelat;var \
tileoffsety=tilerowremain*this.tileSize.h;var \
tileoffsetlat=extent.top-tilelat*tilerow;return{tilelon:tilelon,tilelat:tilelat,tileof \
fsetlon:tileoffsetlon,tileoffsetlat:tileoffsetlat,tileoffsetx:tileoffsetx,tileoffsety: \
tileoffsety};},CLASS_NAME:"OpenLayers.Layer.MapGuide"});OpenLayers.Layer.MapServer=Ope \
nLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(name,url,params,options){var \
newArguments=[];newA  \
rguments.push(name,url,params,options);OpenLayers.Layer.Grid.prototype.initialize.appl \
y(this,newArguments);if(arguments.length>0){OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);}
 +if(options==null||options.isBaseLayer==null){this.isBaseLayer=((this.params.transpar \
ent!="true")&&(this.params.transparent!=true));}},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Layer.MapServer(this.name,this.url,this.params,this.options);} \
+obj=OpenLayers.Layer.Grid.prototype.clone.apply(this,[obj]);return \
obj;},addTile:function(bounds,position){return new \
OpenLayers.Tile.Image(this,position,bounds,null,this.tileSize);},getURL:function(bounds){bounds=this.adjustBounds(bounds);var \
extent=[bounds.left,bounds.bottom,bounds.right,bounds.top];var \
imageSize=this.getImageSize();var \
url=this.getFullRequestString({mapext:extent,imgext:extent,map_size:[imageSize.w,image \
Size.h],imgx:imageSize.w/2,imgy:imageSize.h/2,imgxy:[imageSize.w,imageSize.h]});return \
url;},getFullRequestString:function(newParams,altUrl){var \
url=(altUrl==null)?this.url:altUrl;var \
allParams=OpenLayers.Util.extend({},this.params);allParams=OpenLayers.Util.extend(allParams,newParams);var \
paramsString=OpenLayers.Util.getParameterString(allParams);if(url instanceof \
Array){url=this.selectUrl(paramsString,url);} +var \
urlParams=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(url));for(var \
key in allParams){if(key.toUpperCase()in urlParams){delete allParams[key];}} \
+paramsString=OpenLayers.Util.getParameterString(allParams);var \
requestString=url;paramsString=paramsString.replace(/,/g,"+");if(paramsString!=""){var \
lastServerChar=url.charAt(url.length-1);if((lastServerChar=="&")||(lastServerChar=="?" \
)){requestString+=paramsString;}else{if(url.indexOf('?')==-1){requestString+='?'+paramsString;}else{requestString+='&'+paramsString;}}}
 +return requestString;},CLASS_NAME:"OpenLayers.Layer.MapServer"});OpenLayers.Layer.TM \
S=OpenLayers.Class(OpenLayers.Layer.Grid,{serviceVersion:"1.0.0",isBaseLayer:true,tileOrigin:null,initialize:function(name,url,options){var \
newArguments=[];newArguments.push(name,url,{},options);OpenLayers.Layer.Grid.prototype \
.initialize.apply(this,newArguments);},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments);},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Layer.TMS(this.name,this.url,this.options);} \
+obj=OpenLayers.Layer.Grid.prototype.clone.apply(this,[obj]);return \
obj;},getURL:function(bounds){bounds=this.adjustBounds(bounds);var \
res=this.map.getResolution();var \
x=Math.round((bounds.left-this.tileOrigin.lon)/(res*this.tileSize.w));var \
y=Math.round((bounds.bottom-this.tileOrigin.lat)/(res*this.tileSize.h));var \
z=this.map.getZoom();var \
path=this.serviceVersion+"/"+this.layername+"/"+z+"/"+x+"/"+y+"."+this.type;var \
url=this.url;if(url instanceof Array){url=this.selectUrl(path,url);} +return \
url+path;},addTile:function(bounds,position){return new \
OpenLayers.Tile.Image(this,position,bounds,null,this.tileSize);},setMap:function(map){ \
OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new \
OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom);}},CLASS_NAME:"Op \
enLayers.Layer.TMS"});OpenLayers.Layer.TileCache=OpenLayers.Class(OpenLayers.Layer.Gri \
d,{isBaseLayer:true,tileOrigin:null,format:'image/png',initialize:function(name,url,la \
yername,options){this.layername=layername;OpenLayers.Layer.Grid.prototype.initialize.a \
pply(this,[name,url,{},options]);this.extension=this.format.split('/')[1].toLowerCase( \
);this.extension=(this.extension=='jpg')?'jpeg':this.extension;},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Layer.TileCache(this.name,this.url,this.layername,this.options);} \
+obj=OpenLayers.Layer.Grid.prototype.clone.apply(this,[obj]);return \
obj;},getURL:function(bounds){var res=this.map.getResolution();var \
bbox=this.maxExtent;var size=this.tileSize;var \
tileX=Math.round((bounds.left-bbox.left)/(res*size.w));var \
tileY=Math.round((bounds.bottom-bbox.bottom)/(res*size.h));var \
tileZ=this.map.zoom;function zeroPad(number,length){number=String(number);var \
zeros=[];for(var i=0;i<length;++i){zeros.push('0');} +return \
zeros.join('').substring(0,length-number.length)+number;} +var \
components=[this.layername,zeroPad(tileZ,2),zeroPad(parseInt(tileX/1000000),3),zeroPad \
((parseInt(tileX/1000)%1000),3),zeroPad((parseInt(tileX)%1000),3),zeroPad(parseInt(til \
eY/1000000),3),zeroPad((parseInt(tileY/1000)%1000),3),zeroPad((parseInt(tileY)%1000),3)+'.'+this.extension];var \
path=components.join('/');var url=this.url;if(url instanceof \
Array){url=this.selectUrl(path,url);} \
+url=(url.charAt(url.length-1)=='/')?url:url+'/';return \
url+path;},addTile:function(bounds,position){var url=this.getURL(bounds);return new \
OpenLayers.Tile.Image(this,position,bounds,url,this.tileSize);},setMap:function(map){O \
penLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new \
OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom);}},CLASS_NAME:"Op \
enLayers.Layer.TileCache"});OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Gri \
d,{DEFAULT_PARAMS:{service:"WMS",version:"1.1.1",request:"GetMap",styles:"",exceptions \
:"application/vnd.ogc.se_inimage",format:"image/jpeg"},reproject:false,isBaseLayer:true,encodeBBOX:false,initialize:function(name,url,params,options){var \
newArguments=[];params=OpenLayers.Util.upperCaseObject(params);newArguments.push(name, \
url,params,options);OpenLayers.Layer.Grid.prototype.initialize.apply(this,newArguments);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(thi
  s.DEFAULT_PARAMS));if(this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().to \
LowerCase()=="true"){if((options==null)||(!options.isBaseLayer)){this.isBaseLayerúlse;}
 +if(this.params.FORMAT=="image/jpeg"){this.params.FORMAT=OpenLayers.Util.alphaHack()? \
"image/gif":"image/png";}}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments);},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Layer.WMS(this.name,this.url,this.params,this.options);} \
+obj=OpenLayers.Layer.Grid.prototype.clone.apply(this,[obj]);return \
obj;},getURL:function(bounds){bounds=this.adjustBounds(bounds);var \
imageSize=this.getImageSize();var \
newParams={'BBOX':this.encodeBBOX?bounds.toBBOX():bounds.toArray(),'WIDTH':imageSize.w,'HEIGHT':imageSize.h};var \
requestString=this.getFullRequestString(newParams);return \
requestString;},addTile:function(bounds,position){return new \
OpenLayers.Tile.Image(this,position,bounds,null,this.tileSize);},mergeNewParams:function(newParams){var \
upperParams=OpenLayers.Util.upperCaseObject(newParams);var \
newArguments=[upperParams];return \
OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,newArguments);},getFullRequestString:function(newParams,altUrl){var \
projectionCode=this.map.getProjection();this.params.SRS=(projectionCode=="none")?null:projectionCode;return \
OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments);},CLASS_NAME:"OpenLayers.Layer.WMS"});OpenLayers.Layer.WorldWind=OpenLayers.Class(O
  penLayers.Layer.Grid,{DEFAULT_PARAMS:{},isBaseLayer:true,lzd:null,zoomLevels:null,in \
itialize:function(name,url,lzd,zoomLevels,params,options){this.lzd=lzd;this.zoomLevels=zoomLevels;var \
newArguments=[];newArguments.push(name,url,params,options);OpenLayers.Layer.Grid.proto \
type.initialize.apply(this,newArguments);this.params=(params?params:{});if(params){Ope \
nLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);}},addTile:function(bounds,position){return \
new OpenLayers.Tile.Image(this,position,bounds,null,this.tileSize);},getZoom:function(){var \
zoom=this.map.getZoom();var \
extent=this.map.getMaxExtent();zoom=zoom-Math.log(this.maxResolution/(this.lzd/512))/Math.log(2);return \
zoom;},getURL:function(bounds){bounds=this.adjustBounds(bounds);var \
zoom=this.getZoom();var extent=this.map.getMaxExtent();var \
deg=this.lzd/Math.pow(2,this.getZoom());var \
x=Math.floor((bounds.left-extent.left)/deg);var \
y=Math.floor((bounds.bottom-extent.bottom)/deg);if(this.map.getResolution()<=(this.l  \
zd/512)&&this.getZoom()<=this.zoomLevels){return \
this.getFullRequestString({L:zoom,X:x,Y:y});}else{return \
OpenLayers.Util.getImagesLocation()+"blank.gif";}},CLASS_NAME:"OpenLayers.Layer.WorldW \
ind"});OpenLayers.Rule=OpenLayers.Class({id:null,name:'default',title:null,description \
:null,context:null,filter:null,elseFilter:false,symbolizer:null,minScaleDenominator:nu \
ll,maxScaleDenominator:null,initialize:function(options){this.id=OpenLayers.Util.creat \
eUniqueID(this.CLASS_NAME+"_");this.symbolizer={};OpenLayers.Util.extend(this,options);},destroy:function(){for(var \
i in this.symbolizer){this.symbolizer[i]=null;} \
+this.symbolizer=null;},evaluate:function(feature){var \
context=this.getContext(feature);var \
applies=true;if(this.minScaleDenominator||this.maxScaleDenominator){var \
scaleþature.layer.map.getScale();} \
+if(this.minScaleDenominator){applies=scale>=OpenLayers.Style.createLiteral(this.minScaleDenominator,context);}
 +if(applies&&this.maxScaleDenominator){applies=scale<OpenLayers.Style.createLiteral(this.maxScaleDenominator,context);}
 +if(applies&&this.filter){if(this.filter.CLASS_NAME=="OpenLayers.Filter.FeatureId"){a \
pplies=this.filter.evaluate(feature);}else{applies=this.filter.evaluate(context);}} \
+return applies;},getContext:function(feature){var \
context=this.context;if(!context){contextþature.attributes||feature.data;} +return \
context;},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.StyleMap=OpenLayers.Class({styles: \
null,extendDefault:true,initialize:function(style,options){this.styles={"default":new \
OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),"select":new \
OpenLayers.Style(OpenLayers.Feature.Vector.style["select"]),"temporary":new \
OpenLayers.Style(OpenLayers.Feature.Vector.style["temporary"])};if(style instanceof \
OpenLayers.Style){this.styles["default"]=style;this.styles["select"]=style;this.styles["temporary"]=style;}else \
if(typeof style=="object"){for(var key in style){if(style[key]instanceof \
OpenLayers.Style){this.styles[key]=style[key];}else if(typeof \
style[key]=="object"){this.styles[key]=new \
OpenLayers.Style(style[key]);}else{this.styles["default"]=new \
OpenLayers.Style(style);this.styles["select"]=new \
OpenLayers.Style(style);this.styles["temporary"]=new \
OpenLayers.Style(style);break;}}} \
+OpenLayers.Util.extend(this,options);},destroy:function(){for(var key in \
this.styles){this.styles[key].destroy();} \
+this.styles=null;},createSymbolizer:function(feature,intent){if(!feature){feature=new \
OpenLayers.Feature.Vector();} +if(!this.styles[intent]){intent="default";}
+feature.renderIntent=intent;var \
defaultSymbolizer={};if(this.extendDefault&&intent!="default"){defaultSymbolizer=this.styles["default"].createSymbolizer(feature);}
 +return OpenLayers.Util.extend(defaultSymbolizer,this.styles[intent].createSymbolizer(feature));},addUniqueValueRules:function(renderIntent,property,symbolizers){var \
rules=[];for(var value in symbolizers){rules.push(new \
OpenLayers.Rule({symbolizer:symbolizers[value],filter:new \
OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:property,value:value})}));}
 +this.styles[renderIntent].addRules(rules);},CLASS_NAME:"OpenLayers.StyleMap"});OpenL \
ayers.Control.NavToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:functio \
n(options){OpenLayers.Control.Panel.prototype.initialize.apply(this,[options]);this.addControls([new \
OpenLayers.Control.Navigation(),new \
OpenLayers.Control.ZoomBox()]);},draw:function(){var \
div=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);this.activateControl(this.controls[0]);return \
div;},CLASS_NAME:"OpenLayers.Control.NavToolbar"});OpenLayers.Filter.Comparison=OpenLa \
yers.Class(OpenLayers.Filter,{type:null,property:null,value:null,lowerBoundary:null,up \
perBoundary:null,initialize:function(options){OpenLayers.Filter.prototype.initialize.apply(this,[options]);},evaluate:function(context){switch(this.type){case \
OpenLayers.Filter.Comparison.EQUAL_TO:case \
OpenLayers.Filter.Comparison.LESS_THAN:case \
OpenLayers.Filter.Comparison.GREATER_THAN:case \
OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:c  ase \
OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:return \
this.binaryCompare(context,this.property,this.value);case \
OpenLayers.Filter.Comparison.BETWEEN:var \
result=context[this.property]>=this.lowerBoundary;result=result&&context[this.property]<=this.upperBoundary;return \
result;case OpenLayers.Filter.Comparison.LIKE:var regexp=new \
RegExp(this.value,"gi");return \
regexp.test(context[this.property]);}},value2regex:function(wildCard,singleChar,escapeChar){if(wildCard=="."){var \
msg="'.' is an unsupported wildCard character for \
"+"OpenLayers.Filter.Comparison";OpenLayers.Console.error(msg);return null;} \
+wildCard=wildCard?wildCard:"*";singleChar=singleChar?singleChar:".";escapeChar=escapeChar?escapeChar:"!";this.value=this.value.replace(new \
RegExp("\\"+escapeChar,"g"),"\\");this.value=this.value.replace(new \
RegExp("\\"+singleChar,"g"),".");this.value=this.value.replace(new \
RegExp("\\"+wildCard,"g"),".*");this.value=this.value.replace(new \
RegExp("\\\\.\\*","g"),"\\"+wildCard);this.value=this.value.replace(new \
RegExp("\\\\\\.","g"),"\\"+singleChar);return this.value;},regex2value:function(){var \
value=this.value;value=value.replace(/!/g,"!!");value=value.replace(/(\\)?\\\./g,function($0,$1){return \
$1?$0:"!.";});value=value.replace(/(\\)?\\\*/g,function($0,$1){return \
$1?$0:"!*";});value=value.replace(/\\\\/g,"\\");value=value.replace(/\.\*/g,"*");return \
value;},binaryCompare:function(context,property,value){switch(this.type){case \
OpenLayers.Filter.Comparison.EQUAL_TO:return context[property]==value;case \
OpenLayers.Filter.Comparison.NOT_EQUAL_TO:return context[property]!=value;ca  se \
OpenLayers.Filter.Comparison.LESS_THAN:return context[property]<value;case \
OpenLayers.Filter.Comparison.GREATER_THAN:return context[property]>value;case \
OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:return \
context[property]<=value;case \
OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:return \
context[property]>=value;}},CLASS_NAME:"OpenLayers.Filter.Comparison"});OpenLayers.Fil \
ter.Comparison.EQUAL_TO="==";OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=";OpenLayers \
.Filter.Comparison.LESS_THAN="<";OpenLayers.Filter.Comparison.GREATER_THAN=">";OpenLay \
ers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=";OpenLayers.Filter.Comparison.GREATER_ \
THAN_OR_EQUAL_TO=">=";OpenLayers.Filter.Comparison.BETWEEN="..";OpenLayers.Filter.Comp \
arison.LIKE="~";OpenLayers.Filter.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:n \
ull,initialize:function(options){this.fids=[];OpenLayers.Filter.prototype.initialize.apply(this,[options]);},evaluate:function(feature){for(var \
i=0;i<this.fids.length;i  ++){var \
fidþature.fid||feature.id;if(fid==this.fids[i]){return true;}} +return \
false;},CLASS_NAME:"OpenLayers.Filter.FeatureId"});OpenLayers.Filter.Logical=OpenLayer \
s.Class(OpenLayers.Filter,{filters:null,type:null,initialize:function(options){this.fi \
lters=[];OpenLayers.Filter.prototype.initialize.apply(this,[options]);},destroy:functi \
on(){this.filters=null;OpenLayers.Filter.prototype.destroy.apply(this);},evaluate:function(context){switch(this.type){case \
OpenLayers.Filter.Logical.AND:for(var \
i=0;i<this.filters.length;i++){if(this.filters[i].evaluate(context)=úlse){return \
false;}} +return true;case OpenLayers.Filter.Logical.OR:for(var \
i=0;i<this.filters.length;i++){if(this.filters[i].evaluate(context)==true){return \
true;}} +return false;case \
OpenLayers.Filter.Logical.NOT:return(!this.filters[0].evaluate(context));}},CLASS_NAME \
:"OpenLayers.Filter.Logical"});OpenLayers.Filter.Logical.AND="&&";OpenLayers.Filter.Lo \
gical.OR="||";OpenLayers.Filter.Logical.NOT="!";OpenLayers.Geometry.Collection=OpenLay \
ers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function \
(components){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.compo \
nents=[];if(components!=null){this.addComponents(components);}},destroy:function(){this.components.length=0;this.components=null;},clone:function(){var \
geometry=eval("new "+this.CLASS_NAME+"()");for(var \
i=0;i<this.components.length;i++){geometry.addComponent(this.components[i].clone());} \
+OpenLayers.Util.applyDefaults(geometry,this);return \
geometry;},getComponentsString:function(){var strings=[];for(var \
i=0;i<this.components.length;i++){strings.push(this.components[i].toShortString());} \
+return strings.join(",");},calculateBounds:function(){this.bounds=null;if(this.compon \
ents&&this.components.length>0){this.setBounds(this.components[0].getBounds());for(var \
i=1;i<this.components.length;i++){this.extendBounds(this.components[i].getBounds());}}},addComponents:function(components){if(!(components \
instanceof Array)){components=[components];} +for(var \
i=0;i<components.length;i++){this.addComponent(components[i]);}},addComponent:function(component,index){var \
addedúlse;if(component){if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.co \
mponentTypes,component.CLASS_NAME)>-1)){if(index!=null&&(index<this.components.length)){var \
components1=this.components.slice(0,index);var \
components2=this.components.slice(index,this.components.length);components1.push(compo \
nent);this.components=components1.concat(components2);}else{this.components.push(component);}
 +component.parent=this;this.clearBounds();added=true;}}
+return added;},removeComponents:function(components){if(!(components instanceof \
Array)){components=[components];} +for(var \
i=components.length-1;i>=0;--i){this.removeComponent(components[i]);}},removeComponent \
:function(component){OpenLayers.Util.removeItem(this.components,component);this.clearBounds();},getLength:function(){var \
length=0.0;for(var i=0;i<this.components.length;i++){length+=this.components[i].getLength();}
 +return length;},getArea:function(){var area=0.0;for(var \
i=0;i<this.components.length;i++){area+=this.components[i].getArea();} +return \
area;},move:function(x,y){for(var \
i=0;i<this.components.length;i++){this.components[i].move(x,y);}},rotate:function(angle,origin){for(var \
i=0;i<this.components.length;++i){this.components[i].rotate(angle,origin);}},resize:function(scale,origin,ratio){for(var \
i=0;i<this.components.length;++i){this.components[i].resize(scale,origin,ratio);}},equals:function(geometry){var \
equivalent=true;if(!geometry||!geometry.CLASS_NAME||(this.CLASS_NAME!=geometry.CLASS_NAME)){equivalentúlse;}else \
if(!(geometry.components instanceof \
Array)||(geometry.components.length!=this.components.length)){equivalentúlse;}else{for(var \
i=0;i<this.components.length;++i){if(!this.components[i].equals(geometry.components[i])){equivalentúlse;break;}}}
 +return equivalent;},transform:function(source,dest){if(source&&dest){for(var \
i=0;i<this.components.length;i++){var \
component=this.components[i];component.transform(source,dest);}} +return \
this;},intersects:function(geometry){var intersectúlse;for(var \
i=0;i<this.components.length;++i){intersect=geometry.intersects(this.components[i]);if(intersect){break;}}
 +return intersect;},CLASS_NAME:"OpenLayers.Geometry.Collection"});OpenLayers.Geometry \
.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(x,y){Op \
enLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=parseFloat(x);this.y=parseFloat(y);},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Geometry.Point(this.x,this.y);} \
+OpenLayers.Util.applyDefaults(obj,this);return \
obj;},calculateBounds:function(){this.bounds=new \
OpenLayers.Bounds(this.x,this.y,this.x,this.y);},distanceTo:function(point){var \
distance=0.0;if((this.x!=null)&&(this.y!=null)&&(point!=null)&&(point.x!=null)&&(point.y!=null)){var \
dx2=Math.pow(this.x-point.x,2);var \
dy2=Math.pow(this.y-point.y,2);distance=Math.sqrt(dx2+dy2);} +return \
distance;},equals:function(geom){var \
equalsúlse;if(geom!=null){equals=((this.x==geom.x&&this.y==geom.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(geom.x)&&isNaN(geom.y)));}
 +return equals;},toShortString:function(){return(this.x+", \
"+this.y);},move:function(x,y){this.x=this.x+x;this.y=this.y+y;this.clearBounds();},rotate:function(angle,origin){angle*=Math.PI/180;var \
radius=this.distanceTo(origin);var \
theta=angle+Math.atan2(this.y-origin.y,this.x-origin.x);this.x=origin.x+(radius*Math.c \
os(theta));this.y=origin.y+(radius*Math.sin(theta));this.clearBounds();},resize:functi \
on(scale,origin,ratio){ratio=(ratio==undefined)?1:ratio;this.x=origin.x+(scale*ratio*( \
this.x-origin.x));this.y=origin.y+(scale*(this.y-origin.y));this.clearBounds();},intersects:function(geometry){var \
intersectúlse;if(geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){intersect=this.equals(geometry);}else{intersect=geometry.intersects(this);}
 +return intersect;},transform:function(source,dest){if((source&&dest)){OpenLayers.Projection.transform(this,source,dest);}
 +return this;},CLASS_NAME:"OpenLayers.Geometry.Point"});OpenLayers.Geometry.Rectangle \
=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,width:null,height:null,initialize \
:function(x,y,width,height){OpenLayers.Geometry.prototype.initialize.apply(this,argume \
nts);this.x=x;this.y=y;this.width=width;this.height=height;},calculateBounds:function(){this.bounds=new \
OpenLayers.Bounds(this.x,this.y,this.x+this.width,this.y+this.height);},getLength:function(){var \
length=(2*this.width)+(2*this.height);return length;},getArea:function(){var \
area=this.width*this.height;return \
area;},CLASS_NAME:"OpenLayers.Geometry.Rectangle"});OpenLayers.Geometry.Surface=OpenLa \
yers.Class(OpenLayers.Geometry,{initialize:function(){OpenLayers.Geometry.prototype.in \
itialize.apply(this,arguments);},CLASS_NAME:"OpenLayers.Geometry.Surface"});OpenLayers \
.Layer.MapServer.Untiled=OpenLayers.Class(OpenLayers.Layer.MapServer,{singleTile:true,initialize:function(name,url,params,options){OpenLayers.Layer.MapServer.prot
  otype.initialize.apply(this,arguments);var msg="The \
OpenLayers.Layer.MapServer.Untiled class is deprecated and "+"will be removed in 3.0. \
Instead, you should use the "+"normal OpenLayers.Layer.MapServer class, passing it \
the option "+"'singleTile' as \
true.";OpenLayers.Console.warn(msg);},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Layer.MapServer.Untiled(this.name,this.url,this.params,this.options);} \
+obj=OpenLayers.Layer.MapServer.prototype.clone.apply(this,[obj]);return \
obj;},CLASS_NAME:"OpenLayers.Layer.MapServer.Untiled"});OpenLayers.Layer.Vector=OpenLa \
yers.Class(OpenLayers.Layer,{EVENT_TYPES:["beforefeatureadded","featureadded","feature \
sadded","featureselected","featureunselected","beforefeaturemodified","featuremodified \
","afterfeaturemodified"],isBaseLayer:false,isFixed:false,isVector:true,features:null, \
selectedFeatures:null,reportError:true,style:null,styleMap:null,renderers:['SVG','VML' \
],renderer:null,geometryType:null,drawn:false,initialize:function(name,options){this.E \
VENT_TYPES=OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat(OpenLayers.Layer.proto \
type.EVENT_TYPES);OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(!this.renderer||!this.renderer.supported()){this.assignRenderer();}
 +if(!this.renderer||!this.renderer.supported()){this.renderer=null;this.displayError();}
 +if(!this.styleMap){this.styleMap=new OpenLayers.StyleMap();}
+this.features=[];this.selectedFeatures=[];},destroy:function(){OpenLayers.Layer.proto \
type.destroy.apply(this,arguments);this.destroyFeatures();this.features=null;this.selectedFeatures=null;if(this.renderer){this.renderer.destroy();}
 +this.renderer=null;this.geometryType=null;this.drawn=null;},assignRenderer:function(){for(var \
i=0;i<this.renderers.length;i++){var \
rendererClass=OpenLayers.Renderer[this.renderers[i]];if(rendererClass&&rendererClass.prototype.supported()){this.renderer=new \
rendererClass(this.div);break;}}},displayError:function(){if(this.reportError){alert(O \
penLayers.i18n("browserNotSupported",{'renderers':this.renderers.join("\n")}));}},setM \
ap:function(map){OpenLayers.Layer.prototype.setMap.apply(this,arguments);if(!this.rend \
erer){this.map.removeLayer(this);}else{this.renderer.map=this.map;this.renderer.setSiz \
e(this.map.getSize());}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize \
.apply(this,arguments);this.renderer.setSize(this.map.getSize());},moveTo:function(bou \
nds,zoomChanged,dragging){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(! \
dragging){this.renderer.root.style.visibility="hidden";if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.div.scrollL
  eft=this.div.scrollLeft;}
+this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+"px";this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+"px";var \
extent=this.map.getExtent();this.renderer.setExtent(extent);this.renderer.root.style.visibility="visible";}
 +if(!this.drawn||zoomChanged){this.drawn=true;for(var \
i=0;i<this.features.length;i++){var \
feature=this.features[i];this.drawFeature(feature);}}},addFeatures:function(features,options){if(!(features \
instanceof Array)){features=[features];} +var \
notify=!options||!options.silent;for(var i=0;i<features.length;i++){var \
featureþatures[i];if(this.geometryType&&!(feature.geometry instanceof \
this.geometryType)){var \
throwStr=OpenLayers.i18n('componentShouldBe',{'geomType':this.geometryType.prototype.CLASS_NAME});throw \
throwStr;} +this.features.push(feature);feature.layer=this;if(!feature.style&&this.style){feature.style=OpenLayers.Util.extend({},this.style);}
 +if(notify){this.events.triggerEvent("beforefeatureadded",{feature:feature});this.preFeatureInsert(feature);}
 +if(this.drawn){this.drawFeature(feature);}
+if(notify){this.events.triggerEvent("featureadded",{feature:feature});this.onFeatureInsert(feature);}}
 +if(notify){this.events.triggerEvent("featuresadded",{features:features});}},removeFeatures:function(features){if(!(features \
instanceof Array)){features=[features];} +for(var iþatures.length-1;i>=0;i--){var \
featureþatures[i];this.features=OpenLayers.Util.removeItem(this.features,feature);if(feature.geometry){this.renderer.eraseGeometry(feature.geometry);}
 +if(OpenLayers.Util.indexOf(this.selectedFeatures,feature)!=-1){OpenLayers.Util.removeItem(this.selectedFeatures,feature);}}},destroyFeatures:function(features){var \
all=(features==undefined);if(all){features=this.features;this.selectedFeatures=[];} \
+this.eraseFeatures(features);var feature;for(var \
iþatures.length-1;i>=0;i--){featureþatures[i];if(!all){OpenLayers.Util.removeItem(this.selectedFeatures,feature);}
 +feature.destroy();}},drawFeature:function(feature,style){if(typeof \
style!="object"){var renderIntent=typeof \
style=="string"?style:feature.renderIntent;styleþature.style||this.style;if(!style){style=this.styleMap.createSymbolizer(feature,renderIntent);}}
 +this.renderer.drawFeature(feature,style);},eraseFeatures:function(features){this.ren \
derer.eraseFeatures(features);},getFeatureFromEvent:function(evt){if(!this.renderer){OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));return \
null;} +var featureId=this.renderer.getFeatureIdFromEvent(evt);return \
this.getFeatureById(featureId);},getFeatureById:function(featureId){var \
feature=null;for(var \
i=0;i<this.features.length;++i){if(this.features[i].id=þatureId){feature=this.features[i];break;}}
 +return feature;},onFeatureInsert:function(feature){},preFeatureInsert:function(featu \
re){},CLASS_NAME:"OpenLayers.Layer.Vector"});OpenLayers.Layer.WMS.Untiled=OpenLayers.C \
lass(OpenLayers.Layer.WMS,{singleTile:true,initialize:function(name,url,params,options){OpenLayers.Layer.WMS.prototype.initialize.apply(this,arguments);var \
msg="The OpenLayers.Layer.WMS.Untiled class is deprecated and "+"will be removed in \
3.0. Instead, you should use the "+"normal OpenLayers.Layer.WMS class, passing it the \
option "+"'singleTile' as \
true.";OpenLayers.Console.warn(msg);},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Layer.WMS.Untiled(this.name,this.url,this.params,this.options);} \
+obj=OpenLayers.Layer.WMS.prototype.clone.apply(this,[obj]);return \
obj;},CLASS_NAME:"OpenLayers.Layer.WMS.Untiled"});OpenLayers.Format.SLD=OpenLayers.Cla \
ss(OpenLayers.Format.XML,{defaultVersion:"1.0.0",version:null,parser:null,initialize:f \
unction(options){OpenLayers.Format.XML.prototype.initialize.apply(this,[options]);},write:function(sld,options){var \
version=(options&&options.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=version){var \
format=OpenLayers.Format.SLD["v"+version.replace(/\./g,"_")];if(!format){throw"Can't \
find a SLD parser for version "+ +version;}
+this.parser=new format(this.options);}
+var root=this.parser.write(sld);return \
OpenLayers.Format.XML.prototype.write.apply(this,[root]);},read:function(data){if(typeof \
data=="string"){data=OpenLayers.Format.XML.prototype.read.apply(this,[data]);} +var \
rootÚta.documentElement;var \
version=this.version;if(!version){version=root.getAttribute("version");if(!version){version=this.defaultVersion;}}
 +if(!this.parser||this.parser.VERSION!=version){var \
format=OpenLayers.Format.SLD["v"+version.replace(/\./g,"_")];if(!format){throw"Can't \
find a SLD parser for version "+ +version;}
+this.parser=new format(this.options);}
+var sld=this.parser.read(data);return \
sld;},CLASS_NAME:"OpenLayers.Format.SLD"});OpenLayers.Format.Text=OpenLayers.Class(Ope \
nLayers.Format,{initialize:function(options){OpenLayers.Format.prototype.initialize.apply(this,[options]);},read:function(text){var \
lines=text.split('\n');var columns;var features=[];for(var \
lcv=0;lcv<(lines.length-1);lcv++){var \
currLine=lines[lcv].replace(/^\s*/,'').replace(/\s*$/,'');if(currLine.charAt(0)!='#'){if(!columns){columns=currLine.split('\t');}else{var \
vals=currLine.split('\t');var geometry=new OpenLayers.Geometry.Point(0,0);var \
attributes={};var style={};var icon,iconSize,iconOffset,overflow;var setúlse;for(var \
valIndex=0;valIndex<vals.length;valIndex++){if(vals[valIndex]){if(columns[valIndex]=='point'){var \
coords=vals[valIndex].split(',');geometry.y=parseFloat(coords[0]);geometry.x=parseFloat(coords[1]);set=true;}else \
if(columns[valIndex]=='lat'){geometry.y=parseFloat(vals[valIndex]);set=true;}else \
if(columns[valIndex]=='lon'){geometry.x  =parseFloat(vals[valIndex]);set=true;}else \
if(columns[valIndex]=='title') +attributes['title']=vals[valIndex];else \
if(columns[valIndex]=='image'||columns[valIndex]=='icon') \
+style['externalGraphic']=vals[valIndex];else if(columns[valIndex]=='iconSize'){var \
size=vals[valIndex].split(',');style['graphicWidth']=parseFloat(size[0]);style['graphicHeight']=parseFloat(size[1]);}else \
if(columns[valIndex]=='iconOffset'){var \
offset=vals[valIndex].split(',');style['graphicXOffset']=parseFloat(offset[0]);style['graphicYOffset']=parseFloat(offset[1]);}else \
if(columns[valIndex]=='description'){attributes['description']=vals[valIndex];}else \
if(columns[valIndex]=='overflow'){attributes['overflow']=vals[valIndex];}}} \
+if(set){if(this.internalProjection&&this.externalProjection){geometry.transform(this.externalProjection,this.internalProjection);}
 +var feature=new OpenLayers.Feature.Vector(geometry,attributes,style);features.push(feature);}}}}
 +return features;},CLASS_NAME:"OpenLayers.Format.Text"});OpenLayers.Geometry.MultiLin \
eString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.G \
eometry.LineString"],initialize:function(components){OpenLayers.Geometry.Collection.pr \
ototype.initialize.apply(this,arguments);},CLASS_NAME:"OpenLayers.Geometry.MultiLineSt \
ring"});OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection \
,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(components){OpenLay \
ers.Geometry.Collection.prototype.initialize.apply(this,arguments);},addPoint:function \
(point,index){this.addComponent(point,index);},removePoint:function(point){this.remove \
Component(point);},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});OpenLayers.Geometry.M \
ultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLaye \
rs.Geometry.Polygon"],initialize:function(components){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments);},C
  LASS_NAME:"OpenLayers.Geometry.MultiPolygon"});OpenLayers.Geometry.Polygon=OpenLayer \
s.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRin \
g"],initialize:function(components){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments);},getArea:function(){var \
area=0.0;if(this.components&&(this.components.length>0)){area+=Math.abs(this.components[0].getArea());for(var \
i=1;i<this.components.length;i++){area-=Math.abs(this.components[i].getArea());}} \
+return area;},containsPoint:function(point){var numRings=this.components.length;var \
containedúlse;if(numRings>0){contained=this.components[0].containsPoint(point);if(contained!==1){if(contained&&numRings>1){var \
hole;for(var i=1;i<numRings;++i){hole=this.components[i].containsPoint(point);if(hole){if(hole===1){contained=1;}else{containedúlse;}
 +break;}}}}}
+return contained;},intersects:function(geometry){var intersectúlse;var \
i;if(geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){intersect=this.containsPoint(geometry);}else \
if(geometry.CLASS_NAME=="OpenLayers.Geometry.LineString"||geometry.CLASS_NAME=="OpenLa \
yers.Geometry.LinearRing"){for(i=0;i<this.components.length;++i){intersect=geometry.intersects(this.components[i]);if(intersect){break;}}
 +if(!intersect){for(i=0;i<geometry.components.length;++i){intersect=this.containsPoin \
t(geometry.components[i]);if(intersect){break;}}}}else{for(i=0;i<geometry.components.l \
ength;++i){intersect=this.intersects(geometry.components[i]);if(intersect){break;}}} \
+if(!intersect&&geometry.CLASS_NAME=="OpenLayers.Geometry.Polygon"){var \
ring=this.components[0];for(i=0;i<ring.components.length;++i){intersect=geometry.containsPoint(ring.components[i]);if(intersect){break;}}}
 +return intersect;},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(origin,radius,sides,rotation){var \
angle=Math.PI*((1/sides)-(1/2));if(rotation){angle+=(rotation/180)*Math.PI;} +var \
rotatedAngle,x,y;var points=[];for(var \
i=0;i<sides;++i){rotatedAngle=angle+(i*2*Math.PI/sides);x=origin.x+(radius*Math.cos(rotatedAngle));y=origin.y+(radius*Math.sin(rotatedAngle));points.push(new \
OpenLayers.Geometry.Point(x,y));} +var ring=new \
OpenLayers.Geometry.LinearRing(points);return new \
OpenLayers.Geometry.Polygon([ring]);};OpenLayers.Handler.Point=OpenLayers.Class(OpenLa \
yers.Handler,{point:null,layer:null,drawing:false,mouseDown:false,lastDown:null,lastUp \
:null,initialize:function(control,callbacks,options){this.style=OpenLayers.Util.extend \
(OpenLayers.Feature.Vector.style['default'],{});OpenLayers.Handler.prototype.initializ \
e.apply(this,arguments);},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this,arguments)){return \
false;} +var options={displayInLayerSwitcher:false,calculateInRange:function(){return \
true;}};this.layer=new \
OpenLayers.Layer.Vector(this.CLASS_NAME,options);this.map.addLayer(this.layer);return \
true;},createFeature:function(){this.point=new OpenLayers.Feature.Vector(new \
OpenLayers.Geometry.Point());},deactivate:function(){if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){return \
false;} +if(this.drawing){this.cancel();}
+if(this.layer.map!=null){this.layer.destroy(false);}
+this.layer=null;return \
true;},destroyFeature:function(){if(this.point){this.point.destroy();} \
+this.point=null;},finalize:function(){this.layer.renderer.clear();this.drawingúlse;th \
is.mouseDownúlse;this.lastDown=null;this.lastUp=null;this.callback("done",[this.geomet \
ryClone()]);this.destroyFeature();},cancel:function(){this.layer.renderer.clear();this \
.drawingúlse;this.mouseDownúlse;this.lastDown=null;this.lastUp=null;this.callback("can \
cel",[this.geometryClone()]);this.destroyFeature();},click:function(evt){OpenLayers.Event.stop(evt);return \
false;},dblclick:function(evt){OpenLayers.Event.stop(evt);return \
false;},drawFeature:function(){this.layer.drawFeature(this.point,this.style);},geometryClone:function(){return \
this.point.geometry.clone();},mousedown:function(evt){if(!this.checkModifiers(evt)){return \
true;} +if(this.lastDown&&this.lastDown.equals(evt.xy)){return true;}
+if(this.lastDown==null){this.createFeature();}
+this.lastDown=evt.xy;this.drawing=true;var \
lonlat=this.map.getLonLatFromPixel(evt.xy);this.point.geometry.x=lonlat.lon;this.point.geometry.y=lonlat.lat;this.drawFeature();return \
false;},mousemove:function(evt){if(this.drawing){var \
lonlat=this.map.getLonLatFromPixel(evt.xy);this.point.geometry.x=lonlat.lon;this.point.geometry.y=lonlat.lat;this.point.geometry.clearBounds();this.drawFeature();}
 +return true;},mouseup:function(evt){if(this.drawing){this.finalize();return \
false;}else{return true;}},CLASS_NAME:"OpenLayers.Handler.Point"});OpenLayers.Layer.GM \
L=OpenLayers.Class(OpenLayers.Layer.Vector,{loaded:false,format:null,formatOptions:null,initialize:function(name,url,options){var \
newArguments=[];newArguments.push(name,options);OpenLayers.Layer.Vector.prototype.init \
ialize.apply(this,newArguments);this.url=url;},setVisibility:function(visibility,noEve \
nt){OpenLayers.Layer.Vector.prototype.setVisibility.apply(this,arguments);if(this.visi \
bility&&!this.loaded){this.loadGML();}},moveTo:function(bounds,zoomChanged,minor){Open \
Layers.Layer.Vector.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.l \
oaded){this.events.triggerEvent("loadstart");this.loadGML();}},loadGML:function(){if(!this.loaded){var \
results=OpenLayers.loadURL(this.url,null,this,this.requestSuccess,this.requestFailure);this.loaded=true;}},setUrl:function(url){this.url=url;this.destroyFeatures();
  this.loadedúlse;this.events.triggerEvent("loadstart");this.loadGML();},requestSuccess:function(request){var \
doc=request.responseXML;if(!doc||!doc.documentElement){doc=request.responseText;} \
+var options={};OpenLayers.Util.extend(options,this.formatOptions);if(this.map&&!this. \
projection.equals(this.map.getProjectionObject())){options.externalProjection=this.projection;options.internalProjection=this.map.getProjectionObject();}
 +var gml=this.format?new this.format(options):new \
OpenLayers.Format.GML(options);this.addFeatures(gml.read(doc));this.events.triggerEven \
t("loadend");},requestFailure:function(request){alert(OpenLayers.i18n("errorLoadingGML \
",{'url':this.url}));this.events.triggerEvent("loadend");},CLASS_NAME:"OpenLayers.Laye \
r.GML"});OpenLayers.Layer.PointTrack=OpenLayers.Class(OpenLayers.Layer.Vector,{dataFro \
m:null,initialize:function(name,options){OpenLayers.Layer.Vector.prototype.initialize. \
apply(this,arguments);},addNodes:function(pointFeatures){if(pointFeatures.length<2){OpenLayers.Console.error("At \
least two point features have to be added to create"+"a line from");return;} +var \
lines=new Array(pointFeatures.length-1);var pointFeature,startPoint,endPoint;for(var \
i=0;i<pointFeatures.length;i++){pointFeature=pointFeatures[i];endPoint=pointFeature.geometry;if(!endPoint){var \
lonlat=pointFeature.lonlat;endPoint=new \
OpenLayers.Geometry.Point(lonlat.lon,lonlat.lat);}else \
if(endPoint.CLASS_NAME!="OpenLayers.Geometry.Point"){OpenLayers.Console.error("Only \
features with point geometries are supported.");return;} +if(i>0){var \
attributes=(this.dataFrom!=null)?(pointFeatures[i+this.dataFrom].data||pointFeatures[i+this.dataFrom].attributes):null;var \
line=new OpenLayers.Geometry.LineString([startPoint,endPoint]);lines[i-1]=new \
OpenLayers.Feature.Vector(line,attributes);} +startPoint=endPoint;}
+this.addFeatures(lines);},CLASS_NAME:"OpenLayers.Layer.PointTrack"});OpenLayers.Layer \
.PointTrack.dataFrom={'SOURCE_NODE':-1,'TARGET_NODE':0};OpenLayers.Layer.WFS=OpenLayer \
s.Class(OpenLayers.Layer.Vector,OpenLayers.Layer.Markers,{isBaseLayer:false,tile:null, \
ratio:2,DEFAULT_PARAMS:{service:"WFS",version:"1.0.0",request:"GetFeature"},featureCla \
ss:null,format:null,formatObject:null,formatOptions:null,vectorMode:true,encodeBBOX:fa \
lse,extractAttributes:false,initialize:function(name,url,params,options){if(options==undefined){options={};}
 +if(options.featureClass||!OpenLayers.Layer.Vector||!OpenLayers.Feature.Vector){this.vectorModeúlse;}
 +OpenLayers.Util.extend(options,{'reportError':false});var \
newArguments=[];newArguments.push(name,options);OpenLayers.Layer.Vector.prototype.init \
ialize.apply(this,newArguments);if(!this.renderer||!this.vectorMode){this.vectorModeúlse;if(!options.featureClass){options.featureClass=OpenLayers.Feature.WFS;}
 +OpenLayers.Layer.Markers.prototype.initialize.apply(this,newArguments);}
+if(this.params&&this.params.typename&&!this.options.typename){this.options.typename=this.params.typename;}
 +if(!this.options.geometry_column){this.options.geometry_column="the_geom";}
+this.params=params;OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCas \
eObject(this.DEFAULT_PARAMS));this.url=url;},destroy:function(){if(this.vectorMode){Op \
enLayers.Layer.Vector.prototype.destroy.apply(this,arguments);}else{OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);}
 +if(this.tile){this.tile.destroy();}
+this.tile=null;this.ratio=null;this.featureClass=null;this.format=null;if(this.formatObject&&this.formatObject.destroy){this.formatObject.destroy();}
 +this.formatObject=null;this.formatOptions=null;this.vectorMode=null;this.encodeBBOX= \
null;this.extractAttributes=null;},setMap:function(map){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);var \
options={'extractAttributes':this.extractAttributes};OpenLayers.Util.extend(options,th \
is.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject()) \
){options.externalProjection=this.projection;options.internalProjection=this.map.getProjectionObject();}
 +this.formatObject=this.format?new this.format(options):new \
OpenLayers.Format.GML(options);}else{OpenLayers.Layer.Markers.prototype.setMap.apply(t \
his,arguments);}},moveTo:function(bounds,zoomChanged,dragging){if(this.vectorMode){Ope \
nLayers.Layer.Vector.prototype.moveTo.apply(this,arguments);}else{OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);}
 +if(dragging){return false;}
+if(zoomChanged){if(this.vectorMode){this.renderer.clear();}}
+if(this.options.minZoomLevel){OpenLayers.Console.warn(OpenLayers.i18n('minZoomLevelError'));if(this.map.getZoom()<this.options.minZoomLevel){return \
null;}} +if(bounds==null){bounds=this.map.getExtent();}
+var firstRendering=(this.tile==null);var \
outOfBounds=(!firstRendering&&!this.tile.bounds.containsBounds(bounds));if(zoomChanged||firstRendering||(!dragging&&outOfBounds)){var \
center=bounds.getCenterLonLat();var tileWidth=bounds.getWidth()*this.ratio;var \
tileHeight=bounds.getHeight()*this.ratio;var tileBounds=new \
OpenLayers.Bounds(center.lon-(tileWidth/2),center.lat-(tileHeight/2),center.lon+(tileWidth/2),center.lat+(tileHeight/2));var \
tileSize=this.map.getSize();tileSize.w=tileSize.w*this.ratio;tileSize.h=tileSize.h*this.ratio;var \
ul=new OpenLayers.LonLat(tileBounds.left,tileBounds.top);var \
pos=this.map.getLayerPxFromLonLat(ul);var url=this.getFullRequestString();var \
params={BBOX:this.encodeBBOX?tileBounds.toBBOX():tileBounds.toArray()};if(this.map&&!this.projection.equals(this.map.getProjectionObject())){var \
projectedBounds=tileBounds.clone();projectedBounds.transform(this.map.getProjectionObj \
ect(),this.projection);params.BBOX=this.encodeBBOX?projectedBounds.toBBOX():projec  \
tedBounds.toArray();} \
+url+="&"+OpenLayers.Util.getParameterString(params);if(!this.tile){this.tile=new \
OpenLayers.Tile.WFS(this,pos,tileBounds,url,tileSize);this.addTileMonitoringHooks(this \
.tile);this.tile.draw();}else{if(this.vectorMode){this.destroyFeatures();this.renderer.clear();}else{this.clearMarkers();}
 +this.removeTileMonitoringHooks(this.tile);this.tile.destroy();this.tile=null;this.tile=new \
OpenLayers.Tile.WFS(this,pos,tileBounds,url,tileSize);this.addTileMonitoringHooks(this \
.tile);this.tile.draw();}}},addTileMonitoringHooks:function(tile){tile.onLoadStart=fun \
ction(){if(this==this.layer.tile){this.layer.events.triggerEvent("loadstart");}};tile. \
events.register("loadstart",tile,tile.onLoadStart);tile.onLoadEnd=function(){if(this== \
this.layer.tile){this.layer.events.triggerEvent("tileloaded");this.layer.events.trigge \
rEvent("loadend");}};tile.events.register("loadend",tile,tile.onLoadEnd);tile.events.r \
egister("unload",tile,tile.onLoadEnd);},removeTileMonitoringHooks:function(tile){tile. \
unload();tile.events.un({"loadstart":tile.onLoadStart,"loadend":tile.onLoadEnd,"unload \
":tile.onLoadEnd,scope:tile});},onMapResize:function(){if(this.vectorMode){OpenLayers. \
Layer.Vector.prototype.onMapResize.apply(this,arguments);}else{OpenLayers.Layer.Markers.prototype.onMapResize.apply(this,arg
  uments);}},mergeNewParams:function(newParams){var \
upperParams=OpenLayers.Util.upperCaseObject(newParams);var \
newArguments=[upperParams];return \
OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,newArguments);},clone:function(obj){if(obj==null){obj=new \
OpenLayers.Layer.WFS(this.name,this.url,this.params,this.options);} \
+if(this.vectorMode){obj=OpenLayers.Layer.Vector.prototype.clone.apply(this,[obj]);}else{obj=OpenLayers.Layer.Markers.prototype.clone.apply(this,[obj]);}
 +return obj;},getFullRequestString:function(newParams,altUrl){var \
projectionCode=this.map.getProjection();this.params.SRS=(projectionCode=="none")?null:projectionCode;return \
OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments);},commit:function(){if(!this.writer){var \
options={};if(this.map&&!this.projection.equals(this.map.getProjectionObject())){optio \
ns.externalProjection=this.projection;options.internalProjection=this.map.getProjectionObject();}
 +this.writer=new OpenLayers.Format.WFS(options,this);}
+var data=this.writer.write(this.features);var url=this.url;var \
success=OpenLayers.Function.bind(this.commitSuccess,this);var \
failure=OpenLayers.Function.bind(this.commitFailure,this);new \
OpenLayers.Ajax.Request(url,{method:'post',postBody:data,onComplete:success,onFailure:failure});},commitSuccess:function(request){var \
response=request.responseText;if(response.indexOf('SUCCESS')!=-1){this.commitReport(OpenLayers.i18n("commitSuccess",{'response':response}));for(var \
i=0;i<this.features.length;i++){this.features[i].state=null;}}else \
if(response.indexOf('FAILED')!=-1||response.indexOf('Exception')!=-1){this.commitRepor \
t(OpenLayers.i18n("commitFailed",{'response':response}));}},commitFailure:function(req \
uest){},commitReport:function(string,response){alert(string);},refresh:function(){if(t \
his.tile){if(this.vectorMode){this.renderer.clear();this.features.length=0;}else{this.clearMarkers();this.markers.length=0;}
 +this.tile.draw();}},CLASS_NAME:"OpenLayers.Layer.WFS"});OpenLayers.Format.SLD.v1=Ope \
nLayers.Class(OpenLayers.Format.XML,{namespaces:{sld:"http://www.opengis.net/sld",ogc: \
"http://www.opengis.net/ogc",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.o \
rg/2001/XMLSchema-instance"},defaultPrefix:"sld",schemaLocation:null,defaultSymbolizer \
:{fillColor:"#808080",fillOpacity:1,strokeColor:"#000000",strokeOpacity:1,strokeWidth: \
1,pointRadius:6},initialize:function(options){OpenLayers.Format.XML.prototype.initialize.apply(this,[options]);},read:function(data){var \
sld={namedLayers:{}};this.readChildNodes(data,sld);return \
sld;},readers:{"sld":{"StyledLayerDescriptor":function(node,sld){sld.version=node.getA \
ttribute("version");this.readChildNodes(node,sld);},"Name":function(node,obj){obj.name \
=this.getChildValue(node);},"Title":function(node,obj){obj.title=this.getChildValue(no \
de);},"Abstract":function(node,obj){obj.description=this.getChildValue(node);},"NamedLayer":function(node,sl
  d){var layer={userStyles:[],namedStyles:[]};this.readChildNodes(node,layer);for(var \
i=0;i<layer.userStyles.length;++i){layer.userStyles[i].layerName=layer.name;} \
+sld.namedLayers[layer.name]=layer;},"NamedStyle":function(node,layer){layer.namedStyl \
es.push(this.getChildName(node.firstChild));},"UserStyle":function(node,layer){var \
style=new OpenLayers.Style(this.defaultSymbolizer);this.readChildNodes(node,style);lay \
er.userStyles.push(style);},"IsDefault":function(node,style){if(this.getChildValue(node)=="1"){style.isDefault=true;}},"FeatureTypeStyle":function(node,style){var \
obj={rules:[]};this.readChildNodes(node,obj);style.rules=obj.rules;},"Rule":function(node,obj){var \
rule=new OpenLayers.Rule();this.readChildNodes(node,rule);obj.rules.push(rule);},"Else \
Filter":function(node,rule){rule.elseFilter=true;},"MinScaleDenominator":function(node \
,rule){rule.minScaleDenominator=this.getChildValue(node);},"MaxScaleDenominator":funct \
ion(node,rule){rule.maxScaleDenominator=this.getChildValue(node);},"LineSymbolizer":function(node,rule){var \
symbolizer=rule.symbolizer["Line"]||{};this.readChildNodes(node,symbolizer);rule.symbolizer["Line"]=symboli
  zer;},"PolygonSymbolizer":function(node,rule){var \
symbolizer=rule.symbolizer["Polygon"]||{};this.readChildNodes(node,symbolizer);rule.symbolizer["Polygon"]=symbolizer;},"PointSymbolizer":function(node,rule){var \
symbolizer=rule.symbolizer["Point"]||{};this.readChildNodes(node,symbolizer);rule.symb \
olizer["Point"]=symbolizer;},"Stroke":function(node,symbolizer){this.readChildNodes(no \
de,symbolizer);},"Fill":function(node,symbolizer){this.readChildNodes(node,symbolizer);},"CssParameter":function(node,symbolizer){var \
cssProperty=node.getAttribute("name");var \
symProperty=this.cssMap[cssProperty];if(symProperty){var \
value=this.readOgcExpression(node);if(value){symbolizer[symProperty]=value;}}},"Graphic":function(node,symbolizer){var \
graphic={};this.readChildNodes(node,graphic);var \
properties=["strokeColor","strokeWidth","strokeOpacity","strokeLinecap","fillColor","fillOpacity","graphicName","rotation","graphicFormat"];var \
prop,value;for(var i=0;i<properties.length;++i){prop=properti  \
es[i];value=graphic[prop];if(value!=undefined){symbolizer[prop]=value;}} \
+if(graphic.opacity!=undefined){symbolizer.graphicOpacity=graphic.opacity;} \
+if(graphic.size!=undefined){symbolizer.pointRadius=graphic.size;} \
+if(graphic.href!=undefined){symbolizer.externalGraphic=graphic.href;}},"ExternalGraph \
ic":function(node,graphic){this.readChildNodes(node,graphic);},"Mark":function(node,gr \
aphic){this.readChildNodes(node,graphic);},"WellKnownName":function(node,graphic){graphic.graphicName=this.getChildValue(node);},"Opacity":function(node,obj){var \
opacity=this.getChildValue(node);if(opacity){obj.opacity=opacity;}},"Size":function(node,obj){var \
size=this.getChildValue(node);if(size){obj.size=size;}},"Rotation":function(node,obj){var \
rotation=this.getChildValue(node);if(rotation){obj.rotation=rotation;}},"OnlineResourc \
e":function(node,obj){obj.href=this.getAttributeNS(node,this.namespaces.xlink,"href"); \
},"Format":function(node,graphic){graphic.graphicFormat=this.getChildValue(node);}},"ogc":{"Filter":function(node,rule){var \
obj={fids:[],filters:[]};this.readChildNodes(node,obj);if(obj.fids.length>0){rule.filter=new \
OpenLayers.Filter.FeatureId({fids:obj.fids});}else if(obj.filters.length>0){rul  \
e.filter=obj.filters[0];}},"FeatureId":function(node,obj){var \
fid=node.getAttribute("fid");if(fid){obj.fids.push(fid);}},"And":function(node,obj){var \
filter=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND});this.readChildNodes(node,filter);obj.filters.push(filter);},"Or":function(node,obj){var \
filter=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR});this.readChildNodes(node,filter);obj.filters.push(filter);},"Not":function(node,obj){var \
filter=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.NOT});this.readCh \
ildNodes(node,filter);obj.filters.push(filter);},"PropertyIsEqualTo":function(node,obj){var \
filter=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO}); \
this.readChildNodes(node,filter);obj.filters.push(filter);},"PropertyIsNotEqualTo":function(node,obj){var \
filter=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO});this.readChildNodes(node,filter);obj.filters.push(fil
  ter);},"PropertyIsLessThan":function(node,obj){var filter=new \
OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN});this.readC \
hildNodes(node,filter);obj.filters.push(filter);},"PropertyIsGreaterThan":function(node,obj){var \
filter=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THA \
N});this.readChildNodes(node,filter);obj.filters.push(filter);},"PropertyIsLessThanOrEqualTo":function(node,obj){var \
filter=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN_O \
R_EQUAL_TO});this.readChildNodes(node,filter);obj.filters.push(filter);},"PropertyIsGreaterThanOrEqualTo":function(node,obj){var \
filter=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THA \
N_OR_EQUAL_TO});this.readChildNodes(node,filter);obj.filters.push(filter);},"PropertyIsBetween":function(node,obj){var \
filter=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN});this.readChildNodes(node,filter);obj
                
 .filters.push(filter);},"PropertyIsLike":function(node,obj){var filter=new \
OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(node,filter);var \
wildCard=node.getAttribute("wildCard");var \
singleChar=node.getAttribute("singleChar");var \
esc=node.getAttribute("escape");filter.value2regex(wildCard,singleChar,esc);obj.filter \
s.push(filter);},"Literal":function(node,obj){obj.value=this.getChildValue(node);},"Pr \
opertyName":function(node,filter){filter.property=this.getChildValue(node);},"LowerBou \
ndary":function(node,filter){filter.lowerBoundary=this.readOgcExpression(node);},"Uppe \
rBoundary":function(node,filter){filter.upperBoundary=this.readOgcExpression(node);}}},readOgcExpression:function(node){var \
obj={};this.readChildNodes(node,obj);var \
value=obj.value;if(!value){value=this.getChildValue(node);} +return \
value;},cssMap:{"stroke":"strokeColor","stroke-opacity":"strokeOpacity","stroke-width" \
:"strokeWidth","stroke-linecap":"strokeLinecap","fill":"fillColor","fill-opacity":"fillOpacity"},getCssProperty:function(sym){var \
css=null;for(var prop in this.cssMap){if(this.cssMap[prop]==sym){css=prop;break;}} \
+return css;},getGraphicFormat:function(href){var format,regex;for(var key in \
this.graphicFormats){if(this.graphicFormats[key].test(href)){format=key;break;}} \
+return format||this.defautlGraphicFormat;},defaultGraphicFormat:"image/png",graphicFo \
rmats:{"image/jpeg":/\.jpe?g$/i,"image/gif":/\.gif$/i,"image/png":/\.png$/i},write:function(sld){return \
this.writers.sld.StyledLayerDescriptor.apply(this,[sld]);},writers:{"sld":{"StyledLayerDescriptor":function(sld){var \
root=this.createElementNSPlus("StyledLayerDescriptor",{attributes:{"version":this.VERS \
ION,"xsi:schemaLocation":this.schemaLocation}});if(sld.name){this.writeNode(root,"Name",sld.name);}
 +if(sld.title){this.writeNode(root,"Title",sld.title);}
+if(sld.description){this.writeNode(root,"Abstract",sld.description);}
+for(var name in sld.namedLayers){this.writeNode(root,"NamedLayer",sld.namedLayers[name]);}
 +return root;},"Name":function(name){return \
this.createElementNSPlus("Name",{value:name});},"Title":function(title){return \
this.createElementNSPlus("Title",{value:title});},"Abstract":function(description){return \
this.createElementNSPlus("Abstract",{value:description});},"NamedLayer":function(layer){var \
node=this.createElementNSPlus("NamedLayer");this.writeNode(node,"Name",layer.name);if(layer.namedStyles){for(var \
i=0;i<layer.namedStyles.length;++i){this.writeNode(node,"NamedStyle",layer.namedStyles[i]);}}
 +if(layer.userStyles){for(var \
i=0;i<layer.userStyles.length;++i){this.writeNode(node,"UserStyle",layer.userStyles[i]);}}
 +return node;},"NamedStyle":function(name){var \
node=this.createElementNSPlus("NamedStyle");this.writeNode(node,"Name",name);return \
node;},"UserStyle":function(style){var \
node=this.createElementNSPlus("UserStyle");if(style.name){this.writeNode(node,"Name",style.name);}
 +if(style.title){this.writeNode(node,"Title",style.title);}
+if(style.description){this.writeNode(node,"Abstract",style.description);}
+if(style.isDefault){this.writeNode(node,"IsDefault",style.isDefault);}
+this.writeNode(node,"FeatureTypeStyle",style);return \
node;},"IsDefault":function(bool){return \
this.createElementNSPlus("IsDefault",{value:(bool)?"1":"0"});},"FeatureTypeStyle":function(style){var \
node=this.createElementNSPlus("FeatureTypeStyle");for(var \
i=0;i<style.rules.length;++i){this.writeNode(node,"Rule",style.rules[i]);} +return \
node;},"Rule":function(rule){var \
node=this.createElementNSPlus("Rule");if(rule.name){this.writeNode(node,"Name",rule.name);}
 +if(rule.title){this.writeNode(node,"Title",rule.title);}
+if(rule.description){this.writeNode(node,"Abstract",rule.description);}
+if(rule.elseFilter){this.writeNode(node,"ElseFilter");}else \
if(rule.filter){this.writeNode(node,"ogc:Filter",rule.filter);} \
+if(rule.minScaleDenominator!=undefined){this.writeNode(node,"MinScaleDenominator",rule.minScaleDenominator);}
 +if(rule.maxScaleDenominator!=undefined){this.writeNode(node,"MaxScaleDenominator",rule.maxScaleDenominator);}
 +var types=OpenLayers.Style.SYMBOLIZER_PREFIXES;var type,symbolizer;for(var \
i=0;i<types.length;++i){type=types[i];symbolizer=rule.symbolizer[type];if(symbolizer){this.writeNode(node,type+"Symbolizer",symbolizer);}}
 +return node;},"ElseFilter":function(){return \
this.createElementNSPlus("ElseFilter");},"MinScaleDenominator":function(scale){return \
this.createElementNSPlus("MinScaleDenominator",{value:scale});},"MaxScaleDenominator":function(scale){return \
this.createElementNSPlus("MaxScaleDenominator",{value:scale});},"LineSymbolizer":function(symbolizer){var \
node=this.createElementNSPlus("LineSymbolizer");this.writeNode(node,"Stroke",symbolizer);return \
node;},"Stroke":function(symbolizer){var \
node=this.createElementNSPlus("Stroke");if(symbolizer.strokeColor!=undefined){this.writeNode(node,"CssParameter",{symbolizer:symbolizer,key:"strokeColor"});}
 +if(symbolizer.strokeOpacity!=undefined){this.writeNode(node,"CssParameter",{symbolizer:symbolizer,key:"strokeOpacity"});}
 +if(symbolizer.strokeWidth!=undefined){this.writeNode(node,"CssParameter",{symbolizer:symbolizer,key:"strokeWidth"});}
 +return node;},"CssParameter":function(obj){return \
this.createElementNSPlus("CssParameter",{attributes:{name:this.getCssProperty(obj.key)},value:obj.symbolizer[obj.key]});},"PolygonSymbolizer":function(symbolizer){var \
node=this.createElementNSPlus("PolygonSymbolizer");this.writeNode(node,"Fill",symbolizer);this.writeNode(node,"Stroke",symbolizer);return \
node;},"Fill":function(symbolizer){var \
node=this.createElementNSPlus("Fill");if(symbolizer.fillColor){this.writeNode(node,"CssParameter",{symbolizer:symbolizer,key:"fillColor"});}
 +if(symbolizer.fillOpacity){this.writeNode(node,"CssParameter",{symbolizer:symbolizer,key:"fillOpacity"});}
 +return node;},"PointSymbolizer":function(symbolizer){var \
node=this.createElementNSPlus("PointSymbolizer");this.writeNode(node,"Graphic",symbolizer);return \
node;},"Graphic":function(symbolizer){var \
node=this.createElementNSPlus("Graphic");if(symbolizer.externalGraphic!=undefined){this.writeNode(node,"ExternalGraphic",symbolizer);}else \
if(symbolizer.graphicName){this.writeNode(node,"Mark",symbolizer);} \
+if(symbolizer.graphicOpacity!=undefined){this.writeNode(node,"Opacity",symbolizer.graphicOpacity);}
 +if(symbolizer.pointRadius!=undefined){this.writeNode(node,"Size",symbolizer.pointRadius);}
 +if(symbolizer.rotation!=undefined){this.writeNode(node,"Rotation",symbolizer.rotation);}
 +return node;},"ExternalGraphic":function(symbolizer){var \
node=this.createElementNSPlus("ExternalGraphic");this.writeNode(node,"OnlineResource",symbolizer.externalGraphic);var \
format=symbolizer.graphicFormat||this.getGraphicFormat(symbolizer.externalGraphic);this.writeNode(node,"Format",format);return \
node;},"Mark":function(symbolizer){var \
node=this.createElementNSPlus("Mark");this.writeNode(node,"WellKnownName",symbolizer.g \
raphicName);this.writeNode(node,"Fill",symbolizer);this.writeNode(node,"Stroke",symbolizer);return \
node;},"WellKnownName":function(name){return \
this.createElementNSPlus("WellKnownName",{value:name});},"Opacity":function(value){return \
this.createElementNSPlus("Opacity",{value:value});},"Size":function(value){return \
this.createElementNSPlus("Size",{value:value});},"Rotation":function(value){return \
this.createElementNSPlus("Rotation",{value:value});},"OnlineResource":function(href){return \
this.createElementNSPlus("OnlineResource",{attributes:{"xlink:type":"si  \
mple","xlink:href":href}});},"Format":function(format){return \
this.createElementNSPlus("Format",{value:format});}},"ogc":{"Filter":function(filter){var \
node=this.createElementNSPlus("ogc:Filter");var \
sub=filter.CLASS_NAME.split(".").pop();if(sub=="FeatureId"){for(var \
i=0;i<filter.fids.length;++i){this.writeNode(node,"FeatureId",filter.fids[i]);}}else{this.writeNode(node,this.getFilterType(filter),filter);}
 +return node;},"FeatureId":function(fid){return \
this.createElementNSPlus("ogc:FeatureId",{attributes:{fid:fid}});},"And":function(filter){var \
node=this.createElementNSPlus("ogc:And");var childFilter;for(var \
i=0;i<filter.filters.length;++i){childFilter=filter.filters[i];this.writeNode(node,this.getFilterType(childFilter),childFilter);}
 +return node;},"Or":function(filter){var node=this.createElementNSPlus("ogc:Or");var \
childFilter;for(var i=0;i<filter.filters.length;++i){childFilter=filter.filters[i];this.writeNode(node,this.getFilterType(childFilter),childFilter);}
 +return node;},"Not":function(filter){var \
node=this.createElementNSPlus("ogc:Not");var \
childFilter=filter.filters[0];this.writeNode(node,this.getFilterType(childFilter),childFilter);return \
node;},"PropertyIsEqualTo":function(filter){var \
node=this.createElementNSPlus("ogc:PropertyIsEqualTo");this.writeNode(node,"PropertyName",filter);this.writeNode(node,"Literal",filter.value);return \
node;},"PropertyIsNotEqualTo":function(filter){var \
node=this.createElementNSPlus("ogc:PropertyIsNotEqualTo");this.writeNode(node,"PropertyName",filter);this.writeNode(node,"Literal",filter.value);return \
node;},"PropertyIsLessThan":function(filter){var \
node=this.createElementNSPlus("ogc:PropertyIsLessThan");this.writeNode(node,"PropertyName",filter);this.writeNode(node,"Literal",filter.value);return \
node;},"PropertyIsGreaterThan":function(filter){var \
node=this.createElementNSPlus("ogc:PropertyIsGreaterThan");this.writeNode(node,"PropertyName",filter);this.writeNode(node,"Literal",filter.value);retu
  rn node;},"PropertyIsLessThanOrEqualTo":function(filter){var \
node=this.createElementNSPlus("ogc:PropertyIsLessThanOrEqualTo");this.writeNode(node,"PropertyName",filter);this.writeNode(node,"Literal",filter.value);return \
node;},"PropertyIsGreaterThanOrEqualTo":function(filter){var \
node=this.createElementNSPlus("ogc:PropertyIsGreaterThanOrEqualTo");this.writeNode(node,"PropertyName",filter);this.writeNode(node,"Literal",filter.value);return \
node;},"PropertyIsBetween":function(filter){var \
node=this.createElementNSPlus("ogc:PropertyIsBetween");this.writeNode(node,"PropertyNa \
me",filter);this.writeNode(node,"LowerBoundary",filter);this.writeNode(node,"UpperBoundary",filter);return \
node;},"PropertyIsLike":function(filter){var \
node=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{wildCard:"*",singleCha \
r:".",escape:"!"}});this.writeNode(node,"PropertyName",filter);this.writeNode(node,"Literal",filter.regex2value());return \
node;},"PropertyName":function(filter){return this.c  \
reateElementNSPlus("ogc:PropertyName",{value:filter.property});},"Literal":function(value){return \
this.createElementNSPlus("ogc:Literal",{value:value});},"LowerBoundary":function(filter){var \
node=this.createElementNSPlus("ogc:LowerBoundary");this.writeNode(node,"Literal",filter.lowerBoundary);return \
node;},"UpperBoundary":function(filter){var \
node=this.createElementNSPlus("ogc:UpperBoundary");this.writeNode(node,"Literal",filter.upperBoundary);return \
node;}}},getFilterType:function(filter){var \
filterType=this.filterMap[filter.type];if(!filterType){throw"SLD writing not \
supported for rule type: "+filter.type;} +return \
filterType;},filterMap:{"&&":"And","||":"Or","!":"Not","==":"PropertyIsEqualTo","!=":" \
PropertyIsNotEqualTo","<":"PropertyIsLessThan",">":"PropertyIsGreaterThan","<=":"Prope \
rtyIsLessThanOrEqualTo",">=":"PropertyIsGreaterThanOrEqualTo","..":"PropertyIsBetween","~":"PropertyIsLike"},getNamespacePrefix:function(uri){var \
prefix=null;if(uri==null){prefix=this.namespaces[this.defaultPrefix];}else{var \
gotPrefixúlse;for(prefix in \
this.namespaces){if(this.namespaces[prefix]==uri){gotPrefix=true;break;}} \
+if(!gotPrefix){prefix=null;}} +return prefix;},readChildNodes:function(node,obj){var \
children=node.childNodes;var child,group,reader,prefix,local;for(var \
i=0;i<children.length;++i){child=children[i];if(child.nodeType==1){prefix=this.getName \
spacePrefix(child.namespaceURI);local=child.nodeName.split(":").pop();group=this.reade \
rs[prefix];if(group){reader=group[local];if(reader){reader.apply(this,[child,obj]);}}}}},writeNode:function(parent,name,obj){var \
prefix,local;var split=name.indexOf(":");if(split>0){prefix=name.substring(0,split);lo \
cal=name.substring(split+1);}else{prefix=this.getNamespacePrefix(parent.namespaceURI);local=name;}
 +var child=this.writers[prefix][local].apply(this,[obj]);parent.appendChild(child);return \
child;},createElementNSPlus:function(name,options){options=options||{};var \
loc=name.indexOf(":");var \
uri=options.uri||this.namespaces[options.prefix];if(!uri){loc=name.indexOf(":");uri=this.namespaces[name.substring(0,loc)];}
 +if(!uri){uri=this.namespaces[this.defaultPrefix];}
+var node=this.createElementNS(uri,name);if(options.attributes){this.setAttributes(node,options.attributes);}
 +if(options.value){node.appendChild(this.createTextNode(options.value));}
+return node;},setAttributes:function(node,obj){var value,loc,alias,uri;for(var name \
in obj){value=obj[name].toString();uri=this.namespaces[name.substring(0,name.indexOf(" \
:"))]||null;this.setAttributeNS(node,uri,name,value);}},CLASS_NAME:"OpenLayers.Format. \
SLD.v1"});OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{c \
omponentTypes:["OpenLayers.Geometry.Point"],initialize:function(points){OpenLayers.Geo \
metry.MultiPoint.prototype.initialize.apply(this,arguments);},getLength:function(){var \
length=0.0;if(this.components&&(this.components.length>1)){for(var \
i=1;i<this.components.length;i++){length+=this.components[i-1].distanceTo(this.components[i]);}}
 +return length;},CLASS_NAME:"OpenLayers.Geometry.Curve"});OpenLayers.Format.SLD.v1_0_ \
0=OpenLayers.Class(OpenLayers.Format.SLD.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/sld \
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd",initialize:function(op \
tions){OpenLayers.Format.SLD.v1.prototype.initialize.apply(this,[options]);},CLASS_NAM \
E:"OpenLayers.Format.SLD.v1_0_0"});OpenLayers.Geometry.LineString=OpenLayers.Class(Ope \
nLayers.Geometry.Curve,{initialize:function(points){OpenLayers.Geometry.Curve.prototyp \
e.initialize.apply(this,arguments);},removeComponent:function(point){if(this.component \
s&&(this.components.length>2)){OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);}},intersects:function(geometry){var \
intersectúlse;var type=geometry.CLASS_NAME;if(type=="OpenLayers.Geometry.LineString"||type=="OpenLayers.Geometry.LinearRing"||type=="OpenLayers.Geometry.Point"){var \
segs1=this.getSortedSegments();var segs2;if(type=="OpenLa  \
yers.Geometry.Point"){segs2=[{x1:geometry.x,y1:geometry.y,x2:geometry.x,y2:geometry.y}];}else{segs2=geometry.getSortedSegments();}
 +var seg1,seg1x1,seg1x2,seg1y1,seg1y2,seg2,seg2y1,seg2y2;outer:for(var \
i=0;i<segs1.length;++i){seg1=segs1[i];seg1x1=seg1.x1;seg1x2=seg1.x2;seg1y1=seg1.y1;seg1y2=seg1.y2;inner:for(var \
j=0;j<segs2.length;++j){seg2=segs2[j];if(seg2.x1>seg1x2){break;} \
+if(seg2.x2<seg1x1){continue;} \
+seg2y1=seg2.y1;seg2y2=seg2.y2;if(Math.min(seg2y1,seg2y2)>Math.max(seg1y1,seg1y2)){continue;}
 +if(Math.max(seg2y1,seg2y2)<Math.min(seg1y1,seg1y2)){continue;}
+if(OpenLayers.Geometry.segmentsIntersect(seg1,seg2)){intersect=true;break \
outer;}}}}else{intersect=geometry.intersects(this);} +return \
intersect;},getSortedSegments:function(){var numSeg=this.components.length-1;var \
segments=new Array(numSeg);for(var \
i=0;i<numSeg;++i){point1=this.components[i];point2=this.components[i+1];if(point1.x<po \
int2.x){segments[i]={x1:point1.x,y1:point1.y,x2:point2.x,y2:point2.y};}else{segments[i]={x1:point2.x,y1:point2.y,x2:point1.x,y2:point1.y};}}
 +function byX1(seg1,seg2){return seg1.x1-seg2.x1;}
+return segments.sort(byX1);},CLASS_NAME:"OpenLayers.Geometry.LineString"});OpenLayers \
.Format.GML=OpenLayers.Class(OpenLayers.Format.XML,{featureNS:"http://mapserver.gis.um \
n.edu/mapserver",featurePrefix:"feature",featureName:"featureMember",layerName:"featur \
es",geometryName:"geometry",collectionName:"FeatureCollection",gmlns:"http://www.openg \
is.net/gml",extractAttributes:true,xy:true,initialize:function(options){this.regExes={ \
trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g \
)};OpenLayers.Format.XML.prototype.initialize.apply(this,[options]);},read:function(data){if(typeof \
data=="string"){data=OpenLayers.Format.XML.prototype.read.apply(this,[data]);} +var \
featureNodes=this.getElementsByTagNameNS(data.documentElement,this.gmlns,this.featureName);var \
features=[];for(var i=0;i<featureNodes.length;i++){var \
feature=this.parseFeature(featureNodes[i]);if(feature){features.push(feature);}} \
+return features;},parseFeature:function(node){var \
order=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope"];var \
type,nodeList,geometry,parser;for(var \
i=0;i<order.length;++i){type=order[i];nodeList=this.getElementsByTagNameNS(node,this.gmlns,type);if(nodeList.length>0){var \
parser=this.parseGeometry[type.toLowerCase()];if(parser){geometry=parser.apply(this,[n \
odeList[0]]);if(this.internalProjection&&this.externalProjection){geometry.transform(t \
his.externalProjection,this.internalProjection);}}else{OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{'geomType':type}));}
 +break;}}
+var attributes;if(this.extractAttributes){attributes=this.parseAttributes(node);}
+var feature=new OpenLayers.Feature.Vector(geometry,attributes);var \
childNode=node.firstChild;var \
fid;while(childNode){if(childNode.nodeType==1){fid=childNode.getAttribute("fid")||childNode.getAttribute("id");if(fid){break;}}
 +childNode=childNode.nextSibling;}
+feature.fid=fid;return feature;},parseGeometry:{point:function(node){var \
nodeList,coordString;var coords=[];var \
nodeList=this.getElementsByTagNameNS(node,this.gmlns,"pos");if(nodeList.length>0){coor \
dString=nodeList[0].firstChild.nodeValue;coordString=coordString.replace(this.regExes.trimSpace,"");coords=coordString.split(this.regExes.splitSpace);}
 +if(coords.length==0){nodeList=this.getElementsByTagNameNS(node,this.gmlns,"coordinat \
es");if(nodeList.length>0){coordString=nodeList[0].firstChild.nodeValue;coordString=coordString.replace(this.regExes.removeSpace,"");coords=coordString.split(",");}}
 +if(coords.length==0){nodeList=this.getElementsByTagNameNS(node,this.gmlns,"coord");if(nodeList.length>0){var \
xList=this.getElementsByTagNameNS(nodeList[0],this.gmlns,"X");var \
yList=this.getElementsByTagNameNS(nodeList[0],this.gmlns,"Y");if(xList.length>0&&yList \
.length>0){coords=[xList[0].firstChild.nodeValue,yList[0].firstChild.nodeValue];}}} \
+if(coords.length==2){coords[2]=null;} +if(this.xy){return new \
OpenLayers.Geometry.Point(coords[0],coords[1],coords[2]);} +else{return new \
OpenLayers.Geometry.Point(coords[1],coords[0],coords[2]);}},multipoint:function(node){var \
nodeList=this.getElementsByTagNameNS(node,this.gmlns,"Point");var \
components=[];if(nodeList.length>0){var point;for(var \
i=0;i<nodeList.length;++i){point=this.parseGeometry.point.apply(this,[nodeList[i]]);if(point){components.push(point);}}}
 +return new OpenLayers.Geometry.MultiPoint(components);},linestring:function(node,ring){var \
nodeList,coordString;var coords=[];var \
points=[];nodeList=this.getElementsByTagNameNS(node,this.gmlns,"posList");if(nodeList. \
length>0){coordString=this.concatChildValues(nodeList[0]);coordString=coordString.repl \
ace(this.regExes.trimSpace,"");coords=coordString.split(this.regExes.splitSpace);var \
dim=parseInt(nodeList[0].getAttribute("dimension"));var j,x,y,z;for(var \
i=0;i<coords.length/dim;++i){j=i*dim;x=coords[j];y=coords[j+1];z=(dim==2)?null:coords[j+2];if(this.xy){points.push(new \
OpenLayers.Geometry.Point(x,y,z));}else{points.push(new \
OpenLayers.Geometry.Point(y,x,z));}}} \
+if(coords.length==0){nodeList=this.getElementsByTagNameNS(node,this.gmlns,"coordinate \
s");if(nodeList.length>0){coordString=this.concatChildValues(nodeList[0]);coordString= \
coordString.replace(this.regExes.trimSpace,"");coordString=coordString.replace(this.regExes.trimComma,",");var \
pointList=coordString.split(this.regExes.splitSpace);for(var \
i=0;i<pointList.length;++i){coords=pointList[i].split(",");if(coords.length==2){coords[2]=null;}
 +if(this.xy){points.push(new \
OpenLayers.Geometry.Point(coords[0],coords[1],coords[2]));}else{points.push(new \
OpenLayers.Geometry.Point(coords[1],coords[0],coords[2]));}}}} +var \
line=null;if(points.length!=0){if(ring){line=new \
OpenLayers.Geometry.LinearRing(points);}else{line=new \
OpenLayers.Geometry.LineString(points);}} +return \
line;},multilinestring:function(node){var \
nodeList=this.getElementsByTagNameNS(node,this.gmlns,"LineString");var \
components=[];if(nodeList.length>0){var line;for(var \
i=0;i<nodeList.length;++i){line=this.parseGeometry.linestring.apply(this,[nodeList[i]]);if(line){components.push(line);}}}
 +return new OpenLayers.Geometry.MultiLineString(components);},polygon:function(node){var \
nodeList=this.getElementsByTagNameNS(node,this.gmlns,"LinearRing");var \
components=[];if(nodeList.length>0){var ring;for(var \
i=0;i<nodeList.length;++i){ring=this.parseGeometry.linestring.apply(this,[nodeList[i],true]);if(ring){components.push(ring);}}}
 +return new OpenLayers.Geometry.Polygon(components);},multipolygon:function(node){var \
nodeList=this.getElementsByTagNameNS(node,this.gmlns,"Polygon");var \
components=[];if(nodeList.length>0){var polygon;for(var \
i=0;i<nodeList.length;++i){polygon=this.parseGeometry.polygon.apply(this,[nodeList[i]]);if(polygon){components.push(polygon);}}}
 +return new OpenLayers.Geometry.MultiPolygon(components);},envelope:function(node){var \
components=[];var coordString;var envelope;var \
lpoint=this.getElementsByTagNameNS(node,this.gmlns,"lowerCorner");if(lpoint.length>0){var \
coords=[];if(lpoint.length>0){coordString=lpoint[0].firstChild.nodeValue;coordString=c \
oordString.replace(this.regExes.trimSpace,"");coords=coordString.split(this.regExes.splitSpace);}
 +if(coords.length==2){coords[2]=null;}
+if(this.xy){var lowerPoint=new \
OpenLayers.Geometry.Point(coords[0],coords[1],coords[2]);}else{var lowerPoint=new \
OpenLayers.Geometry.Point(coords[1],coords[0],coords[2]);}} +var \
upoint=this.getElementsByTagNameNS(node,this.gmlns,"upperCorner");if(upoint.length>0){var \
coords=[];if(upoint.length>0){coordString=upoint[0].firstChild.nodeValue;coordString=c \
oordString.replace(this.regExes.trimSpace,"");coords=coordString.split(this.regExes.splitSpace);}
 +if(coords.length==2){coords[2]=null;}
+if(this.xy){var upperPoint=new \
OpenLayers.Geometry.Point(coords[0],coords[1],coords[2]);}else{var upperPoint=new \
OpenLayers.Geometry.Point(coords[1],coords[0],coords[2]);}} \
+if(lowerPoint&&upperPoint){components.push(new \
OpenLayers.Geometry.Point(lowerPoint.x,lowerPoint.y));components.push(new \
OpenLayers.Geometry.Point(upperPoint.x,lowerPoint.y));components.push(new \
OpenLayers.Geometry.Point(upperPoint.x,upperPoint.y));components.push(new \
OpenLayers.Geometry.Point(lowerPoint.x,upperPoint.y));components.push(new \
OpenLayers.Geometry.Point(lowerPoint.x,lowerPoint.y));var ring=new \
OpenLayers.Geometry.LinearRing(components);envelope=new \
OpenLayers.Geometry.Polygon([ring]);} +return \
envelope;}},parseAttributes:function(node){var attributes={};var \
childNode=node.firstChild;var \
children,i,child,grandchildren,grandchild,name,value;while(childNode){if(childNode.nod \
eType==1){children=childNode.childNodes;for(i=0;i<children.length;++i){child=children[ \
i];if(child.nodeType==1){grandchildren=child.childNodes;if(grandchildren.length==1){gr \
andchild=grandchildren[0];if(grandchild.nodeType==3||grandchild.nodeType==4){name=(chi \
ld.prefix)?child.nodeName.split(":")[1]:child.nodeName;value=grandchild.nodeValue.replace(this.regExes.trimSpace,"");attributes[name]=value;}}}}
 +break;}
+childNode=childNode.nextSibling;}
+return attributes;},write:function(features){if(!(features instanceof \
Array)){features=[features];} +var \
gml=this.createElementNS("http://www.opengis.net/wfs","wfs:"+this.collectionName);for(var \
i=0;i<features.length;i++){gml.appendChild(this.createFeatureXML(features[i]));} \
+return OpenLayers.Format.XML.prototype.write.apply(this,[gml]);},createFeatureXML:function(feature){var \
geometryþature.geometry;var geometryNode=this.buildGeometryNode(geometry);var \
geomContainer=this.createElementNS(this.featureNS,this.featurePrefix+":"+ \
+this.geometryName);geomContainer.appendChild(geometryNode);var \
featureNode=this.createElementNS(this.gmlns,"gml:"+this.featureName);var \
featureContainer=this.createElementNS(this.featureNS,this.featurePrefix+":"+ \
+this.layerName);var \
fidþature.fid||feature.id;featureContainer.setAttribute("fid",fid);featureContainer.appendChild(geomContainer);for(var \
attr in feature.attributes){var \
attrText=this.createTextNode(feature.attributes[attr]);var \
nodename=attr.substring(attr.lastIndexOf(":")+1);var \
attrContainer=this.createElementNS(this.featureNS,this.featurePrefix+":"+ \
+nodename);attrContainer.appendChild(attrText);featureContainer.appendChild(attrContainer);}
 +featureNode.appendChild(featureContainer);return \
featureNode;},buildGeometryNode:function(geometry){if(this.externalProjection&&this.in \
ternalProjection){geometry=geometry.clone();geometry.transform(this.internalProjection,this.externalProjection);}
 +var className=geometry.CLASS_NAME;var \
type=className.substring(className.lastIndexOf(".")+1);var \
builder=this.buildGeometry[type.toLowerCase()];return \
builder.apply(this,[geometry]);},buildGeometry:{point:function(geometry){var \
gml=this.createElementNS(this.gmlns,"gml:Point");gml.appendChild(this.buildCoordinatesNode(geometry));return \
gml;},multipoint:function(geometry){var \
gml=this.createElementNS(this.gmlns,"gml:MultiPoint");var \
points=geometry.components;var pointMember,pointGeom;for(var \
i=0;i<points.length;i++){pointMember=this.createElementNS(this.gmlns,"gml:pointMember" \
);pointGeom=this.buildGeometry.point.apply(this,[points[i]]);pointMember.appendChild(pointGeom);gml.appendChild(pointMember);}
 +return gml;},linestring:function(geometry){var \
gml=this.createElementNS(this.gmlns,"gml:LineString");gml.appendChild(this.buildCoordinatesNode(geometry));return \
gml;},multilinestring:function(geometry){var \
gml=this.createElementNS(this.gmlns,"gml:MultiLineString");var \
lines=geometry.components;var lineMember,lineGeom;for(var \
i=0;i<lines.length;++i){lineMember=this.createElementNS(this.gmlns,"gml:lineStringMemb \
er");lineGeom=this.buildGeometry.linestring.apply(this,[lines[i]]);lineMember.appendChild(lineGeom);gml.appendChild(lineMember);}
 +return gml;},linearring:function(geometry){var \
gml=this.createElementNS(this.gmlns,"gml:LinearRing");gml.appendChild(this.buildCoordinatesNode(geometry));return \
gml;},polygon:function(geometry){var \
gml=this.createElementNS(this.gmlns,"gml:Polygon");var rings=geometry.components;var \
ringMember,ringGeom,type;for(var \
i=0;i<rings.length;++i){type=(i==0)?"outerBoundaryIs":"innerBoundaryIs";ringMember=thi \
s.createElementNS(this.gmlns,"gml:"+type);ringGeom=this.buildGeometry.linearring.apply(this,[rings[i]]);ringMember.appendChild(ringGeom);gml.appendChild(ringMember);}
 +return gml;},multipolygon:function(geometry){var \
gml=this.createElementNS(this.gmlns,"gml:MultiPolygon");var \
polys=geometry.components;var polyMember,polyGeom;for(var \
i=0;i<polys.length;++i){polyMember=this.createElementNS(this.gmlns,"gml:polygonMember" \
);polyGeom=this.buildGeometry.polygon.apply(this,[polys[i]]);polyMember.appendChild(polyGeom);gml.appendChild(polyMember);}
 +return gml;}},buildCoordinatesNode:function(geometry){var \
coordinatesNode=this.createElementNS(this.gmlns,"gml:coordinates");coordinatesNode.set \
Attribute("decimal",".");coordinatesNode.setAttribute("cs",",");coordinatesNode.setAttribute("ts"," \
");var points=(geometry.components)?geometry.components:[geometry];var \
parts=[];for(var i=0;i<points.length;i++){parts.push(points[i].x+","+points[i].y);} \
+var txtNode=this.createTextNode(parts.join(" \
"));coordinatesNode.appendChild(txtNode);return \
coordinatesNode;},CLASS_NAME:"OpenLayers.Format.GML"});OpenLayers.Format.GeoJSON=OpenL \
ayers.Class(OpenLayers.Format.JSON,{initialize:function(options){OpenLayers.Format.JSO \
N.prototype.initialize.apply(this,[options]);},read:function(json,type,filter){type=(type)?type:"FeatureCollection";var \
results=null;var obj=null;if(typeof \
json=="string"){obj=OpenLayers.Format.JSON.prototype.read.apply(this,[json,filter]);}else{obj=json;}
 +if(!obj){OpenLayers.Console.error("Bad JSON: "+json);}else \
if(typeof(obj.type)!="string"){OpenLayers.Console.error("Bad GeoJSON - no type: \
"+json);}else if(this.isValidType(obj,type)){switch(type){case"Geometry":try{results=this.parseGeometry(obj);}catch(err){OpenLayers.Console.error(err);}
 +break;case"Feature":try{results=this.parseFeature(obj);results.type="Feature";}catch(err){OpenLayers.Console.error(err);}
 +break;case"FeatureCollection":results=[];switch(obj.type){case"Feature":try{results. \
push(this.parseFeature(obj));}catch(err){results=null;OpenLayers.Console.error(err);} \
+break;case"FeatureCollection":for(var \
i=0;i<obj.features.length;++i){try{results.push(this.parseFeature(obj.features[i]));}catch(err){results=null;OpenLayers.Console.error(err);}}
 +break;default:try{var geom=this.parseGeometry(obj);results.push(new \
OpenLayers.Feature.Vector(geom));}catch(err){results=null;OpenLayers.Console.error(err);}}
 +break;}}
+return results;},isValidType:function(obj,type){var \
validúlse;switch(type){case"Geometry":if(OpenLayers.Util.indexOf(["Point","MultiPoint" \
,"LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],obj.type)==-1){OpenLayers.Console.error("Unsupported \
geometry type: "+ +obj.type);}else{valid=true;}
+break;case"FeatureCollection":valid=true;break;default:if(obj.type==type){valid=true;}else{OpenLayers.Console.error("Cannot \
convert types from "+ +obj.type+" to "+type);}}
+return valid;},parseFeature:function(obj){var \
feature,geometry,attributes;attributes=(obj.properties)?obj.properties:{};try{geometry=this.parseGeometry(obj.geometry);}catch(err){throw \
err;} +feature=new OpenLayers.Feature.Vector(geometry,attributes);if(obj.id){feature.fid=obj.id;}
 +return feature;},parseGeometry:function(obj){var \
geometry;if(obj.type=="GeometryCollection"){if(!(obj.geometries instanceof \
Array)){throw"GeometryCollection must have geometries array: "+obj;} +var \
numGeom=obj.geometries.length;var components=new Array(numGeom);for(var \
i=0;i<numGeom;++i){components[i]=this.parseGeometry.apply(this,[obj.geometries[i]]);} \
+geometry=new OpenLayers.Geometry.Collection(components);}else{if(!(obj.coordinates \
instanceof Array)){throw"Geometry must have coordinates array: "+obj;} \
+if(!this.parseCoords[obj.type.toLowerCase()]){throw"Unsupported geometry type: \
"+obj.type;} +try{geometry=this.parseCoords[obj.type.toLowerCase()].apply(this,[obj.coordinates]);}catch(err){throw \
err;}} +if(this.internalProjection&&this.externalProjection){geometry.transform(this.externalProjection,this.internalProjection);}
 +return geometry;},parseCoords:{"point":function(array){if(array.length!=2){throw"Only \
2D points are supported: "+array;} +return new \
OpenLayers.Geometry.Point(array[0],array[1]);},"multipoint":function(array){var \
points=[];var p=null;for(var \
i=0;i<array.length;++i){try{p=this.parseCoords["point"].apply(this,[array[i]]);}catch(err){throw \
err;} +points.push(p);}
+return new OpenLayers.Geometry.MultiPoint(points);},"linestring":function(array){var \
points=[];var p=null;for(var \
i=0;i<array.length;++i){try{p=this.parseCoords["point"].apply(this,[array[i]]);}catch(err){throw \
err;} +points.push(p);}
+return new OpenLayers.Geometry.LineString(points);},"multilinestring":function(array){var \
lines=[];var l=null;for(var \
i=0;i<array.length;++i){try{l=this.parseCoords["linestring"].apply(this,[array[i]]);}catch(err){throw \
err;} +lines.push(l);}
+return new OpenLayers.Geometry.MultiLineString(lines);},"polygon":function(array){var \
rings=[];var r,l;for(var \
i=0;i<array.length;++i){try{l=this.parseCoords["linestring"].apply(this,[array[i]]);}catch(err){throw \
err;} +r=new OpenLayers.Geometry.LinearRing(l.components);rings.push(r);}
+return new OpenLayers.Geometry.Polygon(rings);},"multipolygon":function(array){var \
polys=[];var p=null;for(var \
i=0;i<array.length;++i){try{p=this.parseCoords["polygon"].apply(this,[array[i]]);}catch(err){throw \
err;} +polys.push(p);}
+return new OpenLayers.Geometry.MultiPolygon(polys);},"box":function(array){if(array.length!=2){throw"GeoJSON \
box coordinates must have 2 elements";} +return new OpenLayers.Geometry.Polygon([new \
OpenLayers.Geometry.LinearRing([new \
OpenLayers.Geometry.Point(array[0][0],array[0][1]),new \
OpenLayers.Geometry.Point(array[1][0],array[0][1]),new \
OpenLayers.Geometry.Point(array[1][0],array[1][1]),new \
OpenLayers.Geometry.Point(array[0][0],array[1][1]),new \
OpenLayers.Geometry.Point(array[0][0],array[0][1])])]);}},write:function(obj,pretty){var \
geojson={"type":null};if(obj instanceof Array){geojson.type="FeatureCollection";var \
numFeatures=obj.length;geojson.features=new Array(numFeatures);for(var \
i=0;i<numFeatures;++i){var element=obj[i];if(!element instanceof \
OpenLayers.Feature.Vector){var msg="FeatureCollection only supports collections "+"of \
features: "+element;throw msg;} \
+geojson.features[i]=this.extract.feature.apply(this,[element]);}}else \
if(obj.CLASS_NAME.indexOf("OpenLayers.Geometry")==0){geojson=this.extract.geometry.apply(this,[obj]);}else \
if(obj instanceof OpenLayers.Feature.Vector){geojson=this.extract.feature.apply(this,[ \
obj]);if(obj.layer&&obj.layer.projection){geojson.crs=this.createCRSObject(obj);}} \
+return OpenLayers.Format.JSON.prototype.write.apply(this,[geojson,pretty]);},createCRSObject:function(object){var \
proj=object.layer.projection.toString();var crs={};if(proj.match(/epsg:/i)){var \
code=parseInt(proj.substring(proj.indexOf(":")+1));if(code=C26){crs={"type":"OGC","pro \
perties":{"urn":"urn:ogc:def:crs:OGC:1.3:CRS84"}};}else{crs={"type":"EPSG","properties":{"code":code}};}}
 +return crs;},extract:{'feature':function(feature){var \
geom=this.extract.geometry.apply(this,[feature.geometry]);return{"type":"Feature","id" \
:feature.fid==null?feature.id:feature.fid,"properties":feature.attributes,"geometry":g \
eom};},'geometry':function(geometry){if(this.internalProjection&&this.externalProjecti \
on){geometry=geometry.clone();geometry.transform(this.internalProjection,this.externalProjection);}
 +var geometryType=geometry.CLASS_NAME.split('.')[2];var \
data=this.extract[geometryType.toLowerCase()].apply(this,[geometry]);var \
json;if(geometryType=="Collection"){json={"type":"GeometryCollection","geometries":data};}else{json={"type":geometryType,"coordinates":data};}
 +return json;},'point':function(point){return[point.x,point.y];},'multipoint':function(multipoint){var \
array=[];for(var i=0;i<multipoint.components.length;++i){array.push(this.extract.point.apply(this,[multipoint.components[i]]));}
 +return array;},'linestring':function(linestring){var array=[];for(var \
i=0;i<linestring.components.length;++i){array.push(this.extract.point.apply(this,[linestring.components[i]]));}
 +return array;},'multilinestring':function(multilinestring){var array=[];for(var \
i=0;i<multilinestring.components.length;++i){array.push(this.extract.linestring.apply(this,[multilinestring.components[i]]));}
 +return array;},'polygon':function(polygon){var array=[];for(var \
i=0;i<polygon.components.length;++i){array.push(this.extract.linestring.apply(this,[polygon.components[i]]));}
 +return array;},'multipolygon':function(multipolygon){var array=[];for(var \
i=0;i<multipolygon.components.length;++i){array.push(this.extract.polygon.apply(this,[multipolygon.components[i]]));}
 +return array;},'collection':function(collection){var \
len=collection.components.length;var array=new Array(len);for(var \
i=0;i<len;++i){array[i]=this.extract.geometry.apply(this,[collection.components[i]]);}
 +return array;}},CLASS_NAME:"OpenLayers.Format.GeoJSON"});OpenLayers.Format.GeoRSS=Op \
enLayers.Class(OpenLayers.Format.XML,{rssns:"http://backend.userland.com/rss2",feature \
NS:"http://mapserver.gis.umn.edu/mapserver",georssns:"http://www.georss.org/georss",ge \
ons:"http://www.w3.org/2003/01/geo/wgs84_pos#",featureTitle:"Untitled",featureDescription:"No \
Description",gmlParser:null,xy:false,initialize:function(options){OpenLayers.Format.XM \
L.prototype.initialize.apply(this,[options]);},createGeometryFromItem:function(item){var \
point=this.getElementsByTagNameNS(item,this.georssns,"point");var \
lat=this.getElementsByTagNameNS(item,this.geons,'lat');var \
lon=this.getElementsByTagNameNS(item,this.geons,'long');var \
line=this.getElementsByTagNameNS(item,this.georssns,"line");var \
polygon=this.getElementsByTagNameNS(item,this.georssns,"polygon");var \
where=this.getElementsByTagNameNS(item,this.georssns,"where");if(point.length>0||(lat.length>0&&lon.length>0)){var \
location;if(point.length>0){lo  \
cation=OpenLayers.String.trim(point[0].firstChild.nodeValue).split(/\s+/);if(location. \
length!=2){location=OpenLayers.String.trim(point[0].firstChild.nodeValue).split(/\s*,\ \
s*/);}}else{location=[parseFloat(lat[0].firstChild.nodeValue),parseFloat(lon[0].firstChild.nodeValue)];}
 +var geometry=new OpenLayers.Geometry.Point(parseFloat(location[1]),parseFloat(location[0]));}else \
if(line.length>0){var \
coords=OpenLayers.String.trim(line[0].firstChild.nodeValue).split(/\s+/);var \
components=[];var point;for(var i=0;i<coords.length;i+=2){point=new \
OpenLayers.Geometry.Point(parseFloat(coords[i+1]),parseFloat(coords[i]));components.push(point);}
 +geometry=new OpenLayers.Geometry.LineString(components);}else \
if(polygon.length>0){var \
coords=OpenLayers.String.trim(polygon[0].firstChild.nodeValue).split(/\s+/);var \
components=[];var point;for(var i=0;i<coords.length;i+=2){point=new \
OpenLayers.Geometry.Point(parseFloat(coords[i+1]),parseFloat(coords[i]));components.push(point);}
 +geometry=new OpenLayers.Geometry.Polygon([new \
OpenLayers.Geometry.LinearRing(components)]);}else \
if(where.length>0){if(!this.gmlParser){this.gmlParser=new \
OpenLayers.Format.GML({'xy':this.xy});} +var \
feature=this.gmlParser.parseFeature(where[0]);geometryþature.geometry;} \
+if(geometry&&this.internalProjection&&this.externalProjection){geometry.transform(this.externalProjection,this.internalProjection);}
 +return geometry;},createFeatureFromItem:function(item){var \
geometry=this.createGeometryFromItem(item);var \
title=this.getChildValue(item,"*","title",this.featureTitle);var \
description=this.getChildValue(item,"*","description",this.getChildValue(item,"*","content",this.featureDescription));var \
link=this.getChildValue(item,"*","link");if(!link){try{link=this.getElementsByTagNameNS(item,"*","link")[0].getAttribute("href");}catch(e){link=null;}}
 +var id=this.getChildValue(item,"*","id",null);var \
data={"title":title,"description":description,"link":link};var feature=new \
OpenLayers.Feature.Vector(geometry,data);feature.fid=id;return \
feature;},getChildValue:function(node,nsuri,name,def){var \
value;try{value=this.getElementsByTagNameNS(node,nsuri,name)[0].firstChild.nodeValue;}catch(e){value=(def==undefined)?"":def;}
 +return value;},read:function(doc){if(typeof \
doc=="string"){doc=OpenLayers.Format.XML.prototype.read.apply(this,[doc]);} +var \
itemlist=null;itemlist=this.getElementsByTagNameNS(doc,'*','item');if(itemlist.length==0){itemlist=this.getElementsByTagNameNS(doc,'*','entry');}
 +var numItems=itemlist.length;var features=new Array(numItems);for(var \
i=0;i<numItems;i++){features[i]=this.createFeatureFromItem(itemlist[i]);} +return \
features;},write:function(features){var georss;if(features instanceof \
Array){georss=this.createElementNS(this.rssns,"rss");for(var \
i=0;i<features.length;i++){georss.appendChild(this.createFeatureXML(features[i]));}}else{georss=this.createFeatureXML(features);}
 +return OpenLayers.Format.XML.prototype.write.apply(this,[georss]);},createFeatureXML:function(feature){var \
geometryNode=this.buildGeometryNode(feature.geometry);var \
featureNode=this.createElementNS(this.rssns,"item");var \
titleNode=this.createElementNS(this.rssns,"title");titleNode.appendChild(this.createTextNode(feature.attributes.title?feature.attributes.title:""));var \
descNode=this.createElementNS(this.rssns,"description");descNode.appendChild(this.crea \
teTextNode(feature.attributes.description?feature.attributes.description:""));featureN \
ode.appendChild(titleNode);featureNode.appendChild(descNode);if(feature.attributes.link){var \
linkNode=this.createElementNS(this.rssns,"link");linkNode.appendChild(this.createTextNode(feature.attributes.link));featureNode.appendChild(linkNode);}
 +for(var attr in feature.attributes){if(attr=="link"||attr=="title"||attr=="description"){continue;}
 +var attrText=this.createTextNode(feature.attributes[attr]);var \
nodename=attr;if(attr.search(":")!=-1){nodename=attr.split(":")[1];} +var \
attrContainer=this.createElementNS(this.featureNS,"feature:"+nodename);attrContainer.appendChild(attrText);featureNode.appendChild(attrContainer);}
 +featureNode.appendChild(geometryNode);return \
featureNode;},buildGeometryNode:function(geometry){if(this.internalProjection&&this.ex \
ternalProjection){geometry=geometry.clone();geometry.transform(this.internalProjection,this.externalProjection);}
 +var node;if(geometry.CLASS_NAME=="OpenLayers.Geometry.Polygon"){node=this.createElem \
entNS(this.georssns,'georss:polygon');node.appendChild(this.buildCoordinatesNode(geometry.components[0]));}
 +else if(geometry.CLASS_NAME=="OpenLayers.Geometry.LineString"){node=this.createEleme \
ntNS(this.georssns,'georss:line');node.appendChild(this.buildCoordinatesNode(geometry));}
 +else if(geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){node=this.createElementNS( \
this.georssns,'georss:point');node.appendChild(this.buildCoordinatesNode(geometry));}else{throw"Couldn't \
parse "+geometry.CLASS_NAME;} +return \
node;},buildCoordinatesNode:function(geometry){var \
points=null;if(geometry.components){points=geometry.components;} +var \
path;if(points){var numPoints=points.length;var parts=new Array(numPoints);for(var \
i=0;i<numPoints;i++){parts[i]=points[i].y+" "+points[i].x;} +path=parts.join(" \
");}else{path=geometry.y+" "+geometry.x;} +return \
this.createTextNode(path);},CLASS_NAME:"OpenLayers.Format.GeoRSS"});OpenLayers.Format. \
KML=OpenLayers.Class(OpenLayers.Format.XML,{kmlns:"http://earth.google.com/kml/2.0",placemarksDesc:"No \
description available",foldersName:"OpenLayers export",foldersDesc:"Exported on "+new \
Date(),extractAttributes:true,extractStyles:false,internalns:null,features:null,styles \
:null,styleBaseUrl:"",fetched:null,maxDepth:0,initialize:function(options){this.regExe \
s={trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s \
*/g),kmlColor:(/(\w{2})(\w{2})(\w{2})(\w{2})/),kmlIconPalette:(/root:\/\/icons\/palett \
e-(\d+)(\.\w+)/),straightBracket:(/\$\[(.*?)\]/g)};OpenLayers.Format.XML.prototype.ini \
tialize.apply(this,[options]);},read:function(data){this.features=[];this.styles={};this.fetched={};var \
options={depth:this.maxDepth,styleBaseUrl:this.styleBaseUrl};return \
this.parseData(data,options);},parseData:function(data,options){if(typeof \
                data=="string"){data=OpenLayers
 .Format.XML.prototype.read.apply(this,[data]);}
+var types=["Link","NetworkLink","Style","StyleMap","Placemark"];for(var \
i=0;i<types.length;++i){var type=types[i];var \
nodes=this.getElementsByTagNameNS(data,"*",type);if(nodes.length==0){continue;} \
+switch(type.toLowerCase()){case"link":case"networklink":this.parseLinks(nodes,options);break;case"style":if(this.extractStyles){this.parseStyles(nodes,options);}
 +break;case"stylemap":if(this.extractStyles){this.parseStyleMaps(nodes,options);}
+break;case"placemark":this.parseFeatures(nodes,options);break;}}
+return this.features;},parseLinks:function(nodes,options){if(options.depth>=this.maxDepth){return \
false;} +var newOptions=OpenLayers.Util.extend({},options);newOptions.depth++;for(var \
i=0;i<nodes.length;i++){var \
href=this.parseProperty(nodes[i],"*","href");if(href&&!this.fetched[href]){this.fetched[href]=true;var \
data=this.fetchLink(href);if(data){this.parseData(data,newOptions);}}}},fetchLink:function(href){var \
request=new OpenLayers.Ajax.Request(href,{method:'get',asynchronous:false});if(request&&request.transport){return \
request.transport.responseText;}},parseStyles:function(nodes,options){for(var \
i=0;i<nodes.length;i++){var \
style=this.parseStyle(nodes[i]);if(style){styleName=(options.styleBaseUrl||"")+"#"+style.id;this.styles[styleName]=style;}}},parseStyle:function(node){var \
style={};var types=["LineStyle","PolyStyle","IconStyle","BalloonStyle"];var \
type,nodeList,geometry,parser;for(var \
i=0;i<types.length;++i){type=types[i];styleTypeNode=this.getElementsByTagNameNS(node,"*",type)[0];if(!styleTypeNode){continue;}
 +switch(type.toLowerCase()){case"linestyle":var \
color=this.parseProperty(styleTypeNode,"*","color");if(color){var \
matches=(color.toString()).match(this.regExes.kmlColor);var \
alpha=matches[1];style["strokeOpacity"]=parseInt(alpha,16)/255;var b=matches[2];var \
g=matches[3];var r=matches[4];style["strokeColor"]="#"+r+g+b;} +var \
width=this.parseProperty(styleTypeNode,"*","width");if(width){style["strokeWidth"]=width;}
 +case"polystyle":var \
color=this.parseProperty(styleTypeNode,"*","color");if(color){var \
matches=(color.toString()).match(this.regExes.kmlColor);var \
alpha=matches[1];style["fillOpacity"]=parseInt(alpha,16)/255;var b=matches[2];var \
g=matches[3];var r=matches[4];style["fillColor"]="#"+r+g+b;} \
+break;case"iconstyle":var \
scale=parseFloat(this.parseProperty(styleTypeNode,"*","scale")||1);var \
width2*scale;var height2*scale;var \
iconNode=this.getElementsByTagNameNS(styleTypeNode,"*","Icon")[0];if(iconNode){var \
href=this.parseProperty(iconNode,"*","href");if(href){var \
w=this.parseProperty(iconNode,"*","w");var h=this.parseProperty(iconNode,"*","h");var \
google="http://maps.google.com/mapfiles/kml";if(OpenLayers.String.startsWith(href,google)&&!w&&!h){wd;hd;scale=scale/2;}
 +w=w||h;h=h||w;if(w){width=parseInt(w)*scale;}
+if(h){height=parseInt(h)*scale;}
+var matches=href.match(this.regExes.kmlIconPalette);if(matches){var \
palette=matches[1];var file_extension=matches[2];var \
x=this.parseProperty(iconNode,"*","x");var y=this.parseProperty(iconNode,"*","y");var \
posX=x?x/32:0;var posY=y?(7-y/32):7;var \
pos=posY*8+posX;href="http://maps.google.com/mapfiles/kml/pal" \
++palette+"/icon"+pos+file_extension;} \
+style["graphicOpacity"]=1;style["externalGraphic"]=href;}} +var \
hotSpotNode=this.getElementsByTagNameNS(styleTypeNode,"*","hotSpot")[0];if(hotSpotNode){var \
x=parseFloat(hotSpotNode.getAttribute("x"));var \
y=parseFloat(hotSpotNode.getAttribute("y"));var \
xUnits=hotSpotNode.getAttribute("xunits");if(xUnits=="pixels"){style["graphicXOffset"]=-x*scale;}
 +else if(xUnits=="insetPixels"){style["graphicXOffset"]=-width+(x*scale);}
+else if(xUnits=="fraction"){style["graphicXOffset"]=-width*x;}
+var yUnits=hotSpotNode.getAttribute("yunits");if(yUnits=="pixels"){style["graphicYOffset"]=-height+(y*scale)+1;}
 +else if(yUnits=="insetPixels"){style["graphicYOffset"]=-(y*scale)+1;}
+else if(yUnits=="fraction"){style["graphicYOffset"]=-height*(1-y)+1;}}
+style["graphicWidth"]=width;style["graphicHeight"]=height;break;case"balloonstyle":var \
balloonStyle=OpenLayers.Util.getXmlNodeValue(styleTypeNode);if(balloonStyle){style["balloonStyle"]ºlloonStyle.replace(this.regExes.straightBracket,"${$1}");}
 +break;default:}}
+if(!style["strokeColor"]&&style["fillColor"]){style["strokeColor"]=style["fillColor"];}
 +var id=node.getAttribute("id");if(id&&style){style.id=id;}
+return style;},parseStyleMaps:function(nodes,options){for(var \
i=0;i<nodes.length;i++){var node=nodes[i];var \
pairs=this.getElementsByTagNameNS(node,"*","Pair");var \
id=node.getAttribute("id");for(var j=0;j<pairs.length;j++){var pair=pairs[j];var \
key=this.parseProperty(pair,"*","key");var \
styleUrl=this.parseProperty(pair,"*","styleUrl");if(styleUrl&&key=="normal"){this.styl \
es[(options.styleBaseUrl||"")+"#"+id]=this.styles[(options.styleBaseUrl||"")+styleUrl];}
 +if(styleUrl&&key=="highlight"){}}}},parseFeatures:function(nodes,options){var \
features=new Array(nodes.length);for(var i=0;i<nodes.length;i++){var \
featureNode=nodes[i];var \
feature=this.parseFeature.apply(this,[featureNode]);if(feature){if(this.extractStyles& \
&feature.attributes&&feature.attributes.styleUrl){feature.style=this.getStyle(feature.attributes.styleUrl);}
 +var inlineStyleNode=this.getElementsByTagNameNS(featureNode,"*","Style")[0];if(inlineStyleNode){var \
inlineStyle=this.parseStyle(inlineStyleNode);if(inlineStyle){feature.style=OpenLayers. \
Util.extend({},feature.style);OpenLayers.Util.extend(feature.style,inlineStyle);}} \
+features[i]þature;}else{throw"Bad Placemark: "+i;}} \
+this.features=this.features.concat(features);},parseFeature:function(node){var \
order=["MultiGeometry","Polygon","LineString","Point"];var \
type,nodeList,geometry,parser;for(var \
i=0;i<order.length;++i){type=order[i];this.internalns=node.namespaceURI?node.namespace \
URI:this.kmlns;nodeList=this.getElementsByTagNameNS(node,this.internalns,type);if(nodeList.length>0){var \
parser=this.parseGeometry[type.toLowerCase()];if(parser){geometry=parser.apply(this,[n \
odeList[0]]);if(this.internalProjection&&this.externalProjection){geometry.transform(t \
his.externalProjection,this.internalProjection);}}else{OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{'geomType':type}));}
 +break;}}
+var attributes;if(this.extractAttributes){attributes=this.parseAttributes(node);}
+var feature=new OpenLayers.Feature.Vector(geometry,attributes);var \
fid=node.getAttribute("id")||node.getAttribute("name");if(fid!=null){feature.fid=fid;}
 +return feature;},getStyle:function(styleUrl,options){var \
styleBaseUrl=OpenLayers.Util.removeTail(styleUrl);var \
newOptions=OpenLayers.Util.extend({},options);newOptions.depth++;newOptions.styleBaseU \
rl=styleBaseUrl;if(!this.styles[styleUrl]&&!OpenLayers.String.startsWith(styleUrl,"#")&&newOptions.depth<=this.maxDepth&&!this.fetched[styleBaseUrl]){var \
data=this.fetchLink(styleBaseUrl);if(data){this.parseData(data,newOptions);}} +var \
style=this.styles[styleUrl];return style;},parseGeometry:{point:function(node){var \
nodeList=this.getElementsByTagNameNS(node,this.internalns,"coordinates");var \
coords=[];if(nodeList.length>0){var \
coordString=nodeList[0].firstChild.nodeValue;coordString=coordString.replace(this.regExes.removeSpace,"");coords=coordString.split(",");}
 +var point=null;if(coords.length>1){if(coords.length==2){coords[2]=null;}
+point=new OpenLayers.Geometry.Point(coords[0],coords[1],coords[2]);}else{throw"Bad \
coordinate string: "+coordString;} +return point;},linestring:function(node,ring){var \
nodeList=this.getElementsByTagNameNS(node,this.internalns,"coordinates");var \
line=null;if(nodeList.length>0){var \
coordString=this.concatChildValues(nodeList[0]);coordString=coordString.replace(this.r \
egExes.trimSpace,"");coordString=coordString.replace(this.regExes.trimComma,",");var \
pointList=coordString.split(this.regExes.splitSpace);var \
numPoints=pointList.length;var points=new Array(numPoints);var \
coords,numCoords;for(var \
i=0;i<numPoints;++i){coords=pointList[i].split(",");numCoords=coords.length;if(numCoords>1){if(coords.length==2){coords[2]=null;}
 +points[i]=new OpenLayers.Geometry.Point(coords[0],coords[1],coords[2]);}else{throw"Bad \
LineString point coordinates: "+ +pointList[i];}}
+if(numPoints){if(ring){line=new \
OpenLayers.Geometry.LinearRing(points);}else{line=new \
OpenLayers.Geometry.LineString(points);}}else{throw"Bad LineString coordinates: \
"+coordString;}} +return line;},polygon:function(node){var \
nodeList=this.getElementsByTagNameNS(node,this.internalns,"LinearRing");var \
numRings=nodeList.length;var components=new Array(numRings);if(numRings>0){var \
ring;for(var i=0;i<nodeList.length;++i){ring=this.parseGeometry.linestring.apply(this,[nodeList[i],true]);if(ring){components[i]=ring;}else{throw"Bad \
LinearRing geometry: "+i;}}} +return new \
OpenLayers.Geometry.Polygon(components);},multigeometry:function(node){var \
child,parser;var parts=[];var children=node.childNodes;for(var \
i=0;i<children.length;++i){child=children[i];if(child.nodeType==1){var \
type=(child.prefix)?child.nodeName.split(":")[1]:child.nodeName;var \
parser=this.parseGeometry[type.toLowerCase()];if(parser){parts.push(parser.apply(this,[child]));}}}
 +return new OpenLayers.Geometry.Collection(parts);}},parseAttributes:function(node){var \
attributes={};var child,grandchildren,grandchild;var children=node.childNodes;for(var \
i=0;i<children.length;++i){child=children[i];if(child.nodeType==1){grandchildren=child.childNodes;if(grandchildren.length==1||grandchildren.length==3){var \
grandchild;switch(grandchildren.length){case 1:grandchild=grandchildren[0];break;case \
3:default:grandchild=grandchildren[1];break;} \
+if(grandchild.nodeType==3||grandchild.nodeType==4){var \
name=(child.prefix)?child.nodeName.split(":")[1]:child.nodeName;var \
value=OpenLayers.Util.getXmlNodeValue(grandchild);if(value){value=value.replace(this.regExes.trimSpace,"");attributes[name]=value;}}}}}
 +return attributes;},parseProperty:function(xmlNode,namespace,tagName){var value;var \
nodeList=this.getElementsByTagNameNS(xmlNode,namespace,tagName);try{value=OpenLayers.Util.getXmlNodeValue(nodeList[0]);}catch(e){value=null;}
 +return value;},write:function(features){if(!(features instanceof \
Array)){features=[features];} +var kml=this.createElementNS(this.kmlns,"kml");var \
folder=this.createFolderXML();for(var \
i=0;i<features.length;++i){folder.appendChild(this.createPlacemarkXML(features[i]));} \
+kml.appendChild(folder);return \
OpenLayers.Format.XML.prototype.write.apply(this,[kml]);},createFolderXML:function(){var \
folderName=this.createElementNS(this.kmlns,"name");var \
folderNameText=this.createTextNode(this.foldersName);folderName.appendChild(folderNameText);var \
folderDesc=this.createElementNS(this.kmlns,"description");var \
folderDescText=this.createTextNode(this.foldersDesc);folderDesc.appendChild(folderDescText);var \
folder=this.createElementNS(this.kmlns,"Folder");folder.appendChild(folderName);folder.appendChild(folderDesc);return \
folder;},createPlacemarkXML:function(feature){var \
placemarkName=this.createElementNS(this.kmlns,"name");var \
name=(feature.attributes.name)?feature.attributes.name:feature.id;placemarkName.appendChild(this.createTextNode(name));var \
placemarkDesc=this.createElementNS(this.kmlns,"description");var \
desc=(feature.attributes.description)?feature.attributes.description:this.placemarksDesc;placemarkDesc.appendChild(this.createTextNode(desc));var
  placemarkNode=this.createElementNS(this.kmlns,"Placemark");if(feature.fid!=null){placemarkNode.setAttribute("id",feature.fid);}
 +placemarkNode.appendChild(placemarkName);placemarkNode.appendChild(placemarkDesc);var \
geometryNode=this.buildGeometryNode(feature.geometry);placemarkNode.appendChild(geometryNode);return \
placemarkNode;},buildGeometryNode:function(geometry){if(this.internalProjection&&this. \
externalProjection){geometry=geometry.clone();geometry.transform(this.internalProjection,this.externalProjection);}
 +var className=geometry.CLASS_NAME;var \
type=className.substring(className.lastIndexOf(".")+1);var \
builder=this.buildGeometry[type.toLowerCase()];var \
node=null;if(builder){node=builder.apply(this,[geometry]);} +return \
node;},buildGeometry:{point:function(geometry){var \
kml=this.createElementNS(this.kmlns,"Point");kml.appendChild(this.buildCoordinatesNode(geometry));return \
kml;},multipoint:function(geometry){return \
this.buildGeometry.collection.apply(this,[geometry]);},linestring:function(geometry){var \
kml=this.createElementNS(this.kmlns,"LineString");kml.appendChild(this.buildCoordinatesNode(geometry));return \
kml;},multilinestring:function(geometry){return \
this.buildGeometry.collection.apply(this,[geometry]);},linearring:function(geometry){var \
kml=this.createElementNS(this.kmlns,"LinearRing");kml.appendChild(this.buildCoordinatesNode(geometry));return \
kml;},polygon:function(geometry){var \
kml=this.createElementNS(this.kmlns,"Polygon");var rings=geometry.components;var \
ringMember,ringGeom,type;for(var \
i=0;i<rings.length;++i){type=(i==0)?"outerBoundaryIs":"innerBoundaryIs";ringMember=thi \
s.createElementNS(this.kmlns,type);ringGeom=this.buildGeometry.linearring.apply(this,[rings[i]]);rin
  gMember.appendChild(ringGeom);kml.appendChild(ringMember);}
+return kml;},multipolygon:function(geometry){return \
this.buildGeometry.collection.apply(this,[geometry]);},collection:function(geometry){var \
kml=this.createElementNS(this.kmlns,"MultiGeometry");var child;for(var \
i=0;i<geometry.components.length;++i){child=this.buildGeometryNode.apply(this,[geometry.components[i]]);if(child){kml.appendChild(child);}}
 +return kml;}},buildCoordinatesNode:function(geometry){var \
coordinatesNode=this.createElementNS(this.kmlns,"coordinates");var path;var \
points=geometry.components;if(points){var point;var numPoints=points.length;var \
parts=new Array(numPoints);for(var \
i=0;i<numPoints;++i){point=points[i];parts[i]=point.x+","+point.y;} \
+path=parts.join(" ");}else{path=geometry.x+","+geometry.y;} +var \
txtNode=this.createTextNode(path);coordinatesNode.appendChild(txtNode);return \
coordinatesNode;},CLASS_NAME:"OpenLayers.Format.KML"});OpenLayers.Format.OSM=OpenLayer \
s.Class(OpenLayers.Format.XML,{checkTags:false,interestingTagsExclude:null,areaTags:null,initialize:function(options){var \
layer_defaults={'interestingTagsExclude':['source','source_ref','source:ref','history' \
,'attribution','created_by'],'areaTags':['area','building','leisure','tourism','ruins' \
,'historic','landuse','military','natural','sport']};layer_defaults=OpenLayers.Util.extend(layer_defaults,options);var \
interesting={};for(var \
i=0;i<layer_defaults.interestingTagsExclude.length;i++){interesting[layer_defaults.interestingTagsExclude[i]]=true;}
 +layer_defaults.interestingTagsExclude=interesting;var area={};for(var \
i=0;i<layer_defaults.areaTags.length;i++){area[layer_defaults.areaTags[i]]=true;} \
+layer_defaults.areaTags=area;OpenLayers.Format.XML.prototype.initialize.apply(this,[layer_defaults]);},read:function(doc){if(typeof \
doc=="string"){doc=OpenLayers.Format.XML.prototype.read.apply(this,[doc]);} +var \
nodes=this.getNodes(doc);var ways=this.getWays(doc);var feat_list=new \
Array(ways.length);for(var i=0;i<ways.length;i++){var point_list=new \
Array(ways[i].nodes.length);var poly=this.isWayArea(ways[i])?1:0;for(var \
j=0;j<ways[i].nodes.length;j++){var node=nodes[ways[i].nodes[j]];var point=new \
OpenLayers.Geometry.Point(node.lon,node.lat);point.osm_id=parseInt(ways[i].nodes[j]);point_list[j]=point;node.used=true;}
 +var geometry=null;if(poly){geometry=new OpenLayers.Geometry.Polygon(new \
OpenLayers.Geometry.LinearRing(point_list));}else{geometry=new \
OpenLayers.Geometry.LineString(point_list);} \
+if(this.internalProjection&&this.externalProjection){geometry.transform(this.externalProjection,this.internalProjection);}
 +var feat=new OpenLayers.Feature.Vector(geometry,ways[i].tags);feat.osm_id=parseInt(ways[i].id);feat.fid="way."+feat.osm_id;feat_list[i]þat;}
 +for(var node_id in nodes){var \
node=nodes[node_id];if(!node.used||this.checkTags){var \
tags=null;if(this.checkTags){var \
result=this.getTags(node.node,true);if(node.used&&!result[1]){continue;} \
+tags=result[0];}else{tags=this.getTags(node.node);} +var feat=new \
OpenLayers.Feature.Vector(new \
OpenLayers.Geometry.Point(node['lon'],node['lat']),tags);if(this.internalProjection&&t \
his.externalProjection){feat.geometry.transform(this.externalProjection,this.internalProjection);}
 +feat.osm_id=parseInt(node_id);feat.fid="node."+feat.osm_id;feat_list.push(feat);}
+node.node=null;}
+return feat_list;},getNodes:function(doc){var \
node_list=doc.getElementsByTagName("node");var nodes={};for(var \
i=0;i<node_list.length;i++){var node=node_list[i];var \
id=node.getAttribute("id");nodes[id]={'lat':node.getAttribute("lat"),'lon':node.getAttribute("lon"),'node':node};}
 +return nodes;},getWays:function(doc){var \
way_list=doc.getElementsByTagName("way");var return_ways=[];for(var \
i=0;i<way_list.length;i++){var way=way_list[i];var \
way_object={id:way.getAttribute("id")};way_object.tags=this.getTags(way);var \
node_list=way.getElementsByTagName("nd");way_object.nodes=new \
Array(node_list.length);for(var \
j=0;j<node_list.length;j++){way_object.nodes[j]=node_list[j].getAttribute("ref");} \
+return_ways.push(way_object);} +return \
return_ways;},getTags:function(dom_node,interesting_tags){var \
tag_list=dom_node.getElementsByTagName("tag");var tags={};var interestingúlse;for(var \
j=0;j<tag_list.length;j++){var \
key=tag_list[j].getAttribute("k");tags[key]=tag_list[j].getAttribute("v");if(interesting_tags){if(!this.interestingTagsExclude[key]){interesting=true;}}}
 +return interesting_tags?[tags,interesting]:tags;},isWayArea:function(way){var \
poly_shapedúlse;var poly_tagsúlse;if(way.nodes[0]==way.nodes[way.nodes.length-1]){poly_shaped=true;}
 +if(this.checkTags){for(var key in \
way.tags){if(this.areaTags[key]){poly_tags=true;break;}}} +return \
poly_shaped&&(this.checkTags?poly_tags:true);},write:function(features){if(!(features \
instanceof Array)){features=[features];} +this.osm_id=1;this.created_nodes={};var \
root_node=this.createElementNS(null,"osm");root_node.setAttribute("version","0.5");root_node.setAttribute("generator","OpenLayers \
"+OpenLayers.VERSION_NUMBER);for(var iþatures.length-1;i>=0;i--){var \
nodes=this.createFeatureNodes(features[i]);for(var \
j=0;j<nodes.length;j++){root_node.appendChild(nodes[j]);}} +return \
OpenLayers.Format.XML.prototype.write.apply(this,[root_node]);},createFeatureNodes:function(feature){var \
nodes=[];var classNameþature.geometry.CLASS_NAME;var \
type=className.substring(className.lastIndexOf(".")+1);type=type.toLowerCase();var \
builder=this.createXML[type];if(builder){nodes=builder.apply(this,[feature]);} \
+return nodes;},createXML:{'point':function(point){var id=null;var \
geometry=point.geometry?point.geometry:point;var \
already_existsúlse;if(point.osm_id){id=point.osm_id;if(this.created_nodes[id]){already_exists=true;}}else{id=-this.osm_id;this.osm_id++;}
 +if(already_exists){node=this.created_nodes[id];}else{var \
node=this.createElementNS(null,"node");} \
+this.created_nodes[id]=node;node.setAttribute("id",id);node.setAttribute("lon",geomet \
ry.x);node.setAttribute("lat",geometry.y);if(point.attributes){this.serializeTags(point,node);}
 +this.setState(point,node);return \
already_exists?[]:[node];},linestring:function(feature){var nodes=[];var \
geometryþature.geometry;if(feature.osm_id){idþature.osm_id;}else{id=-this.osm_id;this.osm_id++;}
 +var way=this.createElementNS(null,"way");way.setAttribute("id",id);for(var \
i=0;i<geometry.components.length;i++){var \
node=this.createXML['point'].apply(this,[geometry.components[i]]);if(node.length){node=node[0];var \
node_ref=node.getAttribute("id");nodes.push(node);}else{node_ref=geometry.components[i].osm_id;node=this.created_nodes[node_ref];}
 +this.setState(feature,node);var \
nd_dom=this.createElementNS(null,"nd");nd_dom.setAttribute("ref",node_ref);way.appendChild(nd_dom);}
 +this.serializeTags(feature,way);nodes.push(way);return \
nodes;},polygon:function(feature){var \
attrs=OpenLayers.Util.extend({'area':'yes'},feature.attributes);var feat=new \
OpenLayers.Feature.Vector(feature.geometry.components[0],attrs);feat.osm_idþature.osm_id;return \
this.createXML['linestring'].apply(this,[feat]);}},serializeTags:function(feature,node){for(var \
key in feature.attributes){var \
tag=this.createElementNS(null,"tag");tag.setAttribute("k",key);tag.setAttribute("v",fe \
ature.attributes[key]);node.appendChild(tag);}},setState:function(feature,node){if(feature.state){var \
state=null;switch(feature.state){case OpenLayers.State.UPDATE:state="modify";case \
OpenLayers.State.DELETE:state="delete";} \
+if(state){node.setAttribute("action",state);}}},CLASS_NAME:"OpenLayers.Format.OSM"}); \
OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{compon \
entTypes:["OpenLayers.Geometry.Point"],initialize:function(points){OpenLayers.Geometry \
.LineString.prototype.initialize.apply(this,arguments);},addComponent:function(point,index){var \
addedúlse;var lastPoint=this.components.pop();if(index!=null||!point.equals(lastPoint) \
){added=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments);} \
+var firstPoint=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[firstPoint]);return \
added;},removeComponent:function(point){if(this.components.length>4){this.components.p \
op();OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var \
firstPoint=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[firstPoint]);}},move:function(x,y){for(var \
i=0;i<this.components.length-1;i++){this.components[i].move(x,y);}},rotate:function(angle,origin){for(var \
i=0;i<this.components.length-1;++i){this.components[i].rotate(angle,origin);}},resize:function(scale,origin,ratio){for(var \
i=0;i<this.components.length-1;++i){this.components[i].resize(scale,origin,ratio);}},transform:function(source,dest){if(source&&dest){for(var \
i=0;i<this.components.length-1;i++){var \
component=this.components[i];component.transform(source,dest);}} +return \
this;},getArea:function(){var \
area=0.0;if(this.components&&(this.components.length>2)){var sum=0.0;for(var \
i=0;i<this.components.length-1;i++){var b=this.components[i];var \
c=this.components[i+1];sum+=(b.x+c.x)*(c.y-b.y);} +area=-sum/2.0;}
+return area;},containsPoint:function(point){var \
approx=OpenLayers.Number.limitSigDigs;var digs;var px=approx(point.x,digs);var \
py=approx(point.y,digs);function \
getX(y,x1,y1,x2,y2){return(((x1-x2)*y)+((x2*y1)-(x1*y2)))/(y1-y2);} +var \
numSeg=this.components.length-1;var start,end,x1,y1,x2,y2,cx,cy;var crosses=0;for(var \
i=0;i<numSeg;++i){start=this.components[i];x1=approx(start.x,digs);y1=approx(start.y,d \
igs);end=this.components[i+1];x2=approx(end.x,digs);y2=approx(end.y,digs);if(y1==y2){i \
f(py==y1){if(x1<=x2&&(px>=x1&&px<=x2)||x1>=x2&&(px<=x1&&px>=x2)){crosses=-1;break;}} \
+continue;} +cx=approx(getX(py,x1,y1,x2,y2),digs);if(cx==px){if(y1<y2&&(py>=y1&&py<=y2)||y1>y2&&(py<=y1&&py>=y2)){crosses=-1;break;}}
 +if(cx<=px){continue;}
+if(x1!=x2&&(cx<Math.min(x1,x2)||cx>Math.max(x1,x2))){continue;}
+if(y1<y2&&(py>=y1&&py<y2)||y1>y2&&(py<y1&&py>=y2)){++crosses;}}
+var contained=(crosses==-1)?1:!!(crosses&1);return \
contained;},intersects:function(geometry){var \
intersectúlse;if(geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){intersect=this.containsPoint(geometry);}else \
if(geometry.CLASS_NAME=="OpenLayers.Geometry.LineString"){intersect=geometry.intersects(this);}else \
if(geometry.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){intersect=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[geometry]);}else{for(var \
i=0;i<geometry.components.length;++i){intersect=geometry.components[i].intersects(this);if(intersect){break;}}}
 +return intersect;},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});OpenLayers.Handler. \
Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,freehand:false,freehandToggl \
e:'shiftKey',initialize:function(control,callbacks,options){OpenLayers.Handler.Point.p \
rototype.initialize.apply(this,arguments);},createFeature:function(){this.line=new \
OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString());this.point=new \
OpenLayers.Feature.Vector(new \
OpenLayers.Geometry.Point());},destroyFeature:function(){OpenLayers.Handler.Point.prototype.destroyFeature.apply(this);if(this.line){this.line.destroy();}
 +this.line=null;},addPoint:function(){this.line.geometry.addComponent(this.point.geom \
etry.clone(),this.line.geometry.components.length);this.callback("point",[this.point.g \
eometry]);},freehandMode:function(evt){return(this.freehandToggle&&evt[this.freehandToggle])?!this.freehand:this.freehand;},modifyFeature:function(){var \
index=this.line.geometry.components.length-1;this.line.geometry.components[index].x=th \
is.point.geometry.x;this.line.geometry.components[index].y=this.point.geometry.y;this. \
line.geometry.components[index].clearBounds();},drawFeature:function(){this.layer.draw \
Feature(this.line,this.style);this.layer.drawFeature(this.point,this.style);},geometryClone:function(){return \
this.line.geometry.clone();},mousedown:function(evt){if(this.lastDown&&this.lastDown.equals(evt.xy)){return \
false;} +if(this.lastDown==null){this.createFeature();}
+this.mouseDown=true;this.lastDown=evt.xy;var \
lonlat=this.control.map.getLonLatFromPixel(evt.xy);this.point.geometry.x=lonlat.lon;th \
is.point.geometry.y=lonlat.lat;if((this.lastUp==null)||!this.lastUp.equals(evt.xy)){this.addPoint();}
 +this.drawFeature();this.drawing=true;return \
false;},mousemove:function(evt){if(this.drawing){var \
lonlat=this.map.getLonLatFromPixel(evt.xy);this.point.geometry.x=lonlat.lon;this.point \
.geometry.y=lonlat.lat;if(this.mouseDown&&this.freehandMode(evt)){this.addPoint();}else{this.modifyFeature();}
 +this.drawFeature();}
+return true;},mouseup:function(evt){this.mouseDownúlse;if(this.drawing){if(this.freehandMode(evt)){this.finalize();}else{if(this.lastUp==null){this.addPoint();}
 +this.lastUp=evt.xy;}
+return false;}
+return true;},dblclick:function(evt){if(!this.freehandMode(evt)){var \
index=this.line.geometry.components.length-1;this.line.geometry.removeComponent(this.line.geometry.components[index]);this.finalize();}
 +return false;},CLASS_NAME:"OpenLayers.Handler.Path"});OpenLayers.Format.WFS=OpenLaye \
rs.Class(OpenLayers.Format.GML,{layer:null,wfsns:"http://www.opengis.net/wfs",ogcns:"h \
ttp://www.opengis.net/ogc",initialize:function(options,layer){OpenLayers.Format.GML.pr \
ototype.initialize.apply(this,[options]);this.layer=layer;if(this.layer.featureNS){this.featureNS=this.layer.featureNS;}
 +if(this.layer.options.geometry_column){this.geometryName=this.layer.options.geometry_column;}
 +if(this.layer.options.typename){this.featureName=this.layer.options.typename;}},write:function(features){var \
transaction=this.createElementNS(this.wfsns,'wfs:Transaction');transaction.setAttribute("version","1.0.0");transaction.setAttribute("service","WFS");for(var \
i=0;i<features.length;i++){switch(features[i].state){case \
OpenLayers.State.INSERT:transaction.appendChild(this.insert(features[i]));break;case \
OpenLayers.State.UPDATE:transaction.appendChild(this.update(features[i]));break;case \
OpenLayers.State.DELETE:transaction.appendChild(this.remove(features[i]));break;}} \
+return OpenLayers.Format.XML.prototype.write.apply(this,[transaction]);},createFeatureXML:function(feature){var \
geometryNode=this.buildGeometryNode(feature.geometry);var \
geomContainer=this.createElementNS(this.featureNS,"feature:"+this.geometryName);geomContainer.appendChild(geometryNode);var \
featureContainer=this.createElementNS(this.featureNS,"feature:"+this.featureName);featureContainer.appendChild(geomContainer);for(var \
attr in feature.attributes){var \
attrText=this.createTextNode(feature.attributes[attr]);var \
nodename=attr;if(attr.search(":")!=-1){nodename=attr.split(":")[1];} +var \
attrContainer=this.createElementNS(this.featureNS,"feature:"+nodename);attrContainer.appendChild(attrText);featureContainer.appendChild(attrContainer);}
 +return featureContainer;},insert:function(feature){var \
insertNode=this.createElementNS(this.wfsns,'wfs:Insert');insertNode.appendChild(this.createFeatureXML(feature));return \
insertNode;},update:function(feature){if(!feature.fid){alert(OpenLayers.i18n("noFID"));}
 +var updateNode=this.createElementNS(this.wfsns,'wfs:Update');updateNode.setAttribute("typeName",this.layerName);var \
propertyNode=this.createElementNS(this.wfsns,'wfs:Property');var \
nameNode=this.createElementNS(this.wfsns,'wfs:Name');var \
txtNode=this.createTextNode(this.geometryName);nameNode.appendChild(txtNode);propertyNode.appendChild(nameNode);var \
valueNode=this.createElementNS(this.wfsns,'wfs:Value');var \
geometryNode=this.buildGeometryNode(feature.geometry);if(feature.layer){geometryNode.setAttribute("srsName",feature.layer.projection.getCode());}
 +valueNode.appendChild(geometryNode);propertyNode.appendChild(valueNode);updateNode.appendChild(propertyNode);for(var \
propName in feature.attributes){propertyNode=this.createElementNS(this.wfsns,'wfs:Prop \
erty');nameNode=this.createElementNS(this.wfsns,'wfs:Name');nameNode.appendChild(this. \
createTextNode(propName));propertyNode.appendChild(nameNode);valueNode=this.createElem \
entNS(this.wfsns,'wfs:Value');valueNode.appendChild(this.createTextNode(feature.attrib \
utes[propName]));propertyNode.appendChild(valueNode);updateNode.appendChild(propertyNode);}
 +var filterNode=this.createElementNS(this.ogcns,'ogc:Filter');var \
filterIdNode=this.createElementNS(this.ogcns,'ogc:FeatureId');filterIdNode.setAttribut \
e("fid",feature.fid);filterNode.appendChild(filterIdNode);updateNode.appendChild(filterNode);return \
updateNode;},remove:function(feature){if(!feature.fid){alert(OpenLayers.i18n("noFID"));return \
false;} +var deleteNode=this.createElementNS(this.wfsns,'wfs:Delete');deleteNode.setAttribute("typeName",this.layerName);var \
filterNode=this.createElementNS(this.ogcns,'ogc:Filter');var \
filterIdNode=this.createElementNS(this.ogcns,'ogc:FeatureId');filterIdNode.setAttribut \
e("fid",feature.fid);filterNode.appendChild(filterIdNode);deleteNode.appendChild(filterNode);return \
deleteNode;},destroy:function(){this.layer=null;},CLASS_NAME:"OpenLayers.Format.WFS"}) \
;OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{polygon:null,ini \
tialize:function(control,callbacks,options){OpenLayers.Handler.Path.prototype.initialize.apply(this,arguments);},createFeature:function(){this.polygon=new \
OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon());this.line=new \
OpenLayers.Feature.Vector(new \
OpenLayers.Geometry.LinearRing());this.polygon.geometry.addComponent(this.line.geometry);this.point=new \
OpenLayers.Feature.Vector(new \
OpenLayers.Geometry.Point());},destroyFeature:function(){Ope  \
nLayers.Handler.Path.prototype.destroyFeature.apply(this);if(this.polygon){this.polygon.destroy();}
 +this.polygon=null;},modifyFeature:function(){var \
index=this.line.geometry.components.length-2;this.line.geometry.components[index].x=th \
is.point.geometry.x;this.line.geometry.components[index].y=this.point.geometry.y;this. \
line.geometry.components[index].clearBounds();},drawFeature:function(){this.layer.draw \
Feature(this.polygon,this.style);this.layer.drawFeature(this.point,this.style);},geometryClone:function(){return \
this.polygon.geometry.clone();},dblclick:function(evt){if(!this.freehandMode(evt)){var \
index=this.line.geometry.components.length-2;this.line.geometry.removeComponent(this.line.geometry.components[index]);this.finalize();}
 +return false;},CLASS_NAME:"OpenLayers.Handler.Polygon"});OpenLayers.Control.EditingT \
oolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(layer,options){O \
penLayers.Control.Panel.prototype.initialize.apply(this,[options]);this.addControls([new \
OpenLayers.Control.Navigation()]);var controls=[new \
OpenLayers.Control.DrawFeature(layer,OpenLayers.Handler.Point,{'displayClass':'olControlDrawFeaturePoint'}),new \
OpenLayers.Control.DrawFeature(layer,OpenLayers.Handler.Path,{'displayClass':'olControlDrawFeaturePath'}),new \
OpenLayers.Control.DrawFeature(layer,OpenLayers.Handler.Polygon,{'displayClass':'olControlDrawFeaturePolygon'})];for(var \
i=0;i<controls.length;i++){controls[i].featureAdded=function(feature){feature.state=OpenLayers.State.INSERT;};}
 +this.addControls(controls);},draw:function(){var \
div=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);this.activateControl(this.controls[0]);return \
div;},CLASS_NAME:"OpenLayers.Control.EditingToolbar"}); \ No newline at end of file

Copied: branches/testbaudson_dev/ext/jqjson.js (from rev 2556, \
trunk/mapbender/http/extensions/jqjson.js) \
==================================================================--- \
                branches/testbaudson_dev/ext/jqjson.js	                        (rev \
                0)
+++ branches/testbaudson_dev/ext/jqjson.js	2008-06-30 14:13:03 UTC (rev 2566)
@@ -0,0 +1,96 @@
+(function ($) {
+    var m = {
+            '\b': '\\b',
+            '\t': '\\t',
+            '\n': '\\n',
+            '\f': '\\f',
+            '\r': '\\r',
+            '"' : '\\"',
+            '\\': '\\\\'
+        },
+        s = {
+            'array': function (x) {
+                var a = ['['], b, f, i, l = x.length, v;
+                for (i = 0; i < l; i += 1) {
+                    v = x[i];
+                    f = s[typeof v];
+                    if (f) {
+                        v = f(v);
+                        if (typeof v == 'string') {
+                            if (b) {
+                                a[a.length] = ',';
+                            }
+                            a[a.length] = v;
+                            b = true;
+                        }
+                    }
+                }
+                a[a.length] = ']';
+                return a.join('');
+            },
+            'boolean': function (x) {
+                return String(x);
+            },
+            'null': function (x) {
+                return "null";
+            },
+            'number': function (x) {
+                return isFinite(x) ? String(x) : 'null';
+            },
+            'object': function (x) {
+                if (x) {
+                    if (x instanceof Array) {
+                        return s.array(x);
+                    }
+                    var a = ['{'], b, f, i, v;
+                    for (i in x) {
+                        v = x[i];
+                        f = s[typeof v];
+                        if (f) {
+                            v = f(v);
+                            if (typeof v == 'string') {
+                                if (b) {
+                                    a[a.length] = ',';
+                                }
+                                a.push(s.string(i), ':', v);
+                                b = true;
+                            }
+                        }
+                    }
+                    a[a.length] = '}';
+                    return a.join('');
+                }
+                return 'null';
+            },
+            'string': function (x) {
+                if (/["\\\x00-\x1f]/.test(x)) {
+                    x = x.replace(/([\x00-\x1f\\"])/g, function(a, b) {
+                        var c = m[b];
+                        if (c) {
+                            return c;
+                        }
+                        c = b.charCodeAt();
+                        return '\\u00' +
+                            Math.floor(c / 16).toString(16) +
+                            (c % 16).toString(16);
+                    });
+                }
+                return '"' + x + '"';
+            }
+        };
+
+	$.toJSON = function(v) {
+		var f = isNaN(v) ? s[typeof v] : s['number'];
+		if (f) return f(v);
+	};
+
+	$.parseJSON = function(v, safe) {
+		if (safe === undefined) safe = $.parseJSON.safe;
+		if (safe && !/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \
\n\r\t])+?$/.test(v)) +			return undefined;
+		return eval('('+v+')');
+	};
+
+	$.parseJSON.safe = false;
+
+})(jQuery);

Copied: branches/testbaudson_dev/ext/jquery-1.2.6.min.js (from rev 2556, \
trunk/mapbender/http/extensions/jquery-1.2.6.min.js) \
==================================================================--- \
                branches/testbaudson_dev/ext/jquery-1.2.6.min.js	                     \
                (rev 0)
+++ branches/testbaudson_dev/ext/jquery-1.2.6.min.js	2008-06-30 14:13:03 UTC (rev \
2566) @@ -0,0 +1,32 @@
+/*
+ * jQuery 1.2.6 - New Wave Javascript
+ *
+ * Copyright (c) 2008 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
+ * $Rev: 5685 $
+ */
+(function(){var _jQuery=window.jQuery,_$=window.$;var \
jQuery=window.jQuery=window.$=function(selector,context){return new \
jQuery.fn.init(selector,context);};var \
quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery \
.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return \
this;}if(typeof selector=="string"){var \
match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var \
elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return \
jQuery().find(selector);return jQuery(elem);}selector=[];}}else +return \
jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return \
jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return \
this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return \
this.length;},length:0,get:function(num){return \
num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var \
ret=jQuery(elems);ret.prevObject=this;return \
ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return \
this;},each:function(callback,args){return \
jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return \
jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var \
options=name;if(name.constructor==String)if(value===undefined)return \
this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return \
this.each(function(i){for(name in \
options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css
  :function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return \
this.attr(key,value,"curCSS");},text:function(text){if(typeof \
text!="object"&&text!=null)return \
this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var \
ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(thi \
s.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return \
ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var \
elem=this;while(elem.firstChild)elem=elem.firstChild;return \
elem;}).append(this);return this;},wrapInner:function(html){return \
this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return \
this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return \
this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:functio
  n(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return \
this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return \
this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return \
this.prevObject||jQuery([]);},find:function(selector){var \
elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return \
this.pushStack(/[^+>] \
[^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var \
ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var \
clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return \
jQuery.clean([container.innerHTML])[0];}else +return this.cloneNode(true);});var \
clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando \
]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var \
events=jQuery.data(this,"events");for(var type in events)for(var handler in \
events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return \
ret;},filter:function(selector){return \
this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return \
selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return \
this.pushStack(jQuery.multiFilter(selector,this,true));else \
+selector=jQuery.multiFilter(selector,this);var \
isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return \
this.filter(function(){return \
isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return \
this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof \
selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(select \
or){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return \
this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var \
elem=this[0];if(jQuery.nodeName(elem,"select")){var \
index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return \
null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var \
option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return \
value;values.push(value  );}}return values;}else
+return(this[0].value||"").replace(/\r/g,"");}return \
undefined;}if(value.constructor==Number)value+='';return \
this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|ch \
eckbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else \
if(jQuery.nodeName(this,"select")){var \
values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQ \
uery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
 +this.value=value;});},html:function(value){return \
value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return \
this.after(value).remove();},eq:function(i){return \
this.slice(i,i+1);},slice:function(){return \
this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return \
this.pushStack(jQuery.map(this,function(elem,i){return \
callback.call(elem,i,elem);}));},andSelf:function(){return \
this.add(this.prevObject);},data:function(key,value){var \
parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var \
data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return \
data===undefined&&parts[1]?this.data(parts[0]):data;}else +return \
this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return \
this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var \
clone=this.length>1,elems;return \
this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var \
obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=t \
his.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var \
scripts=jQuery([]);jQuery.each(elems,function(){var \
elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts= \
scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).r \
emove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function \
evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType  \
:"script"});else +jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function \
now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var \
target=arguments[0]||{},i=1,length=arguments.length,deepúlse,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof \
target!="object"&&typeof \
target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var \
name in options){var \
src=target[name],copy=options[name];if(target===copy)continue;if(deep&&copy&&typeof \
copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else \
if(copy!==undefined)target[name]=copy;}return target;};var \
expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoo \
m|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;r
  eturn jQuery;},isFunction:function(fn){return!!fn&&typeof \
fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return \
elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var \
head=document.getElementsByTagName("head")[0]||document.documentElement,script=documen \
t.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.textÚta;else
 +script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return \
elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var \
id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]Úta;return \
name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var \
id=elem[expando];if(name){if(jQuery.cache[id]){delete \
jQuery.cache[id][name];name="";for(name in \
jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete \
elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete \
jQuery.cache[id];}},each:function(object,callback,args){var \
name,i=0,length=object.length;if(args){if(length==undefined){for(name in \
object)if(callback.apply(object[name],args)==úl  se)break;}else
+for(;i<length;)if(callback.apply(object[i++],args)==úlse)break;}else{if(length==undefined){for(name \
in object)if(callback.call(object[name],name,object[name])==úlse)break;}else +for(var \
value=object[0];i<length&&callback.call(value,i,value)!=úlse;value=object[++i]){}}return \
object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return \
value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value \
;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/), \
function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" \
":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.classNa \
me=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" \
"):"";},has:function(elem,className){return \
jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var \
old={};for(var name in \
options){old[name]=elem.style[name];elem.style[name]=options[name];}  \
callback.call(elem);for(var name in \
options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var \
val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function \
getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var \
padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem \
,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width", \
true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
 +jQuery.swap(elem,props,getWH);return Math.max(0,val);}return \
jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var \
ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var \
retÞfaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")==" \
";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return \
ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var \
save=style.outline;style.outline="0 solid \
black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else \
if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var \
computedStyleÞfaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var \
swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])
  ){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display" \
&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(nam \
e))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else \
if(elem.currentStyle){var \
camelCase=name.replace(/\-(\w)/g,function(all,letter){return \
letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var \
left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle \
.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return \
ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof \
context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[ \
0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';i
  f(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return \
tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var \
tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var \
wrap=!tags.indexOf("<opt")&&[1,"<select \
multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset \
>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.ind \
> exOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.i \
> ndexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<co \
> l")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.ms \
> ie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var \
> tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&t
> 
 ags.indexOf("<tbody")<0?div.childNodes:[];for(var \
j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.l \
ength)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(c \
ontext.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(di \
v.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(el \
em,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
 +ret=jQuery.merge(ret,elem);});return \
ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return \
undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var \
special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name \
in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type \
property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return \
elem.getAttributeNode(name).nodeValue;return \
elem[name];}if(msie&&notxml&&name=="style")return \
jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var \
attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return \
attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replac
  e(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return \
elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity \
=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return \
letter.toUpperCase();});if(set)elem[name]=value;return \
elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var \
ret=[];if(array!=null){var \
i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else
 +while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var \
i=0,length=array.length;i<length;i++)if(array[i]===elem)return \
i;return-1;},merge:function(first,second){var \
i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
 +while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var \
ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var \
id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return \
ret;},grep:function(elems,callback,inv){var ret=[];for(var \
i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return \
ret;},map:function(elems,callback){var ret=[];for(var \
i=0,length=elems.length;i<length;i++){var \
valueÊllback(elems[i],i);if(value!=null)ret[ret.length]=value;}return \
ret.concat.apply([],ret);}});var \
userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: \
]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie \
:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var \
styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQu  \
ery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"f \
or":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:st \
yleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return \
elem.parentNode;},parents:function(elem){return \
jQuery.dir(elem,"parentNode");},next:function(elem){return \
jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return \
jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return \
jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return \
jQuery.dir(elem,"previousSibling");},siblings:function(elem){return \
jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return \
jQuery.sibling(elem.firstChild);},contents:function(elem){return \
jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuer \
y.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var \
ret=j  Query.map(this,fn);if(selector&&typeof \
selector=="string")ret=jQuery.multiFilter(selector,ret);return \
this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prep \
end",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var \
args=arguments;return this.each(function(){for(var \
i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.eac \
h({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.remove \
Attribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames); \
},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleCl \
ass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remov \
e":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(sel \
ector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.remove
  Data(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function \
(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return \
this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var \
type=name.toLowerCase();jQuery.fn[type]=function(size){return \
this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.saf \
ari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement \
["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(docu \
ment.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.bo \
dy["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.leng \
th?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function \
num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var \
cha  rs=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new \
RegExp("^>\\s*("+chars+"+)"),quickID=new \
RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new \
RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return \
m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return \
a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return \
i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return \
m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return \
i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return \
i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return \
a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return \
jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){r \
eturn!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return \
                a
 .firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return \
(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function \
(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility" \
)!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="non \
e"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return \
a.disabled;},checked:function(a){return a.checked;},selected:function(a){return \
a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio: \
function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},fi \
le:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;}, \
submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;}, \
reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button"
  );},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return \
jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return \
jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) \
*@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 \
*\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new \
RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var \
old,cur=[];while(expr&&expr!=old){old=expr;var \
f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return \
cur;},find:function(t,context){if(typeof \
t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var \
ret=[context],done=[],last,nodeName;while(t&&last!=t){var \
r=[];last=t;t=jQuery.trim(t);var \
foundTokenúlse,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var \
i=0;ret[i];i++)for(var c=ret  \
[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" \
")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var \
merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var \
n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var \
id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==n \
odeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.r \
eplace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" \
"+t.substr(1,t.length);}else{var re2=quickID;var \
m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var \
elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLD  \
oc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof \
oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var \
i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&& \
ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var \
tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var \
val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return \
done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var \
pass=(" "+r[i].className+" \
").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return \
                tmp;},filter:function(t,r,not){var last;while(t&&t
 !=last){last=t;var p=jQuery.parse,m;for(var \
i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g, \
"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else \
if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var \
tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var \
a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQue \
ry.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type== \
"^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else \
if(m[1]==":"&&m[2]=="nth-child"){var \
merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&& \
"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var \
i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNo  \
de,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var \
n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var \
addúlse;if(first==0){if(node.nodeIndex==last)add=true;}else \
if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var \
fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof \
fn=="string")fn=eval("false||function(a,i){return \
"+fn+";}");r=jQuery.grep(r,function(elem,i){return \
fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var \
matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return \
matched;},nth:function(cur,result,dir,elem){result=result||1;var \
num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return \
cur;},sibling:function(n,elem){var \
r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return \
r;}});jQuery.event={add:function(elem,types,handler,data){if  \
(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var \
fn=handler;handler=this.proxy(fn,function(){return \
fn.apply(this,arguments);});handler.dataÚta;}var \
events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof \
jQuery!="undefined"&&!jQuery.event.triggered)return \
jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var \
parts=type.split(".");type=parts[0];handler.type=parts[1];var \
handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[ \
type]||jQuery.event.special[type].setup.call(elem)==úlse){if(elem.addEventListener)elem.addEventListener(type,handle,false);else \
if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type
  ]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var \
events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof \
types=="string"&&types.charAt(0)=="."))for(var type in \
events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var \
parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete \
events[type][handler.guid];else +for(handler in \
events[type])if(!parts[1]||events[type][handler].type==parts[1])delete \
events[type][handler];for(ret in \
events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type] \
.teardown.call(elem)==úlse){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else \
if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete \
events[type];}}});}for(ret in events)break;if(!ret){var \
handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"e \
vents");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative, \
extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var \
exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return \
undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefaul
  t;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopProp \
agation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var \
handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQue \
ry.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,da \
ta)==úlse)valúlse;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra. \
apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donativ \
e!=úlse&&val!=úlse&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggeredúlse;}return \
val;},handle:function(event){var \
val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event \
);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=! \
namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for \
(var j in handlers){var \
handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data= \
handler.data;ret=handler.apply(this,arguments);if(val!=úlse)val=ret;if(ret==úlse){event.preventDefault();event.stopPropagation();}}}return \
val;},fix:function(event){if(event[expando]==true)return event;var \
originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange \
attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget \
data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget \
pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement \
target timeStamp toElement type view wheelDelta which".split(" ");for(var \
i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event \
.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefaul \
t();originalEvent.returnValueúlse;};event.stopPropagation=function(){if(originalEvent.s
  topPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};eve \
nt.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||do \
cument;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.rela \
tedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var \
doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.sc \
rollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc \
&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event \
.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCod \
e||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!even \
t.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return \
event;},proxy:function(fn,proxy){proxy.gu  \
id=fn.guid=fn.guid||proxy.guid||this.guid++;return \
proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return \
false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return \
true;},teardown:function(){if(jQuery.browser.msie)return \
false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return \
true;},handler:function(event){if(withinElement(event,this))return \
true;event.type="mouseenter";return \
jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return \
false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return \
true;},teardown:function(){if(jQuery.browser.msie)return \
false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return \
true;},handler:function(event){if(withinElement(event,this))return \
true;event.type="mouseleave";return jQuery.event.handle.apply  \
(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return \
type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var \
one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return \
this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return \
this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return \
this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return \
this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var \
args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return \
this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return \
args[this.lastToggle++].apply(this,arguments)||fals  \
e;}));},hover:function(fnOver,fnOut){return \
this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
 +jQuery.readyList.push(function(){return fn.call(this,jQuery);});return \
this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady \
){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){thi \
s.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var \
readyBoundúlse;function \
bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery \
.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQu \
ery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.docume \
ntElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery \
.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var \
i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.
  safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!=" \
loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, \
link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(ar \
guments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.r \
eady);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown, \
mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return \
fn?this.bind(name,fn):this.trigger(name);};});var \
withinElement=function(event,elem){var \
parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return \
parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,para
  ms,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" \
");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callbackÊllback||function(){};var \
type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var \
self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function \
(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<d \
iv/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return \
this;},serialize:function(){return \
jQuery.param(this.serializeArray());},serializeArray:function(){return \
this.map(function(){return \
jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return \
this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|passwo
  rd/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return \
val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem. \
name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajax \
Stop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return \
this.bind(o,f);};});var \
jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callbackÚta;data=null;}return \
jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return \
jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return \
jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callbackÚta;data={};}return \
jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,setting
  s);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"a \
pplication/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, \
text/xml",html:"text/html",script:"text/javascript, \
application/javascript",json:"application/json, \
text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var \
jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof \
s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){i \
f(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else \
if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"= \
?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+j
  sonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete \
window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cacheúlse;if(s.cache==úlse&&type=="GET"){var \
ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.u \
rl)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.mat \
ch(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var \
remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var \
head=document.getElementsByTagName("head")[0];var \
script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var \
doneúlse;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState
  ||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return \
undefined;}var requestDoneúlse;var xhr=window.ActiveXObject?new \
ActiveXObject("Microsoft.XMLHTTP"):new \
XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else
 +xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.con \
tentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, \
01 Jan 1970 00:00:00 \
GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", \
*/*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)==úlse){s.global&&jQuery.active--;xhr.abort();return \
false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var \
onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTim \
eout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTi \
meout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.h \
ttpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQu \
ery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"
  ){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
 +jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var \
ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){x \
hr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s \
.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function \
success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function \
complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajax \
Complete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return \
xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.globa \
l)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status> \
0&&xhr.status<300)||xhr.status=04||xhr.status=23||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return
  false;},httpNotModified:function(xhr,url){try{var \
xhrRes=xhr.getResponseHeader("Last-Modified");return \
xhr.status=04||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return \
+for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
 +s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return \
s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return \
speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.fi \
lter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var \
elem=jQuery("<"+this.tagName+" \
/>").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="n \
one")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return \
speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.fi \
lter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display \
");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return \
jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"to
  ggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return \
this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return \
this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return \
this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return \
this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return \
this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return \
this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var \
optall=jQuery.speed(speed,easing,callback);return \
this[optall.queue==úlse?"each":"queue"](function(){if(this.nodeType!=1)return \
false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p \
in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.c  \
omplete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display"); \
opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var \
e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var \
parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var \
end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+ \
unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
 +e.custom(start,val,"");}});return \
true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof \
type=="string"&&!fn))return queue(this[0],type);return \
this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type \
).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var \
timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var \
i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return \
this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var \
q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return \
q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var \
q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,
  easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing| \
|jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.cons \
tructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Numbe \
r?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.compl \
ete;opt.complete=function(){if(opt.queue!=úlse)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return \
opt;},easing:{linear:function(p,n,firstNum,diff){return \
firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0. \
5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options \
=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx. \
prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,thi \
s.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")thi
  s.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return \
this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return \
r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from \
,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var \
self=this;function t(gotoEnd){return \
self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var \
timers=jQuery.timers;for(var \
i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearI \
nterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.ori \
g[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom \
(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuer
  y(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this. \
elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var \
t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var \
done=true;for(var i in \
this.options.curAnim)if(this.options.curAnim[i]!==true)doneúlse;if(done){if(this.optio \
ns.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.displ \
ay=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.dis \
play="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var \
p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return \
false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery
                
 .easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return \
true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:f \
unction(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.no \
w;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:functi \
on(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var \
left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var \
parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerD \
ocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var \
box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft, \
doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc
                
 .documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft \
,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTo \
p);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(o \
ffsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/ \
^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent \
.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if( \
!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scroll \
Top);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parent \
Node;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(of \
fsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fi \
xed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}
  results={top:top,left:left};}function \
border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function \
add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return \
results;};jQuery.fn.extend({position:function(){var \
left=0,top=0,results;if(this[0]){var \
offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test \
(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'m \
arginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'bor \
derTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return \
results;},offsetParent:function(){var \
offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetPare \
nt.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return \
jQuery(offsetParent);}});jQuery.each(['Left  ','Top'],function(i,name){var \
method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return \
val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?va \
l:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):th \
is[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel& \
&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var \
tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return \
this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return \
this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();
 \ No newline at end of file

Copied: branches/testbaudson_dev/ext/jquery-ui-personalized-1.5.min.js (from rev \
2556, trunk/mapbender/http/extensions/jquery-ui-personalized-1.5.min.js) \
==================================================================--- \
branches/testbaudson_dev/ext/jquery-ui-personalized-1.5.min.js	                       \
                (rev 0)
+++ branches/testbaudson_dev/ext/jquery-ui-personalized-1.5.min.js	2008-06-30 \
14:13:03 UTC (rev 2566) @@ -0,0 +1,146 @@
+;(function($){$.ui={plugin:{add:function(module,option,set){var \
proto=$.ui[module].prototype;for(var i in \
set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var \
set=instance.plugins[name];if(!set){return;} +for(var \
i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},cssCache:{},css:function(name){if($.ui.cssCache[name]){return \
$.ui.cssCache[name];} +var tmp=$('<div \
class="ui-resizable-gen">').addClass(name).css({position:'absolute',top:'-5000px',left \
:'-5000px',display:'block'}).appendTo('body');$.ui.cssCache[name]=!!((!(/auto|default/ \
).test(tmp.css('cursor'))||(/^[1-9]/).test(tmp.css('height'))||(/^[1-9]/).test(tmp.css('width'))||!(/none/).test(tmp.css('backgroundImage'))||!(/transparent|rgba\(0, \
0, 0, 0\)/).test(tmp.css('backgroundColor'))));try{$('body').get(0).removeChild(tmp.get(0));}catch(e){}
 +return $.ui.cssCache[name];},disableSelection:function(e){e.unselectable="on";e.onselectstart=function(){return \
false;};if(e.style){e.style.MozUserSelect="none";}},enableSelection:function(e){e.unselectable="off";e.onselectstart=function(){return \
true;};if(e.style){e.style.MozUserSelect="";}},hasScroll:function(e,a){var \
scroll=/top/.test(a||"top")?'scrollTop':'scrollLeft',hasúlse;if(e[scroll]>0)return \
true;e[scroll]=1;has=e[scroll]>0?true:false;e[scroll]=0;return has;}};var \
_remove=$.fn.remove;$.fn.remove=function(){$("*",this).add(this).trigger("remove");return \
_remove.apply(this,arguments);};function getter(namespace,plugin,method){var \
methods=$[namespace][plugin].getter||[];methods=(typeof \
methods=="string"?methods.split(/,?\s+/):methods);return($.inArray(method,methods)!=-1);}
 +$.widget=function(name,prototype){var \
namespace=name.split(".")[0];name=name.split(".")[1];$.fn[name]=function(options){var \
isMethodCall=(typeof \
options=='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&getter(namespace,name,options)){var \
instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
 +return this.each(function(){var \
instance=$.data(this,name);if(isMethodCall&&instance&&$.isFunction(instance[options])){instance[options].apply(instance,args);}else \
if(!isMethodCall){$.data(this,name,new \
$[namespace][name](this,options));}});};$[namespace][name]=function(element,options){var \
self=this;this.widgetName=name;this.widgetBaseClass=namespace+'-'+name;this.options=$. \
extend({disabled:false},$[namespace][name].defaults,options);this.element=$(element).bind('setData.'+name,function(e,key,value){return \
self.setData(key,value);}).bind('getData.'+name,function(e,key){return \
self.getData(key);}).bind('remove',function(){return \
self.destroy();});this.init();};$[namespace][name].prototype=$.extend({},$.widget.prot \
otype,prototype);};$.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName);},getData:function(key){return \
this.options[key];},setData:function(key,value){this.options[key]=value;if(key=='disabled'){this.element[value?'addCla
  ss':'removeClass'](this.widgetBaseClass+'-disabled');}},enable:function(){this.setDa \
ta('disabled',false);},disable:function(){this.setData('disabled',true);}};$.ui.mouse={mouseInit:function(){var \
self=this;this.element.bind('mousedown.'+this.widgetName,function(e){return \
self.mouseDown(e);});if($.browser.msie){this._mouseUnselectable=this.element.attr('unselectable');this.element.attr('unselectable','on');}
 +this.startedúlse;},mouseDestroy:function(){this.element.unbind('.'+this.widgetName); \
($.browser.msie&&this.element.attr('unselectable',this._mouseUnselectable));},mouseDown:function(e){(this._mouseStarted&&this.mouseUp(e));this._mouseDownEvent=e;var \
self=this,btnIsLeft=(e.which==1),elIsCancel=(typeof \
this.options.cancel=="string"?$(e.target).is(this.options.cancel):false);if(!btnIsLeft||elIsCancel||!this.mouseCapture(e)){return \
true;} +this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self._mouseDelayMet=true;},this.options.delay);}
 +if(this.mouseDistanceMet(e)&&this.mouseDelayMet(e)){this._mouseStarted=(this.mouseStart(e)!=úlse);if(!this._mouseStarted){e.preventDefault();return \
true;}} +this._mouseMoveDelegate=function(e){return \
self.mouseMove(e);};this._mouseUpDelegate=function(e){return \
self.mouseUp(e);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);return \
false;},mouseMove:function(e){if($.browser.msie&&!e.button){return this.mouseUp(e);} \
+if(this._mouseStarted){this.mouseDrag(e);return false;} \
+if(this.mouseDistanceMet(e)&&this.mouseDelayMet(e)){this._mouseStarted=(this.mouseSta \
rt(this._mouseDownEvent,e)!=úlse);(this._mouseStarted?this.mouseDrag(e):this.mouseUp(e));}
 +return!this._mouseStarted;},mouseUp:function(e){$(document).unbind('mousemove.'+this \
.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStartedúlse;this.mouseStop(e);}
 +return false;},mouseDistanceMet:function(e){return(Math.max(Math.abs(this._mouseDown \
Event.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance);},mouseDelayMet:function(e){return \
this._mouseDelayMet;},mouseStart:function(e){},mouseDrag:function(e){},mouseStop:function(e){},mouseCapture:function(e){return \
true;}};$.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery);(function($){$.widget("ui.draggable",$.extend($.ui.mouse,{init:function(){var \
o=this.options;if(o.helper=='original'&&!(/(relative|absolute|fixed)/).test(this.element.css('position')))
 +this.element.css('position','relative');this.element.addClass('ui-draggable');(o.dis \
abled&&this.element.addClass('ui-draggable-disabled'));this.mouseInit();},mouseStart:function(e){var \
o=this.options;if(this.helper||o.disabled||$(e.target).is('.ui-resizable-handle'))return \
false;var handle=!this.options.handle||!$(this.options.handle,this.element).length?tru \
e:false;$(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==e.target)handle=true;});if(!handle)return \
false;if($.ui.ddmanager)$.ui.ddmanager.current=this;this.helper=$.isFunction(o.helper) \
?$(o.helper.apply(this.element[0],[e])):(o.helper=='clone'?this.element.clone():this.e \
lement);if(!this.helper.parents('body').length)this.helper.appendTo((o.appendTo=='pare \
nt'?this.element[0].parentNode:o.appendTo));if(this.helper[0]!=this.element[0]&&!(/(fi \
xed|absolute)/).test(this.helper.css("position")))this.helper.css("position","absolute");this.margins={left:(parseInt(this.element.css("marginLeft"),10)||
  0),top:(parseInt(this.element.css("marginTop"),10)||0)};this.cssPosition=this.helper \
.css("position");this.offset=this.element.offset();this.offset={top:this.offset.top-th \
is.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:e.page \
X-this.offset.left,top:e.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var \
po=this.offsetParent.offset();if(this.offsetParent[0]==document.body&&$.browser.mozill \
a)po={top:0,left:0};this.offset.parent={top:po.top+(parseInt(this.offsetParent.css("bo \
rderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};var \
p=this.element.position();this.offset.relative=this.cssPosition=="relative"?{top:p.top \
-(parseInt(this.helper.css("top"),10)||0)+this.offsetParent[0].scrollTop,left:p.left-( \
parseInt(this.helper.css("left"),10)||0)+this.offsetParent[0].scrollLeft}:{top:0,left: \
0};this.originalPosition=this.generatePosition(e);this.helperProportions={width:this.helper.outerWidth(),h
  eight:this.helper.outerHeight()};if(o.cursorAt){if(o.cursorAt.left!=undefined)this.o \
ffset.click.left=o.cursorAt.left+this.margins.left;if(o.cursorAt.right!=undefined)this \
.offset.click.left=this.helperProportions.width-o.cursorAt.right+this.margins.left;if( \
o.cursorAt.top!=undefined)this.offset.click.top=o.cursorAt.top+this.margins.top;if(o.c \
ursorAt.bottom!=undefined)this.offset.click.top=this.helperProportions.height-o.cursorAt.bottom+this.margins.top;}
 +if(o.containment){if(o.containment=='parent')o.containment=this.helper[0].parentNode \
;if(o.containment=='document'||o.containment=='window')this.containment=[0-this.offset \
.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.t \
op,$(o.containment=='document'?document:window).width()-this.offset.relative.left-this \
.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.elem \
ent.css("marginRight"),10)||0),($(o.containment=='document'?document:window).height()| \
|document.body.parentNode.scrollHeight)-this.offset.relative.top-this.offset.parent.to \
p-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)];if(!(/^(document|window|parent)$/).test(o.containment)){var \
ce=$(o.containment)[0];var \
co=$(o.containment).offset();this.containment=[co.left+(parseInt($(ce).css("borderLeft \
Width"),10)||0)-this.offset.relative.left-this.offset.parent.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)|
  |0)-this.offset.relative.top-this.offset.parent.top,co.left+Math.max(ce.scrollWidth, \
ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-this.offset.relative.le \
ft-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(th \
is.element.css("marginRight"),10)||0),co.top+Math.max(ce.scrollHeight,ce.offsetHeight) \
-(parseInt($(ce).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.pa \
rent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)];}}
 +this.propagate("start",e);this.helperProportions={width:this.helper.outerWidth(),hei \
ght:this.helper.outerHeight()};if($.ui.ddmanager&&!o.dropBehaviour)$.ui.ddmanager.prep \
areOffsets(this,e);this.helper.addClass("ui-draggable-dragging");this.mouseDrag(e);return \
true;},convertPositionTo:function(d,pos){if(!pos)pos=this.position;var \
mod=d=="absolute"?1:-1;return{top:(pos.top ++this.offset.relative.top*mod
++this.offset.parent.top*mod
+-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollTop)*mod
 ++(this.cssPosition=="fixed"?this.offsetParent[0].scrollTop:0)*mod
++this.margins.top*mod),left:(pos.left
++this.offset.relative.left*mod
++this.offset.parent.left*mod
+-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollLeft)*mod
 ++(this.cssPosition=="fixed"?this.offsetParent[0].scrollLeft:0)*mod
++this.margins.left*mod)};},generatePosition:function(e){var o=this.options;var \
position={top:(e.pageY +-this.offset.click.top
+-this.offset.relative.top
+-this.offset.parent.top
++(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollTop)
 +-(this.cssPosition=="fixed"?this.offsetParent[0].scrollTop:0)),left:(e.pageX
+-this.offset.click.left
+-this.offset.relative.left
+-this.offset.parent.left
++(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollLeft)
 +-(this.cssPosition=="fixed"?this.offsetParent[0].scrollLeft:0))};if(!this.originalPosition)return \
position;if(this.containment){if(position.left<this.containment[0])position.left=this. \
containment[0];if(position.top<this.containment[1])position.top=this.containment[1];if \
(position.left>this.containment[2])position.left=this.containment[2];if(position.top>this.containment[3])position.top=this.containment[3];}
 +if(o.grid){var top=this.originalPosition.top+Math.round((position.top-this.originalP \
osition.top)/o.grid[1])*o.grid[1];position.top=this.containment?(!(top<this.containmen \
t[1]||top>this.containment[3])?top:(!(top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var \
left=this.originalPosition.left+Math.round((position.left-this.originalPosition.left)/ \
o.grid[0])*o.grid[0];position.left=this.containment?(!(left<this.containment[0]||left> \
this.containment[2])?left:(!(left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}
 +return position;},mouseDrag:function(e){this.position=this.generatePosition(e);this. \
positionAbs=this.convertPositionTo("absolute");this.position=this.propagate("drag",e)| \
|this.position;if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left \
=this.position.left+'px';if(!this.options.axis||this.options.axis!="x")this.helper[0]. \
style.top=this.position.top+'px';if($.ui.ddmanager)$.ui.ddmanager.drag(this,e);return \
false;},mouseStop:function(e){if($.ui.ddmanager&&!this.options.dropBehaviour) \
+$.ui.ddmanager.drop(this,e);if(this.options.revert){var \
self=this;$(this.helper).animate(this.originalPosition,parseInt(this.options.revert,10 \
)||500,function(){self.propagate("stop",e);self.clear();});}else{this.propagate("stop",e);this.clear();}
 +return false;},clear:function(){this.helper.removeClass("ui-draggable-dragging");if( \
this.options.helper!='original'&&!this.cancelHelperRemoval)this.helper.remove();this.h \
elper=null;this.cancelHelperRemovalúlse;},plugins:{},uiHash:function(e){return{helper: \
this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options};},propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.uiHash()]);return \
this.element.triggerHandler(n=="drag"?n:"drag"+n,[e,this.uiHash()],this.options[n]);}, \
destroy:function(){if(!this.element.data('draggable'))return;this.element.removeData(" \
draggable").unbind(".draggable").removeClass('ui-draggable');this.mouseDestroy();}})); \
$.extend($.ui.draggable,{defaults:{appendTo:"parent",axis:false,cancel:":input,button" \
,delay:0,distance:0,helper:"original"}});$.ui.plugin.add("draggable","cursor",{start:function(e,ui){var \
t=$('body');if(t.css("cursor"))ui.options._cursor=t.css("cursor");t.css("cursor",ui.options.cursor);},stop:function(
  e,ui){if(ui.options._cursor)$('body').css("cursor",ui.options._cursor);}});$.ui.plugin.add("draggable","zIndex",{start:function(e,ui){var \
t=$(ui.helper);if(t.css("zIndex"))ui.options._zIndex=t.css("zIndex");t.css('zIndex',ui \
.options.zIndex);},stop:function(e,ui){if(ui.options._zIndex)$(ui.helper).css('zIndex' \
,ui.options._zIndex);}});$.ui.plugin.add("draggable","opacity",{start:function(e,ui){var \
t=$(ui.helper);if(t.css("opacity"))ui.options._opacity=t.css("opacity");t.css('opacity \
',ui.options.opacity);},stop:function(e,ui){if(ui.options._opacity)$(ui.helper).css('o \
pacity',ui.options._opacity);}});$.ui.plugin.add("draggable","iframeFix",{start:functi \
on(e,ui){$(ui.options.iframeFix===true?"iframe":ui.options.iframeFix).each(function(){$('<div \
class="ui-draggable-iframeFix" style="background: \
#fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",positio \
n:"absolute",opacity:"0.001",zIndex:1000}).css($(this).offset()).appendTo("body");});},stop:function(e
  ,ui){$("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this);});}});$.ui.plugin.add("draggable","scroll",{start:function(e,ui){var \
o=ui.options;var i=$(this).data("draggable");o.scrollSensitivity=o.scrollSensitivity|| \
20;o.scrollSpeed=o.scrollSpeed||20;i.overflowY=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-y')))return \
el;el=el.parent();}while(el[0].parentNode);return \
$(document);}(this);i.overflowX=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-x')))return \
el;el=el.parent();}while(el[0].parentNode);return \
$(document);}(this);if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML')i.over \
flowYOffset=i.overflowY.offset();if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML')i.overflowXOffset=i.overflowX.offset();},drag:function(e,ui){var \
o=ui.options;var i=$(this).data("draggable");if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML'){if((
  i.overflowYOffset.top+i.overflowY[0].offsetHeight)-e.pageY<o.scrollSensitivity)
+i.overflowY[0].scrollTop=i.overflowY[0].scrollTop+o.scrollSpeed;if(e.pageY-i.overflowYOffset.top<o.scrollSensitivity)
 +i.overflowY[0].scrollTop=i.overflowY[0].scrollTop-o.scrollSpeed;}else{if(e.pageY-$(document).scrollTop()<o.scrollSensitivity)
 +$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);if($(window).height()-(e.pageY-$(document).scrollTop())<o.scrollSensitivity)
 +$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}
+if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML'){if((i.overflowXOffset.left+i.overflowX[0].offsetWidth)-e.pageX<o.scrollSensitivity)
 +i.overflowX[0].scrollLeft=i.overflowX[0].scrollLeft+o.scrollSpeed;if(e.pageX-i.overflowXOffset.left<o.scrollSensitivity)
 +i.overflowX[0].scrollLeft=i.overflowX[0].scrollLeft-o.scrollSpeed;}else{if(e.pageX-$(document).scrollLeft()<o.scrollSensitivity)
 +$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);if($(window).width()-(e.pageX-$(document).scrollLeft())<o.scrollSensitivity)
 +$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}});$.ui.plugin.add("draggable","snap",{start:function(e,ui){var \
inst=$(this).data("draggable");inst.snapElements=[];$(ui.options.snap===true?'.ui-draggable':ui.options.snap).each(function(){var \
$t=$(this);var $o=$t.offset();if(this!=inst.element[0])inst.snapElements.push({item:th \
is,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left});});},drag:function(e,ui){var \
inst=$(this).data("draggable");var d=ui.options.snapTolerance||20;var \
x1=ui.absolutePosition.left,x2=x1+inst.helperProportions.width,y1=ui.absolutePosition.top,y2=y1+inst.helperProportions.height;for(var \
i=inst.snapElements.length-1;i>=0;i--){var \
l=inst.snapElements[i].left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top, \
b=t+inst.snapElements[i].height;if(!((l-d<x1&&x1<r+d&&t-d<y1&&y1<b+d)||(l-d<x1&&x1<r+d \
&&t-d<y2&&y2<b+d)||(l-d<x2&&x2<r+d&&t-d<y1&&y1<b+d)||(l-d<x2&&x2<r+d&&t-d<y2&&y2<b+d)))continue;if(ui.options.snapMode!='
  inner'){var ts=Math.abs(t-y2)< ;var bs=Math.abs(b-y1)< ;var ls=Math.abs(l-x2)< ;var \
rs=Math.abs(r-x1)< ;if(ts)ui.position.top=inst.convertPositionTo("relative",{top:t-ins \
t.helperProportions.height,left:0}).top;if(bs)ui.position.top=inst.convertPositionTo(" \
relative",{top:b,left:0}).top;if(ls)ui.position.left=inst.convertPositionTo("relative" \
,{top:0,left:l-inst.helperProportions.width}).left;if(rs)ui.position.left=inst.convertPositionTo("relative",{top:0,left:r}).left;}
 +if(ui.options.snapMode!='outer'){var ts=Math.abs(t-y1)< ;var bs=Math.abs(b-y2)< \
;var ls=Math.abs(l-x1)< ;var rs=Math.abs(r-x2)< \
;if(ts)ui.position.top=inst.convertPositionTo("relative",{top:t,left:0}).top;if(bs)ui. \
position.top=inst.convertPositionTo("relative",{top:b-inst.helperProportions.height,le \
ft:0}).top;if(ls)ui.position.left=inst.convertPositionTo("relative",{top:0,left:l}).le \
ft;if(rs)ui.position.left=inst.convertPositionTo("relative",{top:0,left:r-inst.helperP \
roportions.width}).left;}};}});$.ui.plugin.add("draggable","connectToSortable",{start:function(e,ui){var \
inst=$(this).data("draggable");inst.sortables=[];$(ui.options.connectToSortable).each(function(){if($.data(this,'sortable')){var \
sortable=$.data(this,'sortable');inst.sortables.push({instance:sortable,shouldRevert:s \
ortable.options.revert});sortable.refresh();sortable.propagate("activate",e,inst);}});},stop:function(e,ui){var \
inst=$(this).data("draggable");$.each(inst.sortables,function(){if(this.insta  \
nce.isOver){this.instance.isOver=0;inst.cancelHelperRemoval=true;this.instance.cancelH \
elperRemovalúlse;if(this.shouldRevert)this.instance.options.revert=true;this.instance. \
mouseStop(e);this.instance.element.triggerHandler("sortreceive",[e,$.extend(this.insta \
nce.ui(),{sender:inst.element})],this.instance.options["receive"]);this.instance.optio \
ns.helper=this.instance.options._helper;}else{this.instance.propagate("deactivate",e,inst);}});},drag:function(e,ui){var \
inst=$(this).data("draggable"),self=this;var checkPos=function(o){var \
l=o.left,r=l+o.width,t=o.top,b=t+o.height;return(l<(this.positionAbs.left+this.offset. \
click.left)&&(this.positionAbs.left+this.offset.click.left)<r&&t<(this.positionAbs.top \
+this.offset.click.top)&&(this.positionAbs.top+this.offset.click.top)<b);};$.each(inst \
.sortables,function(i){if(checkPos.call(inst,this.instance.containerCache)){if(!this.i \
nstance.isOver){this.instance.isOver=1;this.instance.currentItem=$(self).clone().appendTo(this.instance.elem
  ent).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return \
ui.helper[0];};e.target=this.instance.currentItem[0];this.instance.mouseCapture(e,true \
,true);this.instance.mouseStart(e,true,true);this.instance.offset.click.top=inst.offse \
t.click.top;this.instance.offset.click.left=inst.offset.click.left;this.instance.offse \
t.parent.left-=inst.offset.parent.left-this.instance.offset.parent.left;this.instance. \
offset.parent.top-=inst.offset.parent.top-this.instance.offset.parent.top;inst.propagate("toSortable",e);}
 +if(this.instance.currentItem)this.instance.mouseDrag(e);}else{if(this.instance.isOve \
r){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options \
.revertúlse;this.instance.mouseStop(e,true);this.instance.options.helper=this.instance \
.options._helper;this.instance.currentItem.remove();this.instance.placeholder.remove() \
;inst.propagate("fromSortable",e);}};});}});$.ui.plugin.add("draggable","stack",{start:function(e,ui){var \
group=$.makeArray($(ui.options.stack.group)).sort(function(a,b){return(parseInt($(a).c \
ss("zIndex"),10)||ui.options.stack.min)-(parseInt($(b).css("zIndex"),10)||ui.options.s \
tack.min);});$(group).each(function(i){this.style.zIndex=ui.options.stack.min+i;});thi \
s[0].style.zIndex=ui.options.stack.min+group.length;}});})(jQuery);(function($){$.widg \
et("ui.droppable",{init:function(){this.element.addClass("ui-droppable");this.isover=0;this.isout=1;var \
o=this.options,accept=o.accept;o=$.extend(o,{accept:o.accept&&o.accept.constructor==Functio
  n?o.accept:function(d){return \
$(d).is(accept);}});this.proportions={width:this.element.outerWidth(),height:this.elem \
ent.outerHeight()};$.ui.ddmanager.droppables.push(this);},plugins:{},ui:function(c){re \
turn{draggable:(c.currentItem||c.element),helper:c.helper,position:c.position,absolute \
Position:c.positionAbs,options:this.options,element:this.element};},destroy:function(){var \
drop=$.ui.ddmanager.droppables;for(var i=0;i<drop.length;i++) +if(drop[i]==this)
+drop.splice(i,1);this.element.removeClass("ui-droppable \
ui-droppable-disabled").removeData("droppable").unbind(".droppable");},over:function(e){var \
draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.elem \
ent)[0]==this.element[0])return;if(this.options.accept.call(this.element,(draggable.cu \
rrentItem||draggable.element))){$.ui.plugin.call(this,'over',[e,this.ui(draggable)]);t \
his.element.triggerHandler("dropover",[e,this.ui(draggable)],this.options.over);}},out:function(e){var \
draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.elem \
ent)[0]==this.element[0])return;if(this.options.accept.call(this.element,(draggable.cu \
rrentItem||draggable.element))){$.ui.plugin.call(this,'out',[e,this.ui(draggable)]);th \
is.element.triggerHandler("dropout",[e,this.ui(draggable)],this.options.out);}},drop:function(e,custom){var \
draggable=custom||$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.elemen
  t[0])return false;var \
childrenIntersectionúlse;this.element.find(".ui-droppable").not(".ui-draggable-dragging").each(function(){var \
inst=$.data(this,'droppable');if(inst.options.greedy&&$.ui.intersect(draggable,$.exten \
d(inst,{offset:inst.element.offset()}),inst.options.tolerance)){childrenIntersection=true;return \
false;}});if(childrenIntersection)return \
false;if(this.options.accept.call(this.element,(draggable.currentItem||draggable.eleme \
nt))){$.ui.plugin.call(this,'drop',[e,this.ui(draggable)]);this.element.triggerHandler("drop",[e,this.ui(draggable)],this.options.drop);return \
true;} +return false;},activate:function(e){var \
draggable=$.ui.ddmanager.current;$.ui.plugin.call(this,'activate',[e,this.ui(draggable \
)]);if(draggable)this.element.triggerHandler("dropactivate",[e,this.ui(draggable)],this.options.activate);},deactivate:function(e){var \
draggable=$.ui.ddmanager.current;$.ui.plugin.call(this,'deactivate',[e,this.ui(draggab \
le)]);if(draggable)this.element.triggerHandler("dropdeactivate",[e,this.ui(draggable)] \
,this.options.deactivate);}});$.extend($.ui.droppable,{defaults:{disabled:false,tolera \
nce:'intersect'}});$.ui.intersect=function(draggable,droppable,toleranceMode){if(!droppable.offset)return \
false;var x1=(draggable.positionAbs||draggable.position.absolute).left,x2=x1+draggable \
.helperProportions.width,y1=(draggable.positionAbs||draggable.position.absolute).top,y2=y1+draggable.helperProportions.height;var \
l=droppable.offset.left,r=l+droppable.proportions.width,t=droppable.offset.top,b=t+droppable.proportions.height;switch(toleranceMode){case'fit':retu
  rn(l<x1&&x2<r&&t<y1&&y2<b);break;case'intersect':return(l<x1+(draggable.helperPropor \
tions.width/2)&&x2-(draggable.helperProportions.width/2)<r&&t<y1+(draggable.helperProp \
ortions.height/2)&&y2-(draggable.helperProportions.height/2)<b);break;case'pointer':re \
turn(l<((draggable.positionAbs||draggable.position.absolute).left+(draggable.clickOffs \
et||draggable.offset.click).left)&&((draggable.positionAbs||draggable.position.absolut \
e).left+(draggable.clickOffset||draggable.offset.click).left)<r&&t<((draggable.positio \
nAbs||draggable.position.absolute).top+(draggable.clickOffset||draggable.offset.click) \
.top)&&((draggable.positionAbs||draggable.position.absolute).top+(draggable.clickOffse \
t||draggable.offset.click).top)<b);break;case'touch':return((y1>=t&&y1<=b)||(y2>=t&&y2 \
<=b)||(y1<t&&y2>b))&&((x1>=l&&x1<=r)||(x2>=l&&x2<=r)||(x1<l&&x2>r));break;default:return \
false;break;}};$.ui.ddmanager={current:null,droppables:[],prepareOffsets:function(t,e){var \
m=$.ui.ddmanager.droppables;var type e?e.type:null;for(var \
i=0;i<m.length;i++){if(m[i].options.disabled||(t&&!m[i].options.accept.call(m[i].eleme \
nt,(t.currentItem||t.element))))continue;m[i].visible=m[i].element.is(":visible");if(! \
m[i].visible)continue;m[i].offset=m[i].element.offset();m[i].proportions={width:m[i].e \
lement.outerWidth(),height:m[i].element.outerHeight()};if(type=="dragstart"||type=="sortactivate")m[i].activate.call(m[i],e);}},drop:function(draggable,e){var \
droppedúlse;$.each($.ui.ddmanager.droppables,function(){if(!this.options)return;if(!th \
is.options.disabled&&this.visible&&$.ui.intersect(draggable,this,this.options.tolerance))
 +dropped=this.drop.call(this,e);if(!this.options.disabled&&this.visible&&this.options \
.accept.call(this.element,(draggable.currentItem||draggable.element))){this.isout=1;this.isover=0;this.deactivate.call(this,e);}});return \
dropped;},drag:function(draggable,e){if(draggable.options.refreshPositions)$.ui.ddmana \
ger.prepareOffsets(draggable,e);$.each($.ui.ddmanager.droppables,function(){if(this.disabled||this.greedyChild||!this.visible)return;var \
intersects=$.ui.intersect(draggable,this,this.options.tolerance);var \
c=!intersects&&this.isover==1?'isout':(intersects&&this.isover==0?'isover':null);if(!c)return;var \
parentInstance;if(this.options.greedy){var \
parent=this.element.parents('.ui-droppable:eq(0)');if(parent.length){parentInstance=$.data(parent[0],'droppable');parentInstance.greedyChild=(c=='isover'?1:0);}}
 +if(parentInstance&&c=='isover'){parentInstance['isover']=0;parentInstance['isout']=1;parentInstance.out.call(parentInstance,e);}
 +this[c]=1;this[c=='isout'?'isover':'isout']=0;this[c=="isover"?"over":"out"].call(th \
is,e);if(parentInstance&&c=='isout'){parentInstance['isout']=0;parentInstance['isover' \
]=1;parentInstance.over.call(parentInstance,e);}});}};$.ui.plugin.add("droppable","act \
iveClass",{activate:function(e,ui){$(this).addClass(ui.options.activeClass);},deactiva \
te:function(e,ui){$(this).removeClass(ui.options.activeClass);},drop:function(e,ui){$( \
this).removeClass(ui.options.activeClass);}});$.ui.plugin.add("droppable","hoverClass" \
,{over:function(e,ui){$(this).addClass(ui.options.hoverClass);},out:function(e,ui){$(t \
his).removeClass(ui.options.hoverClass);},drop:function(e,ui){$(this).removeClass(ui.o \
ptions.hoverClass);}});})(jQuery);(function($){$.widget("ui.resizable",$.extend($.ui.mouse,{init:function(){var \
self=this,o=this.options;var \
elpos=this.element.css('position');this.element.addClass("ui-resizable").css({position:/static/.test(elpos)?'relative':elpos});$.extend(o,{_aspectRatio:!!(o.aspec
  tRatio),proxy:o.proxy||o.ghost||o.animate?o.proxy||'proxy':null,knobHandles:o.knobHandles===true?'ui-resizable-knob-handle':o.knobHandles});var \
aBorder='1px solid #DEDEDE';o.defaultTheme={'ui-resizable':{display:'block'},'ui-resiz \
able-handle':{position:'absolute',background:'#F2F2F2',fontSize:'0.1px'},'ui-resizable \
-n':{cursor:'n-resize',height:'4px',left:'0px',right:'0px',borderTop:aBorder},'ui-resi \
zable-s':{cursor:'s-resize',height:'4px',left:'0px',right:'0px',borderBottom:aBorder}, \
'ui-resizable-e':{cursor:'e-resize',width:'4px',top:'0px',bottom:'0px',borderRight:aBo \
rder},'ui-resizable-w':{cursor:'w-resize',width:'4px',top:'0px',bottom:'0px',borderLef \
t:aBorder},'ui-resizable-se':{cursor:'se-resize',width:'4px',height:'4px',borderRight: \
aBorder,borderBottom:aBorder},'ui-resizable-sw':{cursor:'sw-resize',width:'4px',height \
:'4px',borderBottom:aBorder,borderLeft:aBorder},'ui-resizable-ne':{cursor:'ne-resize',width:'4px',height:'4px',borderRight:aBorder,borderTop:aBorder},'ui-res
  izable-nw':{cursor:'nw-resize',width:'4px',height:'4px',borderLeft:aBorder,borderTop:aBorder}};o.knobTheme={'ui-resizable-handle':{background:'#F2F2F2',border:'1px \
solid #808080',height:'8px',width:'8px'},'ui-resizable-n':{cursor:'n-resize',top:'0px' \
,left:'45%'},'ui-resizable-s':{cursor:'s-resize',bottom:'0px',left:'45%'},'ui-resizabl \
e-e':{cursor:'e-resize',right:'0px',top:'45%'},'ui-resizable-w':{cursor:'w-resize',lef \
t:'0px',top:'45%'},'ui-resizable-se':{cursor:'se-resize',right:'0px',bottom:'0px'},'ui \
-resizable-sw':{cursor:'sw-resize',left:'0px',bottom:'0px'},'ui-resizable-nw':{cursor: \
'nw-resize',left:'0px',top:'0px'},'ui-resizable-ne':{cursor:'ne-resize',right:'0px',to \
p:'0px'}};o._nodeName=this.element[0].nodeName;if(o._nodeName.match(/canvas|textarea|input|select|button|img/i)){var \
el=this.element;if(/relative/.test(el.css('position'))&&$.browser.opera) \
+el.css({position:'relative',top:'auto',left:'auto'});el.wrap($('<div \
class="ui-wrapper" style="overflow: \
hidden;"></div>').css({position:el.css('position'),width:el.outerWidth(),height:el.outerHeight(),top:el.css('top'),left:el.css('left')}));var \
oel=this.element;this.element=this.element.parent();this.element.data('resizable',this \
);this.element.css({marginLeft:oel.css("marginLeft"),marginTop:oel.css("marginTop"),ma \
rginRight:oel.css("marginRight"),marginBottom:oel.css("marginBottom")});oel.css({margi \
nLeft:0,marginTop:0,marginRight:0,marginBottom:0});if($.browser.safari&&o.preventDefau \
lt)oel.css('resize','none');o.proportionallyResize=oel.css({position:'static',zoom:1,d \
isplay:'block'});this.element.css({margin:oel.css('margin')});this._proportionallyResize();}
 +if(!o.handles)o.handles=!$('.ui-resizable-handle',this.element).length?"e,s,se":{n:' \
.ui-resizable-n',e:'.ui-resizable-e',s:'.ui-resizable-s',w:'.ui-resizable-w',se:'.ui-r \
esizable-se',sw:'.ui-resizable-sw',ne:'.ui-resizable-ne',nw:'.ui-resizable-nw'};if(o.h \
andles.constructor==String){o.zIndex=o.zIndex||1000;if(o.handles=='all')o.handles='n,e,s,w,se,sw,ne,nw';var \
n=o.handles.split(",");o.handles={};var insertionsDefault={handle:'position: \
absolute; display: none; overflow:hidden;',n:'top: 0pt; width:100%;',e:'right: 0pt; \
height:100%;',s:'bottom: 0pt; width:100%;',w:'left: 0pt; height:100%;',se:'bottom: \
0pt; right: 0px;',sw:'bottom: 0pt; left: 0px;',ne:'top: 0pt; right: 0px;',nw:'top: \
0pt; left: 0px;'};for(var i=0;i<n.length;i++){var \
handle=$.trim(n[i]),dt=o.defaultTheme,hname='ui-resizable-'+handle,loadDefault=!$.ui.c \
ss(hname)&&!o.knobHandles,userKnobClass=$.ui.css('ui-resizable-knob-handle'),allDefTheme=$.extend(dt[hname],dt['ui-resizable-handle']),allKnobTheme=$.extend(o.kno
  bTheme[hname],!userKnobClass?o.knobTheme['ui-resizable-handle']:{});var \
applyZIndex=/sw|se|ne|nw/.test(handle)?{zIndex:++o.zIndex}:{};var \
defCss=(loadDefault?insertionsDefault[handle]:''),axis=$(['<div \
class="ui-resizable-handle ',hname,'" \
style="',defCss,insertionsDefault.handle,'"></div>'].join('')).css(applyZIndex);o.hand \
les[handle]='.ui-resizable-'+handle;this.element.append(axis.css(loadDefault?allDefThe \
me:{}).css(o.knobHandles?allKnobTheme:{}).addClass(o.knobHandles?'ui-resizable-knob-handle':'').addClass(o.knobHandles));}
 +if(o.knobHandles)this.element.addClass('ui-resizable-knob').css(!$.ui.css('ui-resizable-knob')?{}:{});}
 +this._renderAxis=function(target){target=target||this.element;for(var i in \
o.handles){if(o.handles[i].constructor==String) \
+o.handles[i]=$(o.handles[i],this.element).show();if(o.transparent) \
+o.handles[i].css({opacity:0});if(this.element.is('.ui-wrapper')&&o._nodeName.match(/textarea|input|select|button/i)){var \
axis=$(o.handles[i],this.element),padWrapper=0;padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();var \
padPos=['padding',/ne|nw|n/.test(i)?'Top':/se|sw|s/.test(i)?'Bottom':/^e$/.test(i)?'Right':'Left'].join("");if(!o.transparent)
 +target.css(padPos,padWrapper);this._proportionallyResize();}
+if(!$(o.handles[i]).length)continue;}};this._renderAxis(this.element);o._handles=$('.ui-resizable-handle',self.element);if(o.disableSelection)
 +o._handles.each(function(i,e){$.ui.disableSelection(e);});o._handles.mouseover(function(){if(!o.resizing){if(this.className)
 +var axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);self.axis=o.axi \
s=axis&&axis[1]?axis[1]:'se';}});if(o.autohide){o._handles.hide();$(self.element).addC \
lass("ui-resizable-autohide").hover(function(){$(this).removeClass("ui-resizable-autoh \
ide");o._handles.show();},function(){if(!o.resizing){$(this).addClass("ui-resizable-autohide");o._handles.hide();}});}
 +this.mouseInit();},plugins:{},ui:function(){return{axis:this.options.axis,options:th \
is.options};},propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.ui()]);this.elem \
ent.triggerHandler(n=="resize"?n:["resize",n].join(""),[e,this.ui()],this.options[n]);},destroy:function(){var \
el=this.element,wrapped=el.children(".ui-resizable").get(0);this.mouseDestroy();var \
_destroy=function(exp){$(exp).removeClass("ui-resizable \
ui-resizable-disabled").removeData("resizable").unbind(".resizable").find('.ui-resizab \
le-handle').remove();};_destroy(el);if(el.is('.ui-wrapper')&&wrapped){el.parent().appe \
nd($(wrapped).css({position:el.css('position'),width:el.outerWidth(),height:el.outerHe \
ight(),top:el.css('top'),left:el.css('left')})).end().remove();_destroy(wrapped);}},mouseStart:function(e){if(this.options.disabled)return \
false;var handleúlse;for(var i in \
this.options.handles){if($(this.options.handles[i])[0]==e.target)handle=true;} \
+if(!handle)return false;var \
o=this.options,iniPos=this.element.position(),el=this.element,num=function(v){return \
parseInt(v,10)||0;},ie6=$.browser.msie&&$.browser.version<7;o.resizing=true;o.document \
Scroll={top:$(document).scrollTop(),left:$(document).scrollLeft()};if(el.is('.ui-draggable')||(/absolute/).test(el.css('position'))){var \
sOffset=$.browser.msie&&!o.containment&&(/absolute/).test(el.css('position'))&&!(/relative/).test(el.parent().css('position'));var \
dscrollt=sOffset?o.documentScroll.top:0,dscrolll=sOffset?o.documentScroll.left:0;el.css({position:'absolute',top:(iniPos.top+dscrollt),left:(iniPos.left+dscrolll)});}
 +if($.browser.opera&&/relative/.test(el.css('position')))
+el.css({position:'relative',top:'auto',left:'auto'});this._renderProxy();var \
curleft=num(this.helper.css('left')),curtop=num(this.helper.css('top'));this.offset=th \
is.helper.offset();this.position={left:curleft,top:curtop};this.size=o.proxy||ie6?{wid \
th:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this \
.originalSize=o.proxy||ie6?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.w \
idth(),height:el.height()};this.originalPosition={left:curleft,top:curtop};this.sizeDi \
ff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()};this.originalMousePosition={left:e.pageX,top:e.pageY};o.aspectRatio=(typeof \
o.aspectRatio=='number')?o.aspectRatio:((this.originalSize.height/this.originalSize.width)||1);if(o.preserveCursor)
 +$('body').css('cursor',this.axis+'-resize');this.propagate("start",e);return \
true;},mouseDrag:function(e){var \
el=this.helper,o=this.options,props={},self=this,smp=this.originalMousePosition,a=this.axis;var \
dx=(e.pageX-smp.left)||0,dy=(e.pageY-smp.top)||0;var \
trigger=this._change[a];if(!trigger)return false;var \
data=trigger.apply(this,[e,dx,dy]),ie6=$.browser.msie&&$.browser.version<7,csdif=this.sizeDiff;if(o._aspectRatio||e.shiftKey)
 +data=this._updateRatio(data,e);data=this._respectSize(data,e);this.propagate("resize \
",e);el.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!o.proxy&&o.proportionallyResize)
 +this._proportionallyResize();this._updateCache(data);return \
false;},mouseStop:function(e){this.options.resizingúlse;var \
o=this.options,num=function(v){return parseInt(v,10)||0;},self=this;if(o.proxy){var \
pr=o.proportionallyResize,ista=pr&&(/textarea/i).test(pr.get(0).nodeName),soffseth=ist \
a&&$.ui.hasScroll(pr.get(0),'left')?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var \
s={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt \
(self.element.css('left'),10)+(self.position.left-self.originalPosition.left))||null,t \
op=(parseInt(self.element.css('top'),10)+(self.position.top-self.originalPosition.top))||null;if(!o.animate)
 +this.element.css($.extend(s,{top:top,left:left}));if(o.proxy&&!o.animate)this._proportionallyResize();}
 +if(o.preserveCursor)
+$('body').css('cursor','auto');this.propagate("stop",e);if(o.proxy)this.helper.remove();return \
false;},_updateCache:function(data){var \
o=this.options;this.offset=this.helper.offset();if(data.left)this.position.leftÚta.lef \
t;if(data.top)this.position.topÚta.top;if(data.height)this.size.heightÚta.height;if(data.width)this.size.widthÚta.width;},_updateRatio:function(data,e){var \
o=this.options,cpos=this.position,csize=this.size,a=this.axis;if(data.height)data.width=(csize.height/o.aspectRatio);else \
if(data.width)data.height=(csize.width*o.aspectRatio);if(a=='sw'){data.left=cpos.left+(csize.width-data.width);data.top=null;}
 +if(a=='nw'){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(csize.width-data.width);}
 +return data;},_respectSize:function(data,e){var \
el=this.helper,o=this.options,pRatio=o._aspectRatio||e.shiftKey,a=this.axis,ismaxwÚta. \
width&&o.maxWidth&&o.maxWidth<data.width,ismaxhÚta.height&&o.maxHeight&&o.maxHeight<da \
ta.height,isminwÚta.width&&o.minWidth&&o.minWidth>data.width,isminhÚta.height&&o.minHe \
ight&&o.minHeight>data.height;if(isminw)data.width=o.minWidth;if(isminh)data.height=o.minHeight;if(ismaxw)data.width=o.maxWidth;if(ismaxh)data.height=o.maxHeight;var \
dw=this.originalPosition.left+this.originalSize.width,dh=this.position.top+this.size.height;var \
cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(isminw&&cw)data.left=dw-o.minWidth;if(ism \
axw&&cw)data.left=dw-o.maxWidth;if(isminh&&ch)data.top=dh-o.minHeight;if(ismaxh&&ch)data.top=dh-o.maxHeight;var \
isNotwh=!data.width&&!data.height;if(isNotwh&&!data.left&&data.top)data.top=null;else \
if(isNotwh&&!data.top&&data.left)data.left=null;return \
data;},_proportionallyResize:function(){var o=this.options;if(!o.proportio  \
nallyResize)return;var \
prel=o.proportionallyResize,el=this.helper||this.element;if(!o.borderDif){var \
b=[prel.css('borderTopWidth'),prel.css('borderRightWidth'),prel.css('borderBottomWidth \
'),prel.css('borderLeftWidth')],p=[prel.css('paddingTop'),prel.css('paddingRight'),pre \
l.css('paddingBottom'),prel.css('paddingLeft')];o.borderDif=$.map(b,function(v,i){var \
border=parseInt(v,10)||0,padding=parseInt(p[i],10)||0;return border+padding;});} \
+prel.css({height:(el.height()-o.borderDif[0]-o.borderDif[2])+"px",width:(el.width()-o.borderDif[1]-o.borderDif[3])+"px"});},_renderProxy:function(){var \
el=this.element,o=this.options;this.elementOffset=el.offset();if(o.proxy){this.helper=this.helper||$('<div \
style="overflow:hidden;"></div>');var \
ie6=$.browser.msie&&$.browser.version<7,ie6offset=(ie6?1:0),pxyoffset=(ie6?2:-1);this. \
helper.addClass(o.proxy).css({width:el.outerWidth()+pxyoffset,height:el.outerHeight()+ \
pxyoffset,position:'absolute',left:this.elementOffset.left-ie6offset+'px',top:this.ele \
mentOffset.top-ie6offset+'px',zIndex:++o.zIndex});this.helper.appendTo("body");if(o.disableSelection)
 +$.ui.disableSelection(this.helper.get(0));}else{this.helper=el;}},_change:{e:function(e,dx,dy){return{width:this.originalSize.width+dx};},w:function(e,dx,dy){var \
o=this.options,cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx};},n:function(e,dx,dy){var \
o=this.options,cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,heig \
ht:cs.height-dy};},s:function(e,dx,dy){return{height:this.originalSize.height+dy};},se:function(e,dx,dy){return \
$.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,dx,dy]));},sw:function(e,dx,dy){return \
$.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,dx,dy]));},ne:function(e,dx,dy){return \
$.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,dx,dy]));},nw:function(e,dx,dy){return \
$.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,dx,dy]));}}}));$.extend($.ui.resizable,{defaults:{cancel:":input,button",distance:0
  ,delay:0,preventDefault:true,transparent:false,minWidth:10,minHeight:10,aspectRatio: \
false,disableSelection:true,preserveCursor:true,autohide:false,knobHandles:false}});$.ui.plugin.add("resizable","containment",{start:function(e,ui){var \
o=ui.options,self=$(this).data("resizable"),el=self.element;var \
oc=o.containment,ce=(oc instanceof \
$)?oc.get(0):(/parent/.test(oc))?el.parent().get(0):oc;if(!ce)return;self.containerEle \
ment=$(ce);if(/document/.test(oc)||oc==document){self.containerOffset={left:0,top:0};s \
elf.containerPosition={left:0,top:0};self.parentData={element:$(document),left:0,top:0 \
,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight};}
 +else{self.containerOffset=$(ce).offset();self.containerPosition=$(ce).position();self.containerSize={height:$(ce).innerHeight(),width:$(ce).innerWidth()};var \
co=self.containerOffset,ch=self.containerSize.height,cw=self.containerSize.width,width \
=($.ui.hasScroll(ce,"left")?ce.scrollWidth:cw),height=($.ui.hasScroll(ce)?ce.scrollHei \
ght:ch);self.parentData={element:ce,left:co.left,top:co.top,width:width,height:height};}},resize:function(e,ui){var \
o=ui.options,self=$(this).data("resizable"),ps=self.containerSize,co=self.containerOff \
set,cs=self.size,cp=self.position,pRatio=o._aspectRatio||e.shiftKey,cop={top:0,left:0},ce=self.containerElement;if(/static/.test(ce.css('position')))
 +cop=self.containerPosition;if(cp.left<(o.proxy?co.left:cop.left)){self.size.width=se \
lf.size.width+(o.proxy?(self.position.left-co.left):(self.position.left-cop.left));if( \
pRatio)self.size.height=self.size.width*o.aspectRatio;self.position.left=o.proxy?co.left:cop.left;}
 +if(cp.top<(o.proxy?co.top:0)){self.size.height=self.size.height+(o.proxy?(self.posit \
ion.top-co.top):self.position.top);if(pRatio)self.size.width=self.size.height/o.aspectRatio;self.position.top=o.proxy?co.top:0;}
 +var woset=(o.proxy?self.offset.left-co.left:(self.position.left-cop.left))+self.size \
Diff.width,hoset=(o.proxy?self.offset.top-co.top:self.position.top)+self.sizeDiff.heig \
ht;if(woset+self.size.width>=self.parentData.width){self.size.width=self.parentData.width-woset;if(pRatio)self.size.height=self.size.width*o.aspectRatio;}
 +if(hoset+self.size.height>=self.parentData.height){self.size.height=self.parentData. \
height-hoset;if(pRatio)self.size.width=self.size.height/o.aspectRatio;}},stop:function(e,ui){var \
o=ui.options,self=$(this).data("resizable"),cp=self.position,co=self.containerOffset,cop=self.containerPosition,ce=self.containerElement;var \
helper=$(self.helper),ho=helper.offset(),w=helper.innerWidth(),h=helper.innerHeight();if(o.proxy&&!o.animate&&/relative/.test(ce.css('position')))
 +$(this).css({left:(ho.left-co.left),top:(ho.top-co.top),width:w,height:h});if(o.proxy&&!o.animate&&/static/.test(ce.css('position')))
 +$(this).css({left:cop.left+(ho.left-co.left),top:cop.top+(ho.top-co.top),width:w,height:h});}});$.ui.plugin.add("resizable","grid",{resize:function(e,ui){var \
o=ui.options,self=$(this).data("resizable"),cs=self.size,os=self.originalSize,op=self.originalPosition,a=self.axis,ratio=o._aspectRatio||e.shiftKey;o.grid=typeof \
o.grid=="number"?[o.grid,o.grid]:o.grid;var \
ox=Math.round((cs.width-os.width)/(o.grid[0]||1))*(o.grid[0]||1),oy=Math.round((cs.hei \
ght-os.height)/(o.grid[1]||1))*(o.grid[1]||1);if(/^(se|s|e)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;}
 +else if(/^(ne)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy;}
 +else if(/^(sw)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.left=op.left-ox;}
 +else{self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op. \
top-oy;self.position.left=op.left-ox;}}});$.ui.plugin.add("resizable","animate",{stop:function(e,ui){var \
o=ui.options,self=$(this).data("resizable");var \
pr=o.proportionallyResize,ista=pr&&(/textarea/i).test(pr.get(0).nodeName),soffseth=ist \
a&&$.ui.hasScroll(pr.get(0),'left')?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var \
style={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(pars \
eInt(self.element.css('left'),10)+(self.position.left-self.originalPosition.left))||nu \
ll,top=(parseInt(self.element.css('top'),10)+(self.position.top-self.originalPosition. \
top))||null;self.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{dur \
ation:o.animateDuration||"slow",easing:o.animateEasing||"swing",step:function(){var \
data={width:parseInt(self.element.css('width'),10),height:parseInt(self.element.css('height'),10),top:parseInt(self.element.css('top'),10),
  left:parseInt(self.element.css('left'),10)};if(pr)pr.css({width:data.width,height:da \
ta.height});self._updateCache(data);self.propagate("animate",e);}});}});$.ui.plugin.add("resizable","ghost",{start:function(e,ui){var \
o=ui.options,self=$(this).data("resizable"),pr=o.proportionallyResize,cs=self.size;if(!pr)self.ghost=self.element.clone();else \
self.ghost=pr.clone();self.ghost.css({opacity:.25,display:'block',position:'relative', \
height:cs.height,width:cs.width,margin:0,left:0,top:0}).addClass('ui-resizable-ghost').addClass(typeof \
o.ghost=='string'?o.ghost:'');self.ghost.appendTo(self.helper);},resize:function(e,ui){var \
o=ui.options,self=$(this).data("resizable"),pr=o.proportionallyResize;if(self.ghost)se \
lf.ghost.css({position:'relative',height:self.size.height,width:self.size.width});},stop:function(e,ui){var \
o=ui.options,self=$(this).data("resizable"),pr=o.proportionallyResize;if(self.ghost&&s \
elf.helper)self.helper.get(0).removeChild(self.ghost.get(0));}});$.ui.plugin.add("re  \
sizable","alsoResize",{start:function(e,ui){var \
o=ui.options,self=$(this).data("resizable"),_store=function(exp){$(exp).each(function( \
){$(this).data("resizable-alsoresize",{width:parseInt($(this).width(),10),height:parse \
Int($(this).height(),10),left:parseInt($(this).css('left'),10),top:parseInt($(this).cs \
s('top'),10)});});};if(typeof(o.alsoResize)=='object'){$.each(o.alsoResize,function(exp,c){_store(exp);});}else{_store(o.alsoResize);}},resize:function(e,ui){var \
o=ui.options,self=$(this).data("resizable"),os=self.originalSize,op=self.originalPosition;var \
delta={height:(self.size.height-os.height)||0,width:(self.size.width-os.width)||0,top: \
(self.position.top-op.top)||0,left:(self.position.left-op.left)||0},_alsoResize=function(exp,c){$(exp).each(function(){var \
start=$(this).data("resizable-alsoresize"),style={},css=c&&c.length?c:['width','height','top','left'];$.each(css||['width','height','top','left'],function(i,prop){var \
sum=(start[prop]||0)+(delta[prop]||0);if(sum&&sum> 0) \
+style[prop]=sum||null;});$(this).css(style);});};if(typeof(o.alsoResize)=='object'){$ \
.each(o.alsoResize,function(exp,c){_alsoResize(exp,c);});}else{_alsoResize(o.alsoResiz \
e);}},stop:function(e,ui){$(this).removeData("resizable-alsoresize-start");}});})(jQue \
ry);(function($){$.widget("ui.selectable",$.extend($.ui.mouse,{init:function(){var \
self=this;this.element.addClass("ui-selectable");this.draggedúlse;var \
selectees;this.refresh=function(){selectees=$(self.options.filter,self.element[0]);selectees.each(function(){var \
$this=$(this);var pos=$this.offset();$.data(this,"selectable-item",{element:this,$elem \
ent:$this,left:pos.left,top:pos.top,right:pos.left+$this.width(),bottom:pos.top+$this. \
height(),startselected:false,selected:$this.hasClass('ui-selected'),selecting:$this.ha \
sClass('ui-selecting'),unselecting:$this.hasClass('ui-unselecting')});});};this.refres \
h();this.selectees=selectees.addClass("ui-selectee");this.mouseInit();this.helper=$(document.createElement('div')).css({
  border:'1px dotted \
black'});},toggle:function(){if(this.options.disabled){this.enable();}else{this.disable();}},destroy:function(){this.element.removeClass("ui-selectable \
ui-selectable-disabled").removeData("selectable").unbind(".selectable");this.mouseDestroy();},mouseStart:function(e){var \
self=this;this.opos=[e.pageX,e.pageY];if(this.options.disabled) +return;var \
options=this.options;this.selectees=$(options.filter,this.element[0]);this.element.tri \
ggerHandler("selectablestart",[e,{"selectable":this.element[0],"options":options}],opt \
ions.start);$('body').append(this.helper);this.helper.css({"z-index":100,"position":"a \
bsolute","left":e.clientX,"top":e.clientY,"width":0,"height":0});if(options.autoRefresh){this.refresh();}
 +this.selectees.filter('.ui-selected').each(function(){var \
selectee=$.data(this,"selectable-item");selectee.startselected=true;if(!e.ctrlKey){sel \
ectee.$element.removeClass('ui-selected');selectee.selectedúlse;selectee.$element.addC \
lass('ui-unselecting');selectee.unselecting=true;self.element.triggerHandler("selectab \
leunselecting",[e,{selectable:self.element[0],unselecting:selectee.element,options:options}],options.unselecting);}});var \
isSelecteeúlse;$(e.target).parents().andSelf().each(function(){if($.data(this,"selectable-item"))isSelectee=true;});return \
this.options.keyboard?!isSelectee:true;},mouseDrag:function(e){var \
self=this;this.dragged=true;if(this.options.disabled) +return;var \
options=this.options;var \
x1=this.opos[0],y1=this.opos[1],x2=e.pageX,y2=e.pageY;if(x1>x2){var \
tmp=x2;x2=x1;x1=tmp;} +if(y1>y2){var tmp=y2;y2=y1;y1=tmp;}
+this.helper.css({left:x1,top:y1,width:x2-x1,height:y2-y1});this.selectees.each(function(){var \
selectee=$.data(this,"selectable-item");if(!selectee||selectee.element==self.element[0])
 +return;var hitúlse;if(options.tolerance=='touch'){hit=(!(selectee.left>x2||selectee.right<x1||selectee.top>y2||selectee.bottom<y1));}else \
if(options.tolerance=='fit'){hit=(selectee.left>x1&&selectee.right<x2&&selectee.top>y1&&selectee.bottom<y2);}
 +if(hit){if(selectee.selected){selectee.$element.removeClass('ui-selected');selectee.selectedúlse;}
 +if(selectee.unselecting){selectee.$element.removeClass('ui-unselecting');selectee.unselectingúlse;}
 +if(!selectee.selecting){selectee.$element.addClass('ui-selecting');selectee.selectin \
g=true;self.element.triggerHandler("selectableselecting",[e,{selectable:self.element[0 \
],selecting:selectee.element,options:options}],options.selecting);}}else{if(selectee.s \
electing){if(e.ctrlKey&&selectee.startselected){selectee.$element.removeClass('ui-sele \
cting');selectee.selectingúlse;selectee.$element.addClass('ui-selected');selectee.sele \
cted=true;}else{selectee.$element.removeClass('ui-selecting');selectee.selectingúlse;i \
f(selectee.startselected){selectee.$element.addClass('ui-unselecting');selectee.unselecting=true;}
 +self.element.triggerHandler("selectableunselecting",[e,{selectable:self.element[0],unselecting:selectee.element,options:options}],options.unselecting);}}
 +if(selectee.selected){if(!e.ctrlKey&&!selectee.startselected){selectee.$element.remo \
veClass('ui-selected');selectee.selectedúlse;selectee.$element.addClass('ui-unselectin \
g');selectee.unselecting=true;self.element.triggerHandler("selectableunselecting",[e,{ \
selectable:self.element[0],unselecting:selectee.element,options:options}],options.unselecting);}}}});return \
false;},mouseStop:function(e){var self=this;this.draggedúlse;var \
options=this.options;$('.ui-unselecting',this.element[0]).each(function(){var \
selectee=$.data(this,"selectable-item");selectee.$element.removeClass('ui-unselecting' \
);selectee.unselectingúlse;selectee.startselectedúlse;self.element.triggerHandler("sel \
ectableunselected",[e,{selectable:self.element[0],unselected:selectee.element,options: \
options}],options.unselected);});$('.ui-selecting',this.element[0]).each(function(){var \
selectee=$.data(this,"selectable-item");selectee.$element.removeClass('ui-selecting').addClass('ui-selected');selectee.selecting
  úlse;selectee.selected=true;selectee.startselected=true;self.element.triggerHandler( \
"selectableselected",[e,{selectable:self.element[0],selected:selectee.element,options: \
options}],options.selected);});this.element.triggerHandler("selectablestop",[e,{select \
able:self.element[0],options:this.options}],this.options.stop);this.helper.remove();return \
false;}}));$.extend($.ui.selectable,{defaults:{distance:0,delay:0,cancel:":input,butto \
n",appendTo:'body',autoRefresh:true,filter:'*',tolerance:'touch'}});})(jQuery);(function($){function \
contains(a,b){var safari2=$.browser.safari&&$.browser.version<522;if(a.contains&&!safari2){return \
a.contains(b);} +if(a.compareDocumentPosition)
+return!!(a.compareDocumentPosition(b)&16);while(b=b.parentNode)
+if(b==a)return true;return \
false;};$.widget("ui.sortable",$.extend($.ui.mouse,{init:function(){var \
o=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refres \
h();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css('float' \
)):false;if(!(/(relative|absolute|fixed)/).test(this.element.css('position')))this.ele \
ment.css('position','relative');this.offset=this.element.offset();this.mouseInit();},p \
lugins:{},ui:function(inst){return{helper:(inst||this)["helper"],placeholder:(inst||th \
is)["placeholder"]||$([]),position:(inst||this)["position"],absolutePosition:(inst||th \
is)["positionAbs"],options:this.options,element:this.element,item:(inst||this)["curren \
tItem"],sender:inst?inst.element:null};},propagate:function(n,e,inst,noPropagation){$. \
ui.plugin.call(this,n,[e,this.ui(inst)]);if(!noPropagation)this.element.triggerHandler \
(n=="sort"?n:"sort"+n,[e,this.ui(inst)],this.options[n]);},serialize:function(o){var \
items=($.isFunction(this.option  \
s.items)?this.options.items.call(this.element):$(this.options.items,this.element)).not('.ui-sortable-helper');var \
str=[];o=o||{};items.each(function(){var \
res=($(this).attr(o.attribute||'id')||'').match(o.expression||(/(.+)[-=_](.+)/));if(res)str.push((o.key||res[1])+'[]='+(o.key?res[1]:res[2]));});return \
str.join('&');},toArray:function(attr){var \
items=($.isFunction(this.options.items)?this.options.items.call(this.element):$(this.options.items,this.element)).not('.ui-sortable-helper');var \
ret=[];items.each(function(){ret.push($(this).attr(attr||'id'));});return \
ret;},intersectsWith:function(item){var \
x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height;var \
l=item.left,r=l+item.width,t=item.top,b=t+item.height;if(this.options.tolerance=="poin \
ter"||(this.options.tolerance=="guess"&&this.helperProportions[this.floating?'width':' \
height']>item[this.floating?'width':'height'])){return(y1+this.offset.click.top>t&&y  \
1+this.offset.click.top<b&&x1+this.offset.click.left>l&&x1+this.offset.click.left<r);} \
else{return(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/2) \
<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b);}},intersectsWithEdge:function(item){var \
x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height;var \
l=item.left,r=l+item.width,t=item.top,b=t+item.height;if(this.options.tolerance=="poin \
ter"||(this.options.tolerance=="guess"&&this.helperProportions[this.floating?'width':' \
height']>item[this.floating?'width':'height'])){if(!(y1+this.offset.click.top>t&&y1+th \
is.offset.click.top<b&&x1+this.offset.click.left>l&&x1+this.offset.click.left<r))return \
false;if(this.floating){if(x1+this.offset.click.left>l&&x1+this.offset.click.left<l+item.width/2)return \
2;if(x1+this.offset.click.left>l+item.width/2&&x1+this.offset.click.left<r)return \
1;}else{if(y1+this.offset.click.top>  \
t&&y1+this.offset.click.top<t+item.height/2)return \
2;if(y1+this.offset.click.top>t+item.height/2&&y1+this.offset.click.top<b)return \
1;}}else{if(!(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/ \
2)<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b))return \
false;if(this.floating){if(x2>l&&x1<l)return 2;if(x1<r&&x2>r)return \
1;}else{if(y2>t&&y1<t)return 1;if(y1<b&&y2>b)return 2;}} +return \
false;},refresh:function(){this.refreshItems();this.refreshPositions();},refreshItems:function(){this.items=[];this.containers=[this];var \
items=this.items;var \
queries=[$.isFunction(this.options.items)?this.options.items.call(this.element):$(this.options.items,this.element)];if(this.options.connectWith){for(var \
i=this.options.connectWith.length-1;i>=0;i--){var \
cur=$(this.options.connectWith[i]);for(var j=cur.length-1;j>=0;j--){var \
inst=$.data(cur[j],'sortable');if(inst&&!inst.options.disabled){queries.push($.isFunct \
ion(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element));this.containers.push(inst);}};};}
 +for(var i=queries.length-1;i>=0;i--){queries[i].each(function(){$.data(this,'sortabl \
e-item',true);items.push({item:$(this),width:0,height:0,left:0,top:0});});};},refreshPositions:function(fast){for(var \
i=this.items.length-1;i>=0;i--){var \
t=this.items[i].item;if(!fast)this.items[i].width=(this.options.toleranceElement?$(thi \
s.options.toleranceElement,t):t).outerWidth();if(!fast)this.items[i].height=(this.options.toleranceElement?$(this.options.toleranceElement,t):t).outerHeight();var \
p=(this.options.toleranceElement?$(this.options.toleranceElement,t):t).offset();this.items[i].left=p.left;this.items[i].top=p.top;};for(var \
i=this.containers.length-1;i>=0;i--){var \
p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;th \
is.containers[i].containerCache.top=p.top;this.containers[i].containerCache.width=this \
.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight();};},destroy:function(){this.ele
  ment.removeClass("ui-sortable \
ui-sortable-disabled").removeData("sortable").unbind(".sortable");this.mouseDestroy();for(var \
i=this.items.length-1;i>=0;i--) \
+this.items[i].item.removeData("sortable-item");},createPlaceholder:function(that){var \
self=that||this,o=self.options;if(o.placeholder.constructor==String){var \
className=o.placeholder;o.placeholder={element:function(){return \
$('<div></div>').addClass(className)[0];},update:function(i,p){p.css(i.offset()).css({width:i.outerWidth(),height:i.outerHeight()});}};}
 +self.placeholder=$(o.placeholder.element.call(self.element,self.currentItem)).append \
To('body').css({position:'absolute'});o.placeholder.update.call(self.element,self.currentItem,self.placeholder);},contactContainers:function(e){for(var \
i=this.containers.length-1;i>=0;i--){if(this.intersectsWith(this.containers[i].contain \
erCache)){if(!this.containers[i].containerCache.over){if(this.currentContainer!=this.containers[i]){var \
dist000;var itemWithLeastDistance=null;var \
base=this.positionAbs[this.containers[i].floating?'left':'top'];for(var \
j=this.items.length-1;j>=0;j--){if(!contains(this.containers[i].element[0],this.items[j].item[0]))continue;var \
cur=this.items[j][this.containers[i].floating?'left':'top'];if(Math.abs(cur-base)<dist){dist=Math.abs(cur-base);itemWithLeastDistance=this.items[j];}}
 +if(!itemWithLeastDistance&&!this.options.dropOnEmpty)
+continue;if(this.placeholder)this.placeholder.remove();if(this.containers[i].options. \
placeholder){this.containers[i].createPlaceholder(this);}else{this.placeholder=null;;}
 +itemWithLeastDistance?this.rearrange(e,itemWithLeastDistance):this.rearrange(e,null, \
this.containers[i].element);this.propagate("change",e);this.containers[i].propagate("change",e,this);this.currentContainer=this.containers[i];}
 +this.containers[i].propagate("over",e,this);this.containers[i].containerCache.over=1 \
;}}else{if(this.containers[i].containerCache.over){this.containers[i].propagate("out", \
e,this);this.containers[i].containerCache.over=0;}}};},mouseCapture:function(e,overrideHandle){if(this.options.disabled||this.options.type=='static')return \
false;var currentItem=null,nodes=$(e.target).parents().each(function(){if($.data(this,'sortable-item')){currentItem=$(this);return \
false;}});if($.data(e.target,'sortable-item'))currentItem=$(e.target);if(!currentItem)return \
false;if(this.options.handle&&!overrideHandle){var \
validHandleúlse;$(this.options.handle,currentItem).find("*").andSelf().each(function(){if(this==e.target)validHandle=true;});if(!validHandle)return \
false;} +this.currentItem=currentItem;return \
true;},mouseStart:function(e,overrideHandle,noActivation){var \
o=this.options;this.currentContainer=this;this.refresh();this.helper=typeof \
o.helper=='function'?$(o.helper.apply(this.element[0],[e,this.currentItem])):this.curr \
entItem.clone();if(!this.helper.parents('body').length)this.helper.appendTo((o.appendT \
o!='parent'?o.appendTo:this.currentItem[0].parentNode));this.helper.css({position:'abs \
olute',clear:'both'}).addClass('ui-sortable-helper');this.margins={left:(parseInt(this \
.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop") \
,10)||0)};this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this. \
margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:e.pageX-t \
his.offset.left,top:e.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var \
po=this.offsetParent.offset();this.offset.parent={top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),
  left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};this.origin \
alPosition=this.generatePosition(e);this.helperProportions={width:this.helper.outerWid \
th(),height:this.helper.outerHeight()};if(o.cursorAt){if(o.cursorAt.left!=undefined)th \
is.offset.click.left=o.cursorAt.left;if(o.cursorAt.right!=undefined)this.offset.click. \
left=this.helperProportions.width-o.cursorAt.right;if(o.cursorAt.top!=undefined)this.o \
ffset.click.top=o.cursorAt.top;if(o.cursorAt.bottom!=undefined)this.offset.click.top=this.helperProportions.height-o.cursorAt.bottom;}
 +this.domPosition=this.currentItem.prev()[0];if(o.containment){if(o.containment=='par \
ent')o.containment=this.helper[0].parentNode;if(o.containment=='document'||o.containme \
nt=='window')this.containment=[0-this.offset.parent.left,0-this.offset.parent.top,$(o. \
containment=='document'?document:window).width()-this.offset.parent.left-this.helperPr \
oportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),($ \
(o.containment=='document'?document:window).height()||document.body.parentNode.scrollH \
eight)-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt \
(this.element.css("marginBottom"),10)||0)];if(!(/^(document|window|parent)$/).test(o.containment)){var \
ce=$(o.containment)[0];var \
co=$(o.containment).offset();this.containment=[co.left+(parseInt($(ce).css("borderLeft \
Width"),10)||0)-this.offset.parent.left,co.top+(parseInt($(ce).css("borderTopWidth"),1 \
0)||0)-this.offset.parent.top,co.left+Math.max(ce.scrollWidth,ce.offsetWidth)-(parseInt
  ($(ce).css("borderLeftWidth"),10)||0)-this.offset.parent.left-this.helperProportions \
.width-this.margins.left-(parseInt(this.currentItem.css("marginRight"),10)||0),co.top+ \
Math.max(ce.scrollHeight,ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0 \
)-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.currentItem.css("marginBottom"),10)||0)];}}
 +if(o.placeholder)this.createPlaceholder();this.propagate("start",e);this.helperPropo \
rtions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(this.optio \
ns.placeholder!='clone')this.currentItem.css('visibility','hidden');if(!noActivation){for(var \
i=this.containers.length-1;i>=0;i--){this.containers[i].propagate("activate",e,this);}}
 +if($.ui.ddmanager)$.ui.ddmanager.current=this;if($.ui.ddmanager&&!o.dropBehaviour)$.ui.ddmanager.prepareOffsets(this,e);this.dragging=true;this.mouseDrag(e);return \
true;},convertPositionTo:function(d,pos){if(!pos)pos=this.position;var \
mod=d=="absolute"?1:-1;return{top:(pos.top ++this.offset.parent.top*mod
+-(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)*mod
++this.margins.top*mod),left:(pos.left
++this.offset.parent.left*mod
+-(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)*mod
++this.margins.left*mod)};},generatePosition:function(e){var o=this.options;var \
position={top:(e.pageY +-this.offset.click.top
+-this.offset.parent.top
++(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)),left:(e.pageX
 +-this.offset.click.left
+-this.offset.parent.left
++(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft))};if(!this.originalPosition)return \
position;if(this.containment){if(position.left<this.containment[0])position.left=this. \
containment[0];if(position.top<this.containment[1])position.top=this.containment[1];if \
(position.left>this.containment[2])position.left=this.containment[2];if(position.top>this.containment[3])position.top=this.containment[3];}
 +if(o.grid){var top=this.originalPosition.top+Math.round((position.top-this.originalP \
osition.top)/o.grid[1])*o.grid[1];position.top=this.containment?(!(top<this.containmen \
t[1]||top>this.containment[3])?top:(!(top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var \
left=this.originalPosition.left+Math.round((position.left-this.originalPosition.left)/ \
o.grid[0])*o.grid[0];position.left=this.containment?(!(left<this.containment[0]||left> \
this.containment[2])?left:(!(left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}
 +return position;},mouseDrag:function(e){this.position=this.generatePosition(e);this.positionAbs=this.convertPositionTo("absolute");for(var \
i=this.items.length-1;i>=0;i--){var \
intersection=this.intersectsWithEdge(this.items[i]);if(!intersection)continue;if(this. \
items[i].item[0]!=this.currentItem[0]&&this.currentItem[intersection==1?"next":"prev"] \
()[0]!=this.items[i].item[0]&&!contains(this.currentItem[0],this.items[i].item[0])&&(t \
his.options.type=='semi-dynamic'?!contains(this.element[0],this.items[i].item[0]):true \
)){this.direction=intersection==1?"down":"up";this.rearrange(e,this.items[i]);this.propagate("change",e);break;}}
 +this.contactContainers(e);this.propagate("sort",e);if(!this.options.axis||this.optio \
ns.axis=="x")this.helper[0].style.left=this.position.left+'px';if(!this.options.axis|| \
this.options.axis=="y")this.helper[0].style.top=this.position.top+'px';if($.ui.ddmanager)$.ui.ddmanager.drag(this,e);return \
false;},mouseStop:function(e,noPropagation){if($.ui.ddmanager&&!this.options.dropBehaviour)
 +$.ui.ddmanager.drop(this,e);if(this.options.revert){var self=this;var \
cur=self.currentItem.offset();if(self.placeholder)self.placeholder.animate({opacity:'h \
ide'},(parseInt(this.options.revert,10)||500)-50);$(this.helper).animate({left:cur.lef \
t-this.offset.parent.left-self.margins.left+(this.offsetParent[0]==document.body?0:thi \
s.offsetParent[0].scrollLeft),top:cur.top-this.offset.parent.top-self.margins.top+(thi \
s.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.opti \
ons.revert,10)||500,function(){self.propagate("stop",e,null,noPropagation);self.clear( \
e);});}else{this.propagate("stop",e,null,noPropagation);this.clear(e,noPropagation);} \
+return false;},clear:function(e,noPropagation){if(this.domPosition!=this.currentItem. \
prev().not(".ui-sortable-helper")[0])this.propagate("update",e,null,noPropagation);if( \
!contains(this.element[0],this.currentItem[0])){if(this.domPosition==this.currentItem. \
prev().not(".ui-sortable-helper")[0])this.propagate("update",e,null,noPropagation);this.propagate("remove",e,null,noPropagation);for(var \
i=this.containers.length-1;i>=0;i--){if(contains(this.containers[i].element[0],this.cu \
rrentItem[0])){this.containers[i].propagate("update",e,this,noPropagation);this.containers[i].propagate("receive",e,this,noPropagation);}};};for(var \
i=this.containers.length-1;i>=0;i--){this.containers[i].propagate("deactivate",e,this, \
noPropagation);if(this.containers[i].containerCache.over){this.containers[i].propagate("out",e,this);this.containers[i].containerCache.over=0;}}
 +this.draggingúlse;if(this.cancelHelperRemoval)return \
false;$(this.currentItem).css('visibility','');if(this.placeholder)this.placeholder.remove();this.helper.remove();return \
true;},rearrange:function(e,i,a){a?a.append(this.currentItem):i.item[this.direction==' \
down'?'before':'after'](this.currentItem);this.refreshPositions(true);if(this.options. \
placeholder)this.options.placeholder.update.call(this.element,this.currentItem,this.placeholder);}}));$.extend($.ui.sortable,{getter:"serialize \
toArray",defaults:{tolerance:"guess",distance:0,delay:0,cancel:":input,button",items:'> \
*',zIndex:1000,dropOnEmpty:true,appendTo:"parent"}});$.ui.plugin.add("sortable","cursor",{start:function(e,ui){var \
t=$('body');if(t.css("cursor"))ui.options._cursor=t.css("cursor");t.css("cursor",ui.op \
tions.cursor);},stop:function(e,ui){if(ui.options._cursor)$('body').css("cursor",ui.options._cursor);}});$.ui.plugin.add("sortable","zIndex",{start:function(e,ui){var \
                t=ui.helper;if(t.css("zIndex"))ui.options
 ._zIndex=t.css("zIndex");t.css('zIndex',ui.options.zIndex);},stop:function(e,ui){if(u \
i.options._zIndex)$(ui.helper).css('zIndex',ui.options._zIndex);}});$.ui.plugin.add("sortable","opacity",{start:function(e,ui){var \
t=ui.helper;if(t.css("opacity"))ui.options._opacity=t.css("opacity");t.css('opacity',u \
i.options.opacity);},stop:function(e,ui){if(ui.options._opacity)$(ui.helper).css('opac \
ity',ui.options._opacity);}});$.ui.plugin.add("sortable","scroll",{start:function(e,ui){var \
o=ui.options;var i=$(this).data("sortable");o.scrollSensitivity=o.scrollSensitivity||2 \
0;o.scrollSpeed=o.scrollSpeed||20;i.overflowY=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-y')))return \
el;el=el.parent();}while(el[0].parentNode);return \
$(document);}(i.currentItem);i.overflowX=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-x')))return \
el;el=el.parent();}while(el[0].parentNode);return $(document);}(i.cu  \
rrentItem);if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML')i.overflowYOffs \
et=i.overflowY.offset();if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML')i.overflowXOffset=i.overflowX.offset();},sort:function(e,ui){var \
o=ui.options;var i=$(this).data("sortable");if(i.overflowY[0]!=document&&i.overflowY[0 \
].tagName!='HTML'){if((i.overflowYOffset.top+i.overflowY[0].offsetHeight)-e.pageY<o.scrollSensitivity)
 +i.overflowY[0].scrollTop=i.overflowY[0].scrollTop+o.scrollSpeed;if(e.pageY-i.overflowYOffset.top<o.scrollSensitivity)
 +i.overflowY[0].scrollTop=i.overflowY[0].scrollTop-o.scrollSpeed;}else{if(e.pageY-$(document).scrollTop()<o.scrollSensitivity)
 +$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);if($(window).height()-(e.pageY-$(document).scrollTop())<o.scrollSensitivity)
 +$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}
+if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML'){if((i.overflowXOffset.left+i.overflowX[0].offsetWidth)-e.pageX<o.scrollSensitivity)
 +i.overflowX[0].scrollLeft=i.overflowX[0].scrollLeft+o.scrollSpeed;if(e.pageX-i.overflowXOffset.left<o.scrollSensitivity)
 +i.overflowX[0].scrollLeft=i.overflowX[0].scrollLeft-o.scrollSpeed;}else{if(e.pageX-$(document).scrollLeft()<o.scrollSensitivity)
 +$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);if($(window).width()-(e.pageX-$(document).scrollLeft())<o.scrollSensitivity)
 +$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}});})(jQuery);
\ No newline at end of file

Copied: branches/testbaudson_dev/ext/jquery.ajaxmanager.js (from rev 2556, \
trunk/mapbender/http/extensions/jquery.ajaxmanager.js) \
==================================================================--- \
                branches/testbaudson_dev/ext/jquery.ajaxmanager.js	                   \
                (rev 0)
+++ branches/testbaudson_dev/ext/jquery.ajaxmanager.js	2008-06-30 14:13:03 UTC (rev \
2566) @@ -0,0 +1,165 @@
+/**
+ * @author Administrator
+ */
+(function($) {
+    $.extend({
+        manageAjax: function(o){
+          o = $.extend({manageType: 'normal',maxReq: 0, blockSameRequest: false},o);
+          return new $.ajaxManager(o);
+        },
+        ajaxManager: function(o){
+            this.opt = o;
+            this.queue = [];
+        }
+	});
+    $.extend(
+        $.ajaxManager.prototype,
+        {
+            add: function(o){
+                 var quLen = this.queue.length, s = this.opt, q = this.queue, self = \
this,i,j; +                 var cD = (o.data && typeof o.data != \
"string")?$.param(o.data):o.data; +                 if(s.blockSameRequest){
+                    var toPrevent = false;
+                    for (var i = 0;i<quLen; i++){
+                        if(q[i] && q[i].data === cD && q[i].url === o.url && \
q[i].type === o.type) { +                            toPrevent = true;
+                            break;
+                        }
+                    }
+                    if(toPrevent)
+                        return false;
+                 }
+                 q[ quLen ] = {
+            		fnError: o.error,
+            		fnSuccess: o.success,
+            		fnComplete: o.complete,
+                    fnAbort: o.abort,
+            		error: [],
+            		success: [],
+            		complete: [],
+            		done: false,
+            		queued: false,
+                    data: cD,
+                    url: o.url,
+                    type: o.type,
+                    xhr: null
+            	};
+
+                o.error = function(){if(q[ quLen ]) q[ quLen ].error = arguments; };
+            	o.success = function(){if(q[ quLen ]) q[ quLen ].success = arguments; \
}; +                o.abort = function(){if(q[ quLen ]) q[ quLen ].abort = arguments; \
}; +                function startCallbacks(num){
+                    if ( q[ num ].fnError ) q[ num ].fnError.apply( $, q[ num \
].error ); +        			if ( q[ num ].fnSuccess ) q[ num ].fnSuccess.apply( $, q[ num \
].success ); +        			if ( q[ num ].fnComplete ) q[ num ].fnComplete.apply( $, q[ \
num ].complete ); +        			self.abort(num,true);
+                }
+
+            	o.complete = function(){
+            		if(!q[ quLen ])
+                        return;
+                    q[ quLen ].complete = arguments;
+            		q[ quLen ].done = true;
+                    switch (s.manageType) {
+                      case 'sync':
+                        if (quLen === 0 || !q[ quLen-1 ]){
+                            var curQLen = q.length;
+                			for ( i = quLen; i < curQLen; i++ ) {
+                                if(q[i]){
+                                    if(q[i].done)
+                                        startCallbacks(i)
+                                    else
+                                        break;
+                                }
+
+                			}
+                        }
+                        break;
+                        case 'queue':
+                        if (quLen === 0 || !q[ quLen-1 ]){
+                            var curQLen = q.length;
+                			for ( i = 0, j = 0; i < curQLen; i++ ) {
+                                if(q[i] && q[i].queued){
+                                    q[i].xhr = jQuery.ajax(q[i].xhr);
+                                    q[i].queued = false;
+                                    break;
+                                }
+                			}
+                        }
+                        startCallbacks(quLen);
+                        break;
+                      case 'abortOld':
+                        startCallbacks(quLen);
+                        for ( i = quLen; i >= 0; i-- ) {
+                            if(q[i]){
+                                self.abort(i);
+                            }
+            			}
+                        break;
+                      default:
+                        startCallbacks(quLen);
+                        break;
+                    }
+            	};
+
+                if(s.maxReq){
+                    if(s.manageType != 'queue') {
+                        for (i = quLen, j = 0; i >= 0; i--) {
+            				if(j >= s.maxReq)
+                                this.abort(i);
+                            if(q[i]){
+                                j++;
+                            }
+            			}
+                    } else {
+                        for (i = 0, j = 0; i <= quLen && !q[quLen].queued; i++) {
+                            if(q[i] && !q[i].queued)
+                                j++;
+                            if(j > s.maxReq)
+                                q[quLen].queued = true;
+            			}
+                    }
+                }
+                q[ quLen ].xhr = (q[quLen].queued)?o:jQuery.ajax(o);
+                return quLen;
+            },
+            cleanUp: function(){
+               this.queue = [];
+            },
+            abort: function(num,completed){
+               var qLen = this.queue.length, s = this.opt, q = this.queue, self = \
this,i; +               function del(num){
+                   if(!q[num])
+                       return;
+                   (!completed && q[num].fnAbort) && q[num].fnAbort.apply($,[num]);
+                   if(!q[num])
+                       return;
+                   if(q[num].xhr){
+                      if (typeof q[num].xhr.abort != 'undefined')
+                          q[num].xhr.abort();
+                      if (typeof q[num].xhr.close != 'undefined')
+                          q[num].xhr.close();
+                      q[num].xhr = null;
+                   }
+                    q[num] = null;
+               }
+               if(!num && num !== 0){
+                   for (i = 0; i < qLen; i++){
+                       del(i);
+                   }
+                   this.cleanUp();
+               } else {
+                   del(num);
+                   var allowCleaning = true;
+                   for (i = qLen; i >= 0; i--){
+                       if(q[i]){
+                            allowCleaning = false;
+                            break;
+                       }
+                   }
+                   if (allowCleaning) this.cleanUp();
+               }
+            }
+        }
+	);
+})(jQuery);
\ No newline at end of file

Copied: branches/testbaudson_dev/ext/jquery.mousewheel.min.js (from rev 2556, \
trunk/mapbender/http/extensions/jquery.mousewheel.min.js) \
==================================================================--- \
                branches/testbaudson_dev/ext/jquery.mousewheel.min.js	                \
                (rev 0)
+++ branches/testbaudson_dev/ext/jquery.mousewheel.min.js	2008-06-30 14:13:03 UTC \
(rev 2566) @@ -0,0 +1,16 @@
+/* Copyright (c) 2006 Brandon Aaron (brandon.aaron@gmail.com || \
http://brandonaaron.net) + * Dual licensed under the MIT \
(http://www.opensource.org/licenses/mit-license.php) + * and GPL \
(http://www.opensource.org/licenses/gpl-license.php) licenses. + * Thanks to: \
http://adomas.org/javascript-mouse-wheel/ for some pointers. + * Thanks to: Mathias \
Bank(http://www.mathias-bank.de) for a scope bug fix. + *
+ * $LastChangedDate: 2007-12-14 23:57:10 -0600 (Fri, 14 Dec 2007) $
+ * $Rev: 4163 $
+ *
+ * Version: 3.0
+ *
+ * Requires: $ 1.2.2+
+ */
+(function($){$.event.special.mousewheel={setup:function(){var \
handler=$.event.special.mousewheel.handler;if($.browser.mozilla)$(this).bind('mousemov \
e.mousewheel',function(event){$.data(this,'mwcursorposdata',{pageX:event.pageX,pageY:e \
vent.pageY,clientX:event.clientX,clientY:event.clientY});});if(this.addEventListener)t \
his.addEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);else
 +this.onmousewheel=handler;},teardown:function(){var \
handler=$.event.special.mousewheel.handler;$(this).unbind('mousemove.mousewheel');if(t \
his.removeEventListener)this.removeEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);else
 +this.onmousewheel=function(){};$.removeData(this,'mwcursorposdata');},handler:function(event){var \
args=Array.prototype.slice.call(arguments,1);event=$.event.fix(event||window.event);$.extend(event,$.data(this,'mwcursorposdata')||{});var \
delta=0,returnValue=true;if(event.wheelDelta)delta=event.wheelDelta/120;if(event.detai \
l)delta=-event.detail/3;if($.browser.opera)delta=-event.wheelDelta;event.data=event.data||{};event.type="mousewheel";args.unshift(delta);args.unshift(event);return \
$.event.handle.apply(this,args);}};$.fn.extend({mousewheel:function(fn){return \
fn?this.bind("mousewheel",fn):this.trigger("mousewheel");},unmousewheel:function(fn){return \
this.unbind("mousewheel",fn);}});})(jQuery); \ No newline at end of file

Copied: branches/testbaudson_dev/ext/phpmailer-1.72 (from rev 2556, \
trunk/mapbender/http/classes/phpmailer-1.72)

Modified: branches/testbaudson_dev/http/classes/class_administration.php
==================================================================--- \
trunk/mapbender/http/classes/class_administration.php	2008-06-24 12:33:05 UTC (rev \
                2556)
+++ branches/testbaudson_dev/http/classes/class_administration.php	2008-06-30 \
14:13:03 UTC (rev 2566) @@ -1,1119 +1,3 @@
 <?php
-# $Id$
-# http://www.mapbender.org/index.php/class_administration
-# Copyright (C) 2002 CCGIS
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-require_once(dirname(__FILE__)."/class_mb_exception.php");
-require_once(dirname(__FILE__)."/class_user.php");
-
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
-
-require(dirname(__FILE__) . "/phpmailer-1.72/class.phpmailer.php");
-
-/**
- * class to wrap administration methods
- *
- * @uses phpmailer
- */
-class administration {
-    /**
-     * checks whether the passed email-address is valid / following a pattern
-     * @todo is this an exact representation of the RFC 2822?
-     * @todo this should be checked: what about umlaut-domains and tld like \
                '.museum'?
-     * @see http://tools.ietf.org/html/rfc2822
-     *
-     * @param <string> a all lowercase email adress to test
-     * @return <boolean> answer to "is the passed over email valid?""
-     */
-	function isValidEmail($email) {
-        if(mb_eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", \
                $email)) {
-            return true;
-		}
-		return false;
-	}
-
-    /**
-     * sends an email via php mailer
-     *
-     * @param string an email address for the "From"-field
-     * @param string the displayed name for the "From"-field
-     * @param string an email address for the "To"-field
-     * @param string the displayed name for the "From"-field
-     * @param string the text to be set as "Subject"
-     * @param string the text of the emails body
-     * @param string a reference to an error string
-     */
-	function sendEmail($fromAddr, $fromName, $toAddr, $toName, $subject, $body, \
                &$error_msg ){
-
-		global $mailHost, $mailUsername, $mailPassword;
-		if($fromAddr == ''){
-			$fromAddr = MAILADMIN;
-		}
-
-		if($fromName == ''){
-			$fromName = MAILADMINNAME;
-		}
-
-		if ($this->isValidEmail($fromAddr) && $this->isValidEmail($toAddr)) {
-			$mail = new PHPMailer();
-
-			if ($fromName != "" ) {
-				$mail->FromName = $fromName;
-			}
-
-			$mail->IsSMTP();                  // set mailer to use SMTP
-			$mail->Host = $mailHost;          // specify main and backup server
-			$mail->SMTPAuth = true;           // turn on SMTP authentication
-			$mail->Username = $mailUsername;  // SMTP username
-			$mail->Password = $mailPassword;  // SMTP password
-
-			$mail->From = $fromAddr;
-			$mail->AddAddress($toAddr, $toName);
-			#$mail->AddReplyTo("info@ccgis.de", "Information");
-
-			$mail->WordWrap = 50;                                 // set word wrap to 50 \
                characters
-			#$mail->AddAttachment("/var/tmp/file.tar.gz");         // add attachments
-			#$mail->AddAttachment("/tmp/image.jpg", "new.jpg");    // optional name
-			$mail->IsHTML(false);                                  // set email format to \
                HTML
-
-			$mail->Subject = "[".$fromName."] ".$subject;
-			$mail->Body    = $body;
-			#$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
-
-			$error_msg='';
-
-			if(!$mail->Send())
-			{
-			   $error_msg .= "Mailer Error: " . $mail->ErrorInfo;
-			   return false;
-			}
-
-			return true;
-		}
-		else {
-			return false;
-		}
-	}
-
-	/**
-	 * Removes the namespace from a tag name
-	 * @return String like "gml"
-	 * @param $s String like "ogc:gml"
-	 */
-	public static function sepNameSpace($s) {
-		$c = strpos($s,":");
-		if ($c > 0) {
-			return substr($s,$c+1);
-		}
-		return $s;
-	}
-
-	/**
-	 * Parses an XML with PHP XML parser, see
-	 * http://de2.php.net/manual/de/book.xml.php
-	 *
-	 * @return Array an associative array of tags, values, attributes and types
-	 * @param $someXml String The actual XML as string.
-	 */
-	public static function parseXml ($someXml) {
-		$values = null;
-		$tags = null;
-
-		$parser = xml_parser_create(CHARSET);
-
-		// set parsing options
-		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
-		xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
-		xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, CHARSET);
-
-		// this is the actual parsing process
-		xml_parse_into_struct($parser, $someXml, $values, $tags);
-
-		// check if an error occured
-		$code = xml_get_error_code ($parser);
-		if ($code) {
-			// report error
-			$line = xml_get_current_line_number($parser);
-			$errorMessage = xml_error_string($code) . " in line " . $line;
-			$mb_exception = new mb_exception($errorMessage);
-			return false;
-		}
-		xml_parser_free($parser);
-
-		return $values;
-	}
-
-    /**
-     * returns a random password with numbers and chars both lowercase and uppercase \
                (0-9a-zA-Z)
-     *
-     * @return string the new password
-     */
- 	function getRandomPassword() {
-
-		// password length
-		$max = 16;
-
-		//new password
-		$newpass = "";
-
-		for ($i=0;$i <= $max;$i++) {
-			//die ASCII-Zeichen 48 - 57 sind die zahlen 0-9
-			//die ASCII-Zeichen 65 - 90 sind die buchstaben A-Z (Gro�)
-			//die ASCII-Zeichen 97 - 122 sind die buchstaben a-z (Klein)
-			$ascii = 0;
-			do {
-				$ascii=rand(48,122);
-			} while ( ($ascii > 57 && $ascii < 65) || ($ascii > 90 && $ascii < 97));
-			$newpass .= chr($ascii);
-		}
-		return $newpass;
- 	}
-
-    /**
-     * returns the name of a mapbender user which owns the GUI identified by the \
                passed over gui_id.
-     *
-     * @param string the gui_id
-     * @return integer the user id of the owner
-     */
- 	function getOwnerByGui($gui_id){
-		$sql = "(SELECT mb_user.mb_user_id";
-		$sql .= "FROM mb_user ";
-		$sql .= "JOIN gui_mb_user ON mb_user.mb_user_id = gui_mb_user.fkey_mb_user_id ";
-		$sql .= "WHERE gui_mb_user.mb_user_type = 'owner' ";
-		$sql .= "AND gui_mb_user.fkey_gui_id = $1 ";
-		$sql .= "GROUP BY mb_user.mb_user_id ";
-		$sql .= ") ";
-		$sql .= "UNION ( ";
-		$sql .= "SELECT mb_user.mb_user_id ";
-		$sql .= "FROM gui_mb_group ";
-		$sql .= "JOIN mb_user_mb_group ON mb_user_mb_group.fkey_mb_group_id = \
                gui_mb_group.fkey_mb_group_id ";
-		$sql .= "JOIN mb_user ON mb_user.mb_user_id = mb_user_mb_group.fkey_mb_user_id ";
-		$sql .= "JOIN gui_mb_user ON mb_user.mb_user_id = gui_mb_user.fkey_mb_user_id ";
-		$sql .= "WHERE gui_mb_group.mb_group_type = 'owner' ";
-		$sql .= "AND gui_mb_group.fkey_gui_id = $2 ";
-		$sql .= "GROUP BY mb_user.mb_user_id)";
-		$owner = array();
-		$v = array($gui_id,$gui_id);
-		$t = array('s','s');
-		$res = db_prep_query($sql,$v,$t);
-		$cnt = 0;
-		while($row = db_fetch_array($res)){
-			$owner[$cnt] = $row["mb_user_id"];
-			$cnt++;
-		}
-		return $owner;
- 	}
-
-    /**
-     * returns the content of the field mb_user_email for the given userid.
-     *
-     * @param integer userid the id of the current user
-     * @return string the email if one row is found or false if none is found
-     */
-	function getEmailByUserId($userid){
-		$sql = "SELECT mb_user_email FROM mb_user ";
-		$sql .= "WHERE mb_user_id = $1 GROUP by mb_user_email";
-        // TODO why do we group, when userid is a primary key?
-		$v = array($userid);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-		// TODO shall the next two lines be removed?
-        $count_g = 0;
-		$array = array();
-		$row = db_fetch_array($res);
-		if ($row) {
-			return $row["mb_user_email"];
-		}
-		else {
-			return false;
-		}
-	}
-
-    /**
-     * returns the name of the user for the given userid.
-     *
-     * @param	integer		the userid
-     * @return 	string		the name if one row is found or false if none is foundd
-     */
-	function getUserNameByUserId($userid){
-		$sql = "SELECT mb_user_name FROM mb_user ";
-		$sql .= "WHERE mb_user_id = $1 GROUP BY mb_user_name";
-        // TODO why do we group, when userid is a primary key?
-		$v = array($userid);
-		$t = array("i");
-		$res = db_prep_query($sql,$v,$t);
-        // TODO shall the next two lines be removed?
-		$count_g = 0;
-		$array = array();
-		$row = db_fetch_array($res);
-		if ($row) {
-			return $row["mb_user_name"];
-		}
-		else {
-			return false;
-		}
-	}
-
-    /**
-     * returns one or more userids from the given email or false,
-     * if there is no record in the database matching the given email
-     *
-     * @param	string	the email
-     * @return	mixed	an array of userids or false when no records matches
-     */
- 	function getUserIdByEmail($email){
-		$sql = "SELECT  mb_user_id FROM mb_user ";
-		$sql .= "WHERE mb_user_email = $1 GROUP BY mb_user_id";
-		$v = array($email);
-		$t = array('s');
-		$res = db_prep_query($sql,$v,$t);
-  		$count_g = 0;
-  		$array = array();
-		while($row = db_fetch_array($res)){
-			$array[$count_g] = $row["mb_user_id"];
-			$count_g++;
-		}
-		if ($count_g >0)	{
-			return $array;
-		}
-		else {
-			return false;
-		}
- 	}
-
-    /**
-     * returns one or more owners for the given wm_id. First all guis deploying
-     * this wms are selected. Afterwards for each of the guis the owners are
-     * selected and stored within an array.
-     *
-     * @param	integer		the wms_id
-     * @return	mixed		an array of user ids which use the wms in their guis
-     * 						(both for persona or group ownership)
-     */
-	function getOwnerByWms($wms_id){
-		// first get guis which deploy this wms.
-        $sql = "SELECT fkey_gui_id FROM gui_wms WHERE fkey_wms_id = $1 GROUP BY \
                fkey_gui_id";
-		$v = array($wms_id);
-		$t = array('i');
-		$count=0;
-		$res = db_prep_query($sql,$v,$t);
-		while($row = db_fetch_array($res)){
-			$gui[$count] = $row["fkey_gui_id"];
-			$count++;
-		}
-
-		if ($count > 0) {
-			// this is not needed! count($gui) is always equal to $count
-            if(count($gui)>0) {
-				$v = array();
-				$t = array();
-				$c = 1;
-				$sql = "(SELECT mb_user.mb_user_id FROM mb_user JOIN gui_mb_user ";
-				$sql .= "ON mb_user.mb_user_id = gui_mb_user.fkey_mb_user_id ";
-				$sql .= " WHERE gui_mb_user.mb_user_type = 'owner'";
-				$sql .= " AND gui_mb_user.fkey_gui_id IN (";
-				for($i=0; $i<count($gui); $i++){
-					if($i>0){ $sql .= ",";}
-					$sql .= "$".$c;
-					$c++;
-					array_push($v, $gui[$i]);
-					array_push($t, 's');
-				}
-				$sql .= ") GROUP BY mb_user.mb_user_id";
-				$sql .= ") UNION (";
-				$sql .= "SELECT mb_user.mb_user_id FROM gui_mb_group JOIN mb_user_mb_group ON  \
                mb_user_mb_group.fkey_mb_group_id = gui_mb_group.fkey_mb_group_id  \
                JOIN mb_user ";
-				$sql .= "ON mb_user.mb_user_id = mb_user_mb_group.fkey_mb_user_id ";
-				$sql .= " WHERE gui_mb_group.mb_group_type = 'owner'";
-				$sql .= " AND gui_mb_group.fkey_gui_id IN (";
-
-				for($j=0; $j<count($gui); $j++){
-					if($j>0){ $sql .= ",";}
-					$sql .= "$".$c;
-					$c++;
-					array_push($v, $gui[$i]);
-					array_push($t, 's');
-				}
-				$sql .= ") GROUP BY mb_user.mb_user_id)";
-
-				$user = array();
-				$res = db_prep_query($sql,$v,$t);
-			}
-			$cnt = 0;
-
-			while($row = db_fetch_array($res)){
-				$user[$cnt] = $row["mb_user_id"];
-				$cnt++;
-			}
-			if ($cnt>0)	{
-                return $user;
-            } else {
-                return false;
-            }
-		} else {
-          return false;
-        }
-	}
-    /**
-     * tests whether a gui with the passed gui_id exits and returns true or false.
-     *
-     * @param	string		the gui_id to test
-     * @return	boolean		Does a Gui with the passed over gui_id exist?
-     */
-	function guiExists($id){
-		$sql = "SELECT * FROM gui WHERE gui_id = $1 ";
-		$v = array($id);
-		$t = array('s');
-		$res = db_prep_query($sql,$v,$t);
-		$row = db_fetch_array($res);
-		if ($row) {
-			return true;
-		}
-		else {
-			return false;
-		}
-	}
-
-    /**
-     * deletes a {@link http://www.mapbender.org/index.php/WMC WMC} entry specified \
                by wmc_id and user_id
-     *
-     * @param	integer		the user_id
-     * @param	string		the wmc_id
-     * @return	boolean		Did the query run succesfull? This does not necessarily mean \
                that
-     * 						an entry was deleted.
-     * @deprecated
-     */
- 	function deleteWmc($wmc_id, $user_id){
-		$e = new mb_notice("administration->deleteWmc is deprecated, use wmc->delete \
                instead!");
-
-		$wmc = new wmc();
-		return $wmc->delete($wmc_id, $user_id);
- 	}
-
-    /**
-     * inserts a gui with the specified gui_id, after checking the uniqueness of teh \
                gui id.
-     *
-     * @uses administration::guiExists()
-     * @param 	string $guiId	the name and id of the gui to insert.
-     * @return 	boolean			could the gui be inserted?
-     */
-	function insertGui($guiId) {
-		if (!$this->guiExists($guiId)) {
-			$sql = "INSERT INTO gui VALUES ($1, $2, '', '1')";
-			$v = array($guiId,$guiId);
-			$t = array('s','s');
-			$res = db_prep_query($sql,$v,$t);
-			if ($res) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-    /**
-     * deletes links between user and guis in gui_mb_user for a certain gui.
-     *
-     * @param string 	the gui name
-     * @return boolean 	could the sql be executed without errors. This does not
-     * 					necessarily mean, that entries were deleted
-     */
-	function delAllUsersOfGui($guiId) {
-		$sql = "DELETE FROM gui_mb_user WHERE fkey_gui_id = $1 ";
-		$v = array($guiId);
-		$t = array('s');
-		$res = db_prep_query($sql,$v,$t);
-		if (!$res) {
-			return false;
-		}
-		else {
-			return true;
-		}
-	}
-
-    /**
-     * returns an array of WMS for a given user id
-     * @uses getGuisByOwner
-     * @param integer $user_id		the user id
-     * @return integer[] 			wms ids for the user
-     */
-	function getWmsByOwner($user_id){
-		$gui_list = $this->getGuisByOwner($user_id,true);
-		return $this->getWmsByOwnGuis($gui_list);
-	}
-
-    /**
-     * returns an array of WMS where the owner is the user with the passed user_id
-     * @param integer	the user id
-     * @return array 	wms ids for the user
-     */
-	function getWmsByWmsOwner($user_id){
-		$sql = "SELECT wms_id FROM wms WHERE wms_owner = $1";
-		$v = array($user_id);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-		$r = array();
-		while($row = db_fetch_array($res)){
-			array_push($r,$row["wms_id"]);
-		}
-		return $r;
-	}
-
-    /**
-     * returns an array of user which are associated with a wms
-     *
-     * @param integer	the wms id
-     * @return array	user_ids for the wms
-     */
-	function getUserByWms($wms_id){
-		$sql = "SELECT fkey_gui_id FROM gui_wms WHERE fkey_wms_id = $1 GROUP BY \
                fkey_gui_id";
-		$v = array($wms_id);
-		$t = array('i');
-		$count=0;
-		$res = db_prep_query($sql,$v,$t);
-		while($row = db_fetch_array($res)){
-			$gui[$count] = $row["fkey_gui_id"];
-			$count++;
-		}
-		$c = 1;
-		$v = array();
-		$t = array();
-		if(count($gui)>0){
-			$sql = "(SELECT mb_user.mb_user_id FROM mb_user JOIN gui_mb_user ";
-			$sql .= "ON mb_user.mb_user_id = gui_mb_user.fkey_mb_user_id ";
-			$sql .= " WHERE gui_mb_user.fkey_gui_id IN (";
-			for($i=0; $i<count($gui); $i++){
-				if($i>0){ $sql .= ",";}
-				$sql .= "$".$c;
-				array_push($v,$gui[$i]);
-				array_push($t, 's');
-				$c++;
-			}
-			$sql .= ") GROUP BY mb_user.mb_user_id) UNION";
-			$sql .= "(SELECT mb_user.mb_user_id FROM gui_mb_group JOIN mb_user_mb_group ON   \
                mb_user_mb_group.fkey_mb_group_id = gui_mb_group.fkey_mb_group_id     \
                JOIN mb_user ";
-			$sql .= "ON mb_user.mb_user_id = mb_user_mb_group.fkey_mb_user_id ";
-			$sql .= " WHERE gui_mb_group.fkey_gui_id IN (";
-			for($i=0; $i<count($gui); $i++){
-				if($i>0){ $sql .= ",";}
-				$sql .= "$".$c;
-				array_push($v,$gui[$i]);
-				array_push($t, 's');
-				$c++;
-			}
-			$sql .= ") GROUP BY mb_user.mb_user_id )";
-			$user = array();
-			$res = db_prep_query($sql,$v,$t);
-			$cnt = 0;
-			while($row = db_fetch_array($res)){
-				$user[$cnt] = $row["mb_user_id"];
-				$cnt++;
-			}
-		}
-		return $user;
-	}
-
-    /**
-     * selects the WMS-title for a given wms id.
-     *
-     * @param integer 			the wms id
-     * @return string|boolean 	either the title of the wms as string or false when \
                none exists
-     */
-	function getWmsTitleByWmsId($id){
-		$sql = "SELECT wms_title FROM wms WHERE wms_id = $1 GROUP BY wms_title";
-		$v = array($id);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-		$row = db_fetch_array($res);
-		if ($row) return $row["wms_title"]; else return false;
-	}
-
-    /**
-     * selects the Layer-title for a given layer id.
-     *
-     * @param integer			the wms id
-     * @return string|boolean	either the title of the wms as string or false when \
                none exists
-     */
-	function getLayerTitleByLayerId($id){
-		$sql = "SELECT layer_title FROM layer WHERE layer_id = $1 GROUP BY layer_title";
-		$v = array($id);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-		$row = db_fetch_array($res);
-		if ($row) return $row["layer_title"]; else return false;
-	}
-
-    /**
-     * selects the WMC for a given wmc_id.
-     *
-     * @param integer			the wms id
-     * @return string|boolean	either the wmc as string or false when none exists
-     * @deprecated
-     */
-	function getWmcById($id){
-		$e = new mb_notice("administration->getWmcById is deprecated, use wmc->getDocument \
                instead!");
-
-		$wmc = new wmc();
-		return $wmc->getDocument($id);
-	}
-
-    /**
-     * resets the login count of a given user to 0
-     * @param integer	the user id
-     * @return boolean 	could the login count be reseted?
-     */
-	function resetLoginCount($userId) {
-		// TODO: isn't mb_user_login_count a integer?
-        $sql = "UPDATE mb_user SET mb_user_login_count = '0' ";
-		$sql .= "WHERE mb_user_id = $1 ";
-		$v = array($userId);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-		if (!$res) {
-			return false;
-		}
-		else {
-			return true;
-		}
-	}
-
-	function getUserIdByUserName($username){
-		$sql = "SELECT mb_user_id FROM mb_user ";
-		$sql .= "WHERE mb_user_name = $1 GROUP BY mb_user_id";
-		$v = array($username);
-		$t = array('s');
-		$res = db_prep_query($sql,$v,$t);
-		$row = db_fetch_array($res);
-		if ($row) return $row["mb_user_id"]; else return false;
-	}
-
-	function setUserAsGuiOwner($guiId, $userId) {
-		$sql = "UPDATE gui_mb_user SET mb_user_type = 'owner' ";
-		$sql .= "WHERE fkey_gui_id = $1 AND fkey_mb_user_id = $2 ";
-		$v = array($guiId,$userId);
-		$t = array('s','i');
-		$res = db_prep_query($sql,$v,$t);
-
-		if (!$res) {
-			return false;
-		}
-		else {
-			return true;
-		}
- 	}
-
-	function getGuiIdByGuiName($guiTitle){
-		$sql = "SELECT gui_id FROM gui ";
-		$sql .= "WHERE gui_name = $1 GROUP BY gui_id";
-		$v = array($guiTitle);
-		$t = array('s');
-		$res = db_prep_query($sql,$v,$t);
-  		$count_g = 0;
-  		$array = array();
-		while($row = db_fetch_array($res)){
-			$array[$count_g] = $row["gui_id"];
-			$count_g++;
-		}
-		if ($count_g >0)	{
-			return $array;
-		}
-		else {
-			return false;
-		}
- 	}
-
-	function getGuisByOwner($user_id,$ignore_public)
-	{
-		$sql_guis = "SELECT gui.gui_id FROM gui,gui_mb_user ";
-		$sql_guis .= "WHERE (gui.gui_id = gui_mb_user.fkey_gui_id AND \
                gui_mb_user.fkey_mb_user_id = $1) ";
-		if (!isset($ignore_public) OR $ignore_public == false){
-			$sql_guis .= " AND gui.gui_public = 1 ";
-		}
-		$sql_guis .= " AND gui_mb_user.mb_user_type = 'owner' GROUP BY gui.gui_id";
-		$sql_guis .= " ORDER by gui.gui_id";
-		$v = array($user_id);
-		$t = array('i');
-		$res_guis = db_prep_query($sql_guis,$v,$t);
-  		$count_g = 0;
-  		$arrayGuis = array();
-		while($row = db_fetch_array($res_guis)){
-			$arrayGuis[$count_g] = $row["gui_id"];
-			$count_g++;
-		}
-		return $arrayGuis;
- 	}
-
-	/**
-	 * @deprecated
-	 */
- 	function getWmcByOwner($user_id){
-		$e = new mb_notice("administration->getWmcByOwner is deprecated, use \
                user->getWmcByOwner instead!");
-
-		$user = new User($user_id);
-		return $user->getWmcByOwner();
- 	}
-
-	/**
-	 * @deprecated
-	 */
-	function getGuisByPermission($mb_user_id,$ignorepublic){
-		$e = new mb_notice("administration->getGuisByPermission is deprecated, use \
                user->getApplicationsByPermission instead!");
-		$user = new User($mb_user_id);
-		return $user->getApplicationsByPermission($ignorepublic);
-	}
-
-	function getWmsByOwnGuis($array_gui_ids){
-		if(count($array_gui_ids)>0){
-			$v = array();
-			$t = array();
-			$sql = "SELECT fkey_wms_id from gui_wms WHERE gui_wms.fkey_gui_id IN(";
-			for($i=0; $i<count($array_gui_ids); $i++){
-				if($i>0){ $sql .= ",";}
-				$sql .= "$".strval($i+1);
-				array_push($v, $array_gui_ids[$i]);
-				array_push($t, "s");
-			}
-			$sql .= ") GROUP BY fkey_wms_id ORDER BY fkey_wms_id";
-			$res = db_prep_query($sql,$v,$t);
-			$ownguis = array();
-			$i=0;
-			while($row = db_fetch_array($res)){
-				$ownguis[$i] = $row['fkey_wms_id'];
-				$i++;
-			}
-		}
-		return $ownguis;
-	}
-
-	function getLayerByWms($wms_id){
-		$sql = "SELECT layer_id from layer WHERE fkey_wms_id = $1 AND layer_pos NOT IN \
                ('0') GROUP BY layer_id, layer_title ORDER BY layer_title";
-		$v = array($wms_id);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-		$layer_id_array = array();
-		while($row = db_fetch_array($res)){
-			$layer_id_array[count($layer_id_array)] = $row['layer_id'];
-		}
-		return $layer_id_array;
-	}
-
-	function getWmsOwner($wms_id){
-		$sql = "SELECT fkey_gui_id FROM gui_wms WHERE fkey_wms_id = $1 GROUP BY \
                fkey_gui_id";
-		$v = array($wms_id);
-		$t = array('i');
-		$count=0;
-		$res = db_prep_query($sql,$v,$t);
-		while($row = db_fetch_array($res)){
-			$gui[$count] = $row["fkey_gui_id"];
-			$count++;
-		}
-		$v = array();
-		$t = array();
-		if(count($gui)>0){
-			$sql = "SELECT mb_user.mb_user_id FROM mb_user JOIN gui_mb_user ";
-			$sql .= "ON mb_user.mb_user_id = gui_mb_user.fkey_mb_user_id WHERE";
-			$sql .= " gui_mb_user.fkey_gui_id IN (";
-			for($i=0; $i<count($gui); $i++){
-				if($i>0){ $sql .= ",";}
-				$sql .= "$".($i+1);
-				array_push($v,$gui[$i]);
-				array_push($t,'s');
-			}
-			$sql .= ")";
-			$sql .= " AND gui_mb_user.mb_user_type = 'owner' GROUP BY mb_user.mb_user_id";
-			$res = db_prep_query($sql,$v,$t);
-			$i=0;
-			$wmsowner = array();
-			while($row = db_fetch_array($res)){
-				$wmsowner[$i]=$row['mb_user_id'];
-				$i++;
-			}
-		}
-		return $wmsowner;
-	}
-
-	function insertUserAsGuiOwner($guiId, $userId){
-		$sql = "INSERT INTO gui_mb_user VALUES ($1, $2, 'owner')";
-		$v = array($guiId,$userId);
-		$t = array('s','i');
-		$res = db_prep_query($sql,$v,$t);
-		if (!$res) {
-			return false;
-		}
-		else {
-			return true;
-		}
- 	}
-
-   	function checkModulePermission($arrayGuis, $modulePath, $column){
-   		$check = true;
-   		if($check == true){
-	   		$perm = false;
-	   		if(count($arrayGuis)>0){
-	   			$v = array();
-	   			$t = array();
-		   		$sql = "SELECT ".$column." FROM gui_element WHERE fkey_gui_id IN(";
-		   		for($i=0; $i<count($arrayGuis); $i++){
-		   			if($i > 0){ $sql .= ","; }
-		   			$sql .= "$".($i+1);
-		   			array_push($v,$arrayGuis[$i]);
-		   			array_push($t,'s');
-		   		}
-		   		$sql .= ")";
-				$res = db_prep_query($sql,$v,$t);
-				$cnt = 0;
-				while($row = db_fetch_array($res)){
-					if(mb_strpos(stripslashes($row[$column]),$modulePath) !== false){
-						$perm = true;
-					}
-					$cnt++;
-				}
-	   		}
-			return $perm;
-   		}
-   		else{
-   			return true;
-   		}
-   	}
-
-
-	/**
-	 * Checks if a user is allowed to access a GUI element
-	 *
-	 * @return boolean
-	 * @param $arrayGuis Object
-	 * @param $modulePath Object
-	 * @param $elementTag Object
-	 */
-   	function checkModulePermission_new($userId, $modulePath, $elementTag){
-   		if (CHECK) {
-			$arrayGuis = $this->getGuisByPermission($userId, true);
-
-			switch ($elementTag) {
-				case "a" :
-					$column = "e_attributes";
-					$pattern = "/^.*href\s*=\s*(\'|\")\.\.((\/[a-zA-Z0-9_\/\.]+)+)(\?|\'|\").*$/";
-					$replace = "$2";
-					break;
-				case "iframe" :
-					$column = "e_src";
-					$pattern = "/^\.\.((\/[a-zA-Z0-9_\/\.]+)+)(\?|\'|\").*$/";
-					$replace = "$1";
-					break;
-			}
-
-	   		if ($column && count($arrayGuis) > 0) {
-	   			$v = array();
-	   			$t = array();
-		   		$sql = "SELECT DISTINCT ".$column." FROM gui_element WHERE fkey_gui_id IN (";
-		   		for($i=0; $i<count($arrayGuis); $i++){
-		   			if($i > 0){ $sql .= ","; }
-		   			$sql .= "$".($i+1);
-		   			array_push($v,$arrayGuis[$i]);
-		   			array_push($t,'s');
-		   		}
-		   		$sql .= ") ORDER BY " . $column;
-				$res = db_prep_query($sql,$v,$t);
-				while($row = db_fetch_array($res)){
-					if ($row[$column]) {
-						if (preg_match($pattern, stripslashes($row[$column]))) {
-							$dbFilename = preg_replace($pattern, $replace, stripslashes($row[$column]));
-							$e = new mb_notice($dbFilename . " - " . $modulePath);
-
-							if(strpos($modulePath, $dbFilename) !== false){
-								return true;
-							}
-						}
-					}
-				}
-	   		}
-			return false;
-   		}
-		return true;
-   	}
-
-	function getWMSOWSstring($wms_id){
-   		$sql = "SELECT wms_owsproxy FROM wms WHERE wms_id = $1 ";
-   		$v = array($wms_id);
-   		$t = array("i");
-   		$res = db_prep_query($sql,$v,$t);
-   		if($row = db_fetch_array($res)){
-   			return $row["wms_owsproxy"];
-   		}
-   		else{
-   			return false;
-   		}
-   	}
-
-   	function setWMSOWSstring($wms_id, $status){
-   		$sql = "UPDATE wms SET wms_owsproxy = $1 WHERE wms_id = $2 ";
-   		$t = array("s","i");
-   		if($status == 'on'){
-   			$time = md5(microtime(1));
-			$v = array($time,$wms_id);
-   		}
-   		else{
-   			$v = array("",$wms_id);
-   		}
-   		$res = db_prep_query($sql,$v,$t);
-   	}
-
-	/*
-	 * get the owsproxy-string of the current wfs
-	 *
-	 * @param integer the wfs-id of the current wfs
-	 * @return mixed the owsproxy-string or false
-	 */
-
-   	function getWfsOwsproxyString($wfs_id){
-   		$sql = "SELECT wfs_owsproxy FROM wfs WHERE wfs_id = $1 ";
-   		$v = array($wfs_id);
-   		$t = array("i");
-   		$res = db_prep_query($sql,$v,$t);
-   		if($row = db_fetch_array($res)){
-   			return $row["wfs_owsproxy"];
-   		}
-   		else{
-   			return false;
-   		}
-   	}
-
-	/*
-	 * sets or removes the owsproxy string of the current wfs
-	 *
-	 * @param integer the wfs-id
-	 * @param boolean set (true) or remove (false) the owsproxy-string
-	 *
-	 */
-   	function setWfsOwsproxyString($wfs_id, $status){
-   		$sql = "UPDATE wfs SET wfs_owsproxy = $1 WHERE wfs_id = $2 ";
-   		$t = array("s","i");
-   		if($status == true){
-   			$time = md5(microtime(1));
-			$v = array($time,$wfs_id);
-   		}
-   		else{
-   			$n = new mb_notice("removed owsproxy for wfs:".$wfs_id);
-   			$v = array("",$wfs_id);
-   		}
-
-   		$res = db_prep_query($sql,$v,$t);
-   		$newOwsString = $this->getWfsOwsproxyString($wfs_id);
-   		$n = new mb_notice("Class administration - setOWSString for wfs (".$wfs_id.") \
                to: ". $this->getWfsOwsproxyString($wfs_id));
-   		return $newOwsString;
-   	}
-
-   	function checkURL($url){
-		$pos_qm = strpos($url,"?");
-		if($pos_qm > 0 && $pos_qm < (mb_strlen($url)-1) && \
                mb_substr($url,(mb_strlen($url)-1)) != "&"){
-			$url = $url."&";
-			return $url;
-		}
-		else if($pos_qm === false){
-			return $url."?";
-		}
-		else{
-			return $url;
-		}
-	}
-
-	function getModulPermission($userID,$guiID,$elementID){
-		$g = $this->getGuisByPermission($userID,true);
-		if(in_array($guiID,$g)){
-			$sql = "SELECT * FROM gui_element WHERE fkey_gui_id = $1 AND e_id = $2 ";
-			$v = array($guiID,$elementID);
-			$t = array('s','s');
-			$res = db_prep_query($sql,$v,$t);
-			if($row = db_fetch_array($res)){
-				return true;
-			}
-			else{
-				return false;
-			}
-		}
-		else{
-			return false;
-		}
-	}
-
-	function getLayerPermission($wms_id, $layer_name, $user_id){
-		$layer_id = $this->getLayerIdByLayerName($wms_id,$layer_name);
-		$array_guis = $this->getGuisByPermission($user_id,true);
-		$v = array();
-		$t = array();
-		$sql = "SELECT * FROM gui_layer WHERE fkey_gui_id IN (";
-		$c = 1;
-		for($i=0; $i<count($array_guis); $i++){
-			if($i>0){ $sql .= ",";}
-			$sql .= "$".$c;
-			$c++;
-			array_push($v, $array_guis[$i]);
-			array_push($t, 's');
-		}
-		$sql .= ") AND fkey_layer_id = $".$c." AND gui_layer_status = 1";
-		array_push($v,$layer_id);
-		array_push($t,'i');
-		$res = db_prep_query($sql,$v,$t);
-		if($row = db_fetch_array($res)){
-			return true;
-		}
-		else{
-			return false;
-		}
-	}
-
-	function getWmsPermission($wms_id, $user_id) {
-		$array_guis = $this->getGuisByPermission($user_id,true);
-		$v = array();
-		$t = array();
-		$sql = "SELECT * FROM gui_wms WHERE fkey_gui_id IN (";
-		$c = 1;
-		for($i=0; $i<count($array_guis); $i++){
-			if($i>0){ $sql .= ",";}
-			$sql .= "$".$c;
-			$c++;
-			array_push($v, $array_guis[$i]);
-			array_push($t, 's');
-		}
-		$sql .= ") AND fkey_wms_id = $".$c;
-		array_push($v,$wms_id);
-		array_push($t,'i');
-		$res = db_prep_query($sql,$v,$t);
-		if($row = db_fetch_array($res)){
-			return true;
-		}
-		else{
-			return false;
-		}
-	}
-
-	function getLayerIdByLayerName($wms_id, $layer_name){
-		$sql = "SELECT layer_id FROM layer WHERE ";
-		$sql .= "fkey_wms_id = $1 AND layer_name = $2";
-		$v = array($wms_id,$layer_name);
-		$t = array('i','s');
-		$res = db_prep_query($sql,$v,$t);
-		if($row = db_fetch_array($res)){
-			return $row['layer_id'];
-		}
-		else{
-			return false;
-		}
-	}
-
-	function getWmsIdByWmsGetmap($getmap) {
-		$sql = "SELECT wms_id FROM wms WHERE ";
-		$sql .= "wms_getmap LIKE $1 LIMIT 1";
-		$v = array($getmap."%");
-		$t = array('s');
-		$res = db_prep_query($sql,$v,$t);
-		if($row = db_fetch_array($res)){
-			return $row['wms_id'];
-		}
-		else{
-			return false;
-		}
-	}
-
-	function is_utf8_string($string) {
-	    if (is_array($string))
-	    {
-	        $enc = implode('', $string);
-	        return @!((ord($enc[0]) != 239) && (ord($enc[1]) != 187) && (ord($enc[2]) \
                != 191));
-	    }
-	    else
-	    {
-	        return (utf8_encode(utf8_decode($string)) == $string);
-	    }
-    /*
-    		return preg_match('%(?:
-		[\xC2-\xDF][\x80-\xBF]        # non-overlong 2-byte
-		|\xE0[\xA0-\xBF][\x80-\xBF]               # excluding overlongs
-		|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}      # straight 3-byte
-		|\xED[\x80-\x9F][\x80-\xBF]               # excluding surrogates
-		|\xF0[\x90-\xBF][\x80-\xBF]{2}    # planes 1-3
-		|[\xF1-\xF3][\x80-\xBF]{3}                  # planes 4-15
-		|\xF4[\x80-\x8F][\x80-\xBF]{2}    # plane 16
-		)+%xs', $string);
-	*/
-	}
-
-	function is_utf8_xml($xml) {
-		return preg_match('/<\?xml[^>]+encoding="utf-8"[^>]*\?>/is', $xml);
-	}
-
-	function is_utf8 ($data) {
-		return ($this->is_utf8_xml($data) || $this->is_utf8_string($data));
-	}
-
-	function char_encode($data) {
-		if (CHARSET == "UTF-8") {
-			if (!$this->is_utf8($data)) {
-				$e = new mb_notice("Conversion: ISO-8859-1 to UTF-8");
-				return utf8_encode($data);
-			}
-		}
-		else {
-			if ($this->is_utf8($data)) {
-				$e = new mb_notice("Conversion: UTF-8 to ISO-8859-1");
-				return utf8_decode($data);
-			}
-		}
-		$e = new mb_notice("No conversion: is " . CHARSET);
-		return $data;
-	}
-
-	function char_decode($data) {
-		if (CHARSET == "UTF-8") {
-			if ($this->is_utf8($data)) {
-				$e = new mb_notice("Conversion: UTF-8 to ISO-8859-1");
-				return utf8_decode($data);
-			}
-		}
-		$e = new mb_notice("no conversion: is " . CHARSET);
-		return $data;
-	}
-
-	/**
-	 * identifies the Featureservices where the current user is owner
-	 *
-	 * @param integer 		userid the user-ID of the current user
-	 * @return integer[] 	the IDs of the featureservices
-	 */
-	 function getWfsByOwner($userid){
-	 	$sql = "SELECT wfs_id FROM wfs WHERE wfs_owner = $1";
-		$v = array($userid);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-		$r = array();
-		while($row = db_fetch_array($res)){
-			array_push($r,$row["wfs_id"]);
-		}
-		return $r;
-	 }
-
-	 /** identifies the Conf-FeatureServices where the current user is owner
-	 *
-	 * @deprecated
-	 * @param integer 		userid the user-ID of the current user
-	 * @return integer[] 	the IDs of the wfs_conf-table
-	 */
-	 function getWfsConfByPermission($userid){
-		$e = new mb_notice("administration->getWfsConfByPermission is deprecated, use \
                user->getWfsConfByPermission instead!");
-		$user = new User($userid);
-		return $user->getWfsConfByPermission();
-	 }
-}
+include_once(dirname(__FILE__)."/../../lib/administration.php");
 ?>
\ No newline at end of file

Modified: branches/testbaudson_dev/http/classes/class_checkInput.php
==================================================================--- \
                trunk/mapbender/http/classes/class_checkInput.php	2008-06-24 12:33:05 \
                UTC (rev 2556)
+++ branches/testbaudson_dev/http/classes/class_checkInput.php	2008-06-30 14:13:03 \
UTC (rev 2566) @@ -1,54 +1,3 @@
 <?php
-# $Id$
-# http://www.mapbender.org/index.php/class_checkInput
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-class checkInput{
-	var $v;
-	function checkInput($q,$v,$t){
-		if(is_array($v) == false){
-			$v = array($v);
-		}
-		if(is_array($t) == false){
-			$t = array($t);
-		}
-		if(count($v) != count($t)){
-			$e = new mb_exception("array params and array types have a different count  in \
                ".$_SERVER['SCRIPT_FILENAME'].": Sql: ".$q);
-		}
-		if(PREPAREDSTATEMENTS == true && SYS_DBTYPE == "pgsql"){
-			$this->v = $v;
-		}
-		else{
-			for($i=0; $i<count($v); $i++){
-				if($t[$i] == 's'){
-					$v[$i] = db_escape_string($v[$i]);
-				}
-				else if($t[$i] == 'i'){
-					if(preg_match("/w/",$v[$i])){
-						$e = new mb_exception($_SERVER['SCRIPT_FILENAME'].": Unable to parse integer \
                in: ".$q." with: param ".$i.",".$v[i]);
-						die("wrong data type in sql:".$q);
-					}
-				}
-				else if($t[$i] == 'd'){
-
-				}
-			}
-			$this->v = $v;
-		}
-	}
-}
+include_once(dirname(__FILE__)."/../../lib/checkInput.php");
 ?>
\ No newline at end of file

Modified: branches/testbaudson_dev/http/classes/class_connector.php
==================================================================--- \
                trunk/mapbender/http/classes/class_connector.php	2008-06-24 12:33:05 \
                UTC (rev 2556)
+++ branches/testbaudson_dev/http/classes/class_connector.php	2008-06-30 14:13:03 UTC \
(rev 2566) @@ -1,213 +1,3 @@
 <?php
-# $Id$
-# http://www.mapbender.org/index.php/class_connector
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
-
-mb_internal_encoding("UTF-8");
-
-/**
- * Establishes a connection to a given URL (and loads the content).
- * Supports HTTP (GET and POST), cURL and socket connections.
- *
- * @class
- */
-class connector {
-
-	var $file;
-	private $connectionType;
-	private $httpType = "get";
-	private $httpVersion = "1.0";
-	private $httpPostData;
-	private $httpContentType;
-
-	/**
-	 * @constructor
-	 * @param String url the URL that will be loaded (optional)
-	 */
-	public function __construct($url){
-		$this->set("connectionType", CONNECTION);
-		if ($url) {
-			$this->load($url);
-		}
-	}
-
-	/**
-	 * Loads content from the given URL.
-	 */
-	public function load($url) {
-		switch ($this->connectionType) {
-			case "curl":
-				$this->file = $this->getCURL($url);
-				break;
-			case "http":
-				$this->file = $this->getHTTP($url);
-				break;
-			case "socket":
-				$this->file = $this->getSOCKET($url);
-				break;
-		}
-		if(!$this->file){
-			$e = new mb_exception("connector: unable to load: ".$url);
-			return false;
-		}
-		return $this->file;
-	}
-
-	/**
-	 * Sets the environment variables. The following can be set:
-	 * - connectionType ("http", "curl", "socket")
-	 * - httpType ("get", "post")
-	 * - etc.
-	 */
-	public function set ($key, $value) {
-		switch ($key) {
-			case "connectionType":
-				if ($this->isValidConnectionType($value)) {
-					$this->connectionType = $value;
-				}
-				break;
-
-			case "httpVersion":
-				if (in_array($value, array("1.0", "1.1"))) {
-					$this->httpVersion = $value;
-				}
-				else {
-					$e = new mb_exception("class_connector.php: invalid http type '" . $value . \
                "'");
-				}
-				break;
-
-			case "httpType":
-				if (in_array(mb_strtoupper($value), array("POST", "GET"))) {
-					$this->httpType = $value;
-				}
-				else {
-					$e = new mb_exception("class_connector.php: invalid http type '" . $value . \
                "'");
-				}
-				break;
-
-			case "httpPostData":
-				$this->httpPostData = $value;
-				break;
-
-			case "httpContentType":
-				if ($this->isValidHttpContentType($value)) {
-					$this->httpContentType = $value;
-				}
-				break;
-		}
-	}
-
-	private function isValidConnectionType ($value) {
-		if (in_array(mb_strtoupper($value), array("HTTP", "CURL", "SOCKET"))) {
-			return true;
-		}
-		else {
-			$e = new mb_exception("class_connector.php: invalid connection type '" . $value . \
                "'");
-			return false;
-		}
-	}
-
-	private function isValidHttpContentType ($value) {
-		$validHttpContentTypeArray = array("XML");
-		if (in_array(mb_strtoupper($value), $validHttpContentTypeArray)) {
-			switch ($value) {
-				case "XML":
-					$this->httpContentType = "application/xml";
-					break;
-			}
-			return true;
-		}
-		else {
-			$e = new mb_exception("class_connector.php: invalid HTTP content type '" . $value \
                . "'");
-			return false;
-		}
-	}
-
-	private function getCURL($url){
-		$ch = curl_init ($url);
-//		curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
-		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
-		if(CONNECTION_PROXY != ""){
-			curl_setopt($ch, CURLOPT_PROXY,CONNECTION_PROXY.":".CONNECTION_PORT);
-		}
-		if(CONNECTION_PASSWORD != ""){
-			curl_setopt ($ch, CURLOPT_PROXYUSERPWD, CONNECTION_USER.':'.CONNECTION_PASSWORD);
-		}
-		curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
-		$file = curl_exec ($ch);
-		curl_close ($ch);
-
-		return $file;
-	}
-
-	private function getHTTP($url){
-		if ($this->httpType == "get") {
-			return @file_get_contents($url);
-	 	}
-		else {
-			$urlComponentArray = parse_url($url);
-			$host = $urlComponentArray["host"];
-			$port = $urlComponentArray["port"];
-			if ($port == "") {
-				$port = 80;
-			}
-			$path = $urlComponentArray["path"];
-			$buf = '';
-		    $fp = fsockopen($host, $port);
-		    fputs($fp, "POST $path HTTP/".$this->httpVersion . "\r\n");
-		    fputs($fp, "Host: $host\r\n");
-		    if ($this->isValidHttpContentType($this->httpContentType)) {
-		    	fputs($fp,"Content-type: " . $this->httpContentType . "\r\n");
-		    }
-		    fputs($fp, "Content-length: " . strlen($this->httpPostData) . "\r\n");
-		    fputs($fp, "Connection: close\r\n\r\n");
-		    fputs($fp, $this->httpPostData);
-		    $xmlstr = false;
-		    while (!feof($fp)) {
-		    	$content = fgets($fp,4096);
-		    	if( strpos($content, '<?xml') === 0){
-		    		$xmlstr = true;
-		    	}
-		    	if($xmlstr == true){
-		    		$buf .= $content;
-		    	}
-			}
-		    fclose($fp);
-		    return $buf;
-		}
-	}
-
-	private function getSOCKET($url){
-		$r = "";
-		$fp = fsockopen (CONNECTION_PROXY, CONNECTION_PORT, $errno, $errstr, 30);
-		if (!$fp) {
-			echo "$errstr ($errno)<br />\n";
-		}
-		else {
-			fputs ($fp, "GET ".$url." HTTP/1.0\r\n\r\n");
-			while (!feof($fp)) {
-				$r .= fgets($fp,4096);
-			}
-			fclose($fp);
-			return $r;
-		}
-	}
-}
+include_once(dirname(__FILE__)."/../../lib/connector.php");
 ?>
\ No newline at end of file

Modified: branches/testbaudson_dev/http/classes/class_json.php
==================================================================--- \
                trunk/mapbender/http/classes/class_json.php	2008-06-24 12:33:05 UTC \
                (rev 2556)
+++ branches/testbaudson_dev/http/classes/class_json.php	2008-06-30 14:13:03 UTC (rev \
2566) @@ -1,81 +1,3 @@
 <?php
-# $Id:class_json.php 2406 2008-04-23 15:59:31Z christoph $
-# http://www.mapbender.org/index.php/JSON
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-mb_internal_encoding("UTF-8");
-
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
-
-define("JSON_PEAR", "json_pear");
-define("JSON_NATIVE", "json_native");
-
-if (!function_exists("json_encode")) {
-	require_once(dirname(__FILE__)."/../extensions/JSON.php");
-}
-
-/**
- * A wrapper class for PHP JSON encoding/decoding.
- * Uses native PHP functions if available.
- *
- * @class
- */
-class Mapbender_JSON {
-
-	/**
-	 * Either JSON_PEAR or JSON_NATIVE
-	 */
-	private $library = JSON_PEAR;
-
-	/**
-	 * Determines which JSON lib to use.
-	 * @constructor
-	 */
-	public function __construct(){
-		if (function_exists("json_encode")) {
-			$this->library = JSON_NATIVE;
-		}
-	}
-
-	/**
-	 * Encodes an object to JSON
-	 */
-	public function encode($anObject) {
-		if ($this->library == JSON_PEAR) {
-			$pear = new Services_JSON();
-			$e = new mb_notice("using PEAR JSON");
-			return $pear->encode($anObject);
-		}
-		$e = new mb_notice("using native JSON");
-		return json_encode($anObject);
-	}
-
-	/**
-	 * Decodes a JSON string
-	 */
-	public function decode($aString) {
-		if ($this->library == JSON_PEAR) {
-			$pear = new Services_JSON();
-			$e = new mb_notice("using PEAR JSON");
-			return $pear->decode($aString);
-		}
-		$e = new mb_notice("using native JSON");
-		return json_decode($aString);
-	}
-}
+include_once(dirname(__FILE__)."/../../lib/json.php");
 ?>
\ No newline at end of file

Modified: branches/testbaudson_dev/http/classes/class_mb_exception.php
==================================================================--- \
trunk/mapbender/http/classes/class_mb_exception.php	2008-06-24 12:33:05 UTC (rev \
                2556)
+++ branches/testbaudson_dev/http/classes/class_mb_exception.php	2008-06-30 14:13:03 \
UTC (rev 2566) @@ -1,42 +1,3 @@
 <?php
-
-# $Id$
-# http://www.mapbender.org/index.php/class_mb_exception.php
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-require_once(dirname(__FILE__)."/../classes/class_mb_log.php");
-
-/**
- * Logs messages to a specified file, for example "../log/mb_error_log_<date>.log"
- *
- * @package exceptionHandling
- */
-class mb_exception extends mb_log {
-
-	/**
-	 * @param	string $message		message that is being logged
-	 */
-	public function __construct ($message) {
-		return $this->mb_log("ERROR: " . $message, $this->level);
-	}
-
-	/**
-	 * @var string a description of the log level
-	 */
-	private $level = "error";
-}
+include_once(dirname(__FILE__)."/../../lib/exception.php");
 ?>
\ No newline at end of file

Modified: branches/testbaudson_dev/http/classes/class_mb_log.php
==================================================================--- \
                trunk/mapbender/http/classes/class_mb_log.php	2008-06-24 12:33:05 UTC \
                (rev 2556)
+++ branches/testbaudson_dev/http/classes/class_mb_log.php	2008-06-30 14:13:03 UTC \
(rev 2566) @@ -1,143 +1,3 @@
 <?php
-
-# $Id$
-# http://www.mapbender.org/index.php/class_mb_exception.php
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-require_once(dirname(__FILE__)."/../classes/class_mb_notice.php");
-require_once(dirname(__FILE__)."/../classes/class_mb_warning.php");
-require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
-
-/**
- * @package exceptionHandling
- */
-abstract class mb_log {
-
-	/**
-	 * Appends a message to a given log file.
-	 *
-	 * @param	string $n		the message that is being logged.
-	 * @param	string $level	the log level of the message.
-	 * @return	bool			true if the logging succeded; else false.
-	 */
-	protected function mb_log ($n, $level) {
-		if (!isset($this->mb_log_level)) {
-			$n = "class_mb_exception: please set LOG_LEVEL in mapbender.conf" . $n;
-		}
-		if ($this->isValidLevel($level)) {
-			if (is_dir($this->dir)) {
-				$logfile = $this->dir . $this->filename_prefix . date("Y_m_d") . ".log";
-				if ($h = fopen($logfile,"a")) {
-					$content = date("Y.m.d, H:i:s") . "," . $n .chr(13).chr(10);
-					if(!fwrite($h,$content)){
-						$this->result = false;
-						$this->message = "Unable to write " . $logfile;
-						return false;
-					}
-					fclose($h);
-					$this->result = true;
-					$this->message = "Successful.";
-					return true;
-				}
-				else {
-					$this->result = false;
-					$this->message = "Unable to open or generate " . $logfile;
-					return false;
-				}
-			}
-			else {
-				$this->result = false;
-				$this->message = "Directory " . $this->dir . " is not valid.";
-				return false;
-			}
-		}
-		else {
-			$this->result = false;
-			$this->message = "Log level '" . $level . "' is not valid or logging is disabled \
                in mapbender.conf.";
-			return false;
-		}
-	}
-
-	/**
-	 * Retrieves the index of the level in the array of available levels.
-	 * By this, we can find out if the message is eligable for logging.
-	 *
-	 * @param	string $level			the log level of the message
-	 * @param	string[] $levelArray	an array of available levels
-	 * @return	mixed					false, if the level is not available; else
-	 * 									the index of the level in the log level array
-	 */
-	protected function indexOf ($level, $levelArray) {
-		$index = false;
-		for ($i=0; $i < count($levelArray); $i++) {
-			if ($levelArray[$i] == $level) {
-				$index = $i;
-			}
-		}
-		return $index;
-	}
-
-	/**
-	 * Checks if the message will be logged. Example: Log level of the message is \
                "warning",
-	 * but the log level set in
-	 * {@link http://www.mapbender.org/index.php/Mapbender.conf#Mapbender_error_logging \
                mapbender.conf}
-	 * is "off", then the message will not be logged.
-	 *
-	 * @param	string $level	the log level of the message that is being logged.
-	 * @return	bool			true if the message will be logged; else false.
-	 */
-	protected function isValidLevel ($level) {
-		$log_level_array = explode(",", $this->log_levels);
-		$isValid = in_array($level, $log_level_array);
-		$isAppropriate = ($this->indexOf($level, $log_level_array) <= \
                $this->indexOf($this->mb_log_level, $log_level_array));
-		return $isValid && $isAppropriate;
-	}
-
-	/**
-	 * @var	string	a comma-separated list of available log levels, see
-	 * 				{@link http://www.mapbender.org/index.php/Mapbender.conf#Mapbender_error_logging \
                mapbender.conf}.
-	 */
-	protected $log_levels = LOG_LEVEL_LIST;
-
-	/**
-	 * @var	string	the selected log level, see
-	 * 				{@link http://www.mapbender.org/index.php/Mapbender.conf#Mapbender_error_logging \
                mapbender.conf}.
-	 */
-	protected $mb_log_level = LOG_LEVEL;
-
-	/**
-	 * @var	string	the path to the log directory
-	 */
-	protected $dir = "../../log/";
-
-	/**
-	 * @var	string	the prefix of the logs' file name
-	 */
-	protected $filename_prefix = "mb_error_";
-
-	/**
-	 * @var	bool	true if the logging succeeded; else false.
-	 */
-	public $result = false;
-
-	/**
-	 * @var	string	if the logging did not succeed, this contains an error message.
-	 */
-	public $message = "";
-}
+include_once(dirname(__FILE__)."/../../lib/log.php");
 ?>
\ No newline at end of file

Modified: branches/testbaudson_dev/http/classes/class_mb_notice.php
==================================================================--- \
                trunk/mapbender/http/classes/class_mb_notice.php	2008-06-24 12:33:05 \
                UTC (rev 2556)
+++ branches/testbaudson_dev/http/classes/class_mb_notice.php	2008-06-30 14:13:03 UTC \
(rev 2566) @@ -1,40 +1,3 @@
 <?php
-
-# $Id$
-# http://www.mapbender.org/index.php/class_mb_exception.php
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-require_once(dirname(__FILE__)."/../classes/class_mb_log.php");
-
-/**
- * @package exceptionHandling
- */
-class mb_notice extends mb_log {
-
-	/**
-	 * @param	string $message		message that is being logged
-	 */
-	public function __construct ($message) {
-		return $this->mb_log("Notice: " . $message, $this->level);
-	}
-
-	/**
-	 * @var string a description of the log level
-	 */
-	private $level = "notice";
-}
+include_once(dirname(__FILE__)."/../../lib/notice.php");
 ?>
\ No newline at end of file

Modified: branches/testbaudson_dev/http/classes/class_mb_warning.php
==================================================================--- \
                trunk/mapbender/http/classes/class_mb_warning.php	2008-06-24 12:33:05 \
                UTC (rev 2556)
+++ branches/testbaudson_dev/http/classes/class_mb_warning.php	2008-06-30 14:13:03 \
UTC (rev 2566) @@ -1,40 +1,3 @@
 <?php
-
-# $Id$
-# http://www.mapbender.org/index.php/class_mb_exception.php
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-require_once(dirname(__FILE__)."/../classes/class_mb_log.php");
-
-/**
- * @package exceptionHandling
- */
-class mb_warning extends mb_log {
-
-	/**
-	 * @param	string $message		message that is being logged
-	 */
-	public function __construct ($message) {
-		return $this->mb_log("Warning: " . $message, $this->level);
-	}
-
-	/**
-	 * @var string a description of the log level
-	 */
-	private $level = "warning";
-}
+include_once(dirname(__FILE__)."/../../lib/warning.php");
 ?>
\ No newline at end of file

Modified: branches/testbaudson_dev/http/classes/class_user.php
==================================================================--- \
                trunk/mapbender/http/classes/class_user.php	2008-06-24 12:33:05 UTC \
                (rev 2556)
+++ branches/testbaudson_dev/http/classes/class_user.php	2008-06-30 14:13:03 UTC (rev \
2566) @@ -1,159 +1,3 @@
 <?php
-# $Id: class_kml_geometry.php 1966 2008-01-15 08:25:15Z christoph $
-# http://www.mapbender.org/index.php/class_wmc.php
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
-
-/**
- * A Mapbender user as described in the table mb_user.
- */
-class User {
-	/**
-	 * @var Integer The user ID
-	 */
-	var $id;
-
-	/**
-	 * Constructor
-	 * @param $userId Integer 	the ID of the user that	is represented by
-	 * 							this object.
-	 */
-	public function __construct ($userId) {
-		$this->id = $userId;
-	}
-
-	/**
-	 * @return String the ID of this user
-	 */
-	public function __toString () {
-		return (string) $this->id;
-	}
-
-	/**
-	 * Returns an array of application IDs that the user is allowed to access.
-	 *
-	 * @return Array an array of application IDs
-	 * @param $ignorepublic boolean whether or not to ignore
-	 * 								public applications (?)
-	 */
-	public function getApplicationsByPermission ($ignorepublic) {
-		$mb_user_id = $this->id;
-		$arrayGuis = array();
-		$mb_user_groups = array();
-		$sql_groups = "SELECT fkey_mb_group_id FROM mb_user_mb_group WHERE fkey_mb_user_id \
                = $1 ";
-		$v = array($mb_user_id);
-		$t = array("i");
-		$res_groups = db_prep_query($sql_groups,$v,$t);
-		$cnt_groups = 0;
-		while($row = db_fetch_array($res_groups)){
-			$mb_user_groups[$cnt_groups] = $row["fkey_mb_group_id"];
-			$cnt_groups++;
-		}
-		if($cnt_groups > 0){
-			$v = array();
-			$t = array();
-			$sql_g = "SELECT gui.gui_id FROM gui JOIN gui_mb_group ";
-			$sql_g .= " ON gui.gui_id = gui_mb_group.fkey_gui_id WHERE \
                gui_mb_group.fkey_mb_group_id IN (";
-			for($i=0; $i<count($mb_user_groups);$i++){
-				if($i > 0){$sql_g .= ",";}
-				$sql_g .= "$".strval($i+1);
-				array_push($v,$mb_user_groups[$i]);
-				array_push($t,"i");
-			}
-			$sql_g .= ") GROUP BY gui.gui_id";
-			$res_g = db_prep_query($sql_g,$v,$t);
-			while($row = db_fetch_array($res_g)){
-				array_push($arrayGuis,$row["gui_id"]);
-			}
-		}
-		$sql_guis = "SELECT gui.gui_id FROM gui JOIN gui_mb_user ON gui.gui_id = \
                gui_mb_user.fkey_gui_id";
-		$sql_guis .= " WHERE (gui_mb_user.fkey_mb_user_id = $1) ";
-		if (!isset($ignore_public) OR $ignore_public== false){
-			$sql_guis .= " AND gui.gui_public = 1 ";
-		}
-		$sql_guis .= " GROUP BY gui.gui_id";
-		$v = array($mb_user_id);
-		$t = array("i");
-		$res_guis = db_prep_query($sql_guis,$v,$t);
-		$guis = array();
-		while($row = db_fetch_array($res_guis)){
-			if(!in_array($row['gui_id'],$arrayGuis)){
-				array_push($arrayGuis,$row["gui_id"]);
-			}
-		}
-		return $arrayGuis;
-	}
-
-	/** identifies the IDs of WFS confs where the user is owner
-	 *
-	 * @param integer userid the user-ID of the current user
-	 * @return integer[] the IDs of the wfs_conf-table
-	 */
-	public function getWfsConfByPermission(){
-		$userid = $this->id;
-	 	$guisByPer = array();
-//	 	1.
-		$adm = new administration();
-	 	$guisByPer = $adm->getGuisByPermission($userid, true);
-//	 	2.
-		$ownWFSconfs = array();
-		if(count($guisByPer)>0){
-			$v = array();
-			$t = array();
-			$sql = "SELECT wfs_conf.wfs_conf_id  FROM gui_wfs_conf, wfs_conf " .
-					"where wfs_conf.wfs_conf_id = gui_wfs_conf.fkey_wfs_conf_id " .
-					"and gui_wfs_conf.fkey_gui_id IN(";
-			for($i=0; $i<count($guisByPer); $i++){
-				if($i>0){ $sql .= ",";}
-				$sql .= "$".strval($i+1);
-
-				array_push($v, $guisByPer[$i]);
-				array_push($t, "s");
-			}
-			$sql .= ") GROUP BY wfs_conf.wfs_conf_id ORDER BY wfs_conf.wfs_conf_id";
-
-			$res = db_prep_query($sql,$v,$t);
-			$i=0;
-			while($row = db_fetch_array($res)){
-				$ownWFSconfs[$i] = $row['wfs_conf_id'];
-				$i++;
-			}
-		}
-		return $ownWFSconfs;
-	}
-
-	/**
-	 * Returns all WMCs that this user owns
-	 *
-	 * @return integer[] an array of WMC ids; ids from table mb_user_wmc
-	 */
-	public function getWmcByOwner () {
-		$sql = "SELECT wmc_id FROM mb_user_wmc ";
-		$sql .= "WHERE fkey_user_id = $1 GROUP BY wmc_id";
-		$v = array($this->id);
-		$t = array("i");
-		$res_wmc = db_prep_query($sql, $v, $t);
-
-  		$wmcArray = array();
-		while($row = db_fetch_array($res_wmc)){
-			array_push($wmcArray, $row["wmc_id"]);
-		}
-		return $wmcArray;
-	}
-}
+include_once(dirname(__FILE__)."/../../lib/user.php");
 ?>
\ No newline at end of file

Modified: branches/testbaudson_dev/http/classes/class_wmc.php
==================================================================--- \
                trunk/mapbender/http/classes/class_wmc.php	2008-06-24 12:33:05 UTC \
                (rev 2556)
+++ branches/testbaudson_dev/http/classes/class_wmc.php	2008-06-30 14:13:03 UTC (rev \
2566) @@ -379,7 +379,7 @@
 			array_push($wmcJsArray, "setMapRequest('" . $this->overviewMap->getFrameName() . \
"');");  }

-		array_push($wmcJsArray, "eventAfterLoadWMS.trigger()");
+		array_push($wmcJsArray, "eventAfterLoadWMS.trigger();");
 		return $wmcJsArray;
 	}

@@ -1010,4 +1010,4 @@
 	if(CHARSET=="UTF-8") return utf8_decode($str);
 	return $str;
 }
-?>
\ No newline at end of file
+?>

Modified: branches/testbaudson_dev/http/classes/class_wms.php
==================================================================--- \
                trunk/mapbender/http/classes/class_wms.php	2008-06-24 12:33:05 UTC \
                (rev 2556)
+++ branches/testbaudson_dev/http/classes/class_wms.php	2008-06-30 14:13:03 UTC (rev \
2566) @@ -1,2026 +1,3 @@
 <?php
-# $Id$
-# http://www.mapbender.org/index.php/class_wms
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-include_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-require_once(dirname(__FILE__)."/class_connector.php");
-require_once(dirname(__FILE__)."/class_user.php");
-require_once(dirname(__FILE__)."/class_mb_exception.php");
-require_once(dirname(__FILE__)."/class_administration.php");
-
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
-
-class wms {
-	var $lastURL;
-	var $wms_id;
-	var $wms_status;
-	var $wms_version;
-	var $wms_title;
-	var $wms_abstract;
-	var $wms_getcapabilities;
-	var $wms_getcapabilities_doc;
-	var $wms_getmap;
-	var $wms_getfeatureinfo;
-	var $wms_getlegendurl;
-	var $wms_upload_url;
-
-	var $fees;
-	var $accessconstraints;
-	var $contactperson;
-	var $contactposition;
-	var $contactorganization;
-	var $address;
-	var $city;
-	var $stateorprovince;
-	var $postcode;
-	var $country;
-	var $contactvoicetelephone;
-	var $contactfacsimiletelephone;
-	var $contactelectronicmailaddress;
-
-	var $wms_keyword = array();
-	var $data_type = array();
-	var $data_format = array();
-	var $objLayer = array();
-
-	var $wms_supportsld;
-	var $wms_userlayer;
-	var $wms_userstyle;
-	var $wms_remotewfs;
-
-	var $gui_wms_mapformat;
-	var $gui_wms_featureinfoformat;
-	var $gui_wms_exceptionformat;
-	var $gui_wms_epsg;
-	var $gui_wms_sldurl;
-
-	var $default_epsg = 0;
-	var $overwrite = true;
-
-	function wms() {
-	}
-
-	function createOlObjFromWMS($base){
-	 	if(!$this->wms_title || $this->wms_title == ""){
-			echo "alert('Error: no valid capabilities-document !!');";
-			die; exit;
-		}
-		// wms_title and abstract have previously been urlencoded
-		// this solution may not yet be the ultimate one
-
-		$add_wms_string = "var wms_".$this->wms_id." = new OpenLayers.Layer.WMS.Untiled(" \
                .
-				"'" . addslashes($this->wms_title) . "'," .
-				"'" . $this->wms_getmap ."'," ."{layers:'";
-				for($i=1;$i<count($this->objLayer);$i++){
-					$add_wms_string .= addslashes($this->objLayer[$i]->layer_name);
-					if($i!=count($this->objLayer)-1)
-						$add_wms_string .= ",";
-				}
-				$add_wms_string .= "', transparent: 'true'";
-				$add_wms_string .= ",format: '".$this->gui_wms_mapformat."'});\n";
-				if($base)
-					$add_wms_string .= 	"wms_".$this->wms_id.".isBaseLayer=true;\n";
-				$add_wms_string .= \
"wms_".$this->wms_id.".setVisibility(".($this->gui_wms_visible=="1"?"true":"false").");\n";
                
-				$add_wms_string .= "ol_map.addLayer(wms_".$this->wms_id.");\n";
-		echo $add_wms_string;
-	}
-
-	/**
-	 * Compares this WMS to another WMS.
-	 *
-	 * @return boolean false, if
-	 * 					- the capabilities URLs don't match
-	 * 					- the layer count is different
-	 * 					- the layer names are different
-	 *
-	 * @param $anotherWms wms this is just another WMS object
-	 */
-	public function equals ($anotherWms) {
-		// If the getMap URLs are not equal, the WMS are not equal.
-		if ($this->wms_getmap != $anotherWms->wms_getmap) {
-//			$e = new mb_notice($this . " != " . $anotherWms . " (getMap URL)");
-			return false;
-		}
-
-		// If the layer count is different, the WMS are not equal.
-		if (count($this->objLayer) != count($anotherWms->objLayer)) {
-//			$e = new mb_notice($this . " != " . $anotherWms . " (layer count: " . \
                count($this->objLayer) . ":" . count($anotherWms->objLayer). ")");
-			return false;
-		}
-
-		// If the layer names are different, the WMS are not equal.
-		for ($i = 0; $i < count($this->objLayer); $i++) {
-			$name1 = $this->objLayer[$i]->layer_name;
-			$name2 = $anotherWms->objLayer[$i]->layer_name;
-
-			if ($name1 != $name2) {
-//				$e = new mb_notice($this . " != " . $anotherWms . " (layer names, " . $name1 . \
                " vs. " . $name2 . ")");
-				return false;
-			}
-		}
-//		$e = new mb_notice($this . " == " . $anotherWms);
-		return true;
-	}
-
-	/**
-	 * The other WMS must be the same as this WMS, but with different
-	 * application settings. These application settings are copied,
-	 * the local settings are overwritten.
-	 *
-	 * @return boolean true if the settings could be copied; false
-	 * 					when an error occured.
-	 * @param $anotherWms wms The same WMS with possibly other settings
-	 */
-/*
-	public function copyConfiguration ($anotherWms) {
-		if (!$this->equals($anotherWms)) {
-			$e = new mb_exception("class_wms.php: copyConfiguration(): parameters cannot be \
                copied, it's a different WMS.");
-			return false;
-		}
-		for ($i = 0; $i < count($this->objLayer); $i++) {
-			$myCurrentLayer = $this->objLayer[$i];
-			$theirCurrentLayer = $anotherWms->objLayer[$i];
-
-			$myCurrentLayer->gui_layer_selectable = $theirCurrentLayer->gui_layer_selectable;
-			$myCurrentLayer->gui_layer_visible    = $theirCurrentLayer->gui_layer_visible;
-			$myCurrentLayer->gui_layer_queryable  = $theirCurrentLayer->gui_layer_queryable;
-			$myCurrentLayer->gui_layer_querylayer = $theirCurrentLayer->gui_layer_querylayer;
-			$myCurrentLayer->gui_layer_style      = $theirCurrentLayer->gui_layer_style;
-		}
-	}
-*/
-
-	/**
-	 * Removes duplicate WMS from an array of WMS. To find duplicates,
-	 * two WMS are compared via equals().
-	 *
-	 * @return wms[]
-	 * @param $wmsArray wms[]
-	 */
-	public static function merge ($wmsArray) {
-		$e = new mb_notice("before: " . implode(", ", $wmsArray));
-		if (!is_array($wmsArray)) {
-			$e = new mb_exception("class_wms.php: merge(): parameter is NOT an array.");
-			return array();
-		}
-		if (count($wmsArray) == 0) {
-			$e = new mb_exception("class_wms.php: merge(): parameter is an EMPTY array.");
-			return array();
-		}
-
-		$newWmsArray = array();
-
-		while (count($wmsArray) > 0) {
-			$currentWms = array_pop($wmsArray);
-
-			$isNewWms = true;
-
-			if (get_class($currentWms) != "wms") {
-				$e = new mb_exception("class_wms.php: merge(): current WMS is not a WMS object, \
                but a " . get_class($currentWms));
-			}
-			else {
-				for ($i = 0; $i < count($newWmsArray) && $isNewWms; $i++) {
-					if ($currentWms->equals($newWmsArray[$i])) {
-						$isNewWms = false;
-					}
-				}
-				if ($isNewWms) {
-//					$e = new mb_notice("adding WMS " . $currentWms);
-					array_push($newWmsArray, $currentWms);
-				}
-			}
-		}
-		// reversal of the array, because the elements were popped
-		// from another array before.
-//		$e = new mb_notice("after: " . implode(", ", array_reverse($newWmsArray)));
-		return array_reverse($newWmsArray);
-	}
-
-	public function __toString () {
-		return $this->wms_title;
-	}
-
-	function createObjFromXML($url){
-
-		$x = new connector($url);
-		$data = $x->file;
-
-		if(!$data){
-			$this->wms_status = false;
-			return false;
-		}
-		else {
-			$this->wms_status = true;
-		}
-
-		$values = null;
-		$tags = null;
-		$admin = new administration();
-		$this->wms_getcapabilities_doc = $admin->char_encode($data);
-		$this->wms_upload_url = $url;
-
-		$this->wms_id = "";
-		$parser = xml_parser_create("");
-		xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
-		xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1);
-		xml_parser_set_option($parser,XML_OPTION_TARGET_ENCODING,CHARSET);
-		xml_parse_into_struct($parser,$this->wms_getcapabilities_doc,$values,$tags);
-
-		$code = xml_get_error_code($parser);
-		if ($code) {
-			$line = xml_get_current_line_number($parser);
-			$mb_exception = new mb_exception(xml_error_string($code) .  " in line " . $line);
-		}
-
-		xml_parser_free($parser);
-
-		$section = null;
-		$format = null;
-		$cnt_format = 0;
-		$parent = array();
-		$myParent = array();
-		$cnt_layer = -1;
-		$request = null;
-		$layer_style = array();
-		$cnt_styles = -1;
-
-		foreach ($values as $element) {
-			if(mb_strtoupper($element[tag]) == "WMT_MS_CAPABILITIES" && $element[type] == \
                "open"){
-				$this->wms_version = $element[attributes][version];
-			}
-			if(mb_strtoupper($element[tag]) == "TITLE" && $element[level] == '3'){
-				$this->wms_title = $this->stripEndlineAndCarriageReturn($element[value]);
-			}
-			if(mb_strtoupper($element[tag]) == "ABSTRACT" && $element[level] == '3'){
-				$this->wms_abstract = $this->stripEndlineAndCarriageReturn($element[value]);
-			}
-			if(mb_strtolower($element[tag]) == "fees"){
-				$this->fees = $element[value];
-			}
-			if(mb_strtolower($element[tag]) == "accessconstraints"){
-				$this->accessconstraints = $element[value];
-			}
-			if(mb_strtolower($element[tag]) == "contactperson"){
-				$this->contactperson = $element[value];
-			}
-			if(mb_strtolower($element[tag]) == "contactposition"){
-				$this->contactposition = $element[value];
-			}
-			if(mb_strtolower($element[tag]) == "contactorganization"){
-				$this->contactorganization = $element[value];
-			}
-			if(mb_strtolower($element[tag]) == "address"){
-				$this->address = $element[value];
-			}
-			if(mb_strtolower($element[tag]) == "city"){
-				$this->city = $element[value];
-			}
-			if(mb_strtolower($element[tag]) == "stateorprovince"){
-				$this->stateorprovince = $element[value];
-			}
-			if(mb_strtolower($element[tag]) == "postcode"){
-				$this->postcode = $element[value];
-			}
-			if(mb_strtolower($element[tag]) == "country"){
-				$this->country = $element[value];
-			}
-			if(mb_strtolower($element[tag]) == "contactvoicetelephone"){
-				$this->contactvoicetelephone = $element[value];
-			}
-			if(mb_strtolower($element[tag]) == "contactfacsimiletelephone"){
-				$this->contactfacsimiletelephone = $element[value];
-			}
-			if(mb_strtolower($element[tag]) == "contactelectronicmailaddress"){
-				$this->contactelectronicmailaddress = $element[value];
-			}
-	  		if(mb_strtolower($element[tag]) == "keyword" && $section != 'layer'){
-				$this->wms_keyword[count($this->wms_keyword)] = $element[value];
-			}
-
-			/*map section*/
-			if($this->wms_version == "1.0.0"){
-		 		if(mb_strtoupper($element[tag]) == "MAP" && $element[type] == "open"){
-					$section = "map";
-				}
-				if($section == "map" && mb_strtoupper($element[tag]) == "GET"){
-					$this->wms_getmap = $element[attributes][onlineResource];
-				}
-				if($section == "map" && mb_strtoupper($element[tag]) == "FORMAT" && \
                $element[type] == "open"){
-					$format = "map";
-				}
-				if(mb_strtoupper($element[tag]) != "FORMAT" && $section == "map" && $format == \
                "map"){
-					$this->data_type[$cnt_format] = "map";
-					$this->data_format[$cnt_format] = trim($element[tag]);
-					$cnt_format++;
-				}
-				if(mb_strtoupper($element[tag]) == "FORMAT" && $element[type] == "close"){
-					$format = "";
-				}
-				if(mb_strtoupper($element[tag]) == "MAP" && $element[type] == "close"){
-					$section = "";
-				}
-			}
-			else{
-				if(mb_strtoupper($element[tag]) == "GETMAP" && $element[type] == "open"){
-					$section = "map";
-				}
-				if($section == "map" && mb_strtoupper($element[tag]) == "GET" && $element[type] \
                == "open"){
-					$request = "get";
-				}
-				if($section == "map" && $request == "get" && mb_strtoupper($element[tag]) == \
                "ONLINERESOURCE"){
-					$this->wms_getmap = $element[attributes]["xlink:href"];
-				}
-				if($section == "map" && mb_strtoupper($element[tag]) == "FORMAT"){
-					$this->data_type[$cnt_format] = "map";
-					$this->data_format[$cnt_format] = trim($element[value]);
-					$cnt_format++;
-				}
-				if($section == "map" && mb_strtoupper($element[tag]) == "GET" && $element[type] \
                == "close"){
-					$request = "";
-				}
-				if(mb_strtoupper($element[tag]) == "GETMAP" && $element[type] == "close"){
-					$section = "";
-				}
-			}
-			/*capabilities section*/
-			if($this->wms_version == "1.0.0"){
-				if(mb_strtoupper($element[tag]) == "CAPABILITIES" && $element[type] == "open"){
-					$section = "capabilities";
-				}
-				if($section == "capabilities" && mb_strtoupper($element[tag]) == "GET"){
-					$this->wms_getcapabilities = $element[attributes][onlineResource];
-				}
-				if(mb_strtoupper($element[tag]) == "CAPABILITIES" && $element[type] == "close"){
-					$section = "";
-				}
-			}
-			else{
-				if(mb_strtoupper($element[tag]) == "GETCAPABILITIES" && $element[type] == \
                "open"){
-					$section = "capabilities";
-				}
-				if($section == "capabilities" && mb_strtoupper($element[tag]) == "GET" && \
                $element[type] == "open"){
-					$request = "get";
-				}
-				if($section == "capabilities" && $request == "get" && \
                mb_strtoupper($element[tag]) == "ONLINERESOURCE"){
-					$this->wms_getcapabilities = $element[attributes]["xlink:href"];
-				}
-				if($section == "capabilities" && mb_strtoupper($element[tag]) == "GET" && \
                $element[type] == "close"){
-					$request = "";
-				}
-				if(mb_strtoupper($element[tag]) == "GETCAPABILITIES" && $element[type] == \
                "close"){
-					$section = "";
-				}
-			}
-			/*featureInfo section*/
-			if($this->wms_version == "1.0.0"){
-				if(mb_strtoupper($element[tag]) == "FEATUREINFO" && $element[type] == "open"){
-					$section = "featureinfo";
-				}
-				if($section == "featureinfo" && mb_strtoupper($element[tag]) == "GET"){
-					$this->wms_getfeatureinfo = $element[attributes][onlineResource];
-				}
-				if($section == "featureinfo" && mb_strtoupper($element[tag]) == "FORMAT" && \
                $element[type] == "open"){
-					$format = "featureinfo";
-				}
-				if(mb_strtoupper($element[tag]) != "FORMAT" && $section == "featureinfo" && \
                $format == "featureinfo"){
-					$this->data_type[$cnt_format] = "featureinfo";
-					$this->data_format[$cnt_format] = trim($element[tag]);
-					$cnt_format++;
-				}
-				if(mb_strtoupper($element[tag]) == "FORMAT" && $element[type] == "close"){
-					$format = "";
-				}
-				if(mb_strtoupper($element[tag]) == "FEATUREINFO" && $element[type] == "close"){
-					$section = "";
-				}
-			}
-			else{
-				if(mb_strtoupper($element[tag]) == "GETFEATUREINFO" && $element[type] == \
                "open"){
-					$section = "featureinfo";
-				}
-				if($section == "featureinfo" && mb_strtoupper($element[tag]) == "GET" && \
                $element[type] == "open"){
-					$request = "get";
-				}
-				if($section == "featureinfo" && $request == "get" && \
                mb_strtoupper($element[tag]) == "ONLINERESOURCE"){
-					$this->wms_getfeatureinfo = $element[attributes]["xlink:href"];
-				}
-				if($section == "featureinfo" && mb_strtoupper($element[tag]) == "FORMAT"){
-					$this->data_type[$cnt_format] = "featureinfo";
-					$this->data_format[$cnt_format] = trim($element[value]);
-					$cnt_format++;
-				}
-				if($section == "featureinfo" && mb_strtoupper($element[tag]) == "GET" && \
                $element[type] == "close"){
-					$request = "";
-				}
-				if(mb_strtoupper($element[tag]) == "GETFEATUREINFO" && $element[type] == \
                "close"){
-					$section = "";
-				}
-			}
-			/*exception section*/
-			if($this->wms_version == "1.0.0"){
-				if(mb_strtoupper($element[tag]) == "EXCEPTION" && $element[type] == "open"){
-					$section = "exception";
-				}
-				if($section == "exception" && mb_strtoupper($element[tag]) == "FORMAT" && \
                $element[type] == "open"){
-					$format = "exception";
-				}
-				if(mb_strtoupper($element[tag]) != "FORMAT" && $section == "exception" && \
                $format == "exception"){
-					$this->data_type[$cnt_format] = "exception";
-					$this->data_format[$cnt_format] = trim($element[tag]);
-					$cnt_format++;
-				}
-				if($section == "exception" && mb_strtoupper($element[tag]) == "FORMAT" && \
                $element[type] == "close"){
-					$format = "";
-				}
-				if(mb_strtoupper($element[tag]) == "EXCEPTION" && $element[type] == "close"){
-					$section = "";
-				}
-			}
-			else{
-				if(mb_strtoupper($element[tag]) == "EXCEPTION" && $element[type] == "open"){
-					$section = "exception";
-				}
-				if($section == "exception" && mb_strtoupper($element[tag]) == "FORMAT"){
-					$this->data_type[$cnt_format] = "exception";
-					$this->data_format[$cnt_format] = trim($element[value]);
-					$cnt_format++;
-				}
-				if(mb_strtoupper($element[tag]) == "EXCEPTION" && $element[type] == "close"){
-					$section = "";
-				}
-			}
-	      /*legend section*/
-	      if($this->wms_version == "1.0.0"){
-
-	      }
-	      else{
-	        if(mb_strtoupper($element[tag]) == "GETLEGENDGRAPHIC" && $element[type] == \
                "open"){
-				$section = "legend";
-			}
-	        if($section == "legend" && mb_strtoupper($element[tag]) == "GET" && \
                $element[type] == "open"){
-				$request = "get";
-			}
-			if($section == "legend" && $request == "get" && mb_strtoupper($element[tag]) == \
                "ONLINERESOURCE"){
-				$this->wms_getlegendurl = $element[attributes]["xlink:href"];
-			}
-	        if($section == "legend" && mb_strtoupper($element[tag]) == "GET" && \
                $element[type] == "close"){
-				$request = "";
-			}
-			if(mb_strtoupper($element[tag]) == "GETLEGENDGRAPHIC" && $element[type] == \
                "close"){
-				$section = "";
-			}
-	      }
-			/* sld section */
-			if(mb_strtoupper($element[tag]) == "USERDEFINEDSYMBOLIZATION" && $element[type] \
                == "complete"){
-				$this->wms_supportsld = $element[attributes]["SupportSLD"];
-				$this->wms_userlayer = $element[attributes]["UserLayer"];
-				$this->wms_userstyle = $element[attributes]["UserStyle"];
-				$this->wms_remotewfs = $element[attributes]["RemoteWFS"];
-			}
-
-			/*layer section*/
-			if(mb_strtoupper($element[tag]) == "LAYER"){
-				$section = "layer";
-				if ($element[type] == "open") {
-					$cnt_epsg = -1;
-					$cnt_layer++;
-					$parent[$element[level]+1] = $cnt_layer;
-					$myParent[$cnt_layer]= $parent[$element[level]];
-					$this->addLayer($cnt_layer,$myParent[$cnt_layer]);
-					$this->objLayer[$cnt_layer]->layer_queryable = $element[attributes][queryable];
-				}
-				if ($element[type] == "close") {
-
-				}
-			}
-			/* attribution */
-			if(mb_strtoupper($element[tag]) == "ATTRIBUTION"){
-				if ($element[type] == "open") {
-					$section = "attribution";
-				}
-				if ($element[type] == "close") {
-					$section = "layer";
-				}
-			}
-			/* styles */
-			if(mb_strtoupper($element[tag]) == "STYLE"){
-				$section = "style";
-				if($cnt_layer != $layer_style){
-					$layer_style = $cnt_layer;
-					$cnt_styles = -1;
-				}
-				if ($element[type] == "open") {
-					$cnt_styles++;
-				}
-				if ($element[type] == "close") {
-					$section = "layer";
-				}
-			}
-			if($section == "style"){
-				if(mb_strtoupper($element[tag]) == "NAME"){
-					$this->objLayer[$cnt_layer]->layer_style[$cnt_styles]["name"] = \
                $element[value];
-				}
-				if(mb_strtoupper($element[tag]) == "TITLE"){
-					$this->objLayer[$cnt_layer]->layer_style[$cnt_styles]["title"] = \
                $element[value];
-				}
-	      		if(mb_strtoupper($element[tag]) == "LEGENDURL" && $element[type] == \
                "open"){
-					$legendurl = true;
-				}
-				if($legendurl && mb_strtoupper($element[tag]) == "FORMAT"){
-					$this->objLayer[$cnt_layer]->layer_style[$cnt_styles]["legendurlformat"] = \
                $element[value];
-				}
-				if($legendurl && mb_strtoupper($element[tag]) == "ONLINERESOURCE"){
-					$this->objLayer[$cnt_layer]->layer_style[$cnt_styles]["legendurl"] = \
                $element[attributes]["xlink:href"];
-				}
-			    if(mb_strtoupper($element[tag]) == "LEGENDURL" && $element[type] == "close"){
-					$legendurl = false;
-				}
-			}
-			/* end of styles */
-			if($section == "layer"){
-				if(mb_strtoupper($element[tag]) == "NAME"){
-					$this->objLayer[$cnt_layer]->layer_name = $element[value];
-				}
-				if(mb_strtoupper($element[tag]) == "TITLE"){
-					$this->objLayer[$cnt_layer]->layer_title = \
                $this->stripEndlineAndCarriageReturn($element[value]);
-				}
-				if(mb_strtoupper($element[tag]) == "ABSTRACT"){
-					$this->objLayer[$cnt_layer]->layer_abstract = \
                $this->stripEndlineAndCarriageReturn($element[value]);
-				}
-				if(mb_strtoupper($element[tag]) == "KEYWORD"){
-					array_push($this->objLayer[$cnt_layer]->layer_keyword, trim($element[value]));
-				}
-	      		if(mb_strtoupper($element[tag]) == "DATAURL" && $element[type] == "open"){
-					$dataurl = true;
-				}
-				if($dataurl && mb_strtoupper($element[tag]) == "ONLINERESOURCE"){
-					$this->objLayer[$cnt_layer]->layer_dataurl_href = \
                $element[attributes]["xlink:href"];
-				}
-			    if(mb_strtoupper($element[tag]) == "DATAURL" && $element[type] == "close"){
-					$dataurl = false;
-				}
-
-				if(mb_strtoupper($element[tag]) == "METADATAURL" && $element[type] == "open"){
-					$metadataurl = true;
-				}
-				if($metadataurl && mb_strtoupper($element[tag]) == "ONLINERESOURCE"){
-					$this->objLayer[$cnt_layer]->layer_metadataurl = \
                $element[attributes]["xlink:href"];
-				}
-			    if(mb_strtoupper($element[tag]) == "METADATAURL" && $element[type] == \
                "close"){
-					$metadataurl = false;
-				}
-
-				if(mb_strtoupper($element[tag]) == "SRS"){
-	  				$this->objLayer[$cnt_layer]->wms_srs1 = $element[value];
-					// unique srs only, see \
                http://www.mapbender.org/index.php/Arrays_with_unique_entries
-					$this->wms_srs = array_keys(array_flip(explode(" ", \
                $this->objLayer[0]->wms_srs1)));
-				}
-				if(mb_strtoupper($element[tag]) == "LATLONBOUNDINGBOX"){
-					$cnt_epsg++;
-					$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["epsg"] = "EPSG:4326";
-					$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["minx"] = \
                $element[attributes][minx];
-					$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["miny"] = \
                $element[attributes][miny];
-					$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxx"] = \
                $element[attributes][maxx];
-					$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxy"] = \
                $element[attributes][maxy];
-				}
-				if(mb_strtoupper($element[tag]) == "BOUNDINGBOX" && $element[attributes][SRS] != \
                "EPSG:4326"){
-					$cnt_epsg++;
-					$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["epsg"] = \
                $element[attributes][SRS];
-					$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["minx"] = \
                $element[attributes][minx];
-					$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["miny"] = \
                $element[attributes][miny];
-					$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxx"] = \
                $element[attributes][maxx];
-					$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxy"] = \
                $element[attributes][maxy];
-					// a default epsg for mapbender
-					if($cnt_layer == 0 && $this->default_epsg == 0 && \
                mb_strlen(trim($element[attributes][SRS]))>= 10){
-						$this->default_epsg = $cnt_epsg;
-					}
-				}
-				if(mb_strtoupper($element[tag]) == "SCALEHINT"){
-					if($element[attributes][max]>1000) $max = 0; else $max = \
                $element[attributes][max];
-					if($element[attributes][min]>1000) $min = 0; else $min = \
                $element[attributes][min];
-					$this->objLayer[$cnt_layer]->layer_minscale = round(($min * \
                2004.3976484406788493955738891127));
-					$this->objLayer[$cnt_layer]->layer_maxscale = round(($max * \
                2004.3976484406788493955738891127));
-				}
-			}
-			else {
-				continue;
-			}
-		}
-		if(!$this->wms_title || $this->wms_title == "" || !$this->wms_getmap || \
                $this->wms_getmap == ""){
-			$this->wms_status = false;
-			$this->optimizeWMS();
-
-			return false;
-		}
-		else{
-			$this->wms_status = true;
-			$this->optimizeWMS();
-
-			return true;
-		}
-	}
-	/**
-	 * private function
-	 */
-	function optimizeWMS() {
-		/*define defaults for wms-version 1.0.0*/
-		$map_default_ok = false;
-		$featureinfo_default_ok = false;
-		$exception_default_ok = false;
-		if($this->wms_version == "1.0.0"){
-			$map_default = "PNG";
-			$featureinfo_default = "MIME";
-			$exception_default = "INIMAGE";
-		}
-		/*define defaults for wms-version 1.1.0 and 1.1.1*/
-		else{
-			$map_default = "image/png";
-			$featureinfo_default = "text/html";
-			$exception_default = "application/vnd.ogc.se_inimage";
-		}
-		#some default
-		$this->gui_wms_visible = 1;
-		$this->gui_wms_opacity = 100;
-		/*if the rootlayer has no epsg...*/
-		if($this->objLayer[0]->layer_epsg[0]["epsg"] == ""){
-			$this->objLayer[0]->layer_epsg = $this->objLayer[1]->layer_epsg;
-			for($i=0;$i<count($this->objLayer[0]->layer_epsg);$i++){
-				for($j=1; $j<count($this->objLayer); $j++){
-					if($this->objLayer[0]->layer_epsg[$i]["epsg"] == \
                $this->objLayer[$j]->layer_epsg[$i]["epsg"]){
-						if($this->objLayer[$j]->layer_epsg[$i]["minx"]<$this->objLayer[0]->layer_epsg[$i]["minx"]){
                
-							$this->objLayer[0]->layer_epsg[$i]["minx"] = \
                $this->objLayer[$j]->layer_epsg[$i]["minx"];
-						}
-						if($this->objLayer[$j]->layer_epsg[$i]["miny"]<$this->objLayer[0]->layer_epsg[$i]["miny"]){
                
-							$this->objLayer[0]->layer_epsg[$i]["miny"] = \
                $this->objLayer[$j]->layer_epsg[$i]["miny"];
-						}
-						if($this->objLayer[$j]->layer_epsg[$i]["maxx"]>$this->objLayer[0]->layer_epsg[$i]["maxx"]){
                
-							$this->objLayer[0]->layer_epsg[$i]["maxx"] = \
                $this->objLayer[$j]->layer_epsg[$i]["maxx"];
-						}
-						if($this->objLayer[$j]->layer_epsg[$i]["maxy"]>$this->objLayer[0]->layer_epsg[$i]["maxy"]){
                
-							$this->objLayer[0]->layer_epsg[$i]["maxy"] = \
                $this->objLayer[$j]->layer_epsg[$i]["maxy"];
-						}
-					}
-				}
-			}
-		}
-		for($i=0;$i<count($this->objLayer);$i++){
-			if(count($this->objLayer[$i]->layer_epsg) == 0 && \
                count($this->objLayer[0]->layer_epsg) > 0){
-				$this->objLayer[$i]->layer_epsg = $this->objLayer[0]->layer_epsg;
-			}
-			if(!is_int($this->objLayer[$i]->layer_parent)){
-				$this->objLayer[$i]->layer_abstract = $this->wms_abstract;
-				for ($r = 0; $r < count($this->wms_keyword); $r++) {
-					array_push($this->objLayer[$i]->layer_keyword, trim($this->wms_keyword[$r]));
-				}
-			}
-			if($this->objLayer[$i]->layer_name == ""){
-				$this->objLayer[$i]->layer_name = $this->objLayer[$i]->layer_title;
-			}
-			if($this->objLayer[$i]->layer_minscale == ""){
-				$this->objLayer[$i]->layer_minscale = 0;
-			}
-			if($this->objLayer[$i]->layer_maxscale == ""){
-				$this->objLayer[$i]->layer_maxscale = 0;
-			}
-			if($this->objLayer[$i]->layer_queryable == ""){
-				$this->objLayer[$i]->layer_queryable = 0;
-			}
-			$this->objLayer[$i]->gui_layer_minscale = $this->objLayer[$i]->layer_minscale;
-			$this->objLayer[$i]->gui_layer_maxscale = $this->objLayer[$i]->layer_maxscale;
-		}
-		for($i=0;$i<count($this->data_format);$i++){
-			if(mb_strtolower($this->data_type[$i]) == 'map' && \
                mb_strtoupper($this->data_format[$i]) == \
                mb_strtoupper($map_default)){
-				$this->gui_wms_mapformat = mb_strtolower($map_default);
-				$map_default_ok = true;
-			}
-			if(mb_strtolower($this->data_type[$i]) == 'featureinfo' && \
                mb_strtoupper($this->data_format[$i]) == \
                mb_strtoupper($featureinfo_default)){
-				$this->gui_wms_featureinfoformat = mb_strtolower($featureinfo_default);
-				$featureinfo_default_ok = true;
-			}
-			if(mb_strtolower($this->data_type[$i]) == 'exception' && \
                mb_strtolower($this->data_format[$i]) == \
                mb_strtolower($exception_default)){
-				$this->gui_wms_exceptionformat = mb_strtolower($exception_default);
-				$exception_default_ok = true;
-			}
-		}
-		if($map_default_ok == false){
-			for($i=0;$i<count($this->data_format);$i++){
-				if(mb_strtolower($this->data_type[$i]) == "map" ){$this->gui_wms_mapformat = \
                $this->data_format[$i]; break;}
-			}
-		}
-		if($featureinfo_default_ok == false){
-			for($i=0;$i<count($this->data_format);$i++){
-				if(mb_strtolower($this->data_type[$i]) == "featureinfo" \
                ){$this->gui_wms_featureinfoformat = $this->data_format[$i]; break;}
-			}
-		}
-		if($exception_default_ok == false){
-			for($i=0;$i<count($this->data_format);$i++){
-				if(mb_strtolower($this->data_type[$i]) == "exception" \
                ){$this->gui_wms_exceptionformat = $this->data_format[$i]; break;}
-			}
-		}
-
-		if(count($this->objLayer[0]->layer_epsg)>1){
-			$this->gui_wms_epsg = $this->objLayer[0]->layer_epsg[$this->default_epsg][epsg];
-		}
-		else{
-			$this->gui_wms_epsg = $this->objLayer[0]->layer_epsg[0][epsg];
-		}
-		/*the queryable layers*/
-		for($i=0; $i<count($this->objLayer); $i++){
-			if($this->objLayer[$i]->layer_queryable == 1){
-				$this->objLayer[$i]->gui_layer_queryable = 1;
-			}
-			else{
-				$this->objLayer[$i]->gui_layer_queryable = 0;
-			}
-		}
-		for($i=0; $i<count($this->objLayer); $i++){
-				$this->objLayer[$i]->layer_pos=$i;
-		}
-
-		/* fill sld variables when empty */
-		if($this->wms_supportsld == ""){
-				$this->wms_supportsld = 0;
-		}
-		if($this->wms_userlayer == ""){
-				$this->wms_userlayer = 0;
-		}
-		if($this->wms_userstyle == ""){
-				$this->wms_userstyle = 0;
-		}
-		if($this->wms_remotewfs == ""){
-				$this->wms_remotewfs = 0;
-		}
-	  }
-
-	function displayWMS(){
-		echo "<br>id: " . $this->wms_id . " <br>";
-		echo "version: " . $this->wms_version . " <br>";
-		echo "title: " . $this->wms_title . " <br>";
-		echo "abstract: " . $this->wms_abstract . " <br>";
-		echo "maprequest: " . $this->wms_getmap . " <br>";
-		echo "capabilitiesrequest: " . $this->wms_getcapabilities . " <br>";
-		echo "featureinforequest: " . $this->wms_getfeatureinfo . " <br>";
-		echo "gui_wms_mapformat: " . $this->gui_wms_mapformat . " <br>";
-		echo "gui_wms_featureinfoformat: " . $this->gui_wms_featureinfoformat . " <br>";
-		echo "gui_wms_exceptionformat: " . $this->gui_wms_exceptionformat . " <br>";
-		echo "gui_wms_epsg: " . $this->gui_wms_epsg . " <br>";
-		echo "wms_srs: " . $this->objLayer[0]->wms_srs1 . " <br>";
-		echo "gui_wms_visible: " . $this->gui_wms_visible . " <br>";
-		echo "gui_wms_opacity: " . $this->gui_wms_opacity . " <br>";
-		echo "support_sld: " . $this->wms_supportsld . " <br>";
-
-		for($i=0; $i<count($this->data_type);$i++){
-			echo $this->data_type[$i]. " -> ".$this->data_format[$i]. "<br>";
-		}
-		for($i=0; $i<count($this->objLayer); $i++){
-			echo "<hr>";
-			echo "id: <b>".$this->objLayer[$i]->layer_id ."</b> parent: \
<b>".$this->objLayer[$i]->layer_parent."</b> name: \
                <b>".$this->objLayer[$i]->layer_name;
-			echo "</b> title: <b>".$this->objLayer[$i]->layer_title. "</b> queryable: \
<b>".$this->objLayer[$i]->layer_queryable."</b> minScale: <b>". \
$this->objLayer[$i]->layer_minscale."</b> maxScale: \
                <b>".$this->objLayer[$i]->layer_maxscale."</b>";
-			echo "<br>dataurl: <b>".$this->objLayer[$i]->layer_dataurl_href. "</b>";
-			echo "<br>metadataurl: <b>".$this->objLayer[$i]->layer_metadataurl. "</b>";
-			echo "<table border='1'>";
-			for($j=0; $j<count($this->objLayer[$i]->layer_epsg);$j++){
-				echo "<tr><td>".$this->objLayer[$i]->layer_epsg[$j][epsg]."</td><td>".$this->objLayer[$i]->layer_epsg[$j][minx]."</td>";
                
-				echo "<td>".$this->objLayer[$i]->layer_epsg[$j][miny]."</td><td>".$this->objLayer[$i]->layer_epsg[$j][maxx]."</td>";
                
-				echo "<td>".$this->objLayer[$i]->layer_epsg[$j][maxy]."</td></tr>";
-			}
-			echo "</table>";
-			echo "layerstyle:";
-			echo "<table border='1'>";
-			echo "<tr><td>name</td><td>title</td><td>legendurl</td><td>legendurlformat</td></tr>";
                
-			for($j=0; $j<count($this->objLayer[$i]->layer_style);$j++){
-				echo "<tr><td>".$this->objLayer[$i]->layer_style[$j][name]."</td><td>".$this->obj \
Layer[$i]->layer_style[$j][title]."</td><td>".$this->objLayer[$i]->layer_style[$j][leg \
endurl]."</td><td>".$this->objLayer[$i]->layer_style[$j][legendurlformat]."</td></tr>";
                
-			}
-			echo "</table>";
-	        echo "<hr>";
-	        echo "<hr>";
-		}
-	}
-	  function addLayer($id,$parent){
-		$this->objLayer[count($this->objLayer)] = new layer($id,$parent);
-	  }
-	  /**
-	   * private function
-	   */
-	  function stripEndlineAndCarriageReturn($string) {
-	  	return preg_replace("/\n/", "", preg_replace("/\r/", " ", $string));
-	  }
-		function createJsObjFromWMS($parent=0){
-			echo $this->createJsObjFromWMS_();
-		}
-
-
-	function newLayer ($currentLayer, $currentExtent) {
-		$pos = $currentLayer["extension"]["LAYER_POS"];
-		$parent = $currentLayer["extension"]["LAYER_PARENT"];
-		$this->addLayer($pos, $parent);
-
-		// set layer data
-		$layerIndex = count($this->objLayer) - 1;
-		$newLayer = $this->objLayer[$layerIndex];
-		$newLayer->layer_uid = $currentLayer["extension"]["LAYER_ID"];
-		$newLayer->layer_name = $currentLayer["name"];
-		$newLayer->layer_title = $currentLayer["title"];
-		$newLayer->layer_dataurl_href = $currentLayer["dataurl"];
-		$newLayer->layer_pos = $currentLayer["extension"]["LAYER_POS"];
-		$newLayer->layer_queryable = $currentLayer["queryable"];
-		$newLayer->layer_minscale = $currentLayer["extension"]["MINSCALE"];
-		$newLayer->layer_maxscale = $currentLayer["extension"]["MAXSCALE"];
-		$newLayer->layer_metadataurl = $currentLayer["metadataurl"];
-		$newLayer->gui_layer_wms_id = $currentLayer["extension"]["WMS_LAYER_ID"];
-		$newLayer->gui_layer_status = $currentLayer["extension"]["GUI_STATUS"];
-		$newLayer->gui_layer_style = ""; // TODO: Add correct data
-		$newLayer->gui_layer_selectable = $currentLayer["extension"]["GUI_SELECTABLE"];
-		$newLayer->gui_layer_visible = $currentLayer["visible"];
-		$newLayer->gui_layer_queryable = $currentLayer["extension"]["GUI_QUERYABLE"];
-		$newLayer->gui_layer_querylayer = $currentLayer["extension"]["QUERYLAYER"];
-		$newLayer->gui_layer_minscale = $currentLayer["extension"]["GUI_MINSCALE"];
-		$newLayer->gui_layer_maxscale = $currentLayer["extension"]["GUI_MAXSCALE"];
-		if (isset($currentLayer["extension"]["WFSFEATURETYPE"])) {
-			$newLayer->gui_layer_wfs_featuretype = \
                $currentLayer["extension"]["WFSFEATURETYPE"];
-		}
-		$newLayer->layer_abstract = $currentLayer["abstract"];
-
-
-		//
-		// set layer epsg
-		//
-		$newLayer->layer_epsg = array();
-		if ($currentExtent !== null) {
-			$currentLayerEpsg = array();
-			$currentLayerEpsg["epsg"] = $currentExtent->epsg;
-			$currentLayerEpsg["minx"] = $currentExtent->min->x;
-			$currentLayerEpsg["miny"] = $currentExtent->min->y;
-			$currentLayerEpsg["maxx"] = $currentExtent->max->x;
-			$currentLayerEpsg["maxy"] = $currentExtent->max->y;
-			array_push($newLayer->layer_epsg, $currentLayerEpsg);
-		}
-
-
-		//
-		// set layer style
-		//
-		for ($i = 0; $i < count($currentLayer["format"]); $i++) {
-			$layerStyleIndex = count($newLayer->gui_layer_style) - 1;
-			$newLayer->layer_style[$layerStyleIndex] = array();
-			$currentStyle = $newLayer->layer_style[$layerStyleIndex];
-			$currentStyle["name"] = $currentLayer["style"][$i]["name"];
-			$currentStyle["title"] = $currentLayer["style"][$i]["title"];
-			$currentStyle["legendurl"] = $currentLayer["style"][$i]["legendurl"];
-			$currentStyle["legendurl_format"] = $currentLayer["style"][$i]["legendurl_type"];
-		}
-	}
-
-	  function createJsObjFromWMS_($parent=0){
-	  	$str = "";
-	  	if(!$this->wms_title || $this->wms_title == ""){
-			$str .= "alert('Error: no valid capabilities-document !!');";
-			die; exit;
-		}
-			if($parent){
-				$str .=  "parent.";
-			}
-			// wms_title and abstract have previously been urlencoded
-			// this solution may not yet be the ultimate one
-
-			$add_wms_string = "add_wms(" .
-					"'" . $this->wms_id ."'," .
-					"'" . $this->wms_version ."'," .
-					"'" . addslashes($this->wms_title) . "'," .
-					"'" . addslashes($this->wms_abstract) ."'," .
-					"'" . $this->wms_getmap ."'," .
-					"'" . $this->wms_getfeatureinfo ."'," .
-					"'" . $this->wms_getlegendurl ."'," .
-					"'" . $this->wms_filter ."'," .
-					"'" . $this->gui_wms_mapformat . "'," .
-					"'" . $this->gui_wms_featureinfoformat . "'," .
-					"'" . $this->gui_wms_exceptionformat . "'," .
-					"'" . $this->gui_wms_epsg ."'," .
-					"'" . $this->gui_wms_visible ."'," .
-					"'" . $this->gui_wms_opacity ."'," .
-					"'" . $this->gui_wms_sldurl ."" .
-					"');";
-			$str .=  $add_wms_string;
-
-		for($i=0;$i<count($this->data_format);$i++){
-			if($parent){
-				$str .=  "parent.";
-			}
-			$str .= "wms_add_data_type_format('". $this->data_type[$i] ."','". \
                $this->data_format[$i] ."');\n";
-		}
-		for($i=0; $i<count($this->objLayer); $i++){
-			if($parent){
-				$str .= "parent.";
-			}
-			$str .=  "wms_add_layer('".
-				$this->objLayer[$i]->layer_parent ."','".
-				$this->objLayer[$i]->layer_uid ."','".
-				addslashes($this->objLayer[$i]->layer_name) . "','".
-				addslashes($this->objLayer[$i]->layer_title) ."','".
-				$this->objLayer[$i]->layer_dataurl_href ."','".
-				$this->objLayer[$i]->layer_pos ."','".
-				$this->objLayer[$i]->layer_queryable ."','".
-				$this->objLayer[$i]->layer_minscale . "','".
-				$this->objLayer[$i]->layer_maxscale ."','".
-				$this->objLayer[$i]->layer_metadataurl ."','".
-				$this->objLayer[$i]->gui_layer_wms_id ."','".
-				$this->objLayer[$i]->gui_layer_status ."','".
-				$this->objLayer[$i]->gui_layer_style ."','".
-				$this->objLayer[$i]->gui_layer_selectable ."','".
-				$this->objLayer[$i]->gui_layer_visible ."','".
-				$this->objLayer[$i]->gui_layer_queryable ."','".
-				$this->objLayer[$i]->gui_layer_querylayer ."','".
-				$this->objLayer[$i]->gui_layer_minscale ."','".
-				$this->objLayer[$i]->gui_layer_maxscale ."','".
-				$this->objLayer[$i]->gui_layer_wfs_featuretype ."');\n";
-
-			for($j=0; $j<count($this->objLayer[$i]->layer_epsg);$j++){
-				if($i==0){
-					if($parent){
-						$str .= "parent.";
-					}
-					$str .= "wms_addSRS('".
-						$this->objLayer[$i]->layer_epsg[$j]["epsg"] ."','".
-						$this->objLayer[$i]->layer_epsg[$j]["minx"] ."','".
-						$this->objLayer[$i]->layer_epsg[$j]["miny"] ."','".
-						$this->objLayer[$i]->layer_epsg[$j]["maxx"] ."','".
-						$this->objLayer[$i]->layer_epsg[$j]["maxy"] ."');\n";
-				}
-				if($parent){
-					$str .=  "parent.";
-				}
-				$str .= "layer_addEpsg('".
-					$this->objLayer[$i]->layer_epsg[$j]["epsg"] ."','".
-					$this->objLayer[$i]->layer_epsg[$j]["minx"] ."','".
-					$this->objLayer[$i]->layer_epsg[$j]["miny"] ."','".
-					$this->objLayer[$i]->layer_epsg[$j]["maxx"] ."','".
-					$this->objLayer[$i]->layer_epsg[$j]["maxy"] ."');\n";
-			}
-			for($j=0; $j<count($this->objLayer[$i]->layer_style);$j++){
-				if($parent){
-				$str .= "parent.";
-				}
-				$str .= "wms_addLayerStyle('".$this->objLayer[$i]->layer_style[$j]["name"].
-					"', '".$this->objLayer[$i]->layer_style[$j]["title"].
-					"', ".$j.
-					",".$i.
-					",'".$this->objLayer[$i]->layer_style[$j]["legendurl"].
-					"', '".$this->objLayer[$i]->layer_style[$j]["legendformat"]."');\n";
-			}
-		}
-		return $str;
-	  }
-
-	  function createJsLayerObjFromWMS($parent=0, $layer_name){
-	  	if(!$this->wms_title || $this->wms_title == ""){
-			echo " alert('Error: no valid capabilities-document !!');";
-			die; exit;
-		}
-			if($parent){
-				echo "parent.";
-			}
-			// wms_title and abstract have previously been urlencoded
-			// this solution may not yet be the ultimate one
-			print("add_wms('".
-			$this->wms_id ."','".
-			$this->wms_version ."','".
-			preg_replace("/'/", "", $this->wms_title) ."','".
-			preg_replace("/'/", "", $this->wms_abstract) ."','".
-			$this->wms_getmap ."','" .
-			$this->wms_getfeatureinfo ."','".
-			$this->wms_getlegendurl ."','".
-			$this->wms_filter ."','".
-			$this->gui_wms_mapformat ."','".
-			$this->gui_wms_featureinfoformat ."','".
-			$this->gui_wms_exceptionformat . "','".
-			$this->gui_wms_epsg ."','".
-			$this->gui_wms_visible ."','".
-			$this->gui_wms_opacity ."','".
-			$this->gui_wms_sldurl ."');\n");
-
-		for($i=0;$i<count($this->data_format);$i++){
-			if($parent){
-				echo "parent.";
-			}
-			echo "wms_add_data_type_format('". $this->data_type[$i] ."','". \
                $this->data_format[$i] ."');\n";
-		}
-		for($i=0; $i<count($this->objLayer); $i++){
-			if($this->objLayer[$i]->layer_name == $layer_name|| \
                $this->objLayer[$i]->layer_pos == 0){
-
-				if($parent){
-					echo "parent.";
-				}
-			 print ("wms_add_layer('".
-				$this->objLayer[$i]->layer_parent ."','".
-				$this->objLayer[$i]->layer_uid ."','".
-				$this->objLayer[$i]->layer_name . "','".
-				addslashes($this->objLayer[$i]->layer_title) ."','".
-				$this->objLayer[$i]->layer_dataurl_href ."','".
-				$this->objLayer[$i]->layer_pos ."','".
-				$this->objLayer[$i]->layer_queryable ."','".
-				$this->objLayer[$i]->layer_minscale . "','".
-				$this->objLayer[$i]->layer_maxscale ."','".
-				$this->objLayer[$i]->layer_metadataurl ."','".
-				$this->objLayer[$i]->gui_layer_wms_id ."','".
-				$this->objLayer[$i]->gui_layer_status ."','".
-				$this->objLayer[$i]->gui_layer_style ."','".
-				$this->objLayer[$i]->gui_layer_selectable ."','".
-				$this->objLayer[$i]->gui_layer_visible ."','".
-				$this->objLayer[$i]->gui_layer_queryable ."','".
-				$this->objLayer[$i]->gui_layer_querylayer ."','".
-				$this->objLayer[$i]->gui_layer_minscale ."','".
-				$this->objLayer[$i]->gui_layer_maxscale ."','".
-				$this->objLayer[$i]->gui_layer_wfs_featuretype ."');\n");
-			for($j=0; $j<count($this->objLayer[$i]->layer_epsg);$j++){
-				if($i==0){
-					if($parent){
-					echo "parent.";
-					}
-					print("wms_addSRS('".
-						$this->objLayer[$i]->layer_epsg[$j]["epsg"] ."','".
-						$this->objLayer[$i]->layer_epsg[$j]["minx"] ."','".
-						$this->objLayer[$i]->layer_epsg[$j]["miny"] ."','".
-						$this->objLayer[$i]->layer_epsg[$j]["maxx"] ."','".
-						$this->objLayer[$i]->layer_epsg[$j]["maxy"] ."');\n");
-				}
-				if($parent){
-				echo "parent.";
-				}
-				print("layer_addEpsg('".
-					$this->objLayer[$i]->layer_epsg[$j]["epsg"] ."','".
-					$this->objLayer[$i]->layer_epsg[$j]["minx"] ."','".
-					$this->objLayer[$i]->layer_epsg[$j]["miny"] ."','".
-					$this->objLayer[$i]->layer_epsg[$j]["maxx"] ."','".
-					$this->objLayer[$i]->layer_epsg[$j]["maxy"] ."');\n");
-			}
-			for($j=0; $j<count($this->objLayer[$i]->layer_style);$j++){
-				if($parent){
-				echo "parent.";
-				}
-				print("wms_addLayerStyle('".$this->objLayer[$i]->layer_style[$j]["name"]."', \
'".$this->objLayer[$i]->layer_style[$j]["title"]."', \
".$j.",".$i.",'".$this->objLayer[$i]->layer_style[$j]["legendurl"]."', \
                '".$this->objLayer[$i]->layer_style[$j]["legendformat"]."');\n");
-			}
-		   }
-		}
-	  }
-
-
-	/**
-	* writeObjInDB
-	*
-	* this function exports the information from the xml to the mapbender database
-	*/
-	function writeObjInDB($gui_id){
-		global $con;
-
-		$this->checkObj();
-		db_begin();
-
-		# TABLE wms
-		$sql = "INSERT INTO wms (wms_version, wms_title, wms_abstract, \
                wms_getcapabilities, wms_getmap, ";
-		$sql.= "wms_getfeatureinfo, wms_getlegendurl, wms_getcapabilities_doc, \
                wms_upload_url, fees, ";
-		$sql .= "accessconstraints, contactperson, contactposition, contactorganization, \
                address, city, ";
-		$sql .= "stateorprovince, postcode, country, contactvoicetelephone, \
                contactfacsimiletelephone, contactelectronicmailaddress, ";
-		$sql .= "wms_owner,wms_timestamp, ";
-		$sql .= "wms_supportsld, wms_userlayer, wms_userstyle, wms_remotewfs) ";
-		$sql .= "VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28)";
                
-		$v = array($this->wms_version,$this->wms_title,$this->wms_abstract,$this->wms_getcapabilities,
                
-			$this->wms_getmap,$this->wms_getfeatureinfo,$this->wms_getlegendurl,$this->wms_getcapabilities_doc,
                
-			$this->wms_upload_url,$this->fees,$this->accessconstraints,$this->contactperson,$this->contactposition,
                
-			$this->contactorganization,$this->address,$this->city,$this->stateorprovince,$this->postcode,$this->country,
                
-			$this->contactvoicetelephone,$this->contactfacsimiletelephone,$this->contactelectronicmailaddress,
                
-			$_SESSION['mb_user_id'],strtotime("now"),
-			$this->wms_supportsld,$this->wms_userlayer,$this->wms_userstyle,$this->wms_remotewfs \
                );
-		$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i','i','s','s','s','s');
                
-		$res = db_prep_query($sql,$v,$t);
-		if(!$res){
-			db_rollback();
-		}
-
-		$myWMS = db_insert_id($con,'wms', 'wms_id');
-
-		# TABLE layer and gui_layer
-
-		for($i=0; $i<count($this->objLayer); $i++){
-			$this->insertLayer($i,$myWMS,$gui_id);
-			$this->insertGuiLayer($i,$myWMS,$gui_id);
-		}
-
-
-		#TABLE wms_srs
-		$this->insertSRS($myWMS);
-
-		# TABLE wms_format
-		$this->insertFormat($myWMS);
-
-		# TABLE gui_wms
-
-		$sql ="SELECT MAX(gui_wms_position) AS pos FROM gui_wms WHERE fkey_gui_id = $1";
-		$v = array($gui_id);
-		$t = array('s');
-		$res = db_prep_query($sql,$v,$t);
-		if(db_result($res, 0,"pos") > -1){
-			$position = db_result($res, 0,"pos") + 1;
-		} else{ $position = 0; }
-
-		$sql ="INSERT INTO gui_wms (fkey_gui_id, fkey_wms_id, gui_wms_position, \
                gui_wms_mapformat, ";
-		$sql .= "gui_wms_featureinfoformat, gui_wms_exceptionformat, gui_wms_epsg)";
-		$sql .= "VALUES($1,$2,$3,$4,$5,$6,$7)";
-		$v = array($gui_id,$myWMS,$position,$this->gui_wms_mapformat,$this->gui_wms_featureinfoformat,
                
-				$this->gui_wms_exceptionformat,$this->gui_wms_epsg
-				);
-		$t = array('s','i','i','s','s','s','s');
-		$res = db_prep_query($sql,$v,$t);
-		if(!$res){
-			db_rollback();
-		}
-		db_commit();
-
-	    #Changes JW
-	    $this->wms_id = $myWMS;
-	}
-	function insertLayer($i,$myWMS){
-		global $con;
-		$sql = "INSERT INTO layer(fkey_wms_id, layer_pos, layer_parent, layer_name, \
                layer_title, ";
-		$sql .= " layer_queryable, layer_minscale, \
                layer_maxscale,layer_dataurl,layer_metadataurl,layer_abstract) ";
-		$sql .= "VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11)";
-		if($this->objLayer[$i]->layer_id != null){
-			$tmpPos =  $this->objLayer[$i]->layer_id;
-		}
-		else {
-			$tmpPos .= 0;
-		}
-		if($this->objLayer[$i]->layer_parent == '' && $this->objLayer[$i]->layer_parent != \
                '0'){
-			$this->objLayer[$i]->layer_parent = '';
-		}
-		$v = array($myWMS,$tmpPos,$this->objLayer[$i]->layer_parent,$this->objLayer[$i]->layer_name,
                
-				$this->objLayer[$i]->layer_title,
-				$this->objLayer[$i]->layer_queryable,$this->objLayer[$i]->layer_minscale,
-				$this->objLayer[$i]->layer_maxscale,$this->objLayer[$i]->layer_dataurl_href,
-				$this->objLayer[$i]->layer_metadataurl,$this->objLayer[$i]->layer_abstract);
-		$t = array('i','i','s','s','s','i','i','i','s','s','s');
-		$res = db_prep_query($sql,$v,$t);
-		if(!$res){
-			db_rollback();
-		}
-		else {
-			# save the id of each layer: set param2 true
-			$this->objLayer[$i]->db_id = db_insert_id($con, 'layer','layer_id');
-			$this->insertLayerEPSG($i);
-
-			# TABLE layer_style for each layer
-			$this->insertLayerStyle($i);
-
-			# insert Keywords
-			$this->insertLayerKeyword($i);
-
-		}
-	}
-	function updateLayer($i,$myWMS){
-		$sql = "SELECT layer_id FROM layer WHERE fkey_wms_id = $1 AND layer_name = $2";
-		$v = array($myWMS,$this->objLayer[$i]->layer_name);
-		$t = array('i','s');
-		$res = db_prep_query($sql,$v,$t);
-		if($row = db_fetch_array($res)){
-			$l_id = $row['layer_id'];
-		}
-		else{
-			db_rollback();
-			$e = new mb_exception("Not found: ".$this->objLayer[$i]->layer_name);
-			return;
-		}
-
-		$sql = "UPDATE layer SET ";
-		$sql .= "layer_pos = $1, ";
-		$sql .= "layer_parent = $2, ";
-		$sql .= "layer_title = $3, ";
-		$sql .= "layer_queryable = $4, ";
-		$sql .= "layer_minscale = $5, ";
-		$sql .= "layer_maxscale = $6, ";
-		$sql .= "layer_dataurl = $7, ";
-		$sql .= "layer_metadataurl = $8, ";
-		$sql .= "layer_abstract = $9 ";
-		$sql .= "WHERE layer_id = $10";
-
-		if($this->objLayer[$i]->layer_id != null){
-			$tmpPos =  $this->objLayer[$i]->layer_id;
-		}
-		else {
-			$tmpPos .= 0;
-		}
-		if($this->objLayer[$i]->layer_parent == '' && $this->objLayer[$i]->layer_parent != \
                '0'){
-			$this->objLayer[$i]->layer_parent = '';
-		}
-		$v = array($tmpPos,$this->objLayer[$i]->layer_parent,
-				$this->objLayer[$i]->layer_title,
-				$this->objLayer[$i]->layer_queryable,$this->objLayer[$i]->layer_minscale,
-				$this->objLayer[$i]->layer_maxscale,$this->objLayer[$i]->layer_dataurl_href,
-				$this->objLayer[$i]->layer_metadataurl,$this->objLayer[$i]->layer_abstract, \
                $l_id
-			);
-		$t = array('i','s','s','i','i','i','s','s','s','i');
-		$res = db_prep_query($sql,$v,$t);
-		if($this->overwrite == true){
-			$sql = "UPDATE layer SET ";
-			$sql .= "layer_title = $1, ";
-			$sql .= "layer_abstract = $2 ";
-			$sql .= "WHERE layer_id = $3";
-
-			$v = array($this->objLayer[$i]->layer_title,$this->objLayer[$i]->layer_abstract, \
                $l_id);
-			$t = array('s','s','i');
-			$res = db_prep_query($sql,$v,$t);
-		}
-		if(!$res){
-			db_rollback();
-		}
-		else {
-
-			# save the id of each layer: set param2 true
-			$this->objLayer[$i]->db_id = $l_id;
-			$this->insertLayerEPSG($i);
-
-			# TABLE layer_style for each layer
-			$this->insertLayerStyle($i);
-			if($this->overwrite == true){
-				$this->insertLayerKeyword($i);
-			}
-		}
-	}
-	function insertGuiLayer($i,$myWMS,$gui_id){
-		# table gui_layer
-
-		$sql = "INSERT INTO gui_layer (fkey_gui_id, fkey_layer_id, gui_layer_wms_id, ";
-		$sql .= "gui_layer_status, gui_layer_selectable, gui_layer_visible, \
                gui_layer_queryable, ";
-		$sql .= "gui_layer_querylayer,gui_layer_minscale,gui_layer_maxscale, \
                gui_layer_priority, gui_layer_style) ";
-		$sql .= "VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12)";
-		if(count($this->objLayer[$i]->layer_style)>0){
-			$layer_style_name = $this->objLayer[$i]->layer_style[0]["name"];
-		}
-		else{
-			$layer_style_name = NULL;
-		}
-		$v = array($gui_id,$this->objLayer[$i]->db_id,$myWMS,1,1,1,$this->objLayer[$i]->layer_queryable,
                
-			$this->objLayer[$i]->layer_queryable,$this->objLayer[$i]->layer_minscale,$this->objLayer[$i]->layer_maxscale,$i,$layer_style_name);
                
-		$t = array('s','i','i','i','i','i','i','i','i','i','i','s');
-		$res = db_prep_query($sql,$v,$t);
-		#$e = new mb_exception("name des insert styles und fkey_layer_id: \
                ".$layer_style_name." --- ".$this->objLayer[$i]->db_id);
-		if(!$res){
-			db_rollback();
-		}
-	}
-	function appendGuiLayer($i,$myWMS,$gui_id){
-		# table gui_layer
-
-		$sql = "INSERT INTO gui_layer (fkey_gui_id, fkey_layer_id, gui_layer_wms_id, ";
-		$sql .= "gui_layer_status, gui_layer_selectable, gui_layer_visible, \
                gui_layer_queryable, ";
-		$sql .= "gui_layer_querylayer,gui_layer_minscale,gui_layer_maxscale, \
                gui_layer_priority, gui_layer_style) ";
-		$sql .= "VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12)";
-		if(count($this->objLayer[$i]->layer_style)>0){
-			$layer_style_name = $this->objLayer[$i]->layer_style[0]["name"];
-		}
-		else{
-			$layer_style_name = NULL;
-		}
-		$v = array($gui_id,$this->objLayer[$i]->db_id,$myWMS,0,0,0,$this->objLayer[$i]->layer_queryable,
                
-			$this->objLayer[$i]->layer_queryable,$this->objLayer[$i]->layer_minscale,$this->objLayer[$i]->layer_maxscale,$i,$layer_style_name);
                
-		$t = array('s','i','i','i','i','i','i','i','i','i','i','s');
-		$res = db_prep_query($sql,$v,$t);
-		if(!$res){
-			db_rollback();
-		}
-	}
-	function insertSRS($myWMS){
-		for($i=0; $i<count($this->wms_srs);$i++){
-			$sql ="INSERT INTO wms_srs (fkey_wms_id, wms_srs) values($1,$2)";
-			$v = array($myWMS,mb_strtoupper($this->wms_srs[$i]));
-			$t = array('i','s');
-			$res = db_prep_query($sql,$v,$t);
-			if(!$res){
-				db_rollback();
-			}
-		}
-	}
-	function insertFormat($myWMS){
-		for($i=0; $i<count($this->data_type);$i++){
-			$sql ="INSERT INTO wms_format (fkey_wms_id, data_type, data_format) ";
-			$sql .= " VALUES($1,$2,$3)";
-			$v = array($myWMS,$this->data_type[$i],$this->data_format[$i]);
-			$t = array('i','s','s');
-			$res = db_prep_query($sql,$v,$t);
-			if(!$res){
-				db_rollback();
-			}
-		}
-	}
-	function insertLayerEPSG($i){
-		$sql = "DELETE FROM layer_epsg WHERE fkey_layer_id = $1";
-		$v = array($this->objLayer[$i]->db_id);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-		for($j=0; $j<count($this->objLayer[$i]->layer_epsg);$j++){
-			$sql = "INSERT INTO layer_epsg (fkey_layer_id, epsg, minx, miny, maxx, maxy) ";
-			$sql .= "VALUES($1,$2,$3,$4,$5,$6)";
-			$v = array($this->objLayer[$i]->db_id,$this->objLayer[$i]->layer_epsg[$j][epsg],
-				$this->objLayer[$i]->layer_epsg[$j][minx],$this->objLayer[$i]->layer_epsg[$j][miny],
                
-				$this->objLayer[$i]->layer_epsg[$j][maxx],$this->objLayer[$i]->layer_epsg[$j][maxy]
                
-				);
-			$t = array('i','s','d','d','d','d');
-			$res = db_prep_query($sql,$v,$t);
-			if(!$res){
-				db_rollback();
-			}
-		}
-	}
-	function insertLayerStyle($i){
-		$sql = "DELETE FROM layer_style WHERE fkey_layer_id = $1";
-		$v = array($this->objLayer[$i]->db_id);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-		for($j=0; $j<count($this->objLayer[$i]->layer_style);$j++){
-			$sql = "INSERT INTO layer_style (fkey_layer_id, name, title, legendurl, \
                legendurlformat) ";
-			$sql .= "VALUES($1,$2,$3,$4,$5)";
-			$v = array($this->objLayer[$i]->db_id,$this->objLayer[$i]->layer_style[$j]["name"],
                
-					$this->objLayer[$i]->layer_style[$j]["title"],$this->objLayer[$i]->layer_style[$j]["legendurl"],
                
-					$this->objLayer[$i]->layer_style[$j]["legendurlformat"]
-				);
-			$t = array('i','s','s','s','s');
-			$res = db_prep_query($sql,$v,$t);
-			if(!$res){
-				db_rollback();
-			}
-		}
-	}
-	function insertLayerKeyword($i){
-		global $con;
-		$sql = "DELETE FROM layer_keyword WHERE fkey_layer_id = $1";
-		$v = array($this->objLayer[$i]->db_id);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-
-//		var_dump($this);
-		$k = $this->objLayer[$i]->layer_keyword;
-//		var_dump($k);
-		for($j=0; $j<count($k); $j++){
-			$keyword_id = "";
-
-			while ($keyword_id == "") {
-				$sql = "SELECT keyword_id FROM keyword WHERE UPPER(keyword) = UPPER($1)";
-				$v = array($k[$j]);
-				$t = array('s');
-				$res = db_prep_query($sql,$v,$t);
-				$row = db_fetch_array($res);
-			//print_r($row);
-				if ($row) {
-					$keyword_id = $row["keyword_id"];
-				}
-				else {
-					$sql_insertKeyword = "INSERT INTO keyword (keyword)";
-					$sql_insertKeyword .= "VALUES ($1)";
-					$v1 = array($k[$j]);
-					$t1 = array('s');
-					$res_insertKeyword = db_prep_query($sql_insertKeyword,$v1,$t1);
-					if(!$res_insertKeyword){
-						db_rollback();
-					}
-				}
-			}
-
-			// check if layer/keyword combination already exists
-			$sql_layerKeywordExists = "SELECT * FROM layer_keyword WHERE fkey_layer_id = $1 \
                AND fkey_keyword_id = $2";
-			$v = array($this->objLayer[$i]->db_id, $keyword_id);
-			$t = array('i', 'i');
-			$res_layerKeywordExists = db_prep_query($sql_layerKeywordExists, $v, $t);
-			$row = db_fetch_array($res_layerKeywordExists);
-			//print_r($row);
-			if (!$row) {
-				$sql1 = "INSERT INTO layer_keyword (fkey_keyword_id,fkey_layer_id)";
-				$sql1 .= "VALUES ($1,$2)";
-				$v1 = array($keyword_id,$this->objLayer[$i]->db_id);
-				$t1 = array('i','i');
-				$res1 = db_prep_query($sql1,$v1,$t1);
-				if(!$res1){
-					db_rollback();
-				}
-			}
-		}
-	}
-	function updateObjInDB($myWMS){
-		db_begin();
-
-		$sql = "UPDATE wms SET ";
-		$sql .= "wms_version = $1 ,";
-		$sql .= "wms_getcapabilities  = $2 ,";
-		$sql .= "wms_getmap  = $3 ,";
-		$sql .= "wms_getfeatureinfo  = $4 ,";
-		$sql .= "wms_getlegendurl  = $5 ,";
-		$sql .= "wms_getcapabilities_doc = $6 ,";
-		$sql .= "wms_upload_url = $7,  ";
-		$sql .= "wms_owner = $8, ";
-		$sql .= "wms_timestamp = $9, ";
-		$sql .= "wms_supportsld = $10, ";
-		$sql .= "wms_userlayer = $11, ";
-		$sql .= "wms_userstyle = $12, ";
-		$sql .= "wms_remotewfs = $13 ";
-		$sql .= " WHERE wms_id = $14";
-
-		$v = array($this->wms_version,$this->wms_getcapabilities,
-			$this->wms_getmap,$this->wms_getfeatureinfo,$this->wms_getlegendurl,
-			$this->wms_getcapabilities_doc,$this->wms_upload_url,$_SESSION["mb_user_id"],strtotime("now"),
                
-			$this->wms_supportsld,$this->wms_userlayer,$this->wms_userstyle,$this->wms_remotewfs,$myWMS);
                
-		$t = array('s','s','s','s','s','s','s','i','i','s','s','s','s','i');
-
-		$res = db_prep_query($sql,$v,$t);
-		if(!$res){
-			db_rollback();
-		}
-
-		if($this->overwrite == true){
-			$sql = "UPDATE wms SET ";
-			$sql .= "wms_title  = $1 ,";
-			$sql .= "wms_abstract  = $2 ,";
-			$sql .= "fees = $3, ";
-			$sql .= "accessconstraints = $4, ";
-			$sql .= "contactperson = $5, ";
-			$sql .= "contactposition = $6, ";
-			$sql .= "contactorganization = $7, ";
-			$sql .= "address = $8, ";
-			$sql .= "city = $9, ";
-			$sql .= "stateorprovince = $10, ";
-			$sql .= "postcode = $11, ";
-			$sql .= "country = $12, ";
-			$sql .= "contactvoicetelephone = $13, ";
-			$sql .= "contactfacsimiletelephone = $14, ";
-			$sql .= "contactelectronicmailaddress = $15 ";
-			$sql .= " WHERE wms_id = $16";
-
-			$v = array($this->wms_title,$this->wms_abstract,$this->fees,$this->accessconstraints,
                
-				$this->contactperson,$this->contactposition,$this->contactorganization,$this->address,
                
-				$this->city,$this->stateorprovince,$this->postcode,$this->country,$this->contactvoicetelephone,
                
-				$this->contactfacsimiletelephone,$this->contactelectronicmailaddress,$myWMS);
-			$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i');
-			$res = db_prep_query($sql,$v,$t);
-			if(!$res){
-				db_rollback();
-			}
-		}
-
-		# delete and refill srs and formats
-		$sql = "DELETE FROM wms_srs WHERE fkey_wms_id = $1 ";
-		$v = array($myWMS);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-		if(!$res){
-			db_rollback();
-		}
-		$this->insertSRS($myWMS);
-
-		$sql = "DELETE FROM wms_format WHERE fkey_wms_id = $1 ";
-		$v = array($myWMS);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-		if(!$res){
-			db_rollback();
-		}
-		$this->insertFormat($myWMS);
-
-		# update gui_wms
-		$this->update_gui_wms($myWMS);
-
-		# update TABLE layer
-		# delete all layer which are outdated
-		$v = array($myWMS);
-		$t = array('i');
-		$c = 2;
-		$sql = "DELETE FROM layer WHERE fkey_wms_id = $1 AND NOT layer_name IN(";
-		for($i=0; $i<count($this->objLayer); $i++){
-			if($i>0){$sql .= ',';}
-			$sql .= "$".$c;
-			array_push($v,$this->objLayer[$i]->layer_name);
-			array_push($t,'s');
-			$c++;
-		}
-		$sql .= ")";
-
-		$res = db_prep_query($sql,$v,$t);
-		if(!$res){
-			db_rollback();
-		}
-
-		# update or insert?
-		$sql = "SELECT layer_name FROM layer WHERE fkey_wms_id = $1";
-		$v = array($myWMS);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-		$exLayer = array();
-		while($row = db_fetch_array($res)){
-			array_push($exLayer,$row["layer_name"]);
-		}
-
-		$sql = "SELECT fkey_gui_id FROM gui_wms WHERE fkey_wms_id = $1";
-		$v = array($myWMS);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-		$exGui = array();
-		while($row = db_fetch_array($res)){
-			array_push($exGui,$row["fkey_gui_id"]);
-		}
-
-		for($i=0; $i<count($this->objLayer); $i++){
-			if(in_array($this->objLayer[$i]->layer_name,$exLayer)){
-				//echo "<br>update: ".$this->objLayer[$i]->layer_name;
-				$this->updateLayer($i,$myWMS);
-				for($j=0; $j<count($exGui); $j++){
-					$this->updateGuiLayer($i,$myWMS,$exGui[$j]);
-				}
-			}
-			else{
-				//echo "<br>append: ".$this->objLayer[$i]->layer_name;
-				$this->insertLayer($i,$myWMS);
-				for($j=0; $j<count($exGui); $j++){
-					$this->appendGuiLayer($i,$myWMS,$exGui[$j]);
-				}
-			}
-		}
-		db_commit();
-		return;
-	}
-	function updateGuiLayer($i,$myWMS,$gui_id){
-		$sql = "SELECT layer_id FROM layer WHERE fkey_wms_id = $1 AND layer_name = $2";
-		$v = array($myWMS,$this->objLayer[$i]->layer_name);
-		$t = array('i','s');
-		$res = db_prep_query($sql,$v,$t);
-		if($row = db_fetch_array($res)){
-			$l_id = $row['layer_id'];
-		}
-		else{
-			db_rollback();
-			$e = new mb_exception("Not found: ".$this->objLayer[$i]->layer_name. " in gui: \
                ".$gui_id);
-			return;
-		}
-
-		$sql = "SELECT * FROM gui_layer WHERE fkey_layer_id = $1 and fkey_gui_id = $2";
-		$v = array($l_id,$gui_id);
-		$t = array('i','s');
-		$res = db_prep_query($sql,$v,$t);
-		while($row = db_fetch_array($res)){
-			if($this->objLayer[$i]->layer_queryable == 0){
-				$sql1 = "UPDATE gui_layer set gui_layer_queryable = 0, gui_layer_querylayer = 0 \
                ";
-				$sql1 .= "WHERE fkey_layer_id = $1 and fkey_gui_id = $2";
-				$v = array($l_id,$gui_id);
-				$t = array('i','s');
-				$res1 = db_prep_query($sql1,$v,$t);
-				if(!$res1){
-
-				db_rollback();
-				}
-			}
-			if($this->objLayer[$i]->layer_queryable == 1){
-				$sql1 = "UPDATE gui_layer set gui_layer_queryable = 1 ";
-				$sql1 .= "WHERE fkey_layer_id = $1 and fkey_gui_id = $2";
-				$v = array($l_id,$gui_id);
-				$t = array('i','s');
-				$res1 = db_prep_query($sql1,$v,$t);
-				if(!$res1){
-
-					db_rollback();
-				}
-			}
-			if($row["gui_layer_minscale"] < $this->objLayer[$i]->layer_minscale){
-				$sql1 = "UPDATE gui_layer set gui_layer_minscale = $1 ";
-				$sql1 .= "WHERE fkey_layer_id = $2 and fkey_gui_id = $3";
-				$v = array($this->objLayer[$i]->layer_minscale,$l_id,$gui_id);
-				$t = array('i','i','s');
-				$res1 = db_prep_query($sql1,$v,$t);
-				if(!$res1){db_rollback();
-				}
-			}
-			if($row["gui_layer_maxscale"] > $this->objLayer[$i]->layer_maxscale){
-				$sql1 = "UPDATE gui_layer set gui_layer_maxscale = $1 ";
-				$sql1 .= "WHERE fkey_layer_id = $2 and fkey_gui_id = $3";
-				$v = array($this->objLayer[$i]->layer_maxscale,$l_id,$gui_id);
-				$t = array('i','i','s');
-				$res1 = db_prep_query($sql1,$v,$t);
-				if(!$res1){db_rollback();
-				}
-			}
-		}
-	}
-	function update_gui_wms($myWMS){
-		$mySubmit = null;
-		$sql = "SELECT * FROM gui_wms where fkey_wms_id = $1";
-		$v = array($myWMS);
-		$t = array('i');
-		$res = db_prep_query($sql,$v,$t);
-		$cnt = 0;
-		while($row = db_fetch_array($res)){
-			unset($mySubmit);
-			$myGUI[$cnt] = $row["fkey_gui_id"];
-
-			$sql = "UPDATE gui_wms SET ";
-			$v = array();
-			$t = array();
-			$paramCount = 0;
-
-			for($i=0; $i<count($this->data_type); $i++){
-				# gui_wms_mapformat
-				if(mb_strtolower($this->data_type[$i]) == "map" && \
                mb_strtolower($this->data_format[$i]) == \
                mb_strtolower($row["gui_wms_mapformat"])){
-					$myMapFormat = true;
-				}
-				# gui_wms_featureinfoformat
-				if(mb_strtolower($this->data_type[$i]) == "featureinfo" && \
mb_strtolower($this->data_format[$i]) == \
                mb_strtolower($row["gui_wms_featureinfoformat"])){
-					$myFeatureInfoFormat = true;
-				}
-				# gui_wms_exceptionformat
-				if(mb_strtolower($this->data_type[$i]) == "exception" && \
mb_strtolower($this->data_format[$i]) == \
                mb_strtolower($row["gui_wms_exceptionformat"])){
-					$myExceptionFormat = true;
-				}
-			}
-			if(!$myMapFormat){
-				$paramCount++;
-				$sql .= "gui_wms_mapformat = $" . $paramCount . " ";
-				$mySubmit = true;
-				array_push($v, $this->gui_wms_mapformat);
-				array_push($t, "s");
-			}
-			if(!$myFeatureInfoFormat){
-				if($mySubmit){ $sql .= ",";}
-				$paramCount++;
-				$sql .= "gui_wms_featureinfoformat = $" . $paramCount . " ";
-				array_push($v, $this->gui_wms_featureinfoformat);
-				array_push($t, "s");
-				$mySubmit = true;
-			}
-			if(!$myExceptionFormat){
-				if($mySubmit){ $sql .= ",";}
-				$paramCount++;
-				$sql .= "gui_wms_exceptionformat = $" . $paramCount ." ";
-				array_push($v, $this->gui_wms_exceptionformat);
-				array_push($t, "s");
-				$mySubmit = true;
-			}
-
-			# gui_wms_epsg
-			for($j=0; $j<count($this->objLayer[0]->layer_epsg);$j++){
-				if($this->objLayer[0]->layer_epsg[$j][epsg] == \
                mb_strtoupper($row["gui_wms_epsg"])){
-					$myGUI_EPSG = true;
-				}
-			}
-			if(!$myGUI_EPSG){
-				if($mySubmit){ $sql .= ",";}
-				$paramCount++;
-				$sql .= "gui_wms_epsg = $" . $paramCount . " ";
-				array_push($v, $this->gui_wms_epsg);
-				array_push($t, "s");
-				$mySubmit = true;
-			}
-			$paramCount++;
-			$sql .= " WHERE fkey_gui_id = $" . $paramCount . " ";
-			array_push($v, $row["fkey_gui_id"]);
-			array_push($t, "s");
-
-			$paramCount++;
-			$sql .= "AND fkey_wms_id = $" . $paramCount;
-			array_push($v, $myWMS);
-			array_push($t, "i");
-			if($mySubmit){
-				$res = db_prep_query($sql,$v,$t);
-				if(!$res){
-					db_rollback();
-					echo "<pre>".$sql."</pre><br> <br><p>";
-				 	echo db_error();
-				 	echo "<br /> UPDATE ERROR -> KILL PROCESS AND ROLLBACK....................no \
                update<br><br>";
-					$e = new mb_exception("class_wms.php: transaction: Transaction aborted, \
                rollback.");
-				}
-			}
-			$cnt++;
-		}
-	}
-	function getVersion() {
-		return $this->wms_version;
-	}
-
-	function getCapabilities() {
-		return $this->wms_getcapabilities;
-	}
-
-	function getCapabilitiesDoc() {
-		return $this->wms_getcapabilities_doc;
-	}
-
-	/**
-	* creatObjfromDB
-	*
-	*/
-	  function createObjFromDB($gui_id,$wms_id){
-
-		$sql = "Select * from gui_wms where fkey_wms_id = $1 AND fkey_gui_id = $2";
-		$v = array($wms_id,$gui_id);
-		$t = array('i','s');
-		$res = db_prep_query($sql,$v,$t);
-
-		$count=0;
-		#$res_countÛ_num_rows($res);
-
-
-		while($row = db_fetch_array($res)){
-			$this->gui_wms_mapformat=$row["gui_wms_mapformat"];
-			$this->gui_wms_featureinfoformat=$row["gui_wms_featureinfoformat"];
-			$this->gui_wms_exceptionformat=$row["gui_wms_exceptionformat"];
-			$this->gui_wms_epsg=$row["gui_wms_epsg"];
-			$this->gui_wms_visible = $row["gui_wms_visible"];
-			$this->gui_wms_opacity = $row["gui_wms_opacity"];
-			$this->gui_wms_sldurl = $row["gui_wms_sldurl"];
-
-			$sql = "Select * from wms where wms_id = $1 ";
-			$v = array($wms_id);
-			$t = array('i');
-			$res_wms = db_prep_query($sql,$v,$t);
-			$count_wms=0;
-			while($row2 = db_fetch_array($res_wms)){
-				$this->wms_id = $row2["wms_id"];
-				$this->wms_version = $row2["wms_version"];
-				$this->wms_title = $this->stripEndlineAndCarriageReturn($row2["wms_title"]);
-				$this->wms_abstract = \
                $this->stripEndlineAndCarriageReturn($row2["wms_abstract"]);
-				$wmsowsproxy = $row2["wms_owsproxy"];
-				#$wmsowsproxy = "test";
-				if($wmsowsproxy != ""){
-					$owsproxyurl = OWSPROXY."/".session_id()."/".$wmsowsproxy."?";
-					$this->wms_getmap = $owsproxyurl;
-					$this->wms_getcapabilities =  $owsproxyurl;
-					$this->wms_getfeatureinfo = $owsproxyurl;
-					$this->wms_getlegendurl = $owsproxyurl;
-				}
-				else{
-					$this->wms_getmap =  $row2["wms_getmap"];
-					$this->wms_getcapabilities =  $row2["wms_getcapabilities"];
-					$this->wms_getfeatureinfo = $row2["wms_getfeatureinfo"];
-					$this->wms_getlegendurl = $row2["wms_getlegendurl"];
-				}
-				$this->wms_getcapabilities_doc = $row2["wms_getcapabilities_doc"];
-				$this->wms_filter = $row2["wms_filter"];
-				$this->wms_supportsld = $row2["wms_supportsld"];
-				$this->wms_userlayer = $row2["wms_userlayer"];
-				$this->wms_userstyle = $row2["wms_userstyle"];
-				$this->wms_remotewfs = $row2["wms_remotewfs"];
-
-				$count_wms++;
-			}
-
-			### formats
-			$sql = "SELECT * FROM wms_format WHERE fkey_wms_id = $1 ";
-			$v = array($wms_id);
-			$t = array('i');
-			$res_wms = db_prep_query($sql,$v,$t);
-			$count_format=0;
-			while($row3 = db_fetch_array($res_wms)){
-				$this->data_type[$count_format] = $row3["data_type"];
-				$this->data_format[$count_format] = $row3["data_format"];
-				$count_format++;
-			}
-			$count++;
-		}
-
-		#layer
-		$sql = "Select * from gui_layer where gui_layer_wms_id = $1 AND fkey_gui_id = $2 \
                ";
-		$sql .= " AND gui_layer_status = 1 ORDER BY gui_layer_priority;";
-		$v = array($wms_id,$gui_id);
-		$t = array('i','s');
-		$res = db_prep_query($sql,$v,$t);
-		$count=0;
-
-		while($row = db_fetch_array($res)){
-			$layer_id = $row["fkey_layer_id"];
-			$sql = "Select * from layer where layer_id = $1";
-			$v = array($layer_id);
-			$t = array('i');
-			$res_layer = db_prep_query($sql,$v,$t);
-			$count_layer=0;
-			while($row2 = db_fetch_array($res_layer)){
-				$this->addLayer($row2["layer_pos"],$row2["layer_parent"]);
-				$layer_cnt=count($this->objLayer)-1;
-				$this->objLayer[$layer_cnt]->layer_uid = $layer_id;
-				$this->objLayer[$layer_cnt]->layer_name =$row2["layer_name"];
-				$this->objLayer[$layer_cnt]->layer_title =$row2["layer_title"];
-				$this->objLayer[$layer_cnt]->layer_dataurl_href =$row2["layer_dataurl"];
-				$this->objLayer[$layer_cnt]->layer_metadataurl =$row2["layer_metadataurl"];
-				$this->objLayer[$layer_cnt]->layer_pos =$row2["layer_pos"];
-				$this->objLayer[$layer_cnt]->layer_queryable =$row2["layer_pos"];
-				$this->objLayer[$layer_cnt]->layer_queryable =$row2["layer_queryable"];
-				$this->objLayer[$layer_cnt]->layer_minscale =$row2["layer_minscale"];
-				$this->objLayer[$layer_cnt]->layer_maxscale = $row2["layer_maxscale"];
-				$count_layer++;
-			}
-			$this->objLayer[$layer_cnt]->layer_uid = $layer_id;
-			$this->objLayer[$layer_cnt]->gui_layer_wms_id = $row["gui_layer_wms_id"];
-			$this->objLayer[$layer_cnt]->gui_layer_selectable = $row["gui_layer_selectable"];
-			$this->objLayer[$layer_cnt]->gui_layer_visible = $row["gui_layer_visible"];
-			$this->objLayer[$layer_cnt]->gui_layer_queryable = $row["gui_layer_queryable"];
-			$this->objLayer[$layer_cnt]->gui_layer_querylayer = $row["gui_layer_querylayer"];
-			$this->objLayer[$layer_cnt]->gui_layer_minscale = $row["gui_layer_minscale"];
-			$this->objLayer[$layer_cnt]->gui_layer_maxscale = $row["gui_layer_maxscale"];
-			$this->objLayer[$layer_cnt]->gui_layer_style = $row["gui_layer_style"];
-			$this->objLayer[$layer_cnt]->gui_layer_wfs_featuretype = \
                $row["gui_layer_wfs_featuretype"];
-
-			$sql = "Select * from layer_epsg where fkey_layer_id = $1 ORDER BY \
                fkey_layer_id";
-			$v = array($layer_id);
-			$t = array('i');
-			$res_layer_epsg = db_prep_query($sql,$v,$t);
-
-			$count_layer_epsg=0;
-			while($row2 = db_fetch_array($res_layer_epsg)){
-				$this->objLayer[$layer_cnt]->layer_epsg[$count_layer_epsg]["epsg"]=$row2["epsg"];
                
-				$this->objLayer[$layer_cnt]->layer_epsg[$count_layer_epsg]["minx"]=$row2["minx"];
                
-				$this->objLayer[$layer_cnt]->layer_epsg[$count_layer_epsg]["miny"]=$row2["miny"];
                
-				$this->objLayer[$layer_cnt]->layer_epsg[$count_layer_epsg]["maxx"]=$row2["maxx"];
                
-				$this->objLayer[$layer_cnt]->layer_epsg[$count_layer_epsg]["maxy"]=$row2["maxy"];
                
-				$count_layer_epsg++;
-			}
-
-			### handle styles
-			$sql = "SELECT * FROM layer_style WHERE fkey_layer_id = $1 ";
-			$v = array($layer_id);
-			$t = array('i');
-			$res_style = db_prep_query($sql,$v,$t);
-			$count_layer_style = 0;
-			while($row2 = db_fetch_array($res_style)){
-				$this->objLayer[$layer_cnt]->layer_style[$count_layer_style]["name"]=$row2["name"];
                
-				$this->objLayer[$layer_cnt]->layer_style[$count_layer_style]["title"]=$row2["title"];
                
-				if($wmsowsproxy != ""){
-					if($row2["legendurl"]!=''){
-						$this->objLayer[$layer_cnt]->layer_style[$count_layer_style]["legendurl"]=$owsproxyurl.
                
-						"REQUEST=getlegendgraphic&VERSION=".$this->wms_version."&LAYER=".$this->objLayer[$layer_cnt]->layer_name."&FORMAT=".$row2["legendurlformat"].
                
-						"&STYLE=".$row2["name"];
-					}
-				}
-				else{
-					if($row2["legendurl"]!=''){
-						$this->objLayer[$layer_cnt]->layer_style[$count_layer_style]["legendurl"]=$row2["legendurl"];
                
-						#$e = new mb_exception("legendurl = \
                ".$this->objLayer[$layer_cnt]->layer_style[$count_layer_style]["legendurl"]);
                
-					}
-				}
-				$this->objLayer[$layer_cnt]->layer_style[$count_layer_style]["legendurlformat"]=$row2["legendurlformat"];
                
-				$count_layer_style++;
-			}
-			$count++;
-		}
-	   }
-	/** end createObjfromDB **/
-
-	  /**
-	* function checkObjExistsInDB()
-	*
-	* this function checks wether the onlineresource already exists in the database.
-	*/
-	function checkObjExistsInDB(){
-
-		$sql = "Select * from wms where wms_getcapabilities = $1";
-		$v = array($this->wms_getcapabilities);
-		$t = array('s');
-		$res = db_prep_query($sql,$v,$t);
-		$res_count= db_num_rows($res);
-		$wms_id=0;
-		if($res_count>0){
-			$count=0;
-			while($row = db_fetch_array($res)){
-				$wms_id=$row["wms_id"];
-				$count++;
-			}
-		}
-		return $wms_id;
-	}
-
-	function displayDBInformation(){
-		echo $this->wms_getcapabilities;
-		$sql="Select * from wms where wms_getcapabilities = $1";
-		$v = array($this->wms_getcapabilities);
-		$t = array('s');
-		$res = db_prep_query($sql,$v,$t);
-		$count=0;
-		while($row = db_fetch_array($res)){
-		echo "count: ".$count."<br>";
-			$wms_id=$row["wms_id"];
-			echo "version: " .$wms_id." <br>";
-			echo "title: " .$row["wms_version"]. " <br>";
-			echo "abstract: " . $row["wms_title"] . " <br>";
-			echo "maprequest: " .$row["wms_abstract"] . " <br>";
-			echo "capabilitiesrequest: " . $row["wms_getcapabilities"] . " <br>";
-			echo "featureinforequest: " . $row["wms_getmap"]. " <br>";
-			echo "gui_wms_mapformat: " . $row["wms_getfeatureinfo"] . " <br>---------<br>";
-			$count++;
-		}
-	   echo "----<br> wms_id: ".$wms_id."<br>";
-
-	   $sql = "Select * from gui_wms where fkey_wms_id = $1";
-	   $v = array($wms_id);
-	   $t = array('i');
-	   echo "sql: ".$sql." <br>---------<br>";
-	   $res = db_prep_query($sql,$v,$t);
-	   $res_count= db_num_rows($res);
-	   echo "result count: ".$res_count." <br>---------<br>";
-
-	   $count=0;
-	   while($row = db_fetch_array($res)){
-	    	echo "gui_wms_featureinfoformat: " . $row["gui_wms_featureinfoformat"]." \
                <br>";
-	    	echo "gui_wms_exceptionformat: " .  $row["gui_wms_exceptionformat"]. " <br>";
-	    	echo "gui_wms_epsg: " .  $row["gui_wms_epsg"]. " <br>";
-	      $count++;
-	   }
-
-	   #db_close($connect);
-	}
-
-	function checkObj(){
-		if($this->wms_getcapabilities == '' || $this->wms_getmap == '' ){
-			echo "<br>Missing parameters: <br>";
-			$this->displayWMS();
-			print_r($this);
-			echo "<br> Data not committed<br>";
-			die();
-		}
-	}
-
-	/**
-	 * Selects all WMS of the current user from the database.
-	 * Then it creates the corresponding WMS object and returns
-	 * these objects as an array.
-	 *
-	 * @return wms[]
-	 * @param $appId String
-	 */
-	public static function selectMyWmsByApplication ($appId) {
-		// check if user is permitted to access the application
-		$currentUser = new User($_SESSION["mb_user_id"]);
-		$appArray = $currentUser->getApplicationsByPermission(false);
-		if (!in_array($appId, $appArray)) {
-			$e = new mb_warning("class_wms.php: selectMyWmsByApplication(): User '" . \
                $currentUser . "' is not allowed to acces application '" . $appId . \
                "'.");
-			return array();
-		}
-
-		// get WMS of this application
-		$sql = "SELECT fkey_wms_id FROM gui_wms WHERE " .
-				"fkey_gui_id = $1 ORDER BY gui_wms_position";
-		$v = array($appId);
-		$t = array('s');
-		$res = db_prep_query($sql,$v,$t);
-
-		// instantiate PHP objects and store in array
-		$wmsArray = array();
-		while ($row = db_fetch_array($res)) {
-			$currentWms = new wms();
-			$currentWms->createObjFromDB($appId, $row["fkey_wms_id"]);
-			array_push($wmsArray, $currentWms);
-		}
-		return $wmsArray;
-	}
-}
-class layer extends wms {
-	var $layer_id;
-	var $layer_parent;
-	var $layer_name;
-	var $layer_title;
-	var $layer_abstract;
-	var $layer_pos;
-	var $layer_queryable;
-	var $layer_minscale;
-	var $layer_maxscale;
-    var $layer_dataurl_href;
-    var $layer_metadataurl;
-    var $layer_keyword = array();
-	var $layer_epsg = array();
-	var $layer_style = array();
-
-	var $gui_layer_wms_id;
-	var $gui_layer_status = 1;
-	var $gui_layer_selectable = 1;
-	var $gui_layer_visible = 0;
-	var $gui_layer_queryable = 0;
-	var $gui_layer_querylayer = 0;
-	var $gui_layer_style = NULL;
-
-	function layer($id,$parent){
-		$this->layer_id = $id;
-		$this->layer_parent = $parent;
-		//var_dump($this);
-	}
-
-	public function __toString () {
-		$e = new mb_exception("TITLE: " . $this->layer_title);
-		return $this->layer_title;
-	}
-
-}
+include_once(dirname(__FILE__)."/../../lib/wms.php");
 ?>
\ No newline at end of file

Deleted: branches/testbaudson_dev/http/extensions/JSON.php
==================================================================--- \
                trunk/mapbender/http/extensions/JSON.php	2008-06-24 12:33:05 UTC (rev \
                2556)
+++ branches/testbaudson_dev/http/extensions/JSON.php	2008-06-30 14:13:03 UTC (rev \
2566) @@ -1,806 +0,0 @@
-<?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@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?id8
- */
-
-/**
- * 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)
-        {
-
-        }
-    }
-
-}
-
-?>

Deleted: branches/testbaudson_dev/http/extensions/OpenLayers.js
==================================================================--- \
                trunk/mapbender/http/extensions/OpenLayers.js	2008-06-24 12:33:05 UTC \
                (rev 2556)
+++ branches/testbaudson_dev/http/extensions/OpenLayers.js	2008-06-30 14:13:03 UTC \
(rev 2566) @@ -1,1382 +0,0 @@
-/*
-
-  OpenLayers.js -- OpenLayers Map Viewer Library
-
-  Copyright 2005-2008 MetaCarta, Inc., released under the Clear BSD license.
-  Please see http://svn.openlayers.org/trunk/openlayers/license.txt
-  for the full text of the license.
-
-  Includes compressed code under the following licenses:
-
-  (For uncompressed versions of the code used please see the
-  OpenLayers SVN repository: <http://openlayers.org/>)
-
-*/
-
-/* Contains portions of Prototype.js:
- *
- * Prototype JavaScript framework, version 1.4.0
- *  (c) 2005 Sam Stephenson <sam@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/
- *
- *--------------------------------------------------------------------------*/
-
-/**
-*
-*  Contains portions of Rico <http://openrico.org/>
-*
-*  Copyright 2005 Sabre Airline Solutions
-*
-*  Licensed under the Apache License, Version 2.0 (the "License"); you
-*  may not use this file except in compliance with the License. You
-*  may obtain a copy of the License at
-*
-*         http://www.apache.org/licenses/LICENSE-2.0
-*
-*  Unless required by applicable law or agreed to in writing, software
-*  distributed under the License is distributed on an "AS IS" BASIS,
-*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-*  implied. See the License for the specific language governing
-*  permissions and limitations under the License.
-*
-**/
-
-var OpenLayers={singleFile:true};(function(){var singleFile=(typeof \
OpenLayers=="object"&&OpenLayers.singleFile);window.OpenLayers={_scriptName:(!singleFile)?"lib/OpenLayers.js":"OpenLayers.js",_getScriptLocation:function(){var \
scriptLocation="";var scriptName=OpenLayers._scriptName;var \
scripts=document.getElementsByTagName('script');for(var i=0;i<scripts.length;i++){var \
src=scripts[i].getAttribute('src');if(src){var index=src.lastIndexOf(scriptName);var \
                pathLength=src.lastIndexOf('?');if(pathLength<0){pathLength=src.length;}
                
-if((index>-1)&&(index+scriptName.length==pathLength)){scriptLocation=src.slice(0,pathLength-scriptName.length);break;}}}
                
-return scriptLocation;}};if(!singleFile){var jsfiles=new \
Array("OpenLayers/Util.js","OpenLayers/BaseTypes.js","OpenLayers/BaseTypes/Class.js"," \
OpenLayers/BaseTypes/Bounds.js","OpenLayers/BaseTypes/Element.js","OpenLayers/BaseType \
s/LonLat.js","OpenLayers/BaseTypes/Pixel.js","OpenLayers/BaseTypes/Size.js","OpenLayer \
s/Console.js","OpenLayers/Tween.js","Rico/Corner.js","Rico/Color.js","OpenLayers/Ajax. \
js","OpenLayers/Events.js","OpenLayers/Projection.js","OpenLayers/Map.js","OpenLayers/ \
Layer.js","OpenLayers/Icon.js","OpenLayers/Marker.js","OpenLayers/Marker/Box.js","Open \
Layers/Popup.js","OpenLayers/Tile.js","OpenLayers/Tile/Image.js","OpenLayers/Tile/WFS. \
js","OpenLayers/Layer/Image.js","OpenLayers/Layer/SphericalMercator.js","OpenLayers/La \
yer/EventPane.js","OpenLayers/Layer/FixedZoomLevels.js","OpenLayers/Layer/Google.js"," \
OpenLayers/Layer/VirtualEarth.js","OpenLayers/Layer/Yahoo.js","OpenLayers/Layer/HTTPRequest.js","OpenLayers/Layer/Grid.js","OpenLayers/Layer/MapGuide.js","Ope
  nLayers/Layer/MapServer.js","OpenLayers/Layer/MapServer/Untiled.js","OpenLayers/Laye \
r/KaMap.js","OpenLayers/Layer/MultiMap.js","OpenLayers/Layer/Markers.js","OpenLayers/L \
ayer/Text.js","OpenLayers/Layer/WorldWind.js","OpenLayers/Layer/WMS.js","OpenLayers/La \
yer/WMS/Untiled.js","OpenLayers/Layer/GeoRSS.js","OpenLayers/Layer/Boxes.js","OpenLaye \
rs/Layer/TMS.js","OpenLayers/Layer/TileCache.js","OpenLayers/Popup/Anchored.js","OpenL \
ayers/Popup/AnchoredBubble.js","OpenLayers/Popup/Framed.js","OpenLayers/Popup/FramedCl \
oud.js","OpenLayers/Feature.js","OpenLayers/Feature/Vector.js","OpenLayers/Feature/WFS \
.js","OpenLayers/Handler.js","OpenLayers/Handler/Click.js","OpenLayers/Handler/Hover.j \
s","OpenLayers/Handler/Point.js","OpenLayers/Handler/Path.js","OpenLayers/Handler/Poly \
gon.js","OpenLayers/Handler/Feature.js","OpenLayers/Handler/Drag.js","OpenLayers/Handl \
er/RegularPolygon.js","OpenLayers/Handler/Box.js","OpenLayers/Handler/MouseWheel.js","OpenLayers/Handler/Keyboard.js","OpenLayers/C
  ontrol.js","OpenLayers/Control/Attribution.js","OpenLayers/Control/Button.js","OpenL \
ayers/Control/ZoomBox.js","OpenLayers/Control/ZoomToMaxExtent.js","OpenLayers/Control/ \
DragPan.js","OpenLayers/Control/Navigation.js","OpenLayers/Control/MouseDefaults.js"," \
OpenLayers/Control/MousePosition.js","OpenLayers/Control/OverviewMap.js","OpenLayers/C \
ontrol/KeyboardDefaults.js","OpenLayers/Control/PanZoom.js","OpenLayers/Control/PanZoo \
mBar.js","OpenLayers/Control/ArgParser.js","OpenLayers/Control/Permalink.js","OpenLaye \
rs/Control/Scale.js","OpenLayers/Control/ScaleLine.js","OpenLayers/Control/LayerSwitch \
er.js","OpenLayers/Control/DrawFeature.js","OpenLayers/Control/DragFeature.js","OpenLa \
yers/Control/ModifyFeature.js","OpenLayers/Control/Panel.js","OpenLayers/Control/Selec \
tFeature.js","OpenLayers/Control/NavigationHistory.js","OpenLayers/Geometry.js","OpenL \
ayers/Geometry/Rectangle.js","OpenLayers/Geometry/Collection.js","OpenLayers/Geometry/Point.js","OpenLayers/Geometry/MultiPoint.js"
  ,"OpenLayers/Geometry/Curve.js","OpenLayers/Geometry/LineString.js","OpenLayers/Geom \
etry/LinearRing.js","OpenLayers/Geometry/Polygon.js","OpenLayers/Geometry/MultiLineStr \
ing.js","OpenLayers/Geometry/MultiPolygon.js","OpenLayers/Geometry/Surface.js","OpenLa \
yers/Renderer.js","OpenLayers/Renderer/Elements.js","OpenLayers/Renderer/SVG.js","Open \
Layers/Renderer/VML.js","OpenLayers/Layer/Vector.js","OpenLayers/Layer/PointTrack.js", \
"OpenLayers/Layer/GML.js","OpenLayers/Style.js","OpenLayers/StyleMap.js","OpenLayers/R \
ule.js","OpenLayers/Filter.js","OpenLayers/Filter/FeatureId.js","OpenLayers/Filter/Log \
ical.js","OpenLayers/Filter/Comparison.js","OpenLayers/Format.js","OpenLayers/Format/X \
ML.js","OpenLayers/Format/GML.js","OpenLayers/Format/KML.js","OpenLayers/Format/GeoRSS \
.js","OpenLayers/Format/WFS.js","OpenLayers/Format/WKT.js","OpenLayers/Format/OSM.js", \
"OpenLayers/Format/SLD.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/SLD/v1_0_0.js","OpenLayers/Format/Text.js","OpenLayers/
  Format/JSON.js","OpenLayers/Format/GeoJSON.js","OpenLayers/Format/WMC.js","OpenLayer \
s/Format/WMC/v1.js","OpenLayers/Format/WMC/v1_0_0.js","OpenLayers/Format/WMC/v1_1_0.js \
","OpenLayers/Layer/WFS.js","OpenLayers/Control/MouseToolbar.js","OpenLayers/Control/N \
avToolbar.js","OpenLayers/Control/EditingToolbar.js","OpenLayers/Lang.js","OpenLayers/Lang/en.js");var \
agent=navigator.userAgent;var \
docWrite=(agent.match("MSIE")||agent.match("Safari"));if(docWrite){var \
                allScriptTags=new Array(jsfiles.length);}
-var host=OpenLayers._getScriptLocation()+"lib/";for(var \
i=0;i<jsfiles.length;i++){if(docWrite){allScriptTags[i]="<script \
src='"+host+jsfiles[i]+"'></script>";}else{var \
s=document.createElement("script");s.src=host+jsfiles[i];var \
h=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;h.appendChild(s);}}
                
-if(docWrite){document.write(allScriptTags.join(""));}}})();OpenLayers.VERSION_NUMBER="$Revision: \
6819 $";OpenLayers.String={startsWith:function(str,sub){return(str.indexOf(sub)==0);}, \
contains:function(str,sub){return(str.indexOf(sub)!=-1);},trim:function(str){return \
str.replace(/^\s*(.*?)\s*$/,"$1");},camelize:function(str){var \
oStringList=str.split('-');var camelizedString=oStringList[0];for(var \
i=1;i<oStringList.length;i++){var \
                s=oStringList[i];camelizedString+=s.charAt(0).toUpperCase()+s.substring(1);}
                
-return camelizedString;},format:function(template,context,args){if(!context){context=window;}
                
-var tokens=template.split("${");var item,last,replacement;for(var \
i=1;i<tokens.length;i++){item=tokens[i];last=item.indexOf("}");if(last>0){replacement=context[item.substring(0,last)];if(typeof \
replacement=="function"){replacement=args?replacement.apply(null,args):replacement();}
                
-tokens[i]=replacement+item.substring(++last);}else{tokens[i]="${"+item;}}
-return tokens.join("");}};if(!String.prototype.startsWith){String.prototype.startsWit \
h=function(sStart){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{'newMethod':'OpenLayers.String.startsWith'}));return \
                OpenLayers.String.startsWith(this,sStart);};}
-if(!String.prototype.contains){String.prototype.contains=function(str){OpenLayers.Con \
sole.warn(OpenLayers.i18n("methodDeprecated",{'newMethod':'OpenLayers.String.contains'}));return \
                OpenLayers.String.contains(this,str);};}
-if(!String.prototype.trim){String.prototype.trim=function(){OpenLayers.Console.warn(O \
penLayers.i18n("methodDeprecated",{'newMethod':'OpenLayers.String.trim'}));return \
                OpenLayers.String.trim(this);};}
-if(!String.prototype.camelize){String.prototype.camelize=function(){OpenLayers.Consol \
e.warn(OpenLayers.i18n("methodDeprecated",{'newMethod':'OpenLayers.String.camelize'}));return \
                OpenLayers.String.camelize(this);};}
-OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(num,sig){var \
                fig=0;if(sig>0){fig=parseFloat(num.toPrecision(sig));}
-return fig;},format:function(num,dec,tsep,dsep){dec=(typeof \
dec!="undefined")?dec:0;tsep=(typeof \
tsep!="undefined")?tsep:OpenLayers.Number.thousandsSeparator;dsep=(typeof \
dsep!="undefined")?dsep:OpenLayers.Number.decimalSeparator;if(dec!=null){num=parseFloat(num.toFixed(dec));}
                
-var parts=num.toString().split(".");if(parts.length==1&&dec==null){dec=0;}
-var integer=parts[0];if(tsep){var \
thousands=/(-?[0-9]+)([0-9]{3})/;while(thousands.test(integer)){integer=integer.replace(thousands,"$1"+tsep+"$2");}}
                
-var str;if(dec==0){str=integer;}else{var \
rem=parts.length>1?parts[1]:"0";if(dec!=null){rem=rem+new \
                Array(dec-rem.length+1).join("0");}
-str=integer+dsep+rem;}
-return str;}};if(!Number.prototype.limitSigDigs){Number.prototype.limitSigDigs=functi \
on(sig){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{'newMethod':'OpenLayers.String.limitSigDigs'}));return \
                OpenLayers.Number.limitSigDigs(this,sig);};}
-OpenLayers.Function={bind:function(func,object){var \
args=Array.prototype.slice.apply(arguments,[2]);return function(){var \
newArgs=args.concat(Array.prototype.slice.apply(arguments,[0]));return \
func.apply(object,newArgs);};},bindAsEventListener:function(func,object){return \
function(event){return \
func.call(object,event||window.event);};}};if(!Function.prototype.bind){Function.proto \
type.bind=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{'newM \
ethod':'OpenLayers.String.bind'}));Array.prototype.unshift.apply(arguments,[this]);return \
                OpenLayers.Function.bind.apply(null,arguments);};}
-if(!Function.prototype.bindAsEventListener){Function.prototype.bindAsEventListener=fu \
nction(object){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{'newMethod':'OpenLayers.String.bindAsEventListener'}));return \
                OpenLayers.Function.bindAsEventListener(this,object);};}
-OpenLayers.Array={filter:function(array,callback,caller){var \
selected=[];if(Array.prototype.filter){selected=array.filter(callback,caller);}else{var \
                len=array.length;if(typeof callback!="function"){throw new \
                TypeError();}
-for(var i=0;i<len;i++){if(i in array){var \
                val=array[i];if(callback.call(caller,val,i,array)){selected.push(val);}}}}
                
-return selected;}};OpenLayers.Class=function(){var \
Class=function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments);}};var \
extended={};var parent;for(var i=0;i<arguments.length;++i){if(typeof \
                arguments[i]=="function"){parent=arguments[i].prototype;}else{parent=arguments[i];}
                
-OpenLayers.Util.extend(extended,parent);}
-Class.prototype=extended;return \
Class;};OpenLayers.Class.isPrototype=function(){};OpenLayers.Class.create=function(){return \
function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments);}};};OpenLayers.Class.inherit=function(){var \
superClass=arguments[0];var proto=new \
superClass(OpenLayers.Class.isPrototype);for(var \
i=1;i<arguments.length;i++){if(typeof arguments[i]=="function"){var \
                mixin=arguments[i];arguments[i]=new \
                mixin(OpenLayers.Class.isPrototype);}
-OpenLayers.Util.extend(proto,arguments[i]);}
-return proto;};OpenLayers.Util={};OpenLayers.Util.getElement=function(){var \
elements=[];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;};if($==null){var $=OpenLayers.Util.getElement;}
-OpenLayers.Util.extend=function(destination,source){if(destination&&source){for(var \
property in source){var \
                value=source[property];if(value!==undefined){destination[property]=value;}}
                
-var sourceIsEvt=typeof window.Event=="function"&&source instanceof \
window.Event;if(!sourceIsEvt&&source.hasOwnProperty&&source.hasOwnProperty('toString')){destination.toString=source.toString;}}
                
-return destination;};OpenLayers.Util.removeItem=function(array,item){for(var \
                i=array.length-1;i>=0;i--){if(array[i]==item){array.splice(i,1);}}
-return array;};OpenLayers.Util.clearArray=function(array){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{'newMethod':'array \
= []'}));array.length=0;};OpenLayers.Util.indexOf=function(array,obj){for(var \
                i=0;i<array.length;i++){if(array[i]==obj){return i;}}
-return-1;};OpenLayers.Util.modifyDOMElement=function(element,id,px,sz,position,border,overflow,opacity){if(id){element.id=id;}
                
-if(px){element.style.left=px.x+"px";element.style.top=px.y+"px";}
-if(sz){element.style.width=sz.w+"px";element.style.height=sz.h+"px";}
-if(position){element.style.position=position;}
-if(border){element.style.border=border;}
-if(overflow){element.style.overflow=overflow;}
-if(parseFloat(opacity)>=0.0&&parseFloat(opacity)<1.0){element.style.filter='alpha(opacity='+(opacity*100)+')';element.style.opacity=opacity;}else \
if(parseFloat(opacity)==1.0){element.style.filter='';element.style.opacity='';}};OpenL \
ayers.Util.createDiv=function(id,px,sz,imgURL,position,border,overflow,opacity){var \
dom=document.createElement('div');if(imgURL){dom.style.backgroundImage='url('+imgURL+')';}
                
-if(!id){id=OpenLayers.Util.createUniqueID("OpenLayersDiv");}
-if(!position){position="absolute";}
-OpenLayers.Util.modifyDOMElement(dom,id,px,sz,position,border,overflow,opacity);return \
dom;};OpenLayers.Util.createImage=function(id,px,sz,imgURL,position,border,opacity,delayDisplay){var \
image=document.createElement("img");if(!id){id=OpenLayers.Util.createUniqueID("OpenLayersDiv");}
                
-if(!position){position="relative";}
-OpenLayers.Util.modifyDOMElement(image,id,px,sz,position,border,null,opacity);if(dela \
yDisplay){image.style.display="none";OpenLayers.Event.observe(image,"load",OpenLayers. \
Function.bind(OpenLayers.Util.onImageLoad,image));OpenLayers.Event.observe(image,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,image));}
                
-image.style.alt=id;image.galleryImg="no";if(imgURL){image.src=imgURL;}
-return image;};OpenLayers.Util.setOpacity=function(element,opacity){OpenLayers.Util.m \
odifyDOMElement(element,null,null,null,null,null,null,opacity);};OpenLayers.Util.onIma \
geLoad=function(){if(!this.viewRequestID||(this.map&&this.viewRequestID==this.map.view \
RequestID)){this.style.backgroundColor=null;this.style.display="";}};OpenLayers.Util.o \
nImageLoadErrorColor="pink";OpenLayers.IMAGE_RELOAD_ATTEMPTS=0;OpenLayers.Util.onImage \
LoadError=function(){this._attempts=(this._attempts)?(this._attempts+1):1;if(this._att \
empts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){this.src=this.src;}else{this.style.backgroundColor=OpenLayers.Util.onImageLoadErrorColor;}
                
-this.style.display="";};OpenLayers.Util.alphaHack=function(){var \
arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);var \
                filterúlse;try{filter=!!(document.body.filters);}catch(e){}
-return(filter&&(version>=5.5)&&(version<7));};OpenLayers.Util.modifyAlphaImageDiv=fun \
ction(div,id,px,sz,imgURL,position,border,sizing,opacity){OpenLayers.Util.modifyDOMElement(div,id,px,sz,null,null,null,opacity);var \
                img=div.childNodes[0];if(imgURL){img.src=imgURL;}
-OpenLayers.Util.modifyDOMElement(img,div.id+"_innerImage",null,sz,"relative",border); \
if(OpenLayers.Util.alphaHack()){div.style.display="inline-block";if(sizing==null){sizing="scale";}
                
-div.style.filter="progid:DXImageTransform.Microsoft"+".AlphaImageLoader(src='"+img.src+"', \
"+"sizingMethod='"+sizing+"')";if(parseFloat(div.style.opacity)>=0.0&&parseFloat(div.style.opacity)<1.0){div.style.filter+=" \
                alpha(opacity="+div.style.opacity*100+")";}
-img.style.filter="alpha(opacity=0)";}};OpenLayers.Util.createAlphaImageDiv=function(id,px,sz,imgURL,position,border,sizing,opacity,delayDisplay){var \
div=OpenLayers.Util.createDiv();var \
img=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);div.appendCh \
ild(img);if(delayDisplay){img.style.display="none";OpenLayers.Event.observe(img,"load" \
,OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,div));OpenLayers.Event.observe(img,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,div));}
                
-OpenLayers.Util.modifyAlphaImageDiv(div,id,px,sz,imgURL,position,border,sizing,opacity);return \
div;};OpenLayers.Util.upperCaseObject=function(object){var uObject={};for(var key in \
                object){uObject[key.toUpperCase()]=object[key];}
-return uObject;};OpenLayers.Util.applyDefaults=function(to,from){var \
fromIsEvt=typeof window.Event=="function"&&from instanceof window.Event;for(var key \
in from){if(to[key]===undefined||(!fromIsEvt&&from.hasOwnProperty&&from.hasOwnProperty(key)&&!to.hasOwnProperty(key))){to[key]=from[key];}}
                
-if(!fromIsEvt&&from.hasOwnProperty&&from.hasOwnProperty('toString')&&!to.hasOwnProperty('toString')){to.toString=from.toString;}
                
-return to;};OpenLayers.Util.getParameterString=function(params){var \
paramsArray=[];for(var key in params){var value=params[key];if((value!=null)&&(typeof \
value!='function')){var encodedValue;if(typeof \
value=='object'&&value.constructor==Array){var encodedItemArray=[];for(var \
itemIndex=0;itemIndex<value.length;itemIndex++){encodedItemArray.push(encodeURIComponent(value[itemIndex]));}
                
-encodedValue=encodedItemArray.join(",");}
-else{encodedValue=encodeURIComponent(value);}
-paramsArray.push(encodeURIComponent(key)+"="+encodedValue);}}
-return paramsArray.join("&");};OpenLayers.ImgPath='';OpenLayers.Util.getImagesLocation=function(){return \
OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/");};OpenLayers.Util.Try=function(){var \
returnValue=null;for(var i=0;i<arguments.length;i++){var \
                lambda=arguments[i];try{returnValue=lambda();break;}catch(e){}}
-return returnValue;};OpenLayers.Util.getNodes=function(p,tagName){var \
nodes=OpenLayers.Util.Try(function(){return \
OpenLayers.Util._getNodes(p.documentElement.childNodes,tagName);},function(){return \
OpenLayers.Util._getNodes(p.childNodes,tagName);});return \
nodes;};OpenLayers.Util._getNodes=function(nodes,tagName){var retArray=[];for(var \
                i=0;i<nodes.length;i++){if(nodes[i].nodeName==tagName){retArray.push(nodes[i]);}}
                
-return retArray;};OpenLayers.Util.getTagText=function(parent,item,index){var \
                result=OpenLayers.Util.getNodes(parent,item);if(result&&(result.length>0))
                
-{if(!index){index=0;}
-if(result[index].childNodes.length>1){return result.childNodes[1].nodeValue;}
-else if(result[index].childNodes.length==1){return \
result[index].firstChild.nodeValue;}}else{return"";}};OpenLayers.Util.getXmlNodeValue=function(node){var \
                val=null;OpenLayers.Util.Try(function(){val=node.text;if(!val){val=node.textContent;}
                
-if(!val){val=node.firstChild.nodeValue;}},function(){val=node.textContent;});return \
val;};OpenLayers.Util.mouseLeft=function(evt,div){var \
target=(evt.relatedTarget)?evt.relatedTarget:evt.toElement;while(target!=div&&target!=null){target=target.parentNode;}
                
-return(target!=div);};OpenLayers.Util.rad=function(x){return \
x*Math.PI/180;};OpenLayers.Util.distVincenty=function(p1,p2){var \
ac78137,bc56752.3142,f=1/298.257223563;var L=OpenLayers.Util.rad(p2.lon-p1.lon);var \
U1=Math.atan((1-f)*Math.tan(OpenLayers.Util.rad(p1.lat)));var \
U2=Math.atan((1-f)*Math.tan(OpenLayers.Util.rad(p2.lat)));var \
sinU1=Math.sin(U1),cosU1=Math.cos(U1);var sinU2=Math.sin(U2),cosU2=Math.cos(U2);var \
lambda=L,lambdaP=2*Math.PI;var iterLimit \
;while(Math.abs(lambda-lambdaP)>1e-12&&--iterLimit>0){var \
sinLambda=Math.sin(lambda),cosLambda=Math.cos(lambda);var \
                sinSigma=Math.sqrt((cosU2*sinLambda)*(cosU2*sinLambda)+
-(cosU1*sinU2-sinU1*cosU2*cosLambda)*(cosU1*sinU2-sinU1*cosU2*cosLambda));if(sinSigma==0){return \
                0;}
-var cosSigma=sinU1*sinU2+cosU1*cosU2*cosLambda;var \
sigma=Math.atan2(sinSigma,cosSigma);var \
alpha=Math.asin(cosU1*cosU2*sinLambda/sinSigma);var \
cosSqAlpha=Math.cos(alpha)*Math.cos(alpha);var \
cos2SigmaM=cosSigma-2*sinU1*sinU2/cosSqAlpha;var \
C=f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha));lambdaP=lambda;lambda=L+(1-C)*f*Math.sin(alpha)*(sigma+C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)));}
                
-if(iterLimit==0){return NaN;}
-var uSq=cosSqAlpha*(a*a-b*b)/(b*b);var \
A=1+uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));var \
B=uSq/1024*(256+uSq*(-128+uSq*(74-47*uSq)));var \
                deltaSigma=B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)-
                
-B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM)));var \
s=b*A*(sigma-deltaSigma);var d=s.toFixed(3)/1000;return \
d;};OpenLayers.Util.getParameters=function(url){url=url||window.location.href;var \
paramsString="";if(OpenLayers.String.contains(url,'?')){var \
start=url.indexOf('?')+1;var \
end=OpenLayers.String.contains(url,"#")?url.indexOf('#'):url.length;paramsString=url.substring(start,end);}
                
-var parameters={};var pairs=paramsString.split(/[&;]/);for(var \
i=0;i<pairs.length;++i){var keyValue=pairs[i].split('=');if(keyValue[0]){var \
keyÞcodeURIComponent(keyValue[0]);var \
value=keyValue[1]||'';value=value.split(",");for(var \
                j=0;j<value.length;j++){value[j]ÞcodeURIComponent(value[j]);}
-if(value.length==1){value=value[0];}
-parameters[key]=value;}}
-return parameters;};OpenLayers.Util.getArgs=function(url){OpenLayers.Console.warn(Ope \
nLayers.i18n("methodDeprecated",{'newMethod':'OpenLayers.Util.getParameters'}));return \
OpenLayers.Util.getParameters(url);};OpenLayers.Util.lastSeqID=0;OpenLayers.Util.createUniqueID=function(prefix){if(prefix==null){prefix="id_";}
                
-OpenLayers.Util.lastSeqID+=1;return \
prefix+OpenLayers.Util.lastSeqID;};OpenLayers.INCHES_PER_UNIT={'inches':1.0,'ft':12.0, \
'mi':63360.0,'m':39.3701,'km':39370.1,'dd':4374754,'yd':36};OpenLayers.INCHES_PER_UNIT \
["in"]=OpenLayers.INCHES_PER_UNIT.inches;OpenLayers.INCHES_PER_UNIT["degrees"]=OpenLay \
ers.INCHES_PER_UNIT.dd;OpenLayers.INCHES_PER_UNIT["nmi"]52*OpenLayers.INCHES_PER_UNIT.m;OpenLayers.DOTS_PER_INCHr;OpenLayers.Util.normalizeScale=function(scale){var \
normScale=(scale>1.0)?(1.0/scale):scale;return \
normScale;};OpenLayers.Util.getResolutionFromScale=function(scale,units){if(units==null){units="degrees";}
                
-var normScale=OpenLayers.Util.normalizeScale(scale);var \
resolution=1/(normScale*OpenLayers.INCHES_PER_UNIT[units]*OpenLayers.DOTS_PER_INCH);return \
resolution;};OpenLayers.Util.getScaleFromResolution=function(resolution,units){if(units==null){units="degrees";}
                
-var scale=resolution*OpenLayers.INCHES_PER_UNIT[units]*OpenLayers.DOTS_PER_INCH;return \
scale;};OpenLayers.Util.safeStopPropagation=function(evt){OpenLayers.Event.stop(evt,true);};OpenLayers.Util.pagePosition=function(forElement){var \
valueT=0,valueL=0;var element=forElement;var \
child=forElement;while(element){if(element==document.body){if(child&&child.style&&OpenLayers.Element.getStyle(child,'position')=='absolute'){break;}}
                
-valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;child=element;try{element= \
element.offsetParent;}catch(e){OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{'elemId':element.id}));break;}}
                
-element=forElement;while(element){valueT-=element.scrollTop||0;valueL-=element.scrollLeft||0;element=element.parentNode;}
                
-return[valueL,valueT];};OpenLayers.Util.isEquivalentUrl=function(url1,url2,options){o \
ptions=options||{};OpenLayers.Util.applyDefaults(options,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var \
urlObj1=OpenLayers.Util.createUrlObject(url1,options);var \
urlObj2=OpenLayers.Util.createUrlObject(url2,options);for(var key in \
                urlObj1){if(options.test){alert(key+"\n1:"+urlObj1[key]+"\n2:"+urlObj2[key]);}
                
-var val1=urlObj1[key];var \
val2=urlObj2[key];switch(key){case"args":break;case"host":case"port":case"protocol":if((val1=="")||(val2=="")){break;}
                
-default:if((key!="args")&&(urlObj1[key]!=urlObj2[key])){return false;}
-break;}}
-for(var key in urlObj1.args){if(urlObj1.args[key]!=urlObj2.args[key]){return false;}
-delete urlObj2.args[key];}
-for(var key in urlObj2.args){return false;}
-return true;};OpenLayers.Util.createUrlObject=function(url,options){options=options||{};var \
                urlObject={};if(options.ignoreCase){url=url.toLowerCase();}
-var a=document.createElement('a');a.href=url;urlObject.host=a.host;var \
port=a.port;if(port.length<=0){var \
newHostLength=urlObject.host.length-(port.length);urlObject.host=urlObject.host.substring(0,newHostLength);}
                
-urlObject.protocol=a.protocol;urlObject.port=((port=="80")&&(options.ignorePort80))?"":port;urlObject.hash=(options.ignoreHash)?"":a.hash;var \
queryString=a.search;if(!queryString){var \
                qMark=url.indexOf("?");queryString=(qMark!=-1)?url.substr(qMark):"";}
-urlObject.args=OpenLayers.Util.getParameters(queryString);if(((urlObject.protocol=="f \
ile:")&&(url.indexOf("file:")!=-1))||((urlObject.protocol!="file:")&&(urlObject.host!=""))){urlObject.pathname=a.pathname;var \
qIndex=urlObject.pathname.indexOf("?");if(qIndex!=-1){urlObject.pathname=urlObject.pathname.substring(0,qIndex);}}else{var \
relStr=OpenLayers.Util.removeTail(url);var backs=0;do{var \
index=relStr.indexOf("../");if(index==0){backs++;relStr=relStr.substr(3);}else \
if(index>=0){var prevChunk=relStr.substr(0,index-1);var \
slash=prevChunk.indexOf("/");prevChunk=(slash!=-1)?prevChunk.substr(0,slash+1):"";var \
                postChunk=relStr.substr(index+3);relStr=prevChunk+postChunk;}}while(index!=-1)
                
-var windowAnchor=document.createElement("a");var \
windowUrl=window.location.href;if(options.ignoreCase){windowUrl=windowUrl.toLowerCase();}
                
-windowAnchor.href=windowUrl;urlObject.protocol=windowAnchor.protocol;var \
splitter=(windowAnchor.pathname.indexOf("/")!=-1)?"/":"\\";var \
dirs=windowAnchor.pathname.split(splitter);dirs.pop();while((backs>0)&&(dirs.length>0)){dirs.pop();backs--;}
                
-relStr=dirs.join("/")+"/"+relStr;urlObject.pathname=relStr;}
-if((urlObject.protocol=="file:")||(urlObject.protocol=="")){urlObject.host="localhost";}
                
-return urlObject;};OpenLayers.Util.removeTail=function(url){var head=null;var \
qMark=url.indexOf("?");var \
hashMark=url.indexOf("#");if(qMark==-1){head=(hashMark!=-1)?url.substr(0,hashMark):url \
;}else{head=(hashMark!=-1)?url.substr(0,Math.min(qMark,hashMark)):url.substr(0,qMark);}
                
-return head;};OpenLayers.Util.getBrowserName=function(){var browserName="";var \
ua=navigator.userAgent.toLowerCase();if(ua.indexOf("opera")!=-1){browserName="opera";}else \
if(ua.indexOf("msie")!=-1){browserName="msie";}else \
if(ua.indexOf("safari")!=-1){browserName="safari";}else \
if(ua.indexOf("mozilla")!=-1){if(ua.indexOf("firefox")!=-1){browserName="firefox";}else{browserName="mozilla";}}
                
-return browserName;};OpenLayers.Util.getRenderedDimensions=function(contentHTML,size){var \
w=h=null;var container=document.createElement("div");container.style.overflow="";conta \
iner.style.position="absolute";container.style.left="-9999px";if(size){if(size.w){w=container.style.width=size.w;}else \
                if(size.h){h=container.style.height=size.h;}}
-var content=document.createElement("div");content.innerHTML=contentHTML;container.app \
endChild(content);document.body.appendChild(container);if(!w){w=parseInt(content.scrollWidth);container.style.width=w+"px";}
                
-if(!h){h=parseInt(content.scrollHeight);}
-container.removeChild(content);document.body.removeChild(container);return new \
OpenLayers.Size(w,h);};OpenLayers.Util.getScrollbarWidth=function(){var \
scrollbarWidth=OpenLayers.Util._scrollbarWidth;if(scrollbarWidth==null){var \
scr=null;var inn=null;var wNoScroll=0;var \
wScroll=0;scr=document.createElement('div');scr.style.position='absolute';scr.style.to \
p='-1000px';scr.style.left='-1000px';scr.style.width='100px';scr.style.height='50px';s \
cr.style.overflow='hidden';inn=document.createElement('div');inn.style.width='100%';in \
n.style.height='200px';scr.appendChild(inn);document.body.appendChild(scr);wNoScroll=i \
nn.offsetWidth;scr.style.overflow='scroll';wScroll=inn.offsetWidth;document.body.remov \
eChild(document.body.lastChild);OpenLayers.Util._scrollbarWidth=(wNoScroll-wScroll);scrollbarWidth=OpenLayers.Util._scrollbarWidth;}
                
-return scrollbarWidth;};OpenLayers.Rico=new \
Object();OpenLayers.Rico.Corner={round:function(e,options){e=OpenLayers.Util.getElement(e);this._setOptions(options);var \
color=this.options.color;if(this.options.color=="fromElement"){color=this._background(e);}
                
-var bgColor=this.options.bgColor;if(this.options.bgColor=="fromParent"){bgColor=this._background(e.offsetParent);}
                
-this._roundCornersImpl(e,color,bgColor);},changeColor:function(theDiv,newColor){theDiv.style.backgroundColor=newColor;var \
spanElements=theDiv.parentNode.getElementsByTagName("span");for(var \
currIdx=0;currIdx<spanElements.length;currIdx++){spanElements[currIdx].style.backgroundColor=newColor;}},changeOpacity:function(theDiv,newOpacity){var \
mozillaOpacity=newOpacity;var \
ieOpacity='alpha(opacity='+newOpacity*100+')';theDiv.style.opacity=mozillaOpacity;theDiv.style.filter=ieOpacity;var \
spanElements=theDiv.parentNode.getElementsByTagName("span");for(var \
currIdx=0;currIdx<spanElements.length;currIdx++){spanElements[currIdx].style.opacity=m \
ozillaOpacity;spanElements[currIdx].style.filter=ieOpacity;}},reRound:function(theDiv,options){var \
topRico=theDiv.parentNode.childNodes[0];var \
bottomRico=theDiv.parentNode.childNodes[2];theDiv.parentNode.removeChild(topRico);theD \
iv.parentNode.removeChild(bottomRico);this.round(theDiv.parentNode,options);},_roundCornersImpl:function(e,color,bgColo
  r){if(this.options.border){this._renderBorder(e,bgColor);}
-if(this._isTopRounded()){this._roundTopCorners(e,color,bgColor);}
-if(this._isBottomRounded()){this._roundBottomCorners(e,color,bgColor);}},_renderBorder:function(el,bgColor){var \
borderValue="1px solid "+this._borderColor(bgColor);var borderL="border-left: \
"+borderValue;var borderR="border-right: "+borderValue;var \
style="style='"+borderL+";"+borderR+"'";el.innerHTML="<div \
"+style+">"+el.innerHTML+"</div>";},_roundTopCorners:function(el,color,bgColor){var \
corner=this._createCorner(bgColor);for(var \
i=0;i<this.options.numSlices;i++){corner.appendChild(this._createCornerSlice(color,bgColor,i,"top"));}
                
-el.style.paddingTop=0;el.insertBefore(corner,el.firstChild);},_roundBottomCorners:function(el,color,bgColor){var \
corner=this._createCorner(bgColor);for(var \
i=(this.options.numSlices-1);i>=0;i--){corner.appendChild(this._createCornerSlice(color,bgColor,i,"bottom"));}
                
-el.style.paddingBottom=0;el.appendChild(corner);},_createCorner:function(bgColor){var \
corner=document.createElement("div");corner.style.backgroundColor=(this._isTransparent()?"transparent":bgColor);return \
corner;},_createCornerSlice:function(color,bgColor,n,position){var \
slice=document.createElement("span");var \
inStyle=slice.style;inStyle.backgroundColor=color;inStyle.display="block";inStyle.height="1px";inStyle.overflow="hidden";inStyle.fontSize="1px";var \
borderColor=this._borderColor(color,bgColor);if(this.options.border&&n==0){inStyle.bor \
derTopStyle="solid";inStyle.borderTopWidth="1px";inStyle.borderLeftWidth="0px";inStyle \
.borderRightWidth="0px";inStyle.borderBottomWidth="0px";inStyle.height="0px";inStyle.borderColor=borderColor;}
                
-else if(borderColor){inStyle.borderColor=borderColor;inStyle.borderStyle="solid";inStyle.borderWidth="0px \
                1px";}
-if(!this.options.compact&&(n==(this.options.numSlices-1))){inStyle.height="2px";}
-this._setMargin(slice,n,position);this._setBorder(slice,n,position);return \
slice;},_setOptions:function(options){this.options={corners:"all",color:"fromElement", \
bgColor:"fromParent",blend:true,border:false,compact:false};OpenLayers.Util.extend(thi \
s.options,options||{});this.options.numSlices=this.options.compact?2:4;if(this._isTran \
sparent()){this.options.blendúlse;}},_whichSideTop:function(){if(this._hasString(this.options.corners,"all","top")){return"";}
                
-if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0){return"";}
                
-if(this.options.corners.indexOf("tl")>=0){return"left";}else \
                if(this.options.corners.indexOf("tr")>=0){return"right";}
-return"";},_whichSideBottom:function(){if(this._hasString(this.options.corners,"all","bottom")){return"";}
                
-if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0){return"";}
                
-if(this.options.corners.indexOf("bl")>=0){return"left";}else \
                if(this.options.corners.indexOf("br")>=0){return"right";}
-return"";},_borderColor:function(color,bgColor){if(color=="transparent"){return \
bgColor;}else if(this.options.border){return this.options.border;}else \
if(this.options.blend){return \
this._blend(bgColor,color);}else{return"";}},_setMargin:function(el,n,corners){var \
marginSize=this._marginSize(n);var \
whichSide=corners=="top"?this._whichSideTop():this._whichSideBottom();if(whichSide=="left"){el.style.marginLeft=marginSize+"px";el.style.marginRight="0px";}
                
-else if(whichSide=="right"){el.style.marginRight=marginSize+"px";el.style.marginLeft="0px";}
                
-else{el.style.marginLeft=marginSize+"px";el.style.marginRight=marginSize+"px";}},_setBorder:function(el,n,corners){var \
borderSize=this._borderSize(n);var \
whichSide=corners=="top"?this._whichSideTop():this._whichSideBottom();if(whichSide=="left"){el.style.borderLeftWidth=borderSize+"px";el.style.borderRightWidth="0px";}
                
-else if(whichSide=="right"){el.style.borderRightWidth=borderSize+"px";el.style.borderLeftWidth="0px";}
                
-else{el.style.borderLeftWidth=borderSize+"px";el.style.borderRightWidth=borderSize+"px";}
                
-if(this.options.border!úlse){el.style.borderLeftWidth=borderSize+"px";el.style.border \
RightWidth=borderSize+"px";}},_marginSize:function(n){if(this._isTransparent()){return \
                0;}
-var marginSizes=[5,3,2,1];var blendedMarginSizes=[3,2,1,0];var \
compactMarginSizes=[2,1];var \
smBlendedMarginSizes=[1,0];if(this.options.compact&&this.options.blend){return \
smBlendedMarginSizes[n];}else if(this.options.compact){return \
compactMarginSizes[n];}else if(this.options.blend){return \
blendedMarginSizes[n];}else{return marginSizes[n];}},_borderSize:function(n){var \
transparentBorderSizes=[5,3,2,1];var blendedBorderSizes=[2,1,1,1];var \
compactBorderSizes=[1,0];var \
actualBorderSizes=[0,2,0,0];if(this.options.compact&&(this.options.blend||this._isTransparent())){return \
1;}else if(this.options.compact){return compactBorderSizes[n];}else \
if(this.options.blend){return blendedBorderSizes[n];}else \
if(this.options.border){return actualBorderSizes[n];}else \
                if(this._isTransparent()){return transparentBorderSizes[n];}
-return 0;},_hasString:function(str){for(var \
i=1;i<arguments.length;i++)if(str.indexOf(arguments[i])>=0){return true;}return \
false;},_blend:function(c1,c2){var \
cc1=OpenLayers.Rico.Color.createFromHex(c1);cc1.blend(OpenLayers.Rico.Color.createFromHex(c2));return \
cc1;},_background:function(el){try{return \
OpenLayers.Rico.Color.createColorFromBackground(el).asHex();}catch(err){return"#ffffff";}},_isTransparent:function(){return \
this.options.color=="transparent";},_isTopRounded:function(){return \
this._hasString(this.options.corners,"all","top","tl","tr");},_isBottomRounded:function(){return \
this._hasString(this.options.corners,"all","bottom","bl","br");},_hasSingleTextChild:function(el){return \
el.childNodes.length==1&&el.childNodes[0].nodeType==3;}};OpenLayers.ProxyHost="";OpenL \
ayers.nullHandler=function(request){alert(OpenLayers.i18n("unhandledRequest",{'statusT \
ext':request.statusText}));};OpenLayers.loadURL=function(uri,params,caller,onComplete,onFailure){var \
success=(onComplete  \
)?OpenLayers.Function.bind(onComplete,caller):OpenLayers.nullHandler;var \
failure=(onFailure)?OpenLayers.Function.bind(onFailure,caller):OpenLayers.nullHandler;var \
request=new OpenLayers.Ajax.Request(uri,{method:'get',parameters:params,onComplete:success,onFailure:failure});return \
request.transport;};OpenLayers.parseXMLString=function(text){var \
                index=text.indexOf('<');if(index>0){text=text.substring(index);}
-var ajaxResponse=OpenLayers.Util.Try(function(){var xmldom=new \
ActiveXObject('Microsoft.XMLDOM');xmldom.loadXML(text);return \
xmldom;},function(){return new \
DOMParser().parseFromString(text,'text/xml');},function(){var req=new \
XMLHttpRequest();req.open("GET","data:"+"text/xml"+";charset=utf-8,"+encodeURIComponent(text),false);if(req.overrideMimeType){req.overrideMimeType("text/xml");}
                
-req.send(null);return req.responseXML;});return \
ajaxResponse;};OpenLayers.Ajax={emptyFunction:function(){},getTransport:function(){return \
OpenLayers.Util.Try(function(){return new XMLHttpRequest();},function(){return new \
ActiveXObject('Msxml2.XMLHTTP');},function(){return new \
ActiveXObject('Microsoft.XMLHTTP');})||false;},activeRequestCount:0};OpenLayers.Ajax.Responders={responders:[],register:function(responderToAdd){for(var \
                i=0;i<this.responders.length;i++){if(responderToAdd==this.responders[i]){return;}}
                
-this.responders.push(responderToAdd);},unregister:function(responderToRemove){OpenLay \
ers.Util.removeItem(this.reponders,responderToRemove);},dispatch:function(callback,request,transport){var \
responder;for(var i=0;i<this.responders.length;i++){responder=this.responders[i];if(responder[callback]&&typeof \
responder[callback]=='function'){try{responder[callback].apply(responder,[request,tran \
sport]);}catch(e){}}}}};OpenLayers.Ajax.Responders.register({onCreate:function(){OpenL \
ayers.Ajax.activeRequestCount++;},onComplete:function(){OpenLayers.Ajax.activeRequestC \
ount--;}});OpenLayers.Ajax.Base=OpenLayers.Class({initialize:function(options){this.op \
tions={method:'post',asynchronous:true,contentType:'application/xml',parameters:''};Op \
enLayers.Util.extend(this.options,options||{});this.options.method=this.options.method.toLowerCase();if(typeof \
this.options.parameters=='string'){this.options.parameters=OpenLayers.Util.getParameters(this.options.parameters);}}});OpenLayers.Ajax.Request=Op
  enLayers.Class(OpenLayers.Ajax.Base,{_complete:false,initialize:function(url,options \
){OpenLayers.Ajax.Base.prototype.initialize.apply(this,[options]);if(OpenLayers.ProxyH \
ost&&OpenLayers.String.startsWith(url,"http")){url=OpenLayers.ProxyHost+encodeURIComponent(url);}
                
-this.transport=OpenLayers.Ajax.getTransport();this.request(url);},request:function(url){this.url=url;this.method=this.options.method;var \
params=OpenLayers.Util.extend({},this.options.parameters);if(this.method!='get'&&this.method!='post'){params['_method']=this.method;this.method='post';}
                
-this.parameters=params;if(params=OpenLayers.Util.getParameterString(params)){if(this.method=='get'){this.url+=((this.url.indexOf('?')>-1)?'&':'?')+params;}else \
                if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){params+='&_=';}}
                
-try{var response=new \
OpenLayers.Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(response);}
                
-OpenLayers.Ajax.Responders.dispatch('onCreate',this,response);this.transport.open(thi \
s.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronou \
                s){window.setTimeout(OpenLayers.Function.bind(this.respondToReadyState,this,1),10);}
                
-this.transport.onreadystatechange=OpenLayers.Function.bind(this.onStateChange,this);t \
his.setRequestHeaders();this.body=this.method=='post'?(this.options.postBody||params): \
null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.over \
rideMimeType){this.onStateChange();}}catch(e){this.dispatchException(e);}},onStateChange:function(){var \
readyState=this.transport.readyState;if(readyState>1&&!((readyState==4)&&this._complet \
e)){this.respondToReadyState(this.transport.readyState);}},setRequestHeaders:function(){var \
headers={'X-Requested-With':'XMLHttpRequest','Accept':'text/javascript, text/html, \
application/xml, text/xml, \
*/*','OpenLayers':true};if(this.method=='post'){headers['Content-type']=this.options.contentType+
                
-(this.options.encoding?'; \
charset='+this.options.encoding:'');if(this.transport.overrideMimeType&&(navigator.use \
                rAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){headers['Connection']='close';}}
                
-if(typeof this.options.requestHeaders=='object'){var \
extras=this.options.requestHeaders;if(typeof extras.push=='function'){for(var \
i=0,length=extras.length;i<length;i+=2){headers[extras[i]]=extras[i+1];}}else{for(var \
                i in extras){headers[i]=pair[i];}}}
-for(var name in headers){this.transport.setRequestHeader(name,headers[name]);}},success:function(){var \
status=this.getStatus();return!status||(status> \
0&&status<300);},getStatus:function(){try{return \
this.transport.status||0;}catch(e){return \
0;}},respondToReadyState:function(readyState){var \
state=OpenLayers.Ajax.Request.Events[readyState];var response=new \
OpenLayers.Ajax.Response(this);if(state=='Complete'){try{this._complete=true;(this.opt \
ions['on'+response.status]||this.options['on'+(this.success()?'Success':'Failure')]||OpenLayers.Ajax.emptyFunction)(response);}catch(e){this.dispatchException(e);}
                
-var contentType=response.getHeader('Content-type');}
-try{(this.options['on'+state]||OpenLayers.Ajax.emptyFunction)(response);OpenLayers.Aj \
ax.Responders.dispatch('on'+state,this,response);}catch(e){this.dispatchException(e);}
                
-if(state=='Complete'){this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction;}},getHeader:function(name){try{return \
this.transport.getResponseHeader(name);}catch(e){return \
null;}},dispatchException:function(exception){var \
handler=this.options.onException;if(handler){handler(this,exception);OpenLayers.Ajax.Responders.dispatch('onException',this,exception);}else{var \
listenerúlse;var responders=OpenLayers.Ajax.Responders.responders;for(var \
                i=0;i<responders.length;i++){if(responders[i].onException){listener=true;break;}}
                
-if(listener){OpenLayers.Ajax.Responders.dispatch('onException',this,exception);}else{throw \
exception;}}}});OpenLayers.Ajax.Request.Events=['Uninitialized','Loading','Loaded','In \
teractive','Complete'];OpenLayers.Ajax.Response=OpenLayers.Class({status:0,statusText:'',initialize:function(request){this.request=request;var \
transport=this.transport=request.transport,readyState=this.readyState=transport.readyS \
tate;if((readyState>2&&!(!!(window.attachEvent&&!window.opera)))||readyState==4){this. \
status=this.getStatus();this.statusText=this.getStatusText();this.responseText=transport.responseText==null?'':String(transport.responseText);}
                
-if(readyState==4){var \
xml=transport.responseXML;this.responseXML=xml===undefined?null:xml;}},getStatus:OpenLayers.Ajax.Request.prototype.getStatus,getStatusText:function(){try{return \
this.transport.statusText||'';}catch(e){return'';}},getHeader:OpenLayers.Ajax.Request.prototype.getHeader,getResponseHeader:function(name){return \
this.transport.getResponseHeader(name);}});OpenLayers.Ajax.getElementsByTagNameNS=function(parentnode,nsuri,nsprefix,tagname){var \
elem=null;if(parentnode.getElementsByTagNameNS){elem=parentnode.getElementsByTagNameNS \
                (nsuri,tagname);}else{elem=parentnode.getElementsByTagName(nsprefix+':'+tagname);}
                
-return elem;};OpenLayers.Ajax.serializeXMLToString=function(xmldom){var \
serializer=new XMLSerializer();var data=serializer.serializeToString(xmldom);return \
data;};OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,i \
                nitialize:function(left,bottom,right,top){if(left!=null){this.left=parseFloat(left);}
                
-if(bottom!=null){this.bottom=parseFloat(bottom);}
-if(right!=null){this.right=parseFloat(right);}
-if(top!=null){this.top=parseFloat(top);}},clone:function(){return new \
OpenLayers.Bounds(this.left,this.bottom,this.right,this.top);},equals:function(bounds){var \
equalsúlse;if(bounds!=null){equals=((this.left==bounds.left)&&(this.right==bounds.right)&&(this.top==bounds.top)&&(this.bottom==bounds.bottom));}
                
-return equals;},toString:function(){return("left-bottom=("+this.left+","+this.bottom+")"
                
-+" right-top=("+this.right+","+this.top+")");},toArray:function(){return[this.left,th \
is.bottom,this.right,this.top];},toBBOX:function(decimal){if(decimal==null){decimal=6;}
                
-var mult=Math.pow(10,decimal);var bbox=Math.round(this.left*mult)/mult+","+
-Math.round(this.bottom*mult)/mult+","+
-Math.round(this.right*mult)/mult+","+
-Math.round(this.top*mult)/mult;return bbox;},toGeometry:function(){return new \
OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new \
OpenLayers.Geometry.Point(this.left,this.bottom),new \
OpenLayers.Geometry.Point(this.right,this.bottom),new \
OpenLayers.Geometry.Point(this.right,this.top),new \
OpenLayers.Geometry.Point(this.left,this.top)])]);},getWidth:function(){return(this.ri \
ght-this.left);},getHeight:function(){return(this.top-this.bottom);},getSize:function(){return \
new OpenLayers.Size(this.getWidth(),this.getHeight());},getCenterPixel:function(){return \
new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2);},getCenterLonLat:function(){return \
new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2);},add:function(x,y){if((x==null)||(y==null)){var \
                msg=OpenLayers.i18n("boundsAddError");OpenLayers.Console.error(msg);return \
                null;}
-return new OpenLayers.Bounds(this.left+x,this.bottom+y,this.right+x,this.top+y);},extend:function(object){var \
bounds=null;if(object){switch(object.CLASS_NAME){case"OpenLayers.LonLat":bounds=new \
OpenLayers.Bounds(object.lon,object.lat,object.lon,object.lat);break;case"OpenLayers.Geometry.Point":bounds=new \
OpenLayers.Bounds(object.x,object.y,object.x,object.y);break;case"OpenLayers.Bounds":bounds=object;break;}
                
-if(bounds){if((this.left==null)||(bounds.left<this.left)){this.left=bounds.left;}
-if((this.bottom==null)||(bounds.bottom<this.bottom)){this.bottom=bounds.bottom;}
-if((this.right==null)||(bounds.right>this.right)){this.right=bounds.right;}
-if((this.top==null)||(bounds.top>this.top)){this.top=bounds.top;}}}},containsLonLat:function(ll,inclusive){return \
this.contains(ll.lon,ll.lat,inclusive);},containsPixel:function(px,inclusive){return \
this.contains(px.x,px.y,inclusive);},contains:function(x,y,inclusive){if(inclusive==null){inclusive=true;}
                
-var containsúlse;if(inclusive){contains=((x>=this.left)&&(x<=this.right)&&(y>=this.bo \
ttom)&&(y<=this.top));}else{contains=((x>this.left)&&(x<this.right)&&(y>this.bottom)&&(y<this.top));}
                
-return contains;},intersectsBounds:function(bounds,inclusive){if(inclusive==null){inclusive=true;}
                
-var inBottom=(bounds.bottom==this.bottom&&bounds.top==this.top)?true:(((bounds.bottom \
>this.bottom)&&(bounds.bottom<this.top))||((this.bottom>bounds.bottom)&&(this.bottom<bounds.top)));var \
> inTop=(bounds.bottom==this.bottom&&bounds.top==this.top)?true:(((bounds.top>this.bot \
> tom)&&(bounds.top<this.top))||((this.top>bounds.bottom)&&(this.top<bounds.top)));var \
> inRight=(bounds.right==this.right&&bounds.left==this.left)?true:(((bounds.right>this \
> .left)&&(bounds.right<this.right))||((this.right>bounds.left)&&(this.right<bounds.right)));var \
> inLeft=(bounds.right==this.right&&bounds.left==this.left)?true:(((bounds.left>this.l \
> eft)&&(bounds.left<this.right))||((this.left>bounds.left)&&(this.left<bounds.right)) \
> );return(this.containsBounds(bounds,true,inclusive)||bounds.containsBounds(this,true \
> ,inclusive)||((inTop||inBottom)&&(inLeft||inRight)));},containsBounds:function(bounds,partial,inclusive){if(partial==null){partialúlse;}
> 
-if(inclusive==null){inclusive=true;}
-var inLeft;var inTop;var inRight;var \
inBottom;if(inclusive){inLeft=(bounds.left>=this.left)&&(bounds.left<=this.right);inTo \
p=(bounds.top>=this.bottom)&&(bounds.top<=this.top);inRight=(bounds.right>=this.left)& \
&(bounds.right<=this.right);inBottom=(bounds.bottom>=this.bottom)&&(bounds.bottom<=thi \
s.top);}else{inLeft=(bounds.left>this.left)&&(bounds.left<this.right);inTop=(bounds.to \
p>this.bottom)&&(bounds.top<this.top);inRight=(bounds.right>this.left)&&(bounds.right<this.right);inBottom=(bounds.bottom>this.bottom)&&(bounds.bottom<this.top);}
                
-return(partial)?(inTop||inBottom)&&(inLeft||inRight):(inTop&&inLeft&&inBottom&&inRight);},determineQuadrant:function(lonlat){var \
quadrant="";var center=this.getCenterLonLat();quadrant+=(lonlat.lat<center.lat)?"b":"t";quadrant+=(lonlat.lon<center.lon)?"l":"r";return \
quadrant;},transform:function(source,dest){var \
ll=OpenLayers.Projection.transform({'x':this.left,'y':this.bottom},source,dest);var \
lr=OpenLayers.Projection.transform({'x':this.right,'y':this.bottom},source,dest);var \
ul=OpenLayers.Projection.transform({'x':this.left,'y':this.top},source,dest);var \
ur=OpenLayers.Projection.transform({'x':this.right,'y':this.top},source,dest);this.lef \
t=Math.min(ll.x,ul.x);this.bottom=Math.min(ll.y,lr.y);this.right=Math.max(lr.x,ur.x);this.top=Math.max(ul.y,ur.y);return \
this;},wrapDateLine:function(maxExtent,options){options=options||{};var \
leftTolerance=options.leftTolerance||0;var \
rightTolerance=options.rightTolerance||0;var \
newBounds=this.clone();if(maxExtent){while(newBounds.left<m  \
axExtent.left&&(newBounds.right-rightTolerance)<=maxExtent.left){newBounds=newBounds.add(maxExtent.getWidth(),0);}
                
-while((newBounds.left+leftTolerance)>=maxExtent.right&&newBounds.right>maxExtent.right){newBounds=newBounds.add(-maxExtent.getWidth(),0);}}
                
-return newBounds;},CLASS_NAME:"OpenLayers.Bounds"});OpenLayers.Bounds.fromString=function(str){var \
bounds=str.split(",");return \
OpenLayers.Bounds.fromArray(bounds);};OpenLayers.Bounds.fromArray=function(bbox){return \
new OpenLayers.Bounds(parseFloat(bbox[0]),parseFloat(bbox[1]),parseFloat(bbox[2]),parseFloat(bbox[3]));};OpenLayers.Bounds.fromSize=function(size){return \
new OpenLayers.Bounds(0,size.h,size.w,0);};OpenLayers.Bounds.oppositeQuadrant=function(quadrant){var \
opp="";opp+=(quadrant.charAt(0)=='t')?'b':'t';opp+=(quadrant.charAt(1)=='l')?'r':'l';return \
opp;};OpenLayers.Element={visible:function(element){return \
OpenLayers.Util.getElement(element).style.display!='none';},toggle:function(){for(var \
i=0;i<arguments.length;i++){var element=OpenLayers.Util.getElement(arguments[i]);var \
display=OpenLayers.Element.visible(element)?'hide':'show';OpenLayers.Element[display](element);}},hide:function(){for(var \
i=0;i<arguments.length;i++){var element=OpenLayers.Util.getElement(argumen  \
ts[i]);element.style.display='none';}},show:function(){for(var \
i=0;i<arguments.length;i++){var \
element=OpenLayers.Util.getElement(arguments[i]);element.style.display='';}},remove:fu \
nction(element){element=OpenLayers.Util.getElement(element);element.parentNode.removeC \
hild(element);},getHeight:function(element){element=OpenLayers.Util.getElement(element);return \
element.offsetHeight;},getDimensions:function(element){element=OpenLayers.Util.getElem \
ent(element);if(OpenLayers.Element.getStyle(element,'display')!='none'){return{width:element.offsetWidth,height:element.offsetHeight};}
                
-var els=element.style;var originalVisibility=els.visibility;var \
originalPosition=els.position;els.visibility='hidden';els.position='absolute';els.display='';var \
originalWidth=element.clientWidth;var \
originalHeight=element.clientHeight;els.display='none';els.position=originalPosition;e \
ls.visibility=originalVisibility;return{width:originalWidth,height:originalHeight};},getStyle:function(element,style){element=OpenLayers.Util.getElement(element);var \
value=element.style[OpenLayers.String.camelize(style)];if(!value){if(document.defaultView&&document.defaultView.getComputedStyle){var \
css=document.defaultView.getComputedStyle(element,null);value=css?css.getPropertyValue(style):null;}else \
if(element.currentStyle){value=element.currentStyle[OpenLayers.String.camelize(style)];}}
                
-var positions=['left','top','right','bottom'];if(window.opera&&(OpenLayers.Util.index \
Of(positions,style)!=-1)&&(OpenLayers.Element.getStyle(element,'position')=='static')){value='auto';}
                
-return value=='auto'?null:value;}};OpenLayers.LonLat=OpenLayers.Class({lon:0.0,lat:0. \
0,initialize:function(lon,lat){this.lon=parseFloat(lon);this.lat=parseFloat(lat);},toS \
tring:function(){return("lon="+this.lon+",lat="+this.lat);},toShortString:function(){return(this.lon+", \
"+this.lat);},clone:function(){return new \
OpenLayers.LonLat(this.lon,this.lat);},add:function(lon,lat){if((lon==null)||(lat==null)){var \
                msg=OpenLayers.i18n("lonlatAddError");OpenLayers.Console.error(msg);return \
                null;}
-return new OpenLayers.LonLat(this.lon+lon,this.lat+lat);},equals:function(ll){var \
equalsúlse;if(ll!=null){equals=((this.lon==ll.lon&&this.lat==ll.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(ll.lon)&&isNaN(ll.lat)));}
                
-return equals;},transform:function(source,dest){var \
point=OpenLayers.Projection.transform({'x':this.lon,'y':this.lat},source,dest);this.lon=point.x;this.lat=point.y;return \
this;},wrapDateLine:function(maxExtent){var \
newLonLat=this.clone();if(maxExtent){while(newLonLat.lon<maxExtent.left){newLonLat.lon+=maxExtent.getWidth();}
                
-while(newLonLat.lon>maxExtent.right){newLonLat.lon-=maxExtent.getWidth();}}
-return newLonLat;},CLASS_NAME:"OpenLayers.LonLat"});OpenLayers.LonLat.fromString=function(str){var \
pair=str.split(",");return new \
OpenLayers.LonLat(parseFloat(pair[0]),parseFloat(pair[1]));};OpenLayers.Pixel=OpenLaye \
rs.Class({x:0.0,y:0.0,initialize:function(x,y){this.x=parseFloat(x);this.y=parseFloat( \
y);},toString:function(){return("x="+this.x+",y="+this.y);},clone:function(){return \
new OpenLayers.Pixel(this.x,this.y);},equals:function(px){var \
equalsúlse;if(px!=null){equals=((this.x==px.x&&this.y==px.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(px.x)&&isNaN(px.y)));}
                
-return equals;},add:function(x,y){if((x==null)||(y==null)){var \
                msg=OpenLayers.i18n("pixelAddError");OpenLayers.Console.error(msg);return \
                null;}
-return new OpenLayers.Pixel(this.x+x,this.y+y);},offset:function(px){var \
                newPx=this.clone();if(px){newPx=this.add(px.x,px.y);}
-return newPx;},CLASS_NAME:"OpenLayers.Pixel"});OpenLayers.Size=OpenLayers.Class({w:0. \
0,h:0.0,initialize:function(w,h){this.w=parseFloat(w);this.h=parseFloat(h);},toString:function(){return("w="+this.w+",h="+this.h);},clone:function(){return \
new OpenLayers.Size(this.w,this.h);},equals:function(sz){var \
equalsúlse;if(sz!=null){equals=((this.w==sz.w&&this.h==sz.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(sz.w)&&isNaN(sz.h)));}
                
-return equals;},CLASS_NAME:"OpenLayers.Size"});OpenLayers.Console={log:function(){},d \
ebug:function(){},info:function(){},warn:function(){},error:function(){},assert:functi \
on(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},grou \
pEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileE \
nd:function(){},count:function(){},CLASS_NAME:"OpenLayers.Console"};(function(){if(window.console){var \
scripts=document.getElementsByTagName("script");for(var \
i=0;i<scripts.length;++i){if(scripts[i].src.indexOf("firebug.js")!=-1){OpenLayers.Util \
.extend(OpenLayers.Console,console);break;}}}})();OpenLayers.Control=OpenLayers.Class( \
{id:null,map:null,div:null,type:null,allowSelection:false,displayClass:"",title:"",act \
ive:null,handler:null,eventListeners:null,events:null,EVENT_TYPES:["activate","deactiv \
ate"],initialize:function(options){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");OpenLayers.Util.extend(this,
  options);this.events=new \
OpenLayers.Events(this,null,this.EVENT_TYPES);if(this.eventListeners instanceof \
                Object){this.events.on(this.eventListeners);}
-this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");},destroy:function(){if(this.events){if(this.eventListeners){this.events.un(this.eventListeners);}
                
-this.events.destroy();this.events=null;}
-this.eventListeners=null;if(this.handler){this.handler.destroy();this.handler=null;}
-if(this.handlers){for(var key in \
this.handlers){if(this.handlers.hasOwnProperty(key)&&typeof \
                this.handlers[key].destroy=="function"){this.handlers[key].destroy();}}
                
-this.handlers=null;}
-if(this.map){this.map.removeControl(this);this.map=null;}},setMap:function(map){this. \
map=map;if(this.handler){this.handler.setMap(map);}},draw:function(px){if(this.div==nu \
ll){this.div=OpenLayers.Util.createDiv(this.id);this.div.className=this.displayClass;if(!this.allowSelection){this.div.className+=" \
olControlNoSelect";this.div.setAttribute("unselectable","on",0);this.div.onselectstart=function(){return(false);};}
                
-if(this.title!=""){this.div.title=this.title;}}
-if(px!=null){this.position=px.clone();}
-this.moveTo(this.position);return \
this.div;},moveTo:function(px){if((px!=null)&&(this.div!=null)){this.div.style.left=px \
.x+"px";this.div.style.top=px.y+"px";}},activate:function(){if(this.active){return \
                false;}
-if(this.handler){this.handler.activate();}
-this.active=true;this.events.triggerEvent("activate");return \
true;},deactivate:function(){if(this.active){if(this.handler){this.handler.deactivate();}
                
-this.activeúlse;this.events.triggerEvent("deactivate");return true;}
-return false;},CLASS_NAME:"OpenLayers.Control"});OpenLayers.Control.TYPE_BUTTON=1;Ope \
nLayers.Control.TYPE_TOGGLE=2;OpenLayers.Control.TYPE_TOOL=3;OpenLayers.Icon=OpenLayer \
s.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,ini \
tialize:function(url,size,offset,calculateOffset){this.url=url;this.size=(size)?size:new \
OpenLayers.Size(20,20);this.offset=offset?offset:new \
OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));this.calculateOffsetÊlculateOffset;var \
id=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlph \
aImageDiv(id);},destroy:function(){OpenLayers.Event.stopObservingElement(this.imageDiv \
.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null;},clone:function(){return \
new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset);},setSize:function(size){if(size!=null){this.size=size;}
                
-this.draw();},setUrl:function(url){if(url!=null){this.url=url;}
-this.draw();},draw:function(px){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");this.moveTo(px);return \
this.imageDiv;},setOpacity:function(opacity){OpenLayers.Util.modifyAlphaImageDiv(this. \
imageDiv,null,null,null,null,null,null,null,opacity);},moveTo:function(px){if(px!=null){this.px=px;}
                
-if(this.imageDiv!=null){if(this.px==null){this.display(false);}else{if(this.calculateOffset){this.offset=this.calculateOffset(this.size);}
                
-var offsetPx=this.px.offset(this.offset);OpenLayers.Util.modifyAlphaImageDiv(this.ima \
geDiv,null,offsetPx);}}},display:function(display){this.imageDiv.style.display=(displa \
y)?"":"none";},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){if(!OpenLayers.Lang.code){OpenLayers.Lang.setCode();}
                
-return OpenLayers.Lang.code;},setCode:function(code){var \
lang;if(!code){code=(OpenLayers.Util.getBrowserName()=="msie")?navigator.userLanguage:navigator.language;}
                
-var parts=code.split('-');parts[0]=parts[0].toLowerCase();if(typeof \
                OpenLayers.Lang[parts[0]]=="object"){lang=parts[0];}
-if(parts[1]){var testLang=parts[0]+'-'+parts[1].toUpperCase();if(typeof \
                OpenLayers.Lang[testLang]=="object"){lang=testLang;}}
-if(!lang){OpenLayers.Console.warn('Failed to find \
OpenLayers.Lang.'+parts.join("-")+' dictionary, falling back to default \
                language');lang=OpenLayers.Lang.defaultCode;}
-OpenLayers.Lang.code=lang;},translate:function(key,context){var \
dictionary=OpenLayers.Lang[OpenLayers.Lang.getCode()];var \
                message=dictionary[key];if(!message){message=key;}
-if(context){message=OpenLayers.String.format(message,context);}
-return message;}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Popup=OpenLaye \
rs.Class({events:null,id:"",lonlat:null,div:null,size:null,contentHTML:"",backgroundCo \
lor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:false,minSize:null,maxSize:null,padding:0,fixPadding:function(){if(typeof \
this.padding=="number"){this.padding=new \
OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding);}},panMapIfOutO \
fView:false,map:null,initialize:function(id,lonlat,size,contentHTML,closeBox,closeBoxCallback){if(id==null){id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");}
                
-this.id=id;this.lonlat=lonlat;this.size=(size!=null)?size:new \
OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);if(contentHTML!=null){this.contentHTML=contentHTML;}
                
-this.backgroundColor=OpenLayers.Popup.COLOR;this.opacity=OpenLayers.Popup.OPACITY;thi \
s.border=OpenLayers.Popup.BORDER;this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");this.div.className='olPopup';var \
groupDivId=this.id+"_GroupDiv";this.groupDiv=OpenLayers.Util.createDiv(groupDivId,null,null,null,"relative",null,"hidden");var \
id=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(id,null,this.si \
ze.clone(),null,"relative");this.contentDiv.className='olPopupContent';this.groupDiv.a \
ppendChild(this.contentDiv);this.div.appendChild(this.groupDiv);if(closeBox){this.addCloseBox(closeBoxCallback);}
                
-this.registerEvents();},destroy:function(){this.id=null;this.lonlat=null;this.size=nu \
ll;this.contentHTML=null;this.backgroundColor=null;this.opacity=null;this.border=null; \
this.events.destroy();this.events=null;if(this.closeDiv){OpenLayers.Event.stopObservingElement(this.closeDiv);this.groupDiv.removeChild(this.closeDiv);}
                
-this.closeDiv=null;this.div.removeChild(this.groupDiv);this.groupDiv=null;if(this.map!=null){this.map.removePopup(this);}
                
-this.map=null;this.div=null;this.autoSize=null;this.minSize=null;this.maxSize=null;th \
is.padding=null;this.panMapIfOutOfView=null;},draw:function(px){if(px==null){if((this. \
                lonlat!=null)&&(this.map!=null)){px=this.map.getLayerPxFromLonLat(this.lonlat);}}
                
-if(OpenLayers.Util.getBrowserName()=='firefox'){this.map.events.register("movestart",this,function(){var \
style=document.defaultView.getComputedStyle(this.contentDiv,null);var \
currentOverflow=style.getPropertyValue("overflow");if(currentOverflow!="hidden"){this. \
contentDiv._oldOverflow=currentOverflow;this.contentDiv.style.overflow="hidden";}});this.map.events.register("moveend",this,function(){var \
oldOverflow=this.contentDiv._oldOverflow;if(oldOverflow){this.contentDiv.style.overflow=oldOverflow;this.contentDiv._oldOverflow=null;}});}
                
-this.moveTo(px);if(!this.autoSize){this.setSize(this.size);}
-this.setBackgroundColor();this.setOpacity();this.setBorder();this.setContentHTML();if(this.panMapIfOutOfView){this.panIntoView();}
                
-return this.div;},updatePosition:function(){if((this.lonlat)&&(this.map)){var \
px=this.map.getLayerPxFromLonLat(this.lonlat);if(px){this.moveTo(px);}}},moveTo:functi \
on(px){if((px!=null)&&(this.div!=null)){this.div.style.left=px.x+"px";this.div.style.top=px.y+"px";}},visible:function(){return \
OpenLayers.Element.visible(this.div);},toggle:function(){if(this.visible()){this.hide( \
);}else{this.show();}},show:function(){OpenLayers.Element.show(this.div);if(this.panMa \
pIfOutOfView){this.panIntoView();}},hide:function(){OpenLayers.Element.hide(this.div);},setSize:function(size){this.size=size;var \
contentSize=this.size.clone();var contentDivPadding=this.getContentDivPadding();var \
wPadding=contentDivPadding.left+contentDivPadding.right;var \
hPadding=contentDivPadding.top+contentDivPadding.bottom;this.fixPadding();wPadding+=th \
is.padding.left+this.padding.right;hPadding+=this.padding.top+this.padding.bottom;if(this.closeDiv){var \
closeDivWidth=parseInt(this.closeDiv.style.width);wPadding+=c  \
                loseDivWidth+contentDivPadding.right;}
-this.size.w+=wPadding;this.size.h+=hPadding;if(OpenLayers.Util.getBrowserName()=="msi \
e"){contentSize.w+=contentDivPadding.left+contentDivPadding.right;contentSize.h+=contentDivPadding.bottom+contentDivPadding.top;}
                
-if(this.div!=null){this.div.style.width=this.size.w+"px";this.div.style.height=this.size.h+"px";}
                
-if(this.contentDiv!=null){this.contentDiv.style.width=contentSize.w+"px";this.content \
Div.style.height=contentSize.h+"px";}},setBackgroundColor:function(color){if(color!=undefined){this.backgroundColor=color;}
                
-if(this.div!=null){this.div.style.backgroundColor=this.backgroundColor;}},setOpacity:function(opacity){if(opacity!=undefined){this.opacity=opacity;}
                
-if(this.div!=null){this.div.style.opacity=this.opacity;this.div.style.filter='alpha(o \
pacity='+this.opacity*100+')';}},setBorder:function(border){if(border!=undefined){this.border=border;}
                
-if(this.div!=null){this.div.style.border=this.border;}},setContentHTML:function(contentHTML){if(contentHTML!=null){this.contentHTML=contentHTML;}
                
-if(this.autoSize){var \
realSize=OpenLayers.Util.getRenderedDimensions(this.contentHTML);var \
safeSize=this.getSafeContentSize(realSize);var \
newSize=null;if(safeSize.equals(realSize)){newSize=realSize;}else{var fixedSize=new \
OpenLayers.Size();fixedSize.w=(safeSize.w<realSize.w)?safeSize.w:null;fixedSize.h=(saf \
eSize.h<realSize.h)?safeSize.h:null;if(fixedSize.w&&fixedSize.h){newSize=safeSize;}else{var \
clippedSize=OpenLayers.Util.getRenderedDimensions(this.contentHTML,fixedSize);var \
currentOverflow=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if((currentOverflow!="hidden")&&(clippedSize.equals(safeSize))){var \
scrollBar=OpenLayers.Util.getScrollbarWidth();if(fixedSize.w){clippedSize.h+=scrollBar;}else{clippedSize.w+=scrollBar;}}
                
-newSize=this.getSafeContentSize(clippedSize);}}
-this.setSize(newSize);}
-if(this.contentDiv!=null){this.contentDiv.innerHTML=this.contentHTML;}},getSafeContentSize:function(size){var \
safeContentSize=size.clone();var contentDivPadding=this.getContentDivPadding();var \
wPadding=contentDivPadding.left+contentDivPadding.right;var \
hPadding=contentDivPadding.top+contentDivPadding.bottom;this.fixPadding();wPadding+=th \
is.padding.left+this.padding.right;hPadding+=this.padding.top+this.padding.bottom;if(this.closeDiv){var \
closeDivWidth=parseInt(this.closeDiv.style.width);wPadding+=closeDivWidth+contentDivPadding.right;}
                
-if(this.minSize){safeContentSize.w=Math.max(safeContentSize.w,(this.minSize.w-wPadding));safeContentSize.h=Math.max(safeContentSize.h,(this.minSize.h-hPadding));}
                
-if(this.maxSize){safeContentSize.w=Math.min(safeContentSize.w,(this.maxSize.w-wPadding));safeContentSize.h=Math.min(safeContentSize.h,(this.maxSize.h-hPadding));}
                
-if(this.map&&this.map.size){var maxY=this.map.size.h-
-this.map.paddingForPopups.top-
-this.map.paddingForPopups.bottom-
-hPadding;var maxX=this.map.size.w-
-this.map.paddingForPopups.left-
-this.map.paddingForPopups.right-
-wPadding;safeContentSize.w=Math.min(safeContentSize.w,maxX);safeContentSize.h=Math.min(safeContentSize.h,maxY);}
                
-return safeContentSize;},getContentDivPadding:function(){var \
contentDivPadding=this._contentDivPadding;if(!contentDivPadding){this.div.style.display="none";document.body.appendChild(this.div);contentDivPadding=new \
OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,"padding-left"),OpenLaye \
rs.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this \
.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv,"padding-top" \
));this._contentDivPadding=contentDivPadding;document.body.removeChild(this.div);this.div.style.display="";}
                
-return contentDivPadding;},addCloseBox:function(callback){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new \
OpenLayers.Size(17,17));this.closeDiv.className="olPopupCloseBox";var \
contentDivPadding=this.getContentDivPadding();this.closeDiv.style.right=contentDivPadd \
ing.right+"px";this.closeDiv.style.top=contentDivPadding.top+"px";this.groupDiv.appendChild(this.closeDiv);var \
closePopupÊllback||function(e){this.hide();OpenLayers.Event.stop(e);};OpenLayers.Event \
.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(closePopup,this));},panIntoView:function(){var \
mapSize=this.map.getSize();var origTL=this.map.getViewPortPxFromLayerPx(new \
OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));var \
newTL=origTL.clone();if(origTL.x<this.map.paddingForPopups.left){newTL.x=this.map.paddingForPopups.left;}else
                
-if((origTL.x+this.size.w)>(mapSize.w-this.map.paddingForPopups.right)){newTL.x=mapSize.w-this.map.paddingForPopups.right-this.size.w;}
                
-if(origTL.y<this.map.paddingForPopups.top){newTL.y=this.map.paddingForPopups.top;}else
                
-if((origTL.y+this.size.h)>(mapSize.h-this.map.paddingForPopups.bottom)){newTL.y=mapSize.h-this.map.paddingForPopups.bottom-this.size.h;}
                
-var dx=origTL.x-newTL.x;var \
dy=origTL.y-newTL.y;this.map.pan(dx,dy);},registerEvents:function(){this.events=new \
OpenLayers.Events(this,this.div,null,true);this.events.on({"mousedown":this.onmousedow \
n,"mousemove":this.onmousemove,"mouseup":this.onmouseup,"click":this.onclick,"mouseout \
":this.onmouseout,"dblclick":this.ondblclick,scope:this});},onmousedown:function(evt){ \
this.mousedown=true;OpenLayers.Event.stop(evt,true);},onmousemove:function(evt){if(thi \
s.mousedown){OpenLayers.Event.stop(evt,true);}},onmouseup:function(evt){if(this.moused \
own){this.mousedownúlse;OpenLayers.Event.stop(evt,true);}},onclick:function(evt){OpenL \
ayers.Event.stop(evt,true);},onmouseout:function(evt){this.mousedownúlse;},ondblclick: \
function(evt){OpenLayers.Event.stop(evt,true);},CLASS_NAME:"OpenLayers.Popup"});OpenLayers.Popup.WIDTH \
0;OpenLayers.Popup.HEIGHT \
0;OpenLayers.Popup.COLOR="white";OpenLayers.Popup.OPACITY=1;OpenLayers.Popup.BORDER="0px";OpenLayers.Renderer=OpenLayers.Class({container:
  null,extent:null,size:null,resolution:null,map:null,initialize:function(containerID) \
{this.container=OpenLayers.Util.getElement(containerID);},destroy:function(){this.cont \
ainer=null;this.extent=null;this.size=null;this.resolution=null;this.map=null;},supported:function(){return \
false;},setExtent:function(extent){this.extent=extent.clone();this.resolution=null;},s \
etSize:function(size){this.size=size.clone();this.resolution=null;},getResolution:function(){this.resolution=this.resolution||this.map.getResolution();return \
this.resolution;},drawFeature:function(feature,style){if(style==null){styleþature.style;}
                
-if(feature.geometry){this.drawGeometry(feature.geometry,style,feature.id);}},drawGeom \
etry:function(geometry,style,featureId){},clear:function(){},getFeatureIdFromEvent:function(evt){},eraseFeatures:function(features){if(!(features \
                instanceof Array)){features=[features];}
-for(var i=0;i<features.length;++i){this.eraseGeometry(features[i].geometry);}},eraseG \
eometry:function(geometry){},CLASS_NAME:"OpenLayers.Renderer"});OpenLayers.Tween=OpenL \
ayers.Class({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:nu \
ll,time:null,interval:null,playing:false,initialize:function(easing){this.easing=(easi \
ng)?easing:OpenLayers.Easing.Expo.easeOut;},start:function(begin,finish,duration,optio \
ns){this.playing=true;this.begin¾gin;this.finish=finish;this.duration=duration;this.ca \
llbacks=options.callbacks;this.time=0;if(this.interval){window.clearInterval(this.interval);this.interval=null;}
                
-if(this.callbacks&&this.callbacks.start){this.callbacks.start.call(this,this.begin);}
                
-this.interval=window.setInterval(OpenLayers.Function.bind(this.play,this),this.INTERVAL);},stop:function(){if(!this.playing){return;}
                
-if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish);}
-window.clearInterval(this.interval);this.interval=null;this.playingúlse;},play:function(){var \
value={};for(var i in this.begin){var b=this.begin[i];var \
f=this.finish[i];if(b==null||f==null||isNaN(b)||isNaN(f)){OpenLayers.Console.error('invalid \
                value for Tween');}
-var c=f-b;value[i]=this.easing.apply(this,[this.time,b,c,this.duration]);}
-this.time++;if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,value);}
                
-if(this.time>this.duration){if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish);this.playingúlse;}
                
-window.clearInterval(this.interval);this.interval=null;}},CLASS_NAME:"OpenLayers.Twee \
n"});OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};OpenLayers.Easing.Linear={easeIn:function(t,b,c,d){return \
c*t/d+b;},easeOut:function(t,b,c,d){return \
c*t/d+b;},easeInOut:function(t,b,c,d){return \
c*t/d+b;},CLASS_NAME:"OpenLayers.Easing.Linear"};OpenLayers.Easing.Expo={easeIn:functi \
on(t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOut:function(t,b,c,d){retu \
rn(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOut:function(t,b,c,d){if(t==0)return \
b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return \
c/2*(-Math.pow(2,-10*--t)+2)+b;},CLASS_NAME:"OpenLayers.Easing.Expo"};OpenLayers.Easing.Quad={easeIn:function(t,b,c,d){return \
c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOut:function(t,b,c,d){if((t/=d/2)<1)return \
c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},CLASS_NAME:"OpenLayers.Easing.Quad"};OpenLayers.Rico.Color=OpenLayers.Class({initial
  ize:function(red,green,blue){this.rgb={r:red,g:green,b:blue};},setRed:function(r){th \
is.rgb.r=r;},setGreen:function(g){this.rgb.g=g;},setBlue:function(b){this.rgb.b=b;},setHue:function(h){var \
hsb=this.asHSB();hsb.h=h;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},setSaturation:function(s){var \
hsb=this.asHSB();hsb.s=s;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},setBrightness:function(b){var \
hsb=this.asHSB();hsb.b=b;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},darken:function(percent){var \
hsb=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.max(hsb.b-percent,0));},brighten:function(percent){var \
hsb=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.min(hsb.b+pe \
rcent,1));},blend:function(other){this.rgb.r=Math.floor((this.rgb.r+other.rgb.r)/2);th \
is.rgb.g=Math.floor((this.rgb.g+other.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+other.rgb.b)/2);},isBright:function(){var \
hsb=this.asHSB();return th  \
is.asHSB().b>0.5;},isDark:function(){return!this.isBright();},asRGB:function(){return" \
rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")";},asHex:function(){return"#"+this.r \
gb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart();},asHSB:function(){return \
OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b);},toString:function(){return \
this.asHex();}});OpenLayers.Rico.Color.createFromHex=function(hexCode){if(hexCode.length==4){var \
shortHexCode=hexCode;var hexCode='#';for(var \
                i=1;i<4;i++){hexCode+=(shortHexCode.charAt(i)+
-shortHexCode.charAt(i));}}
-if(hexCode.indexOf('#')==0){hexCode=hexCode.substring(1);}
-var red=hexCode.substring(0,2);var green=hexCode.substring(2,4);var \
blue=hexCode.substring(4,6);return new \
OpenLayers.Rico.Color(parseInt(red,16),parseInt(green,16),parseInt(blue,16));};OpenLayers.Rico.Color.createColorFromBackground=function(elem){var \
actualColor=RicoUtil.getElementsComputedStyle(OpenLayers.Util.getElement(elem),"backgr \
oundColor","background-color");if(actualColor=="transparent"&&elem.parentNode){return \
                OpenLayers.Rico.Color.createColorFromBackground(elem.parentNode);}
-if(actualColor==null){return new OpenLayers.Rico.Color(255,255,255);}
-if(actualColor.indexOf("rgb(")==0){var \
colors¬tualColor.substring(4,actualColor.length-1);var \
colorArray=colors.split(",");return new \
OpenLayers.Rico.Color(parseInt(colorArray[0]),parseInt(colorArray[1]),parseInt(colorArray[2]));}
                
-else if(actualColor.indexOf("#")==0){return \
                OpenLayers.Rico.Color.createFromHex(actualColor);}
-else{return new OpenLayers.Rico.Color(255,255,255);}};OpenLayers.Rico.Color.HSBtoRGB=function(hue,saturation,brightness){var \
red=0;var green=0;var \
                blue=0;if(saturation==0){red=parseInt(brightness*255.0+0.5);green=red;blue=red;}
                
-else{var h=(hue-Math.floor(hue))*6.0;var f=h-Math.floor(h);var \
p=brightness*(1.0-saturation);var q=brightness*(1.0-saturation*f);var \
t=brightness*(1.0-(saturation*(1.0-f)));switch(parseInt(h)){case \
0:red=(brightness*255.0+0.5);green=(t*255.0+0.5);blue=(p*255.0+0.5);break;case \
1:red=(q*255.0+0.5);green=(brightness*255.0+0.5);blue=(p*255.0+0.5);break;case \
2:red=(p*255.0+0.5);green=(brightness*255.0+0.5);blue=(t*255.0+0.5);break;case \
3:red=(p*255.0+0.5);green=(q*255.0+0.5);blue=(brightness*255.0+0.5);break;case \
4:red=(t*255.0+0.5);green=(p*255.0+0.5);blue=(brightness*255.0+0.5);break;case \
                5:red=(brightness*255.0+0.5);green=(p*255.0+0.5);blue=(q*255.0+0.5);break;}}
                
-return{r:parseInt(red),g:parseInt(green),b:parseInt(blue)};};OpenLayers.Rico.Color.RGBtoHSB=function(r,g,b){var \
                hue;var saturation;var brightness;var \
                cmax=(r>g)?r:g;if(b>cmax){cmax=b;}
-var cmin=(r<g)?r:g;if(b<cmin){cmin=b;}
-brightness=cmax/255.0;if(cmax!=0){saturation=(cmax-cmin)/cmax;}else{saturation=0;}
-if(saturation==0){hue=0;}else{var redc=(cmax-r)/(cmax-cmin);var \
greenc=(cmax-g)/(cmax-cmin);var \
bluec=(cmax-b)/(cmax-cmin);if(r==cmax){hue=bluec-greenc;}else \
                if(g==cmax){hue=2.0+redc-bluec;}else{hue=4.0+greenc-redc;}
-hue=hue/6.0;if(hue<0){hue=hue+1.0;}}
-return{h:hue,s:saturation,b:brightness};};OpenLayers.Control.ArgParser=OpenLayers.Cla \
ss(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,initia \
lize:function(options){OpenLayers.Control.prototype.initialize.apply(this,arguments);} \
,setMap:function(map){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var \
i=0;i<this.map.controls.length;i++){var \
control=this.map.controls[i];if((control!=this)&&(control.CLASS_NAME=="OpenLayers.Cont \
rol.ArgParser")){if(control.displayProjection!=this.displayProjection){this.displayProjection=control.displayProjection;}
                
-break;}}
-if(i==this.map.controls.length){var \
args=OpenLayers.Util.getParameters();if(args.layers){this.layers=args.layers;this.map.events.register('addlayer',this,this.configureLayers);this.configureLayers();}
                
-if(args.lat&&args.lon){this.center=new \
OpenLayers.LonLat(parseFloat(args.lon),parseFloat(args.lat));if(args.zoom){this.zoom=parseInt(args.zoom);}
                
-this.map.events.register('changebaselayer',this,this.setCenter);this.setCenter();}}}, \
setCenter:function(){if(this.map.baseLayer){this.map.events.unregister('changebaselaye \
r',this,this.setCenter);if(this.displayProjection){this.center.transform(this.displayProjection,this.map.getProjectionObject());}
                
-this.map.setCenter(this.center,this.zoom);}},configureLayers:function(){if(this.layer \
s.length==this.map.layers.length){this.map.events.unregister('addlayer',this,this.configureLayers);for(var \
i=0;i<this.layers.length;i++){var layer=this.map.layers[i];var \
c=this.layers.charAt(i);if(c=="B"){this.map.setBaseLayer(layer);}else \
if((c=="T")||(c=="F")){layer.setVisibility(c=="T");}}}},CLASS_NAME:"OpenLayers.Control \
.ArgParser"});OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control,{separator:", \
",initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,argu \
ments);},destroy:function(){this.map.events.un({"removelayer":this.updateAttribution," \
addlayer":this.updateAttribution,"changelayer":this.updateAttribution,"changebaselayer \
":this.updateAttribution,scope:this});OpenLayers.Control.prototype.destroy.apply(this, \
arguments);},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.map.events.on({'changebaselayer':this.updateAttri
  bution,'changelayer':this.updateAttribution,'addlayer':this.updateAttribution,'removelayer':this.updateAttribution,scope:this});this.updateAttribution();return \
this.div;},updateAttribution:function(){var \
attributions=[];if(this.map&&this.map.layers){for(var \
i=0;i<this.map.layers.length;i++){var \
layer=this.map.layers[i];if(layer.attribution&&layer.getVisibility()){attributions.push(layer.attribution);}}
                
-this.div.innerHTML=attributions.join(this.separator);}},CLASS_NAME:"OpenLayers.Contro \
l.Attribution"});OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:O \
penLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.Butt \
on"});OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{activeColo \
r:"darkblue",layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLb \
l:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending: \
true,initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,a \
rguments);this.layerStates=[];},destroy:function(){OpenLayers.Event.stopObservingEleme \
nt(this.div);OpenLayers.Event.stopObservingElement(this.minimizeDiv);OpenLayers.Event. \
stopObservingElement(this.maximizeDiv);this.clearLayersArray("base");this.clearLayersA \
rray("data");this.map.events.un({"addlayer":this.redraw,"changelayer":this.redraw,"removelayer":this.redraw,"changebaselayer":this
                
 .redraw,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments);},set \
Map:function(map){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.e \
vents.on({"addlayer":this.redraw,"changelayer":this.redraw,"removelayer":this.redraw," \
changebaselayer":this.redraw,scope:this});},draw:function(){OpenLayers.Control.prototy \
pe.draw.apply(this);this.loadContents();if(!this.outsideViewport){this.minimizeControl();}
                
-this.redraw();return this.div;},clearLayersArray:function(layersType){var \
layers=this[layersType+"Layers"];if(layers){for(var i=0;i<layers.length;i++){var \
layer=layers[i];OpenLayers.Event.stopObservingElement(layer.inputElem);OpenLayers.Event.stopObservingElement(layer.labelSpan);}}
                
-this[layersType+"LayersDiv"].innerHTML="";this[layersType+"Layers"]=[];},checkRedraw:function(){var \
redrawúlse;if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){redraw=true;}else{for(var \
i=0;i<this.layerStates.length;i++){var layerState=this.layerStates[i];var \
layer=this.map.layers[i];if((layerState.name!=layer.name)||(layerState.inRange!=layer. \
inRange)||(layerState.id!=layer.id)||(layerState.visibility!=layer.visibility)){redraw=true;break;}}}
                
-return redraw;},redraw:function(){if(!this.checkRedraw()){return this.div;}
-this.clearLayersArray("base");this.clearLayersArray("data");var \
containsOverlaysúlse;var containsBaseLayersúlse;this.layerStates=new \
Array(this.map.layers.length);for(var i=0;i<this.map.layers.length;i++){var \
layer=this.map.layers[i];this.layerStates[i]={'name':layer.name,'visibility':layer.visibility,'inRange':layer.inRange,'id':layer.id};}
                
-var layers=this.map.layers.slice();if(!this.ascending){layers.reverse();}
-for(var i=0;i<layers.length;i++){var layer=layers[i];var \
baseLayer=layer.isBaseLayer;if(layer.displayInLayerSwitcher){if(baseLayer){containsBaseLayers=true;}else{containsOverlays=true;}
                
-var checked=(baseLayer)?(layer==this.map.baseLayer):layer.getVisibility();var \
inputElem=document.createElement("input");inputElem.id="input_"+layer.name;inputElem.n \
ame=(baseLayer)?"baseLayers":layer.name;inputElem.type=(baseLayer)?"radio":"checkbox"; \
inputElem.value=layer.name;inputElem.checked=checked;inputElem.defaultChecked=checked;if(!baseLayer&&!layer.inRange){inputElem.disabled=true;}
                
-var context={'inputElem':inputElem,'layer':layer,'layerSwitcher':this};OpenLayers.Eve \
nt.observe(inputElem,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,context));var \
labelSpan=document.createElement("span");if(!baseLayer&&!layer.inRange){labelSpan.style.color="gray";}
                
-labelSpan.innerHTML=layer.name;labelSpan.style.verticalAlign=(baseLayer)?"bottom":"ba \
seline";OpenLayers.Event.observe(labelSpan,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,context));var \
br=document.createElement("br");var \
groupArray=(baseLayer)?this.baseLayers:this.dataLayers;groupArray.push({'layer':layer,'inputElem':inputElem,'labelSpan':labelSpan});var \
groupDiv=(baseLayer)?this.baseLayersDiv:this.dataLayersDiv;groupDiv.appendChild(inputElem);groupDiv.appendChild(labelSpan);groupDiv.appendChild(br);}}
                
-this.dataLbl.style.display=(containsOverlays)?"":"none";this.baseLbl.style.display=(containsBaseLayers)?"":"none";return \
this.div;},onInputClick:function(e){if(!this.inputElem.disabled){if(this.inputElem.typ \
e=="radio"){this.inputElem.checked=true;this.layer.map.setBaseLayer(this.layer);}else{this.inputElem.checked=!this.inputElem.checked;this.layerSwitcher.updateMap();}}
                
-OpenLayers.Event.stop(e);},onLayerClick:function(e){this.updateMap();},updateMap:function(){for(var \
i=0;i<this.baseLayers.length;i++){var \
layerEntry=this.baseLayers[i];if(layerEntry.inputElem.checked){this.map.setBaseLayer(layerEntry.layer,false);}}
                
-for(var i=0;i<this.dataLayers.length;i++){var \
layerEntry=this.dataLayers[i];layerEntry.layer.setVisibility(layerEntry.inputElem.chec \
ked);}},maximizeControl:function(e){this.div.style.width="20em";this.div.style.height= \
"";this.showControls(false);if(e!=null){OpenLayers.Event.stop(e);}},minimizeControl:fu \
nction(e){this.div.style.width="0px";this.div.style.height="0px";this.showControls(tru \
e);if(e!=null){OpenLayers.Event.stop(e);}},showControls:function(minimize){this.maximi \
zeDiv.style.display=minimize?"":"none";this.minimizeDiv.style.display=minimize?"none": \
"";this.layersDiv.style.display=minimize?"none":"";},loadContents:function(){this.div. \
style.position="absolute";this.div.style.top="25px";this.div.style.right="0px";this.di \
v.style.left="";this.div.style.fontFamily="sans-serif";this.div.style.fontWeight="bold \
";this.div.style.marginTop="3px";this.div.style.marginLeft="3px";this.div.style.margin \
Bottom="3px";this.div.style.fontSize="smaller";this.div.style.color="white";this.di  \
v.style.backgroundColor="transparent";OpenLayers.Event.observe(this.div,"mouseup",Open \
Layers.Function.bindAsEventListener(this.mouseUp,this));OpenLayers.Event.observe(this. \
div,"click",this.ignoreEvent);OpenLayers.Event.observe(this.div,"mousedown",OpenLayers \
.Function.bindAsEventListener(this.mouseDown,this));OpenLayers.Event.observe(this.div, \
"dblclick",this.ignoreEvent);this.layersDiv=document.createElement("div");this.layersD \
iv.id="layersDiv";this.layersDiv.style.paddingTop="5px";this.layersDiv.style.paddingLe \
ft="10px";this.layersDiv.style.paddingBottom="5px";this.layersDiv.style.paddingRight=" \
75px";this.layersDiv.style.backgroundColor=this.activeColor;this.layersDiv.style.width \
="100%";this.layersDiv.style.height="100%";this.baseLbl=document.createElement("div"); \
this.baseLbl.innerHTML=OpenLayers.i18n("baseLayer");this.baseLbl.style.marginTop="3px" \
;this.baseLbl.style.marginLeft="3px";this.baseLbl.style.marginBottom="3px";this.baseLayersDiv=document.createElement("div");this.
  baseLayersDiv.style.paddingLeft="10px";this.dataLbl=document.createElement("div");th \
is.dataLbl.innerHTML=OpenLayers.i18n("overlays");this.dataLbl.style.marginTop="3px";th \
is.dataLbl.style.marginLeft="3px";this.dataLbl.style.marginBottom="3px";this.dataLayer \
sDiv=document.createElement("div");this.dataLayersDiv.style.paddingLeft="10px";if(this \
.ascending){this.layersDiv.appendChild(this.baseLbl);this.layersDiv.appendChild(this.b \
aseLayersDiv);this.layersDiv.appendChild(this.dataLbl);this.layersDiv.appendChild(this \
.dataLayersDiv);}else{this.layersDiv.appendChild(this.dataLbl);this.layersDiv.appendCh \
ild(this.dataLayersDiv);this.layersDiv.appendChild(this.baseLbl);this.layersDiv.appendChild(this.baseLayersDiv);}
                
-this.div.appendChild(this.layersDiv);OpenLayers.Rico.Corner.round(this.div,{corners:"tl \
bl",bgColor:"transparent",color:this.activeColor,blend:false});OpenLayers.Rico.Corner.changeOpacity(this.layersDiv,0.75);var \
imgLocation=OpenLayers.Util.getImagesLocation();var sz=new OpenLayers.Size(18,18);var \
img=imgLocation+'layer-switcher-maximize.png';this.maximizeDiv=OpenLayers.Util.createA \
lphaImageDiv("OpenLayers_Control_MaximizeDiv",null,sz,img,"absolute");this.maximizeDiv \
.style.top="5px";this.maximizeDiv.style.right="0px";this.maximizeDiv.style.left="";thi \
s.maximizeDiv.style.display="none";OpenLayers.Event.observe(this.maximizeDiv,"click",O \
penLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var \
img=imgLocation+'layer-switcher-minimize.png';var sz=new \
OpenLayers.Size(18,18);this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayer \
s_Control_MinimizeDiv",null,sz,img,"absolute");this.minimizeDiv.style.top="5px";this.minimize
  Div.style.right="0px";this.minimizeDiv.style.left="";this.minimizeDiv.style.display= \
"none";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEve \
ntListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv);},ignore \
Event:function(evt){OpenLayers.Event.stop(evt);},mouseDown:function(evt){this.isMouseD \
own=true;this.ignoreEvent(evt);},mouseUp:function(evt){if(this.isMouseDown){this.isMou \
seDownúlse;this.ignoreEvent(evt);}},CLASS_NAME:"OpenLayers.Control.LayerSwitcher"});Op \
enLayers.Control.MouseDefaults=OpenLayers.Class(OpenLayers.Control,{performedDrag:fals \
e,wheelObserver:null,initialize:function(){OpenLayers.Control.prototype.initialize.app \
                ly(this,arguments);},destroy:function(){if(this.handler){this.handler.destroy();}
                
-this.handler=null;this.map.events.un({"click":this.defaultClick,"dblclick":this.defau \
ltDblClick,"mousedown":this.defaultMouseDown,"mouseup":this.defaultMouseUp,"mousemove" \
:this.defaultMouseMove,"mouseout":this.defaultMouseOut,scope:this});OpenLayers.Event.s \
topObserving(window,"DOMMouseScroll",this.wheelObserver);OpenLayers.Event.stopObservin \
g(window,"mousewheel",this.wheelObserver);OpenLayers.Event.stopObserving(document,"mou \
sewheel",this.wheelObserver);this.wheelObserver=null;OpenLayers.Control.prototype.dest \
roy.apply(this,arguments);},draw:function(){this.map.events.on({"click":this.defaultCl \
ick,"dblclick":this.defaultDblClick,"mousedown":this.defaultMouseDown,"mouseup":this.d \
efaultMouseUp,"mousemove":this.defaultMouseMove,"mouseout":this.defaultMouseOut,scope: \
this});this.registerWheelEvents();},registerWheelEvents:function(){this.wheelObserver= \
OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this);OpenLayers.Event.observe(window,"DOMMouseScroll",this.wheelObserve
  r);OpenLayers.Event.observe(window,"mousewheel",this.wheelObserver);OpenLayers.Event \
.observe(document,"mousewheel",this.wheelObserver);},defaultClick:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
                
-var notAfterDrag=!this.performedDrag;this.performedDragúlse;return \
notAfterDrag;},defaultDblClick:function(evt){var \
newCenter=this.map.getLonLatFromViewPortPx(evt.xy);this.map.setCenter(newCenter,this.map.zoom+1);OpenLayers.Event.stop(evt);return \
false;},defaultMouseDown:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
                
-this.mouseDragStart=evt.xy.clone();this.performedDragúlse;if(evt.shiftKey){this.map.d \
iv.style.cursor="crosshair";this.zoomBox=OpenLayers.Util.createDiv('zoomBox',this.mouseDragStart,null,null,"absolute","2px \
solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.filter="alph \
a(opacityP)";this.zoomBox.style.opacity="0.50";this.zoomBox.style.fontSize="1px";this. \
zoomBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.viewPortDiv.appendChild(this.zoomBox);}
                
-document.onselectstart=function(){return \
false;};OpenLayers.Event.stop(evt);},defaultMouseMove:function(evt){this.mousePosition=evt.xy.clone();if(this.mouseDragStart!=null){if(this.zoomBox){var \
deltaX=Math.abs(this.mouseDragStart.x-evt.xy.x);var \
deltaY=Math.abs(this.mouseDragStart.y-evt.xy.y);this.zoomBox.style.width=Math.max(1,de \
ltaX)+"px";this.zoomBox.style.height=Math.max(1,deltaY)+"px";if(evt.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=evt.xy.x+"px";}
                
-if(evt.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=evt.xy.y+"px";}}else{var \
deltaX=this.mouseDragStart.x-evt.xy.x;var deltaY=this.mouseDragStart.y-evt.xy.y;var \
size=this.map.getSize();var newXY=new \
OpenLayers.Pixel(size.w/2+deltaX,size.h/2+deltaY);var \
newCenter=this.map.getLonLatFromViewPortPx(newXY);this.map.setCenter(newCenter,null,true);this.mouseDragStart=evt.xy.clone();this.map.div.style.cursor="move";}
                
-this.performedDrag=true;}},defaultMouseUp:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
                
-if(this.zoomBox){this.zoomBoxEnd(evt);}else{if(this.performedDrag){this.map.setCenter(this.map.center);}}
                
-document.onselectstart=null;this.mouseDragStart=null;this.map.div.style.cursor="";},d \
efaultMouseOut:function(evt){if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(evt,this.map.div)){if(this.zoomBox){this.removeZoomBox();}
                
-this.mouseDragStart=null;}},defaultWheelUp:function(evt){if(this.map.getZoom()<=this. \
map.getNumZoomLevels()){this.map.setCenter(this.map.getLonLatFromPixel(evt.xy),this.ma \
p.getZoom()+1);}},defaultWheelDown:function(evt){if(this.map.getZoom()>0){this.map.set \
Center(this.map.getLonLatFromPixel(evt.xy),this.map.getZoom()-1);}},zoomBoxEnd:functio \
n(evt){if(this.mouseDragStart!=null){if(Math.abs(this.mouseDragStart.x-evt.xy.x)>5||Math.abs(this.mouseDragStart.y-evt.xy.y)>5){var \
start=this.map.getLonLatFromViewPortPx(this.mouseDragStart);var \
end=this.map.getLonLatFromViewPortPx(evt.xy);var top=Math.max(start.lat,end.lat);var \
bottom=Math.min(start.lat,end.lat);var left=Math.min(start.lon,end.lon);var \
right=Math.max(start.lon,end.lon);var bounds=new \
OpenLayers.Bounds(left,bottom,right,top);this.map.zoomToExtent(bounds);}else{var \
end=this.map.getLonLatFromViewPortPx(evt.xy);this.map.setCenter(new \
                OpenLayers.LonLat((end.lon),(end.lat)),this.map.getZoom()+1);}
-this.removeZoomBox();}},removeZoomBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null;},onWheelEvent:function(e){var \
inMapúlse;var elem=OpenLayers.Event.element(e);while(elem!=null){if(this.map&&elem==this.map.div){inMap=true;break;}
                
-elem=elem.parentNode;}
-if(inMap){var delta=0;if(!e){e=window.event;}
-if(e.wheelDelta){delta=e.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){delta=-delta;}}else \
                if(e.detail){delta=-e.detail/3;}
-if(delta){e.xy=this.mousePosition;if(delta<0){this.defaultWheelDown(e);}else{this.defaultWheelUp(e);}}
                
-OpenLayers.Event.stop(e);}},CLASS_NAME:"OpenLayers.Control.MouseDefaults"});OpenLayer \
s.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{element:null,prefix:'',separator:', \
',suffix:'',numdigits:5,granularity:10,lastXy:null,displayProjection:null,initialize:f \
unction(options){OpenLayers.Control.prototype.initialize.apply(this,arguments);},destr \
                oy:function(){if(this.map){this.map.events.unregister('mousemove',this,this.redraw);}
                
-OpenLayers.Control.prototype.destroy.apply(this,arguments);},draw:function(){OpenLaye \
rs.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.left="";this.div.top="";this.element=this.div;}
                
-this.redraw();return this.div;},redraw:function(evt){var \
lonLat;if(evt==null){lonLat=new \
OpenLayers.LonLat(0,0);}else{if(this.lastXy==null||Math.abs(evt.xy.x-this.lastXy.x)>this.granularity||Math.abs(evt.xy.y-this.lastXy.y)>this.granularity)
                
-{this.lastXy=evt.xy;return;}
-lonLat=this.map.getLonLatFromPixel(evt.xy);if(!lonLat){return;}
-if(this.displayProjection){lonLat.transform(this.map.getProjectionObject(),this.displayProjection);}
                
-this.lastXy=evt.xy;}
-var newHtml=this.formatOutput(lonLat);if(newHtml!=this.element.innerHTML){this.element.innerHTML=newHtml;}},formatOutput:function(lonLat){var \
                digits=parseInt(this.numdigits);var newHtml=this.prefix+
-lonLat.lon.toFixed(digits)+
-this.separator+
-lonLat.lat.toFixed(digits)+
-this.suffix;return newHtml;},setMap:function(){OpenLayers.Control.prototype.setMap.ap \
ply(this,arguments);this.map.events.register('mousemove',this,this.redraw);},CLASS_NAM \
E:"OpenLayers.Control.MousePosition"});OpenLayers.Control.NavigationHistory=OpenLayers \
.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOGGLE,previous:null,previousO \
ptions:null,next:null,nextOptions:null,limit:50,activateOnDraw:true,clearOnDeactivate: \
false,registry:null,nextStack:null,previousStack:null,listeners:null,restoring:false,i \
nitialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,[option \
s]);this.registry=OpenLayers.Util.extend({"moveend":function(){return{center:this.map. \
getCenter(),resolution:this.map.getResolution()};}},this.registry);this.clear();var \
previousOptions={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayCl \
ass:this.displayClass+"Previous"};OpenLayers.Util.extend(previousOptions,this.previousOptions);this.previous=new \
OpenLayers.Control.  Button(previousOptions);var \
nextOptions={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this \
.displayClass+"Next"};OpenLayers.Util.extend(nextOptions,this.nextOptions);this.next=new \
OpenLayers.Control.Button(nextOptions);},onPreviousChange:function(state,length){if(state&&!this.previous.active){this.previous.activate();}else \
if(!state&&this.previous.active){this.previous.deactivate();}},onNextChange:function(state,length){if(state&&!this.next.active){this.next.activate();}else \
if(!state&&this.next.active){this.next.deactivate();}},destroy:function(){OpenLayers.C \
ontrol.prototype.destroy.apply(this);this.previous.destroy();this.next.destroy();this.deactivate();for(var \
prop in this){this[prop]=null;}},setMap:function(map){this.map=map;this.next.setMap(ma \
p);this.previous.setMap(map);},draw:function(){OpenLayers.Control.prototype.draw.apply \
(this,arguments);this.next.draw();this.previous.draw();if(this.activateOnDraw){this.activate();}},previousTrigger:functio
  n(){var current=this.previousStack.shift();var \
state=this.previousStack.shift();if(state!=undefined){this.nextStack.unshift(current); \
this.previousStack.unshift(state);this.restoring=true;this.restore(state);this.restori \
ngúlse;this.onNextChange(this.nextStack[0],this.nextStack.length);this.onPreviousChang \
e(this.previousStack[1],this.previousStack.length-1);}else{this.previousStack.unshift(current);}
                
-return state;},nextTrigger:function(){var \
state=this.nextStack.shift();if(state!=undefined){this.previousStack.unshift(state);th \
is.restoring=true;this.restore(state);this.restoringúlse;this.onNextChange(this.nextSt \
ack[0],this.nextStack.length);this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);}
                
-return state;},clear:function(){this.previousStack=[];this.nextStack=[];},restore:function(state){var \
zoom=this.map.getZoomForResolution(state.resolution);this.map.setCenter(state.center,zoom);},setListeners:function(){this.listeners={};for(var \
type in this.registry){this.listeners[type]=OpenLayers.Function.bind(function(){if(!this.restoring){var \
state=this.registry[type].apply(this,arguments);this.previousStack.unshift(state);if(t \
his.previousStack.length>1){this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);}
                
-if(this.previousStack.length>(this.limit+1)){this.previousStack.pop();}
-if(this.nextStack.length>0){this.nextStack=[];this.onNextChange(null,0);}}
-return true;},this);}},activate:function(){var \
activatedúlse;if(this.map){if(OpenLayers.Control.prototype.activate.apply(this)){if(this.listeners==null){this.setListeners();}
                
-for(var type in this.listeners){this.map.events.register(type,this,this.listeners[type]);}
                
-activated=true;if(this.previousStack.length==0){this.initStack();}}}
-return activated;},initStack:function(){if(this.map.getCenter()){this.listeners.moveend();}},deactivate:function(){var \
deactivatedúlse;if(this.map){if(OpenLayers.Control.prototype.deactivate.apply(this)){for(var \
                type in \
                this.listeners){this.map.events.unregister(type,this,this.listeners[type]);}
                
-if(this.clearOnDeactivate){this.clear();}
-deactivated=true;}}
-return deactivated;},CLASS_NAME:"OpenLayers.Control.NavigationHistory"});OpenLayers.C \
ontrol.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,buttons:null,position:null,initialize:function(options){this.position=new \
OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);OpenLayers \
.Control.prototype.initialize.apply(this,arguments);},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);while(this.buttons.length){var \
                btn=this.buttons.shift();btn.map=null;OpenLayers.Event.stopObservingElement(btn);}
                
-this.buttons=null;this.position=null;},draw:function(px){OpenLayers.Control.prototype.draw.apply(this,arguments);px=this.position;this.buttons=[];var \
sz=new OpenLayers.Size(18,18);var centered=new \
OpenLayers.Pixel(px.x+sz.w/2,px.y);this._addButton("panup","north-mini.png",centered,s \
z);px.yÎntered.y+sz.h;this._addButton("panleft","west-mini.png",px,sz);this._addButton \
("panright","east-mini.png",px.add(sz.w,0),sz);this._addButton("pandown","south-mini.p \
ng",centered.add(0,sz.h*2),sz);this._addButton("zoomin","zoom-plus-mini.png",centered. \
add(0,sz.h*3+5),sz);this._addButton("zoomworld","zoom-world-mini.png",centered.add(0,s \
z.h*4+5),sz);this._addButton("zoomout","zoom-minus-mini.png",centered.add(0,sz.h*5+5),sz);return \
this.div;},_addButton:function(id,img,xy,sz){var \
imgLocation=OpenLayers.Util.getImagesLocation()+img;var \
btn=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_PanZoom_"+id,xy,sz,imgLocation,"absolute");this.div.appendChild(btn);OpenLayers.Event.observe(btn,
  "mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,btn));OpenLayers \
.Event.observe(btn,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick \
,btn));OpenLayers.Event.observe(btn,"click",OpenLayers.Function.bindAsEventListener(th \
is.doubleClick,btn));btn.action=id;btn.map=this.map;btn.slideFactor=this.slideFactor;this.buttons.push(btn);return \
btn;},doubleClick:function(evt){OpenLayers.Event.stop(evt);return \
                false;},buttonDown:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
                
-switch(this.action){case"panup":this.map.pan(0,-this.slideFactor);break;case"pandown" \
:this.map.pan(0,this.slideFactor);break;case"panleft":this.map.pan(-this.slideFactor,0 \
);break;case"panright":this.map.pan(this.slideFactor,0);break;case"zoomin":this.map.zo \
omIn();break;case"zoomout":this.map.zoomOut();break;case"zoomworld":this.map.zoomToMaxExtent();break;}
                
-OpenLayers.Event.stop(evt);},CLASS_NAME:"OpenLayers.Control.PanZoom"});OpenLayers.Con \
trol.PanZoom.X=4;OpenLayers.Control.PanZoom.Y=4;OpenLayers.Control.Panel=OpenLayers.Cl \
ass(OpenLayers.Control,{controls:null,defaultControl:null,initialize:function(options) \
{OpenLayers.Control.prototype.initialize.apply(this,[options]);this.controls=[];},dest \
roy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var \
i=this.controls.length-1;i>=0;i--){if(this.controls[i].events){this.controls[i].events.un({"activate":this.redraw,"deactivate":this.redraw,scope:this});}
                
-OpenLayers.Event.stopObservingElement(this.controls[i].panel_div);this.controls[i].pa \
nel_div=null;}},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){for(var \
i=0;i<this.controls.length;i++){if(this.controls[i]==this.defaultControl){this.controls[i].activate();}}
                
-this.redraw();return true;}else{return \
false;}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var \
                i=0;i<this.controls.length;i++){this.controls[i].deactivate();}
-return true;}else{return \
false;}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);for(var \
i=0;i<this.controls.length;i++){this.map.addControl(this.controls[i]);this.controls[i] \
.deactivate();this.controls[i].events.on({"activate":this.redraw,"deactivate":this.redraw,scope:this});}
                
-this.activate();return \
this.div;},redraw:function(){this.div.innerHTML="";if(this.active){for(var \
i=0;i<this.controls.length;i++){var \
element=this.controls[i].panel_div;if(this.controls[i].active){element.className=this. \
controls[i].displayClass+"ItemActive";}else{element.className=this.controls[i].displayClass+"ItemInactive";}
                
-this.div.appendChild(element);}}},activateControl:function(control){if(!this.active){return \
                false;}
-if(control.type==OpenLayers.Control.TYPE_BUTTON){control.trigger();return;}
-if(control.type==OpenLayers.Control.TYPE_TOGGLE){if(control.active){control.deactivate();}else{control.activate();}
                
-return;}
-for(var i=0;i<this.controls.length;i++){if(this.controls[i]!=control){if(this.controls[i].type!=OpenLayers.Control.TYPE_TOGGLE){this.controls[i].deactivate();}}}
                
-control.activate();},addControls:function(controls){if(!(controls instanceof \
                Array)){controls=[controls];}
-this.controls=this.controls.concat(controls);for(var i=0;i<controls.length;i++){var \
element=document.createElement("div");var textNode=document.createTextNode(" \
");controls[i].panel_div=element;if(controls[i].title!=""){controls[i].panel_div.title=controls[i].title;}
                
-OpenLayers.Event.observe(controls[i].panel_div,"click",OpenLayers.Function.bind(this. \
onClick,this,controls[i]));OpenLayers.Event.observe(controls[i].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop));}
                
-if(this.map){for(var \
i=0;i<controls.length;i++){this.map.addControl(controls[i]);controls[i].deactivate();c \
                ontrols[i].events.on({"activate":this.redraw,"deactivate":this.redraw,scope:this});}
                
-this.redraw();}},onClick:function(ctrl,evt){OpenLayers.Event.stop(evt?evt:window.event);this.activateControl(ctrl);},getControlsBy:function(property,match){var \
test=(typeof match.test=="function");var \
found=OpenLayers.Array.filter(this.controls,function(item){return \
item[property]==match||(test&&match.test(item[property]));});return \
found;},getControlsByName:function(match){return \
this.getControlsBy("name",match);},getControlsByClass:function(match){return \
this.getControlsBy("CLASS_NAME",match);},CLASS_NAME:"OpenLayers.Control.Panel"});OpenL \
ayers.Control.Permalink=OpenLayers.Class(OpenLayers.Control,{element:null,base:'',disp \
layProjection:null,initialize:function(element,base,options){OpenLayers.Control.protot \
ype.initialize.apply(this,[options]);this.element=OpenLayers.Util.getElement(element); \
this.baseºse||document.location.href;},destroy:function(){if(this.element.parentNode==this.div){this.div.removeChild(this.element);}
                
-this.element=null;this.map.events.unregister('moveend',this,this.updateLink);OpenLaye \
rs.Control.prototype.destroy.apply(this,arguments);},setMap:function(map){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var \
i=0;i<this.map.controls.length;i++){var \
control=this.map.controls[i];if(control.CLASS_NAME=="OpenLayers.Control.ArgParser"){if \
(control.displayProjection!=this.displayProjection){this.displayProjection=control.displayProjection;}
                
-break;}}
-if(i==this.map.controls.length){this.map.addControl(new \
OpenLayers.Control.ArgParser({'displayProjection':this.displayProjection}));}},draw:fu \
nction(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){thi \
s.element=document.createElement("a");this.element.innerHTML=OpenLayers.i18n("permalink");this.element.href="";this.div.appendChild(this.element);}
                
-this.map.events.on({'moveend':this.updateLink,'changelayer':this.updateLink,'changebaselayer':this.updateLink,scope:this});return \
                this.div;},updateLink:function(){var \
                center=this.map.getCenter();if(!center){return;}
-var params=OpenLayers.Util.getParameters(this.base);params.zoom=this.map.getZoom();var \
latÎnter.lat;var lonÎnter.lon;if(this.displayProjection){var \
mapPosition=OpenLayers.Projection.transform({x:lon,y:lat},this.map.getProjectionObject(),this.displayProjection);lon=mapPosition.x;lat=mapPosition.y;}
                
-params.lat=Math.round(lat*100000)/100000;params.lon=Math.round(lon*100000)/100000;params.layers='';for(var \
i=0;i<this.map.layers.length;i++){var \
layer=this.map.layers[i];if(layer.isBaseLayer){params.layers+=(layer==this.map.baseLayer)?"B":"0";}else{params.layers+=(layer.getVisibility())?"T":"F";}}
                
-var href=this.base;if(href.indexOf('?')!=-1){href=href.substring(0,href.indexOf('?'));}
                
-href+='?'+OpenLayers.Util.getParameterString(params);this.element.href=href;},CLASS_N \
AME:"OpenLayers.Control.Permalink"});OpenLayers.Control.Scale=OpenLayers.Class(OpenLay \
ers.Control,{element:null,initialize:function(element,options){OpenLayers.Control.prot \
otype.initialize.apply(this,[options]);this.element=OpenLayers.Util.getElement(element \
);},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.e \
lement){this.element=document.createElement("div");this.div.appendChild(this.element);}
                
-this.map.events.register('moveend',this,this.updateScale);this.updateScale();return \
                this.div;},updateScale:function(){var \
                scale=this.map.getScale();if(!scale){return;}
-if(scale>•00&&scale<•0000){scale=Math.round(scale/1000)+"K";}else \
                if(scale>•0000){scale=Math.round(scale/1000000)+"M";}else{scale=Math.round(scale);}
                
-this.element.innerHTML=OpenLayers.i18n("scale",{'scaleDenom':scale});},CLASS_NAME:"Op \
enLayers.Control.Scale"});OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Con \
trol,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:" \
ft",eTop:null,eBottom:null,initialize:function(options){OpenLayers.Control.prototype.i \
nitialize.apply(this,[options]);},draw:function(){OpenLayers.Control.prototype.draw.ap \
ply(this,arguments);if(!this.eTop){this.div.style.display="block";this.div.style.posit \
ion="absolute";this.eTop=document.createElement("div");this.eTop.className=this.displayClass+"Top";var \
theLen=this.topInUnits.length;this.div.appendChild(this.eTop);if((this.topOutUnits=="" \
)||(this.topInUnits=="")){this.eTop.style.visibility="hidden";}else{this.eTop.style.visibility="visible";}
                
-this.eBottom=document.createElement("div");this.eBottom.className=this.displayClass+" \
Bottom";this.div.appendChild(this.eBottom);if((this.bottomOutUnits=="")||(this.bottomI \
nUnits=="")){this.eBottom.style.visibility="hidden";}else{this.eBottom.style.visibility="visible";}}
                
-this.map.events.register('moveend',this,this.update);this.update();return \
this.div;},getBarLen:function(maxLen){var \
digits=parseInt(Math.log(maxLen)/Math.log(10));var pow10=Math.pow(10,digits);var \
firstChar=parseInt(maxLen/pow10);var barLen;if(firstChar>5){barLen=5;}else \
                if(firstChar>2){barLen=2;}else{barLen=1;}
-return barLen*pow10;},update:function(){var \
                res=this.map.getResolution();if(!res){return;}
-var curMapUnits=this.map.units;var inches=OpenLayers.INCHES_PER_UNIT;var \
maxSizeData=this.maxWidth*res*inches[curMapUnits];var topUnits;var \
bottomUnits;if(maxSizeData>100000){topUnits=this.topOutUnits;bottomUnits=this.bottomOutUnits;}else{topUnits=this.topInUnits;bottomUnits=this.bottomInUnits;}
                
-var topMax=maxSizeData/inches[topUnits];var \
bottomMax=maxSizeData/inches[bottomUnits];var topRounded=this.getBarLen(topMax);var \
bottomRounded=this.getBarLen(bottomMax);topMax=topRounded/inches[curMapUnits]*inches[topUnits];bottomMax=bottomRounded/inches[curMapUnits]*inches[bottomUnits];var \
topPx=topMax/res;var \
bottomPx=bottomMax/res;this.eTop.style.width=Math.round(topPx)+"px";this.eBottom.style.width=Math.round(bottomPx)+"px";this.eTop.innerHTML=topRounded+" \
"+topUnits;this.eBottom.innerHTML=bottomRounded+" \
"+bottomUnits;},CLASS_NAME:"OpenLayers.Control.ScaleLine"});OpenLayers.Control.ZoomToM \
axExtent=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trig \
ger:function(){if(this.map){this.map.zoomToMaxExtent();}},CLASS_NAME:"OpenLayers.Contr \
ol.ZoomToMaxExtent"});OpenLayers.Event={observers:false,KEY_BACKSPACE:8,KEY_TAB:9,KEY_ \
RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(event){return \
event.target||even  t.srcElement;},isLeftClick:function(event){return(((event.which)&& \
(event.which==1))||((event.button)&&(event.button==1)));},stop:function(event,allowDef \
ault){if(!allowDefault){if(event.preventDefault){event.preventDefault();}else{event.returnValueúlse;}}
                
-if(event.stopPropagation){event.stopPropagation();}else{event.cancelBubble=true;}},findElement:function(event,tagName){var \
element=OpenLayers.Event.element(event);while(element.parentNode&&(!element.tagName||( \
                element.tagName.toUpperCase()!=tagName.toUpperCase()))){element=element.parentNode;}
                
-return element;},observe:function(elementParam,name,observer,useCapture){var \
element=OpenLayers.Util.getElement(elementParam);useCapture=useCapture||false;if(name= \
='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.attachEvent)){name='keydown';}
                
-if(!this.observers){this.observers={};}
-if(!element._eventCacheID){var \
                idPrefix="eventCacheID_";if(element.id){idPrefix=element.id+"_"+idPrefix;}
                
-element._eventCacheID=OpenLayers.Util.createUniqueID(idPrefix);}
-var cacheID=element._eventCacheID;if(!this.observers[cacheID]){this.observers[cacheID]=[];}
                
-this.observers[cacheID].push({'element':element,'name':name,'observer':observer,'useC \
apture':useCapture});if(element.addEventListener){element.addEventListener(name,observer,useCapture);}else \
if(element.attachEvent){element.attachEvent('on'+name,observer);}},stopObservingElement:function(elementParam){var \
element=OpenLayers.Util.getElement(elementParam);var \
cacheID=element._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[ \
cacheID]);},_removeElementObservers:function(elementObservers){if(elementObservers){for(var \
i=elementObservers.length-1;i>=0;i--){var entry=elementObservers[i];var args=new \
Array(entry.element,entry.name,entry.observer,entry.useCapture);var \
removed=OpenLayers.Event.stopObserving.apply(this,args);}}},stopObserving:function(elementParam,name,observer,useCapture){useCapture=useCapture||false;var \
element=OpenLayers.Util.getElement(elementParam);var \
cacheID=element._eventCacheID;if(name=='keypress'){if(navigator.appVersion.match(/Konqueror|Sa
  fari|KHTML/)||element.detachEvent){name='keydown';}}
-var foundEntryúlse;var \
elementObservers=OpenLayers.Event.observers[cacheID];if(elementObservers){var \
i=0;while(!foundEntry&&i<elementObservers.length){var \
cacheEntry=elementObservers[i];if((cacheEntry.name==name)&&(cacheEntry.observer==obser \
ver)&&(cacheEntry.useCapture==useCapture)){elementObservers.splice(i,1);if(elementObservers.length==0){delete \
                OpenLayers.Event.observers[cacheID];}
-foundEntry=true;break;}
-i++;}}
-if(foundEntry){if(element.removeEventListener){element.removeEventListener(name,observer,useCapture);}else \
                if(element&&element.detachEvent){element.detachEvent('on'+name,observer);}}
                
-return foundEntry;},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var \
cacheID in OpenLayers.Event.observers){var \
elementObservers=OpenLayers.Event.observers[cacheID];OpenLayers.Event._removeElementObservers.apply(this,[elementObservers]);}
                
-OpenLayers.Event.observersúlse;}},CLASS_NAME:"OpenLayers.Event"};OpenLayers.Event.obs \
erve(window,'unload',OpenLayers.Event.unloadCache,false);if(window.Event){OpenLayers.Util.applyDefaults(window.Event,OpenLayers.Event);}else{var \
                Event=OpenLayers.Event;}
-OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown \
","mouseup","mousemove","click","dblclick","resize","focus","blur"],listeners:null,obj \
ect:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,initialize:fu \
nction(object,element,eventTypes,fallThrough){this.object=object;this.element=element; \
this.eventTypes=eventTypes;this.fallThroughúllThrough;this.listeners={};this.eventHand \
ler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);if(this.eventTypes!=null){for(var \
                i=0;i<this.eventTypes.length;i++){this.addEventType(this.eventTypes[i]);}}
                
-if(this.element!=null){this.attachToElement(element);}},destroy:function(){if(this.element){OpenLayers.Event.stopObservingElement(this.element);}
                
-this.element=null;this.listeners=null;this.object=null;this.eventTypes=null;this.fall \
Through=null;this.eventHandler=null;},addEventType:function(eventName){if(!this.listen \
ers[eventName]){this.listeners[eventName]=[];}},attachToElement:function(element){for(var \
i=0;i<this.BROWSER_EVENTS.length;i++){var \
eventType=this.BROWSER_EVENTS[i];this.addEventType(eventType);OpenLayers.Event.observe(element,eventType,this.eventHandler);}
                
-OpenLayers.Event.observe(element,"dragstart",OpenLayers.Event.stop);},on:function(object){for(var \
type in object){if(type!="scope"){this.register(type,object.scope,object[type]);}}},re \
gister:function(type,obj,func){if(func!=null&&((this.eventTypes&&OpenLayers.Util.index \
Of(this.eventTypes,type)!=-1)||OpenLayers.Util.indexOf(this.BROWSER_EVENTS,type)!=-1)){if(obj==null){obj=this.object;}
                
-var listeners=this.listeners[type];if(listeners!=null){listeners.push({obj:obj,func:f \
unc});}}},registerPriority:function(type,obj,func){if(func!=null){if(obj==null){obj=this.object;}
                
-var listeners=this.listeners[type];if(listeners!=null){listeners.unshift({obj:obj,func:func});}}},un:function(object){for(var \
type in object){if(type!="scope"){this.unregister(type,object.scope,object[type]);}}},unregister:function(type,obj,func){if(obj==null){obj=this.object;}
                
-var listeners=this.listeners[type];if(listeners!=null){for(var \
i=0;i<listeners.length;i++){if(listeners[i].obj==obj&&listeners[i].func==func){listene \
rs.splice(i,1);break;}}}},remove:function(type){if(this.listeners[type]!=null){this.listeners[type]=[];}},triggerEvent:function(type,evt){if(evt==null){evt={};}
                
-evt.object=this.object;evt.element=this.element;if(!evt.type){evt.type=type;}
-var listeners=(this.listeners[type])?this.listeners[type].slice():null;if((listeners!=null)&&(listeners.length>0)){var \
continueChain;for(var i=0;i<listeners.length;i++){var \
callback=listeners[i];continueChainÊllback.func.apply(callback.obj,[evt]);if((continueChain!=undefined)&&(continueChain=úlse)){break;}}
                
-if(!this.fallThrough){OpenLayers.Event.stop(evt,true);}}
-return continueChain;},handleBrowserEvent:function(evt){evt.xy=this.getMousePosition( \
evt);this.triggerEvent(evt.type,evt);},getMousePosition:function(evt){if(!this.element \
.offsets){this.element.offsets=OpenLayers.Util.pagePosition(this.element);this.element \
.offsets[0]+=(document.documentElement.scrollLeft||document.body.scrollLeft);this.element.offsets[1]+=(document.documentElement.scrollTop||document.body.scrollTop);}
                
-return new OpenLayers.Pixel((evt.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))-this.element.offsets[0]
                
--(document.documentElement.clientLeft||0),(evt.clientY+(document.documentElement.scrollTop||document.body.scrollTop))-this.element.offsets[1]
                
--(document.documentElement.clientTop||0));},CLASS_NAME:"OpenLayers.Events"});OpenLaye \
rs.Format=OpenLayers.Class({externalProjection:null,internalProjection:null,initialize \
:function(options){OpenLayers.Util.extend(this,options);},read:function(data){alert(Op \
enLayers.i18n("readNotImplemented"));},write:function(object){alert(OpenLayers.i18n("w \
riteNotImplemented"));},CLASS_NAME:"OpenLayers.Format"});OpenLayers.Lang.en={'unhandledRequest':"Unhandled \
request return ${statusText}",'permalink':"Permalink",'overlays':"Overlays",'baseLayer':"Base \
Layer",'sameProjection':"The overview map only works when it is in the same \
projection as the main map",'readNotImplemented':"Read not \
implemented.",'writeNotImplemented':"Write not implemented.",'noFID':"Can't update a \
feature for which there is no FID.",'errorLoadingGML':"Error in loading GML file \
${url}",'browserNotSupported':"Your browser does not support vector rendering. \
Currently supported renderers are:\n${renderers}",'componentShoul  dBe':"addFeatures \
: component should be an ${geomType}",'getFeatureError':"getFeatureFromEvent called \
on layer with no renderer. This usually means you "+"destroyed a layer, but not some \
handler which is associated with it.",'minZoomLevelError':"The minZoomLevel property \
is only intended for use "+"with the FixedZoomLevels-descendent layers. That this \
"+"wfs layer checks for minZoomLevel is a relic of the"+"past. We cannot, however, \
remove it without possibly "+"breaking OL based applications that may depend on \
it."+" Therefore we are deprecating it -- the minZoomLevel "+"check below will be \
removed at 3.0. Please instead "+"use min/max resolution setting as described here: \
"+"http://trac.openlayers.org/wiki/SettingZoomLevels",'commitSuccess':"WFS \
Transaction: SUCCESS ${response}",'commitFailed':"WFS Transaction: FAILED \
${response}",'googleWarning':"The Google Layer was unable to load \
correctly.<br><br>"+"To get rid of this message, select a new BaseLayer "+"in the \
layer swi  tcher in the upper-right corner.<br><br>"+"Most likely, this is because \
the Google Maps library "+"script was either not included, or does not contain the \
"+"correct API key for your site.<br><br>"+"Developers: For help getting this working \
correctly, "+"<a href='http://trac.openlayers.org/wiki/Google' \
"+"target='_blank'>click here</a>",'getLayerWarning':"The ${layerType} Layer was \
unable to load correctly.<br><br>"+"To get rid of this message, select a new \
BaseLayer "+"in the layer switcher in the upper-right corner.<br><br>"+"Most likely, \
this is because the ${layerLib} library "+"script was either not correctly \
included.<br><br>"+"Developers: For help getting this working correctly, "+"<a \
href='http://trac.openlayers.org/wiki/${layerLib}' "+"target='_blank'>click \
here</a>",'scale':"Scale = 1 : ${scaleDenom}",'layerAlreadyAdded':"You tried to add \
the layer: ${layerName} to the map, but it has already been \
added",'reprojectDeprecated':"You are using the 'reproject' option "  +"on the \
${layerName} layer. This option is deprecated: "+"its use was designed to support \
displaying data over commercial "+"basemaps, but that functionality should now be \
achieved by using "+"Spherical Mercator support. More information is available from \
"+"http://trac.openlayers.org/wiki/SphericalMercator.",'methodDeprecated':"This \
method has been deprecated and will be removed in 3.0. "+"Please use ${newMethod} \
instead.",'boundsAddError':"You must pass both x and y values to the add \
function.",'lonlatAddError':"You must pass both lon and lat values to the add \
function.",'pixelAddError':"You must pass both x and y values to the add \
function.",'unsupportedGeometryType':"Unsupported geometry type: \
${geomType}",'pagePositionFailed':"OpenLayers.Util.pagePosition failed: element with \
id ${elemId} may be misplaced.",'end':''};OpenLayers.Popup.Anchored=OpenLayers.Class(O \
penLayers.Popup,{relativePosition:null,anchor:null,initialize:function(id,lonlat,size,contentHTML,anchor,close
  Box,closeBoxCallback){var newArguments=new \
Array(id,lonlat,size,contentHTML,closeBox,closeBoxCallback);OpenLayers.Popup.prototype.initialize.apply(this,newArguments);this.anchor=(anchor!=null)?anchor:{size:new \
OpenLayers.Size(0,0),offset:new \
OpenLayers.Pixel(0,0)};},destroy:function(){this.anchor=null;this.relativePosition=nul \
l;OpenLayers.Popup.prototype.destroy.apply(this,arguments);},show:function(){this.upda \
tePosition();OpenLayers.Popup.prototype.show.apply(this,arguments);},moveTo:function(px){var \
oldRelativePosition=this.relativePosition;this.relativePosition=this.calculateRelativePosition(px);var \
newPx=this.calculateNewPx(px);var newArguments=new \
Array(newPx);OpenLayers.Popup.prototype.moveTo.apply(this,newArguments);if(this.relati \
vePosition!=oldRelativePosition){this.updateRelativePosition();}},setSize:function(siz \
e){OpenLayers.Popup.prototype.setSize.apply(this,arguments);if((this.lonlat)&&(this.map)){var \
px=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(px);  \
}},calculateRelativePosition:function(px){var \
lonlat=this.map.getLonLatFromLayerPx(px);var extent=this.map.getExtent();var \
quadrant=extent.determineQuadrant(lonlat);return \
OpenLayers.Bounds.oppositeQuadrant(quadrant);},updateRelativePosition:function(){},calculateNewPx:function(px){var \
newPx=px.offset(this.anchor.offset);var \
top=(this.relativePosition.charAt(0)=='t');newPx.y+=(top)?-this.size.h:this.anchor.size.h;var \
left=(this.relativePosition.charAt(1)=='l');newPx.x+=(left)?-this.size.w:this.anchor.size.w;return \
newPx;},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Projection=OpenLayers.Clas \
s({proj:null,projCode:null,initialize:function(projCode,options){OpenLayers.Util.extend(this,options);this.projCode=projCode;if(window.Proj4js){this.proj=new \
Proj4js.Proj(projCode);}},getCode:function(){return \
this.proj?this.proj.srsCode:this.projCode;},getUnits:function(){return \
this.proj?this.proj.units:null;},toString:function(){return \
this.getCode();},equals:function(projectio  \
n){if(projection&&projection.getCode){return \
this.getCode()==projection.getCode();}else{return false;}},destroy:function(){delete \
this.proj;delete this.projCode;},CLASS_NAME:"OpenLayers.Projection"});OpenLayers.Proje \
ction.transforms={};OpenLayers.Projection.addTransform=function(from,to,method){if(!Op \
                enLayers.Projection.transforms[from]){OpenLayers.Projection.transforms[from]={};}
                
-OpenLayers.Projection.transforms[from][to]=method;};OpenLayers.Projection.transform=f \
unction(point,source,dest){if(source.proj&&dest.proj){point=Proj4js.transform(source.proj,dest.proj,point);}else \
if(source&&dest&&OpenLayers.Projection.transforms[source.getCode()]&&OpenLayers.Projec \
tion.transforms[source.getCode()][dest.getCode()]){OpenLayers.Projection.transforms[source.getCode()][dest.getCode()](point);}
                
-return point;};OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{ren \
dererRoot:null,root:null,xmlns:null,minimumSymbolizer:{strokeLinecap:"round",strokeOpa \
city:1,fillOpacity:1,pointRadius:0},initialize:function(containerID){OpenLayers.Render \
er.prototype.initialize.apply(this,arguments);this.rendererRoot=this.createRenderRoot( \
);this.root=this.createRoot();this.rendererRoot.appendChild(this.root);this.container. \
appendChild(this.rendererRoot);},destroy:function(){this.clear();this.rendererRoot=nul \
l;this.root=null;this.xmlns=null;OpenLayers.Renderer.prototype.destroy.apply(this,argu \
ments);},clear:function(){if(this.root){while(this.root.childNodes.length>0){this.root \
.removeChild(this.root.firstChild);}}},getNodeType:function(geometry,style){},drawGeometry:function(geometry,style,featureId){var \
className=geometry.CLASS_NAME;if((className=="OpenLayers.Geometry.Collection")||(class \
Name=="OpenLayers.Geometry.MultiPoint")||(className=="OpenLayers.Geometry.MultiLineStr
  ing")||(className=="OpenLayers.Geometry.MultiPolygon")){for(var \
i=0;i<geometry.components.length;i++){this.drawGeometry(geometry.components[i],style,featureId);}
                
-return;};if(style.display!="none"){var nodeType=this.getNodeType(geometry,style);var \
node=this.nodeFactory(geometry.id,nodeType);node._featureIdþatureId;node._geometryClas \
s=geometry.CLASS_NAME;node._style=style;node=this.drawGeometryNode(node,geometry);if(node.parentNode!=this.root){this.root.appendChild(node);}
                
-this.postDraw(node);}else{node=OpenLayers.Util.getElement(geometry.id);if(node){node. \
parentNode.removeChild(node);}}},drawGeometryNode:function(node,geometry,style){style= \
style||node._style;OpenLayers.Util.applyDefaults(style,this.minimumSymbolizer);var \
options={'isFilled':true,'isStroked':!!style.strokeWidth};switch(geometry.CLASS_NAME){ \
case"OpenLayers.Geometry.Point":this.drawPoint(node,geometry);break;case"OpenLayers.Ge \
ometry.LineString":options.isFilledúlse;this.drawLineString(node,geometry);break;case" \
OpenLayers.Geometry.LinearRing":this.drawLinearRing(node,geometry);break;case"OpenLaye \
rs.Geometry.Polygon":this.drawPolygon(node,geometry);break;case"OpenLayers.Geometry.Su \
rface":this.drawSurface(node,geometry);break;case"OpenLayers.Geometry.Rectangle":this.drawRectangle(node,geometry);break;default:break;}
                
-node._style=style;node._options=options;return \
this.setStyle(node,style,options,geometry);},postDraw:function(node){},drawPoint:funct \
ion(node,geometry){},drawLineString:function(node,geometry){},drawLinearRing:function( \
node,geometry){},drawPolygon:function(node,geometry){},drawRectangle:function(node,geo \
metry){},drawCircle:function(node,geometry){},drawSurface:function(node,geometry){},getFeatureIdFromEvent:function(evt){var \
node=evt.target||evt.srcElement;return \
node._featureId;},eraseGeometry:function(geometry){if((geometry.CLASS_NAME=="OpenLayer \
s.Geometry.MultiPoint")||(geometry.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(geometry.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")){for(var \
i=0;i<geometry.components.length;i++){this.eraseGeometry(geometry.components[i]);}}else{var \
element=OpenLayers.Util.getElement(geometry.id);if(element&&element.parentNode){element.parentNode.removeChild(element);}}},nodeFactory:function(id,type){var \
node=OpenLayers.Util.getElement  \
(id);if(node){if(!this.nodeTypeCompare(node,type)){node.parentNode.removeChild(node);node=this.nodeFactory(id,type);}}else{node=this.createNode(type,id);}
                
-return node;},CLASS_NAME:"OpenLayers.Renderer.Elements"});OpenLayers.Tile=OpenLayers. \
Class({EVENT_TYPES:["loadstart","loadend","reload","unload"],events:null,id:null,layer \
:null,url:null,bounds:null,size:null,position:null,isLoading:false,isBackBuffer:false, \
lastRatio:1,isFirstDraw:true,backBufferTile:null,initialize:function(layer,position,bo \
unds,url,size){this.layer=layer;this.position=position.clone();this.bounds=bounds.clon \
e();this.url=url;this.size=size.clone();this.id=OpenLayers.Util.createUniqueID("Tile_");this.events=new \
OpenLayers.Events(this,null,this.EVENT_TYPES);},unload:function(){if(this.isLoading){t \
his.isLoadingúlse;this.events.triggerEvent("unload");}},destroy:function(){if(OpenLaye \
rs.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){thi \
s.layer.events.unregister("loadend",this,this.resetBackBuffer);this.events.unregister( \
'loadend',this,this.resetBackBuffer);}else{this.events.unregister('loadend',this,this.showTile);}
                
-this.layer=null;this.bounds=null;this.size=null;this.position=null;this.events.destro \
y();this.events=null;if(this.backBufferTile){this.backBufferTile.destroy();this.backBufferTile=null;}},clone:function(obj){if(obj==null){obj=new \
                OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size);}
                
-OpenLayers.Util.applyDefaults(obj,this);return obj;},draw:function(){var \
maxExtent=this.layer.maxExtent;var \
withinMaxExtent=(maxExtent&&this.bounds.intersectsBounds(maxExtent,false));var \
drawTile=(withinMaxExtent||this.layer.displayOutsideMaxExtent);if(OpenLayers.Util.inde \
xOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(drawTile){if \
(!this.backBufferTile){this.backBufferTile=this.clone();this.backBufferTile.hide();thi \
s.backBufferTile.isBackBuffer=true;this.events.register('loadend',this,this.resetBackBuffer);this.layer.events.register("loadend",this,this.resetBackBuffer);}
                
-this.startTransition();}else{if(this.backBufferTile){this.backBufferTile.clear();}}}e \
lse{if(drawTile&&this.isFirstDraw){this.events.register('loadend',this,this.showTile);this.isFirstDrawúlse;}}
                
-this.shouldDraw=drawTile;this.clear();return \
                drawTile;},moveTo:function(bounds,position,redraw){if(redraw==null){redraw=true;}
                
-this.bounds=bounds.clone();this.position=position.clone();if(redraw){this.draw();}},clear:function(){},getBoundsFromBaseLayer:function(position){var \
msg=OpenLayers.i18n('reprojectDeprecated',{'layerName':this.layer.name});OpenLayers.Console.warn(msg);var \
topLeft=this.layer.map.getLonLatFromLayerPx(position);var \
bottomRightPx=position.clone();bottomRightPx.x+=this.size.w;bottomRightPx.y+=this.size.h;var \
bottomRight=this.layer.map.getLonLatFromLayerPx(bottomRightPx);if(topLeft.lon>bottomRi \
ght.lon){if(topLeft.lon<0){topLeft.lon=-180-(topLeft.lon+180);}else{bottomRight.lon0+bottomRight.lon+180;}}
                
-var bounds=new OpenLayers.Bounds(topLeft.lon,bottomRight.lat,bottomRight.lon,topLeft.lat);return \
bounds;},startTransition:function(){},resetBackBuffer:function(){this.showTile();if(th \
is.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)){this.isFirstDrawúlse;var \
maxExtent=this.layer.maxExtent;var \
withinMaxExtent=(maxExtent&&this.bounds.intersectsBounds(maxExtent,false));if(withinMa \
xExtent){this.backBufferTile.position=this.position;this.backBufferTile.bounds=this.bo \
unds;this.backBufferTile.size=this.size;this.backBufferTile.imageSize=this.layer.image \
Size||this.size;this.backBufferTile.imageOffset=this.layer.imageOffset;this.backBuffer \
Tile.resolution=this.layer.getResolution();this.backBufferTile.renderTile();}}},showTi \
le:function(){if(this.shouldDraw){this.show();}},show:function(){},hide:function(){},C \
LASS_NAME:"OpenLayers.Tile"});OpenLayers.Control.MouseToolbar=OpenLayers.Class(OpenLayers.Control.MouseDefaults,{mode:null,buttons:null,direction:"vertical",but
  tonClicked:null,initialize:function(position,direction){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.position=new \
OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,OpenLayers.Control.MouseToolbar.Y);if(position){this.position=position;}
                
-if(direction){this.direction=direction;}
-this.measureDivs=[];},destroy:function(){for(var btnId in this.buttons){var \
                btn=this.buttons[btnId];btn.map=null;btn.events.destroy();}
-OpenLayers.Control.MouseDefaults.prototype.destroy.apply(this,arguments);},draw:funct \
ion(){OpenLayers.Control.prototype.draw.apply(this,arguments);OpenLayers.Control.MouseDefaults.prototype.draw.apply(this,arguments);this.buttons={};var \
sz=new OpenLayers.Size(28,28);var centered=new \
OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,0);this._addButton("zoombox","drag-rectangle-off.png","drag-rectangle-on.png",centered,sz,"Shift->Drag \
to zoom to area");centeredÎntered.add((this.direction=="vertical"?0:sz.w),(this.direct \
ion=="vertical"?sz.h:0));this._addButton("pan","panning-hand-off.png","panning-hand-on.png",centered,sz,"Drag \
the map to pan.");centeredÎntered.add((this.direction=="vertical"?0:sz.w),(this.direction=="vertical"?sz.h:0));this.switchModeTo("pan");return \
this.div;},_addButton:function(id,img,activeImg,xy,sz,title){var \
imgLocation=OpenLayers.Util.getImagesLocation()+img;var \
activeImgLocation=OpenLayers.Util.getImagesLocation()+activeImg;var \
                btn=OpenLayers.Util
 .createAlphaImageDiv("OpenLayers_Control_MouseToolbar_"+id,xy,sz,imgLocation,"absolut \
e");this.div.appendChild(btn);btn.imgLocation=imgLocation;btn.activeImgLocation¬tiveImgLocation;btn.events=new \
OpenLayers.Events(this,btn,null,true);btn.events.on({"mousedown":this.buttonDown,"mous \
eup":this.buttonUp,"dblclick":OpenLayers.Event.stop,scope:this});btn.action=id;btn.title=title;btn.alt=title;btn.map=this.map;this.buttons[id]=btn;return \
                btn;},buttonDown:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
                
-this.buttonClicked=evt.element.action;OpenLayers.Event.stop(evt);},buttonUp:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
                
-if(this.buttonClicked!=null){if(this.buttonClicked==evt.element.action){this.switchModeTo(evt.element.action);}
                
-OpenLayers.Event.stop(evt);this.buttonClicked=null;}},defaultDblClick:function(evt){this.switchModeTo("pan");this.performedDragúlse;var \
newCenter=this.map.getLonLatFromViewPortPx(evt.xy);this.map.setCenter(newCenter,this.map.zoom+1);OpenLayers.Event.stop(evt);return \
false;},defaultMouseDown:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
                
-this.mouseDragStart=evt.xy.clone();this.performedDragúlse;this.startViaKeyboardúlse;i \
f(evt.shiftKey&&this.mode!="zoombox"){this.switchModeTo("zoombox");this.startViaKeyboard=true;}else \
if(evt.altKey&&this.mode!="measure"){this.switchModeTo("measure");}else \
                if(!this.mode){this.switchModeTo("pan");}
-switch(this.mode){case"zoombox":this.map.div.style.cursor="crosshair";this.zoomBox=OpenLayers.Util.createDiv('zoomBox',this.mouseDragStart,null,null,"absolute","2px \
solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.filter="alph \
a(opacityP)";this.zoomBox.style.opacity="0.50";this.zoomBox.style.fontSize="1px";this. \
zoomBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.viewPortDiv.appendChild(this.zoomBox);this.performedDrag=true;break;case"measure":var \
distance="";if(this.measureStart){var \
measureEnd=this.map.getLonLatFromViewPortPx(this.mouseDragStart);distance=OpenLayers.U \
til.distVincenty(this.measureStart,measureEnd);distance=Math.round(distance*100)/100;distance=distance+"km";this.measureStartBox=this.measureBox;}
                
-this.measureStart=this.map.getLonLatFromViewPortPx(this.mouseDragStart);;this.measure \
Box=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerC \
ontainerDiv.style.left),-2-parseInt(this.map.layerContainerDiv.style.top)),null,null," \
absolute");this.measureBox.style.width="4px";this.measureBox.style.height="4px";this.m \
easureBox.style.fontSize="1px";this.measureBox.style.backgroundColor="red";this.measur \
eBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.layerContainerDiv.appendCh \
ild(this.measureBox);if(distance){this.measureBoxDistance=OpenLayers.Util.createDiv(nu \
ll,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),2-parseI \
nt(this.map.layerContainerDiv.style.top)),null,null,"absolute");this.measureBoxDistanc \
e.innerHTML=distance;this.measureBoxDistance.style.zIndex=this.map.Z_INDEX_BASE["Popup \
"]-1;this.map.layerContainerDiv.appendChild(this.measureBoxDistance);this.measureDivs.push(this.measureBoxDistance);}
                
-this.measureBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.layerContainer \
Div.appendChild(this.measureBox);this.measureDivs.push(this.measureBox);break;default:this.map.div.style.cursor="move";break;}
                
-document.onselectstart=function(){return \
false;};OpenLayers.Event.stop(evt);},switchModeTo:function(mode){if(mode!=this.mode){i \
f(this.mode&&this.buttons[this.mode]){OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode],null,null,null,this.buttons[this.mode].imgLocation);}
                
-if(this.mode=="measure"&&mode!="measure"){for(var \
i=0;i<this.measureDivs.length;i++){if(this.measureDivs[i]){this.map.layerContainerDiv.removeChild(this.measureDivs[i]);}}
                
-this.measureDivs=[];this.measureStart=null;}
-this.mode=mode;if(this.buttons[mode]){OpenLayers.Util.modifyAlphaImageDiv(this.buttons[mode],null,null,null,this.buttons[mode].activeImgLocation);}
                
-switch(this.mode){case"zoombox":this.map.div.style.cursor="crosshair";break;default:t \
his.map.div.style.cursor="";break;}}},leaveMode:function(){this.switchModeTo("pan");}, \
defaultMouseMove:function(evt){if(this.mouseDragStart!=null){switch(this.mode){case"zoombox":var \
deltaX=Math.abs(this.mouseDragStart.x-evt.xy.x);var \
deltaY=Math.abs(this.mouseDragStart.y-evt.xy.y);this.zoomBox.style.width=Math.max(1,de \
ltaX)+"px";this.zoomBox.style.height=Math.max(1,deltaY)+"px";if(evt.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=evt.xy.x+"px";}
                
-if(evt.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=evt.xy.y+"px";}
-break;default:var deltaX=this.mouseDragStart.x-evt.xy.x;var \
deltaY=this.mouseDragStart.y-evt.xy.y;var size=this.map.getSize();var newXY=new \
OpenLayers.Pixel(size.w/2+deltaX,size.h/2+deltaY);var \
newCenter=this.map.getLonLatFromViewPortPx(newXY);this.map.setCenter(newCenter,null,true);this.mouseDragStart=evt.xy.clone();}
                
-this.performedDrag=true;}},defaultMouseUp:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
                
-switch(this.mode){case"zoombox":this.zoomBoxEnd(evt);if(this.startViaKeyboard){this.leaveMode();}
                
-break;case"pan":if(this.performedDrag){this.map.setCenter(this.map.center);}}
-document.onselectstart=null;this.mouseDragStart=null;this.map.div.style.cursor="defau \
lt";},defaultMouseOut:function(evt){if(this.mouseDragStart!=null&&OpenLayers.Util.mous \
eLeft(evt,this.map.div)){if(this.zoomBox){this.removeZoomBox();if(this.startViaKeyboard){this.leaveMode();}}
                
-this.mouseDragStart=null;this.map.div.style.cursor="default";}},defaultClick:function(evt){if(this.performedDrag){this.performedDragúlse;return \
false;}},CLASS_NAME:"OpenLayers.Control.MouseToolbar"});OpenLayers.Control.MouseToolba \
r.X=6;OpenLayers.Control.MouseToolbar.Y00;OpenLayers.Control.PanZoomBar=OpenLayers.Cla \
ss(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEv \
ents:null,zoomBarDiv:null,divEvents:null,zoomWorldIcon:false,initialize:function(){Ope \
nLayers.Control.PanZoom.prototype.initialize.apply(this,arguments);},destroy:function( \
){this.div.removeChild(this.slider);this.slider=null;this.sliderEvents.destroy();this. \
sliderEvents=null;this.div.removeChild(this.zoombarDiv);this.zoomBarDiv=null;this.divE \
vents.destroy();this.divEvents=null;this.map.events.un({"zoomend":this.moveZoomBar,"ch \
angebaselayer":this.redraw,scope:this});OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments);},setMap:function(map){OpenLayers.Control.PanZ
  oom.prototype.setMap.apply(this,arguments);this.map.events.register("changebaselayer \
                ",this,this.redraw);},redraw:function(){if(this.div!=null){this.div.innerHTML="";}
                
-this.draw();},draw:function(px){OpenLayers.Control.prototype.draw.apply(this,arguments);px=this.position.clone();this.buttons=[];var \
sz=new OpenLayers.Size(18,18);var centered=new OpenLayers.Pixel(px.x+sz.w/2,px.y);var \
                wposition=sz.w;if(this.zoomWorldIcon){centered=new \
                OpenLayers.Pixel(px.x+sz.w,px.y);}
-this._addButton("panup","north-mini.png",centered,sz);px.yÎntered.y+sz.h;this._addBut \
ton("panleft","west-mini.png",px,sz);if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",px.add(sz.w,0),sz);wposition*=2;}
                
-this._addButton("panright","east-mini.png",px.add(wposition,0),sz);this._addButton("p \
andown","south-mini.png",centered.add(0,sz.h*2),sz);this._addButton("zoomin","zoom-plu \
s-mini.png",centered.add(0,sz.h*3+5),sz);centered=this._addZoomBar(centered.add(0,sz.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",centered,sz);return \
this.div;},_addZoomBar:function(centered){var \
imgLocation=OpenLayers.Util.getImagesLocation();var \
id="OpenLayers_Control_PanZoomBar_Slider"+this.map.id;var \
zoomsToEnd=this.map.getNumZoomLevels()-1-this.map.getZoom();var \
slider=OpenLayers.Util.createAlphaImageDiv(id,centered.add(-1,zoomsToEnd*this.zoomStopHeight),new \
OpenLayers.Size(20,9),imgLocation+"slider.png","absolute");this.slider=slider;this.sliderEvents=new \
OpenLayers.Events(this,slider,null,true);this.sliderEvents.on({"mousedown":this.zoomBa \
rDown,"mousemove":this.zoomBarDrag,"mouseup":this.zoomBarUp,"dblclick":this.doubleClick,"click":this.doubleClick});var \
                sz=new OpenLayers.Size();sz.h=this
 .zoomStopHeight*this.map.getNumZoomLevels();sz.w=this.zoomStopWidth;var \
div=null;if(OpenLayers.Util.alphaHack()){var \
id="OpenLayers_Control_PanZoomBar"+this.map.id;div=OpenLayers.Util.createAlphaImageDiv(id,centered,new \
OpenLayers.Size(sz.w,this.zoomStopHeight),imgLocation+"zoombar.png","absolute",null,"c \
rop");div.style.height=sz.h;}else{div=OpenLayers.Util.createDiv('OpenLayers_Control_PanZoomBar_Zoombar'+this.map.id,centered,sz,imgLocation+"zoombar.png");}
                
-this.zoombarDiv=div;this.divEvents=new \
OpenLayers.Events(this,div,null,true);this.divEvents.on({"mousedown":this.divClick,"mo \
usemove":this.passEventToSlider,"dblclick":this.doubleClick,"click":this.doubleClick}) \
;this.div.appendChild(div);this.startTop=parseInt(div.style.top);this.div.appendChild( \
slider);this.map.events.register("zoomend",this,this.moveZoomBar);centeredÎntered.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());return \
centered;},passEventToSlider:function(evt){this.sliderEvents.handleBrowserEvent(evt);},divClick:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
                
-var y=evt.xy.y;var top=OpenLayers.Util.pagePosition(evt.object)[1];var \
levels=(y-top)/this.zoomStopHeight;if(!this.map.fractionalZoom){levels=Math.floor(levels);}
                
-var zoom=(this.map.getNumZoomLevels()-1)-levels;zoom=Math.min(Math.max(zoom,0),this.m \
ap.getNumZoomLevels()-1);this.map.zoomTo(zoom);OpenLayers.Event.stop(evt);},zoomBarDown:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
                
-this.map.events.on({"mousemove":this.passEventToSlider,"mouseup":this.passEventToSlid \
er,scope:this});this.mouseDragStart=evt.xy.clone();this.zoomStart=evt.xy.clone();this. \
div.style.cursor="move";this.zoombarDiv.offsets=null;OpenLayers.Event.stop(evt);},zoomBarDrag:function(evt){if(this.mouseDragStart!=null){var \
deltaY=this.mouseDragStart.y-evt.xy.y;var \
offsets=OpenLayers.Util.pagePosition(this.zoombarDiv);if((evt.clientY-offsets[1])>0&&(evt.clientY-offsets[1])<parseInt(this.zoombarDiv.style.height)-2){var \
                newTop=parseInt(this.slider.style.top)-deltaY;this.slider.style.top=newTop+"px";}
                
-this.mouseDragStart=evt.xy.clone();OpenLayers.Event.stop(evt);}},zoomBarUp:function(evt){if(!OpenLayers.Event.isLeftClick(evt)){return;}
                
-if(this.zoomStart){this.div.style.cursor="";this.map.events.un({"mouseup":this.passEventToSlider,"mousemove":this.passEventToSlider,scope:this});var \
deltaY=this.zoomStart.y-evt.xy.y;var \
zoomLevel=this.map.zoom;if(this.map.fractionalZoom){zoomLevel+ÞltaY/this.zoomStopHeigh \
t;zoomLevel=Math.min(Math.max(zoomLevel,0),this.map.getNumZoomLevels()-1);}else{zoomLevel+=Math.round(deltaY/this.zoomStopHeight);}
                
-this.map.zoomTo(zoomLevel);this.moveZoomBar();this.mouseDragStart=null;OpenLayers.Event.stop(evt);}},moveZoomBar:function(){var \
newTop=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.s \
tartTop+1;this.slider.style.top=newTop+"px";},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:" \
",space:" ",newline:"\n",level:0,pretty:false,initialize:function(options){OpenLayers. \
Format.prototype.initialize.apply(this,[options]);},read:function(json,filter){try{if( \
/^[\],:{}\s]*$/.test(json.replace(/\\["\\\/bfnrtu]/g,'@').replace(/"[^"\\\n\r]*"|true| \
false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){var \
object=eval('('+json+')');if(typeof filter==='function'){function \
walk(k,v){if(v&&typeof v==='object'){for(var i in \
                v){if(v.hasOwnProperty(i)){v[i]=walk(i,v[i]);}}}
-return filter(k,v);}
-object=walk('',object);}
-return object;}}catch(e){}
-return null;},write:function(value,pretty){this.pretty=!!pretty;var json=null;var \
type=typeof value;if(this.serialize[type]){json=this.serialize[type].apply(this,[value]);}
                
-return json;},writeIndent:function(){var pieces=[];if(this.pretty){for(var \
                i=0;i<this.level;++i){pieces.push(this.indent);}}
-return pieces.join('');},writeNewline:function(){return(this.pretty)?this.newline:''; \
},writeSpace:function(){return(this.pretty)?this.space:'';},serialize:{'object':function(object){if(object==null){return"null";}
                
-if(object.constructor=Úte){return this.serialize.date.apply(this,[object]);}
-if(object.constructor==Array){return this.serialize.array.apply(this,[object]);}
-var pieces=['{'];this.level+=1;var key,keyJSON,valueJSON;var addCommaúlse;for(key in \
object){if(object.hasOwnProperty(key)){keyJSON=OpenLayers.Format.JSON.prototype.write. \
apply(this,[key,this.pretty]);valueJSON=OpenLayers.Format.JSON.prototype.write.apply(t \
his,[object[key],this.pretty]);if(keyJSON!=null&&valueJSON!=null){if(addComma){pieces.push(',');}
                
-pieces.push(this.writeNewline(),this.writeIndent(),keyJSON,':',this.writeSpace(),valueJSON);addComma=true;}}}
                
-this.level-=1;pieces.push(this.writeNewline(),this.writeIndent(),'}');return \
pieces.join('');},'array':function(array){var json;var \
pieces=['['];this.level+=1;for(var \
i=0;i<array.length;++i){json=OpenLayers.Format.JSON.prototype.write.apply(this,[array[i],this.pretty]);if(json!=null){if(i>0){pieces.push(',');}
                
-pieces.push(this.writeNewline(),this.writeIndent(),json);}}
-this.level-=1;pieces.push(this.writeNewline(),this.writeIndent(),']');return \
pieces.join('');},'string':function(string){var \
m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};if(/[ \
"\\\x00-\x1f]/.test(string)){return'"'+string.replace(/([\x00-\x1f\\"])/g,function(a,b){var \
                c=m[b];if(c){return c;}
-c=b.charCodeAt();return'\\u00'+
-Math.floor(c/16).toString(16)+
-(c%16).toString(16);})+'"';}
-return'"'+string+'"';},'number':function(number){return \
isFinite(number)?String(number):"null";},'boolean':function(bool){return \
String(bool);},'date':function(date){function \
                format(number){return(number<10)?'0'+number:number;}
-return'"'+date.getFullYear()+'-'+
-format(date.getMonth()+1)+'-'+
-format(date.getDate())+'T'+
-format(date.getHours())+':'+
-format(date.getMinutes())+':'+
-format(date.getSeconds())+'"';}},CLASS_NAME:"OpenLayers.Format.JSON"});OpenLayers.For \
mat.XML=OpenLayers.Class(OpenLayers.Format,{xmldom:null,initialize:function(options){if(window.ActiveXObject){this.xmldom=new \
                ActiveXObject("Microsoft.XMLDOM");}
-OpenLayers.Format.prototype.initialize.apply(this,[options]);},read:function(text){var \
                index=text.indexOf('<');if(index>0){text=text.substring(index);}
-var node=OpenLayers.Util.Try(OpenLayers.Function.bind((function(){var \
xmldom;if(window.ActiveXObject&&!this.xmldom){xmldom=new \
                ActiveXObject("Microsoft.XMLDOM");}else{xmldom=this.xmldom;}
-xmldom.loadXML(text);return xmldom;}),this),function(){return new \
DOMParser().parseFromString(text,'text/xml');},function(){var req=new \
XMLHttpRequest();req.open("GET","data:"+"text/xml"+";charset=utf-8,"+encodeURIComponent(text),false);if(req.overrideMimeType){req.overrideMimeType("text/xml");}
                
-req.send(null);return req.responseXML;});return node;},write:function(node){var \
data;if(this.xmldom){data=node.xml;}else{var serializer=new \
XMLSerializer();if(node.nodeType==1){var \
doc=document.implementation.createDocument("","",null);if(doc.importNode){node=doc.importNode(node,true);}
                
-doc.appendChild(node);data=serializer.serializeToString(doc);}else{data=serializer.serializeToString(node);}}
                
-return data;},createElementNS:function(uri,name){var \
element;if(this.xmldom){if(typeof \
uri=="string"){element=this.xmldom.createNode(1,name,uri);}else{element=this.xmldom.createNode(1,name,"");}}else{element=document.createElementNS(uri,name);}
                
-return element;},createTextNode:function(text){var \
node;if(this.xmldom){node=this.xmldom.createTextNode(text);}else{node=document.createTextNode(text);}
                
-return node;},getElementsByTagNameNS:function(node,uri,name){var \
elements=[];if(node.getElementsByTagNameNS){elements=node.getElementsByTagNameNS(uri,name);}else{var \
allNodes=node.getElementsByTagName("*");var potentialNode,fullName;for(var \
i=0;i<allNodes.length;++i){potentialNode=allNodes[i];fullName=(potentialNode.prefix)?( \
potentialNode.prefix+":"+name):name;if((name=="*")||(fullName==potentialNode.nodeName) \
                ){if((uri=="*")||(uri==potentialNode.namespaceURI)){elements.push(potentialNode);}}}}
                
-return elements;},getAttributeNodeNS:function(node,uri,name){var \
attributeNode=null;if(node.getAttributeNodeNS){attributeNode=node.getAttributeNodeNS(uri,name);}else{var \
attributes=node.attributes;var potentialNode,fullName;for(var \
i=0;i<attributes.length;++i){potentialNode=attributes[i];if(potentialNode.namespaceURI \
==uri){fullName=(potentialNode.prefix)?(potentialNode.prefix+":"+name):name;if(fullName==potentialNode.nodeName){attributeNode=potentialNode;break;}}}}
                
-return attributeNode;},getAttributeNS:function(node,uri,name){var \
attributeValue="";if(node.getAttributeNS){attributeValue=node.getAttributeNS(uri,name)||"";}else{var \
attributeNode=this.getAttributeNodeNS(node,uri,name);if(attributeNode){attributeValue=attributeNode.nodeValue;}}
                
-return attributeValue;},getChildValue:function(node,def){var \
                value;try{value=node.firstChild.nodeValue;}catch(e){value=(def!=undefined)?def:"";}
                
-return value;},concatChildValues:function(node,def){var value="";var \
child=node.firstChild;var \
                childValue;while(child){childValue=child.nodeValue;if(childValue){value+=childValue;}
                
-child=child.nextSibling;}
-if(value==""&&def!=undefined){valueÞf;}
-return value;},hasAttributeNS:function(node,uri,name){var \
foundúlse;if(node.hasAttributeNS){found=node.hasAttributeNS(uri,name);}else{found=!!this.getAttributeNodeNS(node,uri,name);}
                
-return found;},setAttributeNS:function(node,uri,name,value){if(node.setAttributeNS){node.setAttributeNS(uri,name,value);}else{if(this.xmldom){if(uri){var \
attribute=node.ownerDocument.createNode(2,name,uri);attribute.nodeValue=value;node.set \
AttributeNode(attribute);}else{node.setAttribute(name,value);}}else{throw"setAttributeNS \
not implemented";}}},CLASS_NAME:"OpenLayers.Format.XML"});OpenLayers.Handler=OpenLayer \
s.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:f \
unction(control,callbacks,options){OpenLayers.Util.extend(this,options);this.control=control;this.callbacksÊllbacks;if(control.map){this.setMap(control.map);}
                
-OpenLayers.Util.extend(this,options);this.id=OpenLayers.Util.createUniqueID(this.CLAS \
S_NAME+"_");},setMap:function(map){this.map=map;},checkModifiers:function(evt){if(this.keyMask==null){return \
                true;}
-var keyModifiers=(evt.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(evt.ctrlKey?OpenLayer \
s.Handler.MOD_CTRL:0)|(evt.altKey?OpenLayers.Handler.MOD_ALT:0);return(keyModifiers==this.keyMask);},activate:function(){if(this.active){return \
                false;}
-var events=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var \
i=0;i<events.length;i++){if(this[events[i]]){this.register(events[i],this[events[i]]);}}
                
-this.active=true;return true;},deactivate:function(){if(!this.active){return false;}
-var events=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var \
i=0;i<events.length;i++){if(this[events[i]]){this.unregister(events[i],this[events[i]]);}}
                
-this.activeúlse;return \
true;},callback:function(name,args){if(name&&this.callbacks[name]){this.callbacks[name \
].apply(this.control,args);}},register:function(name,method){this.map.events.registerP \
riority(name,this,method);this.map.events.registerPriority(name,this,this.setEvent);}, \
unregister:function(name,method){this.map.events.unregister(name,this,method);this.map \
.events.unregister(name,this,this.setEvent);},setEvent:function(evt){this.evt=evt;return \
true;},destroy:function(){this.deactivate();this.control=this.map=null;},CLASS_NAME:"O \
penLayers.Handler"});OpenLayers.Handler.MOD_NONE=0;OpenLayers.Handler.MOD_SHIFT=1;Open \
Layers.Handler.MOD_CTRL=2;OpenLayers.Handler.MOD_ALT=4;OpenLayers.Map=OpenLayers.Class \
({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Popup:750,Control:1000},EVENT_TYPES:["preadd \
layer","addlayer","removelayer","changelayer","movestart","move","moveend","zoomend"," \
popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove",
  "dragstart","drag","dragend","changebaselayer"],id:null,fractionalZoom:false,events: \
null,div:null,dragging:false,size:null,viewPortDiv:null,layerContainerOrigin:null,laye \
rContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,re \
solution:null,zoom:0,viewRequestID:0,tileSize:null,projection:"EPSG:4326",units:'degre \
es',resolutions:null,maxResolution:1.40625,minResolution:null,maxScale:null,minScale:n \
ull,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,di \
splayProjection:null,fallThrough:true,panTween:null,eventListeners:null,panMethod:Open \
Layers.Easing.Expo.easeOut,paddingForPopups:null,initialize:function(div,options){this.tileSize=new \
OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,OpenLayers.Map.TILE_HEIGHT);this.maxExtent=new \
OpenLayers.Bounds(-180,-90,180,90);this.paddingForPopups=new \
OpenLayers.Bounds(15,15,15,15);this.theme=OpenLayers._getScriptLocation()+'theme/default/style.css';OpenLayers.Util.extend(this,options);th
  is.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");this.div=OpenLayers.Util.getElement(div);var \
id=this.div.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(id,nu \
ll,null,null,"relative",null,"hidden");this.viewPortDiv.style.width="100%";this.viewPo \
rtDiv.style.height="100%";this.viewPortDiv.className="olMapViewport";this.div.appendCh \
ild(this.viewPortDiv);id=this.div.id+"_OpenLayers_Container";this.layerContainerDiv=Op \
enLayers.Util.createDiv(id);this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE['Popup']-1;this.viewPortDiv.appendChild(this.layerContainerDiv);this.events=new \
OpenLayers.Events(this,this.div,this.EVENT_TYPES,this.fallThrough);this.updateSize();if(this.eventListeners \
                instanceof Object){this.events.on(this.eventListeners);}
-this.events.register("movestart",this,this.updateSize);if(OpenLayers.String.contains( \
navigator.appName,"Microsoft")){this.events.register("resize",this,this.updateSize);}e \
lse{this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this);OpenLayers.Event.observe(window,'resize',this.updateSizeDestroy);}
                
-if(this.theme){var addNode=true;var \
nodes=document.getElementsByTagName('link');for(var \
i=0;i<nodes.length;++i){if(OpenLayers.Util.isEquivalentUrl(nodes.item(i).href,this.theme)){addNodeúlse;break;}}
                
-if(addNode){var cssNode=document.createElement('link');cssNode.setAttribute('rel','st \
ylesheet');cssNode.setAttribute('type','text/css');cssNode.setAttribute('href',this.theme);document.getElementsByTagName('head')[0].appendChild(cssNode);}}
                
-this.layers=[];if(this.controls==null){if(OpenLayers.Control!=null){this.controls=[new \
OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoom(),new \
OpenLayers.Control.ArgParser(),new \
                OpenLayers.Control.Attribution()];}else{this.controls=[];}}
-for(var i=0;i<this.controls.length;i++){this.addControlToMap(this.controls[i]);}
-this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLay \
ers.Event.observe(window,'unload',this.unloadDestroy);},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy){return \
                false;}
-OpenLayers.Event.stopObserving(window,'unload',this.unloadDestroy);this.unloadDestroy \
=null;if(this.updateSizeDestroy){OpenLayers.Event.stopObserving(window,'resize',this.updateSizeDestroy);}else{this.events.unregister("resize",this,this.updateSize);}
                
-this.paddingForPopups=null;if(this.controls!=null){for(var \
                i=this.controls.length-1;i>=0;--i){this.controls[i].destroy();}
-this.controls=null;}
-if(this.layers!=null){for(var \
                i=this.layers.length-1;i>=0;--i){this.layers[i].destroy(false);}
-this.layers=null;}
-if(this.viewPortDiv){this.div.removeChild(this.viewPortDiv);}
-this.viewPortDiv=null;if(this.eventListeners){this.events.un(this.eventListeners);this.eventListeners=null;}
                
-this.events.destroy();this.events=null;},setOptions:function(options){OpenLayers.Util.extend(this,options);},getTileSize:function(){return \
this.tileSize;},getBy:function(array,property,match){var test=(typeof \
match.test=="function");var \
found=OpenLayers.Array.filter(this[array],function(item){return \
item[property]==match||(test&&match.test(item[property]));});return \
found;},getLayersBy:function(property,match){return \
this.getBy("layers",property,match);},getLayersByName:function(match){return \
this.getLayersBy("name",match);},getLayersByClass:function(match){return \
this.getLayersBy("CLASS_NAME",match);},getControlsBy:function(property,match){return \
this.getBy("controls",property,match);},getControlsByClass:function(match){return \
this.getControlsBy("CLASS_NAME",match);},getLayer:function(id){var \
foundLayer=null;for(var i=0;i<this.layers.length;i++){var \
                layer=this.layers[i];if(layer.id==id){foundLayer=layer;break;}}
-return foundLayer;},setLayerZIndex:function(layer,zIdx){layer.setZIndex(this.Z_INDEX_BASE[layer.isBaseLayer?'BaseLayer':'Overlay']
                
-+zIdx*5);},resetLayersZIndex:function(){for(var i=0;i<this.layers.length;i++){var \
layer=this.layers[i];this.setLayerZIndex(layer,i);}},addLayer:function(layer){for(var \
i=0;i<this.layers.length;i++){if(this.layers[i]==layer){var \
msg=OpenLayers.i18n('layerAlreadyAdded',{'layerName':layer.name});OpenLayers.Console.warn(msg);return \
                false;}}
-this.events.triggerEvent("preaddlayer",{layer:layer});layer.div.className="olLayerDiv \
";layer.div.style.overflow="";this.setLayerZIndex(layer,this.layers.length);if(layer.i \
sFixed){this.viewPortDiv.appendChild(layer.div);}else{this.layerContainerDiv.appendChild(layer.div);}
                
-this.layers.push(layer);layer.setMap(this);if(layer.isBaseLayer){if(this.baseLayer==n \
ull){this.setBaseLayer(layer);}else{layer.setVisibility(false);}}else{layer.redraw();}
                
-this.events.triggerEvent("addlayer",{layer:layer});},addLayers:function(layers){for(var \
i=0;i<layers.length;i++){this.addLayer(layers[i]);}},removeLayer:function(layer,setNewBaseLayer){if(setNewBaseLayer==null){setNewBaseLayer=true;}
                
-if(layer.isFixed){this.viewPortDiv.removeChild(layer.div);}else{this.layerContainerDiv.removeChild(layer.div);}
                
-OpenLayers.Util.removeItem(this.layers,layer);layer.removeMap(this);layer.map=null;if(this.baseLayer==layer){this.baseLayer=null;if(setNewBaseLayer){for(var \
i=0;i<this.layers.length;i++){var \
                iLayer=this.layers[i];if(iLayer.isBaseLayer){this.setBaseLayer(iLayer);break;}}}}
                
-this.resetLayersZIndex();this.events.triggerEvent("removelayer",{layer:layer});},getNumLayers:function(){return \
this.layers.length;},getLayerIndex:function(layer){return \
OpenLayers.Util.indexOf(this.layers,layer);},setLayerIndex:function(layer,idx){var \
base=this.getLayerIndex(layer);if(idx<0){idx=0;}else \
                if(idx>this.layers.length){idx=this.layers.length;}
-if(base!=idx){this.layers.splice(base,1);this.layers.splice(idx,0,layer);for(var \
                i=0;i<this.layers.length;i++){this.setLayerZIndex(this.layers[i],i);}
-this.events.triggerEvent("changelayer",{layer:layer,property:"order"});}},raiseLayer:function(layer,delta){var \
idx=this.getLayerIndex(layer)+delta;this.setLayerIndex(layer,idx);},setBaseLayer:function(newBaseLayer){var \
                oldExtent=null;if(this.baseLayer){oldExtent=this.baseLayer.getExtent();}
                
-if(newBaseLayer!=this.baseLayer){if(OpenLayers.Util.indexOf(this.layers,newBaseLayer)!=-1){if(this.baseLayer!=null){this.baseLayer.setVisibility(false);}
                
-this.baseLayer=newBaseLayer;this.viewRequestID++;this.baseLayer.visibility=true;var \
center=this.getCenter();if(center!=null){var \
newCenter=(oldExtent)?oldExtent.getCenterLonLat():center;var \
newZoom=(oldExtent)?this.getZoomForExtent(oldExtent,true):this.getZoomForResolution(this.resolution,true);this.setCenter(newCenter,newZoom,false,true);}
                
-this.events.triggerEvent("changebaselayer",{layer:this.baseLayer});}}},addControl:fun \
ction(control,px){this.controls.push(control);this.addControlToMap(control,px);},addCo \
ntrolToMap:function(control,px){control.outsideViewport=(control.div!=null);if(this.di \
splayProjection&&!control.displayProjection){control.displayProjection=this.displayProjection;}
                
-control.setMap(this);var \
div=control.draw(px);if(div){if(!control.outsideViewport){div.style.zIndex=this.Z_INDEX_BASE['Control']+
                
-this.controls.length;this.viewPortDiv.appendChild(div);}}},getControl:function(id){var \
returnControl=null;for(var i=0;i<this.controls.length;i++){var \
                control=this.controls[i];if(control.id==id){returnControl=control;break;}}
                
-return returnControl;},removeControl:function(control){if((control)&&(control==this.g \
etControl(control.id))){if(control.div&&(control.div.parentNode==this.viewPortDiv)){this.viewPortDiv.removeChild(control.div);}
                
-OpenLayers.Util.removeItem(this.controls,control);}},addPopup:function(popup,exclusive){if(exclusive){for(var \
                i=this.popups.length-1;i>=0;--i){this.removePopup(this.popups[i]);}}
-popup.map=this;this.popups.push(popup);var \
                popupDiv=popup.draw();if(popupDiv){popupDiv.style.zIndex=this.Z_INDEX_BASE['Popup']+
                
-this.popups.length;this.layerContainerDiv.appendChild(popupDiv);}},removePopup:functi \
on(popup){OpenLayers.Util.removeItem(this.popups,popup);if(popup.div){try{this.layerContainerDiv.removeChild(popup.div);}
                
-catch(e){}}
-popup.map=null;},getSize:function(){var \
                size=null;if(this.size!=null){size=this.size.clone();}
-return size;},updateSize:function(){this.events.element.offsets=null;var \
newSize=this.getCurrentSize();var \
                oldSize=this.getSize();if(oldSize==null){this.size=oldSize=newSize;}
-if(!newSize.equals(oldSize)){this.size=newSize;for(var \
                i=0;i<this.layers.length;i++){this.layers[i].onMapResize();}
-if(this.baseLayer!=null){var center=new \
OpenLayers.Pixel(newSize.w/2,newSize.h/2);var \
centerLL=this.getLonLatFromViewPortPx(center);var \
zoom=this.getZoom();this.zoom=null;this.setCenter(this.getCenter(),zoom);}}},getCurrentSize:function(){var \
size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){var \
                dim=OpenLayers.Element.getDimensions(this.div);size.w=dim.width;size.h=dim.height;}
                
-if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=parseInt(this.div.style.width);size.h=parseInt(this.div.style.height);}
                
-return size;},calculateBounds:function(center,resolution){var \
                extent=null;if(center==null){center=this.getCenter();}
-if(resolution==null){resolution=this.getResolution();}
-if((center!=null)&&(resolution!=null)){var size=this.getSize();var \
w_deg=size.w*resolution;var h_deg=size.h*resolution;extent=new \
OpenLayers.Bounds(center.lon-w_deg/2,center.lat-h_deg/2,center.lon+w_deg/2,center.lat+h_deg/2);}
                
-return extent;},getCenter:function(){return this.center;},getZoom:function(){return \
                this.zoom;},pan:function(dx,dy,options){if(!options){options={};}
-OpenLayers.Util.applyDefaults(options,{animate:true,dragging:false});var \
centerPx=this.getViewPortPxFromLonLat(this.getCenter());var \
newCenterPxÎnterPx.add(dx,dy);if(!options.dragging||!newCenterPx.equals(centerPx)){var \
newCenterLonLat=this.getLonLatFromViewPortPx(newCenterPx);if(options.animate){this.pan \
To(newCenterLonLat);}else{this.setCenter(newCenterLonLat,null,options.dragging);}}},pa \
nTo:function(lonlat){if(this.panMethod&&this.getExtent().containsLonLat(lonlat)){if(!this.panTween){this.panTween=new \
                OpenLayers.Tween(this.panMethod);}
-var center=this.getCenter();var from={lon:center.lon,lat:center.lat};var \
to={lon:lonlat.lon,lat:lonlat.lat};this.panTween.start(from,to,50,{callbacks:{start:Op \
enLayers.Function.bind(function(lonlat){this.events.triggerEvent("movestart");},this),eachStep:OpenLayers.Function.bind(function(lonlat){lonlat=new \
OpenLayers.LonLat(lonlat.lon,lonlat.lat);this.moveTo(lonlat,this.zoom,{'dragging':true \
,'noEvent':true});},this),done:OpenLayers.Function.bind(function(lonlat){lonlat=new \
OpenLayers.LonLat(lonlat.lon,lonlat.lat);this.moveTo(lonlat,this.zoom,{'noEvent':true} \
);this.events.triggerEvent("moveend");},this)}});}else{this.setCenter(lonlat);}},setCe \
nter:function(lonlat,zoom,dragging,forceZoomChange){this.moveTo(lonlat,zoom,{'dragging \
':dragging,'forceZoomChange':forceZoomChange,'caller':'setCenter'});},moveTo:function(lonlat,zoom,options){if(!options){options={};}
                
-var dragging=options.dragging;var forceZoomChange=options.forceZoomChange;var \
noEvent=options.noEvent;if(this.panTween&&options.caller=="setCenter"){this.panTween.stop();}
                
-if(!this.center&&!this.isValidLonLat(lonlat)){lonlat=this.maxExtent.getCenterLonLat();}
                
-if(this.restrictedExtent!=null){if(lonlat==null){lonlat=this.getCenter();}
-if(zoom==null){zoom=this.getZoom();}
-var resolution=this.getResolutionForZoom(zoom);var \
extent=this.calculateBounds(lonlat,resolution);if(!this.restrictedExtent.containsBounds(extent)){var \
maxCenter=this.restrictedExtent.getCenterLonLat();if(extent.getWidth()>this.restrictedExtent.getWidth()){lonlat=new \
OpenLayers.LonLat(maxCenter.lon,lonlat.lat);}else \
if(extent.left<this.restrictedExtent.left){lonlat=lonlat.add(this.restrictedExtent.left-
                
-extent.left,0);}else \
if(extent.right>this.restrictedExtent.right){lonlat=lonlat.add(this.restrictedExtent.right-
                
-extent.right,0);}
-if(extent.getHeight()>this.restrictedExtent.getHeight()){lonlat=new \
OpenLayers.LonLat(lonlat.lon,maxCenter.lat);}else \
if(extent.bottom<this.restrictedExtent.bottom){lonlat=lonlat.add(0,this.restrictedExtent.bottom-
                
-extent.bottom);}
-else if(extent.top>this.restrictedExtent.top){lonlat=lonlat.add(0,this.restrictedExtent.top-
                
-extent.top);}}}
-var zoomChanged=forceZoomChange||((this.isValidZoomLevel(zoom))&&(zoom!=this.getZoom()));var \
centerChanged=(this.isValidLonLat(lonlat))&&(!lonlat.equals(this.center));if(zoomChang \
ed||centerChanged||!dragging){if(!this.dragging&&!noEvent){this.events.triggerEvent("movestart");}
                
-if(centerChanged){if((!zoomChanged)&&(this.center)){this.centerLayerContainer(lonlat);}
                
-this.center=lonlat.clone();}
-if((zoomChanged)||(this.layerContainerOrigin==null)){this.layerContainerOrigin=this.c \
enter.clone();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px";}
                
-if(zoomChanged){this.zoom=zoom;this.resolution=this.getResolutionForZoom(zoom);this.viewRequestID++;}
                
-var bounds=this.getExtent();this.baseLayer.moveTo(bounds,zoomChanged,dragging);bounds=this.baseLayer.getExtent();for(var \
i=0;i<this.layers.length;i++){var layer=this.layers[i];if(!layer.isBaseLayer){var \
inRange=layer.calculateInRange();if(layer.inRange!=inRange){layer.inRange=inRange;if(!inRange){layer.display(false);}
                
-this.events.triggerEvent("changelayer",{layer:layer,property:"visibility"});}
-if(inRange&&layer.visibility){layer.moveTo(bounds,zoomChanged,dragging);}}}
-if(zoomChanged){for(var \
                i=0;i<this.popups.length;i++){this.popups[i].updatePosition();}}
-this.events.triggerEvent("move");if(zoomChanged){this.events.triggerEvent("zoomend");}}
                
-if(!dragging&&!noEvent){this.events.triggerEvent("moveend");}
-this.dragging=!!dragging;},centerLayerContainer:function(lonlat){var \
originPx=this.getViewPortPxFromLonLat(this.layerContainerOrigin);var \
newPx=this.getViewPortPxFromLonLat(lonlat);if((originPx!=null)&&(newPx!=null)){this.la \
yerContainerDiv.style.left=Math.round(originPx.x-newPx.x)+"px";this.layerContainerDiv. \
style.top=Math.round(originPx.y-newPx.y)+"px";}},isValidZoomLevel:function(zoomLevel){ \
return((zoomLevel!=null)&&(zoomLevel>=0)&&(zoomLevel<this.getNumZoomLevels()));},isValidLonLat:function(lonlat){var \
validúlse;if(lonlat!=null){var \
                maxExtent=this.getMaxExtent();valid=maxExtent.containsLonLat(lonlat);}
                
-return valid;},getProjection:function(){var \
projection=this.getProjectionObject();return \
projection?projection.getCode():null;},getProjectionObject:function(){var \
                projection=null;if(this.baseLayer!=null){projection=this.baseLayer.projection;}
                
-return projection;},getMaxResolution:function(){var \
maxResolution=null;if(this.baseLayer!=null){maxResolution=this.baseLayer.maxResolution;}
                
-return maxResolution;},getMaxExtent:function(){var \
                maxExtent=null;if(this.baseLayer!=null){maxExtent=this.baseLayer.maxExtent;}
                
-return maxExtent;},getNumZoomLevels:function(){var \
numZoomLevels=null;if(this.baseLayer!=null){numZoomLevels=this.baseLayer.numZoomLevels;}
                
-return numZoomLevels;},getExtent:function(){var \
                extent=null;if(this.baseLayer!=null){extent=this.baseLayer.getExtent();}
                
-return extent;},getResolution:function(){var \
                resolution=null;if(this.baseLayer!=null){resolution=this.baseLayer.getResolution();}
                
-return resolution;},getScale:function(){var scale=null;if(this.baseLayer!=null){var \
res=this.getResolution();var \
                units=this.baseLayer.units;scale=OpenLayers.Util.getScaleFromResolution(res,units);}
                
-return scale;},getZoomForExtent:function(bounds,closest){var \
zoom=null;if(this.baseLayer!=null){zoom=this.baseLayer.getZoomForExtent(bounds,closest);}
                
-return zoom;},getResolutionForZoom:function(zoom){var \
resolution=null;if(this.baseLayer){resolution=this.baseLayer.getResolutionForZoom(zoom);}
                
-return resolution;},getZoomForResolution:function(resolution,closest){var \
zoom=null;if(this.baseLayer!=null){zoom=this.baseLayer.getZoomForResolution(resolution,closest);}
                
-return zoom;},zoomTo:function(zoom){if(this.isValidZoomLevel(zoom)){this.setCenter(nu \
ll,zoom);}},zoomIn:function(){this.zoomTo(this.getZoom()+1);},zoomOut:function(){this.zoomTo(this.getZoom()-1);},zoomToExtent:function(bounds){var \
center=bounds.getCenterLonLat();if(this.baseLayer.wrapDateLine){var \
maxExtent=this.getMaxExtent();bounds=bounds.clone();while(bounds.right<bounds.left){bounds.right+=maxExtent.getWidth();}
                
-center=bounds.getCenterLonLat().wrapDateLine(maxExtent);}
-this.setCenter(center,this.getZoomForExtent(bounds));},zoomToMaxExtent:function(){this.zoomToExtent(this.getMaxExtent());},zoomToScale:function(scale){var \
res=OpenLayers.Util.getResolutionFromScale(scale,this.baseLayer.units);var \
size=this.getSize();var w_deg=size.w*res;var h_deg=size.h*res;var \
center=this.getCenter();var extent=new \
OpenLayers.Bounds(center.lon-w_deg/2,center.lat-h_deg/2,center.lon+w_deg/2,center.lat+ \
h_deg/2);this.zoomToExtent(extent);},getLonLatFromViewPortPx:function(viewPortPx){var \
lonlat=null;if(this.baseLayer!=null){lonlat=this.baseLayer.getLonLatFromViewPortPx(viewPortPx);}
                
-return lonlat;},getViewPortPxFromLonLat:function(lonlat){var \
                px=null;if(this.baseLayer!=null){px=this.baseLayer.getViewPortPxFromLonLat(lonlat);}
                
-return px;},getLonLatFromPixel:function(px){return \
this.getLonLatFromViewPortPx(px);},getPixelFromLonLat:function(lonlat){var \
px=this.getViewPortPxFromLonLat(lonlat);px.x=Math.round(px.x);px.y=Math.round(px.y);return \
px;},getViewPortPxFromLayerPx:function(layerPx){var \
viewPortPx=null;if(layerPx!=null){var \
dX=parseInt(this.layerContainerDiv.style.left);var \
                dY=parseInt(this.layerContainerDiv.style.top);viewPortPx=layerPx.add(dX,dY);}
                
-return viewPortPx;},getLayerPxFromViewPortPx:function(viewPortPx){var \
layerPx=null;if(viewPortPx!=null){var \
dX=-parseInt(this.layerContainerDiv.style.left);var \
dY=-parseInt(this.layerContainerDiv.style.top);layerPx=viewPortPx.add(dX,dY);if(isNaN(layerPx.x)||isNaN(layerPx.y)){layerPx=null;}}
                
-return layerPx;},getLonLatFromLayerPx:function(px){px=this.getViewPortPxFromLayerPx(px);return \
this.getLonLatFromViewPortPx(px);},getLayerPxFromLonLat:function(lonlat){var \
px=this.getPixelFromLonLat(lonlat);return \
this.getLayerPxFromViewPortPx(px);},CLASS_NAME:"OpenLayers.Map"});OpenLayers.Map.TILE_ \
WIDTH%6;OpenLayers.Map.TILE_HEIGHT%6;OpenLayers.Marker=OpenLayers.Class({icon:null,lon \
lat:null,events:null,map:null,initialize:function(lonlat,icon){this.lonlat=lonlat;var \
newIcon=(icon)?icon:OpenLayers.Marker.defaultIcon();if(this.icon==null){this.icon=newI \
con;}else{this.icon.url=newIcon.url;this.icon.size=newIcon.size;this.icon.offset=newIcon.offset;this.icon.calculateOffset=newIcon.calculateOffset;}
                
-this.events=new OpenLayers.Events(this,this.icon.imageDiv,null);},destroy:function(){ \
this.map=null;this.events.destroy();this.events=null;if(this.icon!=null){this.icon.destroy();this.icon=null;}},draw:function(px){return \
this.icon.draw(px);},moveTo:function(px){if((px!=null)&&(this.icon!=null)){this.icon.moveTo(px);}
                
-this.lonlat=this.map.getLonLatFromLayerPx(px);},onScreen:function(){var \
onScreenúlse;if(this.map){var \
                screenBounds=this.map.getExtent();onScreen=screenBounds.containsLonLat(this.lonlat);}
                
-return onScreen;},inflate:function(inflate){if(this.icon){var newSize=new \
OpenLayers.Size(this.icon.size.w*inflate,this.icon.size.h*inflate);this.icon.setSize(n \
ewSize);}},setOpacity:function(opacity){this.icon.setOpacity(opacity);},setUrl:functio \
n(url){this.icon.setUrl(url);},display:function(display){this.icon.display(display);},CLASS_NAME:"OpenLayers.Marker"});OpenLayers.Marker.defaultIcon=function(){var \
url=OpenLayers.Util.getImagesLocation()+"marker.png";var size=new \
OpenLayers.Size(21,25);var calculateOffset=function(size){return new \
OpenLayers.Pixel(-(size.w/2),-size.h);};return new \
OpenLayers.Icon(url,size,null,calculateOffset);};OpenLayers.Popup.AnchoredBubble=OpenL \
ayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(id,lonlat,size,contentHTML,anchor,closeBox,closeBoxCallback){this.padding=new \
OpenLayers.Bounds(0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE,0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);OpenLayers.Popup.Anchored.prototype.initializ
  e.apply(this,arguments);},draw:function(px){OpenLayers.Popup.Anchored.prototype.draw \
.apply(this,arguments);this.setContentHTML();this.setBackgroundColor();this.setOpacity();return \
this.div;},updateRelativePosition:function(){this.setRicoCorners();},setSize:function( \
size){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.setRicoCo \
rners();},setBackgroundColor:function(color){if(color!=undefined){this.backgroundColor=color;}
                
-if(this.div!=null){if(this.contentDiv!=null){this.div.style.background="transparent"; \
OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor);}}},setOpacity: \
function(opacity){OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,opacity);if \
(this.div!=null){if(this.groupDiv!=null){OpenLayers.Rico.Corner.changeOpacity(this.gro \
upDiv,this.opacity);}}},setBorder:function(border){this.border=0;},setRicoCorners:function(){var \
corners=this.getCornersToRound(this.relativePosition);var \
options={corners:corners,color:this.backgroundColor,bgColor:"transparent",blend:false} \
;if(!this.rounded){OpenLayers.Rico.Corner.round(this.div,options);this.rounded=true;}e \
lse{OpenLayers.Rico.Corner.reRound(this.groupDiv,options);this.setBackgroundColor();this.setOpacity();}},getCornersToRound:function(){var \
corners=['tl','tr','bl','br'];var \
corner=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);OpenLayers.Util.removeItem(corners,corner);return \
corners.join(" ");},CLASS_NAME:"  \
OpenLayers.Popup.AnchoredBubble"});OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenL \
ayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize \
:null,isAlphaImage:false,positionBlocks:null,blocks:null,fixedRelativePosition:false,i \
nitialize:function(id,lonlat,size,contentHTML,anchor,closeBox,closeBoxCallback){OpenLa \
yers.Popup.Anchored.prototype.initialize.apply(this,arguments);if(this.fixedRelativePo \
sition){this.updateRelativePosition();this.calculateRelativePosition=function(px){return \
                this.relativePosition;};}
-this.contentDiv.style.position="absolute";this.contentDiv.style.zIndex=1;if(closeBox){this.closeDiv.style.zIndex=1;}
                
-this.groupDiv.style.position="absolute";this.groupDiv.style.top="0px";this.groupDiv.s \
tyle.left="0px";this.groupDiv.style.height="100%";this.groupDiv.style.width="100%";},d \
estroy:function(){this.imageSrc=null;this.imageSize=null;this.isAlphaImage=null;this.fixedRelativePositionúlse;this.positionBlocks=null;for(var \
i=0;i<this.blocks.length;i++){var \
                block=this.blocks[i];if(block.image){block.div.removeChild(block.image);}
                
-block.image=null;if(block.div){this.groupDiv.removeChild(block.div);}
-block.div=null;}
-this.blocks=null;OpenLayers.Popup.Anchored.prototype.destroy.apply(this,arguments);}, \
setBackgroundColor:function(color){},setBorder:function(){},setOpacity:function(opacit \
y){},setSize:function(size){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arg \
uments);this.updateBlocks();},updateRelativePosition:function(){this.padding=this.positionBlocks[this.relativePosition].padding;if(this.closeDiv){var \
contentDivPadding=this.getContentDivPadding();this.closeDiv.style.right=contentDivPadding.right+
                
-this.padding.right+"px";this.closeDiv.style.top=contentDivPadding.top+
-this.padding.top+"px";}
-this.updateBlocks();},calculateNewPx:function(px){var \
newPx=OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);newPx=newPx.offset(this.positionBlocks[this.relativePosition].offset);return \
newPx;},createBlocks:function(){this.blocks=[];var firstPosition=null;for(var key in \
                this.positionBlocks){firstPosition=key;break;}
-var position=this.positionBlocks[firstPosition];for(var \
i=0;i<position.blocks.length;i++){var block={};this.blocks.push(block);var \
divId=this.id+'_FrameDecorationDiv_'+i;block.div=OpenLayers.Util.createDiv(divId,null,null,null,"absolute",null,"hidden",null);var \
imgId=this.id+'_FrameDecorationImg_'+i;var \
imageCreator=(this.isAlphaImage)?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.c \
reateImage;block.image=imageCreator(imgId,null,this.imageSize,this.imageSrc,"absolute" \
,null,null,null);block.div.appendChild(block.image);this.groupDiv.appendChild(block.div);}},updateBlocks:function(){if(!this.blocks){this.createBlocks();}
                
-if(this.relativePosition){var \
position=this.positionBlocks[this.relativePosition];for(var \
i=0;i<position.blocks.length;i++){var positionBlock=position.blocks[i];var \
block=this.blocks[i];var l=positionBlock.anchor.left;var \
b=positionBlock.anchor.bottom;var r=positionBlock.anchor.right;var \
t=positionBlock.anchor.top;var \
w=(isNaN(positionBlock.size.w))?this.size.w-(r+l):positionBlock.size.w;var \
h=(isNaN(positionBlock.size.h))?this.size.h-(b+t):positionBlock.size.h;block.div.style \
.width=w+'px';block.div.style.height=h+'px';block.div.style.left=(l!=null)?l+'px':'';b \
lock.div.style.bottom=(b!=null)?b+'px':'';block.div.style.right=(r!=null)?r+'px':'';bl \
ock.div.style.top=(t!=null)?t+'px':'';block.image.style.left=positionBlock.position.x+'px';block.image.style.top=positionBlock.position.y+'px';}
                
-this.contentDiv.style.left=this.padding.left+"px";this.contentDiv.style.top=this.padd \
ing.top+"px";}},CLASS_NAME:"OpenLayers.Popup.Framed"});OpenLayers.Renderer.SVG=OpenLay \
ers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",MAX_PIXEL:1 \
5000,localResolution:null,initialize:function(containerID){if(!this.supported()){return;}
                
-OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);},destroy:fun \
ction(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments);},supported:function(){var \
svgFeature="http://www.w3.org/TR/SVG11/feature#";return(document.implementation&&(docu \
ment.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeatur \
e(svgFeature+"SVG","1.1")||document.implementation.hasFeature(svgFeature+"BasicStructu \
re","1.1")));},inValidRange:function(x,y){return(x>=-this.MAX_PIXEL&&x<=this.MAX_PIXEL \
&&y>=-this.MAX_PIXEL&&y<=this.MAX_PIXEL);},setExtent:function(extent){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var \
resolution=this.getResolution();if(!this.localResolution||resolution!=this.localResolution){this.left=-extent.left/resolution;this.top=extent.top/resolution;}
                
-var left=0;var top=0;if(this.localResolution&&resolution==this.localResolution){left=(this.left)-(-extent.left/resolution);top=(this.top)-(extent.top/resolution);}
                
-this.localResolution=resolution;var extentString=left+" "+top+" "+
-extent.getWidth()/resolution+" \
"+extent.getHeight()/resolution;this.rendererRoot.setAttributeNS(null,"viewBox",extent \
String);},setSize:function(size){OpenLayers.Renderer.prototype.setSize.apply(this,argu \
ments);this.rendererRoot.setAttributeNS(null,"width",this.size.w);this.rendererRoot.se \
tAttributeNS(null,"height",this.size.h);},getNodeType:function(geometry,style){var \
nodeType=null;switch(geometry.CLASS_NAME){case"OpenLayers.Geometry.Point":nodeType=sty \
le.externalGraphic?"image":"circle";break;case"OpenLayers.Geometry.Rectangle":nodeType \
="rect";break;case"OpenLayers.Geometry.LineString":nodeType="polyline";break;case"Open \
Layers.Geometry.LinearRing":nodeType="polygon";break;case"OpenLayers.Geometry.Polygon" \
:case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":nodeType="path";break;default:break;}
                
-return nodeType;},setStyle:function(node,style,options){style=style||node._style;options=options||node._options;var \
r=parseFloat(node.getAttributeNS(null,"r"));if(node._geometryClass=="OpenLayers.Geometry.Point"&&r){if(style.externalGraphic){var \
x=parseFloat(node.getAttributeNS(null,"cx"));var \
y=parseFloat(node.getAttributeNS(null,"cy"));if(style.graphicWidth&&style.graphicHeight){node.setAttributeNS(null,"preserveAspectRatio","none");}
                
-var width=style.graphicWidth||style.graphicHeight;var \
height=style.graphicHeight||style.graphicWidth;width=width?width:style.pointRadius*2;height=height?height:style.pointRadius*2;var \
xOffset=(style.graphicXOffset!=undefined)?style.graphicXOffset:-(0.5*width);var \
yOffset=(style.graphicYOffset!=undefined)?style.graphicYOffset:-(0.5*height);var \
opacity=style.graphicOpacity||style.fillOpacity;node.setAttributeNS(null,"x",(x+xOffse \
t).toFixed());node.setAttributeNS(null,"y",(y+yOffset).toFixed());node.setAttributeNS( \
null,"width",width);node.setAttributeNS(null,"height",height);node.setAttributeNS("htt \
p://www.w3.org/1999/xlink","href",style.externalGraphic);node.setAttributeNS(null,"style","opacity: \
                "+opacity);}else{node.setAttributeNS(null,"r",style.pointRadius);}}
-if(options.isFilled){node.setAttributeNS(null,"fill",style.fillColor);node.setAttribu \
teNS(null,"fill-opacity",style.fillOpacity);}else{node.setAttributeNS(null,"fill","none");}
                
-if(options.isStroked){node.setAttributeNS(null,"stroke",style.strokeColor);node.setAt \
tributeNS(null,"stroke-opacity",style.strokeOpacity);node.setAttributeNS(null,"stroke- \
width",style.strokeWidth);node.setAttributeNS(null,"stroke-linecap",style.strokeLinecap);}else{node.setAttributeNS(null,"stroke","none");}
                
-if(style.pointerEvents){node.setAttributeNS(null,"pointer-events",style.pointerEvents);}
                
-if(style.cursor!=null){node.setAttributeNS(null,"cursor",style.cursor);}
-return node;},createNode:function(type,id){var \
node=document.createElementNS(this.xmlns,type);if(id){node.setAttributeNS(null,"id",id);}
                
-return node;},nodeTypeCompare:function(node,type){return(type==node.nodeName);},createRenderRoot:function(){return \
this.nodeFactory(this.container.id+"_svgRoot","svg");},createRoot:function(){return \
this.nodeFactory(this.container.id+"_root","g");},drawPoint:function(node,geometry){this.drawCircle(node,geometry,1);},drawCircle:function(node,geometry,radius){var \
resolution=this.getResolution();var x=(geometry.x/resolution+this.left);var \
y=(this.top-geometry.y/resolution);if(this.inValidRange(x,y)){node.setAttributeNS(null \
,"cx",x);node.setAttributeNS(null,"cy",y);node.setAttributeNS(null,"r",radius);}else{n \
ode.setAttributeNS(null,"cx","");node.setAttributeNS(null,"cy","");node.setAttributeNS \
(null,"r",0);}},drawLineString:function(node,geometry){node.setAttributeNS(null,"point \
s",this.getComponentsString(geometry.components));},drawLinearRing:function(node,geome \
try){node.setAttributeNS(null,"points",this.getComponentsString(geometry.components));},drawPolygon:function(node,geome
  try){var d="";var draw=true;for(var j=0;j<geometry.components.length;j++){var \
linearRing=geometry.components[j];d+=" M";for(var \
i=0;i<linearRing.components.length;i++){var \
component=this.getShortString(linearRing.components[i]);if(component){d+=" \
                "+component;}else{drawúlse;}}}
-d+=" z";if(draw){node.setAttributeNS(null,"d",d);node.setAttributeNS(null,"fill-rule" \
,"evenodd");}else{node.setAttributeNS(null,"d","");}},drawRectangle:function(node,geometry){var \
resolution=this.getResolution();var x=(geometry.x/resolution+this.left);var \
y=(this.top-geometry.y/resolution);if(this.inValidRange(x,y)){node.setAttributeNS(null \
,"x",x);node.setAttributeNS(null,"y",y);node.setAttributeNS(null,"width",geometry.widt \
h/resolution);node.setAttributeNS(null,"height",geometry.height/resolution);}else{node \
.setAttributeNS(null,"x","");node.setAttributeNS(null,"y","");node.setAttributeNS(null \
,"width",0);node.setAttributeNS(null,"height",0);}},drawSurface:function(node,geometry){var \
d=null;var draw=true;for(var \
i=0;i<geometry.components.length;i++){if((i%3)==0&&(i/3)==0){var \
                component=this.getShortString(geometry.components[i]);if(!component){drawúlse;}
                
-d="M "+component;}else if((i%3)==1){var \
                component=this.getShortString(geometry.components[i]);if(!component){drawúlse;}
                
-d+=" C "+component;}else{var \
                component=this.getShortString(geometry.components[i]);if(!component){drawúlse;}
                
-d+=" "+component;}}
-d+=" Z";if(draw){node.setAttributeNS(null,"d",d);}else{node.setAttributeNS(null,"d","");}},getComponentsString:function(components){var \
strings=[];for(var i=0;i<components.length;i++){var \
                component=this.getShortString(components[i]);if(component){strings.push(component);}}
                
-return strings.join(",");},getShortString:function(point){var \
resolution=this.getResolution();var x=(point.x/resolution+this.left);var \
y=(this.top-point.y/resolution);if(this.inValidRange(x,y)){return \
x+","+y;}else{return \
false;}},CLASS_NAME:"OpenLayers.Renderer.SVG"});OpenLayers.Renderer.VML=OpenLayers.Cla \
ss(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",initialize:function(containerID){if(!this.supported()){return;}
                
-if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);var \
style=document.createStyleSheet();style.addRule('olv\\:*',"behavior: \
                url(#default#VML); "+"position: absolute; display: inline-block;");}
-OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);},destroy:fun \
ction(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments);},support \
ed:function(){return!!(document.namespaces);},setExtent:function(extent){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var \
                resolution=this.getResolution();var org=extent.left/resolution+" "+
-extent.top/resolution;this.root.setAttribute("coordorigin",org);var \
                size=extent.getWidth()/resolution+" "+
--extent.getHeight()/resolution;this.root.setAttribute("coordsize",size);},setSize:fun \
ction(size){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);this.rendererR \
oot.style.width=this.size.w;this.rendererRoot.style.height=this.size.h;this.root.style \
.width=this.size.w;this.root.style.height=this.size.h;},getNodeType:function(geometry,style){var \
nodeType=null;switch(geometry.CLASS_NAME){case"OpenLayers.Geometry.Point":nodeType=sty \
le.externalGraphic?"olv:rect":"olv:oval";break;case"OpenLayers.Geometry.Rectangle":nod \
eType="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.L \
inearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":nodeType="olv:shape";break;default:break;}
                
-return nodeType;},setStyle:function(node,style,options,geometry){style=style||node._s \
tyle;options=options||node._options;if(node._geometryClass=="OpenLayers.Geometry.Point"){if(style.externalGraphic){var \
width=style.graphicWidth||style.graphicHeight;var \
height=style.graphicHeight||style.graphicWidth;width=width?width:style.pointRadius*2;height=height?height:style.pointRadius*2;var \
resolution=this.getResolution();var \
xOffset=(style.graphicXOffset!=undefined)?style.graphicXOffset:-(0.5*width);var \
yOffset=(style.graphicYOffset!=undefined)?style.graphicYOffset:-(0.5*height);node.styl \
e.left=((geometry.x/resolution)+xOffset).toFixed();node.style.top=((geometry.y/resolut \
ion)-(yOffset+height)).toFixed();node.style.width=width;node.style.height=height;style \
.fillColor="none";options.isStrokedúlse;}else{this.drawCircle(node,geometry,style.pointRadius);}}
                
-if(options.isFilled){node.setAttribute("fillcolor",style.fillColor);}else{node.setAttribute("filled","false");}
                
-var fills=node.getElementsByTagName("fill");var \
fill=(fills.length==0)?null:fills[0];if(!options.isFilled){if(fill){node.removeChild(fill);}}else{if(!fill){fill=this.createNode('olv:fill',node.id+"_fill");}
                
-fill.setAttribute("opacity",style.fillOpacity);if(node._geometryClass=="OpenLayers.Ge \
ometry.Point"&&style.externalGraphic){if(style.graphicOpacity){fill.setAttribute("opacity",style.graphicOpacity);}
                
-fill.setAttribute("src",style.externalGraphic);fill.setAttribute("type","frame");node \
.style.flip="y";if(!(style.graphicWidth&&style.graphicHeight)){fill.aspect="atmost";}}
                
-if(fill.parentNode!=node){node.appendChild(fill);}}
-if(options.isStroked){node.setAttribute("strokecolor",style.strokeColor);node.setAttr \
ibute("strokeweight",style.strokeWidth+"px");}else{node.setAttribute("stroked","false");}
                
-var strokes=node.getElementsByTagName("stroke");var \
stroke=(strokes.length==0)?null:strokes[0];if(!options.isStroked){if(stroke){node.remo \
veChild(stroke);}}else{if(!stroke){stroke=this.createNode('olv:stroke',node.id+"_stroke");node.appendChild(stroke);}
                
-stroke.setAttribute("opacity",style.strokeOpacity);stroke.setAttribute("endcap",!style.strokeLinecap||style.strokeLinecap=='butt'?'flat':style.strokeLinecap);}
                
-if(style.cursor!=null){node.style.cursor=style.cursor;}
-return node;},postDraw:function(node){var fillColor=node._style.fillColor;var \
strokeColor=node._style.strokeColor;if(fillColor=="none"&&node.getAttribute("fillcolor")!=fillColor){node.setAttribute("fillcolor",fillColor);}
                
-if(strokeColor=="none"&&node.getAttribute("strokecolor")!=strokeColor){node.setAttribute("strokecolor",strokeColor);}},setNodeDimension:function(node,geometry){var \
bbox=geometry.getBounds();if(bbox){var resolution=this.getResolution();var \
scaledBox=new OpenLayers.Bounds((bbox.left/resolution).toFixed(),(bbox.bottom/resoluti \
on).toFixed(),(bbox.right/resolution).toFixed(),(bbox.top/resolution).toFixed());node. \
style.left=scaledBox.left;node.style.top=scaledBox.top;node.style.width=scaledBox.getWidth();node.style.height=scaledBox.getHeight();node.coordorigin=scaledBox.left+" \
"+scaledBox.top;node.coordsize=scaledBox.getWidth()+" \
"+scaledBox.getHeight();}},createNode:function(type,id){var \
                node=document.createElement(type);if(id){node.setAttribute('id',id);}
-node.setAttribute('unselectable','on',0);node.onselectstart=function(){return(false);};return \
node;},nodeTypeCompare:function(node,type){var subType=type;var \
splitIndex=subType.indexOf(":");if(splitIndex!=-1){subType=subType.substr(splitIndex+1);}
                
-var nodeName=node.nodeName;splitIndex=nodeName.indexOf(":");if(splitIndex!=-1){nodeName=nodeName.substr(splitIndex+1);}
                
-return(subType==nodeName);},createRenderRoot:function(){return \
this.nodeFactory(this.container.id+"_vmlRoot","div");},createRoot:function(){return \
this.nodeFactory(this.container.id+"_root","olv:group");},drawPoint:function(node,geom \
etry){this.drawCircle(node,geometry,1);},drawCircle:function(node,geometry,radius){if(!isNaN(geometry.x)&&!isNaN(geometry.y)){var \
resolution=this.getResolution();node.style.left=(geometry.x/resolution).toFixed()-radius;node.style.top=(geometry.y/resolution).toFixed()-radius;var \
diameter=radius*2;node.style.width=diameter;node.style.height=diameter;}},drawLineStri \
ng:function(node,geometry){this.drawLine(node,geometry,false);},drawLinearRing:functio \
n(node,geometry){this.drawLine(node,geometry,true);},drawLine:function(node,geometry,closeLine){this.setNodeDimension(node,geometry);var \
resolution=this.getResolution();var numComponents=geometry.components.length;var \
parts=new Array(numComponents);var comp,x,y;for(var \
i=0;i<numComponents;i++){comp=geome  \
try.components[i];x=(comp.x/resolution);y=(comp.y/resolution);parts[i]=" \
                "+x.toFixed()+","+y.toFixed()+" l ";}
-var end=(closeLine)?" x e":" \
e";node.path="m"+parts.join("")+end;},drawPolygon:function(node,geometry){this.setNodeDimension(node,geometry);var \
resolution=this.getResolution();var path=[];var linearRing,i,comp,x,y;for(var \
j=0;j<geometry.components.length;j++){linearRing=geometry.components[j];path.push("m") \
;for(i=0;i<linearRing.components.length;i++){comp=linearRing.components[i];x=comp.x/resolution;y=comp.y/resolution;path.push(" \
                "+x.toFixed()+","+y.toFixed());if(i==0){path.push(" l");}}
-path.push(" x ");}
-path.push("e");node.path=path.join("");},drawRectangle:function(node,geometry){var \
resolution=this.getResolution();node.style.left=geometry.x/resolution;node.style.top=g \
eometry.y/resolution;node.style.width=geometry.width/resolution;node.style.height=geom \
etry.height/resolution;},drawSurface:function(node,geometry){this.setNodeDimension(node,geometry);var \
resolution=this.getResolution();var path=[];var comp,x,y;for(var \
i=0;i<geometry.components.length;i++){comp=geometry.components[i];x=comp.x/resolution;y=comp.y/resolution;if((i%3)==0&&(i/3)==0){path.push("m");}else \
                if((i%3)==1){path.push(" c");}
-path.push(" "+x+","+y);}
-path.push(" x e");node.path=path.join("");},CLASS_NAME:"OpenLayers.Renderer.VML"});Op \
enLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null, \
layerAlphaHack:null,initialize:function(layer,position,bounds,url,size){OpenLayers.Til \
e.prototype.initialize.apply(this,arguments);this.url=url;this.frame=document.createEl \
ement('div');this.frame.style.overflow='hidden';this.frame.style.position='absolute';t \
his.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack();},destroy:function(){ \
if(this.imgDiv!=null){if(this.layerAlphaHack){OpenLayers.Event.stopObservingElement(th \
is.imgDiv.childNodes[0].id);}else{OpenLayers.Event.stopObservingElement(this.imgDiv.id);}
                
-if(this.imgDiv.parentNode==this.frame){this.frame.removeChild(this.imgDiv);this.imgDiv.map=null;}}
                
-this.imgDiv=null;if((this.frame!=null)&&(this.frame.parentNode==this.layer.div)){this.layer.div.removeChild(this.frame);}
                
-this.frame=null;OpenLayers.Tile.prototype.destroy.apply(this,arguments);},clone:function(obj){if(obj==null){obj=new \
                OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size);}
                
-obj=OpenLayers.Tile.prototype.clone.apply(this,[obj]);obj.imgDiv=null;return \
obj;},draw:function(){if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){this.bounds=this.getBoundsFromBaseLayer(this.position);}
                
-if(!OpenLayers.Tile.prototype.draw.apply(this,arguments)){return false;}
-if(this.isLoading){this.events.triggerEvent("reload");}else{this.isLoading=true;this.events.triggerEvent("loadstart");}
                
-return this.renderTile();},renderTile:function(){if(this.imgDiv==null){this.initImgDiv();}
                
-this.imgDiv.viewRequestID=this.layer.map.viewRequestID;this.url=this.layer.getURL(thi \
s.bounds);OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);var \
imageSize=this.layer.getImageSize();if(this.layerAlphaHack){OpenLayers.Util.modifyAlph \
aImageDiv(this.imgDiv,null,null,imageSize,this.url);}else{OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,imageSize);this.imgDiv.src=this.url;}
                
-return true;},clear:function(){if(this.imgDiv){this.hide();if(OpenLayers.Tile.Image.u \
seBlankTile){this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif";}}},initImgDiv:function(){var \
offset=this.layer.imageOffset;var \
size=this.layer.getImageSize();if(this.layerAlphaHack){this.imgDiv=OpenLayers.Util.cre \
ateAlphaImageDiv(null,offset,size,null,"relative",null,null,null,true);}else{this.imgD \
                iv=OpenLayers.Util.createImage(null,offset,size,null,"relative",null,null,true);}
                
-this.imgDiv.className='olTileImage';this.frame.style.zIndex=this.isBackBuffer?0:1;thi \
s.frame.appendChild(this.imgDiv);this.layer.div.appendChild(this.frame);if(this.layer. \
opacity!=null){OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity);}
                
-this.imgDiv.map=this.layer.map;var \
onload=function(){if(this.isLoading){this.isLoadingúlse;this.events.triggerEvent("load \
end");}};if(this.layerAlphaHack){OpenLayers.Event.observe(this.imgDiv.childNodes[0],'l \
oad',OpenLayers.Function.bind(onload,this));}else{OpenLayers.Event.observe(this.imgDiv,'load',OpenLayers.Function.bind(onload,this));}
                
-var onerror=function(){if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){onl \
oad.call(this);}};OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(onerror,this));},checkImgURL:function(){if(this.layer){var \
loaded=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;if(!OpenLayers.U \
til.isEquivalentUrl(loaded,this.url)){this.hide();}}},startTransition:function(){if(!this.backBufferTile||!this.backBufferTile.imgDiv){return;}
                
-var ratio=1;if(this.backBufferTile.resolution){ratio=this.backBufferTile.resolution/this.layer.getResolution();}
                
-if(ratio!=this.lastRatio){if(this.layer.transitionEffect=='resize'){var \
upperLeft=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);var \
size=new OpenLayers.Size(this.backBufferTile.size.w*ratio,this.backBufferTile.size.h*ratio);var \
px=this.layer.map.getLayerPxFromLonLat(upperLeft);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,px,size);var \
imageSize=this.backBufferTile.imageSize;imageSize=new \
OpenLayers.Size(imageSize.w*ratio,imageSize.h*ratio);var \
imageOffset=this.backBufferTile.imageOffset;if(imageOffset){imageOffset=new \
                OpenLayers.Pixel(imageOffset.x*ratio,imageOffset.y*ratio);}
-OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,imageOffset,imageSiz \
e);this.backBufferTile.show();}}else{if(this.layer.singleTile){this.backBufferTile.show();}else{this.backBufferTile.hide();}}
                
-this.lastRatio=ratio;},show:function(){this.frame.style.display='';if(OpenLayers.Util \
.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(navigat \
or.userAgent.toLowerCase().indexOf("gecko")!=-1){this.frame.scrollLeft=this.frame.scro \
llLeft;}}},hide:function(){this.frame.style.display='none';},CLASS_NAME:"OpenLayers.Ti \
le.Image"});OpenLayers.Tile.Image.useBlankTile=(OpenLayers.Util.getBrowserName()=="saf \
ari"||OpenLayers.Util.getBrowserName()=="opera");OpenLayers.Tile.WFS=OpenLayers.Class( \
OpenLayers.Tile,{features:null,url:null,request:null,initialize:function(layer,positio \
n,bounds,url,size){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url \
=url;this.features=[];},destroy:function(){OpenLayers.Tile.prototype.destroy.apply(thi \
s,arguments);this.destroyAllFeatures();this.features=null;this.url=null;if(this.reques \
t){this.request.abort();this.request=null;}},clear:function(){this.destroyAllFeatures();},draw:function(){if(OpenLayers.Tile.proto
  type.draw.apply(this,arguments)){if(this.isLoading){this.events.triggerEvent("reload");}else{this.isLoading=true;this.events.triggerEvent("loadstart");}
                
-this.loadFeaturesForRegion(this.requestSuccess);}},loadFeaturesForRegion:function(success,failure){if(this.request){this.request.abort();}
                
-this.request=OpenLayers.loadURL(this.url,null,this,success);},requestSuccess:function(request){if(this.features){var \
doc=request.responseXML;if(!doc||!doc.documentElement){doc=OpenLayers.Format.XML.prototype.read(request.responseText);}
                
-if(this.layer.vectorMode){this.layer.addFeatures(this.layer.formatObject.read(doc));}else{var \
resultFeatures=OpenLayers.Ajax.getElementsByTagNameNS(doc,"http://www.opengis.net/gml","gml","featureMember");this.addResults(resultFeatures);}}
                
-if(this.events){this.events.triggerEvent("loadend");}
-this.request=null;},addResults:function(results){for(var \
i=0;i<results.length;i++){var feature=new \
this.layer.featureClass(this.layer,results[i]);this.features.push(feature);}},destroyAllFeatures:function(){while(this.features.length>0){var \
feature=this.features.shift();feature.destroy();}},CLASS_NAME:"OpenLayers.Tile.WFS"}); \
OpenLayers.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:new \
OpenLayers.Size(180,90),layers:null,minRectSize:15,minRectDisplayClass:"RectReplacemen \
t",minRatio:8,maxRatio:32,mapOptions:null,handlers:null,initialize:function(options){t \
his.layers=[];this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,[options]);},destroy:function(){if(!this.mapDiv){return;}
                
-this.handlers.click.destroy();this.mapDiv.removeChild(this.extentRectangle);this.exte \
ntRectangle=null;this.rectEvents.destroy();this.rectEvents=null;this.ovmap.destroy();t \
his.ovmap=null;this.element.removeChild(this.mapDiv);this.mapDiv=null;this.div.removeC \
hild(this.element);this.element=null;if(this.maximizeDiv){OpenLayers.Event.stopObservi \
ngElement(this.maximizeDiv);this.div.removeChild(this.maximizeDiv);this.maximizeDiv=null;}
                
-if(this.minimizeDiv){OpenLayers.Event.stopObservingElement(this.minimizeDiv);this.div.removeChild(this.minimizeDiv);this.minimizeDiv=null;}
                
-this.map.events.un({"moveend":this.update,"changebaselayer":this.baseLayerDraw,scope: \
this});OpenLayers.Control.prototype.destroy.apply(this,arguments);},draw:function(){Op \
enLayers.Control.prototype.draw.apply(this,arguments);if(!(this.layers.length>0)){if(this.map.baseLayer){var \
layer=this.map.baseLayer.clone();this.layers=[layer];}else{this.map.events.register("changebaselayer",this,this.baseLayerDraw);return \
                this.div;}}
-this.element=document.createElement('div');this.element.className=this.displayClass+' \
Element';this.element.style.display='none';this.mapDiv=document.createElement('div');t \
his.mapDiv.style.width=this.size.w+'px';this.mapDiv.style.height=this.size.h+'px';this \
.mapDiv.style.position='relative';this.mapDiv.style.overflow='hidden';this.mapDiv.id=O \
penLayers.Util.createUniqueID('overviewMap');this.extentRectangle=document.createEleme \
nt('div');this.extentRectangle.style.position='absolute';this.extentRectangle.style.zI \
ndex00;this.extentRectangle.className=this.displayClass+'ExtentRectangle';this.mapDiv \
.appendChild(this.extentRectangle);this.element.appendChild(this.mapDiv);this.div.appendChild(this.element);if(!this.outsideViewport){this.div.className+=" \
"+this.displayClass+'Container';var \
imgLocation=OpenLayers.Util.getImagesLocation();var \
img=imgLocation+'layer-switcher-maximize.png';this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+'MaximizeButton',null,new
  OpenLayers.Size(18,18),img,'absolute');this.maximizeDiv.style.display='none';this.ma \
ximizeDiv.className=this.displayClass+'MaximizeButton';OpenLayers.Event.observe(this.m \
aximizeDiv,'click',OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var \
img=imgLocation+'layer-switcher-minimize.png';this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv('OpenLayers_Control_minimizeDiv',null,new \
OpenLayers.Size(18,18),img,'absolute');this.minimizeDiv.style.display='none';this.mini \
mizeDiv.className=this.displayClass+'MinimizeButton';OpenLayers.Event.observe(this.min \
imizeDiv,'click',OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv);var \
eventsToStop=['dblclick','mousedown'];for(var \
i=0;i<eventsToStop.length;i++){OpenLayers.Event.observe(this.maximizeDiv,eventsToStop[ \
i],OpenLayers.Event.stop);OpenLayers.Event.observe(this.minimizeDiv,eventsToStop[i],OpenLayers.Event.stop);}
                
-this.minimizeControl();}else{this.element.s


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic