finalised javascript; changed markers from dots to flags