<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language ?>" xml:lang="<?php print $language ?>">

<head>
  <title><?php print $head_title ?></title>
  <?php print $head ?>
  <?php print $styles ?>
  <?php print $scripts ?>
</head>

<body>

<div id="root">
  <div id="top">
    <div class="first-row">
      <?php if (isset($primary_links)) { print theme('links', $primary_links, array('class' =>'links', 'id' => 'primary-links')); } ?>
      <?php if (isset($search_box)) { print $search_box; } ?>
    </div>
    <div class="second-row">
      <div id="header">
        <h1><a href="<?php print base_path(); ?>" title="<?php print $site_name ?>"><?php print $site_name ?></a></h1>
        <?php if ($site_slogan) { print "<h2>$site_slogan</h2>"; } ?>
      </div>
      <div id="user">
        <?php if (isset($login_block)) { print $login_block; } ?>
      </div>
    </div>
  </div>
  <h2 class="offset">Navigation</h2>
  <ul id="nav">
    <?php if (isset($secondary_links)) { ?><?php print theme('secondary_links', $secondary_links, array('class' =>'links', 'id' => 'subnavlist')) ?><?php } ?>
  </ul>
  <h2 class="offset">Breadcrumbs</h2>
  <div id="breadcrumbs">You are here: <?php print $breadcrumb; ?><?php if ($title): ?> / <span class="unlinked"><?php print $title ?></span><?php endif; ?>
