
  window.onload = initialize();

  function initialize()
  {
    // initialize the DHTML History
    // framework
    dhtmlHistory.initialize();
  
    // subscribe to DHTML history change
    // events
    dhtmlHistory.addListener(handleHistoryChange);
    
    if (dhtmlHistory.isFirstLoad())
    {
      // start adding history
      dhtmlHistory.add("accueil","bloc_contenu.php?rubrique_id=0");
    }

    // determine what our initial location is
    // by retrieving it from the browser's
    // location after the hash
  
    var currentLocation = dhtmlHistory.getCurrentLocation();
  
    // if there is no location then display
    // the default, which is the inbox
    if (currentLocation == "")
    {
      currentLocation = "section:inbox";
    }

    // extract the section to display from
    // the initial location 

    currentLocation = currentLocation.replace(/section\:/, "");
 
   // display this initial location
    displayLocation(currentLocation, null);
  }
  
  /** Handles history change events. */
function handleHistoryChange(newLocation, historyData)
{
   // if there is no location then display
   // the default, which is the inbox
   if (newLocation == "") {
     // newLocation = "section:inbox";
   }
   
   // extract the section to display from
   // the location change; newLocation will
   // begin with the word "section:" 
   newLocation = newLocation.replace(/section\:/, "");
   
   // update the browser to respond to this
   // DHTML history change
  if (newLocation != "")
  {
    displayLocation(newLocation, historyData);
  }
}


  function displayLocation(newLocation, sectionData)
  {
    //// get the menu element that was selected
    //alert(newLocation);
    //alert(sectionData);
    if (sectionData != "")
    {
      //alert(sectionData);
      sendRequest(sectionData,'','contenu');
    }
    //var selectedElement = document.getElementById(newLocation);
    //          
    //
    //    // format and display the address book
    //    sectionData = "<p>Your addressbook:</p>";
    //    sectionData += "<ul>";
    //    
    //    // fetch the address book from the cache
    //    // if we don't have it yet
    //    if (window.addressBook == undefined) {
    //       window.addressBook = 
    //             historyStorage.get("addressBook");
    //    }
    //    
    //    // format the address book for display
    //    for (var i = 0; 
    //             i < window.addressBook.length;
    //                   i++) {
    //       sectionData += "<li>"
    //                      + window.addressBook[i]
    //                      + "</li>";                  
    //    }
    //    
    //    sectionData += "</ul>";
    // }
    // 
    //
    // // update the content's title and main text
    // var contentTitle = 
    //       document.getElementById("content-title");
    // var contentValue =
    //       document.getElementById("content-value");
    // contentTitle.innerHTML = 
    //                      selectedElement.innerHTML;
    // contentValue.innerHTML = sectionData;
  }

/* Displays messages to the screen. */
      function debug(msg, clear) {
        var output = 
                document.getElementById("output");
        if (clear == true)
          output.innerHTML = "<p>" + msg + "</p>";
        else {
          output.innerHTML += 
                            "<p>" + msg + "</p>";
        }
      }
      
      /** Converts pointy brackets into their
             HTML escape code equivalents so
             we can print out XML. */
         function prettyPrintXml(content) {
            if (content == null)
               return null;
            content = 
                content.replace(/</g, "&lt;");
            content = 
                content.replace(/>/g, "&gt;<br/>");
            return content;
         }