Index: extensions/gally/gally-default/admin/Conf.class.inc.php
===================================================================
--- extensions/gally/gally-default/admin/Conf.class.inc.php	(revision 8191)
+++ extensions/gally/gally-default/admin/Conf.class.inc.php	(revision 8528)
@@ -117,4 +117,9 @@
   }
 
+  public function confExists($key)
+  {
+    return(array_key_exists($key, $this->values));
+  }
+
   public function getConfValue($key)
   {
@@ -144,4 +149,54 @@
 
 
+  /**
+   * function used to initialize config file
+   *
+   */
+  static public function init($theme)
+  {
+    $forcedToDefault=array(
+      "imageCenterMode" => '',
+      "imageCenterOffset" => '',
+      "imageCenterTopMin" => '',
+      "imageCenterTopBorder" => '',
+      "interfaceAnimated" => '',
+      "commentAnimated" => '',
+      "animateDelay" => '',
+      "marginContainer" => '',
+      "paddingContainer" => '',
+      "tabsAnimated" => '',
+      "tabsHidden" => '',
+      "tabsVisible" => '',
+      "tabsPosition" => '',
+      "commentRows" => '',
+      "menuAnimated" => '',
+      "menuWidth" => '',
+      "menuMaxWidth" => '',
+      "menuMSIEMaxWidth" => '',
+      "imageSimulateHighRes" => '',
+      "imageScrollMinDeadArea" => ''
+      //"expandMenu" => '',
+    );
+    $gallyDefault = new Conf();
+    $gallyDefault->setFileName(PHPWG_ROOT_PATH."themes/gally-default/conf/default.conf");
+    $gallyDefault->read();
+
+    $configDefault = new Conf();
+    $configDefault->setFileName(PHPWG_ROOT_PATH."themes/$theme/conf/default.conf");
+    $configDefault->read();
+
+    $configLocal = new Conf();
+    $configLocal->setFileName(PHPWG_ROOT_PATH."local/themes/$theme/conf/local.conf");
+    $configLocal->read();
+
+    foreach($forcedToDefault as $key => $param)
+    {
+      if($gallyDefault->confExists($key)) $forcedToDefault[$key]=$gallyDefault->getConfValue($key);
+      if($configDefault->confExists($key)) $forcedToDefault[$key]=$configDefault->getConfValue($key);
+    }
+    $configLocal->setConf($forcedToDefault, false);
+    $configLocal->write();
+  }
+
 }
 
