    var curIdCat = 0;
    var strIdCat = ""; 
    
    function lm_go_cat(idCat){
             document.location = "?id_categories="+idCat+"&str_id_categories="+strIdCat;
    }
    
    function lm_write_parent(idMass){
             document.write('<Table CellPadding=0 CellSpacing=0 Border=0 Width=100% class=titrazdblue '+
                            ' onMouseOver="this.style.textDecoration=\'underline\';"'+
                            ' onMouseOut="this.style.textDecoration=\'none\';"'+
                            ' onClick="lm_write_child('+massleftmenu[idMass][1]+');"'+
                            '>'+
                            '<Tr Valign=top>'+
                            '<Td Width=24 BgColor=#DADADA><Img Src="images/leftbullet.gif" Width=24 Border=0 Alt""></Td>'+
                            '<Td Width=1 BgColor=#C2C2C2><Img Src="images/pixel.gif" Border=0 Width=1></Td>'+
                            '<Td Width=1 BgColor=#F7F7F7><Img Src="images/pixel.gif" Border=0 Width=1></Td>'+
                            '<Td BgColor=#');
                            
             if(massleftmenu[idMass][1] == curIdCat) document.write('FFDE7D style="cursor:hand;color:#FF2500;padding:5px;"'); 
             else document.write('E6E6E6 style="cursor:hand;padding:5px;"');               
             
             document.write('>'+massleftmenu[idMass][2]+'</Td>'+
                            '</Tr>');
             document.write('<Tr Height=1><Td BgColor=#CCCCCC ColSpan=4><Img Src="images/pixel.gif" Border=0 Width=1></Td></Tr></Table><span id="child'+massleftmenu[idMass][1]+'"></span>');
    }
    
    function lm_write_all_child(){
             
             if(strIdCat == "") return false;
             
             promStrIdCat = strIdCat.replace(/-/gi, "'"); 
             
             eval("promMass = new Array("+promStrIdCat.substring(0,promStrIdCat.length-1)+");");
             for(j = 0; j < promMass.length; j++){
                 lm_write_child(promMass[j]);
             }
    }
    
    function lm_write_child(idParent){
             
             promStr = "";
             if(document.getElementById("child"+idParent).innerHTML != ""){
                document.getElementById("child"+idParent).innerHTML = promStr;
                eval("strIdCat = strIdCat.replace(/-"+idParent+"-,/gi, \"\");");
                
                return false;
             }
                
             for(k = 0; k < massleftmenu.length; k++){
                 if(massleftmenu[k][0] == idParent){
                    promStr += ('<Table CellPadding=0 CellSpacing=0 Border=0 Width=100% class=titrazd'+
                                ' onMouseOver="this.style.textDecoration=\'underline\';"'+
                                ' onMouseOut="this.style.textDecoration=\'none\';"'+
                                ' onClick="lm_go_cat('+massleftmenu[k][1]+');"'+
                                '><Tr Height=1><Td BgColor=#EEEEEE ColSpan=4><Img Src="images/pixel.gif" Border=0 Width=1></Td></Tr>'+
                                '<Tr Valign=top>'+
                                '<Td Width=24 BgColor=#DADADA><Img Src="images/pixel.gif" Border=0 Width=24 Height=1></Td>'+
                                '<Td Width=1 BgColor=#C2C2C2><Img Src="images/pixel.gif" Border=0 Width=1></Td>'+
                                '<Td Width=1 BgColor=#F7F7F7><Img Src="images/pixel.gif" Border=0 Width=1></Td>'+
                                '<Td BgColor=#');
                              
                     if(massleftmenu[k][1] == curIdCat) promStr += 'FFDE7D style="cursor:hand;padding:3px;padding-left:10px;color:#FF2500;"'; 
                     else promStr += 'F9F9F9 style="cursor:hand;padding:3px;padding-left:10px;"';
                     
                     promStr += (' ><small>'+massleftmenu[k][2]+'</small></Td>'+
                                 '</Tr></Table>');
                     
                              
                 }   
              }
              if(promStr == ""){
                 lm_go_cat(idParent);
              } else {
                 eval("strIdCat = strIdCat.replace(/-"+idParent+"-,/gi, \"\");");
                 strIdCat += "-"+idParent+"-,"; 
                 document.getElementById("child"+idParent).innerHTML = promStr;            
              }   
    }