<?php
global $kippis_is_smartphone;
$footer1 = is_active_sidebar('sidebar-footer-one'  );
$footer2 = is_active_sidebar('sidebar-footer-two'  );
$footer3 = is_active_sidebar('sidebar-footer-three');
$footer4 = is_active_sidebar('sidebar-footer-four' );
if ($kippis_is_smartphone) $footer_part = '98';
else {
  $footer_total = 0;
  if ($footer1) $footer_total += 1;
  if ($footer2) $footer_total += 1;
  if ($footer3) $footer_total += 1;
  if ($footer4) $footer_total += 1;
  if ($footer_total > 0) $footer_part = (int)(floor(100.0 / $footer_total));
}
?>
      <div id="sidebar-footer">
      <?php
        if ($footer1) {
          echo '<div class="sidebar" id="sidebar-footer-one" style="width:' . $footer_part . '%;">';
          dynamic_sidebar('sidebar-footer-one');
          echo '</div>';
        }
        if ($footer2) {
          echo '<div class="sidebar" id="sidebar-footer-two" style="width:' . $footer_part . '%;">';
          dynamic_sidebar('sidebar-footer-two');
          echo '</div>';
        }
        if ($footer3) {
          echo '<div class="sidebar" id="sidebar-footer-three" style="width:' . $footer_part . '%;">';
          dynamic_sidebar('sidebar-footer-three');
          echo '</div>';
        }
        if ($footer4) {
          echo '<div class="sidebar" id="sidebar-footer-four" style="width:' . $footer_part . '%;">';
          dynamic_sidebar('sidebar-footer-four');
          echo '</div>';
        }
      ?>
      </div>

