use javascript to implement pos system