I'm sorry but this is almost as vague as you can get with a question...
I understand the basis of your question in that you want to use javascript to apply color to a calendar of yours, however without knowing anything about the calendar it's kind of hard to offer a solution. Where does the calendar come from? How is it generated? What does the source/HTML of the calendar look like?
The answers to those questions can change how you will use javascript to apply color to the calendar.