function ShowHideChildItems(listItem, state)
{
    if(listItem){
        if(listItem.tagName == "LI"){
          var item_id = listItem.id.substr(4);
          var child_ul = document.getElementById('subnavigatie'+item_id);
          var current_li = '';
          
          //collapse all items in corresponding menu
          var parent_node = listItem.parentNode;
          for(i=0;i<=parent_node.childNodes.length-1;i++){
            current_li = parent_node.childNodes[i];
            for(j=0;j<=current_li.childNodes.length-1;j++){
              //console.log(current_li.childNodes[j].tagName);
              if(current_li.childNodes[j].tagName == "UL"){
                current_li.childNodes[j].style.display = 'none'
              }
            }
          }
          
          if(child_ul){
            if(typeof state != 'undefined'){
              if(state == 'block' || state == 'none'){
                child_ul.style.display = state;
              }
            }else{
              if(child_ul.style.display == '' || child_ul.style.display == 'block'){
                child_ul.style.display = 'none';
                return;
              }else{
                child_ul.style.display = 'block';
                return;
              }
            }
          }
        }
    }
}
