Index: extensions/Front2Back/Front2Back.php
===================================================================
--- extensions/Front2Back/Front2Back.php	(revision 11216)
+++ extensions/Front2Back/Front2Back.php	(revision 11217)
@@ -4,48 +4,90 @@
 function Front2Back_content($content, $image)
 {
-	global $template, $conf;
-	$conf['Front2Back'] = explode(',', $conf['Front2Back']);
-	load_language('plugin.lang', F2B_PATH);
+  global $template, $conf, $user;
+  $conf['Front2Back'] = explode(',', $conf['Front2Back']);
+  load_language('plugin.lang', F2B_PATH);
 
-	/* dirs and files */
-	if (empty($conf['Front2Back'][0])) {
-		$verso_dir = str_replace($image['file'], null, $image['path']) . $conf['Front2Back'][1];
-		$hd_dir = str_replace($image['file'], null, $image['path']) . $conf['Front2Back'][2];
-	} else {
-		$verso_dir = PHPWG_ROOT_PATH . $conf['Front2Back'][0] . $conf['Front2Back'][1];
-		$hd_dir = PHPWG_ROOT_PATH . $conf['Front2Back'][0] . $conf['Front2Back'][2];
-	}
-	$verso_file = get_filename_wo_extension($image['file']) . $conf['Front2Back'][3] . '.' . get_extension($image['file']);
-	$rotat_file = get_filename_wo_extension($image['file']) . '-r.' . get_extension($image['file']);
+  /* dirs and files */
+  if (empty($conf['Front2Back'][0])) {
+    $verso_dir = str_replace($image['file'], null, $image['path']) . $conf['Front2Back'][1];
+    $hd_dir = str_replace($image['file'], null, $image['path']) . $conf['Front2Back'][2];
+  } else {
+    $verso_dir = PHPWG_ROOT_PATH . $conf['Front2Back'][0] . $conf['Front2Back'][1];
+    $hd_dir = PHPWG_ROOT_PATH . $conf['Front2Back'][0] . $conf['Front2Back'][2];
+  }
+  $verso_file = get_filename_wo_extension($image['file']) . $conf['Front2Back'][3] . '.' . get_extension($image['file']);
+  $rotat_file = get_filename_wo_extension($image['file']) . '-r.' . get_extension($image['file']);
 
-	$template->set_filenames(array('Front2Back' => dirname(__FILE__) . '/template/Front2Back.tpl') );
-	$template->assign('F2B_PATH', F2B_PATH);
+  /* Is there a verso file ? */
+  if (is_file($verso_dir.$verso_file)) 
+  {
+    $template->assign('VERSO_URL', $verso_dir.$verso_file);
 
-	/* Is there a verso file ? */
-	if (is_file($verso_dir.$verso_file)) 
-	{
-		$template->assign('VERSO_URL', $verso_dir.$verso_file);
+    if (is_file($hd_dir.$verso_file)) {
+      $template->assign('VERSO_HD', $hd_dir.$verso_file);
+    }
+  }
+  /* useless section, just for retrocompatibility */
+  else if (is_file($verso_dir.$rotat_file)) 
+  {           
+    $template->assign('VERSO_URL', $verso_dir.$rotat_file); 
+    
+    if (is_file($hd_dir.$rotat_file)) {
+      $template->assign('VERSO_HD', $hd_dir.$rotat_file);
+    }
+  }
+  /* otherwise */
+  else 
+  {
+    return $content;
+  }
+  
+  /* link name */
+  $conf['Front2Back'][7] = unserialize($conf['Front2Back'][7]);
+  if (!empty($conf['Front2Back'][7][$user['language']]))
+  {
+    $conf['Front2Back'][7] = explode('|', $conf['Front2Back'][7][$user['language']]);
+  }
+  else if (!empty($conf['Front2Back'][7]['default']))
+  {
+    $conf['Front2Back'][7] = explode('|', $conf['Front2Back'][7]['default']);
+  }
+  else
+  {
+    $conf['Front2Back'][7] = array(l10n('See back'), l10n('See front'));
+  }
+  
+  $template->set_filenames(array('Front2Back' => dirname(__FILE__) . '/template/Front2Back.tpl') );
+  $template->assign(array(
+    'F2B_PATH' => F2B_PATH,
+    'F2B_position' => $conf['Front2Back'][4],
+    'F2B_switch_mode' => $conf['Front2Back'][5],
+    'F2B_transition' => $conf['Front2Back'][6],
+    'F2B_see_back' => $conf['Front2Back'][7][0],
+    'F2B_see_front' => $conf['Front2Back'][7][1],
+  ));
+  
+  switch ($conf['Front2Back'][4])
+  {
+    case 'toolbar':
+      $template->set_prefilter('picture', 'Front2Back_toolbar_prefilter');
+      return $content;  
+      break;
+    case 'top':
+      return $template->parse('Front2Back', true)."\n".$content;
+      break;
+    case 'bottom':
+      return $content."\n".$template->parse('Front2Back', true);
+      break;
+  }
 
-		if (is_file($hd_dir.$verso_file)) {
-			$template->assign('VERSO_HD', $hd_dir.$verso_file);
-		}
-	}
-	/* useless section, just for retrocompatibility */
-	else if (is_file($verso_dir.$rotat_file)) 
-	{           
-		$template->assign('VERSO_URL', $verso_dir.$rotat_file); 
-		
-		if (is_file($hd_dir.$rotat_file)) {
-			$template->assign('VERSO_HD', $hd_dir.$rotat_file);
-		}
-	}
-	/* otherwise */
-	else 
-	{
-		return $content;
-	}
-	
-	return $content . $template->parse('Front2Back', true);    
 }  
 
