function CallbackForSheetButton(nCount)
  flags.is_hidden_loc = false;
  jump("metall","vhod_turmy",13,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.gaga~=nil and idObject==obj.gaga.id then selectrandomobjectus(1.5,obj.gaag.id); return;end;
  if obj.predo~=nil and idObject==obj.predo.id then selectrandomobjectus(1.5,obj.preod.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.gaag~=nil and obj_id==obj.gaag.id then
        RemoveActivObject(obj.gaga.id)
        obj.gaga.is_removed=true
      end
      if obj.preod~=nil and obj_id==obj.preod.id then
        RemoveActivObject(obj.predo.id)
        obj.predo.is_removed=true
      end      
    return; end
  return ;end;
 
  if sender == 12 then
       if  flags.hidden_metall then

        if obj.mltko.is_collapsed and obj.sverl.is_collapsed and obj.shtpr.is_collapsed and
        obj.lupen.is_collapsed and obj.butyl.is_collapsed and obj.lukas.is_collapsed and
        obj.avok.is_collapsed and obj.duck.is_collapsed and obj.dolly.is_collapsed and
        obj.fakl.is_collapsed and obj.preod.is_collapsed and obj.kakts.is_collapsed and    
        obj.drot.is_collapsed and obj.ogcha.is_collapsed and obj.gnezd.is_collapsed
        then
                  Block_Show_Cur(true);
            if not hidden_finished then
                StartTimer(8881,1);
            end;
            hidden_finished=true  
        end;
      return; end; 
       if not flags.hidden_metall then
        if obj.china.is_collapsed and obj.plchk.is_collapsed and obj.klsha.is_collapsed and
        obj.diktor.is_collapsed and obj.gaag.is_collapsed and obj.fnrko.is_collapsed and
        obj.sony.is_collapsed and obj.tmgvk.is_collapsed and obj.karkar.is_collapsed and
        obj.glas.is_collapsed and obj.egik.is_collapsed and obj.batyn.is_collapsed and    
        obj.metyr.is_collapsed and obj.zubec.is_collapsed and obj.kosar.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")
      Block_Show_Cur(false);
      if  flags.hidden_metall then
        if obj.predo~=nil then
            StoreObj(obj.predo.id,nil,"330",285,350,"probka",323,217)
        end;
      return; end;
      if not flags.hidden_metall then
          if obj.gaga~=nil then
            StoreObj(obj.gaga.id,nil,"101",285,350,"zagig",323,217)
          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 not flags.hidden_metall then
     flags.hidden_metall = true;  
      
      flags.is_hidden_loc = false;
      RemObjFromMouse()      
      jump("metall","vhod_turmy",13,0);
      SetDrawSheet("re",false);
      StopEmiter("rubka");
      dropped_obj = 0;
    return; end;
    if  flags.hidden_metall then
       flags.hidden_metall_dwa = true;    
      flags.is_hidden_loc = false;
      RemObjFromMouse()       
      jump("metall","vhod_turmy",13,0);
      SetDrawSheet("re",false);
      StopEmiter("rubka");
      dropped_obj = 0;
    return; end;
  return; end;
  return; end;
end
function SheetSwitched(nCount)
end;