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 l="",o=new RegExp("(^|(.*?\\/))("+OpenLayers._scriptName+")(\\?|$)"),q=document.getElementsByTagName("script"),s=0,w=q.length;s<w;s++){var G=q[s].getAttribute("src");if(G)if(G=G.match(o)){l=G[1];break}}return l}};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/NewsOnDemandThumb.js","OpenLayers/Popup.js",
"OpenLayers/Thumb.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,g=a.length;e<g;e++)if(b)c[e]="<script src='"+d+a[e]+"'><\/script>";else{var j=document.createElement("script");j.src=d+a[e];(document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body).appendChild(j)}b&&document.write(c.join(""))}})();
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);return a.replace(OpenLayers.String.tokenRegEx,function(d,e){var g;d=e.split(/\.+/);e=d.length;for(var j=0;j<e;j++){if(j==0)g=b;g=g[d[j]]}if(typeof g==
"function")g=c?g.apply(null,c):g();return typeof g=="undefined"?"undefined":g})},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 g=/(-?[0-9]+)([0-9]{3})/;g.test(a);)a=a.replace(g,"$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 for(var e=a.length,g=0;g<e;g++)if(g in a){var j=a[g];b.call(c,j,g,a)&&d.push(j)}return d}};
OpenLayers.Class=function(){for(var a=function(){arguments&&arguments[0]!=OpenLayers.Class.isPrototype&&this.initialize.apply(this,arguments)},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(){for(var a=new arguments[0](OpenLayers.Class.isPrototype),b=1,c=arguments.length;b<c;b++){if(typeof arguments[b]=="function")arguments[b]=new arguments[b](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}if(!(typeof window.Event=="function"&&b instanceof window.Event)&&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,g,j,l){if(typeof a!="undefined"){if(b)a.id=b;b="";if(c)b+="left:"+c.x+"px;top:"+c.y+"px;";if(d)b+="width:"+d.w+"px;height:"+d.h+"px;";if(e)b+="position:"+e+";";if(g)b+="border:"+g+";";if(j)b+="overflow:"+j+";";if(parseFloat(l)>=0&&parseFloat(l)<1)b+="filter:alpha(opacity="+l*100+");opacity:"+l+";";else if(parseFloat(l)==1)b+="filter:;opacity:;";a.style.cssText+=";"+b}};
OpenLayers.Util.createDiv=function(a,b,c,d,e,g,j,l){var o=document.createElement("div");if(d)o.style.backgroundImage="url("+d+")";a||(a=OpenLayers.Util.createUniqueID("OpenLayersDiv"));e||(e="absolute");OpenLayers.Util.modifyDOMElement(o,a,b,c,e,g,j,l);return o};
OpenLayers.Util.createImage=function(a,b,c,d,e,g,j,l){var o=document.createElement("img");a||(a=OpenLayers.Util.createUniqueID("OpenLayersDiv"));e||(e="relative");OpenLayers.Util.modifyDOMElement(o,a,b,c,e,g,null,j);if(l){o.style.display="none";OpenLayers.Event.observe(o,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,o));OpenLayers.Event.observe(o,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,o))}o.style.alt=a;o.galleryImg="no";if(d)o.src=d;return o};
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,g,j,l,o){OpenLayers.Util.modifyDOMElement(a,b,c,d,g,null,null,o);b=a.childNodes[0];if(e)b.src=e;OpenLayers.Util.modifyDOMElement(b,a.id+"_innerImage",null,d,"relative",j);if(OpenLayers.Util.alphaHack()){if(a.style.display!="none")a.style.display="inline-block";if(l==null)l="scale";a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b.src+"', sizingMethod='"+l+"')";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,g,j,l,o){var q=OpenLayers.Util.createDiv(),s=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);q.appendChild(s);if(o){s.style.display="none";OpenLayers.Event.observe(s,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,q));OpenLayers.Event.observe(s,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,q))}OpenLayers.Util.modifyAlphaImageDiv(q,a,b,c,d,e,g,j,l);return q};
OpenLayers.Util.createSpriteDiv=function(a,b,c,d,e,g,j,l){b=OpenLayers.Util.createDiv();OpenLayers.Util.modifyDOMElement(b,a,null,c,e,null,null,l);a=a.split("_");switch(a[a.length-1]){case "panup":b.setAttribute("className","map-up sprite");b.setAttribute("class","map-up sprite");break;case "panleft":b.setAttribute("className","map-left sprite");b.setAttribute("class","map-left sprite");break;case "pandown":b.setAttribute("className","map-down sprite");b.setAttribute("class","map-down sprite");break;
case "panright":b.setAttribute("className","map-right sprite");b.setAttribute("class","map-right sprite");break;case "zoomworld":b.setAttribute("className","map-world sprite");b.setAttribute("class","map-world sprite");break;case "zoomin":b.setAttribute("className","map-zoomin sprite");b.setAttribute("class","map-zoomin sprite");break;case "zoomout":b.setAttribute("className","map-zoomout sprite");b.setAttribute("class","map-zoomout sprite");break}return b};
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=[],g=0,j=d.length;g<j;g++)e.push(encodeURIComponent(d[g]));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){return OpenLayers.Util.Try(function(){return OpenLayers.Util._getNodes(a.documentElement.childNodes,b)},function(){return OpenLayers.Util._getNodes(a.childNodes,b)})};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=1/298.257223563,d=OpenLayers.Util.rad(b.lon-a.lon);a=Math.atan((1-c)*Math.tan(OpenLayers.Util.rad(a.lat)));var e=Math.atan((1-c)*Math.tan(OpenLayers.Util.rad(b.lat)));b=Math.sin(a);a=Math.cos(a);var g=Math.sin(e);e=Math.cos(e);for(var j=d,l=2*Math.PI,o=20;Math.abs(j-l)>1.0E-12&&--o>0;){var q=Math.sin(j),s=Math.cos(j),w=Math.sqrt(e*q*e*q+(a*g-b*e*s)*(a*g-b*e*s));if(w==0)return 0;s=b*g+a*e*s;var G=Math.atan2(w,s),C=Math.asin(a*e*q/w),B=Math.cos(C)*Math.cos(C);
q=s-2*b*g/B;var H=c/16*B*(4+c*(4-3*B));l=j;j=d+(1-H)*c*Math.sin(C)*(G+H*w*(q+H*s*(-1+2*q*q)))}if(o==0)return NaN;c=B*2.723316066819453E11/4.0408299984087055E13;d=c/1024*(256+c*(-128+c*(74-47*c)));return(6356752.3142*(1+c/16384*(4096+c*(-768+c*(320-175*c))))*(G-d*w*(q+d/4*(s*(-1+2*q*q)-d/6*q*(-3+4*w*w)*(-3+4*q*q))))).toFixed(3)/1E3};
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 g=decodeURIComponent(e[0]);e=e[1]||"";e=e.split(",");for(var j=0,l=e.length;j<l;j++)e[j]=decodeURIComponent(e[j]);if(e.length==1)e=e[0];a[g]=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:1E3/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":5E4/OpenLayers.METERS_PER_INCH,"150kilometers":15E4/OpenLayers.METERS_PER_INCH});
OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1E3,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:OpenLayers.INCHES_PER_UNIT.Meter*100,km:OpenLayers.INCHES_PER_UNIT.Meter*1E3,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>1?1/a:a};OpenLayers.Util.getResolutionFromScale=function(a,b){if(b==null)b="degrees";return 1/(OpenLayers.Util.normalizeScale(a)*OpenLayers.INCHES_PER_UNIT[b]*OpenLayers.DOTS_PER_INCH)};
OpenLayers.Util.getScaleFromResolution=function(a,b){if(b==null)b="degrees";return 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(g){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,g=document.createElement("div");g.style.visibility="hidden";var j=c&&c.containerElement?c.containerElement:document.body;if(b)if(b.w){d=b.w;g.style.width=d+"px"}else if(b.h){e=b.h;g.style.height=e+"px"}if(c&&c.displayClass)g.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"}g.appendChild(b);
j.appendChild(g);a=false;for(c=g.parentNode;c&&c.tagName.toLowerCase()!="body";){var l=OpenLayers.Element.getStyle(c,"position");if(l=="absolute"){a=true;break}else if(l&&l!="static")break;c=c.parentNode}if(!a)g.style.position="absolute";if(!d){d=parseInt(b.scrollWidth);g.style.width=d+"px"}e||(e=parseInt(b.scrollHeight));g.removeChild(b);j.removeChild(g);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="alpha(opacity="+
b*100+")";a.style.opacity=b;a.style.filter=c;a=a.parentNode.getElementsByTagName("span");for(var d=0;d<a.length;d++){a[d].style.opacity=b;a[d].style.filter=c}},reRound:function(a,b){var c=a.parentNode.childNodes[2];a.parentNode.removeChild(a.parentNode.childNodes[0]);a.parentNode.removeChild(c);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){b="1px solid "+this._borderColor(b);a.innerHTML="<div "+("style='"+("border-left: "+b)+";"+("border-right: "+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"),g=e.style;g.backgroundColor=a;g.display="block";g.height="1px";g.overflow="hidden";g.fontSize="1px";a=this._borderColor(a,b);if(this.options.border&&c==0){g.borderTopStyle="solid";g.borderTopWidth="1px";g.borderLeftWidth="0px";g.borderRightWidth=
"0px";g.borderBottomWidth="0px";g.height="0px";g.borderColor=a}else if(a){g.borderColor=a;g.borderStyle="solid";g.borderWidth="0px 1px"}if(!this.options.compact&&c==this.options.numSlices-1)g.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++)OpenLayers.Util.getElement(arguments[a]).style.display="none"},show:function(){for(var a=0,b=arguments.length;a<b;a++)OpenLayers.Util.getElement(arguments[a]).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(){return this.imageDiv&&this.imageDiv.parentNode&&this.imageDiv.parentNode.nodeType!=11},CLASS_NAME:"OpenLayers.Icon"});
OpenLayers.NewsOnDemandThumb=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,globalId:null,tooltip:null,titleProcessed:null,ie:false,inf_id:0,initialize:function(a,b,c,d,e,g,j){this.ie=j;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;this.inf_id=e;this.titleProcessed=g;globalId=a=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(a)},
destroy:function(){OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null},clone:function(){return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)},setSize:function(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,"","absolute");this.moveTo(a);this.imageDiv.getAttribute("id");this.imageDiv.setAttribute("class",
"thumb");this.imageDiv.innerHTML='<a class="request icon" href="/'+this.titleProcessed+'" id="matid-'+this.inf_id+'"></a>';return 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(){return this.imageDiv&&this.imageDiv.parentNode&&this.imageDiv.parentNode.nodeType!=11},CLASS_NAME:"OpenLayers.NewsOnDemandThumb"});
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,g){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;this.groupDiv=OpenLayers.Util.createDiv(this.id+"_GroupDiv",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(g);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).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});if(OpenLayers.Element.getStyle(this.contentDiv,"overflow")!="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(){for(var a=function(){this.popup.updateSize();this.popup.visible()&&this.popup.panMapIfOutOfView&&this.popup.panIntoView();OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad)},b=this.contentDiv.getElementsByTagName("img"),
c=0,d=b.length;c<d;c++){var e=b[c];if(e.width==0||e.height==0){e._onImgLoad=OpenLayers.Function.bind(a,{popup:this,img:e});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;a.w=Math.min(a.w,this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-c-b);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);OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(a||function(c){this.hide();OpenLayers.Event.stop(c)},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;this.map.pan(b.x-c.x,b.y-c.y)},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.Thumb=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,globalId:null,tooltip:null,titleProcessed:null,ie:false,initialize:function(a,b,c,d,e,g,j){this.ie=j;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;this.tooltip=e;this.titleProcessed=g;globalId=a=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(a)},
destroy:function(){OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null},clone:function(){return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)},setSize:function(a){if(a!=null)this.size=a;this.draw()},setUrl:function(a){if(a!=null)this.url=a;this.draw()},draw:function(a){var b=this.imageDiv;if(a!=null)this.px=a;if(b!=null)if(this.px==null)this.display(false);else{if(this.calculateOffset)this.offset=this.calculateOffset(this.size);
a=this.px.offset(this.offset);b.style.cssText+=";top:"+a.y+"px;left:"+a.x+"px"}b.innerHTML='<a class="mapthumb icon dot" href="/'+this.titleProcessed+'" thumb="'+this.url+'" tooltip="'+this.tooltip+'"></a>';return b},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(){return this.imageDiv&&this.imageDiv.parentNode&&this.imageDiv.parentNode.nodeType!=11},CLASS_NAME:"OpenLayers.Thumb"});
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 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;if(b.CLASS_NAME=="OpenLayers.LonLat"){c=b.lon;b=b.lat}else{c=b.x;b=b.y}return new OpenLayers.Bounds((this.left-c)*a+c,(this.bottom-b)*a+b,(this.right-c)*a+c,(this.top-b)*a+b)},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.top>=this.bottom&&a.top<=this.top||this.top>a.bottom&&this.top<a.top;c=a.left>=this.left&&a.left<=this.right||this.left>=a.left&&this.left<=a.right;d=a.right>=this.left&&a.right<=this.right||this.right>=a.left&&this.right<=a.right;c=(a.bottom>=this.bottom&&a.bottom<=this.top||this.bottom>=a.bottom&&this.bottom<=a.top||b)&&(c||d)}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),g=this.contains(a.left,a.top,c);a=this.contains(a.right,a.top,c);return b?d||e||g||a:d&&e&&g&&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()][a];c||(c=a);if(b)c=OpenLayers.String.format(c,b);return c}};OpenLayers.i18n=OpenLayers.Lang.translate;
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(){return!!document.createElement("canvas").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;c.onload=OpenLayers.Function.bind(function(){this.canvas.drawImage(this.img,this.x,this.y,this.width,this.height)},{img:c,x:a[0]+(b.graphicXOffset!=undefined?b.graphicXOffset:-(0.5*d)),y:a[1]+(b.graphicYOffset!=undefined?b.graphicYOffset:-(0.5*e)),
width:d,height:e,canvas:this.canvas})},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;return[a.x/b+-c.left/b,c.top/b-a.y/b]},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)).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);if(this.compare(this,a,OpenLayers.Util.getElement(this.order[e]))>
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];this.maxZIndex=this.order.length>0?this.indices[this.order[this.order.length-1]]: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-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 g=a.components.length;d<g;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;return(c?c:b||a.srcElement)._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=OpenLayers.Util.getElement(a.id+this.BACKGROUND_ID_SUFFIX))&&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.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");a[b]=this.easing.apply(this,[this.time,c,d-c,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.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,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(){for(OpenLayers.Control.prototype.destroy.apply(this,arguments);this.buttons.length;){var a=this.buttons.shift();a.map=null;OpenLayers.Event.stopObservingElement(a)}this.position=this.buttons=null},
draw:function(a){OpenLayers.Control.prototype.draw.apply(this,arguments);a=this.position;a.x+=10;a.y+=15;this.buttons=[];var b=new OpenLayers.Size(18,18),c=new OpenLayers.Pixel(a.x+b.w/2,a.y);this._addSpriteButton("panup",{x:-60,y:-336},c,new OpenLayers.Size(25,22));a.y=c.y+b.h;a.x-=8;this._addSpriteButton("panleft",{x:-100,y:-336},a,new OpenLayers.Size(22,25));this._addSpriteButton("zoomworld",{x:-160,y:-336},c.add(0,a.y-19),new OpenLayers.Size(20,20));a.x+=16;this._addSpriteButton("panright",{x:0,
y:-336},a.add(b.w,0),new OpenLayers.Size(22,25));this._addSpriteButton("pandown",{x:-80,y:-336},c.add(0,b.h*2),new OpenLayers.Size(25,24));this._addSpriteButton("zoomin",{x:-140,y:-336},c.add(0,b.h*3+5),new OpenLayers.Size(25,22));this._addSpriteButton("zoomout",{x:-120,y:-336},c.add(0,b.h*4+5),new OpenLayers.Size(25,23));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;c.slideFactor=this.slideFactor;this.buttons.push(c);return c},_addSpriteButton:function(a,b,c,d){b=OpenLayers.Util.createSpriteDiv(this.id+"_"+a,c,d,b,"absolute");this.div.appendChild(b);
OpenLayers.Event.observe(b,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,b));OpenLayers.Event.observe(b,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,b));OpenLayers.Event.observe(b,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,b));b.action=a;b.map=this.map;b.slideFactor=this.slideFactor;this.buttons.push(b);return b},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.slideFactor);break;case "pandown":this.map.pan(0,this.slideFactor);break;case "panleft":this.map.pan(-this.slideFactor,0);break;case "panright":this.map.pan(this.slideFactor,0);break;case "zoomin":this.map.zoomIn();for(var b=0;b<this.map.controls.length;b++)this.map.controls[b].displayClass=="olControlNavigation"&&this.map.controls[b].activate();break;case "zoomout":this.map.zoom>2&&this.map.zoomOut();break;case "zoomworld":Map.setCenter(0,3,2);break}OpenLayers.Event.stop(a)}},CLASS_NAME:"OpenLayers.Control.PanZoom"});
OpenLayers.Control.PanZoom.X=4;OpenLayers.Control.PanZoom.Y=4;
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)._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];OpenLayers.Event.stopObserving.apply(this,new Array(c.element,c.name,c.observer,c.useCapture))}},
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 g=false,j=OpenLayers.Event.observers[e];if(j)for(var l=0;!g&&l<j.length;){var o=j[l];if(o.name==b&&o.observer==c&&o.useCapture==d){j.splice(l,1);j.length==0&&delete OpenLayers.Event.observers[e];g=true;break}l++}if(g)if(a.removeEventListener)a.removeEventListener(b,c,d);else a&&a.detachEvent&&a.detachEvent("on"+
b,c);return g},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var a in OpenLayers.Event.observers)OpenLayers.Event._removeElementObservers.apply(this,[OpenLayers.Event.observers[a]]);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;this.listeners[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:"Base Layer",sameProjection:"The overview map only works when it is in the same projection as the main map",readNotImplemented:"Read not implemented.",writeNotImplemented:"Write not implemented.",noFID:"Can't update a feature for which there is no FID.",errorLoadingGML:"Error in loading GML file ${url}",browserNotSupported:"Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}",
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.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:15E3,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(){return document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#SVG","1.1")||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#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;this.rendererRoot.setAttributeNS(null,"viewBox","0 0 "+this.size.w+" "+this.size.h);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,g;if(a._geometryClass=="OpenLayers.Geometry.Point"&&d){a.style.visibility="";if(b.graphic===false)a.style.visibility="hidden";else if(b.externalGraphic){g=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 j=b.graphicHeight||b.graphicWidth;d=d?d:b.pointRadius*2;j=j?j:b.pointRadius*2;var l=b.graphicYOffset!=undefined?b.graphicYOffset:-(0.5*j),o=b.graphicOpacity||b.fillOpacity;a.setAttributeNS(null,"x",(g.x+(b.graphicXOffset!=undefined?b.graphicXOffset:-(0.5*d))).toFixed());a.setAttributeNS(null,"y",(g.y+l).toFixed());a.setAttributeNS(null,
"width",d);a.setAttributeNS(null,"height",j);a.setAttributeNS(this.xlinkns,"href",b.externalGraphic);a.setAttributeNS(null,"style","opacity: "+o)}else if(this.isComplexSymbol(b.graphicName)){d=b.pointRadius*3;j=d*2;e=this.importSymbol(b.graphicName);l="#"+e;g=this.getPosition(a);e=this.symbolSize[e]/j;o=a.parentNode;var q=a.nextSibling;o&&o.removeChild(a);a.setAttributeNS(this.xlinkns,"href",l);a.setAttributeNS(null,"width",j);a.setAttributeNS(null,"height",j);a.setAttributeNS(null,"x",g.x-d);a.setAttributeNS(null,
"y",g.y-d);if(q)o.insertBefore(a,q);else o&&o.appendChild(a)}else a.setAttributeNS(null,"r",b.pointRadius);if(typeof b.rotation!="undefined"&&g){g=OpenLayers.String.format("rotate(${0} ${1} ${2})",[b.rotation,g.x,g.y]);a.setAttributeNS(null,"transform",g)}}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,g,j,l=0,o=b.components.length;l<o;l++){c+=" M";g=this.getComponentsString(b.components[l].components," ");if(j=g.path){c+=" "+j;e=g.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,g=b.components.length;e<g;e++)if(e%
3==0&&e/3==0){var j=this.getShortString(b.components[e]);j||(d=false);c="M "+j}else if(e%3==1){(j=this.getShortString(b.components[e]))||(d=false);c+=" C "+j}else{(j=this.getShortString(b.components[e]))||(d=false);c+=" "+j}c+=" Z";if(d){a.setAttributeNS(null,"d",c);return a}else return false},drawText:function(a,b,c){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%");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,g=[],j,l=0;l<e;l++){j=a[l];c.push(j);if(j=this.getShortString(j))g.push(j);else{l>0&&this.getShortString(a[l-1])&&g.push(this.clipLine(a[l],a[l-1]));l<e-1&&this.getShortString(a[l+1])&&g.push(this.clipLine(a[l],a[l+1]));d=false}}return{path:g.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,g=b.x/c+this.left;b=this.top-b.y/c;var j=a.x/c+this.left;a=this.top-a.y/c;if(j<-d||j>d){c=(a-b)/(j-g);j=j<0?-d:d;a=b+(j-g)*c}if(a<-e||a>e){c=(j-g)/(a-b);a=a<0?-e:e;j=g+(a-b)*c}return j+","+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),g="",j,l,o=0;o<c.length;o+=2){j=c[o];
l=c[o+1];e.left=Math.min(e.left,j);e.bottom=Math.min(e.bottom,l);e.right=Math.max(e.right,j);e.top=Math.max(e.top,l);g+=" "+j+","+l}d.setAttributeNS(null,"points",g);c=e.getWidth();d=e.getHeight();a.setAttributeNS(null,"viewBox",[e.left-c,e.bottom-d,c*3,d*3].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}this.root.coordorigin=d+" "+c;d=[this.root,this.vectorRoot,this.textRoot];for(var e=0,g=d.length;e<
g;++e){c=d[e];c.coordsize=this.size.w+" "+this.size.h}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,g=a.length;e<g;++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,
g=b.graphicHeight||b.graphicWidth;e=e?e:b.pointRadius*2;g=g?g:b.pointRadius*2;var j=this.getResolution(),l=b.graphicXOffset!=undefined?b.graphicXOffset:-(0.5*e),o=b.graphicYOffset!=undefined?b.graphicYOffset:-(0.5*g);a.style.left=(d.x/j-this.offset.x+l).toFixed();a.style.top=(d.y/j-this.offset.y-(o+g)).toFixed();a.style.width=e+"px";a.style.height=g+"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,l,o);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;l=a.getElementsByTagName("stroke");l=l.length==0?null:l[0];if(c.isStroked){if(!l){l=this.createNode("olv:stroke",a.id+"_stroke");a.appendChild(l)}l.opacity=
b.strokeOpacity;l.endcap=!b.strokeLinecap||b.strokeLinecap=="butt"?"flat":b.strokeLinecap;l.dashstyle=this.dashStyle(b)}else l&&a.removeChild(l);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,g;if(d.graphicWidth&&d.graphicHeight){g=Math.max(d.graphicWidth,d.graphicHeight);e=d.graphicWidth/d.graphicHeight;var j=Math.round(d.graphicWidth||g*e),l=Math.round(d.graphicHeight||g);a.style.width=j+"px";a.style.height=l+"px";var o=
document.getElementById(a.id+"_image");if(!o){o=this.createNode("olv:imagedata",a.id+"_image");a.appendChild(o)}o.style.width=j+"px";o.style.height=l+"px";o.src=d.externalGraphic;o.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";var q=d.rotation*Math.PI/180;o=Math.sin(q);q=Math.cos(q);o="progid:DXImageTransform.Microsoft.Matrix(M11="+q+",M12="+-o+",M21="+o+",M22="+q+",SizingMethod='auto expand')\n";if((q=d.graphicOpacity||d.fillOpacity)&&q!=1)o+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+
q+")\n";a.style.filter=o;o=new OpenLayers.Geometry.Point(-b,-c);j=(new OpenLayers.Bounds(0,0,j,l)).toGeometry();j.rotate(d.rotation,o);j=j.getBounds();a.style.left=Math.round(parseInt(a.style.left)+j.left)+"px";a.style.top=Math.round(parseInt(a.style.top)-j.bottom)+"px"}else{var s=new Image;s.onreadystatechange=OpenLayers.Function.bind(function(){if(s.readyState=="complete"||s.readyState=="interactive"){e=s.width/s.height;g=Math.max(d.pointRadius*2,d.graphicWidth||0,d.graphicHeight||0);b*=e;d.graphicWidth=
g*e;d.graphicHeight=g;this.graphicRotate(a,b,c)}},this);s.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,g=new Array(e),
j,l,o=0;o<e;o++){j=b.components[o];l=j.x/d-this.offset.x;j=j.y/d-this.offset.y;g[o]=" "+l.toFixed()+","+j.toFixed()+" l "}b=c?" x e":" e";a.path="m"+g.join("")+b;return a},drawPolygon:function(a,b){this.setNodeDimension(a,b);var c=this.getResolution(),d=[],e,g,j,l,o,q,s;j=0;for(l=b.components.length;j<l;j++){e=b.components[j];d.push("m");g=0;for(o=e.components.length;g<o;g++){q=e.components[g];s=q.x/c-this.offset.x;q=q.y/c-this.offset.y;d.push(" "+s.toFixed()+","+q.toFixed());g==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,g,j=0,l=b.components.length;j<l;j++){e=b.components[j];g=e.x/c-this.offset.x;e=e.y/c-this.offset.y;if(j%3==0&&j/3==0)d.push("m");else j%3==1&&d.push(" c");d.push(" "+g+","+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&&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 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.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(g,j){if(j&&typeof j==="object")for(var l in j)if(j.hasOwnProperty(l))j[l]=
d(l,j[l]);return b(g,j)}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,g=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){g&&b.push(",");b.push(this.writeNewline(),this.writeIndent(),
d,":",this.writeSpace(),e);g=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.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;return((a.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(a.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(a.altKey?
OpenLayers.Handler.MOD_ALT:0))==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:1E3},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);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,g=d.length;e<g;++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(g=this.controls.length;e<g;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 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++)this.setLayerZIndex(this.layers[a],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){this.getLonLatFromViewPortPx(new OpenLayers.Pixel(a.w/2,a.h/2));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();a.lon==b.lon&&a.lat==b.lat||this.panTween.start({lon:b.lon,lat:b.lat},{lon:a.lon,lat:a.lat},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,g=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 j=this.restrictedExtent.getCenterLonLat();if(c.getWidth()>this.restrictedExtent.getWidth())a=new OpenLayers.LonLat(j.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,j.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&&!g&&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++){j=this.layers[b];if(j!==this.baseLayer&&!j.isBaseLayer){var l=j.calculateInRange();if(j.inRange!=l){(j.inRange=l)||j.display(false);this.events.triggerEvent("changelayer",
{layer:j,property:"visibility"})}if(l&&j.visibility){j.moveTo(a,e,d);d?j.events.triggerEvent("move"):j.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&&!g&&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().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();a=OpenLayers.Util.getScaleFromResolution(a,this.baseLayer.units)}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){this.zoomToExtent(this.getMaxExtent({restricted:a?a.restricted:true}))},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();this.zoomToExtent(new OpenLayers.Bounds(d.lon-a/2,d.lat-c/2,d.lon+a/2,d.lat+c/2),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){return this.getLayerPxFromViewPortPx(this.getPixelFromLonLat(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&&this.icon.erase()},moveTo:function(a){a!=null&&this.icon!=null&&this.icon.moveTo(a);this.lonlat=this.map.getLonLatFromLayerPx(a)},isDrawn:function(){return this.icon&&this.icon.isDrawn()},onScreen:function(){var a=false;if(this.map)a=this.map.getExtent().containsLonLat(this.lonlat);return a},inflate:function(a){this.icon&&this.icon.setSize(new OpenLayers.Size(this.icon.size.w*a,this.icon.size.h*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=new OpenLayers.Size(20,28);return new OpenLayers.Icon("/img/marker.png",a,null,function(b){return new OpenLayers.Pixel(-(b.w/2),-b.h)})};
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 g in a.headers)c.setRequestHeader(g,a.headers[g]);var j=a.scope?OpenLayers.Function.bind(a.callback,a.scope):a.callback,l;if(a.success)l=a.scope?OpenLayers.Function.bind(a.success,a.scope):a.success;var o;if(a.failure)o=a.scope?OpenLayers.Function.bind(a.failure,a.scope):a.failure;var q=
this.events;c.onreadystatechange=function(){if(c.readyState==OpenLayers.Request.XMLHttpRequest.DONE)if(q.triggerEvent("complete",{request:c,config:a,requestUrl:d})!==false){j(c);if(!c.status||c.status>=200&&c.status<300){q.triggerEvent("success",{request:c,config:a,requestUrl:d});l&&l(c)}if(c.status&&(c.status<200||c.status>=300)){q.triggerEvent("failure",{request:c,config:a,requestUrl:d});o&&o(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&&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;var c=function(){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));OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(function(){this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS&&
c.call(this)},this))},checkImgURL:function(){if(this.layer)OpenLayers.Util.isEquivalentUrl(this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src,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().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)if(Math.sqrt(Math.pow(this.down.x-
a.xy.x,2)+Math.pow(this.down.y-a.xy.y,2))>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)Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2))<=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(){this.layer.setZIndex(Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1)},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{var g=e.currentStyle?e.currentStyle.overflow:document.defaultView.getComputedStyle(e,null).getPropertyValue("overflow");b=g&&g=="auto"||g=="scroll"}catch(j){}if(!c){d=0;for(var l=this.map.layers.length;d<l;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){this.moveTo(b,true,false);this.events.triggerEvent("moveend",
{zoomChanged:true});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();this.div.style.display=this.visibility&&this.inRange?"":"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,g=a.length;e<g;e++){var j=a[e];if(this.options[j]&&OpenLayers.Util.indexOf(b,
j)==-1)c=true;d[j]=this.options[j]||this.map[j]}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(g=d.scales.length;e<g;e++)d.resolutions[e]=
OpenLayers.Util.getResolutionFromScale(d.scales[e],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"){a=this.map.getSize();e=d.maxExtent.getWidth()/a.w;a=d.maxExtent.getHeight()/a.h;d.maxResolution=Math.max(e,a)}if(d.maxScale!=null)d.minResolution=OpenLayers.Util.getResolutionFromScale(d.maxScale,d.units);else if(d.minResolution=="auto"&&d.minExtent!=null){a=this.map.getSize();
e=d.minExtent.getWidth()/a.w;a=d.minExtent.getHeight()/a.h;d.minResolution=Math.max(e,a)}if(d.minResolution!=null&&this.options.numZoomLevels==undefined)d.numZoomLevels=Math.floor(Math.log(d.maxResolution/d.minResolution)/Math.log(2))+1;d.resolutions=new Array(d.numZoomLevels);a=2;if(typeof d.minResolution=="number"&&d.numZoomLevels>1)a=Math.pow(d.maxResolution/d.minResolution,1/(d.numZoomLevels-1));b=d.numZoomLevels;c=d.maxResolution;g=d.resolutions;for(e=0;e<b;e++)g[e]=c/Math.pow(a,e)}d.resolutions.sort(function(l,
o){return o-l});this.resolutions=d.resolutions;this.maxResolution=d.resolutions[0];this.minResolution=d.resolutions[d.resolutions.length-1];this.scales=[];e=0;for(g=d.resolutions.length;e<g;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(){return this.getResolutionForZoom(this.map.getZoom())},getExtent:function(){return this.map.calculateBounds()},
getZoomForExtent:function(a,b){var c=this.map.getSize();return this.getZoomForResolution(Math.max(a.getWidth()/c.w,a.getHeight()/c.h),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;for(var c=
this.resolutions[b],d=this.resolutions[this.resolutions.length-1],e,g=0,j=this.resolutions.length;g<j;++g){e=this.resolutions[g];if(e>=a){c=e;b=g}if(e<=a){d=e;break}}g=c-d;a=g>0?b+(c-a)/g:b}else{d=Number.POSITIVE_INFINITY;g=0;for(j=this.resolutions.length;g<j;g++)if(b){c=Math.abs(this.resolutions[g]-a);if(c>d)break;d=c}else if(this.resolutions[g]<a)break;a=Math.max(0,g-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();
b=new OpenLayers.LonLat(d.lon+(a.x-c.w/2)*b,d.lat-(a.y-c.h/2)*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)OpenLayers.Util.modifyDOMElement(this.div.childNodes[b].firstChild,null,null,null,
null,null,null,a)}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(a){this.div.style.zIndex=this.name=="Markers"?800: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(){function a(){this._object=g?new g:new window.ActiveXObject("Microsoft.XMLHTTP")}function b(o){o.onreadystatechange&&o.onreadystatechange.apply(o);a.onreadystatechange&&a.onreadystatechange.apply(o)}function c(o){var q=o.responseXML;if(l&&q&&!q.documentElement&&o.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){q=new ActiveXObject("Microsoft.XMLDOM");q.loadXML(o.responseText)}if(q)if(l&&q.parseError!=0||q.documentElement&&q.documentElement.tagName=="parsererror")return null;
return q}function d(o){try{o.responseText=o._object.responseText}catch(q){}try{o.responseXML=c(o._object)}catch(s){}try{o.status=o._object.status}catch(w){}try{o.statusText=o._object.statusText}catch(G){}}function e(o){o._object.onreadystatechange=new window.Function;delete o._headers}var g=window.XMLHttpRequest,j=!!window.controllers,l=window.document.all&&!window.opera;if(j&&g.wrapped)a.wrapped=g.wrapped;a.UNSENT=0;a.OPENED=1;a.HEADERS_RECEIVED=2;a.LOADING=3;a.DONE=4;a.prototype.readyState=a.UNSENT;
a.prototype.responseText="";a.prototype.responseXML=null;a.prototype.status=0;a.prototype.statusText="";a.prototype.onreadystatechange=null;a.onreadystatechange=null;a.onopen=null;a.onsend=null;a.onabort=null;a.prototype.open=function(o,q,s,w,G){this._async=s;var C=this,B=this.readyState;if(l){var H=function(){C._object.readyState!=a.DONE&&e(C)};s&&window.attachEvent("onunload",H)}this._object.onreadystatechange=function(){if(!(j&&!s)){C.readyState=C._object.readyState;d(C);if(C._aborted)C.readyState=
a.UNSENT;else{if(C.readyState==a.DONE){e(C);l&&s&&window.detachEvent("onunload",H)}B!=C.readyState&&b(C);B=C.readyState}}};a.onopen&&a.onopen.apply(this,arguments);this._object.open(o,q,s,w,G);if(!s&&j){this.readyState=a.OPENED;b(this)}};a.prototype.send=function(o){a.onsend&&a.onsend.apply(this,arguments);if(o&&o.nodeType){o=window.XMLSerializer?(new window.XMLSerializer).serializeToString(o):o.xml;this._headers["Content-Type"]||this._object.setRequestHeader("Content-Type","application/xml")}this._object.send(o);
if(j&&!this._async){this.readyState=a.OPENED;for(d(this);this.readyState<a.DONE;){this.readyState++;b(this);if(this._aborted)return}}};a.prototype.abort=function(){a.onabort&&a.onabort.apply(this,arguments);if(this.readyState>a.UNSENT)this._aborted=true;this._object.abort();e(this)};a.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};a.prototype.getResponseHeader=function(o){return this._object.getResponseHeader(o)};a.prototype.setRequestHeader=function(o,q){if(!this._headers)this._headers=
{};this._headers[o]=q;return this._object.setRequestHeader(o,q)};a.prototype.toString=function(){return"[object XMLHttpRequest]"};a.toString=function(){return"[XMLHttpRequest]"};if(!window.Function.prototype.apply)window.Function.prototype.apply=function(o,q){q||(q=[]);o.__func=this;o.__func(q[0],q[1],q[2],q[3],q[4]);delete o.__func};OpenLayers.Request.XMLHttpRequest=a})();
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 b=b.toGeometry().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 g=this.getBoxCharacteristics();if(g.newBoxModel){if(a.x>b)this.zoomBox.style.width=Math.max(1,d-g.xOffset)+"px";if(a.y>c)this.zoomBox.style.height=Math.max(1,e-g.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.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 this.div.appendChild(a.draw(b))},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++)a.extend(this.markers[b].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=0;a<=this.MAX_ZOOM_LEVEL;++a)this.RESOLUTIONS[a]=156543.0339/Math.pow(2,a);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.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,g=d.lat-c.getHeight()/2*b;b=d.lat+c.getHeight()/2*b;b=new OpenLayers.Bounds(a,g,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++)b[a].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 g=0,j=a.length;g<j;++g){d&&g>0&&e.push(",");b=a[g].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.Boxes=OpenLayers.Class(OpenLayers.Layer.Markers,{initialize:function(){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments)},drawMarker:function(a){var b=a.bounds,c=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(b.left,b.top));b=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(b.right,b.bottom));if(b==null||c==null)a.display(false);else{b=new OpenLayers.Size(Math.max(1,b.x-c.x),Math.max(1,b.y-c.y));c=a.draw(c,b);if(!a.drawn){this.div.appendChild(c);a.drawn=
true}}},removeMarker:function(a){OpenLayers.Util.removeItem(this.markers,a);a.div!=null&&a.div.parentNode==this.div&&this.div.removeChild(a.div)},CLASS_NAME:"OpenLayers.Layer.Boxes"});
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 g=c[d];this.removeTileMonitoringHooks(g);g.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(){OpenLayers.Console.warn("The getGridBounds() function is deprecated. It will be removed in 3.0. Please use getTilesBounds() instead.");
return this.getTilesBounds()},getTilesBounds:function(){var a=null;if(this.grid.length){a=this.grid[this.grid.length-1][0];var b=this.grid[0][this.grid[0].length-1];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=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(b.left,b.top));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,g=Math.floor(e/d)-this.buffer;e=-(e/d-g)*this.tileSize.w;g=b.left+g*d;a=a.top-(b.bottom+c);var j=Math.ceil(a/c)+this.buffer;return{tilelon:d,tilelat:c,tileoffsetlon:g,tileoffsetlat:b.bottom+j*c,tileoffsetx:e,tileoffsety:-(j-a/c)*this.tileSize.h}},
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(),g=this.calculateGridLayout(a,d,e);d=Math.round(g.tileoffsetx);e=Math.round(g.tileoffsety);var j=g.tileoffsetlon,l=g.tileoffsetlat,o=g.tilelon;g=g.tilelat;this.origin=new OpenLayers.Pixel(d,e);var q=d,s=j,w=0,G=parseInt(this.map.layerContainerDiv.style.left),C=parseInt(this.map.layerContainerDiv.style.top);
do{var B=this.grid[w++];if(!B){B=[];this.grid.push(B)}j=s;d=q;var H=0;do{var i=new OpenLayers.Bounds(j,l,j+o,l+g),M=d;M-=G;var L=e;L-=C;M=new OpenLayers.Pixel(M,L);if(L=B[H++])L.moveTo(i,M,false);else{L=this.addTile(i,M);this.addTileMonitoringHooks(L);B.push(L)}j+=o;d+=this.tileSize.w}while(j<=a.right+o*this.buffer||H<b);l-=g;e+=this.tileSize.h}while(l>=a.bottom-g*this.buffer||w<c);this.removeExcessTiles(w,H);this.spiralTileLoad()},spiralTileLoad:function(){for(var a=[],b=["right","down","left","up"],
c=0,d=-1,e=OpenLayers.Util.indexOf(b,"right"),g=0;g<b.length;){var j=c,l=d;switch(b[e]){case "right":l++;break;case "down":j++;break;case "left":l--;break;case "up":j--;break}var o=null;if(j<this.grid.length&&j>=0&&l<this.grid[0].length&&l>=0)o=this.grid[j][l];if(o!=null&&!o.queued){a.unshift(o);o.queued=true;g=0;c=j;d=l}else{e=(e+1)%4;g++}}b=0;for(c=a.length;b<c;b++){o=a[b];o.draw();o.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;;){var b=this.map.getViewPortPxFromLayerPx(this.grid[0][0].position);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=this.grid,c=b[a?0:this.grid.length-1],d=this.map.getResolution(),e=a?-this.tileSize.h:this.tileSize.h;d=d*-e;for(var g=a?b.pop():b.shift(),j=0,l=c.length;j<l;j++){var o=
c[j],q=o.bounds.clone();o=o.position.clone();q.bottom+=d;q.top+=d;o.y+=e;g[j].moveTo(q,o)}a?b.unshift(g):b.push(g)},shiftColumn:function(a){for(var b=a?-this.tileSize.w:this.tileSize.w,c=this.map.getResolution()*b,d=0,e=this.grid.length;d<e;d++){var g=this.grid[d],j=g[a?0:g.length-1],l=j.bounds.clone();j=j.position.clone();l.left+=c;l.right+=c;j.x+=b;var o=a?this.grid[d].pop():this.grid[d].shift();o.moveTo(l,j);a?g.unshift(o):g.push(o)}},removeExcessTiles:function(a,b){for(;this.grid.length>a;)for(var c=
this.grid.pop(),d=0,e=c.length;d<e;d++){var g=c[d];this.removeTileMonitoringHooks(g);g.destroy()}for(;this.grid[0].length>b;){d=0;for(e=this.grid.length;d<e;d++){c=this.grid[d];g=c.pop();this.removeTileMonitoringHooks(g);g.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.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){function c(H){for(var i=H.features?H.features.length:0,M=new Array(i),L=0;L<i;++L)M[L]=H.features[L].fid;B.insertIds=M;d.apply(this,[H])}function d(H){this.callUserCallback(H,b);C=C&&H.success();g++;if(g>=G)if(b.callback){B.code=C?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;
b.callback.apply(b.scope,[B])}}b=OpenLayers.Util.applyDefaults(b,this.options);var e=[],g=0,j={};j[OpenLayers.State.INSERT]=[];j[OpenLayers.State.UPDATE]=[];j[OpenLayers.State.DELETE]=[];for(var l,o,q=[],s=0,w=a.length;s<w;++s){l=a[s];if(o=j[l.state]){o.push(l);q.push(l)}}var G=(j[OpenLayers.State.INSERT].length>0?1:0)+j[OpenLayers.State.UPDATE].length+j[OpenLayers.State.DELETE].length,C=true,B=new OpenLayers.Protocol.Response({reqFeatures:q});a=j[OpenLayers.State.INSERT];a.length>0&&e.push(this.create(a,
OpenLayers.Util.applyDefaults({callback:c,scope:this},b.create)));a=j[OpenLayers.State.UPDATE];for(s=a.length-1;s>=0;--s)e.push(this.update(a[s],OpenLayers.Util.applyDefaults({callback:d,scope:this},b.update)));a=j[OpenLayers.State.DELETE];for(s=a.length-1;s>=0;--s)e.push(this["delete"](a[s],OpenLayers.Util.applyDefaults({callback:d,scope:this},b["delete"])));return e},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=[],g=false,j=0,l=c.length;j<l;j++){d=c[j];if(d.evaluate(a))if(d instanceof OpenLayers.Rule&&d.elseFilter)e.push(d);else{g=true;this.applySymbolizer(d,b,a)}}if(g==false&&e.length>0){g=true;j=0;for(l=e.length;j<l;j++)this.applySymbolizer(e[j],b,a)}if(c.length>0&&g==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={};this.addPropertyStyles(a,this.defaultStyle);for(var b=this.rules,c,d,e=0,g=b.length;e<g;e++){c=b[e].symbolizer;for(var j in c){d=c[j];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};this.handlers.click=new OpenLayers.Handler.Click(this,{dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick},{"double":true,stopDouble:true});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){this.map.setCenter(this.map.getLonLatFromViewPortPx(a.xy),this.map.zoom+1)},defaultDblRightClick:function(a){this.map.setCenter(this.map.getLonLatFromViewPortPx(a.xy),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);this.map.setCenter(new OpenLayers.LonLat(a.lon+d*
e,a.lat+c*e),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){this.getBounds()?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;if(this.getBounds()!=null&&a!=null){b=b!=null?b:0;c=c!=null?c:0;d=(new OpenLayers.Bounds(this.bounds.left-b,this.bounds.bottom-c,this.bounds.right+b,this.bounds.top+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,g=a.x1-b.x1,j=a.y1-b.y1,l=a.x2-a.x1,o=a.y2-a.y1,q=b.y2-b.y1,s=b.x2-b.x1,w=q*l-s*o;q=s*j-q*g;j=l*j-o*g;if(w==0){if(q==0&&j==0)e=true}else{g=q/w;w=j/w;if(g>=0&&g<=1&&w>=0&&w<=1)if(d){l=a.x1+g*l;w=a.y1+g*o;e=new OpenLayers.Geometry.Point(l,w)}else e=true}if(c)if(e){if(d){a=[a,b];b=0;a:for(;b<2;++b){g=a[b];for(o=1;o<3;++o){l=g["x"+o];w=g["y"+o];d=Math.sqrt(Math.pow(l-e.x,2)+Math.pow(w-e.y,2));if(d<c){e.x=
l;e.y=w;break a}}}}}else{a=[a,b];b=0;a:for(;b<2;++b){l=a[b];w=a[(b+1)%2];for(o=1;o<3;++o){g={x:l["x"+o],y:l["y"+o]};j=OpenLayers.Geometry.distanceToSegment(g,w);if(j.distance<c){e=d?new OpenLayers.Geometry.Point(g.x,g.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,g=b.x2;b=b.y2;var j=g-d,l=b-e,o=(j*(c-d)+l*(a-e))/(Math.pow(j,2)+Math.pow(l,2));if(o<=0){d=d;e=e}else if(o>=1){d=g;e=b}else{d=d+o*j;e=e+o*l}return{distance:Math.sqrt(Math.pow(d-c,2)+Math.pow(e-a,2)),x:d,y:e}};
OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(a,b,c,d){var e=[];e.push(a,b,c,d);OpenLayers.Layer.Grid.prototype.initialize.apply(this,e);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);if(d==null||d.isBaseLayer==null)this.isBaseLayer=this.params.transparent!="true"&&this.params.transparent!=true},clone:function(a){if(a==null)a=new OpenLayers.Layer.MapServer(this.name,this.url,this.params,
this.options);return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a])},addTile:function(a,b){return new OpenLayers.Tile.Image(this,b,a,null,this.tileSize)},getURL:function(a){a=this.adjustBounds(a);a=[a.left,a.bottom,a.right,a.top];var b=this.getImageSize();return this.getFullRequestString({mapext:a,imgext:a,map_size:[b.w,b.h],imgx:b.w/2,imgy:b.h/2,imgxy:[b.w,b.h]})},getFullRequestString:function(a,b){b=b==null?this.url:b;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;a=a.replace(/,/g,"+");if(a!=""){c=b.charAt(b.length-1);d+=c=="&"||c=="?"?a:b.indexOf("?")==-1?"?"+a:"&"+a}return d},CLASS_NAME:"OpenLayers.Layer.MapServer"});
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.serviceVersion+"/"+this.layername+"/"+(this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,b):this.map.getZoom())+"/"+c+"/"+a+"."+this.type;c=this.url;if(c instanceof Array)c=this.selectUrl(b,c);return c+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.map.maxExtent.left,this.map.maxExtent.bottom)},CLASS_NAME:"OpenLayers.Layer.TMS"});
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 g in c)e.push(new OpenLayers.Rule({symbolizer:c[g],context:d,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:b,value:g})}));this.styles[a].addRules(e)},
CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Control.NavToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.Navigation,new OpenLayers.Control.ZoomBox])},draw:function(){var a=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);this.activateControl(this.controls[0]);return a},CLASS_NAME:"OpenLayers.Control.NavToolbar"});
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")).test(a[this.property]);break}return b},value2regex:function(a,b,c){if(a=="."){OpenLayers.Console.error("'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison");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){for(var c=!(b&&b.edge===false)&&b&&b.details,d,e,g=Number.POSITIVE_INFINITY,j=0,l=this.components.length;j<l;++j){d=
this.components[j].distanceTo(a,b);distance=c?d.distance:d;if(distance<g){g=distance;e=d;if(g==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++)this.components[c].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)&&b&&b.details,d,e,g;if(a instanceof
OpenLayers.Geometry.Point){b=this.x;d=this.y;e=a.x;g=a.y;a=Math.sqrt(Math.pow(b-e,2)+Math.pow(d-g,2));b=!c?a:{x0:b,y0:d,x1:e,y1:g,distance:a}}else{b=a.distanceTo(this,b);if(c)b={x0:b.x1,y0:b.y1,x1:b.x0,y1:b.y0,distance:b.distance}}return b},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.MapServer.Untiled=OpenLayers.Class(OpenLayers.Layer.MapServer,{singleTile:true,initialize:function(){OpenLayers.Layer.MapServer.prototype.initialize.apply(this,arguments);OpenLayers.Console.warn("The OpenLayers.Layer.MapServer.Untiled class is deprecated and will be removed in 3.0. Instead, you should use the normal OpenLayers.Layer.MapServer class, passing it the option 'singleTile' as true.")},clone:function(a){if(a==null)a=new OpenLayers.Layer.MapServer.Untiled(this.name,this.url,
this.params,this.options);return a=OpenLayers.Layer.MapServer.prototype.clone.apply(this,[a])},CLASS_NAME:"OpenLayers.Layer.MapServer.Untiled"});
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";d=this.renderer.setExtent(this.map.getExtent(),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 e in this.unrenderedFeatures){var g=this.unrenderedFeatures[e];this.drawFeature(g)}}if(!this.drawn||b||!d){this.drawn=true;e=0;for(d=this.features.length;e<d;e++){this.renderer.locked=e!==d-1;g=this.features[e];this.drawFeature(g)}}},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};if(this.events.triggerEvent("beforefeaturesadded",a)===false)return;a=a.features}for(var c=0,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))throw OpenLayers.i18n("componentShouldBe",{geomType:this.geometryType.prototype.CLASS_NAME});
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){if(a==undefined)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}return this.getFeatureById(this.renderer.getFeatureIdFromEvent(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.Format.Filter=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.0.0",version:null,parser:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},write:function(a,b){b=b&&b.version||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=b){var c=OpenLayers.Format.Filter["v"+b.replace(/\./g,"_")];if(!c)throw"Can't find a Filter parser for version "+b;this.parser=new c(this.options)}return this.parser.write(a)},read:function(a){if(typeof a==
"string")a=OpenLayers.Format.XML.prototype.read.apply(this,[a]);var b=this.version;if(!b)b=this.defaultVersion;if(!this.parser||this.parser.VERSION!=b){var c=OpenLayers.Format.Filter["v"+b.replace(/\./g,"_")];if(!c)throw"Can't find a Filter parser for version "+b;this.parser=new c(this.options)}return this.parser.read(a)},CLASS_NAME:"OpenLayers.Format.Filter"});
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()}this.addFeatures((this.format?
new this.format(a):new OpenLayers.Format.GML(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 g=c.selectedFeatures.length-1;g>=0;--g){d=c.selectedFeatures[g];if(!a||
a.except!=d)this.unselect(d)}}},clickFeature:function(a){if(!this.hover)if(OpenLayers.Util.indexOf(a.layer.selectedFeatures,a)>-1)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;if(this.events.triggerEvent("beforefeaturehighlighted",{feature:a})!==false){a._prevHighlighter=a._lastHighlighter;a._lastHighlighter=this.id;b.drawFeature(a,this.selectStyle||this.renderIntent);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 g=0,j=d.features.length;g<j;++g){var l=d.features[g];if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,l.geometry.CLASS_NAME)>
-1)b.toGeometry().intersects(l.geometry)&&OpenLayers.Util.indexOf(d.selectedFeatures,l)==-1&&this.select(l)}}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,g=b.components.length;e<g;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*1E3},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,g,j,l,o,q,s,w=0,G=d.length;a:for(;w<G;++w){c=d[w];e=c.x1;g=c.x2;j=c.y1;l=c.y2;var C=0,B=a.length;for(;C<B;++C){o=a[C];if(o.x1>g)break;if(!(o.x2<e)){q=o.y1;s=o.y2;if(!(Math.min(q,s)>Math.max(j,l)))if(!(Math.max(q,s)<Math.min(j,l)))if(OpenLayers.Geometry.segmentsIntersect(c,o)){b=true;break a}}}}}else b=a.intersects(this);return b},getSortedSegments:function(){function a(e,g){return e.x1-g.x1}for(var b=this.components.length-
1,c=new Array(b),d=0;d<b;++d){point1=this.components[d];point2=this.components[d+1];c[d]=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}}return c.sort(a)},splitWithSegment:function(a,b){var c=!(b&&b.edge===false),d=b&&b.tolerance;b=[];for(var e=this.getVertices(),g=[],j=[],l=false,o,q,s,w={point:true,tolerance:d},G=null,C=0,B=e.length-2;C<=B;++C){d=e[C];g.push(d.clone());o=e[C+1];q={x1:d.x,y1:d.y,x2:o.x,y2:o.y};q=OpenLayers.Geometry.segmentsIntersect(a,
q,w);if(q instanceof OpenLayers.Geometry.Point)if((s=q.x===a.x1&&q.y===a.y1||q.x===a.x2&&q.y===a.y2||q.equals(d)||q.equals(o)?true:false)||c){q.equals(j[j.length-1])||j.push(q.clone());if(C===0)if(q.equals(d))continue;if(!q.equals(o)){l=true;q.equals(d)||g.push(q);b.push(new OpenLayers.Geometry.LineString(g));g=[q.clone()]}}}if(l){g.push(o.clone());b.push(new OpenLayers.Geometry.LineString(g))}if(j.length>0){var H=a.x1<a.x2?1:-1,i=a.y1<a.y2?1:-1;G={lines:b,points:j.sort(function(M,L){return H*M.x-
H*L.x||i*M.y-i*L.y})}}return G},split:function(a,b){var c=null,d=b&&b.mutual,e,g,j,l;if(a instanceof OpenLayers.Geometry.LineString){var o=this.getVertices(),q,s,w,G,C,B=[];j=[];for(var H=0,i=o.length-2;H<=i;++H){q=o[H];s=o[H+1];w={x1:q.x,y1:q.y,x2:s.x,y2:s.y};l=l||[a];d&&B.push(q.clone());for(var M=0;M<l.length;++M)if(G=l[M].splitWithSegment(w,b)){C=G.lines;if(C.length>0){C.unshift(M,1);Array.prototype.splice.apply(l,C);M+=C.length-2}if(d)for(var L=0,v=G.points.length;L<v;++L){C=G.points[L];if(!C.equals(q)){B.push(C);
j.push(new OpenLayers.Geometry.LineString(B));B=C.equals(s)?[]:[C.clone()]}}}}if(d&&j.length>0&&B.length>0){B.push(s.clone());j.push(new OpenLayers.Geometry.LineString(B))}}else c=a.splitWith(this,b);if(l&&l.length>1)g=true;else l=[];if(j&&j.length>1)e=true;else j=[];if(g||e)c=d?[j,l]:l;return c},splitWith:function(a,b){return a.split(this,b)},getVertices:function(a){return 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)&&b&&b.details,d,e={},g=Number.POSITIVE_INFINITY;if(a instanceof OpenLayers.Geometry.Point){b=this.getSortedSegments();for(var j=a.x,l=a.y,o,q=0,s=b.length;q<s;++q){o=b[q];d=OpenLayers.Geometry.distanceToSegment(a,o);if(d.distance<g){g=d.distance;e=d;if(g===0)break}else if(o.x2>j&&(l>o.y1&&l<o.y2||l<o.y1&&l>o.y2))break}e=c?{distance:e.distance,x0:e.x,y0:e.y,x1:j,y1:l}:e.distance}else if(a instanceof OpenLayers.Geometry.LineString){j=
this.getSortedSegments();l=a.getSortedSegments();var w,G,C,B=l.length,H={point:true};q=0;s=j.length;a:for(;q<s;++q){o=j[q];G=o.x1;C=o.y1;for(var i=0;i<B;++i){d=l[i];if(w=OpenLayers.Geometry.segmentsIntersect(o,d,H)){g=0;e={distance:0,x0:w.x,y0:w.y,x1:w.x,y1:w.y};break a}else{d=OpenLayers.Geometry.distanceToSegment({x:G,y:C},d);if(d.distance<g){g=d.distance;e={distance:g,x0:G,y0:C,x1:d.x,y1:d.y}}}}}if(!c)e=e.distance;if(g!==0)if(o){d=a.distanceTo(new OpenLayers.Geometry.Point(o.x2,o.y2),b);a=c?d.distance:
d;if(a<g)e=c?{distance:g,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);OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[this.components[0]]);return c},removeComponent:function(){if(this.components.length>
4){this.components.pop();OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[this.components[0]])}},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++)this.components[c].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,g=0;g<c-1;g++){d=b.components[g];e=b.components[g+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){function b(G,C,B,H,i){return((C-H)*G+(H*B-C*i))/(B-i)}var c=OpenLayers.Number.limitSigDigs,d=c(a.x,14);a=c(a.y,14);for(var e=this.components.length-1,g,j,l,o,q,s=0,w=0;w<e;++w){g=this.components[w];l=c(g.x,14);g=c(g.y,14);j=this.components[w+1];o=c(j.x,14);j=c(j.y,14);if(g==j){if(a==g)if(l<=o&&d>=l&&d<=o||l>=o&&d<=l&&d>=o){s=-1;break}}else{q=c(b(a,l,g,o,j),14);if(q==d)if(g<j&&a>=g&&a<=j||g>j&&a<=g&&a>=j){s=-1;break}if(!(q<=d))if(!(l!=o&&(q<Math.min(l,
o)||q>Math.max(l,o))))if(g<j&&a>=g&&a<j||g>j&&a<g&&a>=j)++s}}return s==-1?1:!!(s&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,g,j,l=[],o=[a],q=0,s=this.components.length;q<s;++q){e=this.components[q];g=false;for(var w=0;w<o.length;++w)if(a=e.split(o[w],b)){if(d){g=a[0];for(var G=0,C=g.length;G<C;++G)G===0&&l.length?l[l.length-1].addComponent(g[G]):
l.push(new OpenLayers.Geometry.MultiLineString([g[G]]));g=true;a=a[1]}if(a.length){a.unshift(w,1);Array.prototype.splice.apply(o,a);break}}if(!g)if(l.length)l[l.length-1].addComponent(e.clone());else l=[new OpenLayers.Geometry.MultiLineString(e.clone())]}if(l&&l.length>1)g=true;else l=[];if(o&&o.length>1)j=true;else o=[];if(g||j)c=d?[l,o]:o;return c},splitWith:function(a,b){var c=null,d=b&&b.mutual,e,g,j,l,o;if(a instanceof OpenLayers.Geometry.LineString){o=[];l=[a];for(var q=0,s=this.components.length;q<
s;++q){g=false;e=this.components[q];for(var w=0;w<l.length;++w)if(a=l[w].split(e,b)){if(d){g=a[0];if(g.length){g.unshift(w,1);Array.prototype.splice.apply(l,g);w+=g.length-2}a=a[1];if(a.length===0)a=[e.clone()]}g=0;for(var G=a.length;g<G;++g)g===0&&o.length?o[o.length-1].addComponent(a[g]):o.push(new OpenLayers.Geometry.MultiLineString([a[g]]));g=true}if(!g)if(o.length)o[o.length-1].addComponent(e.clone());else o=[new OpenLayers.Geometry.MultiLineString([e.clone()])]}}else c=a.split(this);if(l&&l.length>
1)j=true;else l=[];if(o&&o.length>1)g=true;else o=[];if(j||g)c=d?[l,o]:o;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){return b&&b.edge===false&&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 g,j=[],l=0;l<c;++l){g=e+l*2*Math.PI/c;d=a.x+b*Math.cos(g);g=a.y+b*Math.sin(g);j.push(new OpenLayers.Geometry.Point(d,g))}a=new OpenLayers.Geometry.LinearRing(j);return new OpenLayers.Geometry.Polygon([a])};
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(g){OpenLayers.Console.error(g)}break;
case "Feature":try{d=this.parseFeature(e);d.type="Feature"}catch(j){OpenLayers.Console.error(j)}break;case "FeatureCollection":d=[];switch(e.type){case "Feature":try{d.push(this.parseFeature(e))}catch(l){d=null;OpenLayers.Console.error(l)}break;case "FeatureCollection":a=0;for(b=e.features.length;a<b;++a)try{d.push(this.parseFeature(e.features[a]))}catch(o){d=null;OpenLayers.Console.error(o)}break;default:try{var q=this.parseGeometry(e);d.push(new OpenLayers.Feature.Vector(q))}catch(s){d=null;OpenLayers.Console.error(s)}}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(g){throw g;}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(g){throw g;}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(g){throw g;}b.push(c)}return new OpenLayers.Geometry.MultiLineString(b)},polygon:function(a){for(var b=[],c,d,e=0,g=a.length;e<g;++e){try{d=this.parseCoords.linestring.apply(this,[a[e]])}catch(j){throw j;}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(g){throw g;}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 g=a[e];if(!g instanceof OpenLayers.Feature.Vector)throw"FeatureCollection only supports collections of features: "+g;c.features[e]=this.extract.feature.apply(this,[g])}}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=="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"});
OpenLayers.Layer.CloudMade=OpenLayers.Class(OpenLayers.Layer.TMS,{initialize:function(a,b){if(!b.key)throw"Please provide key property in options (your API key).";b=OpenLayers.Util.extend({attribution:"",maxExtent:new OpenLayers.Bounds(-2.003750834E7,-2.003750834E7,2.003750834E7,2.003750834E7),maxResolution:156543.0339,units:"m",projection:"EPSG:900913",isBaseLayer:true,numZoomLevels:19,displayOutsideMaxExtent:true,wrapDateLine:true,styleId:1},b);var c=[b.key,b.styleId,256].join("/")+"/";OpenLayers.Layer.TMS.prototype.initialize.apply(this,
[a,["http://a.tile.cloudmade.com/"+c,"http://b.tile.cloudmade.com/"+c,"http://c.tile.cloudmade.com/"+c],b])},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();var d=Math.pow(2,b);if(a<0||a>=d)return"http://cloudmade.com/js-api/images/empty-tile.png";else{c=(c%d+d)%d;d=this.url;c=b+"/"+c+"/"+a+".png";if(d instanceof Array)d=this.selectUrl(c,d);return d+c}},
CLASS_NAME:"OpenLayers.Layer.CloudMade"});
OpenLayers.Marker.Label=OpenLayers.Class(OpenLayers.Marker,{labelDiv:null,label:null,mouseOver:false,labelClass:"olMarkerLabel",events:null,div:null,onlyOnMouseOver:false,mouseover:false,labelOffset:"10px",initialize:function(a,b,c,d){var e=[];OpenLayers.Util.extend(this,d);e.push(a,b,c);OpenLayers.Marker.prototype.initialize.apply(this,e);this.label=c;this.labelDiv=OpenLayers.Util.createDiv(this.icon.id+"_Text",null,null);this.labelDiv.style.cssText+=";color:#737373;font-size:11px;font-style:italic;font-weight:700;margin-top:"+this.labelOffset+
"px;margin-left:"+this.labelOffset+"px";this.labelDiv.className=this.labelClass;this.labelDiv.innerHTML=c},destroy:function(){this.labelDiv=this.label=null;OpenLayers.Marker.prototype.destroy.apply(this,arguments)},draw:function(){this.div=OpenLayers.Marker.prototype.draw.apply(this,arguments);this.div.style.width="0px";this.div.style.height="0px";this.div.firstChild.style.display="none";this.div.appendChild(this.labelDiv,this.div.firstChild);if(this.mouseOver===true){this.setLabelVisibility(false);
this.events.register("mouseover",this,this.onmouseover);this.events.register("mouseout",this,this.onmouseout)}else this.setLabelVisibility(true);return this.div},onmouseover:function(a){if(!this.mouseover){this.setLabelVisibility(true);this.mouseover=true}if(this.map.getSize().w-this.map.getPixelFromLonLat(this.lonlat).x<50)this.labelDiv.style.marginLeft=-10-this.icon.size.w+"px";if(this.map.getSize().h-this.map.getPixelFromLonLat(this.lonlat).y<50)this.labelDiv.style.marginTop=-10-this.icon.size.h+
"px";OpenLayers.Event.stop(a,true)},onmouseout:function(a){this.mouseover=false;this.setLabelVisibility(false);this.labelDiv.style.marginLeft=this.labelOffset;this.labelDiv.style.marginTop=this.labelOffset;OpenLayers.Event.stop(a,true)},setLabel:function(a){this.label=a;this.labelDiv.innerHTML=a},setLabelVisibility:function(a){this.labelDiv.style.display=a?"block":"none"},getLabelVisibility:function(){return this.labelDiv.style=="none"?false:true},CLASS_NAME:"OpenLayers.Marker.Label"});
(function(a,b){function c(){if(!i.isReady){try{v.documentElement.doScroll("left")}catch(f){setTimeout(c,1);return}i.ready()}}function d(f,h){h.src?i.ajax({url:h.src,async:false,dataType:"script"}):i.globalEval(h.text||h.textContent||h.innerHTML||"");h.parentNode&&h.parentNode.removeChild(h)}function e(f,h,k,n,m,u){var t=f.length;if(typeof h==="object"){for(var F in h)e(f,F,h[F],n,m,k);return f}if(k!==b){n=!u&&n&&i.isFunction(k);for(F=0;F<t;F++)m(f[F],h,n?k.call(f[F],F,m(f[F],h)):k,u);return f}return t?
m(f[0],h):b}function g(){return(new Date).getTime()}function j(){return false}function l(){return true}function o(f,h,k){k[0].type=f;return i.event.handle.apply(h,k)}function q(f){var h,k=[],n=[],m=arguments,u,t,F,z,E,K;t=i.data(this,"events");if(!(f.liveFired===this||!t||!t.live||f.button&&f.type==="click")){f.liveFired=this;var O=t.live.slice(0);for(z=0;z<O.length;z++){t=O[z];t.origType.replace(Aa,"")===f.type?n.push(t.selector):O.splice(z--,1)}u=i(f.target).closest(n,f.currentTarget);E=0;for(K=
u.length;E<K;E++)for(z=0;z<O.length;z++){t=O[z];if(u[E].selector===t.selector){F=u[E].elem;n=null;if(t.preType==="mouseenter"||t.preType==="mouseleave")n=i(f.relatedTarget).closest(t.selector)[0];if(!n||n!==F)k.push({elem:F,handleObj:t})}}E=0;for(K=k.length;E<K;E++){u=k[E];f.currentTarget=u.elem;f.data=u.handleObj.data;f.handleObj=u.handleObj;if(u.handleObj.origHandler.apply(u.elem,m)===false){h=false;break}}return h}}function s(f,h){return"live."+(f&&f!=="*"?f+".":"")+h.replace(/\./g,"`").replace(/ /g,
"&")}function w(f){return!f||!f.parentNode||f.parentNode.nodeType===11}function G(f,h){var k=0;h.each(function(){if(this.nodeName===(f[k]&&f[k].nodeName)){var n=i.data(f[k++]),m=i.data(this,n);if(n=n&&n.events){delete m.handle;m.events={};for(var u in n)for(var t in n[u])i.event.add(this,u,n[u][t],n[u][t].data)}}})}function C(f,h,k){var n,m,u;h=h&&h[0]?h[0].ownerDocument||h[0]:v;if(f.length===1&&typeof f[0]==="string"&&f[0].length<512&&h===v&&!Qa.test(f[0])&&(i.support.checkClone||!Ra.test(f[0]))){m=
true;if(u=i.fragments[f[0]])if(u!==1)n=u}if(!n){n=h.createDocumentFragment();i.clean(f,h,n,k)}if(m)i.fragments[f[0]]=u?n:1;return{fragment:n,cacheable:m}}function B(f,h){var k={};i.each(Sa.concat.apply([],Sa.slice(0,h)),function(){k[this]=f});return k}function H(f){return"scrollTo"in f&&f.document?f:f.nodeType===9?f.defaultView||f.parentWindow:false}var i=function(f,h){return new i.fn.init(f,h)},M=a.jQuery,L=a.$,v=a.document,P,Q=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,U=/^.[^:#\[\.,]*$/,ba=/\S/,S=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,
X=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,ca=navigator.userAgent,ea=false,fa=[],ja,ha=Object.prototype.toString,sa=Object.prototype.hasOwnProperty,pa=Array.prototype.push,ka=Array.prototype.slice,ga=Array.prototype.indexOf;i.fn=i.prototype={init:function(f,h){var k,n;if(!f)return this;if(f.nodeType){this.context=this[0]=f;this.length=1;return this}if(f==="body"&&!h){this.context=v;this[0]=v.body;this.selector="body";this.length=1;return this}if(typeof f==="string")if((k=Q.exec(f))&&(k[1]||!h))if(k[1]){n=h?h.ownerDocument||
h:v;if(f=X.exec(f))if(i.isPlainObject(h)){f=[v.createElement(f[1])];i.fn.attr.call(f,h,true)}else f=[n.createElement(f[1])];else{f=C([k[1]],[n]);f=(f.cacheable?f.fragment.cloneNode(true):f.fragment).childNodes}return i.merge(this,f)}else{if(h=v.getElementById(k[2])){if(h.id!==k[2])return P.find(f);this.length=1;this[0]=h}this.context=v;this.selector=f;return this}else if(!h&&/^\w+$/.test(f)){this.selector=f;this.context=v;f=v.getElementsByTagName(f);return i.merge(this,f)}else return!h||h.jquery?
(h||P).find(f):i(h).find(f);else if(i.isFunction(f))return P.ready(f);if(f.selector!==b){this.selector=f.selector;this.context=f.context}return i.makeArray(f,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return ka.call(this,0)},get:function(f){return f==null?this.toArray():f<0?this.slice(f)[0]:this[f]},pushStack:function(f,h,k){var n=i();i.isArray(f)?pa.apply(n,f):i.merge(n,f);n.prevObject=this;n.context=this.context;if(h==="find")n.selector=this.selector+
(this.selector?" ":"")+k;else if(h)n.selector=this.selector+"."+h+"("+k+")";return n},each:function(f,h){return i.each(this,f,h)},ready:function(f){i.bindReady();if(i.isReady)f.call(v,i);else fa&&fa.push(f);return this},eq:function(f){return f===-1?this.slice(f):this.slice(f,+f+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(ka.apply(this,arguments),"slice",ka.call(arguments).join(","))},map:function(f){return this.pushStack(i.map(this,
function(h,k){return f.call(h,k,h)}))},end:function(){return this.prevObject||i(null)},push:pa,sort:[].sort,splice:[].splice};i.fn.init.prototype=i.fn;i.extend=i.fn.extend=function(){var f=arguments[0]||{},h=1,k=arguments.length,n=false,m,u,t,F;if(typeof f==="boolean"){n=f;f=arguments[1]||{};h=2}if(typeof f!=="object"&&!i.isFunction(f))f={};if(k===h){f=this;--h}for(;h<k;h++)if((m=arguments[h])!=null)for(u in m){t=f[u];F=m[u];if(f!==F)if(n&&F&&(i.isPlainObject(F)||i.isArray(F))){t=t&&(i.isPlainObject(t)||
i.isArray(t))?t:i.isArray(F)?[]:{};f[u]=i.extend(n,t,F)}else if(F!==b)f[u]=F}return f};i.extend({noConflict:function(f){a.$=L;if(f)a.jQuery=M;return i},isReady:false,ready:function(){if(!i.isReady){if(!v.body)return setTimeout(i.ready,13);i.isReady=true;if(fa){for(var f,h=0;f=fa[h++];)f.call(v,i);fa=null}i.fn.triggerHandler&&i(v).triggerHandler("ready")}},bindReady:function(){if(!ea){ea=true;if(v.readyState==="complete")return i.ready();if(v.addEventListener){v.addEventListener("DOMContentLoaded",
ja,false);a.addEventListener("load",i.ready,false)}else if(v.attachEvent){v.attachEvent("onreadystatechange",ja);a.attachEvent("onload",i.ready);var f=false;try{f=a.frameElement==null}catch(h){}v.documentElement.doScroll&&f&&c()}}},isFunction:function(f){return ha.call(f)==="[object Function]"},isArray:function(f){return ha.call(f)==="[object Array]"},isPlainObject:function(f){if(!f||ha.call(f)!=="[object Object]"||f.nodeType||f.setInterval)return false;if(f.constructor&&!sa.call(f,"constructor")&&
!sa.call(f.constructor.prototype,"isPrototypeOf"))return false;var h;for(h in f);return h===b||sa.call(f,h)},isEmptyObject:function(f){for(var h in f)return false;return true},error:function(f){throw f;},parseJSON:function(f){if(typeof f!=="string"||!f)return null;f=i.trim(f);if(/^[\],:{}\s]*$/.test(f.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(f):
(new Function("return "+f))();else i.error("Invalid JSON: "+f)},noop:function(){},globalEval:function(f){if(f&&ba.test(f)){var h=v.getElementsByTagName("head")[0]||v.documentElement,k=v.createElement("script");k.type="text/javascript";if(i.support.scriptEval)k.appendChild(v.createTextNode(f));else k.text=f;h.insertBefore(k,h.firstChild);h.removeChild(k)}},nodeName:function(f,h){return f.nodeName&&f.nodeName.toUpperCase()===h.toUpperCase()},each:function(f,h,k){var n,m=0,u=f.length,t=u===b||i.isFunction(f);
if(k)if(t)for(n in f){if(h.apply(f[n],k)===false)break}else for(;m<u;){if(h.apply(f[m++],k)===false)break}else if(t)for(n in f){if(h.call(f[n],n,f[n])===false)break}else for(k=f[0];m<u&&h.call(k,m,k)!==false;k=f[++m]);return f},trim:function(f){return(f||"").replace(S,"")},makeArray:function(f,h){h=h||[];if(f!=null)f.length==null||typeof f==="string"||i.isFunction(f)||typeof f!=="function"&&f.setInterval?pa.call(h,f):i.merge(h,f);return h},inArray:function(f,h){if(h.indexOf)return h.indexOf(f);for(var k=
0,n=h.length;k<n;k++)if(h[k]===f)return k;return-1},merge:function(f,h){var k=f.length,n=0;if(typeof h.length==="number")for(var m=h.length;n<m;n++)f[k++]=h[n];else for(;h[n]!==b;)f[k++]=h[n++];f.length=k;return f},grep:function(f,h,k){for(var n=[],m=0,u=f.length;m<u;m++)!k!==!h(f[m],m)&&n.push(f[m]);return n},map:function(f,h,k){for(var n=[],m,u=0,t=f.length;u<t;u++){m=h(f[u],u,k);if(m!=null)n[n.length]=m}return n.concat.apply([],n)},guid:1,proxy:function(f,h,k){if(arguments.length===2)if(typeof h===
"string"){k=f;f=k[h];h=b}else if(h&&!i.isFunction(h)){k=h;h=b}if(!h&&f)h=function(){return f.apply(k||this,arguments)};if(f)h.guid=f.guid=f.guid||h.guid||i.guid++;return h},uaMatch:function(f){f=f.toLowerCase();f=/(webkit)[ \/]([\w.]+)/.exec(f)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(f)||/(msie) ([\w.]+)/.exec(f)||!/compatible/.test(f)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(f)||[];return{browser:f[1]||"",version:f[2]||"0"}},browser:{}});ca=i.uaMatch(ca);if(ca.browser){i.browser[ca.browser]=true;
i.browser.version=ca.version}if(i.browser.webkit)i.browser.safari=true;if(ga)i.inArray=function(f,h){return ga.call(h,f)};P=i(v);if(v.addEventListener)ja=function(){v.removeEventListener("DOMContentLoaded",ja,false);i.ready()};else if(v.attachEvent)ja=function(){if(v.readyState==="complete"){v.detachEvent("onreadystatechange",ja);i.ready()}};(function(){i.support={};var f=v.documentElement,h=v.createElement("script"),k=v.createElement("div"),n="script"+g();k.style.display="none";k.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var m=k.getElementsByTagName("*"),u=k.getElementsByTagName("a")[0];if(!(!m||!m.length||!u)){i.support={leadingWhitespace:k.firstChild.nodeType===3,tbody:!k.getElementsByTagName("tbody").length,htmlSerialize:!!k.getElementsByTagName("link").length,style:/red/.test(u.getAttribute("style")),hrefNormalized:u.getAttribute("href")==="/a",opacity:/^0.55$/.test(u.style.opacity),cssFloat:!!u.style.cssFloat,checkOn:k.getElementsByTagName("input")[0].value==="on",optSelected:v.createElement("select").appendChild(v.createElement("option")).selected,
parentNode:k.removeChild(k.appendChild(v.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};h.type="text/javascript";try{h.appendChild(v.createTextNode("window."+n+"=1;"))}catch(t){}f.insertBefore(h,f.firstChild);if(a[n]){i.support.scriptEval=true;delete a[n]}try{delete h.test}catch(F){i.support.deleteExpando=false}f.removeChild(h);if(k.attachEvent&&k.fireEvent){k.attachEvent("onclick",function z(){i.support.noCloneEvent=
false;k.detachEvent("onclick",z)});k.cloneNode(true).fireEvent("onclick")}k=v.createElement("div");k.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";f=v.createDocumentFragment();f.appendChild(k.firstChild);i.support.checkClone=f.cloneNode(true).cloneNode(true).lastChild.checked;i(function(){var z=v.createElement("div");z.style.width=z.style.paddingLeft="1px";v.body.appendChild(z);i.boxModel=i.support.boxModel=z.offsetWidth===2;v.body.removeChild(z).style.display="none"});f=function(z){var E=
v.createElement("div");z="on"+z;var K=z in E;if(!K){E.setAttribute(z,"return;");K=typeof E[z]==="function"}return K};i.support.submitBubbles=f("submit");i.support.changeBubbles=f("change");f=h=k=m=u=null}})();i.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var Z="jQuery"+g(),qa=0,ta={};i.extend({cache:{},expando:Z,noData:{embed:true,object:true,
applet:true},data:function(f,h,k){if(!(f.nodeName&&i.noData[f.nodeName.toLowerCase()])){f=f==a?ta:f;var n=f[Z],m=i.cache;if(!n&&typeof h==="string"&&k===b)return null;n||(n=++qa);if(typeof h==="object"){f[Z]=n;m[n]=i.extend(true,{},h)}else if(!m[n]){f[Z]=n;m[n]={}}f=m[n];if(k!==b)f[h]=k;return typeof h==="string"?f[h]:f}},removeData:function(f,h){if(!(f.nodeName&&i.noData[f.nodeName.toLowerCase()])){f=f==a?ta:f;var k=f[Z],n=i.cache,m=n[k];if(h){if(m){delete m[h];i.isEmptyObject(m)&&i.removeData(f)}}else{if(i.support.deleteExpando)delete f[i.expando];
else f.removeAttribute&&f.removeAttribute(i.expando);delete n[k]}}}});i.fn.extend({data:function(f,h){if(typeof f==="undefined"&&this.length)return i.data(this[0]);else if(typeof f==="object")return this.each(function(){i.data(this,f)});var k=f.split(".");k[1]=k[1]?"."+k[1]:"";if(h===b){var n=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(n===b&&this.length)n=i.data(this[0],f);return n===b&&k[1]?this.data(k[0]):n}else return this.trigger("setData"+k[1]+"!",[k[0],h]).each(function(){i.data(this,
f,h)})},removeData:function(f){return this.each(function(){i.removeData(this,f)})}});i.extend({queue:function(f,h,k){if(f){h=(h||"fx")+"queue";var n=i.data(f,h);if(!k)return n||[];if(!n||i.isArray(k))n=i.data(f,h,i.makeArray(k));else n.push(k);return n}},dequeue:function(f,h){h=h||"fx";var k=i.queue(f,h),n=k.shift();if(n==="inprogress")n=k.shift();if(n){h==="fx"&&k.unshift("inprogress");n.call(f,function(){i.dequeue(f,h)})}}});i.fn.extend({queue:function(f,h){if(typeof f!=="string"){h=f;f="fx"}if(h===
b)return i.queue(this[0],f);return this.each(function(){var k=i.queue(this,f,h);f==="fx"&&k[0]!=="inprogress"&&i.dequeue(this,f)})},dequeue:function(f){return this.each(function(){i.dequeue(this,f)})},delay:function(f,h){f=i.fx?i.fx.speeds[f]||f:f;h=h||"fx";return this.queue(h,function(){var k=this;setTimeout(function(){i.dequeue(k,h)},f)})},clearQueue:function(f){return this.queue(f||"fx",[])}});var oa=/[\n\t]/g,ia=/\s+/,wa=/\r/g,xa=/href|src|style/,Ba=/(button|input)/i,V=/(button|input|object|select|textarea)/i,
ra=/^(a|area)$/i,Ca=/radio|checkbox/;i.fn.extend({attr:function(f,h){return e(this,f,h,true,i.attr)},removeAttr:function(f){return this.each(function(){i.attr(this,f,"");this.nodeType===1&&this.removeAttribute(f)})},addClass:function(f){if(i.isFunction(f))return this.each(function(E){var K=i(this);K.addClass(f.call(this,E,K.attr("class")))});if(f&&typeof f==="string")for(var h=(f||"").split(ia),k=0,n=this.length;k<n;k++){var m=this[k];if(m.nodeType===1)if(m.className){for(var u=" "+m.className+" ",
t=m.className,F=0,z=h.length;F<z;F++)if(u.indexOf(" "+h[F]+" ")<0)t+=" "+h[F];m.className=i.trim(t)}else m.className=f}return this},removeClass:function(f){if(i.isFunction(f))return this.each(function(z){var E=i(this);E.removeClass(f.call(this,z,E.attr("class")))});if(f&&typeof f==="string"||f===b)for(var h=(f||"").split(ia),k=0,n=this.length;k<n;k++){var m=this[k];if(m.nodeType===1&&m.className)if(f){for(var u=(" "+m.className+" ").replace(oa," "),t=0,F=h.length;t<F;t++)u=u.replace(" "+h[t]+" ",
" ");m.className=i.trim(u)}else m.className=""}return this},toggleClass:function(f,h){var k=typeof f,n=typeof h==="boolean";if(i.isFunction(f))return this.each(function(m){var u=i(this);u.toggleClass(f.call(this,m,u.attr("class"),h),h)});return this.each(function(){if(k==="string")for(var m,u=0,t=i(this),F=h,z=f.split(ia);m=z[u++];){F=n?F:!t.hasClass(m);t[F?"addClass":"removeClass"](m)}else if(k==="undefined"||k==="boolean"){this.className&&i.data(this,"__className__",this.className);this.className=
this.className||f===false?"":i.data(this,"__className__")||""}})},hasClass:function(f){f=" "+f+" ";for(var h=0,k=this.length;h<k;h++)if((" "+this[h].className+" ").replace(oa," ").indexOf(f)>-1)return true;return false},val:function(f){if(f===b){var h=this[0];if(h){if(i.nodeName(h,"option"))return(h.attributes.value||{}).specified?h.value:h.text;if(i.nodeName(h,"select")){var k=h.selectedIndex,n=[],m=h.options;h=h.type==="select-one";if(k<0)return null;var u=h?k:0;for(k=h?k+1:m.length;u<k;u++){var t=
m[u];if(t.selected){f=i(t).val();if(h)return f;n.push(f)}}return n}if(Ca.test(h.type)&&!i.support.checkOn)return h.getAttribute("value")===null?"on":h.value;return(h.value||"").replace(wa,"")}return b}var F=i.isFunction(f);return this.each(function(z){var E=i(this),K=f;if(this.nodeType===1){if(F)K=f.call(this,z,E.val());if(typeof K==="number")K+="";if(i.isArray(K)&&Ca.test(this.type))this.checked=i.inArray(E.val(),K)>=0;else if(i.nodeName(this,"select")){var O=i.makeArray(K);i("option",this).each(function(){this.selected=
i.inArray(i(this).val(),O)>=0});if(!O.length)this.selectedIndex=-1}else this.value=K}})}});i.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(f,h,k,n){if(!f||f.nodeType===3||f.nodeType===8)return b;if(n&&h in i.attrFn)return i(f)[h](k);n=f.nodeType!==1||!i.isXMLDoc(f);var m=k!==b;h=n&&i.props[h]||h;if(f.nodeType===1){var u=xa.test(h);if(h in f&&n&&!u){if(m){h==="type"&&Ba.test(f.nodeName)&&f.parentNode&&i.error("type property can't be changed");
f[h]=k}if(i.nodeName(f,"form")&&f.getAttributeNode(h))return f.getAttributeNode(h).nodeValue;if(h==="tabIndex")return(h=f.getAttributeNode("tabIndex"))&&h.specified?h.value:V.test(f.nodeName)||ra.test(f.nodeName)&&f.href?0:b;return f[h]}if(!i.support.style&&n&&h==="style"){if(m)f.style.cssText=""+k;return f.style.cssText}m&&f.setAttribute(h,""+k);f=!i.support.hrefNormalized&&n&&u?f.getAttribute(h,2):f.getAttribute(h);return f===null?b:f}return i.style(f,h,k)}});var Aa=/\.(.*)$/,gb=function(f){return f.replace(/[^\w\s\.\|`]/g,
function(h){return"\\"+h})};i.event={add:function(f,h,k,n){if(!(f.nodeType===3||f.nodeType===8)){if(f.setInterval&&f!==a&&!f.frameElement)f=a;var m,u;if(k.handler){m=k;k=m.handler}if(!k.guid)k.guid=i.guid++;if(u=i.data(f)){var t=u.events=u.events||{},F=u.handle;if(!F)u.handle=F=function(){return typeof i!=="undefined"&&!i.event.triggered?i.event.handle.apply(F.elem,arguments):b};F.elem=f;h=h.split(" ");for(var z,E=0,K;z=h[E++];){u=m?i.extend({},m):{handler:k,data:n};if(z.indexOf(".")>-1){K=z.split(".");
z=K.shift();u.namespace=K.slice(0).sort().join(".")}else{K=[];u.namespace=""}u.type=z;u.guid=k.guid;var O=t[z],Y=i.event.special[z]||{};if(!O){O=t[z]=[];if(!Y.setup||Y.setup.call(f,n,K,F)===false)if(f.addEventListener)f.addEventListener(z,F,false);else f.attachEvent&&f.attachEvent("on"+z,F)}if(Y.add){Y.add.call(f,u);if(!u.handler.guid)u.handler.guid=k.guid}O.push(u);i.event.global[z]=true}f=null}}},global:{},remove:function(f,h,k,n){if(!(f.nodeType===3||f.nodeType===8)){var m,u=0,t,F,z,E,K,O,Y=i.data(f),
da=Y&&Y.events;if(Y&&da){if(h&&h.type){k=h.handler;h=h.type}if(!h||typeof h==="string"&&h.charAt(0)==="."){h=h||"";for(m in da)i.event.remove(f,m+h)}else{for(h=h.split(" ");m=h[u++];){E=m;t=m.indexOf(".")<0;F=[];if(!t){F=m.split(".");m=F.shift();z=new RegExp("(^|\\.)"+i.map(F.slice(0).sort(),gb).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(K=da[m])if(k){E=i.event.special[m]||{};for(aa=n||0;aa<K.length;aa++){O=K[aa];if(k.guid===O.guid){if(t||z.test(O.namespace)){n==null&&K.splice(aa--,1);E.remove&&E.remove.call(f,
O)}if(n!=null)break}}if(K.length===0||n!=null&&K.length===1){if(!E.teardown||E.teardown.call(f,F)===false)Ta(f,m,Y.handle);delete da[m]}}else for(var aa=0;aa<K.length;aa++){O=K[aa];if(t||z.test(O.namespace)){i.event.remove(f,E,O.handler,aa);K.splice(aa--,1)}}}if(i.isEmptyObject(da)){if(h=Y.handle)h.elem=null;delete Y.events;delete Y.handle;i.isEmptyObject(Y)&&i.removeData(f)}}}}},trigger:function(f,h,k,n){var m=f.type||f;if(!n){f=typeof f==="object"?f[Z]?f:i.extend(i.Event(m),f):i.Event(m);if(m.indexOf("!")>=
0){f.type=m=m.slice(0,-1);f.exclusive=true}if(!k){f.stopPropagation();i.event.global[m]&&i.each(i.cache,function(){this.events&&this.events[m]&&i.event.trigger(f,h,this.handle.elem)})}if(!k||k.nodeType===3||k.nodeType===8)return b;f.result=b;f.target=k;h=i.makeArray(h);h.unshift(f)}f.currentTarget=k;(n=i.data(k,"handle"))&&n.apply(k,h);n=k.parentNode||k.ownerDocument;try{if(!(k&&k.nodeName&&i.noData[k.nodeName.toLowerCase()]))if(k["on"+m]&&k["on"+m].apply(k,h)===false)f.result=false}catch(u){}if(!f.isPropagationStopped()&&
n)i.event.trigger(f,h,n,true);else if(!f.isDefaultPrevented()){n=f.target;var t,F=i.nodeName(n,"a")&&m==="click",z=i.event.special[m]||{};if((!z._default||z._default.call(k,f)===false)&&!F&&!(n&&n.nodeName&&i.noData[n.nodeName.toLowerCase()])){try{if(n[m]){if(t=n["on"+m])n["on"+m]=null;i.event.triggered=true;n[m]()}}catch(E){}if(t)n["on"+m]=t;i.event.triggered=false}}},handle:function(f){var h,k,n,m;f=arguments[0]=i.event.fix(f||a.event);f.currentTarget=this;h=f.type.indexOf(".")<0&&!f.exclusive;
if(!h){k=f.type.split(".");f.type=k.shift();n=new RegExp("(^|\\.)"+k.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}m=i.data(this,"events");k=m[f.type];if(m&&k){k=k.slice(0);m=0;for(var u=k.length;m<u;m++){var t=k[m];if(h||n.test(t.namespace)){f.handler=t.handler;f.data=t.data;f.handleObj=t;t=t.handler.apply(this,arguments);if(t!==b){f.result=t;if(t===false){f.preventDefault();f.stopPropagation()}}if(f.isImmediatePropagationStopped())break}}}return f.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(f){if(f[Z])return f;var h=f;f=i.Event(h);for(var k=this.props.length,n;k;){n=this.props[--k];f[n]=h[n]}if(!f.target)f.target=f.srcElement||v;if(f.target.nodeType===3)f.target=f.target.parentNode;if(!f.relatedTarget&&f.fromElement)f.relatedTarget=f.fromElement===f.target?f.toElement:f.fromElement;if(f.pageX==null&&f.clientX!=null){h=v.documentElement;k=v.body;f.pageX=f.clientX+(h&&h.scrollLeft||k&&k.scrollLeft||0)-(h&&h.clientLeft||k&&k.clientLeft||0);f.pageY=f.clientY+(h&&h.scrollTop||
k&&k.scrollTop||0)-(h&&h.clientTop||k&&k.clientTop||0)}if(!f.which&&(f.charCode||f.charCode===0?f.charCode:f.keyCode))f.which=f.charCode||f.keyCode;if(!f.metaKey&&f.ctrlKey)f.metaKey=f.ctrlKey;if(!f.which&&f.button!==b)f.which=f.button&1?1:f.button&2?3:f.button&4?2:0;return f},guid:1E8,proxy:i.proxy,special:{ready:{setup:i.bindReady,teardown:i.noop},live:{add:function(f){i.event.add(this,f.origType,i.extend({},f,{handler:q}))},remove:function(f){var h=true,k=f.origType.replace(Aa,"");i.each(i.data(this,
"events").live||[],function(){if(k===this.origType.replace(Aa,""))return h=false});h&&i.event.remove(this,f.origType,q)}},beforeunload:{setup:function(f,h,k){if(this.setInterval)this.onbeforeunload=k;return false},teardown:function(f,h){if(this.onbeforeunload===h)this.onbeforeunload=null}}}};var Ta=v.removeEventListener?function(f,h,k){f.removeEventListener(h,k,false)}:function(f,h,k){f.detachEvent("on"+h,k)};i.Event=function(f){if(!this.preventDefault)return new i.Event(f);if(f&&f.type){this.originalEvent=
f;this.type=f.type}else this.type=f;this.timeStamp=g();this[Z]=true};i.Event.prototype={preventDefault:function(){this.isDefaultPrevented=l;var f=this.originalEvent;if(f){f.preventDefault&&f.preventDefault();f.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=l;var f=this.originalEvent;if(f){f.stopPropagation&&f.stopPropagation();f.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=l;this.stopPropagation()},isDefaultPrevented:j,isPropagationStopped:j,
isImmediatePropagationStopped:j};var Ua=function(f){var h=f.relatedTarget;try{for(;h&&h!==this;)h=h.parentNode;if(h!==this){f.type=f.data;i.event.handle.apply(this,arguments)}}catch(k){}},Va=function(f){f.type=f.data;i.event.handle.apply(this,arguments)};i.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(f,h){i.event.special[f]={setup:function(k){i.event.add(this,h,k&&k.selector?Va:Ua,f)},teardown:function(k){i.event.remove(this,h,k&&k.selector?Va:Ua)}}});if(!i.support.submitBubbles)i.event.special.submit=
{setup:function(){if(this.nodeName.toLowerCase()!=="form"){i.event.add(this,"click.specialSubmit",function(f){var h=f.target,k=h.type;if((k==="submit"||k==="image")&&i(h).closest("form").length)return o("submit",this,arguments)});i.event.add(this,"keypress.specialSubmit",function(f){var h=f.target,k=h.type;if((k==="text"||k==="password")&&i(h).closest("form").length&&f.keyCode===13)return o("submit",this,arguments)})}else return false},teardown:function(){i.event.remove(this,".specialSubmit")}};if(!i.support.changeBubbles){var Ha=
/textarea|input|select/i,Ia,Wa=function(f){var h=f.type,k=f.value;if(h==="radio"||h==="checkbox")k=f.checked;else if(h==="select-multiple")k=f.selectedIndex>-1?i.map(f.options,function(n){return n.selected}).join("-"):"";else if(f.nodeName.toLowerCase()==="select")k=f.selectedIndex;return k},Ja=function(f,h){var k=f.target,n,m;if(!(!Ha.test(k.nodeName)||k.readOnly)){n=i.data(k,"_change_data");m=Wa(k);if(f.type!=="focusout"||k.type!=="radio")i.data(k,"_change_data",m);if(!(n===b||m===n))if(n!=null||
m){f.type="change";return i.event.trigger(f,h,k)}}};i.event.special.change={filters:{focusout:Ja,click:function(f){var h=f.target,k=h.type;if(k==="radio"||k==="checkbox"||h.nodeName.toLowerCase()==="select")return Ja.call(this,f)},keydown:function(f){var h=f.target,k=h.type;if(f.keyCode===13&&h.nodeName.toLowerCase()!=="textarea"||f.keyCode===32&&(k==="checkbox"||k==="radio")||k==="select-multiple")return Ja.call(this,f)},beforeactivate:function(f){f=f.target;i.data(f,"_change_data",Wa(f))}},setup:function(){if(this.type===
"file")return false;for(var f in Ia)i.event.add(this,f+".specialChange",Ia[f]);return Ha.test(this.nodeName)},teardown:function(){i.event.remove(this,".specialChange");return Ha.test(this.nodeName)}};Ia=i.event.special.change.filters}v.addEventListener&&i.each({focus:"focusin",blur:"focusout"},function(f,h){function k(n){n=i.event.fix(n);n.type=h;return i.event.handle.call(this,n)}i.event.special[h]={setup:function(){this.addEventListener(f,k,true)},teardown:function(){this.removeEventListener(f,
k,true)}}});i.each(["bind","one"],function(f,h){i.fn[h]=function(k,n,m){if(typeof k==="object"){for(var u in k)this[h](u,n,k[u],m);return this}if(i.isFunction(n)){m=n;n=b}var t=h==="one"?i.proxy(m,function(z){i(this).unbind(z,t);return m.apply(this,arguments)}):m;if(k==="unload"&&h!=="one")this.one(k,n,m);else{u=0;for(var F=this.length;u<F;u++)i.event.add(this[u],k,t,n)}return this}});i.fn.extend({unbind:function(f,h){if(typeof f==="object"&&!f.preventDefault)for(var k in f)this.unbind(k,f[k]);else{k=
0;for(var n=this.length;k<n;k++)i.event.remove(this[k],f,h)}return this},delegate:function(f,h,k,n){return this.live(h,k,n,f)},undelegate:function(f,h,k){return arguments.length===0?this.unbind("live"):this.die(h,null,k,f)},trigger:function(f,h){return this.each(function(){i.event.trigger(f,h,this)})},triggerHandler:function(f,h){if(this[0]){f=i.Event(f);f.preventDefault();f.stopPropagation();i.event.trigger(f,h,this[0]);return f.result}},toggle:function(f){for(var h=arguments,k=1;k<h.length;)i.proxy(f,
h[k++]);return this.click(i.proxy(f,function(n){var m=(i.data(this,"lastToggle"+f.guid)||0)%k;i.data(this,"lastToggle"+f.guid,m+1);n.preventDefault();return h[m].apply(this,arguments)||false}))},hover:function(f,h){return this.mouseenter(f).mouseleave(h||f)}});var Xa={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};i.each(["live","die"],function(f,h){i.fn[h]=function(k,n,m,u){var t,F=0,z,E,K=u||this.selector,O=u?this:i(this.context);if(i.isFunction(n)){m=n;n=b}for(k=
(k||"").split(" ");(t=k[F++])!=null;){u=Aa.exec(t);z="";if(u){z=u[0];t=t.replace(Aa,"")}if(t==="hover")k.push("mouseenter"+z,"mouseleave"+z);else{E=t;if(t==="focus"||t==="blur"){k.push(Xa[t]+z);t+=z}else t=(Xa[t]||t)+z;h==="live"?O.each(function(){i.event.add(this,s(t,K),{data:n,selector:K,handler:m,origType:t,origHandler:m,preType:E})}):O.unbind(s(t,K),m)}}return this}});i.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
function(f,h){i.fn[h]=function(k){return k?this.bind(h,k):this.trigger(h)};if(i.attrFn)i.attrFn[h]=true});a.attachEvent&&!a.addEventListener&&a.attachEvent("onunload",function(){for(var f in i.cache)if(i.cache[f].handle)try{i.event.remove(i.cache[f].handle.elem)}catch(h){}});(function(){function f(p){for(var r="",A,D=0;p[D];D++){A=p[D];if(A.nodeType===3||A.nodeType===4)r+=A.nodeValue;else if(A.nodeType!==8)r+=f(A.childNodes)}return r}function h(p,r,A,D,J,I){J=0;for(var R=D.length;J<R;J++){var N=D[J];
if(N){N=N[p];for(var W=false;N;){if(N.sizcache===A){W=D[N.sizset];break}if(N.nodeType===1&&!I){N.sizcache=A;N.sizset=J}if(N.nodeName.toLowerCase()===r){W=N;break}N=N[p]}D[J]=W}}}function k(p,r,A,D,J,I){J=0;for(var R=D.length;J<R;J++){var N=D[J];if(N){N=N[p];for(var W=false;N;){if(N.sizcache===A){W=D[N.sizset];break}if(N.nodeType===1){if(!I){N.sizcache=A;N.sizset=J}if(typeof r!=="string"){if(N===r){W=true;break}}else if(z.filter(r,[N]).length>0){W=N;break}}N=N[p]}D[J]=W}}}var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
m=0,u=Object.prototype.toString,t=false,F=true;[0,0].sort(function(){F=false;return 0});var z=function(p,r,A,D){A=A||[];var J=r=r||v;if(r.nodeType!==1&&r.nodeType!==9)return[];if(!p||typeof p!=="string")return A;for(var I=[],R,N,W,Da,ua=true,ya=T(r),va=p;(n.exec(""),R=n.exec(va))!==null;){va=R[3];I.push(R[1]);if(R[2]){Da=R[3];break}}if(I.length>1&&K.exec(p))if(I.length===2&&E.relative[I[0]])N=Ka(I[0]+I[1],r);else for(N=E.relative[I[0]]?[r]:z(I.shift(),r);I.length;){p=I.shift();if(E.relative[p])p+=
I.shift();N=Ka(p,N)}else{if(!D&&I.length>1&&r.nodeType===9&&!ya&&E.match.ID.test(I[0])&&!E.match.ID.test(I[I.length-1])){R=z.find(I.shift(),r,ya);r=R.expr?z.filter(R.expr,R.set)[0]:R.set[0]}if(r){R=D?{expr:I.pop(),set:Y(D)}:z.find(I.pop(),I.length===1&&(I[0]==="~"||I[0]==="+")&&r.parentNode?r.parentNode:r,ya);N=R.expr?z.filter(R.expr,R.set):R.set;if(I.length>0)W=Y(N);else ua=false;for(;I.length;){var la=I.pop();R=la;if(E.relative[la])R=I.pop();else la="";if(R==null)R=r;E.relative[la](W,R,ya)}}else W=
[]}W||(W=N);W||z.error(la||p);if(u.call(W)==="[object Array]")if(ua)if(r&&r.nodeType===1)for(p=0;W[p]!=null;p++){if(W[p]&&(W[p]===true||W[p].nodeType===1&&ma(r,W[p])))A.push(N[p])}else for(p=0;W[p]!=null;p++)W[p]&&W[p].nodeType===1&&A.push(N[p]);else A.push.apply(A,W);else Y(W,A);if(Da){z(Da,J,A,D);z.uniqueSort(A)}return A};z.uniqueSort=function(p){if(aa){t=F;p.sort(aa);if(t)for(var r=1;r<p.length;r++)p[r]===p[r-1]&&p.splice(r--,1)}return p};z.matches=function(p,r){return z(p,null,null,r)};z.find=
function(p,r,A){var D,J;if(!p)return[];for(var I=0,R=E.order.length;I<R;I++){var N=E.order[I];if(J=E.leftMatch[N].exec(p)){var W=J[1];J.splice(1,1);if(W.substr(W.length-1)!=="\\"){J[1]=(J[1]||"").replace(/\\/g,"");D=E.find[N](J,r,A);if(D!=null){p=p.replace(E.match[N],"");break}}}}D||(D=r.getElementsByTagName("*"));return{set:D,expr:p}};z.filter=function(p,r,A,D){for(var J=p,I=[],R=r,N,W,Da=r&&r[0]&&T(r[0]);p&&r.length;){for(var ua in E.filter)if((N=E.leftMatch[ua].exec(p))!=null&&N[2]){var ya=E.filter[ua],
va,la;la=N[1];W=false;N.splice(1,1);if(la.substr(la.length-1)!=="\\"){if(R===I)I=[];if(E.preFilter[ua])if(N=E.preFilter[ua](N,R,A,I,D,Da)){if(N===true)continue}else W=va=true;if(N)for(var Ea=0;(la=R[Ea])!=null;Ea++)if(la){va=ya(la,N,Ea,R);var Ya=D^!!va;if(A&&va!=null)if(Ya)W=true;else R[Ea]=false;else if(Ya){I.push(la);W=true}}if(va!==b){A||(R=I);p=p.replace(E.match[ua],"");if(!W)return[];break}}}if(p===J)if(W==null)z.error(p);else break;J=p}return R};z.error=function(p){throw"Syntax error, unrecognized expression: "+
p;};var E=z.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},
leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(p){return p.getAttribute("href")}},relative:{"+":function(p,r){var A=typeof r==="string",D=A&&!/\W/.test(r);A=A&&!D;if(D)r=r.toLowerCase();D=0;for(var J=p.length,I;D<J;D++)if(I=p[D]){for(;(I=I.previousSibling)&&I.nodeType!==1;);p[D]=A||I&&I.nodeName.toLowerCase()===r?I||false:I===r}A&&z.filter(r,p,true)},">":function(p,r){var A=typeof r==="string";if(A&&!/\W/.test(r)){r=r.toLowerCase();for(var D=0,J=p.length;D<J;D++){var I=
p[D];if(I){A=I.parentNode;p[D]=A.nodeName.toLowerCase()===r?A:false}}}else{D=0;for(J=p.length;D<J;D++)if(I=p[D])p[D]=A?I.parentNode:I.parentNode===r;A&&z.filter(r,p,true)}},"":function(p,r,A){var D=m++,J=k;if(typeof r==="string"&&!/\W/.test(r)){var I=r=r.toLowerCase();J=h}J("parentNode",r,D,p,I,A)},"~":function(p,r,A){var D=m++,J=k;if(typeof r==="string"&&!/\W/.test(r)){var I=r=r.toLowerCase();J=h}J("previousSibling",r,D,p,I,A)}},find:{ID:function(p,r,A){if(typeof r.getElementById!=="undefined"&&
!A)return(p=r.getElementById(p[1]))?[p]:[]},NAME:function(p,r){if(typeof r.getElementsByName!=="undefined"){var A=[];r=r.getElementsByName(p[1]);for(var D=0,J=r.length;D<J;D++)r[D].getAttribute("name")===p[1]&&A.push(r[D]);return A.length===0?null:A}},TAG:function(p,r){return r.getElementsByTagName(p[1])}},preFilter:{CLASS:function(p,r,A,D,J,I){p=" "+p[1].replace(/\\/g,"")+" ";if(I)return p;I=0;for(var R;(R=r[I])!=null;I++)if(R)if(J^(R.className&&(" "+R.className+" ").replace(/[\t\n]/g," ").indexOf(p)>=
0))A||D.push(R);else if(A)r[I]=false;return false},ID:function(p){return p[1].replace(/\\/g,"")},TAG:function(p){return p[1].toLowerCase()},CHILD:function(p){if(p[1]==="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(p[2]==="even"&&"2n"||p[2]==="odd"&&"2n+1"||!/\D/.test(p[2])&&"0n+"+p[2]||p[2]);p[2]=r[1]+(r[2]||1)-0;p[3]=r[3]-0}p[0]=m++;return p},ATTR:function(p,r,A,D,J,I){r=p[1].replace(/\\/g,"");if(!I&&E.attrMap[r])p[1]=E.attrMap[r];if(p[2]==="~=")p[4]=" "+p[4]+" ";return p},PSEUDO:function(p,r,A,D,
J){if(p[1]==="not")if((n.exec(p[3])||"").length>1||/^\w/.test(p[3]))p[3]=z(p[3],null,null,r);else{p=z.filter(p[3],r,A,true^J);A||D.push.apply(D,p);return false}else if(E.match.POS.test(p[0])||E.match.CHILD.test(p[0]))return true;return p},POS:function(p){p.unshift(true);return p}},filters:{enabled:function(p){return p.disabled===false&&p.type!=="hidden"},disabled:function(p){return p.disabled===true},checked:function(p){return p.checked===true},selected:function(p){return p.selected===true},parent:function(p){return!!p.firstChild},
empty:function(p){return!p.firstChild},has:function(p,r,A){return!!z(A[3],p).length},header:function(p){return/h\d/i.test(p.nodeName)},text:function(p){return"text"===p.type},radio:function(p){return"radio"===p.type},checkbox:function(p){return"checkbox"===p.type},file:function(p){return"file"===p.type},password:function(p){return"password"===p.type},submit:function(p){return"submit"===p.type},image:function(p){return"image"===p.type},reset:function(p){return"reset"===p.type},button:function(p){return"button"===
p.type||p.nodeName.toLowerCase()==="button"},input:function(p){return/input|select|textarea|button/i.test(p.nodeName)}},setFilters:{first:function(p,r){return r===0},last:function(p,r,A,D){return r===D.length-1},even:function(p,r){return r%2===0},odd:function(p,r){return r%2===1},lt:function(p,r,A){return r<A[3]-0},gt:function(p,r,A){return r>A[3]-0},nth:function(p,r,A){return A[3]-0===r},eq:function(p,r,A){return A[3]-0===r}},filter:{PSEUDO:function(p,r,A,D){var J=r[1],I=E.filters[J];if(I)return I(p,
A,r,D);else if(J==="contains")return(p.textContent||p.innerText||f([p])||"").indexOf(r[3])>=0;else if(J==="not"){r=r[3];A=0;for(D=r.length;A<D;A++)if(r[A]===p)return false;return true}else z.error("Syntax error, unrecognized expression: "+J)},CHILD:function(p,r){var A=r[1],D=p;switch(A){case "only":case "first":for(;D=D.previousSibling;)if(D.nodeType===1)return false;if(A==="first")return true;D=p;case "last":for(;D=D.nextSibling;)if(D.nodeType===1)return false;return true;case "nth":A=r[2];var J=
r[3];if(A===1&&J===0)return true;r=r[0];var I=p.parentNode;if(I&&(I.sizcache!==r||!p.nodeIndex)){var R=0;for(D=I.firstChild;D;D=D.nextSibling)if(D.nodeType===1)D.nodeIndex=++R;I.sizcache=r}p=p.nodeIndex-J;return A===0?p===0:p%A===0&&p/A>=0}},ID:function(p,r){return p.nodeType===1&&p.getAttribute("id")===r},TAG:function(p,r){return r==="*"&&p.nodeType===1||p.nodeName.toLowerCase()===r},CLASS:function(p,r){return(" "+(p.className||p.getAttribute("class"))+" ").indexOf(r)>-1},ATTR:function(p,r){var A=
r[1];p=E.attrHandle[A]?E.attrHandle[A](p):p[A]!=null?p[A]:p.getAttribute(A);A=p+"";var D=r[2];r=r[4];return p==null?D==="!=":D==="="?A===r:D==="*="?A.indexOf(r)>=0:D==="~="?(" "+A+" ").indexOf(r)>=0:!r?A&&p!==false:D==="!="?A!==r:D==="^="?A.indexOf(r)===0:D==="$="?A.substr(A.length-r.length)===r:D==="|="?A===r||A.substr(0,r.length+1)===r+"-":false},POS:function(p,r,A,D){var J=E.setFilters[r[2]];if(J)return J(p,A,r,D)}}},K=E.match.POS;for(var O in E.match){E.match[O]=new RegExp(E.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source);
E.leftMatch[O]=new RegExp(/(^(?:.|\r|\n)*?)/.source+E.match[O].source.replace(/\\(\d+)/g,function(p,r){return"\\"+(r-0+1)}))}var Y=function(p,r){p=Array.prototype.slice.call(p,0);if(r){r.push.apply(r,p);return r}return p};try{Array.prototype.slice.call(v.documentElement.childNodes,0)}catch(da){Y=function(p,r){r=r||[];if(u.call(p)==="[object Array]")Array.prototype.push.apply(r,p);else if(typeof p.length==="number")for(var A=0,D=p.length;A<D;A++)r.push(p[A]);else for(A=0;p[A];A++)r.push(p[A]);return r}}var aa;
if(v.documentElement.compareDocumentPosition)aa=function(p,r){if(!p.compareDocumentPosition||!r.compareDocumentPosition){if(p==r)t=true;return p.compareDocumentPosition?-1:1}p=p.compareDocumentPosition(r)&4?-1:p===r?0:1;if(p===0)t=true;return p};else if("sourceIndex"in v.documentElement)aa=function(p,r){if(!p.sourceIndex||!r.sourceIndex){if(p==r)t=true;return p.sourceIndex?-1:1}p=p.sourceIndex-r.sourceIndex;if(p===0)t=true;return p};else if(v.createRange)aa=function(p,r){if(!p.ownerDocument||!r.ownerDocument){if(p==
r)t=true;return p.ownerDocument?-1:1}var A=p.ownerDocument.createRange(),D=r.ownerDocument.createRange();A.setStart(p,0);A.setEnd(p,0);D.setStart(r,0);D.setEnd(r,0);p=A.compareBoundaryPoints(Range.START_TO_END,D);if(p===0)t=true;return p};(function(){var p=v.createElement("div"),r="script"+(new Date).getTime();p.innerHTML="<a name='"+r+"'/>";var A=v.documentElement;A.insertBefore(p,A.firstChild);if(v.getElementById(r)){E.find.ID=function(D,J,I){if(typeof J.getElementById!=="undefined"&&!I)return(J=
J.getElementById(D[1]))?J.id===D[1]||typeof J.getAttributeNode!=="undefined"&&J.getAttributeNode("id").nodeValue===D[1]?[J]:b:[]};E.filter.ID=function(D,J){var I=typeof D.getAttributeNode!=="undefined"&&D.getAttributeNode("id");return D.nodeType===1&&I&&I.nodeValue===J}}A.removeChild(p);A=p=null})();(function(){var p=v.createElement("div");p.appendChild(v.createComment(""));if(p.getElementsByTagName("*").length>0)E.find.TAG=function(r,A){A=A.getElementsByTagName(r[1]);if(r[1]==="*"){r=[];for(var D=
0;A[D];D++)A[D].nodeType===1&&r.push(A[D]);A=r}return A};p.innerHTML="<a href='#'></a>";if(p.firstChild&&typeof p.firstChild.getAttribute!=="undefined"&&p.firstChild.getAttribute("href")!=="#")E.attrHandle.href=function(r){return r.getAttribute("href",2)};p=null})();v.querySelectorAll&&function(){var p=z,r=v.createElement("div");r.innerHTML="<p class='TEST'></p>";if(!(r.querySelectorAll&&r.querySelectorAll(".TEST").length===0)){z=function(D,J,I,R){J=J||v;if(!R&&J.nodeType===9&&!T(J))try{return Y(J.querySelectorAll(D),
I)}catch(N){}return p(D,J,I,R)};for(var A in p)z[A]=p[A];r=null}}();(function(){var p=v.createElement("div");p.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!p.getElementsByClassName||p.getElementsByClassName("e").length===0)){p.lastChild.className="e";if(p.getElementsByClassName("e").length!==1){E.order.splice(1,0,"CLASS");E.find.CLASS=function(r,A,D){if(typeof A.getElementsByClassName!=="undefined"&&!D)return A.getElementsByClassName(r[1])};p=null}}})();var ma=v.compareDocumentPosition?
function(p,r){return!!(p.compareDocumentPosition(r)&16)}:function(p,r){return p!==r&&(p.contains?p.contains(r):true)},T=function(p){return(p=(p?p.ownerDocument||p:0).documentElement)?p.nodeName!=="HTML":false},Ka=function(p,r){var A=[],D="",J;for(r=r.nodeType?[r]:r;J=E.match.PSEUDO.exec(p);){D+=J[0];p=p.replace(E.match.PSEUDO,"")}p=E.relative[p]?p+"*":p;J=0;for(var I=r.length;J<I;J++)z(p,r[J],A);return z.filter(D,A)};i.find=z;i.expr=z.selectors;i.expr[":"]=i.expr.filters;i.unique=z.uniqueSort;i.text=
f;i.isXMLDoc=T;i.contains=ma})();var hb=/Until$/,ib=/^(?:parents|prevUntil|prevAll)/,jb=/,/;ka=Array.prototype.slice;var Za=function(f,h,k){if(i.isFunction(h))return i.grep(f,function(m,u){return!!h.call(m,u,m)===k});else if(h.nodeType)return i.grep(f,function(m){return m===h===k});else if(typeof h==="string"){var n=i.grep(f,function(m){return m.nodeType===1});if(U.test(h))return i.filter(h,n,!k);else h=i.filter(h,n)}return i.grep(f,function(m){return i.inArray(m,h)>=0===k})};i.fn.extend({find:function(f){for(var h=
this.pushStack("","find",f),k=0,n=0,m=this.length;n<m;n++){k=h.length;i.find(f,this[n],h);if(n>0)for(var u=k;u<h.length;u++)for(var t=0;t<k;t++)if(h[t]===h[u]){h.splice(u--,1);break}}return h},has:function(f){var h=i(f);return this.filter(function(){for(var k=0,n=h.length;k<n;k++)if(i.contains(this,h[k]))return true})},not:function(f){return this.pushStack(Za(this,f,false),"not",f)},filter:function(f){return this.pushStack(Za(this,f,true),"filter",f)},is:function(f){return!!f&&i.filter(f,this).length>
0},closest:function(f,h){if(i.isArray(f)){var k=[],n=this[0],m,u={},t;if(n&&f.length){m=0;for(var F=f.length;m<F;m++){t=f[m];u[t]||(u[t]=i.expr.match.POS.test(t)?i(t,h||this.context):t)}for(;n&&n.ownerDocument&&n!==h;){for(t in u){m=u[t];if(m.jquery?m.index(n)>-1:i(n).is(m)){k.push({selector:t,elem:n});delete u[t]}}n=n.parentNode}}return k}var z=i.expr.match.POS.test(f)?i(f,h||this.context):null;return this.map(function(E,K){for(;K&&K.ownerDocument&&K!==h;){if(z?z.index(K)>-1:i(K).is(f))return K;
K=K.parentNode}return null})},index:function(f){if(!f||typeof f==="string")return i.inArray(this[0],f?i(f):this.parent().children());return i.inArray(f.jquery?f[0]:f,this)},add:function(f,h){f=typeof f==="string"?i(f,h||this.context):i.makeArray(f);h=i.merge(this.get(),f);return this.pushStack(w(f[0])||w(h[0])?h:i.unique(h))},andSelf:function(){return this.add(this.prevObject)}});i.each({parent:function(f){return(f=f.parentNode)&&f.nodeType!==11?f:null},parents:function(f){return i.dir(f,"parentNode")},
parentsUntil:function(f,h,k){return i.dir(f,"parentNode",k)},next:function(f){return i.nth(f,2,"nextSibling")},prev:function(f){return i.nth(f,2,"previousSibling")},nextAll:function(f){return i.dir(f,"nextSibling")},prevAll:function(f){return i.dir(f,"previousSibling")},nextUntil:function(f,h,k){return i.dir(f,"nextSibling",k)},prevUntil:function(f,h,k){return i.dir(f,"previousSibling",k)},siblings:function(f){return i.sibling(f.parentNode.firstChild,f)},children:function(f){return i.sibling(f.firstChild)},
contents:function(f){return i.nodeName(f,"iframe")?f.contentDocument||f.contentWindow.document:i.makeArray(f.childNodes)}},function(f,h){i.fn[f]=function(k,n){var m=i.map(this,h,k);hb.test(f)||(n=k);if(n&&typeof n==="string")m=i.filter(n,m);m=this.length>1?i.unique(m):m;if((this.length>1||jb.test(n))&&ib.test(f))m=m.reverse();return this.pushStack(m,f,ka.call(arguments).join(","))}});i.extend({filter:function(f,h,k){if(k)f=":not("+f+")";return i.find.matches(f,h)},dir:function(f,h,k){var n=[];for(f=
f[h];f&&f.nodeType!==9&&(k===b||f.nodeType!==1||!i(f).is(k));){f.nodeType===1&&n.push(f);f=f[h]}return n},nth:function(f,h,k){h=h||1;for(var n=0;f;f=f[k])if(f.nodeType===1&&++n===h)break;return f},sibling:function(f,h){for(var k=[];f;f=f.nextSibling)f.nodeType===1&&f!==h&&k.push(f);return k}});var $a=/ jQuery\d+="(?:\d+|null)"/g,Fa=/^\s+/,ab=/(<([\w:]+)[^>]*?)\/>/g,kb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,bb=/<([\w:]+)/,lb=/<tbody/i,mb=/<|&#?\w+;/,Qa=/<script|<object|<embed|<option|<style/i,
Ra=/checked\s*(?:[^=]|=\s*.checked.)/i,cb=function(f,h,k){return kb.test(k)?f:h+"></"+k+">"},na={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};na.optgroup=na.option;na.tbody=na.tfoot=na.colgroup=na.caption=na.thead;na.th=
na.td;if(!i.support.htmlSerialize)na._default=[1,"div<div>","</div>"];i.fn.extend({text:function(f){if(i.isFunction(f))return this.each(function(h){var k=i(this);k.text(f.call(this,h,k.text()))});if(typeof f!=="object"&&f!==b)return this.empty().append((this[0]&&this[0].ownerDocument||v).createTextNode(f));return i.text(this)},wrapAll:function(f){if(i.isFunction(f))return this.each(function(k){i(this).wrapAll(f.call(this,k))});if(this[0]){var h=i(f,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&
h.insertBefore(this[0]);h.map(function(){for(var k=this;k.firstChild&&k.firstChild.nodeType===1;)k=k.firstChild;return k}).append(this)}return this},wrapInner:function(f){if(i.isFunction(f))return this.each(function(h){i(this).wrapInner(f.call(this,h))});return this.each(function(){var h=i(this),k=h.contents();k.length?k.wrapAll(f):h.append(f)})},wrap:function(f){return this.each(function(){i(this).wrapAll(f)})},unwrap:function(){return this.parent().each(function(){i.nodeName(this,"body")||i(this).replaceWith(this.childNodes)}).end()},
append:function(){return this.domManip(arguments,true,function(f){this.nodeType===1&&this.appendChild(f)})},prepend:function(){return this.domManip(arguments,true,function(f){this.nodeType===1&&this.insertBefore(f,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(h){this.parentNode.insertBefore(h,this)});else if(arguments.length){var f=i(arguments[0]);f.push.apply(f,this.toArray());return this.pushStack(f,"before",arguments)}},after:function(){if(this[0]&&
this[0].parentNode)return this.domManip(arguments,false,function(h){this.parentNode.insertBefore(h,this.nextSibling)});else if(arguments.length){var f=this.pushStack(this,"after",arguments);f.push.apply(f,i(arguments[0]).toArray());return f}},remove:function(f,h){for(var k=0,n;(n=this[k])!=null;k++)if(!f||i.filter(f,[n]).length){if(!h&&n.nodeType===1){i.cleanData(n.getElementsByTagName("*"));i.cleanData([n])}n.parentNode&&n.parentNode.removeChild(n)}return this},empty:function(){for(var f=0,h;(h=
this[f])!=null;f++)for(h.nodeType===1&&i.cleanData(h.getElementsByTagName("*"));h.firstChild;)h.removeChild(h.firstChild);return this},clone:function(f){var h=this.map(function(){if(!i.support.noCloneEvent&&!i.isXMLDoc(this)){var k=this.outerHTML,n=this.ownerDocument;if(!k){k=n.createElement("div");k.appendChild(this.cloneNode(true));k=k.innerHTML}return i.clean([k.replace($a,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(Fa,"")],n)[0]}else return this.cloneNode(true)});if(f===true){G(this,h);
G(this.find("*"),h.find("*"))}return h},html:function(f){if(f===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace($a,""):null;else if(typeof f==="string"&&!Qa.test(f)&&(i.support.leadingWhitespace||!Fa.test(f))&&!na[(bb.exec(f)||["",""])[1].toLowerCase()]){f=f.replace(ab,cb);try{for(var h=0,k=this.length;h<k;h++)if(this[h].nodeType===1){i.cleanData(this[h].getElementsByTagName("*"));this[h].innerHTML=f}}catch(n){this.empty().append(f)}}else i.isFunction(f)?this.each(function(m){var u=
i(this),t=u.html();u.empty().append(function(){return f.call(this,m,t)})}):this.empty().append(f);return this},replaceWith:function(f){if(this[0]&&this[0].parentNode){if(i.isFunction(f))return this.each(function(h){var k=i(this),n=k.html();k.replaceWith(f.call(this,h,n))});if(typeof f!=="string")f=i(f).detach();return this.each(function(){var h=this.nextSibling,k=this.parentNode;i(this).remove();h?i(h).before(f):i(k).append(f)})}else return this.pushStack(i(i.isFunction(f)?f():f),"replaceWith",f)},
detach:function(f){return this.remove(f,true)},domManip:function(f,h,k){function n(O){return i.nodeName(O,"table")?O.getElementsByTagName("tbody")[0]||O.appendChild(O.ownerDocument.createElement("tbody")):O}var m,u,t=f[0],F=[],z;if(!i.support.checkClone&&arguments.length===3&&typeof t==="string"&&Ra.test(t))return this.each(function(){i(this).domManip(f,h,k,true)});if(i.isFunction(t))return this.each(function(O){var Y=i(this);f[0]=t.call(this,O,h?Y.html():b);Y.domManip(f,h,k)});if(this[0]){m=t&&t.parentNode;
m=i.support.parentNode&&m&&m.nodeType===11&&m.childNodes.length===this.length?{fragment:m}:C(f,this,F);z=m.fragment;if(u=z.childNodes.length===1?(z=z.firstChild):z.firstChild){h=h&&i.nodeName(u,"tr");for(var E=0,K=this.length;E<K;E++)k.call(h?n(this[E],u):this[E],E>0||m.cacheable||this.length>1?z.cloneNode(true):z)}F.length&&i.each(F,d)}return this}});i.fragments={};i.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(f,h){i.fn[f]=
function(k){var n=[];k=i(k);var m=this.length===1&&this[0].parentNode;if(m&&m.nodeType===11&&m.childNodes.length===1&&k.length===1){k[h](this[0]);return this}else{m=0;for(var u=k.length;m<u;m++){var t=(m>0?this.clone(true):this).get();i.fn[h].apply(i(k[m]),t);n=n.concat(t)}return this.pushStack(n,f,k.selector)}}});i.extend({clean:function(f,h,k,n){h=h||v;if(typeof h.createElement==="undefined")h=h.ownerDocument||h[0]&&h[0].ownerDocument||v;for(var m=[],u=0,t;(t=f[u])!=null;u++){if(typeof t==="number")t+=
"";if(t){if(typeof t==="string"&&!mb.test(t))t=h.createTextNode(t);else if(typeof t==="string"){t=t.replace(ab,cb);var F=(bb.exec(t)||["",""])[1].toLowerCase(),z=na[F]||na._default,E=z[0],K=h.createElement("div");for(K.innerHTML=z[1]+t+z[2];E--;)K=K.lastChild;if(!i.support.tbody){E=lb.test(t);F=F==="table"&&!E?K.firstChild&&K.firstChild.childNodes:z[1]==="<table>"&&!E?K.childNodes:[];for(z=F.length-1;z>=0;--z)i.nodeName(F[z],"tbody")&&!F[z].childNodes.length&&F[z].parentNode.removeChild(F[z])}!i.support.leadingWhitespace&&
Fa.test(t)&&K.insertBefore(h.createTextNode(Fa.exec(t)[0]),K.firstChild);t=K.childNodes}if(t.nodeType)m.push(t);else m=i.merge(m,t)}}if(k)for(u=0;m[u];u++)if(n&&i.nodeName(m[u],"script")&&(!m[u].type||m[u].type.toLowerCase()==="text/javascript"))n.push(m[u].parentNode?m[u].parentNode.removeChild(m[u]):m[u]);else{m[u].nodeType===1&&m.splice.apply(m,[u+1,0].concat(i.makeArray(m[u].getElementsByTagName("script"))));k.appendChild(m[u])}return m},cleanData:function(f){for(var h,k,n=i.cache,m=i.event.special,
u=i.support.deleteExpando,t=0,F;(F=f[t])!=null;t++)if(k=F[i.expando]){h=n[k];if(h.events)for(var z in h.events)m[z]?i.event.remove(F,z):Ta(F,z,h.handle);if(u)delete F[i.expando];else F.removeAttribute&&F.removeAttribute(i.expando);delete n[k]}}});var nb=/z-?index|font-?weight|opacity|zoom|line-?height/i,db=/alpha\([^)]*\)/,eb=/opacity=([^)]*)/,La=/float/i,Ma=/-([a-z])/ig,ob=/([A-Z])/g,pb=/^-?\d+(?:px)?$/i,qb=/^-?\d/,rb={position:"absolute",visibility:"hidden",display:"block"},sb=["Left","Right"],
tb=["Top","Bottom"],ub=v.defaultView&&v.defaultView.getComputedStyle,fb=i.support.cssFloat?"cssFloat":"styleFloat",Na=function(f,h){return h.toUpperCase()};i.fn.css=function(f,h){return e(this,f,h,true,function(k,n,m){if(m===b)return i.curCSS(k,n);if(typeof m==="number"&&!nb.test(n))m+="px";i.style(k,n,m)})};i.extend({style:function(f,h,k){if(!f||f.nodeType===3||f.nodeType===8)return b;if((h==="width"||h==="height")&&parseFloat(k)<0)k=b;var n=f.style||f,m=k!==b;if(!i.support.opacity&&h==="opacity"){if(m){n.zoom=
1;h=parseInt(k,10)+""==="NaN"?"":"alpha(opacity="+k*100+")";f=n.filter||i.curCSS(f,"filter")||"";n.filter=db.test(f)?f.replace(db,h):h}return n.filter&&n.filter.indexOf("opacity=")>=0?parseFloat(eb.exec(n.filter)[1])/100+"":""}if(La.test(h))h=fb;h=h.replace(Ma,Na);if(m)n[h]=k;return n[h]},css:function(f,h,k,n){if(h==="width"||h==="height"){var m,u=h==="width"?sb:tb;function t(){m=h==="width"?f.offsetWidth:f.offsetHeight;n!=="border"&&i.each(u,function(){n||(m-=parseFloat(i.curCSS(f,"padding"+this,
true))||0);if(n==="margin")m+=parseFloat(i.curCSS(f,"margin"+this,true))||0;else m-=parseFloat(i.curCSS(f,"border"+this+"Width",true))||0})}f.offsetWidth!==0?t():i.swap(f,rb,t);return Math.max(0,Math.round(m))}return i.curCSS(f,h,k)},curCSS:function(f,h,k){var n,m=f.style;if(!i.support.opacity&&h==="opacity"&&f.currentStyle){n=eb.test(f.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return n===""?"1":n}if(La.test(h))h=fb;if(!k&&m&&m[h])n=m[h];else if(ub){if(La.test(h))h="float";h=h.replace(ob,
"-$1").toLowerCase();m=f.ownerDocument.defaultView;if(!m)return null;if(f=m.getComputedStyle(f,null))n=f.getPropertyValue(h);if(h==="opacity"&&n==="")n="1"}else if(f.currentStyle){k=h.replace(Ma,Na);n=f.currentStyle[h]||f.currentStyle[k];if(!pb.test(n)&&qb.test(n)){h=m.left;var u=f.runtimeStyle.left;f.runtimeStyle.left=f.currentStyle.left;m.left=k==="fontSize"?"1em":n||0;n=m.pixelLeft+"px";m.left=h;f.runtimeStyle.left=u}}return n},swap:function(f,h,k){var n={};for(var m in h){n[m]=f.style[m];f.style[m]=
h[m]}k.call(f);for(m in h)f.style[m]=n[m]}});if(i.expr&&i.expr.filters){i.expr.filters.hidden=function(f){var h=f.offsetWidth,k=f.offsetHeight,n=f.nodeName.toLowerCase()==="tr";return h===0&&k===0&&!n?true:h>0&&k>0&&!n?false:i.curCSS(f,"display")==="none"};i.expr.filters.visible=function(f){return!i.expr.filters.hidden(f)}}var vb=g(),wb=/<script(.|\s)*?\/script>/gi,xb=/select|textarea/i,yb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,za=/=\?(&|$)/,
Oa=/\?/,zb=/(\?|&)_=.*?(&|$)/,Ab=/^(\w+:)?\/\/([^\/?#]+)/,Bb=/%20/g,Cb=i.fn.load;i.fn.extend({load:function(f,h,k){if(typeof f!=="string")return Cb.call(this,f);else if(!this.length)return this;var n=f.indexOf(" ");if(n>=0){var m=f.slice(n,f.length);f=f.slice(0,n)}n="GET";if(h)if(i.isFunction(h)){k=h;h=null}else if(typeof h==="object"){h=i.param(h,i.ajaxSettings.traditional);n="POST"}var u=this;i.ajax({url:f,type:n,dataType:"html",data:h,complete:function(t,F){if(F==="success"||F==="notmodified")u.html(m?
i("<div />").append(t.responseText.replace(wb,"")).find(m):t.responseText);k&&u.each(k,[t.responseText,F,t])}});return this},serialize:function(){return i.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?i.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||xb.test(this.nodeName)||yb.test(this.type))}).map(function(f,h){f=i(this).val();return f==null?null:i.isArray(f)?i.map(f,function(k){return{name:h.name,
value:k}}):{name:h.name,value:f}}).get()}});i.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(f,h){i.fn[h]=function(k){return this.bind(h,k)}});i.extend({get:function(f,h,k,n){if(i.isFunction(h)){n=n||k;k=h;h=null}return i.ajax({type:"GET",url:f,data:h,success:k,dataType:n})},getScript:function(f,h){return i.get(f,null,h,"script")},getJSON:function(f,h,k){return i.get(f,h,k,"json")},post:function(f,h,k,n){if(i.isFunction(h)){n=n||k;k=h;h={}}return i.ajax({type:"POST",
url:f,data:h,success:k,dataType:n})},ajaxSetup:function(f){i.extend(i.ajaxSettings,f)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:a.XMLHttpRequest&&(a.location.protocol!=="file:"||!a.ActiveXObject)?function(){return new a.XMLHttpRequest}:function(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(f){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",
json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(f){function h(){m.success&&m.success.call(z,F,t,T);m.global&&n("ajaxSuccess",[T,m])}function k(){m.complete&&m.complete.call(z,T,t);m.global&&n("ajaxComplete",[T,m]);m.global&&!--i.active&&i.event.trigger("ajaxStop")}function n(J,I){(m.context?i(m.context):i.event).trigger(J,I)}var m=i.extend(true,{},i.ajaxSettings,f),u,t,F,z=f&&f.context||m,E=m.type.toUpperCase();if(m.data&&m.processData&&
typeof m.data!=="string")m.data=i.param(m.data,m.traditional);if(m.dataType==="jsonp"){if(E==="GET")za.test(m.url)||(m.url+=(Oa.test(m.url)?"&":"?")+(m.jsonp||"callback")+"=?");else if(!m.data||!za.test(m.data))m.data=(m.data?m.data+"&":"")+(m.jsonp||"callback")+"=?";m.dataType="json"}if(m.dataType==="json"&&(m.data&&za.test(m.data)||za.test(m.url))){u=m.jsonpCallback||"jsonp"+vb++;if(m.data)m.data=(m.data+"").replace(za,"="+u+"$1");m.url=m.url.replace(za,"="+u+"$1");m.dataType="script";a[u]=a[u]||
function(J){F=J;h();k();a[u]=b;try{delete a[u]}catch(I){}Y&&Y.removeChild(da)}}if(m.dataType==="script"&&m.cache===null)m.cache=false;if(m.cache===false&&E==="GET"){var K=g(),O=m.url.replace(zb,"$1_="+K+"$2");m.url=O+(O===m.url?(Oa.test(m.url)?"&":"?")+"_="+K:"")}if(m.data&&E==="GET")m.url+=(Oa.test(m.url)?"&":"?")+m.data;m.global&&!i.active++&&i.event.trigger("ajaxStart");K=(K=Ab.exec(m.url))&&(K[1]&&K[1]!==location.protocol||K[2]!==location.host);if(m.dataType==="script"&&E==="GET"&&K){var Y=v.getElementsByTagName("head")[0]||
v.documentElement,da=v.createElement("script");da.src=m.url;if(m.scriptCharset)da.charset=m.scriptCharset;if(!u){var aa=false;da.onload=da.onreadystatechange=function(){if(!aa&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){aa=true;h();k();da.onload=da.onreadystatechange=null;Y&&da.parentNode&&Y.removeChild(da)}}}Y.insertBefore(da,Y.firstChild);return b}var ma=false,T=m.xhr();if(T){m.username?T.open(E,m.url,m.async,m.username,m.password):T.open(E,m.url,m.async);try{if(m.data||
f&&f.contentType)T.setRequestHeader("Content-Type",m.contentType);if(m.ifModified){i.lastModified[m.url]&&T.setRequestHeader("If-Modified-Since",i.lastModified[m.url]);i.etag[m.url]&&T.setRequestHeader("If-None-Match",i.etag[m.url])}K||T.setRequestHeader("X-Requested-With","XMLHttpRequest");T.setRequestHeader("Accept",m.dataType&&m.accepts[m.dataType]?m.accepts[m.dataType]+", */*":m.accepts._default)}catch(Ka){}if(m.beforeSend&&m.beforeSend.call(z,T,m)===false){m.global&&!--i.active&&i.event.trigger("ajaxStop");
T.abort();return false}m.global&&n("ajaxSend",[T,m]);var p=T.onreadystatechange=function(J){if(!T||T.readyState===0||J==="abort"){ma||k();ma=true;if(T)T.onreadystatechange=i.noop}else if(!ma&&T&&(T.readyState===4||J==="timeout")){ma=true;T.onreadystatechange=i.noop;t=J==="timeout"?"timeout":!i.httpSuccess(T)?"error":m.ifModified&&i.httpNotModified(T,m.url)?"notmodified":"success";var I;if(t==="success")try{F=i.httpData(T,m.dataType,m)}catch(R){t="parsererror";I=R}if(t==="success"||t==="notmodified")u||
h();else i.handleError(m,T,t,I);k();J==="timeout"&&T.abort();if(m.async)T=null}};try{var r=T.abort;T.abort=function(){T&&r.call(T);p("abort")}}catch(A){}m.async&&m.timeout>0&&setTimeout(function(){T&&!ma&&p("timeout")},m.timeout);try{T.send(E==="POST"||E==="PUT"||E==="DELETE"?m.data:null)}catch(D){i.handleError(m,T,null,D);k()}m.async||p();return T}},handleError:function(f,h,k,n){if(f.error)f.error.call(f.context||f,h,k,n);if(f.global)(f.context?i(f.context):i.event).trigger("ajaxError",[h,f,n])},
active:0,httpSuccess:function(f){try{return!f.status&&location.protocol==="file:"||f.status>=200&&f.status<300||f.status===304||f.status===1223||f.status===0}catch(h){}return false},httpNotModified:function(f,h){var k=f.getResponseHeader("Last-Modified"),n=f.getResponseHeader("Etag");if(k)i.lastModified[h]=k;if(n)i.etag[h]=n;return f.status===304||f.status===0},httpData:function(f,h,k){var n=f.getResponseHeader("content-type")||"",m=h==="xml"||!h&&n.indexOf("xml")>=0;f=m?f.responseXML:f.responseText;
m&&f.documentElement.nodeName==="parsererror"&&i.error("parsererror");if(k&&k.dataFilter)f=k.dataFilter(f,h);if(typeof f==="string")if(h==="json"||!h&&n.indexOf("json")>=0)f=i.parseJSON(f);else if(h==="script"||!h&&n.indexOf("javascript")>=0)i.globalEval(f);return f},param:function(f,h){function k(t,F){if(i.isArray(F))i.each(F,function(z,E){h||/\[\]$/.test(t)?n(t,E):k(t+"["+(typeof E==="object"||i.isArray(E)?z:"")+"]",E)});else!h&&F!=null&&typeof F==="object"?i.each(F,function(z,E){k(t+"["+z+"]",
E)}):n(t,F)}function n(t,F){F=i.isFunction(F)?F():F;m[m.length]=encodeURIComponent(t)+"="+encodeURIComponent(F)}var m=[];if(h===b)h=i.ajaxSettings.traditional;if(i.isArray(f)||f.jquery)i.each(f,function(){n(this.name,this.value)});else for(var u in f)k(u,f[u]);return m.join("&").replace(Bb,"+")}});var Pa={},Db=/toggle|show|hide/,Eb=/^([+-]=)?([\d+-.]+)(.*)$/,Ga,Sa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],
["opacity"]];i.fn.extend({show:function(f,h){if(f||f===0)return this.animate(B("show",3),f,h);else{f=0;for(h=this.length;f<h;f++){var k=i.data(this[f],"olddisplay");this[f].style.display=k||"";if(i.css(this[f],"display")==="none"){k=this[f].nodeName;var n;if(Pa[k])n=Pa[k];else{var m=i("<"+k+" />").appendTo("body");n=m.css("display");if(n==="none")n="block";m.remove();Pa[k]=n}i.data(this[f],"olddisplay",n)}}f=0;for(h=this.length;f<h;f++)this[f].style.display=i.data(this[f],"olddisplay")||"";return this}},
hide:function(f,h){if(f||f===0)return this.animate(B("hide",3),f,h);else{f=0;for(h=this.length;f<h;f++){var k=i.data(this[f],"olddisplay");!k&&k!=="none"&&i.data(this[f],"olddisplay",i.css(this[f],"display"))}f=0;for(h=this.length;f<h;f++)this[f].style.display="none";return this}},_toggle:i.fn.toggle,toggle:function(f,h){var k=typeof f==="boolean";if(i.isFunction(f)&&i.isFunction(h))this._toggle.apply(this,arguments);else f==null||k?this.each(function(){var n=k?f:i(this).is(":hidden");i(this)[n?"show":
"hide"]()}):this.animate(B("toggle",3),f,h);return this},fadeTo:function(f,h,k){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:h},f,k)},animate:function(f,h,k,n){var m=i.speed(h,k,n);if(i.isEmptyObject(f))return this.each(m.complete);return this[m.queue===false?"each":"queue"](function(){var u=i.extend({},m),t,F=this.nodeType===1&&i(this).is(":hidden"),z=this;for(t in f){var E=t.replace(Ma,Na);if(t!==E){f[E]=f[t];delete f[t];t=E}if(f[t]==="hide"&&F||f[t]==="show"&&!F)return u.complete.call(this);
if((t==="height"||t==="width")&&this.style){u.display=i.css(this,"display");u.overflow=this.style.overflow}if(i.isArray(f[t])){(u.specialEasing=u.specialEasing||{})[t]=f[t][1];f[t]=f[t][0]}}if(u.overflow!=null)this.style.overflow="hidden";u.curAnim=i.extend({},f);i.each(f,function(K,O){var Y=new i.fx(z,u,K);if(Db.test(O))Y[O==="toggle"?F?"show":"hide":O](f);else{var da=Eb.exec(O),aa=Y.cur(true)||0;if(da){O=parseFloat(da[2]);var ma=da[3]||"px";if(ma!=="px"){z.style[K]=(O||1)+ma;aa=(O||1)/Y.cur(true)*
aa;z.style[K]=aa+ma}if(da[1])O=(da[1]==="-="?-1:1)*O+aa;Y.custom(aa,O,ma)}else Y.custom(aa,O,"")}});return true})},stop:function(f,h){var k=i.timers;f&&this.queue([]);this.each(function(){for(var n=k.length-1;n>=0;n--)if(k[n].elem===this){h&&k[n](true);k.splice(n,1)}});h||this.dequeue();return this}});i.each({slideDown:B("show",1),slideUp:B("hide",1),slideToggle:B("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(f,h){i.fn[f]=function(k,n){return this.animate(h,k,n)}});i.extend({speed:function(f,
h,k){var n=f&&typeof f==="object"?f:{complete:k||!k&&h||i.isFunction(f)&&f,duration:f,easing:k&&h||h&&!i.isFunction(h)&&h};n.duration=i.fx.off?0:typeof n.duration==="number"?n.duration:i.fx.speeds[n.duration]||i.fx.speeds._default;n.old=n.complete;n.complete=function(){n.queue!==false&&i(this).dequeue();i.isFunction(n.old)&&n.old.call(this)};return n},easing:{linear:function(f,h,k,n){return k+n*f},swing:function(f,h,k,n){return(-Math.cos(f*Math.PI)/2+0.5)*n+k}},timers:[],fx:function(f,h,k){this.options=
h;this.elem=f;this.prop=k;if(!h.orig)h.orig={}}});i.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(i.fx.step[this.prop]||i.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(f){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(f=parseFloat(i.css(this.elem,this.prop,f)))&&f>-10000?f:parseFloat(i.curCSS(this.elem,
this.prop))||0},custom:function(f,h,k){function n(u){return m.step(u)}this.startTime=g();this.start=f;this.end=h;this.unit=k||this.unit||"px";this.now=this.start;this.pos=this.state=0;var m=this;n.elem=this.elem;if(n()&&i.timers.push(n)&&!Ga)Ga=setInterval(i.fx.tick,13)},show:function(){this.options.orig[this.prop]=i.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());i(this.elem).show()},hide:function(){this.options.orig[this.prop]=
i.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(f){var h=g(),k=true;if(f||h>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var n in this.options.curAnim)if(this.options.curAnim[n]!==true)k=false;if(k){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;f=i.data(this.elem,"olddisplay");this.elem.style.display=f?f:this.options.display;if(i.css(this.elem,
"display")==="none")this.elem.style.display="block"}this.options.hide&&i(this.elem).hide();if(this.options.hide||this.options.show)for(var m in this.options.curAnim)i.style(this.elem,m,this.options.orig[m]);this.options.complete.call(this.elem)}return false}else{m=h-this.startTime;this.state=m/this.options.duration;f=this.options.easing||(i.easing.swing?"swing":"linear");this.pos=i.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||f](this.state,m,0,1,this.options.duration);
this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};i.extend(i.fx,{tick:function(){for(var f=i.timers,h=0;h<f.length;h++)f[h]()||f.splice(h--,1);f.length||i.fx.stop()},stop:function(){clearInterval(Ga);Ga=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(f){i.style(f.elem,"opacity",f.now)},_default:function(f){if(f.elem.style&&f.elem.style[f.prop]!=null)f.elem.style[f.prop]=(f.prop==="width"||f.prop==="height"?Math.max(0,f.now):f.now)+f.unit;else f.elem[f.prop]=
f.now}}});if(i.expr&&i.expr.filters)i.expr.filters.animated=function(f){return i.grep(i.timers,function(h){return f===h.elem}).length};i.fn.offset="getBoundingClientRect"in v.documentElement?function(f){var h=this[0];if(f)return this.each(function(m){i.offset.setOffset(this,f,m)});if(!h||!h.ownerDocument)return null;if(h===h.ownerDocument.body)return i.offset.bodyOffset(h);var k=h.getBoundingClientRect(),n=h.ownerDocument;h=n.body;n=n.documentElement;return{top:k.top+(self.pageYOffset||i.support.boxModel&&
n.scrollTop||h.scrollTop)-(n.clientTop||h.clientTop||0),left:k.left+(self.pageXOffset||i.support.boxModel&&n.scrollLeft||h.scrollLeft)-(n.clientLeft||h.clientLeft||0)}}:function(f){var h=this[0];if(f)return this.each(function(K){i.offset.setOffset(this,f,K)});if(!h||!h.ownerDocument)return null;if(h===h.ownerDocument.body)return i.offset.bodyOffset(h);i.offset.initialize();var k=h.offsetParent,n=h,m=h.ownerDocument,u,t=m.documentElement,F=m.body;n=(m=m.defaultView)?m.getComputedStyle(h,null):h.currentStyle;
for(var z=h.offsetTop,E=h.offsetLeft;(h=h.parentNode)&&h!==F&&h!==t;){if(i.offset.supportsFixedPosition&&n.position==="fixed")break;u=m?m.getComputedStyle(h,null):h.currentStyle;z-=h.scrollTop;E-=h.scrollLeft;if(h===k){z+=h.offsetTop;E+=h.offsetLeft;if(i.offset.doesNotAddBorder&&!(i.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(h.nodeName))){z+=parseFloat(u.borderTopWidth)||0;E+=parseFloat(u.borderLeftWidth)||0}n=k;k=h.offsetParent}if(i.offset.subtractsBorderForOverflowNotVisible&&u.overflow!==
"visible"){z+=parseFloat(u.borderTopWidth)||0;E+=parseFloat(u.borderLeftWidth)||0}n=u}if(n.position==="relative"||n.position==="static"){z+=F.offsetTop;E+=F.offsetLeft}if(i.offset.supportsFixedPosition&&n.position==="fixed"){z+=Math.max(t.scrollTop,F.scrollTop);E+=Math.max(t.scrollLeft,F.scrollLeft)}return{top:z,left:E}};i.offset={initialize:function(){var f=v.body,h=v.createElement("div"),k,n,m,u=parseFloat(i.curCSS(f,"marginTop",true))||0;i.extend(h.style,{position:"absolute",top:0,left:0,margin:0,
border:0,width:"1px",height:"1px",visibility:"hidden"});h.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.insertBefore(h,f.firstChild);k=h.firstChild;n=k.firstChild;m=k.nextSibling.firstChild.firstChild;this.doesNotAddBorder=n.offsetTop!==5;this.doesAddBorderForTableAndCells=
m.offsetTop===5;n.style.position="fixed";n.style.top="20px";this.supportsFixedPosition=n.offsetTop===20||n.offsetTop===15;n.style.position=n.style.top="";k.style.overflow="hidden";k.style.position="relative";this.subtractsBorderForOverflowNotVisible=n.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=f.offsetTop!==u;f.removeChild(h);i.offset.initialize=i.noop},bodyOffset:function(f){var h=f.offsetTop,k=f.offsetLeft;i.offset.initialize();if(i.offset.doesNotIncludeMarginInBodyOffset){h+=parseFloat(i.curCSS(f,
"marginTop",true))||0;k+=parseFloat(i.curCSS(f,"marginLeft",true))||0}return{top:h,left:k}},setOffset:function(f,h,k){if(/static/.test(i.curCSS(f,"position")))f.style.position="relative";var n=i(f),m=n.offset(),u=parseInt(i.curCSS(f,"top",true),10)||0,t=parseInt(i.curCSS(f,"left",true),10)||0;if(i.isFunction(h))h=h.call(f,k,m);k={top:h.top-m.top+u,left:h.left-m.left+t};"using"in h?h.using.call(f,k):n.css(k)}};i.fn.extend({position:function(){if(!this[0])return null;var f=this[0],h=this.offsetParent(),
k=this.offset(),n=/^body|html$/i.test(h[0].nodeName)?{top:0,left:0}:h.offset();k.top-=parseFloat(i.curCSS(f,"marginTop",true))||0;k.left-=parseFloat(i.curCSS(f,"marginLeft",true))||0;n.top+=parseFloat(i.curCSS(h[0],"borderTopWidth",true))||0;n.left+=parseFloat(i.curCSS(h[0],"borderLeftWidth",true))||0;return{top:k.top-n.top,left:k.left-n.left}},offsetParent:function(){return this.map(function(){for(var f=this.offsetParent||v.body;f&&!/^body|html$/i.test(f.nodeName)&&i.css(f,"position")==="static";)f=
f.offsetParent;return f})}});i.each(["Left","Top"],function(f,h){var k="scroll"+h;i.fn[k]=function(n){var m=this[0],u;if(!m)return null;if(n!==b)return this.each(function(){if(u=H(this))u.scrollTo(!f?n:i(u).scrollLeft(),f?n:i(u).scrollTop());else this[k]=n});else return(u=H(m))?"pageXOffset"in u?u[f?"pageYOffset":"pageXOffset"]:i.support.boxModel&&u.document.documentElement[k]||u.document.body[k]:m[k]}});i.each(["Height","Width"],function(f,h){var k=h.toLowerCase();i.fn["inner"+h]=function(){return this[0]?
i.css(this[0],k,false,"padding"):null};i.fn["outer"+h]=function(n){return this[0]?i.css(this[0],k,false,n?"margin":"border"):null};i.fn[k]=function(n){var m=this[0];if(!m)return n==null?null:this;if(i.isFunction(n))return this.each(function(u){var t=i(this);t[k](n.call(this,u,t[k]()))});return"scrollTo"in m&&m.document?m.document.compatMode==="CSS1Compat"&&m.document.documentElement["client"+h]||m.document.body["client"+h]:m.nodeType===9?Math.max(m.documentElement["client"+h],m.body["scroll"+h],m.documentElement["scroll"+
h],m.body["offset"+h],m.documentElement["offset"+h]):n===b?i.css(m,k):this.css(k,typeof n==="string"?n:n+"px")}});a.jQuery=a.$=i})(window);jQuery.fn.log=function(a){console.log("%s: %o",a,this);return this};
(function(a){function b(d,e,g){d=a[d][e].getter||[];d=typeof d=="string"?d.split(/,?\s+/):d;return a.inArray(g,d)!=-1}a.ui={plugin:{add:function(d,e,g){d=a.ui[d].prototype;for(var j in g){d.plugins[j]=d.plugins[j]||[];d.plugins[j].push([e,g[j]])}},call:function(d,e,g){if(e=d.plugins[e])for(var j=0;j<e.length;j++)d.options[e[j][0]]&&e[j][1].apply(d.element,g)}},cssCache:{},css:function(d){if(a.ui.cssCache[d])return a.ui.cssCache[d];var e=a('<div class="ui-gen">').addClass(d).css({position:"absolute",
top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");a.ui.cssCache[d]=!!(!/auto|default/.test(e.css("cursor"))||/^[1-9]/.test(e.css("height"))||/^[1-9]/.test(e.css("width"))||!/none/.test(e.css("backgroundImage"))||!/transparent|rgba\(0, 0, 0, 0\)/.test(e.css("backgroundColor")));try{a("body").get(0).removeChild(e.get(0))}catch(g){}return a.ui.cssCache[d]},disableSelection:function(d){a(d).attr("unselectable","on").css("MozUserSelect","none")},enableSelection:function(d){a(d).attr("unselectable",
"off").css("MozUserSelect","")},hasScroll:function(d,e){e=/top/.test(e||"top")?"scrollTop":"scrollLeft";var g=false;if(d[e]>0)return true;d[e]=1;g=d[e]>0?true:false;d[e]=0;return g}};var c=a.fn.remove;a.fn.remove=function(){a("*",this).add(this).triggerHandler("remove");return c.apply(this,arguments)};a.widget=function(d,e){var g=d.split(".")[0];d=d.split(".")[1];a.fn[d]=function(j){var l=typeof j=="string",o=Array.prototype.slice.call(arguments,1);if(l&&b(g,d,j)){var q=a.data(this[0],d);return q?
q[j].apply(q,o):undefined}return this.each(function(){var s=a.data(this,d);if(l&&s&&a.isFunction(s[j]))s[j].apply(s,o);else l||a.data(this,d,new a[g][d](this,j))})};a[g][d]=function(j,l){var o=this;this.widgetName=d;this.widgetBaseClass=g+"-"+d;this.options=a.extend({},a.widget.defaults,a[g][d].defaults,l);this.element=a(j).bind("setData."+d,function(q,s,w){return o.setData(s,w)}).bind("getData."+d,function(q,s){return o.getData(s)}).bind("remove",function(){return o.destroy()});this.init()};a[g][d].prototype=
a.extend({},a.widget.prototype,e)};a.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(d){return this.options[d]},setData:function(d,e){this.options[d]=e;if(d=="disabled")this.element[e?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")},enable:function(){this.setData("disabled",false)},disable:function(){this.setData("disabled",true)}};a.widget.defaults={disabled:false};a.ui.mouse={mouseInit:function(){var d=this;this.element.bind("mousedown."+
this.widgetName,function(e){return d.mouseDown(e)});if(a.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},mouseDestroy:function(){this.element.unbind("."+this.widgetName);a.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable)},mouseDown:function(d){this._mouseStarted&&this.mouseUp(d);this._mouseDownEvent=d;var e=this,g=d.which==1,j=typeof this.options.cancel=="string"?a(d.target).parents().add(d.target).filter(this.options.cancel).length:
false;if(!g||j||!this.mouseCapture(d))return true;this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){e._mouseDelayMet=true},this.options.delay);if(this.mouseDistanceMet(d)&&this.mouseDelayMet(d)){this._mouseStarted=this.mouseStart(d)!==false;if(!this._mouseStarted){d.preventDefault();return true}}this._mouseMoveDelegate=function(l){return e.mouseMove(l)};this._mouseUpDelegate=function(l){return e.mouseUp(l)};a(document).bind("mousemove."+this.widgetName,
this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(d){if(a.browser.msie&&!d.button)return this.mouseUp(d);if(this._mouseStarted){this.mouseDrag(d);return false}if(this.mouseDistanceMet(d)&&this.mouseDelayMet(d))(this._mouseStarted=this.mouseStart(this._mouseDownEvent,d)!==false)?this.mouseDrag(d):this.mouseUp(d);return!this._mouseStarted},mouseUp:function(d){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+
this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(d)}return false},mouseDistanceMet:function(d){return Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance},mouseDelayMet:function(){return this._mouseDelayMet},mouseStart:function(){},mouseDrag:function(){},mouseStop:function(){},mouseCapture:function(){return true}};a.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);
(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{init:function(){var b=this.options;b.helper=="original"&&!/(relative|absolute|fixed)/.test(this.element.css("position"))&&this.element.css("position","relative");this.element.addClass("ui-draggable");b.disabled&&this.element.addClass("ui-draggable-disabled");this.mouseInit()},mouseStart:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return false;var d=!this.options.handle||!a(this.options.handle,
this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target)d=true});if(!d)return false;if(a.ui.ddmanager)a.ui.ddmanager.current=this;this.helper=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone():this.element;this.helper.parents("body").length||this.helper.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo);this.helper[0]!=this.element[0]&&!/(fixed|absolute)/.test(this.helper.css("position"))&&
this.helper.css("position","absolute");this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0};this.cssPosition=this.helper.css("position");this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:b.pageX-this.offset.left,top:b.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();if(this.offsetParent[0]==
document.body&&a.browser.mozilla)e={top:0,left:0};this.offset.parent={top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};e=this.element.position();this.offset.relative=this.cssPosition=="relative"?{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.offsetParent[0].scrollTop,left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.offsetParent[0].scrollLeft}:{top:0,left:0};this.originalPosition=this.generatePosition(b);
this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(c.cursorAt){if(c.cursorAt.left!=undefined)this.offset.click.left=c.cursorAt.left+this.margins.left;if(c.cursorAt.right!=undefined)this.offset.click.left=this.helperProportions.width-c.cursorAt.right+this.margins.left;if(c.cursorAt.top!=undefined)this.offset.click.top=c.cursorAt.top+this.margins.top;if(c.cursorAt.bottom!=undefined)this.offset.click.top=this.helperProportions.height-c.cursorAt.bottom+this.margins.top}if(c.containment){if(c.containment==
"parent")c.containment=this.helper[0].parentNode;if(c.containment=="document"||c.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(c.containment=="document"?document:window).width()-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),(a(c.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-
this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)];if(!/^(document|window|parent)$/.test(c.containment)){e=a(c.containment)[0];var g=a(c.containment).offset();this.containment=[g.left+(parseInt(a(e).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left,g.top+(parseInt(a(e).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top,g.left+Math.max(e.scrollWidth,
e.offsetWidth)-(parseInt(a(e).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),g.top+Math.max(e.scrollHeight,e.offsetHeight)-(parseInt(a(e).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}}this.propagate("start",b);this.helperProportions={width:this.helper.outerWidth(),
height:this.helper.outerHeight()};a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b);this.helper.addClass("ui-draggable-dragging");this.mouseDrag(b);return true},convertPositionTo:function(b,c){if(!c)c=this.position;b=b=="absolute"?1:-1;return{top:c.top+this.offset.relative.top*b+this.offset.parent.top*b-(this.cssPosition=="fixed"||this.cssPosition=="absolute"&&this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)*b+(this.cssPosition=="fixed"?a(document).scrollTop():
0)*b+this.margins.top*b,left:c.left+this.offset.relative.left*b+this.offset.parent.left*b-(this.cssPosition=="fixed"||this.cssPosition=="absolute"&&this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)*b+(this.cssPosition=="fixed"?a(document).scrollLeft():0)*b+this.margins.left*b}},generatePosition:function(b){var c=this.options;b={top:b.pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"||this.cssPosition=="absolute"&&this.offsetParent[0]==
document.body?0:this.offsetParent[0].scrollTop)-(this.cssPosition=="fixed"?a(document).scrollTop():0),left:b.pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"||this.cssPosition=="absolute"&&this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)-(this.cssPosition=="fixed"?a(document).scrollLeft():0)};if(!this.originalPosition)return b;if(this.containment){if(b.left<this.containment[0])b.left=this.containment[0];if(b.top<this.containment[1])b.top=
this.containment[1];if(b.left>this.containment[2])b.left=this.containment[2];if(b.top>this.containment[3])b.top=this.containment[3]}if(c.grid){var d=this.originalPosition.top+Math.round((b.top-this.originalPosition.top)/c.grid[1])*c.grid[1];b.top=this.containment?!(d<this.containment[1]||d>this.containment[3])?d:!(d<this.containment[1])?d-c.grid[1]:d+c.grid[1]:d;d=this.originalPosition.left+Math.round((b.left-this.originalPosition.left)/c.grid[0])*c.grid[0];b.left=this.containment?!(d<this.containment[0]||
d>this.containment[2])?d:!(d<this.containment[0])?d-c.grid[0]:d+c.grid[0]:d}return b},mouseDrag:function(b){this.position=this.generatePosition(b);this.positionAbs=this.convertPositionTo("absolute");this.position=this.propagate("drag",b)||this.position;if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return false},
mouseStop:function(b){var c=false;if(a.ui.ddmanager&&!this.options.dropBehaviour)c=a.ui.ddmanager.drop(this,b);if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===true){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revert,10)||500,function(){d.propagate("stop",b);d.clear()})}else{this.propagate("stop",b);this.clear()}return false},clear:function(){this.helper.removeClass("ui-draggable-dragging");this.options.helper!="original"&&
!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},plugins:{},uiHash:function(){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options}},propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.uiHash()]);if(b=="drag")this.positionAbs=this.convertPositionTo("absolute");return this.element.triggerHandler(b=="drag"?b:"drag"+b,[c,this.uiHash()],this.options[b])},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable");
this.mouseDestroy()}}}));a.extend(a.ui.draggable,{defaults:{appendTo:"parent",axis:false,cancel:":input",delay:0,distance:1,helper:"original"}});a.ui.plugin.add("draggable","cursor",{start:function(b,c){b=a("body");if(b.css("cursor"))c.options._cursor=b.css("cursor");b.css("cursor",c.options.cursor)},stop:function(b,c){c.options._cursor&&a("body").css("cursor",c.options._cursor)}});a.ui.plugin.add("draggable","zIndex",{start:function(b,c){b=a(c.helper);if(b.css("zIndex"))c.options._zIndex=b.css("zIndex");
b.css("zIndex",c.options.zIndex)},stop:function(b,c){c.options._zIndex&&a(c.helper).css("zIndex",c.options._zIndex)}});a.ui.plugin.add("draggable","opacity",{start:function(b,c){b=a(c.helper);if(b.css("opacity"))c.options._opacity=b.css("opacity");b.css("opacity",c.options.opacity)},stop:function(b,c){c.options._opacity&&a(c.helper).css("opacity",c.options._opacity)}});a.ui.plugin.add("draggable","iframeFix",{start:function(b,c){a(c.options.iframeFix===true?"iframe":c.options.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+
"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(a(this).offset()).appendTo("body")})},stop:function(){a("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","scroll",{start:function(b,c){b=c.options;c=a(this).data("draggable");b.scrollSensitivity=b.scrollSensitivity||20;b.scrollSpeed=b.scrollSpeed||20;c.overflowY=function(d){do{if(/auto|scroll/.test(d.css("overflow"))||/auto|scroll/.test(d.css("overflow-y")))return d;
d=d.parent()}while(d[0].parentNode);return a(document)}(this);c.overflowX=function(d){do{if(/auto|scroll/.test(d.css("overflow"))||/auto|scroll/.test(d.css("overflow-x")))return d;d=d.parent()}while(d[0].parentNode);return a(document)}(this);if(c.overflowY[0]!=document&&c.overflowY[0].tagName!="HTML")c.overflowYOffset=c.overflowY.offset();if(c.overflowX[0]!=document&&c.overflowX[0].tagName!="HTML")c.overflowXOffset=c.overflowX.offset()},drag:function(b,c){c=c.options;var d=a(this).data("draggable");
if(d.overflowY[0]!=document&&d.overflowY[0].tagName!="HTML"){if(d.overflowYOffset.top+d.overflowY[0].offsetHeight-b.pageY<c.scrollSensitivity)d.overflowY[0].scrollTop+=c.scrollSpeed;if(b.pageY-d.overflowYOffset.top<c.scrollSensitivity)d.overflowY[0].scrollTop-=c.scrollSpeed}else{b.pageY-a(document).scrollTop()<c.scrollSensitivity&&a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed);a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&a(document).scrollTop(a(document).scrollTop()+
c.scrollSpeed)}if(d.overflowX[0]!=document&&d.overflowX[0].tagName!="HTML"){if(d.overflowXOffset.left+d.overflowX[0].offsetWidth-b.pageX<c.scrollSensitivity)d.overflowX[0].scrollLeft+=c.scrollSpeed;if(b.pageX-d.overflowXOffset.left<c.scrollSensitivity)d.overflowX[0].scrollLeft-=c.scrollSpeed}else{b.pageX-a(document).scrollLeft()<c.scrollSensitivity&&a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed);a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&a(document).scrollLeft(a(document).scrollLeft()+
c.scrollSpeed)}}});a.ui.plugin.add("draggable","snap",{start:function(b,c){var d=a(this).data("draggable");d.snapElements=[];a(c.options.snap===true?".ui-draggable":c.options.snap).each(function(){var e=a(this),g=e.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:g.top,left:g.left})})},drag:function(b,c){b=a(this).data("draggable");for(var d=c.options.snapTolerance||20,e=c.absolutePosition.left,g=e+b.helperProportions.width,j=c.absolutePosition.top,
l=j+b.helperProportions.height,o=b.snapElements.length-1;o>=0;o--){var q=b.snapElements[o].left,s=q+b.snapElements[o].width,w=b.snapElements[o].top,G=w+b.snapElements[o].height;if(q-d<e&&e<s+d&&w-d<j&&j<G+d||q-d<e&&e<s+d&&w-d<l&&l<G+d||q-d<g&&g<s+d&&w-d<j&&j<G+d||q-d<g&&g<s+d&&w-d<l&&l<G+d){if(c.options.snapMode!="inner"){var C=Math.abs(w-l)<=20,B=Math.abs(G-j)<=20,H=Math.abs(q-g)<=20,i=Math.abs(s-e)<=20;if(C)c.position.top=b.convertPositionTo("relative",{top:w-b.helperProportions.height,left:0}).top;
if(B)c.position.top=b.convertPositionTo("relative",{top:G,left:0}).top;if(H)c.position.left=b.convertPositionTo("relative",{top:0,left:q-b.helperProportions.width}).left;if(i)c.position.left=b.convertPositionTo("relative",{top:0,left:s}).left}if(c.options.snapMode!="outer"){C=Math.abs(w-j)<=20;B=Math.abs(G-l)<=20;H=Math.abs(q-e)<=20;i=Math.abs(s-g)<=20;if(C)c.position.top=b.convertPositionTo("relative",{top:w,left:0}).top;if(B)c.position.top=b.convertPositionTo("relative",{top:G-b.helperProportions.height,
left:0}).top;if(H)c.position.left=b.convertPositionTo("relative",{top:0,left:q}).left;if(i)c.position.left=b.convertPositionTo("relative",{top:0,left:s-b.helperProportions.width}).left}}}}});a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(this).data("draggable");d.sortables=[];a(c.options.connectToSortable).each(function(){if(a.data(this,"sortable")){var e=a.data(this,"sortable");d.sortables.push({instance:e,shouldRevert:e.options.revert});e.refreshItems();e.propagate("activate",
b,d)}})},stop:function(b){var c=a(this).data("draggable");a.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance.mouseStop(b);this.instance.element.triggerHandler("sortreceive",[b,a.extend(this.instance.ui(),{sender:c.element})],this.instance.options.receive);this.instance.options.helper=this.instance.options._helper}else this.instance.propagate("deactivate",
b,c)})},drag:function(b,c){var d=a(this).data("draggable"),e=this,g=function(j){var l=j.left,o=l+j.width,q=j.top;j=q+j.height;return l<this.positionAbs.left+this.offset.click.left&&this.positionAbs.left+this.offset.click.left<o&&q<this.positionAbs.top+this.offset.click.top&&this.positionAbs.top+this.offset.click.top<j};a.each(d.sortables,function(){if(g.call(d,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(e).clone().appendTo(this.instance.element).data("sortable-item",
true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return c.helper[0]};b.target=this.instance.currentItem[0];this.instance.mouseCapture(b,true);this.instance.mouseStart(b,true,true);this.instance.offset.click.top=d.offset.click.top;this.instance.offset.click.left=d.offset.click.left;this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top;
d.propagate("toSortable",b)}this.instance.currentItem&&this.instance.mouseDrag(b)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance.mouseStop(b,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();d.propagate("fromSortable",b)}})}});a.ui.plugin.add("draggable","stack",{start:function(b,c){b=a.makeArray(a(c.options.stack.group)).sort(function(d,
e){return(parseInt(a(d).css("zIndex"),10)||c.options.stack.min)-(parseInt(a(e).css("zIndex"),10)||c.options.stack.min)});a(b).each(function(d){this.style.zIndex=c.options.stack.min+d});this[0].style.zIndex=c.options.stack.min+b.length}})})(jQuery);
(function(a){function b(c,d){return parseInt(a.curCSS(c.jquery?c[0]:c,d,true))||0}a.dimensions={version:"1.2"};a.each(["Height","Width"],function(c,d){a.fn["inner"+d]=function(){if(this[0]){var e=d=="Height"?"Top":"Left",g=d=="Height"?"Bottom":"Right";return this.is(":visible")?this[0]["client"+d]:b(this,d.toLowerCase())+b(this,"padding"+e)+b(this,"padding"+g)}};a.fn["outer"+d]=function(e){if(this[0]){var g=d=="Height"?"Top":"Left",j=d=="Height"?"Bottom":"Right";e=a.extend({margin:false},e||{});return(this.is(":visible")?
this[0]["offset"+d]:b(this,d.toLowerCase())+b(this,"border"+g+"Width")+b(this,"border"+j+"Width")+b(this,"padding"+g)+b(this,"padding"+j))+(e.margin?b(this,"margin"+g)+b(this,"margin"+j):0)}}});a.each(["Left","Top"],function(c,d){a.fn["scroll"+d]=function(e){if(this[0])return e!=undefined?this.each(function(){this==window||this==document?window.scrollTo(d=="Left"?e:a(window).scrollLeft(),d=="Top"?e:a(window).scrollTop()):(this["scroll"+d]=e)}):this[0]==window||this[0]==document?self[d=="Left"?"pageXOffset":
"pageYOffset"]||a.boxModel&&document.documentElement["scroll"+d]||document.body["scroll"+d]:this[0]["scroll"+d]}});a.fn.extend({position:function(){var c=this[0],d,e,g;if(c){g=this.offsetParent();d=this.offset();e=g.offset();d.top-=b(c,"marginTop");d.left-=b(c,"marginLeft");e.top+=b(g,"borderTopWidth");e.left+=b(g,"borderLeftWidth");d={top:d.top-e.top,left:d.left-e.left}}return d},offsetParent:function(){for(var c=this[0].offsetParent;c&&!/^body|html$/i.test(c.tagName)&&a.css(c,"position")=="static";)c=
c.offsetParent;return a(c)}})})(jQuery);
(function(a){function b(){a.fn.ajaxSubmit.debug&&window.console&&window.console.log&&window.console.log("[jquery.form] "+Array.prototype.join.call(arguments,""))}a.fn.ajaxSubmit=function(c){function d(){function w(){if(!Q++){L.detachEvent?L.detachEvent("onload",w):L.removeEventListener("load",w,false);var S=0,X=true;try{if(U)throw"timeout";var ca,ea;ea=L.contentWindow?L.contentWindow.document:L.contentDocument?L.contentDocument:L.document;if(ea.body==null&&!S&&a.browser.opera){S=1;Q--;setTimeout(w,
100);return}v.responseText=ea.body?ea.body.innerHTML:null;v.responseXML=ea.XMLDocument?ea.XMLDocument:ea;v.getResponseHeader=function(ha){return{"content-type":B.dataType}[ha]};if(B.dataType=="json"||B.dataType=="script"){var fa=ea.getElementsByTagName("textarea")[0];v.responseText=fa?fa.value:v.responseText}else if(B.dataType=="xml"&&!v.responseXML&&v.responseText!=null)v.responseXML=G(v.responseText);ca=a.httpData(v,B.dataType)}catch(ja){X=false;a.handleError(B,v,"error",ja)}if(X){B.success(ca,
"success");P&&a.event.trigger("ajaxSuccess",[v,B])}P&&a.event.trigger("ajaxComplete",[v,B]);P&&!--a.active&&a.event.trigger("ajaxStop");if(B.complete)B.complete(v,X?"success":"error");setTimeout(function(){M.remove();v.responseXML=null},100)}}function G(S,X){if(window.ActiveXObject){X=new ActiveXObject("Microsoft.XMLDOM");X.async="false";X.loadXML(S)}else X=(new DOMParser).parseFromString(S,"text/xml");return X&&X.documentElement&&X.documentElement.tagName!="parsererror"?X:null}var C=o[0];if(a(":input[@name=submit]",
C).length)alert('Error: Form elements must not be named "submit".');else{var B=a.extend({},a.ajaxSettings,c),H=jQuery.extend(true,{},a.extend(true,{},a.ajaxSettings),B),i="jqFormIO"+(new Date).getTime(),M=a('<iframe id="'+i+'" name="'+i+'" />'),L=M[0];if(a.browser.msie||a.browser.opera)L.src='javascript:false;document.write("");';M.css({position:"absolute",top:"-1000px",left:"-1000px"});var v={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},
getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;M.attr("src","about:blank")}},P=B.global;P&&!a.active++&&a.event.trigger("ajaxStart");P&&a.event.trigger("ajaxSend",[v,B]);if(H.beforeSend&&H.beforeSend(v,H)===false)H.global&&jQuery.active--;else if(!v.aborted){var Q=0,U=0;if(H=C.clk){var ba=H.name;if(ba&&!H.disabled){c.extraData=c.extraData||{};c.extraData[ba]=H.value;if(H.type=="image"){c.extraData[name+".x"]=C.clk_x;c.extraData[name+".y"]=C.clk_y}}}setTimeout(function(){var S=
o.attr("target"),X=o.attr("action");o.attr({target:i,method:"POST",action:B.url});c.skipEncodingOverride||o.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});B.timeout&&setTimeout(function(){U=true;w()},B.timeout);var ca=[];try{if(c.extraData)for(var ea in c.extraData)ca.push(a('<input type="hidden" name="'+ea+'" value="'+c.extraData[ea]+'" />').appendTo(C)[0]);M.appendTo("body");L.attachEvent?L.attachEvent("onload",w):L.addEventListener("load",w,false);C.submit()}finally{o.attr("action",
X);S?o.attr("target",S):o.removeAttr("target");a(ca).remove()}},10)}}}if(!this.length){b("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof c=="function")c={success:c};c=a.extend({url:this.attr("action")||window.location.toString(),type:this.attr("method")||"GET"},c||{});var e={};this.trigger("form-pre-serialize",[this,c,e]);if(e.veto){b("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}var g=this.formToArray(c.semantic);if(c.data){c.extraData=
c.data;for(var j in c.data)if(c.data[j]instanceof Array)for(var l in c.data[j])g.push({name:j,value:c.data[j][l]});else g.push({name:j,value:c.data[j]})}if(c.beforeSubmit&&c.beforeSubmit(g,this,c)===false){b("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[g,this,c,e]);if(e.veto){b("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}e=a.param(g);if(c.type.toUpperCase()=="GET"){c.url+=(c.url.indexOf("?")>=0?"&":"?")+e;c.data=
null}else c.data=e;var o=this,q=[];c.resetForm&&q.push(function(){o.resetForm()});c.clearForm&&q.push(function(){o.clearForm()});if(!c.dataType&&c.target){var s=c.success||function(){};q.push(function(w){a(c.target).html(w).each(s,arguments)})}else c.success&&q.push(c.success);c.success=function(w,G){for(var C=0,B=q.length;C<B;C++)q[C].apply(c,[w,G,o])};e=a("input:file",this).fieldValue();g=false;for(j=0;j<e.length;j++)if(e[j])g=true;if(c.iframe||g)a.browser.safari&&c.closeKeepAlive?a.get(c.closeKeepAlive,
d):d();else a.ajax(c);this.trigger("form-submit-notify",[this,c]);return this};a.fn.ajaxForm=function(c){return this.ajaxFormUnbind().bind("submit.form-plugin",function(){a(this).ajaxSubmit(c);return false}).each(function(){a(":submit,input:image",this).bind("click.form-plugin",function(d){var e=this.form;e.clk=this;if(this.type=="image")if(d.offsetX!=undefined){e.clk_x=d.offsetX;e.clk_y=d.offsetY}else if(typeof a.fn.offset=="function"){var g=a(this).offset();e.clk_x=d.pageX-g.left;e.clk_y=d.pageY-
g.top}else{e.clk_x=d.pageX-this.offsetLeft;e.clk_y=d.pageY-this.offsetTop}setTimeout(function(){e.clk=e.clk_x=e.clk_y=null},10)})})};a.fn.ajaxFormUnbind=function(){this.unbind("submit.form-plugin");return this.each(function(){a(":submit,input:image",this).unbind("click.form-plugin")})};a.fn.formToArray=function(c){var d=[];if(this.length==0)return d;var e=this[0],g=c?e.getElementsByTagName("*"):e.elements;if(!g)return d;for(var j=0,l=g.length;j<l;j++){var o=g[j],q=o.name;if(q)if(c&&e.clk&&o.type==
"image")!o.disabled&&e.clk==o&&d.push({name:q+".x",value:e.clk_x},{name:q+".y",value:e.clk_y});else if((o=a.fieldValue(o,true))&&o.constructor==Array)for(var s=0,w=o.length;s<w;s++)d.push({name:q,value:o[s]});else o!==null&&typeof o!="undefined"&&d.push({name:q,value:o})}if(!c&&e.clk){c=e.getElementsByTagName("input");j=0;for(l=c.length;j<l;j++){g=c[j];(q=g.name)&&!g.disabled&&g.type=="image"&&e.clk==g&&d.push({name:q+".x",value:e.clk_x},{name:q+".y",value:e.clk_y})}}return d};a.fn.formSerialize=
function(c){return a.param(this.formToArray(c))};a.fn.fieldSerialize=function(c){var d=[];this.each(function(){var e=this.name;if(e){var g=a.fieldValue(this,c);if(g&&g.constructor==Array)for(var j=0,l=g.length;j<l;j++)d.push({name:e,value:g[j]});else g!==null&&typeof g!="undefined"&&d.push({name:this.name,value:g})}});return a.param(d)};a.fn.fieldValue=function(c){for(var d=[],e=0,g=this.length;e<g;e++){var j=a.fieldValue(this[e],c);j===null||typeof j=="undefined"||j.constructor==Array&&!j.length||
(j.constructor==Array?a.merge(d,j):d.push(j))}return d};a.fieldValue=function(c,d){var e=c.name,g=c.type,j=c.tagName.toLowerCase();if(typeof d=="undefined")d=true;if(d&&(!e||c.disabled||g=="reset"||g=="button"||(g=="checkbox"||g=="radio")&&!c.checked||(g=="submit"||g=="image")&&c.form&&c.form.clk!=c||j=="select"&&c.selectedIndex==-1))return null;if(j=="select"){j=c.selectedIndex;if(j<0)return null;d=[];c=c.options;e=(g=g=="select-one")?j+1:c.length;for(j=g?j:0;j<e;j++){var l=c[j];if(l.selected){l=
a.browser.msie&&!l.attributes.value.specified?l.text:l.value;if(g)return l;d.push(l)}}return d}return c.value};a.fn.clearForm=function(){return this.each(function(){a("input,select,textarea",this).clearFields()})};a.fn.clearFields=a.fn.clearInputs=function(){return this.each(function(){var c=this.type,d=this.tagName.toLowerCase();if(c=="text"||c=="password"||d=="textarea")this.value="";else if(c=="checkbox"||c=="radio")this.checked=false;else if(d=="select")this.selectedIndex=-1})};a.fn.resetForm=
function(){return this.each(function(){if(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType)this.reset()})};a.fn.enable=function(c){if(c==undefined)c=true;return this.each(function(){this.disabled=!c})};a.fn.selected=function(c){if(c==undefined)c=true;return this.each(function(){var d=this.type;if(d=="checkbox"||d=="radio")this.checked=c;else if(this.tagName.toLowerCase()=="option"){d=a(this).parent("select");c&&d[0]&&d[0].type=="select-one"&&d.find("option").selected(false);
this.selected=c}})}})(jQuery);jQuery.fn.extend({mousewheel:function(a,b,c){return this.hover(function(){jQuery.event.mousewheel.giveFocus(this,a,b,c)},function(){jQuery.event.mousewheel.removeFocus(this)})},mousewheeldown:function(a,b){return this.mousewheel(function(){},a,b)},mousewheelup:function(a,b){return this.mousewheel(a,function(){},b)},unmousewheel:function(){return this.each(function(){jQuery.event.mousewheel.removeFocus(this)})},unmousewheeldown:jQuery.fn.unmousewheel,unmousewheelup:jQuery.fn.unmousewheel});
jQuery.event.mousewheel={giveFocus:function(a,b,c,d){a._handleMousewheel&&jQuery(a).unmousewheel();if(d==window.undefined&&c&&c.constructor!=Function){d=c;c=null}a._handleMousewheel=function(e){if(!e)e=window.event;if(d)if(e.preventDefault)e.preventDefault();else e.returnValue=false;var g=0;if(e.wheelDelta){g=e.wheelDelta/120;if(window.opera)g=-g}else if(e.detail)g=-e.detail/3;if(b&&(g>0||!c))b.apply(a,[e,g]);else c&&g<0&&c.apply(a,[e,g])};window.addEventListener&&window.addEventListener("DOMMouseScroll",
a._handleMousewheel,false);window.onmousewheel=document.onmousewheel=a._handleMousewheel},removeFocus:function(a){if(a._handleMousewheel){window.removeEventListener&&window.removeEventListener("DOMMouseScroll",a._handleMousewheel,false);window.onmousewheel=document.onmousewheel=null;a._handleMousewheel=null}}};jQuery.jScrollPane={active:[]};
jQuery.fn.jScrollPane=function(a){a=jQuery.extend({scrollbarWidth:7,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false},a);return this.each(function(){var b=jQuery(this);if(jQuery(this).parent().is(".jScrollPaneContainer")){var c=a.maintainPosition?b.offset({relativeTo:jQuery(this).parent()[0]}).top:0,d=jQuery(this).parent(),e=d.innerWidth(),g=d.outerHeight(),
j=g;d.unmousewheel&&d.unmousewheel();jQuery(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",d).remove();b.css({top:0})}else{c=0;this.originalPadding=b.css("paddingTop")+" "+b.css("paddingRight")+" "+b.css("paddingBottom")+" "+b.css("paddingLeft");this.originalSidePaddingTotal=(parseInt(b.css("paddingLeft"))||0)+(parseInt(b.css("paddingRight"))||0);e=b.innerWidth();j=g=b.innerHeight();b.wrap(jQuery("<div></div>").attr({className:"jScrollPaneContainer"}).css({height:g+"px",width:e+"px"}));
jQuery(document).bind("emchange",function(){b.jScrollPane(a)})}d={height:"auto",width:e-a.scrollbarWidth-a.scrollbarMargin-this.originalSidePaddingTotal+"px"};if(a.scrollbarOnLeft)d.paddingLeft=a.scrollbarMargin+a.scrollbarWidth+"px";else d.paddingRight=a.scrollbarMargin+"px";b.css(d);var l=b.outerHeight(),o=g/l;if(o<0.99){e=b.parent();e.append(jQuery("<div></div>").attr({className:"jScrollPaneTrack"}).css({width:a.scrollbarWidth+"px"}).append(jQuery("<div></div>").attr({className:"jScrollPaneDrag"}).css({width:a.scrollbarWidth+
"px"}).append(jQuery("<div></div>").attr({className:"jScrollPaneDragTop"}).css({width:a.scrollbarWidth+"px"}),jQuery("<div></div>").attr({className:"jScrollPaneDragBottom"}).css({width:a.scrollbarWidth+"px"}))));d=jQuery(">.jScrollPaneTrack",e);var q=jQuery(">.jScrollPaneTrack .jScrollPaneDrag",e);if(a.showArrows){var s,w,G,C,B=function(){if(C>4||C%4==0)ha(S+w*ba);C++},H=function(){jQuery("html").unbind("mouseup",H);s.removeClass("jScrollActiveArrowButton");clearInterval(G)},i=function(){jQuery("html").bind("mouseup",
H);s.addClass("jScrollActiveArrowButton");C=0;B();G=setInterval(B,100)};e.append(jQuery("<a></a>").attr({href:"javascript:;",className:"jScrollArrowUp"}).css({width:a.scrollbarWidth+"px"}).html("Scroll up").bind("mousedown",function(){s=jQuery(this);w=-1;i();this.blur();return false}),jQuery("<a></a>").attr({href:"javascript:;",className:"jScrollArrowDown"}).css({width:a.scrollbarWidth+"px"}).html("Scroll down").bind("mousedown",function(){s=jQuery(this);w=1;i();this.blur();return false}));var M=
jQuery(">.jScrollArrowUp",e),L=jQuery(">.jScrollArrowDown",e);if(a.arrowSize){j=g-a.arrowSize-a.arrowSize;d.css({height:j+"px",top:a.arrowSize+"px"})}else{var v=M.height();a.arrowSize=v;j=g-v-L.height();d.css({height:j+"px",top:v+"px"})}}var P=jQuery(this).css({position:"absolute",overflow:"visible"}),Q,U,ba,S=0,X=o*g/2,ca=function(V,ra){var Ca=ra=="X"?"Left":"Top";return V["page"+ra]||V["client"+ra]+(document.documentElement["scroll"+Ca]||document.body["scroll"+Ca])||0},ea=function(){return false},
fa=function(){xa();Q=q.offset(false);Q.top-=S;U=j-q[0].offsetHeight;ba=2*a.wheelSpeed*U/l},ja=function(){jQuery("html").unbind("mouseup",ja).unbind("mousemove",sa);X=o*g/2;jQuery.browser.msie&&jQuery("html").unbind("dragstart",ea).unbind("selectstart",ea)},ha=function(V){S=V=V<0?0:V>U?U:V;q.css({top:V+"px"});P.css({top:(g-l)*(V/U)+"px"});b.trigger("scroll");if(a.showArrows){M[V==0?"addClass":"removeClass"]("disabled");L[V==U?"addClass":"removeClass"]("disabled")}},sa=function(V){ha(ca(V,"Y")-Q.top-
X)};v=Math.max(Math.min(o*(g-a.arrowSize*2),a.dragMaxHeight),a.dragMinHeight);q.css({height:v+"px"}).bind("mousedown",function(V){fa();X=ca(V,"Y")-S-Q.top;jQuery("html").bind("mouseup",ja).bind("mousemove",sa);jQuery.browser.msie&&jQuery("html").bind("dragstart",ea).bind("selectstart",ea);return false});var pa,ka,ga,Z=function(){if(ka>8||ka%4==0)ha(S-(S-ga)/2);ka++},qa=function(){clearInterval(pa);jQuery("html").unbind("mouseup",qa).unbind("mousemove",ta)},ta=function(V){ga=ca(V,"Y")-Q.top-X};d.bind("mousedown",
function(V){fa();ta(V);ka=0;jQuery("html").bind("mouseup",qa).bind("mousemove",ta);pa=setInterval(Z,100);Z()});e.mousewheel&&e.mousewheel(function(V,ra){fa();xa();V=S;ha(S-ra*ba);return V==S},false);var oa,ia;function wa(){var V=(oa-S)/a.animateStep;if(V>1||V<-1)ha(S+V);else{ha(oa);xa()}}var xa=function(){if(ia){clearInterval(ia);delete oa}},Ba=function(V,ra){if(typeof V=="string"){$e=jQuery(V,this);if(!$e.length)return;V=$e.offset().top-b.offset().top}xa();V=-V/(g-l)*U;if(!ra||a.animateTo){oa=V;
ia=setInterval(wa,a.animateInterval)}else ha(V)};b[0].scrollTo=Ba;b[0].scrollBy=function(V){var ra=-parseInt(P.css("top"))||0;Ba(ra+V)};fa();Ba(-c,true);jQuery.jScrollPane.active.push(b[0])}else b.css({height:g+"px",width:e-this.originalSidePaddingTotal+"px",padding:this.originalPadding})})};jQuery(window).bind("unload",function(){for(var a=jQuery.jScrollPane.active,b=0;b<a.length;b++)a[b].scrollTo=a[b].scrollBy=null});
(function(a){a.fn.upload=function(b){b=a.extend({name:"file",enctype:"multipart/form-data",action:"",autoSubmit:true,onSubmit:function(){},onComplete:function(){},onSelect:function(){},params:{}},b);return new a.ocupload(this,b)};a.ocupload=function(b,c){var d=this,e=(new Date).getTime().toString().substr(8),g=a('<iframe id="iframe'+e+'" name="iframe'+e+'"></iframe>').css({display:"none"}),j=a('<form method="post" enctype="'+c.enctype+'" action="'+c.action+'" target="iframe'+e+'"></form>').css({margin:0,
padding:0}),l=a('<input name="'+c.name+'" type="file" />').css({position:"relative",display:"block",marginLeft:"-175px",opacity:0});b.wrap("<div></div>");j.append(l);b.after(j);b.after(g);var o=b.parent().css({position:"relative",height:b.outerHeight()+"px",width:b.outerWidth()+"px",overflow:"hidden",cursor:"pointer",margin:0,padding:0});l.css("marginTop",-o.height()-10+"px");o.mousemove(function(q){l.css({top:q.pageY-o.offset().top+"px",left:q.pageX-o.offset().left+"px"})});l.change(function(){d.onSelect();
d.autoSubmit&&d.submit()});a.extend(this,{autoSubmit:true,onSubmit:c.onSubmit,onComplete:c.onComplete,onSelect:c.onSelect,filename:function(){return l.attr("value")},params:function(q){if(q=q?q:false)c.params=a.extend(c.params,q);else return c.params},name:function(q){if(q=q?q:false)l.attr("name",value);else return l.attr("name")},action:function(q){if(q=q?q:false)j.attr("action",q);else return j.attr("action")},enctype:function(q){if(q=q?q:false)j.attr("enctype",q);else return j.attr("enctype")},
set:function(q,s){function w(G,C){switch(G){default:throw new Error("[jQuery.ocupload.set] '"+G+"' is an invalid option.");case "name":d.name(C);break;case "action":d.action(C);break;case "enctype":d.enctype(C);break;case "params":d.params(C);break;case "autoSubmit":d.autoSubmit=C;break;case "onSubmit":d.onSubmit=C;break;case "onComplete":d.onComplete=C;break;case "onSelect":d.onSelect=C;break}}(s=s?s:false)?w(q,s):a.each(q,function(G,C){w(G,C)})},submit:function(){this.onSubmit();a.each(c.params,
function(q,s){j.append(a('<input type="hidden" name="'+q+'" value="'+s+'" />'))});j.submit();g.unbind().load(function(){var q=document.getElementById(g.attr("name"));q=a(q.contentWindow.document.body).text();d.onComplete(q)})}})}})(jQuery);
(function(a){function b(){this.debug=false;this._curInst=null;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._promptClass="ui-datepicker-prompt";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this.regional=[];this.regional[""]={clearText:"Clear",clearStatus:"Erase the current date",
closeText:"Close",closeStatus:"Close without change",prevText:"&#x3c;Prev",prevStatus:"Show the previous month",nextText:"Next&#x3e;",nextStatus:"Show the next month",currentText:"Today",currentStatus:"Show the current month",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthStatus:"Show a different month",yearStatus:"Show a different year",
weekHeader:"Wk",weekStatus:"Week of the year",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dayStatus:"Set DD as first week day",dateStatus:"Select DD, M d",dateFormat:"mm/dd/yy",firstDay:0,initStatus:"Select a date",isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,
closeAtTop:true,mandatory:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:true,changeYear:true,yearRange:"-10:+10",changeFirstDay:true,highlightWeek:false,showOtherMonths:false,showWeeks:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",showStatus:false,statusForDate:this.dateStatus,minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,stepMonths:1,rangeSelect:false,
rangeSeparator:" - ",altField:"",altFormat:""};a.extend(this._defaults,this.regional[""]);this.dpDiv=a('<div id="'+this._mainDivId+'" style="display: none;"></div>')}function c(e,g){a.extend(e,g);for(var j in g)if(g[j]==null||g[j]==undefined)e[j]=g[j];return e}function d(e){return e&&(a.browser.safari&&typeof e=="object"&&e.length||e.constructor&&e.constructor.toString().match(/\Array\(\)/))}a.extend(b.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},
setDefaults:function(e){c(this._defaults,e||{});return this},_attachDatepicker:function(e,g){var j=null;for(attrName in this._defaults){var l=e.getAttribute("date:"+attrName);if(l){j=j||{};try{j[attrName]=eval(l)}catch(o){j[attrName]=l}}}l=e.nodeName.toLowerCase();var q=l=="div"||l=="span";if(!e.id)e.id="dp"+(new Date).getTime();var s=this._newInst(a(e),q);s.settings=a.extend({},g||{},j||{});if(l=="input")this._connectDatepicker(e,s);else q&&this._inlineDatepicker(e,s)},_newInst:function(e,g){return{id:e[0].id,
input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:g,dpDiv:!g?this.dpDiv:a('<div class="ui-datepicker-inline"></div>')}},_connectDatepicker:function(e,g){var j=a(e);if(!j.hasClass(this.markerClassName)){var l=this._get(g,"appendText"),o=this._get(g,"isRTL");if(l)j[o?"before":"after"]('<span class="'+this._appendClass+'">'+l+"</span>");l=this._get(g,"showOn");if(l=="focus"||l=="both")j.focus(this._showDatepicker);if(l=="button"||l=="both"){l=this._get(g,"buttonText");
var q=this._get(g,"buttonImage");l=a(this._get(g,"buttonImageOnly")?a("<img/>").addClass(this._triggerClass).attr({src:q,alt:l,title:l}):a('<button type="button"></button>').addClass(this._triggerClass).html(q==""?l:a("<img/>").attr({src:q,alt:l,title:l})));j[o?"before":"after"](l);l.click(function(){a.datepicker._datepickerShowing&&a.datepicker._lastInput==e?a.datepicker._hideDatepicker():a.datepicker._showDatepicker(e);return false})}j.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",
function(s,w,G){g.settings[w]=G}).bind("getData.datepicker",function(s,w){return this._get(g,w)});a.data(e,"datepicker",g)}},_inlineDatepicker:function(e,g){var j=a(e);if(!j.hasClass(this.markerClassName)){j.addClass(this.markerClassName).append(g.dpDiv).bind("setData.datepicker",function(l,o,q){g.settings[o]=q}).bind("getData.datepicker",function(l,o){return this._get(g,o)});a.data(e,"datepicker",g);this._setDate(g,this._getDefaultDate(g));this._updateDatepicker(g)}},_inlineShow:function(e){var g=
this._getNumberOfMonths(e);e.dpDiv.width(g[1]*a(".ui-datepicker",e.dpDiv[0]).width())},_dialogDatepicker:function(e,g,j,l,o){e=this._dialogInst;if(!e){e="dp"+(new Date).getTime();this._dialogInput=a('<input type="text" id="'+e+'" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);a("body").append(this._dialogInput);e=this._dialogInst=this._newInst(this._dialogInput,false);e.settings={};a.data(this._dialogInput[0],"datepicker",e)}c(e.settings,l||{});this._dialogInput.val(g);
this._pos=o?o.length?o:[o.pageX,o.pageY]:null;if(!this._pos)this._pos=[(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");e.settings.onSelect=j;this._inDialog=true;
this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);a.blockUI&&a.blockUI(this.dpDiv);a.data(this._dialogInput[0],"datepicker",e);return this},_destroyDatepicker:function(e){var g=e.nodeName.toLowerCase(),j=a(e);a.removeData(e,"datepicker");if(g=="input")j.siblings("."+this._appendClass).remove().end().siblings("."+this._triggerClass).remove().end().removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",
this._doKeyPress);else if(g=="div"||g=="span")j.removeClass(this.markerClassName).empty()},_enableDatepicker:function(e){e.disabled=false;a(e).siblings("button."+this._triggerClass).each(function(){this.disabled=false}).end().siblings("img."+this._triggerClass).css({opacity:"1.0",cursor:""});this._disabledInputs=a.map(this._disabledInputs,function(g){return g==e?null:g})},_disableDatepicker:function(e){e.disabled=true;a(e).siblings("button."+this._triggerClass).each(function(){this.disabled=true}).end().siblings("img."+
this._triggerClass).css({opacity:"0.5",cursor:"default"});this._disabledInputs=a.map(this._disabledInputs,function(g){return g==e?null:g});this._disabledInputs[this._disabledInputs.length]=e},_isDisabledDatepicker:function(e){if(!e)return false;for(var g=0;g<this._disabledInputs.length;g++)if(this._disabledInputs[g]==e)return true;return false},_changeDatepicker:function(e,g,j){var l=g||{};if(typeof g=="string"){l={};l[g]=j}if(inst=a.data(e,"datepicker")){c(inst.settings,l);this._updateDatepicker(inst)}},
_setDateDatepicker:function(e,g,j){if(e=a.data(e,"datepicker")){this._setDate(e,g,j);this._updateDatepicker(e)}},_getDateDatepicker:function(e){(e=a.data(e,"datepicker"))&&this._setDateFromField(e);return e?this._getDate(e):null},_doKeyDown:function(e){var g=a.data(e.target,"datepicker"),j=true;if(a.datepicker._datepickerShowing)switch(e.keyCode){case 9:a.datepicker._hideDatepicker(null,"");break;case 13:a.datepicker._selectDay(e.target,g.selectedMonth,g.selectedYear,a("td.ui-datepicker-days-cell-over",
g.dpDiv)[0]);return false;case 27:a.datepicker._hideDatepicker(null,a.datepicker._get(g,"duration"));break;case 33:a.datepicker._adjustDate(e.target,e.ctrlKey?-1:-a.datepicker._get(g,"stepMonths"),e.ctrlKey?"Y":"M");break;case 34:a.datepicker._adjustDate(e.target,e.ctrlKey?+1:+a.datepicker._get(g,"stepMonths"),e.ctrlKey?"Y":"M");break;case 35:e.ctrlKey&&a.datepicker._clearDate(e.target);break;case 36:e.ctrlKey&&a.datepicker._gotoToday(e.target);break;case 37:e.ctrlKey&&a.datepicker._adjustDate(e.target,
-1,"D");break;case 38:e.ctrlKey&&a.datepicker._adjustDate(e.target,-7,"D");break;case 39:e.ctrlKey&&a.datepicker._adjustDate(e.target,+1,"D");break;case 40:e.ctrlKey&&a.datepicker._adjustDate(e.target,+7,"D");break;default:j=false}else if(e.keyCode==36&&e.ctrlKey)a.datepicker._showDatepicker(this);else j=false;if(j){e.preventDefault();e.stopPropagation()}},_doKeyPress:function(e){var g=a.data(e.target,"datepicker");g=a.datepicker._possibleChars(a.datepicker._get(g,"dateFormat"));var j=String.fromCharCode(e.charCode==
undefined?e.keyCode:e.charCode);return e.ctrlKey||j<" "||!g||g.indexOf(j)>-1},_showDatepicker:function(e){e=e.target||e;if(e.nodeName.toLowerCase()!="input")e=a("input",e.parentNode)[0];if(!(a.datepicker._isDisabledDatepicker(e)||a.datepicker._lastInput==e)){var g=a.data(e,"datepicker"),j=a.datepicker._get(g,"beforeShow");c(g.settings,j?j.apply(e,[e,g]):{});a.datepicker._hideDatepicker(null,"");a.datepicker._lastInput=e;a.datepicker._setDateFromField(g);if(a.datepicker._inDialog)e.value="";if(!a.datepicker._pos){a.datepicker._pos=
a.datepicker._findPos(e);a.datepicker._pos[1]+=e.offsetHeight}var l=false;a(e).parents().each(function(){l|=a(this).css("position")=="fixed";return!l});if(l&&a.browser.opera){a.datepicker._pos[0]-=document.documentElement.scrollLeft;a.datepicker._pos[1]-=document.documentElement.scrollTop}e={left:a.datepicker._pos[0],top:a.datepicker._pos[1]};a.datepicker._pos=null;g.rangeStart=null;g.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});a.datepicker._updateDatepicker(g);g.dpDiv.width(a.datepicker._getNumberOfMonths(g)[1]*
a(".ui-datepicker",g.dpDiv[0])[0].offsetWidth);e=a.datepicker._checkOffset(g,e,l);g.dpDiv.css({position:a.datepicker._inDialog&&a.blockUI?"static":l?"fixed":"absolute",display:"none",left:e.left+"px",top:e.top+"px"});if(!g.inline){e=a.datepicker._get(g,"showAnim")||"show";j=a.datepicker._get(g,"duration");var o=function(){a.datepicker._datepickerShowing=true;a.browser.msie&&parseInt(a.browser.version)<7&&a("iframe.ui-datepicker-cover").css({width:g.dpDiv.width()+4,height:g.dpDiv.height()+4})};a.effects&&
a.effects[e]?g.dpDiv.show(e,a.datepicker._get(g,"showOptions"),j,o):g.dpDiv[e](j,o);j==""&&o();g.input[0].type!="hidden"&&g.input[0].focus();a.datepicker._curInst=g}}},_updateDatepicker:function(e){var g={width:e.dpDiv.width()+4,height:e.dpDiv.height()+4};e.dpDiv.empty().append(this._generateDatepicker(e)).find("iframe.ui-datepicker-cover").css({width:g.width,height:g.height});g=this._getNumberOfMonths(e);e.dpDiv[(g[0]!=1||g[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");e.dpDiv[(this._get(e,
"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");e.input&&e.input[0].type!="hidden"&&a(e.input[0]).focus()},_checkOffset:function(e,g,j){var l=e.input?this._findPos(e.input[0]):null,o=window.innerWidth||document.documentElement.clientWidth,q=window.innerHeight||document.documentElement.clientHeight,s=document.documentElement.scrollLeft||document.body.scrollLeft,w=document.documentElement.scrollTop||document.body.scrollTop;if(this._get(e,"isRTL")||g.left+e.dpDiv.width()-s>o)g.left=Math.max(j?
0:s,l[0]+(e.input?e.input.width():0)-(j?s:0)-e.dpDiv.width()-(j&&a.browser.opera?document.documentElement.scrollLeft:0));else g.left-=j?s:0;if(g.top+e.dpDiv.height()-w>q)g.top=Math.max(j?0:w,l[1]-(j?w:0)-(this._inDialog?0:e.dpDiv.height())-(j&&a.browser.opera?document.documentElement.scrollTop:0));else g.top-=j?w:0;return g},_findPos:function(e){for(;e&&(e.type=="hidden"||e.nodeType!=1);)e=e.nextSibling;e=a(e).offset();return[e.left,e.top]},_hideDatepicker:function(e,g){var j=this._curInst;if(j){this._get(j,
"rangeSelect")&&this._stayOpen&&this._selectDate("#"+j.id,this._formatDate(j,j.currentDay,j.currentMonth,j.currentYear));this._stayOpen=false;if(this._datepickerShowing){g=g!=null?g:this._get(j,"duration");e=this._get(j,"showAnim");var l=function(){a.datepicker._tidyDialog(j)};g!=""&&a.effects&&a.effects[e]?j.dpDiv.hide(e,a.datepicker._get(j,"showOptions"),g,l):j.dpDiv[g==""?"hide":e=="slideDown"?"slideUp":e=="fadeIn"?"fadeOut":"hide"](g,l);g==""&&this._tidyDialog(j);if(g=this._get(j,"onClose"))g.apply(j.input?
j.input[0]:null,[this._getDate(j),j]);this._datepickerShowing=false;this._lastInput=null;j.settings.prompt=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(a.blockUI){a.unblockUI();a("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null}},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker");a("."+this._promptClass,e.dpDiv).remove()},_checkExternalClick:function(e){if(a.datepicker._curInst){e=a(e.target);
e.parents("#"+a.datepicker._mainDivId).length==0&&!e.hasClass(a.datepicker.markerClassName)&&!e.hasClass(a.datepicker._triggerClass)&&a.datepicker._datepickerShowing&&!(a.datepicker._inDialog&&a.blockUI)&&a.datepicker._hideDatepicker(null,"")}},_adjustDate:function(e,g,j){e=a(e);e=a.data(e[0],"datepicker");this._adjustInstDate(e,g,j);this._updateDatepicker(e)},_gotoToday:function(e){e=a(e);var g=a.data(e[0],"datepicker");if(this._get(g,"gotoCurrent")&&g.currentDay){g.selectedDay=g.currentDay;g.drawMonth=
g.selectedMonth=g.currentMonth;g.drawYear=g.selectedYear=g.currentYear}else{var j=new Date;g.selectedDay=j.getDate();g.drawMonth=g.selectedMonth=j.getMonth();g.drawYear=g.selectedYear=j.getFullYear()}this._adjustDate(e);this._notifyChange(g)},_selectMonthYear:function(e,g,j){e=a(e);var l=a.data(e[0],"datepicker");l._selectingMonthYear=false;l[j=="M"?"drawMonth":"drawYear"]=g.options[g.selectedIndex].value-0;this._adjustDate(e);this._notifyChange(l)},_clickMonthYear:function(e){e=a(e);e=a.data(e[0],
"datepicker");e.input&&e._selectingMonthYear&&!a.browser.msie&&e.input[0].focus();e._selectingMonthYear=!e._selectingMonthYear},_changeFirstDay:function(e,g){e=a(e);e=a.data(e[0],"datepicker");e.settings.firstDay=g;this._updateDatepicker(e)},_selectDay:function(e,g,j,l){if(!a(l).hasClass(this._unselectableClass)){var o=a(e);o=a.data(o[0],"datepicker");var q=this._get(o,"rangeSelect");if(q)if(this._stayOpen=!this._stayOpen){a(".ui-datepicker td").removeClass(this._currentClass);a(l).addClass(this._currentClass)}o.selectedDay=
o.currentDay=a("a",l).html();o.selectedMonth=o.currentMonth=g;o.selectedYear=o.currentYear=j;if(this._stayOpen)o.endDay=o.endMonth=o.endYear=null;else if(q){o.endDay=o.currentDay;o.endMonth=o.currentMonth;o.endYear=o.currentYear}this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear));if(this._stayOpen){o.rangeStart=new Date(o.currentYear,o.currentMonth,o.currentDay);this._updateDatepicker(o)}else if(q){o.selectedDay=o.currentDay=o.rangeStart.getDate();o.selectedMonth=o.currentMonth=
o.rangeStart.getMonth();o.selectedYear=o.currentYear=o.rangeStart.getFullYear();o.rangeStart=null;o.inline&&this._updateDatepicker(o)}}},_clearDate:function(e){e=a(e);var g=a.data(e[0],"datepicker");if(!this._get(g,"mandatory")){this._stayOpen=false;g.endDay=g.endMonth=g.endYear=g.rangeStart=null;this._selectDate(e,"")}},_selectDate:function(e,g){e=a(e);e=a.data(e[0],"datepicker");g=g!=null?g:this._formatDate(e);if(this._get(e,"rangeSelect")&&g)g=(e.rangeStart?this._formatDate(e,e.rangeStart):g)+
this._get(e,"rangeSeparator")+g;e.input&&e.input.val(g);this._updateAlternate(e);var j=this._get(e,"onSelect");if(j)j.apply(e.input?e.input[0]:null,[g,e]);else e.input&&e.input.trigger("change");if(e.inline)this._updateDatepicker(e);else if(!this._stayOpen){this._hideDatepicker(null,this._get(e,"duration"));this._lastInput=e.input[0];typeof e.input[0]!="object"&&e.input[0].focus();this._lastInput=null}},_updateAlternate:function(e){var g=this._get(e,"altField");if(g){var j=this._get(e,"altFormat"),
l=this._getDate(e);dateStr=d(l)?!l[0]&&!l[1]?"":this.formatDate(j,l[0],this._getFormatConfig(e))+this._get(e,"rangeSeparator")+this.formatDate(j,l[1]||l[0],this._getFormatConfig(e)):this.formatDate(j,l,this._getFormatConfig(e));a(g).each(function(){a(this).val(dateStr)})}},noWeekends:function(e){e=e.getDay();return[e>0&&e<6,""]},iso8601Week:function(e){e=new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getTimezoneOffset()/-60);var g=new Date(e.getFullYear(),0,4),j=g.getDay()||7;g.setDate(g.getDate()+
1-j);if(j<4&&e<g){e.setDate(e.getDate()-3);return a.datepicker.iso8601Week(e)}else if(e>new Date(e.getFullYear(),11,28)){j=(new Date(e.getFullYear()+1,0,4)).getDay()||7;if(j>4&&(e.getDay()||7)<j-3){e.setDate(e.getDate()+3);return a.datepicker.iso8601Week(e)}}return Math.floor((e-g)/864E5/7)+1},dateStatus:function(e,g){return a.datepicker.formatDate(a.datepicker._get(g,"dateStatus"),e,a.datepicker._getFormatConfig(g))},parseDate:function(e,g,j){if(e==null||g==null)throw"Invalid arguments";g=typeof g==
"object"?g.toString():g+"";if(g=="")return null;var l=(j?j.shortYearCutoff:null)||this._defaults.shortYearCutoff,o=(j?j.dayNamesShort:null)||this._defaults.dayNamesShort,q=(j?j.dayNames:null)||this._defaults.dayNames,s=(j?j.monthNamesShort:null)||this._defaults.monthNamesShort;j=(j?j.monthNames:null)||this._defaults.monthNames;for(var w=-1,G=-1,C=-1,B=false,H=function(U){(U=P+1<e.length&&e.charAt(P+1)==U)&&P++;return U},i=function(U){H(U);for(var ba=U=U=="@"?14:U=="y"?4:2,S=0;ba>0&&v<g.length&&g.charAt(v)>=
"0"&&g.charAt(v)<="9";){S=S*10+(g.charAt(v++)-0);ba--}if(ba==U)throw"Missing number at position "+v;return S},M=function(U,ba,S){U=H(U)?S:ba;for(S=ba=0;S<U.length;S++)ba=Math.max(ba,U[S].length);S="";for(var X=v;ba>0&&v<g.length;){S+=g.charAt(v++);for(var ca=0;ca<U.length;ca++)if(S==U[ca])return ca+1;ba--}throw"Unknown name at position "+X;},L=function(){if(g.charAt(v)!=e.charAt(P))throw"Unexpected literal at position "+v;v++},v=0,P=0;P<e.length;P++)if(B)if(e.charAt(P)=="'"&&!H("'"))B=false;else L();
else switch(e.charAt(P)){case "d":C=i("d");break;case "D":M("D",o,q);break;case "m":G=i("m");break;case "M":G=M("M",s,j);break;case "y":w=i("y");break;case "@":var Q=new Date(i("@"));w=Q.getFullYear();G=Q.getMonth()+1;C=Q.getDate();break;case "'":if(H("'"))L();else B=true;break;default:L()}if(w<100)w+=(new Date).getFullYear()-(new Date).getFullYear()%100+(w<=l?0:-100);Q=new Date(w,G-1,C);if(Q.getFullYear()!=w||Q.getMonth()+1!=G||Q.getDate()!=C)throw"Invalid date";return Q},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",
ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(e,g,j){if(!g)return"";var l=(j?j.dayNamesShort:null)||this._defaults.dayNamesShort,o=(j?j.dayNames:null)||this._defaults.dayNames,q=(j?j.monthNamesShort:null)||this._defaults.monthNamesShort;j=(j?j.monthNames:null)||this._defaults.monthNames;var s=function(i){(i=H+1<e.length&&e.charAt(H+1)==i)&&H++;return i},w=function(i,
M){return(s(i)&&M<10?"0":"")+M},G=function(i,M,L,v){return s(i)?v[M]:L[M]},C="",B=false;if(g)for(var H=0;H<e.length;H++)if(B)if(e.charAt(H)=="'"&&!s("'"))B=false;else C+=e.charAt(H);else switch(e.charAt(H)){case "d":C+=w("d",g.getDate());break;case "D":C+=G("D",g.getDay(),l,o);break;case "m":C+=w("m",g.getMonth()+1);break;case "M":C+=G("M",g.getMonth(),q,j);break;case "y":C+=s("y")?g.getFullYear():(g.getYear()%100<10?"0":"")+g.getYear()%100;break;case "@":C+=g.getTime();break;case "'":if(s("'"))C+=
"'";else B=true;break;default:C+=e.charAt(H)}return C},_possibleChars:function(e){for(var g="",j=false,l=0;l<e.length;l++)if(j)if(e.charAt(l)=="'"&&!lookAhead("'"))j=false;else g+=e.charAt(l);else switch(e.charAt(l)){case "d":case "m":case "y":case "@":g+="0123456789";break;case "D":case "M":return null;case "'":if(lookAhead("'"))g+="'";else j=true;break;default:g+=e.charAt(l)}return g},_get:function(e,g){return e.settings[g]!==undefined?e.settings[g]:this._defaults[g]},_setDateFromField:function(e){var g=
this._get(e,"dateFormat"),j=e.input?e.input.val().split(this._get(e,"rangeSeparator")):null;e.endDay=e.endMonth=e.endYear=null;var l=defaultDate=this._getDefaultDate(e);if(j.length>0){var o=this._getFormatConfig(e);if(j.length>1){l=this.parseDate(g,j[1],o)||defaultDate;e.endDay=l.getDate();e.endMonth=l.getMonth();e.endYear=l.getFullYear()}try{l=this.parseDate(g,j[0],o)||defaultDate}catch(q){this.log(q);l=defaultDate}}e.selectedDay=l.getDate();e.drawMonth=e.selectedMonth=l.getMonth();e.drawYear=e.selectedYear=
l.getFullYear();e.currentDay=j[0]?l.getDate():0;e.currentMonth=j[0]?l.getMonth():0;e.currentYear=j[0]?l.getFullYear():0;this._adjustInstDate(e)},_getDefaultDate:function(e){var g=this._determineDate(this._get(e,"defaultDate"),new Date),j=this._getMinMaxDate(e,"min",true);e=this._getMinMaxDate(e,"max");g=j&&g<j?j:g;return g=e&&g>e?e:g},_determineDate:function(e,g){var j=function(o){var q=new Date;q.setUTCDate(q.getUTCDate()+o);return q},l=function(o,q){var s=new Date,w=s.getFullYear(),G=s.getMonth();
s=s.getDate();for(var C=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,B=C.exec(o);B;){switch(B[2]||"d"){case "d":case "D":s+=B[1]-0;break;case "w":case "W":s+=B[1]*7;break;case "m":case "M":G+=B[1]-0;s=Math.min(s,q(w,G));break;case "y":case "Y":w+=B[1]-0;s=Math.min(s,q(w,G));break}B=C.exec(o)}return new Date(w,G,s)};return e==null?g:typeof e=="string"?l(e,this._getDaysInMonth):typeof e=="number"?j(e):e},_setDate:function(e,g,j){var l=!g;g=this._determineDate(g,new Date);e.selectedDay=e.currentDay=g.getDate();
e.drawMonth=e.selectedMonth=e.currentMonth=g.getMonth();e.drawYear=e.selectedYear=e.currentYear=g.getFullYear();if(this._get(e,"rangeSelect"))if(j){j=this._determineDate(j,null);e.endDay=j.getDate();e.endMonth=j.getMonth();e.endYear=j.getFullYear()}else{e.endDay=e.currentDay;e.endMonth=e.currentMonth;e.endYear=e.currentYear}this._adjustInstDate(e);if(e.input)e.input.val(l?"":this._formatDate(e)+(!this._get(e,"rangeSelect")?"":this._get(e,"rangeSeparator")+this._formatDate(e,e.endDay,e.endMonth,e.endYear)))},
_getDate:function(e){var g=!e.currentYear||e.input&&e.input.val()==""?null:new Date(e.currentYear,e.currentMonth,e.currentDay);return this._get(e,"rangeSelect")?[e.rangeStart||g,!e.endYear?null:new Date(e.endYear,e.endMonth,e.endDay)]:g},_generateDatepicker:function(e){var g=new Date;g=new Date(g.getFullYear(),g.getMonth(),g.getDate());var j=this._get(e,"showStatus"),l=this._get(e,"isRTL"),o=this._get(e,"mandatory")?"":'<div class="ui-datepicker-clear"><a onclick="jQuery.datepicker._clearDate(\'#'+
e.id+"');\""+(j?this._addStatus(e,this._get(e,"clearStatus")||"&#xa0;"):"")+">"+this._get(e,"clearText")+"</a></div>";o='<div class="ui-datepicker-control">'+(l?"":o)+'<div class="ui-datepicker-close"><a onclick="jQuery.datepicker._hideDatepicker();"'+(j?this._addStatus(e,this._get(e,"closeStatus")||"&#xa0;"):"")+">"+this._get(e,"closeText")+"</a></div>"+(l?o:"")+"</div>";var q=this._get(e,"prompt"),s=this._get(e,"closeAtTop"),w=this._get(e,"hideIfNoPrevNext"),G=this._get(e,"navigationAsDateFormat"),
C=this._getNumberOfMonths(e),B=this._get(e,"stepMonths"),H=C[0]!=1||C[1]!=1,i=!e.currentDay?new Date(9999,9,9):new Date(e.currentYear,e.currentMonth,e.currentDay),M=this._getMinMaxDate(e,"min",true),L=this._getMinMaxDate(e,"max"),v=e.drawMonth,P=e.drawYear;if(L){var Q=new Date(L.getFullYear(),L.getMonth()-C[1]+1,L.getDate());for(Q=M&&Q<M?M:Q;new Date(P,v,1)>Q;){v--;if(v<0){v=11;P--}}}Q=this._get(e,"prevText");Q=!G?Q:this.formatDate(Q,new Date(P,v-B,1),this._getFormatConfig(e));Q='<div class="ui-datepicker-prev">'+
(this._canAdjustMonth(e,-1,P,v)?"<a onclick=\"jQuery.datepicker._adjustDate('#"+e.id+"', -"+B+", 'M');\""+(j?this._addStatus(e,this._get(e,"prevStatus")||"&#xa0;"):"")+">"+Q+"</a>":w?"":"<label>"+Q+"</label>")+"</div>";var U=this._get(e,"nextText");U=!G?U:this.formatDate(U,new Date(P,v+B,1),this._getFormatConfig(e));w='<div class="ui-datepicker-next">'+(this._canAdjustMonth(e,+1,P,v)?"<a onclick=\"jQuery.datepicker._adjustDate('#"+e.id+"', +"+B+", 'M');\""+(j?this._addStatus(e,this._get(e,"nextStatus")||
"&#xa0;"):"")+">"+U+"</a>":w?"":"<label>"+U+"</label>")+"</div>";B=this._get(e,"currentText");B=!G?B:this.formatDate(B,g,this._getFormatConfig(e));l=(q?'<div class="'+this._promptClass+'">'+q+"</div>":"")+(s&&!e.inline?o:"")+'<div class="ui-datepicker-links">'+(l?w:Q)+(this._isInRange(e,this._get(e,"gotoCurrent")&&e.currentDay?i:g)?'<div class="ui-datepicker-current"><a onclick="jQuery.datepicker._gotoToday(\'#'+e.id+"');\""+(j?this._addStatus(e,this._get(e,"currentStatus")||"&#xa0;"):"")+">"+B+"</a></div>":
"")+(l?Q:w)+"</div>";q=this._get(e,"firstDay");G=this._get(e,"changeFirstDay");w=this._get(e,"dayNames");B=this._get(e,"dayNamesShort");Q=this._get(e,"dayNamesMin");U=this._get(e,"monthNames");for(var ba=this._get(e,"beforeShowDay"),S=this._get(e,"highlightWeek"),X=this._get(e,"showOtherMonths"),ca=this._get(e,"showWeeks"),ea=this._get(e,"calculateWeek")||this.iso8601Week,fa=j?this._get(e,"dayStatus")||"&#xa0;":"",ja=this._get(e,"statusForDate")||this.dateStatus,ha=e.endDay?new Date(e.endYear,e.endMonth,
e.endDay):i,sa=0;sa<C[0];sa++)for(var pa=0;pa<C[1];pa++){var ka=new Date(P,v,e.selectedDay);l+='<div class="ui-datepicker-one-month'+(pa==0?" ui-datepicker-new-row":"")+'">'+this._generateMonthYearHeader(e,v,P,M,L,ka,sa>0||pa>0,j,U)+'<table class="ui-datepicker" cellpadding="0" cellspacing="0"><thead><tr class="ui-datepicker-title-row">'+(ca?"<td>"+this._get(e,"weekHeader")+"</td>":"");for(var ga=0;ga<7;ga++){var Z=(ga+q)%7,qa=fa.indexOf("DD")>-1?fa.replace(/DD/,w[Z]):fa.replace(/D/,B[Z]);l+="<td"+
((ga+q+6)%7>=5?' class="ui-datepicker-week-end-cell"':"")+">"+(!G?"<span":"<a onclick=\"jQuery.datepicker._changeFirstDay('#"+e.id+"', "+Z+');"')+(j?this._addStatus(e,qa):"")+' title="'+w[Z]+'">'+Q[Z]+(G?"</a>":"</span>")+"</td>"}l+="</tr></thead><tbody>";ga=this._getDaysInMonth(P,v);if(P==e.selectedYear&&v==e.selectedMonth)e.selectedDay=Math.min(e.selectedDay,ga);qa=(this._getFirstDayOfMonth(P,v)-q+7)%7;Z=new Date(P,v,1-qa);qa=H?6:Math.ceil((qa+ga)/7);for(var ta=0;ta<qa;ta++){l+='<tr class="ui-datepicker-days-row">'+
(ca?'<td class="ui-datepicker-week-col">'+ea(Z)+"</td>":"");for(ga=0;ga<7;ga++){var oa=ba?ba.apply(e.input?e.input[0]:null,[Z]):[true,""],ia=Z.getMonth()!=v,wa=ia||!oa[0]||M&&Z<M||L&&Z>L;l+='<td class="ui-datepicker-days-cell'+((ga+q+6)%7>=5?" ui-datepicker-week-end-cell":"")+(ia?" ui-datepicker-otherMonth":"")+(Z.getTime()==ka.getTime()&&v==e.selectedMonth?" ui-datepicker-days-cell-over":"")+(wa?" "+this._unselectableClass:"")+(ia&&!X?"":" "+oa[1]+(Z.getTime()>=i.getTime()&&Z.getTime()<=ha.getTime()?
" "+this._currentClass:"")+(Z.getTime()==g.getTime()?" ui-datepicker-today":""))+'"'+((!ia||X)&&oa[2]?' title="'+oa[2]+'"':"")+(wa?S?" onmouseover=\"jQuery(this).parent().addClass('ui-datepicker-week-over');\" onmouseout=\"jQuery(this).parent().removeClass('ui-datepicker-week-over');\"":"":" onmouseover=\"jQuery(this).addClass('ui-datepicker-days-cell-over')"+(S?".parent().addClass('ui-datepicker-week-over')":"")+";"+(!j||ia&&!X?"":"jQuery('#ui-datepicker-status-"+e.id+"').html('"+(ja.apply(e.input?
e.input[0]:null,[Z,e])||"&#xa0;")+"');")+"\" onmouseout=\"jQuery(this).removeClass('ui-datepicker-days-cell-over')"+(S?".parent().removeClass('ui-datepicker-week-over')":"")+";"+(!j||ia&&!X?"":"jQuery('#ui-datepicker-status-"+e.id+"').html('&#xa0;');")+'" onclick="jQuery.datepicker._selectDay(\'#'+e.id+"',"+v+","+P+', this);"')+">"+(ia?X?Z.getDate():"&#xa0;":wa?Z.getDate():"<a>"+Z.getDate()+"</a>")+"</td>";Z.setDate(Z.getDate()+1)}l+="</tr>"}v++;if(v>11){v=0;P++}l+="</tbody></table></div>"}l+=(j?
'<div style="clear: both;"></div><div id="ui-datepicker-status-'+e.id+'" class="ui-datepicker-status">'+(this._get(e,"initStatus")||"&#xa0;")+"</div>":"")+(!s&&!e.inline?o:"")+'<div style="clear: both;"></div>'+(a.browser.msie&&parseInt(a.browser.version)<7&&!e.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover"></iframe>':"");return l},_generateMonthYearHeader:function(e,g,j,l,o,q,s,w,G){l=e.rangeStart&&l&&q<l?q:l;q='<div class="ui-datepicker-header">';if(s||!this._get(e,"changeMonth"))q+=
G[g]+"&#xa0;";else{var C=l&&l.getFullYear()==j,B=o&&o.getFullYear()==j;q+='<select class="ui-datepicker-new-month" onchange="jQuery.datepicker._selectMonthYear(\'#'+e.id+"', this, 'M');\" onclick=\"jQuery.datepicker._clickMonthYear('#"+e.id+"');\""+(w?this._addStatus(e,this._get(e,"monthStatus")||"&#xa0;"):"")+">";for(var H=0;H<12;H++)if((!C||H>=l.getMonth())&&(!B||H<=o.getMonth()))q+='<option value="'+H+'"'+(H==g?' selected="selected"':"")+">"+G[H]+"</option>";q+="</select>"}if(s||!this._get(e,"changeYear"))q+=
j;else{g=this._get(e,"yearRange").split(":");G=s=0;if(g.length!=2){s=j-10;G=j+10}else if(g[0].charAt(0)=="+"||g[0].charAt(0)=="-"){s=G=(new Date).getFullYear();s+=parseInt(g[0],10);G+=parseInt(g[1],10)}else{s=parseInt(g[0],10);G=parseInt(g[1],10)}s=l?Math.max(s,l.getFullYear()):s;G=o?Math.min(G,o.getFullYear()):G;for(q+='<select class="ui-datepicker-new-year" onchange="jQuery.datepicker._selectMonthYear(\'#'+e.id+"', this, 'Y');\" onclick=\"jQuery.datepicker._clickMonthYear('#"+e.id+"');\""+(w?this._addStatus(e,
this._get(e,"yearStatus")||"&#xa0;"):"")+">";s<=G;s++)q+='<option value="'+s+'"'+(s==j?' selected="selected"':"")+">"+s+"</option>";q+="</select>"}q+="</div>";return q},_addStatus:function(e,g){return" onmouseover=\"jQuery('#ui-datepicker-status-"+e.id+"').html('"+g+"');\" onmouseout=\"jQuery('#ui-datepicker-status-"+e.id+"').html('&#xa0;');\""},_adjustInstDate:function(e,g,j){var l=e.drawYear+(j=="Y"?g:0),o=e.drawMonth+(j=="M"?g:0);g=Math.min(e.selectedDay,this._getDaysInMonth(l,o))+(j=="D"?g:0);
l=new Date(l,o,g);o=this._getMinMaxDate(e,"min",true);g=this._getMinMaxDate(e,"max");l=o&&l<o?o:l;l=g&&l>g?g:l;e.selectedDay=l.getDate();e.drawMonth=e.selectedMonth=l.getMonth();e.drawYear=e.selectedYear=l.getFullYear();if(j=="M"||j=="Y")this._notifyChange(e)},_notifyChange:function(e){var g=this._get(e,"onChangeMonthYear");if(g)g.apply(e.input?e.input[0]:null,[new Date(e.selectedYear,e.selectedMonth,1),e])},_getNumberOfMonths:function(e){e=this._get(e,"numberOfMonths");return e==null?[1,1]:typeof e==
"number"?[1,e]:e},_getMinMaxDate:function(e,g,j){if(g=this._determineDate(this._get(e,g+"Date"),null)){g.setHours(0);g.setMinutes(0);g.setSeconds(0);g.setMilliseconds(0)}return!j||!e.rangeStart?g:!g||e.rangeStart>g?e.rangeStart:g},_getDaysInMonth:function(e,g){return 32-(new Date(e,g,32)).getDate()},_getFirstDayOfMonth:function(e,g){return(new Date(e,g,1)).getDay()},_canAdjustMonth:function(e,g,j,l){var o=this._getNumberOfMonths(e);j=new Date(j,l+(g<0?g:o[1]),1);g<0&&j.setDate(this._getDaysInMonth(j.getFullYear(),
j.getMonth()));return this._isInRange(e,j)},_isInRange:function(e,g){var j=!e.rangeStart?null:new Date(e.selectedYear,e.selectedMonth,e.selectedDay);j=(j=j&&e.rangeStart<j?e.rangeStart:j)||this._getMinMaxDate(e,"min");e=this._getMinMaxDate(e,"max");return(!j||g>=j)&&(!e||g<=e)},_getFormatConfig:function(e){var g=this._get(e,"shortYearCutoff");g=typeof g!="string"?g:(new Date).getFullYear()%100+parseInt(g,10);return{shortYearCutoff:g,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,
"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,g,j,l){if(!g){e.currentDay=e.selectedDay;e.currentMonth=e.selectedMonth;e.currentYear=e.selectedYear}g=g?typeof g=="object"?g:new Date(l,j,g):new Date(e.currentYear,e.currentMonth,e.currentDay);return this.formatDate(this._get(e,"dateFormat"),g,this._getFormatConfig(e))}});a.fn.datepicker=function(e){var g=Array.prototype.slice.call(arguments,1);if(typeof e=="string"&&(e=="isDisabled"||
e=="getDate"))return a.datepicker["_"+e+"Datepicker"].apply(a.datepicker,[this[0]].concat(g));return this.each(function(){typeof e=="string"?a.datepicker["_"+e+"Datepicker"].apply(a.datepicker,[this].concat(g)):a.datepicker._attachDatepicker(this,e)})};a.datepicker=new b;a(document).ready(function(){a(document.body).append(a.datepicker.dpDiv).mousedown(a.datepicker._checkExternalClick)})})(jQuery);
jQuery.cookie=function(a,b,c){if(typeof b!="undefined"){c=c||{};if(b===null){b="";c.expires=-1}var d="";if(c.expires&&(typeof c.expires=="number"||c.expires.toUTCString)){if(typeof c.expires=="number"){d=new Date;d.setTime(d.getTime()+c.expires*24*60*60*1E3)}else d=c.expires;d="; expires="+d.toUTCString()}var e=c.path?"; path="+c.path:"",g=c.domain?"; domain="+c.domain:"; domain=www.mayomo.com";c=c.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(b),d,e,g,c].join("")}else{b=null;if(document.cookie&&
document.cookie!=""){c=document.cookie.split(";");for(d=0;d<c.length;d++){e=jQuery.trim(c[d]);if(e.substring(0,a.length+1)==a+"="){b=decodeURIComponent(e.substring(a.length+1));break}}}return b}};
(function(){var a={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(b){for(var c=0;c<b.length;c++){var d=b[c].string,e=b[c].prop;this.versionSearchString=b[c].versionSearch||b[c].identity;if(d){if(d.indexOf(b[c].subString)!=-1)return b[c].identity}else if(e)return b[c].identity}},
searchVersion:function(b){var c=b.indexOf(this.versionSearchString);if(c!=-1)return parseFloat(b.substring(c+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,
subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],
dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};a.init();window.$.client={os:a.OS,browser:a.browser}})();(function(){window.jQuery.log=function(a){if(typeof console=="object")console.log(a);else typeof opera=="object"?opera.postError(a):alert(a)}})();
(function(a){a.fn.clickoutside=function(b){var c=1,d=$(this);d.cb=b;this.click(function(){c=0});$(document).click(function(){c&&d.cb();c=1});return $(this)}})(jQuery);
(function(a){var b=true;if(typeof localStorage=="undefined"||typeof JSON=="undefined")b=false;else var c=localStorage;this.setItem=function(d,e,g){if(!b)return false;if(typeof g=="undefined")g=6E4;c.setItem(d,JSON.stringify(e));c.setItem("meta_ct_"+d,(new Date).getTime());c.setItem("meta_lt_"+d,g)};this.getItem=function(d){if(!b)return false;if((new Date).getTime()-c.getItem("meta_ct_"+d)>c.getItem("meta_lt_"+d)){c.removeItem(d);c.removeItem("meta_ct_"+d);c.removeItem("meta_lt_"+d);return false}return JSON.parse(c.getItem(d))};
this.removeItem=function(d){if(!b)return false;c.removeItem(d);c.removeItem("meta_ct_"+d);c.removeItem("meta_lt_"+d);return true};a.localStorage=this})(jQuery);
var Mayomo={bindLogoClick:function(){$(".logoHome").mousedown(function(){$.cookie("prev_href",null,{});$.cookie("centerLon",null,{});$.cookie("centerLat",null,{});$.cookie("zoomTo",null,{})})}},Mouse={disableWheel:function(a){var b=document;if(typeof a!="undefined")b=document.getElementById(a);$.browser.mozilla&&b.addEventListener("DOMMouseScroll",function(c){c.stopPropagation();c.preventDefault();return c.cancelBubble=false},false);$.browser.safari&&b.addEventListener("mousewheel",function(c){c.preventDefault();
return c.cancelBubble=false},false);$.browser.msie&&b.attachEvent("onmousewheel",function(c){if(!c)c=window.event;c.returnValue=false;c.cancelBubble=true;return false},false);$.browser.opera&&b.attachEvent("mousewheel",function(c){if(!c)c=window.event;c.returnValue=false;c.cancelBubble=true;return false},false)}};if(typeof console=="undefined")var console={log:function(){},time:function(){},timeEnd:function(){}};
var BaseController={queryString:{category:9,state:"",keywords:"",fd:"",td:"",page:1},requestUri:"",initQueryString:function(){var a="";if(this.requestUri!="")a=this.requestUri.split("#")[1].replace(/\//g,"");if(typeof location.href.split("#")[1]!="undefined")a=location.href.split("#")[1].replace(/\//g,"");a=a.split(";");for(var b=a.length,c=0;c<b;c++){var d=a[c].split("=");if(d[0]=="category")BaseController.queryString.category=+d[1];else if(d[0]=="state")BaseController.queryString.state=d[1];else if(d[0]==
"fd")BaseController.queryString.fd=d[1];else if(d[0]=="td")BaseController.queryString.td=d[1];else if(d[0]=="keywords")BaseController.queryString.keywords=d[1];else if(d[0]=="page")BaseController.queryString.page=+d[1]}},getMaterialId:function(){var a=location.pathname.substring(1);return a=a.split("-")[0]},setQueryString:function(a){if(typeof a.category!="undefined")BaseController.queryString.category=a.category;if(typeof a.state!="undefined")BaseController.queryString.state=a.state;if(typeof a.fd!=
"undefined")BaseController.queryString.fd=a.fd;if(typeof a.td!="undefined")BaseController.queryString.td=a.td;if(typeof a.keywords!="undefined")BaseController.queryString.keywords=a.keywords;if(typeof a.page!="undefined")BaseController.queryString.page=a.page},rewriteUrl:function(){arrQueryString=[];BaseController.queryString.category!=""&&arrQueryString.push("category="+BaseController.queryString.category);BaseController.queryString.state!=""&&arrQueryString.push("state="+BaseController.queryString.state);
BaseController.queryString.fd!=""&&arrQueryString.push("fd="+BaseController.queryString.fd);BaseController.queryString.td!=""&&arrQueryString.push("td="+BaseController.queryString.td);BaseController.queryString.keywords!=""&&arrQueryString.push("keywords="+BaseController.queryString.keywords);BaseController.queryString.page!=""&&arrQueryString.push("page="+BaseController.queryString.page);strQueryString="#/"+arrQueryString.join(";")+"/";BaseController.setQueryStringToCookie(strQueryString);location.href=
strQueryString},getQueryString:function(){return BaseController.queryString},setQueryStringToCookie:function(a){$.cookie("queryString",a)},getQueryStringFromCookie:function(){if($.cookie("queryString")!=null){this.requestUri=$.cookie("queryString");this.initQueryString()}}};window.Map={};
(function(){var a=OpenLayersMap={_map:null,_server:"http://mayomobg.homeip.net/tilecache/tilcache.py/1.0.0",_markers:new OpenLayers.Layer.Markers("Markers"),_topLeftCorner:[],_bottomRightCorner:[],_size:new OpenLayers.Size(20,20),_offset:new OpenLayers.Pixel(-5,-4.5),_vectorLayer:null,_zoomLevel:0,_pageOffset:0,_timeoutid:null,_lon:0,_lat:10,_zoom:2,_usingCache:false,_saveLonLatZoom:false,vectors:null,mask:null,_clickToSaveCoordinates:false,_uploadMarker:new OpenLayers.Layer.Markers("Markers"),_vectorLayer:null,
_useCloudMade:1,_onlyCloudMade:false,_newsOnDemand:false,_transformation:[{from:new OpenLayers.Projection("EPSG:4326"),to:new OpenLayers.Projection("EPSG:4326")},{from:new OpenLayers.Projection("EPSG:4326"),to:new OpenLayers.Projection("EPSG:900913")}],_cloudmade:null,_thumbsCount:0,_ajaxRequest:null,_popupsDisabled:false,init:function(b){if($("#map").length!=0){$(document).bind("reload-map",function(){a.load(true,BaseController.getQueryString())});if(typeof b!="undefined")a._onlyCloudMade=b;a._map=
new OpenLayers.Map("map");a._cloudmade=new OpenLayers.Layer.CloudMade("CloudMade",{key:"c75669f443cd5ddf803d02b33fcb3a8b",styleId:7511});OpenLayers.Feature.Vector.style["default"].fillOpacity=1;a.vectors=new OpenLayers.Layer.GML("World Countries","/map/virtu.geo.json.html",{format:OpenLayers.Format.GeoJSON,styleMap:a._buildStyle(),projection:new OpenLayers.Projection("EPSG:4326")});b=new OpenLayers.Layer.GML("Mask","/map/mask.geo.json.html",{format:OpenLayers.Format.GeoJSON,styleMap:a._buildMaskStyle(),
projection:new OpenLayers.Projection("EPSG:4326")});a._map.addLayers([a._cloudmade,b,a.vectors]);b=new OpenLayers.Marker.Label((new OpenLayers.LonLat(-40,45)).transform(a._transformation[a._useCloudMade].from,a._transformation[a._useCloudMade].to),null,"Virtu");a._markers.addMarker(b);b=new OpenLayers.Control.SelectFeature(a.vectors,{hover:true,onSelect:function(e){$("path").mousemove(function(g){$("#map").append('<div id="tooltip"></div>');$("#tooltip").addClass("country-tooltip").css({top:g.pageY+
10,left:g.pageX+10,width:"auto"}).html('<div class="left sprite">&nbsp;</div><span class="sprite">'+e.attributes.name+"</span>").show()})},onUnselect:function(){$("path").mouseout(function(){$("#tooltip").remove()})},callbacks:{click:function(){a._map.setCenter((new OpenLayers.LonLat(this.handlers.feature.feature.attributes.lon,this.handlers.feature.feature.attributes.lat)).transform(a._transformation[a._useCloudMade].from,a._transformation[a._useCloudMade].to),this.handlers.feature.feature.attributes.zoomLevel);
$('input[id="country"]').val(this.handlers.feature.feature.attributes.name);a._clickToSaveCoordinates||a.load(true,BaseController.getQueryString())}}});a._map.addControl(b);b.activate();a._disableWheel();if($.cookie("zoomTo")&&$.cookie("centerLon")&&$.cookie("centerLat")){a._lon=$.cookie("centerLon");a._lat=$.cookie("centerLat");a._zoom=$.cookie("zoomTo")}else a._disableDragging();a._map.setCenter((new OpenLayers.LonLat(a._lon,a._lat)).transform(a._transformation[a._useCloudMade].from,a._transformation[a._useCloudMade].to),
a._zoom);a._zoomLevel=a._map.zoom;a._topLeftCorner=a._map.getLonLatFromPixel(new OpenLayers.Pixel($("#map").offset().left,$("#map").offset().top)).transform(a._transformation[a._useCloudMade].to,a._transformation[a._useCloudMade].from);a._bottomRightCorner=a._map.getLonLatFromPixel(new OpenLayers.Pixel($("#map").offset().left+$("#map").width(),$("#map").offset().top+$("#map").height())).transform(a._transformation[a._useCloudMade].to,a._transformation[a._useCloudMade].from);a._map.events.register("movestart",
a._map,function(){a._stopPopups=true;$(a._markers.div).empty()});var c=true;a._map.events.register("moveend",a._map,function(){a._map.zoom<2&&a._map.zoomTo(2);a._timeoutid&&clearTimeout(a._timeoutid);a._refresh();c=false});var d=false;a._map.events.register("mousedown",a._map,function(){d=true});a._map.events.register("mousemove",a._map,function(){d=false});a._map.events.register("mouseup",a._map,function(e){if(d){a._enableWheel();a._enableDraggig()}if(a._clickToSaveCoordinates){var g=a._map.getLonLatFromPixel(new OpenLayers.Pixel(e.pageX,
e.pageY-230)).transform(a._transformation[a._useCloudMade].to,a._transformation[a._useCloudMade].from).lon;e=a._map.getLonLatFromPixel(new OpenLayers.Pixel(e.pageX,e.pageY-230)).transform(a._transformation[a._useCloudMade].to,a._transformation[a._useCloudMade].from).lat;a._putMarker(g,e);a._saveCoordinates(g,e)}});a._map.addLayer(a._markers);a._map.addLayer(a._uploadMarker)}},load:function(b,c){$(".map-tooltip").remove();if(typeof b==null)b=false;a._newsOnDemand=c.category==16||c.category==33?true:
false;a._pageOffset||$("#preloader").show();if(a._map.zoom<a._zoomLevel||b){a._thumbsCount=0;a._markers.clearMarkers();$("a.mapthumb").unbind();$("div.thumb").unbind();$("a.mapthumb").remove();$("div.thumb").remove()}a._map.zoom>a._zoomLevel&&a._enableWheel();a._zoomLevel=a._map.zoom;b="/";if(a._map.zoom>2)b="/latmax/"+(a._topLeftCorner.lat+5)+"/latmin/"+a._bottomRightCorner.lat+"/lonmax/"+a._bottomRightCorner.lon+"/lonmin/"+a._topLeftCorner.lon+"/";if(typeof c!="undefined")var d=c,e="/information/list/category/"+
d.category+"/state/"+d.state+"/FD/"+d.fd+"/TD/"+d.td+"/keywords/"+d.keywords+b+"offset/"+a._pageOffset;if(d.state+d.fd+d.td+d.keywords==""&&b=="/")e=+d.category?"/information/list/category/"+d.category:"/information/list/category/9/";a._usingCache=true;a._ajaxRequest=$.ajax({url:e,dataType:"json",success:function(g){$.localStorage.setItem("the_data_"+d.category,g,1E5);g=g.results;var j=a._newsOnDemand,l=a._map.zoom>3;new OpenLayers.Pixel(-33,-25);for(var o=[],q=0,s=0,w=g.length,G=a._markers,C="",
B,H=w;H--;){B=g[w-H-1];var i=B.o,M=B.a,L=B.i,v=B.tp,P=B.h,Q=B.tt,U=B.ty,ba=B.ip,S=B.t,X=B.d;if(typeof B!="undefined")if(j){B=a._map.getLayerPxFromLonLat((new OpenLayers.LonLat(i,M)).transform(a._transformation[a._useCloudMade].from,a._transformation[a._useCloudMade].to));C+='<div id="OL_Icon_'+H+'" style="position:absolute;top:'+(B.y-30)+"px;left:"+B.x+'px"><a class="request icon" href="/'+v+'" id="matid-'+L+'"></a></div>'}else{B=a._map.getLayerPxFromLonLat((new OpenLayers.LonLat(i,M)).transform(a._transformation[a._useCloudMade].from,
a._transformation[a._useCloudMade].to));C+=l?U==1?'<div id="OL_Icon_'+H+'" style="position:absolute;top:'+(B.y-14)+"px;left:"+B.x+'px"><a class="mapthumb icon photo" style="width:28px;height:28px;" href="/'+v+'" thumb="'+P+'" tooltip="'+S+"{{}}"+Q+"{{}}"+X+'"></a></div>':'<div id="OL_Icon_'+H+'" style="position:absolute;top:'+(B.y-14)+"px;left:"+B.x+'px"><a class="mapthumb icon video" style="width:28px;height:28px;" href="/'+v+'" thumb="'+P+'" tooltip="'+S+"{{}}"+Q+"{{}}"+X+'"></a></div>':'<div id="OL_Icon_'+
H+'" style="position:absolute;top:'+(B.y-4)+"px;left:"+B.x+'px"><a class="mapthumb icon dot" href="/'+v+'" thumb="'+P+'" tooltip="'+S+"{{}}"+Q+"{{}}"+X+'"></a></div>';if(1==ba&&s<30){q++;o[s++]=[Q,P,{top:B.y+100,left:B.x+3},v,S,X]}else if(q<30)o[q++]=[Q,P,{top:B.y+100,left:B.x+3},v,S,X]}}$(G.div).html(C);if(j){$(".request").mouseover(a._showNewsOnDemandTooltip);$(".request").mouseout(function(){clearTimeout(a._timeoutid);a._timeoutid=setTimeout(function(){$("#news-on-demand-tooltip").hide()},1E3)})}else $(".mapthumb").live("mouseover",
a._showTooltip).live("mouseout",a._hideTooltip);$("#preloader").hide();if(!a._popupsDisabled){a._stopPopups=false;clearTimeout(a._tooltipTimeout);a._startShowingPopups(o,0)}}})},onSuccess:function(b){var c=b.results;b=a._newsOnDemand;var d=a._map.zoom>3;new OpenLayers.Pixel(-33,-25);for(var e=[],g=0,j=0,l=c.length,o=a._markers,q="",s,w=l;w--;){s=c[l-w-1];var G=s.o,C=s.a,B=s.i,H=s.tp,i=s.h,M=s.tt,L=s.ty,v=s.ip,P=s.t,Q=s.d;if(typeof s!="undefined")if(b){s=a._map.getLayerPxFromLonLat((new OpenLayers.LonLat(G,
C)).transform(a._transformation[a._useCloudMade].from,a._transformation[a._useCloudMade].to));q+='<div id="OL_Icon_'+w+'" style="position:absolute;top:'+(s.y-30)+"px;left:"+s.x+'px"><a class="request icon" href="/'+H+'" id="matid-'+B+'"></a></div>'}else{s=a._map.getLayerPxFromLonLat((new OpenLayers.LonLat(G,C)).transform(a._transformation[a._useCloudMade].from,a._transformation[a._useCloudMade].to));q+=d?L==1?'<div id="OL_Icon_'+w+'" style="position:absolute;top:'+(s.y-14)+"px;left:"+s.x+'px"><a class="mapthumb icon photo" style="width:28px;height:28px;" href="/'+
H+'" thumb="'+i+'" tooltip="'+P+"{{}}"+M+"{{}}"+Q+'"></a></div>':'<div id="OL_Icon_'+w+'" style="position:absolute;top:'+(s.y-14)+"px;left:"+s.x+'px"><a class="mapthumb icon video" style="width:28px;height:28px;" href="/'+H+'" thumb="'+i+'" tooltip="'+P+"{{}}"+M+"{{}}"+Q+'"></a></div>':'<div id="OL_Icon_'+w+'" style="position:absolute;top:'+(s.y-4)+"px;left:"+s.x+'px"><a class="mapthumb icon dot" href="/'+H+'" thumb="'+i+'" tooltip="'+P+"{{}}"+M+"{{}}"+Q+'"></a></div>';if(1==v&&j<30){g++;e[j++]=[M,
i,{top:s.y+100,left:s.x+3},H,P,Q]}else if(g<30)e[g++]=[M,i,{top:s.y+100,left:s.x+3},H,P,Q]}}$(o.div).html(q);if(!d&&typeof OpenLayers.OlympicGamesBanner!="undefined"){c=new OpenLayers.OlympicGamesBanner;c=new OpenLayers.Marker((new OpenLayers.LonLat(-123.07,49.16)).transform(a._transformation[a._useCloudMade].from,a._transformation[a._useCloudMade].to),c);a._markers.addMarker(c)}$("#vantt").fadeTo(5E3,1).fadeOut("slow",function(){$("#van-banner").show()});if(b){$(".request").mouseover(a._showNewsOnDemandTooltip);
$(".request").mouseout(function(){clearTimeout(a._timeoutid);a._timeoutid=setTimeout(function(){$("#news-on-demand-tooltip").hide()},1E3)})}else $(".mapthumb").live("mouseover",a._showTooltip).live("mouseout",a._hideTooltip);$("#preloader").hide();if(!a._popupsDisabled){a._stopPopups=false;clearTimeout(a._tooltipTimeout);a._startShowingPopups(e,0)}},disablePopups:function(){a._popupsDisabled=true},enablePopups:function(){a._popupsDisabled=false},_stopPopups:false,_tooltipTimeout:null,_clientWidth:$(window).width(),
_startShowingPopups:function(b,c){if(a._stopPopups)a._tooltipTimeout=setTimeout(function(){a._startShowingPopups(b,c)},1E4);else if(typeof b[c]=="undefined"){var d=c+1;a._tooltipTimeout=setTimeout(function(){a._startShowingPopups(b,d)},10)}else{var e=b[c][0];$("#map").append('<div class="map-tooltip" rel="'+c+'"><div class="mtooltip-down">&nbsp;</div><div class="material-tooltip"><div style="background: #ccc url('+b[c][1]+')" class="thumbtooltip" id="thumbtooltip><a class="round" title="" href=""></a></div><h1>'+
b[c][4]+'</h1><br/><div class="tooltip-details">'+e+'</div><div class="material-descr">'+b[c][5]+"</div></div></div>");$(".map-tooltip[rel="+c+"]").show().click(function(){location.href="/"+b[c][3]});e=b[c][2].top-$(".map-tooltip[rel="+c+"] > .material-tooltip")[0].clientHeight+12;var g=b[c][2].left+2,j=0,l=0;if(e<103)j=1;if(g+252>a._clientWidth)l=2;switch(j+l){case 0:break;case 1:e=b[c][2].top+15;j=$(".map-tooltip[rel="+c+"] > .mtooltip-down").css("cssText")+";background:transparent url(/images/material-tooltip-ul.png) no-repeat 0 0;height:12px;";
$(".map-tooltip[rel="+c+"] > .mtooltip-down").css("cssText",j);j=$(".map-tooltip[rel="+c+"] > .material-tooltip").css("cssText")+";background:transparent url(/images/material-tooltip-down.png) no-repeat 0 bottom;";$(".map-tooltip[rel="+c+"] > .material-tooltip").css("cssText",j);break;case 2:g=b[c][2].left-255;j=$(".map-tooltip[rel="+c+"] > .material-tooltip").css("cssText")+";background:transparent url(/images/material-tooltip-down-dr.png) no-repeat 0 bottom;";$(".map-tooltip[rel="+c+"] > .material-tooltip").css("cssText",
j);break;case 3:e=b[c][2].top+15;g=b[c][2].left-252;break}e=$(".map-tooltip[rel="+c+"]").css("cssText")+";top:"+e+"px;left:"+g+"px;width:200px;";$(".map-tooltip[rel="+c+"]").css("cssText",e);d=c;if(b.length==d+1)d=-1;a._tooltipTimeout=setTimeout(function(){$(".map-tooltip").remove();a._startShowingPopups(b,d+1)},3E3)}},addMaterialThumb:function(b){$.ajax({url:"/information/get/id/"+b,dataType:"json",success:function(c){var d=new OpenLayers.Thumb(c[0].http_path,a._size,a._offset,null,c[0].tooltip,
c[0].title_processed,true),e=new OpenLayers.Marker((new OpenLayers.LonLat(+c[0].longitude,+c[0].latitude)).transform(a._transformation[a._useCloudMade].from,a._transformation[a._useCloudMade].to),d);a._markers.addMarker(e);if(c[0].type_id==1)$(d.imageDiv).children().addClass("markedphoto").css({width:"28px",height:"28px",zIndex:3E4});else c[0].type_id==2&&$(d.imageDiv).children().addClass("markedvideo").css({width:"28px",height:"28px",zIndex:3E4});if(a._newsOnDemand)$(".mapthumb").mouseover(a._showNewsOnDemandTooltip);
else{$(".mapthumb").mousemove(a._showTooltip);$(".mapthumb").mouseout(a._hideTooltip)}}})},setCenter:function(b,c,d){a._map.setCenter((new OpenLayers.LonLat(b,c)).transform(a._transformation[a._useCloudMade].from,a._transformation[a._useCloudMade].to),d)},enableSlide:function(){var b=$("#map").height();$(".map-slider").mouseover(function(){document.body.style.cursor="move"});$(".map-slider").mouseout(function(){document.body.style.cursor="auto"});$(".map-slider").mousedown(function(){$(document).mousemove(function(c){b=
c.pageY-105;$("#map").css("height",b);a._map.updateSize()});$(document).mouseup(function(){$("#map").css("height",b);$(document).unbind()})})},enableCoordinatesSave:function(){a._clickToSaveCoordinates=true},_putMarker:function(b,c){a._uploadMarker.clearMarkers();a._uploadMarker.addMarker(new OpenLayers.Marker((new OpenLayers.LonLat(b,c)).transform(a._transformation[a._useCloudMade].from,a._transformation[a._useCloudMade].to)))},_saveCoordinates:function(b,c){$('input[id="longitude"]').val(b);$('input[id="latitude"]').val(c)},
_buildStyle:function(){var b=new OpenLayers.Style,c=new OpenLayers.Rule({filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN,property:"value",value:10}),symbolizer:{Polygon:{fillColor:"#f2f2f2",strokeColor:"#cfcfcf"}}});b.addRules([c]);return new OpenLayers.StyleMap({"default":b,select:{strokeColor:"#59bce6",fillColor:"#59bce6",strokeWidth:1}})},_buildMaskStyle:function(){var b=new OpenLayers.Style,c=new OpenLayers.Rule({filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN,
property:"value",value:10}),symbolizer:{Polygon:{fillColor:"#909090",strokeColor:"#909090"}}});b.addRules([c]);return new OpenLayers.StyleMap({"default":b,select:{strokeColor:"#909090",fillColor:"#909090",strokeWidth:0}})},destroyVectorLayer:function(){a._vectorLayer.destroy()},center:function(){a._map.setCenter(new OpenLayers.LonLat(0,3),2)},_showTooltip:function(b){if($(b.target).is("a")){a._stopPopups=true;$(".map-tooltip").hide();$(this).parent().addClass("popup-thumb");$(this).addClass("popup-thumb");
$(this).offset();var c=$(this).attr("tooltip").split("{{}}");$("#map-tooltip").html('<div class="mtooltip-down">&nbsp;</div><div class="material-tooltip"><div style="background: #ccc url('+$(this).attr("thumb")+')" class="thumbtooltip" id="thumbtooltip><a class="round"></a></div><h1>'+c[0]+'</h1><br/><div class="tooltip-details">'+c[1]+'</div><div class="material-descr">'+c[2]+"</div></div>").show();c=b.pageY-$("#map-tooltip > .material-tooltip")[0].clientHeight;b=b.pageX;b=$("#map-tooltip").css("cssText")+
";top:"+c+"px;left:"+b+"px;width:200px;";$("#map-tooltip").css("cssText",b)}return false},_showNewsOnDemandTooltip:function(b){if(b.target.nodeName=="A"){clearTimeout(a._timeoutid);$("#news-on-demand-tooltip").mouseenter(function(){clearTimeout(a._timeoutid)});$("#news-on-demand-tooltip").mouseleave(function(){a._timeoutid=setTimeout(function(){$("#news-on-demand-tooltip").hide()},2E3)});var c=$(this).attr("id").substr(6),d=$(this).offset();$.ajax({dataType:"json",url:"/information/get/id/"+c,success:function(e){$("#news-on-demand-title").html(e[0].title);
$("#news-on-demand-dc").html(e[0].date_processed);$("#news-on-demand-username").html(e[0].user_name).attr("href","/user/profile/name/"+e[0].user_name);$("#news-on-demand-description").html(e[0].description);$("#news-on-demand-answer").attr("href","/video-reply/id/"+c);$("#news-on-demand-tooltip").css({top:d.top+30,left:d.left+$("#news-on-demand-tooltip").width()+50>$(window).width()?d.left-$("#news-on-demand-tooltip").width()-20:d.left+15,width:"200px"}).show();$.ajax({dataType:"json",url:"/information/get-video-replies/id/"+
c,success:function(g){$("#news-on-demand-vrlist").empty();if(+g.count>0){for(var j=0;j<g.list.length;j++)$("#news-on-demand-vrlist").append('<div class="item"><a class="thumb" href="/'+g.list[j].video_reply_id+'"><img style="width: 70px;" src="data:image/jpeg;base64,'+g.list[j].video_reply_thumb+'"/><img class="news-req-round-img" src="../images/round_white.gif"/></a><a title="Add To My Playlist" class="addItem atmp-'+g.list[j].video_reply_id+'" href="#"/><h1><a href="/'+g.list[j].video_reply_id+
'">'+g.list[j].video_reply_title+"</a></h1><h2>by heyjoe<br/> 27 september 2009 </h2></div>");$("#news-on-demand-reports-count").html(+g.count+" reports")}else $("#news-on-demand-reports-count").html("no reports");$("#news-on-demand-reports-count").attr("href","/"+c);$("#news-on-demand-see-all").attr("href","/"+c)}})}})}return false},removeControls:function(){$(".olControlPanZoom").hide()},_hideTooltip:function(){$(this).parent().removeClass("popup-thumb");$(this).removeClass("popup-thumb");$("#map-tooltip").hide();
if(a._map.zoom==2)a._stopPopups=false},_disableWheel:function(){controls=a._map.getControlsByClass("OpenLayers.Control.Navigation");for(var b=0;b<controls.length;b++)controls[b].disableZoomWheel()},_enableWheel:function(){controls=a._map.getControlsByClass("OpenLayers.Control.Navigation");for(var b=0;b<controls.length;b++)controls[b].enableZoomWheel()},_disableDragging:function(){for(var b=0;b<a._map.controls.length;b++)a._map.controls[b].displayClass=="olControlNavigation"&&a._map.controls[b].deactivate()},
_enableDraggig:function(){for(var b=0;b<a._map.controls.length;b++)a._map.controls[b].displayClass=="olControlNavigation"&&a._map.controls[b].activate()},_refresh:function(){if(a._saveLonLatZoom){$.cookie("zoomTo",a._map.zoom);$.cookie("centerLat",a._map.getCenter().lat);$.cookie("centerLon",a._map.getCenter().lon)}a._topLeftCorner=a._map.getLonLatFromPixel(new OpenLayers.Pixel($("#map").offset().left,$("#map").offset().top)).transform(a._transformation[a._useCloudMade].to,a._transformation[a._useCloudMade].from);
a._bottomRightCorner=a._map.getLonLatFromPixel(new OpenLayers.Pixel($("#map").offset().left+$("#map").width(),$("#map").offset().top+$("#map").height())).transform(a._transformation[a._useCloudMade].to,a._transformation[a._useCloudMade].from);a.load(reload=false,BaseController.getQueryString())},enableLonLatZoomSave:function(){a._saveLonLatZoom=true},callbackReloadMap:function(){a.load(true,BaseController.getQueryString())}};window.Map.init=OpenLayersMap.init;window.Map.load=OpenLayersMap.load;window.Map.destroyVectorLayer=
OpenLayersMap.destroyVectorLayer;window.Map.center=OpenLayersMap.center;window.Map.setCenter=OpenLayersMap.setCenter;window.Map.enableSlide=OpenLayersMap.enableSlide;window.Map.rebuildVirtu=OpenLayersMap.rebuildVirtu;window.Map.hideVirtu=OpenLayersMap.hideVirtu;window.Map.callbackReloadMap=OpenLayersMap.callbackReloadMap;window.Map.enableCoordinatesSave=OpenLayersMap.enableCoordinatesSave;window.Map.addMaterialThumb=OpenLayersMap.addMaterialThumb;window.Map.removeControls=OpenLayersMap.removeControls;
window.Map.enableLonLatZoomSave=OpenLayersMap.enableLonLatZoomSave;window.Map.disablePopups=OpenLayersMap.disablePopups;window.Map.enablePopups=OpenLayersMap.enablePopups;window.OpenLayersMap=null})();var Categories={};
(function(a){var b={_preventDefault:true,initialize:function(c){$(document).bind("reload-categories",function(d,e){b._fetch(e)});1!=$.inArray(c.category,[0,9,11,12,13,14,22,23,28,24,25,31,34,27,38,36,26])&&$(document).trigger("category-changed",c.category);$("#categories a:not('.upload')").live("click",b._categoriesClick);$("#subcategories a").live("click",b._subcategoriesClick)},_fetch:function(c){$.ajax({url:"/indexZend.php/category/parent/id/"+c,dataType:"text",success:function(d){parentId=+d;
$("#categories ul#tabs li").removeClass("active sprite");$("#categories ul#tabs li a").removeClass("li-active sprite");$("#categories ul li a[rel='"+parentId+"']").parent().addClass("active sprite");$("#categories ul li a[rel='"+parentId+"']").addClass("li-active sprite");b._loadSubcategories(parentId)}})},_loadSubcategories:function(c){queryString="/indexZend.php/category/list-sub/datatype/json/";if(c)queryString+="parent/"+c+"/";$.ajax({dataType:"json",url:queryString,success:function(d){$("#subcategories").empty();
for(var e=0;e<d.length;e++)$("#subcategories").append('|<a href="/#/category='+d[e].Id+'/" rel="'+d[e].Id+'" '+(BaseController.getQueryString().category==d[e].Id?'class="active sprite"':"")+">"+d[e].Category+"</a>");$("#subcategories").html($("#subcategories").html().substr(1))}})},_categoriesClick:function(){var c=$(this).attr("rel");if(!c)return true;$("#subcategories").empty().html("Loading ...");$("#categories ul#tabs li").removeClass("active sprite");$("#categories ul#tabs li a").removeClass("li-active sprite");
$(this).parent().addClass("active sprite");$(this).addClass("li-active sprite");BaseController.setQueryString({category:c,keywords:"",fd:"",td:""});BaseController.rewriteUrl();$(document).trigger("category-changed",[c]);return!b._preventDefault},_subcategoriesClick:function(){var c=$(this).attr("rel");if(c){$("#subcategories *").removeClass("active sprite");$(this).addClass("active sprite");BaseController.setQueryString({category:c,keywords:"",fd:"",td:""});BaseController.rewriteUrl();$(document).trigger("category-changed",
[c]);return!b._preventDefault}},disablePreventDefault:function(){b._preventDefault=false}};a.initialize=b.initialize;a.disablePreventDefault=b.disablePreventDefault})(Categories);var Rating={};
(function(){var a={_activeStars:[],_infId:0,_rated:false,bind:function(b){a._infId=b;$(".rating-bar a.rating-star").mouseover(a._getAllStaredChildren);$(".rating-bar a.rating-star").mouseout(a._setAllStaredChildren);$(".rating-bar a").mouseover(a._highlightStars);$(".rating-bar a").mouseout(a._removeHighlight);$(".rating-bar").mouseout(function(){$(".rating-bar a").map(function(){$(this).removeClass("highlight")})});$(".rating-bar a").click(a._rateMaterial)},_rateMaterial:function(){if($.cookie("vote_"+
a._infId)==a._infId){var b=$(".rating-message span").html();$(".rating-message span").html("You have voted for this material!").fadeOut(2E3,function(){$(".rating-message span").html(b).fadeIn(1E3)});return false}if(a._rated)return false;a._rated=true;var c=$(this).attr("id").substr(5);$.ajax({url:"/rating/vote/rating/"+c+"/id/"+a._infId+"/",success:function(d){$.cookie("vote_"+a._infId,a._infId,{path:"/",expires:365});$(".rating-message span").html("Thank you for your vote!").fadeOut(2E3,function(){var e=
d.split("_");$("a.rating-star").map(function(){+$(this).attr("id").substr(5,1)<=Math.ceil(e[0])?$(this).addClass("active"):$(this).removeClass("active")});$(".rating-message span").html(e[0]+" ("+e[1]+" votes)").fadeIn(1E3)})}});return false},_getAllStaredChildren:function(){$(".rating-bar a.active").map(function(){a._activeStars.push($(this));$(this).removeClass("active")})},_setAllStaredChildren:function(){for(var b=a._activeStars.length,c=0;c<b;c++)a._activeStars[c].addClass("active")},_highlightStars:function(){$(this).prev().addClass("highlight");
$(this).prev().prev().addClass("highlight");$(this).prev().prev().prev().addClass("highlight");$(this).prev().prev().prev().prev().addClass("highlight");$(this).prev().prev().prev().prev().prev().addClass("highlight")},_removeHighlight:function(){$(this).removeClass("highlight")}};window.Rating.bind=a.bind})();
var CommentsController={a:null,b:null,commentsContent:"",materialContent:"",timeoutid:null,count:4,submited:false,limit:10,offset:0,first:true,commentsCount:10,init:function(a){if(typeof a=="undefined")a=CommentsController.commentsCount;else CommentsController.commentsCount=a;CommentsController.submited=false;$("#toggleCommentForm").mousedown(CommentsController.showCommentForm);$("#toggleAnonymousCommentForm").mousedown(CommentsController.showAnonymousCommentForm);$("#postAComment").mousedown(CommentsController.showCommentForm);
$("#postAnAnonymousComment").mousedown(CommentsController.showAnonymousCommentForm);$("#videoReply").click(CommentsController.showVideoReplyForm);$(".getC").mouseover(CommentsController.getThisComment);$(".getC").mouseout(function(){CommentsController.timeoutid=setTimeout("CommentsController.fadeThisComment()",1E3)});$(".replyTo").mousedown(CommentsController.showReplyToForm);$(".areplyTo").mousedown(CommentsController.showAnonymousReplyToForm);$(".videoReply").mousedown(CommentsController.showVideoReplyToForm);
$(".flagcom").click(CommentsController.flag);$(".videoReplyThumb a").mousedown(CommentsController.showVideoContainer);CommentsController.first||$.ajax({url:"/comments/list/page/"+(CommentsController.offset/CommentsController.limit+1)+"/id/"+BaseController.getMaterialId(),success:function(b){$("#comments").html(b)}});CommentsController.first=false},showVideoContainer:function(){var a=$(this).attr("id").substr(6);$(this).attr("href");if(a){$("#videoLink").load("/application/MaterialController/show.php?infid="+
a,"",function(){$(".closeVideoLink").click(function(){CommentsController.hideVideoContainer()});$(".goto").attr("href","/"+a);$(".goto").click(function(){location.href="/"})});$(this).offset();$("#videoContainer").css({left:-50,top:100,display:"block"});$("#videoLink").css({display:"block"})}},hideVideoContainer:function(){$("#videoLink").html("");$("#videoContainer").hide()},getThisComment:function(){clearTimeout(CommentsController.timeoutid);var a=$(this).attr("id").substr(5),b=$(this).offset();
$("#commentPane").load(config.application+"CommentsController/show.php?commentID="+a).css({top:b.top+12,left:b.left-130}).show()},fadeThisComment:function(){CommentsController.timeoutid&&$("#commentPane").hide().html(config.lblLoading)},showCommentForm:function(){CommentsController.commentsContent=$("#comments").html();$("#comments").load("/comments","",function(){$("#comment").focus();$("#submitComment").click(CommentsController.submitCommentForm);$("#submitComment").keypress(function(a){if(parseInt(a.which)==
13){CommentsController.submitCommentForm();return false}});$("#closeComment").click(CommentsController.closeCommentForm);$("#closeComment").keypress(function(a){if(parseInt(a.which)==13){CommentsController.closeCommentForm();return false}});$("#resetComment").mousedown(CommentsController.resetCommentForm);$("#resetComment").keypress(function(a){if(parseInt(a.which)==13){CommentsController.resetCommentForm();return false}})})},showAnonymousCommentForm:function(){CommentsController.commentsContent=
$("#comments").html();$("#comments").load("/comments","",function(){$("#name").focus();CommentsController.a=Math.round(Math.random()*10);CommentsController.b=Math.round(Math.random()*10);$("#anonCaptcha").html(CommentsController.a+" + "+CommentsController.b+" = ");$("#submitComment").click(CommentsController.submitAnonymousCommentForm);$("#submitComment").keypress(function(a){if(parseInt(a.which)==13){CommentsController.submitAnonymousCommentForm();return false}});$("input#captcha").keypress(function(a){if(parseInt(a.which)==
13){CommentsController.submitAnonymousCommentForm();return false}});$("#closeComment").click(CommentsController.closeCommentForm);$("#closeComment").keypress(function(a){if(parseInt(a.which)==13){CommentsController.closeCommentForm();return false}});$("#resetComment").click(CommentsController.resetAnonymousCommentForm);$("#resetComment").keypress(function(a){if(parseInt(a.which)==13){CommentsController.resetAnonymousCommentForm();return false}})})},showVideoReplyToForm:function(){CommentsController.materialContent=
$("#vmaterial").html();var a=$(this).attr("id").substr(6),b=queryString.id;a&&b&&$("#inner").load(config.application+"CommentsController/ReplyToForm.php?commentForId="+b+"&replyTo="+a,"",function(){$("#vmaterial").show();if(scriptLoaded.UploadController)UploadController.init();else{$.ajax({type:"GET",url:config.scripts+"UploadController.js",dataType:"script"});scriptLoaded.UploadController=true}$(".back").click(CommentsController.restoreMaterialContent);$(".close").click(CommentsController.restoreMaterialContent)})},
flag:function(){var a=+$(this).attr("rel");if(!a)return false;$.cookie("flaged_"+a)||$.ajax({url:"/comments/flag/id/"+a,success:function(){$.cookie("flaged_"+a,a)}})},fadeFlagError:function(){$(".flagErrors").fadeOut(1E3)},showVideoReplyForm:function(){CommentsController.materialContent=$("#inner").html();$("#inner").load("/application/MaterialController/UploadForm.php?commentForId="+BaseController.getMaterialId(),"",function(){tinyMCE.init({mode:"textareas",theme:"simple"});$.ajax({type:"GET",url:config.scripts+
"UploadController.js",dataType:"script",success:CommentsController.videoReplyForm})})},videoReplyForm:function(){$(".back").click(CommentsController.restoreMaterialContent);$(".closePopup").click(CommentsController.restoreMaterialContent);$(".clickToUpload").html("Reply")},restoreMaterialContent:function(){$("#vmaterial").html(CommentsController.materialContent);CommentsController.init();$.ajax({type:"GET",url:config.scripts+"PreviewController.js",dataType:"script",success:function(){}});$.ajax({type:"GET",
url:config.scripts+"InnerThumbsController.js",dataType:"script"})},moreComment:function(){var a=$(this).attr("id").substr(5);CommentsController.showComment(a);$(this).hide();$("a#less-"+a).show()},lessComment:function(){var a=$(this).attr("id").substr(5);CommentsController.hideComment(a);$(this).css("display","none");$("a#more-"+a).css("display","block")},resetCommentForm:function(){$("#comment").val("")},resetAnonymousCommentForm:function(){$("#comment").val("");$("#name").val("");$("#captcha").val("")},
closeCommentForm:function(){$("#comments").load("/comments/list/id/"+BaseController.getMaterialId(),"",function(){$("#mediatext div#mask").jScrollPane();CommentsController.first=true;CommentsController.init()})},submitCommentForm:function(){CommentsController.submited=!CommentsController.submited;if($("#comment").val()=="")$("#errorComment").html("Fill the comment field").fadeIn(1E3);else if(CommentsController.submited){$.ajax({type:"POST",url:"/comments/save/",data:{replyto:$("#replyTo").val(),message:$("#comment").val(),
infid:BaseController.getMaterialId()},success:function(){CommentsController.closeCommentForm();$("span.cmt span").load("/comments/count/id/"+BaseController.getMaterialId(),"",function(a){$(this).html(" ("+parseInt(a)+")")})}});CommentsController.submited=true}},submitAnonymousCommentForm:function(){CommentsController.submited=!CommentsController.submited;if(CommentsController.a+CommentsController.b!=$("#captcha").val())$("#errorComment").html("Answer the question!").fadeIn(1E3);else if($("#comment").val()==
"")$("#errorComment").html("Fill the comment field!").fadeIn(1E3);else if(CommentsController.submited){$.ajax({type:"POST",url:"/comments/save/",data:{replyto:$("#replyTo").val(),name:$("#name").val(),message:$("#comment").val(),infid:BaseController.getMaterialId()},success:function(a){CommentsController.closeCommentForm();$("span.cmt span").load("/comments/count/id/"+BaseController.getMaterialId(),"",function(b){$(this).html(" ("+parseInt(b)+")")});parseInt(a)==1&&$("#errorComment").html("An error occurred").fadeIn(1E3)}});
CommentsController.submited=true}},showReplyToForm:function(){CommentsController.commentsContent=$("#comments").html();var a=$(this).attr("id").substr(5);a&&$("#comments").load("/comments/show-form/reply-to/"+a,"",function(){$("#submitComment").mousedown(CommentsController.submitCommentForm);$("#submitComment").keypress(function(b){if(parseInt(b.which)==13){CommentsController.submitCommentForm();return false}});$("#resetComment").mousedown(CommentsController.resetCommentForm);$("#resetComment").keypress(function(b){if(parseInt(b.which)==
13){CommentsController.resetCommentForm();return false}});$("#closeComment").mousedown(CommentsController.closeCommentForm);$("#closeComment").keypress(function(b){if(parseInt(b.which)==13){CommentsController.closeCommentForm();return false}})})},showAnonymousReplyToForm:function(){CommentsController.commentsContent=$("#comments").html();var a=$(this).attr("id").substr(6);$("#comments").load("/comments/show-form/reply-to/"+a,"",function(){CommentsController.a=Math.round(Math.random()*10);CommentsController.b=
Math.round(Math.random()*10);$("#anonCaptcha").html(CommentsController.a+"+"+CommentsController.b+" = ");$("#submitComment").mousedown(CommentsController.submitAnonymousCommentForm);$("#submitComment").keypress(function(b){if(parseInt(b.which)==13){CommentsController.submitAnonymousCommentForm();return false}});$("#resetComment").mousedown(CommentsController.resetAnonymousCommentForm);$("#resetComment").keypress(function(b){if(parseInt(b.which)==13){CommentsController.resetAnonymousCommentForm();
return false}});$("#closeComment").mousedown(CommentsController.closeCommentForm);$("#closeComment").keypress(function(b){if(parseInt(b.which)==13){CommentsController.closeCommentForm();return false}})})}},CommentsPager={all:1,current:1,content:"",bind:function(a){this.all=a;$.ajax({url:"/pager/render/all/"+CommentsPager.all+"/current/"+CommentsPager.current+"/",success:function(b){CommentsPager.content=b;CommentsPager.render();CommentsPager.show()}})},hide:function(){$("#comm-pager").hide()},show:function(){$("#comm-pager").show()},
render:function(){$("#comm-pager > a").unbind();$("#comm-pager").html(this.content);$(".previous").click(function(){CommentsPager.current--;if(CommentsPager.current>1){CommentsController.offset=(CommentsPager.current-1)*CommentsController.limit;CommentsController.init(CommentsPager.all)}return false});$(".first").click(function(){$("#comm-pager").empty();CommentsPager.current=1;CommentsController.offset=0;CommentsController.init(CommentsPager.all);return false});$(".next").click(function(){$("#comm-pager").empty();
CommentsPager.current++;if(CommentsPager.current<=CommentsPager.all){CommentsController.offset=(CommentsPager.current-1)*CommentsController.limit;CommentsController.init(CommentsPager.all)}return false});$(".last").click(function(){$("#comm-pager").empty();CommentsPager.current=CommentsPager.all;CommentsController.offset=(CommentsPager.current-1)*CommentsController.limit;CommentsController.init(CommentsPager.all);return false});$(".thumbNumbers").click(function(){$("#comm-pager").empty();CommentsPager.current=
+$(this).html();CommentsController.offset=(CommentsPager.current-1)*CommentsController.limit;CommentsController.init(CommentsPager.all);return false});this.show()},show:function(){CommentsPager.all>1&&$("#comm-pager").show()},hide:function(){$("#comm-pager").hide()}},Playlist={bind:function(){$(document).bind("playlist-item-removed",function(a,b){Playlist.removeItem(b)});$(document).bind("playlist-item-added",function(a,b){Playlist.addToMyPlaylist(b)})},fetch:function(){$.ajax({url:"/playlist/",dataType:"json",
success:function(a){Playlist.render(holder,a)}})},render:function(a,b){for(var c=b.length,d=false,e=0;e<c;e++){if($.browser.msie){b[e].path=b[e].http_path;d=true}a.append('<div class="col"><a href="/'+b[e].title_processed+'" tooltip="'+b[e].tooltip+'" class="thumb"><img src="'+(d?"":"data:image/jpeg;base64,")+b[e].path+'" style="width: 70px;" /><div class="round-img"></div></a><a href="#" class="removeItem sprite" id="rfmp-'+b[e].inf_id+'" title="Remove From My Playlist"></a><div class="content"><h1><a href="/'+
b[e].title_processed+'">'+b[e].title+"</a></h1><h2>"+b[e].date_processed+"</h2><p>"+b[e].description+"</p></div></div>")}$(".removeItem").click(this.removeItem)},removeItem:function(a){for(var b=$.cookie("myPlaylist").split(":"),c="",d=0;d<b.length;d++)if(a!=b[d])c+=":"+b[d];c.substring(1)==""?$.cookie("myPlaylist",null,{path:"/",expires:0}):$.cookie("myPlaylist",c.substring(1),{path:"/",expires:0});$(this).parent().fadeOut(1E3);$("#my-playlist").length>0&&$("#my-playlist span").html("("+Playlist.countMyPlaylist()+
")");$("#myplaylistTab").length>0&&$("#myplaylistTab span").html("("+Playlist.countMyPlaylist()+")");return false},addToMyPlaylist:function(a){var b=$.cookie("myPlaylist");if(null!=$.cookie("myPlaylist")){var c=b.split(":");if(-1!=$.inArray(a,c))return true}if(b=="null")b=a;else if(b=="")b=a;else b+=":"+a;$.cookie("myPlaylist",b,{path:"/",expires:365});$("#my-playlist").length>0&&$("#my-playlist span").html("("+Playlist.countMyPlaylist()+")");$("#myplaylistTab").length>0&&$("#myplaylistTab span").html("("+
Playlist.countMyPlaylist()+")");return false},addItemToMyPlaylist:function(a){var b=$.cookie("myPlaylist");if(null!=$.cookie("myPlaylist")){var c=b.split(":");if(-1!=$.inArray(a,c))return true}if(b=="null")b=a;else if(b=="")b=a;else b+=":"+a;$.cookie("myPlaylist",b,{path:"/",expires:365})},loadMyPlaylist:function(){$(".tabs ul li").removeClass("active");$("#myplaylistTab").parent().addClass("active");$.ajax({type:"GET",dataType:"text",url:config.application+"MaterialController/myPlaylist.php",success:function(){}})},
clearMyPlaylist:function(){$("#myplaylistTab").removeClass("highlight");$("#myplaylistTab span").html("(0)");$.cookie("myPlaylist",null,{path:"/",expires:365});Playlist.loadMyPlaylist();return false},countMyPlaylist:function(){if($.cookie("myPlaylist")==null)return 0;for(var a=$.cookie("myPlaylist").split(":"),b=0,c=0;c<a.length;c++)a[c]!="null"&&b++;return b}},myPlaylistContainer={plItemCount:0,controllers:{show:function(a){myPlaylistContainer.models.getMyPlaylistItemsCount();a?myPlaylistContainer.views.error():
myPlaylistContainer.views.show()}},views:{show:function(){myPlaylistContainer.plItemCount?$("#my-playlist").addClass("not-empty-playlist"):$("#my-playlist").removeClass("not-empty-playlist");$("#my-playlist").html("My Playlist <span>("+myPlaylistContainer.plItemCount+")</span>")},error:function(){var a=$("#mp-container").html();$("#mp-container").html("This material exists in your playlist!").fadeOut(3E3,function(){$("#mp-container").html(a).fadeIn(1E3)})}},models:{getMyPlaylistItemsCount:function(){if($.cookie("myPlaylist")==
null)myPlaylistContainer.plItemCount=0;else{var a=$.cookie("myPlaylist").split(":");for(var b=myPlaylistContainer.plItemCount=0;b<a.length;b++)a[b]!="null"&&myPlaylistContainer.plItemCount++}},getFirstPlaylistItem:function(){if($.cookie("myPlaylist")!="null"){var a=$.cookie("myPlaylist").split(":");return a[a.length-1]}else return 0}},run:function(){$("#mp-container").click(function(){location.href="/"+myPlaylistContainer.models.getFirstPlaylistItem()})}},Related={};
(function(){var a={materialId:0,bind:function(b){a.materialId=b;a._getRelated();$("#related").click(a._getRelated);$("#more-from").click(a._getMoreFrom);$("#selected").click(a._getSelected);$("#my-playlist").click(a._getMyPlaylist);$(document).bind("reload-thumbs",function(){Thumbnail.fetchThumbnails(oQueryString)})},_getRelated:function(){if($(this).parent().length>0){$(".bottom-bar ul li").removeClass("active");$(this).parent().addClass("active")}$.ajax({url:"/information/related/id/"+a.materialId,
success:function(b){if($("#thumbs").html()!=""){$("#thumbs").parent().remove();$(".bottom-bar").append('<div id="thumbs"></div>')}$("#thumbs").html(b+'<br class="clear" /><br class="clear" /><br class="clear" /><br class="clear" />');$("#thumbs").jScrollPane();a._bindAddToMyPlaylist();typeof Mouse!="undefined"&&Mouse.disableWheel("thumbs")}})},_getMoreFrom:function(){$(".bottom-bar ul li").removeClass("active");$(this).parent().addClass("active");$("#thumbs").html("Loading ...");$.ajax({url:"/indexZend.php/material/user-list/username/"+
$("#more-from span b").html()+"/page/1/",success:function(b){$("#thumbs").parent().remove();$(".bottom-bar").append('<div id="thumbs"></div>');$("#thumbs").html(b+'<br class="clear" /><br class="clear" /><br class="clear" /><br class="clear" />');$("#thumbs").jScrollPane();a._bindAddToMyPlaylist();typeof Mouse!="undefined"&&Mouse.disableWheel("thumbs")}})},_getSelected:function(){$(".bottom-bar ul li").removeClass("active");$(this).parent().addClass("active");$("#thumbs").html("Loading ...");var b=
BaseController.getQueryString();$.ajax({url:"/information/list/category/"+b.category+"/keywords/"+b.keywords+"/state/"+b.state+"/FD/"+b.fd+"/TD/"+b.td+"/limit/10/dataType/html/",success:function(c){$("#thumbs").parent().remove();$(".bottom-bar").append('<div id="thumbs"></div>');$("#thumbs").html(c+'<br class="clear" /><br class="clear" /><br class="clear" /><br class="clear" />');$("#thumbs").jScrollPane();a._bindAddToMyPlaylist();typeof Mouse!="undefined"&&Mouse.disableWheel("thumbs");return false}})},
_getMyPlaylist:function(){$(".bottom-bar ul li").removeClass("active");$(this).parent().addClass("active");$("#thumbs").html("Loading ...");$.ajax({dataType:"json",url:"/playlist/",success:function(b){b=b.results;$("#thumbs").parent().remove();$(".bottom-bar").append('<div id="thumbs"></div>');for(var c=0;c<b.length;c++)$("#thumbs").append('<div class="col-inner"><a href="'+b[c].title_processed+'" id="matid-'+b[c].inf_id+'" tooltip="'+b[c].tooltip+'" style="background:url('+b[c].http_path+')" class="thumb"><div class="round-img sprite"></div></a><a href="#" class="removeItem sprite" id="atmp-'+
b[c].inf_id+'" title="Remove From My Playlist" style="margin-left:-26px;"></a><div class="content"><h1><a href="'+b[c].title_processed+'">'+b[c].title+"</a></h1><h3>"+b[c].date_processed+"</h3><p>"+b[c].description+"</p></div></div>");$("#thumbs").jScrollPane();a._bindToRemove();typeof Mouse!="undefined"&&Mouse.disableWheel("thumbs");return false}})},_bindAddToMyPlaylist:function(){$(".addItem").click(function(){var b=$(this).attr("id").substr(6);Playlist.addItemToMyPlaylist(b);$(this).addClass("addItemVisited");
$("#msg-inner-added").show();$("#msg-inner-added").fadeOut(3E3);b=$("#my-playlist > span").html().replace(/\(/g,"").replace(/\)/g,"");b=parseInt(b);b++;$("#my-playlist > span").html("("+b+")");return false})},_bindToRemove:function(){$(".removeItem").click(function(){var b=$(this).attr("id").substr(5);$(this).parent().fadeOut(1E3);console.log("fadeOut");$(document).trigger("playlist-item-removed",[b]);console.log("playlist-item-removed");return false})}};window.Related.bind=a.bind})();
var Flag={bind:function(){$("#flag-as").click(this.showPanel);$("#close-flagas-panel").click(this.hidePanel);$("#flagas-inappropriate").click(this.flagAsInappropriate)},showPanel:function(){$("#flagas-body").show();return false},hidePanel:function(){$("#flagas-body").hide();return false},flagAsInappropriate:function(){$.ajax({url:"/information/flag-inappropriate/id/"+BaseController.getMaterialId(),success:function(){$("#flagas-inappropriate").hide();$("#flaged").show()}});return false}},Favorites=
{bind:function(){$(".add-to-favorites").click(Favorites.addToFavorites)},addToFavorites:function(){$.ajax({type:"GET",dataType:"text",url:"/favorites/add/id/"+BaseController.getMaterialId(),success:function(a){+a==-3&&$(".add-to-favorites").fadeOut("4000",function(){$(".add-to-favorites").parent().append('<span style="float:left;">This material is in your favourites!</span>');$(".add-to-favorites").parent().children(":last-child").fadeOut(4E3,function(){$(".add-to-favorites").fadeIn(1E3)})});+a==
-2&&$(".add-to-favorites").fadeOut("4000",function(){$(".add-to-favorites").parent().append('<span style="float:left;">Invalid material!</span>');$(".add-to-favorites").parent().children(":last-child").fadeOut(4E3,function(){$(".add-to-favorites").fadeIn(1E3)})});+a==-1&&$(".add-to-favorites").fadeOut("4000",function(){$(".add-to-favorites").parent().append('<span style="float:left;">You must log in!</span>');$(".add-to-favorites").parent().children(":last-child").fadeOut(4E3,function(){$(".add-to-favorites").fadeIn(1E3)})});
if(+a==1){+a==-2&&$(".add-to-favorites").fadeOut("2000",function(){$(".add-to-favorites").parent().append('<span style="float:left;">This material is added to your favourites!</span>');$(".add-to-favorites").parent().children(":last-child").fadeOut(4E3,function(){$(".add-to-favorites").fadeIn(1E3)})});$(".add-to-favorites").css("background-position","-34px -594px")}},error:function(){}});return false}},MediaInfoController={materialContent:"",ratio:"",init:function(){$(".edit").click(MediaInfoController.showEditForm);
$(".delete").click(MediaInfoController.promptToDelete);$(".subscribe").click(MediaInfoController.subscribeFor)},subscribeFor:function(){if(config.loggedIn)$.ajax({type:"GET",url:"indexZend.php/subscription/new/feeder/"+$(this).attr("id").substr(5)+"/subscriberid/"+config.user_id+"/datatype/json/",dataType:"json",success:function(b){var c=$(".subscribe").html();$(".subscribe").html(b.message).fadeOut(3E3,function(){$(".subscribe").html(c).show()})}});else{var a=$(".subscribe").html();$(".subscribe").html("You must be logged in!").fadeOut(3E3,
function(){$(".subscribe").html(a).show()})}return false},showEditForm:function(){console.log("MediaInfoController->showEditForm()");location.href="/upload.php?editID="+BaseController.getMaterialId();return false},promptToDelete:function(){$("#promptToDelete").show();$("#yes").click(MediaInfoController.deleteMaterial);$("#no").click(function(){$("#promptToDelete").hide()})},deleteMaterial:function(){BaseController.getMaterialId()&&$.ajax({url:"/information/delete/id/"+BaseController.getMaterialId(),
success:function(){location.reload()}})},updateRating:function(){var a=$(this).attr("id").substr(5),b="vote_"+queryString.id;if(null==$.cookie(b)){$.ajax({type:"GET",url:config.application+"MediaInfoController/rating.php",data:{action:"vote",infid:queryString.id,rating:a,cookie:b},dataType:"text",success:function(d){parseInt(d)==0?$.cookie(b,a,{path:"/",expires:365}):parseInt(d)}});for(var c=1;c<=a;c++)$("#rate-"+c).attr("src","images/star1.gif");MediaInfoController.ratio=$("#ratio").html();$("#ratio").html(config.lblVoteThanks)}else $("#ratio").html(config.lblRatedMaterial);
setTimeout("MediaInfoController.fadeOutRatio()",2E3)},fadeOutRatio:function(){$("#ratio").fadeOut("slow",function(){$("#ratio").load(config.application+"MediaInfoController/rating.php",{action:"show",infid:queryString.id},function(){}).show()})}},FlagCommentAs={bind:function(){$(".anonymflagcom").click(FlagCommentAs.anonymousflagAs);$(".flagcom").click(FlagCommentAs.flagAs)},flagAs:function(){var a=$(this).attr("id").substr(7);if(a)if($.cookie("flaged_"+a))$("#flagError-"+a).html(config.lblYouFlagged).fadeIn(1E3,
function(){setTimeout("CommentsController.fadeFlagError()",2E3)});else{$.ajax({type:"GET",url:config.application+"CommentsController/flag.php",data:{id:a},dataType:"text",success:function(){$("#flagError-"+a).html(config.lblFlaggedComment).fadeIn(1E3,function(){setTimeout("CommentsController.fadeFlagError()",2E3)});$.cookie("flaged_"+a,a)}});$(this).addClass("inapp").html(config.lblInappropriate)}},anonymousflagAs:function(){var a=$(this).attr("id").substr(7);if(a)if($.cookie("flaged_"+a))$("#flagError-"+
a).html(config.lblYouFlagged).fadeIn(1E3,function(){setTimeout("CommentsController.fadeFlagError()",2E3)});else{$.ajax({type:"GET",url:config.application+"CommentsController/flagComment.php",data:{commentID:a},dataType:"text",success:function(){$("#flagError-"+a).html(config.lblFlaggedComment).fadeIn(1E3,function(){setTimeout("CommentsController.fadeFlagError()",2E3)});$.cookie("flaged_"+a,a)}});$(this).addClass("inapp").html(config.lblInappropriate)}},fadeFlagError:function(){$(".flagErrors").fadeOut(1E3)}},
Subscribe={};
(function(a){var b={_userId:-1,bind:function(c){if(typeof c!="undefined"&&c!=null)b._userId=c;$("input.subscribeBtn").click(b._subscribeFor)},_subscribeFor:function(){if(b._userId!=-1)$.ajax({url:"/indexZend.php/subscription/new/feeder/"+$(this).attr("id").substr(5)+"/subscriberid/"+b._userId+"/datatype/json/",dataType:"json",success:function(c){$(".subscribeBtn").val();$(".subscribeBtn").fadeOut(1E3,function(){$(".subscribeBtn").parent().append('<span id="subscr-msg">'+c.message+"</span>")})}});else{$(".subscribeBtn").val();
$(".subscribeBtn").fadeOut(1E3,function(){$(".subscribeBtn").parent().append(' <span id="subscr-msg">You must log in!</span>');location.href="/login"})}return false}};a.bind=b.bind})(window.Subscribe);var Swf={getSwf:function(a){return navigator.appName.indexOf("Microsoft")!=-1?window[a+"ie"]:document[a+"ff"]}},Player={};
(function(a){var b={setVolume:function(c){c=parseInt(c*10);$.cookie("volume",c,{path:"/",expires:365})},setScale:function(c){$.cookie("scale",c,{path:"/",expires:365})},getRelated:function(){var c=BaseController.getMaterialId();+c<=0||$.ajax({dataType:"json",url:"/information/related/id/"+c+"/limit/3/dataType/json/",success:function(d){Swf.getSwf("player").sendRelated(d)}})},onFinishPlaying:function(){$(document).trigger("player-video-finieshed")}};a.setVolume=b.setVolume;a.setScale=b.setScale;a.getRelated=
b.getRelated;a.onFinishPlaying=b.onFinishPlaying})(window.Player);
var Search={_map:null,_infobox:null,_thumbnail:null,_timeline:null,_term:"",_submitEnabled:false,bind:function(){$(document).bind("search-cleared",function(){Search.clearSearch()});$(".searchSubmit").unbind().click(Search.performSearch);$("input.search").click(function(){if($(this).css("color")!="#000"){Search._term=$(this).val();$(this).val("");$(this).css({color:"#000"})}});$("input.search").blur(function(){$(this).val()==""&&$(this).css({color:"#ccc"}).val(Search._term)});$("input.search").keypress(function(a){if(a.which==
13){Search.performSearch();return false}});$(".clickToSearch").click(function(){document.frmSearch.submit()});$("span.clickToSearch").keypress(function(a){a.which==13&&document.frmSearch.submit()})},enableSubmition:function(a){if(typeof a!="undefined")this._submitEnabled=a},performSearch:function(){$("div.select").addClass("search-clear");$(".searchSubmit").unbind().click(function(){$(document).trigger("search-cleared")});var a=$("input.search").val();if(typeof a!=="undefined"){BaseController.setQueryString({keywords:a.replace(/ /g,
"+"),category:0,fd:"1895-03-22",td:"2100-12-31"});if(Search._submitEnabled){location.href="/#/keywords="+a+"/";return false}$(document).trigger("search-changed");BaseController.rewriteUrl();return false}$("#searchHolder").css({background:"transparent url(../images/master.png) no-repeat scroll right -384px"});return false},clearSearch:function(){$("input.search").css({color:"#ccc"}).html(Search._term);if(BaseController.getQueryString().keywords!="")BaseController.setQueryString({keywords:""});else return false;
BaseController.rewriteUrl();$("div.select").removeClass("search-clear");$(".searchSubmit").unbind().click(Search.performSearch);return false}};
