add js functions: State,getUrl and time