$db->next_record();
 echo "<h3>" . $VM_LANG->_('PHPSHOP_AVAILABLE_IMAGES') . " " . $db->f("product_name") . "</h3>\n";
 if (!$pop) {
     echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=shop.product_details&flypage={$flypage}&product_id={$product_id}&Itemid={$Itemid}\">" . $VM_LANG->_('PHPSHOP_BACK_TO_DETAILS') . "</a>";
 } else {
     echo '<a href="#" onclick="javascript: window.close();">' . $VM_LANG->_('PROMPT_CLOSE') . '</a>';
 }
 echo '<br/><br/><br/>';
 $alt = $db->f("product_name");
 $height = PSHOP_IMG_HEIGHT;
 $width = PSHOP_IMG_WIDTH;
 $border = $image_id == "product" ? "4" : "1";
 $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&amp;page={$page}&amp;product_id={$product_id}&amp;image_id=product&amp;Itemid=" . $Itemid . '&amp;pop=' . $pop;
 $title = $db->f("product_name");
 echo "<a href=\"{$href}\" target=\"_self\" title=\"{$title}\">\n";
 $ps_product->show_image($db->f("product_thumb_image"), "alt=\"{$alt}\" align=\"center\" border=\"{$border}\"");
 echo "</a>&nbsp;&nbsp;&nbsp;";
 $dbi = new ps_DB();
 // Let's have a look wether the product has more images.
 $dbi->query("SELECT * FROM #__{vm}_product_files WHERE file_product_id='{$product_id}' AND file_is_image='1'");
 $images = $dbi->record;
 $i = 0;
 foreach ($images as $image) {
     $info = pathinfo($image->file_name);
     $base_filename = basename($image->file_name, "." . $info["extension"]) . "_" . $image->file_image_thumb_height . "x" . $image->file_image_thumb_width . "." . $info["extension"];
     $thumb = $mosConfig_absolute_path . '/' . $info["dirname"] . "/resized/" . $base_filename;
     $thumburl = str_replace($mosConfig_absolute_path, $mosConfig_live_site, $thumb);
     $alt = $image->file_title;
     $height = empty($image->file_image_thumb_height) ? PSHOP_IMG_HEIGHT : $image->file_image_thumb_height;
     $width = empty($image->file_image_thumb_width) ? PSHOP_IMG_WIDTH : $image->file_image_thumb_width;
     $border = $image->file_id == $image_id ? "4" : "1";