add location function;add window status alert function