[Mapbender-commits] r3125 - in branches/print_dev: core documents documents/jsdoc http http/classes http/classes/fonts http/classes/phpmailer-1.72 http/classes/phpmailer-1.72/docs http/classes/phpmailer-1.72/language http/classes/phpmailer-1.72/phpdoc http/classes/phpmailer-1.72/test http/css http/extensions http/extensions/datepicker http/frames http/html http/img http/img/arrows http/img/button_blink_red http/img/button_blue http/img/button_digitize http/img/button_gray http/img/button_silver_blue http/img/trafficlights http/img/tree http/img/tree_blue http/img/tree_gray http/img/tree_new http/img/tree_orange http/include http/javascripts http/php http/print http/print/img http/sld http/sld/classes http/sld/img

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Oct 6 06:40:55 EDT 2008


Author: verenadiewald
Date: 2008-10-06 06:40:54 -0400 (Mon, 06 Oct 2008)
New Revision: 3125

Added:
   branches/print_dev/core/checksum.json
   branches/print_dev/documents/checksum.json
   branches/print_dev/documents/jsdoc/checksum.json
   branches/print_dev/http/checksum.json
   branches/print_dev/http/classes/checksum.json
   branches/print_dev/http/classes/fonts/checksum.json
   branches/print_dev/http/classes/phpmailer-1.72/checksum.json
   branches/print_dev/http/classes/phpmailer-1.72/docs/checksum.json
   branches/print_dev/http/classes/phpmailer-1.72/language/checksum.json
   branches/print_dev/http/classes/phpmailer-1.72/phpdoc/checksum.json
   branches/print_dev/http/classes/phpmailer-1.72/test/checksum.json
   branches/print_dev/http/css/checksum.json
   branches/print_dev/http/extensions/checksum.json
   branches/print_dev/http/extensions/datepicker/checksum.json
   branches/print_dev/http/frames/checksum.json
   branches/print_dev/http/frames/jquery.html
   branches/print_dev/http/html/checksum.json
   branches/print_dev/http/img/arrows/checksum.json
   branches/print_dev/http/img/button_blink_red/checksum.json
   branches/print_dev/http/img/button_blink_red/perimeter_off.png
   branches/print_dev/http/img/button_blink_red/perimeter_on.png
   branches/print_dev/http/img/button_blink_red/perimeter_over.png
   branches/print_dev/http/img/button_blue/checksum.json
   branches/print_dev/http/img/button_digitize/checksum.json
   branches/print_dev/http/img/button_gray/checksum.json
   branches/print_dev/http/img/button_silver_blue/checksum.json
   branches/print_dev/http/img/checksum.json
   branches/print_dev/http/img/trafficlights/checksum.json
   branches/print_dev/http/img/tree/checksum.json
   branches/print_dev/http/img/tree_blue/checksum.json
   branches/print_dev/http/img/tree_gray/checksum.json
   branches/print_dev/http/img/tree_new/checksum.json
   branches/print_dev/http/img/tree_orange/checksum.json
   branches/print_dev/http/include/checksum.json
   branches/print_dev/http/javascripts/checksum.json
   branches/print_dev/http/javascripts/core.js
   branches/print_dev/http/javascripts/event.js
   branches/print_dev/http/javascripts/geometry1.1.js
   branches/print_dev/http/javascripts/point.js
   branches/print_dev/http/javascripts/style.js
   branches/print_dev/http/php/checksum.json
   branches/print_dev/http/php/database-mysql.php
   branches/print_dev/http/php/database-pgsql.php
   branches/print_dev/http/php/mb_listWMCs.php
   branches/print_dev/http/php/mod_createJSObjFromDB.php
   branches/print_dev/http/php/mod_insertWmcIntoDb.php
   branches/print_dev/http/php/mod_showGuiName.php
   branches/print_dev/http/print/checksum.json
   branches/print_dev/http/print/img/checksum.json
   branches/print_dev/http/sld/checksum.json
   branches/print_dev/http/sld/classes/checksum.json
   branches/print_dev/http/sld/img/checksum.json
Modified:
   branches/print_dev/core/globalSettings.php
   branches/print_dev/core/system.php
   branches/print_dev/http/classes/class_SaveLegend.php
   branches/print_dev/http/classes/class_administration.php
   branches/print_dev/http/classes/class_bbox.php
   branches/print_dev/http/classes/class_checkInput.php
   branches/print_dev/http/classes/class_connector.php
   branches/print_dev/http/classes/class_gml2.php
   branches/print_dev/http/classes/class_gui.php
   branches/print_dev/http/classes/class_json.php
   branches/print_dev/http/classes/class_kml_geometry.php
   branches/print_dev/http/classes/class_kml_line.php
   branches/print_dev/http/classes/class_kml_linearring.php
   branches/print_dev/http/classes/class_kml_multigeometry.php
   branches/print_dev/http/classes/class_kml_ows.php
   branches/print_dev/http/classes/class_kml_parser_ows.php
   branches/print_dev/http/classes/class_kml_placemark.php
   branches/print_dev/http/classes/class_kml_point.php
   branches/print_dev/http/classes/class_kml_polygon.php
   branches/print_dev/http/classes/class_layer_monitor.php
   branches/print_dev/http/classes/class_locale.php
   branches/print_dev/http/classes/class_log.php
   branches/print_dev/http/classes/class_monitor.php
   branches/print_dev/http/classes/class_point.php
   branches/print_dev/http/classes/class_user.php
   branches/print_dev/http/classes/class_weldMaps2Image.php
   branches/print_dev/http/classes/class_weldMaps2PNG.php
   branches/print_dev/http/classes/class_wfs.php
   branches/print_dev/http/classes/class_wfs_conf.php
   branches/print_dev/http/classes/class_wmc.php
   branches/print_dev/http/classes/class_wms.php
   branches/print_dev/http/css/admin.screen.css
   branches/print_dev/http/css/administration_alloc.css
   branches/print_dev/http/css/edit_gui.css
   branches/print_dev/http/css/popup.css
   branches/print_dev/http/extensions/datepicker/datepicker.js
   branches/print_dev/http/extensions/ext_featureInfoTunnel.php
   branches/print_dev/http/extensions/fisheye.js
   branches/print_dev/http/extensions/jqjson.js
   branches/print_dev/http/extensions/jquery.ajaxmanager.js
   branches/print_dev/http/extensions/jquery.js
   branches/print_dev/http/extensions/json.js
   branches/print_dev/http/extensions/wz_jsgraphics.js
   branches/print_dev/http/frames/index.php
   branches/print_dev/http/frames/login.php
   branches/print_dev/http/html/mod_treefolder.html
   branches/print_dev/http/html/mod_treefolder2.php
   branches/print_dev/http/javascripts/core.php
   branches/print_dev/http/javascripts/geometry.js
   branches/print_dev/http/javascripts/jsTree.js
   branches/print_dev/http/javascripts/map.js
   branches/print_dev/http/javascripts/map.php
   branches/print_dev/http/javascripts/map_obj.js
   branches/print_dev/http/javascripts/mod_addWMSfromfilteredList_ajax.php
   branches/print_dev/http/javascripts/mod_addWMSgeneralFunctions.js
   branches/print_dev/http/javascripts/mod_adminNavigation.js
   branches/print_dev/http/javascripts/mod_box1.js
   branches/print_dev/http/javascripts/mod_cardindex.js
   branches/print_dev/http/javascripts/mod_closePolygon.js
   branches/print_dev/http/javascripts/mod_closePolygonExt.js
   branches/print_dev/http/javascripts/mod_digitize_tab.php
   branches/print_dev/http/javascripts/mod_displayObj.js
   branches/print_dev/http/javascripts/mod_displayWmc.php
   branches/print_dev/http/javascripts/mod_dragMapSize.php
   branches/print_dev/http/javascripts/mod_highlightPOI.php
   branches/print_dev/http/javascripts/mod_horizTabs.js
   branches/print_dev/http/javascripts/mod_initWmc.php
   branches/print_dev/http/javascripts/mod_loadwmc.php
   branches/print_dev/http/javascripts/mod_pan.php
   branches/print_dev/http/javascripts/mod_perimeter.php
   branches/print_dev/http/javascripts/mod_permanentHighlight.js
   branches/print_dev/http/javascripts/mod_rubber.js
   branches/print_dev/http/javascripts/mod_rubberExt.js
   branches/print_dev/http/javascripts/mod_sandclock.php
   branches/print_dev/http/javascripts/mod_sandclock2.php
   branches/print_dev/http/javascripts/mod_saveWKT.js
   branches/print_dev/http/javascripts/mod_savewmc.php
   branches/print_dev/http/javascripts/mod_switchLocale_noreload.php
   branches/print_dev/http/javascripts/mod_tab.js
   branches/print_dev/http/javascripts/mod_treeConf.js
   branches/print_dev/http/javascripts/mod_wfs_SpatialRequest.php
   branches/print_dev/http/javascripts/mod_wfs_gazetteer_client.php
   branches/print_dev/http/javascripts/popup.js
   branches/print_dev/http/javascripts/requestGeometryConstructor.js
   branches/print_dev/http/javascripts/wfs.js
   branches/print_dev/http/javascripts/wfs_obj.js
   branches/print_dev/http/php/mod_WMSpreferences.php
   branches/print_dev/http/php/mod_addWmsFromFeatureInfo.php
   branches/print_dev/http/php/mod_editElements.php
   branches/print_dev/http/php/mod_editGuiWms.php
   branches/print_dev/http/php/mod_editUser.php
   branches/print_dev/http/php/mod_forgottenPassword.php
   branches/print_dev/http/php/mod_gazetteerMetadata.php
   branches/print_dev/http/php/mod_help.php
   branches/print_dev/http/php/mod_loadCapabilitiesList.php
   branches/print_dev/http/php/mod_log.php
   branches/print_dev/http/php/mod_logout.php
   branches/print_dev/http/php/mod_map1.php
   branches/print_dev/http/php/mod_mapOV.php
   branches/print_dev/http/php/mod_meetingPoint.php
   branches/print_dev/http/php/mod_treefolderClient.php
   branches/print_dev/http/php/mod_wfs.php
   branches/print_dev/http/php/mod_wfs_conf.php
   branches/print_dev/http/php/mod_wfs_edit.php
   branches/print_dev/http/php/mod_wfs_gazetteer_server.php
   branches/print_dev/http/php/nestedSets.php
   branches/print_dev/http/print/mod_printPDF.php
   branches/print_dev/http/print/mod_printPDF_pdf.php
   branches/print_dev/http/print/printPDF.conf
   branches/print_dev/http/print/printPDF_b.conf
   branches/print_dev/http/print/print_functions.php
Log:
2.5 release

Added: branches/print_dev/core/checksum.json
===================================================================
--- branches/print_dev/core/checksum.json	                        (rev 0)
+++ branches/print_dev/core/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"globalSettings.php":"7cd988b9067be68e30a8a59e58f2795a21d82b6c","i18n.php":"a6c2b679682dff349feb0b80129652c13dccfaaf","system.php":"8887c17f698ce0f38cbcf92f419fabcdf25014d1"}
\ No newline at end of file

Modified: branches/print_dev/core/globalSettings.php
===================================================================
--- branches/print_dev/core/globalSettings.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/core/globalSettings.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -40,10 +40,10 @@
 // database wrapper
 //
 if(SYS_DBTYPE=="mysql") {
-	require_once(dirname(__FILE__) . "/../lib/database-mysql.php"); 
+	require_once(dirname(__FILE__) . "/../http/php/database-mysql.php"); 
 }
 else {
-	require_once(dirname(__FILE__) . "/../lib/database-pgsql.php"); 
+	require_once(dirname(__FILE__) . "/../http/php/database-pgsql.php"); 
 }
 
 //
@@ -63,4 +63,9 @@
 //
 $con = db_connect($DBSERVER, $OWNER, $PW);
 db_select_db(DB, $con);
-?>
+
+//
+// Do not display PHP errors
+//
+ini_set("display_errors", "0");
+?>
\ No newline at end of file

Modified: branches/print_dev/core/system.php
===================================================================
--- branches/print_dev/core/system.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/core/system.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -19,19 +19,17 @@
 #
 # mapbender version
 #
-define("MB_VERSION_NUMBER", "2.6");
-define("MB_VERSION_APPENDIX", "trunk");
-define("MB_RELEASE_DATE", mktime(0,0,0,7,22,2008));//h, min,sec,month,day,year
+define("MB_VERSION_NUMBER", "2.5.0");
+define("MB_VERSION_APPENDIX", "");
+define("MB_RELEASE_DATE", mktime(0,0,0,9,29,2008));//h, min,sec,month,day,year
 
 #
 # constants from map.js
 #
 define("MB_RESOLUTION", "28.35");
 define("MB_FEATURE_COUNT", "100");
-define("MB_SECURITY_PROXY", "http://wms1.ccgis.de/mapbender/tools/security_proxy.php?mb_ows_security_proxy=");
 #
 # available log levels 
 #
 define("LOG_LEVEL_LIST", "off,error,warning,notice,all");
 
-define("ZOOM_MOUSEWHEEL", "1.1");

Added: branches/print_dev/documents/checksum.json
===================================================================
--- branches/print_dev/documents/checksum.json	                        (rev 0)
+++ branches/print_dev/documents/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+[]
\ No newline at end of file

Added: branches/print_dev/documents/jsdoc/checksum.json
===================================================================
--- branches/print_dev/documents/jsdoc/checksum.json	                        (rev 0)
+++ branches/print_dev/documents/jsdoc/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+[]
\ No newline at end of file

Added: branches/print_dev/http/checksum.json
===================================================================
--- branches/print_dev/http/checksum.json	                        (rev 0)
+++ branches/print_dev/http/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"index.php":"ef1eebbf558cb370e21451c58d2ad07294420fc4"}
\ No newline at end of file

Added: branches/print_dev/http/classes/checksum.json
===================================================================
--- branches/print_dev/http/classes/checksum.json	                        (rev 0)
+++ branches/print_dev/http/classes/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"class_json.php":"920ef3482801a7f99a88696b8faa22fc4ceb72e7","class_mb_notice.php":"3938b346312a0bc7dc19ecb41e53b104b20156d7","class_mb_log.php":"75c2d75b9b055ba1f9f073c8e643aee0f3b0d46b","class.ezpdf.php":"c993628f4d4cb46a9e41205562342c06a2832522","class_kml_geometry.php":"dbcaccec01342cd117584c60a9f720ef842eec3e","class_keyword.php":"0db9f3d66e6701e52f13b48cad3dfa73de24ac65","class_stripRequest.php":"dafe9baa33782c93f4f4d5cd36511fd6bd14a909","class_gui.php":"98e891a04b157be8253c7631d50cd92c68a54776","class_kml_ows.php":"26d5579ec4cfa87eb7e954f4f43f2d76c3a06761","class_weldMaps2PNG.php":"9d9825a01bfab1e8dce7f6707d8af827bcd7a479","class_weldLegend2PNG.php":"ea1cfb044da9c01b3dacc3f5cd56bd61937c0b5c","class_mb_exception.php":"f977a2de0f25986cd40e54d2ed82e11e917e6a90","class_mb_warning.php":"0c0f6c7c87536c7318aab476e1417b11b7c69023","class_kml_multigeometry.php":"b8a2fd3ccd790ac48d2f75659a08a44aafe48a87","class_monitor.php":"296ba48ae3837238ee8c5ce834821f8f629afe9d","class_wfs_conf.php":"9b1b70cf56321dad1ff94fdbd01809e201d9d797","class.pdf.php":"47991bddb5e4c2073022a76af549a6deb6248956","class_kml.php":"8fb240e818892eda0d28983c4a03cf2359c5454e","class_administration.php":"e09b61b67b6cbc3e73f0a4340a49f228741ec51a","class_kml_point.php":"3b67ed95e6006477c9e9c26b9b16eca3edc3276b","class_metadata.php":"4460ad992f6bf1d2655463f84e06fbee233c6603","class_weldOverview2PNG.php":"fde6a9ac4875fe211eb203ffc43bbc1e8de8be3e","class_point.php":"a40b062578a2e1f7da686ac59fe1302eac24d1dd","class_wmc.php":"37e25b16b60aaa6cffff489d81dfe0a17a9b66e0","class_layer_monitor.php":"4b2d705ff9f7f1125cbb24022782433e32ef1b95","class_wms.php":"e83ca0ccbcd1e0899aee9c46f8fdb14ccd71ee26","class_user.php":"833e31dd1fb679dbe2a45fc13ae9b638ce4e6077","class_connector.php":"e2e12bdf8821b676e27ede9e62f476c17b452603","class_log.php":"4957a1cc6a5d4eb3e6c1a727c51cf953c2a02af0","class_gml2.php":"f4cc04920348bc84ddd2d7e3e147549c7073f055","class_kml_polygon.php":"6ff5ed9d3352952fc93da970a57c53a61bd9e16f","class_kml_placemark.php":"dd56e36ee78147a9402948854f6716c6d0fcba82","class_locale.php":"be977620e2b47ccb7c10b79a208f1020630bd987","class_kml_parser_ows.php":"87848b6bbf2e418ec83af0ec42cf83ab49cba612","class_kml_linearring.php":"2d7ff107c8d33c603f4ff6949bcfc4005350786c","class_kml_line.php":"ed2d28fe1fcf0eea0ff4dca53d0d3b8de204dcc1","class_SaveLegend.php":"957010fcf867d07a8ba503cee66f6443044bc445","class_bbox.php":"5d325bd29049e9b6e98d464cb31408d1c28c02ed","class_weldMaps2Image.php":"5b0514336e297dda0eb8171771b5c4e1da68b2ee","class_wfs.php":"b909d21b3ae92c00069ea2f88fde9ec638436dac","class_checkInput.php":"890b1a06409fbe0aa0666a8b1c99dfd0eb1ef647"}
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_SaveLegend.php
===================================================================
--- branches/print_dev/http/classes/class_SaveLegend.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_SaveLegend.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -64,4 +64,4 @@
 	}
 }
 
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_administration.php
===================================================================
--- branches/print_dev/http/classes/class_administration.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_administration.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -25,8 +25,8 @@
  * class to wrap administration methods
  *
  * @uses phpmailer
- */ 
-class administration {
+ */
+class administration{
     /**
      * checks whether the passed email-address is valid / following a pattern
      * @todo is this an exact representation of the RFC 2822?
@@ -106,54 +106,6 @@
 		}
 	}
 
-	/**
-	 * 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)
      *
@@ -391,13 +343,19 @@
      * @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);
+		$sql = "DELETE FROM mb_user_wmc ";
+		$sql .= "WHERE fkey_user_id = $1 AND wmc_id = $2";
+		$v = array($user_id,$wmc_id);
+		$t = array('i','s');
+		$res = db_prep_query($sql,$v,$t);
+		if ($res) {
+			return true;
+		}
+		else {
+			return false;
+		}
  	}
 
     /**
@@ -556,13 +514,19 @@
      *
      * @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);
+		$sql = "SELECT wmc FROM mb_user_wmc WHERE wmc_id = $1 ";
+		$v = array($id);
+		$t = array('s');
+		$res = db_prep_query($sql,$v,$t);
+		$row = db_fetch_array($res);
+		if ($row) {
+			return $row["wmc"];
+		}
+		else {
+			return false;
+		}
 	}
 
     /**
@@ -651,21 +615,26 @@
 		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();
+		$sql_wmc = "SELECT wmc_id FROM mb_user_wmc ";
+		$sql_wmc .= "WHERE fkey_user_id = $1 GROUP BY wmc_id";
+		$v = array($user_id);
+		$t = array('i');
+		$res_wmc = db_prep_query($sql_wmc,$v,$t);
+  		$count_g = 0;
+  		$arrayWmc = array();
+		while($row = db_fetch_array($res_wmc)){
+			$arrayWmc[$count_g] = $row["wmc_id"];
+			$count_g++;
+		}
+		return $arrayWmc;
  	}
 
 	/**
 	 * @deprecated
 	 */
-	function getGuisByPermission($mb_user_id,$ignorepublic){
-		$e = new mb_notice("administration->getGuisByPermission is deprecated, use user->getApplicationsByPermission instead!"); 
+	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);
 	}
@@ -1106,10 +1075,10 @@
 	 * @param integer 		userid the user-ID of the current user
 	 * @return integer[] 	the IDs of the wfs_conf-table
 	 */
-	 function getWfsConfByPermission($userid){
+	 function getWfsConfByPermission($userid){
 		$e = new mb_notice("administration->getWfsConfByPermission is deprecated, use user->getWfsConfByPermission instead!"); 
 		$user = new User($userid); 	
 		return $user->getWfsConfByPermission();
 	 }
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_bbox.php
===================================================================
--- branches/print_dev/http/classes/class_bbox.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_bbox.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -18,6 +18,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 require_once(dirname(__FILE__)."/../../core/globalSettings.php");
+require_once(dirname(__FILE__)."/class_point.php");
 
 /**
  * A bounding box consisting of an lower left and an upper right point, and an EPSG.
@@ -143,10 +144,6 @@
 		return false;
 	}
 	
-	function toHtml () {
-		return (string) $this->min->toHtml() . " | " . $this->max->toHtml(); 
-	}
-	
 	function __toString() {
 		return (string) "[" . $this->min . $this->max . " " . $this->epsg . "]"; 
 	}

Modified: branches/print_dev/http/classes/class_checkInput.php
===================================================================
--- branches/print_dev/http/classes/class_checkInput.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_checkInput.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -53,4 +53,4 @@
 		}		
 	}	
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_connector.php
===================================================================
--- branches/print_dev/http/classes/class_connector.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_connector.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -43,11 +43,6 @@
 		if ($url) {
 			$this->load($url);
 		}
-
-		// fill array (HOSTs not for Proxy)
-		if (http_ip!=""){
-			$NOT_PROXY_HOSTS_array = split(",", NOT_PROXY_HOSTS);
-		}	
 	}
 	
 	/**
@@ -56,12 +51,7 @@
 	public function load($url) {
 		switch ($this->connectionType) {
 			case "curl":
-				if (in_array($host, $NOT_PROXY_HOSTS_array)){	
-					$this->file = $this->getHTTP($url);				
-				} 
-				else {
-					$this->file = $this->getCURL($url);	
-				}
+				$this->file = $this->getCURL($url);
 				break;
 			case "http":
 				$this->file = $this->getHTTP($url);
@@ -217,4 +207,4 @@
 		}
 	}
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_gml2.php
===================================================================
--- branches/print_dev/http/classes/class_gml2.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_gml2.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,841 +1,844 @@
-<?php
-# $Id: class_gml2.php 2655 2008-07-11 15:16:21Z christoph $
-# http://www.mapbender.org/index.php/class_gml2.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__)."/../../core/globalSettings.php");
-
-require_once(dirname(__FILE__)."/../classes/class_connector.php");
-require_once(dirname(__FILE__)."/../classes/class_json.php");
-
-class gml2 {
-	var $geomtype_point = 'Point';					
-	var $geomtype_polygon = 'Polygon';
-	var $geomtype_line = 'LineString';
-	var $geomtype_multipolygon = 'MultiPolygon'; 
-	var $geomtype_multiline = 'MultiLine';
-	var $geometries = array();	
-	var $member = -1;
-	var $geomtype = array();	
-	var $keys = array();
-	var $values = array();
-	var $geometry = array();
-	var $bbox = array();
-	var $doc;
-	
-	
-	function gml2(){
-		$this->geometries = array($this->geomtype_point, $this->geomtype_polygon, $this->geomtype_line, $this->geomtype_multipolygon, $this->geomtype_multiline);
-	}
-	function getGml($req){
-		$x = new connector($req);
-		return $x->file;
-	}
-
-	function parseFile($req){
-		#$data = implode("",file($req));
-		$x = new connector($req);
-		$data = $x->file;
-		$data = $this->removeWhiteSpace($data);
-		$this->parseXML($data);		
-		#$e = new mb_exception("data = ".$data); 		
-	}
-	
-	function parseXML($data) {
-		
-		$this->doc = $data;
-		return $this->toGeoJSON();
-	}
-
-	function removeWhiteSpace ($string) {
-		return preg_replace("/\>(\s)+\</", "><", trim($string));
-	}
-	
-	function sepNameSpace($s){
-		$c = mb_strpos($s,":"); 
-		if($c>0){
-			return mb_substr($s,$c+1);
-		}
-		else{
-			return $s;
-		}		
-	}
-	
-	function toGeoJSON () {
-		$gmlDoc = new SimpleXMLElement($this->doc);
-		
-		$gmlDoc->registerXPathNamespace('xls', 'http://www.opengis.net/xls');
-		$gmlDoc->registerXPathNamespace('gml', 'http://www.opengis.net/gml');
-		
-		// build feature collection
-		$featureCollection = new FeatureCollection();
-		
-		// segments of the featzreCollection
-		$gmlFeatureMembers = $gmlDoc->xpath("//gml:featureMember");
-		
-		if(count($gmlFeatureMembers)>0){
-			$cnt=0;
-			foreach ($gmlFeatureMembers as $gmlFeatureMember) {
-				$featureMember_dom = dom_import_simplexml($gmlFeatureMember);
-				
-				$feature = new Feature();
-				$feature->parse($featureMember_dom);
-				if (isset($feature->geometry)) {
-					$featureCollection->addFeature($feature);
-				}
-				$cnt++;
-			}
-			
-			return $featureCollection->toGeoJSON();
-		}
-		else{
-			return "{'errorMessage':'Kein Ergebnis'}";
-		}
-	}
-
-	
-	/**
-	 * Exports the file to SHP.
-	 * 
-	 * @param string $filenamePrefix the filename without an ending like .shp
-	 */
-	function toShape ($filenamePrefix) {
-		$unique = TMPDIR . "/" . $filenamePrefix;
-		$fShape = $unique.".shp";
-		$fGml = $unique.".gml";
-//		$pathOgr = '/appserver/postgresql/templates/postgresql824/bin/ogr2ogr';
-		$pathOgr = '/usr/bin/ogr2ogr';
-		$w = $this->toFile($fGml);
-
- 		$exec = $pathOgr.' -f "ESRI Shapefile" "'.$fShape.'" '.$fGml;
- 		exec($exec);
- 		
- 		$exec = 'zip -j '.$unique.' '.$unique.'.shp '.$unique.'.dbf '.$unique.'.shx '.$unique.'.gfs '.$unique.'.gml ';
- 		exec($exec);
-
-		$exec = 'rm -f '.$unique.' '.$unique.'.shp '.$unique.'.dbf '.$unique.'.shx '.$unique.'.gfs '.$unique.'.gml';
-		exec($exec);
-		
-		$exec = 'chmod 777 '.$unique.'.*';
-		exec($exec);
-		//echo "<a href='../tmp/".$unique.".zip'>Download ".$prefix."<a>";
-	}
-	
-	/**
-	 * Writes a file containing the GML.
-	 * 
-	 * @param string $path the path to the file.
-	 * @param string $path the path to the file.
-	 * @return bool true if the file could be saved; else false.
-	 */
-	function toFile ($file) {
-		$handle = fopen($file, "w");
-		if (!$handle) {
-			$e = new mb_exception("class_gml2.php: Filehandler error (" . $file . ").");
-			return false;
-		}
-		if (!fwrite($handle,$this->__toString())) {
-			$e = new mb_exception("class_gml2.php: Could not write file (" . $file . ").");
-			fclose($handle);
-			return false;
-		}
-		fclose($handle);
-		return true;
-	}
-	
-	function __toString () {
-		return $this->doc;
-	}
-
-
-
-	/**
-	 * @deprecated
-	 */
-	function parsegml($req){
-		#$data = implode("",file($req));
-		$x = new connector($req);
-		$this->parse_xml($x->file);		 		
-	}
-
-	/**
-	 * @deprecated
-	 */
-	function parse_xml($data){
-
-
-		$this->doc = $data;
-
-		$section = false;
-		$geom = false;
-		$boundedBy = false;
-		$coordinates = false;
-		$el = -1;
-		$parser = xml_parser_create(CHARSET);
-		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,$data,$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);
-		
-		foreach ($values as $element) {
-			#$e = new mb_exception($element[tag]);
-			if(strtoupper($this->sepNameSpace($element[tag])) == strtoupper("boundedBy") && $element[type] == "open"){
-				$boundedBy = true;
-			}
-			if ($boundedBy) {
-				if(strtoupper($this->sepNameSpace($element[tag])) == strtoupper("coordinates")){
-					$this->bbox = explode(",", str_replace(",,","",str_replace(" ",",",trim($element[value]))));
-					$boundedBy=false;
-				}
-			}
-			if(strtoupper($this->sepNameSpace($element[tag])) == strtoupper("featureMember") && $element[type] == "open"){
-				$this->member++;
-				$this->keys[$this->member] = array();
-				$this->value[$this->member] = array();
-				$this->geometry[$this->member] = array();
-				$section = true;
-				$cnt_geom = 0;
-			}
-			if($section == true){
-				if( in_array($this->sepNameSpace($element[tag]),$this->geometries) && $element[type] == "open"){
-					$geom = true;
-					$this->geomtype[$this->member] = $this->sepNameSpace($element[tag]);
-				}
-				else if(in_array($this->sepNameSpace($element[tag]),$this->geometries) && $element[type] == "close"){
-					$cnt_geom++;
-					$geom = false;
-				}
-				if($geom == true){
-					if (strtoupper($this->sepNameSpace($element[tag])) == strtoupper("coordinates")) {
-						$this->geometry[$this->member][$cnt_geom] =  str_replace(",,","",str_replace(" ",",",trim($element[value])));
-						$coordinates = true;
-						// XXX: Increment counter to get all geometries of a feature member, 
-						// comment it out to only show first geometry of featuremember
-						$cnt_geom++;
-					}
-					else if (!$coordinates && trim($element[value])) {
-						$coords = str_replace(",,","",str_replace(" ",",",trim($element[value])));
-						$tmp_array = explode(",", $coords);
-						if (count($tmp_array > 1)) {
-							$this->geometry[$this->member][$cnt_geom] =  $coords;
-							$coordinates = true;
-						   // XXX: Increment counter to get all geometries of a feature member, 
-						   // comment it out to only show first geometry of featuremember
-							$cnt_geom++;
-						}
-					}
-				}
-				else if(strtoupper($this->sepNameSpace($element[tag])) == strtoupper("featureMember") && $element[type] == "close"){
-					$section = false;	
-					$el = -1;
-				}
-				else{
-					$el++;
-					$this->values[$this->member][$el] = $element[value];
-					$this->keys[$this->member][$el] = $element[tag];	
-				}
-			}
-		}
-	}	
-
-	/**
-	 * @deprecated
-	 */
-	function getMemberCount(){
-		return ($this->member+1);	
-	}
-	
-	/**
-	 * @deprecated
-	 */
-	function getValueBySeparatedKey($memberCount,$keyName){
-		for($i=0; $i<count($this->keys[$memberCount]); $i++){
-			if($this->sepNameSpace($this->keys[$memberCount][$i]) == $keyName){
-				return $this->values[$memberCount][$i];
-			}	
-		}
-	}
-	
-	/**
-	 * @deprecated
-	 */
-	function getValueByKey($memberCount,$keyName){
-		for($i=0; $i<count($this->keys[$memberCount]); $i++){
-			if($this->keys[$memberCount][$i] == $keyName){
-				return $this->values[$memberCount][$i];
-			}	
-		}
-	}
-	
-	/**
-	 * @deprecated
-	 */
-	function getXfromMemberAsString($memberCount,$geomCount){
-		$t = explode(",",$this->geometry[$memberCount][$geomCount]);
-		$x = array();
-		for($i=0; $i<(count($t)-1); $i=$i+2){
-			array_push($x,$t[$i]);
-		}
-		return implode(",",$x);
-	}
-	
-	/**
-	 * @deprecated
-	 */
-	function getYfromMemberAsString($memberCount,$geomCount){
-		$t = explode(",",$this->geometry[$memberCount][$geomCount]);
-		$y = array();
-		for($i=1; $i<=(count($t)-1); $i=$i+2){
-			array_push($y,$t[$i]);
-		}
-		return implode(",",$y);
-	}
-	
-	/**
-	 * @deprecated
-	 */
-	function getGeometriesFromMember($memberCount){
-		return $this->geometry[$memberCount];	
-	}
-	
-	/**
-	 * @deprecated
-	 */
-	function getGeometryTypeFromMember($memberCount){
-		return 	$this->geomtype[$memberCount];
-	}
-
-	/**
-	 * @deprecated
-	 */
-	function exportGeometriesToJS ($isInFrame) {
-		$prefix = "";
-		if ($isInFrame == true) {
-			$prefix = "parent.";
-		}
-		$js = "";
-		$js .= "var geom = new ".$prefix."GeometryArray();\n";
-		for ($i=0; $i<count($this->geometry); $i++) {
-			$js .= $this->exportMemberToJS($i, $isInFrame);
-			$js .= "geom.addCopy(q);\n";
-		}
-		return $js;
-	}
-	
-	/**
-	 * @deprecated
-	 */
-	function exportMemberToJS ($i, $isInFrame) {
-		$prefix = "";
-		if ($isInFrame == true) {
-			$prefix = "parent.";
-		}
-		$js = "";
-		if ($this->getGeometryTypeFromMember($i) == $this->geomtype_point) {
-			$js .= "var current_geomtype = ".$prefix."geomType.point;\n";
-		}
-		elseif ($this->getGeometryTypeFromMember($i) == $this->geomtype_line || $this->getGeometryTypeFromMember($i) == $this->geomtype_multiline) {
-			$js .= "var current_geomtype = ".$prefix."geomType.line;\n";
-		}
-		elseif ($this->getGeometryTypeFromMember($i) == $this->geomtype_polygon || $this->getGeometryTypeFromMember($i) == $this->geomtype_multipolygon) {
-			$js .= "var current_geomtype = ".$prefix."geomType.polygon;\n";
-		}
-		else die("unknown geometry type: '".$this->getGeometryTypeFromMember($i)."'");
-		
-		$js .= "var q = new ".$prefix."MultiGeometry(current_geomtype);\n";
-		
-		for ($j=0; $j<count($this->geometry[$i]); $j++) {
-			$js .= "q.addGeometry(current_geomtype);\n";
-			
-			$x_array = explode(",", $this->getXfromMemberAsString($i, $j));
-			$y_array = explode(",", $this->getYfromMemberAsString($i, $j));
-			
-			for ($k=0; $k<count($x_array); $k++) {
-				$js .= "q.get(-1).addPointByCoordinates(parseFloat(".$x_array[$k]."), parseFloat(".$y_array[$k]."));\n";
-				//$js .= "alert(parseFloat(".$x_array[$k]."), parseFloat(".$y_array[$k]."));";
-			}
-			$js .= "q.get(-1).close();\n";
-		}
-//		$js .= "alert(q);\n";
-		return $js;
-	}
-
-}
-
-
-
-
-class FeatureCollection {
-	var $type = "FeatureCollection";
-	var $featureArray = array();
-	
-	public function __construct() {
-		
-	}
-	
-	public function addFeature ($aFeature) {
-		array_push($this->featureArray, $aFeature);
-	}
-	
-	public function toGeoJSON () {
-		$str = "";
-		$len = count($this->featureArray); 
-		if ($len > 0) {
-			$str .= "{\"type\": \"FeatureCollection\", \"features\": [";
-			for ($i=0; $i < $len; $i++) {
-				if ($i > 0) {
-					$str .= ",";
-				}	
-				$str .= $this->featureArray[$i]->toGeoJSON();
-			}
-			$str .= "]}";
-		}
-		return $str;
-	}
-}
-
-class Feature {
-	var $type = "Feature";
-	var $fid;
-	var $geometry = false;
-	var $properties = array();
-	
-	public function __construct() {
-	}
-	
-	function sepNameSpace($s){
-		list($ns,$FeaturePropertyName) = split(":",$s);
-		$nodeName = array('ns' => $ns, 'value' => $FeaturePropertyName);
-		return $nodeName;
-	}
-	
-	/**
-	 * Parses the feature segment of a GML and stores the geometry in the
-	 * $geometry variable of the class.
-	 * 	
-	 * Example of a feature segment of a GML. 
-	 * 	<gml:featureMember>
-	 * 		<ms:ROUTE fid="ROUTE.228168">
-	 * 			<gml:boundedBy>
-	 * 				<gml:Box srsName="EPSG:31466">
-	 * 					<gml:coordinates>2557381.0,5562371.1 2557653.7,5562526.0</gml:coordinates>
-	 * 				</gml:Box>
-	 * 			</gml:boundedBy>
-	 * 			<ms:geometry>
-	 * 				<gml:LineString>
-	 * 					<gml:coordinates>
-	 * 						2557380.97,5562526 2557390.96,
-	 * 						5562523.22 2557404.03,5562518.2 2557422.31,
-	 * 						5562512 2557437.16,5562508.37 2557441.79,
-	 * 						5562507.49 2557454.31,5562505.1 2557464.27,
-	 * 						5562503.97 2557473.24,5562502.97 2557491.67,
-	 * 						5562502.12 2557505.65,5562502.43 2557513.78,
-	 * 						5562501.12 2557520.89,5562498.79 2557528.5,
-	 * 						5562495.07 2557538.9,5562488.91 2557549.5,
-	 * 						5562483.83 2557558.55,5562476.61 2557569.07,
-	 * 						5562469.82 2557576.61,5562462.72 2557582.75,
-	 * 						5562457.92 2557588.57,5562452.56 2557590.38,
-	 * 						5562449.69 2557593.57,5562445.07 2557596.17,
-	 * 						5562441.31 2557601.71,5562433.93 2557612.97,
-	 * 						5562421.03 2557626,5562405.33 2557639.66,
-	 * 						5562389.75 2557653.69,5562371.12 
-	 * 					</gml:coordinates>
-	 * 				</gml:LineString>
-	 * 			</ms:geometry>
-	 * 			<code>354</code>
-	 * 			<Verkehr>0</Verkehr>
-	 * 			<rlp>t</rlp>
-	 * 		</ms:ROUTE>
-	 * 	</gml:featureMember>
-	 * 
-	 * @return void
-	 * @param $domNode DOMNodeObject the feature tag of the GML 
-	 * 								(<gml:featureMember> in the above example)
-	 */
-	public function parse($domNode) {
-		$currentSibling = $domNode->firstChild;
-		
-		$this->fid = $currentSibling->getAttribute("fid");
-		
-		$currentSibling = $currentSibling->firstChild;
-		
-		while ($currentSibling) {
-		
-			$name = $currentSibling->nodeName;
-			$value = $currentSibling->nodeValue;
-			
-			$namespace = $this->sepNameSpace($name);
-			$ns = $namespace['ns'];
-			$columnName = $namespace['value'];
-			
-			// check if this node is a geometry node.
-			// however, even if it is a property node, 
-			// it has a child node, the text node!
-			// So we might need to do something more 
-			// sophisticated here...
-			if ($currentSibling->hasChildNodes()){
-				$geomNode = $currentSibling->firstChild; 
-					$geomType = $geomNode->nodeName;
-					switch ($geomType) {
-						case "gml:Polygon" :
-							$this->geometry = new GMLPolygon();
-							$this->geometry->parsePolygon($geomNode);
-							break;
-						case "gml:LineString" :
-							$this->geometry = new GMLLine();
-							$this->geometry->parseLine($geomNode);
-							break;
-						case "gml:Point" :
-							$this->geometry = new GMLPoint();
-							$this->geometry->parsePoint($geomNode);
-							break;
-						case "gml:MultiLineString" :
-							$this->geometry = new GMLMultiLine();
-							$this->geometry->parseMultiLine($geomNode);
-							break;
-						case "gml:MultiPolygon" :
-							$this->geometry = new GMLMultiPolygon();
-							$this->geometry->parseMultiPolygon($geomNode);
-							break;
-						default:
-							$this->properties[$columnName] = $value;
-							break;
-					}
-			} 
-			else {
-				$this->properties[$columnName] = $value;
-			}
-			
-			$currentSibling = $currentSibling->nextSibling;
-		}
-	}
-
-	public function toGeoJSON () {
-		$str = "";
-		$str .= "{\"type\":\"Feature\", \"id\":\"".$this->fid."\", \"geometry\": ";
-		if ($this->geometry) {
-			$str .= $this->geometry->toGeoJSON();
-		}
-		else {
-			$str .= "\"\"";
-		}
-
-		
-		$prop = array();
-		
-		$str .= ", \"properties\": ";
-		$cnt = 0;
-		foreach ($this->properties as $key => $value) {
-				$prop[$key] = $value;
-				$cnt ++;
-		}
-
-		$json = new Mapbender_JSON();
-		$str .= $json->encode($prop); 
-		$str .= "}";
-		
-		return $str;
-	}
-}
-
-class GMLLine {
-
-	var $pointArray = array();
-
-	public function __construct() {
-		
-	}
-
-	public function parseLine ($domNode) {
-		$currentSibling = $domNode->firstChild;
-		while ($currentSibling) {
-			
-			foreach(explode(' ',$currentSibling->nodeValue) as $cords){
-				list($x,$y,$z) = explode(',',$cords);
-				$this->addPoint($x, $y);
-			}
-			$currentSibling = $currentSibling->nextSibling;
-		}
-	}
-	
-	private function addPoint ($x, $y) {
-		array_push($this->pointArray, array("x" => $x, "y" => $y));
-	}
-	
-	public function toGeoJSON () {
-		$numberOfPoints = count($this->pointArray);
-		$str = "";
-		if ($numberOfPoints > 0) {
-			$str .= "{\"type\": \"LineString\", \"coordinates\":[";
-			for ($i=0; $i < $numberOfPoints; $i++) {
-				if ($i > 0) {
-					$str .= ",";
-				}
-				$str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"]."]";
-			}
-			$str .= "]}";
-		}
-		else {
-			$e = new mb_exception("GMLLine: toGeoJSON: this point is null.");
-		}
-		return $str;
-	}
-}
-
-class GMLPoint {
-
-	var $point;
-
-	public function __construct() {
-		
-	}
-
-	public function parsePoint ($domNode) {
-		$currentSibling = $domNode->firstChild;
-		while ($currentSibling) {
-			list($x, $y, $z) = explode(",", $currentSibling->nodeValue);
-			$this->setPoint($x, $y);
-			$currentSibling = $currentSibling->nextSibling;
-		}
-	}
-	
-	private function setPoint ($x, $y) {
-#		echo "x: " . $x . " y: " . $y . "\n";
-		$this->point = array("x" => $x, "y" => $y);
-	}
-	
-	public function toGeoJSON () {
-		$str = "";
-		if ($this->point) {
-			$str .= "{\"type\": \"Point\", \"coordinates\":";
-			$str .= "[".$this->point["x"].",".$this->point["y"]."]";
-			$str .= "}";
-		}
-		else {
-			$e = new mb_exception("GMLPoint: toGeoJSON: this point is null.");
-		}
-		return $str;
-	}
-}
-
-class GMLPolygon {
-
-	var $pointArray = array();
-
-	public function __construct() {
-		
-	}
-
-	public function parsePolygon ($domNode) {
-		$simpleXMLNode = simplexml_import_dom($domNode);
-
-		$simpleXMLNode->registerXPathNamespace('gml', 'http://www.opengis.net/gml');
-		
-		$allCoords = $simpleXMLNode->xpath("gml:outerBoundaryIs/gml:LinearRing/gml:coordinates");
-			
-		$cnt=0;
-		foreach ($allCoords as $Coords) {
-			$coordsDom = dom_import_simplexml($Coords);
-				
-//			$name = $coordsDom->nodeName;
-//			$value = $coordsDom->nodeValue;				
-//			echo "===> name: ".$name. ", Value: ".$value."<br>";
-			
-			foreach(explode(' ',$coordsDom->nodeValue) as $pointCoords){
-
-				list($x,$y,$z) = explode(',',$pointCoords);
-				$this->addPoint($x, $y);
-				}
-			
-			$cnt++;
-		}
-		
-		
-	}
-	
-	private function addPoint ($x, $y) {
-		array_push($this->pointArray, array("x" => $x, "y" => $y));
-	}
-	
-	public function toGeoJSON () {
-		$numberOfPoints = count($this->pointArray);
-		$str = "";
-		if ($numberOfPoints > 0) {
-			$str .= "{\"type\": \"Polygon\", \"coordinates\":[[";
-			for ($i=0; $i < $numberOfPoints; $i++) {
-				if ($i > 0) {
-					$str .= ",";
-				}
-				$str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"]."]";
-			}
-			$str .= "]]}";
-		}
-		else {
-			$e = new mb_exception("GMLPolygon: toGeoJSON: this point is null.");
-		}
-		return $str;
-	}
-}
-
-class GMLMultiLine {
-
-	var $lineArray = array();
-
-	public function __construct() {
-		
-	}
-
-	public function parseMultiLine ($domNode) {
-		$simpleXMLNode = simplexml_import_dom($domNode);
-
-		$simpleXMLNode->registerXPathNamespace('gml', 'http://www.opengis.net/gml');
-		
-		$allCoords = $simpleXMLNode->xpath("gml:lineStringMember/gml:LineString/gml:coordinates");
-			
-		$cnt=0;
-		foreach ($allCoords as $Coords) {
-			
-			$this->lineArray[$cnt] = array();
-			
-			$coordsDom = dom_import_simplexml($Coords);
-				
-//			$name = $coordsDom->nodeName;
-//			$value = $coordsDom->nodeValue;				
-//			echo "===> name: ".$name. ", Value: ".$value."<br>";
-			
-			foreach(explode(' ',$coordsDom->nodeValue) as $pointCoords){
-				list($x,$y,$z) = explode(',',$pointCoords);
-				$this->addPoint($x, $y, $cnt);
-				}
-			
-			$cnt++;
-		}
-		
-	}
-	
-	private function addPoint ($x, $y, $i) {
-
-		array_push($this->lineArray[$i], array("x" => $x, "y" => $y));
-	}
-	
-	public function toGeoJSON () {
-		$numberlineArray = count($this->lineArray);
-		$str = "";
-		if ($numberlineArray > 0) {
-			$str .= "{\"type\": \"MultiLineString\", \"coordinates\":[";
-			
-			for ($cnt =0; $cnt < $numberlineArray; $cnt++){
-				if ($cnt > 0) {
-						$str .= ",";
-					}
-					$str .="[";
-			
-				for ($i=0; $i < count($this->lineArray[$cnt]); $i++) {
-					if ($i > 0) {
-						$str .= ",";
-					}
-					$str .= "[".$this->lineArray[$cnt][$i]["x"].",".$this->lineArray[$cnt][$i]["y"]."]";
-				}
-				$str .="]";
-			}
-			$str .= "]}";
-			
-		}
-		else {
-			$e = new mb_exception("GMLMultiLine: toGeoJSON: this multiLine is null.");
-		}
-		return $str;
-	}
-}
-
-class GMLMultiPolygon {
-
-	var $polygonArray = array();
-
-	public function __construct() {
-		
-	}
-
-	public function parseMultiPolygon ($domNode) {
-//		echo $domNode->nodeName."<br>";
-		$simpleXMLNode = simplexml_import_dom($domNode);
-
-		$simpleXMLNode->registerXPathNamespace('gml', 'http://www.opengis.net/gml');
-
-		$allCoords = $simpleXMLNode->xpath("gml:polygonMember/gml:Polygon/gml:outerBoundaryIs/gml:LinearRing/gml:coordinates");
-			
-		$cnt=0;
-		foreach ($allCoords as $Coords) {
-			
-			$this->polygonArray[$cnt] = array();
-			
-			$coordsDom = dom_import_simplexml($Coords);
-				
-//			$name = $coordsDom->nodeName;
-//			$value = $coordsDom->nodeValue;				
-//			echo "===> name: ".$name. ", Value: ".$value."<br>";
-
-			foreach(explode(' ',$coordsDom->nodeValue) as $pointCoords){
-				list($x,$y,$z) = explode(',',$pointCoords);
-				$this->addPoint($x, $y, $cnt);
-				}
-			
-			$cnt++;
-		}
-		
-	}
-	
-	private function addPoint ($x, $y, $i) {
-
-		array_push($this->polygonArray[$i], array("x" => $x, "y" => $y));
-	}
-	
-	public function toGeoJSON () {
-		$numberPolygonArray = count($this->polygonArray);
-		$str = "";
-		if ($numberPolygonArray > 0) {
-			$str .= "{\"type\": \"MultiPolygon\", \"coordinates\":[";
-			
-			for ($cnt =0; $cnt < $numberPolygonArray; $cnt++){
-				if ($cnt > 0) {
-						$str .= ",";
-					}
-					$str .="[";
-			
-				for ($i=0; $i < count($this->polygonArray[$cnt]); $i++) {
-					if ($i > 0) {
-						$str .= ",";
-					}
-					$str .= "[".$this->polygonArray[$cnt][$i]["x"].",".$this->polygonArray[$cnt][$i]["y"]."]";
-				}
-				$str .="]";
-			}
-			$str .= "]}";
-			
-		}
-		else {
-			$e = new mb_exception("GMLMultiPolygon: toGeoJSON: this multiLine is null.");
-		}
-		return $str;
-	}
-}
-?>
+<?php
+# $Id: class_gml2.php 2897 2008-08-29 10:29:30Z verenadiewald $
+# http://www.mapbender.org/index.php/class_gml2.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__)."/../../core/globalSettings.php");
+
+require_once(dirname(__FILE__)."/../classes/class_connector.php");
+require_once(dirname(__FILE__)."/../classes/class_json.php");
+
+class gml2 {
+	var $geomtype_point = 'Point';					
+	var $geomtype_polygon = 'Polygon';
+	var $geomtype_line = 'LineString';
+	var $geomtype_multipolygon = 'MultiPolygon'; 
+	var $geomtype_multiline = 'MultiLine';
+	var $geometries = array();	
+	var $member = -1;
+	var $geomtype = array();	
+	var $keys = array();
+	var $values = array();
+	var $geometry = array();
+	var $bbox = array();
+	var $doc;
+	
+	
+	function gml2(){
+		$this->geometries = array($this->geomtype_point, $this->geomtype_polygon, $this->geomtype_line, $this->geomtype_multipolygon, $this->geomtype_multiline);
+	}
+	function getGml($req){
+		$x = new connector($req);
+		return $x->file;
+	}
+
+	function parseFile($req){
+		#$data = implode("",file($req));
+		$x = new connector($req);
+		$data = $x->file;
+		$data = $this->removeWhiteSpace($data);
+		$this->parseXML($data);		
+		#$e = new mb_exception("data = ".$data); 		
+	}
+	
+	function parseXML($data) {
+		
+		$this->doc = $data;
+		return $this->toGeoJSON();
+	}
+
+	function removeWhiteSpace ($string) {
+		return preg_replace("/\>(\s)+\</", "><", trim($string));
+	}
+	
+	function sepNameSpace($s){
+		$c = mb_strpos($s,":"); 
+		if($c>0){
+			return mb_substr($s,$c+1);
+		}
+		else{
+			return $s;
+		}		
+	}
+	
+	function toGeoJSON () {
+		$gmlDoc = new SimpleXMLElement($this->doc);
+		
+		$gmlDoc->registerXPathNamespace('xls', 'http://www.opengis.net/xls');
+		$gmlDoc->registerXPathNamespace('gml', 'http://www.opengis.net/gml');
+		
+		// build feature collection
+		$featureCollection = new FeatureCollection();
+		
+		// segments of the featzreCollection
+		$gmlFeatureMembers = $gmlDoc->xpath("//gml:featureMember");
+		
+		if(count($gmlFeatureMembers)>0){
+			$cnt=0;
+			foreach ($gmlFeatureMembers as $gmlFeatureMember) {
+				$featureMember_dom = dom_import_simplexml($gmlFeatureMember);
+				
+				$feature = new Feature();
+				$feature->parse($featureMember_dom);
+				if (isset($feature->geometry)) {
+					$featureCollection->addFeature($feature);
+				}
+				$cnt++;
+			}
+			
+			return $featureCollection->toGeoJSON();
+		}
+		else{
+			return "{'errorMessage':'Kein Ergebnis'}";
+		}
+	}
+
+	
+	/**
+	 * Exports the file to SHP.
+	 * 
+	 * @param string $filenamePrefix the filename without an ending like .shp
+	 */
+	function toShape ($filenamePrefix) {
+		$unique = TMPDIR . "/" . $filenamePrefix;
+		$fShape = $unique.".shp";
+		$fGml = $unique.".gml";
+//		$pathOgr = '/appserver/postgresql/templates/postgresql824/bin/ogr2ogr';
+		$pathOgr = '/usr/bin/ogr2ogr';
+		$w = $this->toFile($fGml);
+
+ 		$exec = $pathOgr.' -f "ESRI Shapefile" "'.$fShape.'" '.$fGml;
+ 		exec($exec);
+ 		
+ 		$exec = 'zip -j '.$unique.' '.$unique.'.shp '.$unique.'.dbf '.$unique.'.shx '.$unique.'.gfs '.$unique.'.gml ';
+ 		exec($exec);
+
+		$exec = 'rm -f '.$unique.' '.$unique.'.shp '.$unique.'.dbf '.$unique.'.shx '.$unique.'.gfs '.$unique.'.gml';
+		exec($exec);
+		
+		$exec = 'chmod 777 '.$unique.'.*';
+		exec($exec);
+		//echo "<a href='../tmp/".$unique.".zip'>Download ".$prefix."<a>";
+	}
+	
+	/**
+	 * Writes a file containing the GML.
+	 * 
+	 * @param string $path the path to the file.
+	 * @param string $path the path to the file.
+	 * @return bool true if the file could be saved; else false.
+	 */
+	function toFile ($file) {
+		$handle = fopen($file, "w");
+		if (!$handle) {
+			$e = new mb_exception("class_gml2.php: Filehandler error (" . $file . ").");
+			return false;
+		}
+		if (!fwrite($handle,$this->__toString())) {
+			$e = new mb_exception("class_gml2.php: Could not write file (" . $file . ").");
+			fclose($handle);
+			return false;
+		}
+		fclose($handle);
+		return true;
+	}
+	
+	function __toString () {
+		return $this->doc;
+	}
+
+
+
+	/**
+	 * @deprecated
+	 */
+	function parsegml($req){
+		#$data = implode("",file($req));
+		$x = new connector($req);
+		$this->parse_xml($x->file);		 		
+	}
+
+	/**
+	 * @deprecated
+	 */
+	function parse_xml($data){
+
+
+		$this->doc = $data;
+
+		$section = false;
+		$geom = false;
+		$boundedBy = false;
+		$coordinates = false;
+		$el = -1;
+		$parser = xml_parser_create(CHARSET);
+		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,$data,$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);
+		
+		foreach ($values as $element) {
+			#$e = new mb_exception($element[tag]);
+			if(strtoupper($this->sepNameSpace($element[tag])) == strtoupper("boundedBy") && $element[type] == "open"){
+				$boundedBy = true;
+			}
+			if ($boundedBy) {
+				if(strtoupper($this->sepNameSpace($element[tag])) == strtoupper("coordinates")){
+					$this->bbox = explode(",", str_replace(",,","",str_replace(" ",",",trim($element[value]))));
+					$boundedBy=false;
+				}
+			}
+			if(strtoupper($this->sepNameSpace($element[tag])) == strtoupper("featureMember") && $element[type] == "open"){
+				$this->member++;
+				$this->keys[$this->member] = array();
+				$this->value[$this->member] = array();
+				$this->geometry[$this->member] = array();
+				$section = true;
+				$cnt_geom = 0;
+			}
+			if($section == true){
+				if( in_array($this->sepNameSpace($element[tag]),$this->geometries) && $element[type] == "open"){
+					$geom = true;
+					$this->geomtype[$this->member] = $this->sepNameSpace($element[tag]);
+				}
+				else if(in_array($this->sepNameSpace($element[tag]),$this->geometries) && $element[type] == "close"){
+					$cnt_geom++;
+					$geom = false;
+				}
+				if($geom == true){
+					if (strtoupper($this->sepNameSpace($element[tag])) == strtoupper("coordinates")) {
+						$this->geometry[$this->member][$cnt_geom] =  str_replace(",,","",str_replace(" ",",",trim($element[value])));
+						$coordinates = true;
+						// XXX: Increment counter to get all geometries of a feature member, 
+						// comment it out to only show first geometry of featuremember
+						$cnt_geom++;
+					}
+					else if (!$coordinates && trim($element[value])) {
+						$coords = str_replace(",,","",str_replace(" ",",",trim($element[value])));
+						$tmp_array = explode(",", $coords);
+						if (count($tmp_array > 1)) {
+							$this->geometry[$this->member][$cnt_geom] =  $coords;
+							$coordinates = true;
+						   // XXX: Increment counter to get all geometries of a feature member, 
+						   // comment it out to only show first geometry of featuremember
+							$cnt_geom++;
+						}
+					}
+				}
+				else if(strtoupper($this->sepNameSpace($element[tag])) == strtoupper("featureMember") && $element[type] == "close"){
+					$section = false;	
+					$el = -1;
+				}
+				else{
+					$el++;
+					$this->values[$this->member][$el] = $element[value];
+					$this->keys[$this->member][$el] = $element[tag];	
+				}
+			}
+		}
+	}	
+
+	/**
+	 * @deprecated
+	 */
+	function getMemberCount(){
+		return ($this->member+1);	
+	}
+	
+	/**
+	 * @deprecated
+	 */
+	function getValueBySeparatedKey($memberCount,$keyName){
+		for($i=0; $i<count($this->keys[$memberCount]); $i++){
+			if($this->sepNameSpace($this->keys[$memberCount][$i]) == $keyName){
+				return $this->values[$memberCount][$i];
+			}	
+		}
+	}
+	
+	/**
+	 * @deprecated
+	 */
+	function getValueByKey($memberCount,$keyName){
+		for($i=0; $i<count($this->keys[$memberCount]); $i++){
+			if($this->keys[$memberCount][$i] == $keyName){
+				return $this->values[$memberCount][$i];
+			}	
+		}
+	}
+	
+	/**
+	 * @deprecated
+	 */
+	function getXfromMemberAsString($memberCount,$geomCount){
+		$t = explode(",",$this->geometry[$memberCount][$geomCount]);
+		$x = array();
+		for($i=0; $i<(count($t)-1); $i=$i+2){
+			array_push($x,$t[$i]);
+		}
+		return implode(",",$x);
+	}
+	
+	/**
+	 * @deprecated
+	 */
+	function getYfromMemberAsString($memberCount,$geomCount){
+		$t = explode(",",$this->geometry[$memberCount][$geomCount]);
+		$y = array();
+		for($i=1; $i<=(count($t)-1); $i=$i+2){
+			array_push($y,$t[$i]);
+		}
+		return implode(",",$y);
+	}
+	
+	/**
+	 * @deprecated
+	 */
+	function getGeometriesFromMember($memberCount){
+		return $this->geometry[$memberCount];	
+	}
+	
+	/**
+	 * @deprecated
+	 */
+	function getGeometryTypeFromMember($memberCount){
+		return 	$this->geomtype[$memberCount];
+	}
+
+	/**
+	 * @deprecated
+	 */
+	function exportGeometriesToJS ($isInFrame) {
+		$prefix = "";
+		if ($isInFrame == true) {
+			$prefix = "parent.";
+		}
+		$js = "";
+		$js .= "var geom = new ".$prefix."GeometryArray();\n";
+		for ($i=0; $i<count($this->geometry); $i++) {
+			$js .= $this->exportMemberToJS($i, $isInFrame);
+			$js .= "geom.addCopy(q);\n";
+		}
+		return $js;
+	}
+	
+	/**
+	 * @deprecated
+	 */
+	function exportMemberToJS ($i, $isInFrame) {
+		$prefix = "";
+		if ($isInFrame == true) {
+			$prefix = "parent.";
+		}
+		$js = "";
+		if ($this->getGeometryTypeFromMember($i) == $this->geomtype_point) {
+			$js .= "var current_geomtype = ".$prefix."geomType.point;\n";
+		}
+		elseif ($this->getGeometryTypeFromMember($i) == $this->geomtype_line || $this->getGeometryTypeFromMember($i) == $this->geomtype_multiline) {
+			$js .= "var current_geomtype = ".$prefix."geomType.line;\n";
+		}
+		elseif ($this->getGeometryTypeFromMember($i) == $this->geomtype_polygon || $this->getGeometryTypeFromMember($i) == $this->geomtype_multipolygon) {
+			$js .= "var current_geomtype = ".$prefix."geomType.polygon;\n";
+		}
+		else{
+			$e = new mb_notice("unknown geometry type: '".$this->getGeometryTypeFromMember($i)."' or no geometry existing");
+			return "";
+		}	
+		
+		$js .= "var q = new ".$prefix."MultiGeometry(current_geomtype);\n";
+		
+		for ($j=0; $j<count($this->geometry[$i]); $j++) {
+			$js .= "q.addGeometry(current_geomtype);\n";
+			
+			$x_array = explode(",", $this->getXfromMemberAsString($i, $j));
+			$y_array = explode(",", $this->getYfromMemberAsString($i, $j));
+			
+			for ($k=0; $k<count($x_array); $k++) {
+				$js .= "q.get(-1).addPointByCoordinates(parseFloat(".$x_array[$k]."), parseFloat(".$y_array[$k]."));\n";
+				//$js .= "alert(parseFloat(".$x_array[$k]."), parseFloat(".$y_array[$k]."));";
+			}
+			$js .= "q.get(-1).close();\n";
+		}
+//		$js .= "alert(q);\n";
+		return $js;
+	}
+
+}
+
+
+
+
+class FeatureCollection {
+	var $type = "FeatureCollection";
+	var $featureArray = array();
+	
+	public function __construct() {
+		
+	}
+	
+	public function addFeature ($aFeature) {
+		array_push($this->featureArray, $aFeature);
+	}
+	
+	public function toGeoJSON () {
+		$str = "";
+		$len = count($this->featureArray); 
+		if ($len > 0) {
+			$str .= "{\"type\": \"FeatureCollection\", \"features\": [";
+			for ($i=0; $i < $len; $i++) {
+				if ($i > 0) {
+					$str .= ",";
+				}	
+				$str .= $this->featureArray[$i]->toGeoJSON();
+			}
+			$str .= "]}";
+		}
+		return $str;
+	}
+}
+
+class Feature {
+	var $type = "Feature";
+	var $fid;
+	var $geometry = false;
+	var $properties = array();
+	
+	public function __construct() {
+	}
+	
+	function sepNameSpace($s){
+		list($ns,$FeaturePropertyName) = split(":",$s);
+		$nodeName = array('ns' => $ns, 'value' => $FeaturePropertyName);
+		return $nodeName;
+	}
+	
+	/**
+	 * Parses the feature segment of a GML and stores the geometry in the
+	 * $geometry variable of the class.
+	 * 	
+	 * Example of a feature segment of a GML. 
+	 * 	<gml:featureMember>
+	 * 		<ms:ROUTE fid="ROUTE.228168">
+	 * 			<gml:boundedBy>
+	 * 				<gml:Box srsName="EPSG:31466">
+	 * 					<gml:coordinates>2557381.0,5562371.1 2557653.7,5562526.0</gml:coordinates>
+	 * 				</gml:Box>
+	 * 			</gml:boundedBy>
+	 * 			<ms:geometry>
+	 * 				<gml:LineString>
+	 * 					<gml:coordinates>
+	 * 						2557380.97,5562526 2557390.96,
+	 * 						5562523.22 2557404.03,5562518.2 2557422.31,
+	 * 						5562512 2557437.16,5562508.37 2557441.79,
+	 * 						5562507.49 2557454.31,5562505.1 2557464.27,
+	 * 						5562503.97 2557473.24,5562502.97 2557491.67,
+	 * 						5562502.12 2557505.65,5562502.43 2557513.78,
+	 * 						5562501.12 2557520.89,5562498.79 2557528.5,
+	 * 						5562495.07 2557538.9,5562488.91 2557549.5,
+	 * 						5562483.83 2557558.55,5562476.61 2557569.07,
+	 * 						5562469.82 2557576.61,5562462.72 2557582.75,
+	 * 						5562457.92 2557588.57,5562452.56 2557590.38,
+	 * 						5562449.69 2557593.57,5562445.07 2557596.17,
+	 * 						5562441.31 2557601.71,5562433.93 2557612.97,
+	 * 						5562421.03 2557626,5562405.33 2557639.66,
+	 * 						5562389.75 2557653.69,5562371.12 
+	 * 					</gml:coordinates>
+	 * 				</gml:LineString>
+	 * 			</ms:geometry>
+	 * 			<code>354</code>
+	 * 			<Verkehr>0</Verkehr>
+	 * 			<rlp>t</rlp>
+	 * 		</ms:ROUTE>
+	 * 	</gml:featureMember>
+	 * 
+	 * @return void
+	 * @param $domNode DOMNodeObject the feature tag of the GML 
+	 * 								(<gml:featureMember> in the above example)
+	 */
+	public function parse($domNode) {
+		$currentSibling = $domNode->firstChild;
+		
+		$this->fid = $currentSibling->getAttribute("fid");
+		
+		$currentSibling = $currentSibling->firstChild;
+		
+		while ($currentSibling) {
+		
+			$name = $currentSibling->nodeName;
+			$value = $currentSibling->nodeValue;
+			
+			$namespace = $this->sepNameSpace($name);
+			$ns = $namespace['ns'];
+			$columnName = $namespace['value'];
+			
+			// check if this node is a geometry node.
+			// however, even if it is a property node, 
+			// it has a child node, the text node!
+			// So we might need to do something more 
+			// sophisticated here...
+			if ($currentSibling->hasChildNodes()){
+				$geomNode = $currentSibling->firstChild; 
+					$geomType = $geomNode->nodeName;
+					switch ($geomType) {
+						case "gml:Polygon" :
+							$this->geometry = new GMLPolygon();
+							$this->geometry->parsePolygon($geomNode);
+							break;
+						case "gml:LineString" :
+							$this->geometry = new GMLLine();
+							$this->geometry->parseLine($geomNode);
+							break;
+						case "gml:Point" :
+							$this->geometry = new GMLPoint();
+							$this->geometry->parsePoint($geomNode);
+							break;
+						case "gml:MultiLineString" :
+							$this->geometry = new GMLMultiLine();
+							$this->geometry->parseMultiLine($geomNode);
+							break;
+						case "gml:MultiPolygon" :
+							$this->geometry = new GMLMultiPolygon();
+							$this->geometry->parseMultiPolygon($geomNode);
+							break;
+						default:
+							$this->properties[$columnName] = $value;
+							break;
+					}
+			} 
+			else {
+				$this->properties[$columnName] = $value;
+			}
+			
+			$currentSibling = $currentSibling->nextSibling;
+		}
+	}
+	
+	public function toGeoJSON () {
+		$str = "";
+		$str .= "{\"type\":\"Feature\", \"id\":\"".$this->fid."\", \"geometry\": ";
+		if ($this->geometry) {
+			$str .= $this->geometry->toGeoJSON();
+		}
+		else {
+			$str .= "\"\"";
+		}
+
+		
+		$prop = array();
+		
+		$str .= ", \"properties\": ";
+		$cnt = 0;
+		foreach ($this->properties as $key => $value) {
+				$prop[$key] = $value;
+				$cnt ++;
+		}
+
+		$json = new Mapbender_JSON();
+		$str .= $json->encode($prop); 
+		$str .= "}";
+		
+		return $str;
+	}
+}
+
+class GMLLine {
+
+	var $pointArray = array();
+
+	public function __construct() {
+		
+	}
+
+	public function parseLine ($domNode) {
+		$currentSibling = $domNode->firstChild;
+		while ($currentSibling) {
+			
+			foreach(explode(' ',$currentSibling->nodeValue) as $cords){
+				list($x,$y,$z) = explode(',',$cords);
+				$this->addPoint($x, $y);
+			}
+			$currentSibling = $currentSibling->nextSibling;
+		}
+	}
+	
+	private function addPoint ($x, $y) {
+		array_push($this->pointArray, array("x" => $x, "y" => $y));
+	}
+	
+	public function toGeoJSON () {
+		$numberOfPoints = count($this->pointArray);
+		$str = "";
+		if ($numberOfPoints > 0) {
+			$str .= "{\"type\": \"LineString\", \"coordinates\":[";
+			for ($i=0; $i < $numberOfPoints; $i++) {
+				if ($i > 0) {
+					$str .= ",";
+				}
+				$str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"]."]";
+			}
+			$str .= "]}";
+		}
+		else {
+			$e = new mb_exception("GMLLine: toGeoJSON: this point is null.");
+		}
+		return $str;
+	}
+}
+
+class GMLPoint {
+
+	var $point;
+
+	public function __construct() {
+		
+	}
+
+	public function parsePoint ($domNode) {
+		$currentSibling = $domNode->firstChild;
+		while ($currentSibling) {
+			list($x, $y, $z) = explode(",", $currentSibling->nodeValue);
+			$this->setPoint($x, $y);
+			$currentSibling = $currentSibling->nextSibling;
+		}
+	}
+	
+	private function setPoint ($x, $y) {
+#		echo "x: " . $x . " y: " . $y . "\n";
+		$this->point = array("x" => $x, "y" => $y);
+	}
+	
+	public function toGeoJSON () {
+		$str = "";
+		if ($this->point) {
+			$str .= "{\"type\": \"Point\", \"coordinates\":";
+			$str .= "[".$this->point["x"].",".$this->point["y"]."]";
+			$str .= "}";
+		}
+		else {
+			$e = new mb_exception("GMLPoint: toGeoJSON: this point is null.");
+		}
+		return $str;
+	}
+}
+
+class GMLPolygon {
+
+	var $pointArray = array();
+
+	public function __construct() {
+		
+	}
+
+	public function parsePolygon ($domNode) {
+		$simpleXMLNode = simplexml_import_dom($domNode);
+
+		$simpleXMLNode->registerXPathNamespace('gml', 'http://www.opengis.net/gml');
+		
+		$allCoords = $simpleXMLNode->xpath("gml:outerBoundaryIs/gml:LinearRing/gml:coordinates");
+			
+		$cnt=0;
+		foreach ($allCoords as $Coords) {
+			$coordsDom = dom_import_simplexml($Coords);
+				
+//			$name = $coordsDom->nodeName;
+//			$value = $coordsDom->nodeValue;				
+//			echo "===> name: ".$name. ", Value: ".$value."<br>";
+			
+			foreach(explode(' ',$coordsDom->nodeValue) as $pointCoords){
+
+				list($x,$y,$z) = explode(',',$pointCoords);
+				$this->addPoint($x, $y);
+				}
+			
+			$cnt++;
+		}
+		
+		
+	}
+	
+	private function addPoint ($x, $y) {
+		array_push($this->pointArray, array("x" => $x, "y" => $y));
+	}
+	
+	public function toGeoJSON () {
+		$numberOfPoints = count($this->pointArray);
+		$str = "";
+		if ($numberOfPoints > 0) {
+			$str .= "{\"type\": \"Polygon\", \"coordinates\":[[";
+			for ($i=0; $i < $numberOfPoints; $i++) {
+				if ($i > 0) {
+					$str .= ",";
+				}
+				$str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"]."]";
+			}
+			$str .= "]]}";
+		}
+		else {
+			$e = new mb_exception("GMLPolygon: toGeoJSON: this point is null.");
+		}
+		return $str;
+	}
+}
+
+class GMLMultiLine {
+
+	var $lineArray = array();
+
+	public function __construct() {
+		
+	}
+
+	public function parseMultiLine ($domNode) {
+		$simpleXMLNode = simplexml_import_dom($domNode);
+
+		$simpleXMLNode->registerXPathNamespace('gml', 'http://www.opengis.net/gml');
+		
+		$allCoords = $simpleXMLNode->xpath("gml:lineStringMember/gml:LineString/gml:coordinates");
+			
+		$cnt=0;
+		foreach ($allCoords as $Coords) {
+			
+			$this->lineArray[$cnt] = array();
+			
+			$coordsDom = dom_import_simplexml($Coords);
+				
+//			$name = $coordsDom->nodeName;
+//			$value = $coordsDom->nodeValue;				
+//			echo "===> name: ".$name. ", Value: ".$value."<br>";
+			
+			foreach(explode(' ',$coordsDom->nodeValue) as $pointCoords){
+				list($x,$y,$z) = explode(',',$pointCoords);
+				$this->addPoint($x, $y, $cnt);
+				}
+			
+			$cnt++;
+		}
+		
+	}
+	
+	private function addPoint ($x, $y, $i) {
+
+		array_push($this->lineArray[$i], array("x" => $x, "y" => $y));
+	}
+	
+	public function toGeoJSON () {
+		$numberlineArray = count($this->lineArray);
+		$str = "";
+		if ($numberlineArray > 0) {
+			$str .= "{\"type\": \"MultiLineString\", \"coordinates\":[";
+			
+			for ($cnt =0; $cnt < $numberlineArray; $cnt++){
+				if ($cnt > 0) {
+						$str .= ",";
+					}
+					$str .="[";
+			
+				for ($i=0; $i < count($this->lineArray[$cnt]); $i++) {
+					if ($i > 0) {
+						$str .= ",";
+					}
+					$str .= "[".$this->lineArray[$cnt][$i]["x"].",".$this->lineArray[$cnt][$i]["y"]."]";
+				}
+				$str .="]";
+			}
+			$str .= "]}";
+			
+		}
+		else {
+			$e = new mb_exception("GMLMultiLine: toGeoJSON: this multiLine is null.");
+		}
+		return $str;
+	}
+}
+
+class GMLMultiPolygon {
+
+	var $polygonArray = array();
+
+	public function __construct() {
+		
+	}
+
+	public function parseMultiPolygon ($domNode) {
+//		echo $domNode->nodeName."<br>";
+		$simpleXMLNode = simplexml_import_dom($domNode);
+
+		$simpleXMLNode->registerXPathNamespace('gml', 'http://www.opengis.net/gml');
+
+		$allCoords = $simpleXMLNode->xpath("gml:polygonMember/gml:Polygon/gml:outerBoundaryIs/gml:LinearRing/gml:coordinates");
+			
+		$cnt=0;
+		foreach ($allCoords as $Coords) {
+			
+			$this->polygonArray[$cnt] = array();
+			
+			$coordsDom = dom_import_simplexml($Coords);
+				
+//			$name = $coordsDom->nodeName;
+//			$value = $coordsDom->nodeValue;				
+//			echo "===> name: ".$name. ", Value: ".$value."<br>";
+
+			foreach(explode(' ',$coordsDom->nodeValue) as $pointCoords){
+				list($x,$y,$z) = explode(',',$pointCoords);
+				$this->addPoint($x, $y, $cnt);
+				}
+			
+			$cnt++;
+		}
+		
+	}
+	
+	private function addPoint ($x, $y, $i) {
+
+		array_push($this->polygonArray[$i], array("x" => $x, "y" => $y));
+	}
+	
+	public function toGeoJSON () {
+		$numberPolygonArray = count($this->polygonArray);
+		$str = "";
+		if ($numberPolygonArray > 0) {
+			$str .= "{\"type\": \"MultiPolygon\", \"coordinates\":[";
+			
+			for ($cnt =0; $cnt < $numberPolygonArray; $cnt++){
+				if ($cnt > 0) {
+						$str .= ",";
+					}
+					$str .="[";
+			
+				for ($i=0; $i < count($this->polygonArray[$cnt]); $i++) {
+					if ($i > 0) {
+						$str .= ",";
+					}
+					$str .= "[".$this->polygonArray[$cnt][$i]["x"].",".$this->polygonArray[$cnt][$i]["y"]."]";
+				}
+				$str .="]";
+			}
+			$str .= "]}";
+			
+		}
+		else {
+			$e = new mb_exception("GMLMultiPolygon: toGeoJSON: this multiLine is null.");
+		}
+		return $str;
+	}
+}
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_gui.php
===================================================================
--- branches/print_dev/http/classes/class_gui.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_gui.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -24,51 +24,9 @@
  */
 class gui {
 
-	var $id;
-	var $elementArray = array();
-	
-	public function __construct ($id) {
-		if ($id) {
-			$this->id = $id;
-			$this->elementArray = $this->selectElements();
-		}
+	public function __construct () {
 	}
 
-	public function selectElements () {
-		$sql = "SELECT e_id FROM gui_element WHERE fkey_gui_id = $1 " . 
-				"ORDER BY e_pos";
-		$v = array($this->id);
-		$t = array('s');
-		$res = db_prep_query($sql,$v,$t);
-		$elementArray = array();
-		while ($row = db_fetch_array($res)) {
-			array_push($elementArray, $row[0]);
-		}
-
-		$this->elementArray = array();
-		for ($i = 0; $i < count($elementArray); $i++) {
-			$currentElement = new Element();
-			$currentElement->select($elementArray[$i], $this->id);
-			array_push($this->elementArray, $currentElement);
-		}
-		return $this->elementArray;
-	}
-
-	public function toHtml () {
-		$htmlString = "";
-		$htmlString .= $this->elementsToHtml();
-		return $htmlString;
-	}
-
-	public function getJavaScriptModules () {
-		$jsArray = array();
-		for ($i = 0; $i < count($this->elementArray); $i++) {
-			$currentElement = $this->elementArray[$i];
-			array_merge($jsArray, $currentElement->getJavaScriptModules());			
-		}
-		return $jsArray;
-	}
-	
  	/**
  	 * Checks if a GUI with a given ID exists in the database
  	 * 
@@ -260,33 +218,5 @@
 	      return false;
 		}
 	}
-
-	private function elementsToHtml () {
-		$bodyStringArray = array();
-		$elementString = "";
-		for ($i = 0; $i < count($this->elementArray); $i++) {
-			$currentElement = $this->elementArray[$i];
-			if ($currentElement->id != "body") {
-				$elementString .= $currentElement->toHtml();
-			}
-			else {
-				$bodyStringArray = $currentElement->toHtmlArray();
-			}
-		}
-		$elementString .= "<form id='sendData' name='sendData' action='' " .
-						  "method='POST' target='loadData' " .
-						  "style='position:absolute;left:800px'>" .
-						  "<input type='hidden' name='data'></form>";
-
-		if (count($bodyStringArray) == 3) {
-			$elementString = $bodyStringArray[0] . 
-				$bodyStringArray[1] .
-				$elementString . 
-				$bodyStringArray[2];
-			
-		}
-		return $elementString;			
-	}
-	
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_json.php
===================================================================
--- branches/print_dev/http/classes/class_json.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_json.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -75,4 +75,4 @@
 		return json_decode($aString);
 	}
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_kml_geometry.php
===================================================================
--- branches/print_dev/http/classes/class_kml_geometry.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_kml_geometry.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -57,4 +57,4 @@
 		return get_class($this);
 	} 
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_kml_line.php
===================================================================
--- branches/print_dev/http/classes/class_kml_line.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_kml_line.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -44,34 +44,32 @@
 				#
 				if (preg_match("/,/", $pointArray[$i])) {
 					$aPoint = explode(",", $pointArray[$i]);
-					# ignore altitude
 					// KML only supperts EPSG 4326, so
 					// the coordinates are transformed 
-					$pt = new Mapbender_point($aPoint[0], $aPoint[1], $epsg);
+					$pt = new Mapbender_point($aPoint[0], $aPoint[1], $aPoint[2], $epsg);
 					if (isset($epsg) && $epsg != 4326) {
 						$pt->transform(4326);
 					}
-					$point = array("x" => $pt->x, "y" => $pt->y);
+					$point = array("x" => $pt->x, "y" => $pt->y, "z" => $pt->z);
 					array_push($this->pointArray, $point);
 				}
 			}
 		}
 		else {
 			$pointArray = explode(" ", $geometryString);
-			for ($i=0; $i < count($pointArray); $i+=2) {
+			for ($i=0; $i < count($pointArray); $i+=3) {
 				#
 				# Some KMLs have a lot of whitespaces; this "if" is an
 				# ugly hack to prevent adding empty points
 				#
 				if ($pointArray[$i] && $pointArray[$i+1]) {
-					# ignore altitude
-					$pt = new Mapbender_point($pointArray[$i], $pointArray[$i+1], $epsg);
+					$pt = new Mapbender_point($pointArray[$i], $pointArray[$i+1], $pointArray[$i+2], $epsg);
 					// KML only supperts EPSG 4326, so
 					// the coordinates are transformed 
 					if (isset($epsg) && $epsg != 4326) {
 						$pt->transform(4326);
 					}
-					$point = array("x" => $pt->x, "y" => $pt->y);
+					$point = array("x" => $pt->x, "y" => $pt->y, "z" => $pt->z);
 					array_push($this->pointArray, $point);
 				}
 			}
@@ -96,7 +94,12 @@
 				if ($i > 0) {
 					$str .= ",";
 				}
-				$str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"]."]";
+				if ($this->pointArray[$i]["z"]) {
+					$str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"].",".$this->pointArray[$i]["z"]."]";
+				}
+				else {
+					$str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"]."]";
+				}
 			}
 			return "{\"type\": \"LineString\", \"coordinates\":[" . $str . "]}";
 		}
@@ -106,7 +109,7 @@
 	}
 
 	/**
-	 * @return array an array of points as associative array, coordinates as ["x"] and ["y"]
+	 * @return array an array of points as associative array, coordinates as ["x"] and ["y"] and ["z"]
 	 */
 	public function getPointArray () {
 		return $this->pointArray;
@@ -114,7 +117,7 @@
 	
 	/**
 	 * An array of points, with a point being an associative 
-	 * array consisting of attributes "x" and "y".
+	 * array consisting of attributes "x" and "y" and "z"
 	 */
 	protected $pointArray = array();
 }

Modified: branches/print_dev/http/classes/class_kml_linearring.php
===================================================================
--- branches/print_dev/http/classes/class_kml_linearring.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_kml_linearring.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -42,7 +42,12 @@
 				if ($i > 0) {
 					$str .= ",";
 				}
-				$str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"]."]";
+				if ($this->pointArray[$i]["z"]) {
+					$str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"].",".$this->pointArray[$i]["z"]."]";
+				}
+				else {
+					$str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"]."]";
+				}
 			}
 			return "[" . $str . "]";
 		}

Modified: branches/print_dev/http/classes/class_kml_multigeometry.php
===================================================================
--- branches/print_dev/http/classes/class_kml_multigeometry.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_kml_multigeometry.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -80,4 +80,4 @@
 
 	private $geometryArray = array();
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_kml_ows.php
===================================================================
--- branches/print_dev/http/classes/class_kml_ows.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_kml_ows.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -45,6 +45,114 @@
 	public function __construct() {
 	} 
 
+	public function toSingleLineStringKml() {
+		//KML 2.2 output
+		$doc = new DOMDocument("1.0", CHARSET);
+		$doc->preserveWhiteSpace = false;
+	
+		// attach kml and Document tag
+		$e_kml = $doc->createElementNS("http://earth.google.com/kml/2.2", "kml");
+		$e_document = $doc->createElement("Document");
+		$e_kml->appendChild($e_document);
+		$doc->appendChild($e_kml);
+	
+		// attach placemarks
+		$e = new mb_notice("to string: #placemarks: " . count($this->placemarkArray));
+
+		$lineStyleNode = $doc->createElement("Style");
+		$lineStyleNode->setAttribute("id", "linestyleExample");
+		$lineStyleColorNode = $doc->createElement("color", "7f0000ff");
+		$lineStyleWidthNode = $doc->createElement("width", 4);
+		$lineStyleNode->appendChild($lineStyleColorNode);
+		$lineStyleNode->appendChild($lineStyleWidthNode);
+		$e_document->appendChild($lineStyleNode);
+		
+		//
+		// line segments first
+		//
+		$coordinates = "";
+
+		for ($i = 0; $i < count($this->placemarkArray); $i++) {
+			$currentPlacemark = $this->placemarkArray[$i];
+			$e = new mb_notice("now: " . $i . " of " . (count($this->placemarkArray)-1) . " (is a " . get_class($currentPlacemark) . ")");
+
+			switch ($currentPlacemark->getGeometryType()) {
+				case "KMLLine" :
+					$coordinatesArray = $currentPlacemark->getGeometry()->getPointArray();
+					for ($j = 0; $j < count($coordinatesArray); $j++) {
+						if (!($j == 0 && $i == 0)) {
+							$coordinates .= " ";
+						}
+						$coordinates .= $coordinatesArray[$j]["x"] . "," . $coordinatesArray[$j]["y"] . "," . $coordinatesArray[$j]["z"];
+						
+					}
+					break;
+			}
+		}
+		// create a placemark tag with a geometry and add it to the document
+		$e_coordinates = $doc->createElement("coordinates", $coordinates);
+		$e_geometry = $doc->createElement("LineString");
+		$e_geometry->appendChild($e_coordinates);
+		$e_placemark = $doc->createElement("Placemark");
+		$e_placemark->appendChild($e_geometry);
+		$e_pl_name = $doc->createElement("name", "Route");
+		$e_placemark->appendChild($e_pl_name);
+		$e_pl_style = $doc->createElement("styleUrl", "#linestyleExample");
+		$e_placemark->appendChild($e_pl_style);
+		$e_document->appendChild($e_placemark);
+		
+/*		
+		//
+		// now pois
+		//
+		// attach placemarks
+		$e = new mb_notice("to string: #placemarks: " . count($this->placemarkArray));
+		for ($i = 0; $i < count($this->placemarkArray); $i++) {
+			$currentPlacemark = $this->placemarkArray[$i];
+
+			$e = new mb_notice("now: " . $i . " of " . (count($this->placemarkArray)-1) . " (is a " . get_class($currentPlacemark) . ")");
+			
+			$pl_instructions = $currentPlacemark->getProperty("instruction");
+			$pl_name_array = array();
+			$pl_name = false;
+			$pl_description = false;
+			if ($pl_instructions != null) {
+				$pl_name_array = explode("|", $pl_instructions);
+			}
+
+			switch ($currentPlacemark->getGeometryType()) {
+				case "KMLPoint" :
+					if (count($pl_name_array) > 2) {
+						$pl_name = $pl_name_array[0];
+						$pl_description = $pl_name_array[1];
+					}
+					$e_geometry = $doc->createElement("Point");
+					$point = $currentPlacemark->getGeometry()->getPoint();
+					$coordinates = $point["x"] . "," . $point["y"];
+					$e_coordinates = $doc->createElement("coordinates", $coordinates);
+					$e_geometry->appendChild($e_coordinates);
+					break;
+
+			}
+			// create a placemark tag with a geometry and add it to the document
+			if ($e_geometry) {
+				$e_placemark = $doc->createElement("Placemark");
+				$e_placemark->appendChild($e_geometry);
+				if ($pl_name) {
+					$e_pl_name = $doc->createElement("name", $pl_name);
+					$e_placemark->appendChild($e_pl_name);
+				}
+				if ($pl_description) {
+					$e_pl_description = $doc->createElement("description", $pl_description);
+					$e_placemark->appendChild($e_pl_description);
+				}
+				$e_document->appendChild($e_placemark);
+			}
+		}
+*/
+		return $doc->saveXML();
+	}
+	
 	/**
 	 * @return string the KML document.
 	 */
@@ -69,9 +177,20 @@
 
 				$e = new mb_notice("now: " . $i . " of " . (count($this->placemarkArray)-1) . " (is a " . get_class($currentPlacemark) . ")");
 				
+				$pl_instructions = $currentPlacemark->getProperty("instruction");
+				$pl_name_array = array();
+				$pl_name = false;
+				$pl_description = false;
+				if ($pl_instructions != null) {
+					$pl_name_array = explode("|", $pl_instructions);
+				}
 
 				switch ($currentPlacemark->getGeometryType()) {
 					case "KMLPoint" :
+						if (count($pl_name_array) > 2) {
+							$pl_name = $pl_name_array[0];
+							$pl_description = $pl_name_array[1];
+						}
 						$e_geometry = $doc->createElement("Point");
 						$point = $currentPlacemark->getGeometry()->getPoint();
 						$coordinates = $point["x"] . "," . $point["y"];
@@ -100,6 +219,9 @@
 						break;
 */					
 					case "KMLLine" :
+						if (count($pl_name_array) > 2) {
+							$pl_description = $pl_name_array[1];
+						}
 						$e_geometry = $doc->createElement("LineString");
 						$coordinatesArray = $currentPlacemark->getGeometry()->getPointArray();
 						$coordinates = "";
@@ -107,7 +229,7 @@
 							if ($j > 0) {
 								$coordinates .= " ";
 							}
-							$coordinates .= $coordinatesArray[$j]["x"] . "," . $coordinatesArray[$j]["y"] . ",0";
+							$coordinates .= $coordinatesArray[$j]["x"] . "," . $coordinatesArray[$j]["y"] . "," . $coordinatesArray[$j]["z"];
 							
 						}
 						$e_coordinates = $doc->createElement("coordinates", $coordinates);
@@ -123,6 +245,14 @@
 				if ($e_geometry) {
 					$e_placemark = $doc->createElement("Placemark");
 					$e_placemark->appendChild($e_geometry);
+					if ($pl_name) {
+						$e_pl_name = $doc->createElement("name", $pl_name);
+						$e_placemark->appendChild($e_pl_name);
+					}
+					if ($pl_description) {
+						$e_pl_description = $doc->createElement("description", $pl_description);
+						$e_placemark->appendChild($e_pl_description);
+					}
 					$e_document->appendChild($e_placemark);
 				}
 			}
@@ -300,23 +430,29 @@
 	 * @return boolean true, if the KML could be stored in the database; else false.
 	 */
 	private function storeInDb () {
-		$con = db_connect(DBSERVER,OWNER,PW);
-		db_select_db(DB,$con);
-
-		$sql  = "INSERT INTO gui_kml ";
-		$sql .= "(fkey_mb_user_id, fkey_gui_id, kml_doc, kml_name, kml_description, kml_timestamp) ";
-		$sql .= "VALUES ";
-		$sql .= "($1, $2, $3, $4, $5, $6)";
-		$v = array ($_SESSION["mb_user_id"], $_SESSION["mb_user_gui"], $this->kml, "name", "description", time());
-		$t = array ("i", "s", "s", "s", "s", "s");
-		$res = db_prep_query($sql, $v, $t);
-		if (!$res) {
-			$e = new mb_exception("class_kml.php: storeInDb: failed to store KML in database: " . db_error());
-			return false;
+		if ($_SESSION["mb_user_id"] && $_SESSION["mb_user_gui"]) {
+			$con = db_connect(DBSERVER,OWNER,PW);
+			db_select_db(DB,$con);
+	
+			$sql  = "INSERT INTO gui_kml ";
+			$sql .= "(fkey_mb_user_id, fkey_gui_id, kml_doc, kml_name, kml_description, kml_timestamp) ";
+			$sql .= "VALUES ";
+			$sql .= "($1, $2, $3, $4, $5, $6)";
+			$v = array ($_SESSION["mb_user_id"], $_SESSION["mb_user_gui"], $this->kml, "name", "description", time());
+			$t = array ("i", "s", "s", "s", "s", "s");
+			$res = db_prep_query($sql, $v, $t);
+			if (!$res) {
+				$e = new mb_exception("class_kml.php: storeInDb: failed to store KML in database: " . db_error());
+				return false;
+			}
+	
+			$this->id = db_insert_id($con, "gui_kml", "kml_id");
+			return true;
 		}
-
-		$this->id = db_insert_id($con, "gui_kml", "kml_id");
-		return true;
+		else {
+			// should be false, but code in caller has to be changed first.
+			return true;
+		}
 	}
 
 	/**

Modified: branches/print_dev/http/classes/class_kml_parser_ows.php
===================================================================
--- branches/print_dev/http/classes/class_kml_parser_ows.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_kml_parser_ows.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -44,6 +44,9 @@
 		$id = 0;
 		
 		if (gettype($geometryFromGeoJSON) == "object" && $geometryFromGeoJSON->type == "FeatureCollection") {
+			if ($geometryFromGeoJSON->crs->type == "EPSG" && $geometryFromGeoJSON->crs->properties->code) {
+				$epsg = $geometryFromGeoJSON->crs->properties->code;	
+			}
 			// create Placemarks
 			for ($i = 0; $i < count($geometryFromGeoJSON->features); $i++) {
 				$e = new mb_notice("parsing plm #" . $i . "...length of placemarkArray: " . count($this->placemarkArray));
@@ -52,7 +55,9 @@
 					if ($feature->geometry->crs->type == "EPSG") {
 						$epsg = $feature->geometry->crs->properties->code;	
 					}
-					$e = new mb_notice("EPSG: " . $epsg);
+					if (!$epsg) {
+						$e = new mb_notice("EPSG is not set! Aborting...(" . $epsg . ")");
+					}
 					$geometry = $feature->geometry;
 					
 					$currentGeometry = false;

Modified: branches/print_dev/http/classes/class_kml_placemark.php
===================================================================
--- branches/print_dev/http/classes/class_kml_placemark.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_kml_placemark.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -54,7 +54,7 @@
 	 * @return mixed       the property value; if none exists, null.
 	 */
 	public function getProperty ($key) {
-		if (array_key_exists($key)) {
+		if (array_key_exists($key, $this->properties)) {
 			return $this->properties[$key];
 		}
 		$e = new mb_exception("class_kml_placemark.php: getProperty: no value for key '" . $key . "'");

Modified: branches/print_dev/http/classes/class_kml_point.php
===================================================================
--- branches/print_dev/http/classes/class_kml_point.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_kml_point.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -41,12 +41,12 @@
 		if (preg_match("/,/", $geometryString)) {
 			$aPoint = explode(",", $geometryString);
 			// ignore altitude
-			$pt = new Mapbender_point($aPoint[0], $aPoint[1], $epsg);
+			$pt = new Mapbender_point($aPoint[0], $aPoint[1], $aPoint[2], $epsg);
 		}
 		else {
 			$aPoint = explode(" ", $geometryString);
 			// ignore altitude
-			$pt = new Mapbender_point($aPoint[0], $aPoint[1], $epsg);
+			$pt = new Mapbender_point($aPoint[0], $aPoint[1], $aPoint[2], $epsg);
 		}
 
 		// KML only supperts EPSG 4326, so
@@ -54,7 +54,7 @@
 		if (isset($epsg) && $epsg != 4326) {
 			$pt->transform(4326);
 		}
-		$this->point = array("x" => $pt->x, "y" => $pt->y);
+		$this->point = array("x" => $pt->x, "y" => $pt->y, "z" => $pt->z);
 	}
 
 	/**
@@ -69,7 +69,12 @@
 	 */
 	public function toGeoJSON () {
 		if ($this->point !== null) {
-			return "{\"type\": \"Point\", \"coordinates\": [".$this->point["x"].",".$this->point["y"]."]}";
+			if ($this->point["z"]) {
+				return "{\"type\": \"Point\", \"coordinates\": [".$this->point["x"].",".$this->point["y"].",".$this->point["z"]."]}";
+			}
+			else {
+				return "{\"type\": \"Point\", \"coordinates\": [".$this->point["x"].",".$this->point["y"]."]}";
+			}
 		}
 
 		$e = new mb_exception("KMLPoint: toGeoJSON: this point is null.");
@@ -77,14 +82,14 @@
 	}
 
 	/**
-	 * @return array a point as associative array, coordinates as ["x"] and ["y"]
+	 * @return array a point as associative array, coordinates as ["x"] and ["y"] and ["z"]
 	 */
 	public function getPoint () {
 		return $this->point;
 	}
 		
 	/**
-	 * @var	float[] an associative array, with "x", and "y" being float values.
+	 * @var	float[] an associative array, with "x", and "y"  and "z" being float values.
 	 */
 	private $point;
 }

Modified: branches/print_dev/http/classes/class_kml_polygon.php
===================================================================
--- branches/print_dev/http/classes/class_kml_polygon.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_kml_polygon.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -100,4 +100,4 @@
 	 */
 	private $innerBoundaryArray = array();
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_layer_monitor.php
===================================================================
--- branches/print_dev/http/classes/class_layer_monitor.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_layer_monitor.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -54,4 +54,4 @@
 		}
 	}
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_locale.php
===================================================================
--- branches/print_dev/http/classes/class_locale.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_locale.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,216 +1,218 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/class_locale.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__)."/../../core/globalSettings.php");
-
-/**
- * sets the locale, depending on various settings:
- * 1) a language ID passed to the constructor
- * 2) the browser settings $_SERVER["HTTP_ACCEPT_LANGUAGE"]
- * 3) a default language ID
- * 
- */
-class Mb_locale {
-	var $knownLanguages = null;
-	var $systemLocales = null;
-	var $browserLanguages = null;
-	var $os = null;
-	var $name = null;
-	var $defaultLanguage = "en";
-	var $status = "No locale set.";
-	
-	function Mb_locale($languageId) {
-		if (!$languageId) {
-			$languageId = LANGUAGE;
-		}
-  		$e = new Mb_notice("class_locale: setting locale to " . $languageId);
-		if (USE_I18N) {
-			if (!$this->setCurrentLocale($languageId)) {
-				$e = new Mb_exception("Locale could not be set. Language ID: '" . $languageId . "'");
-			}
-		}
-		else {
-			$this->setCurrentLocale($this->defaultLanguage);
-		}
-	}
-
-	/**
-	 * Get the current locale, evaluating GET/POST variables, browser languages
-	 * and a default locale (in that preference)
-	 *
-	 * @returns current locale
-	 */
-	function setCurrentLocale($languageId) {
-
-	  	// try to set the locale to $languageId
-		if ($this->checkAndSetLocale($languageId)) {
-			return true;
-	  	}
-	  	else {
-	  		$e = new Mb_notice("class_locale: no input parameter specified.");
-	  	}
-
-		// determine the browser setting and try to set locale according to that
-		if ($this->browserLanguage == null) {
-			$this->setBrowserLanguages();
-		}		
-		foreach ($this->browserLanguages as $lang) {
-			$e = new Mb_notice("trying browser setting " . $lang);
-			if ($this->checkAndSetLocale($lang)) {
-				return true;
-			}
-		}	
-		
-		// set to default language
-		$e = new Mb_notice("trying default language " . $this->defaultLanguage);
-		return $this->checkAndSetLocale($this->defaultLanguage);
-	}
-	
-	/**
-	 * checks if a locale is available; if yes, it is set via setlocale
-	 * 
-	 * @returns true if the the locale is set successfully; otherwise false
-	 */
-	function checkAndSetLocale($languageId) {
-		if ($this->os == null) {
-			$this->os = $this->guessHostOS();
-		}
-		
-		if (!USE_I18N || ($this->os != null && isset($languageId))) {
-			if ($this->isKnownLanguage($languageId)) {
-				
-				if ($this->systemLocales == null) {
-					$this->setSystemLocales();					
-				}
-				
-				$locale = $this->systemLocales[$this->knownLanguages[$languageId]][$this->os];				
-				$selectedLocale = setlocale(LC_MESSAGES, $locale);
-				if ($selectedLocale) {
-					$this->name = $selectedLocale;
-					$_SESSION["mb_lang"] = $languageId;
-					$_SESSION["mb_locale"] = $this->name;
-					$e = new Mb_notice("locale " . $this->name . " ok on " . $this->os);
-					// from http://de3.php.net/manual/de/function.gettext.php
-					$path = bindtextdomain("Mapbender", dirname(__FILE__)."/../../resources/locale/");
-					$enc = bind_textdomain_codeset("Mapbender", "UTF-8");
-					$dom = textdomain("Mapbender");
-					return true;
-				}
-			}
-		}
-		$e = new Mb_notice("locale " . $locale . " not found.");
-		return false;
-	}
-	
-	/**
-	 * Guess the operating system which on which this code is running
-	 * multiple methods are tested for reliably guessing the os
-	 * 
-	 * @private
-	 * @returns string with os name
-	 */
-	function guessHostOS(){
-	  if (strncasecmp(php_uname(), 'Windows', 7) == 0)
-	    return 'windows';
-	  else if (strncasecmp(php_uname(), 'Linux', 5) == 0)
-	    return 'linux';
-	  else if (strncasecmp(php_uname(), 'OpenBSD', 7) == 0)
-	    return 'bsd';
-	  else if (strncasecmp(php_uname(), 'FreeBSD', 7) == 0)
-	    return 'bsd';  
-	  else {
-	    $e = new mb_exception('unknown platform: could not interpret uname. php_uname() returned '. php_uname().'. Please report to MB developers');
-	    return null;
-	  }
-	}
-
-	/**
-	 * checks if a language is supported
-	 * 
-	 * @returns true if the language is supported; otherwise false
-	 */
-	function isKnownLanguage($languageId) {
-		if ($this->knownLocales == null) {
-			$this->setKnownLanguages();
-		}
-		if (array_key_exists($languageId, $this->knownLanguages)) {
-			return true;
-		}
-		else {
-			$e = new Mb_notice("language " . $languageId . " not supported.");
-		}	
-		return false; 
-	}
-	
-
-
-	/**
-	 * determines the available Locales on this system
-	 */
-	function setSystemLocales() {
-		$this->systemLocales['it_IT'] = array('linux' => 'it_IT.utf8',
-	                                'windows' => 'Italian_Italy.1252',
-	                                'bsd' => 'it_IT',
-	                                'posix' => 'it_IT');
-		$this->systemLocales['de_DE'] = array('linux' => 'de_DE.utf8',
-	                                'windows' => 'German_Germany.1252',
-	                                'bsd' => 'de_DE',
-	                                'posix' => 'it_IT');
-		$this->systemLocales['en_US'] = array('linux' => 'en_US.utf8',
-	                                'windows' => 'English_United States.1252',
-	                                'bsd' => 'en_US',
-	                                'posix' => 'it_IT');
-	}
-	
-	/**
-	 * set the known languages
-	 */
-	function setKnownLanguages() {
-		$this->knownLanguages = array('en_US' => 'en_US',
-                      'en' => 'en_US',
-                      'de_DE' => 'de_DE',
-                      'de' => 'de_DE',
-                      'bg_BG' => 'bg_BG',
-                      'bg' => 'bg_BG',
-                      'es_ES' => 'es_ES',
-                      'es' => 'es_ES',  
-                      'nl_NL' => 'nl_NL',
-                      'nl' => 'nl_NL',                                                                
-                      'gr_GR' => 'gr_GR',
-                      'gr' => 'gr_GR',
-                      'it_IT' => 'it_IT',
-                      'it' => 'it_IT');
-	}
-	
-	/**
-	 * sets the languages accepted by the client browser
-	 */
-	function setBrowserLanguages () {
-		$this->browserLanguages = array();
-		
-	    $bLangs = split(',', $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
-	    foreach ($bLangs as $lang) {
-			if (strpos($lang, ';') === false)
-				array_push($this->browserLanguages, $lang);
-			else
-				array_push($this->browserLanguages, substr($lang, 0, strpos($lang, ';')));
-	    }		
-	}
-}
-?>
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/class_locale.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__)."/../../core/globalSettings.php");
+
+/**
+ * sets the locale, depending on various settings:
+ * 1) a language ID passed to the constructor
+ * 2) the browser settings $_SERVER["HTTP_ACCEPT_LANGUAGE"]
+ * 3) a default language ID
+ *
+ */
+class Mb_locale {
+        var $knownLanguages = null;
+        var $systemLocales = null;
+        var $browserLanguages = null;
+        var $os = null;
+        var $name = null;
+        var $defaultLanguage = "en";
+        var $status = "No locale set.";
+
+        function Mb_locale($languageId) {
+                if (!$languageId) {
+                        $languageId = LANGUAGE;
+                }
+                  $e = new Mb_notice("class_locale: setting locale to " . $languageId);
+                if (USE_I18N) {
+                        if (!$this->setCurrentLocale($languageId)) {
+                                $e = new Mb_exception("Locale could not be set. Language ID: '" . $languageId . "'");
+                        }
+                }
+                else {
+                        $this->setCurrentLocale($this->defaultLanguage);
+                }
+        }
+
+        /**
+         * Get the current locale, evaluating GET/POST variables, browser languages
+         * and a default locale (in that preference)
+         *
+         * @returns current locale
+         */
+        function setCurrentLocale($languageId) {
+
+                  // try to set the locale to $languageId
+                if ($this->checkAndSetLocale($languageId)) {
+                        return true;
+                  }
+                  else {
+                          $e = new Mb_notice("class_locale: no input parameter specified.");
+                  }
+
+                // determine the browser setting and try to set locale according to that
+                if ($this->browserLanguage == null) {
+                        $this->setBrowserLanguages();
+                }
+                foreach ($this->browserLanguages as $lang) {
+                        $e = new Mb_notice("trying browser setting " . $lang);
+                        if ($this->checkAndSetLocale($lang)) {
+                                return true;
+                        }
+                }
+
+                // set to default language
+                $e = new Mb_notice("trying default language " . $this->defaultLanguage);
+                return $this->checkAndSetLocale($this->defaultLanguage);
+        }
+
+        /**
+         * checks if a locale is available; if yes, it is set via setlocale
+         *
+         * @returns true if the the locale is set successfully; otherwise false
+         */
+        function checkAndSetLocale($languageId) {
+                if ($this->os == null) {
+                        $this->os = $this->guessHostOS();
+                }
+
+                if (!USE_I18N || ($this->os != null && isset($languageId))) {
+                        if ($this->isKnownLanguage($languageId)) {
+
+                                if ($this->systemLocales == null) {
+                                        $this->setSystemLocales();
+                                }
+
+                                $locale = $this->systemLocales[$this->knownLanguages[$languageId]][$this->os];
+                                $selectedLocale = setlocale(LC_MESSAGES, $locale);
+                                if ($selectedLocale) {
+                                        $this->name = $selectedLocale;
+                                        $_SESSION["mb_lang"] = $languageId;
+                                        $_SESSION["mb_locale"] = $this->name;
+                                        $e = new Mb_notice("locale " . $this->name . " ok on " . $this->os);
+                                        // from http://de3.php.net/manual/de/function.gettext.php
+                                        $path = bindtextdomain("Mapbender", dirname(__FILE__)."/../../resources/locale/");
+                                        $enc = bind_textdomain_codeset("Mapbender", "UTF-8");
+                                        $dom = textdomain("Mapbender");
+                                        return true;
+                                }
+                        }
+                }
+                $e = new Mb_notice("locale " . $locale . " not found.");
+                return false;
+        }
+
+        /**
+         * Guess the operating system which on which this code is running
+         * multiple methods are tested for reliably guessing the os
+         *
+         * @private
+         * @returns string with os name
+         */
+        function guessHostOS(){
+          if (strncasecmp(php_uname(), 'Windows', 7) == 0)
+            return 'windows';
+          else if (strncasecmp(php_uname(), 'Linux', 5) == 0)
+            return 'linux';
+          else if (strncasecmp(php_uname(), 'OpenBSD', 7) == 0)
+            return 'bsd';
+          else if (strncasecmp(php_uname(), 'FreeBSD', 7) == 0)
+            return 'bsd';
+          else {
+            throw new Mb_exception('unknown platform: could not interpret uname. php_uname() returned '. php_uname().'. Please report to MB developers');
+            return null;
+          }
+        }
+
+        /**
+         * checks if a language is supported
+         *
+         * @returns true if the language is supported; otherwise false
+         */
+        function isKnownLanguage($languageId) {
+                if ($this->knownLocales == null) {
+                        $this->setKnownLanguages();
+                }
+                if (array_key_exists($languageId, $this->knownLanguages)) {
+                        return true;
+                }
+                else {
+                        $e = new Mb_notice("language " . $languageId . " not supported.");
+                }
+                return false;
+        }
+
+
+
+        /**
+         * determines the available Locales on this system
+         */
+        function setSystemLocales() {
+                $this->systemLocales['it_IT'] = array('linux' => 'it_IT.utf8',
+                                        'windows' => 'Italian_Italy.1252',
+                                        'bsd' => 'it_IT',
+                                        'posix' => 'it_IT');
+                $this->systemLocales['de_DE'] = array('linux' => 'de_DE.utf8',
+                                        'windows' => 'German_Germany.1252',
+                                        'bsd' => 'de_DE',
+                                        'posix' => 'de_DE');
+                $this->systemLocales['en_US'] = array('linux' => 'en_US.utf8',
+                                        'windows' => 'English_United States.1252',
+                                        'bsd' => 'en_US',
+                                        'posix' => 'en_US');
+        }
+
+        /**
+         * set the known languages
+         */
+        function setKnownLanguages() {
+                $this->knownLanguages = array('en_US' => 'en_US',
+                      'en' => 'en_US',
+                      'de_DE' => 'de_DE',
+                      'de' => 'de_DE',
+                      'bg_BG' => 'bg_BG',
+                      'bg' => 'bg_BG',
+                      'es_ES' => 'es_ES',
+                      'es' => 'es_ES',
+                      'nl_NL' => 'nl_NL',
+                      'nl' => 'nl_NL',
+					  'fr_FR' => 'fr_FR',
+                      'fr' => 'fr_FR',
+                      'gr_GR' => 'gr_GR',
+                      'gr' => 'gr_GR',
+                      'it_IT' => 'it_IT',
+                      'it' => 'it_IT');
+        }
+
+        /**
+         * sets the languages accepted by the client browser
+         */
+        function setBrowserLanguages () {
+                $this->browserLanguages = array();
+
+            $bLangs = split(',', $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
+            foreach ($bLangs as $lang) {
+                        if (strpos($lang, ';') === false)
+                                array_push($this->browserLanguages, $lang);
+                        else
+                                array_push($this->browserLanguages, substr($lang, 0, strpos($lang, ';')));
+            }
+        }
+}
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_log.php
===================================================================
--- branches/print_dev/http/classes/class_log.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_log.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -92,4 +92,4 @@
 		}
 	}
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_monitor.php
===================================================================
--- branches/print_dev/http/classes/class_monitor.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_monitor.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -476,4 +476,4 @@
 	}
 	
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_point.php
===================================================================
--- branches/print_dev/http/classes/class_point.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_point.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -20,22 +20,30 @@
 require_once(dirname(__FILE__)."/../../core/globalSettings.php");
 
 /**
- * A Mapbender_point is a 2-dimensional point with an EPSG. 
+ * A Mapbender_point is a 2- or 3-dimensional point with an EPSG. 
  */
 class Mapbender_point {
 	var $x;
 	var $y;
+	var $z;
 	var $epsg;
 	
 	/**
 	 * @constructor
 	 */
-	function __construct($x, $y, $epsg) {
-		if (!$x || !$y || !$epsg) {
-			$e = new mb_exception("Mapbender_point: constructor: some parameters are not set (set (x: ".$x.", y: ".$y.", epsg:".$epsg.")!");
+	function __construct($x, $y, $z, $epsg) {
+		// may be called without $z; so $epsg is the third parameter, $z
+		if (isset($x) && isset($y) && isset($z) && !isset($epsg)) {
+			$e = new mb_notice("Mapbender_point: constructor: probably 2d call (x: ".$x.", y: ".$y.", z: ".$z.", epsg:".$epsg.")!");
+			$epsg = $z;
+			$z = false;
 		}
+		if (!isset($x) || !isset($y) || !isset($epsg)) {
+			$e = new mb_exception("Mapbender_point: constructor: some parameters are not set (set (x: ".$x.", y: ".$y.", z: ".$z.", epsg:".$epsg.")!");
+		}
 		$this->x = $x;
 		$this->y = $y;
+		$this->z = $z;
 		$this->epsg = $epsg;
 	}
 	
@@ -136,11 +144,20 @@
 			$currentEpsg = preg_replace("/EPSG:/", "", $this->epsg);
 			$targetEpsg = preg_replace("/EPSG:/", "", $toEpsg);
 			$sql = "SELECT X(transform(GeometryFromText('POINT(".$this->x." ".$this->y.")',".$currentEpsg."),".$targetEpsg.")) as x, ";
-			$sql .= "Y(transform(GeometryFromText('POINT(".$this->x." ".$this->y.")',".$currentEpsg."),".$targetEpsg.")) as y";
+			$sql .= "Y(transform(GeometryFromText('POINT(".$this->x." ".$this->y.")',".$currentEpsg."),".$targetEpsg.")) as y, ";
+			if (isset($this->z)) {
+				$sql .= "Z(transform(GeometryFromText('POINT(".$this->x." ".$this->y." ".$this->z.")',".$currentEpsg."),".$targetEpsg.")) as z";
+			}
 			$res = db_query($sql);
-			$point = new Mapbender_point(db_result($res,0,"x"), db_result($res,0,"y"), $toEpsg);
+			if (isset($this->z)) {
+				$point = new Mapbender_point(db_result($res,0,"x"), db_result($res,0,"y"), db_result($res,0,"z"), $toEpsg);
+			}
+			else {
+				$point = new Mapbender_point(db_result($res,0,"x"), db_result($res,0,"y"), $toEpsg);
+			}
 			$this->x = $point->x;
 			$this->y = $point->y;
+			$this->z = $point->z;
 			$this->epsg = $point->epsg;
 		}
 		else {
@@ -148,28 +165,13 @@
 		}
 	}
 	
-	function toHtml () {
-		$str = "";
-
-		$xArray = explode(".", strval($this->x));
-		$str .= $xArray[0] . "°";
-		if ($xArray[1]) {
-			$str .= $xArray[1] . "'";
+	function __toString() {
+		if (isset($this->z)) {
+			return (string) "(" . $this->x . "," . $this->y . "," . $this->z . ", " . $this->epsg . ")";
 		}
-		$str .= " O / ";
-		
-		$yArray = explode(".", strval($this->y));
-		$str .= $yArray[0] . "°";
-		if ($yArray[1]) {
-			$str .= $yArray[1] . "'";
+		else {
+			return (string) "(" . $this->x . "," . $this->y . "," . $this->epsg . ")";
 		}
-		$str .= " N";
-		return $str;
-		
 	}
-	
-	function __toString() {
-		return (string) "(" . $this->x . "," . $this->y . "," . $this->epsg . ")";
-	}
 }
 ?>

Modified: branches/print_dev/http/classes/class_user.php
===================================================================
--- branches/print_dev/http/classes/class_user.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_user.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -38,13 +38,6 @@
 	}	
 	
 	/**
-	 * @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
@@ -136,24 +129,5 @@
 		}
 		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;
-	}
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_weldMaps2Image.php
===================================================================
--- branches/print_dev/http/classes/class_weldMaps2Image.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_weldMaps2Image.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -200,4 +200,4 @@
  }
  
 
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_weldMaps2PNG.php
===================================================================
--- branches/print_dev/http/classes/class_weldMaps2PNG.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_weldMaps2PNG.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -79,4 +79,4 @@
 	
 }
 
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_wfs.php
===================================================================
--- branches/print_dev/http/classes/class_wfs.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_wfs.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -22,8 +22,8 @@
 */
 
 require_once(dirname(__FILE__)."/../../core/globalSettings.php");
-require_once(dirname(__FILE__)."/class_connector.php");
-require_once(dirname(__FILE__)."/class_administration.php");
+require_once(dirname(__FILE__)."/class_connector.php");
+require_once(dirname(__FILE__)."/class_administration.php");
 
 class wfs {
 
@@ -64,7 +64,7 @@
 	$values = null;
 	$tags = null;
 	$admin = new administration();
-	$this->wfs_getcapabilities_doc = $admin->char_encode($data);
+	$this->wfs_getcapabilities_doc = $admin->char_encode($data);
 	$this->wfs_upload_url = $url;
 	
 	# for temporary wfs a id has to be created...
@@ -75,7 +75,7 @@
 	xml_parser_set_option($parser,XML_OPTION_TARGET_ENCODING,CHARSET);
 	xml_parse_into_struct($parser,$this->wfs_getcapabilities_doc,$values,$tags);
 	//xml_parse_into_struct($parser,$data,$values,$tags);
-	
+	
 	xml_parser_free($parser);
 	
 	$section = false;
@@ -115,7 +115,7 @@
 			if(strtoupper($element[tag]) == "GETCAPABILITIES" && $element[type] == "open"){
 				$section = "getcapabilities";
 			}
-			if($section == "getcapabilities" && strtoupper($element[tag]) == "GET"){
+			if($section == "getcapabilities" && strtoupper($element[tag]) == "POST"){
 				$this->wfs_getcapabilities = $element[attributes][onlineResource];
 			}
 			
@@ -126,7 +126,7 @@
 				
 				
 			}
-			if($section == "describefeaturetype" && strtoupper($element[tag]) == "GET"){
+			if($section == "describefeaturetype" && strtoupper($element[tag]) == "POST"){
 				$this->wfs_describefeaturetype = $element[attributes][onlineResource];
 			}
 			
@@ -134,7 +134,7 @@
 			if(strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "open"){
 				$section = "getfeature";
 			}
-			if($section == "getfeature" && strtoupper($element[tag]) == "GET"){
+			if($section == "getfeature" && strtoupper($element[tag]) == "POST"){
 				$this->wfs_getfeature = $element[attributes][onlineResource];
 			}
 			if(strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "close"){
@@ -144,7 +144,7 @@
 			if(strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "open"){
 				$section = "transaction";
 			}
-			if($section == "transaction" && strtoupper($element[tag]) == "GET"){
+			if($section == "transaction" && strtoupper($element[tag]) == "POST"){
 				$this->wfs_transaction = $element[attributes][onlineResource];
 			}
 			if(strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "close"){
@@ -195,7 +195,7 @@
 } 
 function addFeaturetype($name,$title,$abstract,$srs,$url,$version){
 	$this->wfs_featuretype[count($this->wfs_featuretype)] = new featuretype($name,$title,$abstract,$srs,$url,$version);
-}
+}
  function stripEndlineAndCarriageReturn($string) {
 	  	return preg_replace("/\n/", "", preg_replace("/\r/", " ", $string));
 	  }
@@ -565,7 +565,7 @@
 			if(strtoupper($element[tag]) == "GETCAPABILITIES" && $element[type] == "open"){
 				$section = "getcapabilities";
 			}
-			if($section == "getcapabilities" && strtoupper($element[tag]) == "GET"){
+			if($section == "getcapabilities" && strtoupper($element[tag]) == "POST"){
 				$this->wfs_getcapabilities = $element[attributes][onlineResource];
 			}
 			
@@ -576,7 +576,7 @@
 				
 				
 			}
-			if($section == "describefeaturetype" && strtoupper($element[tag]) == "GET"){
+			if($section == "describefeaturetype" && strtoupper($element[tag]) == "POST"){
 				$this->wfs_describefeaturetype = $element[attributes][onlineResource];
 			}
 			
@@ -584,7 +584,7 @@
 			if(strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "open"){
 				$section = "getfeature";
 			}
-			if($section == "getfeature" && strtoupper($element[tag]) == "GET"){
+			if($section == "getfeature" && strtoupper($element[tag]) == "POST"){
 				$this->wfs_getfeature = $element[attributes][onlineResource];
 			}
 			if(strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "close"){
@@ -594,7 +594,7 @@
 			if(strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "open"){
 				$section = "transaction";
 			}
-			if($section == "transaction" && strtoupper($element[tag]) == "GET"){
+			if($section == "transaction" && strtoupper($element[tag]) == "POST"){
 				$this->wfs_transaction = $element[attributes][onlineResource];
 			}
 			if(strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "close"){
@@ -808,4 +808,4 @@
 		}		
 	}
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/classes/class_wfs_conf.php
===================================================================
--- branches/print_dev/http/classes/class_wfs_conf.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_wfs_conf.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -93,27 +93,19 @@
 	 * @param $idArray Array an array of integer values representing WFS conf IDs.
 	 */
 	private static function getWfsConfFromDbByArray ($idArray) {
-		$sql = "SELECT * FROM wfs_conf ";
-		$sql .= "JOIN wfs ON wfs_conf.fkey_wfs_id = wfs.wfs_id ";
-		$sql .= "WHERE wfs_conf.wfs_conf_id IN (";
-		
-		$v = array();
-		$t = array();
-		for ($i = 0; $i < count($idArray); $i++) {
-			if ($i > 0) {$sql .= ", ";}
-			$sql .= "$" . ($i+1);
-			array_push($v, $idArray[$i]);
-			array_push($t, 'i');
-		}
-		$sql .= ")";
-		
-		$res = db_prep_query($sql, $v, $t);
-		
 		$rowArray = array();
-		while ($row = db_fetch_array($res)) {
-			array_push($rowArray, $row);
-		}
-		return $rowArray;
+        foreach ($idArray as $id) {
+        		$sql = "SELECT * FROM wfs_conf ";
+                $sql .= "JOIN wfs ON wfs_conf.fkey_wfs_id = wfs.wfs_id ";
+                $sql .= "WHERE wfs_conf.wfs_conf_id = $1 LIMIT 1";
+        
+                $v = array($id);
+                $t = array("i");
+                $res = db_prep_query($sql, $v, $t);
+                $row = db_fetch_array($res);
+                array_push($rowArray, $row);
+        }
+        return $rowArray;
 	}
 	
 	/**
@@ -208,8 +200,7 @@
 									"featuretype_id" => $rowArray[$i]["fkey_featuretype_id"],
 									"wfs_getfeature" => $rowArray[$i]["wfs_getfeature"],
 									"wfs_describefeaturetype" => $rowArray[$i]["wfs_describefeaturetype"],
-									"wfs_transaction" => $rowArray[$i]["wfs_transaction"],
-									"element" => $elementArray
+									"wfs_transaction" => $rowArray[$i]["wfs_transaction"]
 									);
 
 				// get WFS conf element data of current WFS conf

Modified: branches/print_dev/http/classes/class_wmc.php
===================================================================
--- branches/print_dev/http/classes/class_wmc.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_wmc.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -16,87 +16,56 @@
 # 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__)."/../../core/globalSettings.php");
 
 require_once(dirname(__FILE__) . "/../classes/class_wms.php");
 require_once(dirname(__FILE__) . "/../classes/class_layer_monitor.php");
 require_once(dirname(__FILE__) . "/../classes/class_point.php");
 require_once(dirname(__FILE__) . "/../classes/class_bbox.php");
 require_once(dirname(__FILE__) . "/../classes/class_json.php");
-require_once(dirname(__FILE__) . "/../classes/class_map.php");
-require_once(dirname(__FILE__) . "/../classes/class_administration.php");
-require_once(dirname(__FILE__) . "/../classes/class_wmcToXml.php");
 
+function mb_utf8_encode ($str) {
+	if(CHARSET=="UTF-8") return utf8_encode($str);
+	return $str;
+}
+function mb_utf8_decode ($str) {
+	if(CHARSET=="UTF-8") return utf8_decode($str);
+	return $str;
+}
+function sepNameSpace($s){
+	$c = strpos($s,":"); 
+	if($c>0)return substr($s,$c+1);
+	return $s;
+}
+
 /**
  * Implementation of a Web Map Context Document, WMC 1.1.0
- * 
- * Use cases:
- * 
- * Instantiation (1) create a WMC object from a WMC XML document
- * 		$myWmc = new wmc();
- * 		$myWmc->createFromXml($xml);
- * 
- *    If you want to create a WMC object from a WMC in the database
- *    	$xml = wmc::getDocument($wmcId);
- * 		$myWmc = new wmc();
- * 		$myWmc->createFromXml($xml);
- *    
- * 
- * Instantiation (2) create a WMC from the client side
- * 		$myWmc = new wmc();
- * 		$myWmc->createFromJs($mapObject, $generalTitle, $extensionData);
- * 	
- * 	  	(creates a WMC from the JS data and then creates an object from that WMC)
- * 
- * Output (1) (do Instantiation first) Load a WMC into client
- * 		This will return an array of JS statements
- *  
- * 		$myWmc->toJavaScript();
- * 
- * Output (2) (do Instantiation first) Merge with another WMC, then load
- * 	
- * 		$myWmc->merge($anotherWmcXml);
- * 		$myWmc->toJavaScript();
- * 
  */
 class wmc {
-	/**
-	 * Representing the main map in a map application
-	 * @var Map
-	 */
-	var $mainMap;
 
-	/**
-	 * Representing an (optional) overview map in a map application
-	 * @var Map
-	 */
-	var $overviewMap;
-
-	/**
-	 * @var Array
-	 */
-	var $generalExtensionArray = array();
-
-	/**
-	 * The XML representation of this WMC.
-	 * @var String
-	 */
 	var $xml;
 	
-	// constants
-	var $monitoringIsOn = false;
-	var $saveWmcAsFile = true;
-	var $extensionNamespace = "mapbender";
-	var $extensionNamespaceUrl = "http://www.mapbender.org";
-		
-	// set in constructor
 	var $wmc_id;
-	var $userId;
-
-	// set during parsing
 	var $wmc_version;
+	var $wmc_windowWidth;
+	var $wmc_windowHeight;
+	var $wmc_bBox_SRS;
+	var $wmc_bBox_minx;
+	var $wmc_bBox_maxx;
+	var $wmc_bBox_miny;
+	var $wmc_bBox_maxy;
 	var $wmc_name;
 	var $wmc_title;
 	var $wmc_abstract;
+	var $wmc_general_extension = array();
+	var $wmc_logourl;
+	var $wmc_logourl_format;
+	var $wmc_logourl_type;
+	var $wmc_logourl_width;
+	var $wmc_logourl_height;
+	var $wmc_descriptionurl;
+	var $wmc_descriptionurl_format;
+	var $wmc_descriptionurl_type;
 	var $wmc_keyword = array();
 	var $wmc_contactposition;
 	var $wmc_contactvoicetelephone;
@@ -110,966 +79,1294 @@
 	var $wmc_contactstateorprovince;
 	var $wmc_contactpostcode;
 	var $wmc_contactcountry;
-	var $wmc_logourl;
-	var $wmc_logourl_format;
-	var $wmc_logourl_type;
-	var $wmc_logourl_width;
-	var $wmc_logourl_height;
-	var $wmc_descriptionurl;
-	var $wmc_descriptionurl_format;
-	var $wmc_descriptionurl_type;
+				
+				
+	var $wmc_wms_title = array();
+	var $wmc_layer_queryable = array();
+	var $wmc_layer_hidden = array();
+	var $wmc_wms_id = array();
+	var $wmc_wms_service = array();
+	var $wmc_wms_version = array();
+	var $wmc_wms_layer_id = array();
+	var $wmc_layer_wfs_featuretype = array();
+	var $wmc_layer_id = array();
+	var $wmc_layer_pos = array();
+	var $wmc_layer_parent = array();
+	var $wmc_layer_querylayer = array();
+	var $wmc_layer_title = array();
+	var $wmc_layer_name = array();
+	var $wmc_layer_abstract = array();
+	var $wmc_layer_srs = array();
+	var $wmc_wms_serviceURL = array();
+	var $wmc_layer_format_current = array();
+	var $wmc_layer_dataurl = array();
+	var $wmc_layer_metadataurl = array();
+	var $wmc_layer_minscale = array();
+	var $wmc_layer_maxscale = array();
+	var $wmc_gui_layer_minscale = array();
+	var $wmc_gui_layer_maxscale = array();
+	var $wmc_layer_format = array();
+	var $wmc_layer_style_current = array();
+	var $wmc_layer_style_name = array();
+	var $wmc_layer_style_title = array();
+	var $wmc_layer_style_legendurl = array();
+	var $wmc_layer_style_legendurl_width = array();
+	var $wmc_layer_style_legendurl_height = array();
+	var $wmc_layer_style_legendurl_format = array();
+	var $wmc_layer_style_legendurl_type = array();
+	var $wmc_layer_style_sld_url = array();
+	var $wmc_layer_style_sld_type = array();
+	var $wmc_layer_style_sld_title = array();
+	
+	var $wmc_wms_count = 0;
+			
+	/*	
+	 	var $data_type = array(); 
+		var $data_format = array();
+		
+		var $objLayer = array(); 
+		  
+		var $gui_wms_mapformat;
+		var $gui_wms_featureinfoformat;
+		var $gui_wms_exceptionformat;
+		var $gui_wms_epsg;
+		  
+		var $default_epsg = 0;
+  */
+	var $monitoringIsOn = false;
+  		
+function wmc() {
+} 
 
-	public function __construct () {
-		$this->userId = $_SESSION["mb_user_id"];
-		$this->wmc_id = time();
-	} 
+/**
+ * Saves the current WMC in the log folder.
+ * 
+ * @return string the filename of the WMC document.
+ */
+function saveAsFile() {
+	$filename = "wmc_" . date("Y_m_d_H_i_s") . ".log";
+	$logfile = "../../log/" . $filename;
 	
-	// ---------------------------------------------------------------------------
-	// INSTANTIATION
-	// ---------------------------------------------------------------------------
-
-	/**
-	 * Parses the XML string and instantiates the WMC object.
-	 * 
-	 * @param $xml String
-	 */
-	public function createFromXml ($xml) {
-		return $this->createObjFromWMC_xml($xml);
+	if($h = fopen($logfile,"a")){
+		$content = $this->xml;
+		if(!fwrite($h,$content)){
+			$e = new mb_exception("class_wmc.php: failed to write wmc.");
+			return false;
+		}
+		fclose($h);
 	}
+	return $filename;
+}
 
-	/**
-	 * Loads a WMC from the database.
-	 * 
-	 * @param integer $wmc_id the ID of the WMC document in the database table "mb_user_wmc"
-	 */
-	function createFromDb($wmcId){
-		$this->monitoringIsOn = true;
-		
-		$doc = wmc::getDocument($wmcId);
-		$this->createObjFromWMC_xml($doc);
-	}
+/**
+ * @return string the title of the WMC.
+ */
+function getTitle() {
+	return $this->wmc_title;
+}
 
-	public function createFromApplication ($appId) {
-		// get the map objects "overview" and "mapframe1"
-		$this->mainMap = map::selectMainMapByApplication($appId);
-		$this->overviewMap = map::selectOverviewMapByApplication($appId);
-		$this->createXml();
-		$this->saveAsFile();
-	}
+/**
+ * @return Integer the number of (unique?) WMS contained in this WMC.
+ */
+function getNumberOfWms () {
+	return $this->wmc_wms_count;
+}
 
-	/**
-	 * Creates a WMC object from a JS map object {@see map_obj.js}
-	 * 
-	 * @param object $mapObject a map object
-	 * @param integer $user_id the ID of the current user
-	 * @param string $generalTitle the desired title of the WMC
-	 * @param object $extensionData data exclusive to Mapbender, which will be 
-	 * 								mapped into the extension part of the WMC
-	 */
-	public function createFromJs($mapObject, $generalTitle, $extensionData) {
+/**
+ * Creates a WMC object from a JS map object {@see map.js}
+ * 
+ * @param object $mapObject a map object
+ * @param integer $user_id the ID of the current user
+ * @param string $generalTitle the desired title of the WMC
+ * @param object $extensionData data exclusive to Mapbender, which will be 
+ * 								mapped into the extension part of the WMC
+ */
+function createWMCFromObj($mapObject, $user_id, $generalTitle, $extensionData) {
+	$this->wmc_id = $user_id . '_' . time();
 	
-		if (count($mapObject) > 2) {
-			$e = new mb_exception("Save WMC only works for two concurrent map frames (overview plus main) at the moment.");
-		}
-		
-		// set extension data		
-		$this->generalExtensionArray = $extensionData;
-
-		// set title
-		$this->wmc_title = $generalTitle;
-		
-		// create the map objects
-		for ($i = 0; $i < count($mapObject); $i++) {
-			$currentMap = new Map();
-			$currentMap->createFromJs($mapObject[$i]);
-
-			if (isset($mapObject[$i]->isOverview)) {
-				$this->overviewMap = $currentMap;
+	$generalWidth = $mapObject->width;
+	$generalHeight = $mapObject->height;
+	$generalBboxSrs = $mapObject->epsg;
+	
+	$arrayBBox = explode(",", $mapObject->extent);
+	$generalBboxMinx = floatval($arrayBBox[0]);
+	$generalBboxMiny = floatval($arrayBBox[1]);
+	$generalBboxMaxx = floatval($arrayBBox[2]);
+	$generalBboxMaxy = floatval($arrayBBox[3]);
+	
+	$generalName = "Mapbender WMC"; // TO do : insert proper data
+	$generalKeywords = array("Mapbender", "WMC"); // TO do : insert proper data
+	$generalAbstract = ""; // TO do : insert proper data
+	$generalLogoUrl = ""; // TO do : insert proper data
+	$generalLogoUrlWidth = ""; // TO do : insert proper data
+	$generalLogoUrlHeight = ""; // TO do : insert proper data
+	$generalLogoUrlFormat = ""; // TO do : insert proper data
+	$generalDescriptionUrl = ""; // TO do : insert proper data
+	$generalContactPerson = "";
+	$generalContactOrganization = "";
+	$generalContactPosition = "";
+	$generalContactAddressType = "";
+	$generalContactAddress = "";
+	$generalContactCity = "";
+	$generalContactStateOrProvince = "";
+	$generalContactPostCode = "";
+	$generalContactCountry = "";
+	$generalContactVoiceTelephone = "";
+	$generalContactFacsimileTelephone = "";
+	$generalContactElectronicMailAddress = "";
+			
+	$extension_namespace = "mapbender";
+	
+	// LayerList variables
+	$layerHidden = "";
+	$layerQueryable = "";
+	$layerAbstract = "";
+	$layerName = "";
+	$layerSrs = "";
+	$layerDataUrl = "";
+	$layerMetadataUrl = "";
+	$layerFormat = "";
+	$layerFormat_current = "";
+	$layerStyle_current = "";
+	$layerStyle_name = "";
+	$layerStyle_title = "";
+	$layerStyle_legendURL = "";
+	$layerStyle_legendURL_width = "";
+	$layerStyle_legendURL_height = "";
+	$layerStyle_legendURL_format = "";		
+	
+	// generate XML
+	$doc = new DOMDocument("1.0", CHARSET);
+	$doc->preserveWhiteSpace = false;
+	
+	// ViewContext
+	$e_view_context = $doc->createElementNS("http://www.opengis.net/context", "ViewContext");
+	
+	
+	$e_view_context->setAttribute("version", "1.0.0");
+	$e_view_context->setAttribute("id", $this->wmc_id);
+	$e_view_context->setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
+	$e_view_context->setAttribute("xmlns:mapbender", "http://www.mapbender.org");
+	$e_view_context->setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
+	$e_view_context->setAttribute("xsi:SchemaLocation", "http://schemas.opengis.net/context/1.0.0/context.xsd");
+	
+		// General
+		$e_general = $doc->createElement("General");
+	
+			$e_window = $doc->createElement("Window");
+			if (!empty($generalWidth) && !empty($generalHeight)) {
+				$e_window->setAttribute("width", $generalWidth);
+				$e_window->setAttribute("height", $generalHeight);
 			}
-			else {
-				$this->mainMap = $currentMap;
+			$e_general->appendChild($e_window);
+			
+			$e_bbox = $doc->createElement("BoundingBox");
+			$e_bbox->setAttribute("SRS", $generalBboxSrs);
+			$e_bbox->setAttribute("minx", $generalBboxMinx);
+			$e_bbox->setAttribute("miny", $generalBboxMiny);
+			$e_bbox->setAttribute("maxx", $generalBboxMaxx);
+			$e_bbox->setAttribute("maxy", $generalBboxMaxy);
+			$e_general->appendChild($e_bbox);
+			
+			$e_name = $doc->createElement("Name", $generalName);
+			$e_general->appendChild($e_name);
+			
+			$e_title = $doc->createElement("Title", $generalTitle);
+			$e_general->appendChild($e_title);
+			
+			$e_keyword_list = $doc->createElement("KeywordList");
+			for ($i=0; $i < count($generalKeywords); $i++) {
+				$e_keyword = $doc->createElement("Keyword", $generalKeywords[$i]);
+				$e_keyword_list->appendChild($e_keyword);
 			}
-		}
-
-		
-		// create XML
-		$this->createXml();
-
-		$this->saveAsFile();
-		return true;
-	}
+			$e_general->appendChild($e_keyword_list);
+			
+			if ($generalAbstract){
+				$e_abstract = $doc->createElement("Abstract", $generalAbstract);
+				$e_general->appendChild($e_abstract);
+			}
+			
+			if ($generalLogoUrlWidth && $generalLogoUrlHeight && $generalLogoUrlFormat && $generalLogoUrl){
+				$e_logo_url = $doc->createElement("LogoURL");
+				$e_logo_url->setAttribute("width", $generalLogoUrlWidth);
+				$e_logo_url->setAttribute("height", $generalLogoUrlHeight);
+				$e_logo_url->setAttribute("format", $generalLogoUrlFormat);
+			
+				$e_logo_url_or = $doc->createElement("OnlineResource");
+				$e_logo_url_or->setAttributeNS("http://www.opengis.net/context", "xmlns:xlink", "http://www.w3.org/1999/xlink");
+				$e_logo_url_or->setAttribute("xlink:type", "simple");
+				$e_logo_url_or->setAttribute("xlink:href", $generalLogoUrl);
+				$e_logo_url->appendChild($e_logo_url_or);
 	
-	// ---------------------------------------------------------------------------
-	// DATABASE FUNCTIONS
-	// ---------------------------------------------------------------------------
-
-	/**
-	 * Stores this WMC in the database. The WMC has to be instantiated first, see above.
-	 * 
-	 * @return mixed[] an assoc array with attributes "success" (boolean) and "message" (String).
-	 */
-	public function insert () {
-		$result = array();
-		if ($this->userId && $this->xml && $this->wmc_title) {
-			$sql = "INSERT INTO mb_user_wmc VALUES ($1, $2, $3, $4, $5)";
-			$v = array($this->wmc_id, $this->userId, $this->xml, $this->wmc_title, time());
-			$t = array("s", "i", "s", "s", "s");
+				$e_general->appendChild($e_logo_url);
+			}
+				
+			if ($generalDescriptionUrl){
+				$e_description_url = $doc->createElement("DescriptionURL");
+	
+				$e_description_url_or = $doc->createElement("OnlineResource");
+				$e_description_url_or->setAttributeNS("http://www.opengis.net/context", "xmlns:xlink", "http://www.w3.org/1999/xlink");
+				$e_description_url_or->setAttribute("xlink:type", "simple");
+				$e_description_url_or->setAttribute("xlink:href", $generalDescriptionUrl);
+				$e_description_url->appendChild($e_description_url_or);
+	
+				$e_general->appendChild($e_description_url);
+			}
 			
-			$res = db_prep_query($sql, $v, $t);
-			if (db_error()) {
-				$errMsg = "Error while saving WMC document '" . $this->wmc_title . "': " . db_error();
-				$result["success"] = false;
-				$result["message"] = $errMsg;
-				$e = new mb_exception("mod_insertWMCIntoDB: " . $errMsg);
+			if ($generalContactElectronicMailAddress || $generalContactOrganization ||
+				$generalContactPerson || $generalContactPosition || $generalContactAddressType ||
+				$generalContactAddress || $generalContactCity || $generalContactStateOrProvince ||
+				$generalContactPostCode || $generalContactCountry || $generalContactVoiceTelephone ||
+				$generalContactFacsimileTelephone || $generalContactElectronicMailAddress) {
+			
+				$e_contact = $doc->createElement("ContactInformation");
+			
+				if ($generalContactPerson || $generalContactOrganization){
+					$e_contact_person_primary = $doc->createElement("ContactPersonPrimary");
+			
+					if ($generalContactPerson){
+						$e_contact_person = $doc->createElement("ContactPerson", $generalContactPerson);
+						$e_contact_person_primary->appendChild($e_contact_person);
+					}
+					if ($generalContactOrganization){
+						$e_contact_organization = $doc->createElement("ContactOrganization", $generalContactOrganization);
+						$e_contact_person_primary->appendChild($e_contact_organization);
+					}
+					$e_contact->appendChild($e_contact_person_primary);
+				}
+			
+				if ($generalContactPosition){
+					$e_contact_position = $doc->createElement("ContactPosition", $generalContactPosition);
+					$e_contact->appendChild($e_contact_position);
+				}
+			
+				if ($generalContactAddressType || $generalContactAddress || 
+					$generalContactCity || $generalContactStateOrProvince ||
+					$generalContactPostCode || $generalContactCountry) {
+			
+					$e_contact_address = $doc->createElement("ContactAddress");
+			
+					if ($generalContactAddressType){
+						$e_address_type = $doc->createElement("AddressType", $generalContactAddressType);
+						$e_contact_address->appendChild($e_address_type);
+					}
+					if ($generalContactAddress){
+						$e_address = $doc->createElement("Address", $generalContactAddress);
+						$e_contact_address->appendChild($e_address);
+					}
+					if ($generalContactCity){
+						$e_city = $doc->createElement("City", $generalContactCity);
+						$e_contact_address->appendChild($e_city);
+					}
+					if ($generalContactStateOrProvince){
+						$e_state = $doc->createElement("StateOrProvince", $generalContactStateOrProvince);
+						$e_contact_address->appendChild($e_state);
+					}
+					if ($generalContactPostCode){
+						$e_postcode = $doc->createElement("PostCode", $generalContactPostCode);
+						$e_contact_address->appendChild($e_postcode);
+					}
+					if ($generalContactCountry){
+						$e_country = $doc->createElement("Country", $generalContactCountry);
+						$e_contact_address->appendChild($e_country);
+					}
+					$e_contact->appendChild($e_contact_address);
+				}
+				
+				if ($generalContactVoiceTelephone){
+					$e_voice_telephone = $doc->createElement("ContactVoiceTelephone", $generalContactVoiceTelephone);
+					$e_contact->appendChild($e_voice_telephone);
+				}
+				if ($generalContactFacsimileTelephone){
+					$e_facsimile_telephone = $doc->createElement("ContactFacsimileTelephone", $generalContactFacsimileTelephone);
+					$e_contact->appendChild($e_facsimile_telephone);
+				}
+				if ($generalContactElectronicMailAddress){
+					$e_email = $doc->createElement("ContactElectronicMailAddress", $generalContactElectronicMailAddress);
+					$e_contact->appendChild($e_email);
+				}
+				$e_general->appendChild($e_contact);
 			}
-			else {
-				$result["success"] = true;
-				$msg = "WMC document '" . $this->wmc_title . "' has been saved.";
-				$result["message"] = $msg;
-				$e = new mb_notice("mod_insertWMCIntoDB: WMC  '" . $this->wmc_title . "' saved successfully.");
+			
+			
+			if (count($extensionData) > 0) {
+				//$e = new mb_exception("writing wmc...");
+				$e_extensionGeneral = $doc->createElement("Extension");
+				
+				foreach ($extensionData as $keyExtensionData => $valueExtensionData) {
+					$e_currentExtensionTag = $doc->createElement($extension_namespace.":".$keyExtensionData, $valueExtensionData);
+					$e_extensionGeneral->appendChild($e_currentExtensionTag);
+				}
+				$e_general->appendChild($e_extensionGeneral);
 			}
-		}
-		else {
-			$result["success"] = false;
-			$errMsg = "missing parameters (user_id: ".$this->userId.", title: " . $this->wmc_title . ")";
-			$result["message"] = $errMsg;
-			$e = new mb_exception("mod_insertWMCIntoDB: " . $errMsg .")");
-		}
-		return $result;
-	}
+		$e_view_context->appendChild($e_general);
 	
-	/**
-	 * 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 successful?
-	 */
-	public static function delete ($wmcId, $userId) {
-		if (!isset($userId) || $userId === null) {
-			$userId = $_SESSION["mb_user_id"];
-		}
-		
-		$sql = "DELETE FROM mb_user_wmc ";
-		$sql .= "WHERE fkey_user_id = $1 AND wmc_id = $2";
-		$v = array($userId, $wmcId);
-		$t = array('i', 's');
-		$res = db_prep_query($sql, $v, $t);
-		if ($res) {
-			return true;
-		}
-		return false;
-	}
-
-	/**
-	 * Returns a WMC document
-	 * @return String|boolean The document if it exists; else false
-	 * @param $id String the WMC id
-	 */
-	public static function getDocument ($id) {
-		$sql = "SELECT wmc FROM mb_user_wmc WHERE wmc_id = $1";
-		$v = array($id);
-		$t = array('s');
-		$res = db_prep_query($sql,$v,$t);
-		$row = db_fetch_array($res);
-		if ($row) {
-			return $row["wmc"];
-		}
-		return false;
-	}
-
-	// ---------------------------------------------------------------------------
-	// GETTER FUNCTIONS
-	// ---------------------------------------------------------------------------
 	
-	/**
-	 * @return string the title of the WMC.
-	 */
-	public function getTitle() {
-		return $this->wmc_title;
-	}
-
-	// ---------------------------------------------------------------------------
-	// OUTPUT FUNCTIONS
-	// ---------------------------------------------------------------------------
+		// LayerList
+		$e_layer_list = $doc->createElement("LayerList");
 	
-	/**
-	 * Wrapper function, returns XML at the moment
-	 * @return String
-	 */
-	public function __toString() {
-		return $this->toXml();
-	}
-
-	/**
-	 * Returns the XML document if available
-	 * 
-	 * @return String The XML document; if unavailable, null is returned.
-	 */
-	public function toXml () {
-		if (!$this->xml) {
-			$this->createXml();
-		}
-		return $this->xml;
-	}
-
-	/**
-	 * Returns an array of JavaScript statements
-	 * 
-	 * @return String[]
-	 */
-	public function toJavaScript () {
-/*
-		// counts how often a layer has been loaded
-		if ($this->monitoringIsOn) {
-			$monitor = new Layer_load_count();
-			for ($i = 0; $i < count($this->wmc_layer_id); $i++) {
-				$monitor->increment($this->wmc_layer_id[$i]);
+		for ($i=0; $i < count($mapObject->wms); $i++){
+			$wmsId = $mapObject->wms[$i]->wms_id;
+			$wms_epsg = array();
+			$wms_epsg[0] = $mapObject->epsg;
+		
+			if ($mapObject->wms[$i]->gui_wms_epsg != $mapObject->epsg){
+				$wms_epsg[1] = $mapObject->wms[$i]->gui_wms_epsg;
 			}
-		}
-*/		
-		// will contain the JS code to create the maps
-		// representing the state stored in this WMC
-		$wmcJsArray = array();
+	
+			for ($q = 0; $q < count($mapObject->wms[$i]->gui_epsg); $q++){
+				$isInArray = false;
+				
+				for ($r=0 ; $r < count($wms_epsg); $r++){
+					if ($wms_epsg[$r] == $mapObject->wms[$i]->gui_epsg[$q]){
+						$isInArray = true;
+					}
+				}
+				if ($isInArray == false){
+					array_push($wms_epsg, $mapObject->wms[$i]->gui_epsg[$q]);
+				}
+			}
+			for ($j = 0; $j < count($mapObject->wms[$i]->objLayer); $j++){
+				if ($mapObject->wms[$i]->objLayer[$j]->layer_parent != ''){
+					if ($mapObject->wms[$i]->objLayer[$j]->gui_layer_visible == "1"){
+						$layerHidden = 0;
+					}
+					else{
+						$layerHidden = 1;
+					}
+					$layerQueryable = $mapObject->wms[$i]->objLayer[$j]->layer_queryable;
+					$layerQuerylayer = $mapObject->wms[$i]->objLayer[$j]->gui_layer_querylayer;
+					$layerId = $mapObject->wms[$i]->objLayer[$j]->layer_uid;
+					$layerName = $mapObject->wms[$i]->objLayer[$j]->layer_name;
+					$layerTitle = $mapObject->wms[$i]->objLayer[$j]->layer_title;
+					$layerAbstract = $mapObject->wms[$i]->wms_abstract; //To Do: insert actual abstract
+					$layerDataUrl = $mapObject->wms[$i]->objLayer[$j]->layer_dataurl_href; 
+					$layerMetadataUrl = $mapObject->wms[$i]->objLayer[$j]->layer_metadataurl;
+					$layerMinscale = $mapObject->wms[$i]->objLayer[$j]->layer_minscale; 
+					$layerMaxscale = $mapObject->wms[$i]->objLayer[$j]->layer_maxscale; 
+					$guiLayerMinscale = $mapObject->wms[$i]->objLayer[$j]->gui_layer_minscale; 
+					$guiLayerMaxscale = $mapObject->wms[$i]->objLayer[$j]->gui_layer_maxscale; 
+					$wmsVersion = $mapObject->wms[$i]->wms_version;
+					$wmsTitle = $mapObject->wms[$i]->wms_title;
+					$wmsLayerId = $mapObject->wms[$i]->objLayer[0]->layer_uid;
+					$wmsOnlineResource = $mapObject->wms[$i]->wms_getmap;
+					$layerPos = $mapObject->wms[$i]->objLayer[$j]->layer_pos;
+					$layerParent = $mapObject->wms[$i]->objLayer[$j]->layer_parent;
+					$queryLayer = $mapObject->wms[$i]->objLayer[$j]->gui_layer_querylayer;
+					$wfsFeatureType = $mapObject->wms[$i]->objLayer[$j]->gui_layer_wfs_featuretype;
+					
+					$e_layer = $doc->createElement("Layer");
+					$e_layer->setAttribute("queryable", $layerQueryable);
+					$e_layer->setAttribute("hidden", $layerHidden);
 		
-		// set general extension data
-		if (count($this->generalExtensionArray) > 0) {
-			$json = new Mapbender_JSON();
-			array_push($wmcJsArray, "restoredWmcExtensionData = " . $json->encode($this->generalExtensionArray) . ";"); 
-		}
+						$e_service = $doc->createElement("Server");
+						$e_service->setAttribute("service", "OGC:WMS");
+						$e_service->setAttribute("version", $wmsVersion);
+						$e_service->setAttribute("title", $wmsTitle);
 		
-		// reset WMS data
-		array_push($wmcJsArray, "wms = [];");
-		array_push($wmcJsArray, "wms_layer_count = 0;");
+						$e_service_or = $doc->createElement("OnlineResource");
+						$e_service_or->setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
+						$e_service_or->setAttribute("xlink:type", "simple");
+						$e_service_or->setAttribute("xlink:href", $wmsOnlineResource);
+						
+						$e_service->appendChild($e_service_or);
+						$e_layer->appendChild($e_service);
+		
+						$e_layer_name = $doc->createElement("Name", $layerName);
+						$e_layer->appendChild($e_layer_name);
+		
+						$e_layer_title = $doc->createElement("Title", $layerTitle);
+						$e_layer->appendChild($e_layer_title);
+		
+						if ($layerAbstract){
+							$e_layer_abstract = $doc->createElement("Abstract", $layerAbstract);
+							$e_layer->appendChild($e_layer_abstract);
+						}
+		
+						$e_layer_srs = $doc->createElement("SRS", implode(" ", $wms_epsg));
+						$e_layer->appendChild($e_layer_name);
+		
+						if ($layerDataUrl){
+							$e_layer_data_url = $doc->createElement("DataURL");
+			
+							$e_layer_data_url_or = $doc->createElement("OnlineResource");
+							$e_layer_data_url_or->setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
+							$e_layer_data_url_or->setAttribute("xlink:type", "simple");
+							$e_layer_data_url_or->setAttribute("xlink:href", $layerDataUrl);
+							
+							$e_layer_data_url->appendChild($e_layer_data_url_or);
+							$e_layer->appendChild($e_layer_data_url);
+						}
+		
+						if ($layerMetadataUrl){
+							$e_layer_metadata_url = $doc->createElement("MetadataURL");
+			
+							$e_layer_metadata_url_or = $doc->createElement("OnlineResource");
+							$e_layer_metadata_url_or->setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
+							$e_layer_metadata_url_or->setAttribute("xlink:type", "simple");
+							$e_layer_metadata_url_or->setAttribute("xlink:href", $layerMetadataUrl);
+							
+							$e_layer_metadata_url->appendChild($e_layer_metadata_url_or);
+							$e_layer->appendChild($e_layer_metadata_url);
+						}
+		
+						$e_extension = $doc->createElement("Extension");
+		
+						$e_scalehint = $doc->createElement($extension_namespace.":ScaleHint");
+						$e_scalehint->setAttribute("min", $layerMinscale);
+						$e_scalehint->setAttribute("max", $layerMaxscale);
+						$e_extension->appendChild($e_scalehint);
+						
+						$e_gui_scalehint = $doc->createElement($extension_namespace.":guiScaleHint");
+						$e_gui_scalehint->setAttribute("min", $guiLayerMinscale);
+						$e_gui_scalehint->setAttribute("max", $guiLayerMaxscale);
+						$e_extension->appendChild($e_gui_scalehint);
+						
+						$e_layer_id = $doc->createElement($extension_namespace.":layer_id", $layerId);
+						$e_extension->appendChild($e_layer_id);
+						
+						$e_wms_layer_id = $doc->createElement($extension_namespace.":wms_layer_id", $wmsLayerId);
+						$e_extension->appendChild($e_wms_layer_id);
+						
+						$e_layer_pos = $doc->createElement($extension_namespace.":layer_pos", $layerPos);
+						$e_extension->appendChild($e_layer_pos);
+		
+						$e_layer_parent = $doc->createElement($extension_namespace.":layer_parent", $layerParent);
+						$e_extension->appendChild($e_layer_parent);
+		
+						$e_wms_id = $doc->createElement($extension_namespace.":wms_id", $wmsId);
+						$e_extension->appendChild($e_wms_id);
+		
+						$e_querylayer = $doc->createElement($extension_namespace.":querylayer", $layerQuerylayer);
+						$e_extension->appendChild($e_querylayer);
+						
+						if ($wfsFeatureType) {
+							$e_wfsFeatureType = $doc->createElement($extension_namespace.":wfsFeatureType", $wfsFeatureType);
+							$e_extension->appendChild($e_wfsFeatureType);
+						}
 
-		// add WMS for main map frame
-		$wmsArray = $this->mainMap->getWmsArray();
-		// for all wms...
-		for ($i = 0; $i < count($wmsArray); $i++) {
-			// ..add wms and set properties
-			array_push($wmcJsArray, $wmsArray[$i]->createJsObjFromWMS_());
-		}
-
-		// delete existing map objects...
-		array_push($wmcJsArray, "mb_mapObj = [];");
-
-		// .. and add the overview map (if exists)
-		if ($this->overviewMap !== null) {
-			// find the WMS in the main map which is equal to the WMS
-			// in the overview map
-			$ovWmsArray = $this->overviewMap->getWmsArray();
-			$overviewWmsIndex = 0;
-			for ($i = 0; $i < count($ovWmsArray); $i++) {
-				for ($j = 0; $j < count($wmsArray); $j++) {
-					if ($ovWmsArray[$i]->equals($wmsArray[$j])) {
-						$overviewWmsIndex = $j;						
-						break;
-					}
+						$e_layer->appendChild($e_extension);
+		
+						//layerFormat
+						$e_layer_format = $doc->createElement("FormatList");
+		
+						$data_format_current = false;
+		
+						for ($k = 0; $k < count($mapObject->wms[$i]->data_format); $k++){
+		
+							if ($mapObject->wms[$i]->data_type[$k] == "map") {
+								$layerFormat = $mapObject->wms[$i]->data_format[$k];
+				
+								$e_format = $doc->createElement("Format", $layerFormat);
+		
+								if ($data_format_current == false && ( 
+										($mapObject->wms[$i]->data_format[$k] == $mapObject->wms[$i]->gui_wms_mapformat) ||
+										($k == (count($mapObject->wms[$i]->data_format)-1))
+								)){
+		
+									$e_format->setAttribute("current", "1");
+									$data_format_current = true;
+								}
+								$e_layer_format->appendChild($e_format);
+							}
+						}
+						$e_layer->appendChild($e_layer_format);
+		
+		
+						// LayerStyle
+						$e_layer_stylelist = $doc->createElement("StyleList");
+			
+						for ($k = 0; $k < count($mapObject->wms[$i]->objLayer[$j]->layer_style); $k++){
+		
+							if ($k == 0){
+								$layerStyle_current = 1; // To do: insert proper data
+							}
+							else{
+								$layerStyle_current = 0; // To do: insert proper data
+							}
+		
+							$e_layer_style = $doc->createElement("Style");
+		
+							$layerStyleSLD = "";
+		
+							if ($layerStyleSLD){
+								$layerStyleSLDUrl = ""; // To Do: Insert Proper Data
+								
+								$e_layer_style_or = $doc->createElement("OnlineResource");
+								$e_layer_style_or->setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
+								$e_layer_style_or->setAttribute("xlink:type", "simple");
+								$e_layer_style_or->setAttribute("xlink:href", $layerStyleSLDUrl);
+								$e_layer_style->appendChild($e_layer_style_or);
+							}
+							else{
+								//TODO: determine correct layer style entries
+								$layerStyle_name = $mapObject->wms[$i]->objLayer[$j]->layer_style[$k]->name;
+								$layerStyle_title = $mapObject->wms[$i]->objLayer[$j]->layer_style[$k]->title;
+								$layerStyle_legendUrl = $mapObject->wms[$i]->objLayer[$j]->layer_style[$k]->legendurl;
+								$layerStyle_legendUrl_width = ""; // To Do: add proper data
+								$layerStyle_legendUrl_height = ""; // To Do: add proper data
+								$layerStyle_legendUrl_format = ""; // To Do: add proper data
+		
+								if ($layerStyle_current == 1){
+									$e_layer_style->setAttribute("current", "1");
+								}
+	
+								$e_layer_style_name = $doc->createElement("Name", $layerStyle_name);
+								$e_layer_style->appendChild($e_layer_style_name);
+	
+								$e_layer_style_title = $doc->createElement("Title", $layerStyle_title);
+								$e_layer_style->appendChild($e_layer_style_title);
+								
+								
+								$e_layer_style_legendurl = $doc->createElement("LegendUrl");
+								$e_layer_style_legendurl->setAttribute("width", $layerStyle_legendUrl_width);
+								$e_layer_style_legendurl->setAttribute("height", $layerStyle_legendUrl_height);
+								$e_layer_style_legendurl->setAttribute("format", $layerStyle_legendUrl_format);
+	
+								$e_layer_style_legendurl_or = $doc->createElement("OnlineResource");
+								$e_layer_style_legendurl_or->setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
+								$e_layer_style_legendurl_or->setAttribute("xlink:type", "simple");
+								$e_layer_style_legendurl_or->setAttribute("xlink:href", $layerStyle_legendUrl);
+								$e_layer_style_legendurl->appendChild($e_layer_style_legendurl_or);
+								$e_layer_style->appendChild($e_layer_style_legendurl);
+							}
+							$e_layer_stylelist->appendChild($e_layer_style);
+						}	
+						$e_layer->appendChild($e_layer_stylelist);
+						
+					$e_layer_list->appendChild($e_layer);
 				}
 			}
-			$wmcJsArray = array_merge($wmcJsArray, $this->overviewMap->toJavaScript($overviewWmsIndex));
-
 		}
+		$e_view_context->appendChild($e_layer_list);
+	
+	
+	$doc->appendChild($e_view_context);
+	$this->xml = $doc->saveXML();
+	
+	// for debugging: saving WMC as file
+	// (comment when no longer needed)
+	$filename = $this->saveAsFile();
+	if ($filename) {
+		$e = new mb_notice("class_wmc: saving WMC as file " . $filename);
+	}
+}
 
-		// .. and add main map ..
-		$wmcJsArray = array_merge($wmcJsArray, $this->mainMap->toJavaScript(null));
+/**
+ * Loads a WMC from the database.
+ * 
+ * @param integer $wmc_id the ID of the WMC document in the database table "mb_user_wmc"
+ */
+function createObjFromWMC_id($wmc_id){
+	
+	global $DBSERVER,$DB,$OWNER,$PW;
+	$con = db_connect($DBSERVER,$OWNER,$PW);
+	db_select_db(DB, $con);
+	
+	$sql = "SELECT wmc FROM mb_user_wmc WHERE wmc_id = $1";
+	$v = array($wmc_id);
+	$t = array("s");
+	$res = db_prep_query($sql, $v, $t);
+	$wmc = db_fetch_row($res);
+	$this->createObjFromWMC_xml($wmc[0]);
+	$this->monitoringIsOn = true;
+}
 
-		// Finally, request the maps
-		array_push($wmcJsArray, "setMapRequest('" . $this->mainMap->getFrameName() . "');");
-		if ($this->overviewMap !== null) {
-			array_push($wmcJsArray, "setMapRequest('" . $this->overviewMap->getFrameName() . "');");
-		}
+/**
+ * Loads a WMC from an actual WMC XML document.
+ * 
+ * @param string $data the data from the XML file
+ */
+function createObjFromWMC_xml($data){
+#	$data = str_replace("&#38;", "&amp;", $data);
 
-		array_push($wmcJsArray, "eventAfterLoadWMS.trigger();");
-		return $wmcJsArray;
-	}
-	
-	// ------------------------------------------------------------------------
-	// manipulation
-	// ------------------------------------------------------------------------
-	/**
-	 * Merges this WMC with another WMC.
-	 * The settings of the other WMC overwrite the settings of this WMC.
-	 * 
-	 * @return void
-	 * @param $xml2 Object
-	 */
-	public function merge ($xml2) {
-		$someWmc = new wmc();
-		$someWmc->createFromXml($xml2);
+	// store xml 
+	$this->xml = $data;
 
-		$this->mainMap->merge($someWmc->mainMap);
-		if (isset($this->overviewMap) && isset($someWmc->overviewMap)) {
-			$this->overviewMap->merge($someWmc->overviewMap);
-		}
+	// for debugging: saving WMC as file
+	// (comment when no longer needed)
+	$filename = $this->saveAsFile();
+	if ($filename) {
+		$e = new mb_notice("class_wmc: saving WMC as file " . $filename);
 	}
 
-	/**
-	 * Appends the layers of another WMC to this WMC.
-	 * 
-	 * @return void
-	 * @param $xml2 Object
-	 */
-	public function append ($xml2) {
-		$someWmc = new wmc();
-		$someWmc->createFromXml($xml2);
 
-		$this->mainMap->append($someWmc->mainMap);
-		if (isset($this->overviewMap) && isset($someWmc->overviewMap)) {
-			// There is only one WMS in the overview map; merge, not append
-			$this->overviewMap->merge($someWmc->overviewMap);
-		}
-	}
 
-	/**
-	 * Adds a WMS to this WMC
-	 * 
-	 * @return 
-	 */
-	public function appendWmsArray ($wmsArray) {
-		return $this->mainMap->appendWmsArray($wmsArray);
+	$values = NULL;
+	$tags = NULL;
+	$parser = xml_parser_create(CHARSET);
+	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,$data,$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);
+		return false;
 	}
+	xml_parser_free($parser);
 	
-	/**
-	 * Merges a WMS into this WMC
-	 * 
-	 * @return 
-	 */
-	public function mergeWmsArray ($wmsArray) {
-		$this->mainMap->mergeWmsArray($wmsArray);
-	}
-
-// ---------------------------------------------------------------------------
-// private functions
-// ---------------------------------------------------------------------------
-
-	/**
-	 * Loads a WMC from an actual WMC XML document.
-	 * Uses WMS class.
-	 * 
-	 * @param string $data the data from the XML file
-	 */
-	private function createObjFromWMC_xml($data){
-		// store xml 
-		$this->xml = $data;
+	$section = NULL;
+	$format = NULL;
+	$cnt_format = 0;
+	$parent = array();
+	$myParent = array();
+	$cnt_layer = -1;
+	$request = NULL; 
+	$layer_style = array();
+	$extension = false;
 	
-		$values = administration::parseXml($data);
-
-		//
-		// Local variables that indicate which section of the WMC
-		// is currently parsed.
-		//
-		$extension = false;		$general = false;		$layerlist = false;
-		$layer = false;  		$formatlist = false;	$dataurl = false;
-		$metadataurl = false; 	$stylelist = false;
-
-		//
-		// reset WMC data
-		//
-		$this->mainMap = new Map();
-		$this->overviewMap = null;
-		$this->generalExtensionArray = array();
-		
-		$layerlistArray = array();
-		$layerlistArray["main"] = array();
-		$layerlistArray["overview"] = array();
-			 
-		foreach ($values as $element) {
-			$tag = strtoupper(administration::sepNameSpace($element[tag]));
-			$tagLowerCase = administration::sepNameSpace($element[tag]);
-			$type = $element[type];
-			$attributes = $element[attributes];
-			$value = mb_utf8_decode(html_entity_decode($element[value])); // TODO: not sure if utf decoding is necessary
-			
-			if ($tag == "VIEWCONTEXT" && $type == "open") {
-				$this->wmc_id = $attributes["id"];
-				$this->wmc_version = $attributes["version"];
-			}
-			if ($tag == "GENERAL" && $type == "open") {
-				$general = true;
-			}
-			if ($tag == "LAYERLIST" && $type == "open") {
-				$layerlist = true;
-			}
-			if ($general) {
-				if ($tag == "WINDOW") {
-					$this->mainMap->setWidth($attributes["width"]);
-					$this->mainMap->setHeight($attributes["height"]);
+	$general = false;
+	$layerlist = false;
+	$layer = false;
+	$formatlist = false;
+	$dataurl = false;
+	$metadataurl = false; 
+	$stylelist = false;
+	$cnt_style = -1;
+		 
+	foreach ($values as $element) {
+					$verbose .= ".";
+		if(strtoupper($element[tag]) == "VIEWCONTEXT" && $element[type] == "open"){
+				$this->wmc_id = $element[attributes]["id"];
+				$this->wmc_version = $element[attributes]["version"];
+		}
+		if(strtoupper($element[tag]) == "GENERAL" && $element[type] == "open"){
+		   $general = true;
+		}
+		if(strtoupper($element[tag]) == "LAYERLIST" && $element[type] == "open"){
+		   $layerlist = true;
+		}
+		if ($general) {
+				if(strtoupper($element[tag]) == "WINDOW"){
+						$this->wmc_windowWidth = $element[attributes]["width"];
+						$this->wmc_windowHeight = $element[attributes]["height"];
 				}
-				if ($tag == "BOUNDINGBOX") {
-					$bbox = new Mapbender_bbox($attributes["minx"], $attributes["miny"], $attributes["maxx"], $attributes["maxy"], $attributes["SRS"]);
-					$this->mainMap->setExtent($bbox);
+				if(strtoupper($element[tag]) == "BOUNDINGBOX"){
+						$this->wmc_bBox_SRS = $element[attributes]["SRS"];
+						$this->wmc_bBox_minx = $element[attributes]["minx"];
+						$this->wmc_bBox_miny = $element[attributes]["miny"];
+						$this->wmc_bBox_maxx = $element[attributes]["maxx"];
+						$this->wmc_bBox_maxy = $element[attributes]["maxy"];
 				}
-				if ($tag == "NAME") {
-					$this->wmc_name = $value;
+				if(strtoupper($element[tag]) == "NAME"){
+						$this->wmc_name = mb_utf8_decode(html_entity_decode($element[value]));
 				}
-				if ($tag == "TITLE") {
-					$this->wmc_title = $value;
+				if(strtoupper($element[tag]) == "TITLE"){
+						$this->wmc_title = mb_utf8_decode(html_entity_decode($element[value]));
 				}
-				if ($tag == "ABSTRACT") {
-					$this->wmc_abstract = $value;
+				if(strtoupper($element[tag]) == "ABSTRACT"){
+						$this->wmc_abstract = mb_utf8_decode(html_entity_decode($element[value]));
 				}
-				if ($tag == "CONTACTINFORMATION" && $type == "open") {
-					$contactinformation = true;
+				if(strtoupper($element[tag]) == "CONTACTINFORMATION" && $element['type'] == "open"){
+						$contactinformation = true;
 				}
 				if ($contactinformation) {
-					if ($tag == "CONTACTPOSITION") {
-						$this->wmc_contactposition = $value;
+					if(strtoupper($element[tag]) == "CONTACTPOSITION"){
+							$this->wmc_contactposition = mb_utf8_decode(html_entity_decode($element[value]));
 					}
-					if ($tag == "CONTACTVOICETELEPHONE") {
-						$this->wmc_contactvoicetelephone = $value;
+					if(strtoupper($element[tag]) == "CONTACTVOICETELEPHONE"){
+							$this->wmc_contactvoicetelephone = $element[value];
 					}
-					if ($tag == "CONTACTFACSIMILETELEPHONE") {
-						$this->wmc_contactfacsimiletelephone = $value;
+					if(strtoupper($element[tag]) == "CONTACTFACSIMILETELEPHONE"){
+							$this->wmc_contactfacsimiletelephone = $element[value];
 					}
-					if ($tag == "CONTACTELECTRONICMAILADDRESS") {
-						$this->wmc_contactemail = $value;
+					if(strtoupper($element[tag]) == "CONTACTELECTRONICMAILADDRESS"){
+							$this->wmc_contactemail = mb_utf8_decode(html_entity_decode($element[value]));
 					}
-					if ($tag == "CONTACTPERSONPRIMARY" && $type == "open") {
-						$contactpersonprimary = true;
+					if(strtoupper($element[tag]) == "CONTACTPERSONPRIMARY" && $element['type'] == "open"){
+							$contactpersonprimary = true;
 					}
 					if ($contactpersonprimary) {
-						if ($tag == "CONTACTPERSON") {
-							$this->wmc_contactperson = $value;
+						if(strtoupper($element[tag]) == "CONTACTPERSON"){
+								$this->wmc_contactperson = mb_utf8_decode(html_entity_decode($element[value]));
 						}
-						if ($tag == "CONTACTORGANIZATION") {
-							$this->wmc_contactorganization = $value;;
+						if(strtoupper($element[tag]) == "CONTACTORGANIZATION"){
+								$this->wmc_contactorganization = mb_utf8_decode(html_entity_decode($element[value]));
 						}
-						if ($tag == "CONTACTPERSONPRIMARY" && $type == "close") {
-							$contactpersonprimary = false;
+						if(strtoupper($element[tag]) == "CONTACTPERSONPRIMARY" && $element['type'] == "close"){
+								$contactpersonprimary = false;
 						}
 					}
-					if ($tag == "CONTACTADDRESS" && $type == "open") {
-						$contactaddress = true;
+					if(strtoupper($element[tag]) == "CONTACTADDRESS" && $element['type'] == "open"){
+							$contactaddress = true;
 					}
 					if ($contactaddress) {
-						if ($tag == "ADDRESSTYPE") {
-							$this->wmc_contactaddresstype = $value;
+						if(strtoupper($element[tag]) == "ADDRESSTYPE"){
+								$this->wmc_contactaddresstype = mb_utf8_decode(html_entity_decode($element[value]));
 						}
-						if ($tag == "ADDRESS") {
-							$this->wmc_contactaddress = $value;
+						if(strtoupper($element[tag]) == "ADDRESS"){
+								$this->wmc_contactaddress = mb_utf8_decode(html_entity_decode($element[value]));
 						}
-						if ($tag == "CITY") {
-							$this->wmc_contactcity = $value;
+						if(strtoupper($element[tag]) == "CITY"){
+								$this->wmc_contactcity = mb_utf8_decode(html_entity_decode($element[value]));
 						}
-						if ($tag == "STATEORPROVINCE") {
-							$this->wmc_contactstateorprovince = $value;
+						if(strtoupper($element[tag]) == "STATEORPROVINCE"){
+								$this->wmc_contactstateorprovince = mb_utf8_decode(html_entity_decode($element[value]));
 						}
-						if ($tag == "POSTCODE"){
-							$this->wmc_contactpostcode = $value;
+						if(strtoupper($element[tag]) == "POSTCODE"){
+								$this->wmc_contactpostcode = $element[value];
 						}
-						if ($tag == "COUNTRY") {
-							$this->wmc_contactcountry = $value;
+						if(strtoupper($element[tag]) == "COUNTRY"){
+								$this->wmc_contactcountry = mb_utf8_decode(html_entity_decode($element[value]));
 						}
-						if ($tag == "CONTACTADDRESS" && $type == "close") {
-							$contactaddress = false;
+						if(strtoupper($element[tag]) == "CONTACTADDRESS" && $element['type'] == "close"){
+								$contactaddress = false;
 						}
 					}
 				}
-				if ($tag == "LOGOURL" && $type == "open") {
+				if(strtoupper($element[tag]) == "LOGOURL" && $element['type'] == "open"){
 						$logourl = true;
-						$this->wmc_logourl_width = $attributes["width"];
-						$this->wmc_logourl_height = $attributes["height"];
-						$this->wmc_logourl_format = $attributes["format"];
+						$this->wmc_logourl_width = $element[attributes]["width"];
+						$this->wmc_logourl_height = $element[attributes]["height"];
+						$this->wmc_logourl_format = $element[attributes]["format"];
 				}
 				if ($logourl) {
-					if ($tag == "LOGOURL" && $type == "close") {
-						$logourl = false;
+					if(strtoupper($element[tag]) == "LOGOURL" && $element['type'] == "close"){
+							$logourl = false;
 					}
-					if ($tag == "ONLINERESOURCE") {
-						$this->wmc_logourl_type = $attributes["xlink:type"];
-						$this->wmc_logourl = $attributes["xlink:href"];
+					if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+						$this->wmc_logourl_type = $element[attributes]["xlink:type"];
+						$this->wmc_logourl = $element[attributes]["xlink:href"];
 					}
 				}
-				if ($tag == "DESCRIPTIONURL" && $type == "open") {
+				if(strtoupper($element[tag]) == "DESCRIPTIONURL" && $element['type'] == "open"){
 						$descriptionurl = true;
-						$this->wmc_descriptionurl_format = $attributes["format"];
+						$this->wmc_descriptionurl_format = $element[attributes]["format"];
 				}
 				if ($descriptionurl) {
-					if ($tag == "DESCRIPTIONURL" && $type == "close"){
-						$descriptionurl = false;
+					if(strtoupper($element[tag]) == "DESCRIPTIONURL" && $element['type'] == "close"){
+							$descriptionurl = false;
 					}
-					if ($tag == "ONLINERESOURCE") {
-						$this->wmc_descriptionurl_type = $attributes["xlink:type"];
-						$this->wmc_descriptionurl = $attributes["xlink:href"];
+					if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+						$this->wmc_descriptionurl_type = $element[attributes]["xlink:type"];
+						$this->wmc_descriptionurl = $element[attributes]["xlink:href"];
 					}
 				}
-				if ($tag == "KEYWORDLIST" && $type == "open") {
-					$keywordlist = true;
+				if(strtoupper($element[tag]) == "KEYWORDLIST" && $element['type'] == "open"){
+						$keywordlist = true;
 				}
 				if ($keywordlist) {
-					if ($tag == "KEYWORDLIST" && $type == "close") {
-						$keywordlist = false;
-						$cnt_keyword = -1;
+					if(strtoupper($element[tag]) == "KEYWORDLIST" && $element['type'] == "close"){
+							$keywordlist = false;
+							$cnt_keyword = -1;
 					}
-					if ($tag == "KEYWORD") {
+					if(strtoupper($element[tag]) == "KEYWORD"){
 						$cnt_keyword++;
-						$this->wmc_keyword[$cnt_keyword] = $value;
+						$this->wmc_keyword[$cnt_keyword] = mb_utf8_decode(html_entity_decode($element[value]));
 					}
 				}
-				if ($tag == "EXTENSION" && $type == "close") {
+						
+				if(strtoupper($element[tag]) == "EXTENSION" && $element['type'] == "close"){
 					$generalExtension = false;
-					//
-					// After the general extension tag is closed,
-					// we have all necessary information to CREATE
-					// the map objects that are contained in this
-					// WMC.
-					//
-					$this->setMapData();
 				}
 				if ($generalExtension) {
-					$this->generalExtensionArray[$tag] = $value;
+					$this->wmc_general_extension[sepNameSpace($element[tag])] = $element[value];
+//					$e = new mb_exception("WMC: " . $element[tag] . ": " . $element[value]);
 				}
-				if ($tag == "EXTENSION" && $type == "open") {
+				if(strtoupper($element[tag]) == "EXTENSION" && $element['type'] == "open"){
 					$generalExtension = true;
 				}
-				if ($tag == "GENERAL" && $type == "close") {
+
+				if(strtoupper($element[tag]) == "GENERAL" && $element['type'] == "close"){
 		   			$general = false;
 			 	}
-			}
-			if ($layerlist) {
-				if ($tag == "LAYERLIST" && $type == "close") {
+		}
+		if ($layerlist) {
+				if(strtoupper($element[tag]) == "LAYERLIST" && $element['type'] == "close"){
 				   $layerlist = false;
 				}
-				if ($tag == "LAYER" && $type == "open") {
-					//
-					// The associative array currentLayer holds all 
-					// data of the currently processed layer.
-					// The data will be set in the classes' WMS
-					// object when the layer tag is closed.
-					//
-					$currentLayer = array();
-					
-					$currentLayer["queryable"] = $attributes["queryable"];
-					if ($attributes["hidden"] == "1") {
-						$currentLayer["visible"] = 0;
-					}
-					else {
-						$currentLayer["visible"] = 1;
-					}
-					$currentLayer["format"] = array();
-					$currentLayer["style"] = array();
-					$layer = true;
+				if(strtoupper($element[tag]) == "LAYER" && $element[type] == "open"){
+					 $cnt_layer++;
+					 $this->wmc_layer_queryable[$cnt_layer] = $element[attributes]["queryable"];
+					 $this->wmc_layer_hidden[$cnt_layer] = $element[attributes]["hidden"];
+					 $layer = true;
+      		 		 $cnt_epsg = 0;
 				}
 				if ($layer) {
-					if ($tag == "LAYER" && $type == "close") {
-
-						//
-						// After a layer tag is closed,
-						// we have all necessary information to CREATE
-						// a layer object and append it to the WMS object
-						//
-						if ($currentLayer["extension"]["ISOVERVIEWLAYER"] == "1") {
-							array_push($layerlistArray["overview"], $currentLayer);		
-						}
-						else {
-							array_push($layerlistArray["main"], $currentLayer);											
-						}
-				 		$layer = false;
-					}
-					if ($formatlist) {
-						if ($tag == "FORMAT") {
-						 	array_push($currentLayer["format"], array("current" => $attributes["current"], "name" => $value));
-							if ($attributes["current"] == "1") {
-								$currentLayer["formatIndex"] = count($currentLayer["format"]) - 1;
-							}
+					 if(strtoupper($element[tag]) == "LAYER" && $element[type] == "close"){
+					 		$layer = false;
+					 }
+					 if ($formatlist) {
+						 if(strtoupper($element[tag]) == "FORMAT"){
+						 	$cnt_format++;
+						 	$this->wmc_layer_format_current[$cnt_layer][$cnt_format] = $element[attributes]["current"];
+						 	$this->wmc_layer_format[$cnt_layer][$cnt_format] = $element[value];
 						 }
-						 if ($tag == "FORMATLIST" && $type == "close") {
+						 if(strtoupper($element[tag]) == "FORMATLIST" && $element[type] == "close"){
 							 $formatlist = false;
 						 }
 					 }
 					 elseif ($metadataurl) {
-						if ($tag == "ONLINERESOURCE") {
-							$currentLayer["metadataurl"] = $attributes["xlink:href"];
-						}
-						if ($tag == "METADATAURL" && $type == "close") {
-							$metadataurl = false;
-						}
+						 if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+						 	$this->wmc_layer_metadataurl[$cnt_layer] = $element[attributes]["xlink:href"];
+						 }
+						 if(strtoupper($element[tag]) == "METADATAURL" && $element[type] == "close"){
+							 $metadataurl = false;
+						 }
 					 }
 					 elseif ($dataurl) {
-						if ($tag == "ONLINERESOURCE") {
-						 	$currentLayer["dataurl"] = $attributes["xlink:href"];
-						}
-						 if ($tag == "DATAURL" && $type == "close") {
-							$dataurl = false;
+						 if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+						 	$this->wmc_layer_dataurl[$cnt_layer] = $element[attributes]["xlink:href"];
 						 }
+						 if(strtoupper($element[tag]) == "DATAURL" && $element[type] == "close"){
+							 $dataurl = false;
+						 }
 					 }
 					 elseif ($stylelist) {
+						 if(strtoupper($element[tag]) == "STYLE" && $element[type] == "open"){
+						 	$cnt_style++;
+						 	$style = true;
+						 	$this->wmc_layer_style_current[$cnt_layer][$cnt_style] = $element[attributes]["current"];
+						 }
 						 if ($style) {
-							$index = count($currentLayer["style"]) - 1;
-							if ($tag == "STYLE" && $type == "close") {
-								$style = false;
-							}
-							if ($tag == "SLD" && $type == "open") {
-								$sld = true;
-							}
-							if ($sld) {
-								if ($tag == "SLD" && $type == "close") {
-									$sld = false;
-								}
-								if ($tag == "ONLINERESOURCE") {
-									$currentLayer["style"][$index]["sld_type"] = $attributes["xlink:type"];
-									$currentLayer["style"][$index]["sld_url"] = $attributes["xlink:href"];
-								}
-								if ($tag == "TITLE") {
-									$currentLayer["style"][$index]["sld_title"] = $value;
-								}
-							}
-							else {
-								if ($tag == "NAME"){
-									$currentLayer["style"][$index]["name"] = $value;
-								}
-								if ($tag == "TITLE") {
-									$currentLayer["style"][$index]["title"] = $value;
-								}
-								if ($legendurl) {
-									if ($tag == "LEGENDURL" && $type == "close") {
-										$legendurl = false;
-									}
-									if ($tag == "ONLINERESOURCE") {
-									 	$currentLayer["style"][$index]["legendurl_type"] = $attributes["xlink:type"];
-									 	$currentLayer["style"][$index]["legendurl"] = $attributes["xlink:href"];
-									}
-								}
-								if ($tag == "LEGENDURL" && $type == "open") {
+							 if(strtoupper($element[tag]) == "STYLE" && $element[type] == "close"){
+							 	$style = false;
+							 }
+							 if(strtoupper($element[tag]) == "SLD" && $element[type] == "open"){
+							 	$sld = true;
+							 }
+							 if ($sld) {
+								 if(strtoupper($element[tag]) == "SLD" && $element[type] == "close"){
+								 	$sld = false;
+								 }
+								 if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+								 	$this->wmc_layer_style_sld_type[$cnt_layer][$cnt_style] = $element[attributes]["xlink:type"];
+								 	$this->wmc_layer_style_sld_url[$cnt_layer][$cnt_style] = $element[attributes]["xlink:href"];
+								 }
+								 if(strtoupper($element[tag]) == "TITLE"){
+								 	$this->wmc_layer_style_sld_title[$cnt_layer][$cnt_style] = mb_utf8_decode(html_entity_decode($element[value]));
+								 }
+							 }
+							 else {
+								 if(strtoupper($element[tag]) == "NAME"){
+								 	$this->wmc_layer_style_name[$cnt_layer][$cnt_style] = mb_utf8_decode(html_entity_decode($element[value]));
+								 }
+								 if(strtoupper($element[tag]) == "TITLE"){
+								 	$this->wmc_layer_style_title[$cnt_layer][$cnt_style] = $element[value];
+								 }
+								 if(strtoupper($element[tag]) == "LEGENDURL" && $element[type] == "open"){
 								 	$legendurl = true;
-								 	$currentLayer["style"][$index]["legendurl_width"] = $attributes["width"];
-								 	$currentLayer["style"][$index]["legendurl_height"] = $attributes["height"];
-								 	$currentLayer["style"][$index]["legendurl_format"] = $attributes["format"];
-								}
-							}
-						}
-						if ($tag == "STYLE" && $type == "open") {
-							$style = true;
-							array_push($currentLayer["style"], array("current" => $attributes["current"]));
-							if ($attributes["current"] == "1") {
-								$currentLayer["styleIndex"] = count($currentLayer["style"]) - 1;
-							}
-						}
-						if ($tag == "STYLELIST" && $type == "close") {
-							$stylelist = false;
-						}
-					}
-					else {
-						if ($tag == "SERVER" && $type == "open") {
-							 $server = true;
-							 $currentLayer["service"] = $attributes["service"];
-							 $currentLayer["version"] = $attributes["version"];
-							 $currentLayer["wms_title"] = $attributes["title"];
-						}
-						if ($server) {
-							if ($tag == "SERVER" && $type == "close") {
-						 		$server = false;
-						 	}
-							if ($tag == "ONLINERESOURCE") {
-						 		$currentLayer["url"] = $attributes["xlink:href"];
-							}
-						}
-						if ($tag == "NAME") {
-					 		$currentLayer["name"] = $value;
-						}
-						if ($tag == "TITLE") {
-					 		$currentLayer["title"] = $value;
-						}
-						if ($tag == "ABSTRACT") {
-					 		$currentLayer["abstract"] = $value;
-						}
-						if ($tag == "SRS") {
-							$currentLayer["epsg"] = explode(" ", $value);						 	
-						}
-						if ($tag == "EXTENSION" && $type == "close") {
-							$extension = false;
-						}
-						if ($extension == true){
-							if ($value !== "") {
-								if (isset($currentLayer["extension"][$tag])) {
-									if (!is_array($currentLayer["extension"][$tag])) {
-										$firstValue = $currentLayer["extension"][$tag];
-										$currentLayer["extension"][$tag] = array();
-										array_push($currentLayer["extension"][$tag], $firstValue);
-									}	
-									array_push($currentLayer["extension"][$tag], $value);
-								}
-								else {
-									$currentLayer["extension"][$tag] = $value;									
-								}
-							}
-						}
-						if ($tag == "EXTENSION" && $type == "open") {
-							$currentLayer["extension"] = array();
-							$extension = true;
-						}
-						if ($tag == "METADATAURL" && $type == "open") {
-							$metadataurl = true;
-						}
-						if ($tag == "DATAURL" && $type == "open") {
-							$dataurl = true;
-						}
-						if ($tag == "FORMATLIST" && $type == "open") {
-							$formatlist = true;
-						}
-						if ($tag == "STYLELIST" && $type == "open") {
-							$stylelist = true;
-						}
-					}
+								 	$this->wmc_layer_style_legendurl_width[$cnt_layer][$cnt_style] = $element[attributes]["width"];
+								 	$this->wmc_layer_style_legendurl_height[$cnt_layer][$cnt_style] = $element[attributes]["height"];
+								 	$this->wmc_layer_style_legendurl_format[$cnt_layer][$cnt_style] = $element[attributes]["format"];
+								 }
+								 if ($legendurl) {
+									 if(strtoupper($element[tag]) == "LEGENDURL" && $element[type] == "close"){
+									 	$legendurl = false;
+									 }
+									 if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+									 	$this->wmc_layer_style_legendurl_type[$cnt_layer][$cnt_style] = $element[attributes]["xlink:type"];
+									 	$this->wmc_layer_style_legendurl[$cnt_layer][$cnt_style] = $element[attributes]["xlink:href"];
+									 }
+								 }
+							 }
+						 }
+						 if(strtoupper($element[tag]) == "STYLELIST" && $element[type] == "close"){
+							 $stylelist = false;
+						 }
+					 }
+					 else {
+						 if(strtoupper($element[tag]) == "SERVER" && $element[type] == "open"){
+						 	 $server = true;
+						 	 $this->wmc_wms_service[$cnt_layer] = $element[attributes]["service"];
+						 	 $this->wmc_wms_version[$cnt_layer] = $element[attributes]["version"];
+						 	 $this->wmc_wms_title[$cnt_layer] = mb_utf8_decode(html_entity_decode($element[attributes]["title"]));
+						 }
+						 if ($server) {
+							 if(strtoupper($element[tag]) == "SERVER" && $element[type] == "close"){
+							 	 $server = false;
+							 }
+							 if(strtoupper($element[tag]) == "ONLINERESOURCE"){
+						 		 $this->wmc_wms_serviceURL[$cnt_layer] = $element[attributes]["xlink:href"];
+							 }
+						 }
+						 if(strtoupper($element[tag]) == "NAME"){
+					 		 $this->wmc_layer_name[$cnt_layer] = mb_utf8_decode(html_entity_decode($element[value]));
+						 }
+						 if(strtoupper($element[tag]) == "TITLE"){
+					 		 $this->wmc_layer_title[$cnt_layer] = mb_utf8_decode(html_entity_decode($element[value]));
+						 }
+						 if(strtoupper($element[tag]) == "ABSTRACT"){
+					 		 $this->wmc_layer_abstract[$cnt_layer] = mb_utf8_decode(html_entity_decode($element[value]));
+						 }
+						 if(strtoupper($element[tag]) == "SRS"){
+							 $epsgArray = explode(" ", $element[value]);						 	
+					 		 
+					 		 for ($c = 0 ; $c < count($epsgArray) ; $c ++) {
+						 		 $this->wmc_layer_srs[$cnt_layer][$cnt_epsg] = $epsgArray[$c];
+								 $cnt_epsg++;
+					 		 }
+						 }
+						 if (strtoupper($element[tag]) == "EXTENSION" && $element[type] == "open") {
+						 	$extension = true;
+						 }
+						 if (strtoupper($element[tag]) == "EXTENSION" && $element[type] == "close") {
+						 	$extension = false;
+						 }
+						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "SCALEHINT"){
+					 		 $this->wmc_layer_minscale[$cnt_layer] = $element[attributes]["min"];
+					 		 $this->wmc_layer_maxscale[$cnt_layer] = $element[attributes]["max"];
+						 }
+						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "GUISCALEHINT"){
+					 		 $this->wmc_gui_layer_minscale[$cnt_layer] = $element[attributes]["min"];
+					 		 $this->wmc_gui_layer_maxscale[$cnt_layer] = $element[attributes]["max"];
+						 }
+						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "LAYER_ID"){
+					 		 $this->wmc_layer_id[$cnt_layer] = $element[value];
+						 }
+						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "WMS_LAYER_ID"){
+					 		 $this->wmc_wms_layer_id[$cnt_layer] = $element[value];
+						 }
+						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "LAYER_POS"){
+					 		 $this->wmc_layer_pos[$cnt_layer] = $element[value];
+						 }
+						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "LAYER_PARENT"){
+					 		 $this->wmc_layer_parent[$cnt_layer] = $element[value];
+						 }
+						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "QUERYLAYER"){
+					 		 $this->wmc_layer_querylayer[$cnt_layer] = $element[value];
+						 }
+						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "WMS_ID"){
+					 		 $this->wmc_wms_id[$cnt_layer] = $element[value];
+						 }
+						 if($extension == true && strtoupper(sepNameSpace($element[tag])) == "WFSFEATURETYPE"){
+					 		 $this->wmc_layer_wfs_featuretype[$cnt_layer] = $element[value];
+						 }
+						 if(strtoupper($element[tag]) == "METADATAURL" && $element[type] == "open"){
+							 $metadataurl = true;
+						 }
+						 if(strtoupper($element[tag]) == "DATAURL" && $element[type] == "open"){
+							 $dataurl = true;
+						 }
+						 if(strtoupper($element[tag]) == "FORMATLIST" && $element[type] == "open"){
+							 $formatlist = true;
+							 $cnt_format = -1;
+						 }
+						 if(strtoupper($element[tag]) == "STYLELIST" && $element[type] == "open"){
+							 $stylelist = true;
+							 $cnt_style = -1;
+						 }
+					 }
 				}
 			}
 		}
-		
-		// set WMS data
-		
-		$layerlistCompleteArray = array_merge($layerlistArray["main"], $layerlistArray["overview"]);
-		
-		for ($i = 0; $i < count($layerlistCompleteArray); $i++) {
-			$this->setLayerData($layerlistCompleteArray[$i]);
-		}
-
 		return true;
+	  //return $verbose;
 	}
 
 	/**
-	 * Saves the current WMC in the log folder.
+	 * Creates JS code manipulating the map and wms objects, 
+	 * by this displaying the WMC
 	 * 
-	 * @return string the filename of the WMC document.
+	 * @param string $target the link to the map object, f.e. "parent." or "window.opener."
+	 * @param string $mapObj the name of the map object, f.e. "mapframe1"
+	 * @param string $action "load", "merge" or "append"
+	 * 
+	 * @return string the JS code
 	 */
-	private function saveAsFile() {
-		if ($this->saveWmcAsFile) {
-			$filename = "wmc_" . date("Y_m_d_H_i_s") . ".xml";
-			$logfile = "../tmp/" . $filename;
-			
-			if($h = fopen($logfile,"a")){
-				$content = $this->xml;
-				if(!fwrite($h,$content)){
-					$e = new mb_exception("class_wmc.php: failed to write wmc.");
-					return false;
-				}
-				fclose($h);
+	function createJsObjFromWMC($target, $mapObj, $action){
+		
+		/*
+		 * counts how often a layer has been loaded
+		 */
+		if ($this->monitoringIsOn) {
+			$monitor = new Layer_load_count();
+			for ($i = 0; $i < count($this->wmc_layer_id); $i++) {
+				$monitor->increment($this->wmc_layer_id[$i]);
 			}
-			$e = new mb_notice("class_wmc: saving WMC as file " . $filename . "; You can turn this behaviour off in class_wmc.php");
-			return $filename;
 		}
-		return null;
-	}
-	
-	/**
-	 * Called during WMC parsing; sets the data of a single layer.
-	 * 
-	 * @return 
-	 * @param $currentLayer Array an associative array with layer data
-	 */
-	private function setLayerData ($currentLayer) {
-		$currentMap = $this->mainMap;
-		$currentMapIsOverview = false;
-
-		if ($currentLayer["extension"]["ISOVERVIEWLAYER"] == "1") {
-			$currentMap = $this->overviewMap;
-			$currentMapIsOverview = true;
+		
+		$wmc_string = "";
+		$validActions = array("load", "merge", "append");
+		if (!in_array($action, $validActions)) {
+			$wmc_string .= "alert('invalid action: ".$action."');";			
 		}
-
-		$wmsArray = $currentMap->getWmsArray();
-
-		//
-		// check if current layer belongs to an existing WMS.
-		// If yes, store the index of this WMS in $wmsIndex.
-		// If not, set the value to null.
-		//
-		$wmsIndex = null;
-
-		// find last WMS with the same online resource
-		for ($i = count($wmsArray) - 1; $i >= 0; $i--) {
-			if (isset($currentLayer["url"]) && 
-				$currentLayer["url"] == $wmsArray[$i]->wms_getmap) {
-					$wmsIndex = $i;
-					break;
+		else {
+			
+			// general extension
+			if (count($this->wmc_general_extension) > 0) {
+				$json = new Mapbender_JSON();
+				$wmc_string .= $target . "restoredWmcExtensionData = " . $json->encode($this->wmc_general_extension) . ";\n"; 
 			}
-		}
-
-		// Even if this WMS has been found before it could still
-		// be a duplicate! We would have to create a new WMS and 
-		// not append this layer to that WMS.
-		// For the overview layer we never add a new wms.
-		// check if this layer is an overview layer. If yes, skip this layer.
-		if ($wmsIndex !== null && !$currentMapIsOverview) {
-
-			// check if this WMS has a layer equal to the current layer.
-			// If yes, this is a new WMS. If not, append this layer
-			// to the existing WMS.
-			$matchingWmsLayerArray = $this->wmsArray[$wmsIndex]->objLayer;
 			
-			for ($i = 0; $i < count($matchingWmsLayerArray); $i++) {
-				if ($matchingWmsLayerArray[$i]->layer_name == $currentLayer["name"]) {
-
-					// by re-setting the index to null, a new WMS will be 
-					// added below.
-					$wmsIndex = null;
-					break;
-				}
+			$wmc_string .= "var index = " . $target . "getMapObjIndexByName('" . $mapObj . "');\n";
+			if ($action == "load") {
+				// delete all previous wms
+				$wmc_string .= "while(" . $target . "mb_mapObj[index].wms.length > 0){" . $target . "mb_mapObjremoveWMS(index,0);}";
+				$wmc_string .= $target . "deleteWmsObject();\n";
 			}
-		}
-
-		// if yes, create a new WMS ...
-		if ($wmsIndex === null) {
-			$wmsIndex = 0;
-			$wms = new wms();
-
-			//
-			// set WMS data
-			//
-			$wms->wms_id = $currentLayer["extension"]["WMS_ID"]; // TO DO: how about WMS without ID?
-			$wms->wms_version = $currentLayer["version"];
-			$wms->wms_title = $currentLayer["wms_title"];
-			$wms->wms_abstract = $currentLayer["abstract"];
-			$wms->wms_getmap = $currentLayer["url"];
-			$wms->wms_getfeatureinfo = $currentLayer["url"]; // TODO : Add correct data
+			if ($action == "merge") {
+				$wmc_string .= "var wms_exists = false;\n";				// true if this wms exists in the mapObj
+				$wmc_string .= "var current_wms_index = null;\n";		// if wms_exists: index of the wms in the map obj; else: null
+				$wmc_string .= "var layer_exists = false;\n";			// true if this layer exists in an existing wms of the mapObj
+				$wmc_string .= "var current_layer_index = null;\n";		// if layer_exists: index of the layer of the wms in the mapObj; else: null
+			}
+			$new_wms = "";
+			$cnt_wms = -1;
+			$added_wms = array();
 			
-			$styleIndex = $currentLayer["styleIndex"];
-			$wms->wms_getlegendurl = $currentLayer["style"][$styleIndex]["legendurl"];
+			// for all layers in wmc, find individual wms...
+			for ($i = 0; $i < count($this->wmc_layer_title); $i++) {
+				$current_wms = $this->wmc_wms_serviceURL[$i];
+				// ...this is something like 'for every wms'
+				if (!in_array($current_wms , $added_wms)) {
+					$layerlist = "";
+					$querylayerlist = "";
+					$srs_array = array();
+		
+					if ($action == "merge") {
+						$wmc_string .= "wms_exists = false;\n";
+						$wmc_string .= "current_wms_index = null;\n";
+						$wmc_string .= "for (var m=0; m < " . $target . "mb_mapObj[index].wms.length; m++) {\n";
+						$wmc_string .= "\tif ('" . $this->wmc_wms_serviceURL[$i] . "' ==  " . $target . "mb_mapObj[index].wms[m].wms_getmap) {\n";
+						$wmc_string .= "\t\twms_exists = true;\n";
+						$wmc_string .= "\t\tcurrent_wms_index = m;\n";
+						$wmc_string .= "\t}\n";
+						$wmc_string .= "}\n";
+						$wmc_string .= "if (!wms_exists) {\n";
+					}				
+					 
+					$mywms = new wms();
+			
+			  		if(!$this->wmc_layer_title[$i] || $this->wmc_layer_title[$i] == ""){
+						echo "alert('Error: no valid capabilities-document !!');\n";
+						die; exit;
+					}
 
-			$wms->wms_filter = ""; // TODO : Add correct data
+					for($j=0;$j<count($this->wmc_layer_format[$i]);$j++){
+						if ($this->wmc_layer_format_current[$i][$j] == 1) {
+							$wms_data_format = $this->wmc_layer_format[$i][$j];
+						}
+					}
+					// add wms
+					$wmc_string .= "\t" . $target . "add_wms('".
+						$this->wmc_wms_id[$i]."','".
+						$this->wmc_wms_version[$i] ."','".
+						$this->wmc_wms_title[$i] ."','".
+						$this->wmc_layer_abstract[$i] ."','".
+						$this->wmc_wms_serviceURL[$i] ."','" .
+						$this->wmc_wms_serviceURL[$i] ."','" .
+						$this->wmc_layer_style_legendurl[$i][0] ."','','". 
+						$wms_data_format ."','text/html','application/vnd.ogc.se_xml','". 
+						$this->wmc_bBox_SRS ."','1','100','');\n";
+		
+					$added_wms[count($added_wms)] = $current_wms;
+					$cnt_wms++;
+					$cnt_layers = 0;
+					$cnt_query_layers = 0;
+					if ($action == "merge") {
+						$wmc_string .= "}\n";
+					}
+	
+					// add epsg
+					$wmc_string .= $target . "wms_addSRS('". 
+						$this->wmc_bBox_SRS ."','". 
+						$this->wmc_bBox_minx ."','". 
+						$this->wmc_bBox_miny ."','". 
+						$this->wmc_bBox_maxx ."','". 
+						$this->wmc_bBox_maxy ."','". 
+						"');\n";
 
-			$formatIndex = $currentLayer["formatIndex"];
-			$wms->gui_wms_mapformat = $currentLayer["format"][$formatIndex]["name"];
+					// for each layer...
+					for ($ii = 0; $ii < count($this->wmc_layer_title); $ii++) {
+						$layer_wms = $this->wmc_wms_serviceURL[$ii];
+						// ... of this wms
+						if ($current_wms == $layer_wms) {
+							
+							// add format (FIXME: is this working?)
+							$z = count($this->wmc_layer_format[$ii]);
+							for($j=0;$j<$z;$j++){
+								$wmc_string .= $target . "wms_add_data_type_format('map','". $this->wmc_layer_format[$ii][$j] ."');\n";
+							}
+							
+							if ($cnt_layers == 0) {
+								if ($action == "merge") {
+									$wmc_string .= "if (!wms_exists) {\n\t";
+								} 
+								// add parent layer
+								$wmc_string .= $target . "wms_add_layer('','".
+									$this->wmc_wms_layer_id[$i]."','','". 
+									$this->wmc_wms_title[$i] ."','','0','0','0','0','','".
+									$this->wmc_wms_id[$i]."','1','', '1','1','0','0','0','0','');\n";
+								if ($action == "merge") {
+									$wmc_string .= "}\n";
+								} 
+							}
+	
+							$cnt_layers++;
+							
+							if ($action == "merge") {
+								$wmc_string .= "if (wms_exists) {\n";
+								
+								// check if this layer already exists in this wms
+								$wmc_string .= "\tlayer_exists = false;\n";
+								$wmc_string .= "\tcurrent_layer_index = null;\n";
+								$wmc_string .= "\tfor (var m=0; m < " . $target . "mb_mapObj[index].wms[current_wms_index].objLayer.length; m++) {\n";
+								$wmc_string .= "\t\tif ('" . $this->wmc_layer_name[$ii] . "' ==  " . $target . "mb_mapObj[index].wms[current_wms_index].objLayer[m].layer_name) {\n";
+								$wmc_string .= "\t\t\tlayer_exists = true;\n";
+								$wmc_string .= "\t\t\tcurrent_layer_index = m;\n";
+								$wmc_string .= "\t\t}\n";
+								$wmc_string .= "\t}\n"; 
 
-			$wms->gui_wms_featureinfoformat = "text/html"; // TODO : Add correct data
-			$wms->gui_wms_exceptionformat = "application/vnd.ogc.se_xml"; // TODO : Add correct data
-			$wms->gui_wms_epsg = $this->mainMap->getEpsg();
-			$wms->gui_wms_visible = 1; // TODO : Add correct data
-			$wms->gui_wms_opacity = 100; // TODO : Add correct data
-			$wms->gui_wms_sldurl = $currentLayer["style"][$styleIndex]["sld_url"];
+								if ($this->wmc_layer_querylayer[$ii]!="") {
+									$querylayer_yn = $this->wmc_layer_querylayer[$ii];
+								}
+								else {
+									$querylayer_yn = $this->wmc_layer_queryable[$ii];
+								}			
+								$wmc_string .= "\tif (layer_exists) {\n";
+								// check if the visibility or the queryability are different to the existing layer
+								$wmc_string .= "\t\tif (" . $target . "mb_mapObj[index].wms[current_wms_index].objLayer[current_layer_index].gui_layer_visible != '" . intval(!$this->wmc_layer_hidden[$ii]) . "'";
+								$wmc_string .= " || " . $target . "mb_mapObj[index].wms[current_wms_index].objLayer[current_layer_index].gui_layer_querylayer != '" . $querylayer_yn . "') {\n";
+		
+								// if yes, update the visibility and queryability
+								$wmc_string .= "\t\t\t" . $target . "mb_mapObj[index].wms[current_wms_index].objLayer[current_layer_index].gui_layer_visible = " . intval(!$this->wmc_layer_hidden[$ii]) . ";\n"; 
+								$wmc_string .= "\t\t\t" . $target . "mb_mapObj[index].wms[current_wms_index].objLayer[current_layer_index].gui_layer_querylayer = " . $querylayer_yn . ";\n"; 
+								$wmc_string .= "\t\t}\n";
+								$wmc_string .= "\t}\n"; 
+								$wmc_string .= "}\n"; 
+								$wmc_string .= "\telse {\n";
+							} 
 
-			$wms->gui_epsg = $currentLayer["epsg"];
-			//
-			// set data formats
-			//
-			for ($i = 0; $i < count($currentLayer["format"]); $i++) {
-				array_push($wms->data_type, "map");							
-				array_push($wms->data_format, $currentLayer["format"][$i]["name"]);							
+							// add layer
+							$wmc_string .= "\t" . $target . "wms_add_layer('".
+								($this->wmc_layer_parent[$ii]!=""?$this->wmc_layer_parent[$ii]:"0") . "','". 
+								$this->wmc_layer_id[$ii] . "','". 
+								$this->wmc_layer_name[$ii] . "','". 
+								$this->wmc_layer_title[$ii] ."','". 
+								$this->wmc_layer_dataurl[$ii] . "','". 
+								($this->wmc_layer_pos[$ii]!=""?$this->wmc_layer_pos[$ii]:intval($cnt_layers)) ."','". 
+								$this->wmc_layer_queryable[$ii] ."','".
+								$this->wmc_layer_minscale[$ii]  ."','". 
+								$this->wmc_layer_maxscale[$ii]  ."','". 
+								$this->wmc_layer_metadataurl[$ii] ."','". 
+								$this->wmc_wms_id[$i] ."','1','', '1','". 
+								intval(!$this->wmc_layer_hidden[$ii]) ."','". 
+								$this->wmc_layer_queryable[$ii] ."','". 
+								($this->wmc_layer_querylayer[$ii]!=""?$this->wmc_layer_querylayer[$ii]:$this->wmc_layer_queryable[$ii]) ."','".
+								($this->wmc_gui_layer_minscale[$ii]!=""?$this->wmc_gui_layer_minscale[$ii]:$this->wmc_layer_minscale[$ii]) ."','".
+								($this->wmc_gui_layer_maxscale[$ii]!=""?$this->wmc_gui_layer_maxscale[$ii]:$this->wmc_layer_maxscale[$ii]) ."','".
+								$this->wmc_layer_wfs_featuretype[$ii] . "');\n";
+	
+							if ($action == "merge") {
+								$wmc_string .= "\t}\n";
+							} 
+												
+							// if layer is queryable, add it to querylayerlist
+							if (($this->wmc_layer_querylayer[$ii]!=""?$this->wmc_layer_querylayer[$ii]:$this->wmc_layer_queryable[$ii])) {
+								$cnt_query_layers++;
+								if (!in_array($this->wmc_layer_name[$ii], explode(",",$querylayerlist))) {
+									if ($querylayerlist == "") {$querylayerlist = $this->wmc_layer_name[$ii];} else {$querylayerlist .= "," . $this->wmc_layer_name[$ii];} 
+								}
+							}
+							// if layer is visible, add it to layerlist 
+							if (intval(!$this->wmc_layer_hidden[$ii]) && !in_array($this->wmc_layer_name[$ii], explode(",",$layerlist))) {
+								if ($layerlist == "") {$layerlist = $this->wmc_layer_name[$ii];} else {$layerlist .= "," . $this->wmc_layer_name[$ii];}
+							}
+	
+							// add layer style (FIXME: is this working?)
+							for($j=0; $j<count($this->wmc_layer_style_name[$ii]);$j++){
+								$wmc_string .= $target . "wms_addLayerStyle('".$this->wmc_layer_style_name[$ii][$j] ."','".$this->wmc_layer_style_title[$ii][$j] ."','".$j."','".$cnt_layers."', '" . $this->wmc_layer_style_legendurl[$ii][$j] . "', '" . $this->wmc_layer_style_legendurl_format[$ii][$j] . "');\n";
+							}
+						}
+					}
+					// add wms to mapObj with all layers and querylayers
+					if ($action == "merge") {
+						$wmc_string .= "if (!wms_exists) {\n";
+					} 
+					$wmc_string .= $target. "mb_mapObjaddWMSwithLayers('" . $mapObj . "', '" . $layerlist . "', '" . $querylayerlist . "');\n";
+					if ($action == "merge") {
+						$wmc_string .= "}\n";
+						$wmc_string .= "else {\n";
+						$wmc_string .= $target. "mb_mapObj[index].layers[current_wms_index] = \"" . $layerlist . "\";\n";
+						$wmc_string .= $target. "mb_mapObj[index].querylayers[current_wms_index] = \"" . $querylayerlist . "\";\n";
+						$wmc_string .= "}\n";
+					}
+				}
 			}
+			$wmc_string .= "var old_mapObj = ".$target."cloneObject(".$target."mb_mapObj);\n";
+			$wmc_string .= $target . "deleteMapObj();\n";
+			$wmc_string .= "for (var i=0; i<old_mapObj.length; i++) {\n";
+			$wmc_string .= "\tif (old_mapObj[i].frameName != 'overview') {\n";
+			$wmc_string .= "\t\t" . $target . "mb_registerMapObj(old_mapObj[i].frameName, old_mapObj[i].elementName, null, " . $this->wmc_windowWidth . ", " . $this->wmc_windowHeight . ");\n"; 
+			$wmc_string .= "\t\t" . $target . "document.getElementById(old_mapObj[i].frameName).style.width = " . $this->wmc_windowWidth . ";\n";
+			$wmc_string .= "\t\t" . $target . "document.getElementById(old_mapObj[i].frameName).style.height = " . $this->wmc_windowHeight . ";\n";
+			$wmc_string .= "\t}\n";
+			$wmc_string .= "\telse {\n";
+			$wmc_string .= "\t\tvar found = false;\n";
+			$wmc_string .= "\t\tfor (var j=0; j < " . $target . "wms.length && found == false; j++) {\n";
+			$wmc_string .= "\t\t\tif (" . $target . "wms[j].wms_getmap == old_mapObj[i].wms[0].wms_getmap) {\n";
+			$wmc_string .= "\t\t\t\t" . $target . "mb_registerMapObj('overview', old_mapObj[i].elementName, j, old_mapObj[i].width,  old_mapObj[i].width);\n"; 
+			$wmc_string .= "\t\t\t\tfound = true;\n"; 
+			$wmc_string .= "\t\t\t}\n";
+			$wmc_string .= "\t\t}\n";
+			$wmc_string .= "\t\tif (!found) {\n";
+			$wmc_string .= "\t\t\t" . $target . "mb_registerMapObj('overview', old_mapObj[i].elementName, 0, old_mapObj[i].width,  old_mapObj[i].width);\n"; 
+			$wmc_string .= "\t\t}\n";
+			$wmc_string .= "\t}\n";
+			$wmc_string .= "}\n";
+			
+			$ov_bbox = array();
+			// compute the union of the overview and the mapframe bbox for the new overview bbox
+			if ($this->wmc_general_extension["ov_minx"] && $this->wmc_general_extension["ov_miny"] && 
+				$this->wmc_general_extension["ov_maxx"] && $this->wmc_general_extension["ov_maxy"]) {
 
-			// set root layer
-			$wms->addLayer(0, "");
-			$wms->objLayer[0]->layer_uid = $currentLayer["extension"]["WMS_LAYER_ID"];
-			$wms->objLayer[0]->layer_name = $currentLayer["extension"]["WMS_NAME"];
-			$wms->objLayer[0]->layer_title = $currentLayer["wms_title"];
-			$wms->objLayer[0]->layer_pos = 0;
-			$wms->objLayer[0]->layer_queryable = 0;
-			$wms->objLayer[0]->layer_minscale = 0;
-			$wms->objLayer[0]->layer_maxscale = 0;
-			$wms->objLayer[0]->gui_layer_wms_id = $currentLayer["extension"]["WMS_LAYER_ID"];
-			$wms->objLayer[0]->gui_layer_status = 1;
-			$wms->objLayer[0]->gui_layer_selectable = 1; 
-			$wms->objLayer[0]->gui_layer_visible = 1;
-			$wms->objLayer[0]->gui_layer_queryable = 0;
-			$wms->objLayer[0]->gui_layer_querylayer = 0;
-			$wms->objLayer[0]->gui_layer_minscale = 0;
-			$wms->objLayer[0]->gui_layer_maxscale = 0;
-
-			// layer epsg
-			if ($currentLayer["extension"]["EPSG"]) {
-				$layerEpsgArray = array();
-				$layerMinXArray = array();
-				$layerMinYArray = array();
-				$layerMaxXArray = array();
-				$layerMaxYArray = array();
-				if (!is_array($currentLayer["extension"]["EPSG"])) {
-					$layerEpsgArray[0] = $currentLayer["extension"]["EPSG"];
-					$layerMinXArray[0] = $currentLayer["extension"]["MINX"];
-					$layerMinYArray[0] = $currentLayer["extension"]["MINY"];
-					$layerMaxXArray[0] = $currentLayer["extension"]["MAXX"];
-					$layerMaxYArray[0] = $currentLayer["extension"]["MAXY"];
+				// box for overview
+				$ov_min = new Mapbender_point($this->wmc_general_extension["ov_minx"], $this->wmc_general_extension["ov_miny"], $this->wmc_bBox_SRS);
+				$ov_max = new Mapbender_point($this->wmc_general_extension["ov_maxx"], $this->wmc_general_extension["ov_maxy"], $this->wmc_bBox_SRS);
+				$ov_box = new Mapbender_bbox($ov_min, $ov_max, $this->wmc_bBox_SRS);
+				
+				// box for mapframe
+				$mf_min = new Mapbender_point($this->wmc_bBox_minx, $this->wmc_bBox_miny, $this->wmc_bBox_SRS);
+				$mf_max = new Mapbender_point($this->wmc_bBox_maxx, $this->wmc_bBox_maxy, $this->wmc_bBox_SRS);
+				$mf_box = new Mapbender_bbox($mf_min, $mf_max, $this->wmc_bBox_SRS);
+				
+				$unionBox = Mapbender_bbox::union(array($ov_box, $mf_box));
+				
+				array_push($ov_bbox, $unionBox->min->x); 				
+				array_push($ov_bbox, $unionBox->min->y); 				
+				array_push($ov_bbox, $unionBox->max->x); 				
+				array_push($ov_bbox, $unionBox->max->y); 				
+			}
+			else {
+/*
+				$sql = "SELECT minx, miny, maxx, maxy FROM layer_epsg WHERE fkey_layer_id = $1 AND epsg = $2 LIMIT 1";
+				$v = array($this->wmc_layer_id[0], $this->wmc_bBox_SRS);
+				$t = array('i', 's');
+				$res = db_prep_query($sql, $v, $t);
+				$row = db_fetch_array($res);
+				if ($row["minx"] && $row["miny"] && $row["maxx"] && $row["maxy"]) {
+					$ov_bbox = array($row["minx"],$row["miny"],$row["maxx"],$row["maxy"]);
 				}
+				else if ($this->wmc_layer_id[0] && $this->wmc_bBox_SRS){
+					$ov_bbox = array($this->wmc_bBox_minx, $this->wmc_bBox_miny, $this->wmc_bBox_maxx, $this->wmc_bBox_maxy);
+				}
 				else {
-					$layerEpsgArray = $currentLayer["extension"]["EPSG"];
-					$layerMinXArray = $currentLayer["extension"]["MINX"];
-					$layerMinYArray = $currentLayer["extension"]["MINY"];
-					$layerMaxXArray = $currentLayer["extension"]["MAXX"];
-					$layerMaxYArray = $currentLayer["extension"]["MAXY"];
-				}
-	
-				for ($i=0; $i < count($layerEpsgArray); $i++) {
-					$currentLayerEpsg = array();
-					$currentLayerEpsg["epsg"] = $layerEpsgArray[$i];
-					$currentLayerEpsg["minx"] = floatval($layerMinXArray[$i]);
-					$currentLayerEpsg["miny"] = floatval($layerMinYArray[$i]); 
-					$currentLayerEpsg["maxx"] = floatval($layerMaxXArray[$i]);
-					$currentLayerEpsg["maxy"] = floatval($layerMaxYArray[$i]);
-					array_push($wms->objLayer[0]->layer_epsg, $currentLayerEpsg);
-				}
-			}			
-			// add WMS
-			array_push($wmsArray, $wms);
-
-			// the index of the WMS we just added
-			$wmsIndex = count($wmsArray) - 1;
-		}
-
-		// add layer to existing WMS ...
-		$currentWms = $wmsArray[$wmsIndex];
-		$currentWms->newLayer($currentLayer, null);
-		$currentMap->setWmsArray($wmsArray);
-		return true;
-	}
-	
-	/**
-	 * Called during WMC parsing; sets the maps within a WMC.
-	 * 
-	 * @return 
-	 */
-	private function setMapData () {
-		if ($this->generalExtensionArray["OV_WIDTH"] && 
-			$this->generalExtensionArray["OV_HEIGHT"] &&
-			$this->generalExtensionArray["OV_FRAMENAME"] &&
-			$this->generalExtensionArray["OV_MINX"] &&
-			$this->generalExtensionArray["OV_MINY"] &&
-			$this->generalExtensionArray["OV_MAXX"] &&
-			$this->generalExtensionArray["OV_MAXY"] &&
-			$this->generalExtensionArray["OV_SRS"]) {
+*/
+					$ov_bbox = array(2412139.175257732, 5365000, 2767860.824742268, 5700000);		
+//				}
+			}
 			
-			$this->overviewMap = new Map();
-			$this->overviewMap->setWidth($this->generalExtensionArray["OV_WIDTH"]);
-			$this->overviewMap->setHeight($this->generalExtensionArray["OV_HEIGHT"]);
-			$this->overviewMap->setFrameName($this->generalExtensionArray["OV_FRAMENAME"]);
-			$this->overviewMap->setIsOverview(true);
-
-			$bbox = new Mapbender_bbox($this->generalExtensionArray["OV_MINX"], $this->generalExtensionArray["OV_MINY"], $this->generalExtensionArray["OV_MAXX"], $this->generalExtensionArray["OV_MAXY"], $this->generalExtensionArray["OV_SRS"]);
-			$this->overviewMap->setExtent($bbox);
+			$wmc_string .= "for (var i=0; i<old_mapObj.length; i++) {\n";
+			$wmc_string .= "\tif (old_mapObj[i].frameName != 'overview') {\n";
+			$wmc_string .= "\t\t".$target."mb_calculateExtent(old_mapObj[i].frameName, ";
+			$wmc_string .= $this->wmc_bBox_minx .",".$this->wmc_bBox_miny .",";
+			$wmc_string .= $this->wmc_bBox_maxx .",".$this->wmc_bBox_maxy.");\n";
+			$wmc_string .= "\t}\n";
+			$wmc_string .= "\telse {\n";
+			$wmc_string .= "\t\t".$target."mb_calculateExtent(old_mapObj[i].frameName, ";
+			$wmc_string .= $ov_bbox[0] .",".$ov_bbox[1] .",";
+			$wmc_string .= $ov_bbox[2] .",".$ov_bbox[3] .");\n";
+			$wmc_string .= "\t}\n";
+			$wmc_string .= "\t". $target . "setMapRequest(old_mapObj[i].frameName);\n";
+			$wmc_string .= "}\n";
+			$wmc_string .= $target . "mb_execloadWmsSubFunctions();\n";
 		}
-		if ($this->generalExtensionArray["MAIN_FRAMENAME"]) {
-			$this->mainMap->setFrameName($this->generalExtensionArray["MAIN_FRAMENAME"]);
-		}
-		else {
-			$this->mainMap->setFrameName("mapframe1");
-		}
-		return true;
+//		$e = new mb_exception("js code: " . $wmc_string);
+		return $wmc_string;
 	}
-
-	/**
-	 * Creates a WMC document (XML) from the current object
-	 * 
-	 * @return String XML
-	 */
-	private function createXml() {
-		$wmcToXml = new WmcToXml($this);
-		$this->xml = $wmcToXml->getXml();
-	}
-
-	
 } 
-
-/**
- * @deprecated
- */
-function mb_utf8_encode ($str) {
-//	if(CHARSET=="UTF-8") return utf8_encode($str);
-	return $str;
-}
-
-/**
- * @deprecated
- */
-function mb_utf8_decode ($str) {
-//	if(CHARSET=="UTF-8") return utf8_decode($str);
-	return $str;
-}
+// end class
 ?>

Modified: branches/print_dev/http/classes/class_wms.php
===================================================================
--- branches/print_dev/http/classes/class_wms.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/classes/class_wms.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,7 +1,7 @@
 <?php
 # $Id$
 # http://www.mapbender.org/index.php/class_wms
-# Copyright (C) 2002 CCGIS 
+# 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
@@ -19,7 +19,6 @@
 
 require_once(dirname(__FILE__)."/../../core/globalSettings.php");
 require_once(dirname(__FILE__)."/class_connector.php");
-require_once(dirname(__FILE__)."/class_user.php");
 require_once(dirname(__FILE__)."/class_administration.php");
 
 class wms {
@@ -35,7 +34,7 @@
 	var $wms_getfeatureinfo;
 	var $wms_getlegendurl;
 	var $wms_upload_url;
-	  
+
 	var $fees;
 	var $accessconstraints;
 	var $contactperson;
@@ -49,174 +48,34 @@
 	var $contactvoicetelephone;
 	var $contactfacsimiletelephone;
 	var $contactelectronicmailaddress;
-	  
+
 	var $wms_keyword = array();
-	var $data_type = array(); 
+	var $data_type = array();
 	var $data_format = array();
-	var $objLayer = 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;
-		}
+	function wms() {
 	}
-*/	
-	
-	/**
-	 * 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;
@@ -224,13 +83,13 @@
 		else {
 			$this->wms_status = true;
 		}
-			
+
 		$values = null;
 		$tags = null;
 		$admin = new administration();
 		$this->wms_getcapabilities_doc = $data;
 		$this->wms_upload_url = $url;
-		
+
 		$this->wms_id = "";
 		$parser = xml_parser_create("");
 		xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
@@ -240,22 +99,22 @@
 
 		$code = xml_get_error_code($parser);
 		if ($code) {
-			$line = xml_get_current_line_number($parser); 
+			$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; 
+		$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];
@@ -308,7 +167,7 @@
 	  		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"){
@@ -463,7 +322,7 @@
 			}
 	      /*legend section*/
 	      if($this->wms_version == "1.0.0"){
-	      
+
 	      }
 	      else{
 	        if(mb_strtoupper($element[tag]) == "GETLEGENDGRAPHIC" && $element[type] == "open"){
@@ -480,17 +339,17 @@
 			}
 			if(mb_strtoupper($element[tag]) == "GETLEGENDGRAPHIC" && $element[type] == "close"){
 				$section = "";
-			}         
+			}
 	      }
-			/* sld 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*/				
+
+			/*layer section*/
 			if(mb_strtoupper($element[tag]) == "LAYER"){
 				$section = "layer";
 				if ($element[type] == "open") {
@@ -502,7 +361,7 @@
 					$this->objLayer[$cnt_layer]->layer_queryable = $element[attributes][queryable];
 				}
 				if ($element[type] == "close") {
-				
+
 				}
 			}
 			/* attribution */
@@ -546,7 +405,7 @@
 				}
 			    if(mb_strtoupper($element[tag]) == "LEGENDURL" && $element[type] == "close"){
 					$legendurl = false;
-				}   
+				}
 			}
 			/* end of styles */
 			if($section == "layer"){
@@ -570,8 +429,8 @@
 				}
 			    if(mb_strtoupper($element[tag]) == "DATAURL" && $element[type] == "close"){
 					$dataurl = false;
-				}   
-				
+				}
+
 				if(mb_strtoupper($element[tag]) == "METADATAURL" && $element[type] == "open"){
 					$metadataurl = true;
 				}
@@ -580,13 +439,13 @@
 				}
 			    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)));  				
-				}						      
+					$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";
@@ -608,12 +467,12 @@
 					}
 				}
 				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]; 	
+					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;
 			}
@@ -621,13 +480,13 @@
 		if(!$this->wms_title || $this->wms_title == "" || !$this->wms_getmap || $this->wms_getmap == ""){
 			$this->wms_status = false;
 			$this->optimizeWMS();
-			$e = new mb_exception("class_wms: createObjFromXML: WMS " . $url . " could not be loaded.");
+
 			return false;
 		}
 		else{
 			$this->wms_status = true;
 			$this->optimizeWMS();
-			$e = new mb_notice("class_wms: createObjFromXML: WMS " . $url . " has been loaded successfully.");
+
 			return true;
 		}
 	}
@@ -677,7 +536,7 @@
 		}
 		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; 
+				$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;
@@ -686,7 +545,7 @@
 				}
 			}
 			if($this->objLayer[$i]->layer_name == ""){
-				$this->objLayer[$i]->layer_name = $this->objLayer[$i]->layer_title;
+				$this->objLayer[$i]->layer_name = "";
 			}
 			if($this->objLayer[$i]->layer_minscale == ""){
 				$this->objLayer[$i]->layer_minscale = 0;
@@ -708,11 +567,11 @@
 			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++){
@@ -729,7 +588,7 @@
 				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];
 		}
@@ -748,7 +607,7 @@
 		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;
@@ -763,7 +622,7 @@
 				$this->wms_remotewfs = 0;
 		}
 	  }
-	
+
 	function displayWMS(){
 		echo "<br>id: " . $this->wms_id . " <br>";
 		echo "version: " . $this->wms_version . " <br>";
@@ -774,13 +633,13 @@
 		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_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 "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>";
 		}
@@ -807,8 +666,8 @@
 	        echo "<hr>";
 	        echo "<hr>";
 		}
-	} 
-	  function addLayer($id,$parent){	
+	}
+	  function addLayer($id,$parent){
 		$this->objLayer[count($this->objLayer)] = new layer($id,$parent);
 	  }
 	  /**
@@ -817,105 +676,17 @@
 	  function stripEndlineAndCarriageReturn($string) {
 	  	return preg_replace("/\n/", "", preg_replace("/\r/", " ", $string));
 	  }
-		function createJsObjFromWMS($parent=0){
-			echo $this->createJsObjFromWMS_($parent);
-		}
-		
-
-	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 ($currentLayer["extension"]["EPSG"]) {
-			$layerEpsgArray = array();
-			$layerMinXArray = array();
-			$layerMinYArray = array();
-			$layerMaxXArray = array();
-			$layerMaxYArray = array();
-			if (!is_array($currentLayer["extension"]["EPSG"])) {
-				$layerEpsgArray[0] = $currentLayer["extension"]["EPSG"];
-				$layerMinXArray[0] = $currentLayer["extension"]["MINX"];
-				$layerMinYArray[0] = $currentLayer["extension"]["MINY"];
-				$layerMaxXArray[0] = $currentLayer["extension"]["MAXX"];
-				$layerMaxYArray[0] = $currentLayer["extension"]["MAXY"];
-			}
-			else {
-				$layerEpsgArray = $currentLayer["extension"]["EPSG"];
-				$layerMinXArray = $currentLayer["extension"]["MINX"];
-				$layerMinYArray = $currentLayer["extension"]["MINY"];
-				$layerMaxXArray = $currentLayer["extension"]["MAXX"];
-				$layerMaxYArray = $currentLayer["extension"]["MAXY"];
-			}
-
-			for ($i=0; $i < count($layerEpsgArray); $i++) {
-				$currentLayerEpsg = array();
-				$currentLayerEpsg["epsg"] = $layerEpsgArray[$i];
-				$currentLayerEpsg["minx"] = floatval($layerMinXArray[$i]);
-				$currentLayerEpsg["miny"] = floatval($layerMinYArray[$i]); 
-				$currentLayerEpsg["maxx"] = floatval($layerMaxXArray[$i]);
-				$currentLayerEpsg["maxy"] = floatval($layerMaxYArray[$i]);
-				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 = "";
+	  function createJsObjFromWMS($parent=0){
 	  	if(!$this->wms_title || $this->wms_title == ""){
-			$str .= "alert('Error: no valid capabilities-document !!');";
+			echo "alert('Error: no valid capabilities-document !!');";
 			die; exit;
 		}
 			if($parent){
-				$str .=  "parent.";
+				echo "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 ."'," .
@@ -933,77 +704,71 @@
 					"'" . $this->gui_wms_opacity ."'," .
 					"'" . $this->gui_wms_sldurl ."" .
 					"');";
-			$str .=  $add_wms_string;
-			
+			echo $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";		
+				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($parent){
-				$str .= "parent.";
+				echo "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 ."','". 
+			print ("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_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";
-				
+				$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.";
+					echo "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";
+					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){
-					$str .=  "parent.";
+				echo "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";
+				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){
-				$str .= "parent.";
+				echo "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";
+				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");
 			}
 		}
-		return $str;
 	  }
-	  
+
 	  function createJsLayerObjFromWMS($parent=0, $layer_name){
 	  	if(!$this->wms_title || $this->wms_title == ""){
 			echo " alert('Error: no valid capabilities-document !!');";
@@ -1014,54 +779,54 @@
 			}
 			// wms_title and abstract have previously been urlencoded
 			// this solution may not yet be the ultimate one
-			print("add_wms('". 
+			print("add_wms('".
 			$this->wms_id ."','".
 			$this->wms_version ."','".
 			preg_replace("/'/", "", $this->wms_title) ."','".
-			preg_replace("/'/", "", $this->wms_abstract) ."','". 
+			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_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";		
+			}
+			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 ."','". 
+			 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_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++){
@@ -1069,21 +834,21 @@
 					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"] ."','". 
+					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"] ."','". 
+				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++){
@@ -1092,15 +857,15 @@
 				}
 				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 
+	* this function exports the information from the xml to the mapbender database
 	*/
 	function writeObjInDB($gui_id){
 		global $con;
@@ -1108,7 +873,7 @@
 
 		$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, ";
@@ -1129,25 +894,25 @@
 		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);	
-			
+		$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');
@@ -1155,7 +920,7 @@
 		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)";
@@ -1165,10 +930,10 @@
 		$t = array('s','i','i','s','s','s','s');
 		$res = db_prep_query($sql,$v,$t);
 		if(!$res){
-			db_rollback();	
+			db_rollback();
 		}
 		db_commit();
-	    
+
 	    #Changes JW
 	    $this->wms_id = $myWMS;
 	}
@@ -1194,19 +959,19 @@
 		$t = array('i','i','s','s','s','i','i','i','s','s','s');
 		$res = db_prep_query($sql,$v,$t);
 		if(!$res){
-			db_rollback();	
+			db_rollback();
 		}
 		else {
-			# save the id of each layer: set param2 true		
+			# 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);	
-		
+			$this->insertLayerKeyword($i);
+
 		}
 	}
 	function updateLayer($i,$myWMS){
@@ -1215,14 +980,14 @@
 		$t = array('i','s');
 		$res = db_prep_query($sql,$v,$t);
 		if($row = db_fetch_array($res)){
-			$l_id = $row['layer_id'];	
+			$l_id = $row['layer_id'];
 		}
 		else{
 			db_rollback();
 			$e = new mb_exception("Not found: ".$this->objLayer[$i]->layer_name);
-			return;	
-		}	
-		
+			return;
+		}
+
 		$sql = "UPDATE layer SET ";
 		$sql .= "layer_pos = $1, ";
 		$sql .= "layer_parent = $2, ";
@@ -1234,7 +999,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;
 		}
@@ -1248,7 +1013,7 @@
 				$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		
+				$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);
@@ -1257,20 +1022,20 @@
 			$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();	
+			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){
@@ -1280,7 +1045,7 @@
 	}
 	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) ";
@@ -1297,12 +1062,12 @@
 		$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();	
-		}	
+			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) ";
@@ -1318,19 +1083,19 @@
 		$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();	
-		}	
+			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)";		
+			$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');		
+			$t = array('i','s');
 			$res = db_prep_query($sql,$v,$t);
 			if(!$res){
-				db_rollback();	
+				db_rollback();
 			}
-		}	
+		}
 	}
 	function insertFormat($myWMS){
 		for($i=0; $i<count($this->data_type);$i++){
@@ -1340,9 +1105,9 @@
 			$t = array('i','s','s');
 			$res = db_prep_query($sql,$v,$t);
 			if(!$res){
-				db_rollback();	
+				db_rollback();
 			}
-		}	
+		}
 	}
 	function insertLayerEPSG($i){
 		$sql = "DELETE FROM layer_epsg WHERE fkey_layer_id = $1";
@@ -1355,11 +1120,11 @@
 			$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();	
+				db_rollback();
 			}
 		}
 	}
@@ -1373,12 +1138,12 @@
 			$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"]				
+					$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();	
+				db_rollback();
 			}
 		}
 	}
@@ -1388,13 +1153,13 @@
 		$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]);
@@ -1403,7 +1168,7 @@
 				$row = db_fetch_array($res);
 			//print_r($row);
 				if ($row) {
-					$keyword_id = $row["keyword_id"];	
+					$keyword_id = $row["keyword_id"];
 				}
 				else {
 					$sql_insertKeyword = "INSERT INTO keyword (keyword)";
@@ -1412,7 +1177,7 @@
 					$t1 = array('s');
 					$res_insertKeyword = db_prep_query($sql_insertKeyword,$v1,$t1);
 					if(!$res_insertKeyword){
-						db_rollback();	
+						db_rollback();
 					}
 				}
 			}
@@ -1431,7 +1196,7 @@
 				$t1 = array('i','i');
 				$res1 = db_prep_query($sql1,$v1,$t1);
 				if(!$res1){
-					db_rollback();	
+					db_rollback();
 				}
 			}
 		}
@@ -1439,7 +1204,7 @@
 	function updateObjInDB($myWMS){
 		$admin = new administration();
 		db_begin();
-		
+
 		$sql = "UPDATE wms SET ";
 		$sql .= "wms_version = $1 ,";
 		$sql .= "wms_getcapabilities  = $2 ,";
@@ -1455,18 +1220,18 @@
 		$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,
 			$admin->char_encode($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();	
+			db_rollback();
 		}
-		
+
 		if($this->overwrite == true){
 			$sql = "UPDATE wms SET ";
 			$sql .= "wms_title  = $1 ,";
@@ -1485,7 +1250,7 @@
 			$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,
@@ -1493,33 +1258,33 @@
 			$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();	
+				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();	
+			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();	
+			db_rollback();
 		}
 		$this->insertFormat($myWMS);
-		
+
 		# update gui_wms
 		$this->update_gui_wms($myWMS);
-		
-		# update TABLE layer	
+
+		# update TABLE layer
 		# delete all layer which are outdated
 		$v = array($myWMS);
 		$t = array('i');
@@ -1529,16 +1294,16 @@
 			if($i>0){$sql .= ',';}
 			$sql .= "$".$c;
 			array_push($v,$this->objLayer[$i]->layer_name);
-			array_push($t,'s');		
+			array_push($t,'s');
 			$c++;
 		}
 		$sql .= ")";
-		
+
 		$res = db_prep_query($sql,$v,$t);
 		if(!$res){
-			db_rollback();	
+			db_rollback();
 		}
-			
+
 		# update or insert?
 		$sql = "SELECT layer_name FROM layer WHERE fkey_wms_id = $1";
 		$v = array($myWMS);
@@ -1548,7 +1313,7 @@
 		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');
@@ -1557,7 +1322,7 @@
 		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;
@@ -1575,7 +1340,7 @@
 			}
 		}
 		db_commit();
-		return;	
+		return;
 	}
 	function updateGuiLayer($i,$myWMS,$gui_id){
 		$sql = "SELECT layer_id FROM layer WHERE fkey_wms_id = $1 AND layer_name = $2";
@@ -1583,18 +1348,18 @@
 		$t = array('i','s');
 		$res = db_prep_query($sql,$v,$t);
 		if($row = db_fetch_array($res)){
-			$l_id = $row['layer_id'];	
+			$l_id = $row['layer_id'];
 		}
 		else{
 			db_rollback();
 			$e = new mb_exception("Not found: ".$this->objLayer[$i]->layer_name. " in gui: ".$gui_id);
-			return;	
+			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);		
+		$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 ";
@@ -1603,7 +1368,7 @@
 				$t = array('i','s');
 				$res1 = db_prep_query($sql1,$v,$t);
 				if(!$res1){
-					
+
 				db_rollback();
 				}
 			}
@@ -1614,7 +1379,7 @@
 				$t = array('i','s');
 				$res1 = db_prep_query($sql1,$v,$t);
 				if(!$res1){
-					
+
 					db_rollback();
 				}
 			}
@@ -1635,7 +1400,7 @@
 				$res1 = db_prep_query($sql1,$v,$t);
 				if(!$res1){db_rollback();
 				}
-			}		
+			}
 		}
 	}
 	function update_gui_wms($myWMS){
@@ -1645,14 +1410,14 @@
 		$t = array('i');
 		$res = db_prep_query($sql,$v,$t);
 		$cnt = 0;
-		while($row = db_fetch_array($res)){	
+		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;		
+			$paramCount = 0;
 
 			for($i=0; $i<count($this->data_type); $i++){
 				# gui_wms_mapformat
@@ -1691,7 +1456,7 @@
 				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"])){
@@ -1718,24 +1483,24 @@
 			if($mySubmit){
 				$res = db_prep_query($sql,$v,$t);
 				if(!$res){
-					db_rollback();	
+					db_rollback();
 					echo "<pre>".$sql."</pre><br> <br><p>";
-				 	echo db_error(); 
+				 	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;
 	}
@@ -1743,18 +1508,18 @@
 	/**
 	* 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=db_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"];
@@ -1763,7 +1528,7 @@
 			$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');
@@ -1788,7 +1553,7 @@
 					$this->wms_getcapabilities =  $row2["wms_getcapabilities"];
 					$this->wms_getfeatureinfo = $row2["wms_getfeatureinfo"];
 					$this->wms_getlegendurl = $row2["wms_getlegendurl"];
-				}			
+				}
 				// TO DO: Capabilities document needs to 
 				// be encoded to the original encoding
 				// if different from the database encoding
@@ -1798,24 +1563,24 @@
 				$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'); 
+			$t = array('i');
 			$res_wms = db_prep_query($sql,$v,$t);
-			$count_format=0;		
-			while($row3 = db_fetch_array($res_wms)){		
+			$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;";
@@ -1823,9 +1588,9 @@
 		$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"];		
+			$layer_id = $row["fkey_layer_id"];
 			$sql = "Select * from layer where layer_id = $1";
 			$v = array($layer_id);
 			$t = array('i');
@@ -1836,10 +1601,10 @@
 				$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_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_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"];
@@ -1856,12 +1621,12 @@
 			$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"];
@@ -1871,7 +1636,7 @@
 				$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);
@@ -1901,7 +1666,7 @@
 		}
 	   }
 	/** end createObjfromDB **/
-	
+
 	  /**
 	* creatObjfromDBNoGui
 	*
@@ -2056,14 +1821,14 @@
 	* 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);	  
+		$res_count= db_num_rows($res);
 		$wms_id=0;
 		if($res_count>0){
 			$count=0;
@@ -2074,7 +1839,7 @@
 		}
 		return $wms_id;
 	}
-	
+
 	function displayDBInformation(){
 		echo $this->wms_getcapabilities;
 		$sql="Select * from wms where wms_getcapabilities = $1";
@@ -2095,15 +1860,15 @@
 			$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); 
+	   $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>";
@@ -2111,7 +1876,7 @@
 	    	echo "gui_wms_epsg: " .  $row["gui_wms_epsg"]. " <br>";
 	      $count++;
 	   }
-		
+
 	   #db_close($connect);
 	}
 
@@ -2119,47 +1884,12 @@
 		if($this->wms_getcapabilities == '' || $this->wms_getmap == '' ){
 			echo "<br>Missing parameters: <br>";
 			$this->displayWMS();
-			print_r($this);
-			echo "<br> Data not committed<br>";
+			echo "<br> Data not commited<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 {	
+class layer extends wms {
 	var $layer_id;
 	var $layer_parent;
 	var $layer_name;
@@ -2168,31 +1898,25 @@
 	var $layer_pos;
 	var $layer_queryable;
 	var $layer_minscale;
-	var $layer_maxscale;	
+	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;	
-	
+	var $gui_layer_style = NULL;
+
 	function layer($id,$parent){
 		$this->layer_id = $id;
-		$this->layer_parent = $parent;	
-		//var_dump($this);	
+		$this->layer_parent = $parent;
+		//var_dump($this);
 	}
-
-	public function __toString () {
-		$e = new mb_exception("TITLE: " . $this->layer_title);
-		return $this->layer_title;
-	}
-	
 }
-?>
+?>
\ No newline at end of file

Added: branches/print_dev/http/classes/fonts/checksum.json
===================================================================
--- branches/print_dev/http/classes/fonts/checksum.json	                        (rev 0)
+++ branches/print_dev/http/classes/fonts/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"php_Helvetica-Oblique.afm":"4f1f91f4eb52c69be7b62bceae344a65ff3a6efa","Helvetica-BoldOblique.afm":"34be0cbac26900050711ea2204105583cd0cefa4","php_a010013l.afm":"69a79366c9be3e9126e9f82c220998fa992d5a54","php_Courier-BoldOblique.afm":"f6bf987c32d6afa84394261923150114a01f828e","Helvetica-Oblique.afm":"2bc41db76588e26b29a83e98193cfdc1eaa9cb0b","Times-Roman.afm":"f1d663623c89b0df01c984398db01d4d81c5c617","php_Times-Bold.afm":"ed6bc0cb6c1e12a435a571c53b0f83a17e8788f8","php_Times-Italic.afm":"b11e427f877d9e2c7e52438a9cab818f671cf340","Courier-Bold.afm":"4b3914c14e74ac71a0212273da0a5e8bebf8eb10","Courier.afm":"172a86930347c115517b6beeec7fae9469d3c1fa","php_Courier-Oblique.afm":"1d477876e19709d64c46977c72d6f5c0290961f9","php_Helvetica-Bold.afm":"3269991446dd0d5a01b489634f12963ef4675701","php_verdana.afm":"4ef96c0bf24ce39716cdc9a0a1f51f16a452949f","verdana.afm":"3bd47fc4c985bdd671c1487dff63c97badd64db8","php_a0100131.afm":"69a79366c9be3e9126e9f82c220998fa992d5a54","php_Times-BoldItalic.afm":"afa56d4a282a169ac809ecd72ad8e4d808654585","Times-Italic.afm":"31bef2819b1ef0f65c9c798c4d24e4043528bc3a","ZapfDingbats.afm":"f5ae5a7dae0526350f80e9d0e03632afe061e70a","Courier-Oblique.afm":"2a55444c5e3e26a362faeaea96ac62fe5cdc1e7f","Times-Bold.afm":"c693321c94f532df82e790e7737e3ecfdd24755c","php_Symbol.afm":"3e12545346ef5e3e1cd8f4345091a3c2c318dc7d","php_Helvetica.afm":"8f805dd3b2dc7fbc4b9cd3a8ac1ac9d67e828a5d","Times-BoldItalic.afm":"09c8638ca7760f2358bddb96c48cc43709c791c1","Symbol.afm":"24ef9f1d981633530181c40da0b0f6ec6dbe48a1","php_ZapfDingbats.afm":"c0491d8314e19bbd2fa0bd4dc6fa30f48d83c9d5","php_Courier.afm":"dd82b764bcec919efbe298032cc845e923c71130","php_Courier-Bold.afm":"4adeba4209eb6d03036afc9d1f4e0509db76d291","php_Helvetica-BoldOblique.afm":"46d240de04aebdb13980cfeee376f9451b2d2bd6","Helvetica.afm":"6e4474d24fc18bc020912f03eac5c7bb705b260e","php_Times-Roman.afm":"6f31cf0582d63993231eafde61786e7e4df2d2ff","Helvetica-Bold.afm":"744b4d4d7920f0c668202471c8252a46a9f05b6f","Courier-BoldOblique.afm":"a6e166d2457f355830b4e7815148e82d2dd5f173"}
\ No newline at end of file

Added: branches/print_dev/http/classes/phpmailer-1.72/checksum.json
===================================================================
--- branches/print_dev/http/classes/phpmailer-1.72/checksum.json	                        (rev 0)
+++ branches/print_dev/http/classes/phpmailer-1.72/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"ChangeLog.txt":"eb2c1959156a2ab73c15c463c4422ab8afa126df","class.phpmailer.php":"d7e8d0f0ef62bff312c066e5827e9288eb06d217","LICENSE":"d580d4205ca9e848768265f15e4afb91422da78d","class.smtp.php":"23a1cf993487a08adb19c68efe9b69a255befb0d","mail.php":"ad643d9900bb888c029e262d23c6e571dda346f1"}
\ No newline at end of file

Added: branches/print_dev/http/classes/phpmailer-1.72/docs/checksum.json
===================================================================
--- branches/print_dev/http/classes/phpmailer-1.72/docs/checksum.json	                        (rev 0)
+++ branches/print_dev/http/classes/phpmailer-1.72/docs/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"faq.html":"d985f1ede29683980fe446e4f1678fcb00469834","timeoutfix.diff":"82a38bb4763fbf9293073f451db10f653cba8679","extending.html":"63eba7f05c1e772820f1f68605e90020e0e0388e"}
\ No newline at end of file

Added: branches/print_dev/http/classes/phpmailer-1.72/language/checksum.json
===================================================================
--- branches/print_dev/http/classes/phpmailer-1.72/language/checksum.json	                        (rev 0)
+++ branches/print_dev/http/classes/phpmailer-1.72/language/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"phpmailer.lang-br.php":"22c14ad6053c8d09bfdc5783b753a35874e07a24","phpmailer.lang-it.php":"cf57dfcefebcb921aa12c31075c627750462a657","phpmailer.lang-de.php":"e3ca52ae2d3677b71a9e371eb6003f41505ed21a","phpmailer.lang-nl.php":"73461ca6885ece5dcd7f40a1a25b73aa0021508f","phpmailer.lang-cz.php":"4c79abc39e14ecc10eb24dbc32b153090d76358d","phpmailer.lang-no.php":"550dec6d0d79feed44f3f4cdf5267764bfc32628","phpmailer.lang-fr.php":"538a293356a86526ada113cafe6c081371b71bb2","phpmailer.lang-es.php":"e053857411a801fe3eddb5a5a7afbe6025d05f1f","phpmailer.lang-tr.php":"233a9a062638c76b7ac0acbe9cd2253792f9ea60","phpmailer.lang-en.php":"fe1c0e68bb5353b80f124bd550b4583243de4827","phpmailer.lang-se.php":"1d221772e0faa7d76acd6eac8a6eb67151bfcef9"}
\ No newline at end of file

Added: branches/print_dev/http/classes/phpmailer-1.72/phpdoc/checksum.json
===================================================================
--- branches/print_dev/http/classes/phpmailer-1.72/phpdoc/checksum.json	                        (rev 0)
+++ branches/print_dev/http/classes/phpmailer-1.72/phpdoc/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"index-all.html":"82f19a905721e1d2fbff6c953eb0e0243af8117f","packages.html":"8a6360df5654240f4cafe17bd006afeb31905722","help-doc.html":"e3976175968a71ec0cb22bf5b1efb4c3a1c1d1d7","overview-tree.html":"52660dda7e0497daf3aad1d7f030ae620a5b083b","serialized-form.html":"b5ff9a0e811a13dcad44adc27122cfbfb3989cb5","stylesheet.css":"758271a4cf4352cdcdd2b69504c5b52cd9a9b9d8","deprecated-list.html":"047b040d4ca330bfe81443a62bd5aae3672ba166","index.html":"0a838ce988d174854c6afbe8cbcc9c145b1dd290","phpmailer.html":"43e2e714a25689923e5f00a8ce96ef61fc27bb22","allclasses-frame.html":"dd9e85dbf2d7413b4498af5423c58f206407588b"}
\ No newline at end of file

Added: branches/print_dev/http/classes/phpmailer-1.72/test/checksum.json
===================================================================
--- branches/print_dev/http/classes/phpmailer-1.72/test/checksum.json	                        (rev 0)
+++ branches/print_dev/http/classes/phpmailer-1.72/test/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"rocks.png":"57d12019b31b56322c12a2c5391b4a9c2c6c919a","phpunit.php":"bc5a03a0054e32053cf652a8b17c63fee2b42814","phpmailer_test.php":"124e598f80c026ced3d82d7ad9458a9143378f63"}
\ No newline at end of file

Modified: branches/print_dev/http/css/admin.screen.css
===================================================================
--- branches/print_dev/http/css/admin.screen.css	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/css/admin.screen.css	2008-10-06 10:40:54 UTC (rev 3125)
@@ -3,100 +3,285 @@
 /* ################################################## */
 
 * {
+	margin: 0;
+	padding: 0;
 	font-weight: normal;
 	font-style: normal;
 }
 
 body {
+	width: 350px;
+}
+
+body {
+	width: auto;
+	min-width: 350px;
+}
+
+body {
 	padding: 1em;
 	font-family: "Lucida Sans Unicode","Lucida Sans","Lucida Grande","Trebuchet MS",Verdana,Arial,Helvetica,sans-serif;
 	font-size: 12px;
-	line-height: 1.2em;
+	line-height: 1em;
 	color: #000;
-	background-color: #FFF;
+	background-color: #FFF; //#F3F3F3;
 }
 
 /* ################################################## */
 
 h1 {
 	margin-bottom: 1em;
-	font-size: 2em;
+	padding: .5em;
+	font-size: 1.5em;
 	color: #600;
+	background-color: #E3E3E3;
+	border: 1px solid #CCC;
+	-moz-border-radius: 5px;
 }
 
-p {
+p, ul {
 	margin-bottom: 1em;
-}
-
-a {
-	color: #09C;
-}
-
-a:hover {
-	text-decoration: none;
+	line-height: 1.25em;
 }
 
+a {
+	color: #09C;
+}
+
+a:hover {
+	text-decoration: none;
+}
+
+em {
+	font-size: .75em;
+	line-height: 1.25em;
+	text-transform: uppercase;
+	letter-spacing: 1px;
+	color: #999;
+}
+
 /* ################################################## */
 
 form {
 	clear: both;
 	margin-top: 1em;
+	padding-top: 1em;
+	padding-right: 1em;
+	padding-left: 1em;
+	background-color: #ffffff; //#E3E3E3;
+	border: 1px solid #CCC;
+	-moz-border-radius: 5px;
 }
 
-fieldset {
-	padding: 0;
-	border: 0;
+fieldset {
+	border: 0;
 }
 
 legend {
-	display: block;
-	margin: 0;
-	padding: 0;
+	display: block;
+	padding-bottom: .5em;
 	font-weight: bold;
 	text-transform: uppercase;
-	color: #600;
+	color: #600;
 }
 
-label {
-	margin-bottom: .5em;
+label {
+	color: #666;
 	white-space: nowrap;
 }
 
-input, textarea, select {
+input, textarea, select {
+	padding-top: .25em;
+	padding-right: .5em;
+	padding-bottom: .25em;
+	padding-left: .5em;
 	font: inherit;
-	background-color: #EEE;
-	border: 1px solid #CCC;
+	line-height: 1.2em;
+	background-color: #EEE;
+	border-width: 1px;
+	border-color: #FFF;
 }
-
+
+select option:hover {
+	background-color: #CCC;
+}
+
+input[type=submit], 
+input[type=reset],
+input[type=button] {
+	padding-right: .25em;
+	padding-left: .25em;
+	color: #000;
+	//background-color: #CCC;
+}
+
 hr {
-	clear: both;
-	height: 1px;
-	color: #FFF;
-	background-color: transparent;
+	clear: both;
+	background-color:transparent;
 	border: 0;
 }
 
 /* ################################################## */
-
-input.wide {
-	width: 100%;
-}
-
+
+.center {
+	text-align: center;
+}
+
+/* ################################################## */
+
+.topbar {
+	height: 1.75em;
+	line-height: 1.75em;
+	text-align: right;
+	list-style: none;
+	border: 1px solid #999;
+	white-space: nowrap;
+}
+
+.topbar li {
+	display: inline;
+	padding-top: .25em;
+	padding-right: 1.75em;
+	padding-bottom: .25em;
+	padding-left: 1.75em;
+	cursor: pointer;
+	border-left: 1px solid #999;
+}
+
+.topbar a {
+	font-size: .8em;
+	text-decoration: none;
+	text-transform: uppercase;
+	letter-spacing: 1px;
+	color: #999;
+}
+
+.topbar li:hover {
+	background-color: #999;
+}
+
+.topbar li:hover a,
+.topbar a:hover {
+	color: #E3E3E3;
+}
+
+/* ################################################## */
+
+.guiElements {
+	line-height: 1.75em;
+	list-style: none;
+}
+
+.guiElements li {
+	clear: both;
+	margin-bottom: .5em;
+	padding: .5em;
+	color: #CCC;
+	border: 1px solid #3C3C3C;
+}
+
+.guiElements img {
+	float: right
+}
+
+.guiElements li.active {
+	margin-top: 1.5em;
+	margin-left: 1.5em;
+	margin-bottom: 1.5em;
+	background-color: #363636;
+	border-left-width: 1.5em;
+}
+
+.guiElements li.active strong {
+	font-weight: bold;
+}
+
+.guiElements li:hover {
+	background-color: #363636;
+}
+
+.guiElements a {
+	margin-right: 1em;
+	font-weight: normal;
+	font-size: .8em;
+	text-decoration: none;
+	text-transform: uppercase;
+	letter-spacing: 1px;
+}
+
+.guiElements a:after {
+	content: " ""\00BB";
+	font-size: 1.5em;
+	color: #999;
+}
+
+.guiElements a:hover {
+	color: #E3E3E3;
+	background-color: #09C;
+}
+
+.guiElements a:hover:after {
+	color: #E3E3E3;
+}
+
+.guiElements em {
+	clear: both;
+	display: block;
+	padding-right: 3em;
+	font-weight: normal;
+	font-size: 1em;
+	text-transform: none;
+	letter-spacing: 0;
+	color: #999;
+}
+
+.guiElements small {
+	float: right;
+	width: 2em;
+	height: 2em;
+	margin-left: 1em;
+	font-size: .75em;
+	line-height: 2em;
+	text-align: center;
+	text-transform: uppercase;
+	letter-spacing: -1px;
+	color: #E3E3E3;
+	border-width: 1px;
+}
+
+.guiElements small.on {
+	background-color: #9C0;
+	border-style: inset;
+	border-color: #9C0;
+}
+
+.guiElements small.off {
+	background-color: #C00;
+	border-style: outset;
+	border-color: #C00;
+}
+
+.guiElements br {
+	visibility: hidden;
+	display: none;
+}
+
+/* ################################################## */
+
+ 
 .rightContainer {
 	float: right;
-	width: 40%;
-	margin-left: -1%;
+	width: 40%;
 }
 
 
 .leftContainer {
 	float: left;
-	width: 40%;
-	margin-right: -1%;
+	width: 40%;
 }
 
 .centerContainer {
-	float: left;
+	float: left;
 	width: 20%;
 	text-align: center;
 }
@@ -105,19 +290,68 @@
 	visibility: hidden;
 }
 
-.rightContainer select,
+.rightContainer select, input[type=text],
 .leftContainer select {
-	width: 100%;
+	width: 100%
 }
 
 .centerContainer input#add,
 .centerContainer input#remove {
-	margin-top: .5em;
-	margin-bottom: .5em;
+	margin-bottom: .5em;
 	padding-right: 1em;
-	padding-left: 1em;
+	padding-left: 1em;
+	color: #000;
 }
 
-#indicator img {
-	vertical-align: middle;
-}
\ No newline at end of file
+.topContainer,
+.bottomContainer {
+	margin-right: -1em;
+	margin-left: -1em;
+	padding: 1em;
+}
+
+.topContainer {
+	clear: both;
+	border-bottom: 1px dotted #CCC;
+}
+
+.bottomContainer {
+	clear: both;
+	border-top: 1px dotted #CCC;
+}
+
+.topContainer p, 
+.bottomContainer p {
+	margin: 0;
+	line-height: 1.5em;
+}
+
+/* ################################################## */
+
+.labeledFields p {
+	line-height: 2.5em;
+	color: #CCC;
+}
+
+.labeledFields label {
+	float: left;
+	width: 7.5em;
+	padding-right: 1em;
+	text-align: right;
+}
+
+.labeledFields label.inline {
+	float: none;
+	width: auto;
+	padding-right: 0;
+}
+
+/* ################################################## */
+
+#indicator {
+	float: right;
+	position: relative;
+	top: -.25em;
+	margin-left: -20px;
+	margin-bottom: -20px;
+}

Modified: branches/print_dev/http/css/administration_alloc.css
===================================================================
--- branches/print_dev/http/css/administration_alloc.css	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/css/administration_alloc.css	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,28 +1,16 @@
 body{
 	background-color : #ffffff;
-	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+	font-family: Arial, Helvetica, sans-serif;
 }
 select {
 	font-size: 11;
-	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+	font-family: "Times New Roman", Times, serif;
 	width: 200px;
 	font-weight : bold;
 }
 .select_short{
 	width: auto;
 }
-table{
-	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
-	font-size:11;
-}   
-
-.wms_button{
-	color: black;
-	border: solid thin;
-	height:22px;
-	width:60px;
-}
-
 checkbox{
 	background-color : #0066ff; 
 }
@@ -105,4 +93,4 @@
 	left: auto;
 	color : Red;
 	font-size : 13;
-}
+}
\ No newline at end of file

Added: branches/print_dev/http/css/checksum.json
===================================================================
--- branches/print_dev/http/css/checksum.json	                        (rev 0)
+++ branches/print_dev/http/css/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"treeGDE.css":"92808cb1ff96819429a2408add49109a54e540cf","login.css":"d8392ae18c63cb45928d386e14dd904a054e29de","metadata.css":"2df7f174411173407b69c8139cee688821f7a10c","admin_service.css":"b5901edb8c6dfd879c46e3f8f909965ce906853e","popup.css":"4469d1b1dcd5610051a7b60de272a09b180cff11","gazetteerSQL_ALK.css":"ecc55e5bb871165f90d779e8ccae9b5abe84ba23","styler-mod_treefolder.css":"b9fcab863c60f11c8cd0db3e83eaf57f5d4d5bcf","digitize.css":"ef0da7b4068c74c2566281a2b1cbf427889260ba","treeGDE2.css":"70c097332a9782acc441c7cf24e0eaff8d704676","meetingPoint.css":"17c354a1c6be1c0c0f6a2647c45293d6c00d2eea","sldEditor.css":"0e694cab88bfb7bfece43058002ed8114ade3005","gazetteerSQL_ALB.css":"c7038a3b46f1b26bbe3669fd0973ef4d32e92848","admin_user.css":"c3c7146b3b2e128f0dadaa6ec37693f6a9d78567","admin.screen.css":"70ea04613e81aa962e26560fe93471970231695b","gazetteerSQL_Address.css":"1228676b88dd1f0e2d86ef39b5b9d8f0af31ee88","administration_alloc_4.css":"0a7ec0379cfd0c60ec2e3d4d8677277b1d66ff1a","print.css":"cfcbecafa32663c74cd5cbbe78a6d04c96b96d7b","administration_alloc.css":"a0b288575a7f38d96fe3b4c1e29e2d1b4cf77108","fisheye.css":"7e321f92a10dc5f9d26373573dc43b409c2bf69e","mapbender.css":"b4a0ebe2513441edb01c1e010c9cf3d54d3c9ed1","edit_gui.css":"0589841d6828e89a8db76caeb4d99e35f962b514","legend.css":"fdf7062eb756a12ba52f6270c5230c28ebd5e369","admin.css":"bf2c8a3d28abdd41907510607731c1b5b431a2e4"}
\ No newline at end of file

Modified: branches/print_dev/http/css/edit_gui.css
===================================================================
--- branches/print_dev/http/css/edit_gui.css	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/css/edit_gui.css	2008-10-06 10:40:54 UTC (rev 3125)
@@ -18,10 +18,17 @@
 	size: 12px;
 }
 
-.select_short{
+.select_auto{
+
 	width: auto;
 }
 
+.select_short{
+
+	width: 80;
+}
+
+
 .Lbutton{
 		font-size : 9pt;
 		width:56px;

Modified: branches/print_dev/http/css/popup.css
===================================================================
--- branches/print_dev/http/css/popup.css	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/css/popup.css	2008-10-06 10:40:54 UTC (rev 3125)
@@ -23,27 +23,25 @@
     position: absolute;
     
 /*styles that can change*/
-    background:#EEEEEE url(../img/info_on.gif) 8px 8px no-repeat;
+    background:#EEEEEE url(../img/info_on.gif) 5px 5px no-repeat;
     border: 1px solid #000;
-    -moz-border-radius:10px;
-    padding: 0px;
-/*    padding-bottom:30px;
-*/
+    padding: 0;
+    padding-bottom:30px;
 }
 
 div.jqmNotice .jqResize {
 	position: absolute; 
-	right: 5px; 
-	bottom: 5px;
+	right: 2px; 
+	bottom: 2px;
 	width:16px;
 	height:16px;
 	background:url(../img/resize.gif);
 }
 
-.jqmnTitle{margin: 0 30px;}
+.jqmnTitle{margin: 0 25px;}
   
 .jqmnTitle h1{
-  margin: 9px 0;
+  margin: 5px 0;
   padding-left:5px;
   width: 100%;
   font-size:12px;
@@ -54,37 +52,12 @@
 div.jqmNotice .jqmClose {
   position: absolute;
   cursor: pointer;
-  right: 8px;
-  top: 10px;
+  right: 4px;
+  top: 6px;
 }
 
 .jqmnContent{
   border-top:1px;
   color:#000;
-  margin:0px 20px 25px;
-}
-.balloonTL{
-	position:absolute;
-	background-image:url("../img/balloon_ul.png");
-	width:100px;
-	height:80px;
-}
-.balloonTR{
-	position:absolute;
-	background-image:url("../img/balloon_ur.png");
-	width:100px;
-	height:80px;
-}
-.balloonBR{
-	position:absolute;
-	background-image:url("../img/balloon_lr.png");
-	width:100px;
-	height:80px;
-}
-.balloonBL{
-	position:absolute;
-	background-image:url("../img/balloon_ll.png");
-	width:100px;
-	height:80px;
-}
-
+  padding:0 20px 5px;
+}
\ No newline at end of file

Added: branches/print_dev/http/extensions/checksum.json
===================================================================
--- branches/print_dev/http/extensions/checksum.json	                        (rev 0)
+++ branches/print_dev/http/extensions/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"geom2wfst.php":"cb7ad1845e912c24db5682e6469400a8ab9c4dbe","wz_jsgraphics.js":"34364804629c7df036b354126f98ae345b5ddb56","JSON.php":"e0e020187b86f5d2570a36ee23ec499fdcb7369a","fisheye.js":"564238bc74bf7d1332d0c04bb50e1259e4186ae8","jquery.ajaxmanager.js":"fee35e708e3d995d3c422ba36fd025dc15c81a88","markResult.php":"ae7e63d0acc4386eeee6448e991fe7647013c9cc","ext_featureInfoTunnel.php":"176b4632d1dc30c325027fed5f4880cbe378ef2f","jqjson.js":"6064a66d72effddff97f8456c829d60cda799ee7","ext_weldMaps.php":"4ef7df683dd8d997a74f11cf28164037e2a2b90f","jquery.js":"9c83595e88bf663f85c8958c418ab8596e12c830","json.js":"2bf0ef8fe83fd9e8d02254143c438bdb243c1b18"}
\ No newline at end of file

Added: branches/print_dev/http/extensions/datepicker/checksum.json
===================================================================
--- branches/print_dev/http/extensions/datepicker/checksum.json	                        (rev 0)
+++ branches/print_dev/http/extensions/datepicker/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"datepicker.php":"213021ff76e468344235a37dbc602429530b0b38","datepicker.js":"04c4531941ffb7ea9f6b8b254236e19c0f11ec4a","cal.gif":"6d841e93a8725cde4269e789404a0241ce764fa8"}
\ No newline at end of file

Modified: branches/print_dev/http/extensions/datepicker/datepicker.js
===================================================================
--- branches/print_dev/http/extensions/datepicker/datepicker.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/extensions/datepicker/datepicker.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,110 +1,19 @@
-var monthDays=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
-var currDate=new Date();
-var showDate=new Date();
-var target = window.opener.dTarget;
 
-showDate.setDate(1);
-
-function writeY() {
-  for(i=2000; i<2021; i++) {
-	document.write('<option value='+i+'>'+i+'<\/option>');
-  }
-}
-
-function writeM() {
-  for(i=0; i<12; i++) {
-		var j = i + 1;
-		document.write('<option value='+j+'>'+monthNames[i]+'</option>');
-  }
-}
-
-function picker() {
-  document.frm.lYears.selectedIndex = showDate.getFullYear() - 2000;
-  document.frm.lMonths.selectedIndex = showDate.getMonth();
-  var d = lenM(showDate);
-  var y = showDate.getFullYear() - 2000;
-	var begin = showDate.getDay() - 1;
-	if(begin < 0) begin += 7;
-  for(i=0; i<42; i++) {
-    btn=document.frm.elements['btn'+(i+1)];
-    if(i<begin) {
-      btn.value='';
-    }
-    else if(i>=begin+d) {
-      btn.value='';
-    }
-    else {
-      btn.style.color='black';
-      btn.value=i-begin+1;
-    }
-  }
-}
-
-function go(x){
-	var out;
-
-	if(x){
-		if (x =='x'){
-			out = twoDigits(currDate.getDate()) + '.' + (twoDigits(currDate.getMonth()+1)) + '.' + currDate.getFullYear();
-		}
-		else{ 		
-  		out = twoDigits(x) + '.' + (twoDigits(showDate.getMonth()+1)) + '.' + showDate.getFullYear();
-		}
-		target.value = out;
-		close();
- 	}
-}
-
-function twoDigits(x){
-	x = '0' + x;
-	return x.match(/\d\d$/);
-}
-
-function lenM(dt) {
-  var m = dt.getMonth();
-	var d = monthDays[m];
-  if(m == 1 && !(dt.getFullYear() % 4)) {
-    d=29;
-  }
-  return d;
-}
-
-function setDate(y, m) {
-  showDate.setFullYear(y);
-  showDate.setMonth(m);
-}
-
-function selMonth(m) {
-  showDate.setMonth(m);
-  picker();
-}
-
-function selYear(y) {
-  showDate.setFullYear(y+2000);
-  picker();
-}
-
-function prevMonth() {
-  var m=showDate.getMonth()-1;
-  var y=showDate.getFullYear();
-  if(m<0) {
-    m=11;
-    y--;
-    if(y<2000) y=2020;
-  }
-  setDate(y, m);
-  picker();
-}
-
-function nextMonth() {
-  var m=showDate.getMonth()+1;
-  var y=showDate.getFullYear();
-  if(m>11) {
-    m=0;
-    y++;
-    if(y>2020) y=2000;
-  }
-  setDate(y, m);
-  picker();
-}
-
+var monthDays=new Array(31,28,31,30,31,30,31,31,30,31,30,31);var currDate=new Date();var showDate=new Date();var target=window.opener.dTarget;showDate.setDate(1);function writeY(){for(i=2000;i<2021;i++){document.write('<option value='+i+'>'+i+'<\/option>');}}
+function writeM(){for(i=0;i<12;i++){var j=i+1;document.write('<option value='+j+'>'+monthNames[i]+'</option>');}}
+function picker(){document.frm.lYears.selectedIndex=showDate.getFullYear()-2000;document.frm.lMonths.selectedIndex=showDate.getMonth();var d=lenM(showDate);var y=showDate.getFullYear()-2000;var begin=showDate.getDay()-1;if(begin<0)begin+=7;for(i=0;i<42;i++){btn=document.frm.elements['btn'+(i+1)];if(i<begin){btn.value='';}
+else if(i>=begin+d){btn.value='';}
+else{btn.style.color='black';btn.value=i-begin+1;}}}
+function go(x){var out;if(x){if(x=='x'){out=twoDigits(currDate.getDate())+'.'+(twoDigits(currDate.getMonth()+1))+'.'+currDate.getFullYear();}
+else{out=twoDigits(x)+'.'+(twoDigits(showDate.getMonth()+1))+'.'+showDate.getFullYear();}
+target.value=out;close();}}
+function twoDigits(x){x='0'+x;return x.match(/\d\d$/);}
+function lenM(dt){var m=dt.getMonth();var d=monthDays[m];if(m==1&&!(dt.getFullYear()%4)){d=29;}
+return d;}
+function setDate(y,m){showDate.setFullYear(y);showDate.setMonth(m);}
+function selMonth(m){showDate.setMonth(m);picker();}
+function selYear(y){showDate.setFullYear(y+2000);picker();}
+function prevMonth(){var m=showDate.getMonth()-1;var y=showDate.getFullYear();if(m<0){m=11;y--;if(y<2000)y=2020;}
+setDate(y,m);picker();}
+function nextMonth(){var m=showDate.getMonth()+1;var y=showDate.getFullYear();if(m>11){m=0;y++;if(y>2020)y=2000;}
+setDate(y,m);picker();}
\ No newline at end of file

Modified: branches/print_dev/http/extensions/ext_featureInfoTunnel.php
===================================================================
--- branches/print_dev/http/extensions/ext_featureInfoTunnel.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/extensions/ext_featureInfoTunnel.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -29,7 +29,8 @@
 	$x = new connector($nmr);
 	if (empty($x->file)) {
 		//close window if featureInfo has no result
-		echo "<body onLoad=\"javascript:window.close()\">";
+		//echo "<body onLoad=\"javascript:window.close()\">";
+		echo "";
 	} 
 	else {
 		echo $x->file;

Modified: branches/print_dev/http/extensions/fisheye.js
===================================================================
--- branches/print_dev/http/extensions/fisheye.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/extensions/fisheye.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,8 +1,2 @@
-/*
- * Interface elements for jQuery - http://interface.eyecon.ro
- *
- * Copyright (c) 2006 Stefan Petre
- * Dual licensed under the MIT (MIT-LICENSE.txt) 
- * and GPL (GPL-LICENSE.txt) licenses.
- */
- eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('6.15={3o:d(e){7 x=0;7 y=0;7 1Q=1A;7 A=e.L;8(6(e).H(\'Q\')==\'U\'){1E=A.1a;2y=A.O;A.1a=\'1F\';A.Q=\'1Y\';A.O=\'2e\';1Q=26}7 4=e;2P(4){x+=4.3B+(4.1I&&!6.3p.41?F(4.1I.2X)||0:0);y+=4.3x+(4.1I&&!6.3p.41?F(4.1I.2Z)||0:0);4=4.4e}4=e;2P(4&&4.4a&&4.4a.39()!=\'V\'){x-=4.1D||0;y-=4.1s||0;4=4.2x}8(1Q){A.Q=\'U\';A.O=2y;A.1a=1E}q{x:x,y:y}},4E:d(4){7 x=0,y=0;2P(4){x+=4.3B||0;y+=4.3x||0;4=4.4e}q{x:x,y:y}},35:d(e){7 w=6.H(e,\'1T\');7 h=6.H(e,\'36\');7 1e=0;7 1o=0;7 A=e.L;8(6(e).H(\'Q\')!=\'U\'){1e=e.1z;1o=e.2s}u{1E=A.1a;2y=A.O;A.1a=\'1F\';A.Q=\'1Y\';A.O=\'2e\';1e=e.1z;1o=e.2s;A.Q=\'U\';A.O=2y;A.1a=1E}q{w:w,h:h,1e:1e,1o:1o}},4P:d(4){q{1e:4.1z||0,1o:4.2s||0}},58:d(e){7 h,w,22;8(e){w=e.2a;h=e.29}u{22=D.Y;w=2z.3c||2N.3c||(22&&22.2a)||D.V.2a;h=2z.31||2N.31||(22&&22.29)||D.V.29}q{w:w,h:h}},3P:d(e){7 t,l,w,h,1J,1R;8(e&&e.2E.39()!=\'V\'){t=e.1s;l=e.1D;w=e.3j;h=e.3e;1J=0;1R=0}u{8(D.Y&&D.Y.1s){t=D.Y.1s;l=D.Y.1D;w=D.Y.3j;h=D.Y.3e}u 8(D.V){t=D.V.1s;l=D.V.1D;w=D.V.3j;h=D.V.3e}1J=2N.3c||D.Y.2a||D.V.2a||0;1R=2N.31||D.Y.29||D.V.29||0}q{t:t,l:l,w:w,h:h,1J:1J,1R:1R}},3L:d(e,1U){7 4=6(e);7 t=4.H(\'2j\')||\'\';7 r=4.H(\'2k\')||\'\';7 b=4.H(\'2n\')||\'\';7 l=4.H(\'2l\')||\'\';8(1U)q{t:F(t)||0,r:F(r)||0,b:F(b)||0,l:F(l)};u q{t:t,r:r,b:b,l:l}},56:d(e,1U){7 4=6(e);7 t=4.H(\'3w\')||\'\';7 r=4.H(\'3u\')||\'\';7 b=4.H(\'3s\')||\'\';7 l=4.H(\'3t\')||\'\';8(1U)q{t:F(t)||0,r:F(r)||0,b:F(b)||0,l:F(l)};u q{t:t,r:r,b:b,l:l}},4Z:d(e,1U){7 4=6(e);7 t=4.H(\'2Z\')||\'\';7 r=4.H(\'3G\')||\'\';7 b=4.H(\'3y\')||\'\';7 l=4.H(\'2X\')||\'\';8(1U)q{t:F(t)||0,r:F(r)||0,b:F(b)||0,l:F(l)||0};u q{t:t,r:r,b:b,l:l}},3T:d(2i){7 x=2i.53||(2i.52+(D.Y.1D||D.V.1D))||0;7 y=2i.51||(2i.54+(D.Y.1s||D.V.1s))||0;q{x:x,y:y}},3h:d(12,3g){3g(12);12=12.3F;2P(12){6.15.3h(12,3g);12=12.5a}},59:d(12){6.15.3h(12,d(4){S(7 1j 1q 4){8(2R 4[1j]===\'d\'){4[1j]=20}}})},57:d(4,27){7 1b=$.15.3P();7 3l=$.15.35(4);8(!27||27==\'4Y\')$(4).H({X:1b.t+((1i.3S(1b.h,1b.1R)-1b.t-3l.1o)/2)+\'K\'});8(!27||27==\'4Q\')$(4).H({N:1b.l+((1i.3S(1b.w,1b.1J)-1b.l-3l.1e)/2)+\'K\'})},4O:d(4,3U){7 3V=$(\'3q[@2u*="2w"]\',4||D),2w;3V.1V(d(){2w=k.2u;k.2u=3U;k.L.4M="4N:4R.4S.4W(2u=\'"+2w+"\')"})}};[].4i||(4V.4U.4i=d(v,n){n=(n==20)?0:n;7 m=k.1m;S(7 i=n;i<m;i++)8(k[i]==v)q i;q-1});6.3A=d(e){8(/^4T$|^4L$|^5b$|^5c$|^5t$|^5s$|^5r$|^5q$|^5u$|^V$|^5v$|^5z$|^5y$|^5x$|^5w$|^5p$|^5o$/i.2q(e.2E))q 1A;u q 26};6.E.5h=d(e,1p){7 c=e.3F;7 1d=c.L;1d.O=1p.O;1d.2j=1p.18.t;1d.2l=1p.18.l;1d.2n=1p.18.b;1d.2k=1p.18.r;1d.X=1p.X+\'K\';1d.N=1p.N+\'K\';e.2x.4f(c,e);e.2x.5g(e)};6.E.5f=d(e){8(!6.3A(e))q 1A;7 t=6(e);7 A=e.L;7 1Q=1A;7 J={};J.O=t.H(\'O\');8(t.H(\'Q\')==\'U\'){1E=t.H(\'1a\');A.1a=\'1F\';A.Q=\'\';1Q=26}J.32=6.15.35(e);J.18=6.15.3L(e);7 2Y=e.1I?e.1I.4g:t.H(\'5d\');J.X=F(t.H(\'X\'))||0;J.N=F(t.H(\'N\'))||0;7 3J=\'5e\'+F(1i.5i()*4p);7 1x=D.5j(/^3q$|^5n$|^5m$|^5l$|^5k$|^5A$|^2V$|^4u$|^4y$|^4z$|^4x$|^4v$|^4s$|^4H$/i.2q(e.2E)?\'4J\':e.2E);6.1j(1x,\'4F\',3J);1x.3X=\'4B\';7 R=1x.L;7 X=0;7 N=0;8(J.O==\'33\'||J.O==\'2e\'){X=J.X;N=J.N}R.Q=\'U\';R.X=X+\'K\';R.N=N+\'K\';R.O=J.O!=\'33\'&&J.O!=\'2e\'?\'33\':J.O;R.2K=\'1F\';R.36=J.32.1o+\'K\';R.1T=J.32.1e+\'K\';R.2j=J.18.t;R.2k=J.18.r;R.2n=J.18.b;R.2l=J.18.l;8(6.3p.4G){R.4g=2Y}u{R.4D=2Y}e.2x.4f(1x,e);A.2j=\'1M\';A.2k=\'1M\';A.2n=\'1M\';A.2l=\'1M\';A.O=\'2e\';A.4C=\'U\';A.X=\'1M\';A.N=\'1M\';8(1Q){A.Q=\'U\';A.1a=1E}1x.4A(e);R.Q=\'1Y\';q{J:J,4I:6(1x)}};6.E.2f={4K:[0,B,B],4r:[3E,B,B],4w:[4l,4l,4t],4X:[0,0,0],60:[0,0,B],6P:[3H,42,42],6O:[0,B,B],6N:[0,0,1L],6L:[0,1L,1L],6M:[3b,3b,3b],6Q:[0,6R,0],6W:[6V,6U,4k],6S:[1L,0,1L],6T:[6K,4k,47],6J:[B,3I,0],6B:[6A,50,6z],6x:[1L,0,0],6Y:[6C,6D,6I],6H:[6G,0,2U],6E:[B,0,B],6F:[B,6X,0],7a:[0,1v,0],7j:[75,0,7i],7f:[3E,3v,3I],7e:[7h,7l,3v],7g:[3r,B,B],7c:[4c,7d,4c],72:[2U,2U,2U],71:[B,70,74],76:[B,B,3r],7b:[0,B,0],79:[B,0,B],77:[1v,0,0],78:[0,0,1v],6Z:[1v,1v,0],73:[B,3H,0],7k:[B,2I,6y],6v:[1v,0,1v],5V:[B,0,0],5U:[2I,2I,2I],5T:[B,B,B],5R:[B,B,0]};6.E.1w=d(16,3z){8(6.E.2f[16])q{r:6.E.2f[16][0],g:6.E.2f[16][1],b:6.E.2f[16][2]};u 8(M=/^1N\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)$/.2A(16))q{r:F(M[1]),g:F(M[2]),b:F(M[3])};u 8(M=/1N\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)$/.2A(16))q{r:Z(M[1])*2.55,g:Z(M[2])*2.55,b:Z(M[3])*2.55};u 8(M=/^#([a-1H-1B-9])([a-1H-1B-9])([a-1H-1B-9])$/.2A(16))q{r:F("1C"+M[1]+M[1]),g:F("1C"+M[2]+M[2]),b:F("1C"+M[3]+M[3])};u 8(M=/^#([a-1H-1B-9]{2})([a-1H-1B-9]{2})([a-1H-1B-9]{2})$/.2A(16))q{r:F("1C"+M[1]),g:F("1C"+M[2]),b:F("1C"+M[3])};u q 3z==26?1A:{r:B,g:B,b:B}};6.E.4n={3y:1,2X:1,3G:1,2Z:1,5S:1,5B:1,36:1,N:1,5W:1,5X:1,2n:1,2l:1,2k:1,2j:1,62:1,2T:1,61:1,6w:1,1f:1,5Y:1,5Z:1,3s:1,3t:1,3u:1,3w:1,38:1,5Q:1,X:1,1T:1,2O:1};6.E.49={5P:1,5G:1,5H:1,5F:1,5E:1,16:1,5C:1};6.E.25=[\'5D\',\'5I\',\'5J\',\'5O\'];6.E.3k={\'3d\':[\'24\',\'3W\'],\'2B\':[\'24\',\'3f\'],\'2D\':[\'2D\',\'\'],\'2C\':[\'2C\',\'\']};6.3Q.4b({5N:d(1h,1G,P,2v){q k.2d(d(){7 2t=6.1G(1G,P,2v);7 e=28 6.4m(k,2t,1h)})},37:d(1G,2v){q k.2d(d(){7 2t=6.1G(1G,2v);7 e=28 6.37(k,2t)})},5M:d(14){q k.1V(d(){8(k.1n)6.3m(k,14)})},5K:d(14){q k.1V(d(){8(k.1n)6.3m(k,14);8(k.2d&&k.2d[\'E\'])k.2d.E=[]})}});6.4b({37:d(C,o){7 z=k,4o;z.14=d(){8(6.43(o.2M))o.2M.3Z(C)};z.2h=3O(d(){z.14()},o.1k);C.1n=z},P:{4q:d(p,n,4j,4d,1k){q((-1i.5L(p*1i.63)/2)+0.5)*4d+4j}},4m:d(C,o,1h){7 z=k,4o;7 y=C.L;7 44=6.H(C,"2K");7 1O=6.H(C,"Q");7 G={};z.2L=(28 46()).48();o.P=o.P&&6.P[o.P]?o.P:\'4q\';z.2Q=d(I,W){8(6.E.4n[I]){8(W==\'2H\'||W==\'2G\'||W==\'3N\'){8(!C.1r)C.1r={};7 r=Z(6.1y(C,I));C.1r[I]=r&&r>-4p?r:(Z(6.H(C,I))||0);W=W==\'3N\'?(1O==\'U\'?\'2H\':\'2G\'):W;o[W]=26;G[I]=W==\'2H\'?[0,C.1r[I]]:[C.1r[I],0];8(I!=\'1f\')y[I]=G[I][0]+(I!=\'2O\'&&I!=\'34\'?\'K\':\'\');u 6.1j(y,"1f",G[I][0])}u{G[I]=[Z(6.1y(C,I)),Z(W)||0]}}u 8(6.E.49[I])G[I]=[6.E.1w(6.1y(C,I)),6.E.1w(W)];u 8(/^2D$|2C$|24$|2B$|3d$/i.2q(I)){7 m=W.1t(/\\s+/g,\' \').1t(/1N\\s*\\(\\s*/g,\'1N(\').1t(/\\s*,\\s*/g,\',\').1t(/\\s*\\)/g,\')\').64(/([^\\s]+)/g);6n(I){2b\'2D\':2b\'2C\':2b\'3d\':2b\'2B\':m[3]=m[3]||m[1]||m[0];m[2]=m[2]||m[0];m[1]=m[1]||m[0];S(7 i=0;i<6.E.25.1m;i++){7 1l=6.E.3k[I][0]+6.E.25[i]+6.E.3k[I][1];G[1l]=I==\'2B\'?[6.E.1w(6.1y(C,1l)),6.E.1w(m[i])]:[Z(6.1y(C,1l)),Z(m[i])]}3R;2b\'24\':S(7 i=0;i<m.1m;i++){7 3n=Z(m[i]);7 2r=!6m(3n)?\'3W\':(!/6l|U|1F|6j|6k|6o|6p|6u|6t|6s|6q/i.2q(m[i])?\'3f\':1A);8(2r){S(7 j=0;j<6.E.25.1m;j++){1l=\'24\'+6.E.25[j]+2r;G[1l]=2r==\'3f\'?[6.E.1w(6.1y(C,1l)),6.E.1w(m[i])]:[Z(6.1y(C,1l)),3n]}}u{y[\'6r\']=m[i]}}3R}}u{y[I]=W}q 1A};S(p 1q 1h){8(p==\'L\'){7 1c=6.30(1h[p]);S(1P 1q 1c){k.2Q(1P,1c[1P])}}u 8(p==\'3X\'){8(D.2S)S(7 i=0;i<D.2S.1m;i++){7 1K=D.2S[i].1K||D.2S[i].6i||20;8(1K){S(7 j=0;j<1K.1m;j++){8(1K[j].6h==\'.\'+1h[p]){7 1X=28 69(\'\\.\'+1h[p]+\' {\');7 1g=1K[j].L.68;7 1c=6.30(1g.1t(1X,\'\').1t(/}/g,\'\'));S(1P 1q 1c){k.2Q(1P,1c[1P])}}}}}}u{k.2Q(p,1h[p])}}y.Q=1O==\'U\'?\'1Y\':1O;y.2K=\'1F\';z.14=d(){7 t=(28 46()).48();8(t>o.1k+z.2L){4h(z.2h);z.2h=20;S(p 1q G){8(p=="1f")6.1j(y,"1f",G[p][1]);u 8(2R G[p][1]==\'2V\')y[p]=\'1N(\'+G[p][1].r+\',\'+G[p][1].g+\',\'+G[p][1].b+\')\';u y[p]=G[p][1]+(p!=\'2O\'&&p!=\'34\'?\'K\':\'\')}8(o.2G||o.2H)S(7 p 1q C.1r)8(p=="1f")6.1j(y,p,C.1r[p]);u y[p]="";y.Q=o.2G?\'U\':(1O!=\'U\'?1O:\'1Y\');y.2K=44;C.1n=20;8(6.43(o.2M))o.2M.3Z(C)}u{7 n=t-k.2L;7 2c=n/o.1k;S(p 1q G){8(2R G[p][1]==\'2V\'){y[p]=\'1N(\'+F(6.P[o.P](2c,n,G[p][0].r,(G[p][1].r-G[p][0].r),o.1k))+\',\'+F(6.P[o.P](2c,n,G[p][0].g,(G[p][1].g-G[p][0].g),o.1k))+\',\'+F(6.P[o.P](2c,n,G[p][0].b,(G[p][1].b-G[p][0].b),o.1k))+\')\'}u{7 2W=6.P[o.P](2c,n,G[p][0],(G[p][1]-G[p][0]),o.1k);8(p=="1f")6.1j(y,"1f",2W);u y[p]=2W+(p!=\'2O\'&&p!=\'34\'?\'K\':\'\')}}}};z.2h=3O(d(){z.14()},13);C.1n=z},3m:d(C,14){8(14)C.1n.2L-=67;u{2z.4h(C.1n.2h);C.1n=20;6.65(C,"E")}}});6.30=d(1g){7 1c={};8(2R 1g==\'66\'){1g=1g.39().40(\';\');S(7 i=0;i<1g.1m;i++){1X=1g[i].40(\':\');8(1X.1m==2){1c[6.45(1X[0].1t(/\\-(\\w)/g,d(m,c){q c.6a()}))]=6.45(1X[1])}}}q 1c};6.1u={3K:d(o){q k.1V(d(){7 4=k;4.f={10:6(o.10,k),23:6(o.23,k),21:6.15.3o(k),T:o.T,2p:o.2p,1Z:o.1Z,3Y:o.3Y,17:o.17,2T:o.2T};6.1u.2J(4,0);6(2z).2F(\'6b\',d(){4.f.21=6.15.3o(4);6.1u.2J(4,0);6.1u.3i(4)});6.1u.3i(4);4.f.10.2F(\'6g\',d(){6(4.f.2p,k).1S(0).L.Q=\'1Y\'}).2F(\'6f\',d(){6(4.f.2p,k).1S(0).L.Q=\'U\'});6(D).2F(\'6e\',d(e){7 2g=6.15.3T(e);7 19=0;8(4.f.17&&4.f.17==\'3M\')7 2o=2g.x-4.f.21.x-(4.1z-4.f.T*4.f.10.1W())/2-4.f.T/2;u 8(4.f.17&&4.f.17==\'38\')7 2o=2g.x-4.f.21.x-4.1z+4.f.T*4.f.10.1W();u 7 2o=2g.x-4.f.21.x;7 3D=1i.3C(2g.y-4.f.21.y-4.2s/2,2);4.f.10.1V(d(2m){11=1i.6c(1i.3C(2o-2m*4.f.T,2)+3D);11-=4.f.T/2;11=11<0?0:11;11=11>4.f.1Z?4.f.1Z:11;11=4.f.1Z-11;3a=4.f.2T*11/4.f.1Z;k.L.1T=4.f.T+3a+\'K\';k.L.N=4.f.T*2m+19+\'K\';19+=3a});6.1u.2J(4,19)})})},2J:d(4,19){8(4.f.17)8(4.f.17==\'3M\')4.f.23.1S(0).L.N=(4.1z-4.f.T*4.f.10.1W())/2-19/2+\'K\';u 8(4.f.17==\'N\')4.f.23.1S(0).L.N=-19/4.f.10.1W()+\'K\';u 8(4.f.17==\'38\')4.f.23.1S(0).L.N=(4.1z-4.f.T*4.f.10.1W())-19/2+\'K\';4.f.23.1S(0).L.1T=4.f.T*4.f.10.1W()+19+\'K\'},3i:d(4){4.f.10.1V(d(2m){k.L.1T=4.f.T+\'K\';k.L.N=4.f.T*2m+\'K\'})}};6.3Q.6d=6.1u.3K;',62,456,'||||el||jQuery|var|if|||||function||fisheyeCfg|||||this||||options||return||||else||||||es|255|elem|document|fx|parseInt|props|css|tp|oldStyle|px|style|result|left|position|easing|display|wrs|for|itemWidth|none|body|vp|top|documentElement|parseFloat|items|distance|nodeEl||step|iUtil|color|halign|margins|toAdd|visibility|clientScroll|newStyles|cs|wb|opacity|styles|prop|Math|attr|duration|nmp|length|animationHandler|hb|old|in|orig|scrollTop|replace|iFisheye|128|parseColor|wr|curCSS|offsetWidth|false|F0|0x|scrollLeft|oldVisibility|hidden|speed|fA|currentStyle|iw|cssRules|139|0px|rgb|oldDisplay|np|restoreStyle|ih|get|width|toInteger|each|size|rule|block|proximity|null|pos|de|container|border|cssSides|true|axis|new|clientHeight|clientWidth|case|pr|queue|absolute|namedColors|pointer|timer|event|marginTop|marginRight|marginLeft|nr|marginBottom|posx|itemsText|test|sideEnd|offsetHeight|opt|src|callback|png|parentNode|oldPosition|window|exec|borderColor|padding|margin|nodeName|bind|hide|show|192|positionContainer|overflow|startTime|complete|self|zIndex|while|getValues|typeof|styleSheets|maxWidth|211|object|pValue|borderLeftWidth|oldFloat|borderTopWidth|parseStyle|innerHeight|sizes|relative|fontWeight|getSize|height|pause|right|toLowerCase|extraWidth|169|innerWidth|borderWidth|scrollHeight|Color|func|traverseDOM|positionItems|scrollWidth|cssSidesEnd|windowSize|stopAnim|floatVal|getPosition|browser|img|224|paddingBottom|paddingLeft|paddingRight|230|paddingTop|offsetTop|borderBottomWidth|notColor|fxCheckTag|offsetLeft|pow|posy|240|firstChild|borderRightWidth|165|140|wid|build|getMargins|center|toggle|setInterval|getScroll|fn|break|max|getPointer|emptyGIF|images|Width|className|valign|apply|split|opera||isFunction|oldOverflow|trim|Date||getTime|colorCssProps|tagName|extend|144|delta|offsetParent|insertBefore|styleFloat|clearInterval|indexOf|firstNum|107|245|fxe|cssProps|values|10000|linear|azure|dl|220|iframe|ul|beige|table|button|form|appendChild|fxWrapper|listStyle|cssFloat|getPositionLite|id|msie|ol|wrapper|div|aqua|td|filter|progid|fixPNG|getSizeLite|horizontally|DXImageTransform|Microsoft|tr|prototype|Array|AlphaImageLoader|black|vertically|getBorder||pageY|clientX|pageX|clientY||getPadding|centerEl|getClient|purgeEvents|nextSibling|tbody|caption|float|w_|buildWrapper|removeChild|destroyWrapper|random|createElement|select|hr|input|br|meta|optgroup|colgroup|col|tfoot|thead|th|header|option|frameset|frame|script|textarea|fontSize|outlineColor|Top|borderTopColor|borderRightColor|borderBottomColor|borderLeftColor|Right|Bottom|stopAll|cos|stop|animate|Left|backgroundColor|textIndent|yellow|bottom|white|silver|red|letterSpacing|lineHeight|outlineOffset|outlineWidth|blue|minHeight|maxHeight|PI|match|dequeue|string|100000000|cssText|RegExp|toUpperCase|resize|sqrt|Fisheye|mousemove|mouseout|mouseover|selectorText|rules|dotted|dashed|transparent|isNaN|switch|solid|double|outset|borderStyle|inset|ridge|groove|purple|minWidth|darkred|203|204|153|darkorchid|233|150|fuchsia|gold|148|darkviolet|122|darkorange|85|darkcyan|darkgrey|darkblue|cyan|brown|darkgreen|100|darkmagenta|darkolivegreen|183|189|darkkhaki|215|darksalmon|olive|182|lightpink|lightgrey|orange|193||lightyellow|maroon|navy|magenta|green|lime|lightgreen|238|lightblue|khaki|lightcyan|173|130|indigo|pink|216'.split('|'),0,{}))
+
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('6.15={3o:d(e){7 x=0;7 y=0;7 1Q=1A;7 A=e.L;8(6(e).H(\'Q\')==\'U\'){1E=A.1a;2y=A.O;A.1a=\'1F\';A.Q=\'1Y\';A.O=\'2e\';1Q=26}7 4=e;2P(4){x+=4.3B+(4.1I&&!6.3p.41?F(4.1I.2X)||0:0);y+=4.3x+(4.1I&&!6.3p.41?F(4.1I.2Z)||0:0);4=4.4e}4=e;2P(4&&4.4a&&4.4a.39()!=\'V\'){x-=4.1D||0;y-=4.1s||0;4=4.2x}8(1Q){A.Q=\'U\';A.O=2y;A.1a=1E}q{x:x,y:y}},4E:d(4){7 x=0,y=0;2P(4){x+=4.3B||0;y+=4.3x||0;4=4.4e}q{x:x,y:y}},35:d(e){7 w=6.H(e,\'1T\');7 h=6.H(e,\'36\');7 1e=0;7 1o=0;7 A=e.L;8(6(e).H(\'Q\')!=\'U\'){1e=e.1z;1o=e.2s}u{1E=A.1a;2y=A.O;A.1a=\'1F\';A.Q=\'1Y\';A.O=\'2e\';1e=e.1z;1o=e.2s;A.Q=\'U\';A.O=2y;A.1a=1E}q{w:w,h:h,1e:1e,1o:1o}},4P:d(4){q{1e:4.1z||0,1o:4.2s||0}},58:d(e){7 h,w,22;8(e){w=e.2a;h=e.29}u{22=D.Y;w=2z.3c||2N.3c||(22&&22.2a)||D.V.2a;h=2z.31||2N.31||(22&&22.29)||D.V.29}q{w:w,h:h}},3P:d(e){7 t,l,w,h,1J,1R;8(e&&e.2E.39()!=\'V\'){t=e.1s;l=e.1D;w=e.3j;h=e.3e;1J=0;1R=0}u{8(D.Y&&D.Y.1s){t=D.Y.1s;l=D.Y.1D;w=D.Y.3j;h=D.Y.3e}u 8(D.V){t=D.V.1s;l=D.V.1D;w=D.V.3j;h=D.V.3e}1J=2N.3c||D.Y.2a||D.V.2a||0;1R=2N.31||D.Y.29||D.V.29||0}q{t:t,l:l,w:w,h:h,1J:1J,1R:1R}},3L:d(e,1U){7 4=6(e);7 t=4.H(\'2j\')||\'\';7 r=4.H(\'2k\')||\'\';7 b=4.H(\'2n\')||\'\';7 l=4.H(\'2l\')||\'\';8(1U)q{t:F(t)||0,r:F(r)||0,b:F(b)||0,l:F(l)};u q{t:t,r:r,b:b,l:l}},56:d(e,1U){7 4=6(e);7 t=4.H(\'3w\')||\'\';7 r=4.H(\'3u\')||\'\';7 b=4.H(\'3s\')||\'\';7 l=4.H(\'3t\')||\'\';8(1U)q{t:F(t)||0,r:F(r)||0,b:F(b)||0,l:F(l)};u q{t:t,r:r,b:b,l:l}},4Z:d(e,1U){7 4=6(e);7 t=4.H(\'2Z\')||\'\';7 r=4.H(\'3G\')||\'\';7 b=4.H(\'3y\')||\'\';7 l=4.H(\'2X\')||\'\';8(1U)q{t:F(t)||0,r:F(r)||0,b:F(b)||0,l:F(l)||0};u q{t:t,r:r,b:b,l:l}},3T:d(2i){7 x=2i.53||(2i.52+(D.Y.1D||D.V.1D))||0;7 y=2i.51||(2i.54+(D.Y.1s||D.V.1s))||0;q{x:x,y:y}},3h:d(12,3g){3g(12);12=12.3F;2P(12){6.15.3h(12,3g);12=12.5a}},59:d(12){6.15.3h(12,d(4){S(7 1j 1q 4){8(2R 4[1j]===\'d\'){4[1j]=20}}})},57:d(4,27){7 1b=$.15.3P();7 3l=$.15.35(4);8(!27||27==\'4Y\')$(4).H({X:1b.t+((1i.3S(1b.h,1b.1R)-1b.t-3l.1o)/2)+\'K\'});8(!27||27==\'4Q\')$(4).H({N:1b.l+((1i.3S(1b.w,1b.1J)-1b.l-3l.1e)/2)+\'K\'})},4O:d(4,3U){7 3V=$(\'3q[@2u*="2w"]\',4||D),2w;3V.1V(d(){2w=k.2u;k.2u=3U;k.L.4M="4N:4R.4S.4W(2u=\'"+2w+"\')"})}};[].4i||(4V.4U.4i=d(v,n){n=(n==20)?0:n;7 m=k.1m;S(7 i=n;i<m;i++)8(k[i]==v)q i;q-1});6.3A=d(e){8(/^4T$|^4L$|^5b$|^5c$|^5t$|^5s$|^5r$|^5q$|^5u$|^V$|^5v$|^5z$|^5y$|^5x$|^5w$|^5p$|^5o$/i.2q(e.2E))q 1A;u q 26};6.E.5h=d(e,1p){7 c=e.3F;7 1d=c.L;1d.O=1p.O;1d.2j=1p.18.t;1d.2l=1p.18.l;1d.2n=1p.18.b;1d.2k=1p.18.r;1d.X=1p.X+\'K\';1d.N=1p.N+\'K\';e.2x.4f(c,e);e.2x.5g(e)};6.E.5f=d(e){8(!6.3A(e))q 1A;7 t=6(e);7 A=e.L;7 1Q=1A;7 J={};J.O=t.H(\'O\');8(t.H(\'Q\')==\'U\'){1E=t.H(\'1a\');A.1a=\'1F\';A.Q=\'\';1Q=26}J.32=6.15.35(e);J.18=6.15.3L(e);7 2Y=e.1I?e.1I.4g:t.H(\'5d\');J.X=F(t.H(\'X\'))||0;J.N=F(t.H(\'N\'))||0;7 3J=\'5e\'+F(1i.5i()*4p);7 1x=D.5j(/^3q$|^5n$|^5m$|^5l$|^5k$|^5A$|^2V$|^4u$|^4y$|^4z$|^4x$|^4v$|^4s$|^4H$/i.2q(e.2E)?\'4J\':e.2E);6.1j(1x,\'4F\',3J);1x.3X=\'4B\';7 R=1x.L;7 X=0;7 N=0;8(J.O==\'33\'||J.O==\'2e\'){X=J.X;N=J.N}R.Q=\'U\';R.X=X+\'K\';R.N=N+\'K\';R.O=J.O!=\'33\'&&J.O!=\'2e\'?\'33\':J.O;R.2K=\'1F\';R.36=J.32.1o+\'K\';R.1T=J.32.1e+\'K\';R.2j=J.18.t;R.2k=J.18.r;R.2n=J.18.b;R.2l=J.18.l;8(6.3p.4G){R.4g=2Y}u{R.4D=2Y}e.2x.4f(1x,e);A.2j=\'1M\';A.2k=\'1M\';A.2n=\'1M\';A.2l=\'1M\';A.O=\'2e\';A.4C=\'U\';A.X=\'1M\';A.N=\'1M\';8(1Q){A.Q=\'U\';A.1a=1E}1x.4A(e);R.Q=\'1Y\';q{J:J,4I:6(1x)}};6.E.2f={4K:[0,B,B],4r:[3E,B,B],4w:[4l,4l,4t],4X:[0,0,0],60:[0,0,B],6P:[3H,42,42],6O:[0,B,B],6N:[0,0,1L],6L:[0,1L,1L],6M:[3b,3b,3b],6Q:[0,6R,0],6W:[6V,6U,4k],6S:[1L,0,1L],6T:[6K,4k,47],6J:[B,3I,0],6B:[6A,50,6z],6x:[1L,0,0],6Y:[6C,6D,6I],6H:[6G,0,2U],6E:[B,0,B],6F:[B,6X,0],7a:[0,1v,0],7j:[75,0,7i],7f:[3E,3v,3I],7e:[7h,7l,3v],7g:[3r,B,B],7c:[4c,7d,4c],72:[2U,2U,2U],71:[B,70,74],76:[B,B,3r],7b:[0,B,0],79:[B,0,B],77:[1v,0,0],78:[0,0,1v],6Z:[1v,1v,0],73:[B,3H,0],7k:[B,2I,6y],6v:[1v,0,1v],5V:[B,0,0],5U:[2I,2I,2I],5T:[B,B,B],5R:[B,B,0]};6.E.1w=d(16,3z){8(6.E.2f[16])q{r:6.E.2f[16][0],g:6.E.2f[16][1],b:6.E.2f[16][2]};u 8(M=/^1N\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)$/.2A(16))q{r:F(M[1]),g:F(M[2]),b:F(M[3])};u 8(M=/1N\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)$/.2A(16))q{r:Z(M[1])*2.55,g:Z(M[2])*2.55,b:Z(M[3])*2.55};u 8(M=/^#([a-1H-1B-9])([a-1H-1B-9])([a-1H-1B-9])$/.2A(16))q{r:F("1C"+M[1]+M[1]),g:F("1C"+M[2]+M[2]),b:F("1C"+M[3]+M[3])};u 8(M=/^#([a-1H-1B-9]{2})([a-1H-1B-9]{2})([a-1H-1B-9]{2})$/.2A(16))q{r:F("1C"+M[1]),g:F("1C"+M[2]),b:F("1C"+M[3])};u q 3z==26?1A:{r:B,g:B,b:B}};6.E.4n={3y:1,2X:1,3G:1,2Z:1,5S:1,5B:1,36:1,N:1,5W:1,5X:1,2n:1,2l:1,2k:1,2j:1,62:1,2T:1,61:1,6w:1,1f:1,5Y:1,5Z:1,3s:1,3t:1,3u:1,3w:1,38:1,5Q:1,X:1,1T:1,2O:1};6.E.49={5P:1,5G:1,5H:1,5F:1,5E:1,16:1,5C:1};6.E.25=[\'5D\',\'5I\',\'5J\',\'5O\'];6.E.3k={\'3d\':[\'24\',\'3W\'],\'2B\':[\'24\',\'3f\'],\'2D\':[\'2D\',\'\'],\'2C\':[\'2C\',\'\']};6.3Q.4b({5N:d(1h,1G,P,2v){q k.2d(d(){7 2t=6.1G(1G,P,2v);7 e=28 6.4m(k,2t,1h)})},37:d(1G,2v){q k.2d(d(){7 2t=6.1G(1G,2v);7 e=28 6.37(k,2t)})},5M:d(14){q k.1V(d(){8(k.1n)6.3m(k,14)})},5K:d(14){q k.1V(d(){8(k.1n)6.3m(k,14);8(k.2d&&k.2d[\'E\'])k.2d.E=[]})}});6.4b({37:d(C,o){7 z=k,4o;z.14=d(){8(6.43(o.2M))o.2M.3Z(C)};z.2h=3O(d(){z.14()},o.1k);C.1n=z},P:{4q:d(p,n,4j,4d,1k){q((-1i.5L(p*1i.63)/2)+0.5)*4d+4j}},4m:d(C,o,1h){7 z=k,4o;7 y=C.L;7 44=6.H(C,"2K");7 1O=6.H(C,"Q");7 G={};z.2L=(28 46()).48();o.P=o.P&&6.P[o.P]?o.P:\'4q\';z.2Q=d(I,W){8(6.E.4n[I]){8(W==\'2H\'||W==\'2G\'||W==\'3N\'){8(!C.1r)C.1r={};7 r=Z(6.1y(C,I));C.1r[I]=r&&r>-4p?r:(Z(6.H(C,I))||0);W=W==\'3N\'?(1O==\'U\'?\'2H\':\'2G\'):W;o[W]=26;G[I]=W==\'2H\'?[0,C.1r[I]]:[C.1r[I],0];8(I!=\'1f\')y[I]=G[I][0]+(I!=\'2O\'&&I!=\'34\'?\'K\':\'\');u 6.1j(y,"1f",G[I][0])}u{G[I]=[Z(6.1y(C,I)),Z(W)||0]}}u 8(6.E.49[I])G[I]=[6.E.1w(6.1y(C,I)),6.E.1w(W)];u 8(/^2D$|2C$|24$|2B$|3d$/i.2q(I)){7 m=W.1t(/\\s+/g,\' \').1t(/1N\\s*\\(\\s*/g,\'1N(\').1t(/\\s*,\\s*/g,\',\').1t(/\\s*\\)/g,\')\').64(/([^\\s]+)/g);6n(I){2b\'2D\':2b\'2C\':2b\'3d\':2b\'2B\':m[3]=m[3]||m[1]||m[0];m[2]=m[2]||m[0];m[1]=m[1]||m[0];S(7 i=0;i<6.E.25.1m;i++){7 1l=6.E.3k[I][0]+6.E.25[i]+6.E.3k[I][1];G[1l]=I==\'2B\'?[6.E.1w(6.1y(C,1l)),6.E.1w(m[i])]:[Z(6.1y(C,1l)),Z(m[i])]}3R;2b\'24\':S(7 i=0;i<m.1m;i++){7 3n=Z(m[i]);7 2r=!6m(3n)?\'3W\':(!/6l|U|1F|6j|6k|6o|6p|6u|6t|6s|6q/i.2q(m[i])?\'3f\':1A);8(2r){S(7 j=0;j<6.E.25.1m;j++){1l=\'24\'+6.E.25[j]+2r;G[1l]=2r==\'3f\'?[6.E.1w(6.1y(C,1l)),6.E.1w(m[i])]:[Z(6.1y(C,1l)),3n]}}u{y[\'6r\']=m[i]}}3R}}u{y[I]=W}q 1A};S(p 1q 1h){8(p==\'L\'){7 1c=6.30(1h[p]);S(1P 1q 1c){k.2Q(1P,1c[1P])}}u 8(p==\'3X\'){8(D.2S)S(7 i=0;i<D.2S.1m;i++){7 1K=D.2S[i].1K||D.2S[i].6i||20;8(1K){S(7 j=0;j<1K.1m;j++){8(1K[j].6h==\'.\'+1h[p]){7 1X=28 69(\'\\.\'+1h[p]+\' {\');7 1g=1K[j].L.68;7 1c=6.30(1g.1t(1X,\'\').1t(/}/g,\'\'));S(1P 1q 1c){k.2Q(1P,1c[1P])}}}}}}u{k.2Q(p,1h[p])}}y.Q=1O==\'U\'?\'1Y\':1O;y.2K=\'1F\';z.14=d(){7 t=(28 46()).48();8(t>o.1k+z.2L){4h(z.2h);z.2h=20;S(p 1q G){8(p=="1f")6.1j(y,"1f",G[p][1]);u 8(2R G[p][1]==\'2V\')y[p]=\'1N(\'+G[p][1].r+\',\'+G[p][1].g+\',\'+G[p][1].b+\')\';u y[p]=G[p][1]+(p!=\'2O\'&&p!=\'34\'?\'K\':\'\')}8(o.2G||o.2H)S(7 p 1q C.1r)8(p=="1f")6.1j(y,p,C.1r[p]);u y[p]="";y.Q=o.2G?\'U\':(1O!=\'U\'?1O:\'1Y\');y.2K=44;C.1n=20;8(6.43(o.2M))o.2M.3Z(C)}u{7 n=t-k.2L;7 2c=n/o.1k;S(p 1q G){8(2R G[p][1]==\'2V\'){y[p]=\'1N(\'+F(6.P[o.P](2c,n,G[p][0].r,(G[p][1].r-G[p][0].r),o.1k))+\',\'+F(6.P[o.P](2c,n,G[p][0].g,(G[p][1].g-G[p][0].g),o.1k))+\',\'+F(6.P[o.P](2c,n,G[p][0].b,(G[p][1].b-G[p][0].b),o.1k))+\')\'}u{7 2W=6.P[o.P](2c,n,G[p][0],(G[p][1]-G[p][0]),o.1k);8(p=="1f")6.1j(y,"1f",2W);u y[p]=2W+(p!=\'2O\'&&p!=\'34\'?\'K\':\'\')}}}};z.2h=3O(d(){z.14()},13);C.1n=z},3m:d(C,14){8(14)C.1n.2L-=67;u{2z.4h(C.1n.2h);C.1n=20;6.65(C,"E")}}});6.30=d(1g){7 1c={};8(2R 1g==\'66\'){1g=1g.39().40(\';\');S(7 i=0;i<1g.1m;i++){1X=1g[i].40(\':\');8(1X.1m==2){1c[6.45(1X[0].1t(/\\-(\\w)/g,d(m,c){q c.6a()}))]=6.45(1X[1])}}}q 1c};6.1u={3K:d(o){q k.1V(d(){7 4=k;4.f={10:6(o.10,k),23:6(o.23,k),21:6.15.3o(k),T:o.T,2p:o.2p,1Z:o.1Z,3Y:o.3Y,17:o.17,2T:o.2T};6.1u.2J(4,0);6(2z).2F(\'6b\',d(){4.f.21=6.15.3o(4);6.1u.2J(4,0);6.1u.3i(4)});6.1u.3i(4);4.f.10.2F(\'6g\',d(){6(4.f.2p,k).1S(0).L.Q=\'1Y\'}).2F(\'6f\',d(){6(4.f.2p,k).1S(0).L.Q=\'U\'});6(D).2F(\'6e\',d(e){7 2g=6.15.3T(e);7 19=0;8(4.f.17&&4.f.17==\'3M\')7 2o=2g.x-4.f.21.x-(4.1z-4.f.T*4.f.10.1W())/2-4.f.T/2;u 8(4.f.17&&4.f.17==\'38\')7 2o=2g.x-4.f.21.x-4.1z+4.f.T*4.f.10.1W();u 7 2o=2g.x-4.f.21.x;7 3D=1i.3C(2g.y-4.f.21.y-4.2s/2,2);4.f.10.1V(d(2m){11=1i.6c(1i.3C(2o-2m*4.f.T,2)+3D);11-=4.f.T/2;11=11<0?0:11;11=11>4.f.1Z?4.f.1Z:11;11=4.f.1Z-11;3a=4.f.2T*11/4.f.1Z;k.L.1T=4.f.T+3a+\'K\';k.L.N=4.f.T*2m+19+\'K\';19+=3a});6.1u.2J(4,19)})})},2J:d(4,19){8(4.f.17)8(4.f.17==\'3M\')4.f.23.1S(0).L.N=(4.1z-4.f.T*4.f.10.1W())/2-19/2+\'K\';u 8(4.f.17==\'N\')4.f.23.1S(0).L.N=-19/4.f.10.1W()+\'K\';u 8(4.f.17==\'38\')4.f.23.1S(0).L.N=(4.1z-4.f.T*4.f.10.1W())-19/2+\'K\';4.f.23.1S(0).L.1T=4.f.T*4.f.10.1W()+19+\'K\'},3i:d(4){4.f.10.1V(d(2m){k.L.1T=4.f.T+\'K\';k.L.N=4.f.T*2m+\'K\'})}};6.3Q.6d=6.1u.3K;',62,456,'||||el||jQuery|var|if|||||function||fisheyeCfg|||||this||||options||return||||else||||||es|255|elem|document|fx|parseInt|props|css|tp|oldStyle|px|style|result|left|position|easing|display|wrs|for|itemWidth|none|body|vp|top|documentElement|parseFloat|items|distance|nodeEl||step|iUtil|color|halign|margins|toAdd|visibility|clientScroll|newStyles|cs|wb|opacity|styles|prop|Math|attr|duration|nmp|length|animationHandler|hb|old|in|orig|scrollTop|replace|iFisheye|128|parseColor|wr|curCSS|offsetWidth|false|F0|0x|scrollLeft|oldVisibility|hidden|speed|fA|currentStyle|iw|cssRules|139|0px|rgb|oldDisplay|np|restoreStyle|ih|get|width|toInteger|each|size|rule|block|proximity|null|pos|de|container|border|cssSides|true|axis|new|clientHeight|clientWidth|case|pr|queue|absolute|namedColors|pointer|timer|event|marginTop|marginRight|marginLeft|nr|marginBottom|posx|itemsText|test|sideEnd|offsetHeight|opt|src|callback|png|parentNode|oldPosition|window|exec|borderColor|padding|margin|nodeName|bind|hide|show|192|positionContainer|overflow|startTime|complete|self|zIndex|while|getValues|typeof|styleSheets|maxWidth|211|object|pValue|borderLeftWidth|oldFloat|borderTopWidth|parseStyle|innerHeight|sizes|relative|fontWeight|getSize|height|pause|right|toLowerCase|extraWidth|169|innerWidth|borderWidth|scrollHeight|Color|func|traverseDOM|positionItems|scrollWidth|cssSidesEnd|windowSize|stopAnim|floatVal|getPosition|browser|img|224|paddingBottom|paddingLeft|paddingRight|230|paddingTop|offsetTop|borderBottomWidth|notColor|fxCheckTag|offsetLeft|pow|posy|240|firstChild|borderRightWidth|165|140|wid|build|getMargins|center|toggle|setInterval|getScroll|fn|break|max|getPointer|emptyGIF|images|Width|className|valign|apply|split|opera||isFunction|oldOverflow|trim|Date||getTime|colorCssProps|tagName|extend|144|delta|offsetParent|insertBefore|styleFloat|clearInterval|indexOf|firstNum|107|245|fxe|cssProps|values|10000|linear|azure|dl|220|iframe|ul|beige|table|button|form|appendChild|fxWrapper|listStyle|cssFloat|getPositionLite|id|msie|ol|wrapper|div|aqua|td|filter|progid|fixPNG|getSizeLite|horizontally|DXImageTransform|Microsoft|tr|prototype|Array|AlphaImageLoader|black|vertically|getBorder||pageY|clientX|pageX|clientY||getPadding|centerEl|getClient|purgeEvents|nextSibling|tbody|caption|float|w_|buildWrapper|removeChild|destroyWrapper|random|createElement|select|hr|input|br|meta|optgroup|colgroup|col|tfoot|thead|th|header|option|frameset|frame|script|textarea|fontSize|outlineColor|Top|borderTopColor|borderRightColor|borderBottomColor|borderLeftColor|Right|Bottom|stopAll|cos|stop|animate|Left|backgroundColor|textIndent|yellow|bottom|white|silver|red|letterSpacing|lineHeight|outlineOffset|outlineWidth|blue|minHeight|maxHeight|PI|match|dequeue|string|100000000|cssText|RegExp|toUpperCase|resize|sqrt|Fisheye|mousemove|mouseout|mouseover|selectorText|rules|dotted|dashed|transparent|isNaN|switch|solid|double|outset|borderStyle|inset|ridge|groove|purple|minWidth|darkred|203|204|153|darkorchid|233|150|fuchsia|gold|148|darkviolet|122|darkorange|85|darkcyan|darkgrey|darkblue|cyan|brown|darkgreen|100|darkmagenta|darkolivegreen|183|189|darkkhaki|215|darksalmon|olive|182|lightpink|lightgrey|orange|193||lightyellow|maroon|navy|magenta|green|lime|lightgreen|238|lightblue|khaki|lightcyan|173|130|indigo|pink|216'.split('|'),0,{}))
\ No newline at end of file

Modified: branches/print_dev/http/extensions/jqjson.js
===================================================================
--- branches/print_dev/http/extensions/jqjson.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/extensions/jqjson.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,96 +1,13 @@
-(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);
+(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);
\ No newline at end of file

Modified: branches/print_dev/http/extensions/jquery.ajaxmanager.js
===================================================================
--- branches/print_dev/http/extensions/jquery.ajaxmanager.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/extensions/jquery.ajaxmanager.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,165 +1,25 @@
-/**
- * @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
+
+(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

Modified: branches/print_dev/http/extensions/jquery.js
===================================================================
--- branches/print_dev/http/extensions/jquery.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/extensions/jquery.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,11 +1,2 @@
-/*
- * jQuery 1.2.2 - New Wave Javascript
- *
- * Copyright (c) 2007 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * $Date: 2008-01-14 17:56:07 -0500 (Mon, 14 Jan 2008) $
- * $Rev: 4454 $
- */
+
 eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(J(){7(1e.19)L w=1e.19;L E=1e.19=J(a,b){K 1D E.2m.4Y(a,b)};7(1e.$)L D=1e.$;1e.$=E;L u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;L G=/^.[^:#\\[\\.]*$/;E.1i=E.2m={4Y:J(d,b){d=d||T;7(d.15){6[0]=d;6.M=1;K 6}N 7(1v d=="25"){L c=u.39(d);7(c&&(c[1]||!b)){7(c[1])d=E.5c([c[1]],b);N{L a=T.5N(c[3]);7(a)7(a.2s!=c[3])K E().2r(d);N{6[0]=a;6.M=1;K 6}N d=[]}}N K 1D E(b).2r(d)}N 7(E.1q(d))K 1D E(T)[E.1i.21?"21":"43"](d);K 6.6G(d.1n==1N&&d||(d.5j||d.M&&d!=1e&&!d.15&&d[0]!=10&&d[0].15)&&E.2H(d)||[d])},5j:"1.2.2",82:J(){K 6.M},M:0,22:J(a){K a==10?E.2H(6):6[a]},2E:J(b){L a=E(b);a.56=6;K a},6G:J(a){6.M=0;1N.2m.1h.1j(6,a);K 6},V:J(a,b){K E.V(6,a,b)},5E:J(b){L a=-1;6.V(J(i){7(6==b)a=i});K a},1K:J(c,a,b){L d=c;7(c.1n==4d)7(a==10)K 6.M&&E[b||"1K"](6[0],c)||10;N{d={};d[c]=a}K 6.V(J(i){P(c 1r d)E.1K(b?6.Y:6,c,E.1l(6,d[c],b,i,c))})},1m:J(b,a){7((b==\'29\'||b==\'1P\')&&2M(a)<0)a=10;K 6.1K(b,a,"2q")},1t:J(b){7(1v b!="4D"&&b!=W)K 6.4B().3t((6[0]&&6[0].2u||T).5v(b));L a="";E.V(b||6,J(){E.V(6.3p,J(){7(6.15!=8)a+=6.15!=1?6.6M:E.1i.1t([6])})});K a},5r:J(b){7(6[0])E(b,6[0].2u).5J().3n(6[0]).2a(J(){L a=6;2e(a.1B)a=a.1B;K a}).3t(6);K 6},8t:J(a){K 6.V(J(){E(6).6C().5r(a)})},8m:J(a){K 6.V(J(){E(6).5r(a)})},3t:J(){K 6.3P(1a,R,S,J(a){7(6.15==1)6.3k(a)})},6s:J(){K 6.3P(1a,R,R,J(a){7(6.15==1)6.3n(a,6.1B)})},6o:J(){K 6.3P(1a,S,S,J(a){6.1b.3n(a,6)})},5a:J(){K 6.3P(1a,S,R,J(a){6.1b.3n(a,6.2J)})},3h:J(){K 6.56||E([])},2r:J(b){L c=E.2a(6,J(a){K E.2r(b,a)});K 6.2E(/[^+>] [^+>]/.17(b)||b.1g("..")>-1?E.57(c):c)},5J:J(e){L f=6.2a(J(){7(E.14.1d&&!E.3W(6)){L a=6.6c(R),5u=T.2R("1u"),4T=T.2R("1u");5u.3k(a);4T.38=5u.38;K 4T.1B}N K 6.6c(R)});L d=f.2r("*").4R().V(J(){7(6[F]!=10)6[F]=W});7(e===R)6.2r("*").4R().V(J(i){7(6.15==3)K;L c=E.Q(6,"2N");P(L a 1r c)P(L b 1r c[a])E.16.1c(d[i],a,c[a][b],c[a][b].Q)});K f},1F:J(b){K 6.2E(E.1q(b)&&E.3x(6,J(a,i){K b.1O(a,i)})||E.3d(b,6))},4I:J(b){7(b.1n==4d)7(G.17(b))K 6.2E(E.3d(b,6,R));N b=E.3d(b,6);L a=b.M&&b[b.M-1]!==10&&!b.15;K 6.1F(J(){K a?E.35(6,b)<0:6!=b})},1c:J(a){K!a?6:6.2E(E.34(6.22(),a.1n==4d?E(a).22():a.M!=10&&(!a.12||E.12(a,"3i"))?a:[a]))},3K:J(a){K a?E.3d(a,6).M>0:S},7g:J(a){K 6.3K("."+a)},5P:J(b){7(b==10){7(6.M){L c=6[0];7(E.12(c,"2y")){L e=c.44,5L=[],11=c.11,30=c.U=="2y-30";7(e<0)K W;P(L i=30?e:0,2b=30?e+1:11.M;i<2b;i++){L d=11[i];7(d.2p){b=E.14.1d&&!d.9s.1C.9o?d.1t:d.1C;7(30)K b;5L.1h(b)}}K 5L}N K(6[0].1C||"").1p(/\\r/g,"")}K 10}K 6.V(J(){7(6.15!=1)K;7(b.1n==1N&&/5w|5y/.17(6.U))6.3o=(E.35(6.1C,b)>=0||E.35(6.37,b)>=0);N 7(E.12(6,"2y")){L a=b.1n==1N?b:[b];E("90",6).V(J(){6.2p=(E.35(6.1C,a)>=0||E.35(6.1t,a)>=0)});7(!a.M)6.44=-1}N 6.1C=b})},3q:J(a){K a==10?(6.M?6[0].38:W):6.4B().3t(a)},6P:J(a){K 6.5a(a).1Y()},6N:J(i){K 6.2V(i,i+1)},2V:J(){K 6.2E(1N.2m.2V.1j(6,1a))},2a:J(b){K 6.2E(E.2a(6,J(a,i){K b.1O(a,i,a)}))},4R:J(){K 6.1c(6.56)},3P:J(g,f,h,d){L e=6.M>1,3m;K 6.V(J(){7(!3m){3m=E.5c(g,6.2u);7(h)3m.8I()}L b=6;7(f&&E.12(6,"1V")&&E.12(3m[0],"4x"))b=6.3V("1S")[0]||6.3k(6.2u.2R("1S"));L c=E([]);E.V(3m,J(){L a=e?E(6).5J(R)[0]:6;7(E.12(a,"1o")){c=c.1c(a)}N{7(a.15==1)c=c.1c(E("1o",a).1Y());d.1O(b,a)}});c.V(6D)})}};E.2m.4Y.2m=E.2m;J 6D(i,a){7(a.3R)E.3Q({1f:a.3R,3l:S,1G:"1o"});N E.5l(a.1t||a.6A||a.38||"");7(a.1b)a.1b.2X(a)}E.1s=E.1i.1s=J(){L b=1a[0]||{},i=1,M=1a.M,5i=S,11;7(b.1n==8f){5i=b;b=1a[1]||{};i=2}7(1v b!="4D"&&1v b!="J")b={};7(M==1){b=6;i=0}P(;i<M;i++)7((11=1a[i])!=W)P(L a 1r 11){7(b===11[a])6z;7(5i&&11[a]&&1v 11[a]=="4D"&&b[a]&&!11[a].15)b[a]=E.1s(b[a],11[a]);N 7(11[a]!=10)b[a]=11[a]}K b};L F="19"+(1D 3O()).3N(),6y=0,5e={};L H=/z-?5E|89-?87|1y|6q|85-?1P/i;E.1s({81:J(a){1e.$=D;7(a)1e.19=w;K E},1q:J(a){K!!a&&1v a!="25"&&!a.12&&a.1n!=1N&&/J/i.17(a+"")},3W:J(a){K a.1I&&!a.1k||a.28&&a.2u&&!a.2u.1k},5l:J(a){a=E.3f(a);7(a){L b=T.3V("6k")[0]||T.1I,1o=T.2R("1o");1o.U="1t/4l";7(E.14.1d)1o.1t=a;N 1o.3k(T.5v(a));b.3k(1o);b.2X(1o)}},12:J(b,a){K b.12&&b.12.2F()==a.2F()},1Q:{},Q:J(c,d,b){c=c==1e?5e:c;L a=c[F];7(!a)a=c[F]=++6y;7(d&&!E.1Q[a])E.1Q[a]={};7(b!=10)E.1Q[a][d]=b;K d?E.1Q[a][d]:a},3H:J(c,b){c=c==1e?5e:c;L a=c[F];7(b){7(E.1Q[a]){2T E.1Q[a][b];b="";P(b 1r E.1Q[a])1T;7(!b)E.3H(c)}}N{1R{2T c[F]}1W(e){7(c.55)c.55(F)}2T E.1Q[a]}},V:J(c,a,b){7(b){7(c.M==10){P(L d 1r c)7(a.1j(c[d],b)===S)1T}N P(L i=0,M=c.M;i<M;i++)7(a.1j(c[i],b)===S)1T}N{7(c.M==10){P(L d 1r c)7(a.1O(c[d],d,c[d])===S)1T}N P(L i=0,M=c.M,1C=c[0];i<M&&a.1O(1C,i,1C)!==S;1C=c[++i]){}}K c},1l:J(b,a,c,i,d){7(E.1q(a))a=a.1O(b,i);K a&&a.1n==53&&c=="2q"&&!H.17(d)?a+"2P":a},1w:{1c:J(c,b){E.V((b||"").2d(/\\s+/),J(i,a){7(c.15==1&&!E.1w.3E(c.1w,a))c.1w+=(c.1w?" ":"")+a})},1Y:J(c,b){7(c.15==1)c.1w=b!=10?E.3x(c.1w.2d(/\\s+/),J(a){K!E.1w.3E(b,a)}).6g(" "):""},3E:J(b,a){K E.35(a,(b.1w||b).3D().2d(/\\s+/))>-1}},6e:J(b,c,a){L e={};P(L d 1r c){e[d]=b.Y[d];b.Y[d]=c[d]}a.1O(b);P(L d 1r c)b.Y[d]=e[d]},1m:J(d,e,c){7(e=="29"||e=="1P"){L b,3S={3C:"4Z",4X:"23",18:"3u"},3r=e=="29"?["7P","7M"]:["7L","7K"];J 4S(){b=e=="29"?d.7J:d.7I;L a=0,3a=0;E.V(3r,J(){a+=2M(E.2q(d,"7H"+6,R))||0;3a+=2M(E.2q(d,"3a"+6+"62",R))||0});b-=1Z.7E(a+3a)}7(E(d).3K(":4b"))4S();N E.6e(d,3S,4S);K 1Z.2b(0,b)}K E.2q(d,e,c)},2q:J(e,k,j){L d;J 3y(b){7(!E.14.26)K S;L a=T.4a.4L(b,W);K!a||a.4K("3y")==""}7(k=="1y"&&E.14.1d){d=E.1K(e.Y,"1y");K d==""?"1":d}7(E.14.2B&&k=="18"){L c=e.Y.18;e.Y.18="3u";e.Y.18=c}7(k.1E(/4c/i))k=y;7(!j&&e.Y&&e.Y[k])d=e.Y[k];N 7(T.4a&&T.4a.4L){7(k.1E(/4c/i))k="4c";k=k.1p(/([A-Z])/g,"-$1").2w();L h=T.4a.4L(e,W);7(h&&!3y(e))d=h.4K(k);N{L f=[],2L=[];P(L a=e;a&&3y(a);a=a.1b)2L.4U(a);P(L i=0;i<2L.M;i++)7(3y(2L[i])){f[i]=2L[i].Y.18;2L[i].Y.18="3u"}d=k=="18"&&f[2L.M-1]!=W?"2D":(h&&h.4K(k))||"";P(L i=0;i<f.M;i++)7(f[i]!=W)2L[i].Y.18=f[i]}7(k=="1y"&&d=="")d="1"}N 7(e.4j){L g=k.1p(/\\-(\\w)/g,J(a,b){K b.2F()});d=e.4j[k]||e.4j[g];7(!/^\\d+(2P)?$/i.17(d)&&/^\\d/.17(d)){L l=e.Y.2c,3A=e.3A.2c;e.3A.2c=e.4j.2c;e.Y.2c=d||0;d=e.Y.7l+"2P";e.Y.2c=l;e.3A.2c=3A}}K d},5c:J(l,h){L k=[];h=h||T;7(1v h.2R==\'10\')h=h.2u||h[0]&&h[0].2u||T;E.V(l,J(i,d){7(!d)K;7(d.1n==53)d=d.3D();7(1v d=="25"){d=d.1p(/(<(\\w+)[^>]*?)\\/>/g,J(b,a,c){K c.1E(/^(7k|7h|5Q|7f|48|5O|a3|3v|9Y|9W|9T)$/i)?b:a+"></"+c+">"});L f=E.3f(d).2w(),1u=h.2R("1u");L e=!f.1g("<9R")&&[1,"<2y 78=\'78\'>","</2y>"]||!f.1g("<9O")&&[1,"<77>","</77>"]||f.1E(/^<(9K|1S|9I|9F|9A)/)&&[1,"<1V>","</1V>"]||!f.1g("<4x")&&[2,"<1V><1S>","</1S></1V>"]||(!f.1g("<9y")||!f.1g("<9v"))&&[3,"<1V><1S><4x>","</4x></1S></1V>"]||!f.1g("<5Q")&&[2,"<1V><1S></1S><76>","</76></1V>"]||E.14.1d&&[1,"1u<1u>","</1u>"]||[0,"",""];1u.38=e[1]+d+e[2];2e(e[0]--)1u=1u.5D;7(E.14.1d){L g=!f.1g("<1V")&&f.1g("<1S")<0?1u.1B&&1u.1B.3p:e[1]=="<1V>"&&f.1g("<1S")<0?1u.3p:[];P(L j=g.M-1;j>=0;--j)7(E.12(g[j],"1S")&&!g[j].3p.M)g[j].1b.2X(g[j]);7(/^\\s/.17(d))1u.3n(h.5v(d.1E(/^\\s*/)[0]),1u.1B)}d=E.2H(1u.3p)}7(d.M===0&&(!E.12(d,"3i")&&!E.12(d,"2y")))K;7(d[0]==10||E.12(d,"3i")||d.11)k.1h(d);N k=E.34(k,d)});K k},1K:J(d,e,c){7(!d||d.15==3||d.15==8)K 10;L f=E.3W(d)?{}:E.3S;7(e=="2p"&&E.14.26)d.1b.44;7(f[e]){7(c!=10)d[f[e]]=c;K d[f[e]]}N 7(E.14.1d&&e=="Y")K E.1K(d.Y,"9r",c);N 7(c==10&&E.14.1d&&E.12(d,"3i")&&(e=="9q"||e=="9p"))K d.9n(e).6M;N 7(d.28){7(c!=10){7(e=="U"&&E.12(d,"48")&&d.1b)6Z"U 9i 9g\'t 9b 9a";d.99(e,""+c)}7(E.14.1d&&/6T|3R/.17(e)&&!E.3W(d))K d.4z(e,2);K d.4z(e)}N{7(e=="1y"&&E.14.1d){7(c!=10){d.6q=1;d.1F=(d.1F||"").1p(/6W\\([^)]*\\)/,"")+(2M(c).3D()=="93"?"":"6W(1y="+c*6S+")")}K d.1F&&d.1F.1g("1y=")>=0?(2M(d.1F.1E(/1y=([^)]*)/)[1])/6S).3D():""}e=e.1p(/-([a-z])/92,J(a,b){K b.2F()});7(c!=10)d[e]=c;K d[e]}},3f:J(a){K(a||"").1p(/^\\s+|\\s+$/g,"")},2H:J(b){L a=[];7(1v b!="91")P(L i=0,M=b.M;i<M;i++)a.1h(b[i]);N a=b.2V(0);K a},35:J(b,a){P(L i=0,M=a.M;i<M;i++)7(a[i]==b)K i;K-1},34:J(a,b){7(E.14.1d){P(L i=0;b[i];i++)7(b[i].15!=8)a.1h(b[i])}N P(L i=0;b[i];i++)a.1h(b[i]);K a},57:J(a){L c=[],2j={};1R{P(L i=0,M=a.M;i<M;i++){L b=E.Q(a[i]);7(!2j[b]){2j[b]=R;c.1h(a[i])}}}1W(e){c=a}K c},3x:J(c,a,d){7(1v a=="25")a=4A("S||J(a,i){K "+a+"}");L b=[];P(L i=0,M=c.M;i<M;i++)7(!d&&a(c[i],i)||d&&!a(c[i],i))b.1h(c[i]);K b},2a:J(d,a){L c=[];P(L i=0,M=d.M;i<M;i++){L b=a(d[i],i);7(b!==W&&b!=10){7(b.1n!=1N)b=[b];c=c.6Q(b)}}K c}});L v=8X.8V.2w();E.14={5n:(v.1E(/.+(?:8R|8Q|8P|8O)[\\/: ]([\\d.]+)/)||[])[1],26:/6L/.17(v),2B:/2B/.17(v),1d:/1d/.17(v)&&!/2B/.17(v),3X:/3X/.17(v)&&!/(8M|6L)/.17(v)};L y=E.14.1d?"6K":"6J";E.1s({8J:!E.14.1d||T.6I=="6H",3S:{"P":"8G","8E":"1w","4c":y,6J:y,6K:y,38:"38",1w:"1w",1C:"1C",2W:"2W",3o:"3o",8C:"8B",2p:"2p",8A:"8z",44:"44",6F:"6F",28:"28",12:"12"}});E.V({6E:"O.1b",8y:"19.4w(O,\'1b\')",8x:"19.31(O,2,\'2J\')",8w:"19.31(O,2,\'4v\')",8v:"19.4w(O,\'2J\')",8u:"19.4w(O,\'4v\')",8s:"19.5m(O.1b.1B,O)",8r:"19.5m(O.1B)",6C:"19.12(O,\'8q\')?O.8p||O.8o.T:19.2H(O.3p)"},J(c,d){d=4A("S||J(O){K "+d+"}");E.1i[c]=J(b){L a=E.2a(6,d);7(b&&1v b=="25")a=E.3d(b,a);K 6.2E(E.57(a))}});E.V({6B:"3t",8n:"6s",3n:"6o",8l:"5a",8k:"6P"},J(c,b){E.1i[c]=J(){L a=1a;K 6.V(J(){P(L i=0,M=a.M;i<M;i++)E(a[i])[b](6)})}});E.V({8j:J(a){E.1K(6,a,"");7(6.15==1)6.55(a)},8i:J(a){E.1w.1c(6,a)},8h:J(a){E.1w.1Y(6,a)},8g:J(a){E.1w[E.1w.3E(6,a)?"1Y":"1c"](6,a)},1Y:J(a){7(!a||E.1F(a,[6]).r.M){E("*",6).1c(6).V(J(){E.16.1Y(6);E.3H(6)});7(6.1b)6.1b.2X(6)}},4B:J(){E(">*",6).1Y();2e(6.1B)6.2X(6.1B)}},J(a,b){E.1i[a]=J(){K 6.V(b,1a)}});E.V(["8e","62"],J(i,c){L b=c.2w();E.1i[b]=J(a){K 6[0]==1e?E.14.2B&&T.1k["5h"+c]||E.14.26&&1e["8d"+c]||T.6I=="6H"&&T.1I["5h"+c]||T.1k["5h"+c]:6[0]==T?1Z.2b(1Z.2b(T.1k["5g"+c],T.1I["5g"+c]),1Z.2b(T.1k["5f"+c],T.1I["5f"+c])):a==10?(6.M?E.1m(6[0],b):W):6.1m(b,a.1n==4d?a:a+"2P")}});L C=E.14.26&&4t(E.14.5n)<8c?"(?:[\\\\w*4s-]|\\\\\\\\.)":"(?:[\\\\w\\8b-\\8a*4s-]|\\\\\\\\.)",6w=1D 4r("^>\\\\s*("+C+"+)"),6v=1D 4r("^("+C+"+)(#)("+C+"+)"),6u=1D 4r("^([#.]?)("+C+"*)");E.1s({5d:{"":"m[2]==\'*\'||19.12(a,m[2])","#":"a.4z(\'2s\')==m[2]",":":{88:"i<m[3]-0",86:"i>m[3]-0",31:"m[3]-0==i",6N:"m[3]-0==i",3j:"i==0",3M:"i==r.M-1",6r:"i%2==0",6p:"i%2","3j-4m":"a.1b.3V(\'*\')[0]==a","3M-4m":"19.31(a.1b.5D,1,\'4v\')==a","84-4m":"!19.31(a.1b.5D,2,\'4v\')",6E:"a.1B",4B:"!a.1B",83:"(a.6A||a.80||19(a).1t()||\'\').1g(m[3])>=0",4b:\'"23"!=a.U&&19.1m(a,"18")!="2D"&&19.1m(a,"4X")!="23"\',23:\'"23"==a.U||19.1m(a,"18")=="2D"||19.1m(a,"4X")=="23"\',7Y:"!a.2W",2W:"a.2W",3o:"a.3o",2p:"a.2p||19.1K(a,\'2p\')",1t:"\'1t\'==a.U",5w:"\'5w\'==a.U",5y:"\'5y\'==a.U",5b:"\'5b\'==a.U",3J:"\'3J\'==a.U",59:"\'59\'==a.U",6n:"\'6n\'==a.U",6m:"\'6m\'==a.U",2G:\'"2G"==a.U||19.12(a,"2G")\',48:"/48|2y|6l|2G/i.17(a.12)",3E:"19.2r(m[3],a).M",7X:"/h\\\\d/i.17(a.12)",7W:"19.3x(19.3I,J(1i){K a==1i.O;}).M"}},6j:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1D 4r("^([:.#]*)("+C+"+)")],3d:J(a,c,b){L d,2o=[];2e(a&&a!=d){d=a;L f=E.1F(a,c,b);a=f.t.1p(/^\\s*,\\s*/,"");2o=b?c=f.r:E.34(2o,f.r)}K 2o},2r:J(t,p){7(1v t!="25")K[t];7(p&&p.15!=1&&p.15!=9)K[];p=p||T;L d=[p],2j=[],3M,12;2e(t&&3M!=t){L r=[];3M=t;t=E.3f(t);L o=S;L g=6w;L m=g.39(t);7(m){12=m[1].2F();P(L i=0;d[i];i++)P(L c=d[i].1B;c;c=c.2J)7(c.15==1&&(12=="*"||c.12.2F()==12))r.1h(c);d=r;t=t.1p(g,"");7(t.1g(" ")==0)6z;o=R}N{g=/^([>+~])\\s*(\\w*)/i;7((m=g.39(t))!=W){r=[];L l={};12=m[2].2F();m=m[1];P(L j=0,3g=d.M;j<3g;j++){L n=m=="~"||m=="+"?d[j].2J:d[j].1B;P(;n;n=n.2J)7(n.15==1){L h=E.Q(n);7(m=="~"&&l[h])1T;7(!12||n.12.2F()==12){7(m=="~")l[h]=R;r.1h(n)}7(m=="+")1T}}d=r;t=E.3f(t.1p(g,""));o=R}}7(t&&!o){7(!t.1g(",")){7(p==d[0])d.4k();2j=E.34(2j,d);r=d=[p];t=" "+t.6i(1,t.M)}N{L k=6v;L m=k.39(t);7(m){m=[0,m[2],m[3],m[1]]}N{k=6u;m=k.39(t)}m[2]=m[2].1p(/\\\\/g,"");L f=d[d.M-1];7(m[1]=="#"&&f&&f.5N&&!E.3W(f)){L q=f.5N(m[2]);7((E.14.1d||E.14.2B)&&q&&1v q.2s=="25"&&q.2s!=m[2])q=E(\'[@2s="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.12(q,m[3]))?[q]:[]}N{P(L i=0;d[i];i++){L a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&d[i].12.2w()=="4D")a="3v";r=E.34(r,d[i].3V(a))}7(m[1]==".")r=E.58(r,m[2]);7(m[1]=="#"){L e=[];P(L i=0;r[i];i++)7(r[i].4z("2s")==m[2]){e=[r[i]];1T}r=e}d=r}t=t.1p(k,"")}}7(t){L b=E.1F(t,r);d=r=b.r;t=E.3f(b.t)}}7(t)d=[];7(d&&p==d[0])d.4k();2j=E.34(2j,d);K 2j},58:J(r,m,a){m=" "+m+" ";L c=[];P(L i=0;r[i];i++){L b=(" "+r[i].1w+" ").1g(m)>=0;7(!a&&b||a&&!b)c.1h(r[i])}K c},1F:J(t,r,h){L d;2e(t&&t!=d){d=t;L p=E.6j,m;P(L i=0;p[i];i++){m=p[i].39(t);7(m){t=t.7V(m[0].M);m[2]=m[2].1p(/\\\\/g,"");1T}}7(!m)1T;7(m[1]==":"&&m[2]=="4I")r=G.17(m[3])?E.1F(m[3],r,R).r:E(r).4I(m[3]);N 7(m[1]==".")r=E.58(r,m[2],h);N 7(m[1]=="["){L g=[],U=m[3];P(L i=0,3g=r.M;i<3g;i++){L a=r[i],z=a[E.3S[m[2]]||m[2]];7(z==W||/6T|3R|2p/.17(m[2]))z=E.1K(a,m[2])||\'\';7((U==""&&!!z||U=="="&&z==m[5]||U=="!="&&z!=m[5]||U=="^="&&z&&!z.1g(m[5])||U=="$="&&z.6i(z.M-m[5].M)==m[5]||(U=="*="||U=="~=")&&z.1g(m[5])>=0)^h)g.1h(a)}r=g}N 7(m[1]==":"&&m[2]=="31-4m"){L e={},g=[],17=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.39(m[3]=="6r"&&"2n"||m[3]=="6p"&&"2n+1"||!/\\D/.17(m[3])&&"7U+"+m[3]||m[3]),3j=(17[1]+(17[2]||1))-0,d=17[3]-0;P(L i=0,3g=r.M;i<3g;i++){L j=r[i],1b=j.1b,2s=E.Q(1b);7(!e[2s]){L c=1;P(L n=1b.1B;n;n=n.2J)7(n.15==1)n.4p=c++;e[2s]=R}L b=S;7(3j==0){7(j.4p==d)b=R}N 7((j.4p-d)%3j==0&&(j.4p-d)/3j>=0)b=R;7(b^h)g.1h(j)}r=g}N{L f=E.5d[m[1]];7(1v f!="25")f=E.5d[m[1]][m[2]];f=4A("S||J(a,i){K "+f+"}");r=E.3x(r,f,h)}}K{r:r,t:t}},4w:J(b,c){L d=[];L a=b[c];2e(a&&a!=T){7(a.15==1)d.1h(a);a=a[c]}K d},31:J(a,e,c,b){e=e||1;L d=0;P(;a;a=a[c])7(a.15==1&&++d==e)1T;K a},5m:J(n,a){L r=[];P(;n;n=n.2J){7(n.15==1&&(!a||n!=a))r.1h(n)}K r}});E.16={1c:J(f,i,g,e){7(f.15==3||f.15==8)K;7(E.14.1d&&f.54!=10)f=1e;7(!g.2A)g.2A=6.2A++;7(e!=10){L h=g;g=J(){K h.1j(6,1a)};g.Q=e;g.2A=h.2A}L j=E.Q(f,"2N")||E.Q(f,"2N",{}),1x=E.Q(f,"1x")||E.Q(f,"1x",J(){L a;7(1v E=="10"||E.16.52)K a;a=E.16.1x.1j(1a.3G.O,1a);K a});1x.O=f;E.V(i.2d(/\\s+/),J(c,b){L a=b.2d(".");b=a[0];g.U=a[1];L d=j[b];7(!d){d=j[b]={};7(!E.16.2l[b]||E.16.2l[b].4i.1O(f)===S){7(f.3F)f.3F(b,1x,S);N 7(f.6h)f.6h("4h"+b,1x)}}d[g.2A]=g;E.16.2g[b]=R});f=W},2A:1,2g:{},1Y:J(e,h,f){7(e.15==3||e.15==8)K;L i=E.Q(e,"2N"),2f,5E;7(i){7(h==10)P(L g 1r i)6.1Y(e,g);N{7(h.U){f=h.2k;h=h.U}E.V(h.2d(/\\s+/),J(b,a){L c=a.2d(".");a=c[0];7(i[a]){7(f)2T i[a][f.2A];N P(f 1r i[a])7(!c[1]||i[a][f].U==c[1])2T i[a][f];P(2f 1r i[a])1T;7(!2f){7(!E.16.2l[a]||E.16.2l[a].4g.1O(e)===S){7(e.6f)e.6f(a,E.Q(e,"1x"),S);N 7(e.6d)e.6d("4h"+a,E.Q(e,"1x"))}2f=W;2T i[a]}}})}P(2f 1r i)1T;7(!2f){L d=E.Q(e,"1x");7(d)d.O=W;E.3H(e,"2N");E.3H(e,"1x")}}},1U:J(f,b,c,d,g){b=E.2H(b||[]);7(!c){7(6.2g[f])E("*").1c([1e,T]).1U(f,b)}N{7(c.15==3||c.15==8)K 10;L a,2f,1i=E.1q(c[f]||W),16=!b[0]||!b[0].32;7(16)b.4U(6.51({U:f,2K:c}));b[0].U=f;7(E.1q(E.Q(c,"1x")))a=E.Q(c,"1x").1j(c,b);7(!1i&&c["4h"+f]&&c["4h"+f].1j(c,b)===S)a=S;7(16)b.4k();7(g&&E.1q(g)){2f=g.1j(c,a==W?b:b.6Q(a));7(2f!==10)a=2f}7(1i&&d!==S&&a!==S&&!(E.12(c,\'a\')&&f=="50")){6.52=R;1R{c[f]()}1W(e){}}6.52=S}K a},1x:J(c){L a;c=E.16.51(c||1e.16||{});L b=c.U.2d(".");c.U=b[0];L f=E.Q(6,"2N")&&E.Q(6,"2N")[c.U],3B=1N.2m.2V.1O(1a,1);3B.4U(c);P(L j 1r f){L d=f[j];3B[0].2k=d;3B[0].Q=d.Q;7(!b[1]||d.U==b[1]){L e=d.1j(6,3B);7(a!==S)a=e;7(e===S){c.32();c.41()}}}7(E.14.1d)c.2K=c.32=c.41=c.2k=c.Q=W;K a},51:J(c){L a=c;c=E.1s({},a);c.32=J(){7(a.32)a.32();a.7T=S};c.41=J(){7(a.41)a.41();a.7S=R};7(!c.2K)c.2K=c.7R||T;7(c.2K.15==3)c.2K=a.2K.1b;7(!c.4W&&c.4V)c.4W=c.4V==c.2K?c.7Q:c.4V;7(c.6b==W&&c.6a!=W){L b=T.1I,1k=T.1k;c.6b=c.6a+(b&&b.2i||1k&&1k.2i||0)-(b.68||0);c.7O=c.7N+(b&&b.2x||1k&&1k.2x||0)-(b.67||0)}7(!c.3r&&((c.4f||c.4f===0)?c.4f:c.66))c.3r=c.4f||c.66;7(!c.65&&c.64)c.65=c.64;7(!c.3r&&c.2G)c.3r=(c.2G&1?1:(c.2G&2?3:(c.2G&4?2:0)));K c},2l:{21:{4i:J(){5A();K},4g:J(){K}},47:{4i:J(){7(E.14.1d)K S;E(6).2z("4Q",E.16.2l.47.2k);K R},4g:J(){7(E.14.1d)K S;E(6).42("4Q",E.16.2l.47.2k);K R},2k:J(a){7(I(a,6))K R;1a[0].U="47";K E.16.1x.1j(6,1a)}},46:{4i:J(){7(E.14.1d)K S;E(6).2z("4P",E.16.2l.46.2k);K R},4g:J(){7(E.14.1d)K S;E(6).42("4P",E.16.2l.46.2k);K R},2k:J(a){7(I(a,6))K R;1a[0].U="46";K E.16.1x.1j(6,1a)}}}};E.1i.1s({2z:J(c,a,b){K c=="4O"?6.30(c,a,b):6.V(J(){E.16.1c(6,c,b||a,b&&a)})},30:J(d,b,c){K 6.V(J(){E.16.1c(6,d,J(a){E(6).42(a);K(c||b).1j(6,1a)},c&&b)})},42:J(a,b){K 6.V(J(){E.16.1Y(6,a,b)})},1U:J(c,a,b){K 6.V(J(){E.16.1U(c,a,6,R,b)})},63:J(c,a,b){7(6[0])K E.16.1U(c,a,6[0],S,b);K 10},2h:J(){L b=1a;K 6.50(J(a){6.4N=0==6.4N?1:0;a.32();K b[6.4N].1j(6,1a)||S})},7F:J(a,b){K 6.2z(\'47\',a).2z(\'46\',b)},21:J(a){5A();7(E.2Q)a.1O(T,E);N E.3w.1h(J(){K a.1O(6,E)});K 6}});E.1s({2Q:S,3w:[],21:J(){7(!E.2Q){E.2Q=R;7(E.3w){E.V(E.3w,J(){6.1j(T)});E.3w=W}E(T).63("21")}}});L x=S;J 5A(){7(x)K;x=R;7(T.3F&&!E.14.2B)T.3F("61",E.21,S);7(E.14.1d&&1e==3b)(J(){7(E.2Q)K;1R{T.1I.7D("2c")}1W(3e){3z(1a.3G,0);K}E.21()})();7(E.14.2B)T.3F("61",J(){7(E.2Q)K;P(L i=0;i<T.4M.M;i++)7(T.4M[i].2W){3z(1a.3G,0);K}E.21()},S);7(E.14.26){L a;(J(){7(E.2Q)K;7(T.3c!="60"&&T.3c!="1z"){3z(1a.3G,0);K}7(a===10)a=E("Y, 5O[7B=7A]").M;7(T.4M.M!=a){3z(1a.3G,0);K}E.21()})()}E.16.1c(1e,"43",E.21)}E.V(("7z,7y,43,7x,5g,4O,50,7w,"+"7v,7u,7C,4Q,4P,7t,2y,"+"59,7s,7r,7G,3e").2d(","),J(i,b){E.1i[b]=J(a){K a?6.2z(b,a):6.1U(b)}});L I=J(a,c){L b=a.4W;2e(b&&b!=c)1R{b=b.1b}1W(3e){b=c}K b==c};E(1e).2z("4O",J(){E("*").1c(T).42()});E.1i.1s({43:J(g,d,c){7(E.1q(g))K 6.2z("43",g);L e=g.1g(" ");7(e>=0){L i=g.2V(e,g.M);g=g.2V(0,e)}c=c||J(){};L f="4J";7(d)7(E.1q(d)){c=d;d=W}N{d=E.3v(d);f="5Z"}L h=6;E.3Q({1f:g,U:f,1G:"3q",Q:d,1z:J(a,b){7(b=="1X"||b=="5Y")h.3q(i?E("<1u/>").3t(a.4e.1p(/<1o(.|\\s)*?\\/1o>/g,"")).2r(i):a.4e);h.V(c,[a.4e,b,a])}});K 6},7q:J(){K E.3v(6.5X())},5X:J(){K 6.2a(J(){K E.12(6,"3i")?E.2H(6.7p):6}).1F(J(){K 6.37&&!6.2W&&(6.3o||/2y|6l/i.17(6.12)||/1t|23|3J/i.17(6.U))}).2a(J(i,c){L b=E(6).5P();K b==W?W:b.1n==1N?E.2a(b,J(a,i){K{37:c.37,1C:a}}):{37:c.37,1C:b}}).22()}});E.V("5W,5V,5U,69,5T,5S".2d(","),J(i,o){E.1i[o]=J(f){K 6.2z(o,f)}});L B=(1D 3O).3N();E.1s({22:J(d,b,a,c){7(E.1q(b)){a=b;b=W}K E.3Q({U:"4J",1f:d,Q:b,1X:a,1G:c})},7o:J(b,a){K E.22(b,W,a,"1o")},7n:J(c,b,a){K E.22(c,b,a,"2O")},7m:J(d,b,a,c){7(E.1q(b)){a=b;b={}}K E.3Q({U:"5Z",1f:d,Q:b,1X:a,1G:c})},7Z:J(a){E.1s(E.4H,a)},4H:{2g:R,U:"4J",2U:0,5R:"49/x-7j-3i-7i",6x:R,3l:R,Q:W,6t:W,3J:W,4n:{3L:"49/3L, 1t/3L",3q:"1t/3q",1o:"1t/4l, 49/4l",2O:"49/2O, 1t/4l",1t:"1t/7e",4o:"*/*"}},4q:{},3Q:J(s){L f,2Y=/=\\?(&|$)/g,1A,Q;s=E.1s(R,s,E.1s(R,{},E.4H,s));7(s.Q&&s.6x&&1v s.Q!="25")s.Q=E.3v(s.Q);7(s.1G=="4u"){7(s.U.2w()=="22"){7(!s.1f.1E(2Y))s.1f+=(s.1f.1E(/\\?/)?"&":"?")+(s.4u||"7d")+"=?"}N 7(!s.Q||!s.Q.1E(2Y))s.Q=(s.Q?s.Q+"&":"")+(s.4u||"7d")+"=?";s.1G="2O"}7(s.1G=="2O"&&(s.Q&&s.Q.1E(2Y)||s.1f.1E(2Y))){f="4u"+B++;7(s.Q)s.Q=(s.Q+"").1p(2Y,"="+f+"$1");s.1f=s.1f.1p(2Y,"="+f+"$1");s.1G="1o";1e[f]=J(a){Q=a;1X();1z();1e[f]=10;1R{2T 1e[f]}1W(e){}7(h)h.2X(g)}}7(s.1G=="1o"&&s.1Q==W)s.1Q=S;7(s.1Q===S&&s.U.2w()=="22"){L i=(1D 3O()).3N();L j=s.1f.1p(/(\\?|&)4s=.*?(&|$)/,"$a2="+i+"$2");s.1f=j+((j==s.1f)?(s.1f.1E(/\\?/)?"&":"?")+"4s="+i:"")}7(s.Q&&s.U.2w()=="22"){s.1f+=(s.1f.1E(/\\?/)?"&":"?")+s.Q;s.Q=W}7(s.2g&&!E.5M++)E.16.1U("5W");7((!s.1f.1g("9Z")||!s.1f.1g("//"))&&(s.1G=="1o"||s.1G=="2O")&&s.U.2w()=="22"){L h=T.3V("6k")[0];L g=T.2R("1o");g.3R=s.1f;7(s.7c)g.9X=s.7c;7(!f){L l=S;g.9V=g.9U=J(){7(!l&&(!6.3c||6.3c=="60"||6.3c=="1z")){l=R;1X();1z();h.2X(g)}}}h.3k(g);K 10}L m=S;L k=1e.7a?1D 7a("9S.9Q"):1D 79();k.9P(s.U,s.1f,s.3l,s.6t,s.3J);1R{7(s.Q)k.4G("9N-9M",s.5R);7(s.5I)k.4G("9L-5H-9J",E.4q[s.1f]||"9H, 9G 9E 9B 5G:5G:5G 9z");k.4G("X-9x-9u","79");k.4G("9t",s.1G&&s.4n[s.1G]?s.4n[s.1G]+", */*":s.4n.4o)}1W(e){}7(s.75)s.75(k);7(s.2g)E.16.1U("5S",[k,s]);L c=J(a){7(!m&&k&&(k.3c==4||a=="2U")){m=R;7(d){74(d);d=W}1A=a=="2U"&&"2U"||!E.73(k)&&"3e"||s.5I&&E.72(k,s.1f)&&"5Y"||"1X";7(1A=="1X"){1R{Q=E.71(k,s.1G)}1W(e){1A="5C"}}7(1A=="1X"){L b;1R{b=k.5B("70-5H")}1W(e){}7(s.5I&&b)E.4q[s.1f]=b;7(!f)1X()}N E.5t(s,k,1A);1z();7(s.3l)k=W}};7(s.3l){L d=54(c,13);7(s.2U>0)3z(J(){7(k){k.9m();7(!m)c("2U")}},s.2U)}1R{k.9l(s.Q)}1W(e){E.5t(s,k,W,e)}7(!s.3l)c();J 1X(){7(s.1X)s.1X(Q,1A);7(s.2g)E.16.1U("5T",[k,s])}J 1z(){7(s.1z)s.1z(k,1A);7(s.2g)E.16.1U("5U",[k,s]);7(s.2g&&!--E.5M)E.16.1U("5V")}K k},5t:J(s,a,b,e){7(s.3e)s.3e(a,b,e);7(s.2g)E.16.1U("69",[a,s,e])},5M:0,73:J(r){1R{K!r.1A&&9k.9j=="5b:"||(r.1A>=6Y&&r.1A<9h)||r.1A==6X||r.1A==9e||E.14.26&&r.1A==10}1W(e){}K S},72:J(a,c){1R{L b=a.5B("70-5H");K a.1A==6X||b==E.4q[c]||E.14.26&&a.1A==10}1W(e){}K S},71:J(r,b){L c=r.5B("9d-U");L d=b=="3L"||!b&&c&&c.1g("3L")>=0;L a=d?r.9c:r.4e;7(d&&a.1I.28=="5C")6Z"5C";7(b=="1o")E.5l(a);7(b=="2O")a=4A("("+a+")");K a},3v:J(a){L s=[];7(a.1n==1N||a.5j)E.V(a,J(){s.1h(3s(6.37)+"="+3s(6.1C))});N P(L j 1r a)7(a[j]&&a[j].1n==1N)E.V(a[j],J(){s.1h(3s(j)+"="+3s(6))});N s.1h(3s(j)+"="+3s(a[j]));K s.6g("&").1p(/%20/g,"+")}});E.1i.1s({1J:J(c,b){K c?6.27({1P:"1J",29:"1J",1y:"1J"},c,b):6.1F(":23").V(J(){6.Y.18=6.5x||"";7(E.1m(6,"18")=="2D"){L a=E("<"+6.28+" />").6B("1k");6.Y.18=a.1m("18");7(6.Y.18=="2D")6.Y.18="3u";a.1Y()}}).3h()},1H:J(b,a){K b?6.27({1P:"1H",29:"1H",1y:"1H"},b,a):6.1F(":4b").V(J(){6.5x=6.5x||E.1m(6,"18");6.Y.18="2D"}).3h()},6U:E.1i.2h,2h:J(a,b){K E.1q(a)&&E.1q(b)?6.6U(a,b):a?6.27({1P:"2h",29:"2h",1y:"2h"},a,b):6.V(J(){E(6)[E(6).3K(":23")?"1J":"1H"]()})},98:J(b,a){K 6.27({1P:"1J"},b,a)},97:J(b,a){K 6.27({1P:"1H"},b,a)},96:J(b,a){K 6.27({1P:"2h"},b,a)},95:J(b,a){K 6.27({1y:"1J"},b,a)},94:J(b,a){K 6.27({1y:"1H"},b,a)},9f:J(c,a,b){K 6.27({1y:a},c,b)},27:J(l,k,j,h){L i=E.6V(k,j,h);K 6[i.2S===S?"V":"2S"](J(){7(6.15!=1)K S;L g=E.1s({},i);L f=E(6).3K(":23"),4y=6;P(L p 1r l){7(l[p]=="1H"&&f||l[p]=="1J"&&!f)K E.1q(g.1z)&&g.1z.1j(6);7(p=="1P"||p=="29"){g.18=E.1m(6,"18");g.36=6.Y.36}}7(g.36!=W)6.Y.36="23";g.40=E.1s({},l);E.V(l,J(c,a){L e=1D E.2v(4y,g,c);7(/2h|1J|1H/.17(a))e[a=="2h"?f?"1J":"1H":a](l);N{L b=a.3D().1E(/^([+-]=)?([\\d+-.]+)(.*)$/),24=e.2o(R)||0;7(b){L d=2M(b[2]),2C=b[3]||"2P";7(2C!="2P"){4y.Y[c]=(d||1)+2C;24=((d||1)/e.2o(R))*24;4y.Y[c]=24+2C}7(b[1])d=((b[1]=="-="?-1:1)*d)+24;e.3Z(24,d,2C)}N e.3Z(24,a,"")}});K R})},2S:J(a,b){7(E.1q(a)||(a&&a.1n==1N)){b=a;a="2v"}7(!a||(1v a=="25"&&!b))K A(6[0],a);K 6.V(J(){7(b.1n==1N)A(6,a,b);N{A(6,a).1h(b);7(A(6,a).M==1)b.1j(6)}})},8Z:J(b,c){L a=E.3I;7(b)6.2S([]);6.V(J(){P(L i=a.M-1;i>=0;i--)7(a[i].O==6){7(c)a[i](R);a.6R(i,1)}});7(!c)6.5z();K 6}});L A=J(b,c,a){7(!b)K 10;c=c||"2v";L q=E.Q(b,c+"2S");7(!q||a)q=E.Q(b,c+"2S",a?E.2H(a):[]);K q};E.1i.5z=J(a){a=a||"2v";K 6.V(J(){L q=A(6,a);q.4k();7(q.M)q[0].1j(6)})};E.1s({6V:J(b,a,c){L d=b&&b.1n==8Y?b:{1z:c||!c&&a||E.1q(b)&&b,2t:b,3Y:c&&a||a&&a.1n!=8W&&a};d.2t=(d.2t&&d.2t.1n==53?d.2t:{9w:8U,8T:6Y}[d.2t])||8S;d.5o=d.1z;d.1z=J(){7(d.2S!==S)E(6).5z();7(E.1q(d.5o))d.5o.1j(6)};K d},3Y:{6O:J(p,n,b,a){K b+a*p},5F:J(p,n,b,a){K((-1Z.9C(p*1Z.9D)/2)+0.5)*a+b}},3I:[],3T:W,2v:J(b,c,a){6.11=c;6.O=b;6.1l=a;7(!c.3U)c.3U={}}});E.2v.2m={4C:J(){7(6.11.33)6.11.33.1j(6.O,[6.2I,6]);(E.2v.33[6.1l]||E.2v.33.4o)(6);7(6.1l=="1P"||6.1l=="29")6.O.Y.18="3u"},2o:J(a){7(6.O[6.1l]!=W&&6.O.Y[6.1l]==W)K 6.O[6.1l];L r=2M(E.1m(6.O,6.1l,a));K r&&r>-8N?r:2M(E.2q(6.O,6.1l))||0},3Z:J(c,b,d){6.5s=(1D 3O()).3N();6.24=c;6.3h=b;6.2C=d||6.2C||"2P";6.2I=6.24;6.4E=6.4F=0;6.4C();L e=6;J t(a){K e.33(a)}t.O=6.O;E.3I.1h(t);7(E.3T==W){E.3T=54(J(){L a=E.3I;P(L i=0;i<a.M;i++)7(!a[i]())a.6R(i--,1);7(!a.M){74(E.3T);E.3T=W}},13)}},1J:J(){6.11.3U[6.1l]=E.1K(6.O.Y,6.1l);6.11.1J=R;6.3Z(0,6.2o());7(6.1l=="29"||6.1l=="1P")6.O.Y[6.1l]="8L";E(6.O).1J()},1H:J(){6.11.3U[6.1l]=E.1K(6.O.Y,6.1l);6.11.1H=R;6.3Z(6.2o(),0)},33:J(a){L t=(1D 3O()).3N();7(a||t>6.11.2t+6.5s){6.2I=6.3h;6.4E=6.4F=1;6.4C();6.11.40[6.1l]=R;L b=R;P(L i 1r 6.11.40)7(6.11.40[i]!==R)b=S;7(b){7(6.11.18!=W){6.O.Y.36=6.11.36;6.O.Y.18=6.11.18;7(E.1m(6.O,"18")=="2D")6.O.Y.18="3u"}7(6.11.1H)6.O.Y.18="2D";7(6.11.1H||6.11.1J)P(L p 1r 6.11.40)E.1K(6.O.Y,p,6.11.3U[p])}7(b&&E.1q(6.11.1z))6.11.1z.1j(6.O);K S}N{L n=t-6.5s;6.4F=n/6.11.2t;6.4E=E.3Y[6.11.3Y||(E.3Y.5F?"5F":"6O")](6.4F,n,0,1,6.11.2t);6.2I=6.24+((6.3h-6.24)*6.4E);6.4C()}K R}};E.2v.33={2i:J(a){a.O.2i=a.2I},2x:J(a){a.O.2x=a.2I},1y:J(a){E.1K(a.O.Y,"1y",a.2I)},4o:J(a){a.O.Y[a.1l]=a.2I+a.2C}};E.1i.5f=J(){L b=0,3b=0,O=6[0],5q;7(O)8K(E.14){L d=O.1b,45=O,1M=O.1M,1L=O.2u,5p=26&&4t(5n)<8H,2Z=E.1m(O,"3C")=="2Z";7(O.7b){L c=O.7b();1c(c.2c+1Z.2b(1L.1I.2i,1L.1k.2i),c.3b+1Z.2b(1L.1I.2x,1L.1k.2x));1c(-1L.1I.68,-1L.1I.67)}N{1c(O.5k,O.5K);2e(1M){1c(1M.5k,1M.5K);7(3X&&!/^t(8F|d|h)$/i.17(1M.28)||26&&!5p)3a(1M);7(!2Z&&E.1m(1M,"3C")=="2Z")2Z=R;45=/^1k$/i.17(1M.28)?45:1M;1M=1M.1M}2e(d&&d.28&&!/^1k|3q$/i.17(d.28)){7(!/^a0|1V.*$/i.17(E.1m(d,"18")))1c(-d.2i,-d.2x);7(3X&&E.1m(d,"36")!="4b")3a(d);d=d.1b}7((5p&&(2Z||E.1m(45,"3C")=="4Z"))||(3X&&E.1m(45,"3C")!="4Z"))1c(-1L.1k.5k,-1L.1k.5K);7(2Z)1c(1Z.2b(1L.1I.2i,1L.1k.2i),1Z.2b(1L.1I.2x,1L.1k.2x))}5q={3b:3b,2c:b}}J 3a(a){1c(E.2q(a,"a1",R),E.2q(a,"8D",R))}J 1c(l,t){b+=4t(l)||0;3b+=4t(t)||0}K 5q}})();',62,624,'||||||this|if||||||||||||||||||||||||||||||||||||||function|return|var|length|else|elem|for|data|true|false|document|type|each|null||style||undefined|options|nodeName||browser|nodeType|event|test|display|jQuery|arguments|parentNode|add|msie|window|url|indexOf|push|fn|apply|body|prop|css|constructor|script|replace|isFunction|in|extend|text|div|typeof|className|handle|opacity|complete|status|firstChild|value|new|match|filter|dataType|hide|documentElement|show|attr|doc|offsetParent|Array|call|height|cache|try|tbody|break|trigger|table|catch|success|remove|Math||ready|get|hidden|start|string|safari|animate|tagName|width|map|max|left|split|while|ret|global|toggle|scrollLeft|done|handler|special|prototype||cur|selected|curCSS|find|id|duration|ownerDocument|fx|toLowerCase|scrollTop|select|bind|guid|opera|unit|none|pushStack|toUpperCase|button|makeArray|now|nextSibling|target|stack|parseFloat|events|json|px|isReady|createElement|queue|delete|timeout|slice|disabled|removeChild|jsre|fixed|one|nth|preventDefault|step|merge|inArray|overflow|name|innerHTML|exec|border|top|readyState|multiFilter|error|trim|rl|end|form|first|appendChild|async|elems|insertBefore|checked|childNodes|html|which|encodeURIComponent|append|block|param|readyList|grep|color|setTimeout|runtimeStyle|args|position|toString|has|addEventListener|callee|removeData|timers|password|is|xml|last|getTime|Date|domManip|ajax|src|props|timerId|orig|getElementsByTagName|isXMLDoc|mozilla|easing|custom|curAnim|stopPropagation|unbind|load|selectedIndex|offsetChild|mouseleave|mouseenter|input|application|defaultView|visible|float|String|responseText|charCode|teardown|on|setup|currentStyle|shift|javascript|child|accepts|_default|nodeIndex|lastModified|RegExp|_|parseInt|jsonp|previousSibling|dir|tr|self|getAttribute|eval|empty|update|object|pos|state|setRequestHeader|ajaxSettings|not|GET|getPropertyValue|getComputedStyle|styleSheets|lastToggle|unload|mouseout|mouseover|andSelf|getWH|container2|unshift|fromElement|relatedTarget|visibility|init|absolute|click|fix|triggered|Number|setInterval|removeAttribute|prevObject|unique|classFilter|submit|after|file|clean|expr|windowData|offset|scroll|client|deep|jquery|offsetLeft|globalEval|sibling|version|old|safari2|results|wrapAll|startTime|handleError|container|createTextNode|radio|oldblock|checkbox|dequeue|bindReady|getResponseHeader|parsererror|lastChild|index|swing|00|Modified|ifModified|clone|offsetTop|values|active|getElementById|link|val|col|contentType|ajaxSend|ajaxSuccess|ajaxComplete|ajaxStop|ajaxStart|serializeArray|notmodified|POST|loaded|DOMContentLoaded|Width|triggerHandler|ctrlKey|metaKey|keyCode|clientTop|clientLeft|ajaxError|clientX|pageX|cloneNode|detachEvent|swap|removeEventListener|join|attachEvent|substr|parse|head|textarea|reset|image|before|odd|zoom|even|prepend|username|quickClass|quickID|quickChild|processData|uuid|continue|textContent|appendTo|contents|evalScript|parent|defaultValue|setArray|CSS1Compat|compatMode|cssFloat|styleFloat|webkit|nodeValue|eq|linear|replaceWith|concat|splice|100|href|_toggle|speed|alpha|304|200|throw|Last|httpData|httpNotModified|httpSuccess|clearInterval|beforeSend|colgroup|fieldset|multiple|XMLHttpRequest|ActiveXObject|getBoundingClientRect|scriptCharset|callback|plain|img|hasClass|br|urlencoded|www|abbr|pixelLeft|post|getJSON|getScript|elements|serialize|keypress|keydown|change|mouseup|mousedown|dblclick|resize|focus|blur|stylesheet|rel|mousemove|doScroll|round|hover|keyup|padding|offsetHeight|offsetWidth|Bottom|Top|Right|clientY|pageY|Left|toElement|srcElement|cancelBubble|returnValue|0n|substring|animated|header|enabled|ajaxSetup|innerText|noConflict|size|contains|only|line|gt|weight|lt|font|uFFFF|u0128|417|inner|Height|Boolean|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|wrap|prependTo|contentWindow|contentDocument|iframe|children|siblings|wrapInner|prevAll|nextAll|prev|next|parents|maxLength|maxlength|readOnly|readonly|borderTopWidth|class|able|htmlFor|522|reverse|boxModel|with|1px|compatible|10000|ie|ra|it|rv|400|fast|600|userAgent|Function|navigator|Object|stop|option|array|ig|NaN|fadeOut|fadeIn|slideToggle|slideUp|slideDown|setAttribute|changed|be|responseXML|content|1223|fadeTo|can|300|property|protocol|location|send|abort|getAttributeNode|specified|method|action|cssText|attributes|Accept|With|th|slow|Requested|td|GMT|cap|1970|cos|PI|Jan|colg|01|Thu|tfoot|Since|thead|If|Type|Content|leg|open|XMLHTTP|opt|Microsoft|embed|onreadystatechange|onload|area|charset|hr|http|inline|borderLeftWidth|1_|meta'.split('|'),0,{}));
\ No newline at end of file

Modified: branches/print_dev/http/extensions/json.js
===================================================================
--- branches/print_dev/http/extensions/json.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/extensions/json.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,214 +1,28 @@
-/*
-    json.js
-    2007-01-10
 
-    This file adds these methods to JavaScript:
-
-		toJSONString(obj)
-        arrayToJSONString(obj)
-        booleanToJSONString(obj)
-        dateToJSONString(obj)
-        numberToJSONString(obj)
-        objectToJSONString(obj)
-        stringToJSONString(obj)
-            These methods produce a JSON text from a JavaScript value.
-            It must not contain any cyclical references. Illegal values
-            will be excluded.
-
-            The default conversion for dates is to an ISO string. You can
-            add a toJSONString method to any date object to get a different
-            representation.
-
-        parseJSON(string, filter)
-            This method parses a JSON text to produce an object or
-            array. It can throw a SyntaxError exception.
-
-            The optional filter parameter is a function which can filter and
-            transform the results. It receives each of the keys and values, and
-            its return value is used instead of the original value. If it
-            returns what it received, then structure is not modified. If it
-            returns undefined then the member is deleted.
-
-            Example:
-
-            // Parse the text. If a key contains the string 'date' then
-            // convert the value to a date.
-
-            myData = text.parseJSON(function (key, value) {
-                return key.indexOf('date') >= 0 ? new Date(value) : value;
-            });
-
-    It is expected that these methods will formally become part of the
-    JavaScript Programming Language in the Fourth Edition of the
-    ECMAScript standard in 2007.
-*/
-function arrayToJSONString(ao){
-	var a = ['['], b, i, l = ao.length, v;
-	
-	function p(s) {
-		if (b) {
-			a.push(',');
-		}
-		a.push(s);
-		b = true;
-	}
-
-	for (i = 0; i < l; i += 1) {
-		v = ao[i];
-		switch (typeof v) {
-		case 'undefined':
-		case 'function':
-		case 'unknown':
-			break;
-		case 'object':
-			if (v) {
-				p(toJSONString(v));
-			} else {
-				p("null");
-			}
-			break;
-		default:
-			p(toJSONString(v));
-		}
-	}
-	a.push(']');
-	return a.join('');		
-}
-function boolToJSONString(bo) {
-	return String(bo);
-};
-
-function dateToJSONString(dao) {
-	function f(n) {
-		return n < 10 ? '0' + n : n;
-	}
-
-	return '"' + dao.getFullYear() + '-' +
-		f(dao.getMonth() + 1) + '-' +
-		f(dao.getDate()) + 'T' +
-		f(dao.getHours()) + ':' +
-		f(dao.getMinutes()) + ':' +
-		f(dao.getSeconds()) + '"';
-};
-   
-function numberToJSONString(no) {
-	return isFinite(no) ? String(no) : "null";
-};
-
-function objectToJSONString(ob) {
-	
-	var a = ['{'], b, i, v;
-
-	function p(s) {
-		if (b) {
-			a.push(',');
-		}
-		a.push(toJSONString(i), ':', s);
-		b = true;
-	}
-
-	for (i in ob) {
-		if (ob.hasOwnProperty(i)) {
-			v = ob[i];
-			switch (typeof v) {
-			case 'undefined':
-			case 'function':
-			case 'unknown':
-				break;
-			case 'object':
-				if (v) {
-					p(toJSONString(v));
-				} else {
-					p("null");
-				}
-				break;
-			default:
-				p(toJSONString(v));
-			}
-		}
-	}
-	a.push('}');
-	return a.join('');
-};
-
-function stringToJSONString(so){
-	var m = {
-		'\b': '\\b',
-		'\t': '\\t',
-		'\n': '\\n',
-		'\f': '\\f',
-		'\r': '\\r',
-		'"' : '\\"',
-		'\\': '\\\\'
-	};	
-	if (/["\\\x00-\x1f]/.test(so)) {
-		return '"' + so.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 '"' + so + '"';
-}
-
-function toJSONString(o){
-	switch(typeof o){
-	case 'undefined':
-	case 'function':
-	case 'unknown':
-		break;
-	case 'object':
-		if (o.constructor == Array){
-			return arrayToJSONString(o);
-		}else if(o.constructor == Date){
-			return dateToJSONString(o);
-		}else{
-			return objectToJSONString(o);
-		}
-	case 'number':
-		return numberToJSONString(o);
-	case 'string':
-		return stringToJSONString(o);
-	case 'boolean':
-		return boolToJSONString(o);
-	}
-}
-
-function parseJSON(so, filter){
-	var m = {
-		'\b': '\\b',
-		'\t': '\\t',
-		'\n': '\\n',
-		'\f': '\\f',
-		'\r': '\\r',
-		'"' : '\\"',
-		'\\': '\\\\'
-	};	
-	try {
-		if (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.
-				test(so)) {
-			var j = eval('(' + so + ')');
-			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);
-				}
-				return walk('', j);
-			}
-			return j;
-		}
-	} catch (e) {
-	}
-	throw new SyntaxError("parseJSON");        
-}
\ No newline at end of file
+function arrayToJSONString(ao){var a=['['],b,i,l=ao.length,v;function p(s){if(b){a.push(',');}
+a.push(s);b=true;}
+for(i=0;i<l;i+=1){v=ao[i];switch(typeof v){case'undefined':case'function':case'unknown':break;case'object':if(v){p(toJSONString(v));}else{p("null");}
+break;default:p(toJSONString(v));}}
+a.push(']');return a.join('');}
+function boolToJSONString(bo){return String(bo);};function dateToJSONString(dao){function f(n){return n<10?'0'+n:n;}
+return'"'+dao.getFullYear()+'-'+
+f(dao.getMonth()+1)+'-'+
+f(dao.getDate())+'T'+
+f(dao.getHours())+':'+
+f(dao.getMinutes())+':'+
+f(dao.getSeconds())+'"';};function numberToJSONString(no){return isFinite(no)?String(no):"null";};function objectToJSONString(ob){var a=['{'],b,i,v;function p(s){if(b){a.push(',');}
+a.push(toJSONString(i),':',s);b=true;}
+for(i in ob){if(ob.hasOwnProperty(i)){v=ob[i];switch(typeof v){case'undefined':case'function':case'unknown':break;case'object':if(v){p(toJSONString(v));}else{p("null");}
+break;default:p(toJSONString(v));}}}
+a.push('}');return a.join('');};function stringToJSONString(so){var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};if(/["\\\x00-\x1f]/.test(so)){return'"'+so.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'"'+so+'"';}
+function toJSONString(o){switch(typeof o){case'undefined':case'function':case'unknown':break;case'object':if(o.constructor==Array){return arrayToJSONString(o);}else if(o.constructor==Date){return dateToJSONString(o);}else{return objectToJSONString(o);}
+case'number':return numberToJSONString(o);case'string':return stringToJSONString(o);case'boolean':return boolToJSONString(o);}}
+function parseJSON(so,filter){var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};try{if(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(so)){var j=eval('('+so+')');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);}
+return walk('',j);}
+return j;}}catch(e){}
+throw new SyntaxError("parseJSON");}
\ No newline at end of file

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

Added: branches/print_dev/http/frames/checksum.json
===================================================================
--- branches/print_dev/http/frames/checksum.json	                        (rev 0)
+++ branches/print_dev/http/frames/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"jquery.html":"9c7b9b3d7d13decc369ead190cc1416c25740ae9","cleanurl.php":"1d32dca6bb527b26daa2aab3d1ba8cd37d35e4fe","login.php":"65752a4924d72fd163817430af008c30e07597b9","index.php":"d6b64bcfe7ab3f333f20f45a0cf35dd3c3f11a3a","frameset.html":"81eee8eda6359fee117950a7c5d3084c661f5907"}
\ No newline at end of file

Modified: branches/print_dev/http/frames/index.php
===================================================================
--- branches/print_dev/http/frames/index.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/frames/index.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -19,20 +19,24 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 require("../php/mb_validateSession.php");
-require_once(dirname(__FILE__)."/../classes/class_gui.php");
 
-$_SESSION["mb_user_gui"] = $gui_id;
-
 //
 // check if user is allowed to access current GUI; 
 // if not, return to login screen
 //
 if (!in_array($gui_id, $_SESSION["mb_user_guis"])) {
 	$e = new mb_exception("mb_validateSession.php: User: " . $_SESSION["mb_user_id"] . " not allowed to access GUI " . $gui_id);
-	session_write_close();
 	header("Location: ".LOGIN);
 	die();
 }
+
+$pattern = "/sessionID/";
+
+$_SESSION["mb_user_gui"] = $gui_id;
+
+
+
+
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
@@ -46,9 +50,11 @@
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="expires" content="0">
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET;?>">
-<title><?php echo  $gui_id;?> - presented by Mapbender</title>
 <?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title><?php  echo  $gui_id;?> - presented by Mapbender</title>
+<?php
 $sql = "SELECT * FROM gui_element_vars WHERE fkey_e_id = 'body' AND fkey_gui_id = $1 and var_type='file/css'";
 $v = array($gui_id);
 $t = array('s');
@@ -72,13 +78,84 @@
 ?>
 -->
 </style>
-<script type='text/javascript' src='../javascripts/core.php'></script>
-</head>
 <?php
-$currentApplication = new gui($gui_id);
-echo $currentApplication->toHtml();
-$mapPhpParameters = $urlParameters."&mb_myBBOX=".$_REQUEST["mb_myBBOX"];
-echo "<script type='text/javascript' src='../javascripts/map.php?".$mapPhpParameters."'></script>";
+/*********************************************/
+$frame = "";
+/*********************************************/
 
+echo "<script type='text/javascript' src='../javascripts/core.php'></script>";
 ?>
+</head>
+<?php
+$sql = "SELECT fkey_gui_id,e_id,e_pos,e_public,e_comment,gettext($1, e_title) as e_title, e_element,";
+$sql .= "e_src,e_attributes,e_left,e_top,e_width,e_height,e_z_index,e_more_styles,";
+$sql .= "e_content,e_closetag,e_js_file,e_mb_mod,e_target,e_requires,e_url FROM gui_element WHERE e_public = 1 AND fkey_gui_id = $2 ORDER BY e_pos";
+$v = array($_SESSION["mb_lang"], $gui_id);
+$t = array('s', 's');
+$res = db_prep_query($sql,$v,$t);
+$i = 0;
+while(db_fetch_row($res)){
+	$replacement = $urlParameters."&elementID=".db_result($res,$i,"e_id");
+	echo "<".db_result($res,$i,"e_element")." ";
+	if(db_result($res,$i,"e_id") != ""){
+		echo " id='".db_result($res,$i,"e_id")."'";
+		echo " name='".db_result($res,$i,"e_id")."'";
+	}
+	if(db_result($res,$i,"e_attributes") != ""){
+		echo " ".stripslashes(preg_replace($pattern,$replacement,db_result($res,$i,"e_attributes")));
+	}
+	if(db_result($res,$i,"e_title") != ""){
+		echo " title='".db_result($res,$i,"e_title")."' ";
+	}
+	if(db_result($res,$i,"e_src") != ""){
+		if(db_result($res,$i,"e_closetag") == "iframe" && db_result($res,$i,"e_id") != 'loadData'){
+      		echo " src = '".preg_replace($pattern,$replacement,db_result($res,$i,"e_src"));
+				if(mb_strpos(db_result($res,$i,"e_src"), "?")) {
+					echo "&";
+				}
+				else {
+	      			echo "?";
+      			}
+      			echo "e_id_css=".db_result($res,$i,"e_id")."&e_id=".db_result($res,$i,"e_id") . 
+					"&e_target=".db_result($res,$i,"e_target").
+					"&" . $urlParameters . "'";
+		}
+		else{
+			echo " src = '".preg_replace($pattern,$replacement,db_result($res,$i,"e_src"))."'";
+		}
+	}
+	echo " style = '";
+	if(db_result($res,$i,"e_left") != "" && db_result($res,$i,"e_top") != ""){
+		echo "position:absolute;";
+		echo "left:".db_result($res,$i,"e_left").";";
+		echo "top:".db_result($res,$i,"e_top").";";
+	}
+	if(db_result($res,$i,"e_width") != "" && db_result($res,$i,"e_height") != ""){
+		echo "width:".db_result($res,$i,"e_width").";";
+		echo "height:".db_result($res,$i,"e_height").";";
+	}
+	if(db_result($res,$i,"e_z_index") != ""){
+    	echo "z-index:".db_result($res,$i,"e_z_index").";";
+	}
+	if(db_result($res,$i,"e_more_styles") != ""){
+    	echo db_result($res,$i,"e_more_styles");
+	}
+	echo "' >";
+	if(db_result($res,$i,"e_content") != ""){
+		echo " ".stripslashes(db_result($res,$i,"e_content"));
+	}
+	if(db_result($res,$i,"e_closetag") != "" && db_result($res,$i,"e_closetag") != "body"){
+		echo " </".db_result($res,$i,"e_closetag").">";
+	}
+	$i++;
+}
+?>
+<form id='sendData' name='sendData' action='' method='POST' target='loadData' style='position:absolute;left:800px'>
+<input type='hidden' name='data'>
+</form>
+<?php
+#echo "<script type='text/javascript' src='../javascripts/map.php?gui_id=".$_REQUEST["gui_id"]."&zoomToLayer=".$_REQUEST["zoomToLayer"]."&portal_services=".$_REQUEST['portal_services']."&portal_services_wfs=".$_REQUEST['portal_services_wfs']."&layer_preview=".$_REQUEST['layer_preview']."&".strip_tags(SID)."&mb_myBBOX=".$_REQUEST["mb_myBBOX"]."'></script>";
+echo "<script type='text/javascript' src='../javascripts/map.php?".$urlParameters."&mb_myBBOX=".$_REQUEST["mb_myBBOX"]."'></script>";
+?>
+</body>
 </html>

Added: branches/print_dev/http/frames/jquery.html
===================================================================
--- branches/print_dev/http/frames/jquery.html	                        (rev 0)
+++ branches/print_dev/http/frames/jquery.html	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>Untitled</title>
+<script type='text/javascript' src="../extensions/jquery.js"></script>
+</head>
+<body>
+
+</body>
+</html>

Modified: branches/print_dev/http/frames/login.php
===================================================================
--- branches/print_dev/http/frames/login.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/frames/login.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -175,7 +175,6 @@
 				if(isset($_REQUEST["mb_myBBOX"])){
 					$myURL .= "&mb_myBBOX=".$_REQUEST["mb_myBBOX"];
 				}
-				session_write_close();
 				header ($myURL);
 				exit;
 			}

Added: branches/print_dev/http/html/checksum.json
===================================================================
--- branches/print_dev/http/html/checksum.json	                        (rev 0)
+++ branches/print_dev/http/html/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"tab_imprint.html":"832771426e7becea24221be42556409d01fe61cb","mod_sync_treefolder.php":"2250342d4f1725e1401d17ba14668a6910e1ca41","mod_treefolder.html":"9906a5a9cdcc2f7d1d7a764317ad87c3730aaae5","mod_treefolder.php":"a705b039b94ed9888ac6f9654e75987a003d7076","mod_blank.html":"859f7bdb015797cd949bf6fac1e21526e39add9d","mod_treefolder2.php":"26112d305cc2c1b11114b63c206703c4306ea3a8"}
\ No newline at end of file

Modified: branches/print_dev/http/html/mod_treefolder.html
===================================================================
--- branches/print_dev/http/html/mod_treefolder.html	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/html/mod_treefolder.html	2008-10-06 10:40:54 UTC (rev 3125)
@@ -83,15 +83,6 @@
   mod_treeGDE_map = "mapframe1";
   parent.mb_registerSubFunctions("window.frames['treeGDE'].mod_treeGDE()");
 
-function getWMSIndexByTitle(frameName,wms_title){
-   var ind = parent.getMapObjIndexByName(frameName);
-   for(var i=0; i< parent.mb_mapObj[ind].wms.length; i++){
-      if(parent.mb_mapObj[ind].wms[i].wms_title == wms_title){
-         return i;
-      }
-   }
-}
-
 function mod_treeGDE(){
   /**/
 	var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
@@ -101,7 +92,7 @@
 		var myID = document.getElementsByTagName("input")[i].id;
 		var arrayID = document.getElementsByTagName("input")[i].id.split("###");
 		//var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
-		var wms_ind = getWMSIndexByTitle(mod_treeGDE_map,arrayID[0]);
+		var wms_ind = parent.getWMSIndexByTitle(mod_treeGDE_map,arrayID[0]);
 		if(arrayID[2] == "visible"){
 			var arrayLayer = parent.mb_mapObj[ind].layers[wms_ind].split(",");
 			var isOn = false;

Modified: branches/print_dev/http/html/mod_treefolder2.php
===================================================================
--- branches/print_dev/http/html/mod_treefolder2.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/html/mod_treefolder2.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,620 +1,633 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/Mod_treefolder2.php
-# Copyright (C) 2007 Melchior Moos
-#
-# 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.
-
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/Mod_treefolder2.php
+# Copyright (C) 2007 Melchior Moos
+#
+# 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__)."/../php/mb_validateSession.php");
-$gui_id = $_SESSION["mb_user_gui"];
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
-?>
-<TITLE>Treefolder</TITLE>
-<?php
- include '../include/dyn_css.php';
-?>
-<script language='JavaScript'>
-
-function openwindow(Adresse) {
-Fenster1 = window.open(Adresse, "Informationen", "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=no");
-Fenster1.focus();
-}
-</script>
-<script src="../javascripts/jsTree.js" type="text/javascript" language="JavaScript"></script>
-<?php
-echo "<script language='JavaScript'>";
-   $sql = "SELECT e_target FROM gui_element WHERE e_id = $1 AND fkey_gui_id = $2";
-   $v = array($_REQUEST['e_id_css'],$_SESSION["mb_user_gui"]);
-   $t = array('s','s');
-   $res = db_prep_query($sql,$v,$t);
-   $e_target = db_result($res,0,"e_target");
-   echo "mod_treeGDE_map = '".$e_target."';";
-echo "</script>";
-session_write_close();
-?>
-<SCRIPT language="JavaScript" type="text/javascript">
-
-var msgObj = {};
-msgObj.tooltipHandleWms = '<?php echo _mb("(De)activate this service");?>';
-msgObj.tooltipLayerVisible = '<?php echo _mb("Toggles the visibility of this service");?>';
-msgObj.tooltipLayerQuerylayer = '<?php echo _mb("Toggles the queryability of this service");?>';
-msgObj.tooltipLayerContextMenu = '<?php echo _mb("Opens the layer context menu");?>';
-msgObj.tooltipWmsContextMenu = '<?php echo _mb("Opens the WMS context menu");?>';
-msgObj.tooltipRemoveWms = '<?php echo _mb("Removes the selected WMS");?>';
-msgObj.tooltipMoveSelectionUp = '<?php echo _mb("Moves the selection up");?>';
-msgObj.tooltipMoveSelectionDown = '<?php echo _mb("Moves the selection down");?>';
-
-var jst_container = "document.getElementById('treeContainer')";
-var jst_image_folder = imagedir;
-var jst_display_root = false;
-var defaultTarget = 'examplemain';
-var lock=false;
-var lock_update=false;
-var lock_check=false;
-var selectedMap=-1;
-var selectedWMS=-1;
-var selectedLayer=-1;
-var init=false;
-var errors = 0;
-var state=Array();
-var treeState = "";
-var arrNodes =
-[
-	['root_id', ['Layer','javascript:_foo()']
-
-	]
-];
-function _foo(){}
-
-// some defaults
-try{if (reverse){}}catch(e){reverse = 'false';}
-try{if (switchwms){}}catch(e){switchwms = 'true';}
-try{if (ficheckbox){}}catch(e){ficheckbox = 'false';}
-try{if (metadatalink){}}catch(e){metadatalink = 'false';}
-try{if (wmsbuttons){}}catch(e){wmsbuttons = 'false';}
-try{if (showstatus){}}catch(e){showstatus = 'false';}
-try{if (alerterror){}}catch(e){alerterror = 'false';}
-try{if (openfolder){}}catch(e){openfolder = 'false';}
-try{if (handlesublayer){}}catch(e){handlesublayer = 'false';}
-try{if (menu){}}catch(e){menu = '';}
-try {
-	if (redirectToMetadataUrl) {
-		if (redirectToMetadataUrl == "false") {
-			redirectToMetadataUrl = false;
-		}
-		else {
-			redirectToMetadataUrl = true;
-		}
-	}
-}
-catch (e) {
-	var redirectToMetadataUrl = true;
-}
-var defaultMetadataUrl = '../php/mod_layerMetadata.php?';
-if (redirectToMetadataUrl) {
-	defaultMetadataUrl += 'redirectToMetadataUrl=1';
-}
-else {
-	defaultMetadataUrl += 'redirectToMetadataUrl=0';
-}
-
-//menu elements
-var menu_move_up = ['menu_move_up', ['Move up&nbsp;','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];move_up(ids[0],ids[1],ids[2]);',,'move_up.png']];
-var menu_move_down = ['menu_move_down', ['Move down&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];move_down(ids[0],ids[1],ids[2]);',,'move_down.png']];
-var menu_delete = ['menu_delete', ['Remove&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];remove_wms(ids[0],ids[1],ids[2]);',,'delete_wms.png']];
-var menu_opacity_up = ['menu_opacity_up', ['Opacity up&nbsp;','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];opacity_up(ids[0],ids[1],ids[2]);',,'move_up.png']];
-var menu_opacity_down = ['menu_opacity_down', ['Opacity down&nbsp;','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];opacity_down(ids[0],ids[1],ids[2]);',,'move_down.png']];
-var menu_metalink = ['menu_metalink', ['Information&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[ids[0]].wms[ids[1]].objLayer[ids[2]].layer_uid);',,'info.png']];
-var menu_zoom = ['menu_zoom', ['Zoom&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];zoomToLayer(ids[0],ids[1],ids[2]);',,'zoom.png']];
-var menu_hide = ['menu_hide', ['Hide menu&nbsp;', 'javascript:hideMenu()',,'hide.png']];
-//var menu_wms_switch = ['menu_zoom', ['Zoom&nbsp;', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
-//var menu_layer_switch = ['menu_zoom', ['Zjjj&nbsp;', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
-//var menu_info_switch = ['menu_zoom', ['Zmn&nbsp;', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
-
-parent.eventAfterLoadWMS.register(reloadTree);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<TITLE>Treefolder</TITLE>
+<?php
+ include '../include/dyn_css.php';
+?>
+<script language='JavaScript'>
+
+function openwindow(Adresse) {
+Fenster1 = window.open(Adresse, "Informationen", "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=no");
+Fenster1.focus();
+}
+</script>
+<script src="../javascripts/jsTree.js" type="text/javascript" language="JavaScript"></script>
+<?php
+echo "<script language='JavaScript'>";
+   $sql = "SELECT e_target FROM gui_element WHERE e_id = $1 AND fkey_gui_id = $2";
+   $v = array($_REQUEST['e_id_css'],$_SESSION["mb_user_gui"]);
+   $t = array('s','s');
+   $res = db_prep_query($sql,$v,$t);
+   $e_target = db_result($res,0,"e_target");
+   echo "mod_treeGDE_map = '".$e_target."';";
+echo "</script>";
+?>
+<SCRIPT language="JavaScript" type="text/javascript">
+
+var jst_container = "document.getElementById('treeContainer')";
+var jst_image_folder = imagedir;
+var jst_display_root = false;
+var defaultTarget = 'examplemain';
+var lock=false;
+var lock_update=false;
+var lock_check=false;
+var selectedMap=-1;
+var selectedWMS=-1;
+var selectedLayer=-1;
+var init=false;
+var errors = 0;
+var state=Array();
+var treeState = "";
+var arrNodes =
+[
+	['root_id', ['Layer','javascript:_foo()']
+
+	]
+];
+function _foo(){}
+
+// some defaults
+try{if (reverse){}}catch(e){reverse = 'false';}
+try{if (switchwms){}}catch(e){switchwms = 'true';}
+try{if (ficheckbox){}}catch(e){ficheckbox = 'false';}
+try{if (metadatalink){}}catch(e){metadatalink = 'false';}
+try{if (wmsbuttons){}}catch(e){wmsbuttons = 'false';}
+try{if (showstatus){}}catch(e){showstatus = 'false';}
+try{if (alerterror){}}catch(e){alerterror = 'false';}
+try{if (openfolder){}}catch(e){openfolder = 'false';}
+try{if (handlesublayer){}}catch(e){handlesublayer = 'false';}
+try{if (menu){}}catch(e){menu = '';}
+try {
+	if (redirectToMetadataUrl) {
+		if (redirectToMetadataUrl == "false") {
+			redirectToMetadataUrl = false;
+		}
+		else {
+			redirectToMetadataUrl = true;
+		}
+	}
+}
+catch (e) {
+	var redirectToMetadataUrl = true;
+}
+var defaultMetadataUrl = '../php/mod_layerMetadata.php?';
+if (redirectToMetadataUrl) {
+	defaultMetadataUrl += 'redirectToMetadataUrl=1';
+}
+else {
+	defaultMetadataUrl += 'redirectToMetadataUrl=0';
+}
+
+//menu elements
+var menu_move_up = ['menu_move_up', ['Move up&nbsp;','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];move_up(ids[0],ids[1],ids[2]);',,'move_up.png']];
+var menu_move_down = ['menu_move_down', ['Move down&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];move_down(ids[0],ids[1],ids[2]);',,'move_down.png']];
+var menu_delete = ['menu_delete', ['Remove&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];remove_wms(ids[0],ids[1],ids[2]);',,'delete_wms.png']];
+var menu_opacity_up = ['menu_opacity_up', ['Opacity up&nbsp;','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];opacity_up(ids[0],ids[1],ids[2]);',,'move_up.png']];
+var menu_opacity_down = ['menu_opacity_down', ['Opacity down&nbsp;','javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];opacity_down(ids[0],ids[1],ids[2]);',,'move_down.png']];
+var menu_metalink = ['menu_metalink', ['Information&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[ids[0]].wms[ids[1]].objLayer[ids[2]].layer_uid);',,'info.png']];
+var menu_zoom = ['menu_zoom', ['Zoom&nbsp;', 'javascript:var sd = "{@strData}";var ids=eval(sd.substr(0, sd.length-6))[1][7];zoomToLayer(ids[0],ids[1],ids[2]);',,'zoom.png']];
+var menu_hide = ['menu_hide', ['Hide menu&nbsp;', 'javascript:hideMenu()',,'hide.png']];
+//var menu_wms_switch = ['menu_zoom', ['Zoom&nbsp;', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
+//var menu_layer_switch = ['menu_zoom', ['Zjjj&nbsp;', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
+//var menu_info_switch = ['menu_zoom', ['Zmn&nbsp;', 'javascript:var sd = "{@strData}";eval(eval(sd.substr(0, sd.length-6))[1][1]);openwindow(defaultMetadataUrl + "&id="+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_uid);',,'info.png']];
+
+parent.eventAfterLoadWMS.register(reloadTree);
 parent.eventInit.register(loadTree);
 if(showstatus=='true'||alerterror=='true'){
 	parent.eventAfterMapRequest.register(init_mapcheck);
-	init_mapcheck();
-}
+	init_mapcheck();
+}
 parent.eventAfterMapRequest.register(updateScale);
-if(wmsbuttons != "true")
-	jst_highlight = false;
-
-function select(i,ii,iii){
-	//ignore if selected
-	if(selectedMap==i && selectedWMS==ii && selectedLayer==iii)return;
-	if(selectedMap==-1 && selectedWMS==-1 && selectedLayer==-1){
-		selectedMap=i;
-		selectedWMS=ii;
-		selectedLayer=iii;
-		return;
-	}
-	//scalehints
-	var scale = parseInt(parent.mb_getScale(mod_treeGDE_map));
-	if(scale < parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_minscale) && parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_minscale) != 0){
-		if(selectedLayer==0)
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '#999999');
-		else
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '#999999');
-	}
-	else if(scale > parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_maxscale) && parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_maxscale) != 0){
-		if(selectedLayer==0)
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '#999999');
-		else
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '#999999');
-	}
-	else{
-		if(selectedLayer==0)
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '');
-		else
-		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '');
-	}
-
-	selectedMap=i;
-	selectedWMS=ii;
-	selectedLayer=iii;
-}
-
-function updateScale(){
-	if(!init)return;
-	for(var i=0; i<parent.mb_mapObj.length; i++){
-		var scale = parseInt(parent.mb_getScale(mod_treeGDE_map));
-		if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
-			for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
-				for(var iii=1; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
-					if(scale < parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_minscale) && parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_minscale) != 0){
-						if(iii==0)
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '#999999');
-						else
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '#999999');
-					}
-					else if(scale > parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_maxscale) && parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_maxscale) != 0){
-						if(iii==0)
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '#999999');
-						else
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '#999999');
-					}
-					else{
-						if(iii==0)
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '');
-						else
-						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '');
-					}
-				}
-			}
-		}
-	}	
-}
-
-function operaLoad(){
-	initArray();
-	renderTree();
-	setTimeout('initWmsCheckboxen();updateScale();',100);
-}
-
-function loadTree(){
-	if(window.opera){
-		setTimeout('operaLoad()',200);
-		return;
-	}
-	initArray();
-	renderTree();
-	initWmsCheckboxen();
-	updateScale();
-}
-
-function reloadTree(){
-	if(!init) return;
-	selectedMap=-1;
-	selectedWMS=-1;
-	selectedLayer=-1;
-	init=false;
-	arrNodes = [['root_id', ['Layer','javascript:_foo()']]];
-	initArray();
-	if(showstatus=='true'||alerterror=='true')
-		init_mapcheck();
-	renderTree();
-	if(window.opera)
-		setTimeout('initWmsCheckboxen();updateScale();',100);
-	else{
-		initWmsCheckboxen();
-		updateScale();
-	}
-}
-
-function imgerror(){
-	var map=parent.getMapObjIndexByName(mod_treeGDE_map);
-	var wms=Number(this.id.substr(4));
-	this.onerror=null;
-	this.onabort=null;
-	if(state[wms]!=-1 && alerterror=='true'){
-		state[wms]=-1;
-		if(confirm('Failed to Load WMS "'+parent.mb_mapObj[map].wms[wms].objLayer[0].layer_title+'" from Server "'+parent.mb_mapObj[map].wms[wms].wms_getmap.substr(0,parent.mb_mapObj[map].wms[wms].wms_getmap.length-1)+'"\nDo you want to try to load it in a new window?')){
-			window.open(this.src,"");
-		}
-	}
-	state[wms]=-1;
-	errors++;
-	if(showstatus=='true')
-		setNodeImage(arrNodes[0][0]+"|"+parent.mb_mapObj[map].wms[wms].wms_id, "error_folder.png");
-}
-
-function checkComplete(wms, map, img, first){
-	var ind=parent.getMapObjIndexByName(mod_treeGDE_map);
-	if(parent.mb_mapObj[ind].wms[wms].mapURL == false || parent.frames[mod_treeGDE_map].document.getElementById(map).complete){
-		if(state[wms]!=-1){
-			for(var i=1;i<parent.mb_mapObj[ind].wms[wms].objLayer.length;i++){
-				if(parent.mb_mapObj[ind].wms[wms].objLayer[i].gui_layer_visible==1){
-					state[wms]=1;
-					if(showstatus=='true')
-						setNodeImage(img);
-					break;
-				}
-			}
-		}
-	}
-	else{
-		if(first){
-			state[wms]=0;
-			parent.frames[mod_treeGDE_map].document.getElementById(map).onerror=imgerror;
-			parent.frames[mod_treeGDE_map].document.getElementById(map).onabort=imgerror;
-			if(showstatus=='true')
-				setNodeImage(img, "loading_folder.gif");
-		}
-
-		if(state[wms]!=-1)
-			setTimeout('checkComplete('+wms+', "'+map+'", "'+img+'");',100);
-	}
-}
-
-//parent.mb_registerWmsLoadErrorFunctions("window.frames['treeGDE'].imgerror();");
-
-function init_mapcheck(){
-	if(!init)return;
-	errors = 0;
-	var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
-	if(!parent.mb_mapObj[ind]||!init){
-		setTimeout("init_mapcheck();",100);
-		return;
-	}
-	for(var wms=0;wms<parent.mb_mapObj[ind].wms.length;wms++){
-		var wmsimgid="map_"+wms;
-		if(parent.frames[mod_treeGDE_map].document.getElementById(wmsimgid)){
-			checkComplete(wms, wmsimgid, arrNodes[0][0]+'|'+parent.mb_mapObj[ind].wms[wms].wms_id, true);
-		}
-	}
-}
-
-function handleSelectedLayer(mapObj,wms_id,layername,type,status){
-	if(lock_update||lock_check)return;
-	var ind = parent.getMapObjIndexByName(mapObj);
-	for(var i=0; i<parent.mb_mapObj[ind].wms.length; i++){
-		if(parent.mb_mapObj[ind].wms[i].wms_id == wms_id){
-			parent.mb_mapObj[ind].wms[i].handleLayer(layername, type, status);
-			break;
-		}
-	}
-}
-
-function zoomToLayer(j,k,l){
-	if(!j&&!k&&!l){
-		j=selectedMap;
-		k=selectedWMS;
-		l=selectedLayer;
-	}
-	var my=parent.mb_mapObj[j].wms[k].objLayer[l].layer_epsg;
-	for (var i=0;i<my.length;i++){
-		if(my[i]["epsg"]==parent.mb_mapObj[j].epsg){
-			parent.mb_calculateExtent(mod_treeGDE_map,my[i]["minx"],my[i]["miny"],my[i]["maxx"],my[i]["maxy"]);
-			var arrayExt = parent.mb_mapObj[j].extent.split(",");
-			parent.mb_repaint(mod_treeGDE_map,arrayExt[0],arrayExt[1],arrayExt[2],arrayExt[3]);
-			break;
-		}
-	}
-}
-
-
-//---begin------------- opacity --------------------
-
-var opacityIncrement = 20;
-
-function opacity_up(j, k, l) {
-	handleOpacity(j, k, opacityIncrement);
-}
-
-function opacity_down(j, k, l) {
-	handleOpacity(j, k, -opacityIncrement);
-}
-
-function handleOpacity(mapObj_id, wms_id, increment) {
-	var opacity = parent.mb_mapObj[mapObj_id].wms[wms_id].gui_wms_mapopacity*100 + increment;
-	parent.mb_mapObj[mapObj_id].wms[wms_id].setOpacity(opacity);
-	reloadTree();
-}
-
-//---end------------- opacity --------------------
-
-function move_up(j,k,l){
-	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
-		j=selectedMap;
-		k=selectedWMS;
-		l=selectedLayer;
-	}
-	if(j==-1||k==-1||l==-1){
-		alert("You have to select the WMS you want to move up!")
-		return;
-	}
-	var lid=parent.mb_mapObj[j].wms[k].objLayer[l].layer_id;
-	if(!parent.mb_mapObj[j].move(parent.mb_mapObj[j].wms[k].wms_id,lid,(reverse=="true")?false:true)){
-		alert("Illegal move operation");
-		return;
-	}
-	treeState = getState();
-	parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
-	parent.mb_execloadWmsSubFunctions();
-	//find layer and select
-	for(k=0;k<parent.mb_mapObj[j].wms.length;k++){
-		for(l=0;l<parent.mb_mapObj[j].wms[k].objLayer.length;l++){
-			if(parent.mb_mapObj[j].wms[k].objLayer[l].layer_id==lid){
-				select(j,k,l);
-				if(l!=0)
-					selectNode(String(lid));
-				else
-					selectNode(String(parent.mb_mapObj[j].wms[k].wms_id));
-			}
-		}
-	}
-}
-
-function move_down(j,k,l){
-	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
-		j=selectedMap;
-		k=selectedWMS;
-		l=selectedLayer;
-	}
-	if(j==-1||k==-1||l==-1){
-		alert("You have to select the WMS you want to move down!")
-		return;
-	}
-	var lid=parent.mb_mapObj[j].wms[k].objLayer[l].layer_id;
-	if(!parent.mb_mapObj[j].move(parent.mb_mapObj[j].wms[k].wms_id,lid,(reverse=="true")?true:false)){
-		alert("Illegal move operation");
-		return;
-	}
-	treeState = getState();
-	parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
-	parent.mb_execloadWmsSubFunctions();
-	//find layer and select
-	for(k=0;k<parent.mb_mapObj[j].wms.length;k++){
-		for(l=0;l<parent.mb_mapObj[j].wms[k].objLayer.length;l++){
-			if(parent.mb_mapObj[j].wms[k].objLayer[l].layer_id==lid){
-				select(j,k,l);
-				if(l!=0)
-					selectNode(String(lid));
-				else
-					selectNode(String(parent.mb_mapObj[j].wms[k].wms_id));
-			}
-		}
-	}
-}
-
-function remove_wms(j,k,l){
-	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
-		j=selectedMap;
-		k=selectedWMS;
-		l=selectedLayer;
-	}
-	if(j==-1||k==-1||l==-1){
-		alert("You have to select the WMS you want to delete!")
-		return;
-	}
-	if(l!=0){
-		alert("It is not possible to delete a single layer, please select a WMS!")
-		return;
-	}
-	var visibleWMS=0;
-	for(var i=0;i<parent.mb_mapObj[j].wms.length;i++)
-		if(parent.mb_mapObj[j].wms[i].gui_wms_visible=='1'||parent.mb_mapObj[j].wms[i].gui_wms_visible==1)
-			visibleWMS++;
-	if(visibleWMS<=1){
-		alert ("Last WMS can't be removed.\n(Der letzte WMS kann nicht entfernt werden.)");
-		return;
-	}
-	if(confirm('Are you sure you want to remove "'+parent.mb_mapObj[j].wms[k].objLayer[l].layer_title+'"?')){
-  		parent.mb_mapObjremoveWMS(j,k);
-		parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
-		parent.mb_execloadWmsSubFunctions();
-	}
-}
-
-function updateParent(path){
-	if(lock_check)return;
-	var reset_lock=!lock_update;
-	lock_update=true;
-	var state=getChildrenCheckState(path, 0);
-	//enableCheckbox(path, (state!=-1)); //3rd state
-	checkNode(path, 0, (state==1));
-	if(state==0 && showstatus=='true' && path.split(jst_delimiter[0]).length == 2){
-		setTimeout('setNodeImage("'+path+'", "error_folder.png");', 100);
-	}
-	if(reset_lock)
-		lock_update=false;
-}
-
-function handleSelectedWMS(path){
-	if(lock_update)return;
-	var t = path.split("|");
-	var reset_lock=!lock_check;
-	var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
-	var layername = parent.mb_mapObj[ind].wms[parent.getWMSIndexById(mod_treeGDE_map,t[t.length-1])].objLayer[0].layer_name;
-	var bChk = IsChecked(path, 0);
-	handleSelectedLayer(mod_treeGDE_map,t[t.length-1],layername,"visible",bChk?"1":"0");
-	lock_check=true;
-	checkChildren(path, 0, bChk);
-	if(ficheckbox)checkChildren(path, 1, bChk);
-	if(bChk==false && showstatus=='true')
-		setTimeout('setNodeImage("'+path+'", "error_folder.png");', 100);
-	if(reset_lock)
-	{
-		lock_check=false;
-		parent.mb_restateLayers(mod_treeGDE_map,t[t.length-1]);
-		parent.setSingleMapRequest(mod_treeGDE_map,t[t.length-1]);
-	}
-}
-
+if(wmsbuttons != "true")
+	jst_highlight = false;
+
+function select(i,ii,iii){
+	//ignore if selected
+	if(selectedMap==i && selectedWMS==ii && selectedLayer==iii)return;
+	if(selectedMap==-1 && selectedWMS==-1 && selectedLayer==-1){
+		selectedMap=i;
+		selectedWMS=ii;
+		selectedLayer=iii;
+		return;
+	}
+	//scalehints
+	var scale = parseInt(parent.mb_getScale(mod_treeGDE_map));
+	if(scale < parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_minscale) && parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_minscale) != 0){
+		if(selectedLayer==0)
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '#999999');
+		else
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '#999999');
+	}
+	else if(scale > parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_maxscale) && parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_maxscale) != 0){
+		if(selectedLayer==0)
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '#999999');
+		else
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '#999999');
+	}
+	else{
+		if(selectedLayer==0)
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '');
+		else
+		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].layer_id, '');
+	}
+
+	selectedMap=i;
+	selectedWMS=ii;
+	selectedLayer=iii;
+}
+
+function updateScale(){
+	if(!init)return;
+	for(var i=0; i<parent.mb_mapObj.length; i++){
+		var scale = parseInt(parent.mb_getScale(mod_treeGDE_map));
+		if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
+			for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
+				for(var iii=1; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
+					if(scale < parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_minscale) && parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_minscale) != 0){
+						if(iii==0)
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '#999999');
+						else
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '#999999');
+					}
+					else if(scale > parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_maxscale) && parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_maxscale) != 0){
+						if(iii==0)
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '#999999');
+						else
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '#999999');
+					}
+					else{
+						if(iii==0)
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id, '');
+						else
+						   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id+"|"+parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_id, '');
+					}
+				}
+			}
+		}
+	}
+}
+
+function operaLoad(){
+	initArray();
+	renderTree();
+	setTimeout('initWmsCheckboxen();updateScale();',100);
+}
+
+function loadTree(){
+	if(window.opera){
+		setTimeout('operaLoad()',200);
+		return;
+	}
+	initArray();
+	renderTree();
+	initWmsCheckboxen();
+	updateScale();
+}
+
+function reloadTree(){
+	if(!init) return;
+	selectedMap=-1;
+	selectedWMS=-1;
+	selectedLayer=-1;
+	init=false;
+	arrNodes = [['root_id', ['Layer','javascript:_foo()']]];
+	initArray();
+	if(showstatus=='true'||alerterror=='true')
+		init_mapcheck();
+	renderTree();
+	if(window.opera)
+		setTimeout('initWmsCheckboxen();updateScale();',100);
+	else{
+		initWmsCheckboxen();
+		updateScale();
+	}
+}
+
+function imgerror(){
+	var map=parent.getMapObjIndexByName(mod_treeGDE_map);
+	var wms=Number(this.id.substr(4));
+	this.onerror=null;
+	this.onabort=null;
+	if(state[wms]!=-1 && alerterror=='true'){
+		state[wms]=-1;
+		if(confirm('Failed to Load WMS "'+parent.mb_mapObj[map].wms[wms].objLayer[0].layer_title+'" from Server "'+parent.mb_mapObj[map].wms[wms].wms_getmap.substr(0,parent.mb_mapObj[map].wms[wms].wms_getmap.length-1)+'"\nDo you want to try to load it in a new window?')){
+			window.open(this.src,"");
+		}
+	}
+	state[wms]=-1;
+	errors++;
+	if(showstatus=='true')
+		setNodeImage(arrNodes[0][0]+"|"+parent.mb_mapObj[map].wms[wms].wms_id, "error_folder.png");
+}
+
+function checkComplete(wms, map, img, first){
+	var ind=parent.getMapObjIndexByName(mod_treeGDE_map);
+	if(parent.mb_mapObj[ind].wms[wms].mapURL == false || parent.frames[mod_treeGDE_map].document.getElementById(map).complete){
+		if(state[wms]!=-1){
+			for(var i=1;i<parent.mb_mapObj[ind].wms[wms].objLayer.length;i++){
+				if(parent.mb_mapObj[ind].wms[wms].objLayer[i].gui_layer_visible==1){
+					state[wms]=1;
+					if(showstatus=='true')
+						setNodeImage(img);
+					break;
+				}
+			}
+		}
+	}
+	else{
+		if(first){
+			state[wms]=0;
+			parent.frames[mod_treeGDE_map].document.getElementById(map).onerror=imgerror;
+			parent.frames[mod_treeGDE_map].document.getElementById(map).onabort=imgerror;
+
+			if(showstatus=='true')
+				setNodeImage(img, "loading_folder.gif");
+		}
+
+		if(state[wms]!=-1)
+			setTimeout('checkComplete('+wms+', "'+map+'", "'+img+'");',100);
+	}
+}
+
+//parent.mb_registerWmsLoadErrorFunctions("window.frames['treeGDE'].imgerror();");
+
+function init_mapcheck(){
+	if(!init)return;
+	errors = 0;
+	var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
+	if(!parent.mb_mapObj[ind]||!init){
+		setTimeout("init_mapcheck();",100);
+		return;
+	}
+	for(var wms=0;wms<parent.mb_mapObj[ind].wms.length;wms++){
+		var wmsimgid="map_"+wms;
+		if(parent.frames[mod_treeGDE_map].document.getElementById(wmsimgid)){
+			checkComplete(wms, wmsimgid, arrNodes[0][0]+'|'+parent.mb_mapObj[ind].wms[wms].wms_id, true);
+		}
+	}
+}
+
+function handleSelectedLayer(mapObj,wms_id,layername,type,status){
+	if(lock_update||lock_check)return;
+	var ind = parent.getMapObjIndexByName(mapObj);
+	for(var i=0; i<parent.mb_mapObj[ind].wms.length; i++){
+		if(parent.mb_mapObj[ind].wms[i].wms_id == wms_id){
+			parent.mb_mapObj[ind].wms[i].handleLayer(layername, type, status);
+			break;
+		}
+	}
+}
+
+function zoomToLayer(j,k,l){
+	if(!j&&!k&&!l){
+		j=selectedMap;
+		k=selectedWMS;
+		l=selectedLayer;
+	}
+	var my=parent.mb_mapObj[j].wms[k].objLayer[l].layer_epsg;
+	for (var i=0;i<my.length;i++){
+		if(my[i]["epsg"]==parent.mb_mapObj[j].epsg){
+			parent.mb_calculateExtent(mod_treeGDE_map,my[i]["minx"],my[i]["miny"],my[i]["maxx"],my[i]["maxy"]);
+			var arrayExt = parent.mb_mapObj[j].extent.split(",");
+			parent.mb_repaint(mod_treeGDE_map,arrayExt[0],arrayExt[1],arrayExt[2],arrayExt[3]);
+			break;
+		}
+	}
+}
+
+
+//---begin------------- opacity --------------------
+
+var opacityIncrement = 20;
+
+function opacity_up(j, k, l) {
+	handleOpacity(j, k, opacityIncrement);
+}
+
+function opacity_down(j, k, l) {
+	handleOpacity(j, k, -opacityIncrement);
+}
+
+function handleOpacity(mapObj_id, wms_id, increment) {
+	var opacity = parent.mb_mapObj[mapObj_id].wms[wms_id].gui_wms_mapopacity*100 + increment;
+	parent.mb_mapObj[mapObj_id].wms[wms_id].setOpacity(opacity);
+	reloadTree();
+}
+
+//---end------------- opacity --------------------
+
+function move_up(j,k,l){
+	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
+		j=selectedMap;
+		k=selectedWMS;
+		l=selectedLayer;
+	}
+	if(j==-1||k==-1||l==-1){
+		alert("You have to select the WMS you want to move up!")
+		return;
+	}
+	var lid=parent.mb_mapObj[j].wms[k].objLayer[l].layer_id;
+	if(!parent.mb_mapObj[j].move(parent.mb_mapObj[j].wms[k].wms_id,lid,(reverse=="true")?false:true)){
+		alert("Illegal move operation");
+		return;
+	}
+	treeState = getState();
+	parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
+	parent.mb_execloadWmsSubFunctions();
+	//find layer and select
+	for(k=0;k<parent.mb_mapObj[j].wms.length;k++){
+		for(l=0;l<parent.mb_mapObj[j].wms[k].objLayer.length;l++){
+			if(parent.mb_mapObj[j].wms[k].objLayer[l].layer_id==lid){
+				select(j,k,l);
+				if(l!=0)
+					selectNode(String(lid));
+				else
+					selectNode(String(parent.mb_mapObj[j].wms[k].wms_id));
+			}
+		}
+	}
+}
+
+function move_down(j,k,l){
+	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
+		j=selectedMap;
+		k=selectedWMS;
+		l=selectedLayer;
+	}
+	if(j==-1||k==-1||l==-1){
+		alert("You have to select the WMS you want to move down!")
+		return;
+	}
+	var lid=parent.mb_mapObj[j].wms[k].objLayer[l].layer_id;
+	if(!parent.mb_mapObj[j].move(parent.mb_mapObj[j].wms[k].wms_id,lid,(reverse=="true")?true:false)){
+		alert("Illegal move operation");
+		return;
+	}
+	treeState = getState();
+	parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
+	parent.mb_execloadWmsSubFunctions();
+	//find layer and select
+	for(k=0;k<parent.mb_mapObj[j].wms.length;k++){
+		for(l=0;l<parent.mb_mapObj[j].wms[k].objLayer.length;l++){
+			if(parent.mb_mapObj[j].wms[k].objLayer[l].layer_id==lid){
+				select(j,k,l);
+				if(l!=0)
+					selectNode(String(lid));
+				else
+					selectNode(String(parent.mb_mapObj[j].wms[k].wms_id));
+			}
+		}
+	}
+}
+
+function remove_wms(j,k,l){
+	if(isNaN(j)&&isNaN(k)&&isNaN(l)){
+		j=selectedMap;
+		k=selectedWMS;
+		l=selectedLayer;
+	}
+	if(j==-1||k==-1||l==-1){
+		alert("You have to select the WMS you want to delete!")
+		return;
+	}
+	if(l!=0){
+		alert("It is not possible to delete a single layer, please select a WMS!")
+		return;
+	}
+	var visibleWMS=0;
+	for(var i=0;i<parent.mb_mapObj[j].wms.length;i++)
+		if(parent.mb_mapObj[j].wms[i].gui_wms_visible=='1'||parent.mb_mapObj[j].wms[i].gui_wms_visible==1)
+			visibleWMS++;
+	if(visibleWMS<=1){
+		alert ("Last WMS can't be removed.\n(Der letzte WMS kann nicht entfernt werden.)");
+		return;
+	}
+	if(confirm('Are you sure you want to remove "'+parent.mb_mapObj[j].wms[k].objLayer[l].layer_title+'"?')){
+  		parent.mb_mapObjremoveWMS(j,k);
+		parent.zoom(parent.mb_mapObj[j].frameName, true, 1.0);
+		parent.mb_execloadWmsSubFunctions();
+	}
+}
+
+function updateParent(path){
+	if(lock_check)return;
+	var reset_lock=!lock_update;
+	lock_update=true;
+	var state=getChildrenCheckState(path, 0);
+	//enableCheckbox(path, (state!=-1)); //3rd state
+	checkNode(path, 0, (state==1));
+	if(state==0 && showstatus=='true' && path.split(jst_delimiter[0]).length == 2){
+		setTimeout('setNodeImage("'+path+'", "error_folder.png");', 100);
+	}
+	if(reset_lock)
+		lock_update=false;
+}
+
+function handleSelectedWMS(path){
+	if(lock_update)return;
+	var t = path.split("|");
+	var reset_lock=!lock_check;
+	var ind = parent.getMapObjIndexByName(mod_treeGDE_map);
+	var layername = parent.mb_mapObj[ind].wms[parent.getWMSIndexById(mod_treeGDE_map,t[t.length-1])].objLayer[0].layer_name;
+	var bChk = IsChecked(path, 0);
+	handleSelectedLayer(mod_treeGDE_map,t[t.length-1],layername,"visible",bChk?"1":"0");
+	handleSelectedLayer(mod_treeGDE_map,t[t.length-1],layername,"querylayer",bChk?"1":"0");
+	lock_check=true;
+	checkChildren(path, 0, bChk);
+	if(ficheckbox)checkChildren(path, 1, bChk);
+	if(bChk==false && showstatus=='true')
+		setTimeout('setNodeImage("'+path+'", "error_folder.png");', 100);
+	if(reset_lock)
+	{
+		lock_check=false;
+		parent.mb_restateLayers(mod_treeGDE_map,t[t.length-1]);
+		parent.setSingleMapRequest(mod_treeGDE_map,t[t.length-1]);
+	}
+}
+
 function handleSelection(path, box){
-	if(lock_update)return;
-	var reset_lock=!lock_check;
-	lock_check=true;
+	if(lock_update)return;
+	var reset_lock=!lock_check;
+	lock_check=true;
 	var bChk = IsChecked(path, box);	
-//	enableCheckbox(path, 0, true);
+//	enableCheckbox(path, 0, true);
 	checkChildren(path, box, bChk);
-	if(reset_lock){
-		var t = path.split("|");
-		lock_check=false;
-		parent.mb_restateLayers(mod_treeGDE_map,t[1]);
+	if(reset_lock){
+		var t = path.split("|");
+		lock_check=false;
+		parent.mb_restateLayers(mod_treeGDE_map,t[1]);
 		if(box==0)
-		parent.setSingleMapRequest(mod_treeGDE_map,t[1]);
-	}
-}
-
-function initArray(){
-	var parentObj = "";
-	var controls="";
-	if(parent.mb_mapObj.length > 0){
-		for(var i=0; i<parent.mb_mapObj.length; i++){
-			if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
-				for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
-					if(parent.mb_mapObj[i].wms[ii].gui_wms_visible == '1' || parent.mb_mapObj[i].wms[ii].gui_wms_visible == 1){
-						for(var iii=0; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
-							var temp = parent.mb_mapObj[i].wms[ii].objLayer[iii];
-							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == ""){
-								if(!temp.gui_layer_selectable == '1' && !temp.gui_layer_queryable == '1')
-									continue;
-								var c_menu="[";
-								if(reverse=="true"){
-									if(menu.indexOf("wms_down")!=-1 && ii!=parent.mb_mapObj[i].wms.length-1)c_menu+="menu_move_up,";
-									if(menu.indexOf("wms_up")!=-1 && parentObj!="")c_menu+="menu_move_down,";
-								}
-								else{
-									if(menu.indexOf("wms_up")!=-1 && parentObj!="")c_menu+="menu_move_up,";
-									if(menu.indexOf("wms_down")!=-1 && ii!=parent.mb_mapObj[i].wms.length-1)c_menu+="menu_move_down,";
-								}
-								if(menu.indexOf("remove")!=-1)c_menu+="menu_delete,";
-//								if(menu.indexOf("wms_switch")!=-1)c_menu+="menu_wms_switch,";
-								if(menu.indexOf("opacity_up")!=-1 && parseFloat(parent.mb_mapObj[i].wms[ii].gui_wms_mapopacity) < 1)c_menu+="menu_opacity_up,";
-								if(menu.indexOf("opacity_down")!=-1 && parseFloat(parent.mb_mapObj[i].wms[ii].gui_wms_mapopacity) > 0)c_menu+="menu_opacity_down,";
-								if(menu.indexOf("hide")!=-1)c_menu+="menu_hide";
-								c_menu+="]";
-								controls=null;
-								if(switchwms=='true')controls='<INPUT type="checkbox" title="' + msgObj.tooltipHandleWms + '" checked onclick="handleSelectedWMS(\''+arrNodes[0][0]+'|'+parent.mb_mapObj[i].wms[ii].wms_id+'\');" />';
-								if(wmsbuttons == 'true'&&metadatalink == 'true')controls+='<a href="'+'javascript:openwindow(\''+ defaultMetadataUrl + '&id='+temp.layer_uid+'\');'+'"><img src="'+imagedir+'/info.png" /></a>';
-								addNode(arrNodes[0][0],[parent.mb_mapObj[i].wms[ii].wms_id,[temp.layer_title,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,,temp.layer_title,eval(c_menu),controls,[i,ii,iii]]],false,false,reverse=="true");
-								parentObj = arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id;
-							}
-							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent && (handlesublayer=="true"||parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent=="0")){
-								var parentLayer = "";
-								var j = iii;
-								while(parent.mb_mapObj[i].wms[ii].objLayer[j].layer_parent!="0"){
-									//find parent
-									for(var jj=0; jj < parent.mb_mapObj[i].wms[ii].objLayer.length; jj++){
-										if(parent.mb_mapObj[i].wms[ii].objLayer[jj].layer_pos==parseInt(parent.mb_mapObj[i].wms[ii].objLayer[j].layer_parent)){
-											j=jj;
-											break;
-										}
-									}
-									parentLayer = "|" + parent.mb_mapObj[i].wms[ii].objLayer[j].layer_id + parentLayer;
-								}
-								if(temp.gui_layer_selectable == '1' || temp.gui_layer_queryable == '1'){
-									var c_menu="[";
-									if(reverse=="true"){
-										if(menu.indexOf("layer_down")!=-1 && iii!=parent.mb_mapObj[i].wms[ii].objLayer.length-1)c_menu+="menu_move_up,";
-										if(menu.indexOf("layer_up")!=-1 && iii!=1)c_menu+="menu_move_down,";
-									}
-									else{
-										if(menu.indexOf("layer_up")!=-1 && iii!=1)c_menu+="menu_move_up,";
-										if(menu.indexOf("layer_down")!=-1 && iii!=parent.mb_mapObj[i].wms[ii].objLayer.length-1)c_menu+="menu_move_down,";
-									}
-									if(menu.indexOf("metainfo")!=-1)c_menu+="menu_metalink,";
-									if(menu.indexOf("zoom")!=-1 && temp.layer_epsg.length>0)c_menu+="menu_zoom,";
-//									if(menu.indexOf("layer_switch")!=-1)c_menu+="menu_layer_switch,";
-//									if(menu.indexOf("info_switch")!=-1)c_menu+="menu_info_switch,";
-									if(menu.indexOf("hide")!=-1)c_menu+="menu_hide";
-									c_menu+="]";
-									
-									controls='<input type="checkbox"  title="' + msgObj.tooltipLayerVisible + '"'+(temp.layer_name==""?'style="display:none;" ':"")+((temp.gui_layer_visible=='1')?'checked ':'')+(temp.gui_layer_selectable!='1'?'disabled ':'')+"onclick=\"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','visible',this.checked?1:0);handleSelection('"+parentObj+parentLayer+"|"+temp.layer_id+"');updateParent('"+parentObj+parentLayer+"');"+((ficheckbox == 'false')?"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','querylayer',this.checked?1:0)":"")+"\" />";
-									if(ficheckbox == 'true')controls+='<input type="checkbox" title="' + msgObj.tooltipLayerQuerylayer + '" '+(temp.gui_layer_querylayer=='1'?'checked ':'')+(temp.gui_layer_queryable!='1'?'disabled ':'')+"onclick=\"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','querylayer',this.checked?1:0);checkChildren('"+parentObj+parentLayer+"|"+temp.layer_id+"', 1, this.checked?1:0)\" />";
-									if(wmsbuttons == 'true'&&metadatalink == 'true')controls+='<a href="'+'javascript:openwindow(\''+ defaultMetadataUrl + '&id='+temp.layer_uid+'\');'+'"><img src="'+imagedir+'/info.png" /></a>';
-									addNode(parentObj + parentLayer, [temp.layer_id,[temp.layer_title,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,((c_menu!='[]'&&temp.layer_name!="")?'menu.png':null),temp.layer_title,eval(c_menu),controls,[i,ii,iii]]],false,false,reverse=="true");
-								}
-							}
-						}
-					}
-				}
-			}
-		}
-	}
-	init=true;
-}
-
-function initWmsCheckboxen(){
-	var hidden=0;
-	if(parent.mb_mapObj.length > 0){
-		for(var i=0; i<parent.mb_mapObj.length; i++){
-			if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
-				for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
-					if(parent.mb_mapObj[i].wms[ii].gui_wms_visible == '1' || parent.mb_mapObj[i].wms[ii].gui_wms_visible == 1){
-						for(var iii=0; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
-							var temp = parent.mb_mapObj[i].wms[ii].objLayer[iii];
-							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == ""){
-								updateParent(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id);
-							}
-						}
-					}
-					else if(ii<=parent.parseInt(openfolder)+hidden)
-						hidden++;
-				}
-				closeAll()
-				if(treeState!='')
-					setState(treeState);
-				else if(openfolder!='false')
-					setState(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[parent.parseInt(openfolder)+hidden].wms_id);
-			}
-		}
-	}
-}
-//-->  
-  </SCRIPT>
-</HEAD>
-<BODY VLINK="#000000" ALINK="#000000" LINK="#000000" BGCOLOR="#ffffff" TEXT="#000000"
- MARGINHEIGHT="0" MARGINWIDTH="0" LEFTMARGIN="0" TOPMARGIN="0">
-<SCRIPT language="JavaScript" type="text/javascript">
-if(wmsbuttons=='true'){
-	document.writeln("<div>"); 
-	document.writeln('<a href="javascript:move_up()"><img title="'+msgObj.tooltipMoveSelectionUp+'" src="'+imagedir+'/move_up.png" alt="move up" style="position:relative;top:0px;left:0px;"/></a>'); 
-	document.writeln('<a href="javascript:move_down()"><img title="'+msgObj.tooltipMoveSelectionDown+'" src="'+imagedir+'/move_down.png" alt="move down" style="position:relative;top:0px;left:-3px"/></a>'); 
-	document.writeln('<a href="javascript:remove_wms()"><img title="'+msgObj.tooltipRemoveWms+'" src="'+imagedir+'/delete_wms.png" alt="remove wms" style="position:relative;top:0px;left:-6px"/></a>'); 
-	document.writeln("</div>"); 
-}
-</SCRIPT>
-<DIV id="treeContainer"></DIV>
-</BODY>
-</HTML>
+		parent.setSingleMapRequest(mod_treeGDE_map,t[1]);
+	}
+}
+
+function initArray(){
+	var parentObj = "";
+	var controls="";
+	if(parent.mb_mapObj.length > 0){
+		for(var i=0; i<parent.mb_mapObj.length; i++){
+			if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
+				for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
+					if(parent.mb_mapObj[i].wms[ii].gui_wms_visible == '1' || parent.mb_mapObj[i].wms[ii].gui_wms_visible == 1){
+						for(var iii=0; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
+							var temp = parent.mb_mapObj[i].wms[ii].objLayer[iii];
+							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == ""){
+								if(!temp.gui_layer_selectable == '1' && !temp.gui_layer_queryable == '1')
+									continue;
+								var c_menu="[";
+								if(reverse=="true"){
+									if(menu.indexOf("wms_down")!=-1 && ii!=parent.mb_mapObj[i].wms.length-1)c_menu+="menu_move_up,";
+									if(menu.indexOf("wms_up")!=-1 && parentObj!="")c_menu+="menu_move_down,";
+								}
+								else{
+									if(menu.indexOf("wms_up")!=-1 && parentObj!="")c_menu+="menu_move_up,";
+									if(menu.indexOf("wms_down")!=-1 && ii!=parent.mb_mapObj[i].wms.length-1)c_menu+="menu_move_down,";
+								}
+								if(menu.indexOf("remove")!=-1)c_menu+="menu_delete,";
+//								if(menu.indexOf("wms_switch")!=-1)c_menu+="menu_wms_switch,";
+								if(menu.indexOf("opacity_up")!=-1 && parseFloat(parent.mb_mapObj[i].wms[ii].gui_wms_mapopacity) < 1)c_menu+="menu_opacity_up,";
+								if(menu.indexOf("opacity_down")!=-1 && parseFloat(parent.mb_mapObj[i].wms[ii].gui_wms_mapopacity) > 0)c_menu+="menu_opacity_down,";
+								if(menu.indexOf("hide")!=-1)c_menu+="menu_hide";
+								c_menu+="]";
+								controls=null;
+								if(switchwms=='true')controls='<INPUT type="checkbox" checked onclick="handleSelectedWMS(\''+arrNodes[0][0]+'|'+parent.mb_mapObj[i].wms[ii].wms_id+'\');" />';
+								if(wmsbuttons == 'true'&&metadatalink == 'true')controls+='<a href="'+'javascript:openwindow(\''+ defaultMetadataUrl + '&id='+temp.layer_uid+'\');'+'"><img src="'+imagedir+'/info.png" /></a>';
+								addNode(arrNodes[0][0],[parent.mb_mapObj[i].wms[ii].wms_id,[temp.layer_title,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,,temp.layer_title,eval(c_menu),controls,[i,ii,iii]]],false,false,reverse=="true");
+								parentObj = arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id;
+							}
+							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent && (handlesublayer=="true"||parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent=="0")){
+								var parentLayer = "";
+								var j = iii;
+								while(parent.mb_mapObj[i].wms[ii].objLayer[j].layer_parent!="0"){
+									//find parent
+									for(var jj=0; jj < parent.mb_mapObj[i].wms[ii].objLayer.length; jj++){
+										if(parent.mb_mapObj[i].wms[ii].objLayer[jj].layer_pos==parseInt(parent.mb_mapObj[i].wms[ii].objLayer[j].layer_parent)){
+											j=jj;
+											break;
+										}
+									}
+									parentLayer = "|" + parent.mb_mapObj[i].wms[ii].objLayer[j].layer_id + parentLayer;
+								}
+								if(temp.gui_layer_selectable == '1' || temp.gui_layer_queryable == '1'){
+									var c_menu="[";
+									if(reverse=="true"){
+										if(menu.indexOf("layer_down")!=-1 && iii!=parent.mb_mapObj[i].wms[ii].objLayer.length-1)c_menu+="menu_move_up,";
+										if(menu.indexOf("layer_up")!=-1 && iii!=1)c_menu+="menu_move_down,";
+									}
+									else{
+										if(menu.indexOf("layer_up")!=-1 && iii!=1)c_menu+="menu_move_up,";
+										if(menu.indexOf("layer_down")!=-1 && iii!=parent.mb_mapObj[i].wms[ii].objLayer.length-1)c_menu+="menu_move_down,";
+									}
+									if(menu.indexOf("metainfo")!=-1)c_menu+="menu_metalink,";
+									if(menu.indexOf("zoom")!=-1 && temp.layer_epsg.length>0)c_menu+="menu_zoom,";
+//									if(menu.indexOf("layer_switch")!=-1)c_menu+="menu_layer_switch,";
+//									if(menu.indexOf("info_switch")!=-1)c_menu+="menu_info_switch,";
+									if(menu.indexOf("hide")!=-1)c_menu+="menu_hide";
+									c_menu+="]";
+
+									controls = [];
+									controls.push('<input type="checkbox" ');
+									if(temp.layer_name=="")
+										controls.push('style="display:none;" ');
+									if(temp.gui_layer_visible=='1')
+										controls.push('checked ');
+									if(temp.gui_layer_selectable!='1')
+										controls.push('disabled ');
+									controls.push("onclick=\"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','visible',this.checked?1:0);");
+									if(ficheckbox == 'false')
+										controls.push("handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','querylayer',this.checked?1:0);");
+									controls.push("handleSelection('"+parentObj+parentLayer+"|"+temp.layer_id+"', 0);");
+									controls.push("updateParent('"+parentObj+parentLayer+"');\" />");
+									if(ficheckbox == 'true'){
+										controls.push('<input type="checkbox" ');
+										if(temp.gui_layer_querylayer=='1')
+											controls.push('checked ');
+										if(temp.gui_layer_queryable!='1')
+											controls.push('disabled ');
+										controls.push("onclick=\"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','querylayer',this.checked?1:0);");
+										controls.push("handleSelection('"+parentObj+parentLayer+"|"+temp.layer_id+"', 1);\" />");
+									}
+									if(wmsbuttons == 'true'&&metadatalink == 'true'){
+										controls.push('<a href="javascript:openwindow(\''+ defaultMetadataUrl + '&id='+temp.layer_uid+'\');"><img src="'+imagedir+'/info.png" /></a>');
+									}
+									addNode(parentObj + parentLayer, [temp.layer_id,[temp.layer_title,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,((c_menu!='[]'&&temp.layer_name!="")?'menu.png':null),temp.layer_title,eval(c_menu),controls.join(""),[i,ii,iii]]],false,false,reverse=="true");
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+	init=true;
+}
+
+function initWmsCheckboxen(){
+	var hidden=0;
+	if(parent.mb_mapObj.length > 0){
+		for(var i=0; i<parent.mb_mapObj.length; i++){
+			if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
+				for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
+					if(parent.mb_mapObj[i].wms[ii].gui_wms_visible == '1' || parent.mb_mapObj[i].wms[ii].gui_wms_visible == 1){
+						for(var iii=0; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
+							var temp = parent.mb_mapObj[i].wms[ii].objLayer[iii];
+							if(parent.mb_mapObj[i].wms[ii].objLayer[iii].layer_parent == ""){
+								updateParent(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[ii].wms_id);
+							}
+						}
+					}
+					else if(ii<=parent.parseInt(openfolder)+hidden)
+						hidden++;
+				}
+				closeAll()
+				if(treeState!='')
+					setState(treeState);
+				else if(openfolder!='false')
+					setState(arrNodes[0][0]+"|"+parent.mb_mapObj[i].wms[parent.parseInt(openfolder)+hidden].wms_id);
+			}
+		}
+	}
+}
+//-->
+  </SCRIPT>
+</HEAD>
+<BODY VLINK="#000000" ALINK="#000000" LINK="#000000" BGCOLOR="#ffffff" TEXT="#000000"
+ MARGINHEIGHT="0" MARGINWIDTH="0" LEFTMARGIN="0" TOPMARGIN="0">
+<SCRIPT language="JavaScript" type="text/javascript">
+if(wmsbuttons=='true'){
+	document.writeln("<div>");
+	document.writeln('<a href="javascript:move_up()"><img src="'+imagedir+'/move_up.png" alt="move up" style="position:relative;top:0px;left:0px;"/></a>');
+	document.writeln('<a href="javascript:move_down()"><img src="'+imagedir+'/move_down.png" alt="move down" style="position:relative;top:0px;left:-3px"/></a>');
+	document.writeln('<a href="javascript:remove_wms()"><img src="'+imagedir+'/delete_wms.png" alt="remove wms" style="position:relative;top:0px;left:-6px"/></a>');
+	document.writeln("</div>");
+}
+</SCRIPT>
+<DIV id="treeContainer"></DIV>
+</BODY>
+</HTML>
\ No newline at end of file

Added: branches/print_dev/http/img/arrows/checksum.json
===================================================================
--- branches/print_dev/http/img/arrows/checksum.json	                        (rev 0)
+++ branches/print_dev/http/img/arrows/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"arrow_w.gif":"d9f64b7410efa5b3a393a13ee1ed355ce6542b32","arrow_se.gif":"d6f202499a26495097498a42afc45ffa450ca32d","arrow_ne.gif":"6266fc3635f41cce617417f193bffab3ad2547d9","arrow_n.gif":"56eacb84a55238c8ba46aac9b0b58f4b32d66f7e","arrow_nw.gif":"345ddd4de410d78b8adf19c4983b3079f6b330c0","arrow_e.gif":"7e18b991beecc9b6dd8c099f3e5e258a0edec7e2","arrow_s.gif":"6290d211854b9c3cdd4b7905dcdabd9b021c61f7","arrow_sw.gif":"c55ad39c8ea2ea793d8c341186614ebfce07581f"}
\ No newline at end of file

Added: branches/print_dev/http/img/button_blink_red/checksum.json
===================================================================
--- branches/print_dev/http/img/button_blink_red/checksum.json	                        (rev 0)
+++ branches/print_dev/http/img/button_blink_red/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"select_point_over.png":"c3d1c8c57b356e0620d9bf97fee04731b8fd01e0","change_password_off.png":"4e4afe4ec2fcf32a0a83e467c59d969435e52178","addlist_on.png":"bd0f97c0d6d6587573defb3d1f725e72cbc99eb8","selArea_over.png":"3e36a8b4fd0c7250e4fc05f0faa488c4faf6938f","zoomOut2_on.png":"ba31d43b608e24a327e449886774b3b6550ebce8","zoomFull_off.png":"d083de1ac95e43d19fa3726681d094e1cc36a11b","exit_off.png":"47d3ced885aba5debee252ae68375d26177b4380","wmc_save_on.png":"69ce010c6c11e152047894376aa7e2432d065b3c","metadata_over.png":"a1af360428932341421dcb7e5f8f0bbc337c1a07","print_over.png":"c570fbfff3846d06c88d62a4bfa8fc59995f17b4","center_on.png":"f93227afc88ea0d1e21a7e752f06ac4f8fb00da3","zoomOut2_over.png":"b15166353839cecacb7adf53f1d999da992d3eb4","perimeter_on.png":"04c11ca1456a57ac7bc265f7d7fb1721942f6cfd","select_extent_over.png":"e72717f91bac9b8ae6c27cc5c098fb7000871401","center_over.png":"ec40b377f04cb75fe380d1d433f6b68dc9ee0be1","query_over.png":"fcfed18386f921fd6900c0f76317f5892e4a50b5","perimeter_over.png":"8fc2c8168d19eddfb1189f748c89d6f5a9b1bfc8","measure_off.png":"8a0a8eb0151e4055f915b33183cd38d7d2501fb4","print_on.png":"d493a6a6aa696a1607b0930ee9823ad14a506926","change_password_over.png":"981ec73b4895db86e2dd5e988f69e4451556aff0","zoomOut2_off.png":"57926d4a1a5a9532fab4af878c63f59486ff24a9","preferences_over.png":"db572e044f5183bd6bbf50648f44b3a23278572a","selArea_on.png":"ca64f4fdff4fdfce92b76775508fdd94fcf6744f","measure_on.png":"90cf436634ed780756b91eaa7799ac25e5994649","wmc_save_off.png":"da0a36ea4c7b463f7a0030f19dc6dab47a70a127","user_on.png":"6a645d3e31e4b7a9e4174d43da2bf66499792c8c","exportMapimage_on.png":"bfa1bc758177812214b78dc5c25783f140ede29a","tiles_on.png":"a036ea91f9b9056401cbdc20ac4771d79c407803","exit_over.png":"0611aaa43f721c3538ef0c9d3d919c2af1f0db60","addlist_over.png":"44fbc97b74388a15b15e7b9b0af5687aa6f11ec6","addwmsblink_off.png":"8b9281759fa69e3260ead66b5d5c3001ef04d214","add_filtered_list_on.png":"918c02332141c8f81d34b163231b487527c8e5f2","wmc_load_off.png":"2b76e407cb6831a17c08b80e63c95ea3347edbfd","repaint_over.png":"e16d0b3b834db47129eced1eae665b554f1bfe9f","zoomIn2_on.png":"bcf236316b0239ac7a25db694f51f26626582e9d","addwms_over.png":"3870161b8ad8f8deaec0cbfafdb6852b0fa7278a","forward_over.png":"dbe813384e9c5d6ec04e9413ab137670d63bfe24","back_over.png":"f3715a45f4dcc202af9e407e44c1a8bd0e99d116","back_off.png":"e9223e4c121569122c16b916f1ba82a21053377e","wmc_load_over.png":"7c9dd1584ddb410c3ab3607b7ca727ae868dcde8","pan_on.png":"d4efc20c743053fcaaee4fcf6658890b67b78851","select_point_on.png":"660ab88a8ae253aa8a5014f3782d669ec83fb6e6","select_choose_on.png":"1531935247d794d120a8fd00dab2d600770a454b","center_off.png":"592a016e67ad8056ab7406d612f22e11a5227158","addwms_off.png":"ef588a7be582cb96be233086abb3dfb990ff92b1","overviewgermany_off.png":"c6a9460df67b0d9581abcae58e6d83f68a550053","help_over.png":"04be8572c2170d2500344649e2fb39fccf7e3676","back_off_disabled.png":"282cefa634e2b7986e8041b5b58e44091b682da8","select_rectangle_off.png":"fa94129df1a9ec567f7ee8ee041b25be53e7be64","pan_off.png":"c42d8855c640cc91579317de08d317462acd58fd","selArea_off.png":"103884cfe3e51afde41357171d8b2f4797e124b4","reload_off.png":"a8439817b43dd3d669c3b29a5713e6155e596707","coords_over.png":"cc1df01b214145a81946498bac9d705101a18d14","addlist_off.png":"b5eb4b4496677fbeb8d28553ba16f3f22eb3466f","tiles_over.png":"e7170a9d19c9f840c654e1f1cd5546cdeac8a512","select_polygon_over.png":"7d9bc8d34461efa3a76f47e2893521796be48bec","help_off.png":"b6db55fa919341f29a72e7e935592ac3f5fef621","select_extent_on.png":"71339bf22e40758a7919d1367bc9471bb49117fe","help_on.png":"8f9d62e95d33127e6dcd9f7b37d7c0b58130d609","logout_over2.png":"68db6638f31c21f687312c775cedac9f7e8fc237","zoomFull_on.png":"77c55f9a2e97f37b7baf02f46fb6287685f1478a","addwms_on.png":"82227d95059e59c337204e90e13c2f4221dff4ec","add_filtered_list_over.png":"5cad54ed5786a7991a5e841bfe1bcdf0b9654d5a","tiles_off.png":"e5614e41d3e3e3540d8e37ea081bb7c9a772802e","preferences_off.png":"4378a6d29d002b030172769af5910bd6cfc0df75","exit_on.png":"2cc88e28a5654312e459aefc49631a738606bd63","add_over.png":"5d459ae7ded37606da20e30d734cb3ed523ab97b","add_off.png":"e372aae61e1de37811bee028e6db25bc1ac7c52f","zoomIn2_off.png":"059a42efacc330a6a6f233d8de1c30093f8b0ce4","select_rectangle_on.png":"cf558d579b2203ac3721bed455c2c64bcef6f8fe","zoomfull2_off.png":"ce509c6fbd11393e35d506c060e714d6a54244eb","select_choose_over.png":"b4124576fe66b98c656f02e64f42df101092a54f","exportMapimage_over.png":"8ad5b260675623d4810f06f5f41b5f6be7f408ee","repaint_on.png":"487a667a0444accfba2679d1139fe719da1700d2","resizemapsize_over.png":"190c70c4144a45a372a156b3ef813d80e7399880","exportMapimage_off.png":"10bb5a1728a4237f72f99cfeaa8b8652b093f801","select_polygon_off.png":"842d703de10ff159f145060775ca2d3bbe10f596","user_over.png":"6b1b309915e0805bb045cc5cf074c998e55c65b5","reload_on.png":"a8801f5b0ac30de38199ba590c70245d6b47d4af","preferences2_off.png":"4378a6d29d002b030172769af5910bd6cfc0df75","overviewgermany_on.png":"69da48b72d53e2995305bb064028f5a49fa602df","wmc_load_on.png":"79946dc54f8b6a1e8374a1b893b1ee9f900ad5b3","query_on.png":"ad13942e62efa435d41d1136d6babe1e9f8404c7","user_off.png":"f8e6e72886c4576dc3b76ce9f4f82de00bd25e94","logout_off.png":"01698b8c066f180502b792f915dc174466bf1725","logout_over.png":"90b3b261f675c1f8a12acaa37097c1fc03247ac0","pan_over.png":"0734b16054ac193d2bdcc9bc6ab73259dc93f28e","add_filtered_list_off.png":"bfeb5f3b2ff9dfcba174ae87ba064612a47bcdc2","select_choose_off.png":"14d12c9de917af031b1c897114e869e826cec991","print_off.png":"0ff8e0b4679b9467bb073ac8f7c853b77270e16a","forward_off.png":"f42386c7c8acbf309ddcabafc8495b719ac2573f","coords_off.png":"3fce35d2108e2c750fad8c1cdd6a9af68e4413e3","add_on.png":"89cece4b6ad10acb3ec1e3abad23ba878a993e78","preferences_on.png":"d63c5267e7c17fd721e3ce63fb57277ee7fc9ea4","preferences2_over.png":"db572e044f5183bd6bbf50648f44b3a23278572a","perimeter_off.png":"e877e3b27a191f9992925eb0fe499f64d522dd0d","zoomFull_over.png":"54926380d99391dd85b581ca46de17ab55c508cf","repaint_off.png":"2f64884fa956db05f32f308d65dd2a90302dc1b7","select_rectangle_over.png":"5a61bd4c1f367f1cab1f483a396affed48941cc2","help3_off.png":"c542d1e365185fd7a40b9bd2a96574672d936a3e","zoomfull2_over.png":"d11cc23f161ffa6f11a9078c8b40472388ecec80","forward_off_disabled.png":"f06bdd7e79a6ccf02b1b68f64d3435c3b5529312","overviewgermany_over.png":"a1e536e210f6141cb21bab0df67dfb618d2bfd32","help3_on.png":"e7c9f16a324209380267ef811dc747120977b24d","reload_over.png":"4d027e6dab21e00c933c88aa4f17a07e19a46b5b","coords_on.png":"c7ad4d8856b5afdf704d24faa2f71fbe153fc1fb","zoomIn2_over.png":"74d35b411a3a42d906b56247f9b826b47a3534c5","select_polygon_on.png":"7fcedafe59c9b465a42fb28cf9363b46a8132fa9","metadata_off.png":"0ce6552dc4c1231d39a31b05442d85f7695a4115","query_off.png":"9d319776f866073ca4e64a4c9029b0904cc36503","resizemapsize_off.png":"e900587d3010eb6ffd39645fe3198cf2e4c03373","wmc_save_over.png":"87d4fed8394d8ca0ede2cac87761190890843cb7","select_point_off.png":"e0da7171bab0b1bdfbdf2bd0457b3a0d026c1224","leg_over.png":"3770608a4d367e678e1234e8e43eb302a8f72e93","select_extent_off.png":"b98039bb7bace57224ca62e44b9d21a34c61b3c0","measure_over.png":"517fbba3eab390893c9f28f260148ac8d047c44b"}
\ No newline at end of file

Added: branches/print_dev/http/img/button_blink_red/perimeter_off.png
===================================================================
(Binary files differ)


Property changes on: branches/print_dev/http/img/button_blink_red/perimeter_off.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/print_dev/http/img/button_blink_red/perimeter_on.png
===================================================================
(Binary files differ)


Property changes on: branches/print_dev/http/img/button_blink_red/perimeter_on.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/print_dev/http/img/button_blink_red/perimeter_over.png
===================================================================
(Binary files differ)


Property changes on: branches/print_dev/http/img/button_blink_red/perimeter_over.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/print_dev/http/img/button_blue/checksum.json
===================================================================
--- branches/print_dev/http/img/button_blue/checksum.json	                        (rev 0)
+++ branches/print_dev/http/img/button_blue/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"select_point_over.png":"a88270a1b2ca697a2fe69ceac72133be1a75d696","back_on_disabled.png":"c8c2455947470247b7d6d7442e5d4572de8f876c","change_password_off.png":"07bf88ff86acb97f69893ebb4fe19e558ca294f7","gazetteer_off.png":"f26169397bfffc2499f7e28c12ead369862c40b0","selArea_over.png":"e2238ea7ab7b71abe965188ecc798bbd0fbfdb3c","zoomOut2_on.png":"ea4d471b61d1747ff732aa4e097306192acc28b7","zoomFull_off.png":"cd88ac0466c0e6d71bdc15d21ece401f5937eb8c","wmc_save_on.png":"47d4b8f4512d2f81872d35e44bde508f8b351278","home_off.png":"e7cb27aaceb91bdde2c64a7e8ed7f38e3cca55ee","metadata_over.png":"34dca5296d013fb2e3a94d60f7d1c82920777d95","print_over.png":"398fdf6a96a1dd63226a00a149bb898e4e409bbf","README.TXT":"3b05bdecb09bd70ec6d61660f55ca295c76ecfc6","rubber_on.png":"5495f426f2ab3b5281a93b7157a5ca7b1a64ec6b","center_on.png":"e5fd452c4a7ba8631a143a0b36c771e4d0520f96","zoomOut2_over.png":"7c25bde74a2083368a727d3eaab52f0fc386ec67","select_extent_over.png":"3c909d26adf451d7e9590001e33a7e14c44b8826","center_over.png":"fa09292cb25ab4a8ee8858b880edb2fdec044a07","query_over.png":"677b34dfa05d7f0ff4ea929cd183703e52d4d475","measure_off.png":"9f3b604e2e74da4bcc6e56b1d1c3144472a5be44","print_on.png":"4da3d2b30ea28bf5f39c810eb4f08c2a73fb1569","change_password_over.png":"3bba8c852c1728d5b875ea3d4a1b34d9a7d98166","zoomOut2_off.png":"50442d441eac4e5faf8d074b594a8c5bad62255b","preferences_over.png":"4f168e281429b1f6054e88983a91b9b2e152bf3f","selArea_on.png":"e0847cf748575542d2e139d2f9bd7eabafabb1ca","measure_on.png":"437b22ed72a6a24c7d395ed7d0877e6790bff99b","forward_on.png":"e79b0f6179555185bce23602b0157e1117852683","wmc_save_off.png":"56613a1431e4de9ddc0da9d314872b46191147bc","back_on.png":"6336558afd3d232b2199ad557273b2f8693857be","getArea_off.png":"afdd617cb93c5c907d94009e2507e1fc2ac53801","add_filtered_list_on.png":"905be07628cd26b45d68be12d9f5267d755439c2","wmc_load_off.png":"e32d15571a326cf8c4c19d1716d7bf1b0459be16","repaint_over.png":"8210fa19734b664779181314beb88967b7f58a97","wmc_save_off_old.png":"5bf22d86c690aa5b29f526591f3c24ed40c998ab","zoomIn2_on.png":"7604f4a403a26d5452c61b9c6049f4fb3b256fdb","forward_over.png":"c653c35ba2a434854a6b2edef748df0cbc1bf656","back_over.png":"8e798803651abf2fba223eac9b65732f22faa8a5","back_off.png":"aa88619abc12631511f9c4bc1df3cfcb6668d044","wmc_load_over.png":"31c30c66a78f3c62894f272eb0dc42bbc7e0803b","pan_on.png":"442a77931bd4ead1b52a788034e73ed4753c20ff","select_point_on.png":"0d96e2ba59ffce15d05c1a98c2ea8bee559f1adc","select_choose_on.png":"5841e61ae43bb723af2c215c76c26bec83804420","center_off.png":"39aa40d94b1fbd479d4efaddac5270b0a80a9a06","help_over.png":"c81cc3a6760c2652b74603db58f196ac0bb2d16a","back_off_disabled.png":"38155d51cbe046d9c4a6c44dc4ad6c81a0a87cea","select_rectangle_off.png":"a72068791488d10c91a9b508e2cf018cd46af4aa","metadata_on.png":"2236bb1688ee37479b31f080578045f792191ed5","pan_off.png":"003f842cad010e4199028785d28d077c42e43e9c","selArea_off.png":"9eb96abe7872d41c2033563c3ca3c2ba66682ef6","home_on.png":"fcd2218a5e0f2471186bf6def6bd00babf1bc983","reload_off.png":"6a464765e001ccb88abaaef0f6158e8e3a0f17e8","coords_over.png":"78f5e43fe41f71bffdd9cc711097a49389a096ad","select_polygon_over.png":"bec19ffc31969743603443de859bd815b83d4952","help_off.png":"97c33a2bd806cebe4554e27c582d04e1acbc1d7b","select_extent_on.png":"2a69c35e81fb852f6aaf9c5640ce11a4c5e8759e","help_on.png":"6fc2c441abec0acc419168a1a4829d78d9a176c7","closePolygon_off.png":"4b214d0bb852d3c0d5971717c246b1996233b94f","zoomFull_on.png":"3734a1a211f232676e240d4ef24484c59fa2d57f","add_filtered_list_over.png":"8f8c0fd54691a562a6446254d7c25e4b0bbf6df9","preferences_off.png":"93a075819754a32d6c481cdcd3ab79aa53d5c96e","forward_on_disabled.png":"9325e85c58c4580396fbcb292be43b426a9f7b4a","closePolygon_on.png":"c5887659dc323880c0dc37bd7b5fa7d36e034dc6","add_over.png":"d909b570de725740536926ba63c97c6eb98dc76b","add_off.png":"df6c36d45384df643dba9c6167016be36f823595","zoomIn2_off.png":"85d062f9267f4c61a41d172078cbd90131f72816","select_rectangle_on.png":"cd6fccd94fef3beb2a2f820a31be9425323d9e7a","select_choose_over.png":"8ce3bdde0aa02b1ee8313993c2a78f23dadb746e","gazetteer_on.png":"c97460c205f4ace7c1eb472389620656cecf5204","repaint_on.png":"71c496179e2bd8cc2bbbd7854acab6cba0cb61c9","select_polygon_off.png":"3e39884727e3906830c1fdb45cdf1651fb54c34c","reload_on.png":"a806151c196c0c2ff948e409299777e2c279e937","getArea_over.png":"214d3d80f11bb670cd928f222fdbfeeb536488bd","wmc_load_on.png":"2a9e0a869cb5f732a43a8ddfc31bd3e2c9f46dd4","query_on.png":"9ca66603cc4cc0ae2a2b4bce96d6b96b2aee54cd","logout_off.png":"0d9ee1c1e725feea263e404ebfcf0af85ed05bcd","logout_over.png":"b6e010437e40f68db7f54c892c4bf2fe1fe180a1","home_over.png":"068242faf530181b1c1f673be4ed6e84e2456175","pan_over.png":"b7eba7ebd37329beaba02db8b63d7b1de70934fe","add_filtered_list_off.png":"43ae0fe84b38d58e6ec1be0993ade44e30f7ec59","select_choose_off.png":"39825d67d2e4c9faff16b80a0dd61f771ca95899","print_off.png":"5b10df31cd51b481ac109a74969336b653b365a9","forward_off.png":"f6391ca2bc3240a587ba852de715ba645510a022","closePolygon_over.png":"9770acd33a856d3084d748ffbb090ba30db1013a","coords_off.png":"81d20dc06bb00a67481bcd9d6a9a568f869501fe","add_on.png":"836b5d76dcbbd0772f0eee03845814db694883ea","preferences_on.png":"0eddfa2bbbdc05846d8063d6dcd14753507a72b6","zoomFull_over.png":"5386a45d4fa25962757fa1d0f3a6a567ee1c684d","repaint_off.png":"e8b8de31bc90db20ebd4b46c4d859d03d3a06356","select_rectangle_over.png":"37b757cba0f66f31defebcec7fb96fe5e80ae29f","forward_over_disabled.png":"e905e306114d0fd47f8243e26d3977d0a912fda2","getArea_on.png":"a1c34e88451cda3f4633189cc6a335b4f60d707f","forward_off_disabled.png":"5e5a917bd0269b0785d098cb84736cb23ce77dc2","change_password_on.png":"4e3c0cd7037e225b14435ff7872da749dfcc3c8f","reload_over.png":"9d925389d785e5563df5e4243d9758fe68a70137","coords_on.png":"4533f17d0a1b5dfe986330a811b4ed290c6278c9","zoomIn2_over.png":"a4e53afc22a491103e578db7f14a7521de964351","select_polygon_on.png":"71332b098daffacdfecccb64e99b407f6cf4d830","rubber_over.png":"e884d7071285fdfa68e423e3c2a65185a85b5787","metadata_off.png":"d343e13b2f36d71cfbe4920e75a5f0309c06dd58","query_off.png":"9f02396529877aaf8560d3d58ada29c6885227a0","wmc_save_over.png":"902c25e8d9954a3380da9020c89957bd2b3759c5","rubber_off.png":"8bf037f17385804bb86c0179aadc7b5f0d8c1296","back_over_disabled.png":"eecf2e3e46e7bd537ed345ac7496e294cf05e45f","select_point_off.png":"1ff3ece14de71f8cf54fbc2bec2d87e34e469bc4","gazetteer_over.png":"7a0169cb05adcd5627bb4a462fd1fe7397e465cc","select_extent_off.png":"2a69c35e81fb852f6aaf9c5640ce11a4c5e8759e","measure_over.png":"4ef5d8264ae39efcbd53268ea8681858f4a106cc","logout_on.png":"d27a6fb1d35bc3d4808890eb95f851588572bab1"}
\ No newline at end of file

Added: branches/print_dev/http/img/button_digitize/checksum.json
===================================================================
--- branches/print_dev/http/img/button_digitize/checksum.json	                        (rev 0)
+++ branches/print_dev/http/img/button_digitize/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"line_on.png":"e3c7f5b71826beaa988f7083891d84c250a93dc8","move_node_off.png":"8a5d094544de717ac4e46952ff8c226763eb575c","polygon_over.png":"12d86e6e150eb6aa6ad2b78e22cdce918aa7a0cf","polygon_on.png":"1f5eaf5c6c0776079932a0541db877c487e6ded9","geomRemoveDb.png":"903d2a30ca534bdcddb4ca127a0b4b0c6df468ae","delete_node_off.png":"388319a74e828322478f827358e6da9d21f80b59","point_over.png":"cd438c1b2e006a7a39c9e013a7ce22258183b215","point.png":"3e6b0728322c25be9fbaad09f96e66264aed6d43","line_off.png":"a5981c6cccb72f3bd5b545f74f119be57922f032","new_node_on.png":"af7d3ee5de52899d7171401ceb264243ff562c36","del_over.png":"c0e71dc9e6e488f384290a22966fc3d7534ccb7f","delete_node_over.png":"6b430568338c64b91b0b42398f89cfe03fb80f4c","point_off.png":"9ad0c43882b53f47016c5cd85af2f9e72ef6534c","del_off.png":"c0e71dc9e6e488f384290a22966fc3d7534ccb7f","geomInfo.png":"4a865c812713d0663a586c12c9b6a314f111810f","geomRemove.png":"a8560127561c9b7ab815fb0588025c2ee637c273","del_on.png":"2a8e531a4de41afe001663754b44a177eee1ba7c","line_over.png":"f580d32482488f53aa8fe812714e9bd2923ad877","move_node_on.png":"148afd57e96c45de1aba2114ba51fff7e69680b1","point_on.png":"337b64f0580d59e24d2aaba61c6bea982be33e9c","line.png":"267e97473868dbf96935369084daf5f273ceaf2f","delete_node_on.png":"e7e22c5cd19bcc881b0b2429f70e253ab0fe1efc","polygon_off.png":"7cb8f74173145b45b60262d8d891136b2ece361c","new_node_off.png":"8b5c939ac1e08702ae0bea24cacf46edb03d2585","polygon.png":"bf249648ff57c24541f25c8be8f819924239b0e6","new_node_over.png":"2ef334aefcef10eb4ceb21b3b5845abc7ae616df","move_node_over.png":"1393d486cc2fc7fbe19595553f4606928aacb4ff","trans.png":"09bec468844e30c2aa979a334d71c36801fc845a"}
\ No newline at end of file

Added: branches/print_dev/http/img/button_gray/checksum.json
===================================================================
--- branches/print_dev/http/img/button_gray/checksum.json	                        (rev 0)
+++ branches/print_dev/http/img/button_gray/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"query_over.gif":"380533a41ba79369e2a16cd97f263d8cef6e7e05","x.gif":"7e7aed63aa9afaba8c6a4f7ebff512327ed8ef3d","select_point_over.png":"b810ba63532ab7fc4d977e601d2ba20ce79c540a","preferences_over.gif":"753c8aee57d152cf9bd9c35b36f4af756e80915b","change_password_off.png":"309041112a386aa360b36e6677702a9495c0a29e","gazetteer_off.png":"1ad9a91c69ae2ae9374760ee34af6306a0197cc8","addlist_on.png":"4ca565087ace4127e1f87237f391d1ab4d249b15","logoutred_off.png":"0f4d8698c49875d85baa844d0e9737c4dae06733","selArea_over.png":"24bcfebadd10648aae19128b702cfdfb682d2410","zoomOut2_on.png":"b9a5686e8e43e84597c009118918bffd2ed3c5cd","selArea_over.gif":"deff360a15c148b169a962243e3427e59f08f670","zoomFull_off.png":"dcf83d4f6deca85d598127e29f3dee53d9b06c34","wmc_save_on.png":"b6244994fa6f6c376f63fc19c9992f6d04844200","home_off.png":"e2d7b86ae73ad7252f70416bc39e83f7c0ec65dd","wmc_save.png":"876d62a2ea7dacb63676f18d2e4a6c080ad27fe8","forward_over_disabled.gif":"5ffd83aa41e6ac91bdc123eca592422b15f1f0e5","getArea_off.gif":"c84b9b787e7e09a8412c16554a88d4d69c4ba1b4","del.png":"0218a3f921a638c0d9286e6a5749a8c636b10e4b","metadata_over.png":"26e0c1e6b2de65bb72f2f0cad505ce7901b2fcd1","print_over.png":"e383ca853b2c4d544cc40082c8dbde8531fae5bf","smaller.png":"347d6d847d2274a53a945728256112e2f396ea38","center_on.png":"f9dcf7de88a6a41e691fdfceda20c6048648c5a2","zoomOut2_over.png":"f979bd80aacc1f1ea2c8b9c9146a40ec7978f070","perimeter_on.png":"fe24e1830812be1182889ac9b4868f9921403cb6","select_extent_over.png":"697f5aff0aed20f14fac5acd2df60a9d41d1a0d5","center_over.png":"f5552685119815d8a9d7ef5b301ac30c2d69e661","coods_off.png":"7cf0bb3ba3145fff744564618cb4edf3e1d44d9a","add_over.gif":"dc53f9db3295cb1f8967ccadfb737f01cfca4943","query_over.png":"7ca111b61ac7a390223a5f4a2b264e5664b65c0d","perimeter_over.png":"905cf84f3415359722ee1c505184200299be333b","measure_off.png":"846fed7e04f0583df09b5cea0e629d985d646155","gazetteer_over.gif":"21ebc91db58fb9b3877e084b132fbddbb05867f9","print_on.png":"cd9bd438917443a4c0cbdb2d47d1c5e9122385b9","logout_off.gif":"81242f03e6fec66b1c3aa119d2b1142cb7e7cefd","add_filtered_list_over.gif":"2f88a3a5986f0b36748c6077034c88c48a992eba","user_over.gif":"fef820726c074ab081fa11504753de94b73d71aa","change_password_over.png":"3114b851860951a6251897d9900fa832e5a30acf","print_on.gif":"8eff5998cb5f71c4eb13aee1e1e34a299c0ce5b1","zoomOut2_off.png":"5b5eb768b74ae101045d212edd73cce4adf84054","preferences_over.png":"51ea3732590159a03fb936ef7ec0e968494f97a7","selArea_on.png":"bae9a4dbcd20e5788158136b13b6b5a77f4c93b0","measure_on.png":"f702a6d17c3b483f463bab4bda083309d4cbc52c","zoomIn2_over.gif":"fa5db46d826400274419bf089a7e30a2ee6fd887","wmc_save_off.png":"53ab466af68f7b1ca1be6186f21f25c620d3eb1c","user_on.png":"6a645d3e31e4b7a9e4174d43da2bf66499792c8c","repaint_on.gif":"4ff0d7b7ab4c02f8fcb3c5aa5dcefc20db630c69","exportMapimage_on.png":"bfa1bc758177812214b78dc5c25783f140ede29a","metadata_over.gif":"de304cd9872a147f2255125d35f9d545162eed12","tiles_on.png":"ba5a5ac87cf634cadff73baebe36cba5e29faab5","pan_over.gif":"a38cdc902935a7ff92eb7f787012fbc31c92260b","addlist_over.png":"bc32d45bbcd49ac488bf56722e3e4db89eaec608","query_off.gif":"310b6758f4d82b96d6a31739270a9e49d573289c","zoomOut2_over.gif":"09e301cbb763a0bd0182ad6463547558e4e870b5","add_filtered_list_on.gif":"d7586b418feda1ad38b18fef7c79df76616ff7fc","getArea_off.png":"fa807844d5a51d92a1d9ac5aa9e4d8c87a89df33","add_filtered_list_on.png":"96af2236a56e38bb237cdce91ade3c9211f58cdd","change_password_off.gif":"204ad13f67a527864476d8d4d0823406cedbe47c","wmc_load_off.png":"2f0bacfe5b81d6ad69af267333080f7c457d1128","down.png":"05e208eebd98a1c4c882cee5c75fba9cd326edfe","up.png":"502039291f14cbe523b26dec4cbedc586f413c10","overviewgermany_on.gif":"52acc64584c841a7ea901d6d49166a6dafee5296","repaint_over.png":"c619943d5481ef18fa65db1ffeed8406d1b4b20f","gazetteer_on.gif":"50570b150d20fb9c614a60de058a01369647a3a4","back_over_disabled.gif":"0f806b3403e5716ac354484148e9d61dc50b21c1","metadata_layer.gif":"0d7a485f22ac5d1d9a3f901ea09b43117e8cd8b4","zoomIn2_on.png":"e19a6753d0f4ea05096707dd428be3adee49a9f0","forward_over.png":"9ef41ba274d09e85da13e8022f3ba3c122ce0536","helpbook_over.png":"6c8d011ed5b0db3965eae7e4fc42a92844baa6e5","back_over.png":"4f199077572ac73225ccf025191c4555ffb57001","back_off.png":"17ac31d658caae71c244b5cdc4b45000b713948e","wmc_load_over.png":"ae3e1c4d82728852a749fd2c9a4675f9382db03d","pan_on.png":"0faa787e252b2aa3c7463d4daeb4b4e0145a366a","wmc_merge.png":"e3468d87389d672fed72179c4e8f6ee96f0ea1b8","zoomIn2_off.gif":"b9b90346bfcb1b2b5699f26c1fdccf58d42329fe","zoomOut2_off.gif":"f4f46e91d205664dd60289654e8962121f70155a","logo_en.jpg":"5be7f7c993910db8058e7d6661efc7b25cdb0dbb","selArea_off.gif":"1b18aae41bac18ca761a569598b5035b2aceae9e","select_point_on.png":"5754ef5f4a4535113b1e6c15ba365a9f319f2aa5","select_choose_on.png":"32b023a2f41e4c69446ede1e848259e81df1b73e","zoomfull2_on.png":"247fa00f5ca61a295c69313e33751c2dc63dc96e","coods_off.gif":"5b9be2611671d194cd8c4871fbf04e564e954316","rubber_over.gif":"a990883f43291e725eb462fecee41ccf1c2cbbb9","center_off.png":"592a016e67ad8056ab7406d612f22e11a5227158","smaller.gif":"48712e937f86d0a504278b4a702020dd162c155a","repaint_over.gif":"bec9468253faf6117ec8a51c2e9837ffb14e632f","overviewgermany_off.png":"c6a9460df67b0d9581abcae58e6d83f68a550053","help_over.png":"b4541a5e105fb0932a1f50f99c07c21f60ccbfd2","leg_over.gif":"3828e750c0f73a38aa62ff8bc2b2ffdaff1e9dec","back_off_disabled.png":"f4b66b8048efd91a75821642919a6ffc9943e1e3","select_rectangle_off.png":"fa94129df1a9ec567f7ee8ee041b25be53e7be64","coods_on.png":"43b32b1cdf5f1be2dc5d00fa0e90e5fe5788e3b5","save.gif":"8add9b7038d282ed8b815aa1c52e6d4c17d13a3e","pan_off.png":"282531e9e1b7c758fc4747871cdeb21170f0e5f1","user_on.gif":"479874942b43f18c8954ad3f4b7354c0dc58de97","selArea_off.png":"9e63628447fd4f900ecfc73cd4b824aed0683b7a","home_on.png":"65ff29f40d128404314f245e4ad9e83d74b5388f","reload_off.png":"a8439817b43dd3d669c3b29a5713e6155e596707","measure_off.gif":"f9b004b0ca3b1fc8a89987600d77345cbd69f1cd","zoomFullarrow_over.png":"bb43d68381ebc2bbeb0cb4ef9c25fa94b643c2ed","perimeter_off.gif":"f2bdfb2c9b8cfc3fb763346aa53d9cb4e0ac4ebc","helpbook_on.png":"153f8536d7ec2e82da31e8d9f2e733b72aad86db","coords_over.png":"071083b0a9b0d05f261adf73b5bceb6b38eeddc2","print_over.gif":"07b2c940b83089d29bf8acfb2517ba7efe2cf4aa","addlist_off.png":"2aadd878a0b9162e80c72e18b5df32dd146ac033","tiles_over.png":"4fcbe99eed3b2195e66e9631e46a0c14759b2813","select_polygon_over.png":"c46c3b707403efbdf47949ac6d5c635bb1d70bd7","forward_off.gif":"b79ca63b99cb21385e07f70e0810fb5eda178da2","gazetteer_off.gif":"27d767352e69f0c1ffcfbc4e4cc527866e6088d7","help_off.png":"bc7307722c98c636e733d14936187b506182334d","coods_on.gif":"abccb164eaf22c890fad9b933072a7d28e61898f","select_extent_on.png":"55fd0c10ccd80a97481aced1956e2932b7e0b70c","help_on.png":"e007b8da0647698a27f19dead9e300f5b67623b8","closePolygon_off.png":"2ef50a770eff916cf6c07f373c8ca9d998f0d201","zoomFull_on.png":"ee3d820e85fca54f87b9340f05205ddcc9d4c5ab","forward_over.gif":"c3a671aca7bf515f8a6933a11c34dfaebeffece0","zoomFullarrow_off.png":"1008a2be801fdb6f23efd7a57b046c196c86beba","selArea_on.gif":"2967545409ef73261e73290e0f5a76ae8a68411e","add_filtered_list_over.png":"88dcecb3cf0840b18741b1d5ab03859c7a51d8db","tiles_off.png":"6cf2f1afd8c09ef95f1729e74073f93a62e22745","preferences_off.png":"9402498bd02180844ea12c2e1f3547a4fd6c0acf","add_off.gif":"6678ed3b02bc6bd8cc48c723a9f2215316714c93","rubber_off.gif":"4a8c0cfa5f0f5faad3f1bc12b3167b868c2c8e13","center_off.gif":"034e819b70cce72d7955dd2a00bb92f06025f2c7","pan_on.gif":"5b8b5dfae75f0c46a1bd7ee005e86528c3972176","add_over.png":"c24a90d4a65b06d06e9984725f9fa132213d6b41","add_off.png":"e372aae61e1de37811bee028e6db25bc1ac7c52f","zoomIn2_off.png":"d613962bc458ac757e76b737c3e627e7cc46e8d5","select_rectangle_on.png":"7f6400b43eecf431e4635c6bf7d54a315a6701a5","zoomfull2_off.png":"ce509c6fbd11393e35d506c060e714d6a54244eb","zoomIn2_on.gif":"c5a5b6fc24aff2ae850faf71c1c587b28fb98c82","select_choose_over.png":"9189a7ccd2eae04f42009741d4027e968af3dfae","exportMapimage_over.png":"46afe401179d926d423f29628effb997716c7912","gazetteer_on.png":"212b4c1b0581310f91e58105e85f5e629e7eac6a","repaint_on.png":"31faf2789df5f388184c3df0209eb98b4f1e2c3d","exportMapimage_off.png":"10bb5a1728a4237f72f99cfeaa8b8652b093f801","repaint_off.gif":"5ebd7de5876bd7071a2cfd15f089c0d9680fe77a","select_polygon_off.png":"842d703de10ff159f145060775ca2d3bbe10f596","user_over.png":"6b1b309915e0805bb045cc5cf074c998e55c65b5","reload_on.png":"a8801f5b0ac30de38199ba590c70245d6b47d4af","helpbook_off.png":"bd99ee9e0c0f2eb80befd863894de16ee2cbf5e9","zoomFull_off.gif":"809a8b307d54cf4a7cb1785ab392387d633574bc","measure_over.gif":"df6b1c6fd6b5a0c331c78ac45459db44525459d5","overviewgermany_on.png":"ba792fcd3a0dd2e02ff493c9e9ab9f26af655fc6","coods_over.png":"071083b0a9b0d05f261adf73b5bceb6b38eeddc2","wmc_load_on.png":"f3f3505bc87c99ad44017f6598472eec5ea25dc1","query_on.png":"99dece5697840f1cbb04c6d2d1dba3c1d56db2a2","user_off.png":"f8e6e72886c4576dc3b76ce9f4f82de00bd25e94","x.png":"ca83b80a4561ca5a0e0cb47d81cd16e87071ff7a","logout_off.png":"0f4d8698c49875d85baa844d0e9737c4dae06733","logout_over.png":"e547b188552e439a7f977c58bfed1ad1c87aa246","preferences_off.gif":"53c5d511038b4ea704f1033e8357af50008db0d6","logoutred_over.png":"e547b188552e439a7f977c58bfed1ad1c87aa246","home_over.png":"908be002b26e39768adc1870e8f48b39d7e685d2","pan_over.png":"2b5fd194e0b6506a61c04fd5673a954ddd87262a","add_filtered_list_off.png":"25385632667a2627f9c9492941dce56265709e14","measure_on.gif":"fe7bd9164c20769f5e71e092d71fb844df3a848e","back_off_disabled.gif":"6ed2cf681c8c0a4c49beaccf3cd3be14cb4b330f","wmc_xml.png":"0b7e58ea92d4ef7f055d5b91a4c1e8d72172ff58","select_choose_off.png":"14d12c9de917af031b1c897114e869e826cec991","center_over.gif":"afe89d7dc1c2bd7072a46ab819a1559cc865ac80","print_off.png":"7ed6608f6211427e5e3eea8f850380c31a3b06ec","forward_off.png":"3e01763f61e7a44d07811d040b7883bffaf9ed5c","coords_off.png":"7cf0bb3ba3145fff744564618cb4edf3e1d44d9a","add_on.png":"228989269008d2d611c4948eabca5b722385a9e9","coods_over.gif":"615115aecff7402a916fc23fd95efb6e8e655d06","wmc_load.png":"ecb30bce850704399b799daea945d0206c1129e4","perimeter_off.png":"9defc6eb188cb758ac556ffc5e3061fbe0faff11","zoomFull_over.png":"00574cbbaa4612f601eae57c2967c89fec08affa","repaint_off.png":"2f64884fa956db05f32f308d65dd2a90302dc1b7","forward_off_disabled.gif":"308e3f9cfd88717232a0e7b5de284eb877b243ac","wmc_append.png":"debaf8187bb002cf006f85ae815b37582fadaea1","select_rectangle_over.png":"99fe5704f0cf869c55bb104ca4cf5964170bfe6f","metadata_off.gif":"7c07d07114e27a39c089f5502292326c7c1bce71","forward_over_disabled.png":"f2d8d49ff9a22b0eca5cc13f0f37a3542af1275a","user_off.gif":"fda34183b167e0f804ddd50035defceb141bb12f","center_on.gif":"92739bf752088c88b4e272f88abbfa10889ac2f5","print_off.gif":"edcc40f5fc85fb3d8f63d05dc5c9dd679ad7e7b5","zoomFull_over.gif":"14f87004a51a9ab180f8e2eba1f28cbdec64e00a","back_over.gif":"632638602c75a0ab5bc50ea0a8d4502739c3d041","zoomfull2_over.png":"d11cc23f161ffa6f11a9078c8b40472388ecec80","forward_off_disabled.png":"773a533be85a49b632ccbd73520c33b95117b1a3","overviewgermany_over.png":"a7e8fbaf46b5ae7929122f6f03c744430ef5fa21","logo.jpg":"b14e8315e379511c23916aec282069b0ddaed053","query_on.gif":"6edcafc8d1aba63c9c4fc01b99b4709b23c93352","add_filtered_list_off.gif":"5b8228bd2219a11c8ee94bc2b9fb46a32225e20f","save.png":"2d72d5a103dca63f53ea2f118d953fefe058cf90","reload_over.png":"b2879f278170426f22413f250b9aed3979b2188e","back_off.gif":"19ecfd6ceebdc5fda76bb4ad8335d83519013cfe","coords_on.png":"43b32b1cdf5f1be2dc5d00fa0e90e5fe5788e3b5","zoomIn2_over.png":"57f9a094e3956e6f7eda96c5f46fb77781e1cd53","select_polygon_on.png":"050f928293d21422bd0cebd5ded2bdc6a9c97c72","rubber_over.png":"fb0be8b86f757c3aada2c0b61f04b39fc7b84341","metadata_off.png":"85ab6331e3a8205d68433e2c9ad6281ba05737b0","query_off.png":"f318da54985ba4e3e13d481ec53f09b96e837379","overviewgermany_over.gif":"fb37d276dd4683b1dfc4a77d787bc97124dffb23","wmc_save_over.png":"944f2653d213f5da7ad7c459c78bc58e52b7fb50","overviewgermany_off.gif":"abe2aff664a04217db9e7201fcb0c5e8b9c8133d","rubber_off.png":"27302f65148000fb332dc1aedb9911f55b52b376","change_password_over.gif":"fb983388570e6d5b92b04750007d7abb40441901","zoomOut2_on.gif":"abe9c98a4cea4cb147dd0100a79e9412485be5fe","back_over_disabled.png":"7e06b7b01aa7a0b8ae323e47b7abd2af220e1cc7","select_point_off.png":"e0da7171bab0b1bdfbdf2bd0457b3a0d026c1224","gazetteer_over.png":"040bed42c6ad4cc6a82d5302427bb798493bc993","leg_over.png":"9ecc5af05e571e8c70ecccc7a2a69ff1b3ff1526","select_extent_off.png":"0cb111c6b941b19c2212981d4df19b2e855b33a2","metadata_wms.gif":"de1c4e8f7bdd9832c616d9fe9971607c20621046","measure_over.png":"3ecd0018f385d361c357b7b616087a215556e5dc","closePolygon_off.gif":"bf320065867ccff8621327a27890bac4b56a0dc0","pan_off.gif":"d6a56a3b140fe59ea885fc646a6e7ec851a86581"}
\ No newline at end of file

Added: branches/print_dev/http/img/button_silver_blue/checksum.json
===================================================================
--- branches/print_dev/http/img/button_silver_blue/checksum.json	                        (rev 0)
+++ branches/print_dev/http/img/button_silver_blue/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"select_point_over.png":"9256b288db8baea1746449b6b94d54ac0437236e","back_on_disabled.png":"6426c4590c09281f90e742a78022b03d83d58182","change_password_off.png":"4e4afe4ec2fcf32a0a83e467c59d969435e52178","gazetteer_off.png":"f562897b4bafbba2d64b70f03e14a062fe63c316","addlist_on.png":"bd0f97c0d6d6587573defb3d1f725e72cbc99eb8","selArea_over.png":"85c58ef907dd338a6ff4a087df9e2b14cc152e60","line_on.png":"c22e573623b66f898c707c7785e46bfdccd79de5","move_node_off.png":"b76c293d8a2b462f412904975d60070c1520ef34","zoomOut2_on.png":"9c347cfdd96979c50fcdbd7e6e1d6a7ac8718c0f","polygon_over.png":"90288f7bded83595be1dddf7dcabecfc687f10ec","zoomFull_off.png":"5d7ca78cb05db4a6a9205a4870ae0944adf724a9","closePolygon_off2.png":"d9ce4b6d0410461ae661a7fd89f56216b2e4b99e","polygon_on.png":"90288f7bded83595be1dddf7dcabecfc687f10ec","wmc_save_on.png":"00c49c9d78173b90a04c5fe1df6e2f34d6cb8c89","metadata_over.png":"fea067dd1f71bbd71c1906deebb7c33a0bf3c761","print_over.png":"84155582c911d53d38b187a1419769b40849c520","rubber_on.png":"5fb9f816806254b20abbab7153f60917fb1bd164","geomRemoveDb.png":"903d2a30ca534bdcddb4ca127a0b4b0c6df468ae","center_on.png":"4fb626be763a0fead3710e26af60c6bbb80f2088","zoomOut2_over.png":"9c347cfdd96979c50fcdbd7e6e1d6a7ac8718c0f","select_extent_over.png":"3af37d6725ddcea662cf20e7609a12b77e213c2f","center_over.png":"4fb626be763a0fead3710e26af60c6bbb80f2088","query_over.png":"a49529fe756baa727ec365e90aa6f01a996e3eb0","measure_off.png":"f46026a369defaedbc4e62324e34592085bedfbd","rubber_off2.png":"dbb04242db66c388bbbc8dccd507efa329de2b50","print_on.png":"84155582c911d53d38b187a1419769b40849c520","delete_node_off.png":"d4f2ce033b3b2999bf87b5965d6d262b9a83a4b6","change_password_over.png":"981ec73b4895db86e2dd5e988f69e4451556aff0","zoomOut2_off.png":"e63484cb7ce53049feca5259c90853e4533d85b9","preferences_over.png":"db572e044f5183bd6bbf50648f44b3a23278572a","selArea_on.png":"85c58ef907dd338a6ff4a087df9e2b14cc152e60","measure_on.png":"1c291ed32b687bd068d8ffe99a980fe829f4db13","forward_on.png":"2ad4cba7cb7ba3c54e78c2ad3292dd5474982dbf","wmc_save_off.png":"fee66202732de16ca9e9696ed7507e80758a26ca","back_on.png":"6426c4590c09281f90e742a78022b03d83d58182","exportMapimage_on.png":"bfa1bc758177812214b78dc5c25783f140ede29a","point_over.png":"b4ef5bbc5f1b76fd0aa99b525ff6c318f2197c9b","addlist_over.png":"44fbc97b74388a15b15e7b9b0af5687aa6f11ec6","getArea_off.png":"9008efc2a52dc037deb1977b780f1e8b80862fe1","add_filtered_list_on.png":"918c02332141c8f81d34b163231b487527c8e5f2","wmc_load_off.png":"7433aed3ba188fdcd814c5b00f783ff2a3af6418","repaint_over.png":"94f9c9d07ccafd29cb931fa545aa0683b35fe828","zoomIn2_on.png":"4ef4fb3974b0b21e22033fc39c8aad86d3a756b3","forward_over.png":"2ad4cba7cb7ba3c54e78c2ad3292dd5474982dbf","back_over.png":"6426c4590c09281f90e742a78022b03d83d58182","back_off.png":"cd04d4bafc1f144e0fb541fdc90848939981b615","wmc_load_over.png":"79fac48bfa032ac37349bd0328854efed8a3c830","pan_on.png":"3ddbe48b314a7a69f50d0708169a0c61e1fcc094","resizemapsize_on.png":"b81e4e3667c411fa12092c820e66399aa38d2d75","select_point_on.png":"9256b288db8baea1746449b6b94d54ac0437236e","select_choose_on.png":"1531935247d794d120a8fd00dab2d600770a454b","line_off.png":"3843490a65473bfdb6146b67434bf7f88ce0089e","center_off.png":"973ab75b06d6070bca634b441e526684b0a214c8","help_over.png":"9883d4e1b996300b729919a7fb28310f5076e49f","back_off_disabled.png":"cd04d4bafc1f144e0fb541fdc90848939981b615","select_rectangle_off.png":"fc14960bffb8e0b487f1ce93520ac2a3ae662e00","metadata_on.png":"fea067dd1f71bbd71c1906deebb7c33a0bf3c761","new_node_on.png":"5318bae725530b069d0f1de1f4b5181885f66b7e","pan_off.png":"8267b9278ebee870e92b6c0df659b17e1bb1c0c3","del_over.png":"6bc0d414580f94498cd419bd780252e1fe977301","selArea_off.png":"259ee143ff978ead0006a8fff22f4b20a0e1fc83","reload_off.png":"a8439817b43dd3d669c3b29a5713e6155e596707","delete_node_over.png":"d8a4369a76df12f47d5020822d15361d8936c395","point_off.png":"91e63ec1d1ddee8dc1673d151cda5b7adc780013","coords_over.png":"9f5a1be4e70bd661305717e874f0f74937801903","addlist_off.png":"b5eb4b4496677fbeb8d28553ba16f3f22eb3466f","select_polygon_over.png":"0b1ee13a77bff27e50b0512106e10bae153c2b97","help_off.png":"96ec5b645a39f05a4bcc74fb275d85b2c7559e2b","del_off.png":"4d657cd64336427be94501a73ef800a1789077ee","select_extent_on.png":"3af37d6725ddcea662cf20e7609a12b77e213c2f","help_on.png":"9883d4e1b996300b729919a7fb28310f5076e49f","closePolygon_off.png":"97170d72c5b089c8f4391321b2e69853e2de5ee0","zoomFull_on.png":"fed65c1492b26d467558086f001fc700a38fd300","add_filtered_list_over.png":"5cad54ed5786a7991a5e841bfe1bcdf0b9654d5a","geomInfo.png":"4a865c812713d0663a586c12c9b6a314f111810f","preferences_off.png":"4378a6d29d002b030172769af5910bd6cfc0df75","forward_on_disabled.png":"2ad4cba7cb7ba3c54e78c2ad3292dd5474982dbf","closePolygon_on.png":"97170d72c5b089c8f4391321b2e69853e2de5ee0","add_over.png":"8aac5298d1036f956889a0f2bf7ab79609f2204f","add_off.png":"f3d5810290bcf540bfd660499dbf6bfc62f245f8","geomRemove.png":"a8560127561c9b7ab815fb0588025c2ee637c273","zoomIn2_off.png":"69226f476ab0e18a36f95779b6a6c88ae0905915","select_rectangle_on.png":"1a14139cc5e75fbe0825f0be88234d5cb505d5c8","select_choose_over.png":"b4124576fe66b98c656f02e64f42df101092a54f","exportMapimage_over.png":"8ad5b260675623d4810f06f5f41b5f6be7f408ee","del_on.png":"6bc0d414580f94498cd419bd780252e1fe977301","gazetteer_on.png":"eff0b733c2469e5d7bfa41619517b23803b7e299","repaint_on.png":"94f9c9d07ccafd29cb931fa545aa0683b35fe828","line_over.png":"c22e573623b66f898c707c7785e46bfdccd79de5","resizemapsize_over.png":"b81e4e3667c411fa12092c820e66399aa38d2d75","exportMapimage_off.png":"10bb5a1728a4237f72f99cfeaa8b8652b093f801","select_polygon_off.png":"52a30f8ca5faf5c3d06d0ea557f7003b680a2371","reload_on.png":"a8801f5b0ac30de38199ba590c70245d6b47d4af","move_node_on.png":"410f458ca477f047ce7fd698da52110c4c4a9679","getArea_over.png":"9008efc2a52dc037deb1977b780f1e8b80862fe1","wmc_load_on.png":"79fac48bfa032ac37349bd0328854efed8a3c830","query_on.png":"a49529fe756baa727ec365e90aa6f01a996e3eb0","logout_off.png":"2666d23e4c228dfb988c20a328ed5e857fb0a952","logout_over.png":"d7d7dcf225a4f91a0183c2660e794bf5271561a8","pan_over.png":"3ddbe48b314a7a69f50d0708169a0c61e1fcc094","add_filtered_list_off.png":"bfeb5f3b2ff9dfcba174ae87ba064612a47bcdc2","select_choose_off.png":"14d12c9de917af031b1c897114e869e826cec991","print_off.png":"751e269ef3801ba24de2a6a87403ad47d628c922","forward_off.png":"04d0a9a94e45f8117013d2035c0dd3e90daf0297","closePolygon_over.png":"97170d72c5b089c8f4391321b2e69853e2de5ee0","coords_off.png":"d1dfc2332eba6b30e1f2d85cc9108827cb889b82","add_on.png":"8aac5298d1036f956889a0f2bf7ab79609f2204f","preferences_on.png":"d63c5267e7c17fd721e3ce63fb57277ee7fc9ea4","point_on.png":"b4ef5bbc5f1b76fd0aa99b525ff6c318f2197c9b","zoomFull_over.png":"fed65c1492b26d467558086f001fc700a38fd300","repaint_off.png":"5705ed70ee4261f644460ec12fc7f1ebdbaea4bd","select_rectangle_over.png":"1a14139cc5e75fbe0825f0be88234d5cb505d5c8","forward_over_disabled.png":"2ad4cba7cb7ba3c54e78c2ad3292dd5474982dbf","delete_node_on.png":"d8a4369a76df12f47d5020822d15361d8936c395","polygon_off.png":"44850adf89e152c606f41f9edd5aff4e56a62d8e","getArea_on.png":"9008efc2a52dc037deb1977b780f1e8b80862fe1","forward_off_disabled.png":"04d0a9a94e45f8117013d2035c0dd3e90daf0297","shape_off.png":"24f50d87d0825d580e4d5936630a011a92a34ff6","reload_over.png":"4d027e6dab21e00c933c88aa4f17a07e19a46b5b","coords_on.png":"9f5a1be4e70bd661305717e874f0f74937801903","zoomIn2_over.png":"4ef4fb3974b0b21e22033fc39c8aad86d3a756b3","getArea_off2.png":"625fde2d24a6a5fd42a83f23196d68e6a31369b3","select_polygon_on.png":"0b1ee13a77bff27e50b0512106e10bae153c2b97","shape_over.png":"70a628840f41d2e7e93fde1531da01606a4f35d1","rubber_over.png":"5fb9f816806254b20abbab7153f60917fb1bd164","metadata_off.png":"3f433cc1d41aaab400d114e29577d0470998a0ec","query_off.png":"843d2d78f9ae4def71d74ef010fa927451651d9c","resizemapsize_off.png":"31c224aec3467981f1ea683936e73509c144fcbd","wmc_save_over.png":"00c49c9d78173b90a04c5fe1df6e2f34d6cb8c89","new_node_off.png":"c78fc448c9aa3ee972236933f39ab0cb13223275","rubber_off.png":"5fb9f816806254b20abbab7153f60917fb1bd164","new_node_over.png":"5318bae725530b069d0f1de1f4b5181885f66b7e","shape_on.png":"70a628840f41d2e7e93fde1531da01606a4f35d1","back_over_disabled.png":"6426c4590c09281f90e742a78022b03d83d58182","select_point_off.png":"f312811a4ea559cf205b33f8698f0768e64a0d45","move_node_over.png":"410f458ca477f047ce7fd698da52110c4c4a9679","gazetteer_over.png":"eff0b733c2469e5d7bfa41619517b23803b7e299","leg_over.png":"3770608a4d367e678e1234e8e43eb302a8f72e93","select_extent_off.png":"d4fd129ece55ad97a6072694e3d5dd7004f058e8","measure_over.png":"1c291ed32b687bd068d8ffe99a980fe829f4db13","logout_on.png":"d7d7dcf225a4f91a0183c2660e794bf5271561a8","mod_digitize_tab.php":"fdd1350f87ac0e70b060e429b0ebe9da8b15718d"}
\ No newline at end of file

Added: branches/print_dev/http/img/checksum.json
===================================================================
--- branches/print_dev/http/img/checksum.json	                        (rev 0)
+++ branches/print_dev/http/img/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"x.gif":"7e7aed63aa9afaba8c6a4f7ebff512327ed8ef3d","sandclock_oo.gif":"5d49e5cec8391ea77907947482f817adbd72a133","transparent.gif":"680a793f9ad65874a383f23dd9ca43451e533cab","sandclock.gif":"2e76026193be57ce25e48f862880da43cfa3ca82","no_info.gif":"fac7767c5221c69997b287f0f41280fdd76e5d3f","eye_on.gif":"ab2643d494f04292edc7bad0b4c60683b7757bfc","redball.gif":"8287dea0eded3dca40edd7949720a7aa1f646464","header_yellow.jpg":"eba3a0dafd815bde97f16bcb7934047aa3df6a57","info_on.gif":"9a76861d7fc60847889e8a4f9e5bcad4f481853c","layer.gif":"0d7a485f22ac5d1d9a3f901ea09b43117e8cd8b4","mapbender_logo.png":"7679ccb0b9b56c84e8cc859f18d5717ea507fe1e","black.gif":"f963b4565b1eb7419bea267de989546694cc5535","eye_on_.gif":"bc07f7764664aaa35727433f9845941b0a979bb7","wms.gif":"de1c4e8f7bdd9832c616d9fe9971607c20621046","close_icon.png":"3e0dc00cfe79094b241543a53c6c3338546762da","indicator_wheel.gif":"ac4bb226ab029977d048247a2392d86779b453ae","scalebar_bw.gif":"85a2ce568a94c043dbb09f47a172cc7ce95dffc9","OSGeo_150pix.png":"a55abd26ad53e8c8354310152d2d15e04ce49568","eye_off.gif":"495f732611ba7bd7d575a0f68d9ed294a480ee05","white.gif":"85605f08330584627b3df0ea2170474ef2e150bc","mapbender_oo.png":"84d8d92b360856e5d68b1cdf136eda48ce14a46d","add.png":"b6244b0027a8c9f702b311cb5b2ab8cc64f3b5f2","info_off.gif":"d3fe1813af76ccc6114721d002a00cb064098c17","wfs_digitize.png":"e1d7e9796a19eb1b0b1d59f0f6fbbe74018b290f","pencil.png":"62a1b41ac5eefbf3d0ad578a19572d4096d88146","background_yellow.jpg":"c19e4c933c616fae47d2d11d98941353cd60492a","resize.gif":"313a3d93b10b87c7dc49a9795b5bd2aec5918d8e"}
\ No newline at end of file

Added: branches/print_dev/http/img/trafficlights/checksum.json
===================================================================
--- branches/print_dev/http/img/trafficlights/checksum.json	                        (rev 0)
+++ branches/print_dev/http/img/trafficlights/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"go.bmp":"4bd6e76af79d6d1546baddca283ae791f2867cab","wait.bmp":"db4e4e1c6cabe98105689a082591cde6b789bf31","stop.bmp":"d3424b001475eb345cb8f85d29cdfabea7451e3e"}
\ No newline at end of file

Added: branches/print_dev/http/img/tree/checksum.json
===================================================================
--- branches/print_dev/http/img/tree/checksum.json	                        (rev 0)
+++ branches/print_dev/http/img/tree/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"folder_on.gif":"34f06cb79bf221dd82789e60a6fb4e4f601260c9","file.gif":"bddd2dbc36a0a6af52919d2edb9af253bab5e579","file_empty.gif":"87ee9f46173d692c0026f6e39ee265fb9fe4a063","folder_off.gif":"5c39b1b179f777ae91a797aae7ae1fd8e1a598b7","file_last.gif":"3e7add5d92fd86804c573dc0aac5425963c015ba","file_vert.gif":"acd3c98fd8c84010387665eda695b9be40ca10ed","1w.gif":"863fba4e20856d9ff267334811068210480a037a"}
\ No newline at end of file

Added: branches/print_dev/http/img/tree_blue/checksum.json
===================================================================
--- branches/print_dev/http/img/tree_blue/checksum.json	                        (rev 0)
+++ branches/print_dev/http/img/tree_blue/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"folder_on.gif":"771f34393e97b46a6ef1e9ac8463b8fac6c3b054","file.gif":"e2c2ccda4debea5c8e011690861c90953efb3fbf","file_empty.gif":"87ee9f46173d692c0026f6e39ee265fb9fe4a063","folder_off.gif":"ad87bd81ef5b64367dd6ca9efc86c4f05b8245dd","file_last.gif":"9806d09301fa1903418bb3a3a749e172dd024fff","file_vert.gif":"cbc172af4abbce998c06ad2b29d7af8401ec4222","1w.gif":"863fba4e20856d9ff267334811068210480a037a"}
\ No newline at end of file

Added: branches/print_dev/http/img/tree_gray/checksum.json
===================================================================
--- branches/print_dev/http/img/tree_gray/checksum.json	                        (rev 0)
+++ branches/print_dev/http/img/tree_gray/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"folder_on.gif":"2c327cdb21d238d862e88e6df0c080fe08e711ec","file.gif":"015509c120a69b70c79b2f8cce79b3f3c4b35474","file_empty.gif":"015509c120a69b70c79b2f8cce79b3f3c4b35474","folder_off.gif":"994adafa88031d13a66d9e50697c8a8f27c03009","file_last.gif":"015509c120a69b70c79b2f8cce79b3f3c4b35474","file_vert.gif":"015509c120a69b70c79b2f8cce79b3f3c4b35474","1w.gif":"015509c120a69b70c79b2f8cce79b3f3c4b35474"}
\ No newline at end of file

Added: branches/print_dev/http/img/tree_new/checksum.json
===================================================================
--- branches/print_dev/http/img/tree_new/checksum.json	                        (rev 0)
+++ branches/print_dev/http/img/tree_new/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"leaf.png":"c35c8d6ad17b2c7717c4b5113ca448d1721fb862","expanded.png":"c88b86aabdbbd1942702933c63bd1736ddf7faf4","delete_wmsmy.png":"a644be9082e9356453f6cdb4fba42599dca66c98","last_leaf.png":"653af97d00d01590d7cc033e9a2e7a8cbf046ae8","error_folder.png":"aeb9c823883594ad08ccd611ebdefe2463a2845d","hide.png":"5060e44490e46f6eed3b3be26418d28c53d274fa","menu.png":"6564c71d51826dd5bdace69ec901d134e07073c5","move_up.png":"d91ec6f0fc3a341006afa1e8f117a2cf8abb62f8","closed.png":"46d037247bcc0924fcf596eae3c0fd40d066e935","expanded_folder.png":"0f686626447b21d9841bbbe89503035e7f73a5e9","last_closed.png":"bc86a2a7aad25aecd43219561d737b930f7dad3b","zoom.png":"23df945b244a30e9fb11648323dc0994ec03b80a","move_downmy.png":"1d280cac4935df18ad09237f340ce8e8462c6e75","loading_folder.gif":"b7e04482a3ed39e8471461e590d4f5ad365c991c","delete_wms.png":"54e339b4f5fa90cae331428622a16fbc2cff5e1a","branch.png":"48ebf2cdaf220bf8ba9d06140910ec738184432d","error.png":"addf30866d154a50e3efd7a8eaf9fddbacaafd53","info.png":"ccf07521e326e358763af7e7a0f0782d73da95b9","expanded_error.png":"aa84656c22aabdaac0aba24c30190a64034f49b5","closed_folder.png":"1e0f5469a8499453c287d8bff7d62aca25c88665","move_down.png":"7c33bc5ce4cb4767e5f12e09ed89e5d3f6c30c2a","move_upmy.png":"8d45baa39db19de5129779d49c966f0644244006","last_expanded.png":"2022f00e2680292dd7667811740908adc22aa330"}
\ No newline at end of file

Added: branches/print_dev/http/img/tree_orange/checksum.json
===================================================================
--- branches/print_dev/http/img/tree_orange/checksum.json	                        (rev 0)
+++ branches/print_dev/http/img/tree_orange/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"folder_on.gif":"c48607fa48ec3db3ac9bf5d56daed668d86f04dc","file.gif":"bddd2dbc36a0a6af52919d2edb9af253bab5e579","file_empty.gif":"87ee9f46173d692c0026f6e39ee265fb9fe4a063","folder_off.gif":"ee56f572fb1e82965ea80959fbf2db89dc25cb2e","file_last.gif":"3e7add5d92fd86804c573dc0aac5425963c015ba","file_vert.gif":"acd3c98fd8c84010387665eda695b9be40ca10ed","1w.gif":"863fba4e20856d9ff267334811068210480a037a"}
\ No newline at end of file

Added: branches/print_dev/http/include/checksum.json
===================================================================
--- branches/print_dev/http/include/checksum.json	                        (rev 0)
+++ branches/print_dev/http/include/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"dyn_php.php":"4877508107153426e8690f207732f64d66405c8b","dyn_js.php":"31cccce487614272cd7e8bd46820af1fb368a600","dyn_css.php":"276f45ae00295726486225cc506785b7a141f30f"}
\ No newline at end of file

Added: branches/print_dev/http/javascripts/checksum.json
===================================================================
--- branches/print_dev/http/javascripts/checksum.json	                        (rev 0)
+++ branches/print_dev/http/javascripts/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"mod_insertLayerPreviewIntoDb.php":"a2ba0a6eee822565180aaffa2bdf66934be9310d","mod_coords.php":"8f88410aa9af4c1b047545c800688c9d05717bf7","core.js":"2358a5d7d0dcd671e925637281b90e404d8cbd04","mod_savewmc.php":"708b17d9be9ff65f25325d2413acda4068124b3f","mod_dependentDiv.php":"e35a5691b2038bdd5b9f2470085c66999d25055d","mod_tab.js":"0cbb88d49b8a3158754564df1bd97eb0e4166290","mod_displayObj.js":"9f94c605bff1421cc65e63cd47f93b88a17a02bd","mod_loadwmc.php":"f26bdad10ceadecca1ceb1cdec2b8a12d7eed2ba","mod_getArea.php":"29425af78d879ddbad27ab329bcdae990ec0b251","map.php":"992835e81c706222eb967e2f3a91c77d5343fc46","mod_navFrame.php":"e225229e7fc52e3f861dfe2c35b649bcb5bef2d2","popup.js":"3add97f9416721c50fe2e50a0db8429f1724fd88","mod_rubberExt.js":"d06b9053dfa0c57223def9d98dd60f63882cab8c","mod_setBackground.php":"654b3579dcca617421f0bd126e2bdc1f2ae63c86","mod_pan.php":"a02b583141d70ad8c342f8ce96525086ed40a57d","mod_zoomCoords.php":"e3bea1852b6703e9806c0def63551bd029277946","mod_reload.php":"783357e050351363d64f7a767e1fcc26061f07d6","mod_embedded_legend.php":"3258979b9b17d003e69a145b925a77f7dc447df0","geometry1.1.js":"620655897913d25f73c1926e4332aeaf710cf596","mod_log.php":"be4fe62559e137b7c56555769ddf7ce92f22c1ae","mod_add_vendorspecific.php":"40a95468f79ba3c3cdc828dc6cf31743df1d16a0","mod_wfs_gazetteer_client.php":"369a9c40009b3d94b981317d77767bf71bbb1147","mod_sandclock2.php":"b7f83df69e0816d7f7c7fdc7cc9444bae3d19883","mod_scalebar.php":"abb0d622633c61ba067924e10df3c627477f3caf","mod_gazetteerSQL_client.php":"3e2da339c556ee89050ecec5c714ff0983c117ca","mod_featureInfoTunnel.php":"93458c51ec698d2487a6a34d5998bf5cece48600","mod_setBBOX1.php":"7095792bd98fceb48d9a6a6a9a00f72b3aa85bd3","mod_closePolygonExt.js":"d14cf469ec49470f3db9498f4c8fa43bcb868fa4","mod_coords_div.php":"2660516f73f5728f2fd7a81ba3986657c3c4ff64","mod_exportMapImage.php":"c1895289d2862b776048b3c74a6bf4fe34530c2a","mod_wfs_SpatialRequest.php":"27bede5d391bc0c0d611da4b7e524e8ec8c70cdb","mod_repaint.php":"a57f437835f1802d21c410c0de446b43c6d5c8e0","mod_cardindex.js":"419efd85a89c115489a74feaefed926cdfa20034","mod_toggleModule.php":"0ad2723c27a245f3843460fb215b74c4555fd1a0","mod_usemap.php":"71448600f34938a4abdccd65db68ece0898bfe34","mod_setPOI2Scale.php":"d3c130eb40770ce1df5f27c8b1be547997d4c82a","mod_insertKmlIntoDb.php":"436f13750c8ad80ebef128a97bea3faa9213be27","mod_adminNavigation.js":"c0f7fc3c48df387961bac1b701cb334a4b1d820d","mod_saveWKT.js":"c8958585301450c7e1cee1db2021c7528f7b08de","mod_center1.php":"d21b067dded6bd41128cd778a5d11719c45c31b0","mod_horizTabs.js":"65a57ee7251e8e974c79329bdf92a96943db1bf1","mod_permanentHighlight.js":"286994de22cc1cab637a997a654257798adcffc2","mod_zoomOut1.php":"72220e7604e0e374f418dc0b304940828be79971","mod_add_SLD.php":"707a45effa03be0ebe9f62eb7cba74c956fb39f2","mod_wfs_client.html":"2dfe8d34d01a4a54f1834bc6796c79f8fd98400b","mod_addWMS.php":"506d0920e30a77771300c47e5d53be4d0d3fe833","mod_highlightPOI.php":"d1b3a5313a6a479edb87e292c72da7c7e60fd8d4","mod_featureInfo.php":"f5ce6310d75d26b371ed1714f3a06b88689d00df","mod_addWMSgeneralFunctions.js":"68313f8b16b25a4f51764f9b12e1c565d2e6e482","mod_horizTab.php":"ee605d66ad7ad60d35eaea2056ece6f1c786864f","mod_switchLocale_noreload.php":"da36cbcae4702f1e361b492746124bc7a01c78bc","mod_setBackground_all.php":"859bfe75b600791efc65c7f9b5a84db9e3e64b13","mod_zoomFull.php":"01d4d39272ede09f13822c9e8664fc208696771f","mod_home.php":"91cce991ec361f2b675b8dea9a6c3e1cf6380e89","mod_copyright.php":"a7f3d2975a33f50795b8684b40eea66176fb2c0a","style.js":"8c9e05b29da4d0e7423418ed0a48a68eceb63cef","mod_dynamicOverview.php":"235a994ccd6f854a54a78f92eaa51f44edb7a82d","mod_print1.php":"a20aad1ff7e4f6cd904fadbd1044b56df261af06","mod_selectMapsize.php":"dd4618f06e62ca428be2e93667050dee1b6a484e","mod_resize_mapsize.php":"d3dc1e74f487982df9632d0326664c6b2e3dd1e2","jsTree.js":"b8953f9032bb08f52b4faf5dd2161c97884d6559","mod_export_image.php":"35520e4594bb8706429b35c70c614d5390a8bafe","mod_closePolygon.js":"f87494371625c80edad6978d55fe4e81376fff1d","mod_state.php":"de780bade94f022828e73ea116cd49483a577347","mod_loadKML.php":"7c60e736cf95ef7b68af35b547a3c654bc8f929e","mod_measure.php":"9908664a76d3ea0c63bcda47adb46e46d90e4f50","mod_addWMSfromList.php":"7c9887bd10966e6a01b744fa0aeca6cd63586757","mod_renderGML.php":"2a8dbf03604835a412d12d9098608930aca80ad2","wfs.js":"03fed437610f34f37671d536f3fd0df5ae22b01d","mod_forward.php":"5a3aea2fea44bc728ea6f9f2aaec1487fdb3f1be","requestGeometryConstructor.js":"7e58e5e3a2161e29691fcf1dfcb3412c40095f4b","mod_addWMSfromfilteredList.php":"6b233634477eac721051a6d2f9632dd319ac06f4","map.js":"ea1a516021def239ae9ab6e7795b1b330e5fa027","mod_dragMapSize.php":"3fff8a04cff85d86cebdaeccb1e5c98708cdcc0f","mod_poi.php":"f05ecb8b74f4ed48a99ed42abf28a7a114c44fe1","mod_saveWmcKml.php":"42b93a438b45a56055f3249c55f0c6cc076240ce","mod_addWMSfromfilteredList_ajax.php":"7a06efe2a9d59e71f6c866960ca4277e6625cb25","mod_key.php":"97e565d9eac6ef4a97ec2d6569994c90fed3fdac","point.js":"3ece0158b3b2212f1b3cafce307542ef2e61d9f8","mod_scaleSel.php":"639bf170d5c51fb6e9192c8e639c74b6e22e87b3","mod_owsproxy.php":"52f5c58468c207e107030d8eb811cbd189fcf3e5","mod_selArea1.php":"8a8684aff411014b40b2f1d14de19f7b61501a51","mod_scaleText.php":"a7c58f5c3053702e0d4acca91524da11d35eb08e","mod_selArea.php":"858e2d3075ab06f5b390946edf5fa5e881d760ae","mod_displayWmc.php":"095ac59de042888fe1afa755b50f4794cd36ca73","event.js":"f00ea4e5027c95dc383ab50584b379f954e1312e","mod_tab.php":"96f27904d7281c72ee2e89d79a4b7389257ecdfb","mod_help.php":"96b27e106469a27809c578305815d9106b6883f8","mod_perimeter.php":"45a887cfbbc3fdaf49e77bc2bc77a8958594e50f","mod_treeConf.js":"f63d48f27a47a23a5787dbdf5cd6b4d183e81fda","mod_box1.js":"616be3751310c9cabf55321adf712650d5de2231","mod_saveLayerPreview.php":"e168803f3b72bd77b879c4d9dbb2b5c7a8f9285f","map_obj.js":"fa37c2220fe38811d870efe5ecd5fb010af52a53","mod_addWMSfromfilteredListDB.php":"59d96d1c795b874f7cbb160758048547088b121c","mod_setTimeout.php":"b135add6663e2015210b200212d91e8b6d134cd3","mod_back.php":"4bd7067b201eaa817ca19e2750582b30346a901d","mod_scaleHint.php":"2e2dbfe5f49ccbfd6feb257c8ab75de4b31bae36","mod_legend.php":"932c916b9aa7ee3bba914b705327627185b29105","mod_zoomIn1.php":"da8445296b3e561e77bf5afd5fb6c9b9aafbff52","geometry.js":"2d62867b3c1ef101dd6f2c2b0eecc457274361b1","core.php":"aa22806d09b9a201ec56a19cbfca0f78f8eaf013","mod_rubber.js":"3e05375af79819ced524d25b8cda2b70d2e40e1b","mod_fisheye.php":"e47514e9d3795da7ab054be0672edcbaf3daa8e4","mod_featureInfoRedirect.php":"bbd35807d2edd4045ab4755e9fb439e219b24f73","mod_initWmc.php":"cac713d23540f5e0e122561617281fc44e79c640","wfs_obj.js":"e705962cd3ab2f9f34893c466364930f98d42c88","mod_dependentIframe.php":"d2a1d3b81fbba538f7bd6dab27558b22c87938d2","mod_digitize_tab.php":"490a246b03d7f39ec9a86af25f4598fb2a78d495","mod_sandclock.php":"c44aef9699c42b8e8d43d527aa6b978694ed053e"}
\ No newline at end of file

Added: branches/print_dev/http/javascripts/core.js
===================================================================
--- branches/print_dev/http/javascripts/core.js	                        (rev 0)
+++ branches/print_dev/http/javascripts/core.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1,15 @@
+
+var currentWmcExtensionData={};var restoredWmcExtensionData={};var mb_WfsReadSubFunctions=[];var mb_WfsWriteSubFunctions=[];var mb_l10nFunctions=[];var eventAfterMapRequest=new MapbenderEvent();var eventBeforeMapRequest=new MapbenderEvent();var eventBeforeGetScale=new MapbenderEvent();var eventBeforeFeatureInfo=new MapbenderEvent();var eventAfterLoadWMS=new MapbenderEvent();var eventInit=new MapbenderEvent();var eventInitMap=new MapbenderEvent();var eventLocalize=new MapbenderEvent();var eventAfterMapObjectConstruction=new MapbenderEvent();var eventResizeMap=new MapbenderEvent();function mb_registerInitFunctions(stringFunction){eventInit.register(stringFunction);}
+function mb_registerPreFunctions(stringFunction){eventBeforeMapRequest.register(stringFunction);}
+function mb_registerFeatureInfoPreFunctions(stringFunction){eventBeforeFeatureInfo.register(stringFunction);}
+function mb_registerSubFunctions(stringFunction){eventAfterMapRequest.register(stringFunction);}
+function mb_registerMapObjectSubFunctions(stringFunction){eventAfterMapObjectConstruction.register(stringFunction);}
+function mb_registerGetScalePreFunctions(stringFunction){eventBeforeGetScale.register(stringFunction);}
+function mb_registerloadWmsSubFunctions(stringFunction){eventAfterLoadWMS.register(stringFunction);}
+function mb_registerWfsReadSubFunctions(stringFunction){mb_WfsReadSubFunctions[mb_WfsReadSubFunctions.length]=stringFunction;}
+function mb_registerWfsWriteSubFunctions(stringFunction){mb_WfsWriteSubFunctions[mb_WfsWriteSubFunctions.length]=stringFunction;}
+function mb_registerL10nFunctions(stringFunction){eventLocalize.register(stringFunction)}
+var mb_PanSubElements=[];function mb_registerPanSubElement(elName){var ind=mb_PanSubElements.length;mb_PanSubElements[ind]=elName;}
+var mb_vendorSpecific=[];function mb_registerVendorSpecific(stringFunction){mb_vendorSpecific[mb_vendorSpecific.length]=stringFunction;}
+function writeTag(frameName,elName,tagSource){if(frameName&&frameName!==""){window.frames[frameName].document.getElementById(elName).innerHTML=tagSource;}
+else if(!frameName||frameName===""){document.getElementById(elName).innerHTML=tagSource;}}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/core.php
===================================================================
--- branches/print_dev/http/javascripts/core.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/core.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -19,6 +19,7 @@
 
 ob_start();
 header('Content-type: application/x-javascript');
-require_once(dirname(__FILE__) . "/../../lib/event.js");
-require_once(dirname(__FILE__) . "/../../lib/core.js");
+require_once(dirname(__FILE__) . "/../javascripts/event.js");
+require_once(dirname(__FILE__) . "/../javascripts/core.js");
+
 ?>
\ No newline at end of file

Added: branches/print_dev/http/javascripts/event.js
===================================================================
--- branches/print_dev/http/javascripts/event.js	                        (rev 0)
+++ branches/print_dev/http/javascripts/event.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1,16 @@
+
+var MapbenderEvent=function(){this.register=function(aFunction){var mpbnFunction=new MapbenderFunction(aFunction);functionArray.push(mpbnFunction);};this.unregister=function(aFunction){for(var i=0,len=functionArray.length;i<len;i++){if(functionArray[i].getFunction()===aFunction){for(var j=i+1;j<len;j++){functionArray[j-1]=functionArray[j];}
+delete functionArray[len-1];len=len-1;}}
+functionArray.length=len;};this.isRegistered=function(aFunction){for(var i=0,len=functionArray.length;i<len;i++){if(functionArray[i].getFunction()===aFunction){return true;}}
+return false;};this.trigger=function(properties,booleanOperator){if(!(functionArray.length>0)){return true;}
+if(typeof(properties)!="object"){if(typeof(booleanOperator)=="undefined"){booleanOperator=properties;properties=undefined;}
+else{}}
+if(typeof(booleanOperator)=="string"){if(booleanOperator!="AND"&&booleanOperator!="OR"){}}
+else if(typeof(booleanOperator)!="undefined"){}
+var result;switch(booleanOperator){case"AND":result=true;break;case"OR":result=false;break;default:result=true;break;}
+if(log){var e=new Mb_notice("functions (after sort): "+functionArray.join(","));}
+for(var i=0;i<functionArray.length;i++){switch(booleanOperator){case"AND":result=result&&functionArray[i].execute(properties);break;case"OR":result=result||functionArray[i].execute(properties);break;default:result=functionArray[i].execute(properties);break;}}
+return result;};this.getProperties=function(){return propertiesObj;};var functionArray=[];var propertiesObj;var log=false;};var MapbenderFunction=function(aFunction){this.getFunction=function(){return func;};this.execute=function(argumentObj){if(typeof(aFunction)=="function"){return func(argumentObj);}
+else{var argumentNames=[];var argumentValues=[];for(var i in argumentObj){if(typeof(argumentObj[i])=="number"||typeof(argumentObj[i])=="boolean"){argumentNames.push(i);argumentValues.push(argumentObj[i]);}
+else if(typeof(argumentObj[i])=="string"){argumentNames.push(i);argumentValues.push("'"+argumentObj[i]+"'");}}
+var str="";str+="(function ("+argumentNames.join(", ")+") {";str+="return "+aFunction;str+="}";str+="("+argumentValues.join(", ")+"));";var returnValue=eval(str);return returnValue;}};var func=aFunction;};
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/geometry.js
===================================================================
--- branches/print_dev/http/javascripts/geometry.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/geometry.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,1781 +1,150 @@
-/* 
-* $Id$
-* COPYRIGHT: (C) 2001 by ccgis. This program is free software under the GNU General Public
-* License (>=v2). Read the file gpl.txt that comes with Mapbender for details. 
-*/
-// http://www.mapbender.org/index.php/GeometryArray.js
-
-
-var nameGeometryArray = "GeometryArray";
-var nameMultiGeometry = "MultiGeometry";
-var nameGeometry = "Geometry";
-
-/**
- * @class A class representing geometry types "polygon", "line" and "point".
- *
- * @constructor
- */
-function GeomType(){
-	/**
-	 * An identifier for polygons. If you want to check if a {@link MultiGeometry}
-	 * or {@link Geometry} is a polygon, write
-	 * if (someGeometry.geomType == geomType.polygon
-	 * 
-	 * @type String
-	 */
-	this.polygon = "polygon";
-
-	/**
-	 * An identifier for polygons. If you want to check if a {@link MultiGeometry}
-	 * or {@link Geometry} is a line, write
-	 * if (someGeometry.geomType == geomType.line
-	 * 
-	 * @type String
-	 */
-	this.line = "line";
-
-	/**
-	 * An identifier for polygons. If you want to check if a {@link MultiGeometry}
-	 * or {@link Geometry} is a point, write
-	 * if (someGeometry.geomType == geomType.point
-	 * 
-	 * @type String
-	 */
-	this.point = "point";
-}
-var geomType = new GeomType();
-
-
-/**
- * @class a {@link GeometryArray} is a {@link List} of {@link MultiGeometry} objects
- *
- * @ extends List
- * @ requires MultiGeometry 
- * @ requires Geometry
- * @ requires Point
- * @ constructor
- */
-function GeometryArray(){
-
-	/*
-	 * creates a new, empty Multigeometry and adds it to this GeometryArray
-	 *
-	 * @param {String} geomType a {@link GeomType}
-	 */
-	this.addMember = function(geomType){
-		this.add(new MultiGeometry(geomType));
-	};
-	
-	/**
-	 * @ignore
-	 */
-	this.name = nameGeometryArray;
-	
-	/**
-	 * A {@link List} of {@link MultiGeometry} objects.
-	 * 
-	 * @type List
-	 */
-	this.list = [];
-}
-
-GeometryArray.prototype = new List();
-	
-/**
- * gets the j-th {@link Geometry} object of the i-th {@link MultiGeometry} object
- *
- * @param {Integer} i index of the MultiGeometry
- * @param {Integer} j index of the Geometry
- * @type Geometry 
- */
-GeometryArray.prototype.getGeometry = function(i,j){
-	var tmp = this.get(i);
-	return tmp.get(j);
-};
-
-/**
- * gets the k-th Point of the j-th {@link Geometry} object of the i-th {@link MultiGeometry} object
- *
- * @param {Integer} i index of the MultiGeometry
- * @param {Integer} j index of the Geometry
- * @param {Integer} k index of the Point
- * @type Point
- * @returns the Point object at the given indices
- */
-GeometryArray.prototype.getPoint = function(i,j,k){
-	return this.get(i).get(j).get(k);
-};
-
-/**
- * gets an Array of indices; the {@link MultiGeometry} objects at these indices are equal to geom
- *
- * @type Integer[]
- * @param {MultiGeometry} geom 
- * @returns an Array of indices
- */
-GeometryArray.prototype.findMultiGeometry = function(geom) {
-	var a = [];
-	for (var i=0; i < this.count(); i++) {
-		if (this.get(i).equals(geom)) {a.push(i);}
-	}
-	return a;
-};
-	
-/**
- * deletes the j-th {@link Geometry} object of the i-th {@link MultiGeometry} object
- *
- * @param {Integer} i index of the MultiGeometry
- * @param {Integer} j index of the Geometry
- */
-GeometryArray.prototype.delGeometry = function(i,j){
-	if (this.get(i).del(j) === false) {this.del(i);}
-};
-	
-/**
- * deletes the k-th {@link Point} of the j-th {@link Geometry} object of the i-th {@link MultiGeometry} object
- *
- * @param {Integer} i index of the MultiGeometry
- * @param {Integer} j index of the Geometry
- * @param {Integer} k index of the Point
- */
-GeometryArray.prototype.delPoint = function (i,j,k){
-	var res = this.get(i).delPoint(j,k);
-	if (res === false) {this.del(i);}
-};
-	
-/**
- * closes the current {@link MultiGeometry}. Calls method close of the {@link Geometry} class.
- *
- */
-GeometryArray.prototype.close = function(){
-	if (!this.get(-1).get(-1).close()) {
-		this.delGeometry(-1, -1);
-	}
-	else {
-		if (this.get(-1).get(-1).count() === 0) {this.get(-1).del(-1);}
-		if (this.get(-1).count() === 0) {this.del(-1);}
-	}
-	
-};
-
-/**
- * deletes all {@link Point} objects of this {@link GeometryArray} that equal point
- *
- * @param {Point} point
- */
-GeometryArray.prototype.delAllPointsLike = function(point){
-	var finished = false;
-	while (finished === false){
-		finished = true;
-		for (var i = 0 ; finished === true && i < this.count() ; i++){
-			for (var j = 0 ; finished === true && j < this.get(i).count() ; j++){
-				for (var k = 0 ; finished === true && k < this.get(i).get(j).count() ; k++){
-					if (this.getPoint(i,j,k).equals(point)){
-						this.delPoint(i,j,k);
-						finished = false;
-					}
-				}
-			} 
-		}
-	}
-};
-	
-/**
- * updates all {@link Point} objects of this {@link GeometryArray} that equal oldP to newP
- *
- * @param {Point} oldP
- * @param {Point} newP
- */
-GeometryArray.prototype.updateAllPointsLike = function(oldP, newP){
-	for (var i = 0; i < this.count(); i++){
-		this.get(i).updateAllPointsLike(oldP, newP);
-	}
-};
-
-GeometryArray.prototype.placemarkToString = function (placemarkId) {
-	var str = "{\"type\": \"Feature\", \"geometry\": ";
-
-	// get geometries with placemarkId
-	var geometriesFromPlacemark = [];
-	for (var i = 0, len = this.count(); i < len; i++) {
-		if (this.get(i).isFromKml() && this.get(i).e.getElementValueByName("Mapbender:placemarkId") == placemarkId) {
-			geometriesFromPlacemark.push(i);
-		}
-	}	
-
-	if (geometriesFromPlacemark.length > 1) {
-		str += "{\"type\": \"GeometryCollection\", \"geometries\": [";
-		for (var i = 0; i < geometriesFromPlacemark.length; i++) {
-			if (i > 0) {
-				str += ",";
-			}	
-			str += this.get(geometriesFromPlacemark[i]).placemarkToString();
-		}
-		str += "]}";
-
-		// metadata is the same for all indices...get from index 0
-		var propString = this.get(geometriesFromPlacemark[0]).e.toString();
-		if (propString) {
-			str += "," + propString;
-		}
-	}
-	else if (geometriesFromPlacemark.length === 1) {
-		str += this.get(geometriesFromPlacemark[0]).placemarkToString();
-	}
-
-	str += "}";
-	return str;
-};
-
-GeometryArray.prototype.getBBox = function(){
-	var q = this.get(0).get(0).get(0);
-	var min = cloneObject(q);
-	var max = cloneObject(q);
-	for(var i=0; i<this.count();i++){
-		var pos = this.get(i).getBBox();
-		if (pos[0].x < min.x) {min.x = pos[0].x;}
-		if (pos[1].x > max.x) {max.x = pos[1].x;}
-		if (pos[1].y > max.y) {max.y = pos[1].y;}
-		if (pos[0].y < min.y) {min.y = pos[0].y;}
-	}
-	return [min, max];
-};
-
-
-GeometryArray.prototype.importGeoJSON = function (geoJSON) {
-	var isFeatureCollection = false;
-	var featureCollectionEpsg = 4326;
-	var featureEpsg = 4326;
-	//
-	// FEATURE COLLECTION
-	//
-	for (var i in geoJSON) {
-		if (typeof(geoJSON[i]) != "function") {
-			switch (i) {
-				case "type":
-					isFeatureCollection = (geoJSON[i] == "FeatureCollection") ? true : false;
-					break;
-				case "crs":
-					if (geoJSON[i].type == "EPSG") {
-						featureCollectionEpsg = geoJSON[i].properties.code;
-						featureEpsg = geoJSON[i].properties.code;
-					}
-					break;
-				case "features":
-					if (isFeatureCollection) {
-						//
-						// FEATURE
-						//
-						var featureArray = geoJSON[i];
-						for (var j = 0; j < featureArray.length; j++) {
-							featureEpsg = featureCollectionEpsg;
-							var currentFeature = featureArray[j];
-							var isFeature = false;
-
-							for (var k in currentFeature) {
-								if (typeof(currentFeature[k]) != "function") {
-									var geometrytype;
-
-									switch(k) {
-										case "type":
-											isFeature = (currentFeature[k] == "Feature") ? true : false;
-											break;
-
-										case "properties":
-											var properties = currentFeature[k];
-											
-											// GeometryCollections are NOT YET IMPLEMENTED
-											if (geometrytype != "GeometryCollection") {
-												for (var l in properties) {
-													if (typeof(properties[l]) != "function") {
-														this.get(-1).e.setElement(l, properties[l]);
-													}
-												}
-											}
-											break;
-										
-										case "crs":
-											if (currentFeature[k].type == "EPSG") {
-												featureEpsg = currentFeature[k].properties.code;
-											}
-											break;
-
-										case "geometry":
-											if (isFeature) {
-
-												//
-												// GEOMETRY
-												//
-												var currentGeometry = currentFeature[k];
-												for (var l in currentGeometry) {
-													
-													if (typeof(currentGeometry[l]) != "function") {
-														switch (l) {
-															case "type":
-																geometrytype = currentGeometry[l];
-																break;
-															case "coordinates":
-																var coordinates = currentGeometry[l];
-																switch (geometrytype) {
-																	case "Point":
-																		//
-																		// POINT
-																		//
-																		this.addMember(geomType.point);
-																		
-																		this.get(-1).addGeometry();
-																		this.getGeometry(-1,-1).addPointByCoordinates(coordinates[0], coordinates[1]);
-																		this.getGeometry(-1,-1).setEpsg(featureEpsg);
-																		this.close();
-																		break;
-																	
-																	case "LineString":
-																		//
-																		// LINESTRING
-																		//
-																		this.addMember(geomType.line);
-																		this.get(-1).addGeometry();
-																		for (var m = 0; m < coordinates.length; m++) {
-																			var currentPoint = coordinates[m];
-																			this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
-																		}
-																		this.getGeometry(-1,-1).setEpsg(featureEpsg);
-																		this.close();
-																		break;
-																		
-																	case "MultiLineString":
-																		//
-																		// MULTILINESTRING
-																		//
-																		this.addMember(geomType.line);
-																		for (var m = 0; m < coordinates.length; m++) {
-																			this.get(-1).addGeometry();
-																			var currentLine = coordinates[m];
-																			for (var n = 0; n < currentLine.length; n++) {
-																				var currentPoint = currentLine[n];
-																				this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
-																			}
-																			this.getGeometry(-1,-1).setEpsg(featureEpsg);
-																		}
-																		this.close();
-																		break;
-																	
-																	case "Polygon":
-																		//
-																		// POLYGON
-																		//
-																		this.addMember(geomType.polygon);
-																		for (var m = 0; m < coordinates.length; m++) {
-																			this.get(-1).addGeometry();
-																			var currentPolygon = coordinates[m];
-																			for (var n = 0; n < currentPolygon.length; n++) {
-																				var currentPoint = currentPolygon[n];
-																				this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
-																			}
-																			this.getGeometry(-1,-1).setEpsg(featureEpsg);
-																		}
-																		this.close();
-																		break;
-																		
-																	case "MultiPolygon":
-																		//
-																		// MULTIPOLYGON
-																		//
-																		this.addMember(geomType.polygon);
-																		for (var m = 0; m < coordinates.length; m++) {
-																			this.get(-1).addGeometry();
-																			var currentPolygon = coordinates[m];
-																			for (var n = 0; n < currentPolygon.length; n++) {
-																				var currentPoint = currentPolygon[n];
-																				this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
-																			}
-																			this.getGeometry(-1,-1).setEpsg(featureEpsg);
-																		}
-																		this.close();
-																		break;
-							
-																	case "GeometryCollection":
-																		var exc = new Mb_exception("Geometry: GeometryCollections are not yet supported");
-																		break;
-																}
-														}
-													}
-												}
-											}
-									}
-								}
-							}
-						}
-					}
-			}
-		}
-	}
-}
-
-
-GeometryArray.prototype.toString = function () {
-	var str = "{\"type\": \"FeatureCollection\", \"features\": [";
-
-	// separate: geometries that are from a KML and those which are not
-	var multiGeometriesFromKml = [];
-	var multiGeometriesNotFromKml = [];
-	for (var i = 0, len = this.count(); i < len; i++) {
-		if (this.get(i).isFromKml()) {
-			var placemarkId = this.get(i).e.getElementValueByName("Mapbender:placemarkId");
-
-			// only add placemark ids once!
-			var isFound = false;
-			for (var j = 0; j < multiGeometriesFromKml && isFound === false; j++) {
-				if (multiGeometriesFromKml == placemarkId) {
-					isFound = true;
-				}
-			}
-			if (!isFound) {
-				multiGeometriesFromKml.push(placemarkId);
-			}
-		}
-		else {
-			multiGeometriesNotFromKml.push(i);
-		}
-	}
-
-	// add geometries not from KML
-	for (var i = 0, len = multiGeometriesNotFromKml.length; i < len; i++) {
-		if (i > 0) {
-			str += ",";
-		}		
-		str += this.get(multiGeometriesNotFromKml[i]).toString();
-	}
-	
-	// add geometries from KML
-	if (multiGeometriesNotFromKml.length > 0 && multiGeometriesFromKml.length > 0) {
-		str += ",";
-	}
-
-	for (var i=0; i < multiGeometriesFromKml.length; i++) {
-		if (i > 0) {
-			str += ",";
-		}	
-		str += this.placemarkToString();
-	}
-
-	str += "]}";
-	return str;
-};
-	
-/**
- * @class a MultiGeometry is a List of Geometry objects
- *
- * @ extends List
- * @ requires Geometry
- * @ requires Point
- * @ constructor
- * @ param {String} geomType a geomType
- */
-function MultiGeometry(geomType){
-
-	/*
-	 * creates a new, empty {@link Geometry} object and adds it to this {@link MultiGeometry}
-	 *
-	 */
-	this.addGeometry = function(){
-		this.add(new Geometry(this.geomType));
-	};
-	
-	/**
-	 * deletes the {@link Geometry} object at index i; -1 refers to the last {@link Geometry object in the list
-	 * overwrites the del function of {@link List}.
-	 *
-	 * @param {Integer} i index
-	 */
-	this.del = function(i){
-		i = this.getIndex(i);
-		if (i !== false){
-			var tmpLength = this.count() - 1;
-			for (var z = i; z < tmpLength ; z ++){
-				this.list[z] = this.list[z+1];
-				e[z] = e[z+1];
-			}
-			this.list.length -= 1;
-			if (this.list.length === 0) {return false;}
-		}
-		return true;
-	};
-
-	this.list = [];
-	this.e = new Wfs_element();
-	this.geomType = geomType;
-	this.name = nameMultiGeometry;
-}
-
-MultiGeometry.prototype = new List();
-
-/**
- * updates all {@link Point} objects of this {@link MultiGeometry} that equal oldP to newP
- *
- * @param {Point} oldP
- * @param {Point} newP
- */
-MultiGeometry.prototype.updateAllPointsLike = function(oldP, newP){
-	for (var i = 0; i < this.count(); i++) {
-		this.get(i).updateAllPointsLike(oldP, newP);
-	}
-};
-
-/**
- * gets the bounding box of this {@link MultiGeometry} as an Array of 2 points
- *
- * @return the bounding box
- * @type Array of two Point objects
- */
-MultiGeometry.prototype.getBBox = function(){
-	var q = this.get(0).get(0);
-	var min = cloneObject(q);
-	var max = cloneObject(q);
-	for(var i=0; i<this.count();i++){
-		var pos = this.get(i).getBBox();
-		if (pos[0].x < min.x) {min.x = pos[0].x;}
-		if (pos[1].x > max.x) {max.x = pos[1].x;}
-		if (pos[1].y > max.y) {max.y = pos[1].y;}
-		if (pos[0].y < min.y) {min.y = pos[0].y;}
-	}
-	return [min, max];
-};
-
-/**
- * gets the bounding box of this {@link MultiGeometry} as a polygon of four points
- *  
- * @return the bounding box
- * @type MultiGeometry
- */
-MultiGeometry.prototype.getBBox4 = function() {
-	var bbox = this.getBBox();
-	var realBox = new MultiGeometry(geomType.polygon);
-	realBox.addGeometry(geomType.polygon);
-	realBox.get(-1).addPointByCoordinates(bbox[0].x, bbox[0].y);
-	realBox.get(-1).addPointByCoordinates(bbox[0].x, bbox[1].y);
-	realBox.get(-1).addPointByCoordinates(bbox[1].x, bbox[1].y);
-	realBox.get(-1).addPointByCoordinates(bbox[1].x, bbox[0].y);
-	realBox.get(-1).close();
-	return realBox;
-};
-
-/**
- * gets the center of the bounding box of this {@link MultiGeometry}.
- *
- * @return the center of the bounding box
- * @type Point
- */
-MultiGeometry.prototype.getCenter = function(){
-	var tmp = this.getBBox();
-	var x = parseFloat(tmp[0].x) + parseFloat((tmp[1].x - tmp[0].x)/2);
-	var y = parseFloat(tmp[0].y) + parseFloat((tmp[1].y - tmp[0].y)/2);
-	return new Point(x,y);
-};
-
-/**
- * gets the total number of {@link Point} objects of this {@link MultiGeometry}.
- *
- * @return number of points
- * @type Integer
- */
-MultiGeometry.prototype.getTotalPointCount = function(){ 
-	var c = 0;
-	for (var i = 0 ; i < this.count(); i++)	{
-		c += this.get(i).count();
-	}
-	return c;
-};
-
-/**
- * gets the total number of {@link Point} objects of this {@link MultiGeometry}.
- *
- * @return number of points
- * @type Integer
- */
-MultiGeometry.prototype.getPoint = function(j,k){
-	return this.get(j).get(k);
-};
-
-/**
- * compares this {@link MultiGeometry} object with the {@link MultiGeometry} object multigeom.
- *
- * @param {MultiGeometry} multigeom another multigeometry
- * @return true if he multigeometries match; else false 
- * @type Boolean
- */
-MultiGeometry.prototype.equals = function(multigeom) {
-	if (this.geomType != multigeom.geomType) {return false;}
-	if (this.count() != multigeom.count()) {return false;}
-	if (this.getTotalPointCount() != multigeom.getTotalPointCount()) {return false;}
-	for (var i=0; i<this.count(); i++) {
-		if (!this.get(i).equals(multigeom.get(i))) {return false;}
-	}
-	return true;
-};
-
-/**
- * deletes the j-th {@link Point} object of the i-th {@link Geometry} object of this {@link MultiGeometry} object.
- *
- * @param {Integer} i geometry index
- * @param {Integer} j point index
- * @return true if the deletion succeded; else false.
- * @type Boolean
- */
-MultiGeometry.prototype.delPoint = function(i,j){
-	var res = this.get(i).del(j);
-	if (res === false) {return this.del(i);}
-	return true;
-};
-
-MultiGeometry.prototype.isFromKml = function () {
-	if (this.e.getElementValueByName("Mapbender:kml")) {
-		return true;
-	}
-	return false;
-};
-
-MultiGeometry.prototype.toString = function () {
-	var str = this.toStringWithoutProperties();
-	
-	// properties
-	var propString = this.e.toString();
-	if (propString) {
-		str += "," + propString;
-	}
-
-	str += "}";
-	
-	return str;
-};
-
-MultiGeometry.prototype.placemarkToString = function () {
-	var str = "";
-	// geometries
-	for (var i = 0, len = this.count(); i < len; i++) {
-		if (i > 0) {
-			str += ",";
-		}		
-		str += this.get(i).toString();
-	}
-	return str;
-};
-
-MultiGeometry.prototype.toStringWithoutProperties = function () {
-	var str = "{\"type\": \"Feature\", ";
-
-	var epsg = this.getEpsg();
-	if (epsg) {
-		str += "\"crs\": {\"type\": \"EPSG\", \"properties\": {\"code\": " + epsg + "}}, ";
-	}
-	str += "\"geometry\": ";
-
-	// geometries
-	for (var i = 0, len = this.count(); i < len; i++) {
-		if (i > 0) {
-			str += ",";
-		}		
-		str += this.get(i).toString();
-	}
-// this closing curly bracket is added in toString()
-//	str += "}";
-	
-	return str;
-};
-
-/**
- * @return the EPSG code of this geometry.
- * @type integer
- */
-MultiGeometry.prototype.getEpsg = function () {
-	if (this.count() > 0) {
-		return this.get(0).getEpsg();
-	}
-	return false;
-};
-
-/**
- * @class a Geometry is a List of Point objects. If it is a polygon, the last point has 
- * to equal the first point.
- *
- * @extends List
- * @requires Point
- * @constructor
- * @param {String} a string representing a geometry type, see @see GeomType.
- */
-function Geometry(aGeomtype){
-
-	/**
-	 * deletes the {@link Point} object at index i; -1 refers to the last 
-	 * {@link Point} object in the list. Overwrites the del function of 
-	 * {@link List}.
-	 *
-	 * @param {Integer} i index
-	 * @return false if deletion is not yet finished. It is cascaded to 
-	 *         {@link MultiGeometry}. True if the deletion is finished.
-	 */
-	this.del = function(i){
-		i = this.getIndex(i);
-		if (i !== false) {
-			var tmpLength = this.count()-1;
-			
-			for (var z = i; z < tmpLength ; z ++){
-				this.list[z] = this.list[z+1];
-			}
-			this.list.length -= 1;
-		
-			if (this.geomType == geomType.polygon){
-				if (i == tmpLength) {this.list[0] = this.list[tmpLength-1];}
-				else if (i === 0) {this.list[tmpLength-1] = this.list[0];}
-				if (this.list.length == 1){return false;}
-			}
-			updateDist();
-			if(this.list.length === 0) {return false;}
-			return true;
-		}
-		return false;
-	};
-
-	/**
-	 * adds a {@link Point} object to this {@link Geometry} object.
-	 *
-	 * @param {Float} x x value of the point
-	 * @param {Float} y y value of the point
-	 */	
-	this.addPointByCoordinates = function(x,y,z){
-		var newPoint = new Point(x,y,z);
-		this.add(newPoint);
-//		updateDist();
-	};
-
-	/**
-	 * adds a {@link Point} object to this {@link Geometry} object.
-	 *
-	 * @param {Point} aPoint another point
-	 */	
-	this.addPoint = function(aPoint){
-		this.add(new Point(aPoint.x, aPoint.y, aPoint.z));
-		updateDist();
-	};
-
-	/**
-	 * inserts a {@link Point} object at index i of this {@link Geometry} object.
-	 *
-	 * @param {Point} p another point
-	 * @param {Integer} i index
-	 */	
-	this.addPointAtIndex = function(p,i){
-		i = this.getIndex(i);
-		if (i !== false){
-			for(var z = this.count(); z > i; z--){
-				this.list[z] = this.list[z-1];
-			}
-			this.list[i] = new Point(p.x, p.y, p.z);
-			updateDist();
-		}
-	};
-	
-	/**
-	 * Overwrites the {@link Point) object at index i with the {@link Point} object p.
-	 *
-	 * @private
-	 * @param {Point} p another point
-	 * @param {Integer} i index
-	 */	
-	this.updatePointAtIndex = function(p, i){
-		i = this.getIndex(i);
-		if ((i === 0 || i == this.count()-1) && this.geomType == geomType.polygon){
-			this.list[0] = p;
-			this.list[this.count()-1] = p;
-		}
-		else {this.list[i] = p;}
-		updateDist();
-	};
-	
-	/**
-	 * Updates the {@link Geometry#dist} and {@link Geometry#totaldist}
-	 *
-	 * @private
-	 */	
-	var updateDist = function(){
-/*
- * DISABLED BECAUSE IT IS TOO SLOW
-		dist[0] = 0;		
-		totaldist[0] = 0;		
-		for (var i = 1 ; i < that.count(); i++){
-			dist[i] = that.get(i-1).dist(that.get(i));
-			totaldist[i] = totaldist[i-1] + dist[i];
-		}
-*/
-	};
-	/**
-	 * gets the distance between the last and last but one point of this {@link Geometry}.
-	 *
-	 * @param {Integer} numberOfDigitis round to numberOfDigits (optional)
-	 * @return the distance
-	 * @type Float
-	 */	
-	this.getCurrentDist = function(numberOfDigits) {
-		if (typeof(numberOfDigits) == "number") {
-			return roundToDigits(dist[this.count()-1], numberOfDigits);
-		}
-		return dist[this.count()-1];
-		
-	};
-	/**
-	 * gets the length of the outer rim of this {@link Geometry}.
-	 *
-	 * @param {Integer} numberOfDigitis round to numberOfDigits (optional)
-	 * @return the distance
-	 * @type Float
-	 */	
-	this.getTotalDist = function(numberOfDigits) {
-		if (typeof(numberOfDigits) == "number") {
-			return roundToDigits(totaldist[this.count()-1], numberOfDigits);
-		}
-		return totaldist[this.count()-1];
-	};
-	/**
-	 * closes this {@link Geometry}. 
-	 *
-	 * @return true if the geometry could be closed; otherwise false
-	 * @type Boolean
-	 */	
-	this.close = function(){
-		complete = true;
-		if (this.geomType == geomType.polygon){
-			if (this.count() > 2){
-				if (!this.get(0).equals(this.get(-1))) {
-					this.addPoint(this.get(0));
-				}
-			}
-			else {return false;}
-		}
-		if (this.geomType == geomType.line){
-			if (this.count() < 2){return false;}
-		}
-		return true;
-	};
-	/**
-	 * checks if this {@link Geometry} has been closed. 
-	 *
-	 * @return true if the geometry is closed; otherwise false
-	 * @type Boolean
-	 */	
-	this.isComplete = function() { 
-		return complete;
-	};
-	
-	/**
-	 * Sets the EPSG of this geometry.
-	 * 
-	 * @param {Integer} someEpsg the EPSG of this geometry.
-	 * @return true if the EPSG could be set; else false
-	 * @type boolean
-	 */
-	this.setEpsg = function (someEpsg) {
-		// TODO: how to check if EPSG code is correct?
-		if (typeof(someEpsg) == "number") {
-			epsg = someEpsg;
-			return true;
-		}
-		var e = new Mb_exception("EPSG code not valid ("+someEpsg+")");
-		return false;
-	};
-	
-	/**
-	 * @return the EPSG code of this geometry.
-	 * @type integer
-	 */
-	this.getEpsg = function () {
-		return epsg;
-	};
-	
-	this.list = [];
-	var dist = [];
-	var totaldist = [];
-	var complete = false;
-
-	var epsg;
-
-	var that = this;
-
-	this.geomType = aGeomtype;
-	this.name = nameGeometry;
-}
-
-Geometry.prototype = new List();
-
-/**
- * gets the bounding box of this {@link Geometry}
- *
- * @return the bounding box (array of two Point objects)
- * @type Point[]
- */
-Geometry.prototype.getBBox = function(){
-	var q = this.get(0);
-	var min = cloneObject(q);
-	var max = cloneObject(q);
-	
-	for (var j=0; j<this.count(); j++){
-		var pos = this.get(j);
-		if (pos.x < min.x) {min.x = pos.x;}
-		else if (pos.x > max.x) {max.x = pos.x;}
-		if (pos.y < min.y) {min.y = pos.y;}
-		else if (pos.y > max.y) {max.y = pos.y;}
-	}
-	return [min, max];
-};
-
-/**
- * updates all {@link Point} objects of this {@link Geometry} that equal oldP to newP
- *
- * @param {Point} oldP
- * @param {Point} newP
- */
-Geometry.prototype.updateAllPointsLike = function(oldP, newP){
-	var len = this.count();
-	for (var i = 0; i < len ; i++){
-		if (oldP.equals(this.get(i))){
-			if (i>0 && newP.equals(this.get(i-1))){
-				this.del(i);
-				len--;
-				i--;
-			}
-			else {this.updatePointAtIndex(newP, i);}
-		}
-	}
-};
-
-/**
- * compares this {@link Geometry} object with the {@link Geometry} object geom point by point.
- *
- * @param {Geometry} geom another geometry
- * @return true if he geometries match; else false 
- * @type Boolean
- */
-Geometry.prototype.equals = function(geom) {
-	if (this.geomType != geom.geomType) {return false;}
-	if (this.count() != geom.count()) {return false;}
-	for (var i=0; i < this.count(); i++) {
-		if (!this.get(i).equals(geom.get(i))) {return false;}
-	}
-	return true;
-};
-
-Geometry.prototype.toString = function () {
-	var str = "";
-	
-	var epsgStr = "";
-	var epsg = this.getEpsg();
-	if (epsg) {
-		epsgStr = "\"crs\": {\"type\": \"EPSG\", \"properties\": {\"code\": " + epsg + "}}, ";
-	}
-	
-	if (this.geomType == geomType.polygon) {
-		str += "{\"type\": \"Polygon\", " + epsgStr + "\"coordinates\": [[";
-		for (var i = 0; i < this.count(); i++) {
-			if (i > 0) {
-				str += ", ";
-			}
-			str += this.get(i).toString();
-		}
-		str += "]]}";
-	}
-	else if (this.geomType == geomType.line) {
-		str += "{\"type\": \"LineString\", " + epsgStr + "\"coordinates\": [";
-		for (var i = 0; i < this.count(); i++) {
-			if (i > 0) {
-				str += ", ";
-			}
-			str += this.get(i).toString();
-		}
-		str += "]}";
-	}
-	else if (this.geomType == geomType.point) {
-		str += "{\"type\": \"Point\", " + epsgStr + "\"coordinates\": ";
-		str += this.get(0).toString();
-		str += "}";
-	}
-	
-	return str;
-};
-
-
-
-/**
- * @class an array of elements, each consisting of a name/value pair
- *
- * @ constructor
- */
-function Wfs_element(){
-
-	/**
-	 * returns the number of elements of this {@link Wfs_element} object.
-	 *
-	 * @return the number of elements
-	 * @type Integer
-	 */
-	this.count = function(){
-		return name.length;
-	};
-
-	/**
-	 * returns the name of the element at index i.
-	 *
-	 * @param {Integer} i index
-	 * @return the name
-	 * @type String
-	 */
-	this.getName = function(i){ 
-		if (isValidElementIndex(i)) {return name[i];}
-		return false;
-	};
-	
-	/**
-	 * returns the value of the element at index i.
-	 *
-	 * @param {Integer} i index
-	 * @return the value
-	 */
-	this.getValue = function(i){ 
-		if (isValidElementIndex(i)) {return value[i];}
-		return false;
-	};
-
-	/**
-	 * appends a new element with a given name. If an element with this name exists, it is overwritten.
-	 *
-	 * @param {String} aName the name of the new element
-	 * @param {String} aValue the value of the new element
-	 */
-	this.setElement = function(aName, aValue){ 
-		var i = this.getElementIndexByName(aName);
-		if (i === false) {i = this.count();}
-		name[i] = aName;
-		value[i] = aValue;
-	};
-
-	/**
-	 * removes an element with a given name. If an element with this name exists, it is removed.
-	 *
-	 * @param {String} aName the name of the element to delete
-	 */
-	this.delElement = function(aName){
-		var i = this.getElementIndexByName(aName);
-		if (i !== false) {
-			name.splice(i, 1);
-			value.splice(i, 1);
-		}
-	}
-	
-	/**
-	 * checks if an index is valid
-	 *
-	 * @private
-	 * @param {Integer} i an index
-	 * @return true if the index is valid; otherwise false
-	 * @type Boolean
-	 */
-	var isValidElementIndex = function(i){ 
-		if (i>=0 && i<name.length) {return true;}
-		var e = new Mb_exception("class Wfs_element: function isValidElementIndex: illegal element index");
-		return false;
-	};
-	
-	var name  = [];
-	var value = [];
-}
-
-/**
- * gets the index of the element with a given name.
- *
- * @param {String} elementName a name
- * @return the index of the element; if no element with this name exists, false
- * @type Integer, Boolean
- */
-Wfs_element.prototype.getElementIndexByName = function(elementName){
-	for (var j = 0, len = this.count() ; j < len ; j++){
-		if (this.getName(j) == elementName) {return j;}
-	}
-	return false;
-};
-
-/**
- * gets the value of the element with a given name.
- *
- * @param {String} elementName a name
- * @return the value of the element; if no element with this name exists, false
- * @type String, Boolean
- */
-Wfs_element.prototype.getElementValueByName = function(elementName){
-	var i = this.getElementIndexByName(elementName);
-	if (i === false) {return false;}
-	return this.getValue(i);
-};
-
-Wfs_element.prototype.toString = function () {
-	var str = "";
-	if (this.count() > 0) {
-		str += "\"properties\": {";
-		
-		for (i = 0, len = this.count(); i < len; i++) {
-			if (i > 0) {
-				str += ",";
-			}		
-			var key = this.getName(i);
-			var value = this.getValue(i);
-			str += "\"" + key + "\":\"" + value + "\"";
-		}
-		str += "}";
-	}
-	return str;
-};
-
-/**
- * @class a {@link Canvas} contains a {@link DivTag} that holds graphics rendered by {@link jsGraphics}
- *
- * @constructor
- * @requires DivTag
- * @requires jsGraphics
- * @requires GeometryArray
- * @requires MultiGeometry
- * @requires Geometry
- * @param {String} aMapFrame name of the target mapframe
- * @param {String} aTagName name of the target div tag
- * @param {String} aStyle style of the div tag
- * @param {Integer} aLineWidth the line width of the jsGraphics output
- */
-function Canvas(aMapframe, aTagName, aStyle, aLineWidth) {
-	
-	/**
-	 * draws the geometry of the canvas
-	 *
-	 * @param {String} t geometry type (@see GeomType)
-	 * @param {MultiGeometry} g a MultiGeometry object
-	 * @param {String} col a color
-	 * @private
-	 */
- 	this.drawGeometry = function(t,g,col){
-		if(t == geomType.point) {
-			var poiIcon = g.e.getElementValueByName("Mapbender:icon");
-			for(var i=0, ilen = g.count(); i < ilen; i++){
-				var currentGeom = g.get(i);
-				var p = realToMap(mapframe, currentGeom.get(0));
-				var px = p.x;
-				var py = p.y;
-				var radius = diameter/2;
-				if ((px - radius < mapframeWidth && px + radius > 0 &&
-					py - radius < mapframeHeight && py + radius > 0) ||
-					(p.dist(new Point(0,0)) < radius || 
-					 p.dist(new Point(mapframeWidth, mapframeHeight)) < radius ||
-					 p.dist(new Point(0,mapframeHeight)) < radius || 
-					 p.dist(new Point(mapframeWidth, 0)) < radius
-					)
-				) {
-					// if the point contains a link to an icon, display the icon
-					if (poiIcon) {
-						displayIcon(poiIcon, px, py);
-					}
-					else {
-						drawCircle(px-1, py-1, diameter,col);
-					}
-				}
-			}
-		}
-		else if(t == geomType.line || t==geomType.polygon) {
-			for(var i=0, ilen = g.count(); i < ilen; i++){
-				var currentGeom = g.get(i);
-				var previousPoint = realToMap(mapframe, currentGeom.get(0));
-				for (var j=1, jlen = currentGeom.count(); j < jlen; j++) {
-					(function () {
-						var currentPoint = realToMap(mapframe, currentGeom.get(j));
-						
-						var pq = calculateVisibleDash(previousPoint, currentPoint, mapframeWidth, mapframeHeight);
-						if (pq) {
-							drawLine([pq[0].x-1, pq[1].x-1], [pq[0].y-1, pq[1].y-1], col);
-						}
-						previousPoint = currentPoint;
-					})();
-				}
-			}
-		}
-		else {
-			var e = new Mb_exception("class Canvas: function drawGeometry: unknown geomType " + t);
-		}
-	};
-
-	/**
-	 * checks if the MultiGeometry's bounding box width and height is smaller than minWidth
-	 *
-	 * @private
-	 * @param {MultiGeometry} g a MultiGeometry object
-	 */
-	this.isTooSmall = function(g){
-		// TODO switch between dot, original, circle
-//		return false;
-
-		var tmp = g.getBBox();
-		var min = realToMap(mapframe,tmp[0]);
-		var max = realToMap(mapframe,tmp[1]);
-		if((Math.abs(max.x - min.x) < minWidth) && (Math.abs(max.y - min.y) < minWidth)) {
-			return true;
-		}
-		return false;
-	};
-	
-	/**
-	 * gets the jsGraphics.
-	 *
-	 * @private
-	 * @return the jsGraphics
-	 * @type jsGraphics
-	 */
-	this.getCanvas = function(){
-		return canvas;
-	};
-	
-	this.setDiameter = function (px) {
-		diameter = px;
-	};
-	
-	/**
-	 * draws a circle with {@link jsGraphics}.
-	 *
-	 * @private
-	 * @param {Float} x x value of the center
-	 * @param {Float} y y value of the center
-	 * @param {Float} diameter diameter of the circle
-	 * @param {String} color the color of the circle in hex format
-	 */
-	var drawCircle = function(x, y, diameter, color) {
-		canvas.setColor(color);
-		canvas.drawEllipse(x-diameter/2,y-diameter/2,diameter,diameter);
-	};
-
-	/**
-	 * draws a polyline with {@link jsGraphics}.
-	 *
-	 * @private
-	 * @param {Array} x_array array of x values
-	 * @param {Array} y_array array of y values
-	 * @param {String} color the color of the polyline in hex format
-	 */
-	var drawLine = function(x_array, y_array, color) {
-		canvas.setColor(color);
-		canvas.drawPolyline(x_array, y_array);
-	};
-
-	/**
-	 * Displays an icon in the mapframe
-	 * 
-	 * @private
-	 * @param {String} url link to the image
-	 * @param {Float} x x coordinate within the map frame
-	 * @param {Float} y y coordinate within the map frame
-	 */
-	var displayIcon = function (url, x, y) {
-		if(ie){
-			var newImg = document.createElement("img");
-			var newImgTop = y - Math.round(80/2);
-			var newImgLeft = x - Math.round(80/2);
-			that.canvasDivTag.getTag().innerHTML = "<img src='" + url + "' style='position:absolute;top:"+newImgTop+";left:"+newImgLeft+";z-index:100'/>";
-		}
-		else{
-			var newImg = document.createElement("img");
-			newImg.src = url;
-			that.canvasDivTag.getTag().appendChild(newImg);	
-			//newImg.className = "mapsymbol";
-			//newImg.style.cursor = "help";
-			newImg.style.position = "absolute";
-			
-			// center the image at x, y
-			newImg.style.top = y - Math.round(80/2);
-			newImg.style.left = x - Math.round(80/2);
-	//		newImg.style.top = y - Math.round(80);
-	//		newImg.style.left = x;
-			newImg.style.zIndex = 100;
-		}
-	};
-	
-	/**
-	 * This is the {@link DivTag} that contains the output by {@link jsGraphics}.
-	 * 
-	 * @type DivTag
-	 */
-	this.canvasDivTag = new DivTag(aTagName, aMapframe, aStyle);
-
-	var that = this;
-
-	var diameter = 8;
-	var minWidth = 8;
-	var lineWidth = aLineWidth;
-	var mapframe = aMapframe;
-	var mapObjInd = getMapObjIndexByName(mapframe);
-	var mapframeWidth = mb_mapObj[mapObjInd].width;
-	var mapframeHeight = mb_mapObj[mapObjInd].height;
-	eventResizeMap.register(function () {
-		mapframeWidth = mb_mapObj[mapObjInd].width;
-		mapframeHeight = mb_mapObj[mapObjInd].height;
-	});
-	var style = aStyle;
-	var canvas = new jsGraphics(aTagName, window.frames[mapframe]);
-	canvas.setStroke(lineWidth);
-	mb_registerPanSubElement(aTagName);
-}
-
-/**
- * cleans the canvas by emptying the canvas {@link DivTag}.
- */
-Canvas.prototype.clean = function () {
-	this.canvasDivTag.clean();
-};
-
-/**
- * paints all geometries.
- *
- * @param {GeometryArray} gA the geometries that will be drawn
- */
-Canvas.prototype.paint = function(gA) {
-	for (var q = 0; q < gA.count(); q++) {
-		var m = gA.get(q);
-		var t = m.geomType;
-		var col = m.color;
-		if (t == geomType.point) {
-			this.drawGeometry(t,m,col);
-		}
-		else {
-			if (this.isTooSmall(m)){
-				var newMember = new MultiGeometry(geomType.point);
-				newMember.addGeometry();
-				newMember.get(-1).addPoint(m.getCenter());
-				this.drawGeometry(geomType.point,newMember,col);
-			}
-			else{
-				if(t == geomType.line) {this.drawGeometry(t,m, col);}
-				else if(t == geomType.polygon) {this.drawGeometry(t,m,col);}
-				else {
-					var e = new Mb_exception("class Canvas: function paint: unknown geomType" + t);				
-				}
-			}
-		}
-	}
-	this.getCanvas().paint();
-};
-
-/**
- * @class a {@link Highlight} object is {@link jsGraphics} rendering of a {@link GeometryArray} in various mapframes.
- *
- * @constructor
- * @requires Canvas
- * @requires GeometryArray
- * @param {Array} aTargetArray an array of Strings referring to mapframes
- * @param {String} aTagName the name of the div tags
- * @param {Object} aStyle the style of the div tags
- * @param {Integer} the line width of the jsGraphics lines
- */
-function Highlight(aTargetArray, aTagName, aStyle, aLineWidth) {
-	/**
-	 * removes a {@link MultiGeometry} object from the geometry Array
-	 *
-	 * @param {MultiGeometry} m a MultiGeometry
-	 * @param {String} color a color
-	 */	
-	this.del = function(m, color) {
-		var a = gA.findMultiGeometry(m);
-		var del = false;
-		for (var i=0; i<a.length && del === false; i++) {
-			if (gA.get(a[i]).color == color) {
-				gA.del(a[i]);
-				del = true;
-			}
-		}
-	};
-
-	/**
-	 * adds a {@link MultiGeometry} object to the geometry Array
-	 *
-	 * @param {MultiGeometry} m a MultiGeometry
-	 * @param {String} color the color of the highlight
-	 */	
-	this.add = function(m, color) {
-		gA.addCopy(m);
-		if (typeof(color) != 'undefined') {gA.get(-1).color = color;} 
-		else {gA.get(-1).color = lineColor;}
-	};
-	
-	this.hide = function () {
-		for (var i=0; i < canvas.length; i++) {
-			if (typeof(canvas[i]) == "object") {canvas[i].clean();}
-		}
-	};
-
-	/**
-	 * removes all MultiGeometries.
-	 *
-	 */	
-	this.clean = function() {
-		if (gA.count() > 0) {
-			gA = new GeometryArray();
-			this.paint();
-		}
-	};
-
-	/**
-	 * displays the highlight
-	 *
-	 */	
-	this.paint = function() {
-		this.hide();
-		for (var i=0; i < canvas.length; i++) {
-			if (typeof(canvas[i]) == "object") {canvas[i].clean();}
-		}
-		for (var i=0; i<targets.length; i++){
-			if (typeof(canvas[i]) == 'undefined') {
-				canvas[i] = new Canvas(targets[i], tagname, style, lineWidth);
-			}
-			canvas[i].paint(gA);
-		}
-	};
-
-	this.setDiameter = function (radius) {
-		for (var i = 0; i < targets.length; i++) {
-			if (typeof(canvas[i]) != "undefined") {
-				canvas[i].setDiameter(radius);
-			}
-		}
-	}
-
-	this.setMouseOver = function (callback) {
-		for (var i=0; i<targets.length; i++){
-			if (typeof(canvas[i]) !== 'undefined') {
-				canvas[i].canvasDivTag.getTag().onmouseover = function (e) {
-					callback(e);
-				};
-			}
-		}
-	};
-	
-	this.setMouseOut = function (callback) {
-		for (var i=0; i<targets.length; i++){
-			if (typeof(canvas[i]) !== 'undefined') {
-				canvas[i].canvasDivTag.getTag().onmouseout = function (e) {
-					callback(e);
-				};
-			}
-		}
-	};
-	
-	this.setMouseClick = function (callback) {
-		for (var i=0; i<targets.length; i++){
-			if (typeof(canvas[i]) !== 'undefined') {
-				canvas[i].canvasDivTag.getTag().onclick = function (e) {
-					callback(e);
-				};
-			}
-		}
-	};
-	
-	var lineWidth = aLineWidth;
-	var tagname = 'mod_gaz_draw'+aTagName;
-	var style = aStyle;
-	var targets = aTargetArray; 
-	var canvas = []; 
-	var gA = new GeometryArray(); 
-	var lineColor = "#ff0000";
-	this.paint();
-}
-
-// ----------------------------------------------------------------------------------------------------
-// Snapping
-// ----------------------------------------------------------------------------------------------------
-/**
- * @class a {@link Snapping} object stores is {@link jsGraphics} rendering of a {@link GeometryArray} in various mapframes.
- *
- * @constructor
- * @requires GeometryArray
- * @requires Highlight
- * @param {String} aTarget name of the mapframe where snapping occurs
- * @param {String} aTolerance Snapping is activated if the mouse is 
- *                 within aTolerance pixel distance to the reference point.
- * @param {String} aColor apparently deprecated?
- * @param {Integer} aZIndex the z-Index of the {@link jsGraphics} generated by {@link Highlight}.
- */
-function Snapping(aTarget, aTolerance, aColor, aZIndex){
-
-	/**
-	 * draws a circle to highlight the snapped point.
-	 * 
-	 * @param {Point} center the snapped point.
-	 * @param {Integer} radius radius of the circular highlight.
-	 */
-	this.draw = function(center,radius){ 
-		mG = new MultiGeometry(geomType.point);
-		mG.addGeometry();
-		mG.get(-1).addPoint(center);
-		highlight.add(mG,snappingColor);
-		highlight.paint();
-	};
-	this.getTolerance = function() {
-		return tolerance;
-	};
-	this.getTarget = function() {
-		return target;
-	};
-	this.cleanHighlight = function() {
-		return highlight.clean();
-	};
-	this.addPoint = function(aPoint) {
-		coord.push(aPoint);
-	};
-	this.getPointCount = function() {
-		return coord.length;
-	};
-	this.getPoint = function(i) {
-		return coord[i];
-	};
-	this.resetPoints = function() {
-		coord = [];
-	};
-	this.getNearestNeighbour = function(){
-		if (min_i != -1) {return this.getPoint(min_i);}
-		return false;
-	};
-	this.setIndexOfNearestNeighbour = function(i){
-		min_i = i;
-	};
-	this.resetIndexOfNearestNeighbour = function(){
-		min_i = -1;
-	};
-	
-	/**
-	 * @private
-	 */
-	var tolerance = (typeof(aTolerance) == 'undefined') ? 10 : aTolerance;
-
-	/**
-	 * @private
-	 */
-	var zIndex = (typeof(aZIndex) == 'undefined') ? 50 : aZIndex;
-
-	/**
-	 * @private
-	 */
-	var coord = []; 
-
-	/**
-	 * @private
-	 */
-	var min_i = -1;
-
-	/**
-	 * @private
-	 */
-	var target = aTarget;
-
-	/**
-	 * @private
-	 */
-	var snappingColor = aColor;
-	
-	/**
-	 * @private
-	 */
-	var lineWidth = 2;
-
-	/**
-	 * @private
-	 */
-	var style = {"position":"absolute", "top":"0px", "left":"0px", "z-index":zIndex};
-
-	/**
-	 * @private
-	 */
-	var highlight = new Highlight([target], "snapping"+Math.round(Math.random()*Math.pow(10,10)), style, lineWidth);
-}
-
-Snapping.prototype.check = function(currPoint){
-	var minDist = false;
-	
-	for (var i = 0 ; i < this.getPointCount() ; i++) {
-
-		var currDist = currPoint.dist(realToMap(this.getTarget(), this.getPoint(i)));
-		if (minDist === false || currDist < minDist) {
-			minDist = currDist;
-			if (minDist < this.getTolerance()) {this.setIndexOfNearestNeighbour(i);}
-		}
-	}
-	if (this.getPointCount() > 0 && minDist > this.getTolerance()) {
-		this.resetIndexOfNearestNeighbour();
-	}
-	this.cleanHighlight();
-	if (this.isSnapped()) {
-		this.draw(this.getNearestNeighbour(), this.getTolerance());
-	}
-};
-
-/**
- * Stores the points which will have the snapping property. 
- * 
- * @param {GeometryArray} geom all points of geom will be stored. May also be a 
- *                             {@link MultiGeometry} or {@link Geometry}.
- * @param {Point} point this point is excluded. Useful when moving a point of a 
- *                      geometry; you don't want to snap against the point you
- *                      move. Optional.
- */
-Snapping.prototype.store = function(geom, point){
-	this.resetPoints();
-	this.resetIndexOfNearestNeighbour();
-
-	for (var i = 0 ; i < geom.count(); i++){
-		if (geom.name == nameGeometryArray || geom.name == nameMultiGeometry){
-			for (var j = 0 ; j < geom.get(i).count() ; j++){
-				if (geom.get(i).name == nameMultiGeometry){
-					for (var k = 0 ; k < geom.get(i).get(j).count() ; k++){
-						if ((geom.get(i).get(j).isComplete() === true && typeof(point) == 'undefined') || (typeof(point) != 'undefined' && !geom.get(i).get(j).get(k).equals(point))){
-							this.add(geom.getPoint(i, j, k));
-						}
-					}
-				}
-				else {
-					if ((geom.get(i).isComplete() === true && typeof(point) == 'undefined') || (typeof(point) != 'undefined' && !geom.get(i).get(j).get(k).equals(point))){
-						this.add(geom.getPoint(i, j));
-					}
-				}
-			}
-		}
-		else {
-			if (typeof(point) != 'undefined' && !geom.get(i).get(j).get(k).equals(point)){
-				this.add(geom.get(i));
-			}
-		}
-	}
-};
-
-/**
- * Determines whether a point is within snapping distance to the mouse cursor
- * 
- * @return true if a point is within snapping distance; else false
- * @type Boolean
- */
-Snapping.prototype.isSnapped = function(){ 
-	if (this.getNearestNeighbour() !== false) {return true;}
-	return false;
-};
-
-/**
- * Returns the point that is within snapping distance and closest to the mouse cursor.
- * 
- * @return the point (if there is any); else false
- * @type Point
- */
-Snapping.prototype.getSnappedPoint = function(){
-	return this.getNearestNeighbour();
-};
-
-/**
- * Adds the point to the stored points with snapping property.
- * 
- * @param {Point} point which receives snapping property.
- */
-Snapping.prototype.add = function(aPoint){ 
-	this.addPoint(aPoint);
-};
-
-/**
- * Removes the highlight.
- */
-Snapping.prototype.clean = function(){
-	this.cleanHighlight();
-};
-
-
-
-// ----------------------------------------------------------------------------------------------------
-// misc. functions
-// ----------------------------------------------------------------------------------------------------
-
-/**
- * @ignore
- */
-function calculateVisibleDash (p0, p1, width, height) {
-	if (p0.x > p1.x) {var p_temp = p0; p0 = p1; p1 = p_temp; p_temp = null;}
-	var p = p0; var q = p1; var m; var ix; var iy;
-	if (p1.x != p0.x) {
-		m = -(p1.y-p0.y)/(p1.x-p0.x); 
-		if (p0.x < width && p1.x > 0 && !(p0.y < 0 && p1.y < 0) && !(p0.y > height && p1.y > height) ) {
-			if (p0.x < 0) {
-				iy = p0.y - m*(0-p0.x);
-				if (iy > 0 && iy < height) {p = new Point(0, iy);}
-				else if (iy > height) {
-				    ix = p0.x+((p0.y - height)/m);
-				    if (ix > 0 && ix < width) {p = new Point(ix, height);} else {return false;}
-				}
-				else if (iy < 0) {
-				    ix = p0.x+(p0.y/m);
-				    if (ix > 0 && ix < width) {p = new Point(ix, 0);} else {return false;}
-				}
-				else {return false;}
-			}
-			else if (p0.y >= 0 && p0.y <= height) {p = p0;}
-			else if (p0.y < 0) {
-			    ix = p0.x+(p0.y/m);
-			    if (ix > 0 && ix < width) {p = new Point(ix, 0);} else {return false;}
-			}
-			else if (p0.y > height && m > 0) {
-			    ix = p0.x+((p0.y - height)/m);
-			    if (ix > 0 && ix < width) {p = new Point(ix, height);} else {return false;}
-			}
-			else {return false;}
-			if (p1.x > width) {
-				iy = p1.y - m*(width-p1.x);
-				if (iy > 0 && iy < height) {q = new Point(width, iy);}
-				else if (iy < 0) {
-				    ix = p0.x+(p0.y/m);
-				    if (ix > 0 && ix < width) {q = new Point(ix, 0);} else {return false;}
-				}
-				else if (iy > height) {
-				    ix = p0.x+((p0.y - height)/m);
-				    if (ix > 0 && ix < width) {q = new Point(ix, height);} else {return false;}
-				}
-				else {return false;}
-			}
-			else if (p1.y >= 0 && p1.y <= height) {q = p1;}
-			else if (p1.y < 0) {
-			    ix = p1.x+(p1.y/m);
-			    if (ix > 0 && ix < width) {q = new Point(ix, 0);} else {return false;}
-			}
-			else if (p1.y > height) {
-			    ix = p1.x+((p1.y- height)/m);
-			    if (ix > 0 && ix < width) {q = new Point(ix, height);} else {return false;}
-			}
-		}
-		else {return false;}
-	}
-	else {
-		if (!(p0.y < 0 && p1.y < 0) && !(p0.y > height && p1.y > height)) {
-			if (p0.y < 0) {p = new Point(p0.x, 0);}
-			else if (p0.y > height) {p = new Point(p0.x, height);}
-			else {p = p0;}
-			if (p1.y < 0) {q = new Point(p0.x, 0);}
-			else if (p1.y > height) {q = new Point(p0.x, height);}
-			else {q = p1;}
-		}
-		else {return false;}
-	}
-	return [new Point(Math.round(q.x), Math.round(q.y)), new Point(Math.round(p.x), Math.round(p.y))];
-}
-
-/**
- * @ignore
- */
-function objString (a){
-	var z = "";
-	
-	for (attr in a) {
-		var b = a[attr];
-		if (typeof(b) == "object") {z += objString(b);}
-		else {z += attr + " " + b + "\n";alert(attr + " " + b);}
-	}	
-	return z;
-}
+
+var nameGeometryArray="GeometryArray";var nameMultiGeometry="MultiGeometry";var nameGeometry="Geometry";function GeomType(){this.polygon="polygon";this.line="line";this.point="point";}
+var geomType=new GeomType();function GeometryArray(){this.addMember=function(geomType){this.add(new MultiGeometry(geomType));};this.name=nameGeometryArray;this.list=[];}
+GeometryArray.prototype=new List();GeometryArray.prototype.getGeometry=function(i,j){var tmp=this.get(i);return tmp.get(j);};GeometryArray.prototype.getPoint=function(i,j,k){return this.get(i).get(j).get(k);};GeometryArray.prototype.findMultiGeometry=function(geom){var a=[];for(var i=0;i<this.count();i++){if(this.get(i).equals(geom)){a.push(i);}}
+return a;};GeometryArray.prototype.delGeometry=function(i,j){if(this.get(i).del(j)===false){this.del(i);}};GeometryArray.prototype.delPoint=function(i,j,k){var res=this.get(i).delPoint(j,k);if(res===false){this.del(i);}};GeometryArray.prototype.close=function(){if(!this.get(-1).get(-1).close()){this.delGeometry(-1,-1);}
+else{if(this.get(-1).get(-1).count()===0){this.get(-1).del(-1);}
+if(this.get(-1).count()===0){this.del(-1);}}};GeometryArray.prototype.delAllPointsLike=function(point){var finished=false;while(finished===false){finished=true;for(var i=0;finished===true&&i<this.count();i++){for(var j=0;finished===true&&j<this.get(i).count();j++){for(var k=0;finished===true&&k<this.get(i).get(j).count();k++){if(this.getPoint(i,j,k).equals(point)){this.delPoint(i,j,k);finished=false;}}}}}};GeometryArray.prototype.updateAllPointsLike=function(oldP,newP){for(var i=0;i<this.count();i++){this.get(i).updateAllPointsLike(oldP,newP);}};GeometryArray.prototype.placemarkToString=function(placemarkId){var str="{\"type\": \"Feature\", \"geometry\": ";var geometriesFromPlacemark=[];for(var i=0,len=this.count();i<len;i++){if(this.get(i).isFromKml()&&this.get(i).e.getElementValueByName("Mapbender:placemarkId")==placemarkId){geometriesFromPlacemark.push(i);}}
+if(geometriesFromPlacemark.length>1){str+="{\"type\": \"GeometryCollection\", \"geometries\": [";for(var i=0;i<geometriesFromPlacemark.length;i++){if(i>0){str+=",";}
+str+=this.get(geometriesFromPlacemark[i]).placemarkToString();}
+str+="]}";var propString=this.get(geometriesFromPlacemark[0]).e.toString();if(propString){str+=","+propString;}}
+else if(geometriesFromPlacemark.length===1){str+=this.get(geometriesFromPlacemark[0]).placemarkToString();}
+str+="}";return str;};GeometryArray.prototype.getBBox=function(){var q=this.get(0).get(0).get(0);var min=cloneObject(q);var max=cloneObject(q);for(var i=0;i<this.count();i++){var pos=this.get(i).getBBox();if(pos[0].x<min.x){min.x=pos[0].x;}
+if(pos[1].x>max.x){max.x=pos[1].x;}
+if(pos[1].y>max.y){max.y=pos[1].y;}
+if(pos[0].y<min.y){min.y=pos[0].y;}}
+return[min,max];};GeometryArray.prototype.importGeoJSON=function(geoJSON){var isFeatureCollection=false;var featureCollectionEpsg=4326;var featureEpsg=4326;for(var i in geoJSON){if(typeof(geoJSON[i])!="function"){switch(i){case"type":isFeatureCollection=(geoJSON[i]=="FeatureCollection")?true:false;break;case"crs":if(geoJSON[i].type=="EPSG"){featureCollectionEpsg=geoJSON[i].properties.code;featureEpsg=geoJSON[i].properties.code;}
+break;case"features":if(isFeatureCollection){var featureArray=geoJSON[i];for(var j=0;j<featureArray.length;j++){featureEpsg=featureCollectionEpsg;var currentFeature=featureArray[j];var isFeature=false;for(var k in currentFeature){if(typeof(currentFeature[k])!="function"){var geometrytype;switch(k){case"type":isFeature=(currentFeature[k]=="Feature")?true:false;break;case"properties":var properties=currentFeature[k];if(geometrytype!="GeometryCollection"){for(var l in properties){if(typeof(properties[l])!="function"){this.get(-1).e.setElement(l,properties[l]);}}}
+break;case"crs":if(currentFeature[k].type=="EPSG"){featureEpsg=currentFeature[k].properties.code;}
+break;case"geometry":if(isFeature){var currentGeometry=currentFeature[k];for(var l in currentGeometry){if(typeof(currentGeometry[l])!="function"){switch(l){case"type":geometrytype=currentGeometry[l];break;case"coordinates":var coordinates=currentGeometry[l];switch(geometrytype){case"Point":this.addMember(geomType.point);this.get(-1).addGeometry();this.getGeometry(-1,-1).addPointByCoordinates(coordinates[0],coordinates[1],coordinates[2]);this.getGeometry(-1,-1).setEpsg(featureEpsg);this.close();break;case"LineString":this.addMember(geomType.line);this.get(-1).addGeometry();for(var m=0;m<coordinates.length;m++){var currentPoint=coordinates[m];this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0],currentPoint[1],currentPoint[2]);}
+this.getGeometry(-1,-1).setEpsg(featureEpsg);this.close();break;case"MultiLineString":this.addMember(geomType.line);for(var m=0;m<coordinates.length;m++){this.get(-1).addGeometry();var currentLine=coordinates[m];for(var n=0;n<currentLine.length;n++){var currentPoint=currentLine[n];this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0],currentPoint[1],currentPoint[2]);}
+this.getGeometry(-1,-1).setEpsg(featureEpsg);}
+this.close();break;case"Polygon":this.addMember(geomType.polygon);for(var m=0;m<coordinates.length;m++){this.get(-1).addGeometry();var currentPolygon=coordinates[m];for(var n=0;n<currentPolygon.length;n++){var currentPoint=currentPolygon[n];this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0],currentPoint[1],currentPoint[2]);}
+this.getGeometry(-1,-1).setEpsg(featureEpsg);}
+this.close();break;case"MultiPolygon":this.addMember(geomType.polygon);for(var m=0;m<coordinates.length;m++){this.get(-1).addGeometry();var currentPolygon=coordinates[m];for(var n=0;n<currentPolygon.length;n++){var currentPoint=currentPolygon[n];this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0],currentPoint[1],currentPoint[2]);}
+this.getGeometry(-1,-1).setEpsg(featureEpsg);}
+this.close();break;case"GeometryCollection":var exc=new Mb_exception("Geometry: GeometryCollections are not yet supported");break;}}}}}}}}}}}}}}
+GeometryArray.prototype.toString=function(){var str="{\"type\": \"FeatureCollection\", \"features\": [";var multiGeometriesFromKml=[];var multiGeometriesNotFromKml=[];for(var i=0,len=this.count();i<len;i++){if(this.get(i).isFromKml()){var placemarkId=this.get(i).e.getElementValueByName("Mapbender:placemarkId");var isFound=false;for(var j=0;j<multiGeometriesFromKml&&isFound===false;j++){if(multiGeometriesFromKml==placemarkId){isFound=true;}}
+if(!isFound){multiGeometriesFromKml.push(placemarkId);}}
+else{multiGeometriesNotFromKml.push(i);}}
+for(var i=0,len=multiGeometriesNotFromKml.length;i<len;i++){if(i>0){str+=",";}
+str+=this.get(multiGeometriesNotFromKml[i]).toString();}
+if(multiGeometriesNotFromKml.length>0&&multiGeometriesFromKml.length>0){str+=",";}
+for(var i=0;i<multiGeometriesFromKml.length;i++){if(i>0){str+=",";}
+str+=this.placemarkToString();}
+str+="]}";return str;};function MultiGeometry(geomType){this.addGeometry=function(){this.add(new Geometry(this.geomType));};this.del=function(i){i=this.getIndex(i);if(i!==false){var tmpLength=this.count()-1;for(var z=i;z<tmpLength;z++){this.list[z]=this.list[z+1];e[z]=e[z+1];}
+this.list.length-=1;if(this.list.length===0){return false;}}
+return true;};this.list=[];this.e=new Wfs_element();this.geomType=geomType;this.name=nameMultiGeometry;}
+MultiGeometry.prototype=new List();MultiGeometry.prototype.updateAllPointsLike=function(oldP,newP){for(var i=0;i<this.count();i++){this.get(i).updateAllPointsLike(oldP,newP);}};MultiGeometry.prototype.getBBox=function(){var q=this.get(0).get(0);var min=cloneObject(q);var max=cloneObject(q);for(var i=0;i<this.count();i++){var pos=this.get(i).getBBox();if(pos[0].x<min.x){min.x=pos[0].x;}
+if(pos[1].x>max.x){max.x=pos[1].x;}
+if(pos[1].y>max.y){max.y=pos[1].y;}
+if(pos[0].y<min.y){min.y=pos[0].y;}}
+return[min,max];};MultiGeometry.prototype.getBBox4=function(){var bbox=this.getBBox();var realBox=new MultiGeometry(geomType.polygon);realBox.addGeometry(geomType.polygon);realBox.get(-1).addPointByCoordinates(bbox[0].x,bbox[0].y);realBox.get(-1).addPointByCoordinates(bbox[0].x,bbox[1].y);realBox.get(-1).addPointByCoordinates(bbox[1].x,bbox[1].y);realBox.get(-1).addPointByCoordinates(bbox[1].x,bbox[0].y);realBox.get(-1).close();return realBox;};MultiGeometry.prototype.getCenter=function(){var tmp=this.getBBox();var x=parseFloat(tmp[0].x)+parseFloat((tmp[1].x-tmp[0].x)/2);var y=parseFloat(tmp[0].y)+parseFloat((tmp[1].y-tmp[0].y)/2);return new Point(x,y);};MultiGeometry.prototype.getTotalPointCount=function(){var c=0;for(var i=0;i<this.count();i++){c+=this.get(i).count();}
+return c;};MultiGeometry.prototype.getPoint=function(j,k){return this.get(j).get(k);};MultiGeometry.prototype.equals=function(multigeom){if(this.geomType!=multigeom.geomType){return false;}
+if(this.count()!=multigeom.count()){return false;}
+if(this.getTotalPointCount()!=multigeom.getTotalPointCount()){return false;}
+for(var i=0;i<this.count();i++){if(!this.get(i).equals(multigeom.get(i))){return false;}}
+return true;};MultiGeometry.prototype.delPoint=function(i,j){var res=this.get(i).del(j);if(res===false){return this.del(i);}
+return true;};MultiGeometry.prototype.isFromKml=function(){if(this.e.getElementValueByName("Mapbender:kml")){return true;}
+return false;};MultiGeometry.prototype.toString=function(){var str=this.toStringWithoutProperties();var propString=this.e.toString();if(propString){str+=","+propString;}
+str+="}";return str;};MultiGeometry.prototype.placemarkToString=function(){var str="";for(var i=0,len=this.count();i<len;i++){if(i>0){str+=",";}
+str+=this.get(i).toString();}
+return str;};MultiGeometry.prototype.toStringWithoutProperties=function(){var str="{\"type\": \"Feature\", ";var epsg=this.getEpsg();if(epsg){str+="\"crs\": {\"type\": \"EPSG\", \"properties\": {\"code\": "+epsg+"}}, ";}
+str+="\"geometry\": ";for(var i=0,len=this.count();i<len;i++){if(i>0){str+=",";}
+str+=this.get(i).toString();}
+return str;};MultiGeometry.prototype.getEpsg=function(){if(this.count()>0){return this.get(0).getEpsg();}
+return false;};function Geometry(aGeomtype){this.del=function(i){i=this.getIndex(i);if(i!==false){var tmpLength=this.count()-1;for(var z=i;z<tmpLength;z++){this.list[z]=this.list[z+1];}
+this.list.length-=1;if(this.geomType==geomType.polygon){if(i==tmpLength){this.list[0]=this.list[tmpLength-1];}
+else if(i===0){this.list[tmpLength-1]=this.list[0];}
+if(this.list.length==1){return false;}}
+updateDist();if(this.list.length===0){return false;}
+return true;}
+return false;};this.addPointByCoordinates=function(x,y,z){var newPoint=new Point(x,y,z);this.add(newPoint);};this.addPoint=function(aPoint){this.add(new Point(aPoint.x,aPoint.y,aPoint.z));updateDist();};this.addPointAtIndex=function(p,i){i=this.getIndex(i);if(i!==false){for(var z=this.count();z>i;z--){this.list[z]=this.list[z-1];}
+this.list[i]=new Point(p.x,p.y,p.z);updateDist();}};this.updatePointAtIndex=function(p,i){i=this.getIndex(i);if((i===0||i==this.count()-1)&&this.geomType==geomType.polygon){this.list[0]=p;this.list[this.count()-1]=p;}
+else{this.list[i]=p;}
+updateDist();};var updateDist=function(){};this.getCurrentDist=function(numberOfDigits){if(typeof(numberOfDigits)=="number"){return roundToDigits(dist[this.count()-1],numberOfDigits);}
+return dist[this.count()-1];};this.getTotalDist=function(numberOfDigits){if(typeof(numberOfDigits)=="number"){return roundToDigits(totaldist[this.count()-1],numberOfDigits);}
+return totaldist[this.count()-1];};this.close=function(){complete=true;if(this.geomType==geomType.polygon){if(this.count()>2){if(!this.get(0).equals(this.get(-1))){this.addPoint(this.get(0));}}
+else{return false;}}
+if(this.geomType==geomType.line){if(this.count()<2){return false;}}
+return true;};this.isComplete=function(){return complete;};this.setEpsg=function(someEpsg){if(typeof(someEpsg)=="number"){epsg=someEpsg;return true;}
+var e=new Mb_exception("EPSG code not valid ("+someEpsg+")");return false;};this.getEpsg=function(){return epsg;};this.list=[];var dist=[];var totaldist=[];var complete=false;var epsg;var that=this;this.geomType=aGeomtype;this.name=nameGeometry;}
+Geometry.prototype=new List();Geometry.prototype.getBBox=function(){var q=this.get(0);var min=cloneObject(q);var max=cloneObject(q);for(var j=0;j<this.count();j++){var pos=this.get(j);if(pos.x<min.x){min.x=pos.x;}
+else if(pos.x>max.x){max.x=pos.x;}
+if(pos.y<min.y){min.y=pos.y;}
+else if(pos.y>max.y){max.y=pos.y;}}
+return[min,max];};Geometry.prototype.updateAllPointsLike=function(oldP,newP){var len=this.count();for(var i=0;i<len;i++){if(oldP.equals(this.get(i))){if(i>0&&newP.equals(this.get(i-1))){this.del(i);len--;i--;}
+else{this.updatePointAtIndex(newP,i);}}}};Geometry.prototype.equals=function(geom){if(this.geomType!=geom.geomType){return false;}
+if(this.count()!=geom.count()){return false;}
+for(var i=0;i<this.count();i++){if(!this.get(i).equals(geom.get(i))){return false;}}
+return true;};Geometry.prototype.toString=function(){var str="";var epsgStr="";var epsg=this.getEpsg();if(epsg){epsgStr="\"crs\": {\"type\": \"EPSG\", \"properties\": {\"code\": "+epsg+"}}, ";}
+if(this.geomType==geomType.polygon){str+="{\"type\": \"Polygon\", "+epsgStr+"\"coordinates\": [[";for(var i=0;i<this.count();i++){if(i>0){str+=", ";}
+str+=this.get(i).toString();}
+str+="]]}";}
+else if(this.geomType==geomType.line){str+="{\"type\": \"LineString\", "+epsgStr+"\"coordinates\": [";for(var i=0;i<this.count();i++){if(i>0){str+=", ";}
+str+=this.get(i).toString();}
+str+="]}";}
+else if(this.geomType==geomType.point){str+="{\"type\": \"Point\", "+epsgStr+"\"coordinates\": ";str+=this.get(0).toString();str+="}";}
+return str;};function Wfs_element(){this.count=function(){return name.length;};this.getName=function(i){if(isValidElementIndex(i)){return name[i];}
+return false;};this.getValue=function(i){if(isValidElementIndex(i)){return value[i];}
+return false;};this.setElement=function(aName,aValue){var i=this.getElementIndexByName(aName);if(i===false){i=this.count();}
+name[i]=aName;value[i]=aValue;};this.delElement=function(aName){var i=this.getElementIndexByName(aName);if(i!==false){name.splice(i,1);value.splice(i,1);}}
+var isValidElementIndex=function(i){if(i>=0&&i<name.length){return true;}
+var e=new Mb_exception("class Wfs_element: function isValidElementIndex: illegal element index");return false;};var name=[];var value=[];}
+Wfs_element.prototype.getElementIndexByName=function(elementName){for(var j=0,len=this.count();j<len;j++){if(this.getName(j)==elementName){return j;}}
+return false;};Wfs_element.prototype.getElementValueByName=function(elementName){var i=this.getElementIndexByName(elementName);if(i===false){return false;}
+return this.getValue(i);};Wfs_element.prototype.toString=function(){var str="";if(this.count()>0){str+="\"properties\": {";for(i=0,len=this.count();i<len;i++){if(i>0){str+=",";}
+var key=this.getName(i);var value=this.getValue(i);str+="\""+key+"\":\""+value+"\"";}
+str+="}";}
+return str;};function Canvas(aMapframe,aTagName,aStyle,aLineWidth){this.drawGeometry=function(t,g,col){if(t==geomType.point){var poiIcon=g.e.getElementValueByName("Mapbender:icon");for(var i=0,ilen=g.count();i<ilen;i++){var currentGeom=g.get(i);var p=realToMap(mapframe,currentGeom.get(0));var px=p.x;var py=p.y;var radius=diameter/2;if((px-radius<mapframeWidth&&px+radius>0&&py-radius<mapframeHeight&&py+radius>0)||(p.dist(new Point(0,0))<radius||p.dist(new Point(mapframeWidth,mapframeHeight))<radius||p.dist(new Point(0,mapframeHeight))<radius||p.dist(new Point(mapframeWidth,0))<radius)){if(poiIcon){displayIcon(poiIcon,px,py);}
+else{drawCircle(px-1,py-1,diameter,col);}}}}
+else if(t==geomType.line||t==geomType.polygon){for(var i=0,ilen=g.count();i<ilen;i++){var currentGeom=g.get(i);var previousPoint=realToMap(mapframe,currentGeom.get(0));for(var j=1,jlen=currentGeom.count();j<jlen;j++){(function(){var currentPoint=realToMap(mapframe,currentGeom.get(j));var pq=calculateVisibleDash(previousPoint,currentPoint,mapframeWidth,mapframeHeight);if(pq){drawLine([pq[0].x-1,pq[1].x-1],[pq[0].y-1,pq[1].y-1],col);}
+previousPoint=currentPoint;})();}}}
+else{var e=new Mb_exception("class Canvas: function drawGeometry: unknown geomType "+t);}};this.isTooSmall=function(g){var tmp=g.getBBox();var min=realToMap(mapframe,tmp[0]);var max=realToMap(mapframe,tmp[1]);if((Math.abs(max.x-min.x)<minWidth)&&(Math.abs(max.y-min.y)<minWidth)){return true;}
+return false;};this.getCanvas=function(){return canvas;};this.setDiameter=function(px){diameter=px;};var drawCircle=function(x,y,diameter,color){canvas.setColor(color);canvas.drawEllipse(x-diameter/2,y-diameter/2,diameter,diameter);};var drawLine=function(x_array,y_array,color){canvas.setColor(color);canvas.drawPolyline(x_array,y_array);};var displayIcon=function(url,x,y){var newImg=that.canvasDivTag.getRootNode().createElement("img");newImg.src=url;newImg.className="mapsymbol";newImg.style.cursor="help";newImg.style.position="absolute";newImg.style.top=y-Math.round(newImg.height/2);newImg.style.left=x-Math.round(newImg.width/2);newImg.style.zIndex=100;var thisTag=that.canvasDivTag.getTag();thisTag.appendChild(newImg);}
+this.canvasDivTag=new DivTag(aTagName,aMapframe,aStyle);var that=this;var diameter=8;var minWidth=8;var lineWidth=aLineWidth||2;var mapframe=aMapframe;var mapObjInd=getMapObjIndexByName(mapframe);var mapframeWidth=mb_mapObj[mapObjInd].width;var mapframeHeight=mb_mapObj[mapObjInd].height;eventResizeMap.register(function(){mapframeWidth=mb_mapObj[mapObjInd].width;mapframeHeight=mb_mapObj[mapObjInd].height;});var style=aStyle;var canvas=new jsGraphics(aTagName,window.frames[mapframe]);canvas.setStroke(lineWidth);mb_registerPanSubElement(aTagName);}
+Canvas.prototype.clean=function(){this.canvasDivTag.clean();};Canvas.prototype.paint=function(gA){for(var q=0;q<gA.count();q++){var m=gA.get(q);var t=m.geomType;var col=m.color;if(t==geomType.point){this.drawGeometry(t,m,col);}
+else{if(this.isTooSmall(m)){var newMember=new MultiGeometry(geomType.point);newMember.addGeometry();newMember.get(-1).addPoint(m.getCenter());this.drawGeometry(geomType.point,newMember,col);}
+else{if(t==geomType.line){this.drawGeometry(t,m,col);}
+else if(t==geomType.polygon){this.drawGeometry(t,m,col);}
+else{var e=new Mb_exception("class Canvas: function paint: unknown geomType"+t);}}}}
+this.getCanvas().paint();};function Highlight(aTargetArray,aTagName,aStyle,aLineWidth){this.del=function(m,color){var a=gA.findMultiGeometry(m);var del=false;for(var i=0;i<a.length&&del===false;i++){if(gA.get(a[i]).color==color){gA.del(a[i]);del=true;}}};this.add=function(m,color){gA.addCopy(m);if(typeof(color)!='undefined'){gA.get(-1).color=color;}
+else{gA.get(-1).color=lineColor;}};this.hide=function(){for(var i=0;i<canvas.length;i++){if(typeof(canvas[i])=="object"){canvas[i].clean();}}};this.clean=function(){if(gA.count()>0){gA=new GeometryArray();this.paint();}};this.paint=function(){this.hide();for(var i=0;i<canvas.length;i++){if(typeof(canvas[i])=="object"){canvas[i].clean();}}
+for(var i=0;i<targets.length;i++){if(typeof(canvas[i])=='undefined'){canvas[i]=new Canvas(targets[i],tagname,style,lineWidth);}
+canvas[i].paint(gA);}};this.setDiameter=function(radius){for(var i=0;i<targets.length;i++){if(typeof(canvas[i])!="undefined"){canvas[i].setDiameter(radius);}}}
+this.setMouseOver=function(callback){for(var i=0;i<targets.length;i++){if(typeof(canvas[i])!=='undefined'){canvas[i].canvasDivTag.getTag().onmouseover=function(e){callback(e);};}}};this.setMouseOut=function(callback){for(var i=0;i<targets.length;i++){if(typeof(canvas[i])!=='undefined'){canvas[i].canvasDivTag.getTag().onmouseout=function(e){callback(e);};}}};this.setMouseClick=function(callback){for(var i=0;i<targets.length;i++){if(typeof(canvas[i])!=='undefined'){canvas[i].canvasDivTag.getTag().onclick=function(e){callback(e);};}}};var lineWidth=aLineWidth;var tagname='mod_gaz_draw'+aTagName;var style=aStyle;var targets=aTargetArray;var canvas=[];var gA=new GeometryArray();var lineColor="#ff0000";this.paint();}
+function Snapping(aTarget,aTolerance,aColor,aZIndex){this.draw=function(center,radius){mG=new MultiGeometry(geomType.point);mG.addGeometry();mG.get(-1).addPoint(center);highlight.add(mG,snappingColor);highlight.paint();};this.getTolerance=function(){return tolerance;};this.getTarget=function(){return target;};this.cleanHighlight=function(){return highlight.clean();};this.addPoint=function(aPoint){coord.push(aPoint);};this.getPointCount=function(){return coord.length;};this.getPoint=function(i){return coord[i];};this.resetPoints=function(){coord=[];};this.getNearestNeighbour=function(){if(min_i!=-1){return this.getPoint(min_i);}
+return false;};this.setIndexOfNearestNeighbour=function(i){min_i=i;};this.resetIndexOfNearestNeighbour=function(){min_i=-1;};var tolerance=(typeof(aTolerance)=='undefined')?10:aTolerance;var zIndex=(typeof(aZIndex)=='undefined')?50:aZIndex;var coord=[];var min_i=-1;var target=aTarget;var snappingColor=aColor;var lineWidth=2;var style={"position":"absolute","top":"0px","left":"0px","z-index":zIndex};var highlight=new Highlight([target],"snapping"+Math.round(Math.random()*Math.pow(10,10)),style,lineWidth);}
+Snapping.prototype.check=function(currPoint){var minDist=false;for(var i=0;i<this.getPointCount();i++){var currDist=currPoint.dist(realToMap(this.getTarget(),this.getPoint(i)));if(minDist===false||currDist<minDist){minDist=currDist;if(minDist<this.getTolerance()){this.setIndexOfNearestNeighbour(i);}}}
+if(this.getPointCount()>0&&minDist>this.getTolerance()){this.resetIndexOfNearestNeighbour();}
+this.cleanHighlight();if(this.isSnapped()){this.draw(this.getNearestNeighbour(),this.getTolerance());}};Snapping.prototype.store=function(geom,point){this.resetPoints();this.resetIndexOfNearestNeighbour();for(var i=0;i<geom.count();i++){if(geom.name==nameGeometryArray||geom.name==nameMultiGeometry){for(var j=0;j<geom.get(i).count();j++){if(geom.get(i).name==nameMultiGeometry){for(var k=0;k<geom.get(i).get(j).count();k++){if((geom.get(i).get(j).isComplete()===true&&typeof(point)=='undefined')||(typeof(point)!='undefined'&&!geom.get(i).get(j).get(k).equals(point))){this.add(geom.getPoint(i,j,k));}}}
+else{if((geom.get(i).isComplete()===true&&typeof(point)=='undefined')||(typeof(point)!='undefined'&&!geom.get(i).get(j).get(k).equals(point))){this.add(geom.getPoint(i,j));}}}}
+else{if(typeof(point)!='undefined'&&!geom.get(i).get(j).get(k).equals(point)){this.add(geom.get(i));}}}};Snapping.prototype.isSnapped=function(){if(this.getNearestNeighbour()!==false){return true;}
+return false;};Snapping.prototype.getSnappedPoint=function(){return this.getNearestNeighbour();};Snapping.prototype.add=function(aPoint){this.addPoint(aPoint);};Snapping.prototype.clean=function(){this.cleanHighlight();};function calculateVisibleDash(p0,p1,width,height){if(p0.x>p1.x){var p_temp=p0;p0=p1;p1=p_temp;p_temp=null;}
+var p=p0;var q=p1;var m;var ix;var iy;if(p1.x!=p0.x){m=-(p1.y-p0.y)/(p1.x-p0.x);if(p0.x<width&&p1.x>0&&!(p0.y<0&&p1.y<0)&&!(p0.y>height&&p1.y>height)){if(p0.x<0){iy=p0.y-m*(0-p0.x);if(iy>0&&iy<height){p=new Point(0,iy);}
+else if(iy>height){ix=p0.x+((p0.y-height)/m);if(ix>0&&ix<width){p=new Point(ix,height);}else{return false;}}
+else if(iy<0){ix=p0.x+(p0.y/m);if(ix>0&&ix<width){p=new Point(ix,0);}else{return false;}}
+else{return false;}}
+else if(p0.y>=0&&p0.y<=height){p=p0;}
+else if(p0.y<0){ix=p0.x+(p0.y/m);if(ix>0&&ix<width){p=new Point(ix,0);}else{return false;}}
+else if(p0.y>height&&m>0){ix=p0.x+((p0.y-height)/m);if(ix>0&&ix<width){p=new Point(ix,height);}else{return false;}}
+else{return false;}
+if(p1.x>width){iy=p1.y-m*(width-p1.x);if(iy>0&&iy<height){q=new Point(width,iy);}
+else if(iy<0){ix=p0.x+(p0.y/m);if(ix>0&&ix<width){q=new Point(ix,0);}else{return false;}}
+else if(iy>height){ix=p0.x+((p0.y-height)/m);if(ix>0&&ix<width){q=new Point(ix,height);}else{return false;}}
+else{return false;}}
+else if(p1.y>=0&&p1.y<=height){q=p1;}
+else if(p1.y<0){ix=p1.x+(p1.y/m);if(ix>0&&ix<width){q=new Point(ix,0);}else{return false;}}
+else if(p1.y>height){ix=p1.x+((p1.y-height)/m);if(ix>0&&ix<width){q=new Point(ix,height);}else{return false;}}}
+else{return false;}}
+else{if(!(p0.y<0&&p1.y<0)&&!(p0.y>height&&p1.y>height)){if(p0.y<0){p=new Point(p0.x,0);}
+else if(p0.y>height){p=new Point(p0.x,height);}
+else{p=p0;}
+if(p1.y<0){q=new Point(p0.x,0);}
+else if(p1.y>height){q=new Point(p0.x,height);}
+else{q=p1;}}
+else{return false;}}
+return[new Point(Math.round(q.x),Math.round(q.y)),new Point(Math.round(p.x),Math.round(p.y))];}
+function objString(a){var z="";for(attr in a){var b=a[attr];if(typeof(b)=="object"){z+=objString(b);}
+else{z+=attr+" "+b+"\n";}}
+return z;}
\ No newline at end of file

Added: branches/print_dev/http/javascripts/geometry1.1.js
===================================================================
--- branches/print_dev/http/javascripts/geometry1.1.js	                        (rev 0)
+++ branches/print_dev/http/javascripts/geometry1.1.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1,90 @@
+
+var Geometry={Type:{isValid:function(aGeometry){try{if(aGeometry.getType()==this.point||aGeometry.getType()==this.line||aGeometry.getType()==this.polygon||aGeometry.getType()==this.multigeometry)
+{return true;}}
+catch(e){var exc=new Mb_exception("Geometry.Type.isValid: invalid geometry type for geometry: "+aGeometry+"; "+e);}
+return false;},isPoint:function(aGeometry){try{if(aGeometry.getType()==this.point){return true;}}
+catch(e){var exc=new Mb_exception("Geometry.Type.isPoint: not a point: geometry: "+aGeometry+"; "+e);}
+return false;},isLine:function(aGeometry){try{if(aGeometry.getType()==this.line){return true;}}
+catch(e){var exc=new Mb_exception("Geometry.Type.isLine: not a line: geometry: "+aGeometry+"; "+e);}
+return false;},isPolygon:function(aGeometry){try{if(aGeometry.getType()==this.polygon){return true;}}
+catch(e){var exc=new Mb_exception("Geometry.Type.isPolygon: not a polygon: geometry: "+aGeometry+"; "+e);}
+return false;},isLinearRing:function(aGeometry){try{if(aGeometry.getType()==this.linearring){return true;}}
+catch(e){var exc=new Mb_exception("Geometry.Type.isLinearRing: not a linear ring: geometry: "+aGeometry+"; "+e);}
+return false;},point:"point",line:"line",linearring:"linearring",polygon:"polygon",multigeometry:"multigeometry"},MultiGeometry:function(){this.getType=function(){return Geometry.Type.multipolygon;};this.push=function(aGeometry){if(Geometry.Type.isValid(aGeometry)){this.add(aGeometry);this.get(-1).onEmpty.register(function(){that.isEmpty();});return true;}
+return false;};this.pop=function(){return this.remove(-1);};this.remove=function(index){if(this.del(index)){this.isEmpty();return true;}
+return false;};this.isEmpty=function(){if(this.count()===0){this.onEmpty.trigger();return true;}
+return false;};this.onEmpty=new MapbenderEvent();this.list=[];},Line:function(){this.getType=function(){return Geometry.Type.line;};this.push=function(aPoint){if(Geometry.Type.isPoint(aPoint)){this.add(aPoint);this.get(-1).onEmpty.register(function(){that.rearrangeList();});return true;}
+return false;};this.remove=function(index){if(this.del(index)){return this.isEmpty();}
+return false;};this.rearrangeList=function(){var listLength=this.count();for(var i=0;i<listLength;i++){if(!this.get(i).isSet()){this.remove(i);i-=1;listLength-=1;}}};this.isEmpty=function(){if(this.count===0){this.onEmpty.trigger();return true;}
+return false;};this.onEmpty=new MapbenderEvent();this.list=[];},Polygon:function(){this.getType=function(){return Geometry.Type.polygon;};this.setOuterBoundary=function(aLinearRing){if(Geometry.Type.isLinearRing(aLinearRing)){outerBoundary=aLinearRing;outerBoundary.onEmpty.register(function(){that.isEmpty();});return true;}
+return false;};this.removeOuterBoundary=function(){outerBoundary=null;innerBoundaryArray=null;return this.onEmpty.trigger();};this.appendInnerBoundary=function(aLinearRing){innerBoundaryArray.push(aLinearRing);};this.removeInnerBoundary=function(index){return innerBoundaryArray.remove(index);};this.isEmpty=function(){if(!Geometry.Type.isLinearRing(outerBoundary)){return this.onEmpty.trigger();}
+return false;};var outerBoundary;var innerBoundaryArray=new Geometry.InnerBoundaryArray();},InnerBoundaryArray:function(){this.push=function(aLinearRing){if(Geometry.Type.isLinearRing(aLinearRing)){return this.add(aLinearRing);}
+return false;};this.remove=function(index){return this.del(index);};this.onEmpty=new MapbenderEvent();this.list=[];},LinearRing:function(){this.getType=function(){return Geometry.Type.linearring;};this.push=function(aPoint){if(Geometry.Type.isPoint(aPoint)){if(!this.isClosed()){this.add(aPoint);if(this.count()>3&&this.get(0).equals(this.get(-1))){this.close();}
+this.get(-1).onEmpty.register(function(){that.rearrangeList();});return true;}
+else{var e=new Mb_warning("Geometry.LinearRing: push: Cannot add point; linear ring is already closed!");}}
+return false;};this.remove=function(index){var i=this.getIndex(index);if(i!==false){if(i===0||i===this.getIndex(-1)){this.del(0);if(!this.isEmpty()){this.list[this.count()-1]=this.list[0];}
+return true;}
+else{return this.del(i);}}
+return false;};this.isEmpty=function(){if(this.count()===0){this.onEmpty.trigger();return true;}
+return false;};this.rearrangeList=function(){var listLength=this.count();for(var i=0;i<listLength;i++){if(!this.get(i).isSet()){this.remove(i);i-=1;listLength-=1;}}};this.close=function(){if(this.count()>3&&this.get(0).equals(this.get(-1))){closed=true;return closed;}
+else if(this.count()>2&&!this.get(0).equals(this.get(-1))){var newPoint=new Geometry.Point(this.get(0).x,this.get(0).y);this.push(newPoint);}
+else{var e=new Mb_warning("Geometry.LinearRing: close: cannot close linear ring, must have at least 3 points (triangle)");}
+return false;};this.isClosed=function(){return closed;};this.onEmpty=new MapbenderEvent();var closed=false;this.list=[];},Point:function(){this.getType=function(){return Geometry.Type.point;};this.remove=function(){onEmpty.trigger();this.x=null;this.y=null;this.onEmpty=null;};this.x=parseFloat(x);this.y=parseFloat(y);this.isSet=function(){return(this.x!==null&&this.y!==null);};this.onEmpty=new MapbenderEvent();}};Geometry.GeometryArray.prototype=new List();Geometry.MultiGeometry.prototype=new List();Geometry.InnerBoundary.prototype=new List();Geometry.LinearRing.prototype=new List();Geometry.Line.prototype=new List();Geometry.Point.prototype.dist=function(p){return Math.sqrt(Math.pow(this.y-p.y,2)+Math.pow(this.x-p.x,2));};Geometry.Point.prototype.equals=function(p){if(this.x==p.x&&this.y==p.y){return true;}
+return false;};Geometry.Point.prototype.minus=function(p){return new Point(this.x-p.x,this.y-p.y);};Geometry.Point.prototype.plus=function(p){return new Point(this.x+p.x,this.y+p.y);};Geometry.Point.prototype.dividedBy=function(c){if(c!==0){return new Point(this.x/c,this.y/c);}
+var e=new Mb_exception("Point.dividedBy: Division by zero");return false;};Geometry.Point.prototype.times=function(c){return new Point(this.x*c,this.y*c);};Geometry.Point.prototype.round=function(numOfDigits){return new Point(roundToDigits(this.x,numOfDigits),roundToDigits(this.y,numOfDigits));};Geometry.Point.prototype.toString=function(){return"("+this.x+", "+this.y+")";};function Wfs_element(){this.count=function(){return name.length;};this.getName=function(i){if(isValidElementIndex(i)){return name[i];}
+return false;};this.getValue=function(i){if(isValidElementIndex(i)){return value[i];}
+return false;};this.setElement=function(aName,aValue){var i=this.getElementIndexByName(aName);if(i===false){i=this.count();}
+name[i]=aName;value[i]=aValue;};var isValidElementIndex=function(i){if(i>=0&&i<name.length){return true;}
+var e=new Mb_exception("class Wfs_element: function isValidElementIndex: illegal element index");return false;};var name=[];var value=[];}
+Wfs_element.prototype.getElementIndexByName=function(elementName){for(var j=0;j<this.count();j++){if(this.getName(j)==elementName){return j;}}
+return false;};Wfs_element.prototype.getElementValueByName=function(elementName){var i=this.getElementIndexByName(elementName);if(i===false){return false;}
+return this.getValue(i);};function Canvas(aMapframe,aTagName,aStyle,aLineWidth){this.drawGeometry=function(t,g,col){var mapObjInd=getMapObjIndexByName(mapframe);width=mb_mapObj[mapObjInd].width;height=mb_mapObj[mapObjInd].height;for(var i=0;i<g.count();i++){if(t==geomType.point){var p=realToMap(mapframe,g.get(i).get(0));if(p.x+diameter<mb_mapObj[mapObjInd].width&&p.x-diameter>0&&p.y+diameter<mb_mapObj[mapObjInd].height&&p.y-diameter>0){drawCircle(p.x-1,p.y-1,diameter,col);}}
+else if(t==geomType.line||t==geomType.polygon){for(var j=0;j<g.get(i).count()-1;j++){var pq=calculateVisibleDash(realToMap(mapframe,g.get(i).get(j)),realToMap(mapframe,g.get(i).get(j+1)),width,height);if(pq){drawLine([pq[0].x-1,pq[1].x-1],[pq[0].y-1,pq[1].y-1],col);}}}
+else{var e=new Mb_exception("class Canvas: function drawGeometry: unknown geomType "+t);}}};this.isTooSmall=function(g){var tmp=g.getBBox();var min=realToMap(mapframe,tmp[0]);var max=realToMap(mapframe,tmp[1]);if((Math.abs(max.x-min.x)<minWidth)&&(Math.abs(max.y-min.y)<minWidth)){return true;}
+return false;};this.getCanvas=function(){return canvas;};var drawCircle=function(x,y,diameter,color){canvas.setColor(color);canvas.drawEllipse(x-diameter/2,y-diameter/2,diameter,diameter);};var drawLine=function(x_array,y_array,color){canvas.setColor(color);canvas.drawPolyline(x_array,y_array);};this.canvasDivTag=new DivTag(aTagName,aMapframe,aStyle);var that=this;var diameter=8;var minWidth=8;var lineWidth=aLineWidth;var mapframe=aMapframe;var style=aStyle;var canvas=new jsGraphics(aTagName,window.frames[mapframe]);canvas.setStroke(lineWidth);mb_registerPanSubElement(aTagName);}
+Canvas.prototype.clean=function(){this.canvasDivTag.clean();};Canvas.prototype.paint=function(gA){for(var q=0;q<gA.count();q++){var m=gA.get(q);var t=m.geomType;var col=m.color;if(t==geomType.point){this.drawGeometry(t,m,col);}
+else{if(this.isTooSmall(m)){var newMember=new MultiGeometry(geomType.point);newMember.addGeometry();newMember.get(-1).addPoint(m.getCenter());this.drawGeometry(geomType.point,newMember,col);}
+else{if(t==geomType.line){this.drawGeometry(t,m,col);}
+else if(t==geomType.polygon){this.drawGeometry(t,m,col);}
+else{var e=new Mb_exception("class Canvas: function paint: unknown geomType"+t);}}}}
+this.getCanvas().paint();};function Highlight(aTargetArray,aTagName,aStyle,aLineWidth){this.del=function(m,color){var a=gA.findMultiGeometry(m);var del=false;for(var i=0;i<a.length&&del===false;i++){if(gA.get(a[i]).color==color){gA.del(a[i]);del=true;}}
+this.paint();};this.add=function(m,color){gA.addCopy(m);if(typeof(color)!='undefined'){gA.get(-1).color=color;}
+else{gA.get(-1).color=lineColor;}
+this.paint();};this.clean=function(){if(gA.count()>0){gA=new GeometryArray();this.paint();}};this.paint=function(){for(var i=0;i<canvas.length;i++){if(typeof(canvas[i])=="object"){canvas[i].clean();}}
+for(var i=0;i<targets.length;i++){if(typeof(canvas[i])=='undefined'){canvas[i]=new Canvas(targets[i],tagname,style,lineWidth);}
+canvas[i].paint(gA);}};var lineWidth=aLineWidth;var tagname='mod_gaz_draw'+aTagName;var style=aStyle;var targets=aTargetArray;var canvas=[];var gA=new GeometryArray();var lineColor="#ff0000";this.paint();}
+function Snapping(aTarget,aTolerance,aColor,aZIndex){this.draw=function(center,radius){mG=new MultiGeometry(geomType.point);mG.addGeometry();mG.get(-1).addPoint(center);highlight.add(mG);};this.getTolerance=function(){return tolerance;};this.getTarget=function(){return target;};this.cleanHighlight=function(){return highlight.clean();};this.addPoint=function(aPoint){coord.push(aPoint);};this.getPointCount=function(){return coord.length;};this.getPoint=function(i){return coord[i];};this.resetPoints=function(){coord=[];};this.getNearestNeighbour=function(){if(min_i!=-1){return this.getPoint(min_i);}
+return false;};this.setIndexOfNearestNeighbour=function(i){min_i=i;};this.resetIndexOfNearestNeighbour=function(){min_i=-1;};var tolerance=(typeof(aTolerance)=='undefined')?10:aTolerance;var zIndex=(typeof(aZIndex)=='undefined')?50:aZIndex;var coord=[];var min_i=-1;var target=aTarget;var lineWidth=2;var style={"position":"absolute","top":"0px","left":"0px","z-index":zIndex};var highlight=new Highlight([target],"snapping"+Math.round(Math.random()*Math.pow(10,10)),style,lineWidth);}
+Snapping.prototype.check=function(currPoint){var minDist=false;for(var i=0;i<this.getPointCount();i++){var currDist=currPoint.dist(realToMap(this.getTarget(),this.getPoint(i)));if(minDist===false||currDist<minDist){minDist=currDist;if(minDist<this.getTolerance()){this.setIndexOfNearestNeighbour(i);}}}
+if(this.getPointCount()>0&&minDist>this.getTolerance()){this.resetIndexOfNearestNeighbour();}
+this.cleanHighlight();if(this.isSnapped()){this.draw(this.getNearestNeighbour(),this.getTolerance());}};Snapping.prototype.store=function(geom,point){this.resetPoints();this.resetIndexOfNearestNeighbour();for(var i=0;i<geom.count();i++){if(geom.name==nameGeometryArray||geom.name==nameMultiGeometry){for(var j=0;j<geom.get(i).count();j++){if(geom.get(i).name==nameMultiGeometry){for(var k=0;k<geom.get(i).get(j).count();k++){if((geom.get(i).get(j).isComplete()===true&&typeof(point)=='undefined')||(typeof(point)!='undefined'&&!geom.get(i).get(j).get(k).equals(point))){this.add(geom.getPoint(i,j,k));}}}
+else{if((geom.get(i).isComplete()===true&&typeof(point)=='undefined')||(typeof(point)!='undefined'&&!geom.get(i).get(j).get(k).equals(point))){this.add(geom.getPoint(i,j));}}}}
+else{if(typeof(point)!='undefined'&&!geom.get(i).get(j).get(k).equals(point)){this.add(geom.get(i));}}}};Snapping.prototype.isSnapped=function(){if(this.getNearestNeighbour()!==false){return true;}
+return false;};Snapping.prototype.getSnappedPoint=function(){return this.getNearestNeighbour();};Snapping.prototype.add=function(aPoint){this.addPoint(aPoint);};Snapping.prototype.clean=function(){this.cleanHighlight();};function calculateVisibleDash(p0,p1,width,height){if(p0.x>p1.x){var p_temp=p0;p0=p1;p1=p_temp;p_temp=null;}
+var p=p0;var q=p1;var m;var ix;var iy;if(p1.x!=p0.x){m=-(p1.y-p0.y)/(p1.x-p0.x);if(p0.x<width&&p1.x>0&&!(p0.y<0&&p1.y<0)&&!(p0.y>height&&p1.y>height)){if(p0.x<0){iy=p0.y-m*(0-p0.x);if(iy>0&&iy<height){p=new Point(0,iy);}
+else if(iy>height){ix=p0.x+((p0.y-height)/m);if(ix>0&&ix<width){p=new Point(ix,height);}else{return false;}}
+else if(iy<0){ix=p0.x+(p0.y/m);if(ix>0&&ix<width){p=new Point(ix,0);}else{return false;}}
+else{return false;}}
+else if(p0.y>=0&&p0.y<=height){p=p0;}
+else if(p0.y<0){ix=p0.x+(p0.y/m);if(ix>0&&ix<width){p=new Point(ix,0);}else{return false;}}
+else if(p0.y>height&&m>0){ix=p0.x+((p0.y-height)/m);if(ix>0&&ix<width){p=new Point(ix,height);}else{return false;}}
+else{return false;}
+if(p1.x>width){iy=p1.y-m*(width-p1.x);if(iy>0&&iy<height){q=new Point(width,iy);}
+else if(iy<0){ix=p0.x+(p0.y/m);if(ix>0&&ix<width){q=new Point(ix,0);}else{return false;}}
+else if(iy>height){ix=p0.x+((p0.y-height)/m);if(ix>0&&ix<width){q=new Point(ix,height);}else{return false;}}
+else{return false;}}
+else if(p1.y>=0&&p1.y<=height){q=p1;}
+else if(p1.y<0){ix=p1.x+(p1.y/m);if(ix>0&&ix<width){q=new Point(ix,0);}else{return false;}}
+else if(p1.y>height){ix=p1.x+((p1.y-height)/m);if(ix>0&&ix<width){q=new Point(ix,height);}else{return false;}}}
+else{return false;}}
+else{if(!(p0.y<0&&p1.y<0)&&!(p0.y>height&&p1.y>height)){if(p0.y<0){p=new Point(p0.x,0);}
+else if(p0.y>height){p=new Point(p0.x,height);}
+else{p=p0;}
+if(p1.y<0){q=new Point(p0.x,0);}
+else if(p1.y>height){q=new Point(p0.x,height);}
+else{q=p1;}}
+else{return false;}}
+return[new Point(Math.round(q.x),Math.round(q.y)),new Point(Math.round(p.x),Math.round(p.y))];}
+function objString(a){var z="";for(attr in a){var b=a[attr];if(typeof(b)=="object"){z+=objString(b);}
+else{z+=attr+" "+b+"\n";alert(attr+" "+b);}}
+return z;}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/jsTree.js
===================================================================
--- branches/print_dev/http/javascripts/jsTree.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/jsTree.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,697 +1,253 @@
-/***************************************************************
-# $Id$
-*  http://www.mapbender.org/index.php/Mod_treefolder2.php
-*
-*  Copyright notice
-*  (c) 2003-2004 Tobias Bender (tobias at phpXplorer.org)
-*  All rights reserved
-*
-*  This script is part of the jsTree project. The jsTree project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt distributed with these scripts.
-*
-*  This script 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.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-var jst_cm
-var jst_cmT
-var jst_activeNode
-var jst_reload_strData = ""
-var jst_reload_ctlImage
-var jst_reload_halt = false
-var jst_any_expanded
-var jst_expandAll_int
-var jst_loaded = false
-var jst_state_paths = new Array()
-
-var jst_delimiter = ["|", "<|>"]
-var jst_id = "jsTree"
-var jst_container = "document.body"
-var jst_data = "arrNodes"
-var jst_expandAll_warning = "Expanding all nodes can take a while depending on your hardware! Continue?"
-var jst_target
-var jst_context_menu
-var jst_display_root = true
-var jst_highlight = true
-var jst_highlight_color = "white"
-var jst_highlight_bg = "navy"
-var jst_highlight_padding = "1px"
-var jst_image_folder = "./images"
-var jst_reloading = false
-var jst_reload_frame = "reLoader"
-var jst_reload_script = "tree_jsTree_reload.php"
-var jst_reloading_status = "loading tree nodes ..."
-
-function absTop(nd){
-	return nd.offsetParent ? nd.offsetTop + absTop(nd.offsetParent) : nd.offsetTop
-}
-
-function nodeClick(nd){
-	if(jst_highlight){
-		if(jst_activeNode){
-			jst_activeNode.style.color = ""
-			jst_activeNode.style.backgroundColor = ""
-			nd.style.padding = ""
-		}
-		nd.style.color = jst_highlight_color
-		nd.style.backgroundColor = jst_highlight_bg
-		nd.style.padding = jst_highlight_padding
-		jst_activeNode = nd
-	}
-//	if(childExists(nd.parentNode.parentNode))
-//		window.scrollTo(0, absTop(nd) - 5)
-}
-
-function _getDefinition(data, depth){
-
-	var d = new Array()
-
-	if(!data)
-		return ""
-
-	var sD = ""
-	for(var i = 0; i < depth; i++)
-		sD += '\t'
-
-	if(data != eval(jst_data))
-		d.push(",")
-
-	d.push("\n" + sD + "[")
-
-	var nodes = new Array()
-
-	for(var n1 in data){
-
-		var infos = new Array()
-
-		for(var i = 0; i < 5; i++)
-			infos.push(data[n1][1][i] ? "'" + data[n1][1][i].replace(/\n/g, '\\' + 'n') + "'" : null)
 
-		infos.push(null);
-		
-		if(data[n1][1][6]){
-			infos.push("'"+data[n1][1][6]+"'");
-//TODO checked and disabled state
-		}else{
-			infos.push(null);
-		}
-
-		for(var i = 6; i > 0; i--)
-			if(!infos[i]){
-				infos.pop()
-			}else{
-				break
-			}
-
-		nodes.push("\n" + sD + "\t['" + data[n1][0].replace(/\'/g, '\\' + "'") + "', [" + infos.join(",") + "]" + _getDefinition(data[n1][2], depth + 1) + "]")
-	}
-	
-	d.push(nodes.join(",") + "\n" + sD + "]")
-
-	return d.join("")
-}
-
-function getDefinition(){
-	return jst_data + "=" + _getDefinition(eval(jst_data), 0)
-}
-
-function getDomNode(path){
-	var parts = path.split(jst_delimiter[0]);
-	var tr = document.getElementById(parts[parts.length-1]);	
-	if(tr)
-		return tr;
-	var tBody = get1stTBody()
-	for(var p = 0; p < parts.length; p++){
-		for(var c = 0; c < tBody.childNodes.length; c++){
-			var tr = tBody.childNodes[c]
-			if(tr.id == parts[p]){
-				if(p == parts.length - 1){
-					return tr
-				}else{
-					if(!childExists(tr))
-						return null;
-					tBody = tBody.childNodes[c + 1].childNodes[1].firstChild.firstChild
-
-					if(!tBody)
-						return null
-				}
-				break
-			}
-		}
-	}
-	return null
-}
-
-function delArrItem(a, p){
-	var b = a.slice(0, p)
-	var e = a.slice(p + 1)
-	return b.concat(e)
-}
-function addArrItem(a, p, v){
-	var b = a.slice(0, p)
-	var e=a.slice(p)
-	b[b.length] = v
-	return b.concat(e)
-}
-
-function _editDataNode(action, path, nd){
-	var ps = jst_data
-	var parts = path.split(jst_delimiter[0])
-
-	for(var p = 0; p < parts.length; p++){
-		var arrData = eval(ps)
-		
-	  for(var d = 0; d < arrData.length; d++)
-			if(parts[p] == arrData[d][0]){
-
-				if(p == parts.length - 1){
-
-					switch(action){
-						case "d":
-							if(ps != jst_data)
-								eval(ps + "=delArrItem(" + ps + "," + d + ")")
-						break;
-						case "a":
-							if(!eval(ps)[d][2])
-								eval(ps)[d].push(new Array())
-							eval(ps)[d][2].push(nd)
-						break;
-						case "u":
-							if(!eval(ps)[d][2])
-								eval(ps)[d].push(new Array())
-							eval(ps)[d][2].unshift(nd)
-						break;
-					}
-					return true
-					
-					
-				}else{
-					ps = ps + "[" + d + "][2]"
-				}
-				break
-
-			}
-	}
-	return false
-}
-
-function addNode(path, nd, sel, refresh, begining){
-	if(_editDataNode((begining?"u":"a"), path, nd)){
-		if(refresh){	
-			rebuildNode(path, true)
-			rebuildNode(path)
-		}
-
-		if(sel)
-			nodeClick(getDomNode(path + jst_delimiter[0] + nd[0]).childNodes[1].childNodes[1])
-	}
-}
-
-
-function deleteNode(path){
-	if(_editDataNode("d", path))
-		rebuildNode(path, true)
-}
-
-function _getState(tBody, path){
-	var hasSub = false
-	
-	for(var c = 0; c < tBody.childNodes.length; c++){
-		var tr = tBody.childNodes[c]
-		if(childExists(tr) && isExpanded(tr)){
-			_getState(tBody.childNodes[c + 1].childNodes[1].firstChild.firstChild, path + (path != "" ? jst_delimiter[0] : "") + tr.id)
-			hasSub = true
-		}
-	}
-	if(!hasSub)
-		jst_state_paths.push(path)
-}
-
-function getState(){
-	jst_state_paths = new Array()
-	_getState(get1stTBody(), "")
-	return jst_state_paths.join(jst_delimiter[1])
-}
-
-function setState(data){
-	jst_state_paths = data.split(jst_delimiter[1])
-	for(var p in jst_state_paths){
-		var path="";
-		var pathElements = jst_state_paths[p].split(jst_delimiter[0]);
-		for(i in pathElements){
-			path += pathElements[i];
-			var tr = getDomNode(path)
-			
-			if(tr){
-				var f1 = tr.firstChild
-				if(f1){
-					var f2 = f1.firstChild
-					if(!isExpanded(tr) && f2)
-						if(f2.onclick)
-							f2.onclick()
-				}
-			}
-			path+=jst_delimiter[0];
-		}
-	}
-}
-
-function rebuildNode(path, parent){
-	if(parent){
-		var arrPath = path.split(jst_delimiter[0])
-		arrPath.pop()
-		path = arrPath.join(jst_delimiter[0])
-	}
-	
-	if(path.split(jst_delimiter[0]).length<=1){
-		renderTree()
-	}else{
-	
-		var nd = getDomNode(path)
-	
-		if(nd){
-			var nn = nd.nextSibling
-
-			if(nn){
-				var nCh = nn.childNodes[1].firstChild
-				if(nCh.nodeName == "TABLE")
-					nd.parentNode.parentNode.deleteRow(nn.rowIndex)
-			}
-			if(nd.firstChild.firstChild.onclick)
-				nd.firstChild.firstChild.onclick()
-		}
-	}
-}
-
-function setNodeColor(path, color){
-	var nd = getDomNode(path)
-	if(nd){
-		nd.childNodes[1].childNodes[nd.childNodes[1].childNodes.length-1].style.color=color;
-	}
-}
-
-function setNodeImage(path, Img){
-	var ps = jst_data;
-	var parts = path.split(jst_delimiter[0])
-	var arrData = null;
-
-	for(var p = 0; p < parts.length; p++){
-		arrData = eval(ps);
-		for(var d = 0; d < arrData.length; d++){
-			if(parts[p] == arrData[d][0]){
-				if(p == parts.length - 1){
-					eval(ps)[d][1][3]=Img;
-					var nd = getDomNode(path);
-					if(nd){
-						var cb = nd.childNodes[1].childNodes[0];
-						if(cb && cb.nodeName=="IMG"){
-							if(Img)
-								cb.src=jst_image_folder+"/"+Img;
-							else if(eval(ps)[d][2]){
-								if(childExists(nd)){
-									var s = nd.nextSibling.style
-									if(s.display == ""){
-										cb.src = jst_image_folder + "/expanded_folder.png";
-									}else{
-										cb.src = jst_image_folder + "/closed_folder.png";
-									}
-								}else{
-									cb.src = jst_image_folder + "/expanded_folder.png";
-								}
-							}
-							else
-								rebuildNode(path, true);
-						}
-						else 
-							rebuildNode(path, true);
-					}
-					return true
-				}else{
-					ps = ps + "[" + d + "][2]"
-				}
-				break;
-			}
-		}
-	}
-	return false
-}
-
-function selectNode(path){
-	var nd = getDomNode(path)
-	if(nd){
-		nodeClick(nd.childNodes[1].childNodes[nd.childNodes[1].childNodes.length-1])
-		return true
-	}else{
-		return false
-	}
-}
-
-function IsChecked(path, ctrlNr){
-	var nd = getDomNode(path)
-	if(nd){
-		var fc = nd.childNodes[1].firstChild;
-		if(fc && fc.nodeName=="IMG")ctrlNr++;
-		var cb = nd.childNodes[1].childNodes[ctrlNr];
-		if(cb && cb.nodeName=="INPUT"){
-			return cb.checked;
-		}
-	}
-	return false;
-}
-
-//getChildrenCheckState returns:
-//	1:if each child with checkbox ctrlNr is checked
-//	0:if none is checked
-// -1:if states are different or ctrlNr is no checkbox or any other error
-function getChildrenCheckState(path, ctrlNr){
-	var state = -1;
-	var plus=0;
-	var nd = getDomNode(path);
-
-	if(!nd)return -1;
-	if(!childExists(nd))return -1;
-	var tBody = nd.nextSibling.childNodes[1].firstChild.firstChild;
-	if(!tBody)return -1;
-	for(var i = 0;i < tBody.childNodes.length; i++){
-		var fc = tBody.childNodes[i].childNodes[1].firstChild;
-		plus=0;
-		if(fc && fc.nodeName=="IMG")plus++;
-		var cb = tBody.childNodes[i].childNodes[1].childNodes[ctrlNr+plus];
-		if(cb && cb.nodeName=="INPUT"){
-			if(state == -1) 
-				state = cb.checked?1:0;
-			else{
-				if(state != cb.checked?1:0)
-					return -1;
-			}
-			
-		}		
-	}
-	return state;
-}
-
-function checkChildren(path, ctrlNr, bChk){
-	var nd = getDomNode(path);
-	var plus;
-	
-	if(!nd)return false;
-	if(!childExists(nd))return false;
-	var tBody = nd.nextSibling.childNodes[1].firstChild.firstChild;
-	if(!tBody)return false;
-	for(var i = 0;i < tBody.childNodes.length; i++){
-		var fc = tBody.childNodes[i].childNodes[1].firstChild;
-		plus=0;
-		if(fc && fc.nodeName=="IMG")plus++;
-		var cb = tBody.childNodes[i].childNodes[1].childNodes[ctrlNr+plus];
-		if(cb && cb.nodeName=="INPUT"&&!cb.disabled){
-			cb.checked = bChk;	
-			if(cb.onclick){cb.onclick();}
-		}		
-	}
-	return true;
-}
-
-function checkNode(path, ctrlNr, bChk){
-	var nd = getDomNode(path)
-	if(nd){
-		var fc = nd.childNodes[1].firstChild;
-		if(fc && fc.nodeName=="IMG")ctrlNr++;
-		var cb = nd.childNodes[1].childNodes[ctrlNr];
-		if(cb && cb.nodeName=="INPUT"){
-			cb.checked = bChk;
-			if(cb.onclick)cb.onclick();
-//TODO DataNode anpassen
-			return true;
-		}
-	}
-	return false;
-}
-
-function enableCheckbox(path, ctrlNr, pEnabled){
-	var nd = getDomNode(path)
-	if(nd){
-		var fc = nd.childNodes[1].firstChild;
-		if(fc && fc.nodeName=="IMG")ctrlNr++;
-		var cb = nd.childNodes[1].childNodes[ctrlNr];
-		if(cb && cb.nodeName=="INPUT"){
-			cb.disabled = !pEnabled;
-//TODO DataNode anpassen
-			return true;
-		}
-	}
-	return false;	
-}
-
-
-
-function get1stTBody(){
-	return eval(jst_container).firstChild.firstChild.childNodes[1].childNodes[1].firstChild.firstChild
-}
-
-function __switchAll(tBody, expand){
-	if(!tBody)
-		return false
-
-	for(var c = 0; c < tBody.childNodes.length; c++){
-		var tr = tBody.childNodes[c]
-		var img = tr.firstChild.firstChild
-
-		if(img)
-			if(img.onclick){
-				if((expand && !childExists(tr)) || ((expand && !isExpanded(tr)) || (!expand && isExpanded(tr)))){
-					if(img.id != "rootImage")
-						img.onclick()
-						
-					jst_any_expanded = true
-				}
-				
-				if(tBody.childNodes[c + 1])
-					__switchAll(tBody.childNodes[c + 1].childNodes[1].firstChild.firstChild, expand)
-			}
-	}
-}
-
-function _switchAll(expand){
-	if(jst_reload_halt)
-		return
-
-	__switchAll(get1stTBody(), expand)
-	
-	if(jst_reloading){
-		if(!jst_any_expanded)
-			cancelExpandAll()
-
-		jst_any_expanded = null
-	}
-}
-
-function expandAll(){
-	if(jst_expandAll_warning ? confirm(jst_expandAll_warning) : true)	
-		if(jst_reloading){
-			jst_expandAll_int = window.setInterval("if(!jst_reload_halt)_switchAll(true)", 100)
-		}else{
-			_switchAll(true)
-		}
-}
-
-function cancelExpandAll(){
-	if(jst_expandAll_int)
-		window.clearInterval(jst_expandAll_int)
-}
-
-function closeAll(){
-	_switchAll(false)
-}
-
-function isExpanded(tr){
-	return childExists(tr) ? tr.nextSibling.style.display != "none" : false
-}
-
-function childExists(tr){
-	try{
-		return tr.nextSibling.childNodes[1].firstChild.nodeName == "TABLE"
-	}catch(e){
-		return false
-	}
-}
-
-function getPath(strData){
-	if(strData.indexOf("[") > 0){
-		
-		var sub3 = strData.substr(0, strData.lastIndexOf("["))
-		var sub6 = sub3.substr(0, sub3.lastIndexOf("["))
-		
-		return (getPath(sub6) != "" ? getPath(sub6) + jst_delimiter[0] : "") + eval(sub3 + "[0]")
-	}else{
-		return ""
-	}
-}
-
-function reloadCallback(){
-
-	eval(jst_reload_strData + "=window.frames['" + jst_reload_frame + "']." + jst_data)
-	
-	renderNode(jst_reload_strData, jst_reload_ctlImage, null, true)
-	
-	window.status = ""
-	
-	jst_reload_halt = false
-	jst_reload_strData = ""
-	jst_reload_ctlImage = null
-}
-
-function renderNode(strData, ctlImg, event, reload){
-
-	if(event)
-		event.cancelBubble = true
-
-	if(jst_reload_halt && !reload)
-		return
-
-	jst_loaded = false
-
-	if(jst_reloading && !reload && eval(strData).length == 0){
-		jst_reload_strData = strData
-		jst_reload_ctlImage = ctlImg
-		jst_reload_halt = true
-		if(jst_reloading_status)
-			window.status = jst_reloading_status
-
-		window.frames[jst_reload_frame].document.location.href = "./" + jst_reload_script + (jst_reload_script.indexOf("?") > -1 ? "&" : "?") + "path=" + getPath(strData)
-		return
-	}
-
-	var tr = ctlImg.parentNode.parentNode
-
-	if(ctlImg.id != "rootFolder"){
-		var fldImg = tr.childNodes[1].firstChild
-
-		if(childExists(tr)){
-			var s = tr.nextSibling.style
-			var img1 = jst_image_folder + "/" + (tr.nextSibling.nextSibling ? "" : "last_")
-
-			if(s.display == ""){
-				s.display = "none"
-				ctlImg.src = img1 + "closed.png"
-				if(eval(strData.substr(0, strData.length-3)+"[1][3]"))
-					fldImg.src = jst_image_folder + "/" + eval(strData.substr(0, strData.length-3)+"[1][3]");
-				else
-					fldImg.src = jst_image_folder + "/closed_folder.png";
-			}else{
-				s.display = ""
-				ctlImg.src = img1 + "expanded.png"
-				if(eval(strData.substr(0, strData.length-3)+"[1][3]"))
-					fldImg.src = jst_image_folder + "/" + eval(strData.substr(0, strData.length-3)+"[1][3]");
-				else
-					fldImg.src = jst_image_folder + "/expanded_folder.png";
-			}
-			return
-		}else{
-			ctlImg.src = jst_image_folder + "/" + (tr.nextSibling ? "" : "last_") + "closed.png"
-			if(eval(strData.substr(0, strData.length-3)+"[1][3]"))
-				fldImg.src = jst_image_folder + "/" + eval(strData.substr(0, strData.length-3)+"[1][3]");
-			else
-				fldImg.src = jst_image_folder + "/closed_folder.png";
-		}
-	}
-
-	var newTr = tr.parentNode.insertRow((tr.rowIndex?tr.rowIndex:0) + 1)
-
-	if(ctlImg.id != "rootFolder"){
-		newTr.style.display = "none";
-	}
-
-	newTr.appendChild(document.createElement('td'))
-	newTr.appendChild(document.createElement('td'))
-		
-	if(newTr.nextSibling)
-		newTr.firstChild.setAttribute("background", jst_image_folder + "/branch.png", "false")
-	
-	newTr.childNodes[1].innerHTML = renderChildren(strData)
-	
-	var nodes = eval(strData)
-
-	var ndWithChildren = 0;
-	for(var n in nodes){
-		var n0 = nodes[n]
-		var n1 = n0[2]
-
-		if(n1){
-			renderNode(strData + "[" + n + "][2]" ,newTr.childNodes[1].firstChild.firstChild.childNodes[parseInt(n)+ndWithChildren].firstChild.firstChild);
-			ndWithChildren++;
-		}
-	}
-	
-	jst_loaded = true
-}
-
-function renderChildren(strData, tblCls, menu){
-
-	var code = Array()
-
-	code.push('<table cellspacing="0" cellpadding="0" border="0" class="' + tblCls + '">')
-	
-	var nodes = eval(strData)
-
-	for(var n in nodes){
-		var n0 = nodes[n]
-		var n1 = n0[2]
-
-		code.push('<tr id="' + n0[0] + '"><td><img' + (strData == jst_data ? ' style="display:none" id="rootImage"' : '') + ' src="' + jst_image_folder + '/')
-
-		if(n1){
-			code.push((n == nodes.length - 1 ? "last_closed" : "closed") + '.png" onClick="renderNode(' + "'" + strData + "[" + n + "][2]" + "'" + ',this,event)" class="action"')
-		}else{
-			code.push((n == nodes.length - 1 ? "last_leaf" : "leaf") + '.png"')
-		}
-		
-		if(jst_context_menu && !n0[1][5] && !menu)
-			n0[1][5] = jst_context_menu
-	
-		code.push(' alt=""></td><td nowrap>'+((n1||n0[1][3])?'<img'  + (((strData == jst_data)&&!jst_display_root) ? ' style="display:none"' : '') +  (n0[1][5] ? ' class="action" onClick="showMenu(\'' + strData + '[' + n + ']\', this, event)"' : '') + ' src="' + jst_image_folder + '/' + (n1 ? (n0[1][3]?n0[1][3]:"closed_folder.png") : n0[1][3] ? n0[1][3] : "node.png") + '" alt="">':'')+((n0[1][6]&&((strData != jst_data)||jst_display_root))?n0[1][6]:'')+'<a class="node"'  + (((strData == jst_data)&&!jst_display_root) ? ' style="display:none"' : '')+ (n0[1][4] ? ' title="' + n0[1][4] + '"' : '') + ' onClick="nodeClick(this)" href=' + "'" + (menu ? String(n0[1][1]).replace(/{@strData}/g, strData) : n0[1][1] ) + "'" + (n0[1][2] ? ' target="' + n0[1][2] + '"' : jst_target ? ' target="' + jst_target + '"' : '') + '>' + n0[1][0]  + '</a></td></tr>')			
-	}
-	code.push('</table>')
-	
-	return code.join("")
-}
-
-function showMenu(strData, img, event){
-	var o = window.pageYOffset
-	var offY = o ? o : document.body.scrollTop
-	var offX = o ? window.pageXOffset : document.body.scrollLeft
-	
-	jst_cm.innerHTML = renderChildren(strData + "[1][5]", "menu", true)
-	
-	jst_cm.style.top = offY + event.clientY
-	jst_cm.style.left = offX + event.clientX
-	jst_cm.style.visibility = ""
-	
-	event.cancelBubble = true
-}
-
-function hideMenu(){
-	jst_cm.style.visibility = "hidden"
-}
-
-function renderTree(){
-//	TestDate = new Date();TestStartZeit=TestDate.getTime();
-	eval(jst_container).innerHTML = '<table cellspacing="0" cellpadding="0" border="0"><tr id="'+eval(jst_data + "[0][0]")+'"><td colspan="2"><span id="rootFolder"></span></td></tr></table><div style="position:absolute;top:-100;left:-100" id="contextMenu"></div>'
-	renderNode(jst_data, document.getElementById("rootFolder"))
-	renderNode(jst_data + "[0][2]", document.getElementById("rootImage"))
-	
-	jst_cm = document.getElementById("contextMenu")
-	document.body.onclick = hideMenu
-	jst_loaded = true
-//	TestDate=new Date();TestStopZeit=TestDate.getTime();alert(TestStopZeit-TestStartZeit);
-}
+var jst_cm
+var jst_cmT
+var jst_activeNode
+var jst_reload_strData=""
+var jst_reload_ctlImage
+var jst_reload_halt=false
+var jst_any_expanded
+var jst_expandAll_int
+var jst_loaded=false
+var jst_state_paths=new Array()
+var jst_delimiter=["|","<|>"]
+var jst_id="jsTree"
+var jst_container="document.body"
+var jst_data="arrNodes"
+var jst_expandAll_warning="Expanding all nodes can take a while depending on your hardware! Continue?"
+var jst_target
+var jst_context_menu
+var jst_display_root=true
+var jst_highlight=true
+var jst_highlight_color="white"
+var jst_highlight_bg="navy"
+var jst_highlight_padding="1px"
+var jst_image_folder="./images"
+var jst_reloading=false
+var jst_reload_frame="reLoader"
+var jst_reload_script="tree_jsTree_reload.php"
+var jst_reloading_status="loading tree nodes ..."
+function absTop(nd){return nd.offsetParent?nd.offsetTop+absTop(nd.offsetParent):nd.offsetTop}
+function nodeClick(nd){if(jst_highlight){if(jst_activeNode){jst_activeNode.style.color=""
+jst_activeNode.style.backgroundColor=""
+nd.style.padding=""}
+nd.style.color=jst_highlight_color
+nd.style.backgroundColor=jst_highlight_bg
+nd.style.padding=jst_highlight_padding
+jst_activeNode=nd}}
+function _getDefinition(data,depth){var d=new Array()
+if(!data)
+return""
+var sD=""
+for(var i=0;i<depth;i++)
+sD+='\t'
+if(data!=eval(jst_data))
+d.push(",")
+d.push("\n"+sD+"[")
+var nodes=new Array()
+for(var n1 in data){var infos=new Array()
+for(var i=0;i<5;i++)
+infos.push(data[n1][1][i]?"'"+data[n1][1][i].replace(/\n/g,'\\'+'n')+"'":null)
+infos.push(null);if(data[n1][1][6]){infos.push("'"+data[n1][1][6]+"'");}else{infos.push(null);}
+for(var i=6;i>0;i--)
+if(!infos[i]){infos.pop()}else{break}
+nodes.push("\n"+sD+"\t['"+data[n1][0].replace(/\'/g,'\\'+"'")+"', ["+infos.join(",")+"]"+_getDefinition(data[n1][2],depth+1)+"]")}
+d.push(nodes.join(",")+"\n"+sD+"]")
+return d.join("")}
+function getDefinition(){return jst_data+"="+_getDefinition(eval(jst_data),0)}
+function getDomNode(path){var parts=path.split(jst_delimiter[0]);var tr=document.getElementById(parts[parts.length-1]);if(tr)
+return tr;var tBody=get1stTBody()
+for(var p=0;p<parts.length;p++){for(var c=0;c<tBody.childNodes.length;c++){var tr=tBody.childNodes[c]
+if(tr.id==parts[p]){if(p==parts.length-1){return tr}else{if(!childExists(tr))
+return null;tBody=tBody.childNodes[c+1].childNodes[1].firstChild.firstChild
+if(!tBody)
+return null}
+break}}}
+return null}
+function delArrItem(a,p){var b=a.slice(0,p)
+var e=a.slice(p+1)
+return b.concat(e)}
+function addArrItem(a,p,v){var b=a.slice(0,p)
+var e=a.slice(p)
+b[b.length]=v
+return b.concat(e)}
+function _editDataNode(action,path,nd){var ps=jst_data
+var parts=path.split(jst_delimiter[0])
+for(var p=0;p<parts.length;p++){var arrData=eval(ps)
+for(var d=0;d<arrData.length;d++)
+if(parts[p]==arrData[d][0]){if(p==parts.length-1){switch(action){case"d":if(ps!=jst_data)
+eval(ps+"=delArrItem("+ps+","+d+")")
+break;case"a":if(!eval(ps)[d][2])
+eval(ps)[d].push(new Array())
+eval(ps)[d][2].push(nd)
+break;case"u":if(!eval(ps)[d][2])
+eval(ps)[d].push(new Array())
+eval(ps)[d][2].unshift(nd)
+break;}
+return true}else{ps=ps+"["+d+"][2]"}
+break}}
+return false}
+function addNode(path,nd,sel,refresh,begining){if(_editDataNode((begining?"u":"a"),path,nd)){if(refresh){rebuildNode(path,true)
+rebuildNode(path)}
+if(sel)
+nodeClick(getDomNode(path+jst_delimiter[0]+nd[0]).childNodes[1].childNodes[1])}}
+function deleteNode(path){if(_editDataNode("d",path))
+rebuildNode(path,true)}
+function _getState(tBody,path){var hasSub=false
+for(var c=0;c<tBody.childNodes.length;c++){var tr=tBody.childNodes[c]
+if(childExists(tr)&&isExpanded(tr)){_getState(tBody.childNodes[c+1].childNodes[1].firstChild.firstChild,path+(path!=""?jst_delimiter[0]:"")+tr.id)
+hasSub=true}}
+if(!hasSub)
+jst_state_paths.push(path)}
+function getState(){jst_state_paths=new Array()
+_getState(get1stTBody(),"")
+return jst_state_paths.join(jst_delimiter[1])}
+function setState(data){jst_state_paths=data.split(jst_delimiter[1])
+for(var p in jst_state_paths){var path="";var pathElements=jst_state_paths[p].split(jst_delimiter[0]);for(i in pathElements){path+=pathElements[i];var tr=getDomNode(path)
+if(tr){var f1=tr.firstChild
+if(f1){var f2=f1.firstChild
+if(!isExpanded(tr)&&f2)
+if(f2.onclick)
+f2.onclick()}}
+path+=jst_delimiter[0];}}}
+function rebuildNode(path,parent){if(parent){var arrPath=path.split(jst_delimiter[0])
+arrPath.pop()
+path=arrPath.join(jst_delimiter[0])}
+if(path.split(jst_delimiter[0]).length<=1){renderTree()}else{var nd=getDomNode(path)
+if(nd){var nn=nd.nextSibling
+if(nn){var nCh=nn.childNodes[1].firstChild
+if(nCh.nodeName=="TABLE")
+nd.parentNode.parentNode.deleteRow(nn.rowIndex)}
+if(nd.firstChild.firstChild.onclick)
+nd.firstChild.firstChild.onclick()}}}
+function setNodeColor(path,color){var nd=getDomNode(path)
+if(nd){nd.childNodes[1].childNodes[nd.childNodes[1].childNodes.length-1].style.color=color;}}
+function setNodeImage(path,Img){var ps=jst_data;var parts=path.split(jst_delimiter[0])
+var arrData=null;for(var p=0;p<parts.length;p++){arrData=eval(ps);for(var d=0;d<arrData.length;d++){if(parts[p]==arrData[d][0]){if(p==parts.length-1){eval(ps)[d][1][3]=Img;var nd=getDomNode(path);if(nd){var cb=nd.childNodes[1].childNodes[0];if(cb&&cb.nodeName=="IMG"){if(Img)
+cb.src=jst_image_folder+"/"+Img;else if(eval(ps)[d][2]){if(childExists(nd)){var s=nd.nextSibling.style
+if(s.display==""){cb.src=jst_image_folder+"/expanded_folder.png";}else{cb.src=jst_image_folder+"/closed_folder.png";}}else{cb.src=jst_image_folder+"/expanded_folder.png";}}
+else
+rebuildNode(path,true);}
+else
+rebuildNode(path,true);}
+return true}else{ps=ps+"["+d+"][2]"}
+break;}}}
+return false}
+function selectNode(path){var nd=getDomNode(path)
+if(nd){nodeClick(nd.childNodes[1].childNodes[nd.childNodes[1].childNodes.length-1])
+return true}else{return false}}
+function IsChecked(path,ctrlNr){var nd=getDomNode(path)
+if(nd){var fc=nd.childNodes[1].firstChild;if(fc&&fc.nodeName=="IMG")ctrlNr++;var cb=nd.childNodes[1].childNodes[ctrlNr];if(cb&&cb.nodeName=="INPUT"){return cb.checked;}}
+return false;}
+function getChildrenCheckState(path,ctrlNr){var state=-1;var plus=0;var nd=getDomNode(path);if(!nd)return-1;if(!childExists(nd))return-1;var tBody=nd.nextSibling.childNodes[1].firstChild.firstChild;if(!tBody)return-1;for(var i=0;i<tBody.childNodes.length;i++){var fc=tBody.childNodes[i].childNodes[1].firstChild;plus=0;if(fc&&fc.nodeName=="IMG")plus++;var cb=tBody.childNodes[i].childNodes[1].childNodes[ctrlNr+plus];if(cb&&cb.nodeName=="INPUT"){if(state==-1)
+state=cb.checked?1:0;else{if(state!=cb.checked?1:0)
+return-1;}}}
+return state;}
+function checkChildren(path,ctrlNr,bChk){var nd=getDomNode(path);var plus;if(!nd)return false;if(!childExists(nd))return false;var tBody=nd.nextSibling.childNodes[1].firstChild.firstChild;if(!tBody)return false;for(var i=0;i<tBody.childNodes.length;i++){var fc=tBody.childNodes[i].childNodes[1].firstChild;plus=0;if(fc&&fc.nodeName=="IMG")plus++;var cb=tBody.childNodes[i].childNodes[1].childNodes[ctrlNr+plus];if(cb&&cb.nodeName=="INPUT"&&!cb.disabled){cb.checked=bChk;if(cb.onclick){cb.onclick();}}}
+return true;}
+function checkNode(path,ctrlNr,bChk){var nd=getDomNode(path)
+if(nd){var fc=nd.childNodes[1].firstChild;if(fc&&fc.nodeName=="IMG")ctrlNr++;var cb=nd.childNodes[1].childNodes[ctrlNr];if(cb&&cb.nodeName=="INPUT"){cb.checked=bChk;if(cb.onclick)cb.onclick();return true;}}
+return false;}
+function enableCheckbox(path,ctrlNr,pEnabled){var nd=getDomNode(path)
+if(nd){var fc=nd.childNodes[1].firstChild;if(fc&&fc.nodeName=="IMG")ctrlNr++;var cb=nd.childNodes[1].childNodes[ctrlNr];if(cb&&cb.nodeName=="INPUT"){cb.disabled=!pEnabled;return true;}}
+return false;}
+function get1stTBody(){return eval(jst_container).firstChild.firstChild.childNodes[1].childNodes[1].firstChild.firstChild}
+function __switchAll(tBody,expand){if(!tBody)
+return false
+for(var c=0;c<tBody.childNodes.length;c++){var tr=tBody.childNodes[c]
+var img=tr.firstChild.firstChild
+if(img)
+if(img.onclick){if((expand&&!childExists(tr))||((expand&&!isExpanded(tr))||(!expand&&isExpanded(tr)))){if(img.id!="rootImage")
+img.onclick()
+jst_any_expanded=true}
+if(tBody.childNodes[c+1])
+__switchAll(tBody.childNodes[c+1].childNodes[1].firstChild.firstChild,expand)}}}
+function _switchAll(expand){if(jst_reload_halt)
+return
+__switchAll(get1stTBody(),expand)
+if(jst_reloading){if(!jst_any_expanded)
+cancelExpandAll()
+jst_any_expanded=null}}
+function expandAll(){if(jst_expandAll_warning?confirm(jst_expandAll_warning):true)
+if(jst_reloading){jst_expandAll_int=window.setInterval("if(!jst_reload_halt)_switchAll(true)",100)}else{_switchAll(true)}}
+function cancelExpandAll(){if(jst_expandAll_int)
+window.clearInterval(jst_expandAll_int)}
+function closeAll(){_switchAll(false)}
+function isExpanded(tr){return childExists(tr)?tr.nextSibling.style.display!="none":false}
+function childExists(tr){try{return tr.nextSibling.childNodes[1].firstChild.nodeName=="TABLE"}catch(e){return false}}
+function getPath(strData){if(strData.indexOf("[")>0){var sub3=strData.substr(0,strData.lastIndexOf("["))
+var sub6=sub3.substr(0,sub3.lastIndexOf("["))
+return(getPath(sub6)!=""?getPath(sub6)+jst_delimiter[0]:"")+eval(sub3+"[0]")}else{return""}}
+function reloadCallback(){eval(jst_reload_strData+"=window.frames['"+jst_reload_frame+"']."+jst_data)
+renderNode(jst_reload_strData,jst_reload_ctlImage,null,true)
+window.status=""
+jst_reload_halt=false
+jst_reload_strData=""
+jst_reload_ctlImage=null}
+function renderNode(strData,ctlImg,event,reload){if(event)
+event.cancelBubble=true
+if(jst_reload_halt&&!reload)
+return
+jst_loaded=false
+if(jst_reloading&&!reload&&eval(strData).length==0){jst_reload_strData=strData
+jst_reload_ctlImage=ctlImg
+jst_reload_halt=true
+if(jst_reloading_status)
+window.status=jst_reloading_status
+window.frames[jst_reload_frame].document.location.href="./"+jst_reload_script+(jst_reload_script.indexOf("?")>-1?"&":"?")+"path="+getPath(strData)
+return}
+var tr=ctlImg.parentNode.parentNode
+if(ctlImg.id!="rootFolder"){var fldImg=tr.childNodes[1].firstChild
+if(childExists(tr)){var s=tr.nextSibling.style
+var img1=jst_image_folder+"/"+(tr.nextSibling.nextSibling?"":"last_")
+if(s.display==""){s.display="none"
+ctlImg.src=img1+"closed.png"
+if(eval(strData.substr(0,strData.length-3)+"[1][3]"))
+fldImg.src=jst_image_folder+"/"+eval(strData.substr(0,strData.length-3)+"[1][3]");else
+fldImg.src=jst_image_folder+"/closed_folder.png";}else{s.display=""
+ctlImg.src=img1+"expanded.png"
+if(eval(strData.substr(0,strData.length-3)+"[1][3]"))
+fldImg.src=jst_image_folder+"/"+eval(strData.substr(0,strData.length-3)+"[1][3]");else
+fldImg.src=jst_image_folder+"/expanded_folder.png";}
+return}else{ctlImg.src=jst_image_folder+"/"+(tr.nextSibling?"":"last_")+"closed.png"
+if(eval(strData.substr(0,strData.length-3)+"[1][3]"))
+fldImg.src=jst_image_folder+"/"+eval(strData.substr(0,strData.length-3)+"[1][3]");else
+fldImg.src=jst_image_folder+"/closed_folder.png";}}
+var newTr=tr.parentNode.insertRow((tr.rowIndex?tr.rowIndex:0)+1)
+if(ctlImg.id!="rootFolder"){newTr.style.display="none";}
+newTr.appendChild(document.createElement('td'))
+newTr.appendChild(document.createElement('td'))
+if(newTr.nextSibling)
+newTr.firstChild.setAttribute("background",jst_image_folder+"/branch.png","false")
+newTr.childNodes[1].innerHTML=renderChildren(strData)
+var nodes=eval(strData)
+var ndWithChildren=0;for(var n in nodes){var n0=nodes[n]
+var n1=n0[2]
+if(n1){renderNode(strData+"["+n+"][2]",newTr.childNodes[1].firstChild.firstChild.childNodes[parseInt(n)+ndWithChildren].firstChild.firstChild);ndWithChildren++;}}
+jst_loaded=true}
+function renderChildren(strData,tblCls,menu){var code=Array()
+code.push('<table cellspacing="0" cellpadding="0" border="0" class="'+tblCls+'">')
+var nodes=eval(strData)
+for(var n in nodes){var n0=nodes[n]
+var n1=n0[2]
+code.push('<tr id="'+n0[0]+'"><td><img'+(strData==jst_data?' style="display:none" id="rootImage"':'')+' src="'+jst_image_folder+'/')
+if(n1){code.push((n==nodes.length-1?"last_closed":"closed")+'.png" onClick="renderNode('+"'"+strData+"["+n+"][2]"+"'"+',this,event)" class="action"')}else{code.push((n==nodes.length-1?"last_leaf":"leaf")+'.png"')}
+if(jst_context_menu&&!n0[1][5]&&!menu)
+n0[1][5]=jst_context_menu
+code.push(' alt=""></td><td nowrap>'+((n1||n0[1][3])?'<img'+(((strData==jst_data)&&!jst_display_root)?' style="display:none"':'')+(n0[1][5]?' class="action" onClick="showMenu(\''+strData+'['+n+']\', this, event)"':'')+' src="'+jst_image_folder+'/'+(n1?(n0[1][3]?n0[1][3]:"closed_folder.png"):n0[1][3]?n0[1][3]:"node.png")+'" alt="">':'')+((n0[1][6]&&((strData!=jst_data)||jst_display_root))?n0[1][6]:'')+'<a class="node"'+(((strData==jst_data)&&!jst_display_root)?' style="display:none"':'')+(n0[1][4]?' title="'+n0[1][4]+'"':'')+' onClick="nodeClick(this)" href='+"'"+(menu?String(n0[1][1]).replace(/{@strData}/g,strData):n0[1][1])+"'"+(n0[1][2]?' target="'+n0[1][2]+'"':jst_target?' target="'+jst_target+'"':'')+'>'+n0[1][0]+'</a></td></tr>')}
+code.push('</table>')
+return code.join("")}
+function showMenu(strData,img,event){var o=window.pageYOffset
+var offY=o?o:document.body.scrollTop
+var offX=o?window.pageXOffset:document.body.scrollLeft
+jst_cm.innerHTML=renderChildren(strData+"[1][5]","menu",true)
+jst_cm.style.top=offY+event.clientY
+jst_cm.style.left=offX+event.clientX
+jst_cm.style.visibility=""
+event.cancelBubble=true}
+function hideMenu(){jst_cm.style.visibility="hidden"}
+function renderTree(){eval(jst_container).innerHTML='<table cellspacing="0" cellpadding="0" border="0"><tr id="'+eval(jst_data+"[0][0]")+'"><td colspan="2"><span id="rootFolder"></span></td></tr></table><div style="position:absolute;top:-100;left:-100" id="contextMenu"></div>'
+renderNode(jst_data,document.getElementById("rootFolder"))
+renderNode(jst_data+"[0][2]",document.getElementById("rootImage"))
+jst_cm=document.getElementById("contextMenu")
+document.body.onclick=hideMenu
+jst_loaded=true}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/map.js
===================================================================
--- branches/print_dev/http/javascripts/map.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/map.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,754 +1,253 @@
-/**
- * used in mod_box1, mod_dragMapSize, mod_pan
- */
-var mb_start_x = 0;
-var mb_start_y = 0;
-var mb_end_x = 0;
-var mb_end_y = 0;
 
-/**
- * @deprecated
- */
-function mb_execloadWmsSubFunctions(){
-	eventAfterLoadWMS.trigger();
-}
-
-function mb_execWfsReadSubFunctions(geom) { 	 
-	for(var i=0; i<mb_WfsReadSubFunctions.length; i++){ 	 
-		mb_WfsReadSubFunctions[i](geom); 	 
-	} 	 
-}
-
-function mb_execWfsWriteSubFunctions() { 	 
-	for(var i=0; i<mb_WfsWriteSubFunctions.length; i++){
-		mb_WfsWriteSubFunctions[i](); 	 
-	} 	 
-}
-
-function mb_setWmcExtensionData(anArray) {
-	for (var i in anArray) {
-		if (typeof(anArray[i]) != "undefined") {
-			currentWmcExtensionData[i] = anArray[i];
-		}
-	}
-}
-
-function mb_getWmcExtensionData(arrayKey) {
-	for (var i in restoredWmcExtensionData) {
-		if (arrayKey == i) {
-			return restoredWmcExtensionData[i];
-		}
-	}
-	var e = new Mb_warning("mb_getWmcExtensionData: "+arrayKey+" not found. Maybe this GUI does not allow loading or saving WMC documents from/to the session");
-	return null;
-}
-
-
-eventAfterInit.register(function () {
-	// performs a map request for each map frame
-	for (var i = 0; i < mb_mapObj.length; i++){
-		setMapRequest(mb_mapObj[i].frameName);
-	}      	
-});
-
-eventBeforeFeatureInfo.register(function() {
-	for (var j=0; j<mb_mapObj.length; j++) {
-		var mapObj = mb_mapObj[j];
-
-		//
-		// set list of visible layers, active querylayers 
-		// and styles for each WMS in this map
-		//
-		
-		var cnt_layers;
-		var cnt_querylayers;
-		var styles;
-		var layers;
-		var querylayers = "";
-		for(i=0; i< mapObj.wms.length; i++){
-			cnt_layers = 0;
-			cnt_querylayers = 0;
-			styles = "";
-			layers = "";
-			querylayers = "";
-	
-			for(var ii=0; ii<mapObj.wms[i].objLayer.length; ii++){
-				// layer is visible and not root layer
-				if(mapObj.wms[i].objLayer[ii].gui_layer_visible == 1 && ii>0){
-					if(cnt_layers > 0){
-						layers += ","; styles += ","; 
-					}
-					layers += wms[i].objLayer[ii].layer_name; 
-					styles += ""; 
-					cnt_layers++;
-				}            
-				// layer is queryable and not root layer
-				if(mapObj.wms[i].objLayer[ii].gui_layer_querylayer == 1 && ii>0){
-					if(cnt_querylayers > 0){
-						querylayers += ",";
-					}
-					querylayers += wms[i].objLayer[ii].layer_name; 
-					cnt_querylayers++;
-				}                          
-			}
-			mapObj.layers[i] = layers;
-			mapObj.styles[i] = styles;
-			mapObj.querylayers[i] = querylayers;
-		}
-	}
-});
-
-function mb_registerMapObj(frameName, elementName,wms_index,width, height){
-	mb_mapObj.push(new mb_mapObj_const(frameName, elementName, width, height, wms_index));    
-}
-
-
-function mb_mapObjremoveWMS(objind,wmsind){
-	var wms_ID = null;
-	var i;
-	var new_wmsarray = [];
-	var new_layerarray = [];
-	var new_querylayerarray = [];
-	var new_stylesarray = [];
-	var new_mapURLarray = [];
-	
-	for	(i=0;i<mb_mapObj[objind].wms.length; i++){
-		if(i != wmsind){
-			new_wmsarray[new_wmsarray.length] = mb_mapObj[objind].wms[i];
-			new_layerarray[new_layerarray.length] = mb_mapObj[objind].layers[i];
-			new_querylayerarray[new_querylayerarray.length] = mb_mapObj[objind].querylayers[i];
-			new_stylesarray[new_stylesarray.length] = mb_mapObj[objind].styles[i];
-			new_mapURLarray[new_mapURLarray.length] = mb_mapObj[objind].mapURL[i];
-		}
-		else {
-			wms_ID = mb_mapObj[objind].wms[i].wms_id;
-		}
-	}
-	mb_mapObj[objind].wms = new_wmsarray; 
-	mb_mapObj[objind].layers = new_layerarray; 
-	mb_mapObj[objind].querylayers = new_querylayerarray; 
-	mb_mapObj[objind].styles = new_stylesarray; 
-	mb_mapObj[objind].mapURL = new_mapURLarray;
-
-	var another_new_wmsarray = [];
-	for	(i=0;i<wms.length; i++){
-		if(wms[i].wms_id != wms_ID){
-			another_new_wmsarray[another_new_wmsarray.length] = wms[i]; 
-		}
-	}
-	wms = another_new_wmsarray; 
-}
-function setExtent(width,height,epsg){
-   for(var i=0; i < wms[0].gui_epsg.length; i++){
-      if(wms[0].gui_epsg[i] == epsg){      
-         var bbox_minx = parseFloat(wms[0].gui_minx[i]);
-         var bbox_miny = parseFloat(wms[0].gui_miny[i]);
-         var bbox_maxx = parseFloat(wms[0].gui_maxx[i]);
-         var bbox_maxy = parseFloat(wms[0].gui_maxy[i]);     
-   
-         var extenty = bbox_maxy - bbox_miny;
-         var extentx = bbox_maxx - bbox_minx;
-
-         var relation_px_x = width / height;
-         var relation_px_y = height / width;
-         var relation_bbox_x = extentx / extenty;         
-         var centerx = bbox_minx + (extentx/2);
-         var centery = bbox_miny + (extenty/2);
-         if(relation_bbox_x <= relation_px_x){                
-                bbox_minx = centerx - relation_px_x * extenty / 2;
-                bbox_maxx = centerx + relation_px_x * extenty / 2;
-         }
-        
-         if(relation_bbox_x > relation_px_x){                
-                bbox_miny = centery - relation_px_y * extentx / 2;
-                bbox_maxy = centery + relation_px_y * extentx / 2;
-         }
-        return bbox_minx  +","+ bbox_miny +","+ bbox_maxx  +","+ bbox_maxy;
-     }
-   }
-}
-function setMapRequest(frameName){
-	var functionName = 'setMapRequest';
-
-	var ret = eventBeforeMapRequest.trigger({frameName:frameName}, "AND");
-	if (ret === false) {
-		return true;
-	}
-
-	var ts = mb_timestamp();
-	var myMapIds = [];
-	for (var i=0; i < mb_mapObj.length; i++){
-		var currentMapObject = mb_mapObj[i];
-		if (currentMapObject.frameName != frameName) {
-			continue;
-		}
-		
-		var newMapRequest = "";
-		for (var ii = 0; ii < currentMapObject.wms.length; ii++){
-			var currentWms = currentMapObject.wms[ii];
-			if (!(currentWms.gui_wms_visible > 0)) {
-				continue;
-			}
-			myMapIds.push("map_"+ii);
-			
-			newMapRequest += getLayerHtmlCode(frameName, i, ii);
-			
-		}
-		writeTag(mb_mapObj[i].frameName, mb_mapObj[i].elementName, newMapRequest);
-	}
-	eventAfterMapRequest.trigger({
-		"frameName": frameName,
-		"myMapIds": myMapIds.join(",")
-	});
-/*
-	for(var i=0; i<mb_MapRequestSubFunctions.length; i++){
-		eval(mb_MapRequestSubFunctions[i]);
-	}
-*/
-}
-
-function getLayerHtmlCode (frameName, i, ii) {
-	var currentMapObject = mb_mapObj[i];
-	var currentWms = currentMapObject.wms[ii];
-
-	var myDivId = "div_" + ii;          
-	var myMapId = "map_" + ii;
-	//disable Layer which are out of scale
-	var validLayers = mb_checkScale(frameName, i, ii);
-	var layerNames = validLayers.toString();
-
-	var newMapURL = false;
-	var opacityString = "";
-	if (currentMapObject.layers[ii] !== "" && layerNames !== ''){
-		// get map URL
-		newMapURL = currentMapObject.getMapUrl(i, ii);
-
-		var currentOpacity = currentWms.gui_wms_mapopacity;
-		if (currentOpacity != 1) {
-			opacityString += "opacity:" + currentOpacity + "; ";
-			opacityString += "Filter: Alpha(Opacity=" + currentOpacity*100 + "); ";
-			opacityString += "-moz-opacity:" + currentOpacity + " ; ";
-			opacityString += "-khtml-opacity:" + currentOpacity;
-		}
-	}
-
-	var imageString = "";
-	if (newMapURL) {
-		imageString = "<img id='"+myMapId+"' name='mapimage' ";
-		imageString += "src='" + newMapURL + "' ";
-		imageString += "width='"+currentMapObject.width+"' ";
-		imageString += "height='"+currentMapObject.height+"' ";
-		imageString += "border='0'>";	
-	}
-
-	var newMapRequest = "<div id='"+myDivId+"' ";
-	newMapRequest += "style=\"position:absolute; top:0px; left:0px; ";
-	newMapRequest += "z-index:" + ii + ";" + opacityString + "\">";
-	newMapRequest += imageString;
-	newMapRequest += "</div>";   
-
-	currentMapObject.mapURL[ii]= newMapURL;	
-	currentWms.mapURL = newMapURL;
-
-	if (mb_log && currentWms.mapURL) {
-		var tmp = eval(mb_log + "('" +newMapURL + "','" + ts + "')");
-	}
-
-	return newMapRequest;
-}
-
-function setSingleMapRequest(frameName,wms_id){
-	var functionName = 'setSingleMapRequest';
-	
-	eventBeforeMapRequest.trigger({frameName:frameName});
-
-	var ts = mb_timestamp();	
-
-	for(i = 0; i < mb_mapObj.length; i++){
-		var currentMapObject = mb_mapObj[i];
-		if (currentMapObject.frameName != frameName) {
-			continue;
-		}
-		
-		for (var ii=0; ii < currentMapObject.wms.length; ii++){ 
-			var currentWms = currentMapObject.wms[ii];
-			if (currentWms.wms_id != wms_id) {
-				continue;
-			}
-
-			var newMapRequest = getLayerHtmlCode(frameName, i, ii);
-
-			if (mb_log) {
-				var tmp = eval(mb_log + "('" + newMapURL + "','" + ts + "')");
-			}
-			var myDivId = "div_" + ii;          
-			writeTag(currentMapObject.frameName, myDivId, newMapRequest);
-			var myMapId = "map_" + ii;
-			eventAfterMapRequest.trigger({"frameName":frameName, "myMapId":myMapId});
-			return true;
-		}      
-	}  
-	return false; 
-}
-
-
-function mb_restateLayers(frameName,wms_id){
-	//alert(frameName + " / " + wms_id);
-	var ind = getMapObjIndexByName(frameName);	
-	for(var i=0; i<mb_mapObj[ind].wms.length; i++){
-		if(mb_mapObj[ind].wms[i].wms_id == wms_id){
-			var cnt_layers = 0;
-			var cnt_querylayers = 0;
-			var layers = "";
-			var styles = "";
-			var querylayers = "";
-			for(var ii=0; ii<mb_mapObj[ind].wms[i].objLayer.length; ii++){
-				if(mb_mapObj[ind].wms[i].objLayer[ii].gui_layer_visible == 1 && !mb_mapObj[ind].wms[i].objLayer[ii].has_childs){
-					if(cnt_layers > 0){layers += ","; styles += ","; }
-					layers += mb_mapObj[ind].wms[i].objLayer[ii].layer_name;
-					//alert(mb_mapObj[ind].wms[i].objLayer[ii].layer_name); 
-					styles += ""; 
-					cnt_layers++;
-				}            
-				if(mb_mapObj[ind].wms[i].objLayer[ii].gui_layer_querylayer == 1 && !mb_mapObj[ind].wms[i].objLayer[ii].has_childs){
-					if(cnt_querylayers > 0){querylayers += ",";}
-					querylayers += mb_mapObj[ind].wms[i].objLayer[ii].layer_name; 
-					cnt_querylayers++;
-				}
-			}
-			mb_mapObj[ind].layers[i] = layers;
-			mb_mapObj[ind].querylayers[i] = querylayers;
-			mb_mapObj[ind].styles[i] = styles;
-		}
-	}
-}
-
-function mb_checkScale(frameName,mObj,wmsObj){
-	var thisLayer = mb_mapObj[mObj].layers[wmsObj].split(",");
-	var thisScale = mb_getScale(frameName);  
-	var str_layer = "";
-	var cnt_layer = 0;
-	for(var i=0; i<mb_mapObj[mObj].wms[wmsObj].objLayer.length; i++){  
-		var myLayername = mb_mapObj[mObj].wms[wmsObj].objLayer[i].layer_name;
-		var myMinscale = mb_mapObj[mObj].wms[wmsObj].objLayer[i].gui_layer_minscale;
-		var myMaxscale = mb_mapObj[mObj].wms[wmsObj].objLayer[i].gui_layer_maxscale;
-		for(var ii=0; ii<thisLayer.length; ii++){
-			var minscaleOK = false;
-			var maxscaleOK = false;   
-			if(thisLayer[ii] == myLayername){
-				if(myMinscale === 0 || thisScale >= myMinscale){minscaleOK = true;}
-				if(myMaxscale === 0 || thisScale <= myMaxscale){maxscaleOK = true;}
-				if(maxscaleOK === true && minscaleOK === true  && !mb_mapObj[mObj].wms[wmsObj].objLayer[i].has_childs){
-					if(cnt_layer > 0){str_layer += ","; }//str_styles += ","; str_titles += ",";str_parent += ","; str_legendurls += ",";}
-					str_layer += thisLayer[ii];
-					cnt_layer++;
-				}
-			}
-		}
-	}
-	var str_layerstyles = [];
-	str_layerstyles[0] = str_layer;
-	return str_layerstyles;
-}
-
-function setFeatureInfoRequest(fName,x,y, path) {
-	var functionName = 'setFeatureInfoRequest';
-	var ts = mb_timestamp();
-	eventBeforeFeatureInfo.trigger({"fName":fName});
-/*
-	for(var i=0; i<mb_FeatureInfoPreFunctions.length; i++){
-		eval(mb_FeatureInfoPreFunctions[i]);
-	}   
-*/
-	var cnt_fi = 0;
-	for(i=0; i<mb_mapObj.length; i++){
-		if(mb_mapObj[i].frameName == fName){
-			for(var ii=0; ii<mb_mapObj[i].wms.length; ii++){
-				var newfeatureInfoRequest = "";
-				var requestParams = "";
-				var validation = false;
-				newfeatureInfoRequest += mb_mapObj[i].wms[ii].wms_getfeatureinfo;          
-            	newfeatureInfoRequest += mb_getConjunctionCharacter(mb_mapObj[i].wms[ii].wms_getfeatureinfo);
-            	
-				if(mb_mapObj[i].wms[ii].wms_version == "1.0.0"){requestParams += "WMTVER="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=feature_info&";}
-				if(mb_mapObj[i].wms[ii].wms_version != "1.0.0"){requestParams += "VERSION="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=GetFeatureInfo&SERVICE=WMS&";}
-				requestParams += "SRS="+mb_mapObj[i].epsg+"&";
-				requestParams += "BBOX="+mb_mapObj[i].extent+"&";
-				requestParams += "WIDTH="+mb_mapObj[i].width+"&";
-				requestParams += "HEIGHT="+mb_mapObj[i].height+"&";
-				requestParams += "LAYERS="+mb_mapObj[i].layers[ii]+"&";
-				requestParams += "STYLES="+mb_mapObj[i].styles[ii]+"&";
-				requestParams += "FORMAT="+mb_mapObj[i].wms[ii].gui_wms_mapformat+"&";
-				requestParams += "INFO_FORMAT="+mb_mapObj[i].wms[ii].gui_wms_featureinfoformat+"&";
-				requestParams += "EXCEPTIONS=application/vnd.ogc.se_xml&";
-				if(mb_feature_count > 0){             
-					requestParams += "FEATURE_COUNT="+mb_feature_count+"&";
-				}
-				requestParams += "QUERY_LAYERS="+mb_mapObj[i].querylayers[ii]+"&";
-				requestParams += "X=" + x  + "&";
-				requestParams += "Y=" + y;
-				
-				if(mb_mapObj[i].querylayers[ii] !== "" && mb_mapObj[i].layers[ii] !== ""){
-					validation = true;
-				}
-				//add vendor-specific
-				for(var v=0; v < mb_vendorSpecific.length; v++){
-					var vendorSpecificString = eval(mb_vendorSpecific[v]); 
-					requestParams += "&" + vendorSpecificString; 
-				}
-				if(mb_log && validation){
-					var tmp = eval(mb_log + "('" + newfeatureInfoRequest + requestParams + "','" + ts + "')");
-				}
-				if(document.getElementById("FeatureInfoRedirect") && validation){
-					newfeatureInfoRequest += requestParams;
-					if(path){
-						window.frames.FeatureInfoRedirect.document.getElementById(mb_mapObj[i].wms[ii].wms_id).src = path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr;
-					}
-					else{
-						window.frames.FeatureInfoRedirect.document.getElementById(mb_mapObj[i].wms[ii].wms_id).src = newfeatureInfoRequest;
-					}
-					cnt_fi++;
-            	}
-				else if(path && validation){
-					newfeatureInfoRequest += requestParams;
-					try{
-						var p = new mb_popup({
-							title:"Feature Info",
-							url:path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr,
-							width:600,
-							height:500,
-							top:200,
-							left:600
-						});
-						p.show();
-					}catch(e){
-						window.open(path + "?url=" + escape(newfeatureInfoRequest)+"&"+mb_nr, "" , "width=300,height=400,scrollbars=yes,resizable=yes");
-					}
-					cnt_fi++;
-				}
-				else if(validation){
-					newfeatureInfoRequest += requestParams;
-					try{
-						var p = new mb_popup({
-							title:"Feature Info",
-							url:newfeatureInfoRequest,
-							width:600,
-							height:500,
-							top:200,
-							left:600
-						});
-						p.show();
-					}
-					catch(e){
-						window.open(newfeatureInfoRequest, "" , "width=300,height=400,scrollbars=yes,resizable=yes");					
-					}
-					cnt_fi++;
-				}    
-			}
-		}
-	}
-   	if(cnt_fi === 0){
-		alert(unescape("Please select a layer! \n Bitte waehlen Sie eine Ebene zur Abfrage aus!"));
-	}
-}
-
-/*
- * global function to zoom a mapobject
- * 
- * use: mb_mapObj.zoom() {@link mb_mapObj_const#zoom}
- * @deprecated
- * 
- */
-function zoom(frameName,in_, factor,x,y) {
-	var obj = getMapObjByName(frameName);
-	if(x && y){
-		obj.zoom(in_, factor, x, y);
-	}
-	else{
-		obj.zoom(in_, factor, false, false);
-	}	
-	setMapRequest(frameName);
-}
-function mb_panMap(frameName,dir){
-   var ind = getMapObjIndexByName(frameName);
-   var arrayBBox = mb_mapObj[ind].extent.split(",");
-   var minx = parseFloat(arrayBBox[0]);
-   var miny = parseFloat(arrayBBox[1]);
-   var maxx = parseFloat(arrayBBox[2]);
-   var maxy = parseFloat(arrayBBox[3]);
-   var xtentx = parseFloat(arrayBBox[2]) - parseFloat(arrayBBox[0]);
-   var xtenty =  parseFloat(arrayBBox[3]) - parseFloat(arrayBBox[1]);
-
-   if(dir == "NW"){minx = minx - (xtentx/2); maxx = maxx - (xtentx/2); miny = miny + (xtenty/2); maxy = maxy + (xtenty/2);}
-   if(dir == "N"){miny = miny + (xtenty/2); maxy = maxy + (xtenty/2);}
-   if(dir == "NE"){minx = minx + (xtentx/2); maxx = maxx + (xtentx/2); miny = miny + (xtenty/2); maxy = maxy + (xtenty/2);}
-   if(dir == "W"){minx = minx - (xtentx/2); maxx = maxx - (xtentx/2);}
-   if(dir == "E"){minx = minx + (xtentx/2); maxx = maxx + (xtentx/2);}
-   if(dir == "SW"){minx = minx - (xtentx/2); maxx = maxx - (xtentx/2); miny = miny - (xtenty/2); maxy = maxy - (xtenty/2);}
-   if(dir == "S"){miny = miny - (xtenty/2); maxy = maxy - (xtenty/2);}
-   if(dir == "SE"){minx = minx + (xtentx/2); maxx = maxx + (xtentx/2); miny = miny - (xtenty/2); maxy = maxy - (xtenty/2);}
-  mb_mapObj[ind].extent = minx + "," + miny + "," + maxx + "," + maxy;
-  setMapRequest(frameName);
-}
-
-function handleSelectedLayer (frameName, wms_title, layerName, type, status) {
-//	alert(frameName + " , " +wms_title + " , " +layerName + " , " +type + " , " +status);
-//	type = {visible || querylayer] status = {0 || 1}
-	for (var i=0; i < mb_mapObj.length; i++) {
-		if (mb_mapObj[i].frameName == frameName) {
-			var cnt_layer = 0;
-			var str_layer = "";
-			var myMapObj = i;
-			for (var ii = 0; ii < mb_mapObj[i].wms.length; ii++) {
-				if (mb_mapObj[i].wms[ii].wms_title == wms_title) { //ii is true
-					var myWMS = ii; 
-					if (type == "visible") {
-						var arrayLayer = mb_mapObj[i].layers[ii].split(",");
-					}
-					if (type == "querylayer") {
-						var arrayLayer = mb_mapObj[i].querylayers[ii].split(",");
-					}
-					for (var iii = 1; iii < mb_mapObj[i].wms[ii].objLayer.length; iii++) {
-						var layer_name = mb_mapObj[i].wms[ii].objLayer[iii].layer_name;
-						if (type == "querylayer") {
-							if (layer_name == layerName && status == 1 && mb_mapObj[i].wms[ii].objLayer[iii].layer_queryable == 1){
-								if (cnt_layer > 0) {
-									str_layer += ",";
-								}
-								str_layer += layer_name;
-								cnt_layer++;                   
-							}
-						}
-						else if (type == "visible") {
-							if (layer_name == layerName && status == 1) {
-								if (cnt_layer > 0) {
-									str_layer += ",";
-								}
-								str_layer += layer_name;
-								cnt_layer++;                   
-							}
-						}
-						for (var iiii = 0; iiii < arrayLayer.length; iiii++) {
-							if (layer_name == arrayLayer[iiii] && layer_name != layerName) {
-								if (cnt_layer > 0) {
-									str_layer += ",";
-								}
-								str_layer += layer_name;
-								cnt_layer++;             
-							}
-						}
-					}
-				}   
-			}         
-		}
-	}
-	if (type == "visible") {
-		mb_mapObj[myMapObj].layers[myWMS] = str_layer;
-		var array_str_layer = str_layer.split(",");
-		var str_styles = "";
-		for (var cnt=0; cnt < array_str_layer.length; cnt++) {
-			if (cnt > 0) {
-				str_styles += ",";
-			}
-			str_styles += "";
-		}
-		mb_mapObj[myMapObj].styles[myWMS] = str_styles;
-	}
-	if (type == "querylayer") {
-		mb_mapObj[myMapObj].querylayers[myWMS] = str_layer;
-	}
-/*
-	if(type == 'visible'){
-		setSingleMapRequest(frameName,wms_title);
-	}
-*/
-}
-
-function handleSelectedLayer_array(mapObj, array_wms, array_layer, type, status){
-	//alert(mapObj+" / "+array_wms[0]+" / "+ array_layer[0]+" / "+ type+" / "+ status);
-	var ind = getMapObjIndexByName(mapObj);
-	for(var j=0; j<array_wms.length; j++){
-		for(var i=0; i<mb_mapObj[ind].wms.length; i++){
-			if(mb_mapObj[ind].wms[i].wms_id == array_wms[j]){
-				var check = false;
-				for(var ii=0; ii<mb_mapObj[ind].wms[i].objLayer.length; ii++){
-					if(mb_mapObj[ind].wms[i].wms_id == array_wms[j] && mb_mapObj[ind].wms[i].objLayer[ii].layer_name == array_layer[j]){
-						if(type == "visible"){
-							mb_mapObj[ind].wms[i].objLayer[ii].gui_layer_visible = parseInt(status, 10);
-							//alert(mb_mapObj[ind].wms[i].objLayer[ii].layer_name);
-							check = true;
-						}
-                        if(type == "querylayer" && (mb_mapObj[ind].wms[i].objLayer[ii].gui_layer_queryable == "1" || mb_mapObj[ind].wms[i].objLayer[ii].gui_layer_queryable == 1)){
-							mb_mapObj[ind].wms[i].objLayer[ii].gui_layer_querylayer = parseInt(status, 10);
-						}
-					}
-				}
-                mb_restateLayers(mapObj, array_wms[j]);
-                //alert('restate');
-                /*
-                * hier noch checken, welche wms sich geaendert haben und disctinct eine singleRequest aufrufen:
-                */ 
-                if(check === true){					
-                    
-                    if(mb_mapObj[ind].wms[i].gui_wms_visible == 1){
-						setSingleMapRequest(mapObj,mb_mapObj[ind].wms[i].wms_id);
-                        //alert('sSMR');
-					}
-				}
-			}
-		}
-	}
-}
-
-function makeClickPos2RealWorldPos(frameName, myClickX, myClickY) {
-	var ind = getMapObjIndexByName(frameName);
-	var width = parseInt(mb_mapObj[ind].width, 10);
-	var height = parseInt(mb_mapObj[ind].height, 10);
-	var arrayBBox = mb_mapObj[ind].extent.split(",");
-	var minX = parseFloat(arrayBBox[0]);
-	var minY = parseFloat(arrayBBox[1]);
-	var maxX = parseFloat(arrayBBox[2]);
-	var maxY = parseFloat(arrayBBox[3]);
-	var deltaX = (maxX - minX)/width;
-	var deltaY = (maxY - minY)/height;
-	if(deltaX > 0){
-		var roundx = 1/Math.pow(10,(Math.round(Math.log(deltaX)/Math.log(10))));
-	}
-	else{
-		var roundx =  Math.pow(10,(Math.round(Math.log(deltaX)/Math.log(10))));
-	}
-	if(deltaY > 0){
-		var roundy = 1/Math.pow(10,(Math.round(Math.log(deltaY)/Math.log(10))));
-	}
-	else{
-		var roundy =  Math.pow(10,(Math.round(Math.log(deltaY)/Math.log(10))));
-	}	
-	var xtentx = maxX - minX;
-	var xtenty =  maxY - minY;
-	var posX = parseFloat(minX + (myClickX / width) * xtentx);
-	var posY = parseFloat(maxY - (myClickY / height) * xtenty);
-	posX = Math.round(posX * roundx)/roundx;
-	posY = Math.round(posY * roundy)/roundy;
-	return [posX, posY];
-}
-
-function makeRealWorld2mapPos(frameName,rw_posx, rw_posy){
-   var ind = getMapObjIndexByName(frameName);
-   var mpObj = mb_mapObj[ind]; 
-   var arrayBBox = mpObj.extent.split(",");
-   var minX = parseFloat(arrayBBox[0]);
-   var minY = parseFloat(arrayBBox[1]);
-   var maxX = parseFloat(arrayBBox[2]);
-   var maxY = parseFloat(arrayBBox[3]);
-   return [Math.round((rw_posx - minX)*mpObj.width/(maxX - minX)), Math.round((maxY - rw_posy)*mpObj.height/(maxY - minY))];
-}
-
-// function for object-identification 
-function getMapObjIndexByName(frameName){
-	for(var i=0; i<mb_mapObj.length; i++){
-		if(mb_mapObj[i].frameName == frameName){
-			return i;
-		}
-	}   
-}
-function getMapObjByName(frameName){
-	for(var i=0; i<mb_mapObj.length; i++){
-		if(mb_mapObj[i].frameName == frameName){
-			return mb_mapObj[i];
-		}
-	}
-	return false;
-}
-function getWMSIDByTitle(frameName,wms_title){
-   var ind = getMapObjIndexByName(frameName);
-   for(var i=0; i< mb_mapObj[ind].wms.length; i++){
-      if(mb_mapObj[ind].wms[i].wms_title == wms_title){
-         //return i;
-         return mb_mapObj[ind].wms[i].wms_id;
-      }
-   }
-}
-function getWMSIndexById(frameName,wms_id){
-   var ind = getMapObjIndexByName(frameName);
-   for(var i=0; i< mb_mapObj[ind].wms.length; i++){
-      if(mb_mapObj[ind].wms[i].wms_id == wms_id){
-         return i;
-      }
-   }
-}
-//scale
-function mb_getScale(frameName) {
-
-	var myScale = eventBeforeGetScale.trigger({"frameName":frameName});
-/*
-   for(var i=0; i<mb_GetScalePreFunctions.length; i++){
-		var myScale = eval(mb_GetScalePreFunctions[i]);
-	}
-*/
-   if(typeof(myScale) == "number"){
-      var Y_str = myScale;
-   }
-   else{
-      var ind = getMapObjIndexByName(frameName);
-      var arrayBBox = mb_mapObj[ind].extent.split(",");
-      var xtenty =  parseFloat(arrayBBox[3]) - parseFloat(arrayBBox[1]);
-      var scaleY = (xtenty / mb_mapObj[ind].height) *(mb_resolution * 100);
-      if (scaleY<1){
-      	var Y_str = scaleY;
-      }else{
-      	var Y_str = Math.round(scaleY);
-      }
-   }   
-   return Y_str;   
-}
-
-function mb_repaintScale(frameName, x, y, scale){
-   var ind = getMapObjIndexByName(frameName);
-   if(x === null && y === null){
-      var arrayBBox = mb_mapObj[ind].extent.split(",");
-      x = parseFloat(arrayBBox[0]) + ((parseFloat(arrayBBox[2]) - parseFloat(arrayBBox[0]))/2);
-      y = parseFloat(arrayBBox[1]) + ((parseFloat(arrayBBox[3]) - parseFloat(arrayBBox[1]))/2);
-   }
-   var minx = parseFloat(x) - (mb_mapObj[ind].width / (mb_resolution * 100 *2) * scale);
-   var miny = parseFloat(y) -  (mb_mapObj[ind].height / (mb_resolution * 100 *2) * scale);
-   var maxx = parseFloat(x) + (mb_mapObj[ind].width / (mb_resolution * 100 *2) * scale);
-   var maxy = parseFloat(y) +  (mb_mapObj[ind].height / (mb_resolution * 100 *2) * scale);
-   mb_repaint(frameName,minx, miny, maxx, maxy);
-}
-function mb_repaint(frameName,minx,miny,maxx,maxy){
-   var ind = getMapObjIndexByName(frameName);
-   mb_mapObj[ind].extent = minx + "," + miny + "," + maxx + "," + maxy;
-   setMapRequest(frameName);
-}
-/*
- * converts the extent of the mapobject so that the maximum	extent will be displayed {@link mb_mapObj_const#calculateExtent}
- * use: mb_mapObj.calculateExtent
- * @deprecated
- * 
- */
-function mb_calculateExtent(frameName,minx,miny,maxx,maxy){
-  var map = getMapObjByName(frameName);
-  var extent = new Extent(minx,miny,maxx,maxy);
-  map.calculateExtent(extent);
-}
-/*
- * @class extent
- * @param {float} minx
- * @param {float} miny
- * @param {float} maxx
- * @param {float} maxy
- * @return the extent as object
- * @type Object
- */
-function Extent(minx,miny,maxx,maxy){
-	this.minx = parseFloat(minx);
-	this.miny = parseFloat(miny);
-	this.maxx = parseFloat(maxx);
-	this.maxy = parseFloat(maxy);
-	this.extentx = this.maxx - this.minx;
-	this.extenty = this.maxy - this.miny;
-	this.centerx = this.minx + this.extentx/2;
-	this.centery = this.miny + this.extenty/2;	
-	return this;
-}
-
+var ie=document.all?1:0;var n6=document.getElementById&&!document.all?1:0;var n4=document.layers?1:0;var mb_mapObj=[];var mb_fiWin=null;var mb_panActive=false;var clickX;var clickY;var mb_start_x=0;var mb_start_y=0;var mb_end_x=0;var mb_end_y=0;var mb_offset_top=0;var mb_offset_right=0;var mb_offset_bottom=0;var mb_offset_left=0;var mb_log=null;function mb_removeFunctionFromArray(arrayname,stringFunction){var length=eval(arrayname+".length");for(var i=0;i<length;i++){if(eval(arrayname+"["+i+"]")==stringFunction){var newArray1=eval(arrayname+".slice(0, "+(i-1)+")");var newArray2=eval(arrayname+".slice("+(i+1)+", "+length+")");eval(arrayname+" = newArray1.concat(newArray2)");i--;length--;}}}
+function localize(){eventLocalize.trigger();}
+function mb_execloadWmsSubFunctions(){eventAfterLoadWMS.trigger();}
+function mb_execWfsReadSubFunctions(geom){for(var i=0;i<mb_WfsReadSubFunctions.length;i++){mb_WfsReadSubFunctions[i](geom);}}
+function mb_execWfsWriteSubFunctions(){for(var i=0;i<mb_WfsWriteSubFunctions.length;i++){mb_WfsWriteSubFunctions[i]();}}
+function mb_setWmcExtensionData(anArray){for(var i in anArray){if(typeof(anArray[i])!="undefined"){currentWmcExtensionData[i]=anArray[i];}}}
+function mb_getWmcExtensionData(arrayKey){for(var i in restoredWmcExtensionData){if(arrayKey==i){return restoredWmcExtensionData[i];}}
+var e=new Mb_warning("mb_getWmcExtensionData: "+arrayKey+" not found. Maybe this GUI does not allow loading or saving WMC documents from/to the session");return null;}
+var mb_security_proxy="http://wms1.ccgis.de/mapbender/tools/security_proxy.php?mb_ows_security_proxy=";var mb_trans=new Image();mb_trans.src="../img/transparent.gif";function init(){eventInitMap.trigger();eventInit.trigger();for(var i=0;i<mb_mapObj.length;i++){setMapRequest(mb_mapObj[i].frameName);}}
+function deleteWmsObject(){wms=[];wms_layer_count=0;}
+function deleteMapObj(){mb_mapObj=[];}
+function mb_registerMapObj(frameName,elementName,wms_index,width,height){mb_mapObj[mb_mapObj.length]=new mb_mapObj_const(frameName,elementName,width,height,wms_index);}
+function mb_mapObj_const(frameName,elementName,width,height,wms_index){this.width=width;this.height=height;this.frameName=frameName;this.elementName=elementName;this.layers=[];this.styles=[];this.querylayers=[];this.geom="";this.gml="";if(wms_index!==null){this.wms=[];this.wms[0]=wms[wms_index];this.wms[0].mapURL=false;var cnt_layers=0;var cnt_querylayers=0;var styles="";var layers="";var querylayers="";for(var ii=0;ii<this.wms[0].objLayer.length;ii++){if(this.wms[0].objLayer[ii].gui_layer_visible==1&&ii>0){if(cnt_layers>0){layers+=",";styles+=",";}
+layers+=this.wms[0].objLayer[ii].layer_name;styles+="";cnt_layers++;}
+if(this.wms[0].objLayer[ii].gui_layer_querylayer==1&&ii>0){if(cnt_querylayers>0){querylayers+=",";}
+querylayers+=this.wms[0].objLayer[ii].layer_name;cnt_querylayers++;}}
+this.layers[0]=layers;this.styles[0]=styles;this.querylayers[0]=querylayers;}
+else{this.wms=[];for(var i=0;i<wms.length;i++){this.wms[i]=wms[i];this.wms[i].mapURL=false;}
+for(i=0;i<this.wms.length;i++){var cnt_layers=0;var cnt_querylayers=0;var styles="";var layers="";var querylayers="";for(var ii=0;ii<this.wms[i].objLayer.length;ii++){if(this.wms[i].objLayer[ii].gui_layer_visible==1&&ii>0){if(cnt_layers>0){layers+=",";styles+=",";}
+layers+=wms[i].objLayer[ii].layer_name;styles+="";cnt_layers++;}
+if(this.wms[i].objLayer[ii].gui_layer_querylayer==1&&ii>0){if(cnt_querylayers>0){querylayers+=",";}
+querylayers+=wms[i].objLayer[ii].layer_name;cnt_querylayers++;}}
+this.layers[i]=layers;this.styles[i]=styles;this.querylayers[i]=querylayers;}}
+this.epsg=wms[0].gui_wms_epsg;this.extent=setExtent(this.width,this.height,this.epsg);this.mapURL=[];this.getWidth=function(){return parseInt(this.width,10);};this.setWidth=function(width){this.width=parseInt(width,10);};this.getHeight=function(){return parseInt(this.height,10);};this.setHeight=function(height){this.height=parseInt(height,10);};this.getExtent=function(){return this.extent;};this.getExtentInfos=function(){var c=this.getExtent().split(",");var ext=new Extent(c[0],c[1],c[2],c[3]);return ext;};this.calculateExtent=function(ext){var relation_px_x=this.getWidth()/this.getHeight();var relation_px_y=this.getHeight()/this.getWidth();var relation_bbox_x=ext.extentx/ext.extenty;if(relation_bbox_x<=relation_px_x){ext.minx=ext.centerx-relation_px_x*ext.extenty/2;ext.maxx=ext.centerx+relation_px_x*ext.extenty/2;}
+if(relation_bbox_x>relation_px_x){ext.miny=ext.centery-relation_px_y*ext.extentx/2;ext.maxy=ext.centery+relation_px_y*ext.extentx/2;}
+this.setExtent(ext.minx,ext.miny,ext.maxx,ext.maxy);};this.zoom=function(in_,factor,x,y){factor=parseFloat(factor);if(!in_){factor=1/factor;}
+var extent=this.getExtentInfos();var distx=extent.maxx-extent.minx;var disty=extent.maxy-extent.miny;if(x&&y){var centerx=parseFloat(x);var centery=parseFloat(y);}
+else{var centerx=extent.minx+distx/2;var centery=extent.miny+disty/2;}
+var new_distx=distx/factor;var new_disty=disty/factor;var minx=centerx-new_distx/2;var miny=centery-new_disty/2;var maxx=centerx+new_distx/2;var maxy=centery+new_disty/2;this.setExtent(minx,miny,maxx,maxy);};this.setExtent=function(minx,miny,maxx,maxy){this.extent=String(minx)+","+String(miny)+","+String(maxx)+","+String(maxy);};this.getSRS=function(){return this.epsg;};this.getMapRequests=function(){var allRequests=[];for(var i=0;i<this.wms.length;i++){var currentRequest=this.wms[i].getMapRequest(this);if(currentRequest){allRequests.push(currentRequest);}}
+if(allRequests.length>0){return allRequests;}
+return false;};this.getMapRequests=function(){var allRequests=[];for(var i=0;i<this.wms.length;i++){var currentRequest=this.wms[i].getMapRequest(this);if(currentRequest){allRequests.push(currentRequest);}}
+if(allRequests.length>0){return allRequests;}
+return false;};this.getFeatureInfoRequests=function(clickPoint){var allRequests=[];for(var i=0;i<this.wms.length;i++){var currentRequest=this.wms[i].getFeatureInfoRequest(this,clickPoint);if(currentRequest){allRequests.push(currentRequest);}}
+if(allRequests.length>0){return allRequests;}
+return false;};this.getScale=function(){var scale;var bbox=this.extent.split(",");var xtenty;if(this.epsg=="EPSG:4326"){var pxLenx=(parseFloat(bbox[2])-parseFloat(bbox[0]))/this.width;var pxLeny=(parseFloat(bbox[3])-parseFloat(bbox[1]))/this.height;var lat_from=((parseFloat(bbox[3])-parseFloat(bbox[1])/2)*Math.PI)/180;var lat_to=((parseFloat(bbox[3])-parseFloat(bbox[1])/2+pxLeny)*Math.PI)/180;var lon_from=((parseFloat(bbox[2])-parseFloat(bbox[0])/2)*Math.PI)/180;var lon_to=((parseFloat(bbox[2])-parseFloat(bbox[0])/2+pxLeny)*Math.PI)/180;var dist=6371229*Math.acos(Math.sin(lat_from)*Math.sin(lat_to)+Math.cos(lat_from)*Math.cos(lat_to)*Math.cos(lon_from-lon_to));scale=(dist/Math.SQRT2)*(mb_resolution*100);}else{xtenty=parseFloat(bbox[3])-parseFloat(bbox[1]);scale=(xtenty/this.height)*(mb_resolution*100);}
+return Math.round(scale);};this.move=function(wms_id,layer_id,moveUp){var i,j;for(i=0;i<this.wms.length;i++){if(wms_id==this.wms[i].wms_id){break;}}
+if(layer_id&&layer_id!=this.wms[i].objLayer[0].layer_id){return this.wms[i].moveLayer(layer_id,moveUp);}
+j=i+(moveUp?-1:1);if(!(i!=j&&i>=0&&i<this.wms.length&&j>=0&&j<this.wms.length)){return false;}
+upper=this.wms[i];this.wms[i]=this.wms[j];this.wms[j]=upper;var upperLayers=this.layers[i];var upperStyles=this.styles[i];var upperQuerylayers=this.querylayers[i];this.layers[i]=this.layers[j];this.styles[i]=this.styles[j];this.querylayers[i]=this.querylayers[j];this.layers[j]=upperLayers;this.styles[j]=upperStyles;this.querylayers[j]=upperQuerylayers;return true;};eventAfterMapObjectConstruction.trigger();}
+function mb_getConjunctionCharacter(onlineresource){var conChar;if(onlineresource.indexOf("?")>-1){if(onlineresource.charAt(onlineresource.length-1)=="?"){conChar="";}else if(onlineresource.charAt(onlineresource.length-1)=="&"){conChar="";}else{conChar="&";}}
+if(onlineresource.indexOf("?")==-1){conChar="?";}
+return conChar;}
+function mb_moveWmsById(mapObj_ind,wms_id,toIndex){return mb_wmsMoveByIndex(mapObj_ind,getWMSIndexById(mapObj_ind,wms_id),toIndex);}
+function mb_wmsMoveByIndex(mapObj_ind,fromIndex,toIndex){if(fromIndex!=toIndex&&fromIndex>=0&&fromIndex<mb_mapObj[mapObj_ind].wms.length&&toIndex>=0&&toIndex<mb_mapObj[mapObj_ind].wms.length){var changed=false;if(fromIndex>toIndex){for(var i=fromIndex;i>toIndex;i--){var result=mb_swapWmsByIndex(mapObj_ind,i-1,i);if(result===true){changed=true;}}}
+else{for(var i=fromIndex;i<toIndex;i++){var result=mb_swapWmsByIndex(mapObj_ind,i,i+1);if(result===true){changed=true;}}}
+return changed;}
+else{return false;}}
+function mb_swapWmsById(mapObj_ind,wms1_id,wms2_id){return mb_swapWmsByIndex(mapObj_ind,getWMSIndexById(mapObj_ind,wms1_id),getWMSIndexById(mapObj_ind,wms2_id));}
+function mb_swapWmsByIndex(mapObj_ind,indexA,indexB){if(indexA!=indexB&&indexA>=0&&indexA<mb_mapObj[mapObj_ind].wms.length&&indexB>=0&&indexB<mb_mapObj[mapObj_ind].wms.length){upper=mb_mapObj[mapObj_ind].wms[indexA];mb_mapObj[mapObj_ind].wms[indexA]=mb_mapObj[mapObj_ind].wms[indexB];mb_mapObj[mapObj_ind].wms[indexB]=upper;var upperLayers=mb_mapObj[mapObj_ind].layers[indexA];var upperStyles=mb_mapObj[mapObj_ind].styles[indexA];var upperQuerylayers=mb_mapObj[mapObj_ind].querylayers[indexA];mb_mapObj[mapObj_ind].layers[indexA]=mb_mapObj[mapObj_ind].layers[indexB];mb_mapObj[mapObj_ind].styles[indexA]=mb_mapObj[mapObj_ind].styles[indexB];mb_mapObj[mapObj_ind].querylayers[indexA]=mb_mapObj[mapObj_ind].querylayers[indexB];mb_mapObj[mapObj_ind].layers[indexB]=upperLayers;mb_mapObj[mapObj_ind].styles[indexB]=upperStyles;mb_mapObj[mapObj_ind].querylayers[indexB]=upperQuerylayers;return true;}
+else{return false;}}
+function mb_moveUpWmsByIndex(mapObj_ind,index){if(index>0&&index<wms.length){return mb_swapWmsByIndex(mapObj_ind,index-1,index);}
+else{return false;}}
+function mb_moveDownWmsByIndex(mapObj_ind,index){if(index>=0&&index<wms.length-1){return mb_swapWmsByIndex(mapObj_ind,index,index+1);}
+else{return false;}}
+function mb_mapObjaddWMS(obj){var cnt_layers=0;var cnt_querylayers=0;var styles="";var layers="";var querylayers="";var ind=getMapObjIndexByName(obj);for(var i=0;i<(wms.length-1);i++){if(parseInt(wms[i].wms_id,10)>=parseInt(wms[wms.length-1].wms_id,10)){wms[wms.length-1].wms_id=parseInt(mb_mapObj[ind].wms[i].wms_id,10)+1;}}
+mb_mapObj[ind].wms[mb_mapObj[ind].wms.length]=wms[wms.length-1];mb_mapObj[ind].layers[mb_mapObj[ind].layers.length]=layers;mb_mapObj[ind].styles[mb_mapObj[ind].styles.length]=styles;mb_mapObj[ind].querylayers[mb_mapObj[ind].querylayers.length]=querylayers;mb_execloadWmsSubFunctions();return true;}
+function mb_mapObjaddWMSwithLayers(obj,layers,querylayers){var cnt_layers=0;var cnt_querylayers=0;var styles="";var ind=getMapObjIndexByName(obj);mb_mapObj[ind].wms[mb_mapObj[ind].wms.length]=wms[wms.length-1];mb_mapObj[ind].layers[mb_mapObj[ind].layers.length]=layers;mb_mapObj[ind].styles[mb_mapObj[ind].styles.length]=styles;mb_mapObj[ind].querylayers[mb_mapObj[ind].querylayers.length]=querylayers;}
+function mb_mapObjremoveWMS(objind,wmsind){var wms_ID=null;var new_wmsarray=[];var new_layerarray=[];var new_querylayerarray=[];var new_stylesarray=[];var new_mapURLarray=[];for(var i=0;i<mb_mapObj[objind].wms.length;i++){if(i!=wmsind){new_wmsarray[new_wmsarray.length]=mb_mapObj[objind].wms[i];new_layerarray[new_layerarray.length]=mb_mapObj[objind].layers[i];new_querylayerarray[new_querylayerarray.length]=mb_mapObj[objind].querylayers[i];new_stylesarray[new_stylesarray.length]=mb_mapObj[objind].styles[i];new_mapURLarray[new_mapURLarray.length]=mb_mapObj[objind].mapURL[i];}
+else{wms_ID=mb_mapObj[objind].wms[i].wms_id;}}
+mb_mapObj[objind].wms=new_wmsarray;mb_mapObj[objind].layers=new_layerarray;mb_mapObj[objind].querylayers=new_querylayerarray;mb_mapObj[objind].styles=new_stylesarray;mb_mapObj[objind].mapURL=new_mapURLarray;var another_new_wmsarray=[];for(var i=0;i<wms.length;i++){if(wms[i].wms_id!=wms_ID){another_new_wmsarray[another_new_wmsarray.length]=wms[i];}}
+wms=another_new_wmsarray;}
+function setExtent(width,height,epsg){for(var i=0;i<wms[0].gui_epsg.length;i++){if(wms[0].gui_epsg[i]==epsg){var bbox_minx=parseFloat(wms[0].gui_minx[i]);var bbox_miny=parseFloat(wms[0].gui_miny[i]);var bbox_maxx=parseFloat(wms[0].gui_maxx[i]);var bbox_maxy=parseFloat(wms[0].gui_maxy[i]);var extenty=bbox_maxy-bbox_miny;var extentx=bbox_maxx-bbox_minx;var relation_px_x=width/height;var relation_px_y=height/width;var relation_bbox_x=extentx/extenty;var centerx=bbox_minx+(extentx/2);var centery=bbox_miny+(extenty/2);if(relation_bbox_x<=relation_px_x){bbox_minx=centerx-relation_px_x*extenty/2;bbox_maxx=centerx+relation_px_x*extenty/2;}
+if(relation_bbox_x>relation_px_x){bbox_miny=centery-relation_px_y*extentx/2;bbox_maxy=centery+relation_px_y*extentx/2;}
+return bbox_minx+","+bbox_miny+","+bbox_maxx+","+bbox_maxy;}}}
+function setMapRequest(frameName){var functionName='setMapRequest';var ts=mb_timestamp();var ret=eventBeforeMapRequest.trigger({frameName:frameName},"AND");if(ret===false){return true;}
+for(var i=0;i<mb_mapObj.length;i++){var newMapRequest="";if(mb_mapObj[i].frameName==frameName){for(var ii=0;ii<mb_mapObj[i].wms.length;ii++){if(mb_mapObj[i].wms[ii].gui_wms_visible>0){var myDivId="div_"+ii;var myMapId="map_"+ii;var validLayers=mb_checkScale(frameName,i,ii);var layerNames=validLayers.toString();if(mb_mapObj[i].layers[ii]!==""&&layerNames!==''){var newMapURL="";if(mb_mapObj[i].wms[ii].gui_wms_mapopacity!=1){var cadenaOpacity="opacity:"+mb_mapObj[i].wms[ii].gui_wms_mapopacity+"; Filter: Alpha(Opacity="+mb_mapObj[i].wms[ii].gui_wms_mapopacity*100+"); -moz-opacity:"+mb_mapObj[i].wms[ii].gui_wms_mapopacity+" ; -khtml-opacity:"+mb_mapObj[i].wms[ii].gui_wms_mapopacity;newMapRequest+="<div id='"+myDivId+"' style=\"position:absolute; top:0px; left:0px; z-index:"+ii+";"+cadenaOpacity+"\">";}
+else{newMapRequest+="<div id='"+myDivId+"' style='position:absolute; top:0px; left:0px; z-index:"+ii+"'>";}
+newMapRequest+="<img id='"+myMapId+"' name='mapimage' src='";newMapURL+=mb_mapObj[i].wms[ii].wms_getmap;newMapURL+=mb_getConjunctionCharacter(mb_mapObj[i].wms[ii].wms_getmap);if(mb_mapObj[i].wms[ii].wms_version=="1.0.0"){newMapURL+="WMTVER="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=map&";}
+if(mb_mapObj[i].wms[ii].wms_version!="1.0.0"){newMapURL+="VERSION="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=GetMap&SERVICE=WMS&";}
+newMapURL+="LAYERS="+layerNames+"&";newMapURL+="STYLES=";var layer=layerNames.split(",");for(var j=0;j<layer.length;j++){if(j>0){newMapURL+=",";}
+if(mb_mapObj[i].wms[ii].getCurrentStyleByLayerName(layer[j])===false){newMapURL+="";}
+else{newMapURL+=mb_mapObj[i].wms[ii].getCurrentStyleByLayerName(layer[j]);}}
+newMapURL+="&";newMapURL+="SRS="+mb_mapObj[i].epsg+"&";newMapURL+="BBOX="+mb_mapObj[i].extent+"&";newMapURL+="WIDTH="+mb_mapObj[i].width+"&";newMapURL+="HEIGHT="+mb_mapObj[i].height+"&";newMapURL+="FORMAT="+mb_mapObj[i].wms[ii].gui_wms_mapformat+"&";newMapURL+="BGCOLOR=0xffffff&";if(mb_mapObj[i].wms[ii].gui_wms_mapformat.search(/gif/i)>-1||mb_mapObj[i].wms[ii].gui_wms_mapformat.search(/png/i)>-1){newMapURL+="TRANSPARENT=TRUE&";}
+newMapURL+="EXCEPTIONS="+mb_mapObj[i].wms[ii].gui_wms_exceptionformat;for(var v=0;v<mb_vendorSpecific.length;v++){var vendorSpecificString=eval(mb_vendorSpecific[v]);if(typeof(vendorSpecificString)!="undefined"){newMapURL+="&"+vendorSpecificString;}}
+if(mb_mapObj[i].wms[ii].wms_filter){var tmp=mb_mapObj[i].wms[ii].wms_filter+"?id="+mb_styleID;var temp="&SLD="+tmp+"&";newMapURL+=temp;}
+if(mb_mapObj[i].wms[ii].gui_wms_sldurl){var temp="&SLD="+escape(mb_mapObj[i].wms[ii].gui_wms_sldurl)+"&";newMapURL+=temp;}
+if(mb_log){var tmp=eval(mb_log+"('"+newMapURL+"','"+ts+"')");}
+newMapRequest+=newMapURL;mb_mapObj[i].mapURL[ii]=newMapURL;mb_mapObj[i].wms[ii].mapURL=newMapURL;newMapRequest+="' width='"+mb_mapObj[i].width+"' height='"+mb_mapObj[i].height+"' border='0'></div>";}
+else{mb_mapObj[i].mapURL[ii]=false;mb_mapObj[i].wms[ii].mapURL=false;newMapRequest+="<div id='"+myDivId+"' style='position:absolute; top:0px; left:0px; z-index:"+ii+"'>";newMapRequest+="<img id='"+myMapId+"' name='mapimage' src='"+mb_trans.src;newMapRequest+="' width='"+mb_mapObj[i].width+"' height='"+mb_mapObj[i].height+"' border='0'>";newMapRequest+="</div>";}}}
+writeTag(mb_mapObj[i].frameName,mb_mapObj[i].elementName,newMapRequest);}}
+eventAfterMapRequest.trigger({"frameName":frameName,"myMapId":myMapId});}
+function setSingleMapRequest(frameName,wms_id){var functionName='setSingleMapRequest';var ts=mb_timestamp();eventBeforeMapRequest.trigger({frameName:frameName});for(i=0;i<mb_mapObj.length;i++){var newMapRequest="";if(mb_mapObj[i].frameName==frameName){for(var ii=0;ii<mb_mapObj[i].wms.length;ii++){var myDivId="div_"+ii;var myMapId="map_"+ii;var validLayers=mb_checkScale(frameName,i,ii);var layerNames=validLayers.toString();if(mb_mapObj[i].wms[ii].wms_id==wms_id){var newMapURL="";newMapRequest+="<img id='"+myMapId+"' name='mapimage' src='";newMapURL+=mb_mapObj[i].wms[ii].wms_getmap;newMapURL+=mb_getConjunctionCharacter(mb_mapObj[i].wms[ii].wms_getmap);if(mb_mapObj[i].wms[ii].wms_version=="1.0.0"){newMapURL+="WMTVER="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=map&";}
+if(mb_mapObj[i].wms[ii].wms_version!="1.0.0"){newMapURL+="VERSION="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=GetMap&SERVICE=WMS&";}
+newMapURL+="LAYERS="+layerNames+"&";var layer=layerNames.split(",");newMapURL+="STYLES=";for(var j=0;j<layer.length;j++){if(j>0){newMapURL+=",";}
+if(mb_mapObj[i].wms[ii].getCurrentStyleByLayerName(layer[j])===false){newMapURL+="";}
+else{newMapURL+=mb_mapObj[i].wms[ii].getCurrentStyleByLayerName(layer[j]);}}
+newMapURL+="&";newMapURL+="SRS="+mb_mapObj[i].epsg+"&";newMapURL+="BBOX="+mb_mapObj[i].extent+"&";newMapURL+="WIDTH="+mb_mapObj[i].width+"&";newMapURL+="HEIGHT="+mb_mapObj[i].height+"&";newMapURL+="FORMAT="+mb_mapObj[i].wms[ii].gui_wms_mapformat+"&";newMapURL+="BGCOLOR=0xffffff&";if(mb_mapObj[i].wms[ii].gui_wms_mapformat.search(/gif/i)>-1||mb_mapObj[i].wms[ii].gui_wms_mapformat.search(/png/i)>-1){newMapURL+="TRANSPARENT=TRUE&";}
+newMapURL+="EXCEPTIONS="+mb_mapObj[i].wms[ii].gui_wms_exceptionformat;for(var v=0;v<mb_vendorSpecific.length;v++){var vendorSpecificString=eval(mb_vendorSpecific[v]);if(typeof(vendorSpecificString)!="undefined"){newMapURL+="&"+vendorSpecificString;}}
+if(mb_mapObj[i].wms[ii].wms_filter){var tmp=mb_mapObj[i].wms[ii].wms_filter+"?id="+mb_styleID;var temp="&SLD="+tmp+"&";newMapURL+=temp;}
+if(mb_mapObj[i].wms[ii].gui_wms_sldurl){var temp="&SLD="+escape(mb_mapObj[i].wms[ii].gui_wms_sldurl)+"&";newMapURL+=temp;}
+if(mb_mapObj[i].layers[ii]!==""&&layerNames!==''){newMapRequest+=newMapURL;mb_mapObj[i].mapURL[ii]=newMapURL;mb_mapObj[i].wms[ii].mapURL=newMapURL;newMapRequest+="' width='"+mb_mapObj[i].width+"' height='"+mb_mapObj[i].height+"' border='0'>";}
+else{mb_mapObj[i].mapURL[ii]=false;mb_mapObj[i].wms[ii].mapURL=false;newMapRequest="<img id='"+myMapId+"' name='mapimage' src='"+mb_trans.src;newMapRequest+="' width='"+mb_mapObj[i].width+"' height='"+mb_mapObj[i].height+"' border='0'>";}
+if(mb_log){var tmp=eval(mb_log+"('"+newMapURL+"','"+ts+"')");}
+writeTag(mb_mapObj[i].frameName,myDivId,newMapRequest);}}}}
+eventAfterMapRequest.trigger({"frameName":frameName,"myMapId":myMapId});}
+function mb_restateLayers(frameName,wms_id){var ind=getMapObjIndexByName(frameName);for(var i=0;i<mb_mapObj[ind].wms.length;i++){if(mb_mapObj[ind].wms[i].wms_id==wms_id){var cnt_layers=0;var cnt_querylayers=0;var layers="";var styles="";var querylayers="";for(var ii=0;ii<mb_mapObj[ind].wms[i].objLayer.length;ii++){if(mb_mapObj[ind].wms[i].objLayer[ii].gui_layer_visible==1&&!mb_mapObj[ind].wms[i].objLayer[ii].has_childs){if(cnt_layers>0){layers+=",";styles+=",";}
+layers+=mb_mapObj[ind].wms[i].objLayer[ii].layer_name;styles+="";cnt_layers++;}
+if(mb_mapObj[ind].wms[i].objLayer[ii].gui_layer_querylayer==1&&!mb_mapObj[ind].wms[i].objLayer[ii].has_childs){if(cnt_querylayers>0){querylayers+=",";}
+querylayers+=mb_mapObj[ind].wms[i].objLayer[ii].layer_name;cnt_querylayers++;}}
+mb_mapObj[ind].layers[i]=layers;mb_mapObj[ind].querylayers[i]=querylayers;mb_mapObj[ind].styles[i]=styles;}}}
+function mb_checkScale(frameName,mObj,wmsObj){var thisLayer=mb_mapObj[mObj].layers[wmsObj].split(",");var thisScale=mb_getScale(frameName);var str_layer="";var cnt_layer=0;for(var i=0;i<mb_mapObj[mObj].wms[wmsObj].objLayer.length;i++){var myLayername=mb_mapObj[mObj].wms[wmsObj].objLayer[i].layer_name;var myMinscale=mb_mapObj[mObj].wms[wmsObj].objLayer[i].gui_layer_minscale;var myMaxscale=mb_mapObj[mObj].wms[wmsObj].objLayer[i].gui_layer_maxscale;for(var ii=0;ii<thisLayer.length;ii++){var minscaleOK=false;var maxscaleOK=false;if(thisLayer[ii]==myLayername){if(myMinscale===0||thisScale>=myMinscale){minscaleOK=true;}
+if(myMaxscale===0||thisScale<=myMaxscale){maxscaleOK=true;}
+if(maxscaleOK===true&&minscaleOK===true&&!mb_mapObj[mObj].wms[wmsObj].objLayer[i].has_childs){if(cnt_layer>0){str_layer+=",";}
+str_layer+=thisLayer[ii];cnt_layer++;}}}}
+var str_layerstyles=[];str_layerstyles[0]=str_layer;return str_layerstyles;}
+function setFeatureInfoRequest(fName,x,y,path){var functionName='setFeatureInfoRequest';var ts=mb_timestamp();eventBeforeFeatureInfo.trigger({"fName":fName});var cnt_fi=0;for(i=0;i<mb_mapObj.length;i++){if(mb_mapObj[i].frameName==fName){for(var ii=0;ii<mb_mapObj[i].wms.length;ii++){var newfeatureInfoRequest="";var requestParams="";var validation=false;newfeatureInfoRequest+=mb_mapObj[i].wms[ii].wms_getfeatureinfo;newfeatureInfoRequest+=mb_getConjunctionCharacter(mb_mapObj[i].wms[ii].wms_getfeatureinfo);if(mb_mapObj[i].wms[ii].wms_version=="1.0.0"){requestParams+="WMTVER="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=feature_info&";}
+if(mb_mapObj[i].wms[ii].wms_version!="1.0.0"){requestParams+="VERSION="+mb_mapObj[i].wms[ii].wms_version+"&REQUEST=GetFeatureInfo&SERVICE=WMS&";}
+requestParams+="SRS="+mb_mapObj[i].epsg+"&";requestParams+="BBOX="+mb_mapObj[i].extent+"&";requestParams+="WIDTH="+mb_mapObj[i].width+"&";requestParams+="HEIGHT="+mb_mapObj[i].height+"&";requestParams+="LAYERS="+mb_mapObj[i].layers[ii]+"&";requestParams+="STYLES="+mb_mapObj[i].styles[ii]+"&";requestParams+="FORMAT="+mb_mapObj[i].wms[ii].gui_wms_mapformat+"&";requestParams+="INFO_FORMAT="+mb_mapObj[i].wms[ii].gui_wms_featureinfoformat+"&";requestParams+="EXCEPTIONS=application/vnd.ogc.se_xml&";if(mb_feature_count>0){requestParams+="FEATURE_COUNT="+mb_feature_count+"&";}
+requestParams+="QUERY_LAYERS="+mb_mapObj[i].querylayers[ii]+"&";requestParams+="X="+x+"&";requestParams+="Y="+y;if(mb_mapObj[i].querylayers[ii]!==""&&mb_mapObj[i].layers[ii]!==""){validation=true;}
+for(var v=0;v<mb_vendorSpecific.length;v++){var vendorSpecificString=eval(mb_vendorSpecific[v]);requestParams+="&"+vendorSpecificString;}
+if(mb_log&&validation){var tmp=eval(mb_log+"('"+newfeatureInfoRequest+requestParams+"','"+ts+"')");}
+if(document.getElementById("FeatureInfoRedirect")&&validation){newfeatureInfoRequest+=requestParams;if(path){window.frames.FeatureInfoRedirect.document.getElementById(mb_mapObj[i].wms[ii].wms_id).src=path+"?url="+escape(newfeatureInfoRequest)+"&"+mb_nr;}
+else{window.frames.FeatureInfoRedirect.document.getElementById(mb_mapObj[i].wms[ii].wms_id).src=newfeatureInfoRequest;}
+cnt_fi++;}
+else if(path&&validation){newfeatureInfoRequest+=requestParams;(function(){var currentRequest=newfeatureInfoRequest;mb_ajax_post(path,{'url':currentRequest},function(js_code,status){if(js_code){try{var p=new mb_popup({title:"Feature Info",url:path+"?url="+escape(currentRequest)+"&"+mb_nr,width:600,height:500,top:200,left:600});p.show();}catch(e){window.open(path+"?url="+escape(currentRequest)+"&"+mb_nr,"","width=300,height=400,scrollbars=yes,resizable=yes");}}
+else{var e=new Mb_exception("No featureInfo results.");}});}());cnt_fi++;}
+else if(validation){newfeatureInfoRequest+=requestParams;try{var p=new mb_popup({title:"Feature Info",url:newfeatureInfoRequest,width:600,height:500,top:200,left:600});p.show();}
+catch(e){window.open(newfeatureInfoRequest,"","width=300,height=400,scrollbars=yes,resizable=yes");}
+cnt_fi++;}}}}
+if(cnt_fi===0){alert(unescape("Please select a layer! \n Bitte waehlen Sie eine Ebene zur Abfrage aus!"));}}
+function zoom(frameName,in_,factor,x,y){var obj=getMapObjByName(frameName);if(x&&y){obj.zoom(in_,factor,x,y);}
+else{obj.zoom(in_,factor,false,false);}
+setMapRequest(frameName);}
+function mb_panMap(frameName,dir){var ind=getMapObjIndexByName(frameName);var arrayBBox=mb_mapObj[ind].extent.split(",");var minx=parseFloat(arrayBBox[0]);var miny=parseFloat(arrayBBox[1]);var maxx=parseFloat(arrayBBox[2]);var maxy=parseFloat(arrayBBox[3]);var xtentx=parseFloat(arrayBBox[2])-parseFloat(arrayBBox[0]);var xtenty=parseFloat(arrayBBox[3])-parseFloat(arrayBBox[1]);if(dir=="NW"){minx=minx-(xtentx/2);maxx=maxx-(xtentx/2);miny=miny+(xtenty/2);maxy=maxy+(xtenty/2);}
+if(dir=="N"){miny=miny+(xtenty/2);maxy=maxy+(xtenty/2);}
+if(dir=="NE"){minx=minx+(xtentx/2);maxx=maxx+(xtentx/2);miny=miny+(xtenty/2);maxy=maxy+(xtenty/2);}
+if(dir=="W"){minx=minx-(xtentx/2);maxx=maxx-(xtentx/2);}
+if(dir=="E"){minx=minx+(xtentx/2);maxx=maxx+(xtentx/2);}
+if(dir=="SW"){minx=minx-(xtentx/2);maxx=maxx-(xtentx/2);miny=miny-(xtenty/2);maxy=maxy-(xtenty/2);}
+if(dir=="S"){miny=miny-(xtenty/2);maxy=maxy-(xtenty/2);}
+if(dir=="SE"){minx=minx+(xtentx/2);maxx=maxx+(xtentx/2);miny=miny-(xtenty/2);maxy=maxy-(xtenty/2);}
+mb_mapObj[ind].extent=minx+","+miny+","+maxx+","+maxy;setMapRequest(frameName);}
+function handleSelectedLayer(frameName,wms_title,layerName,type,status){for(var i=0;i<mb_mapObj.length;i++){if(mb_mapObj[i].frameName==frameName){var cnt_layer=0;var str_layer="";var myMapObj=i;for(var ii=0;ii<mb_mapObj[i].wms.length;ii++){if(mb_mapObj[i].wms[ii].wms_title==wms_title){var myWMS=ii;if(type=="visible"){var arrayLayer=mb_mapObj[i].layers[ii].split(",");}
+if(type=="querylayer"){var arrayLayer=mb_mapObj[i].querylayers[ii].split(",");}
+for(var iii=1;iii<mb_mapObj[i].wms[ii].objLayer.length;iii++){var layer_name=mb_mapObj[i].wms[ii].objLayer[iii].layer_name;if(type=="querylayer"){if(layer_name==layerName&&status==1&&mb_mapObj[i].wms[ii].objLayer[iii].layer_queryable==1){if(cnt_layer>0){str_layer+=",";}
+str_layer+=layer_name;cnt_layer++;}}
+else if(type=="visible"){if(layer_name==layerName&&status==1){if(cnt_layer>0){str_layer+=",";}
+str_layer+=layer_name;cnt_layer++;}}
+for(var iiii=0;iiii<arrayLayer.length;iiii++){if(layer_name==arrayLayer[iiii]&&layer_name!=layerName){if(cnt_layer>0){str_layer+=",";}
+str_layer+=layer_name;cnt_layer++;}}}}}}}
+if(type=="visible"){mb_mapObj[myMapObj].layers[myWMS]=str_layer;var array_str_layer=str_layer.split(",");var str_styles="";for(var cnt=0;cnt<array_str_layer.length;cnt++){if(cnt>0){str_styles+=",";}
+str_styles+="";}
+mb_mapObj[myMapObj].styles[myWMS]=str_styles;}
+if(type=="querylayer"){mb_mapObj[myMapObj].querylayers[myWMS]=str_layer;}}
+function handleSelectedLayer_array(mapObj,array_wms,array_layer,type,status){var ind=getMapObjIndexByName(mapObj);for(var j=0;j<array_wms.length;j++){for(var i=0;i<mb_mapObj[ind].wms.length;i++){if(mb_mapObj[ind].wms[i].wms_id==array_wms[j]){var check=false;for(var ii=0;ii<mb_mapObj[ind].wms[i].objLayer.length;ii++){if(mb_mapObj[ind].wms[i].wms_id==array_wms[j]&&mb_mapObj[ind].wms[i].objLayer[ii].layer_name==array_layer[j]){if(type=="visible"){mb_mapObj[ind].wms[i].objLayer[ii].gui_layer_visible=parseInt(status,10);check=true;}
+if(type=="querylayer"&&(mb_mapObj[ind].wms[i].objLayer[ii].gui_layer_queryable=="1"||mb_mapObj[ind].wms[i].objLayer[ii].gui_layer_queryable==1)){mb_mapObj[ind].wms[i].objLayer[ii].gui_layer_querylayer=parseInt(status,10);}}}
+mb_restateLayers(mapObj,array_wms[j]);if(check===true){if(mb_mapObj[ind].wms[i].gui_wms_visible==1){setSingleMapRequest(mapObj,mb_mapObj[ind].wms[i].wms_id);}}}}}}
+function makeClickPos2RealWorldPos(frameName,myClickX,myClickY){var ind=getMapObjIndexByName(frameName);var width=parseInt(mb_mapObj[ind].width,10);var height=parseInt(mb_mapObj[ind].height,10);var arrayBBox=mb_mapObj[ind].extent.split(",");var minX=parseFloat(arrayBBox[0]);var minY=parseFloat(arrayBBox[1]);var maxX=parseFloat(arrayBBox[2]);var maxY=parseFloat(arrayBBox[3]);var deltaX=(maxX-minX)/width;var deltaY=(maxY-minY)/height;if(deltaX>0){var roundx=1/Math.pow(10,(Math.round(Math.log(deltaX)/Math.log(10))));}
+else{var roundx=Math.pow(10,(Math.round(Math.log(deltaX)/Math.log(10))));}
+if(deltaY>0){var roundy=1/Math.pow(10,(Math.round(Math.log(deltaY)/Math.log(10))));}
+else{var roundy=Math.pow(10,(Math.round(Math.log(deltaY)/Math.log(10))));}
+var xtentx=maxX-minX;var xtenty=maxY-minY;var posX=parseFloat(minX+(myClickX/width)*xtentx);var posY=parseFloat(maxY-(myClickY/height)*xtenty);posX=Math.round(posX*roundx)/roundx;posY=Math.round(posY*roundy)/roundy;return[posX,posY];}
+function makeRealWorld2mapPos(frameName,rw_posx,rw_posy){var ind=getMapObjIndexByName(frameName);var mpObj=mb_mapObj[ind];var arrayBBox=mpObj.extent.split(",");var minX=parseFloat(arrayBBox[0]);var minY=parseFloat(arrayBBox[1]);var maxX=parseFloat(arrayBBox[2]);var maxY=parseFloat(arrayBBox[3]);return[Math.round((rw_posx-minX)*mpObj.width/(maxX-minX)),Math.round((maxY-rw_posy)*mpObj.height/(maxY-minY))];}
+function mb_arrangeElement(frameName,elName,left,top){if(frameName!==""){window.frames[frameName].document.getElementById(elName).style.top=top;window.frames[frameName].document.getElementById(elName).style.left=left;}
+else{document.getElementById(elName).style.top=top;document.getElementById(elName).style.left=left;}}
+function mb_getMousePos(e,fName){if(fName){if(ie){clickX=window.frames[fName].event.clientX;clickY=window.frames[fName].event.clientY;}
+else{clickX=e.pageX;clickY=e.pageY;}}
+else{if(ie){clickX=event.clientX;clickY=event.clientY;}
+else{clickX=e.pageX;clickY=e.pageY;}}
+var pos=[clickX,clickY];return pos;}
+function getMapObjIndexByName(frameName){for(var i=0;i<mb_mapObj.length;i++){if(mb_mapObj[i].frameName==frameName){return i;}}}
+function getMapObjByName(frameName){for(var i=0;i<mb_mapObj.length;i++){if(mb_mapObj[i].frameName==frameName){return mb_mapObj[i];}}
+return false;}
+function mb_getLayerTitleByName(map_index,wms_index,myLayer_name){for(var i=0;i<mb_mapObj[map_index].wms[wms_index].objLayer.length;i++){if(mb_mapObj[map_index].wms[wms_index].objLayer[i].layer_name==myLayer_name){return mb_mapObj[map_index].wms[wms_index].objLayer[i].layer_title;}}}
+function getWMSIDByTitle(frameName,wms_title){var ind=getMapObjIndexByName(frameName);for(var i=0;i<mb_mapObj[ind].wms.length;i++){if(mb_mapObj[ind].wms[i].wms_title==wms_title){return mb_mapObj[ind].wms[i].wms_id;}}}
+function getWMSIndexByTitle(frameName,wms_title){var ind=getMapObjIndexByName(frameName);for(var i=0;i<mb_mapObj[ind].wms.length;i++){if(mb_mapObj[ind].wms[i].wms_title==wms_title){return i;}}}
+function getWMSIndexById(frameName,wms_id){var ind=getMapObjIndexByName(frameName);for(var i=0;i<mb_mapObj[ind].wms.length;i++){if(mb_mapObj[ind].wms[i].wms_id==wms_id){return i;}}}
+function mb_getScale(frameName){var myScale=eventBeforeGetScale.trigger({"frameName":frameName});if(typeof(myScale)=="number"){var Y_str=myScale;}
+else{var ind=getMapObjIndexByName(frameName);var arrayBBox=mb_mapObj[ind].extent.split(",");var xtenty=parseFloat(arrayBBox[3])-parseFloat(arrayBBox[1]);var scaleY=(xtenty/mb_mapObj[ind].height)*(mb_resolution*100);if(scaleY<1){var Y_str=scaleY;}else{var Y_str=Math.round(scaleY);}}
+return Y_str;}
+function mb_repaintScale(frameName,x,y,scale){var ind=getMapObjIndexByName(frameName);if(x===null&&y===null){var arrayBBox=mb_mapObj[ind].extent.split(",");x=parseFloat(arrayBBox[0])+((parseFloat(arrayBBox[2])-parseFloat(arrayBBox[0]))/2);y=parseFloat(arrayBBox[1])+((parseFloat(arrayBBox[3])-parseFloat(arrayBBox[1]))/2);}
+var minx=parseFloat(x)-(mb_mapObj[ind].width/(mb_resolution*100*2)*scale);var miny=parseFloat(y)-(mb_mapObj[ind].height/(mb_resolution*100*2)*scale);var maxx=parseFloat(x)+(mb_mapObj[ind].width/(mb_resolution*100*2)*scale);var maxy=parseFloat(y)+(mb_mapObj[ind].height/(mb_resolution*100*2)*scale);mb_repaint(frameName,minx,miny,maxx,maxy);}
+function mb_repaint(frameName,minx,miny,maxx,maxy){var ind=getMapObjIndexByName(frameName);mb_mapObj[ind].extent=minx+","+miny+","+maxx+","+maxy;setMapRequest(frameName);}
+function mb_calculateExtent(frameName,minx,miny,maxx,maxy){var map=getMapObjByName(frameName);var extent=new Extent(minx,miny,maxx,maxy);map.calculateExtent(extent);}
+function Extent(minx,miny,maxx,maxy){this.minx=parseFloat(minx);this.miny=parseFloat(miny);this.maxx=parseFloat(maxx);this.maxy=parseFloat(maxy);this.extentx=this.maxx-this.minx;this.extenty=this.maxy-this.miny;this.centerx=this.minx+this.extentx/2;this.centery=this.miny+this.extenty/2;return this;}
+function mb_showHighlight(frameName,x,y){var pos=makeRealWorld2mapPos(frameName,x,y);mb_arrangeElement(frameName,"highlight",pos[0]-7,pos[1]-7);window.frames[frameName].document.getElementById("highlight").style.visibility='visible';}
+function mb_hideHighlight(frameName){mb_arrangeElement(frameName,"highlight",-20,-20);mb_arrangeElement(frameName,"highlight",-20,-20);window.frames[frameName].document.getElementById("highlight").style.visibility='hidden';}
+function mb_permanentHighlight(frameName,x,y){var pos=makeRealWorld2mapPos(frameName,x,y);mb_arrangeElement(frameName,"permanent",pos[0]-7,pos[1]-7);window.frames[frameName].document.getElementById("permanent").style.visibility='visible';}
+function mb_markResult(frameName,geom,col){var x="";var y="";var tmp=[];var ind=getMapObjIndexByName(frameName);for(var i=0;i<geom.length;i++){if(i>0){x+=":";y+=":";}
+tmp=geom[i].split(",");for(var ii=0;ii<tmp.length;ii+=2){var pos=makeRealWorld2mapPos(frameName,tmp[ii],tmp[ii+1]);if(ii>0){x+=",";y+=",";}
+x+=pos[0];y+=pos[1];}}
+var source="<img src='../extensions/markResult.php?x="+x+"&y="+y+"&width="+mb_mapObj[ind].width+"&height="+mb_mapObj[ind].height+"&color="+col+"'>";writeTag(frameName,"markResult",source);}
+function mb_disableResult(frameName){writeTag(frameName,"markResult","");}
+function mb_registerGML(frameName,obj){var ind=getMapObjIndexByName(frameName);mb_mapObj[ind].geom=obj;}
+function mb_timestamp(){var d=new Date();var ts=Math.round(Date.parse(d)/1000);return ts;}
+function mb_getlayerposbyname(objInd,wmsInd,lname){var t=mb_mapObj[objInd].wms[wmsInd];for(var i=0;i<t.objLayer.length;i++){if(t.objLayer[i].layer_name==lname){return t.objLayer[i].layer_pos;}}}
+function mb_getLayerObjByName(fname,wms_id,layer_name){var ind=getMapObjIndexByName(fname);var wmsInd=getWMSIndexById(fname,wms_id);var t=mb_mapObj[ind].wms[wmsInd];for(var i=0;i<t.objLayer.length;i++){if(t.objLayer[i].layer_name==layer_name){return t.objLayer[i];}}}
+function mb_getchildsbyname(objInd,wmsInd,lname){var t=mb_mapObj[objInd].wms[wmsInd];var pos=mb_getlayerposbyname(objInd,wmsInd,lname);var l=[];l.name=[];l.title=[];l.legendurl=[];for(var i=0;i<t.objLayer.length;i++){if(t.objLayer[i].layer_parent==pos){l.name[l.name.length]=t.objLayer[i].layer_name;l.title[l.title.length]=t.objLayer[i].layer_title;if(t.objLayer[i].layer_style.length>0){l.legendurl[l.legendurl.length]=t.objLayer[i].layer_style[0].legendurl;}else{l.legendurl[l.legendurl.length]=0;}}}
+if(l.name.length>0){return l;}
+else{return false;}}
+function DivTag(aTagName,aFrameName,aStyle){this.exists=function(){return(rootNode.getElementById(tagName))?true:false;};this.getTag=function(){return rootNode.getElementById(tagName);};var determineRootNode=function(){node=document;if(frameName!==""){if(checkFrame()){node=window.frames[frameName].document;}
+else{var e=new Mb_exception("frame "+frameName+" doesn't exist.");}}
+return node;};var toCamelCase=function(aString){var newString="";for(var i=0;i<aString.length;i++){if(aString.substr(i,1)!="-"){newString+=aString.substr(i,1);}
+else{i++;newString+=aString.substr(i,1).toUpperCase();}}
+return newString;};this.getRootNode=function(){return rootNode;};var setStyle=function(){if(that.exists()){var node=rootNode.getElementById(tagName);node.setAttribute("style","");for(var attr in tagStyle){if(typeof(tagStyle[attr])!="function"&&typeof(tagStyle[attr])!="object"){var evalString="node.style."+toCamelCase(attr)+" = \""+tagStyle[attr]+"\";";eval(evalString);}}}};var create=function(){if(!that.exists()){var divTag=rootNode.createElement("div");var divTagAppended=rootNode.getElementsByTagName("body")[0].appendChild(divTag);divTagAppended.id=tagName;}
+else{that.clean();}
+setStyle();};var checkFrame=function(){if(frameName!==""){return(typeof(window.frames[frameName])!='undefined');}
+return true;};var that=this;var tagName=aTagName;var frameName=aFrameName;var rootNode=determineRootNode();var tagStyle=aStyle;create();}
+DivTag.prototype.write=function(someText){if(this.exists()){this.getTag().innerHTML=someText;}};DivTag.prototype.clean=function(){this.write("");};var Mb_log=function(){var that=this;var levelArray=global_log_levels.split(",");var log_level=global_mb_log_level;var log_js=global_mb_log_js;var indexOfLevel=function(aLevel){for(var i=0;i<levelArray.length;i++){if(aLevel==levelArray[i]){return i;}}
+return false;};var isValidLevel=function(aLevel){var isNotOff=typeof(log_js)!='undefined'&&log_js!="off";var levelIndex=indexOfLevel(aLevel);var isAppropriate=(typeof(levelIndex)=='number'&&levelIndex<indexOfLevel(log_level));return(isNotOff&&isAppropriate);};this.throwException=function(message,level){if(isValidLevel(level)){if(log_js=="on"){try{mb_ajax_post('../php/mb_js_exception.php',{level:level,text:message});}
+catch(e){alert(e+": "+message);}}
+else if(log_js=="alert"){alert(message);}
+else if(log_js=="console"){if(level=="warning"){console.warn("%s",message);}
+else if(level=="error"){console.error("%s",message);}
+else{console.log("%s",message);}}}};};function Mb_exception(message){var level="error";this.throwException(message,level);}
+Mb_exception.prototype=new Mb_log();function Mb_warning(message){var level="warning";this.throwException(message,level);}
+Mb_warning.prototype=new Mb_log();function Mb_notice(message){var level="notice";this.throwException(message,level);}
+Mb_notice.prototype=new Mb_log();function mb_ajax_get(url,param,callback){try{$.get(url,param,callback);}
+catch(e){var error=new Mb_exception('map.php: mb_ajax_get:'+e);}}
+function mb_ajax_post(url,param,callback){try{$.post(url,param,callback);}
+catch(e){var error=new Mb_exception('map.php: mb_ajax_post:'+e);}}
+function mb_ajax_json(url,param,callback){try{$.getJSON(url,param,callback);}
+catch(e){var error=new Mb_exception('map.php: mb_ajax_json:'+e);}}
+var mb_button=[];function mb_regButton_frame(wii,frameName,param){var ind=mb_button.length;mb_button[ind]=new mb_conButton(wii,ind);if(frameName===null){if(param===null){eval(wii+"("+ind+")");}
+else{eval(wii+"("+ind+", "+param+")");}}
+else if(param===null){eval("window.frames['"+frameName+"']."+wii+"("+ind+")");}
+else{eval("window.frames['"+frameName+"']."+wii+"("+ind+", "+param+")");}
+mb_button[ind].prev=mb_button[ind].src;mb_button[ind].src=mb_button[ind].img_off;mb_button[ind].onmouseover=function(){mb_button_over(ind);};mb_button[ind].onmouseout=function(){mb_button_out(ind);};mb_button[ind].onclick=function(){mb_button_click(ind);};if(frameName===null){mb_button[ind].frameName="";}
+else{mb_button[ind].frameName=frameName;}}
+function mb_regButton(wii){mb_regButton_frame(wii,null,null);}
+function mb_conButton(wii,ind){this.wii=wii;return true;}
+function mb_button_over(ind){if(mb_button[ind].status===0){mb_button[ind].prev=mb_button[ind].src;mb_button[ind].src=mb_button[ind].img_over;}}
+function mb_button_out(ind){if(mb_button[ind].status===0){mb_button[ind].src=mb_button[ind].img_off;}}
+function mb_button_click(ind){var mbStatus=mb_button[ind].status;if(mbStatus===0){mb_disableButton(mb_button[ind].elName);mb_button[ind].prev=mb_button[ind].img_on;mb_button[ind].src=mb_button[ind].img_on;mb_button[ind].status=1;if(mb_button[ind].frameName!==""){window.frames[mb_button[ind].frameName].document.getElementById(mb_button[ind].elName).go();}
+else{document.getElementById(mb_button[ind].elName).go();}}
+else{mb_button[ind].prev=mb_button[ind].img_off;mb_button[ind].src=mb_button[ind].img_off;mb_button[ind].status=0;if(mb_button[ind].frameName!==""){window.frames[mb_button[ind].frameName].document.getElementById(mb_button[ind].elName).stop();}
+else{document.getElementById(mb_button[ind].elName).stop();}}}
+function mb_disableButton(elName){for(var i=0;i<mb_button.length;i++){if(mb_button[i].elName!=elName&&mb_button[i].status==1){mb_button[i].status=0;if(mb_button[i].frameName!==""){window.frames[mb_button[i].frameName].document.getElementById(mb_button[i].elName).src=mb_button[i].img_off;window.frames[mb_button[i].frameName].document.getElementById(mb_button[i].elName).stop();}
+else{document.getElementById(mb_button[i].elName).src=mb_button[i].img_off;document.getElementById(mb_button[i].elName).stop();}
+return true;}}}
+function mb_disableThisButton(elName){for(var i=0;i<mb_button.length;i++){if(mb_button[i].elName==elName&&mb_button[i].status==1){mb_button[i].status=0;if(mb_button[i].frameName!==""){window.frames[mb_button[i].frameName].document.getElementById(mb_button[i].elName).src=mb_button[i].img_off;window.frames[mb_button[i].frameName].document.getElementById(mb_button[i].elName).stop();}
+else{document.getElementById(mb_button[i].elName).src=mb_button[i].img_off;document.getElementById(mb_button[i].elName).stop();}
+return true;}}}
+function updateButtonTooltips(obj){var imageArray=document.getElementsByTagName("img");for(var i=0;i<imageArray.length;i++){for(var j=0;j<obj.length;j++){if(imageArray[i].id==obj[j].id){document.getElementById(imageArray[i].id).title=obj[j].title;}}}}
+function mb_localizeButtons(){mb_ajax_json("../php/mod_button_tooltips.php",function(obj,status){updateButtonTooltips(obj);});}
+eventLocalize.register(function(){mb_localizeButtons();});eventInit.register(function(){eventLocalize.trigger();});function cloneObject(obj){if(typeof obj!=='object'||obj===null){return obj;}
+var c=obj instanceof Array?[]:{};for(var i in obj){var prop=obj[i];if(typeof prop=='object'){if(prop instanceof Array){c[i]=[];for(var j=0;j<prop.length;j++){if(typeof prop[j]!='object'){c[i].push(prop[j]);}else{c[i].push(cloneObject(prop[j]));}}}else{c[i]=cloneObject(prop);}}else{c[i]=prop;}}
+return c;}
+var List=function(){this.count=function(){return this.list.length;};this.del=function(i){i=this.getIndex(i);if(i!==false){for(var z=i;z<this.count()-1;z++){this.list[z]=this.list[z+1];}
+this.list.length-=1;return true;}
+return false;};this.empty=function(){while(this.list!==null&&this.count()>0){this.list.pop();}};this.get=function(i){i=this.getIndex(i);if(i!==false){return this.list[i];}
+return false;};this.add=function(item){var i=this.list.length;this.list[i]=item;};this.addCopy=function(item){this.add(cloneObject(item));};this.union=function(aList){for(var i=0;i<aList.count();i++){this.addCopy(aList.get(i));}};this.getIndex=function(i){var len=this.list.length;if(i<0&&len+i>-1){return len+i;}
+else if(i>-1&&i<len){return i;}
+var e=new Mb_exception("class List: function getIndex: member index "+i+" is not valid");return false;};this.toString=function(){var str="";for(var i=0;i<this.count();i++){str+=this.get(i).toString();}
+return str;};this.list=null;};function mb_checkTag(frameName,tagName,elementId,appendAtTagName,attributes){var oldElement;var newElement;var prefix;if(frameName&&frameName!==""){prefix=window.frames[frameName].document;}
+else if(!frameName||frameName===""){prefix=document;}
+oldElement=prefix.getElementById(elementId);if(oldElement===null){newElement=prefix.createElement(tagName);newElement=prefix.getElementsByTagName(appendAtTagName)[0].appendChild(newElement);}
+else{if(oldElement.nodeName.toLowerCase()==tagName.toLowerCase()){for(var i=0;i<attributes.length;i++){oldElement.setAttribute(attributes[i][0],attributes[i][1]);}
+return oldElement;}
+else{return false;}}
+var newElementAttributeNode=document.createAttribute("id");newElementAttributeNode.value=elementId;newElement.setAttributeNode(newElementAttributeNode);for(var i=0;i<attributes.length;i++){newElement.setAttribute(attributes[i][0],attributes[i][1]);}
+return newElement;}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/map.php
===================================================================
--- branches/print_dev/http/javascripts/map.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/map.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -18,6 +18,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_wms.php");
 
 // see http://trac.osgeo.org/mapbender/ticket/79
 ini_set('session.bug_compat_42',0); 
@@ -61,58 +62,36 @@
 echo "mapbender.versionNumber = '" . MB_VERSION_NUMBER . "';";
 echo "mapbender.versionAppendix = '" . MB_VERSION_APPENDIX . "';";
 echo "mapbender.releaseDate = new Date(".date("Y",MB_RELEASE_DATE).",".date("n",MB_RELEASE_DATE).",".date("j",MB_RELEASE_DATE).");";
-echo "mapbender.zoomMousewheel = " . ZOOM_MOUSEWHEEL . ";";
 echo "var owsproxy = '".OWSPROXY."';";
 echo "var global_mb_log_js = '".LOG_JS."';";
 echo "var global_mb_log_level = '".LOG_LEVEL."';";
 echo "var global_log_levels = '".LOG_LEVEL_LIST."';";
 echo "var mb_feature_count = ".MB_FEATURE_COUNT.";";
 echo "var mb_resolution = ".MB_RESOLUTION.";";
-echo "var mb_security_proxy = '" . MB_SECURITY_PROXY . "';";
 
 //
-// Load external JavaScript libraries
+// Load JavaScript libraries
 //
-$extPath = dirname(__FILE__) . "/../extensions/";
-$extFileArray = array(  "jquery-1.2.6.min.js", 
-						"jqjson.js", 
-						"jquery.mousewheel.min.js");
+require_once(dirname(__FILE__) . "/../extensions/jquery.js");
+require_once(dirname(__FILE__) . "/../javascripts/map.js");
+require_once(dirname(__FILE__) . "/../javascripts/point.js");
+require_once(dirname(__FILE__) . "/../javascripts/map_obj.js");
+require_once(dirname(__FILE__) . "/../javascripts/wfs_obj.js");
+require_once(dirname(__FILE__) . "/../extensions/jqjson.js");
+require_once(dirname(__FILE__) . "/../javascripts/style.js");
 
-for ($i = 0; $i < count($extFileArray); $i++) {
-	$currentFile = $extPath . $extFileArray[$i];
-	if (file_exists($currentFile)) {
-		require_once($currentFile);
-	}
-	else {
-		$e = new mb_exception("Extension not found: " . $currentFile);
-		echo "var e = new Mb_exception('Library not found: " . $currentFile . "');";
-		die;
-	}
-}
-
 //
-// Load internal JavaScript libraries
-//
-$libPath = dirname(__FILE__) . "/../../lib/";
-$libFileArray = array(  "exception.js", 
-						"ajax.js", 
-						"basic.js",
-						"div.js",
-						"list.js",
-						"point.js",
-						"style.js",
-						"button.js");
+// Load WMS
+// 
+$sql = "SELECT fkey_wms_id FROM gui_wms WHERE fkey_gui_id = $1 ORDER BY gui_wms_position";
+$v = array($gui_id);
+$t = array('s');
+$res = db_prep_query($sql, $v, $t);
 
-for ($i = 0; $i < count($libFileArray); $i++) {
-	$currentFile = $libPath . $libFileArray[$i];
-	if (file_exists($currentFile)) {
-		require_once($currentFile);
-	}
-	else {
-		$e = new mb_exception("Library not found: " . $currentFile);
-		echo "var e = new Mb_exception('Library not found: " . $currentFile . "');";
-		die;
-	}
+while($row = db_fetch_array($res)) {
+	$mywms = new wms();
+	$mywms->createObjFromDB($gui_id, $row["fkey_wms_id"]);
+	$mywms->createJsObjFromWMS();
 }
 
 //
@@ -128,12 +107,11 @@
 		for ($i = 0; $i < count($moduleArray); $i++) {
 			$currentFile = dirname(__FILE__) . "/../javascripts/" . trim($moduleArray[$i]);
 			if (file_exists($currentFile)) {
+				$e = new mb_notice("LOADING module : " . $currentFile);
 				require_once($currentFile);
 			}
 			else {
 				$e = new mb_exception("Javascript module not found: " . $currentFile);
-				echo "var e = new Mb_exception('Javascript module not found: " . $currentFile . "');";
-				die;
 			}
 		}
 	}
@@ -150,22 +128,18 @@
 $mb_res = db_prep_query($mb_sql, $mb_v, $mb_t);
 while($row_js = db_fetch_array($mb_res)){
 	if($row_js["e_js_file"] != ""){
-		$jsArray = explode(",", $row_js["e_js_file"]);
-		for ($i = 0; $i < count($jsArray); $i++) {
-			$e_id = $row_js["e_id"];
-			$e_src = $row_js["e_src"];
-			$e_require = $row_js["e_requires"];
-			$e_target = explode(",",$row_js["e_target"]);
-			$currentFile = trim($jsArray[$i]);
-			if (file_exists($currentFile)) {
-				require_once($currentFile);
-			}
-			else {
-				$e = new mb_exception("Javascript not found: " . $currentFile);
-				echo "var e = new Mb_exception('Javascript not found: " . $currentFile . "');";
-				die;
-			}
+		$e_id = $row_js["e_id"];
+		$e_src = $row_js["e_src"];
+		$e_require = $row_js["e_requires"];
+		$e_target = explode(",",$row_js["e_target"]);
+		$currentFile = $row_js["e_js_file"];
+		if (file_exists($currentFile)) {
+			$e = new mb_notice("LOADING Javascript: " . $currentFile . " of element: " . $e_id);
+			require_once($currentFile);
 		}
+		else {
+			$e = new mb_exception("Javascript not found: " . $currentFile);
+		}
 	}
 }
 ?>

Modified: branches/print_dev/http/javascripts/map_obj.js
===================================================================
--- branches/print_dev/http/javascripts/map_obj.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/map_obj.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,404 +1,62 @@
-/* 
-* $Id: map_obj.js 2517 2008-06-19 16:40:00Z christoph $
-* COPYRIGHT: (C) 2001 by ccgis. This program is free software under the GNU General Public
-* License (>=v2). Read the file gpl.txt that comes with Mapbender for details. 
-*/
-var mb_mapObj = [];
 
-function mb_mapObj_const(frameName, elementName, width, height, wms_index){
-	this.width = width;
-	this.height = height;
-	this.frameName = frameName;
-	this.elementName = elementName;
-	this.layers = [];
-	this.styles = [];
-	this.querylayers = [];
-	this.geom = "";
-	this.gml = ""; 
-	this.wms = [];
-
-	// 
-	// Add pointers to WMS objects which are in this map.
-	// If wms_index is set (=map is overview), only this 
-	// WMS is being pointed to.
-	//
-	var index = 0;
-	for(var i=0; i < wms.length; i++){
-		var isValidWms = (wms_index === null) || (wms_index == i);
-		if (isValidWms) {
-			this.wms[index] = wms[i];
-			this.wms[index].mapURL = false;
-			index++;
-		}
-	}
-
-	//
-	// set list of visible layers, active querylayers 
-	// and styles for each WMS in this map
-	//
-	var cnt_layers;
-	var cnt_querylayers;
-	var styles;
-	var layers;
-	var querylayers = "";
-	for(i=0; i< this.wms.length; i++){
-		cnt_layers = 0;
-		cnt_querylayers = 0;
-		styles = "";
-		layers = "";
-		querylayers = "";
-
-		for(var ii=0; ii<this.wms[i].objLayer.length; ii++){
-			// layer is visible and not root layer
-			if(this.wms[i].objLayer[ii].gui_layer_visible == 1 && ii>0){
-				if(cnt_layers > 0){
-					layers += ","; styles += ","; 
-				}
-				layers += wms[i].objLayer[ii].layer_name; 
-				styles += ""; 
-				cnt_layers++;
-			}            
-			// layer is queryable and not root layer
-			if(this.wms[i].objLayer[ii].gui_layer_querylayer == 1 && ii>0){
-				if(cnt_querylayers > 0){
-					querylayers += ",";
-				}
-				querylayers += wms[i].objLayer[ii].layer_name; 
-				cnt_querylayers++;
-			}                          
-		}
-		this.layers[i] = layers;
-		this.styles[i] = styles;
-		this.querylayers[i] = querylayers;
-	}
-   
-	this.epsg = wms[0].gui_wms_epsg;
-	this.extent = setExtent(this.width,this.height,this.epsg);
-	this.mapURL = [];
-	var styleTag = window.frames[this.frameName].document.getElementById(this.elementName).style;
-	styleTag.width = this.width;
-	styleTag.height = this.height;   
-   
-	/**
-	 * get the width of the mapObj
-	 *
-	 * @member mb_mapObj_const
-	 * @return width of the mapObj  
-	 * @type integer  
-	 */
-	this.getWidth = function(){
-		return parseInt(this.width, 10);
-	};
-	
-	/**
-	 * set the width of the mapObj
-	 *
-	 * @param {integer} widht the width of the mapObj  
-	 */
-	this.setWidth = function(width){
-		this.width = parseInt(width, 10);
-	};
-	
-	/**
-	 * get the height of the mapObj
-	 *
-	 * @member mb_mapObj_const
-	 * @return width of the mapObj  
-	 * @type integer  
-	 */
-	this.getHeight = function(){
-		return parseInt(this.height, 10);
-	};
-	
-	/**
-	 * set the height of the mapObj
-	 *
-	 * @param {integer} height the height of the mapObj  
-	 */
-	this.setHeight = function(height){
-		this.height = parseInt(height, 10);
-	};
-	
-	/**
-	 * get the extent of the mapObj
-	 *
-	 * @member mb_mapObj_const
-	 * @return extent of the mapObj as commaseparated minx,minx,maxx,maxy  
-	 * @type string
-	 */
-	this.getExtent = function(){
-		return this.extent;
-	};
-	
-	/**
-	 * get the extent as minx, maxx, miny, maxy
-	 *
-	 * @return extent and additional informations of the mapObj  
-	 * @type Object
-	 */
-	this.getExtentInfos = function(){
-		var c = this.getExtent().split(",");
-		var ext = new Extent(c[0],c[1],c[2],c[3]);
-		return ext;
-	};
-	
-	/**
-	 * converts the extent of the mapobject so that the maximum	extent will be displayed
-	 *
-	 */
-	this.calculateExtent = function(ext){
-		var relation_px_x = this.getWidth() / this.getHeight();
-		var relation_px_y = this.getHeight() / this.getWidth();
-		var relation_bbox_x = ext.extentx / ext.extenty;     
-		if(relation_bbox_x <= relation_px_x){                
-			ext.minx = ext.centerx - relation_px_x * ext.extenty / 2;
-			ext.maxx = ext.centerx + relation_px_x * ext.extenty / 2;
-		}
-		if(relation_bbox_x > relation_px_x){                
-			ext.miny = ext.centery - relation_px_y * ext.extentx / 2;
-			ext.maxy = ext.centery + relation_px_y * ext.extentx / 2;
-		}
-		this.setExtent(ext.minx,ext.miny,ext.maxx,ext.maxy);
-	};
-	
-	
-	/**
-	 * zoom the map with a zoomfactor and optional to x,y coords
-	 * 
-	 * @param {boolean} in_ in = true, out = false
-	 * @param {float} factor the zoomfactor 1 equals 100%
-	 * @param {float} x center to x-position
-	 * @param {float} y center to y-position
-	 */
-	 this.zoom = function(in_, factor, x, y){
-		factor = parseFloat(factor);
-		if (!in_) {
-			factor = 1 / factor;
-		}
-		
-		var extent = this.getExtentInfos();
-		var distx = extent.maxx - extent.minx;
-		var disty =  extent.maxy - extent.miny;
-		
-		
-		if(x && y){
-			var centerx = parseFloat(x);
-			var centery = parseFloat(y);
-		}
-		else{
-			var centerx = extent.minx + distx/2;
-			var centery = extent.miny + disty/2;
-		}
-		
-		
-		var new_distx = distx / factor;
-		var new_disty = disty / factor;
-		var minx = centerx - new_distx / 2;
-		var miny = centery - new_disty / 2;
-		var maxx = centerx + new_distx / 2;
-		var maxy = centery + new_disty / 2;
-		this.setExtent(minx,miny,maxx,maxy);
-		//Todo:
-		//setMapRequest!
-	 };
-
-	/**
-	 * set the extent of the wms
-	 */
-	 this.setExtent = function(minx,miny,maxx,maxy){
-	 	this.extent = String(minx)+","+String(miny)+","+String(maxx)+","+String(maxy);
-	 };
-	
-	/**
-	 * get the srs of the mapObj
-	 *
-	 * @return srs as epsg:number  
-	 * @type string
-	 */
-	this.getSRS = function(){
-		return this.epsg;
-	};
-	
-	/**
-	 * get all mapRequests 
-	 *
-	 * @return array of mapRequests of this map object  
-	 * @type string[]  
-	 */
-	this.getMapRequests = function(){
-		var allRequests = [];
-		//loop through all wms to get the mapRequests
-		for(var i=0; i<this.wms.length; i++){
-			var currentRequest = this.wms[i].getMapRequest(this);
-			if(currentRequest){ 
-				allRequests.push(currentRequest);
-			}
-		}
-		if(allRequests.length > 0){
-			return allRequests;
-		}
-		return false;
-	};
-
-	/**
-	 * Return the map URL of the WMS at index i
-	 * @param {Object} currentWmsIndex
-	 */
-	this.getMapUrl = function (i, ii) {
-		var currentWms = this.wms[ii];
-		var validLayers = currentWms.getLayers(this);
-		var layerNames = validLayers.join(",");
-		
-		url = currentWms.wms_getmap; 
-		url += mb_getConjunctionCharacter(currentWms.wms_getmap);
-			
-		if (currentWms.wms_version == "1.0.0") {
-			url += "WMTVER=" + currentWms.wms_version + "&REQUEST=map&";
-		}
-		else {
-			url += "VERSION=" + currentWms.wms_version + "&REQUEST=GetMap&SERVICE=WMS&";
-		}             
-		
-		url += "LAYERS=" + layerNames + "&";
-		url += "STYLES=";
-		var layer = layerNames.split(",");
-		for (var j = 0; j < layer.length; j++){
-			if (j > 0) {
-				url  += ",";
-			}
-			if (currentWms.getCurrentStyleByLayerName(layer[j]) !== false) {
-				url += currentWms.getCurrentStyleByLayerName(layer[j]);
-			}
-		}
-		url += "&";
-		url += "SRS=" + this.epsg + "&";
-		url += "BBOX=" + this.extent + "&";
-		url += "WIDTH=" + this.width + "&";
-		url += "HEIGHT=" + this.height + "&";
-		url += "FORMAT=" + currentWms.gui_wms_mapformat + "&";
-		url += "BGCOLOR=0xffffff&";
-	
-		if (currentWms.gui_wms_mapformat.search(/gif/i)>-1 || 
-			currentWms.gui_wms_mapformat.search(/png/i)>-1) {
-				url += "TRANSPARENT=TRUE&";
-		}
-	
-		url += "EXCEPTIONS=" + currentWms.gui_wms_exceptionformat + "&";
-	
-		// add vendor-specific
-		for (var v = 0; v < mb_vendorSpecific.length; v++) {
-			var vendorSpecificString = eval(mb_vendorSpecific[v]); 
-			// if eval doesn't evaluate a function, the result is undefined.
-			// Sometimes it is necessary not to evaluate a function, for
-			// example if you want to change a variable from the current
-			// scope (see mod_addSLD.php) 
-			if (typeof(vendorSpecificString) != "undefined") {
-				url += vendorSpecificString + "&";
-			} 
-		}
-		// add Filter
-		if (currentWms.wms_filter !== ""){
-			url += "&SLD=" + currentWms.wms_filter +"?id="+ mb_styleID + "&";
-		}
-		// add sld
-		if(currentWms.gui_wms_sldurl !== ""){
-			url += "&SLD=" + escape(currentWms.gui_wms_sldurl) + "&";
-		}
-		return url;
-	}
-
-	/**
-	 * get all featureInfoRequests 
-	 *
-	 * @member mb_mapObj_const
-	 * @param float x the x-value of the click position in pixel
-	 * @param float y the y-value of the click position in pixel
-	 * @return array of all featureInfoRequests of this map object  
-	 * @type string[]  
-	 */
-	this.getFeatureInfoRequests = function(clickPoint){
-		var allRequests = [];
-		//loop through all wms to get the FeatureInfoRequests
-		for(var i=0; i<this.wms.length; i++){
-			var currentRequest = this.wms[i].getFeatureInfoRequest(this, clickPoint);
-			if(currentRequest){ 
-				allRequests.push(currentRequest);
-			}
-		}
-		if(allRequests.length > 0){
-			return allRequests;
-		}
-		return false;
-	};
-	
-	/**
-	 * calculation of the mapscale 
-	 *
-	 * @member mb_mapObj_const
-	 * @return scale  
-	 * @type integer  
-	 */
-	this.getScale = function(){
-		var scale;
-		var bbox = this.extent.split(",");
-		var xtenty;
-		if(this.epsg=="EPSG:4326"){
-			var pxLenx = (parseFloat(bbox[2])-parseFloat(bbox[0]))/this.width;
-			var pxLeny = (parseFloat(bbox[3])-parseFloat(bbox[1]))/this.height;
-			var lat_from = ((parseFloat(bbox[3])-parseFloat(bbox[1])/2)*Math.PI)/180;
-			var lat_to = ((parseFloat(bbox[3])-parseFloat(bbox[1])/2+pxLeny)*Math.PI)/180;
-			var lon_from = ((parseFloat(bbox[2])-parseFloat(bbox[0])/2)*Math.PI)/180;
-			var lon_to = ((parseFloat(bbox[2])-parseFloat(bbox[0])/2+pxLeny)*Math.PI)/180;
-			var dist=6371229*Math.acos(Math.sin(lat_from)*Math.sin(lat_to)+Math.cos(lat_from)*Math.cos(lat_to)*Math.cos(lon_from-lon_to));
-			scale = (dist/Math.SQRT2) * (mb_resolution * 100);
-		}else{
-			xtenty =  parseFloat(bbox[3]) - parseFloat(bbox[1]);
-			scale = (xtenty / this.height) * (mb_resolution * 100);
-		}
-		return Math.round(scale);
-	};
-	/**
-	 * move a wms or layer 
-	 *
-	 * @param int wms_id id of wms to move
-	 * @param int layer_id id of layer to move
-	 * @return true of successful
-	 * @type boolean
-	 */
-	this.move = function(wms_id, layer_id, moveUp){
-		var i,j;
-		for(i=0;i<this.wms.length;i++){
-			if (wms_id == this.wms[i].wms_id) {
-				break;
-			}
-		}
-		
-		//check if only one wms is affected?
-		if (layer_id && layer_id != this.wms[i].objLayer[0].layer_id) {
-			return this.wms[i].moveLayer(layer_id, moveUp);
-		}
-		
-		//else swap wms
-		j = i + (moveUp?-1:1);
-		if (!(i != j && i >= 0 && i < this.wms.length && j >= 0 && j < this.wms.length)) {
-			return false;
-		}
-		
-		upper = this.wms[i];
-		this.wms[i] = this.wms[j];
-		this.wms[j] = upper;
-		var upperLayers = this.layers[i];
-		var upperStyles = this.styles[i];
-		var upperQuerylayers = this.querylayers[i];
-		this.layers[i] = this.layers[j];
-		this.styles[i] = this.styles[j];
-		this.querylayers[i] = this.querylayers[j];
-		this.layers[j] = upperLayers;
-		this.styles[j] = upperStyles;
-		this.querylayers[j] = upperQuerylayers;
-		
-		return true;
-	};
-	
-	eventAfterMapObjectConstruction.trigger();
-}
\ No newline at end of file
+var wms=[];var wms_layer_count=0;function add_wms(wms_id,wms_version,wms_title,wms_abstract,wms_getmap,wms_getfeatureinfo,wms_getlegendurl,wms_filter,gui_wms_mapformat,gui_wms_featureinfoformat,gui_wms_exceptionformat,gui_wms_epsg,gui_wms_visible,gui_wms_opacity,gui_wms_sldurl){wms[wms.length]=new wms_const(wms_id,wms_version,wms_title,wms_abstract,wms_getmap,wms_getfeatureinfo,wms_getlegendurl,wms_filter,gui_wms_mapformat,gui_wms_featureinfoformat,gui_wms_exceptionformat,gui_wms_epsg,parseInt(gui_wms_visible,10),parseInt(gui_wms_opacity),gui_wms_sldurl);wms_layer[wms.length-1]=[];}
+function wms_const(wms_id,wms_version,wms_title,wms_abstract,wms_getmap,wms_getfeatureinfo,wms_getlegendurl,wms_filter,gui_wms_mapformat,gui_wms_featureinfoformat,gui_wms_exceptionformat,gui_wms_epsg,gui_wms_visible,gui_wms_opacity,gui_wms_sldurl){if(!wms_id){var id_ok=false;while(id_ok===false){wms_id="a"+Math.round(10000*Math.random());id_ok=true;for(var i=0;i<wms.length&&id_ok===true;i++){if(wms_id==wms[i].wms_id){id_ok=false;}}}}
+this.wms_id=wms_id;this.wms_version=wms_version;this.wms_title=wms_title;this.wms_abstract=wms_abstract;this.wms_getmap=wms_getmap;this.wms_getfeatureinfo=wms_getfeatureinfo;this.wms_getlegendurl=wms_getlegendurl;this.wms_filter=wms_filter;this.data_type=[];this.data_format=[];this.objLayer=[];this.gui_wms_mapformat=gui_wms_mapformat;this.gui_wms_featureinfoformat=gui_wms_featureinfoformat;this.gui_wms_exceptionformat=gui_wms_exceptionformat;this.gui_wms_epsg=gui_wms_epsg;this.gui_wms_visible=gui_wms_visible;this.gui_epsg=[];this.gui_minx=[];this.gui_miny=[];this.gui_maxx=[];this.gui_maxy=[];this.gui_wms_mapopacity=gui_wms_opacity/100;this.gui_wms_sldurl=gui_wms_sldurl;}
+wms_const.prototype.getMapRequest=function(mapObj){var layers=this.getLayers(mapObj);if(!layers){return false;}
+var rq=this.wms_getmap;rq+=mb_getConjunctionCharacter(this.wms_getmap);if(this.wms_version==="1.0.0"){rq+="WMTVER="+this.wms_version+"&REQUEST=map";}
+else{rq+="VERSION="+this.wms_version+"&REQUEST=getMap&SERVICE=WMS";}
+rq+="&LAYERS="+layers.join(",");rq+="&WIDTH="+mapObj.getWidth();rq+="&HEIGHT="+mapObj.getHeight();rq+="&SRS="+mapObj.getSRS();rq+="&BBOX="+mapObj.getExtent();rq+="&STYLES="+this.getLayerstyles(mapObj).join(",");rq+="&FORMAT="+this.gui_wms_mapformat;rq+="&EXCEPTIONS="+this.gui_wms_exceptionformat;return rq;};wms_const.prototype.getFeatureInfoRequest=function(mapObj,clickPoint){var layers=this.getLayers(mapObj);var querylayers=this.getQuerylayers(mapObj);if(!layers||!querylayers){return false;}
+var rq=this.wms_getfeatureinfo;rq+=mb_getConjunctionCharacter(this.wms_getfeatureinfo);if(this.wms_version==="1.0.0"){rq+="WMTVER="+this.wms_version+"&REQUEST=feature_info";}
+else{rq+="VERSION="+this.wms_version+"&REQUEST=GetFeatureInfo&SERVICE=WMS";}
+rq+="&LAYERS="+layers.join(",");if(mb_feature_count>0){rq+="&FEATURE_COUNT="+mb_feature_count;}
+rq+="&QUERY_LAYERS="+querylayers.join(",");rq+="&WIDTH="+mapObj.getWidth();rq+="&HEIGHT="+mapObj.getHeight();rq+="&SRS="+mapObj.getSRS();rq+="&BBOX="+mapObj.getExtent();rq+="&STYLES="+this.getLayerstyles(mapObj).join(",");rq+="&FORMAT="+this.gui_wms_mapformat;rq+="&INFO_FORMAT="+this.gui_wms_featureinfoformat;rq+="&EXCEPTIONS=application/vnd.ogc.se_xml";rq+="&X="+clickPoint.x;rq+="&Y="+clickPoint.y;return rq;};wms_const.prototype.setOpacity=function(opacity){this.gui_wms_mapopacity=parseInt(opacity)/100;if(this.gui_wms_mapopacity>1||isNaN(this.gui_wms_mapopacity))
+this.gui_wms_mapopacity=1;if(this.gui_wms_mapopacity<0)
+this.gui_wms_mapopacity=0;if(this.gui_wms_visible>0){var divId=null;for(var i=0;i<wms.length;i++){if(this.wms_id==wms[i].wms_id){var divId='div_'+i;break;}}
+if(!divId)
+return;wmsImage=parent.mapframe1.document.getElementById(divId);if(wmsImage!=null){wmsImage.style.opacity=this.gui_wms_mapopacity;wmsImage.style.MozOpacity=this.gui_wms_mapopacity;wmsImage.style.KhtmlOpacity=this.gui_wms_mapopacity;wmsImage.style.filter="alpha(opacity="+this.gui_wms_mapopacity*100+")";}}}
+wms_const.prototype.getLayers=function(mapObj){try{var wmsIsVisible=(this.gui_wms_visible>0);if(!wmsIsVisible){return false;}
+visibleLayers=[];for(var i=0;i<this.objLayer.length;i++){var isVisible=(this.objLayer[i].gui_layer_visible===1);var hasNoChildren=(!this.objLayer[i].has_childs);if(isVisible&&hasNoChildren){if(this.objLayer[i].checkScale(mapObj)){visibleLayers.push(this.objLayer[i].layer_name);}}}
+if(visibleLayers.length===0){return false;}
+return visibleLayers;}
+catch(e){alert(e);}};wms_const.prototype.getLayerstyles=function(mapObj){var layers=this.getLayers(mapObj);var layerstyles='';var styles=[];if(layers){for(i=0;i<layers.length;i++){var style=this.getCurrentStyleByLayerName(layers[i]);if(!style){style='';}
+styles.push(style);}
+return styles;}
+return false;};wms_const.prototype.checkLayerParentByLayerName=function(layername){for(var i=0;i<this.objLayer.length;i++){if(this.objLayer[i].layer_name==layername){return this.objLayer[i].layer_parent;}}};wms_const.prototype.getTitleByLayerName=function(layername){for(var i=0;i<this.objLayer.length;i++){if(this.objLayer[i].layer_name==layername){return this.objLayer[i].layer_title;}}};wms_const.prototype.getCurrentStyleByLayerName=function(layername){for(var i=0;i<this.objLayer.length;i++){if(this.objLayer[i].layer_name==layername){if(this.objLayer[i].gui_layer_style===''||this.objLayer[i].gui_layer_style===null){return false;}
+else{return this.objLayer[i].gui_layer_style;}}}};wms_const.prototype.getLegendUrlByGuiLayerStyle=function(layername,guiLayerStyle){for(var i=0;i<this.objLayer.length;i++){if(this.objLayer[i].layer_name==layername){if(this.objLayer[i].layer_style.length===0){return false;}
+for(var k=0;k<this.objLayer[i].layer_style.length;k++){if(this.objLayer[i].layer_style[k].name==guiLayerStyle){var legendUrl=this.objLayer[i].layer_style[k].legendurl;if(this.gui_wms_sldurl!==""){legendUrl+="&SLD="+escape(this.gui_wms_sldurl);}
+if(legendUrl!==''&&legendUrl!==null&&typeof(legendUrl)!='undefined'){return legendUrl;}
+else{return false;}}}}}
+return false;};wms_const.prototype.getQuerylayers=function(mapObj){queryLayers=[];for(var i=0;i<this.objLayer.length;i++){if(this.objLayer[i].gui_layer_querylayer===1&&!this.objLayer[i].has_childs){if(this.objLayer[i].checkScale(mapObj)){queryLayers.push(this.objLayer[i].layer_name);}}}
+if(queryLayers.length===0){return false;}
+return queryLayers;};wms_const.prototype.getLayerByLayerPos=function(layer_pos){for(var i=0;i<this.objLayer.length;i++){if(this.objLayer[i].layer_pos==layer_pos){return this.objLayer[i];}}
+return null;};wms_const.prototype.getSublayerState=function(layer_id,type){var i;var state=-1,value;for(i=0;i<this.objLayer.length;i++){if(this.objLayer[i].layer_id==layer_id){break;}}
+for(var j=i+1;j<this.objLayer.length;j++){if(this.objLayer[i].parent_layer==this.objLayer[j].parent_layer){break;}
+if(type=="visible"){value=this.objLayer[j].gui_layer_visible;}
+else if(type=="querylayer"){value=this.objLayer[j].gui_layer_querylayer;}
+if(state==-1){state=value;}
+if(state!=value){return-1;}}
+return state;};wms_const.prototype.handleLayer=function(layer_name,type,value){var i;for(i=0;i<this.objLayer.length;i++){if(this.objLayer[i].layer_name==layer_name){break;}}
+for(var j=i;j<this.objLayer.length;j++){if(i!=j&&this.objLayer[i].layer_parent>=this.objLayer[j].layer_parent){break;}
+if(type=="visible"){this.objLayer[j].gui_layer_visible=parseInt(value,10);}
+else if(type=="querylayer"&&this.objLayer[j].gui_layer_queryable){this.objLayer[j].gui_layer_querylayer=parseInt(value,10);}}
+var parentLayer=this.getLayerByLayerPos(this.objLayer[i].layer_parent);if(parentLayer){var state=this.getSublayerState(parentLayer.layer_id,type);if(state!=-1){if(type=="visible"){this.objLayer[j].gui_layer_visible=state;}
+else if(type=="querylayer"&&this.objLayer[j].gui_layer_queryable){this.objLayer[j].gui_layer_querylayer=state;}}}};wms_const.prototype.moveLayer=function(layerId,moveUp){var iLayer=-1;var i;for(i=0;i<this.objLayer.length;i++){if(this.objLayer[i].layer_id==layerId){iLayer=i;break;}}
+if(iLayer==-1){return false;}
+var upperLayer=-1;var lowerLayer=-1;var parentLayer=this.objLayer[iLayer].layer_parent;if(moveUp){lowerLayer=iLayer;for(i=iLayer-1;i>0;i--){if(parentLayer==this.objLayer[i].layer_parent){upperLayer=i;break;}}
+if(upperLayer==-1){return false;}}
+else{upperLayer=iLayer;for(i=iLayer+1;i<this.objLayer.length;i++){if(parentLayer==this.objLayer[i].layer_parent){lowerLayer=i;break;}}
+if(lowerLayer==-1){return false;}}
+var layersDown=lowerLayer-upperLayer;for(i=lowerLayer+1;i<this.objLayer.length;i++){if(parentLayer==this.objLayer[i].layer_parent){break;}}
+var layersUp=i-lowerLayer;var temp=[];for(i=0;i<layersDown+layersUp;i++){temp[temp.length]=this.objLayer[upperLayer+i];}
+for(i=0;i<layersUp;i++){this.objLayer[upperLayer+i]=temp[i+layersDown];}
+for(i=0;i<layersDown;i++){this.objLayer[upperLayer+layersUp+i]=temp[i];}
+return true;};function wms_add_data_type_format(datatype,dataformat){var insertDataFormat=true;for(var i=0;i<wms[wms.length-1].data_type.length;i++){if(wms[wms.length-1].data_type[i]==datatype&&wms[wms.length-1].data_format[i]==dataformat){insertDataFormat=false;}}
+if(insertDataFormat===true){wms[wms.length-1].data_type[wms[wms.length-1].data_type.length]=datatype;wms[wms.length-1].data_format[wms[wms.length-1].data_format.length]=dataformat;}}
+function wms_addSRS(epsg,minx,miny,maxx,maxy){wms[wms.length-1].gui_epsg[wms[wms.length-1].gui_epsg.length]=epsg;wms[wms.length-1].gui_minx[wms[wms.length-1].gui_minx.length]=minx;wms[wms.length-1].gui_miny[wms[wms.length-1].gui_miny.length]=miny;wms[wms.length-1].gui_maxx[wms[wms.length-1].gui_maxx.length]=maxx;wms[wms.length-1].gui_maxy[wms[wms.length-1].gui_maxy.length]=maxy;}
+function wms_addLayerStyle(styleName,styleTitle,count,layerCount,styleLegendUrl,styleLegendUrlFormat){var currentLayer=wms[wms.length-1].objLayer[layerCount];if(currentLayer){currentLayer.layer_style[count]={};currentLayer.layer_style[count].name=styleName;currentLayer.layer_style[count].title=styleTitle;currentLayer.layer_style[count].legendurl=styleLegendUrl;currentLayer.layer_style[count].legendurlformat=styleLegendUrlFormat;}}
+function wms_add_layer(layer_parent,layer_uid,layer_name,layer_title,layer_dataurl_href,layer_pos,layer_queryable,layer_minscale,layer_maxscale,layer_metadataurl,gui_layer_wms_id,gui_layer_status,gui_layer_style,gui_layer_selectable,gui_layer_visible,gui_layer_queryable,gui_layer_querylayer,gui_layer_minscale,gui_layer_maxscale,gui_layer_wfs_featuretype){wms[wms.length-1].objLayer[wms[wms.length-1].objLayer.length]=new wms_layer(layer_parent,layer_uid,layer_name,layer_title,layer_dataurl_href,layer_pos,layer_queryable,layer_minscale,layer_maxscale,layer_metadataurl,gui_layer_wms_id,gui_layer_status,gui_layer_style,parseInt(gui_layer_selectable,10),parseInt(gui_layer_visible,10),parseInt(gui_layer_queryable,10),parseInt(gui_layer_querylayer,10),parseInt(gui_layer_minscale,10),parseInt(gui_layer_maxscale,10),gui_layer_wfs_featuretype);var parentLayer=wms[wms.length-1].getLayerByLayerPos(parseInt(layer_parent,10));if(parentLayer){parentLayer.has_childs=true;}}
+function layer_addEpsg(epsg,minx,miny,maxx,maxy){var j=wms[wms.length-1].objLayer.length-1;var k=wms[wms.length-1].objLayer[j].layer_epsg.length;var currentLayer=wms[wms.length-1].objLayer[j];currentLayer.layer_epsg[k]={};currentLayer.layer_epsg[k].epsg=epsg;currentLayer.layer_epsg[k].minx=minx;currentLayer.layer_epsg[k].miny=miny;currentLayer.layer_epsg[k].maxx=maxx;currentLayer.layer_epsg[k].maxy=maxy;}
+function wms_layer(layer_parent,wms_layer_uid,layer_name,layer_title,layer_dataurl_href,layer_pos,layer_queryable,layer_minscale,layer_maxscale,layer_metadataurl,gui_layer_wms_id,gui_layer_status,gui_layer_style,gui_layer_selectable,gui_layer_visible,gui_layer_queryable,gui_layer_querylayer,gui_layer_minscale,gui_layer_maxscale,gui_layer_wfs_featuretype){this.layer_id=wms_layer_count;this.layer_uid=wms_layer_uid;this.layer_parent=layer_parent;this.layer_name=layer_name;this.layer_title=layer_title;this.layer_dataurl_href=layer_dataurl_href;this.layer_pos=layer_pos;this.layer_queryable=layer_queryable;this.layer_minscale=layer_minscale;this.layer_maxscale=layer_maxscale;this.layer_metadataurl=layer_metadataurl;this.layer_epsg=[];this.gui_layer_wms_id=gui_layer_wms_id;this.gui_layer_status=gui_layer_status;this.gui_layer_selectable=gui_layer_selectable;this.gui_layer_visible=gui_layer_visible;this.gui_layer_queryable=gui_layer_queryable;this.gui_layer_querylayer=gui_layer_querylayer;this.gui_layer_minscale=gui_layer_minscale;this.gui_layer_maxscale=gui_layer_maxscale;this.gui_layer_style=gui_layer_style;this.gui_layer_wfs_featuretype=gui_layer_wfs_featuretype;this.gui_layer_style=null;this.has_childs=false;this.layer_style=[];wms_layer_count++;}
+wms_layer.prototype.checkScale=function(mapObj){var minScale=parseInt(this.gui_layer_minscale,10);var maxScale=parseInt(this.gui_layer_maxscale,10);var currentScale=parseInt(mapObj.getScale(),10);if(minScale===0&&maxScale===0){return true;}
+if(minScale>currentScale||(maxScale!==0&&maxScale<currentScale)){return false;}
+return true;};wms_layer.prototype.setVisible=function(visible){this.gui_layer_visible=parseInt(visible,10);};wms_layer.prototype.setQueryable=function(queryable){this.gui_layer_querylayer=parseInt(queryable,10);};
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_addWMSfromfilteredList_ajax.php
===================================================================
--- branches/print_dev/http/javascripts/mod_addWMSfromfilteredList_ajax.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_addWMSfromfilteredList_ajax.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -20,372 +20,304 @@
 require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
 
 ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
 <head>
-	<meta http-equiv="cache-control" content="no-cache" />
-	<meta http-equiv="pragma" content="no-cache" />
-	<meta http-equiv="expires" content="0" />
-	<?php printf("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\" />",CHARSET);	?>
-	<title>Add WMS</title>
-	<script type="text/javascript">
-	<!--
-	// Set default for element variables if they are undefined
-	option_all        = (typeof(option_all) !== 'undefined')        ? option_all        : '1';
-	option_group      = (typeof(option_group) !== 'undefined')      ? option_group      : '1';
-	option_gui        = (typeof(option_gui) !== 'undefined')        ? option_gui        : '1';
-	option_dball      = (typeof(option_dball) !== 'undefined')      ? option_dball      : '1';
-	option_dbgroup    = (typeof(option_dbgroup) !== 'undefined')    ? option_dbgroup    : '1';
-	option_dbgui      = (typeof(option_dbgui) !== 'undefined')      ? option_dbgui      : '1';
-	capabilitiesInput = (typeof(capabilitiesInput) !== 'undefined') ? capabilitiesInput : '0';
-	gui_list          = (typeof(gui_list) !== 'undefined')          ? gui_list          : '';
+<meta http-equiv="Content-Type" content="text/html; charset='<?php echo CHARSET;?>'>
+<title>Add WMS from Filtered Catalog</title>
+<link rel="stylesheet" type="text/css" href="../css/administration_alloc.css">
+<STYLE TYPE="text/css">
+<!--
+body{
+	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
+	font-size:10pt
+}    
+   
+table{
+	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
+	font-size:11;
+}   
 
-	var guis = gui_list.split(',');
-	
-	if(gui_list === '') {
-		guis = [];
-	}
+.wms_button{
+	color: black;
+	border: solid thin;
+	height:22px;
+	width:60px;
+}
+-->
+</STYLE>
+<?php
+include '../include/dyn_css.php';
+?>
+<script type="text/javascript">
+<!--
+var global_source = "capabilities";  // "capabilities" || "db"
+var phpUrl = "../php/mod_addWMSfromfilteredList_server.php?<?php echo $urlParameters;?>";
 
-	var global_source = 'capabilities';  // [capabilities,db]
-	var phpUrl        = '../php/mod_addWMSfromfilteredList_server.php?<?php echo $urlParameters;?>';
+// ----------------- Load service --------------------
 
-	// Load service
+function mod_addWMSfromDB(gui_id, wms_id) {
+	window.opener.mod_addWMSById_load(gui_id, wms_id);
+}
 
-	function mod_addWMSfromDB(gui_id,wms_id) {
-		parent.mod_addWMSById_load(gui_id,wms_id);
-	}
+function mod_addWMSfromfilteredList(pointer_name,version){
 
-	function mod_addWMSfromfilteredList(pointer_name,version){
-		//TODO: load active
-		var load                 = false;
-		var conjunctionCharacter = parent.mb_getConjunctionCharacter(pointer_name);
-		
-		if(version == '1.0.0') {
-			load = pointer_name + conjunctionCharacter + 'REQUEST=capabilities&WMTVER=1.0.0';
-		}
-		else if(version == '1.1.0' || version == '1.1.1') {
-			load = pointer_name + conjunctionCharacter + 'REQUEST=GetCapabilities&SERVICE=WMS&VERSION=' + version;
-		}
-		if(load !== false) {
-			parent.mod_addWMS_load(load);
-		}
+	var load = false;
+	var conjunctionCharacter = window.opener.mb_getConjunctionCharacter(pointer_name);
+	
+	if (version == '1.0.0') {
+		load = pointer_name + conjunctionCharacter + "REQUEST=capabilities&WMTVER=1.0.0";
 	}
-
-	function mod_addWmsfromURL(){
-		var capabilities = document.getElementById('CapURL').value;
-		parent.mod_addWMS_load(capabilities);
+	else if (version == '1.1.0' || version == '1.1.1') {
+		load = pointer_name + conjunctionCharacter + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=" + version;
 	}
+	if (load !== false) {
+		window.opener.mod_addWMS_load(load);
+	}
+}
 
-	// Retrieve data
+// -----------------  Retrieve data --------------------
 
-	function setSource(sourceValue) {
-		global_source = sourceValue;
-	}
+function setSource(sourceValue) {
+	global_source = sourceValue;
+}
 
-	function getGroups() {
-		imageOn();
-		parent.mb_ajax_json(phpUrl, {"command":"getGroups"}, function (json, status) {
-			imageOff();
-			displayGroups(json.group);
-		});
-	}
+function getGroups() {
+	imageOn();
+	window.opener.mb_ajax_json(phpUrl, {"command":"getGroups"}, function (json, status) {
+		imageOff();
+		displayGroups(json.group);
+	});
+}
 
-	function getGUIs() {
-		imageOn();
-		parent.mb_ajax_json(phpUrl, {"command":"getGUIs"}, function (json, status) {
-			imageOff();
-			displayGUIs(json.gui);
-		});
-	}
+function getGUIs() {
+	imageOn();
+	window.opener.mb_ajax_json(phpUrl, {"command":"getGUIs"}, function (json, status) {
+		imageOff();
+		displayGUIs(json.gui);
+	});
+}
 
-	function getWMSByGUI(guiId) {
-		if(guiId=="")
-			return getAllWMS();
-		imageOn();
-		parent.mb_ajax_json(phpUrl, {"command":"getWMSByGUI", "guiId":guiId}, function (json, status) {
-			imageOff();
-			displayWMS(json.wms, guiId);
-		});
-	}
+function getWMSByGUI(guiId) {
+	imageOn();
+	window.opener.mb_ajax_json(phpUrl, {"command":"getWMSByGUI", "guiId":guiId}, function (json, status) {
+		imageOff();
+		displayWMS(json.wms, guiId);
+	});
+}
 
-	function getWMSByGroup(groupId) {
-		imageOn();
-		parent.mb_ajax_json(phpUrl, {"command":"getWMSByGroup", "groupId":groupId}, function (json, status) {
-			imageOff();
-			displayWMS(json.wms);
-		});
-	}
+function getWMSByGroup(groupId) {
+	imageOn();
+	window.opener.mb_ajax_json(phpUrl, {"command":"getWMSByGroup", "groupId":groupId}, function (json, status) {
+		imageOff();
+		displayWMS(json.wms);
+	});
+}
 
-	function getAllWMS() {
-		imageOn();
-		parent.mb_ajax_json(phpUrl, {"command":"getAllWMS"}, function (json, status) {
-			imageOff();
-			displayWMS(json.wms);
-		});
-	}
+function getAllWMS() {
+	imageOn();
+	window.opener.mb_ajax_json(phpUrl, {"command":"getAllWMS"}, function (json, status) {
+		imageOff();
+		displayWMS(json.wms);
+	});
+}
 
-	// -----------------  Display results --------------------
+// -----------------  Display results --------------------
 
-	function removeChildNodes(node) {
-		while (node.childNodes.length > 0) {
-			var childNode = node.firstChild;
-			node.removeChild(childNode);
-		}
+function removeChildNodes(node) {
+	while (node.childNodes.length > 0) {
+		var childNode = node.firstChild;
+		node.removeChild(childNode);
 	}
+}
 
-	function setTableHeader(text,titleLeft,titleRight) {
-		document.getElementById('resultString').innerHTML = text;
-		document.getElementById('titleLeft').innerHTML    = titleLeft;
-		document.getElementById('titleRight').innerHTML   = titleRight;
-		
-		removeChildNodes(document.getElementById('resultTableBody'));
-	}
+function setTableHeader(text, titleLeft, titleRight) {
+	document.getElementById("resultTable").style.visibility = 'visible';
+	document.getElementById("resultString").innerHTML = text;
+	document.getElementById("titleLeft").innerHTML = titleLeft;
+	document.getElementById("titleRight").innerHTML = titleRight;
+	removeChildNodes(document.getElementById("resultTableBody"));
+}
 
-	function addTableRow(leftText,rightText,onClick) {
-		var resultTableBoy        = document.getElementById('resultTableBody');
-		var leftTableCell         = document.createElement('td');
-		var rightTableCell        = document.createElement('td');
-		var leftTableCellContent  = document.createElement('strong');
-		var rightTableCellContent = document.createElement('em');
-		var tableRow              = document.createElement('tr');
-				
-		leftTableCellContent.innerHTML  = leftText;
-		rightTableCellContent.innerHTML = rightText;
+function addRow(tableId, leftText, rightText, onClick, cnt) {
+	var leftNode = document.createElement("td");
+	var leftDivNode = createDiv(leftText, onClick,"leftDiv"+cnt);
+	leftNode.appendChild(leftDivNode);
 
-		leftTableCell.appendChild(leftTableCellContent);
-		rightTableCell.appendChild(rightTableCellContent);
-		tableRow.appendChild(leftTableCell);
-		tableRow.appendChild(rightTableCell);
-		
-		tableRow.setAttribute('onclick',onClick);
+	var rightNode = document.createElement("td");
+	var rightDivNode = createDiv(rightText, onClick,"rightDiv"+cnt);
+	rightNode.appendChild(rightDivNode);
 
-		if(resultTableBoy.childNodes.length % 2 !== 0) {
-			tableRow.className += tableRow.className + ' alternate';
-		}
-
-		resultTableBoy.appendChild(tableRow);
+	var rowNode = document.createElement("tr");
+	rowNode.id = "tr"+cnt;
+	var nodeId = rowNode.id;
+	rowNode.onmouseover = function () {
+			setBackgroundColor(nodeId,"#F08080");
 	}
-
-	function imageOn() {
-		document.getElementById("progressIndicator").style.visibility = "visible";
-		document.getElementById("progressIndicator").style.display = "block";
-		document.getElementById("resultTable").style.visibility = "hidden";
-		document.getElementById("resultTable").style.display = "none";
-		document.getElementById("resultString").style.visibility = "hidden";
-		document.getElementById("resultString").style.display = "none";
+	rowNode.onmouseout = function () {
+			setBackgroundColor(nodeId,"#FFFFFF");
 	}
+	//rowNode.setAttribute("onmouseover", "this.style.backgroundColor = '#F08080'");
+	//rowNode.setAttribute("onmouseout", "this.style.backgroundColor = '#FFFFFF'");
+	
+	rowNode.appendChild(leftNode);
+	rowNode.appendChild(rightNode);
+	
+	document.getElementById(tableId).appendChild(rowNode);
+}
 
-	function imageOff() {
-		document.getElementById("progressIndicator").style.visibility = "hidden";
-		document.getElementById("progressIndicator").style.display = "none";
-		document.getElementById("resultTable").style.visibility = "visible";
-		document.getElementById("resultTable").style.display = "block";
-		document.getElementById("resultString").style.visibility = "visible";
-		document.getElementById("resultString").style.display = "block";
-	}
+function setBackgroundColor(nodeId, color){
+	document.getElementById(nodeId).style.backgroundColor = color;	
+}
 
-	function noResult() {
-		document.getElementById("resultTable").style.visibility = 'hidden';
-		document.getElementById("resultString").innerHTML = noResultText;
-	}
+function createDiv(text, onClick, divId) {
+	var divNode = document.createElement("div");
+	divNode.id = divId;
+	divNode.style.cursor = "pointer";
+	divNode.onclick = onClick;
+	
+	//divNode.setAttribute("onclick", onClick);
+	divNode.innerHTML = text;
+	
+	return divNode;
+}
 
-	function setButtons() {
-		var containerCapabilities = document.getElementById('container_capabilities');
-		var containerButtons      = document.getElementById('container_buttons');
-		var optionButton          = false;
+function imageOn() {
+	document.getElementById("searchImage").style.visibility = "visible";
+	document.getElementById("resultTable").style.visibility = "hidden";
+	document.getElementById("resultString").style.visibility = "hidden";
+}
 
-		// If only one is active load list imidiately
-		if(
-			parseInt(option_all) + 
-			parseInt(option_group) + 
-			parseInt(option_gui) + 
-			parseInt(option_dbgui) + 
-			parseInt(option_dbgroup) + 
-			parseInt(option_dball)
-		=== 1) {
-			if(option_all === '1') {
-				optionButton = document.getElementById('button_all');
-			}
-			if(option_group === '1') {
-				optionButton = document.getElementById('button_group');
-			}
-			if(option_gui === '1') {
-				optionButton = document.getElementById('button_gui');
-			}
-			if(option_dball === '1'){
-				optionButton = document.getElementById('button_dbAll');
-			}
-			if(option_dbgroup === '1') {
-				optionButton = document.getElementById('button_dbGroup');
-			}
-			if(option_dbgui === '1') {
-				optionButton = document.getElementById('button_dbGui');
-			}
+function imageOff() {
+	document.getElementById("searchImage").style.visibility = "hidden";
+	document.getElementById("resultTable").style.visibility = "visible";
+	document.getElementById("resultString").style.visibility = "visible";
+}
 
-			if(optionButton) {
-				optionButton.onclick();
-				containerButtons.parentNode.removeChild(containerButtons);
-				
-				return;
-			}
-		}
+function noResult() {
+	document.getElementById("resultTable").style.visibility = 'hidden';
+	document.getElementById("resultString").innerHTML = noResultText;
+}
 
-		if(typeof(option_all) !== 'undefined' && option_all === '0') {
-			optionButton = document.getElementById('button_all'); 
-			optionButton.parentNode.removeChild(optionButton);
-		}
-		if(typeof(option_group) !== 'undefined' && option_group === '0') {
-			optionButton = document.getElementById('button_group');
-			optionButton.parentNode.removeChild(optionButton);
-		}
-		if(typeof(option_gui) !== 'undefined' && option_gui === '0') {
-			optionButton = document.getElementById('button_gui');
-			optionButton.parentNode.removeChild(optionButton);
-		}
-		if(option_dball === '0') {
-			optionButton = document.getElementById('button_dbAll');
-			optionButton.parentNode.removeChild(optionButton);
-		}
-		if(option_dbgroup === '0') {
-			optionButton = document.getElementById('button_dbGroup');
-			optionButton.parentNode.removeChild(optionButton);
-		}
-		if(option_dbgui === '0') {
-			optionButton = document.getElementById('button_dbGui');
-			optionButton.parentNode.removeChild(optionButton);
-		}
-		
-		if(capabilitiesInput === '0') {
-			optionButton = document.getElementById('capabilitiesForm');
-			optionButton.parentNode.removeChild(optionButton);
-			containerCapabilities.parentNode.removeChild(containerCapabilities);
-		}
+function setButtons() {
+	if (typeof(option_all) != "undefined" && option_all == '0') {
+		var child = document.getElementById("button_all"); 
+		child.parentNode.removeChild(child);
 	}
+	if (typeof(option_group) != "undefined" && option_group == '0') {
+		var child = document.getElementById("button_group");
+		child.parentNode.removeChild(child);
+	}
+	if (typeof(option_gui) != "undefined" && option_gui == '0') {
+		var child = document.getElementById("button_gui");
+		child.parentNode.removeChild(child);
+	}
+	if (typeof(option_db) != "undefined" && option_db == '0') {
+		var child = document.getElementById("button_db");
+		child.parentNode.removeChild(child);
+	}
+}
 
-	function displayGroups (groupArray) {
-		if (groupArray.length > 0) {
-			setTableHeader(selectGroupText, groupNameText, groupAbstractText);
-			
-			for (var i = 0; i < groupArray.length; i++) {
-				var onClick = "getWMSByGroup('" + groupArray[i].id + "')";
-				addTableRow(groupArray[i].name, groupArray[i].description, onClick);	
-			}
+function displayGroups (groupArray) {
+	if (groupArray.length > 0) {
+		setTableHeader(selectGroupText, groupNameText, groupAbstractText);
+		
+		for (var i = 0; i < groupArray.length; i++) {
+			(function () {
+				var index = i;
+				var onClick = function () {
+					getWMSByGroup(groupArray[index].id);	
+				}
+				addRow("resultTableBody", groupArray[i].name, groupArray[i].description, onClick, i);	
+			}());
 		}
-		else {
-			noResult();
-		}
 	}
+	else {
+		noResult();
+	}
+}
 
-	function displayGUIs (guiArray) {
-		if (guiArray.length > 0) {
-			setTableHeader(selectGuiText, guiNameText, guiAbstractText);
-			
-			for (var i = 0; i < guiArray.length; i++) {
-				var onClick = "getWMSByGUI('" + guiArray[i].id + "')";
-				if(guis.length>0){
-					for(var j=0; j < guis.length; j++){
-						if(guiArray[i].id==guis[j]){
-							addTableRow(guiArray[i].name, guiArray[i].description, onClick);	
-							break;
-						}
-					}
+function displayGUIs (guiArray) {
+	if (guiArray.length > 0) {
+		setTableHeader(selectGuiText, guiNameText, guiAbstractText);
+		
+		for (var i = 0; i < guiArray.length; i++) {
+			(function () {
+				var index = i;
+				var onClick = function () {
+					getWMSByGUI(guiArray[index].id);	
 				}
-				else
-					addTableRow(guiArray[i].name, guiArray[i].description, onClick);	
-			}
+				addRow("resultTableBody", guiArray[i].name, guiArray[i].description, onClick, i);	
+			}())
 		}
-		else {
-			noResult();
-		}
 	}
+	else {
+		noResult();
+	}
+}
 
-	function displayWMS (wmsArray, guiId) {
-		if (wmsArray.length > 0) {
-			setTableHeader(selectWmsText, wmsNameText, wmsAbstractText);
+function displayWMS (wmsArray, guiId) {
+	if (wmsArray.length > 0) {
+		setTableHeader(selectWmsText, wmsNameText, wmsAbstractText);
 
-			for (var i = 0; i < wmsArray.length; i++) {
+		for (var i = 0; i < wmsArray.length; i++) {
 
+			(function () {
+				var index = i;
 				if (global_source == "db" && typeof(guiId) !== "undefined" ) {
-					var onClick = "mod_addWMSfromDB('" + guiId + "', '" + wmsArray[i].id + "')";
+					var onClick = function () {
+						mod_addWMSfromDB(guiId, wmsArray[index].id);	
+					}
 				}		
 				else {
-					var onClick = "mod_addWMSfromfilteredList('" + wmsArray[i].getCapabilitiesUrl + "', '" + wmsArray[i].version + "')";
+					var onClick = function () {
+						mod_addWMSfromDB(guiId, wmsArray[index].id);	
+					}
+	//				var onClick = "mod_addWMSfromfilteredList('" + wmsArray[i].getCapabilitiesUrl + "', '" + wmsArray[i].version + "')";
 				}
-				addTableRow(wmsArray[i].title, wmsArray[i].abstract, onClick);
-			}
+				addRow("resultTableBody", wmsArray[i].title, wmsArray[i].abstract, onClick, i);
+			}());
 		}
-		else {
-			noResult();
-		}
 	}
-	-->
-	</script>
-	<?php include("../include/dyn_css.php"); ?>
-	<script type="text/javascript">
-	var wmsNameText = '<?php echo _mb("WMS name");?>';
-	var wmsAbstractText = '<?php echo _mb("WMS abstract");?>';
-	var selectWmsText = '<?php echo _mb("Please select a WMS") . ":";?>';
-	var selectGuiText = '<?php echo _mb("Please select an application") . ":";?>';
-	var selectGroupText = '<?php echo _mb("Please select a group") . ":";?>';
-	var groupAbstractText = '<?php echo _mb("group abstract");?>';
-	var groupNameText = '<?php echo _mb("group name");?>';
-	var guiAbstractText = '<?php echo _mb("application abstract");?>';
-	var guiNameText = '<?php echo _mb("application name");?>';
-	var noResultText = '<?php echo _mb("no result");?>';
-	</script>
+	else {
+		noResult();
+	}
+}
 
+// -->
+</script>
 </head>
+<body onLoad="window.focus();setButtons();">
 
-<body onLoad="setButtons();">
-<h1><?php echo _mb("Add WMS"); ?></h1>
-<p><?php echo _mb("Enter a Capabilities-URL of a WMS or select one or more WMS from list."); ?></p>
-<p><em><?php echo _mb("Hint: Possibly you need to zoom in for showing layers from external map service. The operator of the external service is responsible for the display ranges. PortalU does not have a stake in this behaviour."); ?></em></p>
-
-<form id="capabilitiesForm" name="addURLForm" method="post" action="">
-<fieldset id="container_capabilities">
-<legend>Capabilities</legend>
-	<p>
-		<label for="CapURL"><?php echo _mb("Capabilities-URL"); ?>:</label> 
-		<input type="text" id="CapURL" name="CapURL" /> 
-		<input type="button" id="addCapURL" name="addCapURL" value="<?php echo _mb("Add"); ?>" onclick="mod_addWmsfromURL();" />
-	</p>
-</fieldset>
+<form name='addWMSForm'>
+	<table border='0' cellpadding='3'  rules='rows'>
+		<tr>
+			<td><input type='button' class='wms_button' name='button_all' id='button_all' value='all wms' onclick='setSource("capabilities");getAllWMS()'></td>
+			<td><input type='button' class='wms_button' name='button_group' id='button_group' value='group' onclick = 'setSource("capabilities");getGroups()'></td>	
+			<td><input type='button' class='wms_button' name='button_gui' id='button_gui' value='gui' onclick = 'setSource("capabilities");getGUIs()'></td>
+			<td><input type='button' class='wms_button' name='button_db' id='button_db' value='db' onclick = 'setSource("db");getGUIs()'></td>
+		</tr>
+	</table>
 </form>
 
-<form id="addWMSForm" name="addWMSForm" method="post" action="">
-<fieldset id="container_buttons">
-<legend>WMS list(s)</legend>
-	<p>
-		<label><?php echo _mb("Available WMS list(s)"); ?>:</label> 
-		<input type="button" name="button_all"     id="button_all"     value="<?php echo _mb("All WMS"); ?>"            onclick="setSource('capabilities');getWMSByGUI(gui_list)"> 
-		<input type="button" name="button_group"   id="button_group"   value="<?php echo _mb("WMS by Group"); ?>"              onclick="setSource('capabilities');getGroups()"> 
-		<input type="button" name="button_gui"     id="button_gui"     value="<?php echo _mb("WMS by GUI"); ?>"                onclick="setSource('capabilities');getGUIs()"> 
-		<input type="button" name="button_dbAll"   id="button_dbAll"   value="<?php echo _mb("Database (All WMS)"); ?>" onclick="setSource('db');getWMSByGUI(gui_list)">
-		<input type="button" name="button_dbGroup" id="button_dbGroup" value="<?php echo _mb("Database (Group)"); ?>"   onclick="setSource('db');getGroups()"> 
-		<input type="button" name="button_dbGui"   id="button_dbGui"   value="<?php echo _mb("Database (GUI)"); ?>"     onclick="setSource('db');getGUIs()"> 
-	</p>
-</fieldset>
-</form>
+<div id='searchImage' name='searchImage' style='visibility:hidden'>
+	<img src='../img/indicator_wheel.gif'>
+</div>
 
-<p id="progressIndicator" name="progressIndicator">
-	<img src="../img/indicator_wheel.gif" />
-	<?php echo _mb("Loading"); ?> ... 
-</p>
+<div id='resultString' name='resultString'></div>
 
-<h2 id="resultString" name="resultString"></h2>
+<br>
 
-<table id="resultTable" name="resultTable">
-	<thead>
+<table id='resultTable' name='resultTable' border=1 width="98%" cellpadding=3 rules='rows' style='visibility:hidden'>
+	<thead bgcolor="#FAEBD7">
 		<tr>
-			<th id="titleLeft" name="titleLeft"></th>
-			<th id="titleRight" name="titleRight"></th>
+			<td id='titleLeft' name='titleLeft' width=200 height=10></td>
+			<td id='titleRight' name='titleRight' align=left class=fieldnames_s></td>
 		</tr>
 	</thead>
-	<tbody id="resultTableBody" name="resultTableBody">
+	<tbody id='resultTableBody' name='resultTableBody'>
 	</tbody>
 </table>
+</div>
 </body>
-
 </html>
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_addWMSgeneralFunctions.js
===================================================================
--- branches/print_dev/http/javascripts/mod_addWMSgeneralFunctions.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_addWMSgeneralFunctions.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,38 +1,6 @@
-function mb_mapObjaddWMS(obj){
-	var cnt_layers = 0;
-	var cnt_querylayers = 0;
-	var styles = "";
-	var layers = "";
-	var querylayers = "";
-	var ind = getMapObjIndexByName(obj);
-	//is the id valid?
-	for( var i=0; i<(wms.length-1); i++){
-		if(parseInt(wms[i].wms_id, 10) >= parseInt(wms[wms.length-1].wms_id, 10)){
-			wms[wms.length-1].wms_id = parseInt(mb_mapObj[ind].wms[i].wms_id, 10) + 1;
-		}
-	} 
-	mb_mapObj[ind].wms[mb_mapObj[ind].wms.length] = wms[wms.length-1];
-	mb_mapObj[ind].layers[mb_mapObj[ind].layers.length] = layers;
-	mb_mapObj[ind].styles[mb_mapObj[ind].styles.length] = styles;
-	mb_mapObj[ind].querylayers[mb_mapObj[ind].querylayers.length] = querylayers;  
-	mb_execloadWmsSubFunctions();
-	return true; 
-}
 
-function mod_addWMS_load(caps){
-	window.frames['loadData'].document.location.href = "../php/mod_createJSObjFromXML.php?caps=" + encodeURIComponent(caps);
-}
-
-function mod_addLayer_load(caps,layer_name){
-	var url = "../php/mod_createJSLayerObjFromXML.php?caps=" + encodeURIComponent(caps) + "&layer_name=" + encodeURIComponent(layer_name);
-	window.frames['loadData'].document.location.href = url;
-}
-
-function mod_addWMSById_load(gui_id, wms_id){
-	window.frames['loadData'].document.location.href = "../php/mod_createJSObjFromDBByWMS.php?wms_id=" + wms_id + "&gui_id=" + gui_id;
-}
-
-function mod_addWMS_refresh(){
-	mb_mapObjaddWMS('mapframe1')
-	zoom('mapframe1', true, 0.999);
-}
\ No newline at end of file
+function mod_addWMS_load(caps){window.frames['loadData'].document.location.href="../php/mod_createJSObjFromXML.php?caps="+encodeURIComponent(caps);}
+function mod_addLayer_load(caps,layer_name){var url="../php/mod_createJSLayerObjFromXML.php?caps="+encodeURIComponent(caps)+"&layer_name="+encodeURIComponent(layer_name);window.frames['loadData'].document.location.href=url;}
+function mod_addWMSById_load(gui_id,wms_id){window.frames['loadData'].document.location.href="../php/mod_createJSObjFromDBByWMS.php?wms_id="+wms_id+"&gui_id="+gui_id;}
+function mod_addWMS_refresh(){mb_mapObjaddWMS('mapframe1')
+zoom('mapframe1',true,0.999);}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_adminNavigation.js
===================================================================
--- branches/print_dev/http/javascripts/mod_adminNavigation.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_adminNavigation.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,12 +1,4 @@
-function mod_adminNavigation_init(){
-	eventInit.trigger();
-	for (var i=0; i< document.getElementsByTagName("a").length; i++){
-		document.getElementsByTagName("a")[i].onclick = new Function("mod_adminNavigation(this)");
-	}
-}
-function mod_adminNavigation(obj){
-	for (var i=0; i< document.getElementsByTagName("a").length; i++){
-		document.getElementsByTagName("a")[i].style.color = "#808080";
-	}
-	obj.style.color = "#0000ff";
-}
\ No newline at end of file
+
+function mod_adminNavigation_init(){eventInit.trigger();for(var i=0;i<document.getElementsByTagName("a").length;i++){document.getElementsByTagName("a")[i].onclick=new Function("mod_adminNavigation(this)");}}
+function mod_adminNavigation(obj){for(var i=0;i<document.getElementsByTagName("a").length;i++){document.getElementsByTagName("a")[i].style.color="#808080";}
+obj.style.color="#0000ff";}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_box1.js
===================================================================
--- branches/print_dev/http/javascripts/mod_box1.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_box1.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,142 +1,23 @@
-/* 
-* $Id$
-* COPYRIGHT: (C) 2001 by ccgis. This program is free software under the GNU General Public
-* License (>=v2). Read the file gpl.txt that comes with Mapbender for details. 
-*/
 
-var mb_isActive = false;
-var mb_isBF = false;
-var mb_zF = false;
-
-var mb_offset_top = 0;
-var mb_offset_right = 0;
-var mb_offset_bottom = 0;
-var mb_offset_left = 0;
-
-function  mod_box_start(e){
-	mb_isActive = true;
-	mb_getMousePos(e,mb_isBF);
-	mb_start_x = clickX;
-	mb_start_y = clickY;
-	mb_end_x = mb_start_x+1;
-	mb_end_y = mb_start_y+1;
-	mb_offset_left = mb_start_x;
-	mb_offset_top = mb_start_y;
-	mb_offset_bottom = mb_start_y;
-	mb_offset_right = mb_start_x;
-	mb_drawBox(mb_start_x,mb_start_y,mb_end_x,mb_end_y);
-	return false;
-}
-function mod_box_run(e){
-	if(mb_isActive){
-		mb_getMousePos(e,mb_isBF);
-		for(var i=0; i<mb_mapObj.length; i++){
-			if(mb_mapObj[i].frameName == mb_isBF){
-				var width = mb_mapObj[i].width;
-				var height = mb_mapObj[i].height;
-			}
-		}
-		if (((clickX>width) || (clickY>height) || (clickX<=0) ||(clickY<=0))){
-			isActive = false;  
-			mod_box_stop(e);
-		}
-		else{
-			mb_end_x=clickX;
-			mb_end_y=clickY;
-			evalExtent();
-		}
-		return false;
-	}
-}
-function mod_box_stop(e){
-	mb_hideElement("l_top");
-	mb_hideElement("l_left");
-	mb_hideElement("l_right");
-	mb_hideElement("l_bottom");
-	if(mb_isActive){
-		mb_isActive = false;
-		return mb_setMapExtent(mb_start_x,mb_start_y,mb_end_x,mb_end_y);
-	}
-	mb_isActive = false;
-}
-function mb_drawBox(left,top,right,bottom){
-	mb_arrangeBox("l_top",left,top,right,top+2);
-	mb_arrangeBox("l_left",left,top,left+2,bottom);
-	mb_arrangeBox("l_right",right-2,top,right,bottom);
-	mb_arrangeBox("l_bottom",left,bottom-2,right,bottom);
-	mb_displayElement("l_top");
-	mb_displayElement("l_left");
-	mb_displayElement("l_right");
-	mb_displayElement("l_bottom");
-}
-function mb_arrangeBox(name, left, top, right, bottom){
-	var el = window.frames[mb_isBF].document.getElementById(name).style;
-	el.height = Math.abs(bottom - top);
-	el.width = Math.abs(right - left);
-	el.top = top + "px";
-	el.left = left + "px";
-}
-function mb_displayElement(name){
-	window.frames[mb_isBF].document.getElementById(name).style.visibility = "visible";
-}
-function mb_hideElement(name) {
-	window.frames[mb_isBF].document.getElementById(name).style.visibility = "hidden";
-}
-function evalExtent(){
-	if(mb_start_x>mb_end_x){
-		mb_offset_right=mb_start_x;
-		mb_offset_left=mb_end_x;
-	}
-	else{
-		mb_offset_left=mb_start_x;
-		mb_offset_right=mb_end_x;
-	}
-	if(mb_start_y>mb_end_y){
-		mb_offset_bottom=mb_start_y;
-		mb_offset_top=mb_end_y;
-	}
-	else{
-		mb_offset_top=mb_start_y;
-		mb_offset_bottom=mb_end_y;
-	}
-	if((mb_start_x != mb_end_x)&&(mb_start_y != mb_end_y)){
-		mb_drawBox(mb_offset_left,mb_offset_top,mb_offset_right,mb_offset_bottom);
-	}
-}
-function mb_setMapExtent(x1,y1,x2,y2){
-	if(x1 < x2){
-		var minx = x1;
-		var maxx = x2;
-	}
-	else{
-		var minx = x2;
-		var maxx = x1;
-	}
-	if(y1 < y2){
-		var miny = y2;
-		var maxy = y1;
-	}
-	else{
-		var miny = y1;
-		var maxy = y2;
-	}
-   // area or clickpoint ?
-	var ret = [];
-	if((maxx - minx) > 3 && (miny - maxy) > 3){
-		var posMin = makeClickPos2RealWorldPos(mb_isBF,minx,miny);
-		var posMax = makeClickPos2RealWorldPos(mb_isBF,maxx,maxy);
-		ret[0] = posMin[0];
-		ret[1] = posMin[1];
-		ret[2] = posMax[0];
-		ret[3] = posMax[1];
-		return ret;
-	// mb_setValidClipping(posMin[0],posMin[1],posMax[0], posMax[1]);
-	}
-	else{
-		var posMin = makeClickPos2RealWorldPos(mb_isBF,minx,miny);
-		ret[0] = posMin[0];
-		ret[1] = posMin[1];
-		return ret;      
-		//zoom(mb_zF,true,1.0,pos[0], pos[1]);
-	}
-}
\ No newline at end of file
+var mb_isActive=false;var mb_isBF=false;var mb_zF=false;function mod_box_start(e){mb_isActive=true;mb_getMousePos(e,mb_isBF);mb_start_x=clickX;mb_start_y=clickY;mb_end_x=mb_start_x+1;mb_end_y=mb_start_y+1;mb_offset_left=mb_start_x;mb_offset_top=mb_start_y;mb_offset_bottom=mb_start_y;mb_offset_right=mb_start_x;mb_drawBox(mb_start_x,mb_start_y,mb_end_x,mb_end_y);return false;}
+function mod_box_run(e){if(mb_isActive){mb_getMousePos(e,mb_isBF);for(var i=0;i<mb_mapObj.length;i++){if(mb_mapObj[i].frameName==mb_isBF){var width=mb_mapObj[i].width;var height=mb_mapObj[i].height;}}
+if(((clickX>width)||(clickY>height)||(clickX<=0)||(clickY<=0))){isActive=false;mod_box_stop(e);}
+else{mb_end_x=clickX;mb_end_y=clickY;evalExtent();}
+return false;}}
+function mod_box_stop(e){mb_hideElement("l_top");mb_hideElement("l_left");mb_hideElement("l_right");mb_hideElement("l_bottom");if(mb_isActive){mb_isActive=false;return mb_setMapExtent(mb_start_x,mb_start_y,mb_end_x,mb_end_y);}
+mb_isActive=false;}
+function mb_drawBox(left,top,right,bottom){mb_arrangeBox("l_top",left,top,right,top+2);mb_arrangeBox("l_left",left,top,left+2,bottom);mb_arrangeBox("l_right",right-2,top,right,bottom);mb_arrangeBox("l_bottom",left,bottom-2,right,bottom);mb_displayElement("l_top");mb_displayElement("l_left");mb_displayElement("l_right");mb_displayElement("l_bottom");}
+function mb_arrangeBox(name,left,top,right,bottom){var el=window.frames[mb_isBF].document.getElementById(name).style;el.height=Math.abs(bottom-top);el.width=Math.abs(right-left);el.top=top+"px";el.left=left+"px";}
+function mb_displayElement(name){window.frames[mb_isBF].document.getElementById(name).style.visibility="visible";}
+function mb_hideElement(name){window.frames[mb_isBF].document.getElementById(name).style.visibility="hidden";}
+function evalExtent(){if(mb_start_x>mb_end_x){mb_offset_right=mb_start_x;mb_offset_left=mb_end_x;}
+else{mb_offset_left=mb_start_x;mb_offset_right=mb_end_x;}
+if(mb_start_y>mb_end_y){mb_offset_bottom=mb_start_y;mb_offset_top=mb_end_y;}
+else{mb_offset_top=mb_start_y;mb_offset_bottom=mb_end_y;}
+if((mb_start_x!=mb_end_x)&&(mb_start_y!=mb_end_y)){mb_drawBox(mb_offset_left,mb_offset_top,mb_offset_right,mb_offset_bottom);}}
+function mb_setMapExtent(x1,y1,x2,y2){if(x1<x2){var minx=x1;var maxx=x2;}
+else{var minx=x2;var maxx=x1;}
+if(y1<y2){var miny=y2;var maxy=y1;}
+else{var miny=y1;var maxy=y2;}
+var ret=[];if((maxx-minx)>3&&(miny-maxy)>3){var posMin=makeClickPos2RealWorldPos(mb_isBF,minx,miny);var posMax=makeClickPos2RealWorldPos(mb_isBF,maxx,maxy);ret[0]=posMin[0];ret[1]=posMin[1];ret[2]=posMax[0];ret[3]=posMax[1];return ret;}
+else{var posMin=makeClickPos2RealWorldPos(mb_isBF,minx,miny);ret[0]=posMin[0];ret[1]=posMin[1];return ret;}}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_cardindex.js
===================================================================
--- branches/print_dev/http/javascripts/mod_cardindex.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_cardindex.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,49 +1,6 @@
-/*********configuration:****************************************************************/
-var mod_cardindex_indexes	= new Array("tab1 ","tab2 ","tab3 ","tab4 ");
-var mod_cardindex_id		= new Array("iframe1","iframe2", "iframe3","iframe4");
-var mod_cardindex_dim		= new Array();
-var mod_cardindex_icolor	= "#7BA5D6";	//background active tabs
-var mod_cardindex_ficolor	= "#ff0000";	//font activ tabs
-var mod_cardindex_bcolor	= "#ffffff";	//background inactive tabs
-/***************************************************************************************/
 
-mb_registerInitFunctions("mod_cardindex_init()");
-function mod_cardindex_init(){
-	mod_cardindex_dim["width"] = document.getElementById(mod_cardindex_id[0]).style.width;
-	mod_cardindex_dim["height"] = document.getElementById(mod_cardindex_id[0]).style.height;
-	var str = "<span  style='font-family: Arial, Helvetica, sans-serif;font-size:10px;cursor:pointer'>";
-	for(var i=0; i<mod_cardindex_indexes.length; i++){
-		str += "<span id='mod_cardindex"+i+"'onclick='mod_cardindex("+i+")' style='color:black'>"+mod_cardindex_indexes[i]+"</span>&nbsp;";
-	}
-	str += "</span>";
-	writeTag("","cardindex",str);
-	for(var i=0; i<mod_cardindex_indexes.length; i++){
-		if(i == 0){
-			document.getElementById("mod_cardindex" + i).style.color = mod_cardindex_ficolor;
-			document.getElementById("mod_cardindex" + i).style.backgroundColor = mod_cardindex_icolor;
-		}
-		else{
-			document.getElementById(mod_cardindex_id[i]).style.visibility = 'hidden';
-			document.getElementById(mod_cardindex_id[i]).style.width = "1px";
-			document.getElementById(mod_cardindex_id[i]).style.height = "1px";
-		}
-	}
-}
-function mod_cardindex(obj){
-	for(var i=0; i<mod_cardindex_indexes.length; i++){
-		if(obj != i){
-			document.getElementById("mod_cardindex" + i).style.color = 'black';
-			document.getElementById("mod_cardindex" + i).style.backgroundColor = mod_cardindex_bcolor;
-			document.getElementById(mod_cardindex_id[i]).style.visibility = 'hidden';
-			document.getElementById(mod_cardindex_id[i]).style.width = "1px";
-			document.getElementById(mod_cardindex_id[i]).style.height = "1px";         
-		}
-		else if(obj == i){
-			document.getElementById("mod_cardindex" + i).style.color = mod_cardindex_ficolor;
-			document.getElementById("mod_cardindex" + i).style.backgroundColor = mod_cardindex_icolor;
-			document.getElementById(mod_cardindex_id[i]).style.visibility = 'visible';
-			document.getElementById(mod_cardindex_id[i]).style.width = mod_cardindex_dim["width"];
-			document.getElementById(mod_cardindex_id[i]).style.height = mod_cardindex_dim["height"];
-		}
-	}
-}
\ No newline at end of file
+var mod_cardindex_indexes=new Array("tab1 ","tab2 ","tab3 ","tab4 ");var mod_cardindex_id=new Array("iframe1","iframe2","iframe3","iframe4");var mod_cardindex_dim=new Array();var mod_cardindex_icolor="#7BA5D6";var mod_cardindex_ficolor="#ff0000";var mod_cardindex_bcolor="#ffffff";mb_registerInitFunctions("mod_cardindex_init()");function mod_cardindex_init(){mod_cardindex_dim["width"]=document.getElementById(mod_cardindex_id[0]).style.width;mod_cardindex_dim["height"]=document.getElementById(mod_cardindex_id[0]).style.height;var str="<span  style='font-family: Arial, Helvetica, sans-serif;font-size:10px;cursor:pointer'>";for(var i=0;i<mod_cardindex_indexes.length;i++){str+="<span id='mod_cardindex"+i+"'onclick='mod_cardindex("+i+")' style='color:black'>"+mod_cardindex_indexes[i]+"</span>&nbsp;";}
+str+="</span>";writeTag("","cardindex",str);for(var i=0;i<mod_cardindex_indexes.length;i++){if(i==0){document.getElementById("mod_cardindex"+i).style.color=mod_cardindex_ficolor;document.getElementById("mod_cardindex"+i).style.backgroundColor=mod_cardindex_icolor;}
+else{document.getElementById(mod_cardindex_id[i]).style.visibility='hidden';document.getElementById(mod_cardindex_id[i]).style.width="1px";document.getElementById(mod_cardindex_id[i]).style.height="1px";}}}
+function mod_cardindex(obj){for(var i=0;i<mod_cardindex_indexes.length;i++){if(obj!=i){document.getElementById("mod_cardindex"+i).style.color='black';document.getElementById("mod_cardindex"+i).style.backgroundColor=mod_cardindex_bcolor;document.getElementById(mod_cardindex_id[i]).style.visibility='hidden';document.getElementById(mod_cardindex_id[i]).style.width="1px";document.getElementById(mod_cardindex_id[i]).style.height="1px";}
+else if(obj==i){document.getElementById("mod_cardindex"+i).style.color=mod_cardindex_ficolor;document.getElementById("mod_cardindex"+i).style.backgroundColor=mod_cardindex_icolor;document.getElementById(mod_cardindex_id[i]).style.visibility='visible';document.getElementById(mod_cardindex_id[i]).style.width=mod_cardindex_dim["width"];document.getElementById(mod_cardindex_id[i]).style.height=mod_cardindex_dim["height"];}}}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_closePolygon.js
===================================================================
--- branches/print_dev/http/javascripts/mod_closePolygon.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_closePolygon.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,11 +1,3 @@
-var mod_closePolygon_img = new Image();
-mod_closePolygon_img.src = "../img/button_gray/closePolygon_off.gif";
-register_measureSubFunctions("mod_closePolygon()");
-function mod_closePolygon(){
-	var str =  "<div style='position:absolute;top:25px' onmouseup='parent.mod_closePolygon_go()' ";
-	str += "onmouseover='parent.mod_measure_timeout()' onmouseout='parent.mod_measure_disableTimeout()'><img src='"+mod_closePolygon_img.src+"'></div>";
-	return str;
-}
-function mod_closePolygon_go(){
-	mod_measure_close();
-}
\ No newline at end of file
+
+var mod_closePolygon_img=new Image();mod_closePolygon_img.src="../img/button_gray/closePolygon_off.gif";register_measureSubFunctions("mod_closePolygon()");function mod_closePolygon(){var str="<div style='position:absolute;top:25px' onmouseup='parent.mod_closePolygon_go()' ";str+="onmouseover='parent.mod_measure_timeout()' onmouseout='parent.mod_measure_disableTimeout()'><img src='"+mod_closePolygon_img.src+"'></div>";return str;}
+function mod_closePolygon_go(){mod_measure_close();}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_closePolygonExt.js
===================================================================
--- branches/print_dev/http/javascripts/mod_closePolygonExt.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_closePolygonExt.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,17 +1,6 @@
-var mod_closePolygonExt_img = new Image();
-mod_closePolygonExt_img.src = "../img/button_gray/closePolygon_off.gif";
-try {register_setExtRequestSubFunctions("mod_closePolygonExt()");}
-catch(e) {
-	try {parent.register_setExtRequestSubFunctions("mod_closePolygonExt()");}
-	catch(e) {
-		alert("exception (mod_closePolygonExt.js): register_setExtRequestSubFunctions not found");
-	}
-}
-function mod_closePolygonExt(){
-	var str =  "<div style='position:absolute;top:25px' onmouseup='parent.mod_wfs_spatialRequest_close()' ";
-	str += "onmouseover='parent.mod_wfs_spatialRequest_timeout()' onmouseout='parent.mod_wfs_spatialRequest_disableTimeout()'><img src='"+mod_closePolygonExt_img.src+"'></div>";
-	return str;
-}
-function mod_closePolygonExt_go(){
-	mod_setExtRequest_close();
-}
\ No newline at end of file
+
+var mod_closePolygonExt_img=new Image();mod_closePolygonExt_img.src="../img/button_gray/closePolygon_off.gif";try{register_setExtRequestSubFunctions("mod_closePolygonExt()");}
+catch(e){try{parent.register_setExtRequestSubFunctions("mod_closePolygonExt()");}
+catch(e){alert("exception (mod_closePolygonExt.js): register_setExtRequestSubFunctions not found");}}
+function mod_closePolygonExt(){var str="<div style='position:absolute;top:25px' onmouseup='parent.mod_wfs_spatialRequest_close()' ";str+="onmouseover='parent.mod_wfs_spatialRequest_timeout()' onmouseout='parent.mod_wfs_spatialRequest_disableTimeout()'><img src='"+mod_closePolygonExt_img.src+"'></div>";return str;}
+function mod_closePolygonExt_go(){mod_setExtRequest_close();}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_digitize_tab.php
===================================================================
--- branches/print_dev/http/javascripts/mod_digitize_tab.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_digitize_tab.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -49,8 +49,6 @@
 	buttonDig_y.push(y);
 }
 
-//default definition of image directory for digitize buttons, might
-//be overwritten with digitize conf data
 var buttonDig_imgdir = "../img/button_digitize/";
 var buttonDig_id = [];
 var buttonDig_on = [];
@@ -138,6 +136,8 @@
 }
 
 function mod_digitize_go(e){
+	parent.mb_registerGML(mod_digitize_target,d);   
+
 	// ie workaround
 	if (e == undefined) {
 		e = parent.frames[mod_digitize_target].event;
@@ -942,7 +942,7 @@
 				if (isValidWfsConfIndex(wfsConf, d.get(i).wfs_conf)) {
 					listOfGeom += "\t\t\t<img src = '"+buttonDig_imgdir+buttonDig_removeDb_src+"' title='"+msgObj.buttonDig_removeDb_title+"' onclick=\"var deltrans = confirm('"+msgObj.messageConfirmDeleteGeomFromDb+"');if (deltrans) dbGeom('delete', "+i+")\">\n";
 				}
-				listOfGeom += "\t\t</td>\n\t\t<td class='searchResults'>\n";
+				listOfGeom += "\t\t</td>\n\t\t<td style = 'color:blue;font-size:12px'>\n";
 				listOfGeom += "\t\t\t<div onmouseover='parent.mb_wfs_perform(\"over\",d.get("+i+"));' ";
 				listOfGeom += " onmouseout='parent.mb_wfs_perform(\"out\",d.get("+i+"))' ";
 				listOfGeom += " onclick='parent.mb_wfs_perform(\"click\",d.get("+i+"));' ";
@@ -1288,9 +1288,9 @@
 					}
 					var formElementHtml = featureTypeElement['f_form_element_html']; 
 					if (!formElementHtml || !formElementHtml.match(/<select/)) {
-						str += "\t\t\t\t<input id = 'datatype_mb_digitize_form_" + elementName + "' name='datatype' type='hidden' value = '" + elementType + "'>\n";
-						str += "\t\t\t\t<input id = 'mandatory_mb_digitize_form_" + elementName + "' name='mandatory' type='hidden' value = '" + isMandatory + "'>\n";
-						str += "\t\t\t\t<input id = 'mb_digitize_form_" + elementName + "' name='" + elementLabel + "' type='text' class = '"+featureTypeElement['f_style_id']+"' size=20 value = '" + elementValue + "'>\n";
+						str += "\t\t\t\t<input id = 'datatype_" + elementName + "' name='datatype' type='hidden' value = '" + elementType + "'>\n";
+						str += "\t\t\t\t<input id = 'mandatory_" + elementName + "' name='mandatory' type='hidden' value = '" + isMandatory + "'>\n";
+						str += "\t\t\t\t<input id = '" + elementName + "' name='" + elementLabel + "' type='text' class = '"+featureTypeElement['f_style_id']+"' size=20 value = '" + elementValue + "'>\n";
 					}
 					else {
 							while (formElementHtml.match(/\\/)) {
@@ -1388,8 +1388,7 @@
 				}
 				else if (myform.elements[i].type == 'text' ){
 					if (myform.elements[i].id) {
-						var elementId = String(myform.elements[i].id).replace(/mb_digitize_form_/, "");
-						d.get(m).e.setElement(elementId, myform.elements[i].value);
+						d.get(m).e.setElement(myform.elements[i].id, myform.elements[i].value);
 					}
 					else {
 						errorMessage = msgObj.messageErrorFormEvaluation;
@@ -1398,8 +1397,7 @@
 				// selectbox
 				else if (typeof(myform.elements[i].selectedIndex) == 'number') {
 					if (myform.elements[i].id) {
-						var elementId = String(myform.elements[i].id).replace(/mb_digitize_form_/, "");
-						d.get(m).e.setElement(elementId, myform.elements[i].options[myform.elements[i].selectedIndex].value);
+						d.get(m).e.setElement(myform.elements[i].id, myform.elements[i].options[myform.elements[i].selectedIndex].value);
 					}
 					else {
 						errorMessage = msgObj.messageErrorFormEvaluation;
@@ -1525,4 +1523,4 @@
 		<table cellpadding='0' cellspacing='0' align = center><tr><td><div id='digButtons'></div></td></tr></table>
 		<div id = 'listOfGeometries'></div>
 	</body>
-</html>
+</html>
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_displayObj.js
===================================================================
--- branches/print_dev/http/javascripts/mod_displayObj.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_displayObj.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,156 +1,13 @@
-function mod_displayObj(){
-	var tg = "";
-	tg +="<head>";
-	tg += "<title>Mapbender Info</title>";
-	tg += "<style type='text/css'>";
-	tg +="<!-- body{font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:10pt}";
-	tg +="hr{color:blue;}";
-	tg +="table{border-width:1;font-size:10pt}";
-	tg +="th{background-color:#F08080;text-align:left;}";
-	tg +="tr{background-color:white;}";
-	tg +=".tr_head{font-weight:bold;background-color:silver;}";
-	tg +=".th_wfs{font-weight:bold;background-color:#BDBAF7;text-align:left;}";
-	tg +="--></style></head>";
 
-	var myWin = null;
-	tg += "<body><h3 >Mapbender Metadata</h3>";
-	tg += "<h4 >active maps</h4>";
-
-	for(var i=0; i<mb_mapObj.length; i++){
-		tg += "<h4 >frame: "+ mb_mapObj[i].frameName+"</h4>";
-		tg += "<table border='1' width='98%' rules='rows'><tr>";
-		tg += "<th width='200'>wms:</th><th>request</th></tr>";
-		for(var ii=0; ii<mb_mapObj[i].wms.length; ii++){
-			tg +="<tr><td width='200'>"+mb_mapObj[i].wms[ii].wms_title+"</td><td>";
-			// if the mapURL is not defined or false, don't add a link
-			if (mb_mapObj[i].mapURL[ii] == false || typeof(mb_mapObj[i].mapURL[ii]) == 'undefined' ){
-				tg += mb_mapObj[i].mapURL[ii];
-			}
-			else{
-				tg += "<a href='"+ mb_mapObj[i].mapURL[ii]+"' target='_blank'>"+ mb_mapObj[i].mapURL[ii]+"</a>";
-			}
-			tg +="</td></tr>";
-		}
-		tg += "</table><br>";
-	}
-	tg += "<hr>";
-   
-	for(var j=0; j<mb_mapObj.length; j++){   
-		for(var cnt=0; cnt<mb_mapObj[j].wms.length;cnt++){
-			tg += "<h4 >"+ mb_mapObj[j].frameName+" WMS: "+ cnt+ ": "+mb_mapObj[j].wms[cnt].wms_title+" ("+mb_mapObj[j].wms[cnt].wms_abstract+") </h4>";
-			tg += "<table border='1' rules='rows'><tr>";
-			tg += "<th >WMS nr:</th><th>" + cnt+ "</th></tr>";
-			tg += "<tr><td>wms_id:</td><td>" + mb_mapObj[j].wms[cnt].wms_id + "</td></tr>";
-			tg += "<tr><td>wms_version:</td><td>" + mb_mapObj[j].wms[cnt].wms_version + "</td></tr>";
-			tg += "<tr><td>wms_title: </td><td>" + mb_mapObj[j].wms[cnt].wms_title + "</td></tr>";
-			tg += "<tr><td>wms_abstract:</td><td>" + mb_mapObj[j].wms[cnt].wms_abstract + "</td></tr>";
-			tg += "<tr><td>wms_getmap: </td><td>" + mb_mapObj[j].wms[cnt].wms_getmap + "</td></tr>";
-			tg += "<tr><td>wms_getfeatureinfo: </td><td>" + mb_mapObj[j].wms[cnt].wms_getfeatureinfo + "</td></tr>";
-			tg += "<tr><td>wms_getlegendurl: </td><td>" + mb_mapObj[j].wms[cnt].wms_getlegendurl + "</td></tr>";
-			tg += "<tr><td>gui_wms_mapformat: </td><td>" + mb_mapObj[j].wms[cnt].gui_wms_mapformat + "</td></tr>";
-			tg += "<tr><td>gui_wms_featureinfoformat: </td><td>" + mb_mapObj[j].wms[cnt].gui_wms_featureinfoformat + "</td></tr>";
-			tg += "<tr><td>gui_wms_exceptionformat: </td><td>" + mb_mapObj[j].wms[cnt].gui_wms_exceptionformat + "</td></tr>";
-			tg += "<tr><td>gui_wms_epsg: </td><td>" + mb_mapObj[j].wms[cnt].gui_wms_epsg + "</td></tr>";
-			tg += "<tr><td>gui_wms_visible: </td><td>" + mb_mapObj[j].wms[cnt].gui_wms_visible + "</td></tr>" ;
-            
-	  
-			tg += "<tr class='tr_head'><td>Data: </td><td>.</td></tr>";
-			for(var i=0; i<mb_mapObj[j].wms[cnt].data_type.length; i++){
-				tg += "<tr><td>" + mb_mapObj[j].wms[cnt].data_type[i] + "</td><td>" + mb_mapObj[j].wms[cnt].data_format[i] + "</td></tr>" ;
-			}
-			for(var i=0; i<mb_mapObj[j].wms[cnt].gui_epsg.length; i++){
-				tg += "<tr class='tr_head'><td>epsg : </td><td>" + mb_mapObj[j].wms[cnt].gui_epsg[i] + "</td></tr>" ;
-				tg += "<tr><td>minx : </td><td>" + mb_mapObj[j].wms[cnt].gui_minx[i] + "</td></tr>" ;
-				tg += "<tr><td>miny : </td><td>" + mb_mapObj[j].wms[cnt].gui_miny[i] + "</td></tr>" ;
-				tg += "<tr><td>maxx : </td><td>" + mb_mapObj[j].wms[cnt].gui_maxx[i] + "</td></tr>" ;
-				tg += "<tr><td>maxy : </td><td>" + mb_mapObj[j].wms[cnt].gui_maxy[i]+"</td></tr>" ;
-			}
-	     
-			tg += "</table><br>";
-	     
-			tg += "<table border='1' rules='rows'><tr class='tr_head'>";
-			tg += "<td>layer_id</td>";
-			tg += "<td>layer_uid</td>";
-			tg += "<td>layer_pos</td>";
-			tg += "<td>layer_parent</td>";
-			tg += "<td>layer_name</td>";
-			tg += "<td>layer_title</td>";
-			tg += "<td>layer_dataurl</td>";
-			tg += "<td>layer_queryable</td>";
-			tg += "<td>layer_minscale</td>";
-			tg += "<td>layer_maxscale</td>";
-			tg += "<td>gui_layer_wms_id</td>";
-			tg += "<td>gui_layer_status</td>";
-			tg += "<td>gui_layer_selectable</td>";
-			tg += "<td>gui_layer_visible</td>";
-			tg += "<td>gui_layer_queryable</td>";
-			tg += "<td>gui_layer_querylayer</td>";
-			tg += "<td>gui_layer_minscale</td>";
-			tg += "<td>gui_layer_maxscale</td>";
-			tg += "<td>gui_layer_wfs_featuretype</td>";
-			tg += "</tr>";
-	          
-			for(var i=0; i<mb_mapObj[j].wms[cnt].objLayer.length; i++){
-				tg += "<tr>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_id + "</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_uid + "</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_pos + "</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_parent+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_name+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_title+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_dataurl_href+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_queryable+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_minscale+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_maxscale+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_wms_id+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_status+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_selectable+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_visible+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_queryable+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_querylayer+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_minscale+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_maxscale+"</td>";
-				tg += "<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_wfs_featuretype+"</td>";
-				tg += "</tr>";
-			}
-			tg += "</table><br><br>";
-		}
-		tg += "<hr>";
-	}
-
-	if(wfs){
-		for(var cnt=0; cnt<wfs.length;cnt++){
-			tg += "<br><h4 style='font-color:blue'>WFS: "+ cnt+ ": "+wfs[cnt].wfs_title+" ("+wfs[cnt].wfs_abstract+") </h4>";
-			tg+="<table border='1' rules='rows'><tr>";
-    
-			tg += "<th class='th_wfs' width='200'>WFS nr: </th><th class='th_wfs'>" + cnt+ "</th></tr>";
-			tg += "<tr><td>wfs_id:</td><td> " + wfs[cnt].wfs_id + "</td></tr>";
-			tg += "<tr><td>wfs_version: </td><td>" + wfs[cnt].wfs_version + "</td></tr>";
-			tg += "<tr><td>wfs_title: </td><td>" + wfs[cnt].wfs_title + "</td></tr>";
-			tg += "<tr><td>wfs_abstract:</td><td>" + wfs[cnt].wfs_abstract + "</td></tr>";
-			tg += "<tr><td>wfs_getcapabilities: </td><td><a href='"+ wfs[cnt].wfs_getcapabilities + "&VERSION=1.0.0&request=getcapabilities' target='_blank'>" + wfs[cnt].wfs_getcapabilities + "</a></td></tr>";
-			tg += "<tr><td>wfs_describefeaturetype:</td><td>" + wfs[cnt].wfs_describefeaturetype +  "</td></tr>";
-
-			tg += "</table><br>";
-     
-			tg += "<table border='1' rules='rows' ><tr class='tr_head'>";
-			tg += "<td width='200'>wfs_featuretype</td>";
-			tg += "<td>featuretype_name</td></tr>";
-         
-			for(var i=0; i<wfs[cnt].wfs_featuretype.length; i++){
-				tg += "<tr><td>"+i+"</td>";
-				tg += "<td>" + wfs[cnt].wfs_featuretype[i].featuretype_name + "</td>";
-				tg += "<tr>";
-			}
-			tg += "</table><br>";
-		}
-
-	}
-	//
-	tg += "<BR></body>";
-	myWin = window.open("","myWin","");
-	myWin.document.open("text/html");
-	myWin.document.write(tg);
-	myWin.document.close();
-	myWin.focus();  
-}
\ No newline at end of file
+function mod_displayObj(){var tg="";tg+="<head>";tg+="<title>Mapbender Info</title>";tg+="<style type='text/css'>";tg+="<!-- body{font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:10pt}";tg+="hr{color:blue;}";tg+="table{border-width:1;font-size:10pt}";tg+="th{background-color:#F08080;text-align:left;}";tg+="tr{background-color:white;}";tg+=".tr_head{font-weight:bold;background-color:silver;}";tg+=".th_wfs{font-weight:bold;background-color:#BDBAF7;text-align:left;}";tg+="--></style></head>";var myWin=null;tg+="<body><h3 >Mapbender Metadata</h3>";tg+="<h4 >active maps</h4>";for(var i=0;i<mb_mapObj.length;i++){tg+="<h4 >frame: "+mb_mapObj[i].frameName+"</h4>";tg+="<table border='1' width='98%' rules='rows'><tr>";tg+="<th width='200'>wms:</th><th>request</th></tr>";for(var ii=0;ii<mb_mapObj[i].wms.length;ii++){tg+="<tr><td width='200'>"+mb_mapObj[i].wms[ii].wms_title+"</td><td>";if(mb_mapObj[i].mapURL[ii]==false||typeof(mb_mapObj[i].mapURL[ii])=='undefined'){tg+=mb_mapObj[i].mapURL[ii];}
+else{tg+="<a href='"+mb_mapObj[i].mapURL[ii]+"' target='_blank'>"+mb_mapObj[i].mapURL[ii]+"</a>";}
+tg+="</td></tr>";}
+tg+="</table><br>";}
+tg+="<hr>";for(var j=0;j<mb_mapObj.length;j++){for(var cnt=0;cnt<mb_mapObj[j].wms.length;cnt++){tg+="<h4 >"+mb_mapObj[j].frameName+" WMS: "+cnt+": "+mb_mapObj[j].wms[cnt].wms_title+" ("+mb_mapObj[j].wms[cnt].wms_abstract+") </h4>";tg+="<table border='1' rules='rows'><tr>";tg+="<th >WMS nr:</th><th>"+cnt+"</th></tr>";tg+="<tr><td>wms_id:</td><td>"+mb_mapObj[j].wms[cnt].wms_id+"</td></tr>";tg+="<tr><td>wms_version:</td><td>"+mb_mapObj[j].wms[cnt].wms_version+"</td></tr>";tg+="<tr><td>wms_title: </td><td>"+mb_mapObj[j].wms[cnt].wms_title+"</td></tr>";tg+="<tr><td>wms_abstract:</td><td>"+mb_mapObj[j].wms[cnt].wms_abstract+"</td></tr>";tg+="<tr><td>wms_getmap: </td><td>"+mb_mapObj[j].wms[cnt].wms_getmap+"</td></tr>";tg+="<tr><td>wms_getfeatureinfo: </td><td>"+mb_mapObj[j].wms[cnt].wms_getfeatureinfo+"</td></tr>";tg+="<tr><td>wms_getlegendurl: </td><td>"+mb_mapObj[j].wms[cnt].wms_getlegendurl+"</td></tr>";tg+="<tr><td>gui_wms_mapformat: </td><td>"+mb_mapObj[j].wms[cnt].gui_wms_mapformat+"</td></tr>";tg+="<tr><td>gui_wms_featureinfoformat: </td><td>"+mb_mapObj[j].wms[cnt].gui_wms_featureinfoformat+"</td></tr>";tg+="<tr><td>gui_wms_exceptionformat: </td><td>"+mb_mapObj[j].wms[cnt].gui_wms_exceptionformat+"</td></tr>";tg+="<tr><td>gui_wms_epsg: </td><td>"+mb_mapObj[j].wms[cnt].gui_wms_epsg+"</td></tr>";tg+="<tr><td>gui_wms_visible: </td><td>"+mb_mapObj[j].wms[cnt].gui_wms_visible+"</td></tr>";tg+="<tr class='tr_head'><td>Data: </td><td>.</td></tr>";for(var i=0;i<mb_mapObj[j].wms[cnt].data_type.length;i++){tg+="<tr><td>"+mb_mapObj[j].wms[cnt].data_type[i]+"</td><td>"+mb_mapObj[j].wms[cnt].data_format[i]+"</td></tr>";}
+for(var i=0;i<mb_mapObj[j].wms[cnt].gui_epsg.length;i++){tg+="<tr class='tr_head'><td>epsg : </td><td>"+mb_mapObj[j].wms[cnt].gui_epsg[i]+"</td></tr>";tg+="<tr><td>minx : </td><td>"+mb_mapObj[j].wms[cnt].gui_minx[i]+"</td></tr>";tg+="<tr><td>miny : </td><td>"+mb_mapObj[j].wms[cnt].gui_miny[i]+"</td></tr>";tg+="<tr><td>maxx : </td><td>"+mb_mapObj[j].wms[cnt].gui_maxx[i]+"</td></tr>";tg+="<tr><td>maxy : </td><td>"+mb_mapObj[j].wms[cnt].gui_maxy[i]+"</td></tr>";}
+tg+="</table><br>";tg+="<table border='1' rules='rows'><tr class='tr_head'>";tg+="<td>layer_id</td>";tg+="<td>layer_uid</td>";tg+="<td>layer_pos</td>";tg+="<td>layer_parent</td>";tg+="<td>layer_name</td>";tg+="<td>layer_title</td>";tg+="<td>layer_dataurl</td>";tg+="<td>layer_queryable</td>";tg+="<td>layer_minscale</td>";tg+="<td>layer_maxscale</td>";tg+="<td>gui_layer_wms_id</td>";tg+="<td>gui_layer_status</td>";tg+="<td>gui_layer_selectable</td>";tg+="<td>gui_layer_visible</td>";tg+="<td>gui_layer_queryable</td>";tg+="<td>gui_layer_querylayer</td>";tg+="<td>gui_layer_minscale</td>";tg+="<td>gui_layer_maxscale</td>";tg+="<td>gui_layer_wfs_featuretype</td>";tg+="</tr>";for(var i=0;i<mb_mapObj[j].wms[cnt].objLayer.length;i++){tg+="<tr>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_id+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_uid+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_pos+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_parent+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_name+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_title+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_dataurl_href+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_queryable+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_minscale+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].layer_maxscale+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_wms_id+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_status+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_selectable+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_visible+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_queryable+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_querylayer+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_minscale+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_maxscale+"</td>";tg+="<td>"+mb_mapObj[j].wms[cnt].objLayer[i].gui_layer_wfs_featuretype+"</td>";tg+="</tr>";}
+tg+="</table><br><br>";}
+tg+="<hr>";}
+if(wfs){for(var cnt=0;cnt<wfs.length;cnt++){tg+="<br><h4 style='font-color:blue'>WFS: "+cnt+": "+wfs[cnt].wfs_title+" ("+wfs[cnt].wfs_abstract+") </h4>";tg+="<table border='1' rules='rows'><tr>";tg+="<th class='th_wfs' width='200'>WFS nr: </th><th class='th_wfs'>"+cnt+"</th></tr>";tg+="<tr><td>wfs_id:</td><td> "+wfs[cnt].wfs_id+"</td></tr>";tg+="<tr><td>wfs_version: </td><td>"+wfs[cnt].wfs_version+"</td></tr>";tg+="<tr><td>wfs_title: </td><td>"+wfs[cnt].wfs_title+"</td></tr>";tg+="<tr><td>wfs_abstract:</td><td>"+wfs[cnt].wfs_abstract+"</td></tr>";tg+="<tr><td>wfs_getcapabilities: </td><td><a href='"+wfs[cnt].wfs_getcapabilities+"&VERSION=1.0.0&request=getcapabilities' target='_blank'>"+wfs[cnt].wfs_getcapabilities+"</a></td></tr>";tg+="<tr><td>wfs_describefeaturetype:</td><td>"+wfs[cnt].wfs_describefeaturetype+"</td></tr>";tg+="</table><br>";tg+="<table border='1' rules='rows' ><tr class='tr_head'>";tg+="<td width='200'>wfs_featuretype</td>";tg+="<td>featuretype_name</td></tr>";for(var i=0;i<wfs[cnt].wfs_featuretype.length;i++){tg+="<tr><td>"+i+"</td>";tg+="<td>"+wfs[cnt].wfs_featuretype[i].featuretype_name+"</td>";tg+="<tr>";}
+tg+="</table><br>";}}
+tg+="<BR></body>";myWin=window.open("","myWin","");myWin.document.open("text/html");myWin.document.write(tg);myWin.document.close();myWin.focus();}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_displayWmc.php
===================================================================
--- branches/print_dev/http/javascripts/mod_displayWmc.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_displayWmc.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -22,9 +22,9 @@
 $wmc_id = $_GET["wmc_id"];
 
 if ($wmc_id){
-	require_once(dirname(__FILE__)."/../classes/class_wmc.php");
-	$wmc = new wmc();
-	$wmc_gml = $wmc->getDocument($wmc_id);
+	require_once(dirname(__FILE__)."/../classes/class_administration.php");
+	$admin = new administration();
+	$wmc_gml = $admin->getWmcById($wmc_id);
 
 	if ($wmc_gml){
 		//Display WMC

Modified: branches/print_dev/http/javascripts/mod_dragMapSize.php
===================================================================
--- branches/print_dev/http/javascripts/mod_dragMapSize.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_dragMapSize.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -58,7 +58,7 @@
 		mouseCatcher.style.width = 500;
 		mouseCatcher.style.height = 500;
 		mouseCatcher.style.zIndex = 160;
-		if(top.ie)
+		if($.browser.msie)
 			mouseCatcher.style.background = "url(../img/transparent.gif)"; 
 		mouseCatcher.style.left=clickX-250;
 		mouseCatcher.style.top=clickY-250;

Modified: branches/print_dev/http/javascripts/mod_highlightPOI.php
===================================================================
--- branches/print_dev/http/javascripts/mod_highlightPOI.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_highlightPOI.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -67,14 +67,13 @@
 
 function mod_highlightPOI_init(){
 		var myPOI = "<?php if (CHARSET == 'UTF-8'){
-				echo utf8_encode($_SESSION['mb_myPOI']);
+				echo preg_replace("/\n/", "<br>", $_SESSION['mb_myPOI']);
 			}else{
-				echo $_SESSION['mb_myPOI'];
+				echo preg_replace("/\n/", "<br>", utf8_decode($_SESSION['mb_myPOI']));
 			} 
 			?>";
-
 	if(myPOI != ""){
- 		mod_highlightPOI_params = myPOI.split(",");
+ 		mod_highlightPOI_params = myPOI.split("|");
 
 	  
   

Modified: branches/print_dev/http/javascripts/mod_horizTabs.js
===================================================================
--- branches/print_dev/http/javascripts/mod_horizTabs.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_horizTabs.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,90 +1,8 @@
-/* 
-* $Id:$
-* COPYRIGHT: (C) 2001 by ccgis. This program is free software under the GNU General Public
-* License (>=v2). Read the file gpl.txt that comes with Mapbender for details. 
-*/
-(function($){
 
-/**
- * turns a div tag into a tab control
- * @return jQuery
- */
-	$.fn.tabControl = function(options){
-		defaults = {tab:true};
-		return this.each(function(){
-			this._tabSettings = $.extend(defaults, options)
-			this.tabs = [];
-			this.activeTab = false;
-			//append div for tab buttons
-			$(this).append("<div />")
-		});
-	};
-	
-/**
- * adds a tab to a tab control
- * @return jQuery
- */
-	$.fn.addTab = function(options){
-		return this.each(function(){
-			//ensure function is called on a tabControl
-			if(!this._tabSettings)
-				return;
-				
-			//Add tab
-			this.tabs.push(options);
-
-			//add access button	for this tab and update height
-			this.tab_height = parseInt($("div",this)
-				.append("<span class=\"tabButton\" id=\"tabButton_"+options.id+"\">"+options.title+"</span> ")
-				.height());
-			 //bind click event to activate the tab
-			 $("#tabButton_"+options.id,this)
-			 	.bind("click",{i:this.tabs.length-1},function(event){
-					$(this.parentNode.parentNode).activateTab(event.data.i);
-				});
-
-			//set element to right position
-			$("#"+options.id).css({position:"absolute",
-				left:parseInt(this.style.left),
-				top:parseInt(this.style.top)+this.tab_height,
-				width:$(this).width(),
-				height:$(this).height()-this.tab_height,
-				zIndex:parseInt(this.style.zIndex+1)})
-			//and hide it
-			.hide();
-		});
-	}
-	
-/**
- * activate tab i of the tab control
- * @param integer i number of tab to activate (0 to number of tabs -1)
- * @return jQuery
- */
-	$.fn.activateTab = function(i){
-		return this.each(function(){
-			//ensure function is called on a tabControl
-			if(!this._tabSettings)
-				return;	
-
-			//hide old tab
-			if(this.activeTab!==false){
-				$("#"+this.tabs[this.activeTab].id).hide();
-				$("#tabButton_"+this.tabs[this.activeTab].id).removeClass("tabButtonActive").addClass("tabButton");
-			}
-
-			//move tab to right position
-			$("#"+this.tabs[i].id).css({position:"absolute",
-					left:parseInt(this.style.left),
-					top:parseInt(this.style.top)+this.tab_height,width:$(this).width(),
-					height:$(this).height()-this.tab_height,zIndex:parseInt(this.style.zIndex+1)})
-			//and show it
-			.show();
-			
-			//update button state
-			$("#tabButton_"+this.tabs[i].id).removeClass("tabButton").addClass("tabButtonActive");
-			this.activeTab=i;
-		});
-	}
-})
-(jQuery);
-
+(function($){$.fn.tabControl=function(options){defaults={tab:true};return this.each(function(){this._tabSettings=$.extend(defaults,options)
+this.tabs=[];this.activeTab=false;$(this).append("<div />")});};$.fn.addTab=function(options){return this.each(function(){if(!this._tabSettings)
+return;this.tabs.push(options);this.tab_height=parseInt($("div",this).append("<span class=\"tabButton\" id=\"tabButton_"+options.id+"\">"+options.title+"</span> ").height());$("#tabButton_"+options.id,this).bind("click",{i:this.tabs.length-1},function(event){$(this.parentNode.parentNode).activateTab(event.data.i);});$("#"+options.id).css({position:"absolute",left:parseInt(this.style.left),top:parseInt(this.style.top)+this.tab_height,width:$(this).width(),height:$(this).height()-this.tab_height,zIndex:parseInt(this.style.zIndex+1)}).hide();});}
+$.fn.activateTab=function(i){return this.each(function(){if(!this._tabSettings)
+return;if(this.activeTab!==false){$("#"+this.tabs[this.activeTab].id).hide();$("#tabButton_"+this.tabs[this.activeTab].id).removeClass("tabButtonActive").addClass("tabButton");}
+$("#"+this.tabs[i].id).css({position:"absolute",left:parseInt(this.style.left),top:parseInt(this.style.top)+this.tab_height,width:$(this).width(),height:$(this).height()-this.tab_height,zIndex:parseInt(this.style.zIndex+1)}).show();$("#tabButton_"+this.tabs[i].id).removeClass("tabButton").addClass("tabButtonActive");this.activeTab=i;});}})
+(jQuery);
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_initWmc.php
===================================================================
--- branches/print_dev/http/javascripts/mod_initWmc.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_initWmc.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -68,7 +68,7 @@
 			echo "var wmc_id = false;";
 			echo "wmc_id = '".$wmc_id."';";
 			$wmc = new wmc();
-			$wmc->createFromDb($wmc_id);
+			$wmc->createObjFromWMC_id($wmc_id);
 			$js_wmc .= $wmc->createJsObjFromWMC("", $e_target[0], $action);
 			
 			if (!empty($x) && !empty($y) && !empty($icon)) {

Modified: branches/print_dev/http/javascripts/mod_loadwmc.php
===================================================================
--- branches/print_dev/http/javascripts/mod_loadwmc.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_loadwmc.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -22,77 +22,77 @@
 
 include(dirname(__FILE__) . "/../include/dyn_js.php");
 
-function createJs ($mergeWms) {
-	$jsString = "";
-	$wmc = new wmc();
-	if (!isset($_SESSION['mb_wmc'])) {
-		$e = new mb_notice("wmc not set, generating from app: " . $_SESSION["mb_user_gui"]);
-		$wmc->createFromApplication($_SESSION["mb_user_gui"]);		
-		$_SESSION["mb_wmc"] = $wmc->toXml();
-		$e = new mb_exception("initial WMC: " . $_SESSION["mb_wmc"]);
+echo "mod_loadwmc_target = '".$e_target[0]."';";
+
+/*
+// this may be added at a later stage
+if ($new_wmc == 1) {
+	include(dirname(__FILE__) . "/../generate_defaultWmc.php");
+	$startup = true;
+	$e = new mb_notice("loadwmc: new wmc");
+}
+else {
+	$startup = false;
+	$e = new mb_notice("loadwmc: old wmc");
+}
+if ($gui_changed == 0) {
+	if ($_REQUEST['portal_services']) {
+		$e = new mb_notice("loadwmc: merging layers");
+		include(dirname(__FILE__) . "/../merge_layers.php");
 	}
-
-	if (isset($_SESSION['mb_wmc'])) {
-		$e = new mb_notice("merging with WMC.");
-
-		if ($wmc->createFromXml($_SESSION['mb_wmc'])) {
-	
-			if ($mergeWms) {
-				$wmsArray = array();
-				for ($i = 0; $i < count($_SESSION["wms"]); $i++) {
-					$currentWms = new wms();
-					$currentWms->createObjFromXML($_SESSION["wms"][$i]);
-					array_push($wmsArray, $currentWms);
+	if ($_SESSION['GML']) {
+		$e = new mb_notice("loadwmc: merging bbox");
+		include(dirname(__FILE__) . "/../merge_bbox.php");
+	}
+}
+*/
+?>
+function load_wmc_session() {
+	<?php
+		if (isset($_SESSION['mb_wmc'])) {
+			$wmc = new wmc();
+			if ($wmc->createObjFromWMC_xml($_SESSION['mb_wmc'])) {
+				$js = "";
+				if ($_SESSION['layer_preview']) {
+//					echo "var e = new Mb_notice('mod_loadwmc: load_wmc_session: layer preview');";
+					$js = $wmc->createJsObjFromWMC("", $e_target, "load");
 				}
-				$wmc->mergeWmsArray($wmsArray);
-				$_SESSION["command"] = "";
-				$_SESSION["wms"] = array();
+				else if ($startup == true) {
+//					echo "var e = new Mb_notice('mod_loadwmc: load_wmc_session: load new wmc');";
+					$js = $wmc->createJsObjFromWMC("", $e_target, "merge");
+					$startup = false;
+				}		
+				else {
+//					echo "var e = new Mb_notice('mod_loadwmc: load_wmc_session: load old wmc');";
+					$js = $wmc->createJsObjFromWMC("", $e_target, "load");
+				}
+				echo $js;
 			}
-	
-			$javaScriptArray = array();
-			$javaScriptArray = $wmc->toJavaScript();
-
-			$jsString .= implode("", $javaScriptArray);
+			else {
+				echo "var e = new Mb_notice('mod_loadwmc: load_wmc_session: error parsing wmc');";
+			}
 		}
 		else {
-			$jsString .= "var e = new Mb_notice('mod_loadwmc: load_wmc_session: error parsing wmc');";
+			echo "var e = new Mb_warning('mod_loadwmc: load_wmc_session: no wmc set!');";
 		}
-	}
-	else {
-		$e = new mb_notice("not merging WMC");
-		$jsString .= "var e = new Mb_warning('mod_loadwmc: load_wmc_session: no wmc set!');";
-	}
-	return $jsString;
+	?>
 }
 
-//
-// Creates the function load_wmc_session.
-// This function loads a WMC from the session, if the element var
-// "loadFromSession" is set to true.
-//
-?>
-function load_wmc_session() {
-<?php
-if ($_SESSION["command"] && $_SESSION["command"] == "ADDWMS") {
-	$e = new mb_notice("merging with WMS in Session...");
-	echo createJs(true);
+try {if (loadFromSession) {}}catch(e) {loadFromSession = 0;}
+
+if (loadFromSession) {
+	mb_registerInitFunctions('load_wmc_session()');
 }
-else {
-	$e = new mb_notice("NOT merging with WMS in Session...");
-	echo createJs(false);
+
+var mod_loadwmc_img = new Image(); mod_loadwmc_img.src = "<?php echo $e_src; ?>";
+//var mod_loadwmc_img_over = new Image(); mod_loadwmc_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
+
+function mod_importWmc(id){
+	alert(id);
 }
-?>
+function mod_loadwmc(obj){
+	windowWmc = window.open("../php/mb_listWMCs.php?<?php echo SID;?>","displayWmc","width=500, height=600, scrollbars=yes, dependent=yes");
 }
-
-<?php 
-if ($e_src) {
-	sprintf("var mod_loadwmc_img = new Image(); 
-			mod_loadwmc_img.src = '%s'", $e_src);
-	
-}
-
-//
-// Creates a pop up with a dialogue to load, view or delete WMC documents
-//
-include("mod_loadwmc.js");
-?>
\ No newline at end of file
+function mod_loadwmc_init(obj){
+	//document.getElementById("loadwmc").src = mod_zoom1_img_over.src;
+}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_pan.php
===================================================================
--- branches/print_dev/http/javascripts/mod_pan.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_pan.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -28,9 +28,6 @@
 var mod_pan_img_off = new Image(); mod_pan_img_off.src = "<?php  echo $e_src;  ?>";
 var mod_pan_img_over = new Image(); mod_pan_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
 
-
-var mb_panActive = false;
-
 function init_mod_pan(ind){
 	mb_button[ind] = document.getElementById(mod_pan_elName);
 	mb_button[ind].img_over = mod_pan_img_over.src;
@@ -43,18 +40,12 @@
 	mb_button[ind].stop = new Function ("mod_pan_disable()");
 }
 function mod_pan_click(){   
-	var p = window.frames[mod_pan_target].document.getElementById("maps");
-	p.style.cursor = "pointer";
-	
 	var el = window.frames[mod_pan_target].document; 
 	el.onmousedown = mod_pan_start;
 	el.onmouseup = mod_pan_stop;
 	el.onmousemove = mod_pan_run;
 }
 function mod_pan_disable(){
-	var p = window.frames[mod_pan_target].document.getElementById("maps");
-	p.style.cursor = "";
-	
 	var el = window.frames[mod_pan_target].document; 
 	el.onmousedown = null;
 	el.onmouseup = null;

Modified: branches/print_dev/http/javascripts/mod_perimeter.php
===================================================================
--- branches/print_dev/http/javascripts/mod_perimeter.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_perimeter.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -36,40 +36,6 @@
 var mod_perimeter_status = 0;
 var mod_perimeter_img_obj = null;
 
-function mb_checkTag(frameName, tagName, elementId, appendAtTagName, attributes){
-	var oldElement;
-	var newElement;
-	var prefix;
-	if(frameName && frameName !== ""){
-		prefix = window.frames[frameName].document;
-	}
-	else if(!frameName || frameName === ""){
-		prefix = document;
-	}
-	oldElement = prefix.getElementById(elementId);
-	if (oldElement === null) {
-		newElement = prefix.createElement(tagName);
-		newElement = prefix.getElementsByTagName(appendAtTagName)[0].appendChild(newElement);
-	}
-	else {
-		if (oldElement.nodeName.toLowerCase() == tagName.toLowerCase()) {
-			for (var i=0; i<attributes.length; i++) {
-				oldElement.setAttribute(attributes[i][0], attributes[i][1]);
-			}
-			return oldElement;
-		}
-		else {
-			return false;
-		}
-	}
-	var newElementAttributeNode = document.createAttribute("id");
-	newElementAttributeNode.value = elementId;
-	newElement.setAttributeNode(newElementAttributeNode);
-	for (var i=0; i<attributes.length; i++) {
-		newElement.setAttribute(attributes[i][0], attributes[i][1]);
-	}
-	return newElement;
-}
 function mod_perimeter_checkDefaults(){
 	try{var t = mod_perimeter_thickness;}catch(e){mod_perimeter_thickness = 2;}
 	try{var t = mod_perimeter_color;}catch(e){mod_perimeter_color = '#000000';}

Modified: branches/print_dev/http/javascripts/mod_permanentHighlight.js
===================================================================
--- branches/print_dev/http/javascripts/mod_permanentHighlight.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_permanentHighlight.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,28 +1,3 @@
-var mod_permanentHighlight_target = "mapframe1";
-var mod_permanentHighlight_x = false;
-var mod_permanentHighlight_y = false;
-var mod_permanentHighlight_text = false;
 
-mb_registerSubFunctions("mod_permanentHighlight_init()");
-mb_registerPanSubElement("permanent");
-
-function mod_permanentHighlight_init(){
-	if(mod_permanentHighlight_x && mod_permanentHighlight_y){
-		mb_permanentHighlight("mapframe1",parseFloat(mod_permanentHighlight_x),parseFloat(mod_permanentHighlight_y));
-	}
-}
-function mb_permanentHighlight(frameName,x,y){
-	var pos = makeRealWorld2mapPos(frameName,x, y);
-	window.frames[frameName].document.getElementById('permanent').style.visibility = 'visible';
-	//3373790 / 5938930
-	if (mod_permanentHighlight_text){
-		var tagSource = "";
-	    tagSource += "<div style='z-index:4;position:absolute;left:"+(pos[0]-7)+"px;top:"+(pos[1]-7)+"px'>";
-	    tagSource += "<img src='../img/redball.gif'>";
-	    tagSource += "<span style='position:absolute;top:+12px;left:+12px;z-index:20;visibility:visible;background-color:white;color:red;font-family:Arial;'><nobr>";
-	    tagSource += mod_permanentHighlight_text +"</nobr><span></div>";
-	    writeTag(frameName, "permanent", tagSource);
-	}else{
-		mb_arrangeElement(frameName,"permanent",pos[0]-7, pos[1]-7);
-	}
-}
+var mod_permanentHighlight_target="mapframe1";var mod_permanentHighlight_x=false;var mod_permanentHighlight_y=false;var mod_permanentHighlight_text=false;mb_registerSubFunctions("mod_permanentHighlight_init()");mb_registerPanSubElement("permanent");function mod_permanentHighlight_init(){if(mod_permanentHighlight_x&&mod_permanentHighlight_y){mb_permanentHighlight("mapframe1",parseFloat(mod_permanentHighlight_x),parseFloat(mod_permanentHighlight_y));}}
+function mb_permanentHighlight(frameName,x,y){var pos=makeRealWorld2mapPos(frameName,x,y);window.frames[frameName].document.getElementById('permanent').style.visibility='visible';if(mod_permanentHighlight_text){var tagSource="";tagSource+="<div style='z-index:4;position:absolute;left:"+(pos[0]-7)+"px;top:"+(pos[1]-7)+"px'>";tagSource+="<img src='../img/redball.gif'>";tagSource+="<span style='position:absolute;top:+12px;left:+12px;z-index:20;visibility:visible;background-color:white;color:red;font-family:Arial;'><nobr>";tagSource+=mod_permanentHighlight_text+"</nobr><span></div>";writeTag(frameName,"permanent",tagSource);}else{mb_arrangeElement(frameName,"permanent",pos[0]-7,pos[1]-7);}}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_rubber.js
===================================================================
--- branches/print_dev/http/javascripts/mod_rubber.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_rubber.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,14 +1,3 @@
-//$Id$
-//$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_rubber.js,v 1.4 2005/09/13 14:38:11 bjoern_heuser Exp $
-var mod_rubber_img = new Image();
-mod_rubber_img.src = "../img/button_gray/rubber_off.gif";
-mod_rubber_img.title = "gemessene Strecke l&ouml;schen";
-register_measureSubFunctions("mod_rubber()");
-
-function mod_rubber(){
-   var str =  "<div onmouseup='parent.mod_rubber_go()' onmouseover='parent.mod_measure_timeout()' onmouseout='parent.mod_measure_go()'><img src='"+mod_rubber_img.src+"' title='"+mod_rubber_img.title+"'></div>";
-   return str;
-}
-function mod_rubber_go(){
-   mod_measure_delete();
-}
\ No newline at end of file
+
+var mod_rubber_img=new Image();mod_rubber_img.src="../img/button_gray/rubber_off.gif";mod_rubber_img.title="gemessene Strecke l&ouml;schen";register_measureSubFunctions("mod_rubber()");function mod_rubber(){var str="<div onmouseup='parent.mod_rubber_go()' onmouseover='parent.mod_measure_timeout()' onmouseout='parent.mod_measure_go()'><img src='"+mod_rubber_img.src+"' title='"+mod_rubber_img.title+"'></div>";return str;}
+function mod_rubber_go(){mod_measure_delete();}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_rubberExt.js
===================================================================
--- branches/print_dev/http/javascripts/mod_rubberExt.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_rubberExt.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,8 +1,2 @@
-var mod_rubberExt_img = new Image();
-mod_rubberExt_img.src = "../img/button_gray/rubber_off.gif";
-register_setExtRequestSubFunctions("mod_rubberExt()");
 
-function mod_rubberExt(){
-	var str =  "<div onmouseup='parent.mod_wfs_spatialRequest_delete()' onmouseover='parent.mod_wfs_spatialRequest_timeout()' onmouseout=\"parent.mod_wfs_spatialRequest_digitize_go('polygon')\"><img src='"+mod_rubberExt_img.src+"'></div>";
-	return str;
-}
+var mod_rubberExt_img=new Image();mod_rubberExt_img.src="../img/button_gray/rubber_off.gif";register_setExtRequestSubFunctions("mod_rubberExt()");function mod_rubberExt(){var str="<div onmouseup='parent.mod_wfs_spatialRequest_delete()' onmouseover='parent.mod_wfs_spatialRequest_timeout()' onmouseout=\"parent.mod_wfs_spatialRequest_digitize_go('polygon')\"><img src='"+mod_rubberExt_img.src+"'></div>";return str;}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_sandclock.php
===================================================================
--- branches/print_dev/http/javascripts/mod_sandclock.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_sandclock.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -31,27 +31,17 @@
 var mod_sandclock_img = new Image();
 mod_sandclock_img.src = mod_sandclock_image;
 
-mb_registerSubFunctions("mod_sandclock(true,myMapIds)");
+mb_registerSubFunctions("mod_sandclock(true,myMapId)");
 
-function mod_sandclock(start,myMapIds){
+function mod_sandclock(start,myMapId){
 	var ind = getMapObjIndexByName(mod_sandclock_target);
 	if(start){
 		var temp = "<img src='"+mod_sandclock_img.src+"'>";
 		writeTag(mod_sandclock_target, "sandclock", temp);
 		mb_arrangeElement(mod_sandclock_target, "sandclock", (mb_mapObj[ind].width/2 - 16), (mb_mapObj[ind].height/2 - 16));
 	}
-	aktiv = setTimeout("mod_sandclock('','"+myMapIds+"')",10);
-	var myMapIdArray = myMapIds.split(",");
-	var complete = true;
-	var myMapId;
-	for (var i = 0; i < myMapIdArray.length && complete; i++) {
-		myMapId = myMapIdArray[i];
-		if(window.frames[mod_sandclock_target].document.getElementById(myMapId) && 
-			!window.frames[mod_sandclock_target].document.getElementById(myMapId).complete) {
-			complete = false;
-		}
-	}
-	if (complete) {
+	aktiv = setTimeout("mod_sandclock('','"+myMapId+"')",100);
+	if(window.frames[mod_sandclock_target].document.getElementById(myMapId) && window.frames[mod_sandclock_target].document.getElementById(myMapId).complete){
 		clearTimeout(aktiv);
 		writeTag(mod_sandclock_target, "sandclock", "");
 	} 

Modified: branches/print_dev/http/javascripts/mod_sandclock2.php
===================================================================
--- branches/print_dev/http/javascripts/mod_sandclock2.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_sandclock2.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -29,7 +29,7 @@
 mb_registerSubFunctions("mod_sandclock(true,myMapId)");
 
 
-function mod_sandclock(start){
+function mod_sandclock(start,myMapId){
 	var ind = getMapObjIndexByName(mod_sandclock_target);
 	if(start){  
 		mod_sandclock_count = mod_sandclock_maxWait; 
@@ -44,7 +44,7 @@
 	}
 
 	// check images:
-	aktiv = setTimeout("mod_sandclock(false)",100);
+	aktiv = setTimeout("mod_sandclock('','"+myMapId+"')",100);
 	mod_sandclock_count -= 1000;
 
 	var allMaps = window.frames[mod_sandclock_target].document.getElementsByName("mapimage");

Modified: branches/print_dev/http/javascripts/mod_saveWKT.js
===================================================================
--- branches/print_dev/http/javascripts/mod_saveWKT.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_saveWKT.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,18 +1,4 @@
-var mod_saveWKT_img = new Image();
-var mod_saveWKT_win = null;
-mod_saveWKT_img.src = "../img/button_gray/save.gif";
-register_measureSubFunctions("mod_saveWKT()");
 
-function mod_saveWKT(){
-	var str =  "<div style='position:absolute;top:75px' onmouseup='parent.mod_saveWKT_go()' ";
-	str += "onmouseover='parent.mod_measure_timeout()' onmouseout='parent.mod_measure_go()'><img src='"+mod_saveWKT_img.src+"'></div>";
-	return str;
-}
-function mod_saveWKT_go(){
-	if(mod_saveWKT_win == null || mod_saveWKT_win.closed == true){
-		mod_saveWKT_win =  window.open("../php/mod_saveWKT.php","mod_saveWKT_win","width=400, height=400, resizable=yes, dependent=yes");
-	}
-	else{
-		mod_saveWKT_win.focus();
-	}
-}
\ No newline at end of file
+var mod_saveWKT_img=new Image();var mod_saveWKT_win=null;mod_saveWKT_img.src="../img/button_gray/save.gif";register_measureSubFunctions("mod_saveWKT()");function mod_saveWKT(){var str="<div style='position:absolute;top:75px' onmouseup='parent.mod_saveWKT_go()' ";str+="onmouseover='parent.mod_measure_timeout()' onmouseout='parent.mod_measure_go()'><img src='"+mod_saveWKT_img.src+"'></div>";return str;}
+function mod_saveWKT_go(){if(mod_saveWKT_win==null||mod_saveWKT_win.closed==true){mod_saveWKT_win=window.open("../php/mod_saveWKT.php","mod_saveWKT_win","width=400, height=400, resizable=yes, dependent=yes");}
+else{mod_saveWKT_win.focus();}}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_savewmc.php
===================================================================
--- branches/print_dev/http/javascripts/mod_savewmc.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_savewmc.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -24,9 +24,7 @@
 ?>
 function setOnUnload() {
 	if (ie) {
-		document.getElementsByTagName('body')[0].onunload = function() {
-			var x = new Function ("", "mod_savewmc_session()"); x(); 
-		};
+		document.getElementsByTagName('body')[0].onunload = function() {var x = new Function ("", "mod_savewmc_session()"); x(); };
 	}
 	else {
 		document.getElementsByTagName('body')[0].setAttribute("onUnload", "mod_savewmc_session();");
@@ -39,12 +37,8 @@
 	mb_registerInitFunctions('setOnUnload()');
 }
 
-<?php 
-if ($e_src) {
-	sprintf("var mod_savewmc_img = new Image(); 
-			mod_savewmc_img.src = '%s';", $e_src);
-}
-?>
+var mod_savewmc_img = new Image(); 
+mod_savewmc_img.src = "<?php  echo $e_src;  ?>";
 //var mod_savewmc_img_over = new Image(); mod_savewmc_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
 
 function mod_savewmc_session(){
@@ -70,5 +64,5 @@
 	if (storeInSession) {
 		$.ajaxSetup({async:false}); //TODO: find out why async doesn't work onunload
 	}
-	$.post("../php/mod_savewmc_server.php", {"saveInSession":storeInSession, "generalTitle":generalTitle, "extensionData":extensionDataString, "mapObject":$.toJSON(mb_mapObj)}, callbackFunction);
-}
+	$.post("../php/mod_insertWmcIntoDb.php", {"saveInSession":storeInSession, "generalTitle":generalTitle, "extensionData":extensionDataString, "mapObject":$.toJSON(mb_mapObj[ind])}, callbackFunction);
+}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_switchLocale_noreload.php
===================================================================
--- branches/print_dev/http/javascripts/mod_switchLocale_noreload.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_switchLocale_noreload.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -32,7 +32,7 @@
 	var lang = document.getElementById("language").options[index].value;
 	mb_ajax_post("../php/mod_setLocale.php", {"lang":lang}, function(result, status) {
 		mapbender.locale = result;
-		eventLocalize.trigger();
+		localize();	
 	});
 }
 

Modified: branches/print_dev/http/javascripts/mod_tab.js
===================================================================
--- branches/print_dev/http/javascripts/mod_tab.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_tab.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,496 +1,28 @@
-// check element vars
-try{
-	if (open_tab){
-		open_tab = Number(open_tab);
-
-		if (isNaN(open_tab)) {
-			var e = new Mb_warning("mod_tab.js: tab_init: open_tab must be a number or an empty string.");
-		}
-	}
-}
-catch(e){
-	var z = new Mb_warning("mod_tab.js: tab_init: open_tab is not set.");
-	open_tab = "";
-}
-
-var tabs;
-
-mb_registerInitFunctions('tab_init()');
-
-
-eventLocalize.register(function () {
-	localizeTabs();
-});
-
-eventInit.register(function () {
-	localizeTabs();
-});
-
-function localizeTabs() {
-	mb_ajax_json("../php/mod_tab_messages.php", function(obj, status){
-		tabs.setTitles(obj);
-	});
-}
-
-function tab_init(){
-	var obj = document.getElementById("tabs").style;
-
-	// generate a new tab array
-	tabs = new VerticalTabArray(tab_style);
-
-	// add the tabs from element vars
-	for (var i = 0; i < tab_ids.length; i++){
-		tabs.addTab(tab_ids[i], tab_prefix + tab_titles[i], tab_frameHeight[i]);
-	}
-
-	if (open_tab !== "") {
-		tabs.openTab(tabs.get(open_tab).module);
-	}
-}
-
-function tab_open(elementName) {
-  // show the desired tab
-	tabs.openTab(elementName);
-}
-
-/**
- * @class A single vertical tab
- * 
- * @constructor
- * @param {String} id the ID of the GUI element that will be displayed within the tab
- * @param {String} title the header of the tab
- * @param {Integer} frameHeight the height of the frame containing the GUI element
- * @param {Integer} tabWidth the width of a tab (NOT the frame)
- * @param {Integer} tabHeight the height of a tab (NOT the frame)
- * @param {String} tabStyle A string with a CSS (example: position:absolute;visibility:visible;border: 1px solid white;font-size:12;color:#343434;background-color:#CFD2D4;cursor:pointer;)
- * @param {Integer} number the index of the current tab in a {@link VerticalTabArray}.
- */
-var VerticalTab = function (id, title, frameHeight, tabWidth, tabHeight, tabStyle, number) {
-	
-	/**
-	 * Sets the attributes of the tabs DOM node.
-	 * 
-	 * @private
-	 * @param {String} title the header of the tab
-	 * @param {Integer} frameHeight the height of the frame containing the GUI element
-	 * @param {Integer} tabWidth the width of a tab (NOT the frame)
-	 * @param {Integer} tabHeight the height of a tab (NOT the frame)
-	 * @param {String} tabStyle A string with a CSS (example: position:absolute;visibility:visible;border: 1px solid white;font-size:12;color:#343434;background-color:#CFD2D4;cursor:pointer;)
-	 * @param {Integer} number the index of the current tab in a {@link VerticalTabArray}.
-	 * 
-	 */
-	var setNodeAttributes = function(title, frameHeight, tabWidth, tabHeight, tabStyle, number) {
-	
-		node.id = "tabs_" + that.module;
-		
-		//set css class
-		node.className = "verticalTabs";
-
-		//mandatory style entries
-		node.style.position = "absolute";
-		node.style.width = tabWidth;
-		node.style.height = tabHeight;
-		node.style.top = number * tabHeight;
-		
-		// open or close on click
-		// see http://www.mapbender.org/index.php/Add_events_via_DOM_in_IE_and_FF
-		if (top.ie) {
-		
-		   node.onclick = function() {
-		      tabs.toggleTab(that.module);
-		   };
-		}
-		else {
-			node.onclick = function(){
-				tabs.toggleTab(that.module);
-			};
-		}
-		
-		// tab header
-		node.innerHTML = title;
-	};
-
-	/**
-	 * Returns the DOM node of this tab.
-	 *
-	 * @return the DOM node of this tab.
-	 * @type DOMNode
-	 */
-	this.getNode = function() {
-		return node;
-	};
-	
-	/**
-	 * The ID of the GUI element that will be displayed within the tab.
-	 */
-	this.module = id;
-
-	/**
-	 * The height of the frame containing the GUI element.
-	 */
-	this.height = frameHeight;
-	
-	/**
-	 * While a tab is opened or closed, the value is false.
-	 */
-	this.animationFinished = true;
-
-	/**
-	 * The DOM node of this tab.
-	 *
-	 * @private
-	 */
-	var node = document.createElement("div");
-	var that = this;
-	
-	setNodeAttributes(title, frameHeight, tabWidth, tabHeight, tabStyle, number);
-};
-	
-/**
- * An array of vertical tabs, behaving like an accordion
- *
- * @extends List
- * @param {String} cssString A string with a CSS (example: position:absolute;visibility:visible;border: 1px solid white;font-size:12;color:#343434;background-color:#CFD2D4;cursor:pointer;)
- */	
-var VerticalTabArray = function (cssString) {
-	
-	/**
-	 * Adds a new tab to the Array.
-	 *
-	 * @param {String} id the ID of the GUI element that will be displayed within the tab
-	 * @param {String} title the header of the tab
-	 * @param {Integer} height the height of the frame containing the GUI element
-	 */
-	this.addTab = function(id, title, height) {
-		var tab = new VerticalTab(id, title, height, tabWidth, tabHeight, tabStyle, this.count());
-		this.add(tab);
-
-		document.getElementById(id).style.visibility = 'hidden';
-
-		// append the new tab
-		rootNode.appendChild(this.get(-1).getNode());
-	};
-	
-	/**
-	 * Removes a tab from the Array.
-	 *
-	 * @param {String} id the ID of the GUI element within the tab.
-	 */
-	this.delTab = function(id) {
-		var index = getIndexById(id);
-		
-		if (index !== null) {
-			// delete the DOM node
-			rootNode.removeChild(this.get(index).getNode());
-
-			// delete the tab
-			this.del(index);
-			
-			// move the other tabs (below the removed tab) up
-			for (var i = index; i < this.count(); i++) {
-				var currentNode = this.get(i).getNode();
-				
-				// parseInt removes "px"
-				var currentTop = parseInt(currentNode.style.top, 10);
-				currentNode.style.top = currentTop - tabHeight;
-			}			
-		}
-	};
-		
-	/**
-	 * Opens a tab specified by the module Id.
-	 *
-	 * @param {String} id the ID of the GUI element within the tab.
-	 */
-	this.toggleTab = function(id) {
-		// if no tab is currently opening or closing
-		if (isAnimationFinished()) {
-			for (var i=0; i < this.count(); i++) {
-				hideFrame(this.get(i).module);
-			}
-			// if the opened tab is the active tab, close it
-			if (id === activeTabId) {
-				closeTab(activeTabId);
-			}
-			//otherwise
-			else {
-				// show the desired tab
-		  	activeTabId = id;
-				startAnimation("open");
-			}
-		}
-		else {
-			var e = new Mb_warning("mod_tab.js: could not activate tab, opening or closing in progress!");
-		}
-	};
-	
-	/**
-	 * Sets the titles of each single tab after l10n
-	 * 
-	 * @param {Object} obj an array containing objects with id and title
-	 */
-	this.setTitles = function (obj) {
-		for (var i = 0; i < this.count(); i++) {
-			for(var j=0; j<obj.length; j++){
-				if (this.get(i).module == obj[j].id) {
-					this.get(i).getNode().innerHTML = tabPrefix + obj[j].title;
-				}
-			}
-		}		
-	}
-	/**
-	 * Returns the absolute coordinates of tab by the module ID
-	 * 
-	 * @param {String} id the ID of the GUI element within the tab.
-	 * @return {String} String with "left,top,right,bottom"
-	 */
-	 
-	 this.getCoords = function(id) {
-	 	var coords=[];
-	 	//get indixes
-	 	if (activeTabId) {
-			var indexOfOpeningTab = getIndexById(activeTabId);
-		}
-		var index = getIndexById(id);
-	 	
-	 	//left
-	 	coords[0] = tabLeftOffset;
-	 	//top
-	 	coords[1] = tabTopOffset + index*tabHeight + (activeTabId&&indexOfOpeningTab<index?this.get(indexOfOpeningTab).height:0);
-	 	//right
-	 	coords[2] = coords[0] + tabWidth;
-	 	//bottom
-	 	coords[3] = coords[1] + (id==activeTabId?this.get(indexOfOpeningTab).height+tabHeight:tabHeight);
-	 	
-	 	return coords.join(",");
-	 };
-
-	/**
-	 * Animated opening and closing of the tab with the given id.
-	 * Needs to be public because it is called via "setInterval". 
-	 *
-	 * @param {String} openOrClose a string with the values "open" or "close".
-	 */
-	this.animate = function(openOrClose) {
-
-		for (var i=0; i < this.count(); i++) {
-			
-			if (this.get(i).animationFinished === false) {
-
-				//The 'top' position of the i-th tab after the animation
-				var currentTabNewTop = i * tabHeight;
-	
-				if (openOrClose == 'open') {
-					var indexOfOpeningTab = getIndexById(activeTabId);
-					
-					// move the lower tabs down by the height of the opening tab
-					if (indexOfOpeningTab !== null && i > indexOfOpeningTab) {
-						currentTabNewTop += this.get(indexOfOpeningTab).height;
-					}
-				}	
-				//The current 'top' position of the i-th tab
-				//(parseInt removes 'px')
-				var currentTabCurrentTop = parseInt(this.get(i).getNode().style.top, 10);
-				
-				// animation is finished
-				if (currentTabCurrentTop == currentTabNewTop) {
-					this.get(i).animationFinished = true;
-				}	
-				// animation not yet finished, move the tab down
-				else if (currentTabCurrentTop < currentTabNewTop) {
-					var pixel = Math.min(pixelPerIteration, currentTabNewTop - currentTabCurrentTop);
-					this.get(i).getNode().style.top = currentTabCurrentTop + pixel;
-				}
-				// animation not yet finished, move the tab up
-				else if (currentTabCurrentTop > currentTabNewTop) {
-					var pixel = Math.min(pixelPerIteration, currentTabCurrentTop - currentTabNewTop);
-					this.get(i).getNode().style.top = currentTabCurrentTop - pixel;
-				}
-				else {
-					var e = new Mb_exception("mod_tab.js: animate: unknown state for tab "+ i + " (currentTop: "+currentTabCurrentTop+", newTop:"+currentTabNewTop+")");
-				}
-			}
-		}
-		// check if the animation is finished
-		if (isAnimationFinished()) {
-			stopAnimation();
-			if (openOrClose == "open") {
-				showFrame(activeTabId);
-			}
-		}
-	};
-
-	/**
-	 * Returns the index of the vertical tab with a given id 
-	 *
-	 * @private
-	 * @param {String} id the ID of the GUI element within the tab.
-	 */
-	var getIndexById = function(id) {
-		for (var i = 0; i < that.count(); i++) {
-			if (that.get(i).module == id) {
-				return i;
-			}
-		}
-		var e = new Mb_exception("mod_tab.js: getIndexById: ID '"+id+"' not found.");
-		return null;
-	};
-	
-	/**
-	 * Closes a tab.
-	 * 
-	 * @private
-	 * @param {String} id the ID of the GUI element within the tab.
-	 */
-	var closeTab = function(id) {
-		if (id !== null) {
-			hideFrame(id);
-			activeTabId = null;
-			startAnimation("close");
-		}		
-	};
-	
-	/**
-	 * Opens a tab.
-	 *
-	 * @public
-	 * @param {String} id the ID of the GUI element within the tab.
-	 */
-	this.openTab = function(id) {
-		if (id !== null && activeTabId != id) {
-  		// if no tab is currently opening or closing
-  		if (isAnimationFinished()) {
-  			for (var i=0; i < this.count(); i++) {
-  				hideFrame(this.get(i).module);
-  			}
-  		}
-      activeTabId = id;
-    	startAnimation("open");
-		}
-	};
-
-	/**
-	 * Hides a frame within a tab (before closing the tab).
-	 *
-	 * @private
-	 * @param {String} id the ID of the GUI element within the tab.
-	 */
-	var hideFrame = function(id) {
-		var index = getIndexById(id);
-		if (index !== null) {
-			var obj = document.getElementById(id);
-			obj.style.visibility = 'hidden';
-			//try to apply for childs of horizontal tabs
-			try{
-				if(obj.tabs)
-					document.getElementById(obj.tabs[obj.activeTab].id).style.visibility = 'hidden';
-		}
-			catch(e){}
-		}
-	};
-	
-	/**
-	 * Shows a frame within a tab (after opening the tab).
-	 *
-	 * @private
-	 * @param {String} id the ID of the GUI element within the tab.
-	 */
-	var showFrame = function(id) {
-		var index = getIndexById(id);
-		if (index !== null) {
-			var obj = document.getElementById(id);
-			var newpos = ((index+1) * tabHeight) + parseInt(tabTopOffset);
-			//try to apply for childs of horizontal tabs
-			try{
-				if(obj.tabs){
-					activeTab = document.getElementById(obj.tabs[obj.activeTab].id).style;
-					activeTab.visibility = 'visible';
-					activeTab.top = ((newpos + 1) + obj.tab_height) + "px";
-					activeTab.left = (tabLeftOffset) + "px";
-					activeTab.width = tabWidth;
-					activeTab.height = (parseInt(that.get(index).height) - 2) - obj.tab_height;
-				}
-			}
-			catch(e){}
-			obj=obj.style;
-			obj.top = (newpos + 1) + "px";
-			obj.left = (tabLeftOffset) + "px";
-			obj.width = tabWidth;
-			obj.height = (parseInt(that.get(index).height, 10) - 2);
-			obj.visibility = 'visible';
-		}
-	};
-
-	/**
-	 * Starts the animation of the opening and closing tabs
-	 *
-	 * @private
-	 * @param {String} openOrClose a string with the values "open" or "close".
-	 */
-	var startAnimation = function(openOrClose) {
-		for (var i = 0; i < that.count(); i++) {
-			that.get(i).animationFinished = false;
-		}
-		tabInterval = setInterval("tabs.animate('"+openOrClose+"')",1);
-	};
-	
-	/**
-	 * Checks if the animation of the opening and closing tabs is finished.
-	 *
-	 * @private
-	 */
-	var isAnimationFinished = function() {
-		for (var i = 0; i < that.count(); i ++) {
-			if (that.get(i).animationFinished === false) {
-				return false;
-			}
-		}
-		return true;
-	};
-
-	/**
-	 * Stops the animation of the opening and closing tabs
-	 *
-	 * @private
-	 */
-	var stopAnimation = function() {
-		clearInterval(tabInterval);		
-	};
-
-	this.list = [];
-	var that = this;
-
-	/**
-	 * The DOM node of the tab array.
-	 */
-	var rootNode = document.getElementById("tabs");
-
-	/**
-	 * The ID of the currently open tab. If no tab is open, the value is NULL
-	 */
-	var activeTabId = null;
-
-	/**
-	 * Number of pixel that a tab moves while opening or closing.
-	 * @private
-	 */
-	var pixelPerIteration = 20;
-	
-	/**
-	 * Used for the 'setInterval' call of 'this.animate'
-	 */
-	var tabInterval;
-
-
-	var tabTopOffset = parseInt(rootNode.style.top, 10);
-	var tabLeftOffset = parseInt(rootNode.style.left, 10);
-	var tabWidth = parseInt(rootNode.style.width, 10);
-	var tabHeight = parseInt(rootNode.style.height, 10);
-	var tabStyle = cssString;
-
-	var tabPrefix = tab_prefix || '';
-	var styleObj = new StyleTag();
-	styleObj.addClass("verticalTabs", tabStyle);
-};
-
-VerticalTabArray.prototype = new List();
+
+try{if(open_tab){open_tab=Number(open_tab);if(isNaN(open_tab)){var e=new Mb_warning("mod_tab.js: tab_init: open_tab must be a number or an empty string.");}}}
+catch(e){var z=new Mb_warning("mod_tab.js: tab_init: open_tab is not set.");open_tab="";}
+var tabs;mb_registerInitFunctions('tab_init()');eventLocalize.register(function(){localizeTabs();});eventInit.register(function(){localizeTabs();});function localizeTabs(){mb_ajax_json("../php/mod_tab_messages.php",function(obj,status){tabs.setTitles(obj);});}
+function tab_init(){var obj=document.getElementById("tabs").style;tabs=new VerticalTabArray(tab_style);for(var i=0;i<tab_ids.length;i++){tabs.addTab(tab_ids[i],tab_prefix+tab_titles[i],tab_frameHeight[i]);}
+if(open_tab!==""){tabs.openTab(tabs.get(open_tab).module);}}
+function tab_open(elementName){tabs.openTab(elementName);}
+var VerticalTab=function(id,title,frameHeight,tabWidth,tabHeight,tabStyle,number){var setNodeAttributes=function(title,frameHeight,tabWidth,tabHeight,tabStyle,number){node.id="tabs_"+that.module;node.className="verticalTabs";node.style.position="absolute";node.style.width=tabWidth;node.style.height=tabHeight;node.style.top=number*tabHeight;if($.browser.msie){node.onclick=function(){tabs.toggleTab(that.module);};}
+else{node.onclick=function(){tabs.toggleTab(that.module);};}
+node.innerHTML=title;};this.getNode=function(){return node;};this.module=id;this.height=frameHeight;this.animationFinished=true;var node=document.createElement("div");var that=this;setNodeAttributes(title,frameHeight,tabWidth,tabHeight,tabStyle,number);};var VerticalTabArray=function(cssString){this.addTab=function(id,title,height){var tab=new VerticalTab(id,title,height,tabWidth,tabHeight,tabStyle,this.count());this.add(tab);document.getElementById(id).style.visibility='hidden';rootNode.appendChild(this.get(-1).getNode());};this.delTab=function(id){var index=getIndexById(id);if(index!==null){rootNode.removeChild(this.get(index).getNode());this.del(index);for(var i=index;i<this.count();i++){var currentNode=this.get(i).getNode();var currentTop=parseInt(currentNode.style.top,10);currentNode.style.top=currentTop-tabHeight;}}};this.toggleTab=function(id){if(isAnimationFinished()){for(var i=0;i<this.count();i++){hideFrame(this.get(i).module);}
+if(id===activeTabId){closeTab(activeTabId);}
+else{activeTabId=id;startAnimation("open");}}
+else{var e=new Mb_warning("mod_tab.js: could not activate tab, opening or closing in progress!");}};this.setTitles=function(obj){for(var i=0;i<this.count();i++){for(var j=0;j<obj.length;j++){if(this.get(i).module==obj[j].id){this.get(i).getNode().innerHTML=tabPrefix+obj[j].title;}}}}
+this.getCoords=function(id){var coords=[];if(activeTabId){var indexOfOpeningTab=getIndexById(activeTabId);}
+var index=getIndexById(id);coords[0]=tabLeftOffset;coords[1]=tabTopOffset+index*tabHeight+(activeTabId&&indexOfOpeningTab<index?this.get(indexOfOpeningTab).height:0);coords[2]=coords[0]+tabWidth;coords[3]=coords[1]+(id==activeTabId?this.get(indexOfOpeningTab).height+tabHeight:tabHeight);return coords.join(",");};this.animate=function(openOrClose){for(var i=0;i<this.count();i++){if(this.get(i).animationFinished===false){var currentTabNewTop=i*tabHeight;if(openOrClose=='open'){var indexOfOpeningTab=getIndexById(activeTabId);if(indexOfOpeningTab!==null&&i>indexOfOpeningTab){currentTabNewTop+=this.get(indexOfOpeningTab).height;}}
+var currentTabCurrentTop=parseInt(this.get(i).getNode().style.top,10);if(currentTabCurrentTop==currentTabNewTop){this.get(i).animationFinished=true;}
+else if(currentTabCurrentTop<currentTabNewTop){var pixel=Math.min(pixelPerIteration,currentTabNewTop-currentTabCurrentTop);this.get(i).getNode().style.top=currentTabCurrentTop+pixel;}
+else if(currentTabCurrentTop>currentTabNewTop){var pixel=Math.min(pixelPerIteration,currentTabCurrentTop-currentTabNewTop);this.get(i).getNode().style.top=currentTabCurrentTop-pixel;}
+else{var e=new Mb_exception("mod_tab.js: animate: unknown state for tab "+i+" (currentTop: "+currentTabCurrentTop+", newTop:"+currentTabNewTop+")");}}}
+if(isAnimationFinished()){stopAnimation();if(openOrClose=="open"){showFrame(activeTabId);}}};var getIndexById=function(id){for(var i=0;i<that.count();i++){if(that.get(i).module==id){return i;}}
+var e=new Mb_exception("mod_tab.js: getIndexById: ID '"+id+"' not found.");return null;};var closeTab=function(id){if(id!==null){hideFrame(id);activeTabId=null;startAnimation("close");}};this.openTab=function(id){if(id!==null&&activeTabId!=id){if(isAnimationFinished()){for(var i=0;i<this.count();i++){hideFrame(this.get(i).module);}}
+activeTabId=id;startAnimation("open");}};var hideFrame=function(id){var index=getIndexById(id);if(index!==null){var obj=document.getElementById(id);obj.style.visibility='hidden';try{if(obj.tabs)
+document.getElementById(obj.tabs[obj.activeTab].id).style.visibility='hidden';}
+catch(e){}}};var showFrame=function(id){var index=getIndexById(id);if(index!==null){var obj=document.getElementById(id);var newpos=((index+1)*tabHeight)+parseInt(tabTopOffset);try{if(obj.tabs){activeTab=document.getElementById(obj.tabs[obj.activeTab].id).style;activeTab.visibility='visible';activeTab.top=((newpos+1)+obj.tab_height)+"px";activeTab.left=(tabLeftOffset)+"px";activeTab.width=tabWidth;activeTab.height=(parseInt(that.get(index).height)-2)-obj.tab_height;}}
+catch(e){}
+obj=obj.style;obj.top=(newpos+1)+"px";obj.left=(tabLeftOffset)+"px";obj.width=tabWidth;obj.height=(parseInt(that.get(index).height,10)-2);obj.visibility='visible';}};var startAnimation=function(openOrClose){for(var i=0;i<that.count();i++){that.get(i).animationFinished=false;}
+tabInterval=setInterval("tabs.animate('"+openOrClose+"')",1);};var isAnimationFinished=function(){for(var i=0;i<that.count();i++){if(that.get(i).animationFinished===false){return false;}}
+return true;};var stopAnimation=function(){clearInterval(tabInterval);};this.list=[];var that=this;var rootNode=document.getElementById("tabs");var activeTabId=null;var pixelPerIteration=20;var tabInterval;var tabTopOffset=parseInt(rootNode.style.top,10);var tabLeftOffset=parseInt(rootNode.style.left,10);var tabWidth=parseInt(rootNode.style.width,10);var tabHeight=parseInt(rootNode.style.height,10);var tabStyle=cssString;var tabPrefix=tab_prefix||'';var styleObj=new StyleTag();styleObj.addClass("verticalTabs",tabStyle);};VerticalTabArray.prototype=new List();
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_treeConf.js
===================================================================
--- branches/print_dev/http/javascripts/mod_treeConf.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_treeConf.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1 +1,2 @@
+
 mb_registerSubFunctions("window.frames['treeConfGDE'].checkLayer()");
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_wfs_SpatialRequest.php
===================================================================
--- branches/print_dev/http/javascripts/mod_wfs_SpatialRequest.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_wfs_SpatialRequest.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -60,7 +60,6 @@
 var button_rectangle = "rectangle";
 var button_extent = "extent";
 var button_dialogue = "dialogue";
-var mb_wfs_tolerance = 8;
 
 var activeButton = null;
 var mod_wfs_spatialRequest_geometry = null;
@@ -93,7 +92,7 @@
 var msgObj;
 
 mb_registerInitFunctions("init_wfsSpatialRequest()");
-mb_registerL10nFunctions("init_wfsSpatialRequest()");
+//mb_registerL10nFunctions("init_wfsSpatialRequest()");
 
 function init_wfsSpatialRequest() {
 	mb_ajax_json("../php/mod_wfsSpatialRequest_messages.php", function(obj, status) {
@@ -782,4 +781,4 @@
 }
 if(wfsResultToPopupDiv==1){
 	mb_registerWfsReadSubFunctions(function(geom){displayPopup(geom);});
-}
\ No newline at end of file
+}

Modified: branches/print_dev/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- branches/print_dev/http/javascripts/mod_wfs_gazetteer_client.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/mod_wfs_gazetteer_client.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -19,8 +19,8 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
-$gui_id = $_SESSION["mb_user_gui"];
 
+$gui_id = $_SESSION["mb_user_gui"];
 $target = $_REQUEST["e_target"];
 $isLoaded = $_REQUEST["isLoaded"];
 
@@ -38,8 +38,7 @@
 <?php 
 	include '../include/dyn_js.php';
 	include '../include/dyn_php.php';
-	include(dirname(__FILE__) . "/../../conf/" . $wfs_spatial_request_conf_filename);
-
+	
 	echo "var targetString = '" . $target . "';";
 	echo "var wfsConfIdString = '" . $wfsConfIdString . "';";
 	echo "var e_id_css = '" . $e_id_css . "';";
@@ -59,235 +58,21 @@
 	maxHighlightedPoints = 0;
 //	var e = new parent.Mb_warning("mod_wfs_gazetteer_client.php: Element var maxHighlightedPoints is not set, see 'edit element vars'.");
 }
-// Element var showResultInPopup
-try {if(showResultInPopup){}}catch(e) {showResultInPopup = 1;}
 
-//element var openLinkFromSearch for opening attribute link directly onclick of searchResult entry
-try{
-	if (openLinkFromSearch){}
-}
-catch(e){
-	openLinkFromSearch =0;
-}
-
 var targetArray = targetString.split(",");
 var global_wfsConfObj;
 var global_selectedWfsConfId;
 var point_px = 10;
 var resultGeom = null;
 var cw_fillcolor = "#cc33cc";
-var frameName = e_id_css;
-var inputNotEnough = [];
 
-//start button management spatialRequest ////////
-var button_point = "point";
-var button_polygon = "polygon";
-var button_rectangle = "rectangle";
-var button_extent = "extent";
-var mb_wfs_tolerance = 8;
 
-var activeButton = null;
-var mod_wfs_spatialRequest_geometry = null;
-var mod_wfs_spatialRequest_frameName = "";
-var mod_wfs_spatialRequest_epsg;
-var mod_wfs_spatialRequest_width;
-var mod_wfs_spatialRequest_height;
-
-/**
- * This Geometry contains the geometry of the optinal spatial constraint
- */
-var spatialRequestGeom = null;
-
-/**
- * Something like box, polygon, point, extent
- */
-var spatialRequestType = null;
-
-/**
- * This Geometry contains the result from the WFS request
- */
-var geomArray;
-
-var buttonWfs_id = [];
-var buttonWfs_on = [];
-var buttonWfs_src = [];
-var buttonWfs_title_off = [];
-var buttonWfs_title_on = [];
-var buttonWfs_x = [];
-var buttonWfs_y = [];
-
-function addButtonWfs(id, isOn, src, title, x, y) {
-	buttonWfs_id.push(id);
-	buttonWfs_on.push(isOn);
-	buttonWfs_src.push(src);
-	buttonWfs_title_off.push(title);
-	buttonWfs_title_on.push(title);
-	buttonWfs_x.push(x);
-	buttonWfs_y.push(y);
-}
-// end of button management spatialRequest ///////////
-
 parent.mb_registerInitFunctions("window.frames['"+this.name+"'].initModWfsGazetteer()");
-parent.mb_registerInitFunctions("window.frames['"+this.name+"'].init_wfsSpatialRequest()");
 
-function init_wfsSpatialRequest() {
-	//parent.mb_ajax_json("../php/mod_wfsSpatialRequest_messages.php", function(obj, status) {
-	//	msgObj = obj;
-		buttonWfs_id = [];
-		buttonWfs_on = [];
-		buttonWfs_src = [];
-		buttonWfs_title_off = [];
-		buttonWfs_title_on = [];
-		buttonWfs_x = [];
-		buttonWfs_y = [];
-		addButtonWfs("rectangle", buttonRectangle.status, buttonRectangle.img, buttonRectangle.title, buttonRectangle.x, buttonRectangle.y);
-		addButtonWfs("polygon", buttonPolygon.status, buttonPolygon.img, buttonPolygon.title, buttonPolygon.x, buttonPolygon.y);
-		addButtonWfs("point", buttonPoint.status, buttonPoint.img, buttonPoint.title, buttonPoint.x, buttonPoint.y);
-		addButtonWfs("extent", buttonExtent.status, buttonExtent.img, buttonExtent.title, buttonExtent.x, buttonExtent.y);
-		displayButtons();
-	//});
+function openwindow(Adresse) {
+	Fenster1 = window.open(Adresse, "Informationen", "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=no");
+	Fenster1.focus();
 }
-
-function wfsInitFunction (j) {
-	var functionCall = "parent.mb_regButton_frame('initWfsButton', '"+frameName+"', "+j+")";
-	var x = new Function ("", functionCall); 
-	x();
-} 
-
-function initWfsButton(ind, pos) {
-	parent.mb_button[ind] = document.getElementById(buttonWfs_id[pos]);
-	parent.mb_button[ind].img_over = buttonWfs_imgdir + buttonWfs_src[pos].replace(/_off/,"_over");
-	parent.mb_button[ind].img_on = buttonWfs_imgdir + buttonWfs_src[pos].replace(/_off/,"_on");
-	parent.mb_button[ind].img_off = buttonWfs_imgdir + buttonWfs_src[pos];
-	parent.mb_button[ind].img_out = buttonWfs_imgdir + buttonWfs_src[pos];
-	parent.mb_button[ind].status = 0;
-	parent.mb_button[ind].elName = buttonWfs_id[pos];
-	parent.mb_button[ind].frameName = frameName;
-	parent.mb_button[ind].go = new Function ("requestGeometryHighlight.clean(); wfsEnable(parent.mb_button["+ind+"], " + pos + ")");
-	parent.mb_button[ind].stop = new Function ("wfsDisable(parent.mb_button["+ind+"], " + pos + ")");
-	var ind = parent.getMapObjIndexByName("mapframe1");
-	mod_wfs_spatialRequest_width = parent.mb_mapObj[ind].width;
-	mod_wfs_spatialRequest_height = parent.mb_mapObj[ind].height;
-	mod_wfs_spatialRequest_epsg = parent.mb_mapObj[ind].epsg;
-	parent.mb_registerPanSubElement("measuring");
-}	
-
-function displayButtons() {
-	for (var i = 0 ; i < buttonWfs_id.length ; i ++) {
-		if (parseInt(buttonWfs_on[i])==1) {
-			var currentImg = document.createElement("img");
-			currentImg.id = buttonWfs_id[i];
-			currentImg.name = buttonWfs_id[i];
-			currentImg.title = buttonWfs_title_off[i];
-			currentImg.src = buttonWfs_imgdir+buttonWfs_src[i];
-			currentImg.style.marginRight = "5px";
-			currentImg.onmouseover = new Function("wfsInitFunction("+i+")");
-			
-			document.getElementById("displaySpatialButtons").appendChild(currentImg);
-		}
-	}
-}
-
-function disableButtons() {
-	removeChildNodes(document.getElementById("displaySpatialButtons"));
-}
-
-function wfsEnable(obj) {
-   	var el = parent.window.frames["mapframe1"].document;
-   	el.onmouseover = null;
-   	el.onmousedown = null;
-   	el.onmouseup = null;
-   	el.onmousemove = null;
-   	
-	if (obj.id == button_point) {
-		if (activeButton == null) {
-			activeButton = obj;
-		}
-	}
-	if (obj.id == button_polygon) {
-		if (activeButton == null) {
-			activeButton = obj;
-		}
-	}
-	else if (obj.id == button_rectangle){
-		if (activeButton == null) {
-			activeButton = obj;
-		}
-	}
-	else if (obj.id == button_extent){
-		if (activeButton == null) {
-			activeButton = obj;
-		}
-	}
-	callRequestGeometryConstructor(obj.id,"mapframe1");
-}
-
-function callRequestGeometryConstructor(selectedType,target){
-		if(document.getElementById("res")){
-			document.getElementById("res").innerHTML ="";
-			spatialRequestGeom = null;
-		}
-		if(document.getElementById("spatialResHint")){
-			document.getElementById("spatialResHint").innerHTML = "";
-		}
-		spatialRequestType = selectedType;
-		var geometryConstructor = new parent.RequestGeometryConstructor(target);
-		geometryConstructor.getGeometry(selectedType,function(target,queryGeom){
-			if(queryGeom !=''){
-				var spatialRes = document.createElement("span");
-				spatialRes.id = "spatialResHint";
-				spatialRes.name = "spatialResHint";
-				document.getElementById("displaySpatialButtons").appendChild(spatialRes);
-				document.getElementById("spatialResHint").innerHTML = spatialRequestIsSetMessage;
-				spatialRequestGeom = queryGeom;
-			}
-			parent.mb_disableThisButton(selectedType);
-			
-			// spatialRequestGeom is a Geometry, but for the highlight
-			// a MultiGeometry is needed.
-			var multiGeom;
-			// a line represents a bbox...but highlight must be a polyon
-			// (extent or box selection)
-			if (spatialRequestGeom.geomType == parent.geomType.line) {
-				multiGeom = new parent.MultiGeometry(parent.geomType.polygon);
-				newGeom = new parent.Geometry(parent.geomType.polygon);
-				var p1 = spatialRequestGeom.get(0);
-				var p2 = spatialRequestGeom.get(1);
-				newGeom.addPoint(p1);
-				newGeom.addPointByCoordinates(p1.x, p2.y);
-				newGeom.addPoint(p2);
-				newGeom.addPointByCoordinates(p2.x, p1.y);
-				newGeom.close();
-				multiGeom.add(newGeom);
-			}
-			// standard case
-			// (polygon and point selection)
-			else {
-				multiGeom = new parent.MultiGeometry(spatialRequestGeom.geomType);
-				multiGeom.add(spatialRequestGeom);
-			}
-			
-			// add highlight of geometry
-			requestGeometryHighlight.add(multiGeom);
-			requestGeometryHighlight.paint();
-		
-		});
-}
-
-function wfsDisable(obj) {
-	var el = parent.window.frames["mapframe1"].document; 
-	el.onmousedown = null;
-	el.ondblclick = null;
-	el.onmousemove = null;
-	parent.writeTag("mapframe1","measure_display","");
-	parent.writeTag("mapframe1","measure_sub","");
-	activeButton = null;
-}
-
-function openwindow(url) {
-	window1 = window.open(url, "Information", "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=no");
-	window1.focus();
-}
 //----------------------------------------------------------------------------------
 
 function appendWfsConf(newWfsConfIdString) {
@@ -361,9 +146,7 @@
 	}
 	document.getElementById("wfsGeomType").style.visibility = "hidden";
 	document.getElementById("wfsRemove").style.visibility = "hidden";
-		
-	geomArray = new parent.GeometryArray();
-
+	
 	parent.mb_ajax_json("../php/mod_wfs_gazetteer_server.php", {command:"getWfsConf",wfsConfIdString:wfsConfIdString}, function(json, status) {
 		global_wfsConfObj = json;
 		var wfsCount = 0;
@@ -387,12 +170,6 @@
 		}
 		parent.mb_setWmcExtensionData({"wfsConfIdString":wfsConfIdString});
 	});
-	
-	// creates a Highlight object for the request geometry
-	var styleProperties = {"position":"absolute", "top":"0px", "left":"0px", "z-index":100};
-	requestGeometryHighlight = new parent.Highlight(targetArray, "requestGeometryHighlight", styleProperties, 2);
-	parent.mb_registerSubFunctions("window.frames['" + frameName +"'].requestGeometryHighlight.paint()");
-	
 }
 
 function setWfsInfo() {
@@ -430,7 +207,7 @@
 		wfsGeomTypeNode.style.visibility = 'visible';
 	}
 	else {
-		var e = new parent.Mb_exception("WFS gazetteer: geometry type unknown.");
+		var e = new parent.Mb_exception("WFS gazetteer: geometry type unknown.");		
 	}
 	
 	// set image: remove this WFS
@@ -453,7 +230,7 @@
 			initModWfsGazetteer();			
 			parent.mb_setWmcExtensionData({"wfsConfIdString":wfsConfIdString});
 		}
-	}  
+	}
 }
 
 function setWfsConfIdString() {
@@ -471,23 +248,12 @@
 	var selectNode = document.createElement("select");
 	selectNode.name = "wfs_conf_sel";
 	var wfsFormNode = document.getElementById("selectWfsConfForm");
-	if (parent.ie) {
-		selectNode.onchange = function() {
+	selectNode.onchange = function() {
 		global_selectedWfsConfId = this.value;
-     	if(typeof(resultGeometryPopup)!="undefined"){
-	 		resultGeometryPopup.destroy();
-	 	}
-	 	if(typeof(wfsPopup)!="undefined"){
-	 		wfsPopup.destroy();
-	 	}
-    	setWfsInfo();
+		setWfsInfo();
 		appendStyles();
 		appendWfsForm();
-		};
-	}
-	else{
-	   selectNode.setAttribute("onchange", "if(typeof(resultGeometryPopup)!='undefined'){resultGeometryPopup.destroy();}if(typeof(wfsPopup)!='undefined'){wfsPopup.destroy();};global_selectedWfsConfId = this.value;setWfsInfo();appendStyles();appendWfsForm();");
-	}
+	};
 	var isSelected = false;
 	for (var wfsConfId in global_wfsConfObj) {
 		var optionNode = document.createElement("option");
@@ -528,711 +294,150 @@
 	for (var i = 0; i < wfsConfElementArray.length; i++){
 		if (parseInt(wfsConfElementArray[i].f_search)) {
 			var spanNode = document.createElement("span");
-			spanNode.setAttribute("id", wfsConfElementArray[i].element_name+"Span");
+			spanNode.setAttribute("id", "ttttt");
 			spanNode.className = wfsConfElementArray[i].f_label_id;
 			spanNode.innerHTML = wfsConfElementArray[i].f_label;
-			if(wfsConfElementArray[i].f_form_element_html.match(/\<select/)){
-				var inputNode = document.createElement("span");
-				inputNode.id = wfsConfElementArray[i].element_name+"Select";
-				inputNode.innerHTML = wfsConfElementArray[i].f_form_element_html;
-			}
-			else if(wfsConfElementArray[i].f_form_element_html.match(/checkbox/)){
-				var inputNode = document.createElement("span");
-				inputNode.id = wfsConfElementArray[i].element_name+"Checkbox";
-				inputNode.innerHTML = wfsConfElementArray[i].f_form_element_html;
-			}
-			else{ 
-				var inputNode = document.createElement("input");
-				inputNode.type = "text";
-				inputNode.className = wfsConfElementArray[i].f_style_id;
-				inputNode.id = wfsConfElementArray[i].element_name;
-				if(wfsConfElementArray[i].f_form_element_html.match(/datepicker/)){
-					inputNode.readOnly=true;
-					inputNode.style.backgroundColor = "#D3D3D3";
-					inputNode.title = "Use datepicker for selection of date";
-				}
-			}
+			var inputNode = document.createElement("input");
+			inputNode.type = "text";
+			inputNode.className = wfsConfElementArray[i].f_style_id;
+			inputNode.id = wfsConfElementArray[i].element_name;
+			
 			form.appendChild(spanNode);
 			form.appendChild(inputNode);
-			
-			//build imgNode for datepicker image
-			if(wfsConfElementArray[i].f_form_element_html.match(/datepicker/)){
-				var imgNode = document.createElement("span");
-				imgNode.id = wfsConfElementArray[i].element_name+"Img";
-				imgNode.title = "Click here to open datepicker";
-				imgNode.innerHTML = wfsConfElementArray[i].f_form_element_html;
-				form.appendChild(imgNode);
-			}
 			form.appendChild(document.createElement("br"));
 		}
 	}
 	var submitButton = document.createElement("input");
 	submitButton.type = "submit";
-	submitButton.id = "submitButton";
 	submitButton.className = global_wfsConfObj[global_selectedWfsConfId].g_button_id;
 	submitButton.value = global_wfsConfObj[global_selectedWfsConfId].g_button;
 	
 	form.appendChild(submitButton);
-	
-	var delFilterButton = document.createElement("input");
-	delFilterButton.type = "button";
-	delFilterButton.style.marginLeft = "5px";
-	delFilterButton.className = global_wfsConfObj[global_selectedWfsConfId].g_button_id;
-	delFilterButton.value = clearFilterButtonLabel;
-	// Internet explorer
-	if (parent.ie) {$_REQUEST['pdfPathString']
-		delFilterButton.onclick = function() {
-			var x = new Function ("", "clearFilter();"); 
-			x(); 
-		};
-	}
-	// Firefox
-	else {
-		delFilterButton.onclick = function () {
-			clearFilter();
-		}
-	}  
-	form.appendChild(delFilterButton);
-	
-	checkSrs();
 }
 
-function checkSrs(){
-	//check SRS
-	var ind = parent.getMapObjIndexByName("mapframe1");
-	var submit = document.getElementById("submitButton");
-	if(global_wfsConfObj[global_selectedWfsConfId].featuretype_srs.toUpperCase()!=parent.mb_mapObj[ind].getSRS().toUpperCase()){
-		var msg = "Different EPSG of map and wfs featuretype, no spatial request possible!\n";
-		msg += parent.mb_mapObj[ind].getSRS()+" und "+global_wfsConfObj[global_selectedWfsConfId].featuretype_srs;
-		alert(msg);
-			
-		//disable Submit Button
-		if(submit)submit.disabled = true;
-	}
-	else{
-		//disable Submit Button
-		if(submit)submit.disabled = false;
-	}
-}
-
-function clearFilter(){
-	var wfsConfElementArray = global_wfsConfObj[global_selectedWfsConfId].element;
-	for (var i = 0; i < wfsConfElementArray.length; i++){
-		if (parseInt(wfsConfElementArray[i].f_search)) {
-			if(wfsConfElementArray[i].f_form_element_html.match(/checkbox/)){
-				var elementArray = document.getElementsByName(wfsConfElementArray[i].element_name);
-				for (var j = 0; j < elementArray.length; j++){ 
-					elementArray[j].checked = "";
-				}
-				document.getElementById('checkAll').checked = "";
-			}
-			else{
-				document.getElementById(wfsConfElementArray[i].element_name).value = "";	
-			}
-		}	
-	}
-	
-	//remove geometry from spatialrequest, remove drawn rectangle or polygon and hint
-	spatialRequestGeom = null;
-	requestGeometryHighlight.clean();
-	requestGeometryHighlight.paint();
-	if(document.getElementById('spatialResHint')){
- 		document.getElementById("spatialResHint").innerHTML = "";
- 	}
-		
-	//remove result popup
-	if(typeof(resultGeometryPopup)!="undefined"){
- 		resultGeometryPopup.destroy();
- 	}
- 	//remove detail popup
- 	if(typeof(wfsPopup)!="undefined"){
- 		wfsPopup.destroy();
- 	}
-	
- 	if(document.getElementById('spatialResHint')){
- 		document.getElementById("spatialResHint").innerHTML = "";
- 	}
- 	document.getElementById("res").innerHTML = "";
-}
-
-function getNumberOfFilterParameters(){
-	var cnt = 0;
-	var el = global_wfsConfObj[global_selectedWfsConfId].element;
-	inputNotEnough = [];
-	for (var i = 0; i < el.length; i++){
-	
-		if( el[i]['f_search'] == 1){
-			if(el[i]['f_form_element_html'].match(/\<select/)){
-				var elementValue = document.getElementById(el[i]['element_name']).options[document.getElementById(el[i]['element_name']).selectedIndex].value;
-    		}
-    		else if(el[i]['f_form_element_html'].match(/checkbox/)){
-				var elementArray = document.getElementsByName(el[i]['element_name']);
-				var selectedVal = [];
-				for (var j = 0; j < elementArray.length; j++){ 
-					if (elementArray[j].checked == true){ 
-						selectedVal.push(elementArray[j].value);
-					}
-				}
-				var elementValue = selectedVal.join(",");
-			}
-			else{
-				var elementValue = document.getElementById(el[i]['element_name']).value;
-			}
-	
-			if (elementValue != '') {
-				cnt++;
-			}
-			if(elementValue.length < el[i]['f_min_input']){
-				inputNotEnough.push(el[i]['element_name']+"("+el[i]['f_min_input']+")");
-			}
-		}
-	}
-	
-	if(inputNotEnough.length>0){
-		alert("Mandatory fields: "+inputNotEnough.join(', '));
-		return false;
-	}
-	
-//	if(spatialRequestGeom == null){
-//		alert("Bitte räumliche Eingrenzung vornehmen.");
-//		return false;
-//	}
-	
-	return cnt;
-}
 function validate(){
-	if(geomArray.count()>0){
- 		geomArray.empty();
- 	}
- 	if(typeof(resultGeometryPopup)!="undefined"){
- 		resultGeometryPopup.destroy();
- 	}
- 	if(typeof(wfsPopup)!="undefined"){
- 		wfsPopup.destroy();
- 	}
 	global_resultHighlight = new parent.Highlight(targetArray, "wfs_gazetteer_highlight", {"position":"absolute", "top":"0px", "left":"0px", "z-index":100}, 2);
 
 	var filterParameterCount = getNumberOfFilterParameters();
 	
-	if(filterParameterCount == 0 && spatialRequestGeom == null){
-	//if(filterParameterCount == 0){
-		//alert("Please specify at least one filter attribute.");
+	if(filterParameterCount == 0){
 		return false;
 	}
 	else{
-		if(inputNotEnough.length==0){
-			var andConditions = "";
-			
-			var el = global_wfsConfObj[global_selectedWfsConfId].element;
-			var srs = global_wfsConfObj[global_selectedWfsConfId].featuretype_srs;
+		var andConditions = "";
 		
-			for (var i = 0; i < el.length; i++) {
-				if (el[i]['f_search'] == 1){
-					if(el[i]['f_form_element_html'].match(/\<select/)){
-						var elementValue = document.getElementById(el[i]['element_name']).options[document.getElementById(el[i]['element_name']).selectedIndex].value;
-	    			}
-	    			else if(el[i]['f_form_element_html'].match(/checkbox/)){
-						var elementArray = document.getElementsByName(el[i]['element_name']);
-						var selectedVal = [];
-						for (var j = 0; j < elementArray.length; j++){ 
-							if (elementArray[j].checked == true){ 
-								selectedVal.push(elementArray[j].value);
-							}
-						}
-						var elementValue = selectedVal.join(",");
+		var el = global_wfsConfObj[global_selectedWfsConfId].element;
+
+		for (var i = 0; i < el.length; i++) {
+			if (el[i]['f_search'] == 1 && document.getElementById(el[i]['element_name']).value != '') {
+		
+				var a = new Array();
+				a = document.getElementById(el[i]['element_name']).value.split(",");
+				var orConditions = "";
+				for (var j=0; j < a.length; j++) {
+					
+					orConditions += "<ogc:PropertyIsLike wildCard='*' singleChar='.' escape='!'>";
+					orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
+					orConditions += "<ogc:Literal>*";
+					if(el[i]['f_toupper'] == 1){
+						orConditions += a[j].toUpperCase();
 					}
 					else{
-						var elementValue = document.getElementById(el[i]['element_name']).value;
+						orConditions += a[j];
 					}
+					orConditions += "*</ogc:Literal>";
+					orConditions += "</ogc:PropertyIsLike>";
 				}
-				
-				if (el[i]['f_search'] == 1 && elementValue != '') {
-					var a = new Array();
-					a = elementValue.split(",");
-					var orConditions = "";
-					for (var j=0; j < a.length; j++) {
-						if(el[i]['f_operator']=='bothside'){
-							orConditions += "<ogc:PropertyIsLike wildCard='*' singleChar='.' escape='!'>";
-							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
-							orConditions += "<ogc:Literal>*";
-							if(el[i]['f_toupper'] == 1){
-								orConditions += a[j].toUpperCase();
-							}
-							else{
-								orConditions += a[j];
-							}
-							orConditions += "*</ogc:Literal>";
-							orConditions += "</ogc:PropertyIsLike>";
-					}
-						else if(el[i]['f_operator']=='rightside'){
-							orConditions += "<ogc:PropertyIsLike wildCard='*' singleChar='.' escape='!'>";
-							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
-							orConditions += "<ogc:Literal>";
-							if(el[i]['f_toupper'] == 1){
-								orConditions += a[j].toUpperCase();
-							}
-							else{
-								orConditions += a[j];
-							}
-							orConditions += "*</ogc:Literal>";
-							orConditions += "</ogc:PropertyIsLike>";
-						}
-						else if(el[i]['f_operator']=='greater_than'){
-							orConditions += "<ogc:PropertyIsGreaterThan>";
-							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
-							orConditions += "<ogc:Literal>";
-							if(el[i]['f_toupper'] == 1){
-								orConditions += a[j].toUpperCase();
-							}
-							else{
-								orConditions += a[j];
-							}
-							orConditions += "</ogc:Literal>";
-							orConditions += "</ogc:PropertyIsGreaterThan>";
-						}
-						else if(el[i]['f_operator']=='less_than'){
-							orConditions += "<ogc:PropertyIsLessThan>";
-							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
-							orConditions += "<ogc:Literal>";
-							if(el[i]['f_toupper'] == 1){
-								orConditions += a[j].toUpperCase();
-							}
-							else{
-								orConditions += a[j];
-							}
-							orConditions += "</ogc:Literal>";
-							orConditions += "</ogc:PropertyIsLessThan>";
-						}
-						else if(el[i]['f_operator']=='less_equal_than'){
-							orConditions += "<ogc:PropertyIsLessThanOrEqualTo>";
-							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
-							orConditions += "<ogc:Literal>";
-							if(el[i]['f_toupper'] == 1){
-								orConditions += a[j].toUpperCase();
-							}
-							else{
-								orConditions += a[j];
-							}
-							orConditions += "</ogc:Literal>";
-							orConditions += "</ogc:PropertyIsLessThanOrEqualTo>";
-						}
-						else if(el[i]['f_operator']=='greater_equal_than'){
-							orConditions += "<ogc:PropertyIsGreaterThanOrEqualTo>";
-							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
-							orConditions += "<ogc:Literal>";
-							if(el[i]['f_toupper'] == 1){
-								orConditions += a[j].toUpperCase();
-							}
-							else{
-								orConditions += a[j];
-							}
-							orConditions += "</ogc:Literal>";
-							orConditions += "</ogc:PropertyIsGreaterThanOrEqualTo>";
-						}
-						else if(el[i]['f_operator']=='equal'){
-							orConditions += "<ogc:PropertyIsEqualTo>";
-							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
-							orConditions += "<ogc:Literal>";
-							if(el[i]['f_toupper'] == 1){
-								orConditions += a[j].toUpperCase();
-							}
-							else{
-								orConditions += a[j];
-							}
-							orConditions += "</ogc:Literal>";
-							orConditions += "</ogc:PropertyIsEqualTo>";
-						}
-						else{
-							orConditions += "<ogc:PropertyIsLike wildCard='*' singleChar='.' escape='!'>";
-							orConditions += "<ogc:PropertyName>" + el[i]['element_name'] + "</ogc:PropertyName>";
-							orConditions += "<ogc:Literal>*";
-							if(el[i]['f_toupper'] == 1){
-								orConditions += a[j].toUpperCase();
-							}
-							else{
-								orConditions += a[j];
-							}
-							orConditions += "*</ogc:Literal>";
-							orConditions += "</ogc:PropertyIsLike>";
-						}
-					}
-					if(a.length > 1){
-						andConditions += "<Or>" + orConditions + "</Or>";
-					}
-					else {
-						andConditions += orConditions;
-					}
+				if(a.length > 1){
+					andConditions += "<Or>" + orConditions + "</Or>";
 				}
+				else {
+					andConditions += orConditions;
+				}
 			}
+		}
+
+		var u = global_wfsConfObj[global_selectedWfsConfId].wfs_getfeature + parent.mb_getConjunctionCharacter(global_wfsConfObj[global_selectedWfsConfId].wfs_getfeature);
+		u += "REQUEST=getFeature&Typename="+global_wfsConfObj[global_selectedWfsConfId].featuretype_name+"&Version=1.0.0&service=WFS";
+		u += "&filter=";
+
+		if (filterParameterCount > 1) {
+			andConditions = "<And>" + andConditions + "</And>";
+		}
+
+		var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>"+andConditions+"</ogc:Filter>";
+
+		document.getElementById("res").innerHTML = "<table><tr><td><img src='../img/indicator_wheel.gif'></td><td>Searching...</td></tr></table>";
+		var parameters = {command:"getSearchResults", "wfs_conf_id":global_selectedWfsConfId, "frame":this.name, "url":u, "filter":filter, "backlink":""};
+		parent.mb_ajax_get("../php/mod_wfs_gazetteer_server.php", parameters, function (jsCode, status) {
+			document.getElementById("res").innerHTML = "<table><tr><td>Arranging search results...</td></tr></table>";
 			
-			if(spatialRequestGeom!=null){
-				if(spatialRequestGeom.geomType == "polygon"){
-					if(buttonPolygon.filteroption=='within'){	
-						andConditions += "<Within><ogc:PropertyName>";
-						for (var j=0; j < el.length; j++) {
-							if(el[j]['f_geom']==1){
-								var elementName = el[j]['element_name'];
-								andConditions += el[j]['element_name'];
-							}
-						}
-						andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
-						andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
-						for(var k=0; k<spatialRequestGeom.count(); k++){
-							if(k>0)	andConditions += " ";
-							andConditions += spatialRequestGeom.get(k).x+","+spatialRequestGeom.get(k).y;
-						}
-						andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
-						andConditions += "</gml:Polygon></Within>";
+			eval(jsCode);
+			
+			for (var i=0; i < parent.wms.length; i++) {
+				for (var j=0; j < parent.wms[i].objLayer.length; j++) {
+	
+					var currentLayer = parent.wms[i].objLayer[j];
+					var wms_id = parent.wms[i].wms_id; 
+	
+					if (currentLayer.gui_layer_wfs_featuretype == global_selectedWfsConfId) {
+						var layer_name = currentLayer.layer_name; 
+						parent.handleSelectedLayer_array(targetArray[0],[wms_id],[layer_name],'querylayer',1); 
+						parent.handleSelectedLayer_array(targetArray[0],[wms_id],[layer_name],'visible',1);
 					}
-					else if(buttonPolygon.filteroption=='intersects'){
-						andConditions += "<Intersects><ogc:PropertyName>";
-						for (var j=0; j < el.length; j++) {
-							if(el[j]['f_geom']==1){
-								var elementName = el[j]['element_name'];
-								andConditions += el[j]['element_name'];
-							}
-						}
-						andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
-						andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
-						for(var k=0; k<spatialRequestGeom.count(); k++){
-							if(k>0)	andConditions += " ";
-							andConditions += spatialRequestGeom.get(k).x+","+spatialRequestGeom.get(k).y;
-						}
-						andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
-						andConditions += "</gml:Polygon></Intersects>";
-					}
-				}	
-				else if(spatialRequestGeom.geomType == "line"){
-					var rectangle = [];
-					rectangle = spatialRequestGeom.getBBox();
-					
-					if(buttonRectangle.filteroption=='within'){	
-						andConditions += "<Within><ogc:PropertyName>";
-						for (var j=0; j < el.length; j++) {
-							if(el[j]['f_geom']==1){
-								var elementName = el[j]['element_name'];
-								andConditions += el[j]['element_name'];
-							}
-						}
-						andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
-						andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
-						andConditions += rectangle[0].x+","+rectangle[0].y;
-						andConditions += " ";
-						andConditions += rectangle[0].x+","+rectangle[1].y;
-						andConditions += " ";
-						andConditions += rectangle[1].x+","+rectangle[1].y;
-						andConditions += " ";
-						andConditions += rectangle[1].x+","+rectangle[0].y;
-						andConditions += " ";
-						andConditions += rectangle[0].x+","+rectangle[0].y;
-						andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
-						andConditions += "</gml:Polygon></Within>";
-					}
-					else if(buttonRectangle.filteroption=='intersects'){
-						andConditions += "<Intersects><ogc:PropertyName>";
-						for (var j=0; j < el.length; j++) {
-							if(el[j]['f_geom']==1){
-								var elementName = el[j]['element_name'];
-								andConditions += el[j]['element_name'];
-							}
-						}
-						andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
-						andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
-						andConditions += rectangle[0].x+","+rectangle[0].y;
-						andConditions += " ";
-						andConditions += rectangle[0].x+","+rectangle[1].y;
-						andConditions += " ";
-						andConditions += rectangle[1].x+","+rectangle[1].y;
-						andConditions += " ";
-						andConditions += rectangle[1].x+","+rectangle[0].y;
-						andConditions += " ";
-						andConditions += rectangle[0].x+","+rectangle[0].y;
-						andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
-						andConditions += "</gml:Polygon></Intersects>";
-					}			
 				}
-				else if(spatialRequestGeom.geomType == "point"){
-					var tmp = spatialRequestGeom.get(0);
-					var mapPos = parent.makeRealWorld2mapPos("mapframe1",tmp.x, tmp.y);
-					var buffer = mb_wfs_tolerance/2;
-					var mapPosXAddPix = mapPos[0] + buffer; 
-					var mapPosYAddPix = mapPos[1] +buffer;
-					var mapPosXRemovePix = mapPos[0] - buffer;
-					var mapPosYRemovePix = mapPos[1] - buffer;
-					var realWorld1 = parent.makeClickPos2RealWorldPos("mapframe1",mapPosXRemovePix,mapPosYRemovePix);
-					var realWorld2 = parent.makeClickPos2RealWorldPos("mapframe1",mapPosXAddPix,mapPosYRemovePix);
-					var realWorld3 = parent.makeClickPos2RealWorldPos("mapframe1",mapPosXAddPix,mapPosYRemovePix);
-					var realWorld4 = parent.makeClickPos2RealWorldPos("mapframe1",mapPosXRemovePix,mapPosYAddPix);
-					andConditions += "<Intersects><ogc:PropertyName>";
-					for (var j=0; j < el.length; j++) {
-						if(el[j]['f_geom']==1){
-							var elementName = el[j]['element_name'];
-							andConditions += el[j]['element_name'];
-						}
-					}
-					andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
-					andConditions += realWorld1[0] + "," + realWorld1[1] + " " + realWorld2[0] + "," + realWorld2[1] +  " ";
-					andConditions += realWorld3[0] + "," + realWorld3[1] + " " + realWorld4[0] + "," + realWorld4[1] + " " + realWorld1[0] + "," + realWorld1[1]; 
-					andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects>";
-				}
-				//andConditions += "<ogc:Not><ogc:PropertyIsNull>";
-	            //andConditions += "<ogc:PropertyName>" + elementName + "</ogc:PropertyName>";
-	       		//andConditions += "</ogc:PropertyIsNull></ogc:Not>";
 			}
 			
-			var u = global_wfsConfObj[global_selectedWfsConfId].wfs_getfeature + parent.mb_getConjunctionCharacter(global_wfsConfObj[global_selectedWfsConfId].wfs_getfeature);
-			u += "REQUEST=getFeature&Typename="+global_wfsConfObj[global_selectedWfsConfId].featuretype_name+"&Version=1.0.0&service=WFS";
-			u += "&filter=";
-	
-			if (filterParameterCount > 1 || spatialRequestGeom != null) {
-				andConditions = "<And>" + andConditions + "</And>";
-			}
-	
-			var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>"+andConditions+"</ogc:Filter>";
-	
-			document.getElementById("res").innerHTML = "<table><tr><td><img src='../img/indicator_wheel.gif'></td><td>Searching...</td></tr></table>";
-			var parameters = {command:"getSearchResults", "wfs_conf_id":global_selectedWfsConfId, "frame":this.name, "url":u, "filter":filter, "backlink":""};
-			parent.mb_ajax_get("../php/mod_wfs_gazetteer_server.php", parameters, function (jsCode, status) {
-				document.getElementById("res").innerHTML = "<table><tr><td>Arranging search results...</td></tr></table>";
-				
-				if(status=='success'){
-					for (var i=0; i < parent.wms.length; i++) {
-						for (var j=0; j < parent.wms[i].objLayer.length; j++) {
-							var currentLayer = parent.wms[i].objLayer[j];
-							var wms_id = parent.wms[i].wms_id; 
-							if (currentLayer.gui_layer_wfs_featuretype == global_selectedWfsConfId) {
-								var layer_name = currentLayer.layer_name; 
-								parent.handleSelectedLayer_array(targetArray[0],[wms_id],[layer_name],'querylayer',1); 
-								parent.handleSelectedLayer_array(targetArray[0],[wms_id],[layer_name],'visible',1);					
-							}
-						}
+			var body = "";
+			if (typeof(geom) == 'object') {
+				resultGeom = geom; // set the global variable
+				for (var i=0; i < geom.count(); i++) {
+					body += "<div id='geom"+i+"'style='cursor:pointer;' ";
+					if ((i % 2) === 0) {
+						body += "class='even'";
 					}
-					var geoObj = eval('(' + jsCode + ')');	
-		       		if (jsCode) {
-			        	if (typeof(geoObj) == 'object') {
-			        		geomArray.importGeoJSON(geoObj);
-			        		document.getElementById("res").innerHTML = '';
-							displayResult(geomArray);
-						}
-						else {
-							document.getElementById("res").innerHTML = '';
-							displayResult();
-						}
+					else {
+						body += "class='uneven'";
 					}
-		       		else {
-						document.getElementById("res").innerHTML = '';
-						alert("No results.");
+					body += " onmouseover=\"setResult('over', this.id)\" ";
+					body += " onmouseout=\"setResult('out', this.id)\" ";
+					body += " onclick=\"setResult('click', this.id)\">";
+					for (var j=0; j < geom.get(i).e.count(); j++) {
+						body += geom.get(i).e.getValue(j) + " ";
 					}
-		       	}
-			});
-		}
-		else{
-			return false;
-		}
-	}	
-	//spatialRequestGeom = null;
-	return false;
-}
-
-function displayResult(geom){
-	geomArray = geom;
-	if(geomArray!=null && geomArray.count()>0){
-		var contentHtml = createListOfGeometries();
-	}
-	else{
-		var contentHtml = "No results.";
-	}
-	
-	if(showResultInPopup==1){
-		if (typeof(resultGeometryPopup) == "undefined") {
-			resultGeometryPopup = new parent.mb_popup(searchPopupTitle,contentHtml,searchPopupWidth,searchPopupHeight,searchPopupX,searchPopupY);
-		}
-		else {
-			resultGeometryPopup.destroy();
-			resultGeometryPopup = new parent.mb_popup(searchPopupTitle,contentHtml,searchPopupWidth,searchPopupHeight,searchPopupX,searchPopupY);
-		}
-		resultGeometryPopup.show();
-	
-	}
-	else{
-		document.getElementById("res").innerHTML = contentHtml;
-	}
-	
-} 
-
-function createListOfGeometries(){
-	if(showResultInPopup==1){
-		var domPath = "window.frames['"+frameName+"'].";
-	}
-	else{
-		var domPath = "";
-	}
-	var listOfGeom = "<form name='resultListForm'><table style='background-color:#EEEEEE;'>\n";
-	var wfsConf = global_wfsConfObj[global_selectedWfsConfId];
-	var labelArray = [];
-	if (geomArray.count() > 0) {
-				
-		if(showResultInPopup==1){
-			listOfGeom += "<tr>";
-			var labelObj = getListTitle();
-			for (var k = 1 ; k < labelObj.length; k ++) {
-				listOfGeom += "<td>";
-				listOfGeom += labelObj[k];
-				listOfGeom += "</td>";
+					body += "</div>";
+				}
 			}
-			listOfGeom += "</tr>";
-		}
-						
-		for (var i = 0 ; i < geomArray.count(); i ++) {
-			if (geomArray.get(i).get(-1).isComplete()) {
-				listOfGeom += "<tr>\n";
-				var resultElObj = getListValues(geomArray.get(i));
-				for (var l = 1 ; l < resultElObj.length; l ++) {
-					if(resultElObj[l]!=''){
-						listOfGeom += "<td style='cursor:pointer;\n";
-						if(showResultInPopup==1){
-							if ((i % 2) === 0) {
-								listOfGeom += "color:blue'";
-							}
-							else {
-								listOfGeom += "color:red'";
-							}
-						}
-						else{
-							if ((i % 2) === 0) {
-								listOfGeom += "' class='even'";
-							}
-							else {
-								listOfGeom += "' class='uneven'";
-							}
-						}
-						listOfGeom += " onmouseover=\""+domPath+"setResult('over',"+i+")\" ";
-						listOfGeom += " onmouseout=\""+domPath+"setResult('out',"+i+")\" ";
-						listOfGeom += " onclick=\""+domPath+"setResult('click',"+i+"); "+domPath+"showWfs("+i+");\" ";
-						listOfGeom += ">"+ resultElObj[l] +"</td>";
-					}
-				}	
-				listOfGeom += "\t</tr>\n"; 
+			else {
+				body = "Kein Ergebnis.";
 			}
-		}
+			document.getElementById('res').innerHTML = body;
+		});
 	}
-	listOfGeom += "</table></form>\n";
-	return listOfGeom; 
+	return false;
 }
 
-function getListTitle(){
-	var wfsConf = global_wfsConfObj[global_selectedWfsConfId];
-	var labelArray = [];
-	for (var j = 0 ; j < wfsConf.element.length ; j++) {
-		if(wfsConf.element[j].f_show == 1 && wfsConf.element[j].f_label!=''){
-			var labelPos = wfsConf.element[j].f_respos;
-			labelArray[labelPos] = wfsConf.element[j].f_label;
-		}
-	}
-	return labelArray;
-}
-		
-function getListValues(geom){
-	var wfsConf = global_wfsConfObj[global_selectedWfsConfId];
-	var resultArray = [];
-	for (var i = 0 ; i < wfsConf.element.length ; i++) {
-		if (wfsConf.element[i].f_show == 1 && geom.e.getElementValueByName(wfsConf.element[i].element_name) !=false) {
-			var pos = wfsConf.element[i].f_respos;
-			if(pos>0){
-				resultArray[pos] = geom.e.getElementValueByName(wfsConf.element[i].element_name);
-			}
-		}
-	}
-	return resultArray;
-}
+function getNumberOfFilterParameters(){
+	var cnt = 0;
+	var el = global_wfsConfObj[global_selectedWfsConfId].element;
 
-function showWfs(geometryIndex) {
-	var wfsConf = global_wfsConfObj[global_selectedWfsConfId];
-	var wfsElement = geomArray.get(geometryIndex).e;
-	var showDetailsObj = [];
-	var details = 0;
-	for (var i = 0 ; i <wfsConf.element.length; i ++) {
-		if(wfsConf.element[i].f_show_detail == 1 && wfsElement.getElementValueByName(wfsConf.element[i].element_name)!=''){
-			var elPos = wfsConf.element[i].f_detailpos;
-			if(elPos>0){
-				var currentObj = {};
-//				showDetailsObj[elPos] = {};
-				currentObj.elPos = elPos;
-				currentObj.data = {};
-				//var elementVal = wfsElement.getElementValueByName(wfsConf.element[i].element_name);
-				//showDetailsObj[elPos][wfsConf.element[i].f_label] = elementVal;
-				if(wfsConf.element[i].f_form_element_html.indexOf("href")!=-1){
-					var newPath = wfsElement.getElementValueByName(wfsConf.element[i].element_name).replace(/%computername%/,"Rechnername");
-					var setUrl = wfsConf.element[i].f_form_element_html.replace(/href\s*=\s*['|"]\s*['|"]/, "href='"+newPath+"' target='_blank'");
-					if(setUrl.match(/><\/a>/)){
-						var newLink	=	setUrl.replace(/><\/a>/, ">"+wfsElement.getElementValueByName(wfsConf.element[i].element_name)+"</a>");
-					}
-					else{
-						var newLink = setUrl;
-					}
-					if(openLinkFromSearch=='1'){
-						window.open(elementVal, elementVal,"width=500, height=400,left=100,top=100,scrollbars=yes");
-					}
-//					showDetailsObj[elPos][wfsConf.element[i].f_label] =  newLink;
-					currentObj.data[wfsConf.element[i].f_label] = newLink;
-				}
-				else{
-//					showDetailsObj[elPos][wfsConf.element[i].f_label] = wfsElement.getElementValueByName(wfsConf.element[i].element_name);
-					currentObj.data[wfsConf.element[i].f_label] = wfsElement.getElementValueByName(wfsConf.element[i].element_name);
-				}
-				showDetailsObj.push(currentObj);
+	for (var i = 0; i < el.length; i++){
+		if( el[i]['f_search'] == 1){
+			if (document.getElementById(el[i]['element_name']).value != '') {
+				cnt++;
 			}
-			details = 1;
 		}
-		else{
-			details = 0;
-		}
 	}
-	var resultHtml = "";
-	resultHtml += "<table style='background-color:#EEEEEE;'>\n";
-//	for (var elPos in showDetailsObj) {
-
-	showDetailsObj.sort(showDetailObjSort);
-	for (var i=0; i < showDetailsObj.length; i++) {
-//		var currentDetail = showDetailsObj[elPos];
-		var currentDetail = showDetailsObj[i].data;
-		for(var key in currentDetail){
-			var currentDetailName = key;
-			var currentDetailValue = currentDetail[key];
-			resultHtml +="<tr><td>\n"; 
-			resultHtml += currentDetailName;
-			resultHtml +="</td>\n"; 
-			resultHtml += "<td>\n";
-			resultHtml += currentDetailValue;
-			resultHtml += "</td></tr>\n";
-		}
-	}
-	if(details != 1){
-		resultHtml +="<tr><td>No detail information</td></tr>\n";
-	}
-	resultHtml += "</table>\n";
-	if(showResultInPopup==1){
-		if (typeof(wfsPopup) == "undefined") {
-			wfsPopup = new parent.mb_popup(detailPopupTitle,resultHtml,detailPopupWidth,detailPopupHeight,detailPopupX,detailPopupY);
-		}
-		else {
-			wfsPopup.destroy();
-			wfsPopup = new parent.mb_popup(detailPopupTitle,resultHtml,detailPopupWidth,detailPopupHeight,detailPopupX,detailPopupY);
-		}
-		wfsPopup.show();
-	}
+	return cnt;
 }
-
-function showDetailObjSort (a, b) {
-	return (parseInt(a.elPos) - parseInt(b.elPos));
-}
-
 /*
 * event -> {over || out || click}
 * geom -> commaseparated coordinates x1,y1,x2,y2 ...
 */
-function setResult(event, index){
-	var currentGeom = geomArray.get(index);
+function setResult(event, id){
+	var index = parseInt(id.slice(4));
+
+	var currentGeom = resultGeom.get(index);
 	if (maxHighlightedPoints > 0 && currentGeom.getTotalPointCount() > maxHighlightedPoints) {
 		currentGeom = currentGeom.getBBox4();
 	}
@@ -1258,22 +463,14 @@
 	}
 	return true;
 }
-function callPick(obj){
-	dTarget = obj;
-	var dp = window.open('../tools/datepicker/datepicker.php?m=Jan_Feb_Mar_Apr_May_June_July_Aug_Sept_Oct_Nov_Dec&d=Mon_Tue_Wed_Thu_Fri_Sat_Sun&t=today','dp','left=200,top=200,width=230,height=210,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0');
-	dp.focus();
-	return false;
-}
-
 </script>
 </head>
 <body leftmargin='0' topmargin='10'  bgcolor='#ffffff'>
 <form name='selectWfsConfForm' id='selectWfsConfForm'></form>
-<div name='displaySpatialButtons' id='displaySpatialButtons' style='width:180px'></div>
-<a name='wfsInfo' id='wfsInfo'></a>
-<img src = "" name='wfsRemove' id='wfsRemove'>
 <img src = "" name='wfsGeomType' id='wfsGeomType'>
+<img src = "" name='wfsRemove' id='wfsRemove'>
+<a name='wfsInfo' id='wfsInfo'></a>
 <form name='wfsForm' id='wfsForm' onsubmit='return validate()'></form>
 <div name='res' id='res' style='width:180px'></div>
 </body>
-</html>
+</html>
\ No newline at end of file

Added: branches/print_dev/http/javascripts/point.js
===================================================================
--- branches/print_dev/http/javascripts/point.js	                        (rev 0)
+++ branches/print_dev/http/javascripts/point.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1,20 @@
+
+function Point(x,y,z){this.x=x;this.y=y;this.z=z;}
+Point.prototype.dist=function(p){return Math.sqrt(Math.pow(this.y-p.y,2)+Math.pow(this.x-p.x,2));};Point.prototype.equals=function(p){if(this.x==p.x&&this.y==p.y){return true;}
+return false;};Point.prototype.minus=function(p){return new Point(this.x-p.x,this.y-p.y);};Point.prototype.plus=function(p){return new Point(this.x+p.x,this.y+p.y);};Point.prototype.dividedBy=function(c){if(c!==0){return new Point(this.x/c,this.y/c);}
+var e=new Mb_exception("Point.dividedBy: Division by zero");return false;};Point.prototype.times=function(c){return new Point(this.x*c,this.y*c);};Point.prototype.round=function(numOfDigits){return new Point(roundToDigits(this.x,numOfDigits),roundToDigits(this.y,numOfDigits));};Point.prototype.toString=function(){if(typeof(this.z=="undefined")){return"["+this.x+", "+this.y+"]";}
+else{return"["+this.x+", "+this.y+", "+this.z+"]";}};function mapToReal(frameName,aPoint){var v;if(typeof(mb_mapObj)=='object'){v=makeClickPos2RealWorldPos(frameName,aPoint.x,aPoint.y);}
+else{if(typeof(parent.mb_mapObj)=='object'){v=parent.makeClickPos2RealWorldPos(frameName,aPoint.x,aPoint.y);}
+else{alert('where am i?');}}
+return new Point(v[0],v[1]);}
+function realToMap(frameName,aPoint){var v;if(typeof(mb_mapObj)=='object'){v=makeRealWorld2mapPos(frameName,aPoint.x,aPoint.y);}
+else if(typeof(parent.mb_mapObj)=='object'){v=parent.makeRealWorld2mapPos(frameName,aPoint.x,aPoint.y);}
+else{var e=new Mb_exception('Point.realToMap:where am i?');}
+return new Point(v[0],v[1]);}
+function mb_calcExtent(frameName,min,max){var ind;if(typeof(mb_mapObj)=='object'){ind=getMapObjIndexByName(frameName);}
+else if(typeof(parent.mb_mapObj)=='object'){ind=parent.getMapObjIndexByName(frameName);}
+else{var e=new Mb_exception('Point.mb_calcExtent: function getMapObjIndexByName not found');}
+var extent=max.minus(min);var center=extent.dividedBy(2).plus(min);var relation_px_x=mb_mapObj[ind].width/mb_mapObj[ind].height;var relation_px_y=mb_mapObj[ind].height/mb_mapObj[ind].width;var relation_bbox_x=extent.x/extent.y;var new_min;var new_max;if(relation_bbox_x<=relation_px_x){new_min=new Point(center.x-relation_px_x*extent.y/2,min.y);new_max=new Point(center.x+relation_px_x*extent.y/2,max.y);}
+else if(relation_bbox_x>relation_px_x){new_min=new Point(min.x,center.y-relation_px_y*extent.x/2);new_max=new Point(max.x,center.y+relation_px_y*extent.x/2);}
+mb_mapObj[ind].extent=new_min.x+","+new_min.y+","+new_max.x+","+new_max.y;}
+function roundToDigits(aFloat,numberOfDigits){return Math.round(aFloat*Math.pow(10,parseInt(numberOfDigits,10)))/Math.pow(10,parseInt(numberOfDigits,10));}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/popup.js
===================================================================
--- branches/print_dev/http/javascripts/popup.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/popup.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,454 +1,48 @@
-/* 
-* $Id$
-* COPYRIGHT: (C) 2002 by ccgis. This program is free software under the GNU General Public
-* License (>=v2). Read the file gpl.txt that comes with Mapbender for details. 
-*/
-//http://www.mapbender.org/index.php/popup
-var popup_count = 0;
-var popup_top = 150;
 
-/**
- * @class A class representing a popup window
- *
- * @constructor
- * @param {String/Object} title the title text of the popup or Options object
- * Elelemts of the options object (all optional):
- *  left: position left
- *  top: position top
- *  width: popup width
- *  height: popup height
- *  title: popup title
- *  frameName: name of the popups iframe if it loads a frame  (recommended to set destroy to false)
- *  opacity: opacity of the frame default:1
- *  moveOpacity: opacity while the user moves or resizes the frame default:0.8
- *  html:content html of the frame (not parsed if url not false)
- *  url:content url of the frame
- *  minWidth: minimum width of the popup if the user resizes it
- *  maxWidth: maximum width of the popup if the user resizes it
- *  minHeight: minimum height of the popup if the user resizes it
- *  maxHeight: maximum height of the popup if the user resizes it
- *  minTop: minimum top position if the user moves the popup default:"document"
- *  minLeft: minimum left position if the user moves the popup default:"document"
- *  maxRight: maximum right position if the user moves/resizes the popup
- *  maxBottom: maximum bottom position if the user moves/resized the popup
- * 	style: additional styles for the popup window
- *  destroy: remove dom of popup if user closes it (don't use it for iframes with framename) default:true
- *  closeCallback: function that is called if the user closes the window
- *  resizeable: allow user to change the size default:true
- *  dragable: allow user to move the window default:true
- *  balloon: balloon popup from top, left (disables resizeable and dragable)
- * 
- * @param {String} html the "body" of the popup, can also be "url:http://foo.de" to display a website
- * @param {Number} width width of the popup
- * @param {Number} height hight of the popup
- * @param {Number} posx left position of the popup
- * @param {Number} popy top posision of the popup
- * 
- */
-function mb_popup(title,html,width,height,posx,posy,fName,opacity) {
-	//get first free place
-	var create_pos=popup_count;
-	for(var i = 0; i < popup_count;i++)
-//		if(!document.getElementById("popup"+String(i))){
-//			create_pos=i;
-//			break;
-//		}
-
-	this.id="popup"+String(create_pos);
-//	this.id="popup"+String(popup_top);
-	
-	//Set defaults
-	defaults = {
-		left:25*create_pos,
-		top:25*create_pos,
-		width:300,height:250,
-		title:"Title",
-		frameName:this.id,
-		id:this.id
-	};
-		
-	if(typeof(title)!='object'){
-		this.options = defaults;
-		
-		//Set vars
-		if(posx)this.options.left=posx;
-		if(posy)this.options.top=posy;
-		if(width)this.options.width=width;
-		if(height)this.options.height=height;
-		if(title)this.options.title=title;
-		if(fName)this.options.frameName=fName;
-		if(opacity)this.options.opacity;
-		if(html){
-			if(html.indexOf("url:")==0)
-				this.options.url=html.substr(4);
-			else
-				this.options.html=html;
-		}
-	}
-	else
-		this.options=$.extend(defaults, title);
-
-	popup_count++;
-	
-	//create dom popup
-	$("body").append("<div style=\"display:none;z-index:"+popup_top+"\" id=\""+this.id+"\"></div>");
-	this.div = $("#"+this.id).mbPopup(this.options);
-}
-
-/**
- * Shows the popup
- */
-mb_popup.prototype.show = function(){
-	if(!document.getElementById(this.id)){
-		//(re)create dom popup
-		$("body").append("<div style=\"display:none;z-index:"+popup_top+"\" id=\""+this.id+"\"></div>");
-		this.div = $("#"+this.id).mbPopup(this.options);
-	}
-	if(!this.isVisible())
-		$("#"+this.id).show();
-}
-
-/**
- * Hides the popup
- */
-mb_popup.prototype.hide = function(){	
-	$("#"+this.id).hide();
-	$("#balloon_"+this.id).hide();
-}
-
-/**
- * Hides the popup
- */
-mb_popup.prototype.destroy = function(){	
-	$("#"+this.id).remove();
-	$("#balloon_"+this.id).remove();
-}
-
-/**
- * sets the width of the popup window
- *
- * @param {Number} width new width of the popup  
- */
-mb_popup.prototype.setWidth = function(width){
-	var div=document.getElementById(this.id);
-	if(div)div.style.width=width;
-}
-
-/**
- * sets the height of the popup window
- *
- * @param {Number} height new height of the popup  
- */
-mb_popup.prototype.setHeight = function(height){
-	var div=document.getElementById(this.id);
-	if(div)div.style.height=height;
-}
-
-/**
- * sets the left position of the popup window
- *
- * @param {Number} left new left position of the popup  
- */
-mb_popup.prototype.setLeft = function(left){
-	var div=document.getElementById(this.id);
-	if(div)div.style.left=left;
-}
-
-/**
- * sets the top position of the popup window
- *
- * @param {Number} top new top position of the popup  
- */
-mb_popup.prototype.setTop = function(topp){
-	var div=document.getElementById(this.id);
-	if(div)div.style.top=topp;
-}
-
-/**
- * sets the opacity of the popup window
- *
- * @param {Number} opacity new opacity value of the popup  
- */
-mb_popup.prototype.setOpacity = function(opacityy){
-	var div=document.getElementById(this.id);
-	if(div)div.style.opacity=opacityy;
-}
-
-/**
- * sets the title of the popup window
- *
- * @param {String} title new title text of the popup  
- */
-mb_popup.prototype.setTitle = function(title){
-	$("#"+this.id+" h1").text(title);
-}
-
-/**
- * sets the html content of the popup window
- *
- * @param {String} html new html "body" of the popup  
- */
-mb_popup.prototype.setHtml = function(htmll){
-	this.options.url=null;
-	this.options.html=htmll;
-	$("#"+this.id+" .jqmnContent").html(htmll);
-}
-
-/**
- * sets the url of the content
- *
- * @param {String} url new url of the popup  
- */
-mb_popup.prototype.setUrl = function(url){
-	this.options.url=url;
-	this.options.html=null;
-	try{
-		eval("window.frames."+this.options.frameName+".location = \""+url+"\"");
-	}catch(e){
-		$("#"+this.id+" .jqmnContent").html('<iframe src="'+url+'"></iframe>');
-	}
-}
-
-/**
- * gets the visible state of the popup window
- * @return visible state of the popup
- * @type Boolean
- */
-mb_popup.prototype.isVisible = function(){
-	return $("#"+this.id+":visible").length>0?true:false;
-}
-
-/**
- * get Scroll position
- */
-function getScrollPos() {  
-	var scrOf ={X:0,Y:0,wW:$(window).width(),dW:$().width(),wH:$(window).height(),dH:$().height()};  
-	
-	if( typeof( window.pageYOffset ) == 'number' ) {  
-		//Netscape compliant  
-		scrOf.Y = window.pageYOffset;  
-		scrOf.X = window.pageXOffset;  
-	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {  
-		//DOM compliant  
-		scrOf.Y = document.body.scrollTop;  
-		scrOf.X = document.body.scrollLeft;  
-	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {  
-		//IE6 standards compliant mode  
-		scrOf.Y = document.documentElement.scrollTop;  
-		scrOf.X = document.documentElement.scrollLeft;  
-	}  
-	return scrOf;  
-}
-
-(function($){
-	$.fn.mbPopup = function(options){
-		//default settings
-		defaults = {
-			left:0,top:0,width:300,height:250,
-			title:"",frameName:"",
-			opacity:1.0,moveOpacity:0.8,html:false,url:false,
-			minWidth:false,maxWidth:false,
-			minHeight:false,maxHeight:false,
-			minTop:"document",minLeft:"document",
-			maxRight:false,maxBottom:false,
-			dragable:true,resizeable:true,balloon:false,
-			style:null,destroy:true,
-			closeCallback:null
-		};
-		//override defaults
-		settings=$.extend(defaults,options)
-		
-		//add Styles
-		this.addClass("jqmNotice");
-		
-		//automated settings for balloon popup
-		if(settings.balloon){
-			var dim = getScrollPos();
-			
-			bubble_height = 80;
-			bubble_width = 100;
-			settings.resizeable = false;
-			settings.dragable = false;
-			settings.hotSpotY=settings.top;
-			settings.hotSpotX=settings.left;
-			position = 0;
-			
-			console ={};
-			console.log = function(){};
-			
-			if(settings.hotSpotY-settings.height-bubble_height-parseInt(this.css("border-top-width"))<dim.Y){
-				//bubble on top
-				settings.top = settings.hotSpotY+bubble_height-parseInt(this.css("border-top-width"));
-			}
-			else{
-				//bubble on bottom
-				settings.top = settings.hotSpotY-settings.height-bubble_height+(top.ie?parseInt(this.css("border-bottom-width")):-parseInt(this.css("border-top-width")));
-				position+=2;
-			}
-			if(settings.hotSpotX+settings.width+parseInt(this.css("border-left-width"))+parseInt(this.css("border-right-width"))>(dim.X+dim.wW)){
-				//bubble on right
-				settings.left = settings.hotSpotX-parseInt(this.css("border-left-width"))-parseInt(this.css("border-right-width"))-settings.width;
-				position++;
-			}
-			else{
-				//bubble on left
-				settings.left = settings.hotSpotX-parseInt(this.css("border-left-width"));
-			}
-
-			$("body").append("<div id='balloon_"+settings.id+"' class='balloon"+(position>=2?"B":"T")+(position%2?"R":"L")+"' style='z-index:"+(popup_top++)+";left:"+(settings.hotSpotX-(position%2?bubble_width:0))+"px;top:"+(settings.hotSpotY-(position>=2?bubble_height:0))+"px'>");
-		}
-		
-		this.css({top:settings.top+"px",
-			left:settings.left+"px",
-			width:settings.width+"px",
-			height:settings.height+"px",
-			opacity:settings.opacity
-			});
-		
-		if(settings.style)
-			this.css(settings.style);
-		
-		//Insert content
-		if(settings.url)
-			html = ('<iframe name="'+settings.frameName+'" src="'+settings.url+'"></iframe>');
-		else
-			html = ('<div class="scrollDiv">'+settings.html+'</div>');
-	
-		this.html('<div class="jqmnTitle jqDrag"><h1>'+settings.title+'</h1></div><div class="jqmnContent">'+html+'</div><img src="../img/close_icon.png" class="jqmClose" alt="close" />'+(settings.resizeable?'<div class="jqResize" />':''));
-	
-		var data = {El:this,fY:settings.minTop,fX:settings.minLeft,tX:settings.maxRight,tY:settings.maxBottom,
-			fW:settings.minWidth,tW:settings.maxWidth,fH:settings.minHeight,tH:settings.maxHeight,
-			destroy:settings.destroy,opacity:settings.opacity,moveOpacity:settings.moveOpacity,close:settings.closeCallback}
-
-		//Make window Dragable
-		if(settings.dragable)
-		$(".jqDrag", this).bind('mousedown',data,function(event){
-			//set to top
-			event.data.El.css("z-index",popup_top++);
-			event.data.El.css('opacity',event.data.moveOpacity)
-			//create helper div to steal mouse events
-			$("body").append("<div style=\"position:absolute;top:0px;left:0px;width:"+$().width()+"px;height:"+$().height()+"px;z-index:"+(popup_top+2)+(top.ie?";background:url(../img/transparent.gif)":"")+"\" id=\"mouse_catcher\"></div>");
-			$("iframe", event.data.El).hide();
-						
-			//Parse setiings of min and max position
-			var data = $.mbPopupFn.parseDimensions(event);
-			
-			//bind mouse events to popup
-				$().bind("mousemove",$.extend(data,{drag:true}),$.mbPopupFn.move).bind('mouseup',event.data,$.mbPopupFn.stop);
-		});
-		
-		//Make Window resizable
-		if(settings.resizeable)
-		$(".jqResize", this).bind('mousedown',data,function(event){
-			//set to top
-			event.data.El.css("z-index",popup_top++);
-			event.data.El.css('opacity',0.8)
-			//create helper div to steal mouse events
-			$("body").append("<div style=\"position:absolute;top:0px;left:0px;width:"+$().width()+"px;height:"+$().height()+"px;z-index:"+(popup_top+2)+(top.ie?";background:url(../img/transparent.gif)":"")+"\" id=\"mouse_catcher\"></div>");
-			$("iframe", event.data.El).hide();
-
-			//Parse setiings of min and max position
-			var data = $.mbPopupFn.parseDimensions(event);
-			
-			//bind mouse events to popup
-				$().bind("mousemove",$.extend(data,{drag:false}),$.mbPopupFn.move).bind('mouseup',event.data,$.mbPopupFn.stop);
-		});
-		
-		//closeButton
-		$(".jqmClose", this).bind('click',data, function(event){
-			if(event.data.close)
-				event.data.close();
-			if(event.data.destroy){
-				event.data.El.slideUp('slow', function(){$(this).remove();});
-				$("#balloon_"+event.data.El.attr("id")).remove();
-			}
-			else{
-				event.data.El.slideUp('slow');
-				$("#balloon_"+event.data.El.attr("id")).fadeOut();
-			}
-		});
-		
-		//raise on click
-		this.click(function(){this.style.zIndex=popup_top++;$("#balloon_"+this.id).css("z-index", popup_top++);});
-		$("#balloon_"+settings.id).click(function(){$("#"+this.id.substr(8)).css("z-index", popup_top++);this.style.zIndex=popup_top++;});
-		
-		//raise top postition
-		popup_top++;
-	};
-	//helper functions
-	$.mbPopupFn = {
-		//on mouse action
-		move:function(event){
-			//drag
-			if(event.data.drag){
-			var newPos = {X:event.data.X+event.pageX-event.data.pX,
-				Y:event.data.Y+event.pageY-event.data.pY};
-			if(event.data.fX!==false&&newPos.X<event.data.fX)
-				newPos.X=event.data.fX;
-			if(event.data.fY!==false&&newPos.Y<event.data.fY)
-				newPos.Y=event.data.fY;
-			if(event.data.tX!==false&&newPos.X>event.data.tX-event.data.W)
-				newPos.X=event.data.tX-event.data.W;
-			if(event.data.tY!==false&&newPos.Y>event.data.tY-event.data.H)
-				newPos.Y=event.data.tY-event.data.H;
-			
-			event.data.El.css({left:newPos.X,top:newPos.Y});
-				return;
-			}
-			//resize
-			var newDim = {W:Math.max(event.pageX-event.data.pX+event.data.W,0),
-				H:Math.max(event.pageY-event.data.pY+event.data.H,0)};
-			if(event.data.fW!==false&&newDim.W<event.data.fW)
-				newDim.W=event.data.fW;
-			if(event.data.fH!==false&&newDim.H<event.data.fH)
-				newDim.H=event.data.fH;
-			if(event.data.tW!==false&&newDim.W>event.data.tW)
-				newDim.W=event.data.tW;
-			if(event.data.tH!==false&&newDim.H>event.data.tH)
-				newDim.H=event.data.tH;
-			if(event.data.tX!==false&&newDim.W+event.data.X>event.data.tX)
-				newDim.W=event.data.tX-event.data.X;
-			if(event.data.tY!==false&&newDim.H+event.data.Y>event.data.tY)
-				newDim.H=event.data.tY-event.data.Y;	
-						
-			event.data.El.css({width:newDim.W,height:newDim.H});
-		},
-		stop:function(event){
-			event.data.El.css('opacity',event.data.opacity)
-			$("iframe", event.data.El).show();
-			$().unbind('mousemove',$.mbPopupFn.move).unbind('mouseup',$.mbPopupFn.stop);
-			$("#mouse_catcher").remove();
-		},
-		stopresize:function(event){
-			event.data.El.css('opacity',event.data.opacity)
-			$("iframe", event.data.El).show();
-			$().unbind('mousemove',$.mbPopupFn.resize).unbind('mouseup',$.mbPopupFn.stopresize);
-			$("#mouse_catcher").remove();
-		},
-		//parse move and resize dimensions
-		parseDimensions:function(d){
-			var dim = getScrollPos();
-			var bd = {X:parseInt($(d.data.El).css("border-left-width"))+parseInt($(d.data.El).css("border-right-width")),
-				Y:parseInt($(d.data.El).css("border-top-width"))+parseInt($(d.data.El).css("border-bottom-width"))};
-			ret = {El:d.data.El,
-				fX:(d.data.fX=="window"?dim.X:(d.data.fX=="document"?0:(d.data.fX<0?dim.dW-d.data.fX:d.data.fX))),
-				fY:(d.data.fX=="window"?dim.Y:(d.data.fY=="document"?0:(d.data.fY<0?dim.dH-d.data.fY:d.data.fY))),
-				tX:(d.data.tX=="window"?dim.X+dim.wW:(d.data.tX=="document"?dim.dW:(d.data.tX<0?dim.dW-d.data.tX:d.data.tX))),
-				tY:(d.data.tY=="window"?dim.Y+dim.wH:(d.data.tY=="document"?dim.dH:(d.data.tH<0?dim.dH-d.data.tH:d.data.tY))),
-				fW:(d.data.fW=="window"?dim.wW:(d.data.fW=="document"?dim.dW:(d.data.fW<0?dim.dW-d.data.fW:d.data.fW))),
-				fH:(d.data.fH=="window"?dim.wH:(d.data.fH=="document"?dim.dH:(d.data.fH<0?dim.dH-d.data.fH:d.data.fH))),
-				tW:(d.data.tW=="window"?dim.wW:(d.data.tW=="document"?dim.dW:(d.data.tW<0?dim.dW-d.data.tW:d.data.tW))),
-				tH:(d.data.tH=="window"?dim.wH:(d.data.tH=="document"?dim.dH:(d.data.tH<0?dim.dH-d.data.tH:d.data.tH))),
-				X:parseInt(d.data.El.css("left")),
-				Y:parseInt(d.data.El.css("top")),
-				W:parseInt(d.data.El.css("width")),
-				H:parseInt(d.data.El.css("height")),
-				pX:d.pageX,pY:d.pageY
-			};
-			if(ret.tX)ret.tX-=bd.X;
-			if(ret.tY)ret.tY-=bd.Y;
-			return ret;	
-		}
-	};
-	})
-(jQuery);
+var popup_count=1;var popup_top=150;function mb_popup(title,html,width,height,posx,posy,fName,opacity){var create_pos=popup_count;for(var i=0;i<popup_count;i++)
+this.id="popup"+String(create_pos);defaults={left:25*create_pos,top:25*create_pos,width:300,height:250,title:"Title",frameName:this.id}
+if(typeof(title)!='object'){this.options=defaults;if(posx)this.options.left=posx;if(posy)this.options.top=posy;if(width)this.options.width=width;if(height)this.options.height=height;if(title)this.options.title=title;if(fName)this.options.frameName=fName;if(opacity)this.options.opacity;if(html){if(html.indexOf("url:")==0)
+this.options.url=html.substr(4);else
+this.options.html=html;}}
+else
+this.options=$.extend(defaults,title);popup_count++;$("body").append("<div style=\"display:none;z-index:"+popup_top+"\" id=\""+this.id+"\"></div>");this.div=$("#"+this.id).mbPopup(this.options);}
+mb_popup.prototype.show=function(){if(!document.getElementById(this.id)){$("body").append("<div style=\"display:none;z-index:"+popup_top+"\" id=\""+this.id+"\"></div>");this.div=$("#"+this.id).mbPopup(this.options);}
+if(!this.isVisible())
+$("#"+this.id).show();}
+mb_popup.prototype.hide=function(){$("#"+this.id).hide();}
+mb_popup.prototype.destroy=function(){$("#"+this.id).remove();}
+mb_popup.prototype.setWidth=function(width){var div=document.getElementById(this.id);if(div)div.style.width=width;}
+mb_popup.prototype.setHeight=function(height){var div=document.getElementById(this.id);if(div)div.style.height=height;}
+mb_popup.prototype.setLeft=function(left){var div=document.getElementById(this.id);if(div)div.style.left=left;}
+mb_popup.prototype.setTop=function(topp){var div=document.getElementById(this.id);if(div)div.style.top=topp;}
+mb_popup.prototype.setOpacity=function(opacityy){var div=document.getElementById(this.id);if(div)div.style.opacity=opacityy;}
+mb_popup.prototype.setTitle=function(title){$("#"+this.id+" h1").text(title);}
+mb_popup.prototype.setHtml=function(htmll){this.options.url=null;this.options.html=htmll;$("#"+this.id+" .jqmnContent").html(htmll);}
+mb_popup.prototype.setUrl=function(url){this.options.url=url;this.options.html=null;try{eval("window.frames."+this.options.frameName+".location = \""+url+"\"");}catch(e){$("#"+this.id+" .jqmnContent").html('<iframe src="'+url+'"></iframe>');}}
+mb_popup.prototype.isVisible=function(){return $("#"+this.id+":visible").length>0?true:false;}
+function getScrollPos(){var scrOf={X:0,Y:0,wW:$(window).width(),dW:$().width(),wH:$(window).height(),dH:$().height()};if(typeof(window.pageYOffset)=='number'){scrOf.Y=window.pageYOffset;scrOf.X=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOf.Y=document.body.scrollTop;scrOf.X=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOf.Y=document.documentElement.scrollTop;scrOf.X=document.documentElement.scrollLeft;}
+return scrOf;}
+(function($){$.fn.mbPopup=function(options){defaults={left:0,top:0,width:300,height:250,title:"",frameName:"",opacity:1.0,moveOpacity:0.8,html:false,url:false,minWidth:false,maxWidth:false,minHeight:false,maxHeight:false,minTop:"document",minLeft:"document",maxRight:false,maxBottom:false,style:null,destroy:true,closeCallback:null};settings=$.extend(defaults,options)
+this.addClass("jqmNotice");this.css({top:settings.top,left:settings.left,width:settings.width,height:settings.height,opacity:settings.opacity});if(settings.style)
+this.css(settings.style);if(settings.url)
+html=('<iframe name="'+settings.frameName+'" src="'+settings.url+'"></iframe>');else
+html=('<div class="scrollDiv">'+settings.html+'</div>');this.html('<div class="jqmnTitle jqDrag"><h1>'+settings.title+'</h1></div><div class="jqmnContent">'+html+'</div><img src="../img/close_icon.png" class="jqmClose" alt="close" /><div class="jqResize" />');var data={El:this,fY:settings.minTop,fX:settings.minLeft,tX:settings.maxRight,tY:settings.maxBottom,fW:settings.minWidth,tW:settings.maxWidth,fH:settings.minHeight,tH:settings.maxHeight,destroy:settings.destroy,opacity:settings.opacity,moveOpacity:settings.moveOpacity,close:settings.closeCallback}
+$(".jqDrag",this).bind('mousedown',data,function(event){event.data.El.css("z-index",popup_top++);event.data.El.css('opacity',event.data.moveOpacity)
+$("body").append("<div style=\"position:absolute;top:0px;left:0px;width:"+$().width()+"px;height:"+$().height()+"px;z-index:"+(popup_top+2)+($.browser.msie?";background:url(../img/transparent.gif)":"")+"\" id=\"mouse_catcher\"></div>");$("iframe",event.data.El).hide();var data=$.mbPopupFn.parseDimensions(event);$().bind("mousemove",data,$.mbPopupFn.drag).bind('mouseup',event.data,$.mbPopupFn.stopdrag);});$(".jqResize",this).bind('mousedown',data,function(event){event.data.El.css("z-index",popup_top++);event.data.El.css('opacity',0.8)
+$("body").append("<div style=\"position:absolute;top:0px;left:0px;width:"+$().width()+"px;height:"+$().height()+"px;z-index:"+(popup_top+2)+($.browser.msie?";background:url(../img/transparent.gif)":"")+"\" id=\"mouse_catcher\"></div>");$("iframe",event.data.El).hide();var data=$.mbPopupFn.parseDimensions(event);$().bind("mousemove",data,$.mbPopupFn.resize).bind('mouseup',event.data,$.mbPopupFn.stopresize);});$(".jqmClose",this).bind('click',data,function(event){if(event.data.close)
+event.data.close();if(event.data.destroy)
+event.data.El.slideUp('slow',function(){$(this).remove();});else
+event.data.El.slideUp('slow');});this.click(function(){this.style.zIndex=popup_top++});};$.mbPopupFn={drag:function(event){var newPos={X:event.data.X+event.pageX-event.data.pX,Y:event.data.Y+event.pageY-event.data.pY};if(event.data.fX!==false&&newPos.X<event.data.fX)
+newPos.X=event.data.fX;if(event.data.fY!==false&&newPos.Y<event.data.fY)
+newPos.Y=event.data.fY;if(event.data.tX!==false&&newPos.X>event.data.tX-event.data.W)
+newPos.X=event.data.tX-event.data.W;if(event.data.tY!==false&&newPos.Y>event.data.tY-event.data.H)
+newPos.Y=event.data.tY-event.data.H;event.data.El.css({left:newPos.X,top:newPos.Y});},resize:function(event){var newDim={W:Math.max(event.pageX-event.data.pX+event.data.W,0),H:Math.max(event.pageY-event.data.pY+event.data.H,0)};if(event.data.fW!==false&&newDim.W<event.data.fW)
+newDim.W=event.data.fW;if(event.data.fH!==false&&newDim.H<event.data.fH)
+newDim.H=event.data.fH;if(event.data.tW!==false&&newDim.W>event.data.tW)
+newDim.W=event.data.tW;if(event.data.tH!==false&&newDim.H>event.data.tH)
+newDim.H=event.data.tH;if(event.data.tX!==false&&newDim.W+event.data.X>event.data.tX)
+newDim.W=event.data.tX-event.data.X;if(event.data.tY!==false&&newDim.H+event.data.Y>event.data.tY)
+newDim.H=event.data.tY-event.data.Y;event.data.El.css({width:newDim.W,height:newDim.H});},stopdrag:function(event){event.data.El.css('opacity',event.data.opacity)
+$("iframe",event.data.El).show();$().unbind('mousemove',$.mbPopupFn.drag).unbind('mouseup',$.mbPopupFn.stopdrag);$("#mouse_catcher").remove();},stopresize:function(event){event.data.El.css('opacity',event.data.opacity)
+$("iframe",event.data.El).show();$().unbind('mousemove',$.mbPopupFn.resize).unbind('mouseup',$.mbPopupFn.stopresize);$("#mouse_catcher").remove();},parseDimensions:function(d){var dim=getScrollPos();return{El:d.data.El,fX:(d.data.fX=="window"?dim.X:(d.data.fX=="document"?0:(d.data.fX<0?dim.dW-d.data.fX:d.data.fX))),fY:(d.data.fX=="window"?dim.Y:(d.data.fY=="document"?0:(d.data.fY<0?dim.dH-d.data.fY:d.data.fY))),tX:(d.data.tX=="window"?dim.X+dim.wW:(d.data.tX=="document"?dim.dW:(d.data.tX<0?dim.dW-d.data.tX:d.data.tX))),tY:(d.data.tY=="window"?dim.Y+dim.wH:(d.data.tY=="document"?dim.dH:(d.data.tH<0?dim.dH-d.data.tH:d.data.tY))),fW:(d.data.fW=="window"?dim.wW:(d.data.fW=="document"?dim.dW:(d.data.fW<0?dim.dW-d.data.fW:d.data.fW))),fH:(d.data.fH=="window"?dim.wH:(d.data.fH=="document"?dim.dH:(d.data.fH<0?dim.dH-d.data.fH:d.data.fH))),tW:(d.data.tW=="window"?dim.wW:(d.data.tW=="document"?dim.dW:(d.data.tW<0?dim.dW-d.data.tW:d.data.tW))),tH:(d.data.tH=="window"?dim.wH:(d.data.tH=="document"?dim.dH:(d.data.tH<0?dim.dH-d.data.tH:d.data.tH))),X:parseInt(d.data.El.css("left")),Y:parseInt(d.data.El.css("top")),W:parseInt(d.data.El.css("width")),H:parseInt(d.data.El.css("height")),pX:d.pageX,pY:d.pageY};}};})
+(jQuery);
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/requestGeometryConstructor.js
===================================================================
--- branches/print_dev/http/javascripts/requestGeometryConstructor.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/requestGeometryConstructor.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,201 +1,20 @@
-/* 
-* $Id: requestGeometryConstructor.js 1882 2007-12-03 09:01:24Z verenadiewald $
-* COPYRIGHT: (C) 2001 by ccgis. This program is free software under the GNU General Public
-* License (>=v2). Read the file gpl.txt that comes with Mapbender for details. 
-*/
-//http://www.mapbender.org/index.php/requestGeometryConstructor.js
-
-/**
- * @class A class representing a constructor for a geometry/WFS request.
- *
- * @constructor
- * @param {String} geomType type of the {@link RequestGeometryConstructor}
- * @param {String} geomType target of the {@link RequestGeometryConstructor}
- */
- function RequestGeometryConstructor(geomTarget){
- 	/**
- 	 * geomTarget target of the {@link RequestGeometryConstructor}
-	 *
-	 * @type String
-	 */
-
-	this.geomTarget = geomTarget;
-	
-	this.getGeometry = function(queryType,callbackFunction){
-		var target = this.geomTarget;
-		s = new Snapping(this.geomTarget);
-		callback = callbackFunction;
-		
-	   	var el = window.frames[target].document;
-	   	el.onmouseover = null;
-	   	el.onmousedown = null;
-	   	el.onmouseup = null;
-	   	el.onmousemove = null;
-	
-		if (queryType == "point") {
-			queryGeom = new Geometry(geomType.point);
-			el.onmousedown = function (e) {
-				mb_getMousePos(e,target);
-				realWorldPos = mapToReal(target,new Point(clickX,clickY));
-				queryGeom.addPoint(realWorldPos);
-				callback(target, queryGeom);
-				el.onmouseover = null;
-	   			el.onmousedown = null;
-	   			el.onmouseup = null;
-	   			el.onmousemove = null;
-				queryGeom = null;
-		   	};
-		}
-		else if (queryType == "polygon") {
-			queryGeom = new Geometry(geomType.polygon);
-			el.onmousedown = wfsSpatialRequestStart;
-			el.onmousemove = wfsSpatialRequestRun;
-		}
-		else if (queryType == "rectangle") {
-			queryGeom = new Geometry(geomType.line);
-			el.onmouseover = selAreaExtInit;
-			el.onmousedown = mod_box_start;
-		   	el.onmouseup = selAreaExtGet;
-		   	el.onmousemove = mod_box_run;
-		}
-		else if (queryType == "extent") {
-			queryGeom = new Geometry(geomType.line);
-			var ind = getMapObjIndexByName(target);
-			var p0 = mapToReal(target, new Point(0,0));
-			var p1 = mapToReal(target, new Point(mb_mapObj[ind].width,mb_mapObj[ind].height)); 
-			queryGeom.addPoint(p0);
-			queryGeom.addPoint(p1);
-			callback(target, queryGeom);
-			el.onmouseover = null;
-   			el.onmousedown = null;
-   			el.onmouseup = null;
-   			el.onmousemove = null;
-			queryGeom = null;
-		}
-		
-	}
-	
-	var s;
-	var callback;
-	
-	var wfsSpatialRequestStart = function(e){
-		this.geomTarget = geomTarget;
-		var that = this;
-		var realWorldPos;
-		if (s.isSnapped() == true) {
-			realWorldPos = s.getSnappedPoint(); 
-			s.clean();
-		}
-		else {
-			mb_getMousePos(e,that.geomTarget);
-			realWorldPos = mapToReal(that.geomTarget,new Point(clickX,clickY));
-		}
-		queryGeom.addPoint(realWorldPos);
-	
-		if (queryGeom.count() == 1) {
-			s.add(queryGeom.get(0));
-		}
-		if (s.isSnapped() && queryGeom.count() >= 3 && queryGeom.get(-1).equals(queryGeom.get(0))) {
-			queryGeom.close();
-			callback(that.geomTarget,queryGeom);
-			writeTag(that.geomTarget,"measuring","");
-			writeTag(that.geomTarget,"measure_display","");
-			var el = window.frames[that.geomTarget].document;
-			el.onmouseover = null;
-   			el.onmousedown = null;
-   			el.onmouseup = null;
-   			el.onmousemove = null;
-			queryGeom = null;
-			return;
-		}
-		drawDashedLineExt();	
-	}
-	
-	var wfsSpatialRequestRun = function(e){
-		this.geomTarget = geomTarget;
-		var that = this;
-		if (queryGeom.count() >= 3) {
-			mb_getMousePos(e,that.geomTarget);
-			var pos = new Point(clickX,clickY);
-			s.check(pos);
-		}
-	}
-	
-	var drawDashedLineExt = function(e){
-		this.geomTarget = geomTarget;
-		var that = this;
-		var ind = getMapObjIndexByName(that.geomTarget);
-		var str_mPoints = "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='"+mb_mapObj[ind].width+"' height='0'></div>";
-		str_mPoints += "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='0' height='"+mb_mapObj[ind].height+"'></div>";
-		if (queryGeom != null) {
-			for(var i=0; i<queryGeom.count(); i++){
-				var pos = realToMap(that.geomTarget,queryGeom.get(i));
-				str_mPoints += "<div style='font-size:1px;position:absolute;top:"+(pos.y-2)+"px;left:"+(pos.x-2)+"px;width:3px;height:3px;background-color:#ff0000'></div>";
-			}
-			if(queryGeom.count()>1){
-				for(var k=1; k<queryGeom.count(); k++){
-					var pos0 = realToMap(that.geomTarget,queryGeom.get(k));
-					var pos1 = realToMap(that.geomTarget,queryGeom.get(k-1));
-					str_mPoints += evaluateDashesExt(pos1,pos0,k);
-				}
-			}
-		}
-		writeTag(that.geomTarget,"measuring",str_mPoints);
-	}
-	
-	var evaluateDashesExt = function(p1,p0,count){
-		this.geomTarget = geomTarget;
-		var that = this;
-		var ind = getMapObjIndexByName(that.geomTarget);
-		var str_dashedLine = "";
-		var d = p0.dist(p1);
-		var n = Math.round(d);
-		var s =  p0.minus(p1).dividedBy(n);
-		for(var i=1; i<n; i++){
-			var currPoint = p1.plus(s.times(i)).minus(new Point(2,2)).round(0); 
-			if(currPoint.x >= 0 && currPoint.x <= mb_mapObj[ind].width && currPoint.y >= 0 && currPoint.y <= mb_mapObj[ind].height){
-				str_dashedLine += "<div style='font-size:1px;position:absolute;top:"+currPoint.y+"px;left:"+currPoint.x+"px;width:3px;height:3px;background-color:#ff0000'></div>";
-			}
-		}
-		return str_dashedLine;
-	}
-	
-	var selAreaExtInit = function(e){
-		this.geomTarget = geomTarget;
-		var that = this;
-   		mb_isBF = that.geomTarget;
-   		mb_zF = that.geomTarget;
-	}
-	
-	var selAreaExtGet = function(e){
-		this.geomTarget = geomTarget;
-		var that = this;
-		selAreaExtSetValidClipping(mod_box_stop(e));
-		mb_isBF = that.geomTarget;
-		mb_zF = that.geomTarget;
-	}
-	
-	var selAreaExtSetValidClipping = function(coords){
-		this.geomTarget = geomTarget;
-		var that = this;
-		if (queryGeom != null) {
-			queryGeom.addPoint(new Point(coords[0],coords[1]));
-			queryGeom.addPoint(new Point(coords[2],coords[3]));
-			
-			if(queryGeom.count() == 2){
-				callback(that.geomTarget,queryGeom);
-				var el = window.frames[that.geomTarget].document;
-				el.onmouseover = null;
-	   			el.onmousedown = null;
-	   			el.onmouseup = null;
-	   			el.onmousemove = null;
-				queryGeom = null;
-			}
-			else{
-				callback(that.geomTarget,queryGeom);
-			}
-		}
-	}	
-}
-
-
+
+function RequestGeometryConstructor(geomTarget){this.geomTarget=geomTarget;this.getGeometry=function(queryType,callbackFunction){var target=this.geomTarget;s=new Snapping(this.geomTarget);callback=callbackFunction;var el=window.frames[target].document;el.onmouseover=null;el.onmousedown=null;el.onmouseup=null;el.onmousemove=null;if(queryType=="point"){queryGeom=new Geometry(geomType.point);el.onmousedown=function(e){mb_getMousePos(e,target);realWorldPos=mapToReal(target,new Point(clickX,clickY));queryGeom.addPoint(realWorldPos);callback(target,queryGeom);el.onmouseover=null;el.onmousedown=null;el.onmouseup=null;el.onmousemove=null;queryGeom=null;};}
+else if(queryType=="polygon"){queryGeom=new Geometry(geomType.polygon);el.onmousedown=wfsSpatialRequestStart;el.onmousemove=wfsSpatialRequestRun;}
+else if(queryType=="rectangle"){queryGeom=new Geometry(geomType.line);el.onmouseover=selAreaExtInit;el.onmousedown=mod_box_start;el.onmouseup=selAreaExtGet;el.onmousemove=mod_box_run;}
+else if(queryType=="extent"){queryGeom=new Geometry(geomType.line);var ind=getMapObjIndexByName(target);var p0=mapToReal(target,new Point(0,0));var p1=mapToReal(target,new Point(mb_mapObj[ind].width,mb_mapObj[ind].height));queryGeom.addPoint(p0);queryGeom.addPoint(p1);callback(target,queryGeom);el.onmouseover=null;el.onmousedown=null;el.onmouseup=null;el.onmousemove=null;queryGeom=null;}}
+var s;var callback;var wfsSpatialRequestStart=function(e){this.geomTarget=geomTarget;var that=this;var realWorldPos;if(s.isSnapped()==true){realWorldPos=s.getSnappedPoint();s.clean();}
+else{mb_getMousePos(e,that.geomTarget);realWorldPos=mapToReal(that.geomTarget,new Point(clickX,clickY));}
+queryGeom.addPoint(realWorldPos);if(queryGeom.count()==1){s.add(queryGeom.get(0));}
+if(s.isSnapped()&&queryGeom.count()>=3&&queryGeom.get(-1).equals(queryGeom.get(0))){queryGeom.close();callback(that.geomTarget,queryGeom);writeTag(that.geomTarget,"measuring","");writeTag(that.geomTarget,"measure_display","");var el=window.frames[that.geomTarget].document;el.onmouseover=null;el.onmousedown=null;el.onmouseup=null;el.onmousemove=null;queryGeom=null;return;}
+drawDashedLineExt();}
+var wfsSpatialRequestRun=function(e){this.geomTarget=geomTarget;var that=this;if(queryGeom.count()>=3){mb_getMousePos(e,that.geomTarget);var pos=new Point(clickX,clickY);s.check(pos);}}
+var drawDashedLineExt=function(e){this.geomTarget=geomTarget;var that=this;var ind=getMapObjIndexByName(that.geomTarget);var str_mPoints="<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='"+mb_mapObj[ind].width+"' height='0'></div>";str_mPoints+="<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='0' height='"+mb_mapObj[ind].height+"'></div>";if(queryGeom!=null){for(var i=0;i<queryGeom.count();i++){var pos=realToMap(that.geomTarget,queryGeom.get(i));str_mPoints+="<div style='font-size:1px;position:absolute;top:"+(pos.y-2)+"px;left:"+(pos.x-2)+"px;width:3px;height:3px;background-color:#ff0000'></div>";}
+if(queryGeom.count()>1){for(var k=1;k<queryGeom.count();k++){var pos0=realToMap(that.geomTarget,queryGeom.get(k));var pos1=realToMap(that.geomTarget,queryGeom.get(k-1));str_mPoints+=evaluateDashesExt(pos1,pos0,k);}}}
+writeTag(that.geomTarget,"measuring",str_mPoints);}
+var evaluateDashesExt=function(p1,p0,count){this.geomTarget=geomTarget;var that=this;var ind=getMapObjIndexByName(that.geomTarget);var str_dashedLine="";var d=p0.dist(p1);var n=Math.round(d);var s=p0.minus(p1).dividedBy(n);for(var i=1;i<n;i++){var currPoint=p1.plus(s.times(i)).minus(new Point(2,2)).round(0);if(currPoint.x>=0&&currPoint.x<=mb_mapObj[ind].width&&currPoint.y>=0&&currPoint.y<=mb_mapObj[ind].height){str_dashedLine+="<div style='font-size:1px;position:absolute;top:"+currPoint.y+"px;left:"+currPoint.x+"px;width:3px;height:3px;background-color:#ff0000'></div>";}}
+return str_dashedLine;}
+var selAreaExtInit=function(e){this.geomTarget=geomTarget;var that=this;mb_isBF=that.geomTarget;mb_zF=that.geomTarget;}
+var selAreaExtGet=function(e){this.geomTarget=geomTarget;var that=this;selAreaExtSetValidClipping(mod_box_stop(e));mb_isBF=that.geomTarget;mb_zF=that.geomTarget;}
+var selAreaExtSetValidClipping=function(coords){this.geomTarget=geomTarget;var that=this;if(queryGeom!=null){queryGeom.addPoint(new Point(coords[0],coords[1]));queryGeom.addPoint(new Point(coords[2],coords[3]));if(queryGeom.count()==2){callback(that.geomTarget,queryGeom);var el=window.frames[that.geomTarget].document;el.onmouseover=null;el.onmousedown=null;el.onmouseup=null;el.onmousemove=null;queryGeom=null;}
+else{callback(that.geomTarget,queryGeom);}}}}
\ No newline at end of file

Added: branches/print_dev/http/javascripts/style.js
===================================================================
--- branches/print_dev/http/javascripts/style.js	                        (rev 0)
+++ branches/print_dev/http/javascripts/style.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1,4 @@
+
+var StyleTag=function(){var createStyleTag=function(){if($.browser.msie){styleSheetObj=document.styleSheets[0];}
+else{styleObj=document.createElement("style");styleObj.setAttribute("type","text/css");document.getElementsByTagName("head")[0].appendChild(styleObj);}};this.addClass=function(className,cssString){if($.browser.msie){var cssRules=cssString.split(";");for(i=0;i<cssRules.length-1;i++){styleSheetObj.addRule("."+className,cssRules[i]);}}
+else{styleObj.appendChild(document.createTextNode("."+className+"{\n\t"+cssString+"\n}\n"));}};var styleObj;var styleSheetObj;createStyleTag();};
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/wfs.js
===================================================================
--- branches/print_dev/http/javascripts/wfs.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/wfs.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,360 +1,71 @@
-<?php
-#$Id$
-#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_wfs_spatialRequest.php,v 1.4 2006/03/08 15:26:26 c_baudson Exp $
-# 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.
-
-session_start();
-import_request_variables("PG");
-require_once(dirname(__FILE__) . "/../php/mb_validateSession.php");
-require_once(dirname(__FILE__) . "/../../conf/mapbender.conf");
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
-
-$e_id_css = "wfs";
-include '../include/dyn_js.php';
-require_once(dirname(__FILE__) . "/wfs_usemap.js");
-?>
-var highlight_tag_id = "wfs_highlight_tag";
-var mb_wfs_fetched = [];
-
-
-var mb_wfs_target = "mapframe1";
-var mb_wfs_objwin = null;
-var mb_wfs_objwin_left = 800;
-var mb_wfs_objwin_top = 200;
-var mb_wfs_objwin_width = 200;
-var mb_wfs_objwin_height = 200;
-var mb_wfs_targets = new Array("mapframe1","overview");
-var mb_wfs_fillColor = "#ff0000";
-var usemap = "";
-var mod_usemap_radius = 10;
-var mod_usemap_line_tolerance = 5;
-var useCheckboxForHighlighting = false;
-
-var mb_wfs_fetch = new GeometryArray();
-
-var highlight;
-
-try {if(generalHighlightZIndex){}}catch(e) {generalHighlightZIndex = 90;}
-try {if(generalHighlightLineWidth){}}catch(e) {generalHighlightLineWidth = 2;}
-try {if(useUsemap){}}catch(e) {useUsemap = 0;}
-
-mb_registerInitFunctions('initHighlight()');
-
-function initHighlight() {
-	var styleObj = {"position":"absolute", "top":"0px", "left":"0px", "z-index":generalHighlightZIndex};
-	highlight = new Highlight(mb_wfs_targets, highlight_tag_id, styleObj, generalHighlightLineWidth);
-}
-try {if(displayWfsResultList){}}catch(e) {displayWfsResultList = 0;};
-
-if (displayWfsResultList == 1) {
-	//mb_registerWfsReadSubFunctions(function(geom){mb_wfs_listMember(geom)});
-}
-
-
-if (parseInt(useUsemap) == 1) {
-	mb_registerSubFunctions('mod_usemap("")');
-}
-
-if (useCheckboxForHighlighting) {
-	eventInit.register(function() {
-		mb_registerSubFunctions('highlight.paint()');
-	});
-}
-
-/*
-if (useExtentIsSet()) {
-	mb_registerSubFunctions("mb_setwfsrequest_extent()");
-}
-function mb_setwfsrequest_extent() {
-
-	if (useExtentIsSet()) {
-		var ind = getMapObjIndexByName(mb_wfs_targets[0]);
-		var pos_a = makeClickPos2RealWorldPos(mb_wfs_targets[0],0,0);
-		var pos_b = makeClickPos2RealWorldPos(mb_wfs_targets[0],mb_mapObj[ind].width,mb_mapObj[ind].height);
-	
-		var x = [];
-		var y = [];
-		x[0] = pos_a[0];
-		x[1] = pos_b[0];
-		y[0] = pos_a[1];
-		y[1] = pos_b[1];
-		
-		mb_setwfsrequest(mb_wfs_targets[0],'rectangle',x,y);
-	}
-}
-*/
-
-function mb_wfs_listMember(geomArray){
-	mb_wfs_fetch.union(geomArray);
-	var wfs_conf = get_complete_wfs_conf();
-	var str = "<table>";
-	for(var i=0; i<mb_wfs_fetch.count(); i++){
-		var t = wfs_conf[mb_wfs_fetch.get(i).wfs_conf];
-		for(var j=0; j<t['element'].length; j++){
-			if(t['element'][j]['f_show'] > 0){
-				var k = mb_wfs_fetch.get(i).e.getElementIndexByName(t['element'][j]['element_name']);
-				//alert(k);
-				if(k != -1){
-					str += "<tr><td>";
-					if (useCheckboxForHighlighting) {
-						str += "<input type=checkbox id=highlightCheckbox" + i + " onChange='highlightGeometry(" + i + ")'></td><td>";
-					}
-					str += "<div";
-					if (!useCheckboxForHighlighting) {
-						str += " onmouseover='mb_wfs_perform(\"over\",mb_wfs_fetch.get("+i+"))' ";
-						str += " onmouseout='mb_wfs_perform(\"out\",mb_wfs_fetch.get("+i+"))' ";
-					}
-					str += " onclick='mb_wfs_perform(\"click\",mb_wfs_fetch.get("+i+"))' ";
-					str += ">" + mb_wfs_fetch.get(i).e.getValue(k)+ "</div></td></tr>";
-				}
-			}
-		}
-	}
-	str += "</table>";
-	mb_wfs_objwin.innerHTML = str;
-//	if (parseInt(useUsemap) == 1) mod_usemap(wfs_name);
-}
-
-function mb_wfs_reset(){
-	mb_wfs_fetch = new parent.GeometryArray();
-	usemap = "";
-	
-	if(mb_wfs_objwin == null){
-		var iframe=document.createElement('div');
-		iframe.setAttribute("style","position:absolute;left:"+mb_wfs_objwin_left+"px;top:"+mb_wfs_objwin_top+"px;width:"+mb_wfs_objwin_width+"px;height:"+mb_wfs_objwin_height+"px");
-		mb_wfs_objwin = document.body.appendChild(iframe);
-		mb_wfs_objwin.id = "mb_wfs_objwin";
-		mb_wfs_objwin.name = "mb_wfs_objwin";
-		mb_wfs_objwin.style.position = 'absolute';
-		mb_wfs_objwin.style.left = mb_wfs_objwin_left+"px";
-		mb_wfs_objwin.style.top = mb_wfs_objwin_top+"px";
-		mb_wfs_objwin.style.width = mb_wfs_objwin_width+"px";
-		mb_wfs_objwin.style.height = mb_wfs_objwin_height+"px";
-	}
-	for(var i=0; i<mb_wfsreq; i++){
-		if(document.getElementById("mb_wfs_win_"+mb_wfsreq)){
-			document.removeChild("mb_wfs_win_"+mb_wfsreq);
-		}
-	}
-	mb_wfsreq = 0;
-	return true;
-}
-
-function get_complete_wfs_conf() {
-	var wfs_conf = window.frames["wfs_conf"].get_wfs_conf();
-	return wfs_conf;
-}
-
-function highlightGeometry(i) {
-	var id = "highlightCheckbox"+i;
-	if (document.getElementById(id).checked) {
-		highlight.add(mb_wfs_fetch.get(i), '#00ff00');
-		highlight.paint();
-	}
-	else {
-		highlight.del(mb_wfs_fetch.get(i), '#00ff00');
-		highlight.paint();
-	}
-}
-
-function mb_wfs_perform(type,m){
-
-	var wfs_conf = window.frames["wfs_conf"].get_wfs_conf();
-	if(type=='over') {
-		highlight.add(m, '#ff0000');
-		highlight.paint();
-	}
-	else if (type == 'out') {
-		highlight.del(m, '#ff0000');
-		highlight.paint();
-	}
-	else 
-		if (type == 'click') {
-			var tmp = m.getBBox();
-			if (m.geomType == geomType.point) {
-				var b = 1;
-			}
-			else {
-				var b = 0;
-			}
-			if (typeof(m.wfs_conf) != "undefined") {
-				b = parseFloat(wfs_conf[m.wfs_conf]['g_buffer']);
-			}
-			var buffer = new Point(b, b);
-			var bbox_ll = tmp[0].minus(buffer);
-			var bbox_ru = tmp[1].plus(buffer);
-			mb_calcExtent(mb_wfs_targets[0], bbox_ll, bbox_ru);
-			zoom(mb_wfs_targets[0], 'true', 1.0);
-		}
-}
-
-function get_wfs_str(myconf, d, m, type, fid) {
-
-	<!-- Getting the Namspace for the FeautureType -->	
-	var featureTypeArray = myconf['featuretype_name'].split(':')
-	var featureNS = featureTypeArray[0];
-
-	var str = '<wfs:Transaction version="1.0.0" service="WFS" ';
-
-	var ns_gml = false;	var ns_ogc = false;	var ns_xsi = false;	var ns_wfs = false;	var ns_featureNS = false;
-	
-	for (var q = 0 ; q < myconf['namespaces'].length ; q++) {
-	
-		if (myconf['namespaces'][q]['name'] == "gml"){		
-			 ns_gml = true;
-			 str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
-		} else if (myconf['namespaces'][q]['name'] == "ogc") {
-			ns_ogc = true;
-			str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
-		} else if (myconf['namespaces'][q]['name'] == "xsi") {
-			ns_xsi = true;
-			str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
-		} else if (myconf['namespaces'][q]['name'] == "wfs") {
-			ns_wfs = true;
-			str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
-		} else if (myconf['namespaces'][q]['name'] == featureNS) {
-			ns_featureNS = true;
-			str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" '
-			strForSchemaLocation = myconf['namespaces'][q]['location'];
-		}
-	}
-	
-	if (ns_gml == false) str += 'xmlns:gml="http://www.opengis.net/gml" ';
-	if (ns_ogc == false) str += 'xmlns:ogc="http://www.opengis.net/ogc" ';
-	if (ns_xsi == false) str += 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ';
-	if (ns_featureNS == false) str += 'xmlns:"+featureNS+"="http://www.someserver.com/"+featureNS+"" ';
-	if (ns_wfs == false) str += 'xmlns:wfs="http://www.opengis.net/wfs" ';
-	
-	str += 'xsi:schemaLocation="http://www.opengis.net/wfs';
-	str += ' http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd';
-	str += ' ' + strForSchemaLocation;
-	str += ' '+ myconf['wfs_describefeaturetype'];
-	//str += mb_getConjunctionCharacter(myconf['wfs_describefeaturetype']);
-	//str += 'typename=' + myconf['featuretype_name'];
-	str += '">';
-
-	//
-	// ---------------------------------------- SAVE -------------------------------------------------
-	//
-	if (type == "save") {
-		str += '<wfs:Insert><'+ myconf['featuretype_name']+'>';
-		for(var i=0; i<d.get(m).e.count(); i++){
-			if(d.get(m).e.getValue(i) != "" && d.get(m).e.getName(i) != "fid"){
-				var tmp = d.get(m).e.getName(i);
-				str += '<' + tmp  + '>' + d.get(m).e.getValue(i) + '</' + tmp  + '>';
-			}
-		}
-		for(var j=0; j<myconf['element'].length; j++){
-			if(myconf['element'][j]['f_geom'] == 1){
-				var el_geom = myconf['element'][j]['element_name'];	
-			}
-		}
-		str += '<' + el_geom + '>';	
-		if(d.get(m).geomType == geomType.point){
-			str += '<gml:Point srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:coordinates>';
-			str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y; 
-			str += '</gml:coordinates>';
-			str += '</gml:Point>';		
-		}
-		if(d.get(m).geomType == geomType.line){
-			str += '<gml:MultiLineString srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:lineStringMember><gml:LineString><gml:coordinates>';
-			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";	
-				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			} 
-			str += '</gml:coordinates></gml:LineString></gml:lineStringMember>';
-			str += '</gml:MultiLineString>';
-		}
-		if(d.get(m).geomType == geomType.polygon){
-			str += '<gml:MultiPolygon srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';
-
-			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";	
-				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			} 
-			str += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>';
-		}
-		str += '</' + el_geom + '></'+ myconf['featuretype_name']+'></wfs:Insert>';		
-	}
-	//
-	// --------------------------------------- UPDATE ------------------------------------------------
-	//
-	else if (type == "update") {
-		str += '<wfs:Update typeName="'+ myconf['featuretype_name']+'">';
-		for(var i=0; i<d.get(m).e.count(); i++){
-			if(d.get(m).e.getValue(i) != "" && d.get(m).e.getName(i) != "fid"){
-				str += '<wfs:Property>';
-				str += '<wfs:Name>'+d.get(m).e.getName(i)+'</wfs:Name>';
-				str += '<wfs:Value>'+d.get(m).e.getValue(i)+'</wfs:Value>';
-				str += '</wfs:Property>';
-			}
-		}
-		for(var j=0; j<myconf['element'].length; j++){
-			if(myconf['element'][j]['f_geom'] == 1){
-				var el_geom = myconf['element'][j]['element_name'];	
-			}
-		}
-		str += '<wfs:Property><wfs:Name>' + el_geom + '</wfs:Name><wfs:Value>';
-		if(d.get(m).geomType == geomType.point){
-			str += '<gml:Point srsName="' + myconf['featuretype_srs'] + '"><gml:coordinates>';
-			str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y; 
-			str += '</gml:coordinates></gml:Point>';		
-		}
-		if(d.get(m).geomType == geomType.line){
-			str += '<gml:MultiLineString srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:lineStringMember><gml:LineString><gml:coordinates>';
-			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";	
-				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			} 
-			str += '</gml:coordinates></gml:LineString></gml:lineStringMember>';
-			str += '</gml:MultiLineString>';
-		}
-		if(d.get(m).geomType == geomType.polygon){
-			str += '<gml:MultiPolygon srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';
-			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";	
-				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			} 
-			str += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>';
-		}
-		str += '</wfs:Value></wfs:Property>';
-		str += '<ogc:Filter><ogc:FeatureId fid="'+fid+'"/></ogc:Filter>';
-		str += '</wfs:Update>';
-	}
-	//
-	// --------------------------------------- DELETE ------------------------------------------------
-	//
-	else if (type == "delete") {
-		str += '<wfs:Delete typeName="'+ myconf['featuretype_name']+'">';
-		for(var j=0; j<myconf['element'].length; j++){
-			if(myconf['element'][j]['f_geom'] == 1){
-				var el_geom = myconf['element'][j]['element_name'];	
-			}
-		}
-		str += '<ogc:Filter><ogc:FeatureId fid="'+fid+'"/></ogc:Filter>';
-		str += '</wfs:Delete>';
-	}
-	
-	str += '</wfs:Transaction>';
-	return str;
-}
+
+function mod_usemap(wfs_name){if(wfs_name==""){usemap="";}
+var ind=getMapObjIndexByName(mb_wfs_target);var myImg=window.frames[mb_wfs_target].document.getElementById("um_img").style;myImg.width=mb_mapObj[ind].width;myImg.height=mb_mapObj[ind].height;for(var i=0;i<mb_wfs_fetch.count();i++){if(mb_wfs_fetch.get(i).wfs_conf==wfs_name||wfs_name==""){if(mb_wfs_fetch.get(i).geomType==geomType.polygon){usemap+=mod_usemap_polygon(i);}
+else if(mb_wfs_fetch.get(i).geomType==geomType.point){usemap+=mod_usemap_circle(i);}
+else if(mb_wfs_fetch.get(i).geomType==geomType.line){usemap+=mod_usemap_line(i);}}}
+writeUsemap(usemap);}
+function mod_usemap_circle(ind){var str="";var coord="";var title="";for(var i=0;i<mb_wfs_fetch.get(ind).e.count();i++){if(i>0)title+="&#10;";title+=mb_wfs_fetch.get(ind).e.getName(i)+": "+mb_wfs_fetch.get(ind).e.getValue(i);}
+for(var i=0;i<mb_wfs_fetch.get(ind).count();i++){var p=mb_wfs_fetch.getPoint(ind,i,0);var pos=realToMap(mb_wfs_target,p);coord+=pos.x+", "+pos.y;str+="<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";str+="onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='circle'  coords='";str+=coord+", "+mod_usemap_radius+"' href='#'>";}
+return str;}
+function mod_usemap_line_calculate(aGeometry,j,orientation,cnt){var coord="";var p1=realToMap(mb_wfs_targets[0],aGeometry.get(j));var p2=realToMap(mb_wfs_targets[0],aGeometry.get(j+orientation));var vec=p2.minus(p1);if(vec.x!=0||vec.y!=0){var n_vec;if(vec.x!=0){if(vec.x>0)n_vec=new Point((-vec.y)/vec.x,-1);else n_vec=new Point(vec.y/vec.x,1);}
+else{if(vec.y>0)n_vec=new Point(1,0);else n_vec=new Point(-1,0);}
+n_vec=n_vec.times(mod_usemap_line_tolerance).dividedBy(n_vec.dist(new Point(0,0)))
+lp=new Point(p1.x+n_vec.x,p1.y-n_vec.y);if(cnt>0)coord+=", ";coord+=parseInt(lp.x)+", "+parseInt(lp.y);coord+=", "+parseInt(lp.x+vec.x)+", "+parseInt(lp.y+vec.y);}
+return coord;}
+function mod_usemap_line(ind){var str="";var title="";for(var i=0;i<mb_wfs_fetch.get(ind).e.count();i++){if(i>0)title+="&#10;";title+=mb_wfs_fetch.get(ind).e.getName(i)+": "+mb_wfs_fetch.get(ind).e.getValue(i);}
+for(var i=0;i<mb_wfs_fetch.get(ind).count();i++){var coord="";var cnt=0;for(var j=0;j<mb_wfs_fetch.getGeometry(ind,i).count()-1;j++){var result=mod_usemap_line_calculate(mb_wfs_fetch.getGeometry(ind,i),j,1,cnt);if(result!=""){coord+=result;cnt++;}}
+for(var j=(mb_wfs_fetch.getGeometry(ind,i).count()-1);j>0;j--){var result=mod_usemap_line_calculate(mb_wfs_fetch.getGeometry(ind,i),j,-1,cnt);if(result!=""){coord+=result;cnt++;}}
+if(coord!=""){str+="<AREA title='"+title+"'";str+="onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";str+="onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' ";str+="shape='poly'  coords='";str+=coord+"' href='#'>";}
+else{var pos=realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind,i,0));coord+=pos.x+", "+pos.y;str+="<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch["+ind+"])' ";str+="onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='circle'  coords='";str+=coord+", "+mod_usemap_radius+"' href='#'>";}}
+return str;}
+function mod_usemap_polygon(ind){var str="";var coord="";var title="";for(var i=0;i<mb_wfs_fetch.get(ind).e.count();i++){if(i>0)title+="&#10;";title+=mb_wfs_fetch.get(ind).e.getName(i)+": "+mb_wfs_fetch.get(ind).e.getValue(i);}
+for(var i=0;i<mb_wfs_fetch.get(ind).count();i++){var pos=realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind,i,0));coord+=pos.x+", "+pos.y;for(var j=1;j<mb_wfs_fetch.getGeometry(ind,i).count();j++){pos=realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind,i,j));coord+=", "+pos.x+", "+pos.y;}
+str+="<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";str+="onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='poly'  coords='";str+=coord+"' href='#'>";}
+return str;}
+function writeUsemap(str){writeTag(mb_wfs_targets[0],'um',str);}
+var highlight_tag_id="wfs_highlight_tag";var mb_wfs_fetched=[];var mb_wfs_target="mapframe1";var mb_wfs_objwin=null;var mb_wfs_objwin_left=800;var mb_wfs_objwin_top=200;var mb_wfs_objwin_width=200;var mb_wfs_objwin_height=200;var mb_wfs_targets=new Array("mapframe1","overview");var mb_wfs_fillColor="#ff0000";var usemap="";var mod_usemap_radius=10;var mod_usemap_line_tolerance=5;var useCheckboxForHighlighting=false;var mb_wfs_fetch=new GeometryArray();var highlight;try{if(generalHighlightZIndex){}}catch(e){generalHighlightZIndex=90;}
+try{if(generalHighlightLineWidth){}}catch(e){generalHighlightLineWidth=2;}
+try{if(useUsemap){}}catch(e){useUsemap=0;}
+mb_registerInitFunctions('initHighlight()');function initHighlight(){var styleObj={"position":"absolute","top":"0px","left":"0px","z-index":generalHighlightZIndex};highlight=new Highlight(mb_wfs_targets,highlight_tag_id,styleObj,generalHighlightLineWidth);}
+try{if(displayWfsResultList){}}catch(e){displayWfsResultList=0;};if(displayWfsResultList==1){}
+if(parseInt(useUsemap)==1){mb_registerSubFunctions('mod_usemap("")');}
+if(useCheckboxForHighlighting){eventInit.register(function(){mb_registerSubFunctions('highlight.paint()');});}
+function mb_wfs_listMember(geomArray){mb_wfs_fetch.union(geomArray);var wfs_conf=get_complete_wfs_conf();var str="<table>";for(var i=0;i<mb_wfs_fetch.count();i++){var t=wfs_conf[mb_wfs_fetch.get(i).wfs_conf];for(var j=0;j<t['element'].length;j++){if(t['element'][j]['f_show']>0){var k=mb_wfs_fetch.get(i).e.getElementIndexByName(t['element'][j]['element_name']);if(k!=-1){str+="<tr><td>";if(useCheckboxForHighlighting){str+="<input type=checkbox id=highlightCheckbox"+i+" onChange='highlightGeometry("+i+")'></td><td>";}
+str+="<div";if(!useCheckboxForHighlighting){str+=" onmouseover='mb_wfs_perform(\"over\",mb_wfs_fetch.get("+i+"))' ";str+=" onmouseout='mb_wfs_perform(\"out\",mb_wfs_fetch.get("+i+"))' ";}
+str+=" onclick='mb_wfs_perform(\"click\",mb_wfs_fetch.get("+i+"))' ";str+=">"+mb_wfs_fetch.get(i).e.getValue(k)+"</div></td></tr>";}}}}
+str+="</table>";mb_wfs_objwin.innerHTML=str;}
+function mb_wfs_reset(){mb_wfs_fetch=new parent.GeometryArray();usemap="";if(mb_wfs_objwin==null){var iframe=document.createElement('div');iframe.setAttribute("style","position:absolute;left:"+mb_wfs_objwin_left+"px;top:"+mb_wfs_objwin_top+"px;width:"+mb_wfs_objwin_width+"px;height:"+mb_wfs_objwin_height+"px");mb_wfs_objwin=document.body.appendChild(iframe);mb_wfs_objwin.id="mb_wfs_objwin";mb_wfs_objwin.name="mb_wfs_objwin";mb_wfs_objwin.style.position='absolute';mb_wfs_objwin.style.left=mb_wfs_objwin_left+"px";mb_wfs_objwin.style.top=mb_wfs_objwin_top+"px";mb_wfs_objwin.style.width=mb_wfs_objwin_width+"px";mb_wfs_objwin.style.height=mb_wfs_objwin_height+"px";}
+for(var i=0;i<mb_wfsreq;i++){if(document.getElementById("mb_wfs_win_"+mb_wfsreq)){document.removeChild("mb_wfs_win_"+mb_wfsreq);}}
+mb_wfsreq=0;return true;}
+function get_complete_wfs_conf(){var wfs_conf=window.frames["wfs_conf"].get_wfs_conf();return wfs_conf;}
+function highlightGeometry(i){var id="highlightCheckbox"+i;if(document.getElementById(id).checked){highlight.add(mb_wfs_fetch.get(i),'#00ff00');highlight.paint();}
+else{highlight.del(mb_wfs_fetch.get(i),'#00ff00');highlight.paint();}}
+function mb_wfs_perform(type,m){var wfs_conf=window.frames["wfs_conf"].get_wfs_conf();if(type=='over'){highlight.add(m,'#ff0000');highlight.paint();}
+else if(type=='out'){highlight.del(m,'#ff0000');highlight.paint();}
+else
+if(type=='click'){var tmp=m.getBBox();if(m.geomType==geomType.point){var b=1;}
+else{var b=0;}
+if(typeof(m.wfs_conf)!="undefined"){b=parseFloat(wfs_conf[m.wfs_conf]['g_buffer']);}
+var buffer=new Point(b,b);var bbox_ll=tmp[0].minus(buffer);var bbox_ru=tmp[1].plus(buffer);mb_calcExtent(mb_wfs_targets[0],bbox_ll,bbox_ru);zoom(mb_wfs_targets[0],'true',1.0);}}
+function get_wfs_str(myconf,d,m,type,fid){<!--Getting the Namspace for the FeautureType-->var featureTypeArray=myconf['featuretype_name'].split(':')
+var featureNS=featureTypeArray[0];var str='<wfs:Transaction version="1.0.0" service="WFS" ';var ns_gml=false;var ns_ogc=false;var ns_xsi=false;var ns_wfs=false;var ns_featureNS=false;for(var q=0;q<myconf['namespaces'].length;q++){if(myconf['namespaces'][q]['name']=="gml"){ns_gml=true;str+='xmlns:'+myconf['namespaces'][q]['name']+'="'+myconf['namespaces'][q]['location']+'" ';}else if(myconf['namespaces'][q]['name']=="ogc"){ns_ogc=true;str+='xmlns:'+myconf['namespaces'][q]['name']+'="'+myconf['namespaces'][q]['location']+'" ';}else if(myconf['namespaces'][q]['name']=="xsi"){ns_xsi=true;str+='xmlns:'+myconf['namespaces'][q]['name']+'="'+myconf['namespaces'][q]['location']+'" ';}else if(myconf['namespaces'][q]['name']=="wfs"){ns_wfs=true;str+='xmlns:'+myconf['namespaces'][q]['name']+'="'+myconf['namespaces'][q]['location']+'" ';}else if(myconf['namespaces'][q]['name']==featureNS){ns_featureNS=true;str+='xmlns:'+myconf['namespaces'][q]['name']+'="'+myconf['namespaces'][q]['location']+'" '
+strForSchemaLocation=myconf['namespaces'][q]['location'];}}
+if(ns_gml==false)str+='xmlns:gml="http://www.opengis.net/gml" ';if(ns_ogc==false)str+='xmlns:ogc="http://www.opengis.net/ogc" ';if(ns_xsi==false)str+='xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ';if(ns_featureNS==false)str+='xmlns:"+featureNS+"="http://www.someserver.com/"+featureNS+"" ';if(ns_wfs==false)str+='xmlns:wfs="http://www.opengis.net/wfs" ';str+='xsi:schemaLocation="http://www.opengis.net/wfs';str+=' http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd';str+=' '+strForSchemaLocation;str+=' '+myconf['wfs_describefeaturetype'];str+='">';if(type=="save"){str+='<wfs:Insert><'+myconf['featuretype_name']+'>';for(var i=0;i<d.get(m).e.count();i++){if(d.get(m).e.getValue(i)!=""&&d.get(m).e.getName(i)!="fid"){var tmp=d.get(m).e.getName(i);str+='<'+tmp+'>'+d.get(m).e.getValue(i)+'</'+tmp+'>';}}
+for(var j=0;j<myconf['element'].length;j++){if(myconf['element'][j]['f_geom']==1){var el_geom=myconf['element'][j]['element_name'];}}
+str+='<'+el_geom+'>';if(d.get(m).geomType==geomType.point){str+='<gml:Point srsName="'+myconf['featuretype_srs']+'">';str+='<gml:coordinates>';str+=d.getPoint(m,0,0).x+","+d.getPoint(m,0,0).y;str+='</gml:coordinates>';str+='</gml:Point>';}
+if(d.get(m).geomType==geomType.line){str+='<gml:MultiLineString srsName="'+myconf['featuretype_srs']+'">';str+='<gml:lineStringMember><gml:LineString><gml:coordinates>';for(var k=0;k<d.getGeometry(m,0).count();k++){if(k>0)str+=" ";str+=d.getPoint(m,0,k).x+","+d.getPoint(m,0,k).y;}
+str+='</gml:coordinates></gml:LineString></gml:lineStringMember>';str+='</gml:MultiLineString>';}
+if(d.get(m).geomType==geomType.polygon){str+='<gml:MultiPolygon srsName="'+myconf['featuretype_srs']+'">';str+='<gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';for(var k=0;k<d.getGeometry(m,0).count();k++){if(k>0)str+=" ";str+=d.getPoint(m,0,k).x+","+d.getPoint(m,0,k).y;}
+str+='</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>';}
+str+='</'+el_geom+'></'+myconf['featuretype_name']+'></wfs:Insert>';}
+else if(type=="update"){str+='<wfs:Update typeName="'+myconf['featuretype_name']+'">';for(var i=0;i<d.get(m).e.count();i++){if(d.get(m).e.getValue(i)!=""&&d.get(m).e.getName(i)!="fid"){str+='<wfs:Property>';str+='<wfs:Name>'+d.get(m).e.getName(i)+'</wfs:Name>';str+='<wfs:Value>'+d.get(m).e.getValue(i)+'</wfs:Value>';str+='</wfs:Property>';}}
+for(var j=0;j<myconf['element'].length;j++){if(myconf['element'][j]['f_geom']==1){var el_geom=myconf['element'][j]['element_name'];}}
+str+='<wfs:Property><wfs:Name>'+el_geom+'</wfs:Name><wfs:Value>';if(d.get(m).geomType==geomType.point){str+='<gml:Point srsName="'+myconf['featuretype_srs']+'"><gml:coordinates>';str+=d.getPoint(m,0,0).x+","+d.getPoint(m,0,0).y;str+='</gml:coordinates></gml:Point>';}
+if(d.get(m).geomType==geomType.line){str+='<gml:MultiLineString srsName="'+myconf['featuretype_srs']+'">';str+='<gml:lineStringMember><gml:LineString><gml:coordinates>';for(var k=0;k<d.getGeometry(m,0).count();k++){if(k>0)str+=" ";str+=d.getPoint(m,0,k).x+","+d.getPoint(m,0,k).y;}
+str+='</gml:coordinates></gml:LineString></gml:lineStringMember>';str+='</gml:MultiLineString>';}
+if(d.get(m).geomType==geomType.polygon){str+='<gml:MultiPolygon srsName="'+myconf['featuretype_srs']+'">';str+='<gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';for(var k=0;k<d.getGeometry(m,0).count();k++){if(k>0)str+=" ";str+=d.getPoint(m,0,k).x+","+d.getPoint(m,0,k).y;}
+str+='</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>';}
+str+='</wfs:Value></wfs:Property>';str+='<ogc:Filter><ogc:FeatureId fid="'+fid+'"/></ogc:Filter>';str+='</wfs:Update>';}
+else if(type=="delete"){str+='<wfs:Delete typeName="'+myconf['featuretype_name']+'">';for(var j=0;j<myconf['element'].length;j++){if(myconf['element'][j]['f_geom']==1){var el_geom=myconf['element'][j]['element_name'];}}
+str+='<ogc:Filter><ogc:FeatureId fid="'+fid+'"/></ogc:Filter>';str+='</wfs:Delete>';}
+str+='</wfs:Transaction>';return str;}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/wfs_obj.js
===================================================================
--- branches/print_dev/http/javascripts/wfs_obj.js	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/javascripts/wfs_obj.js	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,75 +1,6 @@
-//$Id$
-//$Header: /cvsroot/mapbender/mapbender/http/javascripts/wfs_obj.js,v 1.3 2005/09/13 14:38:11 bjoern_heuser Exp $
-//global variables
-var wfs = [];
-var wfs_featuretype_count = 0;
-var wfs_element_count = 0;
-//list of all wms-objects
-function add_wfs(
-			wfs_id,
-			wfs_version,
-			wfs_title,
-			wfs_abstract,
-			wfs_getcapabilities,
-			wfs_describefeaturetype){
-					wfs[wfs.length] = new wfs_const( 
-					wfs_id,
-			      wfs_version,
-			      wfs_title,
-			      wfs_abstract,
-			      wfs_getcapabilities,
-			      wfs_describefeaturetype);
-					//wfs_featuretype[wfs.length - 1] = [];
-}
-//the wms constructor
-function wfs_const(  
-			wfs_id,
-			wfs_version,
-			wfs_title,
-			wfs_abstract,
-			wfs_getcapabilities,
-			wfs_describefeaturetype){
-   
-	this.wfs_id = wfs_id;
-	this.wfs_version = wfs_version;
-	this.wfs_title = wfs_title;
-	this.wfs_abstract = wfs_abstract;
-	this.wfs_getcapabilities = wfs_getcapabilities;
-	this.wfs_describefeaturetype = wfs_describefeaturetype;
-
-	this.wfs_featuretype = [];
-   //alert(wfs_id + " , " +wfs_title + " , " +wfs_abstract + " , " +wfs_getcapabilities + " , " +wfs_describefeaturetype);
-}
-//featuretype
-function wfs_add_featuretype(
-			featuretype_name,
-			featuretype_title,
-			featuretype_srs,
-			featuretype_geomtype){
-                      
-	      wfs[wfs.length-1].wfs_featuretype[wfs[wfs.length-1].wfs_featuretype.length] = new featuretype(
-											featuretype_name,
-											featuretype_title,
-											featuretype_srs,
-											featuretype_geomtype);
-//alert(featuretype_name + " , " +featuretype_title + " , " +featuretype_srs + " , " +featuretype_geomtype);
-}
-function featuretype(
-			featuretype_name,
-			featuretype_title,
-			featuretype_srs,
-			featuretype_geomtype){
-	this.featuretype_name = featuretype_name;
-	this.featuretype_title = featuretype_title;
-	this.featuretype_srs = featuretype_srs;
-	this.featuretype_geomtype = featuretype_geomtype;
-	this.element = [];
-	wfs_featuretype_count++; 
-}
-//elements
-function wfs_add_featuretype_element(element_name, element_type, element_count, featuretype_count){
-	wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count] = [];
-	wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count].name = element_name;
-	wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count].type = element_type;
-   //alert(element_name +" , "+element_type);
-}
+
+var wfs=[];var wfs_featuretype_count=0;var wfs_element_count=0;function add_wfs(wfs_id,wfs_version,wfs_title,wfs_abstract,wfs_getcapabilities,wfs_describefeaturetype){wfs[wfs.length]=new wfs_const(wfs_id,wfs_version,wfs_title,wfs_abstract,wfs_getcapabilities,wfs_describefeaturetype);}
+function wfs_const(wfs_id,wfs_version,wfs_title,wfs_abstract,wfs_getcapabilities,wfs_describefeaturetype){this.wfs_id=wfs_id;this.wfs_version=wfs_version;this.wfs_title=wfs_title;this.wfs_abstract=wfs_abstract;this.wfs_getcapabilities=wfs_getcapabilities;this.wfs_describefeaturetype=wfs_describefeaturetype;this.wfs_featuretype=[];}
+function wfs_add_featuretype(featuretype_name,featuretype_title,featuretype_srs,featuretype_geomtype){wfs[wfs.length-1].wfs_featuretype[wfs[wfs.length-1].wfs_featuretype.length]=new featuretype(featuretype_name,featuretype_title,featuretype_srs,featuretype_geomtype);}
+function featuretype(featuretype_name,featuretype_title,featuretype_srs,featuretype_geomtype){this.featuretype_name=featuretype_name;this.featuretype_title=featuretype_title;this.featuretype_srs=featuretype_srs;this.featuretype_geomtype=featuretype_geomtype;this.element=[];wfs_featuretype_count++;}
+function wfs_add_featuretype_element(element_name,element_type,element_count,featuretype_count){wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count]=[];wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count].name=element_name;wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count].type=element_type;}
\ No newline at end of file

Added: branches/print_dev/http/php/checksum.json
===================================================================
--- branches/print_dev/http/php/checksum.json	                        (rev 0)
+++ branches/print_dev/http/php/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"mod_loadCapabilitiesList.php":"70b8283040a3ce0ec442f9303b41c52c887be2f5","mb_validatePermission.php":"970ff77d6fe22436ea7bb7ae396f70bbf5d91e2e","mod_filteredGroup_User.php":"6e21082b26697d4dbc7b925d5138b9e13f59662d","mod_wfs_gazetteer_server.php":"5c9892e65f3d9db63010e2f4f75a451c55f848ae","mod_wfs_result.php":"f15a71eab7d9a80738facd0c554557c70970d5c7","mod_gazetteerMetadata.php":"15bd54b778dcf516ce1deceebad210e4305aa610","mod_group_user.php":"b951d1b7b8762dd0bf6173df2059d0299c555733","mod_addWMSfromfilteredList_server.php":"07d918db124d7293f6ef810e4f69c9480929b128","mod_exportElement.php":"6d74ef5f6b53706fe2e5b6bc356308a61a7474b2","mb_listKMLs.php":"627781cb6ea7b488035d50382ba8c9498fe5f11a","mb_listGUIs.php":"ca851c63827d46826dff3d329fcebbec1cc72922","mod_evalArea.php":"c8c3cdf08260312c8d38035d0fd9cb9f02983bdd","mod_printView1.php":"7c64add4f29b2eef0cc2625e21a5fb54bb7ee2d5","mod_gazLayerObj_conf.php":"c80d5b0902983c2b60ae9a482116b8cccc0e6dc0","mod_changePassword.php":"373e3e73fe0880f322bc68f0405de9f7d662184a","mod_gui_user.php":"f5af42125861b093f9f15ea745b08b6b39e36380","mb_validateSession.php":"1c538aa636c66b87d1663b64c323a1e4a3190a2d","mod_showGuiName.php":"8ef8da78e5591212c7c312cc75b2210c7e806dce","mod_getStyles.php":"e674622f8081d91c7f5efb5496e08336a1198ec8","mod_filteredGui_filteredUser.php":"a42d21956c399b4bb5ae5aed07e613b90193f755","mod_gazetteerMetadata_search.php":"aab19362d455703d62388bc89b3aa2020d78be4d","database-pgsql.php":"23440a880fd7cf02b60d79f6f97a8a717af73702","mod_exportGUI.php":"dccc4dabced4053a634f49fe6bec4e252d4bd848","mod_filteredGroup_filteredGui.php":"893bf1a35d1c645a5706663159eeacb11d988959","mod_zoomCoords.php":"b4284fc1afe0ee615c980fcf8770568ee250e744","mod_loadCapabilities_temp.php":"9de3593c64fef1f5eb834b9566464e17f74c6d16","mod_log.php":"a02113cf3bf87dde8666e6f3857d8bb7c5b17604","mod_wfs.php":"cdef7684629920203a7fa87e2b1bc2105abb3106","mod_logout.php":"0219e8ffc1faeca20224400fc0b160a812b8d069","mod_saveWKT.php":"fdfb75246738cc1c7be95def6eb7ca5a72d25c34","mod_editElements.php":"8339b9e0a00032e70b69306179518acb375e8d80","mod_displayKML.php":"a93b49294c4634456ef32fa9438901c4614d3b90","mod_forgottenPassword.php":"44eee47a8aa44e06ac643988bbd7859b0f40f724","mod_editGroup.php":"54d0b4b3a055e3294b01ae49ff9e1c5778716e07","mod_wfs_conf.php":"952820f52bcbd38b26123097f2a064e2db6fc943","mod_map1.php":"16d233184e000de34e9ae90a72fd39f14f59946e","mod_gazetteerSQL_server.php":"a10b1da19e8ea30668b38f4f12146e38b2e28683","mod_newGui.php":"563f2f3d104c0ead5d131c60bb68b3c235fd6d8c","mod_treefolderAdmin.php":"625a3704aa80dfaa56beef5052e2855a1239ef1c","mod_WMSpreferences.php":"2cbb7aff8b0ad2f53854fbf292577e46bb5bd859","mod_edit_metadata.php":"ad856e8a3cec7c99c3ef0b48cebc0def0fee7dd4","mod_filteredWms_layer_topic.php":"d18257e01b59138efd4b222c0efc811eba83b7cf","mod_editSelf.php":"0ee2bfcfb469c05fb3f2ad065d481d119e4dd0d5","mod_filteredWms_topic.php":"fa2352fcdda2b024d0a2f3fc65c9d9b2988a8a7f","mod_layerMetadata.php":"3a31e0fa4e29279e4e77aa94c7af7943de15fffa","mod_user_filteredGui.php":"390d98475f916547034d5cb94024ad0d0f047873","mod_filteredUser_filteredGui.php":"e080d7eda376f0a02f8b65a6d30917b3bcfa513f","mod_editWMS_Metadata.php":"ff99242c958d77bb6862aa041dfabf7388aa2792","mod_loadwms.php":"49274ada34ec00867e0e158cb5cccd8413dec60a","mod_wfsLayerObj_conf.php":"6b157f9e629dd2d51cc9eea387c30e9021bdccad","mod_usemap.php":"e9a2b187ff2113caec30e275b0032d4d380300e3","mod_wfs_server.php":"addd8957daa1f45334bd14d17225a4c7669fc7bd","mod_gui_owner.php":"73d24bfee9516afb28d5fb91df410da31b930209","mod_filteredGui_group.php":"507a0e72503872d5ae69652fd3f062f8b43412b2","mod_owsproxy_conf.php":"5063de1b45e028f2dc5d23f0cc052e4cd19833bf","mod_changeEPSG_dynamic.php":"34b56e31bb7a33cac0990e77e59d377bfb142311","mb_listWMCs.php":"2841324eb872d8912ef3cedc31505dae494b78cf","createImageFromText.php":"9dff939417546aecb74d59718443a58d7385ab35","mod_button_tooltips.php":"ea3db38bcd74899e5bb5a1c503a80ed16897498c","mod_user_gui.php":"471143db08fdb9a968aff772db618d1eff1d9fb0","mod_wfs_edit.php":"c7948e69793b3ac0c0b53d979c2760ab8d54d9b5","mod_updateKmlInDb.php":"5cdcf8fb33d48feaf4fdb9aeb709eaff85cd2993","mod_featuretypeMetadata.php":"67518f2b8c6db8fd9ec1904ae524ff6f0aeb1712","mod_deleteFilteredGUI.php":"f04f1eb6bf8105a9382ff4265d296bb32cb423f5","mod_editGuiWms.php":"c7d7b39cc233c677d03067435e641fc8b44e7dde","mod_group_filteredUser.php":"0f2392e3044f58f33aa5c04342654b7ccf165d08","mb_getGUIs.php":"dda751a23c9e6b518a6103fad63eceb567a3f613","mod_filteredUser_Group.php":"acab356a37f11b446402c632eaf9ed57ee92d061","mod_createJSObjFromXML.php":"b7a0173793985c847bf2acff22e57034ef4ea304","mod_gui_filteredGroup.php":"90fd6b33915a4f28391c90e38fc27d5bdd3ff3ab","mod_createJSLayerObjFromXML.php":"bc92f8cd17f3b66747e3d31e0f8aa4285f7b934c","mod_export_image.php":"7e27ddff4486b7af080c6d5d76f50681ca31c8ad","mod_SelectKeyword.php":"58ab402ee529a0ffab2285f2b5eefae7c3c65602","mod_filteredGui_filteredGroup.php":"1988cceb6de18e1787068b69fdcba62ee4675bb7","mod_tab_messages.php":"ba33b4078efd34cc74d9ec5fb0866e8756818ae9","mod_gazetteer_conf.php":"c911ce258ab340b52d6f44835c94bd3f738ce1a1","mod_filteredUser_filteredGroup.php":"5d4836a287fa8bddeed5ad2338d136b43a31a257","mod_simpleWMSpreferences.php":"cb3787851caea7c97b445a72100d346d5c7bef86","mod_editUser.php":"3f3a7c3cf03f7836e26ef770d3810ed30a3471f3","mod_treefolderClient.php":"4aa781b670ac8905494f467df035ab187b8a5c29","mod_createJSObjFromDBByWMS.php":"6977207b3f2b0a5ea662c5ee4f67bf758ed68449","mod_deleteGUI.php":"1217cc297050c5f7801b0cec15f576c89ea282cc","mod_filteredGroup_filteredUser.php":"71bf108fda85cc5117a322f77716003034739fb8","mod_user_filteredGroup.php":"0d62b9964a1e13f20b69ccd33619f586b7bafec6","mod_filteredGui_User.php":"cc9d0178e78cd3991f718fe80a16b86f4ac5d1db","mod_filteredUser_Gui.php":"3129c0d034d44929f0ae62fe64a488822bf57aae","mod_meetingPoint.php":"4a868c805a4c80dd98da71805b29806bfb486ea5","mod_insertWmcIntoDb.php":"e9ff612312641c7bb087aaf0b60ab7dbb81fd091","mod_updateWMS.php":"cc998e643d2c661a8fc91a84045e2d0b6db51920","mod_gazLayerObj_edit.php":"e7067cd4c1f61e08722c7de8c28012478981dd63","mod_editGuiWmsMeta.php":"1be90fb3cdf1b3c3011759f6c4c3029ebe833525","mod_deleteWFS.php":"e22f6ba0b6dc2d4d7a4b77118ff01ea705e1631c","mod_orphanWMS.php":"2e8b6abfb007baf6ead7043e6432892816d64dc7","mod_editFilteredUser.php":"06f1467368a058187b8b378cf8340bcb93bdd2a8","mod_wfsSpatialRequest_messages.php":"cf779627cd92a4e88176731f50ae02650c6efef3","mod_gazetteer_edit.php":"bd0060d35d90704e98a875643ecdbfe590ec6ca6","mod_edit_element_vars.php":"8e3547817e0ad1eff852cf94e49b9a56a6d12970","mod_zoomCoords_en.php":"bbd55d1250ba84329f9fdee0f287d010dbdf9e16","mod_help.php":"62b82cde535cceac183c42b528160f8a4fa049aa","mod_loadCapabilities.php":"30473371fdd91d6ea4f920650dfb1bb5ea724d24","mod_digitize_messages.php":"adf38d0cd8b33a5688557073fe3f391c7e46c7ee","mod_createJSObjFromDB.php":"76378839a0c9a67abf0de27b73f6939340ebc777","mod_changeEPSG.php":"37a51f00e9090b6b44a1f34bcfb2aca247004e19","mod_filteredGroup_Gui.php":"3a4a4ce503418136252a1bbf857e03c9413c85cc","mb_js_exception.php":"069b7adee0c3dd229dbc63dd0f152d955be488bd","mod_mapOV.php":"b5bf7b8532e7a6484d1b0a299c19775dcbee96e0","mod_showLoggedUser.php":"fe94c108df6aa2d53db932b67b07257d80d1c640","mod_deleteWMS.php":"f8e88dae951aa4987e6d9683922748dc8bfbdbe0","mod_setLocale.php":"efd33c145d3ebb828a65a4adfc40e68afb0797db","mod_gui_filteredUser.php":"74f4616c719061929af7d57c0c7b281d24114564","mb_validateInput.php":"e71a0f68830ab2d841d3b532459e518086082fdd","mod_gui_group.php":"56e4e3e543c92d0350dd82afab325da2e361e33d","mod_loadwms_temp.php":"1429f840572fc67d3f8740cd9369ef8b215be423","mod_group_gui.php":"1bf0b277b70dc3a935e4c2a1c3e62260ab940686","mod_renameGUI.php":"e4b720a6825a02854145d758b2b9bd8b74273748","mod_loadWFSCapabilities.php":"597f551e162fedbe12f9b6725b67d65bd0aa21bd","mod_group_filteredGui.php":"a5b8bea8269473528daeaf1c83dbf5052889a4a2","nestedSets.php":"d0540b92f5d6babb9631a05c87dd06d5f7bb25db","mod_createUser.php":"839ad16879184f13e5f50be557036c5922244203","mod_user_group.php":"5d6332b62631b0c8e7bb02d5a239cced1cafb56e","mod_addWmsFromFeatureInfo.php":"76d98cdda4042ef3acf5164c28beaf321d11fb7a","database-mysql.php":"06a541356dda2ae561c27b24d2f137adea0d5479","mod_loadwfs.php":"e9645cb9cea3d29e23c666f1bf32fc386f32770e","mod_editElementVars.php":"6585f99da4bdc981596c6fe0a62fa71ceac3fb75","mod_exportMapImage_server.php":"23de9480a9d30c20dcb8dcd28560a7565c4b433f","mod_editFilteredGroup.php":"26742eb7a85b2d364939697a601d9e7e7875756b"}
\ No newline at end of file

Added: branches/print_dev/http/php/database-mysql.php
===================================================================
--- branches/print_dev/http/php/database-mysql.php	                        (rev 0)
+++ branches/print_dev/http/php/database-mysql.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1,409 @@
+<?php
+# $Id: database-mysql.php 1592 2007-08-06 08:08:51Z christoph $
+# http://www.mapbender.org/index.php/database-mysql.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.
+
+/**
+ * \file
+ * \brief MySQL database connection/querying layer
+ * 
+ * MySQL database connection/querying layer
+ *
+ * example:
+ * \code
+ * include_once(dirname(__FILE__)."/afwphp/database-mysql.php");  
+ * $sys_dbhost=...                            
+ * $sys_dbuser=...                            
+ * $sys_dbpasswd=...                           
+ * $sys_dbname=...                            
+ *                                             
+ * db_connect();                               
+ * ...                                         
+ * $rs = db_query("select * from table");      
+ * while($row = db_fetch_array($rs));
+ *  ...
+ * \endcode
+ */
+
+/**
+ * System-wide database type
+ *
+ * @var	constant		$sys_database_type
+ */
+$sys_database_type='mysql';
+
+/**
+ *  Connect to the database
+ *
+ *  Notice the global vars that must be set up
+ *  Notice the global vars $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname that must be set up 
+ *  in other functions in this library
+ */
+include_once(dirname(__FILE__)."/../../http/classes/class_mb_exception.php");
+include_once(dirname(__FILE__)."/../../http/classes/class_checkInput.php");
+function db_escapestring($unescaped_string){
+	return @mysql_escape_string($unescaped_string);
+}
+function db_escape_string($unescaped_string){
+	return @mysql_escape_string($unescaped_string);
+}
+
+
+function db_connect($DBSERVER="",$OWNER="",$PW="") {
+	global $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname,
+		$conn,$conn_update,$sys_db_use_replication,$sys_dbreadhost;
+
+	
+	if ($DBSERVER)
+		$sys_dbhost = $DBSERVER; 
+	if ($OWNER)
+		$sys_dbuser = $OWNER; 
+	if ($PW)
+		$sys_dbpasswd = $PW; 
+	if (PORT!=''){
+		$sys_dbport = ':'.PORT;
+	}
+	else{
+		$sys_dbport = '';
+	} 
+		
+	if ($sys_db_use_replication) {
+		//
+		//  if configured for replication, $conn is the read-only host
+		//  we do not connect to update server until needed
+		//
+		$conn = @mysql_pconnect($sys_dbreadhost,$sys_dbuser,$sys_dbpasswd);
+		$conn_update=@mysql_pconnect($sys_dbhost,$sys_dbuser,$sys_dbpasswd);
+	} else {
+		$conn = @mysql_pconnect($sys_dbhost.$sys_dbport,$sys_dbuser,$sys_dbpasswd);
+		#echo "@mysql_pconnect($sys_dbhost.$sys_dbport,$sys_dbuser,$sys_dbpasswd)";
+	}
+	if ($sys_dbname)
+		@mysql_select_db($sys_dbname);
+	return $conn;
+}
+
+function db_select_db($DB,$con="") {
+	global $conn,$sys_dbname; 
+	$sys_dbname = $DB;	
+	$_con = $con ? $con : $conn;
+	$ret = @mysql_select_db($sys_dbname,$_con);
+	if ($ret){
+		return true;
+	}
+	else {
+		return false;
+	}
+//	echo "$ret=@mysql_select_db($sys_dbname,$_con);";
+}
+
+/**
+ *  Query the database
+ *
+ *  @param		$qstring (string)	SQL statement
+ *  @param		$limit (int)		How many rows do you want returned
+ *  @param		$offset (int)		Of matching rows, return only rows starting here
+ */
+function db_query($qstring,$limit='-1',$offset=0) {
+	global $QUERY_COUNT,$sys_db_use_replication,$sys_db_is_dirty,$DB,
+		$sys_dbname,$conn,$conn_update,$sys_dbhost,$sys_dbuser,$sys_dbpasswd;
+
+	$QUERY_COUNT++;
+	if(!$sys_dbname && $DB)
+	$sys_dbname = $DB;
+	db_select_db($sys_dbname,$conn);
+	
+	if ($limit > 0) {
+		if (!$offset || $offset < 0) {
+			$offset=0;
+		}
+		$qstring=$qstring." LIMIT $offset,$limit";
+	}
+//	if ($GLOBALS['IS_DEBUG'])
+		$GLOBALS['G_DEBUGQUERY'] .= $qstring . "<P><BR>\n";
+
+	//
+	//are we configured to try to use replication?
+	//
+	if ($sys_db_use_replication) {
+		//
+		//if we haven't yet done an insert/update, 
+		//read from the read-only db
+		//
+		if (!$sys_db_is_dirty && mb_eregi("^( )*(select)",$qstring)) {
+			if ($QUERY_COUNT%3==0) {
+				// 1/3rd of read queries go to master for now
+				return @mysql_db_query($sys_dbname,$qstring,$conn_update);
+			} else {
+				return @mysql_db_query($sys_dbname,$qstring,$conn);
+			}
+		} else {
+			//must be an update/insert/delete query - go to master server
+			$sys_db_is_dirty=true;
+			return @mysql_db_query($sys_dbname,$qstring,$conn_update);
+		}
+	} else {
+		$ret = @mysql_db_query($sys_dbname,$qstring,$conn);
+//		echo "@mysql_db_query($sys_dbname,$qstring,$conn); ret=$ret<br>";
+		if(!$ret){
+			$e = new mb_exception("db_query($qstring)=$ret db_error=".db_error());
+		}
+		return $ret;
+	}
+	//echo "SQL__".$qstring;
+}
+/**
+ *  prepare and query the database
+ *
+ *  @param		$qstring (string)	SQL statement
+ *  @param		$params (array string params)		
+ *  @param		$types (array string types)		
+ */
+function db_prep_query($qstring, $params, $types){
+	$ci = new checkInput($qstring,$params,$types);
+	$params = $ci->v; 
+	for ($i=0; $i<count($params); $i++){
+		$needle = "$".strval($i+1);
+		$tmp = '';
+		if($params[$i] !== NULL){
+			if($types[$i] == 's'){ $tmp .= "'"; }
+			$tmp .= $params[$i];
+			if($types[$i] == 's'){ $tmp .= "'"; }
+		}
+		else{
+			$tmp .= "NULL";
+		}
+		$posa = mb_strpos($qstring, $needle);
+		$posb = mb_strlen($needle);
+		$qstring = mb_substr($qstring,0,$posa).$tmp.mb_substr($qstring,($posa + $posb));	
+	}
+	$r = db_query($qstring);
+	return $r;
+}
+/**
+ *	Begin a transaction
+ *
+ *	Begin a transaction for databases that support them
+ *	may cause unexpected behavior in databases that don't
+ */
+function db_begin() {
+	return db_query("BEGIN WORK");
+}
+
+/**
+ * Commit a transaction
+ *
+ * Commit a transaction for databases that support them
+ * may cause unexpected behavior in databases that don't
+ */
+function db_commit() {
+	return db_query("COMMIT");
+}
+
+/**
+ * Roll back a transaction
+ *
+ * Rollback a transaction for databases that support them
+ * may cause unexpected behavior in databases that don't
+ */
+function db_rollback() {
+	$str = db_error();
+	db_query("ROLLBACK");
+	die('sql error: ' . $str . " ROLLBACK performed....");
+}
+
+/**
+ * Returns the number of rows in this result set
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ */
+function db_numrows($qhandle) {
+	// return only if qhandle exists, otherwise 0
+	if ($qhandle) {
+		return @mysql_numrows($qhandle);
+	} else {
+		return 0;
+	}
+}
+/**
+ * Returns the number of rows in this result set
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ * php 3,4,5
+ */
+function db_num_rows($qhandle) {
+	// return only if qhandle exists, otherwise 0
+	if ($qhandle) {
+		return @mysql_num_rows($qhandle);
+	} else {
+		return 0;
+	}
+}
+
+/**
+ *  Frees a database result properly 
+ *
+ *  @param	$qhandle (string)	Query result set handle
+ */
+function db_free_result($qhandle) {
+	return @mysql_free_result($qhandle);
+}
+
+/**
+ *  Reset a result set.
+ *
+ *  Reset is useful for db_fetch_array sometimes you need to start over
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$row (int)		Row number
+ */
+function db_reset_result($qhandle,$row=0) {
+	return mysql_data_seek($qhandle,$row);
+}
+
+/**
+ *  Returns a field from a result set
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$row (int)		Row number
+ *  @param		$field (string)	Field name
+ */
+function db_result($qhandle,$row,$field) {
+	return @mysql_result($qhandle,$row,$field);
+}
+
+/**
+ *  Returns the number of fields in this result set
+ *
+ *  @param		$lhandle (string)	Query result set handle
+ */
+function db_numfields($lhandle) {
+	return @mysql_numfields($lhandle);
+}
+
+/**
+ *  Returns the number of fields in this result set
+ *
+ *  @param		$lhandle (string)	Query result set handle
+ * php 3,4,5
+ */
+function db_num_fields($lhandle) {
+	return @mysql_num_fields($lhandle);
+}
+
+/**
+ *  Returns the number of rows changed in the last query
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */
+function db_fieldname($lhandle,$fnumber) {
+	   return @mysql_fieldname($lhandle,$fnumber);
+}
+
+/**
+ *  Returns the number of rows changed in the last query
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ */
+function db_affected_rows($qhandle) {
+	return @mysql_affected_rows();
+}
+
+/**
+ *  Fetch an array
+ *
+ *  Returns an associative array from 
+ *  the current row of this database result
+ *  Use db_reset_result to seek a particular row
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ */
+function db_fetch_array($qhandle) {
+	return @mysql_fetch_array($qhandle);
+}
+
+/**                                                       
+ * fetch a row into an array 
+ * 
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */
+function db_fetch_row($qhandle,$fnumber=0) {
+	  return @mysql_fetch_row($qhandle);
+}
+
+/**
+ *  Returns the last primary key from an insert
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$table_name (string)	Is the name of the table you inserted into
+ *  @param		$pkey_field_name (string)	Is the field name of the primary key
+ */
+function db_insertid($qhandle="",$table_name="",$pkey_field_name="") {
+	return @mysql_insert_id();
+}
+
+function db_insert_id($qhandle="",$table_name="",$pkey_field_name="") {
+	return @mysql_insert_id();
+}
+
+/**
+ * Returns the last error from the database
+ */
+function db_error() {
+	return @mysql_error();
+}
+
+/**
+ * Get the flags associated with the specified field in a result 
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ *
+ * 					Examples: "not_null", "primary_key", "unique_key", "multiple_key",					 
+ *                    "blob", "unsigned", "zerofill","binary", "enum",                  
+ *                    "auto_increment", "timestamp"                                     
+ */
+
+function db_field_flags($lhandle,$fnumber) {
+	   return @mysql_field_flags($lhandle,$fnumber);
+}
+
+/**                                                       
+ * Get the type of the specified field  
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */                                                       
+                                                          
+function db_field_type($lhandle,$fnumber) {               
+	   return @mysql_field_type($lhandle,$fnumber);         
+}                                                         
+
+/**                                                       
+ * Get the length of the specified field                                                            
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */                                                       
+                                                          
+function db_field_len($lhandle,$fnumber) {               
+	   return @mysql_field_len($lhandle,$fnumber);         
+} 
+
+?>
\ No newline at end of file

Added: branches/print_dev/http/php/database-pgsql.php
===================================================================
--- branches/print_dev/http/php/database-pgsql.php	                        (rev 0)
+++ branches/print_dev/http/php/database-pgsql.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1,436 @@
+<?php
+# $Id: database-pgsql.php 1592 2007-08-06 08:08:51Z christoph $
+# http://www.mapbender.org/index.php/database-pgsql.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.
+
+/**
+ * \file
+ * \brief MySQL database connection/querying layer
+ * 
+ * MySQL database connection/querying layer
+ *
+ * example:
+ * \code
+ * include_once(dirname(__FILE__)."/afwphp/database-mysql.php");  
+ * $sys_dbhost=...                            
+ * $sys_dbuser=...                            
+ * $sys_dbpasswd=...                           
+ * $sys_dbname=...                            
+ *                                             
+ * db_connect();                               
+ * ...                                         
+ * $rs = db_query("select * from table");      
+ * while($row = db_fetch_array($rs));
+ *  ...
+ * \endcode
+ */
+
+/**
+ * System-wide database type
+ *
+ * @var	constant		$sys_database_type
+ */
+$sys_database_type='pgsql';
+
+/**
+ *  Connect to the database
+ *
+ *  Notice the global vars that must be set up
+ *  Notice the global vars $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname that must be set up 
+ *  in other functions in this library
+ */
+include_once(dirname(__FILE__)."/../../http/classes/class_mb_exception.php");
+include_once(dirname(__FILE__)."/../../http/classes/class_checkInput.php");
+function db_escape_string($unescaped_string){
+	return @pg_escape_string(stripslashes($unescaped_string));
+}
+$DB = DB;
+
+
+function db_connect($DBSERVER="",$OWNER="",$PW="") {
+	global $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname,$db_debug;
+	global $conn,$conn_update,$DB;	
+
+	
+	$db_debug=0;
+	if ($DBSERVER)
+		$sys_dbhost = $DBSERVER; 
+	if ($OWNER)
+		$sys_dbuser = $OWNER; 
+	if ($PW && $PW != null)
+		$sys_dbpasswd = $PW; 
+	
+	$sys_dbport = PORT; 	
+		
+	if($GLOBALS['DB'])
+		$sys_dbname = $DB;
+			
+	$connstring = "";
+	if ($sys_dbuser)		
+		$connstring.=" user=$sys_dbuser";
+	if ($sys_dbname)		
+		$connstring.=" dbname=$sys_dbname";		
+	if ($sys_dbhost)		
+		$connstring.=" host=$sys_dbhost";	
+	if ($sys_dbport)		
+		$connstring.=" port=$sys_dbport";		
+	if ($sys_dbpasswd)		
+		$connstring.=" password=$sys_dbpasswd";		
+	
+	if ($db_debug)
+		echo $connstring." ";		
+
+	$conn = pg_connect($connstring);		
+
+		#if(isset($sys_db_clientencoding) && $sys_db_clientencoding > "")
+		#{
+		#pg_set_client_encoding ( $conn, $sys_db_clientencoding);
+		#}
+	#return $conn;
+	if ($db_debug)
+		echo "conn=".$conn;
+#echo $connstring;
+#if(!$conn)
+#{echo "FEHLER in Connection";
+#pg_error($conn);}	
+	
+	return $conn;
+}
+
+function db_select_db($DB,$con="") {
+	global $conn,$sys_dbname; 
+#	$sys_dbname = DB;	
+#	$_con = $con ? $con : $conn;
+#	$ret = @mysql_select_db($sys_dbname,$_con);
+//	echo "$ret=@mysql_select_db($sys_dbname,$_con);";
+}
+
+/**
+ *  Query the database
+ *
+ *  @param		$qstring (string)	SQL statement
+ *  @param		$limit (int)		How many rows do you want returned
+ *  @param		$offset (int)		Of matching rows, return only rows starting here
+ */
+function db_query($qstring) {
+	global $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname,$db_debug,
+		$conn,$conn_update,$QUERY_COUNT,$DBSERVER,$OWNER,$PW,$DB;
+	$QUERY_COUNT++;
+	$ret = pg_exec($qstring);
+//	$e = new mb_exception("not ps:  ".$_SERVER['SCRIPT_FILENAME']." : ".$qstring);
+	if(!$ret){
+		$e = new mb_exception("db_query($qstring)=$ret db_error=".db_error());
+	}
+	return $ret;	
+}
+/**
+ *  prepare and query the database
+ *
+ *  @param		$qstring (string)	SQL statement
+ *  @param		$params (array params as strings)		
+ *  @param		$types (array types as strings)		
+ */
+function db_prep_query($qstring, $params, $types){
+	$ci = new checkInput($qstring,$params,$types);
+	$params = $ci->v; 
+	if(PREPAREDSTATEMENTS == false){
+		for ($i=0; $i<count($params); $i++){
+			$needle = "$".strval($i+1);
+			$tmp = '';
+			if($params[$i] !== NULL){
+				if($types[$i] == 's'){ $tmp .= "'"; }
+				$tmp .= $params[$i];
+				if($types[$i] == 's'){ $tmp .= "'"; }
+			}
+			else{
+				$tmp .= "NULL";
+			}
+			$posa = mb_strpos($qstring, $needle);
+			$posb = mb_strlen($needle);
+			$qstring = mb_substr($qstring,0,$posa).$tmp.mb_substr($qstring,($posa + $posb));	
+		}
+		$r = db_query($qstring);
+		if(!$r){
+			$e = new mb_exception("Error while executing sql statement in ".$_SERVER['SCRIPT_FILENAME'].": Sql: ".$qstring.", Error: ".db_error());
+		}
+	}
+	else{
+		$result = pg_prepare("", $qstring);
+		if(!$result){
+			$e = new mb_exception("Error while preparing statement in ".$_SERVER['SCRIPT_FILENAME'].": Sql: ".$qstring.", Error: ".db_error());
+		}
+		$r = pg_execute("", $params);
+		if(!$r){
+			$e = new mb_exception("Error while executing prepared statement in ".$_SERVER['SCRIPT_FILENAME'].": Sql: ".$qstring.", Error: ".db_error());
+		}
+	}	
+	return $r;
+}
+/**
+ *	Begin a transaction
+ *
+ *	Begin a transaction for databases that support them
+ *	may cause unexpected behavior in databases that don't
+ */
+function db_begin() {
+	return db_query("BEGIN WORK");
+}
+
+/**
+ * Commit a transaction
+ *
+ * Commit a transaction for databases that support them
+ * may cause unexpected behavior in databases that don't
+ */
+function db_commit() {
+	return db_query("COMMIT");
+}
+
+/**
+ * Roll back a transaction
+ *
+ * Rollback a transaction for databases that support them
+ * may cause unexpected behavior in databases that don't
+ */
+function db_rollback() {
+	$str = db_error();
+	db_query("ROLLBACK");
+	die('sql error: ' . $str . " ROLLBACK performed....");
+}
+
+/**
+ * Returns the number of rows in this result set
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ */
+function db_numrows($qhandle) {
+	// return only if qhandle exists, otherwise 0
+	if ($qhandle) {
+		return @pg_numrows($qhandle);
+	} else {
+		return 0;
+	}
+}
+/**
+ * Returns the number of rows in this result set
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ *	php > 4.2
+ */ 
+function db_num_rows($qhandle) {
+	// return only if qhandle exists, otherwise 0
+	if ($qhandle) {
+		return @pg_num_rows($qhandle);
+	} else {
+		return 0;
+	}
+}
+
+/**
+ *  Frees a database result properly 
+ *
+ *  @param	$qhandle (string)	Query result set handle
+ */
+function db_free_result($qhandle) {
+	return @pg_freeresult($qhandle);
+}
+
+/**
+ *  Reset a result set.
+ *
+ *  Reset is useful for db_fetch_array sometimes you need to start over
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$row (int)		Row number
+ */
+function db_reset_result($qhandle,$row=0) {
+#dummy
+	return 0;#mysql_data_seek($qhandle,$row);
+	
+}
+
+/**
+ *  Returns a field from a result set
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$row (int)		Row number
+ *  @param		$field (string)	Field name
+ */
+function db_result($qhandle,$row,$field) {
+	return @pg_result($qhandle,$row,$field);
+}
+
+/**
+ *  Returns the number of fields in this result set
+ *
+ *  @param		$lhandle (string)	Query result set handle
+ */
+function db_numfields($lhandle) {
+	return @pg_numfields($lhandle);
+}
+
+/**
+ *  Returns the number of fields in this result set
+ *
+ *  @param		$lhandle (string)	Query result set handle
+ *	php >4.2
+ */
+function db_num_fields($lhandle) {
+	return @pg_num_fields($lhandle);
+}
+
+/**
+ *  Returns the number of rows changed in the last query
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */
+function db_fieldname($lhandle,$fnumber) {
+	   return @pg_fieldname($lhandle,$fnumber);
+}
+
+/**
+ *  Returns the number of rows changed in the last query
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ */
+function db_affected_rows($qhandle) {
+	
+	return @pg_cmdtuples($qhandle);
+}
+
+/**
+ *  Fetch an array
+ *
+ *  Returns an associative array from 
+ *  the current row of this database result
+ *  Use db_reset_result to seek a particular row
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ */
+function db_fetch_array($qhandle) {
+	return @pg_fetch_array($qhandle);
+}
+
+function db_fetch_all($qhandle){
+		return @pg_fetch_all($qhandle);
+}
+/**                                                       
+ * fetch a row into an array 
+ * 
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */
+function db_fetch_row($qhandle,$fnumber=0) {
+	  return pg_fetch_row($qhandle);
+}
+
+/**
+ *  Returns the last primary key from an insert
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$table_name (string)	Is the name of the table you inserted into
+ *  @param		$pkey_field_name (string)	Is the field name of the primary key
+ */
+function db_insertid($qhandle="",$table_name="",$pkey_field_name="") {
+	$res=db_query("SELECT max($pkey_field_name) AS id FROM $table_name");
+    if ($res && db_numrows($res) > 0) {
+        return @db_result($res,0,'id');
+    } else {
+        return 0;
+    }
+}
+
+
+
+
+function db_insert_id($qhandle="",$table_name="",$pkey_field_name="") {
+		global $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname,$db_debug,
+		$conn,$conn_update,$QUERY_COUNT,$DBSERVER,$OWNER,$PW,$DB;
+	/*	
+	$oid =pg_last_oid($qhandle);
+	echo $oid;
+	
+	$res=db_query("SELECT ".$pkey_field_name." FROM ".$table_name." WHERE oid =".$oid );
+    if ($res && db_numrows($res) > 0) {
+        return @db_result($res,0,0);
+    } else {
+        return 0;
+    }*/
+    $res=db_query("SELECT max($pkey_field_name) AS id FROM $table_name");
+    if ($res && db_numrows($res) > 0) {
+        return db_result($res,0,'id');
+    } else {
+        return 0;
+    }
+}
+
+function db_last_oid()
+      {
+      	global $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname,$db_debug,
+		$conn,$conn_update,$QUERY_COUNT;
+        global $DBSERVER,$OWNER,$PW,$DB	;
+             return pg_getlastoid($conn);
+      }
+
+
+/**
+ * Returns the last error from the database
+ */
+function db_error() {
+	return @pg_last_error();
+}
+
+/**
+ * Get the flags associated with the specified field in a result 
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ *
+ * 					Examples: "not_null", "primary_key", "unique_key", "multiple_key",					 
+ *                    "blob", "unsigned", "zerofill","binary", "enum",                  
+ *                    "auto_increment", "timestamp"                                     
+ */
+
+function db_field_flags($lhandle,$fnumber) {
+	   print "db_field_flags()	isn't implemented";
+	   
+}
+
+/**                                                       
+ * Get the type of the specified field  
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */                                                       
+                                                          
+function db_field_type($lhandle,$fnumber) {               
+	   return @pg_fieldtype($lhandle,$fnumber);         
+}                                                         
+
+/**                                                       
+ * Get the length of the specified field                                                            
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */                                                       
+                                                          
+function db_field_len($lhandle,$fnumber) {               
+	   return @pg_fieldlen($lhandle,$fnumber);         
+} 
+
+?>
\ No newline at end of file

Added: branches/print_dev/http/php/mb_listWMCs.php
===================================================================
--- branches/print_dev/http/php/mb_listWMCs.php	                        (rev 0)
+++ branches/print_dev/http/php/mb_listWMCs.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1,202 @@
+<?php
+# $Id: mb_listWMCs.php 2900 2008-09-01 08:53:14Z astrid_emde $
+# http://www.mapbender.org/index.php/mb_listWMCs.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__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__) . "/../classes/class_administration.php");
+require_once(dirname(__FILE__) . "/../classes/class_wmc.php");
+ini_set('error_reporting', 'E_ALL & ~ E_NOTICE & ~ E_WARNINGS');
+
+$gui_id = $_SESSION["mb_user_gui"];
+$user_id = $_SESSION["mb_user_id"];
+
+$action = $_GET["action"];
+$wmcId = $_GET["wmc_id"];
+
+$delWmcId = $_POST["del_wmc_id"];
+$clientFilename = $_FILES['local_wmc_filename']['tmp_name'];
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+	<head>
+		<meta http-equiv="cache-control" content="no-cache">
+		<meta http-equiv="pragma" content="no-cache">
+		<meta http-equiv="expires" content="0">
+		<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET;?>">	
+		<title>Select web map contect document from list</title>
+	</head>
+	<body>
+		<form name='delete_wmc' action='<?php echo $self; ?>' method='POST'>
+			<input type='hidden' id='delete_wmc' name='del_wmc_id' value ='' >
+		</form>
+
+<?php
+function mb_listWMCs($wmcIdArray, $form_target){
+	$display = "<h2 style='font-family: Arial, Helvetica, sans-serif; color: #808080;background-color: White;'><font align='left' color='#000000'>load WMC from list</font></h2>";
+	$display .= "<table width='90%' style='font-family: Arial, Helvetica, sans-serif;font-size : 12px;color: #808080;' border='1' cellpadding='3' rules='rows'><tr style='background-color:#F0F0F0;' width='80px'><td ><b>WMC name</b></td><td><b>last update</b></td><td colspan=5></td></tr>";
+
+	if (count($wmcIdArray) > 0) {
+		$v = array();
+		$t = array();
+
+		$wmcIdList = "";
+		for ($i = 0; $i < count($wmcIdArray); $i++){
+			if ($i > 0){ 
+				$wmcIdList .= ",";
+			}
+			$wmcIdList .= "$".($i+1);
+			array_push($v, $wmcIdArray[$i]);
+			array_push($t, 's');
+		}
+		$sql_list_wmcs = "SELECT DISTINCT wmc_id, wmc_title, wmc_timestamp FROM mb_user_wmc ";
+		$sql_list_wmcs .= "WHERE wmc_id IN (" . $wmcIdList . ") ";
+		$sql_list_wmcs .= "ORDER BY wmc_timestamp DESC";
+		
+		$res_list_wmcs = db_prep_query($sql_list_wmcs, $v, $t);
+		while($row = db_fetch_array($res_list_wmcs)){
+			$this_id = $row["wmc_id"];
+			$this_title = $row["wmc_title"];
+			$this_timestamp = date("M d Y H:i:s", $row["wmc_timestamp"]); 
+
+			$display .= "<tr onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
+			$display .= "<td>".$this_title."</td>";
+			$display .= "<td>".$this_timestamp. "</td>";
+			$display .= "<td><a href=\"" . $form_target . "&action=load&wmc_id=".$this_id."\"><img src=\"../img/button_gray/wmc_load.png\" title=\"load this WMC\"  border=0></a></td>";
+			$display .= "<td><a href=\"" . $form_target . "&action=merge&wmc_id=".$this_id."\"><img src=\"../img/button_gray/wmc_merge.png\" title=\"merge WMC\"  border=0></a></td>";
+			$display .= "<td><a href=\"" . $form_target . "&action=append&wmc_id=".$this_id."\"><img src=\"../img/button_gray/wmc_append.png\" title=\"append WMC\"  border=0></a></td>";
+			$display .= "<td><a href='../javascripts/mod_displayWmc.php?wmc_id=".$this_id."' target = '_blank'><img src=\"../img/button_gray/wmc_xml.png\" title=\"display WMC XML\"  border=0></a></td>";
+			$display .= "<td><a href=\"" . $form_target . "&action=delete&wmc_id=".$this_id."\"><img src=\"../img/button_gray/del.png\" title=\"delete this WMC\"  border=0></a></td>";
+			$display .= "</tr>";
+		}
+	}
+	else{
+		$display .= "<tr><td>There are no WMCs availiable</td></tr>";
+	}	
+	$display .= "</table>";
+	   
+	return $display;
+}
+
+function getTarget($gui_id) {
+	$sql = "SELECT e_requires, e_target FROM gui_element WHERE e_id = 'loadwmc' AND fkey_gui_id = $1";
+	$v = array($gui_id);
+	$t = array("s");
+	$res = db_prep_query($sql, $v, $t);
+	$cnt = 0;
+	while($row = db_fetch_array($res)){ 
+		$e_target = $row["e_target"];
+		$e_require = $row["e_requires"];
+		$cnt++;
+	}
+	if ($cnt > 1) { 
+		$e = new mb_exception("listWMCs: e_id 'loadwmc' not unique in GUI '" . $gui_id . "'!");
+	}
+
+	$targetArray = explode(",", $e_target);
+	if (in_array('mapframe1', $targetArray)) {
+		return 'mapframe1';
+	}
+	else {
+		return trim($targetArray[0]);
+	}
+}
+
+function loadFile($filename) {
+	$handle = fopen($filename, "r");
+	$cnt = 0;
+	while (!feof($handle)) {
+    	$buffer .= fgets($handle, 4096);
+	}
+	fclose ($handle);
+	return $buffer;
+}
+
+$admin = new administration();
+$wmcIdArray = $admin->getWmcByOwner($user_id);
+
+// wmc is being deleted
+if (!empty($delWmcId)) {
+	$result = $admin->deleteWmc($delWmcId, $user_id);
+	if (!$result) {
+		echo "<script language='javascript'>";
+		echo "alert('WMC could not be deleted!');";
+		echo "</script>";
+	}
+}
+// wmc is being loaded from file
+elseif ($clientFilename) {
+	$serverFilename = "../tmp/wmc" . time() . ".xml";
+	copy($clientFilename, $serverFilename);
+	
+	$wmc = new wmc();
+	$wmc->createObjFromWMC_xml(loadFile($serverFilename));
+	
+	$mytarget = getTarget($gui_id);
+	$js = $wmc->createJsObjFromWMC("window.opener.", $mytarget, "load");
+	echo "<script language='javascript'>";
+	echo $js;
+	if ($wmc->getTitle()) {
+		$title = "'" . $wmc->getTitle() . "' ";
+	}
+	echo "alert(\"WMC " . $title . ": load successful.\");\n";
+	echo "window.close();";
+	echo "</script>";
+}
+
+// load a WMC from file
+?>
+<h2 style='font-family: Arial, Helvetica, sans-serif; color: #808080;background-color: White;'><font align='left' color='#000000'>load WMC from file</font></h2>
+<form enctype="multipart/form-data" action="<?php echo $self;?>" method=POST target="_self"> 
+<input type='file' name='local_wmc_filename'>
+<input type='submit' value='load'>
+</form>
+<?php
+
+// load a WMC from list
+echo mb_listWMCs($wmcIdArray, $self);
+		
+if ($wmcId && in_array($wmcId, $wmcIdArray)){
+	if ($action == "delete") {
+		echo "<script language='javascript'>";
+		echo "value = confirm('Do you really want to delete this document?');";
+		echo "if (value == true) {";
+		echo "document.delete_wmc.del_wmc_id.value = '" . $wmcId . "';";
+		echo "document.delete_wmc.submit();";
+		echo "}";
+		echo "</script>";
+	}
+	else if ($action == "append" || $action == "merge" || $action == "load") {
+		$mytarget = getTarget($gui_id);
+
+		$wmc = new wmc();
+		$wmc->createObjFromWMC_id($wmcId);
+		$js = $wmc->createJsObjFromWMC("window.opener.", $mytarget, $action);
+
+		echo "<script language='javascript'>";
+		echo $js;
+		if ($wmc->getTitle()) {
+			$title = "'" . $wmc->getTitle() . "' ";
+		}
+		echo "alert(\"WMC " . $title . ": " . $action . " successful.\");\n";
+		echo "window.close();";
+		echo "</script>";
+	}
+}
+?>
+</body>
+</html>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_WMSpreferences.php
===================================================================
--- branches/print_dev/http/php/mod_WMSpreferences.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_WMSpreferences.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -106,27 +106,6 @@
 var ind = window.opener.getMapObjIndexByName(mod_WMSpreferences_target1);
 var my = window.opener.mb_mapObj[ind];
 
- function mb_swapWmsByIndex(mapObj_ind, indexA, indexB) {
-	if (indexA != indexB && indexA >= 0 && indexA < mb_mapObj[mapObj_ind].wms.length && indexB >= 0 && indexB < mb_mapObj[mapObj_ind].wms.length) {
-		upper = mb_mapObj[mapObj_ind].wms[indexA];
-		mb_mapObj[mapObj_ind].wms[indexA] = mb_mapObj[mapObj_ind].wms[indexB];
-		mb_mapObj[mapObj_ind].wms[indexB] = upper;
-		var upperLayers = mb_mapObj[mapObj_ind].layers[indexA];
-		var upperStyles = mb_mapObj[mapObj_ind].styles[indexA];
-		var upperQuerylayers = mb_mapObj[mapObj_ind].querylayers[indexA];
-		mb_mapObj[mapObj_ind].layers[indexA] = mb_mapObj[mapObj_ind].layers[indexB];
-		mb_mapObj[mapObj_ind].styles[indexA] = mb_mapObj[mapObj_ind].styles[indexB];
-		mb_mapObj[mapObj_ind].querylayers[indexA] = mb_mapObj[mapObj_ind].querylayers[indexB];
-		mb_mapObj[mapObj_ind].layers[indexB] = upperLayers;
-		mb_mapObj[mapObj_ind].styles[indexB] = upperStyles;
-		mb_mapObj[mapObj_ind].querylayers[indexB] = upperQuerylayers;
-		return true;
-	}
-	else {
-		return false;
-	}
-}
-
  
 
 // Opacity version

Modified: branches/print_dev/http/php/mod_addWmsFromFeatureInfo.php
===================================================================
--- branches/print_dev/http/php/mod_addWmsFromFeatureInfo.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_addWmsFromFeatureInfo.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -23,56 +23,6 @@
 
 echo "var mod_target = '".$e_target[0]."';";
 ?>
-function mb_swapWmsByIndex(mapObj_ind, indexA, indexB) {
-	if (indexA != indexB && indexA >= 0 && indexA < mb_mapObj[mapObj_ind].wms.length && indexB >= 0 && indexB < mb_mapObj[mapObj_ind].wms.length) {
-		upper = mb_mapObj[mapObj_ind].wms[indexA];
-		mb_mapObj[mapObj_ind].wms[indexA] = mb_mapObj[mapObj_ind].wms[indexB];
-		mb_mapObj[mapObj_ind].wms[indexB] = upper;
-		var upperLayers = mb_mapObj[mapObj_ind].layers[indexA];
-		var upperStyles = mb_mapObj[mapObj_ind].styles[indexA];
-		var upperQuerylayers = mb_mapObj[mapObj_ind].querylayers[indexA];
-		mb_mapObj[mapObj_ind].layers[indexA] = mb_mapObj[mapObj_ind].layers[indexB];
-		mb_mapObj[mapObj_ind].styles[indexA] = mb_mapObj[mapObj_ind].styles[indexB];
-		mb_mapObj[mapObj_ind].querylayers[indexA] = mb_mapObj[mapObj_ind].querylayers[indexB];
-		mb_mapObj[mapObj_ind].layers[indexB] = upperLayers;
-		mb_mapObj[mapObj_ind].styles[indexB] = upperStyles;
-		mb_mapObj[mapObj_ind].querylayers[indexB] = upperQuerylayers;
-		return true;
-	}
-	else {
-		return false;
-	}
-}
-
-
-function mb_wmsMoveByIndex(mapObj_ind, fromIndex, toIndex) {
-	if (fromIndex != toIndex && fromIndex >= 0 && fromIndex < mb_mapObj[mapObj_ind].wms.length && toIndex >= 0 && toIndex < mb_mapObj[mapObj_ind].wms.length) {
-		var changed = false;
-		var i;
-		var result;
-		if (fromIndex > toIndex) {
-			for (i = fromIndex; i > toIndex ; i--) {
-				result = mb_swapWmsByIndex(mapObj_ind, i-1, i);
-				if (result === true) {
-					changed = true;
-				}
-			}
-		}
-		else {
-			for (i = fromIndex; i < toIndex ; i++) {
-				result = mb_swapWmsByIndex(mapObj_ind, i, i+1);
-				if (result === true) {
-					changed = true;
-				}
-			}
-		}
-		return changed;
-	}
-	else {
-		return false;
-	}
-}
-
 function addWmsFromFeatureInfo(pointer_name, version) {
 	mb_registerloadWmsSubFunctions("addWmsFromInfo_pos()");
 	var mywms = pointer_name; 
@@ -105,4 +55,5 @@
 		mb_wmsMoveByIndex(getMapObjIndexByName(mod_target), mb_mapObj[getMapObjIndexByName(mod_target)].wms.length-1, mod_addWmsFromFeatureInfo_position-1);
 	}
 	eventAfterLoadWMS.unregister("addWmsFromInfo_pos()");
+//	mb_removeFunctionFromArray("mb_loadWmsSubFunctions", "addWmsFromInfo_pos()");	
 }
\ No newline at end of file

Added: branches/print_dev/http/php/mod_createJSObjFromDB.php
===================================================================
--- branches/print_dev/http/php/mod_createJSObjFromDB.php	                        (rev 0)
+++ branches/print_dev/http/php/mod_createJSObjFromDB.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1,33 @@
+<?php
+# $Id: mod_createJSObjFromDB.php 2144 2008-02-26 23:16:14Z christoph $
+# http://www.mapbender.org/index.php/mod_createJSObjectFromDB.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__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_wms.php");
+
+$sql = "SELECT fkey_wms_id FROM gui_wms WHERE fkey_gui_id = $1 ORDER BY gui_wms_position";
+$v = array($_SESSION["mb_user_gui"]);
+$t = array('s');
+$res = db_prep_query($sql,$v,$t);
+
+while($row = db_fetch_array($res)){
+	$mywms = new wms();
+	$mywms->createObjFromDB($_SESSION["mb_user_gui"],$row["fkey_wms_id"]);
+	$mywms->createJsObjFromWMS();
+}
+?>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_editElements.php
===================================================================
--- branches/print_dev/http/php/mod_editElements.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_editElements.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -466,12 +466,6 @@
 	   echo "<input type='button' class='' name='' value='delete' onclick='thisDelete()'> \n";
 	   echo "<input type='button' class='' name='' value='show' onclick='thisShow()'> \n";
 	   echo "<input type='button' class='' name='' value='sql' onclick='thisExport()'> \n";
-	   echo	"<input type='button' class='' name='' value='arrange' " .
-	   		"onclick='window.open(\"mod_editApplication.php?" . SID . "&" .
-	   		"guiID=" . $_SESSION["mb_user_gui"] . "&" .
-	   		"editApplicationId=" . $guiList1 . "\", " .
-	   		"\"edit application\", " .
-	   		"\"width=500,height=500,dependent\");'> \n";
 	   echo "</div>\n";
 	   echo "<input type='hidden'  name='guiList1' value='".$guiList1."' >\n";
 	   echo "<input type='hidden'  name='guiId' value='".$guiId."' >\n";

Modified: branches/print_dev/http/php/mod_editGuiWms.php
===================================================================
--- branches/print_dev/http/php/mod_editGuiWms.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_editGuiWms.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -82,6 +82,7 @@
 			}
 		}
 	}
+
 }
 function checkBoxValue(){
    for(var i=0; i<document.forms[0].elements.length; i++){
@@ -170,15 +171,19 @@
 		$cnt++;
 	}
 	#if($cnt > 1){die("Error: WMS (ID) not unique!");}
+
 		$sql = "Delete from gui_wms where fkey_gui_id = $1 and fkey_wms_id = $2 ";
 		$v = array($guiList,$wmsList);
 		$t = array('s','i');
 		$res = db_prep_query($sql,$v,$t);
+
 		$sql = "Delete from gui_layer where fkey_gui_id = $1 and gui_layer_wms_id = $2";
 		$v = array($guiList,$wmsList);
 		$t = array('s','i');
 		$res = db_prep_query($sql,$v,$t);
+
 		$del='false';
+
 		$sql = "UPDATE gui_wms SET gui_wms_position = (gui_wms_position - 1) WHERE gui_wms_position > $1";
 		$sql .= " AND fkey_gui_id = $2 ";
 		$v = array($wms_position,$guiList);
@@ -479,6 +484,7 @@
    $cnt_le++;
 }
 
+
 echo "<div style='position:absolute;left:590px; top:180px;' ><input type='button' style='width:100px;height:100px;background-color:#0066cc' value='save' onclick='checkBoxValue()'></div>";
 echo "<table class='table_top'>";
 echo "<tr>";
@@ -567,6 +573,7 @@
 	}
 	echo "</select>";
 	echo "</td>";
+
 echo "</tr>";
 
 # opacity
@@ -582,6 +589,7 @@
 	}
 	echo "</select>";
 	echo "</td>";
+
 echo "</tr>";
 
 # sld support
@@ -633,6 +641,7 @@
 echo "</td><td></td><td></td><td></td></tr>";
 
 for($i=0; $i<count($layer_id); $i++){
+
 #layer_styles
 $sql_styles = "SELECT * FROM layer_style WHERE  fkey_layer_id = $1";
 $v = array($layer_id[$i]);
@@ -676,6 +685,7 @@
 
   echo "<td><input name='L_".$layer_id[$i]."___gui_layer_minscale' type='text' size='5' value='".$gui_layer_minscale[$i]."'></td>";
   echo "<td style='background:lightgrey'><input name='L_".$layer_id[$i]."___gui_layer_maxscale' type='text' size='5' value='".$gui_layer_maxscale[$i]."'></td>";
+
   /**/
   echo "<td>\n";
   echo "<select class='select_short' name='L_".$layer_id[$i]."___gui_layer_style'>\n";
@@ -688,6 +698,7 @@
        echo ">".$style[$j]."</option>\n";
  }
   echo "</select></td>\n";
+
   /**/
   echo "<td><select class='select_auto' name='L_".$layer_id[$i]."___gui_layer_priority'>";
   for($j=0; $j<count($gui_layer_priority); $j++){
@@ -734,4 +745,4 @@
 }
 ?>
 </body>
-</html>
+</html>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_editUser.php
===================================================================
--- branches/print_dev/http/php/mod_editUser.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_editUser.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -389,4 +389,4 @@
 // -->
 </script>
 </body>
-</html>
+</html>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_forgottenPassword.php
===================================================================
--- branches/print_dev/http/php/mod_forgottenPassword.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_forgottenPassword.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -18,7 +18,8 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 import_request_variables("PG");
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+//require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
 require_once(dirname(__FILE__)."/../classes/class_administration.php");
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Modified: branches/print_dev/http/php/mod_gazetteerMetadata.php
===================================================================
--- branches/print_dev/http/php/mod_gazetteerMetadata.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_gazetteerMetadata.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -236,4 +236,4 @@
 </form>
 <div id='resultDivTag' class='result'></div>
 </body>
-</html>
+</html>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_help.php
===================================================================
--- branches/print_dev/http/php/mod_help.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_help.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -26,7 +26,7 @@
 if(!isset($mod_help_height)){
 	$mod_help_height = 1000;	
 }
-?>
+?>
 <img src='../img/transparent.gif' style='cursor:help' width='<?php echo $mod_help_width ?>' height='<?php echo $mod_help_height ?>' usemap='#mod_help_imagemap' border='0'>
 	<map name='mod_help_imagemap'>
 	<?php
@@ -41,7 +41,7 @@
 		if($row["e_id"] != 'help'){
 			echo "window.open('".$row["e_url"]."');";	
 		}
-		echo "\" ";
+		echo "\" ";
 		echo "id=\"helpArea_".$row['e_id']."\" ";
 		echo "shape=\"rect\" coords=\"".$row['e_left'].",".$row['e_top'].",";		
 		echo ($row['e_left']+$row['e_width']).",".($row['e_top']+$row['e_height'])."\" ";

Added: branches/print_dev/http/php/mod_insertWmcIntoDb.php
===================================================================
--- branches/print_dev/http/php/mod_insertWmcIntoDb.php	                        (rev 0)
+++ branches/print_dev/http/php/mod_insertWmcIntoDb.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1,63 @@
+<?php
+#$Id: mod_insertWmcIntoDb.php 1198 2007-10-18 14:37:52Z baudson $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_insertWmcIntoDb.php,v 1.19 2006/03/09 14:02:42 uli_rothstein Exp $
+# 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__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+require_once(dirname(__FILE__)."/../classes/class_wmc.php");
+require_once(dirname(__FILE__)."/../classes/class_json.php");
+
+$json = new Mapbender_JSON();
+$mapObject = $json->decode(stripslashes($_POST["mapObject"]));
+$user_id = $_SESSION["mb_user_id"];
+$save_in_session = $_POST["saveInSession"];
+$generalTitle = $_POST["generalTitle"];
+
+$extensionData = $json->decode(stripslashes($_POST["extensionData"]));
+
+$wmc = new wmc();
+$wmc->createWMCFromObj($mapObject, $user_id, $generalTitle, $extensionData);
+
+if ($save_in_session) {
+	$_SESSION["mb_wmc"] = $wmc->xml;
+	$_SESSION["epsg"] = $mapObject->epsg;
+	$_SESSION["previous_gui"] = $_SESSION["mb_user_gui"];
+	$e = new mb_notice("mod_insertWMCIntoDB: save WMC in session succeeded.");
+}
+else {
+	if ($user_id && $wmc->wmc_id) {
+		$sql = "INSERT INTO mb_user_wmc VALUES ($1, $2, $3, $4, $5)";
+		$v = array($wmc->wmc_id, $user_id, $wmc->xml, $generalTitle, time());
+		$t = array("s", "i", "s", "s", "s");
+		
+		$res = db_prep_query($sql, $v, $t);
+		if (db_error()) {
+			$errMsg = "Error while saving WMC document '" . $generalTitle . "': " . db_error();
+			echo $errMsg;
+			$e = new mb_exception("mod_insertWMCIntoDB: " . $errMsg);
+		}
+		else {
+			echo "WMC document '" . $generalTitle . "' has been saved.";
+			$e = new mb_notice("mod_insertWMCIntoDB: WMC  '" . $generalTitle . "' saved successfully.");
+		}
+	}
+	else {
+		$e = new mb_exception("mod_insertWMCIntoDB: missing parameters (user_id: ".$user_id.", wmc_id: ".$wmc->wmc_id."))");
+	}
+}
+?>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_loadCapabilitiesList.php
===================================================================
--- branches/print_dev/http/php/mod_loadCapabilitiesList.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_loadCapabilitiesList.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -304,4 +304,4 @@
 echo "<div class='getcapabilities'>" . $wms_getcapabilities . "</div>";
 ?>
 </body>
-</html>
+</html>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_log.php
===================================================================
--- branches/print_dev/http/php/mod_log.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_log.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -18,7 +18,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-require(dirname(__FILE__)."/../include/dyn_php.php");
+require(dirname(__FILE__)."/../include/dyn_php.php");
 
 if($_REQUEST['req']){
 	ignore_user_abort();
@@ -29,6 +29,6 @@
 	if(empty($req)){$req = "init";}
 	include(dirname(__FILE__)."/../classes/class_log.php");
 	$log = new log("default", $req, $time_client, $logtype);
-}
-echo "log into $logtype successful!";
+}
+echo "log into $logtype successful!";
 ?>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_logout.php
===================================================================
--- branches/print_dev/http/php/mod_logout.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_logout.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -54,4 +54,4 @@
 		}
 	}
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_map1.php
===================================================================
--- branches/print_dev/http/php/mod_map1.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_map1.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -41,7 +41,6 @@
    $e_height = $row["e_height"];
    $cnt++;
 }
-session_write_close();
 if($cnt > 1){ echo "alert('mapframe1: ID not unique!');";}
 echo '<script type="text/javascript">';
 echo "\n";
@@ -49,80 +48,24 @@
 echo "var mod_map1_height = '".$e_height."';\n";
 echo "</script>\n";
 ?>
-<!--
-<script type='text/javascript' src='../extensions/jquery-1.2.6.min.js'></script>
-<script type='text/javascript' src='../extensions/jquery.mousewheel.min.js'></script>
-<script type='text/javascript' src='../extensions/jqjson.js'></script>
--->
 <script type="text/javascript">
 <!--
 
-var mapTimeout;
-var	sum_delta = 0;
-var lastTimestamp;
-var lastScrollPositionX;
-var lastScrollPositionY;
-
 function init () {
-	
 	parent.eventInitMap.register(function init_mod_map1(){
 		parent.mb_registerMapObj('mapframe1', 'maps', null,mod_map1_width, mod_map1_height);
-		
-		parent.$(document, window.frames['mapframe1']).mousewheel(function (event, delta) {
-			if (sum_delta == 0) {
-				mapTimeout = setTimeout(function () {
-						lastScrollPositionX=event.pageX;
-						lastScrollPositionY=event.pageY;
-						mousewheelZoom();	
-					}, 
-					100);
-			}
-			sum_delta = sum_delta + (delta);
-			var currentTime = new Date();
-			lastTimestamp = currentTime.getTime();
-			
-			return false;
-		});
+		document.getElementById("maps").style.width = mod_map1_width;
+		document.getElementById("maps").style.height = mod_map1_height;
 	});
 }
 
-function mousewheelZoom () {
-	var currentTime = new Date();
-
-	if (currentTime.getTime() - lastTimestamp > 200) {
-				
-		var ind = parent.getMapObjIndexByName('mapframe1');			
-		var pos = parent.makeClickPos2RealWorldPos("mapframe1", lastScrollPositionX, lastScrollPositionY);
-				
-		if (sum_delta > 0) {
-			parent.zoom("mapframe1", true, Math.pow(parent.mapbender.zoomMousewheel, sum_delta), pos[0],pos[1]);
-		}
-		else {
-			parent.zoom("mapframe1", false, Math.pow(parent.mapbender.zoomMousewheel, -sum_delta), pos[0], pos[1]);
-		}
-		
-		var newPosX =  parent.parent.mb_mapObj[ind].width - lastScrollPositionX;
-		var newPosY =  parent.parent.mb_mapObj[ind].height - lastScrollPositionY;
-				
-		var posAfterZoom = parent.makeClickPos2RealWorldPos("mapframe1", newPosX, newPosY);
-		parent.zoom('mapframe1', false, 1.0, posAfterZoom[0], posAfterZoom[1]); 
-		
-		sum_delta = 0;
-		clearTimeout(mapTimeout);
-	}
-	else {
-		mapTimeout = setTimeout(function () {
-				mousewheelZoom(sum_delta);	
-			}, 
-			100);
-	}
-}
 // -->
 </script>
 </head>
 <body leftmargin='0' topmargin='0' onload="init()" bgcolor='#ffffff'>
 <div id='markResult' name='maps' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; z-index:26'> </div>
 <div id='maps' name='maps' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; z-index:2;'> </div>
+
 <div id='highlight' style="position:absolute;top:-10px;left:-10px;width:14px;height:14px;z-index:3;visibility:visible"><img src="../img/redball.gif"/></div>
 <div id='l_right' name='l_right' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:10;visibility:hidden;background-color:#ff0000;cursor: crosshair;"></div>
 <div id='l_bottom'  name='l_bottom' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:11;visibility:hidden;background-color:#ff0000;cursor: crosshair;"></div>

Modified: branches/print_dev/http/php/mod_mapOV.php
===================================================================
--- branches/print_dev/http/php/mod_mapOV.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_mapOV.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -68,10 +68,12 @@
 		document.onmousedown = parent.mod_box_start;
 		document.onmouseup = mod_ov_getExtent;
 		document.onmousemove = parent.mod_box_run;
+		document.getElementById("maps").style.width = mod_overview_width;
+		document.getElementById("maps").style.height = mod_overview_height;   
 		
 		var ind = parent.getMapObjIndexByName('overview');
 		var ov_extent = parent.mb_mapObj[ind].getExtentInfos();
-		parent.mb_mapObj[ind].isOverview = true;
+		parent.mb_setWmcExtensionData({"ov_minx":ov_extent.minx,"ov_miny":ov_extent.miny,"ov_maxx":ov_extent.maxx,"ov_maxy":ov_extent.maxy});
 	});
 }
 function mod_ov_setHandler(e){

Modified: branches/print_dev/http/php/mod_meetingPoint.php
===================================================================
--- branches/print_dev/http/php/mod_meetingPoint.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_meetingPoint.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -26,25 +26,12 @@
 <title>meetingPoint</title>
 <?php
 include '../include/dyn_css.php';
-
-$sql = "SELECT DISTINCT e_target FROM gui_element WHERE e_id = '".$_REQUEST["e_id_css"]."' AND fkey_gui_id = $1";
-$v = array($gui_id);
-$t = array('s');
-
-$res = db_prep_query($sql, $v, $t);
-$cnt = 0;
-while($row = db_fetch_array($res)){    
-	$e_target[$cnt] = $row["e_target"];
-	$cnt++;
-}
-
-
 ?>
 <script language='JavaScript'>
 <!--
 <?php
 include('../include/dyn_js.php');
-echo "var mod_meetingPoint_target = '".$e_target."';";
+echo "var mod_meetingPoint_target = '" . $_REQUEST["e_target"] . "';";
 echo "var meetingPoint_write_to = 'meetingPoint';";
 ?>
 try{
@@ -234,7 +221,7 @@
     	my_meetingPoint += encodeURIComponent(document.forms[0].mytext.value);
 
     	
-    	my_meetingPoint += "," + document.forms[0].x.value + ",";
+    	my_meetingPoint += "|" + document.forms[0].x.value + "|";
     	my_meetingPoint += document.forms[0].y.value;
 
     	if(meetingPoint_export_format == 'email'){
@@ -301,4 +288,4 @@
 <br>
 </form>
 </body>
-</html>
+</html>
\ No newline at end of file

Added: branches/print_dev/http/php/mod_showGuiName.php
===================================================================
--- branches/print_dev/http/php/mod_showGuiName.php	                        (rev 0)
+++ branches/print_dev/http/php/mod_showGuiName.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1,42 @@
+<?php
+# $Id: mod_showGuiName.php 2920 2008-09-10 14:20:01Z astrid_emde $
+#http://www.mapbender.org/ShowGuiName
+# 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.
+
+import_request_variables("PG");
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Show User</title>
+<?php
+include '../include/dyn_css.php';
+?>
+</head>
+<body leftmargin="5" topmargin="0">
+<?php
+$guiName=$_REQUEST["gui_name"];
+
+echo "<div class='text4'>".$gui_id."</div>";
+
+?>
+</body>
+</html>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_treefolderClient.php
===================================================================
--- branches/print_dev/http/php/mod_treefolderClient.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_treefolderClient.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -204,22 +204,12 @@
 		cBox[ind]['layer'] = array_layer;
 	}
 }
-function mb_getLayerObjByName(fname,wms_id,layer_name){
-	var ind = parent.getMapObjIndexByName(fname);
-	var wmsInd = parent.getWMSIndexById(fname,wms_id);
-	var t = parent.mb_mapObj[ind].wms[wmsInd];
-	for(var i=0; i < t.objLayer.length; i++){
-		if(t.objLayer[i].layer_name == layer_name){
-			return t.objLayer[i];
-		}
-	}
-}
 function checkLayer(){
 	var checkit;
 	for(var i=0; i<cBox.length; i++){
 		checkit = true;
 		for(var j=0; j<cBox[i]['wms'].length;j++){
-			var obj = mb_getLayerObjByName(treetarget,cBox[i]['wms'][j],cBox[i]['layer'][j]);
+			var obj = parent.mb_getLayerObjByName(treetarget,cBox[i]['wms'][j],cBox[i]['layer'][j]);
 			if(obj){
 				if(obj.gui_layer_visible == '0' || obj.gui_layer_visible == 0){
 					checkit = false;

Modified: branches/print_dev/http/php/mod_wfs.php
===================================================================
--- branches/print_dev/http/php/mod_wfs.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_wfs.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -165,7 +165,6 @@
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_edit'] = '".$row["f_edit"]."';";
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_mandatory'] = '".$row["f_mandatory"]."';";
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_auth_varname'] = '".$row["f_auth_varname"]."';";
-			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_operator'] = '".$row["f_operator"]."';";
 			$cnt++;
 		}
 		if($cnt == 0){die("wfs_conf data not available");}		
@@ -177,4 +176,4 @@
 </head>
 <body leftmargin='0' topmargin='10'  bgcolor='#ffffff' onload='register()'>
 </body>
-</html>
+</html>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_wfs_conf.php
===================================================================
--- branches/print_dev/http/php/mod_wfs_conf.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_wfs_conf.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -60,40 +60,6 @@
 function validate(){
 	return true;
 }
-
-function removeChildNodes(node) {
-	while (node.childNodes.length > 0) {
-		var childNode = node.firstChild;
-		node.removeChild(childNode);
-	}
-}
-
-function controlOperators(checkVal,operatorField,valType){
-	var opSelect = document.getElementById(operatorField);
-	removeChildNodes(opSelect);
-	option1 = new Option("-----","0");
-	opSelect.options[opSelect.length] = option1;
-	if(checkVal==true){
-		opSelect.disabled = '';
-		option2 = new Option("%...%","bothside");
-		opSelect.options[opSelect.length] = option2;
-		option3 = new Option("...%","rightside");
-		opSelect.options[opSelect.length] = option3;
-		option4 = new Option("equal","equal");
-		opSelect.options[opSelect.length] = option4;
-		option5 = new Option(">","greater_than");
-		opSelect.options[opSelect.length] = option5;
-		option6 = new Option("<","less_than");
-		opSelect.options[opSelect.length] = option6;
-		option7 = new Option(">=","greater_equal_than");
-		opSelect.options[opSelect.length] = option7;
-		option8 = new Option("<=","less_equal_than");
-		opSelect.options[opSelect.length] = option8;
-	}
-	else{
-		opSelect.disabled = 'disabled';
-	}
-}
 </script>
 
 </head>
@@ -144,7 +110,7 @@
         $wfsID = db_insert_id($con,'wfs_conf','wfs_conf_id');
 
         for ($i = 0; $i < $_REQUEST["num"]; $i++){
-                $sql = "INSERT INTO wfs_conf_element (fkey_wfs_conf_id,f_id,f_search,f_pos,f_min_input,f_style_id,f_toupper,f_label,f_label_id,f_show,f_respos,f_edit,f_form_element_html,f_mandatory,f_auth_varname,f_show_detail,f_detailpos,f_operator) VALUES(";
+                $sql = "INSERT INTO wfs_conf_element (fkey_wfs_conf_id,f_id,f_search,f_pos,f_style_id,f_toupper,f_label,f_label_id,f_show,f_respos,f_edit,f_form_element_html,f_mandatory,f_auth_varname,f_show_detail) VALUES(";
                 $sql .= "$1, $2, ";
                 if (!empty($_REQUEST["f_search".$i])) {
                 	$sql .= "'1'";
@@ -152,46 +118,45 @@
                 else {
                 	$sql .= "'0'";
                 }
-                $sql .= ", $3, $4, $5, ";
+                $sql .= ", $3, $4, ";
 				if (!empty($_REQUEST["f_toupper".$i])) {
                 	$sql .= "'1'";
                 }
                 else {
                 	$sql .= "'0'";
                 }				
-                $sql .= ",$6, $7, ";
+                $sql .= ",$5, $6, ";
                 if (!empty($_REQUEST["f_show".$i])) {
                 	$sql .= "'1'";
                 }
                 else {
                 	$sql .= "'0'";
                 }
-                $sql .= ", $8, ";
+                $sql .= ", $7, ";
                 if (!empty($_REQUEST["f_edit".$i])) {
                 	$sql .= "'1'";
                 } 
                 else {
                 	$sql .= "'0'";
                 }
-                $sql .= ",$9, ";
+                $sql .= ",$8, ";
                 if (!empty($_REQUEST["f_mandatory".$i])) {
                 	$sql .= "'1'";
                 }
                 else {
                 	$sql .= "'0'";
                 }
-                $sql .= ",$10,";
-                if(!empty($_REQUEST["f_show_detail".$i])){
+                $sql .= ",$9,";
+                if (!empty($_REQUEST["f_show_detail".$i])) {
                 	$sql .= "'1'";
                 }
                 else {
                 	$sql .= "'0'";
                 }
-                $sql .= ",$11,$12";
  				$sql .= "); ";
 
-				$v = array($wfsID, $_REQUEST["f_id".$i], $_REQUEST["f_pos".$i], $_REQUEST["f_min_input".$i], $_REQUEST["f_style_id".$i], $_REQUEST["f_label".$i], $_REQUEST["f_label_id".$i], $_REQUEST["f_respos".$i], stripslashes($_REQUEST["f_form_element_html".$i]), $_REQUEST["f_auth_varname".$i], $_REQUEST["f_detailpos".$i], $_REQUEST["f_operator".$i]);
-				$t = array("i", "s", "s", "i", "s", "s", "s", "i", "s", "s", "i", "s");
+				$v = array($wfsID, $_REQUEST["f_id".$i], $_REQUEST["f_pos".$i], $_REQUEST["f_style_id".$i], $_REQUEST["f_label".$i], stripslashes($_REQUEST["f_label_id".$i]), $_REQUEST["f_respos".$i], stripslashes($_REQUEST["f_form_element_html".$i]), $_REQUEST["f_auth_varname".$i]);
+				$t = array("i", "s", "s", "s", "s", "s", "i", "s", "s");
                 $res = db_prep_query($sql, $v, $t);
         }
         if (isset($_REQUEST["f_geom"])) {
@@ -286,7 +251,7 @@
         echo "<tr><td>Style:</td><td><textarea cols=50 rows=5 name='g_style'></textarea></td></tr>" ;
         echo "<tr><td>Buffer:</td><td><input type='text' size='4' name='g_buffer' value='1'></td></tr>" ;
         echo "<tr><td>ResultStyle:</td><td><textarea cols=50 rows=5 name='g_res_style'></textarea></td></tr>" ;
-//        echo "<tr><td>WZ-Graphics:</td><td><input name='g_use_wzgraphics' type='checkbox'></td></tr>";
+        echo "<tr><td>WZ-Graphics:</td><td><input name='g_use_wzgraphics' type='checkbox'></td></tr>";
         echo "</table>";
 
 
@@ -299,7 +264,6 @@
                 echo "<td>" . toImage('geom') . "</td>";
                 echo "<td>" . toImage('search') . "</td>";
                 echo "<td>" . toImage('pos') . "</td>";
-                echo "<td>" . toImage('minimum_input') . "</td>";
                 echo "<td>" . toImage('style_id') . "</td>";
                 echo "<td>" . toImage('upper') . "</td>";
                 echo "<td>" . toImage('label') . "</td>";
@@ -307,13 +271,10 @@
                 echo "<td>" . toImage('show') . "</td>";
                 echo "<td>" . toImage('position') . "</td>";
                 echo "<td>" . toImage('show_detail') . "</td>";
-                echo "<td>" . toImage('detail_position') . "</td>";
                 echo "<td>" . toImage('mandatory') . "</td>";
                 echo "<td>" . toImage('edit') . "</td>";
                 echo "<td>" . toImage('html') . "</td>";
                 echo "<td>" . toImage('auth') . "</td>";
-                echo "<td>" . toImage('operator') . "</td>";
-                
         echo "</tr>";
 
         for($i=0; $i<count($aWFS->elements->element_id); $i++){
@@ -321,16 +282,8 @@
                 echo "<td>".$aWFS->elements->element_id[$i]."<input type='hidden' name='f_id".$i."' value='".$aWFS->elements->element_id[$i]."'></td>";
                 echo "<td>".$aWFS->elements->element_name[$i]."<br><div style='font-size:10'>".$aWFS->elements->element_type[$i]."</div></td>";
                 echo "<td><input name='f_geom' type='radio' value='".$aWFS->elements->element_id[$i]."'></td>";
-                echo "<td><input name='f_search".$i."' type='checkbox' onclick='controlOperators(document.forms[0].f_search".$i.".checked,\"f_operator".$i."\",\"".$aWFS->elements->element_type[$i]."\");'></td>";
+                echo "<td><input name='f_search".$i."' type='checkbox'></td>";
                 echo "<td><input name='f_pos".$i."' type='text' size='1' value='0'></td>";
-                echo "<td><select name='f_min_input".$i."' id='f_min_input".$i."'>";
-                echo "<option value='0'>-----</option>";
-                echo "<option value='1'>1</option>";
-                echo "<option value='2'>2</option>";
-                echo "<option value='3'>3</option>";
-                echo "<option value='4'>4</option>";
-                echo "<option value='5'>5</option>";
-                echo "</select></td>";
                 echo "<td><input name='f_style_id".$i."' type='text' size='2' value='0'></td>";
                 echo "<td><input name='f_toupper".$i."' type='checkbox'></td>";
                 echo "<td><input name='f_label".$i."' type='text' size='4'></td>";
@@ -338,14 +291,10 @@
                 echo "<td><input name='f_show".$i."' type='checkbox'></td>";
                 echo "<td><input name='f_respos".$i."' type='text' size='1' value='0'></td>";
                 echo "<td><input name='f_show_detail".$i."' type='checkbox'></td>";
-                echo "<td><input name='f_detailpos".$i."' type='text' size='1' value='0'></td>";
                 echo "<td><input name='f_mandatory".$i."' type='checkbox'></td>";
                 echo "<td><input name='f_edit".$i."' type='checkbox'></td>";
                 echo "<td><textarea name='f_form_element_html".$i."' cols='15' rows='1' ></textarea></td>";
-                echo "<td><input name='f_auth_varname".$i."' type='text' size='8' value=''></td>";
-                echo "<td><select name='f_operator".$i."' id='f_operator".$i."' disabled>";
-                echo "<option value='0'>-----</option>";
-                echo "</select></td>";
+                echo "<td><input name='f_auth_varname".$i."' type='text' size='8'></td>";
                 echo "</tr>";
         }
         echo "</table>";

Modified: branches/print_dev/http/php/mod_wfs_edit.php
===================================================================
--- branches/print_dev/http/php/mod_wfs_edit.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_wfs_edit.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -40,44 +40,6 @@
 function validate(){	
 	return true;
 }
-function openwindow(Adresse) {
-	Fenster1 = window.open(Adresse, "Metadaten", "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=no");
-	Fenster1.focus();
-}
-
-function removeChildNodes(node) {
-	while (node.childNodes.length > 0) {
-		var childNode = node.firstChild;
-		node.removeChild(childNode);
-	}
-}
-
-function controlOperators(checkVal,operator,valType,opValue){
-	var opSelect = document.getElementById(operator);
-	removeChildNodes(opSelect);
-	if(checkVal==true){
-		opSelect.disabled = '';
-		option1 = new Option("-----","0");
-		opSelect.options[opSelect.length] = option1;
-		option2 = new Option("%...%","bothside");
-		opSelect.options[opSelect.length] = option2;
-		option3 = new Option("...%","rightside");
-		opSelect.options[opSelect.length] = option3;
-		option4 = new Option("equal","equal");
-		opSelect.options[opSelect.length] = option4;
-		option5 = new Option(">","greater_than");
-		opSelect.options[opSelect.length] = option5;
-		option6 = new Option("<","less_than");
-		opSelect.options[opSelect.length] = option6;
-		option7 = new Option(">=","greater_equal_than");
-		opSelect.options[opSelect.length] = option7;
-		option8 = new Option("<=","less_equal_than");
-		opSelect.options[opSelect.length] = option8;
-	}
-	else{
-		opSelect.disabled = 'disabled';
-	}
-}
 </script>
 
 </head>
@@ -106,7 +68,7 @@
         $sql .= " WHERE wfs_conf_id = $9;";
         
         $v = array($_REQUEST["wfs_conf_abstract"], $_REQUEST["g_label"], $_REQUEST["g_label_id"], $_REQUEST["g_button"], $_REQUEST["g_button_id"], $_REQUEST["g_style"], $_REQUEST["g_buffer"], $_REQUEST["g_res_style"], $_REQUEST["gaz"]);
-        $t = array("s", "s", "s", "s", "s", "s", "s", "s", "s");
+        $t = array("s", "s", "s", "s", "s", "s", "s", "i", "s");
         $res = db_prep_query($sql, $v, $t);
 		        
 		if (isset($_REQUEST["f_geom"])) {
@@ -139,7 +101,7 @@
                 else {
                 	$sql .= "0";
                 }
-                $sql .= "', f_pos = $1, f_min_input = $2, f_style_id = $3,";
+                $sql .= "', f_pos = $1, f_style_id = $2,";
                 $sql .= "f_toupper = '" ;
                 if (!empty($_REQUEST["f_toupper".$i])) {
                 	$sql .= "1";
@@ -147,7 +109,7 @@
                 else { 
                 	$sql .= "0";
                 }
-                $sql .= "',f_label = $4, f_label_id = $5,";
+                $sql .= "',f_label = $3, f_label_id = $4,";
                 $sql .= "f_show = '";
                 if (!empty($_REQUEST["f_show".$i])) {
                 	$sql .= "1";
@@ -155,7 +117,7 @@
                 else {
                 	$sql .= "0";
                 }
-				$sql .= "',f_respos = $6,";
+				$sql .= "',f_respos = $5,";
                 $sql .= "f_edit = '";
                 if (!empty($_REQUEST["f_edit".$i])) {
                 	$sql .= "1";
@@ -163,7 +125,7 @@
                 else {
                 	$sql .= "0";
                 }
-				$sql .= "', f_form_element_html = $7,";
+				$sql .= "', f_form_element_html = $6,";
                 $sql .= "f_mandatory = '";
                 if (!empty($_REQUEST["f_mandatory".$i])) {
                 	$sql .= "1";
@@ -171,20 +133,19 @@
                 else {
                 	$sql .= "0";
                 }
-				$sql .= "', f_auth_varname = $8";
-			   	$sql .= ", f_show_detail = '";
-                if(!empty($_REQUEST["f_show_detail".$i])){
+				$sql .= "', f_auth_varname = $7,";
+				$sql .= "f_show_detail = '";
+                if (!empty($_REQUEST["f_show_detail".$i])) {
                 	$sql .= "1";
                 }
                 else {
                 	$sql .= "0";
                 }
-                $sql .= "', f_detailpos = $9";
-                $sql .= ", f_operator = $10";
-				$sql .= " WHERE fkey_wfs_conf_id = $11 AND f_id = $12;";
+                $sql .= "'";
+				$sql .= " WHERE fkey_wfs_conf_id = $8 AND f_id = $9;";
 
-				$v = array($_REQUEST["f_pos".$i], $_REQUEST["f_min_input".$i], $_REQUEST["f_style_id".$i], $_REQUEST["f_label".$i], $_REQUEST["f_label_id".$i], $_REQUEST["f_respos".$i], stripslashes($_REQUEST["f_form_element_html".$i]), $_REQUEST["f_auth_varname".$i], $_REQUEST["f_detailpos".$i], $_REQUEST["f_operator".$i], $_REQUEST["gaz"], $_REQUEST["f_id".$i]);
-				$t = array("s", "i", "s", "s", "s", "s", "s", "s", "i", "s", "i", "s");
+				$v = array($_REQUEST["f_pos".$i], $_REQUEST["f_style_id".$i], $_REQUEST["f_label".$i], $_REQUEST["f_label_id".$i], $_REQUEST["f_respos".$i], stripslashes($_REQUEST["f_form_element_html".$i]), $_REQUEST["f_auth_varname".$i], $_REQUEST["gaz"], $_REQUEST["f_id".$i]);
+				$t = array("s", "s", "s", "s", "s", "s", "s", "i", "s");
                 $res = db_prep_query($sql, $v, $t);
         }
 }
@@ -236,9 +197,9 @@
                 echo "<tr><td>Style:</td><td><textarea cols=50 rows=5 name='g_style'>".$row["g_style"]."</textarea></td></tr>" ;
                 echo "<tr><td>Buffer:</td><td><input type='text' size='4' name='g_buffer' value='".$row["g_buffer"]."'></td></tr>" ;
                 echo "<tr><td>ResultStyle:</td><td><textarea cols=50 rows=5 name='g_res_style'>".$row["g_res_style"]."</textarea></td></tr>" ;
-//                echo "<tr><td>WZ-Graphics:</td><td><input name='g_use_wzgraphics' type='checkbox'";
-//                if($row["g_use_wzgraphics"] == 1){ echo " checked"; }
-//                echo "></td></tr>";
+                echo "<tr><td>WZ-Graphics:</td><td><input name='g_use_wzgraphics' type='checkbox'";
+                if($row["g_use_wzgraphics"] == 1){ echo " checked"; }
+                echo "></td></tr>";
                 echo "</table>";
         }
 
@@ -257,7 +218,6 @@
                 echo "<td>" . toImage('geom') . "</td>";
                 echo "<td>" . toImage('search') . "</td>";
                 echo "<td>" . toImage('pos') . "</td>";
-                echo "<td>" . toImage('minimum_input') . "</td>";
                 echo "<td>" . toImage('style_id') . "</td>";
                 echo "<td>" . toImage('upper') . "</td>";
                 echo "<td>" . toImage('label') . "</td>";
@@ -265,12 +225,10 @@
                 echo "<td>" . toImage('show') . "</td>";
                 echo "<td>" . toImage('position') . "</td>";
                 echo "<td>" . toImage('show_detail') . "</td>";
-                echo "<td>" . toImage('detail_position') . "</td>";
                 echo "<td>" . toImage('mandatory') . "</td>";
                 echo "<td>" . toImage('edit') . "</td>";
                 echo "<td>" . toImage('html') . "</td>";
                 echo "<td>" . toImage('auth') . "</td>";
-                echo "<td>" . toImage('operator') . "</td>";
         echo "</tr>";
         $cnt = 0;
         while($row = db_fetch_array($res)){
@@ -286,23 +244,8 @@
 				echo "></td>";
                 echo "<td><input name='f_search".$cnt."' type='checkbox'";
                 if($row["f_search"] == 1){ echo " checked"; }
-                echo " onclick='controlOperators(document.forms[0].f_search".$cnt.".checked,\"f_operator".$cnt."\",\"".$row["element_type"]."\",\"".$row["f_operator"]."\");'></td>";
+                echo "></td>";
                 echo "<td><input name='f_pos".$cnt."' type='text' size='1' value='".$row["f_pos"]."'></td>";
-                echo "<td><select name='f_min_input".$cnt."' id='f_min_input".$cnt."' ";
-                echo ">";
-                echo "<option value='0' ";
-                if($row["f_min_input"] == 0){ echo " selected"; } echo ">-----</option>";
-                echo "<option value='1' ";
-                if($row["f_min_input"] == 1){ echo " selected"; } echo ">1</option>";
-                echo "<option value='2' ";
-                if($row["f_min_input"] == 2){ echo " selected"; } echo ">2</option>";
-                echo "<option value='3' ";
-                if($row["f_min_input"] == 3){ echo " selected"; } echo ">3</option>";
-                echo "<option value='4' ";
-                if($row["f_min_input"] == 4){ echo " selected"; } echo ">4</option>";
-                echo "<option value='5' ";
-                if($row["f_min_input"] == 5){ echo " selected"; } echo ">5</option>";
-                echo "</select></td>";				
                 echo "<td><input name='f_style_id".$cnt."' type='text' size='2' value='".$row["f_style_id"]."'></td>";
                 echo "<td><input name='f_toupper".$cnt."' type='checkbox'";
                 if($row["f_toupper"] == 1){ echo " checked"; }
@@ -316,7 +259,6 @@
                 echo "<td><input name='f_show_detail".$cnt."' type='checkbox'";
                 if($row["f_show_detail"] == 1){ echo " checked"; }
                 echo "></td>";
-                echo "<td><input name='f_detailpos".$cnt."' type='text' size='1' value='".$row["f_detailpos"]."'></td>";
                 echo "<td><input name='f_mandatory".$cnt."' type='checkbox'";
                 if($row["f_mandatory"] == 1){ echo " checked"; }
                 echo "></td>";
@@ -325,37 +267,6 @@
                 echo "></td>";
                 echo "<td><textarea name='f_form_element_html".$cnt."' cols='15' rows='1' >".$row["f_form_element_html"]."</textarea></td>";
                 echo "<td><input name='f_auth_varname".$cnt."' type='text' size='8' value='".$row["f_auth_varname"]."'></td>";
-                echo "<td><select name='f_operator".$cnt."' id='f_operator".$cnt."' ";
-                if($row["f_search"] != 1){
-                	echo "disabled";
-                }
-                echo ">";
-                echo "<option value='0' ";
-                if($row["f_operator"] == 0){ echo " selected"; }
-				echo ">-----</option>";
-				echo "<option value='bothside' ";
-                if($row["f_operator"] == 'bothside'){ echo " selected"; }
-				echo ">%...%</option>";
-				echo "<option value='rightside' ";
-                if($row["f_operator"] == 'rightside'){ echo " selected"; }
-				echo ">...%</option>";
-				echo "<option value='equal' ";
-                if($row["f_operator"] == 'equal'){ echo " selected"; }
-				echo ">equal</option>";
-				echo "<option value='greater_than' ";
-                if($row["f_operator"] == 'greater_than'){ echo " selected"; }
-				echo ">></option>";
-				echo "<option value='less_than' ";
-                if($row["f_operator"] == 'less_than'){ echo " selected"; }
-				echo "><</option>";
-				echo "<option value='less_equal_than' ";
-                if($row["f_operator"] == 'less_equal_than'){ echo " selected"; }
-				echo "><=</option>";
-				echo "<option value='greater_equal_than' ";
-                if($row["f_operator"] == 'greater_equal_than'){ echo " selected"; }
-				echo ">>=</option>";
-				
-     			echo "</select></td>";
                 echo "</tr>";
                 $cnt++;
         }

Modified: branches/print_dev/http/php/mod_wfs_gazetteer_server.php
===================================================================
--- branches/print_dev/http/php/mod_wfs_gazetteer_server.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/mod_wfs_gazetteer_server.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -94,9 +94,7 @@
 	
 	$obj = new WfsConf();
 	$obj->load($wfsConfIdArray);
-	$json = new Mapbender_JSON();
-	$output = $json->encode($obj->confArray);
-	echo $output;
+	echo $obj;
 }
 else if ($command == "getSearchResults") {
 	$wfs_conf_id = $_REQUEST["wfs_conf_id"];
@@ -143,12 +141,24 @@
 	
 	$req = urldecode($url).urlencode($admin->char_decode(stripslashes($filter)));
 	$mygml = new gml2();
-	$mygml->parseFile($req);
+	$mygml->parsegml($req);
 	
-	header("Content-type:application/x-json; charset=utf-8");
-	echo $mygml->toGeoJSON();
+	// generates JavaScript code that will add a geometry array containing
+	// all the result geometries and their attributes (wfs_conf_elements)
+	
+	$js = "";
+	if ($mygml->getMemberCount() > 0) { 
+		$js .= $mygml->exportGeometriesToJS(true);
+	
+		for ($i = 0; $i < $mygml->getMemberCount(); $i++) {
+			for ($j = 0; $j < count($col); $j++){
+				$js .= "geom.get(".$i.").e.setElement('".$j."', '".$mygml->getValueBySeparatedKey($i, $col[$j]) . "');\n";
+			}
+		}
+	}
+	echo $js;
 }
 else {
 	echo "please enter a valid command.";
 }
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/php/nestedSets.php
===================================================================
--- branches/print_dev/http/php/nestedSets.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/php/nestedSets.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -54,16 +54,16 @@
 	if(value == 'insert'){
 		/*
 		if(document.forms[0].title.value == ''){alert("Bitte geben Sie einen Titel an."); permission = false; return;}
-		if(document.forms[0].left.value == ''){alert("W�hlen Sie eine Position."); permission = false; return;}
+		if(document.forms[0].left.value == ''){alert("Wählen Sie eine Position."); permission = false; return;}
       	*/
-      	if(document.forms[0].title.value == ''){alert("Please insert a title."); permission = false; return;}
+      	if(document.forms[0].title.value == ''){alert("<?php echo _mb("Please insert a title.") ?>"); permission = false; return;}
 		if(document.forms[0].left.value == ''){alert("Please choose a position."); permission = false; return;}
       
-      if(document.forms[0].wmsList.selectedIndex > 0 && document.forms[0].layer.selectedIndex == 0){alert("W�hlen Sie einen Layer."); permission = false; return;}
+      if(document.forms[0].wmsList.selectedIndex > 0 && document.forms[0].layer.selectedIndex == 0){alert("Wählen Sie einen Layer."); permission = false; return;}
 		if(permission == true){document.forms[0].action.value = "insert"; document.forms[0].submit();}
 	}
 	if(value == 'delete'){
-		//permission = confirm("Soll das Objekt mit Inhalten gel�scht werden?");
+		//permission = confirm("Soll das Objekt mit Inhalten gelöscht werden?");
 		permission = confirm("Do you want to delete the object and the content of the object?");
 		if(permission == true){
 		document.forms[0].action.value = "delete"; 
@@ -73,7 +73,7 @@
 	if(value == 'update'){
 		/*
 		if(document.forms[0].title.value == ''){alert("Bitte geben Sie einen Titel an."); permission = false; return;}
-		if(document.forms[0].left.value == ''){alert("Bitte w�hlen Sie eine Position."); permission = false; return;}
+		if(document.forms[0].left.value == ''){alert("Bitte wählen Sie eine Position."); permission = false; return;}
 		*/
 		
 		if(document.forms[0].title.value == ''){alert("Please fill in a labeling."); permission = false; return;}
@@ -83,10 +83,10 @@
 	}
 	if(value == 'add'){
 		/*
-		if(document.forms[0].left.value == ''){alert("Bitte w�hlen Sie eine Position."); permission = false; return;}
-		if(document.forms[0].guiList.selectedIndex == 0){alert("Bitte w�hlen Sie eine GUI."); permission = false; return;}
-		if(document.forms[0].wmsList.selectedIndex == 0){alert("Bitte w�hlen Sie einen WMS."); permission = false; return;}
-		if(document.forms[0].layer.selectedIndex == 0){alert("Bitte w�hlen Sie eine Ebene."); permission = false; return;}
+		if(document.forms[0].left.value == ''){alert("Bitte wählen Sie eine Position."); permission = false; return;}
+		if(document.forms[0].guiList.selectedIndex == 0){alert("Bitte wählen Sie eine GUI."); permission = false; return;}
+		if(document.forms[0].wmsList.selectedIndex == 0){alert("Bitte wählen Sie einen WMS."); permission = false; return;}
+		if(document.forms[0].layer.selectedIndex == 0){alert("Bitte wählen Sie eine Ebene."); permission = false; return;}
 		*/
 		
 		if(document.forms[0].left.value == ''){alert("Please fill in a position."); permission = false; return;}
@@ -112,7 +112,7 @@
 }
 if(isset($action) && $action == "insert"){
 	$temp = explode("###", $layer);
-	$sql = "SELECT rgt FROM gui_treegde WHERE lft = $1 AND fkey_gui_id = $1";
+	$sql = "SELECT rgt FROM gui_treegde WHERE lft = $1 AND fkey_gui_id = $2";
 	$v = array($left, $guiList);
 	$t = array("i", "s");
 	$res = db_prep_query($sql, $v, $t);
@@ -124,15 +124,16 @@
 	$v = array($left, $guiList);
 	$t = array("i", "s");
 	db_prep_query($sql, $v, $t);
-	
+#echo $sql . " 1: ".$left." 2:".$guiList."<br>";
 	$sql = "UPDATE gui_treegde SET lft=lft+2 WHERE lft >= $1 AND fkey_gui_id = $2";
 	$v = array($left, $guiList);
 	$t = array("i", "s");
 	db_prep_query($sql, $v, $t);
+#echo $sql . " 1: ".$left." 2:".$guiList."<br>";
 
 	$sql = "INSERT INTO gui_treegde(fkey_gui_id, fkey_layer_id, lft,rgt, ";
 	$sql .= "my_layer_title, layer, wms_id) VALUES($1, $2, $3, $4, $5, $6, $7)";
-		#echo $sql . "<br>";
+#echo $sql . "<br>";
 	$v = array($guiList, $temp[0], $left, ($left+1), $name, $temp[1], $wmsList);
 	$t = array("s", "s", "i", "i", "s", "s", "s");		
 	db_prep_query($sql, $v, $t);
@@ -146,7 +147,7 @@
 		db_query($sql);
 		#hier ist noch was falsch
 		$sql = "INSERT INTO gui_treegde(fkey_gui_id,my_layer_title,lft,rgt,layer) VALUES('".$guiList."','new',".$left.",".($left+1).",'new')";
-		echo $sql . "<br />";
+		#echo $sql . "<br />";
 		db_query($sql);      
 	}
 	*/
@@ -164,14 +165,15 @@
 		$t = array("i", "i", "s");
 		db_prep_query($sql, $v, $t);
 
-		$sql = "UPDATE gui_treegde SET lft=lft-(($1 - $2 + 1)) WHERE lft > $3 AND fkey_gui_id = $4";
-		$v = array($right, $left, $right, $guiList);
-		$t = array("i", "i", "i", "s");
+		$sql = "UPDATE gui_treegde SET lft=lft-$1 WHERE lft > $2 AND fkey_gui_id = $3";
+		$v = array($right-$left+1, $right, $guiList);
+		$t = array("i", "i", "s");
 		db_prep_query($sql, $v, $t);
-
-		$sql = "UPDATE gui_treegde SET rgt=rgt-(($1 - $2 + 1)) WHERE rgt > $3 AND fkey_gui_id = $4";
-		$v = array($right, $left, $right, $guiList);
-		$t = array("i", "i", "i", "s");
+#echo $sql . " r:".$right." l:".$left." 2:".$guiList."<br>";
+		$sql = "UPDATE gui_treegde SET rgt=rgt-$1 WHERE rgt > $2 AND fkey_gui_id = $3";
+		$v = array($right-$left+1, $right, $guiList);
+		$t = array("i", "i", "s");
+#echo $sql . " r:".$right." l:".$left." 2:".$guiList."<br>";
 		db_prep_query($sql, $v, $t);
 	}
 }
@@ -193,12 +195,12 @@
 	$sql_val = "SELECT * FROM gui_treegde WHERE lft = $1 AND fkey_gui_id = $2";
 	$v = array($left, $guiList);
 	$t = array("i", "s");
-	$res = db_prep_query($sql_val, $v, $t);
+	$res_val = db_prep_query($sql_val, $v, $t);
 	
 	$sql = "UPDATE gui_treegde SET ";
 	$sql .= "fkey_layer_id = $1, layer = $2, wms_id =  $3 ";
 	$sql .= "WHERE lft = $4 AND fkey_gui_id = $5";
-	
+
 	$v = array();
 	$t = array("s", "s", "s", "i", "s");	
 
@@ -222,7 +224,6 @@
 	else {
 		array_push($v, $wmsList);
 	}
-
 	array_push($v, $left);	
 	array_push($v, $guiList);	
 	db_prep_query($sql, $v, $t);

Added: branches/print_dev/http/print/checksum.json
===================================================================
--- branches/print_dev/http/print/checksum.json	                        (rev 0)
+++ branches/print_dev/http/print/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"mod_printPDF_pdf.php":"40c195cbdeadb2dd00dadc3b7667292cb5a46969","print_functions.php":"8d33e4f7e022ff98d8db9d4697a718cbde296734","printPDF.conf":"56418cda8cfb6eb29f6541d756e40720493ced15","printPDF_b.conf":"7c543b34af85f0791abcc91ce64a4fe5a63c086d","mod_printPDF.php":"d0ca8e7f918998e13344073bc3ed20ae7fa9550e"}
\ No newline at end of file

Added: branches/print_dev/http/print/img/checksum.json
===================================================================
--- branches/print_dev/http/print/img/checksum.json	                        (rev 0)
+++ branches/print_dev/http/print/img/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"mapbender_logo.png":"7679ccb0b9b56c84e8cc859f18d5717ea507fe1e","northarrow.png":"7f9f58f4868fcc8e663921519c3ee0ca24e9c9f0"}
\ No newline at end of file

Modified: branches/print_dev/http/print/mod_printPDF.php
===================================================================
--- branches/print_dev/http/print/mod_printPDF.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/print/mod_printPDF.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,397 +1,400 @@
-<?php
-# $Id: mod_printPDF.php
-# http://www.mapbender.org/index.php/mod_printPDF.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.
-session_start();
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-?>
-<title>Print PDF</title>
-</head>
-<style type="text/css">
-<!-- 
-select{
-   width:150px;
-} 
-input{
-	width:150px;
-}
-.mycheck{
-	width:15px;
-}
-div{
-	font-family : Arial, Helvetica, sans-serif;
-	font-size: 12px;
-}
--->
-</style>
-<?php
-
-//FIXME:
-//setlocale(LC_ALL, "de_DE.utf8");
-
-require_once(dirname(__FILE__)."/../print/".$_REQUEST["conf"]);
-echo "<script type='text/javascript'>";
-echo "var target = '".$_REQUEST["target"]."';";
-echo "var comment = '".$label_comment."';";
-echo "var comment_length = ".$comment_length.";";
-echo "var label_button = '".$label_button."';";
-echo "var type = '".$type."';";
-echo "</script>";
-?>
-<script type="text/javascript">
-<!--
-
-
-var size;
-var format;
-var map_width;
-var map_height;
-
-if(type=='window'){
-	var pt = window.opener;
-}
-else if(type == 'iframe'){
-	var pt = parent;
-}
-
-function mod_legend_print(){
-	var mod_legend_target = target;
-	var ind = pt.getMapObjIndexByName(mod_legend_target);
-	var layers;
-
-	document.forms[0].layers.value = "";
-	document.forms[0].wms_id.value = "";
-	document.forms[0].wms_title.value = "";
-	document.forms[0].legendurl.value = "";
-	
-	for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
-		layers = pt.mb_mapObj[ind].wms[i].getLayers(pt.mb_mapObj[ind]);
-		if(layers != "" && layers){
-		
-			if(i>0 && document.forms[0].wms_id.value!=''){
-			    document.forms[0].layers.value += "___";
-			    document.forms[0].wms_id.value += "___";
-			    document.forms[0].wms_title.value += "___";
-			    document.forms[0].legendurl.value += "___";
-			}
-					
-			document.forms[0].wms_id.value += pt.mb_mapObj[ind].wms[i].wms_id;   
-			document.forms[0].wms_title.value += pt.mb_mapObj[ind].wms[i].wms_title;
-				
-			for(var j=0; j<layers.length; j++){			
-				var layer = layers[j];
-				var title = pt.mb_mapObj[ind].wms[i].getTitleByLayerName(layers[j]);
-				var layerStyle = pt.mb_mapObj[ind].wms[i].getCurrentStyleByLayerName(layers[j]);
-				if(layerStyle==false){
-					var temp_legendurl = pt.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layers[j],"default");	
-				}
-				else{
-					var temp_legendurl = pt.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layers[j],layerStyle);
-				}
-				
-				//---------- legendurl ----------
-				tmp_name = "";	
-				if(j>0){
-					document.forms[0].layers.value += ",";
-				}
-					document.forms[0].layers.value += title;
-				if(j>0){
-					document.forms[0].legendurl.value += ",";
-				}
-				if (temp_legendurl!= '' || !temp_legendurl == 'true'){
-					document.forms[0].legendurl.value += temp_legendurl;
-				}else{
-					document.forms[0].legendurl.value +='0';
-				}	
-			}	
-		}
-		else{
-			if(i>0 && document.forms[0].wms_id.value!=''){
-			    document.forms[0].layers.value += "___";
-			    document.forms[0].wms_id.value += "___";
-			    document.forms[0].wms_title.value += "___";
-			    document.forms[0].legendurl.value += "___";
-		    }
-			
-			document.forms[0].layers.value += "0";
-		    document.forms[0].wms_id.value += "0";
-		    document.forms[0].wms_title.value += "0";
-		    document.forms[0].legendurl.value += "0";
-		}
-	}//for
-	//alert(document.forms[0].layers.value+"---"+document.forms[0].wms_id.value+"---"+document.forms[0].wms_title.value+"---"+document.forms[0].legendurl.value);	
-		
-}
-
-function validate(){
-	size = document.form1.size.options[document.form1.size.selectedIndex].value;
-	format = document.form1.format.options[document.form1.format.selectedIndex].value;
-	if(size != "" && format != ""){
-		var ind = pt.getMapObjIndexByName(target);
-		var coord = pt.mb_mapObj[ind].extent.split(",");
-		var centerX = parseFloat(coord[0]) + (parseFloat(coord[2]) - parseFloat(coord[0]))/2
-		var centerY = parseFloat(coord[1]) + (parseFloat(coord[3]) - parseFloat(coord[1]))/2
-		if(size == "A4" && format == "portrait"){
-			map_width = <?php echo $a4p_map_width; ?>; 
-			map_height = <?php echo $a4p_map_height; ?>; 
-		}
-		if(size == "A4" && format == "landscape"){
-			map_width = <?php echo $a4l_map_width; ?>;
-			map_height = <?php echo $a4l_map_height; ?>; 
-		}
-		if(size == "A3" && format == "portrait"){
-			map_width = <?php echo $a3p_map_width; ?>;
-			map_height = <?php echo $a3p_map_height; ?>;
-		}
-		if(size == "A3" && format == "landscape"){
-			map_width = <?php echo $a3l_map_width; ?>;
-			map_height = <?php echo $a3l_map_height; ?>;
-		}  
-		if(size == "A2" && format == "portrait"){
-			map_width = <?php echo $a2p_map_width; ?>;
-			map_height = <?php echo $a2p_map_height; ?>;
-		}
-		if(size == "A2" && format == "landscape"){
-			map_width = <?php echo $a2l_map_width; ?>;
-			map_height = <?php echo $a2l_map_height; ?>;
-		}
-		if(size == "A1" && format == "portrait"){
-			map_width = <?php echo $a1p_map_width; ?>;
-			map_height = <?php echo $a1p_map_height; ?>;
-		}
-		if(size == "A1" && format == "landscape"){
-			map_width = <?php echo $a1l_map_width; ?>;
-			map_height = <?php echo $a1l_map_height; ?>;
-		}
-		if(size == "A0" && format == "portrait"){
-			map_width = <?php echo $a0p_map_width; ?>;
-			map_height = <?php echo $a0p_map_height; ?>;
-		}
-		if(size == "A0" && format == "landscape"){
-			map_width = <?php echo $a0l_map_width; ?>;
-			map_height = <?php echo $a0l_map_height; ?>;
-		}     
-		var pos = pt.makeClickPos2RealWorldPos(target, map_width , map_height);
-		var prevscale= pt.mb_getScale(target);
-		pt.mb_mapObj[ind].extent = coord[0] + "," + pos[1] + "," + pos[0] + "," +  coord[3];
-
-		pt.mb_mapObj[ind].width = Math.round(map_width);
-		pt.mb_mapObj[ind].height = Math.round(map_height);
-		pt.document.getElementById(target).style.width = Math.round(map_width);
-		pt.document.getElementById(target).style.height = Math.round(map_height);
-		pt.window.frames[target].document.getElementById("maps").style.width = Math.round(map_width);
-		pt.window.frames[target].document.getElementById("maps").style.height = Math.round(map_height);
-
-		//pt.setMapRequest(target);		
-		pt.mb_repaintScale(target, null, null, prevscale);
-      	document.form1.map_url.value = '';
-		for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
-			if(pt.mb_mapObj[ind].wms[i].gui_wms_visible > 0){
-				if(pt.mb_mapObj[ind].wms[i].mapURL != false && pt.mb_mapObj[ind].wms[i].mapURL != 'false' && pt.mb_mapObj[ind].wms[i].mapURL != ''){   
-					if(document.form1.map_url.value != ""){
-						document.form1.map_url.value += "___";
-					}         
-					document.form1.map_url.value += pt.mb_mapObj[ind].wms[i].mapURL;
-				}
-			}
-		}
-		
-		//overview_url
-		var ind_overview = pt.getMapObjIndexByName('overview');
-
-		//alert ("l�nge: " + length+ " - " + ind_overview + name + pt.mb_mapObj[ind_overview].wms.length);
-		if(pt.mb_mapObj[ind_overview].mapURL != false ){
-			document.forms[0].overview_url.value = pt.mb_mapObj[ind_overview].mapURL;
-		}
-	}
-}
-function refreshParams(){
-	var ind = pt.getMapObjIndexByName(target);
-	var f = document.form1;
-	f.map_url.value = "";
-	for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
-		if(pt.mb_mapObj[ind].wms[i].gui_wms_visible > 0){
-			if(pt.mb_mapObj[ind].wms[i].mapURL != false && pt.mb_mapObj[ind].wms[i].mapURL != 'false' && pt.mb_mapObj[ind].wms[i].mapURL != ''){
-				if(f.map_url.value != ""){
-					f.map_url.value += "___";
-				}      
-				f.map_url.value += pt.mb_mapObj[ind].wms[i].mapURL;
-			}
-		}
-	}
-	f.map_scale.value = pt.mb_getScale(target);
-	f.epsg.value = pt.mb_mapObj[ind].epsg;
-	mod_legend_print();
-}
-function printMap(){
-	if(size != "" && (format == "portrait" || format == "landscape")){
-		refreshParams();
-		if(document.form1.c1.value != comment){
-			document.form1.comment1.value = document.form1.c1.value;
-		}
-		if(document.form1.c2.value != comment){
-			document.form1.comment2.value = document.form1.c2.value;
-		}
-		if(document.form1.mylegendcheckbox.checked == 0){
-			document.form1.mylegend.value = 'false';
-		}else{
-			document.form1.mylegend.value = 'true';
-		}
-		
-		// write the measured coordinates
-		
-		if (pt.mod_measure_RX != undefined && pt.mod_measure_RY != undefined) {
-			var tmp_x = '';
-			var tmp_y = '';
-			for(i = 0; i<pt.mod_measure_RX.length; i++) {
-				if(tmp_x != '') {
-					tmp_x += ','
-				}
-				tmp_x += pt.mod_measure_RX[i];
-			}
-			for(i = 0; i<pt.mod_measure_RY.length; i++) {
-				if(tmp_y != '') {
-					tmp_y += ','
-				}
-				tmp_y += pt.mod_measure_RY[i];
-			}
-			document.forms['form1'].elements['measured_x_values'].value = tmp_x;
-			document.forms['form1'].elements['measured_y_values'].value = tmp_y;
-		}
-		
-		document.form1.submit();
-	}
-	else{
-		alert("<?php echo _("No format selected.")?>");
-	}
-}
-function valCom(obj){
-	if(obj.value.length > comment_length){
-		obj.value = obj.value.substr(0,comment_length);
-	}
-}
-// -->
-</script>
-<body>
-<form name='form1' method='POST' action='../print/mod_printPDF_pdf.php?<?php echo SID; ?>' target="_blank">
-<table border='0'>
-<tr>
-	<td>
-	<select name='size' onchange='validate()'>
-<?php
-	if($a4 == true && $a3 == true){
-		echo "<option value=''>".$label_format."</option>";
-	}
-	if($a4 == true){
-		echo "<option value='A4'>".$label_format_a4."</option>";
-	}
-	if($a3 == true){
-		echo "<option value='A3'>".$label_format_a3."</option>";
-	}
-	if($a2 == true){
-		echo "<option value='A2'>".$label_format_a2."</option>";
-	}
-	if($a1 == true){
-		echo "<option value='A1'>".$label_format_a1."</option>";
-	}
-	if($a0 == true){
-		echo "<option value='A0'>".$label_format_a0."</option>";
-	}
-?>
-	</select>
-	</td>   
-</tr>
-<tr>
-	<td>
-	<select name='format' onchange='validate()'>
-	<option value=''><?php echo $label_orientation; ?></option>
-	<option value='portrait'><?php echo $label_portrait; ?></option>
-	<option value='landscape'><?php echo $label_landscape; ?></option>
-	</select>
-	</td>
-</tr>
-<?php
-if($highquality == true){
-	echo "<tr>";
-		echo "<td>";
-		echo "<select name='quality'>";
-		echo "<option value='1'>".$label_72dpi."</option>";
-		echo "<option value='2'>".$label_288dpi."</option>";
-		echo "</select>";
-		echo "</td>";
-	echo "</tr>";
-}
-?>
-<tr>
-	<td>
-		<input type='text' name='c1' value='<?php echo $label_comment; ?>' onkeydown="valCom(this)">
-	</td>
-</tr>
-<tr>
-	<td>
-		<input type='text' name='c2' value='<?php echo $label_comment; ?>' onkeydown="valCom(this)">
-	</td>
-</tr>
-<?php
-if($legend == true){
-	echo "<tr>";
-		echo "<td>";
-		echo "<div><input type='checkbox' class='mycheck' name='mylegendcheckbox' value='false'>".$label_legend."</div>";
-		echo "</td>";
-	echo "</tr>";
-}else {
-	echo "<tr>";
-	echo "<td>";
-	echo "<input type='hidden' name='mylegendcheckbox' value='false'>";
-	echo "</td>";
-	echo "</tr>";
-}
-
-
-?>
-<table>  
-<input type='hidden' name='map_url' value=''>
-<input type='hidden' name='overview_url' value=''>
-<input type='hidden' name='wms_title' value=''>
-<input type='hidden' name='wms_id' value=''>
-<input type='hidden' name='layers' value=''>
-<input type='hidden' name='legendurl' value=''>
-<input type='hidden' name='map_scale' value=''>
-<input type='hidden' name='epsg' value=''>
-<input type='button' name='print' value="<?php echo $label_button; ?>" onclick='printMap()'>
-<input type='hidden' name='conf' value='<?php echo $_REQUEST["conf"]; ?>'>
-<input type='hidden' name='comment1' value=''>
-<input type='hidden' name='comment2' value=''>
-<input type='hidden' name='mylegend' value='true'>
-<input type='hidden' name='measured_x_values' value=''>
-<input type='hidden' name='measured_y_values' value=''>
-
-</form>
-</body>
-</html>
+<?php
+# $Id: mod_printPDF.php
+# http://www.mapbender.org/index.php/mod_printPDF.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__)."/../../core/globalSettings.php");
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+	<meta http-equiv="cache-control" content="no-cache" />
+	<meta http-equiv="pragma" content="no-cache" />
+	<meta http-equiv="expires" content="0" />
+	<?php printf("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\" />",CHARSET);	?>
+	<title>Print PDF</title>
+
+	<?php
+	//FIXME:
+	//setlocale(LC_ALL, "de_DE.utf8");
+
+	require_once(dirname(__FILE__)."/../print/".$_REQUEST["conf"]);
+
+	printf("
+	<script type=\"text/javascript\">
+		var target = '%s';
+		var comment1 = '%s';
+		var comment1_length = %s;
+		var comment2 = '%s';
+		var comment2_length = %s;
+		var label_button = '%s';
+		var type = '%s';
+	</script>",
+	$_REQUEST["target"],$label_comment1,$comment1_length,$label_comment2,$comment2_length,$label_button,$type
+	);
+	?>
+
+	<script type="text/javascript">
+	<!--
+	var size;
+	var format;
+	var map_width;
+	var map_height;
+
+	if(type=='window'){
+		var pt = window.opener;
+	}
+	else if(type == 'iframe'){
+		var pt = parent;
+	}
+
+	function mod_legend_print(){
+		var mod_legend_target = target;
+		var ind = pt.getMapObjIndexByName(mod_legend_target);
+		var layers;
+
+		document.forms[0].layers.value = "";
+		document.forms[0].wms_id.value = "";
+		document.forms[0].wms_title.value = "";
+		document.forms[0].legendurl.value = "";
+
+		for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
+			layers = pt.mb_mapObj[ind].wms[i].getLayers(pt.mb_mapObj[ind]);
+			if(layers != "" && layers){
+
+				if(i>0 && document.forms[0].wms_id.value!=''){
+				    document.forms[0].layers.value += "___";
+				    document.forms[0].wms_id.value += "___";
+				    document.forms[0].wms_title.value += "___";
+				    document.forms[0].legendurl.value += "___";
+				}
+
+				document.forms[0].wms_id.value += pt.mb_mapObj[ind].wms[i].wms_id;
+				document.forms[0].wms_title.value += pt.mb_mapObj[ind].wms[i].wms_title;
+
+				for(var j=0; j<layers.length; j++){
+					var layer = layers[j];
+					var title = pt.mb_mapObj[ind].wms[i].getTitleByLayerName(layers[j]);
+					var layerStyle = pt.mb_mapObj[ind].wms[i].getCurrentStyleByLayerName(layers[j]);
+					if(layerStyle==false){
+						var temp_legendurl = pt.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layers[j],"default");
+					}
+					else{
+						var temp_legendurl = pt.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layers[j],layerStyle);
+					}
+
+					//---------- legendurl ----------
+					tmp_name = "";
+					if(j>0){
+						document.forms[0].layers.value += ",";
+					}
+						document.forms[0].layers.value += title;
+					if(j>0){
+						document.forms[0].legendurl.value += ",";
+					}
+					if (temp_legendurl!= '' || !temp_legendurl == 'true'){
+						document.forms[0].legendurl.value += temp_legendurl;
+					}else{
+						document.forms[0].legendurl.value +='0';
+					}
+				}
+			}
+			else{
+				if(i>0 && document.forms[0].wms_id.value!=''){
+				    document.forms[0].layers.value += "___";
+				    document.forms[0].wms_id.value += "___";
+				    document.forms[0].wms_title.value += "___";
+				    document.forms[0].legendurl.value += "___";
+			    }
+
+				document.forms[0].layers.value += "0";
+			    document.forms[0].wms_id.value += "0";
+			    document.forms[0].wms_title.value += "0";
+			    document.forms[0].legendurl.value += "0";
+			}
+		}//for
+		//alert(document.forms[0].layers.value+"---"+document.forms[0].wms_id.value+"---"+document.forms[0].wms_title.value+"---"+document.forms[0].legendurl.value);
+
+	}
+
+	function validate(){
+		size = document.getElementById('size').options[document.getElementById('size').selectedIndex].value;
+		format = document.getElementById('format').options[document.getElementById('format').selectedIndex].value;
+
+		if(size != "false" && format != "false"){
+			var ind = pt.getMapObjIndexByName(target);
+			var coord = pt.mb_mapObj[ind].extent.split(",");
+			var centerX = parseFloat(coord[0]) + (parseFloat(coord[2]) - parseFloat(coord[0]))/2
+			var centerY = parseFloat(coord[1]) + (parseFloat(coord[3]) - parseFloat(coord[1]))/2
+			if(size == "A4" && format == "portrait"){
+				map_width = <?php echo $a4p_map_width; ?>;
+				map_height = <?php echo $a4p_map_height; ?>;
+			}
+			if(size == "A4" && format == "landscape"){
+				map_width = <?php echo $a4l_map_width; ?>;
+				map_height = <?php echo $a4l_map_height; ?>;
+			}
+			if(size == "A3" && format == "portrait"){
+				map_width = <?php echo $a3p_map_width; ?>;
+				map_height = <?php echo $a3p_map_height; ?>;
+			}
+			if(size == "A3" && format == "landscape"){
+				map_width = <?php echo $a3l_map_width; ?>;
+				map_height = <?php echo $a3l_map_height; ?>;
+			}
+			if(size == "A2" && format == "portrait"){
+				map_width = <?php echo $a2p_map_width; ?>;
+				map_height = <?php echo $a2p_map_height; ?>;
+			}
+			if(size == "A2" && format == "landscape"){
+				map_width = <?php echo $a2l_map_width; ?>;
+				map_height = <?php echo $a2l_map_height; ?>;
+			}
+			if(size == "A1" && format == "portrait"){
+				map_width = <?php echo $a1p_map_width; ?>;
+				map_height = <?php echo $a1p_map_height; ?>;
+			}
+			if(size == "A1" && format == "landscape"){
+				map_width = <?php echo $a1l_map_width; ?>;
+				map_height = <?php echo $a1l_map_height; ?>;
+			}
+			if(size == "A0" && format == "portrait"){
+				map_width = <?php echo $a0p_map_width; ?>;
+				map_height = <?php echo $a0p_map_height; ?>;
+			}
+			if(size == "A0" && format == "landscape"){
+				map_width = <?php echo $a0l_map_width; ?>;
+				map_height = <?php echo $a0l_map_height; ?>;
+			}
+			var pos = pt.makeClickPos2RealWorldPos(target, map_width , map_height);
+			var prevscale= pt.mb_getScale(target);
+			pt.mb_mapObj[ind].extent = coord[0] + "," + pos[1] + "," + pos[0] + "," +  coord[3];
+
+			pt.mb_mapObj[ind].width = Math.round(map_width);
+			pt.mb_mapObj[ind].height = Math.round(map_height);
+			pt.document.getElementById(target).style.width = Math.round(map_width);
+			pt.document.getElementById(target).style.height = Math.round(map_height);
+			pt.window.frames[target].document.getElementById("maps").style.width = Math.round(map_width);
+			pt.window.frames[target].document.getElementById("maps").style.height = Math.round(map_height);
+
+			//pt.setMapRequest(target);
+			pt.mb_repaintScale(target, null, null, prevscale);
+		document.form1.map_url.value = '';
+			for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
+				if(pt.mb_mapObj[ind].wms[i].gui_wms_visible > 0){
+					if(pt.mb_mapObj[ind].wms[i].mapURL != false && pt.mb_mapObj[ind].wms[i].mapURL != 'false' && pt.mb_mapObj[ind].wms[i].mapURL != ''){
+						if(document.form1.map_url.value != ""){
+							document.form1.map_url.value += "___";
+						}
+						document.form1.map_url.value += pt.mb_mapObj[ind].wms[i].mapURL;
+					}
+				}
+			}
+
+			//overview_url
+			var ind_overview = pt.getMapObjIndexByName('overview');
+
+			//alert ("l�nge: " + length+ " - " + ind_overview + name + pt.mb_mapObj[ind_overview].wms.length);
+			if(pt.mb_mapObj[ind_overview].mapURL != false ){
+				document.forms[0].overview_url.value = pt.mb_mapObj[ind_overview].mapURL;
+			}
+		}
+	}
+	function refreshParams(){
+		var f = document.forms[0];
+		size = document.getElementById('size').options[document.getElementById('size').selectedIndex].value;
+		format = document.getElementById('format').options[document.getElementById('format').selectedIndex].value;
+		
+		if(size != "" && format != ""){
+			var ind = pt.getMapObjIndexByName(target);
+			var coord = pt.mb_mapObj[ind].extent.split(",");
+			var centerX = parseFloat(coord[0]) + (parseFloat(coord[2]) - parseFloat(coord[0]))/2
+			var centerY = parseFloat(coord[1]) + (parseFloat(coord[3]) - parseFloat(coord[1]))/2
+			
+			var pos = pt.makeClickPos2RealWorldPos(target, map_width , map_height);
+			pt.mb_mapObj[ind].extent = coord[0] + "," + pos[1] + "," + pos[0] + "," +  coord[3];
+	
+			pt.mb_mapObj[ind].width = Math.round(map_width);
+			pt.mb_mapObj[ind].height = Math.round(map_height);
+			pt.document.getElementById(target).style.width = Math.round(map_width);
+			pt.document.getElementById(target).style.height = Math.round(map_height);
+			pt.window.frames[target].document.getElementById("maps").style.width = Math.round(map_width);
+			pt.window.frames[target].document.getElementById("maps").style.height = Math.round(map_height);
+	
+			//pt.setMapRequest(target);		
+			pt.mb_repaintScale(target, null, null, pt.mb_getScale(target));
+			f.map_url.value = '';
+			for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
+				if(pt.mb_mapObj[ind].wms[i].gui_wms_visible > 0){
+					if(pt.mb_mapObj[ind].wms[i].mapURL != false && pt.mb_mapObj[ind].wms[i].mapURL != 'false' && pt.mb_mapObj[ind].wms[i].mapURL != ''){   
+						if(f.map_url.value != ""){
+							f.map_url.value += "___";
+						}         
+						f.map_url.value += pt.mb_mapObj[ind].wms[i].mapURL;
+					}
+				}
+			}
+			
+			//overview_url
+			var ind_overview = pt.getMapObjIndexByName('overview');
+	
+			//alert ("l�nge: " + length+ " - " + ind_overview + name + pt.mb_mapObj[ind_overview].wms.length);
+			if(pt.mb_mapObj[ind_overview].mapURL != false ){
+				f.overview_url.value = pt.mb_mapObj[ind_overview].mapURL;
+			}
+		}
+	
+		f.map_scale.value = pt.mb_getScale(target);
+		f.epsg.value = pt.mb_mapObj[ind].epsg;
+		
+		mod_legend_print();
+	}
+	function printMap(){
+		if(size != "false" && (format == "portrait" || format == "landscape")){
+			refreshParams();
+			if(document.form1.c1.value != comment1){
+				document.form1.comment1.value = document.form1.c1.value;
+			}
+			if(document.form1.c2.value != comment2){
+				document.form1.comment2.value = document.form1.c2.value;
+			}
+			if(document.form1.mylegendcheckbox.checked == 0){
+				document.form1.mylegend.value = 'false';
+			}else{
+				document.form1.mylegend.value = 'true';
+			}
+
+			// write the measured coordinates
+
+			if (pt.mod_measure_RX != undefined && pt.mod_measure_RY != undefined) {
+				var tmp_x = '';
+				var tmp_y = '';
+				for(i = 0; i<pt.mod_measure_RX.length; i++) {
+					if(tmp_x != '') {
+						tmp_x += ','
+					}
+					tmp_x += pt.mod_measure_RX[i];
+				}
+				for(i = 0; i<pt.mod_measure_RY.length; i++) {
+					if(tmp_y != '') {
+						tmp_y += ','
+					}
+					tmp_y += pt.mod_measure_RY[i];
+				}
+				document.forms['form1'].elements['measured_x_values'].value = tmp_x;
+				document.forms['form1'].elements['measured_y_values'].value = tmp_y;
+			}
+
+			document.form1.submit();
+		}
+		else{
+			alert('<?php echo _mb("No format selected")."!"?>');
+		}
+	}
+
+	function checkCommentLength(obj,maxLength){
+		if(obj.value.length > maxLength){
+			obj.value = obj.value.substr(0,maxLength);
+		}
+	}
+	-->
+	</script>
+	<?php include("../include/dyn_css.php"); ?>
+</head>
+
+<body>
+<form name="form1" method="post" action="../print/mod_printPDF_pdf.php?<?php echo SID; ?>" target="_blank">
+<p id="container_size">
+	<label for="size"><?php echo $label_format ?></label>
+	<select id="size" name="size" onchange="validate();">
+		<option value="false">-</option>
+		<?php
+		for($i = 4; $i >= 0; $i--) {
+			if(${"a".$i}) {
+				printf("<option value=\"A%s\">%s</option>",$i,${"label_format_a".$i});
+			}
+		}
+		?>
+	</select>
+</p>
+
+<p id="container_orientation">
+	<label for="format"><?php echo $label_orientation; ?></label>
+	<select id="format" name="format" onchange="validate();">
+		<option value="portrait"><?php echo $label_portrait; ?></option>
+		<option value="landscape"><?php echo $label_landscape; ?></option>
+	</select>
+</p>
+
+<?php if($highquality === TRUE): ?>
+	<p id="container_quality">
+		<label for="quality"><?php echo $label_quality; ?></label>
+		<input type="radio" id="quality" name="quality" value="1" checked="checked" /> <?php echo $label_72dpi; ?>
+		<input type="radio" id="quality" name="quality" value="2" /> <?php echo $label_288dpi; ?>
+	</p>
+<?php endif; ?>
+
+<?php
+ini_set("error_reporting",E_ALL);
+ini_set("display_errors","on");
+	for($i = 1; $i <= 2; $i++) {
+		$max_comment_length = ${"comment".$i."_length"};
+		$label_hint         = ($max_comment_length > -1) ? sprintf(" <em>"._mb("max.")." %s)</em>",$max_comment_length) : NULL;
+		$javascript         = ($max_comment_length > -1) ? sprintf(" onblur=\"checkCommentLength(this,%s)\"",$max_comment_length) : NULL;
+
+		$html  = sprintf("<p id=\"container_comment%s\">",$i);
+		$html .= sprintf("<label for=\"c%s\">%s%s</label> ",$i,${"label_comment".$i},$label_hint);
+		$html .= sprintf("<textarea id=\"c%s\" name=\"c%s\" cols=\"20\" rows=\"2\"%s></textarea> ",$i,$i,$javascript);
+		$html .= "</p>";
+
+		echo $html;
+	}
+?>
+
+<?php if($legend === TRUE): ?>
+	<p id="container_legend">
+		<label for="mylegendcheckbox"><?php echo $label_legend; ?></label>
+		<input type="checkbox" id="mylegendcheckbox" name="mylegendcheckbox" value="false" />
+	</p>
+<?php else: ?>
+	<input type="hidden" name="mylegendcheckbox" value="false" />
+<?php endif; ?>
+
+<input type="hidden" name="map_url" />
+<input type="hidden" name="overview_url" />
+<input type="hidden" name="wms_title" />
+<input type="hidden" name="wms_id" />
+<input type="hidden" name="layers" />
+<input type="hidden" name="legendurl" />
+<input type="hidden" name="map_scale" />
+<input type="hidden" name="epsg" />
+<input type="hidden" name="conf" value="<?php echo $_REQUEST["conf"]; ?>" />
+<input type="hidden" name="comment1" />
+<input type="hidden" name="comment2" />
+<input type="hidden" name="mylegend" value="true" >
+<input type="hidden" name="measured_x_values" />
+<input type="hidden" name="measured_y_values" />
+
+<p>
+	<input type="button" id="print" name="print" value="<?php echo $label_button; ?>" onclick="printMap();" />
+</p>
+</form>
+</body>
+
+</html>

Modified: branches/print_dev/http/print/mod_printPDF_pdf.php
===================================================================
--- branches/print_dev/http/print/mod_printPDF_pdf.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/print/mod_printPDF_pdf.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -57,7 +57,11 @@
 $map_scale = $_REQUEST["map_scale"];
 $overview_url = $_REQUEST["overview_url"];
 $epsg = $_REQUEST["epsg"];
+if($overview_url=='false'){
+	$overview = false;	
+}
 
+
 function setscalebar($scale){
     	$mb_resolution = 28.35;
         
@@ -152,77 +156,75 @@
 }
 $coord = mb_split(",",$map_extent);
 
-if($overview === true){
-	// analyse overview url and draw rectangle with position
-	$o_url = new stripRequest($overview_url);
-	$overview_width = round($o_url->get("width"));
-	$overview_height = round($o_url->get("height"));
-	
-	if($factor>1){
-		$o_url->set('width',(intval($o_url->get('width'))*4));
-		$o_url->set('height',(intval($o_url->get('height'))*4));
-		if(in_array($o_url->get('map'),$highqualitymapfiles)){	
-				$o_url->set('map',preg_replace("/\.map/","_4.map",$o_url->get('map')));		
-				$overview_url = $o_url->url;	
-		}
+// analyse overview url and draw rectangle with position
+$o_url = new stripRequest($overview_url);
+$overview_width = round($o_url->get("width"));
+$overview_height = round($o_url->get("height"));
+
+if($factor>1){
+	$o_url->set('width',(intval($o_url->get('width'))*4));
+	$o_url->set('height',(intval($o_url->get('height'))*4));
+	if(in_array($o_url->get('map'),$highqualitymapfiles)){	
+			$o_url->set('map',preg_replace("/\.map/","_4.map",$o_url->get('map')));		
+			$overview_url = $o_url->url;	
 	}
-	
-	if($matching == true){
-		$overview_url = preg_replace($pattern,$replacement,$overview_url);  
-	}
-	
-	
-	if ($size == "A4" && $format == "portrait"){
-		$overview_left = $a4p_overviewOffset_left;
-		$overview_bottom =$a4p_overviewOffset_bottom;
-	}elseif ($size == "A4" && $format == "landscape"){
-		$overview_left = $a4l_overviewOffset_left;
-		$overview_bottom =$a4l_overviewOffset_bottom;
-	}elseif ($size == "A3" && $format == "portrait"){
-		$overview_left = $a3p_overviewOffset_left;
-		$overview_bottom =$a3p_overviewOffset_bottom;
-	}elseif ($size == "A3" && $format == "landscape"){
-		$overview_left = $a3l_overviewOffset_left;
-		$overview_bottom = $a3l_overviewOffset_bottom;
-	}elseif ($size == "A2" && $format == "portrait"){
-		$overview_left = $a2p_overviewOffset_left;
-		$overview_bottom =$a2p_overviewOffset_bottom;
-	}elseif ($size == "A2" && $format == "landscape"){
-		$overview_left = $a2l_overviewOffset_left;
-		$overview_bottom = $a2l_overviewOffset_bottom;
-	}elseif ($size == "A1" && $format == "portrait"){
-		$overview_left = $a1p_overviewOffset_left;
-		$overview_bottom =$a1p_overviewOffset_bottom;
-	}elseif ($size == "A1" && $format == "landscape"){
-		$overview_left = $a1l_overviewOffset_left;
-		$overview_bottom = $a1l_overviewOffset_bottom;
-	}elseif ($size == "A0" && $format == "portrait"){
-		$overview_left = $a0p_overviewOffset_left;
-		$overview_bottom =$a0p_overviewOffset_bottom;
-	}elseif ($size == "A0" && $format == "landscape"){
-		$overview_left = $a0l_overviewOffset_left;
-		$overview_bottom = $a0l_overviewOffset_bottom;
-	}
-	
-	$o_extent = $o_url->get("BBOX");
-	
-	$array_overview_url[0] = $overview_url;
-	if($log == true){
-		$l = new log("printPDF_overview",$array_overview_url);
-	}
-	
-	/*
-	$o_new = new stripRequest($overview_url);
-	$o_new->set('width',50);
-	$o_new->set('height',50);
-	//$o->set('BBOX',$overview_extent);
-	$o_url_new =$o_new->url;
-	$array_overview[0] = $overview_url;
-	$array_overview[1] = $o_url;
-	*/
-}	
+}
 
+if($matching == true){
+	$overview_url = preg_replace($pattern,$replacement,$overview_url);  
+}
+
+
+if ($size == "A4" && $format == "portrait"){
+	$overview_left = $a4p_overviewOffset_left;
+	$overview_bottom =$a4p_overviewOffset_bottom;
+}elseif ($size == "A4" && $format == "landscape"){
+	$overview_left = $a4l_overviewOffset_left;
+	$overview_bottom =$a4l_overviewOffset_bottom;
+}elseif ($size == "A3" && $format == "portrait"){
+	$overview_left = $a3p_overviewOffset_left;
+	$overview_bottom =$a3p_overviewOffset_bottom;
+}elseif ($size == "A3" && $format == "landscape"){
+	$overview_left = $a3l_overviewOffset_left;
+	$overview_bottom = $a3l_overviewOffset_bottom;
+}elseif ($size == "A2" && $format == "portrait"){
+	$overview_left = $a2p_overviewOffset_left;
+	$overview_bottom =$a2p_overviewOffset_bottom;
+}elseif ($size == "A2" && $format == "landscape"){
+	$overview_left = $a2l_overviewOffset_left;
+	$overview_bottom = $a2l_overviewOffset_bottom;
+}elseif ($size == "A1" && $format == "portrait"){
+	$overview_left = $a1p_overviewOffset_left;
+	$overview_bottom =$a1p_overviewOffset_bottom;
+}elseif ($size == "A1" && $format == "landscape"){
+	$overview_left = $a1l_overviewOffset_left;
+	$overview_bottom = $a1l_overviewOffset_bottom;
+}elseif ($size == "A0" && $format == "portrait"){
+	$overview_left = $a0p_overviewOffset_left;
+	$overview_bottom =$a0p_overviewOffset_bottom;
+}elseif ($size == "A0" && $format == "landscape"){
+	$overview_left = $a0l_overviewOffset_left;
+	$overview_bottom = $a0l_overviewOffset_bottom;
+}
+
+$o_extent = $o_url->get("BBOX");
+
+$array_overview_url[0] = $overview_url;
+if($log == true){
+	$l = new log("printPDF_overview",$array_overview_url);
+}
+
 /*
+$o_new = new stripRequest($overview_url);
+$o_new->set('width',50);
+$o_new->set('height',50);
+//$o->set('BBOX',$overview_extent);
+$o_url_new =$o_new->url;
+$array_overview[0] = $overview_url;
+$array_overview[1] = $o_url;
+*/
+
+/*
  * north arrow
  */
 if($size == "A4" && $format == "portrait"){
@@ -485,7 +487,7 @@
    $length = $pdf->getTextWidth($mySize, $text10);   
    $pdf->addText($ll[0] + $header_width/2 - $length/2,75,$mySize,$text10);
    
-   $mySize = 8;
+   $mySize = 6;
    $length = $pdf->getTextWidth($mySize, $text11);   
    $pdf->addText($ll[0] + $header_width/2 - $length/2,60,$mySize,$text11); 
    $mySize = 6;

Modified: branches/print_dev/http/print/printPDF.conf
===================================================================
--- branches/print_dev/http/print/printPDF.conf	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/print/printPDF.conf	2008-10-06 10:40:54 UTC (rev 3125)
@@ -45,12 +45,12 @@
 $new_comment2 = $admin->char_decode($_REQUEST["comment2"]);
 
 $text1 = $admin->char_decode(_mb("Print preview"));
-$text2 = "- Mapbender -";
+$text2 = "Mapbender";
 $text3 = "";
 $text4 = $admin->char_decode(_mb("Scale 1:")). " ".$_REQUEST["map_scale"];
-$text5 = $admin->char_decode(_mb("Date:")) . " ".date("d.m.Y",strtotime("now"));
+$text5 = $admin->char_decode(_mb("Date")) . ": ".date("d.m.Y",strtotime("now"));
 
-$text6 = $admin->char_decode(_mb("Notes:"));
+$text6 = $admin->char_decode(_mb("Notes")).":";
 $text7 = "";
 $text8 = $new_comment1;
 $text9 = $new_comment2;
@@ -58,13 +58,14 @@
 
 
 $text11 = $admin->char_decode(_mb("This copy has been automatically generated and is thus not valid without signature."));
-$text12 = $admin->char_decode(_mb("This copy is protected by law (Par. 3 Abs. 1 VermKatG NW). It can be duplicaedted, modified, published or be passed to third parties only in agreement with"));
+
+$text12 = $admin->char_decode(_mb("This copy is protected by law (Par. 3 Abs. 1 VermKatG NW). It can be duplicated, modified, published or be passed to third parties only in agreement with"));
 $text13 = $admin->char_decode(_mb("the publisher, except duplicates and modifications aimed at internal use of government agencies or private use."));
 
-$text14 = $admin->char_decode(_mb("This copy is protected,"));
-$text15 = $admin->char_decode(_mb("ask me!!!!"));
-$text16 = $admin->char_decode(_mb("or the publisher"));
-$text17 = $admin->char_decode(_mb("or use is internally."));
+$text14 = $admin->char_decode(_mb("This copy is protected by law (Par. 3 Abs. 1 VermKatG NW). "));
+$text15 = $admin->char_decode(_mb("It can be duplicated, modified, published or be passed to third parties only in"));
+$text16 = $admin->char_decode(_mb("agreement with the publisher except duplicates and modifications"));
+$text17 = $admin->char_decode(_mb("aimed at internal use of government agencies or private use."));
 
 /*
 * Labeling for buttons, textfields ...
@@ -82,11 +83,11 @@
 $label_landscape = _mb("landscape");
 
 $label_quality = _mb("Quality");
-$label_72dpi = "72 dpi";
-$label_288dpi = "288 dpi";
+$label_72dpi = sprintf(_mb("Quality: %d dpi"), 72);
+$label_288dpi = sprintf(_mb("Quality: %d dpi"), 288);
 
-$label_comment1 = _mb("Comment 1:");
-$label_comment2 = _mb("Comment 2:");
+$label_comment1 = _mb("Comment")." 1:";
+$label_comment2 = _mb("Comment")." 2:";
 $comment1_length = 30;
 $comment2_length = 30;
 

Modified: branches/print_dev/http/print/printPDF_b.conf
===================================================================
--- branches/print_dev/http/print/printPDF_b.conf	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/print/printPDF_b.conf	2008-10-06 10:40:54 UTC (rev 3125)
@@ -24,7 +24,7 @@
 * Legend
 */
 $legend=true;
-$label_legend = _mb('Print legend');
+$label_legend = _mb('print legend');
 $legendFilename = TMPDIR."/legend_".substr(md5(uniqid(rand())),0,7).".png";
 $legendFilenameUserPolygon = TMPDIR."/legend_".substr(md5(uniqid(rand())),0,7).".png";
 $legendText = $admin->char_decode(_mb("Legend"));
@@ -45,12 +45,12 @@
 $new_comment2 = $admin->char_decode($_REQUEST["comment2"]);
 
 $text1 = $admin->char_decode(_mb("Print preview"));
-$text2 = "- Mapbender -";
+$text2 = "Mapbender";
 $text3 = "";
 $text4 = $admin->char_decode(_mb("Scale 1:")). " ".$_REQUEST["map_scale"];
-$text5 = $admin->char_decode(_mb("Date:")) . " ".date("d.m.Y",strtotime("now"));
+$text5 = $admin->char_decode(_mb("Date")) . ": ".date("d.m.Y",strtotime("now"));
 
-$text6 = $admin->char_decode(_mb("Notes:"));
+$text6 = $admin->char_decode(_mb("Notes")).":";
 $text7 = "";
 $text8 = $new_comment1;
 $text9 = $new_comment2;
@@ -58,13 +58,14 @@
 
 
 $text11 = $admin->char_decode(_mb("This copy has been automatically generated and is thus not valid without signature."));
-$text12 = $admin->char_decode(_mb("This copy is protected by law (Par. 3 Abs. 1 VermKatG NW). It can be duplicaedted, modified, published or be passed to third parties only in agreement with"));
+
+$text12 = $admin->char_decode(_mb("This copy is protected by law (Par. 3 Abs. 1 VermKatG NW). It can be duplicated, modified, published or be passed to third parties only in agreement with"));
 $text13 = $admin->char_decode(_mb("the publisher, except duplicates and modifications aimed at internal use of government agencies or private use."));
 
-$text14 = $admin->char_decode(_mb("This copy is protected,"));
-$text15 = $admin->char_decode(_mb("ask me!!!!"));
-$text16 = $admin->char_decode(_mb("or the publisher"));
-$text17 = $admin->char_decode(_mb("or use is internally."));
+$text14 = $admin->char_decode(_mb("This copy is protected by law (Par. 3 Abs. 1 VermKatG NW). "));
+$text15 = $admin->char_decode(_mb("It can be duplicated, modified, published or be passed to third parties only in"));
+$text16 = $admin->char_decode(_mb("agreement with the publisher except duplicates and modifications"));
+$text17 = $admin->char_decode(_mb("aimed at internal use of government agencies or private use."));
 
 /*
 * Labeling for buttons, textfields ...
@@ -81,11 +82,12 @@
 $label_portrait = _mb("portrait");
 $label_landscape = _mb("landscape");
 
+$label_quality = _mb("Quality");
 $label_72dpi = sprintf(_mb("Quality: %d dpi"), 72);
 $label_288dpi = sprintf(_mb("Quality: %d dpi"), 288);
 
-$label_comment1 = "Comment 1";
-$label_comment2 = "Comment 2";
+$label_comment1 = _mb("Comment")." 1:";
+$label_comment2 = _mb("Comment")." 2:";
 $comment1_length = 30;
 $comment2_length = 30;
 

Modified: branches/print_dev/http/print/print_functions.php
===================================================================
--- branches/print_dev/http/print/print_functions.php	2008-10-06 10:35:10 UTC (rev 3124)
+++ branches/print_dev/http/print/print_functions.php	2008-10-06 10:40:54 UTC (rev 3125)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Id$
- * 
  * converts the coordinates created via the JavaScript
  * functions in 'mod_measure.php' into an array which 
  * then holds both X- ans Y-values for each point in
@@ -219,12 +217,12 @@
     $thePolyArr = makePolyFromCoord($theFullArr);
 	
 	if (isClosedPolygon($theFullArr)) {
-	  $nr_of_points = count($theFullArr);
 		$isClosed = TRUE;
-	} else {
-	  $nr_of_points = count($theFullArr);
+	} 
+	else {
 		$isClosed = FALSE;
 	}
+	$nr_of_points = count($theFullArr);
 	
 	// is fill option set?
 	// wenn der erste und letzte punkt nicht �bereinstimmen,

Added: branches/print_dev/http/sld/checksum.json
===================================================================
--- branches/print_dev/http/sld/checksum.json	                        (rev 0)
+++ branches/print_dev/http/sld/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"sld_edit_filter.php":"4e6d16fb7c40ffdd64172dcd74616ee18b357b11","sld_main.php":"f2c3f81b2a1bfee4cdf805325197736296414b1e","sld_pick_color.php":"8ea27810bc8b2ea23f1376cb422d20bdb6f81bb2","sld_config.php":"7611007c1a9ef3488fb9a5fc90368e0690d2c891","sld_filter_parse.php":"dc233065f90a2ac227fc26da4ec1845c9aa10779","sld_parse.php":"aed8c6000fff6820496e60dd42046ceb5115db51","sld_function_handler.php":"e4eca70d8aa27205536bcef6030fa5c55f789e72","sld_function_getusersld.php":"4257a663c391b0f79ac5ddb6329170b8eacf1579"}
\ No newline at end of file

Added: branches/print_dev/http/sld/classes/checksum.json
===================================================================
--- branches/print_dev/http/sld/classes/checksum.json	                        (rev 0)
+++ branches/print_dev/http/sld/classes/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"RasterSymbolizer.php":"d074dc9b76dc0b911959aa5ecb57e55408f3e698","UserStyle.php":"4ab102c55e90113149207df1bcc968a9608adffd","PropertyIsNull.php":"b6f66c2a2c4d977e4eafd42c66410f28a01ef9aa","PolygonSymbolizer.php":"a6eb4c6b1deba2e45ff3c54cd0a62bcefdf07de1","DisplayOperationModule.php":"6a3b685dd703f9f984e3da4873319138f2b8965e","ElseFilter.php":"39e179b9a8cd19651433a5feb166c7d8b015ea50","LineSymbolizer.php":"60b922726c881580ed088a656e508df87fd71ce2","Halo.php":"010a726a013e929c2effccfe4dc80ffd97993d90","Mark.php":"92c1dd8d3fc228533fa3567278217709a7e5a802","BinaryLogicOp.php":"d5375ca04c17d42613cfa14dbde46005a926c4a0","AnchorPoint.php":"d6c7b5d1ad624733735136729acfecb26afd59ff","ExternalGraphic.php":"57a35f42d4f46a36c07b8542ab6d735422835a19","StyledLayerDescriptor.php":"4902ccc7f7e07021315e4a2fb4749339b775ed30","GraphicStroke.php":"6d82ac3f09376610f9b372521b6bfa3e960db592","NamedLayer.php":"6c40e82d435c6032e082109ea72f84619c8e9465","TextSymbolizer.php":"76023358f6f5aa622be8b4c17e93320a6d198dcf","LegendGraphic.php":"07296cd1009f1be2867f91bbe9eba93d93c3879a","PropertyIsBetween.php":"c38cc1f0b5244ae0f3dede115e2397a823a32178","Graphic.php":"df5b82d61e1b64138a05a2b85d49cca7f63e2203","ParameterValue.php":"0f47bafdf1ab036bba0a740bbe5cdcb92e6fb49f","ColorMap.php":"d27f992bd1902cca6ab929a688d9bc3a253903fa","CssParameter.php":"8cfeb9de1a8dbce8f1be45289796176a57b5bbbc","UnaryLogicOp.php":"add5f54c94fc3f789639fcd813c7297b626b1cf0","GraphicFill.php":"5ace1e52440f317038756f9ee0c4fe1dd92fa456","DbUtils.php":"7797ae7d697a6125e6b64115f4ef6e540351efed","Displacement.php":"a28a4d4fc911065869094f0509809306407f70a7","PointSymbolizer.php":"03c69a0335d30b7cc873408c9de4cc157551ca72","PointPlacement.php":"7e8b10be74bc1b3d1c22ecd554d49f467aa4d3d0","Font.php":"f8a6419cc3e893e50b9eef9a41254d209681ea29","Rule.php":"5686ccd99aebe2c732e553c35b6e0fdb69a3b082","Stroke.php":"93e30feb2ceb44de8cfb5882694a85e87598403a","LabelPlacement.php":"01df9aa7e648ed80a3925f5a7b7999e261f7d46a","PropertyIsLike.php":"081b99f35bcfdd1e6c8e0e471b3671931c734a2c","Fill.php":"b7dbb94f32d1b4cd8de5eb8304b53fe0e465f667","FeatureTypeStyle.php":"d4e04cb08acd6e7865872c09aad5d1cd13803f93","ColorMapEntry.php":"49181dd61e4a372110e7b418f31ba31427844591","AddOperationModule.php":"169077dbfe380790eb5015ced053a278825b0408","Filter.php":"46a8c7c0bbb1d23371ce0d0048551c598b864d1f","BinaryComparisonOp.php":"c366c2b467aeeb20f5f484471bb5413f270d4f6f"}
\ No newline at end of file

Added: branches/print_dev/http/sld/img/checksum.json
===================================================================
--- branches/print_dev/http/sld/img/checksum.json	                        (rev 0)
+++ branches/print_dev/http/sld/img/checksum.json	2008-10-06 10:40:54 UTC (rev 3125)
@@ -0,0 +1 @@
+{"script_link.png":"995b2a278deb0d9651f092787f2c5a4307f31a0a","script_code_red.png":"27055d1ed80734afc87073bbc74fa8ad6ae35ba2","script_save.png":"55b6cb7de40a1fd132d81ea3618886be380a458f","lightning.png":"d332052a383ccd5ae331b92953dd63575a920dc3","script.png":"d9dec4792c8dc69377606a87c6c03b5b92f694b2","plus.gif":"b6244b0027a8c9f702b311cb5b2ab8cc64f3b5f2","map_magnify.png":"3c58fc3ef5c9036bdc603349b6a10b0dc273398d","minus.gif":"8f0ebcb45d7ba71a541d4781329f4a6900c7ee65"}
\ No newline at end of file



More information about the Mapbender_commits mailing list