Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wax

Package Overview
Dependencies
Maintainers
5
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wax - npm Package Compare versions

Comparing version 3.0.5 to 3.0.6

_site/attribution-md.html

11

CHANGELOG.md
## Changelog
### 3.0.6
* Update [reqwest](https://github.com/ded/reqwest) to 0.2.7 for IE9 compatibility.
* Parse `matrix()` CSS transforms for IE9 compatibility.
* Fix to `wax.mm.interaction()` on dragging outside of the map.
### 3.0.5
* `bwdetect` refactored to be compatible with Google Maps.
* Tests for `bwdetect`, `gridFeature`.
### 3.0.4

@@ -4,0 +15,0 @@

12

control/lib/util.js

@@ -23,7 +23,8 @@ var wax = wax || {};

// Add additional CSS3 transform handling.
// These features are used by Google Maps API V3.
var style = el.style.transform ||
el.style['-webkit-transform'] ||
el.style.MozTransform;
el.style.WebkitTransform ||
el.style.OTransform ||
el.style.MozTransform ||
el.style.msTransform;
if (style) {

@@ -40,2 +41,5 @@ if (match = style.match(/translate\((.+)px, (.+)px\)/)) {

left += parseInt(pts[12], 10);
} else if (match = style.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/)) {
top += parseInt(match[2], 10);
left += parseInt(match[1], 10);
}

@@ -42,0 +46,0 @@ }

@@ -12,3 +12,5 @@ wax = wax || {};

