<?php
// todo: debug
// include_once( "debuglib.php" );

/************************************************************/
/* THEME NAME: Kids' Pages (version 1.0)                    */
/************************************************************/

/************************************************************/
/*                                                          */
/* Theme Colors Definition                                  */
/*                                                          */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks    */
/* function for left side with: blocks(left);               */
/************************************************************/
$thename = "kp";
// $bgcolor1 = "#B8C6C9";  //full bg color
// $bgcolor2 = "#DCE3E4";  //menu bg & cell top color
// $bgcolor3 = "#9DB0B5";  //main bg color
// $bgcolor4 = "#9DB0B5";  //main bg color

$bgcolor1   = "#cce5ff";  // full bg color
$bgcolor2   = "#ebf5ff";  // menu bg & cell top color
$bgcolor3   = "#99ccff";  // main bg color
$bgcolor4   = "#99ccff";  // main bg color
$textcolor1 = "#000000";  // link color
$textcolor2 = "#000000";  // regular color
$postnuke_theme = true;
themes_get_language();

/************************************************************/
/* Function getColor()                                      */
/*                                                          */
/* Easily modify the colors of the theme by adjusting       */
/* the colors in this function, the standard colors above   */
/* need to be modified to match for other modules to work   */
/************************************************************/
function getColor($color)
{
  $white = "#FFFFFF";
  $background = "#FFFFFF";
  $font = "#ffffff";
  $bodyfont = "#000000";
  $fontalert = "#FF0000";
  $mainbg = "#FFFFFF";
  $border = "#006699";

  $titlebg = "#3366FF";  // top bar color
  $titlebg2 = "#660099";
  $hilitehead = "#ffcc00";
  $articlehead = "#DCE3E4";
  $articletext = "#F0F3F4";
  $sectionhead = "#006699";
  $sectionbody = "#FFFFFF";
  $sectionfooter = "#B8C6C9";
  return $$color;
}

/************************************************************/
/* Standard Table functions                                 */
/************************************************************/
function OpenTableWithNoBorder()
{
  echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"" . getColor("white") . "\"><tr><td>\n";
  echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"" . getColor("sectionbody") . "\"><tr><td>\n";
}

function OpenTableWithNoBorderOrPadding()
{
  echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"" . getColor("white") . "\"><tr><td>\n";
  echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"" . getColor("sectionbody") . "\"><tr><td>\n";
}

function OpenTable()
{
  //dtb: white border    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"" . getColor("border") . "\"><tr><td>\n";
  echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"" . getColor("white") . "\"><tr><td>\n";
  echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"" . getColor("sectionbody") . "\"><tr><td>\n";
}

function CloseTable()
{
  echo "</td></tr></table></td></tr></table>\n";
}

function OpenTable2()
{
  echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"" . getColor("border") . "\" align=\"center\"><tr><td>\n";
  echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"" . getColor("sectionbody") . "\"><tr><td>\n";
}

function CloseTable2()
{
  echo "</td></tr></table></td></tr></table>\n";
}

/************************************************************/
/* Function themeheader()                                   */
/*                                                          */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks    */
/* function for left side with: blocks(left);               */
/************************************************************/

