<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
  require_once "../cms/lib/viewer_functions.php";

  list($commonRecords, $commonMetaData) = getRecords(array(
    'tableName'   => 'common',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $commonRecord = @$commonRecords[0]; // get first record
  
  list($newsRecords, $newsMetaData) = getRecords(array(
    'tableName'   => 'news',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $newsRecord = @$newsRecords[0]; // get first record
  
  list($newsRecords, $newsMetaData) = getRecords(array(
    'tableName'   => 'news',
    'limit'       => '10',
    'loadUploads' => '0',
    'allowSearch' => '0',
  ));

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<title>News - <?php echo $newsRecord['title'] ?></title>
<link rel="stylesheet" type="text/css" media="screen, print, projection"  href="common.css"></link>
<script type="text/javascript"  src="popmenu.js"></script>
<link rel="stylesheet" type="text/css" media="screen, print, projection"  href="products.css"></link>
</head>
<body>
<div  id="pid2products">
<div id="scootdown">
<div id="productgrow">
 <p  style="margin-bottom:0px; margin-top:0px;"><?php echo $newsRecord['title'] ?></p>
 <p><?php echo date("D, M jS, Y g:i:s a", strtotime($newsRecord['date'])) ?></p>
 <p><?php echo $newsRecord['content'] ?></p>
 <p><a href="<?php echo $newsMetaData['news/_listPage']; ?>">&lt;&lt; Back to list page</a> - 
  <a href="mailto:?subject=<?php echo thisPageUrl() ?>">Email this Page</a></p>
 </div>
<!--/product-grow-->
<div id="footer">
<div id="footerbggrow"></div>
<div id="footernav"><p><?php echo $commonRecord['footer_nav'] ?></p></div>
<div id="footercopy"><?php echo $commonRecord['footer_legal'] ?></div>
</div><!--/footer-->
</div><!--/scootdown-->
<?php echo $commonRecord['navigation'] ?>
<div id="layer90"></div>
<div id="logoblueimg">
  <?php foreach ($commonRecord['logo'] as $upload): ?>
  <?php if ($upload['isImage']): ?>
  <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="<?php echo $upload['info1'] ?>" title="<?php echo $upload['info1'] ?>" /><br/>
  <?php endif ?>
  <?php endforeach ?>
</div>
<?php echo $commonRecord['login_code'] ?>
<div id="searchliteral"><?php echo $commonRecord['search_box'] ?></div>
<div id="id21description">
 <p>News intro area</p>
</div>
<div id="newsimg"><img  src="media/newsimg.gif"  alt="news"  /></div>
<div id="prodleftcol">
<?php foreach ($newsRecords as $record): ?>
 <p><a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a></p>
 <br />
 <div id="newsline"></div>
 <?php endforeach; ?>
</div>
</div>
</body>
</html>