def METHOD_NAME(self,state,id,events):
    global LocalAvatar
    global isOpen
    if id == actClickableBook.id and state and PtWasLocallyNotified(self.key):
        PtLoadDialog(DialogName,self.key)
        self.SetStdGUIVisibility(0)
        PtShowDialog(DialogName)
        RespOpen.run(self.key)
        isOpen = 1
    elif id == actClickableBook.id and not state and PtWasLocallyNotified(self.key):
        if not isOpen:
            self.SetStdGUIVisibility(0)
            PtShowDialog(DialogName)
            RespOpen.run(self.key)
            isOpen = 1
    elif id == RespOpen.id:
        RespLoop.run(self.key)