wax.mm.fullscreen = function(map) {
var state = 1,
// true: fullscreen
// false: minimized
var state = false,
fullscreen = {},

@@ -20,3 +22,3 @@ a,

if (e) com.modestmaps.cancelEvent(e);
if (state = !state) {
if (state) {
fullscreen.original();

@@ -40,2 +42,3 @@ } else {

fullscreen.full = function() {
if (state) { return; } else { state = true; }
smallSize = [map.parent.offsetWidth, map.parent.offsetHeight];

@@ -48,2 +51,3 @@ map.parent.className += ' wax-fullscreen-map';

fullscreen.original = function() {
if (!state) { return; } else { state = false; }
map.parent.className = map.parent.className.replace('wax-fullscreen-map', '');

@@ -50,0 +54,0 @@ map.setSize(

@@ -135,3 +135,3 @@ wax = wax || {};

if (e.type === 'mousedown') {
MM.addEvent(map.parent, 'mouseup', onUp);
MM.addEvent(document.body, 'mouseup', onUp);

@@ -165,3 +165,3 @@ // Only track single-touches. Double-touches will not affect this

MM.removeEvent(map.parent, 'mouseup', onUp);
MM.removeEvent(document.body, 'mouseup', onUp);
if (map.parent.ontouchend) {

@@ -168,0 +168,0 @@ MM.removeEvent(map.parent, 'touchend', onUp);

@@ -1,6 +0,6 @@

/* wax - 3.0.5 - 1.0.4-361-g59892a1 */
/* wax - 3.0.6 - 1.0.4-372-g3e9b147 */
/*!
* Reqwest! A x-browser general purpose XHR connection manager
* Reqwest! A general purpose XHR connection manager
* copyright Dustin Diaz 2011

@@ -10,4 +10,3 @@ * https://github.com/ded/reqwest

*/
!function(window){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText,JSON;switch(type){case"json":resp=JSON?JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){if(/\.json$/.test(a))return"json";if(/\.jsonp$/.test(a))return"jsonp";if(/\.js$/.test(a))return"js";if(/\.html?$/.test(a))return"html";if(/\.xml$/.test(a))return"xml";return"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var f=xhr();f.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(f,a),f.onreadystatechange=readyState(f,b,c),a.before&&a.before(f),f.send(a.data||null);return f}var d=doc.createElement("script");window[getCallbackName(a)]=generalCallback,d.type="text/javascript",d.src=a.url,d.async=!0;var e=function(){a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(d)};d.onload=e,d.onreadystatechange=function(){/^loaded|complete$/.test(d.readyState)&&e()},head.appendChild(d)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest");if(b.data){c["Content-type"]=c["Content-type"]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}}function readyState(a,b,c){return function(){a&&a.readyState==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",head=doc[byTag]("head")[0],xhr="XMLHttpRequest"in window?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")},uniqid=0,lastValue;Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=a[byTag]("input"),c=a[byTag]("select"),d=a[byTag]("textarea");return(v(b).chain().toArray().map(serial).value().join("")+v(c).chain().toArray().map(serial).value().join("")+v(d).chain().toArray().map(serial).value().join("")).replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=window.reqwest;reqwest.noConflict=function(){window.reqwest=old;return this},window.reqwest=reqwest}(this)
// Instantiate objects based on a JSON "record". The record must be a statement
!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){if(/\.json$/.test(a))return"json";if(/\.jsonp$/.test(a))return"jsonp";if(/\.js$/.test(a))return"js";if(/\.html?$/.test(a))return"html";if(/\.xml$/.test(a))return"xml";return"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var f=xhr();f.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(f,a),f.onreadystatechange=handleReadyState(f,b,c),a.before&&a.before(f),f.send(a.data||null);return f}var d=doc.createElement("script"),e=0;win[getCallbackName(a)]=generalCallback,d.type="text/javascript",d.src=a.url,d.async=!0,d.onload=d.onreadystatechange=function(){if(d[readyState]&&d[readyState]!=="complete"&&d[readyState]!=="loaded"||e)return!1;d.onload=d.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(d),e=1},head.appendChild(d)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){context.reqwest=old;return this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window)// Instantiate objects based on a JSON "record". The record must be a statement
// array in the following form:

@@ -727,7 +726,8 @@ //

// Add additional CSS3 transform handling.
// These features are used by Google Maps API V3.
var style = el.style.transform ||
el.style['-webkit-transform'] ||
el.style.MozTransform;
el.style.WebkitTransform ||
el.style.OTransform ||
el.style.MozTransform ||
el.style.msTransform;
if (style) {

@@ -744,2 +744,5 @@ if (match = style.match(/translate\((.+)px, (.+)px\)/)) {

left += parseInt(pts[12], 10);
} else if (match = style.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/)) {
top += parseInt(match[2], 10);
left += parseInt(match[1], 10);
}

@@ -746,0 +749,0 @@ }

@@ -1,6 +0,6 @@

/* wax - 3.0.5 - 1.0.4-361-g59892a1 *//*!
* Reqwest! A x-browser general purpose XHR connection manager
/* wax - 3.0.6 - 1.0.4-372-g3e9b147 *//*!
* Reqwest! A general purpose XHR connection manager
* copyright Dustin Diaz 2011
* https://github.com/ded/reqwest
* license MIT
*/!function(window){function readyState(a,b,c){return function(){a&&a.readyState==4&&(twoHundo.test(a.status)?b(a):c(a))}}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest");if(b.data){c["Content-type"]=c["Content-type"]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function generalCallback(a){lastValue=a}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=readyState(d,b,c),a.before&&a.before(d),d.send(a.data||null);return d}var e=doc.createElement("script");window[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0;var f=function(){a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e)};e.onload=f,e.onreadystatechange=function(){/^loaded|complete$/.test(e.readyState)&&f()},head.appendChild(e)}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function setType(a){if(/\.json$/.test(a))return"json";if(/\.jsonp$/.test(a))return"jsonp";if(/\.js$/.test(a))return"js";if(/\.html?$/.test(a))return"html";if(/\.xml$/.test(a))return"xml";return"js"}function init(o,fn){function complete(a){o.complete&&o.complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText,JSON;switch(type){case"json":resp=JSON?JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function error(a){o.error&&o.error(a),complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function reqwest(a,b){return new Reqwest(a,b)}function enc(a){return encodeURIComponent(a)}function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",head=doc[byTag]("head")[0],xhr="XMLHttpRequest"in window?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")},uniqid=0,lastValue;Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=a[byTag]("input"),c=a[byTag]("select"),d=a[byTag]("textarea");return(v(b).chain().toArray().map(serial).value().join("")+v(c).chain().toArray().map(serial).value().join("")+v(d).chain().toArray().map(serial).value().join("")).replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=window.reqwest;reqwest.noConflict=function(){window.reqwest=old;return this},window.reqwest=reqwest}(this);var wax=wax||{};Array.prototype.reduce||(Array.prototype.reduce=function(a){"use strict";if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;if(c==0&&arguments.length==1)throw new TypeError;var d=0,e;if(arguments.length>=2)e=arguments[1];else do{if(d in b){e=b[d++];break}if(++d>=c)throw new TypeError}while(!0);while(d<c)d in b&&(e=a.call(undefined,e,b[d],d,b)),d++;return e}),wax.Record=function(a,b){var c=function(a,b){var c=a.split(".").reduce(function(a,b){return[a[1]||a[0],a[1]?a[1][b]:a[0][b]]},[b||window,null]);if(c[0]&&c[1])return c;throw a+" not found."},d=function(a,b){var d=c(a),e;b=b.length?wax.Record(b):[];if(Object.create)e=Object.create(d[1].prototype),d[1].apply(e,b);else switch(b.length){case 0:e=new d[1];break;case 1:e=new d[1](b[0]);break;case 2:e=new d[1](b[0],b[1]);break;case 3:e=new d[1](b[0],b[1],b[2]);break;case 4:e=new d[1](b[0],b[1],b[2],b[3]);break;case 5:e=new d[1](b[0],b[1],b[2],b[3],b[4]);break;default:}return e},e=function(a,b,d){var e=c(a,d),f=b.length?wax.Record(b):[];return d&&a.indexOf(".")===-1?e[1].apply(d,f):e[1].apply(e[0],f)},f=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@literal","@chain","@inject","@group"],a.split(" ")[0])!==-1},g=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@chain"],a.split(" ")[0])!==-1},h=function(a){if(wax.util.isArray(a)&&a[0]&&f(a[0]))return{verb:a[0].split(" ")[0],subject:a[0].split(" ")[1],object:a.slice(1)};return!1},i,j=!1,k=null,l=null,m=h(a);if(!m){if(a!==null&&typeof a=="object"){var n=wax.util.keys(a);for(i=0;i<n.length;i++){var o=n[i];a[o]=wax.Record(a[o],b)}return a}return a}switch(m.verb){case"@group":for(i=0;i<m.object.length;i++)k=wax.Record(m.object[i],b),l=h(m.object[i]),l&&g(l.verb)&&(b=k);return b;case"@new":return d(m.subject,m.object);case"@literal":j=c(m.subject);return j?j[1]:null;case"@inject":return e(m.subject,m.object,b);case"@chain":return e(m.subject,m.object,b);case"@call":return e(m.subject,m.object,null)}},wax=wax||{},wax.attribution=function(){var a,b={};b.set=function(b){if(typeof b!="undefined"){a.innerHTML=b;return this}},b.element=function(){return a},b.init=function(){a=document.createElement("div"),a.className="wax-attribution";return this};return b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){g&&h();return this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add();return c},wax.formatter=function(x){var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};formatter.format=function(a,b){try{return f(a,b)}catch(c){console&&console.log(c)}};return formatter},wax.GridInstance=function(a,b,c){function f(a){a>=93&&a--,a>=35&&a--,a-=32;return a}c=c||{};var d={},e=c.resolution||4;tileSize=c.tileSize||256,d.gridFeature=function(b,c){if(!!a&&!!a.grid){if(c<0||b<0)return;if(Math.floor(c)>tileSize||Math.floor(b)>tileSize)return;var d=f(a.grid[Math.floor(c/e)].charCodeAt(Math.floor(b/e)));if(a.keys[d]&&a.data[a.keys[d]])return a.data[a.keys[d]]}},d.tileFeature=function(a,c,d,e){var f=wax.util.offset(d);feature=this.gridFeature(a-f.left,c-f.top);if(feature)return b.format(e,feature)};return d},wax.GridManager=function(a){function i(a){typeof a=="string"&&(a=[a]);return function(c){if(!!c){var d=/(\d+)\/(\d+)\/(\d+)\.[\w\._]+/g.exec(c);if(!d)return;return a[parseInt(d[2],10)%a.length].replace("{z}",d[1]).replace("{x}",d[2]).replace("{y}",d[3])}}}function h(a,b){if(typeof e!="undefined")return b(null,e);wax.request.get(f(a),function(a,c){c&&c.formatter?e=wax.formatter(c.formatter):e=!1;return b(a,e)})}a=a||{};var b=a.resolution||4,c={},d={},e,f=function(a){return a.replace(/\d+\/\d+\/\d+\.\w+/,"layer.json")},g=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};d.formatter=function(a){if(!arguments.length)return e;e=wax.formatter(a);return d},d.formatterUrl=function(a){if(!arguments.length)return f;f=typeof a=="string"?function(){return a}:a;return d},d.gridUrl=function(a){if(!arguments.length)return g;g=typeof a=="function"?a:i(a);return d},d.getGrid=function(a,c){h(a,function(d,e){var f=g(a);if(d||!e||!f)return c(d,null);wax.request.get(f,function(a,d){if(a)return c(a,null);c(null,wax.GridInstance(d,e,{resolution:b||4}))})});return d},a.formatter&&d.formatter(a.formatter),a.grids&&d.gridUrl(a.grids);return d};var wax=wax||{};wax.legend=function(){var a,b={},c;b.element=function(){return c},b.content=function(b){if(!arguments.length)return a.innerHTML;b?(a.innerHTML=b,a.style.display="block"):(a.innerHTML="",a.style.display="none");return this},b.add=function(){c=document.createElement("div"),c.className="wax-legends",a=document.createElement("div"),a.className="wax-legend",a.style.display="none",c.appendChild(a);return this};return b.add()};var w=function(a){a.melt=function(b,c){return b.apply(c,[a,c])};return a},wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(!this.locks[a]){var c=this;this.locks[a]=!0,reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}}};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(a){this._currentTooltip=undefined,a=a||{},a.animationOut&&(this.animationOut=a.animationOut),a.animationIn&&(this.animationIn=a.animationIn)},wax.tooltip.prototype.isPopup=function(a){return a&&a.className.indexOf("wax-popup")!==-1},wax.tooltip.prototype.getTooltip=function(a,b,c,d){tooltip=document.createElement("div"),tooltip.className="wax-tooltip wax-tooltip-"+c,tooltip.innerHTML=a,b.appendChild(tooltip);return tooltip},wax.tooltip.prototype.hideTooltip=function(a){if(!!a){var b,c=function(){this.parentNode&&this.parentNode.removeChild(this)};a.style["-webkit-transition"]!==undefined&&this.animationOut?b="webkitTransitionEnd":a.style.MozTransition!==undefined&&this.animationOut&&(b="transitionend"),b?(a.addEventListener(b,c,!1),a.addEventListener("transitionend",c,!1),a.className+=" "+this.animationOut):a.parentNode&&a.parentNode.removeChild(a)}},wax.tooltip.prototype.click=function(a,b,c){this.unselect(b);var d=this.getTooltip(a,b,c),e=document.createElement("a");e.href="#close",e.className="close",e.innerHTML="Close";var f=wax.util.bind(function(a){this.hideTooltip(d),this._currentTooltip=undefined,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault();return!1},this);e.addEventListener?e.addEventListener("click",f,!1):e.attachEvent&&e.attachEvent("onclick",f),d.className+=" wax-popup",d.innerHTML=a,d.appendChild(e),this._currentTooltip=d},wax.tooltip.prototype.select=function(a,b,c,d){if(!!a){if(this.isPopup(this._currentTooltip))return;this._currentTooltip=this.getTooltip(a,b,c,d),b.style.cursor="pointer"}},wax.tooltip.prototype.unselect=function(a){this.isPopup(this._currentTooltip)||(a.style.cursor="default",this._currentTooltip&&(this.hideTooltip(this._currentTooltip),this._currentTooltip=undefined))},wax.tooltip.prototype.out=wax.tooltip.prototype.unselect,wax.tooltip.prototype.over=wax.tooltip.prototype.select,wax.tooltip.prototype.click=wax.tooltip.prototype.click;var wax=wax||{};wax.util=wax.util||{},wax.util={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=0,e=0,f=function(a){if(a!==document.body&&a!==document.documentElement){d+=a.offsetTop,e+=a.offsetLeft;var b=a.style.transform||a.style["-webkit-transform"]||a.style.MozTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");d+=parseInt(c[13],10),e+=parseInt(c[12],10)}}};f(a);try{while(a=a.offsetParent)f(a)}catch(g){}d+=document.body.offsetTop,e+=document.body.offsetLeft,d+=document.body.parentNode.offsetTop,e+=document.body.parentNode.offsetLeft;var h=document.defaultView?window.getComputedStyle(document.body.parentNode,null):document.body.parentNode.currentStyle;document.body.parentNode.offsetTop!==parseInt(h.marginTop,10)&&!isNaN(parseInt(h.marginTop,10))&&(d+=parseInt(h.marginTop,10),e+=parseInt(h.marginLeft,10));return{top:d,left:e,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},bind:function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,c.concat(Array.prototype.slice.call(arguments)))}},isString:function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},isArray:Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;if(!a)var a=window.event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}}},wax=wax||{},wax.g=wax.g||{},wax.g.attribution=function(a,b){b=b||{};var c,d={};d.element=function(){return c.element()},d.appendTo=function(a){wax.util.$(a).appendChild(c.element());return this},d.init=function(){c=wax.attribution(),c.set(b.attribution),c.element().className="wax-attribution wax-g";return this};return d.init()},wax=wax||{},wax.g=wax.g||{},wax.g.bwdetect=function(a,b){b=b||{};var c=b.png||".png128",d=b.jpg||".jpg70";if(!a.mapTypes["mb-low"]){var e=a.mapTypes.mb,f={tiles:[],scheme:e.options.scheme,blankImage:e.options.blankImage,minzoom:e.minZoom,maxzoom:e.maxZoom,name:e.name,description:e.description};for(var g=0;g<e.options.tiles.length;g++)f.tiles.push(e.options.tiles[g].replace(".png",c).replace(".jpg",d));m.mapTypes.set("mb-low",new wax.g.connector(f))}return wax.bwdetect(b,function(b){a.setMapTypeId(b?"mb":"mb-low")})},wax=wax||{},wax.g=wax.g||{},wax.g.interaction=function(a,b,c){b=b||{},c=c||{};var d={modifyingEvents:["dragstart","dragend","drag","zoom_changed","resize","center_changed","bounds_changed"],waxGM:new wax.GridManager(b),callbacks:c.callbacks||new wax.tooltip,clickAction:c.clickAction||"full",add:function(){for(var b=0;b<this.modifyingEvents.length;b++)google.maps.event.addListener(a,this.modifyingEvents[b],wax.util.bind(this.clearTileGrid,this));google.maps.event.addListener(a,"mousemove",this.onMove()),google.maps.event.addListener(a,"click",this.click());return this},getTileGrid:function(){if(!this._getTileGrid){this._getTileGrid=[];var b=a.getZoom(),c=wax.util.offset(a.getDiv()),d=wax.util.bind(function(a){if(!!a.interactive)for(var d in a.cache){if(d.split("/")[0]!=b)continue;var e=wax.util.offset(a.cache[d]);this._getTileGrid.push([e.top-c.top,e.left-c.left,a.cache[d]])}},this);for(var e in a.mapTypes)d(a.mapTypes[e]);a.overlayMapTypes.forEach(d)}return this._getTileGrid},clearTileGrid:function(a,b){this._getTileGrid=null},getTile:function(a){var b,c=this.getTileGrid();for(var d=0;d<c.length;d++)if(c[d][0]<a.pixel.y&&c[d][0]+256>a.pixel.y&&c[d][1]<a.pixel.x&&c[d][1]+256>a.pixel.x){b=c[d][2];break}return b||!1},onMove:function(b){this._onMove||(this._onMove=wax.util.bind(function(b){var c=this.getTile(b);c&&this.waxGM.getGrid(c.src,wax.util.bind(function(d,e){if(!d&&!!e){var f=e.tileFeature(b.pixel.x+wax.util.offset(a.getDiv()).left,b.pixel.y+wax.util.offset(a.getDiv()).top,c,{format:"teaser"});f&&this.feature!==f?(this.feature=f,this.callbacks.out(a.getDiv()),this.callbacks.over(f,a.getDiv(),0,b)):f||(this.feature=null,this.callbacks.out(a.getDiv()))}},this))},this));return this._onMove},click:function(b){this._onClick||(this._onClick=wax.util.bind(function(b){var c=this.getTile(b);c&&this.waxGM.getGrid(c.src,wax.util.bind(function(d,e){if(!d&&!!e){var f=e.tileFeature(b.pixel.x+wax.util.offset(a.getDiv()).left,b.pixel.y+wax.util.offset(a.getDiv()).top,c,{format:this.clickAction});if(f)switch(this.clickAction){case"full":this.callbacks.click(f,a.getDiv(),0,b);break;case"location":window.location=f}}},this))},this));return this._onClick}};return d.add(a)},wax=wax||{},wax.g=wax.g||{},wax.g.legend=function(a,b){b=b||{};var c,d={};d.add=function(){c=wax.legend().content(b.legend||"");return this},d.element=function(){return c.element()},d.appendTo=function(a){wax.util.$(a).appendChild(c.element());return this};return d.add()};var wax=wax||{};wax.g=wax.g||{},wax.g.connector=function(a){a=a||{},this.options={tiles:a.tiles,scheme:a.scheme||"xyz",blankImage:a.blankImage},this.minZoom=a.minzoom||0,this.maxZoom=a.maxzoom||22,this.name=a.name||"",this.description=a.description||"",this.interactive=!0,this.tileSize=new google.maps.Size(256,256),this.cache={}},wax.g.connector.prototype.getTile=function(a,b,c){var d=b+"/"+a.x+"/"+a.y;if(!this.cache[d]){var e=this.cache[d]=new Image(256,256);this.cache[d].src=this.getTileUrl(a,b),this.cache[d].setAttribute("gTileKey",d),this.cache[d].onerror=function(){e.style.display="none"}}return this.cache[d]},wax.g.connector.prototype.releaseTile=function(a){var b=a.getAttribute("gTileKey");this.cache[b]&&delete this.cache[b],a.parentNode&&a.parentNode.removeChild(a)},wax.g.connector.prototype.getTileUrl=function(a,b){var c=Math.pow(2,b),d=this.options.scheme==="tms"?c-1-a.y:d,e=a.x%c;e=e<0?a.x%c+c:e;if(d<0)return this.options.blankImage;return this.options.tiles[parseInt(e+d,10)%this.options.tiles.length].replace("{z}",b).replace("{x}",e).replace("{y}",d)}
*/!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();return d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=handleReadyState(d,b,c),a.before&&a.before(d),d.send(a.data||null),d}var e=doc.createElement("script"),f=0;win[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0,e.onload=e.onreadystatechange=function(){if(e[readyState]&&e[readyState]!=="complete"&&e[readyState]!=="loaded"||f)return!1;e.onload=e.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e),f=1},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;return a.url=a.url.substr(0,a.url.length-1)+c,c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){return context.reqwest=old,this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window);var wax=wax||{};Array.prototype.reduce||(Array.prototype.reduce=function(a){"use strict";if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;if(c==0&&arguments.length==1)throw new TypeError;var d=0,e;if(arguments.length>=2)e=arguments[1];else do{if(d in b){e=b[d++];break}if(++d>=c)throw new TypeError}while(!0);while(d<c)d in b&&(e=a.call(undefined,e,b[d],d,b)),d++;return e}),wax.Record=function(a,b){var c=function(a,b){var c=a.split(".").reduce(function(a,b){return[a[1]||a[0],a[1]?a[1][b]:a[0][b]]},[b||window,null]);if(c[0]&&c[1])return c;throw a+" not found."},d=function(a,b){var d=c(a),e;b=b.length?wax.Record(b):[];if(Object.create)e=Object.create(d[1].prototype),d[1].apply(e,b);else switch(b.length){case 0:e=new d[1];break;case 1:e=new d[1](b[0]);break;case 2:e=new d[1](b[0],b[1]);break;case 3:e=new d[1](b[0],b[1],b[2]);break;case 4:e=new d[1](b[0],b[1],b[2],b[3]);break;case 5:e=new d[1](b[0],b[1],b[2],b[3],b[4]);break;default:}return e},e=function(a,b,d){var e=c(a,d),f=b.length?wax.Record(b):[];return d&&a.indexOf(".")===-1?e[1].apply(d,f):e[1].apply(e[0],f)},f=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@literal","@chain","@inject","@group"],a.split(" ")[0])!==-1},g=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@chain"],a.split(" ")[0])!==-1},h=function(a){return wax.util.isArray(a)&&a[0]&&f(a[0])?{verb:a[0].split(" ")[0],subject:a[0].split(" ")[1],object:a.slice(1)}:!1},i,j=!1,k=null,l=null,m=h(a);if(!m){if(a!==null&&typeof a=="object"){var n=wax.util.keys(a);for(i=0;i<n.length;i++){var o=n[i];a[o]=wax.Record(a[o],b)}return a}return a}switch(m.verb){case"@group":for(i=0;i<m.object.length;i++)k=wax.Record(m.object[i],b),l=h(m.object[i]),l&&g(l.verb)&&(b=k);return b;case"@new":return d(m.subject,m.object);case"@literal":return j=c(m.subject),j?j[1]:null;case"@inject":return e(m.subject,m.object,b);case"@chain":return e(m.subject,m.object,b);case"@call":return e(m.subject,m.object,null)}},wax=wax||{},wax.attribution=function(){var a,b={};return b.set=function(b){if(typeof b=="undefined")return;return a.innerHTML=b,this},b.element=function(){return a},b.init=function(){return a=document.createElement("div"),a.className="wax-attribution",this},b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;return c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){return g&&h(),this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add(),c},wax.formatter=function(x){var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};return formatter.format=function(a,b){try{return f(a,b)}catch(c){console&&console.log(c)}},formatter},wax.GridInstance=function(a,b,c){function f(a){return a>=93&&a--,a>=35&&a--,a-=32,a}c=c||{};var d={},e=c.resolution||4;return tileSize=c.tileSize||256,d.gridFeature=function(b,c){if(!a||!a.grid)return;if(c<0||b<0)return;if(Math.floor(c)>tileSize||Math.floor(b)>tileSize)return;var d=f(a.grid[Math.floor(c/e)].charCodeAt(Math.floor(b/e)));if(a.keys[d]&&a.data[a.keys[d]])return a.data[a.keys[d]]},d.tileFeature=function(a,c,d,e){var f=wax.util.offset(d);feature=this.gridFeature(a-f.left,c-f.top);if(feature)return b.format(e,feature)},d},wax.GridManager=function(a){function h(a,b){if(typeof e!="undefined")return b(null,e);wax.request.get(f(a),function(a,c){return c&&c.formatter?e=wax.formatter(c.formatter):e=!1,b(a,e)})}function i(a){return typeof a=="string"&&(a=[a]),function b(b){if(!b)return;var c=/(\d+)\/(\d+)\/(\d+)\.[\w\._]+/g.exec(b);if(!c)return;return a[parseInt(c[2],10)%a.length].replace("{z}",c[1]).replace("{x}",c[2]).replace("{y}",c[3])}}a=a||{};var b=a.resolution||4,c={},d={},e,f=function(a){return a.replace(/\d+\/\d+\/\d+\.\w+/,"layer.json")},g=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};return d.formatter=function(a){return arguments.length?(e=wax.formatter(a),d):e},d.formatterUrl=function(a){return arguments.length?(f=typeof a=="string"?function(){return a}:a,d):f},d.gridUrl=function(a){return arguments.length?(g=typeof a=="function"?a:i(a),d):g},d.getGrid=function(a,c){return h(a,function(d,e){var f=g(a);if(d||!e||!f)return c(d,null);wax.request.get(f,function(a,d){if(a)return c(a,null);c(null,wax.GridInstance(d,e,{resolution:b||4}))})}),d},a.formatter&&d.formatter(a.formatter),a.grids&&d.gridUrl(a.grids),d};var wax=wax||{};wax.legend=function(){var a,b={},c;return b.element=function(){return c},b.content=function(b){return arguments.length?(b?(a.innerHTML=b,a.style.display="block"):(a.innerHTML="",a.style.display="none"),this):a.innerHTML},b.add=function(){return c=document.createElement("div"),c.className="wax-legends",a=document.createElement("div"),a.className="wax-legend",a.style.display="none",c.appendChild(a),this},b.add()};var w=function(a){return a.melt=function(b,c){return b.apply(c,[a,c])},a},wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(this.locks[a])return;var c=this;this.locks[a]=!0,reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(a){this._currentTooltip=undefined,a=a||{},a.animationOut&&(this.animationOut=a.animationOut),a.animationIn&&(this.animationIn=a.animationIn)},wax.tooltip.prototype.isPopup=function(a){return a&&a.className.indexOf("wax-popup")!==-1},wax.tooltip.prototype.getTooltip=function(a,b,c,d){return tooltip=document.createElement("div"),tooltip.className="wax-tooltip wax-tooltip-"+c,tooltip.innerHTML=a,b.appendChild(tooltip),tooltip},wax.tooltip.prototype.hideTooltip=function(a){if(!a)return;var b,c=function(){this.parentNode&&this.parentNode.removeChild(this)};a.style["-webkit-transition"]!==undefined&&this.animationOut?b="webkitTransitionEnd":a.style.MozTransition!==undefined&&this.animationOut&&(b="transitionend"),b?(a.addEventListener(b,c,!1),a.addEventListener("transitionend",c,!1),a.className+=" "+this.animationOut):a.parentNode&&a.parentNode.removeChild(a)},wax.tooltip.prototype.click=function(a,b,c){this.unselect(b);var d=this.getTooltip(a,b,c),e=document.createElement("a");e.href="#close",e.className="close",e.innerHTML="Close";var f=wax.util.bind(function(a){return this.hideTooltip(d),this._currentTooltip=undefined,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),!1},this);e.addEventListener?e.addEventListener("click",f,!1):e.attachEvent&&e.attachEvent("onclick",f),d.className+=" wax-popup",d.innerHTML=a,d.appendChild(e),this._currentTooltip=d},wax.tooltip.prototype.select=function(a,b,c,d){if(!a)return;if(this.isPopup(this._currentTooltip))return;this._currentTooltip=this.getTooltip(a,b,c,d),b.style.cursor="pointer"},wax.tooltip.prototype.unselect=function(a){if(this.isPopup(this._currentTooltip))return;a.style.cursor="default",this._currentTooltip&&(this.hideTooltip(this._currentTooltip),this._currentTooltip=undefined)},wax.tooltip.prototype.out=wax.tooltip.prototype.unselect,wax.tooltip.prototype.over=wax.tooltip.prototype.select,wax.tooltip.prototype.click=wax.tooltip.prototype.click;var wax=wax||{};wax.util=wax.util||{},wax.util={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=0,e=0,f=function(a){if(a===document.body||a===document.documentElement)return;d+=a.offsetTop,e+=a.offsetLeft;var b=a.style.transform||a.style.WebkitTransform||a.style.OTransform||a.style.MozTransform||a.style.msTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");d+=parseInt(c[13],10),e+=parseInt(c[12],10)}else if(match=b.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10)};f(a);try{while(a=a.offsetParent)f(a)}catch(g){}d+=document.body.offsetTop,e+=document.body.offsetLeft,d+=document.body.parentNode.offsetTop,e+=document.body.parentNode.offsetLeft;var h=document.defaultView?window.getComputedStyle(document.body.parentNode,null):document.body.parentNode.currentStyle;return document.body.parentNode.offsetTop!==parseInt(h.marginTop,10)&&!isNaN(parseInt(h.marginTop,10))&&(d+=parseInt(h.marginTop,10),e+=parseInt(h.marginLeft,10)),{top:d,left:e,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},bind:function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,c.concat(Array.prototype.slice.call(arguments)))}},isString:function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},isArray:Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;if(!a)var a=window.event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}}},wax=wax||{},wax.g=wax.g||{},wax.g.attribution=function(a,b){b=b||{};var c,d={};return d.element=function(){return c.element()},d.appendTo=function(a){return wax.util.$(a).appendChild(c.element()),this},d.init=function(){return c=wax.attribution(),c.set(b.attribution),c.element().className="wax-attribution wax-g",this},d.init()},wax=wax||{},wax.g=wax.g||{},wax.g.bwdetect=function(a,b){b=b||{};var c=b.png||".png128",d=b.jpg||".jpg70";if(!a.mapTypes["mb-low"]){var e=a.mapTypes.mb,f={tiles:[],scheme:e.options.scheme,blankImage:e.options.blankImage,minzoom:e.minZoom,maxzoom:e.maxZoom,name:e.name,description:e.description};for(var g=0;g<e.options.tiles.length;g++)f.tiles.push(e.options.tiles[g].replace(".png",c).replace(".jpg",d));m.mapTypes.set("mb-low",new wax.g.connector(f))}return wax.bwdetect(b,function(b){a.setMapTypeId(b?"mb":"mb-low")})},wax=wax||{},wax.g=wax.g||{},wax.g.interaction=function(a,b,c){b=b||{},c=c||{};var d={modifyingEvents:["dragstart","dragend","drag","zoom_changed","resize","center_changed","bounds_changed"],waxGM:new wax.GridManager(b),callbacks:c.callbacks||new wax.tooltip,clickAction:c.clickAction||"full",add:function(){for(var b=0;b<this.modifyingEvents.length;b++)google.maps.event.addListener(a,this.modifyingEvents[b],wax.util.bind(this.clearTileGrid,this));return google.maps.event.addListener(a,"mousemove",this.onMove()),google.maps.event.addListener(a,"click",this.click()),this},getTileGrid:function(){if(!this._getTileGrid){this._getTileGrid=[];var b=a.getZoom(),c=wax.util.offset(a.getDiv()),d=wax.util.bind(function(a){if(!a.interactive)return;for(var d in a.cache){if(d.split("/")[0]!=b)continue;var e=wax.util.offset(a.cache[d]);this._getTileGrid.push([e.top-c.top,e.left-c.left,a.cache[d]])}},this);for(var e in a.mapTypes)d(a.mapTypes[e]);a.overlayMapTypes.forEach(d)}return this._getTileGrid},clearTileGrid:function(a,b){this._getTileGrid=null},getTile:function(a){var b,c=this.getTileGrid();for(var d=0;d<c.length;d++)if(c[d][0]<a.pixel.y&&c[d][0]+256>a.pixel.y&&c[d][1]<a.pixel.x&&c[d][1]+256>a.pixel.x){b=c[d][2];break}return b||!1},onMove:function(b){return this._onMove||(this._onMove=wax.util.bind(function(b){var c=this.getTile(b);c&&this.waxGM.getGrid(c.src,wax.util.bind(function(d,e){if(d||!e)return;var f=e.tileFeature(b.pixel.x+wax.util.offset(a.getDiv()).left,b.pixel.y+wax.util.offset(a.getDiv()).top,c,{format:"teaser"});f&&this.feature!==f?(this.feature=f,this.callbacks.out(a.getDiv()),this.callbacks.over(f,a.getDiv(),0,b)):f||(this.feature=null,this.callbacks.out(a.getDiv()))},this))},this)),this._onMove},click:function(b){return this._onClick||(this._onClick=wax.util.bind(function(b){var c=this.getTile(b);c&&this.waxGM.getGrid(c.src,wax.util.bind(function(d,e){if(d||!e)return;var f=e.tileFeature(b.pixel.x+wax.util.offset(a.getDiv()).left,b.pixel.y+wax.util.offset(a.getDiv()).top,c,{format:this.clickAction});if(f)switch(this.clickAction){case"full":this.callbacks.click(f,a.getDiv(),0,b);break;case"location":window.location=f}},this))},this)),this._onClick}};return d.add(a)},wax=wax||{},wax.g=wax.g||{},wax.g.legend=function(a,b){b=b||{};var c,d={};return d.add=function(){return c=wax.legend().content(b.legend||""),this},d.element=function(){return c.element()},d.appendTo=function(a){return wax.util.$(a).appendChild(c.element()),this},d.add()};var wax=wax||{};wax.g=wax.g||{},wax.g.connector=function(a){a=a||{},this.options={tiles:a.tiles,scheme:a.scheme||"xyz",blankImage:a.blankImage},this.minZoom=a.minzoom||0,this.maxZoom=a.maxzoom||22,this.name=a.name||"",this.description=a.description||"",this.interactive=!0,this.tileSize=new google.maps.Size(256,256),this.cache={}},wax.g.connector.prototype.getTile=function(a,b,c){var d=b+"/"+a.x+"/"+a.y;if(!this.cache[d]){var e=this.cache[d]=new Image(256,256);this.cache[d].src=this.getTileUrl(a,b),this.cache[d].setAttribute("gTileKey",d),this.cache[d].onerror=function(){e.style.display="none"}}return this.cache[d]},wax.g.connector.prototype.releaseTile=function(a){var b=a.getAttribute("gTileKey");this.cache[b]&&delete this.cache[b],a.parentNode&&a.parentNode.removeChild(a)},wax.g.connector.prototype.getTileUrl=function(a,b){var c=Math.pow(2,b),d=this.options.scheme==="tms"?c-1-a.y:d,e=a.x%c;return e=e<0?a.x%c+c:e,d<0?this.options.blankImage:this.options.tiles[parseInt(e+d,10)%this.options.tiles.length].replace("{z}",b).replace("{x}",e).replace("{y}",d)}

@@ -1,6 +0,6 @@

/* wax - 3.0.5 - 1.0.4-361-g59892a1 */
/* wax - 3.0.6 - 1.0.4-372-g3e9b147 */
/*!
* Reqwest! A x-browser general purpose XHR connection manager
* Reqwest! A general purpose XHR connection manager
* copyright Dustin Diaz 2011

@@ -10,4 +10,3 @@ * https://github.com/ded/reqwest

*/
!function(window){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText,JSON;switch(type){case"json":resp=JSON?JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){if(/\.json$/.test(a))return"json";if(/\.jsonp$/.test(a))return"jsonp";if(/\.js$/.test(a))return"js";if(/\.html?$/.test(a))return"html";if(/\.xml$/.test(a))return"xml";return"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var f=xhr();f.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(f,a),f.onreadystatechange=readyState(f,b,c),a.before&&a.before(f),f.send(a.data||null);return f}var d=doc.createElement("script");window[getCallbackName(a)]=generalCallback,d.type="text/javascript",d.src=a.url,d.async=!0;var e=function(){a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(d)};d.onload=e,d.onreadystatechange=function(){/^loaded|complete$/.test(d.readyState)&&e()},head.appendChild(d)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest");if(b.data){c["Content-type"]=c["Content-type"]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}}function readyState(a,b,c){return function(){a&&a.readyState==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",head=doc[byTag]("head")[0],xhr="XMLHttpRequest"in window?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")},uniqid=0,lastValue;Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=a[byTag]("input"),c=a[byTag]("select"),d=a[byTag]("textarea");return(v(b).chain().toArray().map(serial).value().join("")+v(c).chain().toArray().map(serial).value().join("")+v(d).chain().toArray().map(serial).value().join("")).replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=window.reqwest;reqwest.noConflict=function(){window.reqwest=old;return this},window.reqwest=reqwest}(this)
// Instantiate objects based on a JSON "record". The record must be a statement
!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){if(/\.json$/.test(a))return"json";if(/\.jsonp$/.test(a))return"jsonp";if(/\.js$/.test(a))return"js";if(/\.html?$/.test(a))return"html";if(/\.xml$/.test(a))return"xml";return"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var f=xhr();f.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(f,a),f.onreadystatechange=handleReadyState(f,b,c),a.before&&a.before(f),f.send(a.data||null);return f}var d=doc.createElement("script"),e=0;win[getCallbackName(a)]=generalCallback,d.type="text/javascript",d.src=a.url,d.async=!0,d.onload=d.onreadystatechange=function(){if(d[readyState]&&d[readyState]!=="complete"&&d[readyState]!=="loaded"||e)return!1;d.onload=d.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(d),e=1},head.appendChild(d)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){context.reqwest=old;return this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window)// Instantiate objects based on a JSON "record". The record must be a statement
// array in the following form:

@@ -727,7 +726,8 @@ //

// Add additional CSS3 transform handling.
// These features are used by Google Maps API V3.
var style = el.style.transform ||
el.style['-webkit-transform'] ||
el.style.MozTransform;
el.style.WebkitTransform ||
el.style.OTransform ||
el.style.MozTransform ||
el.style.msTransform;
if (style) {

@@ -744,2 +744,5 @@ if (match = style.match(/translate\((.+)px, (.+)px\)/)) {

left += parseInt(pts[12], 10);
} else if (match = style.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/)) {
top += parseInt(match[2], 10);
left += parseInt(match[1], 10);
}

@@ -746,0 +749,0 @@ }

@@ -1,6 +0,6 @@

