1?optForm:null)),optInfoWindow);
this.map_.setZMarkerWithInfoWindow(this.idZMarker);
if(optInfoWindow.onOpenFn)
this.onOpenFn=optInfoWindow.onOpenFn;
}
ZMarker.prototype.setZInfoWindowPosition = function(){
this.map_.getInfoWindow().reposition(this.getPoint(),new GSize(0,-this.getIcon().iconSize.height-this.getIcon().maxHeight));
}
ZMarker.prototype.fitZInfoWindow = function(){
var offsetHeight=this.getIcon().maxHeight;
while(offsetHeight>0){
offsetHeight--;
setTimeout('zMap.getInfoWindow().reposition(zMarkers['+this.idZMarker+'].getPoint(),new GSize(0,'+(-this.getIcon().iconSize.height-offsetHeight)+'))',(500/this.getIcon().maxHeight));
}
if(this.onOpenFn)
this.onOpenFn();
}
ZMarker.prototype.getCategoryId = function(){
return this.categorie_.id;
}
ZMarker.prototype.getDistanceToCenter = function(){
return this.distance_;
}
ZMarker.prototype.setDistanceToCenter = function(distance){
this.distance_=distance;
}
ZMarker.prototype.inEditMode = function(){
return (this.draggable_ && this.draggingEnabled());
}
ZMarker.prototype.drawLineToCenter = function(){
if(this.zPolyline)
this.removeLineToCenter();
this.zPolyline = new ZPolyline(new Array(this.map_.getCenter(),this.getPoint()), '#'+this.categorie_.color, 3, 0.7, null, 'dash');
this.map_.addOverlay(this.zPolyline);
}
ZMarker.prototype.removeLineToCenter = function(){
if(this.zPolyline){
this.map_.removeOverlay(this.zPolyline);
delete this.zPolyline;
}
}
ZMarker.prototype.getMarkerIcon = function(){
var icon = new GIcon();
icon.image = this.srcIcon_;
icon.iconSize = new GSize(37, 51);
icon.shadow = this.srcIconShadow_;
icon.shadowSize = new GSize(57, 51);
icon.iconAnchor = new GPoint(18, 51);
icon.infoWindowAnchor = new GPoint(17,1);
icon.maxHeight=13;
icon.transparent=this.srcIconTransparent_;
icon.imageMap=[1,1,1,33,13,33,14,37,15,41,16,49,17,50,19,50,20,49,21,41,35,33,35,1];
//icon.imageMap=[0,0,36,0,36,33,22,33,18,48,14,33,0,33];
/*icon.printImage='';
icon.mozPrintImage='';
icon.printShadow='';
*/
return icon;
}
function ZMarkerTemp(point,options) {
this.isZMarkerTemp=true;
this.srcIcon_= options.srcIcon || "img/marker_edit.png";
this.srcIconShadow_= options.srcIconShadow || "img/marker_shadow.png";
this.srcIconTransparent_ = options.srcIconTransparent || "img/marker_transparent.png";
this.icon_= this.getMarkerIcon();
//this.icon_=new GIcon(G_DEFAULT_ICON);
this.title_=options.title || '';
//var arguments = new Array(point, {icon:this.icon_, dragCrossMove:false, clickable:true, draggable:true, bouncy:false, bounceGravity:1});
GMarker.apply(this,new Array(point, {icon:this.icon_, dragCrossMove:false, clickable:true, draggable:true, bouncy:false, bounceGravity:1}));
GEvent.addListener(this,'drag',this.setZInfoWindowPosition);
GEvent.addListener(this,'dragend',this.fitZInfoWindow);
}
ZMarkerTemp.prototype = new GMarker(new GLatLng(0, 0));
ZMarkerTemp.prototype.initialize = function(map) {
GMarker.prototype.initialize.call(this, map);
this.map_ = map;
}
ZMarkerTemp.prototype.redraw = function(force) {
GMarker.prototype.redraw.call(this, this.map_);
}
ZMarkerTemp.prototype.remove = function() {
GMarker.prototype.remove.call(this);
}
ZMarkerTemp.prototype.removeFromMap = function() {
this.map_.removeOverlay(this);
return null;
}
ZMarkerTemp.prototype.getZInfoWindowContent = function(optForm){
var info_window = document.createElement('div');
info_window.id='info_window';
var element = document.createElement('h4');
element.appendChild(document.createTextNode(this.title_));
info_window.appendChild(element);
element = document.createElement('p');
element.id='form_res';
element.appendChild(document.createTextNode('\u00a0'));
info_window.appendChild(element);
element = document.createElement('input');
element.id='hidIdPoi';
element.setAttribute('name','hidIdPoi');
element.setAttribute('type','hidden');
info_window.appendChild(element);
element = document.createElement('div');
element.id='info_forms';
info_window.appendChild(element);
ZForm.initialize(element,optForm.lang);
element = document.createElement('div');
element.id='buttons';
var button = document.createElement('input');
button.id='annuler';
button.setAttribute('type','button');
button.setAttribute('value',optForm.cancelLabel);
ZEvent.addEventListener(button,'click',optForm.cancelFn,false);
element.appendChild(button);
button = document.createElement('input');
button.id='valider';
button.setAttribute('type','button');
button.setAttribute('value',optForm.saveLabel);
ZEvent.addEventListener(button,'click',optForm.saveFn,false);
element.appendChild(button);
info_window.appendChild(element);
return info_window;
}
ZMarkerTemp.prototype.openZInfoWindow = function(options,optForm){
options.pixelOffset=new GSize(0,-this.getIcon().iconSize.height);
this.map_.setZMarkerTempWithInfoWindow();
this.map_.openInfoWindow(this.getPoint(),this.getZInfoWindowContent(optForm),options);
if(options.onOpenFn)
this.onOpenFn=options.onOpenFn;
}
ZMarkerTemp.prototype.setZInfoWindowPosition = function(){
this.map_.getInfoWindow().reposition(this.getPoint(),new GSize(0,-this.getIcon().iconSize.height-this.getIcon().maxHeight));
}
ZMarkerTemp.prototype.fitZInfoWindow = function(){
var offsetHeight=this.getIcon().maxHeight;
while(offsetHeight>0){
offsetHeight--;
setTimeout('zMap.getInfoWindow().reposition(zMarkerTemp.getPoint(),new GSize(0,'+(-this.getIcon().iconSize.height-offsetHeight)+'))',(500/this.getIcon().maxHeight));
}
if(this.onOpenFn)
this.onOpenFn();
}
ZMarkerTemp.prototype.getMarkerIcon = function(){
var icon = new GIcon();
icon.image = this.srcIcon_;
icon.shadow = this.srcIconShadow_;
icon.iconSize = new GSize(37, 51);
icon.maxHeight=13;
icon.shadowSize = new GSize(57, 51);
icon.iconAnchor = new GPoint(18, 51);
icon.infoWindowAnchor = new GPoint(17,1);
icon.transparent=this.srcIconTransparent_;
icon.imageMap=[1,1,1,33,13,33,14,37,15,41,16,49,17,50,19,50,20,49,21,41,35,33,35,1];
return icon;
}
function ZMarkerGeocoded(placemark,options) {
this.isZMarkerGeocoded=true;
this.idZMarkerGeocoded=null;
this.drawn=false;
this.isDrawn_=false;
this.zoomLevel_=0;
this.srcIcon_ = options?(options.srcIcon || "img/marker_geoloc.png"):"img/marker_geoloc.png";
this.srcIconShadow_ = options?(options.srcIconShadow || "img/marker_geolocshadow.png"):"img/marker_geolocshadow.png";
this.srcIconHighlight_ = options?(options.srcIconHighlight || "img/marker_geolocroll.png"):"img/marker_geolocroll.png";
this.srcIconTransparent_ = options?(options.srcIconTransparent || "img/marker_geoloctransparent.png"):"img/marker_geoloctransparent.png";
this.listId_='list_zmarker';
this.listEltName_ = 'list_eltg';
if(this.srcIcon_!="")
this.icon_= this.getMarkerIcon();
else
this.icon_= G_DEFAULT_ICON;
this.placemark_ = placemark;
if(this.placemark_.Point)
this.point_ = new GLatLng(this.placemark_.Point.coordinates[1],this.placemark_.Point.coordinates[0]);
else
this.point_ = new GLatLng(0,0);
if(this.placemark_.address)
this.location_=this.placemark_.address;
else
this.location_='';
GMarker.apply(this,new Array(this.point_, {title:this.location_,icon:this.icon_}));
}
ZMarkerGeocoded.prototype = new GMarker(new GLatLng(0,0));
ZMarkerGeocoded.prototype.initialize = function(map) {
GMarker.prototype.initialize.call(this, map);
this.map_ = map;
this.zoomLevel_ = this.map_.zGeocoder.getZoomLevel(this.placemark_);
this.drawn=true;
}
ZMarkerGeocoded.prototype.redraw = function(force) {
GMarker.prototype.redraw.call(this, this.map_);
}
ZMarkerGeocoded.prototype.remove = function() {
GMarker.prototype.remove.call(this);
}
ZMarkerGeocoded.prototype.removeFromMap = function() {
this.map_.removeOverlay(this);
return null;
}
ZMarkerGeocoded.prototype.getLocation = function() {
return this.location_;
}
ZMarkerGeocoded.prototype.getZoomLevel = function() {
return this.zoomLevel_;
}
ZMarkerGeocoded.prototype.setId = function(id){
this.idZMarkerGeocoded=id;
this.addMouseEvents();
}
ZMarkerGeocoded.prototype.getId = function(){
return this.idZMarkerGeocoded;
}
ZMarkerGeocoded.prototype.setIsDrawn = function(value){
this.isDrawn_=value;
}
ZMarkerGeocoded.prototype.isDrawn = function(){
return this.isDrawn_;
}
ZMarkerGeocoded.prototype.openZInfoWindow = function(options){
options.pixelOffset=new GSize(0,-this.getIcon().iconSize.height);
var p = document.createElement('p');
p.id='info_geocoded';
p.appendChild(document.createTextNode(this.location_));
this.map_.openInfoWindow(this.getPoint(),p,options);
this.map_.setZMarkerGeoWithInfoWindow(this.getId());
if(options.onOpenFn)
this.onOpenFn=options.onOpenFn;
}
ZMarkerGeocoded.prototype.drawLineToCenter = function(){
if(this.zPolyline)
this.removeLineToCenter();
this.zPolyline = new ZPolyline(new Array(this.map_.getCenter(),this.getPoint()), '#ff2020', 3, 0.7, null, 'dash');
this.map_.addOverlay(this.zPolyline);
}
ZMarkerGeocoded.prototype.removeLineToCenter = function(){
if(this.zPolyline){
this.map_.removeOverlay(this.zPolyline);
delete this.zPolyline;
}
}
ZMarkerGeocoded.prototype.getMarkerIcon = function(){
var icon = new GIcon();
icon.image = this.srcIcon_;
icon.shadow = this.srcIconShadow_;
icon.iconSize = new GSize(21, 47);
icon.shadowSize = new GSize(35, 47);
icon.iconAnchor = new GPoint(9, 45);
icon.infoWindowAnchor = new GPoint(10,0);
icon.transparent=this.srcIconTransparent_;
icon.imageMap=[2,2,2,28,8,28,8,47,11,47,11,28,18,28,18,2];
return icon;
}
ZMarkerGeocoded.prototype.addMouseEvents = function(){
if(this.srcIconHighlight_!=""){
GEvent.clearListeners(this,'mouseover');
GEvent.clearListeners(this,'mouseout');
GEvent.addListener(this,'mouseover',function(){
this.setImage(this.srcIconHighlight_);
if(parseInt(document.getElementById(this.listId_).style.width)>0){
document.getElementById(this.listEltName_+this.idZMarkerGeocoded).style.background='#fdf06a';
document.getElementById(this.listEltName_+this.idZMarkerGeocoded).style.cursor='pointer';
}
}
);
GEvent.addListener(this,'mouseout',function(){
this.setImage(this.srcIcon_);
if(parseInt(document.getElementById(this.listId_).style.width)>0){
document.getElementById(this.listEltName_+this.idZMarkerGeocoded).style.background='#ffffff';
document.getElementById(this.listEltName_+this.idZMarkerGeocoded).style.cursor='auto';
}
}
);
}
}
function ZPolyline(points, color, weight, opacity, tooltip, dash) {
this.tooltip_ = tooltip;
this.dash_ = (dash != null) ? dash : "solid";
this.color_ = color;
this.weight_ = weight;
this.opacity_ = opacity;
this.domId_='zpolyline';
this.usesVml = (navigator.userAgent.indexOf("MSIE") != -1);
GPolyline.call(this,points,color,weight,opacity);
}
ZPolyline.prototype = new GPolyline(new Array(new GLatLng(0,0)));
ZPolyline.prototype.initialize = function(map) {
GPolyline.prototype.initialize.call(this,map);
}
ZPolyline.prototype.remove = function() {
GPolyline.prototype.remove.call(this);
}
ZPolyline.prototype.redraw = function(force) {
GPolyline.prototype.redraw.call(this,force);
var elt=null;
if(this.usesVml){
var shps = document.getElementsByTagName("shape");
if(shps.length){
elt = shps[shps.length-1];
if(this.tooltip != null){
elt.style.cursor = "help";
elt.title = this.tooltip;
}
if(this.domId_)
elt.id = this.domId_;
}
}
else{
var shps = document.getElementsByTagName("path");
if(shps.length){
elt = shps[shps.length-1];
if(this.tooltip != null){
elt.style.cursor = "help";
elt.setAttribute("title",this.tooltip);
}
elt.setAttribute("id",this.domId_);
elt.setAttribute("pointer-events","stroke");
}
}
if(elt!=null){
this.setColor(this.color_);
this.setDash(this.dash_);
this.setOpacity(this.opacity_);
this.setWeight(this.weight_);
}
}
ZPolyline.prototype.setColor = function(color){
this.color_ = color;
var elt = document.getElementById(this.domId_);
if(this.usesVml)
elt.stroke.color = this.color_;
else
elt.setAttribute("stroke",this.color_);
}
ZPolyline.prototype.getColor = function(){
return this.color_;
}
ZPolyline.prototype.setDash = function(dash) {
this.dash_ = dash;
var elt = document.getElementById(this.domId_);
if(this.usesVml){
if(this.dash_ == "dash")
elt.stroke.dashstyle = "dash";
else if (this.dash_ == "dot")
elt.stroke.dashstyle = "dot";
else
elt.stroke.dashstyle = "";
}
else{
if(this.dash_ == "dash")
elt.setAttribute("stroke-dasharray","10,10");
else if (this.dash_ == "dot")
elt.setAttribute("stroke-dasharray","3,17");
else
elt.setAttribute("stroke-dasharray","");
}
}
ZPolyline.prototype.getDash = function() {
return this.dash_;
}
ZPolyline.prototype.setWeight = function(weight) {
this.weight_ = weight;
var elt = document.getElementById(this.domId_);
if(this.usesVml)
elt.stroke.weight = this.weight_+"px";
else
elt.setAttribute("stroke-width",this.weight_+"px");
}
ZPolyline.prototype.getWeight = function() {
return this.weight_;
}
ZPolyline.prototype.setOpacity = function(opacity) {
this.opacity_ = opacity;
var elt = document.getElementById(this.domId_);
if(this.usesVml)
elt.stroke.opacity = this.opacity_;
else
elt.setAttribute("stroke-opacity",this.opacity_);
}
ZPolyline.prototype.getOpacity = function() {
return this.opacity_;
}
ZPolyline.prototype.setDOMId = function(id) {
this.domId_=id;
}
function ZForm(){}
ZForm.prototype=ZForm;
ZForm.prototype.buildOnglet = function(codeLangue, selected){
var onglet = document.createElement('div');
onglet.setAttribute('id','onglet_'+codeLangue);
if(ZForm.languages[codeLangue])
onglet.setAttribute('title',ZForm.languages[codeLangue]);
if (isIE()){
onglet.setAttribute("className","div-onglet");
onglet.onmouseover=function(){this.style.cursor='pointer'};
onglet.onmouseout=function(){this.style.cursor='auto'};
onglet.onclick=ZForm.showOnglet;
}
else{
onglet.setAttribute("class","div-onglet");
onglet.setAttribute("onclick","ZForm.showOnglet('"+codeLangue+"')");
onglet.setAttribute("onmouseover","this.style.cursor='pointer'");
onglet.setAttribute("onmouseout","this.style.cursor='auto'");
}
onglet.setAttribute("title",ZForm.languages[codeLangue]);
onglet.innerHTML=codeLangue;
if(selected)
onglet.style.fontWeight='bold';
return onglet;
}
ZForm.prototype.buildForm = function(codeLangue,labels, selected){
var corps = document.createElement('div');
corps.setAttribute('id','form_'+codeLangue);
corps.setAttribute("class","div-form");
corps.setAttribute("className","div-form");
//corps.innerHTML=''+ZForm.languages[codeLangue]+'
'
corps.innerHTML=''
+''
+''
+''
+''
+''
+''
+'
'
+''
+''
+''
+'
'
+''
+'';
if(selected)
corps.style.display='block';
else
corps.style.display='none';
return corps;
}
ZForm.prototype.buildFormPicture = function(codeLangue,labels, seleted){
var corps = document.createElement('div');
corps.setAttribute('id','form_'+codeLangue);
corps.setAttribute("class","div-form");
corps.setAttribute("className","div-form");
var html = ''+ZForm.languages[codeLangue]+'
';
for(var i=0;i<9;i++){
reste=i-(Math.floor(i/2)*2);
html +=''
+''
+'
';
}
corps.innerHTML=html;
if(selected)
corps.style.display='block';
else
corps.style.display='none';
return corps;
}
ZForm.prototype.buildOngletLangue = function(){
var onglet = document.createElement('div');
onglet.setAttribute('id','onglet_lang');
if (isIE()){
onglet.onmouseover=function(){this.style.cursor='pointer'};
onglet.onmouseout=function(){this.style.cursor='auto'};
onglet.onclick=ZForm.showOnglet;
}
else{
onglet.setAttribute("onclick","ZForm.showOnglet('lang')");
onglet.setAttribute("onmouseover","this.style.cursor='pointer'");
onglet.setAttribute("onmouseout","this.style.cursor='auto'");
}
onglet.innerHTML=ZForm.lblLanguages;
return onglet;
}
ZForm.prototype.buildFormLangue = function(selLang){
var corps = document.createElement('div');
corps.setAttribute('id','form_lang');
corps.setAttribute("class","div-form");
corps.setAttribute("className","div-form");
var element = document.createElement('select');
element.setAttribute('id','selLangue');
element.setAttribute('name','selLangue');
element.setAttribute("title","Ajouter une langue");
var option = document.createElement('option');
option.setAttribute('id','selLangue_0');
option.setAttribute('value','');
option.innerHTML=ZForm.labels.langFirstOpt;
element.appendChild(option);
for(var codeLangue in ZForm.languages){
option = document.createElement('option');
option.setAttribute('id','selLangue_'+codeLangue);
option.setAttribute('value',codeLangue);
option.innerHTML=ZForm.languages[codeLangue];
element.appendChild(option);
}
delete option;
corps.appendChild(element);
var element= document.createElement('input');
element.setAttribute('type','button');
element.setAttribute("name","add_langue");
element.setAttribute("id","add_langue");
element.setAttribute("value",ZForm.labels.addButton);
if (isIE())
element.onclick=ZForm.addLanguage;
else
element.setAttribute("onclick","ZForm.addLanguage()");
corps.appendChild(element);
var element= document.createElement('h6');
element.innerHTML=ZForm.labels.languagesTableTitle;
corps.appendChild(element);
var element= document.createElement('table');
element.setAttribute("id","list_lang");
element.setAttribute("cellspacing","0");
element.setAttribute("cellpadding","0");
element.setAttribute("id","list_lang");
var tbody=document.createElement('tbody');
ZForm.buildListLanguages(tbody,selLang);
element.appendChild(tbody);
delete tbody;
corps.appendChild(element);
delete element;
return corps;
}
ZForm.prototype.initialize = function(parentDiv,selLang,labels){
if(parentDiv)
{
var divOnglets=document.createElement('div');
divOnglets.setAttribute('id','onglets');
var divForms=document.createElement('div');
divForms.setAttribute('id','forms');
for(var i=0;i'+ZForm.languages[codeLangue]+'';
tr.appendChild(td);
td_count++;
reste=td_count-(Math.floor(td_count/cols)*cols);
if(reste==0)
parent.appendChild(tr);
}
i++;
}
if(!td_count){
tr = document.createElement('tr');
td = document.createElement('td');
td.innerHTML='Aucune';
tr.appendChild(td);
parent.appendChild(tr);
}
//return tbody;
}
ZForm.prototype.languageExists = function(codeLangue){
var exists=false, divOnglets=document.getElementById('onglets'), i=0;
while(!exists && i2 && document.getElementById('onglet_'+codeLangue)
&& document.getElementById('onglet_'+codeLangue).parentNode.getAttribute('id')=='onglets'){
divOnglets.removeChild(document.getElementById('onglet_'+codeLangue));
divForms.removeChild(document.getElementById('form_'+codeLangue));
ZForm.clearListLanguages();
ZForm.listLanguages();
}
}
}
ZForm.prototype.addForm = function(codeLangue) {
var divOnglets=document.getElementById('onglets');
var divForms=document.getElementById('forms');
divOnglets.insertBefore(ZForm.buildOnglet(codeLangue),divOnglets.childNodes[divOnglets.childNodes.length-1]);
if(divForms.parentNode.getAttribute('id')=='titles')
divForms.insertBefore(ZForm.buildFormPicture(codeLangue),divForms.childNodes[divForms.childNodes.length-1]);
else
divForms.insertBefore(ZForm.buildForm(codeLangue),divForms.childNodes[divForms.childNodes.length-1]);
}
ZForm.prototype.setFieldValueForLanguage = function(id_field,codeLangue,value){
if(document.getElementById(id_field+'_'+codeLangue)){
document.getElementById(id_field+'_'+codeLangue).value=value;
return true;
}
else
return false;
}
ZForm.prototype.getFieldValueForLanguage = function(id_field,codeLangue){
if(document.getElementById(id_field+'_'+codeLangue))
return trim(document.getElementById(id_field+'_'+codeLangue).value);
else
return '';
}
ZForm.prototype.setFieldValue = function(id_field,value){
if(document.getElementById(id_field)){
document.getElementById(id_field).value=value;
return true;
}
else
return false;
}
ZForm.prototype.getFieldValue = function(id_field){
if(document.getElementById(id_field))
return trim(document.getElementById(id_field).value);
else
return '';
}
ZForm.prototype.setValuesFor = function(name,value){
var div=document.getElementById('forms');
for(var i=0;i0)
dLanguages+=';';
dLanguages+=lang;
var j=0;
while(j'+text+'';
}
ZForm.prototype.resetDialog = function(){
document.getElementById('form_res').style.background='none';
document.getElementById('form_res').innerHTML=' ';
}
ZForm.prototype.proccessingDialog = function(text){
document.getElementById('form_res').style.background='url(img/loading_16x16.gif) 5px 0px no-repeat';
document.getElementById('form_res').innerHTML=text;
}
ZForm.prototype.lock = function(on){
if(on)
ZForm.locked=true;
else
ZForm.locked=false;
var forms=document.getElementById('forms').getElementsByTagName('div');
for(var i=0;i0){
setFsDefaultValue();
resetSearchForm();
resetSearchCriteria();
var direction=-1;
}
else{
buildList(zMap,zMarkers,zMarkersGeocoded);
var direction=1;
}
widthes=getWidthes(outter_container_width,direction,20);
movediv(outter_container_div,icon_list_div,0,10);
}
function movediv(div,divTab,step,timelaps){
if (step0){
document.getElementById('form_fast_search').style.visibility="hidden";
document.getElementById(divTab).style.backgroundImage='url(img/hide-arrow.png)';
}
else{
setDefaultValue();
removeGeocodedMarkers();
document.getElementById(divTab).style.backgroundImage='url(img/show-arrow.png)';
document.getElementById('form_fast_search').style.visibility="visible";
}
//zMap.panBy(new GSize(direction*outter_container_width*(-1)/2,0));
delete widthes;
fitInfoWindowInMap();
clearTimeout(moveid);
}
}
function getWidthes(bound,direction,nb_steps){
var res=new Array(),i=0,width=(direction>0?0:bound);
while((direction>0 && width0)){
width=0.5*(1-(direction*Math.cos(Math.PI*i/nb_steps)))*bound;
if(width>bound)
width=bound;
else if(width<0)
width=0;
res[i]=width;
i++;
}
return res;
}
function buildList(map,markers,geocodedMarkers){
var idCateg=0;
var dt=null;
var dd=null;
var span = null;
emptyList();
var dl = document.getElementById('dl_list_content');
if(geocodedMarkers.length){
var center = map.getCenter();
dt=document.createElement('dt');
if(isIE())
dt.style.setAttribute('cssText','color:#ff2020;');
else
dt.setAttribute('style','color:#ff2020;');
dt.appendChild(document.createTextNode(map.zGeocoder.getListLabel()));
dl.appendChild(dt);
for(var i in geocodedMarkers){
dd=document.createElement('dd');
dd.setAttribute('id','list_eltg'+geocodedMarkers[i].getId());
dd.setAttribute('zmarkergeoid',geocodedMarkers[i].getId());
if(isIE())
dd.style.setAttribute('cssText','color:#000000;');
else
dd.setAttribute('style','color:#000000;');
ZEvent.addEventListener(dd,'mouseout',listElementMouseEvent,false);
ZEvent.addEventListener(dd,'mouseover',listElementMouseEvent,false);
ZEvent.addEventListener(dd,'click',listElementMouseEvent,false);
span = document.createElement('span');
if(isIE())
span.style.setAttribute('cssText','color:#ff2020;');
else
span.setAttribute('style','color:#ff2020;');
span.appendChild(document.createTextNode(meterToKM(center.distanceFrom(geocodedMarkers[i].getPoint()),2)+' km'));
dd.appendChild(document.createTextNode(geocodedMarkers[i].getLocation()+' '));
dd.appendChild(span);
dl.appendChild(dd);
}
}
if(markers.length){
for(var i in markers){
if(markers[i].isOnMap){
if(idCateg!=markers[i].categorie_.id){
dt=document.createElement('dt');
if(isIE())
dt.style.setAttribute('cssText','color:#'+markers[i].categorie_.color+';');
else
dt.setAttribute('style','color:#'+markers[i].categorie_.color+';');
dt.appendChild(document.createTextNode(markers[i].categorie_.name));
dl.appendChild(dt);
idCateg=markers[i].categorie_.id;
}
var dd=document.createElement('dd');
dd.setAttribute('id','list_elt'+markers[i].idZMarker);
dd.setAttribute('zmarkerid',markers[i].idZMarker);
if(isIE())
dd.style.setAttribute('cssText','color:#000000;');
else
dd.setAttribute('style','color:#000000;');
ZEvent.addEventListener(dd,'mouseout',listElementMouseEvent,false);
ZEvent.addEventListener(dd,'mouseover',listElementMouseEvent,false);
ZEvent.addEventListener(dd,'click',listElementMouseEvent,false);
span = document.createElement('span');
if(isIE())
span.style.setAttribute('cssText','color:#'+markers[i].categorie_.color+';');
else
span.setAttribute('style','color:#'+markers[i].categorie_.color+';');
span.appendChild(document.createTextNode(meterToKM(markers[i].getDistanceToCenter(),2)+' km'));
dd.appendChild(document.createTextNode(markers[i].title_[markers[i].lang_]+' '));
dd.appendChild(span);
dl.appendChild(dd);
}
}
}
//GLog.write(innerHTML);
addListResultWarning(map);
}
function emptyList(){
var dl = document.getElementById('dl_list_content');
while(dl.hasChildNodes()){
ZEvent.dispatchEvent(dl.firstChild,'MouseEvents','mouseout');
ZEvent.removeEventListener(dl.firstChild,'mouseout',listElementMouseEvent,false);
ZEvent.removeEventListener(dl.firstChild,'mouseover',listElementMouseEvent,false);
ZEvent.removeEventListener(dl.firstChild,'click',listElementMouseEvent,false);
dl.removeChild(dl.firstChild);
}
}
function addListResultWarning(map){
if(map.getNbVisibleMarkers()==0 || map.getNbVisibleMarkers()==map.getMaxMarkers()){
var dl = document.getElementById('dl_list_content');
var dt = document.createElement('dt');
if(isIE())
dt.style.setAttribute('cssText','color:#bf282d;');
else
dt.setAttribute('style','color:#bf282d;');
if(map.getNbVisibleMarkers()==0){
dt.appendChild(document.createTextNode(map.getListNoResultLabel()));
dl.appendChild(dt);
}
else{
dt.appendChild(document.createTextNode(map.getListMaxResultsLabel()));
dl.insertBefore(dt,dl.firstChild);
}
}
}
function listElementMouseEvent(e){
var zEvent = new ZEvent(e);
var zMarkerId = zEvent.source.getAttribute('zmarkerid')?zEvent.source.getAttribute('zmarkerid'):(zEvent.source.parentNode.getAttribute('zmarkerid')?zEvent.source.parentNode.getAttribute('zmarkerid'):null);
var zMarkerGeoId = zEvent.source.getAttribute('zmarkergeoid')?zEvent.source.getAttribute('zmarkergeoid'):(zEvent.source.parentNode.getAttribute('zmarkergeoid')?zEvent.source.parentNode.getAttribute('zmarkergeoid'):null);
if(zMarkerId && isPOIDrawn(zMarkerId)){
GEvent.trigger(zMarkers[zMarkerId],zEvent.type);
if(zEvent.type=='click' && zMap.getZoom()<14)
zMap.setCenter(zMarkers[zMarkerId].getPoint(),14);
else if(zEvent.type=='mouseover')
zMarkers[zMarkerId].drawLineToCenter();
else if(zEvent.type=='mouseout')
zMarkers[zMarkerId].removeLineToCenter();
}
else if(zMarkerGeoId && isGeocodedPOIDrawn(zMarkerGeoId)){
GEvent.trigger(zMarkersGeocoded[zMarkerGeoId],zEvent.type);
if(zEvent.type=='click')
zMap.setCenter(zMarkersGeocoded[zMarkerGeoId].getPoint(),zMarkersGeocoded[zMarkerGeoId].getZoomLevel());
else if(zEvent.type=='mouseover')
zMarkersGeocoded[zMarkerGeoId].drawLineToCenter();
else if(zEvent.type=='mouseout')
zMarkersGeocoded[zMarkerGeoId].removeLineToCenter();
}
}
function setElementState(elt,state,refresh){
if (refresh || state != elt.getAttribute('state')) {
elt.setAttribute('state', state);
if (elt.nodeName.toLowerCase() == 'th') {
elt.setAttribute("class","th_icon_"+elt.getAttribute('value')+'_'+state);
elt.setAttribute("className","th_icon_"+elt.getAttribute('value')+'_'+state);
checkOthersState((state == 'on' ? true : false));
}
else{
if(state=='on'){
elt.setAttribute("class","cl_icon_"+elt.getAttribute('value'));
elt.setAttribute("className","cl_icon_"+elt.getAttribute('value'));
}
else{
elt.setAttribute("class","cl_icon_off");
elt.setAttribute("className","cl_icon_off");
}
}
}
}
function updateSelectedCategories(elt){
if(!elt && isIE())
elt=window.event.srcElement;
var state=elt.getAttribute('state');
var value=elt.getAttribute('value');
if(state=='on'){
if(value!='autres'){
setElementState(elt,'off',false);
removeFromSelectedCategories(value);
}
else{
var th=document.getElementById('categ_sub_list').getElementsByTagName('th');
for(var i=0;i