updated do_costdivide and index with upload button

index with upload button needs to be integrated with the other index.
The result from do_costdivide.js is now a global variable.