function themeheader()
{
  global  $index, $thename;

  $slogan = pnConfigGetVar('slogan');
  $sitename = pnConfigGetVar('sitename');
  $banners = pnConfigGetVar('banners');
  $startpage = pnConfigGetVar('startpage');
  $currentlang = pnConfigGetVar('language');
  if (!pnUserLoggedIn()) { $username = pnConfigGetVar('anonymous'); } else { $username = pnUserGetVar('uname'); }

  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"/lib/css/nde-basic.css\" media=\"all\">"
  ."<link rel=\"stylesheet\" type=\"text/css\" href=\"/lib/css/nde-central.css\" media=\"all\">"
  ."<link rel=\"stylesheet\" type=\"text/css\" href=\"/lib/css/cssjsmenudhtml.css\" media=\"all\">"
  ."<link rel=\"stylesheet\" type=\"text/css\" href=\"/lib/css/cssjsmenuhover.css\" media=\"all\" id=\"hoverJS\">"
  ."<link rel=\"stylesheet\" type=\"text/css\" href=\"/lib/css/cssjsmenupreso.css\" media=\"all\">"
  ."<link rel=\"stylesheet\" type=\"text/css\" href=\"/lib/css/nde-purple.css\" title=\"Blue\" media=\"screen\">"
  ."<script type=\"text/javascript\" language=\"javascript\" src=\"/lib/js/dhtml.js\"></script>"
  ."<script type=\"text/javascript\" language=\"javascript\" src=\"/lib/js/cssjsmenu.js\"></script>"
  ."<script type=\"text/javascript\" src=\"/lib/js/config.js\"></script>";

$more_styles =
<<<EOT
<style>

.kids-eat-free-callout {
  width: 350px;
  margin-top: 5px;
  margin-bottom: 5px;
  padding: 10px;
  border-top: medium solid #000;
  border-bottom: medium solid #000;
  background-color: #339;
  color: #FFF;
  }
</style>

EOT
;

  echo $more_styles;

  echo "<LINK REL=\"SHORTCUT ICON\" HREF=\"/favicon.ico\">";
  echo "</head>\n";
//  echo "<body  onLoad=\"init()\" bgcolor=\"" . getColor("background") . "\">\n";

  echo '<body  onLoad="preloadImages();init();" style="background-color:#cce5ff; padding: 0px; margin: 5px 0px 5px 0px;text-align:center;">';
//        echo "<div align=\"right\"><img src=\"$imageurl\" border=\"0\" alt=\""._CLICK."\"></a></div>";


// echo '<div align="center" style="margin-left: auto; margin-right: auto; background-color: white;width: 995px;padding: 0px 0px 10px 0px;margin: 0px auto 0px auto">';
echo '<div align="center" style="background-color: white;width: 995px;padding: 5px 0px 10px 0px;margin: 0px auto 0px auto">';




//  echo '<table cellpadding="0" cellspacing="0" width="100%" border="0" align="center"><tr>';
  echo '<table cellpadding="0" cellspacing="0" width="990" border="0" align="center"><tr>';
  echo '<td width="240">';
  echo '<a href="/"><img src="/themes/kp/images/titlebar3.gif" alt="' . _WELCOMETO . ' ' . $sitename . '" border="0"></a>';
  echo '</td>';
//    echo '<td width="10"><img src="themes/kp/images/pixel.gif" width="10" height="1"></td>';
//    echo '<td><a href="/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5008"><img src="/images/misc/donorthanks.gif" width="210" height="60" border="0"></a></td>';



//  echo '<td width="240"><img src="/themes/kp/images/pixel.gif" width="210" height="1"></td>';

  echo '<td width="240">';
//  echo '<img src="/themes/kp/images/pixel.gif" width="210" height="1">';
  echo '<div style="position: relative;height:60px;">';
//  echo '<div style="position:absolute;left:0px;top:13px;padding:0px;margin:0px;"><a href="http://www.ronruelle.com/kids.html" target="_blank"><img src="/images/comics/dogbutton.gif" width="101" height="59" border="0"></a></div>';
//  echo '<div style="position:absolute;left:118px;top:3px;padding:0px;margin:0px;"><a href="/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5017" title="Download great money-saving coupons!"><img src="/images/misc/moneysavingcoupons.gif" width="77" height="60" border="0"></a></div>';


$region_selector =
<<<EOT

<style type="text/css">
<!--

#RegionSelectorTable_01 {
  position:relative;
  left:0px;
  top:0px;
  width:240px;
  height:60px;
}

#RegionSelector-01 {
  position:absolute;
  left:0px;
  top:0px;
  width:120px;
  height:30px;
}

#RegionSelector-02 {
  position:absolute;
  left:120px;
  top:0px;
  width:120px;
  height:30px;
}

#RegionSelector-03 {
  position:absolute;
  left:0px;
  top:30px;
  width:120px;
  height:30px;
}

#RegionSelector-04 {
  position:absolute;
  left:120px;
  top:15px;
  width:120px;
  height:30px;
}
-->
</style>

<script type="text/javascript">
<!--

userAgent = window.navigator.userAgent;
browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
function newImage(arg) {
  if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
  }
}

function findElement(n,ly) {
  if (browserVers < 4)    return document[n];
  var curDoc = ly ? ly.document : document;
  var elem = curDoc[n];
  if (!elem) {
    for (var i=0;i<curDoc.layers.length;i++) {
      elem = findElement(n,curDoc.layers[i]);
      if (elem) return elem;
    }
  }
  return elem;
}

function changeImages() {
  if (document.images && (preloadFlag == true)) {
    var img;
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      img = null;
      if (document.layers) {
        img = findElement(changeImages.arguments[i],0);
      }
      else {
        img = document.images[changeImages.arguments[i]];
      }
      if (img) {
        img.src = changeImages.arguments[i+1];
      }
    }
  }
}

var preloadFlag = false;
function preloadImages() {
  if (document.images) {
    RegionSelector_01_over = newImage("/images/regionselector/RegionSelector_01-over.gif");
    RegionSelector_03_over = newImage("/images/regionselector/RegionSelector_03-over.gif");
    RegionSelector_04_over = newImage("/images/regionselector/RegionSelector_04-over.gif");
    kidseatfree_over = newImage("images/cover/2005-06/kidseatfree-over.gif");
    preloadFlag = true;
  }
}
// -->
</script>

<div id="RegionSelectorTable_01">