+function Front2Back_toolbar_prefilter($content, &$smarty)
+{
+  $search = '{/if}{/strip}{*caddie management END*}';
+  $replacement = $search."\n".file_get_contents(F2B_PATH.'template/Front2Back.tpl');
+  return str_replace($search, $replacement, $content);
+}
+
 ?>
Index: extensions/Front2Back/admin.php
===================================================================
--- extensions/Front2Back/admin.php	(revision 11216)
+++ extensions/Front2Back/admin.php	(revision 11217)
@@ -9,26 +9,48 @@
 if (isset($_POST['submit']))
 {
-	$conf['Front2Back'] = array(
-		!empty($_POST['path']) ? rtrim($_POST['path'],'/').'/' : '',
-		!empty($_POST['parent']) ? rtrim($_POST['parent'],'/').'/' : '',
-		!empty($_POST['hd_parent']) ? rtrim($_POST['hd_parent'],'/').'/' : '',
-		!empty($_POST['suffix']) ? $_POST['suffix'] : '',
-	);
-			
-    $query = 'UPDATE ' . CONFIG_TABLE . '
-		SET value="' . implode (',', $conf['Front2Back']) . '"
-		WHERE param="Front2Back"';
-    pwg_query($query);
-	
-	array_push($page['infos'], l10n('Information data registered in database'));
+  $conf['Front2Back'] = array(
+    !empty($_POST['path']) ? rtrim($_POST['path'],'/').'/' : '',
+    !empty($_POST['parent']) ? rtrim($_POST['parent'],'/').'/' : '',
+    !empty($_POST['hd_parent']) ? rtrim($_POST['hd_parent'],'/').'/' : '',
+    !empty($_POST['suffix']) ? $_POST['suffix'] : '',
+    $_POST['position'],
+    $_POST['switch_mode'],
+    $_POST['transition'],
+    serialize(str_replace(array('"',','), ' ', $_POST['link_name'])),
+  );
+      
+  conf_update_param('Front2Back', implode (',', $conf['Front2Back'])); 
+  array_push($page['infos'], l10n('Information data registered in database'));
+}
+
+// Gestion des langues pour le bloc menu
+$conf['Front2Back'][7] = unserialize($conf['Front2Back'][7]);
+$template->append('link_name', array(
+  'LANGUAGE_NAME' => l10n('Default'),
+  'LANGUAGE_CODE' => 'default',
+  'VALUE' => @$conf['Front2Back'][7]['default'],
+  )
+);
+foreach (get_languages() as $language_code => $language_name)
+{
+	$template->append('link_name', array(
+    'LANGUAGE_NAME' => $language_name,
+    'LANGUAGE_CODE' => $language_code,
+    'VALUE' => isset($conf['Front2Back'][7][$language_code]) ? $conf['Front2Back'][7][$language_code] : '',
+    )
+  );
 }
 
 $template->assign(array(
-	'PATH' => $conf['Front2Back'][0],
-	'PARENT' => $conf['Front2Back'][1],
-	'HD_PARENT' => $conf['Front2Back'][2],
-	'SUFFIX' => $conf['Front2Back'][3],
+  'F2B_PATH' => F2B_PATH,
+  'PATH' => $conf['Front2Back'][0],
+  'PARENT' => $conf['Front2Back'][1],
+  'HD_PARENT' => $conf['Front2Back'][2],
+  'SUFFIX' => $conf['Front2Back'][3],
+  'POSITION' => $conf['Front2Back'][4],
+  'SWITCH_MODE' => $conf['Front2Back'][5],
+  'TRANSITION' => $conf['Front2Back'][6],
 ));
-	
+  
 $template->set_filename('Front2Back_conf', dirname(__FILE__).'/template/admin.tpl');
 $template->assign_var_from_handle('ADMIN_CONTENT', 'Front2Back_conf');
Index: extensions/Front2Back/language/en_UK/plugin.lang.php
===================================================================
--- extensions/Front2Back/language/en_UK/plugin.lang.php	(revision 11216)
+++ extensions/Front2Back/language/en_UK/plugin.lang.php	(revision 11217)
@@ -1,36 +1,50 @@
 <?php
 
-$lang['Front2Back_back'] = 'See back';
-$lang['Front2Back_front'] = 'See front';
+$lang['See back'] = 'See back';
+$lang['See front'] = 'See front';
 
-$lang['f2b_path'] = "Back sides' folder";
-$lang['f2b_parent'] = "Web sized pics' sub-folder";
-$lang['f2b_hd_parent'] = "HD pics' sub-folder";
-$lang['f2b_suffix'] = "Suffix";
+$lang['Back sides folder'] = 'Back sides folder';
+$lang['Web sized pics sub-folder'] = 'Web sized pics sub-folder';
+$lang['HD pics sub-folder'] = 'HD pics sub-folder';
+$lang['Suffix'] = 'Suffix';
+
+$lang['Switch mode'] = 'Switch mode';
+$lang['Click'] = 'Click';
+$lang['Mouseover'] = 'Mouseover';
+$lang['Transition'] = 'Transition';
+$lang['Fade'] = 'Fade';
+$lang['Link position'] = 'Link position';
+$lang['Top'] = 'Top';
+$lang['Bottom'] = 'Bottom';
+$lang['Toolbar'] = 'Toolbar';
+$lang['Link name'] = 'Link name';
+
+$lang['Seperate the two labels with the | symbol. Leave blank to use default translation.'] = 'Seperate the two labels with the | symbol. Leave blank to use default translation.';
 
 $lang['f2b_help'] = "
 <fieldset>
