(function(){var b=this.Store=function(d,e,g){var h=this;this.name=d;this.listeners={};if(e){for(var i in e){if(e.hasOwnProperty(i)&&this.get(i)===undefined){this.set(i,e[i])}}}var j=function(l,m){([l,"*"]).each(function(n){if(h.listeners[n]){h.listeners[n].each(function(o){o(m,l,h.name)
})}})};var c=this.toObject();var f=function(){k(true)};var k=function(n){if(Object.keys(h.listeners).length!==0){var l=h.toObject();if(!n){for(var m in l){if(l.hasOwnProperty(m)&&l[m]!==c[m]){j(m,l[m])
}}for(var m in c){if(c.hasOwnProperty(m)&&!l.hasOwnProperty(m)){j(m,l[m])}}}c=l;setTimeout(k,(g||300))}else{setTimeout(f,1000)}};f()};b.__proto__=function a(){};b.__proto__.clear=function(){localStorage.clear()
};b.prototype.get=function(c){var d=localStorage.getItem("store."+this.name+"."+c);if(d===null){return}try{return JSON.parse(d)}catch(f){return null}};b.prototype.set=function(c,d){if(d===undefined){this.remove(c)
}else{if(typeof d==="function"){d=null}else{try{d=JSON.stringify(d)}catch(f){d=null}}localStorage.setItem("store."+this.name+"."+c,d)}return this};b.prototype.remove=function(c){localStorage.removeItem("store."+this.name+"."+c);
return this};b.prototype.removeAll=function(){var c="store."+this.name+".";for(var d=(localStorage.length-1);d>=0;d--){if(localStorage.key(d).substring(0,c.length)===c){localStorage.removeItem(localStorage.key(d))
}}return this};b.prototype.toObject=function(){var c={};var d="store."+this.name+".";for(var f=(localStorage.length-1);f>=0;f--){if(localStorage.key(f).substring(0,d.length)===d){var e=localStorage.key(f).substring(d.length);
var g=this.get(e);if(g!==undefined){c[e]=g}}}return c};b.prototype.fromObject=function(c,e){if(!e){this.removeAll()}for(var d in c){if(c.hasOwnProperty(d)){this.set(d,c[d])}}return this};b.prototype.addEvent=function(c,d){if(!this.listeners[c]){this.listeners[c]=[]
}this.listeners[c].push(d);return this};b.prototype.removeEvent=function(c,e){for(var d=(this.listeners[c].length-1);d>=0;d--){if(this.listeners[c][d]===e){this.listeners[c].splice(d,1)}}if(this.listeners[c].length===0){delete this.listeners[c]
}return this}})();if(!("localStorage" in window)){window.Store=function(){this.get=function(){return};this.set=function(){};this.removeAll=function(){};this.addEvent=function(){};this.removeEvent=function(){}
}}if(typeof(AjaxGeocoder)=="undefined"){var AjaxGeocoder=Class.create({initialize:function(a){if(typeof(Autocomplete)=="undefined"){throw ("Autocomplete is not defined")}var b=$(a);if(!this.serviceUrl){this.serviceUrl="/ajaxv1/Geocoder/search"
}var d=new Element("input",{type:"hidden",value:""});if(b.value!=""&&b.value.match(/^[0-9]+$/)){b.hide();b.disabled=true;AjaxGeocoder.getAreaInfos(b.value,{onSuccess:function(i){var h=i.responseText.evalJSON();
d.value=b.value;$(b).value=h.infos.full_label;b.show();b.disabled=false}})}else{b.disabled=false}["id","name"].each(function(h){if(b[h]){d[h]=b[h];b[h]="autocomplete_"+b[h]}});b.insert({after:d});var g=Autocomplete;
var f=new Element("img",{src:"/images/ajax-loader.gif"});f.hide();g.prototype.getSuggestions=g.prototype.getSuggestions.wrap(function(h){f.show();return h()});g.prototype.suggest=g.prototype.suggest.wrap(function(h){f.hide();
return h()});new g(b,{serviceUrl:this.serviceUrl,minChars:2,maxHeight:400,width:300,deferRequestBy:300,onSelect:function(i,h){d.value=h}});var e;var c;b.observe("focus",function(){e=d.value;c=b.value;d.value="none";
b.value=""});b.observe("blur",function(){if(d.value=="none"){d.value=e;b.value=c}});b.observe("keypress",function(h){if(h.keyCode==13){h.stopPropagation();h.preventDefault()}});b.addClassName("autocomplete");
b.insert({after:f})}});var AjaxGeoCity=Class.create(AjaxGeocoder,{initialize:function($super,a){this.serviceUrl="/ajaxv1/Geocoder/searchCity";$super(a)}});AjaxGeocoder.NO_COUNTRY="";AjaxGeocoder.NO_REGION="";
AjaxGeocoder.COUNTRY_ACCURACY=1;AjaxGeocoder.REGION_ACCURACY=2;AjaxGeocoder.SUBREGION_ACCURACY=3;AjaxGeocoder.TOWN_ACCURACY=4;AjaxGeocoder.SHOW_HIDDEN=0;AjaxGeocoder.DEBUG_INFOS=0;AjaxGeocoder.NOCACHE=0;
AjaxGeocoder.getSubAreas=function(d,c){var b={method:"get"};Object.extend(b,c||{});var a="/ajaxv1/Geocoder/getSubAreas?id="+d;if(AjaxGeocoder.SHOW_HIDDEN==1){a+="&show_hidden=1"}if(AjaxGeocoder.DEBUG_INFOS==1){a+="&debug_infos=1"
}if(AjaxGeocoder.NOCACHE==1&&d!=""){a+="&nocache=1"}new Ajax.Request(a,b)};AjaxGeocoder.getAreaInfos=function(c,b){var a={method:"get"};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/Geocoder/getAreaInfos?id="+c,a)
};AjaxGeocoder.getFRData=function(b){var a={method:"get"};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/Geocoder/getFRData",a)};AjaxGeocoder.getDescendantsByAccuracy=function(d,c,b){var a={method:"get"};
Object.extend(a,b||{});new Ajax.Request("/ajaxv1/Geocoder/getDescendantsByAccuracy?accuracy="+c+"&id="+d+"&show_hidden="+AjaxGeocoder.SHOW_HIDDEN+"&debug_infos="+AjaxGeocoder.DEBUG_INFOS,a)};AjaxGeocoder.getUserOldLocation=function(b){var a={method:"get"};
Object.extend(a,b||{});new Ajax.Request("/ajaxv1/Geocoder/getUserOldLocation?",a)};AjaxGeocoder.search=function(c,b){var a={method:"GET"};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/Geocoder/search?query="+c,a)
};AjaxGeocoder.searchCity=function(c,b){var a={method:"GET"};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/Geocoder/searchCity?query="+c,a)};AjaxGeocoder.searchByCoords=function(d,c,b){var a={method:"GET"};
Object.extend(a,b||{});new Ajax.Request("/ajaxv1/Geocoder/searchByCoords?latitude="+d+"&longitude="+c,a)};(function(){var a="AjaxGeoCity";var b=function(c){new AjaxGeoCity(c)};if(typeof(AjaxUI)=="undefined"){Event.observe(window,"load",function(){$$("."+a).each(function(c){b(c)
})})}else{AjaxUI.subscribe(a,b)}})();(function(){var a="AjaxGeocoder";var b=function(c){new AjaxGeocoder(c)};if(typeof(AjaxUI)=="undefined"){Event.observe(window,"load",function(){$$("."+a).each(function(c){b(c)
})})}else{AjaxUI.subscribe(a,b)}})()}if(typeof(AjaxStorage)=="undefined"){var AjaxStorage=Class.create({});AjaxStorage.setUserPref=function(f,c,b){try{var a={method:"post",postBody:"data="+escape(c)};Object.extend(a,b||{});
new Ajax.Request("/ajaxv1/Storage/setUserPref?id="+f.join(","),a)}catch(d){console.error(d)}};AjaxStorage.getUserPref=function(c,b){var a={method:"get"};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/Storage/getUserPref?id="+c.join(","),a)
};AjaxStorage.setSessionPref=function(f,c,b){try{var a={method:"post",postBody:"data="+escape(c)};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/Storage/setSessionPref?id="+f.join(","),a)}catch(d){console.error(d)
}};AjaxStorage.getSessionPref=function(c,b){var a={method:"get"};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/Storage/getSessionPref?id="+c.join(","),a)}}if(typeof(FRDeptSelector)=="undefined"){function similar_text(c,b){function d(k,f,j,e){function g(n,r,m,p){var v=0,t=0,u=0,s,q,o;
for(s=0;s<r;++s){for(q=0;q<p;++q){for(o=0;(s+o<r)&&(q+o<p)&&(n.charAt(s+o)==m.charAt(q+o));++o){}if(o>u){u=o;v=s;t=q}}}return{pos1:v,pos2:t,max:u}}var i=g(k,f,j,e);var h=i.max;if(h){if(i.pos1&&i.pos2){h+=d(k,i.pos1,j,i.pos2)
}if((i.pos1+i.max<f)&&(i.pos2+i.max<e)){h+=d(k.substr(i.pos1+i.max),f-i.pos1-i.max,j.substr(i.pos2+i.max),e-i.pos2-i.max)}}return h}var a=d(c,c.length,b,b.length);return{similar:a,percent:a*200/(c.length+b.length)}
}var FRDeptSelector=Class.create({observe:function(c,a,b){a.each(function(d){Event.observe(c,d,b)})},initialize:function(B){var B=$(B);var s=B;var p=B.select("[id=regions]").first();var b=B.select("[id=pays]").first();
var m=B.select("[id=region]").first();var i=B.select("[id=dept]").first();var x=B.select("[id=villeSelector]").first();var r=" - "+gettext("Choisissez")+" - ";var d=gettext("Chargement...");var f=" - "+gettext("Vide")+" - ";
var a=null;var v={pays:"",region:"",dept:""};var n=16;var w=n;var C=new Store("FRDeptSelector");var z=function(e){e.update("");e.insert((new Element("option",{value:""})).update(r));e.value="";e.disabled=false
};var o=function(e){z(e);e.disabled=true};var u=function(e){e.disabled=true;e.update("");e.insert((new Element("option",{value:""})).update(d))};var y=function(e){if(e.childElements().size()==1){e.disabled=true;
e.update("");e.insert((new Element("option",{value:""})).update(f))}};var g=function(e){u(b);AjaxGeocoder.getSubAreas(AjaxGeocoder.NO_REGION,{onSuccess:function(F){var E=F.responseText.evalJSON();var D=[];
z(b);E.items.each(function(H){var G=new Element("option",{value:H.id});if(H.label=="separator"){G.update("-----------------")}else{G.update(H.label)}b.insert(G)});if(e){e()}l()}})};var l=function(){if(typeof(AjaxStorage)!="undefined"){}};
var c=function(){u(m);u(i);AjaxGeocoder.getFRData({onSuccess:function(D){var e=D.responseText.evalJSON();a=e.fr_id;z(m);z(i);e.regions.each(function(E){m.insert((new Element("option",{value:E.id})).update(E.label))
});e.depts.each(function(E){i.insert((new Element("option",{value:E.id})).update(E.label))});m.fire(":updated");i.fire(":updated");l()}})};var h=false;var k=function(){p.value="";$A([b,m,i]).each(function(D){if(D.value!=""){p.value=D.value
}});C.set("pays",b.value);C.set("region",m.value);C.set("dept",i.value);if(x){x.fire("location:reset")}h=true};var q=function(){v.pays=b.value;o(m);o(i);k();if(b.value==""){return}if(b.select("option").toArray()[b.selectedIndex].value==n){c()
}else{u(m);u(i);AjaxGeocoder.getDescendantsByAccuracy(b.value,AjaxGeocoder.REGION_ACCURACY,{onSuccess:function(D){var e=D.responseText.evalJSON();z(m);e.items.each(function(F){if(F.oldpays=="0"){return
}if(typeof m.childElements().last()!="undefined"){var E=similar_text(m.childElements().last().innerHTML,F.label);if(E.percent>=95){m.childElements().last().value+=","+F.id;return}}m.insert((new Element("option",{value:F.id})).update(F.label))
});y(m);l()}});AjaxGeocoder.getDescendantsByAccuracy(b.value,AjaxGeocoder.SUBREGION_ACCURACY,{onSuccess:function(D){var e=D.responseText.evalJSON();z(i);e.items.each(function(F){if(F.oldpays=="0"){return
}if(typeof i.childElements().last()!="undefined"){var E=similar_text(i.childElements().last().innerHTML,F.label);if(E.percent>=95){i.childElements().last().value+=","+F.id;return}}i.insert((new Element("option",{value:F.id})).update(F.label))
});y(i);l()}})}};var t=function(){if(b.value==""){b.value=w}i.value="";k()};var A=function(){if(b.value==""){b.value=w}m.value="";k()};this.observe(b,["change","keyup"],q);this.observe(m,["change"],t);
this.observe(i,["change"],A);if(!b.empty()){g=function(e){if(e){e()}}}if(C.get("pays")){var j=function(){if(C.get("pays")){if(h){return}var e=C.get("pays");if(e==""){return}b.value=e;if(b.value!=w||m.select("option").size()==1){q()
}k()}};g(j)}else{if(m.empty()||i.empty()){c();g()}}if(x){new LocationGeocoder(x);x.observe("location:select",function(e){b.value="";p.value=unescape(e.memo.data);o(m);o(i)})}}});(function(){var a="FRDeptSelector";
var b=function(c){new FRDeptSelector(c)};if(typeof(AjaxUI)=="undefined"){Event.observe(window,"load",function(){$$("."+a).each(function(c){b(c)})})}else{AjaxUI.subscribe(a,b)}})()}var Autocomplete=function(b,a){this.el=$(b);
this.id=this.el.identify();this.el.setAttribute("autocomplete","off");this.suggestions=[];this.data=[];this.badQueries=[];this.selectedIndex=-1;this.currentValue=this.el.value;this.intervalId=0;this.cachedResponse=[];
this.instanceId=null;this.onChangeInterval=null;this.ignoreValueChange=false;this.serviceUrl=a.serviceUrl;this.options={autoSubmit:false,minChars:1,maxHeight:300,deferRequestBy:0,width:0,container:null};
if(a){Object.extend(this.options,a)}if(Autocomplete.isDomLoaded){this.initialize()}else{Event.observe(document,"dom:loaded",this.initialize.bind(this),false)}};Autocomplete.instances=[];Autocomplete.isDomLoaded=false;
Autocomplete.getInstance=function(c){var b=Autocomplete.instances;var a=b.length;while(a--){if(b[a].id===c){return b[a]}}};Autocomplete.highlight=function(b,a){return b.replace(a,function(c){return"<strong>"+c+"</strong>"
})};Autocomplete.prototype={killerFn:null,initialize:function(){var a=this;this.killerFn=function(c){if(!$(Event.element(c)).up(".autocomplete")){a.killSuggestions();a.disableKillerFn()}}.bindAsEventListener(this);
if(!this.options.width){this.options.width=this.el.getWidth()}var b=new Element("div",{style:"position:fixed;"});b.update('<div class="autocomplete-w1"><div class="autocomplete-w2"><div class="autocomplete" id="Autocomplete_'+this.id+'" style="display:none; width:'+this.options.width+'px;"></div></div></div>');
this.options.container=$(this.options.container);if(this.options.container){this.options.container.appendChild(b);this.fixPosition=function(){}}else{document.body.appendChild(b)}this.mainContainerId=b.identify();
this.container=$("Autocomplete_"+this.id);this.fixPosition();Event.observe(this.el,window.opera?"keypress":"keydown",this.onKeyPress.bind(this));Event.observe(this.el,"keyup",this.onKeyUp.bind(this));Event.observe(this.el,"blur",this.enableKillerFn.bind(this));
Event.observe(this.el,"focus",this.fixPosition.bind(this));Event.observe(document,"scroll",function(c){a.fixPosition()});this.container.setStyle({maxHeight:this.options.maxHeight+"px"});this.instanceId=Autocomplete.instances.push(this)-1
},fixPosition:function(){var a=this.el.viewportOffset();$(this.mainContainerId).setStyle({top:(a.top+this.el.getHeight())+"px",left:a.left+"px"})},enableKillerFn:function(){Event.observe(document.body,"click",this.killerFn)
},disableKillerFn:function(){Event.stopObserving(document.body,"click",this.killerFn)},killSuggestions:function(){this.stopKillSuggestions();this.intervalId=window.setInterval(function(){this.hide();this.stopKillSuggestions()
}.bind(this),300)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},onKeyPress:function(a){if(!this.enabled){return}switch(a.keyCode){case Event.KEY_ESC:this.el.value=this.currentValue;
this.hide();break;case Event.KEY_TAB:case Event.KEY_RETURN:if(this.selectedIndex===-1){this.hide();return}this.select(this.selectedIndex);if(a.keyCode===Event.KEY_TAB){return}break;case Event.KEY_UP:this.moveUp();
break;case Event.KEY_DOWN:this.moveDown();break;default:return}Event.stop(a)},onKeyUp:function(a){switch(a.keyCode){case Event.KEY_UP:case Event.KEY_DOWN:return}clearInterval(this.onChangeInterval);if(this.currentValue!==this.el.value){if(this.options.deferRequestBy>0){this.onChangeInterval=setInterval((function(){this.onValueChange()
}).bind(this),this.options.deferRequestBy)}else{this.onValueChange()}}},onValueChange:function(){clearInterval(this.onChangeInterval);this.currentValue=this.el.value;this.selectedIndex=-1;if(this.ignoreValueChange){this.ignoreValueChange=false;
return}if(this.currentValue===""||this.currentValue.length<this.options.minChars){this.hide()}else{this.getSuggestions()}},getSuggestions:function(){var a=this.cachedResponse[this.currentValue];if(a&&Object.isArray(a.suggestions)){this.suggestions=a.suggestions;
this.data=a.data;this.suggest()}else{if(!this.isBadQuery(this.currentValue)){new Ajax.Request(this.serviceUrl,{parameters:{query:this.currentValue},onComplete:this.processResponse.bind(this),method:"get"})
}}},isBadQuery:function(b){var a=this.badQueries.length;while(a--){if(b.indexOf(this.badQueries[a])===0){return true}}return false},hide:function(){this.enabled=false;this.selectedIndex=-1;this.container.hide()
},suggest:function(){if(this.suggestions.length===0){this.hide();return}var b=[];var a=new RegExp("\\b"+this.currentValue.match(/\w+/g).join("|\\b"),"gi");this.suggestions.each(function(d,c){b.push((this.selectedIndex===c?'<div class="selected"':"<div"),' title="',d,'" onclick="Autocomplete.instances[',this.instanceId,"].select(",c,');" onmouseover="Autocomplete.instances[',this.instanceId,"].activate(",c,');">',Autocomplete.highlight(d,a),"</div>")
}.bind(this));this.enabled=true;this.container.update(b.join("")).show()},processResponse:function(c){var a;try{a=c.responseText.evalJSON();if(!Object.isArray(a.data)){a.data=[]}}catch(b){return}this.suggestions=a.suggestions;
this.data=a.data;this.cachedResponse[a.query]=a;if(a.suggestions.length===0){this.badQueries.push(a.query)}if(a.query===this.currentValue){this.suggest()}},activate:function(a){var b=this.container.childNodes;
var c;if(this.selectedIndex!==-1&&b.length>this.selectedIndex){b[this.selectedIndex].className=""}this.selectedIndex=a;if(this.selectedIndex!==-1&&b.length>this.selectedIndex){c=b[this.selectedIndex];c.className="selected"
}return c},deactivate:function(b,a){b.className="";if(this.selectedIndex===a){this.selectedIndex=-1}},select:function(b){var a=this.suggestions[b];if(a){this.el.value=a;if(this.options.autoSubmit&&this.el.form){this.el.form.submit()
}this.ignoreValueChange=true;this.hide();this.onSelect(b)}},moveUp:function(){if(this.selectedIndex===-1){return}if(this.selectedIndex===0){this.container.childNodes[0].className="";this.selectedIndex=-1;
this.el.value=this.currentValue;return}this.adjustScroll(this.selectedIndex-1)},moveDown:function(){if(this.selectedIndex===(this.suggestions.length-1)){return}this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(b){var a=this.container;
var f=this.activate(b);var c=f.offsetTop;var d=a.scrollTop;var e=d+this.options.maxHeight-25;if(c<d){a.scrollTop=c}else{if(c>e){a.scrollTop=c-this.options.maxHeight+25}}this.el.value=this.suggestions[b]
},onSelect:function(a){(this.options.onSelect||Prototype.emptyFunction)(this.suggestions[a],this.data[a])}};Event.observe(document,"dom:loaded",function(){Autocomplete.isDomLoaded=true},false);if(typeof(AutocompleteIE6Patched)=="undefined"){var AutocompleteIE6Patched=true;
if(/MSIE 6/i.test(navigator.userAgent)){(function(){Autocomplete.prototype.suggestIE6Patched=function(){$$("select").invoke("addClassName","autocompleteIE6SelectHide");$$(".autocompleteIE6FalseSelect").invoke("remove");
$$("select").each(function(b){var a=new Element("span",{"class":"autocompleteIE6FalseSelect"});a.update(b.options[b.selectedIndex].text);b.insert({after:a})})};Autocomplete.prototype.suggest=Autocomplete.prototype.suggest.wrap(function(a){a();
this.suggestIE6Patched()});Autocomplete.prototype.hide=Autocomplete.prototype.hide.wrap(function(a){a();$$("select").invoke("removeClassName","autocompleteIE6SelectHide");$$(".autocompleteIE6FalseSelect").invoke("remove")
})})()}}if(typeof(LocationGeocoder)=="undefined"){Element.addMethods({findClosest:function(c,a){var b=function(g){var f=g.next(a);if(!f){var d=g.up();if(d){return b(d)}}return f};return b(c)}});var LocationGeocoder=Class.create({initialize:function(p){if(typeof(Autocomplete)=="undefined"){throw ("Autocomplete is not defined")
}var l=$(p);if(!this.serviceUrl){this.serviceUrl="/ajaxv1/Geocoder/search?v=2"}if(l.hasAttribute("data-min-accuracy")){this.serviceUrl+="&frRegionFilter=0&min_accuracy="+l.readAttribute("data-min-accuracy")
}var b=false;if(l.hasAttribute("data-only-geodb")){b=l.readAttribute("data-only-geodb")=="true";this.serviceUrl+="&noGMaps=1"}if(l.hasAttribute("data-no-detail")){this.serviceUrl+="&noDataDetail=1"}if(document.location.href.match(/hlLocationGeocoder=1/)){l.style.borderColor="red"
}var i=new Element("input",{type:"hidden",value:""});var a=false;l.disabled=false;["id","name"].each(function(q){if(l[q]){i[q]=l[q];l[q]="autocomplete_"+l[q]}});l.insert({after:i});var d=Autocomplete;var m;
var f=new Element("img",{src:"/images/ajax-loader.gif"});f.hide();var k;d.prototype.getSuggestions=d.prototype.getSuggestions.wrap(function(q){f.show();k=this.currentValue;a=true;return q()});d.prototype.suggestmore=function(){delete m.cachedResponse[k];
m.serviceUrl=o+"&more=1";l.value=k;m.currentValue=k;m.getSuggestions();m.serviceUrl=o};[l,i].invoke("observe","location:reset",function(){i.value="";l.value=""});d.prototype.select=d.prototype.select.wrap(function(q,s){var r=this.suggestions[s];
var t=this.data[s];if(r){if(t=="others"){this.suggestmore();return}else{if(t!="none"){i.value=t;l.value=this.suggestions[s];l.fire("location:select",{data:t,value:this.suggestions[s]})}}this.ignoreValueChange=true;
this.hide()}});var n=Class.create({count:0,initialize:function(){this.enabled=false},start:function(s,q,r){this.count=s+1;this.atStep=q;this.atEnd=r;if(!this.enabled){this.enabled=true;this.throttle()}},throttle:function(){this.count-=1;
this.atStep(this.count);if(this.count>0){var q=this;this.enabled=true;window.setTimeout(function(){q.throttle()},1000)}else{this.atEnd();this.enabled=false}}});d.prototype.suggest=d.prototype.suggest.wrap(function(q){if(typeof(this.suggestIE6Patched)!="undefined"){this.suggestIE6Patched()
}if(this.suggestions.length===0){this.hide();return}var r=this;var t=[];var s=new RegExp("\\b"+this.currentValue.match(/\w+/g).join("|\\b"),"gi");other=false;this.suggestions.each(function(B,w){var A="";
var v="";var z="";if(this.suggestions.length<10){if(this.data[w]=="others"){if(!b){if(typeof(r.autoSuggestMoreTimer)=="undefined"){r.autoSuggestMoreTimer=new n()}z=(' (<span id="autosuggesttimer"></span>)');
r.autoSuggestMoreTimer.start(8,function(D){if(typeof r.container.select("#autosuggesttimer").first()!="undefined"){r.container.select("#autosuggesttimer").first().update(D+" "+gettext("secondes"));return
}},function(){if(m.enabled){m.suggestmore()}})}else{return}}try{var C=unescape(this.data[w]).evalJSON();if(C.latitude){if(C.type=="GMaps"){}if(C.latitude!=null){A=('<br/><img src="http://maps.google.com/maps/api/staticmap?center='+C.latitude+","+C.longitude+"&zoom=10&size=250x100&sensor=false&markers=color:red|color:red|label:A|"+C.latitude+","+C.longitude+'" />')
}}}catch(y){}}var u=(this.selectedIndex===w?" selected":"");var x=(w%2==0?"even":"odd");t.push('<div class="',u,'"><div class="item ',x,'"',' title="',B,'" onclick="Autocomplete.instances[',this.instanceId,"].select(",w,');" onmouseover="Autocomplete.instances[',this.instanceId,"].activate(",w,');">',Autocomplete.highlight(B,s),v,A,z,"</div></div>")
}.bind(this));this.enabled=true;this.container.update(t.join("")).show();f.hide()});var j=false;var g=function(){i.value=e;l.value=c};d.prototype.hide=d.prototype.hide.wrap(function(q){q();if(i.value=="none"&&!j){g()
}});var h=true;var o=this.serviceUrl;m=new d(l,{serviceUrl:o,minChars:1,maxHeight:400,width:300,deferRequestBy:300});var e;var c;l.observe("focus",function(){e=i.value;c=l.value;i.value="none";l.value="";
j=true;if(!m.container.empty()){m.container.show();if(typeof(m.suggestIE6Patched)!="undefined"){m.suggestIE6Patched()}}h=false});l.observe("blur",function(){j=false;if(i.value=="none"&&!m.enabled){g()}});
l.addClassName("autocomplete");l.insert({after:f});this._li}});var AjaxGeoCity=Class.create(LocationGeocoder,{initialize:function($super,a){this.serviceUrl="/ajaxv1/Geocoder/searchCity?";$super(a)}});(function(){var a="AjaxGeoCity";
var b=function(c){new AjaxGeoCity(c)};if(typeof(AjaxUI)=="undefined"){Event.observe(window,"load",function(){$$("."+a).each(function(c){b(c)})})}else{AjaxUI.subscribe(a,b)}})();(function(){var a="LocationGeocoder";
var b=function(c){new LocationGeocoder(c)};if(typeof(AjaxUI)=="undefined"){Event.observe(window,"load",function(){$$("."+a).each(function(c){b(c)})})}else{AjaxUI.subscribe(a,b)}})()};