$(document).ready(function(){var e=null,f=$("#storeMap").mapplic({source:"/stores-json",height:700,minimap:!1,sidebar:!1,hovertip:!0,developer:!1,maxscale:2,mousewheel:!1,search:!1,fullscreen:!1,fillcolor:"#fff"});f.on("locationopened",function(a,b){var c=$(b).attr("id"),d=$(".mapplic-sidebar");c=$('.mapplic-list-location[data-location="'+c+'"]');$(".mapplic-list-location").removeClass("j-storeActive");c.addClass("j-storeActive");d.animate({scrollTop:c.offset().top-d.offset().top+d.scrollTop()})});
$(document).on("click",".mapplic-list-location",function(){var a=$(".mapplic-list"),b=$(this);$(".mapplic-list-location").not(this).removeClass("j-storeActive");$(this).addClass("j-storeActive");a.animate({scrollTop:b.offset().top-a.offset().top+a.scrollTop()})});$(document).on("click",".j-storelist",function(a){a.preventDefault();a=$(this).data("location");$(f).data("mapplic").showLocation(a,500)});$(document).on("keyup",".j-storesearch",function(a){var b={a:"search"};b.q=$(this).val();b.c=$(".j-storecategory").val();
clearTimeout(e);e=setTimeout(function(){$.getJSON("/process-stores",b,function(a){$("#storesList").html(a.content)})},500)});$(document).on("submit",".storeSearchForm",function(a){a.preventDefault()})});