function CallbackForSheetButton(nCount)
  flags.is_hidden_loc = false;
  jump("stulja","electro",19,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.lodit~=nil and idObject==obj.lodit.id then selectrandomobjectus(1.5,obj.idltwo.id); return;end;
  if obj.svetka~=nil and idObject==obj.svetka.id then selectrandomobjectus(1.5,obj.svetak.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.idltwo~=nil and obj_id==obj.idltwo.id then
        RemoveActivObject(obj.lodit.id)
        obj.lodit.is_removed=true
      end
      if obj.svetak~=nil and obj_id==obj.svetak.id then
        RemoveActivObject(obj.svetka.id)
        obj.svetka.is_removed=true
      end          
    return; end
  return ;end;
 
  if sender == 12 then
       if not flags.hidden_stulja then

        if obj.domka.is_collapsed and obj.sharov.is_collapsed and obj.havyc.is_collapsed and
        obj.palco.is_collapsed and obj.dudik.is_collapsed and obj.remash.is_collapsed and
        obj.musico.is_collapsed and obj.porka.is_collapsed and obj.ubork.is_collapsed and
        obj.motoco.is_collapsed and obj.gajok.is_collapsed and obj.kobura.is_collapsed and    
        obj.kegela.is_collapsed and obj.svetak.is_collapsed and obj.tapki.is_collapsed
        then
                  Block_Show_Cur(true);
            if not hidden_finished then
                StartTimer(8881,1);
            end;
            hidden_finished=true  
        end;
      return; end; 
       if flags.hidden_stulja then
        if obj.pikeec.is_collapsed and obj.ikzub.is_collapsed and obj.fuck.is_collapsed and
        obj.otsos.is_collapsed and obj.takoj.is_collapsed and obj.derzdo.is_collapsed and
        obj.pisto.is_collapsed and obj.podnik.is_collapsed and obj.kapore.is_collapsed and
        obj.gazok.is_collapsed and obj.abak.is_collapsed and obj.idltwo.is_collapsed and    
        obj.gudro.is_collapsed and obj.kapec.is_collapsed and obj.keron.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.hidden_stulja then
        Block_Show_Cur(false);
        if obj.svetka~=nil then
            StoreObj(obj.svetka.id,nil,"173",335,350,"fonar",276,241)
        end;
      return; end;
      if flags.hidden_stulja then
        Block_Show_Cur(false);
        if obj.lodit~=nil then
            StoreObj(obj.lodit.id,nil,"488",335,360,"idol1",320,223)
        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.hidden_stulja then      
      flags.hidden_stulja_two = true;    
      flags.is_hidden_loc = false;
      neighbors.stulja.lock=true;          

      jump("stulja","electro",19,0);
      SetDrawSheet("re",false);


      StopEmiter("stulja");
      dropped_obj = 0;
    return; end;
    if not flags.hidden_stulja then

      flags.hidden_stulja = true;    
      flags.is_hidden_loc = false;
      neighbors.stulja.lock=true;    
      jump("stulja","electro",19,0);
      SetDrawSheet("re",false);

      -- ActivateObject(6,false);
      -- Set_Anim_Cur(6,3);
      StopEmiter("stulja");
      dropped_obj = 0;
    return; end;
  return; end;
  return; end;
end
function SheetSwitched(nCount)
end;