+ /**
+ * return first image of the page, the $current photo
+ * lies in.
+ *
+ * this function is used to find out the first photo of the
+ * current page, in which the $current photo lies. this is
+ * used to display the correct photo, when calling showPhotoIndex()
+ * from showImage()
+ */
+ private function getCurrentPage($current, $max)
+ {
+ if(isset($this->cfg->thumbs_per_page) && !empty($this->cfg->thumbs_per_page)) {
+ for($page_start = 0; $page_start <= $max; $page_start+=$this->cfg->thumbs_per_page) {
+ if($current >= $page_start && $current < ($page_start+$this->cfg->thumbs_per_page))
+ return $page_start;
+ }
+ }
+ return 0;
+
+ } // getCurrentPage()
+