/*

 Copyright (c) 2011-2012, AcademSoft
 All rights reserved.

 Copyright (c) 2007-2008, Google
 All rights reserved.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.


 Navitel.Dom.Draggable based on L.Draggable class of Leaflet library

 Copyright (c) 2010-2011, CloudMade, Vladimir Agafonkin
 All rights reserved.

 Redistribution and use in source and binary forms, with or without modification, are
 permitted provided that the following conditions are met:

 1. Redistributions of source code must retain the above copyright notice, this list of
 conditions and the following disclaimer.

 2. Redistributions in binary form must reproduce the above copyright notice, this list
 of conditions and the following disclaimer in the documentation and/or other materials
 provided with the distribution.

 Copyright (c) 2011 John Resig, http://jquery.com/
*/
var Navitel=function(){var b={};b.inherits=function(a,c){var e=function(){};e.prototype=c.prototype;a.prototype=new e;a.prototype.constructor=a;a._superClass=c.prototype;for(var e=2,g=arguments.length;e<g;e++){var h=arguments[e];if(typeof h=="function")h=h.prototype;b.extend(a.prototype,h)}};b.extend=function(a){for(var a=a||{},b=1,e=arguments.length;b<e;b++){var c=arguments[b]||{},h;for(h in c)c.hasOwnProperty(h)&&(a[h]=c[h])}return a};b.extendClass=function(a,c){b.extend(a.prototype,c)};b.Class=
function(){var a=arguments.length,c=arguments[0],e=arguments[a-1],g=e.initialize||function(){};a>1&&!e.initialize&&(g=function(){c&&c.apply(this,arguments)});a>1?(a=[g].concat([].slice.call(arguments,0,a-1),e),b.inherits.apply(null,a)):g.prototype=e;return g};b._uidCounter=1;b._registry={};b.hasUid=function(a){return"_NAVI_UID"in a};b.getUid=function(a,c){var e=a._NAVI_UID?a._NAVI_UID:a._NAVI_UID=b._uidCounter++;c&&(b._registry[e]=a);return e};b.getByUid=function(a){return b._registry[a]};b.delUid=
function(a){var c=a._NAVI_UID;c in b._registry&&delete b._registry[c];delete a._NAVI_UID};b.now=function(){return+new Date};b.instanceOf=function(a,b){if(!b)return!1;return a instanceof b};b._writeScriptTag=function(a){document.write('<script type="text/javascript" src="'+a+'"><\/script>')};b._appendScriptNode=function(a){var b=document.createElement("script");b.setAttribute("type","text/javascript");b.src=a;(document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body).appendChild(b)};
b.importScript=function(a){var c=navigator.userAgent;c.match("MSIE")||c.match("Safari")?b._writeScriptTag(a):b._appendScriptNode(a)};b.setdefault=function(a,b,e){typeof e=="undefined"&&(e={});a[b]||(a[b]=e);return a[b]};if(!Array.prototype.every)Array.prototype.every=function(a,b){if(this===void 0||this===null)throw new TypeError;var e=Object(this),c=e.length>>>0;if(typeof a!=="function")throw new TypeError;for(var h=0;h<c;h++)if(h in e&&!a.call(b,e[h],h,e))return!1;return!0};if(!Array.prototype.filter)Array.prototype.filter=
function(a,b){if(this===void 0||this===null)throw new TypeError;var e=Object(this),c=e.length>>>0;if(typeof a!=="function")throw new TypeError;for(var h=[],i=0;i<c;i++)if(i in e){var k=e[i];a.call(b,k,i,e)&&h.push(k)}return h};if(!Array.prototype.forEach)Array.prototype.forEach=function(a,b){if(this===void 0||this===null)throw new TypeError;var e=Object(this),c=e.length>>>0;if(typeof a!=="function")throw new TypeError;for(var h=0;h<c;h++)h in e&&a.call(b,e[h],h,e)};if(!Array.prototype.indexOf)Array.prototype.indexOf=
function(a){if(this===void 0||this===null)throw new TypeError;var b=Object(this),e=b.length>>>0;if(e===0)return-1;var c=0;arguments.length>0&&(c=Number(arguments[1]),c!==c?c=0:c!==0&&c!==Infinity&&c!==-Infinity&&(c=(c>0||-1)*Math.floor(Math.abs(c))));if(c>=e)return-1;for(c=c>=0?c:Math.max(e-Math.abs(c),0);c<e;c++)if(c in b&&b[c]===a)return c;return-1};Array.isArray=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"};if(!Array.prototype.lastIndexOf)Array.prototype.lastIndexOf=
function(a){if(this===void 0||this===null)throw new TypeError;var b=Object(this),e=b.length>>>0;if(e===0)return-1;var c=e;arguments.length>1&&(c=Number(arguments[1]),c!==c?c=0:c!==0&&c!==Infinity&&c!==-Infinity&&(c=(c>0||-1)*Math.floor(Math.abs(c))));for(e=c>=0?Math.min(c,e-1):e-Math.abs(c);e>=0;e--)if(e in b&&b[e]===a)return e;return-1};if(!Array.prototype.map)Array.prototype.map=function(a,b){if(this===void 0||this===null)throw new TypeError;var e=Object(this),c=e.length>>>0;if(typeof a!=="function")throw new TypeError;
for(var h=Array(c),i=0;i<c;i++)i in e&&(h[i]=a.call(b,e[i],i,e));return h};if(!Array.prototype.reduce)Array.prototype.reduce=function(a){if(this===void 0||this===null)throw new TypeError;var b=Object(this),e=b.length>>>0;if(typeof a!=="function")throw new TypeError;if(e==0&&arguments.length==1)throw new TypeError;var c=0,h;if(arguments.length>=2)h=arguments[1];else{do{if(c in b){h=b[c++];break}if(++c>=e)throw new TypeError;}while(1)}for(;c<e;)c in b&&(h=a.call(void 0,h,b[c],c,b)),c++;return h};if(!Array.prototype.reduceRight)Array.prototype.reduceRight=
function(a){if(this===void 0||this===null)throw new TypeError;var b=Object(this),e=b.length>>>0;if(typeof a!=="function")throw new TypeError;if(e===0&&arguments.length===1)throw new TypeError;e-=1;var c;if(arguments.length>=2)c=arguments[1];else{do{if(e in this){c=this[e--];break}if(--e<0)throw new TypeError;}while(1)}for(;e>=0;)e in b&&(c=a.call(void 0,c,b[e],e,b)),e--;return c};if(!Array.prototype.some)Array.prototype.some=function(a,b){if(this===void 0||this===null)throw new TypeError;var e=Object(this),
c=e.length>>>0;if(typeof a!=="function")throw new TypeError;for(var h=0;h<c;h++)if(h in e&&a.call(b,e[h],h,e))return!0;return!1};if(!Date.now)Date.now=function(){return+new Date};if(!Date.prototype.toJSON)Date.prototype.toJSON=Date.prototype.toJSON;if(!Date.prototype.toISOString)Date.prototype.toISOString=function(){var a=function(b,e){e=e||2;return(b+="",b.length===e)?b:a("0"+b,e)};return function(){var b=[this.getUTCFullYear(),a(this.getUTCMonth()+1),a(this.getUTCDate())].join("-"),e=[a(this.getUTCHours()),
a(this.getUTCMinutes()),a(this.getUTCSeconds())].join(":")+"."+a(this.getUTCMilliseconds(),3);return[b,e].join("T")+"Z"}}();if(!Function.prototype.bind)Function.prototype.bind=function(a){var b=[].slice,e=b.call(arguments,1),c=this,h=function(){},i=function(){return c.apply(this instanceof h?this:a||{},e.concat(b.call(arguments)))};h.prototype=c.prototype;i.prototype=new h;return i};if(!Object.keys)Object.keys=function(a){if(a!==Object(a))throw new TypeError("Object.keys called on non-object");var b=
[],e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&b.push(e);return b};if(!String.prototype.trim)String.prototype.trim=function(){var a=/^\s+/,b=/\s+$/;return function(){return this.replace(a,"").replace(b,"")}}();var a;a||(a={});(function(){function d(a){return a<10?"0"+a:a}function b(a){h.lastIndex=0;return h.test(a)?'"'+a.replace(h,function(a){var e=j[a];return typeof e==="string"?e:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function e(a,d){var c,g,h,j,q=i,r,
u=d[a];u&&typeof u==="object"&&typeof u.toJSON==="function"&&(u=u.toJSON(a));typeof l==="function"&&(u=l.call(d,a,u));switch(typeof u){case "string":return b(u);case "number":return isFinite(u)?String(u):"null";case "boolean":case "null":return String(u);case "object":if(!u)return"null";i+=k;r=[];if(Object.prototype.toString.apply(u)==="[object Array]"){j=u.length;for(c=0;c<j;c+=1)r[c]=e(c,u)||"null";h=r.length===0?"[]":i?"[\n"+i+r.join(",\n"+i)+"\n"+q+"]":"["+r.join(",")+"]";i=q;return h}if(l&&typeof l===
"object"){j=l.length;for(c=0;c<j;c+=1)typeof l[c]==="string"&&(g=l[c],(h=e(g,u))&&r.push(b(g)+(i?": ":":")+h))}else for(g in u)Object.prototype.hasOwnProperty.call(u,g)&&(h=e(g,u))&&r.push(b(g)+(i?": ":":")+h);h=r.length===0?"{}":i?"{\n"+i+r.join(",\n"+i)+"\n"+q+"}":"{"+r.join(",")+"}";i=q;return h}}if(typeof Date.prototype.toJSON!=="function")Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+d(this.getUTCMonth()+1)+"-"+d(this.getUTCDate())+"T"+d(this.getUTCHours())+
":"+d(this.getUTCMinutes())+":"+d(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()};var c=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i,k,j={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},
l;if(typeof a.stringify!=="function")a.stringify=function(a,d,b){var c;k=i="";if(typeof b==="number")for(c=0;c<b;c+=1)k+=" ";else typeof b==="string"&&(k=b);if((l=d)&&typeof d!=="function"&&(typeof d!=="object"||typeof d.length!=="number"))throw Error("JSON.stringify");return e("",{"":a})};if(typeof a.parse!=="function")a.parse=function(a,e){function d(a,b){var c,f,g=a[b];if(g&&typeof g==="object")for(c in g)Object.prototype.hasOwnProperty.call(g,c)&&(f=d(g,c),f!==void 0?g[c]=f:delete g[c]);return e.call(a,
b,g)}var b,a=String(a);c.lastIndex=0;c.test(a)&&(a=a.replace(c,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return b=eval("("+a+")"),typeof e==="function"?d({"":b},""):b;throw new SyntaxError("JSON.parse");}})();(function(){function a(e,d,b,c,f,g){for(var f=0,h=c.length;f<h;f++){var i=
c[f];if(i){for(var k=!1,i=i[e];i;){if(i.sizcache===b){k=c[i.sizset];break}if(i.nodeType===1&&!g)i.sizcache=b,i.sizset=f;if(i.nodeName.toLowerCase()===d){k=i;break}i=i[e]}c[f]=k}}}function c(a,e,d,b,f,g){for(var f=0,h=b.length;f<h;f++){var i=b[f];if(i){for(var k=!1,i=i[a];i;){if(i.sizcache===d){k=b[i.sizset];break}if(i.nodeType===1){if(!g)i.sizcache=d,i.sizset=f;if(typeof e!=="string"){if(i===e){k=!0;break}}else if(m.filter(e,[i]).length>0){k=i;break}}i=i[a]}b[f]=k}}}var e=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
g=0,h=Object.prototype.toString,i=!1,k=!0;[0,0].sort(function(){k=!1;return 0});var j=function(a){a!=null&&[].push.apply(this,a)};j.make=function(a){if(a==null)return new j;else if(!(a instanceof j))return new j(a);return a};j.prototype={constructor:j,length:0,push:[].push,slice:function(){return j.make([].slice.apply(this,arguments))},toArray:function(){return[].slice.call(this,0)},forEach:[].forEach,map:[].map,some:[].some,every:[].every,filter:[].filter,sort:[].sort,indexOf:[].indexOf,splice:[].splice};
var l=function(a){return h.call(a)=="[object Array]"||a instanceof j},m=function(a,d,b,c){var b=j.make(b),f=d=d||document;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!a||typeof a!=="string")return b;var g,h,i,k,p,t=!0,r=m.isXML(d),q=[],u=a;do if(e.exec(""),g=e.exec(u))if(u=g[3],q.push(g[1]),g[2]){k=g[3];break}while(g);if(q.length>1&&o.exec(a))if(q.length===2&&n.relative[q[0]])h=v(q[0]+q[1],d);else for(h=n.relative[q[0]]?[d]:m(q.shift(),d);q.length;)a=q.shift(),n.relative[a]&&(a+=q.shift()),h=v(a,
h);else if(!c&&q.length>1&&d.nodeType===9&&!r&&n.match.ID.test(q[0])&&!n.match.ID.test(q[q.length-1])&&(g=m.find(q.shift(),d,r),d=g.expr?m.filter(g.expr,g.set)[0]:g.set[0]),d){g=c?{expr:q.pop(),set:s(c)}:m.find(q.pop(),q.length===1&&(q[0]==="~"||q[0]==="+")&&d.parentNode?d.parentNode:d,r);h=g.expr?m.filter(g.expr,g.set):g.set;for(q.length>0?i=s(h):t=!1;q.length;)g=p=q.pop(),n.relative[p]?g=q.pop():p="",g==null&&(g=d),n.relative[p](i,g,r)}else i=[];i||(i=h);i||m.error(p||a);if(l(i))if(t)if(d&&d.nodeType===
1)for(a=0;i[a]!=null;a++)i[a]&&(i[a]===!0||i[a].nodeType===1&&m.contains(d,i[a]))&&b.push(h[a]);else for(a=0;i[a]!=null;a++)i[a]&&i[a].nodeType===1&&b.push(h[a]);else b.push.apply(b,i);else s(i,b);k&&(m(k,f,b,c),m.uniqueSort(b));return b};m.uniqueSort=function(a){if(r&&(i=k,a.sort(r),i))for(var e=1;e<a.length;e++)a[e]===a[e-1]&&a.splice(e--,1);return a};m.matches=function(a,e){return m(a,null,null,e)};m.matchesSelector=function(a,e){return m(e,null,null,[a]).length>0};m.find=function(a,e,d){var b;
if(!a)return[];for(var c=0,g=n.order.length;c<g;c++){var f,h=n.order[c];if(f=n.leftMatch[h].exec(a)){var i=f[1];f.splice(1,1);if(i.substr(i.length-1)!=="\\"&&(f[1]=(f[1]||"").replace(/\\/g,""),b=n.find[h](f,e,d),b!=null)){a=a.replace(n.match[h],"");break}}}b||(b=typeof e.getElementsByTagName!=="undefined"?e.getElementsByTagName("*"):[]);return{set:b,expr:a}};m.filter=function(a,e,d,b){for(var c,f,g=a,h=[],i=e,k=e&&e[0]&&m.isXML(e[0]);a&&e.length;){for(var j in n.filter)if((c=n.leftMatch[j].exec(a))!=
null&&c[2]){var l,o,p=n.filter[j];o=c[1];f=!1;c.splice(1,1);if(o.substr(o.length-1)!=="\\"){i===h&&(h=[]);if(n.preFilter[j])if(c=n.preFilter[j](c,i,d,h,b,k)){if(c===!0)continue}else f=l=!0;if(c)for(var q=0;(o=i[q])!=null;q++)if(o){l=p(o,c,q,i);var t=b^!!l;d&&l!=null?t?f=!0:i[q]=!1:t&&(h.push(o),f=!0)}if(l!==void 0){d||(i=h);a=a.replace(n.match[j],"");if(!f)return[];break}}}if(a===g)if(f==null)m.error(a);else break;g=a}return i};m.error=function(a){throw"Syntax error, unrecognized expression: "+a;
};var n=m.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|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")}},relative:{"+":function(a,e){var d=typeof e==="string",b=d&&!/\W/.test(e),d=d&&!b;b&&(e=e.toLowerCase());for(var b=0,c=a.length,f;b<c;b++)if(f=a[b]){for(;(f=f.previousSibling)&&f.nodeType!==1;);a[b]=d||f&&f.nodeName.toLowerCase()===e?f||!1:f===e}d&&m.filter(e,a,!0)},">":function(a,e){var d,b=typeof e===
"string",c=0,f=a.length;if(b&&!/\W/.test(e))for(e=e.toLowerCase();c<f;c++){if(d=a[c])d=d.parentNode,a[c]=d.nodeName.toLowerCase()===e?d:!1}else{for(;c<f;c++)(d=a[c])&&(a[c]=b?d.parentNode:d.parentNode===e);b&&m.filter(e,a,!0)}},"":function(e,b,h){var i,k=g++,j=c;typeof b==="string"&&!/\W/.test(b)&&(i=b=b.toLowerCase(),j=a);j("parentNode",b,k,e,i,h)},"~":function(e,b,h){var i,k=g++,j=c;typeof b==="string"&&!/\W/.test(b)&&(i=b=b.toLowerCase(),j=a);j("previousSibling",b,k,e,i,h)}},find:{ID:function(a,
e,d){if(typeof e.getElementById!=="undefined"&&!d)return(a=e.getElementById(a[1]))&&a.parentNode?[a]:[]},NAME:function(a,e){if(typeof e.getElementsByName!=="undefined"){for(var d=[],b=e.getElementsByName(a[1]),c=0,f=b.length;c<f;c++)b[c].getAttribute("name")===a[1]&&d.push(b[c]);return d.length===0?null:d}},TAG:function(a,e){if(typeof e.getElementsByTagName!=="undefined")return e.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,e,d,b,c,f){a=" "+a[1].replace(/\\/g,"")+" ";if(f)return a;for(var f=
0,g;(g=e[f])!=null;f++)g&&(c^(g.className&&(" "+g.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?d||b.push(g):d&&(e[f]=!1));return!1},ID:function(a){return a[1].replace(/\\/g,"")},TAG:function(a){return a[1].toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]);a[2]=a[2].replace(/^\+|\s*/g,"");var e=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=e[1]+(e[2]||1)-0;a[3]=e[3]-0}else a[2]&&m.error(a[0]);a[0]=
g++;return a},ATTR:function(a,e,d,b,c,f){e=a[1]=a[1].replace(/\\/g,"");!f&&n.attrMap[e]&&(a[1]=n.attrMap[e]);a[4]=(a[4]||a[5]||"").replace(/\\/g,"");a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(a,d,b,c,f){if(a[1]==="not")if((e.exec(a[3])||"").length>1||/^\w/.test(a[3]))a[3]=m(a[3],null,null,d);else return a=m.filter(a[3],d,b,1^f),b||c.push.apply(c,a),!1;else if(n.match.POS.test(a[0])||n.match.CHILD.test(a[0]))return!0;return a},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===
!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,e,d){return!!m(d[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.type},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},
password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,e){return e===0},last:function(a,e,d,b){return e===b.length-1},even:function(a,e){return e%2===0},odd:function(a,e){return e%2===1},lt:function(a,
e,d){return e<d[3]-0},gt:function(a,e,d){return e>d[3]-0},nth:function(a,e,d){return d[3]-0===e},eq:function(a,e,d){return d[3]-0===e}},filter:{PSEUDO:function(a,e,d,b){var c=e[1],f=n.filters[c];if(f)return f(a,d,e,b);else if(c==="contains")return(a.textContent||a.innerText||m.getText([a])||"").indexOf(e[3])>=0;else if(c==="not"){e=e[3];d=0;for(b=e.length;d<b;d++)if(e[d]===a)return!1;return!0}else m.error(c)},CHILD:function(a,e){var d=e[1],b=a;switch(d){case "only":case "first":for(;b=b.previousSibling;)if(b.nodeType===
1)return!1;if(d==="first")return!0;b=a;case "last":for(;b=b.nextSibling;)if(b.nodeType===1)return!1;return!0;case "nth":var d=e[2],c=e[3];if(d===1&&c===0)return!0;var f=e[0],g=a.parentNode;if(g&&(g.sizcache!==f||!a.nodeIndex)){for(var h=0,b=g.firstChild;b;b=b.nextSibling)if(b.nodeType===1)b.nodeIndex=++h;g.sizcache=f}b=a.nodeIndex-c;return d===0?b===0:b%d===0&&b/d>=0}},ID:function(a,e){return a.nodeType===1&&a.getAttribute("id")===e},TAG:function(a,e){return e==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===
e},CLASS:function(a,e){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(a,e){var d=e[1],d=n.attrHandle[d]?n.attrHandle[d](a):a[d]!=null?a[d]:a.getAttribute(d),b=d+"",c=e[2],f=e[4];return d==null?c==="!=":c==="="?b===f:c==="*="?b.indexOf(f)>=0:c==="~="?(" "+b+" ").indexOf(f)>=0:!f?b&&d!==!1:c==="!="?b!==f:c==="^="?b.indexOf(f)===0:c==="$="?b.substr(b.length-f.length)===f:c==="|="?b===f||b.substr(0,f.length+1)===f+"-":!1},POS:function(a,e,d,b){var c=n.setFilters[e[2]];
if(c)return c(a,d,e,b)}}},o=n.match.POS,p=function(a,e){return"\\"+(e-0+1)},t;for(t in n.match)n.match[t]=RegExp(n.match[t].source+/(?![^\[]*\])(?![^\(]*\))/.source),n.leftMatch[t]=RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[t].source.replace(/\\(\d+)/g,p));var s=function(a,e){e=j.make(e);a=Array.prototype.slice.call(a,0);e.push.apply(e,a);return e};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(q){s=function(a,e){var d=0,b=j.make(e);if(l(a))Array.prototype.push.apply(b,
a);else if(typeof a.length==="number")for(var c=a.length;d<c;d++)b.push(a[d]);else for(;a[d];d++)b.push(a[d]);return b}}var r,u;document.documentElement.compareDocumentPosition?r=function(a,e){if(a===e)return i=!0,0;if(!a.compareDocumentPosition||!e.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(e)&4?-1:1}:(r=function(a,e){var d,b,c=[],f=[];d=a.parentNode;b=e.parentNode;var g=d;if(a===e)return i=!0,0;else if(d===b)return u(a,e);else if(d){if(!b)return 1}else return-1;
for(;g;)c.unshift(g),g=g.parentNode;for(g=b;g;)f.unshift(g),g=g.parentNode;d=c.length;b=f.length;for(g=0;g<d&&g<b;g++)if(c[g]!==f[g])return u(c[g],f[g]);return g===d?u(a,f[g],-1):u(c[g],e,1)},u=function(a,e,d){if(a===e)return d;for(a=a.nextSibling;a;){if(a===e)return-1;a=a.nextSibling}return 1});m.getText=function(a){for(var e="",d,b=0;a[b];b++)d=a[b],d.nodeType===3||d.nodeType===4?e+=d.nodeValue:d.nodeType!==8&&(e+=m.getText(d.childNodes));return e};(function(){var a=document.createElement("div"),
e="script"+(new Date).getTime(),d=document.documentElement;a.innerHTML="<a name='"+e+"'/>";d.insertBefore(a,d.firstChild);if(document.getElementById(e))n.find.ID=function(a,e,d){if(typeof e.getElementById!=="undefined"&&!d)return(e=e.getElementById(a[1]))?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:void 0:[]},n.filter.ID=function(a,e){var d=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&d&&d.nodeValue===
e};d.removeChild(a);d=a=null})();(function(){var a=document.createElement("div");a.appendChild(document.createComment(""));if(a.getElementsByTagName("*").length>0)n.find.TAG=function(a,e){var d=e.getElementsByTagName(a[1]);if(a[1]==="*"){for(var b=[],c=0;d[c];c++)d[c].nodeType===1&&b.push(d[c]);d=b}return d};a.innerHTML="<a href='#'></a>";if(a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(a){return a.getAttribute("href",
2)};a=null})();document.querySelectorAll&&function(){var a=m,e=document.createElement("div");e.innerHTML="<p class='TEST'></p>";if(!(e.querySelectorAll&&e.querySelectorAll(".TEST").length===0)){m=function(e,d,b,c){d=d||document;if(!c&&!m.isXML(d)){var f=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(e);if(f&&(d.nodeType===1||d.nodeType===9))if(f[1])return s(d.getElementsByTagName(e),b);else if(f[2]&&n.find.CLASS&&d.getElementsByClassName)return s(d.getElementsByClassName(f[2]),b);if(d.nodeType===9){if(e===
"body"&&d.body)return s([d.body],b);else if(f&&f[3]){var g=d.getElementById(f[3]);if(g&&g.parentNode){if(g.id===f[3])return s([g],b)}else return s([],b)}try{return s(d.querySelectorAll(e),b)}catch(h){}}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var g=(f=d.getAttribute("id"))||"__sizzle__",i=d.parentNode,k=/^\s*[+~]/.test(e);f?g=g.replace(/'/g,"\\$&"):d.setAttribute("id",g);if(k&&i)d=d.parentNode;try{if(!k||i)return s(d.querySelectorAll("[id='"+g+"'] "+e),b)}catch(j){}finally{f||
d.removeAttribute("id")}}}return a(e,d,b,c)};for(var d in a)m[d]=a[d];e=null}}();(function(){var a=document.documentElement,e=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector,d=!1;try{e.call(document.documentElement,"[test!='']:sizzle")}catch(b){d=!0}if(e)m.matchesSelector=function(a,b){b=b.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(d||!n.match.PSEUDO.test(b)&&!/!=/.test(b))return e.call(a,b)}catch(c){}return m(b,null,null,[a]).length>0}})();
(function(){var a=document.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0&&(a.lastChild.className="e",a.getElementsByClassName("e").length!==1))n.order.splice(1,0,"CLASS"),n.find.CLASS=function(a,e,d){if(typeof e.getElementsByClassName!=="undefined"&&!d)return e.getElementsByClassName(a[1])},a=null})();m.contains=document.documentElement.contains?function(a,e){return a!==e&&(a.contains?a.contains(e):
!0)}:document.documentElement.compareDocumentPosition?function(a,e){return!!(a.compareDocumentPosition(e)&16)}:function(){return!1};m.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?a.nodeName!=="HTML":!1};var v=function(a,e){for(var d,b=[],c="",f=e.nodeType?[e]:e;d=n.match.PSEUDO.exec(a);)c+=d[0],a=a.replace(n.match.PSEUDO,"");a=n.relative[a]?a+"*":a;d=0;for(var g=f.length;d<g;d++)m(a,f[d],b);return m.filter(c,b)};b.Sizzle=m;b.SizzleNodeList=j})();b.Uri={getQueryArgs:function(a){var a=
a||window.location.search,b={};a.replace(/(\w+)=(.+?)(&|$)/g,function(a,d,c){b[d]=window.decodeURIComponent(c)});return b},encode:function(a){var b=[],e;for(e in a)b.push(e+"="+encodeURIComponent(a[e]));return b.join("&")},stripQuery:function(a){a=a||document.location.href;a.indexOf("?")!=-1&&(a=a.substring(0,a.indexOf("?")));return a},build:function(a,c){var e=b.Uri,c=e.stripQuery(c);c+="?"+e.encode(a);return c},append:function(a,b){var e="",e=a.indexOf("?")!=-1?"&":"?";return a+e+b}};b.Func={deferred:function(a,
b,e){if(!a.__deferred)a.__deferred=function(){a.__deferredTimer&&window.clearTimeout(a.__deferredTimer);var c=[].slice.call(arguments);a.__deferredTimer=window.setTimeout(function(){a.__deferredTimer=null;a.apply(b,c)},e)};return a.__deferred},each:function(a,b,e){if(a.forEach)a.forEach(b,e);else for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.call(e,a[c],c)},noop:function(){}};b.Json={parse:a.parse,stringify:a.stringify};b.Text={};b.Text.strargs=function(a,b){b instanceof Array||(b=[b]);
return a.replace(/%(\d+)/g,function(a,d){var c=parseInt(d);if(!isNaN(c)&&b.length>=c)return b[c-1];return""})};b.Text.escapeHtml=function(a){var b={"<":"&lt;",">":"&gt;","&":"&amp;"};return String(a).replace(/[><&]/g,function(a,d){if(d in b)return b[d];return""})};b.Text.repeat=function(a,b){return Array(b+1).join(a)};b.Text.padNumber=function(a,c){var e=String(a),g=c-e.length;if(g>0)return b.Text.repeat("0",g)+e;return e};b.Text.isAbsoluteUrl=function(a){return/^https?:\/\//.test(a)};b.Math={};b.Math._getxy=
function(){var a=arguments.callee.caller.arguments,b=typeof a[0]!="object";return[b?a[0]:a[0].x,b?a[1]:a[0].y]};b.Math.Point=function(a,b){this.set(a,b)};b.extendClass(b.Math.Point,{add:function(){var a=b.Math._getxy();this.x+=a[0];this.y+=a[1];return this},sub:function(){var a=b.Math._getxy();this.x-=a[0];this.y-=a[1];return this},set:function(){var a=b.Math._getxy();this.x=a[0]==null?null:Number(a[0]);this.y=a[1]==null?null:Number(a[1]);return this},multiply:function(a){this.x*=a;this.y*=a;return this},
clone:function(){return new b.Math.Point(this.x,this.y)},distanceTo:function(a){return b.Geo.dist(this,a)}});b.Math.Matrix2=function(a){this._m=a};b.extendClass(b.Math.Matrix2,{multiply:function(a){if(a instanceof b.Math.Point)return new b.Math.Point(this._m[0]*a.x+this._m[1]*a.y,this._m[2]*a.x+this._m[3]*a.y);else if(typeof a=="number")return this.clone().scaleBy(a);else throw Error("invalid value for multiplication for Matrix");},scaleBy:function(a){this._m=this._m.map(function(b){return b*a});
return this},clone:function(){return new b.Math.Matrix2(this._m.slice())}});b.Math.Matrix2.makeRotation=function(a){var c=Math.cos(a),a=Math.sin(a);return new b.Math.Matrix2(c,-a,a,c)};b.UserAgent={};(function(){var a=navigator.userAgent,b=/(opera)(?:.*version)?[ \/]([\w.]+)/,e=/(msie) ([\w.]+)/,c=/(mozilla)(?:.*? rv:([\w.]+))?/;this.OPERA=typeof opera!="undefined";this.MSIE=!this.OPERA&&a.indexOf("MSIE")!=-1;this.MOBILE=(this.WEBKIT=!this.OPERA&&a.indexOf("WebKit")!=-1)&&a.indexOf("Mobile")!=-1;
this.GECKO=!this.OPERA&&!this.WEBKIT&&navigator.product=="Gecko";var h=["Webkit","Moz","O","MS"],i=function(a,e){var e=e||document.createElement("div"),d=a.charAt(0).toUpperCase()+a.substr(1),b=h.map(function(a){return a+d}),c=null;if([a].concat(b).some(function(a){c=a;return e.style[a]!==void 0}))return c;return!1};this.TOUCH="ontouchstart"in document.documentElement;this.CSS_TRANSITIONS=i("transition");this.CSS_TRANSFORM=i("transform");i=a.toLowerCase();this.version=(/(webkit)[ \/]([\w.]+)/.exec(i)||
b.exec(i)||e.exec(i)||a.indexOf("compatible")<0&&c.exec(i)||[])[2]||"0"}).call(b.UserAgent);b.Cookie={set:function(a,b,e,c,h,i){document.cookie=a+"="+escape(b)+(e?"; expires="+e:"")+(c?"; path="+c:"")+(h?"; domain="+h:"")+(i?"; secure":"")},get:function(a){if(document.cookie.length>0){var b=document.cookie.indexOf(a+"=");if(b!=-1){b=b+a.length+1;a=document.cookie.indexOf(";",b);if(a==-1)a=document.cookie.length;return unescape(document.cookie.substring(b,a))}}return""},remove:function(a){b.Cookie.set(a,
"","Fri, 31 Dec 1999 23:59:59 GMT")}};b.Events={};b.Events.Event=function(a,b,e){this.type=a;this.canBubble=b==null?!0:b;this.cancelable=e==null?!0:e};b.Events.Event.prototype.stopPropagation=function(){this._stopped=!0};b.Events.Event.prototype.preventDefault=function(){if(this.cancelable)this._prevented=!0};b.Events.Event.prototype.canceled=function(){return!(!this._canceled&&!this._prevented)};b.EventTarget=function(){};b.EventTarget.prototype.addEventListener=function(a,b,e){var c=this._events_listeners=
this._events_listeners||{};c[a]=c[a]||[];c[a].push([b,e]);return this};b.EventTarget.prototype.listen=function(a,b,e){typeof a=="string"&&(a=[a]);a.forEach(function(a){this.addEventListener(a,b,e)},this)};b.EventTarget.prototype.on=function(a,b){for(var e in a)this.addEventListener(e,a[e],b)};b.EventTarget.prototype.un=function(a,b){for(var e in a)this.removeEventListener(e,a[e],b)};b.EventTarget.prototype.hasEventListeners=function(a){return"_events_listeners"in this&&a in this._events_listeners&&
this._events_listeners[a].length>0};b.EventTarget.prototype.removeEventListener=function(a,b,e){if(!this.hasEventListeners(a))return this;this._events_listeners[a]=this._events_listeners[a].filter(function(a){return!(a[0]==b&&a[1]==e)})};b.EventTarget.prototype.unlisten=function(a,b,e){typeof a=="string"&&(a=[a]);a.forEach(function(a){this.removeEventListener(a,b,e)},this)};b.EventTarget.prototype.getParentEventTarget=function(){return this._parentEventTarget};b.EventTarget.prototype.setParentEventTarget=
function(a){this._parentEventTarget=a};b.EventTarget.prototype.dispatchEvent=function(a,c){return b.Events.dispatchEvent(this,a,c)};b.EventTarget.prototype.fire=function(a,b){a=this.dispatchEvent(a,b);if(a.canceled)return!a.canceled()};b.EventTarget.destroy=function(){this._events_listeners=null};b.EventTarget.prototype._fireListeners=function(a,b){var e=!0,b=b||a.type;this.hasEventListeners(b)&&this._events_listeners[b].forEach(function(b){b[0].call(b[1],a)==!1&&(e=!1)},this);return e};b.Events.dispatchEvent=
function(a,c,e){var g=c.type||c;typeof c=="string"&&(c=e||{});if((e=!b.Events.isNativeEvent(c)&&!c._dontExtend)&&!c.canceled){var h=new b.Events.Event(g),i;for(i in h)c[i]=h[i]}if(e){i=[a];c.type=g;c.target=a;if(c.canBubble)for(;a=a.getParentEventTarget();)i.push(a);a=i.length;e=1;for(h=0;h<a&&!c._stopped;h++){var k=i[h];(c.currentTarget=k)&&k._fireListeners&&(e&=k._fireListeners(c,g))}c._canceled=c._prevented||!e}else a&&a._fireListeners&&a._fireListeners(c,g);return c};var c=function(){var a=function(){this.cancelBubble=
!0},c=function(){this.returnValue=!1};b.Events.stop=function(e){e.stopPropagation?e.stopPropagation():a.call(e)};b.Events.cancel=function(a){a.preventDefault?a.preventDefault():c.call(a)};var e=function(){return{x:this.clientX!==void 0?this.clientX:this.pageX,y:this.clientY!==void 0?this.clientY:this.pageY}};return function(b){if(!b.target)b.target=b.srcElement;b.getxy=e;if(!b.stopPropagation)b.stopPropagation=a;if(!b.preventDefault)b.preventDefault=c;return b}}();b.Events._handleBrowserEvent=function(a,
b){var e=c(a||window.event),g=this.context||e.target;try{return b.call(g,e)}catch(h){throw h;}};b.Events._getProxyHandler=function(a,c,e,g,h,i){var i=i==null?!1:i,k=["_NAVI_HANDLER",c,b.getUid(e),g?"on":"off",b.getUid(h||window),i?"o":"r"].join("_"),j=b.Dom.q,j=j(a);if(!j.data(k)){var l=function(e){l.once&&b.Events._removeListener(a,c,l,g);b.Events._handleBrowserEvent.call(l,e,l.handler)};l.context=h;l.handler=e;l.once=i;j.data(k,l)}return j.data(k)};b.Events._getSupportedEventType=function(a){switch(a){case "transitionend":if(b.UserAgent.OPERA)return"oTransitionEnd";
else if(b.UserAgent.WEBKIT)return"webkitTransitionEnd";else if(b.UserAgent.MSIE)return"MSTransitionEnd"}return a};b.Events._listen=function(a,c,e,g,h,i){c=this._getSupportedEventType(c);h=h||!1;e=this._getProxyHandler(a,c,e,h,g,i);b.Events._addListener(a,c,e,h)};b.Events._addListener=function(a,b,e,c){a.addEventListener?a.addEventListener(b,e,c):a.attachEvent("on"+b,e)};b.Events._removeListener=function(a,b,e,c){a.removeEventListener?a.removeEventListener(b,e,c):a.detachEvent("on"+b,e)};b.Events._unlisten=
function(a,c,e,g,h){c=this._getSupportedEventType(c);h=h||!1;e=this._getProxyHandler(a,c,e,h,g);b.Events._removeListener(a,c,e,h)};b.Events.listen=function(a,c,e,g,h,i){typeof c=="string"&&(c=[c]);c.forEach(function(c){b.Events._listen(a,c,e,g,h,i)})};b.Events.listenOnce=function(a,c,e,g,h){b.Events.listen(a,c,e,g,h,!0)};b.Events.unlisten=function(a,c,e,g,h){typeof c=="string"&&(c=[c]);c.forEach(function(c){b.Events._unlisten(a,c,e,g,h)})};b.Events.isNativeEvent=function(a){var b=!1;typeof a=="object"&&
(b=window.Event?a instanceof window.Event:"altKey"in a&&"cancelBubble"in a);return b};b.Io={};b.Io.script=function(a){var b,e=document.head||document.getElementsByTagName("head")[0]||document.documentElement;return{send:function(c){b=document.createElement("script");b.async="async";if(a.charset)b.charset=a.charset;b.src=a.url;b.onload=b.onreadystatechange=function(a,d){if(d||!b.readyState||/loaded|complete/.test(b.readyState))b.onload=b.onreadystatechange=null,e&&b.parentNode&&e.removeChild(b),b=
void 0,!d&&typeof c=="function"&&c(200,"success")};e.insertBefore(b,e.firstChild)},abort:function(){if(b)b.onload(0,1)}}};b.Geo={};b.Geo.dpSimplify=function(a,b,e,c){var h=-Infinity,i=null,k=b*b,j=a.length;e==null&&(e=0);c==null&&(c=j-1);for(j=e+1;j<c;j++){var l=this._sqPointToSegmentDist(a[j],a[e],a[c]);l>h&&(h=l,i=j)}return h>=k?(e=this.dpSimplify(a,b,e,i),a=this.dpSimplify(a,b,i,c),e.pop(),e.concat(a)):[e,c]};b.Geo.pointToSegmentDist=function(a,b,e){return Math.sqrt(this._sqPointToSegmentDist(a,
b,e))};b.Geo.dist=function(a,b){return Math.sqrt(this._sqDist(a,b))};b.Geo._sqDist=function(a,b){var e=b.x-a.x,c=b.y-a.y;return e*e+c*c};b.Geo._sqPointToSegmentDist=function(a,c,e){var g=e.x-c.x,h=e.y-c.y;if(!g&&!h)return this._sqDist(a,c);var i=((a.x-c.x)*g+(a.y-c.y)*h)/this._sqDist(c,e);if(i<0)return this._sqDist(a,c);if(i>1)return this._sqDist(a,e);c=new b.Math.Point(c.x+g*i,c.y+h*i);return this._sqDist(a,c)};b.Geo.LineArrows=function(a,b,e){this.target=a;this.layer=a.layer;this.map=this.layer.map;
this.overlay=this.layer;this.style=b;this.geom=e};b.extendClass(b.Geo.LineArrows,{distortion:15,clear:function(){if(this.features&&this.features.length)this.overlay.removeFeatures(this.features),this.features=null},render:function(){this.clear();var a=this.map.resolution*this.distortion,c=[];this.target.geometry.components.forEach(function(e){for(var e=e.components,g=b.Geo.dpSimplify(e,a),h=0,i=g.length;h<i-1;h++){for(var k=g[h+1],j=-Infinity,l=null,m=g[h];m<k;m++){var n=b.Geo._sqDist(e[m],e[m+1]);
n>j&&(j=n,l=m)}l!=null&&(k=this.renderArrow(e[l],e[l+1]))&&c.push(k)}},this);this.features=c;this.overlay.addFeatures(c)},renderArrow:function(a,c){var e=this.map.resolution,g=c.x-a.x,h=c.y-a.y,i=Math.sqrt(g*g+h*h),k=i/e,j=this.geom,l=j.arrowWidth,m=j.arrowHeight,j=j.tailWidth;if(k<j+l)return null;h/=i;g/=i;var n=new b.Math.Matrix2([g,-h,h,g]),g=[],k=new b.Math.Point(Math.max(0,(k-j-l)/2),0),g=[k.clone()];k.add(j,0);g.push(k.clone());k.add(0,-m);g.push(k.clone());k.add(l,m);g.push(k.clone());k.add(-l,
m);g.push(k.clone());k.add(0,-m);g.push(k.clone());g=g.map(function(b){b=n.multiply(b).multiply(e).add(a);return new OpenLayers.Geometry.Point(b.x,b.y)},this);l=new OpenLayers.Geometry.LinearRing(g);return new OpenLayers.Feature.Vector(l,null,this.style)}});b.i18n=function(a,b){this._base_ctx=a;this.install_lazy(a);b===void 0&&(b=a);this.install_translators(b)};b.inherits(b.i18n,b.EventTarget);b.extend(b.i18n,{_install_methods:["gettext","ngettext","dgettext","dngettext","pgettext","dpgettext","npgettext",
"dnpgettext"],localesMap:{ua:"uk_UA"},_translators:{},registerTr:function(a,b){this._translators[a]=b}});b.extendClass(b.i18n,{lang:null,_messages:{},supported_locales:[],isSupported:function(a){return this.supported_locales.indexOf(a)>=0},getLang:function(){return this.lang},setLang:function(a){this.lang=a},selectLang:function(a,c){if(!this.isSupported(a)){a in b.i18n.localesMap&&(a=b.i18n.localesMap[a]);if(!a||!/^\w+_?(\w+)?_?(\w+)?$/.test(a))(a=b.UserAgent.MSIE?navigator.userLanguage||navigator.language:
navigator.language)&&(a=a.replace("-","_"));if(a&&!this.isSupported(a)){for(var e=a.split("_"),g=e.length;--g;){var h=[].slice.call(e,0,g).join("_");if(this.isSupported(h))return h}return c}}return a||c},install_translators:function(a){var a=a||this,c=b.i18n._translators,e;for(e in c)a[e]=c[e].bind(this._base_ctx)},install_lazy:function(a){for(var a=a||this,c=b.i18n._install_methods,e=0,g=c.length;e<g;e++)(function(){var g=c[e];a[g+"_lazy"]=function(){var e=[].slice.call(arguments);return new b.i18n.LazyMsg(e,
g,a)}}).call(this)},install:function(a,c){c=c||this._base_ctx;this._gt=new b.i18n.Gettext({locale_data:a||{messages:{}}});for(var e=b.i18n._install_methods,g=this,h=0,i=e.length;h<i;h++)(function(){var a=e[h];c[a]=c[a+"_ne"]=function(){return g._gt[a].apply(g._gt,arguments)}}).call(this);c._=c.gettext;c.ngettextf=function(a,e,d){return b.Text.strargs(c.ngettext(a,e,d),d)};this.fire("ready")},installed:function(){return!!this._gt},getLocaleData:function(a){return this._messages[a]},ready:function(a,
b){this.installed()?a.call(b):this.addEventListener("ready",a,b)}});b.i18n.LazyMsg=function(a,b,e){this.args=a;this.funcname=b;this.scope=e};b.i18n.LazyMsg.prototype.toString=function(){return this.scope[this.funcname].apply(this.scope,this.args)};b.i18n.Gettext=function(a){this.domain="messages";this.locale_data=void 0;this._locale_data={};var b=["domain","locale_data"];if(this.isValidObject(a))for(var e in a)for(var c=0;c<b.length;c++)e==b[c]&&this.isValidObject(a[e])&&(this[e]=a[e]);this.try_load_lang();
return this};b.i18n.Gettext.context_glue="\u0004";b.i18n.Gettext.prototype.try_load_lang=function(){if(typeof this.locale_data!="undefined"){var a=this.locale_data;this.locale_data=void 0;this.parse_locale_data(a);if(typeof this._locale_data[this.domain]=="undefined")throw Error("Error: Gettext 'locale_data' does not contain the domain '"+this.domain+"'");}};b.i18n.Gettext.prototype.parse_locale_data=function(a){if(typeof this._locale_data=="undefined")this._locale_data={};for(var b in a)if(a.hasOwnProperty(b)&&
this.isValidObject(a[b])){var e=!1,c;for(c in a[b]){e=!0;break}var h=a[b];b==""&&(b="messages");this.isValidObject(this._locale_data[b])||(this._locale_data[b]={});if(!this.isValidObject(this._locale_data[b].head))this._locale_data[b].head={};if(!this.isValidObject(this._locale_data[b].msgs))this._locale_data[b].msgs={};if(e)for(var i in h)if(i==""){var e=h[i],k;for(k in e){var j=k.toLowerCase();this._locale_data[b].head[j]=e[k]}}else this._locale_data[b].msgs[i]=h[i]}for(b in this._locale_data)if(this.isValidObject(this._locale_data[b].head["plural-forms"])&&
typeof this._locale_data[b].head.plural_func=="undefined")if(a=this._locale_data[b].head["plural-forms"],/^(\s*nplurals\s*=\s*[0-9]+\s*;\s*plural\s*=\s*(?:\s|[-\?\|&=!<>+*\/%:;a-zA-Z0-9_()])+)/m.test(a))a=this._locale_data[b].head["plural-forms"],/;\s*$/.test(a)||(a=a.concat(";")),this._locale_data[b].head.plural_func=new Function("n","var plural; var nplurals; "+a+' return { "nplural" : nplurals, "plural" : (plural === true ? 1 : plural ? plural : 0) };');else throw Error("Syntax error in language file. Plural-Forms header is invalid ["+
a+"]");else if(typeof this._locale_data[b].head.plural_func=="undefined")this._locale_data[b].head.plural_func=function(a){return{nplural:2,plural:a!=1?1:0}}};b.i18n.Gettext.prototype.textdomain=function(a){if(a&&a.length)this.domain=a;return this.domain};b.i18n.Gettext.prototype.gettext=function(a){return this.dcnpgettext(null,void 0,a,void 0,void 0,void 0)};b.i18n.Gettext.prototype.dgettext=function(a,b){return this.dcnpgettext(a,void 0,b,void 0,void 0,void 0)};b.i18n.Gettext.prototype.dcgettext=
function(a,b,e){return this.dcnpgettext(a,void 0,b,void 0,void 0,e)};b.i18n.Gettext.prototype.ngettext=function(a,b,e){return this.dcnpgettext(null,void 0,a,b,e,void 0)};b.i18n.Gettext.prototype.dngettext=function(a,b,e,c){return this.dcnpgettext(a,void 0,b,e,c,void 0)};b.i18n.Gettext.prototype.dcngettext=function(a,b,e,c,h){return this.dcnpgettext(a,void 0,b,e,c,h,h)};b.i18n.Gettext.prototype.pgettext=function(a,b){return this.dcnpgettext(null,a,b,void 0,void 0,void 0)};b.i18n.Gettext.prototype.dpgettext=
function(a,b,e){return this.dcnpgettext(a,b,e,void 0,void 0,void 0)};b.i18n.Gettext.prototype.dcpgettext=function(a,b,e,c){return this.dcnpgettext(a,b,e,void 0,void 0,c)};b.i18n.Gettext.prototype.npgettext=function(a,b,e,c){return this.dcnpgettext(null,a,b,e,c,void 0)};b.i18n.Gettext.prototype.dnpgettext=function(a,b,e,c,h){return this.dcnpgettext(a,b,e,c,h,void 0)};b.i18n.Gettext.prototype.dcnpgettext=function(a,c,e,g,h){if(!this.isValidObject(e))return"";var i=this.isValidObject(g),c=this.isValidObject(c)?
c+b.i18n.Gettext.context_glue+e:e,k=this.isValidObject(a)?a:this.isValidObject(this.domain)?this.domain:"messages",a=[];if(typeof this._locale_data!="undefined"&&this.isValidObject(this._locale_data[k]))a.push(this._locale_data[k]);else if(typeof this._locale_data!="undefined")for(var j in this._locale_data)a.push(this._locale_data[j]);j=[];var k=!1,l;if(a.length)for(var m=0;m<a.length;m++){var n=a[m];if(this.isValidObject(n.msgs[c])){for(l=0;l<n.msgs[c].length;l++)j[l]=n.msgs[c][l];j.shift();l=n;
k=!0;if(j.length>0&&j[0].length!=0)break}}if(j.length==0||j[0].length==0)j=[e,g];e=j[0];if(i){if(k&&this.isValidObject(l.head.plural_func)){h=l.head.plural_func(h);if(!h.plural)h.plural=0;if(!h.nplural)h.nplural=0;if(h.nplural<=h.plural)h.plural=0;h=h.plural}else h=h!=1?1:0;this.isValidObject(j[h])&&(e=j[h])}return e};b.i18n.Gettext.prototype.isValidObject=function(a){return null==a?!1:"undefined"==typeof a?!1:!0};b.i18n.formatNumber=function(a){var a=String(a),b=a.length;return a.replace(/\d/g,function(a,
c){var d=b-c-1;if(d&&d%3==0)return a+",";return a})};b.i18n.registerTr("distance",function(a,c){var e=a/1E3;e>=(c||10)?(e=Math.round(e),a=-1):e=0;var g=[];e&&g.push(b.i18n.formatNumber(e)+this._("km."));a>=0&&g.push(b.i18n.formatNumber(a)+this._("m."));return g.join(" ")});b.Template=function(a){this._i18n=a;this.cache={};this._templates={};this._global_ctx={}};b.Template.IFDEF_EXPR="if(typeof $e != 'undefined') {";b.Template.tags={"if":{open:"if($e) {",close:"}"},"else":{_default:"true",open:"} else if($e) {"},
"=":{open:b.Template.IFDEF_EXPR+" $t.push(Navitel.Text.escapeHtml($e)); };"},html:{open:b.Template.IFDEF_EXPR+" $t.push($e); };"},gettext:{open:"$t.push( $i18n._($args) );"},ngettext:{open:"$t.push( $i18n.ngettext($args) );"},dgettext:{open:"$t.push( $i18n.dgettext($args) );"},dngettext:{open:"$t.push( $i18n.dngettext($args) );"},pgettext:{open:"$t.push( $i18n.pgettext($args) );"},npgettext:{open:"$t.push( $i18n.npgettext($args) );"},dpgettext:{open:"$t.push( $i18n.dpgettext($args) );"},dnpgettext:{open:"$t.push( $i18n.dnpgettext($args) );"},
tmpl:{_args:["obj"],open:"$t.push($nt.render($e, $args));"},each:{_args:["value","index"],open:"Navitel.Func.each($e, function($args) {",close:"});"}};b.extendClass(b.Template,{compile:function(a){var c=b.getUid(this._i18n,!0),a="var $t=[],$nt = Navitel.getByUid("+b.getUid(this,!0)+"),$i18n = Navitel.getByUid("+c+");with($nt._global_ctx){with(obj || window){$t.push('"+a.replace(/[\r\t\n]/g," ").replace(/\${([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?\w+)}\}/g,"{{$1 }}").replace(/\{\{(\/?)(\w+|.)(?:\((.*?)\))??\s+(.*?)\s*\}\}/g,
function(a,e,c,d,f){for(a=b.Template.tags[c];typeof a=="string";)a=b.Template.tags[a];if(!a)throw Error("Unknown template tag: "+c);c=f||a._default;!d&&a._args&&(d=a._args.join(","));return"');"+a[e?"close":"open"].split("$e").join(c).split("$args").join(d)+"$t.push('"})+"');} }return $t.join('');";try{return new Function("obj","$opts",a)}catch(e){if(e instanceof SyntaxError)throw Error("Template is invalid");}},updateContext:function(a){b.extend(this._global_ctx,a)},compileLazy:function(a,b){return this.cache[a]=
this.cache[a]||this.compile(b)},make:function(a){var b=this._templates[a]||document.getElementById(a);if(!b)throw Error("Template with id "+a+" not exists");return this.compileLazy(a,b.innerHTML||b)},render:function(a,b,e){return this.make(a)(b,e)}});b.Style={getComputedStyle:function(a,c){var e=b.Dom.getOwnerDocument(a);if(e.defaultView&&e.defaultView.getComputedStyle&&(e=e.defaultView.getComputedStyle(a,"")))return e[c];return null},getCascadedStyle:function(a,b){return a.currentStyle?a.currentStyle[b]:
null},getStyle:function(a,c){return b.Style.getComputedStyle(a,c)||b.Style.getCascadedStyle(a,c)||a.style[c]}};b.Dom={};b.Dom.getElement=function(a){if(typeof a=="string")return document.getElementById(a);return a};b.Dom.query=b.Dom.q=function(a,c){if(typeof a!="string")return b.SizzleNodeList.make([a]);return b.Sizzle(a,c)};b.Dom.getOwnerDocument=function(a){if(a==null)return document;return a.nodeType==9?a:a.ownerDocument||a.document};b.Dom.getPageOffset=function(a){b.Dom.getOwnerDocument(a);var c=
new b.Math.Point(0,0),e=document.documentElement;if(a==e)return c;if(a.getBoundingClientRect){var a=a.getBoundingClientRect(),g=e.scrollTop;c.x=a.left+e.scrollLeft;c.y=a.top+g}else throw Error("Your browser is outdated, please upgrade.");return c};b.Dom.absPosition=function(a,c){var e=this.getPageOffset(a);if(!e)return null;if(c==null)c=document.body;if(b.Style.getStyle(c,"position")=="static")return e;var g=this.getPageOffset(c);return e.sub(g)};b.Dom.disableTextSelection=function(a){a=b.Dom.getOwnerDocument(a);
b.Dom.__selectstart=a.onselectstart;a.onselectstart=function(){return!1}};b.Dom.enableTextSelection=function(a){a=b.Dom.getOwnerDocument(a);if(b.Dom.__selectstart)a.onselectstart=b.Dom.__selectstart,b.Dom.__selectstart=null};b.Dom.fromHtml=function(a){return b.Dom.makeFragment(a).firstChild};b.Dom.makeFragment=function(a){var b=document.createDocumentFragment(),e=document.createElement("div");for(e.innerHTML=a.trim();e.firstChild;)b.appendChild(e.removeChild(e.firstChild));return b};b.Dom.setContent=
function(a,b){["INPUT","TEXTAREA"].indexOf(a.nodeName.toUpperCase())!=-1?a.value=b:typeof b=="string"?a.innerHTML=b:(a.innerHTML="",a.appendChild(b))};b.Dom.getContent=function(a){return["INPUT","TEXTAREA"].indexOf(a.nodeName.toUpperCase())!=-1?a.value:a.innerHTML};b.Dom.getTextContent=function(a){return a.innerText||a.textContent||a.value};b.Dom.create=function(a,b,e){a=document.createElement(a);if(b!=null)a.className=typeof b=="string"?b:b.join(" ");if(e!=null)for(var c in e)a.setAttribute(c,e[c]);
return a};b.Dom.remove=function(a){return a.parentNode.removeChild(a)};b.Dom.Classes={_list:function(a){a=String(a.className).split(/\s+/);a[0]==""&&a.shift();return a},has:function(a,c){return b.Dom.Classes._list(a).indexOf(c)!=-1},add:function(a){for(var c=b.Dom.Classes._list(a),e=1,g=arguments.length;e<g;e++){var h=arguments[e];c.indexOf(h)==-1&&c.push(h)}a.className=c.join(" ")},remove:function(a){for(var c=b.Dom.Classes._list(a),e=1,g=arguments.length;e<g;e++){var h=c.indexOf(arguments[e]);h!=
-1&&c.splice(h,1)}a.className=c.join(" ")}};b.Dom.Draggable=function(a,c,e){b.extend(this,e);this._element=a;this._dragStartTarget=c||a};b.inherits(b.Dom.Draggable,b.EventTarget);b.Dom.Draggable.START=b.UserAgent.TOUCH?"touchstart":"mousedown";b.Dom.Draggable.END=b.UserAgent.TOUCH?"touchend":"mouseup";b.Dom.Draggable.MOVE=b.UserAgent.TOUCH?"touchmove":"mousemove";b.Dom.Draggable.TAP_TOLERANCE=15;b.extendClass(b.Dom.Draggable,{_enabled:!1,enable:function(){if(!this._enabled)b.Events.listen(this._dragStartTarget,
b.Dom.Draggable.START,this._onDown,this),this._enabled=!0},disable:function(){if(this._enabled)b.Events.unlisten(this._dragStartTarget,b.Dom.Draggable.START,this._onDown,this),this._enabled=!1},_onDown:function(a){if(!(a.shiftKey||a.which!=1&&a.button!=1&&!a.touches)&&!(a.touches&&a.touches.length>1)){var b=a.touches&&a.touches.length==1?a.touches[0]:a,e=this.dispatchEvent("dragdown",{"native":b});e.canceled()||(this.startDrag(b),e.dontStopEvent||(a.preventDefault(),a.stopPropagation()))}},startDrag:function(a){this._started=
!0;this._moved=!1;b.Dom.disableTextSelection();this._setMovingCursor();this._startPos=this._newPos=new b.Math.Point(this._element.offsetLeft,this._element.offsetTop);this._startPoint=new b.Math.Point(a.clientX,a.clientY);b.Events.listen(document,b.Dom.Draggable.MOVE,this._onMove,this);b.Events.listen(document,b.Dom.Draggable.END,this._onUp,this)},_onMove:function(a){if(!(a.touches&&a.touches.length>1)&&this._started){a.preventDefault();var b=a.touches&&a.touches.length==1?a.touches[0]:a;if(!this._moved&&
(a=this.fire("dragstart",{"native":a}),this._moved=!0,!a)){this.stopDrag();return}this._dx=b.clientX-this._startPoint.x;this._dy=b.clientY-this._startPoint.y;this._newPos=this._startPos.clone().add(this._dx,this._dy);this._updatePosition(b)}},_updatePosition:function(a){this.fire("drag",{pos:this._newPos,dx:this._dx,dy:this._dy,"native":a})},_onUp:function(a){if(a.changedTouches){var c=a.changedTouches[0];(this._newPos&&this._newPos.distanceTo(this._startPos)||0)<b.Dom.Draggable.TAP_TOLERANCE&&this._simulateEvent("click",
c)}this.fire("dragup",{"native":a});this.stopDrag();this._moved&&this.fire("dragend")},stopDrag:function(){b.Dom.enableTextSelection();this._restoreCursor();if(this._started)b.Events.unlisten(document,b.Dom.Draggable.MOVE,this._onMove,this),b.Events.unlisten(document,b.Dom.Draggable.END,this._onUp,this),this._started=!1},_setMovingCursor:function(){this._bodyCursor=document.body.style.cursor;document.body.style.cursor="move"},_restoreCursor:function(){document.body.style.cursor=this._bodyCursor},
_simulateEvent:function(a,b){var e=document.createEvent("MouseEvent");e.initMouseEvent(a,!0,!0,window,1,b.screenX,b.screenY,b.clientX,b.clientY,!1,!1,!1,!1,0,null);b.target.dispatchEvent(e)}});b.Dom.DraggableGroup=function(a,c){b.Dom.Draggable.call(this,a,null,c);this.on({dragdown:this._onDragDown,dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this)};b.inherits(b.Dom.DraggableGroup,b.Dom.Draggable);b.extendClass(b.Dom.DraggableGroup,{dragClass:null,dragStartClass:null,_onDragDown:function(a){for(var a=
a["native"].target,c=!1,e=null;a!=this._element&&a;){b.Dom.Classes.has(a,this.dragStartClass)&&(c=!0);if(b.Dom.Classes.has(a,this.dragClass)){e=a;break}a=a.parentNode}if(!c||!e)return!1;this._dragNode=e},_onDragStart:function(){this.beforeDrag(this._dragNode)},_onDrag:function(a){a.dragNode=this._dragNode},_onDragEnd:function(){var a=this._dragNode;a.style.width=this._savedWidth;a.style.height=this._savedHeight;a.style.position=this._savedPosition;b.Dom.Classes.remove(a,"navi-dragged")},beforeDrag:function(a){this._savedWidth=
a.style.width;this._savedHeight=a.style.height;this._savedPosition=a.style.position;this._startPos=new b.Math.Point(a.offsetLeft,a.offsetTop);a.style.width=a.clientWidth+"px";a.style.height=a.clientHeight+"px";b.Dom.Classes.add(a,"navi-dragged")}});b.Dom.Sortable=function(a,c){b.Dom.DraggableGroup.call(this,a,c);var e=this.placeholderNode=document.createElement(this.placeholderTag);e.className="navi-sortable-placeholder";e.style.display="none"};b.inherits(b.Dom.Sortable,b.Dom.DraggableGroup);b.extendClass(b.Dom.Sortable,
{placeholderTag:"div",beforeDrag:function(a){var c=this._getDraggables();this._minY=c[0].offsetTop;this._maxY=c[c.length-1].offsetTop;b.Dom.Sortable._superClass.beforeDrag.call(this,a);c=(this._dragParent=a.parentNode).insertBefore(this.placeholderNode,a);c.style.height=a.style.height;c.style.position=this._savedPosition;c.style.display=""},_onDragEnd:function(a){b.Dom.Sortable._superClass._onDragEnd.call(this,a);var a=this.placeholderNode,c=a.previousSibling,e=a.nextSibling;a.parentNode.removeChild(a);
a.style.display="none";this.fire("beforedrop",{prevNode:c,nextNode:e,dragNode:this._dragNode})&&(e?this._dragParent.insertBefore(this._dragNode,e):this._dragParent.appendChild(this._dragNode),this.fire("drop",{prevNode:c,nextNode:e,dragNode:this._dragNode}))},_getDraggables:function(){return b.Dom.q("."+this.dragClass,this._element)},_onDrag:function(a){b.Dom.Sortable._superClass._onDrag.call(this,a);var c=Math.max(this._minY,a.pos.y),c=Math.min(this._maxY,c);a.dragNode.style.top=c+"px";var e=this._getDraggables().filter(function(e){return a.dragNode!=
e}),g=null,h=null;e.every(function(e,b){if(e.offsetTop>=a.dragNode.offsetTop)return g=b,!1;return!0},this);var i=this.placeholderNode;c==this._maxY&&(g=null);g==null?this._dragParent.appendChild(i):(c==this._minY&&(g=0),h=e[g],this._dragParent.insertBefore(i,h))}});b.Dom.fn=b.SizzleNodeList.prototype;b.Dom.fn.parents=function(a){var c=this[0],e=new b.SizzleNodeList,g=!1;a&&a.substr(a.length-6)==":first"&&(g=!0,a=a.substr(0,a.length-6));for(;c=c.parentNode;)if(!a||b.Sizzle.matchesSelector(c,a))if(e.push(c),
g)break;return e};b._data={};b.Dom.fn.data=function(a,c){var e=this;this.forEach(function(g){g=b.getUid(g);g=b.setdefault(b._data,g);typeof a=="string"?c!==void 0?g[a]=c:e=g[a]:b.extend(g,a)});return e};b.Dom.fn.delData=function(){this.forEach(function(a){b.hasUid(a)&&(a=b.getUid(a),delete b._data[a])});return this};(function(a){b.extend(b.Dom.fn,{addClass:function(b){this.forEach(function(e){a.add(e,b)});return this},removeClass:function(){var b=[].slice.call(arguments);this.forEach(function(e){e=
[e].concat(b);a.remove.apply(a,e)});return this},hasClass:function(b){return this.every(function(e){return a.has(e,b)})},toggleClass:function(b,e){typeof e=="boolean"?(e?this.addClass:this.removeClass).call(this,b):this.forEach(function(e){(a.has(e,b)?a.remove:a.add).call(a,e,b)});return this}})})(b.Dom.Classes);b.Dom.fn.bind=function(a,c,e){this.forEach(function(g){b.Events.listen(g,a,c,e)});return this};b.Dom.fn.unbind=function(a,c,e){this.forEach(function(g){b.Events.unlisten(g,a,c,e)});return this};
b.Dom.fn.click=function(a,b){this.bind("click",a,b);return this};b.Fx={requestAnimFrame:function(a){(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)})(a)},fadeIn:function(a,c){var e=new b.Fx.Animation;e.on({started:function(){a.style.opacity=0;a.style.display=""},playing:function(e){a.style.opacity=b.Fx.Easing.easeOut(e.progress)},ended:function(){a.style.opacity=1}});e.play(c||
1500)},fadeOut:function(a,c){var e=new b.Fx.Animation;e.on({playing:function(e){a.style.opacity=1-b.Fx.Easing.easeIn(e.progress)},ended:function(){a.style.opacity=0;a.style.display="none"}});e.play(c||1500)}};b.Fx.Easing={easeIn:function(a){return Math.pow(a,3)},easeOut:function(a){return 1-Math.pow(1-a,3)}};b.Fx.Animation=function(){};b.inherits(b.Fx.Animation,b.EventTarget);b.Fx.Animation.States={STOPPED:0,PLAYING:1,PAUSED:2};b.extendClass(b.Fx.Animation,{state:b.Fx.Animation.States.STOPPED,progress:0,
play:function(a){this.startTime=b.now();this.endTime=this.startTime+a;this.progress=0;this.duration=a;this.state=b.Fx.Animation.States.PLAYING;this._onStarted();this.cycle()},setProgress:function(a){this.update(a)},update:function(a,c){this.progress=a||this.progress;this.duration=c||this.duration;if(this.state==b.Fx.Animation.States.PLAYING)this.startTime=b.now()-this.progress*this.duration,this.endTime=this.startTime+this.duration},pause:function(){this.state=b.Fx.Animation.States.PAUSED;this.fire("paused")},
resume:function(){this.state=b.Fx.Animation.States.PLAYING;this.fire("resumed");this.cycle()},stop:function(){this._onStopped()},cycle:function(){if(this.state!=b.Fx.Animation.States.PLAYING)return!1;this.progress=(b.now()-this.startTime)/(this.endTime-this.startTime);if(this.progress>1)this.progress=1;this._onPlaying();this.progress==1?(this._onStopped(),this.fire("ended")):b.Fx.requestAnimFrame(this.cycle.bind(this))},_onStarted:function(){this.fire("started")},_onStopped:function(){this.state=
b.Fx.Animation.States.STOPPED;this.fire("stopped")},_onPlaying:function(){this.fire("playing")},fire:function(a,c){c=b.extend(c,{progress:this.progress});return b.Fx.Animation._superClass.fire.call(this,a,c)},isPlaying:function(){return this.state==b.Fx.Animation.States.PLAYING}});b.Ui={};(function(){var a=b.UserAgent;a.MSIE&&(a=a.version.split(".")[0],b.Dom.Classes.add(document.documentElement||document.body.parentNode||document.body,"ie"+a,"ie"))})();b.Ui.Element=function(a,c){b.extend(this,c);
a&&this.attach(a)};b.inherits(b.Ui.Element,b.EventTarget);b.Ui.Element.States={HOVER:1,ACTIVE:2,SELECTED:4,CHECKED:8,FOCUSED:16,OPENED:32};b.Ui.Element.Events={HIGHLIGHT:"highlight",UNHIGHLIGHT:"unhighlight",ACTIVATED:"activated",DEACTIVED:"deactived",SELECT:"select",UNSELECT:"unselect",CHECK:"check",UNCHECK:"uncheck",FOCUS:"focus",BLUR:"blur",OPEN:"open",CLOSE:"close"};b.Ui.Element.prototype.state=0;b.Ui.Element.prototype.transitionStates=255;b.Ui.Element.prototype.autoStates=0;b.Ui.Element.prototype.enableTransitionState=
function(a,b){b||b==null?this.transitionStates|=a:this.transitionStates&=~a};b.Ui.Element.prototype.enableAutoState=function(a,c){var e=this.autoStates,g=b.Ui.Element.States;c||c==null?this.autoStates|=a:this.autoStates&=~a;var h=[],i=[],k=this.autoStates,j=function(a,b){var c=e&a,d=k&a,c=c?1:0;if(c^(d?1:0))c=c?i:h,c.push.apply(c,b)};j(g.HOVER,["mouseover","mouseout"]);j(g.OPENED,["mousedown","mouseup"]);j(g.CHECKED|g.SELECTED,["click"]);h.length&&this.listenElement(h,this._onMouseEvent);i.length&&
this.unlistenElement(i,this._onMouseEvent)};b.Ui.Element.prototype.stopEventTypes=[];b.Ui.Element.prototype.attach=function(a){var a=this.element=b.Dom.getElement(a),c=b.Ui.Element.States;a._navi_obj=this;Object.keys(c).forEach(function(e){var b=e.toLowerCase(),e=c[e];a.getAttribute(b)!=null&&this.setState(e,!0)},this);var e=this.autoStates;if(e)this.autoStates=0,this.enableAutoState(e)};b.Ui.Element.prototype._detach=function(a){this.exitDocument();delete a._navi_obj;this.element=null};b.Ui.Element.prototype.tagName=
"div";b.Ui.Element.prototype.enterDocument=function(){};b.Ui.Element.prototype.exitDocument=function(){};b.Ui.Element.prototype.createDom=function(){var a=document.createElement(this.tagName);if(this.className)a.className=this.className;return a};b.Ui.Element.prototype.onRender=function(){};b.Ui.Element.prototype.render=function(a,b){var e=this.createDom();this.attach(e);a=a||document.body;a.insertBefore(e,b||null);this.enterDocument();this.onRender();return e};b.Ui.Element.prototype.decorate=function(a){this._decorate(a);
this.attach(this.element||a);this.enterDocument();return this.element};b.Ui.Element.prototype._decorate=function(){};b.Ui.Element.prototype.listenElement=function(a,c,e,g){return b.Events.listen(this.element,a,c,e||this,g)};b.Ui.Element.prototype.unlistenElement=function(a,c,e,g){return b.Events.unlisten(this.element,a,c,e||this,g)};b.Ui.Element.prototype.destroy=function(){this.enableAutoState(255,!1);this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element);this.element&&
this._detach(this.element);b.Ui.Element._superClass.destroy.call(this)};b.Ui.Element.prototype.addClass=function(){var a=[].concat.apply([this.element],arguments);b.Dom.Classes.add.apply(null,a)};b.Ui.Element.prototype.removeClass=function(){var a=[].concat.apply([this.element],arguments);b.Dom.Classes.remove.apply(null,a)};b.Ui.Element.prototype.addCssState=function(a){b.Ui.Element.addState(this.element,a)};b.Ui.Element.prototype.removeCssState=function(a){b.Ui.Element.removeState(this.element,a)};
b.Ui.Element.prototype.hasCssState=function(a){return b.Ui.Element.hasState(this.element,a)};b.Ui.Element.prototype.toggleStateClass=function(a,b,e){a?(this.removeCssState(e),this.addCssState(b)):(this.removeCssState(b),this.addCssState(e))};b.Ui.Element.prototype._applyState=function(a,b){var e=a.toLowerCase();b?this.addCssState(e):this.removeCssState(e)};b.Ui.Element.prototype._setStateInternal=function(){};b.Ui.Element.prototype.setState=function(a,c){this.checkState(a,c)||(c?this.state|=a:this.state&=
~a,Object.keys(b.Ui.Element.States).forEach(function(e){var g=b.Ui.Element.States[e];g&a&&(this._applyState(e,c),this._setStateInternal(g,c))},this))};b.Ui.Element.prototype.hasState=function(a){return this.checkState(a,!0)};b.Ui.Element.prototype.checkState=function(a,b){return b?!!(this.state&a):!(this.state&a)};b.Ui.Element.prototype.toggleState=function(a){this.setState(a,!this.hasState(a))};b.Ui.Element.prototype.getEventForTransitionState=function(a,c){switch(a){case b.Ui.Element.States.HOVER:return c?
b.Ui.Element.Events.HIGHLIGHT:b.Ui.Element.Events.UNHIGHLIGHT;case b.Ui.Element.States.ACTIVE:return c?b.Ui.Element.Events.ACTIVATED:b.Ui.Element.Events.DEACTIVATED;case b.Ui.Element.States.SELECTED:return c?b.Ui.Element.Events.SELECT:b.Ui.Element.Events.UNSELECT;case b.Ui.Element.States.CHECKED:return c?b.Ui.Element.Events.CHECK:b.Ui.Element.Events.UNCHECK;case b.Ui.Element.States.FOCUSED:return c?b.Ui.Element.Events.FOCUS:b.Ui.Element.Events.BLUR;case b.Ui.Element.States.OPENED:return c?b.Ui.Element.Events.OPEN:
b.Ui.Element.Events.CLOSE}};b.Ui.Element.prototype.isTransitionAllowed=function(a,b){return this.transitionStates&a&&this.fire(this.getEventForTransitionState(a,b))};b.Ui.Element.prototype.setHighlited=function(a){this.isTransitionAllowed(b.Ui.Element.States.HOVER,a)&&this.setState(b.Ui.Element.States.HOVER,a)};b.Ui.Element.prototype.setChecked=function(a){this.isTransitionAllowed(b.Ui.Element.States.CHECKED,a)&&this.setState(b.Ui.Element.States.CHECKED,a)};b.Ui.Element.prototype.setOpened=function(a){this.isTransitionAllowed(b.Ui.Element.States.OPENED,
a)&&this.setState(b.Ui.Element.States.OPENED,a)};b.Ui.Element.prototype.setSelected=function(a){this.isTransitionAllowed(b.Ui.Element.States.SELECTED,a)&&this.setState(b.Ui.Element.States.SELECTED,a)};b.Ui.Element.prototype.isChecked=function(){return this.hasState(b.Ui.Element.States.CHECKED)};b.Ui.Element.prototype.isOpened=function(){return this.hasState(b.Ui.Element.States.OPENED)};b.Ui.Element.prototype.isSelected=function(){return this.hasState(b.Ui.Element.States.SELECTED)};b.Ui.Element.prototype._onMouseEvent=
function(a){switch(a.type){case "mouseover":case "mouseout":this.autoStates&b.Ui.Element.States.HOVER&&this.setHighlited(a.type=="mouseover");break;case "click":this.autoStates&b.Ui.Element.States.CHECKED?this.setChecked(!this.isChecked()):this.autoStates&b.Ui.Element.States.SELECTED&&this.setSelected(!this.isSelected());break;case "mousedown":this._mousedown=!0;this.autoStates&b.Ui.Element.States.OPENED&&this.setOpened(!this.isOpened());break;case "mouseup":if(this._mousedown)this._mousedown=!1}};
b.Ui.Element.prototype.getContentNode=function(){return this.element};b.Ui.Element.prototype.setContent=function(a){b.Dom.setContent(this.getContentNode(),a)};b.Ui.Element.prototype.getContent=function(){return b.Dom.getContent(this.getContentNode())};b.Ui.Element.prototype.isVisible=function(){return this.element.style.display!="none"};b.Ui.Element.prototype.setVisible=function(a){this.element.style.display=a?"":"none";this.fire("visibility",{visible:a})};b.Ui.Element.prototype.hide=function(){this.setVisible(!1)};
b.Ui.Element.prototype.show=function(){this.setVisible(!0)};b.Ui.Element.prototype.toggle=function(){this.setVisible(!this.isVisible())};b.Ui.Element.prototype.setStyle=function(a,b){var e=this.element;if(typeof a=="string")e.style[a]=b;else for(var c in a)a.hasOwnProperty(c)&&(e.style[c]=a[c])};b.Ui.Element.prototype._reqFadeAnim=function(){if(!this._fadeAnim)(this._fadeAnim=new b.Fx.Animation).on({started:function(){if(this._fadeAnim._fadeIn)this.element.style.opacity=0,this.show()},playing:function(a){this.element.style.opacity=
this._fadeAnim._fadeIn?b.Fx.Easing.easeOut(a.progress):1-b.Fx.Easing.easeIn(a.progress)},ended:function(){this._fadeAnim._fadeIn||this.hide()}},this);return this._fadeAnim};b.Ui.Element.prototype.fade=function(a,b){var b=b||1500,e=this._reqFadeAnim();e.isPlaying()&&(e._fadeIn!=a?e.update(1-e.progress,b):e.update(null,b));e._fadeIn=a;e.isPlaying()||e.play(b)};b.Ui.Element.prototype.fadeIn=function(a){this.fade(!0,a)};b.Ui.Element.prototype.fadeOut=function(a){this.fade(!1,a)};b.Ui.Element.prototype.fadePlaying=
function(){return this._reqFadeAnim().isPlaying()};b.Ui.Element._mkStateClass=function(a,b){var e=a;typeof a!="string"&&(e=a.className.split(/\s+/)[0]);return e+"-"+b};b.Ui.Element.addState=function(a,c){b.Dom.Classes.add(a,b.Ui.Element._mkStateClass(a,c))};b.Ui.Element.removeState=function(a,c){b.Dom.Classes.remove(a,b.Ui.Element._mkStateClass(a,c))};b.Ui.Element.hasState=function(a,c){return b.Dom.Classes.has(a,b.Ui.Element._mkStateClass(a,c))};b.Ui.Element.fromNode=function(a){return a._navi_obj};
b.Ui.Button=function(a,c){b.Ui.Element.call(this,a,c)};b.inherits(b.Ui.Button,b.Ui.Element);b.extendClass(b.Ui.Button,{tagName:"button",name:"button",autoStates:b.Ui.Element.States.HOVER|b.Ui.Element.States.CHECKED});b.Ui.Buttons=function(a){this.buttons=a;this.attach()};b.inherits(b.Ui.Buttons,b.EventTarget);b.extendClass(b.Ui.Buttons,{uniqueChecked:!0,canUncheckAll:!1,attach:function(){var a=this.buttons.length;this.buttons.forEach(function(c,e){if(a>1){var g="middle";e==0?g="left":e==a-1&&(g="right");
b.Dom.Classes.add(c.element,g)}c.setParentEventTarget(this);c.addEventListener("check",this.onButtonCheck,this);c.addEventListener("uncheck",this.onButtonUncheck,this)},this)},onButtonCheck:function(a){this.uniqueChecked&&this.buttons.forEach(function(c){a.target!=c&&c.setState(b.Ui.Element.States.CHECKED,!1)})},onButtonUncheck:function(a){this.canUncheckAll||this.buttons.some(function(b){if(b!=a.target)return b.isChecked()})||a.preventDefault()}});b.Ui.Buttons.fromSelector=function(a){a=[].map.call(b.Dom.q(a),
function(a){return new b.Ui.Button(a)});return new b.Ui.Buttons(a)};b.Ui.Popup=function(a){b.extend(this,a)};b.inherits(b.Ui.Popup,b.Ui.Element);b.extendClass(b.Ui.Popup,{className:"navi-popup",autoClose:!1,moveTo:function(a){this.element.style.left=a.x+"px";this.element.style.top=a.y+"px"},enterDocument:function(){if(this.autoClose)this._docBinded=!0,b.Events.listen(document,"mousedown",this._onDocumentClick,this,!0)},exitDocument:function(){this._docBinded&&b.Events.unlisten(document,"mousedown",
this._onDocumentClick,this,!0)},_onDocumentClick:function(a){for(a=a.target;a;){if(a==this.element||a==this.refNode)return;a=a.parentNode}this.setOpened(!1)},bindContentToRoleMap:function(a,c,e){e||(e={});var g=e.scope||null,h=e.eventType||"click";b.Dom.q(a,this.getContentNode()).forEach(function(a){b.Events.listen(a,h,function(b){var d=a.getAttribute("role");d&&(d in c?(c[d].call(g,b||window.event),e.inRoleHandler&&e.inRoleHandler.call(g)):e.outRoleHandler&&e.outRoleHandler.call(g))})})}});b.Ui.Menu=
function(a,c){b.extend(this,c);this.refNode=a};b.inherits(b.Ui.Menu,b.Ui.Popup);b.extendClass(b.Ui.Menu,{className:"navi-menu",contentClass:"navi-menu-content",tagName:"ul",autoClose:!0,createDom:function(){var a=document.createElement("div");a.className=this.className;var b=document.createElement(this.tagName);b.className=this.contentClass;a.appendChild(b);return a},getContentNode:function(){return this.element.firstChild},position:function(a){var a=a||this.refNode,c=b.Dom.absPosition(a),e=this.element;
e.style.left=c.x+"px";e.style.top=c.y+a.offsetHeight+"px";e.style.width=a.offsetWidth+"px"}});b.Ui.SelectBox=function(a){b.extend(this,a)};b.inherits(b.Ui.SelectBox,b.Ui.Element);b.extendClass(b.Ui.SelectBox,{autoStates:b.Ui.Element.States.OPENED,_decorate:function(a){this._selectbox=a;var c=a.parentNode,e=b.Dom.create("div","navi-selectbox"),g=this._textNode=b.Dom.create("div","navi-selectbox-text");e.appendChild(g);g=b.Dom.create("div","navi-selectbox-icon");e.appendChild(g);a.style.display="none";
this._makeMenu(e,a);c.appendChild(e);this.element=e},enterDocument:function(){this._reflect()},_makeMenu:function(a,c){var e=this._menu=new b.Ui.Menu(a);e.render();e.addClass("navi-selectbox-menu");c!=null&&c.className&&e.addClass(c.className.split(/\s+/)[0]+"_menu");e.listenElement("mousedown",this._onMenuClick,this);e.listen("close",this._onMenuClosed,this)},getMenu:function(){return this._menu},getContentNode:function(){return this._textNode},_updateContent:function(a){this.setContent(a.innerHTML)},
_setInputValue:function(a){this._selectbox.value=a},setValue:function(a){for(var b=this._menu.getContentNode().firstChild,e=null;b;){if(b.getAttribute("_value")==a){e=b;break}b=b.nextSibling}if(e&&(this._setInputValue(a),this._updateContent(e),this.value!=a))this.value=a,this.fire("change")},_onMenuClick:function(a){a=a.target;a.nodeName.toLowerCase()=="li"&&this.setValue(a.getAttribute("_value"));this.setOpened(!1)},_makeMenuItem:function(a,c){var e=b.Dom.create("li",null,{_value:c});e.innerHTML=
a;return e},addItem:function(a,b){var e=this._makeMenuItem(a,b);this._menu.getContentNode().appendChild(e)},_reflect:function(){var a=this._selectbox,b=a.selectedIndex;b>=0&&this._updateContent(a.options[b]);for(var b=a.options.length,e=0;e<b;e++){var c=a.options[e];this.addItem(c.innerHTML,c.value)}},_setStateInternal:function(a,c){a&b.Ui.Element.States.OPENED&&this._setOpened(c)},_setOpened:function(a){a&&this._menu.position(this._menuAnchor);this._menu.setState(b.Ui.Element.States.OPENED,a)},_onMenuClosed:function(){this.setOpened(!1)}});
b.Ui.Tab=function(a,c){b.Ui.Element.call(this,a,c)};b.inherits(b.Ui.Tab,b.Ui.Element);b.extendClass(b.Ui.Tab,{className:"navi-tab",tagName:"li",autoStates:b.Ui.Element.States.SELECTED,setState:function(a,c){a==b.Ui.Element.States.SELECTED&&this.pane&&(c?b.Ui.Element.addState:b.Ui.Element.removeState).call(b.Ui.Element,this.pane,"visible");b.Ui.Element.prototype.setState.call(this,a,c)},destroy:function(){if(this.pane&&this.pane.parentNode)this.pane.parentNode.removeChild(this.pane),this.pane=null;
b.Ui.Tab._superClass.destroy.call(this)}});b.Ui.TabBar=function(){this._tabs=[];this.listen("select",this.onTabSelect,this);this.listen("unselect",this.onTabUnselect,this)};b.inherits(b.Ui.TabBar,b.Ui.Element);b.extendClass(b.Ui.TabBar,{_decorate:function(a){a=b.Dom.getElement(a);this._tabsNode=b.Dom.q(".navi-tabs-nav",a)[0];this._tabsCont=b.Dom.q(".navi-tabs-cont",a)[0];b.Dom.q(".navi-tab",this._tabsNode).forEach(function(a){this._decorateTab(a)},this)},_addTabPane:function(a){var b=document.createElement("div");
b.className="navi-tabs-pane";a.pane=b;this._tabsCont.appendChild(b)},_decorateTab:function(a){var c=new b.Ui.Tab;c.decorate(a);c.setParentEventTarget(this);this._tabs.push(c);a=a.getAttribute("pane");a=b.Dom.q(a,this._tabsCont)[0];c.pane=a;this._tabs.length==1&&this.selectTab(c);return c},addTab:function(a,c){if(c==null)c=this._tabs.length;var e=b.Dom.q(".navi-tab",this._tabsNode),g=new b.Ui.Tab,h=null;c<this._tabs.length&&e[c]&&(h=e[c]);g.render(this._tabsNode,h);g.setContent(a);g.setParentEventTarget(this);
this._tabs.splice(c,0,g);this._addTabPane(g);this._tabs.length==1&&this.selectTab(g);return g},_getTab:function(a){if(typeof a=="number"){var c=this._getTabs(),a=b.Ui.Element.fromNode(c[a]);if(!a)return}return a},removeTab:function(a){a=this._getTab(a);a.destroy()},selectTab:function(a){a=this._getTab(a);a.setSelected(!0)},_getTabs:function(){return b.Dom.q(".navi-tab",this._tabsNode)},_findFirstTabOnLastRow:function(){for(var a=this._getTabs(),c=a.length,e=null,g=0;c--;){var h=b.Dom.getPageOffset(a[c]);
e&&h.y<e.y&&(g=c+1);e=h}return g},getSelectedTab:function(){return this._selectedTab},onTabSelect:function(a){this._tabs.forEach(function(c){if(a.target!=c)c.setState(b.Ui.Element.States.SELECTED,!1);else{var e=this._getTabs(),g=b.Dom.getPageOffset(c.element);b.Dom.getPageOffset(e[e.length-1]).y>g.y&&(g=this._findFirstTabOnLastRow(),this._tabsNode.insertBefore(c.element,e[g+1]))}},this);this._selectedTab=a.target;this.fire("tabselect",{tab:a.target})},onTabUnselect:function(a){this._tabs.some(function(b){if(b!=
a.target)return b.isSelected()})?this.fire("tabunselect",{tab:a.target}):a.preventDefault()}});return b}(),OpenLayers=function(){var b={Popup:{}};b.String={startsWith:function(a,b){return a.indexOf(b)==0},contains:function(a,b){return a.indexOf(b)!=-1},trim:function(a){return a.trim()},camelize:function(a){for(var a=a.split("-"),b=a[0],d=1,f=a.length;d<f;d++){var e=a[d];b+=e.charAt(0).toUpperCase()+e.substring(1)}return b},format:function(a,c,d){c||(c=window);return a.replace(b.String.tokenRegEx,
function(a,b){for(var g,h=b.split(/\.+/),i=0;i<h.length;i++)i==0&&(g=c),g=g[h[i]];typeof g=="function"&&(g=d?g.apply(null,d):g());return typeof g=="undefined"?"undefined":g})},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(a){return b.String.numberRegEx.test(a)},numericIf:function(a){return b.String.isNumeric(a)?parseFloat(a):a}};if(!String.prototype.startsWith)String.prototype.startsWith=function(a){b.Console.warn(b.i18n("methodDeprecated",
{newMethod:"OpenLayers.String.startsWith"}));return b.String.startsWith(this,a)};if(!String.prototype.contains)String.prototype.contains=function(a){b.Console.warn(b.i18n("methodDeprecated",{newMethod:"OpenLayers.String.contains"}));return b.String.contains(this,a)};if(!String.prototype.camelize)String.prototype.camelize=function(){b.Console.warn(b.i18n("methodDeprecated",{newMethod:"OpenLayers.String.camelize"}));return b.String.camelize(this)};b.Number={decimalSeparator:".",thousandsSeparator:",",
limitSigDigs:function(a,b){var d=0;b>0&&(d=parseFloat(a.toPrecision(b)));return d},format:function(a,c,d,f){c=typeof c!="undefined"?c:0;d=typeof d!="undefined"?d:b.Number.thousandsSeparator;f=typeof f!="undefined"?f:b.Number.decimalSeparator;c!=null&&(a=parseFloat(a.toFixed(c)));var e=a.toString().split(".");e.length==1&&c==null&&(c=0);a=e[0];if(d)for(var g=/(-?[0-9]+)([0-9]{3})/;g.test(a);)a=a.replace(g,"$1"+d+"$2");c==0?c=a:(d=e.length>1?e[1]:"0",c!=null&&(d+=Array(c-d.length+1).join("0")),c=a+
f+d);return c}};if(!Number.prototype.limitSigDigs)Number.prototype.limitSigDigs=function(a){b.Console.warn(b.i18n("methodDeprecated",{newMethod:"OpenLayers.Number.limitSigDigs"}));return b.Number.limitSigDigs(this,a)};b.Function={bind:function(a){var b=[].slice.call(arguments,1);return a.bind.apply(a,b)},bindAsEventListener:function(a,b){return function(d){return a.call(b,d||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}};if(!Function.prototype.bindAsEventListener)Function.prototype.bindAsEventListener=
function(a){b.Console.warn(b.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bindAsEventListener"}));return b.Function.bindAsEventListener(this,a)};b.Array={filter:function(a,b,d){return a.filter(b,d)}};b.Class=Navitel.Class;b.inherit=Navitel.inherits;b.Util=b.Util||{};b.Util.extend=function(a,b){a=a||{};if(b){for(var d in b){var f=b[d];f!==void 0&&(a[d]=f)}if(!(typeof window.Event=="function"&&b instanceof window.Event)&&b.hasOwnProperty&&b.hasOwnProperty("toString"))a.toString=b.toString}return a};
b.Util=b.Util||{};b.Util.getElement=function(){for(var a=[],b=0,d=arguments.length;b<d;b++){var f=arguments[b];typeof f=="string"&&(f=document.getElementById(f));if(arguments.length==1)return f;a.push(f)}return a};b.Util.isElement=function(a){return!!(a&&a.nodeType===1)};b.Util.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"};if(typeof window.$==="undefined")window.$=b.Util.getElement;b.Util.removeItem=function(a,b){for(var d=a.length-1;d>=0;d--)a[d]==b&&a.splice(d,
1);return a};b.Util.clearArray=function(a){b.Console.warn(b.i18n("methodDeprecated",{newMethod:"array = []"}));a.length=0};b.Util.indexOf=function(a,b){if(typeof a.indexOf=="function")return a.indexOf(b);else{for(var d=0,f=a.length;d<f;d++)if(a[d]==b)return d;return-1}};b.Util.modifyDOMElement=function(a,b,d,f,e,g,h,i){if(b)a.id=b;if(d)a.style.left=d.x+"px",a.style.top=d.y+"px";if(f)a.style.width=f.w+"px",a.style.height=f.h+"px";if(e)a.style.position=e;if(g)a.style.border=g;if(h)a.style.overflow=
h;if(parseFloat(i)>=0&&parseFloat(i)<1)a.style.filter="alpha(opacity="+i*100+")",a.style.opacity=i;else if(parseFloat(i)==1)a.style.filter="",a.style.opacity=""};b.Util.createDiv=function(a,c,d,f,e,g,h,i){var k=document.createElement("div");if(f)k.style.backgroundImage="url("+f+")";a||(a=b.Util.createUniqueID("OpenLayersDiv"));e||(e="absolute");b.Util.modifyDOMElement(k,a,c,d,e,g,h,i);return k};b.Util.createImage=function(a,c,d,f,e,g,h,i){var k=document.createElement("img");a||(a=b.Util.createUniqueID("OpenLayersDiv"));
e||(e="relative");b.Util.modifyDOMElement(k,a,c,d,e,g,null,h);if(i)k.style.display="none",b.Event.observe(k,"load",b.Function.bind(b.Util.onImageLoad,k)),b.Event.observe(k,"error",b.Function.bind(b.Util.onImageLoadError,k));k.style.alt=a;k.galleryImg="no";if(f)k.src=f;return k};b.Util.setOpacity=function(a,c){b.Util.modifyDOMElement(a,null,null,null,null,null,null,c)};b.Util.onImageLoad=function(){if(!this.viewRequestID||this.map&&this.viewRequestID==this.map.viewRequestID)this.style.display="";b.Element.removeClass(this,
"olImageLoadError")};b.IMAGE_RELOAD_ATTEMPTS=0;b.Util.onImageLoadError=function(){this._attempts=this._attempts?this._attempts+1:1;if(this._attempts<=b.IMAGE_RELOAD_ATTEMPTS){var a=this.urls;if(a&&b.Util.isArray(a)&&a.length>1){var c=this.src.toString(),d,f;for(f=0;d=a[f];f++)if(c.indexOf(d)!=-1)break;var e=Math.floor(a.length*Math.random()),e=a[e];for(f=0;e==d&&f++<4;)e=Math.floor(a.length*Math.random()),e=a[e];this.src=c.replace(d,e)}else this.src=this.src}else b.Element.addClass(this,"olImageLoadError");
this.style.display=""};b.Util.alphaHackNeeded=null;b.Util.alphaHack=function(){if(b.Util.alphaHackNeeded==null){var a=navigator.appVersion.split("MSIE"),a=parseFloat(a[1]),c=!1;try{c=!!document.body.filters}catch(d){}b.Util.alphaHackNeeded=c&&a>=5.5&&a<7}return b.Util.alphaHackNeeded};b.Util.modifyAlphaImageDiv=function(a,c,d,f,e,g,h,i,k){b.Util.modifyDOMElement(a,c,d,f,g,null,null,k);c=a.childNodes[0];if(e)c.src=e;b.Util.modifyDOMElement(c,a.id+"_innerImage",null,f,"relative",h);if(b.Util.alphaHack()){if(a.style.display!=
"none")a.style.display="inline-block";i==null&&(i="scale");a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+c.src+"', sizingMethod='"+i+"')";parseFloat(a.style.opacity)>=0&&parseFloat(a.style.opacity)<1&&(a.style.filter+=" alpha(opacity="+a.style.opacity*100+")");c.style.filter="alpha(opacity=0)"}};b.Util.createAlphaImageDiv=function(a,c,d,f,e,g,h,i,k){var j=b.Util.createDiv(),l=b.Util.createImage(null,null,null,null,null,null,null,!1);j.appendChild(l);if(k)l.style.display=
"none",b.Event.observe(l,"load",b.Function.bind(b.Util.onImageLoad,j)),b.Event.observe(l,"error",b.Function.bind(b.Util.onImageLoadError,j));b.Util.modifyAlphaImageDiv(j,a,c,d,f,e,g,h,i);return j};b.Util.upperCaseObject=function(a){var b={},d;for(d in a)b[d.toUpperCase()]=a[d];return b};b.Util.applyDefaults=function(a,b){var a=a||{},d=typeof window.Event=="function"&&b instanceof window.Event,f;for(f in b)if(a[f]===void 0||!d&&b.hasOwnProperty&&b.hasOwnProperty(f)&&!a.hasOwnProperty(f))a[f]=b[f];
if(!d&&b&&b.hasOwnProperty&&b.hasOwnProperty("toString")&&!a.hasOwnProperty("toString"))a.toString=b.toString;return a};b.Util.getParameterString=function(a){var b=[],d;for(d in a){var f=a[d];if(f!=null&&typeof f!="function"){if(typeof f=="object"&&f.constructor==Array){for(var e=[],g,h=0,i=f.length;h<i;h++)g=f[h],e.push(encodeURIComponent(g===null||g===void 0?"":g));f=e.join(",")}else f=encodeURIComponent(f);b.push(encodeURIComponent(d)+"="+f)}}return b.join("&")};b.Util.urlAppend=function(a,b){var d=
a;if(b){var f=(a+" ").split(/[?&]/);d+=f.pop()===" "?b:f.length?"&"+b:"?"+b}return d};b.ImgPath="";b.Util.getImagesLocation=function(){return b.ImgPath||b._getScriptLocation()+"img/"};b.Util.Try=function(){for(var a=null,b=0,d=arguments.length;b<d;b++){var f=arguments[b];try{a=f();break}catch(e){}}return a};b.Util.mouseLeft=function(a,b){for(var d=a.relatedTarget?a.relatedTarget:a.toElement;d!=b&&d!=null;)d=d.parentNode;return d!=b};b.Util.DEFAULT_PRECISION=14;b.Util.toFloat=function(a,c){if(c==null)c=
b.Util.DEFAULT_PRECISION;typeof a!=="number"&&(a=parseFloat(a));return c===0?a:parseFloat(a.toPrecision(c))};b.Util.rad=function(a){return a*Math.PI/180};b.Util.deg=function(a){return a*180/Math.PI};b.Util.VincentyConstants={a:6378137,b:6356752.3142,f:1/298.257223563};b.Util.distVincenty=function(a,c){for(var d=b.Util.VincentyConstants,f=d.a,e=d.b,d=d.f,g=b.Util.rad(c.lon-a.lon),h=Math.atan((1-d)*Math.tan(b.Util.rad(a.lat))),i=Math.atan((1-d)*Math.tan(b.Util.rad(c.lat))),k=Math.sin(h),h=Math.cos(h),
j=Math.sin(i),i=Math.cos(i),l=g,m=2*Math.PI,n=20;Math.abs(l-m)>1.0E-12&&--n>0;){var o=Math.sin(l),p=Math.cos(l),t=Math.sqrt(i*o*i*o+(h*j-k*i*p)*(h*j-k*i*p));if(t==0)return 0;var p=k*j+h*i*p,s=Math.atan2(t,p),q=Math.asin(h*i*o/t),r=Math.cos(q)*Math.cos(q),o=p-2*k*j/r,u=d/16*r*(4+d*(4-3*r)),m=l,l=g+(1-u)*d*Math.sin(q)*(s+u*t*(o+u*p*(-1+2*o*o)))}if(n==0)return NaN;f=r*(f*f-e*e)/(e*e);d=f/1024*(256+f*(-128+f*(74-47*f)));return(e*(1+f/16384*(4096+f*(-768+f*(320-175*f))))*(s-d*t*(o+d/4*(p*(-1+2*o*o)-d/
6*o*(-3+4*t*t)*(-3+4*o*o))))).toFixed(3)/1E3};b.Util.destinationVincenty=function(a,c,d){for(var f=b.Util,e=f.VincentyConstants,g=e.a,h=e.b,e=e.f,i=a.lon,k=a.lat,a=f.rad(c),c=Math.sin(a),a=Math.cos(a),j=(1-e)*Math.tan(f.rad(k)),k=1/Math.sqrt(1+j*j),l=j*k,m=Math.atan2(j,a),j=k*c,n=1-j*j,g=n*(g*g-h*h)/(h*h),o=1+g/16384*(4096+g*(-768+g*(320-175*g))),p=g/1024*(256+g*(-128+g*(74-47*g))),g=d/(h*o),t=2*Math.PI;Math.abs(g-t)>1.0E-12;)var s=Math.cos(2*m+g),q=Math.sin(g),r=Math.cos(g),u=p*q*(s+p/4*(r*(-1+2*
s*s)-p/6*s*(-3+4*q*q)*(-3+4*s*s))),t=g,g=d/(h*o)+u;d=l*q-k*r*a;d=Math.atan2(l*r+k*q*a,(1-e)*Math.sqrt(j*j+d*d));h=e/16*n*(4+e*(4-3*n));return new b.LonLat(i+f.deg(Math.atan2(q*c,k*r-l*q*a)-(1-h)*e*j*(g+h*q*(s+h*r*(-1+2*s*s)))),f.deg(d))};b.Util.getParameters=function(a){var a=a===null||a===void 0?window.location.href:a,c="";if(b.String.contains(a,"?"))var c=a.indexOf("?")+1,d=b.String.contains(a,"#")?a.indexOf("#"):a.length,c=a.substring(c,d);for(var a={},c=c.split(/[&;]/),d=0,f=c.length;d<f;++d){var e=
c[d].split("=");if(e[0]){var g=e[0];try{g=decodeURIComponent(g)}catch(h){g=unescape(g)}e=(e[1]||"").replace(/\+/g," ");try{e=decodeURIComponent(e)}catch(i){e=unescape(e)}e=e.split(",");e.length==1&&(e=e[0]);a[g]=e}}return a};b.Util.getArgs=function(a){b.Console.warn(b.i18n("methodDeprecated",{newMethod:"OpenLayers.Util.getParameters"}));return b.Util.getParameters(a)};b.Util.lastSeqID=0;b.Util.createUniqueID=function(a){a==null&&(a="id_");b.Util.lastSeqID+=1;return a+b.Util.lastSeqID};b.INCHES_PER_UNIT=
{inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};b.INCHES_PER_UNIT["in"]=b.INCHES_PER_UNIT.inches;b.INCHES_PER_UNIT.degrees=b.INCHES_PER_UNIT.dd;b.INCHES_PER_UNIT.nmi=1852*b.INCHES_PER_UNIT.m;b.METERS_PER_INCH=0.0254000508001016;b.Util.extend(b.INCHES_PER_UNIT,{Inch:b.INCHES_PER_UNIT.inches,Meter:1/b.METERS_PER_INCH,Foot:0.3048006096012192/b.METERS_PER_INCH,IFoot:0.3048/b.METERS_PER_INCH,ClarkeFoot:0.3047972651151/b.METERS_PER_INCH,SearsFoot:0.30479947153867626/b.METERS_PER_INCH,GoldCoastFoot:0.3047997101815088/
b.METERS_PER_INCH,IInch:0.0254/b.METERS_PER_INCH,MicroInch:2.54E-5/b.METERS_PER_INCH,Mil:2.54E-8/b.METERS_PER_INCH,Centimeter:0.01/b.METERS_PER_INCH,Kilometer:1E3/b.METERS_PER_INCH,Yard:0.9144018288036576/b.METERS_PER_INCH,SearsYard:0.914398414616029/b.METERS_PER_INCH,IndianYard:0.9143985307444408/b.METERS_PER_INCH,IndianYd37:0.91439523/b.METERS_PER_INCH,IndianYd62:0.9143988/b.METERS_PER_INCH,IndianYd75:0.9143985/b.METERS_PER_INCH,IndianFoot:0.30479951/b.METERS_PER_INCH,IndianFt37:0.30479841/b.METERS_PER_INCH,
IndianFt62:0.3047996/b.METERS_PER_INCH,IndianFt75:0.3047995/b.METERS_PER_INCH,Mile:1609.3472186944373/b.METERS_PER_INCH,IYard:0.9144/b.METERS_PER_INCH,IMile:1609.344/b.METERS_PER_INCH,NautM:1852/b.METERS_PER_INCH,"Lat-66":110943.31648893273/b.METERS_PER_INCH,"Lat-83":110946.25736872235/b.METERS_PER_INCH,Decimeter:0.1/b.METERS_PER_INCH,Millimeter:0.0010/b.METERS_PER_INCH,Dekameter:10/b.METERS_PER_INCH,Decameter:10/b.METERS_PER_INCH,Hectometer:100/b.METERS_PER_INCH,GermanMeter:1.0000135965/b.METERS_PER_INCH,
CaGrid:0.999738/b.METERS_PER_INCH,ClarkeChain:20.1166194976/b.METERS_PER_INCH,GunterChain:20.11684023368047/b.METERS_PER_INCH,BenoitChain:20.116782494375872/b.METERS_PER_INCH,SearsChain:20.11676512155/b.METERS_PER_INCH,ClarkeLink:0.201166194976/b.METERS_PER_INCH,GunterLink:0.2011684023368047/b.METERS_PER_INCH,BenoitLink:0.20116782494375873/b.METERS_PER_INCH,SearsLink:0.2011676512155/b.METERS_PER_INCH,Rod:5.02921005842012/b.METERS_PER_INCH,IntnlChain:20.1168/b.METERS_PER_INCH,IntnlLink:0.201168/b.METERS_PER_INCH,
Perch:5.02921005842012/b.METERS_PER_INCH,Pole:5.02921005842012/b.METERS_PER_INCH,Furlong:201.1684023368046/b.METERS_PER_INCH,Rood:3.778266898/b.METERS_PER_INCH,CapeFoot:0.3047972615/b.METERS_PER_INCH,Brealey:375/b.METERS_PER_INCH,ModAmFt:0.304812252984506/b.METERS_PER_INCH,Fathom:1.8288/b.METERS_PER_INCH,"NautM-UK":1853.184/b.METERS_PER_INCH,"50kilometers":5E4/b.METERS_PER_INCH,"150kilometers":15E4/b.METERS_PER_INCH});b.Util.extend(b.INCHES_PER_UNIT,{mm:b.INCHES_PER_UNIT.Meter/1E3,cm:b.INCHES_PER_UNIT.Meter/
100,dm:b.INCHES_PER_UNIT.Meter*100,km:b.INCHES_PER_UNIT.Meter*1E3,kmi:b.INCHES_PER_UNIT.nmi,fath:b.INCHES_PER_UNIT.Fathom,ch:b.INCHES_PER_UNIT.IntnlChain,link:b.INCHES_PER_UNIT.IntnlLink,"us-in":b.INCHES_PER_UNIT.inches,"us-ft":b.INCHES_PER_UNIT.Foot,"us-yd":b.INCHES_PER_UNIT.Yard,"us-ch":b.INCHES_PER_UNIT.GunterChain,"us-mi":b.INCHES_PER_UNIT.Mile,"ind-yd":b.INCHES_PER_UNIT.IndianYd37,"ind-ft":b.INCHES_PER_UNIT.IndianFt37,"ind-ch":20.11669506/b.METERS_PER_INCH});b.DOTS_PER_INCH=72;b.Util.normalizeScale=
function(a){return a>1?1/a:a};b.Util.getResolutionFromScale=function(a,c){var d;a&&(c==null&&(c="degrees"),d=1/(b.Util.normalizeScale(a)*b.INCHES_PER_UNIT[c]*b.DOTS_PER_INCH));return d};b.Util.getScaleFromResolution=function(a,c){c==null&&(c="degrees");return a*b.INCHES_PER_UNIT[c]*b.DOTS_PER_INCH};b.Util.pagePosition=function(a){var c=[0,0],d=b.Util.getViewportElement();if(!a||a==window||a==d)return c;var f=b.IS_GECKO&&document.getBoxObjectFor&&b.Element.getStyle(a,"position")=="absolute"&&(a.style.top==
""||a.style.left==""),e=null;if(a.getBoundingClientRect)a=a.getBoundingClientRect(),e=d.scrollTop,c[0]=a.left+d.scrollLeft,c[1]=a.top+e;else if(document.getBoxObjectFor&&!f)a=document.getBoxObjectFor(a),d=document.getBoxObjectFor(d),c[0]=a.screenX-d.screenX,c[1]=a.screenY-d.screenY;else{c[0]=a.offsetLeft;c[1]=a.offsetTop;e=a.offsetParent;if(e!=a)for(;e;)c[0]+=e.offsetLeft,c[1]+=e.offsetTop,e=e.offsetParent;d=b.BROWSER_NAME;if(d=="opera"||d=="safari"&&b.Element.getStyle(a,"position")=="absolute")c[1]-=
document.body.offsetTop;for(e=a.offsetParent;e&&e!=document.body;){c[0]-=e.scrollLeft;if(d!="opera"||e.tagName!="TR")c[1]-=e.scrollTop;e=e.offsetParent}}return c};b.Util.getViewportElement=function(){var a=arguments.callee.viewportElement;if(a==void 0)a=b.BROWSER_NAME=="msie"&&document.compatMode!="CSS1Compat"?document.body:document.documentElement,arguments.callee.viewportElement=a;return a};b.Util.isEquivalentUrl=function(a,c,d){d=d||{};b.Util.applyDefaults(d,{ignoreCase:!0,ignorePort80:!0,ignoreHash:!0});
var a=b.Util.createUrlObject(a,d),c=b.Util.createUrlObject(c,d),f;for(f in a)if(f!=="args"&&a[f]!=c[f])return!1;for(f in a.args){if(a.args[f]!=c.args[f])return!1;delete c.args[f]}for(f in c.args)return!1;return!0};b.Util.createUrlObject=function(a,c){c=c||{};if(!/^\w+:\/\//.test(a)){var d=window.location,f=d.port?":"+d.port:"",f=d.protocol+"//"+d.host.split(":").shift()+f;a.indexOf("/")===0?a=f+a:(d=d.pathname.split("/"),d.pop(),a=f+d.join("/")+"/"+a)}c.ignoreCase&&(a=a.toLowerCase());d=document.createElement("a");
d.href=a;f={};f.host=d.host.split(":").shift();f.protocol=d.protocol;f.port=c.ignorePort80?d.port=="80"||d.port=="0"?"":d.port:d.port==""||d.port=="0"?"80":d.port;f.hash=c.ignoreHash||d.hash==="#"?"":d.hash;var e=d.search;e||(e=a.indexOf("?"),e=e!=-1?a.substr(e):"");f.args=b.Util.getParameters(e);f.pathname=d.pathname.charAt(0)=="/"?d.pathname:"/"+d.pathname;return f};b.Util.removeTail=function(a){var b=null,b=a.indexOf("?"),d=a.indexOf("#");return b=b==-1?d!=-1?a.substr(0,d):a:d!=-1?a.substr(0,Math.min(b,
d)):a.substr(0,b)};b.IS_GECKO=function(){var a=navigator.userAgent.toLowerCase();return a.indexOf("webkit")==-1&&a.indexOf("gecko")!=-1}();b.BROWSER_NAME=function(){var a="",b=navigator.userAgent.toLowerCase();b.indexOf("opera")!=-1?a="opera":b.indexOf("msie")!=-1?a="msie":b.indexOf("safari")!=-1?a=b.indexOf("chrome")!=-1?"chrome":"safari":b.indexOf("mozilla")!=-1&&(a=b.indexOf("firefox")!=-1?"firefox":"mozilla");return a}();b.Util.getBrowserName=function(){return b.BROWSER_NAME};b.Util.getRenderedDimensions=
function(a,c,d){var f,e,g=document.createElement("div");g.style.visibility="hidden";var h=d&&d.containerElement?d.containerElement:document.body;if(c)if(c.w)f=c.w,g.style.width=f+"px";else if(c.h)e=c.h,g.style.height=e+"px";if(d&&d.displayClass)g.className=d.displayClass;c=document.createElement("div");c.innerHTML=a;c.style.overflow="visible";if(c.childNodes){a=0;for(d=c.childNodes.length;a<d;a++)if(c.childNodes[a].style)c.childNodes[a].style.overflow="visible"}g.appendChild(c);h.appendChild(g);a=
!1;for(d=g.parentNode;d&&d.tagName.toLowerCase()!="body";){var i=b.Element.getStyle(d,"position");if(i=="absolute"){a=!0;break}else if(i&&i!="static")break;d=d.parentNode}if(!a)g.style.position="absolute";if(!f)f=parseInt(c.scrollWidth),g.style.width=f+"px";e||(e=parseInt(c.scrollHeight));g.removeChild(c);h.removeChild(g);return new b.Size(f,e)};b.Util.getScrollbarWidth=function(){var a=b.Util._scrollbarWidth;if(a==null){var c=null,d=null,c=a=0,c=document.createElement("div");c.style.position="absolute";
c.style.top="-1000px";c.style.left="-1000px";c.style.width="100px";c.style.height="50px";c.style.overflow="hidden";d=document.createElement("div");d.style.width="100%";d.style.height="200px";c.appendChild(d);document.body.appendChild(c);a=d.offsetWidth;c.style.overflow="scroll";c=d.offsetWidth;document.body.removeChild(document.body.lastChild);b.Util._scrollbarWidth=a-c;a=b.Util._scrollbarWidth}return a};b.Event={observers:!1,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},isSingleTouch:function(a){return a.touches&&a.touches.length==1},isMultiTouch:function(a){return a.touches&&a.touches.length>1},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)a.preventDefault?a.preventDefault():a.returnValue=!1;a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},
findElement:function(a,c){for(var d=b.Event.element(a);d.parentNode&&(!d.tagName||d.tagName.toUpperCase()!=c.toUpperCase());)d=d.parentNode;return d},observe:function(a,c,d,f){a=b.Util.getElement(a);f=f||!1;if(c=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.attachEvent))c="keydown";if(!this.observers)this.observers={};if(!a._eventCacheID){var e="eventCacheID_";a.id&&(e=a.id+"_"+e);a._eventCacheID=b.Util.createUniqueID(e)}e=a._eventCacheID;this.observers[e]||(this.observers[e]=
[]);this.observers[e].push({element:a,name:c,observer:d,useCapture:f});a.addEventListener?a.addEventListener(c,d,f):a.attachEvent&&a.attachEvent("on"+c,d)},stopObservingElement:function(a){a=b.Util.getElement(a)._eventCacheID;this._removeElementObservers(b.Event.observers[a])},_removeElementObservers:function(a){if(a)for(var c=a.length-1;c>=0;c--){var d=a[c];b.Event.stopObserving.apply(this,[d.element,d.name,d.observer,d.useCapture])}},stopObserving:function(a,c,d,f){var f=f||!1,a=b.Util.getElement(a),
e=a._eventCacheID;if(c=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.detachEvent))c="keydown";var g=!1,h=b.Event.observers[e];if(h)for(var i=0;!g&&i<h.length;){var k=h[i];if(k.name==c&&k.observer==d&&k.useCapture==f){h.splice(i,1);h.length==0&&delete b.Event.observers[e];g=!0;break}i++}g&&(a.removeEventListener?a.removeEventListener(c,d,f):a&&a.detachEvent&&a.detachEvent("on"+c,d));return g},unloadCache:function(){if(b.Event&&b.Event.observers){for(var a in b.Event.observers)b.Event._removeElementObservers.apply(this,
[b.Event.observers[a]]);b.Event.observers=!1}},CLASS_NAME:"OpenLayers.Event"};b.Event.observe(window,"unload",b.Event.unloadCache,!1);window.Event&&b.Util.applyDefaults(window.Event,b.Event);b.Events=b.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend"],listeners:null,object:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,includeXY:!1,clearMouseListener:null,
initialize:function(a,c,d,f,e){b.Util.extend(this,e);this.object=a;this.fallThrough=f;this.listeners={};this.eventHandler=b.Function.bindAsEventListener(this.handleBrowserEvent,this);this.clearMouseListener=b.Function.bind(this.clearMouseCache,this);this.eventTypes=[];if(d!=null){a=0;for(f=d.length;a<f;a++)this.addEventType(d[a])}c!=null&&this.attachToElement(c)},destroy:function(){this.element&&(b.Event.stopObservingElement(this.element),this.element.hasScrollEvent&&b.Event.stopObserving(window,
"scroll",this.clearMouseListener));this.eventHandler=this.fallThrough=this.eventTypes=this.object=this.listeners=this.element=null},addEventType:function(a){this.listeners[a]||(this.eventTypes.push(a),this.listeners[a]=[])},attachToElement:function(a){this.element&&b.Event.stopObservingElement(this.element);this.element=a;for(var c=0,d=this.BROWSER_EVENTS.length;c<d;c++){var f=this.BROWSER_EVENTS[c];this.addEventType(f);b.Event.observe(a,f,this.eventHandler)}b.Event.observe(a,"dragstart",b.Event.stop)},
on:function(a){for(var b in a)b!="scope"&&this.register(b,a.scope,a[b])},register:function(a,c,d){if(d!=null&&b.Util.indexOf(this.eventTypes,a)!=-1){if(c==null)c=this.object;this.listeners[a].push({obj:c,func:d})}},registerPriority:function(a,b,d){if(d!=null){if(b==null)b=this.object;a=this.listeners[a];a!=null&&a.unshift({obj:b,func:d})}},un:function(a){for(var b in a)b!="scope"&&this.unregister(b,a.scope,a[b])},unregister:function(a,b,d){if(b==null)b=this.object;a=this.listeners[a];if(a!=null)for(var f=
0,e=a.length;f<e;f++)if(a[f].obj==b&&a[f].func==d){a.splice(f,1);break}},remove:function(a){this.listeners[a]!=null&&(this.listeners[a]=[])},triggerEvent:function(a,c){var d=this.listeners[a];if(d&&d.length!=0){c==null&&(c={});c.object=this.object;c.element=this.element;if(!c.type)c.type=a;for(var d=d.slice(),f,e=0,g=d.length;e<g;e++)if(f=d[e],f=f.func.apply(f.obj,[c]),f!=void 0&&f==!1)break;this.fallThrough||b.Event.stop(c,!0);return f}},handleBrowserEvent:function(a){var b=a.type,d=this.listeners[b];
if(d&&d.length!=0){if((d=a.touches)&&d[0]){for(var f=0,e=0,g=d.length,h,i=0;i<g;++i)h=d[i],f+=h.clientX,e+=h.clientY;a.clientX=f/g;a.clientY=e/g}if(this.includeXY)a.xy=this.getMousePosition(a);this.triggerEvent(b,a)}},clearMouseCache:function(){this.element.scrolls=null;this.element.lefttop=null;var a=document.body;if(a&&(!(a.scrollTop!=0||a.scrollLeft!=0)||!navigator.userAgent.match(/iPhone/i)))this.element.offsets=null},getMousePosition:function(a){if(this.includeXY){if(!this.element.hasScrollEvent)b.Event.observe(window,
"scroll",this.clearMouseListener),this.element.hasScrollEvent=!0}else this.clearMouseCache();if(!this.element.scrolls){var c=b.Util.getViewportElement();this.element.scrolls=[c.scrollLeft,c.scrollTop]}if(!this.element.lefttop)this.element.lefttop=[document.documentElement.clientLeft||0,document.documentElement.clientTop||0];if(!this.element.offsets)this.element.offsets=b.Util.pagePosition(this.element);return new b.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"});b.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"),c=0,d=a.length;c<d;++c)if(a[c].src.indexOf("firebug.js")!=-1&&console){b.Util.extend(b.Console,console);break}})();b.Renderer=b.Class({container:null,root:null,extent:null,locked:!1,size:null,resolution:null,map:null,initialize:function(a,c){this.container=b.Util.getElement(a);b.Util.extend(this,c)},destroy:function(){this.map=this.resolution=this.size=this.extent=this.container=null},supported:function(){return!1},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 d=a.geometry.getBounds();if(d){d.intersectsBounds(this.extent)||(b={display:"none"});d=this.drawGeometry(a.geometry,b,a.id);if(b.display!="none"&&b.label&&d!==!1){var f=a.geometry.getCentroid();if(b.labelXOffset||b.labelYOffset){var e=
isNaN(b.labelXOffset)?0:b.labelXOffset,g=isNaN(b.labelYOffset)?0:b.labelYOffset,h=this.getResolution();f.move(e*h,g*h)}this.drawText(a.id,b,f)}else this.removeText(a.id);return d}}},drawGeometry:function(){},drawText:function(){},removeText:function(){},clear:function(){},getFeatureIdFromEvent:function(){},eraseFeatures:function(a){b.Util.isArray(a)||(a=[a]);for(var c=0,d=a.length;c<d;++c){var f=a[c];this.eraseGeometry(f.geometry,f.id);this.removeText(f.id)}},eraseGeometry:function(){},moveRoot:function(){},
getRenderLayerId:function(){return this.container.id},applyDefaultSymbolizer:function(a){var c=b.Util.extend({},b.Renderer.defaultSymbolizer);a.stroke===!1&&(delete c.strokeWidth,delete c.strokeColor);a.fill===!1&&delete c.fillColor;b.Util.extend(c,a);return c},CLASS_NAME:"OpenLayers.Renderer"});b.Renderer.defaultSymbolizer={fillColor:"#000000",strokeColor:"#000000",strokeWidth:2,fillOpacity:1,strokeOpacity:1,pointRadius:0};b.Request={DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:!0,
user:void 0,password:void 0,params:null,proxy:b.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},URL_SPLIT_REGEX:/([^:]*:)\/\/([^:]*:?[^@]*@)?([^:\/\?]*):?([^\/\?]*)/,events:new b.Events(this,null,["complete","success","failure"]),issue:function(a){var c=b.Util.extend(this.DEFAULT_CONFIG,{proxy:b.ProxyHost}),a=b.Util.applyDefaults(a,c),d=new b.Request.XMLHttpRequest,f=b.Util.urlAppend(a.url,b.Util.getParameterString(a.params||{})),c=f.indexOf("http")!=0,e=
!c&&f.match(this.URL_SPLIT_REGEX);if(e){var g=window.location,c=e[1]==g.protocol&&e[3]==g.hostname,e=e[4],g=g.port;if(e!=80&&e!=""||g!="80"&&g!="")c=c&&e==g}c||(a.proxy?f=typeof a.proxy=="function"?a.proxy(f):a.proxy+encodeURIComponent(f):b.Console.warn(b.i18n("proxyNeeded"),{url:f}));d.open(a.method,f,a.async,a.user,a.password);for(var h in a.headers)d.setRequestHeader(h,a.headers[h]);var i=this.events,k=this;d.onreadystatechange=function(){d.readyState==b.Request.XMLHttpRequest.DONE&&i.triggerEvent("complete",
{request:d,config:a,requestUrl:f})!==!1&&k.runCallbacks({request:d,config:a,requestUrl:f})};a.async===!1?d.send(a.data):window.setTimeout(function(){d.readyState!==0&&d.send(a.data)},0);return d},runCallbacks:function(a){var c=a.request,d=a.config,f=d.scope?b.Function.bind(d.callback,d.scope):d.callback,e;d.success&&(e=d.scope?b.Function.bind(d.success,d.scope):d.success);var g;d.failure&&(g=d.scope?b.Function.bind(d.failure,d.scope):d.failure);if(b.Util.createUrlObject(d.url).protocol=="file:"&&
c.responseText)c.status=200;f(c);if(!c.status||c.status>=200&&c.status<300)this.events.triggerEvent("success",a),e&&e(c);if(c.status&&(c.status<200||c.status>=300))this.events.triggerEvent("failure",a),g&&g(c)},GET:function(a){a=b.Util.extend(a,{method:"GET"});return b.Request.issue(a)},POST:function(a){a=b.Util.extend(a,{method:"POST"});a.headers=a.headers?a.headers:{};"CONTENT-TYPE"in b.Util.upperCaseObject(a.headers)||(a.headers["Content-Type"]="application/xml");return b.Request.issue(a)},PUT:function(a){a=
b.Util.extend(a,{method:"PUT"});a.headers=a.headers?a.headers:{};"CONTENT-TYPE"in b.Util.upperCaseObject(a.headers)||(a.headers["Content-Type"]="application/xml");return b.Request.issue(a)},DELETE:function(a){a=b.Util.extend(a,{method:"DELETE"});return b.Request.issue(a)},HEAD:function(a){a=b.Util.extend(a,{method:"HEAD"});return b.Request.issue(a)},OPTIONS:function(a){a=b.Util.extend(a,{method:"OPTIONS"});return b.Request.issue(a)}};b.Control=b.Class({id:null,map:null,div:null,type:null,allowSelection:!1,
displayClass:"",title:"",autoActivate:!1,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,"");b.Util.extend(this,a);this.events=new b.Events(this,null,this.EVENT_TYPES);if(this.eventListeners instanceof Object)this.events.on(this.eventListeners);if(this.id==null)this.id=b.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;this.div=null},setMap:function(a){this.map=a;this.handler&&this.handler.setMap(a)},draw:function(a){if(this.div==null){this.div=
b.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=b.Function.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!1;this.handler&&this.handler.activate();
this.active=!0;this.map&&b.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active");this.events.triggerEvent("activate");return!0},deactivate:function(){if(this.active)return this.handler&&this.handler.deactivate(),this.active=!1,this.map&&b.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active"),this.events.triggerEvent("deactivate"),!0;return!1},CLASS_NAME:"OpenLayers.Control"});b.Control.TYPE_BUTTON=1;b.Control.TYPE_TOGGLE=2;b.Control.TYPE_TOOL=
3;(function(){function a(){this._object=g&&!k?new g:new window.ActiveXObject("Microsoft.XMLHTTP");this._listeners=[]}function c(){return new a}function d(a){c.onreadystatechange&&c.onreadystatechange.apply(a);a.dispatchEvent({type:"readystatechange",bubbles:!1,cancelable:!1,timeStamp:new Date+0})}function f(a){try{a.responseText=a._object.responseText}catch(b){}try{var e;var c=a._object,d=c.responseXML,g=c.responseText;if(i&&g&&d&&!d.documentElement&&c.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/))d=
new window.ActiveXObject("Microsoft.XMLDOM"),d.async=!1,d.validateOnParse=!1,d.loadXML(g);e=d&&(i&&d.parseError!=0||!d.documentElement||d.documentElement&&d.documentElement.tagName=="parsererror")?null:d;a.responseXML=e}catch(h){}try{a.status=a._object.status}catch(f){}try{a.statusText=a._object.statusText}catch(k){}}function e(a){a._object.onreadystatechange=new window.Function}var g=window.XMLHttpRequest,h=!!window.controllers,i=window.document.all&&!window.opera,k=i&&window.navigator.userAgent.match(/MSIE 7.0/);
c.prototype=a.prototype;if(h&&g.wrapped)c.wrapped=g.wrapped;c.UNSENT=0;c.OPENED=1;c.HEADERS_RECEIVED=2;c.LOADING=3;c.DONE=4;c.prototype.readyState=c.UNSENT;c.prototype.responseText="";c.prototype.responseXML=null;c.prototype.status=0;c.prototype.statusText="";c.prototype.priority="NORMAL";c.prototype.onreadystatechange=null;c.onreadystatechange=null;c.onopen=null;c.onsend=null;c.onabort=null;c.prototype.open=function(a,b,g,k,o){delete this._headers;arguments.length<3&&(g=!0);this._async=g;var p=this,
t=this.readyState,s;i&&g&&(s=function(){t!=c.DONE&&(e(p),p.abort())},window.attachEvent("onunload",s));c.onopen&&c.onopen.apply(this,arguments);arguments.length>4?this._object.open(a,b,g,k,o):arguments.length>3?this._object.open(a,b,g,k):this._object.open(a,b,g);this.readyState=c.OPENED;d(this);this._object.onreadystatechange=function(){if(!h||g)p.readyState=p._object.readyState,f(p),p._aborted?p.readyState=c.UNSENT:(p.readyState==c.DONE&&(delete p._data,e(p),i&&g&&window.detachEvent("onunload",s)),
t!=p.readyState&&d(p),t=p.readyState)}};c.prototype.send=function(a){c.onsend&&c.onsend.apply(this,arguments);arguments.length||(a=null);a&&a.nodeType&&(a=window.XMLSerializer?(new window.XMLSerializer).serializeToString(a):a.xml,oRequest._headers["Content-Type"]||oRequest._object.setRequestHeader("Content-Type","application/xml"));this._data=a;this._object.send(this._data);if(h&&!this._async){this.readyState=c.OPENED;for(f(this);this.readyState<c.DONE;)if(this.readyState++,d(this),this._aborted)break}};
c.prototype.abort=function(){c.onabort&&c.onabort.apply(this,arguments);if(this.readyState>c.UNSENT)this._aborted=!0;this._object.abort();e(this);this.readyState=c.UNSENT;delete this._data};c.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};c.prototype.getResponseHeader=function(a){return this._object.getResponseHeader(a)};c.prototype.setRequestHeader=function(a,b){if(!this._headers)this._headers={};this._headers[a]=b;return this._object.setRequestHeader(a,b)};
c.prototype.addEventListener=function(a,b,e){for(var c=0,d;d=this._listeners[c];c++)if(d[0]==a&&d[1]==b&&d[2]==e)return;this._listeners.push([a,b,e])};c.prototype.removeEventListener=function(a,b,e){for(var c=0,d;d=this._listeners[c];c++)if(d[0]==a&&d[1]==b&&d[2]==e)break;d&&this._listeners.splice(c,1)};c.prototype.dispatchEvent=function(a){a={type:a.type,target:this,currentTarget:this,eventPhase:2,bubbles:a.bubbles,cancelable:a.cancelable,timeStamp:a.timeStamp,stopPropagation:function(){},preventDefault:function(){},
initEvent:function(){}};a.type=="readystatechange"&&this.onreadystatechange&&(this.onreadystatechange.handleEvent||this.onreadystatechange).apply(this,[a]);for(var b=0,e;e=this._listeners[b];b++)e[0]==a.type&&!e[2]&&(e[1].handleEvent||e[1]).apply(this,[a])};c.prototype.toString=function(){return"[object XMLHttpRequest]"};c.toString=function(){return"[XMLHttpRequest]"};if(!window.Function.prototype.apply)window.Function.prototype.apply=function(a,b){b||(b=[]);a.__func=this;a.__func(b[0],b[1],b[2],
b[3],b[4]);delete a.__func};b.Request.XMLHttpRequest=c})();b.LonLat=b.Class({lon:0,lat:0,initialize:function(a,c){this.lon=b.Util.toFloat(a);this.lat=b.Util.toFloat(c)},toString:function(){return"lon="+this.lon+",lat="+this.lat},toShortString:function(){return this.lon+", "+this.lat},clone:function(){return new b.LonLat(this.lon,this.lat)},add:function(a,c){if(a==null||c==null){var d=b.i18n("lonlatAddError");b.Console.error(d);return null}return new b.LonLat(this.lon+b.Util.toFloat(a),this.lat+b.Util.toFloat(c))},
equals:function(a){var b=!1;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,c){var d=b.Projection.transform({x:this.lon,y:this.lat},a,c);this.lon=d.x;this.lat=d.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"});b.LonLat.fromString=function(a){a=a.split(",");return new b.LonLat(a[0],
a[1])};b.LonLat.fromArray=function(a){var c=b.Util.isArray(a);return new b.LonLat(c&&a[0],c&&a[1])};b.Element={visible:function(a){return b.Util.getElement(a).style.display!="none"},toggle:function(){for(var a=0,c=arguments.length;a<c;a++){var d=b.Util.getElement(arguments[a]),f=b.Element.visible(d)?"hide":"show";b.Element[f](d)}},hide:function(){b.Console.warn(b.i18n("methodDeprecated",{newMethod:"element.style.display = 'none';"}));for(var a=0,c=arguments.length;a<c;a++){var d=b.Util.getElement(arguments[a]);
if(d)d.style.display="none"}},show:function(){b.Console.warn(b.i18n("methodDeprecated",{newMethod:"element.style.display = '';"}));for(var a=0,c=arguments.length;a<c;a++){var d=b.Util.getElement(arguments[a]);if(d)d.style.display=""}},remove:function(a){a=b.Util.getElement(a);a.parentNode.removeChild(a)},getHeight:function(a){a=b.Util.getElement(a);return a.offsetHeight},getDimensions:function(a){a=b.Util.getElement(a);if(b.Element.getStyle(a,"display")!="none")return{width:a.offsetWidth,height:a.offsetHeight};
var c=a.style,d=c.visibility,f=c.position,e=c.display;c.visibility="hidden";c.position="absolute";c.display="";var g=a.clientWidth,a=a.clientHeight;c.display=e;c.position=f;c.visibility=d;return{width:g,height:a}},hasClass:function(a,b){var d=a.className;return!!d&&RegExp("(^|\\s)"+b+"(\\s|$)").test(d)},addClass:function(a,c){b.Element.hasClass(a,c)||(a.className+=(a.className?" ":"")+c);return a},removeClass:function(a,c){var d=a.className;if(d)a.className=b.String.trim(d.replace(RegExp("(^|\\s+)"+
c+"(\\s+|$)")," "));return a},toggleClass:function(a,c){b.Element.hasClass(a,c)?b.Element.removeClass(a,c):b.Element.addClass(a,c);return a},getStyle:function(a,c){var a=b.Util.getElement(a),d=null;if(a&&a.style){d=a.style[b.String.camelize(c)];d||(document.defaultView&&document.defaultView.getComputedStyle?d=(d=document.defaultView.getComputedStyle(a,null))?d.getPropertyValue(c):null:a.currentStyle&&(d=a.currentStyle[b.String.camelize(c)]));var f=["left","top","right","bottom"];window.opera&&b.Util.indexOf(f,
c)!=-1&&b.Element.getStyle(a,"position")=="static"&&(d="auto")}return d=="auto"?null:d}};b.Bounds=b.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(a,c,d,f){if(a!=null)this.left=b.Util.toFloat(a);if(c!=null)this.bottom=b.Util.toFloat(c);if(d!=null)this.right=b.Util.toFloat(d);if(f!=null)this.top=b.Util.toFloat(f)},clone:function(){return new b.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(a){var b=!1;a!=null&&(b=this.left==a.left&&this.right==
a.right&&this.top==a.top&&this.bottom==a.bottom);return b},toString:function(){return[this.left,this.bottom,this.right,this.top].join(",")},toArray:function(a){return a===!0?[this.bottom,this.left,this.top,this.right]:[this.left,this.bottom,this.right,this.top]},toBBOX:function(a,b){a==null&&(a=6);var d=Math.pow(10,a),f=Math.round(this.left*d)/d,e=Math.round(this.bottom*d)/d,g=Math.round(this.right*d)/d,d=Math.round(this.top*d)/d;return b===!0?e+","+f+","+d+","+g:f+","+e+","+g+","+d},toGeometry:function(){return new b.Geometry.Polygon([new b.Geometry.LinearRing([new b.Geometry.Point(this.left,
this.bottom),new b.Geometry.Point(this.right,this.bottom),new b.Geometry.Point(this.right,this.top),new b.Geometry.Point(this.left,this.top)])])},getWidth:function(){return this.right-this.left},getHeight:function(){return this.top-this.bottom},getSize:function(){return new b.Size(this.getWidth(),this.getHeight())},getCenterPixel:function(){return new b.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)},getCenterLonLat:function(){if(!this.centerLonLat)this.centerLonLat=new b.LonLat((this.left+
this.right)/2,(this.bottom+this.top)/2);return this.centerLonLat},scale:function(a,c){c==null&&(c=this.getCenterLonLat());var d,f;c.CLASS_NAME=="OpenLayers.LonLat"?(d=c.lon,f=c.lat):(d=c.x,f=c.y);return new b.Bounds((this.left-d)*a+d,(this.bottom-f)*a+f,(this.right-d)*a+d,(this.top-f)*a+f)},add:function(a,c){if(a==null||c==null){var d=b.i18n("boundsAddError");b.Console.error(d);return null}return new b.Bounds(this.left+a,this.bottom+c,this.right+a,this.top+c)},extend:function(a){var c=null;if(a){switch(a.CLASS_NAME){case "OpenLayers.LonLat":c=
new b.Bounds(a.lon,a.lat,a.lon,a.lat);break;case "OpenLayers.Geometry.Point":c=new b.Bounds(a.x,a.y,a.x,a.y);break;case "OpenLayers.Bounds":c=a}if(c){this.centerLonLat=null;if(this.left==null||c.left<this.left)this.left=c.left;if(this.bottom==null||c.bottom<this.bottom)this.bottom=c.bottom;if(this.right==null||c.right>this.right)this.right=c.right;if(this.top==null||c.top>this.top)this.top=c.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,c,d){d==null&&(d=!0);if(a==null||c==null)return!1;var a=b.Util.toFloat(a),c=b.Util.toFloat(c),f=!1;return f=d?a>=this.left&&a<=this.right&&c>=this.bottom&&c<=this.top:a>this.left&&a<this.right&&c>this.bottom&&c<this.top},intersectsBounds:function(a,b){b==null&&(b=!0);var d=!1,f=this.left==a.right||this.right==a.left||this.top==a.bottom||this.bottom==a.top;if(b||!f)var d=a.top>=this.bottom&&a.top<=this.top||this.top>a.bottom&&this.top<a.top,f=a.left>=this.left&&a.left<=
this.right||this.left>=a.left&&this.left<=a.right,e=a.right>=this.left&&a.right<=this.right||this.right>=a.left&&this.right<=a.right,d=(a.bottom>=this.bottom&&a.bottom<=this.top||this.bottom>=a.bottom&&this.bottom<=a.top||d)&&(f||e);return d},containsBounds:function(a,b,d){b==null&&(b=!1);d==null&&(d=!0);var f=this.contains(a.left,a.bottom,d),e=this.contains(a.right,a.bottom,d),g=this.contains(a.left,a.top,d),a=this.contains(a.right,a.top,d);return b?f||e||g||a:f&&e&&g&&a},determineQuadrant:function(a){var b=
"",d=this.getCenterLonLat();b+=a.lat<d.lat?"b":"t";b+=a.lon<d.lon?"l":"r";return b},transform:function(a,c){this.centerLonLat=null;var d=b.Projection.transform({x:this.left,y:this.bottom},a,c),f=b.Projection.transform({x:this.right,y:this.bottom},a,c),e=b.Projection.transform({x:this.left,y:this.top},a,c),g=b.Projection.transform({x:this.right,y:this.top},a,c);this.left=Math.min(d.x,e.x);this.bottom=Math.min(d.y,f.y);this.right=Math.max(f.x,g.x);this.top=Math.max(e.y,g.y);return this},wrapDateLine:function(a,
b){var b=b||{},d=b.leftTolerance||0,f=b.rightTolerance||0,e=this.clone();if(a){for(;e.left<a.left&&e.right-f<=a.left;)e=e.add(a.getWidth(),0);for(;e.left+d>=a.right&&e.right>a.right;)e=e.add(-a.getWidth(),0)}return e},CLASS_NAME:"OpenLayers.Bounds"});b.Bounds.fromString=function(a,c){var d=a.split(",");return b.Bounds.fromArray(d,c)};b.Bounds.fromArray=function(a,c){return c===!0?new b.Bounds(parseFloat(a[1]),parseFloat(a[0]),parseFloat(a[3]),parseFloat(a[2])):new b.Bounds(parseFloat(a[0]),parseFloat(a[1]),
parseFloat(a[2]),parseFloat(a[3]))};b.Bounds.fromSize=function(a){return new b.Bounds(0,a.h,a.w,0)};b.Bounds.oppositeQuadrant=function(a){var b="";b+=a.charAt(0)=="t"?"b":"t";b+=a.charAt(1)=="l"?"r":"l";return b};b.Size=b.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 b.Size(this.w,this.h)},equals:function(a){var b=!1;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"});b.Pixel=b.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 b.Pixel(this.x,this.y)},equals:function(a){var b=!1;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},distanceTo:function(a){return Math.sqrt(Math.pow(this.x-a.x,2)+Math.pow(this.y-a.y,2))},add:function(a,c){if(a==
null||c==null){var d=b.i18n("pixelAddError");b.Console.error(d);return null}return new b.Pixel(this.x+a,this.y+c)},offset:function(a){var b=this.clone();a&&(b=this.add(a.x,a.y));return b},CLASS_NAME:"OpenLayers.Pixel"});b.Tile=b.Class({EVENT_TYPES:["loadstart","loadend","reload","unload"],events:null,id:null,layer:null,url:null,bounds:null,size:null,position:null,isLoading:!1,initialize:function(a,c,d,f,e,g){this.layer=a;this.position=c.clone();this.bounds=d.clone();this.url=f;if(e)this.size=e.clone();
this.id=b.Util.createUniqueID("Tile_");this.events=new b.Events(this,null,this.EVENT_TYPES);b.Util.extend(this,g)},unload:function(){if(this.isLoading)this.isLoading=!1,this.events.triggerEvent("unload")},destroy:function(){this.position=this.size=this.bounds=this.layer=null;this.events.destroy();this.events=null},clone:function(a){a==null&&(a=new b.Tile(this.layer,this.position,this.bounds,this.url,this.size));b.Util.applyDefaults(a,this);return a},draw:function(){var a=this.layer.maxExtent;this.shouldDraw=
a&&this.bounds.intersectsBounds(a,!1)||this.layer.displayOutsideMaxExtent;this.clear();return this.shouldDraw},moveTo:function(a,b,d){d==null&&(d=!0);this.bounds=a.clone();this.position=b.clone();d&&this.draw()},clear:function(){},getBoundsFromBaseLayer:function(a){var c=b.i18n("reprojectDeprecated",{layerName:this.layer.name});b.Console.warn(c);c=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(c.lon>a.lon)c.lon<0?c.lon=
-180-(c.lon+180):a.lon=180+a.lon+180;return new b.Bounds(c.lon,a.lat,a.lon,c.lat)},showTile:function(){this.shouldDraw&&this.show()},show:function(){},hide:function(){},CLASS_NAME:"OpenLayers.Tile"});b.Tile.Image=b.Class(b.Tile,{url:null,imgDiv:null,frame:null,layerAlphaHack:null,isBackBuffer:!1,isFirstDraw:!0,backBufferTile:null,maxGetUrlLength:null,initialize:function(a,c,d,f){b.Tile.prototype.initialize.apply(this,arguments);this.maxGetUrlLength!=null&&b.Util.extend(this,b.Tile.Image.IFrame);this.url=
f;this.frame=document.createElement("div");this.frame.style.overflow="hidden";this.frame.style.position="absolute";this.layerAlphaHack=this.layer.alpha&&b.Util.alphaHack()},destroy:function(){this.imgDiv!=null&&this.removeImgDiv();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);
b.Tile.prototype.destroy.apply(this,arguments)},clone:function(a){a==null&&(a=new b.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size));a=b.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=b.Tile.prototype.draw.apply(this,arguments);if(b.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1||this.layer.singleTile)if(a){if(!this.backBufferTile)this.backBufferTile=
this.clone(),this.backBufferTile.hide(),this.backBufferTile.isBackBuffer=!0,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=!1;if(!a)return!1;this.isLoading?this.events.triggerEvent("reload"):(this.isLoading=!0,this.events.triggerEvent("loadstart"));return this.renderTile()},
resetBackBuffer:function(){this.showTile();if(this.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)){this.isFirstDraw=!1;var a=this.layer.maxExtent;if(a&&this.bounds.intersectsBounds(a,!1))this.backBufferTile.position=this.position,this.backBufferTile.bounds=this.bounds,this.backBufferTile.size=this.size,this.backBufferTile.imageSize=this.layer.getImageSize(this.bounds)||this.size,this.backBufferTile.imageOffset=this.layer.imageOffset,this.backBufferTile.resolution=this.layer.getResolution(),
this.backBufferTile.renderTile();this.backBufferTile.hide()}},renderTile:function(){this.layer.async?(this.initImgDiv(),this.layer.getURLasync(this.bounds,this,"url",this.positionImage)):(this.url=this.layer.getURL(this.bounds),this.initImgDiv(),this.positionImage());return!0},positionImage:function(){if(this.layer!==null){b.Util.modifyDOMElement(this.frame,null,this.position,this.size);var a=this.layer.getImageSize(this.bounds);this.layerAlphaHack?b.Util.modifyAlphaImageDiv(this.imgDiv,null,null,
a,this.url):(b.Util.modifyDOMElement(this.imgDiv,null,null,a),this.imgDiv.src=this.url)}},clear:function(){if(this.imgDiv&&(this.hide(),b.Tile.Image.useBlankTile))this.imgDiv.src=b.Util.getImagesLocation()+"blank.gif"},initImgDiv:function(){if(this.imgDiv==null){var a=this.layer.imageOffset,c=this.layer.getImageSize(this.bounds);this.imgDiv=this.layerAlphaHack?b.Util.createAlphaImageDiv(null,a,c,null,"relative",null,null,null,!0):b.Util.createImage(null,a,c,null,"relative",null,null,!0);if(b.Util.isArray(this.layer.url))this.imgDiv.urls=
this.layer.url.slice();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&&b.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity);this.imgDiv.map=this.layer.map;var d=function(){if(this.isLoading)this.isLoading=!1,this.events.triggerEvent("loadend")};this.layerAlphaHack?b.Event.observe(this.imgDiv.childNodes[0],"load",b.Function.bind(d,this)):
b.Event.observe(this.imgDiv,"load",b.Function.bind(d,this));b.Event.observe(this.imgDiv,"error",b.Function.bind(function(){this.imgDiv._attempts>b.IMAGE_RELOAD_ATTEMPTS&&d.call(this)},this))}this.imgDiv.viewRequestID=this.layer.map.viewRequestID},removeImgDiv:function(){b.Event.stopObservingElement(this.imgDiv);if(this.imgDiv.parentNode==this.frame)this.frame.removeChild(this.imgDiv),this.imgDiv.map=null;this.imgDiv.urls=null;var a=this.imgDiv.firstChild;a?(b.Event.stopObservingElement(a),this.imgDiv.removeChild(a),
delete a):this.imgDiv.src=b.Util.getImagesLocation()+"blank.gif"},checkImgURL:function(){this.layer&&(b.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;this.backBufferTile.resolution&&(a=this.backBufferTile.resolution/this.layer.getResolution());if(a!=1){if(this.layer.transitionEffect=="resize"){var c=new b.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top),
d=new b.Size(this.backBufferTile.size.w*a,this.backBufferTile.size.h*a),c=this.layer.map.getLayerPxFromLonLat(c);b.Util.modifyDOMElement(this.backBufferTile.frame,null,c,d);d=this.backBufferTile.imageSize;d=new b.Size(d.w*a,d.h*a);(c=this.backBufferTile.imageOffset)&&(c=new b.Pixel(c.x*a,c.y*a));b.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,c,d);this.backBufferTile.show()}}else this.layer.singleTile?this.backBufferTile.show():this.backBufferTile.hide()}},show:function(){this.frame.style.display=
"";if(b.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1&&b.IS_GECKO===!0)this.frame.scrollLeft=this.frame.scrollLeft},hide:function(){this.frame.style.display="none"},CLASS_NAME:"OpenLayers.Tile.Image"});b.Tile.Image.useBlankTile=b.BROWSER_NAME=="safari"||b.BROWSER_NAME=="opera";b.Handler=b.Class({id:null,control:null,map:null,keyMask:null,active:!1,evt:null,initialize:function(a,c,d){b.Util.extend(this,d);this.control=a;this.callbacks=c;(a=this.map||a.map)&&this.setMap(a);
this.id=b.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(a){this.map=a},checkModifiers:function(a){if(this.keyMask==null)return!0;return((a.shiftKey?b.Handler.MOD_SHIFT:0)|(a.ctrlKey?b.Handler.MOD_CTRL:0)|(a.altKey?b.Handler.MOD_ALT:0))==this.keyMask},activate:function(){if(this.active)return!1;for(var a=b.Events.prototype.BROWSER_EVENTS,c=0,d=a.length;c<d;c++)this[a[c]]&&this.register(a[c],this[a[c]]);return this.active=!0},deactivate:function(){if(!this.active)return!1;for(var a=b.Events.prototype.BROWSER_EVENTS,
c=0,d=a.length;c<d;c++)this[a[c]]&&this.unregister(a[c],this[a[c]]);this.active=!1;return!0},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!0},destroy:function(){this.deactivate();this.control=
this.map=null},CLASS_NAME:"OpenLayers.Handler"});b.Handler.MOD_NONE=0;b.Handler.MOD_SHIFT=1;b.Handler.MOD_CTRL=2;b.Handler.MOD_ALT=4;b.Lang={code:null,defaultCode:"en",getCode:function(){b.Lang.code||b.Lang.setCode();return b.Lang.code},setCode:function(a){var c;a||(a=b.BROWSER_NAME=="msie"?navigator.userLanguage:navigator.language);a=a.split("-");a[0]=a[0].toLowerCase();typeof b.Lang[a[0]]=="object"&&(c=a[0]);if(a[1]){var d=a[0]+"-"+a[1].toUpperCase();typeof b.Lang[d]=="object"&&(c=d)}if(!c)b.Console.warn("Failed to find OpenLayers.Lang."+
a.join("-")+" dictionary, falling back to default language"),c=b.Lang.defaultCode;b.Lang.code=c},translate:function(a,c){var d=b.Lang[b.Lang.getCode()];(d=d&&d[a])||(d=a);c&&(d=b.String.format(d,c));return d}};b.i18n=b.Lang.translate;b.Handler.Drag=b.Class(b.Handler,{started:!1,stopDown:!0,dragging:!1,touch:!1,last:null,start:null,lastMoveEvt:null,oldOnselectstart:null,interval:0,timeoutId:null,documentDrag:!1,documentEvents:null,initialize:function(){b.Handler.prototype.initialize.apply(this,arguments);
if(this.documentDrag===!0){var a=this;this._docMove=function(b){a.mousemove({xy:{x:b.clientX,y:b.clientY},element:document})};this._docUp=function(b){a.mouseup({xy:{x:b.clientX,y:b.clientY}})}}},dragstart:function(a){var c=!0;this.dragging=!1;if(this.checkModifiers(a)&&(b.Event.isLeftClick(a)||b.Event.isSingleTouch(a))){this.started=!0;this.last=this.start=a.xy;b.Element.addClass(this.map.viewPortDiv,"olDragDown");this.down(a);this.callback("down",[a.xy]);b.Event.stop(a);if(!this.oldOnselectstart)this.oldOnselectstart=
document.onselectstart?document.onselectstart:b.Function.True;document.onselectstart=b.Function.False;c=!this.stopDown}else this.started=!1,this.last=this.start=null;return c},dragmove:function(a){this.lastMoveEvt=a;if(this.started&&!this.timeoutId&&(a.xy.x!=this.last.x||a.xy.y!=this.last.y)){this.documentDrag===!0&&this.documentEvents&&(a.element===document?(this.adjustXY(a),this.setEvent(a)):this.removeDocumentEvents());if(this.interval>0)this.timeoutId=setTimeout(b.Function.bind(this.removeTimeout,
this),this.interval);this.dragging=!0;this.move(a);this.callback("move",[a.xy]);if(!this.oldOnselectstart)this.oldOnselectstart=document.onselectstart,document.onselectstart=b.Function.False;this.last=a.xy}return!0},dragend:function(a){if(this.started){this.documentDrag===!0&&this.documentEvents&&(this.adjustXY(a),this.removeDocumentEvents());var c=this.start!=this.last;this.dragging=this.started=!1;b.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.up(a);this.callback("up",[a.xy]);c&&
this.callback("done",[a.xy]);document.onselectstart=this.oldOnselectstart}return!0},down:function(){},move:function(){},up:function(){},out:function(){},mousedown:function(a){return this.dragstart(a)},touchstart:function(a){if(!this.touch)this.touch=!0,this.map.events.un({mousedown:this.mousedown,mouseup:this.mouseup,mousemove:this.mousemove,click:this.click,scope:this});return this.dragstart(a)},mousemove:function(a){return this.dragmove(a)},touchmove:function(a){return this.dragmove(a)},removeTimeout:function(){this.timeoutId=
null;this.dragging&&this.mousemove(this.lastMoveEvt)},mouseup:function(a){return this.dragend(a)},touchend:function(a){a.xy=this.last;return this.dragend(a)},mouseout:function(a){if(this.started&&b.Util.mouseLeft(a,this.map.eventsDiv))if(this.documentDrag===!0)this.addDocumentEvents();else{var c=this.start!=this.last;this.dragging=this.started=!1;b.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.out(a);this.callback("out",[]);c&&this.callback("done",[a.xy]);if(document.onselectstart)document.onselectstart=
this.oldOnselectstart}return!0},click:function(){return this.start==this.last},activate:function(){var a=!1;if(b.Handler.prototype.activate.apply(this,arguments))this.dragging=!1,a=!0;return a},deactivate:function(){var a=!1;if(b.Handler.prototype.deactivate.apply(this,arguments))this.dragging=this.started=this.touch=!1,this.last=this.start=null,a=!0,b.Element.removeClass(this.map.viewPortDiv,"olDragDown");return a},adjustXY:function(a){var c=b.Util.pagePosition(this.map.viewPortDiv);a.xy.x-=c[0];
a.xy.y-=c[1]},addDocumentEvents:function(){b.Element.addClass(document.body,"olDragDown");this.documentEvents=!0;b.Event.observe(document,"mousemove",this._docMove);b.Event.observe(document,"mouseup",this._docUp)},removeDocumentEvents:function(){b.Element.removeClass(document.body,"olDragDown");this.documentEvents=!1;b.Event.stopObserving(document,"mousemove",this._docMove);b.Event.stopObserving(document,"mouseup",this._docUp)},CLASS_NAME:"OpenLayers.Handler.Drag"});b.Handler.Keyboard=b.Class(b.Handler,
{KEY_EVENTS:["keydown","keyup"],eventListener:null,initialize:function(){b.Handler.prototype.initialize.apply(this,arguments);this.eventListener=b.Function.bindAsEventListener(this.handleKeyEvent,this)},destroy:function(){this.deactivate();this.eventListener=null;b.Handler.prototype.destroy.apply(this,arguments)},activate:function(){if(b.Handler.prototype.activate.apply(this,arguments)){for(var a=0,c=this.KEY_EVENTS.length;a<c;a++)b.Event.observe(document,this.KEY_EVENTS[a],this.eventListener);return!0}else return!1},
deactivate:function(){var a=!1;if(b.Handler.prototype.deactivate.apply(this,arguments)){for(var a=0,c=this.KEY_EVENTS.length;a<c;a++)b.Event.stopObserving(document,this.KEY_EVENTS[a],this.eventListener);a=!0}return a},handleKeyEvent:function(a){this.checkModifiers(a)&&this.callback(a.type,[a])},CLASS_NAME:"OpenLayers.Handler.Keyboard"});b.Handler.Pinch=b.Class(b.Handler,{started:!1,stopDown:!1,pinching:!1,last:null,start:null,initialize:function(){b.Handler.prototype.initialize.apply(this,arguments)},
touchstart:function(a){var c=!0;this.pinching=!1;b.Event.isMultiTouch(a)?(this.started=!0,this.last=this.start={distance:this.getDistance(a.touches),delta:0,scale:1},this.callback("start",[a,this.start]),c=!this.stopDown):(this.started=!1,this.last=this.start=null);b.Event.stop(a);return c},touchmove:function(a){if(this.started&&b.Event.isMultiTouch(a)){this.pinching=!0;var c=this.getPinchData(a);this.callback("move",[a,c]);this.last=c;b.Event.stop(a)}return!0},touchend:function(a){if(this.started)this.pinching=
this.started=!1,this.callback("done",[a,this.start,this.last]),this.last=this.start=null;return!0},activate:function(){var a=!1;if(b.Handler.prototype.activate.apply(this,arguments))this.pinching=!1,a=!0;return a},deactivate:function(){var a=!1;if(b.Handler.prototype.deactivate.apply(this,arguments))this.pinching=this.started=!1,this.last=this.start=null,a=!0;return a},getDistance:function(a){var b=a[0],a=a[1];return Math.sqrt(Math.pow(b.clientX-a.clientX,2)+Math.pow(b.clientY-a.clientY,2))},getPinchData:function(a){a=
this.getDistance(a.touches);return{distance:a,delta:this.last.distance-a,scale:a/this.start.distance}},CLASS_NAME:"OpenLayers.Handler.Pinch"});b.Handler.Click=b.Class(b.Handler,{delay:300,single:!0,"double":!1,pixelTolerance:0,dblclickTolerance:13,stopSingle:!1,stopDouble:!1,timerId:null,touch:!1,down:null,last:null,first:null,rightclickTimerId:null,initialize:function(){b.Handler.prototype.initialize.apply(this,arguments)},touchstart:function(a){if(!this.touch)this.unregisterMouseListeners(),this.touch=
!0;this.down=this.getEventInfo(a);this.last=this.getEventInfo(a);return!0},touchmove:function(a){this.last=this.getEventInfo(a);return!0},touchend:function(a){if(this.down)a.xy=this.last.xy,a.lastTouches=this.last.touches,this.handleSingle(a),this.down=null;return!0},unregisterMouseListeners:function(){this.map.events.un({mousedown:this.mousedown,mouseup:this.mouseup,click:this.click,dblclick:this.dblclick,scope:this})},mousedown:function(a){this.down=this.getEventInfo(a);this.last=this.getEventInfo(a);
return!0},mouseup:function(a){var c=!0;this.checkModifiers(a)&&this.control.handleRightClicks&&b.Event.isRightClick(a)&&(c=this.rightclick(a));return c},rightclick:function(a){if(this.passesTolerance(a))if(this.rightclickTimerId!=null)return this.clearTimer(),this.callback("dblrightclick",[a]),!this.stopDouble;else a=this["double"]?b.Util.extend({},a):this.callback("rightclick",[a]),a=b.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])},click:function(a){if(!this.last)this.last=this.getEventInfo(a);this.handleSingle(a);return!this.stopSingle},dblclick:function(a){this.handleDouble(a);return!this.stopDouble},handleDouble:function(a){this["double"]&&this.passesDblclickTolerance(a)&&this.callback("dblclick",[a])},handleSingle:function(a){if(this.passesTolerance(a))this.timerId!=null?(this.last.touches&&this.last.touches.length===1&&(this["double"]&&
b.Event.stop(a),this.handleDouble(a)),(!this.last.touches||this.last.touches.length!==2)&&this.clearTimer()):(this.first=this.getEventInfo(a),this.queuePotentialClick(this.single?b.Util.extend({},a):null))},queuePotentialClick:function(a){this.timerId=window.setTimeout(b.Function.bind(this.delayedCall,this,a),this.delay)},passesTolerance:function(a){var b=!0;if(this.pixelTolerance!=null&&this.down&&this.down.xy&&(b=this.pixelTolerance>=this.down.xy.distanceTo(a.xy))&&this.touch&&this.down.touches.length===
this.last.touches.length)for(var a=0,d=this.down.touches.length;a<d;++a)if(this.getTouchDistance(this.down.touches[a],this.last.touches[a])>this.pixelTolerance){b=!1;break}return b},getTouchDistance:function(a,b){return Math.sqrt(Math.pow(a.clientX-b.clientX,2)+Math.pow(a.clientY-b.clientY,2))},passesDblclickTolerance:function(){var a=!0;this.down&&this.first&&(a=this.down.xy.distanceTo(this.first.xy)<=this.dblclickTolerance);return a},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])},getEventInfo:function(a){var b;if(a.touches){var d=a.touches.length;b=Array(d);for(var f,e=0;e<d;e++)f=a.touches[e],b[e]={clientX:f.clientX,clientY:f.clientY}}return{xy:a.xy,touches:b}},deactivate:function(){var a=!1;if(b.Handler.prototype.deactivate.apply(this,arguments))this.clearTimer(),this.last=this.first=
this.down=null,this.touch=!1,a=!0;return a},CLASS_NAME:"OpenLayers.Handler.Click"});b.Handler.MouseWheel=b.Class(b.Handler,{wheelListener:null,mousePosition:null,interval:0,delta:0,cumulative:!0,initialize:function(){b.Handler.prototype.initialize.apply(this,arguments);this.wheelListener=b.Function.bindAsEventListener(this.onWheelEvent,this)},destroy:function(){b.Handler.prototype.destroy.apply(this,arguments);this.wheelListener=null},onWheelEvent:function(a){if(this.map&&this.checkModifiers(a)){for(var c=
!1,d=!1,f=!1,e=b.Event.element(a);e!=null&&!f&&!c;){if(!c)try{var g=e.currentStyle?e.currentStyle.overflow:document.defaultView.getComputedStyle(e,null).getPropertyValue("overflow"),c=g&&g=="auto"||g=="scroll"}catch(h){}if(!d)for(var f=0,i=this.map.layers.length;f<i;f++)if(e==this.map.layers[f].div||e==this.map.layers[f].pane){d=!0;break}f=e==this.map.div;e=e.parentNode}if(!c&&f){if(d){c=0;if(!a)a=window.event;a.wheelDelta?(c=a.wheelDelta/120,window.opera&&window.opera.version()<9.2&&(c=-c)):a.detail&&
(c=-a.detail/3);this.delta+=c;this.interval?(window.clearTimeout(this._timeoutId),this._timeoutId=window.setTimeout(b.Function.bind(function(){this.wheelZoom(a)},this),this.interval)):this.wheelZoom(a)}b.Event.stop(a)}}},wheelZoom:function(a){var b=this.delta;this.delta=0;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,this.cumulative?b:-1]):this.callback("up",[a,this.cumulative?b:1])}},mousemove:function(a){this.mousePosition=
a.xy},activate:function(){if(b.Handler.prototype.activate.apply(this,arguments)){var a=this.wheelListener;b.Event.observe(window,"DOMMouseScroll",a);b.Event.observe(window,"mousewheel",a);b.Event.observe(document,"mousewheel",a);return!0}else return!1},deactivate:function(){if(b.Handler.prototype.deactivate.apply(this,arguments)){var a=this.wheelListener;b.Event.stopObserving(window,"DOMMouseScroll",a);b.Event.stopObserving(window,"mousewheel",a);b.Event.stopObserving(document,"mousewheel",a);return!0}else return!1},
CLASS_NAME:"OpenLayers.Handler.MouseWheel"});b.Handler.Box=b.Class(b.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxOffsets:null,initialize:function(){b.Handler.prototype.initialize.apply(this,arguments);this.dragHandler=new b.Handler.Drag(this,{down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox},{keyMask:this.keyMask})},destroy:function(){b.Handler.prototype.destroy.apply(this,arguments);if(this.dragHandler)this.dragHandler.destroy(),this.dragHandler=null},
setMap:function(a){b.Handler.prototype.setMap.apply(this,arguments);this.dragHandler&&this.dragHandler.setMap(a)},startBox:function(){this.callback("start",[]);this.zoomBox=b.Util.createDiv("zoomBox",new b.Pixel(-9999,-9999));this.zoomBox.className=this.boxDivClassName;this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.eventsDiv.appendChild(this.zoomBox);b.Element.addClass(this.map.eventsDiv,"olDrawBox")},moveBox:function(a){var b=this.dragHandler.start.x,d=this.dragHandler.start.y,
f=Math.abs(b-a.x),e=Math.abs(d-a.y),g=this.getBoxOffsets();this.zoomBox.style.width=f+g.width+1+"px";this.zoomBox.style.height=e+g.height+1+"px";this.zoomBox.style.left=(a.x<b?b-f-g.left:b-g.left)+"px";this.zoomBox.style.top=(a.y<d?d-e-g.top:d-g.top)+"px"},endBox:function(a){if(Math.abs(this.dragHandler.start.x-a.x)>5||Math.abs(this.dragHandler.start.y-a.y)>5)var c=this.dragHandler.start,a=new b.Bounds(Math.min(c.x,a.x),Math.max(c.y,a.y),Math.max(c.x,a.x),Math.min(c.y,a.y));else a=this.dragHandler.start.clone();
this.removeBox();this.callback("done",[a])},removeBox:function(){this.map.eventsDiv.removeChild(this.zoomBox);this.boxOffsets=this.zoomBox=null;b.Element.removeClass(this.map.eventsDiv,"olDrawBox")},activate:function(){return b.Handler.prototype.activate.apply(this,arguments)?(this.dragHandler.activate(),!0):!1},deactivate:function(){return b.Handler.prototype.deactivate.apply(this,arguments)?(this.dragHandler.deactivate()&&this.zoomBox&&this.removeBox(),!0):!1},getBoxOffsets:function(){if(!this.boxOffsets){var a=
document.createElement("div");a.style.position="absolute";a.style.border="1px solid black";a.style.width="3px";document.body.appendChild(a);var c=a.clientWidth==3;document.body.removeChild(a);var a=parseInt(b.Element.getStyle(this.zoomBox,"border-left-width")),d=parseInt(b.Element.getStyle(this.zoomBox,"border-right-width")),f=parseInt(b.Element.getStyle(this.zoomBox,"border-top-width")),e=parseInt(b.Element.getStyle(this.zoomBox,"border-bottom-width"));this.boxOffsets={left:a,right:d,top:f,bottom:e,
width:c===!1?a+d:0,height:c===!1?f+e:0}}return this.boxOffsets},CLASS_NAME:"OpenLayers.Handler.Box"});b.Handler.Feature=b.Class(b.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},touchstart:{"in":"click",out:"clickout"}},feature:null,lastFeature:null,down:null,up:null,touch:!1,clickTolerance:4,geometryTypes:null,stopClick:!0,stopDown:!0,stopUp:!1,initialize:function(a,
c,d,f){b.Handler.prototype.initialize.apply(this,[a,d,f]);this.layer=c},touchstart:function(a){if(!this.touch)this.touch=!0,this.map.events.un({mousedown:this.mousedown,mouseup:this.mouseup,mousemove:this.mousemove,click:this.click,dblclick:this.dblclick,scope:this});return b.Event.isMultiTouch(a)?!0:this.mousedown(a)},touchmove:function(a){b.Event.stop(a)},mousedown:function(a){this.down=a.xy;return this.handle(a)?!this.stopDown:!0},mouseup:function(a){this.up=a.xy;return this.handle(a)?!this.stopUp:
!0},click:function(a){return this.handle(a)?!this.stopClick:!0},mousemove:function(a){if(!this.callbacks.over&&!this.callbacks.out)return!0;this.handle(a);return!0},dblclick:function(a){return!this.handle(a)},geometryTypeMatches:function(a){return this.geometryTypes==null||b.Util.indexOf(this.geometryTypes,a.geometry.CLASS_NAME)>-1},handle:function(a){if(this.feature&&!this.feature.layer)this.feature=null;var c=a.type,d=!1,f=!!this.feature,e=c=="click"||c=="dblclick"||c=="touchstart";if((this.feature=
this.layer.getFeatureFromEvent(a))&&!this.feature.layer)this.feature=null;if(this.lastFeature&&!this.lastFeature.layer)this.lastFeature=null;this.feature?(c==="touchstart"&&b.Event.stop(a),a=this.feature!=this.lastFeature,this.geometryTypeMatches(this.feature)?(f&&a?(this.lastFeature&&this.triggerCallback(c,"out",[this.lastFeature]),this.triggerCallback(c,"in",[this.feature])):(!f||e)&&this.triggerCallback(c,"in",[this.feature]),this.lastFeature=this.feature,d=!0):(this.lastFeature&&(f&&a||e)&&this.triggerCallback(c,
"out",[this.lastFeature]),this.feature=null)):this.lastFeature&&(f||e)&&this.triggerCallback(c,"out",[this.lastFeature]);return d},triggerCallback:function(a,b,d){(b=this.EVENTMAP[a][b])&&(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,d):this.callback(b,d))},activate:function(){var a=!1;b.Handler.prototype.activate.apply(this,arguments)&&(this.moveLayerToTop(),this.map.events.on({removelayer:this.handleMapEvents,
changelayer:this.handleMapEvents,scope:this}),a=!0);return a},deactivate:function(){var a=!1;if(b.Handler.prototype.deactivate.apply(this,arguments))this.moveLayerBack(),this.up=this.down=this.lastFeature=this.feature=null,this.touch=!1,this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),a=!0;return a},handleMapEvents:function(a){(a.type=="removelayer"||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"});b.Tween=b.Class({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,interval:null,playing:!1,initialize:function(a){this.easing=a?a:b.Easing.Expo.easeOut},start:function(a,c,d,f){this.playing=!0;this.begin=a;this.finish=
c;this.duration=d;this.callbacks=f.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(b.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=!1},play:function(){var a={},c;
for(c in this.begin){var d=this.begin[c],f=this.finish[c];(d==null||f==null||isNaN(d)||isNaN(f))&&b.Console.error("invalid value for Tween");a[c]=this.easing.apply(this,[this.time,d,f-d,this.duration])}this.time++;this.callbacks&&this.callbacks.eachStep&&this.callbacks.eachStep.call(this,a);this.time>this.duration&&this.stop()},CLASS_NAME:"OpenLayers.Tween"});b.Easing={CLASS_NAME:"OpenLayers.Easing"};b.Easing.Linear={easeIn:function(a,b,d,f){return d*a/f+b},easeOut:function(a,b,d,f){return d*a/f+
b},easeInOut:function(a,b,d,f){return d*a/f+b},CLASS_NAME:"OpenLayers.Easing.Linear"};b.Easing.Expo={easeIn:function(a,b,d,f){return a==0?b:d*Math.pow(2,10*(a/f-1))+b},easeOut:function(a,b,d,f){return a==f?b+d:d*(-Math.pow(2,-10*a/f)+1)+b},easeInOut:function(a,b,d,f){if(a==0)return b;if(a==f)return b+d;if((a/=f/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},CLASS_NAME:"OpenLayers.Easing.Expo"};b.Easing.Quad={easeIn:function(a,b,d,f){return d*(a/=f)*a+b},easeOut:function(a,
b,d,f){return-d*(a/=f)*(a-2)+b},easeInOut:function(a,b,d,f){if((a/=f/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},CLASS_NAME:"OpenLayers.Easing.Quad"};b.Map=b.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1E3},EVENT_TYPES:["preaddlayer","addlayer","preremovelayer","removelayer","changelayer","movestart","move","moveend","zoomend","popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove","dragstart","drag","dragend","changebaselayer"],
id:null,fractionalZoom:!1,events:null,allOverlays:!1,div:null,dragging:!1,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:!0,panTween:null,eventListeners:null,panMethod:b.Easing.Expo.easeOut,panDuration:50,paddingForPopups:null,minPx:null,maxPx:null,initialize:function(a,c){arguments.length===1&&typeof a==="object"&&(a=(c=a)&&c.div);this.tileSize=new b.Size(b.Map.TILE_WIDTH,b.Map.TILE_HEIGHT);this.maxExtent=new b.Bounds(-180,-90,180,90);this.paddingForPopups=new b.Bounds(15,15,15,15);b.Util.extend(this,c);this.layers=[];this.id=b.Util.createUniqueID("OpenLayers.Map_");this.div=b.Util.getElement(a);if(!this.div)this.div=
document.createElement("div"),this.div.style.height="1px",this.div.style.width="1px";b.Element.addClass(this.div,"olMap");var d=this.id+"_OpenLayers_ViewPort";this.viewPortDiv=b.Util.createDiv(d,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);d=document.createElement("div");d.id=this.id+"_events";d.style.position="absolute";d.style.width="100%";d.style.height=
"100%";d.style.zIndex=this.Z_INDEX_BASE.Control-1;this.viewPortDiv.appendChild(d);this.eventsDiv=d;this.events=new b.Events(this,this.eventsDiv,this.EVENT_TYPES,this.fallThrough,{includeXY:!0});d=this.id+"_OpenLayers_Container";this.layerContainerDiv=b.Util.createDiv(d);this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1;this.eventsDiv.appendChild(this.layerContainerDiv);this.updateSize();if(this.eventListeners instanceof Object)this.events.on(this.eventListeners);this.events.register("movestart",
this,this.updateSize);b.String.contains(navigator.appName,"Microsoft")?this.events.register("resize",this,this.updateSize):(this.updateSizeDestroy=b.Function.bind(this.updateSize,this),b.Event.observe(window,"resize",this.updateSizeDestroy));if(this.theme){for(var d=!0,f=document.getElementsByTagName("link"),e=0,g=f.length;e<g;++e)if(b.Util.isEquivalentUrl(f.item(e).href,this.theme)){d=!1;break}d&&(d=document.createElement("link"),d.setAttribute("rel","stylesheet"),d.setAttribute("type","text/css"),
d.setAttribute("href",this.theme),document.getElementsByTagName("head")[0].appendChild(d))}if(this.controls==null)this.controls=b.Control!=null?[new b.Control.Navigation,new b.Control.PanZoom,new b.Control.ArgParser,new b.Control.Attribution]:[];e=0;for(g=this.controls.length;e<g;e++)this.addControlToMap(this.controls[e]);this.popups=[];this.unloadDestroy=b.Function.bind(this.destroy,this);b.Event.observe(window,"unload",this.unloadDestroy);c&&c.layers&&(delete this.center,this.addLayers(c.layers),
c.center&&this.setCenter(c.center,c.zoom))},render:function(a){this.div=b.Util.getElement(a);b.Element.addClass(this.div,"olMap");this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);this.div.appendChild(this.viewPortDiv);this.updateSize()},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy)return!1;if(this.panTween)this.panTween.stop(),this.panTween=null;b.Event.stopObserving(window,"unload",this.unloadDestroy);this.unloadDestroy=null;this.updateSizeDestroy?
b.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(!1);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){var c=this.minPx&&a.restrictedExtent!=this.restrictedExtent;b.Util.extend(this,a);c&&this.moveTo(this.getCachedCenter(),this.zoom,{forceZoomChange:!0})},getTileSize:function(){return this.tileSize},getBy:function(a,c,d){var f=typeof d.test=="function";return b.Array.filter(this[a],function(a){return a[c]==d||f&&d.test(a[c])})},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,d=0,f=this.layers.length;d<f;d++){var e=this.layers[d];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 c=0,d=this.layers.length;c<d;c++)if(this.layers[c]==a)return a=b.i18n("layerAlreadyAdded",{layerName:a.name}),b.Console.warn(a),!1;if(this.events.triggerEvent("preaddlayer",{layer:a})!==!1){if(this.allOverlays)a.isBaseLayer=!1;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);a.isBaseLayer||this.allOverlays&&!this.baseLayer?this.baseLayer==null?this.setBaseLayer(a):a.setVisibility(!1):a.redraw();this.events.triggerEvent("addlayer",{layer:a});a.events.triggerEvent("added",{map:this,layer:a});a.afterAdd()}},addLayers:function(a){for(var b=0,d=a.length;b<d;b++)this.addLayer(a[b])},removeLayer:function(a,c){if(this.events.triggerEvent("preremovelayer",{layer:a})!==!1){c==null&&(c=!0);a.isFixed?this.viewPortDiv.removeChild(a.div):this.layerContainerDiv.removeChild(a.div);
b.Util.removeItem(this.layers,a);a.removeMap(this);a.map=null;if(this.baseLayer==a&&(this.baseLayer=null,c))for(var d=0,f=this.layers.length;d<f;d++){var e=this.layers[d];if(e.isBaseLayer||this.allOverlays){this.setBaseLayer(e);break}}this.resetLayersZIndex();this.events.triggerEvent("removelayer",{layer:a});a.events.triggerEvent("removed",{map:this,layer:a})}},getNumLayers:function(){return this.layers.length},getLayerIndex:function(a){return b.Util.indexOf(this.layers,a)},setLayerIndex:function(a,
b){var d=this.getLayerIndex(a);if(b<0)b=0;else if(b>this.layers.length)b=this.layers.length;if(d!=b){this.layers.splice(d,1);this.layers.splice(b,0,a);for(var d=0,f=this.layers.length;d<f;d++)this.setLayerZIndex(this.layers[d],d);this.events.triggerEvent("changelayer",{layer:a,property:"order"});this.allOverlays&&(b===0?this.setBaseLayer(a):this.baseLayer!==this.layers[0]&&this.setBaseLayer(this.layers[0]))}},raiseLayer:function(a,b){var d=this.getLayerIndex(a)+b;this.setLayerIndex(a,d)},setBaseLayer:function(a){if(a!=
this.baseLayer&&b.Util.indexOf(this.layers,a)!=-1){var c=this.getCachedCenter(),d=b.Util.getResolutionFromScale(this.getScale(),a.units);this.baseLayer!=null&&!this.allOverlays&&this.baseLayer.setVisibility(!1);this.baseLayer=a;this.viewRequestID++;(!this.allOverlays||this.baseLayer.visibility)&&this.baseLayer.setVisibility(!0);c!=null&&(a=this.getZoomForResolution(d||this.resolution,!0),this.setCenter(c,a,!1,!0));this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}},addControl:function(a,
b){this.controls.push(a);this.addControlToMap(a,b)},addControls:function(a,b){for(var d=arguments.length===1?[]:b,f=0,e=a.length;f<e;f++)this.addControl(a[f],d[f]?d[f]:null)},addControlToMap:function(a,b){a.outsideViewport=a.div!=null;if(this.displayProjection&&!a.displayProjection)a.displayProjection=this.displayProjection;a.setMap(this);var d=a.draw(b);if(d&&!a.outsideViewport)d.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length,this.viewPortDiv.appendChild(d);a.autoActivate&&a.activate()},
getControl:function(a){for(var b=null,d=0,f=this.controls.length;d<f;d++){var e=this.controls[d];if(e.id==a){b=e;break}}return b},removeControl:function(a){a&&a==this.getControl(a.id)&&(a.div&&a.div.parentNode==this.viewPortDiv&&this.viewPortDiv.removeChild(a.div),b.Util.removeItem(this.controls,a))},addPopup:function(a,b){if(b)for(var d=this.popups.length-1;d>=0;--d)this.removePopup(this.popups[d]);a.map=this;this.popups.push(a);if(d=a.draw())d.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length,
this.layerContainerDiv.appendChild(d)},removePopup:function(a){b.Util.removeItem(this.popups,a);if(a.div)try{this.layerContainerDiv.removeChild(a.div)}catch(c){}a.map=null},getSize:function(){var a=null;this.size!=null&&(a=this.size.clone());return a},updateSize:function(){var a=this.getCurrentSize();if(a&&!isNaN(a.h)&&!isNaN(a.w)){this.events.clearMouseCache();var b=this.getSize();if(b==null)this.size=b=a;if(!a.equals(b)){this.size=a;a=0;for(b=this.layers.length;a<b;a++)this.layers[a].onMapResize();
a=this.getCachedCenter();if(this.baseLayer!=null&&a!=null)b=this.getZoom(),this.zoom=null,this.setCenter(a,b)}}},getCurrentSize:function(){var a=new b.Size(this.div.clientWidth,this.div.clientHeight);if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h))a.w=this.div.offsetWidth,a.h=this.div.offsetHeight;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,c){var d=null;a==null&&(a=this.getCachedCenter());c==null&&
(c=this.getResolution());if(a!=null&&c!=null)var f=this.getSize(),d=f.w*c,f=f.h*c,d=new b.Bounds(a.lon-d/2,a.lat-f/2,a.lon+d/2,a.lat+f/2);return d},getCenter:function(){var a=null,b=this.getCachedCenter();b&&(a=b.clone());return a},getCachedCenter:function(){if(!this.center&&this.size)this.center=this.getLonLatFromViewPortPx(new b.Pixel(this.size.w/2,this.size.h/2));return this.center},getZoom:function(){return this.zoom},pan:function(a,c,d){d=b.Util.applyDefaults(d,{animate:!0,dragging:!1});if(d.dragging)(a!=
0||c!=0)&&this.moveByPx(a,c);else{var f=this.getViewPortPxFromLonLat(this.getCachedCenter()),a=f.add(a,c);if(this.dragging||!a.equals(f))f=this.getLonLatFromViewPortPx(a),d.animate?this.panTo(f):(this.moveTo(f),this.dragging=!1,this.events.triggerEvent("moveend"))}},panTo:function(a){if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(a)){if(!this.panTween)this.panTween=new b.Tween(this.panMethod);var c=this.getCachedCenter();if(!a.equals(c)){var c=this.getPixelFromLonLat(c),d=
this.getPixelFromLonLat(a),f={x:0,y:0};this.panTween.start({x:0,y:0},{x:d.x-c.x,y:d.y-c.y},this.panDuration,{callbacks:{eachStep:b.Function.bind(function(a){this.moveByPx(a.x-f.x,a.y-f.y);f.x=Math.round(a.x);f.y=Math.round(a.y)},this),done:b.Function.bind(function(){this.moveTo(a);this.dragging=!1;this.events.triggerEvent("moveend")},this)}})}}else this.setCenter(a)},setCenter:function(a,b,d,f){this.panTween&&this.panTween.stop();this.moveTo(a,b,{dragging:d,forceZoomChange:f})},moveByPx:function(a,
b){var d=this.size.w/2,f=this.size.h/2,e=d+a,g=f+b,h=this.baseLayer.wrapDateLine,i=0,k=0;this.restrictedExtent&&(i=d,k=f,h=!1);a=h||e<=this.maxPx.x-i&&e>=this.minPx.x+i?Math.round(a):0;b=g<=this.maxPx.y-k&&g>=this.minPx.y+k?Math.round(b):0;d=this.minPx.x;f=this.maxPx.x;if(a||b){if(!this.dragging)this.dragging=!0,this.events.triggerEvent("movestart");this.center=null;if(a)this.layerContainerDiv.style.left=parseInt(this.layerContainerDiv.style.left)-a+"px",this.minPx.x-=a,this.maxPx.x-=a,h&&(this.maxPx.x>
f&&(this.maxPx.x-=f-d),this.minPx.x<d&&(this.minPx.x+=f-d));if(b)this.layerContainerDiv.style.top=parseInt(this.layerContainerDiv.style.top)-b+"px",this.minPx.y-=b,this.maxPx.y-=b;d=0;for(f=this.layers.length;d<f;++d)if(h=this.layers[d],h.visibility&&(h===this.baseLayer||h.inRange))h.moveByPx(a,b),h.events.triggerEvent("move");this.events.triggerEvent("move")}},moveTo:function(a,c,d){d||(d={});c!=null&&(c=parseFloat(c),this.fractionalZoom||(c=Math.round(c)));var f=d.dragging||this.dragging,e=d.forceZoomChange;
if(!this.getCachedCenter()&&!this.isValidLonLat(a))a=this.maxExtent.getCenterLonLat(),this.center=a.clone();if(this.restrictedExtent!=null){if(a==null)a=this.center;c==null&&(c=this.getZoom());var g=this.getResolutionForZoom(c),g=this.calculateBounds(a,g);if(!this.restrictedExtent.containsBounds(g)){var h=this.restrictedExtent.getCenterLonLat();g.getWidth()>this.restrictedExtent.getWidth()?a=new b.LonLat(h.lon,a.lat):g.left<this.restrictedExtent.left?a=a.add(this.restrictedExtent.left-g.left,0):g.right>
this.restrictedExtent.right&&(a=a.add(this.restrictedExtent.right-g.right,0));g.getHeight()>this.restrictedExtent.getHeight()?a=new b.LonLat(a.lon,h.lat):g.bottom<this.restrictedExtent.bottom?a=a.add(0,this.restrictedExtent.bottom-g.bottom):g.top>this.restrictedExtent.top&&(a=a.add(0,this.restrictedExtent.top-g.top))}}e=e||this.isValidZoomLevel(c)&&c!=this.getZoom();g=this.isValidLonLat(a)&&!a.equals(this.center);if(e||g||f){f||this.events.triggerEvent("movestart");if(g)!e&&this.center&&this.centerLayerContainer(a),
this.center=a.clone();a=e?this.getResolutionForZoom(c):this.getResolution();if(e||this.layerContainerOrigin==null){this.layerContainerOrigin=this.getCachedCenter();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px";var i=this.getMaxExtent({restricted:!0}),g=i.getCenterLonLat(),h=this.center.lon-g.lon,k=g.lat-this.center.lat,g=Math.round(i.getWidth()/a),i=Math.round(i.getHeight()/a),h=(this.size.w-g)/2-h/a,k=(this.size.h-i)/2-k/a;this.minPx=new b.Pixel(h,k);this.maxPx=new b.Pixel(h+
g,k+i)}if(e)this.zoom=c,this.resolution=a,this.viewRequestID++;a=this.getExtent();this.baseLayer.visibility&&(this.baseLayer.moveTo(a,e,d.dragging),d.dragging||this.baseLayer.events.triggerEvent("moveend",{zoomChanged:e}));a=this.baseLayer.getExtent();for(c=this.layers.length-1;c>=0;--c)if(g=this.layers[c],g!==this.baseLayer&&!g.isBaseLayer){h=g.calculateInRange();if(g.inRange!=h)(g.inRange=h)||g.display(!1),this.events.triggerEvent("changelayer",{layer:g,property:"visibility"});h&&g.visibility&&
(g.moveTo(a,e,d.dragging),d.dragging||g.events.triggerEvent("moveend",{zoomChanged:e}))}this.events.triggerEvent("move");f||this.events.triggerEvent("moveend");if(e){c=0;for(d=this.popups.length;c<d;c++)this.popups[c].updatePosition();this.events.triggerEvent("zoomend")}}},centerLayerContainer:function(a){var b=this.getViewPortPxFromLonLat(this.layerContainerOrigin),d=this.getViewPortPxFromLonLat(a);if(b!=null&&d!=null){var f=parseInt(this.layerContainerDiv.style.left),a=parseInt(this.layerContainerDiv.style.top),
e=Math.round(b.x-d.x),b=Math.round(b.y-d.y);this.layerContainerDiv.style.left=e+"px";this.layerContainerDiv.style.top=b+"px";f-=e;a-=b;this.minPx.x-=f;this.maxPx.x-=f;this.minPx.y-=a;this.maxPx.y-=a}},isValidZoomLevel:function(a){return a!=null&&a>=0&&a<this.getNumZoomLevels()},isValidLonLat:function(a){var b=!1;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;this.baseLayer!=null&&(a=this.baseLayer.getExtent());
return a},getResolution:function(){var a=null;this.baseLayer!=null?a=this.baseLayer.getResolution():this.allOverlays===!0&&this.layers.length>0&&(a=this.layers[0].getResolution());return a},getUnits:function(){var a=null;if(this.baseLayer!=null)a=this.baseLayer.units;return a},getScale:function(){var a=null;this.baseLayer!=null&&(a=this.getResolution(),a=b.Util.getScaleFromResolution(a,this.baseLayer.units));return a},getZoomForExtent:function(a,b){var d=null;this.baseLayer!=null&&(d=this.baseLayer.getZoomForExtent(a,
b));return d},getResolutionForZoom:function(a){var b=null;this.baseLayer&&(b=this.baseLayer.getResolutionForZoom(a));return b},getZoomForResolution:function(a,b){var d=null;this.baseLayer!=null&&(d=this.baseLayer.getZoomForResolution(a,b));return d},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 d=a.getCenterLonLat();if(this.baseLayer.wrapDateLine){d=
this.getMaxExtent();for(a=a.clone();a.right<a.left;)a.right+=d.getWidth();d=a.getCenterLonLat().wrapDateLine(d)}this.setCenter(d,this.getZoomForExtent(a,b))},zoomToMaxExtent:function(a){this.zoomToExtent(this.getMaxExtent({restricted:a?a.restricted:!0}))},zoomToScale:function(a,c){var d=b.Util.getResolutionFromScale(a,this.baseLayer.units),f=this.getSize(),e=f.w*d;d*=f.h;f=this.getCachedCenter();this.zoomToExtent(new b.Bounds(f.lon-e/2,f.lat-d/2,f.lon+e/2,f.lat+d/2),c)},getLonLatFromViewPortPx:function(a){var b=
null;this.baseLayer!=null&&(b=this.baseLayer.getLonLatFromViewPortPx(a));return b},getViewPortPxFromLonLat:function(a){var b=null;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},getGeodesicPixelSize:function(a){var c=a?this.getLonLatFromPixel(a):this.getCachedCenter()||new b.LonLat(0,
0),d=this.getResolution(),a=c.add(-d/2,0),f=c.add(d/2,0),e=c.add(0,-d/2),c=c.add(0,d/2),d=new b.Projection("EPSG:4326"),g=this.getProjectionObject()||d;g.equals(d)||(a.transform(g,d),f.transform(g,d),e.transform(g,d),c.transform(g,d));return new b.Size(b.Util.distVincenty(a,f),b.Util.distVincenty(e,c))},getViewPortPxFromLayerPx:function(a){var b=null;if(a!=null)var b=parseInt(this.layerContainerDiv.style.left),d=parseInt(this.layerContainerDiv.style.top),b=a.add(b,d);return b},getLayerPxFromViewPortPx:function(a){var b=
null;if(a!=null){var b=-parseInt(this.layerContainerDiv.style.left),d=-parseInt(this.layerContainerDiv.style.top),b=a.add(b,d);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"});b.Map.TILE_WIDTH=256;b.Map.TILE_HEIGHT=256;b.Layer=b.Class({id:null,name:null,div:null,opacity:null,
alwaysInRange:null,EVENT_TYPES:["loadstart","loadend","loadcancel","visibilitychanged","move","moveend","added","removed"],RESOLUTION_PROPERTIES:["scales","resolutions","maxScale","minScale","maxResolution","minResolution","numZoomLevels","maxZoomLevel"],events:null,map:null,isBaseLayer:!1,alpha:!1,displayInLayerSwitcher:!0,visibility:!0,attribution:null,inRange:!1,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:!1,wrapDateLine:!1,transitionEffect:null,SUPPORTED_TRANSITIONS:["resize"],metadata:{},initialize:function(a,c){this.addOptions(c);this.name=a;if(this.id==null&&(this.id=b.Util.createUniqueID(this.CLASS_NAME+"_"),this.div=b.Util.createDiv(this.id),this.div.style.width="100%",this.div.style.height="100%",this.div.dir="ltr",this.events=new b.Events(this,this.div,this.EVENT_TYPES),
this.eventListeners instanceof Object))this.events.on(this.eventListeners);if(this.wrapDateLine)this.displayOutsideMaxExtent=!0},destroy:function(a){a==null&&(a=!0);this.map!=null&&this.map.removeLayer(this,a);this.options=this.div=this.name=this.map=this.projection=null;this.events&&(this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy());this.events=this.eventListeners=null},clone:function(a){a==null&&(a=new b.Layer(this.name,this.getOptions()));b.Util.applyDefaults(a,this);
a.map=null;return a},getOptions:function(){var a={},b;for(b in this.options)a[b]=this[b];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,c){if(this.options==null)this.options={};b.Util.extend(this.options,a);b.Util.extend(this,a);if(typeof this.projection=="string")this.projection=new b.Projection(this.projection);if(this.projection&&this.projection.getUnits())this.units=this.projection.getUnits();
if(this.map){var d=this.map.getResolution(),f=this.RESOLUTION_PROPERTIES.concat(["projection","units","minExtent","maxExtent"]),e;for(e in a)if(a.hasOwnProperty(e)&&b.Util.indexOf(f,e)>=0){this.initResolutions();c&&this.map.baseLayer===this&&(this.map.setCenter(this.map.getCenter(),this.map.getZoomForResolution(d),!1,!0),this.map.events.triggerEvent("changebaselayer",{layer:this}));break}}},onMapResize:function(){},redraw:function(){var a=!1;if(this.map){this.inRange=this.calculateInRange();var b=
this.getExtent();b&&this.inRange&&this.visibility&&(this.moveTo(b,!0,!1),this.events.triggerEvent("moveend",{zoomChanged:!0}),a=!0)}return a},moveTo:function(){var a=this.visibility;this.isBaseLayer||(a=a&&this.inRange);this.display(a)},moveByPx:function(){},setMap:function(a){if(this.map==null){this.map=a;this.maxExtent=this.maxExtent||this.map.maxExtent;this.minExtent=this.minExtent||this.map.minExtent;this.projection=this.projection||this.map.projection;if(typeof this.projection=="string")this.projection=
new b.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 b.Pixel(-this.gutter,
-this.gutter),this.imageSize=new b.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){if(a!=(this.div.style.display!="none"))this.div.style.display=a&&this.calculateInRange()?"block":"none"},calculateInRange:function(){var a=
!1;this.alwaysInRange?a=!0: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(){var a,c,d,f={},e=!0;a=0;for(c=this.RESOLUTION_PROPERTIES.length;a<c;a++)d=this.RESOLUTION_PROPERTIES[a],f[d]=this.options[d],e&&this.options[d]&&(e=!1);if(this.alwaysInRange==null)this.alwaysInRange=e;if(f.resolutions==
null)f.resolutions=this.resolutionsFromScales(f.scales);if(f.resolutions==null)f.resolutions=this.calculateResolutions(f);if(f.resolutions==null){a=0;for(c=this.RESOLUTION_PROPERTIES.length;a<c;a++)d=this.RESOLUTION_PROPERTIES[a],f[d]=this.options[d]!=null?this.options[d]:this.map[d];if(f.resolutions==null)f.resolutions=this.resolutionsFromScales(f.scales);if(f.resolutions==null)f.resolutions=this.calculateResolutions(f)}var g;if(this.options.maxResolution&&this.options.maxResolution!=="auto")g=this.options.maxResolution;
this.options.minScale&&(g=b.Util.getResolutionFromScale(this.options.minScale,this.units));var h;if(this.options.minResolution&&this.options.minResolution!=="auto")h=this.options.minResolution;this.options.maxScale&&(h=b.Util.getResolutionFromScale(this.options.maxScale,this.units));f.resolutions&&(f.resolutions.sort(function(a,b){return b-a}),g||(g=f.resolutions[0]),h||(h=f.resolutions[f.resolutions.length-1]));if(this.resolutions=f.resolutions){c=this.resolutions.length;this.scales=Array(c);for(a=
0;a<c;a++)this.scales[a]=b.Util.getScaleFromResolution(this.resolutions[a],this.units);this.numZoomLevels=c}if(this.minResolution=h)this.maxScale=b.Util.getScaleFromResolution(h,this.units);if(this.maxResolution=g)this.minScale=b.Util.getScaleFromResolution(g,this.units)},resolutionsFromScales:function(a){if(a!=null){var c,d,f;f=a.length;c=Array(f);for(d=0;d<f;d++)c[d]=b.Util.getResolutionFromScale(a[d],this.units);return c}},calculateResolutions:function(a){var c,d,f=a.maxResolution;a.minScale!=
null?f=b.Util.getResolutionFromScale(a.minScale,this.units):f=="auto"&&this.maxExtent!=null&&(c=this.map.getSize(),d=this.maxExtent.getWidth()/c.w,c=this.maxExtent.getHeight()/c.h,f=Math.max(d,c));d=a.minResolution;a.maxScale!=null?d=b.Util.getResolutionFromScale(a.maxScale,this.units):a.minResolution=="auto"&&this.minExtent!=null&&(c=this.map.getSize(),d=this.minExtent.getWidth()/c.w,c=this.minExtent.getHeight()/c.h,d=Math.max(d,c));c=a.maxZoomLevel;a=a.numZoomLevels;typeof d==="number"&&typeof f===
"number"&&a===void 0?a=Math.floor(Math.log(f/d)/Math.log(2))+1:a===void 0&&c!=null&&(a=c+1);if(!(typeof a!=="number"||a<=0||typeof f!=="number"&&typeof d!=="number")){c=Array(a);var e=2;typeof d=="number"&&typeof f=="number"&&(e=Math.pow(f/d,1/(a-1)));var g;if(typeof f==="number")for(g=0;g<a;g++)c[g]=f/Math.pow(e,g);else for(g=0;g<a;g++)c[a-1-g]=d*Math.pow(e,g);return c}},getResolution:function(){return this.getResolutionForZoom(this.map.getZoom())},getExtent:function(){return this.map.calculateBounds()},
getZoomForExtent:function(a,b){var d=this.map.getSize();return this.getZoomForResolution(Math.max(a.getWidth()/d.w,a.getHeight()/d.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),a=this.resolutions[b]-(a-b)*(this.resolutions[b]-this.resolutions[Math.ceil(a)]);else a=this.resolutions[Math.round(a)];return a},getZoomForResolution:function(a,b){var d,f;if(this.map.fractionalZoom){var e=
0,g=this.resolutions[e],h=this.resolutions[this.resolutions.length-1],i;d=0;for(f=this.resolutions.length;d<f;++d)if(i=this.resolutions[d],i>=a&&(g=i,e=d),i<=a){h=i;break}d=g-h;d=d>0?e+(g-a)/d:e}else{g=Number.POSITIVE_INFINITY;d=0;for(f=this.resolutions.length;d<f;d++)if(b){e=Math.abs(this.resolutions[d]-a);if(e>g)break;g=e}else if(this.resolutions[d]<a)break;d=Math.max(0,d-1)}return d},getLonLatFromViewPortPx:function(a){var c=null,d=this.map;if(a!=null&&d.minPx){var c=d.getResolution(),f=d.getMaxExtent({restricted:!0}),
c=new b.LonLat((a.x-d.minPx.x)*c+f.left,(d.minPx.y-a.y)*c+f.top);this.wrapDateLine&&(c=c.wrapDateLine(this.maxExtent))}return c},getViewPortPxFromLonLat:function(a){var c=null;if(a!=null)var c=this.map.getResolution(),d=this.map.getExtent(),c=new b.Pixel(1/c*(a.lon-d.left),1/c*(d.top-a.lat));return c},setOpacity:function(a){if(a!=this.opacity){this.opacity=a;for(var c=0,d=this.div.childNodes.length;c<d;++c)b.Util.modifyDOMElement(this.div.childNodes[c].firstChild,null,null,null,null,null,null,a);
this.map!=null&&this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"})}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(a){this.div.style.zIndex=a},adjustBounds:function(a){if(this.gutter)var c=this.gutter*this.map.getResolution(),a=new b.Bounds(a.left-c,a.bottom-c,a.right+c,a.top+c);this.wrapDateLine&&(c={rightTolerance:this.getResolution(),leftTolerance:this.getResolution()},a=a.wrapDateLine(this.maxExtent,c));return a},CLASS_NAME:"OpenLayers.Layer"});
b.Layer.HTTPRequest=b.Class(b.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:!1,initialize:function(a,c,d,f){b.Layer.prototype.initialize.apply(this,[a,f]);this.url=c;this.params=b.Util.extend({},d)},destroy:function(){this.params=this.url=null;b.Layer.prototype.destroy.apply(this,arguments)},clone:function(a){a==null&&(a=new b.Layer.HTTPRequest(this.name,this.url,this.params,this.getOptions()));return a=b.Layer.prototype.clone.apply(this,[a])},setUrl:function(a){this.url=
a},mergeNewParams:function(a){this.params=b.Util.extend(this.params,a);a=this.redraw();this.map!=null&&this.map.events.triggerEvent("changelayer",{layer:this,property:"params"});return a},redraw:function(a){return a?this.mergeNewParams({_olSalt:Math.random()}):b.Layer.prototype.redraw.apply(this,[])},selectUrl:function(a,b){for(var d=1,f=0,e=a.length;f<e;f++)d*=a.charCodeAt(f)*this.URL_HASH_FACTOR,d-=Math.floor(d);return b[Math.floor(d*b.length)]},getFullRequestString:function(a,c){var d=c||this.url,
f=b.Util.extend({},this.params),f=b.Util.extend(f,a),e=b.Util.getParameterString(f);b.Util.isArray(d)&&(d=this.selectUrl(e,d));var e=b.Util.upperCaseObject(b.Util.getParameters(d)),g;for(g in f)g.toUpperCase()in e&&delete f[g];e=b.Util.getParameterString(f);return b.Util.urlAppend(d,e)},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"});b.Projection=b.Class({proj:null,projCode:null,titleRegEx:/\+title=[^\+]*/,initialize:function(a,c){b.Util.extend(this,c);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){var c=!1;a&&(window.Proj4js&&this.proj.defData&&a.proj.defData?c=this.proj.defData.replace(this.titleRegEx,"")==a.proj.defData.replace(this.titleRegEx,""):a.getCode&&(c=this.getCode(),a=a.getCode(),c=c==a||!!b.Projection.transforms[c]&&b.Projection.transforms[c][a]===b.Projection.nullTransform));return c},destroy:function(){delete this.proj;
delete this.projCode},CLASS_NAME:"OpenLayers.Projection"});b.Projection.transforms={};b.Projection.addTransform=function(a,c,d){b.Projection.transforms[a]||(b.Projection.transforms[a]={});b.Projection.transforms[a][c]=d};b.Projection.transform=function(a,c,d){if(c.proj&&d.proj)a=Proj4js.transform(c.proj,d.proj,a);else if(c&&d&&b.Projection.transforms[c.getCode()]&&b.Projection.transforms[c.getCode()][d.getCode()])b.Projection.transforms[c.getCode()][d.getCode()](a);return a};b.Projection.nullTransform=
function(a){return a};b.Layer.SphericalMercator={getExtent:function(){var a=null;return a=this.sphericalMercator?this.map.calculateBounds():b.Layer.FixedZoomLevels.prototype.getExtent.apply(this)},getLonLatFromViewPortPx:function(){return b.Layer.prototype.getLonLatFromViewPortPx.apply(this,arguments)},getViewPortPxFromLonLat:function(){return b.Layer.prototype.getViewPortPxFromLonLat.apply(this,arguments)},initMercatorParameters:function(){this.RESOLUTIONS=[];for(var a=0;a<=this.MAX_ZOOM_LEVEL;++a)this.RESOLUTIONS[a]=
156543.03390625/Math.pow(2,a);this.units="m";this.projection=this.projection||"EPSG:900913"},forwardMercator:function(a,c){var d;d=Math.log(Math.tan((90+c)*Math.PI/360))/(Math.PI/180);return new b.LonLat(a*2.003750834E7/180,d*2.003750834E7/180)},inverseMercator:function(a,c){var d;d=180/Math.PI*(2*Math.atan(Math.exp(c/2.003750834E7*180*Math.PI/180))-Math.PI/2);return new b.LonLat(a/2.003750834E7*180,d)},projectForward:function(a){var c=b.Layer.SphericalMercator.forwardMercator(a.x,a.y);a.x=c.lon;
a.y=c.lat;return a},projectInverse:function(a){var c=b.Layer.SphericalMercator.inverseMercator(a.x,a.y);a.x=c.lon;a.y=c.lat;return a}};(function(){var a=["EPSG:900913","EPSG:3857","EPSG:102113","EPSG:102100"],c=b.Projection.addTransform,d=b.Layer.SphericalMercator,f=b.Projection.nullTransform,e,g,h,i,k;e=0;for(g=a.length;e<g;++e){h=a[e];c("EPSG:4326",h,d.projectForward);c(h,"EPSG:4326",d.projectInverse);for(k=e+1;k<g;++k)i=a[k],c(h,i,f),c(i,h,f)}})();b.Layer.Grid=b.Class(b.Layer.HTTPRequest,{tileSize:null,
tileOriginCorner:"bl",tileOrigin:null,tileOptions:null,grid:null,singleTile:!1,ratio:1.5,buffer:0,numLoadingTiles:0,tileLoadingDelay:100,timerId:null,initialize:function(){b.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);this.events.addEventType("tileloaded");this.grid=[];this._moveGriddedTiles=b.Function.bind(this.moveGriddedTiles,this)},removeMap:function(){if(this.timerId!=null)window.clearTimeout(this.timerId),this.timerId=null},destroy:function(){this.clearGrid();this.tileSize=
this.grid=null;b.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 d=this.grid[a],f=0,e=d.length;f<e;f++){var g=d[f];this.removeTileMonitoringHooks(g);g.destroy()}this.grid=[]}},clone:function(a){a==null&&(a=new b.Layer.Grid(this.name,this.url,this.params,this.getOptions()));a=b.Layer.HTTPRequest.prototype.clone.apply(this,[a]);if(this.tileSize!=null)a.tileSize=this.tileSize.clone();a.grid=[];return a},moveTo:function(a,
c,d){b.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);a=a||this.map.getExtent();if(a!=null){var f=!this.grid.length||c,e=this.getTilesBounds();this.singleTile?(f||!d&&!e.containsBounds(a))&&this.initSingleTile(a):f||!e.containsBounds(a,!0)?this.initGriddedTiles(a):this.scheduleMoveGriddedTiles()}},moveByPx:function(){this.singleTile||this.scheduleMoveGriddedTiles()},scheduleMoveGriddedTiles:function(){this.timerId!=null&&window.clearTimeout(this.timerId);this.timerId=window.setTimeout(this._moveGriddedTiles,
this.tileLoadingDelay)},setTileSize:function(a){if(this.singleTile)a=this.map.getSize(),a.h=parseInt(a.h*this.ratio),a.w=parseInt(a.w*this.ratio);b.Layer.HTTPRequest.prototype.setTileSize.apply(this,[a])},getGridBounds:function(){b.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)var a=this.grid[this.grid.length-1][0],c=this.grid[0][this.grid[0].length-
1],a=new b.Bounds(a.bounds.left,a.bounds.bottom,c.bounds.right,c.bounds.top);return a},initSingleTile:function(a){var c=a.getCenterLonLat(),d=a.getWidth()*this.ratio,a=a.getHeight()*this.ratio,c=new b.Bounds(c.lon-d/2,c.lat-a/2,c.lon+d/2,c.lat+a/2),d=this.map.getLayerPxFromLonLat(new b.LonLat(c.left,c.top));this.grid.length||(this.grid[0]=[]);(a=this.grid[0][0])?a.moveTo(c,d):(a=this.addTile(c,d),this.addTileMonitoringHooks(a),a.draw(),this.grid[0][0]=a);this.removeExcessTiles(1,1)},calculateGridLayout:function(a,
b,d){var f=d*this.tileSize.w;d*=this.tileSize.h;var e=a.left-b.lon,g=Math.floor(e/f)-this.buffer,a=a.top-(b.lat+d),h=Math.ceil(a/d)+this.buffer;return{tilelon:f,tilelat:d,tileoffsetlon:b.lon+g*f,tileoffsetlat:b.lat+h*d,tileoffsetx:-(e/f-g)*this.tileSize.w,tileoffsety:-(h-a/d)*this.tileSize.h}},getTileOrigin:function(){var a=this.tileOrigin;if(!a)var a=this.getMaxExtent(),c={tl:["left","top"],tr:["right","top"],bl:["left","bottom"],br:["right","bottom"]}[this.tileOriginCorner],a=new b.LonLat(a[c[0]],
a[c[1]]);return a},initGriddedTiles:function(a){var c=this.map.getSize(),d=Math.ceil(c.h/this.tileSize.h)+Math.max(1,2*this.buffer),c=Math.ceil(c.w/this.tileSize.w)+Math.max(1,2*this.buffer),f=this.getTileOrigin(),e=this.map.getResolution(),g=this.calculateGridLayout(a,f,e),f=Math.round(g.tileoffsetx),e=Math.round(g.tileoffsety),h=g.tileoffsetlon,i=g.tileoffsetlat,k=g.tilelon,g=g.tilelat;this.origin=new b.Pixel(f,e);var j=f,l=h,m=0,n=parseInt(this.map.layerContainerDiv.style.left),o=parseInt(this.map.layerContainerDiv.style.top);
do{var p=this.grid[m++];p||(p=[],this.grid.push(p));var h=l,f=j,t=0;do{var s=new b.Bounds(h,i,h+k,i+g),q=f;q-=n;var r=e;r-=o;q=new b.Pixel(q,r);(r=p[t++])?r.moveTo(s,q,!1):(r=this.addTile(s,q),this.addTileMonitoringHooks(r),p.push(r));h+=k;f+=this.tileSize.w}while(h<=a.right+k*this.buffer||t<c);i-=g;e+=this.tileSize.h}while(i>=a.bottom-g*this.buffer||m<d);this.removeExcessTiles(m,t);this.spiralTileLoad()},getMaxExtent:function(){return this.maxExtent},spiralTileLoad:function(){for(var a=[],c=["right",
"down","left","up"],d=0,f=-1,e=b.Util.indexOf(c,"right"),g=0;g<c.length;){var h=d,i=f;switch(c[e]){case "right":i++;break;case "down":h++;break;case "left":i--;break;case "up":h--}var k=null;h<this.grid.length&&h>=0&&i<this.grid[0].length&&i>=0&&(k=this.grid[h][i]);k!=null&&!k.queued?(a.unshift(k),k.queued=!0,g=0,d=h,f=i):(e=(e+1)%4,g++)}c=0;for(d=a.length;c<d;c++)k=a[c],k.draw(),k.queued=!1},addTile:function(a,c){return new b.Tile.Image(this,c,a,null,this.tileSize,this.tileOptions)},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(){var a=!0,b=this.buffer||1,d=this.grid[0][0].position,f=parseInt(this.map.layerContainerDiv.style.left),e=parseInt(this.map.layerContainerDiv.style.top),d=d.add(f,e);d.x>-this.tileSize.w*(b-1)?this.shiftColumn(!0):d.x<-this.tileSize.w*b?this.shiftColumn(!1):d.y>-this.tileSize.h*(b-1)?this.shiftRow(!0):d.y<-this.tileSize.h*b?this.shiftRow(!1):a=!1;if(a)this.timerId=window.setTimeout(this._moveGriddedTiles,0)},shiftRow:function(a){var b=this.grid,d=b[a?0:this.grid.length-
1],f=this.map.getResolution(),e=a?-this.tileSize.h:this.tileSize.h;f*=-e;for(var g=a?b.pop():b.shift(),h=0,i=d.length;h<i;h++){var k=d[h],j=k.bounds.clone(),k=k.position.clone();j.bottom+=f;j.top+=f;k.y+=e;g[h].moveTo(j,k)}a?b.unshift(g):b.push(g)},shiftColumn:function(a){for(var b=a?-this.tileSize.w:this.tileSize.w,d=this.map.getResolution()*b,f=0,e=this.grid.length;f<e;f++){var g=this.grid[f],h=g[a?0:g.length-1],i=h.bounds.clone(),h=h.position.clone();i.left+=d;i.right+=d;h.x+=b;var k=a?this.grid[f].pop():
this.grid[f].shift();k.moveTo(i,h);a?g.unshift(k):g.push(k)}},removeExcessTiles:function(a,b){for(;this.grid.length>a;)for(var d=this.grid.pop(),f=0,e=d.length;f<e;f++){var g=d[f];this.removeTileMonitoringHooks(g);g.destroy()}for(;this.grid[0].length>b;){f=0;for(e=this.grid.length;f<e;f++)d=this.grid[f],g=d.pop(),this.removeTileMonitoringHooks(g),g.destroy()}},onMapResize:function(){this.singleTile&&(this.clearGrid(),this.setTileSize())},getTileBounds:function(a){var c=this.maxExtent,d=this.getResolution(),
f=d*this.tileSize.w;d*=this.tileSize.h;var e=this.getLonLatFromViewPortPx(a),a=c.left+f*Math.floor((e.lon-c.left)/f),c=c.bottom+d*Math.floor((e.lat-c.bottom)/d);return new b.Bounds(a,c,a+f,c+d)},CLASS_NAME:"OpenLayers.Layer.Grid"});b.Layer.Markers=b.Class(b.Layer,{isBaseLayer:!1,markers:null,drawn:!1,initialize:function(){b.Layer.prototype.initialize.apply(this,arguments);this.markers=[]},destroy:function(){this.clearMarkers();this.markers=null;b.Layer.prototype.destroy.apply(this,arguments)},setOpacity:function(a){if(a!=
this.opacity){this.opacity=a;for(var a=0,b=this.markers.length;a<b;a++)this.markers[a].setOpacity(this.opacity)}},moveTo:function(a,c){b.Layer.prototype.moveTo.apply(this,arguments);if(c||!this.drawn){for(var d=0,f=this.markers.length;d<f;d++)this.drawMarker(this.markers[d]);this.drawn=!0}},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){this.markers&&this.markers.length&&
(b.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);b==null?a.display(!1):a.isDrawn()?a.icon&&a.icon.moveTo(b):this.div.appendChild(a.draw(b))},getDataExtent:function(){var a=null;if(this.markers&&this.markers.length>0)for(var a=new b.Bounds,c=0,d=this.markers.length;c<d;c++)a.extend(this.markers[c].lonlat);return a},CLASS_NAME:"OpenLayers.Layer.Markers"});
b.Feature=b.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:null,popup:null,initialize:function(a,c,d){this.layer=a;this.lonlat=c;this.data=d!=null?d:{};this.id=b.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){this.layer!=null&&this.layer.map!=null&&this.popup!=null&&this.layer.map.removePopup(this.popup);this.layer!=null&&this.marker!=null&&this.layer.removeMarker(this.marker);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=!1;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 b.Marker(this.lonlat,this.data.icon);return this.marker},destroyMarker:function(){this.marker.destroy()},createPopup:function(a){if(this.lonlat!=null){if(!this.popup)this.popup=new (this.popupClass?this.popupClass:b.Popup.AnchoredBubble)(this.id+
"_popup",this.lonlat,this.data.popupSize,this.data.popupContentHTML,this.marker?this.marker.icon:null,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"});b.ProxyHost="";b.nullHandler=function(a){b.Console.userError(b.i18n("unhandledRequest",{statusText:a.statusText}))};b.loadURL=function(a,
c,d,f,e){typeof c=="string"&&(c=b.Util.getParameters(c));return b.Request.GET({url:a,params:c,success:f?f:b.nullHandler,failure:e?e:b.nullHandler,scope:d})};b.parseXMLString=function(a){var c=a.indexOf("<");c>0&&(a=a.substring(c));return b.Util.Try(function(){var b=new ActiveXObject("Microsoft.XMLDOM");b.loadXML(a);return b},function(){return(new DOMParser).parseFromString(a,"text/xml")},function(){var b=new XMLHttpRequest;b.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(a),!1);b.overrideMimeType&&
b.overrideMimeType("text/xml");b.send(null);return b.responseXML})};b.Ajax={emptyFunction:function(){},getTransport:function(){return b.Util.Try(function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||!1},activeRequestCount:0};b.Ajax.Responders={responders:[],register:function(a){for(var b=0;b<this.responders.length;b++)if(a==this.responders[b])return;this.responders.push(a)},unregister:function(a){b.Util.removeItem(this.reponders,
a)},dispatch:function(a,b,d){for(var f,e=0;e<this.responders.length;e++)if(f=this.responders[e],f[a]&&typeof f[a]=="function")try{f[a].apply(f,[b,d])}catch(g){}}};b.Ajax.Responders.register({onCreate:function(){b.Ajax.activeRequestCount++},onComplete:function(){b.Ajax.activeRequestCount--}});b.Ajax.Base=b.Class({initialize:function(a){this.options={method:"post",asynchronous:!0,contentType:"application/xml",parameters:""};b.Util.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();
if(typeof this.options.parameters=="string")this.options.parameters=b.Util.getParameters(this.options.parameters)}});b.Ajax.Request=b.Class(b.Ajax.Base,{_complete:!1,initialize:function(a,c){b.Ajax.Base.prototype.initialize.apply(this,[c]);b.ProxyHost&&b.String.startsWith(a,"http")&&(a=b.ProxyHost+encodeURIComponent(a));this.transport=b.Ajax.getTransport();this.request(a)},request:function(a){this.url=a;this.method=this.options.method;a=b.Util.extend({},this.options.parameters);if(this.method!="get"&&
this.method!="post")a._method=this.method,this.method="post";this.parameters=a;if(a=b.Util.getParameterString(a))this.method=="get"?this.url+=(this.url.indexOf("?")>-1?"&":"?")+a:/Konqueror|Safari|KHTML/.test(navigator.userAgent)&&(a+="&_=");try{var c=new b.Ajax.Response(this);if(this.options.onCreate)this.options.onCreate(c);b.Ajax.Responders.dispatch("onCreate",this,c);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);this.options.asynchronous&&window.setTimeout(b.Function.bind(this.respondToReadyState,
this,1),10);this.transport.onreadystatechange=b.Function.bind(this.onStateChange,this);this.setRequestHeaders();this.body=this.method=="post"?this.options.postBody||a:null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType)this.onStateChange()}catch(d){this.dispatchException(d)}},onStateChange:function(){var a=this.transport.readyState;a>1&&!(a==4&&this._complete)&&this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var a={"X-Requested-With":"XMLHttpRequest",
Accept:"text/javascript, text/html, application/xml, text/xml, */*",OpenLayers:!0};if(this.method=="post"&&(a["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:""),this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005))a.Connection="close";if(typeof this.options.requestHeaders=="object"){var b=this.options.requestHeaders;if(typeof b.push=="function")for(var d=0,f=b.length;d<f;d+=2)a[b[d]]=b[d+1];else for(d in b)a[d]=
b[d]}for(var e in a)this.transport.setRequestHeader(e,a[e])},success:function(){var a=this.getStatus();return!a||a>=200&&a<300},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var a=b.Ajax.Request.Events[a],c=new b.Ajax.Response(this);if(a=="Complete"){try{this._complete=!0,(this.options["on"+c.status]||this.options["on"+(this.success()?"Success":"Failure")]||b.Ajax.emptyFunction)(c)}catch(d){this.dispatchException(d)}c.getHeader("Content-type")}try{(this.options["on"+
a]||b.Ajax.emptyFunction)(c),b.Ajax.Responders.dispatch("on"+a,this,c)}catch(f){this.dispatchException(f)}if(a=="Complete")this.transport.onreadystatechange=b.Ajax.emptyFunction},getHeader:function(a){try{return this.transport.getResponseHeader(a)}catch(b){return null}},dispatchException:function(a){var c=this.options.onException;if(c)c(this,a),b.Ajax.Responders.dispatch("onException",this,a);else{for(var c=!1,d=b.Ajax.Responders.responders,f=0;f<d.length;f++)if(d[f].onException){c=!0;break}if(c)b.Ajax.Responders.dispatch("onException",
this,a);else throw a;}}});b.Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];b.Ajax.Response=b.Class({status:0,statusText:"",initialize:function(a){this.request=a;var a=this.transport=a.transport,b=this.readyState=a.readyState;if(b>2&&(!window.attachEvent||window.opera)||b==4)this.status=this.getStatus(),this.statusText=this.getStatusText(),this.responseText=a.responseText==null?"":String(a.responseText);if(b==4)a=a.responseXML,this.responseXML=a===void 0?null:a},
getStatus:b.Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:b.Ajax.Request.prototype.getHeader,getResponseHeader:function(a){return this.transport.getResponseHeader(a)}});b.Ajax.getElementsByTagNameNS=function(a,b,d,f){var e=null;return e=a.getElementsByTagNameNS?a.getElementsByTagNameNS(b,f):a.getElementsByTagName(d+":"+f)};b.Ajax.serializeXMLToString=function(a){return(new XMLSerializer).serializeToString(a)};b.Geometry=
b.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=b.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){this.bounds=this.id=null},clone:function(){return new b.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,c,d){var f=!1;this.getBounds()!=null&&a!=null&&(c=c!=null?c:0,d=d!=null?d:0,f=(new b.Bounds(this.bounds.left-c,this.bounds.bottom-d,this.bounds.right+c,this.bounds.top+d)).containsLonLat(a));return f},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},toString:function(){return b.Format.WKT.prototype.write(new b.Feature.Vector(this))},CLASS_NAME:"OpenLayers.Geometry"});b.Geometry.fromWKT=
function(a){var c=arguments.callee.format;if(!c)c=new b.Format.WKT,arguments.callee.format=c;var d,c=c.read(a);if(c instanceof b.Feature.Vector)d=c.geometry;else if(b.Util.isArray(c)){d=c.length;for(var f=Array(d),e=0;e<d;++e)f[e]=c[e].geometry;d=new b.Geometry.Collection(f)}return d};b.Geometry.segmentsIntersect=function(a,c,d){var f=d&&d.point,d=d&&d.tolerance,e=!1,g=a.x1-c.x1,h=a.y1-c.y1,i=a.x2-a.x1,k=a.y2-a.y1,j=c.y2-c.y1,l=c.x2-c.x1,m=j*i-l*k,j=l*h-j*g,h=i*h-k*g;m==0?j==0&&h==0&&(e=!0):(g=j/
m,m=h/m,g>=0&&g<=1&&m>=0&&m<=1&&(f?(i=a.x1+g*i,m=a.y1+g*k,e=new b.Geometry.Point(i,m)):e=!0));if(d)if(e){if(f){a=[a,c];c=0;a:for(;c<2;++c){g=a[c];for(k=1;k<3;++k)if(i=g["x"+k],m=g["y"+k],f=Math.sqrt(Math.pow(i-e.x,2)+Math.pow(m-e.y,2)),f<d){e.x=i;e.y=m;break a}}}}else{a=[a,c];c=0;a:for(;c<2;++c){i=a[c];m=a[(c+1)%2];for(k=1;k<3;++k)if(g={x:i["x"+k],y:i["y"+k]},h=b.Geometry.distanceToSegment(g,m),h.distance<d){e=f?new b.Geometry.Point(g.x,g.y):!0;break a}}}return e};b.Geometry.distanceToSegment=function(a,
b){var d=a.x,f=a.y,e=b.x1,g=b.y1,h=b.x2,i=b.y2,k=h-e,j=i-g,l=0;if(k||j)l=(k*(d-e)+j*(f-g))/(Math.pow(k,2)+Math.pow(j,2));l<=0||(l>=1?(e=h,g=i):(e+=l*k,g+=l*j));return{distance:Math.sqrt(Math.pow(e-d,2)+Math.pow(g-f,2)),x:e,y:g}};b.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};b.Feature.Vector=b.Class(b.Feature,{fid:null,geometry:null,attributes:null,bounds:null,state:null,style:null,url:null,renderIntent:"default",modified:null,initialize:function(a,c,d){b.Feature.prototype.initialize.apply(this,
[null,null,c]);this.lonlat=null;this.geometry=a?a:null;this.state=null;this.attributes={};if(c)this.attributes=b.Util.extend(this.attributes,c);this.style=d?d:null},destroy:function(){if(this.layer)this.layer.removeFeatures(this),this.layer=null;this.modified=this.geometry=null;b.Feature.prototype.destroy.apply(this,arguments)},clone:function(){return new b.Feature.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)},onScreen:function(a){var b=!1;this.layer&&this.layer.map&&
(b=this.layer.map.getExtent(),a?(a=this.geometry.getBounds(),b=b.intersectsBounds(a)):b=b.toGeometry().intersects(this.geometry));return b},getVisibility:function(){return!(this.style&&this.style.display=="none"||!this.layer||this.layer&&this.layer.styleMap&&this.layer.styleMap.createSymbolizer(this,this.renderIntent).display=="none"||this.layer&&!this.layer.getVisibility())},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(a,b,d){var f=
!1;this.geometry&&(f=this.geometry.atPoint(a,b,d));return f},destroyPopup:function(){},move:function(a){if(this.layer&&this.geometry.move){var a=a.CLASS_NAME=="OpenLayers.LonLat"?this.layer.getViewPortPxFromLonLat(a):a,b=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat()),d=this.layer.map.getResolution();this.geometry.move(d*(a.x-b.x),d*(b.y-a.y));this.layer.drawFeature(this);return b}},toState:function(a){if(a==b.State.UPDATE)switch(this.state){case b.State.UNKNOWN:case b.State.DELETE:this.state=
a}else if(a==b.State.INSERT)switch(this.state){case b.State.UNKNOWN:break;default:this.state=a}else if(a==b.State.DELETE)switch(this.state){case b.State.UNKNOWN:case b.State.UPDATE:this.state=a}else if(a==b.State.UNKNOWN)this.state=a},CLASS_NAME:"OpenLayers.Feature.Vector"});b.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"}};b.Layer.Vector=b.Class(b.Layer,{EVENT_TYPES:["beforefeatureadded","beforefeaturesadded","featureadded","featuresadded","beforefeatureremoved","beforefeaturesremoved",
"featureremoved","featuresremoved","beforefeatureselected","featureselected","featureunselected","beforefeaturemodified","featuremodified","afterfeaturemodified","vertexmodified","vertexremoved","sketchstarted","sketchmodified","sketchcomplete","refresh"],isBaseLayer:!1,isFixed:!1,features:null,filter:null,selectedFeatures:null,unrenderedFeatures:null,reportError:!0,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,
drawn:!1,initialize:function(){this.EVENT_TYPES=b.Layer.Vector.prototype.EVENT_TYPES.concat(b.Layer.prototype.EVENT_TYPES);b.Layer.prototype.initialize.apply(this,arguments);(!this.renderer||!this.renderer.supported())&&this.assignRenderer();if(!this.renderer||!this.renderer.supported())this.renderer=null,this.displayError();if(!this.styleMap)this.styleMap=new b.StyleMap;this.features=[];this.selectedFeatures=[];this.unrenderedFeatures={};if(this.strategies)for(var a=0,c=this.strategies.length;a<
c;a++)this.strategies[a].setLayer(this)},destroy:function(){if(this.strategies){var a,c,d;c=0;for(d=this.strategies.length;c<d;c++)a=this.strategies[c],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;b.Layer.prototype.destroy.apply(this,arguments)},
clone:function(a){a==null&&(a=new b.Layer.Vector(this.name,this.getOptions()));for(var a=b.Layer.prototype.clone.apply(this,[a]),c=this.features,d=c.length,f=Array(d),e=0;e<d;++e)f[e]=c[e].clone();a.features=f;return a},refresh:function(a){this.calculateInRange()&&this.visibility&&this.events.triggerEvent("refresh",a)},assignRenderer:function(){for(var a=0,c=this.renderers.length;a<c;a++){var d=this.renderers[a];if((d=typeof d=="function"?d:b.Renderer[d])&&d.prototype.supported()){this.renderer=new d(this.div,
this.rendererOptions);break}}},displayError:function(){this.reportError&&b.Console.userError(b.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))},setMap:function(){b.Layer.prototype.setMap.apply(this,arguments);this.renderer?(this.renderer.map=this.map,this.renderer.setSize(this.map.getSize())):this.map.removeLayer(this)},afterAdd:function(){if(this.strategies){var a,b,d;b=0;for(d=this.strategies.length;b<d;b++)a=this.strategies[b],a.autoActivate&&a.activate()}},removeMap:function(){this.drawn=
!1;if(this.strategies){var a,b,d;b=0;for(d=this.strategies.length;b<d;b++)a=this.strategies[b],a.autoActivate&&a.deactivate()}},onMapResize:function(){b.Layer.prototype.onMapResize.apply(this,arguments);this.renderer.setSize(this.map.getSize())},moveTo:function(a,c,d){b.Layer.prototype.moveTo.apply(this,arguments);var f=b.Renderer.NG&&this.renderer instanceof b.Renderer.NG;if(f)d||this.renderer.updateDimensions(c);else{var e=!0;if(!d){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";e=this.renderer.setExtent(this.map.getExtent(),c);this.renderer.root.style.visibility="visible";if(b.IS_GECKO===!0)this.div.scrollLeft=this.div.scrollLeft;if(!c&&e)for(var g in this.unrenderedFeatures){var h=this.unrenderedFeatures[g];this.drawFeature(h)}}}if(!this.drawn||!f&&(c||!e)){this.drawn=!0;g=0;for(f=this.features.length;g<f;g++)this.renderer.locked=g!==f-1,h=this.features[g],
this.drawFeature(h)}},redraw:function(){if(b.Renderer.NG&&this.renderer instanceof b.Renderer.NG)this.drawn=!1;return b.Layer.prototype.redraw.apply(this,arguments)},display:function(){b.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,c){b.Util.isArray(a)||(a=[a]);var d=!c||!c.silent;if(d){var f={features:a};if(this.events.triggerEvent("beforefeaturesadded",f)===!1)return;a=
f.features}for(var f=[],e=0,g=a.length;e<g;e++){this.renderer.locked=e!=a.length-1?!0:!1;var h=a[e];if(this.geometryType&&!(h.geometry instanceof this.geometryType))throw b.i18n("componentShouldBe",{geomType:this.geometryType.prototype.CLASS_NAME});h.layer=this;if(!h.style&&this.style)h.style=b.Util.extend({},this.style);if(d){if(this.events.triggerEvent("beforefeatureadded",{feature:h})===!1)continue;this.preFeatureInsert(h)}f.push(h);this.features.push(h);this.drawFeature(h);d&&(this.events.triggerEvent("featureadded",
{feature:h}),this.onFeatureInsert(h))}d&&this.events.triggerEvent("featuresadded",{features:f})},removeFeatures:function(a,c){if(a&&a.length!==0){if(a===this.features)return this.removeAllFeatures(c);b.Util.isArray(a)||(a=[a]);a===this.selectedFeatures&&(a=a.slice());var d=!c||!c.silent;d&&this.events.triggerEvent("beforefeaturesremoved",{features:a});for(var f=a.length-1;f>=0;f--){this.renderer.locked=f!=0&&a[f-1].geometry?!0:!1;var e=a[f];delete this.unrenderedFeatures[e.id];d&&this.events.triggerEvent("beforefeatureremoved",
{feature:e});this.features=b.Util.removeItem(this.features,e);e.layer=null;e.geometry&&this.renderer.eraseFeatures(e);b.Util.indexOf(this.selectedFeatures,e)!=-1&&b.Util.removeItem(this.selectedFeatures,e);d&&this.events.triggerEvent("featureremoved",{feature:e})}d&&this.events.triggerEvent("featuresremoved",{features:a})}},removeAllFeatures:function(a){var a=!a||!a.silent,b=this.features;a&&this.events.triggerEvent("beforefeaturesremoved",{features:b});for(var d,f=b.length-1;f>=0;f--)d=b[f],a&&this.events.triggerEvent("beforefeatureremoved",
{feature:d}),d.layer=null,a&&this.events.triggerEvent("featureremoved",{feature:d});this.renderer.clear();this.features=[];this.unrenderedFeatures={};this.selectedFeatures=[];a&&this.events.triggerEvent("featuresremoved",{features:b})},destroyFeatures:function(a,b){if(a==void 0)a=this.features;if(a){this.removeFeatures(a,b);for(var d=a.length-1;d>=0;d--)a[d].destroy()}},drawFeature:function(a,c){if(this.drawn){if(typeof c!="object"){!c&&a.state===b.State.DELETE&&(c="delete");var d=c||a.renderIntent;
(c=a.style||this.style)||(c=this.styleMap.createSymbolizer(a,d))}d=this.renderer.drawFeature(a,c);d===!1||d===null?this.unrenderedFeatures[a.id]=a:delete this.unrenderedFeatures[a.id]}},eraseFeatures:function(a){this.renderer.eraseFeatures(a)},getFeatureFromEvent:function(a){if(!this.renderer)return b.Console.error(b.i18n("getFeatureError")),null;var c=null;(a=this.renderer.getFeatureIdFromEvent(a))&&(c=typeof a==="string"?this.getFeatureById(a):a);return c},getFeatureBy:function(a,b){for(var d=null,
f=0,e=this.features.length;f<e;++f)if(this.features[f][a]==b){d=this.features[f];break}return d},getFeatureById:function(a){return this.getFeatureBy("id",a)},getFeatureByFid:function(a){return this.getFeatureBy("fid",a)},getFeaturesByAttribute:function(a,b){var d,f,e=this.features.length,g=[];for(d=0;d<e;d++)(f=this.features[d])&&f.attributes&&f.attributes[a]===b&&g.push(f);return g},onFeatureInsert:function(){},preFeatureInsert:function(){},getDataExtent:function(){var a=null,c=this.features;if(c&&
c.length>0)for(var d=null,f=0,e=c.length;f<e;f++)if(d=c[f].geometry)a===null&&(a=new b.Bounds),a.extend(d.getBounds());return a},CLASS_NAME:"OpenLayers.Layer.Vector"});b.Strategy=b.Class({layer:null,options:null,active:null,autoActivate:!0,autoDestroy:!0,initialize:function(a){b.Util.extend(this,a);this.options=a;this.active=!1},destroy:function(){this.deactivate();this.options=this.layer=null},setLayer:function(a){this.layer=a},activate:function(){if(!this.active)return this.active=!0;return!1},
deactivate:function(){if(this.active)return this.active=!1,!0;return!1},CLASS_NAME:"OpenLayers.Strategy"});b.Strategy.BBOX=b.Class(b.Strategy,{bounds:null,resolution:null,ratio:2,resFactor:null,response:null,activate:function(){var a=b.Strategy.prototype.activate.call(this);if(a)if(this.layer.events.on({moveend:this.update,scope:this}),this.layer.events.on({refresh:this.update,scope:this}),this.layer.visibility===!0&&this.layer.inRange===!0)this.update();else this.layer.events.on({visibilitychanged:this.update,
scope:this});return a},deactivate:function(){var a=b.Strategy.prototype.deactivate.call(this);a&&this.layer.events.un({moveend:this.update,refresh:this.update,visibilitychanged:this.update,scope:this});return a},update:function(a){var b=this.getMapBounds();if(b!==null&&(a&&a.force||this.invalidBounds(b)))this.calculateBounds(b),this.resolution=this.layer.map.getResolution(),this.triggerRead(a)},getMapBounds:function(){if(this.layer.map===null)return null;var a=this.layer.map.getExtent();a&&!this.layer.projection.equals(this.layer.map.getProjectionObject())&&
(a=a.clone().transform(this.layer.map.getProjectionObject(),this.layer.projection));return a},invalidBounds:function(a){a||(a=this.getMapBounds());a=!this.bounds||!this.bounds.containsBounds(a);!a&&this.resFactor&&(a=this.resolution/this.layer.map.getResolution(),a=a>=this.resFactor||a<=1/this.resFactor);return a},calculateBounds:function(a){a||(a=this.getMapBounds());var c=a.getCenterLonLat(),d=a.getWidth()*this.ratio,a=a.getHeight()*this.ratio;this.bounds=new b.Bounds(c.lon-d/2,c.lat-a/2,c.lon+
d/2,c.lat+a/2)},triggerRead:function(a){this.response&&(this.layer.protocol.abort(this.response),this.layer.events.triggerEvent("loadend"));this.layer.events.triggerEvent("loadstart");this.response=this.layer.protocol.read(b.Util.applyDefaults({filter:this.createFilter(),callback:this.merge,scope:this},a))},createFilter:function(){var a=new b.Filter.Spatial({type:b.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});this.layer.filter&&(a=new b.Filter.Logical({type:b.Filter.Logical.AND,
filters:[this.layer.filter,a]}));return a},merge:function(a){this.layer.destroyFeatures();if((a=a.features)&&a.length>0){var b=this.layer.projection,d=this.layer.map.getProjectionObject();if(!d.equals(b))for(var f,e=0,g=a.length;e<g;++e)(f=a[e].geometry)&&f.transform(b,d);this.layer.addFeatures(a)}this.response=null;this.layer.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.BBOX"});b.ElementsIndexer=b.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(a){this.compare=
a?b.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:b.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;this.clear()},insert:function(a){this.exists(a)&&this.remove(a);var c=a.id;this.determineZIndex(a);for(var d=-1,f=this.order.length,e;f-d>1;)e=parseInt((d+f)/2),this.compare(this,a,b.Util.getElement(this.order[e]))>0?d=e:f=e;this.order.splice(f,0,c);this.indices[c]=this.getZIndex(a);return this.getNextElement(f)},remove:function(a){var a=a.id,c=b.Util.indexOf(this.order,a);if(c>=0)this.order.splice(c,
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+=1;if(a<this.order.length){var c=b.Util.getElement(this.order[a]);
c==void 0&&(c=this.getNextElement(a));return c}else return null},CLASS_NAME:"OpenLayers.ElementsIndexer"});b.ElementsIndexer.IndexingMethods={Z_ORDER:function(a,b,d){var b=a.getZIndex(b),f=0;d&&(a=a.getZIndex(d),f=b-a);return f},Z_ORDER_DRAWING_ORDER:function(a,c,d){a=b.ElementsIndexer.IndexingMethods.Z_ORDER(a,c,d);d&&a==0&&(a=1);return a},Z_ORDER_Y_ORDER:function(a,c,d){a=b.ElementsIndexer.IndexingMethods.Z_ORDER(a,c,d);d&&a===0&&(c=d._boundsBottom-c._boundsBottom,a=c===0?1:c);return a}};b.Renderer.Elements=
b.Class(b.Renderer,{rendererRoot:null,root:null,vectorRoot:null,textRoot:null,xmlns:null,indexer:null,BACKGROUND_ID_SUFFIX:"_background",LABEL_ID_SUFFIX:"_label",initialize:function(a,c){b.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(c&&(c.zIndexing||c.yOrdering))this.indexer=new b.ElementsIndexer(c.yOrdering)},destroy:function(){this.clear();this.xmlns=this.root=this.rendererRoot=null;b.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){var a,b=this.vectorRoot;if(b)for(;a=b.firstChild;)b.removeChild(a);if(b=this.textRoot)for(;a=b.firstChild;)b.removeChild(a);this.indexer&&this.indexer.clear()},getNodeType:function(){},drawGeometry:function(a,b,d){var f=a.CLASS_NAME,
e=!0;if(f=="OpenLayers.Geometry.Collection"||f=="OpenLayers.Geometry.MultiPoint"||f=="OpenLayers.Geometry.MultiLineString"||f=="OpenLayers.Geometry.MultiPolygon"){for(var f=0,g=a.components.length;f<g;f++)e=this.drawGeometry(a.components[f],b,d)&&e;return e}f=e=!1;b.display!="none"&&(b.backgroundGraphic?this.redrawBackgroundNode(a.id,a,b,d):f=!0,e=this.redrawNode(a.id,a,b,d));if(e==!1&&(b=document.getElementById(a.id)))b._style.backgroundGraphic&&(f=!0),b.parentNode.removeChild(b);f&&(b=document.getElementById(a.id+
this.BACKGROUND_ID_SUFFIX))&&b.parentNode.removeChild(b);return e},redrawNode:function(a,b,d,f){d=this.applyDefaultSymbolizer(d);a=this.nodeFactory(a,this.getNodeType(b,d));a._featureId=f;a._boundsBottom=b.getBounds().bottom;a._geometryClass=b.CLASS_NAME;a._style=d;b=this.drawGeometryNode(a,b,d);if(b===!1)return!1;a=b.node;this.indexer?(d=this.indexer.insert(a))?this.vectorRoot.insertBefore(a,d):this.vectorRoot.appendChild(a):a.parentNode!==this.vectorRoot&&this.vectorRoot.appendChild(a);this.postDraw(a);
return b.complete},redrawBackgroundNode:function(a,c,d){d=b.Util.extend({},d);d.externalGraphic=d.backgroundGraphic;d.graphicXOffset=d.backgroundXOffset;d.graphicYOffset=d.backgroundYOffset;d.graphicZIndex=d.backgroundGraphicZIndex;d.graphicWidth=d.backgroundWidth||d.graphicWidth;d.graphicHeight=d.backgroundHeight||d.graphicHeight;d.backgroundGraphic=null;d.backgroundXOffset=null;d.backgroundYOffset=null;d.backgroundGraphicZIndex=null;return this.redrawNode(a+this.BACKGROUND_ID_SUFFIX,c,d,null)},
drawGeometryNode:function(a,b,d){var d=d||a._style,f={isFilled:d.fill===void 0?!0:d.fill,isStroked:d.stroke===void 0?!!d.strokeWidth:d.stroke},e;switch(b.CLASS_NAME){case "OpenLayers.Geometry.Point":if(d.graphic===!1)f.isFilled=!1,f.isStroked=!1;e=this.drawPoint(a,b);break;case "OpenLayers.Geometry.LineString":f.isFilled=!1;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)}a._options=f;return e!=!1?{node:this.setStyle(a,d,f,b),complete:e}:!1},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,d=b&&b.correspondingUseElement;return(d?d:b||a.srcElement)._featureId},eraseGeometry:function(a,c){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 d=0,f=a.components.length;d<f;d++)this.eraseGeometry(a.components[d],c);else if((d=b.Util.getElement(a.id))&&d.parentNode){if(d.geometry)d.geometry.destroy(),d.geometry=null;d.parentNode.removeChild(d);
this.indexer&&this.indexer.remove(d);d._style.backgroundGraphic&&(d=b.Util.getElement(a.id+this.BACKGROUND_ID_SUFFIX))&&d.parentNode&&d.parentNode.removeChild(d)}},nodeFactory:function(a,c){var d=b.Util.getElement(a);d?this.nodeTypeCompare(d,c)||(d.parentNode.removeChild(d),d=this.nodeFactory(a,c)):d=this.createNode(c,a);return d},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"});b.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]};b.Renderer.SVG=b.Class(b.Renderer.Elements,
{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15E3,translationParameters:null,symbolMetrics:null,initialize:function(){if(this.supported())b.Renderer.Elements.prototype.initialize.apply(this,arguments),this.translationParameters={x:0,y:0},this.symbolMetrics={}},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,d){a+=d?0:this.translationParameters.x;b+=d?0:this.translationParameters.y;return a>=-this.MAX_PIXEL&&a<=this.MAX_PIXEL&&b>=-this.MAX_PIXEL&&b<=this.MAX_PIXEL},setExtent:function(a,c){b.Renderer.Elements.prototype.setExtent.apply(this,arguments);var d=this.getResolution(),f=-a.left/d,d=a.top/d;return c?(this.left=f,this.top=d,this.rendererRoot.setAttributeNS(null,"viewBox","0 0 "+this.size.w+" "+this.size.h),this.translate(0,0),!0):((f=this.translate(f-this.left,
d-this.top))||this.setExtent(a,!0),f)},translate:function(a,b){if(this.inValidRange(a,b,!0)){var d="";if(a||b)d="translate("+a+","+b+")";this.root.setAttributeNS(null,"transform",d);this.translationParameters={x:a,y:b};return!0}else return!1},setSize:function(){b.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 d=null;switch(a.CLASS_NAME){case "OpenLayers.Geometry.Point":d=
b.externalGraphic?"image":this.isComplexSymbol(b.graphicName)?"svg":"circle";break;case "OpenLayers.Geometry.Rectangle":d="rect";break;case "OpenLayers.Geometry.LineString":d="polyline";break;case "OpenLayers.Geometry.LinearRing":d="polygon";break;case "OpenLayers.Geometry.Polygon":case "OpenLayers.Geometry.Curve":case "OpenLayers.Geometry.Surface":d="path"}return d},setStyle:function(a,c,d){var c=c||a._style,d=d||a._options,f=parseFloat(a.getAttributeNS(null,"r")),e=1,g;if(a._geometryClass=="OpenLayers.Geometry.Point"&&
f){a.style.visibility="";if(c.graphic===!1)a.style.visibility="hidden";else if(c.externalGraphic){g=this.getPosition(a);if(c.graphicTitle)a.setAttributeNS(null,"title",c.graphicTitle),f=this.nodeFactory(null,"title"),f.textContent=c.graphicTitle,a.appendChild(f);c.graphicWidth&&c.graphicHeight&&a.setAttributeNS(null,"preserveAspectRatio","none");var f=c.graphicWidth||c.graphicHeight,h=c.graphicHeight||c.graphicWidth,f=f?f:c.pointRadius*2,h=h?h:c.pointRadius*2,i=c.graphicYOffset!=void 0?c.graphicYOffset:
-(0.5*h),k=c.graphicOpacity||c.fillOpacity;a.setAttributeNS(null,"x",(g.x+(c.graphicXOffset!=void 0?c.graphicXOffset:-(0.5*f))).toFixed());a.setAttributeNS(null,"y",(g.y+i).toFixed());a.setAttributeNS(null,"width",f);a.setAttributeNS(null,"height",h);a.setAttributeNS(this.xlinkns,"href",c.externalGraphic);a.setAttributeNS(null,"style","opacity: "+k);a.onclick=b.Renderer.SVG.preventDefault}else if(this.isComplexSymbol(c.graphicName)){var f=c.pointRadius*3,h=f*2,j=this.importSymbol(c.graphicName);g=
this.getPosition(a);e=this.symbolMetrics[j.id][0]*3/h;i=a.parentNode;k=a.nextSibling;i&&i.removeChild(a);a.firstChild&&a.removeChild(a.firstChild);a.appendChild(j.firstChild.cloneNode(!0));a.setAttributeNS(null,"viewBox",j.getAttributeNS(null,"viewBox"));a.setAttributeNS(null,"width",h);a.setAttributeNS(null,"height",h);a.setAttributeNS(null,"x",g.x-f);a.setAttributeNS(null,"y",g.y-f);k?i.insertBefore(a,k):i&&i.appendChild(a)}else a.setAttributeNS(null,"r",c.pointRadius);f=c.rotation;if((f!==void 0||
a._rotation!==void 0)&&g)a._rotation=f,f|=0,a.nodeName!=="svg"?a.setAttributeNS(null,"transform","rotate("+f+" "+g.x+" "+g.y+")"):(g=this.symbolMetrics[j.id],a.firstChild.setAttributeNS(null,"transform","rotate("+f+" "+g[1]+" "+g[2]+")"))}d.isFilled?(a.setAttributeNS(null,"fill",c.fillColor),a.setAttributeNS(null,"fill-opacity",c.fillOpacity)):a.setAttributeNS(null,"fill","none");d.isStroked?(a.setAttributeNS(null,"stroke",c.strokeColor),a.setAttributeNS(null,"stroke-opacity",c.strokeOpacity),a.setAttributeNS(null,
"stroke-width",c.strokeWidth*e),a.setAttributeNS(null,"stroke-linecap",c.strokeLinecap||"round"),a.setAttributeNS(null,"stroke-linejoin","round"),c.strokeDashstyle&&a.setAttributeNS(null,"stroke-dasharray",this.dashStyle(c,e))):a.setAttributeNS(null,"stroke","none");c.pointerEvents&&a.setAttributeNS(null,"pointer-events",c.pointerEvents);c.cursor!=null&&a.setAttributeNS(null,"cursor",c.cursor);return a},dashStyle:function(a,c){var d=a.strokeWidth*c,f=a.strokeDashstyle;switch(f){case "solid":return"none";
case "dot":return[1,4*d].join();case "dash":return[4*d,4*d].join();case "dashdot":return[4*d,4*d,1,4*d].join();case "longdash":return[8*d,4*d].join();case "longdashdot":return[8*d,4*d,1,4*d].join();default:return b.String.trim(f).replace(/\s+/g,",")}},createNode:function(a,b){var d=document.createElementNS(this.xmlns,a);b&&d.setAttributeNS(null,"id",b);return d},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,d){var f=this.getResolution(),e=b.x/f+this.left,b=this.top-b.y/f;return this.inValidRange(e,b)?(a.setAttributeNS(null,"cx",e),a.setAttributeNS(null,"cy",b),a.setAttributeNS(null,"r",d),a):!1},drawLineString:function(a,b){var d=
this.getComponentsString(b.components);return d.path?(a.setAttributeNS(null,"points",d.path),d.complete?a:null):!1},drawLinearRing:function(a,b){var d=this.getComponentsString(b.components);return d.path?(a.setAttributeNS(null,"points",d.path),d.complete?a:null):!1},drawPolygon:function(a,b){for(var d="",f=!0,e=!0,g,h,i=0,k=b.components.length;i<k;i++)d+=" M",g=this.getComponentsString(b.components[i].components," "),(h=g.path)?(d+=" "+h,e=g.complete&&e):f=!1;d+=" z";return f?(a.setAttributeNS(null,
"d",d),a.setAttributeNS(null,"fill-rule","evenodd"),e?a:null):!1},drawRectangle:function(a,b){var d=this.getResolution(),f=b.x/d+this.left,e=this.top-b.y/d;return this.inValidRange(f,e)?(a.setAttributeNS(null,"x",f),a.setAttributeNS(null,"y",e),a.setAttributeNS(null,"width",b.width/d),a.setAttributeNS(null,"height",b.height/d),a):!1},drawSurface:function(a,b){for(var d=null,f=!0,e=0,g=b.components.length;e<g;e++)if(e%3==0&&e/3==0){var h=this.getShortString(b.components[e]);h||(f=!1);d="M "+h}else e%
3==1?((h=this.getShortString(b.components[e]))||(f=!1),d+=" C "+h):((h=this.getShortString(b.components[e]))||(f=!1),d+=" "+h);d+=" Z";return f?(a.setAttributeNS(null,"d",d),a):!1},drawText:function(a,c,d){var f=this.getResolution(),e=d.x/f+this.left,g=d.y/f-this.top,f=this.nodeFactory(a+this.LABEL_ID_SUFFIX,"text");f.setAttributeNS(null,"x",e);f.setAttributeNS(null,"y",-g);c.fontColor&&f.setAttributeNS(null,"fill",c.fontColor);c.fontOpacity&&f.setAttributeNS(null,"opacity",c.fontOpacity);c.fontFamily&&
f.setAttributeNS(null,"font-family",c.fontFamily);c.fontSize&&f.setAttributeNS(null,"font-size",c.fontSize);c.fontWeight&&f.setAttributeNS(null,"font-weight",c.fontWeight);c.fontStyle&&f.setAttributeNS(null,"font-style",c.fontStyle);c.labelSelect===!0?(f.setAttributeNS(null,"pointer-events","visible"),f._featureId=a):f.setAttributeNS(null,"pointer-events","none");g=c.labelAlign||"cm";f.setAttributeNS(null,"text-anchor",b.Renderer.SVG.LABEL_ALIGN[g[0]]||"middle");b.IS_GECKO===!0&&f.setAttributeNS(null,
"dominant-baseline",b.Renderer.SVG.LABEL_ALIGN[g[1]]||"central");for(var h=c.label.split("\n"),i=h.length;f.childNodes.length>i;)f.removeChild(f.lastChild);for(var k=0;k<i;k++){var j=this.nodeFactory(a+this.LABEL_ID_SUFFIX+"_tspan_"+k,"tspan");if(c.labelSelect===!0)j._featureId=a,j._geometry=d,j._geometryClass=d.CLASS_NAME;b.IS_GECKO===!1&&j.setAttributeNS(null,"baseline-shift",b.Renderer.SVG.LABEL_VSHIFT[g[1]]||"-35%");j.setAttribute("x",e);if(k==0){var l=b.Renderer.SVG.LABEL_VFACTOR[g[1]];l==null&&
(l=-0.5);j.setAttribute("dy",l*(i-1)+"em")}else j.setAttribute("dy","1em");j.textContent=h[k]===""?" ":h[k];j.parentNode||f.appendChild(j)}f.parentNode||this.textRoot.appendChild(f)},getComponentsString:function(a,b){for(var d=[],f=!0,e=a.length,g=[],h,i=0;i<e;i++)h=a[i],d.push(h),(h=this.getShortString(h))?g.push(h):(i>0&&this.getShortString(a[i-1])&&g.push(this.clipLine(a[i],a[i-1])),i<e-1&&this.getShortString(a[i+1])&&g.push(this.clipLine(a[i],a[i+1])),f=!1);return{path:g.join(b||","),complete:f}},
clipLine:function(a,b){if(b.equals(a))return"";var d=this.getResolution(),f=this.MAX_PIXEL-this.translationParameters.x,e=this.MAX_PIXEL-this.translationParameters.y,g=b.x/d+this.left,h=this.top-b.y/d,i=a.x/d+this.left,d=this.top-a.y/d,k;if(i<-f||i>f)k=(d-h)/(i-g),i=i<0?-f:f,d=h+(i-g)*k;if(d<-e||d>e)k=(i-g)/(d-h),d=d<0?-e:e,i=g+(d-h)*k;return i+","+d},getShortString:function(a){var b=this.getResolution(),d=a.x/b+this.left,a=this.top-a.y/b;return this.inValidRange(d,a)?d+","+a:!1},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 c=this.container.id+"-"+a,d=document.getElementById(c);if(d!=null)return d;var f=b.Renderer.symbol[a];if(!f)throw Error(a+" is not a valid symbol name");var a=this.nodeFactory(c,"symbol"),e=this.nodeFactory(null,"polygon");a.appendChild(e);for(var d=new b.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0),g=[],h,i,k=0;k<f.length;k+=2)h=f[k],i=f[k+1],d.left=Math.min(d.left,h),d.bottom=
Math.min(d.bottom,i),d.right=Math.max(d.right,h),d.top=Math.max(d.top,i),g.push(h,",",i);e.setAttributeNS(null,"points",g.join(" "));f=d.getWidth();e=d.getHeight();a.setAttributeNS(null,"viewBox",[d.left-f,d.bottom-e,f*3,e*3].join(" "));this.symbolMetrics[c]=[Math.max(f,e),d.getCenterLonLat().lon,d.getCenterLonLat().lat];this.defs.appendChild(a);return a},getFeatureIdFromEvent:function(a){var c=b.Renderer.Elements.prototype.getFeatureIdFromEvent.apply(this,arguments);if(!c)c=a.target,c=c.parentNode&&
c!=this.rendererRoot&&c.parentNode._featureId;return c},CLASS_NAME:"OpenLayers.Renderer.SVG"});b.Renderer.SVG.LABEL_ALIGN={l:"start",r:"end",b:"bottom",t:"hanging"};b.Renderer.SVG.LABEL_VSHIFT={t:"-70%",b:"0"};b.Renderer.SVG.LABEL_VFACTOR={t:0,b:-1};b.Renderer.SVG.preventDefault=function(a){a.preventDefault&&a.preventDefault()};b.Renderer.VML=b.Class(b.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(),c=["shape","rect","oval","fill","stroke","imagedata","group","textbox"],d=0,f=c.length;d<f;d++)a.addRule("olv\\:"+c[d],"behavior: url(#default#VML); position: absolute; display: inline-block;")}b.Renderer.Elements.prototype.initialize.apply(this,arguments)}},supported:function(){return!!document.namespaces},setExtent:function(a,c){b.Renderer.Elements.prototype.setExtent.apply(this,arguments);var d=this.getResolution(),f=a.left/d|0,d=a.top/d-this.size.h|
0;c||!this.offset?(this.offset={x:f,y:d},d=f=0):(f-=this.offset.x,d-=this.offset.y);this.root.coordorigin=f+" "+d;for(var f=[this.root,this.vectorRoot,this.textRoot],e=0,g=f.length;e<g;++e)d=f[e],d.coordsize=this.size.w+" "+this.size.h;this.root.style.flip="y";return!0},setSize:function(){b.Renderer.prototype.setSize.apply(this,arguments);for(var a=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot],c=this.size.w+"px",d=this.size.h+"px",f,e=0,g=a.length;e<g;++e)f=a[e],f.style.width=c,f.style.height=
d},getNodeType:function(a,b){var d=null;switch(a.CLASS_NAME){case "OpenLayers.Geometry.Point":d=b.externalGraphic?"olv:rect":this.isComplexSymbol(b.graphicName)?"olv:shape":"olv:oval";break;case "OpenLayers.Geometry.Rectangle":d="olv:rect";break;case "OpenLayers.Geometry.LineString":case "OpenLayers.Geometry.LinearRing":case "OpenLayers.Geometry.Polygon":case "OpenLayers.Geometry.Curve":case "OpenLayers.Geometry.Surface":d="olv:shape"}return d},setStyle:function(a,b,d,f){var b=b||a._style,d=d||a._options,
e=b.fillColor;if(a._geometryClass==="OpenLayers.Geometry.Point")if(b.externalGraphic){d.isFilled=!0;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,h=this.getResolution(),i=b.graphicXOffset!=void 0?b.graphicXOffset:-(0.5*e),k=b.graphicYOffset!=void 0?b.graphicYOffset:-(0.5*g);a.style.left=(f.x/h-this.offset.x+i|0)+"px";a.style.top=(f.y/h-this.offset.y-(k+g)|0)+"px";a.style.width=e+"px";a.style.height=
g+"px";a.style.flip="y";e="none";d.isStroked=!1}else this.isComplexSymbol(b.graphicName)?(g=this.importSymbol(b.graphicName),a.path=g.path,a.coordorigin=g.left+","+g.bottom,g=g.size,a.coordsize=g+","+g,this.drawCircle(a,f,b.pointRadius),a.style.flip="y"):this.drawCircle(a,f,b.pointRadius);d.isFilled?a.fillcolor=e:a.filled="false";f=a.getElementsByTagName("fill");f=f.length==0?null:f[0];if(d.isFilled){f||(f=this.createNode("olv:fill",a.id+"_fill"));f.opacity=b.fillOpacity;if(a._geometryClass==="OpenLayers.Geometry.Point"&&
b.externalGraphic){if(b.graphicOpacity)f.opacity=b.graphicOpacity;f.src=b.externalGraphic;f.type="frame";if(!b.graphicWidth||!b.graphicHeight)f.aspect="atmost"}f.parentNode!=a&&a.appendChild(f)}else f&&a.removeChild(f);e=b.rotation;if(e!==void 0||a._rotation!==void 0)if(a._rotation=e,b.externalGraphic)this.graphicRotate(a,i,k,b),f.opacity=0;else if(a._geometryClass==="OpenLayers.Geometry.Point")a.style.rotation=e||0;i=a.getElementsByTagName("stroke");i=i.length==0?null:i[0];if(d.isStroked){if(i||
(i=this.createNode("olv:stroke",a.id+"_stroke"),a.appendChild(i)),i.on=!0,i.color=b.strokeColor,i.weight=b.strokeWidth+"px",i.opacity=b.strokeOpacity,i.endcap=b.strokeLinecap=="butt"?"flat":b.strokeLinecap||"round",b.strokeDashstyle)i.dashstyle=this.dashStyle(b)}else if(a.stroked=!1,i)i.on=!1;if(b.cursor!="inherit"&&b.cursor!=null)a.style.cursor=b.cursor;return a},graphicRotate:function(a,c,d,f){var f=f||a._style,e=f.rotation||0,g,h;if(!f.graphicWidth||!f.graphicHeight){var i=new Image;i.onreadystatechange=
b.Function.bind(function(){if(i.readyState=="complete"||i.readyState=="interactive")g=i.width/i.height,h=Math.max(f.pointRadius*2,f.graphicWidth||0,f.graphicHeight||0),c*=g,f.graphicWidth=h*g,f.graphicHeight=h,this.graphicRotate(a,c,d,f)},this);i.src=f.externalGraphic}else{h=Math.max(f.graphicWidth,f.graphicHeight);g=f.graphicWidth/f.graphicHeight;var k=Math.round(f.graphicWidth||h*g),j=Math.round(f.graphicHeight||h);a.style.width=k+"px";a.style.height=j+"px";var l=document.getElementById(a.id+"_image");
l||(l=this.createNode("olv:imagedata",a.id+"_image"),a.appendChild(l));l.style.width=k+"px";l.style.height=j+"px";l.src=f.externalGraphic;l.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";l=e*Math.PI/180;e=Math.sin(l);l=Math.cos(l);e="progid:DXImageTransform.Microsoft.Matrix(M11="+l+",M12="+-e+",M21="+e+",M22="+l+",SizingMethod='auto expand')\n";(l=f.graphicOpacity||f.fillOpacity)&&l!=1&&(e+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+l+
")\n");a.style.filter=e;e=new b.Geometry.Point(-c,-d);k=(new b.Bounds(0,0,k,j)).toGeometry();k.rotate(f.rotation,e);k=k.getBounds();a.style.left=Math.round(parseInt(a.style.left)+k.left)+"px";a.style.top=Math.round(parseInt(a.style.top)-k.bottom)+"px"}},postDraw:function(a){a.style.visibility="visible";var b=a._style.fillColor,d=a._style.strokeColor;if(b=="none"&&a.fillcolor!=b)a.fillcolor=b;if(d=="none"&&a.strokecolor!=d)a.strokecolor=d},setNodeDimension:function(a,c){var d=c.getBounds();if(d){var f=
this.getResolution(),d=new b.Bounds(d.left/f-this.offset.x|0,d.bottom/f-this.offset.y|0,d.right/f-this.offset.x|0,d.top/f-this.offset.y|0);a.style.left=d.left+"px";a.style.top=d.top+"px";a.style.width=d.getWidth()+"px";a.style.height=d.getHeight()+"px";a.coordorigin=d.left+" "+d.top;a.coordsize=d.getWidth()+" "+d.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,c){var d=document.createElement(a);if(c)d.id=c;d.unselectable="on";d.onselectstart=b.Function.False;return d},nodeTypeCompare:function(a,b){var d=b,f=d.indexOf(":");f!=-1&&(d=d.substr(f+1));var e=a.nodeName,f=e.indexOf(":");f!=-1&&(e=e.substr(f+1));return d==e},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,d){if(!isNaN(b.x)&&!isNaN(b.y)){var f=this.getResolution();a.style.left=(b.x/f-this.offset.x|0)-d+"px";a.style.top=(b.y/f-this.offset.y|0)-d+"px";b=d*2;a.style.width=b+"px";a.style.height=b+"px";return a}return!1},drawLineString:function(a,b){return this.drawLine(a,b,!1)},drawLinearRing:function(a,b){return this.drawLine(a,
b,!0)},drawLine:function(a,b,d){this.setNodeDimension(a,b);for(var f=this.getResolution(),e=b.components.length,g=Array(e),h,i,k=0;k<e;k++)h=b.components[k],i=h.x/f-this.offset.x|0,h=h.y/f-this.offset.y|0,g[k]=" "+i+","+h+" l ";a.path="m"+g.join("")+(d?" x e":" e");return a},drawPolygon:function(a,b){this.setNodeDimension(a,b);var d=this.getResolution(),f=[],e,g,h,i,k,j,l,m,n,o;e=0;for(g=b.components.length;e<g;e++){f.push("m");h=b.components[e].components;i=e===0;j=k=null;l=0;for(m=h.length;l<m;l++)n=
h[l],o=n.x/d-this.offset.x|0,n=n.y/d-this.offset.y|0,o=" "+o+","+n,f.push(o),l==0&&f.push(" l"),i||(k?k!=o&&(j?j!=o&&(i=!0):j=o):k=o);f.push(i?" x ":" ")}f.push("e");a.path=f.join("");return a},drawRectangle:function(a,b){var d=this.getResolution();a.style.left=(b.x/d-this.offset.x|0)+"px";a.style.top=(b.y/d-this.offset.y|0)+"px";a.style.width=(b.width/d|0)+"px";a.style.height=(b.height/d|0)+"px";return a},drawText:function(a,c,d){var f=this.nodeFactory(a+this.LABEL_ID_SUFFIX,"olv:rect"),e=this.nodeFactory(a+
this.LABEL_ID_SUFFIX+"_textbox","olv:textbox"),g=this.getResolution();f.style.left=(d.x/g-this.offset.x|0)+"px";f.style.top=(d.y/g-this.offset.y|0)+"px";f.style.flip="y";e.innerText=c.label;if(c.cursor!="inherit"&&c.cursor!=null)e.style.cursor=c.cursor;if(c.fontColor)e.style.color=c.fontColor;if(c.fontOpacity)e.style.filter="alpha(opacity="+c.fontOpacity*100+")";if(c.fontFamily)e.style.fontFamily=c.fontFamily;if(c.fontSize)e.style.fontSize=c.fontSize;if(c.fontWeight)e.style.fontWeight=c.fontWeight;
if(c.fontStyle)e.style.fontStyle=c.fontStyle;if(c.labelSelect===!0)f._featureId=a,e._featureId=a,e._geometry=d,e._geometryClass=d.CLASS_NAME;e.style.whiteSpace="nowrap";e.inset="1px,0px,0px,0px";f.parentNode||(f.appendChild(e),this.textRoot.appendChild(f));c=c.labelAlign||"cm";c.length==1&&(c+="m");a=e.clientWidth*b.Renderer.VML.LABEL_SHIFT[c.substr(0,1)];e=e.clientHeight*b.Renderer.VML.LABEL_SHIFT[c.substr(1,1)];f.style.left=parseInt(f.style.left)-a-1+"px";f.style.top=parseInt(f.style.top)+e+"px"},
drawSurface:function(a,b){this.setNodeDimension(a,b);for(var d=this.getResolution(),f=[],e,g,h=0,i=b.components.length;h<i;h++)e=b.components[h],g=e.x/d-this.offset.x|0,e=e.y/d-this.offset.y|0,h%3==0&&h/3==0?f.push("m"):h%3==1&&f.push(" c"),f.push(" "+g+","+e);f.push(" x e");a.path=f.join("");return a},moveRoot:function(a){var c=this.map.getLayer(a.container.id);c instanceof b.Layer.Vector.RootContainer&&(c=this.map.getLayer(this.container.id));c&&c.renderer.clear();b.Renderer.Elements.prototype.moveRoot.apply(this,
arguments);c&&c.redraw()},importSymbol:function(a){var c=this.container.id+"-"+a,d=this.symbolCache[c];if(d)return d;d=b.Renderer.symbol[a];if(!d)throw Error(a+" is not a valid symbol name");for(var a=new b.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0),f=["m"],e=0;e<d.length;e+=2){var g=d[e],h=d[e+1];a.left=Math.min(a.left,g);a.bottom=Math.min(a.bottom,h);a.right=Math.max(a.right,g);a.top=Math.max(a.top,h);f.push(g);f.push(h);e==0&&f.push("l")}f.push("x e");d=f.join(" ");f=(a.getWidth()-a.getHeight())/
2;f>0?(a.bottom-=f,a.top+=f):(a.left+=f,a.right-=f);d={path:d,size:a.getWidth(),left:a.left,bottom:a.bottom};return this.symbolCache[c]=d},CLASS_NAME:"OpenLayers.Renderer.VML"});b.Renderer.VML.LABEL_SHIFT={l:0,c:0.5,r:1,t:0,m:0.5,b:1};b.Renderer.Canvas=b.Class(b.Renderer,{hitDetection:!0,hitOverflow:0,canvas:null,features:null,pendingRedraw:!1,initialize:function(){b.Renderer.prototype.initialize.apply(this,arguments);this.root=document.createElement("canvas");this.container.appendChild(this.root);
this.canvas=this.root.getContext("2d");this.features={};if(this.hitDetection)this.hitCanvas=document.createElement("canvas"),this.hitContext=this.hitCanvas.getContext("2d")},eraseGeometry:function(a,b){this.eraseFeatures(this.features[b][0])},supported:function(){return!!document.createElement("canvas").getContext},setSize:function(a){this.size=a.clone();var b=this.root;b.style.width=a.w+"px";b.style.height=a.h+"px";b.width=a.w;b.height=a.h;this.resolution=null;if(this.hitDetection)b=this.hitCanvas,
b.style.width=a.w+"px",b.style.height=a.h+"px",b.width=a.w,b.height=a.h},drawFeature:function(a,b){var d;if(a.geometry)b=this.applyDefaultSymbolizer(b||a.style),d=a.geometry.getBounds(),(d=b.display!=="none"&&!!d&&d.intersectsBounds(this.extent))?this.features[a.id]=[a,b]:delete this.features[a.id],this.pendingRedraw=!0;if(this.pendingRedraw&&!this.locked)this.redraw(),this.pendingRedraw=!1;return d},drawGeometry:function(a,b,d){var f=a.CLASS_NAME;if(f=="OpenLayers.Geometry.Collection"||f=="OpenLayers.Geometry.MultiPoint"||
f=="OpenLayers.Geometry.MultiLineString"||f=="OpenLayers.Geometry.MultiPolygon")for(f=0;f<a.components.length;f++)this.drawGeometry(a.components[f],b,d);else switch(a.CLASS_NAME){case "OpenLayers.Geometry.Point":this.drawPoint(a,b,d);break;case "OpenLayers.Geometry.LineString":this.drawLineString(a,b,d);break;case "OpenLayers.Geometry.LinearRing":this.drawLinearRing(a,b,d);break;case "OpenLayers.Geometry.Polygon":this.drawPolygon(a,b,d)}},drawExternalGraphic:function(a,c,d){var f=new Image;if(c.graphicTitle)f.title=
c.graphicTitle;var e=c.graphicWidth||c.graphicHeight,g=c.graphicHeight||c.graphicWidth,e=e?e:c.pointRadius*2,g=g?g:c.pointRadius*2,h=c.graphicXOffset!=void 0?c.graphicXOffset:-(0.5*e),i=c.graphicYOffset!=void 0?c.graphicYOffset:-(0.5*g),k=c.graphicOpacity||c.fillOpacity;f.onload=b.Function.bind(function(){if(this.features[d]){var c=this.getLocalXY(a),l=c[0],c=c[1];if(!isNaN(l)&&!isNaN(c)){var l=l+h|0,c=c+i|0,m=this.canvas;m.globalAlpha=k;var n=b.Renderer.Canvas.drawImageScaleFactor||(b.Renderer.Canvas.drawImageScaleFactor=
/android 2.1/.test(navigator.userAgent.toLowerCase())?320/window.screen.width:1);m.drawImage(f,l*n,c*n,e*n,g*n);this.hitDetection&&(this.setHitContextStyle("fill",d),this.hitContext.fillRect(l,c,e,g))}}},this);f.src=c.externalGraphic},setCanvasStyle:function(a,b){a==="fill"?(this.canvas.globalAlpha=b.fillOpacity,this.canvas.fillStyle=b.fillColor):a==="stroke"?(this.canvas.globalAlpha=b.strokeOpacity,this.canvas.strokeStyle=b.strokeColor,this.canvas.lineWidth=b.strokeWidth):(this.canvas.globalAlpha=
0,this.canvas.lineWidth=1)},featureIdToHex:function(a){a=Number(a.split("_").pop())+1;if(a>=16777216)this.hitOverflow=a-16777215,a=a%16777216+1;var a="000000"+a.toString(16),b=a.length;return a="#"+a.substring(b-6,b)},setHitContextStyle:function(a,b,d){b=this.featureIdToHex(b);a=="fill"?(this.hitContext.globalAlpha=1,this.hitContext.fillStyle=b):a=="stroke"?(this.hitContext.globalAlpha=1,this.hitContext.strokeStyle=b,this.hitContext.lineWidth=d.strokeWidth+2):(this.hitContext.globalAlpha=0,this.hitContext.lineWidth=
1)},drawPoint:function(a,b,d){if(b.graphic!==!1)if(b.externalGraphic)this.drawExternalGraphic(a,b,d);else{var f=this.getLocalXY(a),a=f[0],f=f[1];if(!isNaN(a)&&!isNaN(f)){var e=Math.PI*2,g=b.pointRadius;b.fill!==!1&&(this.setCanvasStyle("fill",b),this.canvas.beginPath(),this.canvas.arc(a,f,g,0,e,!0),this.canvas.fill(),this.hitDetection&&(this.setHitContextStyle("fill",d,b),this.hitContext.beginPath(),this.hitContext.arc(a,f,g,0,e,!0),this.hitContext.fill()));b.stroke!==!1&&(this.setCanvasStyle("stroke",
b),this.canvas.beginPath(),this.canvas.arc(a,f,g,0,e,!0),this.canvas.stroke(),this.hitDetection&&(this.setHitContextStyle("stroke",d,b),this.hitContext.beginPath(),this.hitContext.arc(a,f,g,0,e,!0),this.hitContext.stroke()),this.setCanvasStyle("reset"))}}},drawLineString:function(a,c,d){c=b.Util.applyDefaults({fill:!1},c);this.drawLinearRing(a,c,d)},drawLinearRing:function(a,b,d){b.fill!==!1&&(this.setCanvasStyle("fill",b),this.renderPath(this.canvas,a,b,d,"fill"),this.hitDetection&&(this.setHitContextStyle("fill",
d,b),this.renderPath(this.hitContext,a,b,d,"fill")));b.stroke!==!1&&(this.setCanvasStyle("stroke",b),this.renderPath(this.canvas,a,b,d,"stroke"),this.hitDetection&&(this.setHitContextStyle("stroke",d,b),this.renderPath(this.hitContext,a,b,d,"stroke")));this.setCanvasStyle("reset")},renderPath:function(a,b,d,f,e){b=b.components;d=b.length;a.beginPath();var f=this.getLocalXY(b[0]),g=f[1];if(!isNaN(f[0])&&!isNaN(g)){a.moveTo(f[0],f[1]);for(f=1;f<d;++f)g=this.getLocalXY(b[f]),a.lineTo(g[0],g[1]);e===
"fill"?a.fill():a.stroke()}},drawPolygon:function(a,c,d){var a=a.components,f=a.length;this.drawLinearRing(a[0],c,d);for(var e=1;e<f;++e){this.canvas.globalCompositeOperation="destination-out";if(this.hitDetection)this.hitContext.globalCompositeOperation="destination-out";this.drawLinearRing(a[e],b.Util.applyDefaults({stroke:!1,fillOpacity:1},c),d);this.canvas.globalCompositeOperation="source-over";if(this.hitDetection)this.hitContext.globalCompositeOperation="source-over";this.drawLinearRing(a[e],
b.Util.applyDefaults({fill:!1},c),d)}},drawText:function(a,c){var c=b.Util.extend({fontColor:"#000000",labelAlign:"cm"},c),d=this.getLocalXY(a);this.setCanvasStyle("reset");this.canvas.fillStyle=c.fontColor;this.canvas.globalAlpha=c.fontOpacity||1;var f=[c.fontStyle?c.fontStyle:"normal","normal",c.fontWeight?c.fontWeight:"normal",c.fontSize?c.fontSize:"1em",c.fontFamily?c.fontFamily:"sans-serif"].join(" "),e=c.label.split("\n"),g=e.length;if(this.canvas.fillText){this.canvas.font=f;this.canvas.textAlign=
b.Renderer.Canvas.LABEL_ALIGN[c.labelAlign[0]]||"center";this.canvas.textBaseline=b.Renderer.Canvas.LABEL_ALIGN[c.labelAlign[1]]||"middle";var h=b.Renderer.Canvas.LABEL_FACTOR[c.labelAlign[1]];h==null&&(h=-0.5);f=this.canvas.measureText("Mg").height||this.canvas.measureText("xx").width;d[1]+=f*h*(g-1);for(h=0;h<g;h++)this.canvas.fillText(e[h],d[0],d[1]+f*h)}else if(this.canvas.mozDrawText){this.canvas.mozTextStyle=f;var i=b.Renderer.Canvas.LABEL_FACTOR[c.labelAlign[0]];i==null&&(i=-0.5);h=b.Renderer.Canvas.LABEL_FACTOR[c.labelAlign[1]];
h==null&&(h=-0.5);f=this.canvas.mozMeasureText("xx");d[1]+=f*(1+h*g);for(h=0;h<g;h++){var k=d[0]+i*this.canvas.mozMeasureText(e[h]),j=d[1]+h*f;this.canvas.translate(k,j);this.canvas.mozDrawText(e[h]);this.canvas.translate(-k,-j)}}this.setCanvasStyle("reset")},getLocalXY:function(a){var b=this.getResolution(),d=this.extent;return[a.x/b+-d.left/b,d.top/b-a.y/b]},clear:function(){var a=this.root.height,b=this.root.width;this.canvas.clearRect(0,0,b,a);this.features={};this.hitDetection&&this.hitContext.clearRect(0,
0,b,a)},getFeatureIdFromEvent:function(a){var b=null;if(this.hitDetection&&!this.map.dragging)a=a.xy,a=this.hitContext.getImageData(a.x|0,a.y|0,1,1).data,a[3]===255&&(a=a[2]+256*(a[1]+256*a[0]))&&(b=this.features["OpenLayers.Feature.Vector_"+(a-1+this.hitOverflow)][0]);return b},eraseFeatures:function(a){b.Util.isArray(a)||(a=[a]);for(var c=0;c<a.length;++c)delete this.features[a[c].id];this.redraw()},redraw:function(){if(!this.locked){var a=this.root.height,b=this.root.width;this.canvas.clearRect(0,
0,b,a);this.hitDetection&&this.hitContext.clearRect(0,0,b,a);var a=[],d,f;for(f in this.features)this.features.hasOwnProperty(f)&&(b=this.features[f][0],d=this.features[f][1],this.drawGeometry(b.geometry,d,b.id),d.label&&a.push([b,d]));b=0;for(d=a.length;b<d;++b)f=a[b],this.drawText(f[0].geometry.getCentroid(),f[1])}},CLASS_NAME:"OpenLayers.Renderer.Canvas"});b.Renderer.Canvas.LABEL_ALIGN={l:"left",r:"right",t:"top",b:"bottom"};b.Renderer.Canvas.LABEL_FACTOR={l:0,r:-1,t:0,b:-1};b.Renderer.Canvas.drawImageScaleFactor=
null;b.StyleMap=b.Class({styles:null,extendDefault:!0,initialize:function(a,c){this.styles={"default":new b.Style(b.Feature.Vector.style["default"]),select:new b.Style(b.Feature.Vector.style.select),temporary:new b.Style(b.Feature.Vector.style.temporary),"delete":new b.Style(b.Feature.Vector.style["delete"])};if(a instanceof b.Style)this.styles["default"]=a,this.styles.select=a,this.styles.temporary=a,this.styles["delete"]=a;else if(typeof a=="object")for(var d in a)if(a[d]instanceof b.Style)this.styles[d]=
a[d];else if(typeof a[d]=="object")this.styles[d]=new b.Style(a[d]);else{this.styles["default"]=new b.Style(a);this.styles.select=new b.Style(a);this.styles.temporary=new b.Style(a);this.styles["delete"]=new b.Style(a);break}b.Util.extend(this,c)},destroy:function(){for(var a in this.styles)this.styles[a].destroy();this.styles=null},createSymbolizer:function(a,c){a||(a=new b.Feature.Vector);this.styles[c]||(c="default");a.renderIntent=c;var d={};this.extendDefault&&c!="default"&&(d=this.styles["default"].createSymbolizer(a));
return b.Util.extend(d,this.styles[c].createSymbolizer(a))},addUniqueValueRules:function(a,c,d,f){var e=[],g;for(g in d)e.push(new b.Rule({symbolizer:d[g],context:f,filter:new b.Filter.Comparison({type:b.Filter.Comparison.EQUAL_TO,property:c,value:g})}));this.styles[a].addRules(e)},CLASS_NAME:"OpenLayers.StyleMap"});b.Style=b.Class({id:null,name:null,title:null,description:null,layerName:null,isDefault:!1,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:!1,propertyStyles:null,initialize:function(a,
c){b.Util.extend(this,c);this.rules=[];c&&c.rules&&this.addRules(c.rules);this.setDefaultStyle(a||b.Feature.Vector.style["default"]);this.id=b.Util.createUniqueID(this.CLASS_NAME+"_")},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 c=this.defaultsPerSymbolizer?{}:this.createLiterals(b.Util.extend({},this.defaultStyle),a),d=this.rules,f,e=[],g=!1,h=0,i=d.length;h<i;h++)f=d[h],
f.evaluate(a)&&(f instanceof b.Rule&&f.elseFilter?e.push(f):(g=!0,this.applySymbolizer(f,c,a)));if(g==!1&&e.length>0){g=!0;h=0;for(i=e.length;h<i;h++)this.applySymbolizer(e[h],c,a)}if(d.length>0&&g==!1)c.display="none";if(c.label&&typeof c.label!=="string")c.label=String(c.label);return c},applySymbolizer:function(a,c,d){var f=d.geometry?this.getSymbolizerPrefix(d.geometry):b.Style.SYMBOLIZER_PREFIXES[0],a=a.symbolizer[f]||a.symbolizer;if(this.defaultsPerSymbolizer===!0)f=this.defaultStyle,b.Util.applyDefaults(a,
{pointRadius:f.pointRadius}),(a.stroke===!0||a.graphic===!0)&&b.Util.applyDefaults(a,{strokeWidth:f.strokeWidth,strokeColor:f.strokeColor,strokeOpacity:f.strokeOpacity,strokeDashstyle:f.strokeDashstyle,strokeLinecap:f.strokeLinecap}),(a.fill===!0||a.graphic===!0)&&b.Util.applyDefaults(a,{fillColor:f.fillColor,fillOpacity:f.fillOpacity}),a.graphic===!0&&b.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(b.Util.extend(c,a),d)},createLiterals:function(a,c){var d=b.Util.extend({},c.attributes||c.data);b.Util.extend(d,this.context);for(var f in this.propertyStyles)a[f]=b.Style.createLiteral(a[f],d,c,f);return a},findPropertyStyles:function(){var a=
{};this.addPropertyStyles(a,this.defaultStyle);for(var b=this.rules,d,f,e=0,g=b.length;e<g;e++)for(var h in d=b[e].symbolizer,d)if(f=d[h],typeof f=="object")this.addPropertyStyles(a,f);else{this.addPropertyStyles(a,d);break}return a},addPropertyStyles:function(a,b){var d,f;for(f in b)d=b[f],typeof d=="string"&&d.match(/\$\{\w+\}/)&&(a[f]=!0);return a},addRules:function(a){Array.prototype.push.apply(this.rules,a);this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(a){this.defaultStyle=
a;this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(a){for(var c=b.Style.SYMBOLIZER_PREFIXES,d=0,f=c.length;d<f;d++)if(a.CLASS_NAME.indexOf(c[d])!=-1)return c[d]},clone:function(){var a=b.Util.extend({},this);if(this.rules){a.rules=[];for(var c=0,d=this.rules.length;c<d;++c)a.rules.push(this.rules[c].clone())}a.context=this.context&&b.Util.extend({},this.context);c=b.Util.extend({},this.defaultStyle);return new b.Style(c,a)},CLASS_NAME:"OpenLayers.Style"});b.Style.createLiteral=
function(a,c,d,f){typeof a=="string"&&a.indexOf("${")!=-1&&(a=b.String.format(a,c,[d,f]),a=isNaN(a)||!a?a:parseFloat(a));return a};b.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text","Raster"];b.Geometry.Collection=b.Class(b.Geometry,{components:null,componentTypes:null,initialize:function(a){b.Geometry.prototype.initialize.apply(this,arguments);this.components=[];a!=null&&this.addComponents(a)},destroy:function(){this.components.length=0;this.components=null;b.Geometry.prototype.destroy.apply(this,
arguments)},clone:function(){for(var a=eval("new "+this.CLASS_NAME+"()"),c=0,d=this.components.length;c<d;c++)a.addComponent(this.components[c].clone());b.Util.applyDefaults(a,this);return a},getComponentsString:function(){for(var a=[],b=0,d=this.components.length;b<d;b++)a.push(this.components[b].toShortString());return a.join(",")},calculateBounds:function(){this.bounds=null;var a=new b.Bounds,c=this.components;if(c)for(var d=0,f=c.length;d<f;d++)a.extend(c[d].getBounds());a.left!=null&&a.bottom!=
null&&a.right!=null&&a.top!=null&&this.setBounds(a)},addComponents:function(a){b.Util.isArray(a)||(a=[a]);for(var c=0,d=a.length;c<d;c++)this.addComponent(a[c])},addComponent:function(a,c){var d=!1;if(a&&(this.componentTypes==null||b.Util.indexOf(this.componentTypes,a.CLASS_NAME)>-1)){if(c!=null&&c<this.components.length){var d=this.components.slice(0,c),f=this.components.slice(c,this.components.length);d.push(a);this.components=d.concat(f)}else this.components.push(a);a.parent=this;this.clearBounds();
d=!0}return d},removeComponents:function(a){var c=!1;b.Util.isArray(a)||(a=[a]);for(var d=a.length-1;d>=0;--d)c=this.removeComponent(a[d])||c;return c},removeComponent:function(a){b.Util.removeItem(this.components,a);this.clearBounds();return!0},getLength:function(){for(var a=0,b=0,d=this.components.length;b<d;b++)a+=this.components[b].getLength();return a},getArea:function(){for(var a=0,b=0,d=this.components.length;b<d;b++)a+=this.components[b].getArea();return a},getGeodesicArea:function(a){for(var b=
0,d=0,f=this.components.length;d<f;d++)b+=this.components[d].getGeodesicArea(a);return b},getCentroid:function(a){if(!a)return this.components.length&&this.components[0].getCentroid();a=this.components.length;if(!a)return!1;for(var c=[],d=[],f=0,e=Number.MAX_VALUE,g,h=0;h<a;++h){g=this.components[h];var i=g.getArea();g=g.getCentroid(!0);!isNaN(i)&&!isNaN(g.x)&&!isNaN(g.y)&&(c.push(i),f+=i,e=i<e&&i>0?i:e,d.push(g))}a=c.length;if(f===0){for(h=0;h<a;++h)c[h]=1;f=c.length}else{for(h=0;h<a;++h)c[h]/=e;
f/=e}for(var k=e=0,h=0;h<a;++h)g=d[h],i=c[h],e+=g.x*i,k+=g.y*i;return new b.Geometry.Point(e/f,k/f)},getGeodesicLength:function(a){for(var b=0,d=0,f=this.components.length;d<f;d++)b+=this.components[d].getGeodesicLength(a);return b},move:function(a,b){for(var d=0,f=this.components.length;d<f;d++)this.components[d].move(a,b)},rotate:function(a,b){for(var d=0,f=this.components.length;d<f;++d)this.components[d].rotate(a,b)},resize:function(a,b,d){for(var f=0;f<this.components.length;++f)this.components[f].resize(a,
b,d);return this},distanceTo:function(a,b){for(var d=!(b&&b.edge===!1)&&b&&b.details,f,e,g,h=Number.POSITIVE_INFINITY,i=0,k=this.components.length;i<k;++i)if(f=this.components[i].distanceTo(a,b),g=d?f.distance:f,g<h&&(h=g,e=f,h==0))break;return e},equals:function(a){var c=!0;if(!a||!a.CLASS_NAME||this.CLASS_NAME!=a.CLASS_NAME)c=!1;else if(!b.Util.isArray(a.components)||a.components.length!=this.components.length)c=!1;else for(var d=0,f=this.components.length;d<f;++d)if(!this.components[d].equals(a.components[d])){c=
!1;break}return c},transform:function(a,b){if(a&&b){for(var d=0,f=this.components.length;d<f;d++)this.components[d].transform(a,b);this.bounds=null}return this},intersects:function(a){for(var b=!1,d=0,f=this.components.length;d<f;++d)if(b=a.intersects(this.components[d]))break;return b},getVertices:function(a){for(var b=[],d=0,f=this.components.length;d<f;++d)Array.prototype.push.apply(b,this.components[d].getVertices(a));return b},CLASS_NAME:"OpenLayers.Geometry.Collection"});b.Geometry.Point=b.Class(b.Geometry,
{x:null,y:null,initialize:function(a,c){b.Geometry.prototype.initialize.apply(this,arguments);this.x=parseFloat(a);this.y=parseFloat(c)},clone:function(a){a==null&&(a=new b.Geometry.Point(this.x,this.y));b.Util.applyDefaults(a,this);return a},calculateBounds:function(){this.bounds=new b.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(a,c){var d=!(c&&c.edge===!1)&&c&&c.details,f,e,g,h,i;a instanceof b.Geometry.Point?(e=this.x,g=this.y,h=a.x,i=a.y,f=Math.sqrt(Math.pow(e-h,2)+Math.pow(g-i,2)),
f=!d?f:{x0:e,y0:g,x1:h,y1:i,distance:f}):(f=a.distanceTo(this,c),d&&(f={x0:f.x1,y0:f.y1,x1:f.x0,y1:f.y0,distance:f.distance}));return f},equals:function(a){var b=!1;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 d=this.distanceTo(b),f=a+Math.atan2(this.y-b.y,this.x-b.x);this.x=b.x+d*Math.cos(f);
this.y=b.y+d*Math.sin(f);this.clearBounds()},getCentroid:function(){return new b.Geometry.Point(this.x,this.y)},resize:function(a,b,d){this.x=b.x+a*(d==void 0?1:d)*(this.x-b.x);this.y=b.y+a*(this.y-b.y);this.clearBounds();return this},intersects:function(a){var b=!1;return b=a.CLASS_NAME=="OpenLayers.Geometry.Point"?this.equals(a):a.intersects(this)},transform:function(a,c){if(a&&c)b.Projection.transform(this,a,c),this.bounds=null;return this},getVertices:function(){return[this]},CLASS_NAME:"OpenLayers.Geometry.Point"});
b.Geometry.MultiPoint=b.Class(b.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(){b.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"});b.Geometry.Curve=b.Class(b.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(){b.Geometry.MultiPoint.prototype.initialize.apply(this,arguments)},
getLength:function(){var a=0;if(this.components&&this.components.length>1)for(var b=1,d=this.components.length;b<d;b++)a+=this.components[b-1].distanceTo(this.components[b]);return a},getGeodesicLength:function(a){var c=this;if(a){var d=new b.Projection("EPSG:4326");d.equals(a)||(c=this.clone().transform(a,d))}a=0;if(c.components&&c.components.length>1)for(var f,e=1,g=c.components.length;e<g;e++)d=c.components[e-1],f=c.components[e],a+=b.Util.distVincenty({lon:d.x,lat:d.y},{lon:f.x,lat:f.y});return a*
1E3},CLASS_NAME:"OpenLayers.Geometry.Curve"});b.Geometry.LineString=b.Class(b.Geometry.Curve,{initialize:function(){b.Geometry.Curve.prototype.initialize.apply(this,arguments)},removeComponent:function(){var a=this.components&&this.components.length>2;a&&b.Geometry.Collection.prototype.removeComponent.apply(this,arguments);return a},intersects:function(a){var c=!1,d=a.CLASS_NAME;if(d=="OpenLayers.Geometry.LineString"||d=="OpenLayers.Geometry.LinearRing"||d=="OpenLayers.Geometry.Point"){var f=this.getSortedSegments(),
a=d=="OpenLayers.Geometry.Point"?[{x1:a.x,y1:a.y,x2:a.x,y2:a.y}]:a.getSortedSegments(),e,g,h,i,k,j,l,m=0,n=f.length;a:for(;m<n;++m){d=f[m];e=d.x1;g=d.x2;h=d.y1;i=d.y2;var o=0,p=a.length;for(;o<p;++o){k=a[o];if(k.x1>g)break;if(!(k.x2<e)&&(j=k.y1,l=k.y2,!(Math.min(j,l)>Math.max(h,i))&&!(Math.max(j,l)<Math.min(h,i))&&b.Geometry.segmentsIntersect(d,k))){c=!0;break a}}}}else c=a.intersects(this);return c},getSortedSegments:function(){for(var a=this.components.length-1,b=Array(a),d,f,e=0;e<a;++e)d=this.components[e],
f=this.components[e+1],b[e]=d.x<f.x?{x1:d.x,y1:d.y,x2:f.x,y2:f.y}:{x1:f.x,y1:f.y,x2:d.x,y2:d.y};return b.sort(function(a,b){return a.x1-b.x1})},splitWithSegment:function(a,c){for(var d=!(c&&c.edge===!1),f=c&&c.tolerance,e=[],g=this.getVertices(),h=[],i=[],k=!1,j,l,m,n={point:!0,tolerance:f},o=null,p=0,t=g.length-2;p<=t;++p)if(f=g[p],h.push(f.clone()),j=g[p+1],l={x1:f.x,y1:f.y,x2:j.x,y2:j.y},l=b.Geometry.segmentsIntersect(a,l,n),l instanceof b.Geometry.Point&&((m=l.x===a.x1&&l.y===a.y1||l.x===a.x2&&
l.y===a.y2||l.equals(f)||l.equals(j)?!0:!1)||d))l.equals(i[i.length-1])||i.push(l.clone()),!(p===0&&l.equals(f))&&!l.equals(j)&&(k=!0,l.equals(f)||h.push(l),e.push(new b.Geometry.LineString(h)),h=[l.clone()]);k&&(h.push(j.clone()),e.push(new b.Geometry.LineString(h)));if(i.length>0)var s=a.x1<a.x2?1:-1,q=a.y1<a.y2?1:-1,o={lines:e,points:i.sort(function(a,b){return s*a.x-s*b.x||q*a.y-q*b.y})};return o},split:function(a,c){var d=null,f=c&&c.mutual,e,g,h,i;if(a instanceof b.Geometry.LineString){var k=
this.getVertices(),j,l,m,n,o,p=[];h=[];for(var t=0,s=k.length-2;t<=s;++t){j=k[t];l=k[t+1];m={x1:j.x,y1:j.y,x2:l.x,y2:l.y};i=i||[a];f&&p.push(j.clone());for(var q=0;q<i.length;++q)if(n=i[q].splitWithSegment(m,c))if(o=n.lines,o.length>0&&(o.unshift(q,1),Array.prototype.splice.apply(i,o),q+=o.length-2),f)for(var r=0,u=n.points.length;r<u;++r)o=n.points[r],o.equals(j)||(p.push(o),h.push(new b.Geometry.LineString(p)),p=o.equals(l)?[]:[o.clone()])}f&&h.length>0&&p.length>0&&(p.push(l.clone()),h.push(new b.Geometry.LineString(p)))}else d=
a.splitWith(this,c);i&&i.length>1?g=!0:i=[];h&&h.length>1?e=!0:h=[];if(g||e)d=f?[h,i]:i;return d},splitWith:function(a,b){return a.split(this,b)},getVertices:function(a){return a===!0?[this.components[0],this.components[this.components.length-1]]:a===!1?this.components.slice(1,this.components.length-1):this.components.slice()},distanceTo:function(a,c){var d=!(c&&c.edge===!1)&&c&&c.details,f,e={},g=Number.POSITIVE_INFINITY;if(a instanceof b.Geometry.Point){for(var h=this.getSortedSegments(),i=a.x,
k=a.y,j,l=0,m=h.length;l<m;++l)if(j=h[l],f=b.Geometry.distanceToSegment(a,j),f.distance<g){if(g=f.distance,e=f,g===0)break}else if(j.x2>i&&(k>j.y1&&k<j.y2||k<j.y1&&k>j.y2))break;e=d?{distance:e.distance,x0:e.x,y0:e.y,x1:i,y1:k}:e.distance}else if(a instanceof b.Geometry.LineString){var h=this.getSortedSegments(),i=a.getSortedSegments(),n,o,p=i.length,t={point:!0},l=0,m=h.length;a:for(;l<m;++l){k=h[l];j=k.x1;o=k.y1;for(var s=0;s<p;++s)if(f=i[s],n=b.Geometry.segmentsIntersect(k,f,t)){g=0;e={distance:0,
x0:n.x,y0:n.y,x1:n.x,y1:n.y};break a}else if(f=b.Geometry.distanceToSegment({x:j,y:o},f),f.distance<g)g=f.distance,e={distance:g,x0:j,y0:o,x1:f.x,y1:f.y}}if(!d)e=e.distance;g!==0&&k&&(f=a.distanceTo(new b.Geometry.Point(k.x2,k.y2),c),l=d?f.distance:f,l<g&&(e=d?{distance:g,x0:f.x1,y0:f.y1,x1:f.x0,y1:f.y0}:l))}else e=a.distanceTo(this,c),d&&(e={distance:e.distance,x0:e.x1,y0:e.y1,x1:e.x0,y1:e.y0});return e},simplify:function(a){if(this&&this!==null){var c=this.getVertices();if(c.length<3)return this;
var d=function(a,b,c,f){for(var j=0,l=0,m=b,n;m<c;m++)n=Math.abs(0.5*(a[b].x*a[c].y+a[c].x*a[m].y+a[m].x*a[b].y-a[c].x*a[b].y-a[m].x*a[c].y-a[b].x*a[m].y))/Math.sqrt(Math.pow(a[b].x-a[c].x,2)+Math.pow(a[b].y-a[c].y,2))*2,n>j&&(j=n,l=m);j>f&&l!=b&&(e.push(l),d(a,b,l,f),d(a,l,c,f))},f=c.length-1,e=[];e.push(0);for(e.push(f);c[0].equals(c[f]);)f--,e.push(f);d(c,0,f,a);a=[];e.sort(function(a,b){return a-b});for(f=0;f<e.length;f++)a.push(c[e[f]]);return new b.Geometry.LineString(a)}else return this},CLASS_NAME:"OpenLayers.Geometry.LineString"});
b.Geometry.LinearRing=b.Class(b.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(){b.Geometry.LineString.prototype.initialize.apply(this,arguments)},addComponent:function(a,c){var d=!1,f=this.components.pop();if(c!=null||!a.equals(f))d=b.Geometry.Collection.prototype.addComponent.apply(this,arguments);b.Geometry.Collection.prototype.addComponent.apply(this,[this.components[0]]);return d},removeComponent:function(){var a=this.components&&this.components.length>
3;a&&(this.components.pop(),b.Geometry.Collection.prototype.removeComponent.apply(this,arguments),b.Geometry.Collection.prototype.addComponent.apply(this,[this.components[0]]));return a},move:function(a,b){for(var d=0,f=this.components.length;d<f-1;d++)this.components[d].move(a,b)},rotate:function(a,b){for(var d=0,f=this.components.length;d<f-1;++d)this.components[d].rotate(a,b)},resize:function(a,b,d){for(var f=0,e=this.components.length;f<e-1;++f)this.components[f].resize(a,b,d);return this},transform:function(a,
b){if(a&&b){for(var d=0,f=this.components.length;d<f-1;d++)this.components[d].transform(a,b);this.bounds=null}return this},getCentroid:function(){if(this.components&&this.components.length>2){for(var a=0,c=0,d=0;d<this.components.length-1;d++){var f=this.components[d],e=this.components[d+1];a+=(f.x+e.x)*(f.x*e.y-e.x*f.y);c+=(f.y+e.y)*(f.x*e.y-e.x*f.y)}d=-1*this.getArea();return new b.Geometry.Point(a/(6*d),c/(6*d))}else return null},getArea:function(){var a=0;if(this.components&&this.components.length>
2){for(var b=a=0,d=this.components.length;b<d-1;b++){var f=this.components[b],e=this.components[b+1];a+=(f.x+e.x)*(e.y-f.y)}a=-a/2}return a},getGeodesicArea:function(a){var c=this;if(a){var d=new b.Projection("EPSG:4326");d.equals(a)||(c=this.clone().transform(a,d))}a=0;d=c.components&&c.components.length;if(d>2){for(var f,e,g=0;g<d-1;g++)f=c.components[g],e=c.components[g+1],a+=b.Util.rad(e.x-f.x)*(2+Math.sin(b.Util.rad(f.y))+Math.sin(b.Util.rad(e.y)));a=a*40680631590769/2}return a},containsPoint:function(a){for(var c=
b.Number.limitSigDigs,d=c(a.x,14),a=c(a.y,14),f=this.components.length-1,e,g,h,i,k,j=0,l=0;l<f;++l)if(e=this.components[l],h=c(e.x,14),e=c(e.y,14),g=this.components[l+1],i=c(g.x,14),g=c(g.y,14),e==g){if(a==e&&(h<=i&&d>=h&&d<=i||h>=i&&d<=h&&d>=i)){j=-1;break}}else{k=c(((h-i)*a+(i*e-h*g))/(e-g),14);if(k==d&&(e<g&&a>=e&&a<=g||e>g&&a<=e&&a>=g)){j=-1;break}k<=d||h!=i&&(k<Math.min(h,i)||k>Math.max(h,i))||(e<g&&a>=e&&a<g||e>g&&a<e&&a>=g)&&++j}return j==-1?1:!!(j&1)},intersects:function(a){var c=!1;if(a.CLASS_NAME==
"OpenLayers.Geometry.Point")c=this.containsPoint(a);else if(a.CLASS_NAME=="OpenLayers.Geometry.LineString")c=a.intersects(this);else if(a.CLASS_NAME=="OpenLayers.Geometry.LinearRing")c=b.Geometry.LineString.prototype.intersects.apply(this,[a]);else for(var d=0,f=a.components.length;d<f;++d)if(c=a.components[d].intersects(this))break;return c},getVertices:function(a){return a===!0?[]:this.components.slice(0,this.components.length-1)},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});b.Geometry.MultiLineString=
b.Class(b.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],initialize:function(){b.Geometry.Collection.prototype.initialize.apply(this,arguments)},split:function(a,c){for(var d=null,f=c&&c.mutual,e,g,h,i,k=[],j=[a],l=0,m=this.components.length;l<m;++l){g=this.components[l];h=!1;for(var n=0;n<j.length;++n)if(e=g.split(j[n],c)){if(f){h=e[0];for(var o=0,p=h.length;o<p;++o)o===0&&k.length?k[k.length-1].addComponent(h[o]):k.push(new b.Geometry.MultiLineString([h[o]]));h=!0;e=e[1]}if(e.length){e.unshift(n,
1);Array.prototype.splice.apply(j,e);break}}h||(k.length?k[k.length-1].addComponent(g.clone()):k=[new b.Geometry.MultiLineString(g.clone())])}k&&k.length>1?h=!0:k=[];j&&j.length>1?i=!0:j=[];if(h||i)d=f?[k,j]:j;return d},splitWith:function(a,c){var d=null,f=c&&c.mutual,e,g,h,i,k,j;if(a instanceof b.Geometry.LineString){j=[];k=[a];for(var l=0,m=this.components.length;l<m;++l){h=!1;g=this.components[l];for(var n=0;n<k.length;++n)if(e=k[n].split(g,c)){f&&(h=e[0],h.length&&(h.unshift(n,1),Array.prototype.splice.apply(k,
h),n+=h.length-2),e=e[1],e.length===0&&(e=[g.clone()]));h=0;for(var o=e.length;h<o;++h)h===0&&j.length?j[j.length-1].addComponent(e[h]):j.push(new b.Geometry.MultiLineString([e[h]]));h=!0}h||(j.length?j[j.length-1].addComponent(g.clone()):j=[new b.Geometry.MultiLineString([g.clone()])])}}else d=a.split(this);k&&k.length>1?i=!0:k=[];j&&j.length>1?h=!0:j=[];if(i||h)d=f?[k,j]:j;return d},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});b.Control.KeyboardDefaults=b.Class(b.Control,{autoActivate:!0,
slideFactor:75,draw:function(){this.handler=new b.Handler.Keyboard(this,{keydown:this.defaultKeyPress})},defaultKeyPress:function(a){switch(a.keyCode){case b.Event.KEY_LEFT:this.map.pan(-this.slideFactor,0);break;case b.Event.KEY_RIGHT:this.map.pan(this.slideFactor,0);break;case b.Event.KEY_UP:this.map.pan(0,-this.slideFactor);break;case b.Event.KEY_DOWN:this.map.pan(0,this.slideFactor);break;case 33:a=this.map.getSize();this.map.pan(0,-0.75*a.h);break;case 34:a=this.map.getSize();this.map.pan(0,
0.75*a.h);break;case 35:a=this.map.getSize();this.map.pan(0.75*a.w,0);break;case 36:a=this.map.getSize();this.map.pan(-0.75*a.w,0);break;case 43:case 61:case 187:case 107:this.map.zoomIn();break;case 45:case 109:case 189:case 95:this.map.zoomOut()}},CLASS_NAME:"OpenLayers.Control.KeyboardDefaults"});b.Control.PinchZoom=b.Class(b.Control,{type:b.Control.TYPE_TOOL,containerOrigin:null,pinchOrigin:null,currentCenter:null,autoActivate:!0,initialize:function(){b.Control.prototype.initialize.apply(this,
arguments);this.handler=new b.Handler.Pinch(this,{start:this.pinchStart,move:this.pinchMove,done:this.pinchDone},this.handlerOptions)},activate:function(){var a=b.Control.prototype.activate.apply(this,arguments);a&&(this.map.events.on({moveend:this.updateContainerOrigin,scope:this}),this.updateContainerOrigin());return a},deactivate:function(){var a=b.Control.prototype.deactivate.apply(this,arguments);this.map&&this.map.events&&this.map.events.un({moveend:this.updateContainerOrigin,scope:this});return a},
updateContainerOrigin:function(){var a=this.map.layerContainerDiv;this.containerOrigin={x:parseInt(a.style.left,10),y:parseInt(a.style.top,10)}},pinchStart:function(a){this.currentCenter=this.pinchOrigin=a.xy},pinchMove:function(a,b){var d=b.scale,f=this.containerOrigin,e=this.pinchOrigin,g=a.xy;this.applyTransform("translate("+Math.round(g.x-e.x+(d-1)*(f.x-e.x))+"px, "+Math.round(g.y-e.y+(d-1)*(f.y-e.y))+"px) scale("+d+")");this.currentCenter=g},applyTransform:function(a){var b=this.map.layerContainerDiv.style;
b["-webkit-transform"]=a;b["-moz-transform"]=a},pinchDone:function(a,b,d){this.applyTransform("");a=this.map.getZoomForResolution(this.map.getResolution()/d.scale,!0);if(a!==this.map.getZoom()||!this.currentCenter.equals(this.pinchOrigin)){var b=this.map.getResolutionForZoom(a),d=this.map.getLonLatFromPixel(this.pinchOrigin),f=this.currentCenter,e=this.map.getSize();d.lon+=b*(e.w/2-f.x);d.lat-=b*(e.h/2-f.y);this.map.setCenter(d,a)}},CLASS_NAME:"OpenLayers.Control.PinchZoom"});b.Control.Navigation=
b.Class(b.Control,{dragPan:null,dragPanOptions:null,pinchZoom:null,pinchZoomOptions:null,documentDrag:!1,zoomBox:null,zoomBoxEnabled:!0,zoomWheelEnabled:!0,mouseWheelOptions:null,handleRightClicks:!1,zoomBoxKeyMask:b.Handler.MOD_SHIFT,autoActivate:!0,initialize:function(){this.handlers={};b.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;this.pinchZoom&&
this.pinchZoom.destroy();this.pinchZoom=null;b.Control.prototype.destroy.apply(this,arguments)},activate:function(){this.dragPan.activate();this.zoomWheelEnabled&&this.handlers.wheel.activate();this.handlers.click.activate();this.zoomBoxEnabled&&this.zoomBox.activate();this.pinchZoom&&this.pinchZoom.activate();return b.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.pinchZoom&&this.pinchZoom.deactivate();this.zoomBox.deactivate();this.dragPan.deactivate();this.handlers.click.deactivate();
this.handlers.wheel.deactivate();return b.Control.prototype.deactivate.apply(this,arguments)},draw:function(){if(this.handleRightClicks)this.map.viewPortDiv.oncontextmenu=b.Function.False;this.handlers.click=new b.Handler.Click(this,{click:this.defaultClick,dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick},{"double":!0,stopDouble:!0});this.dragPan=new b.Control.DragPan(b.Util.extend({map:this.map,documentDrag:this.documentDrag},this.dragPanOptions));this.zoomBox=new b.Control.ZoomBox({map:this.map,
keyMask:this.zoomBoxKeyMask});this.dragPan.draw();this.zoomBox.draw();this.handlers.wheel=new b.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown},this.mouseWheelOptions);if(b.Control.PinchZoom)this.pinchZoom=new b.Control.PinchZoom(b.Util.extend({map:this.map},this.pinchZoomOptions))},defaultClick:function(a){a.lastTouches&&a.lastTouches.length==2&&this.map.zoomOut()},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,c){var d=this.map.getZoom(),f=this.map.getZoom()+Math.round(c),f=Math.max(f,0),f=Math.min(f,this.map.getNumZoomLevels());if(f!==d){var e=this.map.getSize(),d=e.w/2-a.xy.x,e=a.xy.y-e.h/2,g=this.map.baseLayer.getResolutionForZoom(f),h=this.map.getLonLatFromPixel(a.xy);this.map.setCenter(new b.LonLat(h.lon+d*g,h.lat+e*g),f)}},wheelUp:function(a,b){this.wheelChange(a,b||1)},wheelDown:function(a,b){this.wheelChange(a,b||-1)},disableZoomBox:function(){this.zoomBoxEnabled=
!1;this.zoomBox.deactivate()},enableZoomBox:function(){this.zoomBoxEnabled=!0;this.active&&this.zoomBox.activate()},disableZoomWheel:function(){this.zoomWheelEnabled=!1;this.handlers.wheel.deactivate()},enableZoomWheel:function(){this.zoomWheelEnabled=!0;this.active&&this.handlers.wheel.activate()},CLASS_NAME:"OpenLayers.Control.Navigation"});b.Control.ScaleLine=b.Class(b.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,geodesic:!1,
draw:function(){b.Control.prototype.draw.apply(this,arguments);if(!this.eTop)this.eTop=document.createElement("div"),this.eTop.className=this.displayClass+"Top",this.div.appendChild(this.eTop),this.eTop.style.visibility=this.topOutUnits==""||this.topInUnits==""?"hidden":"visible",this.eBottom=document.createElement("div"),this.eBottom.className=this.displayClass+"Bottom",this.div.appendChild(this.eBottom),this.eBottom.style.visibility=this.bottomOutUnits==""||this.bottomInUnits==""?"hidden":"visible";
this.map.events.register("moveend",this,this.update);this.update();return this.div},getBarLen:function(a){var b=parseInt(Math.log(a)/Math.log(10)),b=Math.pow(10,b),a=parseInt(a/b);return(a>5?5:a>2?2:1)*b},update:function(){var a=this.map.getResolution();if(a){var c=this.map.getUnits(),d=b.INCHES_PER_UNIT,f=this.maxWidth*a*d[c],e=1;this.geodesic===!0&&(e=(this.map.getGeodesicPixelSize().w||1.0E-6)*this.maxWidth/(f/d.km),f*=e);var g,h;f>1E5?(g=this.topOutUnits,h=this.bottomOutUnits):(g=this.topInUnits,
h=this.bottomInUnits);var i=f/d[g];f/=d[h];var k=this.getBarLen(i),j=this.getBarLen(f),i=k/d[c]*d[g],f=j/d[c]*d[h];if(this.eBottom.style.visibility=="visible")this.eBottom.style.width=Math.round(f/a/e)+"px",this.eBottom.innerHTML=j+" "+h;if(this.eTop.style.visibility=="visible")this.eTop.style.width=Math.round(i/a/e)+"px",this.eTop.innerHTML=k+" "+g}},CLASS_NAME:"OpenLayers.Control.ScaleLine"});b.Control.ZoomBox=b.Class(b.Control,{type:b.Control.TYPE_TOOL,out:!1,alwaysZoom:!1,draw:function(){this.handler=
new b.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})},zoomBox:function(a){if(a instanceof b.Bounds){var c;if(this.out){c=Math.min(this.map.size.h/Math.abs(a.top-a.bottom),this.map.size.w/Math.abs(a.right-a.left));var d=this.map.getExtent(),f=this.map.getLonLatFromPixel(a.getCenterPixel()),a=f.lon-d.getWidth()/2*c,e=f.lon+d.getWidth()/2*c,g=f.lat-d.getHeight()/2*c;c=f.lat+d.getHeight()/2*c;c=new b.Bounds(a,g,e,c)}else c=this.map.getLonLatFromPixel(new b.Pixel(a.left,a.bottom)),d=this.map.getLonLatFromPixel(new b.Pixel(a.right,
a.top)),c=new b.Bounds(c.lon,c.lat,d.lon,d.lat);d=this.map.getZoom();this.map.zoomToExtent(c);d==this.map.getZoom()&&this.alwaysZoom==!0&&this.map.zoomTo(d+(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"});b.Control.DragPan=b.Class(b.Control,{type:b.Control.TYPE_TOOL,panned:!1,interval:1,documentDrag:!1,kinetic:null,enableKinetic:!1,
kineticInterval:10,draw:function(){if(this.enableKinetic){var a={interval:this.kineticInterval};typeof this.enableKinetic==="object"&&(a=b.Util.extend(a,this.enableKinetic));this.kinetic=new b.Kinetic(a)}this.handler=new b.Handler.Drag(this,{move:this.panMap,done:this.panMapDone,down:this.panMapStart},{interval:this.interval,documentDrag:this.documentDrag})},panMapStart:function(){this.kinetic&&this.kinetic.begin()},panMap:function(a){this.kinetic&&this.kinetic.update(a);this.panned=!0;this.map.pan(this.handler.last.x-
a.x,this.handler.last.y-a.y,{dragging:!0,animate:!1})},panMapDone:function(a){if(this.panned){var b=null;this.kinetic&&(b=this.kinetic.end(a));this.map.pan(this.handler.last.x-a.x,this.handler.last.y-a.y,{dragging:!!b,animate:!1});if(b){var d=this;this.kinetic.move(b,function(a,b,c){d.map.pan(a,b,{dragging:!c,animate:!1})})}this.panned=!1}},CLASS_NAME:"OpenLayers.Control.DragPan"});b.Control.DragFeature=b.Class(b.Control,{geometryTypes:null,onStart:function(){},onDrag:function(){},onComplete:function(){},
onEnter:function(){},onLeave:function(){},documentDrag:!1,layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(a,c){b.Control.prototype.initialize.apply(this,[c]);this.layer=a;this.handlers={drag:new b.Handler.Drag(this,b.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks),{documentDrag:this.documentDrag}),feature:new b.Handler.Feature(this,this.layer,b.Util.extend({click:this.clickFeature,
clickout:this.clickoutFeature,over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})}},clickFeature:function(a){if(this.handlers.feature.touch&&!this.over&&this.overFeature(a))this.handlers.drag.dragstart(this.handlers.feature.evt),this.handlers.drag.stopDown=!1},clickoutFeature:function(a){if(this.handlers.feature.touch&&this.over)this.outFeature(a),this.handlers.drag.stopDown=!0},destroy:function(){this.layer=null;b.Control.prototype.destroy.apply(this,
[])},activate:function(){return this.handlers.feature.activate()&&b.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.handlers.drag.deactivate();this.handlers.feature.deactivate();this.feature=null;this.dragging=!1;this.lastPixel=null;b.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");return b.Control.prototype.deactivate.apply(this,arguments)},overFeature:function(a){var c=!1;this.handlers.drag.dragging?this.over=this.feature.id==a.id?!0:!1:(this.feature=
a,this.handlers.drag.activate(),this.over=c=!0,b.Element.addClass(this.map.viewPortDiv,this.displayClass+"Over"),this.onEnter(a));return c},downFeature:function(a){this.lastPixel=a;this.onStart(this.feature,a)},moveFeature:function(a){var b=this.map.getResolution();this.feature.geometry.move(b*(a.x-this.lastPixel.x),b*(this.lastPixel.y-a.y));this.layer.drawFeature(this.feature);this.lastPixel=a;this.onDrag(this.feature,a)},upFeature:function(){this.over||this.handlers.drag.deactivate()},doneDragging:function(a){this.onComplete(this.feature,
a)},outFeature:function(a){if(this.handlers.drag.dragging){if(this.feature.id==a.id)this.over=!1}else this.over=!1,this.handlers.drag.deactivate(),b.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over"),this.onLeave(a),this.feature=null},cancel:function(){this.handlers.drag.deactivate();this.over=!1},setMap:function(a){this.handlers.drag.setMap(a);this.handlers.feature.setMap(a);b.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.DragFeature"});b.Control.Permalink=
b.Class(b.Control,{argParserClass:b.Control.ArgParser,element:null,anchor:!1,base:"",displayProjection:null,initialize:function(a,c,d){if(a!==null&&typeof a=="object"&&!b.Util.isElement(a)){if(this.base=document.location.href,b.Control.prototype.initialize.apply(this,[a]),this.element!=null)this.element=b.Util.getElement(this.element)}else b.Control.prototype.initialize.apply(this,[d]),this.element=b.Util.getElement(a),this.base=c||document.location.href},destroy:function(){this.element.parentNode==
this.div&&this.div.removeChild(this.element);this.element=null;this.map.events.unregister("moveend",this,this.updateLink);b.Control.prototype.destroy.apply(this,arguments)},setMap:function(){b.Control.prototype.setMap.apply(this,arguments);for(var a=0,c=this.map.controls.length;a<c;a++){var d=this.map.controls[a];if(d.CLASS_NAME==this.argParserClass.CLASS_NAME){if(d.displayProjection!=this.displayProjection)this.displayProjection=d.displayProjection;break}}a==this.map.controls.length&&this.map.addControl(new this.argParserClass({displayProjection:this.displayProjection}))},
draw:function(){b.Control.prototype.draw.apply(this,arguments);if(!this.element&&!this.anchor)this.element=document.createElement("a"),this.element.innerHTML=b.i18n("Permalink"),this.element.href="",this.div.appendChild(this.element);this.map.events.on({moveend:this.updateLink,changelayer:this.updateLink,changebaselayer:this.updateLink,scope:this});this.updateLink();return this.div},updateLink:function(){var a=this.anchor?"#":"?",c=this.base;c.indexOf(a)!=-1&&(c=c.substring(0,c.indexOf(a)));c+=a+
b.Util.getParameterString(this.createParams());this.anchor&&!this.element?window.location.href=c:this.element.href=c},createParams:function(a,c,d){var a=a||this.map.getCenter(),f=b.Util.getParameters(this.base);if(a){f.zoom=c||this.map.getZoom();c=a.lat;a=a.lon;if(this.displayProjection)c=b.Projection.transform({x:a,y:c},this.map.getProjectionObject(),this.displayProjection),a=c.x,c=c.y;f.lat=Math.round(c*1E5)/1E5;f.lon=Math.round(a*1E5)/1E5;d=d||this.map.layers;f.layers="";a=0;for(c=d.length;a<c;a++){var e=
d[a];f.layers+=e.isBaseLayer?e==this.map.baseLayer?"B":"0":e.getVisibility()?"T":"F"}}return f},CLASS_NAME:"OpenLayers.Control.Permalink"});b.Icon=b.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(a,c,d,f){this.url=a;this.size=c?c:new b.Size(20,20);this.offset=d?d:new b.Pixel(-(this.size.w/2),-(this.size.h/2));this.calculateOffset=f;a=b.Util.createUniqueID("OL_Icon_");this.imageDiv=b.Util.createAlphaImageDiv(a)},destroy:function(){this.erase();
b.Event.stopObservingElement(this.imageDiv.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null},clone:function(){return new b.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){b.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&&b.Element.remove(this.imageDiv)},setOpacity:function(a){b.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(!1);else{if(this.calculateOffset)this.offset=this.calculateOffset(this.size);a=this.px.offset(this.offset);b.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"});b.Marker=b.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(a,c){this.lonlat=a;var d=c?c:b.Marker.defaultIcon();this.icon==null?this.icon=d:(this.icon.url=d.url,this.icon.size=d.size,this.icon.offset=d.offset,this.icon.calculateOffset=d.calculateOffset);this.events=new b.Events(this,this.icon.imageDiv,null)},destroy:function(){this.erase();this.map=null;this.events.destroy();this.events=null;if(this.icon!=null)this.icon.destroy(),
this.icon=null},draw:function(a){return this.icon.draw(a)},erase:function(){this.icon!=null&&this.icon.erase()},moveTo:function(a){a!=null&&this.icon!=null&&this.icon.moveTo(a);this.lonlat=this.map.getLonLatFromLayerPx(a)},isDrawn:function(){return this.icon&&this.icon.isDrawn()},onScreen:function(){var a=!1;this.map&&(a=this.map.getExtent().containsLonLat(this.lonlat));return a},inflate:function(a){this.icon&&this.icon.setSize(new b.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"});b.Marker.defaultIcon=function(){var a=b.Util.getImagesLocation()+"marker.png",c=new b.Size(21,25);return new b.Icon(a,c,null,function(a){return new b.Pixel(-(a.w/2),-a.h)})};return b}(),NMaps=Navitel.Maps=function(){var b={},a=function(a,b){b.addEventListener=function(c,d,f){b.constructor.prototype.addEventListener.call(this,c,d,f);a.register(c,f,d)}};b.THEME_PATH="navitel/theme/white";
b.DISPLAY_PROJECTION="EPSG:4326";b.PROJECTION="EPSG:900913";b.Util={SUPPORT:{CANVAS:OpenLayers.Renderer.Canvas.prototype.supported()},getDisplayCoordinate:function(a,c){var d=(a-Math.floor(a))*60,f=(d-Math.floor(d))*60,d={full_degrees:a,degrees:Math.floor(Math.abs(a)),full_minutes:d,minutes:Math.floor(d),fill_seconds:f,seconds:f.toFixed(2)};d.title=c=="lat"?a<0?b.pgettext("WSG84","S"):b.pgettext("WSG84","N"):a<0?b.pgettext("WSG84","W"):b.pgettext("WSG84","E");return d},showError:function(a){var b=
document.getElementById("modalAlert");if(!b)b=document.createElement("div"),b.id="NMaps-modalAlert",b.className="NMaps-modalAlert",b.onclick=function(){this.style.display="none";this.innerHTML=""},document.body.appendChild(b);b.innerHTML=a;b.style.visibility="hidden";b.style.display="inline-block";var a=OpenLayers.Util.getViewportElement(),c=(a.clientWidth-b.offsetWidth)/2;b.style.top=Math.round((a.clientHeight-b.offsetHeight)/2)+"px";b.style.left=Math.round(c)+"px";b.style.visibility="visible"},
getHTTPErrorMessage:function(a){var c;switch(a.status){case 500:c=b._("Internal server error");break;case 503:c=b._("The server is currently unavailable (because it is overloaded or down for maintenance)");break;case 404:c=b._("Resource not found");break;default:var d="error"+a.status;c=b.dgettext_ne("http_errors",d);c==d&&(c=Navitel.Text.strargs(b.gettext("Unhandled request return %1"),a.statusText))}return c},handleError:function(a){this.showError(this.getHTTPErrorMessage(a));return!0}};RegExp.escape=
RegExp.escape||function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")};b.Util.handleError=b.Util.handleError.bind(b.Util);b.RequestClass=function(){};Navitel.extend(b.RequestClass.prototype,OpenLayers.Request);b.RequestClass.prototype.runCallbacks=function(a){var b=a.config,c=function(a){return function(e){var c=e.responseText,d="text";if(!b.dataType)b.dataType="auto";if(b.dataType=="auto"){var f=e.getResponseHeader("Content-Type");if(f&&(f=f.split(/;\s*/)[0],f=="application/json"||f=="text/json"))d=
"json"}else d=b.dataType;if(d=="json")try{c=Navitel.Json.parse(e.responseText)}catch(h){h instanceof SyntaxError&&(c=eval("("+e.responseText+")"))}a.call(this,c,e)}};if(b.callback)b.callback=c(b.callback);if(b.success)b.success=c(b.success);if(b.failure)b.failure=c(b.failure);OpenLayers.Request.runCallbacks.call(this,a)};b.Request=new b.RequestClass;b.nullHandler=function(a,c){b.Util.handleError(c)};b.loadURL=function(a,c,d,f,k){typeof c=="string"&&(c=OpenLayers.Util.getParameters(c));return b.Request.issue({url:a,
params:c,success:f?f:function(){},failure:k?k:b.nullHandler,scope:d,method:"GET"})};b.i18n=new Navitel.i18n(b,null);b.setLang=function(a){var c=b.i18n,d=c.selectLang(a,"ru"),a=function(){c.install(c.getLocaleData(d));c.setLang(d)};c.getLocaleData(d)!=null?a():Navitel.Io.script({url:b.BASE_URI+b.THEME_PATH+"/langs/"+d+".js"}).send(a)};OpenLayers.i18n_old=OpenLayers.i18n;OpenLayers.i18n=function(a){return b.dgettext("openlayers",a)};b.i18n.supported_locales=["uk_UA","ru","en","es"];b.Template=new Navitel.Template(b);
b.Styles={};b.Styles.$E=function(a,b){var c={};Navitel.extend(c,this[a]);return Navitel.extend(c,b)};b.Handler=OpenLayers.Class(OpenLayers.Handler,Navitel.EventTarget,{});b.Handler.Autocompleter=function(a,b){Navitel.Ui.Menu.call(this,a,b);this.setInput(a);this.render();this.place()};Navitel.inherits(b.Handler.Autocompleter,Navitel.Ui.Menu);Navitel.extendClass(b.Handler.Autocompleter,{selectedIndex:-1,popupCorner:null,input:null,minChars:3,delayPopupTimer:null,delayPopupTimeout:700,setInput:function(a){if(a)this.setInput(null),
a=Navitel.Dom.getElement(a),this.currentValue=a.value,Navitel.Events.listen(a,"keyup",this.handleInputKeyUp,this),Navitel.Events.listen(a,"keydown",this.handleInputKeyPress,this),this.input=a;else if(this.input)a=this.input,Navitel.Events.unlisten(a,"keyup",this.handleInputKeyUp,this),Navitel.Events.unlisten(a,"keydown",this.handleInputKeyPress,this)},enterDocument:function(){this.addClass("b_page_autocomplete");b.Handler.Autocompleter._superClass.enterDocument.call(this)},destroy:function(){this.setInput(null);
b.Handler.Autocompleter._superClass.destroy.call(this)},positionRelative:function(a){var b=Navitel.Dom.absPosition(a);this.element.style.top=b.y+a.offsetHeight+"px";this.element.style.left=b.x+"px";this.element.style.width=a.clientWidth+"px"},place:function(a){(a=a||this.popupCorner||this.input)&&this.positionRelative(a)},handleInputKeyPress:function(a){if(this.enabled&&a){switch(a.keyCode){case 27:this.input.value=this.currentValue;this.setOpened(!1);break;case 9:case 13:if(this.selectedIndex===
-1){this.setOpened(!1);return}this.select(this.selectedIndex);if(a.keyCode===9)return;break;case 38:this.moveUp();break;case 40:this.moveDown();break;default:return}a.stopPropagation()}},handleInputKeyUp:function(a){if(a)switch(a.keyCode){case 38:case 40:return}this.clearPopupTimeout();if(this.currentValue!=this.input.value)if(this.delayPopupTimeout>0)this.delayPopupTimer=window.setTimeout(this.onValueChange.bind(this),this.delayPopupTimeout);else this.onValueChange()},clearPopupTimeout:function(){if(this.delayPopupTimer)window.clearTimeout(this.delayPopupTimer),
this.delayPopupTimer=null},onValueChange:function(){this.clearPopupTimeout();this.currentValue=this.input.value;this.selectedIndex=-1;this.currentValue==""||this.currentValue.length<this.minChars?this.setOpened(!1):this.autocomplete()},autocomplete:function(){},setVisible:function(a){a?this.element.style.display="":(this.enabled=!1,this.selectedIndex=-1,this.element.style.display="none")},_setStateInternal:function(a,b){a==Navitel.Ui.Element.States.OPENED&&this.setVisible(b)},highlight:function(a,
b){return a.replace(b,'<span class="b_autocomplete_match">$1</span>')},clearContent:function(){for(var a=this.getContentNode();a.firstChild;)a.removeChild(a.firstChild)},getItemElements:function(){return[].slice.call(this.getContentNode().childNodes)},activate:function(a){var b=this.getItemElements(),c;b[this.selectedIndex]&&Navitel.Dom.Classes.remove(b[this.selectedIndex],"selected");this.selectedIndex=a;b[this.selectedIndex]&&(c=b[this.selectedIndex],Navitel.Dom.Classes.add(c,"selected"));return c},
moveUp:function(){if(this.selectedIndex!=-1){var a=this.getItemElements();this.selectedIndex==0?(Navitel.Dom.Classes.remove(a[0],"selected"),this.selectedIndex=-1,this.input.value=this.currentValue):this.adjustScroll(this.selectedIndex-1)}},moveDown:function(){this.selectedIndex!=this.getItemElements().length-1&&this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(a){var b=this.getContentNode(),c=this.activate(a);if(c){var d=[b.scrollTop,b.scrollTop+b.clientHeight],c=[c.offsetTop,c.offsetTop+
c.offsetHeight];if(c[0]<d[0])b.scrollTop=c[0];if(c[1]>d[1])b.scrollTop=c[1]-b.clientHeight;this.handleItemSelected(a)}},select:function(){},handleItemSelected:function(){}});b.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler.Keyboard,{skipInputs:!0,handleKeyEvent:function(a){this.checkModifiers(a)&&this.checkValidFocus(a)&&this.callback(a.type,[a])},checkValidFocus:function(a){return function(a){return["input","textarea"].indexOf(a.nodeName.toLowerCase())==-1}(OpenLayers.Event.element(a))}});
b.Icon=OpenLayers.Class(OpenLayers.Icon,{initialize:function(a,b,c,d){this.url=a;b||(b=[20,20]);Array.isArray(b)&&(b=new OpenLayers.Size(b[0],b[1]));this.size=b;c||(c=[-(this.size.w/2),-(this.size.h/2)]);Array.isArray(c)&&(c=new OpenLayers.Pixel(c[0],c[1]));this.offset=c;this.calculateOffset=d;this.createLayout();this.imageDiv.className="NMaps-marker"},destroy:function(){this.erase();OpenLayers.Event.stopObservingElement(this.getImageNode());this.imageDiv=null},createLayout:function(){this.imageDiv=
document.createElement("img")},getImageNode:function(){return this.imageDiv},draw:function(a){var b=this.getImageNode();b.src=this.url;this.imageDiv.style.width=this.size.w;this.imageDiv.style.height=this.size.h;if(b!=this.imageDiv)b.style.width=this.size.w,b.style.height=this.size.h;this.moveTo(a);return this.imageDiv},setOpacity:function(a){OpenLayers.Util.setOpacity(this.imageDiv,a)},moveTo:function(a){if(a!=null)this.px=a;a=this.imageDiv;if(a!=null)if(this.px==null)this.display(!1);else{if(this.calculateOffset)this.offset=
this.calculateOffset(this.size);var b=this.px.offset(this.offset);OpenLayers.Util.modifyDOMElement(a,null,b)}},setStyle:function(a){a=b.Icon.parseStyle(a);Navitel.extend(this,a);this.style=a.style;this.draw()}});b.Icon.parseStyle=function(a){var c={},d=a;typeof a=="string"&&(d=b.Styles[a]);if(d.width&&d.height)c.size=new OpenLayers.Size(d.width,d.height);if(d.imagePath)a=d.imagePath,Navitel.Text.isAbsoluteUrl(a)||(a=OpenLayers.ImgPath+a),c.url=a;c.offset=new OpenLayers.Pixel(-(typeof d.offsetLeft!=
"undefined"?d.offsetLeft:size.w/2),-(typeof d.offsetTop!="undefined"?d.offsetTop:size.h));c.style=d;return c};b.Icon.make=function(a,c){if(c==null)c=b.Icon;var d=this.parseStyle(a),f=new c(d.url,d.size,d.offset);f.style=d.style;return f};b.LabeledIcon=OpenLayers.Class(b.Icon,{createLayout:function(){var a=this.imageDiv=document.createElement("div");this._img=document.createElement("img");a.appendChild(this._img);this._textNode=document.createElement("div");this._textNode.className="NMaps-icon-label";
a.appendChild(this._textNode);return a},draw:function(a){b.Icon.prototype.draw.call(this,a);this.style&&this.style.label&&Navitel.extend(this._textNode.style,this.style.label);return this.imageDiv},getImageNode:function(){return this._img},setLabel:function(a){this._textNode.innerHTML=a},getLabel:function(){return this._textNode.innerHTML}});b.Tile={};OpenLayers.Projection._instances={};OpenLayers.Projection.getInstance=function(a){this._instances[a]||(this._instances[a]=new OpenLayers.Projection(a));
return this._instances[a]};var c=OpenLayers.Projection.getInstance(b.DISPLAY_PROJECTION),d=OpenLayers.Projection.getInstance(b.PROJECTION),f={project:function(){return this.transform(c,d)},unproject:function(){return this.transform(d,c)}};Navitel.extendClass(OpenLayers.LonLat,f);Navitel.extendClass(OpenLayers.Bounds,f);b.MapZoomAnimation=Navitel.Class({_zoomDuration:80,initZoomAnim:function(){this._zoomAnim=new Navitel.Fx.Animation;this._zoomAnim.on({playing:this._onZoomPlay,started:this._onZoomStart,
stopped:this._onZoomEnd},this);this.listen("zoomend",this.handleZoomEnd,this);if(Navitel.UserAgent.MSIE&&parseInt(Navitel.UserAgent.version)<9)this._zoomDuration=140},handleZoomEnd:function(){this._lastZoomId=this.viewRequestID;if(!(this._lastAnimZoom==this.zoom||this.tweenTiles.length==0)){this.zoomAnimation&&this._zoomAnim.stop();this.zoomAnimation=!0;this._lastAnimZoom=this.zoom;this._animData={};for(var a={},b=0;b<this.tweenTiles.length;b++){var c=this.tweenTiles[b],d=c.backBufferTile;if(d){var f=
Navitel.getUid(d),f=Navitel.setdefault(this._animData,f);f.from=[parseInt(d.frame.style.left)+this.animationOffset.x,parseInt(d.frame.style.top)+this.animationOffset.y,parseInt(d.frame.style.width)];f.to=[c.px.x,c.px.y,c.sz.w];a[c.id]=c}}this.tweenTiles=[];this._animTiles=a;this._zoomAnim.play(this._zoomDuration)}},_updateNode:function(a,b,c,d){a.style.width=d+"px";a.style.height=d+"px";a.style.left=b+"px";a.style.top=c+"px"},_transformTile:function(a,b,c,d,f){var j=Math.ceil(c[0]+f*(d[0]-c[0])),
l=Math.ceil(c[1]+f*(d[1]-c[1])),c=Math.ceil(c[2]+f*(d[2]-c[2])),d=this._updateNode;d(a,j,l,c);l=j=c<256?-1:0;d(b,j,l,c<256?c+2:c)},_animUpdateTile:function(a,b){var c=a.backBufferTile,d=c.frame,f=c.imgDiv,c=this._animData[Navitel.getUid(c)];this._transformTile(d,f,c.from,c.to,b)},_onZoomStart:function(){this.fire("animationstart");for(var a in this._animTiles){var b=this._animTiles[a];this._animUpdateTile(b,0);b.hide();b.backBufferTile.show()}},_onZoomPlay:function(a){var a=a.progress,b;for(b in this._animTiles){var c=
this._animTiles[b];c.backBufferTile?this._animUpdateTile(c,a):delete this._animTiles[b]}},_onZoomEnd:function(){this.zoomAnimation=!1;this._animData=this._animTiles=null;this.fire("animationend")}});b.Map=OpenLayers.Class(OpenLayers.Map,b.MapZoomAnimation,Navitel.EventTarget,{Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Vector:525,Feature:750,Marker:950,Popup:1150,Control:1350},controls:[],mapUrl:["http://m01.navitel.su/2.0/navitms.fcgi?t=","http://m02.navitel.su/2.0/navitms.fcgi?t=","http://m03.navitel.su/2.0/navitms.fcgi?t=",
"http://m04.navitel.su/2.0/navitms.fcgi?t="],jamsUrl:["http://m01.navitel.su/2.0/navitms.fcgi?j=","http://m02.navitel.su/2.0/navitms.fcgi?j=","http://m03.navitel.su/2.0/navitms.fcgi?j=","http://m04.navitel.su/2.0/navitms.fcgi?j="],routesUrl:"http://maps.navitel.su/2.0/route_manager.fcgi",resolutions:[0.0186613838586856,0.0373227677173712,0.0746455354347424,0.149291070869485,0.29858214173897,0.597164283477939,1.19432856695588,2.38865713391176,4.77731426782352,9.55462853564703,19.1092570712941,38.2185141425881,
76.4370282851763,152.874056570353,305.748113140705,611.49622628141,1222.99245256282,2445.98490512564,4891.96981025128,9783.93962050256,19567.8792410051,39135.7584820102,78271.5169640205,156543.033928041],units:"m",home:[37.6,55.8,6],withJams:!0,withClickHandler:!0,basePrintUrl:"./print.html",themePath:"navitel/theme/white",initialize:function(){OpenLayers.Map.prototype.initialize.apply(this,arguments);a(this.events,this);Navitel.Dom.Classes.add(this.layerContainerDiv,"NMaps-layer-container");this.handleError=
this.handleError.bind(this);b.i18n.installed()||b.setLang("ru");Navitel.Cookie.get("PLAY_SESSION")||Navitel.Cookie.remove("PLAY_SESSION");this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");Navitel.Dom.Classes.has(document.body,"NMaps")||Navitel.Dom.Classes.add(this.div,"NMaps");Navitel.Dom.Classes.add(this.div,"NMaps-map");this.numZoomLevels=this.resolutions.length;this.minZoomLevel=3;this.maxZoomLevel=17;this.projection=OpenLayers.Projection.getInstance(b.PROJECTION);this.displayProjection=
OpenLayers.Projection.getInstance(b.DISPLAY_PROJECTION);this.maxExtent=new OpenLayers.Bounds(-2.003750834E7,-2.003750834E7,2.203750834E7,2.303750834E7);this.restrictedExtent=new OpenLayers.Bounds(-2.003750834E7,-1.73686842808E7,2.1258271904556E7,1.73686842808E7);OpenLayers.ImgPath=b.BASE_URI+this.themePath+"/style/img/";b.IMG_PATH=OpenLayers.ImgPath;var e=OpenLayers.Util.getParameters();e.zoom=e.zoom||e.z;if(e.home&&e.home.length==3)this.home=[e.home[0],e.home[1],e.home[2]];else{var c=Navitel.Cookie.get("params");
if(c)try{var d=Navitel.Json.parse(c);if(d.home&&(d.home=d.home.split(","),d.home[0]&&d.home[1]&&d.home[2]))this.home=d.home.map(function(a){return Number(a)})}catch(f){console&&console.warn("Failed to parse cookie params",c)}}c=OpenLayers.LonLat.fromString(e.lon==null||e.lat==null?[this.home[0],this.home[1]].join(","):[e.lon,e.lat].join(",")).transform(this.displayProjection,this.projection);this.tweenTiles=[];if(!this.layerTile)this.layerTile=new b.Layer.Tile("Navitel TileCache",this.getMapUrl()),
this.addLayer(this.layerTile);if(!this.layerJams&&this.withJams)this.layerJams=new b.Layer.Jams("\u041f\u0440\u043e\u0431\u043a\u0438",this.getJamsUrl()),this.addLayer(this.layerJams);this.getExtent()==null&&this.setCenter(c,e.zoom==null?this.home[2]:Number(e.zoom));if(this.withClickHandler)this.click=new b.Control.Click(this,this.clickOptions||{});this.tooltip=b.Tooltip.getInstance();e=this.errorPopup=new Navitel.Ui.Popup;e.render(this.errorDiv||this.viewPortDiv);e.hide();e.addClass("NMaps-error-popup");
window.imageBlank=new Image;window.imageBlank.src=OpenLayers.ImgPath+"blank.gif";this.initZoomAnim();this.addControl(new b.Control.NavitelLogoLink("logo","http://www.navitel.su/partners/maps/"));this.initPrint()},addLayer:function(a){if(a.urlId){var b=OpenLayers.Util.getParameters();RegExp(a.urlId).test(b.fl)&&a.setVisibility(!1)}OpenLayers.Map.prototype.addLayer.call(this,a)},zoomTo:function(a,b){if(this.isValidZoomLevel(a)){var c=null;if(b!=null){var c=this.getCenter(),d=this.getResolution(),f=
(b.lon-c.lon)/d,d=(b.lat-c.lat)/d,j=this.getResolutionForZoom(a);c.lon=b.lon-f*j;c.lat=b.lat-d*j}this.setCenter(c,a)}},moveTo:function(a,b){if(b!=null)this.viewPortDiv.style.backgroundColor=b>=10?"#f2efe9":"#CBD8C3";return OpenLayers.Map.prototype.moveTo.apply(this,arguments)},setCenter:function(){this.animationOffset={x:parseInt(this.layerContainerDiv.style.left),y:parseInt(this.layerContainerDiv.style.top)};this.wheelChanged=!1;OpenLayers.Map.prototype.setCenter.apply(this,arguments)},isValidZoomLevel:function(a){return a!=
null&&a>=this.minZoomLevel&&a<=this.maxZoomLevel},getProjectionObject:function(){return this.projection},getTileOffset:function(a,b,c){var c=c||this.getZoom(),d=this.getMaxExtent(),f=this.getTileSize(),j=this.getResolutionForZoom(c),c=j*f.w,f=j*f.h,a=Math.floor((a-d.left)/c),b=Math.floor((b-d.bottom)/f),f=Math.floor(Math.abs(d.bottom-d.top)/f)-1,a=Math.min(Math.floor(Math.abs(d.right-d.left)/c)-1,a),b=Math.min(f,b);return[a,b]},boundsToTileBounds:function(a){var b=this.getTileOffset(a.left,a.bottom),
a=this.getTileOffset(a.right,a.top);return new OpenLayers.Bounds(b[0],b[1],a[0],a[1])},getExtentInTiles:function(){var a=this.getExtent();a&&(a=this.boundsToTileBounds(a));return a},_getOffsetFromLonLat:function(a,b){b==null&&(b=this.getZoom());var c=this.getTileSize(),d=this.getResolutionForZoom(b),f=this.getMaxExtent(),j=d*c.w,l=d*c.h,m=this.getTileOffset(a.lon,a.lat,b),c=m[0],m=m[1],j=Math.round((a.lon-f.left-c*j)/d),d=Math.round((a.lat-f.bottom-m*l)/d),j=Math.min(j,255),d=Math.min(d,255);return[c,
m,b,j,d]},_getLonLatFromOffset:function(a){var b=a[0],c=a[1],d=a[2],f=a[3],a=a[4],j=this.getTileSize(),l=this.getMaxExtent(),d=this.getResolutionForZoom(d);return new OpenLayers.LonLat(l.left+(f+j.w*b)*d,l.bottom+(a+j.h*c)*d)},setLayerZIndex:function(a,b){var c=a.isBaseLayer?"BaseLayer":"Overlay";a instanceof OpenLayers.Layer.Vector?c="Vector":a instanceof OpenLayers.Layer.Markers&&(c="Marker");c=this.Z_INDEX_BASE[c];a.setZIndex(c+b*5)},drawInCanvas:function(a,b){var c=[].concat(this.layers);c.sort(function(a,
b){return a.getZIndex()-b.getZIndex()});b==null&&(b=this.getExtent());for(var d=0,f=c.length;d<f;d++){var j=c[d];j.drawInCanvas&&j.getVisibility()&&(a.save(),j.drawInCanvas(a,b),a.restore())}},initPrint:function(){if(b.Util.SUPPORT.CANVAS){Navitel.Dom.Classes.add(this.div,"NMaps-alt-print");var a=document.createElement("canvas");a.className="NMaps-canvasViewPort";this.viewPortDiv.appendChild(a);this.canvasRenderer=new b.Control.CanvasRenderer(a);this.addControl(this.canvasRenderer)}},displayError:function(a,
b){this._errFadeTimer&&window.clearTimeout(this._errFadeTimer);var c=this.errorPopup;c.setContent(a);(!c.isVisible()||c.fadePlaying())&&c.fadeIn(400);this._errFadeTimer=window.setTimeout(function(){c.fadeOut();this._errFadeTimer=null}.bind(this),b||4E3)},handleError:function(a){this.displayError(b.Util.getHTTPErrorMessage(a))},updateSize:function(){OpenLayers.Map.prototype.updateSize.call(this);this.fire("resize")},destroy:function(){this.tweenTiles=this.imageCache=this.changeLayerTimeout=window.imageBlank=
null;OpenLayers.Map.prototype.destroy.call(this)},getMapUrl:function(){return this.mapUrl},getJamsUrl:function(){return this.jamsUrl}});Navitel.Map=b.Map;b.Map._detectBaseUri=function(){for(var a="",b=RegExp("(.*"+RegExp.escape("navitel.su")+"/.*)navitel/theme/white/main.js"),c=document.getElementsByTagName("script"),d=0,f=c.length;d<f;d++){var j=c[d].src;if(j&&(j=j.match(b))){a=j[1];break}}return a};b.BASE_URI=b.Map._detectBaseUri();b.BasePopup=function(a){this.offset=new Navitel.Math.Point(0,0);
this.translation=new Navitel.Math.Point(0,0);this.baseOffset=[0,0];Navitel.extend(this,a)};Navitel.inherits(b.BasePopup,Navitel.Ui.Popup);Navitel.extendClass(b.BasePopup,{lonlat:null,offset:null,translation:null,baseOffset:null,_orientation:"lt",_visStack:[],_positionStyles:{l:"left",r:"right",t:"top",b:"bottom"},resetOffset:function(){this.offset.set.apply(this.offset,this.baseOffset)},_calcBaseOffset:function(){return[0,0]},invalidateOffset:function(){this.baseOffset=this._calcBaseOffset();this.resetOffset()},
getContentNode:function(){return this._contentNode||this.element},setLonLat:function(a){this.lonlat=a},setOrientation:function(a){this._orientation=a||"lt"},enterDocument:function(){this.addClass("navi-popup");Navitel.Events.listen(this.element,["click","mousemove","mousedown","mouseup"],this._handleEvents,this);this._contentNode=Navitel.Dom.q(".NMaps-popup-content",this.element)[0];Navitel.Events.listen(this._contentNode,"dblclick",Navitel.Events.stop)},_handleEvents:function(a){if(a.type=="mousedown")this._mousedown=
!0;else if(a.type=="mouseup"){if(!this._mousedown)return;this._mousedown=!1}a.stopPropagation()},pushVisible:function(a){var b=this.isVisible();this._visStack.push([b,this.element.style.visibility]);if(!b)this.element.style.visibility="hidden";this.element.style.display=a?"":"none"},popVisible:function(){var a=this._visStack.pop(),b=a[1];this.element.style.display=a[0]?"":"none";this.element.style.visibility=b},getSize:function(){this.pushVisible(!0);var a=this.element.offsetWidth,b=this.element.offsetHeight;
this.popVisible();return{w:a,h:b}},applyTranslations:function(a){var b=this._orientation,c=b.charAt(0)=="l",b=b.charAt(1)=="t",d=this.translation.x,f=this.translation.y;if(!c)a.x=-a.x,d=-d;if(!b)a.y=-a.y,f=-f;a.x+=this.offset.x+d;a.y+=this.offset.y+f;return a},calcOrientation:function(a){var a=this.map.getViewPortPxFromLayerPx(a),b=this.getSize(),c=this.map.div.clientWidth;a.x+=this.offset.x+this.translation.x;a.y+=this.offset.y+this.translation.y;var d="l";c-b.w<a.x&&(d="r");return d+"t"},draw:function(){return this.element},
updatePosition:function(){if(this.lonlat&&this.map){var a=this.map.getLayerPxFromLonLat(this.lonlat);if(a){var b=this.calcOrientation(a);this.setOrientation(b);this.applyTranslations(a);var c=this._positionStyles,d=c[b.charAt(0)],f=c[b.charAt(1)],j=this.element;j.style[d]=a.x+"px";j.style[f]=a.y+"px";Object.keys(c).filter(function(a){return b.indexOf(a)==-1}).forEach(function(a){j.style[c[a]]=""})}}},panIntoView:function(){var a=0,b=0,c=this.element;this.pushVisible(!0);var d=new OpenLayers.Pixel(c.offsetLeft,
c.offsetTop),d=this.map.getViewPortPxFromLayerPx(d),f=d.y+c.offsetHeight,c=d.x+c.offsetWidth;this.popVisible();var j=this.map.div.clientWidth,l=this.map.div.clientHeight;if(c>j)a=c-j;else if(d.x<0)a=d.x;if(f>l)b=f-l;else if(d.y<0)b=d.y;(a||b)&&this.map.pan(a,b)}});b.Popup=function(a){b.BasePopup.call(this,a);this.render()};Navitel.inherits(b.Popup,b.BasePopup);Navitel.extendClass(b.Popup,{withZoomers:!1,_zoomersMod:"NMaps-popup-with-zoomers",withCloser:!0,withTip:!0,_createHtml:function(){return b.Template.render("popup-layout",
{withZoomers:this.withZoomers,withCloser:this.withCloser,withTip:this.withTip})},createDom:function(){return Navitel.Dom.fromHtml(this._createHtml())},setContent:function(a){b.Popup._superClass.setContent.call(this,a);this.adjustLayout()},_getTipNode:function(){var a=".NMaps-popup-tip";a+=this.hasZoomers()?"-z":"-d";return Navitel.Dom.q(a,this.element)[0]},_calcBaseOffset:function(){if(!this.withTip&&!this.withZoomers)return b.Popup._superClass._calcBaseOffset.call(this);var a=this.element,c=this.withTip?
this._getTipNode():this._zoomersNode,d=this._orientation.charAt(0)=="l";this.pushVisible(!0);var f=Navitel.Dom.getPageOffset(c),k=Navitel.Dom.getPageOffset(a),a=d?k.x-f.x-1:f.x+c.offsetWidth-(k.x+a.offsetWidth)-1,c=-c.offsetTop-Math.ceil(c.offsetHeight/2)-1;this.popVisible();return[a,c]},adjustLayout:function(){if(this.hasZoomers()){var a=this.element,b=this._zoomersNode;this.pushVisible(!0);var c=a.clientHeight,d=b.style.height;b.style.height="";var f=b.clientHeight;b.style.height=d;var j=parseInt(Navitel.Style.getStyle(a,
"borderBottomRightRadius")||9);this.popVisible();var b=this._zoomersNode,d=Navitel.Dom.Classes,j=f+j,l="",m=d.add;if(c>f&&c<j)l=c+"px";else if(c>=j)m=d.remove;m.call(d,a,"NMaps-popup-hsmall");b.style.height=l}},setOrientation:function(a){b.Popup._superClass.setOrientation.call(this,a);var c=this.element,d=Navitel.Dom.Classes,f=d._list,k=f(c)[0];["lt","rt","lb","rb"].forEach(function(a){d.remove(c,k+"-"+a)});d.add(c,k+"-"+(a||"lt"))},enableZoomers:function(a){if(this.withZoomers&&this.hasZoomers()!=
a){var b=Navitel.Dom.Classes;(a?b.add:b.remove)(this.element,this._zoomersMod);this.invalidateOffset()}},hasZoomers:function(){if(!this.withZoomers)return!1;return Navitel.Dom.Classes.has(this.element,this._zoomersMod)},enterDocument:function(){b.Popup._superClass.enterDocument.call(this);if(this.withCloser)this._closeButton=Navitel.Dom.q(".NMaps-popup-close",this.element)[0],Navitel.Events.listen(this._closeButton,"click",this._closeClick,this),this.addClass("navi-popup-with-closer");Navitel.Dom.q(".NMaps-popup-tip",
this.element).bind("contextmenu",function(a){Navitel.Events.stop(a);Navitel.Events.cancel(a)});if(this.withZoomers)this._zoomersNode=Navitel.Dom.q(".NMaps-popup-zoomers",this.element)[0];this.setOrientation("lt");this.invalidateOffset()},_closeClick:function(){this.fire("close")&&this.hide()}});b.Tooltip=OpenLayers.Class({hideTimer:null,initialize:function(){this.element=document.createElement("SPAN");this.element.className="NMaps-tooltip";document.body.appendChild(this.element)},show:function(a,
b){if(this.hideTimer)window.clearTimeout(this.hideTimer),this.hideTimer=null;this.element.style.left=b.x+"px";this.element.style.top=b.y+"px";this.element.style.display="block";this.element.innerHTML=a},hide:function(){this.element.style.display="none";this.element.innerHTML=""},hideAfter:function(a){this.hideTimer=window.setTimeout(this.hide.bind(this),a)}});b.Tooltip.getInstance=function(){if(!this.tooltip)this.tooltip=new b.Tooltip;return this.tooltip};b.Tile.ImageCache=OpenLayers.Class(OpenLayers.Tile.Image,
Navitel.EventTarget,{timerUrlId:null,setUrlTimeout:400,initialize:function(a,b,c,d,f,j){OpenLayers.Tile.Image.prototype.initialize.apply(this,arguments);this.isBackBuffer=j;this.frame.className=this.isBackBuffer?"NMaps-bg-tile":"NMaps-tile";this.events.registerPriority("loadend",this,this.onLoadEnd);this._setImgUrlHandler=this._setImgUrlHandler.bind(this)},destroy:function(){Navitel.EventTarget.destroy.call(this);this.clearLoadTimer();this.layer.events.unregister("loadend",this,this.allTilesLoaded);
this.layer.map.unlisten("animationend",this.onAnimationEnd,this);OpenLayers.Tile.Image.prototype.destroy.call(this)},show:function(){this.visible=!0;var a=Navitel.Ui.Element;a.removeState(this.frame,"hidden");a.addState(this.frame,"visible");this.isBackBuffer||this.fire("displayed")},hide:function(){this.visible=!1;var a=Navitel.Ui.Element;a.removeState(this.frame,"visible");a.addState(this.frame,"hidden")},isVisible:function(){return this.visible},clearLoadTimer:function(){if(this.timerUrlId!=null)window.clearTimeout(this.timerUrlId),
this.timerUrlId=null},clear:function(){this.clearLoadTimer();OpenLayers.Tile.Image.prototype.clear.apply(this,arguments)},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(this.layer.HARD_TRANSITIONS&this.layer.transitionEffect||this.layer.singleTile)a?(this.prepareTransition(),this.startTransition()):this.clearTransition();else if(a&&this.isFirstDraw)this.events.register("loadend",
this,this.showTile),this.isFirstDraw=!1;if(!a)return!1;this.isLoading?this.events.triggerEvent("reload"):(this.isLoading=!0,this.events.triggerEvent("loadstart"));return this.renderTile()},prepareTransition:function(){if(!this.backBufferTile)this.backBufferTile=this.makeBackBuffer(),this.events.register("loadend",this,this.resetBackBuffer),this.layer.events.register("loadend",this,this.allTilesLoaded)},makeBackBuffer:function(){var a=this.clone(null,!0);a.hide();return a},clearTransition:function(){this.backBufferTile&&
this.backBufferTile.clear()},positionImage:function(){if(this.layer!=null){this.frame.id=null;this.frame.style.left=this.position.x+"px";this.frame.style.top=this.position.y+"px";this.frame.style.width=this.size.w+"px";this.frame.style.height=this.size.h+"px";var a=this.layer.getImageSize();this.layerAlphaHack?OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,a,this.url):(this.imgDiv.style.left="0",this.imgDiv.style.top="0",this.imgDiv.style.width=a.w+"px",this.imgDiv.style.height=a.h+"px");
this.clearLoadTimer();this.timerUrlId=window.setTimeout(this._setImgUrlHandler,this.setUrlTimeout)}},_setImgUrlHandler:function(){this.timerUrlId=null;this.setImgUrl()},setImgUrl:function(){if(this.imgDiv)this.imgDiv.style.display="none",this.imgDiv.viewRequestID=this.layer.map.viewRequestID,this.imgDiv.src=this.url},onLoadEnd:function(){if(this.imgDiv&&this.imgDiv.src.match(OpenLayers.Util.getImagesLocation()+"blank.gif"))return this.isLoading=!0,!1},onAnimationEnd:function(){this.backBufferTile&&
!this.isLoading&&this.resetBackBuffer();this.layer.map.unlisten("animationend",this.onAnimationEnd,this)},startTransition:function(){if(this.backBufferTile&&this.backBufferTile.imgDiv){if(!this.fire("transitionstart"))return!1;var a=1,c=this.layer.getResolution();this.backBufferTile.resolution&&(a=this.backBufferTile.resolution/c);if(this.layer.maxTileScale&&(a>this.layer._maxTileRatio||a<this.layer._minTileRatio)){if(this.layer.useZoomAnimation&&this.layer.map.zoomAnimation)this.layer.map._zoomAnim.stop(),
this.layer.map.zoomAnimation=!1;this.backBufferTile.hide();return!1}var d=this.layer.transitionEffect&255&b.Layer.TransitionEffects.ANIM_RESIZE;if(c!=this.lastResolution){if(this.layer.transitionEffect&b.Layer.TransitionEffects.RESIZE){var f=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top),k=new OpenLayers.Size(Math.round(this.backBufferTile.size.w*a),Math.round(this.backBufferTile.size.h*a)),f=this.layer.map.getLayerPxFromLonLat(f);d?(this.px=f,this.sz=k,this.layer.map.tweenTiles.push(this)):
(OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,f,k),d=this.backBufferTile.imageSize,d=new OpenLayers.Size(Math.round(d.w*a),Math.round(d.h*a)),(k=this.backBufferTile.imageOffset)&&(k=new OpenLayers.Pixel(Math.round(k.x*a),Math.round(k.y*a))),OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,k,d),this.backBufferTile.show())}}else this.layer.singleTile?this.backBufferTile.show():this.backBufferTile.hide();this.lastResolution=c}},shouldLoadBackBuffer:function(){return this.backBufferTile&&
(this.isFirstDraw||!this.layer.numLoadingTiles)},withinMaxExtent:function(){var a=this.layer.maxExtent;return a&&this.bounds.intersectsBounds(a,!1)},loadBackBuffer:function(){if(this.withinMaxExtent())this.backBufferTile.position=this.position,this.backBufferTile.bounds=this.bounds,this.backBufferTile.size=this.size,this.backBufferTile.imageSize=this.layer.getImageSize(this.bounds)||this.size,this.backBufferTile.imageOffset=this.layer.imageOffset,this.backBufferTile.resolution=this.layer.getResolution(),
this.backBufferTile.renderTile();this.backBufferTile.hide()},resetBackBuffer:function(){if(this.layer._zoomAnimationReady()){if(this.showTile(),this.shouldLoadBackBuffer()&&(this.loadBackBuffer(),!this.isBackBuffer))this.isFirstDraw=!1}else this.layer.map.listen("animationend",this.onAnimationEnd,this)},allTilesLoaded:function(){this.resetBackBuffer()},initImgDiv:function(){var a=this.layer.imageOffset,b=this.layer.getImageSize(this.bounds);this.imgDiv=this.layerAlphaHack?OpenLayers.Util.createAlphaImageDiv(null,
a,b,null,"relative",null,null,null,!0):OpenLayers.Util.createImage(null,a,b,null,"relative",null,null,!0);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;this.attachToImg(this.imgDiv)},attachToImg:function(a){this.imgDiv=a;var b=function(){if(this.isLoading)this.isLoading=
!1,this.events&&this.events.triggerEvent("loadend")};this.onImageLoad=b.bind(this);this.layerAlphaHack?OpenLayers.Event.observe(a.childNodes[0],"load",this.onImageLoad):OpenLayers.Event.observe(a,"load",this.onImageLoad);this.onImageError=function(){a._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS&&b.call(this)}.bind(this);OpenLayers.Event.observe(a,"error",this.onImageError)},detachFromImg:function(a){this.onImageLoad&&(this.layerAlphaHack?OpenLayers.Event.stopObserving(a.childNodes[0],"load",this.onImageLoad):
OpenLayers.Event.stopObserving(a,"load",this.onImageLoad));this.onImageError&&OpenLayers.Event.stopObserving(a,"error",this.onImageError)},renderTile:function(){this.imgDiv==null&&this.initImgDiv();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);this.positionImage()}return!0},clone:function(a,c){a==null&&(a=new b.Tile.ImageCache(this.layer,
this.position,this.bounds,this.url,this.size,c));a=OpenLayers.Tile.prototype.clone.call(this,a);a.imgDiv=null;return a}});b.Tile.SoftImage=OpenLayers.Class(b.Tile.ImageCache,{destroy:function(){this.clearAnimTimer();this.layer.map.unlisten("animationend",this.allTilesLoaded,this);b.Tile.SoftImage._superClass.destroy.call(this)},prepareTransition:function(){if(!this.transitionInited)this.listen("transitionstart",this.handleTransitionStart,this),this.imgParams={},this.transitionInited=!0;b.Tile.ImageCache.prototype.prepareTransition.call(this);
this.backBufferTile.imgDiv||this.backBufferTile.initImgDiv()},showTile:function(){if(!this.isBackBuffer)this.lastDisplayedResolution=this.layer.getResolution(),this.layer.lastTileResolution=this.lastDisplayedResolution;b.Tile.ImageCache.prototype.showTile.call(this)},clearAnimTimer:function(){if(this._waitAnimTimer!=null)window.clearTimeout(this._waitAnimTimer),this._waitAnimTimer=null},clear:function(){this.clearLoadTimer();this.clearAnimTimer();this.imgDiv&&this.hide()},handleTransitionStart:function(){if(this.layer.lastTileResolution&&
this.lastDisplayedResolution&&this.lastDisplayedResolution!=this.layer.lastTileResolution)return this.backBufferTile.hide(),!1;if(!this.isLoading){if(!this.imgDiv)return!1;Navitel.extend(this.backBufferTile,this.imgParams);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,this.backBufferTile.position,this.backBufferTile.size);var a=this.backBufferTile.imgDiv,b=this.imgDiv;this.backBufferTile.detachFromImg(a);this.detachFromImg(b);this.backBufferTile.frame.replaceChild(b,a);this.backBufferTile.attachToImg(b);
this.frame.appendChild(a);this.attachToImg(a);this.backBufferTile.imgDiv.style.display="";this.backBufferTile.imgDiv.viewRequestID=null}if(OpenLayers.Tile.Image.useBlankTile)this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"},loadBackBuffer:function(){this.withinMaxExtent()&&this.isFirstDraw&&(Navitel.extend(this.backBufferTile,this.imgParams),OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,this.backBufferTile.position,this.backBufferTile.size))},resetBackBuffer:function(){this.imgParams.position=
this.position;this.imgParams.bounds=this.bounds;this.imgParams.size=this.size;this.imgParams.imageSize=this.layer.getImageSize(this.bounds)||this.size;this.imgParams.imageOffset=this.layer.imageOffset;this.imgParams.resolution=this.layer.getResolution();b.Tile.ImageCache.prototype.resetBackBuffer.call(this)},allTilesLoaded:function(a){this.layer.map.unlisten("animationend",this.allTilesLoaded,this);this._waitAnimTimer=null;a=a==1;if(this.layer._zoomAnimationReady()){var b=this.backBufferTile;this.layer.useCssTransitions&&
!a?this._waitAnimTimer=window.setTimeout(this.allTilesLoaded.bind(this,1),300):b.hide()}else this.layer.map.listen("animationend",this.allTilesLoaded,this)},shouldLoadBackBuffer:function(){return!!this.backBufferTile},clone:function(a,c){a==null&&(a=new b.Tile.SoftImage(this.layer,this.position,this.bounds,this.url,this.size,c));a=OpenLayers.Tile.prototype.clone.call(this,a);a.imgDiv=null;return a}});b.Tile.JamsTile=OpenLayers.Class(b.Tile.ImageCache,{shouldDisplayed:function(a){return a.isVisible()},
registerToShow:function(a){a.listen("displayed",this.showTile,this)},unregisterToShow:function(a){a.unlisten("displayed",this.showTile,this)},showTile:function(a){a&&a.target&&this.unregisterToShow(a.target);this.shouldDraw&&this.layer&&(a=this.layer.map.baseLayer.getTileAt(this.position),!a||this.shouldDisplayed(a)?this.show():this.registerToShow(a))}});b.Geometry={};b.Geometry.clipSegment=function(a,b){var c=a.x2-a.x1,d=a.y2-a.y1,f=!1;if(!c&&!d&&a.x1>=b.left&&a.x1<=b.right&&a.y1>=b.bottom&&a.y1<=
b.top)return!0;var j=0,l=1,m=function(a,b){var e=!0,c=null;a==0?b<0&&(e=!1):(c=b/a,a<0?c>l?e=!1:c>j&&(j=c):c<j?e=!1:c<l&&(l=c));return e};if(m(-c,a.x1-b.left)&&m(c,b.right-a.x1)&&m(-d,a.y1-b.bottom)&&m(d,b.top-a.y1)){if(l<1)a.x2=a.x1+l*c,a.y2=a.y1+l*d;j>0&&(a.x1+=j*c,a.y1+=j*d);f=!0}return f};b.Geometry.distanceBeetwenLineStrings=function(a,b){for(var c=Number.POSITIVE_INFINITY,d=function(c,d){return a.components[c==0?0:a.components.length-1].distanceTo(b.components[d==0?0:b.components.length-1])},
d=[d(0,0),d(0,1),d(1,0),d(1,1)],f,j=0;j<4;j++){var l=d[j];l<c&&(c=l,f=j)}return{distance:c,side1:f>1?1:0,side2:f%2?1:0}};b.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.MultiLineString,{clip:function(a){var b=new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(a.left,a.bottom),new OpenLayers.Geometry.Point(a.right,a.bottom),new OpenLayers.Geometry.Point(a.right,a.top),new OpenLayers.Geometry.Point(a.left,a.top)]);b.getVertices=OpenLayers.Geometry.LineString.prototype.getVertices;
for(var c=[],d=[],f=0,j=this.components.length;f<j;f++){var l=this.components[f],m=b.split(l);if(m&&m.length)for(var n=0,o=m.length;n<o;n++){var p=m[n];p.meta=l.meta;this.lineStringInBounds(p,a)?c.push(p):d.push(p)}else m=l.clone(),m.meta=l.meta,this.lineStringInBounds(m,a)?c.push(m):d.push(m)}return{"in":c,out:d}},lineStringInBounds:function(a,b){return b.containsLonLat(a.getBounds().getCenterLonLat())},softClip:function(a){for(var c=[],d=function(a,b){var e=new OpenLayers.Geometry.LineString(a);
e.meta=b.meta;return e},f=0,k=this.components.length;f<k;f++){for(var j=this.components[f],l=[],m,n=!1,o=null,p=0,t=j.components.length;p<t;p++){var s=j.components[p],q=a.contains(s.x,s.y,!0),r=q;!q&&n&&(c.push(d(l,j)),l=[],n=!1);p>0&&(!q&&m&&(n=q=!0),q&&!m&&l.push(o));m=r;o=s;q&&l.push(s)}l.length>1&&c.push(d(l,j))}return new b.Geometry.MultiLineString(c)},isEmpty:function(){return!this.components.length},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});b.Layer={};b.Layer.CanvasRenderer=OpenLayers.Class(OpenLayers.Renderer.Canvas,
{hitDetection:!1,initialize:function(a,b){this.canvas=a;this.map=b;this.features={}},getCtx:function(){return this.canvas},assignTo:function(a){this.root=a.root;this._savedClearRect=this.canvas.clearRect;this._savedRenderer=a;this.canvas.clearRect=OpenLayers.Function.False;return this},deassign:function(){this.canvas.clearRect=this._savedClearRect;return this._savedRenderer},setExtent:function(a){this.extent=a.clone();this.resolution=null}});b.Layer.Vector=OpenLayers.Class(OpenLayers.Layer.Vector,
Navitel.EventTarget,{initialize:function(){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments);a(this.events,this)},drawInCanvas:function(a,b){var c=this._getCanvasRenderer(a);c.setExtent(b);var d=this.map.getResolution();a.rect(0,0,Math.round((b.right-b.left)/d),Math.round((b.top-b.bottom)/d));a.clip();this.renderer=c.assignTo(this.renderer);for(var f=0,j=this.features.length;f<j;f++)c.locked=f!==j-1,d=this.features[f],this.drawFeature(d);this.renderer=c.deassign()},_getCanvasRenderer:function(a){if(this.__canvas_renderer&&
this.__canvas_renderer.getCtx()!=a)this.__canvas_renderer.destroy(),this.__canvas_renderer=null;if(!this.__canvas_renderer)this.__canvas_renderer=new b.Layer.CanvasRenderer(a,this.map);return this.__canvas_renderer}});b.Layer.Markers=OpenLayers.Class(OpenLayers.Layer.Markers,Navitel.EventTarget,{initialize:function(){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments);a(this.events,this)},afterAdd:function(){OpenLayers.Layer.Markers.prototype.afterAdd.call(this);this.map.listen("contextmenu",
this.onContextMenu,this);this.on({removed:this.onRemoved,visibilitychanged:this.onVisibilityChanged},this)},removeMap:function(){OpenLayers.Layer.Markers.prototype.removeMap.call(this);this.map.unlisten("contextmenu",this.onContextMenu,this);this.unlisten("visibilitychanged",this.onVisibilityChanged,this)},onRemoved:function(a){this._hidePopup(a.map);this.unlisten("removed",this.onRemoved,this)},onVisibilityChanged:function(){this._hidePopup(this.map)},_hidePopup:function(a){(a=a.click.popup)&&a.isVisible()&&
a.marker&&this.hasMarker(a.marker)&&a.hide()},hasMarker:function(a){return this.markers.some(function(b){return b==a})},onContextMenu:function(a){var b=this.getMarkerFromEvent(a);b&&a.setMarker(b);this.fire("contextmenu",a)},drawInCanvas:function(a,c){var d=this.map.getResolution();a.rect(0,0,Math.round((c.right-c.left)/d),Math.round((c.top-c.bottom)/d));a.clip();for(var f=0,k=this.markers.length;f<k;f++){var j=this.markers[f];if(j.lonlat){var l=new OpenLayers.Pixel(j.lonlat.lon/d+-c.left/d,c.top/
d-j.lonlat.lat/d),j=j.icon,m=j.offset;j.calculateOffset&&(m=j.calculateOffset(j.size));l=l.offset(m);l.x=Math.round(l.x);l.y=Math.round(l.y);m=j.getImageNode?j.getImageNode():j.imageDiv.firstChild;a.drawImage(m,l.x,l.y);if(j instanceof b.LabeledIcon&&(m=j.getLabel())){var n=j._textNode,o=OpenLayers.Element.getStyle,p=o(n,"font-family")||"Verdana",t=o(n,"font-size")||"12px",s=o(n,"margin-top")||"2px",n=o(n,"line-height")||"18px",s=parseInt(s),n=parseInt(n);a.font=t+" "+p;a.textAling="center";a.textBaseline=
"bottom";t=parseInt(t);p=a.measureText(m).width;a.fillText(m,l.x+Math.round((j.size.w-p)/2),Math.round(l.y+s+(n+t)/2+2))}}}},getMarkerFromEvent:function(a){for(var b=OpenLayers.Event.element(a),a=null;b;){if(Navitel.Dom.Classes.has(b,"NMaps-marker")){a=b;break}b=b.parentNode}if(a)for(var b=0,c=this.markers.length;b<c;b++)if(this.markers[b].icon.imageDiv==a)return this.markers[b]}});b.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.Grid,Navitel.EventTarget,{zoomOffset:0,maxTileScale:0,wrapDateLine:!0,
useCssTransitions:null,useLangCode:!0,buffer:2,initialize:function(e,c,d,f){OpenLayers.Layer.Grid.prototype.initialize.call(this,e,c,d,f);a(this.events,this);if(this.transitionEffect&b.Layer.TransitionEffects.CSS_TRANSITION&&Navitel.UserAgent.CSS_TRANSITIONS)this.useCssTransitions=!0;if(e=this.maxTileScale)this._maxTileRatio=Math.pow(2,e),this._minTileRatio=Math.pow(2,-e);b.Layer.fixUseBlankTile()},afterAdd:function(){var a=["NMaps-layer"];this.useCssTransitions&&(this.transitionEffect&b.Layer.TransitionEffects.FADE&&
a.push("NMaps-layer-anim-fade"),this.transitionEffect&255&b.Layer.TransitionEffects.FADE_IN&&a.push("NMaps-layer-anim-fade-in"),this.transitionEffect&255&b.Layer.TransitionEffects.FADE_OUT&&a.push("NMaps-layer-anim-fade-out"));this.div.className+=" "+a.join(" ")},addTile:function(a,c){var d=this.getURL(a);return new b.Tile.ImageCache(this,c,a,d,this.tileSize)},_zoomAnimationReady:function(){var a=this.map;if(this.transitionEffect&b.Layer.TransitionEffects.ANIMATED){if(a.zoomAnimation)return!1;if(a._lastZoomId&&
a._lastZoomId<a.viewRequestID)return!1}return!0},getURL:function(a){var c=this.map.getResolution(),d=Math.round((a.left-this.maxExtent.left)/(c*this.tileSize.w)),a=Math.round((a.bottom-this.maxExtent.bottom)/(c*this.tileSize.h)),c=this.map.getZoom()+this.zoomOffset,f=Math.pow(2,c);this.wrapDateLine&&(d=(d%f+f)%f,a=(a%f+f)%f);f=this.url;f instanceof Array&&(f=this.selectUrl(""+d+a+c,f));var k=Navitel.Text.padNumber,f=f+k(d,8)+","+k(a,8)+","+k(c,2);f+=this.getExtraUrlStr();this.useLangCode&&(f=OpenLayers.Util.urlAppend(f,
"hl="+b.i18n.getLang()));return f},getExtraUrlStr:function(){return""},getTileAt:function(a){var b=this.grid[0][0],c=Math.floor((a.y-b.position.y)/this.tileSize.h),a=Math.floor((a.x-b.position.x)/this.tileSize.w);if(this.grid[c])return this.grid[c][a]},extentToGridBounds:function(a,b){b==null&&(b=this.getResolution());var c=this.map.getLayerPxFromLonLat({lon:a.left,lat:a.top}),d=parseInt(this.grid[0][0].frame.style.left),f=parseInt(this.grid[0][0].frame.style.top),d=c.x-d,c=c.y-f;return new OpenLayers.Bounds(d,
c+Math.round((a.top-a.bottom)/b),d+Math.round((a.right-a.left)/b),c)},_renderInCanvas:function(a,b){for(var c=Math.floor(b.left/this.tileSize.w),d=Math.floor(b.top/this.tileSize.h),f=Math.floor(b.right/this.tileSize.w),j=Math.floor(b.bottom/this.tileSize.h),l=0,m=b.top%this.tileSize.h,n=b.left%this.tileSize.w,o=b.bottom-b.top,p=b.right-b.left,t=d;t<=j;t++)if(this.grid[t]){var s=t==d?m:0,q=this.tileSize.h-s;l+q>o&&(q=o-l);var r=0;for(ix=c;ix<=f;ix++){var u=this.grid[t][ix];if(u&&!u.isLoading){var v=
ix==c?n:0,w=this.tileSize.w-v;r+w>p&&(w=p-r);a.drawImage(u.imgDiv,v,s,w,q,r,l,w,q);r+=w}}l+=q}},display:function(a){this._allowDisplay&&OpenLayers.Layer.Grid.prototype.display.call(this,a)},setDisplayed:function(a){this.map.fire("changelayer",{layer:this,property:"displayed",displayed:a});this._allowDisplay=a},isAllowDisplay:function(){return this._allowDisplay},drawInCanvas:function(a,b){var c=this.extentToGridBounds(b);this._renderInCanvas(a,c)}});b.Layer.TransitionEffects={NONE:0,RESIZE:1,ANIM_RESIZE:513,
FADE_OUT:1538,FADE_IN:1540,FADE:1542,CSS_TRANSITION:1024,ANIMATED:512};b.Layer.Grid.prototype.transitionEffect=b.Layer.TransitionEffects.RESIZE;b.Layer.Grid.prototype.HARD_TRANSITIONS=b.Layer.TransitionEffects.RESIZE|b.Layer.TransitionEffects.ANIM_RESIZE;b.Layer.fixUseBlankTile=function(){if(!this.useBlankTileFixed){this.useBlankTileFixed=!0;var a=OpenLayers.Util.getImagesLocation()+"blank.gif",b=new Image,c=0,d=function(){OpenLayers.Tile.Image.useBlankTile=c<2};b.onload=function(){c+=1;c==1&&window.setTimeout(function(){b.src=
a;window.setTimeout(d,900)},50)};b.src=a}};b.Layer.Jams=OpenLayers.Class(b.Layer.Grid,{urlId:"J",transitionEffect:b.Layer.TransitionEffects.FADE_IN,reloadInterval:9E5,reloadTimer:null,urlSaltParam:null,isBaseLayer:!1,minZoomLevel:6,initialize:function(a,c,d){b.Layer.Grid.prototype.initialize.apply(this,[a,c,d]);this.reloadTimer=setInterval(this.reloadRun.bind(this),this.reloadInterval)},setMap:function(a){b.Layer.Grid.prototype.setMap.call(this,a);this._wasDisplayed=!1;this.map.listen("zoomend",this.onZoomEnd,
this)},onZoomEnd:function(){if(this.map.getZoom()>=this.minZoomLevel)this.isAllowDisplay()||(this.setDisplayed(!0),this._wasDisplayed&&this.setVisibility(!0));else if(this.isAllowDisplay())this._wasDisplayed=this.getVisibility(),this.setVisibility(!1),this.setDisplayed(!1)},destroy:function(){window.clearInterval(this.reloadTimer);b.Layer.Grid.prototype.destroy.apply(this,arguments)},reloadRun:function(){this.urlSaltParam=this.getSaltParam();this.redraw(!0)},getSaltParam:function(){return(Math.random()+
"").substr(2)},getExtraUrlStr:function(){if(this.urlSaltParam==null)this.urlSaltParam=this.getSaltParam();return","+this.urlSaltParam},addTile:function(a,c){var d=this.getURL(a);return new b.Tile.JamsTile(this,c,a,d,this.tileSize)}});b.Layer.Tile=OpenLayers.Class(b.Layer.Grid,{isBaseLayer:!0,transitionEffect:b.Layer.TransitionEffects.ANIM_RESIZE|b.Layer.TransitionEffects.FADE_IN,maxTileScale:4,displayInLayerSwitcher:!1,addTile:function(a,c){var d=this.getURL(a);return new b.Tile.SoftImage(this,c,
a,d,this.tileSize)}});b.Kinetic=Navitel.Class({threshold:0,maxSpeed:0,duration:500,_distDuration:55,nbPoints:100,delay:200,points:void 0,initialize:function(a){Navitel.extend(this,a)},begin:function(){this._isDragging=!0;this.points=[]},update:function(a){this.points.unshift({xy:a,tick:(new Date).getTime()});this.points.length>this.nbPoints&&this.points.pop()},end:function(a){this._isDragging=!1;for(var b,c=Navitel.now(),d=0,f=this.points.length,j;d<f;d++){j=this.points[d];if(c-j.tick>this.delay)break;
b=j}if(b&&(d=Navitel.now()-b.tick,c=Math.sqrt(Math.pow(a.x-b.xy.x,2)+Math.pow(a.y-b.xy.y,2)),d=c/d,!(d==0||d<this.threshold)))return c=Math.asin((a.y-b.xy.y)/c),b.xy.x<=a.x&&(c=Math.PI-c),this.maxSpeed&&(d=Math.min(d,this.maxSpeed)),{speed:d,theta:c}},move:function(a,b){var c=a.speed,d=Math.cos(a.theta),f=-Math.sin(a.theta),j=Navitel.now(),l=0,m=0,n=c*this._distDuration,o=function(){if(!this._isDragging){var a=(Navitel.now()-j)/this.duration;a>1&&(a=1);var e=Navitel.Fx.Easing.easeOut(a)*n,c=e*d;e*=
f;a={end:a==1};a.x=c-l;a.y=e-m;l=c;m=e;b(a.x,a.y,a.end);a.end||Navitel.Fx.requestAnimFrame(o)}}.bind(this);Navitel.Fx.requestAnimFrame(o)}});OpenLayers.Kinetic=b.Kinetic;b.Control=OpenLayers.Class(OpenLayers.Control,Navitel.EventTarget,{initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments);a(this.events,this)}});b.ContextMenuEvent=Navitel.Class({_dontExtend:!0,popup:null,lonlat:null,_template:null,showPoint:!0,_extraContent:null,_init:function(a,b){this.popup=a;this.lonlat=
b;this._extraContent=[];this._popupContext={}},addContent:function(a,b){this._extraContent.push([a,b])},_getExtraContent:function(){return this._extraContent.map(function(a){if(!this.marker||!a[1])return a[0];return""},this).join(" ")},_populate:function(a){for(var b in a)b!="constructor"&&!this[b]&&(this[b]=a[b])},updateContext:function(a){Navitel.extend(this._popupContext,a)},setMarker:function(a){this.showPoint=!1;this.lonlat=a.lonlat;var b=a.icon.size,c=null,d=null,f=a.icon.style;if(f)typeof f.popupOffset==
"number"?c=f.popupOffset:(d=f.popupOffset[0],c=f.popupOffset[1]);c==null&&(c=Math.round(b.h/Math.PI));d==null&&(d=Math.round(b.w/2-5));this.popup.translation.y+=Math.round(-b.h+c);this.popup.offset.x+=d;this.marker=a},setTemplate:function(a){this._template=a}});b.Control.Click=OpenLayers.Class(b.Control,{defaultHandlerOptions:{single:!0,"double":!0,pixelTolerance:null},handleRightClicks:!0,popup:null,lastLonLat:null,initialize:function(a,c){this.map=a;this.handlerOptions=Navitel.extend({},this.defaultHandlerOptions);
OpenLayers.Control.prototype.initialize.call(this,c);var d={click:this.onClick};if(this.handleRightClicks){if(Navitel.UserAgent.OPERA)document.oncontextmenu=function(a){Navitel.Events.cancel(a);return!1};Navitel.Events.listen(a.viewPortDiv,"contextmenu",function(a){this.map.events.clearMouseCache();a.xy=this.map.events.getMousePosition(a);this.showPopup.apply(this,[a]);Navitel.Events.cancel(a);return!1},this)}this.handler=new OpenLayers.Handler.Click(this,d,this.handlerOptions);this.createOverlay(a);
this.popupTemplate=b.Template.make("popup");this.markersTemplate=b.Template.make("marker-popup");a.addControl(this);this.activate()},onClick:function(a){this.hidePopups();this.map.fire("leftclick",a);this.lastLonLat=null},showPopup:function(a){var c=this.map.getLonLatFromViewPortPx(a.xy);if(!this.popup)this.popup=this.createPopup();var d=this.popup;d.resetOffset();d.enableZoomers(!0);d.translation.set(0,0);var f=this.popupTemplate,k=new b.ContextMenuEvent;k._init(d,c);k._populate(a);this.map.fire("contextmenu",
k);a=k._popupContext;if(k._template)f=k._template;c=k.lonlat.clone().unproject();if(k.marker){var j=k.marker;d.marker=j;j.popup=d;if(j.popupTemplate)f=j.popupTemplate;else if(j.name||j.description)f=this.markersTemplate;Navitel.extend(a,{name:j.name||"",description:j.description||""});j.popupContext&&Navitel.extend(a,j.popupContext)}else if(j=this.popup.marker)j.popup=null,d.marker=null;Navitel.extend(a,{extra_content:k._getExtraContent(),ll:{lat:b.Util.getDisplayCoordinate(c.lat,"lat"),lon:b.Util.getDisplayCoordinate(c.lon,
"lon"),decimal:this.isCoordsDecimal()}});f=f(a);this.lastLonLat=k.lonlat;this.showPoint=k.showPoint;d.lonlat=k.lonlat;d.setContent(f);d.updatePosition();d.show();d.panIntoView();this.showPoint||this.updatePinVisibility();this.attachToPopup(d)},isCoordsDecimal:function(){return Navitel.Cookie.get("geo_coords")=="d"},setCoordsDecimal:function(a){Navitel.Cookie.set("geo_coords",a?"d":"g");Navitel.Dom.q(".NMaps-geo-coords",this.popup.getContentNode()).toggleClass("NMaps-geo-coords-fd",a)},updatePinVisibility:function(){!this.popup.isVisible()||
!this.showPoint?this.overlay.removeFeatures([this.pin]):this.showPoint&&this.showPin(this.popup.lonlat)},showPin:function(a){var b=this.pin,c=b.geometry,d=this._hasPin();if(c.x!=a.lon||c.y!=a.lat||!d)c.x=a.lon,c.y=a.lat,c.clearBounds(),d?this.overlay.drawFeature(b):this.overlay.addFeatures([b])},_hasPin:function(){return this.overlay.features.filter(function(a){return a==this.pin},this).length>0},createOverlay:function(a){this.overlay=new b.Layer.Vector("c");this.pin=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(0,
0),null,b.Styles["click-pin"]);a.addLayer(this.overlay);this.overlay.setZIndex(a.Z_INDEX_BASE.Feature-1)},createPopup:function(){var a=new b.Popup(b.Styles.popup);a.hide();a.listen("visibility",this.updatePinVisibility,this);this.map.addPopup(a);var c=Navitel.Dom.q(".NMaps-popup-zoom-in",a._layoutNode)[0];Navitel.Events.listen(c,"click",this.zoomIn,this);c=Navitel.Dom.q(".NMaps-popup-zoom-out",a._layoutNode)[0];Navitel.Events.listen(c,"click",this.zoomOut,this);return a},zoomIn:function(){this.map.zoomTo(this.map.getZoom()+
1,this.lastLonLat)},zoomOut:function(){this.map.zoomTo(this.map.getZoom()-1,this.lastLonLat)},_swapCoordsType:function(){this.setCoordsDecimal(!this.isCoordsDecimal())},attachToPopup:function(a){Navitel.Dom.q(".NMaps-geo-coords-s .navi-button",this.popup.getContentNode()).click(this._swapCoordsType,this);this.map.fire("attachpopup",{popup:a})},hidePopups:function(){for(var a=0;a<this.map.popups.length;a++)this.map.popups[a].hide()}});b.Control.KeyboardDefaults=OpenLayers.Class(OpenLayers.Control.KeyboardDefaults,
{draw:function(){this.handler=new b.Handler.Keyboard(this,{keydown:this.defaultKeyPress})}});b.Control.NavitelLogoLink=OpenLayers.Class(b.Control,{initialize:function(a,c,d){b.Control.prototype.initialize.apply(this,[d]);this.element=Navitel.Dom.getElement(a);this.url=c||window.loc.href},destroy:function(){this.element.parentNode==this.div&&this.div.removeChild(this.element);this.element=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,
arguments);if(!this.element)this.div.className=this.displayClass,this.element=document.createElement("a"),this.element.target="_blank",this.element.href=this.url,this.div.appendChild(this.element);return this.div},CLASS_NAME:"Navitel.Control.NavitelLogoLink"});b.Control.Permalink=OpenLayers.Class(OpenLayers.Control.Permalink,Navitel.EventTarget,{id:"permalink",base:"",initialize:function(){OpenLayers.Control.Permalink.prototype.initialize.apply(this,arguments);a(this.events,this)},setMap:function(a){OpenLayers.Control.prototype.setMap.call(this,
a);this.map.listen("permalink-update",this.updateLink,this)},draw:function(){var a=OpenLayers.Control.Permalink.prototype.draw.call(this);Navitel.Events.listen(a,["mousedown","contextmenu"],Navitel.Events.stop);return a},createParams:function(a,b,c){a=a||this.map.getCenter();a=OpenLayers.Control.Permalink.prototype.createParams.apply(this,[a,b,c]);delete a.layers;delete a.fl;for(var c=c||this.map.layers,b="",d=0,f=c.length;d<f;d++){var j=c[d];j.urlId&&(j.getVisibility()||(b+=j.urlId.charAt(0)))}if(b)a.fl=
b;this.map.fire("permalink-params",{params:a,permalink:this});return a},updateLink:function(){OpenLayers.Control.Permalink.prototype.updateLink.call(this);this.map.fire("permalink-updated",{permalink:this})},getHref:function(){return this.element.href},CLASS_NAME:"Navitel.Control.Permalink"});b.Control.NavitelScaleLine=OpenLayers.Class(OpenLayers.Control.ScaleLine,Navitel.EventTarget,{initialize:function(){OpenLayers.Control.ScaleLine.prototype.initialize.apply(this,arguments);a(this.events,this)},
update:function(){var a=this.map.getResolution();if(a){var b=this.map.getCenter().transform(this.map.projection,this.map.displayProjection).lat*Math.PI/180;a*=Math.cos(b);var b=this.map.getUnits(),c=OpenLayers.INCHES_PER_UNIT,d=this.maxWidth*a*c[b],f,j;d>1E5?(f=this.topOutUnits,j=this.bottomOutUnits):(f=this.topInUnits,j=this.bottomInUnits);var l=d/c[f];d/=c[j];var m=this.getBarLen(l),n=this.getBarLen(d),l=m/c[b]*c[f],d=n/c[b]*c[j];if(this.eBottom.style.visibility=="visible")this.eBottom.style.width=
Math.round(d/a)+"px",this.eBottom.innerHTML=n+" "+j;if(this.eTop.style.visibility=="visible")this.eTop.style.width=Math.round(l/a)+"px",this.eTop.innerHTML=m+" "+f}},CLASS_NAME:"Navitel.Control.NavitelScaleLine"});b.Control.Navigation=OpenLayers.Class(OpenLayers.Control.Navigation,Navitel.EventTarget,{id:"navigation",documentDrag:!0,initialize:function(){OpenLayers.Control.Navigation.prototype.initialize.apply(this,arguments);a(this.events,this)},wheelUp:function(){this.map&&this.map.maxZoomLevel>
this.map.zoom&&OpenLayers.Control.Navigation.prototype.wheelUp.apply(this,arguments)},wheelDown:function(){this.map&&this.map.minZoomLevel<this.map.zoom&&OpenLayers.Control.Navigation.prototype.wheelDown.apply(this,arguments)},CLASS_NAME:"NMaps.Control.Navigation"});b.Control.CanvasRenderer=OpenLayers.Class(b.Control,{active:!0,drawTimer:null,drawTimeout:300,canvas:null,initialize:function(a,b){OpenLayers.Control.prototype.initialize.call(this,b);this.canvas=Navitel.Dom.getElement(a);this.layerListeners=
{loadend:this.update,moveend:this.update,scope:this};this.drawMapBinded=this.drawMap.bind(this)},draw:function(){return null},setMap:function(a){OpenLayers.Control.prototype.setMap.call(this,a);this.map.on({resize:this.updateSize},this);for(var a=0,b=this.map.layers.length;a<b;a++)this.map.layers[a].events.on(this.layerListeners);this.updateSize(!1)},update:function(a){if(this.active){var b=!1;a.type=="loadend"?b=!0:a.type=="moveend"&&(b=!a.zoomChanged);if(b)this.drawTimer&&window.clearTimeout(this.drawTimer),
this.drawTimer=window.setTimeout(this.drawMapBinded,this.drawTimeout)}},updateSize:function(a){if(this.active){a==null&&(a=!0);var b=this.map.getSize(),c=this.canvas;c.setAttribute("width",b.w);c.setAttribute("height",b.h);c.style.width=b.w+"px";c.style.height=b.h+"px";a&&this.drawMap()}},drawMap:function(){this.drawTimer=null;var a=this.canvas.getContext("2d");a.clearRect(0,0,this.canvas.width,this.canvas.height);this.map.drawInCanvas(a)}});b.Marker=OpenLayers.Class(OpenLayers.Marker,Navitel.EventTarget,
{initialize:function(){b.Marker._superClass.initialize.apply(this,arguments);a(this.events,this)},destroy:function(){Navitel.EventTarget.destroy.call(this);b.Marker._superClass.destroy.call(this)}});b.Marker.make=function(a,c,d,f){if(d==null)d=b.Marker;c=b.Icon.make(c,f);return new d(a,c)};OpenLayers.Marker.defaultIcon=function(){return b.Icon.make("default-marker")};b.ComponentFactory=OpenLayers.Class({components:null,initialize:function(a,b){this.map=a;Navitel.extend(this,b);this.registerStdComponents()},
registerStdComponents:function(){var a=this.map,c=function(c){return new (c=="print"?b.ToolBar.PrintButton:b.ToolBar.OpenPrintButton)("print",a)};this.components={jams:function(){if(a.withJams)return new b.ToolBar.LayerButton("jams",a.layerJams,b._("Show jams layer"),b._("Hide jams layer"));return null},zoombar:function(){var c=new b.Control.ZoomBar(a);c.render=c.draw;return c},home:function(){return new b.ToolBar.Button("home",{tooltip:b._("Home"),onclick:function(){var b=(new OpenLayers.LonLat(a.home[0],
a.home[1])).transform(a.displayProjection,a.projection);a.setCenter(b,a.home[2])},map:a})},print:function(){return c("print")},openprint:function(){return c("openprint")},zoomin:function(){return new b.ToolBar.Button("zoomIn",{tooltip:b._("Zoom in"),onclick:function(){a.setCenter(a.center,a.getZoom()+1)},map:a})},zoomout:function(){return new b.ToolBar.Button("zoomOut",{tooltip:b._("Zoom out"),onclick:function(){a.setCenter(a.center,a.getZoom()-1)},map:a})},panmover:function(){var c=new b.Control.PanMoveMaps({map:a});
c.render=c.draw;return c}};var d=a.getControlsByClass("NMaps.Control.Navigation")[0];d&&d.dragPan&&this.registerControlButton("hand",d.dragPan,b._("Unlock map dragging"),b._("Lock map dragging"))},register:function(a,b,c){if(this.components==null)this.components={};this.components[a]=[b,c]},registerLayerButton:function(a,c,d,f){this.register(a,function(){return new b.ToolBar.LayerButton(a,this,d,f)},c)},registerControlButton:function(a,c,d,f){this.register(a,function(){return new b.ToolBar.ControlButton(a,
this,d,f)},c)},create:function(a){if(!this.components[a])return null;a=this.components[a];return typeof a=="function"?a():a[0].call(a[1])}});b.ComponentFactory.instances={};b.ComponentFactory.getInstance=function(a){this.instances[a.id]||(this.instances[a.id]=new b.ComponentFactory(a));return this.instances[a.id]};b.Styles["default-marker"]={imagePath:"marker-green.png",width:22,height:25,offsetLeft:7,offsetTop:25};b.Styles["click-pin"]={fillColor:"#9809cd",pointRadius:6,cursor:"pointer",hoverFillOpacity:1,
strokeOpacity:0.7,strokeColor:"#FFFFFF",strokeWidth:2};b.Styles.popup={withZoomers:!0};b.Styles.route={strokeWidth:6,strokeColor:"#0000ff",strokeOpacity:0.45};b.Styles["route-markers"]={imagePath:"route-start.png",width:28,height:44,offsetLeft:14,offsetTop:44,popupOffset:14};b.Styles["route-markers-start"]=b.Styles["route-markers"];b.Styles["route-markers-middle"]=b.Styles.$E("route-markers",{imagePath:"route-middle.png",width:24,height:36,offsetLeft:12,offsetTop:36,popupOffset:12});b.Styles["route-markers-end"]=
b.Styles.$E("route-markers",{imagePath:"route-end.png"});b.Styles["route-segments"]={strokeWidth:6,strokeColor:"#3498d7",strokeOpacity:0.45};b.Styles["route-arrows"]={strokeWidth:1,fillColor:"#ffffff",fillOpacity:1,strokeColor:"#ffffff",strokeOpacity:1};b.Styles["route-arrows-geom"]={tailWidth:9,arrowWidth:5,arrowHeight:2};b.Styles["route-hover-pin"]=b.Styles.$E("click-pin",{});b.Handler.Closest=OpenLayers.Class(b.Handler,{layer:null,lastLonLat:null,isOver:!1,pixelTolerance:7,excludeFeatures:[],state:0,
STATE_IN:1,STATE_OUT:2,initialize:function(a,c,d,f){b.Handler.prototype.initialize.call(this,c,d,f);this.layer=a},over:function(){},out:function(){},move:function(){},deactivate:function(){if(!this.active)b.Handler.prototype.deactivate.call(this),this.isOver=!1},mousemove:function(a){var b=this.findClosestPosition(this.layer.getLonLatFromViewPortPx(a.xy));if(b&&b.pxDistance<=this.pixelTolerance){this.isOver=!0;var c=new OpenLayers.LonLat(b.point[0],b.point[1]);this.lastLonLat=c;var d=this.state&this.STATE_IN?
"move":"over",a={lonlat:c,position:b,event:a};this[d].call(this,a);this.fire(d,a);this.state=this.STATE_IN}else if(this.state!=this.STATE_OUT)this.isOver=!1,this.fire("out",a),this.out(a),this.state=this.STATE_OUT},featurePasses:function(a){for(var b=0,c=this.excludeFeatures.length;b<c;b++)if(this.excludeFeatures[b]==a)return!1;return!0},findClosestPosition:function(a,b){var c=a instanceof OpenLayers.Geometry.Point?a:new OpenLayers.Geometry.Point(a.lon,a.lat),d=Number.POSITIVE_INFINITY,f,j=null;if(b)j=
b,f=c.distanceTo(j.geometry,{details:!0});else for(var l=0,m=this.layer.features.length;l<m;l++){var n=this.layer.features[l];if(n&&n.geometry&&this.featurePasses(n)&&(!n.geometry.components||n.geometry.components.length)){var o=c.distanceTo(n.geometry,{details:!0});if(o&&o.distance<d)d=o.distance,j=n,f=o}}if(j)return c=this.layer.map.getPixelFromLonLat({lon:f.x0,lat:f.y0}),l=this.layer.map.getPixelFromLonLat({lon:f.x1,lat:f.y1}),{pxDistance:Math.sqrt(Math.pow(l.x-c.x,2)+Math.pow(l.y-c.y,2)),distance:d,
point:[f.x1,f.y1],feature:j};return null}});b.Routes={};b.Routes.ClosestHandler=OpenLayers.Class(b.Handler.Closest,{initialize:function(){b.Handler.Closest.prototype.initialize.apply(this,arguments);this.createComponents();this.layer.listen("draw",this._onLayerDraw,this)},destroy:function(){this.destroyComponents()},createComponents:function(){this.hoverPin=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(0,0),null,b.Styles["route-hover-pin"]);this.hoverPin.style.display="none";this.layer.addFeatures([this.hoverPin])},
showPin:function(a){this.hoverPin.style.display=a?"":"none";this.layer.redraw()},_onLayerDraw:function(){this.layer.eraseFeatures([this.hoverPin]);this.layer.drawFeature(this.hoverPin)},destroyComponents:function(){this.hoverPin.destroy();this.hoverPin=null},over:function(a){this.showPin(!0);this.hoverPin.move(a.lonlat)},out:function(){this.showPin(!1)},move:function(a){this.hoverPin.move(a.lonlat)},activate:function(){if(!this.active)return b.Handler.Closest.prototype.activate.call(this);return!1},
deactivate:function(){if(this.active)return this.showPin(!1),b.Handler.Closest.prototype.deactivate.call(this);return!1}});b.Routes.Marker=OpenLayers.Class(OpenLayers.Marker,{initialize:function(){OpenLayers.Marker.prototype.initialize.apply(this,arguments);Navitel.Dom.Classes.add(this.icon.imageDiv,"NMaps-route-marker")},afterAdd:function(){this.setLonLat(this.lonlat)},fixLonLat:function(a){if(a)return this.map._getLonLatFromOffset(this.map._getOffsetFromLonLat(a));return a},moveTo:function(a){a!=
null&&this.icon!=null&&this.icon.moveTo(a);this.setLonLat(this.map.getLonLatFromLayerPx(a))},setLonLat:function(a){this.lonlat=this.fixLonLat(a)},getDisplayPosition:function(){var a=this.lonlat.clone().transform(this.map.projection,this.map.displayProjection);return[a.lon.toFixed(5),a.lat.toFixed(5)].join(", ")}});b.Routes.Marker.ll_template=b.Template.compile("${x[0]}\u00b0 ${x[1]}\u2032 ${x[2]}\u2033");b.Routes.Markers=OpenLayers.Class(b.Layer.Markers,{initialize:function(){b.Layer.Markers.prototype.initialize.apply(this,
arguments)},addMarker:function(a,b){OpenLayers.Layer.Markers.prototype.addMarker.call(this,a);typeof b=="number"&&(this.markers.pop(),this.markers.splice(b,0,a));this.setLabels();this.fire("addmarker",{marker:a});a.afterAdd()},moveMarker:function(a,b){if(a!=b){typeof a!="number"&&(a=this.indexOf(a));var c=this.markers.splice(a,1)[0];this.markers.splice(b,0,c);this.setLabels()}},setLabels:function(){for(var a=0,b=this.markers.length;a<b;a++){var c=this.markers[a],d="";a>0&&a<b-1&&(d=a);c.icon.setLabel(d)}},
indexOf:function(a){return OpenLayers.Util.indexOf(this.markers,a)},removeMarker:function(a){var b=this.markers.length,c=this.indexOf(a);if(b>2)if(c==0)b=this.markers[1],b.icon.setStyle("route-markers-start"),b.pointType="start";else if(c==b-1)b=this.markers[b-2],b.icon.setStyle("route-markers-end"),b.pointType="end";OpenLayers.Layer.Markers.prototype.removeMarker.call(this,a);this.setLabels();this.fire("removemarker",{marker:a})}});b.Routes.Format={};b.Routes.Format.parseRoutePoints=function(a){for(var c=
[],d=0;d<a.length;d++){for(var f=[],k=1;k<a[d].length;k++)f.push(new OpenLayers.Geometry.Point(a[d][k].lon,a[d][k].lat));f=new OpenLayers.Geometry.LineString(f);f.meta=a[d][0];c.push(f)}return new b.Geometry.MultiLineString(c)};b.Routes.CacheMiddleware=OpenLayers.Class({drawRequest:null,cache:{},cachedStateKey:null,gcTimers:[],refreshTimer:null,refreshTimerInterval:3E3,destroy:function(){this.cache=null;Navitel.EventTarget.destroy.call(this)},transformTileBounds:function(a,b){var c=this.layer.map.getMaxExtent(),
d=this.layer.map.getTileSize(),f=this.layer.map.getResolutionForZoom(b),j=f*d.w,d=f*d.h,f=c.left+a.left*j,c=c.bottom+a.bottom*d;return new OpenLayers.Bounds(f,c,f+(a.right-a.left+1)*j,c+(a.top-a.bottom+1)*d)},drawRoute:function(a,b,c,d,f){this.drawRequest&&this.layer.protocol.abort(this.drawRequest);var j=[a,f.routeType,f.routeVehicleType].join("_");if(this.cachedStateKey!=j)this.clearCache(),this.cachedStateKey=j;var l=this.getCacheCellForZoom(c),j=this.getUncachedViewport(l,b),m=function(f){f&&
this.handleDrawResponse(f);f=this.transformTileBounds(b,c);f=this.getGeometryForBounds(l,f);Navitel.extend(f,{viewport:b,rId:a,zoom:c});d(f)};j?(j={rId:a,viewport:j,zoom:c,callback:m,scope:this},Navitel.extend(j,f),this.drawRequest=this.layer.protocol.drawRoute(j)):m.call(this)},clearCache:function(){for(this.cache={};this.gcTimers.length;){var a=this.gcTimers.shift();window.clearTimeout(a)}},getGeometryForBounds:function(a,b){return{route:a.route.softClip(b),adds:a.adds.softClip(b)}},getUncachedViewport:function(a,
b){for(var c=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,f=Number.POSITIVE_INFINITY,j=Number.NEGATIVE_INFINITY,l=b.left;l<=b.right;l++)for(var m=b.bottom;m<=b.top;m++){var n=this.getMaskKey(l,m);a.mask[n]||(l<c&&(c=l),m<f&&(f=m),l>d&&(d=l),m>j&&(j=m))}if(isFinite(c)&&isFinite(f))return new OpenLayers.Bounds(c,f,d,j);return null},getCacheCellForZoom:function(a){this.cache[a]||(this.cache[a]={route:new b.Geometry.MultiLineString,adds:new b.Geometry.MultiLineString,mask:{}});return this.cache[a]},
getMaskKey:function(a,b){return a+"_"+b},handleDrawResponse:function(a){var c=this.drawRequest.getResponseHeader("Cache-Control");this.drawRequest=null;var d=1E3;if(c)for(var c=c.split(/,\s/),f=0,k=c.length;f<k;f++){var j=c[f];j.toLowerCase().match("max-age")&&(d=parseInt(j.split("=")[1]))}var c=a.viewport,l=a.zoom,f=b.Routes.Format.parseRoutePoints(a.points),k=b.Routes.Format.parseRoutePoints(a.segments),m=this.transformTileBounds(c,l),a=this.getCacheCellForZoom(l),j=function(a,b){b.components=b.clip(m)["in"];
if(a.isEmpty()&&b.components.length)a.components=b.components;else{var c=a.clip(m).out;a.components=c;var c=a.components,d=[a.components.length,0].concat(b.components);c.splice.apply(c,d)}a.clearBounds()};j(a.route,f);j(a.adds,k);f=(new Date).getTime()/1E3;for(k=c.left;k<=c.right;k++)for(j=c.bottom;j<=c.top;j++){var n=this.getMaskKey(k,j);a.mask[n]=f+d}var o=this,c=function(){o.gc(l,this.timerId)},d=window.setTimeout(c.bind(c),d*1E3);c.timerId=d;this.gcTimers.push(d)},gc:function(a,b){OpenLayers.Util.removeItem(this.gcTimers,
b);window.clearTimeout(b);this.refreshTimer&&window.clearTimeout(this.refreshTimer);var c=this.getCacheCellForZoom(a),d=Math.ceil((new Date).getTime()/1E3),f;for(f in c.mask){var j=c.mask[f];j&&d>=j-1&&(c.mask[f]=null)}this.refreshTimer=window.setTimeout(this.checkForRefresh.bind(this),this.refreshTimerInterval)},checkForRefresh:function(){this.refreshTimer=null;var a=this.layer.map.getZoom(),b=this.bboxStrategy.getMapFetchBounds();this.getUncachedViewport(this.getCacheCellForZoom(a),b)&&this.layer.refresh({force:!0})}});
b.Routes.Strategy=OpenLayers.Class(OpenLayers.Strategy.BBOX,{initialize:function(){OpenLayers.Strategy.BBOX.prototype.initialize.apply(this,arguments);this.cacheMiddleware=new b.Routes.CacheMiddleware({bboxStrategy:this});this._mergeBound=this.merge.bind(this)},destroy:function(){OpenLayers.Strategy.BBOX.prototype.destroy.apply(this);this.cacheMiddleware.destroy();this.cacheMiddleware=null},setLayer:function(a){this.layer=a;this.cacheMiddleware.layer=a},getMapBounds:function(){return this.layer.map.getExtentInTiles()},
getMapFetchBounds:function(a){a||(a=this.getMapBounds());return a},calculateBounds:function(a){this.bounds=this.getMapFetchBounds(a)},triggerRead:function(){var a=this.layer.getRouteId();if(a){var b=this.layer.map.getZoom(),c=this.getInsensitivityRadiusForZoom(b);this.layer.fire("loadstart");this.cacheMiddleware.drawRoute(a,this.bounds,b,this._mergeBound,{insensitivityRadius:c,routeType:this.layer.routeType,routeVehicleType:this.layer.routeVehicleType})}},getInsensitivityRadiusForZoom:function(){return 2},
merge:function(a){this.layer.getRouteId()&&(this.layer.drawRouteGeoms(a.route,a.adds),this.layer.fire("loadend"))}});b.Routes.Protocol=function(a,b){Navitel.extend(this,b);this.url=a;this.sync=0};Navitel.inherits(b.Routes.Protocol,Navitel.EventTarget);Navitel.extendClass(b.Routes.Protocol,{destroy:function(){Navitel.EventTarget.destroy.call(this)},url:null,version:"2",sendRequest:function(a,c,d){a.pv=this.version;return b.loadURL(this.url,a,this,function(a){a.err?this.handleError(a,d):c.call(this,
a)},function(a,b){b.status==500?this.handleError({err:17,method:"draw"},d):this.map.handleError(b)})},handleError:function(a,c){var d=a.err,f=b._("The route server returned a reply with an unknown error");switch(d){case 1:f=b._("Routes: incorrect syntax");break;case 2:f=b._("Routes: incorrect protocol version");break;case 11:f=b._("Too few points in the route");break;case 12:f=b._("Too many points in the route");break;case 13:f=b._("Incorrect number of points when you add/move/delete");break;case 14:f=
b._("Incorrect ID route");break;case 15:f=b._("Incorrect coordinates of a point");break;case 16:f=b._("Incorrect radius of insensitivity");break;case 17:f=b._("Unable to build route on the specified route points")}typeof c=="function"&&c.call(this,a);this.map.displayError(f,void 0)},buildRoute:function(a,b,c){for(var d={},f=[],j=0;j<a.length;j++)f.push(this.map._getOffsetFromLonLat(a[j]).join(","));d.B=f.join(":");return this.sendRequest(d,function(a){this.fire("build",a);typeof b=="function"&&b.call(c,
a)},function(b){var c={points:a,method:"build"};Navitel.extend(c,b);this.fire("error",c)})},removePoint:function(a,b){return this.sendRequest({R:a+","+b},function(a){this.fire("remove",a)},function(c){var d={rId:a,n:b,method:"remove"};Navitel.extend(d,c);this.fire("error",d)})},drawRoute:function(a){var c=a.rId,d=a.viewport,f=a.zoom,k=this.map.getResolutionForZoom(f),j=this.map,l=a.routeType==null?b.Routes.Protocol.RouteType.DEFAULT:a.routeType,m=a.routeVehicleType==null?b.Routes.Protocol.RouteVehicleType.DEFAULT:
a.routeVehicleType,l={D:[c,d.left,d.bottom,d.right,d.top,f,a.insensitivityRadius].join(","),RP:l|m<<1},n=++this.sync;return this.sendRequest(l,function(b){if(this.sync==n){for(var l=[],m=[],s=function(a,b){return j._getLonLatFromOffset([d.left,d.bottom,f,a,b])},q=0,r=1;r<b.length;r++)if(b[r].length==0)q=1;else if(q==0){var u=b[r][0],v=s(b[r][1],b[r][2]);l[r-1]=[u,v];for(u=3;u<b[r].length;u+=2)v=v.add(b[r][u]*k,b[r][u+1]*k),l[r-1].push(v)}else{var v=b[r][0],u=s(b[r][1],b[r][2]),w=s(b[r][3],b[r][4]);
m.push([v,u,w])}b={rId:c,points:l,segments:m,viewport:d,zoom:f};a.callback&&a.callback.call(a.scope,b);this.fire("draw",b)}},function(b){b=Navitel.extend(b,a);b.method="draw";this.fire("error",b)})},newPoint:function(a,b,c){var d=this.map.getZoom(),d=this.map._getOffsetFromLonLat(c,d);return this.sendRequest({N:[a,b].concat(d).join(",")},function(a){this.fire("new",{rId:a.rId,n:b,lonlat:c.clone()})},function(d){var f={rId:a,n:b,lonlat:c,method:"new"};Navitel.extend(f,d);this.fire("error",f)})},movePoint:function(a,
b,c){var d=this.map.getZoom(),d=this.map._getOffsetFromLonLat(c,d);return this.sendRequest({M:[a,b].concat(d).join(",")},function(a){this.fire("move",{rId:a.rId,n:b,lonlat:c.clone()})},function(d){var f={rId:a,n:b,lonlat:c,method:"move"};Navitel.extend(f,d);this.fire("error",f)})},restorePoints:function(a,b,c,d){return this.sendRequest({P:a},function(d){for(var f=[],i=0,m=d.length;i<m;i++){var n=this.map._getLonLatFromOffset(d[i]);f.push(n)}d={points:f,rId:a};typeof b=="function"&&b.call(c,d);this.fire("points",
d)},function(b){var f={rId:a,method:"points"};Navitel.extend(f,b);typeof d=="function"&&d.call(c,f);this.fire("error",f)})},getManeuvers:function(a){var b=a.rId,c=a.viewport,d=a.zoom,f=this.map;return this.sendRequest({V:[b,c.left,c.bottom,c.right,c.top,d].join(",")},function(j){for(var l=[],m=1,n=j.length;m<n;m++){var o=j[m],p={visible:!!o.Vis,len:o.Len,city:o.Ct};if(o.Vis)p.lonlat=f._getLonLatFromOffset([c.left,c.bottom+1,d,o.PtX,(c.top-c.bottom)*256-o.PtY]),p.angle=o.An,o="none",p.angle>0?o="right":
p.angle<0&&(o="left"),p.maneuver=o;l.push(p)}j={rId:b,maneuvers:l,viewport:c,zoom:d};a.callback&&a.callback.call(a.scope,j);this.fire("maneuvers",j)},function(){this.fire("error",{rId:b,method:"maneuvers"})})},getAddresses:function(a,b,c){return this.sendRequest({A:a},function(d){d={rId:a,addresses:d};typeof b=="function"&&b.call(c,d);this.fire("addresses",d)},function(){this.fire("error",{rId:a,method:"addresses"})})},eraseRoute:function(a,b,c){return this.sendRequest({E:a},function(){typeof b==
"function"&&b.call(c,{rId:a});this.fire("erase",{rId:a})},function(){this.fire("error",{rId:a,method:"erase"})})},abort:function(a){a&&a.readyState>0&&a.abort()}});b.Routes.Protocol.RouteType={SHORTEST:0,FASTEST:1};b.Routes.Protocol.RouteVehicleType={PEDESTRIAN:0,BICYCLE:1,CAR:2,TAXI:3,BUS:4,EMERGENCY:5,DELIVERY:6,TRUCK:7};b.Routes.Layer=OpenLayers.Class(b.Layer.Vector,{urlId:"R",name:"\u041c\u0430\u0440\u0448\u0440\u0443\u0442",renderers:["Canvas","SVG","VML"],route:null,lastDrawedRid:null,adds:null,
map:null,readOnly:!1,drawArrows:!0,serviceUrl:"/route_manager.fcgi",routeType:b.Routes.Protocol.RouteType.FASTEST,routeVehicleType:b.Routes.Protocol.RouteVehicleType.CAR,initialize:function(a){this.strategies=[new b.Routes.Strategy({resFactor:1.5})];b.Layer.Vector.prototype.initialize.call(this,this.name,a);this.refresh=Navitel.Func.deferred(this.refresh,this,100);this.route=new b.Routes.Route;this.adds=new OpenLayers.Feature.Vector(null,null,b.Styles["route-segments"]);this.addFeatures([this.route,
this.adds]);this.popupTemplate=b.Template.make("route-popup")},afterAdd:function(){this.protocol=new b.Routes.Protocol(this.map.routesUrl,{map:this.map});b.ComponentFactory.getInstance(this.map).registerLayerButton("routes",this,b._("Show routes layer"),b._("Hide routes layer"));this.markersLayer=new b.Routes.Markers("\u0422\u043e\u0447\u043a\u0438 \u0437\u0430\u0435\u0437\u0434\u043e\u0432");this.map.addLayer(this.markersLayer);this.protocol.on({error:this.handleError,erase:this.handleErase},this);
this.listen("draw",this.handleDraw,this);if(this.drawArrows){var a=new Navitel.Geo.LineArrows(this.route,b.Styles["route-arrows"],b.Styles["route-arrows-geom"]);this.on({draw:a.render,clear:a.clear},a)}this.session=new b.Routes.Session(this);this.session.listen("sended",function(){this.refresh({force:!0})},this);this.route.registerSessionHandlers();if(!this.readOnly){this.dragger=new b.Control.DragMarker(this.markersLayer);this.dragger.on({drag:function(a){a=a.marker;this.route.isBuilded()&&this.session.movePoint(a,
a.lonlat)},dragstart:function(){this.map.click.hidePopups();this.closestHandler.deactivate()},dragend:function(){this.closestHandler.activate();this.session.flush()},startdelay:function(){this.session.flush()}},this);this.markersLayer.on({contextmenu:function(a){this.popupContext={States:b.Routes.Layer.States,state:this.getState()};if(a.marker)this.popupContext.contextMarker=a.marker;else if(this.popupContext.contextMarker=null,this.closestHandler.isOver)a.lonlat=this.closestHandler.lastLonLat;var c=
this.popupTemplate(this.popupContext);a.addContent(c,!a.marker)}},this);this.map.on({attachpopup:function(a){var b=this.map.click.lastLonLat.clone();a.popup.bindContentToRoleMap(".NMaps-proute-link",{"route-remove-point":function(){this.route.removePoint(this.popupContext.contextMarker)},"route-add-start-point":function(){this.route.addStart(b)},"route-add-middle-point":function(){this.route.addMiddle(b)},"route-add-end-point":function(){this.route.addEnd(b)},"route-delete":function(){this.removeRoute()}},
{inRoleHandler:function(){a.popup.hide()},scope:this})}},this);this.closestHandler=new b.Routes.ClosestHandler(this,this,null,{map:this.map});this.closestHandler.activate();var c=this.map.getControlsByClass("NMaps.Control.Navigation")[0].dragPan,d=c.active;this.closestHandler.on({out:function(a){if(this._fStartDrag){this._fStartDrag=!1;var b=this.route.getClosestLineString(this.closestHandler.lastLonLat),e=null;b&&(e=b.meta+1);b=this.route.addMiddle(this.getLonLatFromViewPortPx(a.xy),e);this.dragger.forceStartDragging(a,
b)}d&&c.activate()},over:function(){d=c.active;c.deactivate()}},this);this.map.events.registerPriority("mousedown",this,function(){this._fStartDrag=this.closestHandler.isOver});this.map.events.registerPriority("mouseup",this,function(){this._fStartDrag=!1})}OpenLayers.Layer.Vector.prototype.afterAdd.call(this);a=OpenLayers.Util.getParameters();if(a.rId){var f=parseInt(a.rp),k=null,j=null;isNaN(f)||(k=f&1,j=f>>1);this.protocol.restorePoints(a.rId,function(a){this.buildRouteByPoints(a.points,a.rId);
k!=null&&this.setRouteType(k);j!=null&&this.setRouteVehicleType(j)},this)}this.map.on({animationstart:function(){this.lastVisibility=this.getVisibility();this.display(!1,!0)},animationend:function(){this.display(this.lastVisibility,!0)}},this)},getState:function(){var a=this.markersLayer.markers.length,c=b.Routes.Layer.States;return a==0?c.EMPTY:a==1?this.markersLayer.markers[0].pointType=="start"?c.START:c.END:a==2?c.START_END:c.MORE},getRouteId:function(){return this.session.rid},destroy:function(){this.markersLayer.destroy();
this.markersLayer=null;this.session.destroy();this.session=null;this.protocol.destroy();this.protocol=null;OpenLayers.Layer.Vector.prototype.destroy.apply(this,arguments)},getDataExtent:function(){var a=this.markersLayer.getDataExtent(),b=this.route.geometry.getBounds(),c=a||b;a&&b&&c.extend(b);return c},setRouteType:function(a){if(this.routeType!=a)this.routeType=a,this.refresh({force:!0}),this.fire("typechanged",{layer:this}),this.map.fire("permalink-update",{caller:this})},setRouteVehicleType:function(a){if(this.routeVehicleType!=
a)this.routeVehicleType=a,this.refresh({force:!0}),this.fire("vehicletypechanged",{layer:this}),this.map.fire("permalink-update",{caller:this})},drawRouteGeoms:function(a,b){this.clearRouteGeoms();this.adds.geometry=b;this.route.geometry=a;this.adds.geometry.clearBounds();this.route.geometry.clearBounds();this.redraw();this.closestHandler&&this.dragger&&!this.dragger.isDragging&&this.closestHandler.activate();this.fire("draw")},clearRouteGeoms:function(){var a=[];this.route.geometry&&a.push(this.route);
this.adds.geometry&&a.push(this.adds);this.eraseFeatures(a);this.adds.geometry&&this.adds.geometry.destroy();this.route.geometry&&this.route.geometry.destroy();this.adds.geometry=null;this.route.geometry=null;this.fire("clear")},clearRoute:function(a){this.closestHandler&&this.closestHandler.deactivate();(!a||!a.keepMarkers)&&this.markersLayer.clearMarkers();this.clearRouteGeoms()},eraseRoute:function(a,b){this.getRouteId()&&this.protocol.eraseRoute(this.getRouteId(),a,b)},removeRoute:function(a){this.lastDrawedRid=
null;this.clearRoute(a);(!a||!a.dontErase)&&this.eraseRoute();this.session.setRid(null)},handleDraw:function(){this.lastDrawedRid=this.getRouteId()},handleError:function(a){if(a.err==17||a.err==12)this.lastDrawedRid?a.err==17&&this.lastDrawedRid==this.getRouteId()||(this.session.lock(),this.protocol.restorePoints(this.lastDrawedRid,function(a){this.clearRoute();this.session.unlock();this.buildRouteByPoints(a.points,a.rId)},this,function(){this.session.unlock()})):this.removeRoute({dontErase:!0})},
createPoints:function(a,b){for(var c="start",d=a.length,f=0;f<d;)this.route.createPoint(a[f],null,c).created=!!b,c="middle",++f==d-1&&(c="end")},buildRouteByPoints:function(a,b){this.createPoints(a,!0);this.lastDrawedRid=null;this.session.setRid(b);this.session.startSending();this.refresh({force:!0})},handleErase:function(){this.clearRouteGeoms()},setVisibility:function(){OpenLayers.Layer.Vector.prototype.setVisibility.apply(this,arguments);this.markersLayer&&this.markersLayer.setVisibility.apply(this.markersLayer,
arguments)},display:function(a,b){OpenLayers.Layer.Vector.prototype.display.call(this,a);b&&this.markersLayer&&this.markersLayer.display(a)}});b.Routes.Layer.States={EMPTY:1,START:2,END:4,START_END:8,MORE:16};b.Routes.Session=function(a,b){this.layer=a;this.protocol=a.protocol;Navitel.extend(this,b);this.protocolListeners={remove:this.handleResponse,"new":this.handleResponse,move:this.handleResponse,build:this.handleBuild,erase:this.handleErase,error:this.handleError};this.layerListeners={loadend:this.handleLayerLoaded,
draw:this.handleDraw};this.mapListeners={"permalink-params":this.handleMapPermalink};this.protocol.on(this.protocolListeners,this);this.layer.on(this.layerListeners,this);this.layer.map.on(this.mapListeners,this)};Navitel.inherits(b.Routes.Session,Navitel.EventTarget);Navitel.extendClass(b.Routes.Session,{layer:null,rid:null,changes:[],sendTx:null,sendTimerId:null,sendingInterval:1E3,CHANGE_NEW:1,CHANGE_MOVE:2,CHANGE_REMOVE:4,destroy:function(){this.stopSending();this.protocol.un(this.protocolListeners,
this);this.layer.un(this.layerListeners,this);this.layer.map.un(this.mapListeners,this);this.layer=null;Navitel.EventTarget.destroy.call(this);this.changes=[];this.sendTx=null},setRid:function(a){if(this.rid!=a)this.rid=a,this.layer.map.fire("permalink-update",{caller:this})},handleMapPermalink:function(a){if(this.rid){a.params.rId=this.rid;var b=this.layer;a.params.rp=b.routeType|b.routeVehicleType<<1}else delete a.params.rId,delete a.params.rp},addChange:function(a){if(this.locked)return!1;var b=
[a].concat(Array.prototype.slice.call(arguments,1)),c=!0;if(a==this.CHANGE_MOVE&&this.changes.length>0&&(!this.sendTx||this.sendTx[1]<this.changes.length)){var d=this.changes[this.changes.length-1];d[0]&(this.CHANGE_MOVE|this.CHANGE_NEW)&&d[1]===b[1]&&(d[2]=b[2],c=!1)}c&&this.changes.push(b)},newPoint:function(a,b,c){this.addChange(this.CHANGE_NEW,a,b,c)},movePoint:function(a,b){this.addChange(this.CHANGE_MOVE,a,b)},removePoint:function(a){this.addChange(this.CHANGE_REMOVE,a)},lock:function(){this.locked=
!0},unlock:function(){this.locked=!1},handleBuild:function(a){this.waitDrawForStart=!0;this.setRid(a.rId);this.fire("build",a)},handleDraw:function(){if(this.waitDrawForStart)this.startSending(),this.waitDrawForStart=!1},handleLayerLoaded:function(){if(this.waitRedraw)this.waitRedraw=!1,this.sendNext()},handleErase:function(){this.stopSending()},handleError:function(a){this.changes=[];this.sendTx=null;this.waitRedraw=!1;this.fire(a.type,a)},handleResponse:function(a){this.setRid(a.rId);this.fire(a.type,
a);a.type=="new"||a.type=="remove"?(this.waitRedraw=!0,this.layer.refresh({force:!0})):this.sendNext()},isSending:function(){return!!this.sendTx},startSending:function(){this.sendTimerId&&this.stopSending();this.sendTimerId=window.setInterval(this.send.bind(this),this.sendingInterval)},stopSending:function(){if(this.sendTimerId!=null)window.clearInterval(this.sendTimerId),this.sendTimerId=null},send:function(){if(this.isSending()||!this.changes.length||this.rid==null)return!1;this.sendTx=[this.changes.length,
0];return this.sendNext()},flush:function(){if(this.sendTx)this.sendTx[0]=this.changes.length;this.send()},sendNext:function(){if(!this.sendTx)return!1;var a=this.sendTx[1]++;if(a>=this.sendTx[0])return this.changes.splice(0,this.sendTx[0]),this.sendTx=null,this.fire("sended",{rId:this.rid}),!1;this.sendChange(this.changes[a])},sendChange:function(a){var b=null;switch(a[0]){case this.CHANGE_NEW:var b=a[1],c=a[2],d=a[3];d==null&&(d=1,(c=this.layer.route.getClosestLineString(c))&&(d=c.meta+1));this.layer.markersLayer.moveMarker(b,
d);a[1]=d;a.length=3;b=this.protocol.newPoint;break;case this.CHANGE_MOVE:a[1]=this.layer.markersLayer.indexOf(a[1]);b=this.protocol.movePoint;break;case this.CHANGE_REMOVE:b=this.protocol.removePoint}b&&(a=[this.rid].concat(a.slice(1)),b.apply(this.protocol,a))}});b.Routes.Route=OpenLayers.Class(OpenLayers.Feature.Vector,{initialize:function(a,c,d){d||(d={});OpenLayers.Util.applyDefaults(d,b.Styles.route);OpenLayers.Feature.Vector.prototype.initialize.call(this,a,c,d)},registerSessionHandlers:function(){this.layer.session.on({"new":this.handleNewPoint,
build:this.handleBuild},this)},createStartPoint:function(a){return this.createPoint(a,0,"start")},createMiddlePoint:function(a,b){return this.createPoint(a,b,"middle")},createEndPoint:function(a){return this.createPoint(a,this.getMarkersLen(),"end")},createPoint:function(a,c,d){a=b.Marker.make(a,"route-markers-"+d,b.Routes.Marker,b.LabeledIcon);a.pointType=d;this.layer.markersLayer.addMarker(a,c);return a},addStart:function(a){this.layer.setVisibility(!0);var c=b.Routes.Layer.States;this.layer.getState()&
(c.EMPTY|c.END)?(c=this.createStartPoint(a),this.buildRoute()):(c=this.layer.markersLayer.markers[0],c.moveTo(this.layer.map.getLayerPxFromLonLat(a)));this.isBuilded()&&this.layer.session.movePoint(c,a);return c},buildRoute:function(){if(this.getMarkersLen()==2&&!this.isBuilded()){for(var a=[],b=0;b<this.getMarkersLen();b++)a.push(this.layer.markersLayer.markers[b].lonlat);this.layer.protocol.buildRoute(a,function(){this.layer.refresh({force:!0})},this)}},isBuilded:function(){return!!this.layer.getRouteId()},
addEnd:function(a){this.layer.setVisibility(!0);var c=b.Routes.Layer.States;this.layer.getState()&(c.EMPTY|c.START)?(c=this.createEndPoint(a),this.buildRoute()):(c=this.layer.markersLayer.markers[this.getMarkersLen()-1],c.moveTo(this.layer.map.getLayerPxFromLonLat(a)));this.isBuilded()&&this.layer.session.movePoint(c,a);return c},getClosestLineString:function(a){for(var b=this.geometry.components,c=Number.POSITIVE_INFINITY,a=new OpenLayers.Geometry.Point(a.lon,a.lat),d=null,f=0,j=b.length;f<j;f++){var l=
b[f],m=l.distanceTo(a);m!=null&&m<c&&(c=m,d=l)}return d},handleNewPoint:function(a){this.layer.markersLayer.markers[a.n].created=!0},handleBuild:function(){for(var a=this.layer.markersLayer.markers,b=0,c=a.length;b<c;b++)a[b].created=!0},addMiddle:function(a,b){if(!(this.getMarkersLen()<2)){this.layer.setVisibility(!0);var c=this.createMiddlePoint(a,b||1);this.layer.session.newPoint(c,a,b);return c}},getMarkersLen:function(){return this.layer.markersLayer.markers.length},removePoint:function(a){var b=
this.getMarkersLen(),c=this.layer.markersLayer.indexOf(a);this.layer.markersLayer.removeMarker(a);b=this.getMarkersLen();b>1?a.created&&(this.layer.session.removePoint(c),this.layer.session.flush()):b==0?this.layer.removeRoute():this.layer.removeRoute({keepMarkers:!0})}});b.Control.DragMarker=function(a,b){Navitel.extend(this,b);this.layer=a;a.on({addmarker:function(a){var a=a.marker,b=new Navitel.Dom.Draggable(a.icon.imageDiv);a._dragHandler=b;b.marker=a;b.enable();b.listen("drag",this._onDrag,this);
b.listen("dragstart",this._onDragStart,this);b.listen("dragend",this._onDragEnd,this)},removemarker:this._onRemoveMarker},this)};Navitel.inherits(b.Control.DragMarker,Navitel.EventTarget);Navitel.extendClass(b.Control.DragMarker,{lastPixel:null,moveDelayInterval:380,_moveDelayTimer:null,_prevPixel:null,_moveDelayed:!1,layer:null,isDragging:!1,_onRemoveMarker:function(a){a=a.marker;if(a._dragHandler)a._dragHandler.stopDrag(),a._dragHandler.disable(),a._dragHandler.marker=null,a._dragHandler=null},
forceStartDragging:function(a,b){this.marker=b;b._dragHandler.startDrag(a)},_onDrag:function(a){this._lastPixel=a.pos.clone();var b=a.target.marker,a=this._startPos.add(a.dx,a.dy);b.moveTo(a);this.fire("drag",{marker:b})},_onDragStart:function(a){a=a.target.marker;a.icon.imageDiv.style.cursor="";this.isDragging=!0;this._startPos=a.icon.px.clone();this.fire("dragstart",{marker:a});this._moveDelayTimer=window.setInterval(this.handleMovingDelay.bind(this),this.moveDelayInterval)},_onDragEnd:function(a){this.fire("dragend",
{marker:a.target.marker});this.isDragging=!1;if(this._moveDelayTimer)window.clearInterval(this._moveDelayTimer),this._moveDelayTimer=null},handleMovingDelay:function(){if(this._lastPixel){if(this.__prevPixel){var a=this._lastPixel.y-this.__prevPixel.y;if(this._lastPixel.x-this.__prevPixel.x==0&&a==0){if(!this._moveDelayed)this.fire("startdelay"),this._moveDelayed=!0}else if(this._moveDelayed)this.fire("stopdelay"),this._moveDelayed=!1}this.__prevPixel=this._lastPixel.clone()}}});b.Control.SideBar=
function(a,b){Navitel.Ui.TabBar.call(this);this.map=a;this.contentNode=Navitel.Dom.getElement(b);this.decorate(this.contentNode);this.switcherElem=new Navitel.Ui.Element("b_page_switcher");this.switcherElem.enableAutoState(Navitel.Ui.Element.States.HOVER,!0);this.switcherElem.listenElement("click",this.toggle,this)};Navitel.inherits(b.Control.SideBar,Navitel.Ui.TabBar);Navitel.extendClass(b.Control.SideBar,{TOGGLE_CLASS:"f_sidebar_on",isVisible:function(){return Navitel.Dom.Classes.has(document.body,
this.TOGGLE_CLASS)},setVisible:function(a){(a?Navitel.Dom.Classes.add:Navitel.Dom.Classes.remove)(document.body,this.TOGGLE_CLASS);a&&this._adjustTabsCont();this.map.updateSize();this.fire("visibility",{visibility:a})},toggle:function(){this.setVisible(!this.isVisible())},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},addTab:function(a,c){var d=b.Control.SideBar._superClass.addTab.call(this,a,c);this._adjustTabsCont();return d},_adjustTabsCont:function(){var a=this._tabsCont;
a.style.position="absolute";a.style.top=this._tabsNode.offsetHeight+this._tabsNode.offsetTop+"px"}});b.Search={};b.Search.PersistentData=function(){this.fetch()};Navitel.inherits(b.Search.PersistentData,Navitel.EventTarget);Navitel.extendClass(b.Search.PersistentData,{serviceUrlWellKnown:"/webmaps/wellKnown",serviceUrlSearchTypes:"/webmaps/searchtypes",wellKnownList:null,searchTemplates:null,fetched:!1,cachedLocations:{},cacheLocation:function(a,b){this.cachedLocations[a]||(this.cachedLocations[a]=
[]);for(var c=!1,d=0,f=this.cachedLocations[a].length;d<f;d++)if(this.cachedLocations[a][d][0]==b[0]){c=!0;break}c||this.cachedLocations[a].push(b)},getCachedLocations:function(a){return this.cachedLocations[a]},fetch:function(){b.loadURL(this.serviceUrlWellKnown,null,this,function(a){this.wellKnownList=this.expandList(a);this.searchTemplates&&this.handleFetched()},this.handleFail);b.loadURL(this.serviceUrlSearchTypes,null,this,function(a){this.searchTemplates=this.expandList(a);this.wellKnownList&&
this.handleFetched()},this.handleFail)},handleFail:function(){this._failed=!0;this.fire("failed")},handleFetched:function(){if(!this.fetched)this.fetched=!0,this.fire("fetched")},expandList:function(a){for(var b={},c=0,d=a.length;c<d;c++){var f=a[c];b[f[0]]=f.slice(1)}return b},getSearchTemplate:function(a){if(a=this.searchTemplates[a])return a[0];return null},getWellKnownEntry:function(a){return this.wellKnownList[a]},onReady:function(a,b){var c=[].slice.call(arguments,2);this.fetched?a.apply(b,
c):this.listen("fetched",a,b)},onFailed:function(a,b){var c=[].slice.call(arguments,2);this._failed?a.apply(b,c):this.listen("failed",a,b)}});b.Search.PersistentData.getInstance=function(){if(!this.instance)this.instance=new b.Search.PersistentData;return this.instance};b.Search.Location=OpenLayers.Class({titleSep:", ",parentSep:", ",locSep:", ",initialize:function(a,c){Navitel.extend(this,c);this.data=a;b.Search.Location._cache[this.getId()]=this},getTitleAndParent:function(a,b){var c=[this.getTitle(a)],
d=this.getParent(b);d&&c.push(d);return c},getTitle:function(a){var c=this.data,d=c[1],c=c[2];a&&(d=[].slice.call(d).reverse());a=d.join(this.titleSep);return(b.Search.PersistentData.getInstance().getSearchTemplate(c)||"%n").replace("%n",a)},getParent:function(a){var c=this.data,d=c[3],c=c[4];a&&c&&(c=[].slice.call(c).reverse());a=b.Search.PersistentData.getInstance();if(d){if(d=a.getWellKnownEntry(d))return d[2]}else if(c)return c.join(this.parentSep)},getId:function(){return this.data[0]},format:function(a,
b,c){a=this.getTitleAndParent(a,b);c&&a.reverse();return a.join(this.locSep)}});b.Search.Location._cache={};b.Search.Location.fromCache=function(a){return this._cache[a]};b.Search.Popup=function(a,c,d){b.Handler.Autocompleter.call(this,c,d);this.locations=[];this.cachedResponse={};this.persistentData=b.Search.PersistentData.getInstance();this.setMap(a)};Navitel.inherits(b.Search.Popup,b.Handler.Autocompleter);Navitel.extendClass(b.Search.Popup,{serviceUrl:"/webmaps/autocomplete",reverseLocationTitle:!0,
reverseLocationParent:!1,reverseLocation:!1,setMap:function(a){this._map=a;this._map.listen("moveend",function(){this.cachedResponse={}},this)},autocomplete:function(){var a=this.cachedResponse[this.currentValue];if(a)this.handleSuggest(a);else{var c=this.currentValue,a={s:c},d=this._map.getCenter().transform(this._map.projection,this._map.displayProjection);a.lon=parseFloat(d.lon);a.lat=parseFloat(d.lat);a.z=this._map.getZoom();b.loadURL(this.serviceUrl,a,this,function(a){this.processSuggestResponse(a,
c)},this.handleSuggestFailure)}},handleSuggestFailure:function(a){this._map.displayError(b.Util.getHTTPErrorMessage(a));this.setOpened(!1)},createSuggestEntry:function(a,b,c,d){var f=this,j=document.createElement("div");j._index=a;j.className="b_autocomplete_entry";d&&(j.className+=" selected");j.setAttribute("title",b.replace(/<(\S+?)[^>]*>/g,""));var l=document.createElement("div");l.className="b_autocomplete_entry_title";l.innerHTML=b;j.appendChild(l);if(c)a=document.createElement("div"),a.className=
"b_autocomplete_entry_subtitle",a.innerHTML=c,j.appendChild(a);Navitel.Events.listen(j,"click",function(a){f.select(j._index);a.stopPropagation()});Navitel.Events.listen(l,"mouseover",function(){f.handleTitleMouseOver(l)});Navitel.Events.listen(l,"mouseout",function(){f.handleTitleMouseOut(l)});return j},handleTitleMouseOver:function(a){Navitel.Ui.Element.addState(a,"hover")},handleTitleMouseOut:function(a){Navitel.Ui.Element.removeState(a,"hover")},suggest:function(){if(this.locations.length===0||
this.currentValue.length<2)this.setOpened(!1);else{this.clearContent();for(var a=RegExp("("+RegExp.escape(this.currentValue.trim().split(/[\s,]+/).join("|")).replace("\\|","|","g")+")","gi"),b=0;b<this.locations.length;b++){var c=this.locations[b].getTitleAndParent(!0,!1),d=c[1],c=this.highlight(c[0],a),d=this.createSuggestEntry(b,c,d,this.selectedIndex==b);this.getContentNode().appendChild(d)}this.enabled=!0;this.place();window.s=this;this.setOpened(!0)}},handleSuggest:function(a){this.persistentData.onReady(function(){var c=
a.map(function(a){return new b.Search.Location(a)});this.locations=c;for(var d=0,f=c.length;d<f;d++)this.persistentData.cacheLocation(this.formatLocation(c[d]),a[d]);this.suggest()},this)},processSuggestResponse:function(a,b){this.cachedResponse[b]=a;b==this.currentValue&&this.handleSuggest(a)},formatLocation:function(a){return a.format(this.reverseLocationTitle,this.reverseLocationParent,this.reverseLocation)},select:function(a){var b=this.locations[a];if(b)this.input.value=this.formatLocation(b),
this.setOpened(!1),this.onSelect(a)},handleItemSelected:function(a){this.input.value=this.formatLocation(this.locations[a])},onSelect:function(a){this.locations[a]&&(a=this.locations[a],this.fire("select",{search_id:a.getId(),query:a.getTitle(!0),query_full:this.input.value,query_data:a.data}))}});b.Search.MainPopup=function(a,c,d){b.Search.Popup.call(this,a,c,d);if(!this.form)this.form=this.input.form;Navitel.Events.listen(this.form,"submit",this.handleFormSubmit,this);this.listen("select",this.handleSelect,
this)};Navitel.inherits(b.Search.MainPopup,b.Search.Popup);Navitel.extendClass(b.Search.MainPopup,{handleFormSubmit:function(){this.clearPopupTimeout();this.setOpened(!1)},handleSelect:function(a){var b={};Navitel.extend(b,a);this._map.fire("search-select",b)}});b.Search.Navigation=OpenLayers.Class(OpenLayers.Control,{searchUrl:"/webmaps/searchTwoStep",searchInfoUrl:"/webmaps/searchTwoStepInfo",searchByIdUrl:"/webmaps/searchById",autoActivate:!0,lastSelectedEntry:null,lastQuery:null,permalinkParams:null,
initialize:function(a,c){OpenLayers.Control.prototype.initialize.apply(this,[c]);this.input=Navitel.Dom.getElement(a);this.form=this.input.form||document.getElementById("search_form");var d=Navitel.Dom.q("#search_btn")[0];this.persistentData=b.Search.PersistentData.getInstance();this.entryTemplate=b.Template.make("NMaps-search-entry");this.popupTemplate=b.Template.make("NMaps-navigation-popup");this.notFoundTmpl=b.Template.make("NMaps-search-not-found");Navitel.Events.listen(this.form,"submit",this.handleFormSubmit,
this);Navitel.Events.listen(d,"click",function(){this.search(this.getFormQuery())},this)},activate:function(){if(!this.active)return OpenLayers.Control.prototype.activate.call(this),this.map.addLayer(this.markersLayer),!0;return!1},deactivate:function(){if(this.active)return this.map.removeLayer(this.markersLayer),OpenLayers.Control.prototype.deactivate.call(this),!0;return!1},handleFail:function(){Navitel.Dom.Classes.add(document.body,"search_error");this.map.displayError(b._("Search is temporarily unavailable"))},
setMap:function(a){OpenLayers.Control.prototype.setMap.call(this,a);this.markersLayer=new b.Layer.Markers("Search markers");this.markersLayer.setVisibility(!1);this.marker=b.Marker.make(new OpenLayers.LonLat(0,0),"search-marker");this.markersLayer.addMarker(this.marker);this.marker.popupTemplate=this.popupTemplate;this.persistentData.onFailed(this.handleFail,this);this._tab=this.map.sidebar.addTab(b._("Search results"),0);this.map.on({"search-select":this.handleSearchSelect,"permalink-params":this.handlePermalinkParams},
this);var c=OpenLayers.Util.getParameters();if(c.sid&&!c.sq){var d=parseInt(c.sid);if(!isNaN(d))this.searchById(d,function(a){var e={noNavigate:c.lon&&c.lat};this.persistentData.onReady(function(){this.input.value=(new b.Search.Location(a)).format(!0,!0,!0)},this);this.showLocations([a],d,e)}),this.permalinkParams={sid:d},this.map.fire("permalink-update")}else if(c.sid&&c.sq&&(d=parseInt(c.sid),!isNaN(d))){this.input.value=c.sq;var a=new OpenLayers.LonLat(c.sll[0],c.sll[1]),f=parseInt(c.sz);this.search(c.sq,
d,{ctxLonLat:a,ctxZoom:f,noNavigate:!0})}},handlePermalinkParams:function(a){this.permalinkParams&&(Navitel.extend(a.params,this.permalinkParams),a.params.sq&&(delete a.params.sl,delete a.params.st))},search:function(a,c,d){d==null&&(d={});this.activate();var f={s:a},k=d.ctxLonLat||this.map.getCenter().transform(this.map.projection,this.map.displayProjection),j=d.ctxZoom||this.map.getZoom();f.lon=parseFloat(k.lon);f.lat=parseFloat(k.lat);f.z=j;this.lastQuery={s:a,lon:k.lon.toFixed(5),lat:k.lat.toFixed(5),
zoom:j};if(arguments.length==1&&(k=this.persistentData.getCachedLocations(a))){this.showLocations(k);return}b.loadURL(this.searchUrl,f,this,function(a){this.showLocations(a,c,d)})},createSearchUrl:function(a){return this.makeSearchUrl({sid:a})},makeSearchUrl:function(a){var b=document.location.href;b.indexOf("?")!=-1&&(b=b.substring(0,b.indexOf("?")));b+="?"+OpenLayers.Util.getParameterString(a);return b},getSearchEntryHtml:function(a,b){return this.entryTemplate({search_href:this.createSearchUrl(a,
b),search_title:b.getTitle(!0),search_text:b.getParent(!1)||"",search_id:a})},show:function(){var a=this.map.sidebar;a.show();a.selectTab(this._tab)},show404:function(){html=this.notFoundTmpl({search:this.input.value});this.setSidebarContent(html)},showLocations:function(a,c,d){d==null&&(d={});if(a.length){for(var f=null,k=d.additional_data,j=0,l=a.length;j<l;j++){var m=a[j];if(k&&k[0]==m[0]){f=j;break}}f!=null?f=a.splice(f,1)[0]:k&&(f=k);f&&a.unshift(f);!c&&a&&a[0]&&(c=a[0][0]);this.persistentData.onReady(function(){for(var f=
a.map(function(a){return new b.Search.Location(a)}),i="",j=0,k=f.length;j<k;j++)i+=this.getSearchEntryHtml(a[j][0],f[j]);c?(this.updatePermalink(c),this.selectLocation(c,d.noNavigate)):this.hideMarker();this.setSidebarContent(i,c);this.map.sidebar.show();this._tab.setSelected(!0)},this)}else this.show404()},updatePermalink:function(a){if(this.lastQuery)this.permalinkParams={sid:a,sq:this.lastQuery.s,sll:[this.lastQuery.lon,this.lastQuery.lat].join(","),sz:this.lastQuery.zoom},this.map.fire("permalink-update")},
setSidebarContent:function(a,b){var c=this._tab.pane;c.innerHTML=a;for(var c=Navitel.Dom.q(".b_search_title a",c),d=0,f=c.length;d<f;d++){var j=c[d];j.getAttribute("_sid")==b&&this.selectSearchNode(j.parentNode.parentNode);Navitel.Events.listen(j,"click",this.handleLinkClick,this)}this.show()},getLocationPlace:function(a,c){b.loadURL(this.searchInfoUrl,{id:a},this,function(a){var b=(new OpenLayers.LonLat(a[0],a[1])).transform(this.map.displayProjection,this.map.projection);c.call(this,b,a[2])})},
searchById:function(a,c){b.loadURL(this.searchByIdUrl,{id:a},this,function(a){c.call(this,a)})},displayMarker:function(a){this.marker.popup&&this.marker.popup.hide();this.marker.lonlat=a;this.markersLayer.setVisibility(!0);this.markersLayer.drawMarker(this.marker)},hideMarker:function(){this.markersLayer.setVisibility(!1)},handleLinkClick:function(a){var b=OpenLayers.Event.element(a),c=b.parentNode.parentNode,d=b.getAttribute("_sid");this.selectLocation(d,!1,function(){this.updatePermalink(d);this.selectSearchNode(c)});
OpenLayers.Event.stop(a);return!1},selectLocation:function(a,c,d){this.getLocationPlace(a,function(f,k){var j=b.Search.Location.fromCache(a);this.marker.popupContext={location_title:j.getTitle(!0),location_desc:j.getParent(!0)};this.displayMarker(f);c||this.map.setCenter(f,k);typeof d=="function"&&d.call(this)})},selectSearchNode:function(a){this.lastSelectedEntry&&Navitel.Ui.Element.removeState(this.lastSelectedEntry,"selected");Navitel.Ui.Element.addState(a,"selected");this.lastSelectedEntry=a},
getFormQuery:function(){return this.input.value},handleFormSubmit:function(a){this.search(this.getFormQuery());OpenLayers.Event.stop(a);return!1},handleSearchSelect:function(a){this.search(a.query,a.search_id,{additional_data:a.query_data})}});b.Styles["search-marker"]={imagePath:"marker-green-city.png",width:28,height:44,offsetLeft:14,offsetTop:44,popupOffset:14};b.ToolBar=OpenLayers.Class(OpenLayers.Control,{components:["hand","jams","zoombar","home"],drawComponentNode:function(a){Navitel.Dom.Classes.add(a,
"NMaps-toolbar-component");this.div.appendChild(a)},drawComponent:function(a){if(a=b.ComponentFactory.getInstance(this.map).create(a))return this.drawComponentNode(a.render()),a},drawComponents:function(a){for(var b=0,c=a.length;b<c;b++)this.drawComponent(a[b])},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);Navitel.Dom.Classes.add(this.div,"NMaps-toolbar");var a=document.createElement("DIV");a.className="NMaps-toolbar-background";this.div.appendChild(a);this.drawComponents(this.components);
Navitel.Events.listen(this.div,["click","dblclick","mousedown","rightclick","dblrightclick","contextmenu"],Navitel.Events.stop);return this.div},CLASS_NAME:"Navitel.ToolBar"});b.Control.ToolBar=b.ToolBar;b.ToolBar.Component=function(a,b){this.name=a;Navitel.extend(this,b);this.onInit.call(this)};Navitel.inherits(b.ToolBar.Component,Navitel.Ui.Element);Navitel.extendClass(b.ToolBar.Component,{attach:function(a){a=Navitel.Dom.getElement(a);a.className="NMaps-"+this.name;b.ToolBar.Component._superClass.attach.call(this,
a)},onInit:function(){}});b.ToolBar.Button=function(a,c){b.ToolBar.Component.call(this,a,c)};Navitel.inherits(b.ToolBar.Button,b.ToolBar.Component);Navitel.extendClass(b.ToolBar.Button,{tooltip:null,stopClick:!0,setActive:function(a){this.toggleStateClass(a,"active","inactive")},attach:function(a){b.ToolBar.Button._superClass.attach.call(this,a);this.listenElement("click",this.click);this.listenElement("mouseover",this.mouseover)},mouseover:function(){var a=this.getTooltip.call(this);if(a){var c=
b.Tooltip.getInstance(),d=Navitel.Dom.absPosition(this.element);if(this.element.getBoundingClientRect){var f=this.element.getBoundingClientRect();d.y+=f.bottom-f.top}else d.y+=this.element.offsetHeight;c.show(a,d);c.hideAfter(1E3)}},click:function(a){this.onclick.call(this,a);this.stopClick&&(a.stopPropagation(),a.preventDefault())},getTooltip:function(){return this.tooltip},onclick:function(){}});b.ToolBar.ControlButton=function(a,c,d,f){b.ToolBar.Button.call(this,a);this.control=c;this.activateTip=
d;this.deactivateTip=f;this.attachToControl()};Navitel.inherits(b.ToolBar.ControlButton,b.ToolBar.Button);Navitel.extendClass(b.ToolBar.ControlButton,{onRender:function(){this.reflect()},attachToControl:function(){this.control.events.on({activate:this.reflect,deactivate:this.reflect,scope:this})},reflect:function(){this.setActive(this.control.active)},getTooltip:function(){return this.control.active?this.deactivateTip:this.activateTip},onclick:function(){(this.control.active?this.control.deactivate:
this.control.activate).call(this.control)}});b.ToolBar.LayerButton=function(a,c,d,f){b.ToolBar.Button.call(this,a);this.layer=c;this.showTip=d;this.hideTip=f;this.attachToLayer()};Navitel.inherits(b.ToolBar.LayerButton,b.ToolBar.Button);Navitel.extendClass(b.ToolBar.LayerButton,{onRender:function(){this.reflect()},attachToLayer:function(){this.layer.map.on({changelayer:this.onchangelayer},this)},reflect:function(){this.setActive(this.layer.getVisibility())},getTooltip:function(){return this.layer.visibility?
this.hideTip:this.showTip},onclick:function(){this.layer.setVisibility(!this.layer.getVisibility())},onchangelayer:function(a){if(a.layer==this.layer)if(a.property=="visibility")this.reflect();else if(a.property=="displayed")this.element.style.display=a.displayed?"":"none"}});b.ToolBar.OpenPrintButton=function(a,c){b.ToolBar.Button.call(this,a);this.map=c;this.map.on({"permalink-updated":this.updateLink},this);window.addEventListener&&window.addEventListener("keydown",this.onWinKeydown.bind(this),
!0)};Navitel.inherits(b.ToolBar.OpenPrintButton,b.ToolBar.Button);Navitel.extendClass(b.ToolBar.OpenPrintButton,{tagName:"a",stopClick:!0,tooltip:b.gettext_lazy("Open print version"),onWinKeydown:function(a){if(a.ctrlKey&&a.keyCode==80)return this.openPrintWindow(),a.preventDefault(),!1},onRender:function(){this.iconDiv.className=Navitel.Ui.Element._mkStateClass(this.element,"icon");this.updateLink()},attach:function(a){b.ToolBar.Button.prototype.attach.call(this,a);this.element.setAttribute("target",
"_blank");this.iconDiv=document.createElement("div");this.element.appendChild(this.iconDiv)},updateLink:function(){var a=this.map.getControl("permalink").getHref(),a=OpenLayers.Util.getParameters(a);this.element.href=OpenLayers.Util.urlAppend(this.map.basePrintUrl,OpenLayers.Util.getParameterString(a))},onclick:function(){this.openPrintWindow()},openPrintWindow:function(){return window.open(this.element.href,Navitel.UserAgent.MSIE?"_blank":b._("Navitel.Maps: printable version"),"location=yes,resizable=yes,scrollbars=yes,width=730,height=750,left=2,top=2")}});
b.ToolBar.PrintButton=function(a,c){b.ToolBar.Button.call(this,a);this.map=c};Navitel.inherits(b.ToolBar.PrintButton,b.ToolBar.Button);Navitel.extendClass(b.ToolBar.PrintButton,{stopClick:!0,tooltip:b.gettext_lazy("Print"),onRender:function(){this.addCssState("icon")},onclick:function(){window.print()}});b.Control.ZoomBar=OpenLayers.Class(b.Control,{initialize:function(a,c){this.map=a;c=c||{};b.Control.prototype.initialize.apply(this,[c]);this.position=null;this.height=c.height||163;this.sliderHeight=
c.sliderHeight||27},destroy:function(){this.slider.destroy();OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.div.style.position="relative";var a=this.map.maxZoomLevel-this.map.getZoom();this.zoomLevelsCount=this.map.maxZoomLevel-this.map.minZoomLevel+1;this.zoomLevelHeight=Math.floor(this.height/this.zoomLevelsCount);this.slider=new b.ToolBar.Component("slider");this.slider.render();this.slider.listenElement("mousedown",
this.zoomBarDown,this);Navitel.Events.listen(document.body,"mousemove",this.zoomBarDrag,this,!0);Navitel.Events.listen(document.body,"mouseup",this.zoomBarUp,this,!0);this.slider.element.style.top=a*this.zoomLevelHeight+"px";this.slider.element.style.zIndex=9999;this.zoombarDiv=new b.ToolBar.Component("zoombar-background");this.div.appendChild((new b.ToolBar.Button("zoomIn",{tooltip:b._("Zoom in"),onclick:function(){this.map.setCenter(this.map.center,this.map.getZoom()+1)},map:this.map})).render());
a=new b.ToolBar.Component("slider-container");a.render();a.element.appendChild(this.zoombarDiv.render());this.zoombarDiv.listenElement("mouseup",this.divClick,this);a.element.appendChild(this.slider.element);this.div.appendChild(a.element);this.div.appendChild((new b.ToolBar.Button("zoomOut",{tooltip:b._("Zoom out"),onclick:function(){this.map.setCenter(this.map.center,this.map.getZoom()-1)},map:this.map})).render());this.moveZoomBar=this.moveZoomBar.bind(this);this.map.listen("zoomend",this.moveZoomBar,
this);Navitel.Events.listen(this.div,["click","dblclick","mousedown","rightclick","dblrightclick","contextmenu"],Navitel.Events.stop);return this.div},divClick:function(a){if(OpenLayers.Event.isLeftClick(a)){var b=(a.getxy().y-Navitel.Dom.getPageOffset(a.target).y-parseInt(this.sliderHeight/2))/this.zoomLevelHeight;this.map.fractionalZoom||(b=Math.floor(b));b=this.map.maxZoomLevel-b;b=Math.min(Math.max(b,this.map.minZoomLevel),this.map.maxZoomLevel);this.map.zoomTo(b);OpenLayers.Event.stop(a)}},zoomBarDown:function(a){if(OpenLayers.Event.isLeftClick(a))this.mouseDragStart=
a.getxy(),this.zoomStart=a.getxy(),this.div.style.cursor="move",this.saveSliderCursor=this.slider.element.style.cursor,this.slider.element.style.cursor="move",this.sliderMouseY=a.clientY-OpenLayers.Util.pagePosition(this.slider.element)[1],OpenLayers.Event.stop(a)},zoomBarDrag:function(a){if(this.mouseDragStart!=null){var b=this.mouseDragStart.y-a.getxy().y,c=OpenLayers.Util.pagePosition(this.zoombarDiv.element);if(a.clientY-c[1]>=this.sliderMouseY&&a.clientY-c[1]<=this.height-(this.slider.element.clientWidth-
this.sliderMouseY-2))this.slider.element.style.top=parseInt(this.slider.element.style.top)-b+"px",this.mouseDragStart=a.getxy()}},zoomBarUp:function(a){if(OpenLayers.Event.isLeftClick(a)&&this.zoomStart&&this.mouseDragStart){this.div.style.cursor="";this.slider.element.style.cursor=this.saveSliderCursor;var a=this.zoomStart.y-a.getxy().y,b=this.map.zoom;this.map.fractionalZoom?(b+=a/this.zoomLevelHeight,b=Math.min(Math.max(b,0),this.zoomLevelsCount-1)):b+=Math.round(a/this.zoomLevelHeight);b=Math.min(Math.max(b,
this.map.minZoomLevel),this.map.maxZoomLevel);this.map.zoomTo(b);this.mouseDragStart=null}},moveZoomBar:function(){this.slider.element.style.top=(this.map.maxZoomLevel-this.map.getZoom())*this.zoomLevelHeight+"px"},CLASS_NAME:"Navitel.Control.ZoomBar"});b.Template._templates.popup='<dt class="nowrap">{{pgettext("Popup click point", "Coordinates of point") }}:</dt>\n<dd class="NMaps-geo-coords{{if ll.decimal}} NMaps-geo-coords-fd{{/if}}">\n    <div class="NMaps-geo-coords-c">\n        <div class="nowrap" title="{{gettext("Latitude") }}">\n            <span class="NMaps-geo-coords-g">\n                ${ll.lat.title} ${ll.lat.degrees}\u00b0 ${ll.lat.minutes}\u2032 ${ll.lat.seconds}\u2033\n            </span>\n            <span class="NMaps-geo-coords-d">\n                ${ll.lat.title} ${parseFloat(ll.lat.full_degrees.toFixed(6))}\n            </span>\n        </div>\n        <div class="nowrap" title="{{gettext("Longitude") }}">\n            <span class="NMaps-geo-coords-g">\n                ${ll.lon.title} ${ll.lon.degrees}\u00b0 ${ll.lon.minutes}\u2032 ${ll.lon.seconds}\u2033\n            </span>\n            <span class="NMaps-geo-coords-d">\n                ${ll.lon.title} ${parseFloat(ll.lon.full_degrees.toFixed(6))}\n            </span>\n        </div>\n    </div>\n    <div class="NMaps-geo-coords-s">\n        <div class="navi-button"></div>\n    </div>\n</dd>\n{{html extra_content}}\n';
b.Template._templates["popup-layout"]='<div class="NMaps-popup {{if typeof withZoomers != \'undefined\' && withZoomers }}NMaps-popup-with-zoomers{{/if }}">\n    <div class="NMaps-popup-overlay"></div>\n    <div class="NMaps-popup-content"></div>\n    {{if typeof withCloser != \'undefined\' && withCloser }}\n        <div class="NMaps-popup-close"></div>\n    {{/if}}\n    {{if typeof withZoomers != \'undefined\' && withZoomers }}\n        <div class="NMaps-popup-zoomers">\n            <div title="{{gettext("Zoom in") }}" class="NMaps-popup-zoom-in"></div>\n            <div title="{{gettext("Zoom out") }}" class="NMaps-popup-zoom-out"></div>\n            {{if withTip }}\n            <div class="NMaps-popup-tip NMaps-popup-tip-z"></div>\n            {{/if}}\n        </div>\n    {{/if}}\n    {{if typeof withTip !=\'undefined\' && withTip }}\n    <div class="NMaps-popup-tip NMaps-popup-tip-d"></div>\n    {{/if}}\n</div>\n';
b.Template._templates["popup-vtip-layout"]='<div class="NMaps-popup-wrapper NMaps-popup-vtip">\n    {{html popupContent }}\n    <div class="c_tip">\n        <div class="c_tip_o"></div>\n        <div class="c_tip_i"></div>\n    </div>\n</div>\n';b.Template._templates["marker-popup"]='<div class="NMaps-marker-name">${name}</div>\n<div class="NMaps-marker-description">${description}</div>\n';b.Template._templates["route-popup"]='{{if contextMarker }}\n    <ul class="NMaps-route-menu without-heading">\n        <li>\n            <div class="NMaps-proute-link navi-button route-delete-point" role="route-remove-point">\n                <span>{{pgettext("Routing", "Remove route\'s point") }}</span>\n            </div>\n        </li>\n    </ul>\n{{else}}\n    <dt class="nowrap">{{pgettext("Menu section", "Get directions") }}:</dt>\n    <dd>\n        <ul class="NMaps-route-menu">\n            <li>\n                <div class="NMaps-proute-link navi-button add-start-point" role="route-add-start-point">\n                    {{pgettext("Routing: add start point", "Start") }}\n                </div>\n                <div class="NMaps-proute-link navi-button add-end-point" role="route-add-end-point">\n                    {{pgettext("Routing: add end point", "Destination") }}\n                </div>\n            </li>\n    {{if state & (States.START_END | States.MORE) }}\n            <li>\n                <div class="NMaps-proute-link navi-button add-middle-point" role="route-add-middle-point">\n                    {{pgettext("Routing: add middle point", "Visit") }}\n                </div>\n            </li>\n    {{/if}}\n    {{if state & (States.START_END | States.MORE) }}\n            <li>\n                <div class="NMaps-proute-link navi-button route-delete" role="route-delete">\n                    {{gettext("Delete route") }}\n                </div>\n            </li>\n    {{/if}}\n        </ul>\n    </dd>\n{{/if}}\n\n\n\n';
b.Template.updateContext({map_search_input_sfx:"-native"});return b}();

NMaps.i18n._messages['ru'] = {"http_errors": {"": {"PO-Revision-Date": "2011-06-28 10:47+0700", "Content-Transfer-Encoding": "8bit", "Plural-Forms": "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "Project-Id-Version": "Navitel.Maps VERSION", "Report-Msgid-Bugs-To": "EMAIL@ADDRESS", "Generated-By": "Babel r.#623\n", "Last-Translator": "Andrey Rublev <a_rublev@ac-sw.com>", "Language-Team": "ru <LL@li.org>", "POT-Creation-Date": "2011-06-24 17:03+0700", "Content-Type": "text/plain; charset=utf-8", "MIME-Version": "1.0"}, "error408": [null, "\u0418\u0441\u0442\u0435\u043a\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430"], "error409": [null, "\u0417\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0438\u0437-\u0437\u0430 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0443"], "error415": [null, "\u041d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445"], "error414": [null, "\u0417\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u044b\u0439 URI \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u044b\u0439"], "error417": [null, "\u0421\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430"], "error416": [null, "\u0417\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c"], "error411": [null, "\u0421\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c Content-Length"], "error410": [null, "\u0417\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435"], "error413": [null, "\u0420\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0432\u0435\u043b\u0438\u043a"], "error412": [null, "\u041f\u0440\u0435\u0434\u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u043e\u0434\u043d\u0438\u043c \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (request-header), \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043b\u043e\u0436\u043d\u044b\u043c \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c"], "error503": [null, "Service Unavailable - \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0435 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 (\u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d \u0438\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0442\u0435\u0445\u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0438)"], "error502": [null, "Bad Gateway - \u0441\u0435\u0440\u0432\u0435\u0440, \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0439 (\u043d\u0435\u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u044b\u0439) \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043e\u043d \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u043b \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430"], "error501": [null, "Not Implemented - \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0439 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430"], "error500": [null, "Internal Server Error - \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430"], "error505": [null, "\u041d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f HTTP"], "error504": [null, "Gateway Timeout - \u0441\u0435\u0440\u0432\u0435\u0440, \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0437\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043e\u043d \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u043b \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430"], "error402": [null, "\u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u043f\u043b\u0430\u0442\u0430"], "error403": [null, "\u0412 \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0443 \u043e\u0442\u043a\u0430\u0437\u0430\u043d\u043e"], "error400": [null, "\u0421\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u0441\u043c\u043e\u0433 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441"], "error401": [null, "\u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f"], "error406": [null, "\u0417\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0439 URI \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u043c \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430\u043c"], "error407": [null, "\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043b\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440"], "error404": [null, "\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d"], "error405": [null, "\u0412 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u043c\u0435\u0442\u043e\u0434"]}, "openlayers": {"": {"PO-Revision-Date": "2011-06-27 15:52+0700", "Content-Transfer-Encoding": "8bit", "Plural-Forms": "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "Project-Id-Version": "Navitel.Maps VERSION", "Report-Msgid-Bugs-To": "EMAIL@ADDRESS", "Generated-By": "Babel r.#623\n", "Last-Translator": "FULL NAME <EMAIL@ADDRESS>", "Language-Team": "ru <LL@li.org>", "POT-Creation-Date": "2011-06-24 17:03+0700", "Content-Type": "text/plain; charset=utf-8", "MIME-Version": "1.0"}, "Permalink": [null, "\u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430"]}, "messages": {"": {"PO-Revision-Date": "2011-06-28 12:10+0700", "Content-Transfer-Encoding": "8bit", "Plural-Forms": "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "Project-Id-Version": "Navitel.Maps VERSION", "Report-Msgid-Bugs-To": "EMAIL@ADDRESS", "Generated-By": "Babel r.#623\n", "Last-Translator": "Andrey Rublev <a_rublev@ac-sw.com>", "Language-Team": "ru <LL@li.org>", "POT-Creation-Date": "2012-01-11 15:05+0700", "Content-Type": "text/plain; charset=utf-8", "MIME-Version": "1.0"}, "Routing: add end point\u0004Destination": [null, "\u0421\u044e\u0434\u0430"], "Internal server error": [null, "Internal Server Error - \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430"], "Latitude": [null, "\u0428\u0438\u0440\u043e\u0442\u0430"], "Navitel.Maps: printable version": [null, "\u041d\u0430\u0432\u0438\u0442\u0435\u043b \u043f\u0440\u043e\u0431\u043a\u0438: \u0432\u0435\u0440\u0441\u0438\u044f \u0434\u043b\u044f \u043f\u0435\u0447\u0430\u0442\u0438"], "Unable to find": [null, "\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438"], "Show routes layer": [null, "\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043b\u043e\u0439 \u0441 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u043c\u0438"], "Too many points in the route": [null, "\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0442\u043e\u0447\u0435\u043a \u0432 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0435"], "Print": [null, "\u041f\u0435\u0447\u0430\u0442\u044c"], "The server is currently unavailable (because it is overloaded or down for maintenance)": [null, "Service Unavailable - \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0435 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 (\u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d \u0438\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0442\u0435\u0445\u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0438)"], "Zoom in": [null, "\u041f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u044c"], "Search is temporarily unavailable": [null, "\u041f\u043e\u0438\u0441\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442"], "Popup click point\u0004Coordinates of point": [null, "\u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0442\u043e\u0447\u043a\u0438"], "Routing: add middle point\u0004Visit": [null, "\u0417\u0430\u0435\u0445\u0430\u0442\u044c"], "Zoom out": [null, "\u041e\u0442\u0434\u0430\u043b\u0438\u0442\u044c"], "Try changing your search terms": [null, "\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430"], "Find": [null, "\u041d\u0430\u0439\u0442\u0438"], "m.": [null, "\u043c."], "Unhandled request return %1": [null, "\u041d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u0435\u0440\u043d\u0443\u043b %1"], "Routing\u0004Remove route's point": [null, "\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0442\u043e\u0447\u043a\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430"], "Open print version": [null, "\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u043b\u044f \u043f\u0435\u0447\u0430\u0442\u0438"], "Unable to build route on the specified route points": [null, "\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0442\u043e\u0447\u043a\u0430\u043c"], "Menu section\u0004Get directions": [null, "\u041f\u0440\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442"], "Incorrect coordinates of a point": [null, "\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0442\u043e\u0447\u043a\u0438"], "Routing: add start point\u0004Start": [null, "\u041e\u0442\u0441\u044e\u0434\u0430"], "Search": [null, "\u041f\u043e\u0438\u0441\u043a"], "Resource not found": [null, "\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d"], "Show jams layer": [null, "\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043b\u043e\u0439 \u0441 \u043f\u0440\u043e\u0431\u043a\u0430\u043c\u0438"], "Longitude": [null, "\u0414\u043e\u043b\u0433\u043e\u0442\u0430"], "Routes: incorrect syntax": [null, "\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u044b: \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441"], "Incorrect radius of insensitivity": [null, "\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0440\u0430\u0434\u0438\u0443\u0441 \u043d\u0435\u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438"], "Hide routes layer": [null, "\u0421\u043a\u0440\u044b\u0442\u044c \u0441\u043b\u043e\u0439 \u0441 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u043c"], "Too few points in the route": [null, "\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u043e \u0442\u043e\u0447\u0435\u043a \u0432 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0435"], "Routes: incorrect protocol version": [null, "\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u044b: \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430"], "WSG84\u0004E": [null, ""], "km.": [null, "\u043a\u043c."], "The route server returned a reply with an unknown error": [null, "\u0421\u0435\u0440\u0432\u0435\u0440 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u0432\u0435\u0440\u043d\u0443\u043b \u043e\u0442\u0432\u0435\u0442 \u0441 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439"], "WSG84\u0004N": [null, ""], "Unlock map dragging": [null, "\u0420\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u044b"], "Search results": [null, "\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0438\u0441\u043a\u0430"], "WSG84\u0004S": [null, ""], "Hide jams layer": [null, "\u0421\u043a\u0440\u044b\u0442\u044c \u0441\u043b\u043e\u0439 \u0441 \u043f\u0440\u043e\u0431\u043a\u0430\u043c\u0438"], "WSG84\u0004W": [null, ""], "Incorrect ID route": [null, "\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 ID \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430"], "Home": [null, "\u0414\u043e\u043c\u043e\u0439"], "Delete route": [null, "\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442"], "Lock map dragging": [null, "\u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u044b"], "Incorrect number of points when you add/move/delete": [null, "\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0442\u043e\u0447\u043a\u0438 \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438/\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438"]}}

