<?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($pricing_introRecords, $pricing_introMetaData) = getRecords(array(
    'tableName'   => 'pricing_intro',
    'where'       => '', // load first record
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $pricing_introRecord = @$pricing_introRecords[0]; // get first record
  if (!$pricing_introRecord) { dieWith404("!"); } // show error message if no record found

  list($promo_panelsRecords, $promo_panelsMetaData) = getRecords(array(
    'tableName'   => 'promo_panels',
    'where'       => 'num = '.$pricing_introRecord['promo'],
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $promo_panels = @$promo_panelsRecords[0]; // get first record
  if (!$promo_panels) { dieWith404("!!"); } // show error message if no record found

  list($masthead_imagesRecords, $masthead_imagesMetaData) = getRecords(array(
    'tableName'   => 'masthead_images',
    'where'       => 'num = '.$pricing_introRecord['main_image'],
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
  $masthead_imagesRecord = @$masthead_imagesRecords[0]; // get first record
  if (!$masthead_imagesRecord) { dieWith404("Record not found!"); } // show error message if no record found

  list($pricingRecords, $pricingMetaData) = getRecords(array(
    'tableName'   => 'pricing',
    'loadUploads' => true,
    'allowSearch' => false,
  ));

?>
<!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($pricing_introRecord['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">

/***********************************************
* Contractible Headers script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated Mar 23rd, 2004.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var enablepersist="off" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="yes" //Collapse previously open content when opening present? (yes/no)

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate

</script>
<SCRIPT TYPE="text/javascript" SRC="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></SCRIPT>
</head>
<body>
<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 colspan="5">

<table border="0" cellpadding="0" cellspacing="0">
<tr>
<?php foreach ($masthead_imagesRecord['image'] as $index => $upload): ?>
<td width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" valign="baseline" background="<?php echo $upload['urlPath'] ?>" id="tdPromoInset"><img src="img/single-pixel.gif" width="1060" height="243" border="0" /></td>
<?php endforeach ?>
</tr>
</table>
</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($pricing_introRecord['title']) ?></h1></td>
      <td>&nbsp;</td>
    </tr>    <tr>
      <td>&nbsp;</td>
      <td>
<?php echo $pricing_introRecord['content']; ?>
<?php foreach ($pricingRecords as $record): ?>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><p class="question" style="cursor:hand; cursor:pointer" onClick="expandcontent('<?php echo htmlencode($record['num']) ?>')"><a href="#"><?php echo htmlencode($record['title']) ?></a></p>
<div id="<?php echo htmlencode($record['num']) ?>" class="switchcontent">
<?php echo $record['content']; ?></div></td>
</tr>
<tr>
<td><img src="img/single-pixel.gif" width="616" height="6" /></td>
</tr>
</table>
<?php endforeach ?></td>
      <td>&nbsp;</td>
      <td><script language="JavaScript" type="text/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 src="_subnav-classes-ssi.php" width="100%" height="100%" name="subnavAbout" id="subnav" marginheight="0" frameborder="0" onload="autoResize('subnav');"></iframe>
        <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="<?php echo $upload['urlPath'] ?>" id="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></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>