EOT;

  echo $region_selector;


  $currentRegion = getRegionIDCcookie();

  if ( $currentRegion == 1 ) // Denver Metro/Boulder
  {
$region_selector =
<<<EOT
  <div id="RegionSelector-01">
    <img name="RegionSelector_01" src="/images/regionselector/RegionSelector_01-over.gif" width="120" height="30" border="0" alt="">
  </div>
EOT;
  }
  else
  {
$region_selector =
<<<EOT
  <div id="RegionSelector-01">
    <a href="/index.php?newregion=1"
      onmouseover="changeImages('RegionSelector_01', '/images/regionselector/RegionSelector_01-over.gif'); return true;"
      onmouseout="changeImages('RegionSelector_01', '/images/regionselector/RegionSelector_01.gif'); return true;"
      onmousedown="changeImages('RegionSelector_01', '/images/regionselector/RegionSelector_01-over.gif'); return true;"
      onmouseup="changeImages('RegionSelector_01', '/images/regionselector/RegionSelector_01-over.gif'); return true;">
      <img name="RegionSelector_01" src="/images/regionselector/RegionSelector_01.gif" width="120" height="30" border="0" alt=""></a>
  </div>
EOT;
  }
  echo $region_selector;

  if ( $currentRegion == 2 ) // Northern Colorado
  {
$region_selector =
<<<EOT
  <div id="RegionSelector-03">
    <img name="RegionSelector_03" src="/images/regionselector/RegionSelector_03-over.gif" width="120" height="30" border="0" alt="">
  </div>
EOT;
  }
  else
  {
$region_selector =
<<<EOT
  <div id="RegionSelector-03">
    <a href="/index.php?newregion=2"
      onmouseover="changeImages('RegionSelector_03', '/images/regionselector/RegionSelector_03-over.gif'); return true;"
      onmouseout="changeImages('RegionSelector_03', '/images/regionselector/RegionSelector_03.gif'); return true;"
      onmousedown="changeImages('RegionSelector_03', '/images/regionselector/RegionSelector_03-over.gif'); return true;"
      onmouseup="changeImages('RegionSelector_03', '/images/regionselector/RegionSelector_03-over.gif'); return true;">
      <img name="RegionSelector_03" src="/images/regionselector/RegionSelector_03.gif" width="120" height="30" border="0" alt=""></a>
  </div>
EOT;
  }
  echo $region_selector;



  if ( $currentRegion == 0 ) // Everywhere
  {
$region_selector =
<<<EOT
  <div id="RegionSelector-04">
    <img name="RegionSelector_04" src="/images/regionselector/RegionSelector_04-over.gif" width="120" height="30" border="0" alt="">
  </div>
EOT;
  }
  else
  {
$region_selector =
<<<EOT
  <div id="RegionSelector-04">
    <a href="/index.php?newregion=0"
      onmouseover="changeImages('RegionSelector_04', '/images/regionselector/RegionSelector_04-over.gif'); return true;"
      onmouseout="changeImages('RegionSelector_04', '/images/regionselector/RegionSelector_04.gif'); return true;"
      onmousedown="changeImages('RegionSelector_04', '/images/regionselector/RegionSelector_04-over.gif'); return true;"
      onmouseup="changeImages('RegionSelector_04', '/images/regionselector/RegionSelector_04-over.gif'); return true;">
      <img name="RegionSelector_04" src="/images/regionselector/RegionSelector_04.gif" width="120" height="30" border="0" alt=""></a>
  </div>
EOT;
  }
  echo $region_selector;

  echo '</div>';


  echo '</div>';
  echo '</td>';

  echo '<td>';
  echo '<span style="float:right;padding-right:4px;">';
  pnBannerDisplay( 1 ); // todo: dtb no banner
  echo '</span>';
  echo '</td>';
  echo '</tr></table>';

//  echo "<table cellpadding=\"3\" cellspacing=\"0\" width=\"100%\" border=\"0\" align=\"center\" bgcolor=\"" . getColor("mainbg") . "\" style=\"border : 1px solid " . getColor("white") . ";\">"
  echo "<table cellpadding=\"3\" cellspacing=\"0\" width=\"990\" border=\"0\" align=\"center\" bgcolor=\"" . getColor("mainbg") . "\" style=\"border : 1px solid " . getColor("white") . ";\">"
       . '<tr><td colspan="3">'

       . "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" >"
       . "<form method=\"post\" action=\"modules.php?op=modload&amp;name=Search&amp;file=index\">"

       . "<td bgcolor=\"" . getColor("titlebg") . "\" align=\"left\" width=\"15\"><img src=\"/themes/kp/images/titlebar-left.gif\" width=\"15\" height=\"29\"></td>"
       . "<td bgcolor=\"" . getColor("titlebg") . "\" align=\"left\" width=\"420\" >"
       . '<span style="color:#fff;font-weight: bold;">';

  if ( pnUserLoggedIn() )
  {

echo
<<<EOT

<style>
.adminlinks {
  font-size: 11px;
  }

.adminlinks A:link {
    text-decoration: underline;
    color:#fff;
}

.adminlinks A:visited {
    text-decoration: underline;
    color:#fff;
}

.adminlinks A:hover {
    color:#ff0;
    text-decoration: underline;
}
</style>
<span class="adminlinks">
EOT;

    echo _HELLO." $username";
    echo "&nbsp;|&nbsp;";
    echo "<a href=\"/user.php?module=NS-User&op=logout\">Logout</a>";
    echo "&nbsp;|&nbsp;";
    echo "Spreadsheets:&nbsp;";
    echo "<a href=\"/excel.php?region_id=1\">Denver</a>";
    echo "&nbsp;|&nbsp;";
    echo "<a href=\"/excel.php?region_id=2\">NoCo</a>";
    echo "&nbsp;|&nbsp;";
    echo "<a href=\"/excel.php\">All</a>";
    echo "&nbsp;|&nbsp;";
    echo '</span>';
  }

    // date stamp
