function CallbackForSheetButton(nCount)
  flags.is_hidden_loc = false;
  jump("garderob","mayor_house",8,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
    --  WriteToConsole("No activ objects \n")
      return;end;
  end;  
  if obj.shstr1~=nil and idObject==obj.shstr1.id then selectrandomobjectus(1.5,obj.shstrk.id); return;end;
  if obj.kamen~=nil and idObject==obj.kamen.id then selectrandomobjectus(1.5,obj.prbkr.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.shstrk~=nil and obj_id==obj.shstrk.id then
        RemoveActivObject(obj.shstr1.id)
        obj.shstr1.is_removed=true
      end
      if obj.prbkr~=nil and obj_id==obj.prbkr.id then
        RemoveActivObject(obj.kamen.id)
        obj.kamen.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 not flags.hidden_garderob then

        if obj.vorob.is_collapsed and obj.peresh.is_collapsed and obj.pesoch.is_collapsed and
        obj.kist.is_collapsed and obj.sgra.is_collapsed and obj.rulet.is_collapsed and
        obj.jajco.is_collapsed and obj.prbkr.is_collapsed and obj.glob.is_collapsed and
        obj.pomad.is_collapsed and obj.roga.is_collapsed and obj.buling.is_collapsed and    
        obj.brosh.is_collapsed and obj.binok.is_collapsed and obj.ranec.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_garderob then
        if obj.paucha.is_collapsed and obj.saku.is_collapsed and obj.kabele.is_collapsed and
        obj.shstrk.is_collapsed and obj.papkab.is_collapsed and obj.plechy.is_collapsed and
        obj.fara.is_collapsed and obj.ramych.is_collapsed and obj.popuga.is_collapsed and
        obj.sharf.is_collapsed and obj.darts.is_collapsed and obj.zontb.is_collapsed and    
        obj.konina.is_collapsed and obj.kleta.is_collapsed and obj.hlyst.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 not flags.hidden_garderob then
        if obj.kamen~=nil then
        StoreObj(obj.kamen.id,nil,"152",335,350,"kamen",247,300)        
        end;
      return; end;
      if flags.hidden_garderob then
        if obj.shstr1~=nil then
        StoreObj(obj.shstr1.id,nil,"250",285,350,"shesterenka",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 flags.hidden_garderob then
      flags.hidden_garderob_two = true;
    end;
    if not flags.hidden_garderob then
      flags.hidden_garderob = true;
    end;    
    flags.is_hidden_loc = false;
    neighbors.garderob.lock = true;
    jump("garderob","mayor_house",8,0);
    SetDrawSheet("re",false);


    StopEmiter("garderob");
    dropped_obj = 0;
  return; end;
  return; end;
end
function SheetSwitched(nCount)
end;