Index: extensions/gally/gally-default/admin/GallyDefault.class.inc.php
===================================================================
--- extensions/gally/gally-default/admin/GallyDefault.class.inc.php	(revision 8191)
+++ extensions/gally/gally-default/admin/GallyDefault.class.inc.php	(revision 8528)
@@ -20,4 +20,6 @@
 class GallyDefault
 {
+  const THEME_VERSION = '1.4.0';
+
   private $directories=Array(
     'templates.parent' => '',
@@ -32,6 +34,48 @@
   protected $themeProperties = Array(
       'name' => 'Gally/Default',
-      'version' => '1.3.1'
+      'version' => self::THEME_VERSION
     );
+
+
+  /**
+   * function used to activate a theme
+   *
+   * @param String $themeId : theme's id (for example 'gally-lapis-lazulis')
+   * @param String $themeVersion : theme's release (not gally-default release)
+   * @param String $gallyDefaultNeeded : gally-default release needed
+   * @param &Array $errors : array of error messages
+   */
+  static public function activate($themeId, $themeVersion, $gallyDefaultNeeded, $errors)
+  {
+    if(strnatcmp(self::THEME_VERSION, $gallyDefaultNeeded)<0)
+    {
+      if(!is_array($errors))
+      {
+        if($errors!='')
+        {
+          $errors=array($errors);
+        }
+        else
+        {
+          $errors=array();
+        }
+      }
+
+      $errors[]=sprintf(l10n('This theme needs Gally-default theme v%s; actually, Gally-default version is %s.'), $gallyDefaultNeeded, self::THEME_VERSION);
+    }
+    else
+    {
+      Conf::init($themeId);
+    }
+    return($errors);
+  }
+
+  /**
+   * function used to deactivate a theme
+   *
+   */
+  static public function deactivate()
+  {
+  }
 
   /**
@@ -92,5 +136,5 @@
     $this->config->read();
     $this->config->setFileName($this->directories['conf.local']."/default.conf");
-    $this->config->read();
+    $this->config->read(false);
     $this->config->setFileName(PHPWG_ROOT_PATH."local/themes/".basename(dirname($this->directories['conf.local']))."/conf/local.conf");
     $this->config->read(false);
Index: extensions/gally/gally-default/conf/default.conf
===================================================================
--- extensions/gally/gally-default/conf/default.conf	(revision 8191)
+++ extensions/gally/gally-default/conf/default.conf	(revision 8528)
@@ -72,4 +72,8 @@
 imageCenterTopBorder="imageHeaderBar"
 
+# -- 1.4.0 --
+# The 'imageScrollMinDeadArea' option allows to define the minimum width for
+# dead area in scroll mode
+imageScrollMinDeadArea=0
 
 # The 'imageInterface' option can take theses values :
@@ -195,5 +199,18 @@
 highResClickMode="zoom"
 
-
+# -- 1.4.0 --
+# the 'manageTips' option can take theses values :
+#   "yes" => the interface uses the simpleTip.js script to display hints
+#   "no"  => the interface uses the default browser method to display hints
+manageTips="no"
+
+# -- 1.4.0 --
+# the 'manageTipsPos' define the default position for tips ; the option can take
+# theses values :
+#   "tipOnTop"    => tip is displayed above the object
+#   "tipOnBottom" => tip is displayed under the object
+#   "tipOnLeft"   => tip is displayed on the left side of the object
+#   "tipOnRight"  => tip is displayed on the right side of the object
+manageTipsPos="tipOnBottom"
 
 # ------- Menu parameters ------------------------------------------------------
Index: extensions/gally/gally-default/css/theme.css
===================================================================
--- extensions/gally/gally-default/css/theme.css	(revision 8191)
+++ extensions/gally/gally-default/css/theme.css	(revision 8528)
@@ -6,5 +6,5 @@
   file version: 1.2.0
   ------------------------------------------------------------------------------
-  author: grum at grum.dnsalias.com
+  author: grum at piwigo.org
   << May the Little SpaceFrog be with you >>
   ------------------------------------------------------------------------------
@@ -13,3 +13,5 @@
 
 
-
+.thumbnailCategory {
+  cursor:pointer;
+}
Index: extensions/gally/gally-default/js/gallyjs-tcp.js
===================================================================
--- extensions/gally/gally-default/js/gallyjs-tcp.js	(revision 8191)
+++ extensions/gally/gally-default/js/gallyjs-tcp.js	(revision 8528)
@@ -4,7 +4,7 @@
   ------------------------------------------------------------------------------
   file: gally/gallyjs-tcp.js
-  file release: 1.1.0
+  file release: 1.4.0
   ------------------------------------------------------------------------------
-  author: grum at grum.dnsalias.com
+  author: grum at piwigo.org
   << May the Little SpaceFrog be with you >>
   ------------------------------------------------------------------------------
@@ -16,214 +16,224 @@
 ----------------------------------------------------------------------------- */
 
-var menuState;
-
-$("document").ready( function()
-  {
-    initMenu();
-    initContentDesc();
+var gallyCP=null;
+
+$(document).ready(
+  function()
+  {
+    gallyCP=new GallyCP();
   }
 );
 
 
-function initContentDesc()
+function GallyCP ()
 {
-  if(($("#additional_infoTOP").length + $("#additional_infoBOTTOM").length)<2)
-  {
-    // if div TOP & BOTTOM don't exists, it's not necessary to process this the
-    // initialisation
-    return(false);
-  }
-/*
-  this code permit to manage 3 informations panels with one text area (or 2 if
-  extended description plugin is used)
-
-  this function don't use a regExp object (due to some freeze with this method
-  during test)
-
-  known tags :
-    <!--up-down-->
-    <!--right-left-->
-
-  if the plugin "ExtendedDescription" is installed, the "<!--up-down-->" tag is
-  already managed by the plugin :
-    - top text is in a <div class="additional_info">
-        => text is moved to the to the '#additional_infoTOP' div  and
-            the '.additional_info' div added by the plugin is deleted
-    - bottom text is in <div id="additional_infoLEFT">
-        => if tag "<!--right-left-->" is present
+  var menuState,
+
+  initContentDesc = function()
+  {
+    if(($("#additional_infoTOP").length + $("#additional_infoBOTTOM").length)<2)
+    {
+      // if div TOP & BOTTOM don't exists, it's not necessary to process this the
+      // initialisation
+      return(false);
+    }
+    /*
+      this code permit to manage 3 informations panels with one text area (or 2 if
+      extended description plugin is used)
+
+      this function don't use a regExp object (due to some freeze with this method
+      during test)
+
+      known tags :
+        <!--up-down-->
+        <!--right-left-->
+
+      if the plugin "ExtendedDescription" is installed, the "<!--up-down-->" tag is
+      already managed by the plugin :
+        - top text is in a <div class="additional_info">
+            => text is moved to the to the '#additional_infoTOP' div  and
+                the '.additional_info' div added by the plugin is deleted
+        - bottom text is in <div id="additional_infoLEFT">
+            => if tag "<!--right-left-->" is present
+                text on right is moved to the to the '#additional_infoBOTTOM' div and
+                removed from the '#additional_infoLEFT' div
+
+      if the plugin "ExtendedDescription" is not installed, all the text is in
+      the <div id="additional_infoLEFT">
+        => if tag "<!--up-down-->" is present
+            text on right is moved to the to the '#additional_infoTOP' div and
+            removed from the '#additional_infoLEFT' div
+        => if tag "<!--right-left-->" is present on the '#additional_infoLEFT' div
             text on right is moved to the to the '#additional_infoBOTTOM' div and
             removed from the '#additional_infoLEFT' div
-
-  if the plugin "ExtendedDescription" is not installed, all the text is in
-  the <div id="additional_infoLEFT">
-    => if tag "<!--up-down-->" is present
-        text on right is moved to the to the '#additional_infoTOP' div and
-        removed from the '#additional_infoLEFT' div
-    => if tag "<!--right-left-->" is present on the '#additional_infoLEFT' div
-        text on right is moved to the to the '#additional_infoBOTTOM' div and
-        removed from the '#additional_infoLEFT' div
-*/
-
-  // <!--up-down--> tag
-  txt = $("#additional_infoLEFT").attr("innerHTML");
-  if(txt==null) { txt=""; }
-  tmp = txt.indexOf("<!--up-down-->");
-
-  if(tmp>-1)
-  { // tag is not managed by the ExtendedDescription plugin
-    $("#additional_infoTOP").attr("innerHTML", txt.slice(0,tmp));
-    txt=txt.substr(tmp+14); //remove the tag
-  }
-  else
-  { // perhaps tag is managed by the ExtendedDescription plugin
-    $(".additional_info").each( function (i)
+    */
+
+    // <!--up-down--> tag
+    txt = $("#additional_infoLEFT").attr("innerHTML");
+    if(txt==null) { txt=""; }
+    tmp = txt.indexOf("<!--up-down-->");
+
+    if(tmp>-1)
+    { // tag is not managed by the ExtendedDescription plugin
+      $("#additional_infoTOP").attr("innerHTML", txt.slice(0,tmp));
+      txt=txt.substr(tmp+14); //remove the tag
+    }
+    else
+    { // perhaps tag is managed by the ExtendedDescription plugin
+      $(".additional_info").each( function (i)
+        {
+          if(this.id=="")
+          {
+            $("#additional_infoTOP").attr("innerHTML", $("#additional_infoTOP").attr("innerHTML")+this.innerHTML);
+            this.parentNode.removeChild(this);
+          }
+        }
+      );
+    }
+
+    // <!--right-left--> tag
+    tmp = txt.indexOf("<!--right-left-->");
+
+    if(tmp>-1)
+    { // tag is present, cut the right text to the
+      $("#additional_infoBOTTOM").attr("innerHTML", txt.slice(0,tmp));
+      txt=txt.substr(tmp+17);
+    }
+
+    $("#additional_infoLEFT").attr("innerHTML", txt);
+
+    if((txt.replace(/\s*/im, "")=="")&&($("#additional_infoID").length>0))
+    {
+      // remove the left area if empty
+      $("#additional_infoID").get(0).parentNode.removeChild($("#additional_infoID").get(0));
+    }
+    $(".additional_info").css("visibility", "visible");
+
+    if($("#additional_infoBOTTOM").attr("innerHTML").replace(/\s*/im, "")=="")
+    {
+      // remove the bottom area if empty
+      $("#additional_infoBOTTOM").get(0).parentNode.removeChild($("#additional_infoBOTTOM").get(0));
+    }
+    else
+    {
+      $("#additional_infoBOTTOM").css("visibility", "visible");
+    }
+
+    if($("#additional_infoTOP").attr("innerHTML").replace(/\s*/im, "")=="")
+    {
+      // remove the top area if empty
+      $("#additional_infoTOP").get(0).parentNode.removeChild($("#additional_infoTOP").get(0));
+    }
+    else
+    {
+      $("#additional_infoTOP").css("visibility", "visible");
+    }
+  },
+
+  initMenu = function ()
+  {
+    if(options.menuAnimated != "noswitch")
+    {
+      $("#menubar").css(
+        {
+          visibility:"hidden",
+          top: $("#titrePageID").attr("offsetTop")+$("#titrePageID").attr("offsetHeight")-2+'px'
+        }
+      );
+      switchmenu('n');
+      switch(options.menuWidth)
       {
-        if(this.id=="")
+        case "auto":
+          $("#menubar").css("width", "auto");
+          maxwidth=options.menuMaxWidth;
+
+          regexp = /[1234567]\./i;
+          if(jQuery.browser.msie && jQuery.browser.version.match(regexp))
+          {
+            maxwidth=options.menuMSIEMaxWidth;
+          }
+          if(maxwidth>0) { $("#menubar").css("max-width", maxwidth+"px"); }
+          break;
+        case "info":
+          $("#menubar").css("width", $(".additionnal_info").css("width"));
+          break;
+        default:
+          $("#menubar").css("width", options.menuWidth+"px");
+      }
+    }
+    else
+    {
+      $("#menubar dl dd").each(
+        function (index, elem)
         {
-          $("#additional_infoTOP").attr("innerHTML", $("#additional_infoTOP").attr("innerHTML")+this.innerHTML);
-          this.parentNode.removeChild(this);
+          //alert($(this.parentNode).attr('offsetWidth')+"---"+$(this.parentNode).attr('id'));
+          $(this).css("min-width", $(this.parentNode).attr('offsetWidth'));
+          if(jQuery.browser.msie)
+          {
+            $(this).css("max-width", options.menuMSIEMaxWidth+"px");
+          }
         }
+      );
+    }
+  },
+
+  switchmenu = function(force, iconpath)
+  {
+    if(force=='')
+    {
+      (!menuState)?force='y':force='n';
+    }
+
+    if(options.menuAnimated == "fade")
+    {
+      switch(force)
+      {
+        case 'y':
+          $("#menubar").css({
+            visibility:"visible",
+            height:"auto"
+          }).fadeTo(options.animateDelay,1);
+          $("#icon_menu").attr("className", "button2");
+          menuState=true;
+          break;
+        default:
+          $("#menubar").fadeTo(options.animateDelay, 0, function () {
+            $("#menubar").css({
+              visibility:"hidden",
+              height:"0px"
+            });
+          });
+          $("#icon_menu").attr("className", "button");
+          menuState=false;
       }
-    );
-  }
-
-  // <!--right-left--> tag
-  tmp = txt.indexOf("<!--right-left-->");
-
-  if(tmp>-1)
-  { // tag is present, cut the right text to the
-    $("#additional_infoBOTTOM").attr("innerHTML", txt.slice(0,tmp));
-    txt=txt.substr(tmp+17);
-  }
-
-  $("#additional_infoLEFT").attr("innerHTML", txt);
-
-  if((txt.replace(/\s*/im, "")=="")&&($("#additional_infoID").length>0))
-  {
-    // remove the left area if empty
-    $("#additional_infoID").get(0).parentNode.removeChild($("#additional_infoID").get(0));
-  }
-  $(".additional_info").css("visibility", "visible");
-
-  if($("#additional_infoBOTTOM").attr("innerHTML").replace(/\s*/im, "")=="")
-  {
-    // remove the bottom area if empty
-    $("#additional_infoBOTTOM").get(0).parentNode.removeChild($("#additional_infoBOTTOM").get(0));
-  }
-  else
-  {
-    $("#additional_infoBOTTOM").css("visibility", "visible");
-  }
-
-  if($("#additional_infoTOP").attr("innerHTML").replace(/\s*/im, "")=="")
-  {
-    // remove the top area if empty
-    $("#additional_infoTOP").get(0).parentNode.removeChild($("#additional_infoTOP").get(0));
-  }
-  else
-  {
-    $("#additional_infoTOP").css("visibility", "visible");
-  }
-}
-
-
-function initMenu()
-{
-  if(options.menuAnimated != "noswitch")
-  {
-    $("#menubar").css(
+    }
+    else
+    {
+      switch(force)
       {
-        visibility:"hidden",
-        top: $("#titrePageID").attr("offsetTop")+$("#titrePageID").attr("offsetHeight")-2+'px'
-      }
-    );
-    switchmenu('n');
-    switch(options.menuWidth)
-    {
-      case "auto":
-        $("#menubar").css("width", "auto");
-        maxwidth=options.menuMaxWidth;
-
-        regexp = /[1234567]\./i;
-        if(jQuery.browser.msie && jQuery.browser.version.match(regexp))
-        {
-          maxwidth=options.menuMSIEMaxWidth;
-        }
-        if(maxwidth>0) { $("#menubar").css("max-width", maxwidth+"px"); }
-        break;
-      case "info":
-        $("#menubar").css("width", $(".additionnal_info").css("width"));
-        break;
-      default:
-        $("#menubar").css("width", options.menuWidth+"px");
-    }
-  }
-  else
-  {
-    $("#menubar dl dd").each(
-      function (index, elem)
-      {
-        //alert($(this.parentNode).attr('offsetWidth')+"---"+$(this.parentNode).attr('id'));
-        $(this).css("min-width", $(this.parentNode).attr('offsetWidth'));
-        if(jQuery.browser.msie)
-        {
-          $(this).css("max-width", options.menuMSIEMaxWidth+"px");
-        }
-      }
-    );
-  }
-}
-
-
-function switchmenu(force, iconpath)
-{
-  if(force=='')
-  {
-    (!menuState)?force='y':force='n';
-  }
-
-  if(options.menuAnimated == "fade")
-  {
-    switch(force)
-    {
-      case 'y':
-        $("#menubar").css({
-          visibility:"visible",
-          height:"auto"
-        }).fadeTo(options.animateDelay,1);
-        $("#icon_menu").attr("className", "button2");
-        menuState=true;
-        break;
-      default:
-        $("#menubar").fadeTo(options.animateDelay, 0, function () {
+        case 'y':
+          $("#menubar").css({
+            visibility:"visible",
+            height:"auto"
+          });
+          $("#icon_menu").attr("className", "button2");
+          menuState=true;
+          break;
+        default:
           $("#menubar").css({
             visibility:"hidden",
             height:"0px"
           });
-        });
-        $("#icon_menu").attr("className", "button");
-        menuState=false;
-    }
-  }
-  else
-  {
-    switch(force)
-    {
-      case 'y':
-        $("#menubar").css({
-          visibility:"visible",
-          height:"auto"
-        });
-        $("#icon_menu").attr("className", "button2");
-        menuState=true;
-        break;
-      default:
-        $("#menubar").css({
-          visibility:"hidden",
-          height:"0px"
-        });
-        $("#icon_menu").attr("className", "button");
-        menuState=false;
-    }
-  }
+          $("#icon_menu").attr("className", "button");
+          menuState=false;
+      }
+    }
+  };
+
+  this.switchmenu = function(force, iconpath) { switchmenu(force, iconpath); };
+
+  initMenu();
+  initContentDesc();
 }
+
+
Index: extensions/gally/gally-default/js/gallyjs-tcp.packed.js
===================================================================
--- extensions/gally/gally-default/js/gallyjs-tcp.packed.js	(revision 8528)
+++ extensions/gally/gally-default/js/gallyjs-tcp.packed.js	(revision 8528)
@@ -0,0 +1,2 @@
+/* file: gally-tcp.js - v1.4.0 | packed on 2011/01/08 with http://joliclic.free.fr/php/javascript-packer/ */
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('W N=X;$(1n).1u(a(){N=1k P()});a P(){W k,10=a(){5(($("#b").K+$("#j").K)<2){1h(L)}6=$("#S").4("8");5(6==X){6=""}d=6.V("<!--1C-1d-->");5(d>-1){$("#b").4("8",6.Q(0,d));6=6.T(d+14)}l{$(".U").Y(a(i){5(e.1f==""){$("#b").4("8",$("#b").4("8")+e.8);e.m.q(e)}})}d=6.V("<!--1j-1i-->");5(d>-1){$("#j").4("8",6.Q(0,d));6=6.T(d+17)}$("#S").4("8",6);5((6.D(/\\s*/H,"")=="")&&($("#G").K>0)){$("#G").h(0).m.q($("#G").h(0))}$(".U").3("c","o");5($("#j").4("8").D(/\\s*/H,"")==""){$("#j").h(0).m.q($("#j").h(0))}l{$("#j").3("c","o")}5($("#b").4("8").D(/\\s*/H,"")==""){$("#b").h(0).m.q($("#b").h(0))}l{$("#b").3("c","o")}},15=a(){5(9.12!="1y"){$("#7").3({c:"F",1z:$("#M").4("1B")+$("#M").4("1A")-2+\'r\'});x(\'n\');E(9.R){t"u":$("#7").3("g","u");p=9.1t;O=/[1o]\\./i;5(I.B.18&&I.B.1m.1p(O)){p=9.13}5(p>0){$("#7").3("16-g",p+"r")}z;t"1r":$("#7").3("g",$(".1e").3("g"));z;J:$("#7").3("g",9.R+"r")}}l{$("#7 1s 1q").Y(a(1v,1w){$(e).3("1x-g",$(e.m).4(\'1l\'));5(I.B.18){$(e).3("16-g",9.13+"r")}})}},x=a(f,C){5(f==\'\'){(!k)?f=\'y\':f=\'n\'}5(9.12=="1g"){E(f){t\'y\':$("#7").3({c:"o",A:"u"}).Z(9.19,1);$("#v").4("w","1b");k=1c;z;J:$("#7").Z(9.19,0,a(){$("#7").3({c:"F",A:"1a"})});$("#v").4("w","11");k=L}}l{E(f){t\'y\':$("#7").3({c:"o",A:"u"});$("#v").4("w","1b");k=1c;z;J:$("#7").3({c:"F",A:"1a"});$("#v").4("w","11");k=L}}};e.x=a(f,C){x(f,C)};15();10()}',62,101,'|||css|attr|if|txt|menubar|innerHTML|options|function|additional_infoTOP|visibility|tmp|this|force|width|get||additional_infoBOTTOM|menuState|else|parentNode||visible|maxwidth|removeChild|px||case|auto|icon_menu|className|switchmenu||break|height|browser|iconpath|replace|switch|hidden|additional_infoID|im|jQuery|default|length|false|titrePageID|gallyCP|regexp|GallyCP|slice|menuWidth|additional_infoLEFT|substr|additional_info|indexOf|var|null|each|fadeTo|initContentDesc|button|menuAnimated|menuMSIEMaxWidth||initMenu|max||msie|animateDelay|0px|button2|true|down|additionnal_info|id|fade|return|left|right|new|offsetWidth|version|document|1234567|match|dd|info|dl|menuMaxWidth|ready|index|elem|min|noswitch|top|offsetHeight|offsetTop|up'.split('|'),0,{}))
Index: extensions/gally/gally-default/js/gallyjs-tpp.js
===================================================================
--- extensions/gally/gally-default/js/gallyjs-tpp.js	(revision 8191)
+++ extensions/gally/gally-default/js/gallyjs-tpp.js	(revision 8528)
@@ -4,7 +4,7 @@
   ------------------------------------------------------------------------------
   file: gally/gallyjs-tpp.js
-  file release: 1.3.4
+  file release: 1.4.0
   ------------------------------------------------------------------------------
-  author: grum at grum.dnsalias.com
+  author: grum at piwigo.org
   << May the Little SpaceFrog be with you >>
   ------------------------------------------------------------------------------
@@ -16,572 +16,593 @@
 ----------------------------------------------------------------------------- */
 
-
-var showtabs;
-var selectedTab;
-var interfaceTimerDelay;
-var isScrollable;
-var zoomMode;
-
-$("document").ready(
+var gallyPP=null;
+
+$(document).ready(
   function()
   {
-    inittoolbar();
+    gallyPP=new GallyPP();
   }
 );
 
-function inittoolbar()
-{
-  $(document).data("initialized", 0);
-  $(document).data("interface", false);
-  $(document).data("highWidth", 0);
-  $(document).data("highHeight", 0);
-
-  regexp = /[1234567]\./i;
-
-  if(jQuery.browser.msie && jQuery.browser.version.match(regexp))
-  {
-    // this features don't work with the f*****g msie browser version <= 7.0
-    // it seems to be functionnal with ie 8.0
-    options.interfaceAnimated="none";
-    options.imageAutoScroll=false;
-  }
-
-  if(options.imageAutoScroll)
-  {
-    $("html").css("overflow-x", "hidden");
-  }
-  else
-  {
-    $("html").css("overflow-x", "scroll");
-  }
-
-  if(options.imageCenterTopBorder == "imageHeaderBar")
-  {
-    options.imageCenterTopMin+=$("#imageHeaderBar").get(0).offsetTop+$("#imageHeaderBar").get(0).offsetHeight;
-  }
-
-  if(!options.interfaceCanSwitch)
-  {
-    options.interfaceHidden=false;
-  }
-
-  zoomMode=options.defaultZoomSize;
-  currentTab=-1;
-  selectedTab=-1;
-  interfaceTimerDelay = null;
-  switchInterface('0', true);
-  initializeImageMode("init");
-
-
-  if((options.interfaceOnImage=="always" || (options.interfaceOnImage=="noscroll" && !isScrollable)) && options.interfaceCanSwitch)
-  {
-    $("#theImg").bind("mouseenter", function () { switchInterface('y', true); } )
-                .bind("mouseleave", function () { switchInterface('n', true); } )
-                .bind("mousemove", function () { switchInterface('y', true); } );
-  }
-
-  if(options.interfaceCanSwitch)
-  {
-    $("#imageHeaderBar").bind("mouseenter", function () { switchInterface('y', false); } )
-                        .bind("mousemove", function () { switchInterface('y', false); } );
-    $("#imageToolBar").bind("mouseenter", function () { switchInterface('y', true); } )
-                      .bind("mouseleave", function () { switchInterface('n', true); } )
-                      .bind("mousemove", function () { switchInterface('y', true); } );
-
-
-    $("#navThumbPrev").bind("mouseenter", function () { switchInterface('Y', true); } )
-                      .bind("mouseleave", function () { switchInterface('n', true); } )
-                      .bind("mousemove", function () { switchInterface('y', true); } );
-
-    $("#navThumbNext").bind("mouseenter", function () { switchInterface('Y', true); } )
-                      .bind("mouseleave", function () { switchInterface('n', true); } )
-                      .bind("mousemove", function () { switchInterface('y', true); } );
-  }
-
-
-  $("#navThumbPrev").css("top", $("#navThumbPrev").attr("offsetTop")+$("#theHeader").attr("offsetHeight")+$("#theHeaderAlt").attr("offsetHeight")+"px");
-  $("#navThumbNext").css("top", $("#navThumbNext").attr("offsetTop")+$("#theHeader").attr("offsetHeight")+$("#theHeaderAlt").attr("offsetHeight")+"px");
-
-  $("#theImage").css("top", $("#theImage").attr("offsetTop")+$("#theHeader").attr("offsetHeight")+$("#theHeaderAlt").attr("offsetHeight")+"px");
-
-  $("#contentid").attr("rows", options.commentRows);
-
-  /* fx duration option set to 0 doesn't work so... */
-  if(options.animateDelay>0)
-  {
-    $("#theTabs").tabs({ fx: { opacity: 'toggle', duration:options.animateDelay } } );
-  }
-  else
-  {
-    $("#theTabs").tabs();
-  }
-  switchTabs('n');
-
-
-  if(options.interfaceCanSwitch)
-  {
-    $('#theTabsContainer').bind("mouseenter", function () { switchInterface('Y', false); } )
-                          .bind("mouseleave", function () { switchInterface('n'); } )
+function GallyPP () {
+  var tabs={
+        show:'n',
+        current:-1,
+        selected:-1
+      },
+      interface={
+        visible:false,
+        initialized:0,
+        timerDelay:null
+      },
+      image={
+        isScrollable:false,
+        highWidth:0,
+        highHeight:0,
+        leftPos:0,
+        zoomMode:''
+      },
+      container=null,
+
+  /**
+   * initialize the object
+   */
+  init = function()
+  {
+    regexp = /[1234567]\./i;
+
+    if(jQuery.browser.msie && jQuery.browser.version.match(regexp))
+    {
+      // this features don't work with the f*****g msie browser version <= 7.0
+      // it seems to be functionnal with ie 8.0
+      options.interfaceAnimated="none";
+      options.imageAutoScroll=false;
+    }
+
+    if(options.imageAutoScroll)
+    {
+      $("html").css("overflow-x", "hidden");
+    }
+    else
+    {
+      $("html").css("overflow-x", "scroll");
+    }
+
+    if(options.imageCenterTopBorder == "imageHeaderBar")
+    {
+      options.imageCenterTopMin+=$("#imageHeaderBar").get(0).offsetTop+$("#imageHeaderBar").get(0).offsetHeight;
+    }
+
+    if(!options.interfaceCanSwitch)
+    {
+      options.interfaceHidden=false;
+    }
+
+    image.zoomMode=options.defaultZoomSize;
+
+    switchInterface('0', true);
+    initializeImageMode("init");
+
+
+    if((options.interfaceOnImage=="always" || (options.interfaceOnImage=="noscroll" && !image.isScrollable)) && options.interfaceCanSwitch)
+    {
+      $("#theImg").bind("mouseenter", function () { switchInterface('y', true); } )
+                  .bind("mouseleave", function () { switchInterface('n', true); } )
+                  .bind("mousemove", function () { switchInterface('y', true); } );
+    }
+
+    if(options.interfaceCanSwitch)
+    {
+      $("#imageHeaderBar").bind("mouseenter", function () { switchInterface('y', false); } )
                           .bind("mousemove", function () { switchInterface('y', false); } );
-  }
-
-  $("#theTabs").bind('tabsselect', function(event, ui)
-    {
-      /* The "collapsible" option don't work with jQuery 1.2.6
-       * This function aims to reproduct this functionnality
-      */
-      selectedTab=ui.index;
-    }
-  );
-
-  $('.tab a').click(function()
-    {
-      /* The "collapsible" option don't work with jQuery 1.2.6
-       * This function aims to reproduct this functionnality
-      */
-      $(this).get(0).blur();
-      if(selectedTab == currentTab)
-      {
-        if (currentTab!=-1) switchTabs('n');
-        currentTab=-1;
-        selectedTab=-1;
-      }
-      else
-      {
-        if(currentTab==-1) switchTabs('y');
-        currentTab=selectedTab;
-      }
-    }
-  );
-
-  $(window).resize( function () { initializeImageMode("resize"); } );
-
-  $(document).data("initialized", 1).trigger('gallyInterfaceReady');
-}
-
-function simulateHighRes()
-{
-  if(isScrollable && options.imageHaveHighRes==false && options.imageSimulateHighRes)
-  {
-    $('#theImgContainer').bind('click', function ()
-      {
-        openDisplayHigh($('#theImg').attr('src'));
-      }
-    ).addClass('pointer');
-  }
-
-}
-
-function initializeImageMode(mode)
-{
-  if(mode=="init")
-  {
-    theHeaderHeight=$("#theHeader").attr("offsetHeight")+$("#theHeaderAlt").attr("offsetHeight");
-
-    $("#imageToolBar").css("top", $("#imageToolBar").attr("offsetTop")+theHeaderHeight+$("#imageHeaderBar").attr("offsetHeight")+"px");
-
-    if(options.tabsPosition=="bottom")
-    {
-      copyrightArea = $("#copyright").attr("clientHeight")+1;
-      $("#theTabsContainer").css("bottom", copyrightArea+"px");
-    }
-    else if(options.tabsPosition=="top")
-    {
-      toolBarArea = $("#imageToolBar").attr("offsetTop")+$("#imageToolBar").attr("offsetHeight");
-      $("#theTabsContainer").css("top", toolBarArea+"px");
-    }
-
-    if($("#navThumbPrev").length>0)
-    {
-      $("#navThumbPrev").css("height", $("#copyright").attr("offsetTop")-$("#navThumbPrev").attr("offsetTop")-options.tabsHidden+"px");
-    }
-    if($("#navThumbNext").length>0)
-    {
-      $("#navThumbNext").css("height", $("#copyright").attr("offsetTop")-$("#navThumbNext").attr("offsetTop")-options.tabsHidden+"px");
-    }
-  }
-
-  cssValues = new Object;
-  cssValues.height = $("#theImg").attr("height")+"px";
-
-  // autoscroll
-  if(options.imageAutoScroll && ($("#theImg").attr("scrollWidth")>($("#theImage").attr("clientWidth")-2*options.marginContainer)))
-  {
-    cssValues.width = ($("#theImage").attr("clientWidth")- 2*options.marginContainer)+"px";
-
-    $("#theImage").bind("mousemove",
-      function(event){
-        deadArea = $("#navThumbPrev").attr("clientWidth")*1.2;
-        mouse=Math.max(Math.min(event.clientX-this.offsetLeft, this.clientWidth - deadArea), deadArea);
-        $("#theImg")
-          .css("left",Math.round(($("#theImg").attr("scrollWidth")-this.clientWidth) * -(mouse-deadArea)/(this.clientWidth-2*deadArea))+"px")
-          .trigger('scrolled');
+      $("#imageToolBar").bind("mouseenter", function () { switchInterface('y', true); } )
+                        .bind("mouseleave", function () { switchInterface('n', true); } )
+                        .bind("mousemove", function () { switchInterface('y', true); } );
+
+
+      $("#navThumbPrev").bind("mouseenter", function () { switchInterface('Y', true); } )
+                        .bind("mouseleave", function () { switchInterface('n', true); } )
+                        .bind("mousemove", function () { switchInterface('y', true); } );
+
+      $("#navThumbNext").bind("mouseenter", function () { switchInterface('Y', true); } )
+                        .bind("mouseleave", function () { switchInterface('n', true); } )
+                        .bind("mousemove", function () { switchInterface('y', true); } );
+    }
+
+
+    $("#navThumbPrev").css("top", $("#navThumbPrev").attr("offsetTop")+$("#theHeader").attr("offsetHeight")+$("#theHeaderAlt").attr("offsetHeight")+"px");
+    $("#navThumbNext").css("top", $("#navThumbNext").attr("offsetTop")+$("#theHeader").attr("offsetHeight")+$("#theHeaderAlt").attr("offsetHeight")+"px");
+
+    $("#theImage").css("top", $("#theImage").attr("offsetTop")+$("#theHeader").attr("offsetHeight")+$("#theHeaderAlt").attr("offsetHeight")+"px");
+
+    $("#contentid").attr("rows", options.commentRows);
+
+    /* fx duration option set to 0 doesn't work so... */
+    if(options.animateDelay>0)
+    {
+      $("#theTabs").tabs({ fx: { opacity: 'toggle', duration:options.animateDelay } } );
+    }
+    else
+    {
+      $("#theTabs").tabs();
+    }
+    switchTabs('n');
+
+
+    if(options.interfaceCanSwitch)
+    {
+      $('#theTabsContainer').bind("mouseenter", function () { switchInterface('Y', false); } )
+                            .bind("mouseleave", function () { switchInterface('n'); } )
+                            .bind("mousemove", function () { switchInterface('y', false); } );
+    }
+
+    $("#theTabs").bind('tabsselect', function(event, ui)
+      {
+        /* The "collapsible" option don't work with jQuery 1.2.6
+         * This function aims to reproduct this functionnality
+        */
+        tabs.selected=ui.index;
       }
     );
-    isScrollable=true;
-  }
-  else
-  {
-    $("#theImage").unbind("mousemove");
-    $("#theImg").css("left", "0px");
-    cssValues.width = $("#theImg").attr("scrollWidth")+"px";
-    isScrollable=false;
-  }
-  $("#theImgContainer").css(cssValues);
-
-  // imagecenter
-  if($("#copyright").css("position")=="fixed")
-  {
-    $("#theImage").css("padding-bottom", $("#copyright").attr("offsetHeight")+"px");
-  }
-  switch(options.imageCenterMode)
-  {
-    case "img":
-      imgTop = $("#theImgContainer").attr('offsetHeight');
-      break;
-    case "all":
-      imgTop = $("#theImage").attr('offsetHeight');
-      break;
-    default:
-      imgTop = -10000;
-      break;
-  }
-  imgTop = ($("#copyright").attr("offsetTop") - ($("#imageHeaderBar").attr("offsetTop") + $("#imageHeaderBar").attr("offsetHeight")) - imgTop)/2 + options.imageCenterOffset;
-
-  if(imgTop<options.imageCenterTopMin)
-  {
-    imgTop=options.imageCenterTopMin;
-  }
-  imgTop=imgTop+"px";
-
-  $("#theImage").css("top", imgTop);
-
-  simulateHighRes();
-
-}
-
-function switchInterface(show, resetTimer)
-{
-  /*
-  uiImg class is affected on this elements :
-  $("#imageToolBarContainer").stop(true, false).fadeTo(animateDelay, 1);
-  $("#imageInfosContainer").stop(true, false).fadeTo(animateDelay, 1);
-  $("#navThumbPrevContainer").stop(true, false).fadeTo(animateDelay, 1);
-  $("#navThumbNextContainer").stop(true, false).fadeTo(animateDelay, 1);
-  */
-
-  if(($(document).data("initialized")==1)&&(options.interfaceHidden))
-  {
-    $(document).data("initialized", 2);
-    if(show=="Y") return('');
-  }
-
-  if(!options.interfaceHidden && show=="0")  { show="1"; }
-
-  // works with jQuery 1.2.6 (support function need jQuery 1.3)
-  if(options.interfaceAnimated=="fade")
-  {
-    switch(show)
-    {
-      case '0':
-        $(".uiImg").css({opacity: 0, visibility:"hidden"});
-        $(document).data("interface", false);
+
+    $('.tab a').click(function()
+      {
+        /* The "collapsible" option don't work with jQuery 1.2.6
+         * This function aims to reproduct this functionnality
+        */
+        $(this).get(0).blur();
+        if(tabs.selected == tabs.current)
+        {
+          if (tabs.current!=-1) switchTabs('n');
+          tabs.current=-1;
+          tabs.selected=-1;
+        }
+        else
+        {
+          if(tabs.current==-1) switchTabs('y');
+          tabs.current=tabs.selected;
+        }
+      }
+    );
+
+    $(window).resize( function () { initializeImageMode("resize"); } );
+
+    interface.initialized=1;
+    $(document).trigger('gallyInterfaceReady');
+  },
+
+  simulateHighRes = function ()
+  {
+    if(image.isScrollable && options.imageHaveHighRes==false && options.imageSimulateHighRes)
+    {
+      $('#theImgContainer').bind('click', function ()
+        {
+          openDisplayHigh($('#theImg').attr('src'));
+        }
+      ).addClass('pointer');
+    }
+
+  },
+
+  initializeImageMode = function (mode)
+  {
+    if(mode=="init")
+    {
+      theHeaderHeight=$("#theHeader").attr("offsetHeight")+$("#theHeaderAlt").attr("offsetHeight");
+
+      $("#imageToolBar").css("top", $("#imageToolBar").attr("offsetTop")+theHeaderHeight+$("#imageHeaderBar").attr("offsetHeight")+"px");
+
+      if(options.tabsPosition=="bottom")
+      {
+        copyrightArea = $("#copyright").attr("clientHeight")+1;
+        $("#theTabsContainer").css("bottom", copyrightArea+"px");
+      }
+      else if(options.tabsPosition=="top")
+      {
+        toolBarArea = $("#imageToolBar").attr("offsetTop")+$("#imageToolBar").attr("offsetHeight");
+        $("#theTabsContainer").css("top", toolBarArea+"px");
+      }
+
+      if($("#navThumbPrev").length>0)
+      {
+        $("#navThumbPrev").css("height", $("#copyright").attr("offsetTop")-$("#navThumbPrev").attr("offsetTop")-options.tabsHidden+"px");
+      }
+      if($("#navThumbNext").length>0)
+      {
+        $("#navThumbNext").css("height", $("#copyright").attr("offsetTop")-$("#navThumbNext").attr("offsetTop")-options.tabsHidden+"px");
+      }
+    }
+
+    cssValues = new Object;
+    cssValues.height = $("#theImg").attr("height")+"px";
+
+    // autoscroll
+    if(options.imageAutoScroll && ($("#theImg").attr("scrollWidth")>($("#theImage").attr("clientWidth")-2*options.marginContainer)))
+    {
+      cssValues.width = ($("#theImage").attr("clientWidth")- 2*(options.marginContainer+options.paddingContainer))+"px";
+
+      $("#theImage").bind("mousemove",
+        function(event){
+          deadArea = Math.max(options.imageScrollMinDeadArea, $("#navThumbPrev").attr("clientWidth")*1.2);
+          mouse=Math.max(Math.min(event.clientX-image.leftPos, this.clientWidth - deadArea), deadArea);
+          $("#theImg")
+            .css("left",Math.round(($("#theImg").attr("scrollWidth")-this.clientWidth) * -(mouse-deadArea)/(this.clientWidth-2*deadArea))+"px")
+            .trigger('scrolled');
+        }
+      );
+      image.isScrollable=true;
+    }
+    else
+    {
+      $("#theImage").unbind("mousemove");
+      $("#theImg").css("left", "0px");
+      cssValues.width = $("#theImg").attr("scrollWidth")+"px";
+      image.isScrollable=false;
+    }
+    $("#theImgContainer").css(cssValues);
+
+    // imagecenter
+    if($("#copyright").css("position")=="fixed")
+    {
+      $("#theImage").css("padding-bottom", $("#copyright").attr("offsetHeight")+"px");
+    }
+    switch(options.imageCenterMode)
+    {
+      case "img":
+        imgTop = $("#theImgContainer").attr('offsetHeight');
         break;
-      case '1':
-        if(!$(document).data("interface")) $(".uiImg").css({opacity: 1, visibility:"visible"});
-        $(document).data("interface", true);
-        if(resetTimer) resetInterfaceTimer();
-        break;
-      case '2':
-        //if($(document).data("interface")) break;
-      case 'Y':
-      case 'y':
-        if(!$(document).data("interface")) $(".uiImg").css("visibility","visible").stop(true, false).fadeTo(options.animateDelay, 1);
-        $(document).data("interface", true);
-        if(resetTimer) resetInterfaceTimer();
+      case "all":
+        imgTop = $("#theImage").attr('offsetHeight');
         break;
       default:
-        $(".uiImg").stop(true, false).fadeTo(options.animateDelay, 0, function ()
+        imgTop = -10000;
+        break;
+    }
+    imgTop = ($("#copyright").attr("offsetTop") - ($("#imageHeaderBar").attr("offsetTop") + $("#imageHeaderBar").attr("offsetHeight")) - imgTop)/2 + options.imageCenterOffset;
+
+    if(imgTop<options.imageCenterTopMin)
+    {
+      imgTop=options.imageCenterTopMin;
+    }
+    imgTop=imgTop+"px";
+
+    $("#theImage").css("top", imgTop);
+
+
+    image.leftPos=$('#theImage').offset().left;
+
+    simulateHighRes();
+
+  },
+
+  switchInterface = function (show, resetTimer)
+  {
+    if((interface.initialized==1)&&(options.interfaceHidden))
+    {
+      interface.initialized=2;
+      if(show=="Y") return('');
+    }
+
+    if(!options.interfaceHidden && show=="0")  { show="1"; }
+
+    // works with jQuery 1.2.6 (support function need jQuery 1.3)
+    if(options.interfaceAnimated=="fade")
+    {
+      switch(show)
+      {
+        case '0':
+          $(".uiImg").css({opacity: 0, visibility:"hidden"});
+          interface.visible=false;
+          break;
+        case '1':
+          if(!interface.visible) $(".uiImg").css({opacity: 1, visibility:"visible"});
+          interface.visible=true;
+          if(resetTimer) resetInterfaceTimer();
+          break;
+        case '2':
+          //if(interface.visible) break;
+        case 'Y':
+        case 'y':
+          if(!interface.visible) $(".uiImg").css("visibility","visible").stop(true, false).fadeTo(options.animateDelay, 1);
+          interface.visible=true;
+          if(resetTimer) resetInterfaceTimer();
+          break;
+        default:
+          $(".uiImg").stop(true, false).fadeTo(options.animateDelay, 0, function ()
+            {
+              this.style.visibility="hidden";
+              interface.visible=false;
+            }
+          );
+          clearInterfaceTimer();
+          break;
+      }
+    }
+    else
+    {
+      //other value....
+      switch(show)
+      {
+        case 'y':
+        case 'Y':
+        case '1':
+        case '2':
+          if(!interface.visible) $(".uiImg").css("visibility", "visible");
+          interface.visible=true;
+          if(resetTimer) resetInterfaceTimer();
+          break;
+        default:
+          $(".uiImg").css("visibility", "hidden");
+          interface.visible=false;
+          clearInterfaceTimer();
+          break;
+      }
+    }
+  },
+
+  switchTabs = function(show)
+  {
+    if(show!='')
+    {
+      tabs.show=show;
+    }
+    else
+    {
+      if(tabs.show!='n')
+      {
+        tabs.show='n';
+      }
+      else
+      {
+        tabs.show='y';
+      }
+    }
+
+    if(options.tabsAnimated)
+    {
+      if(tabs.show=='y')
+      {
+        $("#theTabsContainer").animate({height:options.tabsVisible+"px"}, options.animateDelay).trigger('resize');
+      }
+      else
+      {
+        $('#theTabs div.tabPanel').addClass("ui-tabs-hide").css("display", "");
+        $('#theTabs li').removeClass("ui-tabs-selected");
+        $("#theTabsContainer").animate({height:options.tabsHidden+"px"}, options.animateDelay).trigger('resize');
+      }
+    }
+    else
+    {
+      if(tabs.show=='y')
+      {
+        $("#theTabsContainer").css({height:options.tabsVisible+"px"}).trigger('resize');
+      }
+      else
+      {
+        $('#theTabs div.tabPanel').addClass("ui-tabs-hide").css("display", "");
+        $('#theTabs li').removeClass("ui-tabs-selected");
+        $("#theTabsContainer").css({height:options.tabsHidden+"px"}).trigger('resize');
+      }
+    }
+  },
+
+  clearInterfaceTimer = function()
+  {
+    if(interface.timerDelay!=null)
+    {
+      window.clearInterval(interface.timerDelay);
+      interface.timerDelay=null;
+    }
+  },
+
+  resetInterfaceTimer = function()
+  {
+    clearInterfaceTimer();
+    if(options.interfaceTimerDelay>0 && options.interfaceCanSwitch) interface.timerDelay=window.setInterval(switchInterface, options.interfaceTimerDelay, "n", false);
+  },
+
+  openDisplayHigh = function(url)
+  {
+    $('#theImageHigh').css(
+      {
+        width:$("html").get(0).scrollWidth+"px",
+        height:$("html").get(0).scrollHeight+"px",
+        display:"block"
+      }
+    );
+
+    if($("#theImgHigh").attr('src')=="")
+    {
+      p = new Object();
+      p.left = (($(window).width()-$("#theImgHighContainer").attr("clientWidth")-options.paddingContainer*2)/2)+"px";
+      p.top = (($(window).height()-$("#theImgHighContainer").attr("clientHeight")-options.paddingContainer*2)/2)+"px";
+
+
+      $('#theImgHighContainer')
+        .css(
           {
-            this.style.visibility="hidden";
-            $(document).data("interface", false);
+            left:p.left,
+            top:p.top,
+            padding:options.paddingContainer+"px"
           }
         );
-        clearInterfaceTimer();
-        break;
-    }
-  }
-  else
-  {
-    //other value....
-    switch(show)
-    {
-      case 'y':
-      case 'Y':
-      case '1':
-      case '2':
-        if(!$(document).data("interface")) $(".uiImg").css("visibility", "visible");
-        $(document).data("interface", true);
-        if(resetTimer) resetInterfaceTimer();
-        break;
-      default:
-        $(".uiImg").css("visibility", "hidden");
-        $(document).data("interface", false);
-        clearInterfaceTimer();
-        break;
-    }
-  }
-}
-
-function switchTabs(show)
-{
-  if(show!='')
-  {
-    showtabs=show;
-  }
-  else
-  {
-    if(showtabs!='n')
-    {
-      showtabs='n';
-    }
-    else
-    {
-      showtabs='y';
-    }
-  }
-
-  if(options.tabsAnimated)
-  {
-    if(showtabs=='y')
-    {
-      $("#theTabsContainer").animate({height:options.tabsVisible+"px"}, options.animateDelay).trigger('resize');
-    }
-    else
-    {
-      $('#theTabs div.tabPanel').addClass("ui-tabs-hide").css("display", "");
-      $('#theTabs li').removeClass("ui-tabs-selected");
-      $("#theTabsContainer").animate({height:options.tabsHidden+"px"}, options.animateDelay).trigger('resize');
-    }
-  }
-  else
-  {
-    if(showtabs=='y')
-    {
-      $("#theTabsContainer").css({height:options.tabsVisible+"px"}).trigger('resize');
-    }
-    else
-    {
-      $('#theTabs div.tabPanel').addClass("ui-tabs-hide").css("display", "");
-      $('#theTabs li').removeClass("ui-tabs-selected");
-      $("#theTabsContainer").css({height:options.tabsHidden+"px"}).trigger('resize');
-    }
-  }
-}
-
-function clearInterfaceTimer()
-{
-  if(interfaceTimerDelay!=null)
-  {
-    window.clearInterval(interfaceTimerDelay);
-    interfaceTimerDelay=null;
-  }
-}
-
-function resetInterfaceTimer()
-{
-  clearInterfaceTimer();
-  if(options.interfaceTimerDelay>0 && options.interfaceCanSwitch) interfaceTimerDelay=window.setInterval(switchInterface, options.interfaceTimerDelay, "n", false);
-}
-
-function openDisplayHigh(url)
-{
-  $('#theImageHigh').css(
-    {
-      width:$("html").get(0).scrollWidth+"px",
-      height:$("html").get(0).scrollHeight+"px",
-      display:"block"
-    }
-  );
-
-  if($("#theImgHigh").attr('src')=="")
-  {
-    p = new Object();
-    p.left = (($(window).width()-$("#theImgHighContainer").attr("clientWidth")-options.paddingContainer*2)/2)+"px";
-    p.top = (($(window).height()-$("#theImgHighContainer").attr("clientHeight")-options.paddingContainer*2)/2)+"px";
-
-
-    $('#theImgHighContainer')
-      .css(
+
+
+      $("#theImgHigh")
+        .load(
+          function ()
+          {
+            image.highWidth=$("#theImgHigh").width();
+            image.highHeight=$("#theImgHigh").height();
+
+            p=calcImgHighPositionAndSize(image.zoomMode);
+
+            $('#theImgHighContainer').css("background-image", "none");
+            displayZoomHigh();
+            $("#theImgHigh").css( {display:"block"} );
+          }
+        )
+        .attr('src', url);
+
+      if(options.highResClickMode=='close')
+      {
+        $("#theImgHigh").bind('click', closeDisplayHigh);
+      }
+      else
+      {
+        // switch zoom
+        $("#theImgHigh").bind('click', switchZoomHigh);
+      }
+    }
+    else
+    {
+      p=calcImgHighPositionAndSize(image.zoomMode);
+
+      $('#theImgHighContainer')
+        .css(
+          {
+            left:p.left+"px",
+            top:p.top+"px",
+            width:p.width+"px",
+            height:p.height+"px"
+          }
+        );
+    }
+  },
+
+  calcImgHighPositionAndSize = function(zoom)
+  {
+    var p = {
+          left:options.marginContainer,
+          top:options.marginContainer,
+          width:0,
+          height:0
+        },
+        margins = (options.marginContainer+options.paddingContainer)*2;
+
+    if(zoom=='full')
+    {
+      p.width = $("html").get(0).clientWidth-margins;
+      p.height = $("html").get(0).clientHeight-margins;
+    }
+    else
+    {
+      //zoom = 'fit'
+      ratioImg = image.highWidth / image.highHeight;
+      ratioPage = $("html").get(0).clientWidth / $("html").get(0).clientHeight;
+
+      if((ratioPage > 1 && (ratioPage > ratioImg)) ||
+         (ratioPage < 1 && (ratioPage < ratioImg)))
+      {
+        p.height = $("html").get(0).clientHeight-margins;
+        p.width = p.height*ratioImg;
+      }
+      else
+      {
+        p.width = $("html").get(0).clientWidth-margins;
+        p.height = p.width/ratioImg;
+      }
+      p.left = ($("html").get(0).clientWidth-p.width)/2-options.paddingContainer;
+      p.top = ($("html").get(0).clientHeight-p.height)/2-options.paddingContainer;
+    }
+
+    if(p.width>image.highWidth)
+    {
+      p.width = image.highWidth;
+      p.left = ($("html").get(0).clientWidth-p.width)/2;
+    }
+    if(p.height>image.highHeight)
+    {
+      p.height = image.highHeight;
+      p.top = ($("html").get(0).clientHeight-p.height)/2;
+    }
+
+    return(p);
+  },
+
+  displayZoomHigh = function()
+  {
+    container=calcImgHighPositionAndSize(image.zoomMode);
+
+    $('#theImgHighContainer').css(
         {
-          left:p.left,
-          top:p.top,
-          padding:options.paddingContainer+"px"
+          left:container.left+"px",
+          top:container.top+"px",
+          width:container.width+"px",
+          height:container.height+"px"
         }
       );
 
 
-    $("#theImgHigh")
-      .load(
-        function ()
-        {
-          $(document).data("highWidth", $("#theImgHigh").width());
-          $(document).data("highHeight", $("#theImgHigh").height());
-
-          p=calcImgHighPositionAndSize(zoomMode);
-
-          $('#theImgHighContainer').css("background-image", "none")
-          displayZoomHigh();
-          $("#theImgHigh").css( {display:"block"} );
-        }
-      )
-      .attr('src', url);
-
-    if(options.highResClickMode=='close')
-    {
-      $("#theImgHigh").bind('click', closeDisplayHigh);
-    }
-    else
-    {
-      // switch zoom
-      $("#theImgHigh").bind('click', switchZoomHigh);
-    }
-  }
-  else
-  {
-    p=calcImgHighPositionAndSize(zoomMode);
-
-    $('#theImgHighContainer')
-      .css(
-        {
-          left:p.left+"px",
-          top:p.top+"px",
-          width:p.width+"px",
-          height:p.height+"px"
-        }
-      );
-  }
+
+      if(image.zoomMode=="full")
+      {
+        $("#theImgHigh")
+          .css(
+            {
+              width:image.highWidth+"px",
+              height:image.highHeight+"px"
+            }
+          );
+        $('#theImgHighContainer').bind("mousemove",
+            function(event)
+            {
+              deadArea = Math.max(options.marginContainer*2, options.imageScrollMinDeadArea);
+              mouseX=Math.max(Math.min(event.clientX-container.left, container.width - deadArea), deadArea);
+              mouseY=Math.max(Math.min(event.clientY-container.top, container.height - deadArea), deadArea);
+              $("#theImgHigh")
+                .css("left",Math.round((image.highWidth-container.width) * -(mouseX-deadArea)/(container.width-2*deadArea))+"px")
+                .css("top",Math.round((image.highHeight-container.height) * -(mouseY-deadArea)/(container.height-2*deadArea))+"px");
+            }
+          );
+      }
+      else
+      {
+        $("#theImgHigh")
+          .css(
+            {
+              width:container.width+"px",
+              height:container.height+"px",
+              left:"0px",
+              top:"0px"
+            }
+          );
+        $('#theImgHighContainer').unbind("mousemove");
+      }
+  },
+
+  closeDisplayHigh = function()
+  {
+    $('#theImageHigh').css('display', 'none');
+  },
+
+  switchZoomHigh = function()
+  {
+    if(image.zoomMode=='full')
+    {
+      image.zoomMode="fit";
+    }
+    else
+    {
+      image.zoomMode="full";
+    }
+
+    $("#theImgHighZoomButton").toggleClass('full').toggleClass('fit');
+
+    displayZoomHigh();
+  };
+
+
+  this.closeDisplayHigh = function () { closeDisplayHigh(); };
+  this.switchZoomHigh = function () { switchZoomHigh(); };
+  this.getImageProp = function () { return image; };
+  this.getInterfaceProp = function () { return interface; };
+  this.getTabsProp = function () { return tabs; };
+
+  init();
+
 }
 
-function calcImgHighPositionAndSize(zoom)
-{
-  p = new Object();
-
-  if(zoom=='full')
-  {
-    p.width = ($("html").get(0).clientWidth-(options.marginContainer+options.paddingContainer)*2);
-    p.height = ($("html").get(0).clientHeight-(options.marginContainer+options.paddingContainer)*2);
-    p.left=options.marginContainer;
-    p.top=options.marginContainer;
-
-    if(p.width>$(document).data("highWidth"))
-    {
-      p.width = $(document).data("highWidth")-options.paddingContainer*2;
-      p.left = ($("html").get(0).clientWidth-p.width)/2;
-    }
-
-    if(p.height>$(document).data("highHeight"))
-    {
-      p.height = $(document).data("highHeight")-options.paddingContainer*2;
-      p.top = ($("html").get(0).clientHeight-p.height)/2;
-    }
-  }
-  else
-  {
-    //zoom = 'fit'
-    ratioImg = $(document).data("highWidth") / $(document).data("highHeight");
-    ratioPage = $("html").get(0).clientWidth / $("html").get(0).clientHeight;
-
-    if((ratioPage > 1 && (ratioPage > ratioImg)) ||
-       (ratioPage < 1 && (ratioPage < ratioImg)))
-    {
-      p.height = ($("html").get(0).clientHeight-(options.marginContainer+options.paddingContainer)*2);
-      p.width = p.height*ratioImg;
-    }
-    else
-    {
-      p.width = ($("html").get(0).clientWidth-(options.marginContainer+options.paddingContainer)*2);
-      p.height = p.width/ratioImg;
-    }
-    p.left = ($("html").get(0).clientWidth-p.width)/2;
-    p.top = ($("html").get(0).clientHeight-p.height)/2;
-  }
-
-  return(p);
-}
-
-function closeDisplayHigh()
-{
-  $('#theImageHigh').css('display', 'none');
-}
-
-function switchZoomHigh()
-{
-  if(zoomMode=='full')
-  {
-    zoomMode="fit";
-  }
-  else
-  {
-    zoomMode="full";
-  }
-
-  $("#theImgHighZoomButton").toggleClass('full').toggleClass('fit');
-
-  displayZoomHigh();
-}
-
-function displayZoomHigh()
-{
-  p=calcImgHighPositionAndSize(zoomMode);
-
-  $('#theImgHighContainer').css(
-      {
-        left:p.left+"px",
-        top:p.top+"px",
-        width:p.width+"px",
-        height:p.height+"px"
-      }
-    );
-
-
-
-    if(zoomMode=="full")
-    {
-      $("#theImgHigh")
-        .css(
-          {
-            width:$(document).data("highWidth")+"px",
-            height:$(document).data("highHeight")+"px"
-          }
-        );
-      $('#theImgHighContainer').bind("mousemove",
-          function(event)
-          {
-            deadArea = options.marginContainer*2;
-            mouseX=Math.max(Math.min(event.clientX-this.offsetLeft, this.clientWidth - deadArea), deadArea);
-            mouseY=Math.max(Math.min(event.clientY-this.offsetTop, this.clientHeight - deadArea), deadArea);
-            $("#theImgHigh")
-              .css("left",Math.round(($("#theImgHigh").attr("scrollWidth")-this.clientWidth) * -(mouseX-deadArea)/(this.clientWidth-2*deadArea))+"px")
-              .css("top",Math.round(($("#theImgHigh").attr("scrollHeight")-this.clientHeight) * -(mouseY-deadArea)/(this.clientHeight-2*deadArea))+"px");
-          }
-        );
-    }
-    else
-    {
-      $("#theImgHigh")
-        .css(
-          {
-            width:p.width+"px",
-            height:p.height+"px",
-            left:"0px",
-            top:"0px"
-          }
-        );
-      $('#theImgHighContainer').unbind("mousemove");
-    }
-}
-
-
-
-
+
+
+
Index: extensions/gally/gally-default/js/gallyjs-tpp.packed.js
===================================================================
--- extensions/gally/gally-default/js/gallyjs-tpp.packed.js	(revision 8528)
+++ extensions/gally/gally-default/js/gallyjs-tpp.packed.js	(revision 8528)
@@ -0,0 +1,2 @@
+/* file: gally-tpp.js - v1.4.0 | packed on 2011/01/08 with http://joliclic.free.fr/php/javascript-packer/ */
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1M 2c=1a;$(2i).2N(5(){2c=1S 2b()});5 2b(){1M d={m:\'n\',Z:-1,L:-1},j={v:l,1w:0,1c:1a},b={1e:l,T:0,R:0,1K:0,H:\'\'},q=1a,1q=5(){29=/[2O]\\./i;4(2a.28.2M&&2a.28.2J.2K(29)){3.2p="1R";3.1D=l}4(3.1D){$("t").8("2d-x","1z")}k{$("t").8("2d-x","2Q")}4(3.2V=="M"){3.1C+=$("#M").r(0).z+$("#M").r(0).s}4(!3.18){3.1F=l}b.H=3.2W;f(\'0\',h);1G("1q");4((3.2e=="2U"||(3.2e=="2I"&&!b.1e))&&3.18){$("#J").e("16",5(){f(\'y\',h)}).e("19",5(){f(\'n\',h)}).e("G",5(){f(\'y\',h)})}4(3.18){$("#M").e("16",5(){f(\'y\',l)}).e("G",5(){f(\'y\',l)});$("#1l").e("16",5(){f(\'y\',h)}).e("19",5(){f(\'n\',h)}).e("G",5(){f(\'y\',h)});$("#S").e("16",5(){f(\'Y\',h)}).e("19",5(){f(\'n\',h)}).e("G",5(){f(\'y\',h)});$("#X").e("16",5(){f(\'Y\',h)}).e("19",5(){f(\'n\',h)}).e("G",5(){f(\'y\',h)})}$("#S").8("g",$("#S").6("z")+$("#1y").6("s")+$("#1t").6("s")+"7");$("#X").8("g",$("#X").6("z")+$("#1y").6("s")+$("#1t").6("s")+"7");$("#E").8("g",$("#E").6("z")+$("#1y").6("s")+$("#1t").6("s")+"7");$("#2R").6("2S",3.2X);4(3.15>0){$("#Q").d({2z:{1J:\'2B\',2A:3.15}})}k{$("#Q").d()}1m(\'n\');4(3.18){$(\'#P\').e("16",5(){f(\'Y\',l)}).e("19",5(){f(\'n\')}).e("G",5(){f(\'y\',l)})}$("#Q").e(\'2H\',5(V,12){d.L=12.2D});$(\'.2E a\').1v(5(){$(D).r(0).2C();4(d.L==d.Z){4(d.Z!=-1)1m(\'n\');d.Z=-1;d.L=-1}k{4(d.Z==-1)1m(\'y\');d.Z=d.L}});$(1b).U(5(){1G("U")});j.1w=1;$(2i).W(\'31\')},2x=5(){4(b.1e&&3.3e==l&&3.2Y){$(\'#1B\').e(\'1v\',5(){2m($(\'#J\').6(\'1N\'))}).1L(\'3d\')}},1G=5(2g){4(2g=="1q"){26=$("#1y").6("s")+$("#1t").6("s");$("#1l").8("g",$("#1l").6("z")+26+$("#M").6("s")+"7");4(3.1X=="1E"){1Y=$("#11").6("N")+1;$("#P").8("1E",1Y+"7")}k 4(3.1X=="g"){1W=$("#1l").6("z")+$("#1l").6("s");$("#P").8("g",1W+"7")}4($("#S").1U>0){$("#S").8("9",$("#11").6("z")-$("#S").6("z")-3.1p+"7")}4($("#X").1U>0){$("#X").8("9",$("#11").6("z")-$("#X").6("z")-3.1p+"7")}}1f=1S 2y;1f.9=$("#J").6("9")+"7";4(3.1D&&($("#J").6("1u")>($("#E").6("w")-2*3.14))){1f.c=($("#E").6("w")-2*(3.14+3.O))+"7";$("#E").e("G",5(V){u=B.1h(3.2j,$("#S").6("w")*1.2);20=B.1h(B.1O(V.22-b.1K,D.w-u),u);$("#J").8("o",B.1P(($("#J").6("1u")-D.w)*-(20-u)/(D.w-2*u))+"7").W(\'33\')});b.1e=h}k{$("#E").1Z("G");$("#J").8("o","1T");1f.c=$("#J").6("1u")+"7";b.1e=l}$("#1B").8(1f);4($("#11").8("30")=="34"){$("#E").8("2t-1E",$("#11").6("s")+"7")}1I(3.39){A"38":C=$("#1B").6(\'s\');I;A"37":C=$("#E").6(\'s\');I;1H:C=-3a;I}C=($("#11").6("z")-($("#M").6("z")+$("#M").6("s"))-C)/2+3.3i;4(C<3.1C){C=3.1C}C=C+"7";$("#E").8("g",C);b.1K=$(\'#E\').32().o;2x()},f=5(m,1A){4((j.1w==1)&&(3.1F)){j.1w=2;4(m=="Y")1g(\'\')}4(!3.1F&&m=="0"){m="1"}4(3.2p=="3b"){1I(m){A\'0\':$(".10").8({1J:0,13:"1z"});j.v=l;I;A\'1\':4(!j.v)$(".10").8({1J:1,13:"v"});j.v=h;4(1A)1o();I;A\'2\':A\'Y\':A\'y\':4(!j.v)$(".10").8("13","v").2n(h,l).2q(3.15,1);j.v=h;4(1A)1o();I;1H:$(".10").2n(h,l).2q(3.15,0,5(){D.3j.13="1z";j.v=l});1s();I}}k{1I(m){A\'y\':A\'Y\':A\'1\':A\'2\':4(!j.v)$(".10").8("13","v");j.v=h;4(1A)1o();I;1H:$(".10").8("13","1z");j.v=l;1s();I}}},1m=5(m){4(m!=\'\'){d.m=m}k{4(d.m!=\'n\'){d.m=\'n\'}k{d.m=\'y\'}}4(3.2L){4(d.m==\'y\'){$("#P").2u({9:3.2o+"7"},3.15).W(\'U\')}k{$(\'#Q 2s.21\').1L("12-d-1V").8("1j","");$(\'#Q 25\').2h("12-d-L");$("#P").2u({9:3.1p+"7"},3.15).W(\'U\')}}k{4(d.m==\'y\'){$("#P").8({9:3.2o+"7"}).W(\'U\')}k{$(\'#Q 2s.21\').1L("12-d-1V").8("1j","");$(\'#Q 25\').2h("12-d-L");$("#P").8({9:3.1p+"7"}).W(\'U\')}}},1s=5(){4(j.1c!=1a){1b.35(j.1c);j.1c=1a}},1o=5(){1s();4(3.2w>0&&3.18)j.1c=1b.3h(f,3.2w,"n",l)},2m=5(2r){$(\'#2k\').8({c:$("t").r(0).1u+"7",9:$("t").r(0).2P+"7",1j:"2l"});4($("#F").6(\'1N\')==""){p=1S 2y();p.o=(($(1b).c()-$("#K").6("w")-3.O*2)/2)+"7";p.g=(($(1b).9()-$("#K").6("N")-3.O*2)/2)+"7";$(\'#K\').8({o:p.o,g:p.g,2t:3.O+"7"});$("#F").3c(5(){b.T=$("#F").c();b.R=$("#F").9();p=1x(b.H);$(\'#K\').8("3g-b","1R");1Q();$("#F").8({1j:"2l"})}).6(\'1N\',2r);4(3.3f==\'2Z\'){$("#F").e(\'1v\',1r)}k{$("#F").e(\'1v\',1n)}}k{p=1x(b.H);$(\'#K\').8({o:p.o+"7",g:p.g+"7",c:p.c+"7",9:p.9+"7"})}},1x=5(2v){1M p={o:3.14,g:3.14,c:0,9:0},1k=(3.14+3.O)*2;4(2v==\'17\'){p.c=$("t").r(0).w-1k;p.9=$("t").r(0).N-1k}k{1i=b.T/b.R;1d=$("t").r(0).w/$("t").r(0).N;4((1d>1&&(1d>1i))||(1d<1&&(1d<1i))){p.9=$("t").r(0).N-1k;p.c=p.9*1i}k{p.c=$("t").r(0).w-1k;p.9=p.c/1i}p.o=($("t").r(0).w-p.c)/2-3.O;p.g=($("t").r(0).N-p.9)/2-3.O}4(p.c>b.T){p.c=b.T;p.o=($("t").r(0).w-p.c)/2}4(p.9>b.R){p.9=b.R;p.g=($("t").r(0).N-p.9)/2}1g(p)},1Q=5(){q=1x(b.H);$(\'#K\').8({o:q.o+"7",g:q.g+"7",c:q.c+"7",9:q.9+"7"});4(b.H=="17"){$("#F").8({c:b.T+"7",9:b.R+"7"});$(\'#K\').e("G",5(V){u=B.1h(3.14*2,3.2j);23=B.1h(B.1O(V.22-q.o,q.c-u),u);24=B.1h(B.1O(V.36-q.g,q.9-u),u);$("#F").8("o",B.1P((b.T-q.c)*-(23-u)/(q.c-2*u))+"7").8("g",B.1P((b.R-q.9)*-(24-u)/(q.9-2*u))+"7")})}k{$("#F").8({c:q.c+"7",9:q.9+"7",o:"1T",g:"1T"});$(\'#K\').1Z("G")}},1r=5(){$(\'#2k\').8(\'1j\',\'1R\')},1n=5(){4(b.H==\'17\'){b.H="2f"}k{b.H="17"}$("#3k").27(\'17\').27(\'2f\');1Q()};D.1r=5(){1r()};D.1n=5(){1n()};D.2T=5(){1g b};D.2F=5(){1g j};D.2G=5(){1g d};1q()}',62,207,'|||options|if|function|attr|px|css|height||image|width|tabs|bind|switchInterface|top|true||interface|else|false|show||left||container|get|offsetHeight|html|deadArea|visible|clientWidth|||offsetTop|case|Math|imgTop|this|theImage|theImgHigh|mousemove|zoomMode|break|theImg|theImgHighContainer|selected|imageHeaderBar|clientHeight|paddingContainer|theTabsContainer|theTabs|highHeight|navThumbPrev|highWidth|resize|event|trigger|navThumbNext||current|uiImg|copyright|ui|visibility|marginContainer|animateDelay|mouseenter|full|interfaceCanSwitch|mouseleave|null|window|timerDelay|ratioPage|isScrollable|cssValues|return|max|ratioImg|display|margins|imageToolBar|switchTabs|switchZoomHigh|resetInterfaceTimer|tabsHidden|init|closeDisplayHigh|clearInterfaceTimer|theHeaderAlt|scrollWidth|click|initialized|calcImgHighPositionAndSize|theHeader|hidden|resetTimer|theImgContainer|imageCenterTopMin|imageAutoScroll|bottom|interfaceHidden|initializeImageMode|default|switch|opacity|leftPos|addClass|var|src|min|round|displayZoomHigh|none|new|0px|length|hide|toolBarArea|tabsPosition|copyrightArea|unbind|mouse|tabPanel|clientX|mouseX|mouseY|li|theHeaderHeight|toggleClass|browser|regexp|jQuery|GallyPP|gallyPP|overflow|interfaceOnImage|fit|mode|removeClass|document|imageScrollMinDeadArea|theImageHigh|block|openDisplayHigh|stop|tabsVisible|interfaceAnimated|fadeTo|url|div|padding|animate|zoom|interfaceTimerDelay|simulateHighRes|Object|fx|duration|toggle|blur|index|tab|getInterfaceProp|getTabsProp|tabsselect|noscroll|version|match|tabsAnimated|msie|ready|1234567|scrollHeight|scroll|contentid|rows|getImageProp|always|imageCenterTopBorder|defaultZoomSize|commentRows|imageSimulateHighRes|close|position|gallyInterfaceReady|offset|scrolled|fixed|clearInterval|clientY|all|img|imageCenterMode|10000|fade|load|pointer|imageHaveHighRes|highResClickMode|background|setInterval|imageCenterOffset|style|theImgHighZoomButton'.split('|'),0,{}))
Index: extensions/gally/gally-default/js/gallyjs-ttm.js
===================================================================
--- extensions/gally/gally-default/js/gallyjs-ttm.js	(revision 8528)
+++ extensions/gally/gally-default/js/gallyjs-ttm.js	(revision 8528)
@@ -0,0 +1,120 @@
+/* -----------------------------------------------------------------------------
+  GALLY
+  Template for Piwigo
+  ------------------------------------------------------------------------------
+  file: gally/gallyjs-ttm.js
+  file release: 1.0.0
+  ------------------------------------------------------------------------------
+  author: grum at piwigo.org
+  << May the Little SpaceFrog be with you >>
+  ------------------------------------------------------------------------------
+  JS to manage bubbles tips
+
+  need jQuery 1.2.6
+
+  see the release_notes.txt file for more informations
+----------------------------------------------------------------------------- */
+
+var gallyTM=null;
+
+$(document).ready(
+  function()
+  {
+    gallyTM=new GallyTM();
+  }
+);
+
+
+function GallyTM ()
+{
+  var sTip=null,
+
+  initTips = function ()
+  {
+    if(options.manageTips)
+    {
+      $('#menubar dl:not(#mbTags) dd [title]').not('.sTipOnTop, .sTipOnBottom, .sTipOnLeft, .sTipOnRight').addClass('sTipOnRight');
+
+      sTip=new simpleTip();
+      $('[title]').each(
+        function ()
+        {
+          tipPos=options.manageTipsPos;
+
+          if($(this).hasClass('sTipOnTop')) { tipPos='tipOnTop'; }
+          else if($(this).hasClass('sTipOnRight')) { tipPos='tipOnRight'; }
+          else if($(this).hasClass('sTipOnLeft')) { tipPos='tipOnLeft'; }
+          else if($(this).hasClass('sTipOnBottom')) { tipPos='tipOnBottom'; }
+
+          switch(tipPos)
+          {
+            case 'tipOnTop':
+              sTip.doAction(
+                'add',
+                this,
+                {
+                  targetPos:'top-middle',
+                  tipPos:'bottom-middle',
+                  offsetY:14,
+                  arrowHeight:13,
+                  arrowWidth:17,
+                  drawArrow:true,
+                  arrowImgDir:options.themePath
+                }
+              );
+              break;
+            case 'tipOnRight':
+              sTip.doAction(
+                'add',
+                this,
+                {
+                  targetPos:'middle-right',
+                  tipPos:'middle-left',
+                  offsetX:12,
+                  arrowHeight:17,
+                  arrowWidth:12,
+                  drawArrow:true,
+                  arrowImgDir:options.themePath
+                }
+              );
+              break;
+            case 'tipOnLeft':
+              sTip.doAction(
+                'add',
+                this,
+                {
+                  targetPos:'middle-left',
+                  tipPos:'middle-right',
+                  offsetX:12,
+                  arrowHeight:17,
+                  arrowWidth:12,
+                  drawArrow:true,
+                  arrowImgDir:options.themePath
+                }
+              );
+              break;
+            case 'tipOnBottom':
+              sTip.doAction(
+                'add',
+                this,
+                {
+                  targetPos:'bottom-middle',
+                  tipPos:'top-middle',
+                  offsetY:12,
+                  arrowHeight:12,
+                  arrowWidth:17,
+                  drawArrow:true,
+                  arrowImgDir:options.themePath
+                }
+              );
+              break;
+          }
+        }
+      );
+    }
+  };
+
+  initTips();
+}
+
+
Index: extensions/gally/gally-default/js/gallyjs-ttm.packed.js
===================================================================
--- extensions/gally/gally-default/js/gallyjs-ttm.packed.js	(revision 8528)
+++ extensions/gally/gally-default/js/gallyjs-ttm.packed.js	(revision 8528)
@@ -0,0 +1,2 @@
+/* file: gally-ttm.js - v1.4.0 | packed on 2011/01/08 with http://joliclic.free.fr/php/javascript-packer/ */
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('t n=s;$(K).M(b(){n=q v()});b v(){t 5=s,G=b(){6(4.J){$(\'#I L:r(#V) T [u]\').r(\'.o, .C, .p, .m\').U(\'m\');5=q S();$(\'[u]\').R(b(){0=4.O;6($(1).7(\'o\')){0=\'F\'}l 6($(1).7(\'m\')){0=\'H\'}l 6($(1).7(\'p\')){0=\'E\'}l 6($(1).7(\'C\')){0=\'x\'}P(0){c\'F\':5.d(\'a\',1,{8:\'A-2\',0:\'z-2\',B:Q,k:N,j:h,i:f,g:4.e});9;c\'H\':5.d(\'a\',1,{8:\'2-w\',0:\'2-D\',y:3,k:h,j:3,i:f,g:4.e});9;c\'E\':5.d(\'a\',1,{8:\'2-D\',0:\'2-w\',y:3,k:h,j:3,i:f,g:4.e});9;c\'x\':5.d(\'a\',1,{8:\'z-2\',0:\'A-2\',B:3,k:3,j:h,i:f,g:4.e});9}})}};G()}',58,58,'tipPos|this|middle|12|options|sTip|if|hasClass|targetPos|break|add|function|case|doAction|themePath|true|arrowImgDir|17|drawArrow|arrowWidth|arrowHeight|else|sTipOnRight|gallyTM|sTipOnTop|sTipOnLeft|new|not|null|var|title|GallyTM|right|tipOnBottom|offsetX|bottom|top|offsetY|sTipOnBottom|left|tipOnLeft|tipOnTop|initTips|tipOnRight|menubar|manageTips|document|dl|ready|13|manageTipsPos|switch|14|each|simpleTip|dd|addClass|mbTags'.split('|'),0,{}))
Index: extensions/gally/gally-default/js/simpleTip.js
===================================================================
--- extensions/gally/gally-default/js/simpleTip.js	(revision 8528)
+++ extensions/gally/gally-default/js/simpleTip.js	(revision 8528)
@@ -0,0 +1,443 @@
+/**
+ * -----------------------------------------------------------------------------
+ * file: simpleTip.js
+ * file version: 1.0.1
+ * date: 2010-12-23
+ *
+ * JS file provided by the piwigo's plugin "GrumPluginClasses"
+ *
+ * -----------------------------------------------------------------------------
+ * Author     : Grum
+ *   email    : grum@piwigo.com
+ *   website  : http://photos.grum.fr
+ *   PWG user : http://forum.phpwebgallery.net/profile.php?id=3706
+ *
+ *   << May the Little SpaceFrog be with you ! >>
+ * -----------------------------------------------------------------------------
+ *
+ * Why simpleTip ?
+ * I have tried the jQuery plugins 'tiptip' and 'qTip'
+ *  - 'tiptip' is a good solution, but bugged
+ *  - 'qTip' is excellent but too many options for my needs (and sometimes,
+ *    I have some 'not initialized value' error)
+ * I need something simple and light...
+ *
+ * constructor : myST = new simpleTip();
+ *
+ *
+ *
+ * :: HISTORY ::
+ *
+ * | release | date       |
+ * | 1.0.0   | 2010-07-10 | start to coding
+ * |         |            |
+ * | 1.0.1   | 2010-12-23 | fix minor bugs
+ * |         |            |
+ * |         |            |
+ * |         |            |
+ * |         |            |
+ *
+ */
+
+/**
+ * tipItem is an object to define tooltip properties
+ *
+ * - content : content for the tooltip
+ * - index   : index of the simpleTip object
+ * - options : object with theses properties
+ *              * targetPos : position of the tooltip relative to the target
+ *              * tipPos    : position of the tooltip relative to the target
+ *                            can take values : top-left,    top-middle,    top-right
+ *                                              middle-left, middle-middle, middle-right
+ *                                              bottom-left, bottom-middle, bottom-right
+ *              * drawArrow : draw an arrow (true) or not (false)
+ *              * offsetX   : apply an offset to the tooltip position X
+ *              * offsetY   : apply an offset to the tooltip position Y
+ *              * classes   : additionnal classes
+ *
+ */
+function tipItem(item, index, options)
+{
+  this.item=item;
+  this.content=item.title;
+  this.index=index;
+  this.options=jQuery.extend(
+    {
+      targetPos:'bottom-middle',
+      tipPos:'top-middle',
+      drawArrow:false,
+      offsetX:0,
+      offsetY:0,
+      classes:'',
+      arrowImgDir: '',
+      arrowWidth: 12,
+      arrowHeight: 12
+    },
+    options
+  );
+}
+
+
+function simpleTip()
+{
+  var items = new Array(),
+      itemIndexInc = 0,
+      options={
+          name:''
+        };
+
+  if(arguments.length>=1)
+  {
+    options.name=arguments[0];
+  }
+
+  /**
+   * action
+   *  - add   ("add", item, [options])
+   *  - remove ("remove", item)
+   *  - clear ("clear")
+   */
+  this.doAction = function(fct)
+  {
+    switch(fct)
+    {
+      case 'add':
+        if(arguments.length==2)
+        {
+          add(arguments[1], { } );
+        }
+        else
+        {
+          add(arguments[1], arguments[2]);
+        }
+        break;
+      case 'remove':
+        if(arguments.length==2)
+        {
+          remove(arguments[1]);
+        }
+        break;
+      case 'clear':
+        clear();
+        break;
+      case 'hide':
+        hide();
+        break;
+      case 'show':
+        show();
+        break;
+      case 'prepare':
+        if(arguments.length==4)
+        {
+          prepare(arguments[1], arguments[2], arguments[3]);
+        }
+        break;
+    }
+  };
+
+  var add = function (item, options)
+  {
+    index=getIndex(item);
+
+    if(index==-1 & item.title!='')
+    {
+      // process only items not already processed
+
+      tip=new tipItem(item, itemIndexInc, options);
+
+      $(item)
+        .attr(
+          {
+           title: '',
+           simpleTip: tip.index
+          }
+        )
+        .bind('mouseover', {index:tip.index}, function (event)
+          {
+            prepare($(this).offset().left, $(this).offset().top, $(this).innerWidth(), $(this).innerHeight(), event.data.index );
+            show();
+          }
+        )
+        .bind('mouseout', function (event)
+          {
+            hide();
+          }
+        );
+
+      items.push(tip);
+      itemIndexInc++;
+    }
+
+  };
+
+
+  var remove = function (item)
+  {
+    index=getIndex(item);
+
+    if(index!=-1)
+    {
+      $(item)
+        .attr(
+          {
+           title: items[index].content,
+           simpleTip: ''
+          }
+        )
+        .unbind('mouseover')
+        .unbind('mouseout');
+
+      items[index].item=null;
+      items.splice(index,1);
+    }
+  };
+
+
+  var clear = function ()
+  {
+    hide();
+
+    while(items.length>0)
+    {
+      if(items[0].item!=null)
+      {
+        $(items[0].item)
+          .attr(
+            {
+             title: items[0].content,
+             simpleTip: ''
+            }
+          )
+          .unbind('mouseover')
+          .unbind('mouseout');
+        items[0].item=null;
+      }
+      items.shift();
+    }
+    itemIndexInc=0;
+  };
+
+
+  var getIndex = function(item)
+  {
+    searched=$(item).attr('simpleTip');
+
+    for(i=0;i<items.length;i++)
+    {
+      if(items[i].index==searched) return(i);
+    }
+    return(-1);
+  };
+
+  /**
+   * prepare the tooltip
+   *
+   * @param Float posX : position X of the target
+   * @param Float posY : position Y of the target
+   * @param Float width  : width of the target
+   * @param Float height : height of the target
+   * @param String index : index of the target item
+   */
+  var prepare = function (posX, posY, width, height, index)
+  {
+    //itemIndex=getIndex(getFromIndex(index));
+    itemIndex=index;
+    arrowX=0;
+    arrowY=0;
+
+    $('#iSimpleTipContent'+options.name).html(items[itemIndex].content);
+
+    $('#iSimpleTip'+options.name)
+      .css(
+        {
+          left: '-1500px',
+          top:  '-1500px',
+          display: 'block'
+        }
+      );
+
+    switch(items[itemIndex].options.targetPos)
+    {
+      case 'top-left':
+        x=posX;
+        y=posY;
+        break;
+
+      case 'top-middle':
+        x=posX+width/2;
+        y=posY;
+        break;
+
+      case 'top-right':
+        x=posX+width;
+        y=posY;
+        break;
+
+      case 'middle-left':
+        x=posX;
+        y=posY+height/2;
+        break;
+
+      case 'middle-middle':
+        x=posX+width/2;
+        y=posY+height/2;
+        break;
+
+      case 'middle-right':
+        x=posX+width;
+        y=posY+height/2;
+        break;
+
+      case 'bottom-left':
+        x=posX;
+        y=posY+height;
+        break;
+
+      case 'bottom-middle':
+        x=posX+width/2;
+        y=posY+height;
+        break;
+
+      case 'bottom-right':
+        x=posX+width;
+        y=posY+height;
+        break;
+    }
+
+
+    stWidth=$('#iSimpleTipContent'+options.name).outerWidth();
+    stHeight=$('#iSimpleTipContent'+options.name).outerHeight();
+    stWidthI=$('#iSimpleTipContent'+options.name).innerWidth();
+    stHeightI=$('#iSimpleTipContent'+options.name).innerHeight();
+    bwX=(stWidth-stWidthI)/2;
+    bwY=(stHeight-stHeightI)/2;
+    arrowModel='';
+
+    switch(items[itemIndex].options.tipPos)
+    {
+      case 'top-left':
+        //nothing to do
+        x+=items[itemIndex].options.offsetX;
+        y+=items[itemIndex].options.offsetY;
+        arrowX=-bwX;
+        arrowY=-items[itemIndex].options.arrowHeight+bwY;
+        arrowModel='up';
+        break;
+
+      case 'top-middle':
+        x-=stWidth/2;
+        y+=items[itemIndex].options.offsetY;
+        arrowX=(stWidthI-items[itemIndex].options.arrowWidth)/2;
+        arrowY=-items[itemIndex].options.arrowHeight+bwY;
+        arrowModel='up';
+        break;
+
+      case 'top-right':
+        x-=stWidth+items[itemIndex].options.offsetX;
+        y+=items[itemIndex].options.offsetY;
+        arrowX=stWidthI-items[itemIndex].options.arrowWidth+bwX;
+        arrowY=-items[itemIndex].options.arrowHeight+bwY;
+        arrowModel='up';
+        break;
+
+      case 'middle-left':
+        x+=items[itemIndex].options.offsetX;
+        y-=stHeight/2;
+        arrowX=-items[itemIndex].options.arrowWidth+bwX;
+        arrowY=(stHeightI-items[itemIndex].options.arrowHeight)/2+bwY;
+        arrowModel='left';
+        break;
+
+      case 'middle-middle':
+        x-=stWidth/2;
+        y-=stHeight/2;
+        break;
+
+      case 'middle-right':
+        x-=stWidth+items[itemIndex].options.offsetX;
+        y-=stHeight/2;
+        arrowX=stWidthI+bwX;
+        arrowY=(stHeightI-items[itemIndex].options.arrowHeight)/2+bwY;
+        arrowModel='right';
+        break;
+
+      case 'bottom-left':
+        x+=items[itemIndex].options.offsetX;
+        y-=stHeight+items[itemIndex].options.offsetY;
+        arrowX=-bwX;
+        arrowY=stHeightI+bwY;
+        arrowModel='down';
+        break;
+
+      case 'bottom-middle':
+        x-=stWidth/2;
+        y-=stHeight+items[itemIndex].options.offsetY;
+        arrowX=(stWidthI-items[itemIndex].options.arrowWidth)/2+bwX;
+        arrowY=stHeightI+bwY;
+        arrowModel='down';
+        break;
+
+      case 'bottom-right':
+        x-=stWidth+items[itemIndex].options.offsetX;
+        y-=stHeight+items[itemIndex].options.offsetY;
+        arrowX=stWidthI-items[itemIndex].options.arrowWidth+bwX;
+        arrowY=stHeightI+bwY;
+        arrowModel='down';
+        break;
+    }
+
+    if(items[itemIndex].options.drawArrow & arrowModel!='')
+    {
+      $('#iSimpleTipArrow'+options.name).css(
+        {
+          display: 'block',
+          background: 'url("'+items[itemIndex].options.arrowImgDir+'/arrow_'+arrowModel+'.png") no-repeat scroll 0 0 transparent',
+          marginLeft: arrowX+'px',
+          marginTop: arrowY+'px',
+          width: items[itemIndex].options.arrowWidth+'px',
+          height: items[itemIndex].options.arrowHeight+'px'
+        }
+      );
+    }
+    else
+    {
+      $('#iSimpleTipArrow'+options.name).css('display', 'none');
+    }
+
+
+    $('#iSimpleTip'+options.name)
+      .css(
+        {
+          left: x+'px',
+          top:  y+'px',
+          display: 'none'
+        }
+      )
+      .removeClass()
+      .addClass(items[itemIndex].options.classes);
+
+  };
+
+  var show = function ()
+  {
+    $('#iSimpleTip'+options.name).css('display', 'block');
+  };
+
+  var hide = function ()
+  {
+    $('#iSimpleTip'+options.name).css('display', 'none');
+  };
+
+
+  var init = function ()
+  {
+    if($('#iSimpleTip'+options.name).length==0)
+    {
+      text="<div id='iSimpleTip"+options.name+"' style='z-index:15000;display:none;position:absolute;left:0px;top:0px;'><div id='iSimpleTipShadow"+options.name+"' style='position:absolute;width:100%;height:100%;background:#000000;opacity:0.4;filter:alpha(opacity:40);display:block;z-index:-1;margin-left:2px;margin-top:2px;'></div><div id='iSimpleTipArrow"+options.name+"' style='position:absolute;'></div><div id='iSimpleTipContent"+options.name+"'></div></div>";
+      $('body').append(text);
+    }
+  };
+
+
+  init();
+}
Index: extensions/gally/gally-default/js/simpleTip.packed.js
===================================================================
--- extensions/gally/gally-default/js/simpleTip.packed.js	(revision 8528)
+++ extensions/gally/gally-default/js/simpleTip.packed.js	(revision 8528)
@@ -0,0 +1,2 @@
+/* file: simpleTip.js - v1.0.1 | packed on 2010/12/23 with http://joliclic.free.fr/php/javascript-packer/ */
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('e 1E(c,a,5){s.c=c;s.13=c.R;s.a=a;s.5=1I.1G({1n:\'I-d\',1l:\'g-d\',1y:1N,J:0,F:0,1v:\'\',1z:\'\',H:12,D:12},5)}e P(){q 6=1w 1L(),Z=0,5={b:\'\'};k(f.G>=1){5.b=f[0]}s.1K=e(1q){19(1q){9\'11\':k(f.G==2){11(f[1],{})}1x{11(f[1],f[2])}8;9\'1c\':k(f.G==2){1c(f[1])}8;9\'1h\':1h();8;9\'Q\':Q();8;9\'T\':T();8;9\'10\':k(f.G==4){10(f[1],f[2],f[3])}8}};q 11=e(c,5){a=15(c);k(a==-1&c.R!=\'\'){V=1w 1E(c,Z,5);$(c).X({R:\'\',P:V.a}).1u(\'14\',{a:V.a},e(1b){10($(s).1B().h,$(s).1B().g,$(s).1m(),$(s).1k(),1b.1M.a);T()}).1u(\'17\',e(1b){Q()});6.1O(V);Z++}};q 1c=e(c){a=15(c);k(a!=-1){$(c).X({R:6[a].13,P:\'\'}).Y(\'14\').Y(\'17\');6[a].c=18;6.1J(a,1)}};q 1h=e(){Q();1H(6.G>0){k(6[0].c!=18){$(6[0].c).X({R:6[0].13,P:\'\'}).Y(\'14\').Y(\'17\');6[0].c=18}6.1P()}Z=0};q 15=e(c){1o=$(c).X(\'P\');1S(i=0;i<6.G;i++){k(6[i].a==1o)1s(i)}1s(-1)};q 10=e(l,o,p,t,a){7=a;n=0;m=0;$(\'#L\'+5.b).25(6[7].13);$(\'#M\'+5.b).O({h:\'-1r\',g:\'-1r\',B:\'W\'});19(6[7].5.1n){9\'g-h\':x=l;y=o;8;9\'g-d\':x=l+p/2;y=o;8;9\'g-C\':x=l+p;y=o;8;9\'d-h\':x=l;y=o+t/2;8;9\'d-d\':x=l+p/2;y=o+t/2;8;9\'d-C\':x=l+p;y=o+t/2;8;9\'I-h\':x=l;y=o+t;8;9\'I-d\':x=l+p/2;y=o+t;8;9\'I-C\':x=l+p;y=o+t;8}w=$(\'#L\'+5.b).24();A=$(\'#L\'+5.b).23();K=$(\'#L\'+5.b).1m();E=$(\'#L\'+5.b).1k();v=(w-K)/2;r=(A-E)/2;j=\'\';19(6[7].5.1l){9\'g-h\':x+=6[7].5.J;y+=6[7].5.F;n=-v;m=-6[7].5.D+r;j=\'1a\';8;9\'g-d\':x-=w/2;y+=6[7].5.F;n=(K-6[7].5.H)/2;m=-6[7].5.D+r;j=\'1a\';8;9\'g-C\':x-=w+6[7].5.J;y+=6[7].5.F;n=K-6[7].5.H+v;m=-6[7].5.D+r;j=\'1a\';8;9\'d-h\':x+=6[7].5.J;y-=A/2;n=-6[7].5.H+v;m=(E-6[7].5.D)/2+r;j=\'h\';8;9\'d-d\':x-=w/2;y-=A/2;8;9\'d-C\':x-=w+6[7].5.J;y-=A/2;n=K+v;m=(E-6[7].5.D)/2+r;j=\'C\';8;9\'I-h\':x+=6[7].5.J;y-=A+6[7].5.F;n=-v;m=E+r;j=\'16\';8;9\'I-d\':x-=w/2;y-=A+6[7].5.F;n=(K-6[7].5.H)/2+v;m=E+r;j=\'16\';8;9\'I-C\':x-=w+6[7].5.J;y-=A+6[7].5.F;n=K-6[7].5.H+v;m=E+r;j=\'16\';8}k(6[7].5.1y&j!=\'\'){$(\'#1e\'+5.b).O({B:\'W\',1D:\'1Q("\'+6[7].5.1z+\'/2a\'+j+\'.2c") 2b-29 27 0 0 21\',22:n+\'N\',1T:m+\'N\',p:6[7].5.H+\'N\',t:6[7].5.D+\'N\'})}1x{$(\'#1e\'+5.b).O(\'B\',\'U\')}$(\'#M\'+5.b).O({h:x+\'N\',g:y+\'N\',B:\'U\'}).1R().1V(6[7].5.1v)};q T=e(){$(\'#M\'+5.b).O(\'B\',\'W\')};q Q=e(){$(\'#M\'+5.b).O(\'B\',\'U\')};q 1A=e(){k($(\'#M\'+5.b).G==0){1p="<u S=\'M"+5.b+"\' 1g=\'z-a:1W;B:U;1d:1f;h:1C;g:1C;\'><u S=\'20"+5.b+"\' 1g=\'1d:1f;p:1F%;t:1F%;1D:#1Z;1t:0.4;1X:1U(1t:1Y);B:W;z-a:-1;1j-h:1i;1j-g:1i;\'></u><u S=\'1e"+5.b+"\' 1g=\'1d:1f;\'></u><u S=\'L"+5.b+"\'></u></u>";$(\'28\').26(1p)}};1A()}',62,137,'|||||options|items|itemIndex|break|case|index|name|item|middle|function|arguments|top|left||arrowModel|if|posX|arrowY|arrowX|posY|width|var|bwY|this|height|div|bwX|stWidth||||stHeight|display|right|arrowHeight|stHeightI|offsetY|length|arrowWidth|bottom|offsetX|stWidthI|iSimpleTipContent|iSimpleTip|px|css|simpleTip|hide|title|id|show|none|tip|block|attr|unbind|itemIndexInc|prepare|add||content|mouseover|getIndex|down|mouseout|null|switch|up|event|remove|position|iSimpleTipArrow|absolute|style|clear|2px|margin|innerHeight|tipPos|innerWidth|targetPos|searched|text|fct|1500px|return|opacity|bind|classes|new|else|drawArrow|arrowImgDir|init|offset|0px|background|tipItem|100|extend|while|jQuery|splice|doAction|Array|data|false|push|shift|url|removeClass|for|marginTop|alpha|addClass|15000|filter|40|000000|iSimpleTipShadow|transparent|marginLeft|outerHeight|outerWidth|html|append|scroll|body|repeat|arrow_|no|png'.split('|'),0,{}))
Index: extensions/gally/gally-default/pem_metadata.txt
===================================================================
--- extensions/gally/gally-default/pem_metadata.txt	(revision 8528)
+++ extensions/gally/gally-default/pem_metadata.txt	(revision 8528)
@@ -0,0 +1,4 @@
+File automatically created from SVN repository.
+
+URL: http://piwigo.org/svn/extensions/gally/gally-default/ 
+Revision: 6752
Index: extensions/gally/gally-default/release_notes.txt
===================================================================
--- extensions/gally/gally-default/release_notes.txt	(revision 8191)
+++ extensions/gally/gally-default/release_notes.txt	(revision 8528)
@@ -113,7 +113,19 @@
   |         |            |   . Privacy level don't work
   |         |            |
+  | 1.4.0   | 2010-12-23 | * add simpleTip.js script
   |         |            |
+  |         |            | * rewrite gally-tpp.js script (make an object)
   |         |            |
+  |         |            | * rewrite gally-tcp.js script (make an object)
   |         |            |
+  |         |            | * add gally-ttm.js script (for tip management)
+  |         |            |
+  |         |            | * pack js files
+  |         |            |
+  |         |            | * mantis bug:1983
+  |         |            |   . Incorrect display for the icon of recent photo in
+  |         |            |     IE 7
+  |         |            |
+  |         |            | * add the option 'imageScrollMinDeadArea'
   |         |            |
   |         |            |
@@ -135,4 +147,5 @@
   | gallyjs-tcp.js  | Javascript for the categories pages management
   | gallyjs-tpp.js  | Javascript for the pictures pages management
+  | gallyjs-ttm.js  | Javascript for the tooltips management
   | default.conf    | The default config file
   | local.conf      | The local config file
Index: extensions/gally/gally-default/template/config.js.tpl
===================================================================
--- extensions/gally/gally-default/template/config.js.tpl	(revision 8191)
+++ extensions/gally/gally-default/template/config.js.tpl	(revision 8528)
@@ -12,4 +12,5 @@
   imageCenterTopMin:{#imageCenterTopMin#},
   imageCenterTopBorder:"{#imageCenterTopBorder#}",
+  imageScrollMinDeadArea:{#imageScrollMinDeadArea#},
   interfaceAnimated:"{#interfaceAnimated#}",
   interfaceCanSwitch:{if #interfaceCanSwitch#=='yes'}true{else}false{/if},
@@ -34,5 +35,8 @@
   menuMSIEMaxWidth:"{#menuMSIEMaxWidth#}",
 {/if}
-  animateDelay:{#animateDelay#}
+  manageTips:{if #manageTips#=='yes'}true{else}false{/if},
+  manageTipsPos:"{#manageTipsPos#}",
+  animateDelay:{#animateDelay#},
+  themePath:"{$themeconf.icon_dir}"
 {literal}
 }
Index: extensions/gally/gally-default/template/header.tpl
===================================================================
--- extensions/gally/gally-default/template/header.tpl	(revision 8191)
+++ extensions/gally/gally-default/template/header.tpl	(revision 8528)
@@ -50,40 +50,41 @@
   {known_script id="jquery.ui.dialog" src=$ROOT_URL|cat:"themes/default/js/ui/packed/ui.dialog.packed.js"}
 
-  {if $BODY_ID=='theCategoryPage' || $BODY_ID=='thePicturePage'}
 
-    {php}
-      $themes=$this->get_template_vars('themes');
-      foreach($themes as $theme)
+  {php}
+    $themes=$this->get_template_vars('themes');
+    foreach($themes as $theme)
+    {
+      $dir=dirname($_SERVER['SCRIPT_FILENAME'])."/themes/".$theme['id']."/conf/";
+      $dirlocal=dirname($_SERVER['SCRIPT_FILENAME'])."/local/themes/".$theme['id']."/conf/";
+      $this->assign("default_conf", $dir."default.conf");
+      if(file_exists($dirlocal."local.conf"))
       {
-        $dir=dirname($_SERVER['SCRIPT_FILENAME'])."/themes/".$theme['id']."/conf/";
-        $dirlocal=dirname($_SERVER['SCRIPT_FILENAME'])."/local/themes/".$theme['id']."/conf/";
-        $this->assign("default_conf", $dir."default.conf");
-        if(file_exists($dirlocal."local.conf"))
-        {
-          $this->assign("local_conf", $dirlocal."local.conf");
-        }
-        else
-        {
-          $this->assign("local_conf", "");
-        }
+        $this->assign("local_conf", $dirlocal."local.conf");
       }
-    {/php}
+      else
+      {
+        $this->assign("local_conf", "");
+      }
+    }
+  {/php}
 
-    {config_load file=$default_conf}
-    {if $local_conf!=""}
-      {config_load file=$local_conf}
-    {/if}
-
-    {php}
-        $this->assign("alternateBannerContent", html_entity_decode($this->get_config_vars('alternateBannerContent')));
-    {/php}
-
-    {include file='config.js.tpl'}
+  {config_load file=$default_conf}
+  {if $local_conf!=""}
+    {config_load file=$local_conf}
   {/if}
 
+  {php}
+      $this->assign("alternateBannerContent", html_entity_decode($this->get_config_vars('alternateBannerContent')));
+  {/php}
 
+  {include file='config.js.tpl'}
+
+  {if #manageTips#=='yes'}
+    {known_script id="gpc.simpleTip" src=$ROOT_URL|@cat:"themes/gally-default/js/simpleTip.packed.js" }
+    {known_script id="gallyjs-ttm" src=$ROOT_URL|cat:"themes/gally-default/js/gallyjs-ttm.packed.js"}
+  {/if}
 
   {if $BODY_ID=='theCategoryPage'}
-  {known_script id="gallyjs-tcp" src=$ROOT_URL|cat:"themes/gally-default/js/gallyjs-tcp.js"}
+  {known_script id="gallyjs-tcp" src=$ROOT_URL|cat:"themes/gally-default/js/gallyjs-tcp.packed.js"}
   <link rel="stylesheet" type="text/css" href="{$ROOT_URL}themes/gally-default/css/thumbnails.css">
   <link rel="stylesheet" type="text/css" href="{$ROOT_URL}themes/gally-default/css/menubar.css">
@@ -91,5 +92,5 @@
 
   {if $BODY_ID=='thePicturePage'}
-  {known_script id="gallyjs-tpp" src=$ROOT_URL|cat:"themes/gally-default/js/gallyjs-tpp.js"}
+  {known_script id="gallyjs-tpp" src=$ROOT_URL|cat:"themes/gally-default/js/gallyjs-tpp.packed.js"}
   <link rel="stylesheet" type="text/css" href="{$ROOT_URL}themes/gally-default/css/picture.css">
   {/if}
Index: extensions/gally/gally-default/template/index.tpl
===================================================================
--- extensions/gally/gally-default/template/index.tpl	(revision 8191)
+++ extensions/gally/gally-default/template/index.tpl	(revision 8528)
@@ -10,5 +10,5 @@
     {else}
     <div id="menuswitcher">
-      <a id="icon_menu" class="button" onclick="switchmenu('', '{$ROOT_URL}{$themeconf.icon_dir}/');">&nbsp;
+      <a id="icon_menu" class="button" onclick="gallyCP.switchmenu('', '{$ROOT_URL}{$themeconf.icon_dir}/');">&nbsp;
         <!-- <img  src="{$ROOT_URL}{$themeconf.icon_dir}/menu-show.png"  alt="{'display all elements in all sub-categories'|@translate}"> -->
       </a>
Index: extensions/gally/gally-default/template/mainpage_categories.tpl
===================================================================
--- extensions/gally/gally-default/template/mainpage_categories.tpl	(revision 8191)
+++ extensions/gally/gally-default/template/mainpage_categories.tpl	(revision 8528)
@@ -4,13 +4,13 @@
   {foreach from=$category_thumbnails item=cat name=catloop}
   <li class="odd{if ($smarty.foreach.catloop.iteration-1) % 2 == 0}0{else}1{/if}">
-    <div class="thumbnailCategory">
+    <div class="thumbnailCategory"  onclick="window.location='{$cat.URL}';">
       <div class="illustration">
-        <a href="{$cat.URL}">
+
           <img {if isset($cat.EXTRA_CLASS)}class="{$cat.EXTRA_CLASS}"{/if} src="{$cat.TN_SRC}" alt="{$cat.TN_ALT}" title="{$cat.NAME|@replace:'"':' '} - {'shows images at the root of this category'|@translate}">
-        </a>
+
       </div>
       <div class="description">
         <h3>
-          <a href="{$cat.URL}">{$cat.NAME}</a>
+          {$cat.NAME}
             {if !empty($cat.icon_ts)}
             <img title="{$cat.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent{if $cat.icon_ts.IS_CHILD_DATE}_by_child{/if}.png" class="icon" alt="(!)">
Index: extensions/gally/gally-default/template/menubar_identification.tpl
===================================================================
--- extensions/gally/gally-default/template/menubar_identification.tpl	(revision 8191)
+++ extensions/gally/gally-default/template/menubar_identification.tpl	(revision 8528)
@@ -1,64 +1,64 @@
 <dt>{'Identification'|@translate}</dt>
 <dd>
-	{if isset($USERNAME)}
-	<p>{'Hello'|@translate}&nbsp;{$USERNAME}&nbsp;!</p>
-	{/if}
+  {if isset($USERNAME)}
+  <p>{'Hello'|@translate}&nbsp;{$USERNAME}&nbsp;!</p>
+  {/if}
 
-	<ul>
-	{if isset($U_REGISTER)}
-	<li><a href="{$U_REGISTER}" title="{'Create a new account'|@translate}" rel="nofollow">{'Register'|@translate}</a></li>
-	{/if}
+  <ul>
+  {if isset($U_REGISTER)}
+  <li><a href="{$U_REGISTER}" title="{'Create a new account'|@translate}" rel="nofollow">{'Register'|@translate}</a></li>
+  {/if}
 
-	{if isset($U_LOGIN)}
-	<li><a href="{$U_LOGIN}" rel="nofollow">{'Login'|@translate}</a></li>
-	{/if}
+  {if isset($U_LOGIN)}
+  <li><a href="{$U_LOGIN}" rel="nofollow">{'Login'|@translate}</a></li>
+  {/if}
 
-	{if isset($U_LOGOUT)}
-	<li><a href="{$U_LOGOUT}">{'Logout'|@translate}</a></li>
-	{/if}
+  {if isset($U_LOGOUT)}
+  <li><a href="{$U_LOGOUT}">{'Logout'|@translate}</a></li>
+  {/if}
 
-	{if isset($U_PROFILE)}
-	<li><a href="{$U_PROFILE}" title="{'customize the appareance of the gallery'|@translate}">{'Customize'|@translate}</a></li>
-	{/if}
+  {if isset($U_PROFILE)}
+  <li><a href="{$U_PROFILE}" title="{'customize the appareance of the gallery'|@translate}">{'Customize'|@translate}</a></li>
+  {/if}
 
-	{if isset($U_ADMIN)}
-	<li><a href="{$U_ADMIN}" title="{'available for administrators only'|@translate}">{'Administration'|@translate}</a></li>
-	{/if}
-	</ul>
+  {if isset($U_ADMIN)}
+  <li><a href="{$U_ADMIN}" title="{'available for administrators only'|@translate}">{'Administration'|@translate}</a></li>
+  {/if}
+  </ul>
 
-	{if isset($U_LOGIN)}
-	<form method="post" action="{$U_LOGIN}" id="quickconnect">
-	<fieldset>
-	<legend>{'Quick connect'|@translate}</legend>
-	<div>
-	<label for="username">{'Username'|@translate}</label><br/>
-	<input type="text" name="username" id="username" value="" style="width:90%">
-	</div>
+  {if isset($U_LOGIN)}
+  <form method="post" action="{$U_LOGIN}" id="quickconnect">
+  <fieldset>
+  <legend>{'Quick connect'|@translate}</legend>
+  <div>
+  <label for="username">{'Username'|@translate}</label><br/>
+  <input type="text" name="username" id="username" value="" style="width:90%">
+  </div>
 
-	<div><label for="password">{'Password'|@translate}</label>
-	<br/>
-	<input type="password" name="password" id="password" style="width:90%">
-	</div>
+  <div><label for="password">{'Password'|@translate}</label>
+  <br/>
+  <input type="password" name="password" id="password" style="width:90%">
+  </div>
 
-	{if $AUTHORIZE_REMEMBERING}
-	<div><label for="remember_me">
-	{'Auto login'|@translate}
-	<input type="checkbox" name="remember_me" id="remember_me" value="1">
-	</label></div>
-	{/if}
+  {if $AUTHORIZE_REMEMBERING}
+  <div><label for="remember_me">
+  {'Auto login'|@translate}
+  <input type="checkbox" name="remember_me" id="remember_me" value="1">
+  </label></div>
+  {/if}
 
-	<div>
-	<input class="submit" type="submit" name="login" value="{'Submit'|@translate}">
-	<ul class="actions">
-		<li><a id="icon_lost_password3" class="button" href="{$U_LOST_PASSWORD}" title="{'Forgot your password?'|@translate}" rel="nofollow"><!--<img src="{$ROOT_URL}{$themeconf.icon_dir}/lost_password.png" class="button" alt="{'Forgot your password?'|@translate}">--></a></li>
-		{if isset($U_REGISTER)}
-		<li><a id="icon_register3" class="button" href="{$U_REGISTER}" title="{'Create a new account'|@translate}" rel="nofollow"><!-- <img src="{$ROOT_URL}{$themeconf.icon_dir}/register.png" class="button" alt="{'Register'|@translate}"/>--></a></li>
-		{/if}
-	</ul>
-	</div>
+  <div id='iValid'>
+  <input class="submit" type="submit" name="login" value="{'Submit'|@translate}">
+  <ul class="actions">
+    <li><a id="icon_lost_password3" class="button sTipOnBottom" href="{$U_LOST_PASSWORD}" title="{'Forgot your password?'|@translate}" rel="nofollow"><!--<img src="{$ROOT_URL}{$themeconf.icon_dir}/lost_password.png" class="button" alt="{'Forgot your password?'|@translate}">--></a></li>
+    {if isset($U_REGISTER)}
+    <li><a id="icon_register3" class="button sTipOnBottom" href="{$U_REGISTER}" title="{'Create a new account'|@translate}" rel="nofollow"><!-- <img src="{$ROOT_URL}{$themeconf.icon_dir}/register.png" class="button" alt="{'Register'|@translate}"/>--></a></li>
+    {/if}
+  </ul>
+  </div>
 
-	</fieldset>
-	</form>
-	{/if}
+  </fieldset>
+  </form>
+  {/if}
 </dd>
 
Index: extensions/gally/gally-default/template/menubar_tags.tpl
===================================================================
--- extensions/gally/gally-default/template/menubar_tags.tpl	(revision 8191)
+++ extensions/gally/gally-default/template/menubar_tags.tpl	(revision 8528)
@@ -1,10 +1,10 @@
 <dt>{'Related tags'|@translate}</dt>
 <dd>
-	<div id="menuTagCloud">
-		{foreach from=$block->data item=tag}
-		<span>
-			<a href="{$tag.URL}" class="tagLevel{$tag.level}" title="{'See images linked to this tag only'|@translate}">{$tag.name}</a>
+  <div id="menuTagCloud">
+    {foreach from=$block->data item=tag}
+    <span>
+      <a href="{$tag.URL}" class="tagLevel{$tag.level} sTipOnTop" title="{'See images linked to this tag only'|@translate}">{$tag.name}</a>
       {if !empty($tag.U_ADD) }
-      <a class="tagaddbutton" href="{$tag.U_ADD}"
+      <a class="tagaddbutton sTipOnTop" href="{$tag.U_ADD}"
         title="{$pwg->l10n_dec('%d element are also linked to current tags', '%d elements are also linked to current tags', $tag.counter)}"
         rel="nofollow">
@@ -12,7 +12,7 @@
       </a>
       {/if}
-		</span>
-		{/foreach}
-	</div>
+    </span>
+    {/foreach}
+  </div>
 </dd>
 
Index: extensions/gally/gally-default/template/notification.tpl
===================================================================
--- extensions/gally/gally-default/template/notification.tpl	(revision 8191)
+++ extensions/gally/gally-default/template/notification.tpl	(revision 8528)
@@ -17,6 +17,6 @@
     <p>{'The RSS notification feed provides notification on news from this website : new pictures, updated categories, new comments. Use a RSS feed reader.'|@translate}</p>
 
-    <p><a href="{$U_FEED_IMAGE_ONLY}">{'Image only RSS feed'|@translate}</a></p>
-    <p><a href="{$U_FEED}">{'Complete RSS feed (images, comments)'|@translate}</a></p>
+    <p><span class="rssFeed"></span><a href="{$U_FEED_IMAGE_ONLY}">{'Image only RSS feed'|@translate}</a></p>
+    <p><span class="rssFeed"></span><a href="{$U_FEED}">{'Complete RSS feed (images, comments)'|@translate}</a></p>
   </div>
 </div>
Index: extensions/gally/gally-default/template/picture.tpl
===================================================================
--- extensions/gally/gally-default/template/picture.tpl	(revision 8191)
+++ extensions/gally/gally-default/template/picture.tpl	(revision 8528)
@@ -8,6 +8,6 @@
     <div id="theImgHighBg"></div>
     <div id="theImgHighContainer">
-      <div id="theImgHighCloseButton" onclick="closeDisplayHigh();"></div>
-      <div id="theImgHighZoomButton" class="fit" onclick="switchZoomHigh();"></div>
+      <div id="theImgHighCloseButton" onclick="gallyPP.closeDisplayHigh();"></div>
+      <div id="theImgHighZoomButton" class="fit" onclick="gallyPP.switchZoomHigh();"></div>
       <div id="theImgHighContainer2">
         <img id="theImgHigh" src="" style="display:none;" alt="{$ALT_IMG}"
Index: extensions/gally/gally-default/themeconf.inc.php
===================================================================
--- extensions/gally/gally-default/themeconf.inc.php	(revision 8191)
+++ extensions/gally/gally-default/themeconf.inc.php	(revision 8528)
@@ -2,5 +2,5 @@
 /*
 Theme Name: Gally
-Version: 1.3.5
+Version: 1.4.0
 Description: Parent theme for all the Gally themes
 Theme URI: http://piwigo.org/ext/extension_view.php?eid=382
