!function(n,t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):n.Maplace=t(n.jQuery)}(this,function(n){"use strict";function t(t){this.VERSION="0.2.7";this.loaded=!1;this.markers=[];this.circles=[];this.oMap=!1;this.view_all_key="all";this.infowindow=null;this.maxZIndex=0;this.ln=0;this.oMap=!1;this.oBounds=null;this.map_div=null;this.canvas_map=null;this.controls_wrapper=null;this.current_control=null;this.current_index=null;this.Polyline=null;this.Polygon=null;this.Fusion=null;this.directionsService=null;this.directionsDisplay=null;this.o={debug:!1,map_div:"#gmap",controls_div:"#controls",generate_controls:!0,controls_type:"dropdown",controls_cssclass:"",controls_title:"",controls_on_map:!0,controls_applycss:!0,controls_position:google.maps.ControlPosition.RIGHT_TOP,type:"marker",view_all:!0,view_all_text:"View All",pan_on_click:!0,start:0,locations:[],shared:{},map_options:{mapTypeId:google.maps.MapTypeId.ROADMAP},stroke_options:{strokeColor:"#0000FF",strokeOpacity:.8,strokeWeight:2,fillColor:"#0000FF",fillOpacity:.4},directions_options:{travelMode:google.maps.TravelMode.DRIVING,unitSystem:google.maps.UnitSystem.METRIC,optimizeWaypoints:!1,provideRouteAlternatives:!1,avoidHighways:!1,avoidTolls:!1},circle_options:{radius:100,visible:!0},styles:{},fusion_options:{},directions_panel:null,draggable:!1,editable:!1,show_infowindows:!0,show_markers:!0,infowindow_type:"bubble",listeners:{},beforeViewAll:function(){},afterViewAll:function(){},beforeShow:function(){},afterShow:function(){},afterCreateMarker:function(){},beforeCloseInfowindow:function(){},afterCloseInfowindow:function(){},beforeOpenInfowindow:function(){},afterOpenInfowindow:function(){},afterRoute:function(){},onPolylineClick:function(){},onPolygonClick:function(){},circleRadiusChanged:function(){},circleCenterChanged:function(){},drag:function(){},dragEnd:function(){},dragStart:function(){}};this.AddControl("dropdown",r);this.AddControl("list",i);t&&"directions"===t.type&&(!t.show_markers&&(t.show_markers=!1),!t.show_infowindows&&(t.show_infowindows=!1));n.extend(!0,this.o,t)}var r,i;return r={activateCurrent:function(n){this.html_element.find("select").val(n)},getHtml:function(){var r,t,u=this,i="";if(this.ln>1){for(i+='<select class="dropdown controls '+this.o.controls_cssclass+'">',this.ShowOnMenu(this.view_all_key)&&(i+='<option value="'+this.view_all_key+'">'+this.o.view_all_text+"<\/option>"),t=0;t<this.ln;t+=1)this.ShowOnMenu(t)&&(i+='<option value="'+(t+1)+'">'+(this.o.locations[t].title||"#"+(t+1))+"<\/option>");i+="<\/select>";i=n(i).bind("change",function(){u.ViewOnMap(this.value)})}return r=this.o.controls_title,this.o.controls_title&&(r=n('<div class="controls_title"><\/div>').css(this.o.controls_applycss?{fontWeight:"bold",fontSize:this.o.controls_on_map?"12px":"inherit",padding:"3px 10px 5px 0"}:{}).append(this.o.controls_title)),this.html_element=n('<div class="wrap_controls"><\/div>').append(r).append(i),this.html_element}},i={html_a:function(t,i,r){var o=this,u=i||t+1,e=r||this.o.locations[t].title,f=n('<a data-load="'+u+'" id="ullist_a_'+u+'" href="#'+u+'" title="'+e+'"><span>'+(e||"#"+(t+1))+"<\/span><\/a>");return f.css(this.o.controls_applycss?{color:"#666",display:"block",padding:"5px",fontSize:this.o.controls_on_map?"12px":"inherit",textDecoration:"none"}:{}),f.on("click",function(t){t.preventDefault();var i=n(this).attr("data-load");o.ViewOnMap(i)}),f},activateCurrent:function(n){this.html_element.find("li").removeClass("active");this.html_element.find("#ullist_a_"+n).parent().addClass("active")},getHtml:function(){var r,t,u=n("<ul class='ullist controls "+this.o.controls_cssclass+"'><\/ul>").css(this.o.controls_applycss?{margin:0,padding:0,listStyleType:"none"}:{});for(this.ShowOnMenu(this.view_all_key)&&u.append(n("<li><\/li>").append(i.html_a.call(this,!1,this.view_all_key,this.o.view_all_text))),t=0;t<this.ln;t++)this.ShowOnMenu(t)&&u.append(n("<li><\/li>").append(i.html_a.call(this,t)));return r=this.o.controls_title,this.o.controls_title&&(r=n('<div class="controls_title"><\/div>').css(this.o.controls_applycss?{fontWeight:"bold",padding:"3px 10px 5px 0",fontSize:this.o.controls_on_map?"12px":"inherit"}:{}).append(this.o.controls_title)),this.html_element=n('<div class="wrap_controls"><\/div>').append(r).append(u),this.html_element}},t.prototype.controls={},t.prototype.create_objMap=function(){var i,r=this,t=0;for(i in this.o.styles)this.o.styles.hasOwnProperty(i)&&(0===t&&(this.o.map_options.mapTypeControlOptions={mapTypeIds:[google.maps.MapTypeId.ROADMAP]}),t++,this.o.map_options.mapTypeControlOptions.mapTypeIds.push("map_style_"+t));if(this.loaded)r.oMap.setOptions(this.o.map_options);else try{this.map_div.css({position:"relative",overflow:"hidden"});this.canvas_map=n("<div>").addClass("canvas_map").css({width:"100%",height:"100%"}).appendTo(this.map_div);this.oMap=new google.maps.Map(this.canvas_map.get(0),this.o.map_options)}catch(u){this.debug("create_objMap::"+this.map_div.selector,u.toString())}t=0;for(i in this.o.styles)this.o.styles.hasOwnProperty(i)&&(t++,this.oMap.mapTypes.set("map_style_"+t,new google.maps.StyledMapType(this.o.styles[i],{name:i})),this.oMap.setMapTypeId("map_style_"+t))},t.prototype.add_markers_to_objMap=function(){var n,t,i=this.o.type||"marker";switch(i){case"marker":for(n=0;n<this.ln;n++)t=this.create_objPoint(n),this.create.marker.call(this,n,t);break;default:this.create[i].apply(this)}},t.prototype.create_objPoint=function(t){var i=n.extend({},this.o.locations[t]),r=void 0===i.visible?void 0:i.visible;return!i.type&&(i.type=this.o.type),i.map=this.oMap,i.position=new google.maps.LatLng(i.lat,i.lon),i.zIndex=void 0===i.zIndex?1e4:i.zIndex+100,i.visible=void 0===r?this.o.show_markers:r,this.o.maxZIndex=i.zIndex>this.maxZIndex?i.zIndex:this.maxZIndex,i.image&&(i.icon=new google.maps.MarkerImage(i.image,new google.maps.Size(i.image_w||32,i.image_h||32),new google.maps.Point(0,0),new google.maps.Point((i.image_w||32)/2,(i.image_h||32)/2))),i},t.prototype.create_objCircle=function(t){var r,u,i;return i=n.extend({},t),r=n.extend({},this.o.stroke_options),u=n.extend({},this.o.circle_options),n.extend(r,t.stroke_options||{}),n.extend(i,r),n.extend(u,t.circle_options||{}),n.extend(i,u),i.center=t.position,i.draggable=!1,i.zIndex=t.zIndex>0?t.zIndex-10:1,i},t.prototype.add_markerEv=function(n,t,i){var r=this;google.maps.event.addListener(i,"click",function(u){r.o.beforeShow(n,t,i);r.o.show_infowindows&&t.show_infowindow!==!1&&r.open_infowindow(n,i,u);r.o.pan_on_click&&t.pan_on_click!==!1&&(r.oMap.panTo(t.position),t.zoom&&r.oMap.setZoom(t.zoom));r.current_control&&r.o.generate_controls&&r.current_control.activateCurrent&&r.current_control.activateCurrent.call(r,n+1);r.current_index=n;r.o.afterShow(n,t,i)});t.draggable&&this.add_dragEv(n,t,i)},t.prototype.add_circleEv=function(n,t,i){var r=this;google.maps.event.addListener(i,"click",function(){r.ViewOnMap(n+1)});google.maps.event.addListener(i,"center_changed",function(){r.o.circleCenterChanged(n,t,i)});google.maps.event.addListener(i,"radius_changed",function(){r.o.circleRadiusChanged(n,t,i)});t.draggable&&this.add_dragEv(n,t,i)},t.prototype.add_dragEv=function(n,t,i){var r=this;google.maps.event.addListener(i,"drag",function(){var e,u;if(i.getPosition)e=i.getPosition();else{if(!i.getCenter)return;e=i.getCenter()}if(r.circles[n]&&r.circles[n].setCenter(e),r.Polyline?u="Polyline":r.Polygon&&(u="Polygon"),u){for(var h=r[u].getPath(),o=h.getArray(),s=[],f=0;f<o.length;++f)s[f]=n===f?new google.maps.LatLng(e.lat(),e.lng()):new google.maps.LatLng(o[f].lat(),o[f].lng());r[u].setPath(new google.maps.MVCArray(s));r.add_polyEv(u)}r.o.drag(n,t,i)});google.maps.event.addListener(i,"dragend",function(){r.o.dragEnd(n,t,i)});google.maps.event.addListener(i,"dragstart",function(){r.o.dragStart(n,t,i)});google.maps.event.addListener(i,"center_changed",function(){r.markers[n]&&i.getCenter&&r.markers[n].setPosition(i.getCenter());r.o.drag(n,t,i)})},t.prototype.add_polyEv=function(n){var t=this;google.maps.event.addListener(this[n].getPath(),"set_at",function(i,r){var u=t[n].getPath().getAt(i),f=new google.maps.LatLng(u.lat(),u.lng());t.markers[i]&&t.markers[i].setPosition(f);t.circles[i]&&t.circles[i].setCenter(f);t.o["on"+n+"Changed"](i,r,t[n].getPath().getArray())})},t.prototype.create={marker:function(n,t,i){var r;return"circle"!==t.type||i||(r=this.create_objCircle(t),t.visible||(r.draggable=t.draggable),i=new google.maps.Circle(r),this.add_circleEv(n,r,i),this.circles[n]=i),t.type="marker",i=new google.maps.Marker(t),this.add_markerEv(n,t,i),this.oBounds.extend(t.position),this.markers[n]=i,this.o.afterCreateMarker(n,t,i),i},circle:function(){for(var t,i,r,n=0;n<this.ln;n++)t=this.create_objPoint(n),"circle"===t.type&&(i=this.create_objCircle(t),t.visible||(i.draggable=t.draggable),r=new google.maps.Circle(i),this.add_circleEv(n,i,r),this.circles[n]=r),t.type="marker",this.create.marker.call(this,n,t,r)},polyline:function(){var i,r,t=n.extend({},this.o.stroke_options);for(t.path=[],t.draggable=this.o.draggable,t.editable=this.o.editable,t.map=this.oMap,t.zIndex=this.o.maxZIndex+100,i=0;i<this.ln;i++)r=this.create_objPoint(i),this.create.marker.call(this,i,r),t.path.push(r.position);this.Polyline?this.Polyline.setOptions(t):this.Polyline=new google.maps.Polyline(t);this.add_polyEv("Polyline")},polygon:function(){var i,r,u=this,t=n.extend({},this.o.stroke_options);for(t.path=[],t.draggable=this.o.draggable,t.editable=this.o.editable,t.map=this.oMap,t.zIndex=this.o.maxZIndex+100,i=0;i<this.ln;i++)r=this.create_objPoint(i),this.create.marker.call(this,i,r),t.path.push(r.position);this.Polygon?this.Polygon.setOptions(t):this.Polygon=new google.maps.Polygon(t);google.maps.event.addListener(this.Polygon,"click",function(n){u.o.onPolygonClick(n)});this.add_polyEv("Polygon")},fusion:function(){this.o.fusion_options.styles=[this.o.stroke_options];this.o.fusion_options.map=this.oMap;this.Fusion?this.Fusion.setOptions(this.o.fusion_options):this.Fusion=new google.maps.FusionTablesLayer(this.o.fusion_options)},directions:function(){for(var r,f,e,o,i=this,s=[],u=0,t=0;t<this.ln;t++)r=this.create_objPoint(t),0===t?e=r.position:t===this.ln-1?o=r.position:(f=this.o.locations[t].stopover===!0,s.push({location:r.position,stopover:f})),this.create.marker.call(this,t,r);this.o.directions_options.origin=e;this.o.directions_options.destination=o;this.o.directions_options.waypoints=s;this.directionsService||(this.directionsService=new google.maps.DirectionsService);this.directionsDisplay?this.directionsDisplay.setOptions({draggable:this.o.draggable}):this.directionsDisplay=new google.maps.DirectionsRenderer({draggable:this.o.draggable});this.directionsDisplay.setMap(this.oMap);this.o.directions_panel&&(this.o.directions_panel=n(this.o.directions_panel),this.directionsDisplay.setPanel(this.o.directions_panel.get(0)));this.o.draggable&&google.maps.event.addListener(this.directionsDisplay,"directions_changed",function(){u=i.compute_distance(i.directionsDisplay.directions);i.o.afterRoute(u)});this.directionsService.route(this.o.directions_options,function(n,t){t===google.maps.DirectionsStatus.OK&&(u=i.compute_distance(n),i.directionsDisplay.setDirections(n));i.o.afterRoute(u,t,n)})}},t.prototype.compute_distance=function(n){for(var i=0,r=n.routes[0],u=r.legs.length,t=0;u>t;t++)i+=r.legs[t].distance.value;return i},t.prototype.type_to_open={bubble:function(n){this.infowindow=new google.maps.InfoWindow({content:n.html||""})}},t.prototype.open_infowindow=function(n,t){this.CloseInfoWindow();var i=this.o.locations[n],r=this.o.infowindow_type;i.html&&this.type_to_open[r]&&(this.o.beforeOpenInfowindow(n,i,t),this.type_to_open[r].call(this,i),this.infowindow.open(this.oMap,t),this.o.afterOpenInfowindow(n,i,t))},t.prototype.get_html_controls=function(){return this.controls[this.o.controls_type]&&this.controls[this.o.controls_type].getHtml?(this.current_control=this.controls[this.o.controls_type],this.current_control.getHtml.apply(this)):""},t.prototype.generate_controls=function(){if(!this.o.controls_on_map)return this.controls_wrapper.empty(),void this.controls_wrapper.append(this.get_html_controls());var t=n('<div class="on_gmap '+this.o.controls_type+' gmap_controls"><\/div>').css(this.o.controls_applycss?{margin:"5px"}:{}),i=n(this.get_html_controls()).css(this.o.controls_applycss?{background:"#fff",padding:"5px",border:"1px solid #eee",boxShadow:"rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px",maxHeight:this.map_div.find(".canvas_map").outerHeight()-80,minWidth:100,overflowY:"auto",overflowX:"hidden"}:{});t.append(i);this.oMap.controls[this.o.controls_position].push(t.get(0))},t.prototype.init_map=function(){var i=this,n,t;for(this.Polyline&&this.Polyline.setMap(null),this.Polygon&&this.Polygon.setMap(null),this.Fusion&&this.Fusion.setMap(null),this.directionsDisplay&&this.directionsDisplay.setMap(null),n=this.markers.length-1;n>=0;n-=1)try{this.markers[n]&&this.markers[n].setMap(null)}catch(r){i.debug("init_map::markers::setMap",r.stack)}for(this.markers.length=0,this.markers=[],t=this.circles.length-1;t>=0;t-=1)try{this.circles[t]&&this.circles[t].setMap(null)}catch(r){i.debug("init_map::circles::setMap",r.stack)}this.circles.length=0;this.circles=[];this.o.controls_on_map&&this.oMap.controls&&this.oMap.controls[this.o.controls_position].forEach(function(n,t){try{i.oMap.controls[this.o.controls_position].removeAt(t)}catch(r){i.debug("init_map::removeAt",r.stack)}});this.oBounds=new google.maps.LatLngBounds},t.prototype.perform_load=function(){1===this.ln?(this.o.map_options.set_center?this.oMap.setCenter(new google.maps.LatLng(this.o.map_options.set_center[0],this.o.map_options.set_center[1])):(this.oMap.fitBounds(this.oBounds),this.ViewOnMap(1)),this.o.map_options.zoom&&this.oMap.setZoom(this.o.map_options.zoom)):0===this.ln?(this.o.map_options.set_center?this.oMap.setCenter(new google.maps.LatLng(this.o.map_options.set_center[0],this.o.map_options.set_center[1])):this.oMap.fitBounds(this.oBounds),this.oMap.setZoom(this.o.map_options.zoom||1)):(this.oMap.fitBounds(this.oBounds),"number"==typeof(this.o.start-0)&&this.o.start>0&&this.o.start<=this.ln?this.ViewOnMap(this.o.start):this.o.map_options.set_center?this.oMap.setCenter(new google.maps.LatLng(this.o.map_options.set_center[0],this.o.map_options.set_center[1])):this.ViewOnMap(this.view_all_key),this.o.map_options.zoom&&this.oMap.setZoom(this.o.map_options.zoom))},t.prototype.debug=function(n,t){return this.o.debug&&console.log(n,t),this},t.prototype.AddControl=function(n,t){return n&&t?(this.controls[n]=t,this):(self.debug("AddControl",'Missing "name" and "func" callback.'),!1)},t.prototype.CloseInfoWindow=function(){return this.infowindow&&(this.current_index||0===this.current_index)&&(this.o.beforeCloseInfowindow(this.current_index,this.o.locations[this.current_index]),this.infowindow.close(),this.infowindow=null,this.o.afterCloseInfowindow(this.current_index,this.o.locations[this.current_index])),this},t.prototype.ShowOnMenu=function(n){if(n===this.view_all_key&&this.o.view_all&&this.ln>1)return!0;if(n=parseInt(n,10),"number"==typeof(+n)&&n>=0&&n<this.ln){var t=this.o.locations[n].on_menu!==!1;if(t)return!0}return!1},t.prototype.ViewOnMap=function(n){if(n===this.view_all_key)this.o.beforeViewAll(),this.current_index=n,this.o.locations.length>0&&this.o.generate_controls&&this.current_control&&this.current_control.activateCurrent&&this.current_control.activateCurrent.apply(this,[n]),this.oMap.fitBounds(this.oBounds),this.CloseInfoWindow(),this.o.afterViewAll();else if(n=parseInt(n,10),"number"==typeof(+n)&&n>0&&n<=this.ln)try{google.maps.event.trigger(this.markers[n-1],"click")}catch(t){this.debug("ViewOnMap::trigger",t.stack)}return this},t.prototype.SetLocations=function(n,t){return this.o.locations=n,t&&this.Load(),this},t.prototype.AddLocations=function(t,i){var r=this;return n.isArray(t)&&n.each(t,function(n,t){r.o.locations.push(t)}),n.isPlainObject(t)&&this.o.locations.push(t),i&&this.Load(),this},t.prototype.AddLocation=function(t,i,r){return n.isPlainObject(t)&&this.o.locations.splice(i,0,t),r&&this.Load(),this},t.prototype.RemoveLocations=function(t,i){var u=this,r=0;return n.isArray(t)?n.each(t,function(n,t){t-r<u.ln&&u.o.locations.splice(t-r,1);r++}):t<this.ln&&this.o.locations.splice(t,1),i&&this.Load(),this},t.prototype.Loaded=function(){return this.loaded},t.prototype._init=function(){var t,i;for(this.ln=this.o.locations.length,t=0;t<this.ln;t++)i=n.extend({},this.o.shared),this.o.locations[t]=n.extend(i,this.o.locations[t]),this.o.locations[t].html&&(this.o.locations[t].html=this.o.locations[t].html.replace("%index",t+1),this.o.locations[t].html=this.o.locations[t].html.replace("%title",this.o.locations[t].title||""));return this.map_div=n(this.o.map_div),this.controls_wrapper=n(this.o.controls_div),this},t.prototype.Load=function(t){var r,i;if(n.extend(!0,this.o,t),t&&t.locations&&(this.o.locations=t.locations),this._init(),google.maps.visualRefresh=this.o.visualRefresh===!1?!1:!0,this.init_map(),this.create_objMap(),this.add_markers_to_objMap(),this.ln>1&&this.o.generate_controls||this.o.force_generate_controls?(this.o.generate_controls=!0,this.generate_controls()):this.o.generate_controls=!1,r=this,this.loaded)this.perform_load();else{google.maps.event.addListenerOnce(this.oMap,"idle",function(){r.perform_load()});for(i in this.o.listeners)this.o.listeners.hasOwnProperty(i)&&google.maps.event.addListener(this.oMap,i,this.o.listeners[i])}return this.loaded=!0,this},t});var MapHelper=function(){var t=function(){var r,i,u,t={},o=function(n){t=$.extend(!0,{mapContainerId:"#map-sos-alert",alertLabels:null,searchBoxInputId:"Location"},n);f()},f=function(){r=[];i=null;u=null},s=function(n){u=n;r=[];$.each(n,function(n,t){var u=t.Radius*1e3,i;u>0;i={alertId:t.Id,lat:t.Lat,lon:t.Lon,title:t.Summary,html:a(t),image:t.CategoryImage!=""?t.CategoryImage:null,draggable:!1};r.push(i)});i==null?e():l();var o=document.getElementById(t.searchBoxInputId),f=new google.maps.places.SearchBox(o);f.addListener("places_changed",function(){var t=f.getPlaces(),n;t.length!=0&&(n=new google.maps.LatLngBounds,t.forEach(function(t){t.geometry.viewport?n.union(t.geometry.viewport):n.extend(t.geometry.location)}),i.oMap.fitBounds(n))})},h=function(){f();$(t.mapContainerId).length!=0&&$(t.mapContainerId).before('<div id="'+t.mapContainerId.replace("#","")+'"><\/div>').remove()},e=function(){setTimeout(c(),500)},c=function(){i==null&&$(t.mapContainerId).length!=0&&$(t.mapContainerId).is(":visible")&&(i=new Maplace({locations:r,map_div:t.mapContainerId,map_options:{zoom:2,set_center:[0,0]},generate_controls:!1,pan_on_click:!1,show_markers:!0,beforeOpenInfoWindow:function(){alert("beforeOpenInfoWindow");console.log(i.info);console.log(i.oMap.info)}}).Load())},l=function(){var n=i.oMap.getCenter();i.SetLocations(r).Load({map_options:{zoom:i.oMap.getZoom()}});n!=undefined&&i.oMap.setCenter(new google.maps.LatLng(n.lat(),n.lng()))},a=function(i){var r="";switch(i.SeverityLevel){case 1:r="bg-blue";break;case 2:r="bg-yellow";break;case 3:r="bg-orange";break;case 4:r="bg-red"}return'<div class="panel-body media color-white '+r+'"><div class="media-left"><img src="'+i.ImgUrl+'" alt="'+i.Summary+'" class="media-object"><\/div><div class="media-body"><h4 class="media-heading">'+i.SeverityLevelDescription+"<\/h4>"+i.Summary+'<\/div><\/div><div class="panel-body"><strong>'+t.alertLabels.Countries+"<\/strong> "+(n(i.Countries)?i.Countries:"-")+"<br><strong>"+t.alertLabels.Location+"<\/strong> "+(n(i.Location)?i.Location:"-")+"<br><strong>"+t.alertLabels.Category+"<\/strong> "+(n(i.Category)?i.Category:"-")+"<br><strong>"+t.alertLabels.Severity+"<\/strong> "+(n(i.SeverityLevelDescription)?i.SeverityLevelDescription:"-")+"<br><strong>"+t.alertLabels.StartDate+"<\/strong> "+(n(i.StartDate)?i.StartDate:"-")+(i.Radius>0?"<br><strong>"+t.alertLabels.Radius+"<\/strong> "+i.Radius+" KM":"")+"<br><strong>"+t.alertLabels.Report+"<\/strong> "+i.Report+"<\/div>"};return{initialize:o,destroyMap:h,initMap:e,loadMapWithLocations:s}}(),n=function(n){return n!=null&&n!=undefined?!0:!1};return{IncidentGlobalMap:t}}(),SosBoardJs=function(){var n={},r=function(i){n=$.extend(!0,{tabDivId:"#tabDiv",tabNrId:"#tabNr",filterFormId:"#filterForm",filterFormResetId:"#filterFormReset",showLastDaysId:"#ShowLastDays",dayCountId:"#dayCount",tabBtnsClass:".tabBtns",defaultShowDaysCount:7,mapUrl:"",alertLabels:null,searchBoxInputId:"Location"},i);MapHelper.IncidentGlobalMap.initialize({alertLabels:n.alertLabels});$(document).on("submit",n.filterFormId,function(){t();var n=$(this),i=n.find(":submit");return i.prop("disabled",!1),!1});$(document).on("click",n.filterFormResetId,e);$(document).on("click",n.tabBtnsClass,f);$(document).on("change",n.showLastDaysId,o);$(document).on("click",'a[href*="_SosAlertBoardList"]',function(t){$(n.tabDivId).loading();$.post($(this).attr("href"),$(n.filterFormId).serialize(),function(t){$(n.tabDivId).html(t)});t.preventDefault()});u()},u=function(){t()},f=function(){return i()?!1:($("#tabNr").val($(this).data("tab")),$(n.tabBtnsClass).removeClass("active"),$(this).addClass("active"),t(),!0)},e=function(){$(":input,#filterForm").not(':button,:submit,:reset,:hidden,:radio,input[name*="FilterSeverityLevel"]').val("");$("#Sort").val("MostRecent");$("#ShowLastDays").val(n.defaultShowDaysCount);$(n.dayCountId).text(n.defaultShowDaysCount);$(".lvlChb").each(function(){$(this).prop("checked",$(this).data("default"))});t()},o=function(){$(n.dayCountId).text($(this).val())},t=function(){if(i())return!1;if($(n.tabNrId).val()==1){$(n.tabDivId).loading();$.post($(n.filterFormId).attr("action"),$(n.filterFormId).serialize(),function(t){$(n.tabDivId).html(t)});var t=document.getElementById(n.searchBoxInputId),r=new google.maps.places.SearchBox(t)}else $(n.tabDivId).loading(),$.post(n.mapUrl,$(n.filterFormId).serialize(),function(t){MapHelper.IncidentGlobalMap.destroyMap();setTimeout(function(){$(n.tabDivId).html('<div id="map-sos-alert" style="height:500px"><\/div>');MapHelper.IncidentGlobalMap.loadMapWithLocations(t.Locations)},300)});return!0},i=function(){return $(n.tabDivId).has("div[data-loading]").length!=0?!0:!1};return{initialize:r}}()