function CallbackForSheetButton(nCount)
  flags.is_hidden_loc = false;
  jump("kucha","secret_room",7,0);        
end;

function LevelComplete()
	if not flags.blockrender then
    Block_Show_Cur(true);
   StartTimer(8881,1);
   hidden_finished=true 
   end;
return; end;

function SelectRandom()
  idObject=GetRandomObject();
  c=GetActivCount();
  if idObject==-1 then
      if c~=0 then SelectRandom() return;
      else

      return;end;
  end;  
  if obj.loditr~=nil and idObject==obj.loditr.id then selectrandomobjectus(1.5,obj.rapsol.id); return;end;
  if obj.maslen~=nil and idObject==obj.maslen.id then selectrandomobjectus(1.5,obj.klky.id); return;end;   
  selectrandomobjectus(1.5,idObject);
return;end;

function ActionsJump ()
    
end;

function gameinput (sender,obj_id,attachedID)
  if sender == 1 then    
    if obj_id > 0 and obj_id < 1000000104 then --кликаем на активный объект
      playeffect("collaps")
      dropped_obj = dropped_obj + 1;
      CollapseObj(obj_id);
      if obj.rapsol~=nil and obj_id==obj.rapsol.id then
        RemoveActivObject(obj.loditr.id)
        obj.loditr.is_removed=true
      end
      if obj.klky~=nil and obj_id==obj.klky.id then
        RemoveActivObject(obj.maslen.id)
        obj.maslen.is_removed=true
      end          
    return; end
  return ;end;
  

  
  if sender == 12 then
       if not flags.hidden6 then

        if obj.tabl.is_collapsed and obj.pika.is_collapsed and obj.pava.is_collapsed and
        obj.gest.is_collapsed and obj.luna.is_collapsed and obj.almaz.is_collapsed and
        obj.syr.is_collapsed and obj.gezl.is_collapsed and obj.gaba.is_collapsed and
        obj.krbl.is_collapsed and obj.top38.is_collapsed and obj.klky.is_collapsed and    
        obj.klesh.is_collapsed and obj.luk.is_collapsed and obj.rama.is_collapsed
        then
                  Block_Show_Cur(true);
            if not hidden_finished then
                StartTimer(8881,1);
            end;
            hidden_finished=true  
        end;
      return; end; 
       if flags.hidden6 then
        if obj.serok.is_collapsed and obj.pudok.is_collapsed and obj.socks.is_collapsed and
        obj.rapsol.is_collapsed and obj.masik.is_collapsed and obj.regki.is_collapsed and
        obj.pivko.is_collapsed and obj.ochkol.is_collapsed and obj.posohu.is_collapsed and
        obj.dragon.is_collapsed and obj.kakawo.is_collapsed and obj.idltr.is_collapsed and    
        obj.batyj.is_collapsed and obj.vngrsk.is_collapsed and obj.perga.is_collapsed
        then
            Block_Show_Cur(true);
            if not hidden_finished then
                StartTimer(8881,1);
            end;
            hidden_finished=true  
        end;
      return; end;       
  return; end;
  
  if sender==36 then
    if obj_id == 8881 then
    playeffect("hidenend")
      if not flags.hidden6 then
        Block_Show_Cur(false);
        if obj.maslen~=nil then
           StoreObj(obj.maslen.id,nil,"294",335,350,"maslo",318,209)
        end;
      return; end;
      if flags.hidden6 then
        Block_Show_Cur(false);
        if obj.loditr~=nil then
            StoreObj(obj.loditr.id,nil,"488",335,360,"idol1",318,224)    
        end;
      return; end;
    return; end;

  return; end;
  if sender == 50 then
    WaitRender();
  return; end;
  if sender == 100 then    
  BlockCursor(false)
  if hidden_finished then
    flags.is_hidden_finish=true

    if flags.hidden6 then      
      flags.is_hidden_loc = false;
      neighbors.kucha.lock=true;
 
      SetDrawSheet("re",false);

      
      jump("kucha","secret_room",7,0);
      StopEmiter("kucha");
        
      flags.hidden_kucha_two = true;

      dropped_obj = 0;
    return; end;
    if not flags.hidden6 then

      flags.is_hidden_loc = false;
      neighbors.kucha.lock=true;
      jump("kucha","secret_room",7,0);
      StopEmiter("kucha");
      -- ActivateObject(35,false);
      -- Set_Anim_Cur(35,3);
      flags.hidden6 = true;
      flags.help_kucha = true;    
      SetDrawSheet("re",false);

      dropped_obj = 0;
    return; end;
  return; end; 
  return; end;
end
function SheetSwitched(nCount)
end;