-	<legend>Usage examples</legend>
-	<fieldset>
-		If you put the web sized back side in <i>thumbnail/back/</i> subfolder of your normal image directory and the high-definition back side in the subfolder <i>pwg_high/back/</i>, use the basic configuration:<ul>
-			<li><b>Back sides' folder:</b> <i>empty</i>
-			<li><b>Web sized pics' sub-folder:</b> thumbnail/verso/</li>
-			<li><b>HD pics' sub-folder:</b> pwg_high/verso/</li>
-		</ul>
-	</fieldset>
-	
-	<fieldset>
-		If you prefer to put your backs into a different folder, change the value of the first parameter (relative to the root of the site). Keep in mind that in this case the tree of your gallery is not reproduced, and two images with the same name in two different albums will load the same back side.
-		<br>For example you can use this setup to search the web sided backs in <i>[ROOT]/verso/</i> and HD backs in <i>[ROOT]/verso/hd/</i>
-		<ul>
-			<li><b>Back sides' folder:</b> verso/
-			<li><b>Web sized pics' sub-folder:</b> <i>empty</i></li>
-			<li><b>HD pics' sub-folder:</b> hd/</li>
-		</ul>
-	</fieldset>
-	
-	<fieldset>
-		Anyway the back side pic may have the same name as the normal pic, in this case let <b>Suffix</b> empty, or a name with suffix.
-	</fieldset>
+  <legend>Usage examples</legend>
+  <fieldset>
+    If you put the web sized back side in <i>thumbnail/back/</i> subfolder of your normal image directory and the high-definition back side in the subfolder <i>pwg_high/back/</i>, use the basic configuration:
+    <ul>
+      <li><b>Back sides' folder:</b> <i>empty</i>
+      <li><b>Web sized pics' sub-folder:</b> thumbnail/verso/</li>
+      <li><b>HD pics' sub-folder:</b> pwg_high/verso/</li>
+    </ul>
+  </fieldset>
+  
+  <fieldset>
+    If you prefer to put your backs into a different folder, change the value of the first parameter (relative to the root of the site). Keep in mind that in this case the tree of your gallery is not reproduced, and two images with the same name in two different albums will load the same back side.
+    <br>For example you can use this setup to search the web sided backs in <i>[ROOT]/verso/</i> and HD backs in <i>[ROOT]/verso/hd/</i>
+    <ul>
+      <li><b>Back sides' folder:</b> verso/
+      <li><b>Web sized pics' sub-folder:</b> <i>empty</i></li>
+      <li><b>HD pics' sub-folder:</b> hd/</li>
+    </ul>
+  </fieldset>
+  
+  <fieldset>
+    Anyway the back side pic may have the same name as the normal pic, in this case let <b>Suffix</b> empty, or a name with suffix.
+  </fieldset>
 </fieldset>
 ";
Index: extensions/Front2Back/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/Front2Back/language/fr_FR/plugin.lang.php	(revision 11216)
+++ extensions/Front2Back/language/fr_FR/plugin.lang.php	(revision 11217)
@@ -1,37 +1,50 @@
 <?php
 
-$lang['Front2Back_back'] = 'Voir le dos';
-$lang['Front2Back_front'] = 'Voir le devant';
+$lang['See back'] = 'Voir le dos';
+$lang['See front'] = 'Voir le devant';
 
-$lang['f2b_path'] = "Dossier des versos";
-$lang['f2b_parent'] = "Sous-dossier des images web";
-$lang['f2b_hd_parent'] = "Sous-dossier des images HD";
-$lang['f2b_suffix'] = "Suffixe de détection";
+$lang['Back sides folder'] = 'Dossier des versos';
+$lang['Web sized pics sub-folder'] = 'Sous-dossier des images web';
+$lang['HD pics sub-folder'] = 'Sous-dossier des images HD';
+$lang['Suffix'] = 'Suffixe de détection';
+
+$lang['Switch mode'] = 'Interchanger les images au';
+$lang['Click'] = 'Clic';
+$lang['Mouseover'] = 'Survol';
+$lang['Transition'] = 'Transition';
+$lang['Fade'] = 'Fondu';
+$lang['Link position'] = 'Position du lien';
+$lang['Top'] = 'Haut';
+$lang['Bottom'] = 'Bas';
+$lang['Toolbar'] = 'Barre d\'outils';
+$lang['Link name'] = 'Nom du lien';
+
+$lang['Seperate the two labels with the | symbol. Leave blank to use default translation.'] = 'Séparez les deux textes par le symbole |. Laissez vide pour utiliser la traduction par défaut.';
 
 $lang['f2b_help'] = "
 <fieldset>