//    echo "<td bgcolor=\"" . getColor("titlebg2") . "\" align=\"right\"><img src=\"/themes/kp/images/pixel.gif\" width=\"1\" height=\"21\"></td>"
//    ."<td bgcolor=\"" . getColor("titlebg2") . "\" align=\"right\">";


//  echo "<script type=\"text/javascript\">\n\n"
//  ."<!--   // Array ofmonth Names\n"
//  ."var monthNames = new Array( \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\");\n"
//  ."var now = new Date();\n"
//  ."thisYear = now.getYear();\n"
//  ."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n"
//  ."document.write(monthNames[now.getMonth()] + \" \" + now.getDate() + \", \" + thisYear);\n"
//  ."// -->\n\n"
//  ."</script>&nbsp;&nbsp;";


/*
  $currentRegion = getRegionIDCcookie();
  $regionName = "";

  switch( $currentRegion)
  {
    case 1:
      $regionName = "Denver Metro/Boulder";
      break;

    case 2:
      $regionName = "Northern Colorado";
      break;

    case 0:
    default:
      $regionName = "Everywhere";
      break;
  }

  echo $regionName;
*/
//  echo "&nbsp;<span class=\"adminlinks\" style=\"font-size:60%;\"><a href=\"/index.php?newregion=99\">(change)</a></span>";


  echo "</span></td>\n";

  echo "<td bgcolor=\"" . getColor("titlebg") . "\" align=\"left\">&nbsp;</td>";


  echo "<td bgcolor=\"" . getColor("titlebg") . "\" align=\"right\" width=\"215\">"
  ."<input type=\"text\" name=\"q\" size=\"15\" style=\"margin:0\">"
  ."<input type=\"hidden\" name=\"action\" value=\"search\">"
  ."<input type=\"hidden\" name=\"overview\" value=\"1\">"
  ."<input type=\"hidden\" name=\"stories_topics[]\" value=\"0\">"
  ."<input type=\"hidden\" name=\"stories_cat[]\" value=\"0\">"
  ."<input type=\"hidden\" name=\"active_stories\" value=\"1\">"
  ."<input type=\"hidden\" name=\"active_sections\" value=\"1\">"
  ."<input type=\"hidden\" name=\"bool\" value=\"AND\">"
  ."&nbsp;<input type=\"submit\" name=\"submit\" value=\"search\">&nbsp;&nbsp;&nbsp;</td>"
  ."<td bgcolor=\"" . getColor("titlebg") . "\" align=\"left\" width=\"15\"><img src=\"/themes/kp/images/titlebar-right.gif\" width=\"15\" height=\"29\"></td>"
  ."</tr></form>"
  ."<tr><td colspan=\"5\">";

  echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\"><tr><td>\n";

  echo "<div id=\"main\">";

  echo "<div id=\"navbar\" align=\"center\">\n"
        ."  <ul class=\"nde-menu-system\">\n"
// Left Buffer
// ."    <li style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static;\"><img src=\"/themes/kp/images/pixel.gif\" width=\"230\" height=\"1\"></li>\n"
// ."    <li style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static;\"><img src=\"/themes/kp/images/pixel.gif\" width=\"1\" height=\"1\"></li>\n"

// 1. Home
."    <li style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static;\"><a href=\"/\">Home</a></li>\n"

// 2. About Us
."    <li class=\"submenu\" style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static; padding-bottom: 0pt;\">\n"
."      <a href=\"#\">About Us</a>\n"
."      <ul style=\"position: absolute; left: 138px; top: 17px; visibility: hidden;\">\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5002\">Meet the Staff</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5003\">Contact Us</a></li>\n"
."      </ul>\n"
."    </li>\n"

// 3. Kids' Pages Cares
."    <li class=\"submenu\" style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static; padding-bottom: 0pt;\">\n"
."      <a href=\"#\">Kids' Pages Cares</a>\n"
."      <ul style=\"position: absolute; left: 138px; top: 17px; visibility: hidden;\">\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5005\">Our Mission</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5118\">Accomplishments</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5006\">Programs</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5004\">Board of Directors</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5008\">Donors</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5009\">How Can I Help</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5010\">501(c)(3) Letter</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5007\">Contact Us</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5011\">On-Line Donations</a></li>\n"
."      </ul>\n"
."    </li>\n"

