<?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/bikramyo/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 record from 'homepage_slideshow'
  list($homepage_slideshowRecords, $homepage_slideshowMetaData) = getRecords(array(
    'tableName'   => 'homepage_slideshow',
    'where'       => '', // load first record
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $homepage_slideshowRecord = @$homepage_slideshowRecords[0]; // get first record
  if (!$homepage_slideshowRecord) { dieWith404("Record not found!"); } // show error message if no record found

?>
<!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>
<link rel="shortcut icon" href="favicon.ico" >
<link rel="icon" type="image/gif" href="animated_favicon1.gif" >
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1" />
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script>
<script type='text/javascript' src='menu_jquery.js'></script>
<link href="styles-healthy.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>

<style type="text/css">

#myslideshow{ /*sample CSS for demo*/
	border:0px solid black;
	margin: 0px;
	padding: 0px;
}

</style>

<script src="translucentslideshow.js" type="text/javascript">

/***********************************************
* Translucent slideshow- (c) Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

</script>

<script type="text/javascript">

var translideshow1=new translideshow({
    wrapperid: "myslideshow", //ID of blank DIV on page to house Slideshow
    dimensions: [1060, 350], //width/height of gallery in pixels. Should reflect dimensions of largest image
    imagearray: [
        <?php foreach ($homepage_slideshowRecord['content'] as $index => $upload) {

echo '["' . $upload['urlPath'] . '", "' . htmlencode($upload['info1']) . '", "_top"],';
} ?>
    ],
    displaymode: {type:'auto', pause:6000, cycles:0, pauseonmouseover:true},
    orientation: "h", //Valid values: "h" or "v"
    persist: true, //remember last viewed slide and recall within same session?
    slideduration: 1200 //transition duration (milliseconds)
})

</script>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script>
<link rel='stylesheet' type='text/css' href='styles-nav.css' />
<link href="styles-healthy.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-53ac468d1fa68793"></script>
<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"></script>

<?php
  //get the total number of items in the slideshow
  $numItems = count(@$homepage_slideshow['content']);
  //create variable that can be used as a counter
  $i = 0;
?>

<link href="styles.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY class="bodyIFrame">
<table border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="2"><div id="myslideshow"></div>
      <p align="center" class="paleGrey">
        <a href="javascript:translideshow1.navigate('back')" style="margin-right:40px;">&laquo;</a>
        <?php for ($count = 0; $count < count($homepage_slideshowRecord['content']); $count++) : ?>
        <a href="javascript:translideshow1.navigate(<?php echo $count; ?>)"><?php echo $count + 1; ?></a>&nbsp;&nbsp;
        <?php if(($count +1) < count($homepage_slideshowRecord['content'])) : ?>
        <span class="spanLightGreen">|</span>&nbsp;&nbsp;
        <?php endif; ?>
        <?php endfor; ?>
        <a href="javascript:translideshow1.navigate('forth')" style="margin-left:30px;">&raquo;</a>
</p></td>
  </tr>
</table>
</BODY>
</HTML>
