// ==================================
// mgen 4.1 - (C)1999-2011 Jan Kaluza
// ==================================
// This JavaScript relies on CSS classes!
// See 'mgen.css' (or incorprated CSS)

function AddItem(cid,sid,label,link,bar) {
  this.cid=cid;      // category id
  this.sid=sid;      // subcat id [0 indicates top level of cat]
  this.label=label;  // label for tag
  this.link=link;    // page link
  this.bar=bar;      // middle bar text
}

var eMenu = new Array(
  // Define your menu items here in their categories and subcategories:
  // UPPER_LEVEL, LOWER_LEVEL, TAB_LABEL, PAGE_LINK, BAR_TEXT
  // ==========================================================
  
  new AddItem(10,0,'<nobr> H o m e </nobr>','index.html',' - '),
  new AddItem(10,1,'<nobr>Home</nobr>','index.html',' Welcome to our piece of paradise deep in the African bush '),
  new AddItem(10,8,'<nobr>FLOOD 2012</nobr>','flood2012.html',' we were almost washed away but we survived '),
  new AddItem(10,2,'<nobr>Terms &amp; Conditions</nobr>','terms.html',' our terms and conditions for bookings and tours '),
  new AddItem(10,3,'<nobr>Payments</nobr>','paypage.html',' this page enables you to pay us for booking '),
  new AddItem(10,4,'<nobr>Links</nobr>','links.html',' links and referrals to other accommodation places '),
  new AddItem(10,9,'<nobr>Sitemap</nobr>','sitemap.html',' the sitemap can guide to quickly to the content you want '),

  new AddItem(20,0,'<nobr> Bush Camp </nobr>','bushcamp.html',' - '),
  new AddItem(20,1,'The Camp','bushcamp.html',' a bit of the story and a tour of the camp '),
  new AddItem(20,2,'Directions','busharea.html',' where we are located in the world, and the lowveldt '),
  new AddItem(20,21,'Photo Directions','bushfind.html',' when you need photos to guide you to us '),
  new AddItem(20,3,'Accommodation','bushprices.html',' accommodation options in the bush camp '),
  new AddItem(20,4,'Bush Stay Details','bushdetail.html',' details about the accomodation '),
  new AddItem(20,5,'Gastronomic Dept','bushfood.html',' the all-important food side of your stay '),
  new AddItem(20,6,'Innovate!','bushtech.html',' do it yourself technologies and bush engineering '),
  new AddItem(20,7,'See &amp; Do','bushvisit.html',' things to see and do in the area '),

  new AddItem(30,0,'<nobr> Golden Tours </nobr>','goldentours.html',' - '),
  new AddItem(30,1,'Golden Tours','goldentours.html',' information on the tours and packages we offer '),
  new AddItem(30,2,'10 Day','tourA.html'," our 10 day deluxe circuit of South Africa's best "),
  new AddItem(30,3,'5 Day','tourB.html',' our 5 or 6 day wildlife and scenic adventure '),
  // new AddItem(30,4,'2 Day','tourC.html',' our 2 day Kruger Park tour '),
  // new AddItem(30,5,'1 Day','tourD.html',' our 1 day Kruger Park tour '),
  new AddItem(30,6,'Kruger Info','krugerinfo.html',' do not underestimate the size of this park '),

  new AddItem(40,0,'<nobr> Testimonies </nobr>','testimony.html',' - '),
  new AddItem(40,1,'Testimonies','testimony.html',' things that our clients have said '),
  new AddItem(40,2,'More','testimony2.html',' some more testimonies '),
  new AddItem(40,3,'Recent!','testimony3.html',' even more and recent testimonies '),
  
  new AddItem(50,0,'<nobr> Pests </nobr>','pestcontrol.html',' - '),
  new AddItem(50,1,'Pests','pestcontrol.html',' not all creatures are people friendly '),
  new AddItem(50,2,'Head Lice','headlice.html',' they are nasty things but we have a solution '),
  new AddItem(50,3,'Mole Traps','moletraps.html',' to catch those little guys that do the damage '),

  new AddItem(60,0,'<nobr> Tales & History </nobr>','krugerhist.html',' - '),
  new AddItem(60,1,'Kruger History','krugerhist.html',' origins and early days of the Kruger Park '),
  new AddItem(60,2,'Park Stories','krugertales.html',' tales from the Kruger Park '),
  new AddItem(60,3,'Fireside Tales','fireside.html'," Andre's tales from fireside nights "),
  // new AddItem(60,4,'Wild Side','wildside.html',' stories of just how wild life can get in the bush '),
  
  new AddItem(70,0,'Photo Gallery','gallery1.html',' - '),
  new AddItem(70,1,'Scenic','gallery1.html',' scenery from our part of Africa '),
  new AddItem(70,2,'The Big 5','gallery2.html',' the main attraction to this part of Africa '),
  new AddItem(70,3,'The Small 5','gallery3.html',' less known maybe but just as fun to see '),
  new AddItem(70,4,'Birdlife','gallery4.html',' we see quite a few of the 900+ species of birds '),
  new AddItem(70,5,'Fences','gallery5.html',' scenes from our famous fences tour '),
  new AddItem(70,6,'Client Pics','gallery6.html',' some photos and adventures '),
  
  new AddItem()  // leave this one alone, IT ENDS THE LIST!!!
  // ==========================================================
  // Ensure all items have a COMMA at the end, EXCEPT the last (NULL) one!
  //   IF THE MENU VANISHES FROM THE WEB PAGES, CHECK ALL THE COMMAS!
)

