JS separeted from cm.html