[Mapbender-commits] r1834 - branches/mapbender_sld/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Nov 23 08:43:17 EST 2007


Author: christoph
Date: 2007-11-23 08:43:16 -0500 (Fri, 23 Nov 2007)
New Revision: 1834

Added:
   branches/mapbender_sld/http/javascripts/mod_dynamicOverview.php
   branches/mapbender_sld/http/javascripts/mod_gazetteerSQL_client.php
   branches/mapbender_sld/http/javascripts/mod_poi.php
   branches/mapbender_sld/http/javascripts/mod_renderGML.php
   branches/mapbender_sld/http/javascripts/mod_tab.js
   branches/mapbender_sld/http/javascripts/mod_tab_translation.php
   branches/mapbender_sld/http/javascripts/mod_wfs_client.html
   branches/mapbender_sld/http/javascripts/mod_wfs_gazetteer_client.php
   branches/mapbender_sld/http/javascripts/popup.js
   branches/mapbender_sld/http/javascripts/style.js
Modified:
   branches/mapbender_sld/http/javascripts/geometry.js
   branches/mapbender_sld/http/javascripts/jsTree.js
   branches/mapbender_sld/http/javascripts/map.php
   branches/mapbender_sld/http/javascripts/mb_ajaxWrapper_jQuery.js
   branches/mapbender_sld/http/javascripts/mod_back.php
   branches/mapbender_sld/http/javascripts/mod_digitize_tab.php
   branches/mapbender_sld/http/javascripts/mod_displayWmc.php
   branches/mapbender_sld/http/javascripts/mod_dragMapSize.php
   branches/mapbender_sld/http/javascripts/mod_forward.php
   branches/mapbender_sld/http/javascripts/mod_help.php
   branches/mapbender_sld/http/javascripts/mod_highlightPOI.php
   branches/mapbender_sld/http/javascripts/mod_initWmc.php
   branches/mapbender_sld/http/javascripts/mod_insertKmlIntoDb.php
   branches/mapbender_sld/http/javascripts/mod_insertLayerPreviewIntoDb.php
   branches/mapbender_sld/http/javascripts/mod_legend.php
   branches/mapbender_sld/http/javascripts/mod_loadwmc.php
   branches/mapbender_sld/http/javascripts/mod_measure.php
   branches/mapbender_sld/http/javascripts/mod_measure4326.php
   branches/mapbender_sld/http/javascripts/mod_navFrame.php
   branches/mapbender_sld/http/javascripts/mod_sandclock.php
   branches/mapbender_sld/http/javascripts/mod_savewmc.php
   branches/mapbender_sld/http/javascripts/mod_scaleHint.php
   branches/mapbender_sld/http/javascripts/mod_selArea.php
   branches/mapbender_sld/http/javascripts/mod_tab.php
   branches/mapbender_sld/http/javascripts/mod_usemap.php
   branches/mapbender_sld/http/javascripts/mod_wfs_SpatialRequest.php
   branches/mapbender_sld/http/javascripts/point.js
   branches/mapbender_sld/http/javascripts/wfs.js
Log:
new or updated js

Modified: branches/mapbender_sld/http/javascripts/geometry.js
===================================================================
--- branches/mapbender_sld/http/javascripts/geometry.js	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/geometry.js	2007-11-23 13:43:16 UTC (rev 1834)
@@ -12,13 +12,36 @@
 
 
 /**
- * @class A class representing geometry types.
+ * @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();
@@ -38,24 +61,30 @@
 	/*
 	 * creates a new, empty Multigeometry and adds it to this GeometryArray
 	 *
-	 * @member 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
+ * gets the j-th {@link Geometry} object of the i-th {@link MultiGeometry} object
  *
- * @member GeometryArray
  * @param {Integer} i index of the MultiGeometry
  * @param {Integer} j index of the Geometry
  * @type Geometry 
@@ -67,7 +96,6 @@
 /**
  * gets the k-th Point of the j-th {@link Geometry} object of the i-th {@link MultiGeometry} object
  *
- * @member GeometryArray
  * @param {Integer} i index of the MultiGeometry
  * @param {Integer} j index of the Geometry
  * @param {Integer} k index of the Point
@@ -81,8 +109,7 @@
 /**
  * gets an Array of indices; the {@link MultiGeometry} objects at these indices are equal to geom
  *
- * @member GeometryArray
- * @type Array of Integer
+ * @type Integer[]
  * @param {MultiGeometry} geom 
  * @returns an Array of indices
  */
@@ -97,7 +124,6 @@
 /**
  * deletes the j-th {@link Geometry} object of the i-th {@link MultiGeometry} object
  *
- * @member GeometryArray
  * @param {Integer} i index of the MultiGeometry
  * @param {Integer} j index of the Geometry
  */
@@ -108,7 +134,6 @@
 /**
  * deletes the k-th {@link Point} of the j-th {@link Geometry} object of the i-th {@link MultiGeometry} object
  *
- * @member GeometryArray
  * @param {Integer} i index of the MultiGeometry
  * @param {Integer} j index of the Geometry
  * @param {Integer} k index of the Point
@@ -119,9 +144,8 @@
 };
 	
 /**
- * closes the current {@link MultiGeometry}. Calls {@link Geometry#close}.
+ * closes the current {@link MultiGeometry}. Calls method close of the {@link Geometry} class.
  *
- * @member GeometryArray
  */
 GeometryArray.prototype.close = function(){
 	if (!this.get(-1).get(-1).close()) {
@@ -131,12 +155,12 @@
 		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
  *
- * @member GeometryArray
  * @param {Point} point
  */
 GeometryArray.prototype.delAllPointsLike = function(point){
@@ -159,7 +183,6 @@
 /**
  * updates all {@link Point} objects of this {@link GeometryArray} that equal oldP to newP
  *
- * @member GeometryArray
  * @param {Point} oldP
  * @param {Point} newP
  */
@@ -183,7 +206,6 @@
 	/*
 	 * creates a new, empty {@link Geometry} object and adds it to this {@link MultiGeometry}
 	 *
-	 * @member MultiGeometry
 	 */
 	this.addGeometry = function(){
 		this.add(new Geometry(this.geomType));
@@ -193,7 +215,6 @@
 	 * 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}.
 	 *
-	 * @member MultiGeometry
 	 * @param {Integer} i index
 	 */
 	this.del = function(i){
@@ -221,7 +242,6 @@
 /**
  * updates all {@link Point} objects of this {@link MultiGeometry} that equal oldP to newP
  *
- * @member MultiGeometry
  * @param {Point} oldP
  * @param {Point} newP
  */
@@ -232,9 +252,8 @@
 };
 
 /**
- * gets the bounding box of this {@link MultiGeometry}
+ * gets the bounding box of this {@link MultiGeometry} as an Array of 2 points
  *
- * @member MultiGeometry
  * @return the bounding box
  * @type Array of two Point objects
  */
@@ -251,10 +270,28 @@
 	}
 	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}.
  *
- * @member MultiGeometry
  * @return the center of the bounding box
  * @type Point
  */
@@ -268,7 +305,6 @@
 /**
  * gets the total number of {@link Point} objects of this {@link MultiGeometry}.
  *
- * @member MultiGeometry
  * @return number of points
  * @type Integer
  */
@@ -283,7 +319,6 @@
 /**
  * gets the total number of {@link Point} objects of this {@link MultiGeometry}.
  *
- * @member MultiGeometry
  * @return number of points
  * @type Integer
  */
@@ -294,7 +329,6 @@
 /**
  * compares this {@link MultiGeometry} object with the {@link MultiGeometry} object multigeom.
  *
- * @member MultiGeometry
  * @param {MultiGeometry} multigeom another multigeometry
  * @return true if he multigeometries match; else false 
  * @type Boolean
@@ -312,7 +346,6 @@
 /**
  * deletes the j-th {@link Point} object of the i-th {@link Geometry} object of this {@link MultiGeometry} object.
  *
- * @member MultiGeometry
  * @param {Integer} i geometry index
  * @param {Integer} j point index
  * @return true if the deletion succeded; else false.
@@ -326,20 +359,24 @@
 
 
 /**
- * @class a Geometry is a List of Point objects. If it is a polygon, the last point has to equal the first point.
+ * @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
+ * @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}.
+	 * 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}.
 	 *
-	 * @member Geometry
 	 * @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);
@@ -366,7 +403,6 @@
 	/**
 	 * adds a {@link Point} object to this {@link Geometry} object.
 	 *
-	 * @member Geometry
 	 * @param {Float} x x value of the point
 	 * @param {Float} y y value of the point
 	 */	
@@ -378,7 +414,6 @@
 	/**
 	 * adds a {@link Point} object to this {@link Geometry} object.
 	 *
-	 * @member Geometry
 	 * @param {Point} aPoint another point
 	 */	
 	this.addPoint = function(aPoint){
@@ -389,7 +424,6 @@
 	/**
 	 * inserts a {@link Point} object at index i of this {@link Geometry} object.
 	 *
-	 * @member Geometry
 	 * @param {Point} p another point
 	 * @param {Integer} i index
 	 */	
@@ -408,7 +442,6 @@
 	 * Overwrites the {@link Point) object at index i with the {@link Point} object p.
 	 *
 	 * @private
-	 * @member Geometry
 	 * @param {Point} p another point
 	 * @param {Integer} i index
 	 */	
@@ -426,7 +459,6 @@
 	 * Updates the {@link Geometry#dist} and {@link Geometry#totaldist}
 	 *
 	 * @private
-	 * @member Geometry
 	 */	
 	var updateDist = function(){
 		dist[0] = 0;		
@@ -439,7 +471,6 @@
 	/**
 	 * gets the distance between the last and last but one point of this {@link Geometry}.
 	 *
-	 * @member Geometry
 	 * @param {Integer} numberOfDigitis round to numberOfDigits (optional)
 	 * @return the distance
 	 * @type Float
@@ -454,7 +485,6 @@
 	/**
 	 * gets the length of the outer rim of this {@link Geometry}.
 	 *
-	 * @member Geometry
 	 * @param {Integer} numberOfDigitis round to numberOfDigits (optional)
 	 * @return the distance
 	 * @type Float
@@ -468,7 +498,6 @@
 	/**
 	 * closes this {@link Geometry}. 
 	 *
-	 * @member Geometry
 	 * @return true if the geometry could be closed; otherwise false
 	 * @type Boolean
 	 */	
@@ -490,7 +519,6 @@
 	/**
 	 * checks if this {@link Geometry} has been closed. 
 	 *
-	 * @member Geometry
 	 * @return true if the geometry is closed; otherwise false
 	 * @type Boolean
 	 */	
@@ -514,9 +542,8 @@
 /**
  * gets the bounding box of this {@link Geometry}
  *
- * @member Geometry
- * @return the bounding box
- * @type Array of two Point objects
+ * @return the bounding box (array of two Point objects)
+ * @type Point[]
  */
 Geometry.prototype.getBBox = function(){
 	var q = this.get(0);
@@ -536,7 +563,6 @@
 /**
  * updates all {@link Point} objects of this {@link Geometry} that equal oldP to newP
  *
- * @member Geometry
  * @param {Point} oldP
  * @param {Point} newP
  */
@@ -557,7 +583,6 @@
 /**
  * compares this {@link Geometry} object with the {@link Geometry} object geom point by point.
  *
- * @member Geometry
  * @param {Geometry} geom another geometry
  * @return true if he geometries match; else false 
  * @type Boolean
@@ -582,7 +607,6 @@
 	/**
 	 * returns the number of elements of this {@link Wfs_element} object.
 	 *
-	 * @member Wfs_element
 	 * @return the number of elements
 	 * @type Integer
 	 */
@@ -593,7 +617,6 @@
 	/**
 	 * returns the name of the element at index i.
 	 *
-	 * @member Wfs_element
 	 * @param {Integer} i index
 	 * @return the name
 	 * @type String
@@ -606,7 +629,6 @@
 	/**
 	 * returns the value of the element at index i.
 	 *
-	 * @member Wfs_element
 	 * @param {Integer} i index
 	 * @return the value
 	 */
@@ -618,7 +640,6 @@
 	/**
 	 * appends a new element with a given name. If an element with this name exists, it is overwritten.
 	 *
-	 * @member Wfs_element
 	 * @param {String} aName the name of the new element
 	 * @param {String} aValue the value of the new element
 	 */
@@ -632,7 +653,6 @@
 	/**
 	 * checks if an index is valid
 	 *
-	 * @member Wfs_element
 	 * @private
 	 * @param {Integer} i an index
 	 * @return true if the index is valid; otherwise false
@@ -651,7 +671,6 @@
 /**
  * gets the index of the element with a given name.
  *
- * @member Wfs_element
  * @param {String} elementName a name
  * @return the index of the element; if no element with this name exists, false
  * @type Integer, Boolean
@@ -666,7 +685,6 @@
 /**
  * gets the value of the element with a given name.
  *
- * @member Wfs_element
  * @param {String} elementName a name
  * @return the value of the element; if no element with this name exists, false
  * @type String, Boolean
@@ -679,11 +697,12 @@
 
 
 /**
- * @class a {@link Canvas} is a {@link DivTag} that contains graphics rendered by {@link jsGraphics}
+ * @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
@@ -696,11 +715,10 @@
 	/**
 	 * draws the geometry of the canvas
 	 *
-	 * @member Canvas
-	 * @private
-	 * @param {String} t geometry type
+	 * @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){ 
 		var mapObjInd = getMapObjIndexByName(mapframe);
@@ -731,7 +749,6 @@
 	/**
 	 * checks if the MultiGeometry's bounding box width and height is smaller than minWidth
 	 *
-	 * @member Canvas
 	 * @private
 	 * @param {MultiGeometry} g a MultiGeometry object
 	 */
@@ -746,9 +763,19 @@
 	};
 	
 	/**
+	 * gets the jsGraphics.
+	 *
+	 * @private
+	 * @return the jsGraphics
+	 * @type jsGraphics
+	 */
+	this.getCanvas = function(){
+		return canvas;
+	};
+	
+	/**
 	 * draws a circle with {@link jsGraphics}.
 	 *
-	 * @member Canvas
 	 * @private
 	 * @param {Float} x x value of the center
 	 * @param {Float} y y value of the center
@@ -763,7 +790,6 @@
 	/**
 	 * draws a polyline with {@link jsGraphics}.
 	 *
-	 * @member Canvas
 	 * @private
 	 * @param {Array} x_array array of x values
 	 * @param {Array} y_array array of y values
@@ -775,25 +801,19 @@
 	};
 
 	/**
-	 * gets the jsGraphics.
-	 *
-	 * @member Canvas
-	 * @private
-	 * @return teh jsGraphics
-	 * @type jsGraphics
+	 * This is the {@link DivTag} that contains the output by {@link jsGraphics}.
+	 * 
+	 * @type DivTag
 	 */
-	this.getCanvas = function(){
-		return canvas;
-	};
-	
+	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 that = this;
-	this.canvasDivTag = new DivTag(aTagName, mapframe, style);
 	var canvas = new jsGraphics(aTagName, window.frames[mapframe]);
 	canvas.setStroke(lineWidth);
 	mb_registerPanSubElement(aTagName);
@@ -801,8 +821,6 @@
 
 /**
  * cleans the canvas by emptying the canvas {@link DivTag}.
- *
- * @member Canvas
  */
 Canvas.prototype.clean = function () {
 	this.canvasDivTag.clean();
@@ -811,7 +829,6 @@
 /**
  * paints all geometries.
  *
- * @member Canvas
  * @param {GeometryArray} gA the geometries that will be drawn
  */
 Canvas.prototype.paint = function(gA) {
@@ -856,7 +873,6 @@
 	/**
 	 * removes a {@link MultiGeometry} object from the geometry Array
 	 *
-	 * @member Highlight
 	 * @param {MultiGeometry} m a MultiGeometry
 	 * @param {String} color a color
 	 */	
@@ -875,7 +891,6 @@
 	/**
 	 * adds a {@link MultiGeometry} object to the geometry Array
 	 *
-	 * @member Highlight
 	 * @param {MultiGeometry} m a MultiGeometry
 	 * @param {String} color the color of the highlight
 	 */	
@@ -889,7 +904,6 @@
 	/**
 	 * removes all MultiGeometries.
 	 *
-	 * @member Highlight
 	 */	
 	this.clean = function() {
 		if (gA.count() > 0) {
@@ -901,7 +915,6 @@
 	/**
 	 * displays the highlight
 	 *
-	 * @member Highlight
 	 */	
 	this.paint = function() {
 		for (var i=0; i < canvas.length; i++) {
@@ -928,9 +941,26 @@
 // ----------------------------------------------------------------------------------------------------
 // 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();
@@ -969,13 +999,44 @@
 		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 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);
 }
 
@@ -999,6 +1060,15 @@
 	}
 };
 
+/**
+ * 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();
@@ -1028,19 +1098,39 @@
 	}
 };
 
+/**
+ * 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;
 };
 
-Snapping.prototype.getSnappedPoint = function(geom){
+/**
+ * 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();
 };
@@ -1051,6 +1141,9 @@
 // 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;
@@ -1119,6 +1212,9 @@
 	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 = "";
 	

Modified: branches/mapbender_sld/http/javascripts/jsTree.js
===================================================================
--- branches/mapbender_sld/http/javascripts/jsTree.js	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/jsTree.js	2007-11-23 13:43:16 UTC (rev 1834)
@@ -139,9 +139,9 @@
 				if(p == parts.length - 1){
 					return tr
 				}else{
-					if(!childExists(tr) || !isExpanded(tr))
-						tr.firstChild.firstChild.onclick()
-						tBody = tBody.childNodes[c + 1].childNodes[1].firstChild.firstChild
+					if(!childExists(tr))
+						return null;
+					tBody = tBody.childNodes[c + 1].childNodes[1].firstChild.firstChild
 
 					if(!tBody)
 						return null
@@ -187,6 +187,11 @@
 								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
 					
@@ -201,8 +206,8 @@
 	return false
 }
 
-function addNode(path, nd, sel, refresh){
-	if(_editDataNode("a", path, nd)){
+function addNode(path, nd, sel, refresh, begining){
+	if(_editDataNode((begining?"u":"a"), path, nd)){
 		if(refresh){	
 			rebuildNode(path, true)
 			rebuildNode(path)
@@ -242,16 +247,22 @@
 function setState(data){
 	jst_state_paths = data.split(jst_delimiter[1])
 	for(var p in jst_state_paths){
-		var tr = getDomNode(jst_state_paths[p])
-		
-		if(tr){
-			var f1 = tr.firstChild
-			if(f1){
-				var f2 = f1.firstChild
-				if(!isExpanded(tr) && f2)
-					if(f2.onclick)
-						f2.onclick()
+		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];
 		}
 	}
 }
@@ -263,7 +274,7 @@
 		path = arrPath.join(jst_delimiter[0])
 	}
 	
-	if(path == ""){
+	if(path.split(jst_delimiter[0]).length<=1){
 		renderTree()
 	}else{
 	
@@ -369,7 +380,7 @@
 	var nd = getDomNode(path);
 
 	if(!nd)return -1;
-	if(!childExists(nd))nd.firstChild.firstChild.onclick();
+	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++){
@@ -395,7 +406,7 @@
 	var plus;
 	
 	if(!nd)return false;
-	if(!childExists(nd))nd.firstChild.firstChild.onclick();
+	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++){
@@ -405,8 +416,7 @@
 		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();}	
-//TODO DataNode anpassen
+			if(cb.onclick){cb.onclick();}
 		}		
 	}
 	return true;
@@ -588,16 +598,20 @@
 			}
 			return
 		}else{
-			ctlImg.src = jst_image_folder + "/" + (tr.nextSibling ? "" : "last_") + "expanded.png"
+			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 + "/expanded_folder.png";
+				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'))
 		
@@ -605,7 +619,20 @@
 		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
 }
 

Modified: branches/mapbender_sld/http/javascripts/map.php
===================================================================
--- branches/mapbender_sld/http/javascripts/map.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/map.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -17,15 +17,47 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
+
+include(dirname(__FILE__)."/../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
+
+session_start();
+$con = db_connect(DBSERVER,OWNER,PW);
+db_select_db(DB,$con);
+
+/*
+// may be added at a later stage
+$gui_changed=0;
+$new_wmc=0;
+
+if (!$_REQUEST["layer_preview"] && isset($_SESSION["mb_user_gui"]) && $_SESSION["mb_user_gui"] != $_REQUEST["gui_id"]) {
+	$gui_changed=1;
+}
+
+if (!isset($_SESSION['mb_wmc']) || ($gui_changed==1) ||	($_REQUEST['layer_preview'] && $_REQUEST['portal_services'])) {
+	$new_wmc=1;
+}
+
+if (isset($_REQUEST['layer_preview']) && $_REQUEST['layer_preview'] != 0) {
+	$_SESSION['layer_preview'] = $_REQUEST['portal_services'];
+}
+else {
+	$_SESSION['layer_preview'] = 0;
+}
+*/
+$_SESSION["mb_user_gui"] = $_REQUEST["gui_id"];
+
+session_write_close();
 ob_start();
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-session_start();
 header('Content-type: application/x-javascript');
 
 echo "var mb_nr = '".session_id()."';";
 echo "var mb_myLogin = '".$_SESSION["mb_login"]."';";
 echo "var mb_styleID = '".md5($_SESSION["mb_user_name"])."';";
 echo "var mb_myBBOX = '".$_SESSION["mb_myBBOX"]."';";
+echo "var mapbender = {};";
+echo "mapbender.locale = '" . $_SESSION["mb_locale"] . "';";
+echo "mapbender.languageId = '" . $_SESSION["mb_lang"] . "';";
 echo "var owsproxy = '".OWSPROXY."';";
 echo "var global_mb_log_js = '".LOG_JS."';";
 echo "var global_mb_log_level = '".LOG_LEVEL."';";
@@ -33,11 +65,17 @@
 
 include("map.js");
 
-$con = db_connect($DBSERVER,$OWNER,$PW);
+// see http://trac.osgeo.org/mapbender/ticket/79
+ini_set('session.bug_compat_42',0); 
+ini_set('session.bug_compat_warn',0);
+
+$con = db_connect(DBSERVER,OWNER,PW);
 db_select_db(DB,$con);
 
-$mb_sql = "SELECT DISTINCT e_js_file, e_id, e_src, e_target, e_pos FROM gui_element WHERE e_public = 1 AND fkey_gui_id = '".$_REQUEST["gui_id"]."' ORDER BY e_pos";
-$mb_res = db_query($mb_sql);
+$mb_sql = "SELECT DISTINCT e_js_file, e_id, e_src, e_target, e_pos FROM gui_element WHERE e_public = 1 AND fkey_gui_id = $1 ORDER BY e_pos";
+$mb_v = array($_REQUEST["gui_id"]);
+$mb_t = array("s");
+$mb_res = db_prep_query($mb_sql, $mb_v, $mb_t);
 //$mb_cnt = 0;
 while($row_js = db_fetch_array($mb_res)){
 	if($row_js["e_js_file"] != ""){

Modified: branches/mapbender_sld/http/javascripts/mb_ajaxWrapper_jQuery.js
===================================================================
--- branches/mapbender_sld/http/javascripts/mb_ajaxWrapper_jQuery.js	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mb_ajaxWrapper_jQuery.js	2007-11-23 13:43:16 UTC (rev 1834)
@@ -1,3 +1,4 @@
+/*
 <?php
 # $Id: map.php 736 2006-08-03 12:40:12Z christoph $
 # http://www.mapbender.org/index.php/mb_ajaxWrapper_jQuery.js
@@ -17,16 +18,17 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 ?>
+*/
 
 function mb_ajaxWrap_get(url, param, callback) {
 //	window.frames['ajax'].$.ajaxSetup({async:false}); //TODO: find out why async doesn't work sometimes
-	window.frames['ajax'].$.get(url, param, callback);
+	$.get(url, param, callback);
 }
 function mb_ajaxWrap_post(url, param, callback) {
 //	window.frames['ajax'].$.ajaxSetup({async:false}); //TODO: find out why async doesn't work sometimes
-	window.frames['ajax'].$.post(url, param, callback);
+	$.post(url, param, callback);
 }
 function mb_ajaxWrap_json(url, param, callback) {
 //	window.frames['ajax'].$.ajaxSetup({async:false}); //TODO: find out why async doesn't work sometimes
-	window.frames['ajax'].$.getJSON(url, param, callback);
+	$.getJSON(url, param, callback);
 }
\ No newline at end of file

Modified: branches/mapbender_sld/http/javascripts/mod_back.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_back.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_back.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -28,7 +28,7 @@
 $cnt = 0;
 while($row = db_fetch_array($res)){
 	$e_src = $row["e_src"];
-	$e_target = split(",",$row["e_target"]);
+	$e_target = mb_split(",",$row["e_target"]);
 	$cnt++;
 }
 if($cnt > 1){ echo "alert('back: ID not unique!');";}

Modified: branches/mapbender_sld/http/javascripts/mod_digitize_tab.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_digitize_tab.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_digitize_tab.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -81,6 +81,7 @@
 
 var digitizeDivTag;
 
+var msgObj;
 var featureTypeElementFormId = "featureTypeElementForm";
 
 try {if(mod_digitize_elName){}}catch(e) {mod_digitize_elName = "digitize";}
@@ -129,14 +130,14 @@
 	if (d.getGeometry(-1,-1).isComplete() || d.count() == 0){
 		
 		if (mod_digitizeEvent != false) {
-			alert(errorMessageNoGeometrySelected[selectedLanguage]);
+			alert(msgObj.errorMessageNoGeometrySelected);
 		}
 		return false;
 	}
 	
 	var realWorldPos;
 	if (s.isSnapped()) {
-		realWorldPos = s.getSnappedPoint(d); 
+		realWorldPos = s.getSnappedPoint(); 
 		s.clean();
 	}
 	else {
@@ -308,7 +309,7 @@
 
 	var oldPoint = parent.cloneObject(d.getPoint(i,j,k));
 	if (s.isSnapped()) {
-		var snappedPoint = parent.cloneObject(s.getSnappedPoint(d));
+		var snappedPoint = parent.cloneObject(s.getSnappedPoint());
 		if (!nonTransactionalEditable) {
 			updateAllPointsOfNonTransactionalLike(oldPoint, snappedPoint);
 		}
@@ -366,16 +367,16 @@
 	registerDigitizeSubFunctions("updateListOfGeometries()");
 	registerDigitizeSubFunctions("drawDashedLine()");
 	registerDigitizeSubFunctions("updateMeasureTag()");
+	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].getMessages()");
 	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].setStyleForTargetFrame()");
 	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].checkDigitizeTag()");
 	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].initialiseSnapping()");
+	parent.mb_registerL10nFunctions("window.frames['"+ mod_digitize_elName + "'].getMessages()");
 	if (!nonTransactionalEditable) {
 		parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].initialiseHighlight()");
 	}
 	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].initialiseMeasure()");
 	parent.mb_registerSubFunctions("window.frames['" + mod_digitize_elName + "'].updateExtent()");
-	parent.mb_registerSubFunctions("window.frames['"+ mod_digitize_elName + "'].drawDashedLine()");
-	parent.mb_registerSubFunctions("window.frames['"+ mod_digitize_elName + "'].updateMeasureTag()");
 	parent.mb_registerWfsReadSubFunctions(function(geom){parent.tab_open(mod_digitize_elName);parent.window.frames[mod_digitize_elName].appendGeometryArray(geom);});
 	parent.mb_registerWfsWriteSubFunctions(function(){parent.zoom(mod_digitize_target, true, 0.999);});
 }
@@ -386,6 +387,7 @@
 	 
 	digitizeDivTag = new parent.DivTag(digitizeTagName, mod_digitize_target, digitizeTagStyle);
 	parent.mb_registerPanSubElement(digitizeTagName);
+	parent.mb_registerSubFunctions("window.frames['"+ mod_digitize_elName + "'].drawDashedLine()");
 }
 
 
@@ -406,6 +408,7 @@
 }
 function initialiseMeasure(){
 	measureDivTag = new parent.DivTag(measureTagName, measureTagTarget, measureTagStyle);
+	parent.mb_registerSubFunctions("window.frames['"+ mod_digitize_elName + "'].updateMeasureTag()");
 }
 // --- registered functions (end) -----------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------------------------------------
@@ -417,8 +420,8 @@
 			if (d.getGeometry(-1, -1).count() > 0) {
 				if (mod_digitizeEvent == button_line || mod_digitizeEvent == button_polygon) {
 					var measureString = "";
-					measureString += measureTagLabelCurrent[selectedLanguage] + d.getGeometry(-1, -1).getCurrentDist(measureNumberOfDigits) + "<br>";
-					measureString += measureTagLabelTotal[selectedLanguage] + d.getGeometry(-1, -1).getTotalDist(measureNumberOfDigits);
+					measureString += msgObj.measureTagLabelCurrent + d.getGeometry(-1, -1).getCurrentDist(measureNumberOfDigits) + "<br>";
+					measureString += msgObj.measureTagLabelTotal + d.getGeometry(-1, -1).getTotalDist(measureNumberOfDigits);
 					measureDivTag.write(measureString);
 					return true;
 				}
@@ -573,7 +576,7 @@
 			}
 		}
 		else if (obj.id == button_clear) {
-			var clear = confirm(messageConfirmDeleteAllGeomFromList[selectedLanguage]);
+			var clear = confirm(msgObj.messageConfirmDeleteAllGeomFromList);
 			if (clear) {
 				d = new parent.GeometryArray();
 				parent.mb_disableThisButton(button_clear);
@@ -744,7 +747,7 @@
 		return resultName;
 	}
 	else {
-		return digitizeDefaultGeometryName[selectedLanguage];
+		return msgObj.digitizeDefaultGeometryName;
 	}
 }
 
