Index: /extensions/akBookStyle/trunk/css/admin.css
===================================================================
--- /extensions/akBookStyle/trunk/css/admin.css	(revision 10852)
+++ /extensions/akBookStyle/trunk/css/admin.css	(revision 10853)
@@ -1,12 +1,3 @@
-#content { 
-  text-align: left;
-  padding-left: 20px;
-}
-
-fieldset, fieldset p { 
-  text-align: left;
-}
-
-fieldset p.field  input[type="radio"], fieldset p.field  input[type="checkbox"] {
-  margin:0 3px 0 15px;
-}
+#content{text-align:left;padding-left:20px;}
+fieldset,fieldset p{text-align:left;}
+fieldset p.field input[type="radio"],fieldset p.field input[type="checkbox"]{margin:0 3px 0 15px;}
Index: /extensions/akBookStyle/trunk/css/style.css
===================================================================
--- /extensions/akBookStyle/trunk/css/style.css	(revision 10852)
+++ /extensions/akBookStyle/trunk/css/style.css	(revision 10853)
@@ -1,95 +1,21 @@
-table.ak_display {
-  margin:auto;
-  min-width:99%;
-  width:99%;
-}
-
-table.ak_display tr td, table.ak_display_horizontal tr td { 
-  vertical-align: middle;
-}
-
-td table.thumbnails tr td img {
-  filter: alpha(opacity=70);
-  opacity: 0.7;
-  -moz-opacity: 0.7;
-  -khtml-opacity: 0.7;
-}
-
-td.ak_pic {
-  min-width:640px;
-  text-align:center;
-}
-
-td.navbar { 
-  width: 24px;
-  padding: 200px 0 0 0;
-}
-
-#akPreviousPicture, #akNextPicture { 
-  visibility: hidden;
-}
-
-td.ncol { 
-  padding: 2px;
-}
-
-td table.thumbnails tr td.selected, td table.thumbnails tr td.ncol:hover { 
-  background-color: #FF0000;
-}
-
-td table.thumbnails tr td.selected img, td table.thumbnails tr td.ncol:hover img { 
-  filter: alpha(opacity=100);
-  opacity: 1;
-  -moz-opacity: 1;
-  -khtml-opacity: 1;
-}
-
-td.left {
-  text-align: right;
-}
-
-td.right {
-  text-align: left;
-}
-
-.fleft { 
-  float: left;
-}
-
-.fright { 
-  float: right;
-}
-
-.clipwrapper {
-  position:relative;
-}
-
-.clip {
-  position:absolute;
-}
-
-a.selected img, a.load:hover img { 
-  filter: alpha(opacity=100);
-  opacity: 1;
-  -moz-opacity: 1;
-  -khtml-opacity: 1;
-}
-
-a.hide { 
-  visibility: hidden;
-}
-
-#akBack {
-  position:fixed;
-  right:20px;
-  top:20px;
-}
-
-/******************/
-#theHeader, #menubar, .navigationBar, .titrePage { 
-  display: none;
-}
-
-#content { 
-  margin: 0;
-}
+table.ak_display{margin:auto;min-width:99%;width:99%;}
+table.ak_display tr td,table.ak_display_horizontal tr td{vertical-align:middle;}
+td table.thumbnails tr td img{filter:alpha(opacity=70);opacity:.7;-moz-opacity:.7;-khtml-opacity:.7;}
+td.ak_pic{text-align:center;}
+td.navbar{width:24px;padding:200px 0 0 0;}
+#akPreviousPicture,#akNextPicture{visibility:hidden;}
+td.ncol{padding:2px;}
+td table.thumbnails tr td.selected,td table.thumbnails tr td.ncol:hover{background-color:#F00;}
+td table.thumbnails tr td.selected img,td table.thumbnails tr td.ncol:hover img{filter:alpha(opacity=100);opacity:1;-moz-opacity:1;-khtml-opacity:1;}
+td.left{text-align:right;}
+td.right{text-align:left;}
+.fleft{float:left;}
+.fright{float:right;}
+.clipwrapper{position:relative;}
+.clip{position:absolute;}
+a.selected img,a.load:hover img{filter:alpha(opacity=100);opacity:1;-moz-opacity:1;-khtml-opacity:1;}
+a.hide{visibility:hidden;}
+#akBack{position:fixed;right:20px;top:20px;}
+#theHeader,#menubar,.navigationBar,.titrePage{display:none;}
+#content{margin:0 !important;}
+.ak_pic img { max-width:640px;}
Index: /extensions/akBookStyle/trunk/include/akContent.class.php
===================================================================
--- /extensions/akBookStyle/trunk/include/akContent.class.php	(revision 10852)
+++ /extensions/akBookStyle/trunk/include/akContent.class.php	(revision 10853)
@@ -89,4 +89,13 @@
     $template->assign('AK_THUMBNAILS_LOC', $this->plugin_config->ak_thumbnails_loc); 
     $template->assign('AK_PIC_SRC', get_image_url($images[$this->current_picture]));
+		  $url = duplicate_picture_url(
+        array(
+          'image_id' => $images[$this->current_picture]['id'] ,
+          'image_file' => $images[$this->current_picture]['file']
+        ),
+        array('start')
+      );
+
+    $template->assign('AK_PIC_URL', $url);
 
     $template->assign('AK_NEXT', $this->getNextPicture($this->current_picture, $images));
@@ -132,4 +141,5 @@
       $tpl_vars = $GLOBALS['template']->smarty->_tpl_vars;
       $response['AK_PIC_SRC'] = $tpl_vars['SRC_IMG'];
+      $response['AK_PIC_URL'] = $tpl_vars['current']['url'];
       $response['AK_PIC_ALT'] = $tpl_vars['ALT_IMG'];
       if (isset($tpl_vars['ALT_IMG'])) {
Index: /extensions/akBookStyle/trunk/js/ak_jquery-load.js
===================================================================
--- /extensions/akBookStyle/trunk/js/ak_jquery-load.js	(revision 10852)
+++ /extensions/akBookStyle/trunk/js/ak_jquery-load.js	(revision 10853)
@@ -1,62 +1,53 @@
-$(function() {
+$(function () {
     next_link = $('table.thumbnails div.navbar a[rel=next]');
-    if (next_link.length!=0) {
-      $('#akNextPicture').css('visibility', 'visible');
+    if (next_link.length != 0) {
+        $('#akNextPicture').css('visibility', 'visible')
     }
     previous_link = $('table.thumbnails div.navbar a[rel=previous]');
-    if (previous_link.length!=0) {
-      $('#akPreviousPicture').css('visibility', 'visible');
+    if (previous_link.length != 0) {
+        $('#akPreviousPicture').css('visibility', 'visible')
     }
-    
-    $("a.load")
-      .bind(ak_mouse_event, function() {
-          $('table.thumbnails tr td.ncol').each(function() {
-              if ($(this).hasClass('selected')) {
-                $(this).removeClass('selected');
-              }
-            });
-
-	  $a = $(this);
-          next_thumbnail = $('table.thumbnails a[href='+$(this).attr('href')+']');          
-          if (next_thumbnail.length==0) {
-	    if ($a.attr('id')=='akNextPicture') {
-	      rel = 'next';
-	    } else {
-	      rel = 'previous';
-	    }
-            next_link = $('table.thumbnails div.navbar a[rel='+rel+']');
-            if (next_link.length!=0) {
-              window.location = next_link.attr('href');
+    $("a.load").bind(ak_mouse_event, function () {
+        $('table.thumbnails tr td.ncol').each(function () {
+            if ($(this).hasClass('selected')) {
+                $(this).removeClass('selected')
             }
-          } else {
+        });
+        $a = $(this);
+        //next_thumbnail = $('table.thumbnails a[href=' + $(this).attr('href') + ']');
+        next_thumbnail = $('table.thumbnails a');
+        if (next_thumbnail.length == 0) {
+            if ($a.attr('id') == 'akNextPicture') {
+                rel = 'next'
+            } else {
+                rel = 'previous'
+            }
+            next_link = $('table.thumbnails div.navbar a[rel=' + rel + ']');
+            if (next_link.length != 0) {
+                window.location = next_link.attr('href')
+            }
+        } else {
             next_thumbnail.parent().parent().parent().addClass('selected');
-	    try {
-	      $.get($a.attr('href'),{},
-		    function success(data) { 		    
-		      $('#akPicture')
-			.attr('src', data.AK_PIC_SRC)
-			.attr('alt', data.AK_PIC_ALT)
-			.attr('title', data.AK_PIC_TITLE);
-
-		      if (data.AK_PREVIOUS) {
-			$('#akPreviousPicture')
-			  .removeClass('hide')
-			  .attr('href', data.AK_PREVIOUS);
-		      } else {
-			$('#akPreviousPicture').addClass('hide');
-		      }
-		      if (data.AK_NEXT) {
-			$('#akNextPicture')
-			  .removeClass('hide')
-			  .attr('href', data.AK_NEXT);
-		      } else {
-			$('#akNextPicture').addClass('hide');
-		      }
-		      $a.click(function(e) { e.preventDefault();}); 
-		    },
-		    'json');	    
-	    } catch (e) {}
-          }
-	  return false;
-	});
-  });
+            try {
+                $.get($a.attr('href'), {}, function success(data) {
+											$('#akPicture').attr('src', data.AK_PIC_SRC).attr('alt', data.AK_PIC_ALT).attr('title', data.AK_PIC_TITLE);
+											$('.ak_pic a').attr('href', data.AK_PIC_URL);
+                    if (data.AK_PREVIOUS) {
+                        $('#akPreviousPicture').removeClass('hide').attr('href', data.AK_PREVIOUS)
+                    } else {
+                        $('#akPreviousPicture').addClass('hide')
+                    }
+                    if (data.AK_NEXT) {
+                        $('#akNextPicture').removeClass('hide').attr('href', data.AK_NEXT)
+                    } else {
+                        $('#akNextPicture').addClass('hide')
+                    }
+                    $a.click(function (e) {
+                        e.preventDefault()
+                    })
+                }, 'json')
+            } catch (e) {}
+        }
+        return false
+    })
+});
Index: /extensions/akBookStyle/trunk/main.inc.php
===================================================================
--- /extensions/akBookStyle/trunk/main.inc.php	(revision 10852)
+++ /extensions/akBookStyle/trunk/main.inc.php	(revision 10853)
@@ -29,5 +29,4 @@
 Author URI: http://www.nikrou.net/
 */
-
 if (!defined('PHPWG_ROOT_PATH')) {
   die('Hacking attempt!');
Index: /extensions/akBookStyle/trunk/template/admin.tpl
===================================================================
--- /extensions/akBookStyle/trunk/template/admin.tpl	(revision 10852)
+++ /extensions/akBookStyle/trunk/template/admin.tpl	(revision 10853)
@@ -34,12 +34,10 @@
   </p>
   <p class="field">
-    <label>{'Event to show medium picture.'|translate}
+    {'Event to show medium picture.'|translate}
       {html_radios name='ak_mouse_event' values=$AK_AVAILABLE_EVENTS output=$AK_EVENTS_LABELS|translate selected=$AK_MOUSE_EVENT}
-    </label>
   </p>
   <p class="field">
-    <label>{'Thumbnails location'|translate}
+    {'Thumbnails location'|translate}
       {html_radios name="ak_thumbnails_loc" values=$AK_THUMBNAILS_LOCATIONS_KEYS output=$AK_THUMBNAILS_LOCATIONS_VALUES|translate selected="$AK_THUMBNAILS_LOC"}
-    </label>
   </p>
 </fieldset>
Index: /extensions/akBookStyle/trunk/template/ak_reloaded_image.tpl
===================================================================
--- /extensions/akBookStyle/trunk/template/ak_reloaded_image.tpl	(revision 10852)
+++ /extensions/akBookStyle/trunk/template/ak_reloaded_image.tpl	(revision 10853)
@@ -10,5 +10,7 @@
 
       <td class="ak_pic"> 
-	<img src="{$AK_PIC_SRC}" alt="{$AK_PIC_ALT}" title="{$AK_PIC_TITLE}" id="akPicture">
+				<a href="{$AK_PIC_URL}">
+        	<img src="{$AK_PIC_SRC}" alt="{$AK_PIC_ALT}" title="{$AK_PIC_TITLE}" id="akPicture">
+        </a>
       </td>
       <td class="ncol"> 
Index: /extensions/akBookStyle/trunk/template/ak_thumbnails.tpl
===================================================================
--- /extensions/akBookStyle/trunk/template/ak_thumbnails.tpl	(revision 10852)
+++ /extensions/akBookStyle/trunk/template/ak_thumbnails.tpl	(revision 10853)
@@ -1,5 +1,6 @@
-{known_script id="jquery" src=$ROOT_URL|cat:"themes/default/js/jquery.packed.js"}
+{combine_script id='ak_jquery' require='jquery' path=$AK_PLUGIN_JS|@cat:'/ak_jquery-load.js'}
+{combine_css path=$AK_PLUGIN_CSS|@cat:'/style.css'}
+
 {html_head} 
-<link rel="stylesheet" type="text/css" href="{$AK_PLUGIN_CSS}/style.css">
 <script type="text/javascript">
 var dir_thumbnail = '{$AK_DIR_THUMBNAIL}';
@@ -7,5 +8,4 @@
 var ak_mouse_event = '{$AK_MOUSE_EVENT}';
 </script>
-<script type="text/javascript" src="{$AK_PLUGIN_JS}/ak_jquery-load.js"></script>
 {/html_head}
 
