

function HideNoneMatches()
{
	// find current filename
   var protocol = window.location.protocol;
   var path = window.location.pathname;
   
   // this is required because IE loading files locally uses '\' and not '/'
   var separator = (protocol == 'file:' && path.indexOf('/', 1) == -1 ? '\\' : '/');
   
   var file = path.substring(path.lastIndexOf(separator) + 1);
   var path2 = path.substring(0, path.lastIndexOf(separator));
   var path3 = path2.substring(path2.lastIndexOf(separator) + 1);
   
   var objNavmenu = this.document.getElementById('menu');
   if (objNavmenu != null)
   {
      var listitems = objNavmenu.getElementsByTagName('ul');
      for (var i=listitems.length-1; i>=0; i--)
      {
		 if (listitems[i].innerHTML.indexOf(file, 1) == -1)
         {     
		   //listitems[i].style.backgroundColor = 'yellow';  
		   listitems[i].style.display = "none";
         }   
		if (listitems[i].parentNode.innerHTML.indexOf(file, 1) != -1)
         {			    	
		   //listitems[i].style.backgroundColor = 'white';  
		   listitems[i].style.display = "block";
		 }
      }
	  var listitems = objNavmenu.getElementsByTagName('a');
      
	  //document.write('path2:' + path2 + '<br />');
	  //document.write('path3:' + path3 + '<br />');
	  
	  for (var i=0; i<listitems.length; i++)
      {		
	  
         if ((listitems[i].href.indexOf(path3 + separator + file, 1) != -1) && (listitems[i].href.indexOf(path3) != -1))
         {      
		   // colour the link to current page
           listitems[i].style.backgroundColor = "#FEE6CA";
		   listitems[i].style.display = "block";
		   listitems[i].style.fontWeight = "bold";
		   listitems[i].style.margin = "0";
		  // document.write(listitems[i].href.indexOf('..') + '<br />');
		  /* document.write(listitems[i].href + '<br />');
		   document.write(file + '<br />');
		   document.write(path + '<br />');
   		   document.write(path2 + '<br />');
		   document.write(path3 + '<br /><br />');*/
         }      
      }
   }
}

function initmenu()
{
 // closeall();
 // showCurrentSection();
 HideNoneMatches()
}
