refactored IsNearPolygon()
fixed bug with rendering filled polygons for deleted parts
refactored selected_poly to be global variable and removed unneeded private variables
refactored selectObject() and unselectObjects() as global functions
simplified DrawAllPolygons()
refactored DeleteSelectedPolygon()
created AllAnnotations global variable and cleaned up private variables inside canvas.js