window.dhtmlHistory.create();

function initialize()
{
  // initialize RSH
  //alert("here");
  dhtmlHistory.initialize();
  
  // add ourselves as a listener for history
  // change events
  //alert("here1");
  dhtmlHistory.addListener(handleHistoryChange);
  //alert("here11");
  
  // determine our current location so we can
  // initialize ourselves at startup
  //alert("here");
  //alert("here2");
  var initialLocation = dhtmlHistory.getCurrentLocation();
  //alert("here21");
                
  // if no location specified, use the default
  //alert("here3");
  if (initialLocation == null)
  {
  //alert("here4");
    initialLocation = "1";
    // now initialize our starting UI
    updateUI(initialLocation, null);
    // alert("here41");
   }
   else
   {
   //alert("here5");
    this.handleHistoryChange(dhtmlHistory.getCurrentLocation());
    //alert("here51");
    //updateUI(initialLocation, null);
   }
}

/** A function that is called whenever the user
    presses the back or forward buttons. This
    function will be passed the newLocation,
    as well as any history data we associated
    with the location. */
function handleHistoryChange(newLocation,
                             historyData) 
{
    //alert("here6");
  // use the history data to update our UI
  updateUI(newLocation, historyData);                           
}


