text: /*
  * storeLocator v1.4.7 - jQuery Google Maps Store Locator Plugin
  * (c) Copyright 2013, Bjorn Holine (http://www.bjornblog.com)
  * Released under the MIT license
  * Distance calculation function by Chris Pietschmann: http://pietschsoft.com/post/2008/02/01/Calculate-Distance-Between-Geocodes-in-C-and-JavaScript.aspx
  */
  
  (function(a){a.fn.storeLocator=function(b){var c=a.extend({mapDiv:"map",listDiv:"loc-list",formContainerDiv:"form-container",formID:"user-location",inputID:"address",zoomLevel:12,pinColor:"fe7569",pinTextColor:"000000",lengthUnit:"m",storeLimit:26,distanceAlert:60,dataType:"xml",dataLocation:"locations.xml",listColor1:"ffffff",listColor2:"eeeeee",originMarker:false,originpinColor:"blue",bounceMarker:true,slideMap:true,modalWindow:false,overlayDiv:"overlay",modalWindowDiv:"modal-window",modalContentDiv:"modal-content",modalCloseIconDiv:"close-icon",defaultLoc:false,defaultLat:"",defaultLng:"",autoGeocode:false,maxDistance:false,maxDistanceID:"maxdistance",fullMapStart:false,noForm:false,loading:false,loadingDiv:"loading-map",featuredLocations:false,infowindowTemplatePath:"templates/infowindow-description.html",listTemplatePath:"templates/location-list-description.html",KMLinfowindowTemplatePath:"templates/kml-infowindow-description.html",KMLlistTemplatePath:"templates/kml-location-list-description.html",callbackBeforeSend:null,callbackComplete:null,callbackSuccess:null,callbackModalOpen:null,callbackModalClose:null,jsonpCallback:null,geocodeErrorAlert:"Geocode was not successful for the following reason: ",blankInputAlert:"The input box was blank.",addressErrorAlert:"Unable to find address",autoGeocodeErrorAlert:"Automatic location detection failed. Please fill in your address or zip code.",distanceErrorAlert:"Unfortunately, our closest location is more than ",mileLang:"mile",milesLang:"miles",kilometerLang:"kilometer",kilometersLang:"kilometers"},b);
  return this.each(function(){var h=a(this);var e,g;f();function f(){if(c.dataType==="kml"){a.get(c.KMLinfowindowTemplatePath,function(i){var j=i;g=Handlebars.compile(j);
  });a.get(c.KMLlistTemplatePath,function(i){var j=i;e=Handlebars.compile(j);d();});}else{a.get(c.infowindowTemplatePath,function(i){var j=i;g=Handlebars.compile(j);
  });a.get(c.listTemplatePath,function(i){var j=i;e=Handlebars.compile(j);d();});}}function d(){var i,A,t,n,D,l;var s=[];var j=[];var y=[];var z=[];var w="storeLocator";
  function B(){s=[];j=[];y=[];z=[];a(document).off("click."+w,"#"+c.listDiv+" li");}if(c.modalWindow===true){h.wrap('<div id="'+c.overlayDiv+'"><div id="'+c.modalWindowDiv+'"><div id="'+c.modalContentDiv+'">');
  a("#"+c.modalWindowDiv).prepend('<div id="'+c.modalCloseIconDiv+'"></div>');a("#"+c.overlayDiv).hide();}if(c.slideMap===true){h.hide();}var k={};if(c.lengthUnit==="km"){k.EarthRadius=6367;
  }else{k.EarthRadius=3956;}k.ToRadian=function(r){return r*(Math.PI/180);};k.DiffRadian=function(F,r){return k.ToRadian(r)-k.ToRadian(F);};k.CalcDistance=function(I,H,G,F,r){return r*2*Math.asin(Math.min(1,Math.sqrt((Math.pow(Math.sin((k.DiffRadian(I,G))/2),2)+Math.cos(k.ToRadian(I))*Math.cos(k.ToRadian(G))*Math.pow(Math.sin((k.DiffRadian(H,F))/2),2)))));
  };function x(){geocoder=new google.maps.Geocoder();this.geocode=function(r,F){geocoder.geocode({address:r},function(I,H){if(H==google.maps.GeocoderStatus.OK){var G={};
  G.latitude=I[0].geometry.location.lat();G.longitude=I[0].geometry.location.lng();F(G);}else{alert(c.geocodeErrorAlert+H);F(null);}});};}function E(){geocoder=new google.maps.Geocoder();
  this.geocode=function(F,r){geocoder.geocode({latLng:F},function(I,H){if(H==google.maps.GeocoderStatus.OK){if(I[0]){var G={};G.address=I[0].formatted_address;
  r(G);}}else{alert(c.geocodeErrorAlert+H);r(null);}});};}function u(r,F){return Math.round(r*Math.pow(10,F))/Math.pow(10,F);}if(c.defaultLoc===true){var v=new E();
  var o=new google.maps.LatLng(c.defaultLat,c.defaultLng);v.geocode(o,function(F){if(F!==null){var r=F.address;p(c.defaultLat,c.defaultLng,r);}else{alert(c.addressErrorAlert);
  }});}if(c.fullMapStart===true){p();}if(c.autoGeocode===true){if(navigator.geolocation){navigator.geolocation.getCurrentPosition(q,C);}}function q(F){var G=new E();
  var H=new google.maps.LatLng(F.coords.latitude,F.coords.longitude);G.geocode(H,function(I){if(I!==null){var r=I.address;p(F.coords.latitude,F.coords.longitude,r);
  }else{alert(c.addressErrorAlert);}});}function C(r){alert(c.autoGeocodeErrorAlert);}function m(H){var G=a("#"+c.inputID).val();if(G===""){alert(c.blankInputAlert);
  }else{var F=new x();var r=G;F.geocode(r,function(I){if(I!==null){A=I.latitude;t=I.longitude;p(A,t,G,H);}else{alert(c.addressErrorAlert);}});}}a(function(){function r(G){G.preventDefault();
  if(c.maxDistance===true){var F=a("#"+c.maxDistanceID).val();m(F);}else{m();}}if(c.noForm===true){a(document).on("click."+w,"#"+c.formContainerDiv+" #submit",function(F){r(F);
  });a(document).on("keyup."+w,function(F){if(F.keyCode===13){r(F);}});}else{a(document).on("submit."+w,"#"+c.formID,function(F){r(F);});}});function p(r,G,F,H){a(function(){var I;
  if(c.dataType==="kml"){I="xml";}else{I=c.dataType;}a.ajax({type:"GET",url:c.dataLocation+(c.dataType==="jsonp"?(c.dataLocation.match(/\?/)?"&":"?")+"callback=?":""),dataType:I,jsonpCallback:(c.dataType==="jsonp"?c.jsonpCallback:null),beforeSend:function(){if(c.callbackBeforeSend){c.callbackBeforeSend.call(this);
  }if(c.loading===true){a("#"+c.formContainerDiv).append('<div id="'+c.loadingDiv+'"></div>');}},complete:function(L,K,J){if(c.callbackComplete){c.callbackComplete.call(this,L,K,J);
  }if(c.loading===true){a("#"+c.loadingDiv).remove();}},success:function(M,O,J){if(c.callbackSuccess){c.callbackSuccess.call(this,M,O,J);}var L=0;var N;if(c.fullMapStart===true&&a("#"+c.mapDiv).hasClass("mapOpen")===false){N=true;
  }else{B();}a("#"+c.mapDiv).addClass("mapOpen");if(c.dataType==="json"||c.dataType==="jsonp"){a.each(M,function(){var ah=this.locname;var V=this.lat;var ag=this.lng;
  var S=this.address;var ae=this.address2;var ab=this.city;var T=this.state;var U=this.postal;var Z=this.country;var W=this.phone;var Y=this.email;var Q=this.web;
  Q=Q.replace("http://","");var af=this.hours1;var ad=this.hours2;var ac=this.hours3;var aa=this.category;var X=this.featured;var R=k.CalcDistance(r,G,V,ag,k.EarthRadius);
  if(c.maxDistance===true&&N!==true){if(R<H){s[L]=[R,ah,V,ag,S,ae,ab,T,U,Z,W,Y,Q,af,ad,ac,aa,X];}else{return;}}else{s[L]=[R,ah,V,ag,S,ae,ab,T,U,Z,W,Y,Q,af,ad,ac,aa,X];
  }L++;});}else{if(c.dataType==="kml"){a(M).find("Placemark").each(function(){var R=a(this).find("name").text();var T=a(this).find("coordinates").text().split(",")[1];
  var Q=a(this).find("coordinates").text().split(",")[0];var S=a(this).find("description").text();var U=k.CalcDistance(r,G,T,Q,k.EarthRadius);if(c.maxDistance===true&&N!==true){if(U<H){s[L]=[U,R,T,Q,S];
  }else{return;}}else{s[L]=[U,R,T,Q,S];}L++;});}else{a(M).find("marker").each(function(){var ah=a(this).attr("name");var V=a(this).attr("lat");var ag=a(this).attr("lng");
  var S=a(this).attr("address");var ae=a(this).attr("address2");var ab=a(this).attr("city");var T=a(this).attr("state");var U=a(this).attr("postal");var Z=a(this).attr("country");
  var W=a(this).attr("phone");var Y=a(this).attr("email");var Q=a(this).attr("web");Q=Q.replace("http://","");var af=a(this).attr("hours1");var ad=a(this).attr("hours2");
  var ac=a(this).attr("hours3");var aa=a(this).attr("category");var X=a(this).attr("featured");var R=k.CalcDistance(r,G,V,ag,k.EarthRadius);if(c.maxDistance===true&&N!==true){if(R<H){s[L]=[R,ah,V,ag,S,ae,ab,T,U,Z,W,Y,Q,af,ad,ac,aa,X];
  }else{return;}}else{s[L]=[R,ah,V,ag,S,ae,ab,T,U,Z,W,Y,Q,af,ad,ac,aa,X];}L++;});}}function K(Q){Q.sort(function(T,S){var R=T[0];var U=S[0];return((R<U)?-1:((R>U)?1:0));
  });}K(s);if(c.featuredLocations===true){j=a.grep(s,function(R,Q){return R[17]==="true";});y=a.grep(s,function(R,Q){return R[17]!=="true";});s=[];s=j.concat(y);
  }var P=(c.lengthUnit==="km")?c.kilometersLang:c.milesLang;if(c.maxDistance===true&&N!==true){if(s[0]===undefined||s[0][0]>H){alert(c.distanceErrorAlert+H+" "+P);
  return;}}else{if(s[0][0]>c.distanceAlert){alert(c.distanceErrorAlert+c.distanceAlert+" "+P);}}a(function(){var ay,aq,ao,am,Z,au,aa,R,av,S,ab,ak,ai,ah,at,al,ad;
  function ac(az){ay=s[az][0];ay=u(ay,2);aq=s[az][1];ao=s[az][4];am=s[az][5];Z=s[az][6];au=s[az][7];R=s[az][8];aa=s[az][9];av=s[az][10];S=s[az][11];ab=s[az][12];
  ak=s[az][13];ai=s[az][14];ah=s[az][15];al=s[az][16];ad=s[az][17];}function af(az){ay=s[az][0];ay=u(ay,2);aq=s[az][1];at=s[az][4];}function U(aD){if(c.dataType==="kml"){af(aD.get("id"));
  }else{ac(aD.get("id"));}var aB;if(ay<=1){if(c.lengthUnit==="km"){aB=c.kilometerLang;}else{aB=c.mileLang;}}else{if(c.lengthUnit==="km"){aB=c.kilometersLang;
  }else{aB=c.milesLang;}}var aC=aD.get("id");if(c.storeLimit>26){var aA=aC+1;}else{var aA=String.fromCharCode("A".charCodeAt(0)+aC);}if(c.dataType==="kml"){var az={location:[{distance:ay,markerid:aC,marker:aA,name:aq,description:at,length:aB,origin:F}]};
  }else{var az={location:[{distance:ay,markerid:aC,marker:aA,name:aq,address:ao,address2:am,city:Z,state:au,postal:R,country:aa,phone:av,email:S,web:ab,hours1:ak,hours2:ai,hours3:ah,length:aB,origin:F,category:al,featured:ad}]};
  }return az;}if(c.slideMap===true){h.slideDown();}if(c.modalWindow===true){if(c.callbackModalOpen){c.callbackModalOpen.call(this);}function T(){if(c.callbackModalOpen){c.callbackModalOpen.call(this);
  }a("#"+c.overlayDiv).hide();}a("#"+c.overlayDiv).fadeIn();a(document).on("click."+w,"#"+c.modalCloseIconDiv+", #"+c.overlayDiv,function(){T();});a(document).on("click."+w,"#"+c.modalWindowDiv,function(az){az.stopPropagation();
  });a(document).on("keyup."+w,function(az){if(az.keyCode===27){T();}});}if((c.fullMapStart===true&&N===true)||c.zoomLevel===0){var an={mapTypeId:google.maps.MapTypeId.ROADMAP};
  var X=new google.maps.LatLngBounds();}else{var an={zoom:c.zoomLevel,center:new google.maps.LatLng(r,G),mapTypeId:google.maps.MapTypeId.ROADMAP};}var aw=new google.maps.Map(document.getElementById(c.mapDiv),an);
  var ag=new google.maps.InfoWindow();if((s.length-1)<c.storeLimit-1){l=s.length-1;}else{l=c.storeLimit-1;}if(c.originMarker===true&&c.fullMapStart===false){var W=new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_shadow",new google.maps.Size(40,37),new google.maps.Point(0,0),new google.maps.Point(12,35));
  var aj=new google.maps.LatLng(r,G);var Y=new google.maps.Marker({position:aj,map:aw,icon:"http://maps.google.com/mapfiles/ms/icons/"+c.originpinColor+"-dot.png",shadow:W,draggable:false});
  }for(var ae=0;ae<=l;ae++){var ax=String.fromCharCode("A".charCodeAt(0)+ae);var ar=new google.maps.LatLng(s[ae][2],s[ae][3]);Y=Q(ar,s[ae][1],s[ae][4],ax,s[ae][14]);
  Y.set("id",ae);z[ae]=Y;if((c.fullMapStart===true&&N===true)||c.zoomLevel===0){X.extend(ar);}V(Y);}if((c.fullMapStart===true&&N===true)||c.zoomLevel===0){aw.fitBounds(X);
  }a("#"+c.listDiv+" ul").empty();a(z).each(function(az,aA){var aB=String.fromCharCode("A".charCodeAt(0)+az);var aC=z[az];ap(aC);});function ap(aA){var az=U(aA);
  var aB=e(az);a("#"+c.listDiv+" ul").append(aB);}a(document).on("click."+w,"#"+c.listDiv+" li",function(){var aB=a(this).data("markerid");var aA=z[aB];a("#"+c.listDiv+" li").removeClass("list-focus");
  a("#"+c.listDiv+" li[data-markerid="+aB+"]").addClass("list-focus");aw.panTo(aA.getPosition());var az="left";if(c.bounceMarker===true){aA.setAnimation(google.maps.Animation.BOUNCE);
  setTimeout(function(){aA.setAnimation(null);V(aA,az);},700);}else{V(aA,az);}});a("#"+c.listDiv+" ul li:even").css("background","#"+c.listColor1);a("#"+c.listDiv+" ul li:odd").css("background","#"+c.listColor2);
  function Q(az,aC,aB,aG,aE){var aF=new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld="+aG+"|"+c.pinColor+"|"+c.pinTextColor,new google.maps.Size(21,34),new google.maps.Point(0,0),new google.maps.Point(10,34));
  var aD=new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_shadow",new google.maps.Size(40,37),new google.maps.Point(0,0),new google.maps.Point(12,35));
  if(c.storeLimit>26){var aA=new google.maps.Marker({position:az,map:aw,draggable:false});}else{var aA=new google.maps.Marker({position:az,map:aw,icon:aF,shadow:aD,draggable:false});
  }return aA;}function V(aC,aB){var aA=U(aC);var az=g(aA);if(aB==="left"){ag.setContent(az);ag.open(aC.get("map"),aC);}else{google.maps.event.addListener(aC,"click",function(){ag.setContent(az);
  ag.open(aC.get("map"),aC);a("#"+c.listDiv+" li").removeClass("list-focus");markerId=aC.get("id");a("#"+c.listDiv+" li[data-markerid="+markerId+"]").addClass("list-focus");
  var aD=a("#"+c.listDiv),aE=a("#"+c.listDiv+" li[data-markerid="+markerId+"]");a("#"+c.listDiv).animate({scrollTop:aE.offset().top-aD.offset().top+aD.scrollTop()});
  });}}});}});});}}});};})(jQuery);