<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  
  // load viewer library
  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
  $dirsToCheck = array('/home/content/63/10722363/html/','','../','../../','../../../');
  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

  // load record from 'homepage'
  list($homepageRecords, $homepageMetaData) = getRecords(array(
    'tableName'   => 'homepage',
    'where'       => '', // load first record
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $homepageRecord = @$homepageRecords[0]; // get first record
  if (!$homepageRecord) { dieWith404("Record not found!"); } // show error message if no record found

  list($footer_contentRecords, $footer_contentMetaData) = getRecords(array(
    'tableName'   => 'footer-content',
    'where'       => '', // load first record
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $footer_contentRecord = @$footer_contentRecords[0]; // get first record
  if (!$footer_contentRecord) { dieWith404("Record not found!"); } // show error message if no record found

  list($catalogue_introductionRecords, $catalogue_introductionMetaData) = getRecords(array(
    'tableName'   => 'catalogue_introduction',
    'where'       => '', // load first record
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $catalogue_introductionRecord = @$catalogue_introductionRecords[0]; // get first record
  if (!$catalogue_introductionRecord) { dieWith404("Record not found!"); } // show error message if no record found
  
  // load record from 'insets-panels' uses the selected panel from the services section.
  list($insets_panelsRecords, $insets_panelsMetaData) = getRecords(array(
    'tableName'   => 'insets-panels',
    'where'       => 'num = '.$catalogue_introductionRecord['inset'],
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $insets_panel = @$insets_panelsRecords[0]; // get first record
  if (!$insets_panel) { dieWith404("Record not found!"); } // show error message if no record found

  $where = '';
  $number = getLastNumberInUrl(0);

  if($number > 0){
    $where = "category = $number";
  }

  list($catalogueRecords, $catalogueMetaData) = getRecords(array(
    'tableName'   => 'catalogue',
    'perPage'     => '10',
    'where'       => $where,
    'loadUploads' => true,
    'allowSearch' => false,
    'orderBy'     => 'dragSortOrder DESC ',
  ));
  
  list($catalogue_introductionRecords, $catalogue_introductionMetaData) = getRecords(array(
    'tableName'   => 'catalogue_introduction',
    'where'       => '', // load first record
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $catalogue_introductionRecord = @$catalogue_introductionRecords[0]; // get first record
  if (!$catalogue_introductionRecord) { dieWith404("Record not found!"); } // show error message if no record found

  list($catalogue_categoriesRecords, $catalogue_categoriesMetaData) = getRecords(array(
    'tableName'   => 'catalogue_categories',
    'loadUploads' => true,
    'allowSearch' => false,
  ));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Kathie Jordan Design:&nbsp;<?php echo htmlencode($catalogue_introductionRecord['title']) ?></title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="flexdropdown.css" />

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

<script type="text/javascript" src="flexdropdown.js">

/***********************************************
* Flex Level Drop Down Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>
<link href='http://fonts.googleapis.com/css?family=Pinyon+Script' rel='stylesheet' type='text/css'></head>

<body>
<div  align="center">
<table width="1202" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td id="mastheadBackground"><table width="200" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="images/single-pixel.gif" width="30" height="29" /></td>
        <td><img src="images/single-pixel.gif" width="376" height="29" /></td>
        <td><img src="images/single-pixel.gif" width="766" height="29" /></td>
        <td><img src="images/single-pixel.gif" width="30" height="29" /></td>
        </tr>
      <tr>
        <td><img src="images/single-pixel.gif" width="29" height="81" /></td>
        <td><a href="index.php"><img src="images/logo-kjd.png" width="376" height="81" border="0"/></a></td>
        <td id="mainNavCell">
<?php require_once('_include-main-nav.php'); ?>
</td>
        <td><img src="images/single-pixel.gif" width="29" height="81" /></td>
        </tr>
      </table></td>
    </tr>
  <tr>
    <td id="mainImageLower"><iframe src="lower-slideshow-cms.php" frameborder="0" scrolling="no" width="1202" height="180"></iframe></td>
    </tr>
  <tr>
    <td id="backgroundSpeckled"><table width="1202" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="images/single-pixel.gif" width="65" height="1" /></td>
        <td><img src="images/single-pixel.gif" width="150" height="1" /></td>
        <td><img src="images/single-pixel.gif" width="15" height="1" /></td>
        <td><img src="images/single-pixel.gif" width="608" height="1" /></td>
        <td><img src="images/single-pixel.gif" width="46" height="1" /></td>
        <td><img src="images/single-pixel.gif" width="253" height="1" /></td>
        <td><img src="images/single-pixel.gif" width="65" height="1" /></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td colspan="3"><img src="images/single-pixel.gif" width="376" height="29" /></td>
        <td>&nbsp;</td>
        <td><img src="images/single-pixel.gif" width="253" height="15" /></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td colspan="3"><h1><?php echo htmlencode($catalogue_introductionRecord['title']) ?></h1>
<ul>
<?php foreach ($catalogue_categoriesRecords as $record): ?>
<li>
<?php $count = 0; ?><a href="<?php echo $record['_link'] ?>"><?php echo htmlencode($record['title']) ?>
&nbsp;&raquo;</a>&nbsp;(<?php echo $catalogueMetaData['totalRecords']; ?>&nbsp;items)</li>
<?php endforeach ?>
</ul>
</td>
        <td id="verticalRule">&nbsp;</td>
        <td><table width="253" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td><table width="253" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td><?php require_once('_include-subnav-store.php'); ?></td>
              </tr>
              <tr>
                <td id="horizontalRuleTop">&nbsp;</td>
              </tr>
              <tr>
                <td><table width="100" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <?php foreach ($insets_panel['image'] as $index => $upload): ?>
                    <td width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" valign="baseline" background="<?php echo $upload['urlPath'] ?>" id="tdHomeInset245"><a href="<?php echo htmlencode($insets_panel['link']) ?>"> <img src="images/single-pixel.gif" width="245" height="198" border="0" /> </a></td>
                    <?php endforeach ?>
                  </tr>
                  <tr>
                    <td><img src="images/single-pixel.gif" width="253" height="10" /></td>
                  </tr>
                  <tr>
                    <td><h2><a href="<?php echo htmlencode($insets_panel['link']) ?>"><?php echo htmlencode($insets_panel['title']) ?></a></h2>
                      <?php echo ($insets_panel['content']) ?>
                      <p> <strong><a href="<?php echo htmlencode($insets_panel['link']) ?>">More »</a></strong></p></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table>
  </td>
        <td id="horizontalRule2">&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td colspan="5"><img src="images/single-pixel.gif" width="253" height="46" /></td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
    </tr>
  <tr>
    <td id="backgroundFooter"><?php require_once('_include-footer.php'); ?></td>
  </tr>
  </table>
</div>
</body>
</html>