-	<legend>Exemples d'utilisation</legend>
-	<fieldset>
-		Si vous placez le verso taille web dans le sous-dossier <i>thumbnail/verso/</i> du dossier de votre image normale et le verso haute-définition dans le sous-dossier <i>pwg_high/verso/</i>, utilisez la configuration de base :
-		<ul>
-			<li><b>Dossier des versos :</b> <i>vide</i>
-			<li><b>Sous-dossier des images web :</b> thumbnail/verso/</li>
-			<li><b>Sous-dossier des images HD :</b> pwg_high/verso/</li>
-		</ul>
-	</fieldset>
-	
-	<fieldset>
-		Si vous préferez placer vos versos dans un tout autre dossier changez la valeur du premier paramètre (relatif à la racine du site). Gardez à l'esprit que dans ce cas l'arborescence de votre galerie n'est pas reproduite, et deux images qui ont le même nom dans deux albums différents chargeront le même verso.
-		<br>Par exemple vous pouvez utiliser cette configuration pour chercher les versos web dans <i>[RACINE]/verso/</i> et les versos HD dans <i>[RACINE]/verso/hd/</i>
-		<ul>
-			<li><b>Dossier des versos :</b> verso/
-			<li><b>Sous-dossier des images web :</b> <i>vide</i></li>
-			<li><b>Sous-dossier des images HD :</b> hd/</li>
-		</ul>
-	</fieldset>
-	
-	<fieldset>
-		Dans tous les cas les versos peuvent avoir le même nom que les images normale, dans ce cas laisser <b>Suffixe de détection</b> vide, ou un nom avec suffixe.
-	</fieldset>
+  <legend>Exemples d'utilisation</legend>
+  <fieldset>
+    Si vous placez le verso taille web dans le sous-dossier <i>thumbnail/verso/</i> du dossier de votre image normale et le verso haute-définition dans le sous-dossier <i>pwg_high/verso/</i>, utilisez la configuration de base :
+    <ul>
+      <li><b>Dossier des versos :</b> <i>vide</i>
+      <li><b>Sous-dossier des images web :</b> thumbnail/verso/</li>
+      <li><b>Sous-dossier des images HD :</b> pwg_high/verso/</li>
+    </ul>
+  </fieldset>
+  
+  <fieldset>
+    Si vous préferez placer vos versos dans un tout autre dossier changez la valeur du premier paramètre (relatif à la racine du site). Gardez à l'esprit que dans ce cas l'arborescence de votre galerie n'est pas reproduite, et deux images qui ont le même nom dans deux albums différents chargeront le même verso.
+    <br>Par exemple vous pouvez utiliser cette configuration pour chercher les versos web dans <i>[RACINE]/verso/</i> et les versos HD dans <i>[RACINE]/verso/hd/</i>
+    <ul>
+      <li><b>Dossier des versos :</b> verso/
+      <li><b>Sous-dossier des images web :</b> <i>vide</i></li>
+      <li><b>Sous-dossier des images HD :</b> hd/</li>
+    </ul>
+  </fieldset>
+  
+  <fieldset>
+    Dans tous les cas les versos peuvent avoir le même nom que les images normale, dans ce cas laisser <b>Suffixe de détection</b> vide, ou un nom avec suffixe.
+  </fieldset>
 </fieldset>
 ";
Index: extensions/Front2Back/language/it_IT/plugin.lang.php
===================================================================
--- extensions/Front2Back/language/it_IT/plugin.lang.php	(revision 11216)
+++ extensions/Front2Back/language/it_IT/plugin.lang.php	(revision 11217)
@@ -1,37 +1,37 @@
 <?php
 
-$lang['Front2Back_back'] = 'Vedere il retro';
-$lang['Front2Back_front'] = 'Vedere il fronte';
+$lang['See back'] = 'Vedere il retro';
+$lang['See front'] = 'Vedere il fronte';
 
-$lang['f2b_path'] = 'Album per le foto "retro"';
-$lang['f2b_parent'] = 'Sub-album per le foto taglia Web';
-$lang['f2b_hd_parent'] = 'Sub-album per le foto HD';
-$lang['f2b_suffix'] = 'Prefisso per individuare';
+$lang['Back sides folder'] = 'Album per le foto "retro"';
+$lang['Web sized pics sub-folder'] = 'Sub-album per le foto taglia Web';
+$lang['HD pics sub-folder'] = 'Sub-album per le foto HD';
+$lang['Suffix'] = 'Prefisso per individuare';
 
 $lang['f2b_help'] = '
 <fieldset>
-	<legend>Esempi d\'uso</legend>
-	<fieldset>
-		Se piazzate le foto "retro" con dimenzioni per il web nel sub-album <i>thumbnail/retro/</i> del album della vostra foto normale ("fronte") e la "retro" HD nel sub-album <i>pwg_high/retro/</i>, usare la configurazione di base :
-		<ul>
-			<li><b>Album delle foto "retro" :</b> <i>vuoto</i>
-			<li><b>Sub-album delle foto web :</b> thumbnail/retro/</li>
-			<li><b>Sub-album delle foto HD :</b> pwg_high/retro/</li>
-		</ul>
-	</fieldset>
-	
-	<fieldset>
-		Se preferite piazzare le foto "retro" in un\'altra directory, cambiate il valore del promo paramero (relativo alla radice del sito). Mantenete in mente che in questo caso l\'arborescenza della vostra galleria non viene riprodotta, e che due foto che hanno lo stesso nome in due diversi album caricheranno la stessa foto "retro".
-		<br>Per esempio potete usare questa configurazione per cercare le foto "retro" web in <i>[RADICE]/retro/</i> e le foto "retro" HD in <i>[RADICE]/retro/hd/</i>
-		<ul>
-			<li><b>Album delle foto "retro" :</b> retro/
-			<li><b>Sub-album delle foto web :</b> <i>vuoto</i></li>
-			<li><b>Sub-album delle foto HD :</b> hd/</li>
-		</ul>
-	</fieldset>
-	
-	<fieldset>
-		In tutti i casi le foto "retro" possono avere lo stesso nome che le foto "fronte". In questo caso lasciare <b>Prefisso per individuare</b> vuoto, o un nome con prefisso.
-	</fieldset>
+  <legend>Esempi d\'uso</legend>
+  <fieldset>
+    Se piazzate le foto "retro" con dimenzioni per il web nel sub-album <i>thumbnail/retro/</i> del album della vostra foto normale ("fronte") e la "retro" HD nel sub-album <i>pwg_high/retro/</i>, usare la configurazione di base :
+    <ul>
+      <li><b>Album delle foto "retro" :</b> <i>vuoto</i>
+      <li><b>Sub-album delle foto web :</b> thumbnail/retro/</li>
+      <li><b>Sub-album delle foto HD :</b> pwg_high/retro/</li>
+    </ul>
+  </fieldset>
+  
+  <fieldset>
+    Se preferite piazzare le foto "retro" in un\'altra directory, cambiate il valore del promo paramero (relativo alla radice del sito). Mantenete in mente che in questo caso l\'arborescenza della vostra galleria non viene riprodotta, e che due foto che hanno lo stesso nome in due diversi album caricheranno la stessa foto "retro".
+    <br>Per esempio potete usare questa configurazione per cercare le foto "retro" web in <i>[RADICE]/retro/</i> e le foto "retro" HD in <i>[RADICE]/retro/hd/</i>
+    <ul>
+      <li><b>Album delle foto "retro" :</b> retro/
+      <li><b>Sub-album delle foto web :</b> <i>vuoto</i></li>
+      <li><b>Sub-album delle foto HD :</b> hd/</li>
+    </ul>
+  </fieldset>
+  
+  <fieldset>
+    In tutti i casi le foto "retro" possono avere lo stesso nome che le foto "fronte". In questo caso lasciare <b>Prefisso per individuare</b> vuoto, o un nome con prefisso.
+  </fieldset>
 </fieldset>
 ';
