function OnClick()
	if s.dlg_s01_01==0 then
    Dialogs.ShowDialogGui(true)
 		Dialog("dlg_s01_01")
		Dialog("dlg_s01_02")
 		if s.i_invitation==1 then
 				Dialog("dlg_s01_04")
 				Delete("i_invitation") 
				Widgets.notes_window.AddEntry(2)
 		else
 				Dialog("dlg_s01_03")
				Sleep(500)
				Talk("com_s01_0201_01_hero")	
 		end
    Dialogs.ShowDialogGui(false)
 	end
end

function OnItem(item)
	if item =="i_invitation" then
	MystInventory:GetActive():ReleaseItem()
		if s.dlg_s01_01==0 then
		Dialogs.ShowDialogGui(true)
 		Dialog("dlg_s01_01")
		Dialog("dlg_s01_02")
			if s.i_invitation==1 then
					Dialog("dlg_s01_04")
					Delete("i_invitation") 
					Widgets.notes_window.AddEntry(2)
			else
					Dialog("dlg_s01_03")
					Sleep(500)
					Talk("com_s01_0201_01_hero")	
			end
		Dialogs.ShowDialogGui(false)
		end
	end
end


