Index: extensions/GMaps/gmaps_pip.class.inc.php
===================================================================
--- extensions/GMaps/gmaps_pip.class.inc.php	(revision 11529)
+++ extensions/GMaps/gmaps_pip.class.inc.php	(revision 12204)
@@ -88,5 +88,5 @@
 
     add_event_handler('loc_begin_index', array(&$this, 'displayCategoryPageMap'));
-    add_event_handler('loc_begin_picture', array(&$this, 'displayPicturePageMap'), EVENT_HANDLER_PRIORITY_NEUTRAL+5);
+    if(!isset($_GET['slideshow'])) add_event_handler('loc_begin_picture', array(&$this, 'displayPicturePageMap'), EVENT_HANDLER_PRIORITY_NEUTRAL+5);
     add_event_handler('amd_jpegMD_loaded', array(&$this, 'preparePictureMaps'));
     add_event_handler('loc_end_page_header', array(&$this->css2, 'applyCSS'));
@@ -314,6 +314,7 @@
 </script>", false);
 
+          GPCCore::addHeaderJS('gmaps.infoWindow', GMAPS_PATH.'js/gmapsInfoWindow'.GPCCore::getMinified().'.js', array('jquery'));
+          GPCCore::addHeaderJS('gmaps.category', GMAPS_PATH.'js/gmapsCategory'.GPCCore::getMinified().'.js', array('jquery', 'gmaps.infoWindow'));
         }
-
       }
     }
Index: extensions/GMaps/gmaps_version.inc.php
===================================================================
--- extensions/GMaps/gmaps_version.inc.php	(revision 11529)
+++ extensions/GMaps/gmaps_version.inc.php	(revision 12204)
@@ -15,6 +15,6 @@
   if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-  define('GMAPS_VERSION',  '1.3.1');
-  define('GMAPS_VERSION2', '01.03.01');
+  define('GMAPS_VERSION',  '1.3.2');
+  define('GMAPS_VERSION2', '01.03.02');
   define('GMAPS_GPC_NEEDED', '3.5.1');
   define('GMAPS_AMD_NEEDED', '0.6.0'); //advanced metadata plugin is needed
Index: extensions/GMaps/js/gmapsCategory.js
===================================================================
--- extensions/GMaps/js/gmapsCategory.js	(revision 11529)
+++ extensions/GMaps/js/gmapsCategory.js	(revision 12204)
@@ -2,417 +2,486 @@
  * -----------------------------------------------------------------------------
  * file: gmapsCategory.js
- * file version: 1.2.1
- * date: 2011-04-21
+ * file version: 1.2.2
+ * date: 2011-09-23
  */
 