// 4. Advertising
."    <li class=\"submenu\" style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static; padding-bottom: 0pt;\">\n"
."      <a href=\"#\">Advertising</a>\n"
."      <ul style=\"position: absolute; left: 138px; top: 17px; visibility: hidden;\">\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5030\">Contact the Marketing Department</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5031\">Advantages</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5032\">Circulation & Demographics</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5033\">Ad Sizes</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5034\">Get on the Web</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5035\">Digital Ad/Artwork Submission</a></li>\n"
."      </ul>\n"
."    </li>\n"

// 5. Events
."    <li class=\"submenu\" style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static; padding-bottom: 0pt;\">\n"
//."      <a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5065\">Events</a>\n"
//."      <a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5076\">Events</a>\n"
."      <a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5015\">Events</a>\n"
."    </li>\n"

// 6. Submissions
."    <li class=\"submenu\" style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static; padding-bottom: 0pt;\">\n"
."      <a href=\"#\">Submissions</a>\n"
."      <ul style=\"position: absolute; left: 225px; top: 17px; visibility: hidden;\">\n"
."        <li><a href=\"/index.php?module=SubmitStuff&func=viewbusclass\">Classifieds</a></li>\n"
."        <li><a href=\"/index.php?module=SubmitStuff&func=viewclass\">Nonprofit Classifieds</a></li>\n"
."        <li><a href=\"/index.php?module=SubmitStuff&func=viewcal\">Calendar Listings</a></li>\n"
."        <li><a href=\"/index.php?module=SubmitStuff&func=viewparentres\">Parenting Resources</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5037\">Queries</a></li>\n"
// ."        <li><a href=\"/index.php?module=SubmitStuff&func=viewresponse\">Reader Response</a></li>\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5035\">Digital Ad/Artwork Submission</a></li>\n"
."      </ul>\n"
."    </li>\n"

// 7. Get a Copy
."    <li class=\"submenu\" style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static; padding-bottom: 0pt;\">\n"
."      <a href=\"#\">Get a Copy</a>\n"
."      <ul style=\"position: absolute; left: 138px; top: 17px; visibility: hidden;\">\n"
."        <li><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5036\">Pick Up a Free Copy</a></li>\n"
."        <li><a href=\"/index.php?module=SubmitStuff&func=viewsub\">Subscribe</a></li>\n"
."      </ul>\n"
."    </li>\n"

// 8. Coupons
."    <li class=\"submenu\" style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static; padding-bottom: 0pt;\">\n"
."      <a href=\"/modules.php?op=modload&name=FamilyResource&file=index&req=viewarticle&artid=coupons\">Coupons</a>\n"
// ."      <a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5017\">Coupons</a>\n"
."    </li>\n"


// Contests

."    <li class=\"submenu\" style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static; padding-bottom: 0pt;\">\n";

  switch( $currentRegion )
  {
    case 1:  // Denver Metro/Boulder
      echo "      <a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5157\">Contests</a>\n";
      break;

    case 2:  // Northern Colorado
      echo "      <a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5158\">Contests</a>\n";
      break;

    case 0:  // Everywhere
    default:
      echo "      <a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5091\">Contests</a>\n";
      break;
  }

echo "    </li>\n"


// 8. Advertisers only


."    <li class=\"submenu\" style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static; padding-bottom: 0pt;\">\n"
."      <a href=\"#\">Advertisers Only</a>\n"
."      <ul style=\"position: absolute; left: 138px; top: 17px; visibility: hidden;\">\n"
."        <li><a href=\"/index.php?module=SubmitStuff&func=viewweblisting\">Web Listing</a></li>\n"
."        <li><a href=\"/index.php?module=SubmitStuff&func=viewprintlisting\">Print Listing</a></li>\n"
// ."        <li><a href=\"/index.php?module=SubmitStuff&func=viewpsdlisting\">PSD Activity Guide Listing</a></li>\n"
."      </ul>\n"
."    </li>\n"

// ."    <li class=\"submenu\" style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static; padding-bottom: 0pt;\">\n"
// ."      <a href=\"/index.php?module=SubmitStuff&func=viewadvertisersonly\">Advertisers Only</a>\n"
// ."    </li>\n"


."    \n";

// if ( isRegionIDCookieSet() )
// {
//   echo ""
//
//   // New Region
//   ."    <li class=\"submenu\" style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static; padding-bottom: 0pt;\">\n"
//   ."      <a href=\"/index.php?newregion=99\">New Region</a>\n"
//   ."    </li>\n";
// }

// 9. Brain Boosters
//."    <li class=\"submenu\" style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static; padding-bottom: 0pt;\">\n"
//."      <a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5025\">Brain Boosters</a>\n"
//."    </li>\n"

/*
// Family Fun
."    <li class=\"submenu\" style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static; padding-bottom: 0pt;\">\n"
."      <a href=\"#\">Family Fun</a>\n"
."      <ul style=\"position: absolute; left: 225px; top: 17px; visibility: hidden;\">\n"
."        <li><a href=\"#\">Kids Eat Free</a></li>\n"
."        <li><a href=\"#\">Coupons</a></li>\n"
."      </ul>\n"
."    </li>\n"
*/

