fixed some javascript calendar bugs