A javascript port of mojombo/chronic