/*
// For Kids Only
."    <li class=\"submenu\" style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static; padding-bottom: 0pt;\">\n"
."      <a href=\"#\">For Kids Only</a>\n"
."      <ul style=\"position: absolute; left: 225px; top: 17px; visibility: hidden;\">\n"
."        <li><a href=\"#\">Activities</a></li>\n"
."        <li><a href=\"#\">Kids Contribute</a></li>\n"
."        <li><a href=\"#\">Questionnaire</a></li>\n"
."      </ul>\n"
."    </li>\n"

// Shop at Kids' Pages
."    <li style=\"display: inline; list-style-type: none; list-style-position: outside; list-style-image: none; position: static;\"><a href=\"/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=12\">Shop</a></li>\n"

*/
echo ""
."  </ul>\n"
."</div>\n"
."<div style=\"height: 5px; padding: 4px;\"></div>\n";

  echo "</div>";

  echo "</td></tr>"
       ."</table>";

  echo "</td></tr>"
       ."</table>\n";

  echo "</td></tr>"
      //."<table cellpadding=\"5\" cellspacing=\"0\" width=\"99%\" border=\"0\" align=\"center\" bgcolor=\"" . getColor("mainbg") . "\" style=\"border-left : 1px solid " . getColor("border") . ";border-right : 1px solid " . getColor("border") . ";border-bottom : 1px solid " . getColor("border") . ";\">"

      ."<!-- start body -->"
      ."<tr valign=\"top\">"
      ."  <td width=\"180\" style=\"width:180px\"></td>"
      ."  <td width=\"100%\" style=\"width:100%\"></td>"
      ."  <td width=\"15\" style=\"width:15px\"></td>"
      ."</tr>"

      ."<tr valign=\"top\">"
//    ."<td width=\"150\" valign=\"top\">\n";
      ."<td width=\"180\" valign=\"top\">\n";
  blocks('left');
  echo "<td width=\"100%\">\n";

  // function setRegionIDCookie( $regionid )
  // function getRegionIDCcookie()
  // function isRegionIDCookieSet()
/*
  if ( !isRegionIDCookieSet() )
  {
    $regionsethtml = <<<EOT

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr>
    <td>
      <div style="background-color: #fffbb8;padding:18px;">
        <div style="font-size:14px;font-weight:bold;">
          Kids' Pages now comes in two delicious flavors.<br />
          Choose the one you prefer:
        </div>

        <br />
        <div style="font-size:12px;font-weight:bold;">
          To see events and listings for Denver, Englewood, etc., choose:
        </div>
        <a href="/index.php?newregion=1">Denver Metro/Boulder</a><br />
        <br />

        <div style="font-size:12px;font-weight:bold;">
          To see events and listings for Greely, etc., choose:
        </div>
        <a href="/index.php?newregion=2">Northern Colorado</a><br />
        <br />

        <div style="font-size:12px;font-weight:bold;">
          If you can't decide or you want to see it all, choose:
        </div>
        <a href="/index.php?newregion=0">Everywhere</a><br />
      </div>
    </td>
  </tr>
</table>

EOT;

    echo $regionsethtml;
  }
*/

  if ( $index == 1 )
  {
//        echo "<span>\n";
//        echo "<table border=\"0\" width=\"385\" cellpadding=\"0\" cellspacing=\"0\">"
//        ."  <tr><td><img src=\"/themes/kp/images/pixel.gif\" width=\"385\" height=\"1\"></td></tr>"
//        ."</table>";

    blocks( 'centre' );
//        echo "</span>\n";
  }

//  echo '<div style="position:absolute;left:239px;top:19px;padding:0px;margin:0px;"><a href="http://www.ronruelle.com/kids.html" target="_blank"><img src="/images/comics/dogbutton.gif" width="101" height="59" border="0"></a></div>';
//  echo '<div style="position:absolute;left:357px;top:9px;padding:0px;margin:0px;"><a href="/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=5017" title="Download great money-saving coupons!"><img src="/images/misc/moneysavingcoupons.gif" width="77" height="60" border="0"></a></div>';
}

/************************************************************/
/* function themefooter()                                   */
/*                                                          */
/* Control the footer for your site. You don't need to      */
/* close BODY and HTML tags at the end. In some part call   */
/* the function for right blocks with: blocks('right');     */
/* Also, $index variable need to be global and is used to   */
/* determine if the page your're viewing is the HomePage or */
/* and internal one.                                        */
/************************************************************/

