<?php
  /**
   * Copyright 2011 Zazavi - http://www.zazavi.com
   * Zazavi is free software released under the terms of the GNU General Public License.
   * You should have received a copy of the license.  If not, see <http://www.gnu.org/licenses/>.
   */
  
  if (!defined("_VALID_PHP"))
      die('Direct access to this location is not allowed.');
?>	
  <?php $total = count($modtop);?>
  <div class="wrap">
	<div class="topmodule-outer"<?php if ($total == 1) echo " style=\"padding:0\"";?>>
	  <?php foreach ($modtop as $trow): ?>
	  <div class="topmodule-wrap<?php if($trow['alt_class'] !="") echo ' '.$trow['alt_class'];?>" <?php if ($total > 1) echo " style=\"width:".round(100/$total)."%;float:left;\"";?>>
		<div class="topmodule-inner<?php if($trow['alt_class'] !="") echo ' '.$trow['alt_class'];?>" <?php if ($total == 1) echo " style=\"padding:0;margin:0\"";?>>
		  <?php if ($trow['show_title'] == 1) echo "<h3>".$trow['title'.$core->dblang]."</h3>";?>
		  <?php if ($trow['body'.$core->dblang]) echo "<div class=\"mod-body\">".cleanOut($trow['body'.$core->dblang])."</div>";?>
		  <?php if ($trow['system'] == 1):?>
		  <?php $modfile = MODDIR .$trow['modalias']."/main.php";?>
		  <?php if(file_exists($modfile)) include_once($modfile);?>
		  <?php endif;?>
		</div>
	  </div>
	  <?php endforeach; ?>
	  <?php unset($trow);?>
	  <div class="clear"></div>
	</div>
  </div>
