Rewrote to use google js api