function themefooter()
{
  global $thename, $index;

  if ( $index == 1 )
  {
    echo "<td valign=\"top\" width=\"100%\">\n";
    blocks('right');
  }
  echo "</td></tr></table>\n"
//      ."<table width=\"99%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"" . getColor("mainbg") . "\" align=\"center\" style=\"border : 0px solid " . getColor("border") . ";\"><tr valign=\"top\">\n"
      ."<table width=\"990\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"" . getColor("mainbg") . "\" align=\"center\" style=\"border : 0px solid " . getColor("border") . ";\"><tr valign=\"top\">\n"
      ."</tr><tr align=\"center\">\n"
      ."<td width=\"100%\" colspan=\"3\">\n";
  footmsg();
  echo "</td>\n"
      ."</tr>\n"
      ."</table>\n";


echo '</div>';

// todo: debug
// echo "<h1>show vars</h1>";
// show_vars();


// echo "<h1>start</h1>";
// print_a( debug_backtrace() );  // todo: debug
// echo "<h1>end</h1>";

// show_vars( 1, 1, 10000);
// show_vars( 1, 1, 10000);
// echo "<h1>files</h1>";
// print_a( @$_FILES );

// echo "<h1>globals</h1>";
// foreach ($GLOBALS as $k => $v )
// {
//   echo $k . ": " . $v . '<br />';
// }
}

/************************************************************/
/* Function themeindex()                                    */
/************************************************************/

function themeindex ( $_deprecated, $_deprecated, $_deprecated, $_deprecated,
                      $_deprecated, $_deprecated, $_deprecated, $_deprecated,
                      $_deprecated, $_deprecated, $_deprecated, $_deprecated,
                      $info, $links, $preformat)
{
  global $thename;
  $anonymous = pnConfigGetVar('anonymous');
  $tipath = pnConfigGetVar('tipath');
  echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n"
      ."<tr><td>"
      ."<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" bgcolor=\"" . getColor("border") . "\" width=\"100%\">\n"
        ."  <tr><td style=\"padding:0; border:0\">\n"
        ."    <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"" . getColor("border") . "\" width=\"100%\">\n"
        ."    <tr>\n"
        ."      <td height=\"15\" bgcolor=\"#ffffff\"><img src=\"/themes/kp/images/modhead-left.gif\" height=\"15\" width=\"8\"></td>\n"
        ."      <td width=\"100%\" bgcolor=\"". getColor("sectionhead") . "\" align=\"left\" valign=\"center\" height=\"15\" style=\"color: " . getColor("font") . ";\" >\n"
        ."        &nbsp;\n"
        ."      </td>\n"
        ."      <td height=\"15\" bgcolor=\"#ffffff\"><img src=\"/themes/kp/images/modhead-right.gif\" height=\"15\" width=\"8\"></td>\n"
        ."    </tr>\n"
        ."    </table>\n"
        ."  </td></tr>\n"
      ."<tr><td bgcolor=\"" . getColor("articlehead") . "\" align=\"left\">\n"
      ."$preformat[catandtitle]\n"
      ."<br><b>"._TOPIC."</b> <a href=\"$links[searchtopic]&amp;author=\">$info[topictext]</a>\n"
      ."</td></tr>\n"
      ."<tr><td bgcolor=\"" . getColor("articletext") . "\" style=\"color : " . getColor("bodyfont") . ";\">\n"
      ."<b><a href=\"$links[searchtopic]\"><img src=\"images/topics/$info[topicimage]\" border=\"0\" Alt=\"$info[topictext]\" align=\"right\" hspace=\"10\" vspace=\"10\"></a></b>\n";
  echo "$preformat[hometext]<br><br>$preformat[notes]\n";
  echo "</td></tr>\n"
      ."<tr><td bgcolor=\"" . getColor("sectionfooter") . "\" align=\"right\">\n"
      ."$preformat[more]\n"
      ."</td></tr></table></td></tr></table>\n"
      ."<br>\n\n\n";
}

/************************************************************/
/* Function themearticle()                                  */
/************************************************************/

function themearticle ( $_deprecated, $_deprecated, $_deprecated, $_deprecated,
                        $_deprecated, $_deprecated, $_deprecated, $_deprecated,
                        $_deprecated, $info, $links, $preformat)
{
  global $thename;

  echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"" . getColor("articletext") . "\" width=\"100%\" style=\"border: 1px solid " . getColor("border") . ";\">\n"
      ."<tr><td bgcolor=\"" . getColor("hilitehead") . "\" style=\"border-bottom: 1px solid " . getColor("border") . ";\"><img src=\"themes/kp/images/dots.gif\" height=\"5\" width=\"13\"></td></tr>\n"
      ."<tr><td style=\"padding=5\" style=\"color : " . getColor("font") . ";\">\n"
      ."<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"" . getColor("border") . "\" width=\"100%\"><tr><td>\n"
      ."<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"" . getColor("articlehead") . "\" width=\"100%\"><tr><td align=\"left\">\n"
      ."$preformat[catandtitle]";

  echo "<br>\n";
  echo "Posted on: $info[briefdatetime] "._BY." ";
  echo "$info[informant]";
  if ( pnSecAuthAction( 0, 'Stories::', "$info[aid]:$info[cattitle]:$info[sid]", ACCESS_DELETE ) )
  {
    echo "<br>[ <a href=\"admin.php?module=NS-AddStory&amp;op=EditStory&amp;sid=$info[sid]\">"._EDIT."</a> | <a href=\"admin.php?module=NS-AddStory&amp;op=RemoveStory&amp;sid=$info[sid]\">"._DELETE."</a> ]\n";
  }
  echo "</td></tr></table></td></tr></table><br>";
  echo "<a href=\"$links[searchtopic]\"><img src=\"images/topics/$info[topicimage]\" border=\"0\" Alt=\"$info[topictext]\" align=\"right\" hspace=\"10\" vspace=\"10\"></a>\n";
  echo "$preformat[fulltext]\n";
  echo "</td></tr></table><br>\n\n\n";
}

