JavaScript-implementation of tGAP-model