
    // Показывает подменю производителей
    function ShowPodmenuBistro(id)
    {
        $("#mp_mother"+id).show();
        $("#img_mp_mother"+id).attr('src','/i/sd.gif');
    }


    // АВТО КОМПАНИИ
    function AutoGetPodmenuCompany(level, l, r, id, i, c)
    {
        var level, l, r, id, i, c;

            $.ajax({
               type: "GET",
               url: "/menutwo.php?ajax=getmenuc&level="+level+"&l="+l+"&r="+r+"&id="+id+"&c="+c,
               
               success: function(msg){
                    $("#mc"+id).html(msg);
                    $("#mc"+id).show();
                    $("#img_mc"+id).attr('src','/i/sd.gif');
                    i = i + 5;
                    GetNextMenu(i);
               },
               error: function() {

               }
             });
        
    }
    
    // АВТО ПРОИЗВОДИТЕЛИ
    function AutoGetPodmenuProizvod(level, l, r, id, i, s, c)
    {
            var level, l, r, id, i, s, c;
        
            $.ajax({
               type: "GET",
               url: "/menutwo.php?ajax=getmenup&level="+level+"&l="+l+"&r="+r+"&id="+id+"&s="+s+"&c="+c,
               
               success: function(msg){
                    $("#mp"+id).html(msg);
                    $("#mp"+id).show();
                    $("#img_mp"+id).attr('src','/i/sd.gif');
                    i = i + 6;
                    GetNextMenu(i);
               },
               error: function() {
                 
               }
             });
        
    }
    
    // АВТО ДОКУМЕНТЫ
    function AutoGetPodmenuDoc(level, l, r, id, i, doc)
    {
        var level, l, r, id, i, doc;

            $.ajax({
               type: "GET",
               url: "/menutwo.php?ajax=getmenudoc&level="+level+"&l="+l+"&r="+r+"&id="+id+"&doc="+doc,
               
               success: function(msg){
                    $("#mc"+id).html(msg);
                    $("#mc"+id).show();
                    $("#img_mc"+id).attr('src','/i/sd.gif');
                    i = i + 5;
                    GetNextMenu(i);
               },
               error: function() {

               }
             });
        
    }

    // Показывает подменю производителей
    function ShowMe(name)
    {
        var name;
        //alert(name);
        if (name=="proizvod")
        {
            $("#companies").hide();
            $("#proizvod").show();
            $("#view_menu1").show();
            $("#view_menu2").hide();
        }
        else if (name=="companies")
        {
            $("#proizvod").hide();
            $("#companies").show();
            $("#view_menu1").hide();
            $("#view_menu2").show();
        }
    }
    
    // Показывает подменю производителей
    function ShowPodmenu(id)
    {
        if ($("#mp_mother"+id).css('display') == "block")
        {
            $("#mp_mother"+id).hide();
            $("#img_mp_mother"+id).attr('src','/i/minus.gif');
        }
        else
        {
            $("#mp_mother"+id).show();
            $("#img_mp_mother"+id).attr('src','/i/sd.gif');
        }
    }


    // ВЫТАСКИВАЕМ КОМПАНИИ
    function GetPodmenuCompany(level, l, r, id, c)
    {
        var level,l,r,id, c;
        if ($("#mc"+id).css('display') == "block")
        {
            $("#mc"+id).hide();
            $("#img_mc"+id).attr('src','/i/minus.gif');
        }
        else
        {
            $("#loading").ajaxStart(function(){
                $(this).html('Пожалуйста, подождите...');
             });
            
            $.ajax({
               type: "GET",
               url: "/menutwo.php?ajax=getmenuc&level="+level+"&l="+l+"&r="+r+"&id="+id+"&c="+c,
               
               success: function(msg){
                    //alert(msg);
                    $("#mc"+id).html(msg);
                    $("#mc"+id).show();
                    $("#img_mc"+id).attr('src','/i/sd.gif');
                    $("#loading").html('...');
               },
               error: function() {
                 $("#loading").html('Ошибка обработки запроса!');
               }
             });
        }
    }
    
    function GetPodmenuProizvod(level, l, r, id, s, c)
    {
        var level,l,r,id,s,c;
        if ($("#mp"+id).css('display') == "block")
        {
            $("#mp"+id).hide();
            $("#img_mp"+id).attr('src','/i/minus.gif');
        }
        else
        {
            $("#loading").ajaxStart(function(){
                $(this).html('Пожалуйста, подождите...');
             });
            
            $.ajax({
               type: "GET",
               url: "/menutwo.php?ajax=getmenup&level="+level+"&l="+l+"&r="+r+"&id="+id+"&s="+s+"&c="+c,
               
               success: function(msg){
                    //alert(msg);
                    $("#mp"+id).html(msg);
                    $("#mp"+id).show();
                    $("#img_mp"+id).attr('src','/i/sd.gif');
                    $("#loading").html('...');
               },
               error: function() {
                 $("#loading").html('Ошибка обработки запроса!');
               }
             });
        }
    }
    
    
    
    // ВЫТАСКИВАЕМ КОМПАНИИ
    function GetPodmenuDoc(level, l, r, id, doc)
    {
        var level,l,r,id, doc;
        if ($("#mc"+id).css('display') == "block")
        {
            $("#mc"+id).hide();
            $("#img_mc"+id).attr('src','/i/minus.gif');
        }
        else
        {
            $("#loading").ajaxStart(function(){
                $(this).html('Пожалуйста, подождите...');
             });
            
            $.ajax({
               type: "GET",
               url: "/menutwo.php?ajax=getmenudoc&level="+level+"&l="+l+"&r="+r+"&id="+id+"&doc="+doc,
               
               success: function(msg){
                    //alert(msg);
                    $("#mc"+id).html(msg);
                    $("#mc"+id).show();
                    $("#img_mc"+id).attr('src','/i/sd.gif');
                    $("#loading").html('...');
               },
               error: function() {
                 $("#loading").html('Ошибка обработки запроса!');
               }
             });
        }
    }
    