/************************************************************/
/* Function themesidebox()                                  */
/************************************************************/

function themesidebox( $block )
{
  global $block_side, $thename;

  if (empty($block['position']))
  {
    $block['position'] = "a";
  }

  if ($block['position'] == 'l' || $block['position'] == 'r')
  {
    if ( empty( $block['title'] ) )
    {
//    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"180\" >\n"
//        ."  <tr>\n"
//        ."    <td height=\"7\" bgcolor=\"#ffffff\"><img src=\"/themes/kp/images/pixel.gif\" height=\"7\" width=\"8\"></td>\n"
//        ."    <td width=\"100%\" bgcolor=\"". getColor("sectionhead") . "\" align=\"left\" valign=\"center\" height=\"7\" style=\"color: " . getColor("font") . ";\" ></td>\n"
//        ."    <td height=\"7\" bgcolor=\"#ffffff\"><img src=\"/themes/kp/images/pixel.gif\" height=\"7\" width=\"8\"></td>\n"
//        ."  </tr>\n"
//        ."</table>\n";

      echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border: 0px solid " . getColor("border") . ";\">\n"
          ."<tr><td><img src=\"/themes/kp/images/pixel.gif\" width=\"100%\" height=\"1\"></td></tr>\n"
          ."<tr>\n"
          ."<td bgcolor=\"" . getColor("sectionbody") . "\" style=\"padding:4px\">$block[content]</td>\n"
          ."</tr>\n"
          ."</table>\n"
          ."<br>\n\n\n";
    }
    else
    {
      echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"180\" >\n"
          ."  <tr>\n"
          ."    <td height=\"15\" bgcolor=\"#ffffff\"><img src=\"/themes/kp/images/sidebar-left.gif\" height=\"15\" width=\"8\"></td>\n"
          ."    <td width=\"100%\" bgcolor=\"". getColor("sectionhead") . "\" align=\"left\" valign=\"center\" height=\"15\" style=\"color: " . getColor("font") . ";\" >\n"
          ."      &nbsp;$block[title]\n"
          ."    </td>\n"
          ."    <td height=\"15\" bgcolor=\"#ffffff\"><img src=\"/themes/kp/images/sidebar-right.gif\" height=\"15\" width=\"8\"></td>\n"
          ."  </tr>\n"
          ."</table>\n";

      echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border: 0px solid " . getColor("border") . ";\">\n"
          ."<tr><td><img src=\"/themes/kp/images/pixel.gif\" width=\"100%\" height=\"1\"></td></tr>\n"
          ."<tr>\n"
          ."<td bgcolor=\"" . getColor("sectionbody") . "\" style=\"padding:4px\">$block[content]</td>\n"
          ."</tr>\n"
          ."</table>\n"
          ."<br>\n\n\n";
    }
  }
  if ($block['position'] == 'c')
  {
//    echo "<font>$block[content]</font>";
    echo "$block[content]";
  }
}

/*
function themesidebox($block)
{
  global $block_side, $thename;

  if (empty($block['position']))
  {
    $block['position'] = "a";
  }
  if ($block['position'] == 'l' || $block['position'] == 'r')
  {
    echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"150\" style=\"border: 1px solid " . getColor("border") . ";\">\n"
        ."<tr><td bgcolor=\"" . getColor("hilitehead") . "\" style=\"border-bottom: 1px solid " . getColor("border") . ";\"><img src=\"themes/kp/images/dots.gif\" height=\"5\" width=\"13\"></td></tr>\n"
        ."<tr><td bgcolor=\"" . getColor("sectionhead") . "\" align=\"center\" height=\"20\" style=\"font: bold 13px; color: " . getColor("font") . ";\">\n"
        ."<b>wooba $block[title]</b>\n"
        ."</td></tr>\n"
        ."<tr><td bgcolor=\"" . getColor("border") . "\"><img src=\"themes/kp/images/pixel.gif\" width=\"100%\" height=\"1\"></td></tr>\n"
        ."<tr>\n"
        ."<td bgcolor=\"" . getColor("sectionbody") . "\" style=\"padding:4px\">$block[content]</td>\n"
        ."</tr>\n"
        ."</table>\n"
        ."<br>\n\n\n";
  }
  if ($block['position'] == 'c')
  {
    echo "<font>$block[content]</font>";
  }
}
*/

?>
