diff --git a/build/css/storymap.css b/build/css/storymap.css index 4387692d..5c15d1f2 100644 --- a/build/css/storymap.css +++ b/build/css/storymap.css @@ -1,4 +1,4 @@ -/* storymapjs - v0.1.5 - 2013-12-20 +/* storymapjs - v0.1.6 - 2013-12-20 * Copyright (c) 2013 Northwestern University Knight Lab */ @@ -31,6 +31,8 @@ .vco-storymap h2{margin-top:20px;margin-bottom:5px} .vco-storymap p{margin-top:5px;margin-bottom:10px;font-size:15px;color:#666}.vco-storymap p b{font-weight:bold;line-height:15px;color:#333} .vco-storymap p i,.vco-storymap p em{font-style:italic;line-height:15px} +.vco-storymap a{text-decoration:none;color:#da0000} +.vco-storymap a:hover{text-decoration:underline;color:#740000} .vco-storymap .vco-caption,.vco-storymap .vco-credit,.vco-storymap .vco-slidenav-next,.vco-storymap .vco-slidenav-previous{font-size:11px;line-height:11px} .vco-storymap blockquote,.vco-storymap blockquote p{font-family:"Georgia",Times New Roman,Times,serif;color:#999;font-size:24px;line-height:24px;text-align:left;background:transparent;border:0;padding:0}.vco-storymap blockquote cite,.vco-storymap blockquote p cite{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:11px;color:#666;display:block;text-align:right;font-style:normal} .vco-storymap blockquote cite:before,.vco-storymap blockquote p cite:before{content:"\2014"} @@ -110,8 +112,15 @@ .vco-slide-media-only .vco-slide-content-container .vco-slide-content{text-align:center}.vco-slide-media-only .vco-slide-content-container .vco-slide-content .vco-media{text-align:center;position:relative;width:100%;min-width:50%;max-width:100%;float:none;margin-top:auto;margin-bottom:auto} .vco-slide-media-only .vco-slide-content-container .vco-slide-content .vco-text{width:100%;display:block;margin-left:auto;margin-right:auto;text-align:center}.vco-slide-media-only .vco-slide-content-container .vco-slide-content .vco-text h2{margin-top:20px;margin-bottom:20px} .vco-slide-text-only .vco-slide-content-container .vco-slide-content{text-align:center}.vco-slide-text-only .vco-slide-content-container .vco-slide-content .vco-text{max-width:80%;width:80%;display:block;margin-left:auto;margin-right:auto} -.vco-slide.vco-full-image-background{background:no-repeat center center;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.myBackground.jpg', sizingMethod='scale');-ms-filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='myBackground.jpg', sizingMethod='scale')";background-position:center 25%;color:#fff;text-shadow:1px 1px 2px #000}.vco-slide.vco-full-image-background p{color:#fff;text-shadow:1px 1px 2px #000} -.vco-slide.vco-full-image-background .vco-text .vco-text-content-container{padding:20px;background:#000 transparent;background:rgba(0,0,0,0.5)}.vco-slide.vco-full-image-background .vco-text .vco-text-content-container h2{margin-top:5px} +.vco-slide.vco-full-image-background,.vco-slide.vco-full-color-background{color:#fff !important;text-shadow:1px 1px 1px #000 !important}.vco-slide.vco-full-image-background p,.vco-slide.vco-full-color-background p,.vco-slide.vco-full-image-background h1,.vco-slide.vco-full-color-background h1,.vco-slide.vco-full-image-background h2,.vco-slide.vco-full-color-background h2,.vco-slide.vco-full-image-background h3,.vco-slide.vco-full-color-background h3,.vco-slide.vco-full-image-background h4,.vco-slide.vco-full-color-background h4,.vco-slide.vco-full-image-background h5,.vco-slide.vco-full-color-background h5,.vco-slide.vco-full-image-background h6,.vco-slide.vco-full-color-background h6{color:#fff !important;text-shadow:1px 1px 1px #000 !important} +.vco-slide.vco-full-image-background a,.vco-slide.vco-full-color-background a,.vco-slide.vco-full-image-background a:hover,.vco-slide.vco-full-color-background a:hover,.vco-slide.vco-full-image-background b,.vco-slide.vco-full-color-background b,.vco-slide.vco-full-image-background i,.vco-slide.vco-full-color-background i,.vco-slide.vco-full-image-background blockquote,.vco-slide.vco-full-color-background blockquote,.vco-slide.vco-full-image-background blockquote p,.vco-slide.vco-full-color-background blockquote p{color:#fff !important;text-shadow:1px 1px 1px #000 !important;color:#fff} +.vco-slide.vco-full-image-background .vco-caption,.vco-slide.vco-full-color-background .vco-caption,.vco-slide.vco-full-image-background .vco-credit,.vco-slide.vco-full-color-background .vco-credit{color:#fff !important;text-shadow:1px 1px 1px #000 !important} +.vco-slide.vco-full-image-background .vco-media-twitter blockquote,.vco-slide.vco-full-color-background .vco-media-twitter blockquote,.vco-slide.vco-full-image-background .vco-media-blockquote blockquote,.vco-slide.vco-full-color-background .vco-media-blockquote blockquote{color:#fff !important;text-shadow:1px 1px 1px #000 !important}.vco-slide.vco-full-image-background .vco-media-twitter blockquote p,.vco-slide.vco-full-color-background .vco-media-twitter blockquote p,.vco-slide.vco-full-image-background .vco-media-blockquote blockquote p,.vco-slide.vco-full-color-background .vco-media-blockquote blockquote p{color:#fff !important;text-shadow:1px 1px 1px #000 !important} +.vco-slide.vco-full-image-background .vcard a,.vco-slide.vco-full-color-background .vcard a,.vco-slide.vco-full-image-background .vcard .nickname,.vco-slide.vco-full-color-background .vcard .nickname{color:#fff !important;text-shadow:1px 1px 1px #000 !important} +.vco-slide.vco-full-image-background{background:no-repeat center center;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;background-position:center 25%;text-shadow:1px 1px 2px #000}.vco-slide.vco-full-image-background p,.vco-slide.vco-full-image-background h1,.vco-slide.vco-full-image-background h2,.vco-slide.vco-full-image-background h3,.vco-slide.vco-full-image-background h4,.vco-slide.vco-full-image-background h5,.vco-slide.vco-full-image-background h6{text-shadow:1px 1px 2px #000} +.vco-slide.vco-full-image-background .vco-caption,.vco-slide.vco-full-image-background .vco-credit{text-shadow:1px 1px 2px #000} +.vco-slide.vco-full-image-background .vco-text .vco-text-content-container{padding:20px;background:#000 transparent;background:rgba(0,0,0,0.6);-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.vco-slide.vco-full-image-background .vco-text .vco-text-content-container h2{margin-top:5px} +.vco-slide.vco-full-image-background .vco-media-twitter blockquote,.vco-slide.vco-full-image-background .vco-media-blockquote blockquote{text-shadow:1px 1px 2px #000 !important}.vco-slide.vco-full-image-background .vco-media-twitter blockquote p,.vco-slide.vco-full-image-background .vco-media-blockquote blockquote p{text-shadow:1px 1px 2px #000 !important} @media only screen and (max-width:500px),only screen and (max-device-width:500px){.vco-slide{display:block}.vco-slide .vco-slide-content-container{display:block}.vco-slide .vco-slide-content-container .vco-slide-content{display:block}.vco-slide .vco-slide-content-container .vco-slide-content .vco-media{width:100%;height:auto;float:none;display:block} .vco-slide .vco-slide-content-container .vco-slide-content .vco-text{width:100%;max-width:100%;min-width:auto;float:none;padding:0}}.vco-skinny .vco-slide{display:block}.vco-skinny .vco-slide .vco-slide-content-container{display:block}.vco-skinny .vco-slide .vco-slide-content-container .vco-slide-content{display:block}.vco-skinny .vco-slide .vco-slide-content-container .vco-slide-content .vco-media{width:100%;height:auto;float:none;display:block} .vco-skinny .vco-slide .vco-slide-content-container .vco-slide-content .vco-text{width:100%;max-width:100%;min-width:auto;float:none;padding:0} @media only screen and (max-width:500px),only screen and (max-device-width:500px){}.vco-slidenav-previous,.vco-slidenav-next{position:absolute;top:45%;z-index:10;cursor:pointer}.vco-slidenav-previous .vco-slidenav-content-container,.vco-slidenav-next .vco-slidenav-content-container{height:200px;width:200px;position:absolute} @@ -135,24 +144,28 @@ .vco-media .vco-media-content-container .vco-media-content:after{clear:both} .vco-media .vco-media-content-container .vco-media-content img,.vco-media .vco-media-content-container .vco-media-content embed,.vco-media .vco-media-content-container .vco-media-content object,.vco-media .vco-media-content-container .vco-media-content video{max-width:100%;max-height:100%} .vco-media-shadow{position:relative;z-index:1;-webkit-box-shadow:1px 1px 7px rgba(0,0,0,0.5);-moz-box-shadow:1px 1px 7px rgba(0,0,0,0.5);box-shadow:1px 1px 7px rgba(0,0,0,0.5)} -.vcard{float:right;margin-bottom:15px}.vcard a{color:#333;text-decoration:none} -.vcard a:hover{text-decoration:none}.vcard a:hover .fn{text-decoration:underline} +.vcard{*zoom:1;margin-bottom:15px;margin-top:10px}.vcard:before,.vcard:after{display:table;content:""} +.vcard:after{clear:both} +.vcard .twitter-date{text-align:left;font-size:11px} +.vcard .author{float:right} +.vcard a{color:#333;text-decoration:none} +.vcard a:hover{text-decoration:none}.vcard a:hover .fn,.vcard a:hover .nickname{color:#da0000} .vcard .fn,.vcard .nickname{padding-left:42px} .vcard .fn{display:block;font-weight:bold} .vcard .nickname{margin-top:1px;display:block;color:#666} .vcard .avatar{float:left;display:block;width:32px;height:32px}.vcard .avatar img{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px} +.vco-slide.vco-full-image-background a,.vco-slide.vco-full-color-background a,.vco-slide.vco-full-image-background .vcard a,.vco-slide.vco-full-color-background .vcard a{color:#fff !important;text-shadow:1px 1px 1px #000 !important;color:#fff} .vco-credit{color:#999;text-align:right;display:block;margin:0 auto;margin-top:6px;font-size:10px;line-height:13px} .vco-caption{text-align:left;margin-top:10px;color:#666;font-size:11px;line-height:14px;text-rendering:optimizeLegibility;word-wrap:break-word} -.vco-full-image-background .vco-caption,.vco-full-image-background .vco-credit{color:#fff;text-shadow:1px 1px 2px #000} -.vco-full-image-background .vco-media-shadow:before,.vco-full-image-background .vco-media-shadow:after{background:none;-webkit-box-shadow:0 0 0 #000;-moz-box-shadow:0 0 0 #000;box-shadow:0 0 0 #000} -.vco-full-image-background .vco-media-twitter blockquote,.vco-full-image-background .vco-media-blockquote blockquote{color:#fff !important;text-shadow:1px 1px 2px #000 !important}.vco-full-image-background .vco-media-twitter blockquote p,.vco-full-image-background .vco-media-blockquote blockquote p{color:#fff !important;text-shadow:1px 1px 2px #000 !important} -.vco-full-image-background .vcard a,.vco-full-image-background .vcard .nickname{color:#fff !important} +.vco-full-image-background .vco-media-shadow:before,.vco-full-color-background .vco-media-shadow:before,.vco-full-image-background .vco-media-shadow:after,.vco-full-color-background .vco-media-shadow:after{background:none;-webkit-box-shadow:0 0 0 #000;-moz-box-shadow:0 0 0 #000;box-shadow:0 0 0 #000} @media only screen and (max-width:500px),only screen and (max-device-width:500px){.vco-media{width:100%;height:auto;float:none;display:block}}.vco-text{width:50%;max-width:50%;min-width:120px;padding:0 20px 0 20px;display:table-cell;vertical-align:middle;text-align:left;text-shadow:none} .vco-full-image-background .vco-text,.vco-full-image-background .vco-text p{color:#fff;text-shadow:1px 1px 2px #000} @media only screen and (max-width:500px),only screen and (max-device-width:500px){.vco-text{width:100%;max-width:100%;min-width:auto;float:none}} @media only screen and (max-width:500px),only screen and (max-device-width:500px){}.vco-media .vco-media-twitter{text-align:left;clear:both}.vco-media .vco-media-twitter blockquote{margin:0;margin-right:15px;font-size:15px;line-height:21px;color:#333}.vco-media .vco-media-twitter blockquote p{font-size:36px;line-height:39px;color:#000} .vco-media .vco-media-twitter blockquote p:before{display:none} .vco-media .vco-media-twitter blockquote p:after{display:none} +.vco-media .vco-media-twitter .vco-icon-twitter{color:#55acee} +.vco-media .vco-media-twitter .vcard a:hover,.vco-media .vco-media-twitter .vcard a.vco-date:hover{text-decoration:none;color:#55acee}.vco-media .vco-media-twitter .vcard a:hover .fn,.vco-media .vco-media-twitter .vcard a.vco-date:hover .fn,.vco-media .vco-media-twitter .vcard a:hover .nickname,.vco-media .vco-media-twitter .vcard a.vco-date:hover .nickname{color:#55acee} .vco-slide-media-only .vco-media .vco-media-twitter{width:80%;margin-left:auto;margin-right:auto} @media only screen and (max-width:800px),only screen and (max-device-width:800px){.vco-media .vco-media-twitter blockquote p{font-size:24px;line-height:26px}}@media only screen and (max-width:500px),only screen and (max-device-width:500px){.vco-media .vco-media-twitter blockquote p{font-size:15px;line-height:21px}}.vco-media .vco-media-blockquote{text-align:left;clear:both}.vco-media .vco-media-blockquote blockquote{margin:0;margin-right:15px;text-align:left}.vco-media .vco-media-blockquote blockquote p{font-size:36px;line-height:39px} .vco-media .vco-media-blockquote blockquote cite{font-size:15px;line-height:21px;color:#333;text-align:right} @@ -163,10 +176,11 @@ @media only screen and (max-width:500px),only screen and (max-device-width:500px){} @media only screen and (max-width:500px),only screen and (max-device-width:500px){}.vco-media .vco-media-iframe{width:100%;height:100%}.vco-media .vco-media-iframe iframe{width:100%;height:100%} @media only screen and (max-width:500px),only screen and (max-device-width:500px){}.vco-media .vco-media-wikipedia{text-align:left;margin-left:auto;margin-right:auto;clear:both}.vco-media .vco-media-wikipedia .wiki-source{font-size:13px;line-height:19px;font-style:italic} -.vco-media .vco-media-wikipedia h4{margin-bottom:0} +.vco-media .vco-media-wikipedia h4{margin-top:0;margin-bottom:0} .vco-media .vco-media-wikipedia h4 a{color:#000;text-decoration:none} .vco-media .vco-media-wikipedia h4 a:hover{text-decoration:underline} .vco-media .vco-media-wikipedia p{font-size:13px;line-height:19px} +.vco-slide.vco-full-image-background .vco-media .vco-media-wikipedia,.vco-slide.vco-full-color-background .vco-media .vco-media-wikipedia{padding:20px;background:#000 transparent;background:rgba(0,0,0,0.6);-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.vco-slide.vco-full-image-background .vco-media .vco-media-wikipedia h4 a,.vco-slide.vco-full-color-background .vco-media .vco-media-wikipedia h4 a{color:#fff !important;text-shadow:1px 1px 1px #000 !important} @media only screen and (max-width:500px),only screen and (max-device-width:500px){}.leaflet-map-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-pane,.leaflet-tile-container,.leaflet-overlay-pane,.leaflet-shadow-pane,.leaflet-marker-pane,.leaflet-popup-pane,.leaflet-overlay-pane svg,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0} .leaflet-container{overflow:hidden;-ms-touch-action:none} .leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none} diff --git a/build/js/storymap-min.js b/build/js/storymap-min.js index 63a40845..ca4b5350 100644 --- a/build/js/storymap-min.js +++ b/build/js/storymap-min.js @@ -1,4 +1,4 @@ -/* storymapjs - v0.1.5 - 2013-12-20 +/* storymapjs - v0.1.6 - 2013-12-20 * Copyright (c) 2013 Northwestern University Knight Lab */ /* ********************************************** @@ -6,10 +6,10 @@ ********************************************** *//*! VCO */(function(e){e.VCO={VERSION:"0.1",_originalL:e.VCO}})(this);VCO.debug=!0;VCO.Bind=function(e,t){return function(){return e.apply(t,arguments)}};trace=function(e){VCO.debug&&(window.console?console.log(e):typeof jsTrace!="undefined"&&jsTrace.send(e))};VCO.Util={extend:function(e){var t=Array.prototype.slice.call(arguments,1);for(var n=0,r=t.length,i;n]*>([^<]*)<\s*\/\s*p\s*>/)?e:"

"+e+"

"},getParamString:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+"="+e[n]);return"?"+t.join("&")},formatNum:function(e,t){var n=Math.pow(10,t||5);return Math.round(e*n)/n},falseFn:function(){return!1},requestAnimFrame:function(){function e(e){window.setTimeout(e,1e3/60)}var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||e;return function(n,r,i,s){n=r?VCO.Util.bind(n,r):n;i&&t===e?n():t(n,s)}}(),bind:function(e,t){return function(){return e.apply(t,arguments)}},template:function(e,t){return e.replace(/\{ *([\w_]+) *\}/g,function(e,n){var r=t[n];if(!t.hasOwnProperty(n))throw new Error("No value provided for variable "+e);return r})},ratio:{square:function(e){var t={w:0,h:0};if(e.w>e.h&&e.h>0){t.h=e.h;t.w=e.h}else{t.w=e.w;t.h=e.w}return t},r16_9:function(e){return e.w!==null&&e.w!==""?Math.round(e.w/16*9):e.h!==null&&e.h!==""?Math.round(e.h/9*16):0},r4_3:function(e){if(e.w!==null&&e.w!=="")return Math.round(e.w/4*3);if(e.h!==null&&e.h!=="")return Math.round(e.h/3*4)}},getObjectAttributeByIndex:function(e,t){if(typeof e!="undefined"){var n=0;for(var r in e){if(t===n)return e[r];n++}return""}return""},getUrlVars:function(e){var t,n=[],r,i;t=e.toString();t.match("&")?t=t.replace("&","&"):t.match("&")?t=t.replace("&","&"):t.match("&")&&(t=t.replace("&","&"));i=t.slice(t.indexOf("?")+1).split("&");for(var s=0;s0?n.fn.concat.apply([],e):e}function q(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function R(e){return e in f?f[e]:f[e]=new RegExp("(^|\\s)"+e+"(\\s|$)")}function U(e,t){return typeof t=="number"&&!c[q(e)]?t+"px":t}function z(e){var t,n;if(!a[e]){t=u.createElement(e);u.body.appendChild(t);n=l(t,"").getPropertyValue("display");t.parentNode.removeChild(t);n=="none"&&(n="block");a[e]=n}return a[e]}function W(e){return"children"in e?s.call(e.children):n.map(e.childNodes,function(e){if(e.nodeType==1)return e})}function X(n,r,i){for(t in r)if(i&&(H(r[t])||B(r[t]))){H(r[t])&&!H(n[t])&&(n[t]={});B(r[t])&&!B(n[t])&&(n[t]=[]);X(n[t],r[t],i)}else r[t]!==e&&(n[t]=r[t])}function V(e,t){return t==null?n(e):n(e).filter(t)}function $(e,t,n,r){return M(t)?t.call(e,n,r):t}function J(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function K(t,n){var r=t.className,i=r&&r.baseVal!==e;if(n===e)return i?r.baseVal:r;i?r.baseVal=n:t.className=n}function Q(e){var t;try{return e?e=="true"||(e=="false"?!1:e=="null"?null:isNaN(t=Number(e))?/^[\[\{]/.test(e)?n.parseJSON(e):e:t):e}catch(r){return e}}function G(e,t){t(e);for(var n in e.childNodes)G(e.childNodes[n],t)}var e,t,n,r,i=[],s=i.slice,o=i.filter,u=window.document,a={},f={},l=u.defaultView.getComputedStyle,c={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},h=/^\s*<(\w+|!)[^>]*>/,p=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/^(?:body|html)$/i,v=["val","css","html","text","data","width","height","offset"],m=["after","prepend","before","append"],g=u.createElement("table"),y=u.createElement("tr"),b={tr:u.createElement("tbody"),tbody:g,thead:g,tfoot:g,td:y,th:y,"*":u.createElement("div")},w=/complete|loaded|interactive/,E=/^\.([\w-]+)$/,S=/^#([\w-]*)$/,x=/^[\w-]+$/,T={},N=T.toString,C={},k,L,A=u.createElement("div");C.matches=function(e,t){if(!e||e.nodeType!==1)return!1;var n=e.webkitMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.matchesSelector;if(n)return n.call(e,t);var r,i=e.parentNode,s=!i;s&&(i=A).appendChild(e);r=~C.qsa(i,t).indexOf(e);s&&A.removeChild(e);return r};k=function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})};L=function(e){return o.call(e,function(t,n){return e.indexOf(t)==n})};C.fragment=function(t,r,i){t.replace&&(t=t.replace(p,"<$1>"));r===e&&(r=h.test(t)&&RegExp.$1);r in b||(r="*");var o,u,a=b[r];a.innerHTML=""+t;u=n.each(s.call(a.childNodes),function(){a.removeChild(this)});if(H(i)){o=n(u);n.each(i,function(e,t){v.indexOf(e)>-1?o[e](t):o.attr(e,t)})}return u};C.Z=function(e,t){e=e||[];e.__proto__=n.fn;e.selector=t||"";return e};C.isZ=function(e){return e instanceof C.Z};C.init=function(t,r){if(!t)return C.Z();if(M(t))return n(u).ready(t);if(C.isZ(t))return t;var i;if(B(t))i=F(t);else if(P(t))i=[H(t)?n.extend({},t):t],t=null;else if(h.test(t))i=C.fragment(t.trim(),RegExp.$1,r),t=null;else{if(r!==e)return n(r).find(t);i=C.qsa(u,t)}return C.Z(i,t)};n=function(e,t){return C.init(e,t)};n.extend=function(e){var t,n=s.call(arguments,1);if(typeof e=="boolean"){t=e;e=n.shift()}n.forEach(function(n){X(e,n,t)});return e};C.qsa=function(e,t){var n;return D(e)&&S.test(t)?(n=e.getElementById(RegExp.$1))?[n]:[]:e.nodeType!==1&&e.nodeType!==9?[]:s.call(E.test(t)?e.getElementsByClassName(RegExp.$1):x.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t))};n.contains=function(e,t){return e!==t&&e.contains(t)};n.type=O;n.isFunction=M;n.isWindow=_;n.isArray=B;n.isPlainObject=H;n.isEmptyObject=function(e){var t;for(t in e)return!1;return!0};n.inArray=function(e,t,n){return i.indexOf.call(t,e,n)};n.camelCase=k;n.trim=function(e){return e==null?"":String.prototype.trim.call(e)};n.uuid=0;n.support={};n.expr={};n.map=function(e,t){var n,r=[],i,s;if(j(e))for(i=0;i=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){this.parentNode!=null&&this.parentNode.removeChild(this)})},each:function(e){i.every.call(this,function(t,n){return e.call(t,n,t)!==!1});return this},filter:function(e){return M(e)?this.not(this.not(e)):n(o.call(this,function(t){return C.matches(t,e)}))},add:function(e,t){return n(L(this.concat(n(e,t))))},is:function(e){return this.length>0&&C.matches(this[0],e)},not:function(t){var r=[];if(M(t)&&t.call!==e)this.each(function(e){t.call(this,e)||r.push(this)});else{var i=typeof t=="string"?this.filter(t):j(t)&&M(t.item)?s.call(t):n(t);this.forEach(function(e){i.indexOf(e)<0&&r.push(e)})}return n(r)},has:function(e){return this.filter(function(){return P(e)?n.contains(this,e):n(this).find(e).size()})},eq:function(e){return e===-1?this.slice(e):this.slice(e,+e+1)},first:function(){var e=this[0];return e&&!P(e)?e:n(e)},last:function(){var e=this[this.length-1];return e&&!P(e)?e:n(e)},find:function(e){var t,r=this;typeof e=="object"?t=n(e).filter(function(){var e=this;return i.some.call(r,function(t){return n.contains(t,e)})}):this.length==1?t=n(C.qsa(this[0],e)):t=this.map(function(){return C.qsa(this,e)});return t},closest:function(e,t){var r=this[0],i=!1;typeof e=="object"&&(i=n(e));while(r&&!(i?i.indexOf(r)>=0:C.matches(r,e)))r=r!==t&&!D(r)&&r.parentNode;return n(r)},parents:function(e){var t=[],r=this;while(r.length>0)r=n.map(r,function(e){if((e=e.parentNode)&&!D(e)&&t.indexOf(e)<0){t.push(e);return e}});return V(t,e)},parent:function(e){return V(L(this.pluck("parentNode")),e)},children:function(e){return V(this.map(function(){return W(this)}),e)},contents:function(){return this.map(function(){return s.call(this.childNodes)})},siblings:function(e){return V(this.map(function(e,t){return o.call(W(t.parentNode),function(e){return e!==t})}),e)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(e){return n.map(this,function(t){return t[e]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null);l(this,"").getPropertyValue("display")=="none"&&(this.style.display=z(this.nodeName))})},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){var t=M(e);if(this[0]&&!t)var r=n(e).get(0),i=r.parentNode||this.length>1;return this.each(function(s){n(this).wrapAll(t?e.call(this,s):i?r.cloneNode(!0):r)})},wrapAll:function(e){if(this[0]){n(this[0]).before(e=n(e));var t;while((t=e.children()).length)e=t.first();n(e).append(this)}return this},wrapInner:function(e){var t=M(e);return this.each(function(r){var i=n(this),s=i.contents(),o=t?e.call(this,r):e;s.length?s.wrapAll(o):i.append(o)})},unwrap:function(){this.parent().each(function(){n(this).replaceWith(n(this).children())});return this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var r=n(this);(t===e?r.css("display")=="none":t)?r.show():r.hide()})},prev:function(e){return n(this.pluck("previousElementSibling")).filter(e||"*")},next:function(e){return n(this.pluck("nextElementSibling")).filter(e||"*")},html:function(t){return t===e?this.length>0?this[0].innerHTML:null:this.each(function(e){var r=this.innerHTML;n(this).empty().append($(this,t,e,r))})},text:function(t){return t===e?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=t})},attr:function(n,r){var i;return typeof n=="string"&&r===e?this.length==0||this[0].nodeType!==1?e:n=="value"&&this[0].nodeName=="INPUT"?this.val():!(i=this[0].getAttribute(n))&&n in this[0]?this[0][n]:i:this.each(function(e){if(this.nodeType!==1)return;if(P(n))for(t in n)J(this,t,n[t]);else J(this,n,$(this,r,e,this.getAttribute(n)))})},removeAttr:function(e){return this.each(function(){this.nodeType===1&&J(this,e)})},prop:function(t,n){return n===e?this[0]&&this[0][t]:this.each(function(e){this[t]=$(this,n,e,this[t])})},data:function(t,n){var r=this.attr("data-"+q(t),n);return r!==null?Q(r):e},val:function(t){return t===e?this[0]&&(this[0].multiple?n(this[0]).find("option").filter(function(e){return this.selected}).pluck("value"):this[0].value):this.each(function(e){this.value=$(this,t,e,this.value)})},offset:function(e){if(e)return this.each(function(t){var r=n(this),i=$(this,e,t,r.offset()),s=r.offsetParent().offset(),o={top:i.top-s.top,left:i.left-s.left};r.css("position")=="static"&&(o.position="relative");r.css(o)});if(this.length==0)return null;var t=this[0].getBoundingClientRect();return{left:t.left+window.pageXOffset,top:t.top+window.pageYOffset,width:Math.round(t.width),height:Math.round(t.height)}},css:function(e,n){if(arguments.length<2&&typeof e=="string")return this[0]&&(this[0].style[k(e)]||l(this[0],"").getPropertyValue(e));var r="";if(O(e)=="string")!n&&n!==0?this.each(function(){this.style.removeProperty(q(e))}):r=q(e)+":"+U(e,n);else for(t in e)!e[t]&&e[t]!==0?this.each(function(){this.style.removeProperty(q(t))}):r+=q(t)+":"+U(t,e[t])+";";return this.each(function(){this.style.cssText+=";"+r})},index:function(e){return e?this.indexOf(n(e)[0]):this.parent().children().indexOf(this[0])},hasClass:function(e){return i.some.call(this,function(e){return this.test(K(e))},R(e))},addClass:function(e){return this.each(function(t){r=[];var i=K(this),s=$(this,e,t,i);s.split(/\s+/g).forEach(function(e){n(this).hasClass(e)||r.push(e)},this);r.length&&K(this,i+(i?" ":"")+r.join(" "))})},removeClass:function(t){return this.each(function(n){if(t===e)return K(this,"");r=K(this);$(this,t,n,r).split(/\s+/g).forEach(function(e){r=r.replace(R(e)," ")});K(this,r.trim())})},toggleClass:function(t,r){return this.each(function(i){var s=n(this),o=$(this,t,i,K(this));o.split(/\s+/g).forEach(function(t){(r===e?!s.hasClass(t):r)?s.addClass(t):s.removeClass(t)})})},scrollTop:function(){if(!this.length)return;return"scrollTop"in this[0]?this[0].scrollTop:this[0].scrollY},position:function(){if(!this.length)return;var e=this[0],t=this.offsetParent(),r=this.offset(),i=d.test(t[0].nodeName)?{top:0,left:0}:t.offset();r.top-=parseFloat(n(e).css("margin-top"))||0;r.left-=parseFloat(n(e).css("margin-left"))||0;i.top+=parseFloat(n(t[0]).css("border-top-width"))||0;i.left+=parseFloat(n(t[0]).css("border-left-width"))||0;return{top:r.top-i.top,left:r.left-i.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||u.body;while(e&&!d.test(e.nodeName)&&n(e).css("position")=="static")e=e.offsetParent;return e})}};n.fn.detach=n.fn.remove;["width","height"].forEach(function(t){n.fn[t]=function(r){var i,s=this[0],o=t.replace(/./,function(e){return e[0].toUpperCase()});return r===e?_(s)?s["inner"+o]:D(s)?s.documentElement["offset"+o]:(i=this.offset())&&i[t]:this.each(function(e){s=n(this);s.css(t,$(this,r,e,s[t]()))})}});m.forEach(function(e,t){var r=t%2;n.fn[e]=function(){var e,i=n.map(arguments,function(t){e=O(t);return e=="object"||e=="array"||t==null?t:C.fragment(t)}),s,o=this.length>1;return i.length<1?this:this.each(function(e,u){s=r?u:u.parentNode;u=t==0?u.nextSibling:t==1?u.firstChild:t==2?u:null;i.forEach(function(e){if(o)e=e.cloneNode(!0);else if(!s)return n(e).remove();G(s.insertBefore(e,u),function(e){e.nodeName!=null&&e.nodeName.toUpperCase()==="SCRIPT"&&(!e.type||e.type==="text/javascript")&&!e.src&&window.eval.call(window,e.innerHTML)})})})};n.fn[r?e+"To":"insert"+(t?"Before":"After")]=function(t){n(t)[e](this);return this}});C.Z.prototype=n.fn;C.uniq=L;C.deserializeValue=Q;n.zepto=C;return n}();(function(e){function o(e){return e._zid||(e._zid=r++)}function u(e,t,r,i){t=a(t);if(t.ns)var s=f(t.ns);return(n[o(e)]||[]).filter(function(e){return e&&(!t.e||e.e==t.e)&&(!t.ns||s.test(e.ns))&&(!r||o(e.fn)===o(r))&&(!i||e.sel==i)})}function a(e){var t=(""+e).split(".");return{e:t[0],ns:t.slice(1).sort().join(" ")}}function f(e){return new RegExp("(?:^| )"+e.replace(" "," .* ?")+"(?: |$)")}function l(t,n,r){e.type(t)!="string"?e.each(t,r):t.split(/\s/).forEach(function(e){r(e,n)})}function c(e,t){return e.del&&(e.e=="focus"||e.e=="blur")||!!t}function h(e){return s[e]||e}function p(t,r,i,u,f,p){var d=o(t),v=n[d]||(n[d]=[]);l(r,i,function(n,r){var i=a(n);i.fn=r;i.sel=u;i.e in s&&(r=function(t){var n=t.relatedTarget;if(!n||n!==this&&!e.contains(this,n))return i.fn.apply(this,arguments)});i.del=f&&f(r,n);var o=i.del||r;i.proxy=function(e){var n=o.apply(t,[e].concat(e.data));n===!1&&(e.preventDefault(),e.stopPropagation());return n};i.i=v.length;v.push(i);t.addEventListener(h(i.e),i.proxy,c(i,p))})}function d(e,t,r,i,s){var a=o(e);l(t||"",r,function(t,r){u(e,t,r,i).forEach(function(t){delete n[a][t.i];e.removeEventListener(h(t.e),t.proxy,c(t,s))})})}function b(t){var n,r={originalEvent:t};for(n in t)!g.test(n)&&t[n]!==undefined&&(r[n]=t[n]);e.each(y,function(e,n){r[e]=function(){this[n]=v;return t[e].apply(t,arguments)};r[n]=m});return r}function w(e){if(!("defaultPrevented"in e)){e.defaultPrevented=!1;var t=e.preventDefault;e.preventDefault=function(){this.defaultPrevented=!0;t.call(this)}}}var t=e.zepto.qsa,n={},r=1,i={},s={mouseenter:"mouseover",mouseleave:"mouseout"};i.click=i.mousedown=i.mouseup=i.mousemove="MouseEvents";e.event={add:p,remove:d};e.proxy=function(t,n){if(e.isFunction(t)){var r=function(){return t.apply(n,arguments)};r._zid=o(t);return r}if(typeof n=="string")return e.proxy(t[n],t);throw new TypeError("expected function")};e.fn.bind=function(e,t){return this.each(function(){p(this,e,t)})};e.fn.unbind=function(e,t){return this.each(function(){d(this,e,t)})};e.fn.one=function(e,t){return this.each(function(n,r){p(this,e,t,null,function(e,t){return function(){var n=e.apply(r,arguments);d(r,t,e);return n}})})};var v=function(){return!0},m=function(){return!1},g=/^([A-Z]|layer[XY]$)/,y={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};e.fn.delegate=function(t,n,r){return this.each(function(i,s){p(s,n,r,t,function(n){return function(r){var i,o=e(r.target).closest(t,s).get(0);if(o){i=e.extend(b(r),{currentTarget:o,liveFired:s});return n.apply(o,[i].concat([].slice.call(arguments,1)))}}})})};e.fn.undelegate=function(e,t,n){return this.each(function(){d(this,t,n,e)})};e.fn.live=function(t,n){e(document.body).delegate(this.selector,t,n);return this};e.fn.die=function(t,n){e(document.body).undelegate(this.selector,t,n);return this};e.fn.on=function(t,n,r){return!n||e.isFunction(n)?this.bind(t,n||r):this.delegate(n,t,r)};e.fn.off=function(t,n,r){return!n||e.isFunction(n)?this.unbind(t,n||r):this.undelegate(n,t,r)};e.fn.trigger=function(t,n){if(typeof t=="string"||e.isPlainObject(t))t=e.Event(t);w(t);t.data=n;return this.each(function(){"dispatchEvent"in this&&this.dispatchEvent(t)})};e.fn.triggerHandler=function(t,n){var r,i;this.each(function(s,o){r=b(typeof t=="string"?e.Event(t):t);r.data=n;r.target=o;e.each(u(o,t.type||t),function(e,t){i=t.proxy(r);if(r.isImmediatePropagationStopped())return!1})});return i};"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(t){e.fn[t]=function(e){return e?this.bind(t,e):this.trigger(t)}});["focus","blur"].forEach(function(t){e.fn[t]=function(e){e?this.bind(t,e):this.each(function(){try{this[t]()}catch(e){}});return this}});e.Event=function(e,t){typeof e!="string"&&(t=e,e=t.type);var n=document.createEvent(i[e]||"Events"),r=!0;if(t)for(var s in t)s=="bubbles"?r=!!t[s]:n[s]=t[s];n.initEvent(e,r,!0,null,null,null,null,null,null,null,null,null,null,null,null);n.isDefaultPrevented=function(){return this.defaultPrevented};return n}})(Zepto);(function($){function triggerAndReturn(e,t,n){var r=$.Event(t);$(e).trigger(r,n);return!r.defaultPrevented}function triggerGlobal(e,t,n,r){if(e.global)return triggerAndReturn(t||document,n,r)}function ajaxStart(e){e.global&&$.active++===0&&triggerGlobal(e,null,"ajaxStart")}function ajaxStop(e){e.global&&!--$.active&&triggerGlobal(e,null,"ajaxStop")}function ajaxBeforeSend(e,t){var n=t.context;if(t.beforeSend.call(n,e,t)===!1||triggerGlobal(t,n,"ajaxBeforeSend",[e,t])===!1)return!1;triggerGlobal(t,n,"ajaxSend",[e,t])}function ajaxSuccess(e,t,n){var r=n.context,i="success";n.success.call(r,e,i,t);triggerGlobal(n,r,"ajaxSuccess",[t,n,e]);ajaxComplete(i,t,n)}function ajaxError(e,t,n,r){var i=r.context;r.error.call(i,n,t,e);triggerGlobal(r,i,"ajaxError",[n,r,e]);ajaxComplete(t,n,r)}function ajaxComplete(e,t,n){var r=n.context;n.complete.call(r,t,e);triggerGlobal(n,r,"ajaxComplete",[t,n]);ajaxStop(n)}function empty(){}function mimeToDataType(e){e&&(e=e.split(";",2)[0]);return e&&(e==htmlType?"html":e==jsonType?"json":scriptTypeRE.test(e)?"script":xmlTypeRE.test(e)&&"xml")||"text"}function appendQuery(e,t){return(e+"&"+t).replace(/[&?]{1,2}/,"?")}function serializeData(e){e.processData&&e.data&&$.type(e.data)!="string"&&(e.data=$.param(e.data,e.traditional));e.data&&(!e.type||e.type.toUpperCase()=="GET")&&(e.url=appendQuery(e.url,e.data))}function parseArguments(e,t,n,r){var i=!$.isFunction(t);return{url:e,data:i?t:undefined,success:i?$.isFunction(n)?n:undefined:t,dataType:i?r||n:n}}function serialize(e,t,n,r){var i,s=$.isArray(t);$.each(t,function(t,o){i=$.type(o);r&&(t=n?r:r+"["+(s?"":t)+"]");!r&&s?e.add(o.name,o.value):i=="array"||!n&&i=="object"?serialize(e,o,n,t):e.add(t,o)})}var jsonpID=0,document=window.document,key,name,rscript=/)<[^<]*)*<\/script>/gi,scriptTypeRE=/^(?:text|application)\/javascript/i,xmlTypeRE=/^(?:text|application)\/xml/i,jsonType="application/json",htmlType="text/html",blankRE=/^\s*$/;$.active=0;$.ajaxJSONP=function(e){if("type"in e){var t="jsonp"+ ++jsonpID,n=document.createElement("script"),r=function(){clearTimeout(o);$(n).remove();delete window[t]},i=function(n){r();if(!n||n=="timeout")window[t]=empty;ajaxError(null,n||"abort",s,e)},s={abort:i},o;if(ajaxBeforeSend(s,e)===!1){i("abort");return!1}window[t]=function(t){r();ajaxSuccess(t,s,e)};n.onerror=function(){i("error")};n.src=e.url.replace(/=\?/,"="+t);$("head").append(n);e.timeout>0&&(o=setTimeout(function(){i("timeout")},e.timeout));return s}return $.ajax(e)};$.ajaxSettings={type:"GET",beforeSend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:jsonType,xml:"application/xml, text/xml",html:htmlType,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0};$.ajax=function(options){var settings=$.extend({},options||{});for(key in $.ajaxSettings)settings[key]===undefined&&(settings[key]=$.ajaxSettings[key]);ajaxStart(settings);settings.crossDomain||(settings.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&&RegExp.$2!=window.location.host);settings.url||(settings.url=window.location.toString());serializeData(settings);settings.cache===!1&&(settings.url=appendQuery(settings.url,"_="+Date.now()));var dataType=settings.dataType,hasPlaceholder=/=\?/.test(settings.url);if(dataType=="jsonp"||hasPlaceholder){hasPlaceholder||(settings.url=appendQuery(settings.url,"callback=?"));return $.ajaxJSONP(settings)}var mime=settings.accepts[dataType],baseHeaders={},protocol=/^([\w-]+:)\/\//.test(settings.url)?RegExp.$1:window.location.protocol,xhr=settings.xhr(),abortTimeout;settings.crossDomain||(baseHeaders["X-Requested-With"]="XMLHttpRequest");if(mime){baseHeaders.Accept=mime;mime.indexOf(",")>-1&&(mime=mime.split(",",2)[0]);xhr.overrideMimeType&&xhr.overrideMimeType(mime)}if(settings.contentType||settings.contentType!==!1&&settings.data&&settings.type.toUpperCase()!="GET")baseHeaders["Content-Type"]=settings.contentType||"application/x-www-form-urlencoded";settings.headers=$.extend(baseHeaders,settings.headers||{});xhr.onreadystatechange=function(){if(xhr.readyState==4){xhr.onreadystatechange=empty;clearTimeout(abortTimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){dataType=dataType||mimeToDataType(xhr.getResponseHeader("content-type"));result=xhr.responseText;try{dataType=="script"?(1,eval)(result):dataType=="xml"?result=xhr.responseXML:dataType=="json"&&(result=blankRE.test(result)?null:$.parseJSON(result))}catch(e){error=e}error?ajaxError(error,"parsererror",xhr,settings):ajaxSuccess(result,xhr,settings)}else ajaxError(null,xhr.status?"error":"abort",xhr,settings)}};var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async);for(name in settings.headers)xhr.setRequestHeader(name,settings.headers[name]);if(ajaxBeforeSend(xhr,settings)===!1){xhr.abort();return!1}settings.timeout>0&&(abortTimeout=setTimeout(function(){xhr.onreadystatechange=empty;xhr.abort();ajaxError(null,"timeout",xhr,settings)},settings.timeout));xhr.send(settings.data?settings.data:null);return xhr};$.get=function(e,t,n,r){return $.ajax(parseArguments.apply(null,arguments))};$.post=function(e,t,n,r){var i=parseArguments.apply(null,arguments);i.type="POST";return $.ajax(i)};$.getJSON=function(e,t,n){var r=parseArguments.apply(null,arguments);r.dataType="json";return $.ajax(r)};$.fn.load=function(e,t,n){if(!this.length)return this;var r=this,i=e.split(/\s/),s,o=parseArguments(e,t,n),u=o.success;i.length>1&&(o.url=i[0],s=i[1]);o.success=function(e){r.html(s?$("
").html(e.replace(rscript,"")).find(s):e);u&&u.apply(r,arguments)};$.ajax(o);return this};var escape=encodeURIComponent;$.param=function(e,t){var n=[];n.add=function(e,t){this.push(escape(e)+"="+escape(t))};serialize(n,e,t);return n.join("&").replace(/%20/g,"+")}})(Zepto);VCO.getJSON=Zepto.getJSON;VCO.ajax=Zepto.ajax})(VCO);VCO.Class=function(){};VCO.Class.extend=function(e){var t=function(){this.initialize&&this.initialize.apply(this,arguments)},n=function(){};n.prototype=this.prototype;var r=new n;r.constructor=t;t.prototype=r;t.superclass=this.prototype;for(var i in this)this.hasOwnProperty(i)&&i!=="prototype"&&i!=="superclass"&&(t[i]=this[i]);if(e.statics){VCO.Util.extend(t,e.statics);delete e.statics}if(e.includes){VCO.Util.extend.apply(null,[r].concat(e.includes));delete e.includes}e.options&&r.options&&(e.options=VCO.Util.extend({},r.options,e.options));VCO.Util.extend(r,e);t.extend=VCO.Class.extend;t.include=function(e){VCO.Util.extend(this.prototype,e)};return t};VCO.Events={addEventListener:function(e,t,n){var r=this._vco_events=this._vco_events||{};r[e]=r[e]||[];r[e].push({action:t,context:n||this});return this},hasEventListeners:function(e){var t="_vco_events";return t in this&&e in this[t]&&this[t][e].length>0},removeEventListener:function(e,t,n){if(!this.hasEventListeners(e))return this;for(var r=0,i=this._vco_events,s=i[e].length;r1;if(!d&&"matchMedia"in window){var v=window.matchMedia("(min-resolution:144dpi)");d=v&&v.matches}var m=!window.L_NO_TOUCH&&!i&&(a||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch);VCO.Browser={ie:n,ielt9:n&&!document.addEventListener,webkit:r,firefox:e.indexOf("gecko")!==-1&&!r&&!window.opera&&!n,android:e.indexOf("android")!==-1,android23:s,chrome:e.indexOf("chrome")!==-1,ie3d:f,webkit3d:l,gecko3d:c,opera3d:h,any3d:!window.L_DISABLE_3D&&(f||l||c||h)&&!i,mobile:o,mobileWebkit:o&&r,mobileWebkit3d:o&&l,mobileOpera:o&&window.opera,touch:!!m,msPointer:!!u,pointer:!!a,retina:!!d}})();VCO.Load=function(e){function n(e){var n=0,r=!1;for(n=0;n=0)if(o[t].href===e.urls[0]){a("css");break}i+=1;e&&(i<200?setTimeout(h,50):a("css"))}}var t,n,r={},i=0,s={css:[],js:[]},o=e.styleSheets;return{css:function(e,t,n,r){l("css",e,t,n,r)},js:function(e,t,n,r){l("js",e,t,n,r)}}}(this.document);VCO.Language={name:"English",lang:"en",messages:{loading:"Loading",wikipedia:"From Wikipedia, the free encyclopedia"},buttons:{map_overview:"Map Overview",backtostart:"Back To Beginning",collapse_toggle:"Hide Map",uncollapse_toggle:"Show Map"}};VCO.Easings={ease:[.25,.1,.25,1],linear:[0,0,1,1],easein:[.42,0,1,1],easeout:[0,0,.58,1],easeinout:[.42,0,.58,1]};VCO.Ease={KeySpline:function(e){function t(e,t){return 1-3*t+3*e}function n(e,t){return 3*t-6*e}function r(e){return 3*e}function i(e,i,s){return((t(i,s)*e+n(i,s))*e+r(i))*e}function s(e,i,s){return 3*t(i,s)*e*e+2*n(i,s)*e+r(i)}function o(t){var n=t;for(var r=0;r<4;++r){var o=s(n,e[0],e[2]);if(o==0)return n;var u=i(n,e[0],e[2])-t;n-=u/o}return n}this.get=function(t){return e[0]==e[1]&&e[2]==e[3]?t:i(o(t),e[1],e[3])}},easeInSpline:function(e){var t=new VCO.Ease.KeySpline(VCO.Easings.easein);return t.get(e)},easeInOutExpo:function(e){var t=new VCO.Ease.KeySpline(VCO.Easings.easein);return t.get(e)},easeOut:function(e){return Math.sin(e*Math.PI/2)},easeOutStrong:function(e){return e==1?1:1-Math.pow(2,-10*e)},easeIn:function(e){return e*e},easeInStrong:function(e){return e==0?0:Math.pow(2,10*(e-1))},easeOutBounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},bounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bouncePast:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?2-(7.5625*(e-=1.5/2.75)*e+.75):e<2.5/2.75?2-(7.5625*(e-=2.25/2.75)*e+.9375):2-(7.5625*(e-=2.625/2.75)*e+.984375)},swingTo:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},swingFrom:function(e){var t=1.70158;return e*e*((t+1 -)*e-t)},elastic:function(e){return-1*Math.pow(4,-8*e)*Math.sin((e*6-1)*2*Math.PI/2)+1},spring:function(e){return 1-Math.cos(e*4.5*Math.PI)*Math.exp(-e*6)},blink:function(e,t){return Math.round(e*(t||5))%2},pulse:function(e,t){return-Math.cos(e*((t||5)-.5)*2*Math.PI)/2+.5},wobble:function(e){return-Math.cos(e*Math.PI*9*e)/2+.5},sinusoidal:function(e){return-Math.cos(e*Math.PI)/2+.5},flicker:function(e){var e=e+(Math.random()-.5)/5;return easings.sinusoidal(e<0?0:e>1?1:e)},mirror:function(e){return e<.5?easings.sinusoidal(e*2):easings.sinusoidal(1-(e-.5)*2)},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+ --e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}};VCO.Animate=function(e,t){var n=new vcoanimate(e,t),r;return n};!function(e,t){typeof define=="function"?define(t):typeof module!="undefined"?module.exports=t():this[e]=t()}("vcoanimate",function(){function E(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t);for(n=0;n1e12&&(e=i());o&&(e=i());for(t=n;t--;)w[t](e);w.length&&b(S)}function x(e){w.push(e)===1&&b(S)}function T(e){var t,n=E(w,e);if(n>=0){t=w.slice(n+1);w.length=n;w=w.concat(t)}}function N(e,t){var n={},r;if(r=e.match(c))n.rotate=B(r[1],t?t.rotate:null);if(r=e.match(h))n.scale=B(r[1],t?t.scale:null);if(r=e.match(p)){n.skewx=B(r[1],t?t.skewx:null);n.skewy=B(r[3],t?t.skewy:null)}if(r=e.match(d)){n.translatex=B(r[1],t?t.translatex:null);n.translatey=B(r[3],t?t.translatey:null)}return n}function C(e){var t="";"rotate"in e&&(t+="rotate("+e.rotate+"deg) ");"scale"in e&&(t+="scale("+e.scale+") ");"translatex"in e&&(t+="translate("+e.translatex+"px,"+e.translatey+"px) ");"skewx"in e&&(t+="skew("+e.skewx+"deg,"+e.skewy+"deg)");return t}function k(e,t,n){return"#"+(1<<24|e<<16|t<<8|n).toString(16).slice(1)}function L(e){var t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);return(t?k(t[1],t[2],t[3]):e).replace(/#(\w)(\w)(\w)$/,"#$1$1$2$2$3$3")}function A(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function O(e){return typeof e=="function"}function M(e){return Math.sin(e*Math.PI/2)}function _(e,t,n,r,s,o){function d(e){var i=e-c;if(i>a||h){o=isFinite(o)?o:1;h?p&&t(o):t(o);T(d);return n&&n.apply(f)}isFinite(o)?t(l*r(i/a)+s):t(r(i/a))}r=O(r)?r:j.easings[r]||M;var a=e||u,f=this,l=o-s,c=i(),h=0,p=0;x(d);return{stop:function(e){h=1;p=e;e||(n=null)}}}function D(e,t){var n=e.length,r=[],i,s;for(i=0;i15?15:s<0?0:s;r[i]=s.toString(16)}return"#"+r.join("")}function H(e,t,n,r,i,s,o){if(i=="transform"){o={};for(var a in n[s][i])o[a]=a in r[s][i]?Math.round(((r[s][i][a]-n[s][i][a])*e+n[s][i][a])*u)/u:n[s][i][a];return o}if(typeof n[s][i]=="string")return P(e,n[s][i],r[s][i]);o=Math.round(((r[s][i]-n[s][i])*e+n[s][i])*u)/u;i in v||(o+=t[s][i]||"px");return o}function B(e,t,n,r,i){return(n=f.exec(e))?(i=parseFloat(n[2]))&&t+(n[1]=="+"?1:-1)*i:parseFloat(e)}function j(e,t){var n=e?n=isFinite(e.length)?e:[e]:[],r,i=t.complete,s=t.duration,o=t.easing,u=t.bezier,f=[],c=[],h=[],p=[],d,v;if(u){d=t.left;v=t.top;delete t.right;delete t.bottom;delete t.left;delete t.top}for(r=n.length;r--;){f[r]={};c[r]={};h[r]={};if(u){var b=y(n[r],"left"),w=y(n[r],"top"),E=[B(O(d)?d(n[r]):d||0,parseFloat(b)),B(O(v)?v(n[r]):v||0,parseFloat(w))];p[r]=O(u)?u(n[r],E):u;p[r].push(E);p[r].unshift([parseInt(b,10),parseInt(w,10)])}for(var S in t){switch(S){case"complete":case"duration":case"easing":case"bezier":continue}var x=y(n[r],S),T,k=O(t[S])?t[S](n[r]):t[S];if(typeof k=="string"&&a.test(k)&&!a.test(x)){delete t[S];continue}f[r][S]=S=="transform"?N(x):typeof k=="string"&&a.test(k)?L(x).slice(1):parseFloat(x);c[r][S]=S=="transform"?N(k,f[r][S]):typeof k=="string"&&k.charAt(0)=="#"?L(k).slice(1):B(k,parseFloat(x));typeof k=="string"&&(T=k.match(l))&&(h[r][S]=T[1])}}return _.apply(n,[s,function(e,i,s){for(r=n.length;r--;){if(u){s=D(p[r],e);n[r].style.left=s[0]+"px";n[r].style.top=s[1]+"px"}for(var o in t){i=H(e,h,f,c,o,r);o=="transform"?n[r].style[m]=C(i):o=="opacity"&&!g?n[r].style.filter="alpha(opacity="+i*100+")":n[r].style[A(o)]=i}}},i,o])}var e=document,t=window,n=t.performance,r=n&&(n.now||n.webkitNow||n.msNow||n.mozNow),i=r?function(){return r.call(n)}:function(){return+(new Date)},s=e.documentElement,o=!1,u=1e3,a=/^rgb\(|#/,f=/^([+\-])=([\d\.]+)/,l=/^(?:[\+\-]=?)?\d+(?:\.\d+)?(%|in|cm|mm|em|ex|pt|pc|px)$/,c=/rotate\(((?:[+\-]=)?([\-\d\.]+))deg\)/,h=/scale\(((?:[+\-]=)?([\d\.]+))\)/,p=/skew\(((?:[+\-]=)?([\-\d\.]+))deg, ?((?:[+\-]=)?([\-\d\.]+))deg\)/,d=/translate\(((?:[+\-]=)?([\-\d\.]+))px, ?((?:[+\-]=)?([\-\d\.]+))px\)/,v={lineHeight:1,zoom:1,zIndex:1,opacity:1,transform:1},m=function(){var t=e.createElement("a").style,n=["webkitTransform","MozTransform","OTransform","msTransform","Transform"],r;for(r=0;r1e12!=i()>1e12});j.tween=_;j.getStyle=y;j.bezier=D;j.transform=m;j.parseTransform=N;j.formatTransform=C;j.easings={};return j});VCO.Point=function(e,t,n){this.x=n?Math.round(e):e;this.y=n?Math.round(t):t};VCO.Point.prototype={add:function(e){return this.clone()._add(e)},_add:function(e){this.x+=e.x;this.y+=e.y;return this},subtract:function(e){return this.clone()._subtract(e)},_subtract:function(e){this.x-=e.x;this.y-=e.y;return this},divideBy:function(e,t){return new VCO.Point(this.x/e,this.y/e,t)},multiplyBy:function(e){return new VCO.Point(this.x*e,this.y*e)},distanceTo:function(e){var t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},round:function(){return this.clone()._round()},_round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},clone:function(){return new VCO.Point(this.x,this.y)},toString:function(){return"Point("+VCO.Util.formatNum(this.x)+", "+VCO.Util.formatNum(this.y)+")"}};VCO.DomMixins={show:function(e){e||(this._el.container.style.display="block")},hide:function(e){this._el.container.style.display="none"},addTo:function(e){e.appendChild(this._el.container);this.onAdd()},removeFrom:function(e){e.removeChild(this._el.container);this.onRemove()},animatePosition:function(e,t){var n={duration:this.options.duration,easing:this.options.ease};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]+"px");this.animator&&this.animator.stop();this.animator=VCO.Animate(t,n)},onLoaded:function(){this.fire("loaded",this.data)},onAdd:function(){this.fire("added",this.data)},onRemove:function(){this.fire("removed",this.data)},setPosition:function(e,t){for(var n in e)e.hasOwnProperty(n)&&(t?t.style[n]=e[n]+"px":this._el.container.style[n]=e[n]+"px")},getPosition:function(){return VCO.Dom.getPosition(this._el.container)}};VCO.Dom={get:function(e){return typeof e=="string"?document.getElementById(e):e},create:function(e,t,n){var r=document.createElement(e);r.className=t;n&&n.appendChild(r);return r},createText:function(e,t){var n=document.createTextNode(e);t&&t.appendChild(n);return n},getTranslateString:function(e){return VCO.Dom.TRANSLATE_OPEN+e.x+"px,"+e.y+"px"+VCO.Dom.TRANSLATE_CLOSE},setPosition:function(e,t){e._vco_pos=t;if(VCO.Browser.webkit3d){e.style[VCO.Dom.TRANSFORM]=VCO.Dom.getTranslateString(t);if(VCO.Browser.android){e.style["-webkit-perspective"]="1000";e.style["-webkit-backface-visibility"]="hidden"}}else{e.style.left=t.x+"px";e.style.top=t.y+"px"}},getPosition:function(e){var t={x:0,y:0};while(e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop)){t.x+=e.offsetLeft;t.y+=e.offsetTop;e=e.offsetParent}return t},testProp:function(e){var t=document.documentElement.style;for(var n=0;n0&&(new RegExp("(^|\\s)"+t+"(\\s|$)")).test(e.className)},addClass:function(e,t){VCO.DomUtil.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},removeClass:function(e,t){e.className=e.className.replace(/(\S+)\s*/g,function(e,n){return n===t?"":e}).replace(/^\s+/,"")},setOpacity:function(e,t){VCO.Browser.ie?e.style.filter="alpha(opacity="+Math.round(t*100)+")":e.style.opacity=t},testProp:function(e){var t=document.documentElement.style;for(var n=0;n1e4){this.data.direction="left";t.x>0&&(this.data.direction="right")}if(Math.abs(t.y)>1e4){this.data.direction="up";t.y>0&&(this.data.direction="down")}this._animateMomentum();n&&this.fire("swipe_"+this.data.direction,this.data)},_animateMomentum:function(){var e={x:this.data.new_pos.x,y:this.data.new_pos.y};if(this.options.constraint.top||this.options.constraint.bottom)e.y>this.options.constraint.bottom?e.y=this.options.constraint.bottom:e.ythis.options.constraint.left?e.x=this.options.constraint.left:e.xthis.options.sizebar_default_y){this.show();this.fire("momentum",{y:this.options.sizebar_default_y})}else{this.hide(25);this.fire("swipe",{y:1})}},_onSwipeDown:function(e){this._draggable.stopMomentum();this.show();this.fire("swipe",{y:this.options.sizebar_default_y})},_onButtonOverview:function(e){this.fire("overview",e)},_onButtonBackToStart:function(e){this.fire("back_to_start",e)},_onButtonCollapseMap:function(e){if(this.collapsed){this.collapsed=!1;this.show();this._el.button_overview.style.display="inline";this.fire("swipe",{y:this.options.sizebar_default_y});this._el.button_collapse_toggle.innerHTML=VCO.Language.buttons.collapse_toggle+""}else{this.collapsed=!0;this.hide(25);this._el.button_overview.style.display="none";this.fire("swipe",{y:1});this._el.button_collapse_toggle.innerHTML=VCO.Language.buttons.uncollapse_toggle+""}},_initLayout:function(){this._el.arrow=VCO.Dom.create("div","vco-arrow-up",this._el.container);this._el.container.style.top="0px";this._el.button_overview=VCO.Dom.create("span","vco-sizebar-button",this._el.container);this._el.button_overview.innerHTML=VCO.Language.buttons.map_overview;VCO.DomEvent.addListener(this._el.button_overview,"click",this._onButtonOverview,this);this._el.button_backtostart=VCO.Dom.create("span","vco-sizebar-button",this._el.container);this._el.button_backtostart.innerHTML=VCO.Language.buttons.backtostart+" ";VCO.DomEvent.addListener(this._el.button_backtostart,"click",this._onButtonBackToStart,this);this._el.button_collapse_toggle=VCO.Dom.create("span","vco-sizebar-button",this._el.container);this._el.button_collapse_toggle.innerHTML=VCO.Language.buttons.collapse_toggle+"";VCO.DomEvent.addListener(this._el.button_collapse_toggle,"click",this._onButtonCollapseMap,this);this._draggable=new VCO.Draggable(this._el.container,{enable:{x:!1,y:!0},constraint:{bottom:this.options.height}});this._draggable.on("dragstart",this._onDragStart,this);this._draggable.on("dragmove",this._onDragMove,this);this._draggable.on("dragend",this._onDragEnd,this);this._draggable.on("swipe_up",this._onSwipeUp,this);this._draggable.on("swipe_down",this._onSwipeDown,this);this._draggable.on("momentum",this._onMomentum,this);this._draggable.enable()},_initEvents:function(){},_updateDisplay:function(e,t,n,r){e&&(this.options.width=e);t&&(this.options.height=t);this._draggable.updateConstraint({bottom:this.options.height-this._el.container.offsetHeight});this._el.container.style.width=this.options.width+"px";this._el.arrow.style.left=this.options.width/2-17+"px";trace(r)}});VCO.Message=VCO.Class.extend({includes:[VCO.Events,VCO.DomMixins],_el:{},initialize:function(e,t,n){this._el={parent:{},container:{},message_container:{},loading_icon:{},message:{}};this.options={width:600,height:600};this._el.container=VCO.Dom.create("div","vco-message");if(n){n.appendChild(this._el.container);this._el.parent=n}this.animator={};VCO.Util.mergeData(this.data,e);VCO.Util.mergeData(this.options,t);this._initLayout();this._initEvents()},updateMessage:function(e){this._updateMessage(e)},updateDisplay:function(e,t){this._updateDisplay(e,t)},_updateMessage:function(e){e?this._el.message.innerHTML=e:VCO.Language?this._el.message.innerHTML=VCO.Language.messages.loading:this._el.message.innerHTML="Loading"},_onMouseClick:function(){this.fire("clicked",this.options)},_initLayout:function(){this._el.message_container=VCO.Dom.create("div","vco-message-container",this._el.container);this._el.loading_icon=VCO.Dom.create("div","vco-loading-icon",this._el.message_container);this._el.message=VCO.Dom.create("div","vco-message-content",this._el.message_container);this._updateMessage()},_initEvents:function(){},_updateDisplay:function(e,t,n){}});VCO.MediaType=function(e){var t={},n=[{type:"youtube",name:"YouTube",match_str:"(www.)?youtube|youtu.be",cls:VCO.Media.YouTube},{type:"vimeo",name:"Vimeo",match_str:"(player.)?vimeo.com",cls:VCO.Media.Vimeo},{type:"dailymotion",name:"DailyMotion",match_str:"(www.)?dailymotion.com",cls:VCO.Media.DailyMotion},{type:"vine",name:"Vine",match_str:"(www.)?vine.co",cls:VCO.Media.Vine},{type:"soundcloud",name:"SoundCloud",match_str:"(player.)?soundcloud.com",cls:VCO.Media.SoundCloud},{type:"twitter",name:"Twitter",match_str:"(www.)?twitter.com",cls:VCO.Media.Twitter},{type:"googlemaps",name:"Google Map",match_str:"maps.google",cls:VCO.Media.Map},{type:"googleplus",name:"Google+",match_str:"plus.google",cls:VCO.Media.GooglePlus},{type:"flickr",name:"Flickr",match_str:"flickr.com/photos",cls:VCO.Media.Flickr},{type:"instagram",name:"Instagram",match_str:"instagr.am/p/",cls:VCO.Media},{type:"image",name:"Image",match_str:/jpg|jpeg|png|gif/i,cls:VCO.Media.Image},{type:"googledocs",name:"Google Doc",match_str:/\b.(doc|docx|xls|xlsx|ppt|pptx|pdf|pages|ai|psd|tiff|dxf|svg|eps|ps|ttf|xps|zip|tif)\b/,cls:VCO.Media.GoogleDoc},{type:"wikipedia",name:"Wikipedia",match_str:"(www.)?wikipedia.org",cls:VCO.Media.Wikipedia},{type:"iframe",name:"iFrame",match_str:"iframe",cls:VCO.Media.IFrame},{type:"storify",name:"Storify",match_str:"storify",cls:VCO.Media.Storify},{type:"blockquote",name:"Quote",match_str:"blockquote",cls:VCO.Media.Blockquote},{type:"website",name:"Website",match_str:"http://",cls:VCO.Media.Website},{type:"",name:"",match_str:"",cls:VCO.Media}];for(var r=0;rthis._el.content_item.offsetHeight&&(this._el.content_item.style.width="100%")}}},_loadMedia:function(){},_updateMediaDisplay:function(){this._el.content_item.style.maxHeight=this.options.height-this.options.credit_height-this.options.caption_height-16+"px"},show:function(){},hide:function(){},addTo:function(e){e.appendChild(this._el.container);this.onAdd()},removeFrom:function(e){e.removeChild(this._el.container);this.onRemove()},updateDisplay:function(e,t,n){this._updateDisplay(e,t,n)},stopMedia:function(){this._stopMedia()},onLoaded:function(){this._state.loaded=!0;this.fire("loaded",this.data);this.message&&this.message.hide()},onAdd:function(){this.fire("added",this.data)},onRemove:function(){this.fire("removed",this.data)},_initLayout:function(){this.message=new VCO.Message({},this.options);this.message.addTo(this._el.container);this._el.content_container=VCO.Dom.create("div","vco-media-content-container",this._el.container);if(this.data.link&&this.data.link!=""){this._el.link=VCO.Dom.create("a","vco-media-link",this._el.content_container);this._el.link.href=this.data.link;this.data.link_target&&this.data.link_target!=""?this._el.link.target=this.data.link_target:this._el.link.target="_blank";this._el.content=VCO.Dom.create("div","vco-media-content",this._el.link)}else this._el.content=VCO.Dom.create("div","vco-media-content",this._el.content_container);if(this.data.credit&&this.data.credit!=""){this._el.credit=VCO.Dom.create("div","vco-credit",this._el.content_container);this._el.credit.innerHTML=this.data.credit;this.options.credit_height=this._el.credit.offsetHeight}if(this.data.caption&&this.data.caption!=""){this._el.caption=VCO.Dom.create("div","vco-caption",this._el.content_container);this._el.caption.innerHTML=this.data.caption;this.options.caption_height=this._el.caption.offsetHeight}},_updateDisplay:function(e,t,n){trace("UPDATE MEDIA DISPLAY");e&&(this.options.width=e);t&&(this.options.height=t);this._el.credit&&(this.options.credit_height=this._el.credit.offsetHeight);this._el.caption&&(this.options.caption_height=this._el.caption.offsetHeight);this.updateMediaDisplay()},_stopMedia:function(){}});VCO.Media.Blockquote=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-blockquote",this._el.content);this.media_id=this.data.url;this._el.content_item.innerHTML=this.media_id;this.onLoaded()}});VCO.Media.Flickr=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("img","vco-media-item vco-media-image vco-media-flickr vco-media-shadow",this._el.content);this.media_id=this.data.url.split("photos/")[1].split("/")[1];e="http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+this.options.api_key_flickr+"&photo_id="+this.media_id+"&format=json&jsoncallback=?";VCO.getJSON(e,function(e){t.createMedia(e)})},createMedia:function(e){var t=this.sizes(this.options.height),n=e.sizes.size[e.sizes.size.length-2].source;for(var r=0;r":this._el.content_item.innerHTML="";this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"}});VCO.Media.GooglePlus=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-googleplus",this._el.content);this.media_id=this.data.url;e=this.media_id;this._el.content_item.innerHTML="";this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"}});VCO.Media.IFrame=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe",this._el.content);this.media_id=this.data.url;e=this.media_id;this._el.content_item.innerHTML=e;this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"}});VCO.Media.Image=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("img","vco-media-item vco-media-image vco-media-shadow",this._el.content);this._el.content_item.src=this.data.url;this.onLoaded()}});VCO.Media.SoundCloud= -VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe vco-media-soundcloud vco-media-shadow",this._el.content);this.media_id=this.data.url;e="http://soundcloud.com/oembed?url="+this.media_id+"&format=js&callback=?";VCO.getJSON(e,function(e){t.createMedia(e)})},createMedia:function(e){this._el.content_item.innerHTML=e.html;this.onLoaded()}});VCO.Media.Storify=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe vco-media-storify",this._el.content);this.media_id=this.data.url;e="";e+="";this._el.content_item.innerHTML=e;this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"}});VCO.Media.Text=VCO.Class.extend({includes:[VCO.Events],_el:{container:{},content_container:{},content:{},headline:{}},data:{uniqueid:"",headline:"Le portrait mystérieux",text:"Lorem ipsum dolor sit amet, consectetuer adipiscing elit."},options:{title:!1},initialize:function(e,t,n){VCO.Util.setData(this,e);VCO.Util.mergeData(this.options,t);this._el.container=VCO.Dom.create("div","vco-text");this._el.container.id=this.data.uniqueid;this._initLayout();n&&n.appendChild(this._el.container)},show:function(){},hide:function(){},addTo:function(e){e.appendChild(this._el.container)},removeFrom:function(e){e.removeChild(this._el.container)},headlineHeight:function(){return this._el.headline.offsetHeight+40},onLoaded:function(){this.fire("loaded",this.data)},onAdd:function(){this.fire("added",this.data)},onRemove:function(){this.fire("removed",this.data)},_initLayout:function(){this._el.content_container=VCO.Dom.create("div","vco-text-content-container",this._el.container);if(this.data.headline!=""){var e="vco-headline";this.options.title&&(e="vco-headline vco-headline-title");this._el.headline=VCO.Dom.create("h2",e,this._el.content_container);this._el.headline.innerHTML=this.data.headline}if(this.data.text!=""){this._el.content=VCO.Dom.create("div","vco-text-content",this._el.content_container);this._el.content.innerHTML=VCO.Util.htmlify(this.data.text)}this.onLoaded()}});VCO.Media.Twitter=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-twitter",this._el.content);this.data.url.match("status/")?this.media_id=this.data.url.split("status/")[1]:url.match("statuses/")?this.media_id=this.data.url.split("statuses/")[1]:this.media_id="";e="http://api.twitter.com/1/statuses/oembed.json?id="+this.media_id+"&omit_script=true&include_entities=true&callback=?";VCO.getJSON(e,function(e){t.createMedia(e)})},createMedia:function(e){var t="",n="";t+=e.html.split("

—")[0]+"

";n=e.author_url.split("twitter.com/")[1];t+="";this._el.content_item.innerHTML=t;this.onLoaded()}});VCO.Media.Vimeo=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe vco-media-vimeo vco-media-shadow",this._el.content);this.media_id=this.data.url.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];e="http://player.vimeo.com/video/"+this.media_id+"?api=1&title=0&byline=0&portrait=0&color=ffffff";this.player=VCO.Dom.create("iframe","",this._el.content_item);this.player.width="100%";this.player.height="100%";this.player.frameBorder="0";this.player.src=e;this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=VCO.Util.ratio.r16_9({w:this._el.content_item.offsetWidth})+"px"},_stopMedia:function(){try{this.player.contentWindow.postMessage(JSON.stringify({method:"pause"}),"http://player.vimeo.com")}catch(e){trace(e)}}});VCO.Media.DailyMotion=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe vco-media-dailymotion",this._el.content);this.data.url.match("video")?this.media_id=this.data.url.split("video/")[1].split(/[?&]/)[0]:this.media_id=this.data.url.split("embed/")[1].split(/[?&]/)[0];e="http://www.dailymotion.com/embed/video/"+this.media_id;this._el.content_item.innerHTML="";this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=VCO.Util.ratio.r16_9({w:this._el.content_item.offsetWidth})+"px"}});VCO.Media.Vine=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe vco-media-vine vco-media-shadow",this._el.content);this.media_id=this.data.url.split("vine.co/v/")[1];e="https://vine.co/v/"+this.media_id+"/embed/simple";this._el.content_item.innerHTML="";this.onLoaded()},_updateMediaDisplay:function(){var e=VCO.Util.ratio.square({w:this._el.content_item.offsetWidth,h:this.options.height});this._el.content_item.style.height=e.h+"px"}});VCO.Media.Website=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){},createMedia:function(e){this.onLoaded()}});VCO.Media.Wikipedia=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t,n=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-wikipedia",this._el.content);this.media_id=this.data.url.split("wiki/")[1].split("#")[0].replace("_"," ");this.media_id=this.media_id.replace(" ","%20");t=this.data.url.split("//")[1].split(".wikipedia")[0];e="http://"+t+".wikipedia.org/w/api.php?action=query&prop=extracts&redirects=&titles="+this.media_id+"&exintro=1&format=json&callback=?";VCO.getJSON(e,function(e){n.createMedia(e)});this.onLoaded()},createMedia:function(e){var t="";if(e.query){var n,t={entry:{},title:"",text:"",extract:"",paragraphs:1,text_array:[]};t.entry=VCO.Util.getObjectAttributeByIndex(e.query.pages,0);t.extract=t.entry.extract;t.title=t.entry.title;t.extract.match("