Index: extensions/Front2Back/language/lv_LV/plugin.lang.php
===================================================================
--- extensions/Front2Back/language/lv_LV/plugin.lang.php	(revision 11216)
+++ extensions/Front2Back/language/lv_LV/plugin.lang.php	(revision 11217)
@@ -1,39 +1,37 @@
 <?php
 
-$lang['Front2Back_back'] = 'Skatīt aizmugures daļu';
-$lang['Front2Back_front'] = 'Skatīt priekšpusi';
+$lang['See back'] = 'Skatīt aizmugures daļu';
+$lang['See front'] = 'Skatīt priekšpusi';
 
-$lang['f2b_path'] = "Aizmugures (fona) daļas mape";
-$lang['f2b_parent'] = "Web izmēra attēlu apakšmape";
-$lang['f2b_hd_parent'] = "HD attēlu apakšmape";
-$lang['f2b_suffix'] = "Sufikss";
+$lang['Back sides folder'] = "Aizmugures (fona) daļas mape";
+$lang['Web sized pics sub-folder'] = "Web izmēra attēlu apakšmape";
+$lang['HD pics sub-folder'] = "HD attēlu apakšmape";
+$lang['Suffix'] = "Sufikss";
 
 $lang['f2b_help'] = "
 <fieldset>
-<legend>Izmantošanas piemēri</legend>
-<fieldset>
-Ja ievietojat web izmēra aizmugures daļu <i>thumbnail/back/</i>
-jūsu normāla izmēra attēlu direktorija apakšmapē un HD izmēra attēla aizmugurējo daļu apakšmapē <i>pwg_high/back/</i>, lietojiet pamata konfigurāciju:<ul>
-<li><b>Aizmugures daļas mape:</b> <i>tukša</i>
-<li><b>Web izmēra attēlu apakšmape:</b> thumbnail/verso/</li>
-<li><b>HD attēlu apakšmape:</b> pwg_high/verso/</li>
-</ul>
-</fieldset>
+  <legend>Izmantošanas piemēri</legend>
+  <fieldset>
+    Ja ievietojat web izmēra aizmugures daļu <i>thumbnail/back/</i> jūsu normāla izmēra attēlu direktorija apakšmapē un HD izmēra attēla aizmugurējo daļu apakšmapē <i>pwg_high/back/</i>, lietojiet pamata konfigurāciju:
+    <ul>
+      <li><b>Aizmugures daļas mape:</b> <i>tukša</i>
+      <li><b>Web izmēra attēlu apakšmape:</b> thumbnail/verso/</li>
+      <li><b>HD attēlu apakšmape:</b> pwg_high/verso/</li>
+    </ul>
+  </fieldset>
 
-<fieldset>
-Ja vēlaties izvietot savas mugurpuses citā mapē, izmainiet pirmā parametra vērtību (attiecībā pret vietnes saknes mapi).
-Ņemiet vērā, ka šajā gadījumā jūsu galerijas koka struktūra nepašatjaunojas, un divi attēli ar vienādiem nosaukumiem divos dažādos albūmos izmantos vienu un to pašu fonu (aizmugures daļu).
- <br>Šos istatījumus varat izmantot, lai meklētu web izmēra fonus
-<i>[ROOT]/verso/</i> un HD fonus <i>[ROOT]/verso/hd/</i>
-<ul>
-<li><b> Aizmugures (fona) daļas mape:</b> verso/
-<li><b>Web izmēra attēlu apakšmape:</b> <i>tukša</i></li>
-<li><b>HD attēlu apakšmape:</b> hd/</li>
-</ul>
-</fieldset>
+  <fieldset>
+    Ja vēlaties izvietot savas mugurpuses citā mapē, izmainiet pirmā parametra vērtību (attiecībā pret vietnes saknes mapi). Ņemiet vērā, ka šajā gadījumā jūsu galerijas koka struktūra nepašatjaunojas, un divi attēli ar vienādiem nosaukumiem divos dažādos albūmos izmantos vienu un to pašu fonu (aizmugures daļu).
+    <br>Šos istatījumus varat izmantot, lai meklētu web izmēra fonus <i>[ROOT]/verso/</i> un HD fonus <i>[ROOT]/verso/hd/</i>
+    <ul>
+      <li><b> Aizmugures (fona) daļas mape:</b> verso/
+      <li><b>Web izmēra attēlu apakšmape:</b> <i>tukša</i></li>
+      <li><b>HD attēlu apakšmape:</b> hd/</li>
+    </ul>
+  </fieldset>
 
