fFirstTime=1
loadresource("data\\13\\11\\0005.png","zamok_turmy05",1005);
loadresource("data\\13\\11\\zamok_turmy.png","zamok_turmy",1006);
loadresource("data\\13\\11\\0028.jpg","zamok_turmy28",1028);

AddObjForCur()
SetFlagsForSatButtons()

addstaticobjecttogame(1005,"zamok_turmy05",12 ,27 ,""); --рамка
CloseBtnX,CloseBtnY,SkipBtnX,SkipBtnY,HelpBtnX,HelpBtnY=Coords(1005)

HelpWidth=36
HelpHeight=36
CreateHelpBtn(HelpBtnX,HelpBtnY,36,36);

AddSkipBtn(SkipBtnX,SkipBtnY);

CloseWidth=34
CloseHeight=34
CreateCloseBtn(CloseBtnX,CloseBtnY);


addstaticobjecttogame(1030,"zamok_turmy"    ,858,161,        "",790,926,44,93);--++      
speciale_action(2,1030);  


addactivobjecttogame(1007,"zamok_turmy",449,484,"","",0,0,861,0,126,125); --кн отжата
Set_Anim_Cur(1007,4)
addstaticobjecttogame(1006,"zamok_turmy",445,481,"",861,809,126,125); --кн нажата
addactivobjecttogame(1016,"zamok_turmy",400+19,263+36,"","",0,0,790,114,65,116); --вставленный ключ 8
addactivobjecttogame(1017,"zamok_turmy",190+19,263+36,"","",0,0,790,462,65,116); --вставленный ключ 7
addactivobjecttogame(1018,"zamok_turmy",330+19,263+36,"","",0,0,725,114,65,116); --вставленный ключ 6
addactivobjecttogame(1019,"zamok_turmy",260+19,263+36,"","",0,0,790,230,65,116); --вставленный ключ 5
addactivobjecttogame(1020,"zamok_turmy",610+19,263+36,"","",0,0,790,694,65,116); --вставленный ключ 4
addactivobjecttogame(1021,"zamok_turmy",680+19,263+36,"","",0,0,790,578,65,116); --вставленный ключ 3
addactivobjecttogame(1022,"zamok_turmy",540+19,263+36,"","",0,0,790,346,65,116); --вставленный ключ 2
addactivobjecttogame(1023,"zamok_turmy",470+19,263+36,"","",0,0,790,810,65,116); --вставленный ключ 1

Fields={187+4,257+4,327+4,397+4,467+4,537+4,607+4,677+4,747+4}

for i = 1016,1023,1 do
  --Set_Anim_Cur(i,4)
  OnMouseOver(i);
end;

lastplawka=-1
podsv= false;


addstaticobjecttogame(1024,"zamok_turmy",827,127,"",167,0,175,474); --защелка закрыта
addstaticobjecttogame(1025,"zamok_turmy",835,127,"",0,0,167,479); --защелка открыта
speciale_action(2,1025);
addstaticobjecttogame(1026,"zamok_turmy",37 ,50 ,"",342,0,120,570); --закл откр
speciale_action(2,1026);
addstaticobjecttogame(1027,"zamok_turmy",32 ,106,"",462,0,125,489); --закл закрыт
addstaticobjecttogame(1028,"zamok_turmy28",19 ,36 ,"",0,0,983,584); --бг

  if s_obj>0 then
  AddObjToMouse(s_obj)
  s_obj=0
  end;

Block_Show_Cur(true)
WaitRender();
