<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
//  $Id: popup_image.php   drbyte  Modified in v1.5.6 $
//

  require('includes/application_top.php');

  foreach($_GET as $key => $value) {
    switch ($key) {
      case 'banner':
        $banners_id = zen_db_prepare_input($_GET['banner']);

        $banner = $db->Execute("SELECT banners_title, banners_image, banners_html_text
                                FROM " . TABLE_BANNERS . "
                                WHERE banners_id = '" . (int)$banners_id . "'");

        $page_title = $banner->fields['banners_title'];

        if ($banner->fields['banners_html_text']) {
          $image_source = $banner->fields['banners_html_text'];
        } elseif ($banner->fields['banners_image']) {
          $image_source = zen_image(DIR_WS_CATALOG_IMAGES . $banner->fields['banners_image'], $page_title);
        }
        break;
    }
  }
?>
<!doctype html>
<html <?php echo HTML_PARAMS; ?>>
<head>
<title><?php echo $page_title; ?></title>
<script>
function resize() {
  window.resizeTo(document.images[0].width + 30, document.images[0].height + 60);
}
</script>
</head>
<body onload="resize();">
<?php echo $image_source; ?>
</body>
</html>
