<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php include_once ( '-----' ); ?>
<?php
  require_once "-----";

  list($commonRecords, $commonMetaData) = getRecords(array(
    'tableName'   => 'common',
    'limit'       => '1',
  ));
  $commonRecord = @$commonRecords[0]; // get first record
  
  list($bnr_imgsRecords, $bnr_imgsMetaData) = getRecords(array(
    'tableName'   => 'bnr_imgs',
    'orderBy'     => 'RAND()',
    'limit'       => '1',
  ));
  $bnr_imgsRecord = @$bnr_imgsRecords[0]; // get first record
  
  list($home_mainRecords, $home_mainMetaData) = getRecords(array(
    'tableName'   => 'home_main',
    'limit'       => '1',
  ));
  $home_mainRecord = @$home_mainRecords[0]; // get first record
  
  list($applicationsRecords, $applicationsMetaData) = getRecords(array(
    'tableName'   => 'applications',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $applicationsRecord = @$applicationsRecords[0]; // get first record
  
  // show error message if no matching record is found
  if (!$applicationsRecord) {
    print "This application is no longer active.  Please go back and select another.  Thank you!";
    exit;
  }
  
  list($documentsRecords, $documentsMetaData) = getRecords(array(
    'tableName'   => 'documents',
	'where'       => "'application' = ".mysql_escape($applicationsRecord['num'])."",
	'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><?php echo $applicationsRecord['page_title'] ?></title>
<meta name="description" content="<?php echo $applicationsRecord['meta_description'] ?>" />
<meta name="keywords" content="<?php echo $applicationsRecord['meta_keywords'] ?>"  />
<meta name="robots" content="index,follow" />
<link rel="stylesheet" type="text/css" media="screen, print, projection"  href="common.css"></link>
<link rel="stylesheet" type="text/css" media="screen, print, projection"  href="news.css"></link>
<script type="text/javascript"  src="popmenu.js"></script>
<link rel="stylesheet" type="text/css" media="screen, print, projection"  href="products.css"></link>
<link rel="stylesheet" type="text/css" href="tabcontent.css" />
<script type="text/javascript" src="js/tabcontent.js"></script>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<style type="text/css">
/*Credits: Dynamic Drive CSS Library */
/*URL: http://www.dynamicdrive.com/style/ */
#prodthumb .gallerycontainer{position: relative;width:50px;/*Add a height attribute and set to largest image's height to prevent overlaying*/}
#prodthumb .thumbnail img{border: 0px0;margin: 0 5px 5px 0;}
#prodthumb .thumbnail:hover{background-color: transparent;}
#prodthumb .thumbnail:hover img{border: 0px;}
#prodthumb .thumbnail span{ /*CSS for enlarged image*/position: absolute;left: -1000px;visibility: hidden;color: black;text-decoration: none;}
#prodthumb .thumbnail span img{ /*CSS for enlarged image*/padding: 0px;}
#prodthumb .thumbnail:hover span{ /*CSS for enlarged image*/visibility: visible;top: 0;left: -170px; /*position where enlarged image should offset horizontally */z-index: 50;}
</style>
<!--[if IE 6]>
<style type="text/css">
#addthis {width: 160px; left: 820px;}
#newsgrow {margin-left: -8px;}
#midimg	{top:-115px;}
#botimg{top:-250px;}
#bot{top:-120px;}
</style>
<![endif]-->
<!--[if IE 7]>
<style type="text/css">
#midimg	{top:-100px;}
#botimg{top:-230px;}
#bot{top:-110px;}
</style>
<![endif]-->
<link rel='stylesheet' type='text/css' href='push/css/pushup.css' />
<script type='text/javascript' src='push/js/pushup.js'></script>
<body>
<div  id="newscontainer">
  <!--/scootdown-->
  <?php echo $commonRecord['navigation'] ?>
<div id="layer90"></div>
<div id="flashslideshow">
<?php foreach ($bnr_imgsRecord['image'] as $upload): ?>
    <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt='' />
        <?php endforeach ?>
</div>
<div id="ysilogoblueimg">
  <?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="logintext">
<?php
    if (is_logged_in()) {
        echo "<b>" . Lang('welcome') . "</b> ";
        echo "<a href='" . site_url('members') . "'>" . get_mem_info('Username') . "</a> <b>|</b> ";
		echo "<a href='/secure/index.php?/login/logout'>" . Lang('nav_logout') . "</a>";
    } else {
        echo "<a href='/secure/index.php?/login'>" . Lang('login') . "</a> <b>|</b> ";   
        echo "<a href='/secure/index.php?/register'>" . Lang('register') . "</a>";
    }
?></div>
<div id="searchliteral"><?php echo $commonRecord['search_box'] ?></div>
<div id="prodtitle"><p><?php echo $applicationsRecord['title'] ?></p></div>
<div id="addthis">
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style">
<a href="http://www.addthis.com/bookmark.php?v=250&amp;pub=ysiinc" class="addthis_button_compact">Share</a>
<span class="addthis_separator">|</span>
<a class="addthis_button_facebook"></a>
<a class="addthis_button_email"></a>
<a class="addthis_button_favorites"></a>
<a class="addthis_button_print"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pub=ysiinc"></script>
<!-- AddThis Button END -->
</div>
<div id="proddetail"><?php echo $applicationsRecord['desc_first'] ?></p></div>
<div id="prodimg">
<?php foreach ($applicationsRecord['app_images'] as $upload): ?>
            <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="<?php echo $upload['info1'] ?>" title="<?php echo $upload['info1'] ?>" /><?php break; ?> 
        <?php endforeach ?>
</div>
<div id="prodthumb">
<div class="gallerycontainer">
<?php foreach ($applicationsRecord['app_images'] as $upload): ?>
<a class="thumbnail" href="<?php echo $upload['urlPath'] ?>" rel="lightbox[product]" title="<?php echo $upload['info1'] ?>"><img src="<?php echo $upload['thumbUrlPath2'] ?>" alt="<?php echo $upload['info1'] ?>" width="<?php echo $upload['thumbWidth2'] ?>" height="<?php echo $upload['thumbHeight2'] ?>" title="<?php echo $upload['info1'] ?>" /><span><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="<?php echo $upload['info1'] ?>" title="<?php echo $upload['info1'] ?>" /></span></a>
<?php endforeach ?>
</div>
</div>
<!--end of prod img container -->
<div id="newsleftcol">
<div><?php echo $applicationsRecord['subs'] ?></div>
<br />
<div id="newsline"></div>
<div id="top">
<p style="color:#000; padding-bottom:6px; text-align:left;"><a href="find-a-distributor.php"><strong>Find a Distributor</strong></a></p>
<p>YSI has Authorized Distributors all over the globe. View a map and find your closest contact for YSI <?php echo $applicationsRecord['title'] ?> products and accessories.</p>
</div>
<div id="topimg"><a href="find-a-distributor.php"><img src="media/contact/dealer.jpg" alt="Find a Distributor" title="Find a Distributor" /></a></div>
<div id="mid">
<p style="color:#000; padding-bottom:0px; text-align:left;"><a href="support.php"><strong>Get Support</strong></a></p>
 <p>Have a question about using your YSI equipment in <?php echo $applicationsRecord['title'] ?>?  Ask our application specialists!</p>
</div>
<div id="newsline"></div>
<div id="midimg"><a href="support.php"><img src="media/contact/support.jpg" alt="Contact Technical Support" title="Contact Technical Support" /></a></div>
<div id="bot"><p style="color:#000; padding-bottom:6px; text-align:left;"><a href="product-service.php"><strong>Product Service Centers</strong></a></p>
<p>Want to return a product for service? Here you’ll find authorized service centers and instructions on how to send in your YSI <?php echo $applicationsRecord['title'] ?> product.  <br />
</p></div>
<div id="newsline"></div>
<div id="botimg"><a href="product-service.php"><img src="media/contact/service.jpg" alt="Product Service" title="Product Service" /></a></div>
</div>

<div id="scootdown">
  <div id="newsgrow">
  <br />
<p><?php echo $applicationsRecord['remaining_description'] ?></p>
    <ul id="producttabs" class="producttabs">
      <li><a href="#" rel="prod_1_tab" class="selected"><?php echo $applicationsRecord['tab_1_title'] ?></a></li>
      <li><a href="#" rel="prod_2_tab"><?php echo $applicationsRecord['tab_2_title'] ?></a></li>
      <!--<li><a href="#" rel="prod_3_tab"><?php echo $applicationsRecord['tab_3_title'] ?></a></li>
      <li><a href="#" rel="prod_4_tab"><?php echo $applicationsRecord['tab_4_title'] ?></a></li>
      <li><a href="#" rel="prod_5_tab"><?php echo $applicationsRecord['tab_5_title'] ?></a></li>-->
    </ul>
    <div class="tabcontentstyle">
      <div id="prod_1_tab" class="tabcontent">
        <p></p>
        <?php echo $applicationsRecord['tab_1_content'] ?></div>
      <div id="prod_2_tab" class="tabcontent">
        <p></p>
        <?php echo $applicationsRecord['tab_2_content'] ?>
        <hr />
        <p></p>
		<?php foreach ($documentsRecords as $record): ?>
		Application: <?php echo $record['application'] ?>
        	<?php if ($record['document_type']=="1"): ?> 
            	<?php foreach ($record['pdf'] as $upload): ?>
					<a href="<?php echo $upload['urlPath'] ?>"><?php echo $record['title'] ?></a><br/>
				<?php endforeach ?>
			<?php endif ?>
          <?php endforeach; ?>      
        </div>
      <div id="prod_3_tab" class="tabcontent">
        <p></p>
        <?php echo $applicationsRecord['tab_3_content'] ?></div>
      <div id="prod_4_tab" class="tabcontent">
        <p></p>
        <?php echo $applicationsRecord['tab_4_content'] ?></div>
      <div id="prod_5_tab" class="tabcontent">
         <p></p>
        <?php echo $applicationsRecord['tab_5_content'] ?></div>
      <p>&nbsp;</p>
    </div>
    <script type="text/javascript">

var products=new ddtabcontent("producttabs")
products.setpersist(false)
products.setselectedClassTarget("link") //"link" or "linkparent"
products.init()

</script>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p><a href="<?php echo $applicationsMetaData['_listPage']; ?>">&lt;&lt; Back to Applications page</a></p>
    <p>&nbsp;</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>
</div>
</body>
</html>