<?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/masselsm/public_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 records
  list($homepage_slideshowRecords, $homepage_slideshowMetaData) = getRecords(array(
    'tableName'   => 'homepage_slideshow',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $homepage_slideshowRecord = @$homepage_slideshowRecords[0]; // get first record

  // show error message if no matching record is found
  if (!$homepage_slideshowRecord) {
    header("HTTP/1.0 404 Not Found");
    print "Record not found!";
    exit;
  }

?>

<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Welcome to Massel's Marine</TITLE>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<script type="text/javascript" src="fadeslideshow.js">

/***********************************************
* Ultimate Fade In Slideshow v2.0- (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>

<!-- STEP2: Display Record (Paste this where you want your record displayed and re-arrange fields) -->
<?php if ($record): ?>
<?php endif ?>

<?php if (empty($record)): ?>
<?php endif ?>
<!-- STEP2: /Display Record -->

<script type="text/javascript">

var mygallery=new fadeSlideShow({
wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow
dimensions: [999, 324], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
<?php $firstImage = true ?>
<?php if ($record): ?>
<?php foreach (getUploads($options['tableName'], 'slideshow', $record['num']) as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>

<?php if (!$firstImage): ?>
,
<?php endif ?>
<?php $firstImage = false ?>

[
<?php echo json_encode($upload['thumbUrlPath']) ?>,
"",
"",
"<?php echo json_encode($upload['info1']) ?>"
]

<?php endif ?>
<?php endforeach ?>
<?php endif ?>
],
displaymode: {type:'auto', pause:2000, cycles:0, wraparound:false},
persist: true, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow2toggler"
})

</script>

<link href="styles.css" rel="stylesheet" type="text/css">
</HEAD>

<BODY>
<TABLE WIDTH="100" BORDER="0" ALIGN="CENTER" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD class="tdMainImageCell">
<div id="fadeshow2"></div></TD>
</TR>
</TABLE>
</BODY>
</HTML>