")?t.text_array=t.extract.split("

"):t.text_array.push(t.extract);for(var r=0;r"+t.text_array[r+1]);n="

"+t.title+"

";n+=""+VCO.Language.messages.wikipedia+"";n+=t.text;if(!t.extract.match("REDIRECT")){this._el.content_item.innerHTML=n;this.onLoaded()}}}});VCO.Media.YouTube=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e=this,t;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this.youtube_loaded=!1;this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-youtube vco-media-shadow",this._el.content);this._el.content_item.id=VCO.Util.unique_ID(7);t=VCO.Util.getUrlVars(this.data.url);this.media_id={};this.data.url.match("v=")?this.media_id.id=t.v:this.data.url.match("/embed/")?this.media_id.id=this.data.url.split("embed/")[1].split(/[?&]/)[0]:this.data.url.match(/v\/|v=|youtu\.be\//)?this.media_id.id=this.data.url.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0]:trace("YOUTUBE IN URL BUT NOT A VALID VIDEO");this.media_id.start=t.t;this.media_id.hd=t.hd;VCO.Load.js("https://www.youtube.com/player_api",function(){trace("YouTube API Library Loaded");e.createMedia()})},_updateMediaDisplay:function(){this._el.content_item.style.height=VCO.Util.ratio.r16_9({w:this._el.content_item.offsetWidth})+"px"},_stopMedia:function(){if(this.youtube_loaded)try{this.player.pauseVideo()}catch(e){trace(e)}},createMedia:function(){var e=this;if(typeof this.media_id.start!="undefined"){var t=this.media_id.start.toString(),n=0,r=0;if(t.match("m")){n=parseInt(t.split("m")[0],10);r=parseInt(t.split("m")[1].split("s")[0],10);this.media_id.start=n*60+r}else this.media_id.start=0}else this.media_id.start=0;typeof this.media_id.hd!="undefined"?this.media_id.hd=!0:this.media_id.hd=!1;this.createPlayer()},createPlayer:function(){var e=this;trace("createPlayer");clearTimeout(this.timer);typeof YT!="undefined"&&typeof YT.Player!="undefined"?this.player=new YT.Player(this._el.content_item.id,{playerVars:{enablejsapi:1,color:"white",showinfo:0,theme:"light",start:this.media_id.start,rel:0},videoId:this.media_id.id,events:{onReady:function(){e.onPlayerReady();e.onLoaded()},onStateChange:e.onStateChange}}):this.timer=setTimeout(function(){e.createPlayer()},1e3)},onPlayerReady:function(e){trace("onPlayerReady");this.youtube_loaded=!0},onStateChange:function(e){trace("onStateChange")}});VCO.Media.Slider=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){this._el.content_item=VCO.Dom.create("img","vco-media-item vco-media-image",this._el.content);this._el.content_item.src=this.data.url;this.onLoaded()}});VCO.Slide=VCO.Class.extend({includes:[VCO.Events,VCO.DomMixins],_el:{},initialize:function(e,t,n){this._el={container:{},content_container:{},content:{}};this._media=null;this._mediaclass={};this._text={};this._state={loaded:!1};this.has={headline:!1,text:!1,media:!1,title:!1,background:{image:!1,color:!1,color_value:!1}};this.has.title=n;this.data={uniqueid:null,background:null,date:null,location:null,text:null,media:null};this.options={duration:1e3,slide_padding_lr:100,ease:VCO.Ease.easeInSpline,width:600,height:600,media_name:""};this.animator={};VCO.Util.mergeData(this.options,t);VCO.Util.mergeData(this.data,e);this._initLayout();this._initEvents()},show:function(){this.animator=VCO.Animate(this._el.slider_container,{left:-(this._el.container.offsetWidth*n)+"px",duration:this.options.duration,easing:this.options.ease,complete:function(){trace("DONE")}})},hide:function(){},addTo:function(e){e.appendChild(this._el.container)},removeFrom:function(e){e.removeChild(this._el.container)},updateDisplay:function(e,t,n){this._updateDisplay(e,t,n)},loadMedia:function(){if(this._media&&!this._state.loaded){this._media.loadMedia();this._state.loaded=!0}},stopMedia:function(){this._media&&this._state.loaded&&this._media.stopMedia()},getBackground:function(){return this.has.background},_initLayout:function(){this._el.container=VCO.Dom.create("div","vco-slide");this._el.container.id=this.data.uniqueid;this._el.content_container=VCO.Dom.create("div","vco-slide-content-container",this._el.container);this._el.content=VCO.Dom.create("div","vco-slide-content",this._el.content_container);if(this.data.background){if(this.data.background.url){this.has.background.image=!0;this._el.container.className+=" vco-full-image-background";this._el.container.style.backgroundImage="url('"+this.data.background.url+"')"}if(this.data.background.color){this.has.background.color=!0;this.has.background.color_value=this.data.background.color;this._el.container.style.backgroundColor=this.data.background.color}}this.data.media&&this.data.media.url&&this.data.media.url!=""&&(this.has.media=!0);this.data.text&&this.data.text.text&&(this.has.text=!0);this.data.text&&this.data.text.headline&&(this.has.headline=!0);if(this.has.media){this.data.media.mediatype=VCO.MediaType(this.data.media);this.options.media_name=this.data.media.mediatype.name;this._media=new this.data.media.mediatype.cls(this.data.media,this.options)}if(this.has.text||this.has.headline)this._text=new VCO.Media.Text(this.data.text,{title:this.has.title});if(!this.has.text&&!this.has.headline&&this.has.media){this._el.container.className+=" vco-slide-media-only";this._media.addTo(this._el.content)}else if(this.has.headline&&this.has.media&&!this.has.text){this._el.container.className+=" vco-slide-media-only";this._text.addTo(this._el.content);this._media.addTo(this._el.content)}else if(this.has.text&&this.has.media){this._media.addTo(this._el.content);this._text.addTo(this._el.content)}else if(this.has.text){this._el.container.className+=" vco-slide-text-only";this._text.addTo(this._el.content)}this.onLoaded()},_initEvents:function(){},_updateDisplay:function(e,t,n){e?this.options.width=e:this.options.width=this._el.container.offsetWidth;this._el.content.style.paddingLeft=this.options.slide_padding_lr+"px";this._el.content.style.paddingRight=this.options.slide_padding_lr+"px";this._el.content.style.width=this.options.width-this.options.slide_padding_lr*2+"px";t?this.options.height=t:this.options.height=this._el.container.offsetHeight;if(this._media)if(!this.has.text&&this.has.headline){trace("headline height");trace(this._text.headlineHeight());trace(this.options.height);trace(this.options.height-this._text.headlineHeight());this._media.updateDisplay(this.options.width,this.options.height-this._text.headlineHeight())}else this._media.updateDisplay(this.options.width,this.options.height)}});VCO.SlideNav=VCO.Class.extend({includes:[VCO.Events,VCO.DomMixins],_el:{},initialize:function(e,t,n){this._el={container:{},content_container:{},icon:{},title:{},description:{}};this.mediatype={};this.data={title:"Navigation",description:"Description"};this.options={direction:"previous"};this.animator=null;VCO.Util.mergeData(this.options,t);VCO.Util.mergeData(this.data,e);this._el.container=VCO.Dom.create("div","vco-slidenav-"+this.options.direction);this._initLayout();this._initEvents();n&&n.appendChild(this._el.container)},update:function(e){this._update(e)},setColor:function(e){e?this._el.content_container.className="vco-slidenav-content-container vco-slidenav-inverted":this._el.content_container.className="vco-slidenav-content-container"},_onMouseClick:function(){this.fire("clicked",this.options)},_update:function(e){this.data=VCO.Util.mergeData(this.data,e);this.data.title!=""&&(this._el.title.innerHTML=this.data.title);this.data.date!=""&&(this._el.description.innerHTML=this.data.description)},_initLayout:function(){this._el.content_container=VCO.Dom.create("div","vco-slidenav-content-container",this._el.container);this._el.icon=VCO.Dom.create("div","vco-slidenav-icon",this._el.content_container);this._el.title=VCO.Dom.create("div","vco-slidenav-title",this._el.content_container);this._el.description=VCO.Dom.create("div","vco-slidenav-description",this._el.content_container);this._el.icon.innerHTML=" ";this._update()},_initEvents:function(){VCO.DomEvent.addListener(this._el.container,"click",this._onMouseClick,this)}});VCO.StorySlider=VCO.Class.extend({includes:VCO.Events,initialize:function(e,t,n,r){this._el={container:{},slider_container_mask:{},slider_container:{},slider_item_container:{}};this._nav={};this._nav.previous={};this._nav.next={};this._slides=[];this.current_slide=0;this.data={uniqueid:"",slides:[{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"Slideshow Example",text:"Example slideshow slide "},media:[{uniqueid:"",text:{headline:"Slideshow Example",text:""},media:{url:"http://2.bp.blogspot.com/-dxJbW0CG8Zs/TmkoMA5-cPI/AAAAAAAAAqw/fQpsz9GpFdo/s1600/voyage-dans-la-lune-1902-02-g.jpg",credit:"",caption:"",link:null,link_target:null}},{uniqueid:"",text:{headline:"Slideshow Example",text:""},media:{url:"http://2.bp.blogspot.com/-dxJbW0CG8Zs/TmkoMA5-cPI/AAAAAAAAAqw/fQpsz9GpFdo/s1600/voyage-dans-la-lune-1902-02-g.jpg",credit:"",caption:"",link:null,link_target:null}},{uniqueid:"",text:{headline:"Slideshow Example",text:""},media:{url:"http://2.bp.blogspot.com/-dxJbW0CG8Zs/TmkoMA5-cPI/AAAAAAAAAqw/fQpsz9GpFdo/s1600/voyage-dans-la-lune-1902-02-g.jpg",credit:"",caption:"",link:null,link_target:null}},{uniqueid:"",text:{headline:"Slideshow Example",text:""},media:{url:"http://2.bp.blogspot.com/-dxJbW0CG8Zs/TmkoMA5-cPI/AAAAAAAAAqw/fQpsz9GpFdo/s1600/voyage-dans-la-lune-1902-02-g.jpg",credit:"",caption:"",link:null,link_target:null}}]},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"YouTube",text:"Just add a link to the video in the media field."},media:{url:"http://www.youtube.com/watch?v=lIvftGgps24",credit:"",caption:"",link:null,link_target:null}},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"Wikipedia",text:"Just add a link to the video in the media field."},media:{url:"http://en.wikipedia.org/wiki/Mark_Twain",credit:"",caption:"",link:null,link_target:null}},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"Storify",text:"Just add a link to the video in the media field."},media:{url:"https://storify.com/kqednews/art-at-burning-man-2013",credit:"",caption:"",link:null,link_target:null}},{uniqueid:"",background:{url:"https://secure-b.vimeocdn.com/ts/225/276/225276903_960.jpg",color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"Vimeo",text:"Just add a link to the video in the media field."},media:{url:"https://vimeo.com/33211636",credit:"",caption:"",link:null,link_target:null}},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"iFrame",text:""},media:{url:"",credit:"",caption:"w3schools",link:null,link_target:null}},{uniqueid:"",background:{url:null,color:"#cdbfe3",opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"Flickr",text:""},media:{url:"http://www.flickr.com/photos/neera/6147067542/",credit:"Nosy Iranja",caption:"",link:"http://www.flickr.com/photos/neera/6147067542/",link_target:"_self"}},{uniqueid:"",background:{url:null,color:"#8b4513",opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"Flickr",text:""},media:{url:"https://twitter.com/ThisAmerLife/status/374975945825722368"}},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:null,media:{url:"http://www.flickr.com/photos/neera/6147067542/",credit:"Nosy Iranja",caption:""}},{uniqueid:"",background:{url:"http://2.bp.blogspot.com/-dxJbW0CG8Zs/TmkoMA5-cPI/AAAAAAAAAqw/fQpsz9GpFdo/s1600/voyage-dans-la-lune-1902-02-g.jpg",color:"#cdbfe3",opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"La Lune",text:""},media:{url:"https://soundcloud.com/beastieboys/make-some-noise",credit:null,caption:null}},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:null,media:{url:"https://soundcloud.com/beastieboys/make-some-noise",credit:null,caption:null}},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:null,media:{url:"https://vine.co/v/bjHh0zHdgZT",credit:null,caption:null}},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:null,media:{url:"http://www.flickr.com/photos/neera/6147067542/",credit:"Nosy Iranja",caption:""}}]};this.options={id:"",width:600,height:600,slide_padding_lr:100,start_at_slide:1,duration:1e3,ease:VCO.Ease.easeInOutQuint,dragging:!0,trackResize:!0};if(typeof e=="object"){this._el.container=e;this.options.id=VCO.Util.unique_ID(6,"vco")}else{this.options.id=e;this._el.container=VCO.Dom.get(e)}this._el.container.id||(this._el.container.id=this.options.id);this.animator=null;VCO.Util.mergeData(this.options,n);VCO.Util.mergeData(this.data,t);r&&this.init()},init:function(){this._initLayout();this._initEvents();this._initData();this._updateDisplay();this.goTo(this.options.start_at_slide);this._onLoaded()},updateDisplay:function(e,t){this._updateDisplay(e,t)},createSlide:function(e){this._createSlide(e)},createSlides:function(e){this._createSlides(e)},_createSlides:function(e){for(var t=0;t=0){this.current_slide=e;this.animator&&this.animator.stop();if(t){this._el.slider_container.style.left=-(this.options.width*e)+"px";this._onSlideChange(n)}else this.animator=VCO.Animate(this._el.slider_container,{left:-(this.options.width*e)+"px",duration:this.options.duration,easing:this.options.ease,complete:this._onSlideChange(n)});var i=this._slides[this.current_slide].getBackground();this.fire("colorchange",i);if(i.color||i.image){this._nav.next.setColor(!0);this._nav.previous.setColor(!0)}else{this._nav.next.setColor(!1);this._nav.previous.setColor(!1)}if(this._slides[this.current_slide+1]){this._nav.next.show();this._nav.next.update(this.getNavInfo(this._slides[this.current_slide+1]))}else this._nav.next.hide();if(this._slides[this.current_slide-1]){this._nav.previous.show();this._nav.previous.update(this.getNavInfo(this._slides[this.current_slide-1]))}else this._nav.previous.hide();this.preloadSlides()}},preloadSlides:function(){this._slides[this.current_slide].loadMedia();this._slides[this.current_slide+1]&&this._slides[this.current_slide+1].loadMedia();this._slides[this.current_slide+2]&&this._slides[this.current_slide+2].loadMedia();this._slides[this.current_slide-1]&&this._slides[this.current_slide-1].loadMedia();this._slides[this.current_slide-2]&&this._slides[this.current_slide-2].loadMedia()},getNavInfo:function(e){var t={title:"",description:""};e.data.text&&e.data.text.headline&&(t.title=e.data.text.headline);return t},next:function(){this.goTo(this.current_slide+1)},previous:function(){this.goTo(this.current_slide-1)},_updateDisplay:function(e,t,n){var r;e?this.options.width=e:this.options.width=this._el.container.offsetWidth;t?this.options.height=t:this.options.height=this._el.container.offsetHeight;r=this.options.height/2;this._nav.next.setPosition({top:r});this._nav.previous.setPosition({top:r});for(var i=0;i2?Array.prototype.slice.call(arguments,2):null;return function(){return e.apply(t,n||arguments)}},stamp:function(){var e=0,t="_leaflet_id";return function(n){n[t]=n[t]||++e;return n[t]}}(),invokeEach:function(e,t,n){var r,i;if(typeof e=="object"){i=Array.prototype.slice.call(arguments,3);for(r in e)t.apply(n,[r,e[r]].concat(i));return!0}return!1},limitExecByInterval:function(e,t,n){var r,i;return function s(){var o=arguments;if(r){i=!0;return}r=!0;setTimeout(function(){r=!1;if(i){s.apply(n,o);i=!1}},t);e.apply(n,o)}},falseFn:function(){return!1},formatNum:function(e,t){var n=Math.pow(10,t||5);return Math.round(e*n)/n},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},splitWords:function(e){return i.Util.trim(e).split(/\s+/)},setOptions:function(e,t){e.options=i.extend({},e.options,t);return e.options},getParamString:function(e,t,n){var r=[];for(var i in e)r.push(encodeURIComponent(n?i.toUpperCase():i)+"="+encodeURIComponent(e[i]));return(!t||t.indexOf("?")===-1?"?":"&")+r.join("&")},template:function(e,t){return e.replace(/\{ *([\w_]+) *\}/g,function(e,r){var i=t[r];if(i===n)throw new Error("No value provided for variable "+e);typeof i=="function"&&(i=i(t));return i})},isArray:function(e){return Object.prototype.toString.call(e)==="[object Array]"},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="};(function(){function t(t){var n,r,i=["webkit","moz","o","ms"];for(n=0;n0||e+"_idx"in t&&t[e+"_idx_len"]>0)},removeEventListener:function(e,t,n){if(!this[s])return this;if(!e)return this.clearAllEventListeners();if(i.Util.invokeEach(e,this.removeEventListener,this,t,n))return this;var r=this[s],o=n&&i.stamp(n),u,a,f,l,c,h,p,d,v;e=i.Util.splitWords(e);for(u=0,a=e.length;u=0;c--)if(l[c].action===t&&(!n||l[c].context===n)){v=l.splice(c,1);v[0].action=i.Util.falseFn}if(n&&d&&l.length===0){delete d[o];r[p]--}}}}return this},clearAllEventListeners:function(){delete this[s];return this},fireEvent:function(e,t){if(!this.hasEventListeners(e))return this;var n=i.Util.extend({},t,{type:e,target:this}),r=this[s],o,u,a,f,l;if(r[e]){o=r[e].slice();for(u=0,a=o.length;u1||"matchMedia"in e&&e.matchMedia("(min-resolution:144dpi)")&&e.matchMedia("(min-resolution:144dpi)").matches,g=t.documentElement,y=r&&"transition"in g.style,b="WebKitCSSMatrix"in e&&"m11"in new e.WebKitCSSMatrix,w="MozPerspective"in g.style,E="OTransition"in g.style,S=!e.L_DISABLE_3D&&(y||b||w||E)&&!c,x=!e.L_NO_TOUCH&&!c&&function(){var e="ontouchstart";if(v||e in g)return!0;var n=t.createElement("div"),r=!1 -;if(!n.setAttribute)return!1;n.setAttribute(e,"return;");typeof n[e]=="function"&&(r=!0);n.removeAttribute(e);n=null;return r}();i.Browser={ie:r,ie6:s,ie7:o,ielt9:u,webkit:f,android:h,android23:p,chrome:l,ie3d:y,webkit3d:b,gecko3d:w,opera3d:E,any3d:S,mobile:d,mobileWebkit:d&&f,mobileWebkit3d:d&&b,mobileOpera:d&&e.opera,touch:x,msTouch:v,retina:m}})();i.Point=function(e,t,n){this.x=n?Math.round(e):e;this.y=n?Math.round(t):t};i.Point.prototype={clone:function(){return new i.Point(this.x,this.y)},add:function(e){return this.clone()._add(i.point(e))},_add:function(e){this.x+=e.x;this.y+=e.y;return this},subtract:function(e){return this.clone()._subtract(i.point(e))},_subtract:function(e){this.x-=e.x;this.y-=e.y;return this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){this.x/=e;this.y/=e;return this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){this.x*=e;this.y*=e;return this},round:function(){return this.clone()._round()},_round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},floor:function(){return this.clone()._floor()},_floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},distanceTo:function(e){e=i.point(e);var t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){e=i.point(e);return e.x===this.x&&e.y===this.y},contains:function(e){e=i.point(e);return Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+i.Util.formatNum(this.x)+", "+i.Util.formatNum(this.y)+")"}};i.point=function(e,t,r){return e instanceof i.Point?e:i.Util.isArray(e)?new i.Point(e[0],e[1]):e===n||e===null?e:new i.Point(e,t,r)};i.Bounds=function(e,t){if(!e)return;var n=t?[e,t]:e;for(var r=0,i=n.length;r=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=i.bounds(e);var t=this.min,n=this.max,r=e.min,s=e.max,o=s.x>=t.x&&r.x<=n.x,u=s.y>=t.y&&r.y<=n.y;return o&&u},isValid:function(){return!!this.min&&!!this.max}};i.bounds=function(e,t){return!e||e instanceof i.Bounds?e:new i.Bounds(e,t)};i.Transformation=function(e,t,n,r){this._a=e;this._b=t;this._c=n;this._d=r};i.Transformation.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){t=t||1;e.x=t*(this._a*e.x+this._b);e.y=t*(this._c*e.y+this._d);return e},untransform:function(e,t){t=t||1;return new i.Point((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}};i.DomUtil={get:function(e){return typeof e=="string"?t.getElementById(e):e},getStyle:function(e,n){var r=e.style[n];!r&&e.currentStyle&&(r=e.currentStyle[n]);if((!r||r==="auto")&&t.defaultView){var i=t.defaultView.getComputedStyle(e,null);r=i?i[n]:null}return r==="auto"?null:r},getViewportOffset:function(e){var n=0,r=0,s=e,o=t.body,u=t.documentElement,a,f=i.Browser.ie7;do{n+=s.offsetTop||0;r+=s.offsetLeft||0;n+=parseInt(i.DomUtil.getStyle(s,"borderTopWidth"),10)||0;r+=parseInt(i.DomUtil.getStyle(s,"borderLeftWidth"),10)||0;a=i.DomUtil.getStyle(s,"position");if(s.offsetParent===o&&a==="absolute")break;if(a==="fixed"){n+=o.scrollTop||u.scrollTop||0;r+=o.scrollLeft||u.scrollLeft||0;break}if(a==="relative"&&!s.offsetLeft){var l=i.DomUtil.getStyle(s,"width"),c=i.DomUtil.getStyle(s,"max-width"),h=s.getBoundingClientRect();if(l!=="none"||c!=="none")r+=h.left+s.clientLeft;n+=h.top+(o.scrollTop||u.scrollTop||0);break}s=s.offsetParent}while(s);s=e;do{if(s===o)break;n-=s.scrollTop||0;r-=s.scrollLeft||0;if(!i.DomUtil.documentIsLtr()&&(i.Browser.webkit||f)){r+=s.scrollWidth-s.clientWidth;f&&i.DomUtil.getStyle(s,"overflow-y")!=="hidden"&&i.DomUtil.getStyle(s,"overflow")!=="hidden"&&(r+=17)}s=s.parentNode}while(s);return new i.Point(r,n)},documentIsLtr:function(){if(!i.DomUtil._docIsLtrCached){i.DomUtil._docIsLtrCached=!0;i.DomUtil._docIsLtr=i.DomUtil.getStyle(t.body,"direction")==="ltr"}return i.DomUtil._docIsLtr},create:function(e,n,r){var i=t.createElement(e);i.className=n;r&&r.appendChild(i);return i},hasClass:function(e,t){return e.className.length>0&&(new RegExp("(^|\\s)"+t+"(\\s|$)")).test(e.className)},addClass:function(e,t){i.DomUtil.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},removeClass:function(e,t){e.className=i.Util.trim((" "+e.className+" ").replace(" "+t+" "," "))},setOpacity:function(e,t){if("opacity"in e.style)e.style.opacity=t;else if("filter"in e.style){var n=!1,r="DXImageTransform.Microsoft.Alpha";try{n=e.filters.item(r)}catch(i){if(t===1)return}t=Math.round(t*100);if(n){n.Enabled=t!==100;n.Opacity=t}else e.style.filter+=" progid:"+r+"(opacity="+t+")"}},testProp:function(e){var n=t.documentElement.style;for(var r=0;r=t.lat&&s.lat<=n.lat&&r.lng>=t.lng&&s.lng<=n.lng},intersects:function(e){e=i.latLngBounds(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),s=e.getNorthEast(),o=s.lat>=t.lat&&r.lat<=n.lat,u=s.lng>=t.lng&&r.lng<=n.lng;return o&&u},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(e){if(!e)return!1;e=i.latLngBounds(e);return this._southWest.equals(e.getSouthWest())&&this._northEast.equals(e.getNorthEast())},isValid:function(){return!!this._southWest&&!!this._northEast}};i.latLngBounds=function(e,t){return!e||e instanceof i.LatLngBounds?e:new i.LatLngBounds(e,t)};i.Projection={};i.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(e){var t=i.LatLng.DEG_TO_RAD,n=this.MAX_LATITUDE,r=Math.max(Math.min(n,e.lat),-n),s=e.lng*t,o=r*t;o=Math.log(Math.tan(Math.PI/4+o/2));return new i.Point(s,o)},unproject:function(e){var t=i.LatLng.RAD_TO_DEG,n=e.x*t,r=(2*Math.atan(Math.exp(e.y))-Math.PI/2)*t;return new i.LatLng(r,n)}};i.Projection.LonLat={project:function(e){return new i.Point(e.lng,e.lat)},unproject:function(e){return new i.LatLng(e.y,e.x)}};i.CRS={latLngToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return this.transformation._transform(n,r)},pointToLatLng:function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},scale:function(e){return 256*Math.pow(2,e)}};i.CRS.Simple=i.extend({},i.CRS,{projection:i.Projection.LonLat,transformation:new i.Transformation(1,0,-1,0),scale:function(e){return Math.pow(2,e)}});i.CRS.EPSG3857=i.extend({},i.CRS,{code:"EPSG:3857",projection:i.Projection.SphericalMercator,transformation:new i.Transformation(.5/Math.PI,.5,-0.5/Math.PI,.5),project:function(e){var t=this.projection.project(e),n=6378137;return t.multiplyBy(n)}});i.CRS.EPSG900913=i.extend({},i.CRS.EPSG3857,{code:"EPSG:900913"});i.CRS.EPSG4326=i.extend({},i.CRS,{code:"EPSG:4326",projection:i.Projection.LonLat,transformation:new i.Transformation(1/360,.5,-1/360,.5)});i.Map=i.Class.extend({includes:i.Mixin.Events,options:{crs:i.CRS.EPSG3857,fadeAnimation:i.DomUtil.TRANSITION&&!i.Browser.android23,trackResize:!0,markerZoomAnimation:i.DomUtil.TRANSITION&&i.Browser.any3d},initialize:function(e,t){t=i.setOptions(this,t);this._initContainer(e);this._initLayout();this._initEvents();t.maxBounds&&this.setMaxBounds(t.maxBounds);t.center&&t.zoom!==n&&this.setView(i.latLng(t.center),t.zoom,{reset:!0});this._handlers=[];this._layers={};this._zoomBoundLayers={};this._tileLayersNum=0;this.callInitHooks();this._addLayers(t.layers)},setView:function(e,t){this._resetView(i.latLng(e),this._limitZoom(t));return this},setZoom:function(e,t){return this.setView(this.getCenter(),e,{zoom:t})},zoomIn:function(e,t){return this.setZoom(this._zoom+(e||1),t)},zoomOut:function(e,t){return this.setZoom(this._zoom-(e||1),t)},setZoomAround:function(e,t,n){var r=this.getZoomScale(t),s=this.getSize().divideBy(2),o=e instanceof i.Point?e:this.latLngToContainerPoint(e),u=o.subtract(s).multiplyBy(1-1/r),a=this.containerPointToLatLng(s.add(u));return this.setView(a,t,{zoom:n})},fitBounds:function(e,t){t=t||{};e=e.getBounds?e.getBounds():i.latLngBounds(e);var n=i.point(t.paddingTopLeft||t.padding||[0,0]),r=i.point(t.paddingBottomRight||t.padding||[0,0]),s=this.getBoundsZoom(e,!1,n.add(r)),o=r.subtract(n).divideBy(2),u=this.project(e.getSouthWest(),s),a=this.project(e.getNorthEast(),s),f=this.unproject(u.add(a).divideBy(2).add(o),s);return this.setView(f,s,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e){this.fire("movestart");this._rawPanBy(i.point(e));this.fire("move");return this.fire("moveend")},setMaxBounds:function(e,t){e=i.latLngBounds(e);this.options.maxBounds=e;if(!e){this._boundsMinZoom=null;this.off("moveend",this._panInsideMaxBounds,this);return this}var n=this.getBoundsZoom(e,!0);this._boundsMinZoom=n;this._loaded&&(this._zoomo.x&&(u=Math.floor(o.x-r.x));n.y>s.y&&(a=Math.floor(s.y-n.y));n.xc&&--h>0){d=u*Math.sin(f);p=Math.PI/2-2*Math.atan(a*Math.pow((1-d)/(1+d),.5*u))-f;f+=p}return new i.LatLng(f*t,s)}};i.CRS.EPSG3395=i.extend({},i.CRS,{code:"EPSG:3395",projection:i.Projection.Mercator,transformation:function(){var e=i.Projection.Mercator,t=e.R_MAJOR,n=e.R_MINOR;return new i.Transformation(.5/(Math.PI*t),.5,-0.5/(Math.PI*n),.5)}()});i.TileLayer=i.Class.extend({includes:i.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:i.Browser.mobile,updateWhenIdle:i.Browser.mobile},initialize:function(e,t){t=i.setOptions(this,t);if(t.detectRetina&&i.Browser.retina&&t.maxZoom>0){t.tileSize=Math.floor(t.tileSize/2);t.zoomOffset++;t.minZoom>0&&t.minZoom--;this.options.maxZoom--}t.bounds&&(t.bounds=i.latLngBounds(t.bounds));this._url=e;var n=this.options.subdomains;typeof n=="string"&&(this.options.subdomains=n.split(""))},onAdd:function(e){this._map=e;this._animated=e._zoomAnimated;this._initContainer();this._createTileProto();e.on({viewreset:this._reset,moveend:this._update},this);this._animated&&e.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this);if(!this.options.updateWhenIdle){this._limitedUpdate=i.Util.limitExecByInterval(this._update,150,this);e.on("move",this._limitedUpdate,this)}this._reset();this._update()},addTo:function(e){e.addLayer(this);return this},onRemove:function(e){this._container.parentNode.removeChild(this._container);e.off({viewreset:this._reset,moveend:this._update},this);this._animated&&e.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this);this.options.updateWhenIdle||e.off("move",this._limitedUpdate,this);this._container=null;this._map=null},bringToFront:function(){var e=this._map._panes.tilePane;if(this._container){e.appendChild(this._container);this._setAutoZIndex(e,Math.max)}return this},bringToBack:function(){var e=this._map._panes.tilePane;if(this._container){e.insertBefore(this._container,e.firstChild);this._setAutoZIndex(e,Math.min)}return this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(e){this.options.opacity=e;this._map&&this._updateOpacity();return this},setZIndex:function(e){this.options.zIndex=e;this._updateZIndex();return this},setUrl:function(e,t){this._url=e;t||this.redraw();return this},redraw:function(){if(this._map){this._reset({hard:!0});this._update()}return this},_updateZIndex:function(){this._container&&this.options.zIndex!==n&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e,t){var n=e.children,r=-t(Infinity,-Infinity),i,s,o;for(s=0,o=n.length;sthis.options.maxZoom||t=n)||e.y<0||e.y>=n)return!1}if(t.bounds){var r=t.tileSize,i=e.multiplyBy(r),s=i.add([r,r]),o=this._map.unproject(i),u=this._map.unproject(s);if(!t.continuousWorld&&!t.noWrap){o=o.wrap();u=u.wrap()}if(!t.bounds.intersects([o,u]))return!1}return!0},_removeOtherTiles:function(e){var t,n,r,i;for(i in this._tiles){t=i.split(":");n=parseInt(t[0],10);r=parseInt(t[1],10);(ne.max.x||re.max.y)&&this._removeTile(i)}},_removeTile:function(e){var t=this._tiles[e];this.fire("tileunload",{tile:t,url:t.src});if(this.options.reuseTiles){i.DomUtil.removeClass(t,"leaflet-tile-loaded");this._unusedTiles.push(t)}else t.parentNode===this._tileContainer&&this._tileContainer.removeChild(t);if(!i.Browser.android){t.onload=null;t.src=i.Util.emptyImageUrl}delete this._tiles[e]},_addTile:function(e,t){var n=this._getTilePos(e),r=this._getTile();i.DomUtil.setPosition(r,n,i.Browser.chrome||i.Browser.android23);this._tiles[e.x+":"+e.y]=r;this._loadTile(r,e);r.parentNode!==this._tileContainer&&t.appendChild(r)},_getZoomForUrl:function(){var e=this.options,t=this._map.getZoom();e.zoomReverse&&(t=e.maxZoom-t);return t+e.zoomOffset},_getTilePos:function(e){var t=this._map.getPixelOrigin(),n=this.options.tileSize;return e.multiplyBy(n).subtract(t)},getTileUrl:function(e){return i.Util.template(this._url,i.extend({s:this._getSubdomain(e),z:e.z,x:e.x,y:e.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(e){var t=this._getWrapTileNum();!this.options.continuousWorld&&!this.options.noWrap&&(e.x=(e.x%t+t)%t);this.options.tms&&(e.y=t-e.y-1);e.z=this._getZoomForUrl()},_getSubdomain:function(e){if(!this.options.subdomains||this.options.subdomains.length==0)return"";var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_createTileProto:function(){var e=this._tileImg=i.DomUtil.create("img","leaflet-tile");e.style.width=e.style.height=this.options.tileSize+"px";e.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var e=this._unusedTiles.pop();this._resetTile(e);return e}return this._createTile()},_resetTile:function(){},_createTile:function(){var e=this._tileImg.cloneNode(!1);e.onselectstart=e.onmousemove=i.Util.falseFn;i.Browser.ielt9&&this.options.opacity!==n&&i.DomUtil.setOpacity(e,this.options.opacity);return e},_loadTile:function(e,t){e._layer=this;e.onload=this._tileOnLoad;e.onerror=this._tileOnError;this._adjustTilePoint(t);e.src=this.getTileUrl(t)},_tileLoaded:function(){this._tilesToLoad--;if(!this._tilesToLoad){this.fire("load");if(this._animated){clearTimeout(this._clearBgBufferTimer);this._clearBgBufferTimer=setTimeout(i.bind(this._clearBgBuffer,this),500)}}},_tileOnLoad:function(){var e=this._layer;if(this.src!==i.Util.emptyImageUrl){i.DomUtil.addClass(this,"leaflet-tile-loaded");e.fire("tileload",{tile:this,url:this.src})}e._tileLoaded()},_tileOnError:function(){var e=this._layer;e.fire("tileerror",{tile:this,url:this.src});var t=e.options.errorTileUrl;t&&(this.src=t);e._tileLoaded()}});i.tileLayer=function(e,t){return new i.TileLayer(e,t)};i.TileLayer.WMS=i.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize -:function(e,t){this._url=e;var n=i.extend({},this.defaultWmsParams),r=t.tileSize||this.options.tileSize;t.detectRetina&&i.Browser.retina?n.width=n.height=r*2:n.width=n.height=r;for(var s in t)!this.options.hasOwnProperty(s)&&s!=="crs"&&(n[s]=t[s]);this.wmsParams=n;i.setOptions(this,t)},onAdd:function(e){this._crs=this.options.crs||e.options.crs;var t=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code;i.TileLayer.prototype.onAdd.call(this,e)},getTileUrl:function(e,t){var n=this._map,r=this.options.tileSize,s=e.multiplyBy(r),o=s.add([r,r]),u=this._crs.project(n.unproject(s,t)),a=this._crs.project(n.unproject(o,t)),f=[u.x,a.y,a.x,u.y].join(","),l=i.Util.template(this._url,{s:this._getSubdomain(e)});return l+i.Util.getParamString(this.wmsParams,l,!0)+"&BBOX="+f},setParams:function(e,t){i.extend(this.wmsParams,e);t||this.redraw();return this}});i.tileLayer.wms=function(e,t){return new i.TileLayer.WMS(e,t)};i.TileLayer.Canvas=i.TileLayer.extend({options:{async:!1},initialize:function(e){i.setOptions(this,e)},redraw:function(){if(this._map){this._reset({hard:!0});this._update()}for(var e in this._tiles)this._redrawTile(this._tiles[e]);return this},_redrawTile:function(e){this.drawTile(e,e._tilePoint,this._map._zoom)},_createTileProto:function(){var e=this._canvasProto=i.DomUtil.create("canvas","leaflet-tile");e.width=e.height=this.options.tileSize},_createTile:function(){var e=this._canvasProto.cloneNode(!1);e.onselectstart=e.onmousemove=i.Util.falseFn;return e},_loadTile:function(e,t){e._layer=this;e._tilePoint=t;this._redrawTile(e);this.options.async||this.tileDrawn(e)},drawTile:function(){},tileDrawn:function(e){this._tileOnLoad.call(e)}});i.tileLayer.canvas=function(e){return new i.TileLayer.Canvas(e)};i.ImageOverlay=i.Class.extend({includes:i.Mixin.Events,options:{opacity:1},initialize:function(e,t,n){this._url=e;this._bounds=i.latLngBounds(t);i.setOptions(this,n)},onAdd:function(e){this._map=e;this._image||this._initImage();e._panes.overlayPane.appendChild(this._image);e.on("viewreset",this._reset,this);e.options.zoomAnimation&&i.Browser.any3d&&e.on("zoomanim",this._animateZoom,this);this._reset()},onRemove:function(e){e.getPanes().overlayPane.removeChild(this._image);e.off("viewreset",this._reset,this);e.options.zoomAnimation&&e.off("zoomanim",this._animateZoom,this)},addTo:function(e){e.addLayer(this);return this},setOpacity:function(e){this.options.opacity=e;this._updateOpacity();return this},bringToFront:function(){this._image&&this._map._panes.overlayPane.appendChild(this._image);return this},bringToBack:function(){var e=this._map._panes.overlayPane;this._image&&e.insertBefore(this._image,e.firstChild);return this},_initImage:function(){this._image=i.DomUtil.create("img","leaflet-image-layer");this._map.options.zoomAnimation&&i.Browser.any3d?i.DomUtil.addClass(this._image,"leaflet-zoom-animated"):i.DomUtil.addClass(this._image,"leaflet-zoom-hide");this._updateOpacity();i.extend(this._image,{galleryimg:"no",onselectstart:i.Util.falseFn,onmousemove:i.Util.falseFn,onload:i.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(e){var t=this._map,n=this._image,r=t.getZoomScale(e.zoom),s=this._bounds.getNorthWest(),o=this._bounds.getSouthEast(),u=t._latLngToNewLayerPoint(s,e.zoom,e.center),a=t._latLngToNewLayerPoint(o,e.zoom,e.center)._subtract(u),f=u._add(a._multiplyBy(.5*(1-1/r)));n.style[i.DomUtil.TRANSFORM]=i.DomUtil.getTranslateString(f)+" scale("+r+") "},_reset:function(){var e=this._image,t=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),n=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(t);i.DomUtil.setPosition(e,t);e.style.width=n.x+"px";e.style.height=n.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){i.DomUtil.setOpacity(this._image,this.options.opacity)}});i.imageOverlay=function(e,t,n){return new i.ImageOverlay(e,t,n)};i.Icon=i.Class.extend({options:{className:""},initialize:function(e){i.setOptions(this,e)},createIcon:function(e){return this._createIcon("icon",e)},createShadow:function(e){return this._createIcon("shadow",e)},_createIcon:function(e,t){var n=this._getIconUrl(e);if(!n){if(e==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var r;!t||t.tagName!=="IMG"?r=this._createImg(n):r=this._createImg(n,t);this._setIconStyles(r,e);return r},_setIconStyles:function(e,t){var n=this.options,r=i.point(n[t+"Size"]),s;t==="shadow"?s=i.point(n.shadowAnchor||n.iconAnchor):s=i.point(n.iconAnchor);!s&&r&&(s=r.divideBy(2,!0));e.className="leaflet-marker-"+t+" "+n.className;if(s){e.style.marginLeft=-s.x+"px";e.style.marginTop=-s.y+"px"}if(r){e.style.width=r.x+"px";e.style.height=r.y+"px"}},_createImg:function(e,n){if(!i.Browser.ie6){n||(n=t.createElement("img"));n.src=e}else{n||(n=t.createElement("div"));n.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+e+'")'}return n},_getIconUrl:function(e){return i.Browser.retina&&this.options[e+"RetinaUrl"]?this.options[e+"RetinaUrl"]:this.options[e+"Url"]}});i.icon=function(e){return new i.Icon(e)};i.Icon.Default=i.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(e){var t=e+"Url";if(this.options[t])return this.options[t];i.Browser.retina&&e==="icon"&&(e+="-2x");var n=i.Icon.Default.imagePath;if(!n)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return n+"/marker-"+e+".png"}});i.Icon.Default.imagePath=function(){var e=t.getElementsByTagName("script"),n=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/,r,i,s,o,u;for(r=0,i=e.length;rs){t.height=s+"px";i.DomUtil.addClass(e,o)}else i.DomUtil.removeClass(e,o);this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(!this._map)return;var e=this._map.latLngToLayerPoint(this._latlng),t=this._animated,n=i.point(this.options.offset);t&&i.DomUtil.setPosition(this._container,e);this._containerBottom=-n.y-(t?0:e.y);this._containerLeft=-Math.round(this._containerWidth/2)+n.x+(t?0:e.x);this._container.style.bottom=this._containerBottom+"px";this._container.style.left=this._containerLeft+"px"},_zoomAnimation:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);i.DomUtil.setPosition(this._container,t)},_adjustPan:function(){if(!this.options.autoPan)return;var e=this._map,t=this._container.offsetHeight,n=this._containerWidth,r=new i.Point(this._containerLeft,-t-this._containerBottom);this._animated&&r._add(i.DomUtil.getPosition(this._container));var s=e.layerPointToContainerPoint(r),o=i.point(this.options.autoPanPadding),u=e.getSize(),a=0,f=0;s.x+n>u.x&&(a=s.x+n-u.x+o.x);s.x-a<0&&(a=s.x-o.x);s.y+t>u.y&&(f=s.y+t-u.y+o.y);s.y-f<0&&(f=s.y-o.y);(a||f)&&e.fire("autopanstart").panBy([a,f])},_onCloseButtonClick:function(e){this._close();i.DomEvent.stop(e)}});i.popup=function(e,t){return new i.Popup(e,t)};i.Map.include({openPopup:function(e,t,n){this.closePopup();if(!(e instanceof i.Popup)){var r=e;e=(new i.Popup(n)).setLatLng(t).setContent(r)}e._isOpen=!0;this._popup=e;return this.addLayer(e)},closePopup:function(e){if(!e||e===this._popup){e=this._popup;this._popup=null}if(e){this.removeLayer(e);e._isOpen=!1}return this}});i.Marker.include({openPopup:function(){if(this._popup&&this._map&&!this._map.hasLayer(this._popup)){this._popup.setLatLng(this._latlng);this._map.openPopup(this._popup)}return this},closePopup:function(){this._popup&&this._popup._close();return this},togglePopup:function(){this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup());return this},bindPopup:function(e,t){var n=i.point(this.options.icon.options.popupAnchor||[0,0]);n=n.add(i.Popup.prototype.options.offset);t&&t.offset&&(n=n.add(t.offset));t=i.extend({offset:n},t);this._popup||this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this);if(e instanceof i.Popup){i.setOptions(e,t);this._popup=e}else this._popup=(new i.Popup(t,this)).setContent(e);return this},setPopupContent:function(e){this._popup&&this._popup.setContent(e);return this},unbindPopup:function(){if(this._popup){this._popup=null;this.off("click",this.togglePopup).off("remove",this.closePopup).off("move",this._movePopup)}return this},_movePopup:function(e){this._popup.setLatLng(e.latlng)}});i.LayerGroup=i.Class.extend({initialize:function(e){this._layers={};var t,n;if(e)for(t=0,n=e.length;t';var n=e.firstChild;n.style.behavior="url(#default#VML)";return n&&typeof n.adj=="object"}catch(r){return!1}}();i.Path=i.Browser.svg||!i.Browser.vml?i.Path:i.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{t.namespaces.add("lvml","urn:schemas-microsoft-com:vml");return function(e){return t.createElement("')}}catch(e){return function(e){return t.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var e=this._container=this._createElement("shape");i.DomUtil.addClass(e,"leaflet-vml-shape");this.options.clickable&&i.DomUtil.addClass(e,"leaflet-clickable");e.coordsize="1 1";this._path=this._createElement("path");e.appendChild(this._path);this._map._pathRoot.appendChild(e)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var e=this._stroke,t=this._fill,n=this.options,r=this._container;r.stroked=n.stroke;r.filled=n.fill;if(n.stroke){if(!e){e=this._stroke=this._createElement("stroke");e.endcap="round";r.appendChild(e)}e.weight=n.weight+"px";e.color=n.color;e.opacity=n.opacity;n.dashArray?e.dashStyle=n.dashArray instanceof Array?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle=""}else if(e){r.removeChild(e);this._stroke=null}if(n.fill){if(!t){t=this._fill=this._createElement("fill");r.appendChild(t)}t.color=n.fillColor||n.color;t.opacity=n.fillOpacity}else if(t){r.removeChild(t);this._fill=null}},_updatePath:function(){var e=this._container.style;e.display="none";this._path.v=this.getPathString()+" ";e.display=""}});i.Map.include(i.Browser.svg||!i.Browser.vml?{}:{_initPathRoot:function(){if(this._pathRoot)return;var e=this._pathRoot=t.createElement("div");e.className="leaflet-vml-container";this._panes.overlayPane.appendChild(e);this.on("moveend",this._updatePathViewport);this._updatePathViewport()}});i.Browser.canvas=function(){return!!t.createElement("canvas").getContext}();i.Path=i.Path.SVG&&!e.L_PREFER_CANVAS||!i.Browser.canvas?i.Path:i.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){if(this._map){this.projectLatlngs();this._requestUpdate()}return this},setStyle:function(e){i.setOptions(this,e);if(this._map){this._updateStyle();this._requestUpdate()}return this},onRemove:function(e){e.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this);if(this.options.clickable){this._map.off("click",this._onClick,this);this._map.off("mousemove",this._onMouseMove,this)}this._requestUpdate();this._map=null},_requestUpdate:function(){this._map&&!i.Path._updateRequest&&(i.Path._updateRequest=i.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){i.Path._updateRequest=null;this.fire("moveend")},_initElements:function(){this._map._initPathRoot();this._ctx=this._map._canvasCtx},_updateStyle:function(){var e=this.options;if(e.stroke){this._ctx.lineWidth=e.weight;this._ctx.strokeStyle=e.color}e.fill&&(this._ctx.fillStyle=e.fillColor||e.color)},_drawPath:function(){var e,t,n,r,s,o;this._ctx.beginPath();for(e=0,n=this._parts.length;es){o=u;s=a}}if(s>n){t[o]=1;this._simplifyDPStep(e,t,n,r,o);this._simplifyDPStep(e,t,n,o,i)}},_reducePoints:function(e,t){var n=[e[0]];for(var r=1,i=0,s=e.length;rt){n.push(e[r]);i=r}it.max.x&&(n|=2);e.yt.max.y&&(n|=8);return n},_sqDist:function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},_sqClosestPointOnSegment:function(e,t,n,r){var s=t.x,o=t.y,u=n.x-s,a=n.y-o,f=u*u+a*a,l;if(f>0){l=((e.x-s)*u+(e.y-o)*a)/f;if(l>1){s=n.x;o=n.y}else if(l>0){s+=u*l;o+=a*l}}u=e.x-s;a=e.y-o;return r?u*u+a*a:new i.Point(s,o)}};i.Polyline=i.Path.extend({initialize:function(e,t){i.Path.prototype.initialize.call(this,t);this._latlngs=this._convertLatLngs(e)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var e=0,t=this._latlngs.length;e=2&&e[0].equals(e[e.length-1])&&e.pop()},projectLatlngs:function(){i.Polyline.prototype.projectLatlngs.call(this);this._holePoints=[];if(!this._holes)return;var e,t,n,r;for(e=0,n=this._holes.length;ee.max.x||n.y-t>e.max.y||n.x+te.y!=s.y>e.y&&e.x<(s.x-r.x)*(e.y-r.y)/(s.y-r.y)+r.x&&(t=!t)}}return t}}:{});i.Circle.include(i.Path.CANVAS?{_drawPath:function(){var e=this._point;this._ctx.beginPath();this._ctx.arc(e.x,e.y,this._radius,0,Math.PI*2,!1)},_containsPoint:function(e){var t=this._point,n=this.options.stroke?this.options.weight/2:0;return e.distanceTo(t)<=this._radius+n}}:{});i.CircleMarker.include(i.Path.CANVAS?{_updateStyle:function(){i.Path.prototype._updateStyle.call(this)}}:{});i.GeoJSON=i.FeatureGroup.extend({initialize:function(e,t){i.setOptions(this,t);this._layers={};e&&this.addData(e)},addData:function(e){var t=i.Util.isArray(e)?e:e.features,n,r,s;if(t){for(n=0,r=t.length;n=0;n--)i.DomEvent.addListener(e,i.Draggable.START[n],t);return i.DomEvent.addListener(e,"click",i.DomEvent._fakeStop).addListener(e,"dblclick",t)},preventDefault:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1;return this},stop:function(e){return i.DomEvent.preventDefault(e).stopPropagation(e)},getMousePosition:function(e,n){var r=i.Browser.ie7,s=t.body,o=t.documentElement,u=e.pageX?e.pageX-s.scrollLeft-o.scrollLeft:e.clientX,a=e.pageY?e.pageY-s.scrollTop-o.scrollTop:e.clientY,f=new i.Point(u,a),l=n.getBoundingClientRect(),c=l.left-n.clientLeft,h=l.top-n.clientTop;if(!i.DomUtil.documentIsLtr()&&(i.Browser.webkit||r)){c+=n.scrollWidth-n.clientWidth;r&&i.DomUtil.getStyle(n,"overflow-y")!=="hidden"&&i.DomUtil.getStyle(n,"overflow")!=="hidden"&&(c+=17)}return f._subtract(new i.Point(c,h))},getWheelDelta:function(e){var t=0;e.wheelDelta&&(t=e.wheelDelta/120);e.detail&&(t=-e.detail/3);return t},_skipEvents:{},_fakeStop:function(e){i.DomEvent._skipEvents[e.type]=!0},_skipped:function(e){var t=this._skipEvents[e.type];this._skipEvents[e.type]=!1;return t},_checkMouse:function(e,t){var n=t.relatedTarget;if(!n)return!0;try{while(n&&n!==e)n=n.parentNode}catch(r){return!1}return n!==e},_getEvent:function(){var t=e.event;if(!t){var n=arguments.callee.caller;while(n){t=n.arguments[0];if(t&&e.Event===t.constructor)break;n=n.caller}}return t},_filterClick:function(e,t){var n=e.timeStamp||e.originalEvent.timeStamp,r=i.DomEvent._lastClick&&n-i.DomEvent._lastClick;if(r&&r>100&&r<1e3||e.target._simulatedClick&&!e._simulated){i.DomEvent.stop(e);return}i.DomEvent._lastClick=n;return t(e)}};i.DomEvent.on=i.DomEvent.addListener;i.DomEvent.off=i.DomEvent.removeListener;i.Draggable=i.Class.extend({includes:i.Mixin.Events,statics:{START:i.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"}},initialize:function(e,t){this._element=e;this._dragStartTarget=t||e},enable:function(){if(this._enabled)return;for(var e=i.Draggable.START.length-1;e>=0;e--)i.DomEvent.on(this._dragStartTarget,i.Draggable.START[e],this._onDown,this);this._enabled=!0},disable:function(){if(!this._enabled)return;for(var e=i.Draggable.START.length-1;e>=0;e--)i.DomEvent.off(this._dragStartTarget,i.Draggable.START[e],this._onDown,this);this._enabled=!1;this._moved=!1},_onDown:function(e){if(e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)return;i.DomEvent.stopPropagation(e);if(i.Draggable._disabled)return;i.DomUtil.disableImageDrag();i.DomUtil.disableTextSelection();var n=e.touches?e.touches[0]:e,r=n.target;i.Browser.touch&&r.tagName.toLowerCase()==="a"&&i.DomUtil.addClass(r,"leaflet-active");this._moved=!1;if(this._moving)return;this._startPoint=new i.Point(n.clientX,n.clientY);this._startPos=this._newPos=i.DomUtil.getPosition(this._element);i.DomEvent.on(t,i.Draggable.MOVE[e.type],this._onMove,this).on(t,i.Draggable.END[e.type],this._onUp,this)},_onMove:function(e){if(e.touches&&e.touches.length>1)return;var n=e.touches&&e.touches.length===1?e.touches[0]:e,r=new i.Point(n.clientX,n.clientY),s=r.subtract(this._startPoint);if(!s.x&&!s.y)return;i.DomEvent.preventDefault(e);if(!this._moved){this.fire("dragstart");this._moved=!0;this._startPos=i.DomUtil.getPosition(this._element).subtract(s);i.Browser.touch||i.DomUtil.addClass(t.body,"leaflet-dragging")}this._newPos=this._startPos.add(s);this._moving=!0;i.Util.cancelAnimFrame(this._animRequest);this._animRequest=i.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)},_updatePosition:function(){this.fire("predrag");i.DomUtil.setPosition(this._element,this._newPos);this.fire("drag")},_onUp:function(){i.Browser.touch||i.DomUtil.removeClass(t.body,"leaflet-dragging");for(var e in i.Draggable.MOVE)i.DomEvent.off(t,i.Draggable.MOVE[e],this._onMove).off(t,i.Draggable.END[e],this._onUp);i.DomUtil.enableImageDrag();i.DomUtil.enableTextSelection();if(this._moved){i.Util.cancelAnimFrame(this._animRequest);this.fire("dragend")}this._moving=!1}});i.Handler=i.Class.extend({initialize:function(e){this._map=e},enable:function(){if(this._enabled)return;this._enabled=!0;this.addHooks()},disable:function(){if(!this._enabled)return;this._enabled=!1;this.removeHooks()},enabled:function(){return!!this._enabled}});i.Map.mergeOptions({dragging:!0,inertia:!i.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:Infinity,inertiaThreshold:i.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1});i.Map.Drag=i.Handler.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new i.Draggable(e._mapPane,e._container);this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this);if(e.options.worldCopyJump){this._draggable.on("predrag",this._onPreDrag,this);e.on("viewreset",this._onViewReset,this);this._onViewReset()}}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var e=this._map;e._panAnim&&e._panAnim.stop();e.fire("movestart").fire("dragstart");if(e.options.inertia){this._positions=[];this._times=[]}},_onDrag:function(){if(this._map.options.inertia){var e=this._lastTime=+(new Date),t=this._lastPos=this._draggable._newPos;this._positions.push(t);this._times.push(e);if(e-this._times[0]>200){this._positions.shift();this._times.shift()}}this._map.fire("move").fire("drag")},_onViewReset:function(){var e=this._map.getSize()._divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x;this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,i=(r-t+n)%e+t-n,s=(r+t+n)%e-t-n,o=Math.abs(i+n)t.inertiaThreshold||!this._positions[0];e.fire("dragend");if(r)e.fire("moveend");else{var s=this._lastPos.subtract(this._positions[0]),o=(this._lastTime+n-this._times[0])/1e3,u=t.easeLinearity,a=s.multiplyBy(u/o),f=a.distanceTo([0,0]),l=Math.min(t.inertiaMaxSpeed,f),c=a.multiplyBy(l/f),h=l/(t.inertiaDeceleration*u),p=c.multiplyBy(-h/2).round();!p.x||!p.y?e.fire("moveend"):i.Util.requestAnimFrame(function(){e.panBy(p,{duration:h,easeLinearity:u,noMoveStart:!0})})}}});i.Map.addInitHook("addHandler","dragging",i.Map.Drag);i.Map.mergeOptions({doubleClickZoom:!0});i.Map.DoubleClickZoom=i.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(e){this.setZoomAround(e.containerPoint,this._zoom+1)}});i.Map.addInitHook("addHandler","doubleClickZoom",i.Map.DoubleClickZoom);i.Map.mergeOptions({scrollWheelZoom:!0});i.Map.ScrollWheelZoom=i.Handler.extend({addHooks:function(){i.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this);i.DomEvent.on(this._map._container,"MozMousePixelScroll",i.DomEvent.preventDefault);this._delta=0},removeHooks:function(){i.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll);i.DomEvent.off(this._map._container,"MozMousePixelScroll",i.DomEvent.preventDefault)},_onWheelScroll:function(e){var t=i.DomEvent.getWheelDelta(e);this._delta+=t;this._lastMousePos=this._map.mouseEventToContainerPoint(e);this._startTime||(this._startTime=+(new Date));var n=Math.max(40-(+(new Date)-this._startTime),0);clearTimeout(this._timer);this._timer=setTimeout(i.bind(this._performZoom,this),n);i.DomEvent.preventDefault(e);i.DomEvent.stopPropagation(e)},_performZoom:function(){var e=this._map,t=this._delta,n=e.getZoom();t=t>0?Math.ceil(t):Math.floor(t);t=Math.max(Math.min(t,4),-4);t=e._limitZoom(n+t)-n;this._delta=0;this._startTime=null;if(!t)return;e.setZoomAround(this._lastMousePos,n+t)}});i.Map.addInitHook("addHandler","scrollWheelZoom",i.Map.ScrollWheelZoom);i.extend(i.DomEvent,{_touchstart:i.Browser.msTouch?"MSPointerDown":"touchstart",_touchend:i.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(e,n,r){function p(e){var t;if(i.Browser.msTouch){h.push(e.pointerId);t=h.length}else t=e.touches.length;if(t>1)return;var n=Date.now(),r=n-(s||n);a=e.touches?e.touches[0]:e;o=r>0&&r<=u;s=n}function d(e){if(i.Browser.msTouch){var t=h.indexOf(e.pointerId);if(t===-1)return;h.splice(t,1)}if(o){if(i.Browser.msTouch){var r={},u;for(var f in a){u=a[f];typeof u=="function"?r[f]=u.bind(a):r[f]=u}a=r}a.type="dblclick";n(a);s=null}}var s,o=!1,u=250,a,f="_leaflet_",l=this._touchstart,c=this._touchend,h=[];e[f+l+r]=p;e[f+c+r]=d;var v=i.Browser.msTouch?t.documentElement:e;e.addEventListener(l,p,!1);v.addEventListener(c,d,!1);i.Browser.msTouch&&v.addEventListener("MSPointerCancel",d,!1);return this},removeDoubleTapListener:function(e,n){var r="_leaflet_";e.removeEventListener(this._touchstart,e[r+this._touchstart+n],!1);(i.Browser.msTouch?t.documentElement:e).removeEventListener(this._touchend,e[r+this._touchend+n],!1);i.Browser.msTouch&&t.documentElement.removeEventListener("MSPointerCancel",e[r+this._touchend+n],!1);return this}});i.extend(i.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(e,t,n,r){switch(t){case"touchstart":return this.addMsTouchListenerStart(e,t,n,r);case"touchend":return this.addMsTouchListenerEnd(e,t,n,r);case"touchmove":return this.addMsTouchListenerMove(e,t,n,r);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(e,n,r,i){var s="_leaflet_",o=this._msTouches,u=function(e){var t=!1;for(var n=0;n0?Math.ceil(o):Math.floor(o),a=e._limitZoom(s+u),f=e.getZoomScale(a)/this._scale;e._animateZoom(r,a,n,f)},_getScaleOrigin:function(){var e=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(e)}});i.Map.addInitHook("addHandler","touchZoom",i.Map.TouchZoom);i.Map.mergeOptions({tap:!0,tapTolerance:15});i.Map.Tap=i.Handler.extend({addHooks:function(){i.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){i.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(!e.touches)return;i.DomEvent.preventDefault(e);this._fireClick=!0;if(e.touches.length>1){this._fireClick=!1;clearTimeout(this._holdTimeout);return}var n=e.touches[0],r=n.target;this._startPos=this._newPos=new i.Point(n.clientX,n.clientY);r.tagName.toLowerCase()==="a"&&i.DomUtil.addClass(r,"leaflet-active");this._holdTimeout=setTimeout(i.bind(function(){if(this._isTapValid()){this._fireClick=!1;this._onUp();this._simulateEvent("contextmenu",n)}},this),1e3);i.DomEvent.on(t,"touchmove",this._onMove,this).on(t,"touchend",this._onUp,this)},_onUp:function(e){clearTimeout(this._holdTimeout);i.DomEvent.off(t,"touchmove",this._onMove,this).off(t,"touchend",this._onUp,this);if(this._fireClick&&e&&e.changedTouches){var n=e.changedTouches[0],r=n.target;r.tagName.toLowerCase()==="a"&&i.DomUtil.removeClass(r,"leaflet-active");this._isTapValid()&&this._simulateEvent("click",n)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(e){var t=e.touches[0];this._newPos=new i.Point(t.clientX,t.clientY)},_simulateEvent:function(n,r){var i=t.createEvent("MouseEvents");i._simulated=!0;r.target._simulatedClick=!0;i.initMouseEvent(n,!0,!0,e,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null);r.target.dispatchEvent(i)}});i.Browser.touch&&!i.Browser.msTouch&&i.Map.addInitHook("addHandler","tap",i.Map.Tap);i.Map.mergeOptions({boxZoom:!0});i.Map.BoxZoom=i.Handler.extend({initialize:function(e){this._map=e;this._container=e._container;this._pane=e._panes.overlayPane},addHooks:function(){i.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){i.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;i.DomUtil.disableTextSelection();i.DomUtil.disableImageDrag();this._startLayerPoint=this._map.mouseEventToLayerPoint(e);this._box=i.DomUtil.create("div","leaflet-zoom-box",this._pane);i.DomUtil.setPosition(this._box,this._startLayerPoint);this._container.style.cursor="crosshair";i.DomEvent.on(t,"mousemove",this._onMouseMove,this).on(t,"mouseup",this._onMouseUp,this).on(t,"keydown",this._onKeyDown,this);this._map.fire("boxzoomstart")},_onMouseMove:function(e){var t=this._startLayerPoint,n=this._box,r=this._map.mouseEventToLayerPoint(e),s=r.subtract(t),o=new i.Point(Math.min(r.x,t.x),Math.min(r.y,t.y));i.DomUtil.setPosition(n,o);n.style.width=Math.max(0,Math.abs(s.x)-4)+"px";n.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._pane.removeChild(this._box);this._container.style.cursor="";i.DomUtil.enableTextSelection();i.DomUtil.enableImageDrag();i.DomEvent.off(t,"mousemove",this._onMouseMove).off(t,"mouseup",this._onMouseUp).off(t,"keydown",this._onKeyDown)},_onMouseUp:function(e){this._finish();var t=this._map,n=t.mouseEventToLayerPoint(e);if(this._startLayerPoint.equals(n))return;var r=new i.LatLngBounds(t.layerPointToLatLng(this._startLayerPoint),t.layerPointToLatLng(n));t.fitBounds(r);t.fire("boxzoomend",{boxZoomBounds:r})},_onKeyDown:function(e){e.keyCode===27&&this._finish()}});i.Map.addInitHook("addHandler","boxZoom",i.Map.BoxZoom);i.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1});i.Map.Keyboard=i.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(e){this._map=e;this._setPanOffset(e.options.keyboardPanOffset);this._setZoomOffset(e.options.keyboardZoomOffset)},addHooks:function(){var e=this._map._container;e.tabIndex===-1&&(e.tabIndex="0");i.DomEvent.on(e,"focus",this._onFocus,this).on(e,"blur",this._onBlur,this).on(e,"mousedown",this._onMouseDown,this);this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var e=this._map._container;i.DomEvent.off(e,"focus",this._onFocus,this).off(e,"blur",this._onBlur,this).off(e,"mousedown",this._onMouseDown,this);this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(this._focused)return;var n=t.body,r=t.documentElement,i=n.scrollTop||r.scrollTop,s=n.scrollLeft||r.scrollLeft;this._map._container.focus();e.scrollTo(s,i)},_onFocus:function(){this._focused=!0;this._map.fire("focus")},_onBlur:function(){this._focused=!1;this._map.fire("blur")},_setPanOffset:function(e){var t=this._panKeys={},n=this.keyCodes,r,i;for(r=0,i=n.left.length;rLeaflet'},initialize:function(e){i.setOptions(this,e);this._attributions={}},onAdd:function(e){this._container=i.DomUtil.create("div","leaflet-control-attribution");i.DomEvent.disableClickPropagation(this._container);e.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this);this._update();return this._container},onRemove:function(e){e.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(e){this.options.prefix=e;this._update();return this},addAttribution:function(e){if(!e)return;this._attributions[e]||(this._attributions[e]=0);this._attributions[e]++;this._update();return this},removeAttribution:function(e){if(!e)return;if(this._attributions[e]){this._attributions[e]--;this._update()}return this},_update:function(){if(!this._map)return;var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix);e.length&&n.push(e.join(", "));this._container.innerHTML=n.join(" | ")},_onLayerAdd:function(e){e.layer.getAttribution&&this.addAttribution(e.layer.getAttribution())},_onLayerRemove:function(e){e.layer.getAttribution&&this.removeAttribution(e.layer.getAttribution())}});i.Map.mergeOptions({attributionControl:!0});i.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new i.Control.Attribution).addTo(this))});i.control.attribution=function(e){return new i.Control.Attribution(e)};i.Control.Scale=i.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(e){this._map=e;var t="leaflet-control-scale",n=i.DomUtil.create("div",t),r=this.options;this._addScales(r,t,n);e.on(r.updateWhenIdle?"moveend":"move",this._update,this);e.whenReady(this._update,this);return n},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=i.DomUtil.create("div",t+"-line",n));e.imperial&&(this._iScale=i.DomUtil.create("div",t+"-line",n))},_update:function(){var e=this._map.getBounds(),t=e.getCenter().lat,n=6378137*Math.PI*Math.cos(t*Math.PI/180),r=n*(e.getNorthEast().lng-e.getSouthWest().lng)/180,i=this._map.getSize(),s=this.options,o=0;i.x>0&&(o=r*(s.maxWidth/i.x));this._updateScales(s,o)},_updateScales:function(e,t){e.metric&&t&&this._updateMetric(t);e.imperial&&t&&this._updateImperial(t)},_updateMetric:function(e){var t=this._getRoundNum(e);this._mScale.style.width=this._getScaleWidth(t/e)+"px";this._mScale.innerHTML=t<1e3?t+" m":t/1e3+" km"},_updateImperial:function(e){var t=e*3.2808399,n=this._iScale,r,i,s;if(t>5280){r=t/5280;i=this._getRoundNum(r);n.style.width=this._getScaleWidth(i/r)+"px";n.innerHTML=i+" mi"}else{s=this._getRoundNum(t);n.style.width=this._getScaleWidth(s/t)+"px";n.innerHTML=s+" ft"}},_getScaleWidth:function(e){return Math.round(this.options.maxWidth*e)-10},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1;return t*n}});i.control.scale=function(e){return new i.Control.Scale(e)};i.Control.Layers=i.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(e,t,n){i.setOptions(this,n);this._layers={};this._lastZIndex=0;this._handlingClick=!1;for(var r in e)this._addLayer(e[r],r);for(r in t)this._addLayer(t[r],r,!0)},onAdd:function(e){this._initLayout();this._update();e.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this);return this._container},onRemove:function(e){e.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(e,t){this._addLayer(e,t);this._update();return this},addOverlay:function(e,t){this._addLayer(e,t,!0);this._update();return this},removeLayer:function(e){var t=i.stamp(e);delete this._layers[t];this._update();return this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=i.DomUtil.create("div",e);t.setAttribute("aria-haspopup",!0);if(!i.Browser.touch){i.DomEvent.disableClickPropagation(t);i.DomEvent.on(t,"mousewheel",i.DomEvent.stopPropagation)}else i.DomEvent.on(t,"click",i.DomEvent.stopPropagation);var n=this._form=i.DomUtil.create("form",e+"-list");if(this.options.collapsed){i.Browser.android||i.DomEvent.on(t,"mouseover",this._expand,this).on(t,"mouseout",this._collapse,this);var r=this._layersLink=i.DomUtil.create("a",e+"-toggle",t);r.href="#";r.title="Layers";i.Browser.touch?i.DomEvent.on(r,"click",i.DomEvent.stop).on(r,"click",this._expand,this):i.DomEvent.on(r,"focus",this._expand,this);this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=i.DomUtil.create("div",e+"-base",n);this._separator=i.DomUtil.create("div",e+"-separator",n);this._overlaysList=i.DomUtil.create("div",e+"-overlays",n);t.appendChild(n)},_addLayer:function(e,t,n){var r=i.stamp(e);this._layers[r]={layer:e,name:t,overlay:n};if(this.options.autoZIndex&&e.setZIndex){this._lastZIndex++;e.setZIndex(this._lastZIndex)}},_update:function(){if(!this._container)return;this._baseLayersList.innerHTML="";this._overlaysList.innerHTML="";var e=!1,t=!1,n,r;for(n in this._layers){r=this._layers[n];this._addItem(r);t=t||r.overlay;e=e||!r.overlay}this._separator.style.display=t&&e?"":"none"},_onLayerChange:function(e){var t=this._layers[i.stamp(e.layer)];if(!t)return;this._handlingClick||this._update();var n=t.overlay?e.type==="layeradd"?"overlayadd":"overlayremove":e.type==="layeradd"?"baselayerchange":null;n&&this._map.fire(n,t)},_createRadioElement:function(e,n){var r='this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),i=this._getCenterOffset(e)._divideBy(1-1/r),s=this._getCenterLayerPoint()._add(i);if(n.animate!==!0&&!this.getSize().contains(i))return!1;this.fire("movestart").fire("zoomstart");this._animateZoom(e,t,s,r,null,!0);return!0},_animateZoom:function(e,t,n,r,s,o){this._animatingZoom=!0;i.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim");this._animateToCenter=e;this._animateToZoom=t;i.Draggable&&(i.Draggable._disabled=!0);this.fire("zoomanim",{center:e,zoom:t,origin:n,scale:r,delta:s,backwards:o})},_onZoomTransitionEnd:function(){this._animatingZoom=!1;i.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim");this._resetView(this._animateToCenter,this._animateToZoom,!0,!0);i.Draggable&&(i.Draggable._disabled=!1)}}:{});i.TileLayer.include({_animateZoom:function(e){if(!this._animating){this._animating=!0;this._prepareBgBuffer()}var t=this._bgBuffer,n=i.DomUtil.TRANSFORM,r=e.delta?i.DomUtil.getTranslateString(e.delta):t.style[n],s=i.DomUtil.getScaleString(e.scale,e.origin);t.style[n]=e.backwards?s+" "+r:r+" "+s},_endZoomAnim:function(){var e=this._tileContainer,t=this._bgBuffer;e.style.visibility="";e.parentNode.appendChild(e);i.Util.falseFn(t.offsetWidth);this._animating=!1},_clearBgBuffer:function(){var e=this._map;if(e&&!e._animatingZoom&&!e.touchZoom._zooming){this._bgBuffer.innerHTML="";this._bgBuffer.style[i.DomUtil.TRANSFORM]=""}},_prepareBgBuffer:function(){var e=this._tileContainer,t=this._bgBuffer,n=this._getLoadedTilesPercentage(t),r=this._getLoadedTilesPercentage(e);if(t&&n>.5&&r<.5){e.style.visibility="hidden";this._stopLoadingImages(e);return}t.style.visibility="hidden";t.style[i.DomUtil.TRANSFORM]="";this._tileContainer=t;t=this._bgBuffer=e;this._stopLoadingImages(t);clearTimeout(this._clearBgBufferTimer)},_getLoadedTilesPercentage:function(e){var t=e.getElementsByTagName("img"),n,r,i=0;for(n=0,r=t.length;nStamen Design, ','under CC BY 3.0. ','Data by OpenStreetMap, ','under CC BY SA.'].join("")}},r={toner:n("toner","png",0,20),terrain:n("terrain","jpg",4,18),watercolor:n("watercolor","jpg",1,16),"trees-cabs-crime":{url:"http://{S}.tiles.mapbox.com/v3/stamen.trees-cabs-crime/{Z}/{X}/{Y}.png",type:"png",subdomains:"a b c d".split(" "),minZoom:11,maxZoom:18,extent:[{lat:37.853,lon:-122.577},{lat:37.684,lon:-122.313}],attribution:['Design by Shawn Allen at Stamen.','Data courtesy of FuF,','Yellow Cab','& SFPD.'].join(" ")}};i("toner",["hybrid","labels","lines","background","lite"]);i("toner",["2010"]);i("toner",["2011","2011-lines","2011-labels","2011-lite"]);i("terrain",["background"]);i("terrain",["labels","lines"],"png");e.stamen=e.stamen||{};e.stamen.tile=e.stamen.tile||{};e.stamen.tile.providers=r;e.stamen.tile.getProvider=s;if(typeof MM=="object"){var o=typeof MM.Template=="function"?MM.Template:MM.TemplatedMapProvider;MM.StamenTileLayer=function(e){var t=s(e);this._provider=t;MM.Layer.call(this,new o(t.url,t.subdomains));this.provider.setZoomRange(t.minZoom,t.maxZoom);this.attribution=t.attribution};MM.StamenTileLayer.prototype={setCoordLimits:function(e){var t=this._provider;if(t.extent){e.coordLimits=[e.locationCoordinate(t.extent[0]).zoomTo(t.minZoom),e.locationCoordinate(t.extent[1]).zoomTo(t.maxZoom)];return!0}return!1}};MM.extend(MM.StamenTileLayer,MM.Layer)}typeof L=="object"&&(L.StamenTileLayer=L.TileLayer.extend({initialize:function(e){var t=s(e),n=t.url.replace(/({[A-Z]})/g,function(e){return e.toLowerCase()});L.TileLayer.prototype.initialize.call(this,n,{minZoom:t.minZoom,maxZoom:t.maxZoom,subdomains:t.subdomains,scheme:"xyz",attribution:t.attribution})}}));if(typeof google=="object"&&typeof google.maps=="object"){google.maps.StamenMapType=function(e){var t=s(e),n=t.subdomains;return google.maps.ImageMapType.call(this,{getTileUrl:function(e,r){var i=1<=0){var n=0,r=this.current_marker;this.current_marker=e;var i=this._markers[this.current_marker];this.animator&&this.animator.stop();this._resetMarkersActive();if(i.data.type&&i.data.type=="overview"){this._markerOverview();t||this._onMarkerChange()}else{i.active(!0);if(t)i.data.location&&this._viewTo(i.data.location);else{if(i.data.location&&i.data.location.lat){trace("HAS LOCATION");n=this._calculateZoomChange(this._getMapCenter(!0),i.location());this._viewTo(i.data.location,{calculate_zoom:this.options.calculate_zoom,zoom:n});if(this.options.line_follows_path){if(this.options.show_history_line&&i.data.real_marker&&this._markers[r].data.real_marker){var s=[],o=r;if(othis.current_marker)while(o>this.current_marker){var u={lat:this._markers[o].data.location.lat,lon:this._markers[o].data.location.lon};s.push(u);o--}s.push({lat:i.data.location.lat,lon:i.data.location.lon});this._replaceLines(this._line_active,s)}}else this.options.show_history_line&&i.data.real_marker&&this._markers[r].data.real_marker&&this._replaceLines(this._line_active,[{lat:i.data.location.lat,lon:i.data.location.lon},{lat:this._markers[r].data.location.lat,lon:this._markers[r].data.location.lon}])}else{this._markerOverview();t||this._onMarkerChange()}this._onMarkerChange()}}}},panTo:function(e,t){this._panTo(e,t)},zoomTo:function(e,t){this._zoomTo(e,t)},viewTo:function(e,t){this._viewTo(e,t)},getBoundsZoom:function(e,t,n,r){this.__getBoundsZoom(e,t,n,r)},markerOverview:function(){this._markerOverview()},show:function(){},hide:function(){},addTo:function(e){e.appendChild(this._el.container);this.onAdd()},removeFrom:function(e){e.removeChild(this._el.container);this.onRemove()},createMarkers:function(e){this._createMarkers(e)},createMarker:function(e){this._createMarker(e)},_destroyMarker:function(e){this._removeMarker(e);for(var t=0;t";this._marker.bindPopup(n,{closeButton:!1,offset:[0,43]})},_active:function(e){var t=this;this.data.media&&this.data.media.mediatype?this.media_icon_class="vco-mapmarker-icon vco-icon-"+this.data.media.mediatype.type:this.media_icon_class="vco-mapmarker-icon vco-icon-plaintext";if(this.data.real_marker)if(e){this._marker.setZIndexOffset(100);this._icon=L.divIcon({className:"vco-mapmarker-active "+this.media_icon_class});this.timer=setTimeout(function(){t._openPopup()},this.options.duration+200);this._setIcon()}else{this._marker.closePopup();clearTimeout(this.timer);this._marker.setZIndexOffset(0);this._icon=L.divIcon({className:"vco-mapmarker "+this.media_icon_class});this._setIcon()}},_openPopup:function(){this._marker.openPopup()},_setIcon:function(){this._marker.setIcon(this._icon)},_location:function(){return this.data.real_marker?this._marker.getLatLng():{}}});VCO.Map.Leaflet=VCO.Map.extend({includes:[VCO.Events],_createMap:function(){L.Icon.Default.imagePath=this.options.path_gfx;this._map=new L.map(this._el.map,{scrollWheelZoom:!1});this._map.on("load",this._onMapLoaded,this);var e,t=this.options.map_type.split(":");switch(t[0]){case"stamen":e=new L.StamenTileLayer(t[1]||"toner");break;case"osm":e=new L.TileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{subdomains:"ab"});break;case"http":case"https":e=new L.TileLayer(this.options.map_type,{subdomains:this.options.map_subdomains});break;default:e=new L.StamenTileLayer("toner")}this._map.addLayer(e);this._line=this._createLine(this._line);this._line.setStyle({color:this.options.line_color_inactive});this._addLineToMap(this._line);this._line_active=this._createLine(this._line_active);this._line_active.setStyle({opacity:1});this._addLineToMap(this._line_active)},_createMarker:function(e){var t=new VCO.MapMarker.Leaflet(e,this.options);t.on("markerclick",this._onMarkerClick,this);this._addMarker(t);this._markers.push(t);t.marker_number=this._markers.length-1;this.fire("markerAdded",t)},_addMarker:function(e){e.addTo(this._map)},_removeMarker:function(e){},_markerOverview:function(){var e=[];for(var t=0;t1?1:e)},mirror:function(e){return e<.5?easings.sinusoidal(e*2):easings.sinusoidal(1-(e-.5)*2)},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+ --e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}};VCO.Animate=function(e,t){var n=new vcoanimate(e,t),r;return n};!function(e,t){typeof define=="function"?define(t):typeof module!="undefined"?module.exports=t():this[e]=t()}("vcoanimate",function(){function E(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t);for(n=0;n1e12&&(e=i());o&&(e=i());for(t=n;t--;)w[t](e);w.length&&b(S)}function x(e){w.push(e)===1&&b(S)}function T(e){var t,n=E(w,e);if(n>=0){t=w.slice(n+1);w.length=n;w=w.concat(t)}}function N(e,t){var n={},r;if(r=e.match(c))n.rotate=B(r[1],t?t.rotate:null);if(r=e.match(h))n.scale=B(r[1],t?t.scale:null);if(r=e.match(p)){n.skewx=B(r[1],t?t.skewx:null);n.skewy=B(r[3],t?t.skewy:null)}if(r=e.match(d)){n.translatex=B(r[1],t?t.translatex:null);n.translatey=B(r[3],t?t.translatey:null)}return n}function C(e){var t="";"rotate"in e&&(t+="rotate("+e.rotate+"deg) ");"scale"in e&&(t+="scale("+e.scale+") ");"translatex"in e&&(t+="translate("+e.translatex+"px,"+e.translatey+"px) ");"skewx"in e&&(t+="skew("+e.skewx+"deg,"+e.skewy+"deg)");return t}function k(e,t,n){return"#"+(1<<24|e<<16|t<<8|n).toString(16).slice(1)}function L(e){var t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);return(t?k(t[1],t[2],t[3]):e).replace(/#(\w)(\w)(\w)$/,"#$1$1$2$2$3$3")}function A(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function O(e){return typeof e=="function"}function M(e){return Math.sin(e*Math.PI/2)}function _(e,t,n,r,s,o){function d(e){var i=e-c;if(i>a||h){o=isFinite(o)?o:1;h?p&&t(o):t(o);T(d);return n&&n.apply(f)}isFinite(o)?t(l*r(i/a)+s):t(r(i/a))}r=O(r)?r:j.easings[r]||M;var a=e||u,f=this,l=o-s,c=i(),h=0,p=0;x(d);return{stop:function(e){h=1;p=e;e||(n=null)}}}function D(e,t){var n=e.length,r=[],i,s;for(i=0;i15?15:s<0?0:s;r[i]=s.toString(16)}return"#"+r.join("")}function H(e,t,n,r,i,s,o){if(i=="transform"){o={};for(var a in n[s][i])o[a]=a in r[s][i]?Math.round(((r[s][i][a]-n[s][i][a])*e+n[s][i][a])*u)/u:n[s][i][a];return o}if(typeof n[s][i]=="string")return P(e,n[s][i],r[s][i]);o=Math.round(((r[s][i]-n[s][i])*e+n[s][i])*u)/u;i in v||(o+=t[s][i]||"px");return o}function B(e,t,n,r,i){return(n=f.exec(e))?(i=parseFloat(n[2]))&&t+(n[1]=="+"?1:-1)*i:parseFloat(e)}function j(e,t){var n=e?n=isFinite(e.length)?e:[e]:[],r,i=t.complete,s=t.duration,o=t.easing,u=t.bezier,f=[],c=[],h=[],p=[],d,v;if(u){d=t.left;v=t.top;delete t.right;delete t.bottom;delete t.left;delete t.top}for(r=n.length;r--;){f[r]={};c[r]={};h[r]={};if(u){var b=y(n[r],"left"),w=y(n[r],"top"),E=[B(O(d)?d(n[r]):d||0,parseFloat(b)),B(O(v)?v(n[r]):v||0,parseFloat(w))];p[r]=O(u)?u(n[r],E):u;p[r].push(E);p[r].unshift([parseInt(b,10),parseInt(w,10)])}for(var S in t){switch(S){case"complete":case"duration":case"easing":case"bezier":continue}var x=y(n[r],S),T,k=O(t[S])?t[S](n[r]):t[S];if(typeof k=="string"&&a.test(k)&&!a.test(x)){delete t[S];continue}f[r][S]=S=="transform"?N(x):typeof k=="string"&&a.test(k)?L(x).slice(1):parseFloat(x);c[r][S]=S=="transform"?N(k,f[r][S]):typeof k=="string"&&k.charAt(0)=="#"?L(k).slice(1):B(k,parseFloat(x));typeof k=="string"&&(T=k.match(l))&&(h[r][S]=T[1])}}return _.apply(n,[s,function(e,i,s){for(r=n.length;r--;){if(u){s=D(p[r],e);n[r].style.left=s[0]+"px";n[r].style.top=s[1]+"px"}for(var o in t){i=H(e,h,f,c,o,r);o=="transform"?n[r].style[m]=C(i):o=="opacity"&&!g?n[r].style.filter="alpha(opacity="+i*100+")":n[r].style[A(o)]=i}}},i,o])}var e=document,t=window,n=t.performance,r=n&&(n.now||n.webkitNow||n.msNow||n.mozNow),i=r?function(){return r.call(n)}:function(){return+(new Date)},s=e.documentElement,o=!1,u=1e3,a=/^rgb\(|#/,f=/^([+\-])=([\d\.]+)/,l=/^(?:[\+\-]=?)?\d+(?:\.\d+)?(%|in|cm|mm|em|ex|pt|pc|px)$/,c=/rotate\(((?:[+\-]=)?([\-\d\.]+))deg\)/,h=/scale\(((?:[+\-]=)?([\d\.]+))\)/,p=/skew\(((?:[+\-]=)?([\-\d\.]+))deg, ?((?:[+\-]=)?([\-\d\.]+))deg\)/,d=/translate\(((?:[+\-]=)?([\-\d\.]+))px, ?((?:[+\-]=)?([\-\d\.]+))px\)/,v={lineHeight:1,zoom:1,zIndex:1,opacity:1,transform:1},m=function(){var t=e.createElement("a").style,n=["webkitTransform","MozTransform","OTransform","msTransform","Transform"],r;for(r=0;r1e12!=i()>1e12});j.tween=_;j.getStyle=y;j.bezier=D;j.transform=m;j.parseTransform=N;j.formatTransform=C;j.easings={};return j});VCO.Point=function(e,t,n){this.x=n?Math.round(e):e;this.y=n?Math.round(t):t};VCO.Point.prototype={add:function(e){return this.clone()._add(e)},_add:function(e){this.x+=e.x;this.y+=e.y;return this},subtract:function(e){return this.clone()._subtract(e)},_subtract:function(e){this.x-=e.x;this.y-=e.y;return this},divideBy:function(e,t){return new VCO.Point(this.x/e,this.y/e,t)},multiplyBy:function(e){return new VCO.Point(this.x*e,this.y*e)},distanceTo:function(e){var t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},round:function(){return this.clone()._round()},_round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},clone:function(){return new VCO.Point(this.x,this.y)},toString:function(){return"Point("+VCO.Util.formatNum(this.x)+", "+VCO.Util.formatNum(this.y)+")"}};VCO.DomMixins={show:function(e){e||(this._el.container.style.display="block")},hide:function(e){this._el.container.style.display="none"},addTo:function(e){e.appendChild(this._el.container);this.onAdd()},removeFrom:function(e){e.removeChild(this._el.container);this.onRemove()},animatePosition:function(e,t){var n={duration:this.options.duration,easing:this.options.ease};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]+"px");this.animator&&this.animator.stop();this.animator=VCO.Animate(t,n)},onLoaded:function(){this.fire("loaded",this.data)},onAdd:function(){this.fire("added",this.data)},onRemove:function(){this.fire("removed",this.data)},setPosition:function(e,t){for(var n in e)e.hasOwnProperty(n)&&(t?t.style[n]=e[n]+"px":this._el.container.style[n]=e[n]+"px")},getPosition:function(){return VCO.Dom.getPosition(this._el.container)}};VCO.Dom={get:function(e){return typeof e=="string"?document.getElementById(e):e},create:function(e,t,n){var r=document.createElement(e);r.className=t;n&&n.appendChild(r);return r},createText:function(e,t){var n=document.createTextNode(e);t&&t.appendChild(n);return n},getTranslateString:function(e){return VCO.Dom.TRANSLATE_OPEN+e.x+"px,"+e.y+"px"+VCO.Dom.TRANSLATE_CLOSE},setPosition:function(e,t){e._vco_pos=t;if(VCO.Browser.webkit3d){e.style[VCO.Dom.TRANSFORM]=VCO.Dom.getTranslateString(t);if(VCO.Browser.android){e.style["-webkit-perspective"]="1000";e.style["-webkit-backface-visibility"]="hidden"}}else{e.style.left=t.x+"px";e.style.top=t.y+"px"}},getPosition:function(e){var t={x:0,y:0};while(e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop)){t.x+=e.offsetLeft;t.y+=e.offsetTop;e=e.offsetParent}return t},testProp:function(e){var t=document.documentElement.style;for(var n=0;n0&&(new RegExp("(^|\\s)"+t+"(\\s|$)")).test(e.className)},addClass:function(e,t){VCO.DomUtil.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},removeClass:function(e,t){e.className=e.className.replace(/(\S+)\s*/g,function(e,n){return n===t?"":e}).replace(/^\s+/,"")},setOpacity:function(e,t){VCO.Browser.ie?e.style.filter="alpha(opacity="+Math.round(t*100)+")":e.style.opacity=t},testProp:function(e){var t=document.documentElement.style;for(var n=0;n1e4){this.data.direction="left";t.x>0&&(this.data.direction="right")}if(Math.abs(t.y)>1e4){this.data.direction="up";t.y>0&&(this.data.direction="down")}this._animateMomentum();n&&this.fire("swipe_"+this.data.direction,this.data)},_animateMomentum:function(){var e={x:this.data.new_pos.x,y:this.data.new_pos.y};if(this.options.constraint.top||this.options.constraint.bottom)e.y>this.options.constraint.bottom?e.y=this.options.constraint.bottom:e.ythis.options.constraint.left?e.x=this.options.constraint.left:e.xthis.options.sizebar_default_y){this.show();this.fire("momentum",{y:this.options.sizebar_default_y})}else{this.hide(25);this.fire("swipe",{y:1})}},_onSwipeDown:function(e){this._draggable.stopMomentum();this.show();this.fire("swipe",{y:this.options.sizebar_default_y})},_onButtonOverview:function(e){this.fire("overview",e)},_onButtonBackToStart:function(e){this.fire("back_to_start",e)},_onButtonCollapseMap:function(e){if(this.collapsed){this.collapsed=!1;this.show();this._el.button_overview.style.display="inline";this.fire("swipe",{y:this.options.sizebar_default_y});this._el.button_collapse_toggle.innerHTML=VCO.Language.buttons.collapse_toggle+""}else{this.collapsed=!0;this.hide(25);this._el.button_overview.style.display="none";this.fire("swipe",{y:1});this._el.button_collapse_toggle.innerHTML=VCO.Language.buttons.uncollapse_toggle+""}},_initLayout:function(){this._el.arrow=VCO.Dom.create("div","vco-arrow-up",this._el.container);this._el.container.style.top="0px";this._el.button_overview=VCO.Dom.create("span","vco-sizebar-button",this._el.container);this._el.button_overview.innerHTML=VCO.Language.buttons.map_overview;VCO.DomEvent.addListener(this._el.button_overview,"click",this._onButtonOverview,this);this._el.button_backtostart=VCO.Dom.create("span","vco-sizebar-button",this._el.container);this._el.button_backtostart.innerHTML=VCO.Language.buttons.backtostart+" ";VCO.DomEvent.addListener(this._el.button_backtostart,"click",this._onButtonBackToStart,this);this._el.button_collapse_toggle=VCO.Dom.create("span","vco-sizebar-button",this._el.container);this._el.button_collapse_toggle.innerHTML=VCO.Language.buttons.collapse_toggle+"";VCO.DomEvent.addListener(this._el.button_collapse_toggle,"click",this._onButtonCollapseMap,this);this._draggable=new VCO.Draggable(this._el.container,{enable:{x:!1,y:!0},constraint:{bottom:this.options.height}});this._draggable.on("dragstart",this._onDragStart,this);this._draggable.on("dragmove",this._onDragMove,this);this._draggable.on("dragend",this._onDragEnd,this);this._draggable.on("swipe_up",this._onSwipeUp,this);this._draggable.on("swipe_down",this._onSwipeDown,this);this._draggable.on("momentum",this._onMomentum,this);this._draggable.enable()},_initEvents:function(){},_updateDisplay:function(e,t,n,r){e&&(this.options.width=e);t&&(this.options.height=t);this._draggable.updateConstraint({bottom:this.options.height-this._el.container.offsetHeight});this._el.container.style.width=this.options.width+"px";this._el.arrow.style.left=this.options.width/2-17+"px";trace(r)}});VCO.Message=VCO.Class.extend({includes:[VCO.Events,VCO.DomMixins],_el:{},initialize:function(e,t,n){this._el={parent:{},container:{},message_container:{},loading_icon:{},message:{}};this.options={width:600,height:600};this._el.container=VCO.Dom.create("div","vco-message");if(n){n.appendChild(this._el.container);this._el.parent=n}this.animator={};VCO.Util.mergeData(this.data,e);VCO.Util.mergeData(this.options,t);this._initLayout();this._initEvents()},updateMessage:function(e){this._updateMessage(e)},updateDisplay:function(e,t){this._updateDisplay(e,t)},_updateMessage:function(e){e?this._el.message.innerHTML=e:VCO.Language?this._el.message.innerHTML=VCO.Language.messages.loading:this._el.message.innerHTML="Loading"},_onMouseClick:function(){this.fire("clicked",this.options)},_initLayout:function(){this._el.message_container=VCO.Dom.create("div","vco-message-container",this._el.container);this._el.loading_icon=VCO.Dom.create("div","vco-loading-icon",this._el.message_container);this._el.message=VCO.Dom.create("div","vco-message-content",this._el.message_container);this._updateMessage()},_initEvents:function(){},_updateDisplay:function(e,t,n){}});VCO.MediaType=function(e){var t={},n=[{type:"youtube",name:"YouTube",match_str:"(www.)?youtube|youtu.be",cls:VCO.Media.YouTube},{type:"vimeo",name:"Vimeo",match_str:"(player.)?vimeo.com",cls:VCO.Media.Vimeo},{type:"dailymotion",name:"DailyMotion",match_str:"(www.)?dailymotion.com",cls:VCO.Media.DailyMotion},{type:"vine",name:"Vine",match_str:"(www.)?vine.co",cls:VCO.Media.Vine},{type:"soundcloud",name:"SoundCloud",match_str:"(player.)?soundcloud.com",cls:VCO.Media.SoundCloud},{type:"twitter",name:"Twitter",match_str:"(www.)?twitter.com",cls:VCO.Media.Twitter},{type:"googlemaps",name:"Google Map",match_str:"maps.google",cls:VCO.Media.Map},{type:"googleplus",name:"Google+",match_str:"plus.google",cls:VCO.Media.GooglePlus},{type:"flickr",name:"Flickr",match_str:"flickr.com/photos",cls:VCO.Media.Flickr},{type:"instagram",name:"Instagram",match_str:"instagr.am/p/",cls:VCO.Media},{type:"image",name:"Image",match_str:/jpg|jpeg|png|gif/i,cls:VCO.Media.Image},{type:"googledocs",name:"Google Doc",match_str:/\b.(doc|docx|xls|xlsx|ppt|pptx|pdf|pages|ai|psd|tiff|dxf|svg|eps|ps|ttf|xps|zip|tif)\b/,cls:VCO.Media.GoogleDoc},{type:"wikipedia",name:"Wikipedia",match_str:"(www.)?wikipedia.org",cls:VCO.Media.Wikipedia},{type:"iframe",name:"iFrame",match_str:"iframe",cls:VCO.Media.IFrame},{type:"storify",name:"Storify",match_str:"storify",cls:VCO.Media.Storify},{type:"blockquote",name:"Quote",match_str:"blockquote",cls:VCO.Media.Blockquote},{type:"website",name:"Website",match_str:"http://",cls:VCO.Media.Website},{type:"",name:"",match_str:"",cls:VCO.Media}];for(var r=0;rthis._el.content_item.offsetHeight&&(this._el.content_item.style.width="100%")}}},_loadMedia:function(){},_updateMediaDisplay:function(){this._el.content_item.style.maxHeight=this.options.height-this.options.credit_height-this.options.caption_height-16+"px"},show:function(){},hide:function(){},addTo:function(e){e.appendChild(this._el.container);this.onAdd()},removeFrom:function(e){e.removeChild(this._el.container);this.onRemove()},updateDisplay:function(e,t,n){this._updateDisplay(e,t,n)},stopMedia:function(){this._stopMedia()},onLoaded:function(){this._state.loaded=!0;this.fire("loaded",this.data);this.message&&this.message.hide();this.showMeta()},showMeta:function(){if(this.data.credit&&this.data.credit!=""){this._el.credit=VCO.Dom.create("div","vco-credit",this._el.content_container);this._el.credit.innerHTML=this.data.credit;this.options.credit_height=this._el.credit.offsetHeight}if(this.data.caption&&this.data.caption!=""){this._el.caption=VCO.Dom.create("div","vco-caption",this._el.content_container);this._el.caption.innerHTML=this.data.caption;this.options.caption_height=this._el.caption.offsetHeight}},onAdd:function(){this.fire("added",this.data)},onRemove:function(){this.fire("removed",this.data)},_initLayout:function(){this.message=new VCO.Message({},this.options);this.message.addTo(this._el.container);this._el.content_container=VCO.Dom.create("div","vco-media-content-container",this._el.container);if(this.data.link&&this.data.link!=""){this._el.link=VCO.Dom.create("a","vco-media-link",this._el.content_container);this._el.link.href=this.data.link;this.data.link_target&&this.data.link_target!=""?this._el.link.target=this.data.link_target:this._el.link.target="_blank";this._el.content=VCO.Dom.create("div","vco-media-content",this._el.link)}else this._el.content=VCO.Dom.create("div","vco-media-content",this._el.content_container)},_updateDisplay:function(e,t,n){trace("UPDATE MEDIA DISPLAY");e&&(this.options.width=e);t&&(this.options.height=t);this._el.credit&&(this.options.credit_height=this._el.credit.offsetHeight);this._el.caption&&(this.options.caption_height=this._el.caption.offsetHeight);this.updateMediaDisplay()},_stopMedia:function(){}});VCO.Media.Blockquote=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-blockquote",this._el.content);this.media_id=this.data.url;this._el.content_item.innerHTML=this.media_id;this.onLoaded()},_updateMediaDisplay:function(){}});VCO.Media.Flickr=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("img","vco-media-item vco-media-image vco-media-flickr vco-media-shadow",this._el.content);this.media_id=this.data.url.split("photos/")[1].split("/")[1];e="http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key="+this.options.api_key_flickr+"&photo_id="+this.media_id+"&format=json&jsoncallback=?";VCO.getJSON(e,function(e){t.createMedia(e)})},createMedia:function(e){var t=this.sizes(this.options.height),n=e.sizes.size[e.sizes.size.length-2].source;for(var r=0;r":this._el.content_item.innerHTML="";this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"}});VCO.Media.GooglePlus=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-googleplus",this._el.content);this.media_id=this.data.url;e=this.media_id;this._el.content_item.innerHTML="";this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"}});VCO.Media.IFrame=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe",this._el.content);this.media_id=this.data.url;e=this.media_id;this._el.content_item.innerHTML=e;this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"}});VCO.Media.Image=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("img","vco-media-item vco-media-image vco-media-shadow",this._el.content);this +._el.content_item.src=this.data.url;this.onLoaded()}});VCO.Media.SoundCloud=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe vco-media-soundcloud vco-media-shadow",this._el.content);this.media_id=this.data.url;e="http://soundcloud.com/oembed?url="+this.media_id+"&format=js&callback=?";VCO.getJSON(e,function(e){t.createMedia(e)})},createMedia:function(e){this._el.content_item.innerHTML=e.html;this.onLoaded()}});VCO.Media.Storify=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe vco-media-storify",this._el.content);this.media_id=this.data.url;e="";e+="";this._el.content_item.innerHTML=e;this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=this.options.height+"px"}});VCO.Media.Text=VCO.Class.extend({includes:[VCO.Events],_el:{container:{},content_container:{},content:{},headline:{}},data:{uniqueid:"",headline:"Le portrait mystérieux",text:"Lorem ipsum dolor sit amet, consectetuer adipiscing elit."},options:{title:!1},initialize:function(e,t,n){VCO.Util.setData(this,e);VCO.Util.mergeData(this.options,t);this._el.container=VCO.Dom.create("div","vco-text");this._el.container.id=this.data.uniqueid;this._initLayout();n&&n.appendChild(this._el.container)},show:function(){},hide:function(){},addTo:function(e){e.appendChild(this._el.container)},removeFrom:function(e){e.removeChild(this._el.container)},headlineHeight:function(){return this._el.headline.offsetHeight+40},onLoaded:function(){this.fire("loaded",this.data)},onAdd:function(){this.fire("added",this.data)},onRemove:function(){this.fire("removed",this.data)},_initLayout:function(){this._el.content_container=VCO.Dom.create("div","vco-text-content-container",this._el.container);if(this.data.headline!=""){var e="vco-headline";this.options.title&&(e="vco-headline vco-headline-title");this._el.headline=VCO.Dom.create("h2",e,this._el.content_container);this._el.headline.innerHTML=this.data.headline}if(this.data.text!=""){this._el.content=VCO.Dom.create("div","vco-text-content",this._el.content_container);this._el.content.innerHTML=VCO.Util.htmlify(this.data.text)}this.onLoaded()}});VCO.Media.Twitter=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-twitter",this._el.content);this.data.url.match("status/")?this.media_id=this.data.url.split("status/")[1]:url.match("statuses/")?this.media_id=this.data.url.split("statuses/")[1]:this.media_id="";e="http://api.twitter.com/1/statuses/oembed.json?id="+this.media_id+"&omit_script=true&include_entities=true&callback=?";VCO.getJSON(e,function(e){t.createMedia(e)})},createMedia:function(e){var t="",n="",r="",i="",s="",o="";n=e.html.split("

—")[0]+"

";r=e.author_url.split("twitter.com/")[1];i=e.html.split("

—")[1].split('')[0];o=i.split('">')[1].split("")[0];trace("tweet_status_url "+s);trace("tweet_status_date "+o);t+=n;t+="";this._el.content_item.innerHTML=t;this.onLoaded()},_updateMediaDisplay:function(){}});VCO.Media.Vimeo=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe vco-media-vimeo vco-media-shadow",this._el.content);this.media_id=this.data.url.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];e="http://player.vimeo.com/video/"+this.media_id+"?api=1&title=0&byline=0&portrait=0&color=ffffff";this.player=VCO.Dom.create("iframe","",this._el.content_item);this.player.width="100%";this.player.height="100%";this.player.frameBorder="0";this.player.src=e;this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=VCO.Util.ratio.r16_9({w:this._el.content_item.offsetWidth})+"px"},_stopMedia:function(){try{this.player.contentWindow.postMessage(JSON.stringify({method:"pause"}),"http://player.vimeo.com")}catch(e){trace(e)}}});VCO.Media.DailyMotion=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe vco-media-dailymotion",this._el.content);this.data.url.match("video")?this.media_id=this.data.url.split("video/")[1].split(/[?&]/)[0]:this.media_id=this.data.url.split("embed/")[1].split(/[?&]/)[0];e="http://www.dailymotion.com/embed/video/"+this.media_id;this._el.content_item.innerHTML="";this.onLoaded()},_updateMediaDisplay:function(){this._el.content_item.style.height=VCO.Util.ratio.r16_9({w:this._el.content_item.offsetWidth})+"px"}});VCO.Media.Vine=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-iframe vco-media-vine vco-media-shadow",this._el.content);this.media_id=this.data.url.split("vine.co/v/")[1];e="https://vine.co/v/"+this.media_id+"/embed/simple";this._el.content_item.innerHTML="";this.onLoaded()},_updateMediaDisplay:function(){var e=VCO.Util.ratio.square({w:this._el.content_item.offsetWidth,h:this.options.height});this._el.content_item.style.height=e.h+"px"}});VCO.Media.Website=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){},createMedia:function(e){this.onLoaded()}});VCO.Media.Wikipedia=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e,t,n=this;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-wikipedia",this._el.content);this.media_id=this.data.url.split("wiki/")[1].split("#")[0].replace("_"," ");this.media_id=this.media_id.replace(" ","%20");t=this.data.url.split("//")[1].split(".wikipedia")[0];e="http://"+t+".wikipedia.org/w/api.php?action=query&prop=extracts&redirects=&titles="+this.media_id+"&exintro=1&format=json&callback=?";VCO.getJSON(e,function(e){n.createMedia(e)})},createMedia:function(e){var t="";if(e.query){var n,t={entry:{},title:"",text:"",extract:"",paragraphs:1,text_array:[]};t.entry=VCO.Util.getObjectAttributeByIndex(e.query.pages,0);t.extract=t.entry.extract;t.title=t.entry.title;t.extract.match("

")?t.text_array=t.extract.split("

"):t.text_array.push(t.extract);for(var r=0;r"+t.text_array[r+1]);n="