</div>
  
  
  <div id="content">
    <?php print $help ?>
    <?php print $messages ?>
    
    <div id="primary" class="home">

      <?php if(variable_get('featured_block_1',0) != 0){
        $node = node_load(variable_get('featured_block_1',0));
        if ($node->nid && !$_GET['page']) {
          $image = variable_get('featured_imagefield_1','');
          $image = $node->$image;
          $node->teaser = efficient_node_teaser($node->body, NULL, '300');
        ?>
          
          <div class="overimage-news">
              
            <p class="image">
              <?php  print theme('imagecache', variable_get('featured_imagecache_1',''), $image[0]['filepath'], $image[0]['alt'], $image[0]['title']);  ?></p>
            <div class="content">
              <h1><a href="<?php print url('node/'.$node->nid) ?>"><?php print $node->title ?></a></h1>
              <?php print $node->teaser ?>
              <p class="full">
                <?php print theme('teaser_links',comment_link('node', $node, TRUE),$node) ?>
              </p>
            </div>
          </div>
        <?php  }
      } ?>
      
      <?php if (!$_GET['page']) { ?>
      <div class="featured-row-a">
        <div class="news-a first">
          <?php if(variable_get('featured_block_2',0) != 0){
            $node = node_load(variable_get('featured_block_2',0));
            if ($node->nid) {
              $image = variable_get('featured_imagefield_2','');
              $image = $node->$image;
              $node->teaser = efficient_node_teaser($node->body, NULL, '200');
            ?>
              <h2><a href="<?php print url('node/'.$node->nid) ?>"><?php print $node->title ?></a></h2>
              <p><a href="<?php print url('node/'.$node->nid) ?>"><?php print theme('imagecache', variable_get('featured_imagecache_2',''), $image[0]['filepath'], $image[0]['alt'], $image[0]['title']) ?></a></p>
              <?php print $node->teaser; ?>
              <p class="full">
                <?php print theme('teaser_links',comment_link('node', $node, TRUE),$node) ?>
              </p>
            <?php } ?>
          <?php } ?>
        </div>
              
        <div class="news-a">
          <?php if(variable_get('featured_block_3',0) != 0){
            $node = node_load(variable_get('featured_block_3',0));
            if ($node->nid) {
              $image = variable_get('featured_imagefield_3','');
              $image = $node->$image;
              $node->teaser = efficient_node_teaser($node->body, NULL, '200');
            ?>
              <h2><a href="<?php print url('node/'.$node->nid) ?>"><?php print $node->title ?></a></h2>
              <p><a href="<?php print url('node/'.$node->nid) ?>"><?php print theme('imagecache', variable_get('featured_imagecache_3',''), $image[0]['filepath'], $image[0]['alt'], $image[0]['title']) ?></a></p><?php print $node->teaser ?>
              <p class="full">
                <?php print theme('teaser_links',comment_link('node', $node, TRUE),$node) ?>
              </p>
            <?php } ?>
          <?php } ?>
        </div>
      </div>
      <?php } ?>

      <div class="featured">
        <?php print $content ?>
      </div>
      
      <?php if (!$_GET['page']) { ?>
      <div class="featured-row-b">
        <div class="news-a first">
          <?php if (variable_get('featured_block_4',0) != 0){
            $node = node_load(variable_get('featured_block_4',0));
            if ($node->nid) {
              $image = variable_get('featured_imagefield_4','');
              $image = $node->$image;
              $node->teaser = efficient_node_teaser($node->body, NULL, '200');
            ?>
              <h2><a href="<?php print url('node/'.$node->nid) ?>"><?php print $node->title ?></a></h2>
              <p class="image"><a href="<?php print url('node/'.$node->nid) ?>"><?php print theme('imagecache', variable_get('featured_imagecache_4',''), $image[0]['filepath'], $image[0]['alt'], $image[0]['title']) ?></a></p>
              <p><?php print $node->teaser ?></p>
              <p class="full">
                <?php print theme('teaser_links',comment_link('node', $node, TRUE),$node) ?>
              </p>
            <?php } ?>
          <?php } ?>
        </div>
        
        <div class="news-a">
          <?php if(variable_get('featured_block_5',0) != 0){
            $node = node_load(variable_get('featured_block_5',0));
            if ($node->nid) {
              $image = variable_get('featured_imagefield_5','');
              $image = $node->$image;
              $node->teaser = efficient_node_teaser($node->body, NULL, '200');
            ?>
              <h2><a href="<?php print url('node/'.$node->nid) ?>"><?php print $node->title ?></a></h2>
              <p class="image"><a href="<?php print url('node/'.$node->nid) ?>"><?php print theme('imagecache', variable_get('featured_imagecache_5',''), $image[0]['filepath'], $image[0]['alt'], $image[0]['title']) ?></a></p>
              <p><?php print $node->teaser ?></p>
              <p class="full">
                <?php print theme('teaser_links',comment_link('node', $node, TRUE),$node) ?>
              </p>
            <?php } ?>
          <?php } ?>
        </div>
      </div>
      <?php } ?>
    </div>
    
    <div id="secondary">
      <?php if ($sidebar_left_featured) { print "<div class='sidebar-featured'>$sidebar_left_featured</div>"; } ?>
      <?php if ($sidebar_left) { print $sidebar_left; } ?>
    </div>
    <div id="tertiary">
      <?php if ($sidebar_right) { print $sidebar_right; } ?>
    </div>
  </div>
  <div id="footer">
    <div class="first-row">
      <div class="main">
        <?php if (isset($primary_links)) { print theme('links', $primary_links, array('class' =>'links', 'id' => 'primary-links-footer')); } ?>
        <p class="rss"><a href="<?php print base_path(); ?>rss.xml"><img src="<?php print base_path() . path_to_theme(); ?>/images/rss.gif" alt="RSS" title="RSS" width="34" height="12" /></a></p>
      </div>
      <div class="side">
        <p>This site is valid XHTML 1.0</p>
      </div>
    </div>
    <div class="second-row">
      <div class="main">
        <?php print $footer_message ?> Designed by <a href="http://www.themesnap.com">ThemeSnap.com</a>
      </div>
      <div class="side">
        <p><a href="http://validator.w3.org/check/referer" class="xhtml"><img src="<?php print base_path() . path_to_theme(); ?>/images/w3c-xhtml.jpg" alt="W3C XHTML" title="W3C XHTML" width="91" height="16" /></a> <span>|</span> <a href="http://jigsaw.w3.org/css-validator/check/referer" class="css"><img src="<?php print base_path() . path_to_theme(); ?>/images/w3c-css.jpg" alt="W3C CSS" title="W3C CSS" width="84" height="16" /></a></p>
      </div>
    </div>
  </div>
</div>
<?php print $closure ?>
</body>
</html>