@@ -758,23 +761,23 @@
 	
 				listOfGeom += "\t<tr>\n\t\t<td>\n";
 				if (wfsExistsForGeom(d.get(i), wfsConf)) {
-					listOfGeom += "\t\t\t<img src = '"+buttonDig_imgdir+buttonDig_wfs_src+"' title='"+buttonDig_wfs_title[selectedLanguage]+"' onclick='showWfs("+i+")'>\n";
+					listOfGeom += "\t\t\t<img src = '"+buttonDig_imgdir+buttonDig_wfs_src+"' title='"+msgObj.buttonDig_wfs_title+"' onclick='showWfs("+i+")'>\n";
 				}
 				listOfGeom += "\t\t</td>\n\t\t<td>\n";
-				listOfGeom += "\t\t\t<img src = '"+buttonDig_imgdir+buttonDig_remove_src+"' title='"+buttonDig_remove_title[selectedLanguage]+"' onclick='parent.mb_disableThisButton(mod_digitizeEvent);d.del("+i+");executeDigitizeSubFunctions();'>\n";
+				listOfGeom += "\t\t\t<img src = '"+buttonDig_imgdir+buttonDig_remove_src+"' title='"+msgObj.buttonDig_remove_title+"' onclick='parent.mb_disableThisButton(mod_digitizeEvent);d.del("+i+");executeDigitizeSubFunctions();'>\n";
 				listOfGeom += "\t\t</td>\n\t\t<td>\n";
 	
 				if (isValidWfsConfIndex(wfsConf, d.get(i).wfs_conf)) {
-					listOfGeom += "\t\t\t<img src = '"+buttonDig_imgdir+buttonDig_removeDb_src+"' title='"+buttonDig_removeDb_title[selectedLanguage]+"' onclick=\"var deltrans = confirm('"+messageConfirmDeleteGeomFromDb[selectedLanguage]+"');if (deltrans) dbGeom('delete', "+i+")\">\n";
+					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 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+"));' ";
 				var geomName = getName(d.get(i)); 
-				if (d.get(i).geomType == parent.geomType.polygon) {geomName += " ("+messageDescriptionPolygon[selectedLanguage]+")";}
-				else if (d.get(i).geomType == parent.geomType.line) {geomName += " ("+messageDescriptionLine[selectedLanguage]+")";}
-				else if (d.get(i).geomType == parent.geomType.point) {geomName += " ("+messageDescriptionPoint[selectedLanguage]+")";}
+				if (d.get(i).geomType == parent.geomType.polygon) {geomName += " ("+msgObj.messageDescriptionPolygon+")";}
+				else if (d.get(i).geomType == parent.geomType.line) {geomName += " ("+msgObj.messageDescriptionLine+")";}
+				else if (d.get(i).geomType == parent.geomType.point) {geomName += " ("+msgObj.messageDescriptionPoint+")";}
 				
 				listOfGeom += ">" + geomName +"</div>\t\t</td>\n\t</tr>\n";
 			}
@@ -828,7 +831,7 @@
 		}
 	}
 	if (!isCorrect) {
-		errorMessage = messageSelectAnOption[selectedLanguage] + "\n";
+		errorMessage = msgObj.messageSelectAnOption + "\n";
 	}
 	return {"isCorrect":isCorrect, "errorMessage":errorMessage};
 }
@@ -844,7 +847,7 @@
 			if (nodeArray[i].value == "true") {
 				if (doc.getElementById(nodeId).value == "") {
 					isCorrect = false;
-					errorMessage += "'"+ doc.getElementById(nodeId).name +"': "+ messageErrorFieldIsEmpty[selectedLanguage] +"\n";
+					errorMessage += "'"+ doc.getElementById(nodeId).name +"': "+ msgObj.messageErrorFieldIsEmpty +"\n";
 				}
 			}
 		}
@@ -853,7 +856,7 @@
 }
 
 function isInteger(str) {
-	if (str.match(/^\d+$/)) {
+	if (str.match(/^\d*$/)) {
 		return true;
 	}
 	return false;
@@ -891,14 +894,14 @@
 			if (nodeArray[i].value == "int") {
 				if (!isInteger(nodeValue)) {
 					isCorrect = false;
-					errorMessage += "'"+doc.getElementById(nodeId).name+"': "+ messageErrorNotAnInteger[selectedLanguage] + "\n";
+					errorMessage += "'"+doc.getElementById(nodeId).name+"': "+ msgObj.messageErrorNotAnInteger + "\n";
 				}
 			}
 			else if (nodeArray[i].value == "double") {
 				nodeValue = replaceCommaByDecimalPoint(nodeValue);
 				if (!isFloat(nodeValue)) {
 					isCorrect = false;
-					errorMessage += "'"+doc.getElementById(nodeId).name+"': "+ messageErrorNotAFloat[selectedLanguage] + "\n";
+					errorMessage += "'"+doc.getElementById(nodeId).name+"': "+ msgObj.messageErrorNotAFloat + "\n";
 				}
 				else {
 					doc.getElementById(nodeId).value = nodeValue;
@@ -1118,22 +1121,22 @@
 				onClickText += 	"}";
 				
 				if (options[i] == "save" && hasGeometryColumn && (!fid || showSaveButtonForExistingGeometries)) {
-					str += "\t\t\t<td><input type='button' name='saveButton' value='"+buttonLabelSaveGeometry[selectedLanguage]+"' onclick=\""+onClickText+"\" /></td>\n";
+					str += "\t\t\t<td><input type='button' name='saveButton' value='"+msgObj.buttonLabelSaveGeometry+"' onclick=\""+onClickText+"\" /></td>\n";
 				}
 				
 				if (!featureTypeMismatch && fid) {
 					if (options[i] == "update" && hasGeometryColumn) {
-						str += "\t\t\t<td><input type='button' name='updateButton' value='"+buttonLabelUpdateGeometry[selectedLanguage]+"' onclick=\""+onClickText+"\"/></td>\n";
+						str += "\t\t\t<td><input type='button' name='updateButton' value='"+msgObj.buttonLabelUpdateGeometry+"' onclick=\""+onClickText+"\"/></td>\n";
 					}
 					if (options[i] == "delete"){ 
-						var deleteOnClickText = "var deltrans = confirm('"+messageConfirmDeleteGeomFromDb[selectedLanguage]+"');";
+						var deleteOnClickText = "var deltrans = confirm('"+msgObj.messageConfirmDeleteGeomFromDb+"');";
 						deleteOnClickText += "if (deltrans){";
 						deleteOnClickText += onClickText + "}";
-						str += "\t\t\t<td><input type='button' name='deleteButton' value='"+buttonLabelDeleteGeometry[selectedLanguage]+"' onclick=\""+deleteOnClickText+"\"/></td>\n";
+						str += "\t\t\t<td><input type='button' name='deleteButton' value='"+msgObj.buttonLabelDeleteGeometry+"' onclick=\""+deleteOnClickText+"\"/></td>\n";
 					}
 				}
 				if (options[i] == "abort") {
-					str += "\t\t\t<td><input type='button' name='abortButton' value='"+buttonLabelAbort[selectedLanguage]+"' onclick=\"window.close();\" /></td>\n";
+					str += "\t\t\t<td><input type='button' name='abortButton' value='"+msgObj.buttonLabelAbort+"' onclick=\"window.close();\" /></td>\n";
 				}
 			}
 			str += "\t\t</tr>\n";
@@ -1159,7 +1162,7 @@
 	var mapObjInd = parent.getMapObjIndexByName(mod_digitize_target);
 
 	if (myconf['featuretype_srs'] != parent.mb_mapObj[mapObjInd].epsg) {
-		alert(errorMessageEpsgMismatch[selectedLanguage] + parent.mb_mapObj[mapObjInd].epsg + " / "+ myconf['featuretype_srs']);
+		alert(msgObj.errorMessageEpsgMismatch + parent.mb_mapObj[mapObjInd].epsg + " / "+ myconf['featuretype_srs']);
 	}
 	else {
 		var fid = false;
@@ -1177,7 +1180,7 @@
 						d.get(m).e.setElement(myform.elements[i].id, myform.elements[i].value);
 					}
 					else {
-						errorMessage = messageErrorFormEvaluation[selectedLanguage];
+						errorMessage = msgObj.messageErrorFormEvaluation;
 					}
 				}
 				// selectbox
@@ -1186,7 +1189,7 @@
 						d.get(m).e.setElement(myform.elements[i].id, myform.elements[i].options[myform.elements[i].selectedIndex].value);
 					}
 					else {
-						errorMessage = messageErrorFormEvaluation[selectedLanguage];
+						errorMessage = msgObj.messageErrorFormEvaluation;
 					}
 				}
 			}
@@ -1196,7 +1199,7 @@
 		}
 		str = parent.get_wfs_str(myconf, d, m, type, fid);
 		
