local final_dop = 0;
function Buttons_T(sender,obj_id)
ButtonTreatment(obj_id,10001,10002,10003,CloseBtnX,CloseBtnY,34,34,sender,"john_house",false)     
end;


function gameinput (sender,obj_id,attachedID)    
CursorTreatment(obj_id,sender,attachedID); 
Buttons_T(sender,obj_id)   

  if sender == 30 then
      DeleteResource("luk_john02");
      DeleteResource("luk_john_all");    
      DeleteResource("luk_john11");     
      DeleteResource("luk_john12");   
    WriteToConsole("Del all res \n")
    setcurentleaf("john_house",11,0);    
    WriteToConsole("setcurentleaf \n")
    if flags.luk_jones  and (not flags.luk_jonesM) then
       flags.luk_jonesM=true;
      speciale_action(2,5);
      speciale_action(2,3);
      ActivateObject(3,true);
      Set_Anim_Cur(3,2);
      AddParticleToObject(3,"luk_john",719,598);
      MoveEmiter("luk_john",719,598);
      StartEmiter("luk_john");           
    end;
    Block_Show_Cur(false);
    if flags.luk_john then

      WriteToConsole("StopEmiter \n")
      if not flags.luk_jonesM then
          flags.luk_jonesM=true;
          speciale_action(2,5);
          speciale_action(2,3);
          WriteToConsole("speciale_action \n")
      end;
      Set_Anim_Cur(3,3);
      Set_Anim_Cur(5,3);
      ActivateObject(3,false);      
      ActivateObject(5,false);
 
      StopEmiter("luk_john");
      CreatePlashechka(900000,"600")    
      -- fromMINIJONES=true
      -- WaitRender()
    end;
  return;end;
  
  if sender==50 then
        Block_Show_Cur(true);
        StartTimer(88823,1);
  return;end;
  
  if sender == 1 then

    if obj_id == 6 then
      if obj.ventyl ~= nil and attachedID == obj.ventyl.id then 
        RemObjFromMouse()
        UnStoreObj(attachedID);
        speciale_action(2,4,true,1);
        ActivateObject(6,false)
        Block_Show_Cur(true);
      return; end;
      if attachedID~=-1 and ((obj.ventyl~=nil and attachedID ~= obj.ventyl.id) or (obj.ventyl==nil )) then
            RemObjFromMouse()
            CreatePlashechka(900000,"1000")
      return;end;          
      CreatePlashechka(900000,"289")
    return; end;
    if obj_id == 8 then
        RemObjFromMouse()
        flags.luk_john = true;
        StoreObj(obj.jhndk.id,8,"291",335,360,"dnevnik",317,223,400000)  
        flags.jhndk=true;
    return; end;
  return ;end;
  
  if sender == 16 then
    if obj_id == 4 then
      counter=counter+1;
      speciale_action(2,4,true,0.7);
      speciale_action(2,3,true,1);
      
    return; end;
    if obj_id == 3 then
      if counter>2 then
      playeffect("luk")
      speciale_action(2,3,true);
      speciale_action(2,7,true);
      speciale_action(2,6,true);
      speciale_action(2,8,true);
      speciale_action(2,9,true);
      Set_Anim_Cur(8,4);
      Set_Anim_Cur(9,4);
      Block_Show_Cur(false);
      flags.luk_jones=true;     
      return; end;     
      speciale_action(2,4,true,1);
      speciale_action(2,3,true,0.7);      
    return; end;
  return; end;
  
  if sender == 100 then
  return; end;
  
  if sender == 36 then
    if obj_id == 88823 then
      
      clear_satelite_leaf("john_house");
    return; end;
  return; end;


end
function SheetSwitched(nCount)
end;