Helper functions for Raphael JS