function highlightmenu(selector,value){
 current_file_name = location.pathname.substring(location.pathname.lastIndexOf('/') + 1,location.pathname.length);
 paths = location.href.split('/');
 var menus = $$(selector);
 menus.each(
  function(element){
    var href = element.getAttribute('href');
	if(!isExternalLink(href)){
    var file = href.substring(href.lastIndexOf('/') + 1,href.length);
    if(current_file_name != '' && current_file_name == file){
	  element.setAttribute('id',value);   
    } else {
	  if(current_file_name == '' && file == 'index.html'){
		  element.setAttribute('id',value);
	  }
	}
	//match directory
	//file to target dir
	target_dir = file.substring(0,file.lastIndexOf('.'));
	if(paths.indexOf(target_dir) >-1){
      element.setAttribute('id',value);
	}
	}
  }
 );
 function isExternalLink(href){
    paths = location.href.split('/');
	if( href.startsWith('http') && href.indexOf(paths[2]) == -1){
		return true;}
	return false;
//	 tmp = href.split('/');
//	 for(var i=0;i < 3;i++){
//	  tmp.shift();
//	 }
//	 href = tmp.join('/');
//	 externalLinkFlg = true;
 }
};

$(document).ready(function() {
  $("#footer li+li")
  .css("border-left","#fff 1px solid")
  .css("padding","0 0 0 1em")
})

