my javascript common methods