function SheetSwitched (ncount)
	StopSheet=true;
return;end;

function Timer(ncount, Param1)
	if not StopSheet then
		AlfingSheet();
		StopSheet=false;
	return;end;
return;end;

function SelectRandom()
    selectrandomobject(1.5,54);
end;

function MessageFromMenu(nCount,Param1)
if Param1==2000029 then
	ScrollLeft();
return;end;
if Param1==2000030 then
	ScrollRight();
return;end;
showoptons(0);
return;end;

function gameinput (sender,obj_id,attachedID)
	
	if sender == 2 then
		MessageProc(sender,obj_id);
	return;end;	
	if sender==16 then
		if obj_id==502 or obj_id==500 then
		   BlockCursor(false);
		return;end;

		if obj_id==501 then
			BlockCursor(false);
		return;end;		
		
		if obj_id==22 then
			BlockCursor(false);
		return;end;		

	return;end;
	
	if sender==15 then
		if obj_id==501 then
		    flags.whole_darkness=false;
			BlockCursor(false);
		return;end;
		
		if obj_id==502 then
		if not flags.levelcomplete then
		   BlockCursor(false);
		   ShowMenu(true);
			Set_Cursor(54,2);
			savegame(SaveLevel())
		return;end;	
		return;end;
		
	return;end;	
	if pause_state then
		if sender==1 or sender==6 or sender==14 then
			pause_state=false;
			set_visible_object(11111,false);
		end;	
	return;end;
	if sender == 1 then 
	
			if obj_id==501 then
				if flags.levelcomplete then
					delete_tree_leaf("Root","kabinet");
					delete_tree_leaf("Root","photolab")
					delete_tree_leaf("Root","mini");
					delete_tree_leaf("Root","mini1");
					delete_tree_leaf("Root","mini2");
					delete_tree_leaf("Root","comics");
					setnextlavel(23);
					loadlavel();
				return;end;		
				DarkScreen(false);
				speciale_action(2,502,true);
				
			return;end;
	
	if obj_id==54 then
		speciale_action(2,54,true,2);
		Set_Cursor(54,3);
		Set_Cursor(71,1);
	return;end;

	if obj_id==71 then
	

			setcurentleaf("photolab",2,1);
			savegame(SaveLevel())
			ShowMenu(false);

			AddParticleToObject(37,"water",0,0,0,0);
			AddParticleToObject(35,"probirka_b",0,0,0,0);
			AddParticleToObject(36,"probirka_y",0,0,0,0);
			AddParticleToObject(41,"banka",0,0,0,0);	
			DarkScreen(true);
			speciale_action(2,503,true);
			speciale_action(4,503)
	return;end;
	
	return; end;
	
	
	
end
