window.onload = function() { 
    var categories = document.getElementById("categories").getElementsByTagName("a"),
        i=0, len=categories.length,
        full_path = location.href.split('#')[0];

    for(; i<len; i++) {
        if(categories[i].href.split("#")[0] == full_path) {
            categories[i].className += "selected";
        }
    }
    
    var breadcrumbs = document.getElementById("breadcrumbs").getElementsByTagName("a"),
            i=0, len=breadcrumbs.length,
            full_path = location.href.split('#')[0]; 
    
        for(; i<len; i++) {
            if(breadcrumbs[i].href.split("#")[0] == full_path) {
                $ ("#categories .comp").addClass ("selected");
            }
        }
}

//function toggleDiv(divid){
//  if(document.getElementById(divid).style.display == 'none'){
//    document.getElementById(divid).style.display = 'block';
//  }else{
//    document.getElementById(divid).style.display = 'none';
//  }
//}

function showandhide (selected) {
     $('div[name|="features"]').each(function(index) {
          if ($(this).attr("id") == selected) {
               $(this).show(200);
          }
          else {
               $(this).hide(200);
          }
     });
}