-		parent.mb_ajax_post("../extensions/geom2wfst.php", {'filter':str,'url':myconf['wfs_transaction']}, function(json,status){
+		parent.mb_ajax_post("../extensions/geom2wfst.php", {'filter':str,'url':myconf['wfs_transaction'],'featuretype_name':myconf['featuretype_name'],'wfs_conf_id':wfsConf[d.get(m).wfs_conf]['wfs_conf_id']}, function(json,status){
 			var result = eval('('+json+')');
 			var response = result.response;
 			var fid = result.fid;
@@ -1217,10 +1220,10 @@
 	executeDigitizeSubFunctions();
 	
 	if (status == "success" && response == "success") {
-		var wfsWriteMessage = messageSuccessWfsWrite[selectedLanguage];
+		var wfsWriteMessage = msgObj.messageSuccessWfsWrite;
 	}
 	else {
-		var wfsWriteMessage = messageErrorWfsWrite[selectedLanguage];
+		var wfsWriteMessage = msgObj.messageErrorWfsWrite;
 	} 
 
 	if (typeof(wfsWindow) != 'undefined' && !wfsWindow.closed) {
@@ -1234,6 +1237,18 @@
 // --- wfs window (begin) -----------------------------------------------------------------------------------------
 // -----------------------------------------------------------------------------------------------------------
 
+function getMessages() {
+	parent.mb_ajax_json("../php/mod_digitize_messages.php", function(obj, status) {
+		msgObj = obj;
+		applyMessages();
+	});
+}
+
+function applyMessages() {
+	updateMeasureTag();
+	updateListOfGeometries();
+}
+
 	</script>
 	</head>
 	<body onload="registerFunctions();displayButtons();">

Modified: branches/mapbender_sld/http/javascripts/mod_displayWmc.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_displayWmc.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_displayWmc.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -16,9 +16,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
 include_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+include_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
 
+	
 	$wmc_id = $_GET["wmc_id"];
 
 	if ($wmc_id){
@@ -29,8 +30,16 @@
 		if ($wmc_gml){
 			//Display WMC
  
-			header("Content-type: application/xhtml+xml; charset=".CHARSET);
-			echo $wmc_gml;
+ 			// if "short open tags" is activated, the xml output is interpreted
+ 			// as php, because the XML begins with "<?xml "
+ 			if (ini_get("short_open_tag") == 1) {
+				echo htmlentities($wmc_gml);
+				$e = new mb_warning("'Allow short open tags' is 'On' in php.ini...you might want to turn it off to allow proper WMC display.'");
+ 			}
+ 			else {
+				header("Content-type: application/xhtml+xml; charset=".CHARSET);
+				echo $wmc_gml;
+ 			}
 		}
 		else{
 			echo "Invalid document!";

Modified: branches/mapbender_sld/http/javascripts/mod_dragMapSize.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_dragMapSize.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_dragMapSize.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -75,7 +75,7 @@
 		mouseCatcher.style.height = 500;
 		mouseCatcher.style.zIndex = 160;
 		if(top.ie)
-			mouseCatcher.style.background = "url(/../img/tranparent.gif)"; 
+			mouseCatcher.style.background = "url(../img/transparent.gif)"; 
 		mouseCatcher.style.left=clickX-250;
 		mouseCatcher.style.top=clickY-250;
 		

Added: branches/mapbender_sld/http/javascripts/mod_dynamicOverview.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_dynamicOverview.php	                        (rev 0)
+++ branches/mapbender_sld/http/javascripts/mod_dynamicOverview.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -0,0 +1,193 @@
+<?php
+# $Id: mod_dynamicOverview.php 1335 2007-05-22 13:44:57Z uli $
+# http://www.mapbender.org/index.php/Owsproxy
+# Module maintainer Uli
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+$e_id_css = 'dynamicOverview';
+$gui_id = $_REQUEST["gui_id"];
+include '../include/dyn_js.php';
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'dynamicOverview' 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"];
+	$cnt++;
+}
+if($cnt > 1){ echo "alert('dynamicOverview: ID not unique!');";}
+echo "var mod_dynamicOverview_target = '".$e_target."';";
+
+?>
+/*
+* element_var: mod_dynamicOverview_zoomFactor (proportion between main- and overview-map)
+* element_var: mod_dynamicOverview_startExtent (startextent of the main mapframe, minx,miny,maxx,maxy commaseparated)
+* element_var: mod_dynamicOverview_wmsIndex (wms by index to calculate the maxExtent)
+* element_var: mod_dynamicOverview_useMaxExtent (consider the maxExtent for the wms in the given srs)
+*/
+try{
+	if (mod_dynamicOverview_startExtent){}
+}
+catch(e){
+	mod_dynamicOverview_startExtent = false;
+}
+try{
+	if (mod_dynamicOverview_wmsIndex){ mod_dynamicOverview_wmsIndex = parseInt(mod_dynamicOverview_wmsIndex);}
+}
+catch(e){
+	mod_dynamicOverview_wmsIndex = 0;
+}
+try{
+	if (mod_dynamicOverview_useMaxExtent){}
+}
+catch(e){
+	mod_dynamicOverview_useMaxExtent = false;
+}
+
+var mod_dynamicOverviewCount = 0;
+var mod_dynamicOverviewSwitch = false;
+
+mb_registerPreFunctions("mod_dynamicOverviewCalculateExtent(frameName)");
+mb_registerSubFunctions("mod_dynamicOverviewSetVisibility(frameName)");
+
+function mod_dynamicOverviewCalculateExtent(frameName){
+	var arrayTargets = mod_dynamicOverview_target.split(",");
+	var disty = false;
+	var distx = false;
+	//set extent for the main mapframe from configuration param element_var
+	if(mod_dynamicOverview_startExtent && mod_dynamicOverviewCount == 0){
+		mod_dynamicOverviewCount++;
+		var arrayCoords = mod_dynamicOverview_startExtent.split(",");
+		var minx = parseFloat(arrayCoords[0]);
+		var miny = parseFloat(arrayCoords[1]);
+		var maxx = parseFloat(arrayCoords[2]);
+		var maxy = parseFloat(arrayCoords[3]);
+		mb_calculateExtent(arrayTargets[0],minx,miny,maxx,maxy);
+	}
+	// read params from main-mapframe
+	if(frameName == arrayTargets[0]){
+		var ind = getMapObjIndexByName(frameName);
+		
+		// get center in coords:
+		var coords = mb_mapObj[ind].extent.split(",");
+		var minx = parseFloat(coords[0]);
+		var miny = parseFloat(coords[1]);
+		var maxx = parseFloat(coords[2]);
+		var maxy = parseFloat(coords[3]);
+		distx = maxx - minx;
+		disty   = maxy - miny;
+		var centerx = minx + distx/2;
+		var centery = miny + disty/2;
+		
+		if(mod_dynamicOverview_zoomFactor){
+			mod_dynamicOverview_zoomFactor = parseFloat(mod_dynamicOverview_zoomFactor);
+			minx = centerx - ((distx/2)*mod_dynamicOverview_zoomFactor);
+			miny = centery - ((disty/2)*mod_dynamicOverview_zoomFactor);
+			maxx = centerx + ((distx/2)*mod_dynamicOverview_zoomFactor);
+			maxy = centery + ((disty/2)*mod_dynamicOverview_zoomFactor);
+			distx = maxx - minx;
+		    disty   = maxy - miny; 
+		}
+		
+		// check and set maxExtent for orverview 
+		if(mod_dynamicOverview_useMaxExtent){
+			if(mod_dynamicOverview_useMaxExtent){
+				var maxExtent = mod_dynamicOverview_useMaxExtent;
+			}
+			else{
+				var maxExtent = mod_dynamicOverviewGetMaxExtent(wms[mod_dynamicOverview_wmsIndex], wms[0].gui_wms_epsg);
+			}
+			if(maxExtent){
+				maxExtent = maxExtent.split(",");
+				var maxMinx = parseFloat(maxExtent[0]);
+				var maxMiny = parseFloat(maxExtent[1]);
+				var maxMaxx = parseFloat(maxExtent[2]);
+				var maxMaxy = parseFloat(maxExtent[3]);
+				var maxDistx = maxMaxx - maxMinx;
+				var maxDisty = maxMaxy - maxMiny;	
+				
+				if(distx && disty && (distx > maxDistx || disty > maxDisty)){
+					minx = maxMinx;
+					miny = maxMiny;
+					maxx = maxMaxx;
+					maxy = maxMaxy;
+				}
+			}	
+		}
+		//check and set minExtent for overview
+		var newMinExt = mod_dynamicOverviewCheckDiagonal(arrayTargets[1], minx,miny, maxx, maxy);
+		if(newMinExt){
+//			console.log("newMin: "+newMinExt);
+			var minCoords = newMinExt.split(",");
+			minx = 	parseFloat(minCoords[0]);	
+			miny = 	parseFloat(minCoords[1]);
+			maxx = 	parseFloat(minCoords[2]);
+			maxy = 	parseFloat(minCoords[3]);
+		}
+		mb_calculateExtent(arrayTargets[1],minx,miny,maxx,maxy)
+		zoom(arrayTargets[1],true, 1.0);
+	}
+	else if(frameName == arrayTargets[1]){
+		//switch hidden wms to visible
+		if(wms[mod_dynamicOverview_wmsIndex].gui_wms_visible != 1){
+			mod_dynamicOverviewSwitch = wms[mod_dynamicOverview_wmsIndex].gui_wms_visible;
+			wms[mod_dynamicOverview_wmsIndex].gui_wms_visible = 1;
+		}
+	}
+}
+function mod_dynamicOverviewCheckDiagonal(frameName, minx,miny, maxx, maxy){
+	var r = false;
+	var ind = getMapObjIndexByName(frameName);
+	var distx = maxx-minx;
+	var disty = maxy-miny;
+	var centerx = minx + distx/2;
+	var centery = miny + distx/2;
+	var xPerPix = distx/mb_mapObj[ind].width;
+	var yPerPix = disty/mb_mapObj[ind].height;
+	var d = Math.sqrt(Math.pow(xPerPix,2)+Math.pow(yPerPix,2));
+	if(mod_dynamicOverview_minScale && mod_dynamicOverview_minScale > d){
+		var newDistx = Math.sqrt(Math.pow((mod_dynamicOverview_minScale),2)/2)*mb_mapObj[ind].width;
+//		console.log(newDistx);
+		minx = centerx - newDistx/2;
+		maxx = centerx + newDistx/2;
+		miny = centery - newDistx/2;
+		maxy = centery + newDistx/2;
+		r = minx + ","+ miny + "," + maxx + "," + maxy;
+	}
+	return r;
+}
+function mod_dynamicOverviewSetVisibility(frameName){
+	var arrayTargets = mod_dynamicOverview_target.split(",");
+	if(mod_dynamicOverviewSwitch && frameName == arrayTargets[1]){
+		wms[mod_dynamicOverview_wmsIndex].gui_wms_visible = mod_dynamicOverviewSwitch;
+		
+	}	
+}
+function mod_dynamicOverviewGetMaxExtent(wms, srs){
+	var re = false;
+	for(var i=0; i<wms.gui_epsg.length; i++){
+		if(srs == wms.gui_epsg[i]){
+			var re = wms.gui_minx[i] +","+ wms.gui_miny[i]  +","+ wms.gui_maxx[i] +","+ wms.gui_maxy[i];
+//			window.console.log(re);	
+		}
+	}
+	return re;
+}

Modified: branches/mapbender_sld/http/javascripts/mod_forward.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_forward.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_forward.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -30,7 +30,7 @@
 $cnt = 0;
 while($row = db_fetch_array($res)){
 	$e_src = $row["e_src"];
-	$e_target = split(",",$row["e_target"]);
+	$e_target = mb_split(",",$row["e_target"]);
 	$cnt++;
 }
 if($cnt > 1){

Added: branches/mapbender_sld/http/javascripts/mod_gazetteerSQL_client.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_gazetteerSQL_client.php	                        (rev 0)
+++ branches/mapbender_sld/http/javascripts/mod_gazetteerSQL_client.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -0,0 +1,394 @@
+<?php
+session_start();
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+
+$e_id = $_REQUEST["elementID"];
+$e_target = explode(",", $_REQUEST["e_target"]);
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET;?>">
+<title>Gazetteer</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script type="text/javascript">
+
+var targetFrameArray = [];
+<?php
+echo "var e_id = '". $e_id . "';";
+for ($i = 0; $i < count($e_target); $i++) {
+	echo "targetFrameArray.push('".$e_target[$i]."');";
+}
+?>
+<!--
+// --- begin: expected element vars ---
+// var scale 
+// var numberOfResults
+// var profile = "adresse" | "alk" | "alb" | "adresse2"
+
+if (typeof(scale) == 'undefined') {
+	var scale = 2000;
+	var e = new parent.Mb_warning("mod_gazetteerSQL: element var scale is missing.");
+}
+if (typeof(numberOfResults) == 'undefined') {
+	var numberOfResults = 0;
+	var e = new parent.Mb_warning("mod_gazetteerSQL: element var numberOfResults is missing.");
+}
+if (typeof(tooManyResultsString) == 'undefined') {
+	var tooManyResultsString = "Too many results. Please specify your query.";
+	var e = new parent.Mb_warning("mod_gazetteerSQL: element var tooManyResultsString is missing.");
+}
+if (typeof(profile) == 'undefined' || (profile != "alb" && profile != "alk" && profile != "adresse" && profile != "adresse2")) {
+	profile = "adresse"
+	var e = new parent.Mb_exception("mod_gazetteerSQL: element var profile is missing.");
+}
+
+// --- end: expected element vars ---
+
+
+var generalPreFunctions = [];
+var generalSubFunctions = [];
+var onloadSubFunctions = [];
+var communesSubFunctions = [];
+var streetSubFunctions = [];
+var numberSubFunctions = [];
+var districtSubFunctions = [];
+var parcelSubFunctions = [];
+var ownerSubFunctions = [];
+
+registerFunction(generalPreFunctions, "disableForm();");
+registerFunction(generalSubFunctions, "enableForm();");
+if (profile == "alb") {
+	registerFunction(onloadSubFunctions, "updateCommunes();");
+	registerFunction(communesSubFunctions, "updateOwner();");
+	registerFunction(ownerSubFunctions, "updateOwner();");
+}
+else if (profile == "alk") {
+	registerFunction(onloadSubFunctions, "updateCommunes();");
+	registerFunction(communesSubFunctions, "updateDistricts();");
+	registerFunction(parcelSubFunctions, "updateParcels();");
+}
+else if (profile == "adresse") {
+	registerFunction(onloadSubFunctions, "updateCommunes();");
+	registerFunction(communesSubFunctions, "updateStreets();");
+	registerFunction(streetSubFunctions, "updateNumbers();");
+}
+else if (profile == "adresse2") {
+	registerFunction(onloadSubFunctions, "updateStreets();");
+	registerFunction(streetSubFunctions, "updateNumbers();");
+}
+
+function executeFunctions(arrayOfFunctionStrings) {
+	for (var i = 0; i < arrayOfFunctionStrings.length; i++) {
+		eval(arrayOfFunctionStrings[i]);
+	}
+}
+
+function registerFunction(functionStringArray, functionString) {
+	functionStringArray.push(functionString);
+}
+
+function disableForm() {
+	document.getElementById('selectCommune').disabled = true;
+	document.getElementById('selectStreet').disabled = true;
+	document.getElementById('selectDistrict').disabled = true;
+	document.getElementById('inputParcel1').disabled = true;
+	document.getElementById('inputParcel2').disabled = true;
+	document.getElementById('inputParcelButton').disabled = true;
+	document.getElementById('inputOwner').disabled = true;
+	document.getElementById('inputOwnerButton').disabled = true;
+	document.getElementById("divResults").innerHTML = searchImage;
+}
+
+function enableForm() {
+	document.getElementById('selectCommune').removeAttribute("disabled");
+	document.getElementById('selectStreet').removeAttribute("disabled");
+	document.getElementById('selectDistrict').removeAttribute("disabled");
+	document.getElementById('inputParcel1').removeAttribute("disabled");
+	document.getElementById('inputParcel2').removeAttribute("disabled");
+	document.getElementById('inputParcelButton').removeAttribute("disabled");
+	document.getElementById('inputOwner').removeAttribute("disabled");
+	document.getElementById('inputOwnerButton').removeAttribute("disabled");
+	document.getElementById("divResults").innerHTML = "";
+}
+
+var highlight;
+var houseLocation;
+var parcelLocation;
+var searchImage = "<table><tr><td><img src='../img/indicator_wheel.gif'></td><td>Searching...</td></tr></table>";
+var phpUrl = "../php/mod_gazetteerSQL_server.php";
+
+parent.mb_registerInitFunctions("window.frames['"+e_id+"'].initHighlight()");
+parent.mb_registerInitFunctions("window.frames['"+e_id+"'].executeFunctions(window.frames['"+e_id+"'].onloadSubFunctions)");
+
+
+// - BEGIN -------- HIGHLIGHTING AND ZOOMING ------------------------------------------
+
+function zoomToLocation(aPoint) {
+	parent.mb_repaintScale(targetFrameArray[0], aPoint.x, aPoint.y, scale)
+}
+
+function initHighlight() {
+	var generalHighlightZIndex = 100;
+	var generalHighlightLineWidth = 3;
+	var styleObj = {"position":"absolute", "top":"0px", "left":"0px", "z-index":generalHighlightZIndex};
+	highlight = new parent.Highlight(targetFrameArray, e_id, styleObj, generalHighlightLineWidth);
+}
+
+function zoomToHouseNumber(houseNumber) {
+	zoomToLocation(houseLocation[houseNumber]);
+	removeHighlight();
+	highlightHouseNumber(houseNumber);
+}
+
+function zoomToParcel(parcelId) {
+	zoomToLocation(parcelLocation[parcelId]);
+	removeHighlight();
+	highlightParcel(parcelId);
+}
+
+function highlightHouseNumber(houseNumber) {
+	var mG = new parent.MultiGeometry(parent.geomType.point);
+	mG.addGeometry();
+	mG.get(-1).addPoint(houseLocation[houseNumber]);
+	highlight.add(mG);
+}
+
+function highlightParcel(parcelId) {
+	var mG = new parent.MultiGeometry(parent.geomType.point);
+	mG.addGeometry();
+	mG.get(-1).addPoint(parcelLocation[parcelId]);
+	highlight.add(mG);
+}
+
+function removeHighlight() {
+	highlight.clean();
+}
+
+// - END -------- HIGHLIGHTING AND ZOOMING ------------------------------------------
+
+
+
+function removeChildNodes(node) {
+	while (node.childNodes.length > 0) {
+		var childNode = node.firstChild;
+		node.removeChild(childNode);
+	}
+}
+
+function getSize(result) {
+	if (typeof(result) == "array") {
+		return result.length;
+	}
+	else if (typeof(result) == "object") {
+		var c = 0;
+		for (var attr in result) {
+			c++;
+		}
+		return c;
+	}
+	return 1;
+}
+
+function updateCommunes() {
+	executeFunctions(generalPreFunctions);
+	parent.mb_ajax_json(phpUrl, {"command":"getCommunes"}, function (json, status) {
+		executeFunctions(generalSubFunctions);
+
+		removeChildNodes(document.getElementById('selectCommune'));
+
+		for (var communeId in json.communes) {
+			if (typeof(json.communes[communeId]) != 'function') {
+				var currentNode = document.createElement("option");
+			
+				if (document.getElementById('selectCommune').childNodes.length == 0) {
+					currentNode.selected = "selected";
+				}
+				currentNode.value = communeId;
+				currentNode.innerHTML = json.communes[communeId];
+				document.getElementById('selectCommune').appendChild(currentNode);
+			}
+		}
+		executeFunctions(communesSubFunctions);
+	});
+}
+
+function updateStreets() {
+	executeFunctions(generalPreFunctions);
+	var communeId = document.getElementById('selectCommune').value;
+	
+	parent.mb_ajax_json(phpUrl, {"command":"getStreets", "communeId":communeId}, function (json, status) {
+		executeFunctions(generalSubFunctions);
+
+		removeChildNodes(document.getElementById('selectStreet'));
+
+		for (var streetId in json.streets) {
+			if (typeof(json.streets[streetId]) != 'function') {
+				var currentNode = document.createElement("option");
+	
+				if (document.getElementById('selectStreet').childNodes.length == 0) {
+					currentNode.selected = "selected";
+				}
+				
+				currentNode.value = json.streets[streetId];
+				currentNode.innerHTML = json.streets[streetId];
+				document.getElementById('selectStreet').appendChild(currentNode);
+			}
+		}
+		executeFunctions(streetSubFunctions);
+	});
+}
+
+function updateDistricts() {
+	executeFunctions(generalPreFunctions);
+
+	var communeId = document.getElementById('selectCommune').value;
+	
+	parent.mb_ajax_json(phpUrl, {"command":"getDistricts", "communeId":communeId}, function (districtObject, status) {
+		executeFunctions(generalSubFunctions);
+
+		removeChildNodes(document.getElementById('selectDistrict'));
+
+		for (var districtId in districtObject.districts) {
+			if (typeof(districtObject.districts[districtId]) != 'function') {
+				var currentNode = document.createElement("option");
+	
+				currentNode.value = districtId;
+	
+				if (document.getElementById('selectDistrict').childNodes.length == 0) {
+					currentNode.selected = "selected";
+				}
+				
+				currentNode.value = districtObject.districts[districtId];
+				currentNode.innerHTML = districtObject.districts[districtId];
+				document.getElementById('selectDistrict').appendChild(currentNode);
+			}
+		}
+		executeFunctions(districtSubFunctions);
+	});
+}
+
+function updateNumbers() {
+	executeFunctions(generalPreFunctions);
+
+	var streetName = document.getElementById('selectStreet').value;
+	var communeId = document.getElementById('selectCommune').value;
+
+	parent.mb_ajax_json(phpUrl, {"command":"getNumbers", "communeId":communeId, "streetName":streetName, "numberOfResults":numberOfResults}, function (json, status) {
+		executeFunctions(generalSubFunctions);
+		houseLocation = {};
+		var resultString = "";
+		if (getSize(json.houseNumbers) > 0) {
+			if (json.limited === true) {
+				resultString += tooManyResultsString;
+			}
+			for (var houseNumber in json.houseNumbers) {
+				if (typeof(json.houseNumbers[houseNumber]) != 'function') {
+					houseLocation[houseNumber] = new parent.Point(json.houseNumbers[houseNumber].x, json.houseNumbers[houseNumber].y);
+					resultString += "<b style=\"cursor:pointer\" onclick=\"zoomToHouseNumber('"+houseNumber+"')\" onmouseover=\"highlightHouseNumber('"+houseNumber+"')\" onmouseout=\"removeHighlight()\">"+houseNumber+"</b>&nbsp;&nbsp; ";
+				}
+			}
+		}
+		else {
+			resultString += noResultsString;
+		}
+		document.getElementById("divResults").innerHTML = resultString;
+		executeFunctions(numberSubFunctions);
+	});
+}
+
+function updateParcels() {
+	executeFunctions(generalPreFunctions);
+	
+	var districtId = document.getElementById('selectDistrict').value;
+	var inputParcel1 = document.getElementById('inputParcel1').value;
+	var inputParcel2 = document.getElementById('inputParcel2').value;
+
+
+	parent.mb_ajax_json(phpUrl, {"command":"getLandparcelsByDistrict", "districtId":districtId, "parcelNumber1":inputParcel1, "parcelNumber2":inputParcel2, "numberOfResults":numberOfResults}, function (json, status) {
+		executeFunctions(generalSubFunctions);
+
+		parcelLocation = {};
+		var resultString = "";
+		if (getSize(json.landparcels) > 0) {
+			if (json.limited === true) {
+				resultString += tooManyResultsString;
+			}
+			resultString += "<ol>";
+			for (var parcelId in json.landparcels) {
+				if (typeof(json.landparcels[parcelId]) != 'function') {
+					parcelLocation[parcelId] = new parent.Point(json.landparcels[parcelId].x, json.landparcels[parcelId].y);
+					resultString += "<li style=\"cursor:pointer\" onclick=\"zoomToParcel('"+parcelId+"')\" onmouseover=\"highlightParcel('"+parcelId+"')\" onmouseout=\"removeHighlight()\">"+parcelId+"</li>";
+				}
+			}
+			resultString += "</ol>";
+		}
+		else {
+			resultString += noResultsString;
+		}
+		document.getElementById("divResults").innerHTML = resultString;
+		executeFunctions(numberSubFunctions);
+	});
+}
+
+function updateOwner() {
+	var ownerQueryString = document.getElementById('inputOwner').value;
+	var communeId = document.getElementById('selectCommune').value;
+
+	document.getElementById("divResults").innerHTML = "";
+	document.getElementById('selectCommune').removeAttribute("disabled");
+	document.getElementById('inputOwner').removeAttribute("disabled");
+	document.getElementById('inputOwnerButton').removeAttribute("disabled");
+	
+	if (ownerQueryString != "") {
+		executeFunctions(generalPreFunctions);
+		parent.mb_ajax_json(phpUrl, {"command":"getLandparcelsByOwner", "communeId":communeId, "ownerQueryString":ownerQueryString, "numberOfResults":numberOfResults}, function (json, status) {
+			executeFunctions(generalSubFunctions);
+
+			parcelLocation = {};
+			var resultString = "";
+			if (getSize(json.landparcels) > 0) {
+				if (json.limited === true) {
+					resultString += tooManyResultsString;
+				}
+				resultString += "<ol>";
+				for (var i=0; i < json.landparcels.length; i++) {
+					var parcelId = json.landparcels[i].landparcelId;
+					parcelLocation[parcelId] = new parent.Point(json.landparcels[i].x, json.landparcels[i].y);
+					resultString += "<li style=\"cursor:pointer\" onclick=\"zoomToParcel('"+parcelId+"')\" onmouseover=\"highlightParcel('"+parcelId+"')\" onmouseout=\"removeHighlight()\">"+json.landparcels[i].owner+ " (" + parcelId+")</li>";
+				}
+				resultString += "</ol>";
+			}
+			else {
+				resultString += noResultsString;
+			}
+			document.getElementById("divResults").innerHTML = resultString;
+			executeFunctions(numberSubFunctions);
+	
+		});
+	}
+}
+// -->
+</script>
+</head>
+<body>
+<form>
+<select class='selectCommune' id='selectCommune' onchange='executeFunctions(communesSubFunctions)'></select>
+<select class='selectStreet' id='selectStreet' onchange='executeFunctions(streetSubFunctions);' size=5 disabled></select>
+<select class='selectDistrict' id='selectDistrict' onchange='executeFunctions(districtSubFunctions);' size=5 disabled></select>
+<div id='divParcel' class='divParcel'>
+Flur: <input type='input' class='inputParcel1' id='inputParcel1' disabled></select>
+Flstz: <input type='input' class='inputParcel2' id='inputParcel2' disabled></select>
+<input type='button' id='inputParcelButton' value='?' onclick='executeFunctions(parcelSubFunctions);'>
+</div>
+<div id='divOwner' class='divOwner'>
+Eigent&uuml;mer: <input type='input' class='inputOwner' id='inputOwner' disabled></select>
+<input type='button' id='inputOwnerButton' value='?' onclick='executeFunctions(ownerSubFunctions);'>
+</div>
+</form>
+<div class='divResults' id='divResults'></div>
+</body>
+</html>
\ No newline at end of file

Modified: branches/mapbender_sld/http/javascripts/mod_help.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_help.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_help.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -38,7 +38,7 @@
 try{if(mod_help_color){}}catch(e){mod_help_color = '#cc33cc';}
 try{if(mod_help_thickness){}}catch(e){mod_help_color = 3;}
 var mod_help_elName = "help";
-var mod_halp_str = "";
+var mod_help_str = "";
 var mod_help_img_on = new Image(); mod_help_img_on.src =  "<?php  echo preg_replace("/_off/","_on",$e_src);  ?>";
 var mod_help_img_off = new Image(); mod_help_img_off.src ="<?php  echo $e_src;  ?>";
 var mod_help_img_over = new Image(); mod_help_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";

Modified: branches/mapbender_sld/http/javascripts/mod_highlightPOI.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_highlightPOI.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_highlightPOI.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -58,14 +58,14 @@
 	if (poi_width){}
 }
 catch(e){
-	poi_width = 20;
+	poi_width = 14;
 }
 
 try{
 	if (poi_height){}
 }
 catch(e){
-	poi_height = 20;
+	poi_height = 14;
 }
 
 try{

Modified: branches/mapbender_sld/http/javascripts/mod_initWmc.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_initWmc.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_initWmc.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -59,9 +59,9 @@
 		}
 		else $alt = $kml->description;
 
-		if (ereg("^.*,[[:space:]]((([[:alpha:]]+://)|(www.))[^<>[:space:]]+[[:alnum:]/]).*$", $kml->title)) {
-			$url = ereg_replace("^.*,[[:space:]]((([[:alpha:]]+://)|(www.))[^<>[:space:]]+[[:alnum:]/]).*$", "\\1", $kml->title);
-			if (substr($url, 0, 4) == "www.") {
+		if (mb_ereg("^.*,[[:space:]]((([[:alpha:]]+://)|(www.))[^<>[:space:]]+[[:alnum:]/]).*$", $kml->title)) {
+			$url = mb_ereg_replace("^.*,[[:space:]]((([[:alpha:]]+://)|(www.))[^<>[:space:]]+[[:alnum:]/]).*$", "\\1", $kml->title);
+			if (mb_substr($url, 0, 4) == "www.") {
 				$url = "http://" . $url;
 			}
 		}

Modified: branches/mapbender_sld/http/javascripts/mod_insertKmlIntoDb.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_insertKmlIntoDb.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_insertKmlIntoDb.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -79,7 +79,7 @@
 	$kml->createKMLFromObj();
 	
 	$sql = "INSERT INTO mb_meetingpoint VALUES ($1, $2, $3, $4, $5, $6)";
-	$v = array($kml->kml_id, $wmc_id, str_replace("&", "&#38;" , html_entity_decode($kml->kml)), $_SESSION["mb_user_id"], $_SESSION["mb_user_password"], $gui_id);
+	$v = array($kml->kml_id, $wmc_id, preg_replace("/&/", "&#38;" , html_entity_decode($kml->kml)), $_SESSION["mb_user_id"], $_SESSION["mb_user_password"], $gui_id);
 	$t = array('s', 's', 's', 'i', 's', 's');
 	$res = db_prep_query($sql, $v, $t);
 	
@@ -93,7 +93,7 @@
 	}
 	$filename = "../tmp/".$kml->kml_id.'.kml';
 	$handle = fopen($filename, "w");
-	fputs($handle, str_replace("&", "&#38;" , html_entity_decode($kml->kml)));
+	fputs($handle, preg_replace("/&/", "&#38;" , html_entity_decode($kml->kml)));
 	fclose($handle);
 	
 	echo "Please feel free to add the <a href = 'http://".$_SERVER['HTTP_HOST']."/mburl/".$kml->kml_id."'>link</a> to your meeting point to your website.<br><br>";

Modified: branches/mapbender_sld/http/javascripts/mod_insertLayerPreviewIntoDb.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_insertLayerPreviewIntoDb.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_insertLayerPreviewIntoDb.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -1,5 +1,5 @@
 <?php
-#$Id: mod_insertWmcIntoDb.php 359 2006-10-09 16:41:18Z christoph $
+#$Id: mod_insertLayerPreviewIntoDb.php 915 2007-09-19 13:57:27Z 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 
 #
@@ -18,41 +18,48 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 session_start();
-include("../../conf/mapbender.conf");
+include(dirname(__FILE__)."/../../conf/mapbender.conf");
+include(dirname(__FILE__)."/../../conf/geoportal.conf");
 require_once(dirname(__FILE__)."/../classes/class_administration.php");
+require_once(dirname(__FILE__)."/../classes/class_connector.php");
+require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
+
+function savePreview($fileName, $fileContent) {
+	if (strlen($fileContent) > 0) {
+		$fileMapImg = fopen("..".LAYER_PREVIEW_URL."/".$fileName, 'w+');
+		if ($fileMapImg) {
+			rewind($fileMapImg);
+			$bytesWritten = fwrite($fileMapImg, $fileContent);
+			if ($bytesWritten) {
+				fflush($fileMapImg);
+				ftruncate($fileMapImg, ftell($fileMapImg));
+				fclose($fileMapImg);
+				return true;
+			}
+			$e = new mb_exception("..".LAYER_PREVIEW_URL."/".$fileName.": 0 bytes written.");
+			return false;
+		}
+		$e = new mb_exception("..".LAYER_PREVIEW_URL."/".$fileName.": could not open.");
+		return false;
+	}
+	$e = new mb_exception($fileName.": no file content.");
+	return false;
+}
+
+
 $gui_id = $_REQUEST["gui_id"];
 
 $con = db_connect($DBSERVER,$OWNER,$PW);
 db_select_db(DB,$con);
 
-
-function escByteA($binData) {
-   $search = array();
-   $replace = array();
-   array_push($search, chr(92)); 
-   array_push($replace, '\\134'); 
-   array_push($search, chr(0)); 
-   array_push($replace, '\\000'); 
-   array_push($search, chr(39)); 
-   array_push($replace, '\\047'); 
-   array_push($search, chr(13)); 
-   array_push($replace, '\\015'); 
-   array_push($search, chr(10)); 
-   array_push($replace, '\\012'); 
-
-  $binData = str_replace($search, $replace, $binData);
-  return $binData;
-}
-
-
 if ($_POST["data"]) {
 	$d = explode("____", $_POST["data"]);	
 
 	$mapurl = $d[0];
 	$legendurl = $d[1];
 	
-	$mapurl = eregi_replace("(&width=)[0-9]+($|[^0-9])", "\\1200\\2", $mapurl);
-	$mapurl = eregi_replace("(&height=)[0-9]+($|[^0-9])", "\\1200\\2", $mapurl);
+	$mapurl = eregi_replace("(&width=)[0-9]+($|[^0-9])", "\\1".LAYER_PREVIEW_WIDTH."\\2", $mapurl);
+	$mapurl = eregi_replace("(&height=)[0-9]+($|[^0-9])", "\\1".LAYER_PREVIEW_HEIGHT."\\2", $mapurl);
 		
 	$adm = new administration();
 	$layer_id = $_SESSION['layer_preview'];
@@ -60,9 +67,19 @@
 		 echo "<script>alert('Could not find wms: ".$wms_getmap."');</script>";
 	}
 	else {
-		$map_img = file_get_contents($mapurl);	
-		$legend_img = file_get_contents($legendurl);	
-
+		session_write_close();
+		$con1 = new connector($mapurl);
+		$fileNameMap = $layer_id."_layer_map_preview.png";
+		$fileContentMap = $con1->file;
+		$success = savePreview($fileNameMap, $fileContentMap);
+		if (!$success) $fileNameMap = "";
+		
+		$con2 = new	connector($legendurl);
+		$fileNameLegend = $layer_id."_layer_legend_preview.png";
+		$fileContentLegend = $con2->file;
+		$success = savePreview($fileNameLegend, $fileContentLegend);
+		if (!$success) $fileNameLegend = "";
+ 		
 //		$rlp_4326_box = array(6.10988942079081,48.987785376052,8.58790010810365,50.9273496139233);
 		$rlp_4326_box = array(6.05,48.9,8.6,50.96);
 		
@@ -118,8 +135,11 @@
 			if ($new_miny < -90) $rlp_4326_box[1] = -90; else $rlp_4326_box[1] = $new_miny;
 			if ($new_maxy > 90) $rlp_4326_box[3] = 90; else $rlp_4326_box[3] = $new_maxy;
 		}
-//		echo "<script>prompt('link', 'http://212.79.172.107/cgi-bin/mapserv?map=/data/umn/service_layer.map&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=rlp,ows_layer&STYLES=&SRS=EPSG:4326&BBOX=".$rlp_4326_box[0].",".$rlp_4326_box[1].",".$rlp_4326_box[2].",".$rlp_4326_box[3]."&WIDTH=600&HEIGHT=600&FORMAT=image/png&BGCOLOR=0xffffff&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage&layer_id=".$extent_layer_id."');</script>";
-		$extent_img = file_get_contents("http://212.79.172.107/cgi-bin/mapserv?map=/data/umn/service_layer.map&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=rlp,ows_layer&STYLES=&SRS=EPSG:4326&BBOX=".$rlp_4326_box[0].",".$rlp_4326_box[1].",".$rlp_4326_box[2].",".$rlp_4326_box[3]."&WIDTH=120&HEIGHT=120&FORMAT=image/png&BGCOLOR=0xffffff&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage&layer_id=".$extent_layer_id);
+		$con3 = new connector(LAYER_EXTENT_URL."VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=rlp,ows_layer&STYLES=&SRS=EPSG:4326&BBOX=".$rlp_4326_box[0].",".$rlp_4326_box[1].",".$rlp_4326_box[2].",".$rlp_4326_box[3]."&WIDTH=120&HEIGHT=120&FORMAT=image/png&BGCOLOR=0xffffff&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage&layer_id=".$extent_layer_id);
+		$fileNameExtent = $layer_id."_layer_extent_preview.png";
+		$fileContentExtent = $con3->file;
+		$success = savePreview($fileNameExtent, $fileContentExtent);
+		if (!$success) $fileNameExtent = "";
 
 		$sql = "SELECT * FROM layer_preview WHERE fkey_layer_id = $1";
 		$v = array($layer_id);
@@ -127,17 +147,16 @@
 		$res = db_prep_query($sql, $v, $t);
 		$row = db_fetch_array($res);
 		if ($row['fkey_layer_id'] == $layer_id) {
-			$sql = "UPDATE layer_preview SET layer_map_preview = $1, layer_extent_preview = $2, layer_legend_preview = $3 WHERE fkey_layer_id = $4";
-			$v = array( escByteA($map_img),  escByteA($extent_img), escByteA($legend_img), $layer_id);
+			$sql = "UPDATE layer_preview SET layer_map_preview_filename = $1, layer_extent_preview_filename = $2, layer_legend_preview_filename = $3 WHERE fkey_layer_id = $4";
+			$v = array($fileNameMap, $fileNameExtent, $fileNameLegend, $layer_id);
 			$t = array('s', 's', 's', 'i');
 		}
 		else {
-			$sql = "INSERT INTO layer_preview (fkey_layer_id, layer_map_preview, layer_extent_preview, layer_legend_preview) VALUES ($1, $2, $3, $4)";
-			$v = array($layer_id, escByteA($map_img), escByteA($extent_img), escByteA($legend_img));
+			$sql = "INSERT INTO layer_preview (fkey_layer_id, layer_map_preview_filename, layer_extent_preview_filename, layer_legend_preview_filename) VALUES ($1, $2, $3, $4)";
+			$v = array($layer_id, $fileNameMap, $fileNameExtent, $fileNameLegend);
 			$t = array('i', 's', 's', 's');
 		}
 			
-			
 		$res = db_prep_query($sql, $v, $t);
 		if (db_error()) {
 			 echo "<script>alert(\"Error while saving layer preview: ".addslashes(db_error())."\");</script>";

Modified: branches/mapbender_sld/http/javascripts/mod_legend.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_legend.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_legend.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -64,6 +64,7 @@
 
 <script type="text/javascript">
 <!--
+
 mod_legend_offsetLeft = 25;
 mod_legend_offsetTop = -10;
 
@@ -80,10 +81,9 @@
 catch(e){
 	stickylegend = 'false';
 }
+// Todo: return-value may change in the next version....
+parent.mb_registerSubFunctions("window.frames['legend'].mod_legend_pos(frameName)");
 
-parent.mb_registerSubFunctions("window.frames['legend'].mod_legend_pos()");
-
-
 function mod_legend_init(){
 	var obj = parent.document.getElementById("legend");
 	obj.style.top = mod_legend_target_top  + mod_legend_offsetTop;
@@ -95,127 +95,86 @@
 		checkobj.style.height = 0;
 	}
 }
+
 function mod_legend_repaint(obj){
 	var checkobj = document.getElementById("checkboxstyle");
 	if(checkobj.style.visibility == "visible"){
 		mod_legend_pos();     
 	}
 }
-function mod_legend_pos(){
-	var ind = parent.getMapObjIndexByName(mod_legend_target);
-	var obj = parent.document.getElementById("legend");
 
-	if(stickylegend == 'true'){
-		obj.style.left = parseInt(parent.mb_mapObj[ind].width) + mod_legend_target_left + mod_legend_offsetLeft;
-	}
-
-	if(document.forms[0].sw.checked ==  false){
-		parent.writeTag("legend", "leg", "");
-		return true;
-	}
-
-	var layers;
-	var str = "";
-	var str_tmp = "";
-
-	for(var i=0; i<parent.mb_mapObj[ind].wms.length; i++){
-   		var img_format = parent.mb_mapObj[ind].wms[i].gui_wms_mapformat;
-		//if(parent.mb_mapObj[ind].wms[i].wms_getlegendurl != ""){
-		if(parent.mb_mapObj[ind].wms[i].gui_wms_visible != 0){
-			layers = parent.mb_checkScale(mod_legend_target,ind,i);
-			
-			if(layers[0] != ""){   				    
-				var layer = layers[0].split(",");
-				var titles = layers[2].split(",");
-				var legendurl = layers[3].split(",");
-				var layerparent= layers[4].split(",");
-				var tmp_name = "";
+function mod_legend_pos(frameName){
+	if(frameName == mod_legend_target){
+		var ind = parent.getMapObjIndexByName(mod_legend_target);
+		var obj = parent.document.getElementById("legend");
 	
-        		
-				for(var j=0; j<layer.length; j++){
-				
-		    		var l = parent.mb_getchildsbyname(ind,i,layer[j]);
-    	    		
-		    		// handle grouped layers
-				 	if (l) {				  		
-          				for (var k=0; k<l["name"].length; k++){
-          					//str_tmp += l["title"][k]; // ------
-          					
-          					
-          					if (l["legendurl"][k]!='' && l["legendurl"][k]!=0){
-					 			if (tmp_name != l["title"][k]) {
-					 				if (showgroupedlayertitle == 'true'){				
-				  						str_tmp += "<div><span class='titles'>" +l["title"][k]+ "</span></div>";
-				  					}
-				 	  				str_tmp += "<div>";
-				 	  				if(legendlink == 'true'){
-                                		str_tmp += "<a href='../php/result.php?lingo=deutsch&layer="+layer[j]+l["name"][k]+"' class='legendlink' title='Zeigt Liste zum Thema: "+titles[j]+"' target='result'>";
-                                	}
-                                	str_tmp += "<img border=0 src = '";			
-					  				str_tmp += l["legendurl"][k];
-					  				str_tmp += "'></img>";		
-					  				//str_tmp += l["legendurl"][k];
-					  				if (legendlink == 'true'){
-                                		str_tmp += "</a>";
-                                	}
-                                	str_tmp += "</div>"; 
-									tmp_name = l["title"][k];
-					 			}	// if
-					 		} // if legendurl
-         				 } // for var k=0
-         			} // if (l)         
-         			else {
-         				if (legendurl[j]!='' && legendurl[j]!=0){
-         					if(layerparent[j] == 0){
-	         					if(showlayertitle == 'true'){
-									str_tmp += "<div><span class='titles'>" + titles[j]+ "</span></div>";
-								}
-								str_tmp += "<div>";
-	                        	if(legendlink == 'true'){
-	                        		str_tmp += "<a href='../php/result.php?lingo=deutsch&layer="+layer[j]+"' class='link_metadata' title='Zeigt Liste zum Thema: "+titles[j]+"' target='result'>";
-	                        	}
-	                        	str_tmp += "<img border=0 src = '";			
-								str_tmp += legendurl[j];
-								
-								str_tmp += "'></img>";
-							
-								//str_tmp += "legend:"+legendurl[j];
-								if (legendlink == 'true'){
-	                        		str_tmp += "</a>";
-	                        	}
-	                        	str_tmp += "</div>";
-                        	}//layerparent
-                        } // legendurl[j]!='' && legendurl[j]!=0
-					} // else
-					
-
-					
-					
-				}// for
-			} // if (layers[0...       
-		//}     // if (parent.mb_mapObj[ind].wms[i].wms_getlegendurl != "")
+		if(stickylegend == 'true'){
+			obj.style.left = parseInt(parent.mb_mapObj[ind].width) + mod_legend_target_left + mod_legend_offsetLeft;
 		}
-					
-					if(str_tmp !=''){
-  		  		if (showwmstitle == 'true'){
-    					str += "<div><span class='header'>" +parent.mb_mapObj[ind].wms[i].wms_title+ "</span></div>";
-    				} 
-						str += str_tmp;
-						//prompt('',str_tmp);
-						str_tmp ='';
-					}	
+	
+		if(document.forms[0].sw.checked ==  false){
+			parent.writeTag("legend", "leg", "");
+			return true;
+		}
 		
-	}// for
-    
-	if(str != ""){
-		parent.writeTag("legend", "leg", str);
-		//prompt('',str);
+		var str = "";
+		var str_tmp = "";
+						
+		for(var i=0; i<parent.mb_mapObj[ind].wms.length; i++){
+			
+			 	var layerNames = parent.mb_mapObj[ind].wms[i].getLayers(parent.mb_mapObj[ind]);
+				for(var j=0; j<layerNames.length; j++){
+					var layerParent = parent.mb_mapObj[ind].wms[i].checkLayerParentByLayerName(layerNames[j]); 
+					var layerTitle = parent.mb_mapObj[ind].wms[i].getTitleByLayerName(layerNames[j]);
+					var layerStyle = parent.mb_mapObj[ind].wms[i].getCurrentStyleByLayerName(layerNames[j]);
+					var legendUrl = false;
+					if(layerStyle == false){
+						legendUrl = parent.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layerNames[j],"default");	
+					}
+					else{
+						legendUrl = parent.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layerNames[j],layerStyle);
+					}
+					//console.log("layer_infos : %s",layerNames[j],"---",layerParent,"---",layerTitle,"---",layerStyle,"---",legendUrl);
+			         
+					if (legendUrl !== false){
+						
+//						console.log("legendUrl: %s, typeof(legendUrl): %s", legendUrl, typeof(legendUrl));
+//	 					if(layerParent == 0){
+		 					if(showlayertitle == 'true'){
+								str_tmp += "<div><span class='titles'>" + layerTitle+ "</span></div>";
+							}
+							str_tmp += "<div>";
+		                    if(legendlink == 'true'){
+		                    	str_tmp += "<a href='../php/result.php?lingo=deutsch&layer="+layerNames[j]+"' class='link_metadata' title='Zeigt Liste zum Thema: "+layerTitle+"' target='result'>";
+		                    }
+		                    str_tmp += "<img border=0 src = '";			
+							str_tmp += legendUrl;
+							str_tmp += "'></img>";
+							if (legendlink == 'true'){
+		                    	str_tmp += "</a>";
+		                    }
+		                    str_tmp += "</div>";
+//	                	}
+					} 
+				}
+			if(str_tmp !=''){
+				if (showwmstitle == 'true'){
+					str += "<div><span class='header'>" +parent.mb_mapObj[ind].wms[i].wms_title+ "</span></div>";
+				}
+				str += str_tmp;
+				str_tmp ='';
+			}		
+		}
+		//console.log("ind =%s",ind,"str =",str);
+	    if(str != ""){
+			parent.writeTag("legend", "leg", str);
+		}
+		else{
+			parent.writeTag("legend", "leg", "");
+		}
+		return true;
 	}
-	else{
-		parent.writeTag("legend", "leg", "");
-	}
-	return true;
-} // function mod_legend_pos()
+} 
 
 // -->
 </script>

Modified: branches/mapbender_sld/http/javascripts/mod_loadwmc.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_loadwmc.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_loadwmc.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -37,41 +37,79 @@
 if($cnt > 1){
 	echo "alert('loadwmc: ID not unique!');";
 }
+$e_id_css = "loadwmc";
+include("../include/dyn_js.php");
 
 echo "mod_loadwmc_target = '".$e_target."';";
 
+/*
+// this may be added at a later stage
+if ($new_wmc == 1) {
+	include("../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("../merge_layers.php");
+	}
+	if ($_SESSION['GML']) {
+		$e = new mb_notice("loadwmc: merging bbox");
+		include("../merge_bbox.php");
+	}
+}
+*/
 ?>
-
 function load_wmc_session() {
 	<?php
-		if (isset($_SESSION['mb_wmc']) && !empty($_SESSION['mb_wmc'])) {
+		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");
 				}
-				else if ($_SESSION['startup'] == true) {
+				else if ($startup == true) {
+//					echo "var e = new Mb_notice('mod_loadwmc: load_wmc_session: load new wmc');";
 					$js = $wmc->createJsObjFromWMC("", $e_target, "merge");
-					$_SESSION['startup'] = false;
+					$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;
 			}
+			else {
+				echo "var e = new Mb_notice('mod_loadwmc: load_wmc_session: error parsing wmc');";
+			}
 		}
+		else {
+			echo "var e = new Mb_warning('mod_loadwmc: load_wmc_session: no wmc set!');";
+		}
 	?>
 }
-//mb_registerInitFunctions('load_wmc_session()');
 
+try {if (loadFromSession) {}}catch(e) {loadFromSession = 0;}
+
+if (loadFromSession) {
+	mb_registerInitFunctions('load_wmc_session()');
+}
+
 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);  ?>";
+//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 "e_id=".$e_id . "&" . SID;?>","displayWmc","width=500, height=600, scrollbars=yes, dependent=yes");
-	//windowWmc.focus();
+	windowWmc = window.open("../php/mb_listWMCs.php?<?php echo SID;?>","displayWmc","width=500, height=600, scrollbars=yes, dependent=yes");
 }
 function mod_loadwmc_init(obj){
 	//document.getElementById("loadwmc").src = mod_zoom1_img_over.src;

Modified: branches/mapbender_sld/http/javascripts/mod_measure.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_measure.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_measure.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -149,6 +149,14 @@
 	drawDashedLine();
 }
 function drawDashedLine(){
+	//check if epsg has changed
+	var ind = getMapObjIndexByName(mod_measure_target);
+	if(mod_measure_epsg != mb_mapObj[ind].epsg){
+		mod_measure_delete();
+		mod_measure_width = mb_mapObj[ind].width;
+		mod_measure_height = mb_mapObj[ind].height;
+		mod_measure_epsg = mb_mapObj[ind].epsg;
+	}
 	var str_mPoints = "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='"+mod_measure_width+"' height='0'></div>";
 	str_mPoints += "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='0' height='"+mod_measure_height+"'></div>";
 	for(var i=0; i<mod_measure_RX.length; i++){

Modified: branches/mapbender_sld/http/javascripts/mod_measure4326.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_measure4326.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_measure4326.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -37,7 +37,7 @@
 }
 echo "var mod_measure_target = '".$e_target."';";
 
-require_once("ajax_jquery.js");
+require_once("../extensions/jquery.js");
 $e_id_css = "measure";
 include '../include/dyn_js.php';
 ?>

Modified: branches/mapbender_sld/http/javascripts/mod_navFrame.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_navFrame.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_navFrame.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -20,6 +20,7 @@
 
 $gui_id = $_REQUEST["gui_id"];
 require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+include '../include/dyn_js.php';
 $con = db_connect($DBSERVER,$OWNER,$PW);
 db_select_db(DB,$con);
 $sql = "SELECT e_target,e_src FROM gui_element WHERE e_id = 'navFrame' AND fkey_gui_id = $1";
@@ -37,7 +38,14 @@
 }
 echo "var mod_navFrame_src = '".db_result($res,0,"e_src")."';";
 ?>
-var mod_navFrame_ext = 10;
+
+try{
+	if (mod_navFrame_ext){}
+}
+catch(e){
+	mod_navFrame_ext = 10;
+}
+
 mb_registerSubFunctions("mod_navFrame_arrange()");
 
 function  mod_navFrame_arrange(){
@@ -47,6 +55,7 @@
 	var myTop = parseInt(el.top);
 	var myWidth = parseInt(el.width);
 	var myHeight = parseInt(el.height);
+	
 	//left,top,width,height
 	mod_navFrame_pos("mbN",(myLeft),(myTop - ext),(myWidth),(ext));
 	document.getElementById("arrow_n").style.left = myWidth/2 - document.getElementById("arrow_n").width/2;   

Added: branches/mapbender_sld/http/javascripts/mod_poi.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_poi.php	                        (rev 0)
+++ branches/mapbender_sld/http/javascripts/mod_poi.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -0,0 +1,322 @@
+<?php
+require_once("../../conf/mapbender.conf");
+session_start();
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta name="author-mail" content="info at ccgis.de">
+<meta name="author" content="U. Rothstein">
+<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=iso-8859-1">
+<meta name="DC.Rights" content="CCGIS GbR, Bonn">
+<title>Suche</title>
+<?
+	$gui_id = $_SESSION["mb_user_gui"];
+	$e_id_css = 'poi';
+	include_once("../include/dyn_css.php");
+?>
+<style type="text/css">
+<!--
+	body{
+		font-family : Arial, Helvetica, sans-serif;
+		font-size : 12px;
+		font-weight : bold;
+		color: #808080;
+		background-color: 'ffffff';
+	}
+	.header{
+		color: #cc3366;
+	}
+	a:link{
+		font-family : Arial, Helvetica, sans-serif;
+		text-decoration : none;
+		color: #808080;
+		font-size : 12px;
+		font-weight : bold;
+	}
+	a:visited{
+		font-family : Arial, Helvetica, sans-serif;
+		text-decoration : none;
+		color: #808080;
+		font-size : 12px;
+		font-weight : bold;
+	}
+	a:hover{
+		font-family : Arial, Helvetica, sans-serif;
+		color: white;
+		text-decoration : none;
+		font-weight : bold;
+		background-color : #999999;
+	}
+	a:active{
+		font-family : Arial, Helvetica, sans-serif;
+		color: blue;
+		text-decoration : none;
+		font-weight : bold;
+	}
+	.textfield{
+		border : 2 solid #D3D3D3;
+		font-family : Arial, Helvetica, sans-serif;
+		font-size : 12px;
+		font-weight : bold;
+		color: #808080;
+		width: 100px;
+		position: absolute;
+		left: 50px
+	}
+	.sbutton{
+	font-size : 10px;
+		width: 28px;
+		height: 22px;
+		position: absolute;
+		left: 152px;
+	}
+	.resultFrame{
+		width: 180px;
+		height: 140px;
+		border: 1px;
+		position: absolute;
+		top: 25px;
+		left: 5px;
+		overflow-x : hidden;
+	}
+-->
+</style>
+<?php
+#if(isset($lingo)){$lingo = $_REQUEST["lingo"];}
+#else{$lingo = "deutsch";}
+#$language = parse_ini_file("../language/".$lingo.".txt");
+
+echo "<script type='text/javascript'>";  
+echo "var conffile = '".$_REQUEST["conf_file"]."';";
+echo "var lingo = '".$_REQUEST["lingo"]."';";
+echo "var backlink = '".$_REQUEST["backlink"]."';";
+
+$lingo = $_REQUEST["lingo"];
+$title = "layername_".$lingo;
+require_once("../../conf/".$_REQUEST["conf_file"]);
+
+echo "</script>"; 
+?>
+<script type="text/javascript">
+<!--
+
+function validate(){
+
+   if(document.form1.search.value.length < 1){
+      alert("Bitte vervollst�ndigen Sie die Angaben!");
+      document.form1.search.focus();
+      return false;
+   }
+   else{   
+      text = "mod_poi.php?&search=" + document.form1.search.value+"&conf_file="+conffile+"&lingo="+lingo+"&backlink="+backlink;
+      if (backlink=='parent'){
+      	window.frames["result"].location.href = text;
+      }else{
+      	parent.result.window.location.href = text;
+      }
+      return false;
+   }
+}
+function statistic(value){
+	if (backlink =='parent'){
+   		parent.parent.StatisticFrame.location.href = "../statistic.php?request=" + escape(value);
+   	}
+   	else{
+   		parent.StatisticFrame.location.href = "../statistic.php?request=" + escape(value);
+    }
+   return;
+}
+
+
+function showHighlight(x,y){
+
+	if (backlink =='parent'){
+		parent.parent.mb_showHighlight("mapframe1",x,y);
+		parent.parent.mb_showHighlight("overview",x,y);
+		//alert (backlink);
+	}else{
+		parent.mb_showHighlight("mapframe1",x,y);
+		parent.mb_showHighlight("overview",x,y);
+	}
+}
+function hideHighlight(){
+	if (backlink =='parent'){
+		parent.parent.mb_hideHighlight("mapframe1");
+		parent.parent.mb_hideHighlight("overview");
+	}else{
+		parent.mb_hideHighlight("mapframe1");
+		parent.mb_hideHighlight("overview");
+	}
+}
+
+function handleLayer(sel_lay, wms_title){
+    
+	//var wms_title = document.forms[0].wmsTitle.value
+
+	var x = new Array();
+
+    x[0] = sel_lay;
+
+    var y = new Array();
+    
+    if (backlink =='parent'){
+		var wms_ID = parent.parent.getWMSIDByTitle('mapframe1',wms_title);
+	}
+	else{
+		var wms_ID = parent.getWMSIDByTitle('mapframe1',wms_title);
+	}
+
+    y[0] = wms_ID;
+    
+	//alert(wms_title + " -- X "+ x + "wms_id" + wms_ID);
+	
+	if (backlink =='parent'){
+		parent.parent.handleSelectedLayer_array('mapframe1',y,x,'querylayer',1);
+		parent.parent.handleSelectedLayer_array('mapframe1',y,x,'visible',1);
+		parent.parent.mb_execloadWmsSubFunctions();
+	}
+	else{
+		parent.handleSelectedLayer_array('mapframe1',y,x,'querylayer',1);
+		parent.handleSelectedLayer_array('mapframe1',y,x,'visible',1);		
+		parent.mb_execloadWmsSubFunctions();
+	}
+}
+// -->
+</script>
+</head>
+<body leftmargin="2" topmargin="0" bgcolor="#ffffff">
+<?php
+
+if(!isset($_REQUEST["search"]) || $_REQUEST["search"] == ""){
+	echo "<form name='form1' target='result' onsubmit='return validate();'>";
+	echo "Suchen: &nbsp;&nbsp;<input class='textfield' name='search' type='text'> ";
+	echo "<input class='sbutton' type='submit' name='send'  value='ok'>";
+	echo "<iframe frameborder='1' name='result' src='../html/mod_blank.html' class='resultFrame' scrolling='auto'></iframe>";
+	echo "</form>";
+}
+else{
+	if(preg_match("/\*/",$_REQUEST["search"])){
+		$search = trim(preg_replace("/\*/i","", $_REQUEST["search"]));
+	}
+
+	$con = pg_connect ($con_string) or die ("Error while connecting database $dbname");
+
+	#$sql = "SELECT DISTINCT identificationinfo,minscale, md_fileidentifier ,search_columns, search_result  FROM tab_metadata WHERE public = '1' and not identificationinfo = 'Rasterebene' and not identificationinfo = 'rasterlayer'";
+	$sql = "SELECT DISTINCT identificationinfo,minscale, md_fileidentifier ,".$title.",search_columns, search_result,search_keywords, wms_title  FROM tab_metadata WHERE public = '1' and not identificationinfo = 'Rasterebene' and not identificationinfo = 'rasterlayer'";
+	$res = pg_query($con,$sql);
+	$cnt = 0;
+
+	while(pg_fetch_row($res)){
+		$table[$cnt] = pg_result($res,$cnt,"identificationinfo"); # Tabellen, Abfragenname
+		$minscale[$cnt] = pg_result($res,$cnt,"minscale");	
+		$md_fileidentifier[$cnt] = pg_result($res,$cnt,"md_fileidentifier"); # Layername
+		$layername[$cnt] = pg_result($res,$cnt,"md_fileidentifier"); # Layername in der Mapdatei
+		$result_title[$cnt] = pg_result($res,$cnt,"\"".$title."\""); # layer_deutsch Ergebnisname
+		$search_columns[$cnt] = pg_result($res,$cnt,"search_columns"); # Suchspalten, Trennung �ber ,
+		$search_result[$cnt] = pg_result($res,$cnt,"search_result"); # Ergebnisspalte
+		$search_keywords[$cnt] = pg_result($res,$cnt,"search_keywords"); # Ergebnisspalte
+		$wms_title[$cnt] = pg_result($res,$cnt,"wms_title"); # WMS tile
+           
+		# if one of the searchkeywords is found the data of the whole table is displayed as the result
+		if($search_keywords[$cnt] != '') { 
+			$array_search_keywords = explode(",", $search_keywords[$cnt]);
+			$all[$cnt] = false;
+			for ($p=0 ; $p<count($array_search_keywords);$p++){
+				$hit = preg_match("/".$_REQUEST["search"]."/i",$array_search_keywords[$p]);
+				if ($hit >0){	
+					$all[$cnt] = true;
+				}
+			}
+		}  	
+		//echo "hit:".$hit."all: ".$all[$cnt] ;
+		$cnt++;
+	}
+	$field_has_parent = false; 
+	$has_result = false; 
+
+	for($i=0; $i<count($table); $i++){
+		$sql = "Select GeometryType(the_geom) as type FROM ".$table[$i]." LIMIT 1";
+		$res = pg_query($con,$sql);
+		$type = pg_result($res,0,"type");      
+		$sql = "Select * FROM ".$table[$i]." LIMIT 1";
+		$res = pg_query($con,$sql);
+
+		if(mb_strtoupper($type) =='MULTIPOLYGON'){
+			$sql1 = "SELECT '". $layername[$i]."' as fkey_md_fileidentifier,".$search_result[$i].", '".$wms_title[$i]."' as wms_title, X(Centroid(the_geom)) as x,Y(Centroid(the_geom)) as y  FROM ".$table[$i];
+		}
+		if(mb_strtoupper($type) =='MULTILINESTRING'){
+			$sql1 = "SELECT '". $layername[$i]."' as fkey_md_fileidentifier,".$search_result[$i].",'".$wms_title[$i]."' as wms_title, X(Centroid(the_geom)) as x,Y(Centroid(the_geom)) as y  FROM ".$table[$i];
+		}
+		if(mb_strtoupper($type)=='POINT'){
+			$sql1 = "SELECT '". $layername[$i]."' as fkey_md_fileidentifier,".$search_result[$i].",'".$wms_title[$i]."' as wms_title, X(the_geom) as x,Y(the_geom) as y FROM ".$table[$i];
+		}
+      
+		#---------------- search_columns search_result 
+		if ($all[$i] == false){
+			$array_search_columns = explode(",", $search_columns[$i]);
+
+			if (count($array_search_columns)>0){ 
+				$array_search_columns[count($array_search_columns)] =  $array_search_columns [0];
+				$array_search_columns [0] = "platzhalterxy";
+
+				for($j=0; $j<pg_num_fields($res); $j++){
+					if(array_search(pg_field_name($res,$j),$array_search_columns) == true  ){
+						if($field_has_parent == true){
+							$sql1 .= " OR ";
+						}
+						else {
+							$sql1 .= " WHERE ";
+						};
+						$field_has_parent = true;
+						$sql1 .= pg_field_name($res,$j) ." ILIKE ";
+						$sql1 .= "'%".$_REQUEST["search"]."%'";
+					}
+				}
+				$field_has_parent = false;
+			};
+		}
+		else {
+		}
+		$sql1 .= " ORDER BY ".$search_result[$i];
+		$res1 = pg_query($con,$sql1);
+		$cnt = 0;
+		if(pg_fetch_row($res1)>0){
+			$sel_lay = pg_result($res1,$cnt,"fkey_md_fileidentifier"); 
+      
+			if($minscale[$i] > 0){$scale = $minscale[$i]+100; }
+
+			for ($cnt=0; $cnt < pg_num_rows($res1); $cnt++){
+				if($cnt == 0){
+					$title = "layername_".$lingo;
+					echo "<div class='header'>".$result_title[$i]. "</div>";
+				}
+				if($_REQUEST["backlink"]=='parent'){
+					echo "<nobr><a href='javascript:hideHighlight();parent.parent.mb_repaintScale(\"mapframe1\"," .pg_result($res1,$cnt,"x"). ",".pg_result($res1,$cnt,"y"). ",$scale);'";
+				}
+				else{
+					echo "<nobr><a href='javascript:hideHighlight();parent.mb_repaintScale(\"mapframe1\"," .pg_result($res1,$cnt,"x"). ",".pg_result($res1,$cnt,"y"). ",$scale);'";
+				}
+
+				echo " onmouseover='showHighlight(" .pg_result($res1,$cnt,"x"). "," .pg_result($res1,$cnt,"y"). ")' ";
+				echo "onmouseout='hideHighlight();' ";
+				echo "onclick='handleLayer(\"" .pg_result($res1,$cnt,"fkey_md_fileidentifier"). "\",\"".pg_result($res1,$cnt,"wms_title")."\")'>";
+
+				echo pg_result($res1,$cnt,$search_result[$i])."</a></nobr><br>";
+				$has_result = true;
+			}
+		}
+	}
+	if($has_result == false){echo "Kein Ergebnis!";}
+	echo "<form action='" . $PHP_SELF . "?".SID."' method='post'>";
+	echo "</form>";
+}
+?>
+</body>
+</html>
\ No newline at end of file

Added: branches/mapbender_sld/http/javascripts/mod_renderGML.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_renderGML.php	                        (rev 0)
+++ branches/mapbender_sld/http/javascripts/mod_renderGML.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -0,0 +1,64 @@
+<?php
+# http://www.mapbender.org/index.php/Monitor_Capabilities
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../../conf/geoportal.conf");
+require_once(dirname(__FILE__)."/../classes/class_gml2.php");
+require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
+
+$gui_id = $_SESSION["mb_user_gui"];
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'renderGML' AND fkey_gui_id = $1 LIMIT 1";
+$v = array($gui_id);
+$t = array('s');
+$res = db_prep_query($sql, $v, $t);
+$row = db_fetch_array($res);
+$e_target = explode(",",$row[0]);
+
+$gml_string = $_SESSION["GML"];
+
+if ($gml_string) {
+	$gml = new gml2();
+	$gml->parse_xml($gml_string);
+	$bbox = $gml->bbox;
+	echo "mb_registerInitFunctions('highlight_init()');\n";
+	echo "function highlight_init() {\n";
+	echo "var mf = new Array(";
+	for ($i=0; $i<count($e_target); $i++) {
+		if ($i>0) echo ", ";
+		echo "'".$e_target[$i]."'";
+	}
+	echo ");\n";
+	echo "hl = new Highlight(mf, 'GML_rendering', {'position':'absolute', 'top':'0px', 'left':'0px', 'z-index':" . GML_HIGHLIGHT_Z_INDEX . "});\n";
+	echo $gml->exportMemberToJS(0, false);
+	echo "hl.add(q);\n";
+	echo "mb_registerSubFunctions('hl.paint()');\n";
+	echo "}\n";
+	$e = new mb_notice("renderGML: GML: " . $_SESSION["GML"] . "; EPSG: " . $_SESSION["epsg"] . "; BBOX: " . implode(", ", $bbox));
+	$_SESSION["GML"] = NULL;
+	$e = new mb_notice("renderGML: deleting GML...");
+	
+}
+else {
+	$e = new mb_notice("renderGML: no GML.");
+}
+
+
+
+?>
\ No newline at end of file

Modified: branches/mapbender_sld/http/javascripts/mod_sandclock.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_sandclock.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_sandclock.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -35,10 +35,18 @@
 	echo "alert('sandclock: ID not unique!');";
 }
 echo "var mod_sandclock_target = '".$e_target."';";
+include '../include/dyn_js.php';
 ?>
+try{
+	if (mod_sandclock_image){}
+}
+catch(e){
+	mod_sandclock_image = "../img/sandclock.gif";
+}
 
 var mod_sandclock_img = new Image();
-mod_sandclock_img.src = "../img/sandclock.gif";
+mod_sandclock_img.src = mod_sandclock_image;
+
 mb_registerSubFunctions("mod_sandclock(true,myMapId)");
 
 function mod_sandclock(start,myMapId){

Modified: branches/mapbender_sld/http/javascripts/mod_savewmc.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_savewmc.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_savewmc.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -17,7 +17,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-
 $gui_id = $_REQUEST["gui_id"];
 require_once("../../conf/mapbender.conf");
 $con = db_connect($DBSERVER,$OWNER,$PW);
@@ -42,389 +41,43 @@
 echo "mod_savewmc_target = '".$e_target."';";
 ?>
 function setOnUnload() {
-	document.getElementsByTagName('body')[0].setAttribute("onUnload", "mod_savewmc('session');");
+	if (ie) {
+		document.getElementsByTagName('body')[0].onunload = function() {var x = new Function ("", "mod_savewmc_session()"); x(); };
+	}
+	else {
+		document.getElementsByTagName('body')[0].setAttribute("onUnload", "mod_savewmc_session();");
+	}
 }
 
 try {if (saveInSession) {}}catch(e) {saveInSession = 0;}
 
-if (saveInSession == '1') {
+if (saveInSession == 1) {
 	mb_registerInitFunctions('setOnUnload()');
 }
 
 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(){
+	sendMapDataToServer("session", function(result, status) {});
+}
 
-//0 = Keine Anführungszeichen umwandeln
-//1 = Nur einfache Anführungszeichen umwandeln
-//2 = Nur doppelte Anführungszeichen umwandeln (Standardeinstellung)
-//3 = Beide Arten (einfache und doppelte Anführungszeichen) umwandeln
-function htmlspecialchars(str,typ) {
-	if(typeof str=="undefined") str="";
-	if(typeof typ!="number") typ=2;
-	typ=Math.max(0,Math.min(3,parseInt(typ)));
-	var html=new Array();
-	html[38]="&amp;"; html[60]="&#38;#60;"; html[62]="&#38;#62;";
-	if(typ==1 || typ==3) html[39]="&#38;#39;";
-	if(typ==2 || typ==3) html[34]="&#38;#34;";
-	for(var i in html) {
-		if (typeof(html[i]) != 'function') {
-			var functionString ="str=str.replace('"+String.fromCharCode(i)+"',\""+html[i]+"\");";
-			eval(functionString);
-		}
+function mod_savewmc(title){
+	var generalTitle = title ? title : prompt("Save WMC as...");
+	if (generalTitle != "" && generalTitle != null) {
+		sendMapDataToServer(generalTitle, function(result, status) {alert(status + ": " + result);});
 	}
-    return str;
 }
-function mod_savewmc(title){
+
+function sendMapDataToServer(generalTitle, callbackFunction) {
 	var user = "<?php echo $_SESSION["mb_user_id"]; ?>";
 	var ind = getMapObjIndexByName(mod_savewmc_target);
-	var session = 0;
-	if (title) {
-		var generalTitle = htmlspecialchars(title,0);
-		title_alert = 0;
-		if (title == 'session') {
-			session = 1;
-		}
-	}
-	else {
-		var generalTitle = htmlspecialchars(prompt("Save WMC as..."),0);
-		title_alert = 1;
-	}
-	if (generalTitle != null){
-		var wmc = "";
-
-		// ViewContext variables
-		var version = "1.0.0";
-		var id = "<?php echo $_SESSION["mb_user_id"] . "_";?>";
-		var jetzt = new Date();
-		id += jetzt.getTime();
-
-		// General variables
-		var generalWidth = mb_mapObj[ind].width;
-		var generalHeight = mb_mapObj[ind].height;
-		var generalBboxSrs = mb_mapObj[ind].epsg;
-		var arrayBBox = mb_mapObj[ind].extent.split(",");
-		var generalBboxMinx = parseFloat(arrayBBox[0]);
-		var generalBboxMiny = parseFloat(arrayBBox[1]);
-		var generalBboxMaxx = parseFloat(arrayBBox[2]);
-		var generalBboxMaxy = parseFloat(arrayBBox[3]);
-		var generalName = "Mapbender WMC"; // TO do : insert proper data
-		var generalKeywords = new Array('Mapbender', 'WMC'); // TO do : insert proper data
-		var generalAbstract = ""; // TO do : insert proper data
-		var generalLogoUrl = ""; // TO do : insert proper data
-		var generalLogoUrlWidth = ""; // TO do : insert proper data
-		var generalLogoUrlHeight = ""; // TO do : insert proper data
-		var generalLogoUrlFormat = ""; // TO do : insert proper data
-		var generalDescriptionUrl = ""; // TO do : insert proper data
-
-		var generalContactPerson = "";
-		var generalContactOrganization = "";
-		var generalContactPosition = "";
-		var generalContactAddressType = "";
-		var generalContactAddress = "";
-		var generalContactCity = "";
-		var generalContactStateOrProvince = "";
-		var generalContactPostCode = "";
-		var generalContactCountry = "";
-		var generalContactVoiceTelephone = "";
-		var generalContactFacsimileTelephone = "";
-		var generalContactElectronicMailAddress = "";
-
-		var extension_namespace = "mapbender";
-
-		// LayerList variables
-		var layerHidden = "";
-		var layerQueryable = "";
-		var layerAbstract = "";
-		var layerName = "";
-		var layerSrs = "";
-		var layerDataUrl = "";
-		var layerMetadataUrl = "";
-		var layerFormat = "";
-		var layerFormat_current = "";
-		var layerStyle_current = "";
-		var layerStyle_name = "";
-		var layerStyle_title = "";
-		var layerStyle_legendURL = "";
-		var layerStyle_legendURL_width = "";
-		var layerStyle_legendURL_height = "";
-		var layerStyle_legendURL_format = "";
-		// Missing: Extension
-
-		//ViewContext
-		wmc += "&lt;?xml version=\"1.0\" encoding=\"<?php echo CHARSET; ?>\"?&gt;";
-		// wmc += "&lt;!ENTITY amp    \"&amp;#38;#38;\"&gt;\n";
-		wmc += "&lt;ViewContext version=\"" + version + "\" ";
-		wmc += "id = \"" + id + "\" ";
-		wmc += "xmlns=\"http://www.opengis.net/context\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:mapbender=\"http://www.mapbender.org\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:SchemaLocation=\"http://schemas.opengis.net/context/1.0.0/context.xsd\" ";
-		wmc += "&gt;\n";
-
-		//General
-		wmc += "\t&lt;General&gt;\n";
-
-		if (generalWidth && generalHeight){
-			wmc += "\t\t&lt;Window width=\"" + generalWidth + "\" height=\"" + generalHeight + "\" /&gt;\n";
-		}
-
-		wmc += "\t\t&lt;BoundingBox SRS=\"" + generalBboxSrs + "\" minx =\"" + generalBboxMinx + "\" ";
-		wmc += "miny =\"" + generalBboxMiny + "\" maxx =\"" + generalBboxMaxx + "\" maxy =\"" + generalBboxMaxy + "\" /&gt;\n";
-		wmc += "\t\t&lt;Name&gt;" + generalName + "&lt;/Name&gt;\n";
-		wmc += "\t\t&lt;Title&gt;" + generalTitle + "&lt;/Title&gt;\n";
-
-		if (generalKeywords){
-			wmc += "\t\t&lt;KeywordList&gt;\n";
-			for (var i = 0; i < generalKeywords.length ; i++) {
-				wmc += "\t\t\t&lt;Keyword&gt;" + generalKeywords[i] + "&lt;/Keyword&gt;\n";
-			}
-			wmc += "\t\t&lt;/KeywordList&gt;\n";
-		}
-		if (generalAbstract){
-			wmc += "\t\t&lt;Abstract&gt;" + generalAbstract + "&lt;/Abstract&gt;\n";
-		}
-
-		if (generalLogoUrlWidth && generalLogoUrlHeight && generalLogoUrlFormat && generalLogoUrl){
-			wmc += "\t\t&lt;LogoURL width = \"" + generalLogoUrlWidth + "\" ";
-			wmc += "height = \"" + generalLogoUrlHeight + "\" ";
-			wmc += "format = \"" + generalLogoUrlFormat + "\"&gt;\n";
-			wmc += "\t\t\t&lt;OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type = \"simple\" xlink:href=\"" + generalLogoUrl + "\" /&gt;\n";
-			wmc += "\t\t&lt;/LogoUrl&gt;\n";
-		}
-
-		if (generalDescriptionUrl){
-			wmc += "\t\t&lt;DescriptionURL&gt;\n";
-			wmc += "\t\t\t&lt;OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type = \"simple\" xlink:href=\"" + generalDescriptionUrl + "\" /&gt;\n";
-			wmc += "\t\t&lt;/DescriptionUrl&gt;\n";
-		}
-
-		if (generalContactElectronicMailAddress || generalContactOrganization ||
-			generalContactPerson || generalContactPosition || generalContactAddressType ||
-			generalContactAddress || generalContactCity || generalContactStateOrProvince ||
-			generalContactPostCode || generalContactCountry || generalContactVoiceTelephone ||
-			generalContactFacsimileTelephone || generalContactElectronicMailAddress){
-			wmc += "\t\t&lt;ContactInformation&gt;\n";
-
-			if (generalContactPerson || generalContactOrganization){
-				wmc += "\t\t\t&lt;ContactPersonPrimary&gt;\n";
-				if (generalContactPerson){
-					wmc += "\t\t\t\t&lt;ContactPerson&gt;" + generalContactPerson + "&lt;/ContactPerson&gt;\n";
-				}
-				if (generalContactOrganization){
-					wmc += "\t\t\t\t&lt;ContactOrganization&gt;" + generalContactOrganization + "&lt;/ContactOrganization&gt;\n";
-				}
-				wmc += "\t\t\t&lt;/ContactPersonPrimary&gt;\n";
-			}
-
-			if (generalContactPosition){
-				wmc += "\t\t\t&lt;ContactPosition&gt;" + generalContactPosition + "&lt;/ContactPosition&gt;\n";
-			}
-
-			if (generalContactAddressType || generalContactAddress || generalContactCity || generalContactStateOrProvince ||
-				generalContactPostCode || generalContactCountry){
-				wmc += "\t\t\t&lt;ContactAddress&gt;\n";
-
-				if (generalContactAddressType){
-					wmc += "\t\t\t\t&lt;AddressType&gt;" + generalContactAddressType + "&lt;/AddressType&gt;\n";
-				}
-				if (generalContactAddress){
-					wmc += "\t\t\t\t&lt;Address&gt;" + generalContactAddress + "&lt;/Address&gt;\n";
-				}
-				if (generalContactCity){
-					wmc += "\t\t\t\t&lt;City&gt;" + generalContactCity + "&lt;/City&gt;\n";
-				}
-				if (generalContactStateOrProvince){
-					wmc += "\t\t\t\t&lt;StateOrProvince&gt;" + generalContactStateOrProvince + "&lt;/StateOrProvince&gt;\n";
-				}
-				if (generalContactPostCode){
-					wmc += "\t\t\t\t&lt;PostCode&gt;" + generalContactPostCode + "&lt;/PostCode&gt;\n";
-				}
-				if (generalContactCountry){
-					wmc += "\t\t\t\t&lt;Country&gt;" + generalContactCountry + "&lt;/Country&gt;\n";
-				}
-				wmc += "\t\t\t&lt;/ContactAddress&gt;\n";
-			}
-			wmc += "\t\t\t&lt;ContactVoiceTelephone&gt;" + generalContactVoiceTelephone + "&lt;/ContactVoiceTelephone&gt;\n";
-			wmc += "\t\t\t&lt;ContactFacsimileTelephone&gt;" + generalContactFacsimileTelephone + "&lt;/ContactFacsimileTelephone&gt;\n";
-			wmc += "\t\t\t&lt;ContactElectronicMailAddress&gt;" + generalContactElectronicMailAddress + "&lt;/ContactElectronicMailAddress&gt;\n";
-			wmc += "\t\t&lt;/ContactInformation&gt;\n";
-		}
-
-		wmc += "\t&lt;/General&gt;\n";
-
-		//layerList
-		wmc += "\t&lt;LayerList&gt;\n";
-		for (var i = 0; i < mb_mapObj[ind].wms.length; i++){
-
-			wmsId = mb_mapObj[ind].wms[i].wms_id;
-
-			var wms_epsg = new Array();
-			wms_epsg[0] = mb_mapObj[ind].epsg;
-			if (mb_mapObj[ind].wms[i].gui_wms_epsg != mb_mapObj[ind].epsg){
-				wms_epsg[1] = mb_mapObj[ind].wms[i].gui_wms_epsg;
-			}
-			for (q = 0; q < mb_mapObj[ind].wms[i].gui_epsg.length ; q ++){
-				var isInArray = false;
-				for (r = 0 ; r < wms_epsg.length ; r ++){
-					if (wms_epsg[r] == mb_mapObj[ind].wms[i].gui_epsg[q]){
-						isInArray = true;
-					}
-				}
-				if (isInArray == false){
-					wms_epsg[wms_epsg.length] = mb_mapObj[ind].wms[i].gui_epsg[q];
-				}
-			}
-
-			for (var j = 0; j < mb_mapObj[ind].wms[i].objLayer.length; j++){
-				if (mb_mapObj[ind].wms[i].objLayer[j].layer_parent != ''){
-					if (mb_mapObj[ind].wms[i].objLayer[j].gui_layer_visible == '1'){
-						layerHidden = 0;
-					}
-					else{
-						layerHidden = 1;
-					}
-					layerQueryable = mb_mapObj[ind].wms[i].objLayer[j].layer_queryable;
-					layerQuerylayer = mb_mapObj[ind].wms[i].objLayer[j].gui_layer_querylayer;
-					layerId = mb_mapObj[ind].wms[i].objLayer[j].layer_uid;
-					layerName = htmlspecialchars(mb_mapObj[ind].wms[i].objLayer[j].layer_name,0);
-					layerTitle = htmlspecialchars(mb_mapObj[ind].wms[i].objLayer[j].layer_title, 0);
-					layerAbstract = mb_mapObj[ind].wms[i].wms_abstract; //To Do: insert actual abstract
-					layerDataUrl = mb_mapObj[ind].wms[i].objLayer[j].layer_dataurl_href; 
-					layerMetadataUrl = mb_mapObj[ind].wms[i].objLayer[j].layer_metadataurl;
-					layerMinscale = mb_mapObj[ind].wms[i].objLayer[j].layer_minscale; 
-					layerMaxscale = mb_mapObj[ind].wms[i].objLayer[j].layer_maxscale; 
-					wmsVersion = mb_mapObj[ind].wms[i].wms_version;
-					wmsTitle = htmlspecialchars(mb_mapObj[ind].wms[i].wms_title,0)	;
-					wmsOnlineResource = mb_mapObj[ind].wms[i].wms_getmap;
-
-					wmc += "\t\t&lt;Layer queryable = \"" + layerQueryable + "\" hidden = \"" + layerHidden + "\"&gt;\n";
-					wmc += "\t\t\t&lt;Server service = \"OGC:WMS\" version = \"" + wmsVersion + "\" title = \"" + wmsTitle + "\"&gt;\n";
-					wmc += "\t\t\t\t&lt;OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type=\"simple\" xlink:href=\"" + wmsOnlineResource + "\" /&gt;\n";
-					wmc += "\t\t\t&lt;/Server&gt;\n";
-
-					wmc += "\t\t\t&lt;Name&gt;" + layerName + "&lt;/Name&gt;\n";
-					wmc += "\t\t\t&lt;Title&gt;" + layerTitle + "&lt;/Title&gt;\n";
-
-					if (layerAbstract){
-						wmc += "\t\t\t&lt;Abstract&gt;" + layerAbstract + "&lt;/Abstract&gt;\n";
-					}
-
-					wmc += "\t\t\t&lt;SRS&gt;";
-					for (var k = 0; k < wms_epsg.length ; k ++){
-						wmc +=  wms_epsg[k];
-						if (k < wms_epsg.length-1){
-							wmc += " ";
-						}
-					}
-					wmc += "&lt;/SRS&gt;\n";
-	  
-					if (layerDataUrl){
-						wmc += "\t\t\t&lt;DataURL&gt;\n";
-						wmc += "\t\t\t\t&lt;OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type = \"simple\" xlink:href=\"" + layerDataUrl + "\" /&gt;\n";
-						wmc += "\t\t\t&lt;/DataURL&gt;\n";
-					}
-
-					if (layerMetadataUrl){
-						wmc += "\t\t\t&lt;MetadataURL&gt;\n";
-						wmc += "\t\t\t\t&lt;OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type = \"simple\" xlink:href=\"" + layerMetadataUrl + "\" /&gt;\n";
-						wmc += "\t\t\t&lt;/MetadataURL&gt;\n";
-					}
-
-					wmc += "\t\t\t&lt;Extension&gt;\n";
-					if (layerMinscale && layerMaxscale) {
-						wmc += "\t\t\t\t&lt;"+extension_namespace+":ScaleHint min=\""+layerMinscale+"\" max=\""+layerMaxscale+"\"/&gt;\n";
-					}
-					wmc += "\t\t\t\t&lt;"+extension_namespace+":layer_id&gt;"+layerId+"&lt;/"+extension_namespace+":layer_id&gt;\n";
-					wmc += "\t\t\t\t&lt;"+extension_namespace+":wms_id&gt;"+wmsId+"&lt;/"+extension_namespace+":wms_id&gt;\n";
-					wmc += "\t\t\t\t&lt;"+extension_namespace+":querylayer&gt;"+layerQuerylayer+"&lt;/"+extension_namespace+":querylayer&gt;\n";
-					wmc += "\t\t\t&lt;/Extension&gt;\n";
-
-					//layerFormat
-					wmc += "\t\t\t&lt;FormatList&gt;\n";
-
-					var data_format_current = false;
-					for (var k = 0; k < wms[i].data_format.length; k++){
-
-						if (wms[i].data_type[k] == 'map') {
-							layerFormat = mb_mapObj[ind].wms[i].data_format[k];
-							wmc += "\t\t\t\t&lt;Format";
-							if (data_format_current == false && ( 
-									(mb_mapObj[ind].wms[i].data_format[k] == mb_mapObj[ind].wms[i].gui_wms_mapformat) ||
-									(k == wms[i].data_format.length-1)
-							)){
-								wmc += " current = \"1\"";
-								data_format_current = true;
-							}
-							wmc += "&gt;" + layerFormat + "&lt;/Format&gt;\n";
-						}
-					}
-					wmc += "\t\t\t&lt;/FormatList&gt;\n";
-
-					// LayerStyle
-					wmc += "\t\t\t&lt;StyleList&gt;\n";
 	
-					for (var k = 0; k < 1; k++){
-
-						if (k == 0){
-							layerStyle_current = 1; // To do: insert proper data
-						}
-						else{
-							layerStyle_current = 0; // To do: insert proper data
-						}
-						wmc += "\t\t\t\t&lt;Style";
-
-						layerStyleSLD = "";
-
-						if (layerStyleSLD){
-							layerStyleSLDUrl = ""; // To Do: Insert Proper Data
-							wmc += "\t\t\t\t\t\t&lt;OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type=\"simple\" xlink:href=\"" + layerStyleSLDUrl + "\" /&gt;\n";
-						}
-						else{
-							if (mb_mapObj[ind].wms[i].objLayer[j].layer_style[k]){
-								layerStyle_name = mb_mapObj[ind].wms[i].objLayer[j].layer_style[k]['name'];
-								layerStyle_title = mb_mapObj[ind].wms[i].objLayer[j].layer_style[k]['title'];
-								layerStyle_legendUrl = mb_mapObj[ind].wms[i].objLayer[j].layer_style[k]["legendurl"];
-							}
-							else{
-								layerStyle_name = "default";
-								layerStyle_title = "default";
-								layerStyle_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){
-								wmc += " current = \"1\"";
-							}
-							wmc += "&gt;\n\t\t\t\t\t&lt;Name&gt;" + layerStyle_name + "&lt;/Name&gt;\n";
-							wmc += "\t\t\t\t\t&lt;Title&gt;" + layerStyle_title + "&lt;/Title&gt;\n";
-							wmc += "\t\t\t\t\t&lt;LegendUrl ";
-							wmc += "width = \"" + layerStyle_legendUrl_width + "\" ";
-							wmc += "height = \"" + layerStyle_legendUrl_height + "\" ";
-							wmc += "format = \"" + layerStyle_legendUrl_format + "\"&gt;\n";
-							wmc += "\t\t\t\t\t\t&lt;OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type=\"simple\" xlink:href=\"" + layerStyle_legendUrl + "\" /&gt;\n";
-							wmc += "\t\t\t\t\t&lt;/LegendUrl&gt;\n";
-						}
-
-						wmc += "\t\t\t\t&lt;/Style&gt;\n";
-						// Missing: Describe Style via SLD (see: http://center.ccgis/phprojekt/addons/ewiki/index.php?id=links/SLD)
-					}
-					wmc += "\t\t\t&lt;/StyleList&gt;\n";
-					wmc += "\t\t&lt;/Layer&gt;\n";
-				}
-			}
-		}
-		wmc += "\t&lt;/LayerList&gt;\n";
-		wmc += "&lt;/ViewContext&gt;\n";
-
-		if (session == 1) {
-			var wmc_win = window.open('about:blank', 'wmc_confirm', 'width=200,height=10,left='+Math.round(0.5*screen.width)+',top='+Math.round(0.5*screen.height));
-			document.sendData.target = 'wmc_confirm';
-//			document.sendData.target = '_blank';
-
-		}
-		document.sendData.action = "../javascripts/mod_insertWmcIntoDb.php";
-		document.sendData.data.value = user + "____" + generalTitle + "____" + wmc + "____" + id + "____" + title_alert + "____" + session;
-		document.sendData.submit();
+	var	extensionDataString = "";
+	if (currentWmcExtensionData != null) {
+		extensionDataString = currentWmcExtensionData.toJSONString();
 	}
-	return id;
+
+	window.frames['ajax'].$.ajaxSetup({async:false}); //TODO: find out why async doesn't work onunload
+	window.frames['ajax'].$.post("../php/mod_insertWmcIntoDb.php", {"saveInSession":saveInSession, "generalTitle":generalTitle, "extensionData":extensionDataString, "mapObject":mb_mapObj[ind].toJSONString()}, callbackFunction);
 }
\ No newline at end of file

Modified: branches/mapbender_sld/http/javascripts/mod_scaleHint.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_scaleHint.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_scaleHint.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -34,7 +34,7 @@
 if($cnt > 1){
 	echo "alert('mod_scaleHint: ID not unique!');";
 }
-$params = split(",",$e_target);
+$params = mb_split(",",$e_target);
 
 echo "var mod_scaleHint_target = '".$params[0]."';";
 echo "var mod_scaleHint_min = '".$params[1]."';";

Modified: branches/mapbender_sld/http/javascripts/mod_selArea.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_selArea.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_selArea.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -21,7 +21,7 @@
 require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
 $con = db_connect($DBSERVER,$OWNER,$PW);
 db_select_db(DB,$con);
-$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'selArea1' AND fkey_gui_id = '".$gui_id."'";
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'selArea1' AND fkey_gui_id = $1";
 $v = array($gui_id);
 $t = array('s');
 $res = db_prep_query($sql, $v, $t);

Added: branches/mapbender_sld/http/javascripts/mod_tab.js
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_tab.js	                        (rev 0)
+++ branches/mapbender_sld/http/javascripts/mod_tab.js	2007-11-23 13:43:16 UTC (rev 1834)
@@ -0,0 +1,413 @@
+// 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 e = new Mb_warning("mod_tab.js: tab_init: open_tab is not set.");
+	open_tab = "";
+}
+
+var tabs;
+
+mb_registerInitFunctions('tab_init()');
+
+function tab_open(elementName) {
+	tabs.activateTab(elementName);
+}
+
+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.activateTab(tabs.get(open_tab).module);
+	}
+}
+
+/**
+ * @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() {
+		      var x = new Function ("", "tabs.activateTab('"+that.module+"');"); 
+		      x(); 
+		   };
+		}
+		else {
+			node.setAttribute("onclick", "tabs.activateTab('"+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);
+				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.activateTab = 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
+				openTab(id);
+			}
+		}
+		else {
+			var e = new Mb_warning("mod_tab.js: could not activate tab, opening or closing in progress!");
+		}
+	};
+
+	/**
+	 * 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);
+				
+				// 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.
+	 *
+	 * @private
+	 * @param {String} id the ID of the GUI element within the tab.
+	 */
+	var openTab = function(id) {
+		if (id !== null) {
+			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).style;
+			obj.visibility = 'hidden';
+		}
+	};
+	
+	/**
+	 * 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).style;
+			var newpos = ((index+1) * tabHeight) + parseInt(tabTopOffset);
+			obj.top = (newpos + 1) + "px";
+			obj.left = (tabLeftOffset) + "px";
+			obj.width = tabWidth;
+			obj.height = (parseInt(that.get(index).height) - 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);
+	var tabLeftOffset = parseInt(rootNode.style.left);
+	var tabWidth = parseInt(rootNode.style.width);
+	var tabHeight = parseInt(rootNode.style.height);
+	var tabStyle = cssString;
+
+	
+	var styleObj = new StyleTag();
+	styleObj.addClass("verticalTabs", tabStyle);
+};
+
+VerticalTabArray.prototype = new List();
\ No newline at end of file

Modified: branches/mapbender_sld/http/javascripts/mod_tab.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_tab.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_tab.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -20,141 +20,31 @@
 /********** Configuration*************************************************/
 
 $gui_id = $_REQUEST["gui_id"];
-$e_id_css = 'tabs';
-include(dirname(__FILE__).'/../include/dyn_js.php');
+$e_id_css = "tabs";
+$e_id = "tabs";
+include(dirname(__FILE__)."/../extensions/JSON.php");
+require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
+include(dirname(__FILE__)."/../include/dyn_js.php");
 
-?>
-var tab_height = false;
-var tab_width = false;
-var tab_topOffset = false;
-var tab_leftOffset = false;
-var tab_active = -1;
-var tab_check = new Array();
-var tab_iv1 = false;
-var tab_wait = false;
+$tab_ids = array();
+include(dirname(__FILE__)."/../include/dyn_php.php");
 
-try{
-	if (open_tab){}
+
+echo "var tab_titles = [];\n";
+for ($i=0; $i < count($tab_ids); $i++) {
+	$sql = "SELECT gettext($1, e_title) AS e_title FROM gui_element WHERE fkey_gui_id = $2 AND e_id = $3";
+	$v = array($_SESSION["mb_lang"], $gui_id, $tab_ids[$i]);
+	$t = array("s", "s", "s");
+	$res = db_prep_query($sql, $v, $t);
+	$row = db_fetch_array($res);
+	echo "tab_titles[" . $i . "] = '" . $row["e_title"] . "';\n";	
 }
-catch(e){
-	open_tab = false;
-}
 
-/********** Configuration*************************************************/
-mb_registerInitFunctions('tab_init()');
-function tab_init(){
-	var obj = document.getElementById("tabs").style;
-	tab_topOffset = parseInt(obj.top);
-	tab_leftOffset = parseInt(obj.left);
-	tab_width = parseInt(obj.width);
-	tab_height = parseInt(obj.height);
-	var str = "";
+$json = new Services_JSON();
+$output = $json->encode($tab_ids);
 
-	for(var i = 0; i<tab_ids.length; i++){
-		document.getElementById(tab_ids[i]).style.visibility = 'hidden';
-		tab_titles[i] = tab_prefix + tab_titles[i];
-		var newId = "tab_" + i;
-		str += "<div id='"+newId+"' ";
-		str += "style='";
-		str += tab_style;
-		str += "width:"+tab_width+"px;";
-		str += "height:"+tab_height+"px;";        
-		str += "top:" + ((i * tab_height)) + "px;";
-		str += "'";
-		str += " onclick='tab_set("+i+")'>";
-		str += tab_titles[i];
-		str += "</div>";
-	}
-	document.getElementById("tabs").innerHTML = str;
+echo "var tab_ids = " . $output . ";";	
 
-	if (open_tab != 'false'){
-		tab_set(open_tab);
-	}
-}
-function tab_set(ind){
-	if(tab_wait){
-		return;
-	}
-	tab_unsetFrame();
-	if(ind == tab_active){
-		tab_wait = true;
-		tab_active = -1;
-		tab_check = new Array();
-		tab_iv1 = setInterval("tab_move("+tab_active+")",1);
-		return;
-	}	
-	else{
-		tab_wait = true;
-		tab_active = ind;
-		tab_check = new Array();
-		tab_iv1 = setInterval("tab_move("+tab_active+")",1);
-		return;
-	}
-}
-function tab_setFrame(ind){
-	for(var i = 0; i<tab_ids.length; i++){		
-		if(i == ind){
-			var obj = document.getElementById(tab_ids[i]).style;
-			var newpos = ((i+1) * tab_height) + parseInt(tab_topOffset);
-			obj.top = (newpos + 1) + "px";
-			obj.left = (tab_leftOffset) + "px";
-			obj.width = tab_width;
-			obj.height = (parseInt(tab_frameHeight[ind]) - 2);
-			obj.visibility = 'visible';
-		}
-	}
-}
-function tab_unsetFrame(){
-	for(var i = 0; i<tab_ids.length; i++){
-		var obj = document.getElementById(tab_ids[i]).style;
-		obj.visibility = 'hidden';
-	}
-}
-function tab_open(tabid){
-	var t = false;
-	for(var i = 0; i<tab_ids.length; i++){
-		if(tab_ids[i] == tabid){
-			t = i;
-		}
-	}
-	if(tab_active != t){
-		tab_set(t);
-	}
-}
-function tab_move(ind){			
-	for(var i = 0; i<tab_ids.length; i++){
-		var newpos = (i * tab_height);
-		if(i > ind && tab_active >= 0){
-			newpos += parseInt(tab_frameHeight[ind]);
-		}
-		var myid = "tab_" + i;		
-		var pos = parseInt(document.getElementById(myid).style.top);
-		if(pos == newpos){
-			tab_check[i] = true;
-		}
-		else if(pos < newpos){			
-			document.getElementById(myid).style.top = (pos + 10) + "px"; 
-			tab_check[i] = false;
-		}
-		else if(pos > newpos){
-			document.getElementById(myid).style.top = (pos - 10) + "px";
-			tab_check[i] = false;
-		}		
-	}
-	
-	var check = true;
-	for(var j=0; j<tab_check.length; j++){
-		if(tab_check[j] == false){
-			check = false;
-		}
-	}
-	if(check == true){
-		clearInterval(tab_iv1);
-		tab_check = new Array();
-		tab_wait = false;
-		if(ind >= 0){
-			tab_setFrame(ind);
-		}
-		return;
-	}
-}
\ No newline at end of file
+include(dirname(__FILE__)."/../javascripts/style.js");
+include("mod_tab.js");
+?>
\ No newline at end of file

Added: branches/mapbender_sld/http/javascripts/mod_tab_translation.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_tab_translation.php	                        (rev 0)
+++ branches/mapbender_sld/http/javascripts/mod_tab_translation.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -0,0 +1,184 @@
+<?php
+# $Id: mod_tab.php 855 2006-11-20 14:06:28Z christoph $
+# http://www.mapbender.org/index.php/mod_tab.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.
+
+/********** Configuration*************************************************/
+
+$gui_id = $_REQUEST["gui_id"];
+$e_id_css = 'tabs';
+$e_id = 'tabs';
+include(dirname(__FILE__).'/../extensions/JSON.php');
+include(dirname(__FILE__).'/../classes/class_mb_exception.php');
+$e = new mb_exception("tab_ids");
+include(dirname(__FILE__).'/../include/dyn_js.php');
+
+$tab_ids = array();
+include(dirname(__FILE__).'/../include/dyn_php.php');
+
+
+echo "var tab_titles = [];\n";
+for ($i=0; $i < count($tab_ids); $i++) {
+	$sql = "SELECT gettext(e_title) AS e_title FROM gui_element WHERE fkey_gui_id = $1 AND e_id = $2";
+	$v = array($gui_id, $tab_ids[$i]);
+	$t = array("s", "s");
+	$res = db_prep_query($sql, $v, $t);
+	$row = db_fetch_array($res);
+	echo "tab_titles[" . $i . "] = '" . $row["e_title"] . "';\n";	
+}
+
+$json = new Services_JSON();
+$output = $json->encode($tab_ids);
+
+$e = new mb_exception("tab_ids" . $output);
+echo "var tab_ids = " . $output . ";";	
+
+?>
+var tab_height = false;
+var tab_width = false;
+var tab_topOffset = false;
+var tab_leftOffset = false;
+var tab_active = -1;
+var tab_check = new Array();
+var tab_iv1 = false;
+var tab_wait = false;
+
+try{
+	if (open_tab){}
+}
+catch(e){
+	open_tab = false;
+}
+
+/********** Configuration*************************************************/
+mb_registerInitFunctions('tab_init()');
+function tab_init(){
+	var obj = document.getElementById("tabs").style;
+	tab_topOffset = parseInt(obj.top);
+	tab_leftOffset = parseInt(obj.left);
+	tab_width = parseInt(obj.width);
+	tab_height = parseInt(obj.height);
+	var str = "";
+
+	for(var i = 0; i<tab_ids.length; i++){
+		document.getElementById(tab_ids[i]).style.visibility = 'hidden';
+		tab_titles[i] = tab_prefix + tab_titles[i];
+		var newId = "tab_" + i;
+		str += "<div id='"+newId+"' ";
+		str += "style='";
+		str += tab_style;
+		str += "width:"+tab_width+"px;";
+		str += "height:"+tab_height+"px;";        
+		str += "top:" + ((i * tab_height)) + "px;";
+		str += "'";
+		str += " onclick='tab_set("+i+")'>";
+		str += tab_titles[i];
+		str += "</div>";
+	}
+	document.getElementById("tabs").innerHTML = str;
+
+	if (open_tab != 'false'){
+		tab_set(open_tab);
+	}
+}
+function tab_set(ind){
+	if(tab_wait){
+		return;
+	}
+	tab_unsetFrame();
+	if(ind == tab_active){
+		tab_wait = true;
+		tab_active = -1;
+		tab_check = new Array();
+		tab_iv1 = setInterval("tab_move("+tab_active+")",1);
+		return;
+	}	
+	else{
+		tab_wait = true;
+		tab_active = ind;
+		tab_check = new Array();
+		tab_iv1 = setInterval("tab_move("+tab_active+")",1);
+		return;
+	}
+}
+function tab_setFrame(ind){
+	for(var i = 0; i<tab_ids.length; i++){		
+		if(i == ind){
+			var obj = document.getElementById(tab_ids[i]).style;
+			var newpos = ((i+1) * tab_height) + parseInt(tab_topOffset);
+			obj.top = (newpos + 1) + "px";
+			obj.left = (tab_leftOffset) + "px";
+			obj.width = tab_width;
+			obj.height = (parseInt(tab_frameHeight[ind]) - 2);
+			obj.visibility = 'visible';
+		}
+	}
+}
+function tab_unsetFrame(){
+	for(var i = 0; i<tab_ids.length; i++){
+		var obj = document.getElementById(tab_ids[i]).style;
+		obj.visibility = 'hidden';
+	}
+}
+function tab_open(tabid){
+	var t = false;
+	for(var i = 0; i<tab_ids.length; i++){
+		if(tab_ids[i] == tabid){
+			t = i;
+		}
+	}
+	if(tab_active != t){
+		tab_set(t);
+	}
+}
+function tab_move(ind){			
+	for(var i = 0; i<tab_ids.length; i++){
+		var newpos = (i * tab_height);
+		if(i > ind && tab_active >= 0){
+			newpos += parseInt(tab_frameHeight[ind]);
+		}
+		var myid = "tab_" + i;		
+		var pos = parseInt(document.getElementById(myid).style.top);
+		if(pos == newpos){
+			tab_check[i] = true;
+		}
+		else if(pos < newpos){			
+			document.getElementById(myid).style.top = (pos + 10) + "px"; 
+			tab_check[i] = false;
+		}
+		else if(pos > newpos){
+			document.getElementById(myid).style.top = (pos - 10) + "px";
+			tab_check[i] = false;
+		}		
+	}
+	
+	var check = true;
+	for(var j=0; j<tab_check.length; j++){
+		if(tab_check[j] == false){
+			check = false;
+		}
+	}
+	if(check == true){
+		clearInterval(tab_iv1);
+		tab_check = new Array();
+		tab_wait = false;
+		if(ind >= 0){
+			tab_setFrame(ind);
+		}
+		return;
+	}
+}
\ No newline at end of file

Modified: branches/mapbender_sld/http/javascripts/mod_usemap.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_usemap.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_usemap.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -1,6 +1,6 @@
 <?php
 # $Id$
-# http://www.mapbender.org/index.php/mod_usemap
+# http://www.mapbender.org/index.php/UseMap
 # Copyright (C) 2002 CCGIS 
 #
 # This program is free software; you can redistribute it and/or modify

Modified: branches/mapbender_sld/http/javascripts/mod_wfs_SpatialRequest.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_wfs_SpatialRequest.php	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/mod_wfs_SpatialRequest.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -21,7 +21,6 @@
 import_request_variables("PG");
 require_once("../php/mb_validateSession.php");
 require_once("../../conf/mapbender.conf");
-require_once("../../conf/wfs_default.conf");
 $con = db_connect(DBSERVER,OWNER,PW);
 db_select_db(DB,$con);
 
@@ -72,14 +71,75 @@
 var mod_wfs_spatialRequest_geometry = null;
 var mod_wfs_spatialRequestSubFunctions = [];
 
+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);
+}
+
+var msgObj;
+
+mb_registerInitFunctions("init_wfsSpatialRequest()");
+mb_registerL10nFunctions("init_wfsSpatialRequest()");
+
+function init_wfsSpatialRequest() {
+	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, msgObj.buttonLabelRectangle, buttonRectangle.x, buttonRectangle.y);
+		addButtonWfs("polygon", buttonPolygon.status, buttonPolygon.img, msgObj.buttonLabelPolygon, buttonPolygon.x, buttonPolygon.y);
+		addButtonWfs("point", buttonPoint.status, buttonPoint.img, msgObj.buttonLabelPoint, buttonPoint.x, buttonPoint.y);
+		addButtonWfs("extent", buttonExtent.status, buttonExtent.img, msgObj.buttonLabelExtent, buttonExtent.x, buttonExtent.y);
+		addButtonWfs("dialogue", buttonDialogue.status, buttonDialogue.img, msgObj.buttonLabelDialogue, buttonDialogue.x, buttonDialogue.y);
+		displayButtons();
+	});
+}
 // ------------------------------------------------------------------------------------------
 // ------------ button handling -------------------------------------------------------------
 
+function wfsInitFunction (j) {
+	var functionCall = "mb_regButton_frame('initWfsButton', null, "+j+")";
+	var x = new Function ("", functionCall); 
+	x();
+} 
+
 function displayButtons() {
 	for (var i = 0 ; i < buttonWfs_id.length ; i ++) {
 		if (parseInt(buttonWfs_on[i])==1) {
-			document.write("<div id='div_"+buttonWfs_id[i]+"' style='position:absolute; top:"+buttonWfs_y[i]+"; left:"+buttonWfs_x[i]+"; z-index:"+buttonWfs_zIndex+"'><img name=\""+buttonWfs_id[i]+"\" onmouseover=\"mb_regButton_frame('initWfsButton', null, "+i+");\" id=\""+buttonWfs_id[i]+"\" title=\""+buttonWfs_title_off[i]+"\" src=\""+buttonWfs_imgdir+buttonWfs_src[i]+"\"></div>");
+			var currentDiv = document.createElement("div");
+			currentDiv.id = buttonWfs_id[i]+"Div";
+			currentDiv.style.position = "absolute";
+			currentDiv.style.left = buttonWfs_x[i]
+			currentDiv.style.top = buttonWfs_y[i];
+			currentDiv.style.zIndex = buttonWfs_zIndex;
+			
+			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.onmouseover = new Function("wfsInitFunction("+i+")");
+			
+			currentDiv.appendChild(currentImg);
+			document.getElementsByTagName('body')[0].appendChild(currentDiv);
 		}
 	}
 }
@@ -231,7 +291,7 @@
 function mod_wfs_spatialRequest_start(e){
 	var realWorldPos;
 	if (s.isSnapped() == true) {
-		realWorldPos = s.getSnappedPoint(mod_wfs_spatialRequest_geometry); 
+		realWorldPos = s.getSnappedPoint(); 
 		s.clean();
 	}
 	else {
@@ -408,7 +468,7 @@
 			}
 			filter += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>';
 			filter += '</gml:Polygon></Within></ogc:Filter>';
-			mb_get_geom(url, filter, i, w_[i]);
+			mb_get_geom(url, filter, i, wfs_config[w_[i]]['featuretype_name'], w_[i], w[i]);
 		}
 	}
 	else if(queryGeom.geomType==geomType.line){
@@ -430,7 +490,7 @@
 			filter += rectangle[0].x+","+rectangle[0].y+ " " + rectangle[1].x+","+rectangle[1].y; 
 			filter += "</gml:coordinates></gml:Box></ogc:BBOX></ogc:Filter>";
 			url += param;
-			mb_get_geom(url, filter, i, w_[i]);
+			mb_get_geom(url, filter, i, wfs_config[w_[i]]['featuretype_name'], w_[i], w[i]);
 		}
 	}
 	else if(queryGeom.geomType == geomType.point){
@@ -451,16 +511,16 @@
 			filter += (tmp.x + buffer) + "," + (tmp.y + buffer) + " " + (tmp.x - buffer) + "," + (tmp.y + buffer) + " " + (tmp.x - buffer) + "," + (tmp.y - buffer); 
 			filter += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></ogc:Filter>";
 			url += param;
-			mb_get_geom(url, filter, i, w_[i]);
+			mb_get_geom(url, filter, i, wfs_config[w_[i]]['featuretype_name'], w_[i], w[i]);
 		}
 	}
 //	highlight = new Highlight(mb_wfs_targets, highlight_tag_id, {"position":"absolute", "top":"0px", "left":"0px", "z-index":generalHighlightZIndex}, generalHighlightLineWidth);
 	return true;
 }
 
