big changes to write_js
fixed the default colour in write_kml