Begin initial port of CTRC to JavaScript

def videorender() ported