diff code-docs/navtree.js @ 3:5c2683745b33 vamp-plugin-sdk-v2.4

Update for 2.4
author Chris Cannam
date Fri, 13 Jul 2012 13:30:27 +0100
parents 3c430ef1ed66
children 27319718b1f8
line wrap: on
line diff
--- a/code-docs/navtree.js	Tue Oct 04 14:57:53 2011 +0100
+++ b/code-docs/navtree.js	Fri Jul 13 13:30:27 2012 +0100
@@ -2,202 +2,119 @@
 [
   [ "VampPluginSDK", "index.html", [
     [ "Vamp Plugin SDK", "index.html", null ],
-    [ "Class List", "annotated.html", [
-      [ "_VampFeature", "struct__VampFeature.html", null ],
-      [ "_VampFeatureList", "struct__VampFeatureList.html", null ],
-      [ "_VampFeatureUnion", "union__VampFeatureUnion.html", null ],
-      [ "_VampFeatureV2", "struct__VampFeatureV2.html", null ],
-      [ "_VampOutputDescriptor", "struct__VampOutputDescriptor.html", null ],
-      [ "_VampParameterDescriptor", "struct__VampParameterDescriptor.html", null ],
-      [ "_VampPluginDescriptor", "struct__VampPluginDescriptor.html", null ],
-      [ "AmplitudeFollower", "classAmplitudeFollower.html", null ],
-      [ "FixedTempoEstimator::D", "classFixedTempoEstimator_1_1D.html", null ],
-      [ "Vamp::Plugin::Feature", "structVamp_1_1Plugin_1_1Feature.html", null ],
-      [ "FixedTempoEstimator", "classFixedTempoEstimator.html", null ],
-      [ "Vamp::Plugin::OutputDescriptor", "structVamp_1_1Plugin_1_1OutputDescriptor.html", null ],
-      [ "Vamp::PluginBase::ParameterDescriptor", "structVamp_1_1PluginBase_1_1ParameterDescriptor.html", null ],
-      [ "PercussionOnsetDetector", "classPercussionOnsetDetector.html", null ],
-      [ "Vamp::Plugin", "classVamp_1_1Plugin.html", null ],
-      [ "Vamp::PluginAdapter< P >", "classVamp_1_1PluginAdapter.html", null ],
-      [ "Vamp::PluginAdapterBase", "classVamp_1_1PluginAdapterBase.html", null ],
-      [ "Vamp::PluginBase", "classVamp_1_1PluginBase.html", null ],
-      [ "Vamp::HostExt::PluginBufferingAdapter", "classVamp_1_1HostExt_1_1PluginBufferingAdapter.html", null ],
-      [ "Vamp::HostExt::PluginChannelAdapter", "classVamp_1_1HostExt_1_1PluginChannelAdapter.html", null ],
-      [ "Vamp::PluginHostAdapter", "classVamp_1_1PluginHostAdapter.html", null ],
-      [ "Vamp::HostExt::PluginInputDomainAdapter", "classVamp_1_1HostExt_1_1PluginInputDomainAdapter.html", null ],
-      [ "Vamp::HostExt::PluginLoader", "classVamp_1_1HostExt_1_1PluginLoader.html", null ],
-      [ "Vamp::HostExt::PluginSummarisingAdapter", "classVamp_1_1HostExt_1_1PluginSummarisingAdapter.html", null ],
-      [ "Vamp::HostExt::PluginWrapper", "classVamp_1_1HostExt_1_1PluginWrapper.html", null ],
-      [ "PowerSpectrum", "classPowerSpectrum.html", null ],
-      [ "Vamp::RealTime", "structVamp_1_1RealTime.html", null ],
-      [ "SpectralCentroid", "classSpectralCentroid.html", null ],
-      [ "ZeroCrossing", "classZeroCrossing.html", null ]
+    [ "Namespaces", null, [
+      [ "Namespace List", "namespaces.html", "namespaces" ],
+      [ "Namespace Members", "namespacemembers.html", [
+        [ "All", "namespacemembers.html", null ],
+        [ "Functions", "namespacemembers_func.html", null ]
+      ] ]
     ] ],
-    [ "Class Index", "classes.html", null ],
-    [ "Class Hierarchy", "hierarchy.html", [
-      [ "_VampFeature", "struct__VampFeature.html", null ],
-      [ "_VampFeatureList", "struct__VampFeatureList.html", null ],
-      [ "_VampFeatureUnion", "union__VampFeatureUnion.html", null ],
-      [ "_VampFeatureV2", "struct__VampFeatureV2.html", null ],
-      [ "_VampOutputDescriptor", "struct__VampOutputDescriptor.html", null ],
-      [ "_VampParameterDescriptor", "struct__VampParameterDescriptor.html", null ],
-      [ "_VampPluginDescriptor", "struct__VampPluginDescriptor.html", null ],
-      [ "FixedTempoEstimator::D", "classFixedTempoEstimator_1_1D.html", null ],
-      [ "Vamp::Plugin::Feature", "structVamp_1_1Plugin_1_1Feature.html", null ],
-      [ "Vamp::Plugin::OutputDescriptor", "structVamp_1_1Plugin_1_1OutputDescriptor.html", null ],
-      [ "Vamp::PluginBase::ParameterDescriptor", "structVamp_1_1PluginBase_1_1ParameterDescriptor.html", null ],
-      [ "Vamp::PluginAdapterBase", "classVamp_1_1PluginAdapterBase.html", [
-        [ "Vamp::PluginAdapter< P >", "classVamp_1_1PluginAdapter.html", null ]
-      ] ],
-      [ "Vamp::PluginBase", "classVamp_1_1PluginBase.html", [
-        [ "Vamp::Plugin", "classVamp_1_1Plugin.html", [
-          [ "AmplitudeFollower", "classAmplitudeFollower.html", null ],
-          [ "FixedTempoEstimator", "classFixedTempoEstimator.html", null ],
-          [ "PercussionOnsetDetector", "classPercussionOnsetDetector.html", null ],
-          [ "PowerSpectrum", "classPowerSpectrum.html", null ],
-          [ "SpectralCentroid", "classSpectralCentroid.html", null ],
-          [ "Vamp::HostExt::PluginWrapper", "classVamp_1_1HostExt_1_1PluginWrapper.html", [
-            [ "Vamp::HostExt::PluginBufferingAdapter", "classVamp_1_1HostExt_1_1PluginBufferingAdapter.html", null ],
-            [ "Vamp::HostExt::PluginChannelAdapter", "classVamp_1_1HostExt_1_1PluginChannelAdapter.html", null ],
-            [ "Vamp::HostExt::PluginInputDomainAdapter", "classVamp_1_1HostExt_1_1PluginInputDomainAdapter.html", null ],
-            [ "Vamp::HostExt::PluginSummarisingAdapter", "classVamp_1_1HostExt_1_1PluginSummarisingAdapter.html", null ]
-          ] ],
-          [ "Vamp::PluginHostAdapter", "classVamp_1_1PluginHostAdapter.html", null ],
-          [ "ZeroCrossing", "classZeroCrossing.html", null ]
-        ] ]
-      ] ],
-      [ "Vamp::HostExt::PluginLoader", "classVamp_1_1HostExt_1_1PluginLoader.html", null ],
-      [ "Vamp::RealTime", "structVamp_1_1RealTime.html", null ]
+    [ "Classes", null, [
+      [ "Class List", "annotated.html", "annotated" ],
+      [ "Class Hierarchy", "hierarchy.html", "hierarchy" ],
+      [ "Class Members", "functions.html", [
+        [ "All", "functions.html", "functions_dup" ],
+        [ "Functions", "functions_func.html", "functions_func" ],
+        [ "Variables", "functions_vars.html", null ],
+        [ "Typedefs", "functions_type.html", null ],
+        [ "Enumerations", "functions_enum.html", null ],
+        [ "Enumerator", "functions_eval.html", null ]
+      ] ]
     ] ],
-    [ "Class Members", "functions.html", null ],
-    [ "Namespace List", "namespaces.html", [
-      [ "Vamp", "namespaceVamp.html", null ],
-      [ "Vamp::HostExt", "namespaceVamp_1_1HostExt.html", null ]
+    [ "Files", null, [
+      [ "File List", "files.html", "files" ],
+      [ "File Members", "globals.html", [
+        [ "All", "globals.html", null ],
+        [ "Functions", "globals_func.html", null ],
+        [ "Variables", "globals_vars.html", null ],
+        [ "Typedefs", "globals_type.html", null ],
+        [ "Enumerations", "globals_enum.html", null ],
+        [ "Enumerator", "globals_eval.html", null ],
+        [ "Defines", "globals_defs.html", null ]
+      ] ]
     ] ],
-    [ "Namespace Members", "namespacemembers.html", null ],
-    [ "File List", "files.html", [
-      [ "AmplitudeFollower.cpp", "AmplitudeFollower_8cpp.html", null ],
-      [ "AmplitudeFollower.h", "AmplitudeFollower_8h.html", null ],
-      [ "doc-overview", "doc-overview.html", null ],
-      [ "FixedTempoEstimator.cpp", "FixedTempoEstimator_8cpp.html", null ],
-      [ "FixedTempoEstimator.h", "FixedTempoEstimator_8h.html", null ],
-      [ "hostguard.h", "hostguard_8h.html", null ],
-      [ "PercussionOnsetDetector.cpp", "PercussionOnsetDetector_8cpp.html", null ],
-      [ "PercussionOnsetDetector.h", "PercussionOnsetDetector_8h.html", null ],
-      [ "plugguard.h", "plugguard_8h.html", null ],
-      [ "vamp-sdk/Plugin.h", "vamp-sdk_2Plugin_8h.html", null ],
-      [ "vamp-hostsdk/Plugin.h", "vamp-hostsdk_2Plugin_8h.html", null ],
-      [ "PluginAdapter.h", "PluginAdapter_8h.html", null ],
-      [ "vamp-sdk/PluginBase.h", "vamp-sdk_2PluginBase_8h.html", null ],
-      [ "vamp-hostsdk/PluginBase.h", "vamp-hostsdk_2PluginBase_8h.html", null ],
-      [ "PluginBufferingAdapter.h", "PluginBufferingAdapter_8h.html", null ],
-      [ "PluginChannelAdapter.h", "PluginChannelAdapter_8h.html", null ],
-      [ "PluginHostAdapter.h", "PluginHostAdapter_8h.html", null ],
-      [ "PluginInputDomainAdapter.h", "PluginInputDomainAdapter_8h.html", null ],
-      [ "PluginLoader.h", "PluginLoader_8h.html", null ],
-      [ "plugins.cpp", "plugins_8cpp.html", null ],
-      [ "PluginSummarisingAdapter.h", "PluginSummarisingAdapter_8h.html", null ],
-      [ "PluginWrapper.h", "PluginWrapper_8h.html", null ],
-      [ "PowerSpectrum.cpp", "PowerSpectrum_8cpp.html", null ],
-      [ "PowerSpectrum.h", "PowerSpectrum_8h.html", null ],
-      [ "vamp-sdk/RealTime.h", "vamp-sdk_2RealTime_8h.html", null ],
-      [ "vamp-hostsdk/RealTime.h", "vamp-hostsdk_2RealTime_8h.html", null ],
-      [ "SpectralCentroid.cpp", "SpectralCentroid_8cpp.html", null ],
-      [ "SpectralCentroid.h", "SpectralCentroid_8h.html", null ],
-      [ "system.h", "system_8h.html", null ],
-      [ "vamp-hostsdk.h", "vamp-hostsdk_8h.html", null ],
-      [ "vamp-sdk.h", "vamp-sdk_8h.html", null ],
-      [ "vamp-simple-host.cpp", "vamp-simple-host_8cpp.html", null ],
-      [ "vamp.h", "vamp_8h.html", null ],
-      [ "ZeroCrossing.cpp", "ZeroCrossing_8cpp.html", null ],
-      [ "ZeroCrossing.h", "ZeroCrossing_8h.html", null ]
-    ] ],
-    [ "Directories", "dirs.html", [
-      [ "examples", "dir_4ec587bfce30b9b784fbf1cea7303b09.html", null ],
-      [ "host", "dir_6fbd4b7d3be43d486a3cce3231e92c53.html", null ],
-      [ "src", "dir_629e1dda0168f818e2ee3ab23f68039a.html", null ],
-      [ "vamp", "dir_09d7d2829940fe46b7bc0eab58bbbc83.html", null ],
-      [ "vamp-hostsdk", "dir_878d155c6c7dea35ce3fc23c898c55e3.html", null ],
-      [ "vamp-sdk", "dir_fc29d784de6894b015ce0522888485dd.html", null ]
-    ] ],
-    [ "File Members", "globals.html", null ]
+    [ "Directories", "dirs.html", "dirs" ]
   ] ]
 ];
 
+function getData(varName)
+{
+  var i = varName.lastIndexOf('/');
+  var n = i>=0 ? varName.substring(i+1) : varName;
+  return eval(n);
+}
+
+function stripPath(uri)
+{
+  return uri.substring(uri.lastIndexOf('/')+1);
+}
+
+function getScript(scriptName,func,show)
+{
+  var head = document.getElementsByTagName("head")[0]; 
+  var script = document.createElement('script');
+  script.id = scriptName;
+  script.type = 'text/javascript';
+  script.onload = func; 
+  script.src = scriptName+'.js'; 
+  script.onreadystatechange = function() {
+    if (script.readyState=='complete' || script.readyState=='loaded') { 
+      func(); if (show) showRoot(); 
+    }
+  };
+  head.appendChild(script); 
+}
+
 function createIndent(o,domNode,node,level)
 {
-  if (node.parentNode && node.parentNode.parentNode)
-  {
+  if (node.parentNode && node.parentNode.parentNode) {
     createIndent(o,domNode,node.parentNode,level+1);
   }
   var imgNode = document.createElement("img");
-  if (level==0 && node.childrenData)
-  {
+  imgNode.width = 16;
+  imgNode.height = 22;
+  if (level==0 && node.childrenData) {
     node.plus_img = imgNode;
     node.expandToggle = document.createElement("a");
     node.expandToggle.href = "javascript:void(0)";
-    node.expandToggle.onclick = function() 
-    {
-      if (node.expanded) 
-      {
+    node.expandToggle.onclick = function() {
+      if (node.expanded) {
         $(node.getChildrenUL()).slideUp("fast");
-        if (node.isLast)
-        {
+        if (node.isLast) {
           node.plus_img.src = node.relpath+"ftv2plastnode.png";
-        }
-        else
-        {
+        } else {
           node.plus_img.src = node.relpath+"ftv2pnode.png";
         }
         node.expanded = false;
-      } 
-      else 
-      {
-        expandNode(o, node, false);
+      } else {
+        expandNode(o, node, false, false);
       }
     }
     node.expandToggle.appendChild(imgNode);
     domNode.appendChild(node.expandToggle);
-  }
-  else
-  {
+  } else {
     domNode.appendChild(imgNode);
   }
-  if (level==0)
-  {
-    if (node.isLast)
-    {
-      if (node.childrenData)
-      {
+  if (level==0) {
+    if (node.isLast) {
+      if (node.childrenData) {
         imgNode.src = node.relpath+"ftv2plastnode.png";
-      }
-      else
-      {
+      } else {
         imgNode.src = node.relpath+"ftv2lastnode.png";
         domNode.appendChild(imgNode);
       }
-    }
-    else
-    {
-      if (node.childrenData)
-      {
+    } else {
+      if (node.childrenData) {
         imgNode.src = node.relpath+"ftv2pnode.png";
-      }
-      else
-      {
+      } else {
         imgNode.src = node.relpath+"ftv2node.png";
         domNode.appendChild(imgNode);
       }
     }
-  }
-  else
-  {
-    if (node.isLast)
-    {
+  } else {
+    if (node.isLast) {
       imgNode.src = node.relpath+"ftv2blank.png";
-    }
-    else
-    {
+    } else {
       imgNode.src = node.relpath+"ftv2vertline.png";
     }
   }
@@ -230,27 +147,61 @@
   var a = document.createElement("a");
   node.labelSpan.appendChild(a);
   node.label = document.createTextNode(text);
+  node.expanded = false;
   a.appendChild(node.label);
-  if (link) 
-  {
-    a.href = node.relpath+link;
-  } 
-  else 
-  {
+  if (link) {
+    var url;
+    if (link.substring(0,1)=='^') {
+      url = link.substring(1);
+      link = url;
+    } else {
+      url = node.relpath+link;
+    }
+    a.className = stripPath(link.replace('#',':'));
+    if (link.indexOf('#')!=-1) {
+      var aname = '#'+link.split('#')[1];
+      var srcPage = stripPath($(location).attr('pathname'));
+      var targetPage = stripPath(link.split('#')[0]);
+      a.href = srcPage!=targetPage ? url : '#';
+      a.onclick = function(){
+        if (!$(a).parent().parent().hasClass('selected'))
+        {
+          $('.item').removeClass('selected');
+          $('.item').removeAttr('id');
+          $(a).parent().parent().addClass('selected');
+          $(a).parent().parent().attr('id','selected');
+        }
+        var pos, anchor = $(aname), docContent = $('#doc-content');
+        if (anchor.parent().attr('class')=='memItemLeft') {
+          pos = anchor.parent().position().top;
+        } else {
+          pos = anchor.position().top;
+        }
+        var dist = Math.abs(Math.min(
+                     pos-docContent.offset().top,
+                     docContent[0].scrollHeight-
+                     docContent.height()-docContent.scrollTop()));
+        docContent.animate({
+          scrollTop: pos + docContent.scrollTop() - docContent.offset().top
+        },Math.max(50,Math.min(500,dist)),function(){
+          window.location.replace(aname);
+        });
+      };
+    } else {
+      a.href = url;
+    }
+  } else {
     if (childrenData != null) 
     {
       a.className = "nolink";
       a.href = "javascript:void(0)";
       a.onclick = node.expandToggle.onclick;
-      node.expanded = false;
     }
   }
 
   node.childrenUL = null;
-  node.getChildrenUL = function() 
-  {
-    if (!node.childrenUL) 
-    {
+  node.getChildrenUL = function() {
+    if (!node.childrenUL) {
       node.childrenUL = document.createElement("ul");
       node.childrenUL.className = "children_ul";
       node.childrenUL.style.display = "none";
@@ -267,34 +218,110 @@
   var headerHeight = $("#top").height();
   var footerHeight = $("#nav-path").height();
   var windowHeight = $(window).height() - headerHeight - footerHeight;
-  navtree.scrollTo('#selected',0,{offset:-windowHeight/2});
+  (function (){ // retry until we can scroll to the selected item
+    try {
+      navtree.scrollTo('#selected',0,{offset:-windowHeight/2});
+    } catch (err) {
+      setTimeout(arguments.callee, 0);
+    }
+  })();
 }
 
-function expandNode(o, node, imm)
+function expandNode(o, node, imm, showRoot)
 {
-  if (node.childrenData && !node.expanded) 
-  {
-    if (!node.childrenVisited) 
-    {
-      getNode(o, node);
+  if (node.childrenData && !node.expanded) {
+    if (typeof(node.childrenData)==='string') {
+      var varName    = node.childrenData;
+      getScript(node.relpath+varName,function(){
+        node.childrenData = getData(varName);
+        expandNode(o, node, imm, showRoot);
+      }, showRoot);
+    } else {
+      if (!node.childrenVisited) {
+        getNode(o, node);
+      } if (imm) {
+        $(node.getChildrenUL()).show();
+      } else {
+        $(node.getChildrenUL()).slideDown("fast");
+      }
+      if (node.isLast) {
+        node.plus_img.src = node.relpath+"ftv2mlastnode.png";
+      } else {
+        node.plus_img.src = node.relpath+"ftv2mnode.png";
+      }
+      node.expanded = true;
     }
-    if (imm)
-    {
+  }
+}
+
+function highlightAnchor()
+{
+  var anchor = $($(location).attr('hash'));
+  if (anchor.parent().attr('class')=='memItemLeft'){
+    var rows = $('.memberdecls tr[class$=\""'+
+        window.location.hash.substring(1)+'"\"]').children();
+    rows.effect('highlight',{},1500);
+  } else if (anchor.parent().is(":header")) {
+    anchor.parent().effect('highlight',{},1500);
+  } else {
+    var targetDiv = anchor.next();
+    $(targetDiv).children('.memproto,.memdoc').effect("highlight",{},1500);
+  }
+}
+
+function showNode(o, node, index)
+{
+  if (node.childrenData /*&& !node.expanded*/) {
+    if (typeof(node.childrenData)==='string') {
+      var varName    = node.childrenData;
+      getScript(node.relpath+varName,function(){
+        node.childrenData = getData(varName);
+        showNode(o,node,index);
+      },true);
+    } else {
+      if (!node.childrenVisited) {
+        getNode(o, node);
+      }
       $(node.getChildrenUL()).show();
-    } 
-    else 
-    {
-      $(node.getChildrenUL()).slideDown("fast",showRoot);
+      if (node.isLast) {
+        node.plus_img.src = node.relpath+"ftv2mlastnode.png";
+      } else {
+        node.plus_img.src = node.relpath+"ftv2mnode.png";
+      }
+      node.expanded = true;
+      var n = node.children[o.breadcrumbs[index]];
+      if (index+1<o.breadcrumbs.length) {
+        showNode(o,n,index+1);
+      } else {
+        if (typeof(n.childrenData)==='string') {
+          var varName = n.childrenData;
+          getScript(n.relpath+varName,function(){
+            n.childrenData = getData(varName);
+            node.expanded=false;
+            showNode(o,node,index); // retry with child node expanded
+          },true);
+        } else {
+          if (o.toroot=="index.html" || n.childrenData) {
+            expandNode(o, n, true, true);
+          }
+          var a;
+          if ($(location).attr('hash')) {
+            var link=stripPath($(location).attr('pathname'))+':'+
+                     $(location).attr('hash').substring(1);
+            a=$('.item a[class$=\""'+link+'"\"]');
+          }
+          if (a && a.length) {
+            a.parent().parent().addClass('selected');
+            a.parent().parent().attr('id','selected');
+            highlightAnchor();
+          } else {
+            $(n.itemDiv).addClass('selected');
+            $(n.itemDiv).attr('id','selected');
+          }
+          showRoot();
+        }
+      }
     }
-    if (node.isLast)
-    {
-      node.plus_img.src = node.relpath+"ftv2mlastnode.png";
-    }
-    else
-    {
-      node.plus_img.src = node.relpath+"ftv2mnode.png";
-    }
-    node.expanded = true;
   }
 }
 
@@ -302,35 +329,25 @@
 {
   po.childrenVisited = true;
   var l = po.childrenData.length-1;
-  for (var i in po.childrenData) 
-  {
+  for (var i in po.childrenData) {
     var nodeData = po.childrenData[i];
     po.children[i] = newNode(o, po, nodeData[0], nodeData[1], nodeData[2],
-        i==l);
+      i==l);
   }
 }
 
-function findNavTreePage(url, data)
+function navTo(o,root,hash,relpath)
 {
-  var nodes = data;
-  var result = null;
-  for (var i in nodes) 
-  {
-    var d = nodes[i];
-    if (d[1] == url) 
-    {
-      return new Array(i);
+  getScript(relpath+"navtreeindex",function(){
+    var navTreeIndex = eval('NAVTREEINDEX');
+    if (navTreeIndex) {
+      var nti = navTreeIndex[root+hash];
+      o.breadcrumbs = nti ? nti : navTreeIndex[root];
+      if (o.breadcrumbs==null) o.breadcrumbs = navTreeIndex["index.html"];
+      o.breadcrumbs.unshift(0);
+      showNode(o, o.node, 0);
     }
-    else if (d[2] != null) // array of children
-    {
-      result = findNavTreePage(url, d[2]);
-      if (result != null) 
-      {
-        return (new Array(i).concat(result));
-      }
-    }
-  }
-  return null;
+  },true);
 }
 
 function initNavTree(toroot,relpath)
@@ -346,26 +363,32 @@
   o.node.li.appendChild(o.node.childrenUL);
   o.node.depth = 0;
   o.node.relpath = relpath;
+  o.node.expanded = false;
+  o.node.isLast = true;
+  o.node.plus_img = document.createElement("img");
+  o.node.plus_img.src = relpath+"ftv2pnode.png";
+  o.node.plus_img.width = 16;
+  o.node.plus_img.height = 22;
 
-  getNode(o, o.node);
+  navTo(o,toroot,window.location.hash,relpath);
 
-  o.breadcrumbs = findNavTreePage(toroot, NAVTREE);
-  if (o.breadcrumbs == null)
-  {
-    o.breadcrumbs = findNavTreePage("index.html",NAVTREE);
-  }
-  if (o.breadcrumbs != null && o.breadcrumbs.length>0)
-  {
-    var p = o.node;
-    for (var i in o.breadcrumbs) 
-    {
-      var j = o.breadcrumbs[i];
-      p = p.children[j];
-      expandNode(o,p,true);
-    }
-    p.itemDiv.className = p.itemDiv.className + " selected";
-    p.itemDiv.id = "selected";
-    $(window).load(showRoot);
-  }
+  $(window).bind('hashchange', function(){
+     if (window.location.hash && window.location.hash.length>1){
+       var a;
+       if ($(location).attr('hash')){
+         var clslink=stripPath($(location).attr('pathname'))+':'+
+                               $(location).attr('hash').substring(1);
+         a=$('.item a[class$=\""'+clslink+'"\"]');
+       }
+       if (a==null || !$(a).parent().parent().hasClass('selected')){
+         $('.item').removeClass('selected');
+         $('.item').removeAttr('id');
+       }
+       var link=stripPath($(location).attr('pathname'));
+       navTo(o,link,$(location).attr('hash'),relpath);
+     }
+  })
+
+  $(window).load(showRoot);
 }