<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/
?>

<script  type="text/javascript" language="javascript">
  function showFaq(pole_faq) {
    if (document.getElementById(pole_faq).style.display == 'none') {
    document.getElementById(pole_faq).style.display = 'block'; }
    else {
    document.getElementById(pole_faq).style.display = 'none';
    }
  }
</script>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

  <!-- Naglowek BOF -->
  <tr>
    <td>
      <?php
      $info_box_contents = array();
      $info_box_contents[] = array('text' => sprintf('FAQ'));
      new contentBoxHeading($info_box_contents);
      ?>
    </td>
  </tr>
  <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>
  </tr>
  <!-- Naglowek EOF -->

  <tr>
    <td>
      <table width="100%" cellspacing="1" cellpadding="2" class="infoBox">
        <tr class="infoBoxContents">
          <td>
            <table width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td valign="top" width="100%">
                  <table border="0" width="100%" cellspacing="0" cellpadding="2">
                    <tr>
                      <td class="main" align="left" width="100%">
                        <table border="0" width="100%" cellspacing="0" cellpadding="3">
                          <?php
                          $faq_query = tep_db_query('select f.faq_id, fd.faq_question, fd.faq_answer, f.last_modified, f.sort_order, f.faq_status from '.TABLE_FAQ.' f,  '.TABLE_FAQ_DESCRIPTION.' fd where f.faq_id=fd.faq_id and f.faq_status and fd.language_id='.$_SESSION['languages_id'].' order by f.sort_order, fd.faq_question');
                          $count = 1;
                          if (tep_db_num_rows($faq_query) > 0) {
                            while ($faq = tep_db_fetch_array($faq_query)) {
                              ?>
                              <tr>
                                <td class="main"><b style="cursor:pointer;" onclick="showFaq('faq_answer_<?php echo $faq['faq_id'];?>')"><?php echo $count.'. '.$faq['faq_question'];?></b></td>
                              </tr>
                              <tr>
                                <td style="padding-top:1px;" class="main">
                                  <div style="padding-top:5px;padding-bottom:10px;display:none;" id="faq_answer_<?php echo $faq['faq_id'];?>">
                                    <?php echo $faq['faq_answer'];?>
                                  </div>
                                </td>
                              </tr>
                              <?php
                              $count++;
                            }
                          }
                          ?>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>

  <!-- Przyciski BOF -->
  <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
  </tr>

  <tr>
    <td>
      <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
        <tr class="infoBoxContents">
          <td>
            <table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
<!-- Przyciski EOF -->

</table>