//Set Maximum Page
        $MaxPage = $RecordCount % $zoom->_CONFIG['PageSize'];
        if ($RecordCount % $zoom->_CONFIG['PageSize'] == 0) {
            if ($RecordCount != 0 && $zoom->_CONFIG['PageSize'] != 0) {
                $MaxPage = $RecordCount / $zoom->_CONFIG['PageSize'];
            } else {
                $MaxPage = 0;
            }
        } else {
            $MaxPage = ceil($RecordCount / $zoom->_CONFIG['PageSize']);
        }
        //Set the counter start
        $CounterStart = 1;
        //Counter End
        $CounterEnd = $MaxPage;
        ZMG_Template_Main::showGenericPageHeader($zoom->_CONFIG['viewtype'], _ZOOM_SEARCHRESULTS . ' "<b>' . $suchstring . '</b>"', $Itemid, $mosConfig_live_site . '/components/com_zoom/www/');
        ?>
	    <table border="0" cellspacing="0" cellpadding="3" width="100%">
	    <tr>
		<td align="center" valign="middle" colspan="4">
		<?php 
        if ($ViewRecordCount != 0) {
            echo sprintf(_ZOOM_IMGFOUND, $ViewRecordCount, $PageNo, $MaxPage);
        } else {
            echo "<span class=\"small\">" . _ZOOM_NOPICS . "</span>";
        }
        ?>
		</td>
	    </tr>
	    <?php 
        $tabcnt = 0;
| convenience, or used to compile unrelated photos for a specific     |
| project layout. Lightboxes also allow graphic designers to show     |
| clients options for a project in one simple uncluttered folder."    |
| Source: http://en.wikipedia.org/wiki/Lightbox                       |
|                                                                     |
-----------------------------------------------------------------------
* @version $Id:lightbox.php 136 2007-02-25 21:51:04Z mikedeboer $
* @package zOOmGallery
* @author Mike de Boer <*****@*****.**> 
**/
// MOS Intruder Alerts
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
$PageNo = intval(trim(mosGetParam($_REQUEST, 'PageNo')));
$action = trim(mosGetParam($_REQUEST, 'action'));
$mainframe->setPageTitle(_ZOOM_LIGHTBOX);
ZMG_Template_Main::showGenericPageHeader($zoom->_CONFIG['viewtype'], _ZOOM_LIGHTBOX, $Itemid, $mosConfig_live_site . '/components/com_zoom/www/');
// get files into array...
if ($action == 'add') {
    $key = intval(trim(mosGetParam($_REQUEST, 'key')));
    $type = intval(trim(mosGetParam($_REQUEST, 'lb_type')));
    if ($type == 1 || $type == 3) {
        $object_id = $zoom->_gallery->_images[$key]->_id;
    } elseif ($type == 2) {
        $object_id = $zoom->_gallery->_id;
    }
    if ($type == 3) {
        $type = 1;
        $url_params = "&page=view&catid=" . $zoom->_gallery->_id . "&key=" . $key;
        if (!empty($PageNo)) {
            $url_params .= "&PageNo=" . $PageNo;
        }