
/*/
function clickOpenMenu(famId){
    /*
    if(document.getElementById('pai-' + famId).style.display == 'none'){
        document.getElementById('pai-' + famId).style.display = '';
    }else{
        document.getElementById('pai-' + famId).style.display = 'none';
    }
 * /
    
    var famiId = famId;
    
    $.getJSON("menu.abreMenu.ajax.logic", { id: famId},function(json){
        
        if(json.tamanhoFilhos == 0){
            self.location="produto.pesquisaPorCategoria.logic?id=" + famiId;
        }
        else{
            var html = '';
            html += "<table width='100%' border='0' cellpadding='5' cellspacing='0'>";
            
            for(i = 0; i< json.tamanhoFilhos; i++){
              html += "<tr><td width='4' class='bgMenuEsquerdoOut'>&nbsp;</td>" + 
                "<td class='bgMenuEsquerdoOut'onMouseOver='this.className='bgMenuEsquerdoOver';" +
                   "onMouseOut='this.className='bgMenuEsquerdoOut';'" +
                   "onClick='location.href='produto.pesquisaPorCategoria.logic?id=" + json.filhos[i].id + ";" + 
                    "</td>" +  json.filhos[i].nome +"</tr>";
            }
            html += "</table>";
            
            $('#pai-' + famId).html(html);
            }
            
    });

}


 */


function clickOpenMenu(famId){
  
  var div = "#pai-" + famId;
  famI = famId;
  
  if(document.getElementById('pai-' + famId).className == 'abrir'){
      $.ajax({
          url: "menu.abreMenu.logic",
          type: 'post',
          data: "id=" + famId,
                  
          success: function(msg)
          {
              $(div).html(msg);
              
              document.getElementById('pai-' + famId).className = 'fechar';
          }
      });
  }
  else{
      $(div).html('');
      document.getElementById('pai-' + famId).className = 'abrir';
  }
}















/*

//dezutilizado - takeda
$(document).ready(function(){
$("a.menu").click(function () {
    famId = this.id;
    if(document.getElementById('pai-' + famId).style.display == 'none'){
        document.getElementById('pai-' + famId).style.display = '';
    }else{
        document.getElementById('pai-' + famId).style.display = 'none';
    }
});
});
*/


