function CallbackForSheetButton(nCount)
  flags.is_hidden_loc = false;
  jump("veshalka","holl",1,0);        
end;

function LevelComplete()
  -- dropped_obj = 15;
  -- collaps_obj(GetRandomObject(), 0, 0, 0, 0);
  	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.tvrtk~=nil and idObject==obj.tvrtk.id then selectrandomobjectus(1.5,obj.tvrtk1.id); return;end;
  if obj.molot~=nil and idObject==obj.molot.id then selectrandomobjectus(1.5,obj.molto.id); return;end;    
  selectrandomobjectus(1.5,idObject);
return;end;

function ActionsJump ()
    
end;
function gameinput (sender,obj_id,attachedID)
    WriteToConsole("sender = "..sender.."\n")
  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.tvrtk1~=nil and obj_id==obj.tvrtk1.id then
        RemoveActivObject(obj.tvrtk.id)
        obj.tvrtk.is_removed=true
      end
      if obj.molto~=nil and obj_id==obj.molto.id then
        RemoveActivObject(obj.molot.id)
        obj.molot.is_removed=true
      end          
    return; end
  return ;end;
  
  -- if sender == 4 then
    -- Block_Show_Cur(true);
    -- StartTimer(1,1.5);
  -- return; end;
  
  if sender == 12 then
   -- if dropped_obj == 15 then
    if  (not flags.hidden2) and obj.apple.is_collapsed and obj.shpaga.is_collapsed and obj.kulon.is_collapsed and obj.batary.is_collapsed and obj.teddy.is_collapsed and
        obj.tarak.is_collapsed and obj.bananas.is_collapsed and obj.galst.is_collapsed and obj.plasta.is_collapsed and
        obj.venik.is_collapsed and obj.zont.is_collapsed    and obj.dollar.is_collapsed and obj.heart.is_collapsed and 
        obj.veer.is_collapsed  and obj.molto.is_collapsed     
    then
      Block_Show_Cur(true);
            if not hidden_finished then
                StartTimer(8881,1);
            end;
            hidden_finished=true  
    return; end;
    if  (flags.hidden2 and not flags.hidden5) and obj.chash.is_collapsed and obj.plasch.is_collapsed and obj.ramka.is_collapsed and obj.garmo.is_collapsed and obj.tvrtk1.is_collapsed and
        obj.sharb.is_collapsed and obj.topor.is_collapsed and obj.mouse.is_collapsed and obj.rasch.is_collapsed and
        obj.svecha.is_collapsed and obj.baboch.is_collapsed    and obj.cepy.is_collapsed and obj.kopil.is_collapsed and 
        obj.miha.is_collapsed  and obj.ventil.is_collapsed     
    then
      Block_Show_Cur(true);
            if not hidden_finished then
                StartTimer(8881,1);
            end;
            hidden_finished=true  
    return; end;    
  return; end;
  
  if sender==36 then
    if obj_id == 8881 then
      WriteToConsole("flags = "..tostring(flags.hidden2).."\n")
      neighbors.veshalka.lock=true;
      playeffect("hidenend")     
      if not flags.hidden2 then
        Block_Show_Cur(false);    
        if obj.molot~=nil then
            StoreObj(obj.molot.id,nil,"45",335,350,"molotok",280,220)
        end;
      return; end;
      if flags.hidden2 and not flags.hidden5 then
        Block_Show_Cur(false);
        if obj.tvrtk~=nil then
            StoreObj(obj.tvrtk.id,nil,"134",335,350,"otvertka",266,222)
        end;
      return; end;
    return; end;

  return; end;
  if sender == 50 then

    WriteToConsole("HIDDEN FINISHED \n")
    WaitRender();
  return; end;
  if sender == 100 then 
  BlockCursor(false)
  if hidden_finished then
    
      if flags.hidden2 then
        
    --    StoreObj(obj.tvrtk.id);
        
        flags.help_otvertka = true;
        flags.hidden5 = true;
      end;
      if not flags.hidden2 then
        flags.hidden2 = true;
      end;          
      flags.is_hidden_loc = false;
      flags.is_hidden_finish=true;
      neighbors.veshalka.lock=true;
      jump("veshalka","holl",1,0);
        
  --    ShowSheet("gr","move",1000);
      
      SetDrawSheet("re",false);
      -- SetDrawSheet("gr",true);
      flags.help_veshalka = true;
    
      
      StopEmiter("veshalka");
      dropped_obj = 0;
  return; end;
  return; end;
end
function SheetSwitched(nCount)
end;