-<fieldset>
-Jebkurā gadījumā fona attēlam var būt tāds pats nosaukums kā normālam attēlam, šajā gadījumā atstājiet <b>Sufiksu</b> tukšu, vai nosauciet ar sufiksu.
-</fieldset>
+  <fieldset>
+    Jebkurā gadījumā fona attēlam var būt tāds pats nosaukums kā normālam attēlam, šajā gadījumā atstājiet <b>Sufiksu</b> tukšu, vai nosauciet ar sufiksu.
+  </fieldset>
 </fieldset>
 ";
Index: extensions/Front2Back/main.inc.php
===================================================================
--- extensions/Front2Back/main.inc.php	(revision 11216)
+++ extensions/Front2Back/main.inc.php	(revision 11217)
@@ -15,15 +15,15 @@
 include_once(F2B_PATH . 'Front2Back.php');
 add_event_handler('render_element_content', 'Front2Back_content', 99, 2);
-	
+  
 if (script_basename() == 'admin')
 {
-	add_event_handler('get_admin_plugin_menu_links', 'Front2Back_admin_menu');
-	function Front2Back_admin_menu($menu) 
-	{
-		array_push($menu, array(
-			'NAME' => 'Front2Back',
-			'URL' => get_root_url().'admin.php?page=plugin-' . F2B_DIR));
-		return $menu;
-	}
+  add_event_handler('get_admin_plugin_menu_links', 'Front2Back_admin_menu');
+  function Front2Back_admin_menu($menu) 
+  {
+    array_push($menu, array(
+      'NAME' => 'Front2Back',
+      'URL' => get_root_url().'admin.php?page=plugin-' . F2B_DIR));
+    return $menu;
+  }
 }
 
Index: extensions/Front2Back/maintain.inc.php
===================================================================
--- extensions/Front2Back/maintain.inc.php	(revision 11216)
+++ extensions/Front2Back/maintain.inc.php	(revision 11217)
@@ -4,31 +4,40 @@
 function plugin_install()
 {
-	global $conf;
+  global $conf;
 
-	if (!isset($conf['Front2Back'])) {
-		$q = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
-			VALUES ("Front2Back", ",thumbnail/verso/,pwg_high/verso/,", "Parametres Front2Back");';
-		pwg_query($q);
-	}
+  if (!isset($conf['Front2Back'])) {
+    $q = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
+      VALUES ("Front2Back", ",thumbnail/verso/,pwg_high/verso/,", "Parametres Front2Back");';
+    pwg_query($q);
+  }
 }
 
 function plugin_activate()
 {
-	global $conf;
+  global $conf;
 
-	if (!isset($conf['Front2Back'])) {
-		$q = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
-			VALUES ("Front2Back", ",thumbnail/verso/,pwg_high/verso/,", "Parametres Front2Back");';
-		pwg_query($q);
-	}
+  if (!isset($conf['Front2Back'])) {
+    $q = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
+      VALUES ("Front2Back", ",thumbnail/verso/,pwg_high/verso/,", "Parametres Front2Back");';
+    pwg_query($q);
+  } else {
+    $conf['Front2Back'] = explode(',', $conf['Front2Back']);
+    if (!isset($conf['Front2Back'][4])) {
+      $conf['Front2Back'][4] = 'top';
+      $conf['Front2Back'][5] = 'click';
+      $conf['Front2Back'][6] = 'none';
+      $conf['Front2Back'][7] = serialize(array('default'=>null));
+      conf_update_param('Front2Back', implode (',', $conf['Front2Back'])); 
+    }
+  }
 }
 
 function plugin_uninstall()
 {
-	global $conf;
+  global $conf;
 
-	if (isset($conf['Front2Back'])) {
-		pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param="Front2Back";');
-	}
+  if (isset($conf['Front2Back'])) {
+    pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param="Front2Back";');
+  }
 }
 
Index: extensions/Front2Back/template/Front2Back.css
===================================================================
--- extensions/Front2Back/template/Front2Back.css	(revision 11216)
+++ 	(revision )
@@ -1,11 +1,0 @@
-a.reverse {
-	display:inline-block;
-	border:1px solid #666 !important;
-	padding:3px 5px;
-	margin-bottom:10px;
-	font-size:15px;
-	font-style:italic;	
-}
-a.reverse img {
-	vertical-align:top;
-}
Index: extensions/Front2Back/template/Front2Back.tpl
===================================================================
--- extensions/Front2Back/template/Front2Back.tpl	(revision 11216)
+++ extensions/Front2Back/template/Front2Back.tpl	(revision 11217)
@@ -1,44 +1,101 @@
-{combine_css path=$F2B_PATH|@cat:"template/Front2Back.css"}
+{combine_css path=$F2B_PATH|@cat:"template/style.css"}
+{combine_script id="jquery" load="header" path = "themes/default/js/jquery.min.js"}
 
 {footer_script require="jquery"}