// PRODUCTION RELEASE - do not edit below this point!!
function MenuGen(cat,sub) {
  var theend = 0;
  var midies = 0;
  var proced = 0;
  var live = 0;
  var i = 0;
  var midtxt = '';
  var tmenu = eMenu.length; 
  for (i=0; i<tmenu; i++) {
    if (eMenu[i].sid == 0) theend++;
    if (eMenu[i].cid == cat && eMenu[i].sid != 0) midies++;
    if (eMenu[i].cid == cat && eMenu[i].sid == sub) midtxt = eMenu[i].bar;
  }
  document.write('<div id="mgen">');
  document.write('<ul class="uppertab">');
  for (i=0; i<tmenu; i++) { 
    if (eMenu[i].sid == 0) { 
      if (eMenu[i].cid == cat) {
        document.write('<li class="selected"><a href="'+eMenu[i].link+'"');
        // if (eMenu[i].targ != "") { document.write(' target="'+eMenu[i].targ+'"'); }
        document.write('>'+eMenu[i].label+'</a></li>'); 
        proced++;
        live = 1;
      }
      else {  
        document.write('<li><a href="'+eMenu[i].link+'"');
        // if (eMenu[i].targ != "") { document.write(' target="'+eMenu[i].targ+'"'); }
        document.write('>'+eMenu[i].label+'</a></li>'); 
        proced++;
        live = 0; 
      }
    }
  }
  document.write('</ul>');
  document.write('<p class="midbar">&nbsp; '+midtxt+' &nbsp;</p>');
  if (midies > 0) {
    proced=0;
    live=0;
    document.write('<ul class="lowertab">');
    for (i=0; i<tmenu; i++) {
      if (eMenu[i].cid == cat & eMenu[i].sid != 0) {
        if (eMenu[i].sid==sub) {
          document.write('<li class="selected"><a href="'+eMenu[i].link+'"');
          // if (eMenu[i].targ != "") { document.write(' target="'+eMenu[i].targ+'"'); }
          document.write('>'+eMenu[i].label+'</a></li>'); 
          proced++;
          live = 1;
        }
        else {
          document.write('<li><a href="'+eMenu[i].link+'"');
          // if (eMenu[i].targ != "") { document.write(' target="'+eMenu[i].targ+'"'); }
          document.write('>'+eMenu[i].label+'</a></li>'); 
          proced++;
          live = 0;
        }
      }
    }
    document.writeln('</ul></div>'); 
} 
document.writeln('<!-- mgen 4.0 (C)1999-2008 Jan Kaluza -->'); }