/* wax - 3.0.5 - 1.0.4-361-g59892a1 *//*!
* Reqwest! A x-browser general purpose XHR connection manager
/* wax - 3.0.6 - 1.0.4-372-g3e9b147 *//*!
* Reqwest! A general purpose XHR connection manager
* copyright Dustin Diaz 2011
* https://github.com/ded/reqwest
* license MIT
*/!function(window){function readyState(a,b,c){return function(){a&&a.readyState==4&&(twoHundo.test(a.status)?b(a):c(a))}}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest");if(b.data){c["Content-type"]=c["Content-type"]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function generalCallback(a){lastValue=a}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=readyState(d,b,c),a.before&&a.before(d),d.send(a.data||null);return d}var e=doc.createElement("script");window[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0;var f=function(){a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e)};e.onload=f,e.onreadystatechange=function(){/^loaded|complete$/.test(e.readyState)&&f()},head.appendChild(e)}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function setType(a){if(/\.json$/.test(a))return"json";if(/\.jsonp$/.test(a))return"jsonp";if(/\.js$/.test(a))return"js";if(/\.html?$/.test(a))return"html";if(/\.xml$/.test(a))return"xml";return"js"}function init(o,fn){function complete(a){o.complete&&o.complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText,JSON;switch(type){case"json":resp=JSON?JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function error(a){o.error&&o.error(a),complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function reqwest(a,b){return new Reqwest(a,b)}function enc(a){return encodeURIComponent(a)}function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",head=doc[byTag]("head")[0],xhr="XMLHttpRequest"in window?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")},uniqid=0,lastValue;Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=a[byTag]("input"),c=a[byTag]("select"),d=a[byTag]("textarea");return(v(b).chain().toArray().map(serial).value().join("")+v(c).chain().toArray().map(serial).value().join("")+v(d).chain().toArray().map(serial).value().join("")).replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=window.reqwest;reqwest.noConflict=function(){window.reqwest=old;return this},window.reqwest=reqwest}(this);var wax=wax||{};Array.prototype.reduce||(Array.prototype.reduce=function(a){"use strict";if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;if(c==0&&arguments.length==1)throw new TypeError;var d=0,e;if(arguments.length>=2)e=arguments[1];else do{if(d in b){e=b[d++];break}if(++d>=c)throw new TypeError}while(!0);while(d<c)d in b&&(e=a.call(undefined,e,b[d],d,b)),d++;return e}),wax.Record=function(a,b){var c=function(a,b){var c=a.split(".").reduce(function(a,b){return[a[1]||a[0],a[1]?a[1][b]:a[0][b]]},[b||window,null]);if(c[0]&&c[1])return c;throw a+" not found."},d=function(a,b){var d=c(a),e;b=b.length?wax.Record(b):[];if(Object.create)e=Object.create(d[1].prototype),d[1].apply(e,b);else switch(b.length){case 0:e=new d[1];break;case 1:e=new d[1](b[0]);break;case 2:e=new d[1](b[0],b[1]);break;case 3:e=new d[1](b[0],b[1],b[2]);break;case 4:e=new d[1](b[0],b[1],b[2],b[3]);break;case 5:e=new d[1](b[0],b[1],b[2],b[3],b[4]);break;default:}return e},e=function(a,b,d){var e=c(a,d),f=b.length?wax.Record(b):[];return d&&a.indexOf(".")===-1?e[1].apply(d,f):e[1].apply(e[0],f)},f=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@literal","@chain","@inject","@group"],a.split(" ")[0])!==-1},g=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@chain"],a.split(" ")[0])!==-1},h=function(a){if(wax.util.isArray(a)&&a[0]&&f(a[0]))return{verb:a[0].split(" ")[0],subject:a[0].split(" ")[1],object:a.slice(1)};return!1},i,j=!1,k=null,l=null,m=h(a);if(!m){if(a!==null&&typeof a=="object"){var n=wax.util.keys(a);for(i=0;i<n.length;i++){var o=n[i];a[o]=wax.Record(a[o],b)}return a}return a}switch(m.verb){case"@group":for(i=0;i<m.object.length;i++)k=wax.Record(m.object[i],b),l=h(m.object[i]),l&&g(l.verb)&&(b=k);return b;case"@new":return d(m.subject,m.object);case"@literal":j=c(m.subject);return j?j[1]:null;case"@inject":return e(m.subject,m.object,b);case"@chain":return e(m.subject,m.object,b);case"@call":return e(m.subject,m.object,null)}},wax=wax||{},wax.attribution=function(){var a,b={};b.set=function(b){if(typeof b!="undefined"){a.innerHTML=b;return this}},b.element=function(){return a},b.init=function(){a=document.createElement("div"),a.className="wax-attribution";return this};return b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){g&&h();return this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add();return c},wax.formatter=function(x){var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};formatter.format=function(a,b){try{return f(a,b)}catch(c){console&&console.log(c)}};return formatter},wax.GridInstance=function(a,b,c){function f(a){a>=93&&a--,a>=35&&a--,a-=32;return a}c=c||{};var d={},e=c.resolution||4;tileSize=c.tileSize||256,d.gridFeature=function(b,c){if(!!a&&!!a.grid){if(c<0||b<0)return;if(Math.floor(c)>tileSize||Math.floor(b)>tileSize)return;var d=f(a.grid[Math.floor(c/e)].charCodeAt(Math.floor(b/e)));if(a.keys[d]&&a.data[a.keys[d]])return a.data[a.keys[d]]}},d.tileFeature=function(a,c,d,e){var f=wax.util.offset(d);feature=this.gridFeature(a-f.left,c-f.top);if(feature)return b.format(e,feature)};return d},wax.GridManager=function(a){function i(a){typeof a=="string"&&(a=[a]);return function(c){if(!!c){var d=/(\d+)\/(\d+)\/(\d+)\.[\w\._]+/g.exec(c);if(!d)return;return a[parseInt(d[2],10)%a.length].replace("{z}",d[1]).replace("{x}",d[2]).replace("{y}",d[3])}}}function h(a,b){if(typeof e!="undefined")return b(null,e);wax.request.get(f(a),function(a,c){c&&c.formatter?e=wax.formatter(c.formatter):e=!1;return b(a,e)})}a=a||{};var b=a.resolution||4,c={},d={},e,f=function(a){return a.replace(/\d+\/\d+\/\d+\.\w+/,"layer.json")},g=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};d.formatter=function(a){if(!arguments.length)return e;e=wax.formatter(a);return d},d.formatterUrl=function(a){if(!arguments.length)return f;f=typeof a=="string"?function(){return a}:a;return d},d.gridUrl=function(a){if(!arguments.length)return g;g=typeof a=="function"?a:i(a);return d},d.getGrid=function(a,c){h(a,function(d,e){var f=g(a);if(d||!e||!f)return c(d,null);wax.request.get(f,function(a,d){if(a)return c(a,null);c(null,wax.GridInstance(d,e,{resolution:b||4}))})});return d},a.formatter&&d.formatter(a.formatter),a.grids&&d.gridUrl(a.grids);return d};var wax=wax||{};wax.legend=function(){var a,b={},c;b.element=function(){return c},b.content=function(b){if(!arguments.length)return a.innerHTML;b?(a.innerHTML=b,a.style.display="block"):(a.innerHTML="",a.style.display="none");return this},b.add=function(){c=document.createElement("div"),c.className="wax-legends",a=document.createElement("div"),a.className="wax-legend",a.style.display="none",c.appendChild(a);return this};return b.add()};var w=function(a){a.melt=function(b,c){return b.apply(c,[a,c])};return a},wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(!this.locks[a]){var c=this;this.locks[a]=!0,reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}}};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(a){this._currentTooltip=undefined,a=a||{},a.animationOut&&(this.animationOut=a.animationOut),a.animationIn&&(this.animationIn=a.animationIn)},wax.tooltip.prototype.isPopup=function(a){return a&&a.className.indexOf("wax-popup")!==-1},wax.tooltip.prototype.getTooltip=function(a,b,c,d){tooltip=document.createElement("div"),tooltip.className="wax-tooltip wax-tooltip-"+c,tooltip.innerHTML=a,b.appendChild(tooltip);return tooltip},wax.tooltip.prototype.hideTooltip=function(a){if(!!a){var b,c=function(){this.parentNode&&this.parentNode.removeChild(this)};a.style["-webkit-transition"]!==undefined&&this.animationOut?b="webkitTransitionEnd":a.style.MozTransition!==undefined&&this.animationOut&&(b="transitionend"),b?(a.addEventListener(b,c,!1),a.addEventListener("transitionend",c,!1),a.className+=" "+this.animationOut):a.parentNode&&a.parentNode.removeChild(a)}},wax.tooltip.prototype.click=function(a,b,c){this.unselect(b);var d=this.getTooltip(a,b,c),e=document.createElement("a");e.href="#close",e.className="close",e.innerHTML="Close";var f=wax.util.bind(function(a){this.hideTooltip(d),this._currentTooltip=undefined,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault();return!1},this);e.addEventListener?e.addEventListener("click",f,!1):e.attachEvent&&e.attachEvent("onclick",f),d.className+=" wax-popup",d.innerHTML=a,d.appendChild(e),this._currentTooltip=d},wax.tooltip.prototype.select=function(a,b,c,d){if(!!a){if(this.isPopup(this._currentTooltip))return;this._currentTooltip=this.getTooltip(a,b,c,d),b.style.cursor="pointer"}},wax.tooltip.prototype.unselect=function(a){this.isPopup(this._currentTooltip)||(a.style.cursor="default",this._currentTooltip&&(this.hideTooltip(this._currentTooltip),this._currentTooltip=undefined))},wax.tooltip.prototype.out=wax.tooltip.prototype.unselect,wax.tooltip.prototype.over=wax.tooltip.prototype.select,wax.tooltip.prototype.click=wax.tooltip.prototype.click;var wax=wax||{};wax.util=wax.util||{},wax.util={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=0,e=0,f=function(a){if(a!==document.body&&a!==document.documentElement){d+=a.offsetTop,e+=a.offsetLeft;var b=a.style.transform||a.style["-webkit-transform"]||a.style.MozTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");d+=parseInt(c[13],10),e+=parseInt(c[12],10)}}};f(a);try{while(a=a.offsetParent)f(a)}catch(g){}d+=document.body.offsetTop,e+=document.body.offsetLeft,d+=document.body.parentNode.offsetTop,e+=document.body.parentNode.offsetLeft;var h=document.defaultView?window.getComputedStyle(document.body.parentNode,null):document.body.parentNode.currentStyle;document.body.parentNode.offsetTop!==parseInt(h.marginTop,10)&&!isNaN(parseInt(h.marginTop,10))&&(d+=parseInt(h.marginTop,10),e+=parseInt(h.marginLeft,10));return{top:d,left:e,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},bind:function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,c.concat(Array.prototype.slice.call(arguments)))}},isString:function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},isArray:Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;if(!a)var a=window.event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}}},wax=wax||{},wax.leaf=wax.leaf||{},wax.leaf.interaction=function(a,b,c){b=b||{},c=c||{};var d={modifyingEvents:["move"],waxGM:new wax.GridManager(b),callbacks:c.callbacks||new wax.tooltip,clickAction:c.clickAction||"full",add:function(){for(var b=0;b<this.modifyingEvents.length;b++)a.on(this.modifyingEvents[b],wax.util.bind(this.clearTileGrid,this));L.DomEvent.addListener(a._container,"mousemove",this.onMove(),this),L.DomEvent.addListener(a._container,"mousemove",this.mouseDown(),this);return this},getTileGrid:function(){return this._getTileGrid||(this._getTileGrid=function(a){var b=[];for(var c in a)if(a[c]._tiles)for(var d in a[c]._tiles){var e=wax.util.offset(a[c]._tiles[d]);b.push([e.top,e.left,a[c]._tiles[d]])}return b}(a._layers))},clearTileGrid:function(a,b){this._getTileGrid=null},getTile:function(a){var b,c=this.getTileGrid();for(var d=0;d<c.length;d++)if(c[d][0]<a.y&&c[d][0]+256>a.y&&c[d][1]<a.x&&c[d][1]+256>a.x){b=c[d][2];break}return b||!1},clearTimeout:function(){if(this.clickTimeout){window.clearTimeout(this.clickTimeout),this.clickTimeout=null;return!0}return!1},onMove:function(b){this._onMove||(this._onMove=wax.util.bind(function(b){var c=wax.util.eventoffset(b),d=this.getTile(c);d&&this.waxGM.getGrid(d.src,wax.util.bind(function(e,f){if(!e&&f){var g=f.tileFeature(c.x,c.y,d,{format:"teaser"});g?g&&this.feature!==g?(this.feature=g,this.callbacks.out(a._container),this.callbacks.over(g,a._container,0,b)):g||(this.feature=null,this.callbacks.out(a._container)):(this.feature=null,this.callbacks.out(a._container))}},this))},this));return this._onMove},mouseDown:function(b){this._mouseDown||(this._mouseDown=wax.util.bind(function(b){this.clearTimeout()||(this.downEvent=b,L.DomEvent.addListener(a._container,"mouseup",this.mouseUp(),this))},this));return this._mouseDown},mouseUp:function(){this._mouseUp||(this._mouseUp=wax.util.bind(function(b){L.DomEvent.removeListener(a._container,"mouseup",this.mouseUp(),this);var c=4;Math.round(b.pageY/c)===Math.round(this.downEvent.pageY/c)&&Math.round(b.pageX/c)===Math.round(this.downEvent.pageX/c)&&(this.clickTimeout=window.setTimeout(wax.util.bind(function(){this.click()(b)},this),300))},this));return this._mouseUp},click:function(a){this._onClick||(this._onClick=wax.util.bind(function(a){var b=this.getTile(a);b&&this.waxGM.getGrid(b.src,wax.util.bind(function(c,d){if(d){var e=d.tileFeature(a.pageX,a.pageY,b,{format:this.clickAction});if(e)switch(this.clickAction){case"full":this.callbacks.click(e,this.parent,0,a);break;case"location":window.location=e}}},this))},this));return this._onClick}};return d.add(a)},wax=wax||{},wax.leaf=wax.leaf||{},wax.leaf.connector=L.TileLayer.extend({initialize:function(a){a=a||{},a.minZoom=a.minzoom||0,a.maxZoom=a.maxzoom||22,L.TileLayer.prototype.initialize.call(this,a.tiles[0],a)}})
*/!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();return d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=handleReadyState(d,b,c),a.before&&a.before(d),d.send(a.data||null),d}var e=doc.createElement("script"),f=0;win[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0,e.onload=e.onreadystatechange=function(){if(e[readyState]&&e[readyState]!=="complete"&&e[readyState]!=="loaded"||f)return!1;e.onload=e.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e),f=1},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;return a.url=a.url.substr(0,a.url.length-1)+c,c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){return context.reqwest=old,this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window);var wax=wax||{};Array.prototype.reduce||(Array.prototype.reduce=function(a){"use strict";if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;if(c==0&&arguments.length==1)throw new TypeError;var d=0,e;if(arguments.length>=2)e=arguments[1];else do{if(d in b){e=b[d++];break}if(++d>=c)throw new TypeError}while(!0);while(d<c)d in b&&(e=a.call(undefined,e,b[d],d,b)),d++;return e}),wax.Record=function(a,b){var c=function(a,b){var c=a.split(".").reduce(function(a,b){return[a[1]||a[0],a[1]?a[1][b]:a[0][b]]},[b||window,null]);if(c[0]&&c[1])return c;throw a+" not found."},d=function(a,b){var d=c(a),e;b=b.length?wax.Record(b):[];if(Object.create)e=Object.create(d[1].prototype),d[1].apply(e,b);else switch(b.length){case 0:e=new d[1];break;case 1:e=new d[1](b[0]);break;case 2:e=new d[1](b[0],b[1]);break;case 3:e=new d[1](b[0],b[1],b[2]);break;case 4:e=new d[1](b[0],b[1],b[2],b[3]);break;case 5:e=new d[1](b[0],b[1],b[2],b[3],b[4]);break;default:}return e},e=function(a,b,d){var e=c(a,d),f=b.length?wax.Record(b):[];return d&&a.indexOf(".")===-1?e[1].apply(d,f):e[1].apply(e[0],f)},f=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@literal","@chain","@inject","@group"],a.split(" ")[0])!==-1},g=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@chain"],a.split(" ")[0])!==-1},h=function(a){return wax.util.isArray(a)&&a[0]&&f(a[0])?{verb:a[0].split(" ")[0],subject:a[0].split(" ")[1],object:a.slice(1)}:!1},i,j=!1,k=null,l=null,m=h(a);if(!m){if(a!==null&&typeof a=="object"){var n=wax.util.keys(a);for(i=0;i<n.length;i++){var o=n[i];a[o]=wax.Record(a[o],b)}return a}return a}switch(m.verb){case"@group":for(i=0;i<m.object.length;i++)k=wax.Record(m.object[i],b),l=h(m.object[i]),l&&g(l.verb)&&(b=k);return b;case"@new":return d(m.subject,m.object);case"@literal":return j=c(m.subject),j?j[1]:null;case"@inject":return e(m.subject,m.object,b);case"@chain":return e(m.subject,m.object,b);case"@call":return e(m.subject,m.object,null)}},wax=wax||{},wax.attribution=function(){var a,b={};return b.set=function(b){if(typeof b=="undefined")return;return a.innerHTML=b,this},b.element=function(){return a},b.init=function(){return a=document.createElement("div"),a.className="wax-attribution",this},b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;return c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){return g&&h(),this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add(),c},wax.formatter=function(x){var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};return formatter.format=function(a,b){try{return f(a,b)}catch(c){console&&console.log(c)}},formatter},wax.GridInstance=function(a,b,c){function f(a){return a>=93&&a--,a>=35&&a--,a-=32,a}c=c||{};var d={},e=c.resolution||4;return tileSize=c.tileSize||256,d.gridFeature=function(b,c){if(!a||!a.grid)return;if(c<0||b<0)return;if(Math.floor(c)>tileSize||Math.floor(b)>tileSize)return;var d=f(a.grid[Math.floor(c/e)].charCodeAt(Math.floor(b/e)));if(a.keys[d]&&a.data[a.keys[d]])return a.data[a.keys[d]]},d.tileFeature=function(a,c,d,e){var f=wax.util.offset(d);feature=this.gridFeature(a-f.left,c-f.top);if(feature)return b.format(e,feature)},d},wax.GridManager=function(a){function h(a,b){if(typeof e!="undefined")return b(null,e);wax.request.get(f(a),function(a,c){return c&&c.formatter?e=wax.formatter(c.formatter):e=!1,b(a,e)})}function i(a){return typeof a=="string"&&(a=[a]),function b(b){if(!b)return;var c=/(\d+)\/(\d+)\/(\d+)\.[\w\._]+/g.exec(b);if(!c)return;return a[parseInt(c[2],10)%a.length].replace("{z}",c[1]).replace("{x}",c[2]).replace("{y}",c[3])}}a=a||{};var b=a.resolution||4,c={},d={},e,f=function(a){return a.replace(/\d+\/\d+\/\d+\.\w+/,"layer.json")},g=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};return d.formatter=function(a){return arguments.length?(e=wax.formatter(a),d):e},d.formatterUrl=function(a){return arguments.length?(f=typeof a=="string"?function(){return a}:a,d):f},d.gridUrl=function(a){return arguments.length?(g=typeof a=="function"?a:i(a),d):g},d.getGrid=function(a,c){return h(a,function(d,e){var f=g(a);if(d||!e||!f)return c(d,null);wax.request.get(f,function(a,d){if(a)return c(a,null);c(null,wax.GridInstance(d,e,{resolution:b||4}))})}),d},a.formatter&&d.formatter(a.formatter),a.grids&&d.gridUrl(a.grids),d};var wax=wax||{};wax.legend=function(){var a,b={},c;return b.element=function(){return c},b.content=function(b){return arguments.length?(b?(a.innerHTML=b,a.style.display="block"):(a.innerHTML="",a.style.display="none"),this):a.innerHTML},b.add=function(){return c=document.createElement("div"),c.className="wax-legends",a=document.createElement("div"),a.className="wax-legend",a.style.display="none",c.appendChild(a),this},b.add()};var w=function(a){return a.melt=function(b,c){return b.apply(c,[a,c])},a},wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(this.locks[a])return;var c=this;this.locks[a]=!0,reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(a){this._currentTooltip=undefined,a=a||{},a.animationOut&&(this.animationOut=a.animationOut),a.animationIn&&(this.animationIn=a.animationIn)},wax.tooltip.prototype.isPopup=function(a){return a&&a.className.indexOf("wax-popup")!==-1},wax.tooltip.prototype.getTooltip=function(a,b,c,d){return tooltip=document.createElement("div"),tooltip.className="wax-tooltip wax-tooltip-"+c,tooltip.innerHTML=a,b.appendChild(tooltip),tooltip},wax.tooltip.prototype.hideTooltip=function(a){if(!a)return;var b,c=function(){this.parentNode&&this.parentNode.removeChild(this)};a.style["-webkit-transition"]!==undefined&&this.animationOut?b="webkitTransitionEnd":a.style.MozTransition!==undefined&&this.animationOut&&(b="transitionend"),b?(a.addEventListener(b,c,!1),a.addEventListener("transitionend",c,!1),a.className+=" "+this.animationOut):a.parentNode&&a.parentNode.removeChild(a)},wax.tooltip.prototype.click=function(a,b,c){this.unselect(b);var d=this.getTooltip(a,b,c),e=document.createElement("a");e.href="#close",e.className="close",e.innerHTML="Close";var f=wax.util.bind(function(a){return this.hideTooltip(d),this._currentTooltip=undefined,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),!1},this);e.addEventListener?e.addEventListener("click",f,!1):e.attachEvent&&e.attachEvent("onclick",f),d.className+=" wax-popup",d.innerHTML=a,d.appendChild(e),this._currentTooltip=d},wax.tooltip.prototype.select=function(a,b,c,d){if(!a)return;if(this.isPopup(this._currentTooltip))return;this._currentTooltip=this.getTooltip(a,b,c,d),b.style.cursor="pointer"},wax.tooltip.prototype.unselect=function(a){if(this.isPopup(this._currentTooltip))return;a.style.cursor="default",this._currentTooltip&&(this.hideTooltip(this._currentTooltip),this._currentTooltip=undefined)},wax.tooltip.prototype.out=wax.tooltip.prototype.unselect,wax.tooltip.prototype.over=wax.tooltip.prototype.select,wax.tooltip.prototype.click=wax.tooltip.prototype.click;var wax=wax||{};wax.util=wax.util||{},wax.util={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=0,e=0,f=function(a){if(a===document.body||a===document.documentElement)return;d+=a.offsetTop,e+=a.offsetLeft;var b=a.style.transform||a.style.WebkitTransform||a.style.OTransform||a.style.MozTransform||a.style.msTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");d+=parseInt(c[13],10),e+=parseInt(c[12],10)}else if(match=b.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10)};f(a);try{while(a=a.offsetParent)f(a)}catch(g){}d+=document.body.offsetTop,e+=document.body.offsetLeft,d+=document.body.parentNode.offsetTop,e+=document.body.parentNode.offsetLeft;var h=document.defaultView?window.getComputedStyle(document.body.parentNode,null):document.body.parentNode.currentStyle;return document.body.parentNode.offsetTop!==parseInt(h.marginTop,10)&&!isNaN(parseInt(h.marginTop,10))&&(d+=parseInt(h.marginTop,10),e+=parseInt(h.marginLeft,10)),{top:d,left:e,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},bind:function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,c.concat(Array.prototype.slice.call(arguments)))}},isString:function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},isArray:Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;if(!a)var a=window.event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}}},wax=wax||{},wax.leaf=wax.leaf||{},wax.leaf.interaction=function(a,b,c){b=b||{},c=c||{};var d={modifyingEvents:["move"],waxGM:new wax.GridManager(b),callbacks:c.callbacks||new wax.tooltip,clickAction:c.clickAction||"full",add:function(){for(var b=0;b<this.modifyingEvents.length;b++)a.on(this.modifyingEvents[b],wax.util.bind(this.clearTileGrid,this));return L.DomEvent.addListener(a._container,"mousemove",this.onMove(),this),L.DomEvent.addListener(a._container,"mousemove",this.mouseDown(),this),this},getTileGrid:function(){return this._getTileGrid||(this._getTileGrid=function(a){var b=[];for(var c in a)if(a[c]._tiles)for(var d in a[c]._tiles){var e=wax.util.offset(a[c]._tiles[d]);b.push([e.top,e.left,a[c]._tiles[d]])}return b}(a._layers))},clearTileGrid:function(a,b){this._getTileGrid=null},getTile:function(a){var b,c=this.getTileGrid();for(var d=0;d<c.length;d++)if(c[d][0]<a.y&&c[d][0]+256>a.y&&c[d][1]<a.x&&c[d][1]+256>a.x){b=c[d][2];break}return b||!1},clearTimeout:function(){return this.clickTimeout?(window.clearTimeout(this.clickTimeout),this.clickTimeout=null,!0):!1},onMove:function(b){return this._onMove||(this._onMove=wax.util.bind(function(b){var c=wax.util.eventoffset(b),d=this.getTile(c);d&&this.waxGM.getGrid(d.src,wax.util.bind(function(e,f){if(e)return;if(f){var g=f.tileFeature(c.x,c.y,d,{format:"teaser"});g?g&&this.feature!==g?(this.feature=g,this.callbacks.out(a._container),this.callbacks.over(g,a._container,0,b)):g||(this.feature=null,this.callbacks.out(a._container)):(this.feature=null,this.callbacks.out(a._container))}},this))},this)),this._onMove},mouseDown:function(b){return this._mouseDown||(this._mouseDown=wax.util.bind(function(b){if(this.clearTimeout())return;this.downEvent=b,L.DomEvent.addListener(a._container,"mouseup",this.mouseUp(),this)},this)),this._mouseDown},mouseUp:function(){return this._mouseUp||(this._mouseUp=wax.util.bind(function(b){L.DomEvent.removeListener(a._container,"mouseup",this.mouseUp(),this);var c=4;Math.round(b.pageY/c)===Math.round(this.downEvent.pageY/c)&&Math.round(b.pageX/c)===Math.round(this.downEvent.pageX/c)&&(this.clickTimeout=window.setTimeout(wax.util.bind(function(){this.click()(b)},this),300))},this)),this._mouseUp},click:function(a){return this._onClick||(this._onClick=wax.util.bind(function(a){var b=this.getTile(a);b&&this.waxGM.getGrid(b.src,wax.util.bind(function(c,d){if(d){var e=d.tileFeature(a.pageX,a.pageY,b,{format:this.clickAction});if(e)switch(this.clickAction){case"full":this.callbacks.click(e,this.parent,0,a);break;case"location":window.location=e}}},this))},this)),this._onClick}};return d.add(a)},wax=wax||{},wax.leaf=wax.leaf||{},wax.leaf.connector=L.TileLayer.extend({initialize:function(a){a=a||{},a.minZoom=a.minzoom||0,a.maxZoom=a.maxzoom||22,L.TileLayer.prototype.initialize.call(this,a.tiles[0],a)}})

@@ -1,6 +0,6 @@

/* wax - 3.0.5 - 1.0.4-361-g59892a1 *//*!
* Reqwest! A x-browser general purpose XHR connection manager
/* wax - 3.0.6 - 1.0.4-372-g3e9b147 *//*!
* Reqwest! A general purpose XHR connection manager
* copyright Dustin Diaz 2011
* https://github.com/ded/reqwest
* license MIT
*/!function(window){function readyState(a,b,c){return function(){a&&a.readyState==4&&(twoHundo.test(a.status)?b(a):c(a))}}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest");if(b.data){c["Content-type"]=c["Content-type"]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function generalCallback(a){lastValue=a}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=readyState(d,b,c),a.before&&a.before(d),d.send(a.data||null);return d}var e=doc.createElement("script");window[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0;var f=function(){a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e)};e.onload=f,e.onreadystatechange=function(){/^loaded|complete$/.test(e.readyState)&&f()},head.appendChild(e)}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function setType(a){if(/\.json$/.test(a))return"json";if(/\.jsonp$/.test(a))return"jsonp";if(/\.js$/.test(a))return"js";if(/\.html?$/.test(a))return"html";if(/\.xml$/.test(a))return"xml";return"js"}function init(o,fn){function complete(a){o.complete&&o.complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText,JSON;switch(type){case"json":resp=JSON?JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function error(a){o.error&&o.error(a),complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function reqwest(a,b){return new Reqwest(a,b)}function enc(a){return encodeURIComponent(a)}function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",head=doc[byTag]("head")[0],xhr="XMLHttpRequest"in window?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")},uniqid=0,lastValue;Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=a[byTag]("input"),c=a[byTag]("select"),d=a[byTag]("textarea");return(v(b).chain().toArray().map(serial).value().join("")+v(c).chain().toArray().map(serial).value().join("")+v(d).chain().toArray().map(serial).value().join("")).replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=window.reqwest;reqwest.noConflict=function(){window.reqwest=old;return this},window.reqwest=reqwest}(this);var wax=wax||{};Array.prototype.reduce||(Array.prototype.reduce=function(a){"use strict";if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;if(c==0&&arguments.length==1)throw new TypeError;var d=0,e;if(arguments.length>=2)e=arguments[1];else do{if(d in b){e=b[d++];break}if(++d>=c)throw new TypeError}while(!0);while(d<c)d in b&&(e=a.call(undefined,e,b[d],d,b)),d++;return e}),wax.Record=function(a,b){var c=function(a,b){var c=a.split(".").reduce(function(a,b){return[a[1]||a[0],a[1]?a[1][b]:a[0][b]]},[b||window,null]);if(c[0]&&c[1])return c;throw a+" not found."},d=function(a,b){var d=c(a),e;b=b.length?wax.Record(b):[];if(Object.create)e=Object.create(d[1].prototype),d[1].apply(e,b);else switch(b.length){case 0:e=new d[1];break;case 1:e=new d[1](b[0]);break;case 2:e=new d[1](b[0],b[1]);break;case 3:e=new d[1](b[0],b[1],b[2]);break;case 4:e=new d[1](b[0],b[1],b[2],b[3]);break;case 5:e=new d[1](b[0],b[1],b[2],b[3],b[4]);break;default:}return e},e=function(a,b,d){var e=c(a,d),f=b.length?wax.Record(b):[];return d&&a.indexOf(".")===-1?e[1].apply(d,f):e[1].apply(e[0],f)},f=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@literal","@chain","@inject","@group"],a.split(" ")[0])!==-1},g=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@chain"],a.split(" ")[0])!==-1},h=function(a){if(wax.util.isArray(a)&&a[0]&&f(a[0]))return{verb:a[0].split(" ")[0],subject:a[0].split(" ")[1],object:a.slice(1)};return!1},i,j=!1,k=null,l=null,m=h(a);if(!m){if(a!==null&&typeof a=="object"){var n=wax.util.keys(a);for(i=0;i<n.length;i++){var o=n[i];a[o]=wax.Record(a[o],b)}return a}return a}switch(m.verb){case"@group":for(i=0;i<m.object.length;i++)k=wax.Record(m.object[i],b),l=h(m.object[i]),l&&g(l.verb)&&(b=k);return b;case"@new":return d(m.subject,m.object);case"@literal":j=c(m.subject);return j?j[1]:null;case"@inject":return e(m.subject,m.object,b);case"@chain":return e(m.subject,m.object,b);case"@call":return e(m.subject,m.object,null)}},wax=wax||{},wax.attribution=function(){var a,b={};b.set=function(b){if(typeof b!="undefined"){a.innerHTML=b;return this}},b.element=function(){return a},b.init=function(){a=document.createElement("div"),a.className="wax-attribution";return this};return b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){g&&h();return this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add();return c},wax.formatter=function(x){var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};formatter.format=function(a,b){try{return f(a,b)}catch(c){console&&console.log(c)}};return formatter},wax.GridInstance=function(a,b,c){function f(a){a>=93&&a--,a>=35&&a--,a-=32;return a}c=c||{};var d={},e=c.resolution||4;tileSize=c.tileSize||256,d.gridFeature=function(b,c){if(!!a&&!!a.grid){if(c<0||b<0)return;if(Math.floor(c)>tileSize||Math.floor(b)>tileSize)return;var d=f(a.grid[Math.floor(c/e)].charCodeAt(Math.floor(b/e)));if(a.keys[d]&&a.data[a.keys[d]])return a.data[a.keys[d]]}},d.tileFeature=function(a,c,d,e){var f=wax.util.offset(d);feature=this.gridFeature(a-f.left,c-f.top);if(feature)return b.format(e,feature)};return d},wax.GridManager=function(a){function i(a){typeof a=="string"&&(a=[a]);return function(c){if(!!c){var d=/(\d+)\/(\d+)\/(\d+)\.[\w\._]+/g.exec(c);if(!d)return;return a[parseInt(d[2],10)%a.length].replace("{z}",d[1]).replace("{x}",d[2]).replace("{y}",d[3])}}}function h(a,b){if(typeof e!="undefined")return b(null,e);wax.request.get(f(a),function(a,c){c&&c.formatter?e=wax.formatter(c.formatter):e=!1;return b(a,e)})}a=a||{};var b=a.resolution||4,c={},d={},e,f=function(a){return a.replace(/\d+\/\d+\/\d+\.\w+/,"layer.json")},g=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};d.formatter=function(a){if(!arguments.length)return e;e=wax.formatter(a);return d},d.formatterUrl=function(a){if(!arguments.length)return f;f=typeof a=="string"?function(){return a}:a;return d},d.gridUrl=function(a){if(!arguments.length)return g;g=typeof a=="function"?a:i(a);return d},d.getGrid=function(a,c){h(a,function(d,e){var f=g(a);if(d||!e||!f)return c(d,null);wax.request.get(f,function(a,d){if(a)return c(a,null);c(null,wax.GridInstance(d,e,{resolution:b||4}))})});return d},a.formatter&&d.formatter(a.formatter),a.grids&&d.gridUrl(a.grids);return d};var wax=wax||{};wax.legend=function(){var a,b={},c;b.element=function(){return c},b.content=function(b){if(!arguments.length)return a.innerHTML;b?(a.innerHTML=b,a.style.display="block"):(a.innerHTML="",a.style.display="none");return this},b.add=function(){c=document.createElement("div"),c.className="wax-legends",a=document.createElement("div"),a.className="wax-legend",a.style.display="none",c.appendChild(a);return this};return b.add()};var w=function(a){a.melt=function(b,c){return b.apply(c,[a,c])};return a},wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(!this.locks[a]){var c=this;this.locks[a]=!0,reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}}};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(a){this._currentTooltip=undefined,a=a||{},a.animationOut&&(this.animationOut=a.animationOut),a.animationIn&&(this.animationIn=a.animationIn)},wax.tooltip.prototype.isPopup=function(a){return a&&a.className.indexOf("wax-popup")!==-1},wax.tooltip.prototype.getTooltip=function(a,b,c,d){tooltip=document.createElement("div"),tooltip.className="wax-tooltip wax-tooltip-"+c,tooltip.innerHTML=a,b.appendChild(tooltip);return tooltip},wax.tooltip.prototype.hideTooltip=function(a){if(!!a){var b,c=function(){this.parentNode&&this.parentNode.removeChild(this)};a.style["-webkit-transition"]!==undefined&&this.animationOut?b="webkitTransitionEnd":a.style.MozTransition!==undefined&&this.animationOut&&(b="transitionend"),b?(a.addEventListener(b,c,!1),a.addEventListener("transitionend",c,!1),a.className+=" "+this.animationOut):a.parentNode&&a.parentNode.removeChild(a)}},wax.tooltip.prototype.click=function(a,b,c){this.unselect(b);var d=this.getTooltip(a,b,c),e=document.createElement("a");e.href="#close",e.className="close",e.innerHTML="Close";var f=wax.util.bind(function(a){this.hideTooltip(d),this._currentTooltip=undefined,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault();return!1},this);e.addEventListener?e.addEventListener("click",f,!1):e.attachEvent&&e.attachEvent("onclick",f),d.className+=" wax-popup",d.innerHTML=a,d.appendChild(e),this._currentTooltip=d},wax.tooltip.prototype.select=function(a,b,c,d){if(!!a){if(this.isPopup(this._currentTooltip))return;this._currentTooltip=this.getTooltip(a,b,c,d),b.style.cursor="pointer"}},wax.tooltip.prototype.unselect=function(a){this.isPopup(this._currentTooltip)||(a.style.cursor="default",this._currentTooltip&&(this.hideTooltip(this._currentTooltip),this._currentTooltip=undefined))},wax.tooltip.prototype.out=wax.tooltip.prototype.unselect,wax.tooltip.prototype.over=wax.tooltip.prototype.select,wax.tooltip.prototype.click=wax.tooltip.prototype.click;var wax=wax||{};wax.util=wax.util||{},wax.util={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=0,e=0,f=function(a){if(a!==document.body&&a!==document.documentElement){d+=a.offsetTop,e+=a.offsetLeft;var b=a.style.transform||a.style["-webkit-transform"]||a.style.MozTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");d+=parseInt(c[13],10),e+=parseInt(c[12],10)}}};f(a);try{while(a=a.offsetParent)f(a)}catch(g){}d+=document.body.offsetTop,e+=document.body.offsetLeft,d+=document.body.parentNode.offsetTop,e+=document.body.parentNode.offsetLeft;var h=document.defaultView?window.getComputedStyle(document.body.parentNode,null):document.body.parentNode.currentStyle;document.body.parentNode.offsetTop!==parseInt(h.marginTop,10)&&!isNaN(parseInt(h.marginTop,10))&&(d+=parseInt(h.marginTop,10),e+=parseInt(h.marginLeft,10));return{top:d,left:e,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},bind:function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,c.concat(Array.prototype.slice.call(arguments)))}},isString:function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},isArray:Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;if(!a)var a=window.event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}}},wax=wax||{},wax.mm=wax.mm||{},wax.mm.attribution=function(a,b){b=b||{};var c,d={};d.element=function(){return c.element()},d.appendTo=function(a){wax.util.$(a).appendChild(c.element());return this},d.init=function(){c=wax.attribution(),c.set(b.attribution),c.element().className="wax-attribution wax-mm";return this};return d.init()},wax=wax||{},wax.mm=wax.mm||{},wax.mm.boxselector=function(a,b,c){function n(a,b){if(!!g&&!!h){var c=a.locationPoint(h[0]),d=a.locationPoint(h[1]);g.style.display="block",g.style.height="auto",g.style.width="auto",g.style.left=Math.max(0,d.x)+"px",g.style.top=Math.max(0,d.y)+"px",g.style.right=Math.max(0,a.dimensions.x-c.x)+"px",g.style.bottom=Math.max(0,a.dimensions.y-c.y)+"px"}}function m(b){var c=j(b),g=a.pointLocation(c),i=a.pointLocation(d),k=[new e.Location(Math.max(g.lat,i.lat),Math.min(g.lon,i.lon)),new e.Location(Math.min(g.lat,i.lat),Math.max(g.lon,i.lon))];h=[g,i],f(k),e.removeEvent(a.parent,"mousemove",l),e.removeEvent(a.parent,"mouseup",m),a.parent.style.cursor="auto"}function l(a){var b=j(a);g.style.display="block",b.x<d.x?g.style.left=b.x+"px":g.style.left=d.x+"px",b.y<d.y?g.style.top=b.y+"px":g.style.top=d.y+"px",g.style.width=Math.abs(b.x-d.x)+"px",g.style.height=Math.abs(b.y-d.y)+"px";return e.cancelEvent(a)}function k(b){if(!!b.shiftKey){d=j(b),g.style.left=d.x+"px",g.style.top=d.y+"px",e.addEvent(a.parent,"mousemove",l),e.addEvent(a.parent,"mouseup",m),a.parent.style.cursor="crosshair";return e.cancelEvent(b)}}function j(b){var c=new e.Point(b.clientX,b.clientY);c.x+=document.body.scrollLeft+document.documentElement.scrollLeft,c.y+=document.body.scrollTop+document.documentElement.scrollTop;for(var d=a.parent;d;d=d.offsetParent)c.x-=d.offsetLeft,c.y-=d.offsetTop;return c}var d=null,e=com.modestmaps,f=typeof c=="function"?c:c.callback,g,h,i={};i.add=function(a){g=g||document.createElement("div"),g.id=a.parent.id+"-boxselector-box",g.className="boxselector-box",a.parent.appendChild(g),e.addEvent(a.parent,"mousedown",k),a.addCallback("drawn",n);return this},i.remove=function(){a.parent.removeChild(g),e.removeEvent(a.parent,"mousedown",k),a.removeCallback("drawn",n)};return i.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.bwdetect=function(a,b){function g(b){(!b.options||!b.options.scheme)&&e.Map.prototype.setProvider.call(a,b);var g=[[".png",".jpg"],[c,d]];f&&g.reverse();for(var h=0;h<b.options.tiles.length;h++)b.options.tiles[h]=b.options.tiles[h].replace(g[0][0],g[1][0]).replace(g[0][1],g[1][1]);e.Map.prototype.setProvider.call(a,b)}b=b||{};var c=b.png||".png128",d=b.jpg||".jpg70",e=com.modestmaps,f=1;a.setProvider=g;return wax.bwdetect(b,function(b){f=b,g(a.provider)})},wax=wax||{},wax.mm=wax.mm||{},wax.mm.fullscreen=function(a){function f(a){a&&com.modestmaps.cancelEvent(a),(b=!b)?c.original():c.full()}var b=1,c={},d,e;c.add=function(a){d=document.createElement("a"),d.className="wax-fullscreen",d.href="#fullscreen",d.innerHTML="fullscreen",com.modestmaps.addEvent(d,"click",f);return this},c.full=function(){e=[a.parent.offsetWidth,a.parent.offsetHeight],a.parent.className+=" wax-fullscreen-map",a.setSize(a.parent.offsetWidth,a.parent.offsetHeight)},c.original=function(){a.parent.className=a.parent.className.replace("wax-fullscreen-map",""),a.setSize(e[0],e[1])},c.appendTo=function(a){wax.util.$(a).appendChild(d);return this};return c.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.locationHash={stateChange:function(a){com.modestmaps.addEvent(window,"hashchange",function(){a(location.hash.substring(1))},!1)},getState:function(){return location.hash.substring(1)},pushState:function(a){location.hash="#"+a}},wax.mm.pushState={stateChange:function(a){com.modestmaps.addEvent(window,"popstate",function(b){b.state&&b.state.map_location&&a(b.state.map_location)},!1)},getState:function(){if(!!window.history&&!!window.history.state)return history.state&&history.state.map_location},pushState:function(a){!!window.history&&!!window.history.pushState&&window.history.pushState({map_location:a},document.title,window.location.href)}},wax.mm.hash=function(a,b,c){function l(a){a!==d&&i(d=a)&&k()}function k(){var a=j();d!==a&&(d=a,c.manager.pushState(d))}function h(a,b){return g(a,b,!1)}function g(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}}c=c||{};var d,e={},f=90-1e-8;c.manager=c.manager||wax.mm.pushState;var i=function(b){var c=b.split("/");for(var d=0;d<c.length;d++){c[d]=Number(c[d]);if(isNaN(c[d]))return!0}if(c.length<3)return!0;c.length==3&&a.setCenterZoom(new com.modestmaps.Location(c[1],c[2]),c[0])},j=function(){var b=a.getCenter(),c=a.getZoom(),d=Math.max(0,Math.ceil(Math.log(c)/Math.LN2));return[c.toFixed(2),b.lat.toFixed(d),b.lon.toFixed(d)].join("/")},m=function(){c.defaultCenter&&a.setCenter(c.defaultCenter),c.defaultZoom&&a.setZoom(c.defaultZoom)};e.add=function(a){c.manager.getState()?l(c.manager.getState()):(m(),k()),a.addCallback("drawn",h(k,500)),c.manager.stateChange(l);return this};return e.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.interaction=function(a,b,c){function y(b,c){var d=s(c),i;d&&e.getGrid(d.src,function(e,j){for(var k=0;j&&k<g.length;k++)if(i=j.tileFeature(c.x,c.y,d,{format:g[k]}))switch(g[k]){case"full":case"teaser":return f.click(i,a.parent,0,b);case"location":return h(i)}})}function x(b){var c=wax.util.eventoffset(b);d.removeEvent(a.parent,"mouseup",x),a.parent.ontouchend&&(d.removeEvent(a.parent,"touchend",x),d.removeEvent(a.parent,"touchmove",_touchCancel)),j=!1,b.type==="touchend"?y(b,n):Math.round(c.y/o)===Math.round(n.y/o)&&Math.round(c.x/o)===Math.round(n.x/o)&&(k=window.setTimeout(function(a){return function(b){k=null,y(b,a)}}(c),300));return x}function w(){d.removeEvent(a.parent,"touchend",x),d.removeEvent(a.parent,"touchmove",x),j=!1}function v(b){t()||(j=!0,n=wax.util.eventoffset(b),b.type==="mousedown"?d.addEvent(a.parent,"mouseup",x):b.type==="touchstart"&&b.touches.length===1&&(g=["full","teaser"],f._currentTooltip&&f.hideTooltip(f._currentTooltip),d.addEvent(a.parent,"touchend",x),d.addEvent(a.parent,"touchmove",w)))}function u(b){if(!j){var c=wax.util.eventoffset(b),d=s(c),g;d&&e.getGrid(d.src,function(e,h){!e&&!!h&&((g=h.tileFeature(c.x,c.y,d,{format:"teaser"}))?g&&m!==g?(m=g,f.out(a.parent),f.over(g,a.parent,0,b)):g||(m=null,f.out(a.parent)):(m=null,f.out(a.parent)))})}}function t(){if(k){window.clearTimeout(k),k=null;return!0}return!1}function s(a){for(var b=0,c=q();b<c.length;b++)if(c[b][0]<a.y&&c[b][0]+256>a.y&&c[b][1]<a.x&&c[b][1]+256>a.x)return c[b][2];return!1}function r(a,b){p=null}function q(){var b=a.createOrGetLayer(Math.round(a.getZoom()));return p||(p=function(a){var c=[];for(var d in a)if(a[d].parentNode===b){var e=wax.util.offset(a[d]);c.push([e.top,e.left,a[d]])}return c}(a.tiles))}c=c||{},b=b||{};var d=com.modestmaps,e=wax.GridManager(b),f=c.callbacks||new wax.tooltip(c),g=c.clickAction||["full","location"],h=c.clickHandler||function(a){window.location=a},i={},j=!1,k=!1,l="ontouchstart"in document.documentElement,m,n,o=4,p;i.add=function(){var b=["zoomed","panned","centered","extentset","resized","drawn"];for(var c=0;c<b.length;c++)a.addCallback(b[c],r);d.addEvent(a.parent,"mousemove",u),d.addEvent(a.parent,"mousedown",v),l&&d.addEvent(a.parent,"touchstart",v);return this},i.remove=function(){var b=["zoomed","panned","centered","extentset","resized","drawn"];for(var c=0;c<b.length;c++)a.removeCallback(b[c],r);d.removeEvent(a.parent,"mousemove",u),d.removeEvent(a.parent,"mousedown",v),l&&d.removeEvent(a.parent,"touchstart",v),f._currentTooltip&&f.hideTooltip(f._currentTooltip);return this};return i.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.legend=function(a,b){b=b||{};var c,d={};d.add=function(){c=wax.legend().content(b.legend||"");return this},d.content=function(a){a&&c.content(a.legend||"")},d.element=function(){return c.element()},d.appendTo=function(a){wax.util.$(a).appendChild(c.element());return this};return d.add()},wax=wax||{},wax.mm=wax.mm||{},wax.mm.mobile=function(a,b,c){c=c||{};var d=com.modestmaps,e=navigator.userAgent.toLowerCase(),f=e.indexOf("webkit")!=-1,g=e.indexOf("mobile")!=-1,h=g&&f,i=function(a){var b=document.createElement("canvas"),c=parseInt(a.style.width,10),d=parseInt(a.style.height,10),e=c/2,f=d/2,g=Math.min(c,d)/4,h=b.getContext("2d");b.setAttribute("width",c),b.setAttribute("height",d),h.globalAlpha=.5;var i=h.createLinearGradient(0,0,300,225);i.addColorStop(0,"black"),i.addColorStop(1,"rgb(200, 200, 200)"),h.fillStyle=i,h.fillRect(0,0,c,d),h.fillStyle="rgb(255, 255, 255)",h.beginPath(),h.moveTo(e-g*.6,f-g),h.lineTo(e-g*.6,f+g),h.lineTo(e+g*.6,f),h.fill(),a.appendChild(b)},j=function(a){a.style.position="absolute",a.style.height="50px",a.style.left=a.style.right="0";var b=document.createElement("canvas");b.setAttribute("width",a.offsetWidth),b.setAttribute("height",a.offsetHeight);var c=b.getContext("2d");c.globalAlpha=1,c.fillStyle="rgba(255, 255, 255, 0.5)",c.fillRect(0,0,a.offsetWidth,a.offsetHeight),c.fillStyle="rgb(0, 0, 0)",c.font="bold 20px sans-serif",c.fillText("back",20,30),a.appendChild(b)},k=function(a){a.style.position="absolute",a.style.width=a.style.height="auto",a.style.top=window.pageYOffset+"px",a.style.left=a.style.right="0px"},l=function(a){a.style.position="relative",a.style.width=a.style.height=a.style.top=a.style.left=a.style.right="auto"},m,n,o,p,q=c.overlayDraw||i,r=c.backDraw||j;bodyDraw=c.bodyDraw||function(){};var s={add:function(a){h&&(p=document.createElement("meta"),p.id="wax-touch",p.setAttribute("name","viewport"),m=document.createElement("div"),m.id=a.parent.id+"-mobileoverlay",m.className="wax-mobileoverlay",m.style.position="absolute",m.style.width=a.dimensions.x+"px",m.style.height=a.dimensions.y+"px",a.parent.appendChild(m),q(m),o=document.createElement("div"),backDiv=document.createElement("div"),n=document.body,newBody=document.createElement("body"),newBody.className="wax-mobile-body",newBody.appendChild(backDiv),d.addEvent(m,"touchstart",this.toTouch),d.addEvent(backDiv,"touchstart",this.toPage));return this},toTouch:function(){a.parent.parentNode.replaceChild(o,a.parent),newBody.insertBefore(a.parent,backDiv),document.body=newBody,bodyDraw(newBody),r(backDiv),p.setAttribute("content","initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0"),document.head.appendChild(p),a._smallSize=[a.parent.clientWidth,a.parent.clientHeight],k(a.parent),a.setSize(a.parent.offsetWidth,window.innerHeight),backDiv.style.display="block",m.style.display="none"},toPage:function(){document.body=n,o.parentNode.replaceChild(a.parent,o),l(a.parent),a.setSize(a._smallSize[0],a._smallSize[1]),backDiv.style.display="none",m.style.display="block"}};return s.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.pointselector=function(a,b,c){function p(b){!d||(e=l(b),h.Point.distance(d,e)<f&&(i.addLocation(a.pointLocation(d)),k(m(j))),d=null)}function o(b){d=l(b),h.addEvent(a.parent,"mouseup",p)}function n(){var b=new h.Point(0,0);for(var c=0;c<j.length;c++){var d=a.locationPoint(j[c]);j[c].pointDiv||(j[c].pointDiv=document.createElement("div"),j[c].pointDiv.className="wax-point-div",j[c].pointDiv.style.position="absolute",j[c].pointDiv.style.display="block",j[c].pointDiv.location=j[c],h.addEvent(j[c].pointDiv,"mouseup",function(d){var e=j[c];return function(b){h.removeEvent(a.parent,"mouseup",p),i.deletePoint(e,b)}}()),a.parent.appendChild(j[c].pointDiv)),j[c].pointDiv.style.left=d.x+"px",j[c].pointDiv.style.top=d.y+"px"}}function m(a){var b=[];for(var c=0;c<a.length;c++)b.push(new h.Location(a[c].lat,a[c].lon));return b}function l(b){var c=wax.util.eventoffset(b),d=new h.Point(c.x,c.y),e={x:parseFloat(h.getStyle(document.documentElement,"margin-left")),y:parseFloat(h.getStyle(document.documentElement,"margin-top"))};isNaN(e.x)||(d.x-=e.x),isNaN(e.y)||(d.y-=e.y);for(var f=a.parent;f;f=f.offsetParent)d.x-=f.offsetLeft,d.y-=f.offsetTop;return d}var d=null,e=null,f=5,g,h=com.modestmaps,i={},j=[],k=typeof c=="function"?c:c.callback;i.addLocation=function(a){j.push(a),n(),k(m(j))},i.add=function(a){h.addEvent(a.parent,"mousedown",o),a.addCallback("drawn",n());return this},i.deletePoint=function(a,b){confirm("Delete this point?")&&(a.pointDiv.parentNode.removeChild(a.pointDiv),j.splice(wax.util.indexOf(j,a),1),k(m(j)))};return i.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.zoombox=function(a){function j(a){if(!!d){var b=g(a);e.style.display="block",b.x<f.x?e.style.left=b.x+"px":e.style.left=f.x+"px",e.style.width=Math.abs(b.x-f.x)+"px",b.y<f.y?e.style.top=b.y+"px":e.style.top=f.y+"px",e.style.height=Math.abs(b.y-f.y)+"px";return c.cancelEvent(a)}}function i(b){if(!!b.shiftKey&&!this.drawing){d=!0,f=g(b),e.style.left=f.x+"px",e.style.top=f.y+"px",c.addEvent(a.parent,"mousemove",j),c.addEvent(a.parent,"mouseup",h),a.parent.style.cursor="crosshair";return c.cancelEvent(b)}}function h(b){if(!!d){d=!1;var i=g(b),k=a.pointLocation(i),l=a.pointLocation(f);a.setExtent([k,l]),e.style.display="none",c.removeEvent(a.parent,"mousemove",j),c.removeEvent(a.parent,"mouseup",h),a.parent.style.cursor="auto"}}function g(b){var d=new c.Point(b.clientX,b.clientY);d.x+=document.body.scrollLeft+document.documentElement.scrollLeft,d.y+=document.body.scrollTop+document.documentElement.scrollTop;for(var e=a.parent;e;e=e.offsetParent)d.x-=e.offsetLeft,d.y-=e.offsetTop;return d}var b={},c=com.modestmaps,d=!1,e,f=null;b.add=function(a){e=e||document.createElement("div"),e.id=a.parent.id+"-zoombox-box",e.className="zoombox-box",a.parent.appendChild(e),c.addEvent(a.parent,"mousedown",i);return this},b.remove=function(){a.parent.removeChild(e),c.removeEvent(a.parent,"mousedown",i)};return b.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.zoomer=function(a){var b=com.modestmaps,c=document.createElement("a");c.innerHTML="+",c.href="#",c.className="zoomer zoomin",b.addEvent(c,"mousedown",function(a){b.cancelEvent(a)}),b.addEvent(c,"dblclick",function(a){b.cancelEvent(a)}),b.addEvent(c,"click",function(c){b.cancelEvent(c),a.zoomIn()},!1);var d=document.createElement("a");d.innerHTML="-",d.href="#",d.className="zoomer zoomout",b.addEvent(d,"mousedown",function(a){b.cancelEvent(a)}),b.addEvent(d,"dblclick",function(a){b.cancelEvent(a)}),b.addEvent(d,"click",function(c){b.cancelEvent(c),a.zoomOut()},!1);var e={add:function(a){a.addCallback("drawn",function(a,b){a.coordinate.zoom===a.provider.outerLimits()[0].zoom?d.className="zoomer zoomout zoomdisabled":a.coordinate.zoom===a.provider.outerLimits()[1].zoom?c.className="zoomer zoomin zoomdisabled":(c.className="zoomer zoomin",d.className="zoomer zoomout")});return this},appendTo:function(a){wax.util.$(a).appendChild(c),wax.util.$(a).appendChild(d);return this}};return e.add(a)};var wax=wax||{};wax.mm=wax.mm||{},wax.mm.connector=function(a){this.options={tiles:a.tiles,scheme:a.scheme||"xyz",minzoom:a.minzoom||0,maxzoom:a.maxzoom||22}},wax.mm.connector.prototype={outerLimits:function(){return[(new com.modestmaps.Coordinate(0,0,0)).zoomTo(this.options.minzoom),(new com.modestmaps.Coordinate(1,1,0)).zoomTo(this.options.maxzoom)]},getTileUrl:function(a){if(!(coord=this.sourceCoordinate(a)))return null;coord.row=this.options.scheme==="tms"?Math.pow(2,coord.zoom)-coord.row-1:coord.row;return this.options.tiles[parseInt(Math.pow(2,coord.zoom)*coord.row+coord.column,10)%this.options.tiles.length].replace("{z}",coord.zoom.toFixed(0)).replace("{x}",coord.column.toFixed(0)).replace("{y}",coord.row.toFixed(0))}},com&&com.modestmaps&&com.modestmaps.extend(wax.mm.connector,com.modestmaps.MapProvider)
*/!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();return d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=handleReadyState(d,b,c),a.before&&a.before(d),d.send(a.data||null),d}var e=doc.createElement("script"),f=0;win[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0,e.onload=e.onreadystatechange=function(){if(e[readyState]&&e[readyState]!=="complete"&&e[readyState]!=="loaded"||f)return!1;e.onload=e.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e),f=1},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;return a.url=a.url.substr(0,a.url.length-1)+c,c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){return context.reqwest=old,this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window);var wax=wax||{};Array.prototype.reduce||(Array.prototype.reduce=function(a){"use strict";if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;if(c==0&&arguments.length==1)throw new TypeError;var d=0,e;if(arguments.length>=2)e=arguments[1];else do{if(d in b){e=b[d++];break}if(++d>=c)throw new TypeError}while(!0);while(d<c)d in b&&(e=a.call(undefined,e,b[d],d,b)),d++;return e}),wax.Record=function(a,b){var c=function(a,b){var c=a.split(".").reduce(function(a,b){return[a[1]||a[0],a[1]?a[1][b]:a[0][b]]},[b||window,null]);if(c[0]&&c[1])return c;throw a+" not found."},d=function(a,b){var d=c(a),e;b=b.length?wax.Record(b):[];if(Object.create)e=Object.create(d[1].prototype),d[1].apply(e,b);else switch(b.length){case 0:e=new d[1];break;case 1:e=new d[1](b[0]);break;case 2:e=new d[1](b[0],b[1]);break;case 3:e=new d[1](b[0],b[1],b[2]);break;case 4:e=new d[1](b[0],b[1],b[2],b[3]);break;case 5:e=new d[1](b[0],b[1],b[2],b[3],b[4]);break;default:}return e},e=function(a,b,d){var e=c(a,d),f=b.length?wax.Record(b):[];return d&&a.indexOf(".")===-1?e[1].apply(d,f):e[1].apply(e[0],f)},f=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@literal","@chain","@inject","@group"],a.split(" ")[0])!==-1},g=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@chain"],a.split(" ")[0])!==-1},h=function(a){return wax.util.isArray(a)&&a[0]&&f(a[0])?{verb:a[0].split(" ")[0],subject:a[0].split(" ")[1],object:a.slice(1)}:!1},i,j=!1,k=null,l=null,m=h(a);if(!m){if(a!==null&&typeof a=="object"){var n=wax.util.keys(a);for(i=0;i<n.length;i++){var o=n[i];a[o]=wax.Record(a[o],b)}return a}return a}switch(m.verb){case"@group":for(i=0;i<m.object.length;i++)k=wax.Record(m.object[i],b),l=h(m.object[i]),l&&g(l.verb)&&(b=k);return b;case"@new":return d(m.subject,m.object);case"@literal":return j=c(m.subject),j?j[1]:null;case"@inject":return e(m.subject,m.object,b);case"@chain":return e(m.subject,m.object,b);case"@call":return e(m.subject,m.object,null)}},wax=wax||{},wax.attribution=function(){var a,b={};return b.set=function(b){if(typeof b=="undefined")return;return a.innerHTML=b,this},b.element=function(){return a},b.init=function(){return a=document.createElement("div"),a.className="wax-attribution",this},b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;return c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){return g&&h(),this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add(),c},wax.formatter=function(x){var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};return formatter.format=function(a,b){try{return f(a,b)}catch(c){console&&console.log(c)}},formatter},wax.GridInstance=function(a,b,c){function f(a){return a>=93&&a--,a>=35&&a--,a-=32,a}c=c||{};var d={},e=c.resolution||4;return tileSize=c.tileSize||256,d.gridFeature=function(b,c){if(!a||!a.grid)return;if(c<0||b<0)return;if(Math.floor(c)>tileSize||Math.floor(b)>tileSize)return;var d=f(a.grid[Math.floor(c/e)].charCodeAt(Math.floor(b/e)));if(a.keys[d]&&a.data[a.keys[d]])return a.data[a.keys[d]]},d.tileFeature=function(a,c,d,e){var f=wax.util.offset(d);feature=this.gridFeature(a-f.left,c-f.top);if(feature)return b.format(e,feature)},d},wax.GridManager=function(a){function h(a,b){if(typeof e!="undefined")return b(null,e);wax.request.get(f(a),function(a,c){return c&&c.formatter?e=wax.formatter(c.formatter):e=!1,b(a,e)})}function i(a){return typeof a=="string"&&(a=[a]),function b(b){if(!b)return;var c=/(\d+)\/(\d+)\/(\d+)\.[\w\._]+/g.exec(b);if(!c)return;return a[parseInt(c[2],10)%a.length].replace("{z}",c[1]).replace("{x}",c[2]).replace("{y}",c[3])}}a=a||{};var b=a.resolution||4,c={},d={},e,f=function(a){return a.replace(/\d+\/\d+\/\d+\.\w+/,"layer.json")},g=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};return d.formatter=function(a){return arguments.length?(e=wax.formatter(a),d):e},d.formatterUrl=function(a){return arguments.length?(f=typeof a=="string"?function(){return a}:a,d):f},d.gridUrl=function(a){return arguments.length?(g=typeof a=="function"?a:i(a),d):g},d.getGrid=function(a,c){return h(a,function(d,e){var f=g(a);if(d||!e||!f)return c(d,null);wax.request.get(f,function(a,d){if(a)return c(a,null);c(null,wax.GridInstance(d,e,{resolution:b||4}))})}),d},a.formatter&&d.formatter(a.formatter),a.grids&&d.gridUrl(a.grids),d};var wax=wax||{};wax.legend=function(){var a,b={},c;return b.element=function(){return c},b.content=function(b){return arguments.length?(b?(a.innerHTML=b,a.style.display="block"):(a.innerHTML="",a.style.display="none"),this):a.innerHTML},b.add=function(){return c=document.createElement("div"),c.className="wax-legends",a=document.createElement("div"),a.className="wax-legend",a.style.display="none",c.appendChild(a),this},b.add()};var w=function(a){return a.melt=function(b,c){return b.apply(c,[a,c])},a},wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(this.locks[a])return;var c=this;this.locks[a]=!0,reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(a){this._currentTooltip=undefined,a=a||{},a.animationOut&&(this.animationOut=a.animationOut),a.animationIn&&(this.animationIn=a.animationIn)},wax.tooltip.prototype.isPopup=function(a){return a&&a.className.indexOf("wax-popup")!==-1},wax.tooltip.prototype.getTooltip=function(a,b,c,d){return tooltip=document.createElement("div"),tooltip.className="wax-tooltip wax-tooltip-"+c,tooltip.innerHTML=a,b.appendChild(tooltip),tooltip},wax.tooltip.prototype.hideTooltip=function(a){if(!a)return;var b,c=function(){this.parentNode&&this.parentNode.removeChild(this)};a.style["-webkit-transition"]!==undefined&&this.animationOut?b="webkitTransitionEnd":a.style.MozTransition!==undefined&&this.animationOut&&(b="transitionend"),b?(a.addEventListener(b,c,!1),a.addEventListener("transitionend",c,!1),a.className+=" "+this.animationOut):a.parentNode&&a.parentNode.removeChild(a)},wax.tooltip.prototype.click=function(a,b,c){this.unselect(b);var d=this.getTooltip(a,b,c),e=document.createElement("a");e.href="#close",e.className="close",e.innerHTML="Close";var f=wax.util.bind(function(a){return this.hideTooltip(d),this._currentTooltip=undefined,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),!1},this);e.addEventListener?e.addEventListener("click",f,!1):e.attachEvent&&e.attachEvent("onclick",f),d.className+=" wax-popup",d.innerHTML=a,d.appendChild(e),this._currentTooltip=d},wax.tooltip.prototype.select=function(a,b,c,d){if(!a)return;if(this.isPopup(this._currentTooltip))return;this._currentTooltip=this.getTooltip(a,b,c,d),b.style.cursor="pointer"},wax.tooltip.prototype.unselect=function(a){if(this.isPopup(this._currentTooltip))return;a.style.cursor="default",this._currentTooltip&&(this.hideTooltip(this._currentTooltip),this._currentTooltip=undefined)},wax.tooltip.prototype.out=wax.tooltip.prototype.unselect,wax.tooltip.prototype.over=wax.tooltip.prototype.select,wax.tooltip.prototype.click=wax.tooltip.prototype.click;var wax=wax||{};wax.util=wax.util||{},wax.util={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=0,e=0,f=function(a){if(a===document.body||a===document.documentElement)return;d+=a.offsetTop,e+=a.offsetLeft;var b=a.style.transform||a.style.WebkitTransform||a.style.OTransform||a.style.MozTransform||a.style.msTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");d+=parseInt(c[13],10),e+=parseInt(c[12],10)}else if(match=b.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10)};f(a);try{while(a=a.offsetParent)f(a)}catch(g){}d+=document.body.offsetTop,e+=document.body.offsetLeft,d+=document.body.parentNode.offsetTop,e+=document.body.parentNode.offsetLeft;var h=document.defaultView?window.getComputedStyle(document.body.parentNode,null):document.body.parentNode.currentStyle;return document.body.parentNode.offsetTop!==parseInt(h.marginTop,10)&&!isNaN(parseInt(h.marginTop,10))&&(d+=parseInt(h.marginTop,10),e+=parseInt(h.marginLeft,10)),{top:d,left:e,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},bind:function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,c.concat(Array.prototype.slice.call(arguments)))}},isString:function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},isArray:Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;if(!a)var a=window.event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}}},wax=wax||{},wax.mm=wax.mm||{},wax.mm.attribution=function(a,b){b=b||{};var c,d={};return d.element=function(){return c.element()},d.appendTo=function(a){return wax.util.$(a).appendChild(c.element()),this},d.init=function(){return c=wax.attribution(),c.set(b.attribution),c.element().className="wax-attribution wax-mm",this},d.init()},wax=wax||{},wax.mm=wax.mm||{},wax.mm.boxselector=function(a,b,c){function j(b){var c=new e.Point(b.clientX,b.clientY);c.x+=document.body.scrollLeft+document.documentElement.scrollLeft,c.y+=document.body.scrollTop+document.documentElement.scrollTop;for(var d=a.parent;d;d=d.offsetParent)c.x-=d.offsetLeft,c.y-=d.offsetTop;return c}function k(b){if(!b.shiftKey)return;return d=j(b),g.style.left=d.x+"px",g.style.top=d.y+"px",e.addEvent(a.parent,"mousemove",l),e.addEvent(a.parent,"mouseup",m),a.parent.style.cursor="crosshair",e.cancelEvent(b)}function l(a){var b=j(a);return g.style.display="block",b.x<d.x?g.style.left=b.x+"px":g.style.left=d.x+"px",b.y<d.y?g.style.top=b.y+"px":g.style.top=d.y+"px",g.style.width=Math.abs(b.x-d.x)+"px",g.style.height=Math.abs(b.y-d.y)+"px",e.cancelEvent(a)}function m(b){var c=j(b),g=a.pointLocation(c),i=a.pointLocation(d),k=[new e.Location(Math.max(g.lat,i.lat),Math.min(g.lon,i.lon)),new e.Location(Math.min(g.lat,i.lat),Math.max(g.lon,i.lon))];h=[g,i],f(k),e.removeEvent(a.parent,"mousemove",l),e.removeEvent(a.parent,"mouseup",m),a.parent.style.cursor="auto"}function n(a,b){if(!g||!h)return;var c=a.locationPoint(h[0]),d=a.locationPoint(h[1]);g.style.display="block",g.style.height="auto",g.style.width="auto",g.style.left=Math.max(0,d.x)+"px",g.style.top=Math.max(0,d.y)+"px",g.style.right=Math.max(0,a.dimensions.x-c.x)+"px",g.style.bottom=Math.max(0,a.dimensions.y-c.y)+"px"}var d=null,e=com.modestmaps,f=typeof c=="function"?c:c.callback,g,h,i={};return i.add=function(a){return g=g||document.createElement("div"),g.id=a.parent.id+"-boxselector-box",g.className="boxselector-box",a.parent.appendChild(g),e.addEvent(a.parent,"mousedown",k),a.addCallback("drawn",n),this},i.remove=function(){a.parent.removeChild(g),e.removeEvent(a.parent,"mousedown",k),a.removeCallback("drawn",n)},i.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.bwdetect=function(a,b){function g(b){(!b.options||!b.options.scheme)&&e.Map.prototype.setProvider.call(a,b);var g=[[".png",".jpg"],[c,d]];f&&g.reverse();for(var h=0;h<b.options.tiles.length;h++)b.options.tiles[h]=b.options.tiles[h].replace(g[0][0],g[1][0]).replace(g[0][1],g[1][1]);e.Map.prototype.setProvider.call(a,b)}b=b||{};var c=b.png||".png128",d=b.jpg||".jpg70",e=com.modestmaps,f=1;return a.setProvider=g,wax.bwdetect(b,function(b){f=b,g(a.provider)})},wax=wax||{},wax.mm=wax.mm||{},wax.mm.fullscreen=function(a){function f(a){a&&com.modestmaps.cancelEvent(a),b?c.original():c.full()}var b=!1,c={},d,e;return c.add=function(a){return d=document.createElement("a"),d.className="wax-fullscreen",d.href="#fullscreen",d.innerHTML="fullscreen",com.modestmaps.addEvent(d,"click",f),this},c.full=function(){if(b)return;b=!0,e=[a.parent.offsetWidth,a.parent.offsetHeight],a.parent.className+=" wax-fullscreen-map",a.setSize(a.parent.offsetWidth,a.parent.offsetHeight)},c.original=function(){if(!b)return;b=!1,a.parent.className=a.parent.className.replace("wax-fullscreen-map",""),a.setSize(e[0],e[1])},c.appendTo=function(a){return wax.util.$(a).appendChild(d),this},c.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.locationHash={stateChange:function(a){com.modestmaps.addEvent(window,"hashchange",function(){a(location.hash.substring(1))},!1)},getState:function(){return location.hash.substring(1)},pushState:function(a){location.hash="#"+a}},wax.mm.pushState={stateChange:function(a){com.modestmaps.addEvent(window,"popstate",function(b){b.state&&b.state.map_location&&a(b.state.map_location)},!1)},getState:function(){if(!window.history||!window.history.state)return;return history.state&&history.state.map_location},pushState:function(a){if(!window.history||!window.history.pushState)return;window.history.pushState({map_location:a},document.title,window.location.href)}},wax.mm.hash=function(a,b,c){function g(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}}function h(a,b){return g(a,b,!1)}function k(){var a=j();d!==a&&(d=a,c.manager.pushState(d))}function l(a){if(a===d)return;i(d=a)&&k()}c=c||{};var d,e={},f=90-1e-8;c.manager=c.manager||wax.mm.pushState;var i=function(b){var c=b.split("/");for(var d=0;d<c.length;d++){c[d]=Number(c[d]);if(isNaN(c[d]))return!0}if(c.length<3)return!0;c.length==3&&a.setCenterZoom(new com.modestmaps.Location(c[1],c[2]),c[0])},j=function(){var b=a.getCenter(),c=a.getZoom(),d=Math.max(0,Math.ceil(Math.log(c)/Math.LN2));return[c.toFixed(2),b.lat.toFixed(d),b.lon.toFixed(d)].join("/")},m=function(){c.defaultCenter&&a.setCenter(c.defaultCenter),c.defaultZoom&&a.setZoom(c.defaultZoom)};return e.add=function(a){return c.manager.getState()?l(c.manager.getState()):(m(),k()),a.addCallback("drawn",h(k,500)),c.manager.stateChange(l),this},e.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.interaction=function(a,b,c){function q(){var b=a.createOrGetLayer(Math.round(a.getZoom()));return p||(p=function(a){var c=[];for(var d in a)if(a[d].parentNode===b){var e=wax.util.offset(a[d]);c.push([e.top,e.left,a[d]])}return c}(a.tiles))}function r(a,b){p=null}function s(a){for(var b=0,c=q();b<c.length;b++)if(c[b][0]<a.y&&c[b][0]+256>a.y&&c[b][1]<a.x&&c[b][1]+256>a.x)return c[b][2];return!1}function t(){return k?(window.clearTimeout(k),k=null,!0):!1}function u(b){if(j)return;var c=wax.util.eventoffset(b),d=s(c),g;d&&e.getGrid(d.src,function(e,h){if(e||!h)return;(g=h.tileFeature(c.x,c.y,d,{format:"teaser"}))?g&&m!==g?(m=g,f.out(a.parent),f.over(g,a.parent,0,b)):g||(m=null,f.out(a.parent)):(m=null,f.out(a.parent))})}function v(b){if(t())return;j=!0,n=wax.util.eventoffset(b),b.type==="mousedown"?d.addEvent(document.body,"mouseup",x):b.type==="touchstart"&&b.touches.length===1&&(g=["full","teaser"],f._currentTooltip&&f.hideTooltip(f._currentTooltip),d.addEvent(a.parent,"touchend",x),d.addEvent(a.parent,"touchmove",w))}function w(){d.removeEvent(a.parent,"touchend",x),d.removeEvent(a.parent,"touchmove",x),j=!1}function x(b){var c=wax.util.eventoffset(b);return d.removeEvent(document.body,"mouseup",x),a.parent.ontouchend&&(d.removeEvent(a.parent,"touchend",x),d.removeEvent(a.parent,"touchmove",_touchCancel)),j=!1,b.type==="touchend"?y(b,n):Math.round(c.y/o)===Math.round(n.y/o)&&Math.round(c.x/o)===Math.round(n.x/o)&&(k=window.setTimeout(function(a){return function(b){k=null,y(b,a)}}(c),300)),x}function y(b,c){var d=s(c),i;d&&e.getGrid(d.src,function(e,j){for(var k=0;j&&k<g.length;k++)if(i=j.tileFeature(c.x,c.y,d,{format:g[k]}))switch(g[k]){case"full":case"teaser":return f.click(i,a.parent,0,b);case"location":return h(i)}})}c=c||{},b=b||{};var d=com.modestmaps,e=wax.GridManager(b),f=c.callbacks||new wax.tooltip(c),g=c.clickAction||["full","location"],h=c.clickHandler||function(a){window.location=a},i={},j=!1,k=!1,l="ontouchstart"in document.documentElement,m,n,o=4,p;return i.add=function(){var b=["zoomed","panned","centered","extentset","resized","drawn"];for(var c=0;c<b.length;c++)a.addCallback(b[c],r);return d.addEvent(a.parent,"mousemove",u),d.addEvent(a.parent,"mousedown",v),l&&d.addEvent(a.parent,"touchstart",v),this},i.remove=function(){var b=["zoomed","panned","centered","extentset","resized","drawn"];for(var c=0;c<b.length;c++)a.removeCallback(b[c],r);return d.removeEvent(a.parent,"mousemove",u),d.removeEvent(a.parent,"mousedown",v),l&&d.removeEvent(a.parent,"touchstart",v),f._currentTooltip&&f.hideTooltip(f._currentTooltip),this},i.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.legend=function(a,b){b=b||{};var c,d={};return d.add=function(){return c=wax.legend().content(b.legend||""),this},d.content=function(a){a&&c.content(a.legend||"")},d.element=function(){return c.element()},d.appendTo=function(a){return wax.util.$(a).appendChild(c.element()),this},d.add()},wax=wax||{},wax.mm=wax.mm||{},wax.mm.mobile=function(a,b,c){c=c||{};var d=com.modestmaps,e=navigator.userAgent.toLowerCase(),f=e.indexOf("webkit")!=-1,g=e.indexOf("mobile")!=-1,h=g&&f,i=function(a){var b=document.createElement("canvas"),c=parseInt(a.style.width,10),d=parseInt(a.style.height,10),e=c/2,f=d/2,g=Math.min(c,d)/4,h=b.getContext("2d");b.setAttribute("width",c),b.setAttribute("height",d),h.globalAlpha=.5;var i=h.createLinearGradient(0,0,300,225);i.addColorStop(0,"black"),i.addColorStop(1,"rgb(200, 200, 200)"),h.fillStyle=i,h.fillRect(0,0,c,d),h.fillStyle="rgb(255, 255, 255)",h.beginPath(),h.moveTo(e-g*.6,f-g),h.lineTo(e-g*.6,f+g),h.lineTo(e+g*.6,f),h.fill(),a.appendChild(b)},j=function(a){a.style.position="absolute",a.style.height="50px",a.style.left=a.style.right="0";var b=document.createElement("canvas");b.setAttribute("width",a.offsetWidth),b.setAttribute("height",a.offsetHeight);var c=b.getContext("2d");c.globalAlpha=1,c.fillStyle="rgba(255, 255, 255, 0.5)",c.fillRect(0,0,a.offsetWidth,a.offsetHeight),c.fillStyle="rgb(0, 0, 0)",c.font="bold 20px sans-serif",c.fillText("back",20,30),a.appendChild(b)},k=function(a){a.style.position="absolute",a.style.width=a.style.height="auto",a.style.top=window.pageYOffset+"px",a.style.left=a.style.right="0px"},l=function(a){a.style.position="relative",a.style.width=a.style.height=a.style.top=a.style.left=a.style.right="auto"},m,n,o,p,q=c.overlayDraw||i,r=c.backDraw||j;bodyDraw=c.bodyDraw||function(){};var s={add:function(a){return h&&(p=document.createElement("meta"),p.id="wax-touch",p.setAttribute("name","viewport"),m=document.createElement("div"),m.id=a.parent.id+"-mobileoverlay",m.className="wax-mobileoverlay",m.style.position="absolute",m.style.width=a.dimensions.x+"px",m.style.height=a.dimensions.y+"px",a.parent.appendChild(m),q(m),o=document.createElement("div"),backDiv=document.createElement("div"),n=document.body,newBody=document.createElement("body"),newBody.className="wax-mobile-body",newBody.appendChild(backDiv),d.addEvent(m,"touchstart",this.toTouch),d.addEvent(backDiv,"touchstart",this.toPage)),this},toTouch:function(){a.parent.parentNode.replaceChild(o,a.parent),newBody.insertBefore(a.parent,backDiv),document.body=newBody,bodyDraw(newBody),r(backDiv),p.setAttribute("content","initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0"),document.head.appendChild(p),a._smallSize=[a.parent.clientWidth,a.parent.clientHeight],k(a.parent),a.setSize(a.parent.offsetWidth,window.innerHeight),backDiv.style.display="block",m.style.display="none"},toPage:function(){document.body=n,o.parentNode.replaceChild(a.parent,o),l(a.parent),a.setSize(a._smallSize[0],a._smallSize[1]),backDiv.style.display="none",m.style.display="block"}};return s.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.pointselector=function(a,b,c){function l(b){var c=wax.util.eventoffset(b),d=new h.Point(c.x,c.y),e={x:parseFloat(h.getStyle(document.documentElement,"margin-left")),y:parseFloat(h.getStyle(document.documentElement,"margin-top"))};isNaN(e.x)||(d.x-=e.x),isNaN(e.y)||(d.y-=e.y);for(var f=a.parent;f;f=f.offsetParent)d.x-=f.offsetLeft,d.y-=f.offsetTop;return d}function m(a){var b=[];for(var c=0;c<a.length;c++)b.push(new h.Location(a[c].lat,a[c].lon));return b}function n(){var b=new h.Point(0,0);for(var c=0;c<j.length;c++){var d=a.locationPoint(j[c]);j[c].pointDiv||(j[c].pointDiv=document.createElement("div"),j[c].pointDiv.className="wax-point-div",j[c].pointDiv.style.position="absolute",j[c].pointDiv.style.display="block",j[c].pointDiv.location=j[c],h.addEvent(j[c].pointDiv,"mouseup",function(b){var d=j[c];return function(b){h.removeEvent(a.parent,"mouseup",p),i.deletePoint(d,b)}}()),a.parent.appendChild(j[c].pointDiv)),j[c].pointDiv.style.left=d.x+"px",j[c].pointDiv.style.top=d.y+"px"}}function o(b){d=l(b),h.addEvent(a.parent,"mouseup",p)}function p(b){if(!d)return;e=l(b),h.Point.distance(d,e)<f&&(i.addLocation(a.pointLocation(d)),k(m(j))),d=null}var d=null,e=null,f=5,g,h=com.modestmaps,i={},j=[],k=typeof c=="function"?c:c.callback;return i.addLocation=function(a){j.push(a),n(),k(m(j))},i.add=function(a){return h.addEvent(a.parent,"mousedown",o),a.addCallback("drawn",n()),this},i.deletePoint=function(a,b){confirm("Delete this point?")&&(a.pointDiv.parentNode.removeChild(a.pointDiv),j.splice(wax.util.indexOf(j,a),1),k(m(j)))},i.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.zoombox=function(a){function g(b){var d=new c.Point(b.clientX,b.clientY);d.x+=document.body.scrollLeft+document.documentElement.scrollLeft,d.y+=document.body.scrollTop+document.documentElement.scrollTop;for(var e=a.parent;e;e=e.offsetParent)d.x-=e.offsetLeft,d.y-=e.offsetTop;return d}function h(b){if(!d)return;d=!1;var i=g(b),k=a.pointLocation(i),l=a.pointLocation(f);a.setExtent([k,l]),e.style.display="none",c.removeEvent(a.parent,"mousemove",j),c.removeEvent(a.parent,"mouseup",h),a.parent.style.cursor="auto"}function i(b){if(!b.shiftKey||!!this.drawing)return;return d=!0,f=g(b),e.style.left=f.x+"px",e.style.top=f.y+"px",c.addEvent(a.parent,"mousemove",j),c.addEvent(a.parent,"mouseup",h),a.parent.style.cursor="crosshair",c.cancelEvent(b)}function j(a){if(!d)return;var b=g(a);return e.style.display="block",b.x<f.x?e.style.left=b.x+"px":e.style.left=f.x+"px",e.style.width=Math.abs(b.x-f.x)+"px",b.y<f.y?e.style.top=b.y+"px":e.style.top=f.y+"px",e.style.height=Math.abs(b.y-f.y)+"px",c.cancelEvent(a)}var b={},c=com.modestmaps,d=!1,e,f=null;return b.add=function(a){return e=e||document.createElement("div"),e.id=a.parent.id+"-zoombox-box",e.className="zoombox-box",a.parent.appendChild(e),c.addEvent(a.parent,"mousedown",i),this},b.remove=function(){a.parent.removeChild(e),c.removeEvent(a.parent,"mousedown",i)},b.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.zoomer=function(a){var b=com.modestmaps,c=document.createElement("a");c.innerHTML="+",c.href="#",c.className="zoomer zoomin",b.addEvent(c,"mousedown",function(a){b.cancelEvent(a)}),b.addEvent(c,"dblclick",function(a){b.cancelEvent(a)}),b.addEvent(c,"click",function(c){b.cancelEvent(c),a.zoomIn()},!1);var d=document.createElement("a");d.innerHTML="-",d.href="#",d.className="zoomer zoomout",b.addEvent(d,"mousedown",function(a){b.cancelEvent(a)}),b.addEvent(d,"dblclick",function(a){b.cancelEvent(a)}),b.addEvent(d,"click",function(c){b.cancelEvent(c),a.zoomOut()},!1);var e={add:function(a){return a.addCallback("drawn",function(a,b){a.coordinate.zoom===a.provider.outerLimits()[0].zoom?d.className="zoomer zoomout zoomdisabled":a.coordinate.zoom===a.provider.outerLimits()[1].zoom?c.className="zoomer zoomin zoomdisabled":(c.className="zoomer zoomin",d.className="zoomer zoomout")}),this},appendTo:function(a){return wax.util.$(a).appendChild(c),wax.util.$(a).appendChild(d),this}};return e.add(a)};var wax=wax||{};wax.mm=wax.mm||{},wax.mm.connector=function(a){this.options={tiles:a.tiles,scheme:a.scheme||"xyz",minzoom:a.minzoom||0,maxzoom:a.maxzoom||22}},wax.mm.connector.prototype={outerLimits:function(){return[(new com.modestmaps.Coordinate(0,0,0)).zoomTo(this.options.minzoom),(new com.modestmaps.Coordinate(1,1,0)).zoomTo(this.options.maxzoom)]},getTileUrl:function(a){return(coord=this.sourceCoordinate(a))?(coord.row=this.options.scheme==="tms"?Math.pow(2,coord.zoom)-coord.row-1:coord.row,this.options.tiles[parseInt(Math.pow(2,coord.zoom)*coord.row+coord.column,10)%this.options.tiles.length].replace("{z}",coord.zoom.toFixed(0)).replace("{x}",coord.column.toFixed(0)).replace("{y}",coord.row.toFixed(0))):null}},com&&com.modestmaps&&com.modestmaps.extend(wax.mm.connector,com.modestmaps.MapProvider)

@@ -1,6 +0,6 @@

/* wax - 3.0.5 - 1.0.4-361-g59892a1 */
/* wax - 3.0.6 - 1.0.4-372-g3e9b147 */
/*!
* Reqwest! A x-browser general purpose XHR connection manager
* Reqwest! A general purpose XHR connection manager
* copyright Dustin Diaz 2011

@@ -10,4 +10,3 @@ * https://github.com/ded/reqwest

*/
!function(window){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText,JSON;switch(type){case"json":resp=JSON?JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){if(/\.json$/.test(a))return"json";if(/\.jsonp$/.test(a))return"jsonp";if(/\.js$/.test(a))return"js";if(/\.html?$/.test(a))return"html";if(/\.xml$/.test(a))return"xml";return"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var f=xhr();f.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(f,a),f.onreadystatechange=readyState(f,b,c),a.before&&a.before(f),f.send(a.data||null);return f}var d=doc.createElement("script");window[getCallbackName(a)]=generalCallback,d.type="text/javascript",d.src=a.url,d.async=!0;var e=function(){a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(d)};d.onload=e,d.onreadystatechange=function(){/^loaded|complete$/.test(d.readyState)&&e()},head.appendChild(d)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest");if(b.data){c["Content-type"]=c["Content-type"]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}}function readyState(a,b,c){return function(){a&&a.readyState==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",head=doc[byTag]("head")[0],xhr="XMLHttpRequest"in window?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")},uniqid=0,lastValue;Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=a[byTag]("input"),c=a[byTag]("select"),d=a[byTag]("textarea");return(v(b).chain().toArray().map(serial).value().join("")+v(c).chain().toArray().map(serial).value().join("")+v(d).chain().toArray().map(serial).value().join("")).replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=window.reqwest;reqwest.noConflict=function(){window.reqwest=old;return this},window.reqwest=reqwest}(this)
// Instantiate objects based on a JSON "record". The record must be a statement
!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){if(/\.json$/.test(a))return"json";if(/\.jsonp$/.test(a))return"jsonp";if(/\.js$/.test(a))return"js";if(/\.html?$/.test(a))return"html";if(/\.xml$/.test(a))return"xml";return"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var f=xhr();f.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(f,a),f.onreadystatechange=handleReadyState(f,b,c),a.before&&a.before(f),f.send(a.data||null);return f}var d=doc.createElement("script"),e=0;win[getCallbackName(a)]=generalCallback,d.type="text/javascript",d.src=a.url,d.async=!0,d.onload=d.onreadystatechange=function(){if(d[readyState]&&d[readyState]!=="complete"&&d[readyState]!=="loaded"||e)return!1;d.onload=d.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(d),e=1},head.appendChild(d)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){context.reqwest=old;return this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window)// Instantiate objects based on a JSON "record". The record must be a statement
// array in the following form:

@@ -727,7 +726,8 @@ //

// Add additional CSS3 transform handling.
// These features are used by Google Maps API V3.
var style = el.style.transform ||
el.style['-webkit-transform'] ||
el.style.MozTransform;
el.style.WebkitTransform ||
el.style.OTransform ||
el.style.MozTransform ||
el.style.msTransform;
if (style) {

@@ -744,2 +744,5 @@ if (match = style.match(/translate\((.+)px, (.+)px\)/)) {

left += parseInt(pts[12], 10);
} else if (match = style.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/)) {
top += parseInt(match[2], 10);
left += parseInt(match[1], 10);
}

@@ -746,0 +749,0 @@ }