-	jQuery('.reverse').click(function() {ldelim}
-		if (jQuery(this).attr('name') == 'front') {ldelim}
-			/* picture attributes */
-			jQuery('#theImage img:first-child').attr({ldelim}
-				src: '{$VERSO_URL}',
-				style: 'width:;height:;',
-			});
-			
-			/* hd link atributes */
-			{if isset($VERSO_HD)}
-			jQuery('#theImage a:first-child').attr({ldelim}
-				href: "javascript:phpWGOpenWindow('{$VERSO_HD}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"
-			});
-			{/if}
-			
-			/* f2b link content */
-			jQuery(this).html('<img src="{$F2B_PATH}template/rotate_2.png"/> {'Front2Back_front'|@translate}');
-			jQuery(this).attr('name', 'back');
-			
-		} else if (jQuery(this).attr('name') == 'back') {ldelim}
-			jQuery('#theImage img:first-child').attr({ldelim}
-				src: '{$SRC_IMG}',
-				style: 'width:{$WIDTH_IMG}px;height:{$HEIGHT_IMG}px;',
-			});
-			
-			{if isset($VERSO_HD)}
-			jQuery('#theImage a:first-child').attr({ldelim}
-				href: "javascript:phpWGOpenWindow('{$high.U_HIGH}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')')"
-			});
-			{/if}
-			
-			jQuery(this).html('<img src="{$F2B_PATH}template/rotate_1.png"/> {'Front2Back_back'|@translate}');
-			jQuery(this).attr('name', 'front');
-		}
-	});
+jQuery(document).ready(function () {ldelim}
+
+{if $F2B_switch_mode == 'click'}
+  jQuery('.reverse').click(function() {ldelim}
+    if (jQuery(this).attr('rel') == 'front') {ldelim}
+{else}
+  jQuery('.reverse').hover(function() {ldelim}
+{/if}
+
+      /* picture switch */
+    {if $F2B_transition == 'fade'}
+      jQuery('img[alt="{$ALT_IMG}"]').animate({ldelim}
+        opacity:0
+      }, 400, function() {ldelim}
+        jQuery(this).attr({ldelim}
+          src: '{$VERSO_URL}',
+          style: 'max-width:{$WIDTH_IMG}px;max-height:{$HEIGHT_IMG}px;',
+        });
+        jQuery(this).animate({ldelim}
+          opacity:1
+        }, 400);
+      });
+    {else}
+      jQuery('img[alt="{$ALT_IMG}"]').attr({ldelim}
+        src: '{$VERSO_URL}',
+        style: 'max-width:{$WIDTH_IMG}px;max-height:{$HEIGHT_IMG}px;',
+      });
+    {/if}
+
+    {if $F2B_switch_mode == 'click'}
+      /* hd link */
+      {if isset($VERSO_HD)}
+      jQuery('img[alt="{$ALT_IMG}"]').parent().attr({ldelim}
+        href: "javascript:phpWGOpenWindow('{$VERSO_HD}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"
+      });
+      {/if}
+      
+      /* f2b link content */
+      jQuery(this).html('<img src="{$F2B_PATH}template/rotate_2.png"/> {$F2B_see_front}');
+      jQuery(this).attr('rel', 'back');
+    {/if}
+      
+{if $F2B_switch_mode == 'click'}
+    } else if (jQuery(this).attr('rel') == 'back') {ldelim}
+{else}
+  }, function() {ldelim}
+{/if} 
+      /* picture switch */
+    {if $F2B_transition == 'fade'}
+      jQuery('img[alt="{$ALT_IMG}"]').animate({ldelim}
+        opacity:0
+      }, 400, function() {ldelim}
+        jQuery(this).attr({ldelim}
+          src: '{$SRC_IMG}',
+          style: 'width:{$WIDTH_IMG}px;height:{$HEIGHT_IMG}px;',
+        });
+        jQuery(this).animate({ldelim}
+          opacity:1
+        }, 400);
+      });
+    {else}
+      jQuery('img[alt="{$ALT_IMG}"]').attr({ldelim}
+        src: '{$SRC_IMG}',
+        style: 'width:{$WIDTH_IMG}px;height:{$HEIGHT_IMG}px;',
+      });
+    {/if}
+    
+    {if $F2B_switch_mode == 'click'}
+       /* hd link */
+      {if isset($high.U_HIGH)}
+      jQuery('img[alt="{$ALT_IMG}"]').parent().attr({ldelim}
+        href: "javascript:phpWGOpenWindow('{$high.U_HIGH}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"
+      });
+      {/if}
+      
+      /* f2b link content */
+      jQuery(this).html('<img src="{$F2B_PATH}template/rotate_1.png"/> {$F2B_see_back}');
+      jQuery(this).attr('rel', 'front');
+    {/if}
+    
+{if $F2B_switch_mode == 'click'}
+    }
+  });
+{else}
+  });
+{/if} 
+  
+});
 {/footer_script}
 
-<a class="reverse" name="front">
-	<img src="{$F2B_PATH}template/rotate_1.png"/>
-	{'Front2Back_back'|@translate}
+<img src="{$VERSO_URL}" style="display:none;"/> {* <!-- force preload the verso --> *}
+
+{if $F2B_position != 'toolbar'}<div>{/if}
+<a class="reverse" rel="front" {if $F2B_position == 'toolbar'}style="border:none !important;"{/if} {if $F2B_switch_mode == 'hover'}href="javascript:phpWGOpenWindow('{$VERSO_HD}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"{/if}>
+  <img src="{$F2B_PATH}template/rotate_1.png"/> {$F2B_see_back}
 </a>
+{if $F2B_position != 'toolbar'}</div>{/if}
Index: extensions/Front2Back/template/admin.tpl
===================================================================
--- extensions/Front2Back/template/admin.tpl	(revision 11216)
+++ extensions/Front2Back/template/admin.tpl	(revision 11217)
@@ -1,30 +1,83 @@
+{combine_css path=$F2B_PATH|@cat:"template/style.css"}
+
+{footer_script require='jquery'}{literal}
+jQuery().ready( function () {
+  jQuery('select[name="lang_desc_select"]').change(function () {
+    jQuery('[id^="link_name"]').hide();
+    jQuery("#link_name_"+this.options[this.selectedIndex].value).show();
+  });
+  jQuery('[id^="link_name_"]').keyup(function () {
+    arr = jQuery(this).attr("id").split("link_name_");
+    id = arr[1];
+    opt = jQuery('select[name="lang_desc_select"] option[id="opt_'+id+'"]');
+    if (this.value != '')
+      opt.html(opt.html().replace("\u2718", "\u2714"));
+    else
+      opt.html(opt.html().replace("\u2714", "\u2718"));
+  });
+});
+
+jQuery('.lang_help').tipTip();
+{/literal}{/footer_script}
+
 <div class="titrePage">