"+t.title+"

";n+=""+VCO.Language.messages.wikipedia+"";n+=t.text;if(!t.extract.match("REDIRECT")){this._el.content_item.innerHTML=n;this.onLoaded()}}},_updateMediaDisplay:function(){}});VCO.Media.YouTube=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){var e=this,t;this.message.updateMessage(VCO.Language.messages.loading+" "+this.options.media_name);this.youtube_loaded=!1;this._el.content_item=VCO.Dom.create("div","vco-media-item vco-media-youtube vco-media-shadow",this._el.content);this._el.content_item.id=VCO.Util.unique_ID(7);t=VCO.Util.getUrlVars(this.data.url);this.media_id={};this.data.url.match("v=")?this.media_id.id=t.v:this.data.url.match("/embed/")?this.media_id.id=this.data.url.split("embed/")[1].split(/[?&]/)[0]:this.data.url.match(/v\/|v=|youtu\.be\//)?this.media_id.id=this.data.url.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0]:trace("YOUTUBE IN URL BUT NOT A VALID VIDEO");this.media_id.start=t.t;this.media_id.hd=t.hd;VCO.Load.js("https://www.youtube.com/player_api",function(){trace("YouTube API Library Loaded");e.createMedia()})},_updateMediaDisplay:function(){this._el.content_item.style.height=VCO.Util.ratio.r16_9({w:this._el.content_item.offsetWidth})+"px"},_stopMedia:function(){if(this.youtube_loaded)try{this.player.pauseVideo()}catch(e){trace(e)}},createMedia:function(){var e=this;if(typeof this.media_id.start!="undefined"){var t=this.media_id.start.toString(),n=0,r=0;if(t.match("m")){n=parseInt(t.split("m")[0],10);r=parseInt(t.split("m")[1].split("s")[0],10);this.media_id.start=n*60+r}else this.media_id.start=0}else this.media_id.start=0;typeof this.media_id.hd!="undefined"?this.media_id.hd=!0:this.media_id.hd=!1;this.createPlayer()},createPlayer:function(){var e=this;trace("createPlayer");clearTimeout(this.timer);typeof YT!="undefined"&&typeof YT.Player!="undefined"?this.player=new YT.Player(this._el.content_item.id,{playerVars:{enablejsapi:1,color:"white",showinfo:0,theme:"light",start:this.media_id.start,rel:0},videoId:this.media_id.id,events:{onReady:function(){e.onPlayerReady();e.onLoaded()},onStateChange:e.onStateChange}}):this.timer=setTimeout(function(){e.createPlayer()},1e3)},onPlayerReady:function(e){trace("onPlayerReady");this.youtube_loaded=!0},onStateChange:function(e){trace("onStateChange")}});VCO.Media.Slider=VCO.Media.extend({includes:[VCO.Events],_loadMedia:function(){this._el.content_item=VCO.Dom.create("img","vco-media-item vco-media-image",this._el.content);this._el.content_item.src=this.data.url;this.onLoaded()}});VCO.Slide=VCO.Class.extend({includes:[VCO.Events,VCO.DomMixins],_el:{},initialize:function(e,t,n){this._el={container:{},content_container:{},content:{}};this._media=null;this._mediaclass={};this._text={};this._state={loaded:!1};this.has={headline:!1,text:!1,media:!1,title:!1,background:{image:!1,color:!1,color_value:!1}};this.has.title=n;this.data={uniqueid:null,background:null,date:null,location:null,text:null,media:null};this.options={duration:1e3,slide_padding_lr:100,ease:VCO.Ease.easeInSpline,width:600,height:600,media_name:""};this.animator={};VCO.Util.mergeData(this.options,t);VCO.Util.mergeData(this.data,e);this._initLayout();this._initEvents()},show:function(){this.animator=VCO.Animate(this._el.slider_container,{left:-(this._el.container.offsetWidth*n)+"px",duration:this.options.duration,easing:this.options.ease,complete:function(){trace("DONE")}})},hide:function(){},addTo:function(e){e.appendChild(this._el.container)},removeFrom:function(e){e.removeChild(this._el.container)},updateDisplay:function(e,t,n){this._updateDisplay(e,t,n)},loadMedia:function(){if(this._media&&!this._state.loaded){this._media.loadMedia();this._state.loaded=!0}},stopMedia:function(){this._media&&this._state.loaded&&this._media.stopMedia()},getBackground:function(){return this.has.background},_initLayout:function(){this._el.container=VCO.Dom.create("div","vco-slide");this._el.container.id=this.data.uniqueid;this._el.content_container=VCO.Dom.create("div","vco-slide-content-container",this._el.container);this._el.content=VCO.Dom.create("div","vco-slide-content",this._el.content_container);if(this.data.background){if(this.data.background.url){this.has.background.image=!0;this._el.container.className+=" vco-full-image-background";this._el.container.style.backgroundImage="url('"+this.data.background.url+"')"}if(this.data.background.color){this.has.background.color=!0;this._el.container.className+=" vco-full-color-background";this.has.background.color_value=this.data.background.color;this._el.container.style.backgroundColor=this.data.background.color}}this.data.media&&this.data.media.url&&this.data.media.url!=""&&(this.has.media=!0);this.data.text&&this.data.text.text&&(this.has.text=!0);this.data.text&&this.data.text.headline&&(this.has.headline=!0);if(this.has.media){this.data.media.mediatype=VCO.MediaType(this.data.media);this.options.media_name=this.data.media.mediatype.name;this._media=new this.data.media.mediatype.cls(this.data.media,this.options)}if(this.has.text||this.has.headline)this._text=new VCO.Media.Text(this.data.text,{title:this.has.title});if(!this.has.text&&!this.has.headline&&this.has.media){this._el.container.className+=" vco-slide-media-only";this._media.addTo(this._el.content)}else if(this.has.headline&&this.has.media&&!this.has.text){this._el.container.className+=" vco-slide-media-only";this._text.addTo(this._el.content);this._media.addTo(this._el.content)}else if(this.has.text&&this.has.media){this._media.addTo(this._el.content);this._text.addTo(this._el.content)}else if(this.has.text){this._el.container.className+=" vco-slide-text-only";this._text.addTo(this._el.content)}this.onLoaded()},_initEvents:function(){},_updateDisplay:function(e,t,n){e?this.options.width=e:this.options.width=this._el.container.offsetWidth;this._el.content.style.paddingLeft=this.options.slide_padding_lr+"px";this._el.content.style.paddingRight=this.options.slide_padding_lr+"px";this._el.content.style.width=this.options.width-this.options.slide_padding_lr*2+"px";t?this.options.height=t:this.options.height=this._el.container.offsetHeight;if(this._media)if(!this.has.text&&this.has.headline){trace("headline height");trace(this._text.headlineHeight());trace(this.options.height);trace(this.options.height-this._text.headlineHeight());this._media.updateDisplay(this.options.width,this.options.height-this._text.headlineHeight())}else this._media.updateDisplay(this.options.width,this.options.height)}});VCO.SlideNav=VCO.Class.extend({includes:[VCO.Events,VCO.DomMixins],_el:{},initialize:function(e,t,n){this._el={container:{},content_container:{},icon:{},title:{},description:{}};this.mediatype={};this.data={title:"Navigation",description:"Description"};this.options={direction:"previous"};this.animator=null;VCO.Util.mergeData(this.options,t);VCO.Util.mergeData(this.data,e);this._el.container=VCO.Dom.create("div","vco-slidenav-"+this.options.direction);this._initLayout();this._initEvents();n&&n.appendChild(this._el.container)},update:function(e){this._update(e)},setColor:function(e){e?this._el.content_container.className="vco-slidenav-content-container vco-slidenav-inverted":this._el.content_container.className="vco-slidenav-content-container"},_onMouseClick:function(){this.fire("clicked",this.options)},_update:function(e){this.data=VCO.Util.mergeData(this.data,e);this.data.title!=""&&(this._el.title.innerHTML=this.data.title);this.data.date!=""&&(this._el.description.innerHTML=this.data.description)},_initLayout:function(){this._el.content_container=VCO.Dom.create("div","vco-slidenav-content-container",this._el.container);this._el.icon=VCO.Dom.create("div","vco-slidenav-icon",this._el.content_container);this._el.title=VCO.Dom.create("div","vco-slidenav-title",this._el.content_container);this._el.description=VCO.Dom.create("div","vco-slidenav-description",this._el.content_container);this._el.icon.innerHTML=" ";this._update()},_initEvents:function(){VCO.DomEvent.addListener(this._el.container,"click",this._onMouseClick,this)}});VCO.StorySlider=VCO.Class.extend({includes:VCO.Events,initialize:function(e,t,n,r){this._el={container:{},slider_container_mask:{},slider_container:{},slider_item_container:{}};this._nav={};this._nav.previous={};this._nav.next={};this._slides=[];this.current_slide=0;this.data={uniqueid:"",slides:[{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"Slideshow Example",text:"Example slideshow slide "},media:[{uniqueid:"",text:{headline:"Slideshow Example",text:""},media:{url:"http://2.bp.blogspot.com/-dxJbW0CG8Zs/TmkoMA5-cPI/AAAAAAAAAqw/fQpsz9GpFdo/s1600/voyage-dans-la-lune-1902-02-g.jpg",credit:"",caption:"",link:null,link_target:null}},{uniqueid:"",text:{headline:"Slideshow Example",text:""},media:{url:"http://2.bp.blogspot.com/-dxJbW0CG8Zs/TmkoMA5-cPI/AAAAAAAAAqw/fQpsz9GpFdo/s1600/voyage-dans-la-lune-1902-02-g.jpg",credit:"",caption:"",link:null,link_target:null}},{uniqueid:"",text:{headline:"Slideshow Example",text:""},media:{url:"http://2.bp.blogspot.com/-dxJbW0CG8Zs/TmkoMA5-cPI/AAAAAAAAAqw/fQpsz9GpFdo/s1600/voyage-dans-la-lune-1902-02-g.jpg",credit:"",caption:"",link:null,link_target:null}},{uniqueid:"",text:{headline:"Slideshow Example",text:""},media:{url:"http://2.bp.blogspot.com/-dxJbW0CG8Zs/TmkoMA5-cPI/AAAAAAAAAqw/fQpsz9GpFdo/s1600/voyage-dans-la-lune-1902-02-g.jpg",credit:"",caption:"",link:null,link_target:null}}]},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"YouTube",text:"Just add a link to the video in the media field."},media:{url:"http://www.youtube.com/watch?v=lIvftGgps24",credit:"",caption:"",link:null,link_target:null}},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"Wikipedia",text:"Just add a link to the video in the media field."},media:{url:"http://en.wikipedia.org/wiki/Mark_Twain",credit:"",caption:"",link:null,link_target:null}},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"Storify",text:"Just add a link to the video in the media field."},media:{url:"https://storify.com/kqednews/art-at-burning-man-2013",credit:"",caption:"",link:null,link_target:null}},{uniqueid:"",background:{url:"https://secure-b.vimeocdn.com/ts/225/276/225276903_960.jpg",color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"Vimeo",text:"Just add a link to the video in the media field."},media:{url:"https://vimeo.com/33211636",credit:"",caption:"",link:null,link_target:null}},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"iFrame",text:""},media:{url:"",credit:"",caption:"w3schools",link:null,link_target:null}},{uniqueid:"",background:{url:null,color:"#cdbfe3",opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"Flickr",text:""},media:{url:"http://www.flickr.com/photos/neera/6147067542/",credit:"Nosy Iranja",caption:"",link:"http://www.flickr.com/photos/neera/6147067542/",link_target:"_self"}},{uniqueid:"",background:{url:null,color:"#8b4513",opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"Flickr",text:""},media:{url:"https://twitter.com/ThisAmerLife/status/374975945825722368"}},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:null,media:{url:"http://www.flickr.com/photos/neera/6147067542/",credit:"Nosy Iranja",caption:""}},{uniqueid:"",background:{url:"http://2.bp.blogspot.com/-dxJbW0CG8Zs/TmkoMA5-cPI/AAAAAAAAAqw/fQpsz9GpFdo/s1600/voyage-dans-la-lune-1902-02-g.jpg",color:"#cdbfe3",opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:{headline:"La Lune",text:""},media:{url:"https://soundcloud.com/beastieboys/make-some-noise",credit:null,caption:null}},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:null,media:{url:"https://soundcloud.com/beastieboys/make-some-noise",credit:null,caption:null}},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:null,media:{url:"https://vine.co/v/bjHh0zHdgZT",credit:null,caption:null}},{uniqueid:"",background:{url:null,color:null,opacity:50},date:null,location:{lat:-9.143962,lon:38.731094,zoom:13,icon:"http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-pushpin.png"},text:null,media:{url:"http://www.flickr.com/photos/neera/6147067542/",credit:"Nosy Iranja",caption:""}}]};this.options={id:"",width:600,height:600,slide_padding_lr:100,start_at_slide:1,duration:1e3,ease:VCO.Ease.easeInOutQuint,dragging:!0,trackResize:!0};if(typeof e=="object"){this._el.container=e;this.options.id=VCO.Util.unique_ID(6,"vco")}else{this.options.id=e;this._el.container=VCO.Dom.get(e)}this._el.container.id||(this._el.container.id=this.options.id);this.animator=null;VCO.Util.mergeData(this.options,n);VCO.Util.mergeData(this.data,t);r&&this.init()},init:function(){this._initLayout();this._initEvents();this._initData();this._updateDisplay();this.goTo(this.options.start_at_slide);this._onLoaded()},updateDisplay:function(e,t){this._updateDisplay(e,t)},createSlide:function(e){this._createSlide(e)},createSlides:function(e){this._createSlides(e)},_createSlides:function(e){for(var t=0;t=0){this.current_slide=e;this.animator&&this.animator.stop();if(t){this._el.slider_container.style.left=-(this.options.width*e)+"px";this._onSlideChange(n)}else this.animator=VCO.Animate(this._el.slider_container,{left:-(this.options.width*e)+"px",duration:this.options.duration,easing:this.options.ease,complete:this._onSlideChange(n)});var i=this._slides[this.current_slide].getBackground();this.fire("colorchange",i);if(i.color||i.image){this._nav.next.setColor(!0);this._nav.previous.setColor(!0)}else{this._nav.next.setColor(!1);this._nav.previous.setColor(!1)}if(this._slides[this.current_slide+1]){this._nav.next.show();this._nav.next.update(this.getNavInfo(this._slides[this.current_slide+1]))}else this._nav.next.hide();if(this._slides[this.current_slide-1]){this._nav.previous.show();this._nav.previous.update(this.getNavInfo(this._slides[this.current_slide-1]))}else this._nav.previous.hide();this.preloadSlides()}},preloadSlides:function(){this._slides[this.current_slide].loadMedia();this._slides[this.current_slide+1]&&this._slides[this.current_slide+1].loadMedia();this._slides[this.current_slide+2]&&this._slides[this.current_slide+2].loadMedia();this._slides[this.current_slide-1]&&this._slides[this.current_slide-1].loadMedia();this._slides[this.current_slide-2]&&this._slides[this.current_slide-2].loadMedia()},getNavInfo:function(e){var t={title:"",description:""};e.data.text&&e.data.text.headline&&(t.title=e.data.text.headline);return t},next:function(){this.goTo(this.current_slide+1)},previous:function(){this.goTo(this.current_slide-1)},_updateDisplay:function(e,t,n){var r;e?this.options.width=e:this.options.width=this._el.container.offsetWidth;t?this.options.height=t:this.options.height=this._el.container.offsetHeight;r=this.options.height/2;this._nav.next.setPosition({top:r});this._nav.previous.setPosition({top:r});for(var i=0;i2?Array.prototype.slice.call(arguments,2):null;return function(){return e.apply(t,n||arguments)}},stamp:function(){var e=0,t="_leaflet_id";return function(n){n[t]=n[t]||++e;return n[t]}}(),invokeEach:function(e,t,n){var r,i;if(typeof e=="object"){i=Array.prototype.slice.call(arguments,3);for(r in e)t.apply(n,[r,e[r]].concat(i));return!0}return!1},limitExecByInterval:function(e,t,n){var r,i;return function s(){var o=arguments;if(r){i=!0;return}r=!0;setTimeout(function(){r=!1;if(i){s.apply(n,o);i=!1}},t);e.apply(n,o)}},falseFn:function(){return!1},formatNum:function(e,t){var n=Math.pow(10,t||5);return Math.round(e*n)/n},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},splitWords:function(e){return i.Util.trim(e).split(/\s+/)},setOptions:function(e,t){e.options=i.extend({},e.options,t);return e.options},getParamString:function(e,t,n){var r=[];for(var i in e)r.push(encodeURIComponent(n?i.toUpperCase():i)+"="+encodeURIComponent(e[i]));return(!t||t.indexOf("?")===-1?"?":"&")+r.join("&")},template:function(e,t){return e.replace(/\{ *([\w_]+) *\}/g,function(e,r){var i=t[r];if(i===n)throw new Error("No value provided for variable "+e);typeof i=="function"&&(i=i(t));return i})},isArray:function(e){return Object.prototype.toString.call(e)==="[object Array]"},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="};(function(){function t(t){var n,r,i=["webkit","moz","o","ms"];for(n=0;n0||e+"_idx"in t&&t[e+"_idx_len"]>0)},removeEventListener:function(e,t,n){if(!this[s])return this;if(!e)return this.clearAllEventListeners();if(i.Util.invokeEach(e,this.removeEventListener,this,t,n))return this;var r=this[s],o=n&&i.stamp(n),u,a,f,l,c,h,p,d,v;e=i.Util.splitWords(e);for(u=0,a=e.length;u=0;c--)if(l[c].action===t&&(!n||l[c].context===n)){v=l.splice(c,1);v[0].action=i.Util.falseFn}if(n&&d&&l.length===0){delete d[o];r[p]--}}}}return this},clearAllEventListeners:function(){delete this[s];return this},fireEvent:function(e,t){if(!this.hasEventListeners(e))return this;var n=i.Util.extend({},t,{type:e,target:this}),r=this[s],o,u,a,f,l;if(r[e]){o=r[e].slice();for(u=0,a=o.length;u1||"matchMedia"in e&&e.matchMedia("(min-resolution:144dpi)")&&e.matchMedia("(min-resolution:144dpi)").matches,g=t.documentElement,y=r&&"transition"in g.style,b="WebKitCSSMatrix"in e&&"m11"in new e.WebKitCSSMatrix,w="MozPerspective"in g.style,E="OTransition"in g.style,S=!e.L_DISABLE_3D&&(y||b||w||E)&&!c,x=!e.L_NO_TOUCH&&!c&&function(){var e="ontouchstart";if(v||e in g)return!0;var n=t.createElement("div"),r=!1;if(!n.setAttribute)return!1;n.setAttribute(e,"return;");typeof n[e]=="function"&&(r=!0);n.removeAttribute(e);n=null;return r}();i.Browser={ie:r,ie6:s,ie7:o,ielt9:u,webkit:f,android:h,android23:p,chrome:l,ie3d:y,webkit3d:b,gecko3d:w,opera3d:E,any3d:S,mobile:d,mobileWebkit:d&&f,mobileWebkit3d:d&&b,mobileOpera:d&&e.opera,touch:x,msTouch:v,retina:m}})();i.Point=function(e,t,n){this.x=n?Math.round(e):e;this.y=n?Math.round(t):t};i.Point.prototype={clone:function(){return new i.Point(this.x,this.y)},add:function(e){return this.clone()._add(i.point(e))},_add:function(e){this.x+=e.x;this.y+=e.y;return this},subtract:function(e){return this.clone()._subtract(i.point(e))},_subtract:function(e){this.x-=e.x;this.y-=e.y;return this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){this.x/=e;this.y/=e;return this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){this.x*=e;this.y*=e;return this},round:function(){return this.clone()._round()},_round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},floor:function(){return this.clone()._floor()},_floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},distanceTo:function(e){e=i.point(e);var t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){e=i.point(e);return e.x===this.x&&e.y===this.y},contains:function(e){e=i.point(e);return Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+i.Util.formatNum(this.x)+", "+i.Util.formatNum(this.y)+")"}};i.point=function(e,t,r){return e instanceof i.Point?e:i.Util.isArray(e)?new i.Point(e[0],e[1]):e===n||e===null?e:new i.Point(e,t,r)};i.Bounds=function(e,t){if(!e)return;var n=t?[e,t]:e;for(var r=0,i=n.length;r=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=i.bounds(e);var t=this.min,n=this.max,r=e.min,s=e.max,o=s.x>=t.x&&r.x<=n.x,u=s.y>=t.y&&r.y<=n.y;return o&&u},isValid:function(){return!!this.min&&!!this.max}};i.bounds=function(e,t){return!e||e instanceof i.Bounds?e:new i.Bounds(e,t)};i.Transformation=function(e,t,n,r){this._a=e;this._b=t;this._c=n;this._d=r};i.Transformation.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){t=t||1;e.x=t*(this._a*e.x+this._b);e.y=t*(this._c*e.y+this._d);return e},untransform:function(e,t){t=t||1;return new i.Point((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}};i.DomUtil={get:function(e){return typeof e=="string"?t.getElementById(e):e},getStyle:function(e,n){var r=e.style[n];!r&&e.currentStyle&&(r=e.currentStyle[n]);if((!r||r==="auto")&&t.defaultView){var i=t.defaultView.getComputedStyle(e,null);r=i?i[n]:null}return r==="auto"?null:r},getViewportOffset:function(e){var n=0,r=0,s=e,o=t.body,u=t.documentElement,a,f=i.Browser.ie7;do{n+=s.offsetTop||0;r+=s.offsetLeft||0;n+=parseInt(i.DomUtil.getStyle(s,"borderTopWidth"),10)||0;r+=parseInt(i.DomUtil.getStyle(s,"borderLeftWidth"),10)||0;a=i.DomUtil.getStyle(s,"position");if(s.offsetParent===o&&a==="absolute")break;if(a==="fixed"){n+=o.scrollTop||u.scrollTop||0;r+=o.scrollLeft||u.scrollLeft||0;break}if(a==="relative"&&!s.offsetLeft){var l=i.DomUtil.getStyle(s,"width"),c=i.DomUtil.getStyle(s,"max-width"),h=s.getBoundingClientRect();if(l!=="none"||c!=="none")r+=h.left+s.clientLeft;n+=h.top+(o.scrollTop||u.scrollTop||0);break}s=s.offsetParent}while(s);s=e;do{if(s===o)break;n-=s.scrollTop||0;r-=s.scrollLeft||0;if(!i.DomUtil.documentIsLtr()&&(i.Browser.webkit||f)){r+=s.scrollWidth-s.clientWidth;f&&i.DomUtil.getStyle(s,"overflow-y")!=="hidden"&&i.DomUtil.getStyle(s,"overflow")!=="hidden"&&(r+=17)}s=s.parentNode}while(s);return new i.Point(r,n)},documentIsLtr:function(){if(!i.DomUtil._docIsLtrCached){i.DomUtil._docIsLtrCached=!0;i.DomUtil._docIsLtr=i.DomUtil.getStyle(t.body,"direction")==="ltr"}return i.DomUtil._docIsLtr},create:function(e,n,r){var i=t.createElement(e);i.className=n;r&&r.appendChild(i);return i},hasClass:function(e,t){return e.className.length>0&&(new RegExp("(^|\\s)"+t+"(\\s|$)")).test(e.className)},addClass:function(e,t){i.DomUtil.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},removeClass:function(e,t){e.className=i.Util.trim((" "+e.className+" ").replace(" "+t+" "," "))},setOpacity:function(e,t){if("opacity"in e.style)e.style.opacity=t;else if("filter"in e.style){var n=!1,r="DXImageTransform.Microsoft.Alpha";try{n=e.filters.item(r)}catch(i){if(t===1)return}t=Math.round(t*100);if(n){n.Enabled=t!==100;n.Opacity=t}else e.style.filter+=" progid:"+r+"(opacity="+t+")"}},testProp:function(e){var n=t.documentElement.style;for(var r=0;r=t.lat&&s.lat<=n.lat&&r.lng>=t.lng&&s.lng<=n.lng},intersects:function(e){e=i.latLngBounds(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),s=e.getNorthEast(),o=s.lat>=t.lat&&r.lat<=n.lat,u=s.lng>=t.lng&&r.lng<=n.lng;return o&&u},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(e){if(!e)return!1;e=i.latLngBounds(e);return this._southWest.equals(e.getSouthWest())&&this._northEast.equals(e.getNorthEast())},isValid:function(){return!!this._southWest&&!!this._northEast}};i.latLngBounds=function(e,t){return!e||e instanceof i.LatLngBounds?e:new i.LatLngBounds(e,t)};i.Projection={};i.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(e){var t=i.LatLng.DEG_TO_RAD,n=this.MAX_LATITUDE,r=Math.max(Math.min(n,e.lat),-n),s=e.lng*t,o=r*t;o=Math.log(Math.tan(Math.PI/4+o/2));return new i.Point(s,o)},unproject:function(e){var t=i.LatLng.RAD_TO_DEG,n=e.x*t,r=(2*Math.atan(Math.exp(e.y))-Math.PI/2)*t;return new i.LatLng(r,n)}};i.Projection.LonLat={project:function(e){return new i.Point(e.lng,e.lat)},unproject:function(e){return new i.LatLng(e.y,e.x)}};i.CRS={latLngToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return this.transformation._transform(n,r)},pointToLatLng:function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},scale:function(e){return 256*Math.pow(2,e)}};i.CRS.Simple=i.extend({},i.CRS,{projection:i.Projection.LonLat,transformation:new i.Transformation(1,0,-1,0),scale:function(e){return Math.pow(2,e)}});i.CRS.EPSG3857=i.extend({},i.CRS,{code:"EPSG:3857",projection:i.Projection.SphericalMercator,transformation:new i.Transformation(.5/Math.PI,.5,-0.5/Math.PI,.5),project:function(e){var t=this.projection.project(e),n=6378137;return t.multiplyBy(n)}});i.CRS.EPSG900913=i.extend({},i.CRS.EPSG3857,{code:"EPSG:900913"});i.CRS.EPSG4326=i.extend({},i.CRS,{code:"EPSG:4326",projection:i.Projection.LonLat,transformation:new i.Transformation(1/360,.5,-1/360,.5)});i.Map=i.Class.extend({includes:i.Mixin.Events,options:{crs:i.CRS.EPSG3857,fadeAnimation:i.DomUtil.TRANSITION&&!i.Browser.android23,trackResize:!0,markerZoomAnimation:i.DomUtil.TRANSITION&&i.Browser.any3d},initialize:function(e,t){t=i.setOptions(this,t);this._initContainer(e);this._initLayout();this._initEvents();t.maxBounds&&this.setMaxBounds(t.maxBounds);t.center&&t.zoom!==n&&this.setView(i.latLng(t.center),t.zoom,{reset:!0});this._handlers=[];this._layers={};this._zoomBoundLayers={};this._tileLayersNum=0;this.callInitHooks();this._addLayers(t.layers)},setView:function(e,t){this._resetView(i.latLng(e),this._limitZoom(t));return this},setZoom:function(e,t){return this.setView(this.getCenter(),e,{zoom:t})},zoomIn:function(e,t){return this.setZoom(this._zoom+(e||1),t)},zoomOut:function(e,t){return this.setZoom(this._zoom-(e||1),t)},setZoomAround:function(e,t,n){var r=this.getZoomScale(t),s=this.getSize().divideBy(2),o=e instanceof i.Point?e:this.latLngToContainerPoint(e),u=o.subtract(s).multiplyBy(1-1/r),a=this.containerPointToLatLng(s.add(u));return this.setView(a,t,{zoom:n})},fitBounds:function(e,t){t=t||{};e=e.getBounds?e.getBounds():i.latLngBounds(e);var n=i.point(t.paddingTopLeft||t.padding||[0,0]),r=i.point(t.paddingBottomRight||t.padding||[0,0]),s=this.getBoundsZoom(e,!1,n.add(r)),o=r.subtract(n).divideBy(2),u=this.project(e.getSouthWest(),s),a=this.project(e.getNorthEast(),s),f=this.unproject(u.add(a).divideBy(2).add(o),s);return this.setView(f,s,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e){this.fire("movestart");this._rawPanBy(i.point(e));this.fire("move");return this.fire("moveend")},setMaxBounds:function(e,t){e=i.latLngBounds(e);this.options.maxBounds=e;if(!e){this._boundsMinZoom=null;this.off("moveend",this._panInsideMaxBounds,this);return this}var n=this.getBoundsZoom(e,!0);this._boundsMinZoom=n;this._loaded&&(this._zoomo.x&&(u=Math.floor(o.x-r.x));n.y>s.y&&(a=Math.floor(s.y-n.y));n.xc&&--h>0){d=u*Math.sin(f);p=Math.PI/2-2*Math.atan(a*Math.pow((1-d)/(1+d),.5*u))-f;f+=p}return new i.LatLng(f*t,s)}};i.CRS.EPSG3395=i.extend({},i.CRS,{code:"EPSG:3395",projection:i.Projection.Mercator,transformation:function(){var e=i.Projection.Mercator,t=e.R_MAJOR,n=e.R_MINOR;return new i.Transformation(.5/(Math.PI*t),.5,-0.5/(Math.PI*n),.5)}()});i.TileLayer=i.Class.extend({includes:i.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:i.Browser.mobile,updateWhenIdle:i.Browser.mobile},initialize:function(e,t){t=i.setOptions(this,t);if(t.detectRetina&&i.Browser.retina&&t.maxZoom>0){t.tileSize=Math.floor(t.tileSize/2);t.zoomOffset++;t.minZoom>0&&t.minZoom--;this.options.maxZoom--}t.bounds&&(t.bounds=i.latLngBounds(t.bounds));this._url=e;var n=this.options.subdomains;typeof n=="string"&&(this.options.subdomains=n.split(""))},onAdd:function(e){this._map=e;this._animated=e._zoomAnimated;this._initContainer();this._createTileProto();e.on({viewreset:this._reset,moveend:this._update},this);this._animated&&e.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this);if(!this.options.updateWhenIdle){this._limitedUpdate=i.Util.limitExecByInterval(this._update,150,this);e.on("move",this._limitedUpdate,this)}this._reset();this._update()},addTo:function(e){e.addLayer(this);return this},onRemove:function(e){this._container.parentNode.removeChild(this._container);e.off({viewreset:this._reset,moveend:this._update},this);this._animated&&e.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this);this.options.updateWhenIdle||e.off("move",this._limitedUpdate,this);this._container=null;this._map=null},bringToFront:function(){var e=this._map._panes.tilePane;if(this._container){e.appendChild(this._container);this._setAutoZIndex(e,Math.max)}return this},bringToBack:function(){var e=this._map._panes.tilePane;if(this._container){e.insertBefore(this._container,e.firstChild);this._setAutoZIndex(e,Math.min)}return this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(e){this.options.opacity=e;this._map&&this._updateOpacity();return this},setZIndex:function(e){this.options.zIndex=e;this._updateZIndex();return this},setUrl:function(e,t){this._url=e;t||this.redraw();return this},redraw:function(){if(this._map){this._reset({hard:!0});this._update()}return this},_updateZIndex:function(){this._container&&this.options.zIndex!==n&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e,t){var n=e.children,r=-t(Infinity,-Infinity),i,s,o;for(s=0,o=n.length;sthis.options.maxZoom||t=n)||e.y<0||e.y>=n)return!1}if(t.bounds){var r=t.tileSize,i=e.multiplyBy(r),s=i.add([r,r]),o=this._map.unproject(i),u=this._map.unproject(s);if(!t.continuousWorld&&!t.noWrap){o=o.wrap();u=u.wrap()}if(!t.bounds.intersects([o,u]))return!1}return!0},_removeOtherTiles:function(e){var t,n,r,i;for(i in this._tiles){t=i.split(":");n=parseInt(t[0],10);r=parseInt(t[1],10);(ne.max.x||re.max.y)&&this._removeTile(i)}},_removeTile:function(e){var t=this._tiles[e];this.fire("tileunload",{tile:t,url:t.src});if(this.options.reuseTiles){i.DomUtil.removeClass(t,"leaflet-tile-loaded");this._unusedTiles.push(t)}else t.parentNode===this._tileContainer&&this._tileContainer.removeChild(t);if(!i.Browser.android){t.onload=null;t.src=i.Util.emptyImageUrl}delete this._tiles[e]},_addTile:function(e,t){var n=this._getTilePos(e),r=this._getTile();i.DomUtil.setPosition(r,n,i.Browser.chrome||i.Browser.android23);this._tiles[e.x+":"+e.y]=r;this._loadTile(r,e);r.parentNode!==this._tileContainer&&t.appendChild(r)},_getZoomForUrl:function(){var e=this.options,t=this._map.getZoom();e.zoomReverse&&(t=e.maxZoom-t);return t+e.zoomOffset},_getTilePos:function(e){var t=this._map.getPixelOrigin(),n=this.options.tileSize;return e.multiplyBy(n).subtract(t)},getTileUrl:function(e){return i.Util.template(this._url,i.extend({s:this._getSubdomain(e),z:e.z,x:e.x,y:e.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(e){var t=this._getWrapTileNum();!this.options.continuousWorld&&!this.options.noWrap&&(e.x=(e.x%t+t)%t);this.options.tms&&(e.y=t-e.y-1);e.z=this._getZoomForUrl()},_getSubdomain:function(e){if(!this.options.subdomains||this.options.subdomains.length==0)return"";var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_createTileProto:function(){var e=this._tileImg=i.DomUtil.create("img","leaflet-tile");e.style.width=e.style.height=this.options.tileSize+"px";e.galleryimg="no"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var e=this._unusedTiles.pop();this._resetTile(e);return e}return this._createTile()},_resetTile:function(){},_createTile:function(){var e=this._tileImg.cloneNode(!1);e.onselectstart=e.onmousemove=i.Util.falseFn;i.Browser.ielt9&&this.options.opacity!==n&&i.DomUtil.setOpacity(e,this.options.opacity);return e},_loadTile:function(e,t){e._layer=this;e.onload=this._tileOnLoad;e.onerror=this._tileOnError;this._adjustTilePoint(t);e.src=this.getTileUrl(t)},_tileLoaded:function(){this._tilesToLoad--;if(!this._tilesToLoad){this.fire("load");if(this._animated){clearTimeout(this._clearBgBufferTimer);this._clearBgBufferTimer=setTimeout(i.bind(this._clearBgBuffer,this),500)}}},_tileOnLoad:function(){var e=this._layer +;if(this.src!==i.Util.emptyImageUrl){i.DomUtil.addClass(this,"leaflet-tile-loaded");e.fire("tileload",{tile:this,url:this.src})}e._tileLoaded()},_tileOnError:function(){var e=this._layer;e.fire("tileerror",{tile:this,url:this.src});var t=e.options.errorTileUrl;t&&(this.src=t);e._tileLoaded()}});i.tileLayer=function(e,t){return new i.TileLayer(e,t)};i.TileLayer.WMS=i.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(e,t){this._url=e;var n=i.extend({},this.defaultWmsParams),r=t.tileSize||this.options.tileSize;t.detectRetina&&i.Browser.retina?n.width=n.height=r*2:n.width=n.height=r;for(var s in t)!this.options.hasOwnProperty(s)&&s!=="crs"&&(n[s]=t[s]);this.wmsParams=n;i.setOptions(this,t)},onAdd:function(e){this._crs=this.options.crs||e.options.crs;var t=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code;i.TileLayer.prototype.onAdd.call(this,e)},getTileUrl:function(e,t){var n=this._map,r=this.options.tileSize,s=e.multiplyBy(r),o=s.add([r,r]),u=this._crs.project(n.unproject(s,t)),a=this._crs.project(n.unproject(o,t)),f=[u.x,a.y,a.x,u.y].join(","),l=i.Util.template(this._url,{s:this._getSubdomain(e)});return l+i.Util.getParamString(this.wmsParams,l,!0)+"&BBOX="+f},setParams:function(e,t){i.extend(this.wmsParams,e);t||this.redraw();return this}});i.tileLayer.wms=function(e,t){return new i.TileLayer.WMS(e,t)};i.TileLayer.Canvas=i.TileLayer.extend({options:{async:!1},initialize:function(e){i.setOptions(this,e)},redraw:function(){if(this._map){this._reset({hard:!0});this._update()}for(var e in this._tiles)this._redrawTile(this._tiles[e]);return this},_redrawTile:function(e){this.drawTile(e,e._tilePoint,this._map._zoom)},_createTileProto:function(){var e=this._canvasProto=i.DomUtil.create("canvas","leaflet-tile");e.width=e.height=this.options.tileSize},_createTile:function(){var e=this._canvasProto.cloneNode(!1);e.onselectstart=e.onmousemove=i.Util.falseFn;return e},_loadTile:function(e,t){e._layer=this;e._tilePoint=t;this._redrawTile(e);this.options.async||this.tileDrawn(e)},drawTile:function(){},tileDrawn:function(e){this._tileOnLoad.call(e)}});i.tileLayer.canvas=function(e){return new i.TileLayer.Canvas(e)};i.ImageOverlay=i.Class.extend({includes:i.Mixin.Events,options:{opacity:1},initialize:function(e,t,n){this._url=e;this._bounds=i.latLngBounds(t);i.setOptions(this,n)},onAdd:function(e){this._map=e;this._image||this._initImage();e._panes.overlayPane.appendChild(this._image);e.on("viewreset",this._reset,this);e.options.zoomAnimation&&i.Browser.any3d&&e.on("zoomanim",this._animateZoom,this);this._reset()},onRemove:function(e){e.getPanes().overlayPane.removeChild(this._image);e.off("viewreset",this._reset,this);e.options.zoomAnimation&&e.off("zoomanim",this._animateZoom,this)},addTo:function(e){e.addLayer(this);return this},setOpacity:function(e){this.options.opacity=e;this._updateOpacity();return this},bringToFront:function(){this._image&&this._map._panes.overlayPane.appendChild(this._image);return this},bringToBack:function(){var e=this._map._panes.overlayPane;this._image&&e.insertBefore(this._image,e.firstChild);return this},_initImage:function(){this._image=i.DomUtil.create("img","leaflet-image-layer");this._map.options.zoomAnimation&&i.Browser.any3d?i.DomUtil.addClass(this._image,"leaflet-zoom-animated"):i.DomUtil.addClass(this._image,"leaflet-zoom-hide");this._updateOpacity();i.extend(this._image,{galleryimg:"no",onselectstart:i.Util.falseFn,onmousemove:i.Util.falseFn,onload:i.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(e){var t=this._map,n=this._image,r=t.getZoomScale(e.zoom),s=this._bounds.getNorthWest(),o=this._bounds.getSouthEast(),u=t._latLngToNewLayerPoint(s,e.zoom,e.center),a=t._latLngToNewLayerPoint(o,e.zoom,e.center)._subtract(u),f=u._add(a._multiplyBy(.5*(1-1/r)));n.style[i.DomUtil.TRANSFORM]=i.DomUtil.getTranslateString(f)+" scale("+r+") "},_reset:function(){var e=this._image,t=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),n=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(t);i.DomUtil.setPosition(e,t);e.style.width=n.x+"px";e.style.height=n.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){i.DomUtil.setOpacity(this._image,this.options.opacity)}});i.imageOverlay=function(e,t,n){return new i.ImageOverlay(e,t,n)};i.Icon=i.Class.extend({options:{className:""},initialize:function(e){i.setOptions(this,e)},createIcon:function(e){return this._createIcon("icon",e)},createShadow:function(e){return this._createIcon("shadow",e)},_createIcon:function(e,t){var n=this._getIconUrl(e);if(!n){if(e==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var r;!t||t.tagName!=="IMG"?r=this._createImg(n):r=this._createImg(n,t);this._setIconStyles(r,e);return r},_setIconStyles:function(e,t){var n=this.options,r=i.point(n[t+"Size"]),s;t==="shadow"?s=i.point(n.shadowAnchor||n.iconAnchor):s=i.point(n.iconAnchor);!s&&r&&(s=r.divideBy(2,!0));e.className="leaflet-marker-"+t+" "+n.className;if(s){e.style.marginLeft=-s.x+"px";e.style.marginTop=-s.y+"px"}if(r){e.style.width=r.x+"px";e.style.height=r.y+"px"}},_createImg:function(e,n){if(!i.Browser.ie6){n||(n=t.createElement("img"));n.src=e}else{n||(n=t.createElement("div"));n.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+e+'")'}return n},_getIconUrl:function(e){return i.Browser.retina&&this.options[e+"RetinaUrl"]?this.options[e+"RetinaUrl"]:this.options[e+"Url"]}});i.icon=function(e){return new i.Icon(e)};i.Icon.Default=i.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(e){var t=e+"Url";if(this.options[t])return this.options[t];i.Browser.retina&&e==="icon"&&(e+="-2x");var n=i.Icon.Default.imagePath;if(!n)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return n+"/marker-"+e+".png"}});i.Icon.Default.imagePath=function(){var e=t.getElementsByTagName("script"),n=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/,r,i,s,o,u;for(r=0,i=e.length;rs){t.height=s+"px";i.DomUtil.addClass(e,o)}else i.DomUtil.removeClass(e,o);this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(!this._map)return;var e=this._map.latLngToLayerPoint(this._latlng),t=this._animated,n=i.point(this.options.offset);t&&i.DomUtil.setPosition(this._container,e);this._containerBottom=-n.y-(t?0:e.y);this._containerLeft=-Math.round(this._containerWidth/2)+n.x+(t?0:e.x);this._container.style.bottom=this._containerBottom+"px";this._container.style.left=this._containerLeft+"px"},_zoomAnimation:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);i.DomUtil.setPosition(this._container,t)},_adjustPan:function(){if(!this.options.autoPan)return;var e=this._map,t=this._container.offsetHeight,n=this._containerWidth,r=new i.Point(this._containerLeft,-t-this._containerBottom);this._animated&&r._add(i.DomUtil.getPosition(this._container));var s=e.layerPointToContainerPoint(r),o=i.point(this.options.autoPanPadding),u=e.getSize(),a=0,f=0;s.x+n>u.x&&(a=s.x+n-u.x+o.x);s.x-a<0&&(a=s.x-o.x);s.y+t>u.y&&(f=s.y+t-u.y+o.y);s.y-f<0&&(f=s.y-o.y);(a||f)&&e.fire("autopanstart").panBy([a,f])},_onCloseButtonClick:function(e){this._close();i.DomEvent.stop(e)}});i.popup=function(e,t){return new i.Popup(e,t)};i.Map.include({openPopup:function(e,t,n){this.closePopup();if(!(e instanceof i.Popup)){var r=e;e=(new i.Popup(n)).setLatLng(t).setContent(r)}e._isOpen=!0;this._popup=e;return this.addLayer(e)},closePopup:function(e){if(!e||e===this._popup){e=this._popup;this._popup=null}if(e){this.removeLayer(e);e._isOpen=!1}return this}});i.Marker.include({openPopup:function(){if(this._popup&&this._map&&!this._map.hasLayer(this._popup)){this._popup.setLatLng(this._latlng);this._map.openPopup(this._popup)}return this},closePopup:function(){this._popup&&this._popup._close();return this},togglePopup:function(){this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup());return this},bindPopup:function(e,t){var n=i.point(this.options.icon.options.popupAnchor||[0,0]);n=n.add(i.Popup.prototype.options.offset);t&&t.offset&&(n=n.add(t.offset));t=i.extend({offset:n},t);this._popup||this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this);if(e instanceof i.Popup){i.setOptions(e,t);this._popup=e}else this._popup=(new i.Popup(t,this)).setContent(e);return this},setPopupContent:function(e){this._popup&&this._popup.setContent(e);return this},unbindPopup:function(){if(this._popup){this._popup=null;this.off("click",this.togglePopup).off("remove",this.closePopup).off("move",this._movePopup)}return this},_movePopup:function(e){this._popup.setLatLng(e.latlng)}});i.LayerGroup=i.Class.extend({initialize:function(e){this._layers={};var t,n;if(e)for(t=0,n=e.length;t';var n=e.firstChild;n.style.behavior="url(#default#VML)";return n&&typeof n.adj=="object"}catch(r){return!1}}();i.Path=i.Browser.svg||!i.Browser.vml?i.Path:i.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{t.namespaces.add("lvml","urn:schemas-microsoft-com:vml");return function(e){return t.createElement("')}}catch(e){return function(e){return t.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var e=this._container=this._createElement("shape");i.DomUtil.addClass(e,"leaflet-vml-shape");this.options.clickable&&i.DomUtil.addClass(e,"leaflet-clickable");e.coordsize="1 1";this._path=this._createElement("path");e.appendChild(this._path);this._map._pathRoot.appendChild(e)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var e=this._stroke,t=this._fill,n=this.options,r=this._container;r.stroked=n.stroke;r.filled=n.fill;if(n.stroke){if(!e){e=this._stroke=this._createElement("stroke");e.endcap="round";r.appendChild(e)}e.weight=n.weight+"px";e.color=n.color;e.opacity=n.opacity;n.dashArray?e.dashStyle=n.dashArray instanceof Array?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle=""}else if(e){r.removeChild(e);this._stroke=null}if(n.fill){if(!t){t=this._fill=this._createElement("fill");r.appendChild(t)}t.color=n.fillColor||n.color;t.opacity=n.fillOpacity}else if(t){r.removeChild(t);this._fill=null}},_updatePath:function(){var e=this._container.style;e.display="none";this._path.v=this.getPathString()+" ";e.display=""}});i.Map.include(i.Browser.svg||!i.Browser.vml?{}:{_initPathRoot:function(){if(this._pathRoot)return;var e=this._pathRoot=t.createElement("div");e.className="leaflet-vml-container";this._panes.overlayPane.appendChild(e);this.on("moveend",this._updatePathViewport);this._updatePathViewport()}});i.Browser.canvas=function(){return!!t.createElement("canvas").getContext}();i.Path=i.Path.SVG&&!e.L_PREFER_CANVAS||!i.Browser.canvas?i.Path:i.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){if(this._map){this.projectLatlngs();this._requestUpdate()}return this},setStyle:function(e){i.setOptions(this,e);if(this._map){this._updateStyle();this._requestUpdate()}return this},onRemove:function(e){e.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this);if(this.options.clickable){this._map.off("click",this._onClick,this);this._map.off("mousemove",this._onMouseMove,this)}this._requestUpdate();this._map=null},_requestUpdate:function(){this._map&&!i.Path._updateRequest&&(i.Path._updateRequest=i.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){i.Path._updateRequest=null;this.fire("moveend")},_initElements:function(){this._map._initPathRoot();this._ctx=this._map._canvasCtx},_updateStyle:function(){var e=this.options;if(e.stroke){this._ctx.lineWidth=e.weight;this._ctx.strokeStyle=e.color}e.fill&&(this._ctx.fillStyle=e.fillColor||e.color)},_drawPath:function(){var e,t,n,r,s,o;this._ctx.beginPath();for(e=0,n=this._parts.length;es){o=u;s=a}}if(s>n){t[o]=1;this._simplifyDPStep(e,t,n,r,o);this._simplifyDPStep(e,t,n,o,i)}},_reducePoints:function(e,t){var n=[e[0]];for(var r=1,i=0,s=e.length;rt){n.push(e[r]);i=r}it.max.x&&(n|=2);e.yt.max.y&&(n|=8);return n},_sqDist:function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},_sqClosestPointOnSegment:function(e,t,n,r){var s=t.x,o=t.y,u=n.x-s,a=n.y-o,f=u*u+a*a,l;if(f>0){l=((e.x-s)*u+(e.y-o)*a)/f;if(l>1){s=n.x;o=n.y}else if(l>0){s+=u*l;o+=a*l}}u=e.x-s;a=e.y-o;return r?u*u+a*a:new i.Point(s,o)}};i.Polyline=i.Path.extend({initialize:function(e,t){i.Path.prototype.initialize.call(this,t);this._latlngs=this._convertLatLngs(e)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var e=0,t=this._latlngs.length;e=2&&e[0].equals(e[e.length-1])&&e.pop()},projectLatlngs:function(){i.Polyline.prototype.projectLatlngs.call(this);this._holePoints=[];if(!this._holes)return;var e,t,n,r;for(e=0,n=this._holes.length;ee.max.x||n.y-t>e.max.y||n.x+te.y!=s.y>e.y&&e.x<(s.x-r.x)*(e.y-r.y)/(s.y-r.y)+r.x&&(t=!t)}}return t}}:{});i.Circle.include(i.Path.CANVAS?{_drawPath:function(){var e=this._point;this._ctx.beginPath();this._ctx.arc(e.x,e.y,this._radius,0,Math.PI*2,!1)},_containsPoint:function(e){var t=this._point,n=this.options.stroke?this.options.weight/2:0;return e.distanceTo(t)<=this._radius+n}}:{});i.CircleMarker.include(i.Path.CANVAS?{_updateStyle:function(){i.Path.prototype._updateStyle.call(this)}}:{});i.GeoJSON=i.FeatureGroup.extend({initialize:function(e,t){i.setOptions(this,t);this._layers={};e&&this.addData(e)},addData:function(e){var t=i.Util.isArray(e)?e:e.features,n,r,s;if(t){for(n=0,r=t.length;n=0;n--)i.DomEvent.addListener(e,i.Draggable.START[n],t);return i.DomEvent.addListener(e,"click",i.DomEvent._fakeStop).addListener(e,"dblclick",t)},preventDefault:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1;return this},stop:function(e){return i.DomEvent.preventDefault(e).stopPropagation(e)},getMousePosition:function(e,n){var r=i.Browser.ie7,s=t.body,o=t.documentElement,u=e.pageX?e.pageX-s.scrollLeft-o.scrollLeft:e.clientX,a=e.pageY?e.pageY-s.scrollTop-o.scrollTop:e.clientY,f=new i.Point(u,a),l=n.getBoundingClientRect(),c=l.left-n.clientLeft,h=l.top-n.clientTop;if(!i.DomUtil.documentIsLtr()&&(i.Browser.webkit||r)){c+=n.scrollWidth-n.clientWidth;r&&i.DomUtil.getStyle(n,"overflow-y")!=="hidden"&&i.DomUtil.getStyle(n,"overflow")!=="hidden"&&(c+=17)}return f._subtract(new i.Point(c,h))},getWheelDelta:function(e){var t=0;e.wheelDelta&&(t=e.wheelDelta/120);e.detail&&(t=-e.detail/3);return t},_skipEvents:{},_fakeStop:function(e){i.DomEvent._skipEvents[e.type]=!0},_skipped:function(e){var t=this._skipEvents[e.type];this._skipEvents[e.type]=!1;return t},_checkMouse:function(e,t){var n=t.relatedTarget;if(!n)return!0;try{while(n&&n!==e)n=n.parentNode}catch(r){return!1}return n!==e},_getEvent:function(){var t=e.event;if(!t){var n=arguments.callee.caller;while(n){t=n.arguments[0];if(t&&e.Event===t.constructor)break;n=n.caller}}return t},_filterClick:function(e,t){var n=e.timeStamp||e.originalEvent.timeStamp,r=i.DomEvent._lastClick&&n-i.DomEvent._lastClick;if(r&&r>100&&r<1e3||e.target._simulatedClick&&!e._simulated){i.DomEvent.stop(e);return}i.DomEvent._lastClick=n;return t(e)}};i.DomEvent.on=i.DomEvent.addListener;i.DomEvent.off=i.DomEvent.removeListener;i.Draggable=i.Class.extend({includes:i.Mixin.Events,statics:{START:i.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",MSPointerDown:"touchmove"}},initialize:function(e,t){this._element=e;this._dragStartTarget=t||e},enable:function(){if(this._enabled)return;for(var e=i.Draggable.START.length-1;e>=0;e--)i.DomEvent.on(this._dragStartTarget,i.Draggable.START[e],this._onDown,this);this._enabled=!0},disable:function(){if(!this._enabled)return;for(var e=i.Draggable.START.length-1;e>=0;e--)i.DomEvent.off(this._dragStartTarget,i.Draggable.START[e],this._onDown,this);this._enabled=!1;this._moved=!1},_onDown:function(e){if(e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)return;i.DomEvent.stopPropagation(e);if(i.Draggable._disabled)return;i.DomUtil.disableImageDrag();i.DomUtil.disableTextSelection();var n=e.touches?e.touches[0]:e,r=n.target;i.Browser.touch&&r.tagName.toLowerCase()==="a"&&i.DomUtil.addClass(r,"leaflet-active");this._moved=!1;if(this._moving)return;this._startPoint=new i.Point(n.clientX,n.clientY);this._startPos=this._newPos=i.DomUtil.getPosition(this._element);i.DomEvent.on(t,i.Draggable.MOVE[e.type],this._onMove,this).on(t,i.Draggable.END[e.type],this._onUp,this)},_onMove:function(e){if(e.touches&&e.touches.length>1)return;var n=e.touches&&e.touches.length===1?e.touches[0]:e,r=new i.Point(n.clientX,n.clientY),s=r.subtract(this._startPoint);if(!s.x&&!s.y)return;i.DomEvent.preventDefault(e);if(!this._moved){this.fire("dragstart");this._moved=!0;this._startPos=i.DomUtil.getPosition(this._element).subtract(s);i.Browser.touch||i.DomUtil.addClass(t.body,"leaflet-dragging")}this._newPos=this._startPos.add(s);this._moving=!0;i.Util.cancelAnimFrame(this._animRequest);this._animRequest=i.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)},_updatePosition:function(){this.fire("predrag");i.DomUtil.setPosition(this._element,this._newPos);this.fire("drag")},_onUp:function(){i.Browser.touch||i.DomUtil.removeClass(t.body,"leaflet-dragging");for(var e in i.Draggable.MOVE)i.DomEvent.off(t,i.Draggable.MOVE[e],this._onMove).off(t,i.Draggable.END[e],this._onUp);i.DomUtil.enableImageDrag();i.DomUtil.enableTextSelection();if(this._moved){i.Util.cancelAnimFrame(this._animRequest);this.fire("dragend")}this._moving=!1}});i.Handler=i.Class.extend({initialize:function(e){this._map=e},enable:function(){if(this._enabled)return;this._enabled=!0;this.addHooks()},disable:function(){if(!this._enabled)return;this._enabled=!1;this.removeHooks()},enabled:function(){return!!this._enabled}});i.Map.mergeOptions({dragging:!0,inertia:!i.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:Infinity,inertiaThreshold:i.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1});i.Map.Drag=i.Handler.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new i.Draggable(e._mapPane,e._container);this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this);if(e.options.worldCopyJump){this._draggable.on("predrag",this._onPreDrag,this);e.on("viewreset",this._onViewReset,this);this._onViewReset()}}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var e=this._map;e._panAnim&&e._panAnim.stop();e.fire("movestart").fire("dragstart");if(e.options.inertia){this._positions=[];this._times=[]}},_onDrag:function(){if(this._map.options.inertia){var e=this._lastTime=+(new Date),t=this._lastPos=this._draggable._newPos;this._positions.push(t);this._times.push(e);if(e-this._times[0]>200){this._positions.shift();this._times.shift()}}this._map.fire("move").fire("drag")},_onViewReset:function(){var e=this._map.getSize()._divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x;this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,i=(r-t+n)%e+t-n,s=(r+t+n)%e-t-n,o=Math.abs(i+n)t.inertiaThreshold||!this._positions[0];e.fire("dragend");if(r)e.fire("moveend");else{var s=this._lastPos.subtract(this._positions[0]),o=(this._lastTime+n-this._times[0])/1e3,u=t.easeLinearity,a=s.multiplyBy(u/o),f=a.distanceTo([0,0]),l=Math.min(t.inertiaMaxSpeed,f),c=a.multiplyBy(l/f),h=l/(t.inertiaDeceleration*u),p=c.multiplyBy(-h/2).round();!p.x||!p.y?e.fire("moveend"):i.Util.requestAnimFrame(function(){e.panBy(p,{duration:h,easeLinearity:u,noMoveStart:!0})})}}});i.Map.addInitHook("addHandler","dragging",i.Map.Drag);i.Map.mergeOptions({doubleClickZoom:!0});i.Map.DoubleClickZoom=i.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(e){this.setZoomAround(e.containerPoint,this._zoom+1)}});i.Map.addInitHook("addHandler","doubleClickZoom",i.Map.DoubleClickZoom);i.Map.mergeOptions({scrollWheelZoom:!0});i.Map.ScrollWheelZoom=i.Handler.extend({addHooks:function(){i.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this);i.DomEvent.on(this._map._container,"MozMousePixelScroll",i.DomEvent.preventDefault);this._delta=0},removeHooks:function(){i.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll);i.DomEvent.off(this._map._container,"MozMousePixelScroll",i.DomEvent.preventDefault)},_onWheelScroll:function(e){var t=i.DomEvent.getWheelDelta(e);this._delta+=t;this._lastMousePos=this._map.mouseEventToContainerPoint(e);this._startTime||(this._startTime=+(new Date));var n=Math.max(40-(+(new Date)-this._startTime),0);clearTimeout(this._timer);this._timer=setTimeout(i.bind(this._performZoom,this),n);i.DomEvent.preventDefault(e);i.DomEvent.stopPropagation(e)},_performZoom:function(){var e=this._map,t=this._delta,n=e.getZoom();t=t>0?Math.ceil(t):Math.floor(t);t=Math.max(Math.min(t,4),-4);t=e._limitZoom(n+t)-n;this._delta=0;this._startTime=null;if(!t)return;e.setZoomAround(this._lastMousePos,n+t)}});i.Map.addInitHook("addHandler","scrollWheelZoom",i.Map.ScrollWheelZoom);i.extend(i.DomEvent,{_touchstart:i.Browser.msTouch?"MSPointerDown":"touchstart",_touchend:i.Browser.msTouch?"MSPointerUp":"touchend",addDoubleTapListener:function(e,n,r){function p(e){var t;if(i.Browser.msTouch){h.push(e.pointerId);t=h.length}else t=e.touches.length;if(t>1)return;var n=Date.now(),r=n-(s||n);a=e.touches?e.touches[0]:e;o=r>0&&r<=u;s=n}function d(e){if(i.Browser.msTouch){var t=h.indexOf(e.pointerId);if(t===-1)return;h.splice(t,1)}if(o){if(i.Browser.msTouch){var r={},u;for(var f in a){u=a[f];typeof u=="function"?r[f]=u.bind(a):r[f]=u}a=r}a.type="dblclick";n(a);s=null}}var s,o=!1,u=250,a,f="_leaflet_",l=this._touchstart,c=this._touchend,h=[];e[f+l+r]=p;e[f+c+r]=d;var v=i.Browser.msTouch?t.documentElement:e;e.addEventListener(l,p,!1);v.addEventListener(c,d,!1);i.Browser.msTouch&&v.addEventListener("MSPointerCancel",d,!1);return this},removeDoubleTapListener:function(e,n){var r="_leaflet_";e.removeEventListener(this._touchstart,e[r+this._touchstart+n],!1);(i.Browser.msTouch?t.documentElement:e).removeEventListener(this._touchend,e[r+this._touchend+n],!1);i.Browser.msTouch&&t.documentElement.removeEventListener("MSPointerCancel",e[r+this._touchend+n],!1);return this}});i.extend(i.DomEvent,{_msTouches:[],_msDocumentListener:!1,addMsTouchListener:function(e,t,n,r){switch(t){case"touchstart":return this.addMsTouchListenerStart(e,t,n,r);case"touchend":return this.addMsTouchListenerEnd(e,t,n,r);case"touchmove":return this.addMsTouchListenerMove(e,t,n,r);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(e,n,r,i){var s="_leaflet_",o=this._msTouches,u=function(e){var t=!1;for(var n=0;n0?Math.ceil(o):Math.floor(o),a=e._limitZoom(s+u),f=e.getZoomScale(a)/this._scale;e._animateZoom(r,a,n,f)},_getScaleOrigin:function(){var e=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(e)}});i.Map.addInitHook("addHandler","touchZoom",i.Map.TouchZoom);i.Map.mergeOptions({tap:!0,tapTolerance:15});i.Map.Tap=i.Handler.extend({addHooks:function(){i.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){i.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(!e.touches)return;i.DomEvent.preventDefault(e);this._fireClick=!0;if(e.touches.length>1){this._fireClick=!1;clearTimeout(this._holdTimeout);return}var n=e.touches[0],r=n.target;this._startPos=this._newPos=new i.Point(n.clientX,n.clientY);r.tagName.toLowerCase()==="a"&&i.DomUtil.addClass(r,"leaflet-active");this._holdTimeout=setTimeout(i.bind(function(){if(this._isTapValid()){this._fireClick=!1;this._onUp();this._simulateEvent("contextmenu",n)}},this),1e3);i.DomEvent.on(t,"touchmove",this._onMove,this).on(t,"touchend",this._onUp,this)},_onUp:function(e){clearTimeout(this._holdTimeout);i.DomEvent.off(t,"touchmove",this._onMove,this).off(t,"touchend",this._onUp,this);if(this._fireClick&&e&&e.changedTouches){var n=e.changedTouches[0],r=n.target;r.tagName.toLowerCase()==="a"&&i.DomUtil.removeClass(r,"leaflet-active");this._isTapValid()&&this._simulateEvent("click",n)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(e){var t=e.touches[0];this._newPos=new i.Point(t.clientX,t.clientY)},_simulateEvent:function(n,r){var i=t.createEvent("MouseEvents");i._simulated=!0;r.target._simulatedClick=!0;i.initMouseEvent(n,!0,!0,e,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null);r.target.dispatchEvent(i)}});i.Browser.touch&&!i.Browser.msTouch&&i.Map.addInitHook("addHandler","tap",i.Map.Tap);i.Map.mergeOptions({boxZoom:!0});i.Map.BoxZoom=i.Handler.extend({initialize:function(e){this._map=e;this._container=e._container;this._pane=e._panes.overlayPane},addHooks:function(){i.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){i.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;i.DomUtil.disableTextSelection();i.DomUtil.disableImageDrag();this._startLayerPoint=this._map.mouseEventToLayerPoint(e);this._box=i.DomUtil.create("div","leaflet-zoom-box",this._pane);i.DomUtil.setPosition(this._box,this._startLayerPoint);this._container.style.cursor="crosshair";i.DomEvent.on(t,"mousemove",this._onMouseMove,this).on(t,"mouseup",this._onMouseUp,this).on(t,"keydown",this._onKeyDown,this);this._map.fire("boxzoomstart")},_onMouseMove:function(e){var t=this._startLayerPoint,n=this._box,r=this._map.mouseEventToLayerPoint(e),s=r.subtract(t),o=new i.Point(Math.min(r.x,t.x),Math.min(r.y,t.y));i.DomUtil.setPosition(n,o);n.style.width=Math.max(0,Math.abs(s.x)-4)+"px";n.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._pane.removeChild(this._box);this._container.style.cursor="";i.DomUtil.enableTextSelection();i.DomUtil.enableImageDrag();i.DomEvent.off(t,"mousemove",this._onMouseMove).off(t,"mouseup",this._onMouseUp).off(t,"keydown",this._onKeyDown)},_onMouseUp:function(e){this._finish();var t=this._map,n=t.mouseEventToLayerPoint(e);if(this._startLayerPoint.equals(n))return;var r=new i.LatLngBounds(t.layerPointToLatLng(this._startLayerPoint),t.layerPointToLatLng(n));t.fitBounds(r);t.fire("boxzoomend",{boxZoomBounds:r})},_onKeyDown:function(e){e.keyCode===27&&this._finish()}});i.Map.addInitHook("addHandler","boxZoom",i.Map.BoxZoom);i.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1});i.Map.Keyboard=i.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109,173]},initialize:function(e){this._map=e;this._setPanOffset(e.options.keyboardPanOffset);this._setZoomOffset(e.options.keyboardZoomOffset)},addHooks:function(){var e=this._map._container;e.tabIndex===-1&&(e.tabIndex="0");i.DomEvent.on(e,"focus",this._onFocus,this).on(e,"blur",this._onBlur,this).on(e,"mousedown",this._onMouseDown,this);this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var e=this._map._container;i.DomEvent.off(e,"focus",this._onFocus,this).off(e,"blur",this._onBlur,this).off(e,"mousedown",this._onMouseDown,this);this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(this._focused)return;var n=t.body,r=t.documentElement,i=n.scrollTop||r.scrollTop,s=n.scrollLeft||r.scrollLeft;this._map._container.focus();e.scrollTo(s,i)},_onFocus:function(){this._focused=!0;this._map.fire("focus")},_onBlur:function(){this._focused=!1;this._map.fire("blur")},_setPanOffset:function(e){var t=this._panKeys={},n=this.keyCodes,r,i;for(r=0,i=n.left.length;rLeaflet'},initialize:function(e){i.setOptions(this,e);this._attributions={}},onAdd:function(e){this._container=i.DomUtil.create("div","leaflet-control-attribution");i.DomEvent.disableClickPropagation(this._container);e.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this);this._update();return this._container},onRemove:function(e){e.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(e){this.options.prefix=e;this._update();return this},addAttribution:function(e){if(!e)return;this._attributions[e]||(this._attributions[e]=0);this._attributions[e]++;this._update();return this},removeAttribution:function(e){if(!e)return;if(this._attributions[e]){this._attributions[e]--;this._update()}return this},_update:function(){if(!this._map)return;var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix);e.length&&n.push(e.join(", "));this._container.innerHTML=n.join(" | ")},_onLayerAdd:function(e){e.layer.getAttribution&&this.addAttribution(e.layer.getAttribution())},_onLayerRemove:function(e){e.layer.getAttribution&&this.removeAttribution(e.layer.getAttribution())}});i.Map.mergeOptions({attributionControl:!0});i.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new i.Control.Attribution).addTo(this))});i.control.attribution=function(e){return new i.Control.Attribution(e)};i.Control.Scale=i.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(e){this._map=e;var t="leaflet-control-scale",n=i.DomUtil.create("div",t),r=this.options;this._addScales(r,t,n);e.on(r.updateWhenIdle?"moveend":"move",this._update,this);e.whenReady(this._update,this);return n},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=i.DomUtil.create("div",t+"-line",n));e.imperial&&(this._iScale=i.DomUtil.create("div",t+"-line",n))},_update:function(){var e=this._map.getBounds(),t=e.getCenter().lat,n=6378137*Math.PI*Math.cos(t*Math.PI/180),r=n*(e.getNorthEast().lng-e.getSouthWest().lng)/180,i=this._map.getSize(),s=this.options,o=0;i.x>0&&(o=r*(s.maxWidth/i.x));this._updateScales(s,o)},_updateScales:function(e,t){e.metric&&t&&this._updateMetric(t);e.imperial&&t&&this._updateImperial(t)},_updateMetric:function(e){var t=this._getRoundNum(e);this._mScale.style.width=this._getScaleWidth(t/e)+"px";this._mScale.innerHTML=t<1e3?t+" m":t/1e3+" km"},_updateImperial:function(e){var t=e*3.2808399,n=this._iScale,r,i,s;if(t>5280){r=t/5280;i=this._getRoundNum(r);n.style.width=this._getScaleWidth(i/r)+"px";n.innerHTML=i+" mi"}else{s=this._getRoundNum(t);n.style.width=this._getScaleWidth(s/t)+"px";n.innerHTML=s+" ft"}},_getScaleWidth:function(e){return Math.round(this.options.maxWidth*e)-10},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1;return t*n}});i.control.scale=function(e){return new i.Control.Scale(e)};i.Control.Layers=i.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(e,t,n){i.setOptions(this,n);this._layers={};this._lastZIndex=0;this._handlingClick=!1;for(var r in e)this._addLayer(e[r],r);for(r in t)this._addLayer(t[r],r,!0)},onAdd:function(e){this._initLayout();this._update();e.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this);return this._container},onRemove:function(e){e.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(e,t){this._addLayer(e,t);this._update();return this},addOverlay:function(e,t){this._addLayer(e,t,!0);this._update();return this},removeLayer:function(e){var t=i.stamp(e);delete this._layers[t];this._update();return this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=i.DomUtil.create("div",e);t.setAttribute("aria-haspopup",!0);if(!i.Browser.touch){i.DomEvent.disableClickPropagation(t);i.DomEvent.on(t,"mousewheel",i.DomEvent.stopPropagation)}else i.DomEvent.on(t,"click",i.DomEvent.stopPropagation);var n=this._form=i.DomUtil.create("form",e+"-list");if(this.options.collapsed){i.Browser.android||i.DomEvent.on(t,"mouseover",this._expand,this).on(t,"mouseout",this._collapse,this);var r=this._layersLink=i.DomUtil.create("a",e+"-toggle",t);r.href="#";r.title="Layers";i.Browser.touch?i.DomEvent.on(r,"click",i.DomEvent.stop).on(r,"click",this._expand,this):i.DomEvent.on(r,"focus",this._expand,this);this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=i.DomUtil.create("div",e+"-base",n);this._separator=i.DomUtil.create("div",e+"-separator",n);this._overlaysList=i.DomUtil.create("div",e+"-overlays",n);t.appendChild(n)},_addLayer:function(e,t,n){var r=i.stamp(e);this._layers[r]={layer:e,name:t,overlay:n};if(this.options.autoZIndex&&e.setZIndex){this._lastZIndex++;e.setZIndex(this._lastZIndex)}},_update:function(){if(!this._container)return;this._baseLayersList.innerHTML="";this._overlaysList.innerHTML="";var e=!1,t=!1,n,r;for(n in this._layers){r=this._layers[n];this._addItem(r);t=t||r.overlay;e=e||!r.overlay}this._separator.style.display=t&&e?"":"none"},_onLayerChange:function(e){var t=this._layers[i.stamp(e.layer)];if(!t)return;this._handlingClick||this._update();var n=t.overlay?e.type==="layeradd"?"overlayadd":"overlayremove":e.type==="layeradd"?"baselayerchange":null;n&&this._map.fire(n,t)},_createRadioElement:function(e,n){var r='this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),i=this._getCenterOffset(e)._divideBy(1-1/r),s=this._getCenterLayerPoint()._add(i);if(n.animate!==!0&&!this.getSize().contains(i))return!1;this.fire("movestart").fire("zoomstart");this._animateZoom(e,t,s,r,null,!0);return!0},_animateZoom:function(e,t,n,r,s,o){this._animatingZoom=!0;i.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim");this._animateToCenter=e;this._animateToZoom=t;i.Draggable&&(i.Draggable._disabled=!0);this.fire("zoomanim",{center:e,zoom:t,origin:n,scale:r,delta:s,backwards:o})},_onZoomTransitionEnd:function(){this._animatingZoom=!1;i.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim");this._resetView(this._animateToCenter,this._animateToZoom,!0,!0);i.Draggable&&(i.Draggable._disabled=!1)}}:{});i.TileLayer.include({_animateZoom:function(e){if(!this._animating){this._animating=!0;this._prepareBgBuffer()}var t=this._bgBuffer,n=i.DomUtil.TRANSFORM,r=e.delta?i.DomUtil.getTranslateString(e.delta):t.style[n],s=i.DomUtil.getScaleString(e.scale,e.origin);t.style[n]=e.backwards?s+" "+r:r+" "+s},_endZoomAnim:function(){var e=this._tileContainer,t=this._bgBuffer;e.style.visibility="";e.parentNode.appendChild(e);i.Util.falseFn(t.offsetWidth);this._animating=!1},_clearBgBuffer:function(){var e=this._map;if(e&&!e._animatingZoom&&!e.touchZoom._zooming){this._bgBuffer.innerHTML="";this._bgBuffer.style[i.DomUtil.TRANSFORM]=""}},_prepareBgBuffer:function(){var e=this._tileContainer,t=this._bgBuffer,n=this._getLoadedTilesPercentage(t),r=this._getLoadedTilesPercentage(e);if(t&&n>.5&&r<.5){e.style.visibility="hidden";this._stopLoadingImages(e);return}t.style.visibility="hidden";t.style[i.DomUtil.TRANSFORM]="";this._tileContainer=t;t=this._bgBuffer=e;this._stopLoadingImages(t);clearTimeout(this._clearBgBufferTimer)},_getLoadedTilesPercentage:function(e){var t=e.getElementsByTagName("img"),n,r,i=0;for(n=0,r=t.length;nStamen Design, ','under CC BY 3.0. ','Data by OpenStreetMap, ','under CC BY SA.'].join("")}},r={toner:n("toner","png",0,20),terrain:n("terrain","jpg",4,18),watercolor:n("watercolor","jpg",1,16),"trees-cabs-crime":{url:"http://{S}.tiles.mapbox.com/v3/stamen.trees-cabs-crime/{Z}/{X}/{Y}.png",type:"png",subdomains:"a b c d".split(" "),minZoom:11,maxZoom:18,extent:[{lat:37.853,lon:-122.577},{lat:37.684,lon:-122.313}],attribution:['Design by Shawn Allen at Stamen.','Data courtesy of FuF,','Yellow Cab','& SFPD.'].join(" ")}};i("toner",["hybrid","labels","lines","background","lite"]);i("toner",["2010"]);i("toner",["2011","2011-lines","2011-labels","2011-lite"]);i("terrain",["background"]);i("terrain",["labels","lines"],"png");e.stamen=e.stamen||{};e.stamen.tile=e.stamen.tile||{};e.stamen.tile.providers=r;e.stamen.tile.getProvider=s;if(typeof MM=="object"){var o=typeof MM.Template=="function"?MM.Template:MM.TemplatedMapProvider;MM.StamenTileLayer=function(e){var t=s(e);this._provider=t;MM.Layer.call(this,new o(t.url,t.subdomains));this.provider.setZoomRange(t.minZoom,t.maxZoom);this.attribution=t.attribution};MM.StamenTileLayer.prototype={setCoordLimits:function(e){var t=this._provider;if(t.extent){e.coordLimits=[e.locationCoordinate(t.extent[0]).zoomTo(t.minZoom),e.locationCoordinate(t.extent[1]).zoomTo(t.maxZoom)];return!0}return!1}};MM.extend(MM.StamenTileLayer,MM.Layer)}typeof L=="object"&&(L.StamenTileLayer=L.TileLayer.extend({initialize:function(e){var t=s(e),n=t.url.replace(/({[A-Z]})/g,function(e){return e.toLowerCase()});L.TileLayer.prototype.initialize.call(this,n,{minZoom:t.minZoom,maxZoom:t.maxZoom,subdomains:t.subdomains,scheme:"xyz",attribution:t.attribution})}}));if(typeof google=="object"&&typeof google.maps=="object"){google.maps.StamenMapType=function(e){var t=s(e),n=t.subdomains;return google.maps.ImageMapType.call(this,{getTileUrl:function(e,r){var i=1<=0){var n=0,r=this.current_marker;this.current_marker=e;var i=this._markers[this.current_marker];this.animator&&this.animator.stop();this._resetMarkersActive();if(i.data.type&&i.data.type=="overview"){this._markerOverview();t||this._onMarkerChange()}else{i.active(!0);if(t)i.data.location&&this._viewTo(i.data.location);else{if(i.data.location&&i.data.location.lat){trace("HAS LOCATION");n=this._calculateZoomChange(this._getMapCenter(!0),i.location());this._viewTo(i.data.location,{calculate_zoom:this.options.calculate_zoom,zoom:n});if(this.options.line_follows_path){if(this.options.show_history_line&&i.data.real_marker&&this._markers[r].data.real_marker){var s=[],o=r;if(othis.current_marker)while(o>this.current_marker){var u={lat:this._markers[o].data.location.lat,lon:this._markers[o].data.location.lon};s.push(u);o--}s.push({lat:i.data.location.lat,lon:i.data.location.lon});this._replaceLines(this._line_active,s)}}else this.options.show_history_line&&i.data.real_marker&&this._markers[r].data.real_marker&&this._replaceLines(this._line_active,[{lat:i.data.location.lat,lon:i.data.location.lon},{lat:this._markers[r].data.location.lat,lon:this._markers[r].data.location.lon}])}else{this._markerOverview();t||this._onMarkerChange()}this._onMarkerChange()}}}},panTo:function(e,t){this._panTo(e,t)},zoomTo:function(e,t){this._zoomTo(e,t)},viewTo:function(e,t){this._viewTo(e,t)},getBoundsZoom:function(e,t,n,r){this.__getBoundsZoom(e,t,n,r)},markerOverview:function(){this._markerOverview()},show:function(){},hide:function(){},addTo:function(e){e.appendChild(this._el.container);this.onAdd()},removeFrom:function(e){e.removeChild(this._el.container);this.onRemove()},createMarkers:function(e){this._createMarkers(e)},createMarker:function(e){this._createMarker(e)},_destroyMarker:function(e){this._removeMarker(e);for(var t=0;t";this._marker.bindPopup(n,{closeButton:!1,offset:[0,43]})},_active:function(e){var t=this;this.data.media&&this.data.media.mediatype?this.media_icon_class="vco-mapmarker-icon vco-icon-"+this.data.media.mediatype.type:this.media_icon_class="vco-mapmarker-icon vco-icon-plaintext";if(this.data.real_marker)if(e){this._marker.setZIndexOffset(100);this._icon=L.divIcon({className:"vco-mapmarker-active "+this.media_icon_class});this.timer=setTimeout(function(){t._openPopup()},this.options.duration+200);this._setIcon()}else{this._marker.closePopup();clearTimeout(this.timer);this._marker.setZIndexOffset(0);this._icon=L.divIcon({className:"vco-mapmarker "+this.media_icon_class});this._setIcon()}},_openPopup:function(){this._marker.openPopup()},_setIcon:function(){this._marker.setIcon(this._icon)},_location:function(){return this.data.real_marker?this._marker.getLatLng():{}}});VCO.Map.Leaflet=VCO.Map.extend({includes:[VCO.Events],_createMap:function(){L.Icon.Default.imagePath=this.options.path_gfx;this._map=new L.map(this._el.map,{scrollWheelZoom:!1});this._map.on("load",this._onMapLoaded,this);var e,t=this.options.map_type.split(":");switch(t[0]){case"stamen":e=new L.StamenTileLayer(t[1]||"toner");break;case"osm":e=new L.TileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{subdomains:"ab"});break;case"http":case"https":e=new L.TileLayer(this.options.map_type,{subdomains:this.options.map_subdomains});break;default:e=new L.StamenTileLayer("toner")}this._map.addLayer(e);this._line=this._createLine(this._line);this._line.setStyle({color:this.options.line_color_inactive});this._addLineToMap(this._line);this._line_active=this._createLine(this._line_active);this._line_active.setStyle({opacity:1});this._addLineToMap(this._line_active)},_createMarker:function(e){var t=new VCO.MapMarker.Leaflet(e,this.options);t.on("markerclick",this._onMarkerClick,this);this._addMarker(t);this._markers.push(t);t.marker_number=this._markers.length-1;this.fire("markerAdded",t)},_addMarker:function(e){e.addTo(this._map)},_removeMarker:function(e){},_markerOverview:function(){var e=[];for(var t=0;t\—")[0] + "

