(function($){$.fn.appear=function(fn,options){var settings=$.extend({data:undefined,one:true,accX:0,accY:0},options);return this.each(function(){var t=$(this);t.appeared=false;if(!fn){t.trigger("appear",settings.data);return}var w=$(window);var check=function(){if(!t.is(":visible")){t.appeared=false;return}var a=w.scrollLeft();var b=w.scrollTop();var o=t.offset();var x=o.left;var y=o.top;var ax=settings.accX;var ay=settings.accY;var th=t.height();var wh=w.height();var tw=t.width();var ww=w.width();if(y+th+ay>=b&&y<=b+wh+ay&&x+tw+ax>=a&&x<=a+ww+ax){if(!t.appeared)t.trigger("appear",settings.data)}else{t.appeared=false}};var modifiedFn=function(){t.appeared=true;if(settings.one){w.unbind("scroll",check);var i=$.inArray(check,$.fn.appear.checks);if(i>=0)$.fn.appear.checks.splice(i,1)}fn.apply(this,arguments)};if(settings.one)t.one("appear",settings.data,modifiedFn);else t.bind("appear",settings.data,modifiedFn);w.scroll(check);$.fn.appear.checks.push(check);check()})};$.extend($.fn.appear,{checks:[],timeout:null,checkAll:function(){var length=$.fn.appear.checks.length;if(length>0)while(length--)$.fn.appear.checks[length]()},run:function(){if($.fn.appear.timeout)clearTimeout($.fn.appear.timeout);$.fn.appear.timeout=setTimeout($.fn.appear.checkAll,20)}});$.each(["append","prepend","after","before","attr","removeAttr","addClass","removeClass","toggleClass","remove","css","show","hide"],function(i,n){var old=$.fn[n];if(old){$.fn[n]=function(){var r=old.apply(this,arguments);$.fn.appear.run();return r}}})})(jQuery);(function($){$.fn.countTo=function(options){options=$.extend({},$.fn.countTo.defaults,options||{});var loops=Math.ceil(options.speed/options.refreshInterval),increment=(options.to-options.from)/loops;return $(this).each(function(){var _this=this,loopCount=0,value=options.from,interval=setInterval(updateTimer,options.refreshInterval);function updateTimer(){value+=increment;loopCount++;$(_this).html(value.toFixed(options.decimals));if(typeof options.onUpdate=="function"){options.onUpdate.call(_this,value)}if(loopCount>=loops){clearInterval(interval);value=options.to;if(typeof options.onComplete=="function"){options.onComplete.call(_this,value)}}}})};$.fn.countTo.defaults={from:0,to:100,speed:1e3,refreshInterval:100,decimals:0,onUpdate:null,onComplete:null}})(jQuery);(function($,undef){var defaults,gm,gId=0,isFunction=$.isFunction,isArray=$.isArray;function isObject(m){return typeof m==="object"}function isString(m){return typeof m==="string"}function isNumber(m){return typeof m==="number"}function isUndefined(m){return m===undef}function initDefaults(){gm=google.maps;if(!defaults){defaults={verbose:false,queryLimit:{attempt:5,delay:250,random:250},classes:function(){var r={};$.each("Map Marker InfoWindow Circle Rectangle OverlayView StreetViewPanorama KmlLayer TrafficLayer BicyclingLayer GroundOverlay StyledMapType ImageMapType".split(" "),function(_,k){r[k]=gm[k]});return r}(),map:{mapTypeId:gm.MapTypeId.ROADMAP,center:[46.578498,2.457275],zoom:2},overlay:{pane:"floatPane",content:"",offset:{x:0,y:0}},geoloc:{getCurrentPosition:{maximumAge:6e4,timeout:5e3}}}}}function globalId(id,simulate){return isUndefined(id)?"gmap3_"+(simulate?gId+1:++gId):id}function googleVersionMin(version){var i,gmVersion=gm.version.split(".");version=version.split(".");for(i=0;i=0){return true}}return false}return $.inArray(val,tag)>=0}}}function toLatLng(mixed,emptyReturnMixed,noFlat){var empty=emptyReturnMixed?mixed:null;if(!mixed||isString(mixed)){return empty}if(mixed.latLng){return toLatLng(mixed.latLng)}if(mixed instanceof gm.LatLng){return mixed}if(numeric(mixed.lat)){return new gm.LatLng(mixed.lat,mixed.lng)}if(!noFlat&&isArray(mixed)){if(!numeric(mixed[0])||!numeric(mixed[1])){return empty}return new gm.LatLng(mixed[0],mixed[1])}return empty}function toLatLngBounds(mixed){var ne,sw;if(!mixed||mixed instanceof gm.LatLngBounds){return mixed||null}if(isArray(mixed)){if(mixed.length===2){ne=toLatLng(mixed[0]);sw=toLatLng(mixed[1])}else if(mixed.length===4){ne=toLatLng([mixed[0],mixed[1]]);sw=toLatLng([mixed[2],mixed[3]])}}else{if("ne"in mixed&&"sw"in mixed){ne=toLatLng(mixed.ne);sw=toLatLng(mixed.sw)}else if("n"in mixed&&"e"in mixed&&"s"in mixed&&"w"in mixed){ne=toLatLng([mixed.n,mixed.e]);sw=toLatLng([mixed.s,mixed.w])}}if(ne&&sw){return new gm.LatLngBounds(sw,ne)}return null}function resolveLatLng(ctx,method,runLatLng,args,attempt){var latLng=runLatLng?toLatLng(args.td,false,true):false,conf=latLng?{latLng:latLng}:args.td.address?isString(args.td.address)?{address:args.td.address}:args.td.address:false,cache=conf?geocoderCache.get(conf):false,self=this;if(conf){attempt=attempt||0;if(cache){args.latLng=cache.results[0].geometry.location;args.results=cache.results;args.status=cache.status;method.apply(ctx,[args])}else{if(conf.location){conf.location=toLatLng(conf.location)}if(conf.bounds){conf.bounds=toLatLngBounds(conf.bounds)}geocoder().geocode(conf,function(results,status){if(status===gm.GeocoderStatus.OK){geocoderCache.store(conf,{results:results,status:status});args.latLng=results[0].geometry.location;args.results=results;args.status=status;method.apply(ctx,[args])}else if(status===gm.GeocoderStatus.OVER_QUERY_LIMIT&&attempt=list.length){method.apply(ctx,[args]);return}resolveLatLng(self,function(args){delete args.td;$.extend(list[i],args);resolve.apply(self,[])},true,{td:list[i]})}resolve()}function geoloc(ctx,method,args){var is_echo=false;if(navigator&&navigator.geolocation){navigator.geolocation.getCurrentPosition(function(pos){if(!is_echo){is_echo=true;args.latLng=new gm.LatLng(pos.coords.latitude,pos.coords.longitude);method.apply(ctx,[args])}},function(){if(!is_echo){is_echo=true;args.latLng=false;method.apply(ctx,[args])}},args.opts.getCurrentPosition)}else{args.latLng=false;method.apply(ctx,[args])}}function isDirectGet(obj){var k,result=false;if(isObject(obj)&&obj.hasOwnProperty("get")){for(k in obj){if(k!=="get"){return false}}result=!obj.get.hasOwnProperty("callback")}return result}var services={},geocoderCache=new GeocoderCache;function geocoder(){if(!services.geocoder){services.geocoder=new gm.Geocoder}return services.geocoder}function GeocoderCache(){var cache=[];this.get=function(request){if(cache.length){var i,j,k,item,eq,keys=getKeys(request);for(i=0;i=0;idx--){id=store[name][idx];if(check(objects[id].tag)){break}}}else{for(idx=0;idx=0||!list.length)){for(idx in store.clusterer){objects[store.clusterer[idx]].obj.clear(last,first,tag)}}}}function Task(ctx,onEnd,td){var session={},self=this,current,resolve={latLng:{map:false,marker:false,infowindow:false,circle:false,overlay:false,getlatlng:false,getmaxzoom:false,getelevation:false,streetviewpanorama:false,getaddress:true},geoloc:{getgeoloc:true}};function unify(td){var result={};result[td]={};return result}if(isString(td)){td=unify(td)}function next(){var k;for(k in td){if(td.hasOwnProperty(k)&&!session.hasOwnProperty(k)){return k}}}self.run=function(){var k,opts;while(k=next()){if(isFunction(ctx[k])){current=k;opts=$.extend(true,{},defaults[k]||{},td[k].options||{});if(k in resolve.latLng){if(td[k].values){resolveAllLatLng(td[k].values,ctx,ctx[k],{td:td[k],opts:opts,session:session})}else{resolveLatLng(ctx,ctx[k],resolve.latLng[k],{td:td[k],opts:opts,session:session})}}else if(k in resolve.geoloc){geoloc(ctx,ctx[k],{td:td[k],opts:opts,session:session})}else{ctx[k].apply(ctx,[{td:td[k],opts:opts,session:session}])}return}else{session[k]=null}}onEnd.apply(ctx,[td,session])};self.ack=function(result){session[current]=result;self.run.apply(self,[])}}function directionsService(){if(!services.ds){services.ds=new gm.DirectionsService}return services.ds}function distanceMatrixService(){if(!services.dms){services.dms=new gm.DistanceMatrixService}return services.dms}function maxZoomService(){if(!services.mzs){services.mzs=new gm.MaxZoomService}return services.mzs}function elevationService(){if(!services.es){services.es=new gm.ElevationService}return services.es}function newEmptyOverlay(map,radius){function Overlay(){var self=this;self.onAdd=function(){};self.onRemove=function(){};self.draw=function(){};return defaults.classes.OverlayView.apply(self,[])}Overlay.prototype=defaults.classes.OverlayView.prototype;var obj=new Overlay;obj.setMap(map);return obj}function InternalClusterer($container,map,raw){var timer,projection,ffilter,fdisplay,ferror,updating=false,updated=false,redrawing=false,ready=false,enabled=true,self=this,events=[],store={},ids={},idxs={},markers=[],tds=[],values=[],overlay=newEmptyOverlay(map,raw.radius);main();function prepareMarker(index){if(!markers[index]){delete tds[index].options.map;markers[index]=new defaults.classes.Marker(tds[index].options);attachEvents($container,{td:tds[index]},markers[index],tds[index].id)}}self.getById=function(id){if(id in ids){prepareMarker(ids[id]);return markers[ids[id]]}return false};self.rm=function(id){var index=ids[id];if(markers[index]){markers[index].setMap(null)}delete markers[index];markers[index]=false;delete tds[index];tds[index]=false;delete values[index];values[index]=false;delete ids[id];delete idxs[index];updated=true};self.clearById=function(id){if(id in ids){self.rm(id);return true}};self.clear=function(last,first,tag){var start,stop,step,index,i,list=[],check=ftag(tag);if(last){start=tds.length-1;stop=-1;step=-1}else{start=0;stop=tds.length;step=1}for(index=start;index!==stop;index+=step){if(tds[index]){if(!check||check(tds[index].tag)){list.push(idxs[index]);if(first||last){break}}}}for(i=0;iraw.maxZoom,previousKeys=getStoreKeys();updated=false;if(zoom>3){bounds=extendsMapBounds();check=bounds.getSouthWest().lng()1&&loop)}else{for(j=i;jb});if(td.calculator){calculator=function(indexes){var data=[];$.each(indexes,function(i,index){data.push(internalClusterer.value(index))});return td.calculator.apply($this,[data])}}else{calculator=function(indexes){return indexes.length}}internalClusterer.error(function(){error.apply(self,arguments)});internalClusterer.display(function(cluster){var i,style,atd,obj,offset,shadow,cnt=calculator(cluster.indexes);if(raw.force||cnt>1){for(i=0;iargs.td.maxZoom){this.setZoom(args.td.maxZoom)}})}map.fitBounds(bounds)}manageEnd(args,true)};self.clear=function(args){if(isString(args.td)){if(store.clearById(args.td)||store.objClearById(args.td)){manageEnd(args,true);return}args.td={name:args.td}}if(args.td.id){$.each(array(args.td.id),function(i,id){store.clearById(id)||store.objClearById(id)})}else{store.clear(array(args.td.name),args.td.last,args.td.first,args.td.tag);store.objClear(array(args.td.name),args.td.last,args.td.first,args.td.tag)}manageEnd(args,true)};self.get=function(args,direct,full){var name,res,td=direct?args:args.td;if(!direct){full=td.full}if(isString(td)){res=store.getById(td,false,full)||store.objGetById(td);if(res===false){name=td;td={}}}else{name=td.name}if(name==="map"){res=map}if(!res){res=[];if(td.id){$.each(array(td.id),function(i,id){res.push(store.getById(id,false,full)||store.objGetById(id))});if(!isArray(td.id)){res=res[0]}}else{$.each(name?array(name):[undef],function(i,aName){var result;if(td.first){result=store.get(aName,false,td.tag,full);if(result){res.push(result)}}else if(td.all){$.each(store.all(aName,td.tag,full),function(i,result){res.push(result)})}else{result=store.get(aName,true,td.tag,full);if(result){res.push(result)}}});if(!td.all&&!isArray(name)){res=res[0]}}}res=isArray(res)||!td.all?res:[res];if(direct){return res}else{manageEnd(args,res)}};self.exec=function(args){$.each(array(args.td.func),function(i,func){$.each(self.get(args.td,true,args.td.hasOwnProperty("full")?args.td.full:true),function(j,res){func.call($this,res)})});manageEnd(args,true)};self.trigger=function(args){if(isString(args.td)){gm.event.trigger(map,args.td)}else{var options=[map,args.td.eventName];if(args.td.var_args){$.each(args.td.var_args,function(i,v){options.push(v)})}gm.event.trigger.apply(gm.event,options)}callback(args);task.ack()}}$.fn.gmap3=function(){var i,list=[],empty=true,results=[];initDefaults();for(i=0;i