Witam

Mam stronkę w php. Z lewej strony mam menu: O nas, Oferta, i Kontakt.

screen1

Po kliknięciu na ofertę z prawej strony wyświetlają się informacje o produktach.

Zmodyfikowałam to jednak i po kliknięciu z lewej strony na ofertę, z prawej wyświeta się dodatkowe menu i przyciski:
oferta1, oferta2, oferta3.

screen2

To nowe menu i wyświetlanie go z prawej mam zrobione za pomoca takiego kodu"

  1. <script type='text/javascript'>
  2.  
  3. var PusteId = 0;
  4. var Oferta1Id = 1;
  5. var Oferta2Id = 2;
  6. var Oferta3Id = 3;
  7. var PageMax = 3;
  8.  
  9. var Buttons = new Array();
  10. var ButtonsHi = new Array();
  11. var ButtonsSel = new Array();
  12.  
  13. for (var i = 0; i <= PageMax; i++) {
  14. Buttons[i] = new Image();
  15. ButtonsHi[i] = new Image();
  16. ButtonsSel[i] = new Image();
  17. };
  18.  
  19. <?php
  20. include("subpages/sp_offer.php");
  21.  
  22. ?>
  23.  
  24. var Pages = new Array();
  25. Pages[PusteId] = PusteText;
  26. Pages[Oferta1Id] = Oferta1Text;
  27. Pages[Oferta2Id] = Oferta2Text;
  28. Pages[Oferta3Id] = Oferta3Text;
  29.  
  30. var CurrentPage = 0;
  31.  
  32. function SetButtonState (obj, id, isHovering)
  33. {
  34. if (id == CurrentPage) obj.src = ButtonsSel[id].src;
  35. else if (isHovering) obj.src = ButtonsHi[id].src;
  36. else obj.src = Buttons[id].src;
  37. }
  38.  
  39. function InitButtonStates ()
  40. {
  41. SetButtonState(document.getElementById('Oferta1Button'), Oferta1Id, false);
  42. SetButtonState(document.getElementById('Oferta2Button'), Oferta2Id, false);
  43. SetButtonState(document.getElementById('Oferta3Button'), Oferta3Id, false);
  44. }
  45.  
  46. function ChangePage (id)
  47. {
  48. if (id > PageMax) return;
  49. CurrentPage = id;
  50. document.getElementById('offer_text').innerHTML = Pages[id];
  51. InitButtonStates();
  52. }
  53.  
  54. </script>
  55.  
  56. <div class="wybierz">
  57. <div><img src='images/wybierz-pl.png' width='669' height='36' /></div>
  58. </div>
  59.  
  60. <div class="content">
  61.  
  62. <div style="width:677px; height:38px">
  63.  
  64. <div style='width:221px; height:38px; left:0px; top:0px; position:absolute'><img id='Oferta1Button' onClick='java script:ChangePage(Oferta1Id)' onMouseOver='java script:SetButtonState(this, Oferta1Id, true)' onMouseOut='java script:SetButtonState(this, Oferta1Id, false)' style='cursor:pointer' alt='' /></div>
  65.  
  66. <div style='width:221px; height:38px; left:225px; top:0px; position:absolute'><img id='Oferta2Button' onClick='java script:ChangePage(Oferta2Id)' onMouseOver='java script:SetButtonState(this, Oferta2Id, true)' onMouseOut='java script:SetButtonState(this, Oferta2Id, false)' style='cursor:pointer' alt='' /></div>
  67.  
  68. <div style='width:221px; height:38px; left:450px; top:0px; position:absolute'><img id='Oferta3Button' onClick='java script:ChangePage(Oferta3Id)' onMouseOver='java script:SetButtonState(this, Oferta3Id, true)' onMouseOut='java script:SetButtonState(this, Oferta3Id, false)' style='cursor:pointer' alt='' /></div>
  69.  
  70. </div>
  71.  
  72. <div id='offer_text'></div>
  73.  
  74. </div>
  75.  
  76. <br class="cleaner" />
  77.  
  78. <script type='text/javascript'>
  79. ChangePage(PusteId);
  80. </script>



I zaincludowany plik: sp_offer.php

  1. var PusteText = "<?php include('includes/menu.php'); ?>";
  2.  
  3.  
  4. var Oferta1Text = "<?php include('includes/oferta1.php'); ?>";
  5.  
  6.  
  7. var Oferta2Text = "<?php include('includes/oferta2.php'); ?>";
  8.  
  9.  
  10. var Oferta3Text = "<?php include('includes/oferta3.php'); ?>";
  11.  
  12.  
  13. Buttons[Oferta1Id].src = "buttons/offer/oferta1.png";
  14. Buttons[Oferta2Id].src = "buttons/offer/oferta2.png";
  15. Buttons[Oferta3Id].src = "buttons/offer/oferta3.png";
  16.  
  17. ButtonsHi[Oferta1Id].src = "buttons/offer/oferta1_hi.png";
  18. ButtonsHi[Oferta2Id].src = "buttons/offer/oferta2_hi.png";
  19. ButtonsHi[Oferta3Id].src = "buttons/offer/oferta3_hi.png";
  20.  
  21. ButtonsSel[Oferta1Id].src = "buttons/offer/oferta1_sel.png";
  22. ButtonsSel[Oferta2Id].src = "buttons/offer/oferta2_sel.png";
  23. ButtonsSel[Oferta3Id].src = "buttons/offer/oferta3_sel.png";



I po wybraniu odpowiedniego Buttonu wyświetla sie albo oferta1.php z prawej strony, albo oferta2.php, albo oferta3.

I to wszystko działa.

Ale teraz chciałabym, aby po wybraniu przycisku oferta1 pod spodem pojawiało sie dodatkowe menu: oferta1a, oferta1b, oferta1c.

Chciałabym, aby było tak:

screen3

W jaki sposób stworzyć nowe podmenu? Bo mój sposób nie działa ;/

Pozdrawiam i proszę o pomoc!!
Aga