@@ -1,6 +0,6 @@

/* wax - 3.0.5 - 1.0.4-361-g59892a1 *//*!
* Reqwest! A x-browser general purpose XHR connection manager
/* wax - 3.0.6 - 1.0.4-372-g3e9b147 *//*!
* Reqwest! A general purpose XHR connection manager
* copyright Dustin Diaz 2011
* https://github.com/ded/reqwest
* license MIT
*/!function(window){function readyState(a,b,c){return function(){a&&a.readyState==4&&(twoHundo.test(a.status)?b(a):c(a))}}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest");if(b.data){c["Content-type"]=c["Content-type"]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function generalCallback(a){lastValue=a}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=readyState(d,b,c),a.before&&a.before(d),d.send(a.data||null);return d}var e=doc.createElement("script");window[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0;var f=function(){a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e)};e.onload=f,e.onreadystatechange=function(){/^loaded|complete$/.test(e.readyState)&&f()},head.appendChild(e)}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function setType(a){if(/\.json$/.test(a))return"json";if(/\.jsonp$/.test(a))return"jsonp";if(/\.js$/.test(a))return"js";if(/\.html?$/.test(a))return"html";if(/\.xml$/.test(a))return"xml";return"js"}function init(o,fn){function complete(a){o.complete&&o.complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText,JSON;switch(type){case"json":resp=JSON?JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function error(a){o.error&&o.error(a),complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function reqwest(a,b){return new Reqwest(a,b)}function enc(a){return encodeURIComponent(a)}function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",head=doc[byTag]("head")[0],xhr="XMLHttpRequest"in window?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")},uniqid=0,lastValue;Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=a[byTag]("input"),c=a[byTag]("select"),d=a[byTag]("textarea");return(v(b).chain().toArray().map(serial).value().join("")+v(c).chain().toArray().map(serial).value().join("")+v(d).chain().toArray().map(serial).value().join("")).replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=window.reqwest;reqwest.noConflict=function(){window.reqwest=old;return this},window.reqwest=reqwest}(this);var wax=wax||{};Array.prototype.reduce||(Array.prototype.reduce=function(a){"use strict";if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;if(c==0&&arguments.length==1)throw new TypeError;var d=0,e;if(arguments.length>=2)e=arguments[1];else do{if(d in b){e=b[d++];break}if(++d>=c)throw new TypeError}while(!0);while(d<c)d in b&&(e=a.call(undefined,e,b[d],d,b)),d++;return e}),wax.Record=function(a,b){var c=function(a,b){var c=a.split(".").reduce(function(a,b){return[a[1]||a[0],a[1]?a[1][b]:a[0][b]]},[b||window,null]);if(c[0]&&c[1])return c;throw a+" not found."},d=function(a,b){var d=c(a),e;b=b.length?wax.Record(b):[];if(Object.create)e=Object.create(d[1].prototype),d[1].apply(e,b);else switch(b.length){case 0:e=new d[1];break;case 1:e=new d[1](b[0]);break;case 2:e=new d[1](b[0],b[1]);break;case 3:e=new d[1](b[0],b[1],b[2]);break;case 4:e=new d[1](b[0],b[1],b[2],b[3]);break;case 5:e=new d[1](b[0],b[1],b[2],b[3],b[4]);break;default:}return e},e=function(a,b,d){var e=c(a,d),f=b.length?wax.Record(b):[];return d&&a.indexOf(".")===-1?e[1].apply(d,f):e[1].apply(e[0],f)},f=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@literal","@chain","@inject","@group"],a.split(" ")[0])!==-1},g=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@chain"],a.split(" ")[0])!==-1},h=function(a){if(wax.util.isArray(a)&&a[0]&&f(a[0]))return{verb:a[0].split(" ")[0],subject:a[0].split(" ")[1],object:a.slice(1)};return!1},i,j=!1,k=null,l=null,m=h(a);if(!m){if(a!==null&&typeof a=="object"){var n=wax.util.keys(a);for(i=0;i<n.length;i++){var o=n[i];a[o]=wax.Record(a[o],b)}return a}return a}switch(m.verb){case"@group":for(i=0;i<m.object.length;i++)k=wax.Record(m.object[i],b),l=h(m.object[i]),l&&g(l.verb)&&(b=k);return b;case"@new":return d(m.subject,m.object);case"@literal":j=c(m.subject);return j?j[1]:null;case"@inject":return e(m.subject,m.object,b);case"@chain":return e(m.subject,m.object,b);case"@call":return e(m.subject,m.object,null)}},wax=wax||{},wax.attribution=function(){var a,b={};b.set=function(b){if(typeof b!="undefined"){a.innerHTML=b;return this}},b.element=function(){return a},b.init=function(){a=document.createElement("div"),a.className="wax-attribution";return this};return b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){g&&h();return this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add();return c},wax.formatter=function(x){var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};formatter.format=function(a,b){try{return f(a,b)}catch(c){console&&console.log(c)}};return formatter},wax.GridInstance=function(a,b,c){function f(a){a>=93&&a--,a>=35&&a--,a-=32;return a}c=c||{};var d={},e=c.resolution||4;tileSize=c.tileSize||256,d.gridFeature=function(b,c){if(!!a&&!!a.grid){if(c<0||b<0)return;if(Math.floor(c)>tileSize||Math.floor(b)>tileSize)return;var d=f(a.grid[Math.floor(c/e)].charCodeAt(Math.floor(b/e)));if(a.keys[d]&&a.data[a.keys[d]])return a.data[a.keys[d]]}},d.tileFeature=function(a,c,d,e){var f=wax.util.offset(d);feature=this.gridFeature(a-f.left,c-f.top);if(feature)return b.format(e,feature)};return d},wax.GridManager=function(a){function i(a){typeof a=="string"&&(a=[a]);return function(c){if(!!c){var d=/(\d+)\/(\d+)\/(\d+)\.[\w\._]+/g.exec(c);if(!d)return;return a[parseInt(d[2],10)%a.length].replace("{z}",d[1]).replace("{x}",d[2]).replace("{y}",d[3])}}}function h(a,b){if(typeof e!="undefined")return b(null,e);wax.request.get(f(a),function(a,c){c&&c.formatter?e=wax.formatter(c.formatter):e=!1;return b(a,e)})}a=a||{};var b=a.resolution||4,c={},d={},e,f=function(a){return a.replace(/\d+\/\d+\/\d+\.\w+/,"layer.json")},g=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};d.formatter=function(a){if(!arguments.length)return e;e=wax.formatter(a);return d},d.formatterUrl=function(a){if(!arguments.length)return f;f=typeof a=="string"?function(){return a}:a;return d},d.gridUrl=function(a){if(!arguments.length)return g;g=typeof a=="function"?a:i(a);return d},d.getGrid=function(a,c){h(a,function(d,e){var f=g(a);if(d||!e||!f)return c(d,null);wax.request.get(f,function(a,d){if(a)return c(a,null);c(null,wax.GridInstance(d,e,{resolution:b||4}))})});return d},a.formatter&&d.formatter(a.formatter),a.grids&&d.gridUrl(a.grids);return d};var wax=wax||{};wax.legend=function(){var a,b={},c;b.element=function(){return c},b.content=function(b){if(!arguments.length)return a.innerHTML;b?(a.innerHTML=b,a.style.display="block"):(a.innerHTML="",a.style.display="none");return this},b.add=function(){c=document.createElement("div"),c.className="wax-legends",a=document.createElement("div"),a.className="wax-legend",a.style.display="none",c.appendChild(a);return this};return b.add()};var w=function(a){a.melt=function(b,c){return b.apply(c,[a,c])};return a},wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(!this.locks[a]){var c=this;this.locks[a]=!0,reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}}};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(a){this._currentTooltip=undefined,a=a||{},a.animationOut&&(this.animationOut=a.animationOut),a.animationIn&&(this.animationIn=a.animationIn)},wax.tooltip.prototype.isPopup=function(a){return a&&a.className.indexOf("wax-popup")!==-1},wax.tooltip.prototype.getTooltip=function(a,b,c,d){tooltip=document.createElement("div"),tooltip.className="wax-tooltip wax-tooltip-"+c,tooltip.innerHTML=a,b.appendChild(tooltip);return tooltip},wax.tooltip.prototype.hideTooltip=function(a){if(!!a){var b,c=function(){this.parentNode&&this.parentNode.removeChild(this)};a.style["-webkit-transition"]!==undefined&&this.animationOut?b="webkitTransitionEnd":a.style.MozTransition!==undefined&&this.animationOut&&(b="transitionend"),b?(a.addEventListener(b,c,!1),a.addEventListener("transitionend",c,!1),a.className+=" "+this.animationOut):a.parentNode&&a.parentNode.removeChild(a)}},wax.tooltip.prototype.click=function(a,b,c){this.unselect(b);var d=this.getTooltip(a,b,c),e=document.createElement("a");e.href="#close",e.className="close",e.innerHTML="Close";var f=wax.util.bind(function(a){this.hideTooltip(d),this._currentTooltip=undefined,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault();return!1},this);e.addEventListener?e.addEventListener("click",f,!1):e.attachEvent&&e.attachEvent("onclick",f),d.className+=" wax-popup",d.innerHTML=a,d.appendChild(e),this._currentTooltip=d},wax.tooltip.prototype.select=function(a,b,c,d){if(!!a){if(this.isPopup(this._currentTooltip))return;this._currentTooltip=this.getTooltip(a,b,c,d),b.style.cursor="pointer"}},wax.tooltip.prototype.unselect=function(a){this.isPopup(this._currentTooltip)||(a.style.cursor="default",this._currentTooltip&&(this.hideTooltip(this._currentTooltip),this._currentTooltip=undefined))},wax.tooltip.prototype.out=wax.tooltip.prototype.unselect,wax.tooltip.prototype.over=wax.tooltip.prototype.select,wax.tooltip.prototype.click=wax.tooltip.prototype.click;var wax=wax||{};wax.util=wax.util||{},wax.util={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=0,e=0,f=function(a){if(a!==document.body&&a!==document.documentElement){d+=a.offsetTop,e+=a.offsetLeft;var b=a.style.transform||a.style["-webkit-transform"]||a.style.MozTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");d+=parseInt(c[13],10),e+=parseInt(c[12],10)}}};f(a);try{while(a=a.offsetParent)f(a)}catch(g){}d+=document.body.offsetTop,e+=document.body.offsetLeft,d+=document.body.parentNode.offsetTop,e+=document.body.parentNode.offsetLeft;var h=document.defaultView?window.getComputedStyle(document.body.parentNode,null):document.body.parentNode.currentStyle;document.body.parentNode.offsetTop!==parseInt(h.marginTop,10)&&!isNaN(parseInt(h.marginTop,10))&&(d+=parseInt(h.marginTop,10),e+=parseInt(h.marginLeft,10));return{top:d,left:e,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},bind:function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,c.concat(Array.prototype.slice.call(arguments)))}},isString:function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},isArray:Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;if(!a)var a=window.event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}}};var wax=wax||{};wax.ol=wax.ol||{},wax.ol.Embedder=OpenLayers.Class(OpenLayers.Control,{initialize:function(a){a=a||{},OpenLayers.Control.prototype.initialize.apply(this,[a||{}])},setMap:function(a){$("#"+this.el+"-script").length&&(OpenLayers.Control.prototype.setMap.apply(this,arguments),$(a.div).prepend($('<input type="text" class="embed-src" />').css({"z-index":"9999999999",position:"relative"}).val("<div id='"+this.el+"-script'>"+$("#"+this.el+"-script").html()+"</div>"))),this.activate()},CLASS_NAME:"wax.ol.Embedder"});var wax=wax||{};wax.ol=wax.ol||{};var addEv=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)};wax.ol.Interaction=OpenLayers.Class(OpenLayers.Control,{feature:{},handlerOptions:null,handlers:null,gm:new wax.GridManager,initialize:function(a,b){this.options=b||{},this.clickAction=this.options.clickAction||"full",this.gm=new wax.GridManager(a),OpenLayers.Control.prototype.initialize.apply(this,[this.options||{}]),this.callbacks=this.options.callbacks||new wax.tooltip},setMap:function(a){addEv(a.viewPortDiv,"mousemove",wax.util.bind(this.getInfoForHover,this)),addEv(a.viewPortDiv,"mouseout",wax.util.bind(this.resetLayers,this)),this.clickHandler=new OpenLayers.Handler.Click(this,{click:this.getInfoForClick}),this.clickHandler.setMap(a),this.clickHandler.activate(),a.events.on({addlayer:this.resetLayers,changelayer:this.resetLayers,removelayer:this.resetLayers,changebaselayer:this.resetLayers,scope:this}),OpenLayers.Control.prototype.setMap.apply(this,arguments)},getTileStack:function(a,b){if(!a||!b)return[];var c=[];layerfound:for(var d=0;d<a.length;d++)for(var e=0;e<a[d].grid.length;e++)for(var f=0;f<a[d].grid[e].length;f++){if(a[d].grid[e][f].imgDiv)var g=wax.util.offset(a[d].grid[e][f].imgDiv);else var g=wax.util.offset(a[d].grid[e][f].frame);if(g&&g.top<b.y&&g.top+256>b.y&&g.left<b.x&&g.left+256>b.x){c.push(a[d].grid[e][f]);continue layerfound}}return c},viableLayers:function(){if(this._viableLayers)return this._viableLayers;this._viableLayers=[];for(var a in this.map.layers)this.map.layers[a].visibility===!0&&this.map.layers[a].CLASS_NAME==="OpenLayers.Layer.TMS"&&this._viableLayers.push(this.map.layers[a]);return this._viableLayers},resetLayers:function(a){this._viableLayers=null;var b=a.relatedTarget||a.toElement;b&&b.className!=="olTileImage"&&this.callbacks.out(this.map.viewPortDiv)},getInfoForClick:function(a){if(!!a){var b=this.viableLayers(),c=wax.util.eventoffset(a),d=this.getTileStack(this.viableLayers(),c),e=null,f=null,g=this;for(var h=0;h<d.length;h++){if(!d[h].url)continue;this.gm.getGrid(d[h].url,function(a,b){if(!!b){var e=b.tileFeature(c.x,c.y,d[h].frame,{format:g.clickAction});if(e)switch(g.clickAction){case"full":g.callbacks.click(e,d[h].layer.map.viewPortDiv,h);break;case"location":window.location=e}}})}}},getInfoForHover:function(a){if(!!a){var b={format:"teaser"},c=this.viableLayers(),d=wax.util.eventoffset(a),e=this.getTileStack(this.viableLayers(),d),f=null,g=null,h=this;for(var i=0;i<e.length;i++){if(!e[i].url)continue;this.gm.getGrid(e[i].url,function(c,f){if(f&&e[i]){var g=f.tileFeature(d.x,d.y,e[i].frame,b);if(g){if(!e[i])return;g&&h.feature[i]!==g?(h.feature[i]=g,h.callbacks.out(e[i].layer.map.div),h.callbacks.over(g,e[i].layer.map.div,i,a)):g||(h.feature[i]=null,h.callbacks.out(e[i].layer.map.div))}else h.feature[i]&&h.callbacks.out(e[i].layer.map.div),h.feature[i]=null}})}}},CLASS_NAME:"wax.ol.Interaction"});var wax=wax||{};wax.ol=wax.ol||{},wax.ol.Legend=OpenLayers.Class(OpenLayers.Control,{CLASS_NAME:"wax.ol.Legend",legend:null,options:null,initialize:function(a){this.options=a||{},OpenLayers.Control.prototype.initialize.apply(this,[a||{}])},activate:function(){this.legend=new wax.Legend(this.map.viewPortDiv,this.options.container);return OpenLayers.Control.prototype.activate.apply(this,arguments)},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments),this.activate(),this.map.events.on({addlayer:this.setLegend,changelayer:this.setLegend,removelayer:this.setLegend,changebaselayer:this.setLegend,scope:this})},setLegend:function(){var a=[];for(var b=0;b<this.map.layers.length;b++){var c=this.map.layers[b];c&&c.getURL&&c.visibility&&a.push(c.getURL(new OpenLayers.Bounds))}this.legend.render(a)}});var wax=wax||{};wax.ol=wax.ol||{},wax.ol.Switcher=OpenLayers.Class(OpenLayers.Control,{CLASS_NAME:"wax.ol.Switcher",initialize:function(a){this.$element=$(a.e),this.options=a||{},OpenLayers.Control.prototype.initialize.apply(this,[a||{}])},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments),this.map.events.on({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this}),this.redraw()},layerClick:function(a){var b=a.currentTarget,c=$(b).data("layer");$("a.active",this.$element).removeClass("active"),$.each(this.map.getLayersBy("isBaseLayer",!1),function(){this.CLASS_NAME!=="OpenLayers.Layer.Vector.RootContainer"&&this.displayInLayerSwitcher&&this.setVisibility(!1)}),c.setVisibility(!0),$(b).addClass("active")},needsRedraw:function(){if(!this.layerStates||this.layerStates.length||this.map.layers.length!=this.layerStates.length)return!0;for(var a=0,b=this.layerStates.length;a<b;a++){var c=this.layerStates[a],d=this.map.layers[a];if(c.name!=d.name||c.inRange!=d.inRange||c.id!=d.id||c.visibility!=d.visibility)return!0}return!1},redraw:function(){if(this.needsRedraw()){this.$element.html("");var a=this.map.layers.length;this.layerStates=[];for(var b=0;b<a;b++){var c=this.map.layers[b];this.layerStates[b]={name:c.name,visibility:c.visibility,inRange:c.inRange,id:c.id}}var d=this.map.layers.slice();for(b=0,a=d.length;b<a;b++){var e=d[b];if(e.displayInLayerSwitcher){var f=e.isBaseLayer?e===this.map.baseLayer:e.getVisibility(),g=$.proxy(function(a){this.layerClick(a);return!1},this),h=$("<a></a>");h.click(g).attr("href","#").text(e.name).addClass("layer-toggle").data("layer",e).attr("disabled",!e.inRange),f&&h.addClass("active")}this.$element.append(h),this.$element.trigger("layeradded",h)}}}})
*/!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();return d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=handleReadyState(d,b,c),a.before&&a.before(d),d.send(a.data||null),d}var e=doc.createElement("script"),f=0;win[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0,e.onload=e.onreadystatechange=function(){if(e[readyState]&&e[readyState]!=="complete"&&e[readyState]!=="loaded"||f)return!1;e.onload=e.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e),f=1},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;return a.url=a.url.substr(0,a.url.length-1)+c,c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){return context.reqwest=old,this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window);var wax=wax||{};Array.prototype.reduce||(Array.prototype.reduce=function(a){"use strict";if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;if(c==0&&arguments.length==1)throw new TypeError;var d=0,e;if(arguments.length>=2)e=arguments[1];else do{if(d in b){e=b[d++];break}if(++d>=c)throw new TypeError}while(!0);while(d<c)d in b&&(e=a.call(undefined,e,b[d],d,b)),d++;return e}),wax.Record=function(a,b){var c=function(a,b){var c=a.split(".").reduce(function(a,b){return[a[1]||a[0],a[1]?a[1][b]:a[0][b]]},[b||window,null]);if(c[0]&&c[1])return c;throw a+" not found."},d=function(a,b){var d=c(a),e;b=b.length?wax.Record(b):[];if(Object.create)e=Object.create(d[1].prototype),d[1].apply(e,b);else switch(b.length){case 0:e=new d[1];break;case 1:e=new d[1](b[0]);break;case 2:e=new d[1](b[0],b[1]);break;case 3:e=new d[1](b[0],b[1],b[2]);break;case 4:e=new d[1](b[0],b[1],b[2],b[3]);break;case 5:e=new d[1](b[0],b[1],b[2],b[3],b[4]);break;default:}return e},e=function(a,b,d){var e=c(a,d),f=b.length?wax.Record(b):[];return d&&a.indexOf(".")===-1?e[1].apply(d,f):e[1].apply(e[0],f)},f=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@literal","@chain","@inject","@group"],a.split(" ")[0])!==-1},g=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@chain"],a.split(" ")[0])!==-1},h=function(a){return wax.util.isArray(a)&&a[0]&&f(a[0])?{verb:a[0].split(" ")[0],subject:a[0].split(" ")[1],object:a.slice(1)}:!1},i,j=!1,k=null,l=null,m=h(a);if(!m){if(a!==null&&typeof a=="object"){var n=wax.util.keys(a);for(i=0;i<n.length;i++){var o=n[i];a[o]=wax.Record(a[o],b)}return a}return a}switch(m.verb){case"@group":for(i=0;i<m.object.length;i++)k=wax.Record(m.object[i],b),l=h(m.object[i]),l&&g(l.verb)&&(b=k);return b;case"@new":return d(m.subject,m.object);case"@literal":return j=c(m.subject),j?j[1]:null;case"@inject":return e(m.subject,m.object,b);case"@chain":return e(m.subject,m.object,b);case"@call":return e(m.subject,m.object,null)}},wax=wax||{},wax.attribution=function(){var a,b={};return b.set=function(b){if(typeof b=="undefined")return;return a.innerHTML=b,this},b.element=function(){return a},b.init=function(){return a=document.createElement("div"),a.className="wax-attribution",this},b.init()},wax=wax||{},wax.bwdetect=function(a,b){function h(){wax.bw=-1;var a=new Image;a.src=e;var b=!0,f=setTimeout(function(){b&&wax.bw==-1&&(c.bw(0),b=!1)},d);a.onload=function(){b&&wax.bw==-1&&(clearTimeout(f),c.bw(1),b=!1)}}var c={},d=a.threshold||400,e="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),f=1,g=a.auto===undefined?!0:a.auto;return c.bw=function(a){if(!arguments.length)return f;var c=f;wax.bwlisteners&&wax.bwlisteners.length&&function(){listeners=wax.bwlisteners,wax.bwlisteners=[];for(i=0;i<listeners;i++)listeners[i](a)}(),wax.bw=a,f!=(f=a)&&b(a)},c.add=function(){return g&&h(),this},wax.bw==-1?(wax.bwlisteners=wax.bwlisteners||[],wax.bwlisteners.push(c.bw)):wax.bw!==undefined?c.bw(wax.bw):c.add(),c},wax.formatter=function(x){var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};return formatter.format=function(a,b){try{return f(a,b)}catch(c){console&&console.log(c)}},formatter},wax.GridInstance=function(a,b,c){function f(a){return a>=93&&a--,a>=35&&a--,a-=32,a}c=c||{};var d={},e=c.resolution||4;return tileSize=c.tileSize||256,d.gridFeature=function(b,c){if(!a||!a.grid)return;if(c<0||b<0)return;if(Math.floor(c)>tileSize||Math.floor(b)>tileSize)return;var d=f(a.grid[Math.floor(c/e)].charCodeAt(Math.floor(b/e)));if(a.keys[d]&&a.data[a.keys[d]])return a.data[a.keys[d]]},d.tileFeature=function(a,c,d,e){var f=wax.util.offset(d);feature=this.gridFeature(a-f.left,c-f.top);if(feature)return b.format(e,feature)},d},wax.GridManager=function(a){function h(a,b){if(typeof e!="undefined")return b(null,e);wax.request.get(f(a),function(a,c){return c&&c.formatter?e=wax.formatter(c.formatter):e=!1,b(a,e)})}function i(a){return typeof a=="string"&&(a=[a]),function b(b){if(!b)return;var c=/(\d+)\/(\d+)\/(\d+)\.[\w\._]+/g.exec(b);if(!c)return;return a[parseInt(c[2],10)%a.length].replace("{z}",c[1]).replace("{x}",c[2]).replace("{y}",c[3])}}a=a||{};var b=a.resolution||4,c={},d={},e,f=function(a){return a.replace(/\d+\/\d+\/\d+\.\w+/,"layer.json")},g=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};return d.formatter=function(a){return arguments.length?(e=wax.formatter(a),d):e},d.formatterUrl=function(a){return arguments.length?(f=typeof a=="string"?function(){return a}:a,d):f},d.gridUrl=function(a){return arguments.length?(g=typeof a=="function"?a:i(a),d):g},d.getGrid=function(a,c){return h(a,function(d,e){var f=g(a);if(d||!e||!f)return c(d,null);wax.request.get(f,function(a,d){if(a)return c(a,null);c(null,wax.GridInstance(d,e,{resolution:b||4}))})}),d},a.formatter&&d.formatter(a.formatter),a.grids&&d.gridUrl(a.grids),d};var wax=wax||{};wax.legend=function(){var a,b={},c;return b.element=function(){return c},b.content=function(b){return arguments.length?(b?(a.innerHTML=b,a.style.display="block"):(a.innerHTML="",a.style.display="none"),this):a.innerHTML},b.add=function(){return c=document.createElement("div"),c.className="wax-legends",a=document.createElement("div"),a.className="wax-legend",a.style.display="none",c.appendChild(a),this},b.add()};var w=function(a){return a.melt=function(b,c){return b.apply(c,[a,c])},a},wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(this.locks[a])return;var c=this;this.locks[a]=!0,reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(a){this._currentTooltip=undefined,a=a||{},a.animationOut&&(this.animationOut=a.animationOut),a.animationIn&&(this.animationIn=a.animationIn)},wax.tooltip.prototype.isPopup=function(a){return a&&a.className.indexOf("wax-popup")!==-1},wax.tooltip.prototype.getTooltip=function(a,b,c,d){return tooltip=document.createElement("div"),tooltip.className="wax-tooltip wax-tooltip-"+c,tooltip.innerHTML=a,b.appendChild(tooltip),tooltip},wax.tooltip.prototype.hideTooltip=function(a){if(!a)return;var b,c=function(){this.parentNode&&this.parentNode.removeChild(this)};a.style["-webkit-transition"]!==undefined&&this.animationOut?b="webkitTransitionEnd":a.style.MozTransition!==undefined&&this.animationOut&&(b="transitionend"),b?(a.addEventListener(b,c,!1),a.addEventListener("transitionend",c,!1),a.className+=" "+this.animationOut):a.parentNode&&a.parentNode.removeChild(a)},wax.tooltip.prototype.click=function(a,b,c){this.unselect(b);var d=this.getTooltip(a,b,c),e=document.createElement("a");e.href="#close",e.className="close",e.innerHTML="Close";var f=wax.util.bind(function(a){return this.hideTooltip(d),this._currentTooltip=undefined,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),!1},this);e.addEventListener?e.addEventListener("click",f,!1):e.attachEvent&&e.attachEvent("onclick",f),d.className+=" wax-popup",d.innerHTML=a,d.appendChild(e),this._currentTooltip=d},wax.tooltip.prototype.select=function(a,b,c,d){if(!a)return;if(this.isPopup(this._currentTooltip))return;this._currentTooltip=this.getTooltip(a,b,c,d),b.style.cursor="pointer"},wax.tooltip.prototype.unselect=function(a){if(this.isPopup(this._currentTooltip))return;a.style.cursor="default",this._currentTooltip&&(this.hideTooltip(this._currentTooltip),this._currentTooltip=undefined)},wax.tooltip.prototype.out=wax.tooltip.prototype.unselect,wax.tooltip.prototype.over=wax.tooltip.prototype.select,wax.tooltip.prototype.click=wax.tooltip.prototype.click;var wax=wax||{};wax.util=wax.util||{},wax.util={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=0,e=0,f=function(a){if(a===document.body||a===document.documentElement)return;d+=a.offsetTop,e+=a.offsetLeft;var b=a.style.transform||a.style.WebkitTransform||a.style.OTransform||a.style.MozTransform||a.style.msTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");d+=parseInt(c[13],10),e+=parseInt(c[12],10)}else if(match=b.match(/matrix\(.+, .+, .+, .+, (.+), (.+)\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10)};f(a);try{while(a=a.offsetParent)f(a)}catch(g){}d+=document.body.offsetTop,e+=document.body.offsetLeft,d+=document.body.parentNode.offsetTop,e+=document.body.parentNode.offsetLeft;var h=document.defaultView?window.getComputedStyle(document.body.parentNode,null):document.body.parentNode.currentStyle;return document.body.parentNode.offsetTop!==parseInt(h.marginTop,10)&&!isNaN(parseInt(h.marginTop,10))&&(d+=parseInt(h.marginTop,10),e+=parseInt(h.marginLeft,10)),{top:d,left:e,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},bind:function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,c.concat(Array.prototype.slice.call(arguments)))}},isString:function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},isArray:Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;if(!a)var a=window.event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}}};var wax=wax||{};wax.ol=wax.ol||{},wax.ol.Embedder=OpenLayers.Class(OpenLayers.Control,{initialize:function(a){a=a||{},OpenLayers.Control.prototype.initialize.apply(this,[a||{}])},setMap:function(a){$("#"+this.el+"-script").length&&(OpenLayers.Control.prototype.setMap.apply(this,arguments),$(a.div).prepend($('<input type="text" class="embed-src" />').css({"z-index":"9999999999",position:"relative"}).val("<div id='"+this.el+"-script'>"+$("#"+this.el+"-script").html()+"</div>"))),this.activate()},CLASS_NAME:"wax.ol.Embedder"});var wax=wax||{};wax.ol=wax.ol||{};var addEv=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)};wax.ol.Interaction=OpenLayers.Class(OpenLayers.Control,{feature:{},handlerOptions:null,handlers:null,gm:new wax.GridManager,initialize:function(a,b){this.options=b||{},this.clickAction=this.options.clickAction||"full",this.gm=new wax.GridManager(a),OpenLayers.Control.prototype.initialize.apply(this,[this.options||{}]),this.callbacks=this.options.callbacks||new wax.tooltip},setMap:function(a){addEv(a.viewPortDiv,"mousemove",wax.util.bind(this.getInfoForHover,this)),addEv(a.viewPortDiv,"mouseout",wax.util.bind(this.resetLayers,this)),this.clickHandler=new OpenLayers.Handler.Click(this,{click:this.getInfoForClick}),this.clickHandler.setMap(a),this.clickHandler.activate(),a.events.on({addlayer:this.resetLayers,changelayer:this.resetLayers,removelayer:this.resetLayers,changebaselayer:this.resetLayers,scope:this}),OpenLayers.Control.prototype.setMap.apply(this,arguments)},getTileStack:function(a,b){if(!a||!b)return[];var c=[];d:for(var e=0;e<a.length;e++)for(var f=0;f<a[e].grid.length;f++)for(var g=0;g<a[e].grid[f].length;g++){if(a[e].grid[f][g].imgDiv)var h=wax.util.offset(a[e].grid[f][g].imgDiv);else var h=wax.util.offset(a[e].grid[f][g].frame);if(h&&h.top<b.y&&h.top+256>b.y&&h.left<b.x&&h.left+256>b.x){c.push(a[e].grid[f][g]);continue d}}return c},viableLayers:function(){if(this._viableLayers)return this._viableLayers;this._viableLayers=[];for(var a in this.map.layers)this.map.layers[a].visibility===!0&&this.map.layers[a].CLASS_NAME==="OpenLayers.Layer.TMS"&&this._viableLayers.push(this.map.layers[a]);return this._viableLayers},resetLayers:function(a){this._viableLayers=null;var b=a.relatedTarget||a.toElement;b&&b.className!=="olTileImage"&&this.callbacks.out(this.map.viewPortDiv)},getInfoForClick:function(a){if(!a)return;var b=this.viableLayers(),c=wax.util.eventoffset(a),d=this.getTileStack(this.viableLayers(),c),e=null,f=null,g=this;for(var h=0;h<d.length;h++){if(!d[h].url)continue;this.gm.getGrid(d[h].url,function(a,b){if(!b)return;var e=b.tileFeature(c.x,c.y,d[h].frame,{format:g.clickAction});if(e)switch(g.clickAction){case"full":g.callbacks.click(e,d[h].layer.map.viewPortDiv,h);break;case"location":window.location=e}})}},getInfoForHover:function(a){if(!a)return;var b={format:"teaser"},c=this.viableLayers(),d=wax.util.eventoffset(a),e=this.getTileStack(this.viableLayers(),d),f=null,g=null,h=this;for(var i=0;i<e.length;i++){if(!e[i].url)continue;this.gm.getGrid(e[i].url,function(c,f){if(f&&e[i]){var g=f.tileFeature(d.x,d.y,e[i].frame,b);if(g){if(!e[i])return;g&&h.feature[i]!==g?(h.feature[i]=g,h.callbacks.out(e[i].layer.map.div),h.callbacks.over(g,e[i].layer.map.div,i,a)):g||(h.feature[i]=null,h.callbacks.out(e[i].layer.map.div))}else h.feature[i]&&h.callbacks.out(e[i].layer.map.div),h.feature[i]=null}})}},CLASS_NAME:"wax.ol.Interaction"});var wax=wax||{};wax.ol=wax.ol||{},wax.ol.Legend=OpenLayers.Class(OpenLayers.Control,{CLASS_NAME:"wax.ol.Legend",legend:null,options:null,initialize:function(a){this.options=a||{},OpenLayers.Control.prototype.initialize.apply(this,[a||{}])},activate:function(){return this.legend=new wax.Legend(this.map.viewPortDiv,this.options.container),OpenLayers.Control.prototype.activate.apply(this,arguments)},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments),this.activate(),this.map.events.on({addlayer:this.setLegend,changelayer:this.setLegend,removelayer:this.setLegend,changebaselayer:this.setLegend,scope:this})},setLegend:function(){var a=[];for(var b=0;b<this.map.layers.length;b++){var c=this.map.layers[b];c&&c.getURL&&c.visibility&&a.push(c.getURL(new OpenLayers.Bounds))}this.legend.render(a)}});var wax=wax||{};wax.ol=wax.ol||{},wax.ol.Switcher=OpenLayers.Class(OpenLayers.Control,{CLASS_NAME:"wax.ol.Switcher",initialize:function(a){this.$element=$(a.e),this.options=a||{},OpenLayers.Control.prototype.initialize.apply(this,[a||{}])},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments),this.map.events.on({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this}),this.redraw()},layerClick:function(a){var b=a.currentTarget,c=$(b).data("layer");$("a.active",this.$element).removeClass("active"),$.each(this.map.getLayersBy("isBaseLayer",!1),function(){this.CLASS_NAME!=="OpenLayers.Layer.Vector.RootContainer"&&this.displayInLayerSwitcher&&this.setVisibility(!1)}),c.setVisibility(!0),$(b).addClass("active")},needsRedraw:function(){if(!this.layerStates||this.layerStates.length||this.map.layers.length!=this.layerStates.length)return!0;for(var a=0,b=this.layerStates.length;a<b;a++){var c=this.layerStates[a],d=this.map.layers[a];if(c.name!=d.name||c.inRange!=d.inRange||c.id!=d.id||c.visibility!=d.visibility)return!0}return!1},redraw:function(){if(this.needsRedraw()){this.$element.html("");var a=this.map.layers.length;this.layerStates=[];for(var b=0;b<a;b++){var c=this.map.layers[b];this.layerStates[b]={name:c.name,visibility:c.visibility,inRange:c.inRange,id:c.id}}var d=this.map.layers.slice();for(b=0,a=d.length;b<a;b++){var e=d[b];if(e.displayInLayerSwitcher){var f=e.isBaseLayer?e===this.map.baseLayer:e.getVisibility(),g=$.proxy(function(a){return this.layerClick(a),!1},this),h=$("<a></a>");h.click(g).attr("href","#").text(e.name).addClass("layer-toggle").data("layer",e).attr("disabled",!e.inRange),f&&h.addClass("active")}this.$element.append(h),this.$element.trigger("layeradded",h)}}}})
/*!
* Reqwest! A x-browser general purpose XHR connection manager
* Reqwest! A general purpose XHR connection manager
* copyright Dustin Diaz 2011

@@ -7,2 +7,2 @@ * https://github.com/ded/reqwest

*/
!function(window){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText,JSON;switch(type){case"json":resp=JSON?JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){if(/\.json$/.test(a))return"json";if(/\.jsonp$/.test(a))return"jsonp";if(/\.js$/.test(a))return"js";if(/\.html?$/.test(a))return"html";if(/\.xml$/.test(a))return"xml";return"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var f=xhr();f.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(f,a),f.onreadystatechange=readyState(f,b,c),a.before&&a.before(f),f.send(a.data||null);return f}var d=doc.createElement("script");window[getCallbackName(a)]=generalCallback,d.type="text/javascript",d.src=a.url,d.async=!0;var e=function(){a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(d)};d.onload=e,d.onreadystatechange=function(){/^loaded|complete$/.test(d.readyState)&&e()},head.appendChild(d)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest");if(b.data){c["Content-type"]=c["Content-type"]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}}function readyState(a,b,c){return function(){a&&a.readyState==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",head=doc[byTag]("head")[0],xhr="XMLHttpRequest"in window?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")},uniqid=0,lastValue;Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=a[byTag]("input"),c=a[byTag]("select"),d=a[byTag]("textarea");return(v(b).chain().toArray().map(serial).value().join("")+v(c).chain().toArray().map(serial).value().join("")+v(d).chain().toArray().map(serial).value().join("")).replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=window.reqwest;reqwest.noConflict=function(){window.reqwest=old;return this},window.reqwest=reqwest}(this)
!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){if(/\.json$/.test(a))return"json";if(/\.jsonp$/.test(a))return"jsonp";if(/\.js$/.test(a))return"js";if(/\.html?$/.test(a))return"html";if(/\.xml$/.test(a))return"xml";return"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var f=xhr();f.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(f,a),f.onreadystatechange=handleReadyState(f,b,c),a.before&&a.before(f),f.send(a.data||null);return f}var d=doc.createElement("script"),e=0;win[getCallbackName(a)]=generalCallback,d.type="text/javascript",d.src=a.url,d.async=!0,d.onload=d.onreadystatechange=function(){if(d[readyState]&&d[readyState]!=="complete"&&d[readyState]!=="loaded"||e)return!1;d.onload=d.onreadystatechange=null,a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(d),e=1},head.appendChild(d)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=[a[byTag]("input"),a[byTag]("select"),a[byTag]("textarea")],c=[],d,e;for(d=0,l=b.length;d<l;++d)for(e=0,l2=b[d].length;e<l2;++e)c.push(serial(b[d][e]));return c.join("").replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=context.reqwest;reqwest.noConflict=function(){context.reqwest=old;return this},typeof module!="undefined"?module.exports=reqwest:context.reqwest=reqwest}(this,window)
{
"name": "wax",
"version": "3.0.5",
"version": "3.0.6",
"description": "Tools for improving web maps.",

@@ -5,0 +5,0 @@ "author": {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc