	       var rez_id;
           var content_div;
           
           var max_img_width = 440;
           var max_img_height = 400;
           
           var max_tmb_width = 80;
           var max_tmb_height = 80;
           
           var selected_product;
           var imageObj = new Array;
           
           function showImages(cod_clas, all_menus){
               var menus = all_menus;
               var arrMenus = menus.split(",");
               
               var ie=document.all;
               var ns6=document.getElementById && !document.all;            
                        
	           for(var mymenu=0; mymenu < arrMenus.length; mymenu++){
	               var index_obj = "00" + arrMenus[mymenu];
	               var nume_obj = "menu_"+index_obj.substr(index_obj.length-2, 2);

                   //nume_obj = "menu_04";
                   
                   //alert (nume_obj);
                   
                   if (ie||ns6)  var menuobj=document.all? document.all[nume_obj] : document.getElementById? document.getElementById(nume_obj) : "";
                   
                   menuobj.className="normal";
                   if(arrMenus[mymenu] == cod_clas)menuobj.className="selected";
                   
                   //document.getElementById(nume_obj).setAttribute("class", "normal");
                   //if(arrMenus[mymenu] == cod_clas)document.getElementById(nume_obj).setAttribute("class", "selected");
	           }
               
               resetRight();
                             
               rez_id = colectIdSir(cod_clas, arr_cat);
               return drawThumbs(rez_id, 8, 2);
                       
	       }
//-----
            function colectIdSir(cod, sir){
                
               var sir_content;
               var ret_value = "";
               for( var id in sir ){
                 sir_content = sir[id];
                 if(sir_content.indexOf(cod)!=-1)ret_value += "," + id;
               } 
               return ret_value.substr(1);
            } 
            
//----- Functia de desenare thumbs
            function drawThumbs(sir_ids, nr_lins, nr_cols){
                
       
                if(sir_ids == "") return "<div id='no_prod'>Nu exista produse la aceasta categorie</div>";
                var content_div;
                arr_sir_ids = sir_ids.split(",");
                
       
//======
                var oImg = new Image();
                var rap_redim; 
                
                content_div = "<table cellspacing='10' border='0' width='100%'><tr>";
                var nr_l = 1;
                for( var i=0; i < arr_sir_ids.length; i++ ){
                    oImg.src = "images/gallery/"+arr_img[arr_sir_ids[i]];
                    
                    new_tmb_height = max_tmb_height;
                    new_tmb_width = max_tmb_width;  
                
                    pausecomp(250);
           
                    if(oImg.complete){
                        
                        var iw = oImg.width;
                        var ih = oImg.height;
                    
                        if(iw >= ih){
                            if(iw > max_tmb_width) rap_redim = max_tmb_width/iw;
                            else rap_redim = 1;
                        }
                        if(iw < ih){
                            if(ih > max_tmb_height) rap_redim = max_tmb_height/ih;
                            else rap_redim = 1;
                        }
                        new_width = iw * rap_redim;
                        new_height = ih * rap_redim;
                    
                        padd_tb = (max_tmb_height - new_height ) / 2;
                        padd_lr = (max_tmb_width - new_width ) / 2;  
                    
                    
                    
                    content_div += "<td align='center' style='padding-bottom: 15px;'>";
                    
                    content_div += "<div onmouseover='fadeObj(0.5, 1.0, \"img_"+arr_sir_ids[i]+"\")' onmouseout='fadeObj(1.0, 0.5, \"img_"+arr_sir_ids[i]+"\")' onclick='loadData(\""+arr_sir_ids[i]+"\")' style='width:"+max_tmb_width+"px;height:"+max_tmb_height+"px;border:1px Solid Gray;background-color:#ffffff;'>";
                    content_div += "<img id='img_"+arr_sir_ids[i]+"' class='thumb_nsel', src='"+oImg.src+"' alt='"+arr_tit[arr_sir_ids[i]]+"' style='width:"+new_width+"px;height:"+new_height+"px;margin-top:"+padd_tb+";margin-bottom:"+padd_tb+"px;margin-left:"+padd_lr+"px;margin-right:"+padd_lr+";'>";
                    content_div += "</div>";
                    content_div += "</td>";
                    if(((i+1)%nr_cols)==0) { content_div += "</tr><tr>"; nr_l++; }
                    
                    }
                }
                content_div += "</tr></table>";
                return content_div;
                
            }
//--------------------------------        

            function fadeObj(from_a, to_a, obj_id){         // from_a = 0.0 ... 1.0     to_a = 0.0 ... 1.0
            
                var a; 
            
                if(from_a > to_a)
                for (a = from_a; a >= to_a; a-=0.1){
                    xp = a * 100;
                    document.getElementById(obj_id).style.opacity = a;
                    document.getElementById(obj_id).style.filter = 'alpha(opacity='+xp+');';
                    pausecomp(10);
                }
                
                if(from_a <= to_a)
                for (a = from_a; a <= to_a; a+=0.1){
                    xp = a * 100;
                    document.getElementById(obj_id).style.opacity = a;
                    document.getElementById(obj_id).style.filter = 'alpha(opacity='+xp+');';
                    pausecomp(10);
                }
                
                //alert(a+" - "+xp + " - "+step_a);
                 
            }   
            
//-------------------
            function pausecomp(millis)
            {
            var date = new Date();
            var curDate = null;
            
            do { curDate = new Date(); }
            while(curDate-date < millis);
            } 

//-------------------
                      
//=====================
            function toggleDiv(dtt){
               var ie=document.all;
               var ns6=document.getElementById && !document.all;            
             
               if (ie||ns6)  var dobj=document.all? document.all[dtt] : document.getElementById? document.getElementById(dtt) : "";
            
               
               if(dobj.style.display=='block')dobj.style.display='none';
               else dobj.style.display='block';
            }                                       
