You can buy this project and download/modify it how often you want.
<polygon> points attribute 'onload' <polygon> getPoints() in 'onload' getNumberOfItems polygon with clear getItem first point insertItemBefore inserted point replaceItem replaced point removeItem removed point initialize/appendItem intialized point appended point setAttribute before after setAttribute2 point 0 before point 0 after