1. A method for handling user-interface gestures in non-rectangular regions of a graphical user interface, the method comprising: creating a class comprising a first event handler for an onmouseover event and a second event handler for an onmouseout event; adding each of a group of graphical elements to the class, wherein adding a graphical element to the class comprises adding a reference to the graphical element to the class and attaching the first and second event handlers to the graphical element; identifying a specific graphical element in the group that triggered an invocation of one of the first and second event handlers; determining the closest border of the specific graphical element to a mouse pointer; stopping one of the onmouseover and onmouseout events from propagating in the event another graphical element in the group shares the closest border; and allowing one of the onmouseover and onmouseout events to propagate in the event another graphical element in the group does not share the closest border.