function CallbackForSheetButton(nCount)
  flags.is_hidden_loc = false;
  jump("chulan","john_house",11,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.lodifv~=nil and idObject==obj.lodifv.id then selectrandomobjectus(1.5,obj.idlfv.id); return;end;
  if obj.sovok~=nil and idObject==obj.sovok.id then selectrandomobjectus(1.5,obj.lesnt.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.idlfv~=nil and obj_id==obj.idlfv.id then
        RemoveActivObject(obj.lodifv.id)
        obj.lodifv.is_removed=true
      end
      if obj.lesnt~=nil and obj_id==obj.lesnt.id then
        RemoveActivObject(obj.sovok.id)
        obj.sovok.is_removed=true
      end          
    return; end
  return ;end;
    
  if sender == 12 then
       if not flags.hidden_chulan then

        if obj.skrpa.is_collapsed and obj.uda.is_collapsed and obj.perec.is_collapsed and
        obj.varan.is_collapsed and obj.annas.is_collapsed and obj.percha.is_collapsed and
        obj.gorsh.is_collapsed and obj.gyrky.is_collapsed and obj.ptel.is_collapsed and
        obj.lesnt.is_collapsed and obj.rktko.is_collapsed and obj.kstrl.is_collapsed and    
        obj.korza.is_collapsed and obj.svitk.is_collapsed and obj.shlem.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_chulan then
        if obj.podsak.is_collapsed and obj.altem.is_collapsed and obj.sotol.is_collapsed and
        obj.nebub.is_collapsed and obj.kovos.is_collapsed and obj.idlfv.is_collapsed and
        obj.gryzan.is_collapsed and obj.kijak.is_collapsed and obj.lodec.is_collapsed and
        obj.kstjh.is_collapsed and obj.obolon.is_collapsed and obj.krutoo.is_collapsed and    
        obj.tarea.is_collapsed and obj.merins.is_collapsed and obj.izobil.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_chulan then
        Block_Show_Cur(false);
        if obj.sovok~=nil then
            StoreObj(obj.sovok.id,nil,"180",335,350,"sovok",332,260)
        end;
      return; end;
      if flags.hidden_chulan then
        Block_Show_Cur(false);
        if obj.lodifv~=nil then
            StoreObj(obj.lodifv.id,nil,"488",335,360,"idol1",317,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_chulan then      
      flags.hidden_chulan_two = true;    
      flags.is_hidden_loc = false;
      neighbors.chulan.lock=true;
      jump("chulan","john_house",11,0);
      SetDrawSheet("re",false);


      StopEmiter("chulan");
      dropped_obj = 0;
    return; end;
    if not flags.hidden_chulan then

      flags.hidden_chulan = true;    
      flags.is_hidden_loc = false;
      neighbors.chulan.lock=true;
      jump("chulan","john_house",11,0);
      SetDrawSheet("re",false);

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