-function mb_get_geom(url, filter, index, wfs_conf_id) {
+function mb_get_geom(url, filter, index, typename, js_wfs_conf_id, db_wfs_conf_id) {
 	
-	mb_ajax_post("../" + wfsResultModulePath + wfsResultModuleFilename,{'url':url,'filter':filter,'typename':wfs_config[wfs_conf_id]['featuretype_name'],'wfs_conf_id':wfs_conf_id},function(js_code,status){
+	mb_ajax_post("../" + wfsResultModulePath + wfsResultModuleFilename,{'url':url,'filter':filter,'typename':typename,'js_wfs_conf_id':js_wfs_conf_id, 'db_wfs_conf_id':db_wfs_conf_id},function(js_code,status){
 //		alert(js_code);
 		eval(js_code);
 		if (typeof(geom) == 'object') mb_execWfsReadSubFunctions(geom);
@@ -468,11 +528,8 @@
 	});
 }
 
-//deprecated stuff
-function mod_wfs_spatialRequest_dialog(){	
-}
 function useExtentIsSet () {
 	return mod_wfs_spatialRequest_useExtent;
 }
 
-displayButtons();
+

Added: branches/mapbender_sld/http/javascripts/mod_wfs_client.html
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_wfs_client.html	                        (rev 0)
+++ branches/mapbender_sld/http/javascripts/mod_wfs_client.html	2007-11-23 13:43:16 UTC (rev 1834)
@@ -0,0 +1,416 @@
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;CHARSET=iso-8859-1">
+
+<link rel="stylesheet" type="text/css" media="screen,projection" href="../css/admin.screen.css" title="screen" />
+
+<script src='../extensions/json.js'></script>
+<script type='text/javascript'>
+
+
+/* 
+ * services['action']: instructs the servercomponent
+ * services['services']: infos about the services (wfs)
+ * services['services']['id']: a list of ids
+ * services['service']['title']: a corresponding list of titles
+ *
+ */
+var services = {};
+/*
+ * wfsConf['action']: instructs the servercomponent
+ * wfsConf['wfs']: the ID of the selected wfs 
+ * wfsConf['wfsConf']: infos about the wfs configurations
+ * wfsConf['wfsConf']['id']: a list of ids
+ * wfsConf['wfsConf']['abstract']: a corresponding list of descriptions
+ */
+var wfsConf = {};
+
+/*
+ * guis['action']: instructs the servercomponent
+ * guis['id']: a list of gui-IDs where the current user is owner
+ * guis['selectedGui']: the selected Gui
+ */
+var guis = {};
+
+/*
+ * handleAssignment['action']: instructs the servercomponent
+ * handleAssignment['selectedConf']: a list of wfs-conf Ids 
+ * handleAssignment['selectedGui']: the selected Gui
+ */
+var handleAssignment = {}
+
+/*
+ * vupdateWfs['action']: instructs the servercomponent
+ * vupdateWfs['wfs']: id of wfs to update
+ * vupdateWfs['url']: capabilities url
+ */
+var vupdateWfs = {};
+
+/*
+ * geturl['action']: instructs the servercomponent
+ * geturl['wfs']: id of wfs to get the url for
+ * geturl['column']: column of the url to get in table wfs
+ */
+var geturl = {}
+
+var owsproxy = {}
+
+
+
+
+function getWfsList(){
+	services['action'] = 'getServices';
+	getData(services);
+}
+function getGuis(){
+	guis['action'] = 'getGuis';
+	getData(guis);
+}
+function getWfsConfData(){
+	wfsConf['action'] = 'getWfsConfData';
+	wfsConf['wfs'] = getSelectedWfs();
+	getData(wfsConf);
+}
+function getSelectedWfs(){
+	var w = document.wfsForm.wfsList;
+	var ind  = w.selectedIndex;
+	if(ind == -1){
+		return false;	
+	}
+	if(ind == w.options.length-1)
+		return "gui_confs";
+	return w.options[ind].value;	
+}
+function getGuiConfs(){
+	guis['action'] = 'getAssignedConfs';
+	var g = document.wfsForm.guiList;
+	var ind  = g.selectedIndex;
+	if(ind == -1){
+		return false;	
+	}
+	guis['selectedGui'] = g.options[ind].value;
+	guis['selectedWfs'] = wfsConf['wfs'];  
+	getData(guis);
+}
+/**
+ * Sends an request to get the url to the capabilities doc of selected wfs
+ *
+ */
+ 
+function getUpdateUrl(column){
+	geturl['action'] = 'getUpdateUrl';
+	var w = document.wfsForm.wfsList;
+	var ind  = w.selectedIndex;
+	if(ind == -1){
+		alert("please select an WFS");
+		return;	
+	}
+	geturl['wfs'] = w.options[ind].value; 	
+	geturl['column'] = column;
+	getData(geturl);
+}
+
+function addConfsToGui(){
+	handleAssignment['action'] = 'add';
+	handleAssignment['confs'] = getSelectedConfs();
+	handleAssignment['gui'] = getSelectedGui();
+	getData(handleAssignment);
+}
+function removeConfsFromGui(){
+	handleAssignment['action'] = 'remove';
+	handleAssignment['confs'] = getSelectedAssignedConfs();
+	handleAssignment['gui'] = getSelectedGui();
+	getData(handleAssignment);
+}
+/**
+ * Sends an update request to update the capabilities of selected wfs
+ *
+ * @return success
+ * @type boolean
+ */
+ 
+function updateWfs(){
+	vupdateWfs['action'] = 'updateWfs';
+	var w = document.wfsForm.wfsList;
+	var ind  = w.selectedIndex;
+	if(ind == -1){
+		alert("please select an WFS");
+		return false;	
+	}
+	vupdateWfs['wfs'] = w.options[ind].value; 
+	vupdateWfs['url'] = document.getElementById("updateUrl").value;
+	getData(vupdateWfs);
+	return true;
+}
+
+function deleteWfs(){
+	deleteWfs['action'] = 'deleteWfs';
+	deleteWfs['wfs'] = getSelectedWfs();
+	if(deleteWfs['wfs']&&deleteWfs['wfs']!="gui_confs"){
+		if(confirm("Do you really want to delete the Wfs with Wfs-id:"+deleteWfs['wfs']+"?")){
+			getData(deleteWfs);
+		}
+		return true;
+	}
+	return false;
+}
+
+function setIndicator(){
+	var str = "<img src='../img/indicator_wheel.gif'>";
+	document.getElementById("indicator").innerHTML = str;	
+}
+function removeIndicator(){
+	document.getElementById("indicator").innerHTML = "";
+}
+function getOwsproxy(){
+	owsproxy['action'] = 'getOwsproxy';
+	owsproxy['wfs'] = getSelectedWfs();
+	getData(owsproxy);
+}
+function setOwsproxy(obj){
+	if(obj.checked == true){
+		owsproxy['action'] = 'setOwsproxy';
+	}
+	else{
+		owsproxy['action'] = 'removeOwsproxy';
+	}
+	owsproxy['wfs'] = getSelectedWfs();
+	if(owsproxy['wfs']){
+		getData(owsproxy);
+	}
+	else{
+		obj.checked = false;
+	}
+}
+/*
+ * Ajax-function to get data from the server
+ */
+function getData(obj){
+	setIndicator();
+	var obj2json = obj.toJSONString();
+	parent.mb_ajax_post("../php/mod_wfs_server.php",{"obj":obj2json}, function (json,status){
+		if(status == 'success'){
+			var dsJson = eval('(' + json + ')');
+			switch(obj['action']){
+				case "getServices":
+					appendServices(dsJson);
+				break;
+				case "getWfsConfData":
+					getOwsproxy();
+					appendWfsConfData(dsJson);					
+				break;
+				case "getGuis":
+					appendGuis(dsJson);
+				break;
+				case "getAssignedConfs":
+					appendGuiConfs(dsJson);
+				break;
+				case "getUpdateUrl":
+					setUpdateUrl(dsJson)
+				break;
+				case "add":
+					getGuiConfs();
+				break;
+				case "remove":
+					getGuiConfs();
+				break;
+				case "updateWfs":
+					if(dsJson['success'])
+						alert("Update performed.");
+					else
+						alert("An error occured, see log for details.");
+				break;
+				case "deleteWfs":
+					if(dsJson['success']){
+						getWfsList();
+						getGuis();					
+						alert("WFS deleted.");
+					}
+				break;
+				case "setOwsproxy":
+					displayOwsproxy(dsJson);
+				break;
+				case "removeOwsproxy":
+					displayOwsproxy(dsJson);
+				break;
+				case "getOwsproxy":
+					displayOwsproxy(dsJson);
+				break;
+				default:
+					alert("No action specified.....");
+				break;
+			}
+		}		
+		else{
+			alert("An error occured!");
+		}
+		removeIndicator();
+	});
+}
+
+/**
+ * Sets the update url comming from db in the html form
+ *
+ */
+ 
+function setUpdateUrl(dsJson){
+	document.getElementById("updateUrl").value = dsJson['url'];
+}
+
+/*
+ *
+ */
+function displayOwsproxy(dsJson){
+	if(dsJson.string == "" || dsJson.string == false){
+		document.wfsForm.owsproxy.checked = false;
+	}
+	else{
+		document.wfsForm.owsproxy.checked = true;
+	}
+} 
+
+function appendServices(dsJson){
+	services['services'] = dsJson.services;
+	var o = services['services']; 
+	for(var i=0; i<o.id.length; i++){
+		appendOption(document.forms[0].wfsList, o.title[i], o.id[i], false);
+	}
+	appendOption(document.forms[0].wfsList, "WFS Configurations", "-1", false);
+}
+
+function appendWfsConfData(dsJson){
+	wfsConf['wfsConf'] = {};
+	wfsConf['wfsConf'] = dsJson.wfsConf;
+	var o = wfsConf['wfsConf']; 
+	document.forms[0].wfsConfList.innerHTML = '';
+	for(var i=0; i<o.id.length; i++){
+		appendOption(document.forms[0].wfsConfList, o.abstract[i], o.id[i], false);
+	}
+}
+
+function appendGuis(dsJson){
+	guis['id'] = {};
+	guis['id'] = dsJson.id;
+	var o = guis['id']; 
+	for(var i=0; i<o.length; i++){
+		appendOption(document.forms[0].guiList, o[i], o[i], false);
+	}	
+}
+function appendGuiConfs(dsJson){
+	var list = document.forms[0].guiConfList;
+	list.innerHTML = '';
+	for(var i=0; i<dsJson.assignedConfs.length; i++){
+		var confAbstract = getConfAbstract(dsJson.assignedConfs[i]);
+		appendOption(list, confAbstract, dsJson.assignedConfs[i], false);
+	}	
+}
+function appendOption(boxObject, optionText, optionValue, selected){
+	var newOption = new Option(optionText,optionValue,false,selected);
+	boxObject.options[boxObject.length] = newOption;
+}
+/*
+ * returns id and abstract from a wfs configuration 
+ */
+function getConfAbstract(confId){
+	var c = wfsConf['wfsConf'];
+	for(var i=0; i < c['id'].length; i++){
+		if(c['id'][i] == confId){
+			return c['abstract'][i];
+		}
+	}
+}
+function getSelectedConfs(){
+	var list = document.forms[0].wfsConfList;
+	var confs = [];
+	for(var i=0; i<list.length; i++){
+		if(list.options[i].selected === true){
+			confs.push(list.options[i].value);
+		}
+	}
+	return confs;
+}
+function getSelectedAssignedConfs(){
+	var list = document.forms[0].guiConfList;
+	var confs = [];
+	for(var i=0; i<list.length; i++){
+		if(list.options[i].selected === true){
+			confs.push(list.options[i].value);
+		}
+	}
+	return confs;
+}
+function getSelectedGui(){
+	var ind = document.forms[0].guiList.selectedIndex;
+	return document.forms[0].guiList.options[ind].value;
+}
+</script>
+</head>
+<body onload='getWfsList();getGuis();'>
+
+<h1>Edit WFS</h1>
+<form name='wfsForm'>
+	<div id='indicator'>ahh</div>
+
+	<fieldset class="leftContainer">
+	<legend>WFS List</legend>
+		<p>
+			<select size='4' name='wfsList' class='wfsList' onchange='getWfsConfData();getGuiConfs();'></select>
+		</p>
+	</fieldset>
+	
+	<fieldset class="rightContainer">
+		<legend>Options</legend>
+		<p>
+			<input type='checkbox' name='owsproxy' id='owsproxy' onclick='setOwsproxy(this)' /> 
+			<label for="owsproxy">OWSProxy</label>
+			<br />
+			<label for="updateUrl">
+				Link to new WFS Capabilities URL: 
+				<br />
+				(<a href='javascript:getUpdateUrl("wfs_getcapabilities")'>wfs_getcapabilities</a>, <a href='javascript:getUpdateUrl("wfs_upload_url")'>wfs_upload_url</a>)
+			</label>
+			<input id='updateUrl' type='text' value='' name='updateUrl' class='updateUrl' />
+			<br />
+			<input type='button' value='Update WFS' name='update' id='updateButton' onclick='updateWfs()' /> 
+			<input type='button' value='Delete WFS' name='delete' id='deleteButton' onclick='deleteWfs()' /> 
+		</p>
+	</fieldset>
+
+	<hr />
+
+	<fieldset class="rightContainer">
+	<legend>GUI List</legend>
+		<p>
+			<select size='4' name='guiList' class='guiList' onchange='getGuiConfs()'></select>
+		</p>
+	</fieldset>
+
+	<hr />
+
+	<fieldset class="leftContainer">
+	<legend>WFS Configuration List</legend>
+		<p>
+			<select size='4' name='wfsConfList' class='wfsConfList' onchange='' multiple="multiple"></select>
+		</p>
+	</fieldset>
+
+	<fieldset class="centerContainer">
+	<legend>Action</legend>
+		<p>
+			<input type='button' value='&gt;' name ='add' id ='add' class='add' onclick='addConfsToGui()'><br />
+			<input type='button' value='&lt;' name ='remove' id ='remove' class='remove' onclick='removeConfsFromGui()'>
+		</p>
+	</fieldset>
+
+	<fieldset class="rightContainer">
+	<legend>GUI Configuration List</legend>
+		<p>
+			<select size='4' name='guiConfList' class='guiConfList' onchange='' multiple="multiple"></select>
+		</p>
+	</fieldset>
+	
+	<hr />
+</form>
+
+</body>
+</html>
\ No newline at end of file

Added: branches/mapbender_sld/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- branches/mapbender_sld/http/javascripts/mod_wfs_gazetteer_client.php	                        (rev 0)
+++ branches/mapbender_sld/http/javascripts/mod_wfs_gazetteer_client.php	2007-11-23 13:43:16 UTC (rev 1834)
@@ -0,0 +1,468 @@
+<?php 
+# $Id: mod_wfs_gazetteer_client.php 1370 2007-11-07 14:13:46Z baudson $
+# maintained by http://www.mapbender.org/index.php/User:Verena Diewald
+# http://www.mapbender.org/index.php/WFS_gazetteer
+# 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();
+$gui_id = $_SESSION["mb_user_gui"];
+
+$target = $_REQUEST["e_target"];
+$e_id_css = $_REQUEST["e_id_css"];
+
+require_once("../../conf/mapbender.conf");
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db($DB,$con);
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset='<?php echo CHARSET;?>'">	
+<title>mod_wfs_gazetteer</title>
+
+<?php
+include '../include/dyn_css.php';
+?>
+<script type="text/javascript">
+<?php 
+	echo "var targetString = '" . $target . "';";
+	echo "var wfsConfIdString = '" . $wfsConfIdString . "';";
+?>
+
+// Element var maxHighlightedPoints
+try{
+	if (maxHighlightedPoints){
+		maxHighlightedPoints = Number(maxHighlightedPoints);
+
+		if (isNaN(maxHighlightedPoints)) {
+			var e = new parent.Mb_warning("mod_wfs_gazetteer_client.php: Element var maxHighlightedPoints must be a number.");
+		}
+	}
+}
+catch(e){
+	maxHighlightedPoints = 0;
+	var e = new parent.Mb_warning("mod_wfs_gazetteer_client.php: Element var maxHighlightedPoints is not set, see 'edit element vars'.");
+}
+
+var targetArray = targetString.split(",");
+var global_wfsConfObj;
+var global_selectedWfsConfId;
+var point_px = 10;
+var resultGeom = null;
+var cw_fillcolor = "#cc33cc";
+
+
+parent.mb_registerInitFunctions("window.frames['"+this.name+"'].initModWfsGazetteer()");
+
+function openwindow(Adresse) {
+	Fenster1 = window.open(Adresse, "Informationen", "width=500,height=500,left=100,top=100,scrollbars=yes,resizable=no");
+	Fenster1.focus();
+}
+//----------------------------------------------------------------------------------
+
+function appendWfsConf(newWfsConfIdString) {
+	// merge with existing wfs conf ids
+	if (wfsConfIdString !== "") {
+		if (newWfsConfIdString !== "") {
+			wfsConfIdString += "," + newWfsConfIdString;
+
+			// rebuild form
+			initModWfsGazetteer();
+		}
+	}
+	else {
+		wfsConfIdString = newWfsConfIdString;
+
+		// rebuild form
+		initModWfsGazetteer();
+	}
+	
+}
+
+function removeChildNodes(node) {
+	while (node.childNodes.length > 0) {
+		var childNode = node.firstChild;
+		node.removeChild(childNode);
+	}
+}
+
+/**
+ * removes whitespaces and endlines before and after a string
+ *
+ */ 
+function trimString (str) {
+	return str.replace(/^\s+|\s+|\n+$/g, '');
+}
+
+function appendStyles() {
+	var styleObj;
+	var rule = global_wfsConfObj[global_selectedWfsConfId].g_style + global_wfsConfObj[global_selectedWfsConfId].g_res_style;
+	if (parent.ie) {
+		var styleSheetObj=document.createStyleSheet();
+		styleObj=styleSheetObj.owningElement || styleSheetObj.ownerNode;
+		styleObj.setAttribute("type","text/css");
+		ruleArray = rule.split("}");
+		for (var i=0; i < ruleArray.length - 1; i++) {
+			var currentRule = trimString(ruleArray[i]);
+			var nameValueArray = currentRule.split("{");
+			var name = nameValueArray[0];
+			var value = nameValueArray[1];
+			styleSheetObj.addRule(name,value);
+		}
+	}
+	else {
+		styleObj=document.createElement("style");
+		styleObj.setAttribute("type","text/css");
+		document.getElementsByTagName("head")[0].appendChild(styleObj);
+		styleObj.appendChild(document.createTextNode(rule+"\n"));		
+	}
+}
+
+//----------------------------------------------------------------------------------
+
+
+function initModWfsGazetteer() {
+	// empty nodes
+	var nodesToEmpty = ["selectWfsConfForm", "wfsForm", "res", "wfsInfo"];
+	
+	while (nodesToEmpty.length > 0) {
+		var currentId = nodesToEmpty.pop();
+		var currentNode = document.getElementById(currentId);
+		removeChildNodes(currentNode);
+	}
+	
+	document.getElementById("wfsGeomType").style.visibility = "hidden";
+	document.getElementById("wfsRemove").style.visibility = "hidden";
+	
+	parent.mb_ajax_json("../php/mod_wfs_gazetteer_server.php", {command:"getWfsConf",wfsConfIdString:wfsConfIdString}, function(json, status) {
+		global_wfsConfObj = json;
+		var wfsCount = 0;
+		for (var wfsConfId in global_wfsConfObj) {
+			global_selectedWfsConfId = wfsConfId; 
+			if (typeof(global_wfsConfObj[wfsConfId] != 'function')) {
+				wfsCount++;
+			}
+		}
+		if (wfsCount === 0) {
+			var e = parent.Mb_exception("no wfs conf id available.");
+		}
+		else if (wfsCount === 1) {
+			appendStyles();
+			appendWfsForm();
+			setWfsInfo();	
+		}
+		else {
+			appendWfsConfSelectBox();
+			setWfsInfo();	
+		}
+		parent.mb_setWmcExtensionData({"wfsConfIdString":wfsConfIdString});
+	});
+}
+
+function setWfsInfo() {
+	var bulbNode = document.getElementById("wfsInfo"); 	
+
+	// append bulb image
+	removeChildNodes(bulbNode);
+	var imgNode = document.createElement("img");
+	imgNode.id = "wfsInfoImg";
+	imgNode.src = "../img/button_digitize/geomInfo.png";
+	imgNode.border = 0;
+	bulbNode.appendChild(imgNode);
+	bulbNode.href = "javascript:openwindow('../php/mod_featuretypeMetadata.php?wfs_conf_id=" + global_selectedWfsConfId.toString() + "');";
+	bulbNode.style.visibility = "visible";
+	
+	// set wfsGeomType image
+	var wfsGeomTypeNode = document.getElementById("wfsGeomType");
+	var wfsGeomType = "";
+	for (var i=0; i < global_wfsConfObj[global_selectedWfsConfId].element.length; i++) {
+		if (parseInt(global_wfsConfObj[global_selectedWfsConfId].element[i].f_geom)) {
+			wfsGeomType = global_wfsConfObj[global_selectedWfsConfId].element[i].element_type;
+		}
+	}
+	if (wfsGeomType.match(/Point/)) {
+		wfsGeomTypeNode.src = "../img/button_digitize/point_off.png";
+		wfsGeomTypeNode.style.visibility = 'visible';
+	}
+	else if (wfsGeomType.match(/Line/)) {
+		wfsGeomTypeNode.src = "../img/button_digitize/line_off.png";
+		wfsGeomTypeNode.style.visibility = 'visible';
+	}
+	else if (wfsGeomType.match(/Polygon/)) {
+		wfsGeomTypeNode.src = "../img/button_digitize/polygon_off.png";
+		wfsGeomTypeNode.style.visibility = 'visible';
+	}
+	else {
+		var e = new parent.Mb_exception("WFS gazetteer: geometry type unknown.");		
+	}
+	
+	// set image: remove this WFS
+	var wfsRemoveNode = document.getElementById("wfsRemove");
+	wfsRemoveNode.src = "../img/button_digitize/geomRemove.png";
+	wfsRemoveNode.style.visibility = 'visible';
+	// Internet explorer
+	if (parent.ie) {
+		wfsRemoveNode.onclick = function() {
+			var x = new Function ("", "delete global_wfsConfObj[global_selectedWfsConfId];setWfsConfIdString();initModWfsGazetteer();parent.mb_setWmcExtensionData({'wfsConfIdString':wfsConfIdString});"); 
+			x(); 
+		};
+	}
+	// Firefox
+	else {
+		wfsRemoveNode.onclick = function () {
+			delete global_wfsConfObj[global_selectedWfsConfId];
+			setWfsConfIdString();
+			initModWfsGazetteer();			
+			parent.mb_setWmcExtensionData({"wfsConfIdString":wfsConfIdString});
+		}
+	}
+}
+
+function setWfsConfIdString() {
+	var str = [];
+	for (var wfsConfId in global_wfsConfObj) {
+		global_selectedWfsConfId = wfsConfId; 
+		if (typeof(global_wfsConfObj[wfsConfId] != 'function')) {
+			str.push(wfsConfId);
+		}
+	}
+	wfsConfIdString = str.join(",");
+}
+
+function appendWfsConfSelectBox() {
+	var selectNode = document.createElement("select");
+	selectNode.name = "wfs_conf_sel";
+	selectNode.setAttribute("onchange", "global_selectedWfsConfId = this.value;setWfsInfo();appendStyles();appendWfsForm()");
+	
+	var isSelected = false;
+	for (var wfsConfId in global_wfsConfObj) {
+		var optionNode = document.createElement("option");
+		
+		optionNode.value = wfsConfId;
+		optionNode.innerHTML = global_wfsConfObj[wfsConfId].g_label;
+
+		if (!isSelected) {
+			optionNode.selected = true;
+			isSelected = true;
+			global_selectedWfsConfId = wfsConfId;
+		}
+		selectNode.appendChild(optionNode);
+	}
+
+	var form = document.getElementById('selectWfsConfForm');
+	form.appendChild(selectNode);
+	
+	appendStyles();
+	appendWfsForm();
+}
+
+function appendWfsForm() {
+	var form = document.getElementById("wfsForm");
+	removeChildNodes(form);
+	var resultDiv = document.getElementById("res");
+	removeChildNodes(resultDiv);
+	
+	var divContainer = document.createElement("div");
+	divContainer.className = global_wfsConfObj[global_selectedWfsConfId].g_label_id;
+	
+	divContainer.innerHTML = global_wfsConfObj[global_selectedWfsConfId].g_label;
+	
+	form.appendChild(divContainer);
+
+	var wfsConfElementArray = global_wfsConfObj[global_selectedWfsConfId].element;
+
+	for (var i = 0; i < wfsConfElementArray.length; i++){
+		if (parseInt(wfsConfElementArray[i].f_search)) {
+			var spanNode = document.createElement("span");
+			spanNode.setAttribute("id", "ttttt");
+			spanNode.className = wfsConfElementArray[i].f_label_id;
+			spanNode.innerHTML = wfsConfElementArray[i].f_label;
+			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);
+			form.appendChild(document.createElement("br"));
+		}
+	}
+	var submitButton = document.createElement("input");
+	submitButton.type = "submit";
+	submitButton.className = global_wfsConfObj[global_selectedWfsConfId].g_button_id;
+	submitButton.value = global_wfsConfObj[global_selectedWfsConfId].g_button;
+	
+	form.appendChild(submitButton);
+}
+
+function validate(){
+	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){
+		return false;
+	}
+	else{
+		var andConditions = "";
+		
+		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{
+						orConditions += a[j];
+					}
+					orConditions += "*</ogc:Literal>";
+					orConditions += "</ogc:PropertyIsLike>";
+				}
+				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>";
+			
+			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);
+					}
+				}
+			}
+			
+			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'";
+					}
+					else {
+						body += "class='uneven'";
+					}
+					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) + " ";
+					}
+					body += "</div>";
+				}
+			}
+			else {
+				body = "Kein Ergebnis.";
+			}
+			document.getElementById('res').innerHTML = body;
+		});
+	}
+	return false;
+}
+
+function getNumberOfFilterParameters(){
+	var cnt = 0;
+	var el = global_wfsConfObj[global_selectedWfsConfId].element;
+
+	for (var i = 0; i < el.length; i++){
+		if( el[i]['f_search'] == 1){
+			if (document.getElementById(el[i]['element_name']).value != '') {
+				cnt++;
+			}
+		}
+	}
+	return cnt;
+}
+/*
+* event -> {over || out || click}
+* geom -> commaseparated coordinates x1,y1,x2,y2 ...
+*/
+function setResult(event, id){
+	var index = parseInt(id.slice(4));
+
+	var currentGeom = resultGeom.get(index);
+	if (maxHighlightedPoints > 0 && currentGeom.getTotalPointCount() > maxHighlightedPoints) {
+		currentGeom = currentGeom.getBBox4();
+	}
+	if (event == "over") {
+		global_resultHighlight.add(currentGeom, cw_fillcolor);
+	}
+	else if (event == "out"){
+		global_resultHighlight.del(currentGeom, cw_fillcolor);
+	}
+	else if (event == "click"){
+		global_resultHighlight.del(currentGeom, cw_fillcolor);
+		var bbox = currentGeom.getBBox();
+		var bufferFloat = parseFloat(global_wfsConfObj[global_selectedWfsConfId].g_buffer);
+		var buffer = new parent.Point(bufferFloat,bufferFloat);
+		bbox[0] = bbox[0].minus(buffer);
+		bbox[1] = bbox[1].plus(buffer);
+		parent.mb_calculateExtent(targetArray[0], bbox[0].x, bbox[0].y, bbox[1].x, bbox[1].y);
+		parent.zoom(targetArray[0], 'true', 1.0);
+		global_resultHighlight.add(currentGeom, cw_fillcolor);
+	}
+	return true;
+}
+</script>
+</head>
+<body leftmargin='0' topmargin='10'  bgcolor='#ffffff'>
+<form name='selectWfsConfForm' id='selectWfsConfForm'></form>
+<img src = "" name='wfsGeomType' id='wfsGeomType'>
+<img src = "" name='wfsRemove' id='wfsRemove'>
+<a name='wfsInfo' id='wfsInfo'/>
+<form name='wfsForm' id='wfsForm' onsubmit='return validate()'></form>
+<div name='res' id='res' style='width:180px'></div>
+</body>
+</html>
\ No newline at end of file

