partial javascript for new line items. Incomplete