var OpenLayers= {
	singleFile:true
};
(function() {
	var a=typeof OpenLayers=="object"&&OpenLayers.singleFile;
	window.OpenLayers= {
		_scriptName:!a?"lib/OpenLayers.js":"OpenLayers.js",
		_getScriptLocation: function() {
			for(var i="",j=new RegExp("(^|(.*?\\/))("+OpenLayers._scriptName+")(\\?|$)"),l=document.getElementsByTagName("script"),k=0,n=l.length;k<n;k++) {
				var m=l[k].getAttribute("src");
				if(m)
					if(m=m.match(j)) {
						i=m[1];
						break
					}
			}
			return i
		}
	};
	if(!a) {
		a=new Array("OpenLayers/Util.js","OpenLayers/BaseTypes.js","OpenLayers/BaseTypes/Class.js","OpenLayers/BaseTypes/Bounds.js",
		"OpenLayers/BaseTypes/Element.js","OpenLayers/BaseTypes/LonLat.js","OpenLayers/BaseTypes/Pixel.js","OpenLayers/BaseTypes/Size.js","OpenLayers/Console.js","OpenLayers/Tween.js","Rico/Corner.js","Rico/Color.js","OpenLayers/Ajax.js","OpenLayers/Events.js","OpenLayers/Request.js","OpenLayers/Request/XMLHttpRequest.js","OpenLayers/Projection.js","OpenLayers/Map.js","OpenLayers/Layer.js","OpenLayers/Icon.js","OpenLayers/Marker.js","OpenLayers/Marker/Box.js","OpenLayers/Popup.js","OpenLayers/Tile.js","OpenLayers/Tile/Image.js",
		"OpenLayers/Tile/WFS.js","OpenLayers/Layer/Image.js","OpenLayers/Layer/SphericalMercator.js","OpenLayers/Layer/EventPane.js","OpenLayers/Layer/FixedZoomLevels.js","OpenLayers/Layer/Google.js","OpenLayers/Layer/VirtualEarth.js","OpenLayers/Layer/Yahoo.js","OpenLayers/Layer/HTTPRequest.js","OpenLayers/Layer/Grid.js","OpenLayers/Layer/MapGuide.js","OpenLayers/Layer/MapServer.js","OpenLayers/Layer/MapServer/Untiled.js","OpenLayers/Layer/KaMap.js","OpenLayers/Layer/KaMapCache.js","OpenLayers/Layer/MultiMap.js",
		"OpenLayers/Layer/Markers.js","OpenLayers/Layer/Text.js","OpenLayers/Layer/WorldWind.js","OpenLayers/Layer/ArcGIS93Rest.js","OpenLayers/Layer/WMS.js","OpenLayers/Layer/WMS/Untiled.js","OpenLayers/Layer/ArcIMS.js","OpenLayers/Layer/GeoRSS.js","OpenLayers/Layer/Boxes.js","OpenLayers/Layer/XYZ.js","OpenLayers/Layer/TMS.js","OpenLayers/Layer/TileCache.js","OpenLayers/Popup/Anchored.js","OpenLayers/Popup/AnchoredBubble.js","OpenLayers/Popup/Framed.js","OpenLayers/Popup/FramedCloud.js","OpenLayers/Feature.js",
		"OpenLayers/Feature/Vector.js","OpenLayers/Feature/WFS.js","OpenLayers/Handler.js","OpenLayers/Handler/Click.js","OpenLayers/Handler/Hover.js","OpenLayers/Handler/Point.js","OpenLayers/Handler/Path.js","OpenLayers/Handler/Polygon.js","OpenLayers/Handler/Feature.js","OpenLayers/Handler/Drag.js","OpenLayers/Handler/RegularPolygon.js","OpenLayers/Handler/Box.js","OpenLayers/Handler/MouseWheel.js","OpenLayers/Handler/Keyboard.js","OpenLayers/Control.js","OpenLayers/Control/Attribution.js","OpenLayers/Control/Button.js",
		"OpenLayers/Control/ZoomBox.js","OpenLayers/Control/ZoomToMaxExtent.js","OpenLayers/Control/DragPan.js","OpenLayers/Control/Navigation.js","OpenLayers/Control/MouseDefaults.js","OpenLayers/Control/MousePosition.js","OpenLayers/Control/OverviewMap.js","OpenLayers/Control/KeyboardDefaults.js","OpenLayers/Control/PanZoom.js","OpenLayers/Control/PanZoomBar.js","OpenLayers/Control/ArgParser.js","OpenLayers/Control/Permalink.js","OpenLayers/Control/Scale.js","OpenLayers/Control/ScaleLine.js","OpenLayers/Control/Snapping.js",
		"OpenLayers/Control/Split.js","OpenLayers/Control/LayerSwitcher.js","OpenLayers/Control/DrawFeature.js","OpenLayers/Control/DragFeature.js","OpenLayers/Control/ModifyFeature.js","OpenLayers/Control/Panel.js","OpenLayers/Control/SelectFeature.js","OpenLayers/Control/NavigationHistory.js","OpenLayers/Control/Measure.js","OpenLayers/Control/WMSGetFeatureInfo.js","OpenLayers/Geometry.js","OpenLayers/Geometry/Rectangle.js","OpenLayers/Geometry/Collection.js","OpenLayers/Geometry/Point.js","OpenLayers/Geometry/MultiPoint.js",
		"OpenLayers/Geometry/Curve.js","OpenLayers/Geometry/LineString.js","OpenLayers/Geometry/LinearRing.js","OpenLayers/Geometry/Polygon.js","OpenLayers/Geometry/MultiLineString.js","OpenLayers/Geometry/MultiPolygon.js","OpenLayers/Geometry/Surface.js","OpenLayers/Renderer.js","OpenLayers/Renderer/Elements.js","OpenLayers/Renderer/SVG.js","OpenLayers/Renderer/Canvas.js","OpenLayers/Renderer/VML.js","OpenLayers/Layer/Vector.js","OpenLayers/Layer/Vector/RootContainer.js","OpenLayers/Strategy.js","OpenLayers/Strategy/Fixed.js",
		"OpenLayers/Strategy/Cluster.js","OpenLayers/Strategy/Paging.js","OpenLayers/Strategy/BBOX.js","OpenLayers/Strategy/Save.js","OpenLayers/Protocol.js","OpenLayers/Protocol/HTTP.js","OpenLayers/Protocol/SQL.js","OpenLayers/Protocol/SQL/Gears.js","OpenLayers/Protocol/WFS.js","OpenLayers/Protocol/WFS/v1.js","OpenLayers/Protocol/WFS/v1_0_0.js","OpenLayers/Protocol/WFS/v1_1_0.js","OpenLayers/Layer/PointTrack.js","OpenLayers/Layer/GML.js","OpenLayers/Style.js","OpenLayers/StyleMap.js","OpenLayers/Rule.js",
		"OpenLayers/Filter.js","OpenLayers/Filter/FeatureId.js","OpenLayers/Filter/Logical.js","OpenLayers/Filter/Comparison.js","OpenLayers/Filter/Spatial.js","OpenLayers/Format.js","OpenLayers/Format/XML.js","OpenLayers/Format/ArcXML.js","OpenLayers/Format/ArcXML/Features.js","OpenLayers/Format/GML.js","OpenLayers/Format/GML/Base.js","OpenLayers/Format/GML/v2.js","OpenLayers/Format/GML/v3.js","OpenLayers/Format/KML.js","OpenLayers/Format/GeoRSS.js","OpenLayers/Format/WFS.js","OpenLayers/Format/WFSCapabilities.js",
		"OpenLayers/Format/WFSCapabilities/v1.js","OpenLayers/Format/WFSCapabilities/v1_0_0.js","OpenLayers/Format/WFSCapabilities/v1_1_0.js","OpenLayers/Format/WFSDescribeFeatureType.js","OpenLayers/Format/WMSDescribeLayer.js","OpenLayers/Format/WMSDescribeLayer/v1_1.js","OpenLayers/Format/WKT.js","OpenLayers/Format/OSM.js","OpenLayers/Format/GPX.js","OpenLayers/Format/Filter.js","OpenLayers/Format/Filter/v1.js","OpenLayers/Format/Filter/v1_0_0.js","OpenLayers/Format/Filter/v1_1_0.js","OpenLayers/Format/SLD.js",
		"OpenLayers/Format/SLD/v1.js","OpenLayers/Format/SLD/v1_0_0.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/WFST.js","OpenLayers/Format/WFST/v1.js","OpenLayers/Format/WFST/v1_0_0.js","OpenLayers/Format/WFST/v1_1_0.js","OpenLayers/Format/Text.js","OpenLayers/Format/JSON.js","OpenLayers/Format/GeoJSON.js","OpenLayers/Format/WMC.js","OpenLayers/Format/WMC/v1.js","OpenLayers/Format/WMC/v1_0_0.js","OpenLayers/Format/WMC/v1_1_0.js","OpenLayers/Format/WMSCapabilities.js","OpenLayers/Format/WMSCapabilities/v1_1.js",
		"OpenLayers/Format/WMSCapabilities/v1_1_0.js","OpenLayers/Format/WMSCapabilities/v1_1_1.js","OpenLayers/Format/WMSGetFeatureInfo.js","OpenLayers/Layer/WFS.js","OpenLayers/Control/GetFeature.js","OpenLayers/Control/MouseToolbar.js","OpenLayers/Control/NavToolbar.js","OpenLayers/Control/PanPanel.js","OpenLayers/Control/Pan.js","OpenLayers/Control/ZoomIn.js","OpenLayers/Control/ZoomOut.js","OpenLayers/Control/ZoomPanel.js","OpenLayers/Control/EditingToolbar.js","OpenLayers/Lang.js","OpenLayers/Lang/en.js");
		var b=navigator.userAgent;
		if(b=b.match("MSIE")||b.match("Safari"))
			var c=new Array(a.length);
		for(var d=OpenLayers._getScriptLocation()+"lib/",e=0,f=a.length;e<f;e++)
			if(b)
				c[e]="<script src='"+d+a[e]+"'><\/script>";
			else {
				var g=document.createElement("script");
				g.src=d+a[e];
				var h=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;
				h.appendChild(g)
			}
		b&&document.write(c.join(""))
	}
})();
OpenLayers.VERSION_NUMBER="OpenLayers 2.8 -- $Revision: 9492 $";
OpenLayers.String= {
	startsWith: function(a,b) {
		return a.indexOf(b)==0
	},
	contains: function(a,b) {
		return a.indexOf(b)!=-1
	},
	trim: function(a) {
		return a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")
	},
	camelize: function(a) {
		a=a.split("-");
		for(var b=a[0],c=1,d=a.length;c<d;c++) {
			var e=a[c];
			b+=e.charAt(0).toUpperCase()+e.substring(1)
		}
		return b
	},
	format: function(a,b,c) {
		b||(b=window);
		function d(e,f) {
			var g;
			e=f.split(/\.+/);
			for(f=0;f<e.length;f++) {
				if(f==0)
					g=b;
				g=g[e[f]]
			}
			if(typeof g=="function")
				g=c?g.apply(null,c):g();
			return typeof g==
			"undefined"?"undefined":g
		}

		return a.replace(OpenLayers.String.tokenRegEx,d)
	},
	tokenRegEx:/\$\{([\w.]+?)\}/g,
	numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,
	isNumeric: function(a) {
		return OpenLayers.String.numberRegEx.test(a)
	},
	numericIf: function(a) {
		return OpenLayers.String.isNumeric(a)?parseFloat(a):a
	}
};
if(!String.prototype.startsWith)
	String.prototype.startsWith= function(a) {
		OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", {
			newMethod:"OpenLayers.String.startsWith"
		}));
		return OpenLayers.String.startsWith(this,a)
	};
if(!String.prototype.contains)
	String.prototype.contains= function(a) {
		OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", {
			newMethod:"OpenLayers.String.contains"
		}));
		return OpenLayers.String.contains(this,a)
	};
if(!String.prototype.trim)
	String.prototype.trim= function() {
		OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", {
			newMethod:"OpenLayers.String.trim"
		}));
		return OpenLayers.String.trim(this)
	};
if(!String.prototype.camelize)
	String.prototype.camelize= function() {
		OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", {
			newMethod:"OpenLayers.String.camelize"
		}));
		return OpenLayers.String.camelize(this)
	};
OpenLayers.Number= {
	decimalSeparator:".",
	thousandsSeparator:",",
	limitSigDigs: function(a,b) {
		var c=0;
		if(b>0)
			c=parseFloat(a.toPrecision(b));
		return c
	},
	format: function(a,b,c,d) {
		b=typeof b!="undefined"?b:0;
		c=typeof c!="undefined"?c:OpenLayers.Number.thousandsSeparator;
		d=typeof d!="undefined"?d:OpenLayers.Number.decimalSeparator;
		if(b!=null)
			a=parseFloat(a.toFixed(b));
		var e=a.toString().split(".");
		if(e.length==1&&b==null)
			b=0;
		a=e[0];
		if(c)
			for(var f=/(-?[0-9]+)([0-9]{3})/;f.test(a);)
				a=a.replace(f,"$1"+c+"$2");
		if(b==0)
			b=a;
		else {
			c=e.length>1?e[1]:"0";
			if(b!=null)
				c+=(new Array(b-c.length+1)).join("0");
			b=a+d+c
		}
		return b
	}
};
if(!Number.prototype.limitSigDigs)
	Number.prototype.limitSigDigs= function(a) {
		OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", {
			newMethod:"OpenLayers.Number.limitSigDigs"
		}));
		return OpenLayers.Number.limitSigDigs(this,a)
	};
OpenLayers.Function= {
	bind: function(a,b) {
		var c=Array.prototype.slice.apply(arguments,[2]);
		return function() {
			var d=c.concat(Array.prototype.slice.apply(arguments,[0]));
			return a.apply(b,d)
		}
	},
	bindAsEventListener: function(a,b) {
		return function(c) {
			return a.call(b,c||window.event)
		}
	}
};
if(!Function.prototype.bind)
	Function.prototype.bind= function() {
		OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", {
			newMethod:"OpenLayers.Function.bind"
		}));
		Array.prototype.unshift.apply(arguments,[this]);
		return OpenLayers.Function.bind.apply(null,arguments)
	};
if(!Function.prototype.bindAsEventListener)
	Function.prototype.bindAsEventListener= function(a) {
		OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", {
			newMethod:"OpenLayers.Function.bindAsEventListener"
		}));
		return OpenLayers.Function.bindAsEventListener(this,a)
	};
OpenLayers.Array= {
	filter: function(a,b,c) {
		var d=[];
		if(Array.prototype.filter)
			d=a.filter(b,c);
		else {
			var e=a.length;
			if(typeof b!="function")throw new TypeError;
			for(var f=0;f<e;f++)
				if(f in a) {
					var g=a[f];
					b.call(c,g,f,a)&&d.push(g)
				}
		}
		return d
	}
};
OpenLayers.Class= function() {
	function a() {
		arguments&&arguments[0]!=OpenLayers.Class.isPrototype&&this.initialize.apply(this,arguments)
	}

	for(var b={},c,d=0,e=arguments.length;d<e;++d) {
		if(typeof arguments[d]=="function") {
			if(d==0&&e>1) {
				c=arguments[d].prototype.initialize;
				arguments[d].prototype.initialize= function() {
				};
				b=new arguments[d];
				if(c===undefined)
					delete arguments[d].prototype.initialize;
				else
					arguments[d].prototype.initialize=c
			}
			c=arguments[d].prototype
		} else
			c=arguments[d];
		OpenLayers.Util.extend(b,
		c)
	}
	a.prototype=b;
	return a
};
OpenLayers.Class.isPrototype= function() {
};
OpenLayers.Class.create= function() {
	return function() {
		arguments&&arguments[0]!=OpenLayers.Class.isPrototype&&this.initialize.apply(this,arguments)
	}
};
OpenLayers.Class.inherit= function() {
	var a=arguments[0];
	a=new a(OpenLayers.Class.isPrototype);
	for(var b=1,c=arguments.length;b<c;b++) {
		if(typeof arguments[b]=="function") {
			var d=arguments[b];
			arguments[b]=new d(OpenLayers.Class.isPrototype)
		}
		OpenLayers.Util.extend(a,arguments[b])
	}
	return a
};
OpenLayers.Util= {};
OpenLayers.Util.getElement= function() {
	for(var a=[],b=0,c=arguments.length;b<c;b++) {
		var d=arguments[b];
		if(typeof d=="string")
			d=document.getElementById(d);
		if(arguments.length==1)
			return d;
		a.push(d)
	}
	return a
};
if(typeof window.$==="undefined")
	window.$=OpenLayers.Util.getElement;
OpenLayers.Util.extend= function(a,b) {
	a=a|| {};
	if(b) {
		for(var c in b) {
			var d=b[c];
			if(d!==undefined)
				a[c]=d
		}
		c=typeof window.Event=="function"&&b instanceof window.Event;
		if(!c&&b.hasOwnProperty&&b.hasOwnProperty("toString"))
			a.toString=b.toString
	}
	return a
};
OpenLayers.Util.removeItem= function(a,b) {
	for(var c=a.length-1;c>=0;c--)
		a[c]==b&&a.splice(c,1);
	return a
};
OpenLayers.Util.clearArray= function(a) {
	OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", {
		newMethod:"array = []"
	}));
	a.length=0
};
OpenLayers.Util.indexOf= function(a,b) {
	for(var c=0,d=a.length;c<d;c++)
		if(a[c]==b)
			return c;
	return-1
};
OpenLayers.Util.modifyDOMElement= function(a,b,c,d,e,f,g,h) {
	if(b)
		a.id=b;
	if(c) {
		a.style.left=c.x+"px";
		a.style.top=c.y+"px"
	}
	if(d) {
		a.style.width=d.w+"px";
		a.style.height=d.h+"px"
	}
	if(e)
		a.style.position=e;
	if(f)
		a.style.border=f;
	if(g)
		a.style.overflow=g;
	if(parseFloat(h)>=0&&parseFloat(h)<1) {
		a.style.filter="alpha(opacity="+h*100+")";
		a.style.opacity=h
	} else if(parseFloat(h)==1) {
		a.style.filter="";
		a.style.opacity=""
	}
};
OpenLayers.Util.createDiv= function(a,b,c,d,e,f,g,h) {
	var i=document.createElement("div");
	if(d)
		i.style.backgroundImage="url("+d+")";
	a||(a=OpenLayers.Util.createUniqueID("OpenLayersDiv"));
	e||(e="absolute");
	OpenLayers.Util.modifyDOMElement(i,a,b,c,e,f,g,h);
	return i
};
OpenLayers.Util.createImage= function(a,b,c,d,e,f,g,h) {
	var i=document.createElement("img");
	a||(a=OpenLayers.Util.createUniqueID("OpenLayersDiv"));
	e||(e="relative");
	OpenLayers.Util.modifyDOMElement(i,a,b,c,e,f,null,g);
	if(h) {
		i.style.display="none";
		OpenLayers.Event.observe(i,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,i));
		OpenLayers.Event.observe(i,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,i))
	}
	i.style.alt=a;
	i.galleryImg="no";
	if(d)
		i.src=d;
	return i
};
OpenLayers.Util.setOpacity= function(a,b) {
	OpenLayers.Util.modifyDOMElement(a,null,null,null,null,null,null,b)
};
OpenLayers.Util.onImageLoad= function() {
	if(!this.viewRequestID||this.map&&this.viewRequestID==this.map.viewRequestID) {
		this.style.backgroundColor="transparent";
		this.style.display=""
	}
};
OpenLayers.Util.onImageLoadErrorColor="pink";
OpenLayers.IMAGE_RELOAD_ATTEMPTS=0;
OpenLayers.Util.onImageLoadError= function() {
	this._attempts=this._attempts?this._attempts+1:1;
	if(this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS) {
		var a=this.urls;
		if(a&&a instanceof Array&&a.length>1) {
			var b=this.src.toString(),c,d;
			for(d=0;c=a[d];d++)
				if(b.indexOf(c)!=-1)
					break;
			var e=Math.floor(a.length*Math.random());
			e=a[e];
			for(d=0;e==c&&d++<4;) {
				e=Math.floor(a.length*Math.random());
				e=a[e]
			}
			this.src=b.replace(c,e)
		} else
			this.src=this.src
	} else
		this.style.backgroundColor=OpenLayers.Util.onImageLoadErrorColor;
	this.style.display=""
};
OpenLayers.Util.alphaHackNeeded=null;
OpenLayers.Util.alphaHack= function() {
	if(OpenLayers.Util.alphaHackNeeded==null) {
		var a=navigator.appVersion.split("MSIE");
		a=parseFloat(a[1]);
		var b=false;
		try {
			b=!!document.body.filters
		} catch(c) {
		}
		OpenLayers.Util.alphaHackNeeded=b&&a>=5.5&&a<7
	}
	return OpenLayers.Util.alphaHackNeeded
};
OpenLayers.Util.modifyAlphaImageDiv= function(a,b,c,d,e,f,g,h,i) {
	OpenLayers.Util.modifyDOMElement(a,b,c,d,f,null,null,i);
	b=a.childNodes[0];
	if(e)
		b.src=e;
	OpenLayers.Util.modifyDOMElement(b,a.id+"_innerImage",null,d,"relative",g);
	if(OpenLayers.Util.alphaHack()) {
		if(a.style.display!="none")
			a.style.display="inline-block";
		if(h==null)
			h="scale";
		a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b.src+"', sizingMethod='"+h+"')";
		if(parseFloat(a.style.opacity)>=0&&parseFloat(a.style.opacity)<
		1)
			a.style.filter+=" alpha(opacity="+a.style.opacity*100+")";
		b.style.filter="alpha(opacity=0)"
	}
};
OpenLayers.Util.createAlphaImageDiv= function(a,b,c,d,e,f,g,h,i) {
	var j=OpenLayers.Util.createDiv(),l=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);
	j.appendChild(l);
	if(i) {
		l.style.display="none";
		OpenLayers.Event.observe(l,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,j));
		OpenLayers.Event.observe(l,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,j))
	}
	OpenLayers.Util.modifyAlphaImageDiv(j,a,b,c,d,e,f,g,h);
	return j
};
OpenLayers.Util.upperCaseObject= function(a) {
	var b= {};
	for(var c in a)
		b[c.toUpperCase()]=a[c];
	return b
};
OpenLayers.Util.applyDefaults= function(a,b) {
	a=a|| {};
	var c=typeof window.Event=="function"&&b instanceof window.Event;
	for(var d in b)
		if(a[d]===undefined||!c&&b.hasOwnProperty&&b.hasOwnProperty(d)&&!a.hasOwnProperty(d))
			a[d]=b[d];
	if(!c&&b&&b.hasOwnProperty&&b.hasOwnProperty("toString")&&!a.hasOwnProperty("toString"))
		a.toString=b.toString;
	return a
};
OpenLayers.Util.getParameterString= function(a) {
	var b=[];
	for(var c in a) {
		var d=a[c];
		if(d!=null&&typeof d!="function") {
			if(typeof d=="object"&&d.constructor==Array) {
				for(var e=[],f=0,g=d.length;f<g;f++)
					e.push(encodeURIComponent(d[f]));
				d=e.join(",")
			} else
				d=encodeURIComponent(d);
			b.push(encodeURIComponent(c)+"="+d)
		}
	}
	return b.join("&")
};
OpenLayers.ImgPath="";
OpenLayers.Util.getImagesLocation= function() {
	return OpenLayers.ImgPath||OpenLayers._getScriptLocation()+"img/"
};
OpenLayers.Util.Try= function() {
	for(var a=null,b=0,c=arguments.length;b<c;b++) {
		var d=arguments[b];
		try {
			a=d();
			break
		} catch(e) {
		}
	}
	return a
};
OpenLayers.Util.getNodes= function(a,b) {
	var c=OpenLayers.Util.Try( function() {
		return OpenLayers.Util._getNodes(a.documentElement.childNodes,b)
	}, function() {
		return OpenLayers.Util._getNodes(a.childNodes,b)
	});
	return c
};
OpenLayers.Util._getNodes= function(a,b) {
	for(var c=[],d=0,e=a.length;d<e;d++)
		a[d].nodeName==b&&c.push(a[d]);
	return c
};
OpenLayers.Util.getTagText= function(a,b,c) {
	if((a=OpenLayers.Util.getNodes(a,b))&&a.length>0) {
		c||(c=0);
		if(a[c].childNodes.length>1)
			return a.childNodes[1].nodeValue;
		else if(a[c].childNodes.length==1)
			return a[c].firstChild.nodeValue
	} else
		return""
};
OpenLayers.Util.getXmlNodeValue= function(a) {
	var b=null;
	OpenLayers.Util.Try( function() {
		b=a.text;
		if(!b)
			b=a.textContent;
		if(!b)
			b=a.firstChild.nodeValue
	}, function() {
		b=a.textContent
	});
	return b
};
OpenLayers.Util.mouseLeft= function(a,b) {
	for(a=a.relatedTarget?a.relatedTarget:a.toElement;a!=b&&a!=null;)
		a=a.parentNode;
	return a!=b
};
OpenLayers.Util.DEFAULT_PRECISION=14;
OpenLayers.Util.toFloat= function(a,b) {
	if(b==null)
		b=OpenLayers.Util.DEFAULT_PRECISION;
	return a=b==0?parseFloat(a):parseFloat(parseFloat(a).toPrecision(b))
};
OpenLayers.Util.rad= function(a) {
	return a*Math.PI/180
};
OpenLayers.Util.distVincenty= function(a,b) {
	var c=6378137,d=6356752.3142,e=1/298.257223563,f=OpenLayers.Util.rad(b.lon-a.lon);
	a=Math.atan((1-e)*Math.tan(OpenLayers.Util.rad(a.lat)));
	var g=Math.atan((1-e)*Math.tan(OpenLayers.Util.rad(b.lat)));
	b=Math.sin(a);
	a=Math.cos(a);
	var h=Math.sin(g);
	g=Math.cos(g);
	for(var i=f,j=2*Math.PI,l=20;Math.abs(i-j)>1.0E-12&&--l>0;) {
		var k=Math.sin(i),n=Math.cos(i),m=Math.sqrt(g*k*g*k+(a*h-b*g*n)*(a*h-b*g*n));
		if(m==0)
			return 0;
		var o=b*h+a*g*n;
		n=Math.atan2(m,o);
		var p=Math.asin(a*
		g*k/m),r=Math.cos(p)*Math.cos(p);
		k=o-2*b*h/r;
		var q=e/16*r*(4+e*(4-3*r));
		j=i;
		i=f+(1-q)*e*Math.sin(p)*(n+q*m*(k+q*o*(-1+2*k*k)))
	}
	if(l==0)
		return NaN;
	e=r*(c*c-d*d)/(d*d);
	c=1+e/16384*(4096+e*(-768+e*(320-175*e)));
	e=e/1024*(256+e*(-128+e*(74-47*e)));
	m=e*m*(k+e/4*(o*(-1+2*k*k)-e/6*k*(-3+4*m*m)*(-3+4*k*k)));
	d=d*c*(n-m);
	return d=d.toFixed(3)/1000
};
OpenLayers.Util.getParameters= function(a) {
	a=a||window.location.href;
	var b="";
	if(OpenLayers.String.contains(a,"?")) {
		b=a.indexOf("?")+1;
		var c=OpenLayers.String.contains(a,"#")?a.indexOf("#"):a.length;
		b=a.substring(b,c)
	}
	a= {};
	b=b.split(/[&;]/);
	c=0;
	for(var d=b.length;c<d;++c) {
		var e=b[c].split("=");
		if(e[0]) {
			var f=decodeURIComponent(e[0]);
			e=e[1]||"";
			e=e.split(",");
			for(var g=0,h=e.length;g<h;g++)
				e[g]=decodeURIComponent(e[g]);
			if(e.length==1)
				e=e[0];
			a[f]=e
		}
	}
	return a
};
OpenLayers.Util.getArgs= function(a) {
	OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated", {
		newMethod:"OpenLayers.Util.getParameters"
	}));
	return OpenLayers.Util.getParameters(a)
};
OpenLayers.Util.lastSeqID=0;
OpenLayers.Util.createUniqueID= function(a) {
	if(a==null)
		a="id_";
	OpenLayers.Util.lastSeqID+=1;
	return a+OpenLayers.Util.lastSeqID
};
OpenLayers.INCHES_PER_UNIT= {
	inches:1,
	ft:12,
	mi:63360,
	m:39.3701,
	km:39370.1,
	dd:4374754,
	yd:36
};
OpenLayers.INCHES_PER_UNIT["in"]=OpenLayers.INCHES_PER_UNIT.inches;
OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd;
OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m;
OpenLayers.METERS_PER_INCH=0.0254000508001016;
OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT, {
	Inch:OpenLayers.INCHES_PER_UNIT.inches,
	Meter:1/OpenLayers.METERS_PER_INCH,
	Foot:0.3048006096012192/OpenLayers.METERS_PER_INCH,
	IFoot:0.3048/OpenLayers.METERS_PER_INCH,
	ClarkeFoot:0.3047972651151/OpenLayers.METERS_PER_INCH,
	SearsFoot:0.30479947153867626/OpenLayers.METERS_PER_INCH,
	GoldCoastFoot:0.3047997101815088/OpenLayers.METERS_PER_INCH,
	IInch:0.0254/OpenLayers.METERS_PER_INCH,
	MicroInch:2.54E-5/OpenLayers.METERS_PER_INCH,
	Mil:2.54E-8/OpenLayers.METERS_PER_INCH,
	Centimeter:0.01/OpenLayers.METERS_PER_INCH,
	Kilometer:1000/OpenLayers.METERS_PER_INCH,
	Yard:0.9144018288036576/OpenLayers.METERS_PER_INCH,
	SearsYard:0.914398414616029/OpenLayers.METERS_PER_INCH,
	IndianYard:0.9143985307444408/OpenLayers.METERS_PER_INCH,
	IndianYd37:0.91439523/OpenLayers.METERS_PER_INCH,
	IndianYd62:0.9143988/OpenLayers.METERS_PER_INCH,
	IndianYd75:0.9143985/OpenLayers.METERS_PER_INCH,
	IndianFoot:0.30479951/OpenLayers.METERS_PER_INCH,
	IndianFt37:0.30479841/OpenLayers.METERS_PER_INCH,
	IndianFt62:0.3047996/
	OpenLayers.METERS_PER_INCH,
	IndianFt75:0.3047995/OpenLayers.METERS_PER_INCH,
	Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,
	IYard:0.9144/OpenLayers.METERS_PER_INCH,
	IMile:1609.344/OpenLayers.METERS_PER_INCH,
	NautM:1852/OpenLayers.METERS_PER_INCH,
	"Lat-66":110943.31648893273/OpenLayers.METERS_PER_INCH,
	"Lat-83":110946.25736872235/OpenLayers.METERS_PER_INCH,
	Decimeter:0.1/OpenLayers.METERS_PER_INCH,
	Millimeter:0.0010/OpenLayers.METERS_PER_INCH,
	Dekameter:10/OpenLayers.METERS_PER_INCH,
	Decameter:10/OpenLayers.METERS_PER_INCH,
	Hectometer:100/OpenLayers.METERS_PER_INCH,
	GermanMeter:1.0000135965/OpenLayers.METERS_PER_INCH,
	CaGrid:0.999738/OpenLayers.METERS_PER_INCH,
	ClarkeChain:20.1166194976/OpenLayers.METERS_PER_INCH,
	GunterChain:20.11684023368047/OpenLayers.METERS_PER_INCH,
	BenoitChain:20.116782494375872/OpenLayers.METERS_PER_INCH,
	SearsChain:20.11676512155/OpenLayers.METERS_PER_INCH,
	ClarkeLink:0.201166194976/OpenLayers.METERS_PER_INCH,
	GunterLink:0.2011684023368047/OpenLayers.METERS_PER_INCH,
	BenoitLink:0.20116782494375873/OpenLayers.METERS_PER_INCH,
	SearsLink:0.2011676512155/OpenLayers.METERS_PER_INCH,
	Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,
	IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,
	IntnlLink:0.201168/OpenLayers.METERS_PER_INCH,
	Perch:5.02921005842012/OpenLayers.METERS_PER_INCH,
	Pole:5.02921005842012/OpenLayers.METERS_PER_INCH,
	Furlong:201.1684023368046/OpenLayers.METERS_PER_INCH,
	Rood:3.778266898/OpenLayers.METERS_PER_INCH,
	CapeFoot:0.3047972615/OpenLayers.METERS_PER_INCH,
	Brealey:375/OpenLayers.METERS_PER_INCH,
	ModAmFt:0.304812252984506/
	OpenLayers.METERS_PER_INCH,
	Fathom:1.8288/OpenLayers.METERS_PER_INCH,
	"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,
	"50kilometers":50000/OpenLayers.METERS_PER_INCH,
	"150kilometers":150000/OpenLayers.METERS_PER_INCH
});
OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT, {
	mm:OpenLayers.INCHES_PER_UNIT.Meter/1000,
	cm:OpenLayers.INCHES_PER_UNIT.Meter/100,
	dm:OpenLayers.INCHES_PER_UNIT.Meter*100,
	km:OpenLayers.INCHES_PER_UNIT.Meter*1000,
	kmi:OpenLayers.INCHES_PER_UNIT.nmi,
	fath:OpenLayers.INCHES_PER_UNIT.Fathom,
	ch:OpenLayers.INCHES_PER_UNIT.IntnlChain,
	link:OpenLayers.INCHES_PER_UNIT.IntnlLink,
	"us-in":OpenLayers.INCHES_PER_UNIT.inches,
	"us-ft":OpenLayers.INCHES_PER_UNIT.Foot,
	"us-yd":OpenLayers.INCHES_PER_UNIT.Yard,
	"us-ch":OpenLayers.INCHES_PER_UNIT.GunterChain,
	"us-mi":OpenLayers.INCHES_PER_UNIT.Mile,
	"ind-yd":OpenLayers.INCHES_PER_UNIT.IndianYd37,
	"ind-ft":OpenLayers.INCHES_PER_UNIT.IndianFt37,
	"ind-ch":20.11669506/OpenLayers.METERS_PER_INCH
});
OpenLayers.DOTS_PER_INCH=72;
OpenLayers.Util.normalizeScale= function(a) {
	return a=a>1?1/a:a
};
OpenLayers.Util.getResolutionFromScale= function(a,b) {
	if(b==null)
		b="degrees";
	a=OpenLayers.Util.normalizeScale(a);
	return b=1/(a*OpenLayers.INCHES_PER_UNIT[b]*OpenLayers.DOTS_PER_INCH)
};
OpenLayers.Util.getScaleFromResolution= function(a,b) {
	if(b==null)
		b="degrees";
	return a=a*OpenLayers.INCHES_PER_UNIT[b]*OpenLayers.DOTS_PER_INCH
};
OpenLayers.Util.safeStopPropagation= function(a) {
	OpenLayers.Event.stop(a,true)
};
OpenLayers.Util.pagePosition= function(a) {
	for(var b=0,c=0,d=a,e=a;d;) {
		if(d==document.body)
			if(OpenLayers.Element.getStyle(e,"position")=="absolute")
				break;
		b+=d.offsetTop||0;
		c+=d.offsetLeft||0;
		e=d;
		try {
			d=d.offsetParent
		} catch(f) {
			OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed", {
				elemId:d.id
			}));
			break
		}
	}
	for(d=a;d;) {
		b-=d.scrollTop||0;
		c-=d.scrollLeft||0;
		d=d.parentNode
	}
	return[c,b]
};
OpenLayers.Util.isEquivalentUrl= function(a,b,c) {
	c=c|| {};
	OpenLayers.Util.applyDefaults(c, {
		ignoreCase:true,
		ignorePort80:true,
		ignoreHash:true
	});
	a=OpenLayers.Util.createUrlObject(a,c);
	b=OpenLayers.Util.createUrlObject(b,c);
	for(var d in a)
		if(d!=="args")
			if(a[d]!=b[d])
				return false;
	for(d in a.args) {
		if(a.args[d]!=b.args[d])
			return false;
		delete b.args[d]
	}
	for(d in b.args)
		return false;
	return true
};
OpenLayers.Util.createUrlObject= function(a,b) {
	b=b|| {};
	if(!/^\w+:\/\//.test(a)) {
		var c=window.location,d=c.port?":"+c.port:"";
		d=c.protocol+"//"+c.host.split(":").shift()+d;
		if(a.indexOf("/")===0)
			a=d+a;
		else {
			c=c.pathname.split("/");
			c.pop();
			a=d+c.join("/")+"/"+a
		}
	}
	if(b.ignoreCase)
		a=a.toLowerCase();
	c=document.createElement("a");
	c.href=a;
	d= {};
	d.host=c.host.split(":").shift();
	d.protocol=c.protocol;
	d.port=b.ignorePort80?c.port=="80"||c.port=="0"?"":c.port:c.port==""||c.port=="0"?"80":c.port;
	d.hash=b.ignoreHash||
	c.hash==="#"?"":c.hash;
	b=c.search;
	if(!b) {
		b=a.indexOf("?");
		b=b!=-1?a.substr(b):""
	}
	d.args=OpenLayers.Util.getParameters(b);
	d.pathname=c.pathname.charAt(0)=="/"?c.pathname:"/"+c.pathname;
	return d
};
OpenLayers.Util.removeTail= function(a) {
	var b=null;
	b=a.indexOf("?");
	var c=a.indexOf("#");
	return b=b==-1?c!=-1?a.substr(0,c):a:c!=-1?a.substr(0,Math.min(b,c)):a.substr(0,b)
};
OpenLayers.Util.getBrowserName= function() {
	var a="",b=navigator.userAgent.toLowerCase();
	if(b.indexOf("opera")!=-1)
		a="opera";
	else if(b.indexOf("msie")!=-1)
		a="msie";
	else if(b.indexOf("safari")!=-1)
		a="safari";
	else if(b.indexOf("mozilla")!=-1)
		a=b.indexOf("firefox")!=-1?"firefox":"mozilla";
	return a
};
OpenLayers.Util.getRenderedDimensions= function(a,b,c) {
	var d,e,f=document.createElement("div");
	f.style.visibility="hidden";
	var g=c&&c.containerElement?c.containerElement:document.body;
	if(b)
		if(b.w) {
			d=b.w;
			f.style.width=d+"px"
		} else if(b.h) {
			e=b.h;
			f.style.height=e+"px"
		}
	if(c&&c.displayClass)
		f.className=c.displayClass;
	b=document.createElement("div");
	b.innerHTML=a;
	b.style.overflow="visible";
	if(b.childNodes) {
		a=0;
		for(c=b.childNodes.length;a<c;a++)
			if(b.childNodes[a].style)
				b.childNodes[a].style.overflow="visible"
	}
	f.appendChild(b);
	g.appendChild(f);
	a=false;
	for(c=f.parentNode;c&&c.tagName.toLowerCase()!="body";) {
		var h=OpenLayers.Element.getStyle(c,"position");
		if(h=="absolute") {
			a=true;
			break
		} else if(h&&h!="static")
			break;
		c=c.parentNode
	}
	if(!a)
		f.style.position="absolute";
	if(!d) {
		d=parseInt(b.scrollWidth);
		f.style.width=d+"px"
	}
	e||(e=parseInt(b.scrollHeight));
	f.removeChild(b);
	g.removeChild(f);
	return new OpenLayers.Size(d,e)
};
OpenLayers.Util.getScrollbarWidth= function() {
	var a=OpenLayers.Util._scrollbarWidth;
	if(a==null) {
		var b=null,c=null;
		b=a=0;
		b=document.createElement("div");
		b.style.position="absolute";
		b.style.top="-1000px";
		b.style.left="-1000px";
		b.style.width="100px";
		b.style.height="50px";
		b.style.overflow="hidden";
		c=document.createElement("div");
		c.style.width="100%";
		c.style.height="200px";
		b.appendChild(c);
		document.body.appendChild(b);
		a=c.offsetWidth;
		b.style.overflow="scroll";
		b=c.offsetWidth;
		document.body.removeChild(document.body.lastChild);
		OpenLayers.Util._scrollbarWidth=a-b;
		a=OpenLayers.Util._scrollbarWidth
	}
	return a
};
OpenLayers.Rico= {};
OpenLayers.Rico.Corner= {
	round: function(a,b) {
		a=OpenLayers.Util.getElement(a);
		this._setOptions(b);
		b=this.options.color;
		if(this.options.color=="fromElement")
			b=this._background(a);
		var c=this.options.bgColor;
		if(this.options.bgColor=="fromParent")
			c=this._background(a.offsetParent);
		this._roundCornersImpl(a,b,c)
	},
	changeColor: function(a,b) {
		a.style.backgroundColor=b;
		a=a.parentNode.getElementsByTagName("span");
		for(var c=0;c<a.length;c++)
			a[c].style.backgroundColor=b
	},
	changeOpacity: function(a,b) {
		var c=b;
		b="alpha(opacity="+
		b*100+")";
		a.style.opacity=c;
		a.style.filter=b;
		a=a.parentNode.getElementsByTagName("span");
		for(var d=0;d<a.length;d++) {
			a[d].style.opacity=c;
			a[d].style.filter=b
		}
	},
	reRound: function(a,b) {
		var c=a.parentNode.childNodes[0],d=a.parentNode.childNodes[2];
		a.parentNode.removeChild(c);
		a.parentNode.removeChild(d);
		this.round(a.parentNode,b)
	},
	_roundCornersImpl: function(a,b,c) {
		this.options.border&&this._renderBorder(a,c);
		this._isTopRounded()&&this._roundTopCorners(a,b,c);
		this._isBottomRounded()&&this._roundBottomCorners(a,
		b,c)
	},
	_renderBorder: function(a,b) {
		var c="1px solid "+this._borderColor(b);
		b="border-left: "+c;
		c="border-right: "+c;
		b="style='"+b+";"+c+"'";
		a.innerHTML="<div "+b+">"+a.innerHTML+"</div>"
	},
	_roundTopCorners: function(a,b,c) {
		for(var d=this._createCorner(c),e=0;e<this.options.numSlices;e++)
			d.appendChild(this._createCornerSlice(b,c,e,"top"));
		a.style.paddingTop=0;
		a.insertBefore(d,a.firstChild)
	},
	_roundBottomCorners: function(a,b,c) {
		for(var d=this._createCorner(c),e=this.options.numSlices-1;e>=0;e--)
			d.appendChild(this._createCornerSlice(b,
			c,e,"bottom"));
		a.style.paddingBottom=0;
		a.appendChild(d)
	},
	_createCorner: function(a) {
		var b=document.createElement("div");
		b.style.backgroundColor=this._isTransparent()?"transparent":a;
		return b
	},
	_createCornerSlice: function(a,b,c,d) {
		var e=document.createElement("span"),f=e.style;
		f.backgroundColor=a;
		f.display="block";
		f.height="1px";
		f.overflow="hidden";
		f.fontSize="1px";
		a=this._borderColor(a,b);
		if(this.options.border&&c==0) {
			f.borderTopStyle="solid";
			f.borderTopWidth="1px";
			f.borderLeftWidth="0px";
			f.borderRightWidth=
			"0px";
			f.borderBottomWidth="0px";
			f.height="0px";
			f.borderColor=a
		} else if(a) {
			f.borderColor=a;
			f.borderStyle="solid";
			f.borderWidth="0px 1px"
		}
		if(!this.options.compact&&c==this.options.numSlices-1)
			f.height="2px";
		this._setMargin(e,c,d);
		this._setBorder(e,c,d);
		return e
	},
	_setOptions: function(a) {
		this.options= {
			corners:"all",
			color:"fromElement",
			bgColor:"fromParent",
			blend:true,
			border:false,
			compact:false
		};
		OpenLayers.Util.extend(this.options,a|| {});
		this.options.numSlices=this.options.compact?2:4;
		if(this._isTransparent())
			this.options.blend=
			false
	},
	_whichSideTop: function() {
		if(this._hasString(this.options.corners,"all","top"))
			return"";
		if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0)
			return"";
		if(this.options.corners.indexOf("tl")>=0)
			return"left";
		else if(this.options.corners.indexOf("tr")>=0)
			return"right";
		return""
	},
	_whichSideBottom: function() {
		if(this._hasString(this.options.corners,"all","bottom"))
			return"";
		if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0)
			return"";
		if(this.options.corners.indexOf("bl")>=
		0)
			return"left";
		else if(this.options.corners.indexOf("br")>=0)
			return"right";
		return""
	},
	_borderColor: function(a,b) {
		return a=="transparent"?b:this.options.border?this.options.border:this.options.blend?this._blend(b,a):""
	},
	_setMargin: function(a,b,c) {
		b=this._marginSize(b);
		c=c=="top"?this._whichSideTop():this._whichSideBottom();
		if(c=="left") {
			a.style.marginLeft=b+"px";
			a.style.marginRight="0px"
		} else if(c=="right") {
			a.style.marginRight=b+"px";
			a.style.marginLeft="0px"
		} else {
			a.style.marginLeft=b+"px";
			a.style.marginRight=
			b+"px"
		}
	},
	_setBorder: function(a,b,c) {
		b=this._borderSize(b);
		c=c=="top"?this._whichSideTop():this._whichSideBottom();
		if(c=="left") {
			a.style.borderLeftWidth=b+"px";
			a.style.borderRightWidth="0px"
		} else if(c=="right") {
			a.style.borderRightWidth=b+"px";
			a.style.borderLeftWidth="0px"
		} else {
			a.style.borderLeftWidth=b+"px";
			a.style.borderRightWidth=b+"px"
		}
		if(this.options.border!=false) {
			a.style.borderLeftWidth=b+"px";
			a.style.borderRightWidth=b+"px"
		}
	},
	_marginSize: function(a) {
		if(this._isTransparent())
			return 0;
		var b=[5,
		3,2,1],c=[3,2,1,0],d=[2,1],e=[1,0];
		return this.options.compact&&this.options.blend?e[a]:this.options.compact?d[a]:this.options.blend?c[a]:b[a]
	},
	_borderSize: function(a) {
		var b=[5,3,2,1],c=[2,1,1,1],d=[1,0],e=[0,2,0,0];
		if(this.options.compact&&(this.options.blend||this._isTransparent()))
			return 1;
		else if(this.options.compact)
			return d[a];
		else if(this.options.blend)
			return c[a];
		else if(this.options.border)
			return e[a];
		else if(this._isTransparent())
			return b[a];
		return 0
	},
	_hasString: function(a) {
		for(var b=1;b<
		arguments.length;b++)
			if(a.indexOf(arguments[b])>=0)
				return true;
		return false
	},
	_blend: function(a,b) {
		a=OpenLayers.Rico.Color.createFromHex(a);
		a.blend(OpenLayers.Rico.Color.createFromHex(b));
		return a
	},
	_background: function(a) {
		try {
			return OpenLayers.Rico.Color.createColorFromBackground(a).asHex()
		} catch(b) {
			return"#ffffff"
		}
	},
	_isTransparent: function() {
		return this.options.color=="transparent"
	},
	_isTopRounded: function() {
		return this._hasString(this.options.corners,"all","top","tl","tr")
	},
	_isBottomRounded: function() {
		return this._hasString(this.options.corners,
		"all","bottom","bl","br")
	},
	_hasSingleTextChild: function(a) {
		return a.childNodes.length==1&&a.childNodes[0].nodeType==3
	}
};
OpenLayers.Element= {
	visible: function(a) {
		return OpenLayers.Util.getElement(a).style.display!="none"
	},
	toggle: function() {
		for(var a=0,b=arguments.length;a<b;a++) {
			var c=OpenLayers.Util.getElement(arguments[a]),d=OpenLayers.Element.visible(c)?"hide":"show";
			OpenLayers.Element[d](c)
		}
	},
	hide: function() {
		for(var a=0,b=arguments.length;a<b;a++) {
			var c=OpenLayers.Util.getElement(arguments[a]);
			c.style.display="none"
		}
	},
	show: function() {
		for(var a=0,b=arguments.length;a<b;a++) {
			var c=OpenLayers.Util.getElement(arguments[a]);
			c.style.display=""
		}
	},
	remove: function(a) {
		a=OpenLayers.Util.getElement(a);
		a.parentNode.removeChild(a)
	},
	getHeight: function(a) {
		a=OpenLayers.Util.getElement(a);
		return a.offsetHeight
	},
	getDimensions: function(a) {
		a=OpenLayers.Util.getElement(a);
		if(OpenLayers.Element.getStyle(a,"display")!="none")
			return {
				width:a.offsetWidth,
				height:a.offsetHeight
			};
		var b=a.style,c=b.visibility,d=b.position;
		b.visibility="hidden";
		b.position="absolute";
		b.display="";
		var e=a.clientWidth;
		a=a.clientHeight;
		b.display="none";
		b.position=
		d;
		b.visibility=c;
		return {
			width:e,
			height:a
		}
	},
	hasClass: function(a,b) {
		a=a.className;
		return!!a&&(new RegExp("(^|\\s)"+b+"(\\s|$)")).test(a)
	},
	addClass: function(a,b) {
		OpenLayers.Element.hasClass(a,b)||(a.className+=(a.className?" ":"")+b);
		return a
	},
	removeClass: function(a,b) {
		var c=a.className;
		if(c)
			a.className=OpenLayers.String.trim(c.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," "));
		return a
	},
	toggleClass: function(a,b) {OpenLayers.Element.hasClass(a,b)?OpenLayers.Element.removeClass(a,b):OpenLayers.Element.addClass(a,
		b);
		return a
	},
	getStyle: function(a,b) {
		a=OpenLayers.Util.getElement(a);
		var c=null;
		if(a&&a.style) {
			c=a.style[OpenLayers.String.camelize(b)];
			if(!c)
				if(document.defaultView&&document.defaultView.getComputedStyle)
					c=(c=document.defaultView.getComputedStyle(a,null))?c.getPropertyValue(b):null;
				else if(a.currentStyle)
					c=a.currentStyle[OpenLayers.String.camelize(b)];
			var d=["left","top","right","bottom"];
			if(window.opera&&OpenLayers.Util.indexOf(d,b)!=-1&&OpenLayers.Element.getStyle(a,"position")=="static")
				c="auto"
		}
		return c==
		"auto"?null:c
	}
};
OpenLayers.Size=OpenLayers.Class({
	w:0,
	h:0,
	initialize: function(a,b) {
		this.w=parseFloat(a);
		this.h=parseFloat(b)
	},
	toString: function() {
		return"w="+this.w+",h="+this.h
	},
	clone: function() {
		return new OpenLayers.Size(this.w,this.h)
	},
	equals: function(a) {
		var b=false;
		if(a!=null)
			b=this.w==a.w&&this.h==a.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(a.w)&&isNaN(a.h);
		return b
	},
	CLASS_NAME:"OpenLayers.Size"
});
OpenLayers.Console= {
	log: function() {
	},
	debug: function() {
	},
	info: function() {
	},
	warn: function() {
	},
	error: function() {
	},
	userError: function(a) {
		alert(a)
	},
	assert: function() {
	},
	dir: function() {
	},
	dirxml: function() {
	},
	trace: function() {
	},
	group: function() {
	},
	groupEnd: function() {
	},
	time: function() {
	},
	timeEnd: function() {
	},
	profile: function() {
	},
	profileEnd: function() {
	},
	count: function() {
	},
	CLASS_NAME:"OpenLayers.Console"
};
(function() {
	for(var a=document.getElementsByTagName("script"),b=0,c=a.length;b<c;++b)
		if(a[b].src.indexOf("firebug.js")!=-1)
			if(console) {
				OpenLayers.Util.extend(OpenLayers.Console,console);
				break
			}
})();
OpenLayers.Icon=OpenLayers.Class({
	url:null,
	size:null,
	offset:null,
	calculateOffset:null,
	imageDiv:null,
	px:null,
	initialize: function(a,b,c,d) {
		this.url=a;
		this.size=b?b:new OpenLayers.Size(20,20);
		this.offset=c?c:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));
		this.calculateOffset=d;
		a=OpenLayers.Util.createUniqueID("OL_Icon_");
		this.imageDiv=OpenLayers.Util.createAlphaImageDiv(a)
	},
	destroy: function() {
		this.erase();
		OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);
		this.imageDiv.innerHTML=
		"";
		this.imageDiv=null
	},
	clone: function() {
		return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)
	},
	setSize: function(a) {
		if(a!=null)
			this.size=a;
		this.draw()
	},
	setUrl: function(a) {
		if(a!=null)
			this.url=a;
		this.draw()
	},
	draw: function(a) {
		OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");
		this.moveTo(a);
		return this.imageDiv
	},
	erase: function() {
		this.imageDiv!=null&&this.imageDiv.parentNode!=null&&OpenLayers.Element.remove(this.imageDiv)
	},
	setOpacity: function(a) {
		OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,
		null,null,null,null,null,null,null,a)
	},
	moveTo: function(a) {
		if(a!=null)
			this.px=a;
		if(this.imageDiv!=null)
			if(this.px==null)
				this.display(false);
			else {
				if(this.calculateOffset)
					this.offset=this.calculateOffset(this.size);
				a=this.px.offset(this.offset);
				OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,a)
			}
	},
	display: function(a) {
		this.imageDiv.style.display=a?"":"none"
	},
	isDrawn: function() {
		var a=this.imageDiv&&this.imageDiv.parentNode&&this.imageDiv.parentNode.nodeType!=11;
		return a
	},
	CLASS_NAME:"OpenLayers.Icon"
});
OpenLayers.Popup=OpenLayers.Class({
	events:null,
	id:"",
	lonlat:null,
	div:null,
	contentSize:null,
	size:null,
	contentHTML:null,
	backgroundColor:"",
	opacity:"",
	border:"",
	contentDiv:null,
	groupDiv:null,
	closeDiv:null,
	autoSize:false,
	minSize:null,
	maxSize:null,
	displayClass:"olPopup",
	contentDisplayClass:"olPopupContent",
	padding:0,
	disableFirefoxOverflowHack:false,
	fixPadding: function() {
		if(typeof this.padding=="number")
			this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding)
	},
	panMapIfOutOfView:false,
	keepInMap:false,
	closeOnMove:false,
	map:null,
	initialize: function(a,b,c,d,e,f) {
		if(a==null)
			a=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
		this.id=a;
		this.lonlat=b;
		this.contentSize=c!=null?c:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);
		if(d!=null)
			this.contentHTML=d;
		this.backgroundColor=OpenLayers.Popup.COLOR;
		this.opacity=OpenLayers.Popup.OPACITY;
		this.border=OpenLayers.Popup.BORDER;
		this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");
		this.div.className=
		this.displayClass;
		a=this.id+"_GroupDiv";
		this.groupDiv=OpenLayers.Util.createDiv(a,null,null,null,"relative",null,"hidden");
		a=this.div.id+"_contentDiv";
		this.contentDiv=OpenLayers.Util.createDiv(a,null,this.contentSize.clone(),null,"relative");
		this.contentDiv.className=this.contentDisplayClass;
		this.groupDiv.appendChild(this.contentDiv);
		this.div.appendChild(this.groupDiv);
		e&&this.addCloseBox(f);
		this.registerEvents()
	},
	destroy: function() {
		this.border=this.opacity=this.backgroundColor=this.contentHTML=this.size=
		this.lonlat=this.id=null;
		this.closeOnMove&&this.map&&this.map.events.unregister("movestart",this,this.hide);
		this.events.destroy();
		this.events=null;
		if(this.closeDiv) {
			OpenLayers.Event.stopObservingElement(this.closeDiv);
			this.groupDiv.removeChild(this.closeDiv)
		}
		this.closeDiv=null;
		this.div.removeChild(this.groupDiv);
		this.groupDiv=null;
		this.map!=null&&this.map.removePopup(this);
		this.panMapIfOutOfView=this.padding=this.maxSize=this.minSize=this.autoSize=this.div=this.map=null
	},
	draw: function(a) {
		if(a==null)
			if(this.lonlat!=
			null&&this.map!=null)
				a=this.map.getLayerPxFromLonLat(this.lonlat);
		this.closeOnMove&&this.map.events.register("movestart",this,this.hide);
		if(!this.disableFirefoxOverflowHack&&OpenLayers.Util.getBrowserName()=="firefox") {
			this.map.events.register("movestart",this, function() {
				var b=document.defaultView.getComputedStyle(this.contentDiv,null);
				b=b.getPropertyValue("overflow");
				if(b!="hidden") {
					this.contentDiv._oldOverflow=b;
					this.contentDiv.style.overflow="hidden"
				}
			});
			this.map.events.register("moveend",this, function() {
				var b=this.contentDiv._oldOverflow;
				if(b) {
					this.contentDiv.style.overflow=b;
					this.contentDiv._oldOverflow=null
				}
			})
		}
		this.moveTo(a);
		!this.autoSize&&!this.size&&this.setSize(this.contentSize);
		this.setBackgroundColor();
		this.setOpacity();
		this.setBorder();
		this.setContentHTML();
		this.panMapIfOutOfView&&this.panIntoView();
		return this.div
	},
	updatePosition: function() {
		if(this.lonlat&&this.map) {
			var a=this.map.getLayerPxFromLonLat(this.lonlat);
			a&&this.moveTo(a)
		}
	},
	moveTo: function(a) {
		if(a!=null&&this.div!=
		null) {
			this.div.style.left=a.x+"px";
			this.div.style.top=a.y+"px"
		}
	},
	visible: function() {
		return OpenLayers.Element.visible(this.div)
	},
	toggle: function() {this.visible()?this.hide():this.show()
	},
	show: function() {
		OpenLayers.Element.show(this.div);
		this.panMapIfOutOfView&&this.panIntoView()
	},
	hide: function() {
		OpenLayers.Element.hide(this.div)
	},
	setSize: function(a) {
		this.size=a.clone();
		var b=this.getContentDivPadding(),c=b.left+b.right,d=b.top+b.bottom;
		this.fixPadding();
		c+=this.padding.left+this.padding.right;
		d+=
		this.padding.top+this.padding.bottom;
		if(this.closeDiv) {
			var e=parseInt(this.closeDiv.style.width);
			c+=e+b.right
		}
		this.size.w+=c;
		this.size.h+=d;
		if(OpenLayers.Util.getBrowserName()=="msie") {
			this.contentSize.w+=b.left+b.right;
			this.contentSize.h+=b.bottom+b.top
		}
		if(this.div!=null) {
			this.div.style.width=this.size.w+"px";
			this.div.style.height=this.size.h+"px"
		}
		if(this.contentDiv!=null) {
			this.contentDiv.style.width=a.w+"px";
			this.contentDiv.style.height=a.h+"px"
		}
	},
	updateSize: function() {
		var a="<div class='"+this.contentDisplayClass+
		"'>"+this.contentDiv.innerHTML+"</div>",b=this.map?this.map.layerContainerDiv:document.body,c=OpenLayers.Util.getRenderedDimensions(a,null, {
			displayClass:this.displayClass,
			containerElement:b
		}),d=this.getSafeContentSize(c),e=null;
		if(d.equals(c))
			e=c;
		else {
			e=new OpenLayers.Size;
			e.w=d.w<c.w?d.w:null;
			e.h=d.h<c.h?d.h:null;
			if(e.w&&e.h)
				e=d;
			else {
				a=OpenLayers.Util.getRenderedDimensions(a,e, {
					displayClass:this.contentDisplayClass,
					containerElement:b
				});
				b=OpenLayers.Element.getStyle(this.contentDiv,"overflow");
				if(b!=
				"hidden"&&a.equals(d)) {
					d=OpenLayers.Util.getScrollbarWidth();
					if(e.w)
						a.h+=d;
					else
						a.w+=d
				}
				e=this.getSafeContentSize(a)
			}
		}
		this.setSize(e)
	},
	setBackgroundColor: function(a) {
		if(a!=undefined)
			this.backgroundColor=a;
		if(this.div!=null)
			this.div.style.backgroundColor=this.backgroundColor
	},
	setOpacity: function(a) {
		if(a!=undefined)
			this.opacity=a;
		if(this.div!=null) {
			this.div.style.opacity=this.opacity;
			this.div.style.filter="alpha(opacity="+this.opacity*100+")"
		}
	},
	setBorder: function(a) {
		if(a!=undefined)
			this.border=a;
		if(this.div!=
		null)
			this.div.style.border=this.border
	},
	setContentHTML: function(a) {
		if(a!=null)
			this.contentHTML=a;
		if(this.contentDiv!=null&&this.contentHTML!=null&&this.contentHTML!=this.contentDiv.innerHTML) {
			this.contentDiv.innerHTML=this.contentHTML;
			if(this.autoSize) {
				this.registerImageListeners();
				this.updateSize()
			}
		}
	},
	registerImageListeners: function() {
		function a() {
			this.popup.updateSize();
			this.popup.visible()&&this.popup.panMapIfOutOfView&&this.popup.panIntoView();
			OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad)
		}

		for(var b=this.contentDiv.getElementsByTagName("img"),c=0,d=b.length;c<d;c++) {
			var e=b[c];
			if(e.width==0||e.height==0) {
				var f= {
					popup:this,
					img:e
				};
				e._onImgLoad=OpenLayers.Function.bind(a,f);
				OpenLayers.Event.observe(e,"load",e._onImgLoad)
			}
		}
	},
	getSafeContentSize: function(a) {
		a=a.clone();
		var b=this.getContentDivPadding(),c=b.left+b.right,d=b.top+b.bottom;
		this.fixPadding();
		c+=this.padding.left+this.padding.right;
		d+=this.padding.top+this.padding.bottom;
		if(this.closeDiv) {
			var e=parseInt(this.closeDiv.style.width);
			c+=e+b.right
		}
		if(this.minSize) {
			a.w=Math.max(a.w,this.minSize.w-c);
			a.h=Math.max(a.h,this.minSize.h-d)
		}
		if(this.maxSize) {
			a.w=Math.min(a.w,this.maxSize.w-c);
			a.h=Math.min(a.h,this.maxSize.h-d)
		}
		if(this.map&&this.map.size) {
			e=b=0;
			if(this.keepInMap&&!this.panMapIfOutOfView) {
				e=this.map.getPixelFromLonLat(this.lonlat);
				switch(this.relativePosition) {
					case "tr":
						b=e.x;
						e=this.map.size.h-e.y;
						break;
					case "tl":
						b=this.map.size.w-e.x;
						e=this.map.size.h-e.y;
						break;
					case "bl":
						b=this.map.size.w-e.x;
						e=e.y;
						break;
					case "br":
						b=e.x;
						e=e.y;
						break;
					default:
						b=e.x;
						e=this.map.size.h-e.y;
						break
				}
			}
			d=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-d-e;
			c=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-c-b;
			a.w=Math.min(a.w,c);
			a.h=Math.min(a.h,d)
		}
		return a
	},
	getContentDivPadding: function() {
		var a=this._contentDivPadding;
		if(!a) {
			if(this.div.parentNode==null) {
				this.div.style.display="none";
				document.body.appendChild(this.div)
			}
			this._contentDivPadding=a=new OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,
			"padding-left"),OpenLayers.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv,"padding-top"));
			if(this.div.parentNode==document.body) {
				document.body.removeChild(this.div);
				this.div.style.display=""
			}
		}
		return a
	},
	addCloseBox: function(a) {
		this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new OpenLayers.Size(17,17));
		this.closeDiv.className="olPopupCloseBox";
		var b=this.getContentDivPadding();
		this.closeDiv.style.right=b.right+"px";
		this.closeDiv.style.top=b.top+"px";
		this.groupDiv.appendChild(this.closeDiv);
		a=a||
		function(c) {
			this.hide();
			OpenLayers.Event.stop(c)
		};

		OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(a,this))
	},
	panIntoView: function() {
		var a=this.map.getSize(),b=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top))),c=b.clone();
		if(b.x<this.map.paddingForPopups.left)
			c.x=this.map.paddingForPopups.left;
		else if(b.x+this.size.w>a.w-this.map.paddingForPopups.right)
			c.x=a.w-this.map.paddingForPopups.right-this.size.w;
		if(b.y<this.map.paddingForPopups.top)
			c.y=this.map.paddingForPopups.top;
		else if(b.y+this.size.h>a.h-this.map.paddingForPopups.bottom)
			c.y=a.h-this.map.paddingForPopups.bottom-this.size.h;
		a=b.x-c.x;
		b=b.y-c.y;
		this.map.pan(a,b)
	},
	registerEvents: function() {
		this.events=new OpenLayers.Events(this,this.div,null,true);
		this.events.on({
			mousedown:this.onmousedown,
			mousemove:this.onmousemove,
			mouseup:this.onmouseup,
			click:this.onclick,
			mouseout:this.onmouseout,
			dblclick:this.ondblclick,
			scope:this
		})
	},
	onmousedown: function(a) {
		this.mousedown=true;
		OpenLayers.Event.stop(a,true)
	},
	onmousemove: function(a) {
		this.mousedown&&OpenLayers.Event.stop(a,true)
	},
	onmouseup: function(a) {
		if(this.mousedown) {
			this.mousedown=false;
			OpenLayers.Event.stop(a,true)
		}
	},
	onclick: function(a) {
		OpenLayers.Event.stop(a,true)
	},
	onmouseout: function() {
		this.mousedown=false
	},
	ondblclick: function(a) {
		OpenLayers.Event.stop(a,true)
	},
	CLASS_NAME:"OpenLayers.Popup"
});
OpenLayers.Popup.WIDTH=200;
OpenLayers.Popup.HEIGHT=200;
OpenLayers.Popup.COLOR="white";
OpenLayers.Popup.OPACITY=1;
OpenLayers.Popup.BORDER="0px";
OpenLayers.Protocol=OpenLayers.Class({
	format:null,
	options:null,
	autoDestroy:true,
	initialize: function(a) {
		a=a|| {};
		OpenLayers.Util.extend(this,a);
		this.options=a
	},
	destroy: function() {
		this.format=this.options=null
	},
	read: function() {
	},
	create: function() {
	},
	update: function() {
	},
	"delete": function() {
	},
	commit: function() {
	},
	abort: function() {
	},
	CLASS_NAME:"OpenLayers.Protocol"
});
OpenLayers.Protocol.Response=OpenLayers.Class({
	code:null,
	requestType:null,
	last:true,
	features:null,
	reqFeatures:null,
	priv:null,
	initialize: function(a) {
		OpenLayers.Util.extend(this,a)
	},
	success: function() {
		return this.code>0
	},
	CLASS_NAME:"OpenLayers.Protocol.Response"
});
OpenLayers.Protocol.Response.SUCCESS=1;
OpenLayers.Protocol.Response.FAILURE=0;
OpenLayers.Renderer=OpenLayers.Class({
	container:null,
	root:null,
	extent:null,
	locked:false,
	size:null,
	resolution:null,
	map:null,
	initialize: function(a) {
		this.container=OpenLayers.Util.getElement(a)
	},
	destroy: function() {
		this.map=this.resolution=this.size=this.extent=this.container=null
	},
	supported: function() {
		return false
	},
	setExtent: function(a,b) {
		this.extent=a.clone();
		if(b)
			this.resolution=null
	},
	setSize: function(a) {
		this.size=a.clone();
		this.resolution=null
	},
	getResolution: function() {
		return this.resolution=this.resolution||
		this.map.getResolution()
	},
	drawFeature: function(a,b) {
		if(b==null)
			b=a.style;
		if(a.geometry) {
			var c=a.geometry.getBounds();
			if(c) {
				c.intersectsBounds(this.extent)||(b= {
						display:"none"
					});
				c=this.drawGeometry(a.geometry,b,a.id);b.display!="none"&&b.label&&c!==false?this.drawText(a.id,b,a.geometry.getCentroid()):this.removeText(a.id);
				return c
			}
		}
	},
	drawGeometry: function() {
	},
	drawText: function() {
	},
	removeText: function() {
	},
	clear: function() {
	},
	getFeatureIdFromEvent: function() {
	},
	eraseFeatures: function(a) {
		a instanceof Array||
		(a=[a]);
		for(var b=0,c=a.length;b<c;++b) {
			this.eraseGeometry(a[b].geometry);
			this.removeText(a[b].id)
		}
	},
	eraseGeometry: function() {
	},
	moveRoot: function() {
	},
	getRenderLayerId: function() {
		return this.container.id
	},
	CLASS_NAME:"OpenLayers.Renderer"
});
OpenLayers.Strategy=OpenLayers.Class({
	layer:null,
	options:null,
	active:null,
	autoActivate:true,
	autoDestroy:true,
	initialize: function(a) {
		OpenLayers.Util.extend(this,a);
		this.options=a;
		this.active=false
	},
	destroy: function() {
		this.deactivate();
		this.options=this.layer=null
	},
	setLayer: function(a) {
		this.layer=a
	},
	activate: function() {
		if(!this.active)
			return this.active=true;
		return false
	},
	deactivate: function() {
		if(this.active) {
			this.active=false;
			return true
		}
		return false
	},
	CLASS_NAME:"OpenLayers.Strategy"
});
OpenLayers.Bounds=OpenLayers.Class({
	left:null,
	bottom:null,
	right:null,
	top:null,
	centerLonLat:null,
	initialize: function(a,b,c,d) {
		if(a!=null)
			this.left=OpenLayers.Util.toFloat(a);
		if(b!=null)
			this.bottom=OpenLayers.Util.toFloat(b);
		if(c!=null)
			this.right=OpenLayers.Util.toFloat(c);
		if(d!=null)
			this.top=OpenLayers.Util.toFloat(d)
	},
	clone: function() {
		return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)
	},
	equals: function(a) {
		var b=false;
		if(a!=null)
			b=this.left==a.left&&this.right==a.right&&this.top==
			a.top&&this.bottom==a.bottom;
		return b
	},
	toString: function() {
		return"left-bottom=("+this.left+","+this.bottom+") right-top=("+this.right+","+this.top+")"
	},
	toArray: function() {
		return[this.left,this.bottom,this.right,this.top]
	},
	toBBOX: function(a) {
		if(a==null)
			a=6;
		a=Math.pow(10,a);
		return a=Math.round(this.left*a)/a+","+Math.round(this.bottom*a)/a+","+Math.round(this.right*a)/a+","+Math.round(this.top*a)/a
	},
	toGeometry: function() {
		return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,
		this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])])
	},
	getWidth: function() {
		return this.right-this.left
	},
	getHeight: function() {
		return this.top-this.bottom
	},
	getSize: function() {
		return new OpenLayers.Size(this.getWidth(),this.getHeight())
	},
	getCenterPixel: function() {
		return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)
	},
	getCenterLonLat: function() {
		if(!this.centerLonLat)
			this.centerLonLat=
			new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2);
		return this.centerLonLat
	},
	scale: function(a,b) {
		if(b==null)
			b=this.getCenterLonLat();
		var c,d;
		if(b.CLASS_NAME=="OpenLayers.LonLat") {
			c=b.lon;
			d=b.lat
		} else {
			c=b.x;
			d=b.y
		}
		b=(this.left-c)*a+c;
		var e=(this.bottom-d)*a+d;
		c=(this.right-c)*a+c;
		a=(this.top-d)*a+d;
		return new OpenLayers.Bounds(b,e,c,a)
	},
	add: function(a,b) {
		if(a==null||b==null) {
			a=OpenLayers.i18n("boundsAddError");
			OpenLayers.Console.error(a);
			return null
		}
		return new OpenLayers.Bounds(this.left+
		a,this.bottom+b,this.right+a,this.top+b)
	},
	extend: function(a) {
		var b=null;
		if(a) {
			switch(a.CLASS_NAME) {
				case "OpenLayers.LonLat":
					b=new OpenLayers.Bounds(a.lon,a.lat,a.lon,a.lat);
					break;
				case "OpenLayers.Geometry.Point":
					b=new OpenLayers.Bounds(a.x,a.y,a.x,a.y);
					break;
				case "OpenLayers.Bounds":
					b=a;
					break
			}
			if(b) {
				this.centerLonLat=null;
				if(this.left==null||b.left<this.left)
					this.left=b.left;
				if(this.bottom==null||b.bottom<this.bottom)
					this.bottom=b.bottom;
				if(this.right==null||b.right>this.right)
					this.right=b.right;
				if(this.top==
				null||b.top>this.top)
					this.top=b.top
			}
		}
	},
	containsLonLat: function(a,b) {
		return this.contains(a.lon,a.lat,b)
	},
	containsPixel: function(a,b) {
		return this.contains(a.x,a.y,b)
	},
	contains: function(a,b,c) {
		if(c==null)
			c=true;
		if(a==null||b==null)
			return false;
		a=OpenLayers.Util.toFloat(a);
		b=OpenLayers.Util.toFloat(b);
		var d=false;
		return d=c?a>=this.left&&a<=this.right&&b>=this.bottom&&b<=this.top:a>this.left&&a<this.right&&b>this.bottom&&b<this.top
	},
	intersectsBounds: function(a,b) {
		if(b==null)
			b=true;
		var c=false,d=this.left==
		a.right||this.right==a.left||this.top==a.bottom||this.bottom==a.top;
		if(b||!d) {
			b=a.bottom>=this.bottom&&a.bottom<=this.top||this.bottom>=a.bottom&&this.bottom<=a.top;
			c=a.top>=this.bottom&&a.top<=this.top||this.top>a.bottom&&this.top<a.top;
			d=a.left>=this.left&&a.left<=this.right||this.left>=a.left&&this.left<=a.right;
			a=a.right>=this.left&&a.right<=this.right||this.right>=a.left&&this.right<=a.right;
			c=(b||c)&&(d||a)
		}
		return c
	},
	containsBounds: function(a,b,c) {
		if(b==null)
			b=false;
		if(c==null)
			c=true;
		var d=
		this.contains(a.left,a.bottom,c),e=this.contains(a.right,a.bottom,c),f=this.contains(a.left,a.top,c);
		a=this.contains(a.right,a.top,c);
		return b?d||e||f||a:d&&e&&f&&a
	},
	determineQuadrant: function(a) {
		var b="",c=this.getCenterLonLat();
		b+=a.lat<c.lat?"b":"t";
		b+=a.lon<c.lon?"l":"r";
		return b
	},
	transform: function(a,b) {
		this.centerLonLat=null;
		var c=OpenLayers.Projection.transform({
			x:this.left,
			y:this.bottom
		},a,b),d=OpenLayers.Projection.transform({
			x:this.right,
			y:this.bottom
		},a,b),e=OpenLayers.Projection.transform({
			x:this.left,
			y:this.top
		},a,b);
		a=OpenLayers.Projection.transform({
			x:this.right,
			y:this.top
		},a,b);
		this.left=Math.min(c.x,e.x);
		this.bottom=Math.min(c.y,d.y);
		this.right=Math.max(d.x,a.x);
		this.top=Math.max(e.y,a.y);
		return this
	},
	wrapDateLine: function(a,b) {
		b=b|| {};
		var c=b.leftTolerance||0;
		b=b.rightTolerance||0;
		var d=this.clone();
		if(a) {
			for(;d.left<a.left&&d.right-b<=a.left;)
				d=d.add(a.getWidth(),0);
			for(;d.left+c>=a.right&&d.right>a.right;)
				d=d.add(-a.getWidth(),0)
		}
		return d
	},
	CLASS_NAME:"OpenLayers.Bounds"
});
OpenLayers.Bounds.fromString= function(a) {
	a=a.split(",");
	return OpenLayers.Bounds.fromArray(a)
};
OpenLayers.Bounds.fromArray= function(a) {
	return new OpenLayers.Bounds(parseFloat(a[0]),parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3]))
};
OpenLayers.Bounds.fromSize= function(a) {
	return new OpenLayers.Bounds(0,a.h,a.w,0)
};
OpenLayers.Bounds.oppositeQuadrant= function(a) {
	var b="";
	b+=a.charAt(0)=="t"?"b":"t";
	b+=a.charAt(1)=="l"?"r":"l";
	return b
};
OpenLayers.LonLat=OpenLayers.Class({
	lon:0,
	lat:0,
	initialize: function(a,b) {
		this.lon=OpenLayers.Util.toFloat(a);
		this.lat=OpenLayers.Util.toFloat(b)
	},
	toString: function() {
		return"lon="+this.lon+",lat="+this.lat
	},
	toShortString: function() {
		return this.lon+", "+this.lat
	},
	clone: function() {
		return new OpenLayers.LonLat(this.lon,this.lat)
	},
	add: function(a,b) {
		if(a==null||b==null) {
			a=OpenLayers.i18n("lonlatAddError");
			OpenLayers.Console.error(a);
			return null
		}
		return new OpenLayers.LonLat(this.lon+a,this.lat+b)
	},
	equals: function(a) {
		var b=
		false;
		if(a!=null)
			b=this.lon==a.lon&&this.lat==a.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(a.lon)&&isNaN(a.lat);
		return b
	},
	transform: function(a,b) {
		a=OpenLayers.Projection.transform({
			x:this.lon,
			y:this.lat
		},a,b);
		this.lon=a.x;
		this.lat=a.y;
		return this
	},
	wrapDateLine: function(a) {
		var b=this.clone();
		if(a) {
			for(;b.lon<a.left;)
				b.lon+=a.getWidth();
			for(;b.lon>a.right;)
				b.lon-=a.getWidth()
		}
		return b
	},
	CLASS_NAME:"OpenLayers.LonLat"
});
OpenLayers.LonLat.fromString= function(a) {
	a=a.split(",");
	return new OpenLayers.LonLat(parseFloat(a[0]),parseFloat(a[1]))
};
OpenLayers.Pixel=OpenLayers.Class({
	x:0,
	y:0,
	initialize: function(a,b) {
		this.x=parseFloat(a);
		this.y=parseFloat(b)
	},
	toString: function() {
		return"x="+this.x+",y="+this.y
	},
	clone: function() {
		return new OpenLayers.Pixel(this.x,this.y)
	},
	equals: function(a) {
		var b=false;
		if(a!=null)
			b=this.x==a.x&&this.y==a.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y);
		return b
	},
	add: function(a,b) {
		if(a==null||b==null) {
			a=OpenLayers.i18n("pixelAddError");
			OpenLayers.Console.error(a);
			return null
		}
		return new OpenLayers.Pixel(this.x+
		a,this.y+b)
	},
	offset: function(a) {
		var b=this.clone();
		if(a)
			b=this.add(a.x,a.y);
		return b
	},
	CLASS_NAME:"OpenLayers.Pixel"
});
OpenLayers.Control=OpenLayers.Class({
	id:null,
	map:null,
	div:null,
	type:null,
	allowSelection:false,
	displayClass:"",
	title:"",
	active:null,
	handler:null,
	eventListeners:null,
	events:null,
	EVENT_TYPES:["activate","deactivate"],
	initialize: function(a) {
		this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");
		OpenLayers.Util.extend(this,a);
		this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);
		this.eventListeners instanceof Object&&this.events.on(this.eventListeners);
		if(this.id==null)
			this.id=
			OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")
	},
	destroy: function() {
		if(this.events) {
			this.eventListeners&&this.events.un(this.eventListeners);
			this.events.destroy();
			this.events=null
		}
		this.eventListeners=null;
		if(this.handler) {
			this.handler.destroy();
			this.handler=null
		}
		if(this.handlers) {
			for(var a in this.handlers)
				this.handlers.hasOwnProperty(a)&&typeof this.handlers[a].destroy=="function"&&this.handlers[a].destroy();
			this.handlers=null
		}
		if(this.map) {
			this.map.removeControl(this);
			this.map=null
		}
	},
	setMap: function(a) {
		this.map=
		a;
		this.handler&&this.handler.setMap(a)
	},
	draw: function(a) {
		if(this.div==null) {
			this.div=OpenLayers.Util.createDiv(this.id);
			this.div.className=this.displayClass;
			if(!this.allowSelection) {
				this.div.className+=" olControlNoSelect";
				this.div.setAttribute("unselectable","on",0);
				this.div.onselectstart= function() {
					return false
				}
			}
			if(this.title!="")
				this.div.title=this.title
		}
		if(a!=null)
			this.position=a.clone();
		this.moveTo(this.position);
		return this.div
	},
	moveTo: function(a) {
		if(a!=null&&this.div!=null) {
			this.div.style.left=
			a.x+"px";
			this.div.style.top=a.y+"px"
		}
	},
	activate: function() {
		if(this.active)
			return false;
		this.handler&&this.handler.activate();
		this.active=true;
		this.map&&OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active");
		this.events.triggerEvent("activate");
		return true
	},
	deactivate: function() {
		if(this.active) {
			this.handler&&this.handler.deactivate();
			this.active=false;
			this.map&&OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active");
			this.events.triggerEvent("deactivate");
			return true
		}
		return false
	},
	CLASS_NAME:"OpenLayers.Control"
});
OpenLayers.Control.TYPE_BUTTON=1;
OpenLayers.Control.TYPE_TOGGLE=2;
OpenLayers.Control.TYPE_TOOL=3;
OpenLayers.Lang= {
	code:null,
	defaultCode:"en",
	getCode: function() {
		OpenLayers.Lang.code||OpenLayers.Lang.setCode();
		return OpenLayers.Lang.code
	},
	setCode: function(a) {
		var b;
		a||(a=OpenLayers.Util.getBrowserName()=="msie"?navigator.userLanguage:navigator.language);
		a=a.split("-");
		a[0]=a[0].toLowerCase();
		if(typeof OpenLayers.Lang[a[0]]=="object")
			b=a[0];
		if(a[1]) {
			var c=a[0]+"-"+a[1].toUpperCase();
			if(typeof OpenLayers.Lang[c]=="object")
				b=c
		}
		if(!b) {
			OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+a.join("-")+
			" dictionary, falling back to default language");
			b=OpenLayers.Lang.defaultCode
		}
		OpenLayers.Lang.code=b
	},
	translate: function(a,b) {
		var c=OpenLayers.Lang[OpenLayers.Lang.getCode()];
		(c=c[a])||(c=a);
		if(b)
			c=OpenLayers.String.format(c,b);
		return c
	}
};
OpenLayers.i18n=OpenLayers.Lang.translate;
OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup, {
	relativePosition:null,
	keepInMap:true,
	anchor:null,
	initialize: function(a,b,c,d,e,f,g) {
		a=[a,b,c,d,f,g];
		OpenLayers.Popup.prototype.initialize.apply(this,a);
		this.anchor=e!=null?e: {
			size:new OpenLayers.Size(0,0),
			offset:new OpenLayers.Pixel(0,0)
		}
	},
	destroy: function() {
		this.relativePosition=this.anchor=null;
		OpenLayers.Popup.prototype.destroy.apply(this,arguments)
	},
	show: function() {
		this.updatePosition();
		OpenLayers.Popup.prototype.show.apply(this,arguments)
	},
	moveTo: function(a) {
		var b=this.relativePosition;
		this.relativePosition=this.calculateRelativePosition(a);
		a=this.calculateNewPx(a);
		a=new Array(a);
		OpenLayers.Popup.prototype.moveTo.apply(this,a);
		this.relativePosition!=b&&this.updateRelativePosition()
	},
	setSize: function() {
		OpenLayers.Popup.prototype.setSize.apply(this,arguments);
		if(this.lonlat&&this.map) {
			var a=this.map.getLayerPxFromLonLat(this.lonlat);
			this.moveTo(a)
		}
	},
	calculateRelativePosition: function(a) {
		a=this.map.getLonLatFromLayerPx(a);
		var b=this.map.getExtent();
		a=b.determineQuadrant(a);
		return OpenLayers.Bounds.oppositeQuadrant(a)
	},
	updateRelativePosition: function() {
	},
	calculateNewPx: function(a) {
		a=a.offset(this.anchor.offset);
		var b=this.size||this.contentSize,c=this.relativePosition.charAt(0)=="t";
		a.y+=c?-b.h:this.anchor.size.h;
		c=this.relativePosition.charAt(1)=="l";
		a.x+=c?-b.w:this.anchor.size.w;
		return a
	},
	CLASS_NAME:"OpenLayers.Popup.Anchored"
});
OpenLayers.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer, {
	canvas:null,
	features:null,
	geometryMap:null,
	initialize: function() {
		OpenLayers.Renderer.prototype.initialize.apply(this,arguments);
		this.root=document.createElement("canvas");
		this.container.appendChild(this.root);
		this.canvas=this.root.getContext("2d");
		this.features= {};
		this.geometryMap= {}
	},
	eraseGeometry: function(a) {
		this.eraseFeatures(this.features[this.geometryMap[a.id]][0])
	},
	supported: function() {
		var a=document.createElement("canvas");
		return!!a.getContext
	},
	setExtent: function(a) {
		this.extent=a.clone();
		this.resolution=null;
		this.redraw()
	},
	setSize: function(a) {
		this.size=a.clone();
		this.root.style.width=a.w+"px";
		this.root.style.height=a.h+"px";
		this.root.width=a.w;
		this.root.height=a.h;
		this.resolution=null
	},
	drawFeature: function(a,b) {
		if(b==null)
			b=a.style;
		b=OpenLayers.Util.extend({
			fillColor:"#000000",
			strokeColor:"#000000",
			strokeWidth:2,
			fillOpacity:1,
			strokeOpacity:1
		},b);
		this.features[a.id]=[a,b];
		if(a.geometry)
			this.geometryMap[a.geometry.id]=a.id;
		this.redraw()
	},
	drawGeometry: function(a,b) {
		var c=a.CLASS_NAME;
		if(c=="OpenLayers.Geometry.Collection"||c=="OpenLayers.Geometry.MultiPoint"||c=="OpenLayers.Geometry.MultiLineString"||c=="OpenLayers.Geometry.MultiPolygon")
			for(c=0;c<a.components.length;c++)
				this.drawGeometry(a.components[c],b);
		else
			switch(a.CLASS_NAME) {
				case "OpenLayers.Geometry.Point":
					this.drawPoint(a,b);
					break;
				case "OpenLayers.Geometry.LineString":
					this.drawLineString(a,b);
					break;
				case "OpenLayers.Geometry.LinearRing":
					this.drawLinearRing(a,b);
					break;
				case "OpenLayers.Geometry.Polygon":
					this.drawPolygon(a,
					b);
					break;
				default:
					break
			}
	},
	drawExternalGraphic: function(a,b) {
		var c=new Image;
		c.src=b.externalGraphic;
		if(b.graphicTitle)
			c.title=b.graphicTitle;
		var d=b.graphicWidth||b.graphicHeight,e=b.graphicHeight||b.graphicWidth;
		d=d?d:b.pointRadius*2;
		e=e?e:b.pointRadius*2;
		var f=b.graphicXOffset!=undefined?b.graphicXOffset:-(0.5*d);
		b=b.graphicYOffset!=undefined?b.graphicYOffset:-(0.5*e);
		a= {
			img:c,
			x:a[0]+f,
			y:a[1]+b,
			width:d,
			height:e,
			canvas:this.canvas
		};
		c.onload=OpenLayers.Function.bind( function() {
			this.canvas.drawImage(this.img,
			this.x,this.y,this.width,this.height)
		},a)
	},
	setCanvasStyle: function(a,b) {
		if(a=="fill") {
			this.canvas.globalAlpha=b.fillOpacity;
			this.canvas.fillStyle=b.fillColor
		} else if(a=="stroke") {
			this.canvas.globalAlpha=b.strokeOpacity;
			this.canvas.strokeStyle=b.strokeColor;
			this.canvas.lineWidth=b.strokeWidth
		} else {
			this.canvas.globalAlpha=0;
			this.canvas.lineWidth=1
		}
	},
	drawPoint: function(a,b) {
		if(b.graphic!==false) {
			a=this.getLocalXY(a);
			if(b.externalGraphic)
				this.drawExternalGraphic(a,b);
			else {
				if(b.fill!==false) {
					this.setCanvasStyle("fill",
					b);
					this.canvas.beginPath();
					this.canvas.arc(a[0],a[1],6,0,Math.PI*2,true);
					this.canvas.fill()
				}
				if(b.stroke!==false) {
					this.setCanvasStyle("stroke",b);
					this.canvas.beginPath();
					this.canvas.arc(a[0],a[1],6,0,Math.PI*2,true);
					this.canvas.stroke();
					this.setCanvasStyle("reset")
				}
			}
		}
	},
	drawLineString: function(a,b) {
		if(b.stroke!==false) {
			this.setCanvasStyle("stroke",b);
			this.canvas.beginPath();
			b=this.getLocalXY(a.components[0]);
			this.canvas.moveTo(b[0],b[1]);
			for(b=1;b<a.components.length;b++) {
				var c=this.getLocalXY(a.components[b]);
				this.canvas.lineTo(c[0],c[1])
			}
			this.canvas.stroke()
		}
		this.setCanvasStyle("reset")
	},
	drawLinearRing: function(a,b) {
		if(b.fill!==false) {
			this.setCanvasStyle("fill",b);
			this.canvas.beginPath();
			var c=this.getLocalXY(a.components[0]);
			this.canvas.moveTo(c[0],c[1]);
			for(c=1;c<a.components.length-1;c++) {
				var d=this.getLocalXY(a.components[c]);
				this.canvas.lineTo(d[0],d[1])
			}
			this.canvas.fill()
		}
		if(b.stroke!==false) {
			this.setCanvasStyle("stroke",b);
			this.canvas.beginPath();
			c=this.getLocalXY(a.components[0]);
			this.canvas.moveTo(c[0],
			c[1]);
			for(c=1;c<a.components.length;c++) {
				d=this.getLocalXY(a.components[c]);
				this.canvas.lineTo(d[0],d[1])
			}
			this.canvas.stroke()
		}
		this.setCanvasStyle("reset")
	},
	drawPolygon: function(a,b) {
		this.drawLinearRing(a.components[0],b);
		for(b=1;b<a.components.length;b++)
			this.drawLinearRing(a.components[b], {
				fillOpacity:0,
				strokeWidth:0,
				strokeOpacity:0,
				strokeColor:"#000000",
				fillColor:"#000000"
			})
	},
	drawText: function(a,b) {
		b=OpenLayers.Util.extend({
			fontColor:"#000000",
			labelAlign:"cm"
		},b);
		a=this.getLocalXY(a);
		this.setCanvasStyle("reset");
		this.canvas.fillStyle=b.fontColor;
		this.canvas.globalAlpha=1;
		var c=b.fontWeight+" "+b.fontSize+" "+b.fontFamily;
		if(this.canvas.fillText) {
			var d=OpenLayers.Renderer.Canvas.LABEL_ALIGN[b.labelAlign[0]]||"middle";
			this.canvas.font=c;
			this.canvas.textAlign=d;
			this.canvas.fillText(b.label,a[0],a[1])
		} else if(this.canvas.mozDrawText) {
			this.canvas.mozTextStyle=c;
			c=this.canvas.mozMeasureText(b.label);
			switch(b.labelAlign[0]) {
				case "l":
					break;
				case "r":
					a[0]-=c;
					break;
				case "c":
				default:
					a[0]-=c/2
			}
			this.canvas.translate(a[0],
			a[1]);
			this.canvas.mozDrawText(b.label);
			this.canvas.translate(-1*a[0],-1*a[1])
		}
		this.setCanvasStyle("reset")
	},
	getLocalXY: function(a) {
		var b=this.getResolution(),c=this.extent,d=a.x/b+-c.left/b;
		a=c.top/b-a.y/b;
		return[d,a]
	},
	clear: function() {
		this.canvas.clearRect(0,0,this.root.width,this.root.height)
	},
	getFeatureIdFromEvent: function(a) {
		a=this.map.getLonLatFromPixel(a.xy);
		var b=this.getResolution();
		a=new OpenLayers.Bounds(a.lon-b*5,a.lat-b*5,a.lon+b*5,a.lat+b*5);
		a=a.toGeometry();
		for(var c in this.features)
			if(this.features.hasOwnProperty(c))
				if(this.features[c][0].geometry.intersects(a))
					return c;
		return null
	},
	eraseFeatures: function(a) {
		a instanceof Array||(a=[a]);
		for(var b=0;b<a.length;++b)
			delete this.features[a[b].id];
		this.redraw()
	},
	redraw: function() {
		if(!this.locked) {
			this.clear();
			var a=[],b,c;
			for(var d in this.features)
				if(this.features.hasOwnProperty(d)) {
					b=this.features[d][0];
					c=this.features[d][1];
					if(b.geometry) {
						this.drawGeometry(b.geometry,c);
						c.label&&a.push([b,c])
					}
				}
			for(c=0;len=a.length,c<len;++c) {
				b=a[c];
				this.drawText(b[0].geometry.getCentroid(),b[1])
			}
		}
	},
	CLASS_NAME:"OpenLayers.Renderer.Canvas"
});
OpenLayers.Renderer.Canvas.LABEL_ALIGN= {
	l:"left",
	r:"right"
};
OpenLayers.ElementsIndexer=OpenLayers.Class({
	maxZIndex:null,
	order:null,
	indices:null,
	compare:null,
	initialize: function(a) {
		this.compare=a?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;
		this.order=[];
		this.indices= {};
		this.maxZIndex=0
	},
	insert: function(a) {
		this.exists(a)&&this.remove(a);
		var b=a.id;
		this.determineZIndex(a);
		for(var c=-1,d=this.order.length,e;d-c>1;) {
			e=parseInt((c+d)/2);
			var f=this.compare(this,a,OpenLayers.Util.getElement(this.order[e]));
			if(f>0)
				c=e;
			else
				d=e
		}
		this.order.splice(d,0,b);
		this.indices[b]=this.getZIndex(a);
		return this.getNextElement(d)
	},
	remove: function(a) {
		a=a.id;
		var b=OpenLayers.Util.indexOf(this.order,a);
		if(b>=0) {
			this.order.splice(b,1);
			delete this.indices[a];
			if(this.order.length>0) {
				a=this.order[this.order.length-1];
				this.maxZIndex=this.indices[a]
			} else
				this.maxZIndex=0
		}
	},
	clear: function() {
		this.order=[];
		this.indices= {};
		this.maxZIndex=0
	},
	exists: function(a) {
		return this.indices[a.id]!=null
	},
	getZIndex: function(a) {
		return a._style.graphicZIndex
	},
	determineZIndex: function(a) {
		var b=a._style.graphicZIndex;
		if(b==null) {
			b=this.maxZIndex;
			a._style.graphicZIndex=b
		} else if(b>this.maxZIndex)
			this.maxZIndex=b
	},
	getNextElement: function(a) {
		a=a+1;
		if(a<this.order.length) {
			var b=OpenLayers.Util.getElement(this.order[a]);
			if(b==undefined)
				b=this.getNextElement(a);
			return b
		} else
			return null
	},
	CLASS_NAME:"OpenLayers.ElementsIndexer"
});
OpenLayers.ElementsIndexer.IndexingMethods= {
	Z_ORDER: function(a,b,c) {
		b=a.getZIndex(b);
		var d=0;
		if(c) {
			a=a.getZIndex(c);
			d=b-a
		}
		return d
	},
	Z_ORDER_DRAWING_ORDER: function(a,b,c) {
		a=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(a,b,c);
		if(c&&a==0)
			a=1;
		return a
	},
	Z_ORDER_Y_ORDER: function(a,b,c) {
		a=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(a,b,c);
		if(c&&a==0) {
			b=b._geometry.getBounds().bottom;
			c=c._geometry.getBounds().bottom;
			c=c-b;
			a=c==0?1:c
		}
		return a
	}
};
OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer, {
	rendererRoot:null,
	root:null,
	vectorRoot:null,
	textRoot:null,
	xmlns:null,
	indexer:null,
	BACKGROUND_ID_SUFFIX:"_background",
	LABEL_ID_SUFFIX:"_label",
	minimumSymbolizer: {
		strokeLinecap:"round",
		strokeOpacity:1,
		strokeDashstyle:"solid",
		fillOpacity:1,
		pointRadius:0
	},
	initialize: function(a,b) {
		OpenLayers.Renderer.prototype.initialize.apply(this,arguments);
		this.rendererRoot=this.createRenderRoot();
		this.root=this.createRoot("_root");
		this.vectorRoot=this.createRoot("_vroot");
		this.textRoot=this.createRoot("_troot");
		this.root.appendChild(this.vectorRoot);
		this.root.appendChild(this.textRoot);
		this.rendererRoot.appendChild(this.root);
		this.container.appendChild(this.rendererRoot);
		if(b&&(b.zIndexing||b.yOrdering))
			this.indexer=new OpenLayers.ElementsIndexer(b.yOrdering)
	},
	destroy: function() {
		this.clear();
		this.xmlns=this.root=this.rendererRoot=null;
		OpenLayers.Renderer.prototype.destroy.apply(this,arguments)
	},
	clear: function() {
		if(this.vectorRoot)
			for(;this.vectorRoot.childNodes.length>
			0;)
				this.vectorRoot.removeChild(this.vectorRoot.firstChild);
		if(this.textRoot)
			for(;this.textRoot.childNodes.length>0;)
				this.textRoot.removeChild(this.textRoot.firstChild);
		this.indexer&&this.indexer.clear()
	},
	getNodeType: function() {
	},
	drawGeometry: function(a,b,c) {
		var d=a.CLASS_NAME,e=true;
		if(d=="OpenLayers.Geometry.Collection"||d=="OpenLayers.Geometry.MultiPoint"||d=="OpenLayers.Geometry.MultiLineString"||d=="OpenLayers.Geometry.MultiPolygon") {
			d=0;
			for(var f=a.components.length;d<f;d++)
				e=this.drawGeometry(a.components[d],
				b,c)&&e;
			return e
		}
		e=false;
		if(b.display!="none") {
			b.backgroundGraphic&&this.redrawBackgroundNode(a.id,a,b,c);
			e=this.redrawNode(a.id,a,b,c)
		}
		if(e==false)
			if(b=document.getElementById(a.id)) {
				b._style.backgroundGraphic&&b.parentNode.removeChild(document.getElementById(a.id+this.BACKGROUND_ID_SUFFIX));
				b.parentNode.removeChild(b)
			}
		return e
	},
	redrawNode: function(a,b,c,d) {
		a=this.nodeFactory(a,this.getNodeType(b,c));
		a._featureId=d;
		a._geometry=b;
		a._geometryClass=b.CLASS_NAME;
		a._style=c;
		b=this.drawGeometryNode(a,
		b,c);
		if(b===false)
			return false;
		a=b.node;
		if(this.indexer)(c=this.indexer.insert(a))?this.vectorRoot.insertBefore(a,c):this.vectorRoot.appendChild(a);
		else
			a.parentNode!==this.vectorRoot&&this.vectorRoot.appendChild(a);
		this.postDraw(a);
		return b.complete
	},
	redrawBackgroundNode: function(a,b,c) {
		c=OpenLayers.Util.extend({},c);
		c.externalGraphic=c.backgroundGraphic;
		c.graphicXOffset=c.backgroundXOffset;
		c.graphicYOffset=c.backgroundYOffset;
		c.graphicZIndex=c.backgroundGraphicZIndex;
		c.graphicWidth=c.backgroundWidth||
		c.graphicWidth;
		c.graphicHeight=c.backgroundHeight||c.graphicHeight;
		c.backgroundGraphic=null;
		c.backgroundXOffset=null;
		c.backgroundYOffset=null;
		c.backgroundGraphicZIndex=null;
		return this.redrawNode(a+this.BACKGROUND_ID_SUFFIX,b,c,null)
	},
	drawGeometryNode: function(a,b,c) {
		c=c||a._style;
		OpenLayers.Util.applyDefaults(c,this.minimumSymbolizer);
		var d= {
			isFilled:c.fill===undefined?true:c.fill,
			isStroked:c.stroke===undefined?!!c.strokeWidth:c.stroke
		},e;
		switch(b.CLASS_NAME) {
			case "OpenLayers.Geometry.Point":
				if(c.graphic===
				false) {
					d.isFilled=false;
					d.isStroked=false
				}
				e=this.drawPoint(a,b);
				break;
			case "OpenLayers.Geometry.LineString":
				d.isFilled=false;
				e=this.drawLineString(a,b);
				break;
			case "OpenLayers.Geometry.LinearRing":
				e=this.drawLinearRing(a,b);
				break;
			case "OpenLayers.Geometry.Polygon":
				e=this.drawPolygon(a,b);
				break;
			case "OpenLayers.Geometry.Surface":
				e=this.drawSurface(a,b);
				break;
			case "OpenLayers.Geometry.Rectangle":
				e=this.drawRectangle(a,b);
				break;
			default:
				break
		}
		a._style=c;
		a._options=d;
		return e!=false? {
			node:this.setStyle(a,
			c,d,b),
			complete:e
		}:false
	},
	postDraw: function() {
	},
	drawPoint: function() {
	},
	drawLineString: function() {
	},
	drawLinearRing: function() {
	},
	drawPolygon: function() {
	},
	drawRectangle: function() {
	},
	drawCircle: function() {
	},
	drawSurface: function() {
	},
	removeText: function(a) {
		(a=document.getElementById(a+this.LABEL_ID_SUFFIX))&&this.textRoot.removeChild(a)
	},
	getFeatureIdFromEvent: function(a) {
		var b=a.target,c=b&&b.correspondingUseElement;
		a=c?c:b||a.srcElement;
		return a=a._featureId
	},
	eraseGeometry: function(a) {
		if(a.CLASS_NAME==
		"OpenLayers.Geometry.MultiPoint"||a.CLASS_NAME=="OpenLayers.Geometry.MultiLineString"||a.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon"||a.CLASS_NAME=="OpenLayers.Geometry.Collection")
			for(var b=0,c=a.components.length;b<c;b++)
				this.eraseGeometry(a.components[b]);
		else if((b=OpenLayers.Util.getElement(a.id))&&b.parentNode) {
			if(b.geometry) {
				b.geometry.destroy();
				b.geometry=null
			}
			b.parentNode.removeChild(b);
			this.indexer&&this.indexer.remove(b);
			if(b._style.backgroundGraphic) {
				a=a.id+this.BACKGROUND_ID_SUFFIX;
				(a=OpenLayers.Util.getElement(a))&&a.parentNode&&a.parentNode.removeChild(a)
			}
		}
	},
	nodeFactory: function(a,b) {
		var c=OpenLayers.Util.getElement(a);
		if(c) {
			if(!this.nodeTypeCompare(c,b)) {
				c.parentNode.removeChild(c);
				c=this.nodeFactory(a,b)
			}
		} else
			c=this.createNode(b,a);
		return c
	},
	nodeTypeCompare: function() {
	},
	createNode: function() {
	},
	moveRoot: function(a) {
		var b=this.root;
		if(a.root.parentNode==this.rendererRoot)
			b=a.root;
		b.parentNode.removeChild(b);
		a.rendererRoot.appendChild(b)
	},
	getRenderLayerId: function() {
		return this.root.parentNode.parentNode.id
	},
	isComplexSymbol: function(a) {
		return a!="circle"&&!!a
	},
	CLASS_NAME:"OpenLayers.Renderer.Elements"
});
OpenLayers.Renderer.symbol= {
	star:[350,75,379,161,469,161,397,215,423,301,350,250,277,301,303,215,231,161,321,161,350,75],
	cross:[4,0,6,0,6,4,10,4,10,6,6,6,6,10,4,10,4,6,0,6,0,4,4,4,4,0],
	x:[0,0,25,0,50,35,75,0,100,0,65,50,100,100,75,100,50,65,25,100,0,100,35,50,0,0],
	square:[0,0,0,1,1,1,1,0,0,0],
	triangle:[0,10,10,10,5,0,0,10]
};
OpenLayers.Strategy.Cluster=OpenLayers.Class(OpenLayers.Strategy, {
	distance:20,
	threshold:null,
	features:null,
	clusters:null,
	clustering:false,
	resolution:null,
	initialize: function(a) {
		OpenLayers.Strategy.prototype.initialize.apply(this,[a])
	},
	activate: function() {
		var a=OpenLayers.Strategy.prototype.activate.call(this);
		a&&this.layer.events.on({
			beforefeaturesadded:this.cacheFeatures,
			moveend:this.cluster,
			scope:this
		});
		return a
	},
	deactivate: function() {
		var a=OpenLayers.Strategy.prototype.deactivate.call(this);
		if(a) {
			this.clearCache();
			this.layer.events.un({
				beforefeaturesadded:this.cacheFeatures,
				moveend:this.cluster,
				scope:this
			})
		}
		return a
	},
	cacheFeatures: function(a) {
		var b=true;
		if(!this.clustering) {
			this.clearCache();
			this.features=a.features;
			this.cluster();
			b=false
		}
		return b
	},
	clearCache: function() {
		this.features=null
	},
	cluster: function(a) {
		if((!a||a.zoomChanged)&&this.features) {
			a=this.layer.map.getResolution();
			if(a!=this.resolution||!this.clustersExist()) {
				this.resolution=a;
				a=[];
				for(var b,c,d,e=0;e<this.features.length;++e) {
					b=this.features[e];
					if(b.geometry) {
						c=false;
						for(var f=0;f<a.length;++f) {
							d=a[f];
							if(this.shouldCluster(d,b)) {
								this.addToCluster(d,b);
								c=true;
								break
							}
						}
						c||a.push(this.createCluster(this.features[e]))
					}
				}
				this.layer.destroyFeatures();
				if(a.length>0) {
					if(this.threshold>1) {
						b=a.slice();
						a=[];
						e=0;
						for(d=b.length;e<d;++e) {
							c=b[e];c.attributes.count<this.threshold?Array.prototype.push.apply(a,c.cluster):a.push(c)
						}
					}
					this.clustering=true;
					this.layer.addFeatures(a);
					this.clustering=false
				}
				this.clusters=a
			}
		}
	},
	clustersExist: function() {
		var a=false;
		if(this.clusters&&
		this.clusters.length>0&&this.clusters.length==this.layer.features.length) {
			a=true;
			for(var b=0;b<this.clusters.length;++b)
				if(this.clusters[b]!=this.layer.features[b]) {
					a=false;
					break
				}
		}
		return a
	},
	shouldCluster: function(a,b) {
		a=a.geometry.getBounds().getCenterLonLat();
		b=b.geometry.getBounds().getCenterLonLat();
		b=Math.sqrt(Math.pow(a.lon-b.lon,2)+Math.pow(a.lat-b.lat,2))/this.resolution;
		return b<=this.distance
	},
	addToCluster: function(a,b) {
		a.cluster.push(b);
		a.attributes.count+=1
	},
	createCluster: function(a) {
		var b=
		a.geometry.getBounds().getCenterLonLat();
		b=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat), {
			count:1
		});
		b.cluster=[a];
		return b
	},
	CLASS_NAME:"OpenLayers.Strategy.Cluster"
});
OpenLayers.Strategy.Fixed=OpenLayers.Class(OpenLayers.Strategy, {
	preload:false,
	initialize: function(a) {
		OpenLayers.Strategy.prototype.initialize.apply(this,[a])
	},
	destroy: function() {
		OpenLayers.Strategy.prototype.destroy.apply(this,arguments)
	},
	activate: function() {
		if(OpenLayers.Strategy.prototype.activate.apply(this,arguments)) {
			this.layer.events.on({
				refresh:this.load,
				scope:this
			});this.layer.visibility==true||this.preload?this.load():this.layer.events.on({
				visibilitychanged:this.load,
				scope:this
			});
			return true
		}
		return false
	},
	deactivate: function() {
		var a=OpenLayers.Strategy.prototype.deactivate.call(this);
		a&&this.layer.events.un({
			refresh:this.load,
			visibilitychanged:this.load,
			scope:this
		});
		return a
	},
	load: function(a) {
		this.layer.events.triggerEvent("loadstart");
		this.layer.protocol.read(OpenLayers.Util.applyDefaults({
			callback:this.merge,
			scope:this
		},a));
		this.layer.events.un({
			visibilitychanged:this.load,
			scope:this
		})
	},
	merge: function(a) {
		this.layer.destroyFeatures();
		if((a=a.features)&&a.length>0) {
			var b=this.layer.projection,c=this.layer.map.getProjectionObject();
			if(!c.equals(b))
				for(var d,e=0,f=a.length;e<f;++e)
					(d=a[e].geometry)&&d.transform(b,c);
			this.layer.addFeatures(a)
		}
		this.layer.events.triggerEvent("loadend")
	},
	CLASS_NAME:"OpenLayers.Strategy.Fixed"
});
OpenLayers.Tween=OpenLayers.Class({
	INTERVAL:10,
	easing:null,
	begin:null,
	finish:null,
	duration:null,
	callbacks:null,
	time:null,
	interval:null,
	playing:false,
	initialize: function(a) {
		this.easing=a?a:OpenLayers.Easing.Expo.easeOut
	},
	start: function(a,b,c,d) {
		this.playing=true;
		this.begin=a;
		this.finish=b;
		this.duration=c;
		this.callbacks=d.callbacks;
		this.time=0;
		if(this.interval) {
			window.clearInterval(this.interval);
			this.interval=null
		}
		this.callbacks&&this.callbacks.start&&this.callbacks.start.call(this,this.begin);
		this.interval=
		window.setInterval(OpenLayers.Function.bind(this.play,this),this.INTERVAL)
	},
	stop: function() {
		if(this.playing) {
			this.callbacks&&this.callbacks.done&&this.callbacks.done.call(this,this.finish);
			window.clearInterval(this.interval);
			this.interval=null;
			this.playing=false
		}
	},
	play: function() {
		var a= {};
		for(var b in this.begin) {
			var c=this.begin[b],d=this.finish[b];
			if(c==null||d==null||isNaN(c)||isNaN(d))
				OpenLayers.Console.error("invalid value for Tween");
			d=d-c;
			a[b]=this.easing.apply(this,[this.time,c,d,this.duration])
		}
		this.time++;
		this.callbacks&&this.callbacks.eachStep&&this.callbacks.eachStep.call(this,a);
		if(this.time>this.duration) {
			if(this.callbacks&&this.callbacks.done) {
				this.callbacks.done.call(this,this.finish);
				this.playing=false
			}
			window.clearInterval(this.interval);
			this.interval=null
		}
	},
	CLASS_NAME:"OpenLayers.Tween"
});
OpenLayers.Easing= {
	CLASS_NAME:"OpenLayers.Easing"
};
OpenLayers.Easing.Linear= {
	easeIn: function(a,b,c,d) {
		return c*a/d+b
	},
	easeOut: function(a,b,c,d) {
		return c*a/d+b
	},
	easeInOut: function(a,b,c,d) {
		return c*a/d+b
	},
	CLASS_NAME:"OpenLayers.Easing.Linear"
};
OpenLayers.Easing.Expo= {
	easeIn: function(a,b,c,d) {
		return a==0?b:c*Math.pow(2,10*(a/d-1))+b
	},
	easeOut: function(a,b,c,d) {
		return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b
	},
	easeInOut: function(a,b,c,d) {
		if(a==0)
			return b;
		if(a==d)
			return b+c;
		if((a/=d/2)<1)
			return c/2*Math.pow(2,10*(a-1))+b;
		return c/2*(-Math.pow(2,-10*--a)+2)+b
	},
	CLASS_NAME:"OpenLayers.Easing.Expo"
};
OpenLayers.Easing.Quad= {
	easeIn: function(a,b,c,d) {
		return c*(a/=d)*a+b
	},
	easeOut: function(a,b,c,d) {
		return-c*(a/=d)*(a-2)+b
	},
	easeInOut: function(a,b,c,d) {
		if((a/=d/2)<1)
			return c/2*a*a+b;
		return-c/2*(--a*(a-2)-1)+b
	},
	CLASS_NAME:"OpenLayers.Easing.Quad"
};
OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control, {
	center:null,
	zoom:null,
	layers:null,
	displayProjection:null,
	initialize: function() {
		OpenLayers.Control.prototype.initialize.apply(this,arguments)
	},
	setMap: function() {
		OpenLayers.Control.prototype.setMap.apply(this,arguments);
		for(var a=0,b=this.map.controls.length;a<b;a++) {
			var c=this.map.controls[a];
			if(c!=this&&c.CLASS_NAME=="OpenLayers.Control.ArgParser") {
				if(c.displayProjection!=this.displayProjection)
					this.displayProjection=c.displayProjection;
				break
			}
		}
		if(a==this.map.controls.length) {
			a=OpenLayers.Util.getParameters();
			if(a.layers) {
				this.layers=a.layers;
				this.map.events.register("addlayer",this,this.configureLayers);
				this.configureLayers()
			}
			if(a.lat&&a.lon) {
				this.center=new OpenLayers.LonLat(parseFloat(a.lon),parseFloat(a.lat));
				if(a.zoom)
					this.zoom=parseInt(a.zoom);
				this.map.events.register("changebaselayer",this,this.setCenter);
				this.setCenter()
			}
		}
	},
	setCenter: function() {
		if(this.map.baseLayer) {
			this.map.events.unregister("changebaselayer",this,this.setCenter);
			this.displayProjection&&this.center.transform(this.displayProjection,this.map.getProjectionObject());
			this.map.setCenter(this.center,this.zoom)
		}
	},
	configureLayers: function() {
		if(this.layers.length==this.map.layers.length) {
			this.map.events.unregister("addlayer",this,this.configureLayers);
			for(var a=0,b=this.layers.length;a<b;a++) {
				var c=this.map.layers[a],d=this.layers.charAt(a);
				if(d=="B")
					this.map.setBaseLayer(c);
				else if(d=="T"||d=="F")
					c.setVisibility(d=="T")
			}
		}
	},
	CLASS_NAME:"OpenLayers.Control.ArgParser"
});
OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control, {
	separator:", ",
	initialize: function() {
		OpenLayers.Control.prototype.initialize.apply(this,arguments)
	},
	destroy: function() {
		this.map.events.un({
			removelayer:this.updateAttribution,
			addlayer:this.updateAttribution,
			changelayer:this.updateAttribution,
			changebaselayer:this.updateAttribution,
			scope:this
		});
		OpenLayers.Control.prototype.destroy.apply(this,arguments)
	},
	draw: function() {
		OpenLayers.Control.prototype.draw.apply(this,arguments);
		this.map.events.on({
			changebaselayer:this.updateAttribution,
			changelayer:this.updateAttribution,
			addlayer:this.updateAttribution,
			removelayer:this.updateAttribution,
			scope:this
		});
		this.updateAttribution();
		return this.div
	},
	updateAttribution: function() {
		var a=[];
		if(this.map&&this.map.layers) {
			for(var b=0,c=this.map.layers.length;b<c;b++) {
				var d=this.map.layers[b];
				d.attribution&&d.getVisibility()&&a.push(d.attribution)
			}
			this.div.innerHTML=a.join(this.separator)
		}
	},
	CLASS_NAME:"OpenLayers.Control.Attribution"
});
OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control, {
	type:OpenLayers.Control.TYPE_BUTTON,
	trigger: function() {
	},
	CLASS_NAME:"OpenLayers.Control.Button"
});
OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control, {
	activeColor:"darkgreen",
	layerStates:null,
	layersDiv:null,
	baseLayersDiv:null,
	baseLayers:null,
	dataLbl:null,
	dataLayersDiv:null,
	dataLayers:null,
	minimizeDiv:null,
	maximizeDiv:null,
	ascending:true,
	initialize: function() {
		OpenLayers.Control.prototype.initialize.apply(this,arguments);
		this.layerStates=[]
	},
	destroy: function() {
		OpenLayers.Event.stopObservingElement(this.div);
		OpenLayers.Event.stopObservingElement(this.minimizeDiv);
		OpenLayers.Event.stopObservingElement(this.maximizeDiv);
		this.clearLayersArray("base");
		this.clearLayersArray("data");
		this.map.events.un({
			addlayer:this.redraw,
			changelayer:this.redraw,
			removelayer:this.redraw,
			changebaselayer:this.redraw,
			scope:this
		});
		OpenLayers.Control.prototype.destroy.apply(this,arguments)
	},
	setMap: function() {
		OpenLayers.Control.prototype.setMap.apply(this,arguments);
		this.map.events.on({
			addlayer:this.redraw,
			changelayer:this.redraw,
			removelayer:this.redraw,
			changebaselayer:this.redraw,
			scope:this
		})
	},
	draw: function() {
		OpenLayers.Control.prototype.draw.apply(this);
		this.loadContents();
		this.outsideViewport||this.minimizeControl();
		this.redraw();
		return this.div
	},
	clearLayersArray: function(a) {
		var b=this[a+"Layers"];
		if(b)
			for(var c=0,d=b.length;c<d;c++) {
				var e=b[c];
				OpenLayers.Event.stopObservingElement(e.inputElem);
				OpenLayers.Event.stopObservingElement(e.labelSpan)
			}
		this[a+"LayersDiv"].innerHTML="";
		this[a+"Layers"]=[]
	},
	checkRedraw: function() {
		var a=false;
		if(!this.layerStates.length||this.map.layers.length!=this.layerStates.length)
			a=true;
		else
			for(var b=0,c=this.layerStates.length;b<
			c;b++) {
				var d=this.layerStates[b],e=this.map.layers[b];
				if(d.name!=e.name||d.inRange!=e.inRange||d.id!=e.id||d.visibility!=e.visibility) {
					a=true;
					break
				}
			}
		return a
	},
	redraw: function() {
		if(!this.checkRedraw())
			return this.div;
		this.clearLayersArray("base");
		this.clearLayersArray("data");
		var a=false,b=false,c=this.map.layers.length;
		this.layerStates=new Array(c);
		for(var d=0;d<c;d++) {
			var e=this.map.layers[d];
			this.layerStates[d]= {
				name:e.name,
				visibility:e.visibility,
				inRange:e.inRange,
				id:e.id
			}
		}
		var f=this.map.layers.slice();
		this.ascending||f.reverse();
		d=0;
		for(c=f.length;d<c;d++) {
			e=f[d];
			var g=e.isBaseLayer;
			if(e.displayInLayerSwitcher) {
				if(g)
					b=true;
				else
					a=true;
				var h=g?e==this.map.baseLayer:e.getVisibility(),i=document.createElement("input");
				i.id=this.id+"_input_"+e.name;
				i.name=g?"baseLayers":e.name;
				i.type=g?"radio":"checkbox";
				i.value=e.name;
				i.checked=h;
				i.defaultChecked=h;
				if(!g&&!e.inRange)
					i.disabled=true;
				var j= {
					inputElem:i,
					layer:e,
					layerSwitcher:this
				};
				OpenLayers.Event.observe(i,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,
				j));
				h=document.createElement("span");
				if(!g&&!e.inRange)
					h.style.color="gray";
				h.innerHTML=e.name;
				h.style.verticalAlign=g?"bottom":"baseline";
				OpenLayers.Event.observe(h,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,j));
				j=document.createElement("br");
				var l=g?this.baseLayers:this.dataLayers;
				l.push({
					layer:e,
					inputElem:i,
					labelSpan:h
				});
				e=g?this.baseLayersDiv:this.dataLayersDiv;
				e.appendChild(i);
				e.appendChild(h);
				e.appendChild(j)
			}
		}
		this.dataLbl.style.display=a?"":"none";
		this.baseLbl.style.display=
		b?"":"none";
		return this.div
	},
	onInputClick: function(a) {
		if(!this.inputElem.disabled)
			if(this.inputElem.type=="radio") {
				this.inputElem.checked=true;
				this.layer.map.setBaseLayer(this.layer)
			} else {
				this.inputElem.checked=!this.inputElem.checked;
				this.layerSwitcher.updateMap()
			}
		OpenLayers.Event.stop(a)
	},
	onLayerClick: function() {
		this.updateMap()
	},
	updateMap: function() {
		for(var a=0,b=this.baseLayers.length;a<b;a++) {
			var c=this.baseLayers[a];
			c.inputElem.checked&&this.map.setBaseLayer(c.layer,false)
		}
		a=0;
		for(b=this.dataLayers.length;a<
		b;a++) {
			c=this.dataLayers[a];
			c.layer.setVisibility(c.inputElem.checked)
		}
	},
	maximizeControl: function(a) {
		this.div.style.width="35em";
		this.div.style.height="";
		this.showControls(false);
		a!=null&&OpenLayers.Event.stop(a)
	},
	minimizeControl: function(a) {
		this.div.style.width="0px";
		this.div.style.height="0px";
		this.showControls(true);
		a!=null&&OpenLayers.Event.stop(a)
	},
	showControls: function(a) {
		this.maximizeDiv.style.display=a?"":"none";
		this.minimizeDiv.style.display=a?"none":"";
		this.layersDiv.style.display=a?"none":
		""
	},
	loadContents: function() {
		this.div.style.position="absolute";
		this.div.style.top="5px";
		this.div.style.right="0px";
		this.div.style.left="";
		this.div.style.fontFamily="sans-serif";
		this.div.style.fontWeight="bold";
		this.div.style.marginTop="3px";
		this.div.style.marginLeft="3px";
		this.div.style.marginBottom="3px";
		this.div.style.fontSize="smaller";
		this.div.style.color="white";
		this.div.style.backgroundColor="transparent";
		OpenLayers.Event.observe(this.div,"mouseup",OpenLayers.Function.bindAsEventListener(this.mouseUp,
		this));
		OpenLayers.Event.observe(this.div,"click",this.ignoreEvent);
		OpenLayers.Event.observe(this.div,"mousedown",OpenLayers.Function.bindAsEventListener(this.mouseDown,this));
		OpenLayers.Event.observe(this.div,"dblclick",this.ignoreEvent);
		this.layersDiv=document.createElement("div");
		this.layersDiv.id=this.id+"_layersDiv";
		this.layersDiv.style.paddingTop="5px";
		this.layersDiv.style.paddingLeft="10px";
		this.layersDiv.style.paddingBottom="5px";
		this.layersDiv.style.paddingRight="75px";
		this.layersDiv.style.backgroundColor=
		this.activeColor;
		this.layersDiv.style.width="100%";
		this.layersDiv.style.height="100%";
		this.baseLbl=document.createElement("div");
		this.baseLbl.innerHTML=OpenLayers.i18n("baseLayer");
		this.baseLbl.style.marginTop="3px";
		this.baseLbl.style.marginLeft="3px";
		this.baseLbl.style.marginBottom="3px";
		this.baseLayersDiv=document.createElement("div");
		this.baseLayersDiv.style.paddingLeft="10px";
		this.dataLbl=document.createElement("div");
		this.dataLbl.innerHTML=OpenLayers.i18n("overlays");
		this.dataLbl.style.marginTop=
		"3px";
		this.dataLbl.style.marginLeft="3px";
		this.dataLbl.style.marginBottom="3px";
		this.dataLayersDiv=document.createElement("div");
		this.dataLayersDiv.style.paddingLeft="10px";
		//EDITED TO DELETE FROM THE MAP THE LAYERS SELECTOR
		if(this.ascending) {
			this.layersDiv.appendChild(this.baseLbl);
			this.layersDiv.appendChild(this.baseLayersDiv);
			//this.layersDiv.appendChild(this.dataLbl);
			//this.layersDiv.appendChild(this.dataLayersDiv)
		} else {
			this.layersDiv.appendChild(this.dataLbl);
			this.layersDiv.appendChild(this.dataLayersDiv);
			this.layersDiv.appendChild(this.baseLbl);
			this.layersDiv.appendChild(this.baseLayersDiv)
		}
		this.div.appendChild(this.layersDiv);
		OpenLayers.Rico.Corner.round(this.div, {
			corners:"tl bl",
			bgColor:"transparent",
			color:this.activeColor,
			blend:false
		});
		OpenLayers.Rico.Corner.changeOpacity(this.layersDiv,0.75);
		var a=OpenLayers.Util.getImagesLocation(),b=new OpenLayers.Size(18,18),c=a+"layer-switcher-maximize.png";
		this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,b,c,"absolute");
		this.maximizeDiv.style.top="5px";
		this.maximizeDiv.style.right="0px";
		this.maximizeDiv.style.left="";
		this.maximizeDiv.style.display="none";
		OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));
		//EDITED TO DELETE FROM THE MAP THE LAYERS SELECTOR
		//this.div.appendChild(this.maximizeDiv);
		c=a+"layer-switcher-minimize.png";
		b=new OpenLayers.Size(18,18);
		this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,b,c,"absolute");
		this.minimizeDiv.style.top="5px";
		this.minimizeDiv.style.right="0px";
		this.minimizeDiv.style.left="";
		this.minimizeDiv.style.display="none";
		OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));
		//EDITED TO DELETE FROM THE MAP THE LAYERS SELECTOR
		//this.div.appendChild(this.minimizeDiv)
	},
	ignoreEvent: function(a) {
		OpenLayers.Event.stop(a)
	},
	mouseDown: function(a) {
		this.isMouseDown=true;
		this.ignoreEvent(a)
	},
	mouseUp: function(a) {
		if(this.isMouseDown) {
			this.isMouseDown=false;
			this.ignoreEvent(a)
		}
	},
	CLASS_NAME:"OpenLayers.Control.LayerSwitcher"
});
OpenLayers.Control.LoadingPanel=OpenLayers.Class(OpenLayers.Control, {
	counter:0,
	maximized:false,
	initialize: function(a) {
		OpenLayers.Control.prototype.initialize.apply(this,[a])
	},
	addLayer: function(a) {
		if(a.layer) {
			a.layer.events.register("loadstart",this,this.increaseCounter);
			a.layer.events.register("loadend",this,this.decreaseCounter)
		}
	},
	setMap: function() {
		OpenLayers.Control.prototype.setMap.apply(this,arguments);
		this.map.events.register("preaddlayer",this,this.addLayer);
		for(var a=0;a<this.map.layers.length;a++) {
			var b=
			this.map.layers[a];
			b.events.register("loadstart",this,this.increaseCounter);
			b.events.register("loadend",this,this.decreaseCounter)
		}
	},
	increaseCounter: function() {
		this.counter++;
		if(this.counter>0)
			this.maximized||this.maximizeControl()
	},
	decreaseCounter: function() {
		this.counter>0&&this.counter--;
		this.counter==0&&this.maximized&&this.minimizeControl()
	},
	draw: function() {
		OpenLayers.Control.prototype.draw.apply(this,arguments);
		return this.div
	},
	minimizeControl: function(a) {
		this.div.style.display="none";
		this.div.style.width=
		"0px";
		this.div.style.height="0px";
		this.maximized=false;
		a!=null&&OpenLayers.Event.stop(a)
	},
	maximizeControl: function(a) {
		var b=this.map.getSize(),c=b.w;
		b=b.h;
		this.div.style.width=c+"px";
		this.div.style.height=b+"px";
		this.div.style.display="block";
		this.maximized=true;
		a!=null&&OpenLayers.Event.stop(a)
	},
	destroy: function() {
		if(this.map) {
			this.map.events.unregister("preaddlayer",this,this.addLayer);
			if(this.map.layers)
				for(var a=0;a<this.map.layers.length;a++) {
					var b=this.map.layers[a];
					b.events.unregister("loadstart",
					this,this.increaseCounter);
					b.events.unregister("loadend",this,this.decreaseCounter)
				}
		}
		OpenLayers.Control.prototype.destroy.apply(this,arguments)
	},
	CLASS_NAME:"OpenLayers.Control.LoadingPanel"
});
OpenLayers.Control.MouseDefaults=OpenLayers.Class(OpenLayers.Control, {
	performedDrag:false,
	wheelObserver:null,
	initialize: function() {
		OpenLayers.Control.prototype.initialize.apply(this,arguments)
	},
	destroy: function() {
		this.handler&&this.handler.destroy();
		this.handler=null;
		this.map.events.un({
			click:this.defaultClick,
			dblclick:this.defaultDblClick,
			mousedown:this.defaultMouseDown,
			mouseup:this.defaultMouseUp,
			mousemove:this.defaultMouseMove,
			mouseout:this.defaultMouseOut,
			scope:this
		});
		OpenLayers.Event.stopObserving(window,
		"DOMMouseScroll",this.wheelObserver);
		OpenLayers.Event.stopObserving(window,"mousewheel",this.wheelObserver);
		OpenLayers.Event.stopObserving(document,"mousewheel",this.wheelObserver);
		this.wheelObserver=null;
		OpenLayers.Control.prototype.destroy.apply(this,arguments)
	},
	draw: function() {
		this.map.events.on({
			click:this.defaultClick,
			dblclick:this.defaultDblClick,
			mousedown:this.defaultMouseDown,
			mouseup:this.defaultMouseUp,
			mousemove:this.defaultMouseMove,
			mouseout:this.defaultMouseOut,
			scope:this
		});
		this.registerWheelEvents()
	},
	registerWheelEvents: function() {
		this.wheelObserver=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this);
		OpenLayers.Event.observe(window,"DOMMouseScroll",this.wheelObserver);
		OpenLayers.Event.observe(window,"mousewheel",this.wheelObserver);
		OpenLayers.Event.observe(document,"mousewheel",this.wheelObserver)
	},
	defaultClick: function(a) {
		if(OpenLayers.Event.isLeftClick(a)) {
			a=!this.performedDrag;
			this.performedDrag=false;
			return a
		}
	},
	defaultDblClick: function(a) {
		var b=this.map.getLonLatFromViewPortPx(a.xy);
		this.map.setCenter(b,this.map.zoom+1);
		OpenLayers.Event.stop(a);
		return false
	},
	defaultMouseDown: function(a) {
		if(OpenLayers.Event.isLeftClick(a)) {
			this.mouseDragStart=a.xy.clone();
			this.performedDrag=false;
			if(a.shiftKey) {
				this.map.div.style.cursor="crosshair";
				this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");
				this.zoomBox.style.backgroundColor="white";
				this.zoomBox.style.filter="alpha(opacity=50)";
				this.zoomBox.style.opacity="0.50";
				this.zoomBox.style.fontSize=
				"1px";
				this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;
				this.map.viewPortDiv.appendChild(this.zoomBox)
			}
			document.onselectstart= function() {
				return false
			};
			OpenLayers.Event.stop(a)
		}
	},
	defaultMouseMove: function(a) {
		this.mousePosition=a.xy.clone();
		if(this.mouseDragStart!=null) {
			if(this.zoomBox) {
				var b=Math.abs(this.mouseDragStart.x-a.xy.x),c=Math.abs(this.mouseDragStart.y-a.xy.y);
				this.zoomBox.style.width=Math.max(1,b)+"px";
				this.zoomBox.style.height=Math.max(1,c)+"px";
				if(a.xy.x<this.mouseDragStart.x)
					this.zoomBox.style.left=
					a.xy.x+"px";
				if(a.xy.y<this.mouseDragStart.y)
					this.zoomBox.style.top=a.xy.y+"px"
			} else {
				b=this.mouseDragStart.x-a.xy.x;
				c=this.mouseDragStart.y-a.xy.y;
				var d=this.map.getSize();
				b=new OpenLayers.Pixel(d.w/2+b,d.h/2+c);
				b=this.map.getLonLatFromViewPortPx(b);
				this.map.setCenter(b,null,true);
				this.mouseDragStart=a.xy.clone();
				this.map.div.style.cursor="move"
			}
			this.performedDrag=true
		}
	},
	defaultMouseUp: function(a) {
		if(OpenLayers.Event.isLeftClick(a)) {
			if(this.zoomBox)
				this.zoomBoxEnd(a);
			else
				this.performedDrag&&this.map.setCenter(this.map.center);
			this.mouseDragStart=document.onselectstart=null;
			this.map.div.style.cursor=""
		}
	},
	defaultMouseOut: function(a) {
		if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(a,this.map.div)) {
			this.zoomBox&&this.removeZoomBox();
			this.mouseDragStart=null
		}
	},
	defaultWheelUp: function(a) {
		this.map.getZoom()<=this.map.getNumZoomLevels()&&this.map.setCenter(this.map.getLonLatFromPixel(a.xy),this.map.getZoom()+1)
	},
	defaultWheelDown: function(a) {
		this.map.getZoom()>0&&this.map.setCenter(this.map.getLonLatFromPixel(a.xy),this.map.getZoom()-
		1)
	},
	zoomBoxEnd: function(a) {
		if(this.mouseDragStart!=null) {
			if(Math.abs(this.mouseDragStart.x-a.xy.x)>5||Math.abs(this.mouseDragStart.y-a.xy.y)>5) {
				var b=this.map.getLonLatFromViewPortPx(this.mouseDragStart),c=this.map.getLonLatFromViewPortPx(a.xy);
				a=Math.max(b.lat,c.lat);
				var d=Math.min(b.lat,c.lat),e=Math.min(b.lon,c.lon);
				b=Math.max(b.lon,c.lon);
				b=new OpenLayers.Bounds(e,d,b,a);
				this.map.zoomToExtent(b)
			} else {
				c=this.map.getLonLatFromViewPortPx(a.xy);
				this.map.setCenter(new OpenLayers.LonLat(c.lon,c.lat),
				this.map.getZoom()+1)
			}
			this.removeZoomBox()
		}
	},
	removeZoomBox: function() {
		this.map.viewPortDiv.removeChild(this.zoomBox);
		this.zoomBox=null
	},
	onWheelEvent: function(a) {
		for(var b=false,c=OpenLayers.Event.element(a);c!=null;) {
			if(this.map&&c==this.map.div) {
				b=true;
				break
			}
			c=c.parentNode
		}
		if(b) {
			b=0;
			if(!a)
				a=window.event;
			if(a.wheelDelta) {
				b=a.wheelDelta/120;
				if(window.opera&&window.opera.version()<9.2)
					b=-b
			} else if(a.detail)
				b=-a.detail/3;
			if(b) {
				a.xy=this.mousePosition;b<0?this.defaultWheelDown(a):this.defaultWheelUp(a)
			}
			OpenLayers.Event.stop(a)
		}
	},
	CLASS_NAME:"OpenLayers.Control.MouseDefaults"
});
OpenLayers.Control.MousePosition=OpenLayers.Class(OpenLayers.Control, {
	element:null,
	prefix:"",
	separator:", ",
	suffix:"",
	numDigits:5,
	granularity:10,
	lastXy:null,
	displayProjection:null,
	initialize: function() {
		OpenLayers.Control.prototype.initialize.apply(this,arguments)
	},
	destroy: function() {
		this.map&&this.map.events.unregister("mousemove",this,this.redraw);
		OpenLayers.Control.prototype.destroy.apply(this,arguments)
	},
	draw: function() {
		OpenLayers.Control.prototype.draw.apply(this,arguments);
		if(!this.element) {
			this.div.left=
			"";
			this.div.top="";
			this.element=this.div
		}
		this.redraw();
		return this.div
	},
	redraw: function(a) {
		var b;
		if(a==null)
			b=new OpenLayers.LonLat(0,0);
		else {
			if(this.lastXy==null||Math.abs(a.xy.x-this.lastXy.x)>this.granularity||Math.abs(a.xy.y-this.lastXy.y)>this.granularity) {
				this.lastXy=a.xy;
				return
			}
			b=this.map.getLonLatFromPixel(a.xy);
			if(!b)
				return;
			this.displayProjection&&b.transform(this.map.getProjectionObject(),this.displayProjection);
			this.lastXy=a.xy
		}
		a=this.formatOutput(b);
		if(a!=this.element.innerHTML)
			this.element.innerHTML=
		a
	},
	formatOutput: function(a) {
		var b=parseInt(this.numDigits);
		return a=this.prefix+a.lon.toFixed(b)+this.separator+a.lat.toFixed(b)+this.suffix
	},
	setMap: function() {
		OpenLayers.Control.prototype.setMap.apply(this,arguments);
		this.map.events.register("mousemove",this,this.redraw)
	},
	CLASS_NAME:"OpenLayers.Control.MousePosition"
});
OpenLayers.Control.Pan=OpenLayers.Class(OpenLayers.Control, {
	slideFactor:50,
	direction:null,
	type:OpenLayers.Control.TYPE_BUTTON,
	initialize: function(a,b) {
		this.direction=a;
		this.CLASS_NAME+=this.direction;
		OpenLayers.Control.prototype.initialize.apply(this,[b])
	},
	trigger: function() {
		switch(this.direction) {
			case OpenLayers.Control.Pan.NORTH:
				this.map.pan(0,-this.slideFactor);
				break;
			case OpenLayers.Control.Pan.SOUTH:
				this.map.pan(0,this.slideFactor);
				break;
			case OpenLayers.Control.Pan.WEST:
				this.map.pan(-this.slideFactor,
				0);
				break;
			case OpenLayers.Control.Pan.EAST:
				this.map.pan(this.slideFactor,0);
				break
		}
	},
	CLASS_NAME:"OpenLayers.Control.Pan"
});
OpenLayers.Control.Pan.NORTH="North";
OpenLayers.Control.Pan.SOUTH="South";
OpenLayers.Control.Pan.EAST="East";
OpenLayers.Control.Pan.WEST="West";
OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control, {
	slideFactor:50,
	slideRatio:null,
	buttons:null,
	position:null,
	initialize: function() {
		this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);
		OpenLayers.Control.prototype.initialize.apply(this,arguments)
	},
	destroy: function() {
		OpenLayers.Control.prototype.destroy.apply(this,arguments);
		this.removeButtons();
		this.position=this.buttons=null
	},
	draw: function(a) {
		OpenLayers.Control.prototype.draw.apply(this,arguments);
		a=this.position;
		this.buttons=[];
		var b=new OpenLayers.Size(18,18),c=new OpenLayers.Pixel(a.x+b.w/2,a.y);
		this._addButton("panup","north-mini.png",c,b);
		a.y=c.y+b.h;
		this._addButton("panleft","west-mini.png",a,b);
		this._addButton("panright","east-mini.png",a.add(b.w,0),b);
		this._addButton("pandown","south-mini.png",c.add(0,b.h*2),b);
		this._addButton("zoomin","zoom-plus-mini.png",c.add(0,b.h*3+5),b);
		this._addButton("zoomworld","zoom-world-mini.png",c.add(0,b.h*4+5),b);
		this._addButton("zoomout","zoom-minus-mini.png",
		c.add(0,b.h*5+5),b);
		return this.div
	},
	_addButton: function(a,b,c,d) {
		b=OpenLayers.Util.getImagesLocation()+b;
		c=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+a,c,d,b,"absolute");
		this.div.appendChild(c);
		OpenLayers.Event.observe(c,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,c));
		OpenLayers.Event.observe(c,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,c));
		OpenLayers.Event.observe(c,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,c));
		c.action=
		a;
		c.map=this.map;
		if(this.slideRatio) {
			var e=this.slideRatio;
			a= function(g) {
				return this.map.getSize()[g]*e
			}
		} else {
			var f=this.slideFactor;
			a= function() {
				return f
			}
		}
		c.getSlideFactor=a;
		this.buttons.push(c);
		return c
	},
	_removeButton: function(a) {
		OpenLayers.Event.stopObservingElement(a);
		a.map=null;
		this.div.removeChild(a);
		OpenLayers.Util.removeItem(this.buttons,a)
	},
	removeButtons: function() {
		for(var a=this.buttons.length-1;a>=0;--a)
			this._removeButton(this.buttons[a])
	},
	doubleClick: function(a) {
		OpenLayers.Event.stop(a);
		return false
	},
	buttonDown: function(a) {
		if(OpenLayers.Event.isLeftClick(a)) {
			switch(this.action) {
				case "panup":
					this.map.pan(0,-this.getSlideFactor("h"));
					break;
				case "pandown":
					this.map.pan(0,this.getSlideFactor("h"));
					break;
				case "panleft":
					this.map.pan(-this.getSlideFactor("w"),0);
					break;
				case "panright":
					this.map.pan(this.getSlideFactor("w"),0);
					break;
				case "zoomin":
					this.map.zoomIn();
					break;
				case "zoomout":
					this.map.zoomOut();
					break;
				case "zoomworld":
					this.map.zoomToMaxExtent();
					break
			}
			OpenLayers.Event.stop(a)
		}
	},
	CLASS_NAME:"OpenLayers.Control.PanZoom"
});
OpenLayers.Control.PanZoom.X=4;
OpenLayers.Control.PanZoom.Y=4;
OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control, {
	controls:null,
	defaultControl:null,
	initialize: function(a) {
		OpenLayers.Control.prototype.initialize.apply(this,[a]);
		this.controls=[]
	},
	destroy: function() {
		OpenLayers.Control.prototype.destroy.apply(this,arguments);
		for(var a=this.controls.length-1;a>=0;a--) {
			this.controls[a].events&&this.controls[a].events.un({
				activate:this.redraw,
				deactivate:this.redraw,
				scope:this
			});
			OpenLayers.Event.stopObservingElement(this.controls[a].panel_div);
			this.controls[a].panel_div=
			null
		}
	},
	activate: function() {
		if(OpenLayers.Control.prototype.activate.apply(this,arguments)) {
			for(var a=0,b=this.controls.length;a<b;a++)
				this.controls[a]==this.defaultControl&&this.controls[a].activate();
			this.redraw();
			return true
		} else
			return false
	},
	deactivate: function() {
		if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)) {
			for(var a=0,b=this.controls.length;a<b;a++)
				this.controls[a].deactivate();
			return true
		} else
			return false
	},
	draw: function() {
		OpenLayers.Control.prototype.draw.apply(this,arguments);
		for(var a=0,b=this.controls.length;a<b;a++) {
			this.map.addControl(this.controls[a]);
			this.controls[a].deactivate();
			this.controls[a].events.on({
				activate:this.redraw,
				deactivate:this.redraw,
				scope:this
			})
		}
		this.activate();
		return this.div
	},
	redraw: function() {
		this.div.innerHTML="";
		if(this.active)
			for(var a=0,b=this.controls.length;a<b;a++) {
				var c=this.controls[a].panel_div;
				c.className=this.controls[a].active?this.controls[a].displayClass+"ItemActive":this.controls[a].displayClass+"ItemInactive";
				this.div.appendChild(c)
			}
	},
	activateControl: function(a) {
		if(!this.active)
			return false;
		if(a.type==OpenLayers.Control.TYPE_BUTTON) {
			a.trigger();
			this.redraw()
		} else if(a.type==OpenLayers.Control.TYPE_TOGGLE) {a.active?a.deactivate():a.activate();
			this.redraw()
		} else {
			for(var b=0,c=this.controls.length;b<c;b++)
				this.controls[b]!=a&&this.controls[b].type!=OpenLayers.Control.TYPE_TOGGLE&&this.controls[b].deactivate();
			a.activate()
		}
	},
	addControls: function(a) {
		a instanceof Array||(a=[a]);
		this.controls=this.controls.concat(a);
		for(var b=0,c=a.length;b<
		c;b++) {
			var d=document.createElement("div");
			document.createTextNode(" ");
			a[b].panel_div=d;
			if(a[b].title!="")
				a[b].panel_div.title=a[b].title;
			OpenLayers.Event.observe(a[b].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,a[b]));
			OpenLayers.Event.observe(a[b].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop))
		}
		if(this.map) {
			b=0;
			for(c=a.length;b<c;b++) {
				this.map.addControl(a[b]);
				a[b].deactivate();
				a[b].events.on({
					activate:this.redraw,
					deactivate:this.redraw,
					scope:this
				})
			}
			this.redraw()
		}
	},
	onClick: function(a,b) {
		OpenLayers.Event.stop(b?b:window.event);
		this.activateControl(a)
	},
	getControlsBy: function(a,b) {
		var c=typeof b.test=="function",d=OpenLayers.Array.filter(this.controls, function(e) {
			return e[a]==b||c&&b.test(e[a])
		});
		return d
	},
	getControlsByName: function(a) {
		return this.getControlsBy("name",a)
	},
	getControlsByClass: function(a) {
		return this.getControlsBy("CLASS_NAME",a)
	},
	CLASS_NAME:"OpenLayers.Control.Panel"
});
OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control, {
	element:null,
	initialize: function(a,b) {
		OpenLayers.Control.prototype.initialize.apply(this,[b]);
		this.element=OpenLayers.Util.getElement(a)
	},
	draw: function() {
		OpenLayers.Control.prototype.draw.apply(this,arguments);
		if(!this.element) {
			this.element=document.createElement("div");
			this.div.appendChild(this.element)
		}
		this.map.events.register("moveend",this,this.updateScale);
		this.updateScale();
		return this.div
	},
	updateScale: function() {
		var a=this.map.getScale();
		if(a) {
			a=a>=9500&&a<=950000?Math.round(a/1000)+"K":a>=950000?Math.round(a/1000000)+"M":Math.round(a);
			this.element.innerHTML=OpenLayers.i18n("scale", {
				scaleDenom:a
			})
		}
	},
	CLASS_NAME:"OpenLayers.Control.Scale"
});
OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control, {
	maxWidth:100,
	topOutUnits:"km",
	topInUnits:"m",
	bottomOutUnits:"mi",
	bottomInUnits:"ft",
	eTop:null,
	eBottom:null,
	initialize: function(a) {
		OpenLayers.Control.prototype.initialize.apply(this,[a])
	},
	draw: function() {
		OpenLayers.Control.prototype.draw.apply(this,arguments);
		if(!this.eTop) {
			this.div.style.display="block";
			this.div.style.position="absolute";
			this.eTop=document.createElement("div");
			this.eTop.className=this.displayClass+"Top";
			this.div.appendChild(this.eTop);
			this.eTop.style.visibility=this.topOutUnits==""||this.topInUnits==""?"hidden":"visible";
			this.eBottom=document.createElement("div");
			this.eBottom.className=this.displayClass+"Bottom";
			this.div.appendChild(this.eBottom);
			this.eBottom.style.visibility=this.bottomOutUnits==""||this.bottomInUnits==""?"hidden":"visible"
		}
		this.map.events.register("moveend",this,this.update);
		this.update();
		return this.div
	},
	getBarLen: function(a) {
		var b=parseInt(Math.log(a)/Math.log(10));
		b=Math.pow(10,b);
		a=parseInt(a/b);
		a=a>5?5:
		a>2?2:1;
		return a*b
	},
	update: function() {
		var a=this.map.getResolution();
		if(a) {
			var b=this.map.getUnits(),c=OpenLayers.INCHES_PER_UNIT,d=this.maxWidth*a*c[b],e,f;
			if(d>100000) {
				e=this.topOutUnits;
				f=this.bottomOutUnits
			} else {
				e=this.topInUnits;
				f=this.bottomInUnits
			}
			var g=d/c[e],h=d/c[f];
			d=this.getBarLen(g);
			var i=this.getBarLen(h);
			g=d/c[b]*c[e];
			h=i/c[b]*c[f];
			b=g/a;
			a=h/a;
			if(this.eBottom.style.visibility=="visible") {
				this.eBottom.style.width=Math.round(a)+"px";
				this.eBottom.innerHTML=i+" "+f
			}
			if(this.eTop.style.visibility==
			"visible") {
				this.eTop.style.width=Math.round(b)+"px";
				this.eTop.innerHTML=d+" "+e
			}
		}
	},
	CLASS_NAME:"OpenLayers.Control.ScaleLine"
});
OpenLayers.Control.ZoomIn=OpenLayers.Class(OpenLayers.Control, {
	type:OpenLayers.Control.TYPE_BUTTON,
	trigger: function() {
		this.map.zoomIn()
	},
	CLASS_NAME:"OpenLayers.Control.ZoomIn"
});
OpenLayers.Control.ZoomOut=OpenLayers.Class(OpenLayers.Control, {
	type:OpenLayers.Control.TYPE_BUTTON,
	trigger: function() {
		this.map.zoomOut()
	},
	CLASS_NAME:"OpenLayers.Control.ZoomOut"
});
OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control, {
	type:OpenLayers.Control.TYPE_BUTTON,
	trigger: function() {
		this.map&&this.map.zoomToMaxExtent()
	},
	CLASS_NAME:"OpenLayers.Control.ZoomToMaxExtent"
});
OpenLayers.Event= {
	observers:false,
	KEY_BACKSPACE:8,
	KEY_TAB:9,
	KEY_RETURN:13,
	KEY_ESC:27,
	KEY_LEFT:37,
	KEY_UP:38,
	KEY_RIGHT:39,
	KEY_DOWN:40,
	KEY_DELETE:46,
	element: function(a) {
		return a.target||a.srcElement
	},
	isLeftClick: function(a) {
		return a.which&&a.which==1||a.button&&a.button==1
	},
	isRightClick: function(a) {
		return a.which&&a.which==3||a.button&&a.button==2
	},
	stop: function(a,b) {
		if(!b)
			if(a.preventDefault)
				a.preventDefault();
			else
				a.returnValue=false;
		if(a.stopPropagation)
			a.stopPropagation();
		else
			a.cancelBubble=true
	},
	findElement: function(a,b) {
		for(a=OpenLayers.Event.element(a);a.parentNode&&(!a.tagName||a.tagName.toUpperCase()!=b.toUpperCase());)
			a=a.parentNode;
		return a
	},
	observe: function(a,b,c,d) {
		a=OpenLayers.Util.getElement(a);
		d=d||false;
		if(b=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.attachEvent))
			b="keydown";
		if(!this.observers)
			this.observers= {};
		if(!a._eventCacheID) {
			var e="eventCacheID_";
			if(a.id)
				e=a.id+"_"+e;
			a._eventCacheID=OpenLayers.Util.createUniqueID(e)
		}
		e=a._eventCacheID;
		this.observers[e]||
		(this.observers[e]=[]);
		this.observers[e].push({
			element:a,
			name:b,
			observer:c,
			useCapture:d
		});
		if(a.addEventListener)
			a.addEventListener(b,c,d);
		else
			a.attachEvent&&a.attachEvent("on"+b,c)
	},
	stopObservingElement: function(a) {
		a=OpenLayers.Util.getElement(a);
		a=a._eventCacheID;
		this._removeElementObservers(OpenLayers.Event.observers[a])
	},
	_removeElementObservers: function(a) {
		if(a)
			for(var b=a.length-1;b>=0;b--) {
				var c=a[b];
				c=new Array(c.element,c.name,c.observer,c.useCapture);
				OpenLayers.Event.stopObserving.apply(this,
				c)
			}
	},
	stopObserving: function(a,b,c,d) {
		d=d||false;
		a=OpenLayers.Util.getElement(a);
		var e=a._eventCacheID;
		if(b=="keypress")
			if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.detachEvent)
				b="keydown";
		var f=false,g=OpenLayers.Event.observers[e];
		if(g)
			for(var h=0;!f&&h<g.length;) {
				var i=g[h];
				if(i.name==b&&i.observer==c&&i.useCapture==d) {
					g.splice(h,1);
					g.length==0&&delete OpenLayers.Event.observers[e];
					f=true;
					break
				}
				h++
			}
		if(f)
			if(a.removeEventListener)
				a.removeEventListener(b,c,d);
			else
				a&&a.detachEvent&&a.detachEvent("on"+
				b,c);
		return f
	},
	unloadCache: function() {
		if(OpenLayers.Event&&OpenLayers.Event.observers) {
			for(var a in OpenLayers.Event.observers) {
				var b=OpenLayers.Event.observers[a];
				OpenLayers.Event._removeElementObservers.apply(this,[b])
			}
			OpenLayers.Event.observers=false
		}
	},
	CLASS_NAME:"OpenLayers.Event"
};
OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,false);
if(window.Event)
	OpenLayers.Util.applyDefaults(window.Event,OpenLayers.Event);
else
	var Event=OpenLayers.Event;
OpenLayers.Events=OpenLayers.Class({
	BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur"],
	listeners:null,
	object:null,
	element:null,
	eventTypes:null,
	eventHandler:null,
	fallThrough:null,
	includeXY:false,
	clearMouseListener:null,
	initialize: function(a,b,c,d,e) {
		OpenLayers.Util.extend(this,e);
		this.object=a;
		this.fallThrough=d;
		this.listeners= {};
		this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,
		this);
		this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this);
		this.eventTypes=[];
		if(c!=null) {
			a=0;
			for(d=c.length;a<d;a++)
				this.addEventType(c[a])
		}
		b!=null&&this.attachToElement(b)
	},
	destroy: function() {
		if(this.element) {
			OpenLayers.Event.stopObservingElement(this.element);
			this.element.hasScrollEvent&&OpenLayers.Event.stopObserving(window,"scroll",this.clearMouseListener)
		}
		this.eventHandler=this.fallThrough=this.eventTypes=this.object=this.listeners=this.element=null
	},
	addEventType: function(a) {
		if(!this.listeners[a]) {
			this.eventTypes.push(a);
			this.listeners[a]=[]
		}
	},
	attachToElement: function(a) {
		this.element&&OpenLayers.Event.stopObservingElement(this.element);
		this.element=a;
		for(var b=0,c=this.BROWSER_EVENTS.length;b<c;b++) {
			var d=this.BROWSER_EVENTS[b];
			this.addEventType(d);
			OpenLayers.Event.observe(a,d,this.eventHandler)
		}
		OpenLayers.Event.observe(a,"dragstart",OpenLayers.Event.stop)
	},
	on: function(a) {
		for(var b in a)
			b!="scope"&&this.register(b,a.scope,a[b])
	},
	register: function(a,b,c) {
		if(c!=null&&OpenLayers.Util.indexOf(this.eventTypes,a)!=-1) {
			if(b==
			null)
				b=this.object;
			a=this.listeners[a];
			a.push({
				obj:b,
				func:c
			})
		}
	},
	registerPriority: function(a,b,c) {
		if(c!=null) {
			if(b==null)
				b=this.object;
			a=this.listeners[a];
			a!=null&&a.unshift({
				obj:b,
				func:c
			})
		}
	},
	un: function(a) {
		for(var b in a)
			b!="scope"&&this.unregister(b,a.scope,a[b])
	},
	unregister: function(a,b,c) {
		if(b==null)
			b=this.object;
		a=this.listeners[a];
		if(a!=null)
			for(var d=0,e=a.length;d<e;d++)
				if(a[d].obj==b&&a[d].func==c) {
					a.splice(d,1);
					break
				}
	},
	remove: function(a) {
		if(this.listeners[a]!=null)
			this.listeners[a]=[]
	},
	triggerEvent: function(a,
	b) {
		var c=this.listeners[a];
		if(!(!c||c.length==0)) {
			if(b==null)
				b= {};
			b.object=this.object;
			b.element=this.element;
			if(!b.type)
				b.type=a;
			c=c.slice();
			var d;
			a=0;
			for(var e=c.length;a<e;a++) {
				d=c[a];
				d=d.func.apply(d.obj,[b]);
				if(d!=undefined&&d==false)
					break
			}
			this.fallThrough||OpenLayers.Event.stop(b,true);
			return d
		}
	},
	handleBrowserEvent: function(a) {
		if(this.includeXY)
			a.xy=this.getMousePosition(a);
		this.triggerEvent(a.type,a)
	},
	clearMouseCache: function() {
		this.element.scrolls=null;
		this.element.lefttop=null;
		this.element.offsets=
		null
	},
	getMousePosition: function(a) {
		if(this.includeXY) {
			if(!this.element.hasScrollEvent) {
				OpenLayers.Event.observe(window,"scroll",this.clearMouseListener);
				this.element.hasScrollEvent=true
			}
		} else
			this.clearMouseCache();
		if(!this.element.scrolls)
			this.element.scrolls=[document.documentElement.scrollLeft||document.body.scrollLeft,document.documentElement.scrollTop||document.body.scrollTop];
		if(!this.element.lefttop)
			this.element.lefttop=[document.documentElement.clientLeft||0,document.documentElement.clientTop||
			0];
		if(!this.element.offsets) {
			this.element.offsets=OpenLayers.Util.pagePosition(this.element);
			this.element.offsets[0]+=this.element.scrolls[0];
			this.element.offsets[1]+=this.element.scrolls[1]
		}
		return new OpenLayers.Pixel(a.clientX+this.element.scrolls[0]-this.element.offsets[0]-this.element.lefttop[0],a.clientY+this.element.scrolls[1]-this.element.offsets[1]-this.element.lefttop[1])
	},
	CLASS_NAME:"OpenLayers.Events"
});
OpenLayers.Format=OpenLayers.Class({
	options:null,
	externalProjection:null,
	internalProjection:null,
	data:null,
	keepData:false,
	initialize: function(a) {
		OpenLayers.Util.extend(this,a);
		this.options=a
	},
	destroy: function() {
	},
	read: function() {
		OpenLayers.Console.userError(OpenLayers.i18n("readNotImplemented"))
	},
	write: function() {
		OpenLayers.Console.userError(OpenLayers.i18n("writeNotImplemented"))
	},
	CLASS_NAME:"OpenLayers.Format"
});
OpenLayers.Lang.en= {
	unhandledRequest:"Unhandled request return ${statusText}",
	permalink:"Permalink",
	overlays:"Overlays",
	baseLayer:"Filtro Categorie",
	sameProjection:"The overview map only works when it is in the same projection as the main map",
	readNotImplemented:"Read not implemented.",
	writeNotImplemented:"Write not implemented.",
	noFID:"Can't update a feature for which there is no FID.",
	errorLoadingGML:"Error in loading GML file ${url}",
	browserNotSupported:"Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}",
	componentShouldBe:"addFeatures : component should be an ${geomType}",
	getFeatureError:"getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.",
	minZoomLevelError:"The minZoomLevel property is only intended for use with the FixedZoomLevels-descendent layers. That this wfs layer checks for minZoomLevel is a relic of thepast. We cannot, however, remove it without possibly breaking OL based applications that may depend on it. Therefore we are deprecating it -- the minZoomLevel check below will be removed at 3.0. Please instead use min/max resolution setting as described here: http://trac.openlayers.org/wiki/SettingZoomLevels",
	commitSuccess:"WFS Transaction: SUCCESS ${response}",
	commitFailed:"WFS Transaction: FAILED ${response}",
	googleWarning:"The Google Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the Google Maps library script was either not included, or does not contain the correct API key for your site.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>click here</a>",
	getLayerWarning:"The ${layerType} Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the ${layerLib} library script was not correctly included.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>click here</a>",
	scale:"Scale = 1 : ${scaleDenom}",
	layerAlreadyAdded:"You tried to add the layer: ${layerName} to the map, but it has already been added",
	reprojectDeprecated:"You are using the 'reproject' option on the ${layerName} layer. This option is deprecated: its use was designed to support displaying data over commercial basemaps, but that functionality should now be achieved by using Spherical Mercator support. More information is available from http://trac.openlayers.org/wiki/SphericalMercator.",
	methodDeprecated:"This method has been deprecated and will be removed in 3.0. Please use ${newMethod} instead.",
	boundsAddError:"You must pass both x and y values to the add function.",
	lonlatAddError:"You must pass both lon and lat values to the add function.",
	pixelAddError:"You must pass both x and y values to the add function.",
	unsupportedGeometryType:"Unsupported geometry type: ${geomType}",
	pagePositionFailed:"OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.",
	end:"",
	filterEvaluateNotImplemented:"evaluate is not implemented for this filter type."
};
OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored, {
	rounded:false,
	initialize: function() {
		this.padding=new OpenLayers.Bounds(0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE,0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);
		OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments)
	},
	draw: function() {
		OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);
		this.setContentHTML();
		this.setBackgroundColor();
		this.setOpacity();
		return this.div
	},
	updateRelativePosition: function() {
		this.setRicoCorners()
	},
	setSize: function() {
		OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);
		this.setRicoCorners()
	},
	setBackgroundColor: function(a) {
		if(a!=undefined)
			this.backgroundColor=a;
		if(this.div!=null)
			if(this.contentDiv!=null) {
				this.div.style.background="transparent";
				OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor)
			}
	},
	setOpacity: function(a) {
		OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,a);
		this.div!=null&&this.groupDiv!=null&&OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,
		this.opacity)
	},
	setBorder: function() {
		this.border=0
	},
	setRicoCorners: function() {
		var a=this.getCornersToRound(this.relativePosition);
		a= {
			corners:a,
			color:this.backgroundColor,
			bgColor:"transparent",
			blend:false
		};
		if(this.rounded) {
			OpenLayers.Rico.Corner.reRound(this.groupDiv,a);
			this.setBackgroundColor();
			this.setOpacity()
		} else {
			OpenLayers.Rico.Corner.round(this.div,a);
			this.rounded=true
		}
	},
	getCornersToRound: function() {
		var a=["tl","tr","bl","br"],b=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);
		OpenLayers.Util.removeItem(a,
		b);
		return a.join(" ")
	},
	CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"
});
OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;
OpenLayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored, {
	imageSrc:null,
	imageSize:null,
	isAlphaImage:false,
	positionBlocks:null,
	blocks:null,
	fixedRelativePosition:false,
	initialize: function(a,b,c,d,e,f) {
		OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments);
		if(this.fixedRelativePosition) {
			this.updateRelativePosition();
			this.calculateRelativePosition= function() {
				return this.relativePosition
			}
		}
		this.contentDiv.style.position="absolute";
		this.contentDiv.style.zIndex=1;
		if(f)
			this.closeDiv.style.zIndex=
			1;
		this.groupDiv.style.position="absolute";
		this.groupDiv.style.top="0px";
		this.groupDiv.style.left="0px";
		this.groupDiv.style.height="100%";
		this.groupDiv.style.width="100%"
	},
	destroy: function() {
		this.isAlphaImage=this.imageSize=this.imageSrc=null;
		this.fixedRelativePosition=false;
		this.positionBlocks=null;
		for(var a=0;a<this.blocks.length;a++) {
			var b=this.blocks[a];
			b.image&&b.div.removeChild(b.image);
			b.image=null;
			b.div&&this.groupDiv.removeChild(b.div);
			b.div=null
		}
		this.blocks=null;
		OpenLayers.Popup.Anchored.prototype.destroy.apply(this,
		arguments)
	},
	setBackgroundColor: function() {
	},
	setBorder: function() {
	},
	setOpacity: function() {
	},
	setSize: function() {
		OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);
		this.updateBlocks()
	},
	updateRelativePosition: function() {
		this.padding=this.positionBlocks[this.relativePosition].padding;
		if(this.closeDiv) {
			var a=this.getContentDivPadding();
			this.closeDiv.style.right=a.right+this.padding.right+"px";
			this.closeDiv.style.top=a.top+this.padding.top+"px"
		}
		this.updateBlocks()
	},
	calculateNewPx: function() {
		var a=
		OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);
		return a=a.offset(this.positionBlocks[this.relativePosition].offset)
	},
	createBlocks: function() {
		this.blocks=[];
		var a=null;
		for(var b in this.positionBlocks) {
			a=b;
			break
		}
		a=this.positionBlocks[a];
		for(b=0;b<a.blocks.length;b++) {
			var c= {};
			this.blocks.push(c);
			var d=this.id+"_FrameDecorationDiv_"+b;
			c.div=OpenLayers.Util.createDiv(d,null,null,null,"absolute",null,"hidden",null);
			d=this.id+"_FrameDecorationImg_"+b;
			var e=this.isAlphaImage?OpenLayers.Util.createAlphaImageDiv:
			OpenLayers.Util.createImage;
			c.image=e(d,null,this.imageSize,this.imageSrc,"absolute",null,null,null);
			c.div.appendChild(c.image);
			this.groupDiv.appendChild(c.div)
		}
	},
	updateBlocks: function() {
		this.blocks||this.createBlocks();
		if(this.size&&this.relativePosition) {
			for(var a=this.positionBlocks[this.relativePosition],b=0;b<a.blocks.length;b++) {
				var c=a.blocks[b],d=this.blocks[b],e=c.anchor.left,f=c.anchor.bottom,g=c.anchor.right,h=c.anchor.top,i=isNaN(c.size.w)?this.size.w-(g+e):c.size.w,j=isNaN(c.size.h)?
				this.size.h-(f+h):c.size.h;
				d.div.style.width=(i<0?0:i)+"px";
				d.div.style.height=(j<0?0:j)+"px";
				d.div.style.left=e!=null?e+"px":"";
				d.div.style.bottom=f!=null?f+"px":"";
				d.div.style.right=g!=null?g+"px":"";
				d.div.style.top=h!=null?h+"px":"";
				d.image.style.left=c.position.x+"px";
				d.image.style.top=c.position.y+"px"
			}
			this.contentDiv.style.left=this.padding.left+"px";
			this.contentDiv.style.top=this.padding.top+"px"
		}
	},
	CLASS_NAME:"OpenLayers.Popup.Framed"
});
OpenLayers.Projection=OpenLayers.Class({
	proj:null,
	projCode:null,
	initialize: function(a,b) {
		OpenLayers.Util.extend(this,b);
		this.projCode=a;
		if(window.Proj4js)
			this.proj=new Proj4js.Proj(a)
	},
	getCode: function() {
		return this.proj?this.proj.srsCode:this.projCode
	},
	getUnits: function() {
		return this.proj?this.proj.units:null
	},
	toString: function() {
		return this.getCode()
	},
	equals: function(a) {
		return a&&a.getCode?this.getCode()==a.getCode():false
	},
	destroy: function() {
		delete this.proj;
		delete this.projCode
	},
	CLASS_NAME:"OpenLayers.Projection"
});
OpenLayers.Projection.transforms= {};
OpenLayers.Projection.addTransform= function(a,b,c) {
	OpenLayers.Projection.transforms[a]||(OpenLayers.Projection.transforms[a]= {});
	OpenLayers.Projection.transforms[a][b]=c
};
OpenLayers.Projection.transform= function(a,b,c) {
	if(b.proj&&c.proj)
		a=Proj4js.transform(b.proj,c.proj,a);
	else
		b&&c&&OpenLayers.Projection.transforms[b.getCode()]&&OpenLayers.Projection.transforms[b.getCode()][c.getCode()]&&OpenLayers.Projection.transforms[b.getCode()][c.getCode()](a);
	return a
};
OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements, {
	xmlns:"http://www.w3.org/2000/svg",
	xlinkns:"http://www.w3.org/1999/xlink",
	MAX_PIXEL:15000,
	translationParameters:null,
	symbolSize: {},
	isGecko:null,
	initialize: function() {
		if(this.supported()) {
			OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);
			this.translationParameters= {
				x:0,
				y:0
			};
			this.isGecko=navigator.userAgent.toLowerCase().indexOf("gecko/")!=-1
		}
	},
	destroy: function() {
		OpenLayers.Renderer.Elements.prototype.destroy.apply(this,
		arguments)
	},
	supported: function() {
		var a="http://www.w3.org/TR/SVG11/feature#";
		return document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(a+"SVG","1.1")||document.implementation.hasFeature(a+"BasicStructure","1.1"))
	},
	inValidRange: function(a,b,c) {
		a=a+(c?0:this.translationParameters.x);
		b=b+(c?0:this.translationParameters.y);
		return a>=-this.MAX_PIXEL&&a<=this.MAX_PIXEL&&b>=-this.MAX_PIXEL&&b<=this.MAX_PIXEL
	},
	setExtent: function(a,b) {
		OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,
		arguments);
		var c=this.getResolution(),d=-a.left/c;
		c=a.top/c;
		if(b) {
			this.left=d;
			this.top=c;
			d="0 0 "+this.size.w+" "+this.size.h;
			this.rendererRoot.setAttributeNS(null,"viewBox",d);
			this.translate(0,0);
			return true
		} else {
			(d=this.translate(d-this.left,c-this.top))||this.setExtent(a,true);
			return d
		}
	},
	translate: function(a,b) {
		if(this.inValidRange(a,b,true)) {
			var c="";
			if(a||b)
				c="translate("+a+","+b+")";
			this.root.setAttributeNS(null,"transform",c);
			this.translationParameters= {
				x:a,
				y:b
			};
			return true
		} else
			return false
	},
	setSize: function() {
		OpenLayers.Renderer.prototype.setSize.apply(this,arguments);
		this.rendererRoot.setAttributeNS(null,"width",this.size.w);
		this.rendererRoot.setAttributeNS(null,"height",this.size.h)
	},
	getNodeType: function(a,b) {
		var c=null;
		switch(a.CLASS_NAME) {
			case "OpenLayers.Geometry.Point":
				c=b.externalGraphic?"image":this.isComplexSymbol(b.graphicName)?"use":"circle";
				break;
			case "OpenLayers.Geometry.Rectangle":
				c="rect";
				break;
			case "OpenLayers.Geometry.LineString":
				c="polyline";
				break;
			case "OpenLayers.Geometry.LinearRing":
				c=
				"polygon";
				break;
			case "OpenLayers.Geometry.Polygon":
			case "OpenLayers.Geometry.Curve":
			case "OpenLayers.Geometry.Surface":
				c="path";
				break;
			default:
				break
		}
		return c
	},
	setStyle: function(a,b,c) {
		b=b||a._style;
		c=c||a._options;
		var d=parseFloat(a.getAttributeNS(null,"r")),e=1,f;
		if(a._geometryClass=="OpenLayers.Geometry.Point"&&d) {
			a.style.visibility="";
			if(b.graphic===false)
				a.style.visibility="hidden";
			else if(b.externalGraphic) {
				f=this.getPosition(a);
				b.graphicTitle&&a.setAttributeNS(null,"title",b.graphicTitle);
				b.graphicWidth&&
				b.graphicHeight&&a.setAttributeNS(null,"preserveAspectRatio","none");
				d=b.graphicWidth||b.graphicHeight;
				var g=b.graphicHeight||b.graphicWidth;
				d=d?d:b.pointRadius*2;
				g=g?g:b.pointRadius*2;
				var h=b.graphicXOffset!=undefined?b.graphicXOffset:-(0.5*d),i=b.graphicYOffset!=undefined?b.graphicYOffset:-(0.5*g),j=b.graphicOpacity||b.fillOpacity;
				a.setAttributeNS(null,"x",(f.x+h).toFixed());
				a.setAttributeNS(null,"y",(f.y+i).toFixed());
				a.setAttributeNS(null,"width",d);
				a.setAttributeNS(null,"height",g);
				a.setAttributeNS(this.xlinkns,
				"href",b.externalGraphic);
				a.setAttributeNS(null,"style","opacity: "+j)
			} else if(this.isComplexSymbol(b.graphicName)) {
				d=b.pointRadius*3;
				g=d*2;
				e=this.importSymbol(b.graphicName);
				h="#"+e;
				f=this.getPosition(a);
				e=this.symbolSize[e]/g;
				i=a.parentNode;
				j=a.nextSibling;
				i&&i.removeChild(a);
				a.setAttributeNS(this.xlinkns,"href",h);
				a.setAttributeNS(null,"width",g);
				a.setAttributeNS(null,"height",g);
				a.setAttributeNS(null,"x",f.x-d);
				a.setAttributeNS(null,"y",f.y-d);
				if(j)
					i.insertBefore(a,j);
				else
					i&&i.appendChild(a)
			} else
				a.setAttributeNS(null,
				"r",b.pointRadius);
			if(typeof b.rotation!="undefined"&&f) {
				f=OpenLayers.String.format("rotate(${0} ${1} ${2})",[b.rotation,f.x,f.y]);
				a.setAttributeNS(null,"transform",f)
			}
		}
		if(c.isFilled) {
			a.setAttributeNS(null,"fill",b.fillColor);
			a.setAttributeNS(null,"fill-opacity",b.fillOpacity)
		} else
			a.setAttributeNS(null,"fill","none");
		if(c.isStroked) {
			a.setAttributeNS(null,"stroke",b.strokeColor);
			a.setAttributeNS(null,"stroke-opacity",b.strokeOpacity);
			a.setAttributeNS(null,"stroke-width",b.strokeWidth*e);
			a.setAttributeNS(null,
			"stroke-linecap",b.strokeLinecap);
			a.setAttributeNS(null,"stroke-linejoin","round");
			a.setAttributeNS(null,"stroke-dasharray",this.dashStyle(b,e))
		} else
			a.setAttributeNS(null,"stroke","none");
		b.pointerEvents&&a.setAttributeNS(null,"pointer-events",b.pointerEvents);
		b.cursor!=null&&a.setAttributeNS(null,"cursor",b.cursor);
		return a
	},
	dashStyle: function(a,b) {
		b=a.strokeWidth*b;
		switch(a.strokeDashstyle) {
			case "solid":
				return"none";
			case "dot":
				return[1,4*b].join();
			case "dash":
				return[4*b,4*b].join();
			case "dashdot":
				return[4*
				b,4*b,1,4*b].join();
			case "longdash":
				return[8*b,4*b].join();
			case "longdashdot":
				return[8*b,4*b,1,4*b].join();
			default:
				return a.strokeDashstyle.replace(/ /g,",")
		}
	},
	createNode: function(a,b) {
		a=document.createElementNS(this.xmlns,a);
		b&&a.setAttributeNS(null,"id",b);
		return a
	},
	nodeTypeCompare: function(a,b) {
		return b==a.nodeName
	},
	createRenderRoot: function() {
		return this.nodeFactory(this.container.id+"_svgRoot","svg")
	},
	createRoot: function(a) {
		return this.nodeFactory(this.container.id+a,"g")
	},
	createDefs: function() {
		var a=
		this.nodeFactory(this.container.id+"_defs","defs");
		this.rendererRoot.appendChild(a);
		return a
	},
	drawPoint: function(a,b) {
		return this.drawCircle(a,b,1)
	},
	drawCircle: function(a,b,c) {
		var d=this.getResolution(),e=b.x/d+this.left;
		b=this.top-b.y/d;
		if(this.inValidRange(e,b)) {
			a.setAttributeNS(null,"cx",e);
			a.setAttributeNS(null,"cy",b);
			a.setAttributeNS(null,"r",c);
			return a
		} else
			return false
	},
	drawLineString: function(a,b) {
		b=this.getComponentsString(b.components);
		if(b.path) {
			a.setAttributeNS(null,"points",b.path);
			return b.complete?a:null
		} else
			return false
	},
	drawLinearRing: function(a,b) {
		b=this.getComponentsString(b.components);
		if(b.path) {
			a.setAttributeNS(null,"points",b.path);
			return b.complete?a:null
		} else
			return false
	},
	drawPolygon: function(a,b) {
		for(var c="",d=true,e=true,f,g,h=0,i=b.components.length;h<i;h++) {
			c+=" M";
			f=this.getComponentsString(b.components[h].components," ");
			if(g=f.path) {
				c+=" "+g;
				e=f.complete&&e
			} else
				d=false
		}
		c+=" z";
		if(d) {
			a.setAttributeNS(null,"d",c);
			a.setAttributeNS(null,"fill-rule","evenodd");
			return e?a:null
		} else
			return false
	},
	drawRectangle: function(a,b) {
		var c=this.getResolution(),d=b.x/c+this.left,e=this.top-b.y/c;
		if(this.inValidRange(d,e)) {
			a.setAttributeNS(null,"x",d);
			a.setAttributeNS(null,"y",e);
			a.setAttributeNS(null,"width",b.width/c);
			a.setAttributeNS(null,"height",b.height/c);
			return a
		} else
			return false
	},
	drawSurface: function(a,b) {
		for(var c=null,d=true,e=0,f=b.components.length;e<f;e++)
			if(e%3==0&&e/3==0) {
				var g=this.getShortString(b.components[e]);
				g||(d=false);
				c="M "+g
			} else if(e%3==
			1) {
				(g=this.getShortString(b.components[e]))||(d=false);
				c+=" C "+g
			} else {
				(g=this.getShortString(b.components[e]))||(d=false);
				c+=" "+g
			}
		c+=" Z";
		if(d) {
			a.setAttributeNS(null,"d",c);
			return a
		} else
			return false
	},
	drawText: function(a,b,c) {
		if (b.label !== "> 2"){
			var d=this.getResolution(),e=c.x/d+this.left;
			d=c.y/d-this.top;
			c=this.nodeFactory(a+this.LABEL_ID_SUFFIX,"text");
			a=this.nodeFactory(a+this.LABEL_ID_SUFFIX+"_tspan","tspan");
			c.setAttributeNS(null,"x",e);
			c.setAttributeNS(null,"y",-d);
			c.setAttributeNS(null,"pointer-events","none");
			b.fontColor&&c.setAttributeNS(null,"fill",b.fontColor);
			b.fontFamily&&c.setAttributeNS(null,"font-family",b.fontFamily);
			b.fontSize&&c.setAttributeNS(null,"font-size",b.fontSize);
			b.fontWeight&&c.setAttributeNS(null,"font-weight",b.fontWeight);
			e=b.labelAlign||"cm";
			c.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[e[0]]||"middle");this.isGecko?c.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG.LABEL_ALIGN[e[1]]||"central"):a.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[e[1]]||
			"-35%");
			if((b.label).length>1)
				a.textContent=(b.label).charAt((b.label).length-1);
			else
				a.textContent=b.label;
			if(!c.parentNode) {
				c.appendChild(a);
				this.textRoot.appendChild(c)
			}
		}
	},
	getComponentsString: function(a,b) {
		for(var c=[],d=true,e=a.length,f=[],g,h=0;h<e;h++) {
			g=a[h];
			c.push(g);
			if(g=this.getShortString(g))
				f.push(g);
			else {
				h>0&&this.getShortString(a[h-1])&&f.push(this.clipLine(a[h],a[h-1]));
				h<e-1&&this.getShortString(a[h+1])&&f.push(this.clipLine(a[h],a[h+1]));
				d=false
			}
		}
		return {
			path:f.join(b||","),
			complete:d
		}
	},
	clipLine: function(a,b) {
		if(b.equals(a))
			return"";
		var c=this.getResolution(),
		d=this.MAX_PIXEL-this.translationParameters.x,e=this.MAX_PIXEL-this.translationParameters.y,f=b.x/c+this.left;
		b=this.top-b.y/c;
		var g=a.x/c+this.left;
		a=this.top-a.y/c;
		if(g<-d||g>d) {
			c=(a-b)/(g-f);
			g=g<0?-d:d;
			a=b+(g-f)*c
		}
		if(a<-e||a>e) {
			c=(g-f)/(a-b);
			a=a<0?-e:e;
			g=f+(a-b)*c
		}
		return g+","+a
	},
	getShortString: function(a) {
		var b=this.getResolution(),c=a.x/b+this.left;
		a=this.top-a.y/b;
		return this.inValidRange(c,a)?c+","+a:false
	},
	getPosition: function(a) {
		return {
			x:parseFloat(a.getAttributeNS(null,"cx")),
			y:parseFloat(a.getAttributeNS(null,
			"cy"))
		}
	},
	importSymbol: function(a) {
		if(!this.defs)
			this.defs=this.createDefs();
		var b=this.container.id+"-"+a;
		if(document.getElementById(b)!=null)
			return b;
		var c=OpenLayers.Renderer.symbol[a];
		if(c) {
			a=this.nodeFactory(b,"symbol");
			var d=this.nodeFactory(null,"polygon");
			a.appendChild(d);
			for(var e=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0),f="",g,h,i=0;i<c.length;i+=2) {
				g=c[i];
				h=c[i+1];
				e.left=Math.min(e.left,g);
				e.bottom=Math.min(e.bottom,h);
				e.right=Math.max(e.right,g);
				e.top=Math.max(e.top,
				h);
				f+=" "+g+","+h
			}
			d.setAttributeNS(null,"points",f);
			c=e.getWidth();
			d=e.getHeight();
			e=[e.left-c,e.bottom-d,c*3,d*3];
			a.setAttributeNS(null,"viewBox",e.join(" "));
			this.symbolSize[b]=Math.max(c,d)*3;
			this.defs.appendChild(a);
			return a.id
		} else throw new Error(a+" is not a valid symbol name");
	},
	CLASS_NAME:"OpenLayers.Renderer.SVG"
});
OpenLayers.Renderer.SVG.LABEL_ALIGN= {
	l:"start",
	r:"end",
	b:"bottom",
	t:"hanging"
};
OpenLayers.Renderer.SVG.LABEL_VSHIFT= {
	t:"-70%",
	b:"0"
};
OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements, {
	xmlns:"urn:schemas-microsoft-com:vml",
	symbolCache: {},
	offset:null,
	initialize: function() {
		if(this.supported()) {
			if(!document.namespaces.olv) {
				document.namespaces.add("olv",this.xmlns);
				for(var a=document.createStyleSheet(),b=["shape","rect","oval","fill","stroke","imagedata","group","textbox"],c=0,d=b.length;c<d;c++)
					a.addRule("olv\\:"+b[c],"behavior: url(#default#VML); position: absolute; display: inline-block;")
			}
			OpenLayers.Renderer.Elements.prototype.initialize.apply(this,
			arguments);
			this.offset= {
				x:0,
				y:0
			}
		}
	},
	destroy: function() {
		OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)
	},
	supported: function() {
		return!!document.namespaces
	},
	setExtent: function(a,b) {
		OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);
		var c=this.getResolution(),d=a.left/c;
		c=a.top/c-this.size.h;
		if(b) {
			this.offset= {
				x:d,
				y:c
			};
			c=d=0
		} else {
			d-=this.offset.x;
			c-=this.offset.y
		}
		d=d+" "+c;
		this.root.coordorigin=d;
		d=[this.root,this.vectorRoot,this.textRoot];
		for(var e=0,f=d.length;e<
		f;++e) {
			c=d[e];
			var g=this.size.w+" "+this.size.h;
			c.coordsize=g
		}
		this.root.style.flip="y";
		return true
	},
	setSize: function() {
		OpenLayers.Renderer.prototype.setSize.apply(this,arguments);
		for(var a=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot],b=this.size.w+"px",c=this.size.h+"px",d,e=0,f=a.length;e<f;++e) {
			d=a[e];
			d.style.width=b;
			d.style.height=c
		}
	},
	getNodeType: function(a,b) {
		var c=null;
		switch(a.CLASS_NAME) {
			case "OpenLayers.Geometry.Point":
				c=b.externalGraphic?"olv:rect":this.isComplexSymbol(b.graphicName)?
				"olv:shape":"olv:oval";
				break;
			case "OpenLayers.Geometry.Rectangle":
				c="olv:rect";
				break;
			case "OpenLayers.Geometry.LineString":
			case "OpenLayers.Geometry.LinearRing":
			case "OpenLayers.Geometry.Polygon":
			case "OpenLayers.Geometry.Curve":
			case "OpenLayers.Geometry.Surface":
				c="olv:shape";
				break;
			default:
				break
		}
		return c
	},
	setStyle: function(a,b,c,d) {
		b=b||a._style;
		c=c||a._options;
		if(a._geometryClass=="OpenLayers.Geometry.Point")
			if(b.externalGraphic) {
				if(b.graphicTitle)
					a.title=b.graphicTitle;
				var e=b.graphicWidth||b.graphicHeight,
				f=b.graphicHeight||b.graphicWidth;
				e=e?e:b.pointRadius*2;
				f=f?f:b.pointRadius*2;
				var g=this.getResolution(),h=b.graphicXOffset!=undefined?b.graphicXOffset:-(0.5*e),i=b.graphicYOffset!=undefined?b.graphicYOffset:-(0.5*f);
				a.style.left=(d.x/g-this.offset.x+h).toFixed();
				a.style.top=(d.y/g-this.offset.y-(i+f)).toFixed();
				a.style.width=e+"px";
				a.style.height=f+"px";
				a.style.flip="y";
				b.fillColor="none";
				c.isStroked=false
			} else if(this.isComplexSymbol(b.graphicName)) {
				e=this.importSymbol(b.graphicName);
				a.path=e.path;
				a.coordorigin=e.left+","+e.bottom;
				e=e.size;
				a.coordsize=e+","+e;
				this.drawCircle(a,d,b.pointRadius);
				a.style.flip="y"
			} else
				this.drawCircle(a,d,b.pointRadius);
		if(c.isFilled)
			a.fillcolor=b.fillColor;
		else
			a.filled="false";
		d=a.getElementsByTagName("fill");
		d=d.length==0?null:d[0];
		if(c.isFilled) {
			d||(d=this.createNode("olv:fill",a.id+"_fill"));
			d.opacity=b.fillOpacity;
			if(a._geometryClass=="OpenLayers.Geometry.Point"&&b.externalGraphic) {
				if(b.graphicOpacity)
					d.opacity=b.graphicOpacity;
				d.src=b.externalGraphic;
				d.type=
				"frame";
				if(!(b.graphicWidth&&b.graphicHeight))
					d.aspect="atmost"
			}
			d.parentNode!=a&&a.appendChild(d)
		} else
			d&&a.removeChild(d);
		if(typeof b.rotation!="undefined")
			if(b.externalGraphic) {
				this.graphicRotate(a,h,i);
				d.opacity=0
			} else
				a.style.rotation=b.rotation;
		if(c.isStroked) {
			a.strokecolor=b.strokeColor;
			a.strokeweight=b.strokeWidth+"px"
		} else
			a.stroked=false;
		h=a.getElementsByTagName("stroke");
		h=h.length==0?null:h[0];
		if(c.isStroked) {
			if(!h) {
				h=this.createNode("olv:stroke",a.id+"_stroke");
				a.appendChild(h)
			}
			h.opacity=
			b.strokeOpacity;
			h.endcap=!b.strokeLinecap||b.strokeLinecap=="butt"?"flat":b.strokeLinecap;
			h.dashstyle=this.dashStyle(b)
		} else
			h&&a.removeChild(h);
		if(b.cursor!="inherit"&&b.cursor!=null)
			a.style.cursor=b.cursor;
		return a
	},
	graphicRotate: function(a,b,c) {
		var d=d||a._style,e,f;
		if(d.graphicWidth&&d.graphicHeight) {
			f=Math.max(d.graphicWidth,d.graphicHeight);
			e=d.graphicWidth/d.graphicHeight;
			var g=Math.round(d.graphicWidth||f*e),h=Math.round(d.graphicHeight||f);
			a.style.width=g+"px";
			a.style.height=h+"px";
			var i=
			document.getElementById(a.id+"_image");
			if(!i) {
				i=this.createNode("olv:imagedata",a.id+"_image");
				a.appendChild(i)
			}
			i.style.width=g+"px";
			i.style.height=h+"px";
			i.src=d.externalGraphic;
			i.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";
			var j=d.rotation*Math.PI/180;
			i=Math.sin(j);
			j=Math.cos(j);
			i="progid:DXImageTransform.Microsoft.Matrix(M11="+j+",M12="+-i+",M21="+i+",M22="+j+",SizingMethod='auto expand')\n";
			if((j=d.graphicOpacity||d.fillOpacity)&&j!=1)
				i+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+
				j+")\n";
			a.style.filter=i;
			i=new OpenLayers.Geometry.Point(-b,-c);
			g=(new OpenLayers.Bounds(0,0,g,h)).toGeometry();
			g.rotate(d.rotation,i);
			g=g.getBounds();
			a.style.left=Math.round(parseInt(a.style.left)+g.left)+"px";
			a.style.top=Math.round(parseInt(a.style.top)-g.bottom)+"px"
		} else {
			var l=new Image;
			l.onreadystatechange=OpenLayers.Function.bind( function() {
				if(l.readyState=="complete"||l.readyState=="interactive") {
					e=l.width/l.height;
					f=Math.max(d.pointRadius*2,d.graphicWidth||0,d.graphicHeight||0);
					b*=e;
					d.graphicWidth=
					f*e;
					d.graphicHeight=f;
					this.graphicRotate(a,b,c)
				}
			},this);
			l.src=d.externalGraphic
		}
	},
	postDraw: function(a) {
		var b=a._style.fillColor,c=a._style.strokeColor;
		if(b=="none"&&a.fillcolor!=b)
			a.fillcolor=b;
		if(c=="none"&&a.strokecolor!=c)
			a.strokecolor=c
	},
	setNodeDimension: function(a,b) {
		if(b=b.getBounds()) {
			var c=this.getResolution();
			b=new OpenLayers.Bounds((b.left/c-this.offset.x).toFixed(),(b.bottom/c-this.offset.y).toFixed(),(b.right/c-this.offset.x).toFixed(),(b.top/c-this.offset.y).toFixed());
			a.style.left=b.left+
			"px";
			a.style.top=b.top+"px";
			a.style.width=b.getWidth()+"px";
			a.style.height=b.getHeight()+"px";
			a.coordorigin=b.left+" "+b.top;
			a.coordsize=b.getWidth()+" "+b.getHeight()
		}
	},
	dashStyle: function(a) {
		a=a.strokeDashstyle;
		switch(a) {
			case "solid":
			case "dot":
			case "dash":
			case "dashdot":
			case "longdash":
			case "longdashdot":
				return a;
			default:
				a=a.split(/[ ,]/);
				if(a.length==2) {
					if(1*a[0]>=2*a[1])
						return"longdash";
					return a[0]==1||a[1]==1?"dot":"dash"
				} else if(a.length==4)
					return 1*a[0]>=2*a[1]?"longdashdot":"dashdot";
				return"solid"
		}
	},
	createNode: function(a,b) {
		a=document.createElement(a);
		if(b)
			a.id=b;
		a.unselectable="on";
		a.onselectstart= function() {
			return false
		};
		return a
	},
	nodeTypeCompare: function(a,b) {
		b=b;
		var c=b.indexOf(":");
		if(c!=-1)
			b=b.substr(c+1);
		a=a.nodeName;
		c=a.indexOf(":");
		if(c!=-1)
			a=a.substr(c+1);
		return b==a
	},
	createRenderRoot: function() {
		return this.nodeFactory(this.container.id+"_vmlRoot","div")
	},
	createRoot: function(a) {
		return this.nodeFactory(this.container.id+a,"olv:group")
	},
	drawPoint: function(a,b) {
		return this.drawCircle(a,
		b,1)
	},
	drawCircle: function(a,b,c) {
		if(!isNaN(b.x)&&!isNaN(b.y)) {
			var d=this.getResolution();
			a.style.left=(b.x/d-this.offset.x).toFixed()-c+"px";
			a.style.top=(b.y/d-this.offset.y).toFixed()-c+"px";
			b=c*2;
			a.style.width=b+"px";
			a.style.height=b+"px";
			return a
		}
		return false
	},
	drawLineString: function(a,b) {
		return this.drawLine(a,b,false)
	},
	drawLinearRing: function(a,b) {
		return this.drawLine(a,b,true)
	},
	drawLine: function(a,b,c) {
		this.setNodeDimension(a,b);
		for(var d=this.getResolution(),e=b.components.length,f=new Array(e),
		g,h,i=0;i<e;i++) {
			g=b.components[i];
			h=g.x/d-this.offset.x;
			g=g.y/d-this.offset.y;
			f[i]=" "+h.toFixed()+","+g.toFixed()+" l "
		}
		b=c?" x e":" e";
		a.path="m"+f.join("")+b;
		return a
	},
	drawPolygon: function(a,b) {
		this.setNodeDimension(a,b);
		var c=this.getResolution(),d=[],e,f,g,h,i,j,l;
		g=0;
		for(h=b.components.length;g<h;g++) {
			e=b.components[g];
			d.push("m");
			f=0;
			for(i=e.components.length;f<i;f++) {
				j=e.components[f];
				l=j.x/c-this.offset.x;
				j=j.y/c-this.offset.y;
				d.push(" "+l.toFixed()+","+j.toFixed());
				f==0&&d.push(" l")
			}
			d.push(" x ")
		}
		d.push("e");
		a.path=d.join("");
		return a
	},
	drawRectangle: function(a,b) {
		var c=this.getResolution();
		a.style.left=b.x/c-this.offset.x+"px";
		a.style.top=b.y/c-this.offset.y+"px";
		a.style.width=b.width/c+"px";
		a.style.height=b.height/c+"px";
		return a
	},
	drawText: function(a,b,c) {
		var d=this.nodeFactory(a+this.LABEL_ID_SUFFIX,"olv:rect");
		a=this.nodeFactory(a+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox");
		var e=this.getResolution();
		d.style.left=(c.x/e-this.offset.x).toFixed()+"px";
		d.style.top=(c.y/e-this.offset.y).toFixed()+"px";
		d.style.flip="y";
		a.innerText=b.label;
		if(b.fillColor)
			a.style.color=b.fontColor;
		if(b.fontFamily)
			a.style.fontFamily=b.fontFamily;
		if(b.fontSize)
			a.style.fontSize=b.fontSize;
		if(b.fontWeight)
			a.style.fontWeight=b.fontWeight;
		a.style.whiteSpace="nowrap";
		a.inset="1px,0px,0px,0px";
		if(!d.parentNode) {
			d.appendChild(a);
			this.textRoot.appendChild(d)
		}
		c=b.labelAlign||"cm";
		b=a.clientWidth*OpenLayers.Renderer.VML.LABEL_SHIFT[c.substr(0,1)];
		a=a.clientHeight*OpenLayers.Renderer.VML.LABEL_SHIFT[c.substr(1,1)];
		d.style.left=
		parseInt(d.style.left)-b-1+"px";
		d.style.top=parseInt(d.style.top)+a+"px"
	},
	drawSurface: function(a,b) {
		this.setNodeDimension(a,b);
		for(var c=this.getResolution(),d=[],e,f,g=0,h=b.components.length;g<h;g++) {
			e=b.components[g];
			f=e.x/c-this.offset.x;
			e=e.y/c-this.offset.y;
			if(g%3==0&&g/3==0)
				d.push("m");
			else
				g%3==1&&d.push(" c");
			d.push(" "+f+","+e)
		}
		d.push(" x e");
		a.path=d.join("");
		return a
	},
	moveRoot: function(a) {
		var b=this.map.getLayer(a.container.id);
		if(b instanceof OpenLayers.Layer.Vector.RootContainer)
			b=this.map.getLayer(this.container.id);
		b&&b.renderer.clear();
		OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments);
		b&&b.redraw()
	},
	importSymbol: function(a) {
		var b=this.container.id+"-"+a,c=this.symbolCache[b];
		if(c)
			return c;
		if(c=OpenLayers.Renderer.symbol[a]) {
			a=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);
			for(var d=["m"],e=0;e<c.length;e+=2) {
				x=c[e];
				y=c[e+1];
				a.left=Math.min(a.left,x);
				a.bottom=Math.min(a.bottom,y);
				a.right=Math.max(a.right,x);
				a.top=Math.max(a.top,y);
				d.push(x);
				d.push(y);
				e==0&&d.push("l")
			}
			d.push("x e");
			c=d.join(" ");
			d=(a.getWidth()-a.getHeight())/2;
			if(d>0) {
				a.bottom-=d;
				a.top+=d
			} else {
				a.left-=d;
				a.right+=d
			}
			c= {
				path:c,
				size:a.getWidth(),
				left:a.left,
				bottom:a.bottom
			};
			return this.symbolCache[b]=c
		} else throw new Error(a+" is not a valid symbol name");
	},
	CLASS_NAME:"OpenLayers.Renderer.VML"
});
OpenLayers.Renderer.VML.LABEL_SHIFT= {
	l:0,
	c:0.5,
	r:1,
	t:0,
	m:0.5,
	b:1
};
OpenLayers.Tile=OpenLayers.Class({
	EVENT_TYPES:["loadstart","loadend","reload","unload"],
	events:null,
	id:null,
	layer:null,
	url:null,
	bounds:null,
	size:null,
	position:null,
	isLoading:false,
	initialize: function(a,b,c,d,e) {
		this.layer=a;
		this.position=b.clone();
		this.bounds=c.clone();
		this.url=d;
		this.size=e.clone();
		this.id=OpenLayers.Util.createUniqueID("Tile_");
		this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES)
	},
	unload: function() {
		if(this.isLoading) {
			this.isLoading=false;
			this.events.triggerEvent("unload")
		}
	},
	destroy: function() {
		this.position=this.size=this.bounds=this.layer=null;
		this.events.destroy();
		this.events=null
	},
	clone: function(a) {
		if(a==null)
			a=new OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size);
		OpenLayers.Util.applyDefaults(a,this);
		return a
	},
	draw: function() {
		var a=this.layer.maxExtent;
		this.shouldDraw=(a=a&&this.bounds.intersectsBounds(a,false))||this.layer.displayOutsideMaxExtent;
		this.clear();
		return this.shouldDraw
	},
	moveTo: function(a,b,c) {
		if(c==null)
			c=true;
		this.bounds=a.clone();
		this.position=b.clone();
		c&&this.draw()
	},
	clear: function() {
	},
	getBoundsFromBaseLayer: function(a) {
		var b=OpenLayers.i18n("reprojectDeprecated", {
			layerName:this.layer.name
		});
		OpenLayers.Console.warn(b);
		b=this.layer.map.getLonLatFromLayerPx(a);
		a=a.clone();
		a.x+=this.size.w;
		a.y+=this.size.h;
		a=this.layer.map.getLonLatFromLayerPx(a);
		if(b.lon>a.lon)
			if(b.lon<0)
				b.lon=-180-(b.lon+180);
			else
				a.lon=180+a.lon+180;
		return b=new OpenLayers.Bounds(b.lon,a.lat,a.lon,b.lat)
	},
	showTile: function() {
		this.shouldDraw&&this.show()
	},
	show: function() {
	},
	hide: function() {
	},
	CLASS_NAME:"OpenLayers.Tile"
});
OpenLayers.Control.NavigationHistory=OpenLayers.Class(OpenLayers.Control, {
	type:OpenLayers.Control.TYPE_TOGGLE,
	previous:null,
	previousOptions:null,
	next:null,
	nextOptions:null,
	limit:50,
	activateOnDraw:true,
	clearOnDeactivate:false,
	registry:null,
	nextStack:null,
	previousStack:null,
	listeners:null,
	restoring:false,
	initialize: function(a) {
		OpenLayers.Control.prototype.initialize.apply(this,[a]);
		this.registry=OpenLayers.Util.extend({
			moveend: function() {
				return {
					center:this.map.getCenter(),
					resolution:this.map.getResolution()
				}
			}
		},
		this.registry);
		this.clear();
		a= {
			trigger:OpenLayers.Function.bind(this.previousTrigger,this),
			displayClass:this.displayClass+" "+this.displayClass+"Previous"
		};
		OpenLayers.Util.extend(a,this.previousOptions);
		this.previous=new OpenLayers.Control.Button(a);
		a= {
			trigger:OpenLayers.Function.bind(this.nextTrigger,this),
			displayClass:this.displayClass+" "+this.displayClass+"Next"
		};
		OpenLayers.Util.extend(a,this.nextOptions);
		this.next=new OpenLayers.Control.Button(a)
	},
	onPreviousChange: function(a) {
		if(a&&!this.previous.active)
			this.previous.activate();
		else
			!a&&this.previous.active&&this.previous.deactivate()
	},
	onNextChange: function(a) {
		if(a&&!this.next.active)
			this.next.activate();
		else
			!a&&this.next.active&&this.next.deactivate()
	},
	destroy: function() {
		OpenLayers.Control.prototype.destroy.apply(this);
		this.previous.destroy();
		this.next.destroy();
		this.deactivate();
		for(var a in this)
			this[a]=null
	},
	setMap: function(a) {
		this.map=a;
		this.next.setMap(a);
		this.previous.setMap(a)
	},
	draw: function() {
		OpenLayers.Control.prototype.draw.apply(this,arguments);
		this.next.draw();
		this.previous.draw();
		this.activateOnDraw&&this.activate()
	},
	previousTrigger: function() {
		var a=this.previousStack.shift(),b=this.previousStack.shift();
		if(b!=undefined) {
			this.nextStack.unshift(a);
			this.previousStack.unshift(b);
			this.restoring=true;
			this.restore(b);
			this.restoring=false;
			this.onNextChange(this.nextStack[0],this.nextStack.length);
			this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)
		} else
			this.previousStack.unshift(a);
		return b
	},
	nextTrigger: function() {
		var a=this.nextStack.shift();
		if(a!=undefined) {
			this.previousStack.unshift(a);
			this.restoring=true;
			this.restore(a);
			this.restoring=false;
			this.onNextChange(this.nextStack[0],this.nextStack.length);
			this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)
		}
		return a
	},
	clear: function() {
		this.previousStack=[];
		this.nextStack=[]
	},
	restore: function(a) {
		var b=this.map.getZoomForResolution(a.resolution);
		this.map.setCenter(a.center,b)
	},
	setListeners: function() {
		this.listeners= {};
		for(var a in this.registry)
			this.listeners[a]=OpenLayers.Function.bind( function() {
				if(!this.restoring) {
					var b=
					this.registry[a].apply(this,arguments);
					this.previousStack.unshift(b);
					this.previousStack.length>1&&this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);
					this.previousStack.length>this.limit+1&&this.previousStack.pop();
					if(this.nextStack.length>0) {
						this.nextStack=[];
						this.onNextChange(null,0)
					}
				}
				return true
			},this)
	},
	activate: function() {
		var a=false;
		if(this.map)
			if(OpenLayers.Control.prototype.activate.apply(this)) {
				this.listeners==null&&this.setListeners();
				for(var b in this.listeners)
					this.map.events.register(b,
					this,this.listeners[b]);
				a=true;
				this.previousStack.length==0&&this.initStack()
			}
		return a
	},
	initStack: function() {
		this.map.getCenter()&&this.listeners.moveend()
	},
	deactivate: function() {
		var a=false;
		if(this.map)
			if(OpenLayers.Control.prototype.deactivate.apply(this)) {
				for(var b in this.listeners)
					this.map.events.unregister(b,this,this.listeners[b]);
				this.clearOnDeactivate&&this.clear();
				a=true
			}
		return a
	},
	CLASS_NAME:"OpenLayers.Control.NavigationHistory"
});
OpenLayers.Control.PanPanel=OpenLayers.Class(OpenLayers.Control.Panel, {
	initialize: function(a) {
		OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);
		this.addControls([new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST)])
	},
	CLASS_NAME:"OpenLayers.Control.PanPanel"
});
OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom, {
	zoomStopWidth:18,
	zoomStopHeight:11,
	slider:null,
	sliderEvents:null,
	zoomBarDiv:null,
	divEvents:null,
	zoomWorldIcon:false,
	initialize: function() {
		OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments)
	},
	destroy: function() {
		this._removeZoomBar();
		this.map.events.un({
			changebaselayer:this.redraw,
			scope:this
		});
		OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments)
	},
	setMap: function() {
		OpenLayers.Control.PanZoom.prototype.setMap.apply(this,
		arguments);
		this.map.events.register("changebaselayer",this,this.redraw)
	},
	redraw: function() {
		if(this.div!=null) {
			this.removeButtons();
			this._removeZoomBar()
		}
		this.draw()
	},
	draw: function(a) {
		OpenLayers.Control.prototype.draw.apply(this,arguments);
		a=this.position.clone();
		this.buttons=[];
		var b=new OpenLayers.Size(18,18),c=new OpenLayers.Pixel(a.x+b.w/2,a.y),d=b.w;
		if(this.zoomWorldIcon)
			c=new OpenLayers.Pixel(a.x+b.w,a.y);
		this._addButton("panup","north-mini.png",c,b);
		a.y=c.y+b.h;
		this._addButton("panleft","west-mini.png",
		a,b);
		if(this.zoomWorldIcon) {
			this._addButton("zoomworld","zoom-world-mini.png",a.add(b.w,0),b);
			d*=2
		}
		this._addButton("panright","east-mini.png",a.add(d,0),b);
		this._addButton("pandown","south-mini.png",c.add(0,b.h*2),b);
		this._addButton("zoomin","zoom-plus-mini.png",c.add(0,b.h*3+5),b);
		c=this._addZoomBar(c.add(0,b.h*4+5));
		this._addButton("zoomout","zoom-minus-mini.png",c,b);
		return this.div
	},
	_addZoomBar: function(a) {
		var b=OpenLayers.Util.getImagesLocation(),c=this.id+"_"+this.map.id,d=this.map.getNumZoomLevels()-
		1-this.map.getZoom();
		this.slider=d=OpenLayers.Util.createAlphaImageDiv(c,a.add(-1,d*this.zoomStopHeight),new OpenLayers.Size(20,9),b+"slider.png","absolute");
		this.sliderEvents=new OpenLayers.Events(this,d,null,true, {
			includeXY:true
		});
		this.sliderEvents.on({
			mousedown:this.zoomBarDown,
			mousemove:this.zoomBarDrag,
			mouseup:this.zoomBarUp,
			dblclick:this.doubleClick,
			click:this.doubleClick
		});
		var e=new OpenLayers.Size;
		e.h=this.zoomStopHeight*this.map.getNumZoomLevels();
		e.w=this.zoomStopWidth;
		c=null;
		if(OpenLayers.Util.alphaHack()) {
			c=
			this.id+"_"+this.map.id;
			c=OpenLayers.Util.createAlphaImageDiv(c,a,new OpenLayers.Size(e.w,this.zoomStopHeight),b+"zoombar.png","absolute",null,"crop");
			c.style.height=e.h+"px"
		} else
			c=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,a,e,b+"zoombar.png");
		this.zoombarDiv=c;
		this.divEvents=new OpenLayers.Events(this,c,null,true, {
			includeXY:true
		});
		this.divEvents.on({
			mousedown:this.divClick,
			mousemove:this.passEventToSlider,
			dblclick:this.doubleClick,
			click:this.doubleClick
		});
		this.div.appendChild(c);
		this.startTop=parseInt(c.style.top);
		this.div.appendChild(d);
		this.map.events.register("zoomend",this,this.moveZoomBar);
		return a=a.add(0,this.zoomStopHeight*this.map.getNumZoomLevels())
	},
	_removeZoomBar: function() {
		this.sliderEvents.un({
			mousedown:this.zoomBarDown,
			mousemove:this.zoomBarDrag,
			mouseup:this.zoomBarUp,
			dblclick:this.doubleClick,
			click:this.doubleClick
		});
		this.sliderEvents.destroy();
		this.divEvents.un({
			mousedown:this.divClick,
			mousemove:this.passEventToSlider,
			dblclick:this.doubleClick,
			click:this.doubleClick
		});
		this.divEvents.destroy();
		this.div.removeChild(this.zoombarDiv);
		this.zoombarDiv=null;
		this.div.removeChild(this.slider);
		this.slider=null;
		this.map.events.unregister("zoomend",this,this.moveZoomBar)
	},
	passEventToSlider: function(a) {
		this.sliderEvents.handleBrowserEvent(a)
	},
	divClick: function(a) {
		if(OpenLayers.Event.isLeftClick(a)) {
			var b=a.xy.y,c=OpenLayers.Util.pagePosition(a.object)[1];
			b=(b-c)/this.zoomStopHeight;
			this.map.fractionalZoom||(b=Math.floor(b));
			b=this.map.getNumZoomLevels()-1-b;
			b=Math.min(Math.max(b,
			0),this.map.getNumZoomLevels()-1);
			this.map.zoomTo(b);
			OpenLayers.Event.stop(a)
		}
	},
	zoomBarDown: function(a) {
		if(OpenLayers.Event.isLeftClick(a)) {
			this.map.events.on({
				mousemove:this.passEventToSlider,
				mouseup:this.passEventToSlider,
				scope:this
			});
			this.mouseDragStart=a.xy.clone();
			this.zoomStart=a.xy.clone();
			this.div.style.cursor="move";
			this.zoombarDiv.offsets=null;
			OpenLayers.Event.stop(a)
		}
	},
	zoomBarDrag: function(a) {
		if(this.mouseDragStart!=null) {
			var b=this.mouseDragStart.y-a.xy.y,c=OpenLayers.Util.pagePosition(this.zoombarDiv);
			if(a.clientY-c[1]>0&&a.clientY-c[1]<parseInt(this.zoombarDiv.style.height)-2) {
				b=parseInt(this.slider.style.top)-b;
				this.slider.style.top=b+"px";
				this.mouseDragStart=a.xy.clone()
			}
			OpenLayers.Event.stop(a)
		}
	},
	zoomBarUp: function(a) {
		if(OpenLayers.Event.isLeftClick(a))
			if(this.zoomStart) {
				this.div.style.cursor="";
				this.map.events.un({
					mouseup:this.passEventToSlider,
					mousemove:this.passEventToSlider,
					scope:this
				});
				var b=this.zoomStart.y-a.xy.y,c=this.map.zoom;
				if(this.map.fractionalZoom) {
					c+=b/this.zoomStopHeight;
					c=
					Math.min(Math.max(c,0),this.map.getNumZoomLevels()-1)
				} else
					c+=Math.round(b/this.zoomStopHeight);
				this.map.zoomTo(c);
				this.moveZoomBar();
				this.mouseDragStart=null;
				OpenLayers.Event.stop(a)
			}
	},
	moveZoomBar: function() {
		var a=(this.map.getNumZoomLevels()-1-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;
		this.slider.style.top=a+"px"
	},
	CLASS_NAME:"OpenLayers.Control.PanZoomBar"
});
OpenLayers.Control.ZoomPanel=OpenLayers.Class(OpenLayers.Control.Panel, {
	initialize: function(a) {
		OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);
		this.addControls([new OpenLayers.Control.ZoomIn,new OpenLayers.Control.ZoomToMaxExtent,new OpenLayers.Control.ZoomOut])
	},
	CLASS_NAME:"OpenLayers.Control.ZoomPanel"
});
OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format, {
	indent:"    ",
	space:" ",
	newline:"\n",
	level:0,
	pretty:false,
	initialize: function(a) {
		OpenLayers.Format.prototype.initialize.apply(this,[a])
	},
	read: function(a,b) {
		try {
			if(/^[\],:{}\s]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))) {
				var c=eval("("+a+")");
				if(typeof b==="function") {
					function d(f,g) {
						if(g&&typeof g==="object")
							for(var h in g)
								if(g.hasOwnProperty(h))
									g[h]=
									d(h,g[h]);
						return b(f,g)
					}

					c=d("",c)
				}
				if(this.keepData)
					this.data=c;
				return c
			}
		} catch(e) {
		}
		return null
	},
	write: function(a,b) {
		this.pretty=!!b;
		b=null;
		var c=typeof a;
		if(this.serialize[c])
			try {
				b=this.serialize[c].apply(this,[a])
			} catch(d) {
				OpenLayers.Console.error("Trouble serializing: "+d)
			}
		return b
	},
	writeIndent: function() {
		var a=[];
		if(this.pretty)
			for(var b=0;b<this.level;++b)
				a.push(this.indent);
		return a.join("")
	},
	writeNewline: function() {
		return this.pretty?this.newline:""
	},
	writeSpace: function() {
		return this.pretty?
		this.space:""
	},
	serialize: {
		object: function(a) {
			if(a==null)
				return"null";
			if(a.constructor==Date)
				return this.serialize.date.apply(this,[a]);
			if(a.constructor==Array)
				return this.serialize.array.apply(this,[a]);
			var b=["{"];
			this.level+=1;
			var c,d,e,f=false;
			for(c in a)
				if(a.hasOwnProperty(c)) {
					d=OpenLayers.Format.JSON.prototype.write.apply(this,[c,this.pretty]);
					e=OpenLayers.Format.JSON.prototype.write.apply(this,[a[c],this.pretty]);
					if(d!=null&&e!=null) {
						f&&b.push(",");
						b.push(this.writeNewline(),this.writeIndent(),
						d,":",this.writeSpace(),e);
						f=true
					}
				}
			this.level-=1;
			b.push(this.writeNewline(),this.writeIndent(),"}");
			return b.join("")
		},
		array: function(a) {
			var b,c=["["];
			this.level+=1;
			for(var d=0,e=a.length;d<e;++d) {
				b=OpenLayers.Format.JSON.prototype.write.apply(this,[a[d],this.pretty]);
				if(b!=null) {
					d>0&&c.push(",");
					c.push(this.writeNewline(),this.writeIndent(),b)
				}
			}
			this.level-=1;
			c.push(this.writeNewline(),this.writeIndent(),"]");
			return c.join("")
		},
		string: function(a) {
			var b= {
				"\u0008":"\\b",
				"\t":"\\t",
				"\n":"\\n",
				"\u000c":"\\f",
				"\r":"\\r",
				'"':'\\"',
				"\\":"\\\\"
			};
			if(/["\\\x00-\x1f]/.test(a))
				return'"'+a.replace(/([\x00-\x1f\\"])/g, function(c,d) {
					if(c=b[d])
						return c;
					c=d.charCodeAt();
					return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)
				})+'"';
			return'"'+a+'"'
		},
		number: function(a) {
			return isFinite(a)?String(a):"null"
		},
		"boolean": function(a) {
			return String(a)
		},
		date: function(a) {
			function b(c) {
				return c<10?"0"+c:c
			}

			return'"'+a.getFullYear()+"-"+b(a.getMonth()+1)+"-"+b(a.getDate())+"T"+b(a.getHours())+":"+b(a.getMinutes())+":"+b(a.getSeconds())+
			'"'
		}
	},
	CLASS_NAME:"OpenLayers.Format.JSON"
});
OpenLayers.Format.XML=OpenLayers.Class(OpenLayers.Format, {
	namespaces:null,
	namespaceAlias:null,
	defaultPrefix:null,
	readers: {},
	writers: {},
	xmldom:null,
	initialize: function(a) {
		if(window.ActiveXObject)
			this.xmldom=new ActiveXObject("Microsoft.XMLDOM");
		OpenLayers.Format.prototype.initialize.apply(this,[a]);
		this.namespaces=OpenLayers.Util.extend({},this.namespaces);
		this.namespaceAlias= {};
		for(var b in this.namespaces)
			this.namespaceAlias[this.namespaces[b]]=b
	},
	destroy: function() {
		this.xmldom=null;
		OpenLayers.Format.prototype.destroy.apply(this,
		arguments)
	},
	setNamespace: function(a,b) {
		this.namespaces[a]=b;
		this.namespaceAlias[b]=a
	},
	read: function(a) {
		var b=a.indexOf("<");
		if(b>0)
			a=a.substring(b);
		b=OpenLayers.Util.Try(OpenLayers.Function.bind( function() {
			var c;
			c=window.ActiveXObject&&!this.xmldom?new ActiveXObject("Microsoft.XMLDOM"):this.xmldom;
			c.loadXML(a);
			return c
		},this), function() {
			return(new DOMParser).parseFromString(a,"text/xml")
		}, function() {
			var c=new XMLHttpRequest;
			c.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(a),false);
			c.overrideMimeType&&c.overrideMimeType("text/xml");
			c.send(null);
			return c.responseXML
		});
		if(this.keepData)
			this.data=b;
		return b
	},
	write: function(a) {
		if(this.xmldom)
			a=a.xml;
		else {
			var b=new XMLSerializer;
			if(a.nodeType==1) {
				var c=document.implementation.createDocument("","",null);
				if(c.importNode)
					a=c.importNode(a,true);
				c.appendChild(a);
				a=b.serializeToString(c)
			} else
				a=b.serializeToString(a)
		}
		return a
	},
	createElementNS: function(a,b) {
		return a=this.xmldom?typeof a=="string"?this.xmldom.createNode(1,b,a):this.xmldom.createNode(1,
		b,""):document.createElementNS(a,b)
	},
	createTextNode: function(a) {
		return a=this.xmldom?this.xmldom.createTextNode(a):document.createTextNode(a)
	},
	getElementsByTagNameNS: function(a,b,c) {
		var d=[];
		if(a.getElementsByTagNameNS)
			d=a.getElementsByTagNameNS(b,c);
		else {
			a=a.getElementsByTagName("*");
			for(var e,f,g=0,h=a.length;g<h;++g) {
				e=a[g];
				f=e.prefix?e.prefix+":"+c:c;
				if(c=="*"||f==e.nodeName)
					if(b=="*"||b==e.namespaceURI)
						d.push(e)
			}
		}
		return d
	},
	getAttributeNodeNS: function(a,b,c) {
		var d=null;
		if(a.getAttributeNodeNS)
			d=
			a.getAttributeNodeNS(b,c);
		else {
			a=a.attributes;
			for(var e,f,g=0,h=a.length;g<h;++g) {
				e=a[g];
				if(e.namespaceURI==b) {
					f=e.prefix?e.prefix+":"+c:c;
					if(f==e.nodeName) {
						d=e;
						break
					}
				}
			}
		}
		return d
	},
	getAttributeNS: function(a,b,c) {
		var d="";
		if(a.getAttributeNS)
			d=a.getAttributeNS(b,c)||"";
		else if(a=this.getAttributeNodeNS(a,b,c))
			d=a.nodeValue;
		return d
	},
	getChildValue: function(a,b) {
		b=b||"";
		if(a)
			for(a=a.firstChild;a;a=a.nextSibling)
				switch(a.nodeType) {
					case 3:
					case 4:
						b+=a.nodeValue
				}
		return b
	},
	concatChildValues: function(a,b) {
		var c=
		"";
		a=a.firstChild;
		for(var d;a;) {
			if(d=a.nodeValue)
				c+=d;
			a=a.nextSibling
		}
		if(c==""&&b!=undefined)
			c=b;
		return c
	},
	isSimpleContent: function(a) {
		var b=true;
		for(a=a.firstChild;a;a=a.nextSibling)
			if(a.nodeType===1) {
				b=false;
				break
			}
		return b
	},
	contentType: function(a) {
		var b=false,c=false,d=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY;
		for(a=a.firstChild;a;a=a.nextSibling) {
			switch(a.nodeType) {
				case 1:
					c=true;
					break;
				case 8:
					break;
				default:
					b=true
			}
			if(c&&b)
				break
		}
		if(c&&b)
			d=OpenLayers.Format.XML.CONTENT_TYPE.MIXED;
		else if(c)
			return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX;
		else if(b)
			return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE;
		return d
	},
	hasAttributeNS: function(a,b,c) {
		var d=false;
		return d=a.hasAttributeNS?a.hasAttributeNS(b,c):!!this.getAttributeNodeNS(a,b,c)
	},
	setAttributeNS: function(a,b,c,d) {
		if(a.setAttributeNS)
			a.setAttributeNS(b,c,d);
		else if(this.xmldom)
			if(b) {
				b=a.ownerDocument.createNode(2,c,b);
				b.nodeValue=d;
				a.setAttributeNode(b)
			} else
				a.setAttribute(c,d);
		else throw"setAttributeNS not implemented";
	},
	createElementNSPlus: function(a,b) {
		b=b|| {};
		var c=b.uri||this.namespaces[b.prefix];
		if(!c) {
			c=a.indexOf(":");
			c=this.namespaces[a.substring(0,c)]
		}
		c||(c=this.namespaces[this.defaultPrefix]);
		a=this.createElementNS(c,a);
		b.attributes&&this.setAttributes(a,b.attributes);
		b=b.value;
		if(b!=null) {
			if(typeof b=="boolean")
				b=String(b);
			a.appendChild(this.createTextNode(b))
		}
		return a
	},
	setAttributes: function(a,b) {
		var c,d;
		for(var e in b)
			if(b[e]!=null&&b[e].toString) {
				c=b[e].toString();
				d=this.namespaces[e.substring(0,e.indexOf(":"))]||null;
				this.setAttributeNS(a,d,e,c)
			}
	},
	readNode: function(a,b) {
		b||(b= {});
		var c=this.readers[this.namespaceAlias[a.namespaceURI]];
		if(c) {
			var d=a.localName||a.nodeName.split(":").pop();
			(c=c[d]||c["*"])&&c.apply(this,[a,b])
		}
		return b
	},
	readChildNodes: function(a,b) {
		b||(b= {});
		a=a.childNodes;
		for(var c,d=0,e=a.length;d<e;++d) {
			c=a[d];
			c.nodeType==1&&this.readNode(c,b)
		}
		return b
	},
	writeNode: function(a,b,c) {
		var d,e=a.indexOf(":");
		if(e>0) {
			d=a.substring(0,e);
			a=a.substring(e+1)
		} else {
			d=c?this.namespaceAlias[c.namespaceURI]:this.defaultPrefix;
			a=a
		}
		b=this.writers[d][a].apply(this,[b]);
		c&&c.appendChild(b);
		return b
	},
	getChildEl: function(a,b,c) {
		return a&&this.getThisOrNextEl(a.firstChild,b,c)
	},
	getNextEl: function(a,b,c) {
		return a&&this.getThisOrNextEl(a.nextSibling,b,c)
	},
	getThisOrNextEl: function(a,b,c) {
		a=a;a:
		for(;a;a=a.nextSibling)
			switch(a.nodeType) {
				case 1:
					if((!b||b===(a.localName||a.nodeName.split(":").pop()))&&(!c||c===a.namespaceURI))
						break a;
					a=null;
					break a;
				case 3:
					if(/^\s*$/.test(a.nodeValue))
						break;
				case 4:
				case 6:
				case 12:
				case 10:
				case 11:
					a=null;
					break a
			}
		return a||null
	},
	lookupNamespaceURI: function(a,b) {
		var c=
		null;
		if(a)
			if(a.lookupNamespaceURI)
				c=a.lookupNamespaceURI(b);
			else a:
				switch(a.nodeType) {
					case 1:
						if(a.namespaceURI!==null&&a.prefix===b) {
							c=a.namespaceURI;
							break a
						}
						if(c=a.attributes.length)
							for(var d,e=0;e<c;++e) {
								d=a.attributes[e];
								if(d.prefix==="xmlns"&&d.name==="xmlns:"+b) {
									c=d.value||null;
									break a
								} else if(d.name==="xmlns"&&b===null) {
									c=d.value||null;
									break a
								}
							}
						c=this.lookupNamespaceURI(a.parentNode,b);
						break a;
					case 2:
						c=this.lookupNamespaceURI(a.ownerElement,b);
						break a;
					case 9:
						c=this.lookupNamespaceURI(a.documentElement,
						b);
						break a;
					case 6:
					case 12:
					case 10:
					case 11:
						break a;
					default:
						c=this.lookupNamespaceURI(a.parentNode,b);
						break a
				}
		return c
	},
	CLASS_NAME:"OpenLayers.Format.XML"
});
OpenLayers.Format.XML.CONTENT_TYPE= {
	EMPTY:0,
	SIMPLE:1,
	COMPLEX:2,
	MIXED:3
};
OpenLayers.Format.XML.lookupNamespaceURI=OpenLayers.Function.bind(OpenLayers.Format.XML.prototype.lookupNamespaceURI,OpenLayers.Format.XML.prototype);
OpenLayers.Handler=OpenLayers.Class({
	id:null,
	control:null,
	map:null,
	keyMask:null,
	active:false,
	evt:null,
	initialize: function(a,b,c) {
		OpenLayers.Util.extend(this,c);
		this.control=a;
		this.callbacks=b;
		a.map&&this.setMap(a.map);
		OpenLayers.Util.extend(this,c);
		this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")
	},
	setMap: function(a) {
		this.map=a
	},
	checkModifiers: function(a) {
		if(this.keyMask==null)
			return true;
		a=(a.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(a.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(a.altKey?OpenLayers.Handler.MOD_ALT:
			0);
		return a==this.keyMask
	},
	activate: function() {
		if(this.active)
			return false;
		for(var a=OpenLayers.Events.prototype.BROWSER_EVENTS,b=0,c=a.length;b<c;b++)
			this[a[b]]&&this.register(a[b],this[a[b]]);
		return this.active=true
	},
	deactivate: function() {
		if(!this.active)
			return false;
		for(var a=OpenLayers.Events.prototype.BROWSER_EVENTS,b=0,c=a.length;b<c;b++)
			this[a[b]]&&this.unregister(a[b],this[a[b]]);
		this.active=false;
		return true
	},
	callback: function(a,b) {
		a&&this.callbacks[a]&&this.callbacks[a].apply(this.control,
		b)
	},
	register: function(a,b) {
		this.map.events.registerPriority(a,this,b);
		this.map.events.registerPriority(a,this,this.setEvent)
	},
	unregister: function(a,b) {
		this.map.events.unregister(a,this,b);
		this.map.events.unregister(a,this,this.setEvent)
	},
	setEvent: function(a) {
		this.evt=a;
		return true
	},
	destroy: function() {
		this.deactivate();
		this.control=this.map=null
	},
	CLASS_NAME:"OpenLayers.Handler"
});
OpenLayers.Handler.MOD_NONE=0;
OpenLayers.Handler.MOD_SHIFT=1;
OpenLayers.Handler.MOD_CTRL=2;
OpenLayers.Handler.MOD_ALT=4;
OpenLayers.Map=OpenLayers.Class({
	Z_INDEX_BASE: {
		BaseLayer:100,
		Overlay:325,
		Feature:725,
		Popup:750,
		Control:1000
	},
	EVENT_TYPES:["preaddlayer","addlayer","removelayer","changelayer","movestart","move","moveend","zoomend","popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove","dragstart","drag","dragend","changebaselayer"],
	id:null,
	fractionalZoom:false,
	events:null,
	allOverlays:false,
	div:null,
	dragging:false,
	size:null,
	viewPortDiv:null,
	layerContainerOrigin:null,
	layerContainerDiv:null,
	layers:null,
	controls:null,
	popups:null,
	baseLayer:null,
	center:null,
	resolution:null,
	zoom:0,
	panRatio:1.5,
	viewRequestID:0,
	tileSize:null,
	projection:"EPSG:4326",
	units:"degrees",
	resolutions:null,
	maxResolution:1.40625,
	minResolution:null,
	maxScale:null,
	minScale:null,
	maxExtent:null,
	minExtent:null,
	restrictedExtent:null,
	numZoomLevels:16,
	theme:null,
	displayProjection:null,
	fallThrough:true,
	panTween:null,
	eventListeners:null,
	panMethod:OpenLayers.Easing.Expo.easeOut,
	panDuration:50,
	paddingForPopups:null,
	initialize: function(a,
	b) {
		if(arguments.length===1&&typeof a==="object")
			a=(b=a)&&b.div;
		this.tileSize=new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,OpenLayers.Map.TILE_HEIGHT);
		this.maxExtent=new OpenLayers.Bounds(-180,-90,180,90);
		this.paddingForPopups=new OpenLayers.Bounds(15,15,15,15);
		this.theme=OpenLayers._getScriptLocation()+"theme/default/style.css";
		OpenLayers.Util.extend(this,b);
		this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");
		this.div=OpenLayers.Util.getElement(a);
		if(!this.div) {
			this.div=document.createElement("div");
			this.div.style.height="1px";
			this.div.style.width="1px"
		}
		OpenLayers.Element.addClass(this.div,"olMap");
		var c=this.div.id+"_OpenLayers_ViewPort";
		this.viewPortDiv=OpenLayers.Util.createDiv(c,null,null,null,"relative",null,"hidden");
		this.viewPortDiv.style.width="100%";
		this.viewPortDiv.style.height="100%";
		this.viewPortDiv.className="olMapViewport";
		this.div.appendChild(this.viewPortDiv);
		c=this.div.id+"_OpenLayers_Container";
		this.layerContainerDiv=OpenLayers.Util.createDiv(c);
		this.layerContainerDiv.style.zIndex=
		this.Z_INDEX_BASE.Popup-1;
		this.viewPortDiv.appendChild(this.layerContainerDiv);
		this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES,this.fallThrough, {
			includeXY:true
		});
		this.updateSize();
		this.eventListeners instanceof Object&&this.events.on(this.eventListeners);
		this.events.register("movestart",this,this.updateSize);
		if(OpenLayers.String.contains(navigator.appName,"Microsoft"))
			this.events.register("resize",this,this.updateSize);
		else {
			this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,
			this);
			OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy)
		}
		if(this.theme) {
			c=true;
			for(var d=document.getElementsByTagName("link"),e=0,f=d.length;e<f;++e)
				if(OpenLayers.Util.isEquivalentUrl(d.item(e).href,this.theme)) {
					c=false;
					break
				}
			if(c) {
				c=document.createElement("link");
				c.setAttribute("rel","stylesheet");
				c.setAttribute("type","text/css");
				c.setAttribute("href",this.theme);
				document.getElementsByTagName("head")[0].appendChild(c)
			}
		}
		this.layers=[];
		if(this.controls==null)
			this.controls=OpenLayers.Control!=
			null?[new OpenLayers.Control.Navigation,new OpenLayers.Control.PanZoom,new OpenLayers.Control.ArgParser,new OpenLayers.Control.Attribution]:[];
		e=0;
		for(f=this.controls.length;e<f;e++)
			this.addControlToMap(this.controls[e]);
		this.popups=[];
		this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);
		OpenLayers.Event.observe(window,"unload",this.unloadDestroy)
	},
	render: function(a) {
		this.div=OpenLayers.Util.getElement(a);
		OpenLayers.Element.addClass(this.div,"olMap");
		this.events.attachToElement(this.div);
		this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);
		this.div.appendChild(this.viewPortDiv);
		this.updateSize()
	},
	unloadDestroy:null,
	updateSizeDestroy:null,
	destroy: function() {
		if(!this.unloadDestroy)
			return false;
		OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy);
		this.unloadDestroy=null;this.updateSizeDestroy?OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy):this.events.unregister("resize",this,this.updateSize);
		this.paddingForPopups=null;
		if(this.controls!=null) {
			for(var a=
			this.controls.length-1;a>=0;--a)
				this.controls[a].destroy();
			this.controls=null
		}
		if(this.layers!=null) {
			for(a=this.layers.length-1;a>=0;--a)
				this.layers[a].destroy(false);
			this.layers=null
		}
		this.viewPortDiv&&this.div.removeChild(this.viewPortDiv);
		this.viewPortDiv=null;
		if(this.eventListeners) {
			this.events.un(this.eventListeners);
			this.eventListeners=null
		}
		this.events.destroy();
		this.events=null
	},
	setOptions: function(a) {
		OpenLayers.Util.extend(this,a)
	},
	getTileSize: function() {
		return this.tileSize
	},
	getBy: function(a,
	b,c) {
		var d=typeof c.test=="function";
		return a=OpenLayers.Array.filter(this[a], function(e) {
			return e[b]==c||d&&c.test(e[b])
		})
	},
	getLayersBy: function(a,b) {
		return this.getBy("layers",a,b)
	},
	getLayersByName: function(a) {
		return this.getLayersBy("name",a)
	},
	getLayersByClass: function(a) {
		return this.getLayersBy("CLASS_NAME",a)
	},
	getControlsBy: function(a,b) {
		return this.getBy("controls",a,b)
	},
	getControlsByClass: function(a) {
		return this.getControlsBy("CLASS_NAME",a)
	},
	getLayer: function(a) {
		for(var b=null,c=0,d=this.layers.length;c<
		d;c++) {
			var e=this.layers[c];
			if(e.id==a) {
				b=e;
				break
			}
		}
		return b
	},
	setLayerZIndex: function(a,b) {
		a.setZIndex(this.Z_INDEX_BASE[a.isBaseLayer?"BaseLayer":"Overlay"]+b*5)
	},
	resetLayersZIndex: function() {
		for(var a=0,b=this.layers.length;a<b;a++) {
			var c=this.layers[a];
			this.setLayerZIndex(c,a)
		}
	},
	addLayer: function(a) {
		for(var b=0,c=this.layers.length;b<c;b++)
			if(this.layers[b]==a) {
				a=OpenLayers.i18n("layerAlreadyAdded", {
					layerName:a.name
				});
				OpenLayers.Console.warn(a);
				return false
			}
		if(this.allOverlays)
			a.isBaseLayer=false;
		this.events.triggerEvent("preaddlayer", {
			layer:a
		});
		a.div.className="olLayerDiv";
		a.div.style.overflow="";
		this.setLayerZIndex(a,this.layers.length);a.isFixed?this.viewPortDiv.appendChild(a.div):this.layerContainerDiv.appendChild(a.div);
		this.layers.push(a);
		a.setMap(this);
		if(a.isBaseLayer||this.allOverlays&&!this.baseLayer)this.baseLayer==null?this.setBaseLayer(a):a.setVisibility(false);
		else
			a.redraw();
		this.events.triggerEvent("addlayer", {
			layer:a
		});
		a.afterAdd()
	},
	addLayers: function(a) {
		for(var b=0,c=a.length;b<
		c;b++)
			this.addLayer(a[b])
	},
	removeLayer: function(a,b) {
		if(b==null)
			b=true;a.isFixed?this.viewPortDiv.removeChild(a.div):this.layerContainerDiv.removeChild(a.div);
		OpenLayers.Util.removeItem(this.layers,a);
		a.removeMap(this);
		a.map=null;
		if(this.baseLayer==a) {
			this.baseLayer=null;
			if(b) {
				b=0;
				for(var c=this.layers.length;b<c;b++) {
					var d=this.layers[b];
					if(d.isBaseLayer||this.allOverlays) {
						this.setBaseLayer(d);
						break
					}
				}
			}
		}
		this.resetLayersZIndex();
		this.events.triggerEvent("removelayer", {
			layer:a
		})
	},
	getNumLayers: function() {
		return this.layers.length
	},
	getLayerIndex: function(a) {
		return OpenLayers.Util.indexOf(this.layers,a)
	},
	setLayerIndex: function(a,b) {
		var c=this.getLayerIndex(a);
		if(b<0)
			b=0;
		else if(b>this.layers.length)
			b=this.layers.length;
		if(c!=b) {
			this.layers.splice(c,1);
			this.layers.splice(b,0,a);
			c=0;
			for(var d=this.layers.length;c<d;c++)
				this.setLayerZIndex(this.layers[c],c);
			this.events.triggerEvent("changelayer", {
				layer:a,
				property:"order"
			});
			if(this.allOverlays)
				if(b===0)
					this.setBaseLayer(a);
				else
					this.baseLayer!==this.layers[0]&&this.setBaseLayer(this.layers[0])
		}
	},
	raiseLayer: function(a,b) {
		b=this.getLayerIndex(a)+b;
		this.setLayerIndex(a,b)
	},
	setBaseLayer: function(a) {
		var b=null;
		if(this.baseLayer)
			b=this.baseLayer.getExtent();
		if(a!=this.baseLayer)
			if(OpenLayers.Util.indexOf(this.layers,a)!=-1) {
				this.baseLayer!=null&&!this.allOverlays&&this.baseLayer.setVisibility(false);
				this.baseLayer=a;
				this.viewRequestID++;
				if(!this.allOverlays)
					this.baseLayer.visibility=true;
				a=this.getCenter();
				if(a!=null) {
					a=b?b.getCenterLonLat():a;
					b=b?this.getZoomForExtent(b,true):this.getZoomForResolution(this.resolution,
					true);
					this.setCenter(a,b,false,true)
				}
				this.events.triggerEvent("changebaselayer", {
					layer:this.baseLayer
				})
			}
	},
	addControl: function(a,b) {
		this.controls.push(a);
		this.addControlToMap(a,b)
	},
	addControlToMap: function(a,b) {
		a.outsideViewport=a.div!=null;
		if(this.displayProjection&&!a.displayProjection)
			a.displayProjection=this.displayProjection;
		a.setMap(this);
		if(b=a.draw(b))
			if(!a.outsideViewport) {
				b.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length;
				this.viewPortDiv.appendChild(b)
			}
	},
	getControl: function(a) {
		for(var b=
		null,c=0,d=this.controls.length;c<d;c++) {
			var e=this.controls[c];
			if(e.id==a) {
				b=e;
				break
			}
		}
		return b
	},
	removeControl: function(a) {
		if(a&&a==this.getControl(a.id)) {
			a.div&&a.div.parentNode==this.viewPortDiv&&this.viewPortDiv.removeChild(a.div);
			OpenLayers.Util.removeItem(this.controls,a)
		}
	},
	addPopup: function(a,b) {
		if(b)
			for(b=this.popups.length-1;b>=0;--b)
				this.removePopup(this.popups[b]);
		a.map=this;
		this.popups.push(a);
		if(a=a.draw()) {
			a.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length;
			this.layerContainerDiv.appendChild(a)
		}
	},
	removePopup: function(a) {
		OpenLayers.Util.removeItem(this.popups,a);
		if(a.div)
			try {
				this.layerContainerDiv.removeChild(a.div)
			} catch(b) {
			}
		a.map=null
	},
	getSize: function() {
		var a=null;
		if(this.size!=null)
			a=this.size.clone();
		return a
	},
	updateSize: function() {
		this.events.clearMouseCache();
		var a=this.getCurrentSize(),b=this.getSize();
		if(b==null)
			this.size=b=a;
		if(!a.equals(b)) {
			this.size=a;
			b=0;
			for(var c=this.layers.length;b<c;b++)
				this.layers[b].onMapResize();
			if(this.baseLayer!=null) {
				a=new OpenLayers.Pixel(a.w/2,a.h/
				2);
				this.getLonLatFromViewPortPx(a);
				a=this.getZoom();
				this.zoom=null;
				this.setCenter(this.getCenter(),a)
			}
		}
	},
	getCurrentSize: function() {
		var a=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);
		if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)) {
			var b=OpenLayers.Element.getDimensions(this.div);
			a.w=b.width;
			a.h=b.height
		}
		if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)) {
			a.w=parseInt(this.div.style.width);
			a.h=parseInt(this.div.style.height)
		}
		return a
	},
	calculateBounds: function(a,b) {
		var c=null;
		if(a==null)
			a=this.getCenter();
		if(b==null)
			b=this.getResolution();
		if(a!=null&&b!=null) {
			var d=this.getSize();
			c=d.w*b;
			b=d.h*b;
			c=new OpenLayers.Bounds(a.lon-c/2,a.lat-b/2,a.lon+c/2,a.lat+b/2)
		}
		return c
	},
	getCenter: function() {
		var a=null;
		if(this.center)
			a=this.center.clone();
		return a
	},
	getZoom: function() {
		return this.zoom
	},
	pan: function(a,b,c) {
		c=OpenLayers.Util.applyDefaults(c, {
			animate:true,
			dragging:false
		});
		var d=this.getViewPortPxFromLonLat(this.getCenter());
		a=d.add(a,b);
		if(!c.dragging||!a.equals(d)) {
			d=this.getLonLatFromViewPortPx(a);c.animate?
			this.panTo(d):this.setCenter(d,null,c.dragging)
		}
	},
	panTo: function(a) {
		if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(a)) {
			if(!this.panTween)
				this.panTween=new OpenLayers.Tween(this.panMethod);
			var b=this.getCenter();
			if(!(a.lon==b.lon&&a.lat==b.lat)) {
				b= {
					lon:b.lon,
					lat:b.lat
				};
				a= {
					lon:a.lon,
					lat:a.lat
				};
				this.panTween.start(b,a,this.panDuration, {
					callbacks: {
						start:OpenLayers.Function.bind( function() {
							this.events.triggerEvent("movestart")
						},this),
						eachStep:OpenLayers.Function.bind( function(c) {
							c=
							new OpenLayers.LonLat(c.lon,c.lat);
							this.moveTo(c,this.zoom, {
								dragging:true,
								noEvent:true
							})
						},this),
						done:OpenLayers.Function.bind( function(c) {
							c=new OpenLayers.LonLat(c.lon,c.lat);
							this.moveTo(c,this.zoom, {
								noEvent:true
							});
							this.events.triggerEvent("moveend")
						},this)
					}
				})
			}
		} else
			this.setCenter(a)
	},
	setCenter: function(a,b,c,d) {
		this.moveTo(a,b, {
			dragging:c,
			forceZoomChange:d,
			caller:"setCenter"
		})
	},
	moveTo: function(a,b,c) {
		c||(c= {});
		var d=c.dragging,e=c.forceZoomChange,f=c.noEvent;
		this.panTween&&c.caller=="setCenter"&&
		this.panTween.stop();
		if(!this.center&&!this.isValidLonLat(a))
			a=this.maxExtent.getCenterLonLat();
		if(this.restrictedExtent!=null) {
			if(a==null)
				a=this.getCenter();
			if(b==null)
				b=this.getZoom();
			c=this.getResolutionForZoom(b);
			c=this.calculateBounds(a,c);
			if(!this.restrictedExtent.containsBounds(c)) {
				var g=this.restrictedExtent.getCenterLonLat();
				if(c.getWidth()>this.restrictedExtent.getWidth())
					a=new OpenLayers.LonLat(g.lon,a.lat);
				else if(c.left<this.restrictedExtent.left)
					a=a.add(this.restrictedExtent.left-c.left,
					0);
				else if(c.right>this.restrictedExtent.right)
					a=a.add(this.restrictedExtent.right-c.right,0);
				if(c.getHeight()>this.restrictedExtent.getHeight())
					a=new OpenLayers.LonLat(a.lon,g.lat);
				else if(c.bottom<this.restrictedExtent.bottom)
					a=a.add(0,this.restrictedExtent.bottom-c.bottom);
				else if(c.top>this.restrictedExtent.top)
					a=a.add(0,this.restrictedExtent.top-c.top)
			}
		}
		e=e||this.isValidZoomLevel(b)&&b!=this.getZoom();
		c=this.isValidLonLat(a)&&!a.equals(this.center);
		if(e||c||!d) {
			!this.dragging&&!f&&this.events.triggerEvent("movestart");
			if(c) {
				!e&&this.center&&this.centerLayerContainer(a);
				this.center=a.clone()
			}
			if(e||this.layerContainerOrigin==null) {
				this.layerContainerOrigin=this.center.clone();
				this.layerContainerDiv.style.left="0px";
				this.layerContainerDiv.style.top="0px"
			}
			if(e) {
				this.zoom=b;
				this.resolution=this.getResolutionForZoom(b);
				this.viewRequestID++
			}
			a=this.getExtent();
			if(this.baseLayer.visibility) {
				this.baseLayer.moveTo(a,e,d);d?this.baseLayer.events.triggerEvent("move"):this.baseLayer.events.triggerEvent("moveend", {
					zoomChanged:e
				})
			}
			a=
			this.baseLayer.getExtent();
			b=0;
			for(c=this.layers.length;b<c;b++) {
				g=this.layers[b];
				if(g!==this.baseLayer&&!g.isBaseLayer) {
					var h=g.calculateInRange();
					if(g.inRange!=h) {
						(g.inRange=h)||g.display(false);
						this.events.triggerEvent("changelayer", {
							layer:g,
							property:"visibility"
						})
					}
					if(h&&g.visibility) {
						g.moveTo(a,e,d);d?g.events.triggerEvent("move"):g.events.triggerEvent("moveend", {
							zoomChanged:e
						})
					}
				}
			}
			if(e) {
				b=0;
				for(c=this.popups.length;b<c;b++)
					this.popups[b].updatePosition()
			}
			this.events.triggerEvent("move");
			e&&this.events.triggerEvent("zoomend")
		}
		!d&&
		!f&&this.events.triggerEvent("moveend");
		this.dragging=!!d
	},
	centerLayerContainer: function(a) {
		var b=this.getViewPortPxFromLonLat(this.layerContainerOrigin);
		a=this.getViewPortPxFromLonLat(a);
		if(b!=null&&a!=null) {
			this.layerContainerDiv.style.left=Math.round(b.x-a.x)+"px";
			this.layerContainerDiv.style.top=Math.round(b.y-a.y)+"px"
		}
	},
	isValidZoomLevel: function(a) {
		return a!=null&&a>=0&&a<this.getNumZoomLevels()
	},
	isValidLonLat: function(a) {
		var b=false;
		if(a!=null) {
			b=this.getMaxExtent();
			b=b.containsLonLat(a)
		}
		return b
	},
	getProjection: function() {
		var a=this.getProjectionObject();
		return a?a.getCode():null
	},
	getProjectionObject: function() {
		var a=null;
		if(this.baseLayer!=null)
			a=this.baseLayer.projection;
		return a
	},
	getMaxResolution: function() {
		var a=null;
		if(this.baseLayer!=null)
			a=this.baseLayer.maxResolution;
		return a
	},
	getMaxExtent: function(a) {
		var b=null;
		if(a&&a.restricted&&this.restrictedExtent)
			b=this.restrictedExtent;
		else if(this.baseLayer!=null)
			b=this.baseLayer.maxExtent;
		return b
	},
	getNumZoomLevels: function() {
		var a=null;
		if(this.baseLayer!=
		null)
			a=this.baseLayer.numZoomLevels;
		return a
	},
	getExtent: function() {
		var a=null;
		if(this.baseLayer!=null)
			a=this.baseLayer.getExtent();
		return a
	},
	getResolution: function() {
		var a=null;
		if(this.baseLayer!=null)
			a=this.baseLayer.getResolution();
		return a
	},
	getUnits: function() {
		var a=null;
		if(this.baseLayer!=null)
			a=this.baseLayer.units;
		return a
	},
	getScale: function() {
		var a=null;
		if(this.baseLayer!=null) {
			a=this.getResolution();
			var b=this.baseLayer.units;
			a=OpenLayers.Util.getScaleFromResolution(a,b)
		}
		return a
	},
	getZoomForExtent: function(a,
	b) {
		var c=null;
		if(this.baseLayer!=null)
			c=this.baseLayer.getZoomForExtent(a,b);
		return c
	},
	getResolutionForZoom: function(a) {
		var b=null;
		if(this.baseLayer)
			b=this.baseLayer.getResolutionForZoom(a);
		return b
	},
	getZoomForResolution: function(a,b) {
		var c=null;
		if(this.baseLayer!=null)
			c=this.baseLayer.getZoomForResolution(a,b);
		return c
	},
	zoomTo: function(a) {
		this.isValidZoomLevel(a)&&this.setCenter(null,a)
	},
	zoomIn: function() {
		this.zoomTo(this.getZoom()+1)
	},
	zoomOut: function() {
		this.zoomTo(this.getZoom()-1)
	},
	zoomToExtent: function(a,
	b) {
		var c=a.getCenterLonLat();
		if(this.baseLayer.wrapDateLine) {
			c=this.getMaxExtent();
			for(a=a.clone();a.right<a.left;)
				a.right+=c.getWidth();
			c=a.getCenterLonLat().wrapDateLine(c)
		}
		this.setCenter(c,this.getZoomForExtent(a,b))
	},
	zoomToMaxExtent: function(a) {
		a=a?a.restricted:true;
		a=this.getMaxExtent({
			restricted:a
		});
		this.zoomToExtent(a)
	},
	zoomToScale: function(a,b) {
		var c=OpenLayers.Util.getResolutionFromScale(a,this.baseLayer.units),d=this.getSize();
		a=d.w*c;
		c=d.h*c;
		d=this.getCenter();
		a=new OpenLayers.Bounds(d.lon-
		a/2,d.lat-c/2,d.lon+a/2,d.lat+c/2);
		this.zoomToExtent(a,b)
	},
	getLonLatFromViewPortPx: function(a) {
		var b=null;
		if(this.baseLayer!=null)
			b=this.baseLayer.getLonLatFromViewPortPx(a);
		return b
	},
	getViewPortPxFromLonLat: function(a) {
		var b=null;
		if(this.baseLayer!=null)
			b=this.baseLayer.getViewPortPxFromLonLat(a);
		return b
	},
	getLonLatFromPixel: function(a) {
		return this.getLonLatFromViewPortPx(a)
	},
	getPixelFromLonLat: function(a) {
		a=this.getViewPortPxFromLonLat(a);
		a.x=Math.round(a.x);
		a.y=Math.round(a.y);
		return a
	},
	getViewPortPxFromLayerPx: function(a) {
		var b=
		null;
		if(a!=null) {
			b=parseInt(this.layerContainerDiv.style.left);
			var c=parseInt(this.layerContainerDiv.style.top);
			b=a.add(b,c)
		}
		return b
	},
	getLayerPxFromViewPortPx: function(a) {
		var b=null;
		if(a!=null) {
			b=-parseInt(this.layerContainerDiv.style.left);
			var c=-parseInt(this.layerContainerDiv.style.top);
			b=a.add(b,c);
			if(isNaN(b.x)||isNaN(b.y))
				b=null
		}
		return b
	},
	getLonLatFromLayerPx: function(a) {
		a=this.getViewPortPxFromLayerPx(a);
		return this.getLonLatFromViewPortPx(a)
	},
	getLayerPxFromLonLat: function(a) {
		a=this.getPixelFromLonLat(a);
		return this.getLayerPxFromViewPortPx(a)
	},
	CLASS_NAME:"OpenLayers.Map"
});
OpenLayers.Map.TILE_WIDTH=256;
OpenLayers.Map.TILE_HEIGHT=256;
OpenLayers.Marker=OpenLayers.Class({
	icon:null,
	lonlat:null,
	events:null,
	map:null,
	initialize: function(a,b) {
		this.lonlat=a;
		a=b?b:OpenLayers.Marker.defaultIcon();
		if(this.icon==null)
			this.icon=a;
		else {
			this.icon.url=a.url;
			this.icon.size=a.size;
			this.icon.offset=a.offset;
			this.icon.calculateOffset=a.calculateOffset
		}
		this.events=new OpenLayers.Events(this,this.icon.imageDiv,null)
	},
	destroy: function() {
		this.erase();
		this.map=null;
		this.events.destroy();
		this.events=null;
		if(this.icon!=null) {
			this.icon.destroy();
			this.icon=
			null
		}
	},
	draw: function(a) {
		return this.icon.draw(a)
	},
	erase: function() {
		this.icon!=null&&this.icon.erase()
	},
	moveTo: function(a) {
		a!=null&&this.icon!=null&&this.icon.moveTo(a);
		this.lonlat=this.map.getLonLatFromLayerPx(a)
	},
	isDrawn: function() {
		var a=this.icon&&this.icon.isDrawn();
		return a
	},
	onScreen: function() {
		var a=false;
		if(this.map) {
			a=this.map.getExtent();
			a=a.containsLonLat(this.lonlat)
		}
		return a
	},
	inflate: function(a) {
		if(this.icon) {
			a=new OpenLayers.Size(this.icon.size.w*a,this.icon.size.h*a);
			this.icon.setSize(a)
		}
	},
	setOpacity: function(a) {
		this.icon.setOpacity(a)
	},
	setUrl: function(a) {
		this.icon.setUrl(a)
	},
	display: function(a) {
		this.icon.display(a)
	},
	CLASS_NAME:"OpenLayers.Marker"
});
OpenLayers.Marker.defaultIcon= function() {
	var a=OpenLayers.Util.getImagesLocation()+"marker.png",b=new OpenLayers.Size(21,25);
	function c(d) {
		return new OpenLayers.Pixel(-(d.w/2),-d.h)
	}

	return new OpenLayers.Icon(a,b,null,c)
};
OpenLayers.Popup.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed, {
	contentDisplayClass:"olFramedCloudPopupContent",
	autoSize:true,
	panMapIfOutOfView:true,
	imageSize:new OpenLayers.Size(676,736),
	isAlphaImage:false,
	fixedRelativePosition:false,
	positionBlocks: {
		tl: {
			offset:new OpenLayers.Pixel(44,0),
			padding:new OpenLayers.Bounds(8,40,8,9),
			blocks:[{
				size:new OpenLayers.Size("auto","auto"),
				anchor:new OpenLayers.Bounds(0,51,22,0),
				position:new OpenLayers.Pixel(0,0)
			},{
				size:new OpenLayers.Size(22,"auto"),
				anchor:new OpenLayers.Bounds(null,
				50,0,0),
				position:new OpenLayers.Pixel(-638,0)
			},{
				size:new OpenLayers.Size("auto",19),
				anchor:new OpenLayers.Bounds(0,32,22,null),
				position:new OpenLayers.Pixel(0,-631)
			},{
				size:new OpenLayers.Size(22,18),
				anchor:new OpenLayers.Bounds(null,32,0,null),
				position:new OpenLayers.Pixel(-638,-632)
			},{
				size:new OpenLayers.Size(81,35),
				anchor:new OpenLayers.Bounds(null,0,0,null),
				position:new OpenLayers.Pixel(0,-688)
			}]
		},
		tr: {
			offset:new OpenLayers.Pixel(-45,0),
			padding:new OpenLayers.Bounds(8,40,8,9),
			blocks:[{
				size:new OpenLayers.Size("auto",
				"auto"),
				anchor:new OpenLayers.Bounds(0,51,22,0),
				position:new OpenLayers.Pixel(0,0)
			},{
				size:new OpenLayers.Size(22,"auto"),
				anchor:new OpenLayers.Bounds(null,50,0,0),
				position:new OpenLayers.Pixel(-638,0)
			},{
				size:new OpenLayers.Size("auto",19),
				anchor:new OpenLayers.Bounds(0,32,22,null),
				position:new OpenLayers.Pixel(0,-631)
			},{
				size:new OpenLayers.Size(22,19),
				anchor:new OpenLayers.Bounds(null,32,0,null),
				position:new OpenLayers.Pixel(-638,-631)
			},{
				size:new OpenLayers.Size(81,35),
				anchor:new OpenLayers.Bounds(0,
				0,null,null),
				position:new OpenLayers.Pixel(-215,-687)
			}]
		},
		bl: {
			offset:new OpenLayers.Pixel(45,0),
			padding:new OpenLayers.Bounds(8,9,8,40),
			blocks:[{
				size:new OpenLayers.Size("auto","auto"),
				anchor:new OpenLayers.Bounds(0,21,22,32),
				position:new OpenLayers.Pixel(0,0)
			},{
				size:new OpenLayers.Size(22,"auto"),
				anchor:new OpenLayers.Bounds(null,21,0,32),
				position:new OpenLayers.Pixel(-638,0)
			},{
				size:new OpenLayers.Size("auto",21),
				anchor:new OpenLayers.Bounds(0,0,22,null),
				position:new OpenLayers.Pixel(0,-629)
			},{
				size:new OpenLayers.Size(22,
				21),
				anchor:new OpenLayers.Bounds(null,0,0,null),
				position:new OpenLayers.Pixel(-638,-629)
			},{
				size:new OpenLayers.Size(81,33),
				anchor:new OpenLayers.Bounds(null,null,0,0),
				position:new OpenLayers.Pixel(-101,-674)
			}]
		},
		br: {
			offset:new OpenLayers.Pixel(-44,0),
			padding:new OpenLayers.Bounds(8,9,8,40),
			blocks:[{
				size:new OpenLayers.Size("auto","auto"),
				anchor:new OpenLayers.Bounds(0,21,22,32),
				position:new OpenLayers.Pixel(0,0)
			},{
				size:new OpenLayers.Size(22,"auto"),
				anchor:new OpenLayers.Bounds(null,21,0,32),
				position:new OpenLayers.Pixel(-638,
				0)
			},{
				size:new OpenLayers.Size("auto",21),
				anchor:new OpenLayers.Bounds(0,0,22,null),
				position:new OpenLayers.Pixel(0,-629)
			},{
				size:new OpenLayers.Size(22,21),
				anchor:new OpenLayers.Bounds(null,0,0,null),
				position:new OpenLayers.Pixel(-638,-629)
			},{
				size:new OpenLayers.Size(81,33),
				anchor:new OpenLayers.Bounds(0,null,null,0),
				position:new OpenLayers.Pixel(-311,-674)
			}]
		}
	},
	minSize:new OpenLayers.Size(105,10),
	maxSize:new OpenLayers.Size(600,660),
	initialize: function() {
		this.imageSrc=OpenLayers.Util.getImagesLocation()+
		"cloud-popup-relative.png";
		OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);
		this.contentDiv.className=this.contentDisplayClass
	},
	destroy: function() {
		OpenLayers.Popup.Framed.prototype.destroy.apply(this,arguments)
	},
	CLASS_NAME:"OpenLayers.Popup.FramedCloud"
});
OpenLayers.Request= {
	DEFAULT_CONFIG: {
		method:"GET",
		url:window.location.href,
		async:true,
		user:undefined,
		password:undefined,
		params:null,
		proxy:OpenLayers.ProxyHost,
		headers: {},
		data:null,
		callback: function() {
		},
		success:null,
		failure:null,
		scope:null
	},
	events:new OpenLayers.Events(this,null,["complete","success","failure"]),
	issue: function(a) {
		var b=OpenLayers.Util.extend(this.DEFAULT_CONFIG, {
			proxy:OpenLayers.ProxyHost
		});
		a=OpenLayers.Util.applyDefaults(a,b);
		var c=new OpenLayers.Request.XMLHttpRequest,d=a.url;
		if(a.params) {
			b=
			OpenLayers.Util.getParameterString(a.params);
			if(b.length>0) {
				var e=d.indexOf("?")>-1?"&":"?";
				d+=e+b
			}
		}
		if(a.proxy&&d.indexOf("http")==0)
			d=a.proxy+encodeURIComponent(d);
		c.open(a.method,d,a.async,a.user,a.password);
		for(var f in a.headers)
			c.setRequestHeader(f,a.headers[f]);
		var g=a.scope?OpenLayers.Function.bind(a.callback,a.scope):a.callback,h;
		if(a.success)
			h=a.scope?OpenLayers.Function.bind(a.success,a.scope):a.success;
		var i;
		if(a.failure)
			i=a.scope?OpenLayers.Function.bind(a.failure,a.scope):a.failure;
		var j=
		this.events;
		c.onreadystatechange= function() {
			if(c.readyState==OpenLayers.Request.XMLHttpRequest.DONE) {
				var l=j.triggerEvent("complete", {
					request:c,
					config:a,
					requestUrl:d
				});
				if(l!==false) {
					g(c);
					if(!c.status||c.status>=200&&c.status<300) {
						j.triggerEvent("success", {
							request:c,
							config:a,
							requestUrl:d
						});
						h&&h(c)
					}
					if(c.status&&(c.status<200||c.status>=300)) {
						j.triggerEvent("failure", {
							request:c,
							config:a,
							requestUrl:d
						});
						i&&i(c)
					}
				}
			}
		};a.async===false?c.send(a.data):window.setTimeout( function() {
			c.send(a.data)
		},0);
		return c
	},
	GET: function(a) {
		a=OpenLayers.Util.extend(a, {
			method:"GET"
		});
		return OpenLayers.Request.issue(a)
	},
	POST: function(a) {
		a=OpenLayers.Util.extend(a, {
			method:"POST"
		});
		a.headers=a.headers?a.headers: {};
		"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(a.headers)||(a.headers["Content-Type"]="application/xml");
		return OpenLayers.Request.issue(a)
	},
	PUT: function(a) {
		a=OpenLayers.Util.extend(a, {
			method:"PUT"
		});
		a.headers=a.headers?a.headers: {};
		"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(a.headers)||(a.headers["Content-Type"]=
			"application/xml");
		return OpenLayers.Request.issue(a)
	},
	DELETE: function(a) {
		a=OpenLayers.Util.extend(a, {
			method:"DELETE"
		});
		return OpenLayers.Request.issue(a)
	},
	HEAD: function(a) {
		a=OpenLayers.Util.extend(a, {
			method:"HEAD"
		});
		return OpenLayers.Request.issue(a)
	},
	OPTIONS: function(a) {
		a=OpenLayers.Util.extend(a, {
			method:"OPTIONS"
		});
		return OpenLayers.Request.issue(a)
	}
};
OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile, {
	url:null,
	imgDiv:null,
	frame:null,
	layerAlphaHack:null,
	isBackBuffer:false,
	lastRatio:1,
	isFirstDraw:true,
	backBufferTile:null,
	initialize: function(a,b,c,d) {
		OpenLayers.Tile.prototype.initialize.apply(this,arguments);
		this.url=d;
		this.frame=document.createElement("div");
		this.frame.style.overflow="hidden";
		this.frame.style.position="absolute";
		this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack()
	},
	destroy: function() {
		if(this.imgDiv!=null) {
			this.layerAlphaHack&&
			OpenLayers.Event.stopObservingElement(this.imgDiv.childNodes[0].id);
			OpenLayers.Event.stopObservingElement(this.imgDiv.id);
			if(this.imgDiv.parentNode==this.frame) {
				this.frame.removeChild(this.imgDiv);
				this.imgDiv.map=null
			}
			this.imgDiv.urls=null;
			this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"
		}
		this.imgDiv=null;
		this.frame!=null&&this.frame.parentNode==this.layer.div&&this.layer.div.removeChild(this.frame);
		this.frame=null;
		if(this.backBufferTile) {
			this.backBufferTile.destroy();
			this.backBufferTile=
			null
		}
		this.layer.events.unregister("loadend",this,this.resetBackBuffer);
		OpenLayers.Tile.prototype.destroy.apply(this,arguments)
	},
	clone: function(a) {
		if(a==null)
			a=new OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size);
		a=OpenLayers.Tile.prototype.clone.apply(this,[a]);
		a.imgDiv=null;
		return a
	},
	draw: function() {
		if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject)
			this.bounds=this.getBoundsFromBaseLayer(this.position);
		var a=OpenLayers.Tile.prototype.draw.apply(this,arguments);
		if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1)
			if(a) {
				if(!this.backBufferTile) {
					this.backBufferTile=this.clone();
					this.backBufferTile.hide();
					this.backBufferTile.isBackBuffer=true;
					this.events.register("loadend",this,this.resetBackBuffer);
					this.layer.events.register("loadend",this,this.resetBackBuffer)
				}
				this.startTransition()
			} else
				this.backBufferTile&&this.backBufferTile.clear();
		else if(a&&this.isFirstDraw) {
			this.events.register("loadend",this,this.showTile);
			this.isFirstDraw=false
		}
		if(!a)
			return false;
		if(this.isLoading)
			this.events.triggerEvent("reload");
		else {
			this.isLoading=true;
			this.events.triggerEvent("loadstart")
		}
		return this.renderTile()
	},
	resetBackBuffer: function() {
		this.showTile();
		if(this.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)) {
			this.isFirstDraw=false;
			var a=this.layer.maxExtent;
			if(a=a&&this.bounds.intersectsBounds(a,false)) {
				this.backBufferTile.position=this.position;
				this.backBufferTile.bounds=this.bounds;
				this.backBufferTile.size=
				this.size;
				this.backBufferTile.imageSize=this.layer.imageSize||this.size;
				this.backBufferTile.imageOffset=this.layer.imageOffset;
				this.backBufferTile.resolution=this.layer.getResolution();
				this.backBufferTile.renderTile()
			}
			this.backBufferTile.hide()
		}
	},
	renderTile: function() {
		this.imgDiv==null&&this.initImgDiv();
		this.imgDiv.viewRequestID=this.layer.map.viewRequestID;
		if(this.layer.async)
			this.layer.getURLasync(this.bounds,this,"url",this.positionImage);
		else {
			if(this.layer.url instanceof Array)
				this.imgDiv.urls=
				this.layer.url.slice();
			this.url=this.layer.getURL(this.bounds);
			this.positionImage()
		}
		return true
	},
	positionImage: function() {
		if(this.layer!=null) {
			OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);
			var a=this.layer.getImageSize();
			if(this.layerAlphaHack)
				OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,a,this.url);
			else {
				OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,a);
				this.imgDiv.src=this.url
			}
		}
	},
	clear: function() {
		if(this.imgDiv) {
			this.hide();
			if(OpenLayers.Tile.Image.useBlankTile)
				this.imgDiv.src=
				OpenLayers.Util.getImagesLocation()+"blank.gif"
		}
	},
	initImgDiv: function() {
		var a=this.layer.imageOffset,b=this.layer.getImageSize();
		this.imgDiv=this.layerAlphaHack?OpenLayers.Util.createAlphaImageDiv(null,a,b,null,"relative",null,null,null,true):OpenLayers.Util.createImage(null,a,b,null,"relative",null,null,true);
		this.imgDiv.className="olTileImage";
		this.frame.style.zIndex=this.isBackBuffer?0:1;
		this.frame.appendChild(this.imgDiv);
		this.layer.div.appendChild(this.frame);
		this.layer.opacity!=null&&OpenLayers.Util.modifyDOMElement(this.imgDiv,
		null,null,null,null,null,null,this.layer.opacity);
		this.imgDiv.map=this.layer.map;
		function c() {
			if(this.isLoading) {
				this.isLoading=false;
				this.events.triggerEvent("loadend")
			}
		}this.layerAlphaHack?OpenLayers.Event.observe(this.imgDiv.childNodes[0],"load",OpenLayers.Function.bind(c,this)):OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(c,this));

		function d() {
			this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS&&c.call(this)
		}

		OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(d,
		this))
	},
	checkImgURL: function() {
		if(this.layer) {
			var a=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;
			OpenLayers.Util.isEquivalentUrl(a,this.url)||this.hide()
		}
	},
	startTransition: function() {
		if(this.backBufferTile&&this.backBufferTile.imgDiv) {
			var a=1;
			if(this.backBufferTile.resolution)
				a=this.backBufferTile.resolution/this.layer.getResolution();
			if(a!=this.lastRatio) {
				if(this.layer.transitionEffect=="resize") {
					var b=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top),
					c=new OpenLayers.Size(this.backBufferTile.size.w*a,this.backBufferTile.size.h*a);
					b=this.layer.map.getLayerPxFromLonLat(b);
					OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,b,c);
					c=this.backBufferTile.imageSize;
					c=new OpenLayers.Size(c.w*a,c.h*a);
					if(b=this.backBufferTile.imageOffset)
						b=new OpenLayers.Pixel(b.x*a,b.y*a);
					OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,b,c);
					this.backBufferTile.show()
				}
			} else this.layer.singleTile?this.backBufferTile.show():this.backBufferTile.hide();
			this.lastRatio=a
		}
	},
	show: function() {
		this.frame.style.display="";
		if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1)
			if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1)
				this.frame.scrollLeft=this.frame.scrollLeft
	},
	hide: function() {
		this.frame.style.display="none"
	},
	CLASS_NAME:"OpenLayers.Tile.Image"
});
OpenLayers.Tile.Image.useBlankTile=OpenLayers.Util.getBrowserName()=="safari"||OpenLayers.Util.getBrowserName()=="opera";
OpenLayers.Feature=OpenLayers.Class({
	layer:null,
	id:null,
	lonlat:null,
	data:null,
	marker:null,
	popupClass:OpenLayers.Popup.AnchoredBubble,
	popup:null,
	initialize: function(a,b,c) {
		this.layer=a;
		this.lonlat=b;
		this.data=c!=null?c: {};
		this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")
	},
	destroy: function() {
		this.layer!=null&&this.layer.map!=null&&this.popup!=null&&this.layer.map.removePopup(this.popup);
		this.data=this.lonlat=this.id=this.layer=null;
		if(this.marker!=null) {
			this.destroyMarker(this.marker);
			this.marker=
			null
		}
		if(this.popup!=null) {
			this.destroyPopup(this.popup);
			this.popup=null
		}
	},
	onScreen: function() {
		var a=false;
		if(this.layer!=null&&this.layer.map!=null) {
			a=this.layer.map.getExtent();
			a=a.containsLonLat(this.lonlat)
		}
		return a
	},
	createMarker: function() {
		if(this.lonlat!=null)
			this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon);
		return this.marker
	},
	destroyMarker: function() {
		this.marker.destroy()
	},
	createPopup: function(a) {
		if(this.lonlat!=null) {
			var b=this.id+"_popup",c=this.marker?this.marker.icon:null;
			if(!this.popup)
				this.popup=
				new this.popupClass(b,this.lonlat,this.data.popupSize,this.data.popupContentHTML,c,a);
			if(this.data.overflow!=null)
				this.popup.contentDiv.style.overflow=this.data.overflow;
			this.popup.feature=this
		}
		return this.popup
	},
	destroyPopup: function() {
		if(this.popup) {
			this.popup.feature=null;
			this.popup.destroy();
			this.popup=null
		}
	},
	CLASS_NAME:"OpenLayers.Feature"
});
OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler, {
	delay:300,
	single:true,
	"double":false,
	pixelTolerance:0,
	stopSingle:false,
	stopDouble:false,
	timerId:null,
	down:null,
	rightclickTimerId:null,
	initialize: function() {
		OpenLayers.Handler.prototype.initialize.apply(this,arguments);
		if(this.pixelTolerance!=null)
			this.mousedown= function(a) {
				this.down=a.xy;
				return true
			}
	},
	mousedown:null,
	mouseup: function(a) {
		var b=true;
		if(this.checkModifiers(a)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(a))
			b=
			this.rightclick(a);
		return b
	},
	rightclick: function(a) {
		if(this.passesTolerance(a))
			if(this.rightclickTimerId!=null) {
				this.clearTimer();
				this.callback("dblrightclick",[a]);
				return!this.stopDouble
			} else {
				a=this["double"]?OpenLayers.Util.extend({},a):this.callback("rightclick",[a]);
				a=OpenLayers.Function.bind(this.delayedRightCall,this,a);
				this.rightclickTimerId=window.setTimeout(a,this.delay)
			}
		return!this.stopSingle
	},
	delayedRightCall: function(a) {
		this.rightclickTimerId=null;
		a&&this.callback("rightclick",[a]);
		return!this.stopSingle
	},
	dblclick: function(a) {
		if(this.passesTolerance(a)) {
			this["double"]&&this.callback("dblclick",[a]);
			this.clearTimer()
		}
		return!this.stopDouble
	},
	click: function(a) {
		if(this.passesTolerance(a))
			if(this.timerId!=null)
				this.clearTimer();
			else {
				a=this.single?OpenLayers.Util.extend({},a):null;
				this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,a),this.delay)
			}
		return!this.stopSingle
	},
	passesTolerance: function(a) {
		var b=true;
		if(this.pixelTolerance!=null&&this.down) {
			a=Math.sqrt(Math.pow(this.down.x-
			a.xy.x,2)+Math.pow(this.down.y-a.xy.y,2));
			if(a>this.pixelTolerance)
				b=false
		}
		return b
	},
	clearTimer: function() {
		if(this.timerId!=null) {
			window.clearTimeout(this.timerId);
			this.timerId=null
		}
		if(this.rightclickTimerId!=null) {
			window.clearTimeout(this.rightclickTimerId);
			this.rightclickTimerId=null
		}
	},
	delayedCall: function(a) {
		this.timerId=null;
		a&&this.callback("click",[a])
	},
	deactivate: function() {
		var a=false;
		if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)) {
			this.clearTimer();
			this.down=null;
			a=true
		}
		return a
	},
	CLASS_NAME:"OpenLayers.Handler.Click"
});
OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler, {
	started:false,
	stopDown:true,
	dragging:false,
	last:null,
	start:null,
	oldOnselectstart:null,
	interval:0,
	timeoutId:null,
	initialize: function() {
		OpenLayers.Handler.prototype.initialize.apply(this,arguments)
	},
	down: function() {
	},
	move: function() {
	},
	up: function() {
	},
	out: function() {
	},
	mousedown: function(a) {
		var b=true;
		this.dragging=false;
		if(this.checkModifiers(a)&&OpenLayers.Event.isLeftClick(a)) {
			this.started=true;
			this.last=this.start=a.xy;
			OpenLayers.Element.addClass(this.map.viewPortDiv,
			"olDragDown");
			this.down(a);
			this.callback("down",[a.xy]);
			OpenLayers.Event.stop(a);
			if(!this.oldOnselectstart) {
				this.oldOnselectstart=document.onselectstart?document.onselectstart: function() {
					return true
				};
				document.onselectstart= function() {
					return false
				}
			}
			b=!this.stopDown
		} else {
			this.started=false;
			this.last=this.start=null
		}
		return b
	},
	mousemove: function(a) {
		if(this.started&&!this.timeoutId&&(a.xy.x!=this.last.x||a.xy.y!=this.last.y)) {
			if(this.interval>0)
				this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,
				this),this.interval);
			this.dragging=true;
			this.move(a);
			this.callback("move",[a.xy]);
			if(!this.oldOnselectstart) {
				this.oldOnselectstart=document.onselectstart;
				document.onselectstart= function() {
					return false
				}
			}
			this.last=this.evt.xy
		}
		return true
	},
	removeTimeout: function() {
		this.timeoutId=null
	},
	mouseup: function(a) {
		if(this.started) {
			var b=this.start!=this.last;
			this.dragging=this.started=false;
			OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");
			this.up(a);
			this.callback("up",[a.xy]);
			b&&this.callback("done",
			[a.xy]);
			document.onselectstart=this.oldOnselectstart
		}
		return true
	},
	mouseout: function(a) {
		if(this.started&&OpenLayers.Util.mouseLeft(a,this.map.div)) {
			var b=this.start!=this.last;
			this.dragging=this.started=false;
			OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");
			this.out(a);
			this.callback("out",[]);
			b&&this.callback("done",[a.xy]);
			if(document.onselectstart)
				document.onselectstart=this.oldOnselectstart
		}
		return true
	},
	click: function() {
		return this.start==this.last
	},
	activate: function() {
		var a=false;
		if(OpenLayers.Handler.prototype.activate.apply(this,arguments)) {
			this.dragging=false;
			a=true
		}
		return a
	},
	deactivate: function() {
		var a=false;
		if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)) {
			this.dragging=this.started=false;
			this.last=this.start=null;
			a=true;
			OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown")
		}
		return a
	},
	CLASS_NAME:"OpenLayers.Handler.Drag"
});
OpenLayers.Handler.Feature=OpenLayers.Class(OpenLayers.Handler, {
	EVENTMAP: {
		click: {
			"in":"click",
			out:"clickout"
		},
		mousemove: {
			"in":"over",
			out:"out"
		},
		dblclick: {
			"in":"dblclick",
			out:null
		},
		mousedown: {
			"in":null,
			out:null
		},
		mouseup: {
			"in":null,
			out:null
		}
	},
	feature:null,
	lastFeature:null,
	down:null,
	up:null,
	clickTolerance:4,
	geometryTypes:null,
	stopClick:true,
	stopDown:true,
	stopUp:false,
	initialize: function(a,b,c,d) {
		OpenLayers.Handler.prototype.initialize.apply(this,[a,c,d]);
		this.layer=b
	},
	mousedown: function(a) {
		this.down=
		a.xy;
		return this.handle(a)?!this.stopDown:true
	},
	mouseup: function(a) {
		this.up=a.xy;
		return this.handle(a)?!this.stopUp:true
	},
	click: function(a) {
		return this.handle(a)?!this.stopClick:true
	},
	mousemove: function(a) {
		if(!this.callbacks.over&&!this.callbacks.out)
			return true;
		this.handle(a);
		return true
	},
	dblclick: function(a) {
		return!this.handle(a)
	},
	geometryTypeMatches: function(a) {
		return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,a.geometry.CLASS_NAME)>-1
	},
	handle: function(a) {
		if(this.feature&&
		!this.feature.layer)
			this.feature=null;
		var b=a.type,c=false,d=!!this.feature,e=b=="click"||b=="dblclick";
		if((this.feature=this.layer.getFeatureFromEvent(a))&&!this.feature.layer)
			this.feature=null;
		if(this.lastFeature&&!this.lastFeature.layer)
			this.lastFeature=null;
		if(this.feature) {
			a=this.feature!=this.lastFeature;
			if(this.geometryTypeMatches(this.feature)) {
				if(d&&a) {
					this.lastFeature&&this.triggerCallback(b,"out",[this.lastFeature]);
					this.triggerCallback(b,"in",[this.feature])
				} else if(!d||e)
					this.triggerCallback(b,
					"in",[this.feature]);
				this.lastFeature=this.feature;
				c=true
			} else {
				if(this.lastFeature&&(d&&a||e))
					this.triggerCallback(b,"out",[this.lastFeature]);
				this.feature=null
			}
		} else if(this.lastFeature&&(d||e))
			this.triggerCallback(b,"out",[this.lastFeature]);
		return c
	},
	triggerCallback: function(a,b,c) {
		if(b=this.EVENTMAP[a][b])
			if(a=="click"&&this.up&&this.down) {
				a=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2));
				a<=this.clickTolerance&&this.callback(b,c)
			} else
				this.callback(b,c)
	},
	activate: function() {
		var a=
		false;
		if(OpenLayers.Handler.prototype.activate.apply(this,arguments)) {
			this.moveLayerToTop();
			this.map.events.on({
				removelayer:this.handleMapEvents,
				changelayer:this.handleMapEvents,
				scope:this
			});
			a=true
		}
		return a
	},
	deactivate: function() {
		var a=false;
		if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)) {
			this.moveLayerBack();
			this.up=this.down=this.lastFeature=this.feature=null;
			this.map.events.un({
				removelayer:this.handleMapEvents,
				changelayer:this.handleMapEvents,
				scope:this
			});
			a=true
		}
		return a
	},
	handleMapEvents: function(a) {
		if(!a.property||
		a.property=="order")
			this.moveLayerToTop()
	},
	moveLayerToTop: function() {
		var a=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;
		this.layer.setZIndex(a)
	},
	moveLayerBack: function() {
		var a=this.layer.getZIndex()-1;a>=this.map.Z_INDEX_BASE.Feature?this.layer.setZIndex(a):this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))
	},
	CLASS_NAME:"OpenLayers.Handler.Feature"
});
OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler, {
	wheelListener:null,
	mousePosition:null,
	initialize: function() {
		OpenLayers.Handler.prototype.initialize.apply(this,arguments);
		this.wheelListener=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this)
	},
	destroy: function() {
		OpenLayers.Handler.prototype.destroy.apply(this,arguments);
		this.wheelListener=null
	},
	onWheelEvent: function(a) {
		if(this.map&&this.checkModifiers(a)) {
			for(var b=false,c=false,d=false,e=OpenLayers.Event.element(a);e!=
			null&&!d&&!b;) {
				if(!b)
					try {
						if(e.currentStyle)
							g=e.currentStyle.overflow;
						else
							var f=document.defaultView.getComputedStyle(e,null),g=f.getPropertyValue("overflow");
						b=g&&g=="auto"||g=="scroll"
					} catch(h) {
					}
				if(!c) {
					d=0;
					for(var i=this.map.layers.length;d<i;d++)
						if(e==this.map.layers[d].div||e==this.map.layers[d].pane) {
							c=true;
							break
						}
				}
				d=e==this.map.div;
				e=e.parentNode
			}
			if(!b&&d) {
				c&&this.wheelZoom(a);
				OpenLayers.Event.stop(a)
			}
		}
	},
	wheelZoom: function(a) {
		var b=0;
		if(!a)
			a=window.event;
		if(a.wheelDelta) {
			b=a.wheelDelta/120;
			if(window.opera&&
			window.opera.version()<9.2)
				b=-b
		} else if(a.detail)
			b=-a.detail/3;
		if(b) {
			if(this.mousePosition)
				a.xy=this.mousePosition;
			if(!a.xy)
				a.xy=this.map.getPixelFromLonLat(this.map.getCenter());b<0?this.callback("down",[a,b]):this.callback("up",[a,b])
		}
	},
	mousemove: function(a) {
		this.mousePosition=a.xy
	},
	activate: function() {
		if(OpenLayers.Handler.prototype.activate.apply(this,arguments)) {
			var a=this.wheelListener;
			OpenLayers.Event.observe(window,"DOMMouseScroll",a);
			OpenLayers.Event.observe(window,"mousewheel",a);
			OpenLayers.Event.observe(document,
			"mousewheel",a);
			return true
		} else
			return false
	},
	deactivate: function() {
		if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)) {
			var a=this.wheelListener;
			OpenLayers.Event.stopObserving(window,"DOMMouseScroll",a);
			OpenLayers.Event.stopObserving(window,"mousewheel",a);
			OpenLayers.Event.stopObserving(document,"mousewheel",a);
			return true
		} else
			return false
	},
	CLASS_NAME:"OpenLayers.Handler.MouseWheel"
});
OpenLayers.Layer=OpenLayers.Class({
	id:null,
	name:null,
	div:null,
	opacity:null,
	alwaysInRange:null,
	EVENT_TYPES:["loadstart","loadend","loadcancel","visibilitychanged","move","moveend"],
	events:null,
	map:null,
	isBaseLayer:false,
	alpha:false,
	displayInLayerSwitcher:true,
	visibility:true,
	attribution:null,
	inRange:false,
	imageSize:null,
	imageOffset:null,
	options:null,
	eventListeners:null,
	gutter:0,
	projection:null,
	units:null,
	scales:null,
	resolutions:null,
	maxExtent:null,
	minExtent:null,
	maxResolution:null,
	minResolution:null,
	numZoomLevels:null,
	minScale:null,
	maxScale:null,
	displayOutsideMaxExtent:false,
	wrapDateLine:false,
	transitionEffect:null,
	SUPPORTED_TRANSITIONS:["resize"],
	initialize: function(a,b) {
		this.addOptions(b);
		this.name=a;
		if(this.id==null) {
			this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
			this.div=OpenLayers.Util.createDiv(this.id);
			this.div.style.width="100%";
			this.div.style.height="100%";
			this.div.dir="ltr";
			this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES);
			this.eventListeners instanceof
			Object&&this.events.on(this.eventListeners)
		}
		if(this.wrapDateLine)
			this.displayOutsideMaxExtent=true
	},
	destroy: function(a) {
		if(a==null)
			a=true;
		this.map!=null&&this.map.removeLayer(this,a);
		this.options=this.div=this.name=this.map=this.projection=null;
		if(this.events) {
			this.eventListeners&&this.events.un(this.eventListeners);
			this.events.destroy()
		}
		this.events=this.eventListeners=null
	},
	clone: function(a) {
		if(a==null)
			a=new OpenLayers.Layer(this.name,this.options);
		OpenLayers.Util.applyDefaults(a,this);
		a.map=null;
		return a
	},
	setName: function(a) {
		if(a!=this.name) {
			this.name=a;
			this.map!=null&&this.map.events.triggerEvent("changelayer", {
				layer:this,
				property:"name"
			})
		}
	},
	addOptions: function(a) {
		if(this.options==null)
			this.options= {};
		OpenLayers.Util.extend(this.options,a);
		OpenLayers.Util.extend(this,a)
	},
	onMapResize: function() {
	},
	redraw: function() {
		var a=false;
		if(this.map) {
			this.inRange=this.calculateInRange();
			var b=this.getExtent();
			if(b&&this.inRange&&this.visibility) {
				a=true;
				this.moveTo(b,a,false);
				this.events.triggerEvent("moveend", {
					zoomChanged:a
				});
				a=true
			}
		}
		return a
	},
	moveTo: function() {
		var a=this.visibility;
		this.isBaseLayer||(a=a&&this.inRange);
		this.display(a)
	},
	setMap: function(a) {
		if(this.map==null) {
			this.map=a;
			this.maxExtent=this.maxExtent||this.map.maxExtent;
			if((this.projection=this.projection||this.map.projection)&&typeof this.projection=="string")
				this.projection=new OpenLayers.Projection(this.projection);
			this.units=this.projection.getUnits()||this.units||this.map.units;
			this.initResolutions();
			if(!this.isBaseLayer) {
				this.inRange=
				this.calculateInRange();
				a=this.visibility&&this.inRange;
				this.div.style.display=a?"":"none"
			}
			this.setTileSize()
		}
	},
	afterAdd: function() {
	},
	removeMap: function() {
	},
	getImageSize: function() {
		return this.imageSize||this.tileSize
	},
	setTileSize: function(a) {
		this.tileSize=a=a?a:this.tileSize?this.tileSize:this.map.getTileSize();
		if(this.gutter) {
			this.imageOffset=new OpenLayers.Pixel(-this.gutter,-this.gutter);
			this.imageSize=new OpenLayers.Size(a.w+2*this.gutter,a.h+2*this.gutter)
		}
	},
	getVisibility: function() {
		return this.visibility
	},
	setVisibility: function(a) {
		if(a!=this.visibility) {
			this.visibility=a;
			this.display(a);
			this.redraw();
			this.map!=null&&this.map.events.triggerEvent("changelayer", {
				layer:this,
				property:"visibility"
			});
			this.events.triggerEvent("visibilitychanged")
		}
	},
	display: function(a) {
		var b=this.calculateInRange();
		if(a!=(this.div.style.display!="none"))
			this.div.style.display=a&&b?"block":"none"
	},
	calculateInRange: function() {
		var a=false;
		if(this.alwaysInRange)
			a=true;
		else if(this.map) {
			a=this.map.getResolution();
			a=a>=this.minResolution&&
			a<=this.maxResolution
		}
		return a
	},
	setIsBaseLayer: function(a) {
		if(a!=this.isBaseLayer) {
			this.isBaseLayer=a;
			this.map!=null&&this.map.events.triggerEvent("changebaselayer", {
				layer:this
			})
		}
	},
	initResolutions: function() {
		for(var a=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel"),b=["projection","units"],c=false,d={},e=0,f=a.length;e<f;e++) {
			var g=a[e];
			if(this.options[g]&&OpenLayers.Util.indexOf(b,
			g)==-1)
				c=true;
			d[g]=this.options[g]||this.map[g]
		}
		if(this.alwaysInRange==null)
			this.alwaysInRange=!c;
		if((this.options.minScale!=null||this.options.maxScale!=null)&&this.options.scales==null)
			d.scales=null;
		if((this.options.minResolution!=null||this.options.maxResolution!=null)&&this.options.resolutions==null)
			d.resolutions=null;
		if(!d.numZoomLevels&&d.maxZoomLevel)
			d.numZoomLevels=d.maxZoomLevel+1;
		if(d.scales!=null||d.resolutions!=null) {
			if(d.scales!=null) {
				d.resolutions=[];
				e=0;
				for(f=d.scales.length;e<f;e++) {
					a=
					d.scales[e];
					d.resolutions[e]=OpenLayers.Util.getResolutionFromScale(a,d.units)
				}
			}
			d.numZoomLevels=d.resolutions.length
		} else {
			if(d.minScale)
				d.maxResolution=OpenLayers.Util.getResolutionFromScale(d.minScale,d.units);
			else if(d.maxResolution=="auto") {
				f=this.map.getSize();
				e=d.maxExtent.getWidth()/f.w;
				f=d.maxExtent.getHeight()/f.h;
				d.maxResolution=Math.max(e,f)
			}
			if(d.maxScale!=null)
				d.minResolution=OpenLayers.Util.getResolutionFromScale(d.maxScale,d.units);
			else if(d.minResolution=="auto"&&d.minExtent!=null) {
				f=
				this.map.getSize();
				e=d.minExtent.getWidth()/f.w;
				f=d.minExtent.getHeight()/f.h;
				d.minResolution=Math.max(e,f)
			}
			if(d.minResolution!=null&&this.options.numZoomLevels==undefined) {
				e=d.maxResolution/d.minResolution;
				d.numZoomLevels=Math.floor(Math.log(e)/Math.log(2))+1
			}
			d.resolutions=new Array(d.numZoomLevels);
			f=2;
			if(typeof d.minResolution=="number"&&d.numZoomLevels>1)
				f=Math.pow(d.maxResolution/d.minResolution,1/(d.numZoomLevels-1));
			for(e=0;e<d.numZoomLevels;e++) {
				a=d.maxResolution/Math.pow(f,e);
				d.resolutions[e]=
				a
			}
		}
		d.resolutions.sort( function(h,i) {
			return i-h
		});
		this.resolutions=d.resolutions;
		this.maxResolution=d.resolutions[0];
		e=d.resolutions.length-1;
		this.minResolution=d.resolutions[e];
		this.scales=[];
		e=0;
		for(f=d.resolutions.length;e<f;e++)
			this.scales[e]=OpenLayers.Util.getScaleFromResolution(d.resolutions[e],d.units);
		this.minScale=this.scales[0];
		this.maxScale=this.scales[this.scales.length-1];
		this.numZoomLevels=d.numZoomLevels
	},
	getResolution: function() {
		var a=this.map.getZoom();
		return this.getResolutionForZoom(a)
	},
	getExtent: function() {
		return this.map.calculateBounds()
	},
	getZoomForExtent: function(a,b) {
		var c=this.map.getSize();
		a=Math.max(a.getWidth()/c.w,a.getHeight()/c.h);
		return this.getZoomForResolution(a,b)
	},
	getDataExtent: function() {
	},
	getResolutionForZoom: function(a) {
		a=Math.max(0,Math.min(a,this.resolutions.length-1));
		if(this.map.fractionalZoom) {
			var b=Math.floor(a),c=Math.ceil(a);
			a=this.resolutions[b]-(a-b)*(this.resolutions[b]-this.resolutions[c])
		} else
			a=this.resolutions[Math.round(a)];
		return a
	},
	getZoomForResolution: function(a,
	b) {
		if(this.map.fractionalZoom) {
			b=0;
			var c=this.resolutions.length-1,d=this.resolutions[b],e=this.resolutions[c],f;
			c=0;
			for(var g=this.resolutions.length;c<g;++c) {
				f=this.resolutions[c];
				if(f>=a) {
					d=f;
					b=c
				}
				if(f<=a) {
					e=f;
					break
				}
			}
			c=d-e;
			a=c>0?b+(d-a)/c:b
		} else {
			e=Number.POSITIVE_INFINITY;
			c=0;
			for(g=this.resolutions.length;c<g;c++)
				if(b) {
					d=Math.abs(this.resolutions[c]-a);
					if(d>e)
						break;
					e=d
				} else if(this.resolutions[c]<a)
					break;
			a=Math.max(0,c-1)
		}
		return a
	},
	getLonLatFromViewPortPx: function(a) {
		var b=null;
		if(a!=null) {
			var c=
			this.map.getSize(),d=this.map.getCenter();
			if(d) {
				b=this.map.getResolution();
				var e=a.x-c.w/2;
				a=a.y-c.h/2;
				b=new OpenLayers.LonLat(d.lon+e*b,d.lat-a*b);
				if(this.wrapDateLine)
					b=b.wrapDateLine(this.maxExtent)
			}
		}
		return b
	},
	getViewPortPxFromLonLat: function(a) {
		var b=null;
		if(a!=null) {
			b=this.map.getResolution();
			var c=this.map.getExtent();
			b=new OpenLayers.Pixel(1/b*(a.lon-c.left),1/b*(c.top-a.lat))
		}
		return b
	},
	setOpacity: function(a) {
		if(a!=this.opacity) {
			this.opacity=a;
			for(var b=0,c=this.div.childNodes.length;b<c;++b) {
				var d=
				this.div.childNodes[b].firstChild;
				OpenLayers.Util.modifyDOMElement(d,null,null,null,null,null,null,a)
			}
		}
	},
	getZIndex: function() {
		return this.div.style.zIndex
	},
	setZIndex: function(a) {
		this.div.style.zIndex=a
	},
	adjustBounds: function(a) {
		if(this.gutter) {
			var b=this.gutter*this.map.getResolution();
			a=new OpenLayers.Bounds(a.left-b,a.bottom-b,a.right+b,a.top+b)
		}
		if(this.wrapDateLine) {
			b= {
				rightTolerance:this.getResolution()
			};
			a=a.wrapDateLine(this.maxExtent,b)
		}
		return a
	},
	CLASS_NAME:"OpenLayers.Layer"
});
(function() {
	var a=window.XMLHttpRequest,b=!!window.controllers,c=window.document.all&&!window.opera;
	function d() {
		this._object=a?new a:new window.ActiveXObject("Microsoft.XMLHTTP")
	}

	if(b&&a.wrapped)
		d.wrapped=a.wrapped;
	d.UNSENT=0;
	d.OPENED=1;
	d.HEADERS_RECEIVED=2;
	d.LOADING=3;
	d.DONE=4;
	d.prototype.readyState=d.UNSENT;
	d.prototype.responseText="";
	d.prototype.responseXML=null;
	d.prototype.status=0;
	d.prototype.statusText="";
	d.prototype.onreadystatechange=null;
	d.onreadystatechange=null;
	d.onopen=null;
	d.onsend=
	null;
	d.onabort=null;
	d.prototype.open= function(i,j,l,k,n) {
		this._async=l;
		var m=this,o=this.readyState;
		if(c) {
			var p= function() {
				m._object.readyState!=d.DONE&&h(m)
			};
			l&&window.attachEvent("onunload",p)
		}
		this._object.onreadystatechange= function() {
			if(!(b&&!l)) {
				m.readyState=m._object.readyState;
				g(m);
				if(m._aborted)
					m.readyState=d.UNSENT;
				else {
					if(m.readyState==d.DONE) {
						h(m);
						c&&l&&window.detachEvent("onunload",p)
					}
					o!=m.readyState&&e(m);
					o=m.readyState
				}
			}
		};
		d.onopen&&d.onopen.apply(this,arguments);
		this._object.open(i,
		j,l,k,n);
		if(!l&&b) {
			this.readyState=d.OPENED;
			e(this)
		}
	};
	d.prototype.send= function(i) {
		d.onsend&&d.onsend.apply(this,arguments);
		if(i&&i.nodeType) {
			i=window.XMLSerializer?(new window.XMLSerializer).serializeToString(i):i.xml;
			this._headers["Content-Type"]||this._object.setRequestHeader("Content-Type","application/xml")
		}
		this._object.send(i);
		if(b&&!this._async) {
			this.readyState=d.OPENED;
			for(g(this);this.readyState<d.DONE;) {
				this.readyState++;
				e(this);
				if(this._aborted)
					return
			}
		}
	};
	d.prototype.abort= function() {
		d.onabort&&
		d.onabort.apply(this,arguments);
		if(this.readyState>d.UNSENT)
			this._aborted=true;
		this._object.abort();
		h(this)
	};
	d.prototype.getAllResponseHeaders= function() {
		return this._object.getAllResponseHeaders()
	};
	d.prototype.getResponseHeader= function(i) {
		return this._object.getResponseHeader(i)
	};
	d.prototype.setRequestHeader= function(i,j) {
		if(!this._headers)
			this._headers= {};
		this._headers[i]=j;
		return this._object.setRequestHeader(i,j)
	};
	d.prototype.toString= function() {
		return"[object XMLHttpRequest]"
	};
	d.toString= function() {
		return"[XMLHttpRequest]"
	};
	function e(i) {
		i.onreadystatechange&&i.onreadystatechange.apply(i);
		d.onreadystatechange&&d.onreadystatechange.apply(i)
	}

	function f(i) {
		var j=i.responseXML;
		if(c&&j&&!j.documentElement&&i.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)) {
			j=new ActiveXObject("Microsoft.XMLDOM");
			j.loadXML(i.responseText)
		}
		if(j)
			if(c&&j.parseError!=0||j.documentElement&&j.documentElement.tagName=="parsererror")
				return null;
		return j
	}

	function g(i) {
		try {
			i.responseText=i._object.responseText
		} catch(j) {
		}
		try {
			i.responseXML=
			f(i._object)
		} catch(l) {
		}
		try {
			i.status=i._object.status
		} catch(k) {
		}
		try {
			i.statusText=i._object.statusText
		} catch(n) {
		}
	}

	function h(i) {
		i._object.onreadystatechange=new window.Function;
		delete i._headers
	}

	if(!window.Function.prototype.apply)
		window.Function.prototype.apply= function(i,j) {
			j||(j=[]);
			i.__func=this;
			i.__func(j[0],j[1],j[2],j[3],j[4]);
			delete i.__func
		};
	OpenLayers.Request.XMLHttpRequest=d
})();
OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control, {
	type:OpenLayers.Control.TYPE_TOOL,
	panned:false,
	interval:25,
	draw: function() {
		this.handler=new OpenLayers.Handler.Drag(this, {
			move:this.panMap,
			done:this.panMapDone
		}, {
			interval:this.interval
		})
	},
	panMap: function(a) {
		this.panned=true;
		this.map.pan(this.handler.last.x-a.x,this.handler.last.y-a.y, {
			dragging:this.handler.dragging,
			animate:false
		})
	},
	panMapDone: function(a) {
		if(this.panned) {
			this.panMap(a);
			this.panned=false
		}
	},
	CLASS_NAME:"OpenLayers.Control.DragPan"
});
OpenLayers.State= {
	UNKNOWN:"Unknown",
	INSERT:"Insert",
	UPDATE:"Update",
	DELETE:"Delete"
};
OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature, {
	fid:null,
	geometry:null,
	attributes:null,
	bounds:null,
	state:null,
	style:null,
	renderIntent:"default",
	initialize: function(a,b,c) {
		OpenLayers.Feature.prototype.initialize.apply(this,[null,null,b]);
		this.lonlat=null;
		this.geometry=a?a:null;
		this.state=null;
		this.attributes= {};
		if(b)
			this.attributes=OpenLayers.Util.extend(this.attributes,b);
		this.style=c?c:null
	},
	destroy: function() {
		if(this.layer) {
			this.layer.removeFeatures(this);
			this.layer=null
		}
		this.geometry=
		null;
		OpenLayers.Feature.prototype.destroy.apply(this,arguments)
	},
	clone: function() {
		return new OpenLayers.Feature.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)
	},
	onScreen: function(a) {
		var b=false;
		if(this.layer&&this.layer.map) {
			b=this.layer.map.getExtent();
			if(a) {
				a=this.geometry.getBounds();
				b=b.intersectsBounds(a)
			} else {
				a=b.toGeometry();
				b=a.intersects(this.geometry)
			}
		}
		return b
	},
	createMarker: function() {
		return null
	},
	destroyMarker: function() {
	},
	createPopup: function() {
		return null
	},
	atPoint: function(a,b,c) {
		var d=false;
		if(this.geometry)
			d=this.geometry.atPoint(a,b,c);
		return d
	},
	destroyPopup: function() {
	},
	move: function(a) {
		if(this.layer&&this.geometry.move) {
			a=a.CLASS_NAME=="OpenLayers.LonLat"?this.layer.getViewPortPxFromLonLat(a):a;
			var b=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat()),c=this.layer.map.getResolution();
			this.geometry.move(c*(a.x-b.x),c*(b.y-a.y));
			this.layer.drawFeature(this);
			return b
		}
	},
	toState: function(a) {
		if(a==OpenLayers.State.UPDATE)
			switch(this.state) {
				case OpenLayers.State.UNKNOWN:
				case OpenLayers.State.DELETE:
					this.state=
					a;
					break;
				case OpenLayers.State.UPDATE:
				case OpenLayers.State.INSERT:
					break
			}
		else if(a==OpenLayers.State.INSERT)
			switch(this.state) {
				case OpenLayers.State.UNKNOWN:
					break;
				default:
					this.state=a;
					break
			}
		else if(a==OpenLayers.State.DELETE)
			switch(this.state) {
				case OpenLayers.State.INSERT:
					break;
				case OpenLayers.State.DELETE:
					break;
				case OpenLayers.State.UNKNOWN:
				case OpenLayers.State.UPDATE:
					this.state=a;
					break
			}
		else if(a==OpenLayers.State.UNKNOWN)
			this.state=a
	},
	CLASS_NAME:"OpenLayers.Feature.Vector"
});
OpenLayers.Feature.Vector.style= {
	"default": {
		fillColor:"#ee9900",
		fillOpacity:0.4,
		hoverFillColor:"white",
		hoverFillOpacity:0.8,
		strokeColor:"#ee9900",
		strokeOpacity:1,
		strokeWidth:1,
		strokeLinecap:"round",
		strokeDashstyle:"solid",
		hoverStrokeColor:"red",
		hoverStrokeOpacity:1,
		hoverStrokeWidth:0.2,
		pointRadius:6,
		hoverPointRadius:1,
		hoverPointUnit:"%",
		pointerEvents:"visiblePainted",
		cursor:"inherit"
	},
	select: {
		fillColor:"blue",
		fillOpacity:0.4,
		hoverFillColor:"white",
		hoverFillOpacity:0.8,
		strokeColor:"blue",
		strokeOpacity:1,
		strokeWidth:2,
		strokeLinecap:"round",
		strokeDashstyle:"solid",
		hoverStrokeColor:"red",
		hoverStrokeOpacity:1,
		hoverStrokeWidth:0.2,
		pointRadius:6,
		hoverPointRadius:1,
		hoverPointUnit:"%",
		pointerEvents:"visiblePainted",
		cursor:"pointer"
	},
	temporary: {
		fillColor:"#66cccc",
		fillOpacity:0.2,
		hoverFillColor:"white",
		hoverFillOpacity:0.8,
		strokeColor:"#66cccc",
		strokeOpacity:1,
		strokeLinecap:"round",
		strokeWidth:2,
		strokeDashstyle:"solid",
		hoverStrokeColor:"red",
		hoverStrokeOpacity:1,
		hoverStrokeWidth:0.2,
		pointRadius:6,
		hoverPointRadius:1,
		hoverPointUnit:"%",
		pointerEvents:"visiblePainted",
		cursor:"inherit"
	},
	"delete": {
		display:"none"
	}
};
OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler, {
	dragHandler:null,
	boxDivClassName:"olHandlerBoxZoomBox",
	boxCharacteristics:null,
	initialize: function(a,b) {
		OpenLayers.Handler.prototype.initialize.apply(this,arguments);
		b= {
			down:this.startBox,
			move:this.moveBox,
			out:this.removeBox,
			up:this.endBox
		};
		this.dragHandler=new OpenLayers.Handler.Drag(this,b, {
			keyMask:this.keyMask
		})
	},
	setMap: function(a) {
		OpenLayers.Handler.prototype.setMap.apply(this,arguments);
		this.dragHandler&&this.dragHandler.setMap(a)
	},
	startBox: function() {
		this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.dragHandler.start);
		this.zoomBox.className=this.boxDivClassName;
		this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;
		this.map.viewPortDiv.appendChild(this.zoomBox);
		OpenLayers.Element.addClass(this.map.viewPortDiv,"olDrawBox")
	},
	moveBox: function(a) {
		var b=this.dragHandler.start.x,c=this.dragHandler.start.y,d=Math.abs(b-a.x),e=Math.abs(c-a.y);
		this.zoomBox.style.width=Math.max(1,d)+"px";
		this.zoomBox.style.height=Math.max(1,e)+
		"px";
		this.zoomBox.style.left=a.x<b?a.x+"px":b+"px";
		this.zoomBox.style.top=a.y<c?a.y+"px":c+"px";
		var f=this.getBoxCharacteristics();
		if(f.newBoxModel) {
			if(a.x>b)
				this.zoomBox.style.width=Math.max(1,d-f.xOffset)+"px";
			if(a.y>c)
				this.zoomBox.style.height=Math.max(1,e-f.yOffset)+"px"
		}
	},
	endBox: function(a) {
		var b;
		if(Math.abs(this.dragHandler.start.x-a.x)>5||Math.abs(this.dragHandler.start.y-a.y)>5) {
			var c=this.dragHandler.start;
			b=Math.min(c.y,a.y);
			var d=Math.max(c.y,a.y),e=Math.min(c.x,a.x);
			a=Math.max(c.x,a.x);
			b=new OpenLayers.Bounds(e,d,a,b)
		} else
			b=this.dragHandler.start.clone();
		this.removeBox();
		this.callback("done",[b])
	},
	removeBox: function() {
		this.map.viewPortDiv.removeChild(this.zoomBox);
		this.boxCharacteristics=this.zoomBox=null;
		OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDrawBox")
	},
	activate: function() {
		if(OpenLayers.Handler.prototype.activate.apply(this,arguments)) {
			this.dragHandler.activate();
			return true
		} else
			return false
	},
	deactivate: function() {
		if(OpenLayers.Handler.prototype.deactivate.apply(this,
		arguments)) {
			this.dragHandler.deactivate();
			return true
		} else
			return false
	},
	getBoxCharacteristics: function() {
		if(!this.boxCharacteristics) {
			var a=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width"))+1,b=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"))+1,c=OpenLayers.Util.getBrowserName()=="msie"?document.compatMode!=
			"BackCompat":true;
			this.boxCharacteristics= {
				xOffset:a,
				yOffset:b,
				newBoxModel:c
			}
		}
		return this.boxCharacteristics
	},
	CLASS_NAME:"OpenLayers.Handler.Box"
});
OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer, {
	smoothDragPan:true,
	isBaseLayer:true,
	isFixed:true,
	pane:null,
	mapObject:null,
	initialize: function() {
		OpenLayers.Layer.prototype.initialize.apply(this,arguments);
		if(this.pane==null)
			this.pane=OpenLayers.Util.createDiv(this.div.id+"_EventPane")
	},
	destroy: function() {
		this.mapObject=null;
		OpenLayers.Layer.prototype.destroy.apply(this,arguments)
	},
	setMap: function() {
		OpenLayers.Layer.prototype.setMap.apply(this,arguments);
		this.pane.style.zIndex=parseInt(this.div.style.zIndex)+
		1;
		this.pane.style.display=this.div.style.display;
		this.pane.style.width="100%";
		this.pane.style.height="100%";
		if(OpenLayers.Util.getBrowserName()=="msie")
			this.pane.style.background="url("+OpenLayers.Util.getImagesLocation()+"blank.gif)";this.isFixed?this.map.viewPortDiv.appendChild(this.pane):this.map.layerContainerDiv.appendChild(this.pane);
		this.loadMapObject();
		this.mapObject==null&&this.loadWarningMessage()
	},
	removeMap: function() {
		if(this.pane&&this.pane.parentNode) {
			this.pane.parentNode.removeChild(this.pane);
			this.pane=null
		}
		OpenLayers.Layer.prototype.removeMap.apply(this,arguments)
	},
	loadWarningMessage: function() {
		this.div.style.backgroundColor="darkblue";
		var a=this.map.getSize(),b=Math.min(a.w,300),c=Math.min(a.h,200);
		b=new OpenLayers.Size(b,c);
		a=new OpenLayers.Pixel(a.w/2,a.h/2);
		a=a.add(-b.w/2,-b.h/2);
		a=OpenLayers.Util.createDiv(this.name+"_warning",a,b,null,null,null,"auto");
		a.style.padding="7px";
		a.style.backgroundColor="yellow";
		a.innerHTML=this.getWarningHTML();
		this.div.appendChild(a)
	},
	getWarningHTML: function() {
		return""
	},
	display: function() {
		OpenLayers.Layer.prototype.display.apply(this,arguments);
		this.pane.style.display=this.div.style.display
	},
	setZIndex: function() {
		OpenLayers.Layer.prototype.setZIndex.apply(this,arguments);
		this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1
	},
	moveTo: function(a,b,c) {
		OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
		if(this.mapObject!=null) {
			var d=this.map.getCenter(),e=this.map.getZoom();
			if(d!=null) {
				var f=this.getMapObjectCenter();
				f=this.getOLLonLatFromMapObjectLonLat(f);
				var g=
				this.getMapObjectZoom();
				g=this.getOLZoomFromMapObjectZoom(g);
				if(!d.equals(f)||e!=g)
					if(c&&this.dragPanMapObject&&this.smoothDragPan) {
						e=this.map.getViewPortPxFromLonLat(f);
						d=this.map.getViewPortPxFromLonLat(d);
						this.dragPanMapObject(d.x-e.x,e.y-d.y)
					} else {
						d=this.getMapObjectLonLatFromOLLonLat(d);
						e=this.getMapObjectZoomFromOLZoom(e);
						this.setMapObjectCenter(d,e,c)
					}
			}
		}
	},
	getLonLatFromViewPortPx: function(a) {
		var b=null;
		if(this.mapObject!=null&&this.getMapObjectCenter()!=null) {
			a=this.getMapObjectPixelFromOLPixel(a);
			a=this.getMapObjectLonLatFromMapObjectPixel(a);
			b=this.getOLLonLatFromMapObjectLonLat(a)
		}
		return b
	},
	getViewPortPxFromLonLat: function(a) {
		var b=null;
		if(this.mapObject!=null&&this.getMapObjectCenter()!=null) {
			a=this.getMapObjectLonLatFromOLLonLat(a);
			a=this.getMapObjectPixelFromMapObjectLonLat(a);
			b=this.getOLPixelFromMapObjectPixel(a)
		}
		return b
	},
	getOLLonLatFromMapObjectLonLat: function(a) {
		var b=null;
		if(a!=null) {
			b=this.getLongitudeFromMapObjectLonLat(a);
			a=this.getLatitudeFromMapObjectLonLat(a);
			b=new OpenLayers.LonLat(b,
			a)
		}
		return b
	},
	getMapObjectLonLatFromOLLonLat: function(a) {
		var b=null;
		if(a!=null)
			b=this.getMapObjectLonLatFromLonLat(a.lon,a.lat);
		return b
	},
	getOLPixelFromMapObjectPixel: function(a) {
		var b=null;
		if(a!=null) {
			b=this.getXFromMapObjectPixel(a);
			a=this.getYFromMapObjectPixel(a);
			b=new OpenLayers.Pixel(b,a)
		}
		return b
	},
	getMapObjectPixelFromOLPixel: function(a) {
		var b=null;
		if(a!=null)
			b=this.getMapObjectPixelFromXY(a.x,a.y);
		return b
	},
	CLASS_NAME:"OpenLayers.Layer.EventPane"
});
OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({
	initialize: function() {
	},
	initResolutions: function() {
		for(var a=new Array("minZoomLevel","maxZoomLevel","numZoomLevels"),b=0,c=a.length;b<c;b++) {
			var d=a[b];
			this[d]=this.options[d]!=null?this.options[d]:this.map[d]
		}
		if(this.minZoomLevel==null||this.minZoomLevel<this.MIN_ZOOM_LEVEL)
			this.minZoomLevel=this.MIN_ZOOM_LEVEL;
		a=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;
		b=this.options.numZoomLevels==null&&this.options.maxZoomLevel!=null||this.numZoomLevels==null&&
		this.maxZoomLevel!=null?this.maxZoomLevel-this.minZoomLevel+1:this.numZoomLevels;
		this.numZoomLevels=b!=null?Math.min(b,a):a;
		this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;
		if(this.RESOLUTIONS!=null) {
			a=0;
			this.resolutions=[];
			for(b=this.minZoomLevel;b<=this.maxZoomLevel;b++)
				this.resolutions[a++]=this.RESOLUTIONS[b];
			this.maxResolution=this.resolutions[0];
			this.minResolution=this.resolutions[this.resolutions.length-1]
		}
	},
	getResolution: function() {
		if(this.resolutions!=null)
			return OpenLayers.Layer.prototype.getResolution.apply(this,
			arguments);
		else {
			var a=null,b=this.map.getSize(),c=this.getExtent();
			if(b!=null&&c!=null)
				a=Math.max(c.getWidth()/b.w,c.getHeight()/b.h);
			return a
		}
	},
	getExtent: function() {
		var a=null,b=this.map.getSize(),c=new OpenLayers.Pixel(0,0);
		c=this.getLonLatFromViewPortPx(c);
		b=new OpenLayers.Pixel(b.w,b.h);
		b=this.getLonLatFromViewPortPx(b);
		if(c!=null&&b!=null)
			a=new OpenLayers.Bounds(c.lon,b.lat,b.lon,c.lat);
		return a
	},
	getZoomForResolution: function() {
		if(this.resolutions!=null)
			return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,
			arguments);
		else {
			var a=OpenLayers.Layer.prototype.getExtent.apply(this,[]);
			return this.getZoomForExtent(a)
		}
	},
	getOLZoomFromMapObjectZoom: function(a) {
		var b=null;
		if(a!=null)
			b=a-this.minZoomLevel;
		return b
	},
	getMapObjectZoomFromOLZoom: function(a) {
		var b=null;
		if(a!=null)
			b=a+this.minZoomLevel;
		return b
	},
	CLASS_NAME:"OpenLayers.Layer.FixedZoomLevels"
});
OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer, {
	URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,
	url:null,
	params:null,
	reproject:false,
	initialize: function(a,b,c,d) {
		var e=arguments;
		e=[a,d];
		OpenLayers.Layer.prototype.initialize.apply(this,e);
		this.url=b;
		this.params=OpenLayers.Util.extend({},c)
	},
	destroy: function() {
		this.params=this.url=null;
		OpenLayers.Layer.prototype.destroy.apply(this,arguments)
	},
	clone: function(a) {
		if(a==null)
			a=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.options);
		return a=OpenLayers.Layer.prototype.clone.apply(this,[a])
	},
	setUrl: function(a) {
		this.url=a
	},
	mergeNewParams: function(a) {
		this.params=OpenLayers.Util.extend(this.params,a);
		return this.redraw()
	},
	redraw: function(a) {
		return a?this.mergeNewParams({
			_olSalt:Math.random()
		}):OpenLayers.Layer.prototype.redraw.apply(this,[])
	},
	selectUrl: function(a,b) {
		for(var c=1,d=0,e=a.length;d<e;d++) {
			c*=a.charCodeAt(d)*this.URL_HASH_FACTOR;
			c-=Math.floor(c)
		}
		return b[Math.floor(c*b.length)]
	},
	getFullRequestString: function(a,b) {
		b=b||
		this.url;
		var c=OpenLayers.Util.extend({},this.params);
		c=OpenLayers.Util.extend(c,a);
		a=OpenLayers.Util.getParameterString(c);
		if(b instanceof Array)
			b=this.selectUrl(a,b);
		a=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(b));
		for(var d in c)
			d.toUpperCase()in a&&delete c[d];
		a=OpenLayers.Util.getParameterString(c);
		d=b;
		if(a!="") {
			c=b.charAt(b.length-1);
			d+=c=="&"||c=="?"?a:b.indexOf("?")==-1?"?"+a:"&"+a
		}
		return d
	},
	CLASS_NAME:"OpenLayers.Layer.HTTPRequest"
});
OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer, {
	isBaseLayer:false,
	markers:null,
	drawn:false,
	initialize: function() {
		OpenLayers.Layer.prototype.initialize.apply(this,arguments);
		this.markers=[]
	},
	destroy: function() {
		this.clearMarkers();
		this.markers=null;
		OpenLayers.Layer.prototype.destroy.apply(this,arguments)
	},
	setOpacity: function(a) {
		if(a!=this.opacity) {
			this.opacity=a;
			a=0;
			for(var b=this.markers.length;a<b;a++)
				this.markers[a].setOpacity(this.opacity)
		}
	},
	moveTo: function(a,b) {
		OpenLayers.Layer.prototype.moveTo.apply(this,
		arguments);
		if(b||!this.drawn) {
			for(var c=0,d=this.markers.length;c<d;c++)
				this.drawMarker(this.markers[c]);
			this.drawn=true
		}
	},
	addMarker: function(a) {
		this.markers.push(a);
		this.opacity!=null&&a.setOpacity(this.opacity);
		if(this.map&&this.map.getExtent()) {
			a.map=this.map;
			this.drawMarker(a)
		}
	},
	removeMarker: function(a) {
		if(this.markers&&this.markers.length) {
			OpenLayers.Util.removeItem(this.markers,a);
			a.erase()
		}
	},
	clearMarkers: function() {
		if(this.markers!=null)
			for(;this.markers.length>0;)
				this.removeMarker(this.markers[0])
	},
	drawMarker: function(a) {
		var b=this.map.getLayerPxFromLonLat(a.lonlat);
		if(b==null)
			a.display(false);
		else if(a.isDrawn())
			a.icon&&a.icon.moveTo(b);
		else {
			a=a.draw(b);
			this.div.appendChild(a)
		}
	},
	getDataExtent: function() {
		var a=null;
		if(this.markers&&this.markers.length>0) {
			a=new OpenLayers.Bounds;
			for(var b=0,c=this.markers.length;b<c;b++) {
				var d=this.markers[b];
				a.extend(d.lonlat)
			}
		}
		return a
	},
	CLASS_NAME:"OpenLayers.Layer.Markers"
});
OpenLayers.Layer.SphericalMercator= {
	getExtent: function() {
		var a=null;
		return a=this.sphericalMercator?this.map.calculateBounds():OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)
	},
	initMercatorParameters: function() {
		this.RESOLUTIONS=[];
		for(var a=156543.0339,b=0;b<=this.MAX_ZOOM_LEVEL;++b)
			this.RESOLUTIONS[b]=a/Math.pow(2,b);
		this.units="m";
		this.projection="EPSG:900913"
	},
	forwardMercator: function(a,b) {
		a=a*2.003750834E7/180;
		b=Math.log(Math.tan((90+b)*Math.PI/360))/(Math.PI/180);
		b=b*2.003750834E7/
		180;
		return new OpenLayers.LonLat(a,b)
	},
	inverseMercator: function(a,b) {
		a=a/2.003750834E7*180;
		b=b/2.003750834E7*180;
		b=180/Math.PI*(2*Math.atan(Math.exp(b*Math.PI/180))-Math.PI/2);
		return new OpenLayers.LonLat(a,b)
	},
	projectForward: function(a) {
		var b=OpenLayers.Layer.SphericalMercator.forwardMercator(a.x,a.y);
		a.x=b.lon;
		a.y=b.lat;
		return a
	},
	projectInverse: function(a) {
		var b=OpenLayers.Layer.SphericalMercator.inverseMercator(a.x,a.y);
		a.x=b.lon;
		a.y=b.lat;
		return a
	}
};
OpenLayers.Projection.addTransform("EPSG:4326","EPSG:900913",OpenLayers.Layer.SphericalMercator.projectForward);
OpenLayers.Projection.addTransform("EPSG:900913","EPSG:4326",OpenLayers.Layer.SphericalMercator.projectInverse);
OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control, {
	EVENT_TYPES:["measure","measurepartial"],
	handlerOptions:null,
	callbacks:null,
	displaySystem:"metric",
	geodesic:false,
	displaySystemUnits: {
		geographic:["dd"],
		english:["mi","ft","in"],
		metric:["km","m"]
	},
	partialDelay:300,
	delayedTrigger:null,
	persist:false,
	initialize: function(a,b) {
		this.EVENT_TYPES=OpenLayers.Control.Measure.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);
		OpenLayers.Control.prototype.initialize.apply(this,
		[b]);
		this.callbacks=OpenLayers.Util.extend({
			done:this.measureComplete,
			point:this.measurePartial
		},this.callbacks);
		this.handlerOptions=OpenLayers.Util.extend({
			persist:this.persist
		},this.handlerOptions);
		this.handler=new a(this,this.callbacks,this.handlerOptions)
	},
	cancel: function() {
		this.handler.cancel()
	},
	updateHandler: function(a,b) {
		var c=this.active;
		c&&this.deactivate();
		this.handler=new a(this,this.callbacks,b);
		c&&this.activate()
	},
	measureComplete: function(a) {
		this.delayedTrigger&&window.clearTimeout(this.delayedTrigger);
		this.measure(a,"measure")
	},
	measurePartial: function(a,b) {
		this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind( function() {
			this.measure(b,"measurepartial")
		},this),this.partialDelay)
	},
	measure: function(a,b) {
		var c,d;
		if(a.CLASS_NAME.indexOf("LineString")>-1) {
			c=this.getBestLength(a);
			d=1
		} else {
			c=this.getBestArea(a);
			d=2
		}
		this.events.triggerEvent(b, {
			measure:c[0],
			units:c[1],
			order:d,
			geometry:a
		})
	},
	getBestArea: function(a) {
		for(var b=this.displaySystemUnits[this.displaySystem],c,d,e=0,f=b.length;e<f;++e) {
			c=
			b[e];
			d=this.getArea(a,c);
			if(d>1)
				break
		}
		return[d,c]
	},
	getArea: function(a,b) {
		var c;
		if(this.geodesic) {
			a=a.getGeodesicArea(this.map.getProjectionObject());
			c="m"
		} else {
			a=a.getArea();
			c=this.map.getUnits()
		}
		if(b=OpenLayers.INCHES_PER_UNIT[b]) {
			c=OpenLayers.INCHES_PER_UNIT[c];
			a*=Math.pow(c/b,2)
		}
		return a
	},
	getBestLength: function(a) {
		for(var b=this.displaySystemUnits[this.displaySystem],c,d,e=0,f=b.length;e<f;++e) {
			c=b[e];
			d=this.getLength(a,c);
			if(d>1)
				break
		}
		return[d,c]
	},
	getLength: function(a,b) {
		var c;
		if(this.geodesic) {
			a=
			a.getGeodesicLength(this.map.getProjectionObject());
			c="m"
		} else {
			a=a.getLength();
			c=this.map.getUnits()
		}
		if(b=OpenLayers.INCHES_PER_UNIT[b]) {
			c=OpenLayers.INCHES_PER_UNIT[c];
			a*=c/b
		}
		return a
	},
	CLASS_NAME:"OpenLayers.Control.Measure"
});
OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control, {
	type:OpenLayers.Control.TYPE_TOOL,
	out:false,
	alwaysZoom:false,
	draw: function() {
		this.handler=new OpenLayers.Handler.Box(this, {
			done:this.zoomBox
		}, {
			keyMask:this.keyMask
		})
	},
	zoomBox: function(a) {
		if(a instanceof OpenLayers.Bounds) {
			if(this.out) {
				var b=Math.abs(a.right-a.left),c=Math.abs(a.top-a.bottom);
				b=Math.min(this.map.size.h/c,this.map.size.w/b);
				c=this.map.getExtent();
				var d=this.map.getLonLatFromPixel(a.getCenterPixel());
				a=d.lon-c.getWidth()/
				2*b;
				var e=d.lon+c.getWidth()/2*b,f=d.lat-c.getHeight()/2*b;
				b=d.lat+c.getHeight()/2*b;
				b=new OpenLayers.Bounds(a,f,e,b)
			} else {
				b=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.left,a.bottom));
				c=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.right,a.top));
				b=new OpenLayers.Bounds(b.lon,b.lat,c.lon,c.lat)
			}
			c=this.map.getZoom();
			this.map.zoomToExtent(b);
			if(c==this.map.getZoom()&&this.alwaysZoom==true)
				this.map.zoomTo(c+(this.out?-1:1))
		} else this.out?this.map.setCenter(this.map.getLonLatFromPixel(a),
			this.map.getZoom()-1):this.map.setCenter(this.map.getLonLatFromPixel(a),this.map.getZoom()+1)
	},
	CLASS_NAME:"OpenLayers.Control.ZoomBox"
});
OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format, {
	initialize: function(a) {
		this.regExes= {
			typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,
			spaces:/\s+/,
			parenComma:/\)\s*,\s*\(/,
			doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,
			trimParens:/^\s*\(?(.*?)\)?\s*$/
		};
		OpenLayers.Format.prototype.initialize.apply(this,[a])
	},
	read: function(a) {
		var b,c;
		if(c=this.regExes.typeStr.exec(a)) {
			a=c[1].toLowerCase();
			c=c[2];
			if(this.parse[a])
				b=this.parse[a].apply(this,[c]);
			if(this.internalProjection&&this.externalProjection)
				if(b&&b.CLASS_NAME==
				"OpenLayers.Feature.Vector")
					b.geometry.transform(this.externalProjection,this.internalProjection);
				else if(b&&a!="geometrycollection"&&typeof b=="object") {
					a=0;
					for(c=b.length;a<c;a++) {
						var d=b[a];
						d.geometry.transform(this.externalProjection,this.internalProjection)
					}
				}
		}
		return b
	},
	write: function(a) {
		var b,c,d;
		if(a.constructor==Array) {
			a=a;
			d=true
		} else {
			a=[a];
			d=false
		}
		var e=[];
		d&&e.push("GEOMETRYCOLLECTION(");
		for(var f=0,g=a.length;f<g;++f) {
			d&&f>0&&e.push(",");
			b=a[f].geometry;
			c=b.CLASS_NAME.split(".")[2].toLowerCase();
			if(!this.extract[c])
				return null;
			if(this.internalProjection&&this.externalProjection) {
				b=b.clone();
				b.transform(this.internalProjection,this.externalProjection)
			}
			b=this.extract[c].apply(this,[b]);
			e.push(c.toUpperCase()+"("+b+")")
		}
		d&&e.push(")");
		return e.join("")
	},
	extract: {
		point: function(a) {
			return a.x+" "+a.y
		},
		multipoint: function(a) {
			for(var b=[],c=0,d=a.components.length;c<d;++c)
				b.push(this.extract.point.apply(this,[a.components[c]]));
			return b.join(",")
		},
		linestring: function(a) {
			for(var b=[],c=0,d=a.components.length;c<
			d;++c)
				b.push(this.extract.point.apply(this,[a.components[c]]));
			return b.join(",")
		},
		multilinestring: function(a) {
			for(var b=[],c=0,d=a.components.length;c<d;++c)
				b.push("("+this.extract.linestring.apply(this,[a.components[c]])+")");
			return b.join(",")
		},
		polygon: function(a) {
			for(var b=[],c=0,d=a.components.length;c<d;++c)
				b.push("("+this.extract.linestring.apply(this,[a.components[c]])+")");
			return b.join(",")
		},
		multipolygon: function(a) {
			for(var b=[],c=0,d=a.components.length;c<d;++c)
				b.push("("+this.extract.polygon.apply(this,
				[a.components[c]])+")");
			return b.join(",")
		}
	},
	parse: {
		point: function(a) {
			a=OpenLayers.String.trim(a).split(this.regExes.spaces);
			return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a[0],a[1]))
		},
		multipoint: function(a) {
			a=OpenLayers.String.trim(a).split(",");
			for(var b=[],c=0,d=a.length;c<d;++c)
				b.push(this.parse.point.apply(this,[a[c]]).geometry);
			return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(b))
		},
		linestring: function(a) {
			a=OpenLayers.String.trim(a).split(",");
			for(var b=
			[],c=0,d=a.length;c<d;++c)
				b.push(this.parse.point.apply(this,[a[c]]).geometry);
			return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(b))
		},
		multilinestring: function(a) {
			for(var b=OpenLayers.String.trim(a).split(this.regExes.parenComma),c=[],d=0,e=b.length;d<e;++d) {
				a=b[d].replace(this.regExes.trimParens,"$1");
				c.push(this.parse.linestring.apply(this,[a]).geometry)
			}
			return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(c))
		},
		polygon: function(a) {
			var b;
			a=OpenLayers.String.trim(a).split(this.regExes.parenComma);
			for(var c=[],d=0,e=a.length;d<e;++d) {
				b=a[d].replace(this.regExes.trimParens,"$1");
				b=this.parse.linestring.apply(this,[b]).geometry;
				b=new OpenLayers.Geometry.LinearRing(b.components);
				c.push(b)
			}
			return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(c))
		},
		multipolygon: function(a) {
			for(var b=OpenLayers.String.trim(a).split(this.regExes.doubleParenComma),c=[],d=0,e=b.length;d<e;++d) {
				a=b[d].replace(this.regExes.trimParens,"$1");
				c.push(this.parse.polygon.apply(this,[a]).geometry)
			}
			return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(c))
		},
		geometrycollection: function(a) {
			a=a.replace(/,\s*([A-Za-z])/g,"|$1");
			a=OpenLayers.String.trim(a).split("|");
			for(var b=[],c=0,d=a.length;c<d;++c)
				b.push(OpenLayers.Format.WKT.prototype.read.apply(this,[a[c]]));
			return b
		}
	},
	CLASS_NAME:"OpenLayers.Format.WKT"
});
OpenLayers.Layer.Google=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels, {
	MIN_ZOOM_LEVEL:0,
	MAX_ZOOM_LEVEL:19,
	RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,6.866455078125E-4,3.4332275390625E-4,1.71661376953125E-4,8.58306884765625E-5,4.291534423828125E-5,2.145767211914062E-5,1.072883605957031E-5,5.36441802978515E-6,2.68220901489257E-6],
	type:null,
	sphericalMercator:false,
	dragObject:null,
	termsOfUse:null,
	poweredBy:null,
	initialize: function() {
		OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);
		OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);
		this.addContainerPxFunction();
		if(this.sphericalMercator) {
			OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);
			this.initMercatorParameters()
		}
	},
	loadMapObject: function() {
		try {
			this.mapObject=new GMap2(this.div);
			if(typeof this.mapObject.getDragObject=="function")
				this.dragObject=this.mapObject.getDragObject();
			else
				this.dragPanMapObject=null;
			this.termsOfUse=this.div.lastChild;
			this.div.removeChild(this.termsOfUse);this.isFixed?this.map.viewPortDiv.appendChild(this.termsOfUse):this.map.layerContainerDiv.appendChild(this.termsOfUse);
			this.termsOfUse.style.zIndex="1100";
			this.termsOfUse.style.display=this.div.style.display;
			this.termsOfUse.style.right="";
			this.termsOfUse.style.bottom="";
			this.termsOfUse.className="olLayerGoogleCopyright";
			this.poweredBy=this.div.lastChild;
			this.div.removeChild(this.poweredBy);this.isFixed?
			this.map.viewPortDiv.appendChild(this.poweredBy):this.map.layerContainerDiv.appendChild(this.poweredBy);
			this.poweredBy.style.zIndex="1100";
			this.poweredBy.style.display=this.div.style.display;
			this.poweredBy.style.right="";
			this.poweredBy.style.bottom="";
			this.poweredBy.className="olLayerGooglePoweredBy gmnoprint"
		} catch(a) {
			OpenLayers.Console.error(a)
		}
	},
	setMap: function() {
		OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);
		this.type!=null&&this.map.events.register("moveend",this,this.setMapType)
	},
	setMapType: function() {
		if(this.mapObject.getCenter()!=null) {
			OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)==-1&&this.mapObject.addMapType(this.type);
			this.mapObject.setMapType(this.type);
			this.map.events.unregister("moveend",this,this.setMapType)
		}
	},
	onMapResize: function() {
		if(this.visibility&&this.mapObject.isLoaded())
			this.mapObject.checkResize();
		else {
			if(!this._resized)
				var a=this,b=GEvent.addListener(this.mapObject,"load", function() {
					GEvent.removeListener(b);
					delete a._resized;
					a.mapObject.checkResize();
					a.moveTo(a.map.getCenter(),a.map.getZoom())
				});
			this._resized=true
		}
	},
	display: function() {
		OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments);
		this.termsOfUse.style.display=this.div.style.display;
		this.poweredBy.style.display=this.div.style.display
	},
	removeMap: function() {
		if(this.termsOfUse&&this.termsOfUse.parentNode) {
			this.termsOfUse.parentNode.removeChild(this.termsOfUse);
			this.termsOfUse=null
		}
		if(this.poweredBy&&this.poweredBy.parentNode) {
			this.poweredBy.parentNode.removeChild(this.poweredBy);
			this.poweredBy=null
		}
		OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments)
	},
	getOLBoundsFromMapObjectBounds: function(a) {
		var b=null;
		if(a!=null) {
			b=a.getSouthWest();
			a=a.getNorthEast();
			if(this.sphericalMercator) {
				b=this.forwardMercator(b.lng(),b.lat());
				a=this.forwardMercator(a.lng(),a.lat())
			} else {
				b=new OpenLayers.LonLat(b.lng(),b.lat());
				a=new OpenLayers.LonLat(a.lng(),a.lat())
			}
			b=new OpenLayers.Bounds(b.lon,b.lat,a.lon,a.lat)
		}
		return b
	},
	getMapObjectBoundsFromOLBounds: function(a) {
		var b=null;
		if(a!=null) {
			b=this.sphericalMercator?this.inverseMercator(a.bottom,a.left):new OpenLayers.LonLat(a.bottom,a.left);
			a=this.sphericalMercator?this.inverseMercator(a.top,a.right):new OpenLayers.LonLat(a.top,a.right);
			b=new GLatLngBounds(new GLatLng(b.lat,b.lon),new GLatLng(a.lat,a.lon))
		}
		return b
	},
	addContainerPxFunction: function() {
		if(typeof GMap2!="undefined"&&!GMap2.prototype.fromLatLngToContainerPixel)
			GMap2.prototype.fromLatLngToContainerPixel= function(a) {
				a=this.fromLatLngToDivPixel(a);
				var b=this.getContainer().firstChild.firstChild;
				a.x+=b.offsetLeft;
				a.y+=b.offsetTop;
				return a
			}
	},
	getWarningHTML: function() {
		return OpenLayers.i18n("googleWarning")
	},
	setMapObjectCenter: function(a,b) {
		this.mapObject.setCenter(a,b)
	},
	dragPanMapObject: function(a,b) {
		this.dragObject.moveBy(new GSize(-a,b))
	},
	getMapObjectCenter: function() {
		return this.mapObject.getCenter()
	},
	getMapObjectZoom: function() {
		return this.mapObject.getZoom()
	},
	getMapObjectLonLatFromMapObjectPixel: function(a) {
		return this.mapObject.fromContainerPixelToLatLng(a)
	},
	getMapObjectPixelFromMapObjectLonLat: function(a) {
		return this.mapObject.fromLatLngToContainerPixel(a)
	},
	getMapObjectZoomFromMapObjectBounds: function(a) {
		return this.mapObject.getBoundsZoomLevel(a)
	},
	getLongitudeFromMapObjectLonLat: function(a) {
		return this.sphericalMercator?this.forwardMercator(a.lng(),a.lat()).lon:a.lng()
	},
	getLatitudeFromMapObjectLonLat: function(a) {
		return a=this.sphericalMercator?this.forwardMercator(a.lng(),a.lat()).lat:a.lat()
	},
	getMapObjectLonLatFromLonLat: function(a,b) {
		if(this.sphericalMercator) {
			a=this.inverseMercator(a,b);
			a=new GLatLng(a.lat,a.lon)
		} else
			a=new GLatLng(b,a);
		return a
	},
	getXFromMapObjectPixel: function(a) {
		return a.x
	},
	getYFromMapObjectPixel: function(a) {
		return a.y
	},
	getMapObjectPixelFromXY: function(a,b) {
		return new GPoint(a,b)
	},
	CLASS_NAME:"OpenLayers.Layer.Google"
});
OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
	tileSize:null,
	grid:null,
	singleTile:false,
	ratio:1.5,
	buffer:2,
	numLoadingTiles:0,
	initialize: function() {
		OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);
		this.events.addEventType("tileloaded");
		this.grid=[]
	},
	destroy: function() {
		this.clearGrid();
		this.tileSize=this.grid=null;
		OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)
	},
	clearGrid: function() {
		if(this.grid) {
			for(var a=0,b=this.grid.length;a<b;a++)
				for(var c=
				this.grid[a],d=0,e=c.length;d<e;d++) {
					var f=c[d];
					this.removeTileMonitoringHooks(f);
					f.destroy()
				}
			this.grid=[]
		}
	},
	clone: function(a) {
		if(a==null)
			a=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.options);
		a=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[a]);
		if(this.tileSize!=null)
			a.tileSize=this.tileSize.clone();
		a.grid=[];
		return a
	},
	moveTo: function(a,b,c) {
		OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);
		a=a||this.map.getExtent();
		if(a!=null) {
			var d=!this.grid.length||
			b,e=this.getTilesBounds();
			if(this.singleTile) {
				if(d||!c&&!e.containsBounds(a))
					this.initSingleTile(a)
			} else d||!e.containsBounds(a,true)?this.initGriddedTiles(a):this.moveGriddedTiles(a)
		}
	},
	setTileSize: function(a) {
		if(this.singleTile) {
			a=this.map.getSize().clone();
			a.h=parseInt(a.h*this.ratio);
			a.w=parseInt(a.w*this.ratio)
		}
		OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[a])
	},
	getGridBounds: function() {
		var a="The getGridBounds() function is deprecated. It will be removed in 3.0. Please use getTilesBounds() instead.";
		OpenLayers.Console.warn(a);
		return this.getTilesBounds()
	},
	getTilesBounds: function() {
		var a=null;
		if(this.grid.length) {
			a=this.grid.length-1;
			a=this.grid[a][0];
			var b=this.grid[0].length-1;
			b=this.grid[0][b];
			a=new OpenLayers.Bounds(a.bounds.left,a.bounds.bottom,b.bounds.right,b.bounds.top)
		}
		return a
	},
	initSingleTile: function(a) {
		var b=a.getCenterLonLat(),c=a.getWidth()*this.ratio;
		a=a.getHeight()*this.ratio;
		b=new OpenLayers.Bounds(b.lon-c/2,b.lat-a/2,b.lon+c/2,b.lat+a/2);
		c=new OpenLayers.LonLat(b.left,b.top);
		c=this.map.getLayerPxFromLonLat(c);
		this.grid.length||(this.grid[0]=[]);
		if(a=this.grid[0][0])
			a.moveTo(b,c);
		else {
			a=this.addTile(b,c);
			this.addTileMonitoringHooks(a);
			a.draw();
			this.grid[0][0]=a
		}
		this.removeExcessTiles(1,1)
	},
	calculateGridLayout: function(a,b,c) {
		var d=c*this.tileSize.w;
		c=c*this.tileSize.h;
		var e=a.left-b.left,f=Math.floor(e/d)-this.buffer;
		e=e/d-f;
		e=-e*this.tileSize.w;
		f=b.left+f*d;
		var g=a.top-(b.bottom+c);
		a=Math.ceil(g/c)+this.buffer;
		g=a-g/c;
		g=-g*this.tileSize.h;
		b=b.bottom+a*c;
		return {
			tilelon:d,
			tilelat:c,
			tileoffsetlon:f,
			tileoffsetlat:b,
			tileoffsetx:e,
			tileoffsety:g
		}
	},
	initGriddedTiles: function(a) {
		var b=this.map.getSize(),c=Math.ceil(b.h/this.tileSize.h)+Math.max(1,2*this.buffer);
		b=Math.ceil(b.w/this.tileSize.w)+Math.max(1,2*this.buffer);
		var d=this.maxExtent,e=this.map.getResolution(),f=this.calculateGridLayout(a,d,e);
		d=Math.round(f.tileoffsetx);
		e=Math.round(f.tileoffsety);
		var g=f.tileoffsetlon,h=f.tileoffsetlat,i=f.tilelon;
		f=f.tilelat;
		this.origin=new OpenLayers.Pixel(d,e);
		var j=d,l=g,k=0,n=
		parseInt(this.map.layerContainerDiv.style.left),m=parseInt(this.map.layerContainerDiv.style.top);
		do {
			var o=this.grid[k++];
			if(!o) {
				o=[];
				this.grid.push(o)
			}
			g=l;
			d=j;
			var p=0;
			do {
				var r=new OpenLayers.Bounds(g,h,g+i,h+f),q=d;
				q-=n;
				var s=e;
				s-=m;
				q=new OpenLayers.Pixel(q,s);
				if(s=o[p++])
					s.moveTo(r,q,false);
				else {
					s=this.addTile(r,q);
					this.addTileMonitoringHooks(s);
					o.push(s)
				}
				g+=i;
				d+=this.tileSize.w
			} while(g<=a.right+i*this.buffer||p<b);
			h-=f;
			e+=this.tileSize.h
		} while(h>=a.bottom-f*this.buffer||k<c);
		this.removeExcessTiles(k,
		p);
		this.spiralTileLoad()
	},
	spiralTileLoad: function() {
		for(var a=[],b=["right","down","left","up"],c=0,d=-1,e=OpenLayers.Util.indexOf(b,"right"),f=0;f<b.length;) {
			var g=c,h=d;
			switch(b[e]) {
				case "right":
					h++;
					break;
				case "down":
					g++;
					break;
				case "left":
					h--;
					break;
				case "up":
					g--;
					break
			}
			var i=null;
			if(g<this.grid.length&&g>=0&&h<this.grid[0].length&&h>=0)
				i=this.grid[g][h];
			if(i!=null&&!i.queued) {
				a.unshift(i);
				i.queued=true;
				f=0;
				c=g;
				d=h
			} else {
				e=(e+1)%4;
				f++
			}
		}
		b=0;
		for(c=a.length;b<c;b++) {
			i=a[b];
			i.draw();
			i.queued=false
		}
	},
	addTile: function() {
	},
	addTileMonitoringHooks: function(a) {
		a.onLoadStart= function() {
			this.numLoadingTiles==0&&this.events.triggerEvent("loadstart");
			this.numLoadingTiles++
		};
		a.events.register("loadstart",this,a.onLoadStart);
		a.onLoadEnd= function() {
			this.numLoadingTiles--;
			this.events.triggerEvent("tileloaded");
			this.numLoadingTiles==0&&this.events.triggerEvent("loadend")
		};
		a.events.register("loadend",this,a.onLoadEnd);
		a.events.register("unload",this,a.onLoadEnd)
	},
	removeTileMonitoringHooks: function(a) {
		a.unload();
		a.events.un({
			loadstart:a.onLoadStart,
			loadend:a.onLoadEnd,
			unload:a.onLoadEnd,
			scope:this
		})
	},
	moveGriddedTiles: function() {
		for(var a=this.buffer||1;1;) {
			var b=this.grid[0][0].position;
			b=this.map.getViewPortPxFromLayerPx(b);
			if(b.x>-this.tileSize.w*(a-1))
				this.shiftColumn(true);
			else if(b.x<-this.tileSize.w*a)
				this.shiftColumn(false);
			else if(b.y>-this.tileSize.h*(a-1))
				this.shiftRow(true);
			else if(b.y<-this.tileSize.h*a)
				this.shiftRow(false);
			else
				break
		}
	},
	shiftRow: function(a) {
		var b=a?0:this.grid.length-1,c=this.grid;
		b=c[b];
		var d=this.map.getResolution(),
		e=a?-this.tileSize.h:this.tileSize.h;
		d=d*-e;
		for(var f=a?c.pop():c.shift(),g=0,h=b.length;g<h;g++) {
			var i=b[g],j=i.bounds.clone();
			i=i.position.clone();
			j.bottom+=d;
			j.top+=d;
			i.y+=e;
			f[g].moveTo(j,i)
		}a?c.unshift(f):c.push(f)
	},
	shiftColumn: function(a) {
		var b=a?-this.tileSize.w:this.tileSize.w,c=this.map.getResolution();
		c=c*b;
		for(var d=0,e=this.grid.length;d<e;d++) {
			var f=this.grid[d],g=a?0:f.length-1,h=f[g];
			g=h.bounds.clone();
			h=h.position.clone();
			g.left+=c;
			g.right+=c;
			h.x+=b;
			var i=a?this.grid[d].pop():this.grid[d].shift();
			i.moveTo(g,h);a?f.unshift(i):f.push(i)
		}
	},
	removeExcessTiles: function(a,b) {
		for(;this.grid.length>a;)
			for(var c=this.grid.pop(),d=0,e=c.length;d<e;d++) {
				var f=c[d];
				this.removeTileMonitoringHooks(f);
				f.destroy()
			}
		for(;this.grid[0].length>b;) {
			d=0;
			for(e=this.grid.length;d<e;d++) {
				c=this.grid[d];
				f=c.pop();
				this.removeTileMonitoringHooks(f);
				f.destroy()
			}
		}
	},
	onMapResize: function() {
		if(this.singleTile) {
			this.clearGrid();
			this.setTileSize()
		}
	},
	getTileBounds: function(a) {
		var b=this.maxExtent,c=this.getResolution(),d=c*this.tileSize.w;
		c=c*this.tileSize.h;
		var e=this.getLonLatFromViewPortPx(a);
		a=b.left+d*Math.floor((e.lon-b.left)/d);
		b=b.bottom+c*Math.floor((e.lat-b.bottom)/c);
		return new OpenLayers.Bounds(a,b,a+d,b+c)
	},
	CLASS_NAME:"OpenLayers.Layer.Grid"
});
OpenLayers.Layer.VirtualEarth=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels, {
	MIN_ZOOM_LEVEL:1,
	MAX_ZOOM_LEVEL:17,
	RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,6.866455078125E-4,3.4332275390625E-4,1.71661376953125E-4,8.58306884765625E-5,4.291534423828125E-5,2.145767211914062E-5],
	type:null,
	sphericalMercator:false,
	initialize: function() {
		OpenLayers.Layer.EventPane.prototype.initialize.apply(this,
		arguments);
		OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);
		if(this.sphericalMercator) {
			OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);
			this.initMercatorParameters()
		}
	},
	loadMapObject: function() {
		var a=OpenLayers.Util.createDiv(this.name),b=this.map.getSize();
		a.style.width=b.w+"px";
		a.style.height=b.h+"px";
		this.div.appendChild(a);
		try {
			this.mapObject=new VEMap(this.name)
		} catch(c) {
		}
		if(this.mapObject!=null) {
			try {
				this.mapObject.LoadMap(null,null,this.type,true);
				this.mapObject.AttachEvent("onmousedown", function() {
					return true
				})
			} catch(d) {
			}
			this.mapObject.HideDashboard()
		}
		if(!this.mapObject||!this.mapObject.vemapcontrol||!this.mapObject.vemapcontrol.PanMap||typeof this.mapObject.vemapcontrol.PanMap!="function")
			this.dragPanMapObject=null
	},
	getWarningHTML: function() {
		return OpenLayers.i18n("getLayerWarning", {
			layerType:"VE",
			layerLib:"VirtualEarth"
		})
	},
	setMapObjectCenter: function(a,b) {
		this.mapObject.SetCenterAndZoom(a,b)
	},
	getMapObjectCenter: function() {
		return this.mapObject.GetCenter()
	},
	dragPanMapObject: function(a,
	b) {
		this.mapObject.vemapcontrol.PanMap(a,-b)
	},
	getMapObjectZoom: function() {
		return this.mapObject.GetZoomLevel()
	},
	getMapObjectLonLatFromMapObjectPixel: function(a) {
		return typeof VEPixel!="undefined"?this.mapObject.PixelToLatLong(a):this.mapObject.PixelToLatLong(a.x,a.y)
	},
	getMapObjectPixelFromMapObjectLonLat: function(a) {
		return this.mapObject.LatLongToPixel(a)
	},
	getLongitudeFromMapObjectLonLat: function(a) {
		return this.sphericalMercator?this.forwardMercator(a.Longitude,a.Latitude).lon:a.Longitude
	},
	getLatitudeFromMapObjectLonLat: function(a) {
		return this.sphericalMercator?
		this.forwardMercator(a.Longitude,a.Latitude).lat:a.Latitude
	},
	getMapObjectLonLatFromLonLat: function(a,b) {
		if(this.sphericalMercator) {
			a=this.inverseMercator(a,b);
			a=new VELatLong(a.lat,a.lon)
		} else
			a=new VELatLong(b,a);
		return a
	},
	getXFromMapObjectPixel: function(a) {
		return a.x
	},
	getYFromMapObjectPixel: function(a) {
		return a.y
	},
	getMapObjectPixelFromXY: function(a,b) {
		return typeof VEPixel!="undefined"?new VEPixel(a,b):new Msn.VE.Pixel(a,b)
	},
	CLASS_NAME:"OpenLayers.Layer.VirtualEarth"
});
OpenLayers.Layer.Yahoo=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels, {
	MIN_ZOOM_LEVEL:0,
	MAX_ZOOM_LEVEL:17,
	RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,6.866455078125E-4,3.4332275390625E-4,1.71661376953125E-4,8.58306884765625E-5,4.291534423828125E-5,2.145767211914062E-5,1.072883605957031E-5],
	type:null,
	sphericalMercator:false,
	initialize: function() {
		OpenLayers.Layer.EventPane.prototype.initialize.apply(this,
		arguments);
		OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);
		if(this.sphericalMercator) {
			OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);
			this.initMercatorParameters()
		}
	},
	loadMapObject: function() {
		try {
			var a=this.getMapObjectSizeFromOLSize(this.map.getSize());
			this.mapObject=new YMap(this.div,this.type,a);
			this.mapObject.disableKeyControls();
			this.mapObject.disableDragMap();
			if(!this.mapObject.moveByXY||typeof this.mapObject.moveByXY!="function")
				this.dragPanMapObject=
				null
		} catch(b) {
		}
	},
	onMapResize: function() {
		try {
			var a=this.getMapObjectSizeFromOLSize(this.map.getSize());
			this.mapObject.resizeTo(a)
		} catch(b) {
		}
	},
	setMap: function() {
		OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);
		this.map.events.register("moveend",this,this.fixYahooEventPane)
	},
	fixYahooEventPane: function() {
		var a=OpenLayers.Util.getElement("ygddfdiv");
		if(a!=null) {
			a.parentNode!=null&&a.parentNode.removeChild(a);
			this.map.events.unregister("moveend",this,this.fixYahooEventPane)
		}
	},
	getWarningHTML: function() {
		return OpenLayers.i18n("getLayerWarning", {
			layerType:"Yahoo",
			layerLib:"Yahoo"
		})
	},
	getOLZoomFromMapObjectZoom: function(a) {
		var b=null;
		if(a!=null) {
			b=OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this,[a]);
			b=18-b
		}
		return b
	},
	getMapObjectZoomFromOLZoom: function(a) {
		var b=null;
		if(a!=null) {
			b=OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this,[a]);
			b=18-b
		}
		return b
	},
	setMapObjectCenter: function(a,b) {
		this.mapObject.drawZoomAndCenter(a,b)
	},
	getMapObjectCenter: function() {
		return this.mapObject.getCenterLatLon()
	},
	dragPanMapObject: function(a,b) {
		this.mapObject.moveByXY({
			x:-a,
			y:b
		})
	},
	getMapObjectZoom: function() {
		return this.mapObject.getZoomLevel()
	},
	getMapObjectLonLatFromMapObjectPixel: function(a) {
		return this.mapObject.convertXYLatLon(a)
	},
	getMapObjectPixelFromMapObjectLonLat: function(a) {
		return this.mapObject.convertLatLonXY(a)
	},
	getLongitudeFromMapObjectLonLat: function(a) {
		return this.sphericalMercator?this.forwardMercator(a.Lon,a.Lat).lon:a.Lon
	},
	getLatitudeFromMapObjectLonLat: function(a) {
		return this.sphericalMercator?
		this.forwardMercator(a.Lon,a.Lat).lat:a.Lat
	},
	getMapObjectLonLatFromLonLat: function(a,b) {
		if(this.sphericalMercator) {
			a=this.inverseMercator(a,b);
			a=new YGeoPoint(a.lat,a.lon)
		} else
			a=new YGeoPoint(b,a);
		return a
	},
	getXFromMapObjectPixel: function(a) {
		return a.x
	},
	getYFromMapObjectPixel: function(a) {
		return a.y
	},
	getMapObjectPixelFromXY: function(a,b) {
		return new YCoordPoint(a,b)
	},
	getMapObjectSizeFromOLSize: function(a) {
		return new YSize(a.w,a.h)
	},
	CLASS_NAME:"OpenLayers.Layer.Yahoo"
});
OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol, {
	url:null,
	headers:null,
	params:null,
	callback:null,
	scope:null,
	readWithPOST:false,
	initialize: function() {
		this.params= {};
		this.headers= {};
		OpenLayers.Protocol.prototype.initialize.apply(this,arguments)
	},
	destroy: function() {
		this.headers=this.params=null;
		OpenLayers.Protocol.prototype.destroy.apply(this)
	},
	createCallback: function(a,b,c) {
		return OpenLayers.Function.bind( function() {
			a.apply(this,[b,c])
		},this)
	},
	read: function(a) {
		a=OpenLayers.Util.applyDefaults(a,
		this.options);
		var b=a.readWithPOST!==undefined?a.readWithPOST:this.readWithPOST,c=new OpenLayers.Protocol.Response({
			requestType:"read"
		});
		if(a.filter&&a.filter instanceof OpenLayers.Filter.Spatial)
			if(a.filter.type==OpenLayers.Filter.Spatial.BBOX)
				a.params=OpenLayers.Util.extend(a.params, {
					bbox:a.filter.value.toArray()
				});
		c.priv=b?OpenLayers.Request.POST({
			url:a.url,
			callback:this.createCallback(this.handleRead,c,a),
			data:OpenLayers.Util.getParameterString(a.params),
			headers: {
				"Content-Type":"application/x-www-form-urlencoded"
			}
		}):
		OpenLayers.Request.GET({
			url:a.url,
			callback:this.createCallback(this.handleRead,c,a),
			params:a.params,
			headers:a.headers
		});
		return c
	},
	handleRead: function(a,b) {
		this.handleResponse(a,b)
	},
	create: function(a,b) {
		b=OpenLayers.Util.applyDefaults(b,this.options);
		var c=new OpenLayers.Protocol.Response({
			reqFeatures:a,
			requestType:"create"
		});
		c.priv=OpenLayers.Request.POST({
			url:b.url,
			callback:this.createCallback(this.handleCreate,c,b),
			headers:b.headers,
			data:this.format.write(a)
		});
		return c
	},
	handleCreate: function(a,
	b) {
		this.handleResponse(a,b)
	},
	update: function(a,b) {
		var c=b.url||a.url||this.options.url;
		b=OpenLayers.Util.applyDefaults(b,this.options);
		var d=new OpenLayers.Protocol.Response({
			reqFeatures:a,
			requestType:"update"
		});
		d.priv=OpenLayers.Request.PUT({
			url:c,
			callback:this.createCallback(this.handleUpdate,d,b),
			headers:b.headers,
			data:this.format.write(a)
		});
		return d
	},
	handleUpdate: function(a,b) {
		this.handleResponse(a,b)
	},
	"delete": function(a,b) {
		var c=b.url||a.url||this.options.url;
		b=OpenLayers.Util.applyDefaults(b,
		this.options);
		a=new OpenLayers.Protocol.Response({
			reqFeatures:a,
			requestType:"delete"
		});
		a.priv=OpenLayers.Request.DELETE({
			url:c,
			callback:this.createCallback(this.handleDelete,a,b),
			headers:b.headers
		});
		return a
	},
	handleDelete: function(a,b) {
		this.handleResponse(a,b)
	},
	handleResponse: function(a,b) {
		var c=a.priv;
		if(b.callback) {
			if(c.status>=200&&c.status<300) {
				if(a.requestType!="delete")
					a.features=this.parseFeatures(c);
				a.code=OpenLayers.Protocol.Response.SUCCESS
			} else
				a.code=OpenLayers.Protocol.Response.FAILURE;
			b.callback.call(b.scope,a)
		}
	},
	parseFeatures: function(a) {
		var b=a.responseXML;
		if(!b||!b.documentElement)
			b=a.responseText;
		if(!b||b.length<=0)
			return null;
		return this.format.read(b)
	},
	commit: function(a,b) {
		b=OpenLayers.Util.applyDefaults(b,this.options);
		var c=[],d=0,e= {};
		e[OpenLayers.State.INSERT]=[];
		e[OpenLayers.State.UPDATE]=[];
		e[OpenLayers.State.DELETE]=[];
		for(var f,g,h=[],i=0,j=a.length;i<j;++i) {
			f=a[i];
			if(g=e[f.state]) {
				g.push(f);
				h.push(f)
			}
		}
		var l=(e[OpenLayers.State.INSERT].length>0?1:0)+e[OpenLayers.State.UPDATE].length+
		e[OpenLayers.State.DELETE].length,k=true,n=new OpenLayers.Protocol.Response({
			reqFeatures:h
		});
		function m(p) {
			for(var r=p.features?p.features.length:0,q=new Array(r),s=0;s<r;++s)
				q[s]=p.features[s].fid;
			n.insertIds=q;
			o.apply(this,[p])
		}

		function o(p) {
			this.callUserCallback(p,b);
			k=k&&p.success();
			d++;
			if(d>=l)
				if(b.callback) {
					n.code=k?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;
					b.callback.apply(b.scope,[n])
				}
		}

		a=e[OpenLayers.State.INSERT];
		a.length>0&&c.push(this.create(a,OpenLayers.Util.applyDefaults({
			callback:m,
			scope:this
		},b.create)));
		a=e[OpenLayers.State.UPDATE];
		for(i=a.length-1;i>=0;--i)
			c.push(this.update(a[i],OpenLayers.Util.applyDefaults({
				callback:o,
				scope:this
			},b.update)));
		a=e[OpenLayers.State.DELETE];
		for(i=a.length-1;i>=0;--i)
			c.push(this["delete"](a[i],OpenLayers.Util.applyDefaults({
				callback:o,
				scope:this
			},b["delete"])));
		return c
	},
	abort: function(a) {
		a&&a.priv.abort()
	},
	callUserCallback: function(a,b) {
		(b=b[a.requestType])&&b.callback&&b.callback.call(b.scope,a)
	},
	CLASS_NAME:"OpenLayers.Protocol.HTTP"
});
OpenLayers.Style=OpenLayers.Class({
	name:null,
	title:null,
	description:null,
	layerName:null,
	isDefault:false,
	rules:null,
	context:null,
	defaultStyle:null,
	defaultsPerSymbolizer:false,
	propertyStyles:null,
	initialize: function(a,b) {
		OpenLayers.Util.extend(this,b);
		this.rules=[];
		b&&b.rules&&this.addRules(b.rules);
		this.setDefaultStyle(a||OpenLayers.Feature.Vector.style["default"])
	},
	destroy: function() {
		for(var a=0,b=this.rules.length;a<b;a++) {
			this.rules[a].destroy();
			this.rules[a]=null
		}
		this.defaultStyle=this.rules=null
	},
	createSymbolizer: function(a) {
		for(var b=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),a),c=this.rules,d,e=[],f=false,g=0,h=c.length;g<h;g++) {
			d=c[g];
			var i=d.evaluate(a);
			if(i)
				if(d instanceof OpenLayers.Rule&&d.elseFilter)
					e.push(d);
				else {
					f=true;
					this.applySymbolizer(d,b,a)
				}
		}
		if(f==false&&e.length>0) {
			f=true;
			g=0;
			for(h=e.length;g<h;g++)
				this.applySymbolizer(e[g],b,a)
		}
		if(c.length>0&&f==false)
			b.display="none";
		return b
	},
	applySymbolizer: function(a,b,c) {
		var d=c.geometry?
		this.getSymbolizerPrefix(c.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];
		a=a.symbolizer[d]||a.symbolizer;
		if(this.defaultsPerSymbolizer===true) {
			d=this.defaultStyle;
			OpenLayers.Util.applyDefaults(a, {
				pointRadius:d.pointRadius
			});
			if(a.stroke===true||a.graphic===true)
				OpenLayers.Util.applyDefaults(a, {
					strokeWidth:d.strokeWidth,
					strokeColor:d.strokeColor,
					strokeOpacity:d.strokeOpacity,
					strokeDashstyle:d.strokeDashstyle,
					strokeLinecap:d.strokeLinecap
				});
			if(a.fill===true||a.graphic===true)
				OpenLayers.Util.applyDefaults(a, {
					fillColor:d.fillColor,
					fillOpacity:d.fillOpacity
				});
			a.graphic===true&&OpenLayers.Util.applyDefaults(a, {
				pointRadius:this.defaultStyle.pointRadius,
				externalGraphic:this.defaultStyle.externalGraphic,
				graphicName:this.defaultStyle.graphicName,
				graphicOpacity:this.defaultStyle.graphicOpacity,
				graphicWidth:this.defaultStyle.graphicWidth,
				graphicHeight:this.defaultStyle.graphicHeight,
				graphicXOffset:this.defaultStyle.graphicXOffset,
				graphicYOffset:this.defaultStyle.graphicYOffset
			})
		}
		return this.createLiterals(OpenLayers.Util.extend(b,
		a),c)
	},
	createLiterals: function(a,b) {
		var c=this.context||b.attributes||b.data;
		for(var d in this.propertyStyles)
			a[d]=OpenLayers.Style.createLiteral(a[d],c,b);
		return a
	},
	findPropertyStyles: function() {
		var a= {},b=this.defaultStyle;
		this.addPropertyStyles(a,b);
		b=this.rules;
		for(var c,d,e=0,f=b.length;e<f;e++) {
			c=b[e].symbolizer;
			for(var g in c) {
				d=c[g];
				if(typeof d=="object")
					this.addPropertyStyles(a,d);
				else {
					this.addPropertyStyles(a,c);
					break
				}
			}
		}
		return a
	},
	addPropertyStyles: function(a,b) {
		var c;
		for(var d in b) {
			c=b[d];
			if(typeof c=="string"&&c.match(/\$\{\w+\}/))
				a[d]=true
		}
		return a
	},
	addRules: function(a) {
		this.rules=this.rules.concat(a);
		this.propertyStyles=this.findPropertyStyles()
	},
	setDefaultStyle: function(a) {
		this.defaultStyle=a;
		this.propertyStyles=this.findPropertyStyles()
	},
	getSymbolizerPrefix: function(a) {
		for(var b=OpenLayers.Style.SYMBOLIZER_PREFIXES,c=0,d=b.length;c<d;c++)
			if(a.CLASS_NAME.indexOf(b[c])!=-1)
				return b[c]
	},
	CLASS_NAME:"OpenLayers.Style"
});
OpenLayers.Style.createLiteral= function(a,b,c) {
	if(typeof a=="string"&&a.indexOf("${")!=-1) {
		a=OpenLayers.String.format(a,b,[c]);
		a=isNaN(a)||!a?a:parseFloat(a)
	}
	return a
};
OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text"];
OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control, {
	dragPan:null,
	dragPanOptions:null,
	zoomBox:null,
	zoomWheelEnabled:true,
	handleRightClicks:false,
	zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,
	initialize: function() {
		this.handlers= {};
		OpenLayers.Control.prototype.initialize.apply(this,arguments)
	},
	destroy: function() {
		this.deactivate();
		this.dragPan&&this.dragPan.destroy();
		this.dragPan=null;
		this.zoomBox&&this.zoomBox.destroy();
		this.zoomBox=null;
		OpenLayers.Control.prototype.destroy.apply(this,arguments)
	},
	activate: function() {
		this.dragPan.activate();
		this.zoomWheelEnabled&&this.handlers.wheel.activate();
		this.handlers.click.activate();
		this.zoomBox.activate();
		return OpenLayers.Control.prototype.activate.apply(this,arguments)
	},
	deactivate: function() {
		this.zoomBox.deactivate();
		this.dragPan.deactivate();
		this.handlers.click.deactivate();
		this.handlers.wheel.deactivate();
		return OpenLayers.Control.prototype.deactivate.apply(this,arguments)
	},
	draw: function() {
		if(this.handleRightClicks)
			this.map.viewPortDiv.oncontextmenu= function() {
				return false
			};
		var a= {
			dblclick:this.defaultDblClick,
			dblrightclick:this.defaultDblRightClick
		},b= {
			"double":true,
			stopDouble:true
		};
		this.handlers.click=new OpenLayers.Handler.Click(this,a,b);
		this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({
			map:this.map
		},this.dragPanOptions));
		this.zoomBox=new OpenLayers.Control.ZoomBox({
			map:this.map,
			keyMask:this.zoomBoxKeyMask
		});
		this.dragPan.draw();
		this.zoomBox.draw();
		this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this, {
			up:this.wheelUp,
			down:this.wheelDown
		});
		this.activate()
	},
	defaultDblClick: function(a) {
		a=this.map.getLonLatFromViewPortPx(a.xy);
		this.map.setCenter(a,this.map.zoom+1)
	},
	defaultDblRightClick: function(a) {
		a=this.map.getLonLatFromViewPortPx(a.xy);
		this.map.setCenter(a,this.map.zoom-1)
	},
	wheelChange: function(a,b) {
		b=this.map.getZoom()+b;
		if(this.map.isValidZoomLevel(b)) {
			var c=this.map.getSize(),d=c.w/2-a.xy.x;
			c=a.xy.y-c.h/2;
			var e=this.map.baseLayer.getResolutionForZoom(b);
			a=this.map.getLonLatFromPixel(a.xy);
			a=new OpenLayers.LonLat(a.lon+
			d*e,a.lat+c*e);
			this.map.setCenter(a,b)
		}
	},
	wheelUp: function(a) {
		this.wheelChange(a,1)
	},
	wheelDown: function(a) {
		this.wheelChange(a,-1)
	},
	disableZoomWheel: function() {
		this.zoomWheelEnabled=false;
		this.handlers.wheel.deactivate()
	},
	enableZoomWheel: function() {
		this.zoomWheelEnabled=true;
		this.active&&this.handlers.wheel.activate()
	},
	CLASS_NAME:"OpenLayers.Control.Navigation"
});
OpenLayers.Filter=OpenLayers.Class({
	initialize: function(a) {
		OpenLayers.Util.extend(this,a)
	},
	destroy: function() {
	},
	evaluate: function() {
		return true
	},
	clone: function() {
		return null
	},
	CLASS_NAME:"OpenLayers.Filter"
});
OpenLayers.Geometry=OpenLayers.Class({
	id:null,
	parent:null,
	bounds:null,
	initialize: function() {
		this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")
	},
	destroy: function() {
		this.bounds=this.id=null
	},
	clone: function() {
		return new OpenLayers.Geometry
	},
	setBounds: function(a) {
		if(a)
			this.bounds=a.clone()
	},
	clearBounds: function() {
		this.bounds=null;
		this.parent&&this.parent.clearBounds()
	},
	extendBounds: function(a) {
		var b=this.getBounds();b?this.bounds.extend(a):this.setBounds(a)
	},
	getBounds: function() {
		this.bounds==
		null&&this.calculateBounds();
		return this.bounds
	},
	calculateBounds: function() {
	},
	distanceTo: function() {
	},
	getVertices: function() {
	},
	atPoint: function(a,b,c) {
		var d=false,e=this.getBounds();
		if(e!=null&&a!=null) {
			b=b!=null?b:0;
			c=c!=null?c:0;
			c=new OpenLayers.Bounds(this.bounds.left-b,this.bounds.bottom-c,this.bounds.right+b,this.bounds.top+c);
			d=c.containsLonLat(a)
		}
		return d
	},
	getLength: function() {
		return 0
	},
	getArea: function() {
		return 0
	},
	getCentroid: function() {
		return null
	},
	toString: function() {
		return OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this))
	},
	CLASS_NAME:"OpenLayers.Geometry"
});
OpenLayers.Geometry.fromWKT= function(a) {
	var b=arguments.callee.format;
	if(!b) {
		b=new OpenLayers.Format.WKT;
		arguments.callee.format=b
	}
	var c;
	b=b.read(a);
	if(b instanceof OpenLayers.Feature.Vector)
		c=b.geometry;
	else if(b instanceof Array) {
		c=b.length;
		for(var d=new Array(c),e=0;e<c;++e)
			d[e]=b[e].geometry;
		c=new OpenLayers.Geometry.Collection(d)
	}
	return c
};
OpenLayers.Geometry.segmentsIntersect= function(a,b,c) {
	var d=c&&c.point;
	c=c&&c.tolerance;
	var e=false,f=a.x1-b.x1,g=a.y1-b.y1,h=a.x2-a.x1,i=a.y2-a.y1,j=b.y2-b.y1,l=b.x2-b.x1,k=j*h-l*i;
	j=l*g-j*f;
	g=h*g-i*f;
	if(k==0) {
		if(j==0&&g==0)
			e=true
	} else {
		f=j/k;
		k=g/k;
		if(f>=0&&f<=1&&k>=0&&k<=1)
			if(d) {
				h=a.x1+f*h;
				k=a.y1+f*i;
				e=new OpenLayers.Geometry.Point(h,k)
			} else
				e=true
	}
	if(c)
		if(e) {
			if(d) {
				a=[a,b];
				b=0;a:
				for(;b<2;++b) {
					f=a[b];
					for(i=1;i<3;++i) {
						h=f["x"+i];
						k=f["y"+i];
						d=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(k-e.y,2));
						if(d<c) {
							e.x=
							h;
							e.y=k;
							break a
						}
					}
				}
			}
		} else {
			a=[a,b];
			b=0;a:
			for(;b<2;++b) {
				h=a[b];
				k=a[(b+1)%2];
				for(i=1;i<3;++i) {
					f= {
						x:h["x"+i],
						y:h["y"+i]
					};
					g=OpenLayers.Geometry.distanceToSegment(f,k);
					if(g.distance<c) {
						e=d?new OpenLayers.Geometry.Point(f.x,f.y):true;
						break a
					}
				}
			}
		}
	return e
};
OpenLayers.Geometry.distanceToSegment= function(a,b) {
	var c=a.x;
	a=a.y;
	var d=b.x1,e=b.y1,f=b.x2;
	b=b.y2;
	var g=f-d,h=b-e,i=(g*(c-d)+h*(a-e))/(Math.pow(g,2)+Math.pow(h,2));
	if(i<=0) {
		d=d;
		e=e
	} else if(i>=1) {
		d=f;
		e=b
	} else {
		d=d+i*g;
		e=e+i*h
	}
	return {
		distance:Math.sqrt(Math.pow(d-c,2)+Math.pow(e-a,2)),
		x:d,
		y:e
	}
};
OpenLayers.Layer.TMS=OpenLayers.Class(OpenLayers.Layer.Grid, {
	serviceVersion:"1.0.0",
	isBaseLayer:true,
	tileOrigin:null,
	serverResolutions:null,
	initialize: function(a,b,c) {
		var d=[];
		d.push(a,b, {},c);
		OpenLayers.Layer.Grid.prototype.initialize.apply(this,d)
	},
	destroy: function() {
		OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)
	},
	clone: function(a) {
		if(a==null)
			a=new OpenLayers.Layer.TMS(this.name,this.url,this.options);
		return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a])
	},
	getURL: function(a) {
		a=
		this.adjustBounds(a);
		var b=this.map.getResolution(),c=Math.round((a.left-this.tileOrigin.lon)/(b*this.tileSize.w));
		a=Math.round((a.bottom-this.tileOrigin.lat)/(b*this.tileSize.h));
		b=this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,b):this.map.getZoom();
		c=this.serviceVersion+"/"+this.layername+"/"+b+"/"+c+"/"+a+"."+this.type;
		b=this.url;
		if(b instanceof Array)
			b=this.selectUrl(c,b);
		return b+c
	},
	addTile: function(a,b) {
		return new OpenLayers.Tile.Image(this,b,a,null,this.tileSize)
	},
	setMap: function() {
		OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);
		if(!this.tileOrigin)
			this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom)
	},
	CLASS_NAME:"OpenLayers.Layer.TMS"
});
OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Grid, {
	DEFAULT_PARAMS: {
		service:"WMS",
		version:"1.1.1",
		request:"GetMap",
		styles:"",
		exceptions:"application/vnd.ogc.se_inimage",
		format:"image/jpeg"
	},
	reproject:false,
	isBaseLayer:true,
	encodeBBOX:false,
	noMagic:false,
	initialize: function(a,b,c,d) {
		var e=[];
		c=OpenLayers.Util.upperCaseObject(c);
		e.push(a,b,c,d);
		OpenLayers.Layer.Grid.prototype.initialize.apply(this,e);
		OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));
		if(!this.noMagic&&this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true") {
			if(d==null||!d.isBaseLayer)
				this.isBaseLayer=false;
			if(this.params.FORMAT=="image/jpeg")
				this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png"
		}
	},
	destroy: function() {
		OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)
	},
	clone: function(a) {
		if(a==null)
			a=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.options);
		return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,
		[a])
	},
	getURL: function(a) {
		a=this.adjustBounds(a);
		var b=this.getImageSize();
		a= {
			BBOX:this.encodeBBOX?a.toBBOX():a.toArray(),
			WIDTH:b.w,
			HEIGHT:b.h
		};
		return a=this.getFullRequestString(a)
	},
	addTile: function(a,b) {
		return new OpenLayers.Tile.Image(this,b,a,null,this.tileSize)
	},
	mergeNewParams: function(a) {
		a=OpenLayers.Util.upperCaseObject(a);
		a=[a];
		return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,a)
	},
	getFullRequestString: function() {
		var a=this.map.getProjection();
		this.params.SRS=a=="none"?null:a;
		return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)
	},
	CLASS_NAME:"OpenLayers.Layer.WMS"
});
OpenLayers.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid, {
	isBaseLayer:true,
	sphericalMercator:false,
	initialize: function(a,b,c) {
		if(c&&c.sphericalMercator||this.sphericalMercator)
			c=OpenLayers.Util.extend({
				maxExtent:new OpenLayers.Bounds(-2.00375083392E7,-2.00375083392E7,2.00375083392E7,2.00375083392E7),
				maxResolution:156543.0339,
				numZoomLevels:19,
				units:"m",
				projection:"EPSG:900913"
			},c);
		b=b||this.url;
		a=a||this.name;
		a=[a,b,{},c];
		OpenLayers.Layer.Grid.prototype.initialize.apply(this,a)
	},
	clone: function(a) {
		if(a==
		null)
			a=new OpenLayers.Layer.XYZ(this.name,this.url,this.options);
		a=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[a]);
		if(this.tileSize!=null)
			a.tileSize=this.tileSize.clone();
		a.grid=[];
		return a
	},
	getURL: function(a) {
		var b=this.map.getResolution(),c=Math.round((a.left-this.maxExtent.left)/(b*this.tileSize.w));
		a=Math.round((this.maxExtent.top-a.top)/(b*this.tileSize.h));
		b=this.map.getZoom();
		Math.pow(2,b);
		var d=this.url,e=""+c+a+b;
		if(d instanceof Array)
			d=this.selectUrl(e,d);
		return c=OpenLayers.String.format(d, {
			x:c,
			y:a,
			z:b
		})
	},
	addTile: function(a,b) {
		return new OpenLayers.Tile.Image(this,b,a,null,this.tileSize)
	},
	setMap: function() {
		OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);
		if(!this.tileOrigin)
			this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.bottom)
	},
	CLASS_NAME:"OpenLayers.Layer.XYZ"
});
OpenLayers.Layer.OSM=OpenLayers.Class(OpenLayers.Layer.XYZ, {
	name:"OpenStreetMap",
	attribution:"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap</a>",
	sphericalMercator:true,
	url:"http://tile.openstreetmap.org/${z}/${x}/${y}.png",
	CLASS_NAME:"OpenLayers.Layer.OSM"
});
OpenLayers.Rule=OpenLayers.Class({
	id:null,
	name:"default",
	title:null,
	description:null,
	context:null,
	filter:null,
	elseFilter:false,
	symbolizer:null,
	minScaleDenominator:null,
	maxScaleDenominator:null,
	initialize: function(a) {
		this.symbolizer= {};
		OpenLayers.Util.extend(this,a);
		this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")
	},
	destroy: function() {
		for(var a in this.symbolizer)
			this.symbolizer[a]=null;
		this.symbolizer=null
	},
	evaluate: function(a) {
		var b=this.getContext(a),c=true;
		if(this.minScaleDenominator||
		this.maxScaleDenominator)
			var d=a.layer.map.getScale();
		if(this.minScaleDenominator)
			c=d>=OpenLayers.Style.createLiteral(this.minScaleDenominator,b);
		if(c&&this.maxScaleDenominator)
			c=d<OpenLayers.Style.createLiteral(this.maxScaleDenominator,b);
		if(c&&this.filter)
			c=this.filter.CLASS_NAME=="OpenLayers.Filter.FeatureId"?this.filter.evaluate(a):this.filter.evaluate(b);
		return c
	},
	getContext: function(a) {
		var b=this.context;
		b||(b=a.attributes||a.data);
		if(typeof this.context=="function")
			b=this.context(a);
		return b
	},
	clone: function() {
		var a=OpenLayers.Util.extend({},this);
		a.symbolizer= {};
		for(var b in this.symbolizer) {
			value=this.symbolizer[b];
			type=typeof value;
			if(type==="object")
				a.symbolizer[b]=OpenLayers.Util.extend({},value);
			else if(type==="string")
				a.symbolizer[b]=value
		}
		a.filter=this.filter&&this.filter.clone();
		a.context=this.context&&OpenLayers.Util.extend({},this.context);
		return new OpenLayers.Rule(a)
	},
	CLASS_NAME:"OpenLayers.Rule"
});
OpenLayers.StyleMap=OpenLayers.Class({
	styles:null,
	extendDefault:true,
	initialize: function(a,b) {
		this.styles= {
			"default":new OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),
			select:new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),
			temporary:new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary),
			"delete":new OpenLayers.Style(OpenLayers.Feature.Vector.style["delete"])
		};
		if(a instanceof OpenLayers.Style) {
			this.styles["default"]=a;
			this.styles.select=a;
			this.styles.temporary=a;
			this.styles["delete"]=a
		} else if(typeof a=="object")
			for(var c in a)
				if(a[c]instanceof OpenLayers.Style)
					this.styles[c]=a[c];
				else if(typeof a[c]=="object")
					this.styles[c]=new OpenLayers.Style(a[c]);
				else {
					this.styles["default"]=new OpenLayers.Style(a);
					this.styles.select=new OpenLayers.Style(a);
					this.styles.temporary=new OpenLayers.Style(a);
					this.styles["delete"]=new OpenLayers.Style(a);
					break
				}
		OpenLayers.Util.extend(this,b)
	},
	destroy: function() {
		for(var a in this.styles)
			this.styles[a].destroy();
		this.styles=null
	},
	createSymbolizer: function(a,b) {
		a||(a=new OpenLayers.Feature.Vector);
		this.styles[b]||(b="default");
		a.renderIntent=b;
		var c= {};
		if(this.extendDefault&&b!="default")
			c=this.styles["default"].createSymbolizer(a);
		return OpenLayers.Util.extend(c,this.styles[b].createSymbolizer(a))
	},
	addUniqueValueRules: function(a,b,c,d) {
		var e=[];
		for(var f in c)
			e.push(new OpenLayers.Rule({
				symbolizer:c[f],
				context:d,
				filter:new OpenLayers.Filter.Comparison({
					type:OpenLayers.Filter.Comparison.EQUAL_TO,
					property:b,
					value:f
				})
			}));
		this.styles[a].addRules(e)
	},
	CLASS_NAME:"OpenLayers.StyleMap"
});
OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter, {
	type:null,
	property:null,
	value:null,
	matchCase:true,
	lowerBoundary:null,
	upperBoundary:null,
	initialize: function(a) {
		OpenLayers.Filter.prototype.initialize.apply(this,[a])
	},
	evaluate: function(a) {
		var b=false;
		switch(this.type) {
			case OpenLayers.Filter.Comparison.EQUAL_TO:
				a=a[this.property];
				b=this.value;
				b=!this.matchCase&&typeof a=="string"&&typeof b=="string"?a.toUpperCase()==b.toUpperCase():a==b;
				break;
			case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:
				a=a[this.property];
				b=this.value;
				b=!this.matchCase&&typeof a=="string"&&typeof b=="string"?a.toUpperCase()!=b.toUpperCase():a!=b;
				break;
			case OpenLayers.Filter.Comparison.LESS_THAN:
				b=a[this.property]<this.value;
				break;
			case OpenLayers.Filter.Comparison.GREATER_THAN:
				b=a[this.property]>this.value;
				break;
			case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:
				b=a[this.property]<=this.value;
				break;
			case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:
				b=a[this.property]>=this.value;
				break;
			case OpenLayers.Filter.Comparison.BETWEEN:
				b=
				a[this.property]>=this.lowerBoundary&&a[this.property]<=this.upperBoundary;
				break;
			case OpenLayers.Filter.Comparison.LIKE:
				b=new RegExp(this.value,"gi");
				b=b.test(a[this.property]);
				break
		}
		return b
	},
	value2regex: function(a,b,c) {
		if(a==".") {
			a="'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison";
			OpenLayers.Console.error(a);
			return null
		}
		a=a?a:"*";
		b=b?b:".";
		c=c?c:"!";
		this.value=this.value.replace(new RegExp("\\"+c+"(.|$)","g"),"\\$1");
		this.value=this.value.replace(new RegExp("\\"+b,"g"),
		".");
		this.value=this.value.replace(new RegExp("\\"+a,"g"),".*");
		this.value=this.value.replace(new RegExp("\\\\.\\*","g"),"\\"+a);
		return this.value=this.value.replace(new RegExp("\\\\\\.","g"),"\\"+b)
	},
	regex2value: function() {
		var a=this.value;
		a=a.replace(/!/g,"!!");
		a=a.replace(/(\\)?\\\./g, function(b,c) {
			return c?b:"!."
		});
		a=a.replace(/(\\)?\\\*/g, function(b,c) {
			return c?b:"!*"
		});
		a=a.replace(/\\\\/g,"\\");
		return a=a.replace(/\.\*/g,"*")
	},
	clone: function() {
		return OpenLayers.Util.extend(new OpenLayers.Filter.Comparison,
		this)
	},
	CLASS_NAME:"OpenLayers.Filter.Comparison"
});
OpenLayers.Filter.Comparison.EQUAL_TO="==";
OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=";
OpenLayers.Filter.Comparison.LESS_THAN="<";
OpenLayers.Filter.Comparison.GREATER_THAN=">";
OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=";
OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=";
OpenLayers.Filter.Comparison.BETWEEN="..";
OpenLayers.Filter.Comparison.LIKE="~";
OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry, {
	components:null,
	componentTypes:null,
	initialize: function(a) {
		OpenLayers.Geometry.prototype.initialize.apply(this,arguments);
		this.components=[];
		a!=null&&this.addComponents(a)
	},
	destroy: function() {
		this.components.length=0;
		this.components=null
	},
	clone: function() {
		for(var a=eval("new "+this.CLASS_NAME+"()"),b=0,c=this.components.length;b<c;b++)
			a.addComponent(this.components[b].clone());
		OpenLayers.Util.applyDefaults(a,this);
		return a
	},
	getComponentsString: function() {
		for(var a=
		[],b=0,c=this.components.length;b<c;b++)
			a.push(this.components[b].toShortString());
		return a.join(",")
	},
	calculateBounds: function() {
		this.bounds=null;
		if(this.components&&this.components.length>0) {
			this.setBounds(this.components[0].getBounds());
			for(var a=1,b=this.components.length;a<b;a++)
				this.extendBounds(this.components[a].getBounds())
		}
	},
	addComponents: function(a) {
		a instanceof Array||(a=[a]);
		for(var b=0,c=a.length;b<c;b++)
			this.addComponent(a[b])
	},
	addComponent: function(a,b) {
		var c=false;
		if(a)
			if(this.componentTypes==
			null||OpenLayers.Util.indexOf(this.componentTypes,a.CLASS_NAME)>-1) {
				if(b!=null&&b<this.components.length) {
					c=this.components.slice(0,b);
					b=this.components.slice(b,this.components.length);
					c.push(a);
					this.components=c.concat(b)
				} else
					this.components.push(a);
				a.parent=this;
				this.clearBounds();
				c=true
			}
		return c
	},
	removeComponents: function(a) {
		a instanceof Array||(a=[a]);
		for(var b=a.length-1;b>=0;--b)
			this.removeComponent(a[b])
	},
	removeComponent: function(a) {
		OpenLayers.Util.removeItem(this.components,a);
		this.clearBounds()
	},
	getLength: function() {
		for(var a=0,b=0,c=this.components.length;b<c;b++)
			a+=this.components[b].getLength();
		return a
	},
	getArea: function() {
		for(var a=0,b=0,c=this.components.length;b<c;b++)
			a+=this.components[b].getArea();
		return a
	},
	getGeodesicArea: function(a) {
		for(var b=0,c=0,d=this.components.length;c<d;c++)
			b+=this.components[c].getGeodesicArea(a);
		return b
	},
	getCentroid: function() {
		return this.components.length&&this.components[0].getCentroid()
	},
	getGeodesicLength: function(a) {
		for(var b=0,c=0,d=this.components.length;c<
		d;c++)
			b+=this.components[c].getGeodesicLength(a);
		return b
	},
	move: function(a,b) {
		for(var c=0,d=this.components.length;c<d;c++)
			this.components[c].move(a,b)
	},
	rotate: function(a,b) {
		for(var c=0,d=this.components.length;c<d;++c)
			this.components[c].rotate(a,b)
	},
	resize: function(a,b,c) {
		for(var d=0;d<this.components.length;++d)
			this.components[d].resize(a,b,c);
		return this
	},
	distanceTo: function(a,b) {
		var c=!(b&&b.edge===false);
		c=c&&b&&b.details;
		for(var d,e,f=Number.POSITIVE_INFINITY,g=0,h=this.components.length;g<
		h;++g) {
			d=this.components[g].distanceTo(a,b);
			distance=c?d.distance:d;
			if(distance<f) {
				f=distance;
				e=d;
				if(f==0)
					break
			}
		}
		return e
	},
	equals: function(a) {
		var b=true;
		if(!a||!a.CLASS_NAME||this.CLASS_NAME!=a.CLASS_NAME)
			b=false;
		else if(!(a.components instanceof Array)||a.components.length!=this.components.length)
			b=false;
		else
			for(var c=0,d=this.components.length;c<d;++c)
				if(!this.components[c].equals(a.components[c])) {
					b=false;
					break
				}
		return b
	},
	transform: function(a,b) {
		if(a&&b) {
			for(var c=0,d=this.components.length;c<
			d;c++) {
				var e=this.components[c];
				e.transform(a,b)
			}
			this.bounds=null
		}
		return this
	},
	intersects: function(a) {
		for(var b=false,c=0,d=this.components.length;c<d;++c)
			if(b=a.intersects(this.components[c]))
				break;
		return b
	},
	getVertices: function(a) {
		for(var b=[],c=0,d=this.components.length;c<d;++c)
			Array.prototype.push.apply(b,this.components[c].getVertices(a));
		return b
	},
	CLASS_NAME:"OpenLayers.Geometry.Collection"
});
OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry, {
	x:null,
	y:null,
	initialize: function(a,b) {
		OpenLayers.Geometry.prototype.initialize.apply(this,arguments);
		this.x=parseFloat(a);
		this.y=parseFloat(b)
	},
	clone: function(a) {
		if(a==null)
			a=new OpenLayers.Geometry.Point(this.x,this.y);
		OpenLayers.Util.applyDefaults(a,this);
		return a
	},
	calculateBounds: function() {
		this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)
	},
	distanceTo: function(a,b) {
		var c=!(b&&b.edge===false);
		c=c&&b&&b.details;
		var d,e,
		f;
		if(a instanceof OpenLayers.Geometry.Point) {
			b=this.x;
			d=this.y;
			e=a.x;
			f=a.y;
			a=Math.sqrt(Math.pow(b-e,2)+Math.pow(d-f,2));
			a=!c?a: {
				x0:b,
				y0:d,
				x1:e,
				y1:f,
				distance:a
			}
		} else {
			a=a.distanceTo(this,b);
			if(c)
				a= {
					x0:a.x1,
					y0:a.y1,
					x1:a.x0,
					y1:a.y0,
					distance:a.distance
				}
		}
		return a
	},
	equals: function(a) {
		var b=false;
		if(a!=null)
			b=this.x==a.x&&this.y==a.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y);
		return b
	},
	toShortString: function() {
		return this.x+", "+this.y
	},
	move: function(a,b) {
		this.x+=a;
		this.y+=b;
		this.clearBounds()
	},
	rotate: function(a,b) {
		a*=Math.PI/180;
		var c=this.distanceTo(b);
		a=a+Math.atan2(this.y-b.y,this.x-b.x);
		this.x=b.x+c*Math.cos(a);
		this.y=b.y+c*Math.sin(a);
		this.clearBounds()
	},
	getCentroid: function() {
		return new OpenLayers.Geometry.Point(this.x,this.y)
	},
	resize: function(a,b,c) {
		c=c==undefined?1:c;
		this.x=b.x+a*c*(this.x-b.x);
		this.y=b.y+a*(this.y-b.y);
		this.clearBounds();
		return this
	},
	intersects: function(a) {
		var b=false;
		return b=a.CLASS_NAME=="OpenLayers.Geometry.Point"?this.equals(a):a.intersects(this)
	},
	transform: function(a,
	b) {
		if(a&&b) {
			OpenLayers.Projection.transform(this,a,b);
			this.bounds=null
		}
		return this
	},
	getVertices: function() {
		return[this]
	},
	CLASS_NAME:"OpenLayers.Geometry.Point"
});
OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer, {
	EVENT_TYPES:["beforefeatureadded","beforefeaturesadded","featureadded","featuresadded","beforefeatureremoved","featureremoved","featuresremoved","beforefeatureselected","featureselected","featureunselected","beforefeaturemodified","featuremodified","afterfeaturemodified","vertexmodified","sketchstarted","sketchmodified","sketchcomplete","refresh"],
	isBaseLayer:false,
	isFixed:false,
	isVector:true,
	features:null,
	selectedFeatures:null,
	unrenderedFeatures:null,
	reportError:true,
	style:null,
	styleMap:null,
	strategies:null,
	protocol:null,
	renderers:["SVG","VML","Canvas"],
	renderer:null,
	rendererOptions:null,
	geometryType:null,
	drawn:false,
	initialize: function() {
		this.EVENT_TYPES=OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat(OpenLayers.Layer.prototype.EVENT_TYPES);
		OpenLayers.Layer.prototype.initialize.apply(this,arguments);
		if(!this.renderer||!this.renderer.supported())
			this.assignRenderer();
		if(!this.renderer||!this.renderer.supported()) {
			this.renderer=null;
			this.displayError()
		}
		if(!this.styleMap)
			this.styleMap=
			new OpenLayers.StyleMap;
		this.features=[];
		this.selectedFeatures=[];
		this.unrenderedFeatures= {};
		if(this.strategies)
			for(var a=0,b=this.strategies.length;a<b;a++)
				this.strategies[a].setLayer(this)
	},
	destroy: function() {
		if(this.strategies) {
			var a,b,c;
			b=0;
			for(c=this.strategies.length;b<c;b++) {
				a=this.strategies[b];
				a.autoDestroy&&a.destroy()
			}
			this.strategies=null
		}
		if(this.protocol) {
			this.protocol.autoDestroy&&this.protocol.destroy();
			this.protocol=null
		}
		this.destroyFeatures();
		this.unrenderedFeatures=this.selectedFeatures=
		this.features=null;
		this.renderer&&this.renderer.destroy();
		this.drawn=this.geometryType=this.renderer=null;
		OpenLayers.Layer.prototype.destroy.apply(this,arguments)
	},
	refresh: function(a) {
		this.calculateInRange()&&this.visibility&&this.events.triggerEvent("refresh",a)
	},
	assignRenderer: function() {
		for(var a=0,b=this.renderers.length;a<b;a++) {
			var c=OpenLayers.Renderer[this.renderers[a]];
			if(c&&c.prototype.supported()) {
				this.renderer=new c(this.div,this.rendererOptions);
				break
			}
		}
	},
	displayError: function() {
		this.reportError&&
		OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported", {
			renderers:this.renderers.join("\n")
		}))
	},
	setMap: function() {
		OpenLayers.Layer.prototype.setMap.apply(this,arguments);
		if(this.renderer) {
			this.renderer.map=this.map;
			this.renderer.setSize(this.map.getSize())
		} else
			this.map.removeLayer(this)
	},
	afterAdd: function() {
		if(this.strategies) {
			var a,b,c;
			b=0;
			for(c=this.strategies.length;b<c;b++) {
				a=this.strategies[b];
				a.autoActivate&&a.activate()
			}
		}
	},
	removeMap: function() {
		if(this.strategies) {
			var a,b,c;
			b=0;
			for(c=this.strategies.length;b<c;b++) {
				a=this.strategies[b];
				a.autoActivate&&a.deactivate()
			}
		}
	},
	onMapResize: function() {
		OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);
		this.renderer.setSize(this.map.getSize())
	},
	moveTo: function(a,b,c) {
		OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
		var d=true;
		if(!c) {
			this.renderer.root.style.visibility="hidden";
			this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+"px";
			this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+
			"px";
			var e=this.map.getExtent();
			d=this.renderer.setExtent(e,b);
			this.renderer.root.style.visibility="visible";
			if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1)
				this.div.scrollLeft=this.div.scrollLeft;
			if(!b&&d)
				for(var f in this.unrenderedFeatures) {
					e=this.unrenderedFeatures[f];
					this.drawFeature(e)
				}
		}
		if(!this.drawn||b||!d) {
			this.drawn=true;
			f=0;
			for(d=this.features.length;f<d;f++) {
				this.renderer.locked=f!==d-1;
				e=this.features[f];
				this.drawFeature(e)
			}
		}
	},
	display: function() {
		OpenLayers.Layer.prototype.display.apply(this,
		arguments);
		var a=this.div.style.display;
		if(a!=this.renderer.root.style.display)
			this.renderer.root.style.display=a
	},
	addFeatures: function(a,b) {
		a instanceof Array||(a=[a]);
		if(b=!b||!b.silent) {
			a= {
				features:a
			};
			var c=this.events.triggerEvent("beforefeaturesadded",a);
			if(c===false)
				return;
			a=a.features
		}
		c=0;
		for(var d=a.length;c<d;c++) {
			this.renderer.locked=c!=a.length-1?true:false;
			var e=a[c];
			if(this.geometryType&&!(e.geometry instanceof this.geometryType)) {
				b=OpenLayers.i18n("componentShouldBe", {
					geomType:this.geometryType.prototype.CLASS_NAME
				});
				throw b;
			}
			this.features.push(e);
			e.layer=this;
			if(!e.style&&this.style)
				e.style=OpenLayers.Util.extend({},this.style);
			if(b) {
				if(this.events.triggerEvent("beforefeatureadded",{feature:e})===false)
					continue;
				this.preFeatureInsert(e)
			}
			this.drawFeature(e);
			if(b) {
				this.events.triggerEvent("featureadded", {
					feature:e
				});
				this.onFeatureInsert(e)
			}
		}
		b&&this.events.triggerEvent("featuresadded", {
			features:a
		})
	},
	removeFeatures: function(a,b) {
		if(!(!a||a.length===0)) {
			a instanceof Array||(a=[a]);
			if(a===this.features)
				a=a.slice();
			b=!b||!b.silent;
			for(var c=a.length-1;c>=0;c--) {
				this.renderer.locked=c!=0&&a[c-1].geometry?true:false;
				var d=a[c];
				delete this.unrenderedFeatures[d.id];
				b&&this.events.triggerEvent("beforefeatureremoved", {
					feature:d
				});
				this.features=OpenLayers.Util.removeItem(this.features,d);
				d.layer=null;
				d.geometry&&this.renderer.eraseFeatures(d);
				OpenLayers.Util.indexOf(this.selectedFeatures,d)!=-1&&OpenLayers.Util.removeItem(this.selectedFeatures,d);
				b&&this.events.triggerEvent("featureremoved", {
					feature:d
				})
			}
			b&&this.events.triggerEvent("featuresremoved", {
				features:a
			})
		}
	},
	destroyFeatures: function(a,b) {
		var c=a==undefined;
		if(c)
			a=this.features;
		if(a) {
			this.removeFeatures(a,b);
			for(b=a.length-1;b>=0;b--)
				a[b].destroy()
		}
	},
	drawFeature: function(a,b) {
		if(this.drawn) {
			if(typeof b!="object") {
				if(!b&&a.state===OpenLayers.State.DELETE)
					b="delete";
				var c=b||a.renderIntent;
				(b=a.style||this.style)||(b=this.styleMap.createSymbolizer(a,c))
			}
			if(this.renderer.drawFeature(a,b))
				delete this.unrenderedFeatures[a.id];
			else
				this.unrenderedFeatures[a.id]=a
		}
	},
	eraseFeatures: function(a) {
		this.renderer.eraseFeatures(a)
	},
	getFeatureFromEvent: function(a) {
		if(!this.renderer) {
			OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));
			return null
		}
		a=this.renderer.getFeatureIdFromEvent(a);
		return this.getFeatureById(a)
	},
	getFeatureById: function(a) {
		for(var b=null,c=0,d=this.features.length;c<d;++c)
			if(this.features[c].id==a) {
				b=this.features[c];
				break
			}
		return b
	},
	onFeatureInsert: function() {
	},
	preFeatureInsert: function() {
	},
	getDataExtent: function() {
		var a=null;
		if(this.features&&this.features.length>0) {
			a=new OpenLayers.Bounds;
			for(var b=
			0,c=this.features.length;b<c;b++)
				a.extend(this.features[b].geometry.getBounds())
		}
		return a
	},
	CLASS_NAME:"OpenLayers.Layer.Vector"
});
OpenLayers.Layer.WMS.Untiled=OpenLayers.Class(OpenLayers.Layer.WMS, {
	singleTile:true,
	initialize: function() {
		OpenLayers.Layer.WMS.prototype.initialize.apply(this,arguments);
		var a="The OpenLayers.Layer.WMS.Untiled class is deprecated and will be removed in 3.0. Instead, you should use the normal OpenLayers.Layer.WMS class, passing it the option 'singleTile' as true.";
		OpenLayers.Console.warn(a)
	},
	clone: function(a) {
		if(a==null)
			a=new OpenLayers.Layer.WMS.Untiled(this.name,this.url,this.params,this.options);
		return a=OpenLayers.Layer.WMS.prototype.clone.apply(this,[a])
	},
	CLASS_NAME:"OpenLayers.Layer.WMS.Untiled"
});
OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection, {
	componentTypes:["OpenLayers.Geometry.Point"],
	initialize: function() {
		OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)
	},
	addPoint: function(a,b) {
		this.addComponent(a,b)
	},
	removePoint: function(a) {
		this.removeComponent(a)
	},
	CLASS_NAME:"OpenLayers.Geometry.MultiPoint"
});
OpenLayers.Layer.GML=OpenLayers.Class(OpenLayers.Layer.Vector, {
	loaded:false,
	format:null,
	formatOptions:null,
	initialize: function(a,b,c) {
		var d=[];
		d.push(a,c);
		OpenLayers.Layer.Vector.prototype.initialize.apply(this,d);
		this.url=b
	},
	setVisibility: function() {
		OpenLayers.Layer.Vector.prototype.setVisibility.apply(this,arguments);
		this.visibility&&!this.loaded&&this.loadGML()
	},
	moveTo: function() {
		OpenLayers.Layer.Vector.prototype.moveTo.apply(this,arguments);
		this.visibility&&!this.loaded&&this.loadGML()
	},
	loadGML: function() {
		if(!this.loaded) {
			this.events.triggerEvent("loadstart");
			OpenLayers.Request.GET({
				url:this.url,
				success:this.requestSuccess,
				failure:this.requestFailure,
				scope:this
			});
			this.loaded=true
		}
	},
	setUrl: function(a) {
		this.url=a;
		this.destroyFeatures();
		this.loaded=false;
		this.loadGML()
	},
	requestSuccess: function(a) {
		var b=a.responseXML;
		if(!b||!b.documentElement)
			b=a.responseText;
		a= {};
		OpenLayers.Util.extend(a,this.formatOptions);
		if(this.map&&!this.projection.equals(this.map.getProjectionObject())) {
			a.externalProjection=this.projection;
			a.internalProjection=this.map.getProjectionObject()
		}
		a=
		this.format?new this.format(a):new OpenLayers.Format.GML(a);
		this.addFeatures(a.read(b));
		this.events.triggerEvent("loadend")
	},
	requestFailure: function() {
		OpenLayers.Console.userError(OpenLayers.i18n("errorLoadingGML", {
			url:this.url
		}));
		this.events.triggerEvent("loadend")
	},
	CLASS_NAME:"OpenLayers.Layer.GML"
});
OpenLayers.Layer.Vector.RootContainer=OpenLayers.Class(OpenLayers.Layer.Vector, {
	displayInLayerSwitcher:false,
	layers:null,
	initialize: function() {
		OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)
	},
	display: function() {
	},
	getFeatureFromEvent: function(a) {
		for(var b=this.layers,c,d=0;d<b.length;d++)
			if(c=b[d].getFeatureFromEvent(a))
				return c
	},
	setMap: function(a) {
		OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);
		this.collectRoots();
		a.events.register("changelayer",this,this.handleChangeLayer)
	},
	removeMap: function(a) {
		a.events.unregister("changelayer",this,this.handleChangeLayer);
		this.resetRoots();
		OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)
	},
	collectRoots: function() {
		for(var a,b=0;b<this.map.layers.length;++b) {
			a=this.map.layers[b];
			OpenLayers.Util.indexOf(this.layers,a)!=-1&&a.renderer.moveRoot(this.renderer)
		}
	},
	resetRoots: function() {
		for(var a,b=0;b<this.layers.length;++b) {
			a=this.layers[b];
			this.renderer&&a.renderer.getRenderLayerId()==this.id&&this.renderer.moveRoot(a.renderer)
		}
	},
	handleChangeLayer: function(a) {
		var b=a.layer;
		if(a.property=="order"&&OpenLayers.Util.indexOf(this.layers,b)!=-1) {
			this.resetRoots();
			this.collectRoots()
		}
	},
	CLASS_NAME:"OpenLayers.Layer.Vector.RootContainer"
});
OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control, {
	EVENT_TYPES:["beforefeaturehighlighted","featurehighlighted","featureunhighlighted"],
	multipleKey:null,
	toggleKey:null,
	multiple:false,
	clickout:true,
	toggle:false,
	hover:false,
	highlightOnly:false,
	box:false,
	onBeforeSelect: function() {
	},
	onSelect: function() {
	},
	onUnselect: function() {
	},
	scope:null,
	geometryTypes:null,
	layer:null,
	layers:null,
	callbacks:null,
	selectStyle:null,
	renderIntent:"select",
	handlers:null,
	initialize: function(a,b) {
		this.EVENT_TYPES=
		OpenLayers.Control.SelectFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);
		OpenLayers.Control.prototype.initialize.apply(this,[b]);
		if(this.scope===null)
			this.scope=this;
		if(a instanceof Array) {
			this.layers=a;
			this.layer=new OpenLayers.Layer.Vector.RootContainer(this.id+"_container", {
				layers:a
			})
		} else
			this.layer=a;
		a= {
			click:this.clickFeature,
			clickout:this.clickoutFeature
		};
		if(this.hover) {
			a.over=this.overFeature;
			a.out=this.outFeature
		}
		this.callbacks=OpenLayers.Util.extend(a,this.callbacks);
		this.handlers= {
			feature:new OpenLayers.Handler.Feature(this,this.layer,this.callbacks, {
				geometryTypes:this.geometryTypes
			})
		};
		if(this.box)
			this.handlers.box=new OpenLayers.Handler.Box(this, {
				done:this.selectBox
			}, {
				boxDivClassName:"olHandlerBoxSelectFeature"
			})
	},
	destroy: function() {
		OpenLayers.Control.prototype.destroy.apply(this,arguments);
		this.layers&&this.layer.destroy()
	},
	activate: function() {
		if(!this.active) {
			this.layers&&this.map.addLayer(this.layer);
			this.handlers.feature.activate();
			this.box&&this.handlers.box&&
			this.handlers.box.activate()
		}
		return OpenLayers.Control.prototype.activate.apply(this,arguments)
	},
	deactivate: function() {
		if(this.active) {
			this.handlers.feature.deactivate();
			this.handlers.box&&this.handlers.box.deactivate();
			this.layers&&this.map.removeLayer(this.layer)
		}
		return OpenLayers.Control.prototype.deactivate.apply(this,arguments)
	},
	unselectAll: function(a) {
		for(var b=this.layers||[this.layer],c,d,e=0;e<b.length;++e) {
			c=b[e];
			for(var f=c.selectedFeatures.length-1;f>=0;--f) {
				d=c.selectedFeatures[f];
				if(!a||
				a.except!=d)
					this.unselect(d)
			}
		}
	},
	clickFeature: function(a) {
		if(!this.hover) {
			var b=OpenLayers.Util.indexOf(a.layer.selectedFeatures,a)>-1;
			if(b)
				if(this.toggleSelect())
					this.unselect(a);
				else
					this.multipleSelect()||this.unselectAll({
						except:a
					});
			else {
				this.multipleSelect()||this.unselectAll({
					except:a
				});
				this.select(a)
			}
		}
	},
	multipleSelect: function() {
		return this.multiple||this.handlers.feature.evt&&this.handlers.feature.evt[this.multipleKey]
	},
	toggleSelect: function() {
		return this.toggle||this.handlers.feature.evt&&
		this.handlers.feature.evt[this.toggleKey]
	},
	clickoutFeature: function() {
		!this.hover&&this.clickout&&this.unselectAll()
	},
	overFeature: function(a) {
		var b=a.layer;
		if(this.hover)
			if(this.highlightOnly)
				this.highlight(a);
			else
				OpenLayers.Util.indexOf(b.selectedFeatures,a)==-1&&this.select(a)
	},
	outFeature: function(a) {
		if(this.hover)
			if(this.highlightOnly) {
				if(a._lastHighlighter==this.id)
					if(a._prevHighlighter&&a._prevHighlighter!=this.id) {
						delete a._lastHighlighter;
						var b=this.map.getControl(a._prevHighlighter);
						b&&b.highlight(a)
					} else
						this.unhighlight(a)
			} else
				this.unselect(a)
	},
	highlight: function(a) {
		var b=a.layer,c=this.events.triggerEvent("beforefeaturehighlighted", {
			feature:a
		});
		if(c!==false) {
			a._prevHighlighter=a._lastHighlighter;
			a._lastHighlighter=this.id;
			c=this.selectStyle||this.renderIntent;
			b.drawFeature(a,c);
			this.events.triggerEvent("featurehighlighted", {
				feature:a
			})
		}
	},
	unhighlight: function(a) {
		var b=a.layer;
		a._lastHighlighter=a._prevHighlighter;
		delete a._prevHighlighter;
		b.drawFeature(a,a.style||a.layer.style||"default");
		this.events.triggerEvent("featureunhighlighted", {
			feature:a
		})
	},
	select: function(a) {
		var b=this.onBeforeSelect.call(this.scope,a),c=a.layer;
		if(b!==false) {
			b=c.events.triggerEvent("beforefeatureselected", {
				feature:a
			});
			if(b!==false) {
				c.selectedFeatures.push(a);
				this.highlight(a);
				c.events.triggerEvent("featureselected", {
					feature:a
				});
				this.onSelect.call(this.scope,a)
			}
		}
	},
	unselect: function(a) {
		var b=a.layer;
		this.unhighlight(a);
		OpenLayers.Util.removeItem(b.selectedFeatures,a);
		b.events.triggerEvent("featureunselected", {
			feature:a
		});
		this.onUnselect.call(this.scope,
		a)
	},
	selectBox: function(a) {
		if(a instanceof OpenLayers.Bounds) {
			var b=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.left,a.bottom));
			a=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.right,a.top));
			b=new OpenLayers.Bounds(b.lon,b.lat,a.lon,a.lat);
			this.multipleSelect()||this.unselectAll();
			a=this.multiple;
			this.multiple=true;
			for(var c=this.layers||[this.layer],d,e=0;e<c.length;++e) {
				d=c[e];
				for(var f=0,g=d.features.length;f<g;++f) {
					var h=d.features[f];
					if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,
					h.geometry.CLASS_NAME)>-1)
						b.toGeometry().intersects(h.geometry)&&OpenLayers.Util.indexOf(d.selectedFeatures,h)==-1&&this.select(h)
				}
			}
			this.multiple=a
		}
	},
	setMap: function(a) {
		this.handlers.feature.setMap(a);
		this.box&&this.handlers.box.setMap(a);
		OpenLayers.Control.prototype.setMap.apply(this,arguments)
	},
	CLASS_NAME:"OpenLayers.Control.SelectFeature"
});
OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint, {
	componentTypes:["OpenLayers.Geometry.Point"],
	initialize: function() {
		OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments)
	},
	getLength: function() {
		var a=0;
		if(this.components&&this.components.length>1)
			for(var b=1,c=this.components.length;b<c;b++)
				a+=this.components[b-1].distanceTo(this.components[b]);
		return a
	},
	getGeodesicLength: function(a) {
		var b=this;
		if(a) {
			var c=new OpenLayers.Projection("EPSG:4326");
			c.equals(a)||
			(b=this.clone().transform(a,c))
		}
		a=0;
		if(b.components&&b.components.length>1)
			for(var d,e=1,f=b.components.length;e<f;e++) {
				c=b.components[e-1];
				d=b.components[e];
				a+=OpenLayers.Util.distVincenty({
					lon:c.x,
					lat:c.y
				}, {
					lon:d.x,
					lat:d.y
				})
			}
		return a*1000
	},
	CLASS_NAME:"OpenLayers.Geometry.Curve"
});
OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve, {
	initialize: function() {
		OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments)
	},
	removeComponent: function() {
		this.components&&this.components.length>2&&OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments)
	},
	intersects: function(a) {
		var b=false,c=a.CLASS_NAME;
		if(c=="OpenLayers.Geometry.LineString"||c=="OpenLayers.Geometry.LinearRing"||c=="OpenLayers.Geometry.Point") {
			var d=this.getSortedSegments();
			a=c=="OpenLayers.Geometry.Point"?[{
				x1:a.x,
				y1:a.y,
				x2:a.x,
				y2:a.y
			}]:a.getSortedSegments();
			var e,f,g,h,i,j,l,k=0,n=d.length;a:
			for(;k<n;++k) {
				c=d[k];
				e=c.x1;
				f=c.x2;
				g=c.y1;
				h=c.y2;
				var m=0,o=a.length;
				for(;m<o;++m) {
					i=a[m];
					if(i.x1>f)
						break;
					if(!(i.x2<e)) {
						j=i.y1;
						l=i.y2;
						if(!(Math.min(j,l)>Math.max(g,h)))
							if(!(Math.max(j,l)<Math.min(g,h)))
								if(OpenLayers.Geometry.segmentsIntersect(c,i)) {
									b=true;
									break a
								}
					}
				}
			}
		} else
			b=a.intersects(this);
		return b
	},
	getSortedSegments: function() {
		for(var a=this.components.length-1,b=new Array(a),
		c=0;c<a;++c) {
			point1=this.components[c];
			point2=this.components[c+1];
			b[c]=point1.x<point2.x? {
				x1:point1.x,
				y1:point1.y,
				x2:point2.x,
				y2:point2.y
			}: {
				x1:point2.x,
				y1:point2.y,
				x2:point1.x,
				y2:point1.y
			}
		}
		function d(e,f) {
			return e.x1-f.x1
		}

		return b.sort(d)
	},
	splitWithSegment: function(a,b) {
		var c=!(b&&b.edge===false),d=b&&b.tolerance;
		b=[];
		for(var e=this.getVertices(),f=[],g=[],h=false,i,j,l,k={point:true,tolerance:d},n=null,m=0,o=e.length-2;m<=o;++m) {
			d=e[m];
			f.push(d.clone());
			i=e[m+1];
			j= {
				x1:d.x,
				y1:d.y,
				x2:i.x,
				y2:i.y
			};
			j=OpenLayers.Geometry.segmentsIntersect(a,j,k);
			if(j instanceof OpenLayers.Geometry.Point)
				if((l=j.x===a.x1&&j.y===a.y1||j.x===a.x2&&j.y===a.y2||j.equals(d)||j.equals(i)?true:false)||c) {
					j.equals(g[g.length-1])||g.push(j.clone());
					if(m===0)
						if(j.equals(d))
							continue;
					if(!j.equals(i)) {
						h=true;
						j.equals(d)||f.push(j);
						b.push(new OpenLayers.Geometry.LineString(f));
						f=[j.clone()]
					}
				}
		}
		if(h) {
			f.push(i.clone());
			b.push(new OpenLayers.Geometry.LineString(f))
		}
		if(g.length>0) {
			var p=a.x1<a.x2?1:-1,r=a.y1<a.y2?1:-1;
			n= {
				lines:b,
				points:g.sort( function(q,s) {
					return p*q.x-p*s.x||r*q.y-r*s.y
				})
			}
		}
		return n
	},
	split: function(a,b) {
		var c=null,d=b&&b.mutual,e,f,g,h;
		if(a instanceof OpenLayers.Geometry.LineString) {
			var i=this.getVertices(),j,l,k,n,m,o=[];
			g=[];
			for(var p=0,r=i.length-2;p<=r;++p) {
				j=i[p];
				l=i[p+1];
				k= {
					x1:j.x,
					y1:j.y,
					x2:l.x,
					y2:l.y
				};
				h=h||[a];
				d&&o.push(j.clone());
				for(var q=0;q<h.length;++q)
					if(n=h[q].splitWithSegment(k,b)) {
						m=n.lines;
						if(m.length>0) {
							m.unshift(q,1);
							Array.prototype.splice.apply(h,m);
							q+=m.length-2
						}
						if(d)
							for(var s=0,t=n.points.length;s<
							t;++s) {
								m=n.points[s];
								if(!m.equals(j)) {
									o.push(m);
									g.push(new OpenLayers.Geometry.LineString(o));
									o=m.equals(l)?[]:[m.clone()]
								}
							}
					}
			}
			if(d&&g.length>0&&o.length>0) {
				o.push(l.clone());
				g.push(new OpenLayers.Geometry.LineString(o))
			}
		} else
			c=a.splitWith(this,b);
		if(h&&h.length>1)
			f=true;
		else
			h=[];
		if(g&&g.length>1)
			e=true;
		else
			g=[];
		if(f||e)
			c=d?[g,h]:h;
		return c
	},
	splitWith: function(a,b) {
		return a.split(this,b)
	},
	getVertices: function(a) {
		return a=a===true?[this.components[0],this.components[this.components.length-1]]:a===
		false?this.components.slice(1,this.components.length-1):this.components.slice()
	},
	distanceTo: function(a,b) {
		var c=!(b&&b.edge===false);
		c=c&&b&&b.details;
		var d,e= {},f=Number.POSITIVE_INFINITY;
		if(a instanceof OpenLayers.Geometry.Point) {
			b=this.getSortedSegments();
			for(var g=a.x,h=a.y,i,j=0,l=b.length;j<l;++j) {
				i=b[j];
				d=OpenLayers.Geometry.distanceToSegment(a,i);
				if(d.distance<f) {
					f=d.distance;
					e=d;
					if(f===0)
						break
				} else if(i.x2>g&&(h>i.y1&&h<i.y2||h<i.y1&&h>i.y2))
					break
			}
			e=c? {
				distance:e.distance,
				x0:e.x,
				y0:e.y,
				x1:g,
				y1:h
			}:e.distance
		} else if(a instanceof OpenLayers.Geometry.LineString) {
			h=this.getSortedSegments();
			i=a.getSortedSegments();
			var k,n,m,o=i.length,p= {
				point:true
			};
			j=0;
			l=h.length;a:
			for(;j<l;++j) {
				g=h[j];
				n=g.x1;
				m=g.y1;
				for(var r=0;r<o;++r) {
					d=i[r];
					if(k=OpenLayers.Geometry.segmentsIntersect(g,d,p)) {
						f=0;
						e= {
							distance:0,
							x0:k.x,
							y0:k.y,
							x1:k.x,
							y1:k.y
						};
						break a
					} else {
						d=OpenLayers.Geometry.distanceToSegment({
							x:n,
							y:m
						},d);
						if(d.distance<f) {
							f=d.distance;
							e= {
								distance:f,
								x0:n,
								y0:m,
								x1:d.x,
								y1:d.y
							}
						}
					}
				}
			}
			if(!c)
				e=e.distance;
			if(f!==0)
				if(g) {
					d=
					a.distanceTo(new OpenLayers.Geometry.Point(g.x2,g.y2),b);
					a=c?d.distance:d;
					if(a<f)
						e=c? {
							distance:f,
							x0:d.x1,
							y0:d.y1,
							x1:d.x0,
							y1:d.y0
						}:a
				}
		} else {
			e=a.distanceTo(this,b);
			if(c)
				e= {
					distance:e.distance,
					x0:e.x1,
					y0:e.y1,
					x1:e.x0,
					y1:e.y0
				}
		}
		return e
	},
	CLASS_NAME:"OpenLayers.Geometry.LineString"
});
OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString, {
	componentTypes:["OpenLayers.Geometry.Point"],
	initialize: function() {
		OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments)
	},
	addComponent: function(a,b) {
		var c=false,d=this.components.pop();
		if(b!=null||!a.equals(d))
			c=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments);
		d=this.components[0];
		OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[d]);
		return c
	},
	removeComponent: function() {
		if(this.components.length>
		4) {
			this.components.pop();
			OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);
			var a=this.components[0];
			OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[a])
		}
	},
	move: function(a,b) {
		for(var c=0,d=this.components.length;c<d-1;c++)
			this.components[c].move(a,b)
	},
	rotate: function(a,b) {
		for(var c=0,d=this.components.length;c<d-1;++c)
			this.components[c].rotate(a,b)
	},
	resize: function(a,b,c) {
		for(var d=0,e=this.components.length;d<e-1;++d)
			this.components[d].resize(a,b,c);
		return this
	},
	transform: function(a,b) {
		if(a&&b) {
			for(var c=0,d=this.components.length;c<d-1;c++) {
				var e=this.components[c];
				e.transform(a,b)
			}
			this.bounds=null
		}
		return this
	},
	getCentroid: function() {
		if(this.components&&this.components.length>2) {
			for(var a=0,b=0,c=0;c<this.components.length-1;c++) {
				var d=this.components[c],e=this.components[c+1];
				a+=(d.x+e.x)*(d.x*e.y-e.x*d.y);
				b+=(d.y+e.y)*(d.x*e.y-e.x*d.y)
			}
			c=-1*this.getArea();
			a=a/(6*c);
			b=b/(6*c)
		}
		return new OpenLayers.Geometry.Point(a,b)
	},
	getArea: function() {
		var a=0;
		if(this.components&&
		this.components.length>2) {
			for(var b=a=0,c=this.components.length;b<c-1;b++) {
				var d=this.components[b],e=this.components[b+1];
				a+=(d.x+e.x)*(e.y-d.y)
			}
			a=-a/2
		}
		return a
	},
	getGeodesicArea: function(a) {
		var b=this;
		if(a) {
			var c=new OpenLayers.Projection("EPSG:4326");
			c.equals(a)||(b=this.clone().transform(a,c))
		}
		a=0;
		c=b.components&&b.components.length;
		if(c>2) {
			for(var d,e,f=0;f<c-1;f++) {
				d=b.components[f];
				e=b.components[f+1];
				a+=OpenLayers.Util.rad(e.x-d.x)*(2+Math.sin(OpenLayers.Util.rad(d.y))+Math.sin(OpenLayers.Util.rad(e.y)))
			}
			a=
			a*6378137*6378137/2
		}
		return a
	},
	containsPoint: function(a) {
		var b=OpenLayers.Number.limitSigDigs,c=14,d=b(a.x,c);
		a=b(a.y,c);
		function e(m,o,p,r,q) {
			return((o-r)*m+(r*p-o*q))/(p-q)
		}

		for(var f=this.components.length-1,g,h,i,j,l,k=0,n=0;n<f;++n) {
			g=this.components[n];
			i=b(g.x,c);
			g=b(g.y,c);
			h=this.components[n+1];
			j=b(h.x,c);
			h=b(h.y,c);
			if(g==h) {
				if(a==g)
					if(i<=j&&d>=i&&d<=j||i>=j&&d<=i&&d>=j) {
						k=-1;
						break
					}
			} else {
				l=b(e(a,i,g,j,h),c);
				if(l==d)
					if(g<h&&a>=g&&a<=h||g>h&&a<=g&&a>=h) {
						k=-1;
						break
					}
				if(!(l<=d))
					if(!(i!=j&&(l<Math.min(i,
					j)||l>Math.max(i,j))))
						if(g<h&&a>=g&&a<h||g>h&&a<g&&a>=h)
							++k
			}
		}
		return b=k==-1?1:!!(k&1)
	},
	intersects: function(a) {
		var b=false;
		if(a.CLASS_NAME=="OpenLayers.Geometry.Point")
			b=this.containsPoint(a);
		else if(a.CLASS_NAME=="OpenLayers.Geometry.LineString")
			b=a.intersects(this);
		else if(a.CLASS_NAME=="OpenLayers.Geometry.LinearRing")
			b=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[a]);
		else
			for(var c=0,d=a.components.length;c<d;++c)
				if(b=a.components[c].intersects(this))
					break;
		return b
	},
	getVertices: function(a) {
		return a===
		true?[]:this.components.slice(0,this.components.length-1)
	},
	CLASS_NAME:"OpenLayers.Geometry.LinearRing"
});
OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection, {
	componentTypes:["OpenLayers.Geometry.LineString"],
	initialize: function() {
		OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)
	},
	split: function(a,b) {
		for(var c=null,d=b&&b.mutual,e,f,g,h=[],i=[a],j=0,l=this.components.length;j<l;++j) {
			e=this.components[j];
			f=false;
			for(var k=0;k<i.length;++k)
				if(a=e.split(i[k],b)) {
					if(d) {
						f=a[0];
						for(var n=0,m=f.length;n<m;++n)
							n===0&&h.length?h[h.length-1].addComponent(f[n]):
							h.push(new OpenLayers.Geometry.MultiLineString([f[n]]));
						f=true;
						a=a[1]
					}
					if(a.length) {
						a.unshift(k,1);
						Array.prototype.splice.apply(i,a);
						break
					}
				}
			if(!f)
				if(h.length)
					h[h.length-1].addComponent(e.clone());
				else
					h=[new OpenLayers.Geometry.MultiLineString(e.clone())]
		}
		if(h&&h.length>1)
			f=true;
		else
			h=[];
		if(i&&i.length>1)
			g=true;
		else
			i=[];
		if(f||g)
			c=d?[h,i]:i;
		return c
	},
	splitWith: function(a,b) {
		var c=null,d=b&&b.mutual,e,f,g,h,i;
		if(a instanceof OpenLayers.Geometry.LineString) {
			i=[];
			h=[a];
			for(var j=0,l=this.components.length;j<
			l;++j) {
				f=false;
				e=this.components[j];
				for(var k=0;k<h.length;++k)
					if(a=h[k].split(e,b)) {
						if(d) {
							f=a[0];
							if(f.length) {
								f.unshift(k,1);
								Array.prototype.splice.apply(h,f);
								k+=f.length-2
							}
							a=a[1];
							if(a.length===0)
								a=[e.clone()]
						}
						f=0;
						for(var n=a.length;f<n;++f)
							f===0&&i.length?i[i.length-1].addComponent(a[f]):i.push(new OpenLayers.Geometry.MultiLineString([a[f]]));
						f=true
					}
				if(!f)
					if(i.length)
						i[i.length-1].addComponent(e.clone());
					else
						i=[new OpenLayers.Geometry.MultiLineString([e.clone()])]
			}
		} else
			c=a.split(this);
		if(h&&h.length>
		1)
			g=true;
		else
			h=[];
		if(i&&i.length>1)
			f=true;
		else
			i=[];
		if(g||f)
			c=d?[h,i]:i;
		return c
	},
	CLASS_NAME:"OpenLayers.Geometry.MultiLineString"
});
OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection, {
	componentTypes:["OpenLayers.Geometry.LinearRing"],
	initialize: function() {
		OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)
	},
	getArea: function() {
		var a=0;
		if(this.components&&this.components.length>0) {
			a+=Math.abs(this.components[0].getArea());
			for(var b=1,c=this.components.length;b<c;b++)
				a-=Math.abs(this.components[b].getArea())
		}
		return a
	},
	getGeodesicArea: function(a) {
		var b=0;
		if(this.components&&this.components.length>
		0) {
			b+=Math.abs(this.components[0].getGeodesicArea(a));
			for(var c=1,d=this.components.length;c<d;c++)
				b-=Math.abs(this.components[c].getGeodesicArea(a))
		}
		return b
	},
	containsPoint: function(a) {
		var b=this.components.length,c=false;
		if(b>0) {
			c=this.components[0].containsPoint(a);
			if(c!==1)
				if(c&&b>1)
					for(var d,e=1;e<b;++e)
						if(d=this.components[e].containsPoint(a)) {
							c=d===1?1:false;
							break
						}
		}
		return c
	},
	intersects: function(a) {
		var b=false,c,d;
		if(a.CLASS_NAME=="OpenLayers.Geometry.Point")
			b=this.containsPoint(a);
		else if(a.CLASS_NAME==
		"OpenLayers.Geometry.LineString"||a.CLASS_NAME=="OpenLayers.Geometry.LinearRing") {
			c=0;
			for(d=this.components.length;c<d;++c)
				if(b=a.intersects(this.components[c]))
					break;
			if(!b) {
				c=0;
				for(d=a.components.length;c<d;++c)
					if(b=this.containsPoint(a.components[c]))
						break
			}
		} else {
			c=0;
			for(d=a.components.length;c<d;++c)
				if(b=this.intersects(a.components[c]))
					break
		}
		if(!b&&a.CLASS_NAME=="OpenLayers.Geometry.Polygon") {
			var e=this.components[0];
			c=0;
			for(d=e.components.length;c<d;++c)
				if(b=a.containsPoint(e.components[c]))
					break
		}
		return b
	},
	distanceTo: function(a,b) {
		var c=!(b&&b.edge===false);
		return a=!c&&this.intersects(a)?0:OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[a,b])
	},
	CLASS_NAME:"OpenLayers.Geometry.Polygon"
});
OpenLayers.Geometry.Polygon.createRegularPolygon= function(a,b,c,d) {
	var e=Math.PI*(1/c-0.5);
	if(d)
		e+=d/180*Math.PI;
	for(var f,g=[],h=0;h<c;++h) {
		f=e+h*2*Math.PI/c;
		d=a.x+b*Math.cos(f);
		f=a.y+b*Math.sin(f);
		g.push(new OpenLayers.Geometry.Point(d,f))
	}
	a=new OpenLayers.Geometry.LinearRing(g);
	return new OpenLayers.Geometry.Polygon([a])
};
OpenLayers.Format.KML=OpenLayers.Class(OpenLayers.Format.XML, {
	kmlns:"http://earth.google.com/kml/2.0",
	placemarksDesc:"No description available",
	foldersName:"OpenLayers export",
	foldersDesc:"Exported on "+new Date,
	extractAttributes:true,
	extractStyles:false,
	internalns:null,
	features:null,
	styles:null,
	styleBaseUrl:"",
	fetched:null,
	maxDepth:0,
	initialize: function(a) {
		this.regExes= {
			trimSpace:/^\s*|\s*$/g,
			removeSpace:/\s*/g,
			splitSpace:/\s+/,
			trimComma:/\s*,\s*/g,
			kmlColor:/(\w{2})(\w{2})(\w{2})(\w{2})/,
			kmlIconPalette:/root:\/\/icons\/palette-(\d+)(\.\w+)/,
			straightBracket:/\$\[(.*?)\]/g
		};
		OpenLayers.Format.XML.prototype.initialize.apply(this,[a])
	},
	read: function(a) {
		this.features=[];
		this.styles= {};
		this.fetched= {};
		var b= {
			depth:0,
			styleBaseUrl:this.styleBaseUrl
		};
		return this.parseData(a,b)
	},
	parseData: function(a,b) {
		if(typeof a=="string")
			a=OpenLayers.Format.XML.prototype.read.apply(this,[a]);
		for(var c=["Link","NetworkLink","Style","StyleMap","Placemark"],d=0,e=c.length;d<e;++d) {
			var f=c[d],g=this.getElementsByTagNameNS(a,"*",f);
			if(g.length!=0)
				switch(f.toLowerCase()) {
					case "link":
					case "networklink":
						this.parseLinks(g,
						b);
						break;
					case "style":
						this.extractStyles&&this.parseStyles(g,b);
						break;
					case "stylemap":
						this.extractStyles&&this.parseStyleMaps(g,b);
						break;
					case "placemark":
						this.parseFeatures(g,b);
						break
				}
		}
		return this.features
	},
	parseLinks: function(a,b) {
		if(b.depth>=this.maxDepth)
			return false;
		b=OpenLayers.Util.extend({},b);
		b.depth++;
		for(var c=0,d=a.length;c<d;c++) {
			var e=this.parseProperty(a[c],"*","href");
			if(e&&!this.fetched[e]) {
				this.fetched[e]=true;
				(e=this.fetchLink(e))&&this.parseData(e,b)
			}
		}
	},
	fetchLink: function(a) {
		if(a=
		OpenLayers.Request.GET({url:a,async:false}))
			return a.responseText
	},
	parseStyles: function(a,b) {
		for(var c=0,d=a.length;c<d;c++) {
			var e=this.parseStyle(a[c]);
			if(e) {
				styleName=(b.styleBaseUrl||"")+"#"+e.id;
				this.styles[styleName]=e
			}
		}
	},
	parseStyle: function(a) {
		for(var b={},c=["LineStyle","PolyStyle","IconStyle","BalloonStyle"],d,e=0,f=c.length;e<f;++e) {
			d=c[e];
			if(styleTypeNode=this.getElementsByTagNameNS(a,"*",d)[0])
				switch(d.toLowerCase()) {
					case "linestyle":
						if(d=this.parseProperty(styleTypeNode,"*","color")) {
							var g=
							d.toString().match(this.regExes.kmlColor);
							d=g[1];
							b.strokeOpacity=parseInt(d,16)/255;
							d=g[2];
							var h=g[3],i=g[4];
							b.strokeColor="#"+i+h+d
						}
						if(d=this.parseProperty(styleTypeNode,"*","width"))
							b.strokeWidth=d;
					case "polystyle":
						if(d=this.parseProperty(styleTypeNode,"*","color")) {
							g=d.toString().match(this.regExes.kmlColor);
							d=g[1];
							b.fillOpacity=parseInt(d,16)/255;
							d=g[2];
							h=g[3];
							i=g[4];
							b.fillColor="#"+i+h+d
						}
						d=this.parseProperty(styleTypeNode,"*","fill");
						if(d=="0")
							b.fillColor="none";
						break;
					case "iconstyle":
						h=parseFloat(this.parseProperty(styleTypeNode,
						"*","scale")||1);
						d=32*h;
						i=32*h;
						var j=this.getElementsByTagNameNS(styleTypeNode,"*","Icon")[0];
						if(j) {
							var l=this.parseProperty(j,"*","href");
							if(l) {
								g=this.parseProperty(j,"*","w");
								var k=this.parseProperty(j,"*","h"),n="http://maps.google.com/mapfiles/kml";
								if(OpenLayers.String.startsWith(l,n)&&!g&&!k) {
									k=g=64;
									h/=2
								}
								g=g||k;
								k=k||g;
								if(g)
									d=parseInt(g)*h;
								if(k)
									i=parseInt(k)*h;
								if(g=l.match(this.regExes.kmlIconPalette)) {
									l=g[1];
									g=g[2];
									k=this.parseProperty(j,"*","x");
									j=this.parseProperty(j,"*","y");
									k=k?k/32:0;
									j=
									j?7-j/32:7;
									j=j*8+k;
									l="http://maps.google.com/mapfiles/kml/pal"+l+"/icon"+j+g
								}
								b.graphicOpacity=1;
								b.externalGraphic=l
							}
						}
						if(l=this.getElementsByTagNameNS(styleTypeNode,"*","hotSpot")[0]) {
							k=parseFloat(l.getAttribute("x"));
							j=parseFloat(l.getAttribute("y"));
							g=l.getAttribute("xunits");
							if(g=="pixels")
								b.graphicXOffset=-k*h;
							else if(g=="insetPixels")
								b.graphicXOffset=-d+k*h;
							else if(g=="fraction")
								b.graphicXOffset=-d*k;
							l=l.getAttribute("yunits");
							if(l=="pixels")
								b.graphicYOffset=-i+j*h+1;
							else if(l=="insetPixels")
								b.graphicYOffset=
								-(j*h)+1;
							else if(l=="fraction")
								b.graphicYOffset=-i*(1-j)+1
						}
						b.graphicWidth=d;
						b.graphicHeight=i;
						break;
					case "balloonstyle":
						if(d=OpenLayers.Util.getXmlNodeValue(styleTypeNode))
							b.balloonStyle=d.replace(this.regExes.straightBracket,"${$1}");
						break;
					default:
				}
		}
		if(!b.strokeColor&&b.fillColor)
			b.strokeColor=b.fillColor;
		if((a=a.getAttribute("id"))&&b)
			b.id=a;
		return b
	},
	parseStyleMaps: function(a,b) {
		for(var c=0,d=a.length;c<d;c++) {
			var e=a[c],f=this.getElementsByTagNameNS(e,"*","Pair");
			e=e.getAttribute("id");
			for(var g=
			0,h=f.length;g<h;g++) {
				var i=f[g],j=this.parseProperty(i,"*","key");
				if((i=this.parseProperty(i,"*","styleUrl"))&&j=="normal")
					this.styles[(b.styleBaseUrl||"")+"#"+e]=this.styles[(b.styleBaseUrl||"")+i]
			}
		}
	},
	parseFeatures: function(a,b) {
		for(var c=new Array(a.length),d=0,e=a.length;d<e;d++) {
			var f=a[d],g=this.parseFeature.apply(this,[f]);
			if(g) {
				if(this.extractStyles&&g.attributes&&g.attributes.styleUrl)
					g.style=this.getStyle(g.attributes.styleUrl,b);
				if(this.extractStyles)
					if(f=this.getElementsByTagNameNS(f,
					"*","Style")[0])
						if(f=this.parseStyle(f))
							g.style=OpenLayers.Util.extend(g.style,f);
				c[d]=g
			} else throw"Bad Placemark: "+d;
		}
		this.features=this.features.concat(c)
	},
	parseFeature: function(a) {
		for(var b=["MultiGeometry","Polygon","LineString","Point"],c,d,e,f=0,g=b.length;f<g;++f) {
			c=b[f];
			this.internalns=a.namespaceURI?a.namespaceURI:this.kmlns;
			d=this.getElementsByTagNameNS(a,this.internalns,c);
			if(d.length>0) {
				if(b=this.parseGeometry[c.toLowerCase()]) {
					e=b.apply(this,[d[0]]);
					this.internalProjection&&this.externalProjection&&
					e.transform(this.externalProjection,this.internalProjection)
				} else
					OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType", {
						geomType:c
					}));
				break
			}
		}
		var h;
		if(this.extractAttributes)
			h=this.parseAttributes(a);
		c=new OpenLayers.Feature.Vector(e,h);
		a=a.getAttribute("id")||a.getAttribute("name");
		if(a!=null)
			c.fid=a;
		return c
	},
	getStyle: function(a,b) {
		var c=OpenLayers.Util.removeTail(a);
		b=OpenLayers.Util.extend({},b);
		b.depth++;
		b.styleBaseUrl=c;
		if(!this.styles[a]&&!OpenLayers.String.startsWith(a,"#")&&
		b.depth<=this.maxDepth&&!this.fetched[c])
			(c=this.fetchLink(c))&&this.parseData(c,b);
		return a=OpenLayers.Util.extend({},this.styles[a])
	},
	parseGeometry: {
		point: function(a) {
			var b=this.getElementsByTagNameNS(a,this.internalns,"coordinates");
			a=[];
			if(b.length>0) {
				var c=b[0].firstChild.nodeValue;
				c=c.replace(this.regExes.removeSpace,"");
				a=c.split(",")
			}
			b=null;
			if(a.length>1) {
				if(a.length==2)
					a[2]=null;
				b=new OpenLayers.Geometry.Point(a[0],a[1],a[2])
			} else throw"Bad coordinate string: "+c;
			return b
		},
		linestring: function(a,
		b) {
			a=this.getElementsByTagNameNS(a,this.internalns,"coordinates");
			var c=null;
			if(a.length>0) {
				a=this.getChildValue(a[0]);
				a=a.replace(this.regExes.trimSpace,"");
				a=a.replace(this.regExes.trimComma,",");
				c=a.split(this.regExes.splitSpace);
				for(var d=c.length,e=new Array(d),f,g,h=0;h<d;++h) {
					f=c[h].split(",");
					g=f.length;
					if(g>1) {
						if(f.length==2)
							f[2]=null;
						e[h]=new OpenLayers.Geometry.Point(f[0],f[1],f[2])
					} else throw"Bad LineString point coordinates: "+c[h];
				}
				if(d)
					c=b?new OpenLayers.Geometry.LinearRing(e):new OpenLayers.Geometry.LineString(e);
				else throw"Bad LineString coordinates: "+a;
			}
			return c
		},
		polygon: function(a) {
			a=this.getElementsByTagNameNS(a,this.internalns,"LinearRing");
			var b=a.length,c=new Array(b);
			if(b>0)
				for(var d=0,e=a.length;d<e;++d)
					if(b=this.parseGeometry.linestring.apply(this,[a[d],true]))
						c[d]=b;
					else throw"Bad LinearRing geometry: "+d;
			return new OpenLayers.Geometry.Polygon(c)
		},
		multigeometry: function(a) {
			for(var b,c=[],d=a.childNodes,e=0,f=d.length;e<f;++e) {
				a=d[e];
				if(a.nodeType==1) {
					b=a.prefix?a.nodeName.split(":")[1]:a.nodeName;
					(b=this.parseGeometry[b.toLowerCase()])&&c.push(b.apply(this,[a]))
				}
			}
			return new OpenLayers.Geometry.Collection(c)
		}
	},
	parseAttributes: function(a) {
		var b= {},c=a.getElementsByTagName("ExtendedData");
		if(c.length)
			b=this.parseExtendedData(c[0]);
		var d,e;
		a=a.childNodes;
		c=0;
		for(var f=a.length;c<f;++c) {
			d=a[c];
			if(d.nodeType==1) {
				e=d.childNodes;
				if(e.length==1||e.length==3) {
					switch(e.length) {
						case 1:
							e=e[0];
							break;
						case 3:
						default:
							e=e[1];
							break
					}
					if(e.nodeType==3||e.nodeType==4) {
						d=d.prefix?d.nodeName.split(":")[1]:d.nodeName;
						if(e=OpenLayers.Util.getXmlNodeValue(e)) {
							e=e.replace(this.regExes.trimSpace,"");
							b[d]=e
						}
					}
				}
			}
		}
		return b
	},
	parseExtendedData: function(a) {
		var b= {};
		a=a.getElementsByTagName("Data");
		for(var c=0,d=a.length;c<d;c++) {
			var e=a[c],f=e.getAttribute("name"),g= {},h=e.getElementsByTagName("value");
			if(h.length)
				g.value=this.getChildValue(h[0]);
			e=e.getElementsByTagName("displayName");
			if(e.length)
				g.displayName=this.getChildValue(e[0]);
			b[f]=g
		}
		return b
	},
	parseProperty: function(a,b,c) {
		var d;
		a=this.getElementsByTagNameNS(a,
		b,c);
		try {
			d=OpenLayers.Util.getXmlNodeValue(a[0])
		} catch(e) {
			d=null
		}
		return d
	},
	write: function(a) {
		a instanceof Array||(a=[a]);
		for(var b=this.createElementNS(this.kmlns,"kml"),c=this.createFolderXML(),d=0,e=a.length;d<e;++d)
			c.appendChild(this.createPlacemarkXML(a[d]));
		b.appendChild(c);
		return OpenLayers.Format.XML.prototype.write.apply(this,[b])
	},
	createFolderXML: function() {
		var a=this.createElementNS(this.kmlns,"name"),b=this.createTextNode(this.foldersName);
		a.appendChild(b);
		b=this.createElementNS(this.kmlns,
		"description");
		var c=this.createTextNode(this.foldersDesc);
		b.appendChild(c);
		c=this.createElementNS(this.kmlns,"Folder");
		c.appendChild(a);
		c.appendChild(b);
		return c
	},
	createPlacemarkXML: function(a) {
		var b=this.createElementNS(this.kmlns,"name"),c=a.attributes.name?a.attributes.name:a.id;
		b.appendChild(this.createTextNode(c));
		c=this.createElementNS(this.kmlns,"description");
		var d=a.attributes.description?a.attributes.description:this.placemarksDesc;
		c.appendChild(this.createTextNode(d));
		d=this.createElementNS(this.kmlns,
		"Placemark");
		a.fid!=null&&d.setAttribute("id",a.fid);
		d.appendChild(b);
		d.appendChild(c);
		a=this.buildGeometryNode(a.geometry);
		d.appendChild(a);
		return d
	},
	buildGeometryNode: function(a) {
		if(this.internalProjection&&this.externalProjection) {
			a=a.clone();
			a.transform(this.internalProjection,this.externalProjection)
		}
		var b=a.CLASS_NAME;
		b=b.substring(b.lastIndexOf(".")+1);
		b=this.buildGeometry[b.toLowerCase()];
		var c=null;
		if(b)
			c=b.apply(this,[a]);
		return c
	},
	buildGeometry: {
		point: function(a) {
			var b=this.createElementNS(this.kmlns,
			"Point");
			b.appendChild(this.buildCoordinatesNode(a));
			return b
		},
		multipoint: function(a) {
			return this.buildGeometry.collection.apply(this,[a])
		},
		linestring: function(a) {
			var b=this.createElementNS(this.kmlns,"LineString");
			b.appendChild(this.buildCoordinatesNode(a));
			return b
		},
		multilinestring: function(a) {
			return this.buildGeometry.collection.apply(this,[a])
		},
		linearring: function(a) {
			var b=this.createElementNS(this.kmlns,"LinearRing");
			b.appendChild(this.buildCoordinatesNode(a));
			return b
		},
		polygon: function(a) {
			var b=
			this.createElementNS(this.kmlns,"Polygon");
			a=a.components;
			for(var c,d,e=0,f=a.length;e<f;++e) {
				c=e==0?"outerBoundaryIs":"innerBoundaryIs";
				c=this.createElementNS(this.kmlns,c);
				d=this.buildGeometry.linearring.apply(this,[a[e]]);
				c.appendChild(d);
				b.appendChild(c)
			}
			return b
		},
		multipolygon: function(a) {
			return this.buildGeometry.collection.apply(this,[a])
		},
		collection: function(a) {
			for(var b=this.createElementNS(this.kmlns,"MultiGeometry"),c,d=0,e=a.components.length;d<e;++d)
				(c=this.buildGeometryNode.apply(this,
					[a.components[d]]))&&b.appendChild(c);
			return b
		}
	},
	buildCoordinatesNode: function(a) {
		var b=this.createElementNS(this.kmlns,"coordinates"),c;
		if(c=a.components) {
			for(var d=c.length,e=new Array(d),f=0;f<d;++f) {
				a=c[f];
				e[f]=a.x+","+a.y
			}
			c=e.join(" ")
		} else
			c=a.x+","+a.y;
		c=this.createTextNode(c);
		b.appendChild(c);
		return b
	},
	CLASS_NAME:"OpenLayers.Format.KML"
});
OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection, {
	componentTypes:["OpenLayers.Geometry.Polygon"],
	initialize: function() {
		OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)
	},
	CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"
});
OpenLayers.Format.GeoJSON=OpenLayers.Class(OpenLayers.Format.JSON, {
	initialize: function(a) {
		OpenLayers.Format.JSON.prototype.initialize.apply(this,[a])
	},
	read: function(a,b,c) {
		b=b?b:"FeatureCollection";
		var d=null,e=null;
		if(e=typeof a=="string"?OpenLayers.Format.JSON.prototype.read.apply(this,[a,c]):a)
			if(typeof e.type!="string")
				OpenLayers.Console.error("Bad GeoJSON - no type: "+a);
			else {
				if(this.isValidType(e,b))
					switch(b) {
						case "Geometry":
							try {
								d=this.parseGeometry(e)
							} catch(f) {
								OpenLayers.Console.error(f)
							}
							break;
						case "Feature":
							try {
								d=this.parseFeature(e);
								d.type="Feature"
							} catch(g) {
								OpenLayers.Console.error(g)
							}
							break;
						case "FeatureCollection":
							d=[];
							switch(e.type) {
								case "Feature":
									try {
										d.push(this.parseFeature(e))
									} catch(h) {
										d=null;
										OpenLayers.Console.error(h)
									}
									break;
								case "FeatureCollection":
									a=0;
									for(b=e.features.length;a<b;++a)
										try {
											d.push(this.parseFeature(e.features[a]))
										} catch(i) {
											d=null;
											OpenLayers.Console.error(i)
										}
									break;
								default:
									try {
										var j=this.parseGeometry(e);
										d.push(new OpenLayers.Feature.Vector(j))
									} catch(l) {
										d=null;
										OpenLayers.Console.error(l)
									}
							}
							break
					}
			}
		else
			OpenLayers.Console.error("Bad JSON: "+
			a);
		return d
	},
	isValidType: function(a,b) {
		var c=false;
		switch(b) {
			case "Geometry":
				if(OpenLayers.Util.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],a.type)==-1)
					OpenLayers.Console.error("Unsupported geometry type: "+a.type);
				else
					c=true;
				break;
			case "FeatureCollection":
				c=true;
				break;
			default:
				if(a.type==b)
					c=true;
				else
					OpenLayers.Console.error("Cannot convert types from "+a.type+" to "+b)
		}
		return c
	},
	parseFeature: function(a) {
		var b,c,d;
		c=a.properties?
		a.properties: {};
		d=a.geometry&&a.geometry.bbox||a.bbox;
		try {
			b=this.parseGeometry(a.geometry)
		} catch(e) {throw e;
		}
		b=new OpenLayers.Feature.Vector(b,c);
		if(d)
			b.bounds=OpenLayers.Bounds.fromArray(d);
		if(a.id)
			b.fid=a.id;
		return b
	},
	parseGeometry: function(a) {
		if(a==null)
			return null;
		var b,c=false;
		if(a.type=="GeometryCollection") {
			if(!(a.geometries instanceof Array))throw"GeometryCollection must have geometries array: "+a;
			b=a.geometries.length;
			c=new Array(b);
			for(var d=0;d<b;++d)
				c[d]=this.parseGeometry.apply(this,
				[a.geometries[d]]);
			b=new OpenLayers.Geometry.Collection(c);
			c=true
		} else {
			if(!(a.coordinates instanceof Array))throw"Geometry must have coordinates array: "+a;
			if(!this.parseCoords[a.type.toLowerCase()])throw"Unsupported geometry type: "+a.type;
			try {
				b=this.parseCoords[a.type.toLowerCase()].apply(this,[a.coordinates])
			} catch(e) {throw e;
			}
		}
		this.internalProjection&&this.externalProjection&&!c&&b.transform(this.externalProjection,this.internalProjection);
		return b
	},
	parseCoords: {
		point: function(a) {
			if(a.length!=
			2)throw"Only 2D points are supported: "+a;
			return new OpenLayers.Geometry.Point(a[0],a[1])
		},
		multipoint: function(a) {
			for(var b=[],c=null,d=0,e=a.length;d<e;++d) {
				try {
					c=this.parseCoords.point.apply(this,[a[d]])
				} catch(f) {throw f;
				}
				b.push(c)
			}
			return new OpenLayers.Geometry.MultiPoint(b)
		},
		linestring: function(a) {
			for(var b=[],c=null,d=0,e=a.length;d<e;++d) {
				try {
					c=this.parseCoords.point.apply(this,[a[d]])
				} catch(f) {throw f;
				}
				b.push(c)
			}
			return new OpenLayers.Geometry.LineString(b)
		},
		multilinestring: function(a) {
			for(var b=
			[],c=null,d=0,e=a.length;d<e;++d) {
				try {
					c=this.parseCoords.linestring.apply(this,[a[d]])
				} catch(f) {throw f;
				}
				b.push(c)
			}
			return new OpenLayers.Geometry.MultiLineString(b)
		},
		polygon: function(a) {
			for(var b=[],c,d,e=0,f=a.length;e<f;++e) {
				try {
					d=this.parseCoords.linestring.apply(this,[a[e]])
				} catch(g) {throw g;
				}
				c=new OpenLayers.Geometry.LinearRing(d.components);
				b.push(c)
			}
			return new OpenLayers.Geometry.Polygon(b)
		},
		multipolygon: function(a) {
			for(var b=[],c=null,d=0,e=a.length;d<e;++d) {
				try {
					c=this.parseCoords.polygon.apply(this,
					[a[d]])
				} catch(f) {throw f;
				}
				b.push(c)
			}
			return new OpenLayers.Geometry.MultiPolygon(b)
		},
		box: function(a) {
			if(a.length!=2)throw"GeoJSON box coordinates must have 2 elements";
			return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(a[0][0],a[0][1]),new OpenLayers.Geometry.Point(a[1][0],a[0][1]),new OpenLayers.Geometry.Point(a[1][0],a[1][1]),new OpenLayers.Geometry.Point(a[0][0],a[1][1]),new OpenLayers.Geometry.Point(a[0][0],a[0][1])])])
		}
	},
	write: function(a,
	b) {
		var c= {
			type:null
		};
		if(a instanceof Array) {
			c.type="FeatureCollection";
			var d=a.length;
			c.features=new Array(d);
			for(var e=0;e<d;++e) {
				var f=a[e];
				if(!f instanceof OpenLayers.Feature.Vector) {
					a="FeatureCollection only supports collections of features: "+f;throw a;
				}
				c.features[e]=this.extract.feature.apply(this,[f])
			}
		} else if(a.CLASS_NAME.indexOf("OpenLayers.Geometry")==0)
			c=this.extract.geometry.apply(this,[a]);
		else if(a instanceof OpenLayers.Feature.Vector) {
			c=this.extract.feature.apply(this,[a]);
			if(a.layer&&
			a.layer.projection)
				c.crs=this.createCRSObject(a)
		}
		return OpenLayers.Format.JSON.prototype.write.apply(this,[c,b])
	},
	createCRSObject: function(a) {
		a=a.layer.projection.toString();
		var b= {};
		if(a.match(/epsg:/i)) {
			a=parseInt(a.substring(a.indexOf(":")+1));
			b=a==4326? {
				type:"OGC",
				properties: {
					urn:"urn:ogc:def:crs:OGC:1.3:CRS84"
				}
			}: {
				type:"EPSG",
				properties: {
					code:a
				}
			}
		}
		return b
	},
	extract: {
		feature: function(a) {
			var b=this.extract.geometry.apply(this,[a.geometry]);
			return {
				type:"Feature",
				id:a.fid==null?a.id:a.fid,
				properties:a.attributes,
				geometry:b
			}
		},
		geometry: function(a) {
			if(a==null)
				return null;
			if(this.internalProjection&&this.externalProjection) {
				a=a.clone();
				a.transform(this.internalProjection,this.externalProjection)
			}
			var b=a.CLASS_NAME.split(".")[2];
			a=this.extract[b.toLowerCase()].apply(this,[a]);
			return b=b=="Collection"? {
				type:"GeometryCollection",
				geometries:a
			}: {
				type:b,
				coordinates:a
			}
		},
		point: function(a) {
			return[a.x,a.y]
		},
		multipoint: function(a) {
			for(var b=[],c=0,d=a.components.length;c<d;++c)
				b.push(this.extract.point.apply(this,[a.components[c]]));
			return b
		},
		linestring: function(a) {
			for(var b=[],c=0,d=a.components.length;c<d;++c)
				b.push(this.extract.point.apply(this,[a.components[c]]));
			return b
		},
		multilinestring: function(a) {
			for(var b=[],c=0,d=a.components.length;c<d;++c)
				b.push(this.extract.linestring.apply(this,[a.components[c]]));
			return b
		},
		polygon: function(a) {
			for(var b=[],c=0,d=a.components.length;c<d;++c)
				b.push(this.extract.linestring.apply(this,[a.components[c]]));
			return b
		},
		multipolygon: function(a) {
			for(var b=[],c=0,d=a.components.length;c<d;++c)
				b.push(this.extract.polygon.apply(this,
				[a.components[c]]));
			return b
		},
		collection: function(a) {
			for(var b=a.components.length,c=new Array(b),d=0;d<b;++d)
				c[d]=this.extract.geometry.apply(this,[a.components[d]]);
			return c
		}
	},
	CLASS_NAME:"OpenLayers.Format.GeoJSON"
});