-var markerImgProp = [
-  null,
-  { w:32, h:32, x:15, y:31 }, // s01
-  { w:32, h:32, x:15, y:31 }, // s02
-  { w:32, h:32, x:10, y:31 }, // s03
-  { w:30, h:40, x:4, y:39 } // s04
-];
-
-
-
-/**
- * create the map
- *
- * @param Object properties : map properties
- * @param Integer gmapsIndex : index in the map list
- */
-function createMap(properties, gmapsIndex)
+ var gmapsCM=null,
+     gmapsMM=null;
+
+function categoryMaps()
 {
-  var map = new google.maps.Map($("#"+properties.id).get(0),
-    {
-      backgroundColor:'#ffffff',
-      mapTypeId: properties.mapType,
-      zoom: properties.zoomLevel,
-      center: gmaps.bounds.getCenter(),
-      navigationControl: (properties.navigationControl==-1)?false:true,
-      scrollwheel: (properties.navigationControl==-1)?false:true,
-      scaleControl: (properties.scaleControl=='n')?false:true,
-      streetViewControl: (properties.streetViewControl=='n')?false:true,
-      mapTypeControl:(properties.mapTypeControl==-1)?false:true,
-      mapTypeControlOptions:
-        {
-          style:properties.mapTypeControl
+  var markerImgProp = [
+        null,
+        { w:32, h:32, x:15, y:31 }, // s01
+        { w:32, h:32, x:15, y:31 }, // s02
+        { w:32, h:32, x:10, y:31 }, // s03
+        { w:30, h:40, x:4, y:39 } // s04
+      ],
+      previousThumb={width:-1, height:-1};
+
+
+
+  /**
+   * create the map
+   *
+   * @param Object properties : map properties
+   * @param Integer gmapsIndex : index in the map list
+   */
+  this.createMap = function(properties, gmapsIndex)
+  {
+    var map = new google.maps.Map($("#"+properties.id).get(0),
+      {
+        backgroundColor:'#ffffff',
+        mapTypeId: properties.mapType,
+        zoom: properties.zoomLevel,
+        center: gmaps.bounds.getCenter(),
+        navigationControl: (properties.navigationControl==-1)?false:true,
+        scrollwheel: (properties.navigationControl==-1)?false:true,
+        scaleControl: (properties.scaleControl=='n')?false:true,
+        streetViewControl: (properties.streetViewControl=='n')?false:true,
+        mapTypeControl:(properties.mapTypeControl==-1)?false:true,
+        mapTypeControlOptions:
+          {
+            style:properties.mapTypeControl
+          },
+        markerTitle:''
+      }
+    );
+
+    if(properties.kmlFileUrl!='')
+    {
+      kmlFile = new google.maps.KmlLayer(properties.kmlFileUrl,
+        {
+          preserveViewport:true
+        }
+      );
+      kmlFile.setMap(map);
+    }
+    else
+    {
+      kmlFile=null;
+    }
+
+    re=/^mS(\d\d)_.*/i;
+    iM=re.exec(properties.markerImg);
+    if(iM!=null) iM=new Number(iM[1]);
+
+    if(iM!=null)
+    {
+      map.markerImg = new google.maps.MarkerImage('plugins/GMaps/img/'+properties.markerImg,
+          new google.maps.Size(markerImgProp[iM].w, markerImgProp[iM].h),
+          new google.maps.Point(0,0),
+          new google.maps.Point(markerImgProp[iM].x, markerImgProp[iM].y));
+    }
+    else
+    {
+      map.markerImg = null;
+    }
+
+    map.kmlFile=kmlFile;
+    map.markers=new Array();
+    map.gmapsIndex=gmapsIndex;
+    map.viewportInitialized=false;
+    map.callId=0;
+    properties.gMap=map;
+  }
+
+  /**
+   * load markers from the server
+   *
+   * @param Map map : the map
+   */
+  this.loadMarkers = function(map)
+  {
+    var __this=this;
+    map.callId++;
+
+    datas={
+      requestId:gmaps.requestId,
+      callId:map.callId,
+      bounds:{
+          north:map.getBounds().getNorthEast().lat(),
+          east:map.getBounds().getNorthEast().lng(),
+          south:map.getBounds().getSouthWest().lat(),
+          west:map.getBounds().getSouthWest().lng()
         },
-      markerTitle:''
-    }
-  );
-
-  if(properties.kmlFileUrl!='')
-  {
-    kmlFile = new google.maps.KmlLayer(properties.kmlFileUrl,
-      {
-        preserveViewport:true
+      width:$(map.getDiv()).width(),
+      height:$(map.getDiv()).height(),
+      distanceTreshold:20,
+      loadIndex:map.gmapsIndex,
+    };
+
+
+    $('#gmapsLoading').css('display', 'inline-block');
+    $('#gmapsNbPhotos').html('');
+
+    $.ajax(
+      {
+        type: "POST",
+        url: "plugins/GMaps/gmaps_ajax.php",
+        async: true,
+        data: { ajaxfct:"public.maps.getMarkers", datas:datas },
+        success:
+          function(msg)
+          {
+            tmp=$.parseJSON(msg);
+            if(gmaps.maps[tmp.loadIndex].gMap.callId==tmp.callId)
+            {
+              tmp.markers.sort(compareMarkers);
+              __this.applyMarkers(gmaps.maps[tmp.loadIndex].gMap, tmp.markers);
+              $('#gmapsLoading').css('display', 'none');
+              $('#gmapsNbPhotos').html('['+tmp.datas.nbPhotos+']');
+            }
+          }
       }
     );
-    kmlFile.setMap(map);
-  }
-  else
-  {
-    kmlFile=null;
-  }
-
-  re=/^mS(\d\d)_.*/i;
-  iM=re.exec(properties.markerImg);
-  if(iM!=null) iM=new Number(iM[1]);
-
-  if(iM!=null)
-  {
-    map.markerImg = new google.maps.MarkerImage('plugins/GMaps/img/'+properties.markerImg,
-        new google.maps.Size(markerImgProp[iM].w, markerImgProp[iM].h),
-        new google.maps.Point(0,0),
-        new google.maps.Point(markerImgProp[iM].x, markerImgProp[iM].y));
-  }
-  else
-  {
-    map.markerImg = null;
-  }
-
-  map.kmlFile=kmlFile;
-  map.markers=new Array();
-  map.gmapsIndex=gmapsIndex;
-  map.viewportInitialized=false;
-  map.callId=0;
-  properties.gMap=map;
+  }
+
+  /**
+   * apply markers to map
+   *
+   * @param Map map : the google map object
+   * @param Array markers : array of markers properties
+   *                        each marker is an object with properties :
+   *                          latitude, longitude, nbImg
+   */
+  this.applyMarkers = function(map, markers)
+  {
+    var __this=this;
+
+    /*
+     * deleting markers from the map only if they are not in the new list
+     */
+    if(map.markers.length>0)
+    {
+      var i=0;
+      while(i<map.markers.length)
+      {
+        newListIndex=this.markerInList(map.markers[i].uId, markers);
+        if(newListIndex==-1)
+        {
+          map.markers[i].marker.setMap(null);
+          map.markers.splice(i, 1);
+        }
+        else
+        {
+          markers.splice(newListIndex,1);
+          i++;
+        }
+      }
+    }
+
+    /*
+     * add new markers on the map
+     */
+    for(var i=0;i<markers.length;i++)
+    {
+      var marker = new google.maps.Marker(
+        {
+          position:new google.maps.LatLng(markers[i].lat, markers[i].lng),
+          map: map,
+          title:markers[i].nbImgTxt
+        }
+      );
+
+      if(map.markerImg!=null) marker.setIcon(map.markerImg);
+
+      marker.info=markers[i];
+      marker.info.displayed=0;
+
+      map.markers.push(
+        {
+          marker:marker,
+          uId:markers[i].uId
+        }
+      );
+
+      google.maps.event.addListener(
+        marker,
+        'click',
+        function ()
+        {
+          __this.displayWindowInfo(this);
+        }
+      );
+
+      for(var index=0;index<marker.info.imgTn.length;index++)
+      {
+        switch(marker.info.imgTn[index].charAt(0))
+        {
+          case 'G':
+            marker.info.imgTn[index]='./galleries/'+marker.info.imgTn[index].substr(1);
+            break;
+          case 'U':
+            marker.info.imgTn[index]='./upload/'+marker.info.imgTn[index].substr(1);
+            break;
+        }
+      }
+    }
+  }
+
+  var compareMarkers=function(m1,m2)
+  {
+    if(m1.uId<m2.uId)
+    {
+      return(-1);
+    }
+    else if(m1.uId<m2.uId)
+    {
+      return(1);
+    }
+    return(0);
+  }
+
+  this.markerInList = function(uniqueId, markerList)
+  {
+    for(var i=0;i<markerList.length;i++)
+    {
+      if(markerList[i].uId==uniqueId) return(i)
+    }
+    return(-1);
+  }
+
+  /**
+   * display the infowindow
+   *
+   * @param Marker marker : the marker
+   */
+  this.displayWindowInfo = function(marker)
+  {
+    var __this=this;
+
+    if(gmapsMM!=null && gmapsMM instanceof markupMaps) gmapsMM.closePictureInfo();
+
+    previousThumb.width=-1;
+    previousThumb.width=-1;
+
+    gmaps.currentMarker=marker;
+    gmaps.currentInfo=marker.info;
+    gmaps.infoWindow.close();
+    gmaps.infoWindow.setContent($('#iGMapsInfoWindowContent').clone().each(renameId).get(0));
+    gmaps.infoWindow.open(marker.map, marker);
+    $('#ciWALeft, #ciWARight').unbind('click');
+    $('#ciWARight').bind('click', function(event) { __this.displayPictureNext(); } );
+    $('#ciWALeft').bind('click', function(event) { __this.displayPicturePrev(); } );
+    this.displayPictureInfo(gmaps.currentInfo.displayed);
+  }
+  var renameId = function(i, e)
+  {
+    if(e.id!='') e.id='c'+e.id;
+    $(e).children().each(renameId);
+  }
+
+
+  this.closePictureInfo = function ()
+  {
+    gmaps.currentMarker=null;
+    gmaps.currentInfo=null;
+    gmaps.infoWindow.setContent('');
+    gmaps.infoWindow.close();
+    $('#ciGMIWC_img').unbind('click');
+    $('#ciWALeft, #ciWARight').unbind('click');
+  }
+
+  /**
+   *
+   */
+  this.displayPictureInfo = function(index)
+  {
+    var __index=index,
+        __this=this;
+
+    gmaps.currentInfo.displayed=index;
+    if(gmaps.currentInfo.imgName[index]=='')
+    {
+      $('#ciGMIWC_title').html('&nbsp;');
+    }
+    else
+    {
+      $('#ciGMIWC_title').html(gmaps.currentInfo.imgName[index]);
+    }
+    $('#ciGMIWC_img')
+      .attr('src', gmaps.currentInfo.imgTn[index])
+      .bind('load',
+        function (event)
+          {
+            /*
+             * this methods works but there's a terrible flick...
+             * wait to find another solution... :-/
+             * (and need to be implemented for the markupMaps object too
+             *
+            if(previousThumb.width!=-1)
+            {
+              if(previousThumb.width!=event.target.width || previousThumb.height!=event.target.height)
+              {
+                __this.displayWindowInfo(gmaps.currentMarker);
+                return(false);
+              }
+            }
+            else
+            {
+              previousThumb.width=event.target.width;
+              previousThumb.height=event.target.height;
+            }
+            */
+          }
+      );
+
+    $('#ciGMIWC_img').unbind('click');
+
+    if(gmaps.currentInfo.imgCatsUrl[index].length==1)
+    {
+      $('#ciGMIWC_img').bind('click',
+        function ()
+        {
+          window.location=gmaps.currentInfo.imgCatsUrl[gmaps.currentInfo.displayed][0];
+        }
+      );
+    }
+    else
+    {
+      $('#ciGMIWC_showcatList').html('');
+      for(var i=0;i<gmaps.currentInfo.imgCatsUrl[index].length;i++)
+      {
+        $('#ciGMIWC_showcatList')
+          .append('<li><a href="'+gmaps.currentInfo.imgCatsUrl[index][i]+'">'+gmaps.currentInfo.imgCatsNames[index][i]+'</a></li>');
+      }
+      $('#ciGMIWC_img, #ciGMIWC_showcat')
+        .bind('mouseenter', function () { $('#ciGMIWC_showcat').css('display', 'block'); } )
+        .bind('mouseleave', function () { $('#ciGMIWC_showcat').css('display', 'none'); } );
+    }
+
+    if(gmaps.currentInfo.nbImg>1)
+    {
+      $('#ciGMIWC_picnum').html((index+1)+'/'+gmaps.currentInfo.nbImgTxt);
+      $('#ciWALeft, #ciWARight').css('display', 'inline-block');
+    }
+    else
+    {
+      $('#ciGMIWC_picnum').html(gmaps.currentInfo.nbImgTxt);
+      $('#ciWALeft, #ciWARight').css('display', 'none');
+    }
+  }
+
+  /**
+   *
+   */
+  this.displayPicturePrev = function()
+  {
+    gmaps.currentInfo.displayed--;
+    if(gmaps.currentInfo.displayed<0) gmaps.currentInfo.displayed=gmaps.currentInfo.nbImg-1;
+    this.displayPictureInfo(gmaps.currentInfo.displayed);
+  }
+
+  /**
+   *
+   */
+  this.displayPictureNext = function()
+  {
+    gmaps.currentInfo.displayed++;
+    if(gmaps.currentInfo.displayed>=gmaps.currentInfo.nbImg) gmaps.currentInfo.displayed=0;
+    this.displayPictureInfo(gmaps.currentInfo.displayed);
+  }
+
+
+  /**
+   * check if zoomLevel
+   */
+  this.fitToBounds = function(bounds, mapIndex)
+  {
+    gmaps.maps[mapIndex].gMap.fitBounds(bounds);
+
+    if(gmaps.maps[mapIndex].zoomLevelMaxActivated &&
+       gmaps.maps[mapIndex].gMap.getZoom() > gmaps.maps[mapIndex].zoomLevel)
+    {
+      gmaps.maps[mapIndex].gMap.setZoom(gmaps.maps[mapIndex].zoomLevel);
+    }
+  }
+
+  this.initializeMapViewport = function(mode, mapIndex)
+  {
+    var __this=this;
+
+    if(mapIndex>-1 &&
+       ($('#'+gmaps.maps[mapIndex].id+'Content').dialog('isOpen') && mode=='loaded' || mode=='open') &&
+       (gmaps.maps[mapIndex].gMap.viewportInitialized==false)
+      )
+    {
+      /*
+       * if the container is not visible when map are built, they are
+       * not initialized correctly
+       *
+       * when dialog is opened for the first time, proceed to map
+       * finalization :
+       *  - resize
+       *  - center the map
+       *  - add handlers on events 'dragend' and 'zoom_change'
+       *    allowing to reload markers according to the new viewport
+       */
+      google.maps.event.trigger(gmaps.maps[mapIndex].gMap, 'resize');
+
+      // reduce copyright size... ^_^
+      $('#'+gmaps.maps[mapIndex].id+' span, #'+gmaps.maps[mapIndex].id+' a').css('font-size', '55.0%');
+
+
+      if(gmaps.geolocated)
+      {
+        if(gmaps.maps[mapIndex].fitToBounds)
+        {
+          this.fitToBounds(gmaps.bounds, mapIndex);
+        }
+        else
+        {
+          gmaps.maps[mapIndex].gMap.setCenter(gmaps.bounds.getCenter());
+        }
+      }
+      else
+      {
+        this.fitToBounds(gmaps.maps[mapIndex].gMap.kmlFile.getDefaultViewport(), mapIndex);
+      }
+
+      google.maps.event.addListener(
+        gmaps.maps[mapIndex].gMap,
+        'dragend',
+        function()
+        {
+          __this.loadMarkers(this);
+          $('#gmapsBoundMap').css('display', 'inline');
+          $('#gmapsBoundKml').css('display', 'inline');
+        }
+      );
+
+      google.maps.event.addListener(
+        gmaps.maps[mapIndex].gMap,
+        'zoom_changed',
+        function()
+        {
+          __this.loadMarkers(this);
+          gmaps.infoWindow.close();
+          $('#gmapsBoundMap').css('display', 'inline');
+          $('#gmapsBoundKml').css('display', 'inline');
+        }
+      );
+
+      gmaps.maps[mapIndex].gMap.viewportInitialized=true;
+      this.loadMarkers(gmaps.maps[mapIndex].gMap);
+    }
+
+
+  }
 }
 
-/**
- * load markers from the server
- *
- * @param Map map : the map
- */
-function loadMarkers(map)
-{
-  map.callId++;
-
-  datas={
-    requestId:gmaps.requestId,
-    callId:map.callId,
-    bounds:{
-        north:map.getBounds().getNorthEast().lat(),
-        east:map.getBounds().getNorthEast().lng(),
-        south:map.getBounds().getSouthWest().lat(),
-        west:map.getBounds().getSouthWest().lng()
-      },
-    width:$(map.getDiv()).width(),
-    height:$(map.getDiv()).height(),
-    distanceTreshold:20,
-    loadIndex:map.gmapsIndex,
-  };
-
-
-  $('#gmapsLoading').css('display', 'inline-block');
-  $('#gmapsNbPhotos').html('');
-
-  $.ajax(
-    {
-      type: "POST",
-      url: "plugins/GMaps/gmaps_ajax.php",
-      async: true,
-      data: { ajaxfct:"public.maps.getMarkers", datas:datas },
-      success:
-        function(msg)
-        {
-          tmp=$.parseJSON(msg);
-          if(gmaps.maps[tmp.loadIndex].gMap.callId==tmp.callId)
-          {
-            tmp.markers.sort(compareMarkers);
-            applyMarkers(gmaps.maps[tmp.loadIndex].gMap, tmp.markers);
-            $('#gmapsLoading').css('display', 'none');
-            $('#gmapsNbPhotos').html('['+tmp.datas.nbPhotos+']');
-          }
-        }
-    }
-  );
-}
-
-/**
- * apply markers to map
- *
- * @param Map map : the google map object
- * @param Array markers : array of markers properties
- *                        each marker is an object with properties :
- *                          latitude, longitude, nbImg
- */
-function applyMarkers(map, markers)
-{
-  /*
-   * deleting markers from the map only if they are not in the new list
-   */
-  if(map.markers.length>0)
-  {
-    var i=0;
-    while(i<map.markers.length)
-    {
-      newListIndex=markerInList(map.markers[i].uId, markers);
-      if(newListIndex==-1)
-      {
-        map.markers[i].marker.setMap(null);
-        map.markers.splice(i, 1);
-      }
-      else
-      {
-        markers.splice(newListIndex,1);
-        i++;
-      }
-    }
-  }
-
-  /*
-   * add new markers on the map
-   */
-  for(var i=0;i<markers.length;i++)
-  {
-    var marker = new google.maps.Marker(
-      {
-        position:new google.maps.LatLng(markers[i].lat, markers[i].lng),
-        map: map,
-        title:markers[i].nbImgTxt
-      }
-    );
-
-    if(map.markerImg!=null) marker.setIcon(map.markerImg);
-
-    marker.info=markers[i];
-    marker.info.displayed=0;
-
-    map.markers.push(
-      {
-        marker:marker,
-        uId:markers[i].uId
-      }
-    );
-
-    google.maps.event.addListener(
-      marker,
-      'click',
-      function ()
-      {
-        displayWindowInfo(this);
-      }
-    );
-
-    for(var index=0;index<marker.info.imgTn.length;index++)
-    {
-      switch(marker.info.imgTn[index].charAt(0))
-      {
-        case 'G':
-          marker.info.imgTn[index]='./galleries/'+marker.info.imgTn[index].substr(1);
-          break;
-        case 'U':
-          marker.info.imgTn[index]='./upload/'+marker.info.imgTn[index].substr(1);
-          break;
-      }
-    }
-  }
-}
-
-function compareMarkers(m1,m2)
-{
-  if(m1.uId<m2.uId)
-  {
-    return(-1);
-  }
-  else if(m1.uId<m2.uId)
-  {
-    return(1);
-  }
-  return(0);
-}
-
-function markerInList(uniqueId, markerList)
-{
-  for(var i=0;i<markerList.length;i++)
-  {
-    if(markerList[i].uId==uniqueId) return(i)
-  }
-  return(-1);
-}
-
-/**
- * display the infowindow
- *
- * @param Marker marker : the marker
- */
-function displayWindowInfo(marker)
-{
-  gmaps.currentInfo=marker.info;
-  gmaps.infoWindow.close();
-  gmaps.infoWindow.setContent($('#iGMapsInfoWindowContent').clone().each(renameId).get(0));
-  gmaps.infoWindow.open(marker.map, marker);
-  displayPictureInfo(gmaps.currentInfo.displayed);
-}
-function renameId(i, e)
-{
-  if(e.id!='') e.id='c'+e.id;
-  $(e).children().each(renameId);
-}
-
-
-/**
- *
- */
-function displayPictureInfo(index)
-{
-  gmaps.currentInfo.displayed=index;
-  if(gmaps.currentInfo.imgName[index]=='')
-  {
-    $('#ciGMIWC_title').html('&nbsp;');
-  }
-  else
-  {
-    $('#ciGMIWC_title').html(gmaps.currentInfo.imgName[index]);
-  }
-  $('#ciGMIWC_img').attr('src', gmaps.currentInfo.imgTn[index]);
-
-  $('#ciGMIWC_img').unbind();
-  if(gmaps.currentInfo.imgCatsUrl[index].length==1)
-  {
-    $('#ciGMIWC_img').bind('click',
-      function ()
-      {
-        window.location=gmaps.currentInfo.imgCatsUrl[gmaps.currentInfo.displayed][0];
-      }
-    );
-  }
-  else
-  {
-    $('#ciGMIWC_showcatList').html('');
-    for(var i=0;i<gmaps.currentInfo.imgCatsUrl[index].length;i++)
-    {
-      $('#ciGMIWC_showcatList')
-        .append('<li><a href="'+gmaps.currentInfo.imgCatsUrl[index][i]+'">'+gmaps.currentInfo.imgCatsNames[index][i]+'</a></li>');
-    }
-    $('#ciGMIWC_img, #ciGMIWC_showcat')
-      .bind('mouseenter', function () { $('#ciGMIWC_showcat').css('display', 'block'); } )
-      .bind('mouseleave', function () { $('#ciGMIWC_showcat').css('display', 'none'); } );
-  }
-
-  if(gmaps.currentInfo.nbImg>1)
-  {
-    $('#ciGMIWC_picnum').html((index+1)+'/'+gmaps.currentInfo.nbImgTxt);
-    $('#ciWALeft, #ciWARight').css('display', 'inline-block');
-  }
-  else
-  {
-    $('#ciGMIWC_picnum').html(gmaps.currentInfo.nbImgTxt);
-    $('#ciWALeft, #ciWARight').css('display', 'none');
-  }
-}
-
-/**
- *
- */
-function displayPicturePrev()
-{
-  gmaps.currentInfo.displayed--;
-  if(gmaps.currentInfo.displayed<0) gmaps.currentInfo.displayed=gmaps.currentInfo.nbImg-1;
-  displayPictureInfo(gmaps.currentInfo.displayed);
-}
-
-/**
- *
- */
-function displayPictureNext()
-{
-  gmaps.currentInfo.displayed++;
-  if(gmaps.currentInfo.displayed>=gmaps.currentInfo.nbImg) gmaps.currentInfo.displayed=0;
-  displayPictureInfo(gmaps.currentInfo.displayed);
-}
-
-
-/**
- * check if zoomLevel
- */
-function fitToBounds(bounds, mapIndex)
-{
-  gmaps.maps[mapIndex].gMap.fitBounds(bounds);
-
-  if(gmaps.maps[mapIndex].zoomLevelMaxActivated &&
-     gmaps.maps[mapIndex].gMap.getZoom() > gmaps.maps[mapIndex].zoomLevel)
-  {
-    gmaps.maps[mapIndex].gMap.setZoom(gmaps.maps[mapIndex].zoomLevel);
-  }
-}
-
-function initializeMapViewport(mode, mapIndex)
-{
-  if(mapIndex>-1 &&
-     ($('#'+gmaps.maps[mapIndex].id+'Content').dialog('isOpen') && mode=='loaded' || mode=='open') &&
-     (gmaps.maps[mapIndex].gMap.viewportInitialized==false)
-    )
-  {
-    /*
-     * if the container is not visible when map are built, they are
-     * not initialized correctly
-     *
-     * when dialog is opened for the first time, proceed to map
-     * finalization :
-     *  - resize
-     *  - center the map
-     *  - add handlers on events 'dragend' and 'zoom_change'
-     *    allowing to reload markers according to the new viewport
-     */
-    google.maps.event.trigger(gmaps.maps[mapIndex].gMap, 'resize');
-
-    // reduce copyright size... ^_^
-    $('#'+gmaps.maps[mapIndex].id+' span, #'+gmaps.maps[mapIndex].id+' a').css('font-size', '55.0%');
-
-
-    if(gmaps.geolocated)
-    {
-      if(gmaps.maps[mapIndex].fitToBounds)
-      {
-        fitToBounds(gmaps.bounds, mapIndex);
-      }
-      else
-      {
-        gmaps.maps[mapIndex].gMap.setCenter(gmaps.bounds.getCenter());
-      }
-    }
-    else
-    {
-      fitToBounds(gmaps.maps[mapIndex].gMap.kmlFile.getDefaultViewport(), mapIndex);
-    }
-
-    google.maps.event.addListener(
-      gmaps.maps[mapIndex].gMap,
-      'dragend',
-      function()
-      {
-        loadMarkers(this);
-        $('#gmapsBoundMap').css('display', 'inline');
-        $('#gmapsBoundKml').css('display', 'inline');
-      }
-    );
-
-    google.maps.event.addListener(
-      gmaps.maps[mapIndex].gMap,
-      'zoom_changed',
-      function()
-      {
-        loadMarkers(this);
-        gmaps.infoWindow.close();
-        $('#gmapsBoundMap').css('display', 'inline');
-        $('#gmapsBoundKml').css('display', 'inline');
-      }
-    );
-
-    gmaps.maps[mapIndex].gMap.viewportInitialized=true;
-    loadMarkers(gmaps.maps[mapIndex].gMap);
-  }
-
-
-}
-
-
-$(window).load(function ()
-  {
+
+
+$(window).load(
+  function ()
+  {
+    gmapsCM=new categoryMaps();
+
     // all maps have the same initials bounds
+    initInfoWindow();
+
     gmaps.currentInfo=null;
+    gmaps.currentMarker=null;
 
     gmaps.bounds = new google.maps.LatLngBounds(
@@ -428,5 +497,5 @@
        //$('body').append($('#iGMapsInfoWindowContent'));
        gmaps.infoWindow.setContent('');
-       $('#ciGMIWC_img').unbind();
+       $('#ciGMIWC_img').unbind('click');
      }
     );
@@ -435,5 +504,5 @@
     {
       // prepare google map maps
-      createMap(gmaps.maps[i], i);
+      gmapsCM.createMap(gmaps.maps[i], i);
 
       // if size map depends from windows size, apply new dimensions to map
@@ -476,5 +545,5 @@
                       for(var i=0;i<gmaps.maps.length;i++)
                       {
-                        initializeMapViewport('loaded', i);
+                        gmapsCM.initializeMapViewport('loaded', i);
                         //initializeMapViewport('open', $(this).data('index'));
                       }
@@ -489,7 +558,6 @@
       {
         $('div.gmapsPopup div.ui-dialog-titlebar')
-        .append('<a href="#" id="gmapsBoundMap" style="display:none;" onclick="fitToBounds(gmaps.bounds, '+i+'); $(this).css(\'display\', \'none\').blur(); return(false);">'+
-                '<span>&there4;</span></a>');
-        $('#gmapsBoundMap').attr('title', gmaps.lang.boundmap);
+        .append('<a href="#" id="gmapsBoundMap" style="display:none;"><span>&there4;</span></a>');
+        $('#gmapsBoundMap').attr('title', gmaps.lang.boundmap).bind('click', i, function(event) { gmapsCM.fitToBounds(gmaps.bounds, event.data); $(this).css('display', 'none').blur(); return(false); } );
       }
 
@@ -497,7 +565,6 @@
       {
         $('div.gmapsPopup div.ui-dialog-titlebar')
-          .append('<a href="#" id="gmapsBoundKml" onclick="fitToBounds(gmaps.maps['+i+'].gMap.kmlFile.getDefaultViewport(), '+i+'); $(this).css(\'display\', \'none\').blur(); return(false);">'+
-                  '<span>&sim;</span></a>');
-        $('#gmapsBoundKml').attr('title', gmaps.lang.boundkml);
+          .append('<a href="#" id="gmapsBoundKml"><span>&sim;</span></a>');
+        $('#gmapsBoundKml').attr('title', gmaps.lang.boundkml).bind('click', i, function(event) { gmapsCM.fitToBounds(gmaps.maps[event.data].gMap.kmlFile.getDefaultViewport(), event.data); $(this).css('display', 'none').blur(); return(false); } );
       }
 
@@ -513,4 +580,2 @@
   }
 );
-
-
Index: extensions/GMaps/js/gmapsCategory.min.js
===================================================================
--- extensions/GMaps/js/gmapsCategory.min.js	(revision 11529)
+++ extensions/GMaps/js/gmapsCategory.min.js	(revision 12204)
@@ -1,88 +1,2 @@
-/* file: gmapsCategory.js - v1.2.1 | minified on 2011/04/21 with http://jscompress.com/ */
-var markerImgProp=[null,{w:32,h:32,x:15,y:31},{w:32,h:32,x:15,y:31},{w:32,h:32,x:10,y:31},{w:30,h:40,x:4,y:39}];function createMap(properties,gmapsIndex)
-{var map=new google.maps.Map($("#"+properties.id).get(0),{backgroundColor:'#ffffff',mapTypeId:properties.mapType,zoom:properties.zoomLevel,center:gmaps.bounds.getCenter(),navigationControl:(properties.navigationControl==-1)?false:true,scrollwheel:(properties.navigationControl==-1)?false:true,scaleControl:(properties.scaleControl=='n')?false:true,streetViewControl:(properties.streetViewControl=='n')?false:true,mapTypeControl:(properties.mapTypeControl==-1)?false:true,mapTypeControlOptions:{style:properties.mapTypeControl},markerTitle:''});if(properties.kmlFileUrl!='')
-{kmlFile=new google.maps.KmlLayer(properties.kmlFileUrl,{preserveViewport:true});kmlFile.setMap(map);}
-else
-{kmlFile=null;}
-re=/^mS(\d\d)_.*/i;iM=re.exec(properties.markerImg);if(iM!=null)iM=new Number(iM[1]);if(iM!=null)
-{map.markerImg=new google.maps.MarkerImage('plugins/GMaps/img/'+properties.markerImg,new google.maps.Size(markerImgProp[iM].w,markerImgProp[iM].h),new google.maps.Point(0,0),new google.maps.Point(markerImgProp[iM].x,markerImgProp[iM].y));}
-else
-{map.markerImg=null;}
-map.kmlFile=kmlFile;map.markers=new Array();map.gmapsIndex=gmapsIndex;map.viewportInitialized=false;map.callId=0;properties.gMap=map;}
-function loadMarkers(map)
-{map.callId++;datas={requestId:gmaps.requestId,callId:map.callId,bounds:{north:map.getBounds().getNorthEast().lat(),east:map.getBounds().getNorthEast().lng(),south:map.getBounds().getSouthWest().lat(),west:map.getBounds().getSouthWest().lng()},width:$(map.getDiv()).width(),height:$(map.getDiv()).height(),distanceTreshold:20,loadIndex:map.gmapsIndex,};$('#gmapsLoading').css('display','inline-block');$('#gmapsNbPhotos').html('');$.ajax({type:"POST",url:"plugins/GMaps/gmaps_ajax.php",async:true,data:{ajaxfct:"public.maps.getMarkers",datas:datas},success:function(msg)
-{tmp=$.parseJSON(msg);if(gmaps.maps[tmp.loadIndex].gMap.callId==tmp.callId)
-{tmp.markers.sort(compareMarkers);applyMarkers(gmaps.maps[tmp.loadIndex].gMap,tmp.markers);$('#gmapsLoading').css('display','none');$('#gmapsNbPhotos').html('['+tmp.datas.nbPhotos+']');}}});}
-function applyMarkers(map,markers)
-{if(map.markers.length>0)
-{var i=0;while(i<map.markers.length)
-{newListIndex=markerInList(map.markers[i].uId,markers);if(newListIndex==-1)
-{map.markers[i].marker.setMap(null);map.markers.splice(i,1);}
-else
-{markers.splice(newListIndex,1);i++;}}}
-for(var i=0;i<markers.length;i++)
-{var marker=new google.maps.Marker({position:new google.maps.LatLng(markers[i].lat,markers[i].lng),map:map,title:markers[i].nbImgTxt});if(map.markerImg!=null)marker.setIcon(map.markerImg);marker.info=markers[i];marker.info.displayed=0;map.markers.push({marker:marker,uId:markers[i].uId});google.maps.event.addListener(marker,'click',function()
-{displayWindowInfo(this);});for(var index=0;index<marker.info.imgTn.length;index++)
-{switch(marker.info.imgTn[index].charAt(0))
-{case'G':marker.info.imgTn[index]='./galleries/'+marker.info.imgTn[index].substr(1);break;case'U':marker.info.imgTn[index]='./upload/'+marker.info.imgTn[index].substr(1);break;}}}}
-function compareMarkers(m1,m2)
-{if(m1.uId<m2.uId)
-{return(-1);}
-else if(m1.uId<m2.uId)
-{return(1);}
-return(0);}
-function markerInList(uniqueId,markerList)
-{for(var i=0;i<markerList.length;i++)
-{if(markerList[i].uId==uniqueId)return(i)}
-return(-1);}
-function displayWindowInfo(marker)
-{gmaps.currentInfo=marker.info;gmaps.infoWindow.close();gmaps.infoWindow.setContent($('#iGMapsInfoWindowContent').clone().each(renameId).get(0));gmaps.infoWindow.open(marker.map,marker);displayPictureInfo(gmaps.currentInfo.displayed);}
-function renameId(i,e)
-{if(e.id!='')e.id='c'+e.id;$(e).children().each(renameId);}
-function displayPictureInfo(index)
-{gmaps.currentInfo.displayed=index;if(gmaps.currentInfo.imgName[index]=='')
-{$('#ciGMIWC_title').html(' ');}
-else
-{$('#ciGMIWC_title').html(gmaps.currentInfo.imgName[index]);}
-$('#ciGMIWC_img').attr('src',gmaps.currentInfo.imgTn[index]);$('#ciGMIWC_img').unbind();if(gmaps.currentInfo.imgCatsUrl[index].length==1)
-{$('#ciGMIWC_img').bind('click',function()
-{window.location=gmaps.currentInfo.imgCatsUrl[gmaps.currentInfo.displayed][0];});}
-else
-{$('#ciGMIWC_showcatList').html('');for(var i=0;i<gmaps.currentInfo.imgCatsUrl[index].length;i++)
-{$('#ciGMIWC_showcatList').append('<li><a href="'+gmaps.currentInfo.imgCatsUrl[index][i]+'">'+gmaps.currentInfo.imgCatsNames[index][i]+'</a></li>');}
-$('#ciGMIWC_img, #ciGMIWC_showcat').bind('mouseenter',function(){$('#ciGMIWC_showcat').css('display','block');}).bind('mouseleave',function(){$('#ciGMIWC_showcat').css('display','none');});}
-if(gmaps.currentInfo.nbImg>1)
-{$('#ciGMIWC_picnum').html((index+1)+'/'+gmaps.currentInfo.nbImgTxt);$('#ciWALeft, #ciWARight').css('display','inline-block');}
-else
-{$('#ciGMIWC_picnum').html(gmaps.currentInfo.nbImgTxt);$('#ciWALeft, #ciWARight').css('display','none');}}
-function displayPicturePrev()
-{gmaps.currentInfo.displayed--;if(gmaps.currentInfo.displayed<0)gmaps.currentInfo.displayed=gmaps.currentInfo.nbImg-1;displayPictureInfo(gmaps.currentInfo.displayed);}
-function displayPictureNext()
-{gmaps.currentInfo.displayed++;if(gmaps.currentInfo.displayed>=gmaps.currentInfo.nbImg)gmaps.currentInfo.displayed=0;displayPictureInfo(gmaps.currentInfo.displayed);}
-function fitToBounds(bounds,mapIndex)
-{gmaps.maps[mapIndex].gMap.fitBounds(bounds);if(gmaps.maps[mapIndex].zoomLevelMaxActivated&&gmaps.maps[mapIndex].gMap.getZoom()>gmaps.maps[mapIndex].zoomLevel)
-{gmaps.maps[mapIndex].gMap.setZoom(gmaps.maps[mapIndex].zoomLevel);}}
-function initializeMapViewport(mode,mapIndex)
-{if(mapIndex>-1&&($('#'+gmaps.maps[mapIndex].id+'Content').dialog('isOpen')&&mode=='loaded'||mode=='open')&&(gmaps.maps[mapIndex].gMap.viewportInitialized==false))
-{google.maps.event.trigger(gmaps.maps[mapIndex].gMap,'resize');$('#'+gmaps.maps[mapIndex].id+' span, #'+gmaps.maps[mapIndex].id+' a').css('font-size','55.0%');if(gmaps.geolocated)
-{if(gmaps.maps[mapIndex].fitToBounds)
-{fitToBounds(gmaps.bounds,mapIndex);}
-else
-{gmaps.maps[mapIndex].gMap.setCenter(gmaps.bounds.getCenter());}}
-else
-{fitToBounds(gmaps.maps[mapIndex].gMap.kmlFile.getDefaultViewport(),mapIndex);}
-google.maps.event.addListener(gmaps.maps[mapIndex].gMap,'dragend',function()
-{loadMarkers(this);$('#gmapsBoundMap').css('display','inline');$('#gmapsBoundKml').css('display','inline');});google.maps.event.addListener(gmaps.maps[mapIndex].gMap,'zoom_changed',function()
-{loadMarkers(this);gmaps.infoWindow.close();$('#gmapsBoundMap').css('display','inline');$('#gmapsBoundKml').css('display','inline');});gmaps.maps[mapIndex].gMap.viewportInitialized=true;loadMarkers(gmaps.maps[mapIndex].gMap);}}
-$(window).load(function()
-{gmaps.currentInfo=null;gmaps.bounds=new google.maps.LatLngBounds(new google.maps.LatLng(gmaps.bounds.south,gmaps.bounds.west),new google.maps.LatLng(gmaps.bounds.north,gmaps.bounds.east));gmaps.infoWindow=new google.maps.InfoWindow();google.maps.event.addListener(gmaps.infoWindow,'closeclick',function(){gmaps.infoWindow.setContent('');$('#ciGMIWC_img').unbind();});for(var i=0;i<gmaps.maps.length;i++)
-{createMap(gmaps.maps[i],i);if(gmaps.maps[i].sizeMode=='A')
-{$('#'+gmaps.maps[i].id).css({width:($(window).width()*gmaps.popupAutomaticSize)+'px',height:($(window).height()*gmaps.popupAutomaticSize)+'px'});}
-$('#'+gmaps.maps[i].id+'Content').dialog({autoOpen:false,width:$('#'+gmaps.maps[i].id).width(),height:'auto',modal:true,closeText:'X',dialogClass:'gmapsPopup',title:gmaps.maps[i].title,open:function()
-{$.ajax({type:"POST",url:"plugins/GMaps/gmaps_ajax.php",async:true,data:{ajaxfct:"public.maps.init",category:gmaps.categoryId,mapId:'n'},success:function(msg)
-{gmaps.requestId=msg;for(var i=0;i<gmaps.maps.length;i++)
-{initializeMapViewport('loaded',i);}}});}}).data('index',i);if(gmaps.geolocated)
-{$('div.gmapsPopup div.ui-dialog-titlebar').append('<a href="#" id="gmapsBoundMap" style="display:none;" onclick="fitToBounds(gmaps.bounds, '+i+'); $(this).css(\'display\', \'none\').blur(); return(false);">'+'<span>∴</span></a>');$('#gmapsBoundMap').attr('title',gmaps.lang.boundmap);}
-if(gmaps.maps[i].gMap.kmlFile!=null)
-{$('div.gmapsPopup div.ui-dialog-titlebar').append('<a href="#" id="gmapsBoundKml" onclick="fitToBounds(gmaps.maps['+i+'].gMap.kmlFile.getDefaultViewport(), '+i+'); $(this).css(\'display\', \'none\').blur(); return(false);">'+'<span>∼</span></a>');$('#gmapsBoundKml').attr('title',gmaps.lang.boundkml);}
-$('div.gmapsPopup div.ui-dialog-titlebar').append('<span id="gmapsLoading" style="display:none;"><img src="./plugins/GrumPluginClasses/icons/processing.gif"><span>'+gmaps.lang.loading+'</span></span>');$('#ui-dialog-title-iGMapsIconContent').append('<span id="gmapsNbPhotos"></span>');}});
+/* file: gmapsCategory.js - v1.2.2 | minified on 2011/09/23 with http://jscompress.com/ */
+function categoryMaps(){var a=[null,{w:32,h:32,x:15,y:31},{w:32,h:32,x:15,y:31},{w:32,h:32,x:10,y:31},{w:30,h:40,x:4,y:39}],b={width:-1,height:-1};this.createMap=function(b,c){var d=new google.maps.Map($("#"+b.id).get(0),{backgroundColor:"#ffffff",mapTypeId:b.mapType,zoom:b.zoomLevel,center:gmaps.bounds.getCenter(),navigationControl:b.navigationControl==-1?false:true,scrollwheel:b.navigationControl==-1?false:true,scaleControl:b.scaleControl=="n"?false:true,streetViewControl:b.streetViewControl=="n"?false:true,mapTypeControl:b.mapTypeControl==-1?false:true,mapTypeControlOptions:{style:b.mapTypeControl},markerTitle:""});if(b.kmlFileUrl!=""){kmlFile=new google.maps.KmlLayer(b.kmlFileUrl,{preserveViewport:true});kmlFile.setMap(d)}else{kmlFile=null}re=/^mS(\d\d)_.*/i;iM=re.exec(b.markerImg);if(iM!=null)iM=new Number(iM[1]);if(iM!=null){d.markerImg=new google.maps.MarkerImage("plugins/GMaps/img/"+b.markerImg,new google.maps.Size(a[iM].w,a[iM].h),new google.maps.Point(0,0),new google.maps.Point(a[iM].x,a[iM].y))}else{d.markerImg=null}d.kmlFile=kmlFile;d.markers=new Array;d.gmapsIndex=c;d.viewportInitialized=false;d.callId=0;b.gMap=d};this.loadMarkers=function(a){var b=this;a.callId++;datas={requestId:gmaps.requestId,callId:a.callId,bounds:{north:a.getBounds().getNorthEast().lat(),east:a.getBounds().getNorthEast().lng(),south:a.getBounds().getSouthWest().lat(),west:a.getBounds().getSouthWest().lng()},width:$(a.getDiv()).width(),height:$(a.getDiv()).height(),distanceTreshold:20,loadIndex:a.gmapsIndex};$("#gmapsLoading").css("display","inline-block");$("#gmapsNbPhotos").html("");$.ajax({type:"POST",url:"plugins/GMaps/gmaps_ajax.php",async:true,data:{ajaxfct:"public.maps.getMarkers",datas:datas},success:function(a){tmp=$.parseJSON(a);if(gmaps.maps[tmp.loadIndex].gMap.callId==tmp.callId){tmp.markers.sort(c);b.applyMarkers(gmaps.maps[tmp.loadIndex].gMap,tmp.markers);$("#gmapsLoading").css("display","none");$("#gmapsNbPhotos").html("["+tmp.datas.nbPhotos+"]")}}})};this.applyMarkers=function(a,b){var c=this;if(a.markers.length>0){var d=0;while(d<a.markers.length){newListIndex=this.markerInList(a.markers[d].uId,b);if(newListIndex==-1){a.markers[d].marker.setMap(null);a.markers.splice(d,1)}else{b.splice(newListIndex,1);d++}}}for(var d=0;d<b.length;d++){var e=new google.maps.Marker({position:new google.maps.LatLng(b[d].lat,b[d].lng),map:a,title:b[d].nbImgTxt});if(a.markerImg!=null)e.setIcon(a.markerImg);e.info=b[d];e.info.displayed=0;a.markers.push({marker:e,uId:b[d].uId});google.maps.event.addListener(e,"click",function(){c.displayWindowInfo(this)});for(var f=0;f<e.info.imgTn.length;f++){switch(e.info.imgTn[f].charAt(0)){case"G":e.info.imgTn[f]="./galleries/"+e.info.imgTn[f].substr(1);break;case"U":e.info.imgTn[f]="./upload/"+e.info.imgTn[f].substr(1);break}}}};var c=function(a,b){if(a.uId<b.uId){return-1}else if(a.uId<b.uId){return 1}return 0};this.markerInList=function(a,b){for(var c=0;c<b.length;c++){if(b[c].uId==a)return c}return-1};this.displayWindowInfo=function(a){var c=this;if(gmapsMM!=null&&gmapsMM instanceof markupMaps)gmapsMM.closePictureInfo();b.width=-1;b.width=-1;gmaps.currentMarker=a;gmaps.currentInfo=a.info;gmaps.infoWindow.close();gmaps.infoWindow.setContent($("#iGMapsInfoWindowContent").clone().each(d).get(0));gmaps.infoWindow.open(a.map,a);$("#ciWALeft, #ciWARight").unbind("click");$("#ciWARight").bind("click",function(a){c.displayPictureNext()});$("#ciWALeft").bind("click",function(a){c.displayPicturePrev()});this.displayPictureInfo(gmaps.currentInfo.displayed)};var d=function(a,b){if(b.id!="")b.id="c"+b.id;$(b).children().each(d)};this.closePictureInfo=function(){gmaps.currentMarker=null;gmaps.currentInfo=null;gmaps.infoWindow.setContent("");gmaps.infoWindow.close();$("#ciGMIWC_img").unbind("click");$("#ciWALeft, #ciWARight").unbind("click")};this.displayPictureInfo=function(a){var b=a,c=this;gmaps.currentInfo.displayed=a;if(gmaps.currentInfo.imgName[a]==""){$("#ciGMIWC_title").html(" ")}else{$("#ciGMIWC_title").html(gmaps.currentInfo.imgName[a])}$("#ciGMIWC_img").attr("src",gmaps.currentInfo.imgTn[a]).bind("load",function(a){});$("#ciGMIWC_img").unbind("click");if(gmaps.currentInfo.imgCatsUrl[a].length==1){$("#ciGMIWC_img").bind("click",function(){window.location=gmaps.currentInfo.imgCatsUrl[gmaps.currentInfo.displayed][0]})}else{$("#ciGMIWC_showcatList").html("");for(var d=0;d<gmaps.currentInfo.imgCatsUrl[a].length;d++){$("#ciGMIWC_showcatList").append('<li><a href="'+gmaps.currentInfo.imgCatsUrl[a][d]+'">'+gmaps.currentInfo.imgCatsNames[a][d]+"</a></li>")}$("#ciGMIWC_img, #ciGMIWC_showcat").bind("mouseenter",function(){$("#ciGMIWC_showcat").css("display","block")}).bind("mouseleave",function(){$("#ciGMIWC_showcat").css("display","none")})}if(gmaps.currentInfo.nbImg>1){$("#ciGMIWC_picnum").html(a+1+"/"+gmaps.currentInfo.nbImgTxt);$("#ciWALeft, #ciWARight").css("display","inline-block")}else{$("#ciGMIWC_picnum").html(gmaps.currentInfo.nbImgTxt);$("#ciWALeft, #ciWARight").css("display","none")}};this.displayPicturePrev=function(){gmaps.currentInfo.displayed--;if(gmaps.currentInfo.displayed<0)gmaps.currentInfo.displayed=gmaps.currentInfo.nbImg-1;this.displayPictureInfo(gmaps.currentInfo.displayed)};this.displayPictureNext=function(){gmaps.currentInfo.displayed++;if(gmaps.currentInfo.displayed>=gmaps.currentInfo.nbImg)gmaps.currentInfo.displayed=0;this.displayPictureInfo(gmaps.currentInfo.displayed)};this.fitToBounds=function(a,b){gmaps.maps[b].gMap.fitBounds(a);if(gmaps.maps[b].zoomLevelMaxActivated&&gmaps.maps[b].gMap.getZoom()>gmaps.maps[b].zoomLevel){gmaps.maps[b].gMap.setZoom(gmaps.maps[b].zoomLevel)}};this.initializeMapViewport=function(a,b){var c=this;if(b>-1&&($("#"+gmaps.maps[b].id+"Content").dialog("isOpen")&&a=="loaded"||a=="open")&&gmaps.maps[b].gMap.viewportInitialized==false){google.maps.event.trigger(gmaps.maps[b].gMap,"resize");$("#"+gmaps.maps[b].id+" span, #"+gmaps.maps[b].id+" a").css("font-size","55.0%");if(gmaps.geolocated){if(gmaps.maps[b].fitToBounds){this.fitToBounds(gmaps.bounds,b)}else{gmaps.maps[b].gMap.setCenter(gmaps.bounds.getCenter())}}else{this.fitToBounds(gmaps.maps[b].gMap.kmlFile.getDefaultViewport(),b)}google.maps.event.addListener(gmaps.maps[b].gMap,"dragend",function(){c.loadMarkers(this);$("#gmapsBoundMap").css("display","inline");$("#gmapsBoundKml").css("display","inline")});google.maps.event.addListener(gmaps.maps[b].gMap,"zoom_changed",function(){c.loadMarkers(this);gmaps.infoWindow.close();$("#gmapsBoundMap").css("display","inline");$("#gmapsBoundKml").css("display","inline")});gmaps.maps[b].gMap.viewportInitialized=true;this.loadMarkers(gmaps.maps[b].gMap)}}}var gmapsCM=null,gmapsMM=null;$(window).load(function(){gmapsCM=new categoryMaps;initInfoWindow();gmaps.currentInfo=null;gmaps.currentMarker=null;gmaps.bounds=new google.maps.LatLngBounds(new google.maps.LatLng(gmaps.bounds.south,gmaps.bounds.west),new google.maps.LatLng(gmaps.bounds.north,gmaps.bounds.east));gmaps.infoWindow=new google.maps.InfoWindow;google.maps.event.addListener(gmaps.infoWindow,"closeclick",function(){gmaps.infoWindow.setContent("");$("#ciGMIWC_img").unbind("click")});for(var a=0;a<gmaps.maps.length;a++){gmapsCM.createMap(gmaps.maps[a],a);if(gmaps.maps[a].sizeMode=="A"){$("#"+gmaps.maps[a].id).css({width:$(window).width()*gmaps.popupAutomaticSize+"px",height:$(window).height()*gmaps.popupAutomaticSize+"px"})}$("#"+gmaps.maps[a].id+"Content").dialog({autoOpen:false,width:$("#"+gmaps.maps[a].id).width(),height:"auto",modal:true,closeText:"X",dialogClass:"gmapsPopup",title:gmaps.maps[a].title,open:function(){$.ajax({type:"POST",url:"plugins/GMaps/gmaps_ajax.php",async:true,data:{ajaxfct:"public.maps.init",category:gmaps.categoryId,mapId:"n"},success:function(a){gmaps.requestId=a;for(var b=0;b<gmaps.maps.length;b++){gmapsCM.initializeMapViewport("loaded",b)}}})}}).data("index",a);if(gmaps.geolocated){$("div.gmapsPopup div.ui-dialog-titlebar").append('<a href="#" id="gmapsBoundMap" style="display:none;"><span>∴</span></a>');$("#gmapsBoundMap").attr("title",gmaps.lang.boundmap).bind("click",a,function(a){gmapsCM.fitToBounds(gmaps.bounds,a.data);$(this).css("display","none").blur();return false})}if(gmaps.maps[a].gMap.kmlFile!=null){$("div.gmapsPopup div.ui-dialog-titlebar").append('<a href="#" id="gmapsBoundKml"><span>∼</span></a>');$("#gmapsBoundKml").attr("title",gmaps.lang.boundkml).bind("click",a,function(a){gmapsCM.fitToBounds(gmaps.maps[a.data].gMap.kmlFile.getDefaultViewport(),a.data);$(this).css("display","none").blur();return false})}$("div.gmapsPopup div.ui-dialog-titlebar").append('<span id="gmapsLoading" style="display:none;"><img src="./plugins/GrumPluginClasses/icons/processing.gif"><span>'+gmaps.lang.loading+"</span></span>");$("#ui-dialog-title-iGMapsIconContent").append('<span id="gmapsNbPhotos"></span>')}})
Index: extensions/GMaps/js/gmapsInfoWindow.js
===================================================================
--- extensions/GMaps/js/gmapsInfoWindow.js	(revision 12204)
+++ extensions/GMaps/js/gmapsInfoWindow.js	(revision 12204)
@@ -0,0 +1,112 @@
+/**
+ * -----------------------------------------------------------------------------
+ * file: gmapsInfoWindow.js
+ * file version: 1.0.0
+ * date: 2011-09-23
+ */
+
+/*
+  <div id='iGMapsInfoWindow' style='display:none;'>
+    <div id='iGMapsInfoWindowContent'>
+      <div id='iGMIWC_title'>Titre de la photo</div>
+
+      <table id='iGMIWC_thumb'>
+        <tr>
+          <td style='width:28px;'><div id='iWALeft' ></div></td>
+          <td>
+            <img id='iGMIWC_img' src=''>
+          </td>
+          <td style='width:28px;'><div id='iWARight' ></div></td>
+        </tr>
+      </table>
+
+      <div id='iGMIWC_picnum'>0/0 photo</div>
+
+      <div id='iGMIWC_showcat' style='display:none;'>
+        <span>{'gmaps_i_show_this_picture_in'|@translate}</span>
+        <ul id='iGMIWC_showcatList'>
+        </ul>
+      </div>
+    </div>
+  </div>
+*/
+function initInfoWindow()
+{
+  if($('#iGMapsInfoWindow').length==0)
+  {
+    $('body').append($('<div/>',
+                      {
+                        id:'iGMapsInfoWindow',
+                        css:{display:'none'},
+                      }
+                    ).append($('<div/>',
+                                {
+                                  id:'iGMapsInfoWindowContent'
+                                }
+                              ).append($('<div/>',
+                                          {
+                                            id:'iGMIWC_title',
+                                            html:'(title)'
+                                          }
+                                        )
+                                      ).append($('<table/>',
+                                                  {
+                                                    id:'iGMIWC_thumb'
+                                                  }
+                                                ).append($('<tr/>')
+                                                          .append($('<td/>',
+                                                                    {
+                                                                      css:{width:'28px'}
+                                                                    }
+                                                                   ).append($('<div id="iWALeft"/>')
+                                                                           )
+                                                                 )
+                                                          .append($('<td/>').append($('<img/>',
+                                                                                        {
+                                                                                          id:'iGMIWC_img',
+                                                                                          src:''
+                                                                                        }
+                                                                                      )
+                                                                                    )
+                                                                 )
+                                                          .append($('<td/>',
+                                                                    {
+                                                                      css:{width:'28px'}
+                                                                    }
+                                                                  ).append($('<div id="iWARight">')
+                                                                          )
+                                                                )
+                                                        )
+                                              )
+                                     .append($('<div/>',
+                                                {
+                                                  id:'iGMIWC_picnum',
+                                                  html:'0/0 photo'
+                                                }
+                                              )
+                                            )
+                                     .append($('<div/>',
+                                                {
+                                                  id:'iGMIWC_showcat',
+                                                  css:{display:'none'}
+                                                }
+                                              ).append($('<span/>',
+                                                          {
+                                                            html:'gmaps_i_show_this_picture_in'
+                                                          }
+                                                        )
+                                                      )
+                                                .append($('<ul/>',
+                                                          {
+                                                            id:'iGMIWC_showcatList'
+                                                          }
+                                                        )
+                                                      )
+                                            )
+                            )
+                  );
+  }
+}
+
+
+
Index: extensions/GMaps/js/gmapsInfoWindow.min.js
===================================================================
--- extensions/GMaps/js/gmapsInfoWindow.min.js	(revision 12204)
+++ extensions/GMaps/js/gmapsInfoWindow.min.js	(revision 12204)
@@ -0,0 +1,2 @@
+/* file: gmapsInfoWindow.js - v1.0.0 | minified on 2011/09/23 with http://jscompress.com/ */
+function initInfoWindow(){if($("#iGMapsInfoWindow").length==0){$("body").append($("<div/>",{id:"iGMapsInfoWindow",css:{display:"none"}}).append($("<div/>",{id:"iGMapsInfoWindowContent"}).append($("<div/>",{id:"iGMIWC_title",html:"(title)"})).append($("<table/>",{id:"iGMIWC_thumb"}).append($("<tr/>").append($("<td/>",{css:{width:"28px"}}).append($('<div id="iWALeft"/>'))).append($("<td/>").append($("<img/>",{id:"iGMIWC_img",src:""}))).append($("<td/>",{css:{width:"28px"}}).append($('<div id="iWARight">'))))).append($("<div/>",{id:"iGMIWC_picnum",html:"0/0 photo"})).append($("<div/>",{id:"iGMIWC_showcat",css:{display:"none"}}).append($("<span/>",{html:"gmaps_i_show_this_picture_in"})).append($("<ul/>",{id:"iGMIWC_showcatList"})))))}}
Index: extensions/GMaps/js/gmapsMarkup.js
===================================================================
--- extensions/GMaps/js/gmapsMarkup.js	(revision 11529)
+++ extensions/GMaps/js/gmapsMarkup.js	(revision 12204)
@@ -2,9 +2,15 @@
  * -----------------------------------------------------------------------------
  * file: gmapsMarkup.js
- * file version: 1.1.1
- * date: 2011-04-13
+ * file version: 1.1.2
+ * date: 2011-09-23
  */
 
-var markerImgProp = [
+
+ var gmapsCM=null,
+     gmapsMM=null;
+
+function markupMaps()
+{
+  var markerImgProp = [
       null,
       { w:32, h:32, x:15, y:31 }, // s01
@@ -14,7 +20,4 @@
     ];
 
-
-function markupMaps()
-{
   /**
    * create the map
@@ -94,5 +97,5 @@
       if(properties.fitToBounds)
       {
-        fitToBounds(map.bounds, gmapsIndex);
+        this.fitToBounds(map.bounds, gmapsIndex);
       }
       else
@@ -104,9 +107,9 @@
     if(properties.markerVisible)
     {
-      loadMarkers(map);
+      this.loadMarkers(map);
     }
     else
     {
-      initializeMapViewport(gmapsIndex);
+      this.initializeMapViewport(gmapsIndex);
     }
   };
@@ -117,6 +120,8 @@
    * @param Map map : the map
    */
-  var loadMarkers = function(map)
-  {
+  this.loadMarkers = function(map)
+  {
+    var __this=this;
+
     if(map.getBounds()==null) return(false);
     map.callId++;
@@ -150,6 +155,6 @@
             {
               tmp.markers.sort(compareMarkers);
-              applyMarkers(gmapsMarkup.maps[tmp.loadIndex].gMap, tmp.markers);
-              initializeMapViewport(tmp.loadIndex);
+              __this.applyMarkers(gmapsMarkup.maps[tmp.loadIndex].gMap, tmp.markers);
+              __this.initializeMapViewport(tmp.loadIndex);
             }
           }
@@ -166,5 +171,5 @@
    *                          latitude, longitude, nbImg
    */
-  var applyMarkers = function(map, markers)
+  this.applyMarkers = function(map, markers)
   {
     if(map==null) return(false);
@@ -178,5 +183,5 @@
       while(i<map.markers.length)
       {
-        newListIndex=markerInList(map.markers[i].uId, markers);
+        newListIndex=this.markerInList(map.markers[i].uId, markers);
         if(newListIndex==-1)
         {
@@ -197,11 +202,12 @@
     for(var i=0;i<markers.length;i++)
     {
-      var marker = new google.maps.Marker(
-        {
-          position:new google.maps.LatLng(markers[i].lat, markers[i].lng),
-          map: map,
-          title:markers[i].nbImgTxt
-        }
-      );
+      var __this=this,
+          marker = new google.maps.Marker(
+            {
+              position:new google.maps.LatLng(markers[i].lat, markers[i].lng),
+              map: map,
+              title:markers[i].nbImgTxt
+            }
+          );
 
       if(map.markerImg!=null) marker.setIcon(map.markerImg);
@@ -224,5 +230,5 @@
           function ()
           {
-            displayWindowInfo(this);
+            __this.displayWindowInfo(this);
           }
         );
@@ -257,5 +263,5 @@
   };
 
-  var markerInList=function(uniqueId, markerList)
+  this.markerInList=function(uniqueId, markerList)
   {
     for(var i=0;i<markerList.length;i++)
@@ -271,11 +277,16 @@
    * @param Marker marker : the marker
    */
-  var displayWindowInfo=function(marker)
-  {
+  this.displayWindowInfo=function(marker)
+  {
+    if(gmapsCM && gmapsCM instanceof categoryMaps) gmapsCM.closePictureInfo();
+
     gmapsMarkup.currentInfo=marker.info;
     gmapsMarkup.infoWindow.close();
     gmapsMarkup.infoWindow.setContent($('#iGMapsInfoWindowContent').clone().each(renameId).get(0));
     gmapsMarkup.infoWindow.open(marker.map, marker);
-    displayPictureInfo(gmapsMarkup.currentInfo.displayed);
+    $('#ciWALeft, #ciWARight').unbind('click');
+    $('#ciWARight').bind('click', function(event) { __this.displayPictureNext(); } );
+    $('#ciWALeft').bind('click', function(event) { __this.displayPicturePrev(); } );
+    this.displayPictureInfo(gmapsMarkup.currentInfo.displayed);
   };
   var renameId=function(i, e)
@@ -286,9 +297,33 @@
 
 
-  /**
-   *
-   */
-  var displayPictureInfo=function(index)
-  {
+  this.closePictureInfo = function ()
+  {
+    gmapsMarkup.currentInfo=null;
+    gmapsMarkup.infoWindow.setContent('');
+    gmapsMarkup.infoWindow.close();
+    $('#ciWALeft, #ciWARight').unbind('click');
+  }
+
+  /**
+   *
+   */
+  this.displayPictureInfo=function(index)
+  {
+    var __this=this;
+
+    $('#ciWALeft,#ciWARight').unbind('click');
+    $('#ciWARight').bind('click',
+      function(event)
+      {
+        __this.displayPictureNext();
+      }
+    );
+    $('#ciWALeft').bind('click',
+      function(event)
+      {
+        __this.displayPicturePrev();
+      }
+    );
+
     gmapsMarkup.currentInfo.displayed=index;
     if(gmapsMarkup.currentInfo.imgName[index]=='')
@@ -344,5 +379,5 @@
     gmapsMarkup.currentInfo.displayed--;
     if(gmapsMarkup.currentInfo.displayed<0) gmapsMarkup.currentInfo.displayed=gmapsMarkup.currentInfo.nbImg-1;
-    displayPictureInfo(gmapsMarkup.currentInfo.displayed);
+    this.displayPictureInfo(gmapsMarkup.currentInfo.displayed);
   };
 
@@ -354,5 +389,5 @@
     gmapsMarkup.currentInfo.displayed++;
     if(gmapsMarkup.currentInfo.displayed>=gmapsMarkup.currentInfo.nbImg) gmapsMarkup.currentInfo.displayed=0;
-    displayPictureInfo(gmapsMarkup.currentInfo.displayed);
+    this.displayPictureInfo(gmapsMarkup.currentInfo.displayed);
   };
 
@@ -361,5 +396,5 @@
    * check if zoomLevel
    */
-  var fitToBounds=function(bounds, mapIndex)
+  this.fitToBounds=function(bounds, mapIndex)
   {
     gmapsMarkup.maps[mapIndex].gMap.fitBounds(bounds);
@@ -372,6 +407,8 @@
   };
 
-  var initializeMapViewport=function(mapIndex)
-  {
+  this.initializeMapViewport=function(mapIndex)
+  {
+    var __this=this;
+
     if(mapIndex>-1 && !gmapsMarkup.maps[mapIndex].gMap.initialized)
     {
@@ -386,5 +423,5 @@
           function()
           {
-            loadMarkers(this);
+            __this.loadMarkers(this);
           }
         );
@@ -395,5 +432,5 @@
           function()
           {
-            loadMarkers(this);
+            __this.loadMarkers(this);
             gmapsMarkup.infoWindow.close();
           }
@@ -409,5 +446,5 @@
           function()
           {
-            fitToBounds(gmapsMarkup.maps[mapIndex].gMap.kmlFile.getDefaultViewport(), mapIndex);
+            __this.fitToBounds(gmapsMarkup.maps[mapIndex].gMap.kmlFile.getDefaultViewport(), mapIndex);
           }
         );
@@ -422,7 +459,8 @@
 
 
-$(window).load(function ()
-  {
-    var mm=new markupMaps();
+$(window).load(
+  function ()
+  {
+    gmapsMM=new markupMaps();
 
     // all maps have the same initials bounds
@@ -434,5 +472,4 @@
      'closeclick',
      function () {
-       //$('body').append($('#iGMapsInfoWindowContent'));
        gmapsMarkup.infoWindow.setContent('');
        $('#ciGMIWC_img').unbind();
@@ -465,86 +502,9 @@
               );
 
-              mm.createMap(gmapsMarkup.maps[i], i);
+              gmapsMM.createMap(gmapsMarkup.maps[i], i);
             }
           }
       }
     );
-
-
-    if($('#iGMapsInfoWindow').length==0)
-    {
-      $('body').append($('<div/>',
-                        {
-                          id:'iGMapsInfoWindow',
-                          css:{display:'none'},
-                        }
-                      ).append($('<div/>',
-                                  {
-                                    id:'iGMapsInfoWindowContent'
-                                  }
-                                ).append($('<div/>',
-                                            {
-                                              id:'iGMIWC_title',
-                                              html:'(title)'
-                                            }
-                                          )
-                                        ).append($('<table/>',
-                                                    {
-                                                      id:'iGMIWC_thumb'
-                                                    }
-                                                  ).append($('<tr/>')
-                                                            .append($('<td/>',
-                                                                      {
-                                                                        css:{width:'28px'}
-                                                                      }
-                                                                     ).append($('<div id="iWALeft" onclick="mm.displayPicturePrev();"/>')
-                                                                             )
-                                                                   )
-                                                            .append($('<td/>').append($('<img/>',
-                                                                                          {
-                                                                                            id:'iGMIWC_img',
-                                                                                            src:''
-                                                                                          }
-                                                                                        )
-                                                                                      )
-                                                                   )
-                                                            .append($('<td/>',
-                                                                      {
-                                                                        css:{width:'28px'}
-                                                                      }
-                                                                    ).append($('<div id="iWARight" onclick="mm.displayPictureNext();">')
-                                                                            )
-                                                                  )
-                                                          )
-                                                )
-                                       .append($('<div/>',
-                                                  {
-                                                    id:'iGMIWC_picnum',
-                                                    html:'0/0 photo'
-                                                  }
-                                                )
-                                              )
-                                       .append($('<div/>',
-                                                  {
-                                                    id:'iGMIWC_showcat',
-                                                    css:{display:'none'}
-                                                  }
-                                                ).append($('<span/>',
-                                                            {
-                                                              html:'gmaps_i_show_this_picture_in'
-                                                            }
-                                                          )
-                                                        )
-                                                  .append($('<ul/>',
-                                                            {
-                                                              id:'iGMIWC_showcatList'
-                                                            }
-                                                          )
-                                                        )
-                                              )
-                              )
-                    );
-    }
-
   }
 );
Index: extensions/GMaps/js/gmapsMarkup.min.js
===================================================================
--- extensions/GMaps/js/gmapsMarkup.min.js	(revision 11529)
+++ extensions/GMaps/js/gmapsMarkup.min.js	(revision 12204)
@@ -1,79 +1,2 @@
-/* file: gmapsMarkup.js - v1.1.1 | minified on 2011/04/13 with http://jscompress.com/ */
-var markerImgProp=[null,{w:32,h:32,x:15,y:31},{w:32,h:32,x:15,y:31},{w:32,h:32,x:10,y:31},{w:30,h:40,x:4,y:39}];function markupMaps()
-{this.createMap=function(properties,gmapsIndex)
-{var bounds=new google.maps.LatLngBounds(new google.maps.LatLng(properties.mapBounds.south,properties.mapBounds.west),new google.maps.LatLng(properties.mapBounds.north,properties.mapBounds.east)),map=new google.maps.Map($("#"+properties.id).get(0),{backgroundColor:'#ffffff',mapTypeId:properties.mapType,zoom:properties.zoomLevel,center:bounds.getCenter(),navigationControl:(properties.navigationControl==-1)?false:true,scrollwheel:(properties.navigationControl==-1)?false:true,scaleControl:(properties.scaleControl=='n')?false:true,streetViewControl:(properties.streetViewControl=='n')?false:true,mapTypeControl:(properties.mapTypeControl==-1)?false:true,mapTypeControlOptions:{style:properties.mapTypeControl},markerTitle:''});if(properties.kmlFileUrl!='')
-{kmlFile=new google.maps.KmlLayer(properties.kmlFileUrl,{preserveViewport:true});kmlFile.setMap(map);}
-else
-{kmlFile=null;}
-re=/^mS(\d\d)_.*/i;iM=re.exec(properties.markerImg);if(iM!=null)iM=new Number(iM[1]);if(iM!=null)
-{map.markerImg=new google.maps.MarkerImage('plugins/GMaps/img/'+properties.markerImg,new google.maps.Size(markerImgProp[iM].w,markerImgProp[iM].h),new google.maps.Point(0,0),new google.maps.Point(markerImgProp[iM].x,markerImgProp[iM].y));}
-else
-{map.markerImg=null;}
-map.bounds=bounds;map.kmlFile=kmlFile;map.markers=new Array();map.gmapsIndex=gmapsIndex;map.width=properties.width;map.height=properties.height;map.callId=0;map.allowBubble=properties.allowBubble;map.initialized=false;properties.gMap=map;if(properties.geolocated)
-{if(properties.fitToBounds)
-{fitToBounds(map.bounds,gmapsIndex);}
-else
-{map.setCenter(map.bounds.getCenter());}}
-if(properties.markerVisible)
-{loadMarkers(map);}
-else
-{initializeMapViewport(gmapsIndex);}};var loadMarkers=function(map)
-{if(map.getBounds()==null)return(false);map.callId++;datas={requestId:gmapsMarkup.requestId,callId:map.callId,bounds:{north:map.getBounds().getNorthEast().lat(),east:map.getBounds().getNorthEast().lng(),south:map.getBounds().getSouthWest().lat(),west:map.getBounds().getSouthWest().lng()},width:map.width,height:map.height,distanceTreshold:20,loadIndex:map.gmapsIndex};$.ajax({type:"POST",url:"plugins/GMaps/gmaps_ajax.php",async:true,data:{ajaxfct:"public.maps.getMarkers",datas:datas},success:function(msg)
-{tmp=$.parseJSON(msg);if(gmapsMarkup.maps[tmp.loadIndex].gMap.callId==tmp.callId)
-{tmp.markers.sort(compareMarkers);applyMarkers(gmapsMarkup.maps[tmp.loadIndex].gMap,tmp.markers);initializeMapViewport(tmp.loadIndex);}}});};var applyMarkers=function(map,markers)
-{if(map==null)return(false);if(map.markers.length>0)
-{var i=0;while(i<map.markers.length)
-{newListIndex=markerInList(map.markers[i].uId,markers);if(newListIndex==-1)
-{map.markers[i].marker.setMap(null);map.markers.splice(i,1);}
-else
-{markers.splice(newListIndex,1);i++;}}}
-for(var i=0;i<markers.length;i++)
-{var marker=new google.maps.Marker({position:new google.maps.LatLng(markers[i].lat,markers[i].lng),map:map,title:markers[i].nbImgTxt});if(map.markerImg!=null)marker.setIcon(map.markerImg);marker.info=markers[i];marker.info.displayed=0;map.markers.push({marker:marker,uId:markers[i].uId});if(map.allowBubble)
-{google.maps.event.addListener(marker,'click',function()
-{displayWindowInfo(this);});}
-for(var index=0;index<marker.info.imgTn.length;index++)
-{switch(marker.info.imgTn[index].charAt(0))
-{case'G':marker.info.imgTn[index]='./galleries/'+marker.info.imgTn[index].substr(1);break;case'U':marker.info.imgTn[index]='./upload/'+marker.info.imgTn[index].substr(1);break;}}}};var compareMarkers=function(m1,m2)
-{if(m1.uId<m2.uId)
-{return(-1);}
-else if(m1.uId<m2.uId)
-{return(1);}
-return(0);};var markerInList=function(uniqueId,markerList)
-{for(var i=0;i<markerList.length;i++)
-{if(markerList[i].uId==uniqueId)return(i)}
-return(-1);};var displayWindowInfo=function(marker)
-{gmapsMarkup.currentInfo=marker.info;gmapsMarkup.infoWindow.close();gmapsMarkup.infoWindow.setContent($('#iGMapsInfoWindowContent').clone().each(renameId).get(0));gmapsMarkup.infoWindow.open(marker.map,marker);displayPictureInfo(gmapsMarkup.currentInfo.displayed);};var renameId=function(i,e)
-{if(e.id!='')e.id='c'+e.id;$(e).children().each(renameId);};var displayPictureInfo=function(index)
-{gmapsMarkup.currentInfo.displayed=index;if(gmapsMarkup.currentInfo.imgName[index]=='')
-{$('#ciGMIWC_title').html(' ');}
-else
-{$('#ciGMIWC_title').html(gmapsMarkup.currentInfo.imgName[index]);}
-$('#ciGMIWC_img').attr('src',gmapsMarkup.currentInfo.imgTn[index]);$('#ciGMIWC_img').unbind();if(gmapsMarkup.currentInfo.imgCatsUrl[index].length==1)
-{$('#ciGMIWC_img').bind('click',function()
-{window.location=gmapsMarkup.currentInfo.imgCatsUrl[gmapsMarkup.currentInfo.displayed][0];});}
-else
-{$('#ciGMIWC_showcatList').html('');for(var i=0;i<gmapsMarkup.currentInfo.imgCatsUrl[index].length;i++)
-{$('#ciGMIWC_showcatList').append('<li><a href="'+gmapsMarkup.currentInfo.imgCatsUrl[index][i]+'">'+gmapsMarkup.currentInfo.imgCatsNames[index][i]+'</a></li>');}
-$('#ciGMIWC_img, #ciGMIWC_showcat').bind('mouseenter',function(){$('#ciGMIWC_showcat').css('display','block');}).bind('mouseleave',function(){$('#ciGMIWC_showcat').css('display','none');});}
-if(gmapsMarkup.currentInfo.nbImg>1)
-{$('#ciGMIWC_picnum').html((index+1)+'/'+gmapsMarkup.currentInfo.nbImgTxt);$('#ciWALeft, #ciWARight').css('display','inline-block');}
-else
-{$('#ciGMIWC_picnum').html(gmapsMarkup.currentInfo.nbImgTxt);$('#ciWALeft, #ciWARight').css('display','none');}};this.displayPicturePrev=function()
-{gmapsMarkup.currentInfo.displayed--;if(gmapsMarkup.currentInfo.displayed<0)gmapsMarkup.currentInfo.displayed=gmapsMarkup.currentInfo.nbImg-1;displayPictureInfo(gmapsMarkup.currentInfo.displayed);};this.displayPictureNext=function()
-{gmapsMarkup.currentInfo.displayed++;if(gmapsMarkup.currentInfo.displayed>=gmapsMarkup.currentInfo.nbImg)gmapsMarkup.currentInfo.displayed=0;displayPictureInfo(gmapsMarkup.currentInfo.displayed);};var fitToBounds=function(bounds,mapIndex)
-{gmapsMarkup.maps[mapIndex].gMap.fitBounds(bounds);if(gmapsMarkup.maps[mapIndex].zoomLevelMaxActivated&&gmapsMarkup.maps[mapIndex].gMap.getZoom()>gmapsMarkup.maps[mapIndex].zoomLevel)
-{gmapsMarkup.maps[mapIndex].gMap.setZoom(gmapsMarkup.maps[mapIndex].zoomLevel);}};var initializeMapViewport=function(mapIndex)
-{if(mapIndex>-1&&!gmapsMarkup.maps[mapIndex].gMap.initialized)
-{$('#'+gmapsMarkup.maps[mapIndex].id+' span, #'+gmapsMarkup.maps[mapIndex].id+' a').css('font-size','55.0%');if(gmapsMarkup.maps[mapIndex].markerVisible)
-{google.maps.event.addListener(gmapsMarkup.maps[mapIndex].gMap,'dragend',function()
-{loadMarkers(this);});google.maps.event.addListener(gmapsMarkup.maps[mapIndex].gMap,'zoom_changed',function()
-{loadMarkers(this);gmapsMarkup.infoWindow.close();});}
-if(gmapsMarkup.maps[mapIndex].kmlZoom&&gmapsMarkup.maps[mapIndex].gMap.kmlFile!=null)
-{google.maps.event.addListenerOnce(gmapsMarkup.maps[mapIndex].gMap.kmlFile,'defaultviewport_changed',function()
-{fitToBounds(gmapsMarkup.maps[mapIndex].gMap.kmlFile.getDefaultViewport(),mapIndex);});}
-gmapsMarkup.maps[mapIndex].gMap.initialized=true;}};}
-$(window).load(function()
-{var mm=new markupMaps();gmapsMarkup.currentInfo=null;gmapsMarkup.infoWindow=new google.maps.InfoWindow();google.maps.event.addListener(gmapsMarkup.infoWindow,'closeclick',function(){gmapsMarkup.infoWindow.setContent('');$('#ciGMIWC_img').unbind();});$.ajax({type:"POST",url:"plugins/GMaps/gmaps_ajax.php",async:true,data:{ajaxfct:"public.maps.init",category:gmapsMarkup.categoryId,mapId:'y'},success:function(msg)
-{gmapsMarkup.requestId=msg;for(var i=0;i<gmapsMarkup.maps.length;i++)
-{$('#'+gmapsMarkup.maps[i].id).css({width:gmapsMarkup.maps[i].width+'px',height:gmapsMarkup.maps[i].height+'px'});mm.createMap(gmapsMarkup.maps[i],i);}}});if($('#iGMapsInfoWindow').length==0)
-{$('body').append($('<div/>',{id:'iGMapsInfoWindow',css:{display:'none'},}).append($('<div/>',{id:'iGMapsInfoWindowContent'}).append($('<div/>',{id:'iGMIWC_title',html:'(title)'})).append($('<table/>',{id:'iGMIWC_thumb'}).append($('<tr/>').append($('<td/>',{css:{width:'28px'}}).append($('<div id="iWALeft" onclick="mm.displayPicturePrev();"/>'))).append($('<td/>').append($('<img/>',{id:'iGMIWC_img',src:''}))).append($('<td/>',{css:{width:'28px'}}).append($('<div id="iWARight" onclick="mm.displayPictureNext();">'))))).append($('<div/>',{id:'iGMIWC_picnum',html:'0/0 photo'})).append($('<div/>',{id:'iGMIWC_showcat',css:{display:'none'}}).append($('<span/>',{html:'gmaps_i_show_this_picture_in'})).append($('<ul/>',{id:'iGMIWC_showcatList'})))));}});
+/* file: gmapsMarkup.js - v1.1.2 | minified on 2011/09/23 with http://jscompress.com/ */
+function markupMaps(){var a=[null,{w:32,h:32,x:15,y:31},{w:32,h:32,x:15,y:31},{w:32,h:32,x:10,y:31},{w:30,h:40,x:4,y:39}];this.createMap=function(b,c){var d=new google.maps.LatLngBounds(new google.maps.LatLng(b.mapBounds.south,b.mapBounds.west),new google.maps.LatLng(b.mapBounds.north,b.mapBounds.east)),e=new google.maps.Map($("#"+b.id).get(0),{backgroundColor:"#ffffff",mapTypeId:b.mapType,zoom:b.zoomLevel,center:d.getCenter(),navigationControl:b.navigationControl==-1?false:true,scrollwheel:b.navigationControl==-1?false:true,scaleControl:b.scaleControl=="n"?false:true,streetViewControl:b.streetViewControl=="n"?false:true,mapTypeControl:b.mapTypeControl==-1?false:true,mapTypeControlOptions:{style:b.mapTypeControl},markerTitle:""});if(b.kmlFileUrl!=""){kmlFile=new google.maps.KmlLayer(b.kmlFileUrl,{preserveViewport:true});kmlFile.setMap(e)}else{kmlFile=null}re=/^mS(\d\d)_.*/i;iM=re.exec(b.markerImg);if(iM!=null)iM=new Number(iM[1]);if(iM!=null){e.markerImg=new google.maps.MarkerImage("plugins/GMaps/img/"+b.markerImg,new google.maps.Size(a[iM].w,a[iM].h),new google.maps.Point(0,0),new google.maps.Point(a[iM].x,a[iM].y))}else{e.markerImg=null}e.bounds=d;e.kmlFile=kmlFile;e.markers=new Array;e.gmapsIndex=c;e.width=b.width;e.height=b.height;e.callId=0;e.allowBubble=b.allowBubble;e.initialized=false;b.gMap=e;if(b.geolocated){if(b.fitToBounds){this.fitToBounds(e.bounds,c)}else{e.setCenter(e.bounds.getCenter())}}if(b.markerVisible){this.loadMarkers(e)}else{this.initializeMapViewport(c)}};this.loadMarkers=function(a){var c=this;if(a.getBounds()==null)return false;a.callId++;datas={requestId:gmapsMarkup.requestId,callId:a.callId,bounds:{north:a.getBounds().getNorthEast().lat(),east:a.getBounds().getNorthEast().lng(),south:a.getBounds().getSouthWest().lat(),west:a.getBounds().getSouthWest().lng()},width:a.width,height:a.height,distanceTreshold:20,loadIndex:a.gmapsIndex};$.ajax({type:"POST",url:"plugins/GMaps/gmaps_ajax.php",async:true,data:{ajaxfct:"public.maps.getMarkers",datas:datas},success:function(a){tmp=$.parseJSON(a);if(gmapsMarkup.maps[tmp.loadIndex].gMap.callId==tmp.callId){tmp.markers.sort(b);c.applyMarkers(gmapsMarkup.maps[tmp.loadIndex].gMap,tmp.markers);c.initializeMapViewport(tmp.loadIndex)}}})};this.applyMarkers=function(a,b){if(a==null)return false;if(a.markers.length>0){var c=0;while(c<a.markers.length){newListIndex=this.markerInList(a.markers[c].uId,b);if(newListIndex==-1){a.markers[c].marker.setMap(null);a.markers.splice(c,1)}else{b.splice(newListIndex,1);c++}}}for(var c=0;c<b.length;c++){var d=this,e=new google.maps.Marker({position:new google.maps.LatLng(b[c].lat,b[c].lng),map:a,title:b[c].nbImgTxt});if(a.markerImg!=null)e.setIcon(a.markerImg);e.info=b[c];e.info.displayed=0;a.markers.push({marker:e,uId:b[c].uId});if(a.allowBubble){google.maps.event.addListener(e,"click",function(){d.displayWindowInfo(this)})}for(var f=0;f<e.info.imgTn.length;f++){switch(e.info.imgTn[f].charAt(0)){case"G":e.info.imgTn[f]="./galleries/"+e.info.imgTn[f].substr(1);break;case"U":e.info.imgTn[f]="./upload/"+e.info.imgTn[f].substr(1);break}}}};var b=function(a,b){if(a.uId<b.uId){return-1}else if(a.uId<b.uId){return 1}return 0};this.markerInList=function(a,b){for(var c=0;c<b.length;c++){if(b[c].uId==a)return c}return-1};this.displayWindowInfo=function(a){if(gmapsCM&&gmapsCM instanceof categoryMaps)gmapsCM.closePictureInfo();gmapsMarkup.currentInfo=a.info;gmapsMarkup.infoWindow.close();gmapsMarkup.infoWindow.setContent($("#iGMapsInfoWindowContent").clone().each(c).get(0));gmapsMarkup.infoWindow.open(a.map,a);$("#ciWALeft, #ciWARight").unbind("click");$("#ciWARight").bind("click",function(a){__this.displayPictureNext()});$("#ciWALeft").bind("click",function(a){__this.displayPicturePrev()});this.displayPictureInfo(gmapsMarkup.currentInfo.displayed)};var c=function(a,b){if(b.id!="")b.id="c"+b.id;$(b).children().each(c)};this.closePictureInfo=function(){gmapsMarkup.currentInfo=null;gmapsMarkup.infoWindow.setContent("");gmapsMarkup.infoWindow.close();$("#ciWALeft, #ciWARight").unbind("click")};this.displayPictureInfo=function(a){var b=this;$("#ciWALeft,#ciWARight").unbind("click");$("#ciWARight").bind("click",function(a){b.displayPictureNext()});$("#ciWALeft").bind("click",function(a){b.displayPicturePrev()});gmapsMarkup.currentInfo.displayed=a;if(gmapsMarkup.currentInfo.imgName[a]==""){$("#ciGMIWC_title").html(" ")}else{$("#ciGMIWC_title").html(gmapsMarkup.currentInfo.imgName[a])}$("#ciGMIWC_img").attr("src",gmapsMarkup.currentInfo.imgTn[a]);$("#ciGMIWC_img").unbind();if(gmapsMarkup.currentInfo.imgCatsUrl[a].length==1){$("#ciGMIWC_img").bind("click",function(){window.location=gmapsMarkup.currentInfo.imgCatsUrl[gmapsMarkup.currentInfo.displayed][0]})}else{$("#ciGMIWC_showcatList").html("");for(var c=0;c<gmapsMarkup.currentInfo.imgCatsUrl[a].length;c++){$("#ciGMIWC_showcatList").append('<li><a href="'+gmapsMarkup.currentInfo.imgCatsUrl[a][c]+'">'+gmapsMarkup.currentInfo.imgCatsNames[a][c]+"</a></li>")}$("#ciGMIWC_img, #ciGMIWC_showcat").bind("mouseenter",function(){$("#ciGMIWC_showcat").css("display","block")}).bind("mouseleave",function(){$("#ciGMIWC_showcat").css("display","none")})}if(gmapsMarkup.currentInfo.nbImg>1){$("#ciGMIWC_picnum").html(a+1+"/"+gmapsMarkup.currentInfo.nbImgTxt);$("#ciWALeft, #ciWARight").css("display","inline-block")}else{$("#ciGMIWC_picnum").html(gmapsMarkup.currentInfo.nbImgTxt);$("#ciWALeft, #ciWARight").css("display","none")}};this.displayPicturePrev=function(){gmapsMarkup.currentInfo.displayed--;if(gmapsMarkup.currentInfo.displayed<0)gmapsMarkup.currentInfo.displayed=gmapsMarkup.currentInfo.nbImg-1;this.displayPictureInfo(gmapsMarkup.currentInfo.displayed)};this.displayPictureNext=function(){gmapsMarkup.currentInfo.displayed++;if(gmapsMarkup.currentInfo.displayed>=gmapsMarkup.currentInfo.nbImg)gmapsMarkup.currentInfo.displayed=0;this.displayPictureInfo(gmapsMarkup.currentInfo.displayed)};this.fitToBounds=function(a,b){gmapsMarkup.maps[b].gMap.fitBounds(a);if(gmapsMarkup.maps[b].zoomLevelMaxActivated&&gmapsMarkup.maps[b].gMap.getZoom()>gmapsMarkup.maps[b].zoomLevel){gmapsMarkup.maps[b].gMap.setZoom(gmapsMarkup.maps[b].zoomLevel)}};this.initializeMapViewport=function(a){var b=this;if(a>-1&&!gmapsMarkup.maps[a].gMap.initialized){$("#"+gmapsMarkup.maps[a].id+" span, #"+gmapsMarkup.maps[a].id+" a").css("font-size","55.0%");if(gmapsMarkup.maps[a].markerVisible){google.maps.event.addListener(gmapsMarkup.maps[a].gMap,"dragend",function(){b.loadMarkers(this)});google.maps.event.addListener(gmapsMarkup.maps[a].gMap,"zoom_changed",function(){b.loadMarkers(this);gmapsMarkup.infoWindow.close()})}if(gmapsMarkup.maps[a].kmlZoom&&gmapsMarkup.maps[a].gMap.kmlFile!=null){google.maps.event.addListenerOnce(gmapsMarkup.maps[a].gMap.kmlFile,"defaultviewport_changed",function(){b.fitToBounds(gmapsMarkup.maps[a].gMap.kmlFile.getDefaultViewport(),a)})}gmapsMarkup.maps[a].gMap.initialized=true}}}var gmapsCM=null,gmapsMM=null;$(window).load(function(){gmapsMM=new markupMaps;gmapsMarkup.currentInfo=null;gmapsMarkup.infoWindow=new google.maps.InfoWindow;google.maps.event.addListener(gmapsMarkup.infoWindow,"closeclick",function(){gmapsMarkup.infoWindow.setContent("");$("#ciGMIWC_img").unbind()});$.ajax({type:"POST",url:"plugins/GMaps/gmaps_ajax.php",async:true,data:{ajaxfct:"public.maps.init",category:gmapsMarkup.categoryId,mapId:"y"},success:function(a){gmapsMarkup.requestId=a;for(var b=0;b<gmapsMarkup.maps.length;b++){$("#"+gmapsMarkup.maps[b].id).css({width:gmapsMarkup.maps[b].width+"px",height:gmapsMarkup.maps[b].height+"px"});gmapsMM.createMap(gmapsMarkup.maps[b],b)}}})})
Index: extensions/GMaps/language/it_IT/index.php
===================================================================
--- extensions/GMaps/language/it_IT/index.php	(revision 11529)
+++ extensions/GMaps/language/it_IT/index.php	(revision 12204)
@@ -1,9 +1,12 @@
 <?php
 // +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based photo gallery                                    |
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
 // +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2011 Piwigo Team                  http://piwigo.org |
-// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
-// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
 // +-----------------------------------------------------------------------+
 // | This program is free software; you can redistribute it and/or modify  |
Index: extensions/GMaps/main.inc.php
===================================================================
--- extensions/GMaps/main.inc.php	(revision 11529)
+++ extensions/GMaps/main.inc.php	(revision 12204)
@@ -2,7 +2,7 @@
 /*
 Plugin Name: GMaps
-Version: 1.3.0
+Version: 1.3.1
 Description: Display and manage (google) maps
-Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=454
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=454
 Author: grum@piwigo.org
 Author URI: http://photos.grum.fr
@@ -101,4 +101,12 @@
 |         |            |   . Impossible to upload kml file
 |         |            |
+| 1.3.2   | 2011-09-22 | * mantis bug:2063
+|         |            |   . Incompatibility with slideshow mode
+|         |            |
+|         |            | * mantis bug:2346
+|         |            |   . Preview / next arrow do not work with [gmaps] tag
+|         |            |     in description
+|         |            |
+|         |            |
 |         |            |
 |         |            |
Index: extensions/GMaps/templates/gmaps_category.tpl
===================================================================
--- extensions/GMaps/templates/gmaps_category.tpl	(revision 11529)
+++ extensions/GMaps/templates/gmaps_category.tpl	(revision 12204)
@@ -3,5 +3,4 @@
 {combine_script id="jquery.ui.dialog" path="themes/default/js/ui/minified/jquery.ui.dialog.min.js"}
 {combine_script id="maps.google.com/api" path="http://maps.google.com/maps/api/js?sensor=false"}
-{combine_script id="gmaps.category" path="plugins/GMaps/js/gmapsCategory.min.js" require="jquery.ui"}
 
 {foreach from=$maps item=map}
@@ -11,26 +10,2 @@
 {/foreach}
 
-
-<div id='iGMapsInfoWindow' style='display:none;'>
-  <div id='iGMapsInfoWindowContent'>
-    <div id='iGMIWC_title'>Titre de la photo</div>
-
-    <table id='iGMIWC_thumb'>
-      <tr>
-        <td style='width:28px;'><div id='iWALeft' onclick='displayPicturePrev();'></div></td>
-        <td>
-          <img id='iGMIWC_img' src=''>
-        </td>
-        <td style='width:28px;'><div id='iWARight' onclick='displayPictureNext();'></div></td>
-      </tr>
-    </table>
-
-    <div id='iGMIWC_picnum'>0/0 photo</div>
-
-    <div id='iGMIWC_showcat' style='display:none;'>
-      <span>{'gmaps_i_show_this_picture_in'|@translate}</span>
-      <ul id='iGMIWC_showcatList'>
-      </ul>
-    </div>
-  </div>
-</div>