"; - tweetuser = d.author_url.split("twitter.com\/")[1]; + tweet_text = d.html.split("<\/p>\—")[0] + "

"; + tweetuser = d.author_url.split("twitter.com\/")[1]; + tweet_status_temp = d.html.split("<\/p>\—")[1].split("")[0]; + tweet_status_date = tweet_status_temp.split("\"\>")[1].split("<\/a>")[0]; + + trace("tweet_status_url " + tweet_status_url); + trace("tweet_status_date " + tweet_status_date); + + // TWEET CONTENT + tweet += tweet_text; + + //tweet += ""; // TWEET AUTHOR - tweet += "
"; + tweet += ""; + // Add to DOM this._el.content_item.innerHTML = tweet; @@ -5258,6 +5286,10 @@ VCO.Media.Twitter = VCO.Media.extend({ // After Loaded this.onLoaded(); + }, + + _updateMediaDisplay: function() { + } @@ -5520,8 +5552,6 @@ VCO.Media.Wikipedia = VCO.Media.extend({ self.createMedia(d); }); - // After Loaded - this.onLoaded(); }, createMedia: function(d) { var wiki = ""; @@ -5569,6 +5599,10 @@ VCO.Media.Wikipedia = VCO.Media.extend({ } + }, + + _updateMediaDisplay: function() { + } }); @@ -5945,6 +5979,7 @@ VCO.Slide = VCO.Class.extend({ } if (this.data.background.color) { this.has.background.color = true; + this._el.container.className += ' vco-full-color-background'; this.has.background.color_value = this.data.background.color; this._el.container.style.backgroundColor = this.data.background.color; }