<?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."); }

  list($nourish_blogRecords, $nourish_blogMetaData) = getRecords(array(
    'tableName'   => 'nourish_blog',
    'where'       => whereRecordNumberInUrl(0),
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $nourish_blogRecord = @$nourish_blogRecords[0]; // get first record
  if (!$nourish_blogRecord) { dieWith404("Record not found!"); } // show error message if no record found

  list($yoga_blogRecords, $yoga_blogMetaData) = getRecords(array(
    'tableName'   => 'yoga_blog',
    'where'       => whereRecordNumberInUrl(0),
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $yoga_blogRecord = @$yoga_blogRecords[0]; // get first record
  if (!$yoga_blogRecord) { dieWith404("Record not found!"); } // show error message if no record found

  list($promo_panelsRecords, $promo_panelsMetaData) = getRecords(array(
    'tableName'   => 'promo_panels',
    'where'       => 'num = '.$nourish_blogRecord['promo'],
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $promo_panels = @$promo_panelsRecords[0]; // get first record
  if (!$promo_panels) { 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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo htmlencode($yoga_blogRecord['title']) ?></title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/lightbox.js"></script>
<link href="css/lightbox.css" rel="stylesheet" />
<script type="text/javascript">

/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5480df5c1e1e4513"></script>
</head>
<body>
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5480df5c1e1e4513" async="async"></script>
<div id="navigation">
<?php require_once('_masthead.php'); ?>
</div>
<div align="center">
  <table width="1060" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td><img src="img/single-pixel.gif" width="60" height="156" /></td>
      <td colspan="3"><img src="img/single-pixel.gif" width="940" height="156" /></td>
      <td><img src="img/single-pixel.gif" width="60" height="156" /></td>
    </tr>
    
    <tr>
      <td><img src="img/single-pixel.gif" width="60" height="23" /></td>
      <td><img src="img/single-pixel.gif" width="616" height="20" /></td>
      <td><img src="img/single-pixel.gif" width="30" height="20" /></td>
      <td><img src="img/single-pixel.gif" width="293" height="20" /></td>
      <td><img src="img/single-pixel.gif" width="60" height="20" /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td colspan="3"><h1><?php echo htmlencode($yoga_blogRecord['title']) ?></h1>
      <p><?php echo date("l, F jS, Y", strtotime($yoga_blogRecord['date'])) ?></p></td>
      <td>&nbsp;</td>
    </tr>    <tr>
      <td>&nbsp;</td>
      <td><?php foreach ($yoga_blogRecord['uploads'] as $index => $upload): ?>
        <p align="center"><img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="<?php echo htmlencode($upload['info1']) ?>" /></p>
<?php endforeach ?>
<?php echo $yoga_blogRecord['content']; ?>
    <div id="disqus_thread"></div>
    <script type="text/javascript">
        /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
        var disqus_shortname = 'nourishjuicebar'; // required: replace example with your forum shortname

        /* * * DON'T EDIT BELOW THIS LINE * * */
        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
    </script>
    <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
          
      </td>
      <td>&nbsp;</td>
      <td><script language="JavaScript">

<!--
function autoResize(id){
    var newheight;
    var newwidth;

    if(document.getElementById){
        newheight=document.getElementById(id).contentWindow.document .body.scrollHeight;
        newwidth=document.getElementById(id).contentWindow.document .body.scrollWidth;
    }

    document.getElementById(id).height= (newheight) + "px";
    document.getElementById(id).width= (newwidth) + "px";
}
//-->
</script>

<iframe id="myframe" src="_subnav-yoga-blog-ssi.php" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>
            <!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_sharing_toolbox"></div>
<p class="subnav"></p>


<table border="0" cellpadding="0" cellspacing="0">
          <tr>
            <?php foreach ($promo_panels['image'] as $index => $upload): ?>
            <td width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" valign="baseline" background="http://bikramyogawhiterock.com/<?php echo $upload['urlPath'] ?>" class="tdPromoInset"><a href="<?php echo htmlencode($promo_panels['link']) ?>" style="background-repeat: no-repeat"></a><a href="<?php echo htmlencode($promo_panels['link']) ?>" style="background-repeat: no-repeat"><img src="img/single-pixel.gif" width="293" height="190" border="0" /></a></td>
            <?php endforeach ?>
            </tr>
          <tr>
            <td><img src="img/single-pixel.gif" width="293" height="1" /></td>
          </tr>
          <tr>
            <td><h2><a href="<?php echo htmlencode($promo_panels['link']) ?>"><?php echo htmlencode($promo_panels['title']) ?></a></h2>
              <?php echo ($promo_panels['content']) ?></td>
          </tr>
      </table><?php require_once('_mailing-list.php'); ?>
</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><img src="img/single-pixel.gif" width="60" height="20" /></td>
      <td colspan="3"><img src="img/single-pixel.gif" width="940" height="10" /></td>
      <td><img src="img/single-pixel.gif" width="60" height="10" /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td colspan="3">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td colspan="3"><?php require_once('_footer.php'); ?></td>
      <td>&nbsp;</td>
    </tr>
  </table>
</div>
</body>
</html>