Modified: branches/mapbender_sld/http/javascripts/point.js
===================================================================
--- branches/mapbender_sld/http/javascripts/point.js	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/point.js	2007-11-23 13:43:16 UTC (rev 1834)
@@ -9,17 +9,28 @@
  * @class A class representing a two-dimensional point.
  *
  * @constructor
+ * @param {Float} x x value of the {@link Point}
+ * @param {Float} y y value of the {@link Point}
  */
  function Point(x, y){
+ 	/**
+ 	 * x value of the {@link Point}
+ 	 *
+	 * @type Float
+	 */
 	this.x = parseFloat(x);
+ 	/**
+ 	 * y value of the {@link Point}
+	 *
+	 * @type Float
+	 */
 	this.y = parseFloat(y);
 }
 /**
  * computes the distance between a {@link Point} p and this {@link Point}
  *
- * @member Point
- * @param {Point} p 
- * @return {Float} the distance between the two points
+ * @param {Point} p the distance between this {@link Point} and the {@link Point} p is computed.
+ * @return {Float} the distance between the two {@link Point} objects.
  */
 Point.prototype.dist = function(p){
 	return Math.sqrt(Math.pow(this.y-p.y,2) + Math.pow(this.x-p.x,2)) ;
@@ -27,7 +38,6 @@
 /**
  * checks if the coordinates of this {@link Point} match the coordinates of a {@link Point} p
  *
- * @member Point
  * @param {Point} p 
  * @return {Boolean} true if the two points are equal; elso false
  */
@@ -38,9 +48,8 @@
 /**
  * subtracts a {@link Point} p from this {@link Point}
  *
- * @member Point
  * @param {Point} p 
- * @return a new {Point} with the difference of the two points
+ * @return a new {@link Point} with the difference of the two points
  */
 Point.prototype.minus = function(p){
 	return new Point(this.x-p.x, this.y-p.y);
@@ -48,9 +57,8 @@
 /**
  * adds this {@link Point} to a {@link Point} p
  *
- * @member Point
  * @param {Point} p 
- * @return a new {Point} with the sum of the two points
+ * @return a new {@link Point} with the sum of the two points
  */
 Point.prototype.plus = function(p){
 	return new Point(this.x+p.x, this.y+p.y);
@@ -58,9 +66,8 @@
 /**
  * divides this {@link Point} by a scalar c
  *
- * @member Point
  * @param {Float} c divisor
- * @return a new {Point} divided by c
+ * @return a new {@link Point} divided by c
  */
 Point.prototype.dividedBy = function(c){
 	if (c != 0) {
@@ -72,9 +79,8 @@
 /**
  * multiplies this {@link Point} by a scalar c
  *
- * @member Point
  * @param {Float} c factor
- * @return a new {Point} multiplied by c
+ * @return a new {@link Point} multiplied by c
  */
 Point.prototype.times = function(c){
 	return new Point(this.x*c, this.y*c);
@@ -82,15 +88,14 @@
 /**
  * rounds the coordinates to numOfDigits digits
  *
- * @member Point
- * @return a new {Point} rounded to numOfDigits
+ * @param numOfDigits the coordinate will be rounded to numOfDigits digits
+ * @return a new {@link Point} rounded to numOfDigits digits
  * @type Point
  */
 Point.prototype.round = function(numOfDigits){
 	return new Point(roundToDigits(this.x, numOfDigits), roundToDigits(this.y, numOfDigits));
 }
 /**
- * @member Point
  * @returns a {String} representation of this Point
  * @type String
  */
@@ -101,7 +106,9 @@
 
 //------------------------------------------------------------------------
 // possible improvement: point has flag: map OR real. additional functions: toReal, toMap
-
+/**
+ * @ignore
+ */
 function mapToReal(frameName, aPoint) {
 	var v;
 	if (typeof(mb_mapObj) == 'object') v = makeClickPos2RealWorldPos(frameName, aPoint.x, aPoint.y);
@@ -109,6 +116,9 @@
 	else alert('where am i?');
 	return new Point(v[0], v[1]);
 }
+/**
+ * @ignore
+ */
 function realToMap(frameName, aPoint) {
 	var v;
 	if (typeof(mb_mapObj) == 'object') {
@@ -122,6 +132,9 @@
 	}
 	return new Point(v[0], v[1]);
 }
+/**
+ * @ignore
+ */
 function mb_calcExtent(frameName, min, max) {
 	var ind;
 	if (typeof(mb_mapObj) == 'object') {
@@ -153,6 +166,9 @@
 	}
 	mb_mapObj[ind].extent = new_min.x +","+ new_min.y +","+ new_max.x  +","+ new_max.y;
 }
+/**
+ * @ignore
+ */
 function roundToDigits(aFloat, numberOfDigits) {
 	return Math.round(aFloat*Math.pow(10, parseInt(numberOfDigits)))/Math.pow(10, parseInt(numberOfDigits));
 }

Added: branches/mapbender_sld/http/javascripts/popup.js
===================================================================
--- branches/mapbender_sld/http/javascripts/popup.js	                        (rev 0)
+++ branches/mapbender_sld/http/javascripts/popup.js	2007-11-23 13:43:16 UTC (rev 1834)
@@ -0,0 +1,299 @@
+/* 
+* $Id: popup.js 895 2007-09-17 17:57:38Z nimix $
+* 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
+
+/*jqModal*/
+/*
+ * jqModal - Minimalist Modaling with jQuery
+ *
+ * Copyright (c) 2007 Brice Burgess <bhb at iceburg.net>, http://www.iceburg.net
+ * Licensed under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ * 
+ * $Version: 2007.08.17 +r11
+ * 
+ */
+(function($) {
+$.fn.jqm=function(o){
+var _o = {
+zIndex: 3000,
+overlay: 50,
+overlayClass: 'jqmOverlay',
+closeClass: 'jqmClose',
+trigger: '.jqModal',
+ajax: false,
+target: false,
+modal: false,
+toTop: false,
+onShow: false,
+onHide: false,
+onLoad: false
+};
+return this.each(function(){if(this._jqm)return; s++; this._jqm=s;
+H[s]={c:$.extend(_o, o),a:false,w:$(this).addClass('jqmID'+s),s:s};
+if(_o.trigger)$(this).jqmAddTrigger(_o.trigger);
+});};
+
+$.fn.jqmAddClose=function(e){hs(this,e,'jqmHide'); return this;};
+$.fn.jqmAddTrigger=function(e){hs(this,e,'jqmShow'); return this;};
+$.fn.jqmShow=function(t){return this.each(function(){if(!H[this._jqm].a)$.jqm.open(this._jqm,t)});};
+$.fn.jqmHide=function(t){return this.each(function(){if(H[this._jqm].a)$.jqm.close(this._jqm,t)});};
+
+$.jqm = {
+hash:{},
+open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(/^\d+$/.test(h.w.css('z-index')))?h.w.css('z-index'):c.zIndex,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});h.t=t;h.a=true;h.w.css('z-index',z);
+ if(c.modal) {if(!A[0])F('bind');A.push(s);o.css('cursor','wait');}
+ else if(c.overlay > 0)h.w.jqmAddClose(o);
+ else o=false;
+
+ h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):false;
+ if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in {Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}}
+
+ if(c.ajax) {var r=c.target||h.w,u=c.ajax,r=(typeof r == 'string')?$(r,h.w):$(r),u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
+  r.load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
+ else if(cc)h.w.jqmAddClose($(cc,h.w));
+
+ if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);	
+ (c.onShow)?c.onShow(h):h.w.show();e(h);return false;
+},
+close:function(s){var h=H[s];h.a=false;
+ if(A[0]){A.pop();if(!A[0])F('unbind');}
+ if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();
+ if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();} return false;
+}};
+var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),
+i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),
+e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i); f(h);},
+f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(e){}},
+F=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
+m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return !r;},
+hs=function(w,e,y){var s=[];w.each(function(){s.push(this._jqm)});
+ $(e).each(function(){if(this[y])$.extend(this[y],s);else{this[y]=s;$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return false;});}});};
+})(jQuery);
+/*
+ * jqDnR - Minimalistic Drag'n'Resize for jQuery.
+ *
+ * Copyright (c) 2007 Brice Burgess <bhb at iceburg.net>, http://www.iceburg.net
+ * Licensed under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ * 
+ * $Version: 2007.08.19 +r2
+ */
+
+(function($){
+$.fn.jqDrag=function(h){return i(this,h,'d');};
+$.fn.jqResize=function(h){return i(this,h,'r');};
+$.jqDnR={dnr:{},e:0,
+drag:function(v){
+ if(M.k == 'd')E.css({left:M.X+v.pageX-M.pX,top:M.Y+v.pageY-M.pY});
+ else E.css({width:Math.max(v.pageX-M.pX+M.W,0),height:Math.max(v.pageY-M.pY+M.H,0)});
+  return false;},
+stop:function(){E.css('opacity',M.o);$().unbind('mousemove',J.drag).unbind('mouseup',J.stop);}
+};
+var J=$.jqDnR,M=J.dnr,E=J.e,
+i=function(e,h,k){return e.each(function(){h=(h)?$(h,e):e;
+ h.bind('mousedown',{e:e,k:k},function(v){var d=v.data,p={};E=d.e;
+ // attempt utilization of dimensions plugin to fix IE issues
+ if(E.css('position') != 'relative'){try{E.position(p);}catch(e){}}
+ M={X:p.left||f('left')||0,Y:p.top||f('top')||0,W:f('width')||E[0].scrollWidth||0,H:f('height')||E[0].scrollHeight||0,pX:v.pageX,pY:v.pageY,k:d.k,o:E.css('opacity')};
+ E.css({opacity:0.8});$().mousemove($.jqDnR.drag).mouseup($.jqDnR.stop);
+ return false;
+ });
+});},
+f=function(k){return parseInt(E.css(k))||false;};
+})(jQuery);
+/*end jqModal*/
+
+var popup_count = 0;
+var popup_top = 150;
+
+/**
+ * @class A class representing a popup window
+ *
+ * @constructor
+ * @param {String} title the title text of the popup 
+ * @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) {
+	//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;
+		}
+
+	//Set member vars
+	this.left=posx?posx:25*create_pos;
+	this.top=posy?posy:25*create_pos;
+	this.width=width;
+	this.height=height;
+	this.title=title;
+	this.html=html.indexOf("url:")==0?('<iframe src="'+html.substr(4)+'"></iframe>'):('<div class="scrollDiv">'+html+'</div>');
+	this.id="popup"+String(create_pos);
+	popup_count++;
+}
+
+/**
+ * Shows the popup
+ */
+mb_popup.prototype.show = function(){
+	if(document.getElementById(this.id))return;
+	//create popup div
+	var div=document.createElement('div');
+	div.id=this.id;
+	div.className = "jqmNotice";
+	
+	div.style.left=String(this.left)+"px";
+	div.style.top=String(this.top)+"px";
+//	div.style.width=String(this.width)+"px";
+//	div.style.height=String(this.height)+"px";
+	div.style.zIndex=popup_top++;
+	
+	//create Window elements
+	div.innerHTML='<div class="jqmnTitle jqDrag"><h1>'+this.title+'</h1></div><div class="jqmnContent">'+this.html+'</div><img src="../img/close_icon.png" class="jqmClose" alt="close" /><div class="jqResize" />';
+	
+	//create window
+	document.body.appendChild(div);
+	$(div.firstChild).mousedown(function() {
+		var div=document.createElement('div');
+		div.style.position="absolute";
+		div.style.top="-150px";
+		div.style.left="-150px";
+		div.style.width=String(this.parentNode.clientWidth+300)+"px";
+		div.style.height=String(this.parentNode.clientHeight+150)+"px";
+		if(top.ie)
+			div.style.background = "url(../img/transparent.gif)";
+		div.style.cursor = "move";				
+		this.appendChild(div);
+	});
+	$(div.firstChild).mouseup(function() {
+		$(this.lastChild).remove();
+	});
+	$(div.lastChild).mousedown(function() {
+		var div=document.createElement('div');
+		div.style.position="absolute";
+		div.style.top="-250px";
+		div.style.left="-250px";
+		div.style.width="516px";
+		div.style.height="516px";
+		if(top.ie)
+			div.style.background = "url(../img/transparent.gif)";
+		div.style.cursor = "move";				
+		this.appendChild(div);
+	});
+	$(div.lastChild).mouseup(function() {
+		$(this.lastChild).remove();
+	});	
+	$("#"+this.id, document).jqDrag('.jqDrag').jqResize('.jqResize').jqm({
+      overlay: 0,
+      onShow: function(h) {
+        //on show annimate
+        h.w.css('opacity',1.00).slideDown("slow"); 
+       },
+      onHide: function(h) {
+        // on close do animation and destroy dom element.
+        h.w.slideUp("slow",function() {if(h.o) h.o.remove(); if(h.w)h.w.remove();});}
+      });
+	$("#"+this.id).jqm().jqmShow();
+	//on click bring window to top
+	$("*>#"+this.id).click(function (){this.style.zIndex=popup_top++});
+}
+
+/**
+ * Hides the popup
+ */
+mb_popup.prototype.hide = function(){
+	$("#"+this.id).jqm().jqmHide();
+}
+
+/**
+ * sets the width of the popup window
+ *
+ * @param {Number} width new width of the popup  
+ */
+mb_popup.prototype.setWidth = function(width){
+	this.width=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){
+	this.height=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){
+	this.left=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){
+	this.top=topp;
+	var div=document.getElementById(this.id);
+	if(div)div.style.top=topp;
+}
+
+/**
+ * sets the title of the popup window
+ *
+ * @param {String} title new title text of the popup  
+ */
+mb_popup.prototype.setTitle = function(title){
+	this.title=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.html="<div class='scrollDiv'>"+htmll+"</div>";
+	$("#"+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.html="url:"+url;
+	$("#"+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 document.getElementById(this.id)?true:false;
+}

Added: branches/mapbender_sld/http/javascripts/style.js
===================================================================
--- branches/mapbender_sld/http/javascripts/style.js	                        (rev 0)
+++ branches/mapbender_sld/http/javascripts/style.js	2007-11-23 13:43:16 UTC (rev 1834)
@@ -0,0 +1,49 @@
+/**
+ * creates a style tag in the head of the document.
+ *
+ */
+var StyleTag = function() {
+
+	/**
+	 * Creates the style tag in the head of the document. Something like a constructor. 
+	 *
+	 */
+	var createStyleTag = function() {
+		// TODO: Internet Explorer routine seems a little buggy
+		if (top.ie) {
+			// create a Style Sheet object (IE only)
+			styleSheetObj=document.createStyleSheet();
+			
+			// get the DOM node of the style sheet object, set the type
+			styleObj=styleSheetObj.owningElement || styleSheetObj.ownerNode;
+			styleObj.setAttribute("type","text/css");
+		}
+		else {
+			// create the style node, set the style
+			styleObj=document.createElement("style");
+			styleObj.setAttribute("type","text/css");
+			
+		}
+		// append the node to the head
+		document.getElementsByTagName("head")[0].appendChild(styleObj);
+	};
+	
+	/**
+	 * Adds a class className with the CSS in cssString
+	 */
+	this.addClass = function(className, cssString) {
+		// TODO: Internet Explorer routine seems a little buggy
+		if (top.ie) {
+			styleSheetObj.addRule(className,cssString);
+		}
+		else {
+			// insert the content via createTextNode
+			styleObj.appendChild(document.createTextNode("."+className+"{\n\t"+cssString+"\n}\n"));				
+		}
+	};
+	
+	var styleObj;
+	var styleSheetObj; //IE only...
+	
+	createStyleTag();
+};
\ No newline at end of file

Modified: branches/mapbender_sld/http/javascripts/wfs.js
===================================================================
--- branches/mapbender_sld/http/javascripts/wfs.js	2007-11-23 13:39:18 UTC (rev 1833)
+++ branches/mapbender_sld/http/javascripts/wfs.js	2007-11-23 13:43:16 UTC (rev 1834)
@@ -56,7 +56,7 @@
 	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;}
+try {if(displayWfsResultList){}}catch(e) {displayWfsResultList = 0;};
 
 if (displayWfsResultList == 1) {
 	//mb_registerWfsReadSubFunctions(function(geom){mb_wfs_listMember(geom)});
@@ -168,7 +168,12 @@
 	else if(type=='out') highlight.del(m, '#0000ff');
 	else if(type=='click') {
 		var tmp = m.getBBox();
-		var b = 0;
+		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']);
 		}



More information about the Mapbender_commits mailing list