Basic Javascript function to check for scheduling conflicts