-	<h2>Front2Back</h2>
+  <h2>Front2Back</h2>
 </div>
 
 <form method="post" action="" class="properties" ENCTYPE="multipart/form-data"> 
-	<fieldset>
-		<legend>{'Configuration'|@translate}</legend>	  
-		<ul>			
+  <fieldset>
+    <legend>{'Configuration'|@translate}</legend>    
+    <ul>      
+      <li>
+        <span class="property">{'Back sides folder'|@translate}</span>
+        <input type="text" name="path" value="{$PATH}"/>
+      </li>
+      <li>
+        <span class="property">{'Web sized pics sub-folder'|@translate}</span>
+        <input type="text" name="parent" value="{$PARENT}"/>
+      </li>    
+      <li>
+        <span class="property">{'HD pics sub-folder'|@translate}</span>
+        <input type="text" name="hd_parent" value="{$HD_PARENT}"/>
+      </li>
+      <li>
+        <span class="property">{'Suffix'|@translate}</span>
+        <input type="text" name="suffix" value="{$SUFFIX}"/>
+      </li>
+      
+      <li>
+        <span class="property">{'Link position'|@translate}</span>
+        <label><input type="radio" name="position" value="top" {if $POSITION == 'top'}checked="checked"{/if}/> {'Top'|@translate}</label>
+        <label><input type="radio" name="position" value="bottom" {if $POSITION == 'bottom'}checked="checked"{/if}/> {'Bottom'|@translate}</label>
+        <label><input type="radio" name="position" value="toolbar" {if $POSITION == 'toolbar'}checked="checked"{/if}/> {'Toolbar'|@translate}</label>
+      </li>
 			<li>
-				<span class="property">{'f2b_path'|@translate}</span>
-				<input type="text" name="path" value="{$PATH}"/>
+				<span class="property">{'Switch mode'|@translate}</span>
+				<label><input type="radio" name="switch_mode" value="click" {if $SWITCH_MODE == 'click'}checked="checked"{/if}/> {'Click'|@translate}</label>
+				<label><input type="radio" name="switch_mode" value="hover" {if $SWITCH_MODE == 'hover'}checked="checked"{/if}/> {'Mouseover'|@translate}</label>
 			</li>
 			<li>
-				<span class="property">{'f2b_parent'|@translate}</span>
-				<input type="text" name="parent" value="{$PARENT}"/>
-			</li>		
-			<li>
-				<span class="property">{'f2b_hd_parent'|@translate}</span>
-				<input type="text" name="hd_parent" value="{$HD_PARENT}"/>
+				<span class="property">{'Transition'|@translate}</span>
+				<label><input type="radio" name="transition" value="none" {if $TRANSITION == 'none'}checked="checked"{/if}/> {'None'|@translate}</label>
+				<label><input type="radio" name="transition" value="fade" {if $TRANSITION == 'fade'}checked="checked"{/if}/> {'Fade'|@translate}</label>
 			</li>
-			<li>
-				<span class="property">{'f2b_suffix'|@translate}</span>
-				<input type="text" name="suffix" value="{$SUFFIX}"/>
-			</li>
-		</ul>
-	</fieldset>
-		
-	<p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" /></p>
+      
+      <li>
+        <span class="property">{'Link name'|@translate}</span>
+        <select name="lang_desc_select">
+          {foreach from=$link_name item=lang}
+            <option value="{$lang.LANGUAGE_CODE}" id="opt_{$lang.LANGUAGE_CODE}">{if empty($lang.VALUE)}&#x2718;{else}&#x2714;{/if} &nbsp;{$lang.LANGUAGE_NAME}</option>
+          {/foreach}
+        </select>
+        {foreach from=$link_name item=lang}
+          <input type="text" size="30" name="link_name[{$lang.LANGUAGE_CODE}]" id="link_name_{$lang.LANGUAGE_CODE}" value="{$lang.VALUE}" style="{if $lang.LANGUAGE_CODE != 'default'}display:none; {/if}margin-left:10px;">
+        {/foreach}
+
+        <a class="lang_help" title="{'Seperate the two labels with the | symbol. Leave blank to use default translation.'|@translate}">i</a>
+      </li>
+    </ul>
+  </fieldset>
+    
+  <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" /></p>
 </form>
 
Index: extensions/Front2Back/template/style.css
===================================================================
--- extensions/Front2Back/template/style.css	(revision 11217)
+++ extensions/Front2Back/template/style.css	(revision 11217)
@@ -0,0 +1,23 @@
+a.reverse {
+  display:inline-block;
+  border:1px solid #666 !important;
+  padding:3px 5px;
+  margin-bottom:10px;
+  font-size:15px;
+  font-style:italic;  
+}
+a.reverse img {
+  vertical-align:top;
+}
+.lang_help {
+  display:inline-block;
+  width:15px;
+  text-align:center;
+  font-style:italic;
+  font-family:"Georgia",serif;
+  background-color:#464646;
+  font-size:0.9em;
+  line-height:1.3em;
+  border-radius:10px;
+  -moz-border-radius:10px;
+}
