function str_repeat(a,b){for(var c=[];b>0;c[--b]=a);return c.join("")}function sprintf(){var a=0,b,c=arguments[a++],d=[],e,f,g,h;while(c){if(e=/^[^\x25]+/.exec(c))d.push(e[0]);else if(e=/^\x25{2}/.exec(c))d.push("%");else{if(!(e=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(c)))throw"Huh ?!";if((b=arguments[e[1]||a++])==null||b==undefined)throw"Too few arguments.";if(/[^s]/.test(e[7])&&typeof b!="number")throw"Expecting number but found "+typeof b;switch(e[7]){case"b":b=b.toString(2);break;case"c":b=String.fromCharCode(b);break;case"d":b=parseInt(b);break;case"e":b=e[6]?b.toExponential(e[6]):b.toExponential();break;case"f":b=e[6]?parseFloat(b).toFixed(e[6]):parseFloat(b);break;case"o":b=b.toString(8);break;case"s":b=(b=String(b))&&e[6]?b.substring(0,e[6]):b;break;case"u":b=Math.abs(b);break;case"x":b=b.toString(16);break;case"X":b=b.toString(16).toUpperCase()}b=/[def]/.test(e[7])&&e[2]&&b>0?"+"+b:b,g=e[3]?e[3]=="0"?"0":e[3].charAt(1):" ",h=e[5]-String(b).length,f=e[5]?str_repeat(g,h):"",d.push(e[4]?b+f:f+b)}c=c.substring(e[0].length)}return d.join("")}function MarkerClusterer(a,b,c){this.extend(MarkerClusterer,google.maps.OverlayView),this.map_=a,this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var d=c||{};this.markerClass=d.styles[0].markerClass,this.shadowClass=d.styles[0].shadowClass,this.gridSize_=d.gridSize||60,this.maxZoom_=d.maxZoom||null,this.styles_=d.styles||[],this.imagePath_=d.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=d.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=d.zoomOnClick||!0,this.setupStyles_(),this.setMap(a),this.prevZoom_=this.map_.getZoom();var e=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var a=e.map_.mapTypes[e.map_.getMapTypeId()].maxZoom,b=e.map_.getZoom();if(b<0||b>a)return;e.prevZoom_!=b&&(e.prevZoom_=e.map_.getZoom(),e.resetViewport())}),google.maps.event.addListener(this.map_,"bounds_changed",function(){e.redraw()}),b&&b.length&&this.addMarkers(b,!1)}function Cluster(a){this.markerClusterer_=a,this.map_=a.getMap(),this.gridSize_=a.getGridSize(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new ClusterIcon(this,a.getStyles(),a.getGridSize())}function ClusterIcon(a,b,c){a.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView),this.styles_=b,this.padding_=c||0,this.cluster_=a,this.center_=null,this.map_=a.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}function parseUri(a){var b=parseUri.options,c=b.parser[b.strictMode?"strict":"loose"].exec(a),d={},e=14;while(e--)d[b.key[e]]=c[e]||"";return d[b.q.name]={},d[b.key[12]].replace(b.q.parser,function(a,c,e){c&&(d[b.q.name][c]=e)}),d}function preloadMarkers(a){app.markers=[app.front_office.public_path+"images/markers/active_cluster.png",app.front_office.public_path+"images/markers/inactive_cluster.png",app.front_office.public_path+"images/markers/active_number.png",app.front_office.public_path+"images/markers/inactive_number.png",app.front_office.public_path+"images/markers/number_shadow.png",app.front_office.public_path+"images/markers/marker.png"],jQuery.loadImages(app.markers,a)}function initializeAppDependentObjects(){jQuery("#lf_search").each(function(){lf.app.searchForm=new lf.SearchForm(this),lf.app.searchForm.populateSelectorFromData(app.front_office.point_of_sales)}),jQuery("#lf_listmap_canvas").each(function(){lf.app.listMap=new lf.ListMap(this),app.mapMarkers={},app.mapMarkers.locateOnMap=function(a){lf.app.listMap.showMarkerByIndex(a)}}),jQuery("#lf_accessmap_canvas").each(function(){var a=lf.app.getApiModule();lf.app.accessMap=new a.Map(this,function(b){lf.app.accessMapMarker=new a.SingleMarker(posMarkerCoordinates),lf.app.accessMapMarker.setMap(b),b.setCenter(posMarkerCoordinates),b.setZoom(b.getPointOfSaleZoomLevel()),b.redraw()})})}function initializeFormObjects(){lf.app.posForms=[],jQuery("#lf_contactform form, #lf_coordinatesrequest form, #lf_newsletter form").each(function(){lf.app.posForms.push(new lf.AjaxSubmissionForm(this))})}var Base=function(){};Base.extend=function(a,b){var c=Base.prototype.extend;Base._prototyping=!0;var d=new this;c.call(d,a),d.base=function(){},delete Base._prototyping;var e=d.constructor,f=d.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==f)this._constructing=!0,e.apply(this,arguments),delete this._constructing;else if(arguments[0]!=null)return(arguments[0].extend||c).call(arguments[0],d)};return f.ancestor=this,f.extend=this.extend,f.forEach=this.forEach,f.implement=this.implement,f.prototype=d,f.toString=this.toString,f.valueOf=function(a){return a=="object"?f:e.valueOf()},c.call(f,b),typeof f.init=="function"&&f.init(),f},Base.prototype={extend:function(a,b){if(arguments.length>1){var c=this[a];if(c&&typeof b=="function"&&(!c.valueOf||c.valueOf()!=b.valueOf())&&/\bbase\b/.test(b)){var d=b.valueOf();b=function(){var a=this.base||Base.prototype.base;this.base=c;var b=d.apply(this,arguments);return this.base=a,b},b.valueOf=function(a){return a=="object"?b:d},b.toString=Base.toString}this[a]=b}else if(a){var e=Base.prototype.extend;!Base._prototyping&&typeof this!="function"&&(e=this.extend||e);var f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;while(i=g[h++])a[i]!=f[i]&&e.call(this,i,a[i]);for(var i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)this.prototype[d]===undefined&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a<arguments.length;a++)typeof arguments[a]=="function"?arguments[a](this.prototype):this.prototype.extend(arguments[a]);return this},toString:function(){return String(this.valueOf())}});var I18n=I18n||{};I18n.defaultLocale="en",I18n.defaultSeparator=".",I18n.locale=null,I18n.PLACEHOLDER=/(?:\{\{|%\{)(.*?)(?:\}\}?)/gm,I18n.isValidNode=function(a,b){var c;return a[b]!==null&&a[b]!==c},I18n.lookup=function(a,b){var c=this.prepareOptions(I18n.translations),d=c[I18n.currentLocale()];b=this.prepareOptions(b);if(!d)return;typeof a=="object"&&(a=a.join(this.defaultSeparator)),b.scope&&(a=b.scope.toString()+this.defaultSeparator+a),a=a.split(this.defaultSeparator);while(a.length>0){var e=a.shift();d=d[e];if(!d)break}return!d&&this.isValidNode(b,"defaultValue")&&(d=b.defaultValue),d},I18n.prepareOptions=function(){var a={},b,c=arguments.length;for(var d=0;d<c;d++){b=arguments[d];if(!b)continue;for(var e in b)this.isValidNode(a,e)||(a[e]=b[e])}return a},I18n.interpolate=function(a,b){b=this.prepareOptions(b);var c=a.match(this.PLACEHOLDER);if(!c)return a;var d,e,f;for(var g=0;d=c[g];g++)f=d.replace(this.PLACEHOLDER,"$1"),e=b[f],this.isValidNode(b,f)||(e="[missing "+d+" value]"),regex=new RegExp(d.replace(/\{/gm,"\\{").replace(/\}/gm,"\\}")),a=a.replace(regex,e);return a},I18n.translate=function(a,b){b=this.prepareOptions(b);var c=this.lookup(a,b);try{return typeof c=="object"?typeof b.count=="number"?this.pluralize(b.count,a,b):c:this.interpolate(c,b)}catch(d){return this.missingTranslation(a)}},I18n.localize=function(a,b){switch(a){case"currency":return this.toCurrency(b);case"number":return a=this.lookup("number.format"),this.toNumber(b,a);case"percentage":return this.toPercentage(b);default:return a.match(/^(date|time)/)?this.toTime(a,b):b.toString()}},I18n.parseDate=function(a){var b,c;b=a.toString().match(/(\d{4})-(\d{2})-(\d{2})(?:[ |T](\d{2}):(\d{2}):(\d{2}))?(Z)?/);if(b){for(var d=1;d<=6;d++)b[d]=parseInt(b[d],10)||0;b[2]-=1,b[7]?c=new Date(Date.UTC(b[1],b[2],b[3],b[4],b[5],b[6])):c=new Date(b[1],b[2],b[3],b[4],b[5],b[6])}else typeof a=="number"?(c=new Date,c.setTime(a)):(c=new Date,c.setTime(Date.parse(a)));return c},I18n.toTime=function(a,b){var c=this.parseDate(b),d=this.lookup(a);return c.toString().match(/invalid/i)?c.toString():d?this.strftime(c,d):c.toString()},I18n.strftime=function(a,b){var c=this.lookup("date");if(!c)return a.toString();c.meridian=c.meridian||["AM","PM"];var d=a.getDay(),e=a.getDate(),f=a.getFullYear(),g=a.getMonth()+1,h=a.getHours(),i=h,j=h>11?1:0,k=a.getSeconds(),l=a.getMinutes(),m=a.getTimezoneOffset(),n=Math.floor(Math.abs(m/60)),o=Math.abs(m)-n*60,p=(m>0?"-":"+")+(n.toString().length<2?"0"+n:n)+(o.toString().length<2?"0"+o:o);i>12?i-=12:i===0&&(i=12);var q=function(a){var b="0"+a.toString();return b.substr(b.length-2)},r=b;return r=r.replace("%a",c.abbr_day_names[d]),r=r.replace("%A",c.day_names[d]),r=r.replace("%b",c.abbr_month_names[g]),r=r.replace("%B",c.month_names[g]),r=r.replace("%d",q(e)),r=r.replace("%-d",e),r=r.replace("%H",q(h)),r=r.replace("%-H",h),r=r.replace("%I",q(i)),r=r.replace("%-I",i),r=r.replace("%m",q(g)),r=r.replace("%-m",g),r=r.replace("%M",q(l)),r=r.replace("%-M",l),r=r.replace("%p",c.meridian[j]),r=r.replace("%S",q(k)),r=r.replace("%-S",k),r=r.replace("%w",d),r=r.replace("%y",q(f)),r=r.replace("%-y",q(f).replace(/^0+/,"")),r=r.replace("%Y",f),r=r.replace("%z",p),r},I18n.toNumber=function(a,b){b=this.prepareOptions(b,this.lookup("number.format"),{precision:3,separator:".",delimiter:",",strip_insignificant_zeros:!1});var c=a<0,d=Math.abs(a).toFixed(b.precision).toString(),e=d.split(".");a=e[0];var f=e[1],g=[];while(a.length>0)g.unshift(a.substr(Math.max(0,a.length-3),3)),a=a.substr(0,a.length-3);var h=g.join(b.delimiter);b.precision>0&&(h+=b.separator+e[1]),c&&(h="-"+h);if(b.strip_insignificant_zeros){var i={separator:new RegExp(b.separator.replace(/\./,"\\.")+"$"),zeros:/0+$/};h=h.replace(i.zeros,"").replace(i.separator,"")}return h},I18n.toCurrency=function(a,b){return b=this.prepareOptions(b,this.lookup("number.currency.format"),this.lookup("number.format"),{unit:"$",precision:2,format:"%u%n",delimiter:",",separator:"."}),a=this.toNumber(a,b),a=b.format.replace("%u",b.unit).replace("%n",a),a},I18n.toHumanSize=function(a,b){var c=1024,d=a,e=0,f,g;while(d>=c&&e<4)d/=c,e+=1;return e===0?(f=this.t("number.human.storage_units.units.byte",{count:d}),g=0):(f=this.t("number.human.storage_units.units."+[null,"kb","mb","gb","tb"][e]),g=d-Math.floor(d)===0?0:1),b=this.prepareOptions(b,{precision:g,format:"%n%u",delimiter:""}),a=this.toNumber(d,b),a=b.format.replace("%u",f).replace("%n",a),a},I18n.toPercentage=function(a,b){return b=this.prepareOptions(b,this.lookup("number.percentage.format"),this.lookup("number.format"),{precision:3,separator:".",delimiter:""}),a=this.toNumber(a,b),a+"%"},I18n.pluralize=function(a,b,c){var d;try{d=this.lookup(b,c)}catch(e){}if(!d)return this.missingTranslation(b);var f;c=this.prepareOptions(c),c.count=a.toString();switch(Math.abs(a)){case 0:f=this.isValidNode(d,"zero")?d.zero:this.isValidNode(d,"none")?d.none:this.isValidNode(d,"other")?d.other:this.missingTranslation(b,"zero");break;case 1:f=this.isValidNode(d,"one")?d.one:this.missingTranslation(b,"one");break;default:f=this.isValidNode(d,"other")?d.other:this.missingTranslation(b,"other")}return this.interpolate(f,c)},I18n.missingTranslation=function(){var a='[missing "'+this.currentLocale(),b=arguments.length;for(var c=0;c<b;c++)a+="."+arguments[c];return a+='" translation]',a},I18n.currentLocale=function(){return I18n.locale||I18n.defaultLocale},I18n.t=I18n.translate,I18n.l=I18n.localize,I18n.p=I18n.pluralize,function(a,b){function e(b,e){var g=i(b,e),h=null,j=null;if(e["printMode"].toLowerCase()=="popup")h=a.open("about:blank","printElementWindow","width=650,height=440,scrollbars=yes"),j=h.document;else{var k="printElement_"+Math.round(Math.random()*99999).toString(),l=c.createElement("IFRAME");d(l).attr({style:e.iframeElementOptions.styleToAdd,id:k,className:e.iframeElementOptions.classNameToAdd,frameBorder:0,scrolling:"no",src:"about:blank"}),c.body.appendChild(l),j=l.contentWindow||l.contentDocument,j.document&&(j=j.document),l=c.frames?c.frames[k]:c.getElementById(k),h=l.contentWindow||l}focus(),j.open(),j.write(g),j.close(),f(h)}function f(a){a&&a.printPage?a.printPage():setTimeout(function(){f(a)},50)}function g(a){var b=d(a);d(":checked",b).each(function(){this.setAttribute("checked","checked")}),d("input[type='text']",b).each(function(){this.setAttribute("value",d(this).val())}),d("select",b).each(function(){var a=d(this);d("option",a).each(function(){a.val()==d(this).val()&&this.setAttribute("selected","selected")})}),d("textarea",b).each(function(){var a=d(this).attr("value");d.browser.mozilla&&this.firstChild?this.firstChild.textContent=a:this.innerHTML=a});var c=d("<div></div>").append(b.clone()).html();return c}function h(){var b=a.location.port?":"+a.location.port:"";return a.location.protocol+"//"+a.location.hostname+b+a.location.pathname}function i(a,b){var e=d(a),f=g(a),i=new Array;i.push("<html><head><title>"+b.pageTitle+"</title>");if(b.overrideElementCSS){if(b.overrideElementCSS.length>0)for(var j=0;j<b.overrideElementCSS.length;j++){var k=b.overrideElementCSS[j];typeof k=="string"?i.push('<link type="text/css" rel="stylesheet" href="'+k+'" >'):i.push('<link type="text/css" rel="stylesheet" href="'+k.href+'" media="'+k.media+'" >')}}else d("link",c).filter(function(){return d(this).attr("rel").toLowerCase()=="stylesheet"}).each(function(){i.push('<link type="text/css" rel="stylesheet" href="'+d(this).attr("href")+'" media="'+d(this).attr("media")+'" >')});return i.push('<base href="'+h()+'" />'),i.push('</head><body style="'+b.printBodyOptions.styleToAdd+'" class="'+b.printBodyOptions.classNameToAdd+'">'),i.push('<div class="'+e.attr("class")+'">'+f+"</div>"),i.push('<script type="text/javascript">function printPage(){focus();print();'+(!d.browser.opera&&!b.leaveOpen&&b["printMode"].toLowerCase()=="popup"?"close();":"")+"}</script>"),i.push("</body></html>"),i.join("")}var c=a.document,d=a.jQuery;d.fn.printElement=function(a){var b=d.extend({},d.fn.printElement.defaults,a);return b["printMode"]=="iframe"&&(d.browser.opera||/chrome/.test(navigator.userAgent.toLowerCase()))&&(b.printMode="popup"),d("[id^='printElement_']").remove(),this.each(function(){var a=d.meta?d.extend({},b,d(this).data()):b;e(d(this),a)})},d.fn.printElement.defaults={printMode:"iframe",pageTitle:"",overrideElementCSS:null,printBodyOptions:{styleToAdd:"padding:10px;margin:10px;",classNameToAdd:""},leaveOpen:!1,iframeElementOptions:{styleToAdd:"border:none;position:absolute;width:0px;height:0px;bottom:0px;left:0px;",classNameToAdd:""}},d.fn.printElement.cssElement={href:"",media:""}}(window),jQuery.fn.inspect=function(a){return jQuery.inspect($(this),a),this},jQuery.inspect=function(a,b){b=b?b:"alert";var c="",d=null,e=null;switch(b){case"console":d=jQuery.inspect._buildText,e=jQuery.inspect._console;break;case"window":d=jQuery.inspect._buildHTML,e=jQuery.inspect._window;break;default:d=jQuery.inspect._buildText,e=jQuery.inspect._alert}switch(typeof a){case"string":c="String: "+a;break;case"number":c="Number: "+a;break;case"boolean":c="Boolean: "+a;break;case"undefined":return alert("Object is undefined"),!0;default:c=jQuery.inspect._parseObject(a,d)}e(c)},jQuery.inspect._parseObject=function(a,b){var c="";for(field in a)try{c+=b(field,a[field])}catch(d){}return c},jQuery.inspect._buildText=function(a,b){return a+":"+b+"\n"},jQuery.inspect._buildHTML=function(a,b){return"<tr><td>"+a+"</td><td>"+b+"</td></tr>\n"},jQuery.inspect._console=function(a){console.log(a)},jQuery.inspect._alert=function(a){alert(a)},jQuery.inspect._window=function(a){a="<html><head>"+jQuery.inspect._windowSettings.styles+"</head><body><table>"+a+"</table></body></html>",dump_window=window.open("","",jQuery.inspect._windowSettings.config),dump_window.document.write(a),dump_window.document.close(),dump_window.focus()},jQuery.inspect._windowSettings=jQuery.extend({width:800,height:600}),jQuery.inspect._windowSettings.styles="<style> \t* { \t  margin: 0; \t} \thtml, body { \t  height: 100%; \t  text-align: center; \t  margin-bottom: 1px; \t  font-family: verdana,helvetica,sans-serif; \t} \ttable { \t\twidth: "+(jQuery.inspect._windowSettings.width-20)+"px; \t\tborder: 1px solid black;   }   td {     vertical-align: top;   } </style>",jQuery.inspect._windowSettings.config="width="+jQuery.inspect._windowSettings.width+",height="+jQuery.inspect._windowSettings.height+",scrollbars=yes,location=no,menubar=no,toolbar=no",jQuery.fn.inspect=function(a){return jQuery.inspect($(this),a),this},jQuery.inspect=function(a,b){b=b?b:"alert";var c="",d=null,e=null;switch(b){case"console":d=jQuery.inspect._buildText,e=jQuery.inspect._console;break;case"window":d=jQuery.inspect._buildHTML,e=jQuery.inspect._window;break;default:d=jQuery.inspect._buildText,e=jQuery.inspect._alert}switch(typeof a){case"string":c="String: "+a;break;case"number":c="Number: "+a;break;case"boolean":c="Boolean: "+a;break;case"undefined":return alert("Object is undefined"),!0;default:c=jQuery.inspect._parseObject(a,d)}e(c)},jQuery.inspect._parseObject=function(a,b){var c="";for(field in a)try{c+=b(field,a[field])}catch(d){}return c},jQuery.inspect._buildText=function(a,b){return a+":"+b+"\n"},jQuery.inspect._buildHTML=function(a,b){return"<tr><td>"+a+"</td><td>"+b+"</td></tr>\n"},jQuery.inspect._console=function(a){console.log(a)},jQuery.inspect._alert=function(a){alert(a)},jQuery.inspect._window=function(a){a="<html><head>"+jQuery.inspect._windowSettings.styles+"</head><body><table>"+a+"</table></body></html>",dump_window=window.open("","",jQuery.inspect._windowSettings.config),dump_window.document.write(a),dump_window.document.close(),dump_window.focus()},jQuery.inspect._windowSettings=jQuery.extend({width:800,height:600}),jQuery.inspect._windowSettings.styles="<style> * { margin: 0; } html, body { height: 100%; text-align: center; margin-bottom: 1px; font-family: verdana,helvetica,sans-serif; } table { width: "+(jQuery.inspect._windowSettings.width-20)+"px; border: 1px solid black; } td { vertical-align: top; } </style>",jQuery.inspect._windowSettings.config="width="+jQuery.inspect._windowSettings.width+",height="+jQuery.inspect._windowSettings.height+",scrollbars=yes,location=no,menubar=no,toolbar=no",jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){return b==0?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;g||(g=e*.3*1.5);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return b<1?-0.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c:h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,b,c,d,e,f){return f==undefined&&(f=1.70158),d*(b/=e)*b*((f+1)*b-f)+c},easeOutBack:function(a,b,c,d,e,f){return f==undefined&&(f=1.70158),d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeInOutBack:function(a,b,c,d,e,f){return f==undefined&&(f=1.70158),(b/=e/2)<1?d/2*b*b*(((f*=1.525)+1)*b-f)+c:d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeInBounce:function(a,b,c,d,e){return d-jQuery.easing.easeOutBounce(a,e-b,0,d,e)+c},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(a,b,c,d,e){return b<e/2?jQuery.easing.easeInBounce(a,b*2,0,d,e)*.5+c:jQuery.easing.easeOutBounce(a,b*2-e,0,d,e)*.5+d*.5+c}}),function(a){jQuery.fn.pngFix=function(a){a=jQuery.extend({blankgif:"blank.gif"},a);var b=navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 5.5")!=-1,c=navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 6.0")!=-1;return jQuery.browser.msie&&(b||c)&&(jQuery(this).find("img[src$=.png]").each(function(){jQuery(this).attr("width",jQuery(this).width()),jQuery(this).attr("height",jQuery(this).height());var a="",b="",c=jQuery(this).attr("id")?'id="'+jQuery(this).attr("id")+'" ':"",d=jQuery(this).attr("class")?'class="'+jQuery(this).attr("class")+'" ':"",e=jQuery(this).attr("title")?'title="'+jQuery(this).attr("title")+'" ':"",f=jQuery(this).attr("alt")?'alt="'+jQuery(this).attr("alt")+'" ':"",g=jQuery(this).attr("align")?"float:"+jQuery(this).attr("align")+";":"",h=jQuery(this).parent().attr("href")?"cursor:hand;":"";this.style.border&&(a+="border:"+this.style.border+";",this.style.border=""),this.style.padding&&(a+="padding:"+this.style.padding+";",this.style.padding=""),this.style.margin&&(a+="margin:"+this.style.margin+";",this.style.margin="");var i=this.style.cssText;b+="<span "+c+d+e+f,b+='style="position:relative;white-space:pre-line;display:inline-block;background:transparent;'+g+h,b+="width:"+jQuery(this).width()+"px;"+"height:"+jQuery(this).height()+"px;",b+="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+jQuery(this).attr("src")+"', sizingMethod='scale');",b+=i+'"></span>',a!=""&&(b='<span style="position:relative;display:inline-block;'+a+h+"width:"+jQuery(this).width()+"px;"+"height:"+jQuery(this).height()+"px;"+'">'+b+"</span>"),jQuery(this).hide(),jQuery(this).after(b)}),jQuery(this).find("*").each(function(){var a=jQuery(this).css("background-image");if(a.indexOf(".png")!=-1){var b=a.split('url("')[1].split('")')[0];jQuery(this).css("background-image","none"),jQuery(this).get(0).runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b+"',sizingMethod='scale')"}}),jQuery(this).find("input[src$=.png]").each(function(){var b=jQuery(this).attr("src");jQuery(this).get(0).runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b+"', sizingMethod='scale');",jQuery(this).attr("src",a.blankgif)})),jQuery}}(jQuery);var FlashDetect=new function(){var a=this;a.installed=!1,a.raw="",a.major=-1,a.minor=-1,a.revision=-1,a.revisionStr="";var b=[{name:"ShockwaveFlash.ShockwaveFlash.7",version:function(a){return c(a)}},{name:"ShockwaveFlash.ShockwaveFlash.6",version:function(a){var b="6,0,21";try{a.AllowScriptAccess="always",b=c(a)}catch(d){}return b}},{name:"ShockwaveFlash.ShockwaveFlash",version:function(a){return c(a)}}],c=function(a){var b=-1;try{b=a.GetVariable("$version")}catch(c){}return b},d=function(a){var b=-1;try{b=new ActiveXObject(a)}catch(c){b={activeXError:!0}}return b},e=function(a){var b=a.split(",");return{raw:a,major:parseInt(b[0].split(" ")[1],10),minor:parseInt(b[1],10),revision:parseInt(b[2],10),revisionStr:b[2]}},f=function(a){var b=a.split(/ +/),c=b[2].split(/\./),d=b[3];return{raw:a,major:parseInt(c[0],10),minor:parseInt(c[1],10),revisionStr:d,revision:g(d)}},g=function(b){return parseInt(b.replace(/[a-zA-Z]/g,""),10)||a.revision};a.majorAtLeast=function(b){return a.major>=b},a.minorAtLeast=function(b){return a.minor>=b},a.revisionAtLeast=function(b){return a.revision>=b},a.versionAtLeast=function(b){var c=[a.major,a.minor,a.revision],d=Math.min(c.length,arguments.length);for(i=0;i<d;i++){if(c[i]>=arguments[i]){if(i+1<d&&c[i]==arguments[i])continue;return!0}return!1}},a.FlashDetect=function(){if(navigator.plugins&&navigator.plugins.length>0){var c="application/x-shockwave-flash",g=navigator.mimeTypes;if(g&&g[c]&&g[c].enabledPlugin&&g[c].enabledPlugin.description){var h=g[c].enabledPlugin.description,i=f(h);a.raw=i.raw,a.major=i.major,a.minor=i.minor,a.revisionStr=i.revisionStr,a.revision=i.revision,a.installed=!0}}else if(navigator.appVersion.indexOf("Mac")==-1&&window.execScript){var h=-1;for(var j=0;j<b.length&&h==-1;j++){var k=d(b[j].name);if(!k.activeXError){a.installed=!0,h=b[j].version(k);if(h!=-1){var i=e(h);a.raw=i.raw,a.major=i.major,a.minor=i.minor,a.revision=i.revision,a.revisionStr=i.revisionStr}}}}}()};FlashDetect.JS_RELEASE="1.0.4",$(document).ready(function(){FlashDetect.versionAtLeast(9)||$(".maps-frame").html("<a href='http://www.adobe.com/go/getflashplayer'><img src='/shared/images/get_flash_player.gif'></a>")});var swfobject=function(){function A(){if(t)return;try{var a=i.getElementsByTagName("body")[0].appendChild(Q("span"));a.parentNode.removeChild(a)}catch(b){return}t=!0;var c=l.length;for(var d=0;d<c;d++)l[d]()}function B(a){t?a():l[l.length]=a}function C(b){if(typeof h.addEventListener!=a)h.addEventListener("load",b,!1);else if(typeof i.addEventListener!=a)i.addEventListener("load",b,!1);else if(typeof h.attachEvent!=a)R(h,"onload",b);else if(typeof h.onload=="function"){var c=h.onload;h.onload=function(){c(),b()}}else h.onload=b}function D(){k?E():F()}function E(){var c=i.getElementsByTagName("body")[0],d=Q(b);d.setAttribute("type",e);var f=c.appendChild(d);if(f){var g=0;(function(){if(typeof f.GetVariable!=a){var b=f.GetVariable("$version");b&&(b=b.split(" ")[1].split(","),y.pv=[parseInt(b[0],10),parseInt(b[1],10),parseInt(b[2],10)])}else if(g<10){g++,setTimeout(arguments.callee,10);return}c.removeChild(d),f=null,F()})()}else F()}function F(){var b=m.length;if(b>0)for(var c=0;c<b;c++){var d=m[c].id,e=m[c].callbackFn,f={success:!1,id:d};if(y.pv[0]>0){var g=P(d);if(g)if(S(m[c].swfVersion)&&!(y.wk&&y.wk<312))U(d,!0),e&&(f.success=!0,f.ref=G(d),e(f));else if(m[c].expressInstall&&H()){var h={};h.data=m[c].expressInstall,h.width=g.getAttribute("width")||"0",h.height=g.getAttribute("height")||"0",g.getAttribute("class")&&(h.styleclass=g.getAttribute("class")),g.getAttribute("align")&&(h.align=g.getAttribute("align"));var i={},j=g.getElementsByTagName("param"),k=j.length;for(var l=0;l<k;l++)j[l].getAttribute("name").toLowerCase()!="movie"&&(i[j[l].getAttribute("name")]=j[l].getAttribute("value"));I(h,i,d,e)}else J(g),e&&e(f)}else{U(d,!0);if(e){var n=G(d);n&&typeof n.SetVariable!=a&&(f.success=!0,f.ref=n),e(f)}}}}function G(c){var d=null,e=P(c);if(e&&e.nodeName=="OBJECT")if(typeof e.SetVariable!=a)d=e;else{var f=e.getElementsByTagName(b)[0];f&&(d=f)}return d}function H(){return!u&&S("6.0.65")&&(y.win||y.mac)&&!(y.wk&&y.wk<312)}function I(b,c,d,e){u=!0,r=e||null,s={success:!1,id:d};var g=P(d);if(g){g.nodeName=="OBJECT"?(p=K(g),q=null):(p=g,q=d),b.id=f;if(typeof b.width==a||!/%$/.test(b.width)&&parseInt(b.width,10)<310)b.width="310";if(typeof b.height==a||!/%$/.test(b.height)&&parseInt(b.height,10)<137)b.height="137";i.title=i.title.slice(0,47)+" - Flash Player Installation";var j=y.ie&&y.win?"ActiveX":"PlugIn",k="MMredirectURL="+h.location.toString().replace(/&/g,"%26")+"&MMplayerType="+j+"&MMdoctitle="+i.title;typeof c.flashvars!=a?c.flashvars+="&"+k:c.flashvars=k;if(y.ie&&y.win&&g.readyState!=4){var l=Q("div");d+="SWFObjectNew",l.setAttribute("id",d),g.parentNode.insertBefore(l,g),g.style.display="none",function(){g.readyState==4?g.parentNode.removeChild(g):setTimeout(arguments.callee,10)}()}L(b,c,d)}}function J(a){if(y.ie&&y.win&&a.readyState!=4){var b=Q("div");a.parentNode.insertBefore(b,a),b.parentNode.replaceChild(K(a),b),a.style.display="none",function(){a.readyState==4?a.parentNode.removeChild(a):setTimeout(arguments.callee,10)}()}else a.parentNode.replaceChild(K(a),a)}function K(a){var c=Q("div");if(y.win&&y.ie)c.innerHTML=a.innerHTML;else{var d=a.getElementsByTagName(b)[0];if(d){var e=d.childNodes;if(e){var f=e.length;for(var g=0;g<f;g++)(e[g].nodeType!=1||e[g].nodeName!="PARAM")&&e[g].nodeType!=8&&c.appendChild(e[g].cloneNode(!0))}}}return c}function L(c,d,f){var g,h=P(f);if(y.wk&&y.wk<312)return g;if(h){typeof c.id==a&&(c.id=f);if(y.ie&&y.win){var i="";for(var j in c)c[j]!=Object.prototype[j]&&(j.toLowerCase()=="data"?d.movie=c[j]:j.toLowerCase()=="styleclass"?i+=' class="'+c[j]+'"':j.toLowerCase()!="classid"&&(i+=" "+j+'="'+c[j]+'"'));var k="";for(var l in d)d[l]!=Object.prototype[l]&&(k+='<param name="'+l+'" value="'+d[l]+'" />');h.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+i+">"+k+"</object>",n[n.length]=c.id,g=P(c.id)}else{var m=Q(b);m.setAttribute("type",e);for(var o in c)c[o]!=Object.prototype[o]&&(o.toLowerCase()=="styleclass"?m.setAttribute("class",c[o]):o.toLowerCase()!="classid"&&m.setAttribute(o,c[o]));for(var p in d)d[p]!=Object.prototype[p]&&p.toLowerCase()!="movie"&&M(m,p,d[p]);h.parentNode.replaceChild(m,h),g=m}}return g}function M(a,b,c){var d=Q("param");d.setAttribute("name",b),d.setAttribute("value",c),a.appendChild(d)}function N(a){var b=P(a);b&&b.nodeName=="OBJECT"&&(y.ie&&y.win?(b.style.display="none",function(){b.readyState==4?O(a):setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b))}function O(a){var b=P(a);if(b){for(var c in b)typeof b[c]=="function"&&(b[c]=null);b.parentNode.removeChild(b)}}function P(a){var b=null;try{b=i.getElementById(a)}catch(c){}return b}function Q(a){return i.createElement(a)}function R(a,b,c){a.attachEvent(b,c),o[o.length]=[a,b,c]}function S(a){var b=y.pv,c=a.split(".");return c[0]=parseInt(c[0],10),c[1]=parseInt(c[1],10)||0,c[2]=parseInt(c[2],10)||0,b[0]>c[0]||b[0]==c[0]&&b[1]>c[1]||b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]?!0:!1}function T(c,d,e,f){if(y.ie&&y.mac)return;var g=i.getElementsByTagName("head")[0];if(!g)return;var h=e&&typeof e=="string"?e:"screen";f&&(v=null,w=null);if(!v||w!=h){var j=Q("style");j.setAttribute("type","text/css"),j.setAttribute("media",h),v=g.appendChild(j),y.ie&&y.win&&typeof i.styleSheets!=a&&i.styleSheets.length>0&&(v=i.styleSheets[i.styleSheets.length-1]),w=h}y.ie&&y.win?v&&typeof v.addRule==b&&v.addRule(c,d):v&&typeof i.createTextNode!=a&&v.appendChild(i.createTextNode(c+" {"+d+"}"))}function U(a,b){if(!x)return;var c=b?"visible":"hidden";t&&P(a)?P(a).style.visibility=c:T("#"+a,"visibility:"+c)}function V(b){var c=/[\\\"<>\.;]/,d=c.exec(b)!=null;return d&&typeof encodeURIComponent!=a?encodeURIComponent(b):b}var a="undefined",b="object",c="Shockwave Flash",d="ShockwaveFlash.ShockwaveFlash",e="application/x-shockwave-flash",f="SWFObjectExprInst",g="onreadystatechange",h=window,i=document,j=navigator,k=!1,l=[D],m=[],n=[],o=[],p,q,r,s,t=!1,u=!1,v,w,x=!0,y=function(){var f=typeof i.getElementById!=a&&typeof i.getElementsByTagName!=a&&typeof i.createElement!=a,g=j.userAgent.toLowerCase(),l=j.platform.toLowerCase(),m=l?/win/.test(l):/win/.test(g),n=l?/mac/.test(l):/mac/.test(g),o=/webkit/.test(g)?parseFloat(g.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,p=!1,q=[0,0,0],r=null;if(typeof j.plugins!=a&&typeof j.plugins[c]==b)r=j.plugins[c].description,r&&(typeof j.mimeTypes==a||!j.mimeTypes[e]||!!j.mimeTypes[e].enabledPlugin)&&(k=!0,p=!1,r=r.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),q[0]=parseInt(r.replace(/^(.*)\..*$/,"$1"),10),q[1]=parseInt(r.replace(/^.*\.(.*)\s.*$/,"$1"),10),q[2]=/[a-zA-Z]/.test(r)?parseInt(r.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof h.ActiveXObject!=a)try{var s=new ActiveXObject(d);s&&(r=s.GetVariable("$version"),r&&(p=!0,r=r.split(" ")[1].split(","),q=[parseInt(r[0],10),parseInt(r[1],10),parseInt(r[2],10)]))}catch(t){}return{w3:f,pv:q,wk:o,ie:p,win:m,mac:n}}(),z=function(){if(!y.w3
)return;(typeof i.readyState!=a&&i.readyState=="complete"||typeof i.readyState==a&&(i.getElementsByTagName("body")[0]||i.body))&&A(),t||(typeof i.addEventListener!=a&&i.addEventListener("DOMContentLoaded",A,!1),y.ie&&y.win&&(i.attachEvent(g,function(){i.readyState=="complete"&&(i.detachEvent(g,arguments.callee),A())}),h==top&&function(){if(t)return;try{i.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}A()}()),y.wk&&function(){if(t)return;if(!/loaded|complete/.test(i.readyState)){setTimeout(arguments.callee,0);return}A()}(),C(A))}(),W=function(){y.ie&&y.win&&window.attachEvent("onunload",function(){var a=o.length;for(var b=0;b<a;b++)o[b][0].detachEvent(o[b][1],o[b][2]);var c=n.length;for(var d=0;d<c;d++)N(n[d]);for(var e in y)y[e]=null;y=null;for(var f in swfobject)swfobject[f]=null;swfobject=null})}();return{registerObject:function(a,b,c,d){if(y.w3&&a&&b){var e={};e.id=a,e.swfVersion=b,e.expressInstall=c,e.callbackFn=d,m[m.length]=e,U(a,!1)}else d&&d({success:!1,id:a})},getObjectById:function(a){if(y.w3)return G(a)},embedSWF:function(c,d,e,f,g,h,i,j,k,l){var m={success:!1,id:d};y.w3&&!(y.wk&&y.wk<312)&&c&&d&&e&&f&&g?(U(d,!1),B(function(){e+="",f+="";var n={};if(k&&typeof k===b)for(var o in k)n[o]=k[o];n.data=c,n.width=e,n.height=f;var p={};if(j&&typeof j===b)for(var q in j)p[q]=j[q];if(i&&typeof i===b)for(var r in i)typeof p.flashvars!=a?p.flashvars+="&"+r+"="+i[r]:p.flashvars=r+"="+i[r];if(S(g)){var s=L(n,p,d);n.id==d&&U(d,!0),m.success=!0,m.ref=s}else{if(h&&H()){n.data=h,I(n,p,d,l);return}U(d,!0)}l&&l(m)})):l&&l(m)},switchOffAutoHideShow:function(){x=!1},ua:y,getFlashPlayerVersion:function(){return{major:y.pv[0],minor:y.pv[1],release:y.pv[2]}},hasFlashPlayerVersion:S,createSWF:function(a,b,c){return y.w3?L(a,b,c):undefined},showExpressInstall:function(a,b,c,d){y.w3&&H()&&I(a,b,c,d)},removeSWF:function(a){y.w3&&N(a)},createCSS:function(a,b,c,d){y.w3&&T(a,b,c,d)},addDomLoadEvent:B,addLoadEvent:C,getQueryParamValue:function(a){var b=i.location.search||i.location.hash;if(b){/\?/.test(b)&&(b=b.split("?")[1]);if(a==null)return V(b);var c=b.split("&");for(var d=0;d<c.length;d++)if(c[d].substring(0,c[d].indexOf("="))==a)return V(c[d].substring(c[d].indexOf("=")+1))}return""},expressInstallCallback:function(){if(u){var a=P(f);a&&p&&(a.parentNode.replaceChild(p,a),q&&(U(q,!0),y.ie&&y.win&&(p.style.display="block")),r&&r(s)),u=!1}}}}();MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m",MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png",MarkerClusterer.prototype.extend=function(a,b){return function(a){for(property in a.prototype)this.prototype[property]=a.prototype[property];return this}.apply(a,[b])},MarkerClusterer.prototype.onAdd=function(){this.setReady_(!0)},MarkerClusterer.prototype.idle=function(){},MarkerClusterer.prototype.draw=function(){},MarkerClusterer.prototype.setupStyles_=function(){for(var a=0,b;b=this.sizes[a];a++)this.styles_.push({url:this.imagePath_+(a+1)+"."+this.imageExtension_,height:b,width:b})},MarkerClusterer.prototype.setStyles=function(a){this.styles_=a},MarkerClusterer.prototype.getStyles=function(){return this.styles_},MarkerClusterer.prototype.isZoomOnClick=function(){return this.zoomOnClick_},MarkerClusterer.prototype.getMarkers=function(){return this.markers_},MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_},MarkerClusterer.prototype.setMaxZoom=function(a){this.maxZoom_=a},MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_||this.map_.mapTypes[this.map_.getMapTypeId()].maxZoom},MarkerClusterer.prototype.calculator_=function(a,b){var c=0,d=a.length,e=d;while(e!==0)e=parseInt(e/10,10),c++;return c=Math.min(c,b),{text:d,index:c}},MarkerClusterer.prototype.setCalculator=function(a){this.calculator_=a},MarkerClusterer.prototype.getCalculator=function(){return this.calculator_},MarkerClusterer.prototype.addMarkers=function(a,b){for(var c=0,d;d=a[c];c++)this.pushMarkerTo_(d);b||this.redraw()},MarkerClusterer.prototype.pushMarkerTo_=function(a){a.setVisible(!1),a.setMap(null),a.isAdded=!1;if(a.draggable){var b=this;google.maps.event.addListener(a,"dragend",function(){a.isAdded=!1,b.resetViewport(),b.redraw()})}this.markers_.push(a)},MarkerClusterer.prototype.addMarker=function(a,b){this.pushMarkerTo_(a),b||this.redraw()},MarkerClusterer.prototype.removeMarker=function(a){var b=-1;if(this.markers_.indexOf)b=this.markers_.indexOf(a);else for(var c=0,d;d=this.markers_[c];c++)if(d==a){b=c;continue}return b==-1?!1:(this.markers_.splice(b,1),a.setVisible(!1),a.setMap(null),this.resetViewport(),this.redraw(),!0)},MarkerClusterer.prototype.fitMapToMarkers=function(){var a=this.getMarkers(),b=new google.maps.LatLngBounds;for(var c=0,d;d=a[c];c++)b.extend(d.getPosition());this.map_.fitBounds(b)},MarkerClusterer.prototype.setReady_=function(a){this.ready_||(this.ready_=a,this.createClusters_())},MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length},MarkerClusterer.prototype.getMap=function(){return this.map_},MarkerClusterer.prototype.setMap=function(a){this.map_=a},MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_},MarkerClusterer.prototype.setGridSize=function(a){this.gridSize_=a},MarkerClusterer.prototype.getExtendedBounds=function(a){var b=this.getProjection(),c=new google.maps.LatLng(a.getNorthEast().lat(),a.getNorthEast().lng()),d=new google.maps.LatLng(a.getSouthWest().lat(),a.getSouthWest().lng()),e=b.fromLatLngToDivPixel(c);e.x+=this.gridSize_,e.y-=this.gridSize_;var f=b.fromLatLngToDivPixel(d);f.x-=this.gridSize_,f.y+=this.gridSize_;var g=b.fromDivPixelToLatLng(e),h=b.fromDivPixelToLatLng(f);return a.extend(g),a.extend(h),a},MarkerClusterer.prototype.isMarkerInBounds_=function(a,b){return b.contains(a.getPosition())},MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport(),this.markers_=[]},MarkerClusterer.prototype.resetViewport=function(){for(var a=0,b;b=this.clusters_[a];a++)b.remove();for(var a=0,c;c=this.markers_[a];a++)c.isAdded=!1,c.setMap(null),c.setVisible(!1);this.clusters_=[]},MarkerClusterer.prototype.redraw=function(){this.createClusters_()},MarkerClusterer.prototype.createClusters_=function(){if(!this.ready_)return;var a=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),b=this.getExtendedBounds(a);for(var c=0,d;d=this.markers_[c];c++){var e=!1;if(!d.isAdded&&this.isMarkerInBounds_(d,b)){for(var f=0,g;g=this.clusters_[f];f++)if(!e&&g.getCenter()&&g.isMarkerInClusterBounds(d)){e=!0,g.addMarker(d);break}if(!e){var g=new Cluster(this);g.addMarker(d),this.clusters_.push(g)}}}},Cluster.prototype.isMarkerAlreadyAdded=function(a){if(this.markers_.indexOf)return this.markers_.indexOf(a)!=-1;for(var b=0,c;c=this.markers_[b];b++)if(c==a)return!0;return!1},Cluster.prototype.addMarker=function(a){return this.isMarkerAlreadyAdded(a)?!1:(this.center_||(this.center_=a.getPosition(),this.calculateBounds_()),this.markers_.length==0?(a.setMap(this.map_),a.setVisible(!0)):this.markers_.length==1&&(this.markers_[0].setMap(null),this.markers_[0].setVisible(!1)),a.isAdded=!0,this.markers_.push(a),this.updateIcon(),!0)},Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_},Cluster.prototype.getBounds=function(){return this.calculateBounds_(),this.bounds_},Cluster.prototype.remove=function(){this.clusterIcon_.remove(),delete this.markers_},Cluster.prototype.getCenter=function(){return this.center_},Cluster.prototype.calculateBounds_=function(){var a=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(a)},Cluster.prototype.isMarkerInClusterBounds=function(a){return this.bounds_.contains(a.getPosition())},Cluster.prototype.getMap=function(){return this.map_},Cluster.prototype.updateIcon=function(){var a=this.map_.getZoom(),b=this.markerClusterer_.getMaxZoom();if(a>b){for(var c=0,d;d=this.markers_[c];c++)d.setMap(this.map_),d.setVisible(!0);return}if(this.markers_.length<2){this.clusterIcon_.hide();return}var e=this.markerClusterer_.getStyles().length,f=this.markerClusterer_.getCalculator()(this.markers_,e);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.setSums(f),this.clusterIcon_.show()},ClusterIcon.prototype.triggerClusterClick=function(){var a=this.cluster_.getMarkerClusterer();a.isZoomOnClick()&&(this.map_.panTo(this.cluster_.getCenter()),this.map_.setZoom(this.map_.getZoom()+1))},ClusterIcon.prototype.onAdd=function(){this.div_=document.createElement("DIV"),this.shadow_=document.createElement("DIV");if(this.visible_){var a=this.getPosFromLatLng_(this.center_),b=this.createCss(a);this.div_.setAttribute("class",this.styles_[0].markerClass),this.div_.setAttribute("className",this.styles_[0].markerClass),this.div_.innerHTML="x"+this.sums_.text,this.div_.style.cssText=b,this.shadow_.setAttribute("class",this.styles_[0].shadowClass),this.shadow_.setAttribute("className",this.styles_[0].shadowClass),this.shadow_.style.cssText=b}var c=this.getPanes();c.overlayImage.appendChild(this.shadow_),c.overlayImage.appendChild(this.div_);var d=this;google.maps.event.addDomListener(this.div_,"click",function(){d.triggerClusterClick()})},ClusterIcon.prototype.getPosFromLatLng_=function(a){var b=this.getProjection().fromLatLngToDivPixel(a);return b.x-=parseInt(this.width_/2,10),b.y-=parseInt(this.height_/2,10),b},ClusterIcon.prototype.draw=function(){if(this.visible_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.top=a.y+"px",this.div_.style.left=a.x+"px"}},ClusterIcon.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.shadow_&&(this.shadow_.style.display="none"),this.visible_=!1},ClusterIcon.prototype.show=function(){if(this.div_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(a),this.div_.style.display="",this.div_.setAttribute("class",this.styles_[0].markerClass),this.div_.setAttribute("className",this.styles_[0].markerClass)}if(this.shadow_){var a=this.getPosFromLatLng_(this.center_);this.shadow_.style.cssText=this.createCss(a),this.shadow_.style.display="",this.shadow_.setAttribute("class",this.styles_[0].shadowClass),this.shadow_.setAttribute("className",this.styles_[0].shadowClass)}this.visible_=!0},ClusterIcon.prototype.remove=function(){this.setMap(null)},ClusterIcon.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)},ClusterIcon.prototype.setSums=function(a){this.sums_=a,this.text_=a.text,this.index_=a.index,this.div_&&(this.div_.innerHTML=a.text),this.useStyle()},ClusterIcon.prototype.useStyle=function(){var a=Math.max(0,this.sums_.index-1);a=Math.min(this.styles_.length-1,a);var b=this.styles_[a];this.url_=b.url,this.height_=b.height,this.width_=b.width,this.anchor=b.opt_anchor,this.textSize_=b.opt_textSize},ClusterIcon.prototype.setCenter=function(a){this.center_=a},ClusterIcon.prototype.createCss=function(a){var b=[];return b.push(" position:absolute; cursor:pointer; top:"+a.y+"px; left:"+a.x+"px;"),b.join("")},window.MarkerClusterer=MarkerClusterer,MarkerClusterer.prototype.addMarker=MarkerClusterer.prototype.addMarker,MarkerClusterer.prototype.addMarkers=MarkerClusterer.prototype.addMarkers,MarkerClusterer.prototype.clearMarkers=MarkerClusterer.prototype.clearMarkers,MarkerClusterer.prototype.getCalculator=MarkerClusterer.prototype.getCalculator,MarkerClusterer.prototype.getGridSize=MarkerClusterer.prototype.getGridSize,MarkerClusterer.prototype.getMap=MarkerClusterer.prototype.getMap,MarkerClusterer.prototype.getMarkers=MarkerClusterer.prototype.getMarkers,MarkerClusterer.prototype.getMaxZoom=MarkerClusterer.prototype.getMaxZoom,MarkerClusterer.prototype.getStyles=MarkerClusterer.prototype.getStyles,MarkerClusterer.prototype.getTotalClusters=MarkerClusterer.prototype.getTotalClusters,MarkerClusterer.prototype.getTotalMarkers=MarkerClusterer.prototype.getTotalMarkers,MarkerClusterer.prototype.redraw=MarkerClusterer.prototype.redraw,MarkerClusterer.prototype.removeMarker=MarkerClusterer.prototype.removeMarker,MarkerClusterer.prototype.resetViewport=MarkerClusterer.prototype.resetViewport,MarkerClusterer.prototype.setCalculator=MarkerClusterer.prototype.setCalculator,MarkerClusterer.prototype.setGridSize=MarkerClusterer.prototype.setGridSize,MarkerClusterer.prototype.onAdd=MarkerClusterer.prototype.onAdd,MarkerClusterer.prototype.draw=MarkerClusterer.prototype.draw,MarkerClusterer.prototype.idle=MarkerClusterer.prototype.idle,ClusterIcon.prototype.onAdd=ClusterIcon.prototype.onAdd,ClusterIcon.prototype.draw=ClusterIcon.prototype.draw,ClusterIcon.prototype.onRemove=ClusterIcon.prototype.onRemove,function(a){var b=[];a.loadImages=function(c,d){c instanceof Array||(c=[c]);var e=c.length,f=0;for(var g=e;g--;){var h=document.createElement("img");h.onload=function(){f++,f>=e&&a.isFunction(d)&&d()},h.src=c[g],b.push(h)}}}(jQuery),parseUri.options={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},lf={},lf.maps={},lf.maps.google={},lf.maps.viamichelin={},lf.app={},gui={},Class=function(){},Class.getGlobalObject=function(){return function(){return this}.call(null)},Class.mixin=function(a,b){b.__mixing&&b.__mixing(a);var c=Class.instanceMethods(b.prototype);for(var d=0;d<c.length;d+=1)a.prototype[c[d]]=b.prototype[c[d]];b.__mixed&&b.__mixed(a)},Class.instanceVariables=function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&typeof a[c]!="function"&&b.push(c);return b},Class.instanceMethods=function(a){var b=[],c=a.constructor===Function?a:a.constructor.prototype;for(var d in c)c.hasOwnProperty(d)&&typeof c[d]=="function"&&b.push(d);return b},Class.duplicate=function(a){var b=a instanceof Array?[]:{};for(var c in a)a[c]&&typeof a[c]=="object"?b[c]=Class.duplicate(a[c]):b[c]=a[c];return b},Class.resolvePath=function(a,b){b=b||Class.getGlobalObject();var c=a.split("."),d=b;for(var e=0;e<c.length;e+=1){d=d[c[e]];if(typeof d=="undefined")throw new Error("component '%s' in path '%s' is not defined".format(c[e],a))}return d},Delegatable=function(){},Delegatable.prototype.callDelegateMethod=function(a,b,c){return this.delegate&&this.delegate[a]?this.delegate[a].apply(this.delegate,b):c},gui.Backdrop=Base.extend({constructor:function(){var a=jQuery("body");this.__background=jQuery("<div/>").addClass("backdrop").hide().appendTo(a),this.__indicator=jQuery("<div/>").addClass("backdrop_indicator").hide().appendTo(a),this.__text=jQuery("<div/>").addClass("text").appendTo(this.__indicator);var b=this;jQuery(window).resize(function(){b.__resize()}).trigger("resize")},__resize:function(){var a=jQuery(window).height(),b=jQuery(window).width(),c=this.__indicator.outerHeight(),d=this.__indicator.outerWidth(),e=a/2-c/2,f=b/2-d/2,g=a/2+20,h=b/2-this.__text.width()/2;this.__background.css({width:b,height:a}),this.__indicator.css({top:e,left:f}),this.__text.css({top:g,left:h})},__showWithIndicator:function(a){a=a?a:0,this.__background.fadeIn(a),this.__indicator.fadeIn(a)},__showWithoutIndicator:function(a){a=a?a:0,this.__indicator.hide(),this.__background.fadeIn(a)},hide:function(a){a=a?a:0,this.__background.fadeOut(a),this.__indicator.fadeOut(a)},__setIndicator:function(a,b){this.__indicator.removeClass("loading failure success"),this.__indicator.addClass(a),this.__text.html(b)},showWithoutIndicator:function(a){this.__showWithoutIndicator(a)},showLoadingIndicator:function(a){this.__setIndicator("loading",I18n.t("bridge.index.loading")),this.__showWithIndicator(a),this.__resize()},showFailureIndicator:function(a,b){this.__setIndicator("failure",a),this.__showWithIndicator(b),this.__resize()},showSuccessIndicator:function(a,b){this.__setIndicator("success",a),this.__showWithIndicator(b),this.__resize()}},{sharedInstance:function(){return gui.Backdrop.__sharedInstance||(gui.Backdrop.__sharedInstance=new gui.Backdrop),gui.Backdrop.__sharedInstance}}),lf.app.uniqueId=function(){var a="__lfid_"+lf.app.uniqueId.__next;return lf.app.uniqueId.__next+=1,a},lf.app.uniqueId.__next=0,lf.app.getApiModule=function(){var a=jQuery("script#lf_mapping_api").attr("src"),b="";switch(parseUri(a).host){case"maps.google.com":b="google";break;case"apijsv2.viamichelin.com":b="viamichelin";break;default:b="google"}return lf.maps[b]},lf.maps.Bounds=Base.extend({constructor:function(a,b){this.ne={lat:b.lat,lng:b.lng},this.sw={lat:a.lat,lng:a.lng}},contains:function(a){var b=this.sw.lat<=a.lat&&a.lat<=this.ne.lat,c=this.sw.lng<=a.lng&&a.lng<=this.ne.lng;return b&&c},extend:function(a){a.lat>this.ne.lat&&(this.ne.lat=a.lat),a.lat<this.sw.lat&&(this.sw.lat=a.lat),a.lng>this.ne.lng&&(this.ne.lng=a.lng),a.lng<this.sw.lng&&(this.sw.lng=a.lng)},getCenterPoint:function(){var a=this.ne.lat-this.sw.lat,b=this.ne.lng-this.sw.lng,c=this.sw.lat+a*.5,d=this.sw.lng+b*.5;return{lat:c,lng:d}},getNorthWest:function(){return{lat:this.ne.lat,lng:this.sw.lng}},getSouthEast:function(){return{lat:this.sw.lat,lng:this.ne.lng}}}),lf.maps.Cluster=Base.extend({constructor:function(a){this.markerClusterer=a,this.map=this.markerClusterer.getMap(),this.center=null,this.markers=[],this.bounds=null,this.clusterIcon=new(a.getClusterIconClass())({lat:0,lng:0});var b=this;this.clusterIcon.bind("click",function(){b.map.fitBounds(b.getMarkerBounds())})},addMarker:function(a){return this.isMarkerAlreadyAdded(a)?!1:(this.center||(this.center=a.getPosition(),this.calculateBounds()),this.markers.length===0?(a.setMap(this.map),a.setVisible(!0)):(this.markers[0].setMap(null),this.markers[0].setVisible(!1)),a.isAdded=!0,this.markers.push(a),this.updateIcon(),!0)},getCenter:function(){return this.center},getMarkerBounds:function(){if(this.markers.length===0)return new lf.maps.Bounds({lat:0,lng:0},{lat:0,lng:0});var a=this.markers[0].getPosition(),b=new lf.maps.Bounds(a,a);for(var c=0;c<this.markers.length;c+=1)b.extend(this.markers[c].getPosition());return b},isMarkerAlreadyAdded:function(a){if(this.markers.indexOf)return this.markers.indexOf(a)!==-1;for(var b=0;b<this.markers.length;b+=1)if(this.markers[b]===a)return!0;return!1},isMarkerInClusterBounds:function(a){return this.bounds.contains(a.getPosition())},remove:function(){this.clusterIcon&&this.clusterIcon.setMap(null),delete this.markers},setPositioningMarkerVisible:function(a){for(var b=0;b<this.markers.length;b+=1)this.markers[b].setPositioningMarkerVisible(a);this.clusterIcon&&this.clusterIcon.setPositioningMarkerVisible(a)},calculateBounds:function(){var a=new lf.maps.Bounds(this.center,this.center);this.bounds=this.markerClusterer.getExtendedBounds(a)},updateIcon:function(){var a=this.map.getZoom(),b=this.markerClusterer.getMaxZoom();if(a>b){for(var c=0;c<this.markers.length;c+=1)this.markers[c].setMap(this.map),this.markers[c].setVisible(!0);return}if(this.markers.length<2){this.clusterIcon.setVisible(!1),this.clusterIcon.setMap(null);return}this.clusterIcon.setPosition(this.center),this.clusterIcon.setLabel(this.markers.length),this.clusterIcon.setVisible(!0),this.clusterIcon.setMap(this.map)}}),lf.maps.MarkerClusterer=Base.extend({constructor:function(a,b){this.map=a,this.markers=[],this.clusters=[],this.gridSize=60,this.maxZoom=null,this.ready=!1,this.prevZoom=this.map.getZoom(),this.clusterIconClass=b,this.bindEvents()},addMarkers:function(a,b){for(var c=0;c<a.length;c+=1)this.addMarker(a[c]);b||this.redraw()},addMarker:function(a,b){this.pushMarker(a),b||this.redraw()},clearMarkers:function(){this.resetViewport(),this.markers=[]},getClusterIconClass:function(){return this.clusterIconClass},getExtendedBounds:function(a){var b={lat:a.ne.lat,lng:a.ne.lng},c={lat:a.sw.lat,lng:a.sw.lng},d=this.map.getPixelForLatLng(b);d.x+=this.gridSize,d.y-=this.gridSize;var e=this.map.getPixelForLatLng(c);e.x-=this.gridSize,e.y+=this.gridSize;var f=this.map.getLatLngForPixel(d),g=this.map.getLatLngForPixel(e);return new lf.maps.Bounds(g,f)},getGridSize:function(){return this.gridSize},getMap:function(){return this.map},getMarkers:function(){return this.markers},getMarkerBounds:function(){if(this.markers.length===0)return new lf.maps.Bounds({lat:0,lng:0},{lat:0,lng:0});var a=this.markers[0].getPosition(),b=new lf.maps.Bounds(a,a);for(var c=1;c<this.markers.length;c+=1)b.extend(this.markers[c].getPosition());return b},getMaxZoom:function(){return this.maxZoom||this.map.getMaxZoom()},getTotalClusters:function(){return this.clusters.length},getTotalMarkers:function(){return this.markers},redraw:function(){this.createClusters()},resetViewport:function(){var a;for(a=0;a<this.clusters.length;a+=1)this.clusters[a].remove();for(a=0;a<this.markers.length;a+=1)this.markers[a].isAdded=!1,this.markers[a].setMap(null),this.markers[a].setVisible(!1);this.clusters=[]},setGridSize:function(a){this.gridSize=a},setMap:function(a){this.map=a},setMaxZoom:function(a){this.maxZoom=a},setPositioningMarkerVisible:function(a){for(var b=0;b<this.clusters.length;b+=1)this.clusters[b].setPositioningMarkerVisible(a)},bindEvents:function(){var a=this;this.map.bind("zoom_changed",function(){var b=a.map.getMaxZoom(),c=a.map.getZoom();if(c<0||c>b)return;a.prevZoom!==c&&(a.prevZoom=a.map.getZoom(),a.resetViewport())}),this.map.bind("bounds_changed",function(){a.redraw()}),this.map.bind("tilesloaded",function(){if(a.ready)return;a.ready=!0,a.createClusters()})},createClusters:function(){if(!this.ready)return;var a=this.getExtendedBounds(this.map.getViewportBounds());for(var b=0;b<this.markers.length;b+=1){var c=this.markers[b];!c.isAdded&&a.contains(c.getPosition())&&this.insertMarkerIntoClusters(c)}},insertMarkerIntoClusters:function(a){for(var b=0;b<this.clusters.length;b+=1){var c=this.clusters[b];if(c.getCenter()&&c.isMarkerInClusterBounds(a))return c.addMarker(a),c}var d=new lf.maps.Cluster(this);return d.addMarker(a),this.clusters.push(d),d},pushMarker:function(a){a.setVisible(!1),a.setMap(null),a.isAdded=!1,this.markers.push(a)}}),lf.maps.google.Map=Base.extend({constructor:function(a,b){this.loadedCallback=b;var c=[google.maps.MapTypeId.ROADMAP,google.maps.MapTypeId.HYBRID];this.map=new google.maps.Map(a,{zoom:13,center:new google.maps.LatLng(0,0),mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:!1,mapTypeControlOptions:{mapTypeIds:c,style:google.maps.MapTypeControlStyle.HORIZONTAL_BAR}});var d=this;this.overlay=new google.maps.OverlayView,this.overlay.setMap(this.map),this.overlay.onAdd=function(){d.mapLoaded()},this.overlay.draw=function(){}},fitBounds:function(a,b){var c=new google.maps.LatLng(a.sw.lat,a.sw.lng),d=new google.maps.LatLng(a.ne.lat,a.ne.lng),e=new google.maps.LatLngBounds(c,d);b&&google.maps.event.addListenerOnce(this.map,"bounds_changed",function(){this.getZoom()>b&&this.setZoom(b)}),this.map.fitBounds(e)},redraw:function(){google.maps.event.trigger(this.map,"resize")},getCenter:function(){var a=this.map.getCenter();return{lat:a.lat(),lng:a.lng()}},getZoom:function(){return this.map.getZoom()},getMaxZoom:function(){return this.map.mapTypes[this.map.getMapTypeId()].maxZoom},getPointOfSaleZoomLevel:function(){return 13},getPixelForLatLng:function(a){var b=this.overlay.getProjection();if(!b)return{x:0,y:0};var c=new google.maps.LatLng(a.lat,a.lng),d=b.fromLatLngToDivPixel(c);return{x:d.x,y:d.y}},getLatLngForPixel:function(a){var b=this.overlay.getProjection();if(!b)return{lat:0,lng:0};var c=new google.maps.Point(a.x,a.y),d=b.fromDivPixelToLatLng(c);return{lat:d.lat(),lng:d.lng()}},getViewportBounds:function(){var a=this.map.getBounds(),b=a.getNorthEast(),c=a.getSouthWest(),d={lat:c.lat(),lng:c.lng()},e={lat:b.lat(),lng:b.lng()};return new lf.maps.Bounds(d,e)},setCenter:function(a){this.map.setCenter(new google.maps.LatLng(a.lat,a.lng))},setZoom:function(a){this.map.setZoom(a)},bind:function(a,b){google.maps.event.addListener(this.map,a,b)},mapLoaded:function(){if(this.loaded)return;this.loaded=!0,this.loadedCallback&&this.loadedCallback.call(null,this)}}),lf.maps.google.Overlay=Base.extend({constructor:function(a,b){this.setLabel(a||""),this.setPosition(b),this.build()},setMap:function(a){this.map=a,this.overlay&&this.overlay.setMap(a)},setLabel:function(a){this.label=a,this.overlay&&this.icon.html(a)},setPosition:function(a){this.position=a,this.overlay&&this.ready&&this.draw()},setVisible:function(a){a?this.root.show():this.root.hide()},setActive:function(a){this.isActive=a,this.overlay&&(this.icon.attr("class",this.getIconClass()),this.isActive?this.icon.css("z-index",1e3):this.icon.css("z-index","auto"))},setStyle:function(a){this.style=a,this.overlay&&(this.icon.attr("class",this.getIconClass()),this.shadow.attr("class",this.getShadowClass()))},getShadowClass:function(){return this.style+"_shadow"},getIconClass:function(){return(this.isActive?"active":"inactive")+"_"+this.style},bind:function(){this.icon.bind.apply(this.icon,arguments)},build:function(){this.overlay=new google.maps.OverlayView,this.root=jQuery("<span/>").addClass("lf_marker").css("position","absolute"),this.shadow=jQuery("<span/>").addClass(this.getShadowClass()).appendTo(this.root),this.icon=jQuery("<span/>").addClass(this.getIconClass()).css("cursor","pointer").html(this.label).appendTo(this.root);var a=this;this.overlay.onAdd=function(){a.onAdd()},this.overlay.draw=function(){a.draw()},this.overlay.onRemove=function(){a.onRemove()}},onAdd:function(){var a=this.overlay.getPanes();jQuery.browser.msie&&parseFloat(jQuery.browser.version)===6?this.root.appendTo(a.floatPane):this.root.appendTo(a.floatShadow),this.ready=!0},draw:function(){this.createPrintIcon();var a=this.overlay.getProjection().fromLatLngToDivPixel(this.position);this.root.css({left:a.x-this.root.width()/2,top:a.y-this.root.height()})},onRemove:function(){this.root.detach(),this.ready=!1},createPrintIcon:function(){if(this.printIcon)return;var a=this.icon.css("background-image").match(/^url\((.+)\)$/);a&&(this.printIcon=jQuery("<img/>").attr("src",a[1].replace(/[\"]/g,"")).appendTo(this.root))}}),lf.maps.google.FrontOfficeMarker=Base.extend({constructor:function(a){this.setPosition(a),this.build()},showText:function(a){this.popup||(this.popup=new google.maps.InfoWindow),this.popup.setContent("<div class='lf_mapbubble_text' style='overflow-y:hidden;padding-right:15px;'>"+a+"</div>"),this.popup.open(this.marker.getMap(),this.marker)},hideText:function(){this.popup&&this.popup.close()},setMap:function(a){this.map=a,this.marker&&(this.map?(this.marker.setMap(this.map.map),this.overlay.setMap(this.map.map)):(this.marker.setMap(null),this.overlay.setMap(null)))},setLabel:function(a){this.label=a,this.marker&&this.overlay.setLabel(this.label)},setPosition:function(a){this.latlng=new google.maps.LatLng(a.lat,a.lng),this.marker&&(this.marker.setPosition(this.latlng),this.overlay.setPosition(this.latlng))},getPosition:function(){var a=this.marker.getPosition();return{lat:a.lat(),lng:a.lng()}},setVisible:function(a){this.overlay.setVisible(a)},setPositioningMarkerVisible:function(a){this.marker.setVisible(a)},bind:function(){this.overlay.bind.apply(this.overlay,arguments)},build:function(){this.marker=new google.maps.Marker({flat:!0,position:this.latlng,visible:!1}),this.overlay=new lf.maps.google.Overlay(this.label,this.latlng)}}),lf.maps.google.InactiveMarker=lf.maps.google.FrontOfficeMarker.extend({constructor:function(a){this.base(a),this.overlay.setActive(!1),this.overlay.setStyle("number")}}),lf.maps.google.NumberMarker=lf.maps.google.FrontOfficeMarker.extend({constructor:function(a,b){this.base(b),this.number=a,this.overlay.setLabel(a),this.overlay.setActive(!0),this.overlay.setStyle("number")}}),lf.maps.google.ClusterMarker=lf.maps.google.FrontOfficeMarker.extend({constructor:function(a){this.base(a),this.overlay.setLabel(0),this.overlay.setActive(!0),this.overlay.setStyle("cluster")},setLabel:function(a){this.base("x "+a)}}),lf.maps.google.InactiveClusterMarker=lf.maps.google.FrontOfficeMarker.extend({constructor:function(a){this.base(a),this.overlay.setLabel(0),this.overlay.setActive(!1),this.overlay.setStyle("cluster")},setLabel:function(a){this.base("x "+a)}}),lf.maps.google.SingleMarker=lf.maps.google.FrontOfficeMarker.extend({constructor:function(a){this.base(a),this.overlay.setActive(!0),this.overlay.setStyle("current")}}),lf.maps.google.PolygonLine=Base.extend({constructor:function(a,b){this.setMap(a),this.setColor(b.color||{r:1,g:0,b:0,a:1}),this.line=new google.maps.Polyline(this.getGoogleMapOptions())},setMap:function(a){this.map=a,this.line&&this.line.setMap(this.map)},getMap:function(){return this.map},setColor:function(a){this.color=a,this.line&&this.line.setOptions(this.getGoogleMapOptions())},getColor:function(){return this.color},setPoints:function(a){this.points=a;if(this.line){var b=[];for(var c=0;c<a.length;c+=1)b.push(new google.maps.LatLng(a[c].lat,a[c].lng));this.line.setPath(b)}},getPoints:function(){return this.points},getGoogleMapOptions:function(){return{map:this.map.map,strokeColor:this.getRGBString(),strokeOpacity:this.getColor().a}},getRGBString:function(){function a(a,b){var c=""+a;while(c.length<b)c="0"+c;return c}var b=parseInt(this.color.r*255,10).toString(16),c=parseInt(this.color.g*255,10).toString(16),d=parseInt(this.color.b*255,10).toString(16);return sprintf("#%s%s%s",a(b,2),a(c,2),a(d,2))}}),lf.maps.google.DirectionsService=Base.extend({constructor:function(a,b,c){this.delegate=a,this.origin=b,this.destination=c,this.service=new google.maps.DirectionsService},process:function(){var a=this;this.service.route({destination:this.destination,origin:this.origin,travelMode:google.maps.DirectionsTravelMode.DRIVING},function(b,c){if(c!==google.maps.DirectionsStatus.OK||!a.resultMatchesGeolocation(b)){a.callDelegateMethod("didReceiveFailingDirections",[a]);return}var d=a.convertResult(b);a.callDelegateMethod("didReceiveSuccessfulDirections",[a,d])})},resultMatchesGeolocation:function(a){var b=a.routes[0].legs[0].end_location;return this.delegate.resultMatchesGeolocation(b.lat(),b.lng())},convertResult:function(a){var b=a.routes[0];if(b.legs.length!==1){this.callDelegateMethod("didReceiveFailingDirections",[this]);return}var c=b.legs[0],d=[],e=[];for(var f=0;f<c.steps.length;f+=1){var g=c.steps[f];for(var h=0;h<g.path.length;h+=1){var i=g.path[h];e.push({lat:i.lat(),lng:i.lng()})}d.push({description:g.instructions,distance:g.distance.text})}return{copyrights:b.copyrights,estimatedDistance:c.distance.text,estimatedDuration:c.duration.text,steps:d,points:e}}}),lf.maps.google.DirectionsService.routeForPoint=function(a,b,c){var d=[c.lat,c.lng].join(",");return new lf.maps.google.DirectionsService(a,b,d)},lf.maps.google.DirectionsService.routeForAddress=function(a,b,c){return new lf.maps.google.DirectionsService(a,b,c)},Class.mixin(lf.maps.google.DirectionsService,Delegatable),lf.maps.viamichelin.Map=Base.extend({constructor:function(a,b){this.root=jQuery(a),this.loadedCallback=b,this.callbacks={};var c=this;this.center={lat:0,lng:0};var d=VMLaunch;d("ViaMichelin.Api.Map",{container:a,center:{coords:{lat:0,lon:0}},scrollwheel:!1,zoom:13},{onSuccess:function(a){c.map=a,c.mapLoaded()},onError:function(a){console&&console.error&&console.error(a.errorMsg,a)},onZoomChanged:function(){c.zoomLevelChanged()},onMapCenterChanged:function(a){c.centerPointChanged()}})},fitBounds:function(a,b){var c=a.getNorthWest(),d=a.getSouthEast(),e={};e.no={lat:c.lat,lon:c.lng},e.se={lat:d.lat,lon:d.lng},this.map.drawMap({geoBoundaries:e}),this.center=a.getCenterPoint(),this.centerPointChanged(),this.zoomLevelChanged()},redraw:function(){var a=this.root.width(),b=this.root.height();this.map.resizeTo(a,b),this.root.css({height:"",width:""})},getCenter:function(){return this.center},getZoom:function(){return this.map.getZoomLevel()},getMaxZoom:function(){return 16},getPointOfSaleZoomLevel:function(){return 13},getPixelForLatLng:function(a){var b={lat:a.lat,lon:a.lng},c=this.map.convertGeoToPixel(b);return{x:c.x,y:c.y}},getLatLngForPixel:function(a){var b=this.map.convertPixelToGeo(a);return{lat:b.lat,lng:b.lon}},getViewportBounds:function(){var a=this.getDestinationSouthWest(),b=this.getDestinationNorthEast();return new lf.maps.Bounds(a,b)},setCenter:function(a){this.center=a,this.map.moveTo({lat:a.lat,lon:a.lng}),this.centerPointChanged()},setZoom:function(a){this.map.setZoomLevel(a)},bind:function(a,b){typeof this.callbacks[a]=="undefined"&&
(this.callbacks[a]=[]),this.callbacks[a].push(b)},getDestinationNorthEast:function(){var a=this.getViewportLatLngDelta(),b=this.center.lat+a.lat/2,c=this.center.lng+a.lng/2;return{lat:b,lng:c}},getDestinationSouthWest:function(){var a=this.getViewportLatLngDelta(),b=this.center.lat-a.lat/2,c=this.center.lng-a.lng/2;return{lat:b,lng:c}},getViewportLatLngDelta:function(){var a=this.map.getSouthWest(),b=this.map.getNorthEast(),c=b.lat-a.lat,d=b.lon-a.lon;return{lat:c,lng:d}},centerPointChanged:function(){this.notifyCallbacksForEvent("bounds_changed")},zoomLevelChanged:function(){this.notifyCallbacksForEvent("zoom_changed"),this.notifyCallbacksForEvent("bounds_changed")},mapLoaded:function(){this.loadedCallback&&this.loadedCallback.call(null,this),this.notifyCallbacksForEvent("tilesloaded")},notifyCallbacksForEvent:function(a){var b=this.callbacks[a];if(!b)return;for(var c=0;c<b.length;c+=1)b[c]()}}),lf.maps.viamichelin.FrontOfficeMarker=Base.extend({constructor:function(a){this.callbacks={},this.isAdded=!1,this.marker=new ViaMichelin.Api.Map.Marker(this.getMarkerSettings(a)),this.setPosition(a);var b=this;this.marker.addEventListener("onExpandOpen",function(){b.bubbleOpened()}),this.marker.addEventListener("onClick",function(){b.markerClicked()})},showText:function(a){this.bubbleId&&(this.bubbleText=a,this.marker.openExpandLayer())},hideText:function(){this.bubbleId&&this.marker.closeExpandLayer()},setMap:function(a){if(this.map===a)return;this.isAdded&&this.detachMarker(),this.map=a,this.map&&this.attachMarker()},setLabel:function(a){this.labelText=a,this.marker&&this.labelText&&(this.labelId?jQuery("#"+this.labelId).html(this.labelText):(this.labelId=lf.app.uniqueId(),this.marker.setOverlayText("<span id='"+this.labelId+"'>"+this.labelText+"</span>")))},setPosition:function(a){this.position=a,this.marker&&this.marker.setPosition({lat:a.lat,lon:a.lng})},getPosition:function(){return this.position},setVisible:function(a){this.marker&&this.marker.setVisibility(a)},setPositioningMarkerVisible:function(a){},bind:function(a,b,c){typeof this.callbacks[a]=="undefined"&&(this.callbacks[a]=[]),arguments.length===2&&(c=arguments[1],b=null),this.callbacks[a].push([c,b])},getMarkerSettings:function(a){var b=Class.duplicate(this.getSettingsObject());return b.overlayText.text="",{coords:{lat:a.lat,lon:a.lng},icon:b.icon,size:b.size,overlayText:b.overlayText,visibility:!0}},markerClicked:function(){this.notifyCallbacksForEvent("click")},bubbleOpened:function(){jQuery("#"+this.bubbleId).html(this.bubbleText)},notifyCallbacksForEvent:function(a){var b=this.callbacks[a];if(!b)return;for(var c=0;c<b.length;c+=1)b[c][0].call(null,{data:b[c][1]})},attachMarker:function(){this.map.map.addLayer(this.marker),this.isAdded=!0},detachMarker:function(){this.map.map.removeLayer(this.marker),this.isAdded=!1}}),lf.maps.viamichelin.ClusterMarker=lf.maps.viamichelin.FrontOfficeMarker.extend({constructor:function(a){this.base(a)},setLabel:function(a){this.base("x "+a)},getSettingsObject:function(){return lf_viamichelin_settings.clusterMarker}}),lf.maps.viamichelin.InactiveClusterMarker=lf.maps.viamichelin.FrontOfficeMarker.extend({constructor:function(a){this.base(a)},setLabel:function(a){this.base("x "+a)},getSettingsObject:function(){return lf_viamichelin_settings.inactiveClusterMarker}}),lf.maps.viamichelin.InactiveMarker=lf.maps.viamichelin.FrontOfficeMarker.extend({constructor:function(a){this.base(a)},getMarkerSettings:function(a){var b=this.base(a);return this.bubbleId=lf.app.uniqueId(),this.bubbleText="",b.htm="<div id='"+this.bubbleId+"' style='width:250px;'></div>",b},getSettingsObject:function(){return lf_viamichelin_settings.inactiveMarker}}),lf.maps.viamichelin.NumberMarker=lf.maps.viamichelin.FrontOfficeMarker.extend({constructor:function(a,b){this.base(b),this.number=a,this.setLabel(a)},getMarkerSettings:function(a){var b=this.base(a);return this.bubbleId=lf.app.uniqueId(),this.bubbleText="",b.htm="<div id='"+this.bubbleId+"' class='lf_mapbubble_text'></div>",b},getSettingsObject:function(){return lf_viamichelin_settings.numberMarker}}),lf.maps.viamichelin.SingleMarker=lf.maps.viamichelin.FrontOfficeMarker.extend({constructor:function(a){this.base(a)},getSettingsObject:function(){return lf_viamichelin_settings.singleMarker}}),lf.maps.viamichelin.DirectionsService=Base.extend({constructor:function(a,b,c){this.delegate=a,this.origin=b,this.destination=c},process:function(){typeof this.destination=="string"&&this.geocode("destination"),typeof this.origin=="string"&&this.geocode("origin"),this.processIfPossible()},processDirections:function(){var a=this,b={lat:this.origin.lat,lon:this.origin.lng},c={lat:this.destination.lat,lon:this.destination.lng},d=VMLaunch;d("ViaMichelin.Api.Itinerary",{steps:[{coords:b},{coords:c}]},{onSuccess:function(b){var c=a.convertResponse(b);a.callDelegateMethod("didReceiveSuccessfulDirections",[a,c])},onError:function(b){console&&console.error&&console.error("viamichelin error:",b),a.callDelegateMethod("didReceiveFailingDirections",[a])}})},processIfPossible:function(){if(typeof this.origin=="string"||typeof this.destination=="string")return;this.processDirections()},convertResponse:function(a){function b(a,c){if(c.details.length>0)for(var d=0;d<c.details.length;d+=1)b(a,c.details[d]);else a.steps.push({description:c.description,distance:c.totalDistance})}var c={};c.copyrights="",c.estimatedDistance=a.header.summaries[0].totalDist+"m",c.estimatedDuration=a.header.summaries[0].totalTime+"min",c.steps=[],c.points=[];for(var d=0;d<a.roadSheet.steps.length;d+=1)b(c,a.roadSheet.steps[d]);var e=a.getLayer().layers[0].getPath();for(var f=0;f<e.length;f+=1)c.points.push({lat:e[f].lat,lng:e[f].lon});return c},geocode:function(a){var b=this;this.loadGoogleMaps(function(){(new google.maps.Geocoder).geocode({address:b[a]},function(c,d){var e=c[0].geometry.location;b[a]={lat:e.lat(),lng:e.lng()},b.processIfPossible()})})},loadGoogleMaps:function(a){if(typeof google!="undefined"||lfLoadGoogleApiForViamichelin.loaded)return a.call();lfLoadGoogleApiForViamichelin.callbacks.push(a);if(this.loadingGoogleMaps)return;this.loadingGoogleMaps=!0;var b=document.createElement("script");b.type="text/javascript",b.src="http://maps.google.com/maps/api/js?sensor=false&callback=lfLoadGoogleApiForViamichelin",document.body.appendChild(b)}},{routeForPoint:function(a,b,c){return new lf.maps.viamichelin.DirectionsService(a,b,c)},routeForAddress:function(a,b,c){return new lf.maps.viamichelin.DirectionsService(a,b,c)}}),Class.mixin(lf.maps.viamichelin.DirectionsService,Delegatable),lfLoadGoogleApiForViamichelin=function(){lfLoadGoogleApiForViamichelin.loaded=!0;for(var a=0;a<lfLoadGoogleApiForViamichelin.callbacks.length;a+=1)lfLoadGoogleApiForViamichelin.callbacks[a].call();lfLoadGoogleApiForViamichelin.callbacks=[]},lfLoadGoogleApiForViamichelin.loaded=!1,lfLoadGoogleApiForViamichelin.callbacks=[],lf.maps.viamichelin.PolygonLine=Base.extend({constructor:function(a,b){this.line=new ViaMichelin.Api.Map.PolyLine({strokeWeight:5,strokeColor:"#0000FF",strokeOpacity:.5}),this.setColor(b.color||{r:0,g:0,b:1,a:.75}),this.setMap(a)},setMap:function(a){this.map=a,this.line&&(this.map?this.map.map.addLayer(this.line):this.map.map.removeLayer(this.line))},getMap:function(){return this.map},setColor:function(a){this.color=a,this.line&&(this.line.setStrokeColor(this.getRGBString()),this.line.setStrokeOpacity(this.color.a))},getColor:function(){return this.color},setPoints:function(a){this.points=a;if(this.line){var b=[];for(var c=0;c<a.length;c+=1)b.push({lat:a[c].lat,lon:a[c].lng});this.line.setPath(b)}},getPoints:function(){return this.points},getRGBString:function(){function a(a,b){var c=""+a;while(c.length<b)c="0"+c;return c}var b=parseInt(this.color.r*255,10).toString(16),c=parseInt(this.color.g*255,10).toString(16),d=parseInt(this.color.b*255,10).toString(16);return sprintf("#%s%s%s",a(b,2),a(c,2),a(d,2))}}),DrivingDirectionsPopup=function(a){this.root=a,this.from=a.find('input[name="lf_ddfrom"]'),this.posAddress=a.find("#lf_ddto address"),this.calculateButton=a.find("#lf_ddcalculate button, #lf_ddcalculate a"),this.resultsDiv=a.find("#lf_ddresults"),this.directionsList=a.find("#lf_ddroutesteps"),this.originText=a.find("#lf_ddorigin"),this.estimate=a.find("#lf_ddestimate"),this.mapDiv=a.find("#lf_ddmap"),this.mapCopyright=a.find("#lf_ddcopyright"),this.printButton=a.find("#lf_ddprint"),this.closeButton=a.find("#lf_ddclose"),this.map=null,this.mapOriginMarker=null,this.mapDestinationMarker=null,this.mapRouteLine=null;var b=this;this.from.keypress(function(a){if(a.which!==13)return;b.from.blur(),b.calculateButton.focus().click()}),this.calculateButton.bind("click",function(){b.processRequest()}),this.closeButton.bind("click",function(){b.hide()}),this.printButton.bind("click",function(){b.root.printElement({printMode:"popup",leaveOpen:!0})}),jQuery(window).bind("resize",function(){b.reposition()}).trigger("resize")},DrivingDirectionsPopup.sharedInstance=function(){if(!DrivingDirectionsPopup.__sharedInstance){var a=jQuery("#lf_drivingdirections");if(a.length===0)throw new Error("#lf_drivingdirections is not present");DrivingDirectionsPopup.__sharedInstance=new DrivingDirectionsPopup(a)}return DrivingDirectionsPopup.__sharedInstance},DrivingDirectionsPopup.prototype.reposition=function(){var a=jQuery(window).width()/2-this.root.width()/2;this.root.css({left:a})},DrivingDirectionsPopup.prototype.show=function(){this.root.show(),this.root.trigger("shown")},DrivingDirectionsPopup.prototype.hide=function(){this.root.hide(),this.root.trigger("hidden")},DrivingDirectionsPopup.prototype.bind=function(){this.root.bind.apply(this.root,arguments)},DrivingDirectionsPopup.prototype.unbind=function(){this.root.unbind.apply(this.root,arguments)},DrivingDirectionsPopup.prototype.print=function(){this.root.printElement({printMode:"popup",leaveOpen:!0})},DrivingDirectionsPopup.prototype.getPointOfSaleAddress=function(){return this.posAddress.text().replace(/^\s+/g,"").replace(/\s+jQuery/g,"").replace(/[\n\t]/g,"")},DrivingDirectionsPopup.prototype.processRequest=function(){if(this.from.val().replace(/\s/g,"")===""){window.alert(I18n.t("frontoffice.pos.directions.empty_field_error")),this.from.focus();return}this.geocodingAttempt=null,this.hideResults(),this.processRequestUsingAddress()},DrivingDirectionsPopup.prototype.processRequestUsingAddress=function(){var a=lf.app.getApiModule(),b=this.from.val(),c=this.getPointOfSaleAddress();this.geocodingAttempt="address",a.DirectionsService.routeForAddress(this,b,c).process()},DrivingDirectionsPopup.prototype.processRequestUsingLatLng=function(){var a=lf.app.getApiModule(),b=this.from.val(),c=posMarkerCoordinates;this.geocodingAttempt="latlng",a.DirectionsService.routeForPoint(this,b,c).process()},DrivingDirectionsPopup.prototype.resultMatchesGeolocation=function(a,b){if(this.geocodingAttempt==="latlng")return!0;var c=69.1*(a-posMarkerCoordinates.lat),d=53*(b-posMarkerCoordinates.lng),e=Math.sqrt(c*c+d*d);return e<.0622},DrivingDirectionsPopup.prototype.didReceiveFailingDirections=function(a){this.geocodingAttempt==="address"?this.processRequestUsingLatLng():window.alert(I18n.t("frontoffice.pos.directions.calculate_error"))},DrivingDirectionsPopup.prototype.didReceiveSuccessfulDirections=function(a,b){this.setCopyrightText(b.copyrights),this.setEstimateText(sprintf("%s (%s)",b.estimatedDistance,b.estimatedDuration)),this.setStartAddressText(this.from.val()),this.setDirectionsList(b.steps),this.showResults(),this.setRoutePoints(b.points)},DrivingDirectionsPopup.prototype.hideResults=function(){this.resultsDiv.hide()},DrivingDirectionsPopup.prototype.showResults=function(){this.resultsDiv.show()},DrivingDirectionsPopup.prototype.setDirectionsList=function(a){this.directionsList.empty();for(var b=0;b<a.length;b+=1){var c=a[b],d=jQuery("<li/>").appendTo(this.directionsList);jQuery("<div/>").addClass("lf_ddstepdescription").html(c.description).appendTo(d),jQuery("<div/>").addClass("lf_ddstepdistance").html(c.distance).appendTo(d)}},DrivingDirectionsPopup.prototype.setCopyrightText=function(a){this.mapCopyright.html(a)},DrivingDirectionsPopup.prototype.setEstimateText=function(a){this.estimate.html(a)},DrivingDirectionsPopup.prototype.setStartAddressText=function(a){this.originText.html(a)},DrivingDirectionsPopup.prototype.mapIsLoaded=function(){return this.map!==null},DrivingDirectionsPopup.prototype.setRoutePoints=function(a){var b=new lf.maps.Bounds(a[0],a[0]);for(var c=1;c<a.length;c+=1)b.extend(a[c]);this.createMap(b,function(){var c=a[0],d=a[a.length-1];this.mapOriginMarker.setPosition(c),this.mapDestinationMarker.setPosition(d),this.mapRouteLine.setPoints(a),this.map.fitBounds(b)})},DrivingDirectionsPopup.prototype.createMap=function(a,b){if(this.map){b.call(this);return}var c=lf.app.getApiModule(),d=this;this.map=new c.Map(this.mapDiv[0],function(a){d.mapOriginMarker=new c.NumberMarker("A",{lat:0,lng:0}),d.mapOriginMarker.setMap(a),d.mapDestinationMarker=new c.NumberMarker("B",{lat:0,lng:0}),d.mapDestinationMarker.setMap(a),d.mapRouteLine=new c.PolygonLine(a,{color:{r:0,g:0,b:1,a:.5}}),b.call(d)})},jQuery(document).ready(function(){jQuery("*[data-bind='driving_directions_show']").live("click",function(){gui.Backdrop.sharedInstance().showWithoutIndicator(250),DrivingDirectionsPopup.sharedInstance().show(),jQuery(window).scrollTop(0);var a=function(){gui.Backdrop.sharedInstance().hide(250),DrivingDirectionsPopup.sharedInstance().unbind("hidden",a)};return DrivingDirectionsPopup.sharedInstance().bind("hidden",a),!1})}),lf.ListMap=Base.extend({constructor:function(a){this.markers={},this.markersByIndex={},this.activeMarkers=[],this.inactiveMarkers=[];var b=this,c=lf.app.getApiModule();this.map=new c.Map(a,function(a){b.mapWasLoaded(a)})},mapWasLoaded:function(a){var b=lf.app.getApiModule();this.activeCluster=new lf.maps.MarkerClusterer(a,b.ClusterMarker),this.inactiveCluster=new lf.maps.MarkerClusterer(a,b.InactiveClusterMarker),this.buildMarkers(),this.bindMarkerEvents(),this.activeCluster.redraw(),this.inactiveCluster.redraw(),a.fitBounds(this.activeCluster.getMarkerBounds(),16)},bindMarkerEvents:function(){var a=this,b,c=function(b){a.showMarkerInfo(b.data)};for(var d=0;d<this.activeMarkers.length;d+=1)b=this.activeMarkers[d],b.bind("click",b,c);for(var e=0;e<this.inactiveMarkers.length;e+=1)b=this.inactiveMarkers[e],b.bind("click",b,c)},buildMarkers:function(){var a=this,b=lf.app.getApiModule(),c={};jQuery.each(app.front_office.countries,function(a,b){jQuery.extend(c,app.front_office.point_of_sales[b])}),jQuery.each(active_markers,function(d,e){var f=c[e],g=new b.NumberMarker(start_marker+d+1,f);g.pos_id=e,a.activeCluster.addMarker(g,!0),a.markers[e]=g,a.markersByIndex[d+1]=g,a.activeMarkers.push(g)}),jQuery.each(c,function(d,e){if(a.markers[d])return;var f=c[d],g=new b.InactiveMarker(f);g.pos_id=d,a.inactiveCluster.addMarker(g,!0),a.markers[d]=g,a.inactiveMarkers.push(g)})},closeOpenMarkers:function(){for(var a=0;a<this.activeMarkers.length;a+=1)this.activeMarkers[a].hideText();for(var b=0;b<this.inactiveMarkers.length;b+=1)this.inactiveMarkers[b].hideText()},getErrorText:function(){return'<b style="color:red">'+I18n.translate("frontoffice.maps.info_window.loading_error")+"</b>"},getLoadingText:function(){return"<b>"+I18n.translate("frontoffice.maps.info_window.loading_info")+"</b>"},showMarkerInfo:function(a){this.closeOpenMarkers(),this.map.getZoom()<13&&this.map.setZoom(13),this.map.setCenter(a.getPosition()),a.showText(this.getLoadingText());var b=this;jQuery.ajax({url:"/popup/"+a.pos_id,dataType:"text",success:function(b){a.showText(b)},error:function(){a.showText(b.getLoadingText())}})},showMarkerByIndex:function(a){this.markersByIndex[a]&&this.showMarkerInfo(this.markersByIndex[a])},setPositioningMarkerVisible:function(a){this.activeCluster.setPositioningMarkerVisible(a),this.inactiveCluster.setPositioningMarkerVisible(a)}}),lf.TabArray=Base.extend({constructor:function(a){this.root=jQuery(a);var b=this;this.root.find("a").bind("click",function(){return b.activate(this),!1}),this.root.find("a:not(:first)").each(function(){jQuery(jQuery(this).attr("href")).hide()})},activate:function(a){this.root.find("a.active").each(function(){jQuery(this).removeClass("active"),jQuery(jQuery(this).attr("href")).hide()}),jQuery(a).addClass("active"),jQuery(jQuery(a).attr("href")).each(function(){jQuery(this).show(),jQuery(this).find("#lf_accessmap_canvas").length&&lf.app.accessMap&&(lf.app.accessMap.redraw(),lf.app.accessMap.setCenter(posMarkerCoordinates))})}}),lf.SearchForm=Base.extend({constructor:function(a){this.root=jQuery(a),this.form=this.root.find("form"),this.queryField=this.form.find("#query"),this.queryError=this.root.find(".search_error"),this.querySubmit=this.form.find(".submit"),this.isInitialQuery=!0,this.initialQueryValue=this.queryField.val(),this.selector=this.form.find("select[class=redirects]");var b=this;this.queryField.bind("focusin",function(){b.isInitialQuery&&(b.isInitialQuery=!1,b.queryField.val(""))}),this.queryField.bind("focusout",function(){b.queryField.val().replace(/^\s+/,"").replace(/\s+$/,"").length===0&&(b.isInitialQuery=!0,b.queryField.val(b.initialQueryValue))}),this.queryField.bind("keyUp",function(){b.validateQuery()}),this.form.bind("submit",function(){return b.validateQuery()?!0:(b.queryError.show(),!1)}),this.selector.bind("change",function(){b.checkForRedirect()})},validateQuery:function(){return this.queryField.val().replace(/^\s+/,"").replace(/\s+$/,"")===""?!1:!0},checkForRedirect:function(){this.selector.val()&&(this.selector.attr("disabled",!0),window.location=this.selector.val())},comparator:function(a,b){return a.postal_code===b.postal_code?a.name<b.name?-1:1:a.postal_code<b.postal_code?-1:1},populateSelectorFromData:function(a){this.selector.empty(),jQuery("<option/>").html(app.front_office.select).appendTo(this.selector);var b=[];jQuery.each(a,function(a,c){b.push(a)});var c=this;jQuery.each(b.sort(),function(d,e){var f=c.selector;b.length>1&&(f=jQuery("<optgroup/>").html(e).attr("label",e).appendTo(f));var g=[];jQuery.each(a[e],function(a,b){g.push(b)}),jQuery.each(g.sort(c.comparator),function(a,b){if(b.pos_type_has_page===!0||b.pos_type_has_page==="t"){var c=b.postal_code+" - "+b.name,d="/"+b.url;jQuery("<option/>").html(c).attr("value",d).appendTo(f)}})})}}),lf.AjaxSubmissionForm=Base.extend({constructor:function(a){this.root=jQuery(a),this.submitButton=this.root.find(":submit"),this.spinner=jQuery("<span class='loading'><img width='20' height='20' src='/shared/images/loading.gif' alt='loading'></span>").hide().insertAfter(this.submitButton),this.successRequest=this.root.find(".success_request").hide(),this.errorRequest=this.root.find(".errors_request").hide();var b=this;this.root.bind("submit",function(){return b.submit(),!1})},reset:function(){this.root[0].reset()},submit:function(){this.successRequest.hide(),this.errorRequest.hide(),this.submitButton.addClass("loading").attr("disabled",!0),this.spinner.show();var a=this;jQuery.ajax({url:this.root.attr("action"),type:"POST",data:this.root.serialize(),dataType:"json",success:function(b){a.success(b)}})},success:function(a){var b=this;this.successRequest.empty(),this.errorRequest.empty(),a.notice&&(this.successRequest.html(a.notice).show(),this.reset(),setTimeout(function(){b.successRequest.fadeOut(1e3)},1e4)),a.warning&&this.errorRequest.html(a.warning).show(),this.submitButton.removeClass("loading").attr("disabled",!1),this.spinner.hide()}}),LFListMapScroller=function(a){this.init(a)},jQuery.extend(LFListMapScroller.prototype,{init:function(a){this.resultsCol=jQuery(a.resultsCol||".lf_column1"),this.map=jQuery(a.map||"#lf_listmap"),this.canvas=jQuery(a.canvas||"#lf_listmap_canvas"),this.mapCol=jQuery(a.mapCol||".lf_column2"),this.sizeButton=jQuery(a.sizeButton||"#lf_enlargemap"),this.legendButton=jQuery(a.legendButton||"#lf_showlegend"),this.legend=jQuery(a.legend||"#lf_listmaplegend").hide(),this.legendClose=jQuery(a.legend||"#lf_listmaplegend > span"),this.mapButtons=jQuery(a.mapButtons||"#lf_listmap_buttons"),a.results?this.results=jQuery(a.results):jQuery("#lf_results2").length>0?this.results=jQuery("#lf_results2"):this.results=jQuery("#lf_results"),this.wide=!1,this.scrollTarget=this.map;var b=this;this.sizeButton.bind("click",function(){return b.toggleSize(),!1}),this.legendButton.bind("click",function(){return b.toggleLegend(),!1}),this.legendClose.bind("click",function(){return b.closeLegend(),!1}),jQuery(window).bind("scroll",function(){b.userScrolled()}),this.spacer=jQuery('<div id="spacer" style="height:0"></li>'),this.map.before(this.spacer)},closeLegend:function(){this.legend.hide()},toggleLegend:function(){this.legend.is(":visible")?(this.closeLegend(),this.legendButton.html(I18n.translate("frontoffice.maps.links.legend.show"))):(this.legend.show(),this.legendButton.html(I18n.translate("frontoffice.maps.links.legend.hide"))),this.userScrolled()},toggleSize:function(){var a;lf.app.listMap&&(a=lf.app.listMap.map.getCenter()),this.mapCol.toggleClass("wide"),this.resultsCol.toggleClass("wide"),this.mapCol.hasClass("wide")?(this.wide=!0,this.sizeButton.html(I18n.translate("frontoffice.maps.links.map.shrink")),this.sizeButton.toggleClass("close"),this.spacer.css("height",0)):(this.wide=!1,this.sizeButton.html(I18n.translate("frontoffice.maps.links.map.increase")),this.sizeButton.toggleClass("close")),lf.app.listMap&&(lf.app.listMap.map.redraw(),lf.app.listMap.map.setCenter(a)),this.userScrolled()},userScrolled:function(){if(this.wide)return;var a=this.map.offset().top,b=parseInt(this.map.innerHeight(),10),c=a+b,d=this.results.offset().top,e=parseInt(this.results.innerHeight(),10),f=d+e,g=jQuery(window).scrollTop(),h=jQuery(window).height(),i;d<g?(i=g-d+10,i+b>e&&(i=e-b)):i=0,jQuery("#lf_listmap_legend").html("offset:"+i+", mapHeight:"+b+", resultsHeight:"+e),this.spacer.animate({height:i},{duration:500,easing:"easeOutQuint",queue:!1})}}),jQuery(document).ready(function(){typeof lf_asset_base=="undefined"&&(lf_asset_base=""),typeof lf_viamichelin_settings=="undefined"&&(lf_viamichelin_settings={},lf_viamichelin_settings.numberMarker={icon:{url:lf_asset_base+"/images/markers/active_number.png",offsetX:0,offsetY:0},size:{width:36,height:44},overlayText:{offsetX:0,offsetY:0,style:{color:"#FFD900",fontSize:"11pt",lineHeight:"52px",textAlign:"center",width:"36px",height:"44px"}}},lf_viamichelin_settings.inactiveMarker={icon:{url:lf_asset_base+"/images/markers/inactive_number.png",offsetX:0,offsetY:0},size:{width:36,height:44},overlayText:{offsetX:0,offsetY:0,style:{color:"#FFD900",fontSize:"11pt",lineHeight:"52px",textAlign:"center",width:"36px",height:"44px"}}},lf_viamichelin_settings.clusterMarker={icon:{url:lf_asset_base+"/images/markers/active_cluster.png",offsetX:0,offsetY:0},size:{width:47,height:53},overlayText:{offsetX:0,offsetY:0,style:{color:"#FFD900",fontSize:"11pt",lineHeight:"52px",textAlign:"center",width:"47px",height:"53px"}}},lf_viamichelin_settings.inactiveClusterMarker={icon:{url:lf_asset_base+"/images/markers/inactive_cluster.png",offsetX:0,offsetY:0},size:{width:47,height:53},overlayText:{offsetX:0,offsetY:0,style:{color:"#FFD900",fontSize:"11pt",lineHeight:"52px",textAlign:"center",width:"47px",height:"53px"}}},lf_viamichelin_settings.singleMarker={icon:{url:lf_asset_base+"/images/markers/marker.png",offsetX:0,offsetY:0},size:{width:51,height:47},overlayText:{offsetX:0,offsetY:0,style:{color:"#FFD900",fontSize:"11pt",lineHeight:"52px",textAlign:"center",width:"51px",height:"47px"}}})});var app={};jQuery(document).ready(function(){initializeFormObjects(),jQuery.getJSON("/point_of_sales.json",function(a){app.front_office=a,preloadMarkers(initializeAppDependentObjects())}),jQuery.getJSON("/javascripts/translations.json",function(a){I18n.translations=a}),jQuery("html[lang]").length===0?I18n.locale="fr":I18n.locale=jQuery("html").attr("lang").split("_")[0].toLowerCase();if(jQuery("#lf_openinghours").length){var a=jQuery(".lf_openinghoursdays .lf_days > li:nth-child("+(new Date).getDay()+")").first();a.length&&a.addClass("today")}jQuery("#lf_postabs").each(function(){lf.app.tabs=new lf.TabArray(this)}),jQuery("body.print #lf_printbutton a").bind("click",function(){return window.print(),!1});if(jQuery("#lf_listmap").length)var b=new LFListMapScroller({});jQuery(document).pngFix()});
