function estimate_home_init(){try{location_ac_init("place","location_container");create_price_map()}catch(a){log_jse(a)}}function standard_location_ac_selected_action(a,b){if(a=="postal_code"){Dom.get("postal_code").value=b.postal_code;Dom.get("city_cd").value="";Dom.get("dep_cd").value=""}else{if(a=="city"){Dom.get("postal_code").value="";Dom.get("city_cd").value=b.code;Dom.get("dep_cd").value=""}else{if(a=="department"){Dom.get("postal_code").value="";Dom.get("city_cd").value="";Dom.get("dep_cd").value=b.code}}}}function create_price_map(){if(GBrowserIsCompatible()){var e=Dom.get("region_info");var d=[];var g;var k=[];var j=new Object();j.Alsace=new Array(48.242918,7.543056,-20,0);j.Aquitaine=new Array(44.274445,-0.167916,-20,-5);j.Auvergne=new Array(45.69875,3.281945,-25,-5);j["Basse-Normandie"]=new Array(48.969027,-0.4975,-35,10);j.Bourgogne=new Array(47.269167,4.190139,-30,5);j.Bretagne=new Array(48.07,-3.064861,-20,0);j.Centre=new Array(47.645832,1.570833,-15,10);j["Champagne-Ardenne"]=new Array(48.875971,4.640417,-35,0);j.Corse=new Array(42.188096,9.04704,-15,10);j["Franche-Comté"]=new Array(47.122778,6.193472,-35,10);j["Haute-Normandie"]=new Array(49.368471,0.930833,-25,5);j["Île-de-France"]=new Array(48.67264,2.479861,-15,10);j["Languedoc-Roussillon"]=new Array(43.654583,3.2575,-20,20);j.Limousin=new Array(45.675694,1.626528,-20,5);j.Lorraine=new Array(48.721388,6.25,-25,5);j["Midi-Pyrénées"]=new Array(43.804026,1.541111,-30,0);j["Nord-Pas-de-Calais"]=new Array(50.53125,2.885555,-35,10);j["Pays de la Loire"]=new Array(47.429028,-0.840972,-10,10);j.Picardie=new Array(49.605694,2.805555,-20,0);j["Poitou-Charentes"]=new Array(46.128332,-0.192083,-20,10);j["Provence-Alpes-Côte d'Azur"]=new Array(44.06139,6.023611,-20,25);j["Rhône-Alpes"]=new Array(45.31625,5.396667,-25,0);var a=new GMap2(Dom.get("map_france"),{mapTypes:[G_PHYSICAL_MAP],size:new google.maps.Size("380","350")});var m=new GLatLng(46.5,2,5);a.setCenter(m,5);a.disableInfoWindow();a.disableDragging();a.disableDoubleClickZoom();a.disableContinuousZoom();a.disableScrollWheelZoom();a.disablePinchToZoom();EP.info_label=new ELabel(a.getCenter(),"Label text","elabel_advanced_search_01",new GSize(0,0));EP.info_label.hide();a.addOverlay(EP.info_label);var c,f,l;var i=new YAHOO.util.XHRDataSource(base_url);i.responseType=YAHOO.util.XHRDataSource.TYPE_JSON;i.responseSchema={resultsList:"ResultSet",fields:["b","c","n","p","cd"]};var o=function(u,q){var r,p,v,t,w;for(var s=0;s<q.results.length;s++){r=YAHOO.lang.JSON.parse(q.results[s].b);p=q.results[s].c;v=q.results[s].n;t=q.results[s].p;w=q.results[s].cd;h(r,p,v,t,w)}};var h=function(s,u,p,x,y){var z=[];var t=0;var r=0;for(var w=0;w<s.length;w++){z.push(new GPoint(s[w].x,s[w].y));t+=s[w].x;r+=s[w].y}t=t/s.length;r=r/s.length;var q=new GLatLng(r,t);region_polygon=new GPolygon(z,"#FFFFFF",2,0.4,u,1);a.addOverlay(region_polygon);var v=region_polygon;GEvent.addListener(v,"click",function(){var A=p+"<br>"+x+" €/m²";EP.info_label.setContents(A);EP.info_label.setPoint(q);EP.info_label.show()});GEvent.addListener(v,"mouseover",function(){document.body.style.cursor="pointer"});GEvent.addListener(v,"mouseout",function(){document.body.style.cursor="default"})};var b=function(p){if(p.responseText==undefined){}};var n={success:o,failure:b};i.sendRequest("prix-immobilier/whole_price_map",n)}else{alert("Votre navigateur ne permet pas l'affichage de la carte des prix.")}}function ELabel(a,e,f,c,d,b){this.point=a;this.html=e;this.classname=f||"";this.pixelOffset=c||new GSize(0,0);if(d){if(d<0){d=0}if(d>100){d=100}}this.percentOpacity=d;this.overlap=b||false;this.hidden=false}ELabel.prototype=new GOverlay();ELabel.prototype.initialize=function(a){var c=document.createElement("div");c.style.position="absolute";c.innerHTML='<div class="'+this.classname+'">'+this.html+"</div>";a.getPane(G_MAP_FLOAT_SHADOW_PANE).appendChild(c);this.map_=a;this.div_=c;if(this.percentOpacity){if(typeof(c.style.filter)=="string"){c.style.filter="alpha(opacity:"+this.percentOpacity+")"}if(typeof(c.style.KHTMLOpacity)=="string"){c.style.KHTMLOpacity=this.percentOpacity/100}if(typeof(c.style.MozOpacity)=="string"){c.style.MozOpacity=this.percentOpacity/100}if(typeof(c.style.opacity)=="string"){c.style.opacity=this.percentOpacity/100}}if(this.overlap){var b=GOverlay.getZIndex(this.point.lat());this.div_.style.zIndex=b}if(this.hidden){this.hide()}};ELabel.prototype.remove=function(){this.div_.parentNode.removeChild(this.div_)};ELabel.prototype.copy=function(){return new ELabel(this.point,this.html,this.classname,this.pixelOffset,this.percentOpacity,this.overlap)};ELabel.prototype.redraw=function(b){var c=this.map_.fromLatLngToDivPixel(this.point);var a=parseInt(this.div_.clientHeight);if(c.x+this.pixelOffset.width+this.div_.offsetWidth>this.map_.getSize().width){c.x=this.map_.getSize().width-this.div_.offsetWidth-this.pixelOffset.width}this.div_.style.left=(c.x+this.pixelOffset.width)+"px";this.div_.style.top=(c.y+this.pixelOffset.height-a)+"px"};ELabel.prototype.show=function(){if(this.div_){this.div_.style.display="";this.redraw()}this.hidden=false};ELabel.prototype.hide=function(){if(this.div_){this.div_.style.display="none"}this.hidden=true};ELabel.prototype.isHidden=function(){return this.hidden};ELabel.prototype.supportsHide=function(){return true};ELabel.prototype.setContents=function(a){this.html=a;this.div_.innerHTML='<div class="'+this.classname+'">'+this.html+"</div>";this.redraw(true)};ELabel.prototype.setPoint=function(a){this.point=a;if(this.overlap){var b=GOverlay.getZIndex(this.point.lat());this.div_.style.zIndex=b}this.redraw(true)};ELabel.prototype.setOpacity=function(a){if(a){if(a<0){a=0}if(a>100){a=100}}this.percentOpacity=a;if(this.percentOpacity){if(typeof(this.div_.style.filter)=="string"){this.div_.style.filter="alpha(opacity:"+this.percentOpacity+")"}if(typeof(this.div_.style.KHTMLOpacity)=="string"){this.div_.style.KHTMLOpacity=this.percentOpacity/100}if(typeof(this.div_.style.MozOpacity)=="string"){this.div_.style.MozOpacity=this.percentOpacity/100}if(typeof(this.div_.style.opacity)=="string"){this.div_.style.opacity=this.percentOpacity/100}}};ELabel.prototype.getPoint=function(){return this.point};ELabel.prototype.U=function(){return this.point};ELabel.prototype.V=function(){return this.point};ELabel.prototype.W=function(){return this.point};ELabel.prototype.X=function(){return this.point};ELabel.prototype.Y=function(){return this.point};ELabel.prototype.Z=function(){return this.point};
